@salla.sa/twilight-theme-engine 1.0.152 → 1.0.153
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-HOBSTMWX.js → AddToCartForm-SOC5GBBM.js} +3 -3
- package/dist/{AddToCartForm-HOBSTMWX.js.map → AddToCartForm-SOC5GBBM.js.map} +1 -1
- package/dist/{BlogAuthorPage-56OY5GCN.js → BlogAuthorPage-TTL4SIQA.js} +16 -16
- package/dist/{BlogAuthorPage-56OY5GCN.js.map → BlogAuthorPage-TTL4SIQA.js.map} +1 -1
- package/dist/{BlogCategoryPage-HW7A6RNL.js → BlogCategoryPage-RQ3VXFKP.js} +16 -16
- package/dist/{BlogCategoryPage-HW7A6RNL.js.map → BlogCategoryPage-RQ3VXFKP.js.map} +1 -1
- package/dist/{BlogPage-RRHKP3GP.js → BlogPage-TAGSF4PK.js} +14 -14
- package/dist/{BlogPage-RRHKP3GP.js.map → BlogPage-TAGSF4PK.js.map} +1 -1
- package/dist/{BlogSinglePage-STNMFQHX.js → BlogSinglePage-WFECBPGR.js} +14 -14
- package/dist/{BlogSinglePage-STNMFQHX.js.map → BlogSinglePage-WFECBPGR.js.map} +1 -1
- package/dist/{BlogTagPage-YD3EPTQY.js → BlogTagPage-LEUUDNOX.js} +16 -16
- package/dist/{BlogTagPage-YD3EPTQY.js.map → BlogTagPage-LEUUDNOX.js.map} +1 -1
- package/dist/{BrandsPage-KJFB4QBN.js → BrandsPage-3DKJL2UC.js} +15 -15
- package/dist/{BrandsPage-KJFB4QBN.js.map → BrandsPage-3DKJL2UC.js.map} +1 -1
- package/dist/{Breadcrumb-QKHYTTFB.js → Breadcrumb-CZUWG3RH.js} +14 -14
- package/dist/{Breadcrumb-QKHYTTFB.js.map → Breadcrumb-CZUWG3RH.js.map} +1 -1
- package/dist/{CartItem-DCCYGMRI.js → CartItem-ZZZ34FK2.js} +14 -14
- package/dist/{CartItem-DCCYGMRI.js.map → CartItem-ZZZ34FK2.js.map} +1 -1
- package/dist/{CartSummary-DAAYDRFS.js → CartSummary-YICFP2HG.js} +14 -14
- package/dist/{CartSummary-DAAYDRFS.js.map → CartSummary-YICFP2HG.js.map} +1 -1
- package/dist/{Copyright-GL5Q4FTN.js → Copyright-N7AWWM6R.js} +3 -3
- package/dist/{Copyright-GL5Q4FTN.js.map → Copyright-N7AWWM6R.js.map} +1 -1
- package/dist/{CustomerLayout-D7HC4G7V.js → CustomerLayout-CDARXLTX.js} +14 -14
- package/dist/{CustomerLayout-D7HC4G7V.js.map → CustomerLayout-CDARXLTX.js.map} +1 -1
- package/dist/{Footer-3NQWLPAA.js → Footer-UAEQ5SBA.js} +4 -4
- package/dist/{Footer-3NQWLPAA.js.map → Footer-UAEQ5SBA.js.map} +1 -1
- package/dist/{Header-SCR46P4B.js → Header-TNV53WAC.js} +8 -8
- package/dist/{Header-SCR46P4B.js.map → Header-TNV53WAC.js.map} +1 -1
- package/dist/{LatestProducts-4UML6BNG.js → LatestProducts-CPULMFWH.js} +16 -16
- package/dist/{LatestProducts-4UML6BNG.js.map → LatestProducts-CPULMFWH.js.map} +1 -1
- package/dist/{LoyaltyPage-CQIUT7MD.js → LoyaltyPage-YYYXZOYO.js} +14 -14
- package/dist/{LoyaltyPage-CQIUT7MD.js.map → LoyaltyPage-YYYXZOYO.js.map} +1 -1
- package/dist/{LoyaltyPointsPage-ZOZFDRZT.js → LoyaltyPointsPage-66N76CP7.js} +6 -6
- package/dist/{LoyaltyPointsPage-ZOZFDRZT.js.map → LoyaltyPointsPage-66N76CP7.js.map} +1 -1
- package/dist/{MainMenu-YLCB4MT7.js → MainMenu-7WKMQYJE.js} +5 -5
- package/dist/{MainMenu-YLCB4MT7.js.map → MainMenu-7WKMQYJE.js.map} +1 -1
- package/dist/{MasterLayout-BDDKPLS6.js → MasterLayout-NXS4567C.js} +14 -14
- package/dist/{MasterLayout-BDDKPLS6.js.map → MasterLayout-NXS4567C.js.map} +1 -1
- package/dist/{MobileMenu-S5LB622I.js → MobileMenu-2ISSFTOL.js} +15 -15
- package/dist/{MobileMenu-S5LB622I.js.map → MobileMenu-2ISSFTOL.js.map} +1 -1
- package/dist/{NotificationsPage-FPF7UU3Q.js → NotificationsPage-GRLVJK4Q.js} +14 -14
- package/dist/{NotificationsPage-FPF7UU3Q.js.map → NotificationsPage-GRLVJK4Q.js.map} +1 -1
- package/dist/{OrderSinglePage-M37ROUBX.js → OrderSinglePage-XEX3ZDU4.js} +15 -15
- package/dist/{OrderSinglePage-M37ROUBX.js.map → OrderSinglePage-XEX3ZDU4.js.map} +1 -1
- package/dist/{OrdersPage-GIZFTPQ7.js → OrdersPage-7H5NZQYQ.js} +14 -14
- package/dist/{OrdersPage-GIZFTPQ7.js.map → OrdersPage-7H5NZQYQ.js.map} +1 -1
- package/dist/{PageSingle-EQD5Y3L5.js → PageSingle-Q6RGRZEC.js} +3 -3
- package/dist/{PageSingle-EQD5Y3L5.js.map → PageSingle-Q6RGRZEC.js.map} +1 -1
- package/dist/{ProductDetails-53BXVF37.js → ProductDetails-6W6YIGUS.js} +4 -4
- package/dist/{ProductDetails-53BXVF37.js.map → ProductDetails-6W6YIGUS.js.map} +1 -1
- package/dist/{ProfilePage-6GJXTBFN.js → ProfilePage-P5NHML4X.js} +14 -14
- package/dist/{ProfilePage-6GJXTBFN.js.map → ProfilePage-P5NHML4X.js.map} +1 -1
- package/dist/{ReviewsPage-SCHVMKXV.js → ReviewsPage-D2EPXJJZ.js} +3 -3
- package/dist/{ReviewsPage-SCHVMKXV.js.map → ReviewsPage-D2EPXJJZ.js.map} +1 -1
- package/dist/{SeoCartWidget-IUXLYOTC.js → SeoCartWidget-VMNWM3FM.js} +14 -14
- package/dist/{SeoCartWidget-IUXLYOTC.js.map → SeoCartWidget-VMNWM3FM.js.map} +1 -1
- package/dist/{SettingsPage-2TKL2COF.js → SettingsPage-JYEI7C4T.js} +14 -14
- package/dist/{SettingsPage-2TKL2COF.js.map → SettingsPage-JYEI7C4T.js.map} +1 -1
- package/dist/{StoreClosedNotification-HHOQXT6N.js → StoreClosedNotification-U36UX33X.js} +15 -15
- package/dist/{StoreClosedNotification-HHOQXT6N.js.map → StoreClosedNotification-U36UX33X.js.map} +1 -1
- package/dist/{TestimonialsPage-GJJT7F5G.js → TestimonialsPage-O2FN7CPT.js} +3 -3
- package/dist/{TestimonialsPage-GJJT7F5G.js.map → TestimonialsPage-O2FN7CPT.js.map} +1 -1
- package/dist/{ThankYouPage-ZAEZWSUK.js → ThankYouPage-UEHR5653.js} +14 -14
- package/dist/{ThankYouPage-ZAEZWSUK.js.map → ThankYouPage-UEHR5653.js.map} +1 -1
- package/dist/{WalletPage-74LAUONG.js → WalletPage-5X37XHOU.js} +15 -15
- package/dist/{WalletPage-74LAUONG.js.map → WalletPage-5X37XHOU.js.map} +1 -1
- package/dist/{WebMcpTools-J6HCO5B6.js → WebMcpTools-6ZN6KROP.js} +5 -5
- package/dist/{WebMcpTools-J6HCO5B6.js.map → WebMcpTools-6ZN6KROP.js.map} +1 -1
- package/dist/{WishlistPage-SV55V5CP.js → WishlistPage-2JCIUJEP.js} +16 -16
- package/dist/{WishlistPage-SV55V5CP.js.map → WishlistPage-2JCIUJEP.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-UL2DRYH3.js → chunk-2BRLDR24.js} +3 -3
- package/dist/{chunk-UL2DRYH3.js.map → chunk-2BRLDR24.js.map} +1 -1
- package/dist/{chunk-MJQ3HFLJ.js → chunk-3YMCWKFT.js} +3 -3
- package/dist/{chunk-MJQ3HFLJ.js.map → chunk-3YMCWKFT.js.map} +1 -1
- package/dist/{chunk-VBAFSMNX.js → chunk-46CWPZSI.js} +3 -3
- package/dist/{chunk-VBAFSMNX.js.map → chunk-46CWPZSI.js.map} +1 -1
- package/dist/{chunk-64RDACOS.js → chunk-4FPHFWEU.js} +4 -4
- package/dist/{chunk-64RDACOS.js.map → chunk-4FPHFWEU.js.map} +1 -1
- package/dist/{chunk-I3KAWUPG.js → chunk-4UPADKLB.js} +4 -4
- package/dist/{chunk-I3KAWUPG.js.map → chunk-4UPADKLB.js.map} +1 -1
- package/dist/{chunk-A2SS3TNE.js → chunk-4XT63VFN.js} +3 -3
- package/dist/{chunk-A2SS3TNE.js.map → chunk-4XT63VFN.js.map} +1 -1
- package/dist/{chunk-EAQAPYYU.js → chunk-53ULTYEF.js} +7 -7
- package/dist/{chunk-EAQAPYYU.js.map → chunk-53ULTYEF.js.map} +1 -1
- package/dist/{chunk-XEHOZTER.js → chunk-5WVJYMDS.js} +3 -3
- package/dist/{chunk-XEHOZTER.js.map → chunk-5WVJYMDS.js.map} +1 -1
- package/dist/{chunk-F5RU2UCE.js → chunk-6REUUGFM.js} +15 -15
- package/dist/{chunk-F5RU2UCE.js.map → chunk-6REUUGFM.js.map} +1 -1
- package/dist/{chunk-R4LA6IMS.js → chunk-6VBQ6HJO.js} +3 -3
- package/dist/{chunk-R4LA6IMS.js.map → chunk-6VBQ6HJO.js.map} +1 -1
- package/dist/{chunk-OZRGUVHQ.js → chunk-7RM7W4G7.js} +4 -4
- package/dist/{chunk-OZRGUVHQ.js.map → chunk-7RM7W4G7.js.map} +1 -1
- package/dist/{chunk-LAO3MSKN.js → chunk-7TEJBYGD.js} +7 -7
- package/dist/{chunk-LAO3MSKN.js.map → chunk-7TEJBYGD.js.map} +1 -1
- package/dist/{chunk-LJXWCGBH.js → chunk-A5QIBUZ5.js} +7 -7
- package/dist/{chunk-LJXWCGBH.js.map → chunk-A5QIBUZ5.js.map} +1 -1
- package/dist/{chunk-UBRG55VM.js → chunk-AME4LBNH.js} +4 -4
- package/dist/{chunk-UBRG55VM.js.map → chunk-AME4LBNH.js.map} +1 -1
- package/dist/{chunk-S5KE6KPV.js → chunk-ASLHSLMC.js} +4 -4
- package/dist/{chunk-S5KE6KPV.js.map → chunk-ASLHSLMC.js.map} +1 -1
- package/dist/{chunk-BIVBSVWR.js → chunk-BBTYM4OY.js} +4 -4
- package/dist/{chunk-BIVBSVWR.js.map → chunk-BBTYM4OY.js.map} +1 -1
- package/dist/{chunk-ZBGMIDDO.js → chunk-DWWPRLD3.js} +3 -3
- package/dist/{chunk-ZBGMIDDO.js.map → chunk-DWWPRLD3.js.map} +1 -1
- package/dist/{chunk-FCFIG4M3.js → chunk-EMGVOEZZ.js} +3 -3
- package/dist/{chunk-FCFIG4M3.js.map → chunk-EMGVOEZZ.js.map} +1 -1
- package/dist/{chunk-XTBFIIAR.js → chunk-G4DDINNW.js} +4 -4
- package/dist/{chunk-XTBFIIAR.js.map → chunk-G4DDINNW.js.map} +1 -1
- package/dist/{chunk-UG44HSCN.js → chunk-JIFM6LXR.js} +4 -4
- package/dist/{chunk-UG44HSCN.js.map → chunk-JIFM6LXR.js.map} +1 -1
- package/dist/{chunk-IO4CVUL5.js → chunk-KAIASXU7.js} +6 -4
- package/dist/chunk-KAIASXU7.js.map +1 -0
- package/dist/{chunk-BWKHA4ZD.js → chunk-LDDZ7TUR.js} +4 -4
- package/dist/{chunk-BWKHA4ZD.js.map → chunk-LDDZ7TUR.js.map} +1 -1
- package/dist/{chunk-CV32FSEL.js → chunk-LYKDZ74X.js} +3 -3
- package/dist/{chunk-CV32FSEL.js.map → chunk-LYKDZ74X.js.map} +1 -1
- package/dist/{chunk-JWYZLXJZ.js → chunk-MO2NP3WX.js} +5 -5
- package/dist/{chunk-JWYZLXJZ.js.map → chunk-MO2NP3WX.js.map} +1 -1
- package/dist/{chunk-N2RAPPQ3.js → chunk-O6O2PDH5.js} +4 -4
- package/dist/{chunk-N2RAPPQ3.js.map → chunk-O6O2PDH5.js.map} +1 -1
- package/dist/{chunk-AU2XMLTH.js → chunk-ONBDJMLJ.js} +3 -3
- package/dist/{chunk-AU2XMLTH.js.map → chunk-ONBDJMLJ.js.map} +1 -1
- package/dist/{chunk-KNY2ZZ5M.js → chunk-P7RERWEY.js} +3 -3
- package/dist/{chunk-KNY2ZZ5M.js.map → chunk-P7RERWEY.js.map} +1 -1
- package/dist/{chunk-HSJCVD3P.js → chunk-PBTIZ7UF.js} +4 -4
- package/dist/{chunk-HSJCVD3P.js.map → chunk-PBTIZ7UF.js.map} +1 -1
- package/dist/{chunk-677OXNGV.js → chunk-PSWUFTNS.js} +3 -3
- package/dist/{chunk-677OXNGV.js.map → chunk-PSWUFTNS.js.map} +1 -1
- package/dist/{chunk-AFFBCOH6.js → chunk-QEE2A7O2.js} +3 -3
- package/dist/{chunk-AFFBCOH6.js.map → chunk-QEE2A7O2.js.map} +1 -1
- package/dist/{chunk-5VTVPQQB.js → chunk-QJR5FRIA.js} +4 -4
- package/dist/{chunk-5VTVPQQB.js.map → chunk-QJR5FRIA.js.map} +1 -1
- package/dist/chunk-T3GORIJL.js +69 -0
- package/dist/chunk-T3GORIJL.js.map +1 -0
- package/dist/{chunk-EFKVEYML.js → chunk-T3UUH7YX.js} +5 -5
- package/dist/{chunk-EFKVEYML.js.map → chunk-T3UUH7YX.js.map} +1 -1
- package/dist/{chunk-LPF6YURL.js → chunk-TK2ZIYF6.js} +3 -3
- package/dist/{chunk-LPF6YURL.js.map → chunk-TK2ZIYF6.js.map} +1 -1
- package/dist/{chunk-BY4DQTOG.js → chunk-U7ZHPOGI.js} +7 -7
- package/dist/{chunk-BY4DQTOG.js.map → chunk-U7ZHPOGI.js.map} +1 -1
- package/dist/{chunk-URBOD4MX.js → chunk-WYMDZDEZ.js} +3 -3
- package/dist/{chunk-URBOD4MX.js.map → chunk-WYMDZDEZ.js.map} +1 -1
- package/dist/{chunk-4SZNUX4K.js → chunk-YBWXK2OT.js} +11 -11
- package/dist/{chunk-4SZNUX4K.js.map → chunk-YBWXK2OT.js.map} +1 -1
- package/dist/{chunk-ZC4O472R.js → chunk-YY74QOIL.js} +5 -5
- package/dist/{chunk-ZC4O472R.js.map → chunk-YY74QOIL.js.map} +1 -1
- package/dist/{chunk-O76H6TDP.js → chunk-YZPHKPYI.js} +3 -3
- package/dist/{chunk-O76H6TDP.js.map → chunk-YZPHKPYI.js.map} +1 -1
- package/dist/{chunk-I5GFTVR2.js → chunk-ZHBZ6YMB.js} +4 -4
- package/dist/{chunk-I5GFTVR2.js.map → chunk-ZHBZ6YMB.js.map} +1 -1
- package/dist/{chunk-SXJEZEGN.js → chunk-ZKTSLYTT.js} +3 -3
- package/dist/{chunk-SXJEZEGN.js.map → chunk-ZKTSLYTT.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/index.js +17 -17
- package/dist/components/layout/index.js +4 -4
- package/dist/components/product/index.js +14 -14
- 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-XYBFXCE7.js → document-class-YJDZSSZA.js} +12 -12
- package/dist/{document-class-XYBFXCE7.js.map → document-class-YJDZSSZA.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-SHFUWYCA.js → navigation-W43IKI56.js} +5 -5
- package/dist/{navigation-SHFUWYCA.js.map → navigation-W43IKI56.js.map} +1 -1
- package/dist/{navigation-QDTYXINL.js → navigation-XQLKHMIZ.js} +4 -4
- package/dist/{navigation-QDTYXINL.js.map → navigation-XQLKHMIZ.js.map} +1 -1
- package/dist/{not-found-IFD562WC.js → not-found-LE7TH53E.js} +15 -15
- package/dist/{not-found-IFD562WC.js.map → not-found-LE7TH53E.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 -21
- package/dist/routes/home.js +18 -18
- 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 +22 -22
- package/dist/routes/product.js +17 -17
- package/dist/routes/seo-redirects.d.ts +12 -0
- package/dist/routes/seo-redirects.d.ts.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 -18
- package/dist/{store-lookup-AJT3ZHTS.js → store-lookup-FL54XOJB.js} +8 -8
- package/dist/{store-lookup-AJT3ZHTS.js.map → store-lookup-FL54XOJB.js.map} +1 -1
- package/dist/tanstack/link.d.ts.map +1 -1
- package/dist/tanstack/templates/locale-wrapper.d.ts.map +1 -1
- package/dist/tanstack.js +12 -12
- package/dist/utils/index.js +2 -2
- package/dist/vite/index.js +3 -1
- package/dist/vite/index.js.map +1 -1
- package/package.json +1 -1
- package/tailwind/routes/seo-redirects.ts.txt +52 -2
- package/dist/chunk-IO4CVUL5.js.map +0 -1
- package/dist/chunk-SIYINCXL.js +0 -41
- package/dist/chunk-SIYINCXL.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/product/lazy.ts","../src/components/product/ProductGallery.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAEO,IAAM,kBAAA,GAAqB,aAAA;AAAA,EAAc,MAC9C,OAAO,8BAAkB,CAAA,CAAE,IAAA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A,MACpH,gBAAc,KAAA,CAAM,GAAA;AAAA,MAEpB,QAAA,kBAAA,GAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,KAAK,KAAA,CAAM,GAAA;AAAA,UACX,GAAA,EAAK,MAAM,GAAA,IAAO,EAAA;AAAA,UAClB,SAAA,EAAU,mEAAA;AAAA,UACV,OAAO,KAAA,CAAM,GAAA;AAAA,UACb,UAAU,KAAA,GAAQ,CAAA;AAAA,UAClB,SAAA,EAAS;AAAA;AAAA;AACX;AAAA,GACF;AAEJ","file":"chunk-ZC4O472R.js","sourcesContent":["import { lazyComponent } from '../../utils/lazy-component';\n\nexport const LazyProductDetails = lazyComponent(() =>\n import('./ProductDetails').then((m) => ({ default: m.ProductDetails }))\n);\n\nexport const LazyAddToCartForm = lazyComponent(() =>\n import('./AddToCartForm').then((m) => ({ default: m.AddToCartForm }))\n);\n","import { SallaSlider } from '@salla.sa/twilight-components-react/slider';\nimport { Suspense, useEffect, useMemo, useState } from 'react';\nimport { registry } from '../ComponentRegistry';\nimport { useTwilight } from '../../providers/TwilightProvider';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport type { Product, ProductImage } from '../../types';\nimport { Image } from '../common/Image';\nimport { ImageModal } from '../modal';\nimport { isNativeApp } from '../../native-app';\n\nconst PRODUCT_GALLERY_KEY = 'product:gallery';\n\nexport interface ProductGalleryProps {\n product: Product;\n}\n\ntype ImagePreview = { src: string; alt: string };\ntype GalleryMedia = { url: string; type: 'image' | 'video' | '3d-image' };\n\n/**\n * The engine's own `mobile::gallery.open` payload from before `salla.mobile.openGallery`: a video's\n * link and a 3D model's file go in `url`, with no ids. Sent when the SDK has no `openGallery`\n * (Twilight before 2.14.569) or declines inside the app, so those stores keep the gallery they had.\n */\nfunction legacyGalleryMedia(images: ProductImage[]): GalleryMedia[] {\n return images.flatMap<GalleryMedia>((image) => {\n if (image.three_d_image_url) return [{ url: image.three_d_image_url, type: '3d-image' }];\n if (image.video_url) return [{ url: image.video_url, type: 'video' }];\n return image.url ? [{ url: image.url, type: 'image' }] : [];\n });\n}\n\nfunction ProductGalleryContent({ product }: ProductGalleryProps) {\n const { t } = useTranslation();\n const { theme } = useTwilight();\n const sliderId = `details-slider-${product.id}`;\n const objectFit = theme.settings.slider_background_size ?? 'cover';\n\n // Clicking an image opens an in-app lightbox instead of navigating to the CDN URL.\n const [preview, setPreview] = useState<ImagePreview | null>(null);\n\n useEffect(() => {\n const raf = requestAnimationFrame(() => {\n const el = document.getElementById(sliderId);\n if (!el?.parentElement) return;\n const { parentElement, nextSibling } = el;\n parentElement.removeChild(el);\n parentElement.insertBefore(el, nextSibling);\n });\n return () => cancelAnimationFrame(raf);\n }, [sliderId]);\n\n // The product-details API only returns `image` (singular).\n // Fall back so the main image always renders even without the full gallery array.\n const images: ProductImage[] =\n product.images && product.images.length > 0\n ? product.images\n : product.image?.url\n ? [product.image]\n : [];\n\n const hasManyImages = images.length > 1;\n const openNativeGallery = (selected: ProductImage) => {\n if (!isNativeApp()) return false;\n if (window.salla?.mobile?.openGallery?.(images, selected)) return true;\n window.salla?.event.dispatch('mobile::gallery.open', { images: legacyGalleryMedia(images) });\n return true;\n };\n\n return (\n <div className=\"sidebar md:sticky top-24 w-full md:!w-2/4 rtl:ml-8 ltr:mr-8 pb-8 md:pb-16 overflow-hidden shrink-0\">\n <SallaSlider\n id={sliderId}\n className=\"details-slider rounded-md image-slider\"\n type=\"thumbs\"\n loop={false}\n autoHeight\n listenToThumbnailsOption\n showThumbsControls={false}\n sliderConfig={{ watchOverflow: true, autoHeight: true }}\n >\n {product.promotion_title && (\n <div className=\"promotion-title\">{product.promotion_title}</div>\n )}\n\n {product.calories && (\n <div className=\"absolute z-[2] top-4 rtl:left-4 ltr:right-4 bg-white shadow-sm flex flex-col justify-center items-center rounded-full w-20 h-20 md:w-24 md:h-24\">\n <span className=\"text-red-500 text-xl leading-none font-bold\">{product.calories}</span>\n <span className=\"text-xs text-gray-500\">\n {t('pages.products.calories', 'Calories')}\n </span>\n </div>\n )}\n\n <div slot=\"items\">\n {images.map((image, index) => (\n <ImageSlide\n key={image.id ?? image.three_d_image_url ?? image.video_url ?? image.url}\n image={image}\n product={product}\n index={index}\n objectFit={objectFit}\n onPreview={setPreview}\n onNativeOpen={openNativeGallery}\n />\n ))}\n </div>\n\n {hasManyImages && (\n <div slot=\"thumbs\">\n {images.map((image, index) => (\n <ThumbSlide\n key={image.id ?? image.three_d_image_url ?? image.video_url ?? image.url}\n image={image}\n index={index}\n />\n ))}\n </div>\n )}\n </SallaSlider>\n\n <Suspense fallback={null}>\n <ImageModal\n isOpen={!!preview}\n onClose={() => setPreview(null)}\n src={preview?.src ?? ''}\n alt={preview?.alt}\n />\n </Suspense>\n </div>\n );\n}\n\nexport function ProductGallery(props: ProductGalleryProps) {\n const Component = useMemo(() => {\n const resolved = registry.resolve<ProductGalleryProps>(PRODUCT_GALLERY_KEY);\n // A theme that seeds the key with this component (register + override) would\n // otherwise recurse into itself when it has not actually overridden anything.\n return resolved === ProductGallery ? null : resolved;\n }, []);\n\n if (Component) {\n return <Component {...props} />;\n }\n\n return <ProductGalleryContent {...props} />;\n}\n\nfunction ImageSlide({\n image,\n product,\n index,\n objectFit,\n onPreview,\n onNativeOpen,\n}: {\n image: ProductImage;\n product: Product;\n index: number;\n objectFit: 'cover' | 'contain';\n onPreview: (preview: ImagePreview) => void;\n onNativeOpen: (image: ProductImage) => boolean;\n}) {\n const [loaded, setLoaded] = useState(false);\n const isVideo = Boolean(image.video_url);\n\n if (image.three_d_image_url) {\n return (\n // biome-ignore lint/a11y/noStaticElementInteractions: model-viewer is an interactive web component.\n <model-viewer\n style={{ minHeight: '500px' }}\n className=\"swiper-slide model-entry w-full h-full\"\n loading=\"lazy\"\n camera-controls\n touch-action=\"pan-y\"\n auto-rotate\n poster={image.url || undefined}\n src={image.three_d_image_url}\n shadow-intensity=\"1\"\n alt={image.alt}\n onClick={() => onNativeOpen(image)}\n ></model-viewer>\n );\n }\n\n return (\n <a\n data-fslightbox={`product_${product.id}`}\n data-img-id={image.id}\n data-slid-index={index}\n {...(image.video_url ? { 'data-video-src': image.video_url } : {})}\n data-caption={image.alt}\n data-infinite=\"false\"\n data-type={image.video_url ? 'youtube' : 'image'}\n href={image.video_url || image.url}\n // FsLightbox isn't loaded in this React theme, so the bare href would leave the SPA.\n // Open images in an in-app lightbox; let videos open in a new tab.\n {...(isVideo ? { target: '_blank', rel: 'noopener noreferrer' } : {})}\n onClick={(event) => {\n if (onNativeOpen(image)) {\n event.preventDefault();\n return;\n }\n if (isVideo || !image.url) return;\n event.preventDefault();\n onPreview({ src: image.url, alt: image.alt || product.name });\n }}\n aria-label={product.name}\n className={`swiper-slide magnify-wrapper homeslider__slide ${image.video_url ? 'video-entry' : ''}`}\n >\n <div className={`w-full ${loaded ? '' : 'aspect-square bg-gray-100 animate-pulse'}`}>\n <Image\n id={String(image.id)}\n src={image.url}\n alt={image.alt || product.name}\n className={`h-full w-full object-${objectFit}`}\n aspectRatio=\"1/1\"\n priority={index === 0}\n noWrapper\n onLoad={() => setLoaded(true)}\n />\n </div>\n </a>\n );\n}\n\nfunction ThumbSlide({ image, index }: { image: ProductImage; index: number }) {\n return (\n <div\n className={`slide--one-fourth ${image.video_url ? 'video-entry' : ''} ${image.three_d_image_url ? 'model-entry' : ''}`}\n data-caption={image.alt}\n >\n <Image\n src={image.url}\n alt={image.alt || ''}\n className=\"object-cover w-full h-full bg-gray-100 rounded-md overflow-hidden\"\n title={image.alt}\n priority={index < 5}\n noWrapper\n />\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/product/lazy.ts","../src/components/product/ProductGallery.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAEO,IAAM,kBAAA,GAAqB,aAAA;AAAA,EAAc,MAC9C,OAAO,8BAAkB,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,MAAO,EAAE,OAAA,EAAS,CAAA,CAAE,cAAA,EAAe,CAAE;AACxE;AAEO,IAAM,iBAAA,G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A,UACC,KAAK,KAAA,CAAM,GAAA;AAAA,UACX,GAAA,EAAK,MAAM,GAAA,IAAO,EAAA;AAAA,UAClB,SAAA,EAAU,mEAAA;AAAA,UACV,OAAO,KAAA,CAAM,GAAA;AAAA,UACb,UAAU,KAAA,GAAQ,CAAA;AAAA,UAClB,SAAA,EAAS;AAAA;AAAA;AACX;AAAA,GACF;AAEJ","file":"chunk-YY74QOIL.js","sourcesContent":["import { lazyComponent } from '../../utils/lazy-component';\n\nexport const LazyProductDetails = lazyComponent(() =>\n import('./ProductDetails').then((m) => ({ default: m.ProductDetails }))\n);\n\nexport const LazyAddToCartForm = lazyComponent(() =>\n import('./AddToCartForm').then((m) => ({ default: m.AddToCartForm }))\n);\n","import { SallaSlider } from '@salla.sa/twilight-components-react/slider';\nimport { Suspense, useEffect, useMemo, useState } from 'react';\nimport { registry } from '../ComponentRegistry';\nimport { useTwilight } from '../../providers/TwilightProvider';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport type { Product, ProductImage } from '../../types';\nimport { Image } from '../common/Image';\nimport { ImageModal } from '../modal';\nimport { isNativeApp } from '../../native-app';\n\nconst PRODUCT_GALLERY_KEY = 'product:gallery';\n\nexport interface ProductGalleryProps {\n product: Product;\n}\n\ntype ImagePreview = { src: string; alt: string };\ntype GalleryMedia = { url: string; type: 'image' | 'video' | '3d-image' };\n\n/**\n * The engine's own `mobile::gallery.open` payload from before `salla.mobile.openGallery`: a video's\n * link and a 3D model's file go in `url`, with no ids. Sent when the SDK has no `openGallery`\n * (Twilight before 2.14.569) or declines inside the app, so those stores keep the gallery they had.\n */\nfunction legacyGalleryMedia(images: ProductImage[]): GalleryMedia[] {\n return images.flatMap<GalleryMedia>((image) => {\n if (image.three_d_image_url) return [{ url: image.three_d_image_url, type: '3d-image' }];\n if (image.video_url) return [{ url: image.video_url, type: 'video' }];\n return image.url ? [{ url: image.url, type: 'image' }] : [];\n });\n}\n\nfunction ProductGalleryContent({ product }: ProductGalleryProps) {\n const { t } = useTranslation();\n const { theme } = useTwilight();\n const sliderId = `details-slider-${product.id}`;\n const objectFit = theme.settings.slider_background_size ?? 'cover';\n\n // Clicking an image opens an in-app lightbox instead of navigating to the CDN URL.\n const [preview, setPreview] = useState<ImagePreview | null>(null);\n\n useEffect(() => {\n const raf = requestAnimationFrame(() => {\n const el = document.getElementById(sliderId);\n if (!el?.parentElement) return;\n const { parentElement, nextSibling } = el;\n parentElement.removeChild(el);\n parentElement.insertBefore(el, nextSibling);\n });\n return () => cancelAnimationFrame(raf);\n }, [sliderId]);\n\n // The product-details API only returns `image` (singular).\n // Fall back so the main image always renders even without the full gallery array.\n const images: ProductImage[] =\n product.images && product.images.length > 0\n ? product.images\n : product.image?.url\n ? [product.image]\n : [];\n\n const hasManyImages = images.length > 1;\n const openNativeGallery = (selected: ProductImage) => {\n if (!isNativeApp()) return false;\n if (window.salla?.mobile?.openGallery?.(images, selected)) return true;\n window.salla?.event.dispatch('mobile::gallery.open', { images: legacyGalleryMedia(images) });\n return true;\n };\n\n return (\n <div className=\"sidebar md:sticky top-24 w-full md:!w-2/4 rtl:ml-8 ltr:mr-8 pb-8 md:pb-16 overflow-hidden shrink-0\">\n <SallaSlider\n id={sliderId}\n className=\"details-slider rounded-md image-slider\"\n type=\"thumbs\"\n loop={false}\n autoHeight\n listenToThumbnailsOption\n showThumbsControls={false}\n sliderConfig={{ watchOverflow: true, autoHeight: true }}\n >\n {product.promotion_title && (\n <div className=\"promotion-title\">{product.promotion_title}</div>\n )}\n\n {product.calories && (\n <div className=\"absolute z-[2] top-4 rtl:left-4 ltr:right-4 bg-white shadow-sm flex flex-col justify-center items-center rounded-full w-20 h-20 md:w-24 md:h-24\">\n <span className=\"text-red-500 text-xl leading-none font-bold\">{product.calories}</span>\n <span className=\"text-xs text-gray-500\">\n {t('pages.products.calories', 'Calories')}\n </span>\n </div>\n )}\n\n <div slot=\"items\">\n {images.map((image, index) => (\n <ImageSlide\n key={image.id ?? image.three_d_image_url ?? image.video_url ?? image.url}\n image={image}\n product={product}\n index={index}\n objectFit={objectFit}\n onPreview={setPreview}\n onNativeOpen={openNativeGallery}\n />\n ))}\n </div>\n\n {hasManyImages && (\n <div slot=\"thumbs\">\n {images.map((image, index) => (\n <ThumbSlide\n key={image.id ?? image.three_d_image_url ?? image.video_url ?? image.url}\n image={image}\n index={index}\n />\n ))}\n </div>\n )}\n </SallaSlider>\n\n <Suspense fallback={null}>\n <ImageModal\n isOpen={!!preview}\n onClose={() => setPreview(null)}\n src={preview?.src ?? ''}\n alt={preview?.alt}\n />\n </Suspense>\n </div>\n );\n}\n\nexport function ProductGallery(props: ProductGalleryProps) {\n const Component = useMemo(() => {\n const resolved = registry.resolve<ProductGalleryProps>(PRODUCT_GALLERY_KEY);\n // A theme that seeds the key with this component (register + override) would\n // otherwise recurse into itself when it has not actually overridden anything.\n return resolved === ProductGallery ? null : resolved;\n }, []);\n\n if (Component) {\n return <Component {...props} />;\n }\n\n return <ProductGalleryContent {...props} />;\n}\n\nfunction ImageSlide({\n image,\n product,\n index,\n objectFit,\n onPreview,\n onNativeOpen,\n}: {\n image: ProductImage;\n product: Product;\n index: number;\n objectFit: 'cover' | 'contain';\n onPreview: (preview: ImagePreview) => void;\n onNativeOpen: (image: ProductImage) => boolean;\n}) {\n const [loaded, setLoaded] = useState(false);\n const isVideo = Boolean(image.video_url);\n\n if (image.three_d_image_url) {\n return (\n // biome-ignore lint/a11y/noStaticElementInteractions: model-viewer is an interactive web component.\n <model-viewer\n style={{ minHeight: '500px' }}\n className=\"swiper-slide model-entry w-full h-full\"\n loading=\"lazy\"\n camera-controls\n touch-action=\"pan-y\"\n auto-rotate\n poster={image.url || undefined}\n src={image.three_d_image_url}\n shadow-intensity=\"1\"\n alt={image.alt}\n onClick={() => onNativeOpen(image)}\n ></model-viewer>\n );\n }\n\n return (\n <a\n data-fslightbox={`product_${product.id}`}\n data-img-id={image.id}\n data-slid-index={index}\n {...(image.video_url ? { 'data-video-src': image.video_url } : {})}\n data-caption={image.alt}\n data-infinite=\"false\"\n data-type={image.video_url ? 'youtube' : 'image'}\n href={image.video_url || image.url}\n // FsLightbox isn't loaded in this React theme, so the bare href would leave the SPA.\n // Open images in an in-app lightbox; let videos open in a new tab.\n {...(isVideo ? { target: '_blank', rel: 'noopener noreferrer' } : {})}\n onClick={(event) => {\n if (onNativeOpen(image)) {\n event.preventDefault();\n return;\n }\n if (isVideo || !image.url) return;\n event.preventDefault();\n onPreview({ src: image.url, alt: image.alt || product.name });\n }}\n aria-label={product.name}\n className={`swiper-slide magnify-wrapper homeslider__slide ${image.video_url ? 'video-entry' : ''}`}\n >\n <div className={`w-full ${loaded ? '' : 'aspect-square bg-gray-100 animate-pulse'}`}>\n <Image\n id={String(image.id)}\n src={image.url}\n alt={image.alt || product.name}\n className={`h-full w-full object-${objectFit}`}\n aspectRatio=\"1/1\"\n priority={index === 0}\n noWrapper\n onLoad={() => setLoaded(true)}\n />\n </div>\n </a>\n );\n}\n\nfunction ThumbSlide({ image, index }: { image: ProductImage; index: number }) {\n return (\n <div\n className={`slide--one-fourth ${image.video_url ? 'video-entry' : ''} ${image.three_d_image_url ? 'model-entry' : ''}`}\n data-caption={image.alt}\n >\n <Image\n src={image.url}\n alt={image.alt || ''}\n className=\"object-cover w-full h-full bg-gray-100 rounded-md overflow-hidden\"\n title={image.alt}\n priority={index < 5}\n noWrapper\n />\n </div>\n );\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isNotLaunchedNotice } from './chunk-BRIRWS2Q.js';
|
|
2
|
-
import { getActiveScope, api, STORE_IDENTIFIER_HEADER, devSettingsFetchedAt } from './chunk-
|
|
2
|
+
import { getActiveScope, api, STORE_IDENTIFIER_HEADER, devSettingsFetchedAt } from './chunk-EMGVOEZZ.js';
|
|
3
3
|
import { requestedThemeVersionId } from './chunk-7IVHY4OR.js';
|
|
4
4
|
import { LANGUAGE_COOKIE_NAME, LANGUAGE_COOKIE_MAX_AGE, resolveStoreIdentifier, extractScopeFromUrl, parseStoreId } from './chunk-EEL6OYAQ.js';
|
|
5
5
|
import { getTwilightContext, SettingsError } from './chunk-6K34BCUP.js';
|
|
@@ -250,5 +250,5 @@ var store = {
|
|
|
250
250
|
};
|
|
251
251
|
|
|
252
252
|
export { persistLanguageCookie, readCookieHeader, readNativeAppHeaders, readPageSearch, store };
|
|
253
|
-
//# sourceMappingURL=chunk-
|
|
254
|
-
//# sourceMappingURL=chunk-
|
|
253
|
+
//# sourceMappingURL=chunk-YZPHKPYI.js.map
|
|
254
|
+
//# sourceMappingURL=chunk-YZPHKPYI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/language-cookie.ts","../src/utils/native-app-headers.ts","../src/api/store.ts"],"names":[],"mappings":";;;;;;;;;;AAaA,IAAM,sBAAA,GAAyB,kBAAA,EAAmB,CAC/C,MAAA,CAAO,MAAqB;AAC3B,EAAA,IAAI;AACF,IAAA,OAAO,gBAAA,CAAiB,QAAQ,CAAA,IAAK,IAAA;AAAA,EACvC,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,IAAA;AAAA,EACT;AACF,CAAC,CAAA,CACA,MAAA,CAAO,MAAqB,IAAI,CAAA;AAEnC,IAAM,yBAAA,GAA4B,kBAAA,EAAmB,CAClD,MAAA,CAAO,CAAC,IAAA,KAAuB;AAC9B,EAAA,IAAI;AACF,IAAA,SAAA,CAAU,sBAAsB,IAAA,EAAM;AAAA,MACpC,IAAA,EAAM,GAAA;AAAA,MACN,MAAA,EAAQ,uBAAA;AAAA,MACR,QAAA,EAAU;AAAA,KACX,CAAA;AAAA,EACH,CAAA,CAAA,MAAQ;AAAA,EAER;AACF,CAAC,CAAA,CACA,OAAO,MAAY;AAAC,CAAC,CAAA;AAExB,IAAM,gBAAA,GAAmB,kBAAA,EAAmB,CACzC,MAAA,CAAO,MAAc;AACpB,EAAA,IAAI;AACF,IAAA,OAAO,eAAc,CAAE,MAAA;AAAA,EACzB,CAAA,CAAA,MAAQ;AACN,IAAA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,CAAA;AACpF,IAAA,MAAM,KAAA;AAAA,EACR;AACF;AAEO,IAAM,KAAA,GAAQ;AAAA,EACnB,QAAA,EAAU,OAAO,eAAA,KAA2D;AAC1E,IAAA,IAAI;AACF,MAAA,OAAO,MAAM,cAAc,eAAe,CAAA;AAAA,IAC5C,CAAA,CAAA,MAAQ;AAEN,MAAA,OAAO,IAAA;AAAA,IACT;AAAA,EACF,CAAA;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,CAAC,eAAA,KACT,YAAA,CAAkC;AAAA,MAChC,QAAA,EAAU;AAAA,QACR,OAAA;AAAA,QACA,UAAA;AAAA,QACA,eAAA;AAAA,QACA,oBAAmB,CAAE,MAAA;AAAA,QACrB,cAAA,EAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAQf,uBAAA;AAAwB,OAC1B;AAAA;AAAA,MAEA,OAAA,EAAS,MAAM,aAAA,CAAc,eAAe,CAAA;AAAA;AAAA;AAAA,MAG5C,KAAA,EAAO;AAAA,KACR;AAAA;AAEP","file":"chunk-O76H6TDP.js","sourcesContent":["/**\n * @fileoverview Reading and writing the `s-lang` cookie, on the server and in the browser.\n *\n * The server reads it from the request the framework is handling and writes it to that\n * request's response. The server-only import is stripped from the client bundle by\n * `createIsomorphicFn`, as in `routes/root/beforeLoad.ts`. The browser uses `document.cookie`.\n * Either side outside a request (a prerender, a test) has nothing to read or write and says so\n * quietly.\n */\nimport { createIsomorphicFn } from '@tanstack/react-start';\nimport { getRequestHeader, getRequestUrl, setCookie } from '@tanstack/react-start/server';\nimport { LANGUAGE_COOKIE_MAX_AGE, LANGUAGE_COOKIE_NAME } from './cookies';\n\nconst readServerCookieHeader = createIsomorphicFn()\n .server((): string | null => {\n try {\n return getRequestHeader('cookie') ?? null;\n } catch {\n return null;\n }\n })\n .client((): string | null => null);\n\nconst writeServerLanguageCookie = createIsomorphicFn()\n .server((code: string): void => {\n try {\n setCookie(LANGUAGE_COOKIE_NAME, code, {\n path: '/',\n maxAge: LANGUAGE_COOKIE_MAX_AGE,\n sameSite: 'lax',\n });\n } catch {\n // Outside a request: there is no response to write to.\n }\n })\n .client((): void => {});\n\nconst readServerSearch = createIsomorphicFn()\n .server((): string => {\n try {\n return getRequestUrl().search;\n } catch {\n return '';\n }\n })\n .client((): string => '');\n\n/**\n * The query string of the page being rendered (`?lang=en`, or `''`): the request's on the\n * server, the address bar's in the browser, so both sides read the same one.\n */\nexport function readPageSearch(): string {\n return readServerSearch() || (typeof window !== 'undefined' ? window.location.search : '');\n}\n\n/** The `Cookie` header of the request being handled, or `document.cookie` in the browser. */\nexport function readCookieHeader(): string | null {\n return readServerCookieHeader() ?? (typeof document !== 'undefined' ? document.cookie : null);\n}\n\n/** Remembers `code` as the visitor's language for every store on this host. */\nexport function persistLanguageCookie(code: string): void {\n writeServerLanguageCookie(code);\n if (typeof document !== 'undefined') {\n document.cookie = `${LANGUAGE_COOKIE_NAME}=${encodeURIComponent(code)}; path=/; max-age=${LANGUAGE_COOKIE_MAX_AGE}; SameSite=Lax`;\n }\n}\n","/** The headers the Salla native app sends with every page it loads in its webview. */\nexport const NATIVE_APP_HEADERS = [\n 's-app-os',\n 's-app-version',\n 's-app-full-version',\n 's-app-os-version',\n];\n\n/**\n * The native app's own headers on this request, or null when it is not the app.\n *\n * On a Twig theme Laravel copies them into the settings' `jitsu.context.extra.headers`,\n * where the SDK reads the app's platform and version from (`salla.config.isMobileApp()`).\n * A React theme asks for its settings from the server, through the API, so the app's\n * headers never reach that call: the request is the only place they are.\n */\nexport function readNativeAppHeaders(headers: Headers): Record<string, string> | null {\n const os = headers.get('s-app-os')?.toLowerCase();\n if (os !== 'ios' && os !== 'android') return null;\n const found: Record<string, string> = {};\n for (const name of NATIVE_APP_HEADERS) {\n const value = headers.get(name);\n if (value) found[name] = value;\n }\n return found;\n}\n","import { queryOptions } from '@tanstack/react-query';\nimport { isHTTPError, isNetworkError, isTimeoutError } from 'ky';\nimport { api, getActiveScope, STORE_IDENTIFIER_HEADER } from './client';\nimport { devSettingsFetchedAt } from './dev-settings-cache';\nimport { SettingsError } from '../utils/errors';\nimport type { Store, Theme, Language, JitsuConfig, MaintenanceDetails } from '../types';\nimport { getTwilightContext } from '../twilight/context';\nimport { resolveStoreIdentifier } from '../utils/store-identity';\nimport { extractScopeFromUrl, parseStoreId } from '../utils/cookies';\nimport { readPageSearch } from '../utils/language-cookie';\nimport { requestedThemeVersionId } from '../utils/theme-version';\nimport { NATIVE_APP_HEADERS } from '../utils/native-app-headers';\nimport { isNotLaunchedNotice } from '../utils/maintenance';\n\nexport { resolveStoreIdentifier };\n\nconst DEFAULT_INCLUDE_ITEMS = [\n 'store',\n 'settings',\n 'theme',\n 'theme_settings',\n 'external_services',\n 'currencies',\n 'languages',\n 'payments',\n 'product_widgets',\n 'rating',\n 'ratings',\n 'user',\n];\n\n/** Twig's `salla.init({ user })` object; the endpoint ignores the token, so always the guest. */\nexport interface SettingsUser {\n type: 'guest' | 'user';\n id?: number | string | null;\n language_code?: string;\n currency_code?: string;\n country_code?: string;\n [key: string]: unknown;\n}\n\n/**\n * Raw API response for settings endpoint.\n * Languages come as object: { \"AR\": { code, name, ... }, \"EN\": {...} }\n */\ninterface SettingsApiResponse {\n store?: Store;\n theme?: Theme;\n languages?: Record<string, Language>;\n currencies?: Record<\n string,\n { code: string; name: string; symbol: string; amount: number; country_code: string }\n >;\n external_services?: Record<string, unknown>;\n headers?: Record<string, unknown>;\n login?: { url: string; turnstile_site_key: string };\n affiliate?: { utm_url: string; cta_enabled: boolean };\n debug?: boolean;\n trace_console?: boolean;\n policy_url?: string;\n user?: SettingsUser;\n swoole?: string[];\n jitsu?: JitsuConfig;\n maintenance?: boolean;\n maintenance_details?: MaintenanceDetails;\n}\n\n/**\n * Central settings context - single source of truth for all API data.\n * Contains everything from the settings endpoint response after processing.\n */\nexport interface StoreContext {\n store?: Store;\n theme?: Theme;\n /** Languages as array after conversion from API object format */\n languages?: Language[];\n currencies?: Record<\n string,\n { code: string; name: string; symbol: string; amount: number; country_code: string }\n >;\n external_services?: Record<string, unknown>;\n headers?: Record<string, unknown>;\n login?: { url: string; turnstile_site_key: string };\n affiliate?: { utm_url: string; cta_enabled: boolean };\n debug?: boolean;\n trace_console?: boolean; // todo:: remove it\n policy_url?: string;\n user?: SettingsUser;\n /** API paths the SDK sends with `s-store-api-version: swoole` */\n swoole?: string[];\n /** Where the SDK's analytics send events, and which ones; without it the SDK tracks nothing. */\n jitsu?: JitsuConfig;\n /**\n * The store is closed: by the merchant from the dashboard, by the platform, or\n * for the selected market only. The engine then renders the maintenance page\n * to everyone but the merchant; see `rootBeforeLoad`.\n */\n maintenance?: boolean;\n /** What the maintenance page says; sent beside `maintenance`. */\n maintenance_details?: MaintenanceDetails;\n /**\n * `false` while the store has not launched yet: `maintenance` is then `true` and the\n * engine's maintenance page says the store is launching soon. Absent otherwise. Not\n * from the API: read off `maintenance_details` by `store.settings`, since the\n * backend sends the merchant's \"finish launching\" notice there for every visitor,\n * which is not for a customer's eyes.\n */\n launched?: false;\n /**\n * The scope these settings were requested with; absent when none was. Not from\n * the API: stamped by `store.settings`, so `resolveThemeVersionId` can tell\n * whether the version they name still answers the scope that is active now.\n */\n requestedScopeId?: string;\n /** Which answer of the API these settings are; see {@link SettingsAnswer}. */\n answer?: SettingsAnswer;\n /**\n * When the dev server fetched these settings from the API (epoch ms). It reuses\n * them for a while (see `dev-settings-cache.ts`) and the theme editor says how old\n * they are. Only on a dev server render; absent everywhere else.\n */\n devFetchedAt?: number;\n}\n\n/**\n * Which answer of the settings API a set of settings came from, read off the\n * response rather than the body: the API's request id, the Store's trace, and\n * whether Cloudflare served it from its cache and how old it was. A decision the\n * settings drive for every visitor alike (the maintenance page) can then be\n * traced to the exact request the backend logged, or to a cached copy of it.\n */\nexport interface SettingsAnswer {\n requestId?: string;\n traceId?: string;\n cacheStatus?: string;\n age?: string;\n}\n\nconst ANSWER_HEADERS: Record<keyof SettingsAnswer, string> = {\n requestId: 's-request-id',\n traceId: 'x-trace-id',\n cacheStatus: 'cf-cache-status',\n age: 'age',\n};\n\nfunction settingsAnswerOf(headers: Headers | undefined): SettingsAnswer | undefined {\n if (!headers) return undefined;\n const answer: SettingsAnswer = {};\n for (const [field, name] of Object.entries(ANSWER_HEADERS) as [keyof SettingsAnswer, string][]) {\n const value = headers.get(name);\n if (value) answer[field] = value;\n }\n return Object.keys(answer).length ? answer : undefined;\n}\n\n/**\n * Converts languages object from API to array format.\n * API returns: { \"AR\": { code, name, ... }, \"EN\": { ... } }\n * We need: [{ code, name, ... }, { code, name, ... }]\n * todo:: return the languages as object from the APIs to avoid this\n */\nfunction languagesToArray(languages?: Record<string, Language>): Language[] | undefined {\n if (!languages) return undefined;\n // The SDK's localization modal reads `lang.iso_code` (not `code`) when a language is\n // selected — without it the switch navigates to `/undefined/...`.\n return Object.values(languages).map((lang) => ({ iso_code: lang.code, ...lang }));\n}\n\n/**\n * The settings' analytics context with the native app's headers in it, as Laravel\n * writes it for a Twig theme: the SDK reads the app's platform and version from there.\n * The API answers a server-side call with the engine's own headers, never the app's.\n */\nfunction withNativeAppHeaders(jitsu?: JitsuConfig): JitsuConfig | undefined {\n if (!jitsu || typeof window !== 'undefined') return jitsu;\n let appHeaders: Record<string, string> | null = null;\n try {\n appHeaders = getTwilightContext().nativeAppHeaders;\n } catch {\n return jitsu;\n }\n if (!appHeaders) return jitsu;\n const extra = jitsu.context?.extra;\n // The engine's own app headers go, so an app that sends no version doesn't get the engine's.\n const headers = { ...extra?.headers };\n for (const name of NATIVE_APP_HEADERS) delete headers[name];\n return {\n ...jitsu,\n context: {\n ...jitsu.context,\n extra: { ...extra, headers: { ...headers, ...appHeaders } },\n },\n };\n}\n\nconst SETTINGS_TIMEOUT_MS = 5000;\n\n/**\n * Whether the page's own address switches market (`?scope=`).\n *\n * Only then does the settings request name the scope in its query string. The API\n * reads `?scope=` as a switch and lets it override the market a market's own domain\n * is pinned to, which the `s-scope-id` header never does. Sent on every request, a\n * market remembered from another visit would win over the host the shopper is on: the\n * settings, and the SDK seeded from them, would answer for that market while every\n * call without the parameter (the cart, among them) answers for the host's, and a\n * guest's cart created in one is refused by the other (TD-17588).\n */\nfunction pageSwitchesScope(): boolean {\n return extractScopeFromUrl(`http://page.invalid/${readPageSearch()}`) !== null;\n}\n\nasync function requestSettings(identifier: string): Promise<StoreContext> {\n const includeParams = DEFAULT_INCLUDE_ITEMS.map((i) => `include[]=${i}`).join('&');\n const scope = getActiveScope();\n const params =\n scope != null && pageSwitchesScope() ? `${includeParams}&scope=${scope.id}` : includeParams;\n\n const request = api\n // Sent explicitly rather than left to the client's own resolution, so\n // the identifier this function checked is the identifier that travels.\n // They agree today; a caller passing one and being answered about\n // another is the failure this makes impossible rather than unlikely.\n .get(`store/settings?${params}`, {\n timeout: SETTINGS_TIMEOUT_MS,\n headers: { [STORE_IDENTIFIER_HEADER]: identifier },\n });\n const json = await request.json<{ data?: SettingsApiResponse }>();\n // The same response, already settled; only its headers are read.\n const headers = (await request)?.headers;\n const answer = settingsAnswerOf(headers);\n const devFetchedAt = devSettingsFetchedAt(headers);\n\n const data = json?.data;\n if (!data) {\n throw new SettingsError(\n `The Salla API answered the settings request for store \"${identifier}\" without settings.`,\n { reason: 'empty' }\n );\n }\n\n // Convert languages from object to array\n const languages = languagesToArray(data.languages);\n\n return {\n store: data.store,\n theme: data.theme,\n languages,\n currencies: data.currencies,\n external_services: data.external_services,\n headers: data.headers,\n login: data.login,\n affiliate: data.affiliate,\n policy_url: data.policy_url,\n user: data.user,\n swoole: data.swoole,\n jitsu: withNativeAppHeaders(data.jitsu),\n maintenance: data.maintenance,\n maintenance_details: data.maintenance_details,\n ...(data.maintenance === true &&\n isNotLaunchedNotice(data.maintenance_details) && { launched: false as const }),\n ...(scope && { requestedScopeId: scope.id }),\n ...(answer && { answer }),\n ...(devFetchedAt && { devFetchedAt }),\n };\n}\n\n/** The message the API put in an error body, `{ error: { message } }`, when it sent one. */\nfunction apiErrorMessage(data: unknown): string | undefined {\n const message = (data as { error?: { message?: unknown } } | undefined)?.error?.message;\n return typeof message === 'string' && message.length > 0 && message.length <= 200\n ? message\n : undefined;\n}\n\n/**\n * What core's `CurrentStoreMiddleware` answers, with a 422, when no store has the\n * username or domain it was given (or the store's status is `deleted`). The lookup is\n * `loadUseUsernameOrDomain`, the same one Twig's `checkUsername` turns into its 410.\n * The literal is not translated: it reads the same whatever language was asked for.\n */\nconst STORE_NOT_FOUND_MESSAGE = 'المتجر غير موجود';\n\n/**\n * Whether the API answered that no store has this identifier. A numeric identifier\n * is looked up with `findOrFail`, which Store's exception handler answers with a 410;\n * a username or domain gets {@link STORE_NOT_FOUND_MESSAGE}. A 410 for a username is\n * not read as one: nothing on that path answers it, and a store that does exist must\n * never be told it does not.\n */\nfunction isStoreNotFound(identifier: string, status: number, said: string | undefined): boolean {\n if (status === 410) return parseStoreId(identifier) !== null;\n return status === 422 && said === STORE_NOT_FOUND_MESSAGE;\n}\n\n/**\n * Names what went wrong, because the page, the server log and Sentry all carry\n * this message. Every failure used to read \"Make sure VITE_STORE_DOMAIN is set\",\n * a local-development variable no deployed theme has, so a slow API looked like\n * a misconfigured theme.\n */\nfunction describeSettingsFailure(identifier: string, error: unknown): SettingsError {\n if (error instanceof SettingsError) return error;\n const request = `the settings request for store \"${identifier}\"`;\n if (isTimeoutError(error)) {\n return new SettingsError(\n `The Salla API did not answer ${request} within ${SETTINGS_TIMEOUT_MS} ms.`,\n { reason: 'timeout' }\n );\n }\n if (isHTTPError(error)) {\n const { status } = error.response;\n const said = apiErrorMessage(error.data);\n return new SettingsError(\n `The Salla API answered ${request} with HTTP ${status}${said ? `: ${said}` : ''}.`,\n { reason: isStoreNotFound(identifier, status, said) ? 'not-found' : 'http', status }\n );\n }\n if (isNetworkError(error)) {\n return new SettingsError(`The Salla API could not be reached for ${request}.`, {\n reason: 'network',\n });\n }\n const detail = error instanceof Error ? `: ${error.message}` : '';\n return new SettingsError(`The settings request for store \"${identifier}\" failed${detail}.`);\n}\n\n/**\n * The settings, or a {@link SettingsError} that says why there are none. The\n * query throws it so the root route can say why the store did not load;\n * `store.settings` keeps answering `null` for its own callers.\n */\nasync function fetchSettings(storeIdentifier?: string): Promise<StoreContext> {\n const identifier = storeIdentifier ?? resolveStoreIdentifier();\n\n if (!identifier) {\n const error = new SettingsError(\n 'No store is named for this request: add `?storeId=` on the preview host, or set VITE_STORE_DOMAIN in local development.',\n { reason: 'no-store' }\n );\n console.warn('[store.settings]', error.message);\n throw error;\n }\n\n try {\n return await requestSettings(identifier);\n } catch (cause) {\n const error = describeSettingsFailure(identifier, cause);\n console.error('[store.settings]', error.message, ...(cause === error ? [] : [cause]));\n throw error;\n }\n}\n\nexport const store = {\n settings: async (storeIdentifier?: string): Promise<StoreContext | null> => {\n try {\n return await fetchSettings(storeIdentifier);\n } catch {\n // Already logged, with the reason.\n return null;\n }\n },\n\n queries: {\n settings: (storeIdentifier?: string) =>\n queryOptions<StoreContext | null>({\n queryKey: [\n 'store',\n 'settings',\n storeIdentifier,\n getTwilightContext().locale,\n getActiveScope(),\n // Two versions of one store's settings are two different answers, and\n // this is the query whose answer decides what every other call is\n // pinned to. `requestedThemeVersionId` rather than the resolved one:\n // the resolved value falls back to what these settings report, so it\n // is not knowable until after this query has run — the key would be\n // one thing on the server and another on the client, and the hydrated\n // page would refetch the settings it was just handed.\n requestedThemeVersionId(),\n ],\n // Throws rather than resolving `null`, so the failure keeps its reason.\n queryFn: () => fetchSettings(storeIdentifier),\n // A null never retried, and the root route waits on this: the router's\n // default `retry: 1` would sit through the timeout twice.\n retry: 0,\n }),\n },\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/utils/language-cookie.ts","../src/utils/native-app-headers.ts","../src/api/store.ts"],"names":[],"mappings":";;;;;;;;;;AAaA,IAAM,sBAAA,GAAyB,kBAAA,EAAmB,CAC/C,MAAA,CAAO,MAAqB;AAC3B,EAAA,IAAI;AACF,IAAA,OAAO,gBAAA,CAAiB,QAAQ,CAAA,IAAK,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;AAAA,MAG5C,KAAA,EAAO;AAAA,KACR;AAAA;AAEP","file":"chunk-YZPHKPYI.js","sourcesContent":["/**\n * @fileoverview Reading and writing the `s-lang` cookie, on the server and in the browser.\n *\n * The server reads it from the request the framework is handling and writes it to that\n * request's response. The server-only import is stripped from the client bundle by\n * `createIsomorphicFn`, as in `routes/root/beforeLoad.ts`. The browser uses `document.cookie`.\n * Either side outside a request (a prerender, a test) has nothing to read or write and says so\n * quietly.\n */\nimport { createIsomorphicFn } from '@tanstack/react-start';\nimport { getRequestHeader, getRequestUrl, setCookie } from '@tanstack/react-start/server';\nimport { LANGUAGE_COOKIE_MAX_AGE, LANGUAGE_COOKIE_NAME } from './cookies';\n\nconst readServerCookieHeader = createIsomorphicFn()\n .server((): string | null => {\n try {\n return getRequestHeader('cookie') ?? null;\n } catch {\n return null;\n }\n })\n .client((): string | null => null);\n\nconst writeServerLanguageCookie = createIsomorphicFn()\n .server((code: string): void => {\n try {\n setCookie(LANGUAGE_COOKIE_NAME, code, {\n path: '/',\n maxAge: LANGUAGE_COOKIE_MAX_AGE,\n sameSite: 'lax',\n });\n } catch {\n // Outside a request: there is no response to write to.\n }\n })\n .client((): void => {});\n\nconst readServerSearch = createIsomorphicFn()\n .server((): string => {\n try {\n return getRequestUrl().search;\n } catch {\n return '';\n }\n })\n .client((): string => '');\n\n/**\n * The query string of the page being rendered (`?lang=en`, or `''`): the request's on the\n * server, the address bar's in the browser, so both sides read the same one.\n */\nexport function readPageSearch(): string {\n return readServerSearch() || (typeof window !== 'undefined' ? window.location.search : '');\n}\n\n/** The `Cookie` header of the request being handled, or `document.cookie` in the browser. */\nexport function readCookieHeader(): string | null {\n return readServerCookieHeader() ?? (typeof document !== 'undefined' ? document.cookie : null);\n}\n\n/** Remembers `code` as the visitor's language for every store on this host. */\nexport function persistLanguageCookie(code: string): void {\n writeServerLanguageCookie(code);\n if (typeof document !== 'undefined') {\n document.cookie = `${LANGUAGE_COOKIE_NAME}=${encodeURIComponent(code)}; path=/; max-age=${LANGUAGE_COOKIE_MAX_AGE}; SameSite=Lax`;\n }\n}\n","/** The headers the Salla native app sends with every page it loads in its webview. */\nexport const NATIVE_APP_HEADERS = [\n 's-app-os',\n 's-app-version',\n 's-app-full-version',\n 's-app-os-version',\n];\n\n/**\n * The native app's own headers on this request, or null when it is not the app.\n *\n * On a Twig theme Laravel copies them into the settings' `jitsu.context.extra.headers`,\n * where the SDK reads the app's platform and version from (`salla.config.isMobileApp()`).\n * A React theme asks for its settings from the server, through the API, so the app's\n * headers never reach that call: the request is the only place they are.\n */\nexport function readNativeAppHeaders(headers: Headers): Record<string, string> | null {\n const os = headers.get('s-app-os')?.toLowerCase();\n if (os !== 'ios' && os !== 'android') return null;\n const found: Record<string, string> = {};\n for (const name of NATIVE_APP_HEADERS) {\n const value = headers.get(name);\n if (value) found[name] = value;\n }\n return found;\n}\n","import { queryOptions } from '@tanstack/react-query';\nimport { isHTTPError, isNetworkError, isTimeoutError } from 'ky';\nimport { api, getActiveScope, STORE_IDENTIFIER_HEADER } from './client';\nimport { devSettingsFetchedAt } from './dev-settings-cache';\nimport { SettingsError } from '../utils/errors';\nimport type { Store, Theme, Language, JitsuConfig, MaintenanceDetails } from '../types';\nimport { getTwilightContext } from '../twilight/context';\nimport { resolveStoreIdentifier } from '../utils/store-identity';\nimport { extractScopeFromUrl, parseStoreId } from '../utils/cookies';\nimport { readPageSearch } from '../utils/language-cookie';\nimport { requestedThemeVersionId } from '../utils/theme-version';\nimport { NATIVE_APP_HEADERS } from '../utils/native-app-headers';\nimport { isNotLaunchedNotice } from '../utils/maintenance';\n\nexport { resolveStoreIdentifier };\n\nconst DEFAULT_INCLUDE_ITEMS = [\n 'store',\n 'settings',\n 'theme',\n 'theme_settings',\n 'external_services',\n 'currencies',\n 'languages',\n 'payments',\n 'product_widgets',\n 'rating',\n 'ratings',\n 'user',\n];\n\n/** Twig's `salla.init({ user })` object; the endpoint ignores the token, so always the guest. */\nexport interface SettingsUser {\n type: 'guest' | 'user';\n id?: number | string | null;\n language_code?: string;\n currency_code?: string;\n country_code?: string;\n [key: string]: unknown;\n}\n\n/**\n * Raw API response for settings endpoint.\n * Languages come as object: { \"AR\": { code, name, ... }, \"EN\": {...} }\n */\ninterface SettingsApiResponse {\n store?: Store;\n theme?: Theme;\n languages?: Record<string, Language>;\n currencies?: Record<\n string,\n { code: string; name: string; symbol: string; amount: number; country_code: string }\n >;\n external_services?: Record<string, unknown>;\n headers?: Record<string, unknown>;\n login?: { url: string; turnstile_site_key: string };\n affiliate?: { utm_url: string; cta_enabled: boolean };\n debug?: boolean;\n trace_console?: boolean;\n policy_url?: string;\n user?: SettingsUser;\n swoole?: string[];\n jitsu?: JitsuConfig;\n maintenance?: boolean;\n maintenance_details?: MaintenanceDetails;\n}\n\n/**\n * Central settings context - single source of truth for all API data.\n * Contains everything from the settings endpoint response after processing.\n */\nexport interface StoreContext {\n store?: Store;\n theme?: Theme;\n /** Languages as array after conversion from API object format */\n languages?: Language[];\n currencies?: Record<\n string,\n { code: string; name: string; symbol: string; amount: number; country_code: string }\n >;\n external_services?: Record<string, unknown>;\n headers?: Record<string, unknown>;\n login?: { url: string; turnstile_site_key: string };\n affiliate?: { utm_url: string; cta_enabled: boolean };\n debug?: boolean;\n trace_console?: boolean; // todo:: remove it\n policy_url?: string;\n user?: SettingsUser;\n /** API paths the SDK sends with `s-store-api-version: swoole` */\n swoole?: string[];\n /** Where the SDK's analytics send events, and which ones; without it the SDK tracks nothing. */\n jitsu?: JitsuConfig;\n /**\n * The store is closed: by the merchant from the dashboard, by the platform, or\n * for the selected market only. The engine then renders the maintenance page\n * to everyone but the merchant; see `rootBeforeLoad`.\n */\n maintenance?: boolean;\n /** What the maintenance page says; sent beside `maintenance`. */\n maintenance_details?: MaintenanceDetails;\n /**\n * `false` while the store has not launched yet: `maintenance` is then `true` and the\n * engine's maintenance page says the store is launching soon. Absent otherwise. Not\n * from the API: read off `maintenance_details` by `store.settings`, since the\n * backend sends the merchant's \"finish launching\" notice there for every visitor,\n * which is not for a customer's eyes.\n */\n launched?: false;\n /**\n * The scope these settings were requested with; absent when none was. Not from\n * the API: stamped by `store.settings`, so `resolveThemeVersionId` can tell\n * whether the version they name still answers the scope that is active now.\n */\n requestedScopeId?: string;\n /** Which answer of the API these settings are; see {@link SettingsAnswer}. */\n answer?: SettingsAnswer;\n /**\n * When the dev server fetched these settings from the API (epoch ms). It reuses\n * them for a while (see `dev-settings-cache.ts`) and the theme editor says how old\n * they are. Only on a dev server render; absent everywhere else.\n */\n devFetchedAt?: number;\n}\n\n/**\n * Which answer of the settings API a set of settings came from, read off the\n * response rather than the body: the API's request id, the Store's trace, and\n * whether Cloudflare served it from its cache and how old it was. A decision the\n * settings drive for every visitor alike (the maintenance page) can then be\n * traced to the exact request the backend logged, or to a cached copy of it.\n */\nexport interface SettingsAnswer {\n requestId?: string;\n traceId?: string;\n cacheStatus?: string;\n age?: string;\n}\n\nconst ANSWER_HEADERS: Record<keyof SettingsAnswer, string> = {\n requestId: 's-request-id',\n traceId: 'x-trace-id',\n cacheStatus: 'cf-cache-status',\n age: 'age',\n};\n\nfunction settingsAnswerOf(headers: Headers | undefined): SettingsAnswer | undefined {\n if (!headers) return undefined;\n const answer: SettingsAnswer = {};\n for (const [field, name] of Object.entries(ANSWER_HEADERS) as [keyof SettingsAnswer, string][]) {\n const value = headers.get(name);\n if (value) answer[field] = value;\n }\n return Object.keys(answer).length ? answer : undefined;\n}\n\n/**\n * Converts languages object from API to array format.\n * API returns: { \"AR\": { code, name, ... }, \"EN\": { ... } }\n * We need: [{ code, name, ... }, { code, name, ... }]\n * todo:: return the languages as object from the APIs to avoid this\n */\nfunction languagesToArray(languages?: Record<string, Language>): Language[] | undefined {\n if (!languages) return undefined;\n // The SDK's localization modal reads `lang.iso_code` (not `code`) when a language is\n // selected — without it the switch navigates to `/undefined/...`.\n return Object.values(languages).map((lang) => ({ iso_code: lang.code, ...lang }));\n}\n\n/**\n * The settings' analytics context with the native app's headers in it, as Laravel\n * writes it for a Twig theme: the SDK reads the app's platform and version from there.\n * The API answers a server-side call with the engine's own headers, never the app's.\n */\nfunction withNativeAppHeaders(jitsu?: JitsuConfig): JitsuConfig | undefined {\n if (!jitsu || typeof window !== 'undefined') return jitsu;\n let appHeaders: Record<string, string> | null = null;\n try {\n appHeaders = getTwilightContext().nativeAppHeaders;\n } catch {\n return jitsu;\n }\n if (!appHeaders) return jitsu;\n const extra = jitsu.context?.extra;\n // The engine's own app headers go, so an app that sends no version doesn't get the engine's.\n const headers = { ...extra?.headers };\n for (const name of NATIVE_APP_HEADERS) delete headers[name];\n return {\n ...jitsu,\n context: {\n ...jitsu.context,\n extra: { ...extra, headers: { ...headers, ...appHeaders } },\n },\n };\n}\n\nconst SETTINGS_TIMEOUT_MS = 5000;\n\n/**\n * Whether the page's own address switches market (`?scope=`).\n *\n * Only then does the settings request name the scope in its query string. The API\n * reads `?scope=` as a switch and lets it override the market a market's own domain\n * is pinned to, which the `s-scope-id` header never does. Sent on every request, a\n * market remembered from another visit would win over the host the shopper is on: the\n * settings, and the SDK seeded from them, would answer for that market while every\n * call without the parameter (the cart, among them) answers for the host's, and a\n * guest's cart created in one is refused by the other (TD-17588).\n */\nfunction pageSwitchesScope(): boolean {\n return extractScopeFromUrl(`http://page.invalid/${readPageSearch()}`) !== null;\n}\n\nasync function requestSettings(identifier: string): Promise<StoreContext> {\n const includeParams = DEFAULT_INCLUDE_ITEMS.map((i) => `include[]=${i}`).join('&');\n const scope = getActiveScope();\n const params =\n scope != null && pageSwitchesScope() ? `${includeParams}&scope=${scope.id}` : includeParams;\n\n const request = api\n // Sent explicitly rather than left to the client's own resolution, so\n // the identifier this function checked is the identifier that travels.\n // They agree today; a caller passing one and being answered about\n // another is the failure this makes impossible rather than unlikely.\n .get(`store/settings?${params}`, {\n timeout: SETTINGS_TIMEOUT_MS,\n headers: { [STORE_IDENTIFIER_HEADER]: identifier },\n });\n const json = await request.json<{ data?: SettingsApiResponse }>();\n // The same response, already settled; only its headers are read.\n const headers = (await request)?.headers;\n const answer = settingsAnswerOf(headers);\n const devFetchedAt = devSettingsFetchedAt(headers);\n\n const data = json?.data;\n if (!data) {\n throw new SettingsError(\n `The Salla API answered the settings request for store \"${identifier}\" without settings.`,\n { reason: 'empty' }\n );\n }\n\n // Convert languages from object to array\n const languages = languagesToArray(data.languages);\n\n return {\n store: data.store,\n theme: data.theme,\n languages,\n currencies: data.currencies,\n external_services: data.external_services,\n headers: data.headers,\n login: data.login,\n affiliate: data.affiliate,\n policy_url: data.policy_url,\n user: data.user,\n swoole: data.swoole,\n jitsu: withNativeAppHeaders(data.jitsu),\n maintenance: data.maintenance,\n maintenance_details: data.maintenance_details,\n ...(data.maintenance === true &&\n isNotLaunchedNotice(data.maintenance_details) && { launched: false as const }),\n ...(scope && { requestedScopeId: scope.id }),\n ...(answer && { answer }),\n ...(devFetchedAt && { devFetchedAt }),\n };\n}\n\n/** The message the API put in an error body, `{ error: { message } }`, when it sent one. */\nfunction apiErrorMessage(data: unknown): string | undefined {\n const message = (data as { error?: { message?: unknown } } | undefined)?.error?.message;\n return typeof message === 'string' && message.length > 0 && message.length <= 200\n ? message\n : undefined;\n}\n\n/**\n * What core's `CurrentStoreMiddleware` answers, with a 422, when no store has the\n * username or domain it was given (or the store's status is `deleted`). The lookup is\n * `loadUseUsernameOrDomain`, the same one Twig's `checkUsername` turns into its 410.\n * The literal is not translated: it reads the same whatever language was asked for.\n */\nconst STORE_NOT_FOUND_MESSAGE = 'المتجر غير موجود';\n\n/**\n * Whether the API answered that no store has this identifier. A numeric identifier\n * is looked up with `findOrFail`, which Store's exception handler answers with a 410;\n * a username or domain gets {@link STORE_NOT_FOUND_MESSAGE}. A 410 for a username is\n * not read as one: nothing on that path answers it, and a store that does exist must\n * never be told it does not.\n */\nfunction isStoreNotFound(identifier: string, status: number, said: string | undefined): boolean {\n if (status === 410) return parseStoreId(identifier) !== null;\n return status === 422 && said === STORE_NOT_FOUND_MESSAGE;\n}\n\n/**\n * Names what went wrong, because the page, the server log and Sentry all carry\n * this message. Every failure used to read \"Make sure VITE_STORE_DOMAIN is set\",\n * a local-development variable no deployed theme has, so a slow API looked like\n * a misconfigured theme.\n */\nfunction describeSettingsFailure(identifier: string, error: unknown): SettingsError {\n if (error instanceof SettingsError) return error;\n const request = `the settings request for store \"${identifier}\"`;\n if (isTimeoutError(error)) {\n return new SettingsError(\n `The Salla API did not answer ${request} within ${SETTINGS_TIMEOUT_MS} ms.`,\n { reason: 'timeout' }\n );\n }\n if (isHTTPError(error)) {\n const { status } = error.response;\n const said = apiErrorMessage(error.data);\n return new SettingsError(\n `The Salla API answered ${request} with HTTP ${status}${said ? `: ${said}` : ''}.`,\n { reason: isStoreNotFound(identifier, status, said) ? 'not-found' : 'http', status }\n );\n }\n if (isNetworkError(error)) {\n return new SettingsError(`The Salla API could not be reached for ${request}.`, {\n reason: 'network',\n });\n }\n const detail = error instanceof Error ? `: ${error.message}` : '';\n return new SettingsError(`The settings request for store \"${identifier}\" failed${detail}.`);\n}\n\n/**\n * The settings, or a {@link SettingsError} that says why there are none. The\n * query throws it so the root route can say why the store did not load;\n * `store.settings` keeps answering `null` for its own callers.\n */\nasync function fetchSettings(storeIdentifier?: string): Promise<StoreContext> {\n const identifier = storeIdentifier ?? resolveStoreIdentifier();\n\n if (!identifier) {\n const error = new SettingsError(\n 'No store is named for this request: add `?storeId=` on the preview host, or set VITE_STORE_DOMAIN in local development.',\n { reason: 'no-store' }\n );\n console.warn('[store.settings]', error.message);\n throw error;\n }\n\n try {\n return await requestSettings(identifier);\n } catch (cause) {\n const error = describeSettingsFailure(identifier, cause);\n console.error('[store.settings]', error.message, ...(cause === error ? [] : [cause]));\n throw error;\n }\n}\n\nexport const store = {\n settings: async (storeIdentifier?: string): Promise<StoreContext | null> => {\n try {\n return await fetchSettings(storeIdentifier);\n } catch {\n // Already logged, with the reason.\n return null;\n }\n },\n\n queries: {\n settings: (storeIdentifier?: string) =>\n queryOptions<StoreContext | null>({\n queryKey: [\n 'store',\n 'settings',\n storeIdentifier,\n getTwilightContext().locale,\n getActiveScope(),\n // Two versions of one store's settings are two different answers, and\n // this is the query whose answer decides what every other call is\n // pinned to. `requestedThemeVersionId` rather than the resolved one:\n // the resolved value falls back to what these settings report, so it\n // is not knowable until after this query has run — the key would be\n // one thing on the server and another on the client, and the hydrated\n // page would refetch the settings it was just handed.\n requestedThemeVersionId(),\n ],\n // Throws rather than resolving `null`, so the failure keeps its reason.\n queryFn: () => fetchSettings(storeIdentifier),\n // A null never retried, and the root route waits on this: the router's\n // default `retry: 1` would sit through the timeout twice.\n retry: 0,\n }),\n },\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { orThrow } from './chunk-
|
|
2
|
-
import { api } from './chunk-
|
|
1
|
+
import { orThrow } from './chunk-DWWPRLD3.js';
|
|
2
|
+
import { api } from './chunk-EMGVOEZZ.js';
|
|
3
3
|
import { queryOptions } from '@tanstack/react-query';
|
|
4
4
|
|
|
5
5
|
var blog = {
|
|
@@ -63,5 +63,5 @@ var blog = {
|
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
export { blog };
|
|
66
|
-
//# sourceMappingURL=chunk-
|
|
67
|
-
//# sourceMappingURL=chunk-
|
|
66
|
+
//# sourceMappingURL=chunk-ZHBZ6YMB.js.map
|
|
67
|
+
//# sourceMappingURL=chunk-ZHBZ6YMB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/blog.ts"],"names":[],"mappings":";;;;AAyCO,IAAM,IAAA,GAAO;AAAA,EAClB,GAAA,EAAK,OAAO,MAAA,KAAgD;AAC1D,IAAA,MAAM,UAAmC,EAAC;AAC1C,IAAA,IAAI,MAAA,UAAgB,MAAA,GAAS,MAAA;AAE7B,IAAA,MAAM,WAAW,MAAM,GAAA,CAAI,IAAI,MAAA,EAAQ,OAAoB,EAAE,IAAA,EAAsB;AAEnF,IAAA,OAAO;AAAA,MACL,UAAA,EAAY,QAAA,CAAS,IAAA,C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QAAA,CAAS,IAAA;AAAA,IAClB,CAAA;AAAA,IAEA,WAAA,EAAa,CAAC,EAAA,EAAY,MAAA,KACxB,OAAA,CAAQ,KAAK,QAAA,CAAS,IAAA,CAAK,EAAA,EAAI,MAAM,CAAC;AAAA,GAC1C;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,MACR,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,MAAA,EAAQ,UAAU,CAAA;AAAA,MAC7B,SAAS,CAAC,EAAE,QAAO,KAAM,IAAA,CAAK,IAAI,MAAM;AAAA,KACzC,CAAA;AAAA,IACH,QAAA,EAAU,CAAC,MAAA,KACT,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,MAAA,EAAQ,UAAA,EAAY,MAAM,CAAA;AAAA,MACrC,OAAA,EAAS,CAAC,EAAE,MAAA,EAAO,KAAM,IAAA,CAAK,QAAA,CAAS,IAAA,CAAK,EAAE,GAAG,MAAA,EAAQ,MAAA,EAAQ;AAAA,KAClE,CAAA;AAAA,IACH,OAAA,EAAS,CAAC,EAAA,KACR,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,MAAA,EAAQ,SAAA,EAAW,EAAE,CAAA;AAAA,MAChC,OAAA,EAAS,CAAC,EAAE,MAAA,OAAa,IAAA,CAAK,QAAA,CAAS,IAAA,CAAK,EAAA,EAAI,MAAM;AAAA,KACvD;AAAA;AAEP","file":"chunk-ZHBZ6YMB.js","sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport type { Options as KyOptions } from 'ky';\nimport { api } from './client';\nimport type { Pagination } from './types';\nimport type {\n ArticleSummary,\n ArticleDetail,\n BlogAuthor,\n BlogCategory,\n BlogTag,\n BlogOverview,\n} from '../routes/blog/types';\nimport { orThrow } from '../providers/NavigationProvider';\n\nexport interface BlogArticlesListParams {\n category?: string;\n author?: string;\n tag?: string;\n page?: number;\n cursor?: string | null;\n signal?: AbortSignal;\n}\n\nexport interface BlogArticlesListResponse {\n data: ArticleSummary[];\n categories?: BlogCategory[];\n category: BlogCategory;\n author: BlogAuthor;\n tag: BlogTag;\n cursor: Pagination;\n}\n\nexport interface BlogGetResponse {\n data: {\n categories: BlogCategory[] | null;\n slides: ArticleSummary[] | null;\n articles: ArticleSummary[] | null;\n popular: ArticleSummary[] | null;\n };\n}\n\nexport const blog = {\n get: async (signal?: AbortSignal): Promise<BlogOverview> => {\n const options: Record<string, unknown> = {};\n if (signal) options.signal = signal;\n\n const response = await api.get('blog', options as KyOptions).json<BlogGetResponse>();\n\n return {\n categories: response.data.categories ?? [],\n slides: response.data.slides ?? [],\n articles: response.data.articles ?? [],\n popular: response.data.popular ?? [],\n };\n },\n\n articles: {\n list: async (params?: BlogArticlesListParams): Promise<BlogArticlesListResponse> => {\n const { category, author, tag, page, cursor, signal } = params ?? {};\n\n const searchParams = new URLSearchParams();\n if (page !== undefined) searchParams.set('page', String(page));\n if (cursor) searchParams.set('cursor', cursor);\n if (category) searchParams.set('category', category);\n if (author) searchParams.set('author', author);\n if (tag) searchParams.set('tag', tag);\n\n const options: Record<string, unknown> = {};\n if (signal) options.signal = signal;\n\n const response = await api\n .get(`blog/articles?${searchParams.toString()}`, options as KyOptions)\n .json<{\n data: ArticleSummary[] | null;\n categories?: BlogCategory[] | null;\n category: BlogCategory;\n author: BlogAuthor;\n tag: BlogTag;\n cursor: Pagination;\n }>();\n\n return {\n data: response.data ?? [],\n categories: response.categories ?? undefined,\n category: response.category,\n author: response.author,\n tag: response.tag,\n cursor: response.cursor,\n };\n },\n\n find: async (id: string, signal?: AbortSignal): Promise<ArticleDetail> => {\n const options: Record<string, unknown> = {};\n if (signal) options.signal = signal;\n\n const response = await api\n .get(`blog/articles/${id}`, options as KyOptions)\n .json<{ data: ArticleDetail | null }>();\n\n if (!response.data) {\n throw new Error(`Article ${id} not found`);\n }\n\n return response.data;\n },\n\n findOrThrow: (id: string, signal?: AbortSignal): Promise<ArticleDetail> =>\n orThrow(blog.articles.find(id, signal)),\n },\n\n queries: {\n overview: () =>\n queryOptions({\n queryKey: ['blog', 'overview'],\n queryFn: ({ signal }) => blog.get(signal),\n }),\n articles: (params?: Omit<BlogArticlesListParams, 'signal'>) =>\n queryOptions({\n queryKey: ['blog', 'articles', params],\n queryFn: ({ signal }) => blog.articles.list({ ...params, signal }),\n }),\n article: (id: string) =>\n queryOptions({\n queryKey: ['blog', 'article', id],\n queryFn: ({ signal }) => blog.articles.find(id, signal),\n }),\n },\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { filesCdn, cdn } from './chunk-
|
|
1
|
+
import { filesCdn, cdn } from './chunk-EMGVOEZZ.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-ZKTSLYTT.js.map
|
|
130
|
+
//# sourceMappingURL=chunk-ZKTSLYTT.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,UA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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-SXJEZEGN.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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AA,CAA0B,OAAA,EAAS,MAAM,CAAA;AAAA,MACnD,OAAA,EAAS,MAAM,YAAA,CAAa,QAAA,CAAS,SAAS,MAAM;AAAA,KACrD;AAAA;AAEP","file":"chunk-ZKTSLYTT.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
|
-
export { LazyCartItem as CartItem, LazyCartSummary as CartSummary, LazySeoCartWidget as SeoCartWidget } from '../../chunk-
|
|
1
|
+
export { LazyCartItem as CartItem, LazyCartSummary as CartSummary, LazySeoCartWidget as SeoCartWidget } from '../../chunk-MO2NP3WX.js';
|
|
2
2
|
import '../../chunk-VYGA5AT5.js';
|
|
3
3
|
import '../../chunk-DGUM43GV.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BlogSkeleton, LazyBreadcrumb as Breadcrumb, BreadcrumbSkeleton, LazyCurrencySymbol as CurrencySymbol, CustomerLayoutSkeleton, CustomerPageSkeleton, DeferredData, LazyErrorPage as ErrorPage, Image, LazyNoContent as NoContent, PageSkeleton, ProductCardSkeleton, ProductDetailSkeleton, ProductGridSkeleton, LazyRenderWhenVisible as RenderWhenVisible, SkeletonPulse, resolveDeferred } from '../../chunk-
|
|
1
|
+
export { BlogSkeleton, LazyBreadcrumb as Breadcrumb, BreadcrumbSkeleton, LazyCurrencySymbol as CurrencySymbol, CustomerLayoutSkeleton, CustomerPageSkeleton, DeferredData, LazyErrorPage as ErrorPage, Image, LazyNoContent as NoContent, PageSkeleton, ProductCardSkeleton, ProductDetailSkeleton, ProductGridSkeleton, LazyRenderWhenVisible as RenderWhenVisible, SkeletonPulse, resolveDeferred } from '../../chunk-ONBDJMLJ.js';
|
|
2
2
|
export { Link } from '../../chunk-AXW67SY7.js';
|
|
3
3
|
import '../../chunk-BYMOPN2S.js';
|
|
4
4
|
import '../../chunk-SKLEJJ6M.js';
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
export { Drawer } from '../../chunk-6TKIUG5C.js';
|
|
2
|
-
import '../../chunk-
|
|
2
|
+
import '../../chunk-6REUUGFM.js';
|
|
3
3
|
import '../../chunk-Q77J3D2W.js';
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
4
|
+
import '../../chunk-U7ZHPOGI.js';
|
|
5
|
+
import '../../chunk-46CWPZSI.js';
|
|
6
6
|
import '../../chunk-GMXNVBCD.js';
|
|
7
7
|
import '../../chunk-X55R4VVK.js';
|
|
8
8
|
import '../../chunk-YL6X3ZMG.js';
|
|
9
|
-
import '../../chunk-
|
|
9
|
+
import '../../chunk-3YMCWKFT.js';
|
|
10
10
|
import '../../chunk-OXMUPNMH.js';
|
|
11
|
-
import '../../chunk-
|
|
11
|
+
import '../../chunk-LYKDZ74X.js';
|
|
12
12
|
import '../../chunk-VVZNW5CB.js';
|
|
13
13
|
import '../../chunk-VDPMCOHX.js';
|
|
14
14
|
import '../../chunk-GD26FI4J.js';
|
|
15
15
|
import '../../chunk-BRIRWS2Q.js';
|
|
16
16
|
import '../../chunk-M2MJKUQF.js';
|
|
17
|
-
import '../../chunk-
|
|
17
|
+
import '../../chunk-DWWPRLD3.js';
|
|
18
18
|
import '../../chunk-OUW6WESU.js';
|
|
19
19
|
import '../../chunk-PPUV27YN.js';
|
|
20
20
|
import '../../chunk-HI5V5X3S.js';
|
|
21
|
-
import '../../chunk-
|
|
22
|
-
import '../../chunk-
|
|
21
|
+
import '../../chunk-5WVJYMDS.js';
|
|
22
|
+
import '../../chunk-PSWUFTNS.js';
|
|
23
23
|
import '../../chunk-6T55LXJL.js';
|
|
24
24
|
import '../../chunk-Z653O7MX.js';
|
|
25
25
|
import '../../chunk-ZCH7W7DZ.js';
|
|
@@ -30,16 +30,16 @@ import '../../chunk-7V36I5GT.js';
|
|
|
30
30
|
import '../../chunk-6WI7R2BD.js';
|
|
31
31
|
import '../../chunk-LFMCUQQ3.js';
|
|
32
32
|
import '../../chunk-OAMIDZKW.js';
|
|
33
|
-
import '../../chunk-
|
|
33
|
+
import '../../chunk-2BRLDR24.js';
|
|
34
34
|
import '../../chunk-OQIIJRAS.js';
|
|
35
35
|
import '../../chunk-V2ZDTY6H.js';
|
|
36
|
-
import '../../chunk-
|
|
36
|
+
import '../../chunk-WYMDZDEZ.js';
|
|
37
37
|
import '../../chunk-5XDPAKF5.js';
|
|
38
38
|
import '../../chunk-GCPEMNSU.js';
|
|
39
|
-
import '../../chunk-
|
|
39
|
+
import '../../chunk-EMGVOEZZ.js';
|
|
40
40
|
import '../../chunk-Z5M4YYWT.js';
|
|
41
41
|
import '../../chunk-TYNZ5B2B.js';
|
|
42
|
-
import '../../chunk-
|
|
42
|
+
import '../../chunk-ONBDJMLJ.js';
|
|
43
43
|
import '../../chunk-AXW67SY7.js';
|
|
44
44
|
import '../../chunk-BYMOPN2S.js';
|
|
45
45
|
import '../../chunk-SKLEJJ6M.js';
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
export { BundleComponent, ComponentErrorBoundary, DefaultHomeComponents, FeaturedProductsStyle1, FeaturedProductsStyle2, FeaturedProductsStyle3, FixedBanner, FixedProducts, HomeComponentRenderer, PageBlocks, ParallaxBackground, PhotosSlider, ProductsSlider, ReorderProducts, SquarePhotos, StoreFeatures, LazyTestimonials as Testimonials, Youtube, registerHomeComponentConfig, registerHomeComponents, useReorderButtons } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
1
|
+
export { BundleComponent, ComponentErrorBoundary, DefaultHomeComponents, FeaturedProductsStyle1, FeaturedProductsStyle2, FeaturedProductsStyle3, FixedBanner, FixedProducts, HomeComponentRenderer, PageBlocks, ParallaxBackground, PhotosSlider, ProductsSlider, ReorderProducts, SquarePhotos, StoreFeatures, LazyTestimonials as Testimonials, Youtube, registerHomeComponentConfig, registerHomeComponents, useReorderButtons } from '../../chunk-7TEJBYGD.js';
|
|
2
|
+
import '../../chunk-QEE2A7O2.js';
|
|
3
|
+
import '../../chunk-LDDZ7TUR.js';
|
|
4
|
+
import '../../chunk-YY74QOIL.js';
|
|
5
|
+
import '../../chunk-4FPHFWEU.js';
|
|
6
6
|
import '../../chunk-Y32RHCOH.js';
|
|
7
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-6REUUGFM.js';
|
|
8
8
|
import '../../chunk-Q77J3D2W.js';
|
|
9
|
-
import '../../chunk-
|
|
10
|
-
import '../../chunk-
|
|
9
|
+
import '../../chunk-U7ZHPOGI.js';
|
|
10
|
+
import '../../chunk-46CWPZSI.js';
|
|
11
11
|
import '../../chunk-GMXNVBCD.js';
|
|
12
12
|
import '../../chunk-X55R4VVK.js';
|
|
13
13
|
import '../../chunk-YL6X3ZMG.js';
|
|
14
|
-
import '../../chunk-
|
|
14
|
+
import '../../chunk-3YMCWKFT.js';
|
|
15
15
|
import '../../chunk-OXMUPNMH.js';
|
|
16
|
-
import '../../chunk-
|
|
16
|
+
import '../../chunk-LYKDZ74X.js';
|
|
17
17
|
import '../../chunk-VVZNW5CB.js';
|
|
18
18
|
import '../../chunk-VDPMCOHX.js';
|
|
19
19
|
import '../../chunk-GD26FI4J.js';
|
|
20
20
|
import '../../chunk-BRIRWS2Q.js';
|
|
21
21
|
import '../../chunk-M2MJKUQF.js';
|
|
22
|
-
import '../../chunk-
|
|
22
|
+
import '../../chunk-DWWPRLD3.js';
|
|
23
23
|
import '../../chunk-OUW6WESU.js';
|
|
24
24
|
import '../../chunk-PPUV27YN.js';
|
|
25
25
|
import '../../chunk-HI5V5X3S.js';
|
|
26
|
-
import '../../chunk-
|
|
27
|
-
import '../../chunk-
|
|
26
|
+
import '../../chunk-5WVJYMDS.js';
|
|
27
|
+
import '../../chunk-PSWUFTNS.js';
|
|
28
28
|
import '../../chunk-6T55LXJL.js';
|
|
29
29
|
import '../../chunk-Z653O7MX.js';
|
|
30
30
|
import '../../chunk-ZCH7W7DZ.js';
|
|
@@ -35,16 +35,16 @@ import '../../chunk-7V36I5GT.js';
|
|
|
35
35
|
import '../../chunk-6WI7R2BD.js';
|
|
36
36
|
import '../../chunk-LFMCUQQ3.js';
|
|
37
37
|
import '../../chunk-OAMIDZKW.js';
|
|
38
|
-
import '../../chunk-
|
|
38
|
+
import '../../chunk-2BRLDR24.js';
|
|
39
39
|
import '../../chunk-OQIIJRAS.js';
|
|
40
40
|
import '../../chunk-V2ZDTY6H.js';
|
|
41
|
-
import '../../chunk-
|
|
41
|
+
import '../../chunk-WYMDZDEZ.js';
|
|
42
42
|
import '../../chunk-5XDPAKF5.js';
|
|
43
43
|
import '../../chunk-GCPEMNSU.js';
|
|
44
|
-
import '../../chunk-
|
|
44
|
+
import '../../chunk-EMGVOEZZ.js';
|
|
45
45
|
import '../../chunk-Z5M4YYWT.js';
|
|
46
46
|
import '../../chunk-TYNZ5B2B.js';
|
|
47
|
-
import '../../chunk-
|
|
47
|
+
import '../../chunk-ONBDJMLJ.js';
|
|
48
48
|
import '../../chunk-AXW67SY7.js';
|
|
49
49
|
import '../../chunk-BYMOPN2S.js';
|
|
50
50
|
import '../../chunk-SKLEJJ6M.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { LazyCopyright as Copyright, LazyCustomerLayout as CustomerLayout, LazyFooter as Footer, LazyHeader as Header, LazyMasterLayout as MasterLayout, LazyWidgetHead as WidgetHead } from '../../chunk-
|
|
2
|
-
export { PageAdvertisements } from '../../chunk-
|
|
1
|
+
export { LazyCopyright as Copyright, LazyCustomerLayout as CustomerLayout, LazyFooter as Footer, LazyHeader as Header, LazyMasterLayout as MasterLayout, LazyWidgetHead as WidgetHead } from '../../chunk-53ULTYEF.js';
|
|
2
|
+
export { PageAdvertisements } from '../../chunk-2BRLDR24.js';
|
|
3
3
|
export { MadeWithSalla } from '../../chunk-OQIIJRAS.js';
|
|
4
4
|
export { pushEqualHeightConfig } from '../../chunk-V2ZDTY6H.js';
|
|
5
|
-
import '../../chunk-
|
|
5
|
+
import '../../chunk-WYMDZDEZ.js';
|
|
6
6
|
import '../../chunk-5XDPAKF5.js';
|
|
7
7
|
import '../../chunk-GCPEMNSU.js';
|
|
8
|
-
import '../../chunk-
|
|
8
|
+
import '../../chunk-EMGVOEZZ.js';
|
|
9
9
|
import '../../chunk-Z5M4YYWT.js';
|
|
10
10
|
import '../../chunk-TYNZ5B2B.js';
|
|
11
11
|
import '../../chunk-7IVHY4OR.js';
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
export { LazyAddToCartForm as AddToCartForm, LazyProductDetails as ProductDetails, ProductGallery } from '../../chunk-
|
|
2
|
-
export { ProductCard } from '../../chunk-
|
|
1
|
+
export { LazyAddToCartForm as AddToCartForm, LazyProductDetails as ProductDetails, ProductGallery } from '../../chunk-YY74QOIL.js';
|
|
2
|
+
export { ProductCard } from '../../chunk-4FPHFWEU.js';
|
|
3
3
|
import '../../chunk-Y32RHCOH.js';
|
|
4
|
-
import '../../chunk-
|
|
4
|
+
import '../../chunk-6REUUGFM.js';
|
|
5
5
|
import '../../chunk-Q77J3D2W.js';
|
|
6
|
-
import '../../chunk-
|
|
7
|
-
import '../../chunk-
|
|
6
|
+
import '../../chunk-U7ZHPOGI.js';
|
|
7
|
+
import '../../chunk-46CWPZSI.js';
|
|
8
8
|
import '../../chunk-GMXNVBCD.js';
|
|
9
9
|
import '../../chunk-X55R4VVK.js';
|
|
10
10
|
import '../../chunk-YL6X3ZMG.js';
|
|
11
|
-
import '../../chunk-
|
|
11
|
+
import '../../chunk-3YMCWKFT.js';
|
|
12
12
|
import '../../chunk-OXMUPNMH.js';
|
|
13
|
-
import '../../chunk-
|
|
13
|
+
import '../../chunk-LYKDZ74X.js';
|
|
14
14
|
import '../../chunk-VVZNW5CB.js';
|
|
15
15
|
import '../../chunk-VDPMCOHX.js';
|
|
16
16
|
import '../../chunk-GD26FI4J.js';
|
|
17
17
|
import '../../chunk-BRIRWS2Q.js';
|
|
18
18
|
import '../../chunk-M2MJKUQF.js';
|
|
19
|
-
import '../../chunk-
|
|
19
|
+
import '../../chunk-DWWPRLD3.js';
|
|
20
20
|
import '../../chunk-OUW6WESU.js';
|
|
21
21
|
import '../../chunk-PPUV27YN.js';
|
|
22
22
|
import '../../chunk-HI5V5X3S.js';
|
|
23
|
-
import '../../chunk-
|
|
24
|
-
import '../../chunk-
|
|
23
|
+
import '../../chunk-5WVJYMDS.js';
|
|
24
|
+
import '../../chunk-PSWUFTNS.js';
|
|
25
25
|
import '../../chunk-6T55LXJL.js';
|
|
26
26
|
import '../../chunk-Z653O7MX.js';
|
|
27
27
|
import '../../chunk-ZCH7W7DZ.js';
|
|
@@ -32,16 +32,16 @@ import '../../chunk-7V36I5GT.js';
|
|
|
32
32
|
import '../../chunk-6WI7R2BD.js';
|
|
33
33
|
import '../../chunk-LFMCUQQ3.js';
|
|
34
34
|
import '../../chunk-OAMIDZKW.js';
|
|
35
|
-
import '../../chunk-
|
|
35
|
+
import '../../chunk-2BRLDR24.js';
|
|
36
36
|
import '../../chunk-OQIIJRAS.js';
|
|
37
37
|
import '../../chunk-V2ZDTY6H.js';
|
|
38
|
-
import '../../chunk-
|
|
38
|
+
import '../../chunk-WYMDZDEZ.js';
|
|
39
39
|
import '../../chunk-5XDPAKF5.js';
|
|
40
40
|
import '../../chunk-GCPEMNSU.js';
|
|
41
|
-
import '../../chunk-
|
|
41
|
+
import '../../chunk-EMGVOEZZ.js';
|
|
42
42
|
import '../../chunk-Z5M4YYWT.js';
|
|
43
43
|
import '../../chunk-TYNZ5B2B.js';
|
|
44
|
-
import '../../chunk-
|
|
44
|
+
import '../../chunk-ONBDJMLJ.js';
|
|
45
45
|
import '../../chunk-AXW67SY7.js';
|
|
46
46
|
import '../../chunk-BYMOPN2S.js';
|
|
47
47
|
import '../../chunk-SKLEJJ6M.js';
|