@salla.sa/twilight-theme-engine 1.0.138 → 1.0.139
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-P3IXCYO7.js → AddToCartForm-QGJ2XVCZ.js} +3 -3
- package/dist/{AddToCartForm-P3IXCYO7.js.map → AddToCartForm-QGJ2XVCZ.js.map} +1 -1
- package/dist/{BlogAuthorPage-UJYMW4ZL.js → BlogAuthorPage-5QGP4RDK.js} +16 -16
- package/dist/{BlogAuthorPage-UJYMW4ZL.js.map → BlogAuthorPage-5QGP4RDK.js.map} +1 -1
- package/dist/{BlogCategoryPage-3XO42UFX.js → BlogCategoryPage-FH7ASETM.js} +16 -16
- package/dist/{BlogCategoryPage-3XO42UFX.js.map → BlogCategoryPage-FH7ASETM.js.map} +1 -1
- package/dist/{BlogPage-5SQNDQ7L.js → BlogPage-HNNR2Q4U.js} +14 -14
- package/dist/{BlogPage-5SQNDQ7L.js.map → BlogPage-HNNR2Q4U.js.map} +1 -1
- package/dist/{BlogSinglePage-XSRKZYUI.js → BlogSinglePage-OYXJCOJ2.js} +14 -14
- package/dist/{BlogSinglePage-XSRKZYUI.js.map → BlogSinglePage-OYXJCOJ2.js.map} +1 -1
- package/dist/{BlogTagPage-CFXWHUJR.js → BlogTagPage-XEHXO4PE.js} +16 -16
- package/dist/{BlogTagPage-CFXWHUJR.js.map → BlogTagPage-XEHXO4PE.js.map} +1 -1
- package/dist/{BrandsPage-APYVP4M2.js → BrandsPage-QSTJTEAA.js} +15 -15
- package/dist/{BrandsPage-APYVP4M2.js.map → BrandsPage-QSTJTEAA.js.map} +1 -1
- package/dist/{Breadcrumb-M4DBOMXW.js → Breadcrumb-7QGTM5S5.js} +14 -14
- package/dist/{Breadcrumb-M4DBOMXW.js.map → Breadcrumb-7QGTM5S5.js.map} +1 -1
- package/dist/{CartItem-BXZDBDLA.js → CartItem-7FNRMTQS.js} +14 -14
- package/dist/{CartItem-BXZDBDLA.js.map → CartItem-7FNRMTQS.js.map} +1 -1
- package/dist/{CartSummary-NT7N6ERQ.js → CartSummary-A32524GZ.js} +14 -14
- package/dist/{CartSummary-NT7N6ERQ.js.map → CartSummary-A32524GZ.js.map} +1 -1
- package/dist/{Copyright-IJDVQWOS.js → Copyright-PVSTODJF.js} +3 -3
- package/dist/{Copyright-IJDVQWOS.js.map → Copyright-PVSTODJF.js.map} +1 -1
- package/dist/{CustomerLayout-UNEDHUO2.js → CustomerLayout-NOHKTFXG.js} +14 -14
- package/dist/{CustomerLayout-UNEDHUO2.js.map → CustomerLayout-NOHKTFXG.js.map} +1 -1
- package/dist/{Footer-QX5BCDUK.js → Footer-RDRSICZP.js} +4 -4
- package/dist/{Footer-QX5BCDUK.js.map → Footer-RDRSICZP.js.map} +1 -1
- package/dist/{Header-EAOIXJNS.js → Header-YCS4HJCH.js} +8 -8
- package/dist/{Header-EAOIXJNS.js.map → Header-YCS4HJCH.js.map} +1 -1
- package/dist/LatestProducts-JEOWAHON.js +107 -0
- package/dist/LatestProducts-JEOWAHON.js.map +1 -0
- package/dist/{LoyaltyPage-3VOLW5OQ.js → LoyaltyPage-TE5E3OJC.js} +14 -14
- package/dist/{LoyaltyPage-3VOLW5OQ.js.map → LoyaltyPage-TE5E3OJC.js.map} +1 -1
- package/dist/{LoyaltyPointsPage-IMHJHCZV.js → LoyaltyPointsPage-GI3EQOLY.js} +6 -6
- package/dist/{LoyaltyPointsPage-IMHJHCZV.js.map → LoyaltyPointsPage-GI3EQOLY.js.map} +1 -1
- package/dist/{MainMenu-ML6OQT53.js → MainMenu-46II2DJE.js} +5 -5
- package/dist/{MainMenu-ML6OQT53.js.map → MainMenu-46II2DJE.js.map} +1 -1
- package/dist/{MasterLayout-UCQA73I3.js → MasterLayout-ZYWD2XZO.js} +14 -14
- package/dist/{MasterLayout-UCQA73I3.js.map → MasterLayout-ZYWD2XZO.js.map} +1 -1
- package/dist/{MobileMenu-5JHOT4DP.js → MobileMenu-O7354R4E.js} +15 -15
- package/dist/{MobileMenu-5JHOT4DP.js.map → MobileMenu-O7354R4E.js.map} +1 -1
- package/dist/NoContent-7A7OR2NZ.js +6 -0
- package/dist/NoContent-7A7OR2NZ.js.map +1 -0
- package/dist/{NotificationsPage-C373Z2KC.js → NotificationsPage-OZKKZ2CC.js} +14 -14
- package/dist/{NotificationsPage-C373Z2KC.js.map → NotificationsPage-OZKKZ2CC.js.map} +1 -1
- package/dist/{OrderSinglePage-YYTU72JY.js → OrderSinglePage-IVOIE2YE.js} +15 -15
- package/dist/{OrderSinglePage-YYTU72JY.js.map → OrderSinglePage-IVOIE2YE.js.map} +1 -1
- package/dist/{OrdersPage-2F43AA76.js → OrdersPage-PMLHIHDV.js} +14 -14
- package/dist/{OrdersPage-2F43AA76.js.map → OrdersPage-PMLHIHDV.js.map} +1 -1
- package/dist/{PageSingle-2FIESLYJ.js → PageSingle-C3NBFFHR.js} +3 -3
- package/dist/{PageSingle-2FIESLYJ.js.map → PageSingle-C3NBFFHR.js.map} +1 -1
- package/dist/{ProductDetails-TNULRGXM.js → ProductDetails-R7SFKXNC.js} +4 -4
- package/dist/{ProductDetails-TNULRGXM.js.map → ProductDetails-R7SFKXNC.js.map} +1 -1
- package/dist/{ProfilePage-4VSU6H3S.js → ProfilePage-5FU4N6O7.js} +14 -14
- package/dist/{ProfilePage-4VSU6H3S.js.map → ProfilePage-5FU4N6O7.js.map} +1 -1
- package/dist/{ReviewsPage-65CYIATI.js → ReviewsPage-M7QHDNCJ.js} +3 -3
- package/dist/{ReviewsPage-65CYIATI.js.map → ReviewsPage-M7QHDNCJ.js.map} +1 -1
- package/dist/{SeoCartWidget-UHJJLLCU.js → SeoCartWidget-T6PF34G4.js} +14 -14
- package/dist/{SeoCartWidget-UHJJLLCU.js.map → SeoCartWidget-T6PF34G4.js.map} +1 -1
- package/dist/{SettingsPage-2JHRIGFS.js → SettingsPage-HBREYY5Q.js} +14 -14
- package/dist/{SettingsPage-2JHRIGFS.js.map → SettingsPage-HBREYY5Q.js.map} +1 -1
- package/dist/{StoreClosedNotification-ADSYNO7O.js → StoreClosedNotification-QTKW4PQ2.js} +15 -15
- package/dist/{StoreClosedNotification-ADSYNO7O.js.map → StoreClosedNotification-QTKW4PQ2.js.map} +1 -1
- package/dist/{TestimonialsPage-PYFKXCQP.js → TestimonialsPage-ESB4CQRS.js} +3 -3
- package/dist/{TestimonialsPage-PYFKXCQP.js.map → TestimonialsPage-ESB4CQRS.js.map} +1 -1
- package/dist/{ThankYouPage-VHUAKQF7.js → ThankYouPage-BLYIJQNV.js} +14 -14
- package/dist/{ThankYouPage-VHUAKQF7.js.map → ThankYouPage-BLYIJQNV.js.map} +1 -1
- package/dist/{WalletPage-NG2DJAUE.js → WalletPage-7YOOVSXO.js} +15 -15
- package/dist/{WalletPage-NG2DJAUE.js.map → WalletPage-7YOOVSXO.js.map} +1 -1
- package/dist/{WishlistPage-GFOKEWL3.js → WishlistPage-MXVTTJD6.js} +16 -16
- package/dist/{WishlistPage-GFOKEWL3.js.map → WishlistPage-MXVTTJD6.js.map} +1 -1
- package/dist/api/advertisement.js +2 -2
- package/dist/api/apps.js +2 -2
- package/dist/api/blog.js +3 -3
- package/dist/api/brands.js +3 -3
- package/dist/api/cart.js +3 -3
- package/dist/api/category.js +3 -3
- package/dist/api/client.js +1 -1
- package/dist/api/home.js +2 -2
- package/dist/api/loyalty.js +3 -3
- package/dist/api/menu.js +2 -2
- package/dist/api/notification.js +2 -2
- package/dist/api/order.js +3 -3
- package/dist/api/page.js +3 -3
- package/dist/api/product.js +3 -3
- package/dist/api/profile.js +1 -1
- package/dist/api/store.js +2 -2
- package/dist/api/translations.js +2 -2
- package/dist/api/user.js +2 -2
- package/dist/api/wallet.js +2 -2
- package/dist/api/wishlist.js +4 -4
- package/dist/{chunk-A7KXUBPT.js → chunk-2IGIQA2S.js} +3 -3
- package/dist/{chunk-A7KXUBPT.js.map → chunk-2IGIQA2S.js.map} +1 -1
- package/dist/{NoContent-63TMCPGY.js → chunk-33FWLJXY.js} +2 -4
- package/dist/chunk-33FWLJXY.js.map +1 -0
- package/dist/{chunk-5FEFYFTS.js → chunk-5J3HVOTR.js} +3 -3
- package/dist/{chunk-5FEFYFTS.js.map → chunk-5J3HVOTR.js.map} +1 -1
- package/dist/{chunk-P43VADN7.js → chunk-5KKQUH72.js} +3 -3
- package/dist/{chunk-P43VADN7.js.map → chunk-5KKQUH72.js.map} +1 -1
- package/dist/{chunk-CJZ3MJ3Y.js → chunk-62FNNS7U.js} +7 -7
- package/dist/{chunk-CJZ3MJ3Y.js.map → chunk-62FNNS7U.js.map} +1 -1
- package/dist/{chunk-LMMDVLAB.js → chunk-7CGTHJ6S.js} +7 -5
- package/dist/chunk-7CGTHJ6S.js.map +1 -0
- package/dist/{chunk-YPRSS27D.js → chunk-AORRIQPD.js} +4 -4
- package/dist/{chunk-YPRSS27D.js.map → chunk-AORRIQPD.js.map} +1 -1
- package/dist/{chunk-TWLJ2RII.js → chunk-BBMRL2QU.js} +4 -4
- package/dist/{chunk-TWLJ2RII.js.map → chunk-BBMRL2QU.js.map} +1 -1
- package/dist/{chunk-R73HXW5D.js → chunk-C5UK27T6.js} +4 -4
- package/dist/{chunk-R73HXW5D.js.map → chunk-C5UK27T6.js.map} +1 -1
- package/dist/{chunk-JXLZTGQN.js → chunk-E7TU4RW4.js} +3 -3
- package/dist/{chunk-JXLZTGQN.js.map → chunk-E7TU4RW4.js.map} +1 -1
- package/dist/{chunk-VFQNVPFH.js → chunk-ECFDJBTE.js} +7 -7
- package/dist/{chunk-VFQNVPFH.js.map → chunk-ECFDJBTE.js.map} +1 -1
- package/dist/{chunk-WC2ZDV4J.js → chunk-ECMDQQO2.js} +3 -3
- package/dist/{chunk-WC2ZDV4J.js.map → chunk-ECMDQQO2.js.map} +1 -1
- package/dist/{chunk-OXBMZSKL.js → chunk-ELQFU3RH.js} +4 -4
- package/dist/{chunk-OXBMZSKL.js.map → chunk-ELQFU3RH.js.map} +1 -1
- package/dist/chunk-EPMM5ZWB.js +206 -0
- package/dist/chunk-EPMM5ZWB.js.map +1 -0
- package/dist/{chunk-S7FNMT24.js → chunk-FG2B552D.js} +3 -3
- package/dist/{chunk-S7FNMT24.js.map → chunk-FG2B552D.js.map} +1 -1
- package/dist/{chunk-HEWFF3KI.js → chunk-FN4I3UDJ.js} +3 -3
- package/dist/{chunk-HEWFF3KI.js.map → chunk-FN4I3UDJ.js.map} +1 -1
- package/dist/{chunk-EGJ2SV6O.js → chunk-GCZ46XF6.js} +10 -10
- package/dist/{chunk-EGJ2SV6O.js.map → chunk-GCZ46XF6.js.map} +1 -1
- package/dist/{chunk-SAYYMA6E.js → chunk-HGNR4XBD.js} +21 -9
- package/dist/chunk-HGNR4XBD.js.map +1 -0
- package/dist/{chunk-FVHAKOEH.js → chunk-HUJARQI7.js} +3 -3
- package/dist/{chunk-FVHAKOEH.js.map → chunk-HUJARQI7.js.map} +1 -1
- package/dist/{chunk-R4BPODDJ.js → chunk-ICQIH7F6.js} +3 -3
- package/dist/{chunk-R4BPODDJ.js.map → chunk-ICQIH7F6.js.map} +1 -1
- package/dist/{chunk-U6EB7GM3.js → chunk-ISDSQORB.js} +4 -4
- package/dist/{chunk-U6EB7GM3.js.map → chunk-ISDSQORB.js.map} +1 -1
- package/dist/{chunk-HG75MP47.js → chunk-J4GUGMPX.js} +3 -3
- package/dist/{chunk-HG75MP47.js.map → chunk-J4GUGMPX.js.map} +1 -1
- package/dist/{chunk-5MNGLNIJ.js → chunk-J5OJ7JM2.js} +3 -3
- package/dist/{chunk-5MNGLNIJ.js.map → chunk-J5OJ7JM2.js.map} +1 -1
- package/dist/{chunk-PBFLXHKM.js → chunk-JI6ZNE7R.js} +3 -3
- package/dist/{chunk-PBFLXHKM.js.map → chunk-JI6ZNE7R.js.map} +1 -1
- package/dist/{chunk-EJ66I5SH.js → chunk-JRWBBN3M.js} +4 -4
- package/dist/{chunk-EJ66I5SH.js.map → chunk-JRWBBN3M.js.map} +1 -1
- package/dist/{chunk-JFKHKDSK.js → chunk-LQ2PXFR4.js} +3 -3
- package/dist/{chunk-JFKHKDSK.js.map → chunk-LQ2PXFR4.js.map} +1 -1
- package/dist/{chunk-DMS6PZXN.js → chunk-N63CWDNI.js} +4 -4
- package/dist/{chunk-DMS6PZXN.js.map → chunk-N63CWDNI.js.map} +1 -1
- package/dist/{chunk-3QR6T7KW.js → chunk-NVPOH3CU.js} +6 -201
- package/dist/chunk-NVPOH3CU.js.map +1 -0
- package/dist/{chunk-KLVEKLFL.js → chunk-ONPV2TED.js} +5 -5
- package/dist/{chunk-KLVEKLFL.js.map → chunk-ONPV2TED.js.map} +1 -1
- package/dist/{chunk-UXS3QCHM.js → chunk-P4UZRDTR.js} +14 -14
- package/dist/{chunk-UXS3QCHM.js.map → chunk-P4UZRDTR.js.map} +1 -1
- package/dist/{chunk-ITZ543CK.js → chunk-PLPIAVLJ.js} +3 -3
- package/dist/{chunk-ITZ543CK.js.map → chunk-PLPIAVLJ.js.map} +1 -1
- package/dist/{chunk-6EOAIIHL.js → chunk-RSHQ43OI.js} +3 -3
- package/dist/{chunk-6EOAIIHL.js.map → chunk-RSHQ43OI.js.map} +1 -1
- package/dist/{chunk-6KZUGNCS.js → chunk-TZCTCRGB.js} +3 -3
- package/dist/{chunk-6KZUGNCS.js.map → chunk-TZCTCRGB.js.map} +1 -1
- package/dist/{chunk-TK6A4UON.js → chunk-VZ342V4W.js} +4 -4
- package/dist/{chunk-TK6A4UON.js.map → chunk-VZ342V4W.js.map} +1 -1
- package/dist/{chunk-OSYUGCRG.js → chunk-WWGGQY6N.js} +4 -4
- package/dist/{chunk-OSYUGCRG.js.map → chunk-WWGGQY6N.js.map} +1 -1
- package/dist/{chunk-S5ZKI3TY.js → chunk-XETMTAZC.js} +4 -4
- package/dist/{chunk-S5ZKI3TY.js.map → chunk-XETMTAZC.js.map} +1 -1
- package/dist/{chunk-EOQPV6KS.js → chunk-XNBCPEH6.js} +7 -7
- package/dist/{chunk-EOQPV6KS.js.map → chunk-XNBCPEH6.js.map} +1 -1
- package/dist/{chunk-GJFK3SU5.js → chunk-XRX6VFSO.js} +4 -4
- package/dist/{chunk-GJFK3SU5.js.map → chunk-XRX6VFSO.js.map} +1 -1
- package/dist/{chunk-TVAXTMMQ.js → chunk-Y6X3TVOI.js} +3 -3
- package/dist/{chunk-TVAXTMMQ.js.map → chunk-Y6X3TVOI.js.map} +1 -1
- package/dist/{chunk-35D6CKKX.js → chunk-YF3U4WYG.js} +4 -4
- package/dist/{chunk-35D6CKKX.js.map → chunk-YF3U4WYG.js.map} +1 -1
- package/dist/{chunk-MWAXFBGG.js → chunk-ZU7TSTT7.js} +3 -3
- package/dist/{chunk-MWAXFBGG.js.map → chunk-ZU7TSTT7.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 +12 -12
- package/dist/components/home/HomePageRenderer.d.ts +3 -1
- package/dist/components/home/HomePageRenderer.d.ts.map +1 -1
- package/dist/components/home/LatestProducts.d.ts +13 -0
- package/dist/components/home/LatestProducts.d.ts.map +1 -0
- package/dist/components/home/index.js +17 -16
- package/dist/components/home/lazy.d.ts +1 -0
- package/dist/components/home/lazy.d.ts.map +1 -1
- package/dist/components/home/register.d.ts.map +1 -1
- package/dist/components/layout/index.js +4 -4
- package/dist/components/product/index.js +14 -13
- package/dist/components/store/index.js +13 -13
- package/dist/dev/editor/index.js +1 -1
- package/dist/dev/index.js +1 -1
- package/dist/{document-class-IGGYSGCU.js → document-class-LR4X2CH5.js} +11 -11
- package/dist/{document-class-IGGYSGCU.js.map → document-class-LR4X2CH5.js.map} +1 -1
- package/dist/hooks/index.js +12 -12
- package/dist/hooks/useGtm.js +12 -12
- package/dist/hooks/useMoney.js +12 -12
- package/dist/hooks/useStore.js +12 -12
- package/dist/hooks/useUser.js +3 -3
- package/dist/index.js +12 -12
- package/dist/{navigation-FUHRDRAN.js → navigation-5PCMFALH.js} +4 -4
- package/dist/{navigation-FUHRDRAN.js.map → navigation-5PCMFALH.js.map} +1 -1
- package/dist/{navigation-MJYWGH7A.js → navigation-OQ2ZT3ID.js} +5 -5
- package/dist/{navigation-MJYWGH7A.js.map → navigation-OQ2ZT3ID.js.map} +1 -1
- package/dist/{not-found-VVI6BXAZ.js → not-found-YHQVBI7H.js} +15 -15
- package/dist/{not-found-VVI6BXAZ.js.map → not-found-YHQVBI7H.js.map} +1 -1
- package/dist/providers/index.js +12 -12
- package/dist/routes/account/orders.js +4 -4
- package/dist/routes/account.js +13 -13
- package/dist/routes/blog.js +8 -8
- package/dist/routes/brands.js +4 -4
- package/dist/routes/cart.js +21 -20
- package/dist/routes/cart.js.map +1 -1
- package/dist/routes/home/HomePage.d.ts.map +1 -1
- package/dist/routes/home.js +18 -17
- package/dist/routes/index.js +3 -3
- package/dist/routes/loyalty.js +5 -5
- package/dist/routes/page.js +4 -4
- package/dist/routes/product-listing.js +19 -18
- package/dist/routes/product-listing.js.map +1 -1
- package/dist/routes/product.js +17 -16
- package/dist/routes/product.js.map +1 -1
- package/dist/routes/seo-redirects.js +3 -3
- package/dist/routes/testimonials.js +2 -2
- package/dist/routes/thank-you.js +4 -4
- package/dist/skeleton.js +18 -17
- package/dist/{store-lookup-2P7PQVXE.js → store-lookup-NJCTSPFL.js} +8 -8
- package/dist/{store-lookup-2P7PQVXE.js.map → store-lookup-NJCTSPFL.js.map} +1 -1
- package/dist/tanstack.js +11 -11
- package/dist/utils/index.js +2 -2
- package/package.json +1 -1
- package/tailwind/components/home/HomePageRenderer.tsx.txt +14 -3
- package/tailwind/components/home/LatestProducts.tsx.txt +63 -0
- package/tailwind/components/home/lazy.ts.txt +4 -0
- package/tailwind/components/home/register.ts.txt +2 -0
- package/tailwind/routes/home/HomePage.tsx.txt +6 -0
- package/dist/NoContent-63TMCPGY.js.map +0 -1
- package/dist/chunk-3QR6T7KW.js.map +0 -1
- package/dist/chunk-LMMDVLAB.js.map +0 -1
- package/dist/chunk-SAYYMA6E.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/home/ProductsSlider.tsx","../src/components/home/StoreFeatures.tsx","../src/components/home/FixedBanner.tsx","../src/components/home/FixedProducts.tsx","../src/components/home/FeaturedProductsStyle1.tsx","../src/components/home/FeaturedProductsStyle2.tsx","../src/components/home/FeaturedProductsStyle3.tsx","../src/components/home/ParallaxBackground.tsx","../src/components/home/PhotosSlider.tsx","../src/components/home/SquarePhotos.tsx","../src/components/home/Youtube.tsx","../src/components/home/BundleComponent.tsx","../src/components/home/lazy.ts","../src/components/home/register.ts","../src/components/home/ComponentErrorBoundary.tsx","../src/components/home/HomePageRenderer.tsx","../src/components/home/PageBlocks.tsx","../src/components/home/reorder-hooks.ts","../src/components/home/ReorderProducts.tsx"],"names":["product","StoreFeatures","jsx","memo","FixedBanner","Fragment","jsxs","Suspense","FeaturedProductsStyle1","useCallback","FeaturedProductsStyle2","useState","SallaButton","SallaProductsSlider","FeaturedProductsStyle3","ParallaxBackground","PhotosSlider","SquarePhotos","Youtube","BundleComponent","useEffect","FallbackComponent","ProductsSliderSkeleton","FixedProductsSkeleton","HomeComponentRenderer","Component","PageBlocks","useQuery","ReorderProducts","useMemo"],"mappings":";;;;;;;;;;;;;;;;;;AA6BO,SAAS,cAAA,CAAe,EAAE,IAAA,EAAK,EAAwB;AAC5D,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,cAAA,EAAe;AAC7B,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,KAAA;AAAA,IACA,eAAA,EAAiB,aAAA;AAAA,IACjB,QAAA,GAAW,CAAA;AAAA,IACX,QAAA,GAAW,KAAA;AAAA,IACX,aAAA,EAAe,YAAA;AAAA,IACf,cAAA,EAAgB,aAAA;AAAA,IAChB,IAAA;AAAA,IACA,QAAA;AAAA,IACA,eAAA,EAAiB,aAAA;AAAA,IACjB,SAAA;AAAA,IACA;AAAA,GACF,GAAI,IAAA;AAEJ,EAAA,MAAM,WAAA,GAAc,OAAA;AAAA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,MAAM,EAAE,SAAA,EAAW,QAAA,EAAS,GAAI,kBAAA,EAAmB;AAEnD,EAAA,MAAM,OAAA,GAAU,CAAC,CAAC,SAAA,IAAa,CAAC,CAAC,QAAA,EAAU,KAAA,EAAO,QAAA,EAAU,QAAA,CAAS,SAAS,CAAA;AAC9E,EAAA,MAAM,KAAA,GAAQ,EAAE,yBAAyB,CAAA;AACzC,EAAA,iBAAA,CAAkB,OAAO,CAAA;AAEzB,EAAA,MAAM,IAAA,GAAOC,OAAAA;AAAA,IACX,OAAO;AAAA,MACL,IAAA,EAAM,iBAAA;AAAA,MACN,KAAA;AAAA,MACA,eAAA,EAAiB,0BAAA;AAAA,MACjB,QAAA,EAAU,EAAE,MAAA,EAAQ,SAAA;AAAU,KAChC,CAAA;AAAA,IACA,CAAC,KAAK;AAAA,GACR;AAEA,EAAA,IAAI,CAAC,SAAS,OAAO,IAAA;AAErB,EAAA,uBACE3B,GAAAA,CAAC,KAAA,EAAA,EAAI,EAAA,EAAG,mBAAkB,aAAA,EAAY,SAAA,EACpC,QAAA,kBAAAA,GAAAA,CAAC,yBAAsB,IAAA,EAAY,KAAA,EAAO,EAAA,EAAI,QAAA,EAAU,OAAO,CAAA,EACjE,CAAA;AAEJ,CAAC","file":"chunk-HGNR4XBD.js","sourcesContent":["import { Suspense, useCallback, useMemo } from 'react';\nimport { product, ProductsListSource } from '../../api/product';\nimport { ProductCard } from '../../components/product';\nimport { ProductsSliderSkeleton, SallaProductsSlider } from '@salla.sa/twilight-components-react';\nimport { useTranslation } from '../../providers/I18nProvider';\n\ninterface ProductsSourceConfig {\n source: ProductsListSource;\n source_value?: number | number[] | null;\n}\n\nexport interface ProductsSliderProps {\n data: {\n products: ProductsSourceConfig;\n title?: string;\n display_all_url?: string;\n position?: number;\n priority?: boolean;\n show_controls?: boolean;\n controls_outer?: boolean;\n loop?: boolean;\n centered?: boolean;\n slides_per_view?: number | 'auto';\n direction?: 'rtl' | 'ltr';\n autoplay?: boolean;\n [key: string]: unknown;\n };\n}\n\nexport function ProductsSlider({ data }: ProductsSliderProps) {\n const { t } = useTranslation();\n const {\n products,\n title,\n display_all_url: displayAllUrl,\n position = 1,\n priority = false,\n show_controls: showControls,\n controls_outer: controlsOuter,\n loop,\n centered,\n slides_per_view: slidesPerView,\n direction,\n autoplay,\n } = data;\n\n const sliderProps = useMemo(\n () => ({\n id: `slider-${position}`,\n displayAllTitle: t('blocks.home.display_all', 'View All'),\n ...(showControls !== undefined && { showControls }),\n ...(controlsOuter !== undefined && { controlsOuter }),\n ...(loop !== undefined && { loop }),\n ...(centered !== undefined && { centered }),\n ...(slidesPerView !== undefined && { slidesPerView }),\n ...(direction !== undefined && { direction }),\n }),\n [position, t, showControls, controlsOuter, loop, centered, slidesPerView, direction]\n );\n\n const loader = useCallback(\n () =>\n product.list({\n source: products.source,\n sourceValue: products.source_value,\n }),\n [products.source, products.source_value]\n );\n\n return (\n <Suspense fallback={<ProductsSliderSkeleton />}>\n <SallaProductsSlider\n id={`best-offers-${position}-slider`}\n loader={loader}\n sliderProps={sliderProps}\n {...(displayAllUrl ? { displayAllUrl } : {})}\n {...(title ? { blockTitle: title } : {})}\n {...(autoplay !== undefined ? { autoplay } : {})}\n skeleton={<ProductsSliderSkeleton />}\n >\n {(product, index) => (\n <ProductCard product={product} imagePriority={priority && index < 2} />\n )}\n </SallaProductsSlider>\n </Suspense>\n );\n}\n","import { memo } from 'react';\nimport type { Feature } from '../../types';\n\nexport interface StoreFeaturesProps {\n data: {\n features: Feature[];\n [key: string]: unknown;\n };\n}\n\nexport const StoreFeatures = memo(function StoreFeatures({ data }: StoreFeaturesProps) {\n const { features } = data;\n\n if (!features.length) return null;\n\n return (\n <>\n <div className=\"grid grid-cols-[repeat(2,minmax(0,1fr))] md:grid-cols-[repeat(3,minmax(0,1fr))] gap-4 sm:gap-6 xl:gap-8\">\n {features.map((feature) => (\n <div\n key={`${feature.icon}:${feature.title}:${feature.description ?? ''}`}\n className=\"s-block--features__item\"\n >\n <div className=\"feature-icon\">\n <i className={feature.icon}></i>\n </div>\n <h2>{feature.title}</h2>\n <p>{feature.description}</p>\n </div>\n ))}\n </div>\n </>\n );\n});\n","import { memo } from 'react';\nimport { Link } from '../common';\n\nexport interface FixedBannerComponentProps {\n data: {\n image: {\n url: string;\n alt?: string;\n small_url?: string;\n };\n url?: string;\n title?: string;\n position?: number;\n [key: string]: unknown;\n };\n priority?: boolean;\n}\n\nexport const FixedBanner = memo(function FixedBanner(props: FixedBannerComponentProps) {\n const { data, priority = false } = props;\n const image = data.image?.url;\n\n if (!image) {\n return null;\n }\n\n const url = data.url;\n const altText = data.image.alt?.trim() ? data.image.alt : data.title || 'fixed banner';\n\n const imgProps = priority\n ? {\n loading: 'eager' as const,\n fetchPriority: 'high' as const,\n decoding: 'sync' as const,\n }\n : {\n loading: 'lazy' as const,\n decoding: 'async' as const,\n };\n\n const smallUrl = data.image.small_url;\n\n return (\n <>\n <div className=\"container\">\n <Link\n to={url || '#'}\n className=\"banner banner--fixed overflow-hidden\"\n aria-label={`Banner ${altText}`}\n >\n <picture>\n {smallUrl && <source media=\"(max-width: 767px)\" srcSet={smallUrl} />}\n <img\n width=\"1200\"\n height=\"300\"\n src={image}\n alt={altText}\n style={{ maxWidth: '100%', objectFit: 'contain' }}\n loading={imgProps.loading}\n decoding={imgProps.decoding}\n {...(priority && { fetchPriority: imgProps.fetchPriority })}\n />\n </picture>\n </Link>\n </div>\n </>\n );\n});\n","import { Suspense } from 'react';\nimport { useQuery } from '@tanstack/react-query';\nimport { FixedProductsSkeleton } from '@salla.sa/twilight-components-react';\nimport { Link } from '../common';\nimport { product, ProductsListSource } from '../../api/product';\nimport { ProductCard } from '../../components/product';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport { useTwilight } from '../../providers/TwilightProvider';\n\nexport interface FixedProductsProps {\n data: {\n products: { source: ProductsListSource; source_value?: number[] | null };\n title?: string;\n limit?: number | string;\n display_all_url?: string | null;\n key?: string | null;\n isVertical?: boolean;\n position?: number;\n [key: string]: unknown;\n };\n}\n\nexport function FixedProducts({ data }: FixedProductsProps) {\n const { t } = useTranslation();\n const { theme } = useTwilight();\n\n const title = data.title;\n // The merchant's product count: a number, or the same as a string. Anything that\n // isn't a positive whole number falls back to what the API returns.\n const parsedLimit = Number(data.limit);\n const limit = Number.isInteger(parsedLimit) && parsedLimit > 0 ? parsedLimit : undefined;\n // Matches Twig Raed: `theme.settings.get('vertical_fixed_products', true)`.\n const isVertical = data.isVertical ?? theme.settings.vertical_fixed_products ?? true;\n\n const { data: result, isLoading } = useQuery(\n product.queries.list({\n source: data.products.source,\n sourceValue: data.products?.source_value,\n perPage: limit,\n })\n );\n\n const products = result?.items ?? [];\n\n if (isLoading) {\n return <FixedProductsSkeleton />;\n }\n\n if (!products.length) return null;\n\n return (\n <Suspense fallback={<FixedProductsSkeleton />}>\n {title && (\n <div className=\"s-block__title\">\n <div className=\"right-side\">\n <h2>{title}</h2>\n </div>\n {data.display_all_url && (\n <Link to={data.display_all_url} className=\"s-block__display-all\">\n {t('blocks.home.display_all', 'View All')}\n <i className=\"sicon-arrow-left\"></i>\n </Link>\n )}\n </div>\n )}\n <div\n className={\n 's-products-list-wrapper ' +\n (isVertical ? 's-products-list-vertical-cards' : 's-products-list-horizontal-cards')\n }\n >\n {products.slice(0, limit).map((product) => (\n <ProductCard\n key={product.id}\n product={product}\n layout={isVertical ? 'vertical' : 'horizontal'}\n />\n ))}\n </div>\n </Suspense>\n );\n}\n","import { memo, useState, useCallback } from 'react';\nimport { SallaButton } from '@salla.sa/twilight-components-react/button';\nimport type { Product } from '../../types';\n\ninterface SectionItem {\n title?: string;\n name?: string;\n type?: string;\n id?: string;\n products?: Product[];\n limit?: number;\n}\n\ninterface MainProduct {\n id?: string;\n title?: string;\n value?: string;\n product?: Product;\n}\n\nexport interface FeaturedProductsStyle1Props {\n data: {\n items: SectionItem[];\n main_product?: MainProduct;\n position?: number;\n [key: string]: unknown;\n };\n}\n\nexport const FeaturedProductsStyle1 = memo(function FeaturedProductsStyle1({\n data,\n}: FeaturedProductsStyle1Props) {\n const items = data.items || [];\n const mainProduct = data.main_product;\n\n const [activeTab, setActiveTab] = useState<string>(items[0]?.id || '');\n const [isAnimating, setIsAnimating] = useState(false);\n\n const handleTabClick = useCallback(\n (tabId: string) => {\n if (tabId === activeTab) return;\n setIsAnimating(true);\n setActiveTab(tabId);\n setTimeout(() => setIsAnimating(false), 100);\n },\n [activeTab]\n );\n\n if (!items.length) return null;\n\n const hasMultipleSections = items.length > 1;\n\n return (\n <>\n <div className=\"s-block__title\">\n <div className=\"right-side\">\n <h2>{mainProduct?.title}</h2>\n </div>\n {hasMultipleSections && (\n <div className=\"tabs hide-scroll hidden lg:flex\">\n {items.map((section) => (\n <SallaButton\n key={section.id}\n shape=\"link\"\n onClick={() => handleTabClick(section.id || '')}\n className={`tab-trigger ${activeTab === section.id ? 'is-active' : ''}`}\n >\n {section.title || section.name}\n </SallaButton>\n ))}\n </div>\n )}\n </div>\n\n <div className={`grid grid-cols-1 gap-8 ${mainProduct?.product ? 'lg:grid-cols-2' : ''}`}>\n {mainProduct?.product && (\n <div className=\"flex flex-col\">\n <custom-salla-product-card\n shadow-on-hover\n product={JSON.stringify(mainProduct.product)}\n isSpecial\n ></custom-salla-product-card>\n </div>\n )}\n <div className=\"flex flex-col\">\n {hasMultipleSections && (\n <div className=\"tabs mb-4 sm:mb-8 hide-scroll lg:hidden\">\n {items.map((section) => (\n <SallaButton\n key={section.id}\n shape=\"link\"\n onClick={() => handleTabClick(section.id || '')}\n className={`tab-trigger ${activeTab === section.id ? 'is-active' : ''}`}\n >\n {section.title || section.name}\n </SallaButton>\n ))}\n </div>\n )}\n\n <div className=\"tabs-wrapper flex flex-1\">\n {items.map((section) => {\n const isActive = activeTab === section.id;\n return (\n <div\n key={section.id}\n className={`tabs__item grid-cols-2 ${mainProduct?.product ? '' : 'lg:grid-cols-4'} ${isActive ? 'is-active' : ''} ${isAnimating && isActive ? 'opacity-0 translate-y-3' : ''} ${!isAnimating && isActive ? 'opacity-100 translate-y-0' : ''}`}\n >\n {section.products\n ?.slice(0, mainProduct?.product ? 4 : 8)\n .map((product, productIndex) => (\n <custom-salla-product-card\n key={product.id || productIndex}\n product={JSON.stringify(product)}\n ></custom-salla-product-card>\n ))}\n </div>\n );\n })}\n </div>\n </div>\n </div>\n </>\n );\n});\n","import { memo, useState, useCallback } from 'react';\nimport { SallaButton } from '@salla.sa/twilight-components-react/button';\nimport { SallaProductsList } from '@salla.sa/twilight-components-react';\nimport { SallaProductsSlider } from '@salla.sa/twilight-components-react';\nimport { product, ProductsListSource } from '../../api/product';\nimport { ProductCard } from '../../components/product';\nimport { useTwilight } from '../../providers/TwilightProvider';\n\ninterface ProductSource {\n source: ProductsListSource;\n limit?: number;\n source_value?: number | number[];\n}\n\ninterface SectionItem {\n title?: string;\n name?: string;\n type?: string;\n id?: string;\n products: ProductSource;\n limit?: number;\n}\n\nexport interface FeaturedProductsStyle2Props {\n data: {\n items: SectionItem[];\n position?: number;\n is_slider?: boolean;\n [key: string]: unknown;\n };\n}\n\n// Like Twig Raed, the grid honors `vertical_fixed_products`; the slider never does.\nexport const FeaturedProductsStyle2 = memo(function FeaturedProductsStyle2({\n data,\n}: FeaturedProductsStyle2Props) {\n const { theme } = useTwilight();\n const items = data.items || [];\n const isSlider = data.is_slider ?? true;\n const cardLayout = (theme.settings.vertical_fixed_products ?? true) ? 'vertical' : 'horizontal';\n\n const [activeTab, setActiveTab] = useState<string>(items[0]?.id || '');\n const [isAnimating, setIsAnimating] = useState(false);\n\n const handleTabClick = useCallback(\n (tabId: string) => {\n if (tabId === activeTab) return;\n setIsAnimating(true);\n setActiveTab(tabId);\n setTimeout(() => setIsAnimating(false), 100);\n },\n [activeTab]\n );\n\n const loader = useCallback(\n (source: ProductsListSource, value?: number | number[], limit?: number) => {\n return () =>\n product.list({\n source: source,\n sourceValue: value,\n perPage: limit,\n });\n },\n []\n );\n\n if (!items.length) return null;\n\n const hasMultipleSections = items.length > 1;\n\n return (\n <>\n <div className=\"container\">\n {hasMultipleSections && (\n <div className=\"tabs hide-scroll\">\n {items.map((section) => (\n <SallaButton\n key={section.id}\n fill=\"outline\"\n onClick={() => handleTabClick(section.id || '')}\n className={`tab-trigger ${activeTab === section.id ? 'is-active' : ''}`}\n >\n {section.title || section.name}\n </SallaButton>\n ))}\n </div>\n )}\n\n <div className=\"tabs-wrapper\">\n {items.map((section) => {\n const isActive = activeTab === section.id;\n return (\n <div\n key={section.id}\n className={`tabs__item ${isActive ? 'is-active' : ''} ${isAnimating && isActive ? 'opacity-0 translate-y-3' : ''} ${!isAnimating && isActive ? 'opacity-100 translate-y-0' : ''}`}\n >\n {isSlider ? (\n <SallaProductsSlider\n loader={loader(\n section.products.source,\n section.products?.source_value,\n section.products?.limit\n )}\n sliderProps={{ id: `section-${section.id}-slider` }}\n >\n {(product) => (\n <ProductCard className=\"s-products-slider-card\" product={product} />\n )}\n </SallaProductsSlider>\n ) : (\n <SallaProductsList\n loader={loader(\n section.products.source,\n section.products?.source_value,\n section.products?.limit\n )}\n itemsClassName={`s-products-list-${cardLayout}-cards`}\n >\n {(products) =>\n products.map((product) => (\n <ProductCard key={product.id} product={product} layout={cardLayout} />\n ))\n }\n </SallaProductsList>\n )}\n </div>\n );\n })}\n </div>\n </div>\n </>\n );\n});\n","import { memo } from 'react';\nimport { ProductCard } from '../product/ProductCard';\nimport type { Product } from '../../types';\n\ninterface SectionItem {\n title?: string;\n name?: string;\n type?: string;\n products?: Product[];\n featured_product?: Product;\n limit?: number;\n id?: string;\n}\n\nexport interface FeaturedProductsStyle3Props {\n data: {\n items: SectionItem[];\n position?: number;\n [key: string]: unknown;\n };\n}\n\nexport const FeaturedProductsStyle3 = memo(function FeaturedProductsStyle3({\n data,\n}: FeaturedProductsStyle3Props) {\n const items = data.items || [];\n\n if (!items.length) return null;\n\n return (\n <>\n <div className=\"inner\">\n {items.map((section, sectionIndex) => (\n <div key={section.id || sectionIndex}>\n <div className=\"s-block__title\">\n <h2>{section.title}</h2>\n </div>\n <div className=\"flex-1 grid lg:grid-cols-2 gap-4 sm:gap-8\">\n {section.featured_product ? (\n <>\n <ProductCard product={section.featured_product} layout=\"fullImage\" withShadow />\n <div className=\"grid gap-4 sm:gap-8\">\n {section.products?.slice(0, 3).map((product, idx) => (\n <ProductCard\n key={product.id}\n product={product}\n layout=\"minimal\"\n withShadow\n index={idx}\n />\n ))}\n </div>\n </>\n ) : (\n section.products?.map((product, idx) => (\n <ProductCard\n key={product.id}\n product={product}\n layout=\"minimal\"\n withShadow\n index={idx}\n />\n ))\n )}\n </div>\n </div>\n ))}\n </div>\n </>\n );\n});\n","import { memo } from 'react';\nimport { Link } from '../common';\n\ninterface ImageData {\n url?: string;\n}\n\nexport interface ParallaxBackgroundProps {\n data: {\n image: ImageData;\n url?: string;\n title?: string;\n link_text?: string;\n is_opacity?: boolean;\n position?: number;\n [key: string]: unknown;\n };\n}\n\nexport const ParallaxBackground = memo(function ParallaxBackground({\n data,\n}: ParallaxBackgroundProps) {\n const { image, url, title, link_text: linkText, is_opacity: isOpacity = false } = data;\n\n if (!image?.url) return null;\n\n return (\n <>\n <div className=\"full-banner-entry\" style={{ backgroundImage: `url(${image.url})` }}>\n <div\n className={`overlay h-full w-full ${isOpacity ? 'bg-black' : ''} opacity-60 absolute top-0 left-0`}\n ></div>\n <div className=\"flex h-full items-center justify-center p-5 xs:p-11 relative\">\n <div>\n {title && <h2 className=\"text-2xl font-bold leading-12\">{title}</h2>}\n\n {url && linkText && (\n <Link\n to={url}\n className=\"inline-block text-white text-sm border rounded-md font-bold px-8 py-4\"\n >\n {linkText}\n </Link>\n )}\n </div>\n </div>\n </div>\n </>\n );\n});\n","import { memo } from 'react';\nimport { SallaSlider } from '@salla.sa/twilight-components-react/slider';\nimport { Link, Image } from '../common';\n\ninterface PhotoItem {\n id?: string | number;\n url?: string;\n link_type?: string;\n image?: string;\n}\n\nexport interface PhotosSliderProps {\n data: {\n items: PhotoItem[];\n position?: number;\n is_repeated?: boolean;\n [key: string]: unknown;\n };\n}\n\nexport const PhotosSlider = memo(function PhotosSlider({ data }: PhotosSliderProps) {\n const items = data.items || [];\n const position = data.position ?? 1;\n\n if (!items.length) return null;\n\n return (\n <>\n <SallaSlider\n type=\"carousel\"\n className=\"home-slider photos-slider\"\n centered\n autoPlay\n pagination\n id={`photos-${position}-slider`}\n sliderConfig={{ watchOverflow: true }}\n >\n <div slot=\"items\">\n {items.map((item, index) => (\n <div\n key={item.id ?? `${item.url ?? ''}:${item.image ?? ''}`}\n className=\"swiper-slide\"\n style={{ aspectRatio: '1200/300' }}\n >\n <Link to={item.url || '#'}>\n <Image\n src={item.image}\n className=\"w-full h-full object-contain rounded-md\"\n alt={`image-slider-${index}`}\n width={1200}\n height={300}\n priority={index === 0}\n />\n </Link>\n </div>\n ))}\n </div>\n </SallaSlider>\n </>\n );\n});\n","import { memo } from 'react';\nimport { Link } from '../common';\n\ninterface ImageData {\n url?: string;\n alt?: string;\n}\n\ninterface SquarePhotoItem {\n id?: string | number;\n url?: string;\n link_type?: string;\n /** The Store API sends the URL itself to the engine; Twig gets `{ url, alt }`. */\n image?: string | ImageData;\n text?: string;\n}\n\nconst imageUrl = (item: SquarePhotoItem) =>\n typeof item.image === 'string' ? item.image : item.image?.url;\n\nexport interface SquarePhotosProps {\n data: {\n title?: string;\n items: SquarePhotoItem[];\n position?: number;\n [key: string]: unknown;\n };\n}\n\nexport const SquarePhotos = memo(function SquarePhotos({ data }: SquarePhotosProps) {\n const items = data.items || [];\n const title = data.title;\n\n if (!items.length) return null;\n\n const gridCols =\n items.length <= 3 ? `one-row md:grid-cols-${items.length}` : 'md:grid-cols-3 two-row';\n\n return (\n <>\n {title && (\n <div className=\"s-block__title\">\n <div className=\"right-side\">\n <h2>{title}</h2>\n </div>\n </div>\n )}\n\n <div className={`grid ${gridCols} grid-flow-row gap-3 sm:gap-8`}>\n {items.map((item) => (\n <Link\n {...(item.link_type === 'external_link' ? { target: '_blank' } : {})}\n key={item.id ?? imageUrl(item) ?? item.url}\n className={`banner-entry square-photos ${item.text ? 'has-overlay with-hover' : ''}`}\n style={{ backgroundImage: `url(${imageUrl(item)})` }}\n to={item.url || '#'}\n >\n {item.text && (\n <h3 className=\"text-with-border\">\n <span>{item.text}</span>\n </h3>\n )}\n </Link>\n ))}\n </div>\n </>\n );\n});\n","import { memo, useEffect, useState } from 'react';\n\nexport interface YoutubeProps {\n data: {\n youtube_id: string;\n position?: number;\n [key: string]: unknown;\n };\n}\n\nexport const Youtube = memo(function Youtube({ data }: YoutubeProps) {\n const { youtube_id: youtubeId } = data;\n const [isLoaded, setIsLoaded] = useState(false);\n\n useEffect(() => {\n if (!youtubeId) return;\n\n // Lazy load the lite-youtube web component\n let mounted = true;\n import('@justinribeiro/lite-youtube')\n .then(() => {\n if (mounted) setIsLoaded(true);\n })\n .catch((err) => {\n console.error('Failed to load lite-youtube:', err);\n });\n\n return () => {\n mounted = false;\n };\n }, [youtubeId]);\n\n if (!youtubeId) return null;\n\n return (\n <>\n <div className=\"container\">\n <div className=\"videoWrapper\">\n {isLoaded ? (\n <lite-youtube videoid={youtubeId} params=\"rel=0\"></lite-youtube>\n ) : (\n <div className=\"animate-pulse bg-gray-200 w-full h-full min-h-[300px] rounded\" />\n )}\n </div>\n </div>\n </>\n );\n});\n","import { memo, useState, useEffect, type CSSProperties } from 'react';\n\n// Placeholder hints a bundle declares per component under `props` in its\n// twilight-bundle.json; the store API passes them as `component_props`. Each maps 1:1 to an\n// attribute on <salla-custom-component>, which reserves the component's space until the\n// bundle renders.\n// @see https://github.com/SallaApp/twilight-bundles/blob/master/packages/starter-kit/README.md#component-skeleton--placeholder\nconst SIZE_PROPS = ['min-height', 'height', 'width', 'aspect-ratio'] as const;\nconst SKELETON_PROPS: readonly string[] = [...SIZE_PROPS, 'skeleton-style'];\n\ntype SkeletonProps = Record<string, string>;\n\nexport interface BundleComponentProps {\n data: {\n component_name: string;\n bundle_id: string;\n component_props?: SkeletonProps;\n [key: string]: unknown;\n };\n}\n\nfunction pickSkeletonProps(props: unknown): SkeletonProps {\n if (!props || typeof props !== 'object') return {};\n return Object.fromEntries(\n Object.entries(props).filter(\n ([name, value]) =>\n SKELETON_PROPS.includes(name) && typeof value === 'string' && value.trim() !== ''\n )\n ) as SkeletonProps;\n}\n\n// Until mount there is no <salla-custom-component>, so hold the same footprint with a plain\n// block — otherwise the server HTML has nothing here and the page shifts once it mounts.\nfunction reservedSizeStyle(props: SkeletonProps): CSSProperties | undefined {\n const sizes = SIZE_PROPS.filter((name) => props[name]);\n if (!sizes.length) return undefined;\n return Object.fromEntries(\n sizes.map((name) => [\n name.replace(/-([a-z])/g, (_, char: string) => char.toUpperCase()),\n props[name],\n ])\n ) as CSSProperties;\n}\n\nexport const BundleComponent = memo(function BundleComponent(props: BundleComponentProps) {\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n const {\n component_name: componentName,\n bundle_id: bundleId,\n component_props: componentProps,\n ...rest\n } = props.data;\n const skeletonProps = pickSkeletonProps(componentProps);\n\n if (!mounted) {\n const style = reservedSizeStyle(skeletonProps);\n return style ? <div aria-hidden=\"true\" style={style} /> : null;\n }\n\n const config = JSON.stringify(rest);\n\n return (\n <>\n <salla-custom-component\n component-name={componentName}\n bundle-id={bundleId}\n config={config}\n {...skeletonProps}\n suppressHydrationWarning\n />\n </>\n );\n});\n","import { lazyComponent } from '../../utils/lazy-component';\n\nexport { ProductsSlider as LazyProductsSlider } from './ProductsSlider';\nexport { StoreFeatures as LazyStoreFeatures } from './StoreFeatures';\nexport { FixedBanner as LazyFixedBanner } from './FixedBanner';\nexport { FixedProducts as LazyFixedProducts } from './FixedProducts';\n// Only a home page with no blocks shows it, so most stores never load it.\nexport const LazyLatestProducts = lazyComponent(() =>\n import('./LatestProducts').then((m) => ({ default: m.LatestProducts }))\n);\nexport { FeaturedProductsStyle1 as LazyFeaturedProductsStyle1 } from './FeaturedProductsStyle1';\nexport { FeaturedProductsStyle2 as LazyFeaturedProductsStyle2 } from './FeaturedProductsStyle2';\nexport { FeaturedProductsStyle3 as LazyFeaturedProductsStyle3 } from './FeaturedProductsStyle3';\nexport { ParallaxBackground as LazyParallaxBackground } from './ParallaxBackground';\nexport { PhotosSlider as LazyPhotosSlider } from './PhotosSlider';\nexport { SquarePhotos as LazySquarePhotos } from './SquarePhotos';\nexport const LazyTestimonials = lazyComponent(() =>\n import('./Testimonials').then((m) => ({ default: m.Testimonials }))\n);\nexport { Youtube as LazyYoutube } from './Youtube';\nexport { BundleComponent as LazyBundleComponent } from './BundleComponent';\n","import {\n LazyProductsSlider,\n LazyStoreFeatures,\n LazyFixedBanner,\n LazyFixedProducts,\n LazyLatestProducts,\n LazyFeaturedProductsStyle1,\n LazyFeaturedProductsStyle2,\n LazyFeaturedProductsStyle3,\n LazyParallaxBackground,\n LazyPhotosSlider,\n LazySquarePhotos,\n LazyTestimonials,\n LazyYoutube,\n LazyBundleComponent,\n} from './lazy';\nimport type { AnyHomeComponent } from './types';\nimport { registry } from '../ComponentRegistry';\n\nexport const DefaultHomeComponents: Record<string, AnyHomeComponent | null> = {\n 'fixed-banner': LazyFixedBanner,\n 'photos-slider': LazyPhotosSlider,\n testimonial: LazyTestimonials,\n 'store-features': LazyStoreFeatures,\n youtube: LazyYoutube,\n 'square-photos': LazySquarePhotos,\n 'fixed-products': LazyFixedProducts,\n 'latest-products': LazyLatestProducts,\n 'products-slider': LazyProductsSlider,\n 'parallax-background': LazyParallaxBackground,\n 'featured-products:style1': LazyFeaturedProductsStyle1,\n 'featured-products:style2': LazyFeaturedProductsStyle2,\n 'featured-products:style3': LazyFeaturedProductsStyle3,\n 'bundle-component': LazyBundleComponent,\n};\n\nexport function registerHomeComponents(\n components: Record<string, AnyHomeComponent | null> = DefaultHomeComponents,\n prefix = 'home:'\n): void {\n Object.entries(components).forEach(([path, component]) => {\n if (component) {\n registry.register(`${prefix}${path}`, component);\n }\n });\n}\n","import { Component, type ReactNode, type ErrorInfo } from 'react';\nimport { TwilightContext } from '../../providers/twilight-context';\nimport type { TwilightContextValue } from '../../types/twilight';\nimport type { HomeComponentData } from '../../types';\n\ninterface ComponentErrorBoundaryProps {\n children: ReactNode;\n data: HomeComponentData;\n position: number;\n}\n\ninterface ComponentErrorBoundaryState {\n hasError: boolean;\n error: Error | null;\n}\n\nfunction DevelopmentErrorCard({ error, data }: { error: Error; data: HomeComponentData }) {\n return (\n <section\n dir=\"ltr\"\n className=\"s-block container overflow-hidden bg-red-50 border border-red-300 p-4\"\n >\n <p className=\"text-red-800 text-sm font-bold\">Home Component Error: {data.path}</p>\n <p className=\"text-red-700 text-sm mt-2\">{error.message}</p>\n <details className=\"mt-2\">\n <summary className=\"text-xs cursor-pointer text-red-600\">Stack Trace</summary>\n <pre className=\"text-xs mt-1 overflow-auto max-h-32 text-red-700\">{error.stack}</pre>\n </details>\n <details className=\"mt-2\">\n <summary className=\"text-xs cursor-pointer text-red-600\">Component Data</summary>\n <pre className=\"text-xs mt-1 overflow-auto max-h-32 text-red-700\">\n {JSON.stringify(data, null, 2)}\n </pre>\n </details>\n </section>\n );\n}\n\nexport class ComponentErrorBoundary extends Component<\n ComponentErrorBoundaryProps,\n ComponentErrorBoundaryState\n> {\n static contextType = TwilightContext;\n\n declare context: TwilightContextValue | null;\n\n constructor(props: ComponentErrorBoundaryProps) {\n super(props);\n this.state = { hasError: false, error: null };\n }\n\n static getDerivedStateFromError(error: Error): ComponentErrorBoundaryState {\n return { hasError: true, error };\n }\n\n // Blocks are keyed by position, so a replacement block at the same position reuses\n // this boundary. An error belongs to the block that threw it, not the position.\n componentDidUpdate(prevProps: ComponentErrorBoundaryProps): void {\n if (this.state.hasError && prevProps.data !== this.props.data) {\n this.setState({ hasError: false, error: null });\n }\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n if (!this.context) {\n console.error('[ComponentErrorBoundary] Must be used within TwilightProvider');\n return;\n }\n const { log } = this.context;\n const { data, position } = this.props;\n\n log.groupCollapsed(`HomeComponent Error: ${data.path || 'unknown'}`);\n log.error('ERROR', error.message);\n log.label('COMPONENT', data.path || 'unknown');\n log.label('POSITION', position);\n log.label('URL', typeof window !== 'undefined' ? window.location.href : 'SSR');\n log.label('TIME', new Date().toISOString());\n log.trace('STACK TRACE', error.stack || '');\n log.trace('COMPONENT STACK', errorInfo.componentStack || '');\n log.dir('COMPONENT DATA', data);\n log.groupEnd();\n }\n\n render(): ReactNode {\n const { hasError, error } = this.state;\n const { children, data } = this.props;\n\n if (hasError && error) {\n if (process.env.NODE_ENV === 'production') {\n return null;\n }\n\n return <DevelopmentErrorCard error={error} data={data} />;\n }\n\n return children;\n }\n}\n","import { memo, useEffect, useRef, type ReactNode } from 'react';\nimport { registry } from '../ComponentRegistry';\nimport { RenderWhenVisible } from '../common';\nimport { ComponentErrorBoundary } from './ComponentErrorBoundary';\nimport type { AnyHomeComponent } from './index';\nimport type { HomeComponentData } from '../../types';\nimport {\n BackgroundSliderSkeleton,\n BulletDeliverySkeleton,\n FixedProductsSkeleton,\n ListSkeleton,\n ProductsSliderSkeleton,\n Pulse,\n ReviewItemSkeleton,\n SliderSkeleton,\n} from '@salla.sa/twilight-components-react';\n\nfunction SquareGridSkeleton() {\n return (\n <div className=\"s-block container grid grid-cols-2 sm:grid-cols-4 gap-4 py-8\">\n {[1, 2, 3, 4].map((i) => (\n <Pulse key={i} className=\"aspect-square\" />\n ))}\n </div>\n );\n}\n\nexport type HomeComponentsProps = {\n data: HomeComponentData & {\n position?: number;\n [key: string]: unknown;\n };\n};\n\n/**\n * Fallback component for unknown/unregistered components\n * Only shows in development mode\n */\nconst FallbackComponent = memo(function FallbackComponent({ data }: HomeComponentsProps) {\n if (process.env.NODE_ENV === 'production') return null;\n\n return (\n <section\n dir=\"ltr\"\n className=\"s-block container overflow-hidden bg-yellow-50 border border-yellow-200 p-4\"\n >\n <p className=\"text-yellow-800 text-sm\">\n <strong>Unknown component:</strong> {data.path}\n </p>\n <p className=\"text-yellow-700 text-xs mt-1\">\n Register it in setup.ts: <code>registry.register('home:{data.path}', YourComponent)</code>\n </p>\n <details className=\"mt-2\">\n <summary className=\"text-xs cursor-pointer\">Component Data</summary>\n <pre className=\"text-xs mt-1 overflow-auto max-h-32\">{JSON.stringify(data, null, 2)}</pre>\n </details>\n </section>\n );\n});\n\n/**\n * Get the React component for a given home component path\n * Looks up from registry only - theme must register components\n */\nfunction getComponentByPath(data: HomeComponentData): AnyHomeComponent {\n const { path, view_style: viewStyle } = data;\n\n // 1. Check for view_style variant first\n if (viewStyle) {\n const variantKey = `home:${path}:${viewStyle}`;\n const variant = registry.resolve(variantKey);\n if (variant) {\n return variant as AnyHomeComponent;\n }\n }\n\n // 2. Check registry for component\n const registryKey = `home:${path}`;\n const component = registry.resolve(registryKey);\n if (component) {\n return component as AnyHomeComponent;\n }\n\n // 3. Fallback for unknown components\n return FallbackComponent;\n}\n\n/** Same breakpoint and rules the Store injects for Twig themes (`ComponentVisibilityStyles`). */\nconst CHANNEL_VISIBILITY_CSS =\n '@media (max-width:767.98px){.s-hide-on-mobile{display:none!important}}' +\n '@media (min-width:768px){.s-hide-on-desktop{display:none!important}}';\n\n/**\n * Hide class for the merchant's per-channel pick. A missing key, or one that\n * hides on both channels, means visible everywhere: hiding a block outright\n * is the `is_visible` toggle's job, and stores without the feature send no key.\n */\nexport function channelVisibilityClass(data: HomeComponentData): string {\n const raw = data.channel_visibility;\n if (!raw || typeof raw !== 'object') return '';\n const desktop = raw.desktop !== false;\n const mobile = raw.mobile !== false;\n if (desktop && !mobile) return 's-hide-on-mobile';\n if (mobile && !desktop) return 's-hide-on-desktop';\n return '';\n}\n\n/**\n * Render-shell config for a home block: the values the lazy-load wrapper\n * (`RenderWhenVisible`) needs *before* the block mounts — reserved height, the\n * skeleton placeholder, and the wrapper's className/id.\n *\n * Themes register config for blocks they own via `registerHomeComponentConfig`;\n * the engine knows nothing about theme-specific blocks.\n */\nexport type HomeComponentConfig = {\n height?: string;\n className?: string | ((data: HomeComponentData) => string);\n id?: string | ((data: HomeComponentData) => string);\n placeholder?: ReactNode;\n /** Mount on page load instead of when the block nears the viewport. */\n renderOnMount?: boolean;\n};\n\nconst COMPONENT_CONFIG: Record<string, HomeComponentConfig> = {\n 'products-slider': { height: '450px', placeholder: <ProductsSliderSkeleton /> },\n 'fixed-products': { height: '450px', placeholder: <FixedProductsSkeleton /> },\n 'latest-products': {\n height: '450px',\n placeholder: <FixedProductsSkeleton />,\n // As in Twig Raed's `latest-products.twig`.\n className: 's-block s-block--latest-products container mt-6 sm:mt-8',\n },\n 'featured-products': {\n height: '450px',\n placeholder: <ProductsSliderSkeleton />,\n className: (data) => {\n const style = data.view_style;\n if (style === 'style1')\n return 's-block s-block--featured-products s-block-tabs s-block--special-products container tabs-initialized';\n if (style === 'style2')\n return `s-block s-block--featured-products s-block-tabs s-block--tabs-produtcs s-block--full-bg tabs-initialized ${data.is_slider ? 'as-slider' : 'as-grid'} bg-gray-100 py-8 sm:py-16`;\n if (style === 'style3')\n return `s-block s-block--featured-products s-block--features-products${Array.isArray(data.items) && data.items.length > 1 ? ' two-cols' : ''} container`;\n return 's-block s-block--featured-products container overflow-hidden';\n },\n id: (data) => `featured-products-${data.view_style}-${data.position ?? 0}`,\n },\n testimonial: { height: '350px', placeholder: <ReviewItemSkeleton /> },\n 'store-features': { height: '200px', placeholder: <BulletDeliverySkeleton /> },\n 'parallax-background': { height: '500px', placeholder: <BackgroundSliderSkeleton /> },\n 'fixed-banner': { height: '350px', placeholder: <BackgroundSliderSkeleton /> },\n 'photos-slider': {\n height: 'clamp(130px, 30vw, 350px)',\n placeholder: <SliderSkeleton />,\n className: (data) =>\n `s-block s-block--photos-slider${data.is_repeated ? ' repeated-block' : ''}`,\n },\n 'square-photos': { height: '250px', placeholder: <SquareGridSkeleton /> },\n youtube: { height: '350px', placeholder: <SliderSkeleton /> },\n 'bundle-component': {\n // As in Twig: reserve nothing, the bundle grows the block from 0.\n height: '0px',\n placeholder: <></>,\n className: (data) => `s-block s-block--bundle-${data.component_name}`,\n // As in Twig, where merchant scripts wait a limited time for the bundle's markup.\n renderOnMount: true,\n },\n 'main-links': {\n height: '200px',\n placeholder: <ListSkeleton />,\n className: (data) => {\n const mergeWithTop = data.merge_links_with_top_component;\n const position = data.position;\n return [\n 's-block',\n 's-block--main-links',\n mergeWithTop && position ? 'merge-with-top-component' : '',\n !data.title && mergeWithTop ? 'merged-has-no-title' : '',\n ]\n .filter(Boolean)\n .join(' ');\n },\n },\n 'square-links': { height: '200px', placeholder: <SquareGridSkeleton /> },\n};\n\n/**\n * Theme-registered render-shell config, keyed by home component path. Themes own\n * the display of their blocks by registering config here; at render time a path's\n * theme entry replaces (not field-merges) the engine's built-in `COMPONENT_CONFIG`\n * entry for that path.\n */\nconst themeComponentConfig: Record<string, HomeComponentConfig> = {};\n\n/**\n * Register render-shell config for home blocks a theme owns (height, placeholder,\n * className, id). Merges by path and overwrites existing keys, so it is safe to\n * call more than once and idempotent for the same keys.\n */\nexport function registerHomeComponentConfig(config: Record<string, HomeComponentConfig>): void {\n Object.assign(themeComponentConfig, config);\n}\n\n/**\n * Resolve a block's render-shell config: theme-registered config takes precedence\n * over the engine's built-in config; returns `undefined` when neither defines the\n * path so the renderer can apply generic defaults.\n */\nfunction resolveComponentConfig(path: string): HomeComponentConfig | undefined {\n return themeComponentConfig[path] ?? COMPONENT_CONFIG[path];\n}\n\n/**\n * What the theme editor addresses a block by: the dev editor's layout id (less\n * the remount suffix), its row id, or the uuid of one not saved yet. The layout\n * id comes first: a customized layout keeps the store blocks' row ids among\n * their fields, and duplicates share them. A built-in block (fixed products,\n * YouTube, …) has neither id nor key, so it goes by its path, which the\n * editor matches to the block's slug; the bar says which copy. A block the\n * engine adds itself (`editable: false`) is not the merchant's, so it has none.\n */\nfunction liveBlockIdOf(data: HomeComponentData, editable?: boolean): string | undefined {\n if (editable === false) return undefined;\n const devId = typeof data.__dev_id === 'string' ? data.__dev_id.replace(/~\\d+$/, '') : undefined;\n const id = devId ?? data.id ?? data.key;\n if (typeof id === 'number' || (typeof id === 'string' && id)) return String(id);\n return data.path || undefined;\n}\n\n/**\n * Memoized component renderer with scroll-based lazy loading\n * Components only mount when scrolled into view - preventing API calls until needed\n */\nexport const HomeComponentRenderer = memo(function HomeComponentRenderer({\n data,\n index,\n priority,\n editable,\n}: {\n data: HomeComponentData;\n index: number;\n /** Mount right away with eager images. Defaults to the first three blocks of the page. */\n priority?: boolean;\n /** False for a block the engine adds, not the merchant: the theme editor's bar leaves it alone. */\n editable?: boolean;\n}) {\n const renderCountRef = useRef(0);\n renderCountRef.current += 1;\n\n if (process.env.NODE_ENV === 'development') {\n console.log(\n `[HomeComponentRenderer] RENDER: path=${data.path}, index=${index}, renderCount=${renderCountRef.current}`\n );\n }\n\n useEffect(() => {\n console.log(\n `[HomeComponentRenderer] MOUNT: path=${data.path}, index=${index}, renderCount=${renderCountRef.current}`\n );\n return () => {\n console.log(`[HomeComponentRenderer] UNMOUNT: path=${data.path}, index=${index}`);\n };\n }, [data.path, index]);\n\n const isFirstComponent = priority ?? index <= 2;\n const Component = getComponentByPath(data);\n\n const config = resolveComponentConfig(data.path);\n\n const resolvedClassName = config?.className\n ? typeof config.className === 'function'\n ? config.className(data)\n : config.className\n : `s-block s-block--${data.path}`;\n const hideClass = channelVisibilityClass(data);\n const resolvedId = config?.id\n ? typeof config.id === 'function'\n ? config.id(data)\n : config.id\n : undefined;\n const liveBlockId = liveBlockIdOf(data, editable);\n const height = config?.height || '400px';\n // A theme's config replaces the engine's, but keeps its mount timing unless the theme sets one.\n const renderOnMount = config?.renderOnMount ?? COMPONENT_CONFIG[data.path]?.renderOnMount;\n\n const content = (\n <ComponentErrorBoundary data={data} position={index + 1}>\n <Component data={{ ...data, position: index + 1, priority: isFirstComponent }} />\n </ComponentErrorBoundary>\n );\n\n return (\n <>\n {hideClass && (\n <style href=\"twilight-channel-visibility\" precedence=\"default\">\n {CHANNEL_VISIBILITY_CSS}\n </style>\n )}\n <RenderWhenVisible\n rootMargin=\"50px\"\n className={hideClass ? `${resolvedClassName} ${hideClass}` : resolvedClassName}\n id={resolvedId}\n estimatedHeight={height}\n renderOnMount={isFirstComponent || renderOnMount === true}\n placeholder={config?.placeholder ?? <ProductsSliderSkeleton />}\n // Dev only: lets the theme editor scroll the preview to a block.\n blockIndex={import.meta.env.DEV ? index : undefined}\n liveBlockId={liveBlockId}\n >\n {content}\n </RenderWhenVisible>\n </>\n );\n});\n","import { memo } from 'react';\nimport { useQuery } from '@tanstack/react-query';\nimport { home, type BlockScope } from '../../api/home';\nimport { HomeComponentRenderer } from './HomePageRenderer';\n\nexport interface PageBlocksProps {\n /** The page hook the merchant placed the blocks at, e.g. `product.single.before_customer_reviews`. */\n hook: string;\n /** The product, category or page being shown. */\n scope: BlockScope;\n}\n\n/** Draws the blocks placed at a product, category or page hook, loaded in the browser. */\nexport const PageBlocks = memo(function PageBlocks({ hook, scope }: PageBlocksProps) {\n const { data: blocks = [] } = useQuery(home.queries.blocks(hook, scope));\n\n return (\n <>\n {blocks.map((data, index) => (\n <HomeComponentRenderer key={index} data={data} index={index} priority={false} />\n ))}\n </>\n );\n});\n","import { useEffect } from 'react';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport { whenSallaLoaded } from '../../utils/sdk-helpers';\n\ninterface ReorderLabels {\n /** The add button's text in a reorder list. */\n add: string;\n /** Its text for an out-of-stock product. */\n outOfStock: string;\n}\n\nlet registered = false;\n\n/**\n * Twig's ReorderProductsWidget script: inside a reorder list the add button reads the block's\n * title and adds the product as the customer last ordered it. The SDK has no way to remove a\n * hook, so it is registered once per page load.\n */\nfunction registerReorderHooks(labels: ReorderLabels): void {\n if (registered) return;\n registered = true;\n whenSallaLoaded((sdk) => {\n sdk.hooks?.registerHook?.('salla-add-product-button', 'componentDidLoad', (component) => {\n if (!component.host?.closest('[source=\"reorder\"], [data-source=\"reorder\"]')) return;\n const isOutOfStock =\n component.productStatus === 'out' || component.productStatus === 'out-and-notify';\n const setLabel = () => component.btn?.setText(isOutOfStock ? labels.outOfStock : labels.add);\n setLabel();\n sdk.lang?.onLoaded?.(setLabel);\n if (isOutOfStock) return;\n component.addProductToCart = async (event: Event) => {\n event.preventDefault();\n // The click lands on the inner button, which has no product-id; without one the SDK uses the page's.\n const productId = component.productId ?? component.host.getAttribute('product-id');\n await sdk.order.api.reorderProduct?.(productId ?? undefined);\n };\n });\n });\n}\n\n/**\n * Inside an element with `data-source=\"reorder\"`, make each add button read \"order again\" and\n * add the product as the customer last ordered it, as Twig's reorder block and page do.\n */\nexport function useReorderButtons(enabled: boolean): void {\n const { t } = useTranslation();\n const add = t('pages.orders.repurchase');\n const outOfStock = t('pages.products.out_of_stock');\n useEffect(() => {\n if (enabled) registerReorderHooks({ add, outOfStock });\n }, [enabled, add, outOfStock]);\n}\n","import { memo, useMemo } from 'react';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport { getTwilightContext } from '../../twilight/context';\nimport type { HomeComponentData } from '../../types';\nimport { HomeComponentRenderer } from './HomePageRenderer';\nimport { useReorderButtons } from './reorder-hooks';\n\n/**\n * Twig's \"order again\" block (the Store app's ReorderProductsWidget): on the home page, for a\n * signed-in customer of a store with Reorder on, the products they ordered before, drawn by the\n * theme's own `products-slider` like the home's other product rows.\n */\nexport const ReorderProducts = memo(function ReorderProducts() {\n const { t } = useTranslation();\n const { authToken, settings } = getTwilightContext();\n // The platform lists `reorder` in the store's features exactly when the Reorder setting is on.\n const enabled = !!authToken && !!settings?.store?.features?.includes('reorder');\n const title = t('pages.orders.repurchase');\n useReorderButtons(enabled);\n\n const data = useMemo<HomeComponentData>(\n () => ({\n path: 'products-slider',\n title,\n display_all_url: '/products?source=reorder',\n products: { source: 'reorder' },\n }),\n [title]\n );\n\n if (!enabled) return null;\n\n return (\n <div id=\"reorder-section\" data-source=\"reorder\">\n <HomeComponentRenderer data={data} index={-1} priority={false} />\n </div>\n );\n});\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { filesCdn, cdn } from './chunk-
|
|
1
|
+
import { filesCdn, cdn } from './chunk-J5OJ7JM2.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-
|
|
130
|
-
//# sourceMappingURL=chunk-
|
|
129
|
+
//# sourceMappingURL=chunk-HUJARQI7.js.map
|
|
130
|
+
//# sourceMappingURL=chunk-HUJARQI7.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;AAAA,EACT,CAAA;AAEA,EAAA,IAAI;AACF,IAAA,MAAM,QAAA,GAAW,M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S,MAAM,CAAA;AAAA,MACnD,OAAA,EAAS,MAAM,YAAA,CAAa,QAAA,CAAS,SAAS,MAAM;AAAA,KACrD;AAAA;AAEP","file":"chunk-FVHAKOEH.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;AAAA,IACjD;AAEA,IAAA,MAAM,IAAA,GAAgB,MAAM,QAAA,CA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AA;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-HUJARQI7.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,4 +1,4 @@
|
|
|
1
|
-
import { redirect } from './chunk-
|
|
1
|
+
import { redirect } from './chunk-PLPIAVLJ.js';
|
|
2
2
|
import { clearAuthTokenCookie } from './chunk-FXVII733.js';
|
|
3
3
|
import { FALLBACK_LOCALE } from './chunk-T72DAX7R.js';
|
|
4
4
|
import { useEffect } from 'react';
|
|
@@ -37,5 +37,5 @@ function LogoutRedirect() {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export { LogoutRedirect, accountRedirectLoader, pendingOrdersRedirectLoader, productsSourceRedirectLoader, ratingRedirectLoader, slugBrandRedirectLoader };
|
|
40
|
-
//# sourceMappingURL=chunk-
|
|
41
|
-
//# sourceMappingURL=chunk-
|
|
40
|
+
//# sourceMappingURL=chunk-ICQIH7F6.js.map
|
|
41
|
+
//# sourceMappingURL=chunk-ICQIH7F6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/routes/seo-redirects.ts"],"names":[],"mappings":";;;;;AAcA,eAAsB,wBAAwB,GAAA,EAAkD;AAC9F,EAAA,MAAM,MAAA,GAAS,GAAA,CAAI,MAAA,CAAO,MAAA,IAAU,eAAA;AACpC,EAAA,MAAM,SAAS,CAAA,CAAA,EAAI,MAAM,WAAW,GAAA,CAAI,MAAA,CAAO,EAAE,CAAA,CAAE,CAAA;AACrD;AAOA,eAAsB,4BACpB,GAAA,GAA+C,EAAE,MAAA,EAAQ,IAAG,EAC5C;AAChB,EAAA,MAAM,MAAA,GAAS,GAAA,CAAI,MAAA,CAAO,MAAA,IAAU,eAAA;AACpC,EAAA,MAAM,QAAA,CAAS,CAAA,CAAA,EAAI,MAAM,CAAA,8BAAA,CAAgC,CAAA;AAC3D;AAGA,eAAsB,qBACpB,GAAA,GAA+C,EAAE,MAAA,EAAQ,IAAG,EAC5C;AAChB,EAAA,MAAM,MAAA,GAAS,GAAA,CAAI,MAAA,CAAO,MAAA,IAAU,eAAA;AACpC,EAAA,MAAM,QAAA,CAAS,CAAA,CAAA,EAAI,MAAM,CAAA,eAAA,CAAiB,CAAA;AAC5C;AAGA,eAAsB,sBAAsB,GAAA,EAKzB;AAEjB,EAAA,MAAM,MAAA,GAAS,IAAI,MAAA,CAAO,MAAA,GAAS,IAAI,GAAA,CAAI,MAAA,CAAO,MAAM,CAAA,CAAA,GAAK,EAAA;AAC7D,EAAA,MAAM,QAAA,CAAS,CAAA,EAAG,MAA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AI,IAAI,CAAA,CAAA,GAAK,EAAE,CAAA,CAAA,EAAI;AAAA,IACjF,UAAA,EAAY;AAAA,GACb,CAAA;AACH;AAUO,SAAS,cAAA,GAAuB;AACrC,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,oBAAA,EAAqB;AAErB,IAAA,MAAA,CAAO,QAAA,CAAS,QAAQ,MAAA,CAAO,QAAA,CAAS,KAAK,OAAA,CAAQ,8BAAA,EAAgC,EAAE,CAAC,CAAA;AAAA,EAC1F,CAAA,EAAG,EAAE,CAAA;AACL,EAAA,OAAO,IAAA;AACT","file":"chunk-ICQIH7F6.js","sourcesContent":["import { useEffect } from 'react';\nimport { redirect } from '../providers/NavigationProvider';\nimport { FALLBACK_LOCALE } from '../providers/locale-constants';\nimport { clearAuthTokenCookie } from '../utils/cookies';\n\nexport interface SlugBrandParams {\n /** SEO slug segment (ignored — only here to match the route pattern). */\n slug: string;\n /** Brand numeric ID to redirect to. */\n id: string;\n /** Active locale from the `/$locale` parent layout (e.g. `'ar'`, `'en'`). */\n locale?: string;\n}\n\nexport async function slugBrandRedirectLoader(ctx: { params: SlugBrandParams }): Promise<never> {\n const locale = ctx.params.locale || FALLBACK_LOCALE;\n throw redirect(`/${locale}/brands/${ctx.params.id}`);\n}\n\nexport interface PendingOrdersRedirectParams {\n /** Active locale from the `/$locale` parent layout (e.g. `'ar'`, `'en'`). */\n locale?: string;\n}\n\nexport async function pendingOrdersRedirectLoader(\n ctx: { params: PendingOrdersRedirectParams } = { params: {} }\n): Promise<never> {\n const locale = ctx.params.locale || FALLBACK_LOCALE;\n throw redirect(`/${locale}/account/orders?status=pending`);\n}\n\n/** `/account/rating`: the loyalty \"rate your orders\" link. Twig Raed has no rating page and sends it to the orders list. */\nexport async function ratingRedirectLoader(\n ctx: { params: PendingOrdersRedirectParams } = { params: {} }\n): Promise<never> {\n const locale = ctx.params.locale || FALLBACK_LOCALE;\n throw redirect(`/${locale}/account/orders`);\n}\n\n/** A Twig customer URL (`/profile`, `/orders`, …) kept working as its `/account/…` page. */\nexport async function accountRedirectLoader(ctx: {\n params: PendingOrdersRedirectParams;\n page: string;\n /** The incoming query string (`?status=pending`), kept on the account page. */\n search?: string;\n}): Promise<never> {\n // No locale in the URL stays without one: the locale layout adds it only where the store has several.\n const prefix = ctx.params.locale ? `/${ctx.params.locale}` : '';\n throw redirect(`${prefix}/account/${ctx.page}${ctx.search ?? ''}`, { statusCode: 301 });\n}\n\n/** `/latest-products`, `/most-sales-products` and `/offers` now live at `/products?source=`. */\nexport async function productsSourceRedirectLoader(ctx: {\n params: PendingOrdersRedirectParams;\n source: 'latest' | 'sales' | 'offers';\n search?: string;\n}): Promise<never> {\n const prefix = ctx.params.locale ? `/${ctx.params.locale}` : '';\n const query = new URLSearchParams(ctx.search);\n query.delete('source');\n const rest = query.toString();\n throw redirect(`${prefix}/products?source=${ctx.source}${rest ? `&${rest}` : ''}`, {\n statusCode: 301,\n });\n}\n\n/**\n * `/logout` — where the SDK sends the browser once `salla.auth.logout()` has run\n * (`salla.url.get('logout?from=…')`). The Twig storefront serves that URL server-side. Here\n * it renders nothing and, in the browser, removes the theme's own `token` cookie (the SDK's\n * `cookie.clearAll()` leaves it) and then does a full navigation home. It has to be a\n * component, not a loader redirect: a loader runs during server rendering, where the cookie\n * can't be cleared, so the redirect would leave the visitor signed in on the next request.\n */\nexport function LogoutRedirect(): null {\n useEffect(() => {\n clearAuthTokenCookie();\n // `/{store base}/{locale}/logout?from=…` → `/{store base}/{locale}`\n window.location.replace(window.location.href.replace(/\\/logout\\/?(\\?[^#]*)?(#.*)?$/, ''));\n }, []);\n return null;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { orThrow } from './chunk-
|
|
2
|
-
import { getActiveScope, api } from './chunk-
|
|
1
|
+
import { orThrow } from './chunk-PLPIAVLJ.js';
|
|
2
|
+
import { getActiveScope, api } from './chunk-J5OJ7JM2.js';
|
|
3
3
|
import { getTwilightContext } from './chunk-6K34BCUP.js';
|
|
4
4
|
import { defaultShouldDehydrateQuery, queryOptions } from '@tanstack/react-query';
|
|
5
5
|
|
|
@@ -215,5 +215,5 @@ var product = {
|
|
|
215
215
|
};
|
|
216
216
|
|
|
217
217
|
export { getProductPreview, isProductPreviewQuery, parseNextPageToken, product, productDetailQueryKey, productPreviewQueryKey, rememberProductPreview, shouldDehydrateQuery };
|
|
218
|
-
//# sourceMappingURL=chunk-
|
|
219
|
-
//# sourceMappingURL=chunk-
|
|
218
|
+
//# sourceMappingURL=chunk-ISDSQORB.js.map
|
|
219
|
+
//# sourceMappingURL=chunk-ISDSQORB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/product.ts"],"names":["product"],"mappings":";;;;;AA+FA,SAAS,iBAAA,GAAoB;AAC3B,EAAA,IAAI;AACF,IAAA,MAAM,WAAA,GAAc,oBAAmB,CAAE,WAAA;AACzC,IAAA,OAAO,WAAA,IAAe,OAAO,WAAA,CAAY,YAAA,KAAiB,aAAa,WAAA,GAAc,IAAA;AAAA,EACvF,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,IAAA;AAAA,EACT;AACF;AAEO,SAAS,uBAAuB,EAAA,EAAY;AACjD,EAAA,OAAO,CAAC,UAAA,EAAY,SAAA,EAAW,MAAA,CAAO,EAAE,GAAG,EAAE,KAAA,EAAO,cAAA,EAAe,EAAG,CAAA;AACxE;AAEO,SAAS,sBAAsB,EAAA,EAAY;AAChD,EAAA,OAAO,CAAC,YAAY,QAAA,EAAU,EAAA,EAAI,EAAE,KAAA,EAAO,cAAA,IAAkB,CAAA;AAC/D;AAGO,SAAS,sBAAsB,KAAA,EAAkD;AACtF,EAAA,OAAO,KAAA,CAAM,SAAS,CAAC,CAAA,KAAM,cAAc,KAAA,CAAM,QAAA,CAAS,CAAC,CAAA,KAAM,SAAA;AACnE;AAMO,SAAS,qBACd,KAAA,EACS;AACT,EAAA,OACE,CAAC,sBAAsB,KAAK,CAAA,KAC3B,4BAA4B,K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ery } from '@tanstack/react-query';\nimport { api, getActiveScope } from './client';\nimport type { Product } from '../types';\nimport type { Pagination, PaginatedResult } from './types';\nimport { orThrow } from '../providers/NavigationProvider';\nimport { getTwilightContext } from '../twilight/context';\nimport type { ActiveScope } from '../utils/cookies';\n\n// ===== Filter Types =====\n\nexport interface FilterValue {\n key?: string;\n count?: number;\n value?: string;\n from?: number | '*';\n to?: number | '*';\n}\n\nexport interface Filter {\n key?: string;\n label?: string;\n type?: string;\n values?: FilterValue[];\n max?: number;\n min?: number;\n}\n\n// ===== Product List Types =====\n\nexport type ProductsListSource =\n | 'brands'\n | 'categories'\n | 'json'\n | 'landing-page'\n | 'latest'\n | 'offers'\n | 'recently'\n | 'related'\n | 'selected'\n | 'tags'\n | 'top-rated'\n | 'wishlist'\n | 'search'\n | 'sales'\n | 'reorder'\n | 'best_selling';\n\nexport interface ProductsListParams {\n /** Source type (wishlist, latest, brands, etc.) */\n source: ProductsListSource;\n /**\n * The ids the source reads, as an array: category, brand, tag or product ids\n * (`sourceValue: [708738657]`). Sent as `source_value[]`.\n */\n sourceValue?: string | number | number[] | null;\n /** The search words when `source` is `'search'`. Sent as `keyword`; other sources ignore it. */\n keyword?: string;\n /** Page number for offset-based pagination */\n page?: number;\n /** Cursor for cursor-based pagination (from previous response) */\n cursor?: string | null;\n /** Items per page (default: 15) */\n perPage?: number;\n /** Sort option */\n sort?: string;\n /** Enable filters on the response */\n filterable?: boolean;\n /** Applied `<salla-filters>` selection (the `salla-filters::changed` payload). */\n filters?: ProductListFilters;\n /** Abort signal for cancellation */\n signal?: AbortSignal;\n}\n\n/** One `<salla-filters>` value: a scalar, a list, or a nested `{ sub-key: value }` (variants). */\nexport type ProductListFilterValue =\n string | number | Array<string | number> | { [key: string]: ProductListFilterValue };\n\n/** A `<salla-filters>` selection, i.e. the `salla-filters::changed` payload. */\nexport type ProductListFilters = Record<string, ProductListFilterValue>;\n\nexport type ProductsListResult = PaginatedResult<Product> & {\n filters?: Filter[];\n};\n\nexport interface ProductsListResponse {\n data: Product[];\n cursor?: Pagination;\n filters?: Filter[];\n}\n\n// ===== List-card preview cache =====\n// List payloads are a subset of details (one `image`, no `options` / `images[]`).\n// They live on a separate query key so they can paint a sheet/quick-view without\n// being treated as a successful `products/{id}/details` fetch.\n\nfunction queryClientOrNull() {\n try {\n const queryClient = getTwilightContext().queryClient;\n return queryClient && typeof queryClient.setQueryData === 'function' ? queryClient : null;\n } catch {\n return null;\n }\n}\n\nexport function productPreviewQueryKey(id: string) {\n return ['products', 'preview', String(id), { scope: getActiveScope() }] as const;\n}\n\nexport function productDetailQueryKey(id: string) {\n return ['products', 'detail', id, { scope: getActiveScope() }] as const;\n}\n\n/** True when this query is a list-card stand-in — skip it when dehydrating SSR. */\nexport function isProductPreviewQuery(query: { queryKey: readonly unknown[] }): boolean {\n return query.queryKey[0] === 'products' && query.queryKey[1] === 'preview';\n}\n\n/**\n * Default dehydrate policy (success) plus pending SSR-stream queries, minus\n * list-card stand-ins. Replacing the default wholesale would ship error states.\n */\nexport function shouldDehydrateQuery(\n query: Parameters<typeof defaultShouldDehydrateQuery>[0]\n): boolean {\n return (\n !isProductPreviewQuery(query) &&\n (defaultShouldDehydrateQuery(query) || query.state.status === 'pending')\n );\n}\n\n/**\n * Remember a list/card product so `product.queries.detail(id)` can use it as\n * `placeholderData` while details load. No-op if details for this id are already\n * cached. Themes that fetch products outside `product.list` should call this.\n */\nexport function rememberProductPreview(product: Product): void {\n const queryClient = queryClientOrNull();\n if (!queryClient || product?.id == null) return;\n const id = String(product.id);\n if (queryClient.getQueryState(productDetailQueryKey(id))?.status === 'success') return;\n queryClient.setQueryData(productPreviewQueryKey(id), product);\n}\n\nfunction scopeFromQueryKey(queryKey: readonly unknown[]): ActiveScope | null | undefined {\n const last = queryKey[queryKey.length - 1];\n if (last == null || typeof last !== 'object' || !('scope' in last)) return undefined;\n return (last as { scope: ActiveScope | null }).scope;\n}\n\nfunction isSameScope(a: ActiveScope | null | undefined, b: ActiveScope | null): boolean {\n if (a === undefined) return false;\n if (a === b) return true;\n if (a == null || b == null) return a == null && b == null;\n return (\n a.id === b.id &&\n a.type === b.type &&\n a.allocation_id === b.allocation_id &&\n a.allocation_type === b.allocation_type\n );\n}\n\nconst LIST_QUERY_PREFIXES = [\n ['products', 'list'],\n ['wishlist', 'list'],\n] as const;\n\n/**\n * Rebuild the scoped preview index from hydrated list/wishlist queries (SSR\n * dehydrate drops preview keys). Subsequent lookups hit `productPreviewQueryKey`.\n */\nfunction findProductInScopedLists(\n queryClient: NonNullable<ReturnType<typeof queryClientOrNull>>,\n id: string\n): Product | undefined {\n const scope = getActiveScope();\n let found: Product | undefined;\n for (const prefix of LIST_QUERY_PREFIXES) {\n for (const [queryKey, data] of queryClient.getQueriesData<ProductsListResult>({\n queryKey: prefix,\n })) {\n if (!isSameScope(scopeFromQueryKey(queryKey), scope)) continue;\n for (const item of data?.items ?? []) {\n if (item?.id == null) continue;\n rememberProductPreview(item);\n if (!found && String(item.id) === id) found = item;\n }\n }\n }\n return found;\n}\n\n/**\n * List-card product for `placeholderData`. Prefers the preview key; if that was\n * dropped on SSR dehydrate, rebuilds it from the current-scope list/wishlist.\n */\nexport function getProductPreview(id: string): Product | undefined {\n const queryClient = queryClientOrNull();\n if (!queryClient) return undefined;\n const key = String(id);\n return (\n queryClient.getQueryData(productPreviewQueryKey(key)) ??\n findProductInScopedLists(queryClient, key)\n );\n}\n\nfunction rememberProductPreviews(items: Product[]): void {\n for (const item of items) rememberProductPreview(item);\n}\n\n/**\n * Search sends its words as `keyword` (a `sourceValue` string is still read there, as before);\n * every other source sends its ids as `source_value[]`, which the API requires as an array.\n */\nfunction appendSourceParams(\n searchParams: URLSearchParams,\n { source, sourceValue, keyword }: Pick<ProductsListParams, 'source' | 'sourceValue' | 'keyword'>\n): void {\n if (source === 'search') {\n const words = keyword ?? sourceValue;\n if (words !== undefined) searchParams.set('keyword', String(words));\n } else if (Array.isArray(sourceValue)) {\n sourceValue.forEach((val) => searchParams.append('source_value[]', String(val)));\n } else if (sourceValue !== undefined) {\n searchParams.append('source_value[]', String(sourceValue));\n }\n}\n\n/**\n * Sends an applied filter selection the way the SDK's `<salla-products-list>` does:\n * `filters[key]=v`, `filters[key][]=v` or `filters[key][sub]=v`.\n */\nfunction appendFilterParams(\n searchParams: URLSearchParams,\n filters?: Record<string, ProductListFilterValue>,\n parentKey = 'filters'\n): void {\n if (!filters) return;\n for (const [key, value] of Object.entries(filters)) {\n const fullKey = `${parentKey}[${key}]`;\n if (Array.isArray(value)) {\n value.forEach((item) => searchParams.append(`${fullKey}[]`, String(item)));\n } else if (value !== null && typeof value === 'object') {\n appendFilterParams(searchParams, value, fullKey);\n } else if (value !== undefined && value !== null) {\n searchParams.append(fullKey, String(value));\n }\n }\n}\n\n/** A `category_id` filter replaces the page's category as the list source (as in the SDK). */\n// The API sends these four filter titles in Arabic whatever the language (the values are\n// translated). Twig's `<salla-filters>` swaps them for its own translations when the list\n// reaches it through `filters::fetched`; a list handed over as data, the loader's or a\n// theme's own query, is swapped here instead, with the keys the component uses.\nconst FILTER_TITLES: Record<string, [key: string, fallback: string]> = {\n category_id: ['common.titles.categories', 'Categories'],\n brand_id: ['common.titles.brands', 'Brands'],\n price: ['pages.categories.filter_price', 'Price'],\n rating: ['pages.categories.filter_rating', 'Rating'],\n};\n\nfunction titledFilters(filters?: Filter[]): Filter[] | undefined {\n const t = getTwilightContext().i18n?.t;\n if (!filters || !t) return filters;\n return filters.map((filter) => {\n const title = filter.key && FILTER_TITLES[filter.key];\n return title ? { ...filter, label: t(title[0], title[1]) } : filter;\n });\n}\n\nfunction categoryFilterIds(filters?: ProductListFilters): number[] | null {\n const raw = filters?.category_id;\n if (raw === undefined || raw === null) return null;\n const ids = Array.isArray(raw) ? raw : typeof raw === 'object' ? Object.values(raw) : [raw];\n return ids.map(Number);\n}\n\n// ===== Pagination =====\n\n/**\n * The API's own `cursor.next` (the previous page's response) is usually a\n * bare opaque cursor token, but for sources that don't support true\n * cursor-based pagination (observed: `source=offers`) it's instead a full\n * next-page URL carrying its own `page=N` — and no `cursor=` param at all.\n *\n * Passing that whole URL straight through as `list()`'s own `cursor` used to\n * smuggle its embedded `source` / `per_page` / `sort` into the request on\n * top of the ones `list()` already sets unconditionally, producing a\n * doubled query string (`source=offers&source=offers&...`) the API can't\n * paginate from correctly — every subsequent scroll re-fetched the exact\n * same first page instead of advancing. Pulling just the `page` number back\n * out here, the same way an actual `cursor=` is already pulled out, keeps\n * `list()`'s request to the one copy of each param it's supposed to have.\n */\nexport function parseNextPageToken(nextUrl: string | null | undefined): {\n cursor?: string;\n page?: number;\n} {\n if (!nextUrl) return {};\n\n const cursorMatch = nextUrl.match(/[?&]cursor=([^&]+)/);\n if (cursorMatch) return { cursor: decodeURIComponent(cursorMatch[1]) };\n\n const pageMatch = nextUrl.match(/[?&]page=([^&]+)/);\n if (pageMatch) {\n const page = Number(decodeURIComponent(pageMatch[1]));\n if (Number.isFinite(page)) return { page };\n }\n\n // Neither pattern matched: not a URL at all, just the bare opaque token itself.\n return { cursor: nextUrl };\n}\n\n// ===== API Functions =====\n\nexport const product = {\n find: async (id: string): Promise<Product> => {\n const endpoint = `products/${id}/details?with[]=images&with[]=category&with[]=rating&with[]=notify_availability&with[]=tags&with[]=brand&with[]=options&with[]=skus&with[]=skus_availability&with[]=included_products&with[]=bundle&with[]=sold_quantity`;\n const { data } = await api.get(endpoint).json<{ data: Product }>();\n return data;\n },\n\n findOrThrow: (id: string): Promise<Product> => orThrow(product.find(id)),\n\n /** A tag's name. The list endpoint returns every product for an unknown tag; this one answers 410. */\n tag: async (id: string): Promise<{ id: number; name: string }> => {\n const { tag } = await api\n .get(`products/tags/${id}`)\n .json<{ tag: { id: number; name: string } }>();\n return tag;\n },\n\n /**\n * Fetch products list with pagination support\n * Used by native ProductsList component for SSR loaders\n *\n * API pattern: GET /products?source=wishlist&page=1\n */\n list: async (params: ProductsListParams): Promise<ProductsListResult> => {\n const {\n source,\n sourceValue,\n keyword,\n page,\n cursor,\n perPage = 16,\n sort,\n filterable,\n filters,\n signal,\n } = params;\n\n // Build URL with query parameters\n const searchParams = new URLSearchParams();\n searchParams.set('source', source);\n // Only send page when explicitly provided — cursor-based callers omit it entirely\n if (page !== undefined) searchParams.set('page', String(page));\n searchParams.set('per_page', String(perPage));\n\n appendSourceParams(searchParams, {\n source,\n sourceValue: (source === 'categories' && categoryFilterIds(filters)) || sourceValue,\n keyword,\n });\n appendFilterParams(searchParams, filters);\n\n // Add filterable parameter\n if (filterable !== undefined) {\n searchParams.set('filterable', filterable ? '1' : '0');\n }\n\n // Add sort parameter\n if (sort) {\n searchParams.set('sort', sort);\n }\n\n // Add cursor for cursor-based pagination\n if (cursor) {\n searchParams.set('cursor', cursor);\n }\n\n // Make the request\n const options: Record<string, unknown> = {};\n if (signal) options.signal = signal;\n\n const response = await api\n .get(`products?${searchParams.toString()}`, options as any)\n .json<ProductsListResponse>();\n\n const items = response.data ?? [];\n rememberProductPreviews(items);\n\n return {\n items,\n next: response.cursor?.next ?? null,\n filters: titledFilters(response.filters),\n };\n },\n\n queries: {\n detail: (id: string) =>\n queryOptions({\n // Stock and availability are resolved per branch allocation — same as the list.\n queryKey: productDetailQueryKey(id),\n queryFn: () => product.find(id),\n // List-card product, if one was remembered. Not written as the detail\n // cache entry — `queryFn` still hits products/{id}/details.\n placeholderData: () => getProductPreview(id),\n }),\n tag: (id: string) =>\n queryOptions({\n queryKey: ['products', 'tag', id],\n queryFn: () => product.tag(id),\n }),\n list: (params: Omit<ProductsListParams, 'signal'>) =>\n queryOptions({\n // Scope (branch) varies product availability, and the locale the names and the\n // filter titles (a same-store link can switch language without a page load) — the\n // key must include both.\n queryKey: [\n 'products',\n 'list',\n params,\n { scope: getActiveScope(), locale: getTwilightContext().locale },\n ],\n queryFn: ({ signal }) => product.list({ ...params, signal }),\n }),\n },\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/api/product.ts"],"names":["product"],"mappings":";;;;;AA+FA,SAAS,iBAAA,GAAo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,CAAQ,IAAA,CAAK,EAAE,CAAA;AAAA;AAAA;AAAA,MAG9B,eAAA,EAAiB,MAAM,iBAAA,CAAkB,EAAE;AAAA,KAC5C,CAAA;AAAA,IACH,GAAA,EAAK,CAAC,EAAA,KACJ,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,UAAA,EAAY,KAAA,EAAO,EAAE,CAAA;AAAA,MAChC,OAAA,EAAS,MAAM,OAAA,CAAQ,GAAA,CAAI,EAAE;AAAA,KAC9B,CAAA;AAAA,IACH,IAAA,EAAM,CAAC,MAAA,KACL,YAAA,CAAa;AAAA;AAAA;AAAA;AAAA,MAIX,QAAA,EAAU;AAAA,QACR,UAAA;AAAA,QACA,MAAA;AAAA,QACA,MAAA;AAAA,QACA,EAAE,KAAA,EAAO,cAAA,IAAkB,MAAA,EAAQ,kBAAA,GAAqB,MAAA;AAAO,OACjE;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,MAAA,EAAO,KAAM,OAAA,CAAQ,IAAA,CAAK,EAAE,GAAG,MAAA,EAAQ,MAAA,EAAQ;AAAA,KAC5D;AAAA;AAEP","file":"chunk-ISDSQORB.js","sourcesContent":["import { queryOptions, defaultShouldDehydrateQuery } from '@tanstack/react-query';\nimport { api, getActiveScope } from './client';\nimport type { Product } from '../types';\nimport type { Pagination, PaginatedResult } from './types';\nimport { orThrow } from '../providers/NavigationProvider';\nimport { getTwilightContext } from '../twilight/context';\nimport type { ActiveScope } from '../utils/cookies';\n\n// ===== Filter Types =====\n\nexport interface FilterValue {\n key?: string;\n count?: number;\n value?: string;\n from?: number | '*';\n to?: number | '*';\n}\n\nexport interface Filter {\n key?: string;\n label?: string;\n type?: string;\n values?: FilterValue[];\n max?: number;\n min?: number;\n}\n\n// ===== Product List Types =====\n\nexport type ProductsListSource =\n | 'brands'\n | 'categories'\n | 'json'\n | 'landing-page'\n | 'latest'\n | 'offers'\n | 'recently'\n | 'related'\n | 'selected'\n | 'tags'\n | 'top-rated'\n | 'wishlist'\n | 'search'\n | 'sales'\n | 'reorder'\n | 'best_selling';\n\nexport interface ProductsListParams {\n /** Source type (wishlist, latest, brands, etc.) */\n source: ProductsListSource;\n /**\n * The ids the source reads, as an array: category, brand, tag or product ids\n * (`sourceValue: [708738657]`). Sent as `source_value[]`.\n */\n sourceValue?: string | number | number[] | null;\n /** The search words when `source` is `'search'`. Sent as `keyword`; other sources ignore it. */\n keyword?: string;\n /** Page number for offset-based pagination */\n page?: number;\n /** Cursor for cursor-based pagination (from previous response) */\n cursor?: string | null;\n /** Items per page (default: 15) */\n perPage?: number;\n /** Sort option */\n sort?: string;\n /** Enable filters on the response */\n filterable?: boolean;\n /** Applied `<salla-filters>` selection (the `salla-filters::changed` payload). */\n filters?: ProductListFilters;\n /** Abort signal for cancellation */\n signal?: AbortSignal;\n}\n\n/** One `<salla-filters>` value: a scalar, a list, or a nested `{ sub-key: value }` (variants). */\nexport type ProductListFilterValue =\n string | number | Array<string | number> | { [key: string]: ProductListFilterValue };\n\n/** A `<salla-filters>` selection, i.e. the `salla-filters::changed` payload. */\nexport type ProductListFilters = Record<string, ProductListFilterValue>;\n\nexport type ProductsListResult = PaginatedResult<Product> & {\n filters?: Filter[];\n};\n\nexport interface ProductsListResponse {\n data: Product[];\n cursor?: Pagination;\n filters?: Filter[];\n}\n\n// ===== List-card preview cache =====\n// List payloads are a subset of details (one `image`, no `options` / `images[]`).\n// They live on a separate query key so they can paint a sheet/quick-view without\n// being treated as a successful `products/{id}/details` fetch.\n\nfunction queryClientOrNull() {\n try {\n const queryClient = getTwilightContext().queryClient;\n return queryClient && typeof queryClient.setQueryData === 'function' ? queryClient : null;\n } catch {\n return null;\n }\n}\n\nexport function productPreviewQueryKey(id: string) {\n return ['products', 'preview', String(id), { scope: getActiveScope() }] as const;\n}\n\nexport function productDetailQueryKey(id: string) {\n return ['products', 'detail', id, { scope: getActiveScope() }] as const;\n}\n\n/** True when this query is a list-card stand-in — skip it when dehydrating SSR. */\nexport function isProductPreviewQuery(query: { queryKey: readonly unknown[] }): boolean {\n return query.queryKey[0] === 'products' && query.queryKey[1] === 'preview';\n}\n\n/**\n * Default dehydrate policy (success) plus pending SSR-stream queries, minus\n * list-card stand-ins. Replacing the default wholesale would ship error states.\n */\nexport function shouldDehydrateQuery(\n query: Parameters<typeof defaultShouldDehydrateQuery>[0]\n): boolean {\n return (\n !isProductPreviewQuery(query) &&\n (defaultShouldDehydrateQuery(query) || query.state.status === 'pending')\n );\n}\n\n/**\n * Remember a list/card product so `product.queries.detail(id)` can use it as\n * `placeholderData` while details load. No-op if details for this id are already\n * cached. Themes that fetch products outside `product.list` should call this.\n */\nexport function rememberProductPreview(product: Product): void {\n const queryClient = queryClientOrNull();\n if (!queryClient || product?.id == null) return;\n const id = String(product.id);\n if (queryClient.getQueryState(productDetailQueryKey(id))?.status === 'success') return;\n queryClient.setQueryData(productPreviewQueryKey(id), product);\n}\n\nfunction scopeFromQueryKey(queryKey: readonly unknown[]): ActiveScope | null | undefined {\n const last = queryKey[queryKey.length - 1];\n if (last == null || typeof last !== 'object' || !('scope' in last)) return undefined;\n return (last as { scope: ActiveScope | null }).scope;\n}\n\nfunction isSameScope(a: ActiveScope | null | undefined, b: ActiveScope | null): boolean {\n if (a === undefined) return false;\n if (a === b) return true;\n if (a == null || b == null) return a == null && b == null;\n return (\n a.id === b.id &&\n a.type === b.type &&\n a.allocation_id === b.allocation_id &&\n a.allocation_type === b.allocation_type\n );\n}\n\nconst LIST_QUERY_PREFIXES = [\n ['products', 'list'],\n ['wishlist', 'list'],\n] as const;\n\n/**\n * Rebuild the scoped preview index from hydrated list/wishlist queries (SSR\n * dehydrate drops preview keys). Subsequent lookups hit `productPreviewQueryKey`.\n */\nfunction findProductInScopedLists(\n queryClient: NonNullable<ReturnType<typeof queryClientOrNull>>,\n id: string\n): Product | undefined {\n const scope = getActiveScope();\n let found: Product | undefined;\n for (const prefix of LIST_QUERY_PREFIXES) {\n for (const [queryKey, data] of queryClient.getQueriesData<ProductsListResult>({\n queryKey: prefix,\n })) {\n if (!isSameScope(scopeFromQueryKey(queryKey), scope)) continue;\n for (const item of data?.items ?? []) {\n if (item?.id == null) continue;\n rememberProductPreview(item);\n if (!found && String(item.id) === id) found = item;\n }\n }\n }\n return found;\n}\n\n/**\n * List-card product for `placeholderData`. Prefers the preview key; if that was\n * dropped on SSR dehydrate, rebuilds it from the current-scope list/wishlist.\n */\nexport function getProductPreview(id: string): Product | undefined {\n const queryClient = queryClientOrNull();\n if (!queryClient) return undefined;\n const key = String(id);\n return (\n queryClient.getQueryData(productPreviewQueryKey(key)) ??\n findProductInScopedLists(queryClient, key)\n );\n}\n\nfunction rememberProductPreviews(items: Product[]): void {\n for (const item of items) rememberProductPreview(item);\n}\n\n/**\n * Search sends its words as `keyword` (a `sourceValue` string is still read there, as before);\n * every other source sends its ids as `source_value[]`, which the API requires as an array.\n */\nfunction appendSourceParams(\n searchParams: URLSearchParams,\n { source, sourceValue, keyword }: Pick<ProductsListParams, 'source' | 'sourceValue' | 'keyword'>\n): void {\n if (source === 'search') {\n const words = keyword ?? sourceValue;\n if (words !== undefined) searchParams.set('keyword', String(words));\n } else if (Array.isArray(sourceValue)) {\n sourceValue.forEach((val) => searchParams.append('source_value[]', String(val)));\n } else if (sourceValue !== undefined) {\n searchParams.append('source_value[]', String(sourceValue));\n }\n}\n\n/**\n * Sends an applied filter selection the way the SDK's `<salla-products-list>` does:\n * `filters[key]=v`, `filters[key][]=v` or `filters[key][sub]=v`.\n */\nfunction appendFilterParams(\n searchParams: URLSearchParams,\n filters?: Record<string, ProductListFilterValue>,\n parentKey = 'filters'\n): void {\n if (!filters) return;\n for (const [key, value] of Object.entries(filters)) {\n const fullKey = `${parentKey}[${key}]`;\n if (Array.isArray(value)) {\n value.forEach((item) => searchParams.append(`${fullKey}[]`, String(item)));\n } else if (value !== null && typeof value === 'object') {\n appendFilterParams(searchParams, value, fullKey);\n } else if (value !== undefined && value !== null) {\n searchParams.append(fullKey, String(value));\n }\n }\n}\n\n/** A `category_id` filter replaces the page's category as the list source (as in the SDK). */\n// The API sends these four filter titles in Arabic whatever the language (the values are\n// translated). Twig's `<salla-filters>` swaps them for its own translations when the list\n// reaches it through `filters::fetched`; a list handed over as data, the loader's or a\n// theme's own query, is swapped here instead, with the keys the component uses.\nconst FILTER_TITLES: Record<string, [key: string, fallback: string]> = {\n category_id: ['common.titles.categories', 'Categories'],\n brand_id: ['common.titles.brands', 'Brands'],\n price: ['pages.categories.filter_price', 'Price'],\n rating: ['pages.categories.filter_rating', 'Rating'],\n};\n\nfunction titledFilters(filters?: Filter[]): Filter[] | undefined {\n const t = getTwilightContext().i18n?.t;\n if (!filters || !t) return filters;\n return filters.map((filter) => {\n const title = filter.key && FILTER_TITLES[filter.key];\n return title ? { ...filter, label: t(title[0], title[1]) } : filter;\n });\n}\n\nfunction categoryFilterIds(filters?: ProductListFilters): number[] | null {\n const raw = filters?.category_id;\n if (raw === undefined || raw === null) return null;\n const ids = Array.isArray(raw) ? raw : typeof raw === 'object' ? Object.values(raw) : [raw];\n return ids.map(Number);\n}\n\n// ===== Pagination =====\n\n/**\n * The API's own `cursor.next` (the previous page's response) is usually a\n * bare opaque cursor token, but for sources that don't support true\n * cursor-based pagination (observed: `source=offers`) it's instead a full\n * next-page URL carrying its own `page=N` — and no `cursor=` param at all.\n *\n * Passing that whole URL straight through as `list()`'s own `cursor` used to\n * smuggle its embedded `source` / `per_page` / `sort` into the request on\n * top of the ones `list()` already sets unconditionally, producing a\n * doubled query string (`source=offers&source=offers&...`) the API can't\n * paginate from correctly — every subsequent scroll re-fetched the exact\n * same first page instead of advancing. Pulling just the `page` number back\n * out here, the same way an actual `cursor=` is already pulled out, keeps\n * `list()`'s request to the one copy of each param it's supposed to have.\n */\nexport function parseNextPageToken(nextUrl: string | null | undefined): {\n cursor?: string;\n page?: number;\n} {\n if (!nextUrl) return {};\n\n const cursorMatch = nextUrl.match(/[?&]cursor=([^&]+)/);\n if (cursorMatch) return { cursor: decodeURIComponent(cursorMatch[1]) };\n\n const pageMatch = nextUrl.match(/[?&]page=([^&]+)/);\n if (pageMatch) {\n const page = Number(decodeURIComponent(pageMatch[1]));\n if (Number.isFinite(page)) return { page };\n }\n\n // Neither pattern matched: not a URL at all, just the bare opaque token itself.\n return { cursor: nextUrl };\n}\n\n// ===== API Functions =====\n\nexport const product = {\n find: async (id: string): Promise<Product> => {\n const endpoint = `products/${id}/details?with[]=images&with[]=category&with[]=rating&with[]=notify_availability&with[]=tags&with[]=brand&with[]=options&with[]=skus&with[]=skus_availability&with[]=included_products&with[]=bundle&with[]=sold_quantity`;\n const { data } = await api.get(endpoint).json<{ data: Product }>();\n return data;\n },\n\n findOrThrow: (id: string): Promise<Product> => orThrow(product.find(id)),\n\n /** A tag's name. The list endpoint returns every product for an unknown tag; this one answers 410. */\n tag: async (id: string): Promise<{ id: number; name: string }> => {\n const { tag } = await api\n .get(`products/tags/${id}`)\n .json<{ tag: { id: number; name: string } }>();\n return tag;\n },\n\n /**\n * Fetch products list with pagination support\n * Used by native ProductsList component for SSR loaders\n *\n * API pattern: GET /products?source=wishlist&page=1\n */\n list: async (params: ProductsListParams): Promise<ProductsListResult> => {\n const {\n source,\n sourceValue,\n keyword,\n page,\n cursor,\n perPage = 16,\n sort,\n filterable,\n filters,\n signal,\n } = params;\n\n // Build URL with query parameters\n const searchParams = new URLSearchParams();\n searchParams.set('source', source);\n // Only send page when explicitly provided — cursor-based callers omit it entirely\n if (page !== undefined) searchParams.set('page', String(page));\n searchParams.set('per_page', String(perPage));\n\n appendSourceParams(searchParams, {\n source,\n sourceValue: (source === 'categories' && categoryFilterIds(filters)) || sourceValue,\n keyword,\n });\n appendFilterParams(searchParams, filters);\n\n // Add filterable parameter\n if (filterable !== undefined) {\n searchParams.set('filterable', filterable ? '1' : '0');\n }\n\n // Add sort parameter\n if (sort) {\n searchParams.set('sort', sort);\n }\n\n // Add cursor for cursor-based pagination\n if (cursor) {\n searchParams.set('cursor', cursor);\n }\n\n // Make the request\n const options: Record<string, unknown> = {};\n if (signal) options.signal = signal;\n\n const response = await api\n .get(`products?${searchParams.toString()}`, options as any)\n .json<ProductsListResponse>();\n\n const items = response.data ?? [];\n rememberProductPreviews(items);\n\n return {\n items,\n next: response.cursor?.next ?? null,\n filters: titledFilters(response.filters),\n };\n },\n\n queries: {\n detail: (id: string) =>\n queryOptions({\n // Stock and availability are resolved per branch allocation — same as the list.\n queryKey: productDetailQueryKey(id),\n queryFn: () => product.find(id),\n // List-card product, if one was remembered. Not written as the detail\n // cache entry — `queryFn` still hits products/{id}/details.\n placeholderData: () => getProductPreview(id),\n }),\n tag: (id: string) =>\n queryOptions({\n queryKey: ['products', 'tag', id],\n queryFn: () => product.tag(id),\n }),\n list: (params: Omit<ProductsListParams, 'signal'>) =>\n queryOptions({\n // Scope (branch) varies product availability, and the locale the names and the\n // filter titles (a same-store link can switch language without a page load) — the\n // key must include both.\n queryKey: [\n 'products',\n 'list',\n params,\n { scope: getActiveScope(), locale: getTwilightContext().locale },\n ],\n queryFn: ({ signal }) => product.list({ ...params, signal }),\n }),\n },\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { api } from './chunk-
|
|
1
|
+
import { api } from './chunk-J5OJ7JM2.js';
|
|
2
2
|
import { queryOptions } from '@tanstack/react-query';
|
|
3
3
|
|
|
4
4
|
var apps = {
|
|
@@ -40,5 +40,5 @@ var apps = {
|
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
export { apps };
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
44
|
-
//# sourceMappingURL=chunk-
|
|
43
|
+
//# sourceMappingURL=chunk-J4GUGMPX.js.map
|
|
44
|
+
//# sourceMappingURL=chunk-J4GUGMPX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/apps.ts"],"names":[],"mappings":";;;AAmCO,IAAM,IAAA,GAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKlB,UAAU,YAAmC;AAC3C,IAAA,MAAM,EAAE,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A8B;AACjC,IAAA,OAAO,QAAQ,EAAC;AAAA,EAClB,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,UAAU,YAAkC;AAC1C,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,GAAA,CACpB,GAAA,CAAI,wBAAA,EAA0B,EAAE,OAAA,EAAS,IAAA,EAAM,CAAA,CAC/C,IAAA,EAAsC;AACzC,IAAA,OAAO,EAAE,IAAA,EAAM,IAAA,EAAM,IAAA,IAAQ,EAAC,EAAE;AAAA,EAClC,CAAA;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,MACR,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,MAAA,EAAQ,UAAU,CAAA;AAAA,MAC7B,OAAA,EAAS,MAAM,IAAA,CAAK,QAAA,EAAS;AAAA;AAAA,MAE7B,SAAA,EAAW,QAAA;AAAA;AAAA;AAAA;AAAA,MAIX,KAAA,EAAO;AAAA,KACR,CAAA;AAAA,IAEH,QAAA,EAAU,MACR,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,MAAA,EAAQ,UAAU,CAAA;AAAA,MAC7B,OAAA,EAAS,MAAM,IAAA,CAAK,QAAA,EAAS;AAAA;AAAA,MAE7B,SAAA,EAAW,QAAA;AAAA,MACX,KAAA,EAAO;AAAA,KACR;AAAA;AAEP","file":"chunk-J4GUGMPX.js","sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { api } from './client';\n\nexport interface AppSnippetRow {\n place: string;\n content: string;\n url?: string | null;\n /**\n * Raw snippet id, emitted as `data-snippet-id`. Present only on CDN rows — the\n * inline branch of the backend's snippet parser omits the key entirely.\n */\n id?: number;\n /** `{{customer.x}}` placeholders in `content` to substitute from SDK config `user.*` keys. */\n customer_parameters?: string[];\n}\n\nexport interface AppSnippet {\n service: string;\n app_id: string;\n /** Encoded app id (`getRouteKey()`): the scope id its snippets bind to via `data-scope-id`,\n * and its settings-bucket key. Absent on payloads predating the settings API. */\n id?: string;\n app_slug: string;\n status: string;\n snippets: AppSnippetRow[];\n}\n\n/**\n * Per-app public `app.*` buckets for CDN snippets, keyed by encoded app id (== `AppSnippet.id`,\n * the `Salla.appScope` scope id). One isolated bucket per app; reads within a scope are bare `app.*`.\n */\nexport interface AppSettings {\n apps: Record<string, Record<string, unknown>>;\n}\n\nexport const apps = {\n /**\n * Installed apps' snippets (scripts/HTML to inject). Timeout-bounded because it's awaited in\n * rootBeforeLoad (SSR/TTFB): a slow response degrades to no CDN tags, never stalls the page.\n */\n snippets: async (): Promise<AppSnippet[]> => {\n const { data } = await api\n .get('apps/snippets', { timeout: 2500 })\n .json<{ data?: AppSnippet[] }>();\n return data ?? [];\n },\n\n /**\n * Per-app public `app.*` buckets, keyed by encoded app id. Timeout-bounded (SSR-awaited):\n * a slow response degrades to empty buckets (fail-open), never strands injection.\n */\n settings: async (): Promise<AppSettings> => {\n const { data } = await api\n .get('apps/snippets/settings', { timeout: 2500 })\n .json<{ data?: Partial<AppSettings> }>();\n return { apps: data?.apps ?? {} };\n },\n\n queries: {\n snippets: () =>\n queryOptions({\n queryKey: ['apps', 'snippets'],\n queryFn: () => apps.snippets(),\n // Snippets are static per session; one fetch per page load is enough.\n staleTime: Infinity,\n // No retry: this is awaited in rootBeforeLoad, so the router's default `retry: 1` would\n // make the SSR wait 2 x the 2500ms timeout (plus backoff) before failing open. The\n // 2500ms timeout must be the whole budget; the client fallback query does the retrying.\n retry: 0,\n }),\n\n settings: () =>\n queryOptions({\n queryKey: ['apps', 'settings'],\n queryFn: () => apps.settings(),\n // Encoded app ids and their buckets are stable per page; one fetch is enough.\n staleTime: Infinity,\n retry: 0,\n }),\n },\n};\n"]}
|
|
@@ -7,7 +7,7 @@ import { createIsomorphicFn } from '@tanstack/react-start';
|
|
|
7
7
|
import { getCookie } from '@tanstack/react-start/server';
|
|
8
8
|
|
|
9
9
|
// src/utils/engine-version.ts
|
|
10
|
-
var ENGINE_VERSION = "1.0.
|
|
10
|
+
var ENGINE_VERSION = "1.0.139" ;
|
|
11
11
|
var DEV_SETTINGS_TTL_MS = 60 * 6e4;
|
|
12
12
|
var HIT_HEADER = "x-twilight-dev-cache";
|
|
13
13
|
var FETCHED_AT_HEADER = "x-twilight-dev-fetched-at";
|
|
@@ -242,5 +242,5 @@ var filesCdn = ky.extend({
|
|
|
242
242
|
});
|
|
243
243
|
|
|
244
244
|
export { ENGINE_VERSION, STORE_IDENTIFIER_HEADER, api, cdn, devSettingsFetchedAt, filesCdn, getActiveCurrency, getActiveScope, getActiveScopeId, getAuthToken };
|
|
245
|
-
//# sourceMappingURL=chunk-
|
|
246
|
-
//# sourceMappingURL=chunk-
|
|
245
|
+
//# sourceMappingURL=chunk-J5OJ7JM2.js.map
|
|
246
|
+
//# sourceMappingURL=chunk-J5OJ7JM2.js.map
|