@salla.sa/twilight-theme-engine 1.0.104 → 1.0.105
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.
- package/dist/{AddToCartForm-ZJT6JJHQ.js → AddToCartForm-LWSRJJSF.js} +3 -3
- package/dist/{AddToCartForm-ZJT6JJHQ.js.map → AddToCartForm-LWSRJJSF.js.map} +1 -1
- package/dist/{BlogAuthorPage-KCV5TAWN.js → BlogAuthorPage-E2BONAKB.js} +27 -27
- package/dist/{BlogAuthorPage-KCV5TAWN.js.map → BlogAuthorPage-E2BONAKB.js.map} +1 -1
- package/dist/{BlogCategoryPage-DNDZ76UW.js → BlogCategoryPage-F5G35XQE.js} +27 -27
- package/dist/{BlogCategoryPage-DNDZ76UW.js.map → BlogCategoryPage-F5G35XQE.js.map} +1 -1
- package/dist/{BlogPage-STXNCRQP.js → BlogPage-W4NDWE5Q.js} +25 -25
- package/dist/{BlogPage-STXNCRQP.js.map → BlogPage-W4NDWE5Q.js.map} +1 -1
- package/dist/{BlogSinglePage-JJWYKJHP.js → BlogSinglePage-543VMKSI.js} +25 -25
- package/dist/{BlogSinglePage-JJWYKJHP.js.map → BlogSinglePage-543VMKSI.js.map} +1 -1
- package/dist/{BlogTagPage-ZE2XOPK4.js → BlogTagPage-KDQVHQ65.js} +27 -27
- package/dist/{BlogTagPage-ZE2XOPK4.js.map → BlogTagPage-KDQVHQ65.js.map} +1 -1
- package/dist/{BrandsPage-BDJ3JRDD.js → BrandsPage-ABKUKE5J.js} +26 -26
- package/dist/{BrandsPage-BDJ3JRDD.js.map → BrandsPage-ABKUKE5J.js.map} +1 -1
- package/dist/{Breadcrumb-OK37EG4K.js → Breadcrumb-WBTLVXYF.js} +25 -25
- package/dist/{Breadcrumb-OK37EG4K.js.map → Breadcrumb-WBTLVXYF.js.map} +1 -1
- package/dist/{CartItem-N4B3L2QT.js → CartItem-KNFR7K7Z.js} +25 -25
- package/dist/{CartItem-N4B3L2QT.js.map → CartItem-KNFR7K7Z.js.map} +1 -1
- package/dist/{CartSummary-27VDB6CC.js → CartSummary-EQ4GTR4Y.js} +25 -25
- package/dist/{CartSummary-27VDB6CC.js.map → CartSummary-EQ4GTR4Y.js.map} +1 -1
- package/dist/{Copyright-UOOJCPCK.js → Copyright-NYKF6LY5.js} +3 -3
- package/dist/{Copyright-UOOJCPCK.js.map → Copyright-NYKF6LY5.js.map} +1 -1
- package/dist/{CustomerLayout-2TU63GI2.js → CustomerLayout-NY4LOV3Y.js} +25 -25
- package/dist/{CustomerLayout-2TU63GI2.js.map → CustomerLayout-NY4LOV3Y.js.map} +1 -1
- package/dist/{Footer-QJHB3FO7.js → Footer-DRKA2MI6.js} +4 -4
- package/dist/{Footer-QJHB3FO7.js.map → Footer-DRKA2MI6.js.map} +1 -1
- package/dist/Header-JBZRD2WU.js +22 -0
- package/dist/{Header-2GMIMJ2A.js.map → Header-JBZRD2WU.js.map} +1 -1
- package/dist/{LoyaltyPage-H2FY4IBM.js → LoyaltyPage-VOAUC2CY.js} +25 -25
- package/dist/{LoyaltyPage-H2FY4IBM.js.map → LoyaltyPage-VOAUC2CY.js.map} +1 -1
- package/dist/{LoyaltyPointsPage-FVXJNJKL.js → LoyaltyPointsPage-I5U5NFK3.js} +9 -9
- package/dist/{LoyaltyPointsPage-FVXJNJKL.js.map → LoyaltyPointsPage-I5U5NFK3.js.map} +1 -1
- package/dist/{MainMenu-COKDB5AQ.js → MainMenu-SWP46RPJ.js} +8 -8
- package/dist/{MainMenu-COKDB5AQ.js.map → MainMenu-SWP46RPJ.js.map} +1 -1
- package/dist/MaintenancePage-MGWJYB2O.js +7 -0
- package/dist/MaintenancePage-MGWJYB2O.js.map +1 -0
- package/dist/{MasterLayout-4N7LOXPC.js → MasterLayout-BF2E47SE.js} +25 -25
- package/dist/{MasterLayout-4N7LOXPC.js.map → MasterLayout-BF2E47SE.js.map} +1 -1
- package/dist/{MobileMenu-ELEUZZKM.js → MobileMenu-LBOVOA6D.js} +26 -26
- package/dist/{MobileMenu-ELEUZZKM.js.map → MobileMenu-LBOVOA6D.js.map} +1 -1
- package/dist/{NotificationsPage-DWUGY2XG.js → NotificationsPage-FNFKEOX3.js} +25 -25
- package/dist/{NotificationsPage-DWUGY2XG.js.map → NotificationsPage-FNFKEOX3.js.map} +1 -1
- package/dist/{OrderSinglePage-WR3L5PLV.js → OrderSinglePage-EGCPZ25S.js} +26 -26
- package/dist/{OrderSinglePage-WR3L5PLV.js.map → OrderSinglePage-EGCPZ25S.js.map} +1 -1
- package/dist/{OrdersPage-XQ2D5ES5.js → OrdersPage-DOK3AE37.js} +25 -25
- package/dist/{OrdersPage-XQ2D5ES5.js.map → OrdersPage-DOK3AE37.js.map} +1 -1
- package/dist/{PageSingle-VU46ZY7F.js → PageSingle-4NYB7VCI.js} +7 -7
- package/dist/{PageSingle-VU46ZY7F.js.map → PageSingle-4NYB7VCI.js.map} +1 -1
- package/dist/{ProductDetails-YYWUUS26.js → ProductDetails-EJ6WKSLO.js} +8 -8
- package/dist/{ProductDetails-YYWUUS26.js.map → ProductDetails-EJ6WKSLO.js.map} +1 -1
- package/dist/{ProfilePage-LHB2RELA.js → ProfilePage-RQJNJFAV.js} +25 -25
- package/dist/{ProfilePage-LHB2RELA.js.map → ProfilePage-RQJNJFAV.js.map} +1 -1
- package/dist/{ReviewsPage-5TSLYA2V.js → ReviewsPage-SSVTW76R.js} +3 -3
- package/dist/{ReviewsPage-5TSLYA2V.js.map → ReviewsPage-SSVTW76R.js.map} +1 -1
- package/dist/{SeoCartWidget-DATW77M6.js → SeoCartWidget-I3T6MEYN.js} +25 -25
- package/dist/{SeoCartWidget-DATW77M6.js.map → SeoCartWidget-I3T6MEYN.js.map} +1 -1
- package/dist/{SettingsPage-MDQWPGD7.js → SettingsPage-F2PHWF6M.js} +25 -25
- package/dist/{SettingsPage-MDQWPGD7.js.map → SettingsPage-F2PHWF6M.js.map} +1 -1
- package/dist/StoreClosedNotification-A55JL5ZF.js +54 -0
- package/dist/{StoreClosedNotification-FJS7YUCR.js.map → StoreClosedNotification-A55JL5ZF.js.map} +1 -1
- package/dist/{TestimonialsPage-2RNRU4QT.js → TestimonialsPage-P3NQ4MD6.js} +7 -7
- package/dist/{TestimonialsPage-2RNRU4QT.js.map → TestimonialsPage-P3NQ4MD6.js.map} +1 -1
- package/dist/{ThankYouPage-OZKNDH4H.js → ThankYouPage-NGQHYJV5.js} +25 -25
- package/dist/{ThankYouPage-OZKNDH4H.js.map → ThankYouPage-NGQHYJV5.js.map} +1 -1
- package/dist/{WalletPage-BSEA7PKK.js → WalletPage-QKMWV2NA.js} +26 -26
- package/dist/{WalletPage-BSEA7PKK.js.map → WalletPage-QKMWV2NA.js.map} +1 -1
- package/dist/{WishlistPage-QEB7EFDE.js → WishlistPage-HOR22EBU.js} +27 -27
- package/dist/{WishlistPage-QEB7EFDE.js.map → WishlistPage-HOR22EBU.js.map} +1 -1
- package/dist/api/advertisement.js +5 -5
- package/dist/api/apps.js +5 -5
- package/dist/api/blog.js +7 -7
- package/dist/api/brands.js +7 -7
- package/dist/api/cart.js +7 -7
- package/dist/api/category.js +7 -7
- package/dist/api/client.js +4 -4
- package/dist/api/home.js +5 -5
- package/dist/api/loyalty.js +7 -7
- package/dist/api/menu.js +5 -5
- package/dist/api/notification.js +5 -5
- package/dist/api/order.js +7 -7
- package/dist/api/page.js +7 -7
- package/dist/api/product.js +7 -7
- package/dist/api/profile.js +4 -4
- package/dist/api/store.d.ts +9 -1
- package/dist/api/store.d.ts.map +1 -1
- package/dist/api/store.js +5 -5
- package/dist/api/translations.js +5 -5
- package/dist/api/user.js +5 -5
- package/dist/api/wallet.js +5 -5
- package/dist/api/wishlist.js +8 -8
- package/dist/{chunk-PXHFHHTW.js → chunk-25SLMOCZ.js} +4 -4
- package/dist/{chunk-PXHFHHTW.js.map → chunk-25SLMOCZ.js.map} +1 -1
- package/dist/{chunk-5ISYMZ62.js → chunk-2IS4QU3P.js} +4 -4
- package/dist/{chunk-5ISYMZ62.js.map → chunk-2IS4QU3P.js.map} +1 -1
- package/dist/{chunk-OOCN4RFV.js → chunk-3EBV4X6W.js} +3 -3
- package/dist/{chunk-OOCN4RFV.js.map → chunk-3EBV4X6W.js.map} +1 -1
- package/dist/chunk-3PSJH6Q4.js +108 -0
- package/dist/chunk-3PSJH6Q4.js.map +1 -0
- package/dist/{chunk-OSTGSFJW.js → chunk-42RKFHJG.js} +74 -18
- package/dist/chunk-42RKFHJG.js.map +1 -0
- package/dist/{chunk-HKSDEFQV.js → chunk-42YMCOK4.js} +3 -3
- package/dist/{chunk-HKSDEFQV.js.map → chunk-42YMCOK4.js.map} +1 -1
- package/dist/{chunk-JUUKZRE5.js → chunk-4O52OV5N.js} +3 -3
- package/dist/{chunk-JUUKZRE5.js.map → chunk-4O52OV5N.js.map} +1 -1
- package/dist/{chunk-JDLXT6VI.js → chunk-5DWTU5KS.js} +7 -5
- package/dist/chunk-5DWTU5KS.js.map +1 -0
- package/dist/{chunk-PLGCIXHX.js → chunk-5L6IBYWZ.js} +4 -4
- package/dist/{chunk-PLGCIXHX.js.map → chunk-5L6IBYWZ.js.map} +1 -1
- package/dist/{chunk-AVYPAASH.js → chunk-6SXIAFXW.js} +7 -7
- package/dist/{chunk-AVYPAASH.js.map → chunk-6SXIAFXW.js.map} +1 -1
- package/dist/{chunk-46JZXQRS.js → chunk-76GCBYJX.js} +3 -3
- package/dist/{chunk-46JZXQRS.js.map → chunk-76GCBYJX.js.map} +1 -1
- package/dist/{chunk-IATZL5LC.js → chunk-BHNY4T4O.js} +8 -8
- package/dist/{chunk-IATZL5LC.js.map → chunk-BHNY4T4O.js.map} +1 -1
- package/dist/{chunk-XMO7HDZZ.js → chunk-C5MQ6VWX.js} +3 -3
- package/dist/{chunk-XMO7HDZZ.js.map → chunk-C5MQ6VWX.js.map} +1 -1
- package/dist/{chunk-GWW2YPJ3.js → chunk-CTV5GA2U.js} +4 -4
- package/dist/{chunk-GWW2YPJ3.js.map → chunk-CTV5GA2U.js.map} +1 -1
- package/dist/{chunk-JZDJO2CK.js → chunk-D2VMJV3L.js} +10 -8
- package/dist/chunk-D2VMJV3L.js.map +1 -0
- package/dist/{chunk-QQRU2L23.js → chunk-D6IJYZ7U.js} +7 -7
- package/dist/{chunk-QQRU2L23.js.map → chunk-D6IJYZ7U.js.map} +1 -1
- package/dist/{chunk-7YH3A5BT.js → chunk-DMMGD4GW.js} +5 -5
- package/dist/{chunk-7YH3A5BT.js.map → chunk-DMMGD4GW.js.map} +1 -1
- package/dist/{chunk-HIAHDZI5.js → chunk-FQHNVD3H.js} +3 -3
- package/dist/{chunk-HIAHDZI5.js.map → chunk-FQHNVD3H.js.map} +1 -1
- package/dist/{chunk-H3PJJKAQ.js → chunk-HG4B4F4N.js} +8 -3
- package/dist/chunk-HG4B4F4N.js.map +1 -0
- package/dist/{chunk-6EBVVCNI.js → chunk-HGKAIIAJ.js} +4 -4
- package/dist/{chunk-6EBVVCNI.js.map → chunk-HGKAIIAJ.js.map} +1 -1
- package/dist/{chunk-ZP7H4W2B.js → chunk-HGY7P2Y3.js} +5 -5
- package/dist/{chunk-ZP7H4W2B.js.map → chunk-HGY7P2Y3.js.map} +1 -1
- package/dist/{chunk-5A6QUNZ5.js → chunk-JP5XQJKO.js} +4 -4
- package/dist/{chunk-5A6QUNZ5.js.map → chunk-JP5XQJKO.js.map} +1 -1
- package/dist/{chunk-ZPX4LBQZ.js → chunk-KTLQV4Q4.js} +5 -5
- package/dist/{chunk-ZPX4LBQZ.js.map → chunk-KTLQV4Q4.js.map} +1 -1
- package/dist/{chunk-3W746XYR.js → chunk-LBBPJM4K.js} +5 -5
- package/dist/{chunk-3W746XYR.js.map → chunk-LBBPJM4K.js.map} +1 -1
- package/dist/{chunk-XLCLZIWF.js → chunk-LPAWMUJR.js} +4 -4
- package/dist/{chunk-XLCLZIWF.js.map → chunk-LPAWMUJR.js.map} +1 -1
- package/dist/{chunk-E2GBYIGH.js → chunk-MHDOK7GH.js} +4 -4
- package/dist/{chunk-E2GBYIGH.js.map → chunk-MHDOK7GH.js.map} +1 -1
- package/dist/{chunk-UY57T42N.js → chunk-MSNU4NYS.js} +3 -3
- package/dist/{chunk-UY57T42N.js.map → chunk-MSNU4NYS.js.map} +1 -1
- package/dist/{chunk-VEWF3NFM.js → chunk-OWJMPD7X.js} +3 -3
- package/dist/{chunk-VEWF3NFM.js.map → chunk-OWJMPD7X.js.map} +1 -1
- package/dist/{chunk-YBEZB5WO.js → chunk-P7N3TZFE.js} +46 -24
- package/dist/chunk-P7N3TZFE.js.map +1 -0
- package/dist/{chunk-2JQUBER5.js → chunk-PLW6MTSL.js} +8 -8
- package/dist/{chunk-2JQUBER5.js.map → chunk-PLW6MTSL.js.map} +1 -1
- package/dist/{chunk-EM46TNHW.js → chunk-PSBXF3O5.js} +4 -4
- package/dist/{chunk-EM46TNHW.js.map → chunk-PSBXF3O5.js.map} +1 -1
- package/dist/{chunk-J6T5YOUW.js → chunk-PXM3FBPO.js} +3 -3
- package/dist/{chunk-J6T5YOUW.js.map → chunk-PXM3FBPO.js.map} +1 -1
- package/dist/{chunk-VPGOT3JO.js → chunk-QUBQPGT7.js} +3 -3
- package/dist/{chunk-VPGOT3JO.js.map → chunk-QUBQPGT7.js.map} +1 -1
- package/dist/{chunk-6TWQZEPF.js → chunk-QXX54X55.js} +4 -4
- package/dist/{chunk-6TWQZEPF.js.map → chunk-QXX54X55.js.map} +1 -1
- package/dist/{chunk-WCCZYPYM.js → chunk-RSWRKU4X.js} +4 -4
- package/dist/{chunk-WCCZYPYM.js.map → chunk-RSWRKU4X.js.map} +1 -1
- package/dist/{chunk-P4XV656A.js → chunk-S6SP272Z.js} +5 -4
- package/dist/chunk-S6SP272Z.js.map +1 -0
- package/dist/{chunk-556Q5ATS.js → chunk-SDEBSX6Z.js} +4 -4
- package/dist/{chunk-556Q5ATS.js.map → chunk-SDEBSX6Z.js.map} +1 -1
- package/dist/{chunk-C7RM335V.js → chunk-STKR2KHL.js} +3 -3
- package/dist/{chunk-C7RM335V.js.map → chunk-STKR2KHL.js.map} +1 -1
- package/dist/{chunk-GNLCPK6N.js → chunk-SU7NHAYA.js} +3 -3
- package/dist/{chunk-GNLCPK6N.js.map → chunk-SU7NHAYA.js.map} +1 -1
- package/dist/chunk-TCTKM34I.js +14 -0
- package/dist/{chunk-PJVQMZHM.js.map → chunk-TCTKM34I.js.map} +1 -1
- package/dist/{chunk-PENQTLAN.js → chunk-TWD4ECS3.js} +3 -3
- package/dist/{chunk-PENQTLAN.js.map → chunk-TWD4ECS3.js.map} +1 -1
- package/dist/{chunk-BCADAQXY.js → chunk-TYTYD6AK.js} +3 -3
- package/dist/{chunk-BCADAQXY.js.map → chunk-TYTYD6AK.js.map} +1 -1
- package/dist/{chunk-YXI2ZCXD.js → chunk-U3UY2BDN.js} +4 -4
- package/dist/{chunk-YXI2ZCXD.js.map → chunk-U3UY2BDN.js.map} +1 -1
- package/dist/{chunk-OXA277JH.js → chunk-UWDS42UX.js} +4 -4
- package/dist/{chunk-OXA277JH.js.map → chunk-UWDS42UX.js.map} +1 -1
- package/dist/{chunk-K4ON2CI7.js → chunk-V7QFIGQ4.js} +6 -6
- package/dist/{chunk-K4ON2CI7.js.map → chunk-V7QFIGQ4.js.map} +1 -1
- package/dist/{chunk-6YWW5Y22.js → chunk-VEA7QDNY.js} +3 -3
- package/dist/{chunk-6YWW5Y22.js.map → chunk-VEA7QDNY.js.map} +1 -1
- package/dist/{chunk-W23NEGCL.js → chunk-VJQ7SM4O.js} +5 -5
- package/dist/{chunk-W23NEGCL.js.map → chunk-VJQ7SM4O.js.map} +1 -1
- package/dist/{chunk-A75QNVGV.js → chunk-XD33WKKI.js} +7 -7
- package/dist/{chunk-A75QNVGV.js.map → chunk-XD33WKKI.js.map} +1 -1
- package/dist/{chunk-FNZ4MEUH.js → chunk-YMHL73TL.js} +6 -6
- package/dist/{chunk-FNZ4MEUH.js.map → chunk-YMHL73TL.js.map} +1 -1
- package/dist/{chunk-ZMCFSOYF.js → chunk-YSRKR5DE.js} +4 -4
- package/dist/{chunk-ZMCFSOYF.js.map → chunk-YSRKR5DE.js.map} +1 -1
- package/dist/{chunk-NTK25X6V.js → chunk-YXCJBX6X.js} +8 -8
- package/dist/{chunk-NTK25X6V.js.map → chunk-YXCJBX6X.js.map} +1 -1
- package/dist/{chunk-I3DKJNUZ.js → chunk-ZE262XHY.js} +4 -4
- package/dist/{chunk-I3DKJNUZ.js.map → chunk-ZE262XHY.js.map} +1 -1
- package/dist/components/cart/index.js +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/drawer/index.js +23 -23
- package/dist/components/home/index.js +27 -27
- package/dist/components/layout/index.js +7 -7
- package/dist/components/product/index.js +24 -24
- package/dist/components/store/MaintenancePage.d.ts +8 -0
- package/dist/components/store/MaintenancePage.d.ts.map +1 -0
- package/dist/components/store/index.d.ts +2 -1
- package/dist/components/store/index.d.ts.map +1 -1
- package/dist/components/store/index.js +25 -33
- package/dist/components/store/index.js.map +1 -1
- package/dist/components/store/lazy.d.ts +2 -0
- package/dist/components/store/lazy.d.ts.map +1 -1
- package/dist/components/toast/index.js +5 -5
- package/dist/dev/editor/index.js +3 -3
- package/dist/dev/index.js +3 -3
- package/dist/document-class-AQ7FGLPE.js +29 -0
- package/dist/{document-class-OWGWP7TU.js.map → document-class-AQ7FGLPE.js.map} +1 -1
- package/dist/hooks/index.js +23 -23
- package/dist/hooks/useComments.js +4 -4
- package/dist/hooks/useGtm.js +23 -23
- package/dist/hooks/useMoney.js +23 -23
- package/dist/hooks/useProduct.js +4 -4
- package/dist/hooks/useStore.js +23 -23
- package/dist/hooks/useUser.js +6 -6
- package/dist/hooks/useWishlist.js +4 -4
- package/dist/index.js +23 -23
- package/dist/native-app/index.js +4 -4
- package/dist/{navigation-4ASVNTMT.js → navigation-6MDIVFMB.js} +8 -8
- package/dist/{navigation-4ASVNTMT.js.map → navigation-6MDIVFMB.js.map} +1 -1
- package/dist/navigation-P3RDLBP7.js +14 -0
- package/dist/{navigation-BTWSY7VI.js.map → navigation-P3RDLBP7.js.map} +1 -1
- package/dist/{not-found-EFNMP37O.js → not-found-RBWKACRW.js} +26 -26
- package/dist/{not-found-EFNMP37O.js.map → not-found-RBWKACRW.js.map} +1 -1
- package/dist/providers/TwilightProvider.d.ts +1 -1
- package/dist/providers/TwilightProvider.d.ts.map +1 -1
- package/dist/providers/index.js +23 -23
- package/dist/routes/account/orders.js +8 -8
- package/dist/routes/account.js +17 -17
- package/dist/routes/blog.js +12 -12
- package/dist/routes/brands.js +8 -8
- package/dist/routes/cart.js +31 -31
- package/dist/routes/home.js +28 -28
- package/dist/routes/index.js +7 -7
- package/dist/routes/loyalty.js +9 -9
- package/dist/routes/page.js +8 -8
- package/dist/routes/product-listing.js +29 -29
- package/dist/routes/product.js +27 -27
- package/dist/routes/root/beforeLoad.d.ts +13 -0
- package/dist/routes/root/beforeLoad.d.ts.map +1 -1
- package/dist/routes/seo-redirects.js +7 -7
- package/dist/routes/testimonials.js +3 -3
- package/dist/routes/thank-you.js +8 -8
- package/dist/skeleton.js +28 -28
- package/dist/{store-lookup-4ZBTHRZA.js → store-lookup-7SAEE4L3.js} +12 -12
- package/dist/{store-lookup-4ZBTHRZA.js.map → store-lookup-7SAEE4L3.js.map} +1 -1
- package/dist/tanstack/middleware/twilight.d.ts +12 -0
- package/dist/tanstack/middleware/twilight.d.ts.map +1 -1
- package/dist/tanstack/router.d.ts.map +1 -1
- package/dist/tanstack.js +34 -21
- package/dist/tanstack.js.map +1 -1
- package/dist/twilight/context.d.ts +5 -0
- package/dist/twilight/context.d.ts.map +1 -1
- package/dist/twilight/ensure-context.d.ts.map +1 -1
- package/dist/types/index.d.ts +19 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/twilight.d.ts +8 -0
- package/dist/types/twilight.d.ts.map +1 -1
- package/dist/utils/index.js +6 -6
- package/dist/utils/maintenance.d.ts +31 -0
- package/dist/utils/maintenance.d.ts.map +1 -0
- package/dist/vite/index.js +3 -3
- package/package.json +1 -1
- package/tailwind/components/store/MaintenancePage.tsx.txt +156 -0
- package/tailwind/components/store/index.ts.txt +4 -1
- package/tailwind/components/store/lazy.ts.txt +5 -0
- package/tailwind/routes/root/beforeLoad.ts.txt +54 -0
- package/tailwind/routes/root/head.ts.txt +6 -2
- package/dist/Header-2GMIMJ2A.js +0 -22
- package/dist/StoreClosedNotification-FJS7YUCR.js +0 -54
- package/dist/chunk-H3PJJKAQ.js.map +0 -1
- package/dist/chunk-JDLXT6VI.js.map +0 -1
- package/dist/chunk-JZDJO2CK.js.map +0 -1
- package/dist/chunk-OSTGSFJW.js.map +0 -1
- package/dist/chunk-P4XV656A.js.map +0 -1
- package/dist/chunk-PJVQMZHM.js +0 -14
- package/dist/chunk-YBEZB5WO.js.map +0 -1
- package/dist/document-class-OWGWP7TU.js +0 -29
- package/dist/navigation-BTWSY7VI.js +0 -14
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { getTwilightContext } from '../../twilight/context';
|
|
2
|
+
import { useTranslation } from '../../providers/I18nProvider';
|
|
3
|
+
import type { Store, StoreSocial } from '../../types';
|
|
4
|
+
|
|
5
|
+
const THUMB_URL = 'https://cdn.assets.salla.network/prod/stores/images/construction-01.png';
|
|
6
|
+
|
|
7
|
+
/** Social networks the page links to, in the old page's order, with their Salla icon class. */
|
|
8
|
+
const SOCIAL_ICONS: [keyof StoreSocial, string][] = [
|
|
9
|
+
['twitter', 'sicon-x'],
|
|
10
|
+
['snapchat', 'sicon-snapchat'],
|
|
11
|
+
['youtube', 'sicon-youtube'],
|
|
12
|
+
['tiktok', 'sicon-tiktok'],
|
|
13
|
+
['facebook', 'sicon-facebook'],
|
|
14
|
+
['instagram', 'sicon-instagram'],
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
// The platform's maintenance page (Store `pages/maintenance.blade.php` + `_maintenance.scss`),
|
|
18
|
+
// trimmed to what it renders: greyscale, logo + title beside the message, contacts under a
|
|
19
|
+
// rule, the illustration alongside; stacked and centred under 1024px.
|
|
20
|
+
const STYLE = `
|
|
21
|
+
.s-maintenance{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;min-height:100vh;color:#a3a3a3;background:#fff;filter:grayscale(100%);box-sizing:border-box}
|
|
22
|
+
.s-maintenance *{box-sizing:border-box}
|
|
23
|
+
.s-maintenance .mt-container{width:100%;max-width:1200px;padding:0 15px}
|
|
24
|
+
.s-maintenance .mt-panel{display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%}
|
|
25
|
+
.s-maintenance .mt-message{width:100%;padding-inline-start:80px;animation:revealMtBlock 1.5s forwards}
|
|
26
|
+
.s-maintenance .mt-title{display:flex;align-items:center;margin:0 0 20px}
|
|
27
|
+
.s-maintenance .mt-logo{display:block;flex-shrink:0;width:80px;height:80px;margin-inline-end:20px;border-radius:50%;overflow:hidden;box-shadow:0 0 5px rgb(0 0 0 / 10%)}
|
|
28
|
+
.s-maintenance .mt-logo img{display:block;width:100%;height:100%;object-fit:cover}
|
|
29
|
+
.s-maintenance .mt-title h1{font-size:2.25rem;line-height:1;margin:0;color:#666}
|
|
30
|
+
.s-maintenance .mt-content p{margin:0;white-space:pre-line}
|
|
31
|
+
.s-maintenance .mt-contact-list{display:inline-block;list-style:none;width:100%;max-width:500px;margin:20px 0 0;padding:20px 0 0;border-top:1px solid #eee}
|
|
32
|
+
.s-maintenance .mt-contact-list li{display:inline-block;margin-inline-end:10px}
|
|
33
|
+
.s-maintenance .mt-contact-list a{display:inline-flex;align-items:center;padding:5px;color:rgb(102 102 102 / 80%);text-decoration:none;font-size:1.25rem}
|
|
34
|
+
.s-maintenance .mt-contact-list a:hover{color:#666}
|
|
35
|
+
.s-maintenance .mt-contact--btn{padding:3px 20px 5px;border-radius:20px;color:#fff!important;background:rgb(102 102 102 / 80%);font-size:1rem!important}
|
|
36
|
+
.s-maintenance .mt-contact--btn:hover{background:#666}
|
|
37
|
+
.s-maintenance .mt-contact--btn i{margin-inline-end:10px}
|
|
38
|
+
.s-maintenance .thumb{width:100%;animation:revealMtBlock 1.5s .1s forwards;opacity:0}
|
|
39
|
+
.s-maintenance .thumb img{display:block;width:100%;max-width:450px;margin:0 auto}
|
|
40
|
+
@media (max-width:1024px){
|
|
41
|
+
.s-maintenance{padding:40px 0 10px}
|
|
42
|
+
.s-maintenance .mt-panel{flex-direction:column}
|
|
43
|
+
.s-maintenance .mt-message{order:2;text-align:center;padding:0;margin:50px 0 0}
|
|
44
|
+
.s-maintenance .mt-title{flex-direction:column;margin-bottom:30px}
|
|
45
|
+
.s-maintenance .mt-logo{margin:0 0 10px}
|
|
46
|
+
.s-maintenance .mt-title h1{font-size:1.5rem}
|
|
47
|
+
}
|
|
48
|
+
@media (max-width:640px){.s-maintenance .thumb img{width:80%}}
|
|
49
|
+
@keyframes revealMtBlock{from{opacity:0;transform:translateY(50%)}to{opacity:1;transform:translateY(0)}}
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
/** The phone button and social links under the message; nothing when the store lists none. */
|
|
53
|
+
function Contacts({ store, arabic }: { store: Store | undefined; arabic: boolean }) {
|
|
54
|
+
const { t } = useTranslation();
|
|
55
|
+
const mobile = store?.contacts?.mobile;
|
|
56
|
+
const socials = SOCIAL_ICONS.flatMap(([key, icon]) => {
|
|
57
|
+
const href = store?.social?.[key];
|
|
58
|
+
return href ? [{ key, icon, href }] : [];
|
|
59
|
+
});
|
|
60
|
+
if (!mobile && socials.length === 0) return null;
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<ul className="mt-contact-list">
|
|
64
|
+
{mobile && (
|
|
65
|
+
<li>
|
|
66
|
+
<a href={`tel:${mobile}`} className="mt-contact--btn">
|
|
67
|
+
<i className="sicon-phone" aria-hidden="true" />
|
|
68
|
+
{t('common.elements.contact_us', {
|
|
69
|
+
defaultValue: arabic ? 'تواصل معنا' : 'Contact us',
|
|
70
|
+
})}
|
|
71
|
+
</a>
|
|
72
|
+
</li>
|
|
73
|
+
)}
|
|
74
|
+
{socials.map(({ key, icon, href }) => (
|
|
75
|
+
<li key={key}>
|
|
76
|
+
<a href={href} target="_blank" rel="noreferrer" aria-label={key}>
|
|
77
|
+
<i className={icon} aria-hidden="true" />
|
|
78
|
+
</a>
|
|
79
|
+
</li>
|
|
80
|
+
))}
|
|
81
|
+
</ul>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The page a customer sees while the store is closed: the platform's maintenance page,
|
|
87
|
+
* fed by the settings' `maintenance_details` (the merchant's title and message) and the
|
|
88
|
+
* store's contacts. Rendered by `TwilightProvider` in place of the layout; see
|
|
89
|
+
* `rootBeforeLoad` for who sees it.
|
|
90
|
+
*/
|
|
91
|
+
export function MaintenancePage() {
|
|
92
|
+
const { settings, locale } = getTwilightContext();
|
|
93
|
+
const { t } = useTranslation();
|
|
94
|
+
const store = settings.store;
|
|
95
|
+
const details = settings.maintenance_details;
|
|
96
|
+
const arabic = locale.startsWith('ar');
|
|
97
|
+
|
|
98
|
+
const title =
|
|
99
|
+
details?.title ||
|
|
100
|
+
t('pages.maintenance.title', {
|
|
101
|
+
defaultValue: arabic ? 'المتجر قيد الصيانة' : 'Store under maintenance',
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<div className="s-maintenance" data-testid="store-maintenance-page">
|
|
106
|
+
<style>{STYLE}</style>
|
|
107
|
+
<div className="mt-container">
|
|
108
|
+
<section className="mt-panel">
|
|
109
|
+
<div className="mt-message">
|
|
110
|
+
<div className="mt-title">
|
|
111
|
+
{store?.logo && (
|
|
112
|
+
<span className="mt-logo">
|
|
113
|
+
<img
|
|
114
|
+
src={store.logo}
|
|
115
|
+
alt={
|
|
116
|
+
store.name ||
|
|
117
|
+
t('common.elements.store_logo', {
|
|
118
|
+
defaultValue: arabic ? 'شعار المتجر' : 'Store logo',
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
/>
|
|
122
|
+
</span>
|
|
123
|
+
)}
|
|
124
|
+
<h1>{title}</h1>
|
|
125
|
+
</div>
|
|
126
|
+
<div className="mt-content">
|
|
127
|
+
{details?.message ? (
|
|
128
|
+
// The merchant's own wording: a plain string the dashboard caps at 200 characters.
|
|
129
|
+
<p>{details.message}</p>
|
|
130
|
+
) : (
|
|
131
|
+
<>
|
|
132
|
+
<p>
|
|
133
|
+
{t('pages.maintenance.message', {
|
|
134
|
+
defaultValue: arabic
|
|
135
|
+
? 'عذرا عزيزي العميل، المتجر حاليا قيد الصيانة و سنعاود العمل خلال فترة وجيزة'
|
|
136
|
+
: 'Sorry, the store is under maintenance and will be back shortly.',
|
|
137
|
+
})}
|
|
138
|
+
</p>
|
|
139
|
+
<p>
|
|
140
|
+
{t('pages.maintenance.thanks', {
|
|
141
|
+
defaultValue: arabic ? 'شكرا لتفهمكم' : 'Thank you for your understanding.',
|
|
142
|
+
})}
|
|
143
|
+
</p>
|
|
144
|
+
</>
|
|
145
|
+
)}
|
|
146
|
+
</div>
|
|
147
|
+
<Contacts store={store} arabic={arabic} />
|
|
148
|
+
</div>
|
|
149
|
+
<div className="thumb">
|
|
150
|
+
<img src={THUMB_URL} alt="" />
|
|
151
|
+
</div>
|
|
152
|
+
</section>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
);
|
|
156
|
+
}
|
|
@@ -4,5 +4,8 @@ export {
|
|
|
4
4
|
type StoreClosedNotificationProps,
|
|
5
5
|
} from './StoreClosedNotification';
|
|
6
6
|
|
|
7
|
+
// The page customers see while the store is in maintenance (TwilightProvider renders it).
|
|
8
|
+
export { MaintenancePage } from './MaintenancePage';
|
|
9
|
+
|
|
7
10
|
// Lazy component
|
|
8
|
-
export { LazyStoreClosedNotification } from './lazy';
|
|
11
|
+
export { LazyStoreClosedNotification, LazyMaintenancePage } from './lazy';
|
|
@@ -6,3 +6,8 @@ export const LazyStoreClosedNotification = lazy(() =>
|
|
|
6
6
|
default: m.StoreClosedNotification,
|
|
7
7
|
}))
|
|
8
8
|
);
|
|
9
|
+
|
|
10
|
+
/** Lazy-loaded MaintenancePage: off the shell chunk, since almost no visit renders it. */
|
|
11
|
+
export const LazyMaintenancePage = lazy(() =>
|
|
12
|
+
import('./MaintenancePage').then((m) => ({ default: m.MaintenancePage }))
|
|
13
|
+
);
|
|
@@ -31,6 +31,12 @@ import {
|
|
|
31
31
|
import { syncSdkLocale, syncSdkThemeVersion } from '../../utils/sdk-helpers';
|
|
32
32
|
import { SettingsError } from '../../utils/errors';
|
|
33
33
|
import { resolveStoreBaseRedirect } from '../../utils/store-identity';
|
|
34
|
+
import {
|
|
35
|
+
ownerCookieMatches,
|
|
36
|
+
ownerLinkMatches,
|
|
37
|
+
showsMaintenancePage,
|
|
38
|
+
VIEW_AS_OWNER_COOKIE_NAME,
|
|
39
|
+
} from '../../utils/maintenance';
|
|
34
40
|
|
|
35
41
|
// Reads the `token` cookie from the incoming request on the SERVER. twilightMiddleware
|
|
36
42
|
// extracts the same cookie into a custom ALS, but that ALS does NOT propagate to the
|
|
@@ -128,6 +134,48 @@ export const persistRequestScope = createIsomorphicFn()
|
|
|
128
134
|
})
|
|
129
135
|
.client((): void => {});
|
|
130
136
|
|
|
137
|
+
/** The request's cookie header: the framework's on the server, the document's in the browser. */
|
|
138
|
+
const requestCookies = createIsomorphicFn()
|
|
139
|
+
.server((): string | null => {
|
|
140
|
+
try {
|
|
141
|
+
return getRequestHeader('cookie') ?? null;
|
|
142
|
+
} catch {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
})
|
|
146
|
+
.client((): string | null => (typeof document !== 'undefined' ? document.cookie : null));
|
|
147
|
+
|
|
148
|
+
/** Remembers the owner view for the rest of this browser session; see {@link VIEW_AS_OWNER_COOKIE_NAME}. */
|
|
149
|
+
const rememberOwnerView = createIsomorphicFn()
|
|
150
|
+
.server((storeId: string): void => {
|
|
151
|
+
try {
|
|
152
|
+
setCookie(VIEW_AS_OWNER_COOKIE_NAME, storeId, { path: '/', sameSite: 'lax' });
|
|
153
|
+
} catch {
|
|
154
|
+
// Outside a request (prerender): there is no response to write to.
|
|
155
|
+
}
|
|
156
|
+
})
|
|
157
|
+
.client((storeId: string): void => {
|
|
158
|
+
document.cookie = `${VIEW_AS_OWNER_COOKIE_NAME}=${storeId}; path=/; SameSite=Lax`;
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Whether this visitor sees the maintenance page instead of the store, deciding and
|
|
163
|
+
* remembering the merchant's owner view on the way.
|
|
164
|
+
*
|
|
165
|
+
* Twig's backend lets the merchant into their closed store when the dashboard's link
|
|
166
|
+
* brings them (`?utm_source=dashboard&identifier=<store id>`), and keeps that in the
|
|
167
|
+
* session. Here the link grants a session cookie, and the cookie or the link is the
|
|
168
|
+
* owner view. A customer gets the maintenance page, and `twilightMiddleware` turns the
|
|
169
|
+
* render into a 503 (see `withMaintenanceStatus`).
|
|
170
|
+
*/
|
|
171
|
+
export function resolveMaintenance(href: string, settings: StoreContext): boolean {
|
|
172
|
+
const fromLink = ownerLinkMatches(href, settings);
|
|
173
|
+
const storeId = settings.store?.id;
|
|
174
|
+
if (fromLink && storeId != null) rememberOwnerView(String(storeId));
|
|
175
|
+
const viewAsOwner = fromLink || ownerCookieMatches(requestCookies(), settings);
|
|
176
|
+
return showsMaintenancePage(settings, viewAsOwner);
|
|
177
|
+
}
|
|
178
|
+
|
|
131
179
|
/** On the server, once the settings are in: {@link alignRequestScopeType}, then {@link persistRequestScope}. */
|
|
132
180
|
function settleRequestScope(queryClient: QueryClient, settings: StoreContext): void {
|
|
133
181
|
if (typeof window !== 'undefined') return;
|
|
@@ -146,6 +194,8 @@ export interface BeforeLoadResult {
|
|
|
146
194
|
/** Per-app public `app.*` buckets, threaded the same way so rootHead can install the
|
|
147
195
|
* `Salla.appScope` factory inline in the SSR head. */
|
|
148
196
|
appsSettings?: AppSettings;
|
|
197
|
+
/** This visitor sees the maintenance page, not the store; see {@link resolveMaintenance}. */
|
|
198
|
+
maintenance: boolean;
|
|
149
199
|
}
|
|
150
200
|
|
|
151
201
|
/**
|
|
@@ -279,6 +329,8 @@ export async function rootBeforeLoad(ctx: {
|
|
|
279
329
|
throw redirect({ href: storeBaseHref, reloadDocument: true, replace: true });
|
|
280
330
|
}
|
|
281
331
|
|
|
332
|
+
const maintenance = resolveMaintenance(ctx.location.href, settingsResult);
|
|
333
|
+
|
|
282
334
|
// The merchant's own wording, laid over the platform's — but only when the
|
|
283
335
|
// settings say this language has any.
|
|
284
336
|
//
|
|
@@ -341,6 +393,7 @@ export async function rootBeforeLoad(ctx: {
|
|
|
341
393
|
authToken,
|
|
342
394
|
appsSnippets: snippetsResult,
|
|
343
395
|
appsSettings: appSettingsResult,
|
|
396
|
+
maintenance,
|
|
344
397
|
});
|
|
345
398
|
|
|
346
399
|
return {
|
|
@@ -350,5 +403,6 @@ export async function rootBeforeLoad(ctx: {
|
|
|
350
403
|
authToken,
|
|
351
404
|
appsSnippets: snippetsResult,
|
|
352
405
|
appsSettings: appSettingsResult,
|
|
406
|
+
maintenance,
|
|
353
407
|
};
|
|
354
408
|
}
|
|
@@ -219,6 +219,8 @@ interface RootHeadParts {
|
|
|
219
219
|
isCustomCssUrl?: boolean;
|
|
220
220
|
isCustomJsUrl?: boolean;
|
|
221
221
|
twilightSdkUrl: string;
|
|
222
|
+
/** The visitor gets the maintenance page, which loads no SDK and no app snippets. */
|
|
223
|
+
maintenance: boolean;
|
|
222
224
|
snippetPreconnects: Array<{ rel: 'preconnect'; href: string }>;
|
|
223
225
|
appScopeInstallScript: string;
|
|
224
226
|
themeHookSlotsScript: string | null;
|
|
@@ -268,6 +270,7 @@ function deriveHeadParts(settings?: StoreContext): RootHeadParts {
|
|
|
268
270
|
...deriveFontParts(settings?.theme),
|
|
269
271
|
...deriveCustomizationParts(settings?.theme),
|
|
270
272
|
twilightSdkUrl: resolveTwilightSdkUrl(settings),
|
|
273
|
+
maintenance: getTwilightContext().maintenance,
|
|
271
274
|
// Warm the connection to the snippet host(s) during head parse, so the body's deferred
|
|
272
275
|
// `<script src>` snippet tags fetch off an already-open socket instead of DNS+TCP+TLS.
|
|
273
276
|
snippetPreconnects: snippetPreconnectOrigins(getTwilightContext().appsSnippets).map((href) => ({
|
|
@@ -313,7 +316,8 @@ function buildRootLinks(p: RootHeadParts): NonNullable<HeadDescriptor['links']>
|
|
|
313
316
|
{ rel: 'preconnect', href: 'https://cdn.salla.sa' },
|
|
314
317
|
{ rel: 'preconnect', href: 'https://cdn.assets.salla.network', crossOrigin: 'anonymous' },
|
|
315
318
|
// Warm the installed apps' CDN snippet host(s) — see snippetPreconnectOrigins.
|
|
316
|
-
|
|
319
|
+
// Not on the maintenance page: it renders neither the snippets nor the SDK.
|
|
320
|
+
...(p.maintenance ? [] : p.snippetPreconnects),
|
|
317
321
|
...(p.isGoogleFont
|
|
318
322
|
? [
|
|
319
323
|
{
|
|
@@ -323,7 +327,7 @@ function buildRootLinks(p: RootHeadParts): NonNullable<HeadDescriptor['links']>
|
|
|
323
327
|
},
|
|
324
328
|
]
|
|
325
329
|
: []),
|
|
326
|
-
{ rel: 'modulepreload', href: p.twilightSdkUrl },
|
|
330
|
+
...(p.maintenance ? [] : [{ rel: 'modulepreload' as const, href: p.twilightSdkUrl }]),
|
|
327
331
|
...(p.fontUrlWithDisplay
|
|
328
332
|
? [
|
|
329
333
|
{
|
package/dist/Header-2GMIMJ2A.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export { Header } from './chunk-QQRU2L23.js';
|
|
2
|
-
import './chunk-K4ON2CI7.js';
|
|
3
|
-
import './chunk-OUW6WESU.js';
|
|
4
|
-
import './chunk-7YH3A5BT.js';
|
|
5
|
-
import './chunk-ZMCFSOYF.js';
|
|
6
|
-
import './chunk-5XDPAKF5.js';
|
|
7
|
-
import './chunk-GCPEMNSU.js';
|
|
8
|
-
import './chunk-ZPX4LBQZ.js';
|
|
9
|
-
import './chunk-TYNZ5B2B.js';
|
|
10
|
-
import './chunk-BCADAQXY.js';
|
|
11
|
-
import './chunk-AXW67SY7.js';
|
|
12
|
-
import './chunk-BYMOPN2S.js';
|
|
13
|
-
import './chunk-SKLEJJ6M.js';
|
|
14
|
-
import './chunk-VPGOT3JO.js';
|
|
15
|
-
import './chunk-VEWF3NFM.js';
|
|
16
|
-
import './chunk-GNLCPK6N.js';
|
|
17
|
-
import './chunk-H3PJJKAQ.js';
|
|
18
|
-
import './chunk-T72DAX7R.js';
|
|
19
|
-
import './chunk-DF6FBKDN.js';
|
|
20
|
-
import './chunk-DGUM43GV.js';
|
|
21
|
-
//# sourceMappingURL=Header-2GMIMJ2A.js.map
|
|
22
|
-
//# sourceMappingURL=Header-2GMIMJ2A.js.map
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
export { StoreClosedNotification } from './chunk-5A6QUNZ5.js';
|
|
2
|
-
import './chunk-YBEZB5WO.js';
|
|
3
|
-
import './chunk-QQRU2L23.js';
|
|
4
|
-
import './chunk-J6T5YOUW.js';
|
|
5
|
-
import './chunk-JZDJO2CK.js';
|
|
6
|
-
import './chunk-P4XV656A.js';
|
|
7
|
-
import './chunk-XLCLZIWF.js';
|
|
8
|
-
import './chunk-OXMUPNMH.js';
|
|
9
|
-
import './chunk-PENQTLAN.js';
|
|
10
|
-
import './chunk-VVZNW5CB.js';
|
|
11
|
-
import './chunk-HIAHDZI5.js';
|
|
12
|
-
import './chunk-GD26FI4J.js';
|
|
13
|
-
import './chunk-4SZZPXM2.js';
|
|
14
|
-
import './chunk-K4ON2CI7.js';
|
|
15
|
-
import './chunk-OUW6WESU.js';
|
|
16
|
-
import './chunk-6YWW5Y22.js';
|
|
17
|
-
import './chunk-HI5V5X3S.js';
|
|
18
|
-
import './chunk-PXHFHHTW.js';
|
|
19
|
-
import './chunk-XMO7HDZZ.js';
|
|
20
|
-
import './chunk-MVT5AF2A.js';
|
|
21
|
-
import './chunk-Z653O7MX.js';
|
|
22
|
-
import './chunk-ZCH7W7DZ.js';
|
|
23
|
-
import './chunk-JUUKZRE5.js';
|
|
24
|
-
import './chunk-JWXJPJBO.js';
|
|
25
|
-
import './chunk-CW625T2E.js';
|
|
26
|
-
import './chunk-7V36I5GT.js';
|
|
27
|
-
import './chunk-6WI7R2BD.js';
|
|
28
|
-
import './chunk-OOCN4RFV.js';
|
|
29
|
-
import './chunk-OAMIDZKW.js';
|
|
30
|
-
import './chunk-7YH3A5BT.js';
|
|
31
|
-
import './chunk-V2ZDTY6H.js';
|
|
32
|
-
import './chunk-ZMCFSOYF.js';
|
|
33
|
-
import './chunk-5XDPAKF5.js';
|
|
34
|
-
import './chunk-GCPEMNSU.js';
|
|
35
|
-
import './chunk-ZPX4LBQZ.js';
|
|
36
|
-
import './chunk-TYNZ5B2B.js';
|
|
37
|
-
import './chunk-BCADAQXY.js';
|
|
38
|
-
import './chunk-AXW67SY7.js';
|
|
39
|
-
import './chunk-BYMOPN2S.js';
|
|
40
|
-
import './chunk-SKLEJJ6M.js';
|
|
41
|
-
import './chunk-6BZ5TKEV.js';
|
|
42
|
-
import './chunk-FZKRSGLP.js';
|
|
43
|
-
import './chunk-7V5HOZW4.js';
|
|
44
|
-
import './chunk-YA6ABQB7.js';
|
|
45
|
-
import './chunk-46JZXQRS.js';
|
|
46
|
-
import './chunk-VPGOT3JO.js';
|
|
47
|
-
import './chunk-VEWF3NFM.js';
|
|
48
|
-
import './chunk-GNLCPK6N.js';
|
|
49
|
-
import './chunk-H3PJJKAQ.js';
|
|
50
|
-
import './chunk-T72DAX7R.js';
|
|
51
|
-
import './chunk-DF6FBKDN.js';
|
|
52
|
-
import './chunk-DGUM43GV.js';
|
|
53
|
-
//# sourceMappingURL=StoreClosedNotification-FJS7YUCR.js.map
|
|
54
|
-
//# sourceMappingURL=StoreClosedNotification-FJS7YUCR.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/translations-key.ts","../src/api/messages.ts","../src/utils/errors.ts","../src/providers/i18n-factory.ts","../src/twilight/context.ts"],"names":[],"mappings":";;;;;;AAwBO,SAAS,qBAAqB,MAAA,EAAk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AAChB,MAAA,OAAO,IAAA,CAAK,WAAA;AAAA,IACd,CAAA;AAAA,IACA,IAAI,IAAA,GAAO;AACT,MAAA,IAAI,CAAC,KAAK,IAAA,EAAM;AAKd,QAAA,IAAA,CAAK,IAAA,GAAO,kBAAA;AAAA,UACV,IAAA,CAAK,MAAA;AAAA,UACL,iBAAA,CAAkB,IAAA,CAAK,WAAA,EAAa,IAAA,CAAK,MAAM;AAAA,SACjD;AAAA,MACF;AACA,MAAA,OAAO,IAAA,CAAK,IAAA;AAAA,IACd,CAAA;AAAA,IACA,IAAI,GAAA,GAAM;AACR,MAAA,OAAO,eAAA,CAAgB,IAAA,CAAK,MAAM,CAAA,CAAE,GAAA;AAAA,IACtC,CAAA;AAAA,IACA,IAAI,IAAA,GAAO;AACT,MAAA,OAAO,IAAA,CAAK,IAAA;AAAA,IACd,CAAA;AAAA,IACA,IAAI,YAAA,GAAe;AACjB,MAAA,OAAO,IAAA,CAAK,YAAA;AAAA,IACd,CAAA;AAAA,IACA,IAAI,YAAA,GAAe;AACjB,MAAA,OAAO,IAAA,CAAK,YAAA;AAAA,IACd,CAAA;AAAA,IACA,IAAI,MAAA,GAAS;AACX,MAAA,OAAO,IAAA,CAAK,MAAA;AAAA,IACd;AAAA,GACF;AACF","file":"chunk-H3PJJKAQ.js","sourcesContent":["/**\n * @fileoverview The translations query key, on its own, importing nothing.\n *\n * Three places read the cached translations — `rootBeforeLoad`, the hydration\n * path in `tanstack/router.tsx`, and the lazy `i18n` accessor in\n * `twilight/context.ts` — and all three have to agree on the key or the\n * hydrated page misses the entry it was just handed and refetches. One\n * definition is the only way to keep that true.\n *\n * It lives here rather than in `api/translations.ts`, where it would naturally\n * sit, because **`twilight/context.ts` cannot afford that module's imports**.\n * `api/translations` pulls in `api/client`, which pulls in `ky`; `context.ts`\n * is imported directly by tests that mock `ky`, and adding that edge made six\n * of them stop being mocked and start issuing real requests to `api.salla.dev`\n * (`tests/routes/rootBeforeLoad.test.ts`, bisected to exactly this import). A\n * leaf module with no imports of its own cannot do that to anyone.\n */\n\n/**\n * @param locale is part of the key because each file on the CDN holds one\n * language. The global file this replaced carried every language and was\n * sliced after the cache, so a key without the locale was correct then and is\n * a wrong-language bug now: `/ar` → `/en` would reuse the Arabic entry.\n */\nexport function translationsQueryKey(locale: string): [string, string] {\n return ['translations', locale];\n}\n\n/**\n * The merchant's own wording for one store and one language.\n *\n * Separate from {@link translationsQueryKey} rather than folded into it,\n * because the two files have different lifetimes and different audiences: the\n * platform's copy is the same object for every store on the CDN, and this one\n * is a single merchant's overrides. Keeping them apart means a store with no\n * overrides never invalidates, refetches or dehydrates anything on its account.\n *\n * @param storeId is `settings.store.id` — the Optimus-encoded numeric id, which\n * is what names the object. It is safe in a key even though the locale-only key\n * deliberately avoids naming a store: that warning is about a store *resolved\n * from the request*, which differs between server and client. This one is read\n * out of the settings payload, so both sides compute it from the same\n * dehydrated data and agree.\n */\nexport function storeTranslationsQueryKey(\n storeId: string | number,\n locale: string\n): [string, string, string] {\n return ['translations', String(storeId), locale];\n}\n","/**\n * @fileoverview Composing one language's messages out of the query cache.\n *\n * **There are three places that build an i18n instance**, and they have to\n * agree on more than the key: `rootBeforeLoad`, the hydration path in\n * `tanstack/router.tsx`, and the lazy `i18n` accessor in `twilight/context.ts`.\n * When the platform's copy was the only source, agreeing on\n * `translationsQueryKey` was enough. It is not any more — a merchant's own\n * wording is a second cache entry, and a reader that knows about one and not\n * the other renders different text from the page beside it.\n *\n * That is exactly what shipped in #366: the server rendered the merchant's\n * words and hydration replaced them with the platform's, because only\n * `rootBeforeLoad` had been taught to merge. Greptile caught it. This module is\n * the single answer to \"what are the messages for this locale\", so the next\n * source cannot be added to one reader and forgotten in two.\n *\n * It lives beside `translations-key.ts` and imports nothing at runtime for the\n * same reason that file does: `twilight/context.ts` cannot afford\n * `api/translations`, which pulls in `api/client` and therefore `ky`, and tests\n * that mock `ky` stop being mocked the moment that edge exists.\n */\nimport type { QueryClient } from '@tanstack/react-query';\nimport { translationsQueryKey } from './translations-key';\nimport type { TranslationMessages } from '../providers/I18nProvider';\n\nexport type Messages = Record<string, unknown>;\n\nexport function isPlainObject(value: unknown): value is Messages {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * `overrides` laid over `base`, one leaf at a time.\n *\n * Recursive rather than a spread, because both files are nested by group\n * (`common.errors.500`) and a top-level spread would make a merchant who\n * overrode one string inside `common` lose every other string in it. The\n * merchant's value wins at the leaf, and a group they never touched is left\n * exactly as the platform sent it.\n *\n * A type conflict — one side an object where the other is a string — resolves\n * to the merchant's value. It is the more specific of the two and there is no\n * sensible way to merge a string into a group; the alternative, keeping the\n * platform's, would mean a merchant's edit silently doing nothing.\n */\nexport function mergeMessages(base: Messages, overrides: Messages): Messages {\n const merged: Messages = { ...base };\n\n for (const [key, value] of Object.entries(overrides)) {\n const existing = merged[key];\n merged[key] =\n isPlainObject(existing) && isPlainObject(value) ? mergeMessages(existing, value) : value;\n }\n\n return merged;\n}\n\n/**\n * This store's overrides for `locale`, if any were fetched into the cache.\n *\n * Found by **shape** rather than by asking the settings for a store id, and\n * that is deliberate: the two readers that were missing the merge have a\n * `queryClient` and a locale between them and nothing else, and reaching for\n * `api/store` from `twilight/context.ts` would drag `ky` in through the back\n * door. One document serves one store — a request naming a different one is\n * redirected with `reloadDocument` — so at most one such entry per locale\n * exists, and matching `['translations', <anything>, <locale>]` cannot pick up\n * somebody else's.\n */\nfunction cachedOverrides(queryClient: QueryClient, locale: string): Messages | undefined {\n const entries = queryClient.getQueriesData<Messages>({ queryKey: ['translations'] });\n\n for (const [key, data] of entries) {\n if (key.length === 3 && key[2] === locale && isPlainObject(data)) {\n return data;\n }\n }\n\n return undefined;\n}\n\n/**\n * The messages for `locale`: the platform's copy with this merchant's over it.\n *\n * Reads only — whoever wants the merchant's file in the cache has to have put\n * it there, which `rootBeforeLoad` does and only when the settings say there is\n * one. A reader that runs without it simply gets the platform's copy, which is\n * the same thing it got before any of this existed.\n */\nexport function messagesForLocale(\n queryClient: QueryClient | undefined,\n locale: string\n): TranslationMessages | undefined {\n const common = queryClient?.getQueryData<TranslationMessages>(translationsQueryKey(locale));\n const overrides = queryClient ? cachedOverrides(queryClient, locale) : undefined;\n\n return composeMessages(common, overrides, locale);\n}\n\n/**\n * The same composition from values rather than from the cache.\n *\n * `rootBeforeLoad` has both in hand already — it just awaited them — so it\n * composes directly instead of reading back what it put in.\n */\nexport function composeMessages(\n common: TranslationMessages | null | undefined,\n overrides: Messages | null | undefined,\n locale: string\n): TranslationMessages | undefined {\n if (!overrides || Object.keys(overrides).length === 0) return common ?? undefined;\n\n const base = common?.[`${locale}.trans`];\n\n return {\n [`${locale}.trans`]: mergeMessages(isPlainObject(base) ? base : {}, overrides) as Record<\n string,\n string\n >,\n };\n}\n","export class SettingsError extends Error {\n constructor(message?: string) {\n super(message ?? 'Store settings could not be loaded.');\n this.name = 'SettingsError';\n }\n}\n","import { createInstance, type i18n as I18nInstance } from 'i18next';\nimport { initReactI18next } from 'react-i18next';\n\nexport type TranslationMessages = Record<string, Record<string, string>>;\n\n/**\n * Creates a new i18next instance for the given locale.\n *\n * @param locale - Active locale code, e.g. `'ar'`\n * @param translations - App translations from the Salla API (store-specific)\n * @param themeTranslations - Bundled theme translations (static defaults)\n */\nexport function createI18nInstance(\n locale: string,\n translations?: TranslationMessages,\n themeTranslations?: TranslationMessages\n): I18nInstance {\n const instance = createInstance();\n const transKey = `${locale}.trans`;\n\n instance.use(initReactI18next).init({\n lng: locale,\n fallbackLng: locale,\n ns: ['app', 'theme'],\n defaultNS: 'app',\n fallbackNS: 'theme',\n resources: {\n [locale]: {\n app: translations?.[transKey] ?? {},\n theme: themeTranslations?.[transKey] ?? {},\n },\n },\n interpolation: { escapeValue: false },\n react: { useSuspense: false },\n keySeparator: '.',\n nsSeparator: false,\n });\n\n return instance;\n}\n\n/**\n * Creates i18n instance for testing\n * @param locale - Locale code (default: 'ar')\n * @param translations - Optional translations\n */\nexport function createTestI18n(locale = 'ar', translations?: TranslationMessages): I18nInstance {\n return createI18nInstance(locale, translations);\n}\n","import type { QueryClient } from '@tanstack/react-query';\nimport type { i18n } from 'i18next';\nimport type { StoreContext } from '../api/store';\nimport type { AppSnippet, AppSettings } from '../api/apps';\nimport { FALLBACK_LOCALE, getLanguageInfo } from '../providers/locale-constants';\nimport { createI18nInstance } from '../providers/i18n-factory';\nimport { messagesForLocale } from '../api/messages';\nimport { SettingsError } from '../utils/errors';\nimport type { ActiveScope } from '../utils/cookies';\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface TwilightLocation<TSearch = Record<string, unknown>> {\n href: string;\n pathname: string;\n search: TSearch;\n searchStr: string;\n state: Record<string, unknown>;\n hash: string;\n}\n\nexport interface PageContext {\n slug: string;\n id?: string | number;\n title: string;\n url?: string;\n parent?: { id: string | number; name: string; url: string } | null;\n breadcrumbs?: { name: string; url: string }[];\n}\n\nexport interface TwilightContext {\n queryClient: QueryClient;\n settings: StoreContext;\n locale: string;\n routeId: string;\n location: TwilightLocation;\n authToken: string | null;\n /**\n * The selected market and, once bullet delivery confirmed one, its branch\n * allocation — the full object the SDK sends as `s-scope-*` headers. Seeded from\n * the `scope` cookie on the server; see {@link ActiveScope}.\n */\n scope: ActiveScope | null;\n /** `scope.id`, kept for callers that only need the market. */\n scopeId: string | null;\n /**\n * Which store this request is for, when something other than the hostname says\n * so — the `?storeId=` a preview was opened with, or the cookie remembering it.\n *\n * Null on a live storefront, where the hostname is the answer and there is\n * nothing to carry. See {@link resolveRequestStoreId}.\n */\n storeId: string | null;\n /**\n * Which store the first segment of this request's path named, on a host where\n * the store is the root of every URL: `mtgr-alaatr-2` for\n * `https://preview.salla.design/mtgr-alaatr-2/cart`.\n *\n * Null whenever something else named the store, and on every merchant domain.\n * See {@link resolveRequestStoreBase}.\n */\n storeBase: string | null;\n /**\n * Where {@link storeBase} sits in this request's paths: behind the locale on a\n * Salla shared host (`/ar/dev-x/cart`, named by the dispatcher), in front of it\n * everywhere else. See {@link resolveAddressedStore}.\n */\n storeBaseFollowsLocale: boolean;\n /**\n * Which version of the theme's settings this request asked for — the\n * `?versionId=` an editor preview or a local dev session was opened with, or\n * the cookie remembering it.\n *\n * Null on an ordinary storefront visit, which is the common case: nothing\n * named a version, so the store's live one is what the API answers with. See\n * {@link resolveRequestVersionId}.\n */\n versionId: string | null;\n /**\n * The host this request arrived on, captured server-side.\n *\n * A theme worker is deployed with no vars and no bindings, so the request is\n * the only thing that knows which storefront it is serving. On the client this\n * is `window.location.host`; on the server nothing else has it.\n */\n requestHost: string | null;\n i18n: i18n;\n dir: 'ltr' | 'rtl';\n page?: PageContext;\n /** Installed apps' snippets, fetched in rootBeforeLoad so AppsSnippets can render CDN\n * <script> tags during SSR (React Query isn't dehydrated here, so useQuery has no SSR data). */\n appsSnippets?: AppSnippet[];\n /** Per-app public `app.*` buckets, fetched in rootBeforeLoad so rootHead can install the\n * `Salla.appScope` factory inline at parse time — ahead of the snippets' onReady callbacks. */\n appsSettings?: AppSettings;\n extras?: Record<string, unknown>;\n}\n\n// ============================================================================\n// Internal Store\n// ============================================================================\n\nconst DEFAULT_LOCATION: TwilightLocation = {\n href: '',\n pathname: '',\n search: {},\n searchStr: '',\n state: {},\n hash: '',\n};\n\ninterface ContextData {\n queryClient: QueryClient;\n settings: StoreContext | null;\n locale: string;\n routeId: string;\n location: TwilightLocation;\n authToken: string | null;\n scope: ActiveScope | null;\n storeId: string | null;\n storeBase: string | null;\n storeBaseFollowsLocale: boolean;\n versionId: string | null;\n requestHost: string | null;\n i18n?: i18n;\n page?: PageContext;\n appsSnippets?: AppSnippet[];\n appsSettings?: AppSettings;\n extras?: Record<string, unknown>;\n}\n\nconst DEFAULT_DATA: ContextData = {\n queryClient: null as unknown as QueryClient,\n settings: null,\n locale: FALLBACK_LOCALE,\n routeId: '',\n location: { ...DEFAULT_LOCATION },\n authToken: null,\n scope: null,\n storeId: null,\n storeBase: null,\n storeBaseFollowsLocale: false,\n versionId: null,\n requestHost: null,\n i18n: undefined,\n page: undefined,\n};\n\n// ============================================================================\n// Storage: AsyncLocalStorage (server) or module-level store (client)\n// ============================================================================\n\ntype AsyncLocalStore<T> = { getStore(): T | undefined; run(val: T, fn: () => unknown): unknown };\n\n// Initialize ALS at module load time for SSR — no race condition\ntype AsyncHooks = { AsyncLocalStorage: new <T>() => AsyncLocalStore<T> };\n\n// workerd has no global `require`, so a bundled `require()` throws there; it does have\n// `process.getBuiltinModule` (so does Node >= 20.16), which keeps this out of the browser bundle.\nfunction loadAsyncHooks(): AsyncHooks | null {\n const proc = (globalThis as { process?: { getBuiltinModule?: (id: string) => unknown } }).process;\n try {\n const builtin = proc?.getBuiltinModule?.('node:async_hooks') as AsyncHooks | undefined;\n if (builtin?.AsyncLocalStorage) return builtin;\n } catch {\n /* fall through to require */\n }\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n return require('node:async_hooks') as AsyncHooks;\n } catch {\n return null;\n }\n}\n\nconst isServer = typeof window === 'undefined';\n// One instance per isolate, so a re-evaluated or duplicated copy of this module (dev\n// reloads, src next to dist) reads the scope the request middleware opened.\nconst ALS_KEY = Symbol.for('salla.twilight.context.als');\nlet _als: AsyncLocalStore<ContextData> | null = null;\nif (isServer) {\n const registry = globalThis as { [ALS_KEY]?: AsyncLocalStore<ContextData> };\n const hooks = registry[ALS_KEY] ? null : loadAsyncHooks();\n if (hooks) registry[ALS_KEY] = new hooks.AsyncLocalStorage<ContextData>();\n _als = registry[ALS_KEY] ?? null;\n}\n\n// Without request isolation every request would share `clientStore`: one visitor's\n// auth token and store settings rendered into another's page.\nfunction assertRequestIsolation(): void {\n if (isServer && !_als) {\n throw new Error(\n '[Twilight] AsyncLocalStorage is unavailable; refusing to share request state.'\n );\n }\n}\n\n// The browser's store, shared by every copy of this module on the page like the ALS above,\n// so a loader in one copy reads the location and token the router wrote through another.\nconst CLIENT_KEY = Symbol.for('salla.twilight.context.client');\nconst clientRegistry = globalThis as {\n [CLIENT_KEY]?: { store: ContextData; listeners: Set<() => void> };\n};\nconst clientShared = (clientRegistry[CLIENT_KEY] ??= {\n store: { ...DEFAULT_DATA },\n listeners: new Set<() => void>(),\n});\nconst clientStore: ContextData = clientShared.store;\n\nfunction getTwilightStore(): ContextData {\n assertRequestIsolation();\n if (_als) {\n const store = _als.getStore();\n if (!store)\n throw new Error('[Twilight] No request context. Wrap with runWithTwilightContext().');\n return store;\n }\n return clientStore;\n}\n\nfunction writableStore(): ContextData {\n if (_als) {\n const store = _als.getStore();\n if (store) return store;\n }\n return clientStore;\n}\n\nfunction mergeIntoStore(store: ContextData, partial: Partial<TwilightContext>): void {\n if ('queryClient' in partial && partial.queryClient) store.queryClient = partial.queryClient;\n if ('settings' in partial && partial.settings != null) store.settings = partial.settings;\n if ('locale' in partial && partial.locale != null) store.locale = partial.locale;\n if ('routeId' in partial && partial.routeId != null) store.routeId = partial.routeId;\n if ('location' in partial && partial.location != null)\n store.location = { ...store.location, ...partial.location };\n if ('authToken' in partial && partial.authToken !== undefined)\n store.authToken = partial.authToken ?? null;\n if ('scope' in partial && partial.scope !== undefined) store.scope = partial.scope ?? null;\n else if ('scopeId' in partial && partial.scopeId !== undefined)\n store.scope = partial.scopeId == null ? null : { id: partial.scopeId };\n if ('storeId' in partial && partial.storeId !== undefined)\n store.storeId = partial.storeId ?? null;\n if ('storeBase' in partial && partial.storeBase !== undefined)\n store.storeBase = partial.storeBase ?? null;\n if ('storeBaseFollowsLocale' in partial && partial.storeBaseFollowsLocale !== undefined)\n store.storeBaseFollowsLocale = partial.storeBaseFollowsLocale === true;\n if ('versionId' in partial && partial.versionId !== undefined)\n store.versionId = partial.versionId ?? null;\n if ('requestHost' in partial && partial.requestHost !== undefined)\n store.requestHost = partial.requestHost ?? null;\n if ('i18n' in partial && partial.i18n != null) store.i18n = partial.i18n;\n if ('page' in partial) store.page = partial.page;\n if ('appsSnippets' in partial) store.appsSnippets = partial.appsSnippets;\n if ('appsSettings' in partial) store.appsSettings = partial.appsSettings;\n if ('extras' in partial) store.extras = partial.extras;\n}\n\n// ============================================================================\n// Public API\n// ============================================================================\n\nexport function runWithTwilightContext<T>(partial: Partial<TwilightContext>, fn: () => T): T {\n assertRequestIsolation();\n if (_als) {\n const data: ContextData = { ...DEFAULT_DATA };\n mergeIntoStore(data, partial);\n return _als.run(data, fn) as T;\n }\n mergeIntoStore(clientStore, partial);\n return fn();\n}\n\n// Client-only subscription so React consumers (useRouteId/useIsHome/…) re-render\n// when navigation mutates the module store. Mirrors hooks/useWishlist.ts.\nconst listeners = clientShared.listeners;\n\nexport function subscribeTwilight(listener: () => void): () => void {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n}\n\nexport function updateTwilightContext(partial: Partial<TwilightContext>): void {\n mergeIntoStore(getTwilightStore(), partial);\n // Server uses AsyncLocalStorage and has no React subscribers; notify on client only.\n if (typeof window !== 'undefined') {\n for (const listener of listeners) listener();\n }\n}\n\n/**\n * Whether store settings are available, without throwing.\n *\n * `getTwilightContext().settings` throws a `SettingsError` when the store is\n * empty, which is fatal inside a head function during hydration. Callers that\n * need to *test* availability must use this instead of a try/catch around the\n * getter. Returns false when there is no request context at all (server-side\n * calls outside `runWithTwilightContext`).\n */\nexport function hasTwilightSettings(): boolean {\n try {\n return getTwilightStore().settings != null;\n } catch {\n return false;\n }\n}\n\n/** What a request addressed, as opposed to what it is. */\nexport interface RequestAddressing {\n storeId: string | null;\n storeBase: string | null;\n storeBaseFollowsLocale: boolean;\n versionId: string | null;\n requestHost: string | null;\n}\n\n/**\n * What this request named and the host it arrived on, without throwing.\n *\n * Separate from {@link getTwilightContext} because store identity is read while\n * deciding *what to fetch* — before there is a context worth having — and on the\n * server outside a request the getter throws. A caller asking \"which store?\" has\n * a sane answer for \"none named\"; it has none for an exception.\n *\n * The version rides along rather than getting an accessor of its own: it is read\n * at the same moment, for the same reason, and by the same callers, and a second\n * copy of this try/catch would be a second thing to remember to widen.\n */\nexport function getRequestStore(): RequestAddressing {\n try {\n const data = getTwilightStore();\n return {\n storeId: data.storeId,\n storeBase: data.storeBase,\n storeBaseFollowsLocale: data.storeBaseFollowsLocale,\n versionId: data.versionId,\n requestHost: data.requestHost,\n };\n } catch {\n return {\n storeId: null,\n storeBase: null,\n storeBaseFollowsLocale: false,\n versionId: null,\n requestHost: null,\n };\n }\n}\n\nexport function getTwilightContext(): TwilightContext {\n const data = getTwilightStore();\n return {\n get queryClient() {\n return data.queryClient;\n },\n get settings() {\n if (!data.settings) throw new SettingsError();\n return data.settings;\n },\n get locale() {\n return data.locale;\n },\n get routeId() {\n return data.routeId;\n },\n get location() {\n return data.location;\n },\n get authToken() {\n return data.authToken;\n },\n get scope() {\n return data.scope;\n },\n get scopeId() {\n return data.scope?.id ?? null;\n },\n get storeId() {\n return data.storeId;\n },\n get storeBase() {\n return data.storeBase;\n },\n get storeBaseFollowsLocale() {\n return data.storeBaseFollowsLocale;\n },\n get versionId() {\n return data.versionId;\n },\n get requestHost() {\n return data.requestHost;\n },\n get i18n() {\n if (!data.i18n) {\n // Composed the same way as `rootBeforeLoad` and the hydration path —\n // the platform's copy with this merchant's over it. See\n // `api/messages.ts`: this accessor reading one entry while the others\n // read two is precisely the drift that module exists to stop.\n data.i18n = createI18nInstance(\n data.locale,\n messagesForLocale(data.queryClient, data.locale)\n );\n }\n return data.i18n;\n },\n get dir() {\n return getLanguageInfo(data.locale).dir;\n },\n get page() {\n return data.page;\n },\n get appsSnippets() {\n return data.appsSnippets;\n },\n get appsSettings() {\n return data.appsSettings;\n },\n get extras() {\n return data.extras;\n },\n };\n}\n\n/** @internal Reset store for testing */\nexport function resetForTesting(): void {\n Object.assign(writableStore(), { ...DEFAULT_DATA });\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/store.ts"],"names":[],"mappings":";;;;;AASA,IAAM,qBAAA,GAAwB;AAAA,EAC5B,OAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA,gBAAA;AAAA,EACA,mBAAA;AAAA,EACA,YAA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A,GAAY,gBAAA,CAAiB,IAAA,CAAK,SAAS,CAAA;AAEjD,MAAA,OAAO;AAAA,QACL,OAAO,IAAA,CAAK,KAAA;AAAA,QACZ,OAAO,IAAA,CAAK,KAAA;AAAA,QACZ,SAAA;AAAA,QACA,YAAY,IAAA,CAAK,UAAA;AAAA,QACjB,mBAAmB,IAAA,CAAK,iBAAA;AAAA,QACxB,SAAS,IAAA,CAAK,OAAA;AAAA,QACd,OAAO,IAAA,CAAK,KAAA;AAAA,QACZ,WAAW,IAAA,CAAK,SAAA;AAAA,QAChB,YAAY,IAAA,CAAK,UAAA;AAAA,QACjB,MAAM,IAAA,CAAK,IAAA;AAAA,QACX,QAAQ,IAAA,CAAK,MAAA;AAAA,QACb,OAAO,IAAA,CAAK,KAAA;AAAA,QACZ,GAAI,KAAA,IAAS,EAAE,gBAAA,EAAkB,MAAM,EAAA;AAAG,OAC5C;AAAA,IACF,SAAS,KAAA,EAAO;AACd,MAAA,OAAA,CAAQ,KAAA,CAAM,4BAA4B,KAAK,CAAA;AAC/C,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,MACA,OAAA,EAAS,MAAM,KAAA,CAAM,QAAA,CAAS,eAAe;AAAA,KAC9C;AAAA;AAEP","file":"chunk-JDLXT6VI.js","sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { api, getActiveScope, STORE_IDENTIFIER_HEADER } from './client';\nimport type { Store, Theme, Language, JitsuConfig } from '../types';\nimport { getTwilightContext } from '../twilight/context';\nimport { resolveStoreIdentifier } from '../utils/store-identity';\nimport { requestedThemeVersionId } from '../utils/theme-version';\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}\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 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}\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\nexport const store = {\n settings: async (storeIdentifier?: string): Promise<StoreContext | null> => {\n const identifier = storeIdentifier ?? resolveStoreIdentifier();\n\n if (!identifier) {\n console.warn('[store.settings] No store identifier available');\n return null;\n }\n\n const includeParams = DEFAULT_INCLUDE_ITEMS.map((i) => `include[]=${i}`).join('&');\n const scope = getActiveScope();\n const params = scope != null ? `${includeParams}&scope=${scope.id}` : includeParams;\n\n try {\n const json = await 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: 5000,\n headers: { [STORE_IDENTIFIER_HEADER]: identifier },\n })\n .json<{ data?: SettingsApiResponse }>();\n\n const data = json?.data;\n if (!data) return null;\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: data.jitsu,\n ...(scope && { requestedScopeId: scope.id }),\n };\n } catch (error) {\n console.error('[store.settings] Failed:', error);\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 queryFn: () => store.settings(storeIdentifier),\n }),\n },\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/routes/root/head.ts"],"names":[],"mappings":";;;;;;;;;AAeA,IAAM,mBAAA,GAAsB,sEAAA;AAC5B,IAAM,WAAA,GAAc,OAAA;AACpB,IAAM,YAAA,GAAe,+CAA+C,WAAW,CAAA,CAAA;AAG/E,IAAM,WAAA,GAAsC;AAAA,EAC1C,GAAA,EAAK,GAAG,YAAY,CAAA,OAAA,CAAA;AAAA,EACpB,MAAA,EAAQ,GAAG,YAAY,CAAA,CAAA,CAAA;AAAA,EACvB,UAAA,EAAY,GAAG,YAAY,CAAA,qBAAA,CAAA;AAAA,EAC3B,WAAA,EAAa,GAAG,YAAY,CAAA,UAAA,CAAA;AAAA,EAC5B,aAAA,EAAe,GAAG,YAAY,CAAA,2BAAA,CAAA;AAAA,EAC9B,cAAA,EAAgB,GAAG,YAAY,CAAA,aAAA,CAAA;AAAA,EAC/B,uBAAA,EAAyB,GAAG,YAAY,CAAA,qCAAA,CAAA;AAAA,EACxC,wBAAA,EAA0B,GAAG,YAAY,CAAA,kBAAA;AAC3C,CAAA;AAEO,IAAM,oBAAA,GACX;AAEF,IAAM,oBAAA,GAAuB,uCAAA;AAC7B,IAAM,gBAAA,GAAmB,yDAAA;AAIzB,IAAM,oBAAA,GAAuB,UAAA;AAE7B,IAAM,wBAAA,GAA2B,UAAA;AACjC,IAAM,aAAa,CAAC,OAAA,KAClB,CAAA,EAAG,oBAAoB,IAAI,OAAO,CAAA,gBAAA,CAAA;AAEpC,IAAM,UAA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AAI;AAAC,GACvF;AACF;AAEA,SAAS,iBAAiB,CAAA,EAA0D;AAClF,EAAA,OAAO;AAAA;AAAA;AAAA,IAGL,GAAI,CAAA,CAAE,gBAAA,GAAmB,CAAC,EAAE,EAAA,EAAI,mBAAA,EAAqB,QAAA,EAAU,CAAA,CAAE,gBAAA,EAAkB,CAAA,GAAI,EAAC;AAAA,IACxF,EAAE,EAAA,EAAI,eAAA,EAAiB,QAAA,EAAU,iBAAA,EAAkB;AAAA;AAAA;AAAA,IAGnD,EAAE,EAAA,EAAI,iBAAA,EAAmB,QAAA,EAAU,EAAE,qBAAA,EAAsB;AAAA;AAAA;AAAA,IAG3D,GAAI,CAAA,CAAE,oBAAA,GACF,CAAC,EAAE,EAAA,EAAI,wBAAA,EAA0B,QAAA,EAAU,CAAA,CAAE,oBAAA,EAAsB,CAAA,GACnE,EAAC;AAAA,IACL,EAAE,EAAA,EAAI,iBAAA,EAAmB,QAAA,EAAU,iBAAA,EAAkB;AAAA;AAAA,IAErD,GAAI,CAAA,CAAE,QAAA,GAAW,CAAC,mBAAA,CAAoB,CAAA,CAAE,QAAA,EAAU,OAAA,CAAQ,CAAA,CAAE,aAAa,CAAC,CAAC,IAAI;AAAC,GAClF;AACF;AAIA,SAAS,mBAAA,CAAoB,UAAkB,KAAA,EAAgB;AAC7D,EAAA,OAAO;AAAA,IACL,EAAA,EAAI,iBAAA;AAAA,IACJ,QAAA,EAAU,KAAA,GACN,CAAA,sGAAA,EAAyG,qBAAA,CAAsB,IAAA,CAAK,SAAA,CAAU,QAAQ,CAAC,CAAC,CAAA,yDAAA,CAAA,GACxJ,CAAA,MAAA,EAAS,QAAQ,CAAA,yEAAA;AAAA,GACvB;AACF","file":"chunk-JZDJO2CK.js","sourcesContent":["import type { HeadDescriptor, HeadResult } from '../../utils/head';\nimport { mergeHead, resolveHead } from '../../utils/head';\nimport { buildBaseHead } from '../../utils/baseHead';\nimport { FALLBACK_LOCALE } from '../../providers/locale-constants';\nimport { getTwilightContext } from '../../twilight/context';\nimport type { TwilightContextMatch } from '../../twilight/ensure-context';\nimport { ensureTwilightContextFromMatches } from '../../twilight/ensure-context';\nimport type { StoreContext } from '../../api/store';\nimport type { AppSnippet } from '../../api/apps';\nimport { SettingsError } from '../../utils/errors';\nimport { renderAppScopeInstallScript } from '../../utils/app-scope';\nimport { renderThemeHookSlotsScript } from '../../utils/theme-hook-slots';\nimport { escapeForInlineScript } from '../../utils/inline-script';\nimport { readEnv, renderRuntimeEnvScript } from '../../utils/runtime-env';\n\nconst SALLA_ICONS_CSS_URL = 'https://cdn.assets.salla.network/static/fonts/sallaicons.css?v=2.0.5';\nconst LIT_VERSION = '3.3.3';\nconst LIT_CDN_BASE = `https://cdn.assets.salla.network/static/lit/${LIT_VERSION}`;\n\n/** Bare-specifier map for the lit build the engine's `<salla-*>` web components resolve against. */\nconst LIT_IMPORTS: Record<string, string> = {\n lit: `${LIT_CDN_BASE}/lit.js`,\n 'lit/': `${LIT_CDN_BASE}/`,\n 'lit-html': `${LIT_CDN_BASE}/lit-html/lit-html.js`,\n 'lit-html/': `${LIT_CDN_BASE}/lit-html/`,\n 'lit-element': `${LIT_CDN_BASE}/lit-element/lit-element.js`,\n 'lit-element/': `${LIT_CDN_BASE}/lit-element/`,\n '@lit/reactive-element': `${LIT_CDN_BASE}/reactive-element/reactive-element.js`,\n '@lit/reactive-element/': `${LIT_CDN_BASE}/reactive-element/`,\n};\n\nexport const TICKETING_SCRIPT_URL =\n 'https://cdn.assets.salla.network/latest/@salla.sa/ui-store-ticketing-system/ticketing-system.es.js';\n\nconst TWILIGHT_RELEASE_CDN = 'https://cdn.salla.network/js/twilight';\nconst TWILIGHT_DEV_CDN = 'https://cdn.assets.salla.network/dev/@salla.sa/twilight';\n// The oldest Twilight release this engine works with. Raise it whenever the engine\n// starts relying on something newer; the reason lives in that commit. Today's floor:\n// components ship their own CSS, which themes no longer compile (SallaApp/twilight#2107).\nconst MIN_TWILIGHT_VERSION = '2.14.538';\n// Last resort when no override and no platform pin, and the substitute for a pin below the floor.\nconst DEFAULT_TWILIGHT_VERSION = '2.14.584';\nconst releaseUrl = (version: string): string =>\n `${TWILIGHT_RELEASE_CDN}/${version}/twilight.esm.js`;\n// The head is built more than once per request (early hints, then the page); say it once.\nconst warnedPins = new Set<string>();\n\n/** `x.y.z` release pins only; dev shas and other strings are loaded as given. */\nfunction belowMinimum(version: string): boolean {\n return (\n /^\\d+\\.\\d+\\.\\d+$/.test(version) &&\n version.localeCompare(MIN_TWILIGHT_VERSION, undefined, { numeric: true }) < 0\n );\n}\n\n/** The `x.y.z` release segment of a release-CDN `.../twilight.esm.js` URL, if present. */\nfunction releaseVersionInUrl(url: string): string | null {\n const match = url.match(/\\/(\\d+\\.\\d+\\.\\d+)\\/twilight\\.esm\\.js(?:[?#]|$)/);\n return match ? match[1] : null;\n}\n\n/**\n * `VITE_TWILIGHT_URL`/`VITE_TWILIGHT_VERSION` outrank everything below, including\n * `theme.twilight.version`'s own `belowMinimum` guard — a stale override wins\n * silently otherwise (TD-16375: a scaffold-time pin outlived the engine raising\n * MIN_TWILIGHT_VERSION, so every new theme rendered without component CSS and\n * nothing said why). Only a dev-mode nudge, not a swap: an env override is a\n * deliberate choice, so unlike the settings-pin path below this never substitutes\n * the engine default underneath the developer.\n */\nfunction warnIfOverrideBelowMinimum(source: string, version: string): void {\n // Worker logs in production should stay quiet -- this is a developer-directed nudge,\n // not a user-facing or production-monitored signal. import.meta.env.DEV is a static\n // false in production builds, so this branch (and the console.warn below) is\n // tree-shaken out entirely, same as DevSettingsWidget / dev-settings-store.ts.\n if (!import.meta.env.DEV) return;\n if (!belowMinimum(version)) return;\n const key = `${source}:${version}`;\n if (warnedPins.has(key)) return;\n warnedPins.add(key);\n console.warn(\n `[twilight] ${source}=${version} is below the engine minimum ${MIN_TWILIGHT_VERSION} — components may load without their CSS (SallaApp/twilight#2107). Unset it or bump it to ${MIN_TWILIGHT_VERSION}+.`\n );\n}\n\n/**\n * Which twilight.esm.js the storefront loads, in priority order:\n * 1. `VITE_TWILIGHT_URL` — full local/deployment override.\n * 2. `VITE_TWILIGHT_VERSION` — dev-CDN build override.\n * 3. `theme.twilight.version` from the settings endpoint — the platform-pinned\n * release used when no environment override is configured.\n * 4. The engine's default release, also used when the pin is below the engine minimum.\n */\nexport function resolveTwilightSdkUrl(settings?: StoreContext): string {\n const urlOverride = readEnv('VITE_TWILIGHT_URL');\n if (urlOverride) {\n const version = releaseVersionInUrl(urlOverride);\n if (version) warnIfOverrideBelowMinimum('VITE_TWILIGHT_URL', version);\n return urlOverride;\n }\n\n const versionOverride = readEnv('VITE_TWILIGHT_VERSION');\n if (versionOverride) {\n warnIfOverrideBelowMinimum('VITE_TWILIGHT_VERSION', versionOverride);\n return `${TWILIGHT_DEV_CDN}/${versionOverride}/twilight.esm.js`;\n }\n\n const pinnedVersion = settings?.theme?.twilight?.version;\n if (pinnedVersion && belowMinimum(pinnedVersion)) {\n if (!warnedPins.has(pinnedVersion)) {\n warnedPins.add(pinnedVersion);\n console.warn(\n `[twilight] theme.twilight.version ${pinnedVersion} is below the engine minimum ${MIN_TWILIGHT_VERSION}; loading ${DEFAULT_TWILIGHT_VERSION} instead`\n );\n }\n return releaseUrl(DEFAULT_TWILIGHT_VERSION);\n }\n if (pinnedVersion) return releaseUrl(pinnedVersion);\n\n return releaseUrl(DEFAULT_TWILIGHT_VERSION);\n}\n\n// On a page that preloads its LCP image, the icon font (~270 KB) applies once the first screen's\n// priority images have painted, so it doesn't compete with them; other pages swap on load.\nconst MEDIA_SWAP_SCRIPT = `\n(function(){var d=document,s=function(l){if(l.sheet||\"all\"===l.media)l.media=\"all\";else l.onload=function(){this.media=\"all\"}},f=d.getElementById(\"salla-theme-font\"),i=d.getElementById(\"salla-icons-css\");f&&s(f);if(!i)return;if(!d.querySelector('link[rel=\"preload\"][as=\"image\"]'))return s(i);var g=function(){g=function(){};s(i)},p=function(){requestAnimationFrame(function(){setTimeout(function(){g()})});setTimeout(function(){g()},100)};d.addEventListener(\"DOMContentLoaded\",function(){var m=[].filter.call(d.querySelectorAll('img[fetchpriority=\"high\"]'),function(x){return!x.complete}),n=m.length;if(!n)return p();m.forEach(function(x){var o=function(){--n||p()};x.addEventListener(\"load\",o,{once:!0});x.addEventListener(\"error\",o,{once:!0})});setTimeout(function(){g()},2500)})})();\n`.trim();\n\nconst LOADING_CSS = `\n.loading-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#fff;z-index:9999}\n.loading-spinner{animation:spin 1s linear infinite;border-radius:9999px;height:3rem;width:3rem;border-bottom:2px solid var(--color-primary,#000)}\n@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}\nhtml,body{margin:0;padding:0;height:100%}\n`.trim();\n\nconst SALLA_INIT_SCRIPT = `\nwindow.salla = window.Salla = window.Salla || window.salla || {};\nwindow.Salla.onReady = window.Salla.onReady || function(callback) {\n return new Promise(function(resolve) {\n if (window.Salla.status === 'ready') {\n var config = window.salla && window.salla.config && window.salla.config.all();\n resolve(callback ? callback(config) : config);\n } else {\n window.addEventListener('twilight::initiated', function(event) {\n resolve(callback ? callback(event.detail) : event.detail);\n }, { once: true });\n }\n });\n};\n`.trim();\n\n/**\n * Distinct snippet-host origins to `preconnect` (warm DNS/TCP/TLS during parse). From the real\n * URLs (dev/prod-correct), deduped and capped at 4. No `crossOrigin`: snippets are no-cors fetches.\n */\nexport function snippetPreconnectOrigins(snippets: readonly AppSnippet[] | undefined): string[] {\n if (!snippets?.length) return [];\n const origins = new Set<string>();\n for (const app of snippets) {\n if (app.status !== 'enabled') continue;\n for (const s of app.snippets) {\n if (!s.url) continue;\n try {\n origins.add(new URL(s.url).origin);\n } catch {\n /* skip a malformed snippet url rather than breaking the head */\n }\n if (origins.size >= 4) return [...origins];\n }\n }\n return [...origins];\n}\n\nexport function rootHead(ctx: {\n params: Record<string, string>;\n matches?: readonly TwilightContextMatch[];\n}): HeadResult {\n // Re-run on the client during hydration, where the twilight module store may\n // still be empty. Recover it from the resolved match context so the head is\n // built from real settings instead of falling through to 'Store Unavailable'.\n ensureTwilightContextFromMatches(ctx.matches);\n\n let settings: StoreContext | undefined;\n try {\n settings = getTwilightContext().settings;\n } catch (e) {\n if (e instanceof SettingsError) {\n return resolveHead({\n title: 'Store Unavailable',\n });\n }\n throw e;\n }\n const locale = ctx.params.locale || FALLBACK_LOCALE;\n const parts = deriveHeadParts(settings);\n\n return resolveHead(\n mergeHead(buildBaseHead(settings, locale), {\n meta: buildRootMeta(parts),\n links: buildRootLinks(parts),\n styles: buildRootStyles(parts),\n importMap: [{ imports: LIT_IMPORTS }],\n scripts: buildRootScripts(parts),\n })\n );\n}\n\n/** Everything the root head's tag builders read, derived once from the store settings. */\ninterface RootHeadParts {\n store: StoreContext['store'] | undefined;\n favicon?: string;\n primaryColor?: string;\n fontUrl?: string;\n fontUrlWithDisplay?: string;\n isGoogleFont?: boolean;\n fontFamilyName?: string;\n customJs?: string;\n customCss?: string;\n isCustomCssUrl?: boolean;\n isCustomJsUrl?: boolean;\n twilightSdkUrl: string;\n snippetPreconnects: Array<{ rel: 'preconnect'; href: string }>;\n appScopeInstallScript: string;\n themeHookSlotsScript: string | null;\n runtimeEnvScript: string | null;\n}\n\n/** Google Fonts only honours `display=swap` as a query param; other hosts get the @font-face\n * override instead (see buildRootStyles). */\nfunction deriveFontParts(theme?: StoreContext['theme']) {\n const font = theme?.font;\n const fontUrl = font?.url || font?.path;\n const isGoogleFont = fontUrl?.includes('fonts.googleapis.com');\n const needsDisplay = Boolean(isGoogleFont && fontUrl && !fontUrl.includes('display='));\n const separator = fontUrl?.includes('?') ? '&' : '?';\n\n return {\n fontUrl,\n isGoogleFont,\n fontFamilyName: font?.family_name,\n fontUrlWithDisplay: needsDisplay ? `${fontUrl}${separator}display=swap` : fontUrl,\n };\n}\n\n/** Theme customization JS/CSS, each either a URL to load or an inline blob to embed. */\nfunction deriveCustomizationParts(theme?: StoreContext['theme']) {\n const customization = theme?.customization;\n const customJs = customization?.js?.trim();\n const customCss = customization?.css?.trim();\n const isUrl = (value?: string): boolean =>\n Boolean(value?.startsWith('http') || value?.startsWith('//'));\n\n return {\n customJs,\n customCss,\n isCustomCssUrl: isUrl(customCss),\n isCustomJsUrl: isUrl(customJs),\n };\n}\n\nfunction deriveHeadParts(settings?: StoreContext): RootHeadParts {\n const store = settings?.store;\n\n return {\n store,\n favicon: store?.icon,\n primaryColor: settings?.theme?.color?.primary,\n ...deriveFontParts(settings?.theme),\n ...deriveCustomizationParts(settings?.theme),\n twilightSdkUrl: resolveTwilightSdkUrl(settings),\n // Warm the connection to the snippet host(s) during head parse, so the body's deferred\n // `<script src>` snippet tags fetch off an already-open socket instead of DNS+TCP+TLS.\n snippetPreconnects: snippetPreconnectOrigins(getTwilightContext().appsSnippets).map((href) => ({\n rel: 'preconnect' as const,\n href,\n })),\n // Install `Salla.appScope` inline at parse time, before the SDK is ready — else a snippet's\n // onReady callback calls it too early and throws. Always emitted, even when the settings\n // prefetch failed: the CDN snippet tags ship regardless (they come from the *snippets*\n // endpoint), so the factory has to exist for them. `installAppScope` then seeds the real\n // buckets into this install once the client query resolves.\n appScopeInstallScript: renderAppScopeInstallScript(\n getTwilightContext().appsSettings ?? { apps: {} }\n ),\n // Whitelist the theme's own hook slots at parse time too, for the same reason: apps register\n // their `onReady` callbacks from parser-inserted snippet tags, long before React hydrates.\n themeHookSlotsScript: renderThemeHookSlotsScript(),\n // Env this render resolved (worker `vars` live in server-only `process.env`), handed to the\n // client so it doesn't silently fall back to the production defaults. Re-rendered on the\n // client during hydration, where it resolves to the same values or to nothing.\n runtimeEnvScript: renderRuntimeEnvScript(),\n };\n}\n\nfunction buildRootMeta(p: RootHeadParts): NonNullable<HeadDescriptor['meta']> {\n return [\n { name: 'robots', content: 'index, follow' },\n { name: 'msapplication-TileColor', content: '#ffffff' },\n ...(p.favicon ? [{ name: 'msapplication-TileImage', content: p.favicon }] : []),\n ...(p.primaryColor\n ? [\n { name: 'theme-color', content: p.primaryColor },\n { name: 'msapplication-navbutton-color', content: p.primaryColor },\n { name: 'apple-mobile-web-app-status-bar-style', content: p.primaryColor },\n ]\n : []),\n ];\n}\n\nfunction buildRootLinks(p: RootHeadParts): NonNullable<HeadDescriptor['links']> {\n return [\n { rel: 'preconnect', href: 'https://api.salla.dev' },\n { rel: 'preconnect', href: 'https://cdn.salla.sa' },\n { rel: 'preconnect', href: 'https://cdn.assets.salla.network', crossOrigin: 'anonymous' },\n // Warm the installed apps' CDN snippet host(s) — see snippetPreconnectOrigins.\n ...p.snippetPreconnects,\n ...(p.isGoogleFont\n ? [\n {\n rel: 'preconnect' as const,\n href: 'https://fonts.gstatic.com',\n crossOrigin: 'anonymous' as const,\n },\n ]\n : []),\n { rel: 'modulepreload', href: p.twilightSdkUrl },\n ...(p.fontUrlWithDisplay\n ? [\n {\n id: 'salla-theme-font',\n rel: 'stylesheet',\n href: p.fontUrlWithDisplay,\n media: 'print',\n },\n ]\n : []),\n ...(p.fontUrlWithDisplay && !p.isGoogleFont && p.fontFamilyName\n ? [\n {\n id: 'salla-font-display-override',\n rel: 'preload',\n as: 'style',\n href: p.fontUrlWithDisplay,\n },\n ]\n : []),\n ...(p.favicon ? [{ rel: 'icon', href: p.favicon }] : []),\n ...(p.favicon\n ? [{ id: 'salla-apple-icon', rel: 'apple-touch-icon-precomposed', href: p.favicon }]\n : []),\n ...(p.isCustomCssUrl && p.customCss\n ? [{ id: 'salla-custom-css', rel: 'stylesheet', href: p.customCss }]\n : []),\n {\n id: 'salla-icons-css',\n rel: 'stylesheet',\n href: SALLA_ICONS_CSS_URL,\n media: 'print',\n },\n // {\n // id: 'intl-tel-input-css',\n // rel: 'stylesheet',\n // href: 'https://cdn.jsdelivr.net/npm/intl-tel-input@26.8.0/build/css/intlTelInput.css',\n // },\n ...(p.isCustomJsUrl && p.customJs\n ? [{ id: 'salla-custom-js-preload', rel: 'preload', as: 'script', href: p.customJs }]\n : []),\n ];\n}\n\n// Hoistable (href + precedence): the web components insert their own <style> near the top of\n// <head> before hydration, which a positionally hydrated <style> would be matched against.\nconst hoisted = (id: string, children: string) => ({\n id,\n href: id,\n precedence: 'default',\n children,\n});\n\nfunction buildRootStyles(p: RootHeadParts): NonNullable<HeadDescriptor['styles']> {\n return [\n hoisted('twilight-loading', LOADING_CSS),\n ...(!p.isGoogleFont && p.fontFamilyName\n ? [\n hoisted(\n 'salla-font-display-swap',\n `@font-face{font-family:\"${p.fontFamilyName}\";font-display:swap;src:local(\"${p.fontFamilyName}\")}`\n ),\n ]\n : []),\n ...(!p.isCustomCssUrl && p.customCss ? [hoisted('salla-custom-css', p.customCss)] : []),\n ];\n}\n\nfunction buildRootScripts(p: RootHeadParts): NonNullable<HeadDescriptor['scripts']> {\n return [\n // First: the API base / store identifier this render used, so the hydrated client\n // resolves the same ones (worker `vars` never reach the browser bundle on their own).\n ...(p.runtimeEnvScript ? [{ id: 'salla-runtime-env', children: p.runtimeEnvScript }] : []),\n { id: 'twilight-init', children: SALLA_INIT_SCRIPT },\n // After twilight-init (which defines window.Salla) and before the SDK module, so the\n // appScope factory exists ahead of any snippet's onReady callback firing.\n { id: 'salla-app-scope', children: p.appScopeInstallScript },\n // Arms the hook-slot whitelist push here, so its `twilight::initiated` listener is\n // registered before any app snippet's — listeners fire in registration order.\n ...(p.themeHookSlotsScript\n ? [{ id: 'salla-theme-hook-slots', children: p.themeHookSlotsScript }]\n : []),\n { id: 'salla-async-css', children: MEDIA_SWAP_SCRIPT },\n // The SDK and ticketing modules are rendered at the end of <body> (SallaSdkScripts).\n ...(p.customJs ? [buildCustomJsScript(p.customJs, Boolean(p.isCustomJsUrl))] : []),\n ];\n}\n\n/** A URL customization is loaded after SDK init; an inline one is wrapped so a syntax/runtime\n * error in partner JS warns instead of taking the page down. */\nfunction buildCustomJsScript(customJs: string, isUrl: boolean) {\n return {\n id: 'salla-custom-js',\n children: isUrl\n ? `window.addEventListener('twilight::initiated',function(){var s=document.createElement('script');s.src=${escapeForInlineScript(JSON.stringify(customJs))};s.async=true;document.head.appendChild(s)},{once:true});`\n : `try { ${customJs} } catch(e) { console.warn(\"[ThemeCustomization] Custom JS error:\", e); }`,\n };\n}\n"]}
|