@salla.sa/twilight-theme-engine 1.0.206 → 1.0.207

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 (251) hide show
  1. package/dist/{AddToCartForm-SZ56QSZ7.js → AddToCartForm-RSZHHCOS.js} +3 -3
  2. package/dist/{AddToCartForm-SZ56QSZ7.js.map → AddToCartForm-RSZHHCOS.js.map} +1 -1
  3. package/dist/{BlogAuthorPage-M3OCNQ7D.js → BlogAuthorPage-ALMTZ3TF.js} +19 -19
  4. package/dist/{BlogAuthorPage-M3OCNQ7D.js.map → BlogAuthorPage-ALMTZ3TF.js.map} +1 -1
  5. package/dist/{BlogCategoryPage-CMKE3QCZ.js → BlogCategoryPage-VIXBXUQV.js} +19 -19
  6. package/dist/{BlogCategoryPage-CMKE3QCZ.js.map → BlogCategoryPage-VIXBXUQV.js.map} +1 -1
  7. package/dist/{BlogPage-GHLMIE3Z.js → BlogPage-3TWE7ZHP.js} +17 -17
  8. package/dist/{BlogPage-GHLMIE3Z.js.map → BlogPage-3TWE7ZHP.js.map} +1 -1
  9. package/dist/{BlogSinglePage-M75XQBWT.js → BlogSinglePage-SC3ESA7V.js} +17 -17
  10. package/dist/{BlogSinglePage-M75XQBWT.js.map → BlogSinglePage-SC3ESA7V.js.map} +1 -1
  11. package/dist/{BlogTagPage-ORFGMIBH.js → BlogTagPage-DS7RFXLX.js} +19 -19
  12. package/dist/{BlogTagPage-ORFGMIBH.js.map → BlogTagPage-DS7RFXLX.js.map} +1 -1
  13. package/dist/{BrandsPage-VIVRITLO.js → BrandsPage-UZ7LSXC7.js} +18 -18
  14. package/dist/{BrandsPage-VIVRITLO.js.map → BrandsPage-UZ7LSXC7.js.map} +1 -1
  15. package/dist/{Breadcrumb-Z6OBJQZM.js → Breadcrumb-NMSPOKZC.js} +17 -17
  16. package/dist/{Breadcrumb-Z6OBJQZM.js.map → Breadcrumb-NMSPOKZC.js.map} +1 -1
  17. package/dist/{CanvasOverlay-TYG2WK2Z.js → CanvasOverlay-F64M22YD.js} +3 -3
  18. package/dist/{CanvasOverlay-TYG2WK2Z.js.map → CanvasOverlay-F64M22YD.js.map} +1 -1
  19. package/dist/{CartItem-EL2F4CY6.js → CartItem-SZZQW53E.js} +17 -17
  20. package/dist/{CartItem-EL2F4CY6.js.map → CartItem-SZZQW53E.js.map} +1 -1
  21. package/dist/{CartSummary-KL63ND3A.js → CartSummary-A3GRFQVN.js} +17 -17
  22. package/dist/{CartSummary-KL63ND3A.js.map → CartSummary-A3GRFQVN.js.map} +1 -1
  23. package/dist/{Copyright-3ZSGL24B.js → Copyright-2AQ5UTMJ.js} +3 -3
  24. package/dist/{Copyright-3ZSGL24B.js.map → Copyright-2AQ5UTMJ.js.map} +1 -1
  25. package/dist/{CustomerLayout-AD7C46E5.js → CustomerLayout-YX5RLRJ6.js} +17 -17
  26. package/dist/{CustomerLayout-AD7C46E5.js.map → CustomerLayout-YX5RLRJ6.js.map} +1 -1
  27. package/dist/{Footer-BOHOZDHS.js → Footer-RGUHNCXE.js} +3 -3
  28. package/dist/{Footer-BOHOZDHS.js.map → Footer-RGUHNCXE.js.map} +1 -1
  29. package/dist/GoogleTag-PM23J7UJ.js +15 -0
  30. package/dist/{GoogleTag-VMMAYSX6.js.map → GoogleTag-PM23J7UJ.js.map} +1 -1
  31. package/dist/{Header-MKASJTCQ.js → Header-EUHFF564.js} +8 -8
  32. package/dist/{Header-MKASJTCQ.js.map → Header-EUHFF564.js.map} +1 -1
  33. package/dist/{LatestProducts-7VRYRZZU.js → LatestProducts-5GW3LWNF.js} +19 -19
  34. package/dist/{LatestProducts-7VRYRZZU.js.map → LatestProducts-5GW3LWNF.js.map} +1 -1
  35. package/dist/{LoyaltyPage-ZAKVJX4D.js → LoyaltyPage-FSBFMMDK.js} +17 -17
  36. package/dist/{LoyaltyPage-ZAKVJX4D.js.map → LoyaltyPage-FSBFMMDK.js.map} +1 -1
  37. package/dist/{LoyaltyPointsPage-D23DNGEM.js → LoyaltyPointsPage-MPZPTC5W.js} +6 -6
  38. package/dist/{LoyaltyPointsPage-D23DNGEM.js.map → LoyaltyPointsPage-MPZPTC5W.js.map} +1 -1
  39. package/dist/{MainMenu-VS6ACI36.js → MainMenu-3FRRSA75.js} +5 -5
  40. package/dist/{MainMenu-VS6ACI36.js.map → MainMenu-3FRRSA75.js.map} +1 -1
  41. package/dist/{MasterLayout-6NLIIYLH.js → MasterLayout-BZHQD3HJ.js} +17 -17
  42. package/dist/{MasterLayout-6NLIIYLH.js.map → MasterLayout-BZHQD3HJ.js.map} +1 -1
  43. package/dist/{MobileMenu-HI4UOJAG.js → MobileMenu-FEUDYZ42.js} +18 -18
  44. package/dist/{MobileMenu-HI4UOJAG.js.map → MobileMenu-FEUDYZ42.js.map} +1 -1
  45. package/dist/{NotificationsPage-MDH3WV25.js → NotificationsPage-G3DQBWML.js} +17 -17
  46. package/dist/{NotificationsPage-MDH3WV25.js.map → NotificationsPage-G3DQBWML.js.map} +1 -1
  47. package/dist/{OrderSinglePage-DZVUGLTR.js → OrderSinglePage-73G5GUJJ.js} +18 -18
  48. package/dist/{OrderSinglePage-DZVUGLTR.js.map → OrderSinglePage-73G5GUJJ.js.map} +1 -1
  49. package/dist/{OrdersPage-Z64EXGTP.js → OrdersPage-BY5EKZDD.js} +17 -17
  50. package/dist/{OrdersPage-Z64EXGTP.js.map → OrdersPage-BY5EKZDD.js.map} +1 -1
  51. package/dist/{PageSingle-O3KTWC2Q.js → PageSingle-UNS2BYHY.js} +3 -3
  52. package/dist/{PageSingle-O3KTWC2Q.js.map → PageSingle-UNS2BYHY.js.map} +1 -1
  53. package/dist/{ProductDetails-EGY4N3ZK.js → ProductDetails-JCD5BW76.js} +5 -5
  54. package/dist/{ProductDetails-EGY4N3ZK.js.map → ProductDetails-JCD5BW76.js.map} +1 -1
  55. package/dist/{ProfilePage-UWUJPOYA.js → ProfilePage-KICJ57GW.js} +17 -17
  56. package/dist/{ProfilePage-UWUJPOYA.js.map → ProfilePage-KICJ57GW.js.map} +1 -1
  57. package/dist/{ReviewsPage-G6BXHOSU.js → ReviewsPage-DTPR4TD4.js} +3 -3
  58. package/dist/{ReviewsPage-G6BXHOSU.js.map → ReviewsPage-DTPR4TD4.js.map} +1 -1
  59. package/dist/{SeoCartWidget-R4EVCBXK.js → SeoCartWidget-MNGAOTET.js} +17 -17
  60. package/dist/{SeoCartWidget-R4EVCBXK.js.map → SeoCartWidget-MNGAOTET.js.map} +1 -1
  61. package/dist/{SettingsPage-C2EIQZ2T.js → SettingsPage-IILCN4S6.js} +17 -17
  62. package/dist/{SettingsPage-C2EIQZ2T.js.map → SettingsPage-IILCN4S6.js.map} +1 -1
  63. package/dist/{StoreClosedNotification-AWNBBZJR.js → StoreClosedNotification-BFJHP22E.js} +18 -18
  64. package/dist/{StoreClosedNotification-AWNBBZJR.js.map → StoreClosedNotification-BFJHP22E.js.map} +1 -1
  65. package/dist/{TestimonialsPage-INUAUMKU.js → TestimonialsPage-R4QD6ZZG.js} +3 -3
  66. package/dist/{TestimonialsPage-INUAUMKU.js.map → TestimonialsPage-R4QD6ZZG.js.map} +1 -1
  67. package/dist/{ThankYouPage-GXC7W3HK.js → ThankYouPage-UIGRVDUY.js} +17 -17
  68. package/dist/{ThankYouPage-GXC7W3HK.js.map → ThankYouPage-UIGRVDUY.js.map} +1 -1
  69. package/dist/{WalletPage-TXJKPC5N.js → WalletPage-DSUVR6M5.js} +18 -18
  70. package/dist/{WalletPage-TXJKPC5N.js.map → WalletPage-DSUVR6M5.js.map} +1 -1
  71. package/dist/{WebMcpTools-X33C7Z2Q.js → WebMcpTools-UQF5UD7W.js} +5 -5
  72. package/dist/{WebMcpTools-X33C7Z2Q.js.map → WebMcpTools-UQF5UD7W.js.map} +1 -1
  73. package/dist/{WishlistPage-TEP3OEU6.js → WishlistPage-ILCHKMFE.js} +19 -19
  74. package/dist/{WishlistPage-TEP3OEU6.js.map → WishlistPage-ILCHKMFE.js.map} +1 -1
  75. package/dist/api/advertisement.js +2 -2
  76. package/dist/api/apps.js +2 -2
  77. package/dist/api/blog.js +3 -3
  78. package/dist/api/brands.js +3 -3
  79. package/dist/api/cart.js +3 -3
  80. package/dist/api/category.js +3 -3
  81. package/dist/api/client.js +1 -1
  82. package/dist/api/custom-url.js +2 -2
  83. package/dist/api/home.js +2 -2
  84. package/dist/api/loyalty.js +3 -3
  85. package/dist/api/menu.js +2 -2
  86. package/dist/api/notification.js +2 -2
  87. package/dist/api/order.js +3 -3
  88. package/dist/api/page.d.ts +15 -0
  89. package/dist/api/page.d.ts.map +1 -1
  90. package/dist/api/page.js +3 -3
  91. package/dist/api/product.js +3 -3
  92. package/dist/api/profile.js +1 -1
  93. package/dist/api/store.js +2 -2
  94. package/dist/api/translations.js +2 -2
  95. package/dist/api/user.js +2 -2
  96. package/dist/api/wallet.js +2 -2
  97. package/dist/api/wishlist.js +4 -4
  98. package/dist/{chunk-GGXODCMG.js → chunk-2WLFUHGI.js} +4 -4
  99. package/dist/{chunk-GGXODCMG.js.map → chunk-2WLFUHGI.js.map} +1 -1
  100. package/dist/{chunk-UHDV3USV.js → chunk-4D4AAOP6.js} +3 -3
  101. package/dist/{chunk-UHDV3USV.js.map → chunk-4D4AAOP6.js.map} +1 -1
  102. package/dist/{chunk-SAZP2PYW.js → chunk-4QJJA3I3.js} +3 -3
  103. package/dist/{chunk-SAZP2PYW.js.map → chunk-4QJJA3I3.js.map} +1 -1
  104. package/dist/{chunk-V45JKRB5.js → chunk-4QSG6MWL.js} +14 -14
  105. package/dist/{chunk-V45JKRB5.js.map → chunk-4QSG6MWL.js.map} +1 -1
  106. package/dist/{chunk-2XBIMXCM.js → chunk-5LQ6OAAH.js} +4 -4
  107. package/dist/{chunk-2XBIMXCM.js.map → chunk-5LQ6OAAH.js.map} +1 -1
  108. package/dist/{chunk-D2SVAGSH.js → chunk-5TECTHHK.js} +5 -5
  109. package/dist/{chunk-D2SVAGSH.js.map → chunk-5TECTHHK.js.map} +1 -1
  110. package/dist/{chunk-NC2G27YJ.js → chunk-5ZFU7LTC.js} +5 -5
  111. package/dist/{chunk-NC2G27YJ.js.map → chunk-5ZFU7LTC.js.map} +1 -1
  112. package/dist/{chunk-AB2LBQTZ.js → chunk-6U2R3COR.js} +6 -6
  113. package/dist/{chunk-AB2LBQTZ.js.map → chunk-6U2R3COR.js.map} +1 -1
  114. package/dist/{chunk-GNECZLCV.js → chunk-7NEJCQQ3.js} +3 -3
  115. package/dist/{chunk-GNECZLCV.js.map → chunk-7NEJCQQ3.js.map} +1 -1
  116. package/dist/{chunk-L3K5KK2Q.js → chunk-A7FCCVN4.js} +3 -3
  117. package/dist/{chunk-L3K5KK2Q.js.map → chunk-A7FCCVN4.js.map} +1 -1
  118. package/dist/{chunk-JIKXE3YR.js → chunk-AGQAFP7M.js} +3 -3
  119. package/dist/{chunk-JIKXE3YR.js.map → chunk-AGQAFP7M.js.map} +1 -1
  120. package/dist/{chunk-K6LWHEGZ.js → chunk-AIBTJH3U.js} +5 -5
  121. package/dist/{chunk-K6LWHEGZ.js.map → chunk-AIBTJH3U.js.map} +1 -1
  122. package/dist/{chunk-WUC25XBI.js → chunk-B2VDGIS6.js} +2 -2
  123. package/dist/{chunk-WUC25XBI.js.map → chunk-B2VDGIS6.js.map} +1 -1
  124. package/dist/{chunk-NRLXONDO.js → chunk-EES7CISM.js} +3 -3
  125. package/dist/{chunk-NRLXONDO.js.map → chunk-EES7CISM.js.map} +1 -1
  126. package/dist/{chunk-KXWDMETN.js → chunk-F5CBGBXC.js} +3 -3
  127. package/dist/{chunk-KXWDMETN.js.map → chunk-F5CBGBXC.js.map} +1 -1
  128. package/dist/{chunk-YDY36E2Z.js → chunk-FJF6YEHY.js} +7 -7
  129. package/dist/{chunk-YDY36E2Z.js.map → chunk-FJF6YEHY.js.map} +1 -1
  130. package/dist/{chunk-2ZA6SOF6.js → chunk-H2ABV6TH.js} +3 -3
  131. package/dist/{chunk-2ZA6SOF6.js.map → chunk-H2ABV6TH.js.map} +1 -1
  132. package/dist/{chunk-3WNU52EV.js → chunk-H6FKLBCS.js} +4 -4
  133. package/dist/{chunk-3WNU52EV.js.map → chunk-H6FKLBCS.js.map} +1 -1
  134. package/dist/{chunk-LGB6KWZN.js → chunk-IOSJKP7Y.js} +3 -3
  135. package/dist/{chunk-LGB6KWZN.js.map → chunk-IOSJKP7Y.js.map} +1 -1
  136. package/dist/{chunk-SWEAR4EL.js → chunk-IPF6LCPB.js} +7 -7
  137. package/dist/{chunk-SWEAR4EL.js.map → chunk-IPF6LCPB.js.map} +1 -1
  138. package/dist/{chunk-MU7FXR2Q.js → chunk-IUHIUV26.js} +5 -5
  139. package/dist/{chunk-MU7FXR2Q.js.map → chunk-IUHIUV26.js.map} +1 -1
  140. package/dist/{chunk-SQNREASU.js → chunk-KGNT2I5N.js} +4 -4
  141. package/dist/{chunk-SQNREASU.js.map → chunk-KGNT2I5N.js.map} +1 -1
  142. package/dist/{chunk-OIQNGWO3.js → chunk-KI7K5S5Q.js} +4 -4
  143. package/dist/{chunk-OIQNGWO3.js.map → chunk-KI7K5S5Q.js.map} +1 -1
  144. package/dist/{chunk-EOC2GILU.js → chunk-KIGPESAH.js} +4 -4
  145. package/dist/{chunk-EOC2GILU.js.map → chunk-KIGPESAH.js.map} +1 -1
  146. package/dist/{chunk-UOS4ZNQ2.js → chunk-MF74MEOT.js} +29 -4
  147. package/dist/chunk-MF74MEOT.js.map +1 -0
  148. package/dist/{chunk-YGREWGF7.js → chunk-MIXZNLOC.js} +4 -4
  149. package/dist/{chunk-YGREWGF7.js.map → chunk-MIXZNLOC.js.map} +1 -1
  150. package/dist/{chunk-QVXTEYE4.js → chunk-MSL3DEDB.js} +3 -3
  151. package/dist/{chunk-QVXTEYE4.js.map → chunk-MSL3DEDB.js.map} +1 -1
  152. package/dist/{chunk-IN7XKP4U.js → chunk-NCBRZRAP.js} +3 -3
  153. package/dist/{chunk-IN7XKP4U.js.map → chunk-NCBRZRAP.js.map} +1 -1
  154. package/dist/{chunk-YF4DEYUZ.js → chunk-NPRMYIY4.js} +3 -3
  155. package/dist/{chunk-YF4DEYUZ.js.map → chunk-NPRMYIY4.js.map} +1 -1
  156. package/dist/{chunk-FREN7T2I.js → chunk-OFKVQZYA.js} +3 -3
  157. package/dist/{chunk-FREN7T2I.js.map → chunk-OFKVQZYA.js.map} +1 -1
  158. package/dist/{chunk-RGKUQJMM.js → chunk-PCD3PFHR.js} +4 -4
  159. package/dist/{chunk-RGKUQJMM.js.map → chunk-PCD3PFHR.js.map} +1 -1
  160. package/dist/{chunk-RQU2X5RP.js → chunk-PRAMCUB3.js} +19 -19
  161. package/dist/{chunk-RQU2X5RP.js.map → chunk-PRAMCUB3.js.map} +1 -1
  162. package/dist/{chunk-HLSEXI5X.js → chunk-PXFFPKSW.js} +4 -4
  163. package/dist/{chunk-HLSEXI5X.js.map → chunk-PXFFPKSW.js.map} +1 -1
  164. package/dist/{chunk-KJGZ3GR3.js → chunk-Q5WFMQB5.js} +3 -3
  165. package/dist/{chunk-KJGZ3GR3.js.map → chunk-Q5WFMQB5.js.map} +1 -1
  166. package/dist/{chunk-5XGJ7OTK.js → chunk-Q5YDLJTE.js} +3 -3
  167. package/dist/{chunk-5XGJ7OTK.js.map → chunk-Q5YDLJTE.js.map} +1 -1
  168. package/dist/{chunk-J2ONCJFP.js → chunk-QFJ3K74X.js} +3 -3
  169. package/dist/{chunk-J2ONCJFP.js.map → chunk-QFJ3K74X.js.map} +1 -1
  170. package/dist/{chunk-YRI77IKE.js → chunk-QKQVXVC5.js} +4 -4
  171. package/dist/{chunk-YRI77IKE.js.map → chunk-QKQVXVC5.js.map} +1 -1
  172. package/dist/{chunk-A4XSOGW7.js → chunk-QP7AVGLQ.js} +7 -7
  173. package/dist/{chunk-A4XSOGW7.js.map → chunk-QP7AVGLQ.js.map} +1 -1
  174. package/dist/{chunk-U233JWEI.js → chunk-RSZPZRTD.js} +4 -4
  175. package/dist/{chunk-U233JWEI.js.map → chunk-RSZPZRTD.js.map} +1 -1
  176. package/dist/{chunk-QBVKHDAP.js → chunk-S6EGQM36.js} +3 -3
  177. package/dist/{chunk-QBVKHDAP.js.map → chunk-S6EGQM36.js.map} +1 -1
  178. package/dist/{chunk-PC3CQKE2.js → chunk-SGJDENMI.js} +3 -3
  179. package/dist/{chunk-PC3CQKE2.js.map → chunk-SGJDENMI.js.map} +1 -1
  180. package/dist/{chunk-TILBL7L2.js → chunk-TFHTXAY4.js} +4 -4
  181. package/dist/{chunk-TILBL7L2.js.map → chunk-TFHTXAY4.js.map} +1 -1
  182. package/dist/{chunk-UKPNHU6M.js → chunk-TT3RMAWV.js} +3 -3
  183. package/dist/{chunk-UKPNHU6M.js.map → chunk-TT3RMAWV.js.map} +1 -1
  184. package/dist/{chunk-2SXDYAGG.js → chunk-VMZCTYR4.js} +3 -3
  185. package/dist/{chunk-2SXDYAGG.js.map → chunk-VMZCTYR4.js.map} +1 -1
  186. package/dist/{chunk-MHM5XFTB.js → chunk-VNX4SSBX.js} +3 -3
  187. package/dist/{chunk-MHM5XFTB.js.map → chunk-VNX4SSBX.js.map} +1 -1
  188. package/dist/{chunk-EYGDVKW7.js → chunk-VXWBXATO.js} +4 -4
  189. package/dist/{chunk-EYGDVKW7.js.map → chunk-VXWBXATO.js.map} +1 -1
  190. package/dist/{chunk-HZT7H22K.js → chunk-VZA6B566.js} +4 -4
  191. package/dist/{chunk-HZT7H22K.js.map → chunk-VZA6B566.js.map} +1 -1
  192. package/dist/{chunk-BQBM36PF.js → chunk-WBJOEOTV.js} +4 -4
  193. package/dist/{chunk-BQBM36PF.js.map → chunk-WBJOEOTV.js.map} +1 -1
  194. package/dist/{chunk-WMSIZAHA.js → chunk-WNWIZIM2.js} +3 -3
  195. package/dist/{chunk-WMSIZAHA.js.map → chunk-WNWIZIM2.js.map} +1 -1
  196. package/dist/chunk-WV2V3RVP.js +33 -0
  197. package/dist/chunk-WV2V3RVP.js.map +1 -0
  198. package/dist/components/cart/index.js +1 -1
  199. package/dist/components/common/index.js +1 -1
  200. package/dist/components/drawer/index.js +15 -15
  201. package/dist/components/home/index.js +20 -20
  202. package/dist/components/layout/index.js +4 -4
  203. package/dist/components/product/index.js +17 -17
  204. package/dist/components/store/index.js +16 -16
  205. package/dist/components/tracking/index.js +6 -6
  206. package/dist/{custom-urls-2MFMNEFR.js → custom-urls-PIQDXCXN.js} +7 -7
  207. package/dist/{custom-urls-2MFMNEFR.js.map → custom-urls-PIQDXCXN.js.map} +1 -1
  208. package/dist/dev/editor/index.js +1 -1
  209. package/dist/dev/index.js +1 -1
  210. package/dist/{document-class-S7KZVXXK.js → document-class-4IX3ARNH.js} +17 -17
  211. package/dist/{document-class-S7KZVXXK.js.map → document-class-4IX3ARNH.js.map} +1 -1
  212. package/dist/hooks/index.js +15 -15
  213. package/dist/hooks/useGtm.js +15 -15
  214. package/dist/hooks/useMoney.js +15 -15
  215. package/dist/hooks/useStore.js +15 -15
  216. package/dist/hooks/useUser.js +3 -3
  217. package/dist/index.js +15 -15
  218. package/dist/{navigation-IRWH4CHF.js → navigation-FNSXWOVU.js} +4 -4
  219. package/dist/{navigation-IRWH4CHF.js.map → navigation-FNSXWOVU.js.map} +1 -1
  220. package/dist/{navigation-RFYZOBRP.js → navigation-HVGJE3F6.js} +5 -5
  221. package/dist/{navigation-RFYZOBRP.js.map → navigation-HVGJE3F6.js.map} +1 -1
  222. package/dist/{not-found-JKV76IBT.js → not-found-ROFGDF26.js} +18 -18
  223. package/dist/{not-found-JKV76IBT.js.map → not-found-ROFGDF26.js.map} +1 -1
  224. package/dist/providers/index.js +15 -15
  225. package/dist/routes/account/orders.js +4 -4
  226. package/dist/routes/account.js +13 -13
  227. package/dist/routes/blog.js +8 -8
  228. package/dist/routes/brands.js +4 -4
  229. package/dist/routes/cart.js +25 -25
  230. package/dist/routes/home.js +21 -21
  231. package/dist/routes/index.js +8 -8
  232. package/dist/routes/loyalty.js +5 -5
  233. package/dist/routes/page.js +4 -4
  234. package/dist/routes/product-listing.js +25 -25
  235. package/dist/routes/product.js +24 -24
  236. package/dist/routes/seo-redirects.d.ts +3 -2
  237. package/dist/routes/seo-redirects.d.ts.map +1 -1
  238. package/dist/routes/seo-redirects.js +8 -8
  239. package/dist/routes/testimonials.js +2 -2
  240. package/dist/routes/thank-you.js +4 -4
  241. package/dist/skeleton.js +23 -23
  242. package/dist/{store-lookup-IPVXW4UI.js → store-lookup-WUMF73WT.js} +8 -8
  243. package/dist/{store-lookup-IPVXW4UI.js.map → store-lookup-WUMF73WT.js.map} +1 -1
  244. package/dist/tanstack.js +17 -17
  245. package/dist/utils/index.js +2 -2
  246. package/package.json +1 -1
  247. package/tailwind/routes/seo-redirects.ts.txt +47 -2
  248. package/dist/GoogleTag-VMMAYSX6.js +0 -15
  249. package/dist/chunk-ACOK7N5Y.js +0 -21
  250. package/dist/chunk-ACOK7N5Y.js.map +0 -1
  251. package/dist/chunk-UOS4ZNQ2.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/lib/analytics/gtm-page.ts"],"names":["user"],"mappings":";;;;;;;;AAuCO,IAAM,qBAAA,GAAwB;AAErC,IAAI,KAAA,GAAuB,QAAQ,OAAA,EAAQ;AAC3C,IAAI,iBAAA,GAAoB,KAAA;AACxB,IAAI,WAAA,GAA6B,IAAA;AACjC,IAAI,oBAAgC,MAAM;AAAC,CAAA;AAC3C,IAAI,gBAAgB,IAAI,OAAA,CAAc,CAAC,OAAA,KAAa,oBAAoB,OAAQ,CAAA;AAChF,IAAI,eAAA,GAAuC,IAAA;AAE3C,IAAI,eAAA,uBAAsB,GAAA,EAAY;AAEtC,IAAI,eAAA,uBAAsB,GAAA,EAAY;AAG/B,SAAS,eAAA,GAAiC;AAC/C,EAAA,OAAO,aAAA;AACT;AAEA,SAAS,mBAAA,GAAgD;AACvD,EAAA,IAAI;AACF,IAAA,OAAO,oBAAmB,CAAE,QAAA;AAAA,EAC9B,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,MAAA;AAAA,EACT;AACF;AAEA,SAAS,QAAQ,IAAA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CAAA,IAAK,OAAO,OAAA,CAAQ,OAAA,KAAY,SAAA,EAAW;AAC3E,IAAA,MAAM,WAAW,OAAA,CAAQ,IAAA;AACzB,IAAA,MAAM,WAAW,mBAAA,EAAoB;AACrC,IAAA,IAAI,CAAC,QAAA,CAAS,MAAA,IAAU,CAAC,UAAA,CAAW,QAAQ,CAAA,EAAG;AAE/C,IAAA,MAAM,cAAc,cAAA,CAAe,QAAA,EAAU,oBAAmB,CAAE,IAAA,IAAQ,QAAW,QAAQ,CAAA;AAC7F,IAAA,OAAA,CAAQ,MAAM;AACZ,MAAA,eAAA,CAAgB,EAAE,SAAA,EAAW,EAAE,WAAA,EAAa,IAAA,IAAQ,CAAA;AACpD,MAAA,eAAA,CAAgB,WAAW,CAAA;AAAA,IAC7B,CAAC,CAAA;AAAA,EACH,CAAC,CAAA;AACH","file":"chunk-2XBIMXCM.js","sourcesContent":["/**\n * The order a Twig page fills the data layer in, for a storefront that loads once.\n *\n * A Twig page opens with its own data (`page`, `store`, `customer`, and the page's ecommerce\n * block), then loads the containers, then hands the SDK `twilight::init` and each\n * `services::<name>.init`, which the SDK copies into the data layer. Tags fire on those events\n * and read the data pushed before them, so the order is the contract.\n *\n * Here the first page is pushed once its customer is known (the signed-in one loads in the\n * browser) and, on the cart, once the cart has; GTM waits for that push ({@link whenGtmPageData}).\n * Every later page pushes its own `page` and ecommerce block too, after clearing the previous\n * page's ecommerce (GTM merges objects into what it holds, arrays index by index). Those pages\n * load nothing, so they announce no services again: Salla's container would load its Google\n * tags and Clarity a second time. Every push the engine makes goes through one queue, so a\n * page's data is always in before its events.\n */\nimport type { Cart, Product, User } from '../../types';\nimport type { Order } from '../../routes/account/types';\nimport { user as userApi } from '../../api/user';\nimport type { StoreContext } from '../../api/store';\nimport { getTwilightContext, type PageContext } from '../../twilight/context';\nimport { isNativeApp } from '../../native-app';\nimport { RouteId } from '../../router/route-ids';\nimport { onSallaEvent, whenSallaLoaded } from '../../utils/sdk-helpers';\nimport {\n gtmCartCheckout,\n gtmCustomer,\n gtmDetail,\n gtmEnabled,\n gtmImpressions,\n gtmPage,\n gtmPurchase,\n gtmStore,\n pushToDataLayer,\n servicesInitEvents,\n type DataLayerEntry,\n} from './gtm';\n\n/** How long the first page waits for its customer or its cart before it is pushed without. */\nexport const GTM_PAGE_DATA_WAIT_MS = 3000;\n\nlet queue: Promise<void> = Promise.resolve();\nlet firstPageReported = false;\nlet previousUrl: string | null = null;\nlet markPageDataReady: () => void = () => {};\nlet pageDataReady = new Promise<void>((resolve) => (markPageDataReady = resolve));\nlet stopImpressions: (() => void) | null = null;\n/** Orders this document has pushed a `purchase` for, whether or not GTM has taken it yet. */\nlet purchasesPushed = new Set<string>();\n/** Orders with an `Order Completed` dispatch pending or sent in this document. */\nlet ordersCompleted = new Set<string>();\n\n/** Resolves once the first page's data is in the data layer, as Twig's head pushes it before GTM. */\nexport function whenGtmPageData(): Promise<void> {\n return pageDataReady;\n}\n\nfunction settingsOrUndefined(): StoreContext | undefined {\n try {\n return getTwilightContext().settings;\n } catch {\n return undefined;\n }\n}\n\nfunction enqueue(task: () => void | Promise<void>): void {\n queue = queue.then(task).catch((error: unknown) => {\n console.warn('[gtm] Could not push to the data layer:', error);\n });\n}\n\nfunction withDeadline<T>(value: T | Promise<T>, fallback: T): Promise<T> {\n let timer: ReturnType<typeof setTimeout> | undefined;\n const deadline = new Promise<T>((resolve) => {\n timer = setTimeout(() => resolve(fallback), GTM_PAGE_DATA_WAIT_MS);\n });\n return Promise.race([Promise.resolve(value), deadline])\n .catch(() => fallback)\n .finally(() => clearTimeout(timer));\n}\n\n/** The signed-in customer, from the query `useUser` already loads; a guest has no token. */\nasync function currentUser(): Promise<User | null> {\n const { authToken, queryClient } = getTwilightContext();\n if (!authToken || !queryClient) return null;\n return withDeadline(\n queryClient.ensureQueryData(userApi.queries.current()).catch(() => null),\n null\n );\n}\n\n/** The Salla app's webview: the SDK knows once loaded, the settings carry the app's headers before. */\nfunction inNativeApp(settings: StoreContext | undefined): boolean {\n const os = settings?.jitsu?.context?.extra?.headers?.['s-app-os']?.toLowerCase();\n return os === 'ios' || os === 'android' || isNativeApp();\n}\n\n/**\n * The `user` Twig's `twilight::init` carries (the SDK's own config), as far as tags read it:\n * Salla's container identifies the customer to a chat service from `user.id` when that\n * service's `services::<name>.init` arrives, which is before the SDK pushes a user of its own.\n */\nfunction initUser(settings: StoreContext | undefined, user: User | null): DataLayerEntry {\n const visitor = settings?.user;\n return {\n id: user ? (user.id ?? null) : (visitor?.id ?? null),\n type: user ? 'user' : (visitor?.type ?? 'guest'),\n country_code: user?.country_code ?? visitor?.country_code,\n language_code: visitor?.language_code,\n currency_code: visitor?.currency_code,\n };\n}\n\n/** `twilight::init`, then each `services::<name>.init`, once per document, as Twig's page does. */\nfunction announceServices(settings: StoreContext | undefined, user: User | null): void {\n const snippetServices = (getTwilightContext().appsSnippets ?? []).map((app) => app.service);\n const events = servicesInitEvents(settings?.external_services, snippetServices);\n whenSallaLoaded((sdk) => {\n // The engine calls `salla.init` itself; Twig hands it the event, which the SDK records.\n pushToDataLayer({ event: 'twilight::init', user: initUser(settings, user) });\n for (const [name, payload] of events) sdk.event.dispatch(name, payload);\n });\n}\n\nexport interface GtmPageView {\n page: PageContext;\n /** The page's ecommerce block, or a promise of it: the cart loads in the browser. */\n ecommerce?: DataLayerEntry | Promise<DataLayerEntry | null> | null;\n}\n\n/** Push a page's data, once per page view: the first opens the document's data layer. */\nexport function reportGtmPageView(view: GtmPageView): void {\n if (typeof window === 'undefined') return;\n const settings = settingsOrUndefined();\n if (!gtmEnabled(settings)) {\n markPageDataReady();\n return;\n }\n watchListImpressions();\n\n const first = !firstPageReported;\n firstPageReported = true;\n // `url()->previous()`: the page before, or the store itself when the visitor came from nowhere.\n const referrer = (first ? document.referrer : previousUrl) || window.location.origin;\n previousUrl = window.location.href;\n\n enqueue(async () => {\n const [user, ecommerce] = await Promise.all([\n currentUser(),\n withDeadline(view.ecommerce ?? null, null),\n ]);\n const customer = await gtmCustomer(user, settings);\n const page = gtmPage(\n { slug: view.page.slug, referrer, mobileApp: inNativeApp(settings) },\n settings\n );\n if (first) {\n const entry = { ...ecommerce, page, store: gtmStore(settings), customer };\n pushToDataLayer(entry);\n rememberPurchaseOnceReceived(entry);\n announceServices(settings, user);\n markPageDataReady();\n return;\n }\n // GTM merges each push into what it holds: a guest's `{ isGuest: true }` would keep the\n // signed-out customer's details, and a shorter product list the last page's extra lines.\n pushToDataLayer({ customer: null, ecommerce: null });\n pushToDataLayer({ page, customer });\n if (ecommerce) {\n pushToDataLayer(ecommerce);\n rememberPurchaseOnceReceived(ecommerce);\n }\n });\n}\n\n/** How long a browser remembers an order it reported, as `SeoThankYouWidget` caches it. */\nconst PURCHASE_REMEMBERED_MS = 24 * 60 * 60 * 1000;\n/** How often, and for how long, a pushed purchase is checked for GTM having taken it. */\nexport const PURCHASE_RECEIVED_POLL_MS = 500;\nconst PURCHASE_RECEIVED_WAIT_MS = 60_000;\nconst purchaseKey = (orderId: unknown) => `google_tagged_order_${String(orderId)}`;\nconst orderCompletedKey = (orderId: unknown) => `order_completed_${String(orderId)}`;\n\nfunction reportedRecently(key: string): boolean {\n try {\n const at = Number(window.localStorage.getItem(key));\n return Boolean(at) && Date.now() - at < PURCHASE_REMEMBERED_MS;\n } catch {\n // No storage (a private window): report it, as a Twig page would the first time.\n return false;\n }\n}\n\n/**\n * Remember a pushed `purchase` once GTM has taken it (GTM stamps `gtm.uniqueEventId` on each\n * message it handles). GTM loads seconds after the page here, so a shopper who leaves before\n * then has reported nothing, and the next visit reports it. Twig renders the push and its\n * container together, so it remembers the order as it renders the page.\n */\nfunction rememberPurchaseOnceReceived(entry: DataLayerEntry): void {\n if (entry.event !== 'purchase') return;\n const orderId = (entry.ecommerce as { event_id?: unknown } | undefined)?.event_id;\n const started = Date.now();\n const check = () => {\n if ('gtm.uniqueEventId' in entry) {\n try {\n window.localStorage.setItem(purchaseKey(orderId), String(Date.now()));\n } catch {\n // No storage: nothing to remember it in.\n }\n } else if (Date.now() - started < PURCHASE_RECEIVED_WAIT_MS) {\n setTimeout(check, PURCHASE_RECEIVED_POLL_MS);\n }\n };\n check();\n}\n\n/**\n * An order's `purchase`, once: Twig caches each order it reported for a day, so a reload of\n * the thank-you page counts nothing. Not inside the Salla app, which logs the order itself.\n */\nfunction purchaseOnce(order: Order, settings: StoreContext | undefined): DataLayerEntry | null {\n const id = String(order.id);\n // A return to the page in this document waits on the first push; only a new load retries.\n if (inNativeApp(settings) || purchasesPushed.has(id) || reportedRecently(purchaseKey(id)))\n return null;\n purchasesPushed.add(id);\n return gtmPurchase(order, settings);\n}\n\n/**\n * An order's `Order Completed`, once, as `SeoThankYouWidget` adds it to Twig's `salla.init`\n * events: the thank-you API builds the properties and sends null for an order that reports\n * none. Inside the Salla app too, as on Twig, which skips only the GTM `purchase` there.\n */\nexport function reportOrderCompleted(order: Order): void {\n if (typeof window === 'undefined') return;\n const payload = order.tracking?.order_completed;\n const id = String(order.id);\n if (!payload || typeof payload !== 'object') return;\n const key = orderCompletedKey(id);\n if (ordersCompleted.has(id) || reportedRecently(key)) return;\n ordersCompleted.add(id);\n const pageDataPushed = queue;\n\n whenSallaLoaded(async (sdk) => {\n try {\n // Analytics needs the SDK config, and GTM tags need this page's queued data.\n await Promise.all([sdk.onReady(), pageDataPushed]);\n // Another tab may have sent the event while this one was waiting.\n if (reportedRecently(key)) return;\n sdk.event.dispatch('Order Completed', [payload]);\n } catch (error: unknown) {\n ordersCompleted.delete(id);\n console.warn('[gtm] Could not send Order Completed:', error);\n return;\n }\n\n try {\n window.localStorage.setItem(key, String(Date.now()));\n } catch {\n // This document still remembers the order when storage is unavailable.\n }\n });\n}\n\nexport interface GtmPageEcommerceInput {\n slug: string;\n product?: Product;\n order?: Order;\n /** The cart page's cart, once the page has loaded it. */\n cart?: Promise<Cart | null> | null;\n}\n\n/** A page's own ecommerce block: a product's `detail`, the cart's `checkout`, an order's `purchase`. */\nexport function gtmPageEcommerce(input: GtmPageEcommerceInput): GtmPageView['ecommerce'] {\n if (typeof window === 'undefined') return null;\n const settings = settingsOrUndefined();\n if (!gtmEnabled(settings)) return null;\n if (input.slug === RouteId.PRODUCT_SINGLE && input.product)\n return gtmDetail(input.product, settings);\n if (input.slug === RouteId.CART && input.cart)\n return input.cart.then((cart) => (cart ? gtmCartCheckout(cart, settings) : null));\n if (input.slug === RouteId.THANK_YOU && input.order) return purchaseOnce(input.order, settings);\n return null;\n}\n\n/**\n * `impressions` for each page of a product listing the engine or the theme reports through\n * `salla-products-list::products.fetched`, as `<salla-products-list>` pushes on Twig. That\n * component pushes its own before it emits the API's answer (`success`), so those are skipped.\n * Each batch first clears the last one's list (GTM merges arrays index by index), and only that:\n * the page's own block, such as the cart's `checkout`, stays for the tags still to read it.\n */\nfunction watchListImpressions(): void {\n if (stopImpressions) return;\n stopImpressions = onSallaEvent('salla-products-list::products.fetched', (payload) => {\n const fetched = payload as { data?: unknown; success?: unknown } | undefined;\n if (!Array.isArray(fetched?.data) || typeof fetched.success === 'boolean') return;\n const products = fetched.data as Product[];\n const settings = settingsOrUndefined();\n if (!products.length || !gtmEnabled(settings)) return;\n // The page the products were fetched for, not the one the queue gets to them on.\n const impressions = gtmImpressions(products, getTwilightContext().page ?? undefined, settings);\n enqueue(() => {\n pushToDataLayer({ ecommerce: { impressions: null } });\n pushToDataLayer(impressions);\n });\n });\n}\n\n/** Test seam: forget the document's first page and every listener. */\nexport function resetGtmPageTracking(): void {\n stopImpressions?.();\n stopImpressions = null;\n queue = Promise.resolve();\n firstPageReported = false;\n previousUrl = null;\n purchasesPushed = new Set();\n ordersCompleted = new Set();\n pageDataReady = new Promise<void>((resolve) => (markPageDataReady = resolve));\n}\n\n/** Test seam: settle every push queued so far. */\nexport function flushGtmQueue(): Promise<void> {\n return queue;\n}\n"]}
1
+ {"version":3,"sources":["../src/lib/analytics/gtm-page.ts"],"names":["user"],"mappings":";;;;;;;;AAuCO,IAAM,qBAAA,GAAwB;AAErC,IAAI,KAAA,GAAuB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,KAAA,CAAM,IAAA;AACvC,IAAA,OAAO,KAAA,CAAM,IAAA,CAAK,IAAA,CAAK,CAAC,IAAA,KAAU,OAAO,eAAA,CAAgB,IAAA,EAAM,QAAQ,CAAA,GAAI,IAAK,CAAA;AAClF,EAAA,IAAI,KAAA,CAAM,IAAA,KAAS,OAAA,CAAQ,SAAA,IAAa,KAAA,CAAM,OAAO,OAAO,YAAA,CAAa,KAAA,CAAM,KAAA,EAAO,QAAQ,CAAA;AAC9F,EAAA,OAAO,IAAA;AACT;AASA,SAAS,oBAAA,GAA6B;AACpC,EAAA,IAAI,eAAA,EAAiB;AACrB,EAAA,eAAA,GAAkB,YAAA,CAAa,uCAAA,EAAyC,CAAC,OAAA,KAAY;AACnF,IAAA,MAAM,OAAA,GAAU,OAAA;AAChB,IAAA,IAAI,CAAC,MAAM,OAAA,CAAQ,OAAA,EAAS,IAAI,CAAA,IAAK,OAAO,OAAA,CAAQ,OAAA,KAAY,SAAA,EAAW;AAC3E,IAAA,MAAM,WAAW,OAAA,CAAQ,IAAA;AACzB,IAAA,MAAM,WAAW,mBAAA,EAAoB;AACrC,IAAA,IAAI,CAAC,QAAA,CAAS,MAAA,IAAU,CAAC,UAAA,CAAW,QAAQ,CAAA,EAAG;AAE/C,IAAA,MAAM,cAAc,cAAA,CAAe,QAAA,EAAU,oBAAmB,CAAE,IAAA,IAAQ,QAAW,QAAQ,CAAA;AAC7F,IAAA,OAAA,CAAQ,MAAM;AACZ,MAAA,eAAA,CAAgB,EAAE,SAAA,EAAW,EAAE,WAAA,EAAa,IAAA,IAAQ,CAAA;AACpD,MAAA,eAAA,CAAgB,WAAW,CAAA;AAAA,IAC7B,CAAC,CAAA;AAAA,EACH,CAAC,CAAA;AACH","file":"chunk-5LQ6OAAH.js","sourcesContent":["/**\n * The order a Twig page fills the data layer in, for a storefront that loads once.\n *\n * A Twig page opens with its own data (`page`, `store`, `customer`, and the page's ecommerce\n * block), then loads the containers, then hands the SDK `twilight::init` and each\n * `services::<name>.init`, which the SDK copies into the data layer. Tags fire on those events\n * and read the data pushed before them, so the order is the contract.\n *\n * Here the first page is pushed once its customer is known (the signed-in one loads in the\n * browser) and, on the cart, once the cart has; GTM waits for that push ({@link whenGtmPageData}).\n * Every later page pushes its own `page` and ecommerce block too, after clearing the previous\n * page's ecommerce (GTM merges objects into what it holds, arrays index by index). Those pages\n * load nothing, so they announce no services again: Salla's container would load its Google\n * tags and Clarity a second time. Every push the engine makes goes through one queue, so a\n * page's data is always in before its events.\n */\nimport type { Cart, Product, User } from '../../types';\nimport type { Order } from '../../routes/account/types';\nimport { user as userApi } from '../../api/user';\nimport type { StoreContext } from '../../api/store';\nimport { getTwilightContext, type PageContext } from '../../twilight/context';\nimport { isNativeApp } from '../../native-app';\nimport { RouteId } from '../../router/route-ids';\nimport { onSallaEvent, whenSallaLoaded } from '../../utils/sdk-helpers';\nimport {\n gtmCartCheckout,\n gtmCustomer,\n gtmDetail,\n gtmEnabled,\n gtmImpressions,\n gtmPage,\n gtmPurchase,\n gtmStore,\n pushToDataLayer,\n servicesInitEvents,\n type DataLayerEntry,\n} from './gtm';\n\n/** How long the first page waits for its customer or its cart before it is pushed without. */\nexport const GTM_PAGE_DATA_WAIT_MS = 3000;\n\nlet queue: Promise<void> = Promise.resolve();\nlet firstPageReported = false;\nlet previousUrl: string | null = null;\nlet markPageDataReady: () => void = () => {};\nlet pageDataReady = new Promise<void>((resolve) => (markPageDataReady = resolve));\nlet stopImpressions: (() => void) | null = null;\n/** Orders this document has pushed a `purchase` for, whether or not GTM has taken it yet. */\nlet purchasesPushed = new Set<string>();\n/** Orders with an `Order Completed` dispatch pending or sent in this document. */\nlet ordersCompleted = new Set<string>();\n\n/** Resolves once the first page's data is in the data layer, as Twig's head pushes it before GTM. */\nexport function whenGtmPageData(): Promise<void> {\n return pageDataReady;\n}\n\nfunction settingsOrUndefined(): StoreContext | undefined {\n try {\n return getTwilightContext().settings;\n } catch {\n return undefined;\n }\n}\n\nfunction enqueue(task: () => void | Promise<void>): void {\n queue = queue.then(task).catch((error: unknown) => {\n console.warn('[gtm] Could not push to the data layer:', error);\n });\n}\n\nfunction withDeadline<T>(value: T | Promise<T>, fallback: T): Promise<T> {\n let timer: ReturnType<typeof setTimeout> | undefined;\n const deadline = new Promise<T>((resolve) => {\n timer = setTimeout(() => resolve(fallback), GTM_PAGE_DATA_WAIT_MS);\n });\n return Promise.race([Promise.resolve(value), deadline])\n .catch(() => fallback)\n .finally(() => clearTimeout(timer));\n}\n\n/** The signed-in customer, from the query `useUser` already loads; a guest has no token. */\nasync function currentUser(): Promise<User | null> {\n const { authToken, queryClient } = getTwilightContext();\n if (!authToken || !queryClient) return null;\n return withDeadline(\n queryClient.ensureQueryData(userApi.queries.current()).catch(() => null),\n null\n );\n}\n\n/** The Salla app's webview: the SDK knows once loaded, the settings carry the app's headers before. */\nfunction inNativeApp(settings: StoreContext | undefined): boolean {\n const os = settings?.jitsu?.context?.extra?.headers?.['s-app-os']?.toLowerCase();\n return os === 'ios' || os === 'android' || isNativeApp();\n}\n\n/**\n * The `user` Twig's `twilight::init` carries (the SDK's own config), as far as tags read it:\n * Salla's container identifies the customer to a chat service from `user.id` when that\n * service's `services::<name>.init` arrives, which is before the SDK pushes a user of its own.\n */\nfunction initUser(settings: StoreContext | undefined, user: User | null): DataLayerEntry {\n const visitor = settings?.user;\n return {\n id: user ? (user.id ?? null) : (visitor?.id ?? null),\n type: user ? 'user' : (visitor?.type ?? 'guest'),\n country_code: user?.country_code ?? visitor?.country_code,\n language_code: visitor?.language_code,\n currency_code: visitor?.currency_code,\n };\n}\n\n/** `twilight::init`, then each `services::<name>.init`, once per document, as Twig's page does. */\nfunction announceServices(settings: StoreContext | undefined, user: User | null): void {\n const snippetServices = (getTwilightContext().appsSnippets ?? []).map((app) => app.service);\n const events = servicesInitEvents(settings?.external_services, snippetServices);\n whenSallaLoaded((sdk) => {\n // The engine calls `salla.init` itself; Twig hands it the event, which the SDK records.\n pushToDataLayer({ event: 'twilight::init', user: initUser(settings, user) });\n for (const [name, payload] of events) sdk.event.dispatch(name, payload);\n });\n}\n\nexport interface GtmPageView {\n page: PageContext;\n /** The page's ecommerce block, or a promise of it: the cart loads in the browser. */\n ecommerce?: DataLayerEntry | Promise<DataLayerEntry | null> | null;\n}\n\n/** Push a page's data, once per page view: the first opens the document's data layer. */\nexport function reportGtmPageView(view: GtmPageView): void {\n if (typeof window === 'undefined') return;\n const settings = settingsOrUndefined();\n if (!gtmEnabled(settings)) {\n markPageDataReady();\n return;\n }\n watchListImpressions();\n\n const first = !firstPageReported;\n firstPageReported = true;\n // `url()->previous()`: the page before, or the store itself when the visitor came from nowhere.\n const referrer = (first ? document.referrer : previousUrl) || window.location.origin;\n previousUrl = window.location.href;\n\n enqueue(async () => {\n const [user, ecommerce] = await Promise.all([\n currentUser(),\n withDeadline(view.ecommerce ?? null, null),\n ]);\n const customer = await gtmCustomer(user, settings);\n const page = gtmPage(\n { slug: view.page.slug, referrer, mobileApp: inNativeApp(settings) },\n settings\n );\n if (first) {\n const entry = { ...ecommerce, page, store: gtmStore(settings), customer };\n pushToDataLayer(entry);\n rememberPurchaseOnceReceived(entry);\n announceServices(settings, user);\n markPageDataReady();\n return;\n }\n // GTM merges each push into what it holds: a guest's `{ isGuest: true }` would keep the\n // signed-out customer's details, and a shorter product list the last page's extra lines.\n pushToDataLayer({ customer: null, ecommerce: null });\n pushToDataLayer({ page, customer });\n if (ecommerce) {\n pushToDataLayer(ecommerce);\n rememberPurchaseOnceReceived(ecommerce);\n }\n });\n}\n\n/** How long a browser remembers an order it reported, as `SeoThankYouWidget` caches it. */\nconst PURCHASE_REMEMBERED_MS = 24 * 60 * 60 * 1000;\n/** How often, and for how long, a pushed purchase is checked for GTM having taken it. */\nexport const PURCHASE_RECEIVED_POLL_MS = 500;\nconst PURCHASE_RECEIVED_WAIT_MS = 60_000;\nconst purchaseKey = (orderId: unknown) => `google_tagged_order_${String(orderId)}`;\nconst orderCompletedKey = (orderId: unknown) => `order_completed_${String(orderId)}`;\n\nfunction reportedRecently(key: string): boolean {\n try {\n const at = Number(window.localStorage.getItem(key));\n return Boolean(at) && Date.now() - at < PURCHASE_REMEMBERED_MS;\n } catch {\n // No storage (a private window): report it, as a Twig page would the first time.\n return false;\n }\n}\n\n/**\n * Remember a pushed `purchase` once GTM has taken it (GTM stamps `gtm.uniqueEventId` on each\n * message it handles). GTM loads seconds after the page here, so a shopper who leaves before\n * then has reported nothing, and the next visit reports it. Twig renders the push and its\n * container together, so it remembers the order as it renders the page.\n */\nfunction rememberPurchaseOnceReceived(entry: DataLayerEntry): void {\n if (entry.event !== 'purchase') return;\n const orderId = (entry.ecommerce as { event_id?: unknown } | undefined)?.event_id;\n const started = Date.now();\n const check = () => {\n if ('gtm.uniqueEventId' in entry) {\n try {\n window.localStorage.setItem(purchaseKey(orderId), String(Date.now()));\n } catch {\n // No storage: nothing to remember it in.\n }\n } else if (Date.now() - started < PURCHASE_RECEIVED_WAIT_MS) {\n setTimeout(check, PURCHASE_RECEIVED_POLL_MS);\n }\n };\n check();\n}\n\n/**\n * An order's `purchase`, once: Twig caches each order it reported for a day, so a reload of\n * the thank-you page counts nothing. Not inside the Salla app, which logs the order itself.\n */\nfunction purchaseOnce(order: Order, settings: StoreContext | undefined): DataLayerEntry | null {\n const id = String(order.id);\n // A return to the page in this document waits on the first push; only a new load retries.\n if (inNativeApp(settings) || purchasesPushed.has(id) || reportedRecently(purchaseKey(id)))\n return null;\n purchasesPushed.add(id);\n return gtmPurchase(order, settings);\n}\n\n/**\n * An order's `Order Completed`, once, as `SeoThankYouWidget` adds it to Twig's `salla.init`\n * events: the thank-you API builds the properties and sends null for an order that reports\n * none. Inside the Salla app too, as on Twig, which skips only the GTM `purchase` there.\n */\nexport function reportOrderCompleted(order: Order): void {\n if (typeof window === 'undefined') return;\n const payload = order.tracking?.order_completed;\n const id = String(order.id);\n if (!payload || typeof payload !== 'object') return;\n const key = orderCompletedKey(id);\n if (ordersCompleted.has(id) || reportedRecently(key)) return;\n ordersCompleted.add(id);\n const pageDataPushed = queue;\n\n whenSallaLoaded(async (sdk) => {\n try {\n // Analytics needs the SDK config, and GTM tags need this page's queued data.\n await Promise.all([sdk.onReady(), pageDataPushed]);\n // Another tab may have sent the event while this one was waiting.\n if (reportedRecently(key)) return;\n sdk.event.dispatch('Order Completed', [payload]);\n } catch (error: unknown) {\n ordersCompleted.delete(id);\n console.warn('[gtm] Could not send Order Completed:', error);\n return;\n }\n\n try {\n window.localStorage.setItem(key, String(Date.now()));\n } catch {\n // This document still remembers the order when storage is unavailable.\n }\n });\n}\n\nexport interface GtmPageEcommerceInput {\n slug: string;\n product?: Product;\n order?: Order;\n /** The cart page's cart, once the page has loaded it. */\n cart?: Promise<Cart | null> | null;\n}\n\n/** A page's own ecommerce block: a product's `detail`, the cart's `checkout`, an order's `purchase`. */\nexport function gtmPageEcommerce(input: GtmPageEcommerceInput): GtmPageView['ecommerce'] {\n if (typeof window === 'undefined') return null;\n const settings = settingsOrUndefined();\n if (!gtmEnabled(settings)) return null;\n if (input.slug === RouteId.PRODUCT_SINGLE && input.product)\n return gtmDetail(input.product, settings);\n if (input.slug === RouteId.CART && input.cart)\n return input.cart.then((cart) => (cart ? gtmCartCheckout(cart, settings) : null));\n if (input.slug === RouteId.THANK_YOU && input.order) return purchaseOnce(input.order, settings);\n return null;\n}\n\n/**\n * `impressions` for each page of a product listing the engine or the theme reports through\n * `salla-products-list::products.fetched`, as `<salla-products-list>` pushes on Twig. That\n * component pushes its own before it emits the API's answer (`success`), so those are skipped.\n * Each batch first clears the last one's list (GTM merges arrays index by index), and only that:\n * the page's own block, such as the cart's `checkout`, stays for the tags still to read it.\n */\nfunction watchListImpressions(): void {\n if (stopImpressions) return;\n stopImpressions = onSallaEvent('salla-products-list::products.fetched', (payload) => {\n const fetched = payload as { data?: unknown; success?: unknown } | undefined;\n if (!Array.isArray(fetched?.data) || typeof fetched.success === 'boolean') return;\n const products = fetched.data as Product[];\n const settings = settingsOrUndefined();\n if (!products.length || !gtmEnabled(settings)) return;\n // The page the products were fetched for, not the one the queue gets to them on.\n const impressions = gtmImpressions(products, getTwilightContext().page ?? undefined, settings);\n enqueue(() => {\n pushToDataLayer({ ecommerce: { impressions: null } });\n pushToDataLayer(impressions);\n });\n });\n}\n\n/** Test seam: forget the document's first page and every listener. */\nexport function resetGtmPageTracking(): void {\n stopImpressions?.();\n stopImpressions = null;\n queue = Promise.resolve();\n firstPageReported = false;\n previousUrl = null;\n purchasesPushed = new Set();\n ordersCompleted = new Set();\n pageDataReady = new Promise<void>((resolve) => (markPageDataReady = resolve));\n}\n\n/** Test seam: settle every push queued so far. */\nexport function flushGtmQueue(): Promise<void> {\n return queue;\n}\n"]}
@@ -1,7 +1,7 @@
1
- import { HomeComponentRenderer, ReorderProducts } from './chunk-A4XSOGW7.js';
2
- import { home } from './chunk-PC3CQKE2.js';
1
+ import { HomeComponentRenderer, ReorderProducts } from './chunk-QP7AVGLQ.js';
2
+ import { home } from './chunk-SGJDENMI.js';
3
3
  import { useLiveBlockList, reorder, useLiveBlockMoves } from './chunk-TJK4DVQM.js';
4
- import { useDevHomeBlocks } from './chunk-UHDV3USV.js';
4
+ import { useDevHomeBlocks } from './chunk-4D4AAOP6.js';
5
5
  import { storePageUrl, buildHreflangAlternates } from './chunk-EUHIN5FN.js';
6
6
  import { RouteId } from './chunk-OUW6WESU.js';
7
7
  import { HookSlot } from './chunk-XZFWBF3P.js';
@@ -135,5 +135,5 @@ function head(ctx) {
135
135
  var Home = { id: RouteId.INDEX, loader, head, Component: HomePage };
136
136
 
137
137
  export { Home, HomeSkeleton, homeLoader };
138
- //# sourceMappingURL=chunk-D2SVAGSH.js.map
139
- //# sourceMappingURL=chunk-D2SVAGSH.js.map
138
+ //# sourceMappingURL=chunk-5TECTHHK.js.map
139
+ //# sourceMappingURL=chunk-5TECTHHK.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/routes/home/blockList.ts","../src/routes/home/loader.ts","../src/routes/home/HomePage.tsx","../src/rout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,SAAS,KAAK,GAAA,EAAsC;AAClD,EAAA,MAAM,KAAA,GAAQ,IAAI,QAAA,EAAU,KAAA;AAC5B,EAAA,IAAI,CAAC,KAAA,EAAO,OAAO,EAAC;AAEpB,EAAA,MAAM,KAAA,GAAQ,KAAA,CAAM,IAAA,EAAM,KAAA,IAAS,KAAA,CAAM,IAAA;AACzC,EAAA,MAAM,WAAA,GAAc,KAAA,CAAM,IAAA,EAAM,WAAA,IAAe,KAAA,CAAM,WAAA;AACrD,EAAA,MAAM,QAAA,GAAW,MAAM,IAAA,EAAM,QAAA;AAE7B,EAAA,MAAM,GAAA,GAAM,aAAa,GAAA,CAAI,QAAA,EAAU,IAAI,QAAA,CAAS,QAAQ,KAAK,KAAA,CAAM,GAAA;AAEvE,EAAA,OAAO;AAAA,IACL,KAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA,EAAW,GAAA;AAAA,IACX,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,SAAA;AAAA,MACN,KAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAQ,KAAA,CAAM,IAAA;AAAA,MACd;AAAA,KACF;AAAA,IACA,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,qBAAA;AAAA,MACN,KAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAQ,KAAA,CAAM;AAAA,KAChB;AAAA,IACA,oBAAoB,uBAAA,CAAwB,GAAA,CAAI,QAAA,EAAU,GAAA,CAAI,SAAS,QAAQ;AAAA,GACjF;AACF;AAEO,IAAM,IAAA,GAAO,EAAE,EAAA,EAAI,OAAA,CAAQ,OAAO,MAAA,EAAQ,IAAA,EAAM,WAAW,QAAA","file":"chunk-D2SVAGSH.js","sourcesContent":["import type { HomeComponentData } from '../../types';\n\n/** Paths and keys of `blocks` in order: enough to tell the store's list from one a theme built. */\nexport function blockList(blocks: readonly HomeComponentData[]): string {\n return JSON.stringify(blocks.map((block) => [block.path, block.key ?? null]));\n}\n","import { getTwilightContext } from '../../twilight/context';\nimport { home } from '../../api/home';\nimport type { HomeComponentData } from '../../types';\nimport { RouteId } from '../../router/route-ids';\nimport { blockList } from './blockList';\n\nexport interface HomeLoaderData {\n locale: string;\n components: HomeComponentData[];\n page: { slug: string };\n /**\n * The store's blocks as this loader lists them (`blockList`). A theme whose own loader\n * reshapes `components` keeps this, so the page can tell its list is no longer the store's.\n */\n storeBlocks?: string;\n}\n\nexport async function homeLoader(ctx?: { locale?: string }): Promise<HomeLoaderData> {\n const { queryClient } = getTwilightContext();\n const components = await queryClient.ensureQueryData(home.queries.components());\n const blocks = components.map((comp) => ({\n ...comp,\n path: comp.path?.replace('home.', '') || comp.path,\n }));\n return {\n locale: ctx?.locale || 'ar',\n components: blocks,\n page: { slug: RouteId.INDEX },\n storeBlocks: blockList(blocks),\n };\n}\n","import { memo, useCallback, useMemo, useState } from 'react';\nimport { useDevHomeBlocks, type DevHomeBlock } from '../../dev/dev-settings-store';\nimport { HookSlot } from '../../hooks';\nimport { HomeComponentRenderer, ReorderProducts } from '../../components/home';\nimport { reorder, useLiveBlockList, useLiveBlockMoves } from '../../components/live-editor/moves';\nimport type { HomePageProps } from './types';\nimport { blockList } from './blockList';\nimport type { HomeComponentData } from '../../types';\nimport { Pulse } from '@salla.sa/twilight-components-react';\n\nexport const HomeSkeleton = memo(function HomeSkeleton() {\n return (\n <>\n <div className=\"s-block container skeleton-block-hero\">\n <Pulse className=\"h-64 sm:h-80 rounded-md\" />\n </div>\n <div className=\"s-block container skeleton-block-products\">\n <Pulse className=\"h-10 w-48 mb-4\" />\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-4\">\n {[1, 2, 3, 4].map((i) => (\n <Pulse key={i} className=\"h-56\" />\n ))}\n </div>\n </div>\n <div className=\"s-block container skeleton-block-products\">\n <Pulse className=\"h-10 w-48 mb-4\" />\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-4\">\n {[1, 2, 3, 4].map((i) => (\n <Pulse key={i} className=\"h-56\" />\n ))}\n </div>\n </div>\n </>\n );\n});\n\n/** As on Twig, a home page with no blocks lists the store's latest products instead. */\nconst LATEST_PRODUCTS: HomeComponentData = { path: 'latest-products' };\n\n/** The blocks' places in the store's order: 0, 1, 2… */\nconst storeOrder = (blocks: readonly unknown[]) => Array.from(blocks, (_, at) => at);\n\n// Stable, so a redraw of a page loaded without blocks is kept.\nconst NO_BLOCKS: HomeComponentData[] = [];\n\n// Catalog id (or path) plus copy number: a block drawn in or out leaves the others' state alone.\nfunction blockKeys(blocks: ReadonlyArray<DevHomeBlock<HomeComponentData>>): string[] {\n const copies = new Map<string, number>();\n return blocks.map((block) => {\n if (block.__dev_id) return block.__dev_id;\n const name = String(block.key ?? block.path);\n const copy = copies.get(name) ?? 0;\n copies.set(name, copy + 1);\n return `${name}~${copy}`;\n });\n}\n\nexport const HomePage = memo(function HomePage({\n components = NO_BLOCKS,\n storeBlocks,\n}: HomePageProps) {\n // The design studio draws the blocks again after a save, in place of the loaded\n // ones, until the page loads its blocks anew.\n const [drawn, setDrawn] = useState<{\n source: HomeComponentData[];\n blocks: HomeComponentData[];\n } | null>(null);\n const onList = useCallback(\n (blocks: HomeComponentData[]) => setDrawn({ source: components, blocks }),\n [components]\n );\n // A list the theme's own loader built (Tania's home) is not the store's: the studio reloads it instead.\n const storeList = useMemo(\n () => storeBlocks === undefined || storeBlocks === blockList(components),\n [storeBlocks, components]\n );\n useLiveBlockList(storeList ? onList : null);\n const current = drawn?.source === components ? drawn.blocks : components;\n // Dev-mode only: the dev editor's layout replaces the store's blocks while it\n // is on. No-op passthrough in production builds.\n const renderedComponents = useDevHomeBlocks(current);\n // The theme editor's preview moves blocks in place while the editor saves the\n // order; blocks from the server (a new page, a reload) start over from theirs.\n const [moved, setMoved] = useState<{ source: HomeComponentData[]; order: number[] } | null>(null);\n const order = moved?.source === renderedComponents ? moved.order : null;\n const onMove = useCallback(\n (from: number, to: number) =>\n setMoved((prev) => ({\n source: renderedComponents,\n order: reorder(\n prev?.source === renderedComponents ? prev.order : storeOrder(renderedComponents),\n from,\n to\n ),\n })),\n [renderedComponents]\n );\n useLiveBlockMoves(onMove);\n const placed = order ?? storeOrder(renderedComponents);\n const keys = useMemo(() => blockKeys(renderedComponents), [renderedComponents]);\n\n return (\n <>\n <HookSlot name=\"home:start\" />\n <HookSlot name=\"home:content\" />\n {placed.map((at, index) => {\n // A block's key stays with it when the preview moves it, so a move keeps its state.\n return <HomeComponentRenderer key={keys[at]} data={renderedComponents[at]} index={index} />;\n })}\n {!renderedComponents.length && (\n <HomeComponentRenderer data={LATEST_PRODUCTS} index={0} editable={false} />\n )}\n <HookSlot name=\"home:end\" />\n <ReorderProducts />\n </>\n );\n});\n\nexport { HomePage as default };\n","import type { HeadDescriptor } from '../../utils/head';\nimport { buildHreflangAlternates, storePageUrl } from '../../utils/baseHead';\nimport type { HomeLoaderData } from './loader';\nimport { homeLoader } from './loader';\nimport type { TwilightContext } from '../../twilight/context';\nimport { HomePage } from './HomePage';\nimport { RouteId } from '../../router/route-ids';\n\nexport { HomeSkeleton } from './HomePage';\nexport { registerHomeComponents, DefaultHomeComponents } from '../../components/home/register';\nexport { registerHomeComponentConfig } from '../../components/home';\nexport type { HomePageProps } from './types';\nexport type { HomeLoaderData } from './loader';\nexport type {\n HomeComponentsProps,\n AnyHomeComponent,\n HomeComponentConfig,\n} from '../../components/home';\n\nfunction loader(_ctx?: { locale?: string }): Promise<HomeLoaderData> {\n return homeLoader({ locale: _ctx?.locale });\n}\n\nfunction head(ctx: TwilightContext): HeadDescriptor {\n const store = ctx.settings?.store;\n if (!store) return {};\n\n const title = store.meta?.title ?? store.name;\n const description = store.meta?.description ?? store.description;\n const keywords = store.meta?.keywords;\n // `/ar`, like Twig, where store.url reads `/ar/`.\n const url = storePageUrl(ctx.settings, ctx.location.pathname) ?? store.url;\n\n return {\n title,\n description,\n keywords,\n canonical: url,\n openGraph: {\n type: 'website',\n title,\n description,\n images: store.logo,\n url,\n },\n twitter: {\n card: 'summary_large_image',\n title,\n description,\n images: store.logo,\n },\n alternateLanguages: buildHreflangAlternates(ctx.settings, ctx.location.pathname),\n };\n}\n\nexport const Home = { id: RouteId.INDEX, loader, head, Component: HomePage } as const;\n\nexport { homeLoader };\n"]}
1
+ {"version":3,"sources":["../src/routes/home/blockList.ts","../src/routes/home/loader.ts","../src/routes/home/HomePage.tsx","../src/routes/home/index.tsx"],"names":["HomeSkeleton","HomePage"],"mappings":";;;;;;;;;;;;;AAGO,SAAS,UAAU,MAAA,EAA8C;AACtE,EAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAO,GAAA,CAAI,CAAC,KAAA,KAAU,CAAC,KAAA,CAAM,IAAA,EAAM,KAAA,CAAM,GAAA,IAAO,IAAI,CAAC,CAAC,CAAA;AAC9E;;;ACYA,eAAsB,WAAW,GAAA,EAAoD;AACnF,EAAA,MAAM,EAAE,WAAA,EAAY,GAAI,kBAAA,EAAmB;AAC3C,EAAA,MAAM,aAAa,MAAM,WAAA,CAAY,gBAAgB,IAAA,CAAK,OAAA,CAAQ,YAAY,CAAA;AAC9E,EAAA,MAAM,MAAA,GAAS,UAAA,CAAW,GAAA,CAAI,CAAC,IAAA,MAAU;AAAA,IACvC,GAAG,IAAA;AAAA,IACH,MAAM,IAAA,CAAK,IAAA,EAAM,QAAQ,OAAA,EAAS,EAAE,KAAK,IAAA,CAAK;AAAA,GAChD,CAAE,CAAA;AACF,EAAA,OAAO;AAAA,IACL,MAAA,EAAQ,KAAK,MAAA,IAAU,IAAA;AAAA,IACvB,UAAA,EAAY,MAAA;AAAA,IACZ,IAAA,EAAM,EAAE,IAAA,EAAM,OAAA,CAAQ,KAAA,EAAM;AAAA,IAC5B,WAAA,EAAa,UAAU,MAAM;AAAA,GAC/B;AACF;ACpBO,IAAM,YAAA,GAAe,IAAA,CAAK,SAASA,aAAAA,GAAe;AACvD,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,SAAI,SAAA,E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,EAAM,WAAW,QAAA","file":"chunk-5TECTHHK.js","sourcesContent":["import type { HomeComponentData } from '../../types';\n\n/** Paths and keys of `blocks` in order: enough to tell the store's list from one a theme built. */\nexport function blockList(blocks: readonly HomeComponentData[]): string {\n return JSON.stringify(blocks.map((block) => [block.path, block.key ?? null]));\n}\n","import { getTwilightContext } from '../../twilight/context';\nimport { home } from '../../api/home';\nimport type { HomeComponentData } from '../../types';\nimport { RouteId } from '../../router/route-ids';\nimport { blockList } from './blockList';\n\nexport interface HomeLoaderData {\n locale: string;\n components: HomeComponentData[];\n page: { slug: string };\n /**\n * The store's blocks as this loader lists them (`blockList`). A theme whose own loader\n * reshapes `components` keeps this, so the page can tell its list is no longer the store's.\n */\n storeBlocks?: string;\n}\n\nexport async function homeLoader(ctx?: { locale?: string }): Promise<HomeLoaderData> {\n const { queryClient } = getTwilightContext();\n const components = await queryClient.ensureQueryData(home.queries.components());\n const blocks = components.map((comp) => ({\n ...comp,\n path: comp.path?.replace('home.', '') || comp.path,\n }));\n return {\n locale: ctx?.locale || 'ar',\n components: blocks,\n page: { slug: RouteId.INDEX },\n storeBlocks: blockList(blocks),\n };\n}\n","import { memo, useCallback, useMemo, useState } from 'react';\nimport { useDevHomeBlocks, type DevHomeBlock } from '../../dev/dev-settings-store';\nimport { HookSlot } from '../../hooks';\nimport { HomeComponentRenderer, ReorderProducts } from '../../components/home';\nimport { reorder, useLiveBlockList, useLiveBlockMoves } from '../../components/live-editor/moves';\nimport type { HomePageProps } from './types';\nimport { blockList } from './blockList';\nimport type { HomeComponentData } from '../../types';\nimport { Pulse } from '@salla.sa/twilight-components-react';\n\nexport const HomeSkeleton = memo(function HomeSkeleton() {\n return (\n <>\n <div className=\"s-block container skeleton-block-hero\">\n <Pulse className=\"h-64 sm:h-80 rounded-md\" />\n </div>\n <div className=\"s-block container skeleton-block-products\">\n <Pulse className=\"h-10 w-48 mb-4\" />\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-4\">\n {[1, 2, 3, 4].map((i) => (\n <Pulse key={i} className=\"h-56\" />\n ))}\n </div>\n </div>\n <div className=\"s-block container skeleton-block-products\">\n <Pulse className=\"h-10 w-48 mb-4\" />\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-4\">\n {[1, 2, 3, 4].map((i) => (\n <Pulse key={i} className=\"h-56\" />\n ))}\n </div>\n </div>\n </>\n );\n});\n\n/** As on Twig, a home page with no blocks lists the store's latest products instead. */\nconst LATEST_PRODUCTS: HomeComponentData = { path: 'latest-products' };\n\n/** The blocks' places in the store's order: 0, 1, 2… */\nconst storeOrder = (blocks: readonly unknown[]) => Array.from(blocks, (_, at) => at);\n\n// Stable, so a redraw of a page loaded without blocks is kept.\nconst NO_BLOCKS: HomeComponentData[] = [];\n\n// Catalog id (or path) plus copy number: a block drawn in or out leaves the others' state alone.\nfunction blockKeys(blocks: ReadonlyArray<DevHomeBlock<HomeComponentData>>): string[] {\n const copies = new Map<string, number>();\n return blocks.map((block) => {\n if (block.__dev_id) return block.__dev_id;\n const name = String(block.key ?? block.path);\n const copy = copies.get(name) ?? 0;\n copies.set(name, copy + 1);\n return `${name}~${copy}`;\n });\n}\n\nexport const HomePage = memo(function HomePage({\n components = NO_BLOCKS,\n storeBlocks,\n}: HomePageProps) {\n // The design studio draws the blocks again after a save, in place of the loaded\n // ones, until the page loads its blocks anew.\n const [drawn, setDrawn] = useState<{\n source: HomeComponentData[];\n blocks: HomeComponentData[];\n } | null>(null);\n const onList = useCallback(\n (blocks: HomeComponentData[]) => setDrawn({ source: components, blocks }),\n [components]\n );\n // A list the theme's own loader built (Tania's home) is not the store's: the studio reloads it instead.\n const storeList = useMemo(\n () => storeBlocks === undefined || storeBlocks === blockList(components),\n [storeBlocks, components]\n );\n useLiveBlockList(storeList ? onList : null);\n const current = drawn?.source === components ? drawn.blocks : components;\n // Dev-mode only: the dev editor's layout replaces the store's blocks while it\n // is on. No-op passthrough in production builds.\n const renderedComponents = useDevHomeBlocks(current);\n // The theme editor's preview moves blocks in place while the editor saves the\n // order; blocks from the server (a new page, a reload) start over from theirs.\n const [moved, setMoved] = useState<{ source: HomeComponentData[]; order: number[] } | null>(null);\n const order = moved?.source === renderedComponents ? moved.order : null;\n const onMove = useCallback(\n (from: number, to: number) =>\n setMoved((prev) => ({\n source: renderedComponents,\n order: reorder(\n prev?.source === renderedComponents ? prev.order : storeOrder(renderedComponents),\n from,\n to\n ),\n })),\n [renderedComponents]\n );\n useLiveBlockMoves(onMove);\n const placed = order ?? storeOrder(renderedComponents);\n const keys = useMemo(() => blockKeys(renderedComponents), [renderedComponents]);\n\n return (\n <>\n <HookSlot name=\"home:start\" />\n <HookSlot name=\"home:content\" />\n {placed.map((at, index) => {\n // A block's key stays with it when the preview moves it, so a move keeps its state.\n return <HomeComponentRenderer key={keys[at]} data={renderedComponents[at]} index={index} />;\n })}\n {!renderedComponents.length && (\n <HomeComponentRenderer data={LATEST_PRODUCTS} index={0} editable={false} />\n )}\n <HookSlot name=\"home:end\" />\n <ReorderProducts />\n </>\n );\n});\n\nexport { HomePage as default };\n","import type { HeadDescriptor } from '../../utils/head';\nimport { buildHreflangAlternates, storePageUrl } from '../../utils/baseHead';\nimport type { HomeLoaderData } from './loader';\nimport { homeLoader } from './loader';\nimport type { TwilightContext } from '../../twilight/context';\nimport { HomePage } from './HomePage';\nimport { RouteId } from '../../router/route-ids';\n\nexport { HomeSkeleton } from './HomePage';\nexport { registerHomeComponents, DefaultHomeComponents } from '../../components/home/register';\nexport { registerHomeComponentConfig } from '../../components/home';\nexport type { HomePageProps } from './types';\nexport type { HomeLoaderData } from './loader';\nexport type {\n HomeComponentsProps,\n AnyHomeComponent,\n HomeComponentConfig,\n} from '../../components/home';\n\nfunction loader(_ctx?: { locale?: string }): Promise<HomeLoaderData> {\n return homeLoader({ locale: _ctx?.locale });\n}\n\nfunction head(ctx: TwilightContext): HeadDescriptor {\n const store = ctx.settings?.store;\n if (!store) return {};\n\n const title = store.meta?.title ?? store.name;\n const description = store.meta?.description ?? store.description;\n const keywords = store.meta?.keywords;\n // `/ar`, like Twig, where store.url reads `/ar/`.\n const url = storePageUrl(ctx.settings, ctx.location.pathname) ?? store.url;\n\n return {\n title,\n description,\n keywords,\n canonical: url,\n openGraph: {\n type: 'website',\n title,\n description,\n images: store.logo,\n url,\n },\n twitter: {\n card: 'summary_large_image',\n title,\n description,\n images: store.logo,\n },\n alternateLanguages: buildHreflangAlternates(ctx.settings, ctx.location.pathname),\n };\n}\n\nexport const Home = { id: RouteId.INDEX, loader, head, Component: HomePage } as const;\n\nexport { homeLoader };\n"]}
@@ -1,8 +1,8 @@
1
- import { customUrlRedirect } from './chunk-MU7FXR2Q.js';
1
+ import { customUrlRedirect } from './chunk-IUHIUV26.js';
2
2
  import { PRODUCT_SLUG_ROUTE_ID } from './chunk-NV4PF3O3.js';
3
- import { product } from './chunk-EYGDVKW7.js';
3
+ import { product } from './chunk-VXWBXATO.js';
4
4
  import { productKeyOfId, publicProductKeyPath } from './chunk-SDBR4X3K.js';
5
- import { notFound, orThrow, isMissingResource } from './chunk-FREN7T2I.js';
5
+ import { notFound, orThrow, isMissingResource } from './chunk-OFKVQZYA.js';
6
6
 
7
7
  // src/routes/product/id.ts
8
8
  var PRODUCT_ID = /^\d{1,18}$/;
@@ -42,5 +42,5 @@ async function resolveProductKeyPage(page, queryClient, address) {
42
42
  }
43
43
 
44
44
  export { isProductId, productOfKey, resolveProductKeyPage };
45
- //# sourceMappingURL=chunk-NC2G27YJ.js.map
46
- //# sourceMappingURL=chunk-NC2G27YJ.js.map
45
+ //# sourceMappingURL=chunk-5ZFU7LTC.js.map
46
+ //# sourceMappingURL=chunk-5ZFU7LTC.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/routes/product/id.ts","../src/routes/product/key.ts"],"names":[],"mappings":";;;;;;;AAWA,IAAM,UAAA,GAAa,YAAA;AAGZ,SAAS,YAAY,KAAA,EAAoC;AAC9D,EAAA,OAAO,UAAA,CAAW,IAAA,CAAK,KAAA,IAAS,EA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,OAAA,CAAQ;AAAA,OACvB,CAAA;AAAA,IACH;AACA,IAAA,QAAA,EAAS;AAAA,EACX;AACF","file":"chunk-NC2G27YJ.js","sourcesContent":["/**\n * A product id: 1 to 18 digits.\n *\n * The API keeps product ids in a signed 64-bit integer. Up to 9223372036854775807 it answers\n * a missing product with 410; one past that, it answers 417, which is neither 404 nor 410, so\n * the page went out as a 500 (`/-/p99999999999999999999999`, which scanners ask for). Every\n * 18-digit number fits; real ids have about 10.\n *\n * `TWIG_PRODUCT_URL` in `../seo-redirects.ts` carries the same cap. Both are literals, because static\n * analysis flags a `RegExp` built from a string.\n */\nconst PRODUCT_ID = /^\\d{1,18}$/;\n\n/** Whether `value` can be a product id the API answers 200 or 410 for. */\nexport function isProductId(value: string | undefined): boolean {\n return PRODUCT_ID.test(value ?? '');\n}\n","/**\n * @fileoverview The product at a SKU-link address (`/{key}-{name}`, see `router/product-key-urls`).\n *\n * The rewrite hands the product route an id of `~{key}`. The key is `p{id}` (the product id\n * itself) or a SKU of letters and digits, as Twig's `getProductBySkuOrId` reads it.\n */\nimport type { QueryClient } from '@tanstack/react-query';\nimport type { Product } from '../../types';\nimport { product } from '../../api/product';\nimport { isMissingResource, notFound, orThrow } from '../../providers/NavigationProvider';\nimport { productKeyOfId, publicProductKeyPath } from '../../router/product-key-urls';\nimport { PRODUCT_SLUG_ROUTE_ID } from '../../router/slug-routes';\nimport { customUrlRedirect, type CustomUrlRedirectOptions } from '../custom-urls';\nimport { isProductId } from './id';\n\n/** `p{id}`: Sluggable's key for a product whose SKU is not letters and digits. */\nconst ID_KEY = /^p(\\d+)$/;\n\n/**\n * The product a key names: by id for `p{id}`, else by SKU. A SKU is read through the query cache,\n * which `resolveProductKeyPage` filled in the same navigation, so it costs one call.\n */\nexport async function productOfKey(\n key: string,\n queryClient?: QueryClient | null\n): Promise<Product> {\n const id = ID_KEY.exec(key)?.[1];\n if (id !== undefined) {\n // Past 18 digits the API answers 417, not 404 (see `./id`).\n if (!isProductId(id)) return notFound();\n return product.findOrThrow(id);\n }\n return orThrow(\n queryClient ? queryClient.ensureQueryData(product.queries.bySku(key)) : product.findBySku(key)\n );\n}\n\n/** The address a SKU-link lookup was made for, so a miss can still be one of the merchant's custom URLs. */\nexport interface ProductKeyAddress {\n /** The router's location: the internal path (`/{name}/p~{key}`) and the query string. */\n location: { pathname: string; searchStr: string };\n /** The language segment an item's page takes (the locale layout's rule). */\n targetLocale?: CustomUrlRedirectOptions['targetLocale'];\n}\n\n/**\n * Run by the locale layout's `beforeLoad`: a SKU that names no product is the not-found page, a\n * 404, as Twig's catch-all answers it, unless the address is one of the merchant's custom URLs.\n * Twig tries those after its SKU route: `/values-in-action` is first SKU `values`.\n *\n * It is resolved here, ahead of the product loader, because a theme may turn that loader's\n * not-found into something else: Raed sends it home with a toast. That suits a product that was\n * deleted, but not `/new-arrivals` or a scanner's path, which only look like a SKU link. The\n * answer stays in the query cache for the loader.\n */\nexport async function resolveProductKeyPage(\n page: { routeId: string; params: Record<string, string | undefined> } | undefined,\n queryClient: QueryClient,\n address?: ProductKeyAddress\n): Promise<void> {\n if (page?.routeId !== PRODUCT_SLUG_ROUTE_ID) return;\n const key = productKeyOfId(page.params.id);\n if (!key || ID_KEY.test(key)) return;\n try {\n await queryClient.ensureQueryData(product.queries.bySku(key));\n } catch (error) {\n if (!isMissingResource(error)) throw error;\n const publicPath = address && publicProductKeyPath(address.location.pathname);\n if (publicPath) {\n await customUrlRedirect(publicPath, address.location.searchStr, {\n queryClient,\n targetLocale: address.targetLocale,\n });\n }\n notFound();\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/routes/product/id.ts","../src/routes/product/key.ts"],"names":[],"mappings":";;;;;;;AAWA,IAAM,UAAA,GAAa,YAAA;AAGZ,SAAS,YAAY,KAAA,EAAoC;AAC9D,EAAA,OAAO,UAAA,CAAW,IAAA,CAAK,KAAA,IAAS,EAAE,CAAA;AACpC;;;ACAA,IAAM,MAAA,GAAS,UAAA;AAMf,eAAsB,YAAA,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AAA,EACX;AACF","file":"chunk-5ZFU7LTC.js","sourcesContent":["/**\n * A product id: 1 to 18 digits.\n *\n * The API keeps product ids in a signed 64-bit integer. Up to 9223372036854775807 it answers\n * a missing product with 410; one past that, it answers 417, which is neither 404 nor 410, so\n * the page went out as a 500 (`/-/p99999999999999999999999`, which scanners ask for). Every\n * 18-digit number fits; real ids have about 10.\n *\n * `TWIG_PRODUCT_URL` in `../seo-redirects.ts` carries the same cap. Both are literals, because static\n * analysis flags a `RegExp` built from a string.\n */\nconst PRODUCT_ID = /^\\d{1,18}$/;\n\n/** Whether `value` can be a product id the API answers 200 or 410 for. */\nexport function isProductId(value: string | undefined): boolean {\n return PRODUCT_ID.test(value ?? '');\n}\n","/**\n * @fileoverview The product at a SKU-link address (`/{key}-{name}`, see `router/product-key-urls`).\n *\n * The rewrite hands the product route an id of `~{key}`. The key is `p{id}` (the product id\n * itself) or a SKU of letters and digits, as Twig's `getProductBySkuOrId` reads it.\n */\nimport type { QueryClient } from '@tanstack/react-query';\nimport type { Product } from '../../types';\nimport { product } from '../../api/product';\nimport { isMissingResource, notFound, orThrow } from '../../providers/NavigationProvider';\nimport { productKeyOfId, publicProductKeyPath } from '../../router/product-key-urls';\nimport { PRODUCT_SLUG_ROUTE_ID } from '../../router/slug-routes';\nimport { customUrlRedirect, type CustomUrlRedirectOptions } from '../custom-urls';\nimport { isProductId } from './id';\n\n/** `p{id}`: Sluggable's key for a product whose SKU is not letters and digits. */\nconst ID_KEY = /^p(\\d+)$/;\n\n/**\n * The product a key names: by id for `p{id}`, else by SKU. A SKU is read through the query cache,\n * which `resolveProductKeyPage` filled in the same navigation, so it costs one call.\n */\nexport async function productOfKey(\n key: string,\n queryClient?: QueryClient | null\n): Promise<Product> {\n const id = ID_KEY.exec(key)?.[1];\n if (id !== undefined) {\n // Past 18 digits the API answers 417, not 404 (see `./id`).\n if (!isProductId(id)) return notFound();\n return product.findOrThrow(id);\n }\n return orThrow(\n queryClient ? queryClient.ensureQueryData(product.queries.bySku(key)) : product.findBySku(key)\n );\n}\n\n/** The address a SKU-link lookup was made for, so a miss can still be one of the merchant's custom URLs. */\nexport interface ProductKeyAddress {\n /** The router's location: the internal path (`/{name}/p~{key}`) and the query string. */\n location: { pathname: string; searchStr: string };\n /** The language segment an item's page takes (the locale layout's rule). */\n targetLocale?: CustomUrlRedirectOptions['targetLocale'];\n}\n\n/**\n * Run by the locale layout's `beforeLoad`: a SKU that names no product is the not-found page, a\n * 404, as Twig's catch-all answers it, unless the address is one of the merchant's custom URLs.\n * Twig tries those after its SKU route: `/values-in-action` is first SKU `values`.\n *\n * It is resolved here, ahead of the product loader, because a theme may turn that loader's\n * not-found into something else: Raed sends it home with a toast. That suits a product that was\n * deleted, but not `/new-arrivals` or a scanner's path, which only look like a SKU link. The\n * answer stays in the query cache for the loader.\n */\nexport async function resolveProductKeyPage(\n page: { routeId: string; params: Record<string, string | undefined> } | undefined,\n queryClient: QueryClient,\n address?: ProductKeyAddress\n): Promise<void> {\n if (page?.routeId !== PRODUCT_SLUG_ROUTE_ID) return;\n const key = productKeyOfId(page.params.id);\n if (!key || ID_KEY.test(key)) return;\n try {\n await queryClient.ensureQueryData(product.queries.bySku(key));\n } catch (error) {\n if (!isMissingResource(error)) throw error;\n const publicPath = address && publicProductKeyPath(address.location.pathname);\n if (publicPath) {\n await customUrlRedirect(publicPath, address.location.searchStr, {\n queryClient,\n targetLocale: address.targetLocale,\n });\n }\n notFound();\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { useIsHome } from './chunk-FREN7T2I.js';
2
- import { PageAdvertisements } from './chunk-LGB6KWZN.js';
1
+ import { useIsHome } from './chunk-OFKVQZYA.js';
2
+ import { PageAdvertisements } from './chunk-IOSJKP7Y.js';
3
3
  import { HookSlot, useIsClient } from './chunk-XZFWBF3P.js';
4
4
  import { useTranslation } from './chunk-TYNZ5B2B.js';
5
5
  import { Image } from './chunk-IVO6YRRK.js';
@@ -16,10 +16,10 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
16
16
 
17
17
  // src/components/navigation/lazy.ts
18
18
  var LazyMainMenu = lazyComponent(
19
- () => import('./MainMenu-VS6ACI36.js').then((m) => ({ default: m.MainMenu }))
19
+ () => import('./MainMenu-3FRRSA75.js').then((m) => ({ default: m.MainMenu }))
20
20
  );
21
21
  var LazyMobileMenu = lazyComponent(
22
- () => import('./MobileMenu-HI4UOJAG.js').then((m) => ({ default: m.MobileMenu }))
22
+ () => import('./MobileMenu-FEUDYZ42.js').then((m) => ({ default: m.MobileMenu }))
23
23
  );
24
24
  function HeaderContacts() {
25
25
  const { store } = useTwilight();
@@ -130,5 +130,5 @@ function Header(_props) {
130
130
  }
131
131
 
132
132
  export { Header };
133
- //# sourceMappingURL=chunk-AB2LBQTZ.js.map
134
- //# sourceMappingURL=chunk-AB2LBQTZ.js.map
133
+ //# sourceMappingURL=chunk-6U2R3COR.js.map
134
+ //# sourceMappingURL=chunk-6U2R3COR.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/navigation/lazy.ts","../src/components/layout/Header.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAMO,IAAM,YAAA,GAAe,aAAA;AAAA,EAAc,MACxC,OAAO,wBAAY,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,QAAA,EAAS,CAAE;AAC5D,CAAA;AAEO,IAAM,cAAA,GAAiB,aAAA;AAAA,EAAc,MAC1C,OAAO,0BAAc,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,UAAA,EAAW,CAAE;AAChE,CAAA;ACYA,SAAS,cAAA,GAAiB;AACxB,EAAA,MAAM,EAAE,KAAA,EAAM,GAAI,WAAA,EAAY;AAC9B,EAAA,MAAM,WAAW,WAAA,EAAY;AAC7B,EAAA,IAAI,CAAC,UAAU,OAAO,IAAA;AACtB,EAAA,uBAAO,GAAA,CAAC,iBAAc,QAAA,E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A,CAAC,kBAAW,MAAA,EAAQ,gBAAA,EAAkB,SAAS,MAAM,mBAAA,CAAoB,KAAK,CAAA,EAAG,CAAA;AAAA,oBACjF,GAAA,CAAC,QAAA,EAAA,EAAS,IAAA,EAAK,YAAA,EAAa;AAAA,GAAA,EAC9B,CAAA;AAEJ","file":"chunk-AB2LBQTZ.js","sourcesContent":["import { lazyComponent } from '../../utils/lazy-component';\n\n/**\n * Lazy-loaded navigation components\n * Use these for code-splitting navigation sections\n */\nexport const LazyMainMenu = lazyComponent(() =>\n import('./MainMenu').then((m) => ({ default: m.MainMenu }))\n);\n\nexport const LazyMobileMenu = lazyComponent(() =>\n import('./MobileMenu').then((m) => ({ default: m.MobileMenu }))\n);\n","import { useState } from 'react';\nimport { useIsHome } from '../../providers/NavigationProvider';\nimport { SallaCartSummary } from '@salla.sa/twilight-components-react/cart-summary';\nimport { SallaContacts } from '@salla.sa/twilight-components-react/contacts';\nimport { SallaLocalizationModal } from '@salla.sa/twilight-components-react/localization-modal';\nimport { SallaMenu } from '@salla.sa/twilight-components-react/menu';\nimport { SallaSearch } from '@salla.sa/twilight-components-react/search';\nimport { SallaUserMenu } from '@salla.sa/twilight-components-react/user-menu';\nimport { useTwilight } from '../../providers/twilight-context';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport { HookSlot } from '../../hooks/HookSlot';\nimport { useIsClient } from '../../hooks/useIsClient';\nimport { MainMenu, MobileMenu } from '../navigation';\nimport { Image } from '../common';\nimport { PageAdvertisements } from './PageAdvertisements';\nimport type { Cart } from '../../types';\n\ninterface HeaderProps {\n cart?: Cart;\n}\n\n/** The store's phone and email in the top nav. `<salla-contacts>` fills its light DOM\n * once the SDK is ready, which can come before React hydrates it: a hydration error\n * (React #418). So it renders after mount. */\nfunction HeaderContacts() {\n const { store } = useTwilight();\n const isClient = useIsClient();\n if (!isClient) return null;\n return <SallaContacts contacts={store?.contacts} contactsTitle=\"N/A\" isHeader />;\n}\n\nexport function Header(_props: HeaderProps) {\n const { currency, theme, store } = useTwilight();\n const { locale, languageName } = useTranslation();\n const settings = theme?.settings || {};\n const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);\n\n // Check if we're on homepage\n const isHomepage = useIsHome();\n\n const StoreTitle = isHomepage ? 'h1' : 'span';\n\n return (\n <header className=\"store-header\" suppressHydrationWarning>\n <HookSlot name=\"header:start\" />\n <div className=\"advertisement-slot\">\n <PageAdvertisements />\n </div>\n {/* Top Nav */}\n <div className={`top-navbar${settings.topnav_is_dark ? ' top-navbar--dark' : ''}`}>\n <div className=\"container flex justify-between\">\n <div className=\"flex-1 flex items-center gap-2\">\n {/* Footer Menu */}\n {settings.important_links && <SallaMenu source=\"footer\" topnav />}\n\n {/* Language & Currency */}\n <div className=\"header-buttons\">\n {(store?.settings?.is_multilingual || store?.settings?.currencies_enabled) && (\n <>\n <button\n type=\"button\"\n onClick={() => window.salla?.event.dispatch('localization::open')}\n className=\"btn--rounded-gray basis-0\"\n >\n <span>{languageName}</span>\n <span className=\"mx-1.5\">|</span>\n <span className={`flag iti__flag iti__${store?.country.toLowerCase()}`}></span>\n\n <span>\n {store?.settings?.use_sar_symbol && currency?.code === 'SAR' ? (\n <i className=\"sicon-sar\"></i>\n ) : (\n <>{currency?.symbol}</>\n )}\n </span>\n </button>\n {/* TODO:: support switch the lang without hit the web API, by set it in the sdk and local storage */}\n {/* TODO:: Support switch the curency without hit the web API, by set it in the sdk and local storage */}\n <SallaLocalizationModal\n language={locale}\n currency={currency?.code || 'SAR'}\n suppressHydrationWarning\n />\n </>\n )}\n </div>\n\n {/* Scopes / Branches */}\n {store?.scope && (\n <button\n type=\"button\"\n className=\"btn--rounded-gray\"\n onClick={() =>\n window.salla?.event.dispatch('scopes::open', {\n mode: 'default',\n })\n }\n >\n <i className=\"sicon-location rtl:ml-1 ltr:mr-1\"></i>\n {store.scope.name}\n </button>\n )}\n\n {/* Search bar */}\n <div className=\"header-search flex-1\">\n {/* todo:: use a search icon insted with open the search popup */}\n <SallaSearch inline oval height={36} />\n </div>\n </div>\n\n <HeaderContacts />\n </div>\n </div>\n\n {/* Main Nav */}\n <div\n id=\"mainnav\"\n className={`main-nav-container shadow-default bg-white flex items-center relative z-50${settings.header_is_sticky ? ' sticky top-0' : ''}`}\n >\n <div className=\"inner bg-inherit w-full\">\n <div className=\"container\">\n <div className=\"flex items-stretch justify-between relative\">\n <div className=\"flex items-center\">\n <a\n className=\"lg:hidden mburger mburger--collapse leading-none rtl:ml-4 ltr:mr-4\"\n href=\"#mobile-menu\"\n aria-label=\"Open-menu\"\n onClick={(e) => {\n e.preventDefault();\n setIsMobileMenuOpen(true);\n }}\n >\n <i className=\"sicon-menu text-primary text-2xl\"></i>\n </a>\n <a className=\"navbar-brand\" href={store?.url || '/'}>\n <div className=\"logo-wrapper\">\n <Image\n src={store?.logo}\n alt={`${store?.name || 'Store'} logo`}\n priority\n width={120}\n height={48}\n />\n </div>\n <StoreTitle className=\"sr-only\">{store?.name || 'Store'}</StoreTitle>\n </a>\n <MainMenu />\n </div>\n <div className=\"flex items-center justify-end my-2.5\">\n <SallaUserMenu avatarOnly showHeader className=\"header-btn\" />\n <SallaCartSummary className=\"ml-4 rtl:ml-[unset] rtl:mr-4\">\n <i slot=\"icon\" className=\"header-btn__icon icon sicon-shopping-bag\"></i>\n </SallaCartSummary>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n {/* Mobile Menu */}\n <MobileMenu isOpen={isMobileMenuOpen} onClose={() => setIsMobileMenuOpen(false)} />\n <HookSlot name=\"header:end\" />\n </header>\n );\n}\n"]}
1
+ {"version":3,"sources":["../src/components/navigation/lazy.ts","../src/components/layout/Header.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAMO,IAAM,YAAA,GAAe,aAAA;AAAA,EAAc,MACxC,OAAO,wBAAY,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,QAAA,EAAS,CAAE;AAC5D,CAAA;AAEO,IAAM,cAAA,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AAA,4BAAA,GAAA,CAAC,iBAAc,UAAA,EAAU,IAAA,EAAC,UAAA,EAAU,IAAA,EAAC,WAAU,YAAA,EAAa,CAAA;AAAA,4BAC5D,GAAA,CAAC,gBAAA,EAAA,EAAiB,SAAA,EAAU,8BAAA,EAC1B,QAAA,kBAAA,GAAA,CAAC,OAAE,IAAA,EAAK,MAAA,EAAO,SAAA,EAAU,0CAAA,EAA2C,CAAA,EACtE;AAAA,WAAA,EACF;AAAA,SAAA,EACF,GACF,CAAA,EACF;AAAA;AAAA,KACF;AAAA,oBAGA,GAAA,CAAC,kBAAW,MAAA,EAAQ,gBAAA,EAAkB,SAAS,MAAM,mBAAA,CAAoB,KAAK,CAAA,EAAG,CAAA;AAAA,oBACjF,GAAA,CAAC,QAAA,EAAA,EAAS,IAAA,EAAK,YAAA,EAAa;AAAA,GAAA,EAC9B,CAAA;AAEJ","file":"chunk-6U2R3COR.js","sourcesContent":["import { lazyComponent } from '../../utils/lazy-component';\n\n/**\n * Lazy-loaded navigation components\n * Use these for code-splitting navigation sections\n */\nexport const LazyMainMenu = lazyComponent(() =>\n import('./MainMenu').then((m) => ({ default: m.MainMenu }))\n);\n\nexport const LazyMobileMenu = lazyComponent(() =>\n import('./MobileMenu').then((m) => ({ default: m.MobileMenu }))\n);\n","import { useState } from 'react';\nimport { useIsHome } from '../../providers/NavigationProvider';\nimport { SallaCartSummary } from '@salla.sa/twilight-components-react/cart-summary';\nimport { SallaContacts } from '@salla.sa/twilight-components-react/contacts';\nimport { SallaLocalizationModal } from '@salla.sa/twilight-components-react/localization-modal';\nimport { SallaMenu } from '@salla.sa/twilight-components-react/menu';\nimport { SallaSearch } from '@salla.sa/twilight-components-react/search';\nimport { SallaUserMenu } from '@salla.sa/twilight-components-react/user-menu';\nimport { useTwilight } from '../../providers/twilight-context';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport { HookSlot } from '../../hooks/HookSlot';\nimport { useIsClient } from '../../hooks/useIsClient';\nimport { MainMenu, MobileMenu } from '../navigation';\nimport { Image } from '../common';\nimport { PageAdvertisements } from './PageAdvertisements';\nimport type { Cart } from '../../types';\n\ninterface HeaderProps {\n cart?: Cart;\n}\n\n/** The store's phone and email in the top nav. `<salla-contacts>` fills its light DOM\n * once the SDK is ready, which can come before React hydrates it: a hydration error\n * (React #418). So it renders after mount. */\nfunction HeaderContacts() {\n const { store } = useTwilight();\n const isClient = useIsClient();\n if (!isClient) return null;\n return <SallaContacts contacts={store?.contacts} contactsTitle=\"N/A\" isHeader />;\n}\n\nexport function Header(_props: HeaderProps) {\n const { currency, theme, store } = useTwilight();\n const { locale, languageName } = useTranslation();\n const settings = theme?.settings || {};\n const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);\n\n // Check if we're on homepage\n const isHomepage = useIsHome();\n\n const StoreTitle = isHomepage ? 'h1' : 'span';\n\n return (\n <header className=\"store-header\" suppressHydrationWarning>\n <HookSlot name=\"header:start\" />\n <div className=\"advertisement-slot\">\n <PageAdvertisements />\n </div>\n {/* Top Nav */}\n <div className={`top-navbar${settings.topnav_is_dark ? ' top-navbar--dark' : ''}`}>\n <div className=\"container flex justify-between\">\n <div className=\"flex-1 flex items-center gap-2\">\n {/* Footer Menu */}\n {settings.important_links && <SallaMenu source=\"footer\" topnav />}\n\n {/* Language & Currency */}\n <div className=\"header-buttons\">\n {(store?.settings?.is_multilingual || store?.settings?.currencies_enabled) && (\n <>\n <button\n type=\"button\"\n onClick={() => window.salla?.event.dispatch('localization::open')}\n className=\"btn--rounded-gray basis-0\"\n >\n <span>{languageName}</span>\n <span className=\"mx-1.5\">|</span>\n <span className={`flag iti__flag iti__${store?.country.toLowerCase()}`}></span>\n\n <span>\n {store?.settings?.use_sar_symbol && currency?.code === 'SAR' ? (\n <i className=\"sicon-sar\"></i>\n ) : (\n <>{currency?.symbol}</>\n )}\n </span>\n </button>\n {/* TODO:: support switch the lang without hit the web API, by set it in the sdk and local storage */}\n {/* TODO:: Support switch the curency without hit the web API, by set it in the sdk and local storage */}\n <SallaLocalizationModal\n language={locale}\n currency={currency?.code || 'SAR'}\n suppressHydrationWarning\n />\n </>\n )}\n </div>\n\n {/* Scopes / Branches */}\n {store?.scope && (\n <button\n type=\"button\"\n className=\"btn--rounded-gray\"\n onClick={() =>\n window.salla?.event.dispatch('scopes::open', {\n mode: 'default',\n })\n }\n >\n <i className=\"sicon-location rtl:ml-1 ltr:mr-1\"></i>\n {store.scope.name}\n </button>\n )}\n\n {/* Search bar */}\n <div className=\"header-search flex-1\">\n {/* todo:: use a search icon insted with open the search popup */}\n <SallaSearch inline oval height={36} />\n </div>\n </div>\n\n <HeaderContacts />\n </div>\n </div>\n\n {/* Main Nav */}\n <div\n id=\"mainnav\"\n className={`main-nav-container shadow-default bg-white flex items-center relative z-50${settings.header_is_sticky ? ' sticky top-0' : ''}`}\n >\n <div className=\"inner bg-inherit w-full\">\n <div className=\"container\">\n <div className=\"flex items-stretch justify-between relative\">\n <div className=\"flex items-center\">\n <a\n className=\"lg:hidden mburger mburger--collapse leading-none rtl:ml-4 ltr:mr-4\"\n href=\"#mobile-menu\"\n aria-label=\"Open-menu\"\n onClick={(e) => {\n e.preventDefault();\n setIsMobileMenuOpen(true);\n }}\n >\n <i className=\"sicon-menu text-primary text-2xl\"></i>\n </a>\n <a className=\"navbar-brand\" href={store?.url || '/'}>\n <div className=\"logo-wrapper\">\n <Image\n src={store?.logo}\n alt={`${store?.name || 'Store'} logo`}\n priority\n width={120}\n height={48}\n />\n </div>\n <StoreTitle className=\"sr-only\">{store?.name || 'Store'}</StoreTitle>\n </a>\n <MainMenu />\n </div>\n <div className=\"flex items-center justify-end my-2.5\">\n <SallaUserMenu avatarOnly showHeader className=\"header-btn\" />\n <SallaCartSummary className=\"ml-4 rtl:ml-[unset] rtl:mr-4\">\n <i slot=\"icon\" className=\"header-btn__icon icon sicon-shopping-bag\"></i>\n </SallaCartSummary>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n {/* Mobile Menu */}\n <MobileMenu isOpen={isMobileMenuOpen} onClose={() => setIsMobileMenuOpen(false)} />\n <HookSlot name=\"header:end\" />\n </header>\n );\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { filesCdn, cdn } from './chunk-QBVKHDAP.js';
1
+ import { filesCdn, cdn } from './chunk-S6EGQM36.js';
2
2
  import { storeTranslationsQueryKey, translationsQueryKey, composeMessages, isPlainObject } from './chunk-MWUAHDQL.js';
3
3
  import { queryOptions } from '@tanstack/react-query';
4
4
 
@@ -126,5 +126,5 @@ var translations = {
126
126
  };
127
127
 
128
128
  export { commonTranslationsPath, storeTranslationsPath, translations };
129
- //# sourceMappingURL=chunk-GNECZLCV.js.map
130
- //# sourceMappingURL=chunk-GNECZLCV.js.map
129
+ //# sourceMappingURL=chunk-7NEJCQQ3.js.map
130
+ //# sourceMappingURL=chunk-7NEJCQQ3.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/api/translations.ts"],"names":[],"mappings":";;;;AAiEA,IAAM,kBAAA,GAAqB,sBAAA;AAGpB,SAAS,uBAAuB,MAAA,EAAwB;AAC7D,EAAA,OAAO,uBAAuB,MAAM,CAAA,KAAA,CAAA;AACtC;AAWO,SAAS,qBAAA,CAAsB,SAA0B,MAAA,EAAwB;AACtF,EAAA,OAAO,CAAA,aAAA,EAAgB,OAAO,CAAA,CAAA,EAAI,MAAM,CAAA,KAAA,CAAA;AAC1C;AAUA,eAAe,eACb,IAAA,EACA,EAAE,aAAa,KAAA,EAAM,GAA8B,EAAC,EAC1B;AAE1B,EAAA,MAAM,UAAA,GAAa,CAAC,MAAA,EAAgB,KAAA,KAA0B;AAC5D,IAAA,IAAI,UAAA,EAAY,MAAM,IAAI,KAAA,CAAM,CAAA,eAAA,EAAkB,IAAI,CAAA,EAAA,EAAK,MAAM,CAAA,CAAA,EAAI,EAAE,KAAA,EAAO,CAAA;AAC9E,IAAA,OAAA,CAAQ,IAAA,CAAK,gBAAA,EAAkB,MAAA,EAAQ,IAAA,EAAM,SAAS,EAAE,CAAA;AACx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,OAAA,EAA0B,MAAA,KAClC,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,yBAAA,CAA0B,OAAA,EAAS,MAAM,CAAA;AAAA,MACnD,OAAA,EAAS,MAAM,YAAA,CAAa,QAAA,CAAS,SAAS,MAAM;AAAA,KACrD;AAAA;AAEP","file":"chunk-GNECZLCV.js","sourcesContent":["/**\n * @fileoverview Where a storefront's words come from.\n *\n * Two files, merged: the platform's copy for this language, and the merchant's\n * own edits for this language and this store. Both are plain JSON objects on\n * the uploader's CDN, one per language.\n *\n * ```\n * https://cdn.files.salla.network/translations/common/<locale>.json the platform's\n * https://cdn.files.salla.network/translations/<storeId>/<locale>.json the merchant's\n * ```\n *\n * **What this replaces, and why.** Until now the engine read a single global\n * file, `cdn.salla.network/js/translations.json`, holding every language keyed\n * `\"<locale>.trans\"`. Nothing publishes that file: it is an object last written\n * on 2026-03-26, carrying only `ar` and `en` where the platform has 39 locales,\n * 405 keys behind `Languages-Module` and 959 English strings textually\n * different from it. So every React storefront has been serving copy from\n * March, and a key added since has never reached one. It also carried no\n * merchant overrides at all — a merchant editing their theme's wording in the\n * Dashboard changed nothing on a React theme.\n *\n * **Merchant overrides are read, and only when there are any.** Getting here\n * took two corrections worth keeping.\n *\n * The first is the address. A merchant's own wording lives at\n * `translations/<storeId>/<locale>.json`, keyed by `store()->getRouteKey()` —\n * the Optimus-encoded numeric id. An early version addressed it with\n * `resolveStoreIdentifier()`, on the claim that the two are the same string.\n * That is true of the `store-identifier` *header*, which accepts a host, a\n * username or an id, and false of the R2 key: on a custom domain the resolver\n * returns `reefperfumes.com` and on a shared host a username like\n * `mtgr-alaatr-2`. Both 404, both then read as \"this store has no overrides\",\n * and the merchant's wording silently never appears — so the feature would have\n * worked under `?storeId=` alone, which is preview and localhost. It is\n * `settings.store.id` now, which is known only after the settings query.\n *\n * The second is when to ask at all. Most stores have never customised a word,\n * and a miss is an uncached round trip (`cf-cache-status: DYNAMIC` on the 404)\n * on the critical path of every SSR render. So the request is made only when\n * `settings.languages[<ISO>].has_custom_translations` says there is something\n * to get — a flag `Languages-Module` writes when a merchant saves a\n * translation. A store without overrides pays nothing, which is what made this\n * shippable at all.\n *\n * ⚠️ The flag is written on save, so a store whose wording predates it reads as\n * `false` until someone edits a translation or the backfill runs. That is a\n * store keeping today's behaviour, not a regression — React themes have never\n * read merchant overrides — but it does mean the feature is only as complete as\n * the backfill.\n *\n * **Rollout is by fallback, not by flag.** `translations/common/` is written by\n * a sync in the theme build service that may not have run yet, and a hard switch\n * would leave every storefront with no platform strings at all. A missing common\n * file therefore falls back to the old global one, which is exactly today's\n * behaviour — so this is safe to ship before the bucket is populated, and stops\n * using the fallback on its own once it is.\n */\nimport { queryOptions } from '@tanstack/react-query';\nimport { cdn, filesCdn } from './client';\nimport { storeTranslationsQueryKey, translationsQueryKey } from './translations-key';\nimport { composeMessages, isPlainObject, type Messages } from './messages';\nimport type { TranslationMessages } from '../providers/I18nProvider';\n\n/** The global file this used to be the only reader of. See the file comment. */\nconst LEGACY_GLOBAL_FILE = 'js/translations.json';\n\n/** One language of platform copy, shared by every store. */\nexport function commonTranslationsPath(locale: string): string {\n return `translations/common/${locale}.json`;\n}\n\n/**\n * One language of a single merchant's own wording.\n *\n * `storeId` is `settings.store.id`, which is the value `Languages-Module` names\n * the object with (`store()->getRouteKey()`, the Optimus-encoded numeric id).\n * It is **not** `resolveStoreIdentifier()`: that returns a hostname on a custom\n * domain and a username on a shared host, both of which 404 here and would read\n * as \"this merchant has no overrides\" — silently, on every store but a preview.\n */\nexport function storeTranslationsPath(storeId: string | number, locale: string): string {\n return `translations/${storeId}/${locale}.json`;\n}\n\n/**\n * Reads one language file, or `null` when there is nothing to read.\n *\n * A 404 is the ordinary answer, not a failure: most stores have never had a\n * word customised, so their file does not exist. Distinguishing it from a real\n * error matters only for the log — both end in `null` — but a warning on every\n * page load of every uncustomised store is a warning nobody will read.\n */\nasync function readLocaleFile(\n path: string,\n { failLoudly = false }: { failLoudly?: boolean } = {}\n): Promise<Messages | null> {\n /** A 404 always means \"absent\"; everything else is a failure to read. */\n const unreadable = (reason: string, cause?: unknown): null => {\n if (failLoudly) throw new Error(`[translations] ${path}: ${reason}`, { cause });\n console.warn('[translations]', reason, path, cause ?? '');\n return null;\n };\n\n try {\n const response = await filesCdn.get(path, { throwHttpErrors: false, timeout: 5000 });\n if (response.status === 404) return null;\n\n if (!response.ok) {\n return unreadable(`answered ${response.status}`);\n }\n\n const data: unknown = await response.json();\n if (!isPlainObject(data)) {\n return unreadable('is not a JSON object');\n }\n\n return data;\n } catch (error) {\n if (error instanceof Error && error.message.startsWith('[translations]')) throw error;\n return unreadable('could not be read', error);\n }\n}\n\n/**\n * The pre-CDN global file, sliced to one language.\n *\n * Only reached when `translations/common/<locale>.json` is missing, which is\n * the state of the bucket until the sync has run once.\n */\nasync function readLegacyGlobal(locale: string): Promise<Messages | null> {\n try {\n const data = await cdn.get(LEGACY_GLOBAL_FILE, { timeout: 5000 }).json<TranslationMessages>();\n const forLocale = data?.[`${locale}.trans`];\n return isPlainObject(forLocale) ? forLocale : null;\n } catch {\n console.warn('[translations] the legacy global file could not be read either');\n return null;\n }\n}\n\nexport const translations = {\n /**\n * The platform's copy for `locale`.\n *\n * One file, so one request. See the file comment for why the merchant's own\n * wording is not merged in here yet and what it is waiting on.\n */\n get: async (locale: string): Promise<TranslationMessages | null> => {\n const common = await readLocaleFile(commonTranslationsPath(locale));\n const base = common ?? (await readLegacyGlobal(locale));\n if (!base) return null;\n\n // Still wrapped in the `<locale>.trans` shape the rest of the engine reads.\n // `createI18nInstance` slices by that key and so does the SDK bridge in\n // `I18nProvider`; changing the envelope here would be a second change for\n // no gain, since one language is all any of them ever take out of it.\n return { [`${locale}.trans`]: base as Record<string, string> };\n },\n\n /**\n * This merchant's own wording for `locale`, or `null` if they have none.\n *\n * Only worth calling when `settings.languages[<ISO>].has_custom_translations`\n * says there is something to get. Most stores have never customised a word,\n * and a miss here is an uncached round trip — `cf-cache-status: DYNAMIC` on a\n * 404 — on the critical path of an SSR render. The flag is what makes this\n * free for everyone who does not use it.\n *\n * Returned unwrapped, unlike {@link translations.get}: this is merged into\n * that one's messages rather than handed to i18next on its own.\n */\n forStore: async (storeId: string | number, locale: string): Promise<Messages | null> =>\n // `failLoudly`, unlike the platform file: this is only ever called because\n // the settings said overrides exist, so a 500, a timeout or a body that is\n // not JSON is a failure to read them — not a store that has none. Returning\n // `null` there would cache \"no overrides\" as a success, skip the query's\n // retry, and serve Salla's wording in place of the merchant's until the\n // entry expired. A 404 still means absent, and `rootBeforeLoad` catches the\n // throw and keeps the platform copy, so the worst case is unchanged.\n readLocaleFile(storeTranslationsPath(storeId, locale), { failLoudly: true }),\n\n /**\n * The platform's copy for `locale` with this merchant's wording laid over it.\n *\n * Takes the two as values rather than fetching them, so the caller decides\n * whether the second request happens at all and both stay separately cached.\n */\n /**\n * The platform's copy for `locale` with this merchant's wording over it.\n *\n * Delegates to `composeMessages`, which every other reader of these two\n * entries also uses — see `api/messages.ts` for why there is exactly one.\n */\n merge: (\n common: TranslationMessages | null,\n overrides: Messages | null,\n locale: string\n ): TranslationMessages | null => composeMessages(common, overrides, locale) ?? null,\n\n queries: {\n /**\n * @param locale taken as an argument rather than read from the twilight\n * context, and that is load-bearing. This key is built on the server, on\n * hydration, and again lazily from the context accessor; if any of the\n * three read a locale the others had not been given yet, the hydrated page\n * would miss the dehydrated entry and refetch both files it was just\n * handed. Every caller already has the locale in hand.\n *\n * The store is deliberately **not** in the key. One document serves one\n * store — a request that names a different one is redirected with\n * `reloadDocument`, so the client never changes store under a live cache —\n * and adding a value that resolves from the request on the server and from\n * the injected env on the client is how a key stops matching across\n * hydration.\n */\n byLocale: (locale: string) =>\n queryOptions({\n queryKey: translationsQueryKey(locale),\n queryFn: () => translations.get(locale),\n }),\n\n /**\n * This merchant's overrides, cached apart from the platform's copy.\n *\n * Its own entry rather than a wider `byLocale` key, so the common file is\n * fetched and dehydrated once per language whatever the store does, and a\n * store with no overrides never has an entry at all. Both sides compute the\n * key from the settings payload, so the hydrated page finds what the server\n * dehydrated instead of refetching it.\n */\n byStore: (storeId: string | number, locale: string) =>\n queryOptions({\n queryKey: storeTranslationsQueryKey(storeId, locale),\n queryFn: () => translations.forStore(storeId, locale),\n }),\n },\n};\n"]}
1
+ {"version":3,"sources":["../src/api/translations.ts"],"names":[],"mappings":";;;;AAiEA,IAAM,kBAAA,GAAqB,sBAAA;AAGpB,SAAS,uBAAuB,MAAA,EAAwB;AAC7D,EAAA,OAAO,uBAAuB,MAAM,CAAA,KAAA,CAAA;AACtC;AAWO,SAAS,qBAAA,CAAsB,SAA0B,MAAA,EAAwB;AACtF,EAAA,OAAO,CAAA,aAAA,EAAgB,OAAO,CAAA,CAAA,EAAI,MAAM,CAAA,KAAA,CAAA;AAC1C;AAUA,eAAe,eACb,IAAA,EACA,EAAE,aAAa,KAAA,EAAM,GAA8B,EAAC,EAC1B;AAE1B,EAAA,MAAM,UAAA,GAAa,CAAC,MAAA,EAAgB,KAAA,KAA0B;AAC5D,IAAA,IAAI,UAAA,EAAY,MAAM,IAAI,KAAA,CAAM,CAAA,eAAA,EAAkB,IAAI,CAAA,EAAA,EAAK,MAAM,CAAA,CAAA,EAAI,EAAE,KAAA,EAAO,CAAA;AAC9E,IAAA,OAAA,CAAQ,IAAA,CAAK,gBAAA,EAAkB,MAAA,EAAQ,IAAA,EAAM,SAAS,EAAE,CAAA;AACxD,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AAEA,EAAA,IAAI;AACF,IAAA,MAAM,QAAA,GAAW,MAAM,QAAA,CAAS,GAAA,CAAI,IAAA,EAAM,EAAE,eAAA,EAAiB,KAAA,EAAO,OAAA,EAAS,GAAA,EAAM,CAAA;AACnF,IAAA,IAAI,QAAA,CAAS,MAAA,KAAW,GAAA,EAAK,OAAO,IAAA;AAEpC,IAAA,IAAI,CAAC,SAAS,EAAA,EAAI;AAChB,MAAA,OAAO,UAAA,CAAW,CAAA,SAAA,EAAY,QAAA,CAAS,MAAM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AAQ,GAAG,IAAA,EAA+B;AAAA,EAC/D,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,QAAA,EAAU,OAAO,OAAA,EAA0B,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQzC,cAAA,CAAe,sBAAsB,OAAA,EAAS,MAAM,GAAG,EAAE,UAAA,EAAY,MAAM;AAAA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAc7E,KAAA,EAAO,CACL,MAAA,EACA,SAAA,EACA,WAC+B,eAAA,CAAgB,MAAA,EAAQ,SAAA,EAAW,MAAM,CAAA,IAAK,IAAA;AAAA,EAE/E,OAAA,EAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgBP,QAAA,EAAU,CAAC,MAAA,KACT,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,qBAAqB,MAAM,CAAA;AAAA,MACrC,OAAA,EAAS,MAAM,YAAA,CAAa,GAAA,CAAI,MAAM;AAAA,KACvC,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWH,OAAA,EAAS,CAAC,OAAA,EAA0B,MAAA,KAClC,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,yBAAA,CAA0B,OAAA,EAAS,MAAM,CAAA;AAAA,MACnD,OAAA,EAAS,MAAM,YAAA,CAAa,QAAA,CAAS,SAAS,MAAM;AAAA,KACrD;AAAA;AAEP","file":"chunk-7NEJCQQ3.js","sourcesContent":["/**\n * @fileoverview Where a storefront's words come from.\n *\n * Two files, merged: the platform's copy for this language, and the merchant's\n * own edits for this language and this store. Both are plain JSON objects on\n * the uploader's CDN, one per language.\n *\n * ```\n * https://cdn.files.salla.network/translations/common/<locale>.json the platform's\n * https://cdn.files.salla.network/translations/<storeId>/<locale>.json the merchant's\n * ```\n *\n * **What this replaces, and why.** Until now the engine read a single global\n * file, `cdn.salla.network/js/translations.json`, holding every language keyed\n * `\"<locale>.trans\"`. Nothing publishes that file: it is an object last written\n * on 2026-03-26, carrying only `ar` and `en` where the platform has 39 locales,\n * 405 keys behind `Languages-Module` and 959 English strings textually\n * different from it. So every React storefront has been serving copy from\n * March, and a key added since has never reached one. It also carried no\n * merchant overrides at all — a merchant editing their theme's wording in the\n * Dashboard changed nothing on a React theme.\n *\n * **Merchant overrides are read, and only when there are any.** Getting here\n * took two corrections worth keeping.\n *\n * The first is the address. A merchant's own wording lives at\n * `translations/<storeId>/<locale>.json`, keyed by `store()->getRouteKey()` —\n * the Optimus-encoded numeric id. An early version addressed it with\n * `resolveStoreIdentifier()`, on the claim that the two are the same string.\n * That is true of the `store-identifier` *header*, which accepts a host, a\n * username or an id, and false of the R2 key: on a custom domain the resolver\n * returns `reefperfumes.com` and on a shared host a username like\n * `mtgr-alaatr-2`. Both 404, both then read as \"this store has no overrides\",\n * and the merchant's wording silently never appears — so the feature would have\n * worked under `?storeId=` alone, which is preview and localhost. It is\n * `settings.store.id` now, which is known only after the settings query.\n *\n * The second is when to ask at all. Most stores have never customised a word,\n * and a miss is an uncached round trip (`cf-cache-status: DYNAMIC` on the 404)\n * on the critical path of every SSR render. So the request is made only when\n * `settings.languages[<ISO>].has_custom_translations` says there is something\n * to get — a flag `Languages-Module` writes when a merchant saves a\n * translation. A store without overrides pays nothing, which is what made this\n * shippable at all.\n *\n * ⚠️ The flag is written on save, so a store whose wording predates it reads as\n * `false` until someone edits a translation or the backfill runs. That is a\n * store keeping today's behaviour, not a regression — React themes have never\n * read merchant overrides — but it does mean the feature is only as complete as\n * the backfill.\n *\n * **Rollout is by fallback, not by flag.** `translations/common/` is written by\n * a sync in the theme build service that may not have run yet, and a hard switch\n * would leave every storefront with no platform strings at all. A missing common\n * file therefore falls back to the old global one, which is exactly today's\n * behaviour — so this is safe to ship before the bucket is populated, and stops\n * using the fallback on its own once it is.\n */\nimport { queryOptions } from '@tanstack/react-query';\nimport { cdn, filesCdn } from './client';\nimport { storeTranslationsQueryKey, translationsQueryKey } from './translations-key';\nimport { composeMessages, isPlainObject, type Messages } from './messages';\nimport type { TranslationMessages } from '../providers/I18nProvider';\n\n/** The global file this used to be the only reader of. See the file comment. */\nconst LEGACY_GLOBAL_FILE = 'js/translations.json';\n\n/** One language of platform copy, shared by every store. */\nexport function commonTranslationsPath(locale: string): string {\n return `translations/common/${locale}.json`;\n}\n\n/**\n * One language of a single merchant's own wording.\n *\n * `storeId` is `settings.store.id`, which is the value `Languages-Module` names\n * the object with (`store()->getRouteKey()`, the Optimus-encoded numeric id).\n * It is **not** `resolveStoreIdentifier()`: that returns a hostname on a custom\n * domain and a username on a shared host, both of which 404 here and would read\n * as \"this merchant has no overrides\" — silently, on every store but a preview.\n */\nexport function storeTranslationsPath(storeId: string | number, locale: string): string {\n return `translations/${storeId}/${locale}.json`;\n}\n\n/**\n * Reads one language file, or `null` when there is nothing to read.\n *\n * A 404 is the ordinary answer, not a failure: most stores have never had a\n * word customised, so their file does not exist. Distinguishing it from a real\n * error matters only for the log — both end in `null` — but a warning on every\n * page load of every uncustomised store is a warning nobody will read.\n */\nasync function readLocaleFile(\n path: string,\n { failLoudly = false }: { failLoudly?: boolean } = {}\n): Promise<Messages | null> {\n /** A 404 always means \"absent\"; everything else is a failure to read. */\n const unreadable = (reason: string, cause?: unknown): null => {\n if (failLoudly) throw new Error(`[translations] ${path}: ${reason}`, { cause });\n console.warn('[translations]', reason, path, cause ?? '');\n return null;\n };\n\n try {\n const response = await filesCdn.get(path, { throwHttpErrors: false, timeout: 5000 });\n if (response.status === 404) return null;\n\n if (!response.ok) {\n return unreadable(`answered ${response.status}`);\n }\n\n const data: unknown = await response.json();\n if (!isPlainObject(data)) {\n return unreadable('is not a JSON object');\n }\n\n return data;\n } catch (error) {\n if (error instanceof Error && error.message.startsWith('[translations]')) throw error;\n return unreadable('could not be read', error);\n }\n}\n\n/**\n * The pre-CDN global file, sliced to one language.\n *\n * Only reached when `translations/common/<locale>.json` is missing, which is\n * the state of the bucket until the sync has run once.\n */\nasync function readLegacyGlobal(locale: string): Promise<Messages | null> {\n try {\n const data = await cdn.get(LEGACY_GLOBAL_FILE, { timeout: 5000 }).json<TranslationMessages>();\n const forLocale = data?.[`${locale}.trans`];\n return isPlainObject(forLocale) ? forLocale : null;\n } catch {\n console.warn('[translations] the legacy global file could not be read either');\n return null;\n }\n}\n\nexport const translations = {\n /**\n * The platform's copy for `locale`.\n *\n * One file, so one request. See the file comment for why the merchant's own\n * wording is not merged in here yet and what it is waiting on.\n */\n get: async (locale: string): Promise<TranslationMessages | null> => {\n const common = await readLocaleFile(commonTranslationsPath(locale));\n const base = common ?? (await readLegacyGlobal(locale));\n if (!base) return null;\n\n // Still wrapped in the `<locale>.trans` shape the rest of the engine reads.\n // `createI18nInstance` slices by that key and so does the SDK bridge in\n // `I18nProvider`; changing the envelope here would be a second change for\n // no gain, since one language is all any of them ever take out of it.\n return { [`${locale}.trans`]: base as Record<string, string> };\n },\n\n /**\n * This merchant's own wording for `locale`, or `null` if they have none.\n *\n * Only worth calling when `settings.languages[<ISO>].has_custom_translations`\n * says there is something to get. Most stores have never customised a word,\n * and a miss here is an uncached round trip — `cf-cache-status: DYNAMIC` on a\n * 404 — on the critical path of an SSR render. The flag is what makes this\n * free for everyone who does not use it.\n *\n * Returned unwrapped, unlike {@link translations.get}: this is merged into\n * that one's messages rather than handed to i18next on its own.\n */\n forStore: async (storeId: string | number, locale: string): Promise<Messages | null> =>\n // `failLoudly`, unlike the platform file: this is only ever called because\n // the settings said overrides exist, so a 500, a timeout or a body that is\n // not JSON is a failure to read them — not a store that has none. Returning\n // `null` there would cache \"no overrides\" as a success, skip the query's\n // retry, and serve Salla's wording in place of the merchant's until the\n // entry expired. A 404 still means absent, and `rootBeforeLoad` catches the\n // throw and keeps the platform copy, so the worst case is unchanged.\n readLocaleFile(storeTranslationsPath(storeId, locale), { failLoudly: true }),\n\n /**\n * The platform's copy for `locale` with this merchant's wording laid over it.\n *\n * Takes the two as values rather than fetching them, so the caller decides\n * whether the second request happens at all and both stay separately cached.\n */\n /**\n * The platform's copy for `locale` with this merchant's wording over it.\n *\n * Delegates to `composeMessages`, which every other reader of these two\n * entries also uses — see `api/messages.ts` for why there is exactly one.\n */\n merge: (\n common: TranslationMessages | null,\n overrides: Messages | null,\n locale: string\n ): TranslationMessages | null => composeMessages(common, overrides, locale) ?? null,\n\n queries: {\n /**\n * @param locale taken as an argument rather than read from the twilight\n * context, and that is load-bearing. This key is built on the server, on\n * hydration, and again lazily from the context accessor; if any of the\n * three read a locale the others had not been given yet, the hydrated page\n * would miss the dehydrated entry and refetch both files it was just\n * handed. Every caller already has the locale in hand.\n *\n * The store is deliberately **not** in the key. One document serves one\n * store — a request that names a different one is redirected with\n * `reloadDocument`, so the client never changes store under a live cache —\n * and adding a value that resolves from the request on the server and from\n * the injected env on the client is how a key stops matching across\n * hydration.\n */\n byLocale: (locale: string) =>\n queryOptions({\n queryKey: translationsQueryKey(locale),\n queryFn: () => translations.get(locale),\n }),\n\n /**\n * This merchant's overrides, cached apart from the platform's copy.\n *\n * Its own entry rather than a wider `byLocale` key, so the common file is\n * fetched and dehydrated once per language whatever the store does, and a\n * store with no overrides never has an entry at all. Both sides compute the\n * key from the settings payload, so the hydrated page finds what the server\n * dehydrated instead of refetching it.\n */\n byStore: (storeId: string | number, locale: string) =>\n queryOptions({\n queryKey: storeTranslationsQueryKey(storeId, locale),\n queryFn: () => translations.forStore(storeId, locale),\n }),\n },\n};\n"]}
@@ -2,7 +2,7 @@ import { lazyComponent } from './chunk-TLHZBTPZ.js';
2
2
 
3
3
  // src/components/common/lazy.ts
4
4
  var LazyBreadcrumb = lazyComponent(
5
- () => import('./Breadcrumb-Z6OBJQZM.js').then((m) => ({ default: m.Breadcrumb }))
5
+ () => import('./Breadcrumb-NMSPOKZC.js').then((m) => ({ default: m.Breadcrumb }))
6
6
  );
7
7
  var LazyNoContent = lazyComponent(
8
8
  () => import('./NoContent-7YUWEXI2.js').then((m) => ({ default: m.NoContent }))
@@ -18,5 +18,5 @@ var LazyErrorPage = lazyComponent(
18
18
  );
19
19
 
20
20
  export { LazyBreadcrumb, LazyCurrencySymbol, LazyErrorPage, LazyNoContent, LazyRenderWhenVisible };
21
- //# sourceMappingURL=chunk-L3K5KK2Q.js.map
22
- //# sourceMappingURL=chunk-L3K5KK2Q.js.map
21
+ //# sourceMappingURL=chunk-A7FCCVN4.js.map
22
+ //# sourceMappingURL=chunk-A7FCCVN4.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/common/lazy.ts"],"names":[],"mappings":";;;AASO,IAAM,cAAA,GAAiB,aAAA;AAAA,EAAc,MAC1C,OAAO,0BAAc,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,UAAA,EAAW,CAAE;AAChE;AAEO,IAAM,aAAA,GAAgB,aAAA;AAAA,EAAc,MACzC,OAAO,yBAAa,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,SAAA,EAAU,CAAE;AAC9D;AAEO,IAAM,qBAAA,GAAwB,aAAA;AAAA,EAAc,MACjD,OAAO,iCAAqB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,iBAAA,EAAkB,CAAE;AAC9E;AAEO,IAAM,kBAAA,GAAqB,aAAA;AAAA,EAAc,MAC9C,OAAO,8BAAkB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,cAAA,EAAe,CAAE;AACxE;AAEO,IAAM,aAAA,GAAgB,aAAA;AAAA,EAAc,MACzC,OAAO,yBAAa,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,SAAA,EAAU,CAAE;AAC9D","file":"chunk-L3K5KK2Q.js","sourcesContent":["import { lazyComponent } from '../../utils/lazy-component';\n\n/**\n * Lazy-loaded common components\n * Use these for code-splitting non-critical components\n *\n * NOTE: Skeleton components are sourced from @salla.sa/twilight-components-react\n * because they must render instantly during route transitions.\n */\nexport const LazyBreadcrumb = lazyComponent(() =>\n import('./Breadcrumb').then((m) => ({ default: m.Breadcrumb }))\n);\n\nexport const LazyNoContent = lazyComponent(() =>\n import('./NoContent').then((m) => ({ default: m.NoContent }))\n);\n\nexport const LazyRenderWhenVisible = lazyComponent(() =>\n import('./RenderWhenVisible').then((m) => ({ default: m.RenderWhenVisible }))\n);\n\nexport const LazyCurrencySymbol = lazyComponent(() =>\n import('./CurrencySymbol').then((m) => ({ default: m.CurrencySymbol }))\n);\n\nexport const LazyErrorPage = lazyComponent(() =>\n import('./ErrorPage').then((m) => ({ default: m.ErrorPage }))\n);\n"]}
1
+ {"version":3,"sources":["../src/components/common/lazy.ts"],"names":[],"mappings":";;;AASO,IAAM,cAAA,GAAiB,aAAA;AAAA,EAAc,MAC1C,OAAO,0BAAc,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,UAAA,EAAW,CAAE;AAChE;AAEO,IAAM,aAAA,GAAgB,aAAA;AAAA,EAAc,MACzC,OAAO,yBAAa,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,SAAA,EAAU,CAAE;AAC9D;AAEO,IAAM,qBAAA,GAAwB,aAAA;AAAA,EAAc,MACjD,OAAO,iCAAqB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,iBAAA,EAAkB,CAAE;AAC9E;AAEO,IAAM,kBAAA,GAAqB,aAAA;AAAA,EAAc,MAC9C,OAAO,8BAAkB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,cAAA,EAAe,CAAE;AACxE;AAEO,IAAM,aAAA,GAAgB,aAAA;AAAA,EAAc,MACzC,OAAO,yBAAa,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,SAAA,EAAU,CAAE;AAC9D","file":"chunk-A7FCCVN4.js","sourcesContent":["import { lazyComponent } from '../../utils/lazy-component';\n\n/**\n * Lazy-loaded common components\n * Use these for code-splitting non-critical components\n *\n * NOTE: Skeleton components are sourced from @salla.sa/twilight-components-react\n * because they must render instantly during route transitions.\n */\nexport const LazyBreadcrumb = lazyComponent(() =>\n import('./Breadcrumb').then((m) => ({ default: m.Breadcrumb }))\n);\n\nexport const LazyNoContent = lazyComponent(() =>\n import('./NoContent').then((m) => ({ default: m.NoContent }))\n);\n\nexport const LazyRenderWhenVisible = lazyComponent(() =>\n import('./RenderWhenVisible').then((m) => ({ default: m.RenderWhenVisible }))\n);\n\nexport const LazyCurrencySymbol = lazyComponent(() =>\n import('./CurrencySymbol').then((m) => ({ default: m.CurrencySymbol }))\n);\n\nexport const LazyErrorPage = lazyComponent(() =>\n import('./ErrorPage').then((m) => ({ default: m.ErrorPage }))\n);\n"]}
@@ -2,7 +2,7 @@ import { ensureTwilightContextFromMatches } from './chunk-UAPBMOOV.js';
2
2
  import { renderThemeHookSlotsScript, renderAppScopeInstallScript } from './chunk-QJOTD2GJ.js';
3
3
  import { resolveHead, mergeHead } from './chunk-GD26FI4J.js';
4
4
  import { buildBaseHead, organizationSchema } from './chunk-EUHIN5FN.js';
5
- import { gtmEnabled, DATA_LAYER_PROXY_SCRIPT } from './chunk-KXWDMETN.js';
5
+ import { gtmEnabled, DATA_LAYER_PROXY_SCRIPT } from './chunk-F5CBGBXC.js';
6
6
  import { readEnv, renderRuntimeEnvScript, escapeForInlineScript } from './chunk-4OZIBANF.js';
7
7
  import { getTwilightContext, SettingsError } from './chunk-MWUAHDQL.js';
8
8
  import { FALLBACK_LOCALE } from './chunk-T72DAX7R.js';
@@ -302,5 +302,5 @@ function buildCustomJsScript(customJs, isUrl) {
302
302
  }
303
303
 
304
304
  export { TICKETING_SCRIPT_URL, resolveTwilightSdkUrl, rootHead };
305
- //# sourceMappingURL=chunk-JIKXE3YR.js.map
306
- //# sourceMappingURL=chunk-JIKXE3YR.js.map
305
+ //# sourceMappingURL=chunk-AGQAFP7M.js.map
306
+ //# sourceMappingURL=chunk-AGQAFP7M.js.map