@salla.sa/twilight-theme-engine 1.0.144 → 1.0.145

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 (256) hide show
  1. package/dist/{AddToCartForm-LWT2QINY.js → AddToCartForm-NZNFVGDV.js} +3 -3
  2. package/dist/{AddToCartForm-LWT2QINY.js.map → AddToCartForm-NZNFVGDV.js.map} +1 -1
  3. package/dist/{BlogAuthorPage-52C2OHXW.js → BlogAuthorPage-BXRIYXVN.js} +27 -27
  4. package/dist/{BlogAuthorPage-52C2OHXW.js.map → BlogAuthorPage-BXRIYXVN.js.map} +1 -1
  5. package/dist/{BlogCategoryPage-LBLIAN6Q.js → BlogCategoryPage-GHWC2WVM.js} +27 -27
  6. package/dist/{BlogCategoryPage-LBLIAN6Q.js.map → BlogCategoryPage-GHWC2WVM.js.map} +1 -1
  7. package/dist/{BlogPage-U56CLHI4.js → BlogPage-ZCGNKBLI.js} +25 -25
  8. package/dist/{BlogPage-U56CLHI4.js.map → BlogPage-ZCGNKBLI.js.map} +1 -1
  9. package/dist/{BlogSinglePage-NQJDYUFB.js → BlogSinglePage-TH7Z3MKB.js} +25 -25
  10. package/dist/{BlogSinglePage-NQJDYUFB.js.map → BlogSinglePage-TH7Z3MKB.js.map} +1 -1
  11. package/dist/{BlogTagPage-XP3XGVCO.js → BlogTagPage-GM422SOW.js} +27 -27
  12. package/dist/{BlogTagPage-XP3XGVCO.js.map → BlogTagPage-GM422SOW.js.map} +1 -1
  13. package/dist/{BrandsPage-22AET7DW.js → BrandsPage-LNNPU4NX.js} +26 -26
  14. package/dist/{BrandsPage-22AET7DW.js.map → BrandsPage-LNNPU4NX.js.map} +1 -1
  15. package/dist/{Breadcrumb-YTYXSTKO.js → Breadcrumb-TSG2CW3S.js} +25 -25
  16. package/dist/{Breadcrumb-YTYXSTKO.js.map → Breadcrumb-TSG2CW3S.js.map} +1 -1
  17. package/dist/{CartItem-UTU4GLDN.js → CartItem-UVSLCSEP.js} +25 -25
  18. package/dist/{CartItem-UTU4GLDN.js.map → CartItem-UVSLCSEP.js.map} +1 -1
  19. package/dist/{CartSummary-4UGWZ3B3.js → CartSummary-ZCXTED4G.js} +25 -25
  20. package/dist/{CartSummary-4UGWZ3B3.js.map → CartSummary-ZCXTED4G.js.map} +1 -1
  21. package/dist/{Copyright-B2GYPZBZ.js → Copyright-B25RLEVV.js} +3 -3
  22. package/dist/{Copyright-B2GYPZBZ.js.map → Copyright-B25RLEVV.js.map} +1 -1
  23. package/dist/{CustomerLayout-I4XFBCOH.js → CustomerLayout-WGEUJEDP.js} +25 -25
  24. package/dist/{CustomerLayout-I4XFBCOH.js.map → CustomerLayout-WGEUJEDP.js.map} +1 -1
  25. package/dist/{Footer-OWOF2AGC.js → Footer-QMNESEEI.js} +4 -4
  26. package/dist/{Footer-OWOF2AGC.js.map → Footer-QMNESEEI.js.map} +1 -1
  27. package/dist/{Header-KDJL4YRP.js → Header-ZPDXQ7U6.js} +11 -11
  28. package/dist/{Header-KDJL4YRP.js.map → Header-ZPDXQ7U6.js.map} +1 -1
  29. package/dist/{LatestProducts-YBFHXG5V.js → LatestProducts-UEUM47MI.js} +27 -27
  30. package/dist/{LatestProducts-YBFHXG5V.js.map → LatestProducts-UEUM47MI.js.map} +1 -1
  31. package/dist/{LoyaltyPage-GFWTFQA7.js → LoyaltyPage-ZM3FDTV3.js} +25 -25
  32. package/dist/{LoyaltyPage-GFWTFQA7.js.map → LoyaltyPage-ZM3FDTV3.js.map} +1 -1
  33. package/dist/{LoyaltyPointsPage-WJDZL6G4.js → LoyaltyPointsPage-QQIKIBTH.js} +8 -8
  34. package/dist/{LoyaltyPointsPage-WJDZL6G4.js.map → LoyaltyPointsPage-QQIKIBTH.js.map} +1 -1
  35. package/dist/{MainMenu-AWSLHAEE.js → MainMenu-3Z7HRQGU.js} +7 -7
  36. package/dist/{MainMenu-AWSLHAEE.js.map → MainMenu-3Z7HRQGU.js.map} +1 -1
  37. package/dist/{MasterLayout-ZMHHLGYL.js → MasterLayout-ZRTWOZGC.js} +25 -25
  38. package/dist/{MasterLayout-ZMHHLGYL.js.map → MasterLayout-ZRTWOZGC.js.map} +1 -1
  39. package/dist/{MobileMenu-56MF2EAS.js → MobileMenu-SC7HJ6BT.js} +26 -26
  40. package/dist/{MobileMenu-56MF2EAS.js.map → MobileMenu-SC7HJ6BT.js.map} +1 -1
  41. package/dist/{NotificationsPage-7QC66446.js → NotificationsPage-JMAZ2N2A.js} +25 -25
  42. package/dist/{NotificationsPage-7QC66446.js.map → NotificationsPage-JMAZ2N2A.js.map} +1 -1
  43. package/dist/{OrderSinglePage-WXJHUJ6C.js → OrderSinglePage-6MAFH4Q6.js} +26 -26
  44. package/dist/{OrderSinglePage-WXJHUJ6C.js.map → OrderSinglePage-6MAFH4Q6.js.map} +1 -1
  45. package/dist/{OrdersPage-ZNM4YGXR.js → OrdersPage-NMINSG67.js} +25 -25
  46. package/dist/{OrdersPage-ZNM4YGXR.js.map → OrdersPage-NMINSG67.js.map} +1 -1
  47. package/dist/{PageSingle-NQZM6O5A.js → PageSingle-WLIXOODC.js} +6 -6
  48. package/dist/{PageSingle-NQZM6O5A.js.map → PageSingle-WLIXOODC.js.map} +1 -1
  49. package/dist/{ProductDetails-N4KYBKBG.js → ProductDetails-NFZLUKLN.js} +7 -7
  50. package/dist/{ProductDetails-N4KYBKBG.js.map → ProductDetails-NFZLUKLN.js.map} +1 -1
  51. package/dist/{ProfilePage-XOGVATHX.js → ProfilePage-5PBU637J.js} +25 -25
  52. package/dist/{ProfilePage-XOGVATHX.js.map → ProfilePage-5PBU637J.js.map} +1 -1
  53. package/dist/{ReviewsPage-WOLLCLAY.js → ReviewsPage-RWNFVHWR.js} +3 -3
  54. package/dist/{ReviewsPage-WOLLCLAY.js.map → ReviewsPage-RWNFVHWR.js.map} +1 -1
  55. package/dist/{SeoCartWidget-EVJOTXPO.js → SeoCartWidget-HPBQ6673.js} +25 -25
  56. package/dist/{SeoCartWidget-EVJOTXPO.js.map → SeoCartWidget-HPBQ6673.js.map} +1 -1
  57. package/dist/{SettingsPage-LYDZFUF3.js → SettingsPage-Y5X5BNHD.js} +25 -25
  58. package/dist/{SettingsPage-LYDZFUF3.js.map → SettingsPage-Y5X5BNHD.js.map} +1 -1
  59. package/dist/{StoreClosedNotification-62SFSGRH.js → StoreClosedNotification-5DOQFF2O.js} +26 -26
  60. package/dist/{StoreClosedNotification-62SFSGRH.js.map → StoreClosedNotification-5DOQFF2O.js.map} +1 -1
  61. package/dist/{TestimonialsPage-WPZBQQO2.js → TestimonialsPage-ZDALOH2L.js} +6 -6
  62. package/dist/{TestimonialsPage-WPZBQQO2.js.map → TestimonialsPage-ZDALOH2L.js.map} +1 -1
  63. package/dist/{ThankYouPage-44VMBXGI.js → ThankYouPage-SYMPRWCS.js} +25 -25
  64. package/dist/{ThankYouPage-44VMBXGI.js.map → ThankYouPage-SYMPRWCS.js.map} +1 -1
  65. package/dist/{WalletPage-YVSIECSM.js → WalletPage-DPWZBROY.js} +26 -26
  66. package/dist/{WalletPage-YVSIECSM.js.map → WalletPage-DPWZBROY.js.map} +1 -1
  67. package/dist/{WebMcpTools-VA2A62E3.js → WebMcpTools-3TBLKZL5.js} +9 -9
  68. package/dist/{WebMcpTools-VA2A62E3.js.map → WebMcpTools-3TBLKZL5.js.map} +1 -1
  69. package/dist/{WishlistPage-IGWDG4HC.js → WishlistPage-BM3XSMQF.js} +27 -27
  70. package/dist/{WishlistPage-IGWDG4HC.js.map → WishlistPage-BM3XSMQF.js.map} +1 -1
  71. package/dist/api/advertisement.js +4 -4
  72. package/dist/api/apps.js +4 -4
  73. package/dist/api/blog.js +6 -6
  74. package/dist/api/brands.js +6 -6
  75. package/dist/api/cart.js +6 -6
  76. package/dist/api/category.js +6 -6
  77. package/dist/api/client.js +3 -3
  78. package/dist/api/home.js +4 -4
  79. package/dist/api/loyalty.js +6 -6
  80. package/dist/api/menu.js +4 -4
  81. package/dist/api/notification.js +4 -4
  82. package/dist/api/order.js +6 -6
  83. package/dist/api/page.js +6 -6
  84. package/dist/api/product.js +6 -6
  85. package/dist/api/profile.js +3 -3
  86. package/dist/api/store.js +5 -5
  87. package/dist/api/translations.js +4 -4
  88. package/dist/api/user.js +4 -4
  89. package/dist/api/wallet.js +4 -4
  90. package/dist/api/wishlist.js +7 -7
  91. package/dist/{chunk-BXMU3ARO.js → chunk-2N6XZZ4W.js} +4 -4
  92. package/dist/{chunk-BXMU3ARO.js.map → chunk-2N6XZZ4W.js.map} +1 -1
  93. package/dist/{chunk-KVBWIXXG.js → chunk-2ZESCQRM.js} +3 -3
  94. package/dist/{chunk-KVBWIXXG.js.map → chunk-2ZESCQRM.js.map} +1 -1
  95. package/dist/{chunk-RWAOBMAK.js → chunk-52QZKUDU.js} +6 -6
  96. package/dist/{chunk-RWAOBMAK.js.map → chunk-52QZKUDU.js.map} +1 -1
  97. package/dist/{chunk-BBQATCYN.js → chunk-5JZSBFA5.js} +3 -3
  98. package/dist/{chunk-BBQATCYN.js.map → chunk-5JZSBFA5.js.map} +1 -1
  99. package/dist/{chunk-N6ZE6HUX.js → chunk-5V4W3GBI.js} +5 -5
  100. package/dist/{chunk-N6ZE6HUX.js.map → chunk-5V4W3GBI.js.map} +1 -1
  101. package/dist/{chunk-3E3ABCPC.js → chunk-6TFM3UTF.js} +3 -3
  102. package/dist/{chunk-3E3ABCPC.js.map → chunk-6TFM3UTF.js.map} +1 -1
  103. package/dist/{chunk-CRO7DXS3.js → chunk-7NTPNCIK.js} +3 -3
  104. package/dist/{chunk-CRO7DXS3.js.map → chunk-7NTPNCIK.js.map} +1 -1
  105. package/dist/{chunk-LVUH4FOB.js → chunk-AJM7KUA3.js} +5 -5
  106. package/dist/{chunk-LVUH4FOB.js.map → chunk-AJM7KUA3.js.map} +1 -1
  107. package/dist/{chunk-WU5Z4JGX.js → chunk-BMCECPSU.js} +3 -3
  108. package/dist/{chunk-WU5Z4JGX.js.map → chunk-BMCECPSU.js.map} +1 -1
  109. package/dist/{chunk-O7OFWC34.js → chunk-DHWMC6VU.js} +4 -4
  110. package/dist/{chunk-O7OFWC34.js.map → chunk-DHWMC6VU.js.map} +1 -1
  111. package/dist/{chunk-YVQXIZY7.js → chunk-DMR3ICV5.js} +6 -6
  112. package/dist/{chunk-YVQXIZY7.js.map → chunk-DMR3ICV5.js.map} +1 -1
  113. package/dist/{chunk-WQPG22DY.js → chunk-EGI7F57E.js} +3 -3
  114. package/dist/{chunk-WQPG22DY.js.map → chunk-EGI7F57E.js.map} +1 -1
  115. package/dist/{chunk-3KTDODC5.js → chunk-ETC7OJT5.js} +3 -3
  116. package/dist/{chunk-3KTDODC5.js.map → chunk-ETC7OJT5.js.map} +1 -1
  117. package/dist/{chunk-PYUTATUY.js → chunk-FPGR63AQ.js} +3 -3
  118. package/dist/{chunk-PYUTATUY.js.map → chunk-FPGR63AQ.js.map} +1 -1
  119. package/dist/{chunk-AXTVBTO4.js → chunk-GBMMP344.js} +22 -22
  120. package/dist/{chunk-AXTVBTO4.js.map → chunk-GBMMP344.js.map} +1 -1
  121. package/dist/{chunk-5XWGYFZ2.js → chunk-GFRJHCRX.js} +4 -4
  122. package/dist/{chunk-5XWGYFZ2.js.map → chunk-GFRJHCRX.js.map} +1 -1
  123. package/dist/{chunk-TF6HFXTW.js → chunk-H7LRGY7U.js} +3 -3
  124. package/dist/{chunk-TF6HFXTW.js.map → chunk-H7LRGY7U.js.map} +1 -1
  125. package/dist/{chunk-TAVF4E7T.js → chunk-HJGN3XVG.js} +8 -8
  126. package/dist/{chunk-TAVF4E7T.js.map → chunk-HJGN3XVG.js.map} +1 -1
  127. package/dist/{chunk-2ZR562TA.js → chunk-HRW4YFHR.js} +5 -5
  128. package/dist/{chunk-2ZR562TA.js.map → chunk-HRW4YFHR.js.map} +1 -1
  129. package/dist/{chunk-HOJ5E2PG.js → chunk-IHOUADLX.js} +3 -3
  130. package/dist/{chunk-HOJ5E2PG.js.map → chunk-IHOUADLX.js.map} +1 -1
  131. package/dist/{chunk-S4KV6QGP.js → chunk-ITNUDQVP.js} +27 -20
  132. package/dist/chunk-ITNUDQVP.js.map +1 -0
  133. package/dist/{chunk-6JH4QYKT.js → chunk-KGSB2Y7O.js} +4 -4
  134. package/dist/{chunk-6JH4QYKT.js.map → chunk-KGSB2Y7O.js.map} +1 -1
  135. package/dist/{chunk-W5LVGFHX.js → chunk-KKTVDCVO.js} +6 -6
  136. package/dist/{chunk-W5LVGFHX.js.map → chunk-KKTVDCVO.js.map} +1 -1
  137. package/dist/{chunk-LNTLWEYI.js → chunk-LSMKTPIE.js} +4 -4
  138. package/dist/{chunk-LNTLWEYI.js.map → chunk-LSMKTPIE.js.map} +1 -1
  139. package/dist/{chunk-LFHYQ6AN.js → chunk-M5WTY3EH.js} +3 -3
  140. package/dist/{chunk-LFHYQ6AN.js.map → chunk-M5WTY3EH.js.map} +1 -1
  141. package/dist/{chunk-RYGEIQWO.js → chunk-MGG4XAJ5.js} +3 -3
  142. package/dist/{chunk-RYGEIQWO.js.map → chunk-MGG4XAJ5.js.map} +1 -1
  143. package/dist/{chunk-GN7V2QHO.js → chunk-MIAVMNPM.js} +6 -6
  144. package/dist/{chunk-GN7V2QHO.js.map → chunk-MIAVMNPM.js.map} +1 -1
  145. package/dist/{chunk-4L5RHZHJ.js → chunk-N44U2AA7.js} +4 -4
  146. package/dist/{chunk-4L5RHZHJ.js.map → chunk-N44U2AA7.js.map} +1 -1
  147. package/dist/{chunk-7IQFONJR.js → chunk-NGWHUW34.js} +3 -3
  148. package/dist/{chunk-7IQFONJR.js.map → chunk-NGWHUW34.js.map} +1 -1
  149. package/dist/{chunk-GUODUINX.js → chunk-NLKLS3GZ.js} +5 -5
  150. package/dist/{chunk-GUODUINX.js.map → chunk-NLKLS3GZ.js.map} +1 -1
  151. package/dist/{chunk-VNEMV6IC.js → chunk-NR5YIBTS.js} +4 -4
  152. package/dist/{chunk-VNEMV6IC.js.map → chunk-NR5YIBTS.js.map} +1 -1
  153. package/dist/{chunk-AT6YLLT4.js → chunk-OLL5OGQ5.js} +4 -4
  154. package/dist/{chunk-AT6YLLT4.js.map → chunk-OLL5OGQ5.js.map} +1 -1
  155. package/dist/{chunk-AD4QPYNG.js → chunk-PCB5DCS4.js} +4 -4
  156. package/dist/{chunk-AD4QPYNG.js.map → chunk-PCB5DCS4.js.map} +1 -1
  157. package/dist/{chunk-GCXFTIHV.js → chunk-QIHSKEWU.js} +4 -4
  158. package/dist/{chunk-GCXFTIHV.js.map → chunk-QIHSKEWU.js.map} +1 -1
  159. package/dist/{chunk-MWYKP7CI.js → chunk-QMWP2ZP6.js} +3 -3
  160. package/dist/{chunk-MWYKP7CI.js.map → chunk-QMWP2ZP6.js.map} +1 -1
  161. package/dist/{chunk-ODP2N7CD.js → chunk-R64ITZ7U.js} +4 -4
  162. package/dist/{chunk-ODP2N7CD.js.map → chunk-R64ITZ7U.js.map} +1 -1
  163. package/dist/{chunk-5UWRPWK2.js → chunk-R7VWIXFX.js} +3 -3
  164. package/dist/{chunk-5UWRPWK2.js.map → chunk-R7VWIXFX.js.map} +1 -1
  165. package/dist/{chunk-VV7MDVGS.js → chunk-RJKMW36K.js} +8 -8
  166. package/dist/{chunk-VV7MDVGS.js.map → chunk-RJKMW36K.js.map} +1 -1
  167. package/dist/{chunk-Q7E4TNN7.js → chunk-SLBO4SEE.js} +3 -3
  168. package/dist/{chunk-Q7E4TNN7.js.map → chunk-SLBO4SEE.js.map} +1 -1
  169. package/dist/{chunk-FXVII733.js → chunk-T2752RH7.js} +27 -3
  170. package/dist/chunk-T2752RH7.js.map +1 -0
  171. package/dist/{chunk-MDU7ERR3.js → chunk-TF46NIZF.js} +4 -4
  172. package/dist/{chunk-MDU7ERR3.js.map → chunk-TF46NIZF.js.map} +1 -1
  173. package/dist/{chunk-MZ4LTJQD.js → chunk-TWYTA2SX.js} +7 -7
  174. package/dist/{chunk-MZ4LTJQD.js.map → chunk-TWYTA2SX.js.map} +1 -1
  175. package/dist/{chunk-G3NCSKQ3.js → chunk-U2UNWN4G.js} +5 -5
  176. package/dist/{chunk-G3NCSKQ3.js.map → chunk-U2UNWN4G.js.map} +1 -1
  177. package/dist/{chunk-W6KPVZZR.js → chunk-U5TWRPMK.js} +7 -7
  178. package/dist/{chunk-W6KPVZZR.js.map → chunk-U5TWRPMK.js.map} +1 -1
  179. package/dist/{chunk-JYPIPQ3V.js → chunk-VCMGBB5Y.js} +3 -3
  180. package/dist/{chunk-JYPIPQ3V.js.map → chunk-VCMGBB5Y.js.map} +1 -1
  181. package/dist/{chunk-P3WHN7JA.js → chunk-VZRZQV4Q.js} +3 -3
  182. package/dist/{chunk-P3WHN7JA.js.map → chunk-VZRZQV4Q.js.map} +1 -1
  183. package/dist/{chunk-WATFGHFK.js → chunk-WIDH6AK6.js} +4 -4
  184. package/dist/{chunk-WATFGHFK.js.map → chunk-WIDH6AK6.js.map} +1 -1
  185. package/dist/{chunk-V46O3Z7J.js → chunk-X4ITNSMT.js} +5 -5
  186. package/dist/{chunk-V46O3Z7J.js.map → chunk-X4ITNSMT.js.map} +1 -1
  187. package/dist/{chunk-NHA4SBKG.js → chunk-XMRNYUQY.js} +3 -3
  188. package/dist/{chunk-NHA4SBKG.js.map → chunk-XMRNYUQY.js.map} +1 -1
  189. package/dist/{chunk-IVZNTLAA.js → chunk-XV3HPKLI.js} +3 -3
  190. package/dist/{chunk-IVZNTLAA.js.map → chunk-XV3HPKLI.js.map} +1 -1
  191. package/dist/{chunk-IAM44RPN.js → chunk-YQOCPSOI.js} +4 -4
  192. package/dist/{chunk-IAM44RPN.js.map → chunk-YQOCPSOI.js.map} +1 -1
  193. package/dist/{chunk-C6WYORKW.js → chunk-YYVZFOUI.js} +3 -3
  194. package/dist/{chunk-C6WYORKW.js.map → chunk-YYVZFOUI.js.map} +1 -1
  195. package/dist/components/cart/index.js +1 -1
  196. package/dist/components/common/index.js +1 -1
  197. package/dist/components/drawer/index.js +23 -23
  198. package/dist/components/home/index.js +28 -28
  199. package/dist/components/layout/index.js +6 -6
  200. package/dist/components/product/index.js +25 -25
  201. package/dist/components/store/index.js +24 -24
  202. package/dist/components/toast/index.js +4 -4
  203. package/dist/dev/editor/index.js +2 -2
  204. package/dist/dev/index.js +2 -2
  205. package/dist/document-class-VHDNGZQK.js +32 -0
  206. package/dist/{document-class-TRLFCQHJ.js.map → document-class-VHDNGZQK.js.map} +1 -1
  207. package/dist/hooks/index.js +23 -23
  208. package/dist/hooks/useComments.js +3 -3
  209. package/dist/hooks/useGtm.js +23 -23
  210. package/dist/hooks/useMoney.js +23 -23
  211. package/dist/hooks/useProduct.js +3 -3
  212. package/dist/hooks/useStore.js +23 -23
  213. package/dist/hooks/useUser.js +5 -5
  214. package/dist/hooks/useWishlist.js +3 -3
  215. package/dist/index.js +23 -23
  216. package/dist/native-app/index.js +3 -3
  217. package/dist/{navigation-HWFEKUG6.js → navigation-C5K5SOU2.js} +8 -8
  218. package/dist/{navigation-HWFEKUG6.js.map → navigation-C5K5SOU2.js.map} +1 -1
  219. package/dist/{navigation-E75N4EU3.js → navigation-VW5P7XQM.js} +7 -7
  220. package/dist/{navigation-E75N4EU3.js.map → navigation-VW5P7XQM.js.map} +1 -1
  221. package/dist/{not-found-7SZU5K7G.js → not-found-U2LJEYDT.js} +26 -26
  222. package/dist/{not-found-7SZU5K7G.js.map → not-found-U2LJEYDT.js.map} +1 -1
  223. package/dist/providers/index.js +23 -23
  224. package/dist/routes/account/orders.js +8 -8
  225. package/dist/routes/account.js +17 -17
  226. package/dist/routes/blog.js +12 -12
  227. package/dist/routes/brands.js +8 -8
  228. package/dist/routes/cart.js +32 -32
  229. package/dist/routes/home.js +29 -29
  230. package/dist/routes/index.js +6 -6
  231. package/dist/routes/loyalty.js +9 -9
  232. package/dist/routes/page.js +8 -8
  233. package/dist/routes/product-listing.js +30 -30
  234. package/dist/routes/product.js +28 -28
  235. package/dist/routes/root/beforeLoad.d.ts.map +1 -1
  236. package/dist/routes/seo-redirects.js +6 -6
  237. package/dist/routes/testimonials.js +4 -4
  238. package/dist/routes/thank-you.js +8 -8
  239. package/dist/skeleton.js +29 -29
  240. package/dist/{store-lookup-LGYGZ4PU.js → store-lookup-YL4EUIS2.js} +11 -11
  241. package/dist/{store-lookup-LGYGZ4PU.js.map → store-lookup-YL4EUIS2.js.map} +1 -1
  242. package/dist/tanstack.js +19 -19
  243. package/dist/types/index.d.ts +5 -1
  244. package/dist/types/index.d.ts.map +1 -1
  245. package/dist/utils/baseHead.js +2 -2
  246. package/dist/utils/index.js +6 -6
  247. package/dist/utils/store-base.d.ts +30 -0
  248. package/dist/utils/store-base.d.ts.map +1 -1
  249. package/dist/utils/store-identity.d.ts +8 -0
  250. package/dist/utils/store-identity.d.ts.map +1 -1
  251. package/dist/vite/index.js +3 -3
  252. package/package.json +1 -1
  253. package/tailwind/routes/root/beforeLoad.ts.txt +27 -9
  254. package/dist/chunk-FXVII733.js.map +0 -1
  255. package/dist/chunk-S4KV6QGP.js.map +0 -1
  256. package/dist/document-class-TRLFCQHJ.js +0 -32
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/language-cookie.ts","../src/utils/native-app-headers.ts","../src/api/store.ts"],"names":[],"mappings":";;;;;;;;;;AAaA,IAAM,sBAAA,GAAyB,kBAAA,EAAmB,CAC/C,MAAA,CAAO,MAAqB;AAC3B,EAAA,IAAI;AACF,IAAA,OAAO,gBAAA,CAAiB,QAAQ,CAAA,IAAK,IAAA;AAAA,EACvC,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,IAAA;AAAA,EACT;AACF,CAAC,CAAA,CACA,MAAA,CAAO,MAAqB,IAAI,CAAA;AAEnC,IAAM,yBAAA,GAA4B,kBAAA,EAAmB,CAClD,MAAA,CAAO,CAAC,IAAA,KAAuB;AAC9B,EAAA,IAAI;AACF,IAAA,SAAA,CAAU,sBAAsB,IAAA,EAAM;AAAA,MACpC,IAAA,EAAM,GAAA;AAAA,MACN,MAAA,EAAQ,uBAAA;AAAA,MACR,QAAA,EAAU;AAAA,KACX,CAAA;AAAA,EACH,C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AAA;AAAA,EACzC,SAAS,KAAA,EAAO;AACd,IAAA,MAAM,KAAA,GAAQ,uBAAA,CAAwB,UAAA,EAAY,KAAK,CAAA;AACvD,IAAA,OAAA,CAAQ,KAAA,CAAM,kBAAA,EAAoB,KAAA,CAAM,OAAA,EAAS,GAAI,KAAA,KAAU,KAAA,GAAQ,EAAC,GAAI,CAAC,KAAK,CAAE,CAAA;AACpF,IAAA,MAAM,KAAA;AAAA,EACR;AACF;AAEO,IAAM,KAAA,GAAQ;AAAA,EACnB,QAAA,EAAU,OAAO,eAAA,KAA2D;AAC1E,IAAA,IAAI;AACF,MAAA,OAAO,MAAM,cAAc,eAAe,CAAA;AAAA,IAC5C,CAAA,CAAA,MAAQ;AAEN,MAAA,OAAO,IAAA;AAAA,IACT;AAAA,EACF,CAAA;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,CAAC,eAAA,KACT,YAAA,CAAkC;AAAA,MAChC,QAAA,EAAU;AAAA,QACR,OAAA;AAAA,QACA,UAAA;AAAA,QACA,eAAA;AAAA,QACA,oBAAmB,CAAE,MAAA;AAAA,QACrB,cAAA,EAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAQf,uBAAA;AAAwB,OAC1B;AAAA;AAAA,MAEA,OAAA,EAAS,MAAM,aAAA,CAAc,eAAe,CAAA;AAAA;AAAA;AAAA,MAG5C,KAAA,EAAO;AAAA,KACR;AAAA;AAEP","file":"chunk-YVQXIZY7.js","sourcesContent":["/**\n * @fileoverview Reading and writing the `s-lang` cookie, on the server and in the browser.\n *\n * The server reads it from the request the framework is handling and writes it to that\n * request's response. The server-only import is stripped from the client bundle by\n * `createIsomorphicFn`, as in `routes/root/beforeLoad.ts`. The browser uses `document.cookie`.\n * Either side outside a request (a prerender, a test) has nothing to read or write and says so\n * quietly.\n */\nimport { createIsomorphicFn } from '@tanstack/react-start';\nimport { getRequestHeader, getRequestUrl, setCookie } from '@tanstack/react-start/server';\nimport { LANGUAGE_COOKIE_MAX_AGE, LANGUAGE_COOKIE_NAME } from './cookies';\n\nconst readServerCookieHeader = createIsomorphicFn()\n .server((): string | null => {\n try {\n return getRequestHeader('cookie') ?? null;\n } catch {\n return null;\n }\n })\n .client((): string | null => null);\n\nconst writeServerLanguageCookie = createIsomorphicFn()\n .server((code: string): void => {\n try {\n setCookie(LANGUAGE_COOKIE_NAME, code, {\n path: '/',\n maxAge: LANGUAGE_COOKIE_MAX_AGE,\n sameSite: 'lax',\n });\n } catch {\n // Outside a request: there is no response to write to.\n }\n })\n .client((): void => {});\n\nconst readServerSearch = createIsomorphicFn()\n .server((): string => {\n try {\n return getRequestUrl().search;\n } catch {\n return '';\n }\n })\n .client((): string => '');\n\n/**\n * The query string of the page being rendered (`?lang=en`, or `''`): the request's on the\n * server, the address bar's in the browser, so both sides read the same one.\n */\nexport function readPageSearch(): string {\n return readServerSearch() || (typeof window !== 'undefined' ? window.location.search : '');\n}\n\n/** The `Cookie` header of the request being handled, or `document.cookie` in the browser. */\nexport function readCookieHeader(): string | null {\n return readServerCookieHeader() ?? (typeof document !== 'undefined' ? document.cookie : null);\n}\n\n/** Remembers `code` as the visitor's language for every store on this host. */\nexport function persistLanguageCookie(code: string): void {\n writeServerLanguageCookie(code);\n if (typeof document !== 'undefined') {\n document.cookie = `${LANGUAGE_COOKIE_NAME}=${encodeURIComponent(code)}; path=/; max-age=${LANGUAGE_COOKIE_MAX_AGE}; SameSite=Lax`;\n }\n}\n","/** The headers the Salla native app sends with every page it loads in its webview. */\nexport const NATIVE_APP_HEADERS = [\n 's-app-os',\n 's-app-version',\n 's-app-full-version',\n 's-app-os-version',\n];\n\n/**\n * The native app's own headers on this request, or null when it is not the app.\n *\n * On a Twig theme Laravel copies them into the settings' `jitsu.context.extra.headers`,\n * where the SDK reads the app's platform and version from (`salla.config.isMobileApp()`).\n * A React theme asks for its settings from the server, through the API, so the app's\n * headers never reach that call: the request is the only place they are.\n */\nexport function readNativeAppHeaders(headers: Headers): Record<string, string> | null {\n const os = headers.get('s-app-os')?.toLowerCase();\n if (os !== 'ios' && os !== 'android') return null;\n const found: Record<string, string> = {};\n for (const name of NATIVE_APP_HEADERS) {\n const value = headers.get(name);\n if (value) found[name] = value;\n }\n return found;\n}\n","import { queryOptions } from '@tanstack/react-query';\nimport { isHTTPError, isNetworkError, isTimeoutError } from 'ky';\nimport { api, getActiveScope, STORE_IDENTIFIER_HEADER } from './client';\nimport { devSettingsFetchedAt } from './dev-settings-cache';\nimport { SettingsError } from '../utils/errors';\nimport type { Store, Theme, Language, JitsuConfig, MaintenanceDetails } from '../types';\nimport { getTwilightContext } from '../twilight/context';\nimport { resolveStoreIdentifier } from '../utils/store-identity';\nimport { extractScopeFromUrl, parseStoreId } from '../utils/cookies';\nimport { readPageSearch } from '../utils/language-cookie';\nimport { requestedThemeVersionId } from '../utils/theme-version';\nimport { NATIVE_APP_HEADERS } from '../utils/native-app-headers';\nimport { isNotLaunchedNotice } from '../utils/maintenance';\n\nexport { resolveStoreIdentifier };\n\nconst DEFAULT_INCLUDE_ITEMS = [\n 'store',\n 'settings',\n 'theme',\n 'theme_settings',\n 'external_services',\n 'currencies',\n 'languages',\n 'payments',\n 'product_widgets',\n 'rating',\n 'ratings',\n 'user',\n];\n\n/** Twig's `salla.init({ user })` object; the endpoint ignores the token, so always the guest. */\nexport interface SettingsUser {\n type: 'guest' | 'user';\n id?: number | string | null;\n language_code?: string;\n currency_code?: string;\n country_code?: string;\n [key: string]: unknown;\n}\n\n/**\n * Raw API response for settings endpoint.\n * Languages come as object: { \"AR\": { code, name, ... }, \"EN\": {...} }\n */\ninterface SettingsApiResponse {\n store?: Store;\n theme?: Theme;\n languages?: Record<string, Language>;\n currencies?: Record<\n string,\n { code: string; name: string; symbol: string; amount: number; country_code: string }\n >;\n external_services?: Record<string, unknown>;\n headers?: Record<string, unknown>;\n login?: { url: string; turnstile_site_key: string };\n affiliate?: { utm_url: string; cta_enabled: boolean };\n debug?: boolean;\n trace_console?: boolean;\n policy_url?: string;\n user?: SettingsUser;\n swoole?: string[];\n jitsu?: JitsuConfig;\n maintenance?: boolean;\n maintenance_details?: MaintenanceDetails;\n}\n\n/**\n * Central settings context - single source of truth for all API data.\n * Contains everything from the settings endpoint response after processing.\n */\nexport interface StoreContext {\n store?: Store;\n theme?: Theme;\n /** Languages as array after conversion from API object format */\n languages?: Language[];\n currencies?: Record<\n string,\n { code: string; name: string; symbol: string; amount: number; country_code: string }\n >;\n external_services?: Record<string, unknown>;\n headers?: Record<string, unknown>;\n login?: { url: string; turnstile_site_key: string };\n affiliate?: { utm_url: string; cta_enabled: boolean };\n debug?: boolean;\n trace_console?: boolean; // todo:: remove it\n policy_url?: string;\n user?: SettingsUser;\n /** API paths the SDK sends with `s-store-api-version: swoole` */\n swoole?: string[];\n /** Where the SDK's analytics send events, and which ones; without it the SDK tracks nothing. */\n jitsu?: JitsuConfig;\n /**\n * The store is closed: by the merchant from the dashboard, by the platform, or\n * for the selected market only. The engine then renders the maintenance page\n * to everyone but the merchant; see `rootBeforeLoad`.\n */\n maintenance?: boolean;\n /** What the maintenance page says; sent beside `maintenance`. */\n maintenance_details?: MaintenanceDetails;\n /**\n * `false` while the store has not launched yet: `maintenance` is then `true` and the\n * engine's maintenance page says the store is launching soon. Absent otherwise. Not\n * from the API: read off `maintenance_details` by `store.settings`, since the\n * backend sends the merchant's \"finish launching\" notice there for every visitor,\n * which is not for a customer's eyes.\n */\n launched?: false;\n /**\n * The scope these settings were requested with; absent when none was. Not from\n * the API: stamped by `store.settings`, so `resolveThemeVersionId` can tell\n * whether the version they name still answers the scope that is active now.\n */\n requestedScopeId?: string;\n /** Which answer of the API these settings are; see {@link SettingsAnswer}. */\n answer?: SettingsAnswer;\n /**\n * When the dev server fetched these settings from the API (epoch ms). It reuses\n * them for a while (see `dev-settings-cache.ts`) and the theme editor says how old\n * they are. Only on a dev server render; absent everywhere else.\n */\n devFetchedAt?: number;\n}\n\n/**\n * Which answer of the settings API a set of settings came from, read off the\n * response rather than the body: the API's request id, the Store's trace, and\n * whether Cloudflare served it from its cache and how old it was. A decision the\n * settings drive for every visitor alike (the maintenance page) can then be\n * traced to the exact request the backend logged, or to a cached copy of it.\n */\nexport interface SettingsAnswer {\n requestId?: string;\n traceId?: string;\n cacheStatus?: string;\n age?: string;\n}\n\nconst ANSWER_HEADERS: Record<keyof SettingsAnswer, string> = {\n requestId: 's-request-id',\n traceId: 'x-trace-id',\n cacheStatus: 'cf-cache-status',\n age: 'age',\n};\n\nfunction settingsAnswerOf(headers: Headers | undefined): SettingsAnswer | undefined {\n if (!headers) return undefined;\n const answer: SettingsAnswer = {};\n for (const [field, name] of Object.entries(ANSWER_HEADERS) as [keyof SettingsAnswer, string][]) {\n const value = headers.get(name);\n if (value) answer[field] = value;\n }\n return Object.keys(answer).length ? answer : undefined;\n}\n\n/**\n * Converts languages object from API to array format.\n * API returns: { \"AR\": { code, name, ... }, \"EN\": { ... } }\n * We need: [{ code, name, ... }, { code, name, ... }]\n * todo:: return the languages as object from the APIs to avoid this\n */\nfunction languagesToArray(languages?: Record<string, Language>): Language[] | undefined {\n if (!languages) return undefined;\n // The SDK's localization modal reads `lang.iso_code` (not `code`) when a language is\n // selected — without it the switch navigates to `/undefined/...`.\n return Object.values(languages).map((lang) => ({ iso_code: lang.code, ...lang }));\n}\n\n/**\n * The settings' analytics context with the native app's headers in it, as Laravel\n * writes it for a Twig theme: the SDK reads the app's platform and version from there.\n * The API answers a server-side call with the engine's own headers, never the app's.\n */\nfunction withNativeAppHeaders(jitsu?: JitsuConfig): JitsuConfig | undefined {\n if (!jitsu || typeof window !== 'undefined') return jitsu;\n let appHeaders: Record<string, string> | null = null;\n try {\n appHeaders = getTwilightContext().nativeAppHeaders;\n } catch {\n return jitsu;\n }\n if (!appHeaders) return jitsu;\n const extra = jitsu.context?.extra;\n // The engine's own app headers go, so an app that sends no version doesn't get the engine's.\n const headers = { ...extra?.headers };\n for (const name of NATIVE_APP_HEADERS) delete headers[name];\n return {\n ...jitsu,\n context: {\n ...jitsu.context,\n extra: { ...extra, headers: { ...headers, ...appHeaders } },\n },\n };\n}\n\nconst SETTINGS_TIMEOUT_MS = 5000;\n\n/**\n * Whether the page's own address switches market (`?scope=`).\n *\n * Only then does the settings request name the scope in its query string. The API\n * reads `?scope=` as a switch and lets it override the market a market's own domain\n * is pinned to, which the `s-scope-id` header never does. Sent on every request, a\n * market remembered from another visit would win over the host the shopper is on: the\n * settings, and the SDK seeded from them, would answer for that market while every\n * call without the parameter (the cart, among them) answers for the host's, and a\n * guest's cart created in one is refused by the other (TD-17588).\n */\nfunction pageSwitchesScope(): boolean {\n return extractScopeFromUrl(`http://page.invalid/${readPageSearch()}`) !== null;\n}\n\nasync function requestSettings(identifier: string): Promise<StoreContext> {\n const includeParams = DEFAULT_INCLUDE_ITEMS.map((i) => `include[]=${i}`).join('&');\n const scope = getActiveScope();\n const params =\n scope != null && pageSwitchesScope() ? `${includeParams}&scope=${scope.id}` : includeParams;\n\n const request = api\n // Sent explicitly rather than left to the client's own resolution, so\n // the identifier this function checked is the identifier that travels.\n // They agree today; a caller passing one and being answered about\n // another is the failure this makes impossible rather than unlikely.\n .get(`store/settings?${params}`, {\n timeout: SETTINGS_TIMEOUT_MS,\n headers: { [STORE_IDENTIFIER_HEADER]: identifier },\n });\n const json = await request.json<{ data?: SettingsApiResponse }>();\n // The same response, already settled; only its headers are read.\n const headers = (await request)?.headers;\n const answer = settingsAnswerOf(headers);\n const devFetchedAt = devSettingsFetchedAt(headers);\n\n const data = json?.data;\n if (!data) {\n throw new SettingsError(\n `The Salla API answered the settings request for store \"${identifier}\" without settings.`,\n { reason: 'empty' }\n );\n }\n\n // Convert languages from object to array\n const languages = languagesToArray(data.languages);\n\n return {\n store: data.store,\n theme: data.theme,\n languages,\n currencies: data.currencies,\n external_services: data.external_services,\n headers: data.headers,\n login: data.login,\n affiliate: data.affiliate,\n policy_url: data.policy_url,\n user: data.user,\n swoole: data.swoole,\n jitsu: withNativeAppHeaders(data.jitsu),\n maintenance: data.maintenance,\n maintenance_details: data.maintenance_details,\n ...(data.maintenance === true &&\n isNotLaunchedNotice(data.maintenance_details) && { launched: false as const }),\n ...(scope && { requestedScopeId: scope.id }),\n ...(answer && { answer }),\n ...(devFetchedAt && { devFetchedAt }),\n };\n}\n\n/** The message the API put in an error body, `{ error: { message } }`, when it sent one. */\nfunction apiErrorMessage(data: unknown): string | undefined {\n const message = (data as { error?: { message?: unknown } } | undefined)?.error?.message;\n return typeof message === 'string' && message.length > 0 && message.length <= 200\n ? message\n : undefined;\n}\n\n/**\n * What core's `CurrentStoreMiddleware` answers, with a 422, when no store has the\n * username or domain it was given (or the store's status is `deleted`). The lookup is\n * `loadUseUsernameOrDomain`, the same one Twig's `checkUsername` turns into its 410.\n * The literal is not translated: it reads the same whatever language was asked for.\n */\nconst STORE_NOT_FOUND_MESSAGE = 'المتجر غير موجود';\n\n/**\n * Whether the API answered that no store has this identifier. A numeric identifier\n * is looked up with `findOrFail`, which Store's exception handler answers with a 410;\n * a username or domain gets {@link STORE_NOT_FOUND_MESSAGE}. A 410 for a username is\n * not read as one: nothing on that path answers it, and a store that does exist must\n * never be told it does not.\n */\nfunction isStoreNotFound(identifier: string, status: number, said: string | undefined): boolean {\n if (status === 410) return parseStoreId(identifier) !== null;\n return status === 422 && said === STORE_NOT_FOUND_MESSAGE;\n}\n\n/**\n * Names what went wrong, because the page, the server log and Sentry all carry\n * this message. Every failure used to read \"Make sure VITE_STORE_DOMAIN is set\",\n * a local-development variable no deployed theme has, so a slow API looked like\n * a misconfigured theme.\n */\nfunction describeSettingsFailure(identifier: string, error: unknown): SettingsError {\n if (error instanceof SettingsError) return error;\n const request = `the settings request for store \"${identifier}\"`;\n if (isTimeoutError(error)) {\n return new SettingsError(\n `The Salla API did not answer ${request} within ${SETTINGS_TIMEOUT_MS} ms.`,\n { reason: 'timeout' }\n );\n }\n if (isHTTPError(error)) {\n const { status } = error.response;\n const said = apiErrorMessage(error.data);\n return new SettingsError(\n `The Salla API answered ${request} with HTTP ${status}${said ? `: ${said}` : ''}.`,\n { reason: isStoreNotFound(identifier, status, said) ? 'not-found' : 'http', status }\n );\n }\n if (isNetworkError(error)) {\n return new SettingsError(`The Salla API could not be reached for ${request}.`, {\n reason: 'network',\n });\n }\n const detail = error instanceof Error ? `: ${error.message}` : '';\n return new SettingsError(`The settings request for store \"${identifier}\" failed${detail}.`);\n}\n\n/**\n * The settings, or a {@link SettingsError} that says why there are none. The\n * query throws it so the root route can say why the store did not load;\n * `store.settings` keeps answering `null` for its own callers.\n */\nasync function fetchSettings(storeIdentifier?: string): Promise<StoreContext> {\n const identifier = storeIdentifier ?? resolveStoreIdentifier();\n\n if (!identifier) {\n const error = new SettingsError(\n 'No store is named for this request: add `?storeId=` on the preview host, or set VITE_STORE_DOMAIN in local development.',\n { reason: 'no-store' }\n );\n console.warn('[store.settings]', error.message);\n throw error;\n }\n\n try {\n return await requestSettings(identifier);\n } catch (cause) {\n const error = describeSettingsFailure(identifier, cause);\n console.error('[store.settings]', error.message, ...(cause === error ? [] : [cause]));\n throw error;\n }\n}\n\nexport const store = {\n settings: async (storeIdentifier?: string): Promise<StoreContext | null> => {\n try {\n return await fetchSettings(storeIdentifier);\n } catch {\n // Already logged, with the reason.\n return null;\n }\n },\n\n queries: {\n settings: (storeIdentifier?: string) =>\n queryOptions<StoreContext | null>({\n queryKey: [\n 'store',\n 'settings',\n storeIdentifier,\n getTwilightContext().locale,\n getActiveScope(),\n // Two versions of one store's settings are two different answers, and\n // this is the query whose answer decides what every other call is\n // pinned to. `requestedThemeVersionId` rather than the resolved one:\n // the resolved value falls back to what these settings report, so it\n // is not knowable until after this query has run — the key would be\n // one thing on the server and another on the client, and the hydrated\n // page would refetch the settings it was just handed.\n requestedThemeVersionId(),\n ],\n // Throws rather than resolving `null`, so the failure keeps its reason.\n queryFn: () => fetchSettings(storeIdentifier),\n // A null never retried, and the root route waits on this: the router's\n // default `retry: 1` would sit through the timeout twice.\n retry: 0,\n }),\n },\n};\n"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AA,QACA,UAAA;AAAA,QACA,eAAA;AAAA,QACA,oBAAmB,CAAE,MAAA;AAAA,QACrB,cAAA,EAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAQf,uBAAA;AAAwB,OAC1B;AAAA;AAAA,MAEA,OAAA,EAAS,MAAM,aAAA,CAAc,eAAe,CAAA;AAAA;AAAA;AAAA,MAG5C,KAAA,EAAO;AAAA,KACR;AAAA;AAEP","file":"chunk-DMR3ICV5.js","sourcesContent":["/**\n * @fileoverview Reading and writing the `s-lang` cookie, on the server and in the browser.\n *\n * The server reads it from the request the framework is handling and writes it to that\n * request's response. The server-only import is stripped from the client bundle by\n * `createIsomorphicFn`, as in `routes/root/beforeLoad.ts`. The browser uses `document.cookie`.\n * Either side outside a request (a prerender, a test) has nothing to read or write and says so\n * quietly.\n */\nimport { createIsomorphicFn } from '@tanstack/react-start';\nimport { getRequestHeader, getRequestUrl, setCookie } from '@tanstack/react-start/server';\nimport { LANGUAGE_COOKIE_MAX_AGE, LANGUAGE_COOKIE_NAME } from './cookies';\n\nconst readServerCookieHeader = createIsomorphicFn()\n .server((): string | null => {\n try {\n return getRequestHeader('cookie') ?? null;\n } catch {\n return null;\n }\n })\n .client((): string | null => null);\n\nconst writeServerLanguageCookie = createIsomorphicFn()\n .server((code: string): void => {\n try {\n setCookie(LANGUAGE_COOKIE_NAME, code, {\n path: '/',\n maxAge: LANGUAGE_COOKIE_MAX_AGE,\n sameSite: 'lax',\n });\n } catch {\n // Outside a request: there is no response to write to.\n }\n })\n .client((): void => {});\n\nconst readServerSearch = createIsomorphicFn()\n .server((): string => {\n try {\n return getRequestUrl().search;\n } catch {\n return '';\n }\n })\n .client((): string => '');\n\n/**\n * The query string of the page being rendered (`?lang=en`, or `''`): the request's on the\n * server, the address bar's in the browser, so both sides read the same one.\n */\nexport function readPageSearch(): string {\n return readServerSearch() || (typeof window !== 'undefined' ? window.location.search : '');\n}\n\n/** The `Cookie` header of the request being handled, or `document.cookie` in the browser. */\nexport function readCookieHeader(): string | null {\n return readServerCookieHeader() ?? (typeof document !== 'undefined' ? document.cookie : null);\n}\n\n/** Remembers `code` as the visitor's language for every store on this host. */\nexport function persistLanguageCookie(code: string): void {\n writeServerLanguageCookie(code);\n if (typeof document !== 'undefined') {\n document.cookie = `${LANGUAGE_COOKIE_NAME}=${encodeURIComponent(code)}; path=/; max-age=${LANGUAGE_COOKIE_MAX_AGE}; SameSite=Lax`;\n }\n}\n","/** The headers the Salla native app sends with every page it loads in its webview. */\nexport const NATIVE_APP_HEADERS = [\n 's-app-os',\n 's-app-version',\n 's-app-full-version',\n 's-app-os-version',\n];\n\n/**\n * The native app's own headers on this request, or null when it is not the app.\n *\n * On a Twig theme Laravel copies them into the settings' `jitsu.context.extra.headers`,\n * where the SDK reads the app's platform and version from (`salla.config.isMobileApp()`).\n * A React theme asks for its settings from the server, through the API, so the app's\n * headers never reach that call: the request is the only place they are.\n */\nexport function readNativeAppHeaders(headers: Headers): Record<string, string> | null {\n const os = headers.get('s-app-os')?.toLowerCase();\n if (os !== 'ios' && os !== 'android') return null;\n const found: Record<string, string> = {};\n for (const name of NATIVE_APP_HEADERS) {\n const value = headers.get(name);\n if (value) found[name] = value;\n }\n return found;\n}\n","import { queryOptions } from '@tanstack/react-query';\nimport { isHTTPError, isNetworkError, isTimeoutError } from 'ky';\nimport { api, getActiveScope, STORE_IDENTIFIER_HEADER } from './client';\nimport { devSettingsFetchedAt } from './dev-settings-cache';\nimport { SettingsError } from '../utils/errors';\nimport type { Store, Theme, Language, JitsuConfig, MaintenanceDetails } from '../types';\nimport { getTwilightContext } from '../twilight/context';\nimport { resolveStoreIdentifier } from '../utils/store-identity';\nimport { extractScopeFromUrl, parseStoreId } from '../utils/cookies';\nimport { readPageSearch } from '../utils/language-cookie';\nimport { requestedThemeVersionId } from '../utils/theme-version';\nimport { NATIVE_APP_HEADERS } from '../utils/native-app-headers';\nimport { isNotLaunchedNotice } from '../utils/maintenance';\n\nexport { resolveStoreIdentifier };\n\nconst DEFAULT_INCLUDE_ITEMS = [\n 'store',\n 'settings',\n 'theme',\n 'theme_settings',\n 'external_services',\n 'currencies',\n 'languages',\n 'payments',\n 'product_widgets',\n 'rating',\n 'ratings',\n 'user',\n];\n\n/** Twig's `salla.init({ user })` object; the endpoint ignores the token, so always the guest. */\nexport interface SettingsUser {\n type: 'guest' | 'user';\n id?: number | string | null;\n language_code?: string;\n currency_code?: string;\n country_code?: string;\n [key: string]: unknown;\n}\n\n/**\n * Raw API response for settings endpoint.\n * Languages come as object: { \"AR\": { code, name, ... }, \"EN\": {...} }\n */\ninterface SettingsApiResponse {\n store?: Store;\n theme?: Theme;\n languages?: Record<string, Language>;\n currencies?: Record<\n string,\n { code: string; name: string; symbol: string; amount: number; country_code: string }\n >;\n external_services?: Record<string, unknown>;\n headers?: Record<string, unknown>;\n login?: { url: string; turnstile_site_key: string };\n affiliate?: { utm_url: string; cta_enabled: boolean };\n debug?: boolean;\n trace_console?: boolean;\n policy_url?: string;\n user?: SettingsUser;\n swoole?: string[];\n jitsu?: JitsuConfig;\n maintenance?: boolean;\n maintenance_details?: MaintenanceDetails;\n}\n\n/**\n * Central settings context - single source of truth for all API data.\n * Contains everything from the settings endpoint response after processing.\n */\nexport interface StoreContext {\n store?: Store;\n theme?: Theme;\n /** Languages as array after conversion from API object format */\n languages?: Language[];\n currencies?: Record<\n string,\n { code: string; name: string; symbol: string; amount: number; country_code: string }\n >;\n external_services?: Record<string, unknown>;\n headers?: Record<string, unknown>;\n login?: { url: string; turnstile_site_key: string };\n affiliate?: { utm_url: string; cta_enabled: boolean };\n debug?: boolean;\n trace_console?: boolean; // todo:: remove it\n policy_url?: string;\n user?: SettingsUser;\n /** API paths the SDK sends with `s-store-api-version: swoole` */\n swoole?: string[];\n /** Where the SDK's analytics send events, and which ones; without it the SDK tracks nothing. */\n jitsu?: JitsuConfig;\n /**\n * The store is closed: by the merchant from the dashboard, by the platform, or\n * for the selected market only. The engine then renders the maintenance page\n * to everyone but the merchant; see `rootBeforeLoad`.\n */\n maintenance?: boolean;\n /** What the maintenance page says; sent beside `maintenance`. */\n maintenance_details?: MaintenanceDetails;\n /**\n * `false` while the store has not launched yet: `maintenance` is then `true` and the\n * engine's maintenance page says the store is launching soon. Absent otherwise. Not\n * from the API: read off `maintenance_details` by `store.settings`, since the\n * backend sends the merchant's \"finish launching\" notice there for every visitor,\n * which is not for a customer's eyes.\n */\n launched?: false;\n /**\n * The scope these settings were requested with; absent when none was. Not from\n * the API: stamped by `store.settings`, so `resolveThemeVersionId` can tell\n * whether the version they name still answers the scope that is active now.\n */\n requestedScopeId?: string;\n /** Which answer of the API these settings are; see {@link SettingsAnswer}. */\n answer?: SettingsAnswer;\n /**\n * When the dev server fetched these settings from the API (epoch ms). It reuses\n * them for a while (see `dev-settings-cache.ts`) and the theme editor says how old\n * they are. Only on a dev server render; absent everywhere else.\n */\n devFetchedAt?: number;\n}\n\n/**\n * Which answer of the settings API a set of settings came from, read off the\n * response rather than the body: the API's request id, the Store's trace, and\n * whether Cloudflare served it from its cache and how old it was. A decision the\n * settings drive for every visitor alike (the maintenance page) can then be\n * traced to the exact request the backend logged, or to a cached copy of it.\n */\nexport interface SettingsAnswer {\n requestId?: string;\n traceId?: string;\n cacheStatus?: string;\n age?: string;\n}\n\nconst ANSWER_HEADERS: Record<keyof SettingsAnswer, string> = {\n requestId: 's-request-id',\n traceId: 'x-trace-id',\n cacheStatus: 'cf-cache-status',\n age: 'age',\n};\n\nfunction settingsAnswerOf(headers: Headers | undefined): SettingsAnswer | undefined {\n if (!headers) return undefined;\n const answer: SettingsAnswer = {};\n for (const [field, name] of Object.entries(ANSWER_HEADERS) as [keyof SettingsAnswer, string][]) {\n const value = headers.get(name);\n if (value) answer[field] = value;\n }\n return Object.keys(answer).length ? answer : undefined;\n}\n\n/**\n * Converts languages object from API to array format.\n * API returns: { \"AR\": { code, name, ... }, \"EN\": { ... } }\n * We need: [{ code, name, ... }, { code, name, ... }]\n * todo:: return the languages as object from the APIs to avoid this\n */\nfunction languagesToArray(languages?: Record<string, Language>): Language[] | undefined {\n if (!languages) return undefined;\n // The SDK's localization modal reads `lang.iso_code` (not `code`) when a language is\n // selected — without it the switch navigates to `/undefined/...`.\n return Object.values(languages).map((lang) => ({ iso_code: lang.code, ...lang }));\n}\n\n/**\n * The settings' analytics context with the native app's headers in it, as Laravel\n * writes it for a Twig theme: the SDK reads the app's platform and version from there.\n * The API answers a server-side call with the engine's own headers, never the app's.\n */\nfunction withNativeAppHeaders(jitsu?: JitsuConfig): JitsuConfig | undefined {\n if (!jitsu || typeof window !== 'undefined') return jitsu;\n let appHeaders: Record<string, string> | null = null;\n try {\n appHeaders = getTwilightContext().nativeAppHeaders;\n } catch {\n return jitsu;\n }\n if (!appHeaders) return jitsu;\n const extra = jitsu.context?.extra;\n // The engine's own app headers go, so an app that sends no version doesn't get the engine's.\n const headers = { ...extra?.headers };\n for (const name of NATIVE_APP_HEADERS) delete headers[name];\n return {\n ...jitsu,\n context: {\n ...jitsu.context,\n extra: { ...extra, headers: { ...headers, ...appHeaders } },\n },\n };\n}\n\nconst SETTINGS_TIMEOUT_MS = 5000;\n\n/**\n * Whether the page's own address switches market (`?scope=`).\n *\n * Only then does the settings request name the scope in its query string. The API\n * reads `?scope=` as a switch and lets it override the market a market's own domain\n * is pinned to, which the `s-scope-id` header never does. Sent on every request, a\n * market remembered from another visit would win over the host the shopper is on: the\n * settings, and the SDK seeded from them, would answer for that market while every\n * call without the parameter (the cart, among them) answers for the host's, and a\n * guest's cart created in one is refused by the other (TD-17588).\n */\nfunction pageSwitchesScope(): boolean {\n return extractScopeFromUrl(`http://page.invalid/${readPageSearch()}`) !== null;\n}\n\nasync function requestSettings(identifier: string): Promise<StoreContext> {\n const includeParams = DEFAULT_INCLUDE_ITEMS.map((i) => `include[]=${i}`).join('&');\n const scope = getActiveScope();\n const params =\n scope != null && pageSwitchesScope() ? `${includeParams}&scope=${scope.id}` : includeParams;\n\n const request = api\n // Sent explicitly rather than left to the client's own resolution, so\n // the identifier this function checked is the identifier that travels.\n // They agree today; a caller passing one and being answered about\n // another is the failure this makes impossible rather than unlikely.\n .get(`store/settings?${params}`, {\n timeout: SETTINGS_TIMEOUT_MS,\n headers: { [STORE_IDENTIFIER_HEADER]: identifier },\n });\n const json = await request.json<{ data?: SettingsApiResponse }>();\n // The same response, already settled; only its headers are read.\n const headers = (await request)?.headers;\n const answer = settingsAnswerOf(headers);\n const devFetchedAt = devSettingsFetchedAt(headers);\n\n const data = json?.data;\n if (!data) {\n throw new SettingsError(\n `The Salla API answered the settings request for store \"${identifier}\" without settings.`,\n { reason: 'empty' }\n );\n }\n\n // Convert languages from object to array\n const languages = languagesToArray(data.languages);\n\n return {\n store: data.store,\n theme: data.theme,\n languages,\n currencies: data.currencies,\n external_services: data.external_services,\n headers: data.headers,\n login: data.login,\n affiliate: data.affiliate,\n policy_url: data.policy_url,\n user: data.user,\n swoole: data.swoole,\n jitsu: withNativeAppHeaders(data.jitsu),\n maintenance: data.maintenance,\n maintenance_details: data.maintenance_details,\n ...(data.maintenance === true &&\n isNotLaunchedNotice(data.maintenance_details) && { launched: false as const }),\n ...(scope && { requestedScopeId: scope.id }),\n ...(answer && { answer }),\n ...(devFetchedAt && { devFetchedAt }),\n };\n}\n\n/** The message the API put in an error body, `{ error: { message } }`, when it sent one. */\nfunction apiErrorMessage(data: unknown): string | undefined {\n const message = (data as { error?: { message?: unknown } } | undefined)?.error?.message;\n return typeof message === 'string' && message.length > 0 && message.length <= 200\n ? message\n : undefined;\n}\n\n/**\n * What core's `CurrentStoreMiddleware` answers, with a 422, when no store has the\n * username or domain it was given (or the store's status is `deleted`). The lookup is\n * `loadUseUsernameOrDomain`, the same one Twig's `checkUsername` turns into its 410.\n * The literal is not translated: it reads the same whatever language was asked for.\n */\nconst STORE_NOT_FOUND_MESSAGE = 'المتجر غير موجود';\n\n/**\n * Whether the API answered that no store has this identifier. A numeric identifier\n * is looked up with `findOrFail`, which Store's exception handler answers with a 410;\n * a username or domain gets {@link STORE_NOT_FOUND_MESSAGE}. A 410 for a username is\n * not read as one: nothing on that path answers it, and a store that does exist must\n * never be told it does not.\n */\nfunction isStoreNotFound(identifier: string, status: number, said: string | undefined): boolean {\n if (status === 410) return parseStoreId(identifier) !== null;\n return status === 422 && said === STORE_NOT_FOUND_MESSAGE;\n}\n\n/**\n * Names what went wrong, because the page, the server log and Sentry all carry\n * this message. Every failure used to read \"Make sure VITE_STORE_DOMAIN is set\",\n * a local-development variable no deployed theme has, so a slow API looked like\n * a misconfigured theme.\n */\nfunction describeSettingsFailure(identifier: string, error: unknown): SettingsError {\n if (error instanceof SettingsError) return error;\n const request = `the settings request for store \"${identifier}\"`;\n if (isTimeoutError(error)) {\n return new SettingsError(\n `The Salla API did not answer ${request} within ${SETTINGS_TIMEOUT_MS} ms.`,\n { reason: 'timeout' }\n );\n }\n if (isHTTPError(error)) {\n const { status } = error.response;\n const said = apiErrorMessage(error.data);\n return new SettingsError(\n `The Salla API answered ${request} with HTTP ${status}${said ? `: ${said}` : ''}.`,\n { reason: isStoreNotFound(identifier, status, said) ? 'not-found' : 'http', status }\n );\n }\n if (isNetworkError(error)) {\n return new SettingsError(`The Salla API could not be reached for ${request}.`, {\n reason: 'network',\n });\n }\n const detail = error instanceof Error ? `: ${error.message}` : '';\n return new SettingsError(`The settings request for store \"${identifier}\" failed${detail}.`);\n}\n\n/**\n * The settings, or a {@link SettingsError} that says why there are none. The\n * query throws it so the root route can say why the store did not load;\n * `store.settings` keeps answering `null` for its own callers.\n */\nasync function fetchSettings(storeIdentifier?: string): Promise<StoreContext> {\n const identifier = storeIdentifier ?? resolveStoreIdentifier();\n\n if (!identifier) {\n const error = new SettingsError(\n 'No store is named for this request: add `?storeId=` on the preview host, or set VITE_STORE_DOMAIN in local development.',\n { reason: 'no-store' }\n );\n console.warn('[store.settings]', error.message);\n throw error;\n }\n\n try {\n return await requestSettings(identifier);\n } catch (cause) {\n const error = describeSettingsFailure(identifier, cause);\n console.error('[store.settings]', error.message, ...(cause === error ? [] : [cause]));\n throw error;\n }\n}\n\nexport const store = {\n settings: async (storeIdentifier?: string): Promise<StoreContext | null> => {\n try {\n return await fetchSettings(storeIdentifier);\n } catch {\n // Already logged, with the reason.\n return null;\n }\n },\n\n queries: {\n settings: (storeIdentifier?: string) =>\n queryOptions<StoreContext | null>({\n queryKey: [\n 'store',\n 'settings',\n storeIdentifier,\n getTwilightContext().locale,\n getActiveScope(),\n // Two versions of one store's settings are two different answers, and\n // this is the query whose answer decides what every other call is\n // pinned to. `requestedThemeVersionId` rather than the resolved one:\n // the resolved value falls back to what these settings report, so it\n // is not knowable until after this query has run — the key would be\n // one thing on the server and another on the client, and the hydrated\n // page would refetch the settings it was just handed.\n requestedThemeVersionId(),\n ],\n // Throws rather than resolving `null`, so the failure keeps its reason.\n queryFn: () => fetchSettings(storeIdentifier),\n // A null never retried, and the root route waits on this: the router's\n // default `retry: 1` would sit through the timeout twice.\n retry: 0,\n }),\n },\n};\n"]}
@@ -1,4 +1,4 @@
1
- import { escapeForInlineScript } from './chunk-FXVII733.js';
1
+ import { escapeForInlineScript } from './chunk-T2752RH7.js';
2
2
 
3
3
  // src/utils/app-scope.ts
4
4
  var isBrowser = typeof window !== "undefined";
@@ -132,5 +132,5 @@ function renderThemeHookSlotsScript(names = getRegisteredThemeHookSlots()) {
132
132
  }
133
133
 
134
134
  export { applyAppScopeMocks, applyThemeHookSlots, installAppScope, registerThemeHookSlots, renderAppScopeInstallScript, renderThemeHookSlotsScript };
135
- //# sourceMappingURL=chunk-WQPG22DY.js.map
136
- //# sourceMappingURL=chunk-WQPG22DY.js.map
135
+ //# sourceMappingURL=chunk-EGI7F57E.js.map
136
+ //# sourceMappingURL=chunk-EGI7F57E.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/app-scope.ts","../src/utils/theme-hook-slots.ts"],"names":[],"mappings":";;;AAGA,IAAM,SAAA,GAAY,OAAO,MAAA,KAAW,WAAA;AA2B7B,IAAM,q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SAAA,CAAU,KAAK,CAAC,CAAA;AACxD,EAAA,OACE,wUASM,IAAI,CAAA,EAAA,CAAA;AAEd","file":"chunk-WQPG22DY.js","sourcesContent":["import type { SallaSDK } from '../types/salla-sdk';\nimport { escapeForInlineScript } from './inline-script';\n\nconst isBrowser = typeof window !== 'undefined';\n\n/** One app's private `app.*` bag, keyed without the `app.` prefix (`app.color` → `color`). */\nexport type AppConfigBag = Record<string, unknown>;\n\n/** One public `app.*` bucket per app, keyed by appScopeId. Everything else is read from the\n * real `salla.config` at runtime. */\nexport interface AppScopeContexts {\n apps: Record<string, AppConfigBag>;\n}\n\n/** Builds the `scopeId → sandboxed SDK` factory over a live bucket bag. */\nexport type AppScopeFactoryBuilder = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n w: any,\n appCtx: Record<string, AppConfigBag>\n) => (scopeId: string) => SallaSDK;\n\n/**\n * The sandbox itself: proxies that resolve `app.*` against the app's own bucket and pass\n * everything else through to the real SDK.\n *\n * MUST stay self-contained (only `Object`/`Proxy` and its two arguments): it is serialized via\n * `.toString()` next to {@link appScopeBootstrap} and handed in as an argument, so anything it\n * closed over at module scope would be undefined in the inline head copy. Split out from the\n * bootstrap purely to keep both halves reviewable.\n */\nexport const createAppScopeFactory: AppScopeFactoryBuilder = (w, appCtx) => {\n const isAppKey = (key: unknown): key is string =>\n typeof key === 'string' && key.indexOf('app.') === 0;\n const bucketKey = (key: string): string => key.slice(4);\n const realSalla = (): Record<string, unknown> => w.salla || w.Salla || {};\n const realConfig = (): Record<string, unknown> =>\n (realSalla().config as Record<string, unknown>) || {};\n const passthrough = (obj: Record<string, unknown>, prop: string | symbol): unknown => {\n const member = obj[prop as string];\n return typeof member === 'function' ? member.bind(obj) : member;\n };\n\n const createAppScope = (scopeId: string): SallaSDK => {\n const bucket = (): AppConfigBag => (appCtx[scopeId] = appCtx[scopeId] || {});\n\n const getConfig = (key: string, fallback?: unknown): unknown => {\n if (isAppKey(key)) {\n const sub = bucketKey(key);\n const b = bucket();\n // `app.*` miss returns the caller default, never the real config — a missing app\n // setting must not resolve to a same-named global.\n return sub in b ? b[sub] : fallback;\n }\n const cfg = realConfig();\n return typeof cfg.get === 'function'\n ? (cfg.get as (k: string, d?: unknown) => unknown)(key, fallback)\n : fallback;\n };\n\n const setConfig = (key: string, value: unknown): unknown => {\n if (isAppKey(key)) {\n bucket()[bucketKey(key)] = value;\n return value;\n }\n const cfg = realConfig();\n return typeof cfg.set === 'function'\n ? (cfg.set as (k: string, v: unknown) => unknown)(key, value)\n : value;\n };\n\n const hasConfig = (key: string): boolean =>\n isAppKey(key) ? bucketKey(key) in bucket() : key in realConfig();\n\n const configProxy = new Proxy({} as Record<string, unknown>, {\n get(_t, prop) {\n if (prop === 'get') return getConfig;\n if (prop === 'set') return setConfig;\n if (prop === 'has') return hasConfig;\n if (isAppKey(prop)) return getConfig(prop);\n return passthrough(realConfig(), prop);\n },\n set(_t, prop, value) {\n setConfig(prop as string, value);\n return true;\n },\n has(_t, prop) {\n return hasConfig(prop as string);\n },\n });\n\n return new Proxy({} as Record<string, unknown>, {\n get(_t, prop) {\n return prop === 'config' ? configProxy : passthrough(realSalla(), prop);\n },\n set(_t, prop, value) {\n // Reassigning `salla.config` wholesale would escape the sandbox; swallow it.\n if (prop === 'config') return true;\n realSalla()[prop as string] = value;\n return true;\n },\n }) as unknown as SallaSDK;\n };\n\n return createAppScope;\n};\n\n/**\n * Installs `window.Salla.appScope`, seeded with `contexts` and sandboxed by `makeFactory`.\n *\n * MUST stay self-contained (only `window`/`Object` and its arguments): it's serialized via\n * `.toString()` and inlined into the SSR head so the factory exists at parse time — before the\n * SDK init/hydration a CDN snippet's `onReady` races, else it throws `Salla.appScope is not a\n * function`. `makeFactory` is passed in rather than imported for exactly that reason. Also\n * called directly by `installAppScope` (tests/fallback).\n *\n * Idempotent: the factory is first-write-wins, while buckets are merged per scope (also\n * first-write-wins) so a later call can seed scopes the first one had no data for. `appCtx` is\n * closure-private (namespacing, not security: buckets are public-only and the boundary is\n * server-side).\n */\nexport function appScopeBootstrap(\n contexts: AppScopeContexts,\n makeFactory: AppScopeFactoryBuilder\n): void {\n if (typeof window === 'undefined') return;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const w = window as any;\n const Salla = (w.Salla = w.Salla || {});\n if (Salla.appScope) {\n // Already installed (normally by the inline head copy). The factory is first-write-wins,\n // but buckets are not: the head may have installed with none of them — the settings\n // endpoint can fail or lag behind the snippets one — so hand them to the existing install.\n if (Salla.__appScopeSeed) Salla.__appScopeSeed(contexts);\n return;\n }\n\n // Live bag + pristine snapshot (for mock overlays). Copy, don't alias: a snippet may\n // `config.set('app.x')` and the payload can be a cached response.\n const appCtx: Record<string, AppConfigBag> = {};\n const base: Record<string, AppConfigBag> = {};\n // Which scopes already got their real bucket, so a later seed can't overwrite one.\n const seeded: Record<string, boolean> = {};\n const seed = (next: AppScopeContexts): void => {\n const bags = (next && next.apps) || {};\n Object.keys(bags).forEach((scopeId) => {\n if (seeded[scopeId]) return;\n seeded[scopeId] = true;\n appCtx[scopeId] = Object.assign({}, appCtx[scopeId] || {}, bags[scopeId] || {});\n base[scopeId] = Object.assign({}, appCtx[scopeId]);\n });\n };\n seed(contexts);\n\n const createAppScope = makeFactory(w, appCtx);\n Salla.appScope = (scopeId: string): SallaSDK => createAppScope(scopeId);\n\n // Fill in buckets for scopes not seeded yet (first-write-wins per scope). Lets the head\n // install the factory unconditionally — at parse time, before any snippet's onReady — and\n // still pick up buckets that only the client managed to fetch.\n Salla.__appScopeSeed = (next: AppScopeContexts): void => seed(next);\n\n // Overlay preview mocks onto an app's pristine baseline, so fields the partner did not mock\n // keep their real values. Returns false for an unknown scope or before install.\n Salla.__appScopeMock = (scopeId: string, mocks: AppConfigBag): boolean => {\n if (!(scopeId in base)) return false;\n appCtx[scopeId] = Object.assign({}, base[scopeId], mocks);\n return true;\n };\n}\n\n/** Overlay preview mocks onto one app's bucket (over its pristine values). Delegates to the\n * bootstrap's `__appScopeMock`, so it works for both install paths. False if unknown/uninstalled. */\nexport function applyAppScopeMocks(appScopeId: string, mocks: AppConfigBag): boolean {\n if (!isBrowser) return false;\n const mock = (window.Salla as unknown as { __appScopeMock?: MockApplier } | undefined)\n ?.__appScopeMock;\n return mock?.(appScopeId, mocks) ?? false;\n}\n\ntype MockApplier = (appScopeId: string, mocks: AppConfigBag) => boolean;\n\n/** Serialize the installer into an inline `<script>` body seeded with `contexts` — both halves\n * via `.toString()`, hence their self-contained requirement. See `rootHead`. */\nexport function renderAppScopeInstallScript(contexts: AppScopeContexts): string {\n // Bucket values are partner-set, so escape the JSON seed against a `</script>` breakout.\n // The function sources have no `<`, so they need no escaping.\n const json = escapeForInlineScript(JSON.stringify(contexts));\n return `(${appScopeBootstrap.toString()})(${json},${createAppScopeFactory.toString()});`;\n}\n\n/** Install `Salla.appScope` on the client, or seed buckets into the inline SSR head copy that\n * already installed it. No-op on the server. Fallback for unseeded loads + the unit-test entry\n * point. */\nexport function installAppScope(contexts: AppScopeContexts): void {\n if (!isBrowser) return;\n appScopeBootstrap(contexts, createAppScopeFactory);\n}\n","import { escapeForInlineScript } from './inline-script';\n\nconst registered = new Set<string>();\n\nlet retryArmed = false;\n\n/**\n * Declare hook slots the theme renders itself so apps may mount into them.\n *\n * The SDK rejects `mount()` for any name absent from its `_themeSlots` whitelist, so a theme\n * rendering its own `<salla-hook>` must register the name. Call at module scope; the engine\n * applies the names via {@link applyThemeHookSlots}.\n */\nexport function registerThemeHookSlots(...names: string[]): void {\n for (const name of names) registered.add(name);\n}\n\n/** Push the registered names in. Returns false if the SDK hasn't exposed the list yet. */\nfunction pushSlots(): boolean {\n const slots = window.salla?.hooks?._themeSlots;\n if (!Array.isArray(slots)) return false;\n for (const name of registered) if (!slots.includes(name)) slots.push(name);\n return true;\n}\n\n/**\n * Push every registered slot name into the SDK whitelist. Idempotent. Engine-only.\n *\n * The SDK's hooks module may attach after this runs, so a first no-op falls back to a\n * one-shot retry on `twilight::initiated` — still before apps mount from their own onReady.\n *\n * This is only the late backstop: the whitelist is primarily seeded at parse time by the\n * inline head script from {@link renderThemeHookSlotsScript}, because an app's snippet\n * registers its `onReady` callback before React ever hydrates.\n */\nexport function applyThemeHookSlots(): void {\n if (typeof window === 'undefined' || registered.size === 0) return;\n if (pushSlots() || retryArmed) return;\n\n retryArmed = true;\n window.addEventListener('twilight::initiated', () => void pushSlots(), { once: true });\n}\n\n/** The slot names registered so far. Read by `rootHead` when rendering the inline script. */\nexport function getRegisteredThemeHookSlots(): string[] {\n return [...registered];\n}\n\n/**\n * Serialize the whitelist push into an inline head `<script>` body, so the slots are\n * registered at parse time.\n *\n * Ordering is the whole point: CDN snippets are parser-inserted `<script defer>` tags in the\n * body, so an app's `Salla.onReady` callback is registered long before React hydrates and runs\n * {@link applyThemeHookSlots}. Whichever `twilight::initiated` listener was added first runs\n * first, so the push must be armed from the head — otherwise the SDK rejects the app's\n * `hooks.mount()` with \"Hook <name> is not allowed\" and the app never renders.\n *\n * Returns null when the theme registered no slots. Kept self-contained (only `window`) since\n * it ships as raw source, not as a bundled module.\n */\nexport function renderThemeHookSlotsScript(names: string[] = getRegisteredThemeHookSlots()) {\n if (!names.length) return null;\n const json = escapeForInlineScript(JSON.stringify(names));\n return (\n `(function(names){` +\n `var w=window;` +\n `function push(){` +\n `var h=w.salla&&w.salla.hooks;var slots=h&&h._themeSlots;` +\n `if(!Array.isArray(slots))return false;` +\n `for(var i=0;i<names.length;i++)if(slots.indexOf(names[i])<0)slots.push(names[i]);` +\n `return true}` +\n `if(push())return;` +\n `w.addEventListener('twilight::initiated',function(){push()},{once:true})` +\n `})(${json});`\n );\n}\n"]}
1
+ {"version":3,"sources":["../src/utils/app-scope.ts","../src/utils/theme-hook-slots.ts"],"names":[],"mappings":";;;AAGA,IAAM,SAAA,GAAY,OAAO,MAAA,KAAW,WAAA;AA2B7B,IAAM,qBAAA,GAAgD,CAAC,CAAA,EAAG,MAAA,KAAW;AAC1E,EAAA,MAAM,QAAA,GAAW,CAA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AEd","file":"chunk-EGI7F57E.js","sourcesContent":["import type { SallaSDK } from '../types/salla-sdk';\nimport { escapeForInlineScript } from './inline-script';\n\nconst isBrowser = typeof window !== 'undefined';\n\n/** One app's private `app.*` bag, keyed without the `app.` prefix (`app.color` → `color`). */\nexport type AppConfigBag = Record<string, unknown>;\n\n/** One public `app.*` bucket per app, keyed by appScopeId. Everything else is read from the\n * real `salla.config` at runtime. */\nexport interface AppScopeContexts {\n apps: Record<string, AppConfigBag>;\n}\n\n/** Builds the `scopeId → sandboxed SDK` factory over a live bucket bag. */\nexport type AppScopeFactoryBuilder = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n w: any,\n appCtx: Record<string, AppConfigBag>\n) => (scopeId: string) => SallaSDK;\n\n/**\n * The sandbox itself: proxies that resolve `app.*` against the app's own bucket and pass\n * everything else through to the real SDK.\n *\n * MUST stay self-contained (only `Object`/`Proxy` and its two arguments): it is serialized via\n * `.toString()` next to {@link appScopeBootstrap} and handed in as an argument, so anything it\n * closed over at module scope would be undefined in the inline head copy. Split out from the\n * bootstrap purely to keep both halves reviewable.\n */\nexport const createAppScopeFactory: AppScopeFactoryBuilder = (w, appCtx) => {\n const isAppKey = (key: unknown): key is string =>\n typeof key === 'string' && key.indexOf('app.') === 0;\n const bucketKey = (key: string): string => key.slice(4);\n const realSalla = (): Record<string, unknown> => w.salla || w.Salla || {};\n const realConfig = (): Record<string, unknown> =>\n (realSalla().config as Record<string, unknown>) || {};\n const passthrough = (obj: Record<string, unknown>, prop: string | symbol): unknown => {\n const member = obj[prop as string];\n return typeof member === 'function' ? member.bind(obj) : member;\n };\n\n const createAppScope = (scopeId: string): SallaSDK => {\n const bucket = (): AppConfigBag => (appCtx[scopeId] = appCtx[scopeId] || {});\n\n const getConfig = (key: string, fallback?: unknown): unknown => {\n if (isAppKey(key)) {\n const sub = bucketKey(key);\n const b = bucket();\n // `app.*` miss returns the caller default, never the real config — a missing app\n // setting must not resolve to a same-named global.\n return sub in b ? b[sub] : fallback;\n }\n const cfg = realConfig();\n return typeof cfg.get === 'function'\n ? (cfg.get as (k: string, d?: unknown) => unknown)(key, fallback)\n : fallback;\n };\n\n const setConfig = (key: string, value: unknown): unknown => {\n if (isAppKey(key)) {\n bucket()[bucketKey(key)] = value;\n return value;\n }\n const cfg = realConfig();\n return typeof cfg.set === 'function'\n ? (cfg.set as (k: string, v: unknown) => unknown)(key, value)\n : value;\n };\n\n const hasConfig = (key: string): boolean =>\n isAppKey(key) ? bucketKey(key) in bucket() : key in realConfig();\n\n const configProxy = new Proxy({} as Record<string, unknown>, {\n get(_t, prop) {\n if (prop === 'get') return getConfig;\n if (prop === 'set') return setConfig;\n if (prop === 'has') return hasConfig;\n if (isAppKey(prop)) return getConfig(prop);\n return passthrough(realConfig(), prop);\n },\n set(_t, prop, value) {\n setConfig(prop as string, value);\n return true;\n },\n has(_t, prop) {\n return hasConfig(prop as string);\n },\n });\n\n return new Proxy({} as Record<string, unknown>, {\n get(_t, prop) {\n return prop === 'config' ? configProxy : passthrough(realSalla(), prop);\n },\n set(_t, prop, value) {\n // Reassigning `salla.config` wholesale would escape the sandbox; swallow it.\n if (prop === 'config') return true;\n realSalla()[prop as string] = value;\n return true;\n },\n }) as unknown as SallaSDK;\n };\n\n return createAppScope;\n};\n\n/**\n * Installs `window.Salla.appScope`, seeded with `contexts` and sandboxed by `makeFactory`.\n *\n * MUST stay self-contained (only `window`/`Object` and its arguments): it's serialized via\n * `.toString()` and inlined into the SSR head so the factory exists at parse time — before the\n * SDK init/hydration a CDN snippet's `onReady` races, else it throws `Salla.appScope is not a\n * function`. `makeFactory` is passed in rather than imported for exactly that reason. Also\n * called directly by `installAppScope` (tests/fallback).\n *\n * Idempotent: the factory is first-write-wins, while buckets are merged per scope (also\n * first-write-wins) so a later call can seed scopes the first one had no data for. `appCtx` is\n * closure-private (namespacing, not security: buckets are public-only and the boundary is\n * server-side).\n */\nexport function appScopeBootstrap(\n contexts: AppScopeContexts,\n makeFactory: AppScopeFactoryBuilder\n): void {\n if (typeof window === 'undefined') return;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const w = window as any;\n const Salla = (w.Salla = w.Salla || {});\n if (Salla.appScope) {\n // Already installed (normally by the inline head copy). The factory is first-write-wins,\n // but buckets are not: the head may have installed with none of them — the settings\n // endpoint can fail or lag behind the snippets one — so hand them to the existing install.\n if (Salla.__appScopeSeed) Salla.__appScopeSeed(contexts);\n return;\n }\n\n // Live bag + pristine snapshot (for mock overlays). Copy, don't alias: a snippet may\n // `config.set('app.x')` and the payload can be a cached response.\n const appCtx: Record<string, AppConfigBag> = {};\n const base: Record<string, AppConfigBag> = {};\n // Which scopes already got their real bucket, so a later seed can't overwrite one.\n const seeded: Record<string, boolean> = {};\n const seed = (next: AppScopeContexts): void => {\n const bags = (next && next.apps) || {};\n Object.keys(bags).forEach((scopeId) => {\n if (seeded[scopeId]) return;\n seeded[scopeId] = true;\n appCtx[scopeId] = Object.assign({}, appCtx[scopeId] || {}, bags[scopeId] || {});\n base[scopeId] = Object.assign({}, appCtx[scopeId]);\n });\n };\n seed(contexts);\n\n const createAppScope = makeFactory(w, appCtx);\n Salla.appScope = (scopeId: string): SallaSDK => createAppScope(scopeId);\n\n // Fill in buckets for scopes not seeded yet (first-write-wins per scope). Lets the head\n // install the factory unconditionally — at parse time, before any snippet's onReady — and\n // still pick up buckets that only the client managed to fetch.\n Salla.__appScopeSeed = (next: AppScopeContexts): void => seed(next);\n\n // Overlay preview mocks onto an app's pristine baseline, so fields the partner did not mock\n // keep their real values. Returns false for an unknown scope or before install.\n Salla.__appScopeMock = (scopeId: string, mocks: AppConfigBag): boolean => {\n if (!(scopeId in base)) return false;\n appCtx[scopeId] = Object.assign({}, base[scopeId], mocks);\n return true;\n };\n}\n\n/** Overlay preview mocks onto one app's bucket (over its pristine values). Delegates to the\n * bootstrap's `__appScopeMock`, so it works for both install paths. False if unknown/uninstalled. */\nexport function applyAppScopeMocks(appScopeId: string, mocks: AppConfigBag): boolean {\n if (!isBrowser) return false;\n const mock = (window.Salla as unknown as { __appScopeMock?: MockApplier } | undefined)\n ?.__appScopeMock;\n return mock?.(appScopeId, mocks) ?? false;\n}\n\ntype MockApplier = (appScopeId: string, mocks: AppConfigBag) => boolean;\n\n/** Serialize the installer into an inline `<script>` body seeded with `contexts` — both halves\n * via `.toString()`, hence their self-contained requirement. See `rootHead`. */\nexport function renderAppScopeInstallScript(contexts: AppScopeContexts): string {\n // Bucket values are partner-set, so escape the JSON seed against a `</script>` breakout.\n // The function sources have no `<`, so they need no escaping.\n const json = escapeForInlineScript(JSON.stringify(contexts));\n return `(${appScopeBootstrap.toString()})(${json},${createAppScopeFactory.toString()});`;\n}\n\n/** Install `Salla.appScope` on the client, or seed buckets into the inline SSR head copy that\n * already installed it. No-op on the server. Fallback for unseeded loads + the unit-test entry\n * point. */\nexport function installAppScope(contexts: AppScopeContexts): void {\n if (!isBrowser) return;\n appScopeBootstrap(contexts, createAppScopeFactory);\n}\n","import { escapeForInlineScript } from './inline-script';\n\nconst registered = new Set<string>();\n\nlet retryArmed = false;\n\n/**\n * Declare hook slots the theme renders itself so apps may mount into them.\n *\n * The SDK rejects `mount()` for any name absent from its `_themeSlots` whitelist, so a theme\n * rendering its own `<salla-hook>` must register the name. Call at module scope; the engine\n * applies the names via {@link applyThemeHookSlots}.\n */\nexport function registerThemeHookSlots(...names: string[]): void {\n for (const name of names) registered.add(name);\n}\n\n/** Push the registered names in. Returns false if the SDK hasn't exposed the list yet. */\nfunction pushSlots(): boolean {\n const slots = window.salla?.hooks?._themeSlots;\n if (!Array.isArray(slots)) return false;\n for (const name of registered) if (!slots.includes(name)) slots.push(name);\n return true;\n}\n\n/**\n * Push every registered slot name into the SDK whitelist. Idempotent. Engine-only.\n *\n * The SDK's hooks module may attach after this runs, so a first no-op falls back to a\n * one-shot retry on `twilight::initiated` — still before apps mount from their own onReady.\n *\n * This is only the late backstop: the whitelist is primarily seeded at parse time by the\n * inline head script from {@link renderThemeHookSlotsScript}, because an app's snippet\n * registers its `onReady` callback before React ever hydrates.\n */\nexport function applyThemeHookSlots(): void {\n if (typeof window === 'undefined' || registered.size === 0) return;\n if (pushSlots() || retryArmed) return;\n\n retryArmed = true;\n window.addEventListener('twilight::initiated', () => void pushSlots(), { once: true });\n}\n\n/** The slot names registered so far. Read by `rootHead` when rendering the inline script. */\nexport function getRegisteredThemeHookSlots(): string[] {\n return [...registered];\n}\n\n/**\n * Serialize the whitelist push into an inline head `<script>` body, so the slots are\n * registered at parse time.\n *\n * Ordering is the whole point: CDN snippets are parser-inserted `<script defer>` tags in the\n * body, so an app's `Salla.onReady` callback is registered long before React hydrates and runs\n * {@link applyThemeHookSlots}. Whichever `twilight::initiated` listener was added first runs\n * first, so the push must be armed from the head — otherwise the SDK rejects the app's\n * `hooks.mount()` with \"Hook <name> is not allowed\" and the app never renders.\n *\n * Returns null when the theme registered no slots. Kept self-contained (only `window`) since\n * it ships as raw source, not as a bundled module.\n */\nexport function renderThemeHookSlotsScript(names: string[] = getRegisteredThemeHookSlots()) {\n if (!names.length) return null;\n const json = escapeForInlineScript(JSON.stringify(names));\n return (\n `(function(names){` +\n `var w=window;` +\n `function push(){` +\n `var h=w.salla&&w.salla.hooks;var slots=h&&h._themeSlots;` +\n `if(!Array.isArray(slots))return false;` +\n `for(var i=0;i<names.length;i++)if(slots.indexOf(names[i])<0)slots.push(names[i]);` +\n `return true}` +\n `if(push())return;` +\n `w.addEventListener('twilight::initiated',function(){push()},{once:true})` +\n `})(${json});`\n );\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { getActiveScope, api } from './chunk-G3NCSKQ3.js';
1
+ import { getActiveScope, api } from './chunk-U2UNWN4G.js';
2
2
  import { getTwilightContext } from './chunk-6K34BCUP.js';
3
3
  import { queryOptions } from '@tanstack/react-query';
4
4
 
@@ -25,5 +25,5 @@ var advertisement = {
25
25
  };
26
26
 
27
27
  export { advertisement, advertisementsFor };
28
- //# sourceMappingURL=chunk-3KTDODC5.js.map
29
- //# sourceMappingURL=chunk-3KTDODC5.js.map
28
+ //# sourceMappingURL=chunk-ETC7OJT5.js.map
29
+ //# sourceMappingURL=chunk-ETC7OJT5.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/api/advertisement.ts"],"names":[],"mappings":";;;;AAkBO,SAAS,iBAAA,CACd,KACA,QAAA,EACiB;AACjB,EAAA,OAAO,GAAA,CAAI,MAAA;AAAA,IACT,CAAC,EAAA,KACC,KAAA,CAAM,QAAQ,EAAA,CAAG,KAAK,MACrB,EAAA,CAAG,KAAA,CAAM,QAAA,CAAS,KAAK,KAAM,CAAC,CAAC,YAAY,EAAA,CAAG,KAAA,CAAM,SAAS,QAAQ,CAAA;AAAA,GAC1E;AACF;AAEO,IAAM,aAAA,GAAgB;AAAA;AAAA,EAE3B,MAAM,YAAsC;AAE1C,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,GAAA,CACpB,GAAA,CAAI,gBAAA,EAAkB,EAAE,OAAA,EAAS,GAAA,EAAM,CAAA,CACvC,IAAA,EAAiC;AACpC,IAAA,OAAO,KAAA,CAAM,OAAA,CAAQ,IAAI,CAAA,GAAI,OAAO,EAAC;AAAA,EACvC,CAAA;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,MACJ,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,gBAAA,EAAkB,kBAAA,EAAmB,CAAE,QAAQ,EAAE,KAAA,EAAO,cAAA,EAAe,EAAG,CAAA;AAAA,MACrF,OAAA,EAAS,MAAM,aAAA,CAAc,IAAA,EAAK;AAAA,MAClC,SAAA,EAAW,QAAA;AAAA;AAAA,MAEX,KAAA,EAAO;AAAA,KACR;AAAA;AAEP","file":"chunk-3KTDODC5.js","sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { api, getActiveScope } from './client';\nimport { getTwilightContext } from '../twilight/context';\n\n/** A merchant's announcement bar, as `GET advertisements` returns it. */\nexport interface Advertisement {\n id: number;\n title?: string;\n description?: string;\n icon?: string | null;\n url?: string | null;\n target?: string | null;\n colors?: { bg?: string; text?: string };\n /** Page slugs the ad shows on (`salla.config` `page.slug`), or `all`. */\n pages?: string[];\n}\n\n/** The ads a page shows: the rule the API applies to `?page=`, run on the full list. */\nexport function advertisementsFor(\n ads: readonly Advertisement[],\n pageSlug: string | null | undefined\n): Advertisement[] {\n return ads.filter(\n (ad) =>\n Array.isArray(ad.pages) &&\n (ad.pages.includes('all') || (!!pageSlug && ad.pages.includes(pageSlug)))\n );\n}\n\nexport const advertisement = {\n /** Every active ad, unfiltered: one request serves all pages, filtered with `advertisementsFor`. */\n list: async (): Promise<Advertisement[]> => {\n // Short timeout: it is fetched with the store settings on every server render.\n const { data } = await api\n .get('advertisements', { timeout: 3000 })\n .json<{ data?: Advertisement[] }>();\n return Array.isArray(data) ? data : [];\n },\n\n queries: {\n list: () =>\n queryOptions({\n queryKey: ['advertisements', getTwilightContext().locale, { scope: getActiveScope() }],\n queryFn: () => advertisement.list(),\n staleTime: Infinity,\n // Awaited in rootBeforeLoad: a retry would double the 3s budget. `PageAdvertisements` retries.\n retry: 0,\n }),\n },\n};\n"]}
1
+ {"version":3,"sources":["../src/api/advertisement.ts"],"names":[],"mappings":";;;;AAkBO,SAAS,iBAAA,CACd,KACA,QAAA,EACiB;AACjB,EAAA,OAAO,GAAA,CAAI,MAAA;AAAA,IACT,CAAC,EAAA,KACC,KAAA,CAAM,QAAQ,EAAA,CAAG,KAAK,MACrB,EAAA,CAAG,KAAA,CAAM,QAAA,CAAS,KAAK,KAAM,CAAC,CAAC,YAAY,EAAA,CAAG,KAAA,CAAM,SAAS,QAAQ,CAAA;AAAA,GAC1E;AACF;AAEO,IAAM,aAAA,GAAgB;AAAA;AAAA,EAE3B,MAAM,YAAsC;AAE1C,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,GAAA,CACpB,GAAA,CAAI,gBAAA,EAAkB,EAAE,OAAA,EAAS,GAAA,EAAM,CAAA,CACvC,IAAA,EAAiC;AACpC,IAAA,OAAO,KAAA,CAAM,OAAA,CAAQ,IAAI,CAAA,GAAI,OAAO,EAAC;AAAA,EACvC,CAAA;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,MACJ,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,gBAAA,EAAkB,kBAAA,EAAmB,CAAE,QAAQ,EAAE,KAAA,EAAO,cAAA,EAAe,EAAG,CAAA;AAAA,MACrF,OAAA,EAAS,MAAM,aAAA,CAAc,IAAA,EAAK;AAAA,MAClC,SAAA,EAAW,QAAA;AAAA;AAAA,MAEX,KAAA,EAAO;AAAA,KACR;AAAA;AAEP","file":"chunk-ETC7OJT5.js","sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { api, getActiveScope } from './client';\nimport { getTwilightContext } from '../twilight/context';\n\n/** A merchant's announcement bar, as `GET advertisements` returns it. */\nexport interface Advertisement {\n id: number;\n title?: string;\n description?: string;\n icon?: string | null;\n url?: string | null;\n target?: string | null;\n colors?: { bg?: string; text?: string };\n /** Page slugs the ad shows on (`salla.config` `page.slug`), or `all`. */\n pages?: string[];\n}\n\n/** The ads a page shows: the rule the API applies to `?page=`, run on the full list. */\nexport function advertisementsFor(\n ads: readonly Advertisement[],\n pageSlug: string | null | undefined\n): Advertisement[] {\n return ads.filter(\n (ad) =>\n Array.isArray(ad.pages) &&\n (ad.pages.includes('all') || (!!pageSlug && ad.pages.includes(pageSlug)))\n );\n}\n\nexport const advertisement = {\n /** Every active ad, unfiltered: one request serves all pages, filtered with `advertisementsFor`. */\n list: async (): Promise<Advertisement[]> => {\n // Short timeout: it is fetched with the store settings on every server render.\n const { data } = await api\n .get('advertisements', { timeout: 3000 })\n .json<{ data?: Advertisement[] }>();\n return Array.isArray(data) ? data : [];\n },\n\n queries: {\n list: () =>\n queryOptions({\n queryKey: ['advertisements', getTwilightContext().locale, { scope: getActiveScope() }],\n queryFn: () => advertisement.list(),\n staleTime: Infinity,\n // Awaited in rootBeforeLoad: a retry would double the 3s budget. `PageAdvertisements` retries.\n retry: 0,\n }),\n },\n};\n"]}
@@ -1,4 +1,4 @@
1
- import { filesCdn, cdn } from './chunk-G3NCSKQ3.js';
1
+ import { filesCdn, cdn } from './chunk-U2UNWN4G.js';
2
2
  import { storeTranslationsQueryKey, translationsQueryKey, composeMessages, isPlainObject } from './chunk-6K34BCUP.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-PYUTATUY.js.map
130
- //# sourceMappingURL=chunk-PYUTATUY.js.map
129
+ //# sourceMappingURL=chunk-FPGR63AQ.js.map
130
+ //# sourceMappingURL=chunk-FPGR63AQ.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;AACxD,IAAA,OAAO,IAAA;AA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ClC,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-PYUTATUY.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,CAAA,CAAE,CAAA;AAA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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-FPGR63AQ.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,25 +1,25 @@
1
1
  import { getModelContext } from './chunk-Q77J3D2W.js';
2
- import { Header } from './chunk-W6KPVZZR.js';
3
- import { Footer } from './chunk-C6WYORKW.js';
4
- import { resolveTwilightSdkUrl, TICKETING_SCRIPT_URL, setSnippetPageTargets } from './chunk-N6ZE6HUX.js';
2
+ import { Header } from './chunk-U5TWRPMK.js';
3
+ import { Footer } from './chunk-YYVZFOUI.js';
4
+ import { resolveTwilightSdkUrl, TICKETING_SCRIPT_URL, setSnippetPageTargets } from './chunk-5V4W3GBI.js';
5
5
  import { editorFrame, previewTheme, postToEditor, FRAME_LOADED_ACTION } from './chunk-YL6X3ZMG.js';
6
- import { useDevSettingsOverrides, useDevReportSettingsFetchedAt } from './chunk-AD4QPYNG.js';
7
- import { apps } from './chunk-7IQFONJR.js';
6
+ import { useDevSettingsOverrides, useDevReportSettingsFetchedAt } from './chunk-PCB5DCS4.js';
7
+ import { apps } from './chunk-NGWHUW34.js';
8
8
  import { color } from './chunk-VVZNW5CB.js';
9
- import { applyThemeHookSlots, installAppScope } from './chunk-WQPG22DY.js';
10
- import { withOwnerMaintenanceButton, withoutMaintenanceOnPreviewHost } from './chunk-Q7E4TNN7.js';
11
- import { useLocation, useIsHome, NavigationInterceptor } from './chunk-2ZR562TA.js';
12
- import { useUser } from './chunk-IVZNTLAA.js';
9
+ import { applyThemeHookSlots, installAppScope } from './chunk-EGI7F57E.js';
10
+ import { withOwnerMaintenanceButton, withoutMaintenanceOnPreviewHost } from './chunk-SLBO4SEE.js';
11
+ import { useLocation, useIsHome, NavigationInterceptor } from './chunk-HRW4YFHR.js';
12
+ import { useUser } from './chunk-XV3HPKLI.js';
13
13
  import { DocumentClassProvider, useDocumentClass } from './chunk-JWXJPJBO.js';
14
14
  import { WidgetHead } from './chunk-V2ZDTY6H.js';
15
15
  import { HookSlot } from './chunk-5XDPAKF5.js';
16
16
  import { hookRegistry } from './chunk-GCPEMNSU.js';
17
- import { getActiveCurrency, ENGINE_VERSION } from './chunk-G3NCSKQ3.js';
17
+ import { getActiveCurrency, ENGINE_VERSION } from './chunk-U2UNWN4G.js';
18
18
  import { useTranslation, I18nProvider } from './chunk-TYNZ5B2B.js';
19
- import { Toaster } from './chunk-MWYKP7CI.js';
20
- import { isNativeApp } from './chunk-3E3ABCPC.js';
21
- import { whenSallaLoaded, whenSallaReady, onSallaEvent, getSallaSDK, syncSdkLocale, withSdkThemeVersion } from './chunk-NHA4SBKG.js';
22
- import { AUTH_TOKEN_COOKIE_NAME, rememberDevStoreId, clearAuthTokenCookie, currentHost, syncScopeCookie, escapeForInlineScript } from './chunk-FXVII733.js';
19
+ import { Toaster } from './chunk-QMWP2ZP6.js';
20
+ import { isNativeApp } from './chunk-6TFM3UTF.js';
21
+ import { whenSallaLoaded, whenSallaReady, onSallaEvent, getSallaSDK, syncSdkLocale, withSdkThemeVersion } from './chunk-XMRNYUQY.js';
22
+ import { AUTH_TOKEN_COOKIE_NAME, rememberDevStoreId, clearAuthTokenCookie, currentHost, syncScopeCookie, escapeForInlineScript } from './chunk-T2752RH7.js';
23
23
  import { getTwilightContext, subscribeTwilight, updateTwilightContext, hasTwilightSettings } from './chunk-6K34BCUP.js';
24
24
  import { FALLBACK_LOCALE, getLanguageInfo } from './chunk-T72DAX7R.js';
25
25
  import { useTwilight, TwilightContext } from './chunk-DF6FBKDN.js';
@@ -352,16 +352,16 @@ function useWebMcpSupported() {
352
352
  }
353
353
  var navigationSetups = {
354
354
  tanstack: lazyComponent(
355
- () => import('./navigation-HWFEKUG6.js').then((m) => ({ default: m.NavigationSetup }))
355
+ () => import('./navigation-C5K5SOU2.js').then((m) => ({ default: m.NavigationSetup }))
356
356
  ),
357
357
  // Not preloaded with the rest: a TanStack worker would load Next.js code it never runs.
358
- nextjs: lazy(() => import('./navigation-E75N4EU3.js').then((m) => ({ default: m.NavigationSetup })))
358
+ nextjs: lazy(() => import('./navigation-VW5P7XQM.js').then((m) => ({ default: m.NavigationSetup })))
359
359
  };
360
360
 
361
361
  // src/providers/DocumentSyncRegistry.ts
362
362
  var routeDocumentSyncs = {
363
363
  tanstack: lazyComponent(
364
- () => import('./document-class-TRLFCQHJ.js').then((m) => ({
364
+ () => import('./document-class-VHDNGZQK.js').then((m) => ({
365
365
  default: m.TanStackDocumentSync
366
366
  }))
367
367
  )
@@ -883,7 +883,7 @@ var LazySiftSnippet = lazyComponent(
883
883
  () => import('./SiftSnippet-5FCU6TR6.js').then((m) => ({ default: m.SiftSnippet }))
884
884
  );
885
885
  var LazyStoreClosedNotification = lazyComponent(
886
- () => import('./StoreClosedNotification-62SFSGRH.js').then((m) => ({
886
+ () => import('./StoreClosedNotification-5DOQFF2O.js').then((m) => ({
887
887
  default: m.StoreClosedNotification
888
888
  }))
889
889
  );
@@ -1130,7 +1130,7 @@ function SallaSdkScripts({ settings }) {
1130
1130
 
1131
1131
  // src/components/store/lazy.ts
1132
1132
  var LazyStoreClosedNotification2 = lazyComponent(
1133
- () => import('./StoreClosedNotification-62SFSGRH.js').then((m) => ({
1133
+ () => import('./StoreClosedNotification-5DOQFF2O.js').then((m) => ({
1134
1134
  default: m.StoreClosedNotification
1135
1135
  }))
1136
1136
  );
@@ -1200,7 +1200,7 @@ function LiveEditor() {
1200
1200
  if (!frame) return null;
1201
1201
  return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyLiveEditorBar, { origin: frame.origin, dev: frame.dev }) });
1202
1202
  }
1203
- var LazyWebMcpTools = React2.lazy(() => import('./WebMcpTools-VA2A62E3.js'));
1203
+ var LazyWebMcpTools = React2.lazy(() => import('./WebMcpTools-3TBLKZL5.js'));
1204
1204
  var getSalla2 = () => typeof window !== "undefined" ? window.salla : void 0;
1205
1205
  var TWILIGHT_LOG_STYLES = {
1206
1206
  header: "background: linear-gradient(90deg, #7c3aed, #6366f1); color: white; padding: 4px 8px; border-radius: 4px; font-weight: bold;",
@@ -1489,5 +1489,5 @@ function useStore() {
1489
1489
  }
1490
1490
 
1491
1491
  export { LazyMaintenancePage, LazyStoreClosedNotification2 as LazyStoreClosedNotification, MasterLayout, TwilightProvider, fastCheckoutScript, registerDefaultHooks, registerDocumentSync, routeDocumentSyncs, useBreadcrumbs, useDate, useGtm, useMoney, useNumber, useOpeningHours, usePageConfig, useStore };
1492
- //# sourceMappingURL=chunk-AXTVBTO4.js.map
1493
- //# sourceMappingURL=chunk-AXTVBTO4.js.map
1492
+ //# sourceMappingURL=chunk-GBMMP344.js.map
1493
+ //# sourceMappingURL=chunk-GBMMP344.js.map