@salla.sa/twilight-theme-engine 1.0.208 → 1.0.210
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-FLSMTYQ4.js → AddToCartForm-EG7HATAR.js} +3 -3
- package/dist/{AddToCartForm-FLSMTYQ4.js.map → AddToCartForm-EG7HATAR.js.map} +1 -1
- package/dist/{BlogAuthorPage-PCA6Z5FA.js → BlogAuthorPage-HTOIPQQ4.js} +19 -19
- package/dist/{BlogAuthorPage-PCA6Z5FA.js.map → BlogAuthorPage-HTOIPQQ4.js.map} +1 -1
- package/dist/{BlogCategoryPage-V5OOLDO7.js → BlogCategoryPage-UAHYSE7T.js} +19 -19
- package/dist/{BlogCategoryPage-V5OOLDO7.js.map → BlogCategoryPage-UAHYSE7T.js.map} +1 -1
- package/dist/{BlogPage-3BWT5L66.js → BlogPage-YGVOS4NV.js} +17 -17
- package/dist/{BlogPage-3BWT5L66.js.map → BlogPage-YGVOS4NV.js.map} +1 -1
- package/dist/{BlogSinglePage-5I5KYA3A.js → BlogSinglePage-3YH2K6NA.js} +17 -17
- package/dist/{BlogSinglePage-5I5KYA3A.js.map → BlogSinglePage-3YH2K6NA.js.map} +1 -1
- package/dist/{BlogTagPage-ZOXJ2ZL7.js → BlogTagPage-43GOS5A6.js} +19 -19
- package/dist/{BlogTagPage-ZOXJ2ZL7.js.map → BlogTagPage-43GOS5A6.js.map} +1 -1
- package/dist/{BrandsPage-OJL72GRV.js → BrandsPage-COEINBDY.js} +18 -18
- package/dist/{BrandsPage-OJL72GRV.js.map → BrandsPage-COEINBDY.js.map} +1 -1
- package/dist/{Breadcrumb-GY5KGEKR.js → Breadcrumb-W4E43JGX.js} +17 -17
- package/dist/{Breadcrumb-GY5KGEKR.js.map → Breadcrumb-W4E43JGX.js.map} +1 -1
- package/dist/{CanvasOverlay-AT6M5A2U.js → CanvasOverlay-G2LSKB6E.js} +3 -3
- package/dist/{CanvasOverlay-AT6M5A2U.js.map → CanvasOverlay-G2LSKB6E.js.map} +1 -1
- package/dist/{CartItem-S4BD6EHA.js → CartItem-EBTOA2JO.js} +17 -17
- package/dist/{CartItem-S4BD6EHA.js.map → CartItem-EBTOA2JO.js.map} +1 -1
- package/dist/{CartSummary-JREM7MQD.js → CartSummary-WOZKSBAB.js} +17 -17
- package/dist/{CartSummary-JREM7MQD.js.map → CartSummary-WOZKSBAB.js.map} +1 -1
- package/dist/{Copyright-XX3HG3ZI.js → Copyright-2656CBLY.js} +3 -3
- package/dist/{Copyright-XX3HG3ZI.js.map → Copyright-2656CBLY.js.map} +1 -1
- package/dist/{CustomerLayout-NWSFIJO6.js → CustomerLayout-FBO4W4Z5.js} +17 -17
- package/dist/{CustomerLayout-NWSFIJO6.js.map → CustomerLayout-FBO4W4Z5.js.map} +1 -1
- package/dist/{Footer-AANE2FAE.js → Footer-P3773ZM6.js} +3 -3
- package/dist/{Footer-AANE2FAE.js.map → Footer-P3773ZM6.js.map} +1 -1
- package/dist/GoogleTag-OPCZNE4C.js +15 -0
- package/dist/{GoogleTag-L5HYN3QT.js.map → GoogleTag-OPCZNE4C.js.map} +1 -1
- package/dist/{Header-XTU4UI7Z.js → Header-DSAOP3FS.js} +8 -8
- package/dist/{Header-XTU4UI7Z.js.map → Header-DSAOP3FS.js.map} +1 -1
- package/dist/{LatestProducts-7JE23JAG.js → LatestProducts-GCFPSGAG.js} +19 -19
- package/dist/{LatestProducts-7JE23JAG.js.map → LatestProducts-GCFPSGAG.js.map} +1 -1
- package/dist/{LoyaltyPage-ZN57ZJSO.js → LoyaltyPage-TL6BMGCI.js} +17 -17
- package/dist/{LoyaltyPage-ZN57ZJSO.js.map → LoyaltyPage-TL6BMGCI.js.map} +1 -1
- package/dist/{LoyaltyPointsPage-XHKQJLKS.js → LoyaltyPointsPage-2XEY2ZLT.js} +6 -6
- package/dist/{LoyaltyPointsPage-XHKQJLKS.js.map → LoyaltyPointsPage-2XEY2ZLT.js.map} +1 -1
- package/dist/{MainMenu-5FWCLNGA.js → MainMenu-75YH3CH4.js} +5 -5
- package/dist/{MainMenu-5FWCLNGA.js.map → MainMenu-75YH3CH4.js.map} +1 -1
- package/dist/{MasterLayout-6NE5WERV.js → MasterLayout-65LIO6OE.js} +17 -17
- package/dist/{MasterLayout-6NE5WERV.js.map → MasterLayout-65LIO6OE.js.map} +1 -1
- package/dist/{MobileMenu-FJGYJSBC.js → MobileMenu-YWQ7BHEF.js} +18 -18
- package/dist/{MobileMenu-FJGYJSBC.js.map → MobileMenu-YWQ7BHEF.js.map} +1 -1
- package/dist/{NotificationsPage-3Y3MKZK6.js → NotificationsPage-3UQ3APM2.js} +17 -17
- package/dist/{NotificationsPage-3Y3MKZK6.js.map → NotificationsPage-3UQ3APM2.js.map} +1 -1
- package/dist/{OrderSinglePage-6YBCBFNO.js → OrderSinglePage-GUEL6HB7.js} +18 -18
- package/dist/{OrderSinglePage-6YBCBFNO.js.map → OrderSinglePage-GUEL6HB7.js.map} +1 -1
- package/dist/{OrdersPage-GPIWRVZG.js → OrdersPage-EOD6GG4U.js} +17 -17
- package/dist/{OrdersPage-GPIWRVZG.js.map → OrdersPage-EOD6GG4U.js.map} +1 -1
- package/dist/{PageSingle-NZPCT2XG.js → PageSingle-EOLJMQHB.js} +3 -3
- package/dist/{PageSingle-NZPCT2XG.js.map → PageSingle-EOLJMQHB.js.map} +1 -1
- package/dist/{ProductDetails-3YGL2QGH.js → ProductDetails-RM7MPTMF.js} +5 -5
- package/dist/{ProductDetails-3YGL2QGH.js.map → ProductDetails-RM7MPTMF.js.map} +1 -1
- package/dist/{ProfilePage-RCMMC7OG.js → ProfilePage-XUF24BHS.js} +17 -17
- package/dist/{ProfilePage-RCMMC7OG.js.map → ProfilePage-XUF24BHS.js.map} +1 -1
- package/dist/{ReviewsPage-FVGX7INF.js → ReviewsPage-OUUEO3XC.js} +3 -3
- package/dist/{ReviewsPage-FVGX7INF.js.map → ReviewsPage-OUUEO3XC.js.map} +1 -1
- package/dist/{SeoCartWidget-S4PEITSP.js → SeoCartWidget-TKQPPASG.js} +17 -17
- package/dist/{SeoCartWidget-S4PEITSP.js.map → SeoCartWidget-TKQPPASG.js.map} +1 -1
- package/dist/{SettingsPage-2OZA647W.js → SettingsPage-VIRPJ2FB.js} +17 -17
- package/dist/{SettingsPage-2OZA647W.js.map → SettingsPage-VIRPJ2FB.js.map} +1 -1
- package/dist/{StoreClosedNotification-XIVWDEEQ.js → StoreClosedNotification-SXRGM42Z.js} +18 -18
- package/dist/{StoreClosedNotification-XIVWDEEQ.js.map → StoreClosedNotification-SXRGM42Z.js.map} +1 -1
- package/dist/{TestimonialsPage-EA3N7W56.js → TestimonialsPage-MFRJFBBZ.js} +3 -3
- package/dist/{TestimonialsPage-EA3N7W56.js.map → TestimonialsPage-MFRJFBBZ.js.map} +1 -1
- package/dist/{ThankYouPage-4SRPOE65.js → ThankYouPage-M656TZDL.js} +17 -17
- package/dist/{ThankYouPage-4SRPOE65.js.map → ThankYouPage-M656TZDL.js.map} +1 -1
- package/dist/{WalletPage-IBMF5AQ7.js → WalletPage-RYZACLWW.js} +18 -18
- package/dist/{WalletPage-IBMF5AQ7.js.map → WalletPage-RYZACLWW.js.map} +1 -1
- package/dist/{WebMcpTools-7ILPBGW4.js → WebMcpTools-75A7UJP2.js} +5 -5
- package/dist/{WebMcpTools-7ILPBGW4.js.map → WebMcpTools-75A7UJP2.js.map} +1 -1
- package/dist/{WishlistPage-KVLEDTXR.js → WishlistPage-ICTLFZPO.js} +19 -19
- package/dist/{WishlistPage-KVLEDTXR.js.map → WishlistPage-ICTLFZPO.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/custom-url.js +2 -2
- 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-54VGFM4I.js → chunk-3CZYFTKP.js} +3 -3
- package/dist/{chunk-54VGFM4I.js.map → chunk-3CZYFTKP.js.map} +1 -1
- package/dist/{chunk-VNX6EXCN.js → chunk-3FGCLNM6.js} +7 -7
- package/dist/{chunk-VNX6EXCN.js.map → chunk-3FGCLNM6.js.map} +1 -1
- package/dist/{chunk-WHIIVRZF.js → chunk-4EAQH3WA.js} +4 -4
- package/dist/{chunk-WHIIVRZF.js.map → chunk-4EAQH3WA.js.map} +1 -1
- package/dist/{chunk-XRBYWXFG.js → chunk-5DRX6ZKG.js} +3 -3
- package/dist/{chunk-XRBYWXFG.js.map → chunk-5DRX6ZKG.js.map} +1 -1
- package/dist/{chunk-XRUCBGMT.js → chunk-5XM72SGI.js} +4 -4
- package/dist/{chunk-XRUCBGMT.js.map → chunk-5XM72SGI.js.map} +1 -1
- package/dist/{chunk-BRX23CR2.js → chunk-5ZARPSEZ.js} +3 -3
- package/dist/{chunk-BRX23CR2.js.map → chunk-5ZARPSEZ.js.map} +1 -1
- package/dist/{chunk-F7HINVWX.js → chunk-6DTT6DFS.js} +19 -19
- package/dist/{chunk-F7HINVWX.js.map → chunk-6DTT6DFS.js.map} +1 -1
- package/dist/{chunk-FK4SQURQ.js → chunk-6H6QX2XF.js} +7 -7
- package/dist/{chunk-FK4SQURQ.js.map → chunk-6H6QX2XF.js.map} +1 -1
- package/dist/{chunk-Q4RVSULH.js → chunk-6O2TYPUP.js} +3 -3
- package/dist/{chunk-Q4RVSULH.js.map → chunk-6O2TYPUP.js.map} +1 -1
- package/dist/{chunk-42FFGD7O.js → chunk-6QEKTZWT.js} +6 -6
- package/dist/{chunk-42FFGD7O.js.map → chunk-6QEKTZWT.js.map} +1 -1
- package/dist/{chunk-IPFX3GQO.js → chunk-7557N22C.js} +4 -4
- package/dist/{chunk-IPFX3GQO.js.map → chunk-7557N22C.js.map} +1 -1
- package/dist/{chunk-CBLSUXTP.js → chunk-7IL5RSR5.js} +3 -3
- package/dist/{chunk-CBLSUXTP.js.map → chunk-7IL5RSR5.js.map} +1 -1
- package/dist/{chunk-MFLYX5OS.js → chunk-AUFCS374.js} +4 -4
- package/dist/{chunk-MFLYX5OS.js.map → chunk-AUFCS374.js.map} +1 -1
- package/dist/{chunk-3W42UZSQ.js → chunk-AVJSCOYE.js} +3 -3
- package/dist/{chunk-3W42UZSQ.js.map → chunk-AVJSCOYE.js.map} +1 -1
- package/dist/{chunk-BXUX5FHW.js → chunk-CTU6VJN7.js} +3 -3
- package/dist/{chunk-BXUX5FHW.js.map → chunk-CTU6VJN7.js.map} +1 -1
- package/dist/{chunk-MQ35BIJL.js → chunk-DBFVTN4C.js} +3 -3
- package/dist/{chunk-MQ35BIJL.js.map → chunk-DBFVTN4C.js.map} +1 -1
- package/dist/{chunk-BOB2BDLK.js → chunk-E5HVD4JY.js} +4 -4
- package/dist/{chunk-BOB2BDLK.js.map → chunk-E5HVD4JY.js.map} +1 -1
- package/dist/{chunk-TUZU2FUP.js → chunk-EEZQQMD4.js} +4 -4
- package/dist/{chunk-TUZU2FUP.js.map → chunk-EEZQQMD4.js.map} +1 -1
- package/dist/{chunk-MSKSTXPM.js → chunk-EWK6SZPV.js} +4 -4
- package/dist/{chunk-MSKSTXPM.js.map → chunk-EWK6SZPV.js.map} +1 -1
- package/dist/{chunk-WFXFO222.js → chunk-FD4QTGWX.js} +3 -3
- package/dist/{chunk-WFXFO222.js.map → chunk-FD4QTGWX.js.map} +1 -1
- package/dist/{chunk-3LSW57HE.js → chunk-FY36SODO.js} +3 -3
- package/dist/{chunk-3LSW57HE.js.map → chunk-FY36SODO.js.map} +1 -1
- package/dist/{chunk-GGMWJJFB.js → chunk-G4XPYZ4D.js} +3 -3
- package/dist/{chunk-GGMWJJFB.js.map → chunk-G4XPYZ4D.js.map} +1 -1
- package/dist/{chunk-EKBM77K4.js → chunk-GTNCHLXK.js} +3 -3
- package/dist/{chunk-EKBM77K4.js.map → chunk-GTNCHLXK.js.map} +1 -1
- package/dist/{chunk-K5EHQI7U.js → chunk-H3PNVKBQ.js} +4 -4
- package/dist/{chunk-K5EHQI7U.js.map → chunk-H3PNVKBQ.js.map} +1 -1
- package/dist/{chunk-LHCCAJXH.js → chunk-I6FORV4B.js} +3 -3
- package/dist/{chunk-LHCCAJXH.js.map → chunk-I6FORV4B.js.map} +1 -1
- package/dist/{chunk-4QK6FO3U.js → chunk-KYOGYOMA.js} +4 -4
- package/dist/{chunk-4QK6FO3U.js.map → chunk-KYOGYOMA.js.map} +1 -1
- package/dist/{chunk-IAPLCMKH.js → chunk-MDI42JZX.js} +4 -4
- package/dist/{chunk-IAPLCMKH.js.map → chunk-MDI42JZX.js.map} +1 -1
- package/dist/{chunk-HI5OUST4.js → chunk-MUJEGFLE.js} +3 -3
- package/dist/{chunk-HI5OUST4.js.map → chunk-MUJEGFLE.js.map} +1 -1
- package/dist/{chunk-FSCJ2VXL.js → chunk-NAZ7AXD3.js} +5 -5
- package/dist/{chunk-FSCJ2VXL.js.map → chunk-NAZ7AXD3.js.map} +1 -1
- package/dist/{chunk-WEBVRLRB.js → chunk-NSCZTGJU.js} +3 -3
- package/dist/{chunk-WEBVRLRB.js.map → chunk-NSCZTGJU.js.map} +1 -1
- package/dist/{chunk-O3OSW5KZ.js → chunk-OVYHHD2Q.js} +3 -3
- package/dist/{chunk-O3OSW5KZ.js.map → chunk-OVYHHD2Q.js.map} +1 -1
- package/dist/{chunk-ABQXES25.js → chunk-P3OYCAO3.js} +5 -5
- package/dist/{chunk-ABQXES25.js.map → chunk-P3OYCAO3.js.map} +1 -1
- package/dist/{chunk-XN4FAL4G.js → chunk-P5AFKVVA.js} +4 -4
- package/dist/{chunk-XN4FAL4G.js.map → chunk-P5AFKVVA.js.map} +1 -1
- package/dist/{chunk-OXPVKKJP.js → chunk-Q7FJ4XKY.js} +7 -7
- package/dist/{chunk-OXPVKKJP.js.map → chunk-Q7FJ4XKY.js.map} +1 -1
- package/dist/{chunk-TZBXOHSS.js → chunk-QD3RBSKF.js} +14 -14
- package/dist/{chunk-TZBXOHSS.js.map → chunk-QD3RBSKF.js.map} +1 -1
- package/dist/{chunk-TJDFO67J.js → chunk-SD3XCDUI.js} +3 -3
- package/dist/{chunk-TJDFO67J.js.map → chunk-SD3XCDUI.js.map} +1 -1
- package/dist/{chunk-SHUCELQ5.js → chunk-TZ3DCT3S.js} +3 -3
- package/dist/{chunk-SHUCELQ5.js.map → chunk-TZ3DCT3S.js.map} +1 -1
- package/dist/{chunk-SWLIW4O7.js → chunk-UBU4OIGW.js} +2 -2
- package/dist/{chunk-SWLIW4O7.js.map → chunk-UBU4OIGW.js.map} +1 -1
- package/dist/{chunk-7ORMPMZL.js → chunk-V323S3U7.js} +4 -4
- package/dist/{chunk-7ORMPMZL.js.map → chunk-V323S3U7.js.map} +1 -1
- package/dist/{chunk-PJXTRHQN.js → chunk-V6ZHJMFD.js} +4 -4
- package/dist/{chunk-PJXTRHQN.js.map → chunk-V6ZHJMFD.js.map} +1 -1
- package/dist/{chunk-LUXNURXU.js → chunk-VBXLB7A2.js} +4 -4
- package/dist/{chunk-LUXNURXU.js.map → chunk-VBXLB7A2.js.map} +1 -1
- package/dist/{chunk-D4J3KPGI.js → chunk-VRXZFMMN.js} +4 -4
- package/dist/{chunk-D4J3KPGI.js.map → chunk-VRXZFMMN.js.map} +1 -1
- package/dist/{chunk-7N5EUEMK.js → chunk-WFTPOJUF.js} +4 -4
- package/dist/{chunk-7N5EUEMK.js.map → chunk-WFTPOJUF.js.map} +1 -1
- package/dist/{chunk-DWLEKQ3A.js → chunk-WOIUGEN7.js} +3 -3
- package/dist/{chunk-DWLEKQ3A.js.map → chunk-WOIUGEN7.js.map} +1 -1
- package/dist/{chunk-7P6CX5CM.js → chunk-XHXOKYMY.js} +4 -4
- package/dist/{chunk-7P6CX5CM.js.map → chunk-XHXOKYMY.js.map} +1 -1
- package/dist/{chunk-YUWM5AU7.js → chunk-XTJ45UWF.js} +5 -5
- package/dist/{chunk-YUWM5AU7.js.map → chunk-XTJ45UWF.js.map} +1 -1
- package/dist/{chunk-3MHZVWRI.js → chunk-YB6QLCDQ.js} +5 -5
- package/dist/{chunk-3MHZVWRI.js.map → chunk-YB6QLCDQ.js.map} +1 -1
- package/dist/{chunk-4VQ2XUVG.js → chunk-YUTDUIB5.js} +3 -3
- package/dist/{chunk-4VQ2XUVG.js.map → chunk-YUTDUIB5.js.map} +1 -1
- package/dist/{chunk-2RYMYLXS.js → chunk-YXSKW2QR.js} +3 -3
- package/dist/{chunk-2RYMYLXS.js.map → chunk-YXSKW2QR.js.map} +1 -1
- package/dist/{chunk-SFZBBDO5.js → chunk-Z7SE66QV.js} +3 -3
- package/dist/{chunk-SFZBBDO5.js.map → chunk-Z7SE66QV.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 +15 -15
- package/dist/components/home/index.js +20 -20
- package/dist/components/layout/index.js +4 -4
- package/dist/components/product/index.js +17 -17
- package/dist/components/store/index.js +16 -16
- package/dist/components/tracking/index.js +6 -6
- package/dist/{custom-urls-XGNEF3FO.js → custom-urls-762MPX4D.js} +7 -7
- package/dist/{custom-urls-XGNEF3FO.js.map → custom-urls-762MPX4D.js.map} +1 -1
- package/dist/dev/editor/index.js +1 -1
- package/dist/dev/index.js +1 -1
- package/dist/{document-class-VGMESCGP.js → document-class-FVT5XMGM.js} +17 -17
- package/dist/{document-class-VGMESCGP.js.map → document-class-FVT5XMGM.js.map} +1 -1
- package/dist/hooks/index.js +15 -15
- package/dist/hooks/useGtm.js +15 -15
- package/dist/hooks/useMoney.js +15 -15
- package/dist/hooks/useStore.js +15 -15
- package/dist/hooks/useUser.js +3 -3
- package/dist/index.js +15 -15
- package/dist/{navigation-HCIKY36A.js → navigation-GU5SVIEI.js} +5 -5
- package/dist/{navigation-HCIKY36A.js.map → navigation-GU5SVIEI.js.map} +1 -1
- package/dist/{navigation-3RCZRME5.js → navigation-TG3EJBXL.js} +4 -4
- package/dist/{navigation-3RCZRME5.js.map → navigation-TG3EJBXL.js.map} +1 -1
- package/dist/{not-found-MAYML5V7.js → not-found-SPUNA3MH.js} +18 -18
- package/dist/{not-found-MAYML5V7.js.map → not-found-SPUNA3MH.js.map} +1 -1
- package/dist/providers/index.js +15 -15
- 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 +25 -25
- package/dist/routes/home.js +21 -21
- package/dist/routes/index.js +8 -8
- package/dist/routes/loyalty.js +5 -5
- package/dist/routes/page.js +4 -4
- package/dist/routes/product/index.d.ts.map +1 -1
- package/dist/routes/product-listing/index.d.ts.map +1 -1
- package/dist/routes/product-listing.js +36 -29
- package/dist/routes/product-listing.js.map +1 -1
- package/dist/routes/product.js +41 -24
- package/dist/routes/product.js.map +1 -1
- package/dist/routes/seo-redirects.js +8 -8
- package/dist/routes/testimonials.js +2 -2
- package/dist/routes/thank-you.js +4 -4
- package/dist/skeleton.js +23 -23
- package/dist/{store-lookup-653RQUCV.js → store-lookup-5SQT7FXZ.js} +8 -8
- package/dist/{store-lookup-653RQUCV.js.map → store-lookup-5SQT7FXZ.js.map} +1 -1
- package/dist/tanstack.js +17 -17
- package/dist/utils/index.js +2 -2
- package/package.json +1 -1
- package/tailwind/routes/product/index.tsx.txt +30 -0
- package/tailwind/routes/product-listing/index.tsx.txt +28 -5
- package/dist/GoogleTag-L5HYN3QT.js +0 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/category.ts"],"names":[],"mappings":";;;;AAKO,IAAM,QAAA,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AAA,KAAkC,QAAQ,QAAA,CAAS,IAAA,CAAK,EAAE,CAAC,CAAA;AAAA,EAEzE,MAAM,YAAiC;AACrC,IAAA,MAAM,EAAE,MAAK,GAAI,MAAM,IAAI,GAAA,CAAI,YAAY,EAAE,IAAA,EAA2B;AACxE,IAAA,OAAO,QAAQ,EAAC;AAAA,EAClB,CAAA;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,MAAA,EAAQ,CAAC,EAAA,KACP,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,YAAA,EAAc,QAAA,EAAU,EAAE,CAAA;AAAA,MACrC,OAAA,EAAS,MAAM,QAAA,CAAS,IAAA,CAAK,EAAE;AAAA,KAChC,CAAA;AAAA,IAEH,IAAA,EAAM,MACJ,YAAA,CAAa;AAAA;AAAA,MAEX,QAAA,EAAU,CAAC,YAAA,EAAc,MAAA,EAAQ,EAAE,KAAA,EAAO,cAAA,IAAkB,CAAA;AAAA,MAC5D,OAAA,EAAS,MAAM,QAAA,CAAS,IAAA;AAAK,KAC9B;AAAA;AAEP","file":"chunk-XHXOKYMY.js","sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { api, getActiveScope } from './client';\nimport type { Category } from '../types';\nimport { orThrow } from '../providers/NavigationProvider';\n\nexport const category = {\n find: async (id: string): Promise<Category> => {\n const { data } = await api.get(`categories/${id}`).json<{ data: Category }>();\n return data;\n },\n\n findOrThrow: (id: string): Promise<Category> => orThrow(category.find(id)),\n\n list: async (): Promise<Category[]> => {\n const { data } = await api.get('categories').json<{ data: Category[] }>();\n return data ?? [];\n },\n\n queries: {\n detail: (id: string) =>\n queryOptions({\n queryKey: ['categories', 'detail', id],\n queryFn: () => category.find(id),\n }),\n\n list: () =>\n queryOptions({\n // Scope (branch) varies the API response — key must include it.\n queryKey: ['categories', 'list', { scope: getActiveScope() }],\n queryFn: () => category.list(),\n }),\n },\n};\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { customUrlRedirect } from './chunk-
|
|
1
|
+
import { customUrlRedirect } from './chunk-NAZ7AXD3.js';
|
|
2
2
|
import { PRODUCT_SLUG_ROUTE_ID } from './chunk-NV4PF3O3.js';
|
|
3
|
-
import { product } from './chunk-
|
|
3
|
+
import { product } from './chunk-KYOGYOMA.js';
|
|
4
4
|
import { productKeyOfId, publicProductKeyPath } from './chunk-SDBR4X3K.js';
|
|
5
|
-
import { notFound, orThrow, isMissingResource } from './chunk-
|
|
5
|
+
import { notFound, orThrow, isMissingResource } from './chunk-I6FORV4B.js';
|
|
6
6
|
|
|
7
7
|
// src/routes/product/id.ts
|
|
8
8
|
var PRODUCT_ID = /^\d{1,18}$/;
|
|
@@ -42,5 +42,5 @@ async function resolveProductKeyPage(page, queryClient, address) {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
export { isProductId, productOfKey, resolveProductKeyPage };
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
46
|
-
//# sourceMappingURL=chunk-
|
|
45
|
+
//# sourceMappingURL=chunk-XTJ45UWF.js.map
|
|
46
|
+
//# sourceMappingURL=chunk-XTJ45UWF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/routes/product/id.ts","../src/routes/product/key.ts"],"names":[],"mappings":";;;;;;;AAWA,IAAM,UAAA,GAAa,YAAA;AAGZ,SAAS,YAAY,KAAA,EAAoC;AAC9D,EAAA,OAAO,UAAA,CAAW,IAAA,CAAK,KAAA,IAAS,EAAE,CAAA;AACpC;;;ACAA,IAAM,MAAA,GAAS,UAAA;AAMf,eAAsB,YAAA,CACpB,KACA,WAAA,EACkB;AAClB,EAAA,MAAM,EAAA,GAAK,MAAA,CAAO,IAAA,CAAK,GAAG,IAAI,CAAC,CAAA;AAC/B,EAAA,IAAI,OAAO,MAAA,EAAW;AAEpB,IAAA,IAAI,CAAC,WAAA,CAAY,EAAE,CAAA,SAAU,QAAA,EAAS;AACtC,IAAA,OAAO,OAAA,CAAQ,YAAY,EAAE,CAAA;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AAAA,IACH;AACA,IAAA,QAAA,EAAS;AAAA,EACX;AACF","file":"chunk-XTJ45UWF.js","sourcesContent":["/**\n * A product id: 1 to 18 digits.\n *\n * The API keeps product ids in a signed 64-bit integer. Up to 9223372036854775807 it answers\n * a missing product with 410; one past that, it answers 417, which is neither 404 nor 410, so\n * the page went out as a 500 (`/-/p99999999999999999999999`, which scanners ask for). Every\n * 18-digit number fits; real ids have about 10.\n *\n * `TWIG_PRODUCT_URL` in `../seo-redirects.ts` carries the same cap. Both are literals, because static\n * analysis flags a `RegExp` built from a string.\n */\nconst PRODUCT_ID = /^\\d{1,18}$/;\n\n/** Whether `value` can be a product id the API answers 200 or 410 for. */\nexport function isProductId(value: string | undefined): boolean {\n return PRODUCT_ID.test(value ?? '');\n}\n","/**\n * @fileoverview The product at a SKU-link address (`/{key}-{name}`, see `router/product-key-urls`).\n *\n * The rewrite hands the product route an id of `~{key}`. The key is `p{id}` (the product id\n * itself) or a SKU of letters and digits, as Twig's `getProductBySkuOrId` reads it.\n */\nimport type { QueryClient } from '@tanstack/react-query';\nimport type { Product } from '../../types';\nimport { product } from '../../api/product';\nimport { isMissingResource, notFound, orThrow } from '../../providers/NavigationProvider';\nimport { productKeyOfId, publicProductKeyPath } from '../../router/product-key-urls';\nimport { PRODUCT_SLUG_ROUTE_ID } from '../../router/slug-routes';\nimport { customUrlRedirect, type CustomUrlRedirectOptions } from '../custom-urls';\nimport { isProductId } from './id';\n\n/** `p{id}`: Sluggable's key for a product whose SKU is not letters and digits. */\nconst ID_KEY = /^p(\\d+)$/;\n\n/**\n * The product a key names: by id for `p{id}`, else by SKU. A SKU is read through the query cache,\n * which `resolveProductKeyPage` filled in the same navigation, so it costs one call.\n */\nexport async function productOfKey(\n key: string,\n queryClient?: QueryClient | null\n): Promise<Product> {\n const id = ID_KEY.exec(key)?.[1];\n if (id !== undefined) {\n // Past 18 digits the API answers 417, not 404 (see `./id`).\n if (!isProductId(id)) return notFound();\n return product.findOrThrow(id);\n }\n return orThrow(\n queryClient ? queryClient.ensureQueryData(product.queries.bySku(key)) : product.findBySku(key)\n );\n}\n\n/** The address a SKU-link lookup was made for, so a miss can still be one of the merchant's custom URLs. */\nexport interface ProductKeyAddress {\n /** The router's location: the internal path (`/{name}/p~{key}`) and the query string. */\n location: { pathname: string; searchStr: string };\n /** The language segment an item's page takes (the locale layout's rule). */\n targetLocale?: CustomUrlRedirectOptions['targetLocale'];\n}\n\n/**\n * Run by the locale layout's `beforeLoad`: a SKU that names no product is the not-found page, a\n * 404, as Twig's catch-all answers it, unless the address is one of the merchant's custom URLs.\n * Twig tries those after its SKU route: `/values-in-action` is first SKU `values`.\n *\n * It is resolved here, ahead of the product loader, because a theme may turn that loader's\n * not-found into something else: Raed sends it home with a toast. That suits a product that was\n * deleted, but not `/new-arrivals` or a scanner's path, which only look like a SKU link. The\n * answer stays in the query cache for the loader.\n */\nexport async function resolveProductKeyPage(\n page: { routeId: string; params: Record<string, string | undefined> } | undefined,\n queryClient: QueryClient,\n address?: ProductKeyAddress\n): Promise<void> {\n if (page?.routeId !== PRODUCT_SLUG_ROUTE_ID) return;\n const key = productKeyOfId(page.params.id);\n if (!key || ID_KEY.test(key)) return;\n try {\n await queryClient.ensureQueryData(product.queries.bySku(key));\n } catch (error) {\n if (!isMissingResource(error)) throw error;\n const publicPath = address && publicProductKeyPath(address.location.pathname);\n if (publicPath) {\n await customUrlRedirect(publicPath, address.location.searchStr, {\n queryClient,\n targetLocale: address.targetLocale,\n });\n }\n notFound();\n }\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { seoField } from './chunk-MHBWYHS5.js';
|
|
2
|
-
import { HomeComponentRenderer, ReorderProducts } from './chunk-
|
|
3
|
-
import { home } from './chunk-
|
|
2
|
+
import { HomeComponentRenderer, ReorderProducts } from './chunk-3FGCLNM6.js';
|
|
3
|
+
import { home } from './chunk-5DRX6ZKG.js';
|
|
4
4
|
import { useLiveBlockList, reorder, useLiveBlockMoves } from './chunk-TJK4DVQM.js';
|
|
5
|
-
import { useDevHomeBlocks } from './chunk-
|
|
5
|
+
import { useDevHomeBlocks } from './chunk-5ZARPSEZ.js';
|
|
6
6
|
import { storePageUrl, buildHreflangAlternates } from './chunk-EUHIN5FN.js';
|
|
7
7
|
import { RouteId } from './chunk-OUW6WESU.js';
|
|
8
8
|
import { HookSlot } from './chunk-XZFWBF3P.js';
|
|
@@ -136,5 +136,5 @@ function head(ctx) {
|
|
|
136
136
|
var Home = { id: RouteId.INDEX, loader, head, Component: HomePage };
|
|
137
137
|
|
|
138
138
|
export { Home, HomeSkeleton, homeLoader };
|
|
139
|
-
//# sourceMappingURL=chunk-
|
|
140
|
-
//# sourceMappingURL=chunk-
|
|
139
|
+
//# sourceMappingURL=chunk-YB6QLCDQ.js.map
|
|
140
|
+
//# sourceMappingURL=chunk-YB6QLCDQ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/routes/home/blockList.ts","../src/routes/home/loader.ts","../src/routes/home/HomePage.tsx","../src/routes/home/index.tsx"],"names":["HomeSkeleton","HomePage"],"mappings":";;;;;;;;;;;;;;AAGO,SAAS,UAAU,MAAA,EAA8C;AACtE,EAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAO,GAAA,CAAI,CAAC,KAAA,KAAU,CAAC,KAAA,CAAM,IAAA,EAAM,KAAA,CAAM,GAAA,IAAO,IAAI,CAAC,CAAC,CAAA;AAC9E;;;ACYA,eAAsB,WAAW,GAAA,EAAoD;AACnF,EAAA,MAAM,EAAE,WAAA,EAAY,GAAI,kBAAA,EAAmB;AAC3C,EAAA,MAAM,aAAa,MAAM,WAAA,CAAY,gBAAgB,IAAA,CAAK,OAAA,CAAQ,YAAY,CAAA;AAC9E,EAAA,MAAM,MAAA,GAAS,UAAA,CAAW,GAAA,CAAI,CAAC,IAAA,MAAU;AAAA,IACvC,GAAG,IAAA;AAAA,IACH,MAAM,IAAA,CAAK,IAAA,EAAM,QAAQ,OAAA,E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A,EAAW,GAAA;AAAA,IACX,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,SAAA;AAAA,MACN,KAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAQ,KAAA,CAAM,IAAA;AAAA,MACd;AAAA,KACF;AAAA,IACA,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,qBAAA;AAAA,MACN,KAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAQ,KAAA,CAAM;AAAA,KAChB;AAAA,IACA,oBAAoB,uBAAA,CAAwB,GAAA,CAAI,QAAA,EAAU,GAAA,CAAI,SAAS,QAAQ;AAAA,GACjF;AACF;AAEO,IAAM,IAAA,GAAO,EAAE,EAAA,EAAI,OAAA,CAAQ,OAAO,MAAA,EAAQ,IAAA,EAAM,WAAW,QAAA","file":"chunk-3MHZVWRI.js","sourcesContent":["import type { HomeComponentData } from '../../types';\n\n/** Paths and keys of `blocks` in order: enough to tell the store's list from one a theme built. */\nexport function blockList(blocks: readonly HomeComponentData[]): string {\n return JSON.stringify(blocks.map((block) => [block.path, block.key ?? null]));\n}\n","import { getTwilightContext } from '../../twilight/context';\nimport { home } from '../../api/home';\nimport type { HomeComponentData } from '../../types';\nimport { RouteId } from '../../router/route-ids';\nimport { blockList } from './blockList';\n\nexport interface HomeLoaderData {\n locale: string;\n components: HomeComponentData[];\n page: { slug: string };\n /**\n * The store's blocks as this loader lists them (`blockList`). A theme whose own loader\n * reshapes `components` keeps this, so the page can tell its list is no longer the store's.\n */\n storeBlocks?: string;\n}\n\nexport async function homeLoader(ctx?: { locale?: string }): Promise<HomeLoaderData> {\n const { queryClient } = getTwilightContext();\n const components = await queryClient.ensureQueryData(home.queries.components());\n const blocks = components.map((comp) => ({\n ...comp,\n path: comp.path?.replace('home.', '') || comp.path,\n }));\n return {\n locale: ctx?.locale || 'ar',\n components: blocks,\n page: { slug: RouteId.INDEX },\n storeBlocks: blockList(blocks),\n };\n}\n","import { memo, useCallback, useMemo, useState } from 'react';\nimport { useDevHomeBlocks, type DevHomeBlock } from '../../dev/dev-settings-store';\nimport { HookSlot } from '../../hooks';\nimport { HomeComponentRenderer, ReorderProducts } from '../../components/home';\nimport { reorder, useLiveBlockList, useLiveBlockMoves } from '../../components/live-editor/moves';\nimport type { HomePageProps } from './types';\nimport { blockList } from './blockList';\nimport type { HomeComponentData } from '../../types';\nimport { Pulse } from '@salla.sa/twilight-components-react';\n\nexport const HomeSkeleton = memo(function HomeSkeleton() {\n return (\n <>\n <div className=\"s-block container skeleton-block-hero\">\n <Pulse className=\"h-64 sm:h-80 rounded-md\" />\n </div>\n <div className=\"s-block container skeleton-block-products\">\n <Pulse className=\"h-10 w-48 mb-4\" />\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-4\">\n {[1, 2, 3, 4].map((i) => (\n <Pulse key={i} className=\"h-56\" />\n ))}\n </div>\n </div>\n <div className=\"s-block container skeleton-block-products\">\n <Pulse className=\"h-10 w-48 mb-4\" />\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-4\">\n {[1, 2, 3, 4].map((i) => (\n <Pulse key={i} className=\"h-56\" />\n ))}\n </div>\n </div>\n </>\n );\n});\n\n/** As on Twig, a home page with no blocks lists the store's latest products instead. */\nconst LATEST_PRODUCTS: HomeComponentData = { path: 'latest-products' };\n\n/** The blocks' places in the store's order: 0, 1, 2… */\nconst storeOrder = (blocks: readonly unknown[]) => Array.from(blocks, (_, at) => at);\n\n// Stable, so a redraw of a page loaded without blocks is kept.\nconst NO_BLOCKS: HomeComponentData[] = [];\n\n// Catalog id (or path) plus copy number: a block drawn in or out leaves the others' state alone.\nfunction blockKeys(blocks: ReadonlyArray<DevHomeBlock<HomeComponentData>>): string[] {\n const copies = new Map<string, number>();\n return blocks.map((block) => {\n if (block.__dev_id) return block.__dev_id;\n const name = String(block.key ?? block.path);\n const copy = copies.get(name) ?? 0;\n copies.set(name, copy + 1);\n return `${name}~${copy}`;\n });\n}\n\nexport const HomePage = memo(function HomePage({\n components = NO_BLOCKS,\n storeBlocks,\n}: HomePageProps) {\n // The design studio draws the blocks again after a save, in place of the loaded\n // ones, until the page loads its blocks anew.\n const [drawn, setDrawn] = useState<{\n source: HomeComponentData[];\n blocks: HomeComponentData[];\n } | null>(null);\n const onList = useCallback(\n (blocks: HomeComponentData[]) => setDrawn({ source: components, blocks }),\n [components]\n );\n // A list the theme's own loader built (Tania's home) is not the store's: the studio reloads it instead.\n const storeList = useMemo(\n () => storeBlocks === undefined || storeBlocks === blockList(components),\n [storeBlocks, components]\n );\n useLiveBlockList(storeList ? onList : null);\n const current = drawn?.source === components ? drawn.blocks : components;\n // Dev-mode only: the dev editor's layout replaces the store's blocks while it\n // is on. No-op passthrough in production builds.\n const renderedComponents = useDevHomeBlocks(current);\n // The theme editor's preview moves blocks in place while the editor saves the\n // order; blocks from the server (a new page, a reload) start over from theirs.\n const [moved, setMoved] = useState<{ source: HomeComponentData[]; order: number[] } | null>(null);\n const order = moved?.source === renderedComponents ? moved.order : null;\n const onMove = useCallback(\n (from: number, to: number) =>\n setMoved((prev) => ({\n source: renderedComponents,\n order: reorder(\n prev?.source === renderedComponents ? prev.order : storeOrder(renderedComponents),\n from,\n to\n ),\n })),\n [renderedComponents]\n );\n useLiveBlockMoves(onMove);\n const placed = order ?? storeOrder(renderedComponents);\n const keys = useMemo(() => blockKeys(renderedComponents), [renderedComponents]);\n\n return (\n <>\n <HookSlot name=\"home:start\" />\n <HookSlot name=\"home:content\" />\n {placed.map((at, index) => {\n // A block's key stays with it when the preview moves it, so a move keeps its state.\n return <HomeComponentRenderer key={keys[at]} data={renderedComponents[at]} index={index} />;\n })}\n {!renderedComponents.length && (\n <HomeComponentRenderer data={LATEST_PRODUCTS} index={0} editable={false} />\n )}\n <HookSlot name=\"home:end\" />\n <ReorderProducts />\n </>\n );\n});\n\nexport { HomePage as default };\n","import type { HeadDescriptor } from '../../utils/head';\nimport { buildHreflangAlternates, storePageUrl } from '../../utils/baseHead';\nimport { seoField } from '../../utils/seo-text';\nimport type { HomeLoaderData } from './loader';\nimport { homeLoader } from './loader';\nimport type { TwilightContext } from '../../twilight/context';\nimport { HomePage } from './HomePage';\nimport { RouteId } from '../../router/route-ids';\n\nexport { HomeSkeleton } from './HomePage';\nexport { registerHomeComponents, DefaultHomeComponents } from '../../components/home/register';\nexport { registerHomeComponentConfig } from '../../components/home';\nexport type { HomePageProps } from './types';\nexport type { HomeLoaderData } from './loader';\nexport type {\n HomeComponentsProps,\n AnyHomeComponent,\n HomeComponentConfig,\n} from '../../components/home';\n\nfunction loader(_ctx?: { locale?: string }): Promise<HomeLoaderData> {\n return homeLoader({ locale: _ctx?.locale });\n}\n\nfunction head(ctx: TwilightContext): HeadDescriptor {\n const store = ctx.settings?.store;\n if (!store) return {};\n\n // `seoField`, not `??`: the store's unset SEO fields arrive as \"\".\n const title = seoField(store.meta?.title, store.name);\n const description = seoField(store.meta?.description, store.description);\n const keywords = seoField(store.meta?.keywords, undefined);\n // `/ar`, like Twig, where store.url reads `/ar/`.\n const url = storePageUrl(ctx.settings, ctx.location.pathname) ?? store.url;\n\n return {\n title,\n description,\n keywords,\n canonical: url,\n openGraph: {\n type: 'website',\n title,\n description,\n images: store.logo,\n url,\n },\n twitter: {\n card: 'summary_large_image',\n title,\n description,\n images: store.logo,\n },\n alternateLanguages: buildHreflangAlternates(ctx.settings, ctx.location.pathname),\n };\n}\n\nexport const Home = { id: RouteId.INDEX, loader, head, Component: HomePage } as const;\n\nexport { homeLoader };\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/routes/home/blockList.ts","../src/routes/home/loader.ts","../src/routes/home/HomePage.tsx","../src/routes/home/index.tsx"],"names":["HomeSkeleton","HomePage"],"mappings":";;;;;;;;;;;;;;AAGO,SAAS,UAAU,MAAA,EAA8C;AACtE,EAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAO,GAAA,CAAI,CAAC,KAAA,KAAU,CAAC,KAAA,CAAM,IAAA,EAAM,KAAA,CAAM,GAAA,IAAO,IAAI,CAAC,CAAC,CAA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AA,CAAS,KAAA,CAAM,IAAA,EAAM,WAAA,EAAa,MAAM,WAAW,CAAA;AACvE,EAAA,MAAM,QAAA,GAAW,QAAA,CAAS,KAAA,CAAM,IAAA,EAAM,UAAU,MAAS,CAAA;AAEzD,EAAA,MAAM,GAAA,GAAM,aAAa,GAAA,CAAI,QAAA,EAAU,IAAI,QAAA,CAAS,QAAQ,KAAK,KAAA,CAAM,GAAA;AAEvE,EAAA,OAAO;AAAA,IACL,KAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA,EAAW,GAAA;AAAA,IACX,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,SAAA;AAAA,MACN,KAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAQ,KAAA,CAAM,IAAA;AAAA,MACd;AAAA,KACF;AAAA,IACA,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,qBAAA;AAAA,MACN,KAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAQ,KAAA,CAAM;AAAA,KAChB;AAAA,IACA,oBAAoB,uBAAA,CAAwB,GAAA,CAAI,QAAA,EAAU,GAAA,CAAI,SAAS,QAAQ;AAAA,GACjF;AACF;AAEO,IAAM,IAAA,GAAO,EAAE,EAAA,EAAI,OAAA,CAAQ,OAAO,MAAA,EAAQ,IAAA,EAAM,WAAW,QAAA","file":"chunk-YB6QLCDQ.js","sourcesContent":["import type { HomeComponentData } from '../../types';\n\n/** Paths and keys of `blocks` in order: enough to tell the store's list from one a theme built. */\nexport function blockList(blocks: readonly HomeComponentData[]): string {\n return JSON.stringify(blocks.map((block) => [block.path, block.key ?? null]));\n}\n","import { getTwilightContext } from '../../twilight/context';\nimport { home } from '../../api/home';\nimport type { HomeComponentData } from '../../types';\nimport { RouteId } from '../../router/route-ids';\nimport { blockList } from './blockList';\n\nexport interface HomeLoaderData {\n locale: string;\n components: HomeComponentData[];\n page: { slug: string };\n /**\n * The store's blocks as this loader lists them (`blockList`). A theme whose own loader\n * reshapes `components` keeps this, so the page can tell its list is no longer the store's.\n */\n storeBlocks?: string;\n}\n\nexport async function homeLoader(ctx?: { locale?: string }): Promise<HomeLoaderData> {\n const { queryClient } = getTwilightContext();\n const components = await queryClient.ensureQueryData(home.queries.components());\n const blocks = components.map((comp) => ({\n ...comp,\n path: comp.path?.replace('home.', '') || comp.path,\n }));\n return {\n locale: ctx?.locale || 'ar',\n components: blocks,\n page: { slug: RouteId.INDEX },\n storeBlocks: blockList(blocks),\n };\n}\n","import { memo, useCallback, useMemo, useState } from 'react';\nimport { useDevHomeBlocks, type DevHomeBlock } from '../../dev/dev-settings-store';\nimport { HookSlot } from '../../hooks';\nimport { HomeComponentRenderer, ReorderProducts } from '../../components/home';\nimport { reorder, useLiveBlockList, useLiveBlockMoves } from '../../components/live-editor/moves';\nimport type { HomePageProps } from './types';\nimport { blockList } from './blockList';\nimport type { HomeComponentData } from '../../types';\nimport { Pulse } from '@salla.sa/twilight-components-react';\n\nexport const HomeSkeleton = memo(function HomeSkeleton() {\n return (\n <>\n <div className=\"s-block container skeleton-block-hero\">\n <Pulse className=\"h-64 sm:h-80 rounded-md\" />\n </div>\n <div className=\"s-block container skeleton-block-products\">\n <Pulse className=\"h-10 w-48 mb-4\" />\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-4\">\n {[1, 2, 3, 4].map((i) => (\n <Pulse key={i} className=\"h-56\" />\n ))}\n </div>\n </div>\n <div className=\"s-block container skeleton-block-products\">\n <Pulse className=\"h-10 w-48 mb-4\" />\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-4\">\n {[1, 2, 3, 4].map((i) => (\n <Pulse key={i} className=\"h-56\" />\n ))}\n </div>\n </div>\n </>\n );\n});\n\n/** As on Twig, a home page with no blocks lists the store's latest products instead. */\nconst LATEST_PRODUCTS: HomeComponentData = { path: 'latest-products' };\n\n/** The blocks' places in the store's order: 0, 1, 2… */\nconst storeOrder = (blocks: readonly unknown[]) => Array.from(blocks, (_, at) => at);\n\n// Stable, so a redraw of a page loaded without blocks is kept.\nconst NO_BLOCKS: HomeComponentData[] = [];\n\n// Catalog id (or path) plus copy number: a block drawn in or out leaves the others' state alone.\nfunction blockKeys(blocks: ReadonlyArray<DevHomeBlock<HomeComponentData>>): string[] {\n const copies = new Map<string, number>();\n return blocks.map((block) => {\n if (block.__dev_id) return block.__dev_id;\n const name = String(block.key ?? block.path);\n const copy = copies.get(name) ?? 0;\n copies.set(name, copy + 1);\n return `${name}~${copy}`;\n });\n}\n\nexport const HomePage = memo(function HomePage({\n components = NO_BLOCKS,\n storeBlocks,\n}: HomePageProps) {\n // The design studio draws the blocks again after a save, in place of the loaded\n // ones, until the page loads its blocks anew.\n const [drawn, setDrawn] = useState<{\n source: HomeComponentData[];\n blocks: HomeComponentData[];\n } | null>(null);\n const onList = useCallback(\n (blocks: HomeComponentData[]) => setDrawn({ source: components, blocks }),\n [components]\n );\n // A list the theme's own loader built (Tania's home) is not the store's: the studio reloads it instead.\n const storeList = useMemo(\n () => storeBlocks === undefined || storeBlocks === blockList(components),\n [storeBlocks, components]\n );\n useLiveBlockList(storeList ? onList : null);\n const current = drawn?.source === components ? drawn.blocks : components;\n // Dev-mode only: the dev editor's layout replaces the store's blocks while it\n // is on. No-op passthrough in production builds.\n const renderedComponents = useDevHomeBlocks(current);\n // The theme editor's preview moves blocks in place while the editor saves the\n // order; blocks from the server (a new page, a reload) start over from theirs.\n const [moved, setMoved] = useState<{ source: HomeComponentData[]; order: number[] } | null>(null);\n const order = moved?.source === renderedComponents ? moved.order : null;\n const onMove = useCallback(\n (from: number, to: number) =>\n setMoved((prev) => ({\n source: renderedComponents,\n order: reorder(\n prev?.source === renderedComponents ? prev.order : storeOrder(renderedComponents),\n from,\n to\n ),\n })),\n [renderedComponents]\n );\n useLiveBlockMoves(onMove);\n const placed = order ?? storeOrder(renderedComponents);\n const keys = useMemo(() => blockKeys(renderedComponents), [renderedComponents]);\n\n return (\n <>\n <HookSlot name=\"home:start\" />\n <HookSlot name=\"home:content\" />\n {placed.map((at, index) => {\n // A block's key stays with it when the preview moves it, so a move keeps its state.\n return <HomeComponentRenderer key={keys[at]} data={renderedComponents[at]} index={index} />;\n })}\n {!renderedComponents.length && (\n <HomeComponentRenderer data={LATEST_PRODUCTS} index={0} editable={false} />\n )}\n <HookSlot name=\"home:end\" />\n <ReorderProducts />\n </>\n );\n});\n\nexport { HomePage as default };\n","import type { HeadDescriptor } from '../../utils/head';\nimport { buildHreflangAlternates, storePageUrl } from '../../utils/baseHead';\nimport { seoField } from '../../utils/seo-text';\nimport type { HomeLoaderData } from './loader';\nimport { homeLoader } from './loader';\nimport type { TwilightContext } from '../../twilight/context';\nimport { HomePage } from './HomePage';\nimport { RouteId } from '../../router/route-ids';\n\nexport { HomeSkeleton } from './HomePage';\nexport { registerHomeComponents, DefaultHomeComponents } from '../../components/home/register';\nexport { registerHomeComponentConfig } from '../../components/home';\nexport type { HomePageProps } from './types';\nexport type { HomeLoaderData } from './loader';\nexport type {\n HomeComponentsProps,\n AnyHomeComponent,\n HomeComponentConfig,\n} from '../../components/home';\n\nfunction loader(_ctx?: { locale?: string }): Promise<HomeLoaderData> {\n return homeLoader({ locale: _ctx?.locale });\n}\n\nfunction head(ctx: TwilightContext): HeadDescriptor {\n const store = ctx.settings?.store;\n if (!store) return {};\n\n // `seoField`, not `??`: the store's unset SEO fields arrive as \"\".\n const title = seoField(store.meta?.title, store.name);\n const description = seoField(store.meta?.description, store.description);\n const keywords = seoField(store.meta?.keywords, undefined);\n // `/ar`, like Twig, where store.url reads `/ar/`.\n const url = storePageUrl(ctx.settings, ctx.location.pathname) ?? store.url;\n\n return {\n title,\n description,\n keywords,\n canonical: url,\n openGraph: {\n type: 'website',\n title,\n description,\n images: store.logo,\n url,\n },\n twitter: {\n card: 'summary_large_image',\n title,\n description,\n images: store.logo,\n },\n alternateLanguages: buildHreflangAlternates(ctx.settings, ctx.location.pathname),\n };\n}\n\nexport const Home = { id: RouteId.INDEX, loader, head, Component: HomePage } as const;\n\nexport { homeLoader };\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { user } from './chunk-
|
|
1
|
+
import { user } from './chunk-NSCZTGJU.js';
|
|
2
2
|
import { getTwilightContext } from './chunk-MWUAHDQL.js';
|
|
3
3
|
import { useRenderProbe } from './chunk-T43GL7UN.js';
|
|
4
4
|
import { useQuery } from '@tanstack/react-query';
|
|
@@ -15,5 +15,5 @@ function useUser() {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export { useUser };
|
|
18
|
-
//# sourceMappingURL=chunk-
|
|
19
|
-
//# sourceMappingURL=chunk-
|
|
18
|
+
//# sourceMappingURL=chunk-YUTDUIB5.js.map
|
|
19
|
+
//# sourceMappingURL=chunk-YUTDUIB5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/useUser.ts"],"names":[],"mappings":";;;;;AAWO,SAAS,OAAA,GAAyB;AACvC,EAAA,cAAA,CAAe,SAAS,CAAA;AACxB,EAAA,MAAM,KAAA,GAAQ,oBAAmB,CAAE,SAAA;AAEnC,EAAA,MAAM,QAAQ,QAAA,CAAS;AAAA,IACrB,GAAG,IAAA,CAAK,OAAA,CAAQ,OAAA,EAAQ;AAAA,IACxB,OAAA,EAAS,CAAC,CAAC,KAAA;AAAA,IACX,eAAA,EAAiB;AAAA,GAClB,CAAA;AAED,EAAA,OAAO,EAAE,GAAG,KAAA,EAAO,UAAA,EAAY,CAAC,CAAC,KAAA,EAAM;AACzC","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/hooks/useUser.ts"],"names":[],"mappings":";;;;;AAWO,SAAS,OAAA,GAAyB;AACvC,EAAA,cAAA,CAAe,SAAS,CAAA;AACxB,EAAA,MAAM,KAAA,GAAQ,oBAAmB,CAAE,SAAA;AAEnC,EAAA,MAAM,QAAQ,QAAA,CAAS;AAAA,IACrB,GAAG,IAAA,CAAK,OAAA,CAAQ,OAAA,EAAQ;AAAA,IACxB,OAAA,EAAS,CAAC,CAAC,KAAA;AAAA,IACX,eAAA,EAAiB;AAAA,GAClB,CAAA;AAED,EAAA,OAAO,EAAE,GAAG,KAAA,EAAO,UAAA,EAAY,CAAC,CAAC,KAAA,EAAM;AACzC","file":"chunk-YUTDUIB5.js","sourcesContent":["import { useQuery, type UseQueryResult } from '@tanstack/react-query';\nimport { getTwilightContext } from '../twilight/context';\nimport { user } from '../api/user';\nimport type { User } from '../types';\nimport { useRenderProbe } from '../utils/render-probe';\n\nexport type UseUserReturn = UseQueryResult<User | null> & {\n /** True when an auth token exists (regardless of query state). */\n isLoggedIn: boolean;\n};\n\nexport function useUser(): UseUserReturn {\n useRenderProbe('useUser');\n const token = getTwilightContext().authToken;\n\n const query = useQuery({\n ...user.queries.current(),\n enabled: !!token,\n placeholderData: null,\n });\n\n return { ...query, isLoggedIn: !!token };\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { configureNavigation, UnauthorizedError, NavigationProvider, resolveRelativePath } from './chunk-
|
|
1
|
+
import { configureNavigation, UnauthorizedError, NavigationProvider, resolveRelativePath } from './chunk-I6FORV4B.js';
|
|
2
2
|
import { LinkProvider } from './chunk-EDCNCBSC.js';
|
|
3
3
|
import { useIsNativeApp } from './chunk-BZ2QSBXM.js';
|
|
4
4
|
import { onSallaEvent } from './chunk-MZPX4EPS.js';
|
|
@@ -214,5 +214,5 @@ function TanStackNavigationProvider({ children }) {
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
export { NavigationSetup, TanStackLinkAdapter, TanStackNavigationProvider, createTanStackLinkAdapter, documentRedirectHref, requestHostOf };
|
|
217
|
-
//# sourceMappingURL=chunk-
|
|
218
|
-
//# sourceMappingURL=chunk-
|
|
217
|
+
//# sourceMappingURL=chunk-YXSKW2QR.js.map
|
|
218
|
+
//# sourceMappingURL=chunk-YXSKW2QR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tanstack/link.tsx","../src/tanstack/native-app-events.tsx","../src/utils/request-host.ts","../src/tanstack/navigation.tsx"],"names":["TanStackLink","tanstackNotFound","tanstackRedirect","useParams","jsx"],"mappings":";;;;;;;;;;;;AAWO,SAAS,mBAAA,CAAoB,aAAqB,MAAA,EAAiB;AAExE,EAAA,IAAI,CAAC,QAAA,CAAS,MAAM,CAAA,IAAK,CAAC,WAAA,CAAY,UAAA,CAAW,GAAG,CAAA,IAAK,WAAA,CAAY,UAAA,CAAW,IAAI,CAAA,EAAG;AACrF,IAAA,OAAO,WAAA;AAAA,EACT;AACA,EAAA,MAAM,YAAA,GAAe,WAAA,CAAY,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,CAAA,EAAG,KAAA,CAAM,MAAM,CAAA,CAAE,CAAC,CAAA;AAC/D,EAAA,IAAI,QAAA,CAAS,YAAY,CAAA,EAAG,OAAO,WAAA;AACnC,EAAA,OAAO,WAAA,KAAgB,MAAM,CAAA,CAAA,EAAI,MAAM,KAAK,CAAA,CAAA,EAAI,MAAM,GAAG,WAAW,CAAA,CAAA;AACtE;AAMO,IAAM,mBAAA,GAAsB,UAAA;AAAA,EACjC,CACE;AAAA,IACE,EAAA;AAAA,IACA,IAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,KAAA;AAAA,IACA,KAAA;AAAA,IACA,MAAA;AAAA,IACA,GAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAA;AAAA,IACA,YAAA,EAAc,SAAA;AAAA,IACd,GAAG;AAAA,KAEL,GAAA,KACG;AACH,IAAA,MAAM,EAAE,MAAA,EAAO,GAAI,UAAU,EAAE,MAAA,EAAQ,OAAO,CAAA;AAC9C,IAAA,MAAM,WAAA,GAAc,mBAAA,CAAoB,EAAA,IAAM,IAAA,IAAQ,KAAK,MAAM,CAAA;AAIjE,IAAA,IAAI,gBAAgB,GAAA,EAAK;AACvB,MAAA,OAAO,aAAA;AAAA,QACL,GAAA;AAAA,QACA,EAAE,KAAK,SAAA,EAAW,KAAA,E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;AAAA,GACxD;AAEJ","file":"chunk-2RYMYLXS.js","sourcesContent":["import { forwardRef, createElement } from 'react';\nimport { Link as TanStackLink, useParams } from '@tanstack/react-router';\nimport { isLocale } from '../providers/locale-constants';\nimport type { BaseLinkProps } from '../components/common/Link.types';\n\n/**\n * Routes live under an optional `/{-$locale}` param, so a bare `to=\"/brands\"`\n * resolves with the locale omitted and the $locale loader bounces the user to\n * the fallback locale. Prefix the current locale onto internal paths that\n * don't already carry one.\n */\nexport function localizeDestination(destination: string, locale?: string) {\n // On the not-found page a first segment that is no language binds as the locale (`/p1-x`).\n if (!isLocale(locale) || !destination.startsWith('/') || destination.startsWith('//')) {\n return destination;\n }\n const firstSegment = destination.split('/')[1]?.split(/[?#]/)[0];\n if (isLocale(firstSegment)) return destination;\n return destination === '/' ? `/${locale}` : `/${locale}${destination}`;\n}\n\n/**\n * TanStack Router Link adapter.\n * Translates framework-agnostic props to TanStack Router Link props.\n */\nexport const TanStackLinkAdapter = forwardRef<HTMLAnchorElement, BaseLinkProps>(\n (\n {\n to,\n href,\n children,\n className,\n style,\n title,\n target,\n rel,\n onClick,\n preload,\n replace,\n 'aria-label': ariaLabel,\n ...rest\n },\n ref\n ) => {\n const { locale } = useParams({ strict: false }) as { locale?: string };\n const destination = localizeDestination(to ?? href ?? '/', locale);\n\n // `#` is how a block says it has nowhere to go, such as a banner with no URL. An anchor with\n // no href keeps the theme's `a` styles, and the router can neither preload nor follow it.\n if (destination === '#') {\n return createElement(\n 'a',\n { ref, className, style, title, onClick, 'aria-label': ariaLabel, ...rest },\n children\n );\n }\n\n return createElement(\n TanStackLink,\n {\n ref,\n to: destination,\n className,\n style,\n title,\n target,\n rel,\n onClick,\n preload: preload === 'intent' || preload === false ? preload : undefined,\n replace,\n 'aria-label': ariaLabel,\n ...(rest as Record<string, unknown>),\n },\n children\n );\n }\n);\n\nTanStackLinkAdapter.displayName = 'TanStackLinkAdapter';\n\n/**\n * Create a TanStack Router Link adapter component.\n */\nexport function createTanStackLinkAdapter() {\n return TanStackLinkAdapter;\n}\n","import { useEffect } from 'react';\nimport { useRouter } from '@tanstack/react-router';\nimport { resolveRelativePath } from '../providers/NavigationProvider';\nimport { useTwilight } from '../providers/twilight-context';\nimport { isLocale } from '../providers/locale-constants';\nimport { getTwilightContext } from '../twilight/context';\nimport { useIsNativeApp } from '../native-app';\nimport { onSallaEvent } from '../utils/sdk-helpers';\nimport { hasStoreUrlBase } from '../utils/store-base';\nimport { localizeDestination } from './link';\n\nconst UI_UPDATE_EVENT = 'mobile::ui.update';\nconst OPEN_ORDER_EVENT = 'mobile::open.order';\nconst NAVIGATE_TO_EVENT = 'mobile::navigate.to';\n\n/**\n * Events the native app sends into its webview. `NavigationSetup` mounts this once, so a\n * theme adds no listener of its own:\n *\n * - `mobile::ui.update` re-runs the route loaders and refetches what is on screen.\n * - `mobile::open.order` `{ id }` opens that order, with a fresh cart.\n * - `mobile::navigate.to` `{ url }` opens a notification deep link in-app. Only a link to\n * this store is followed (`deepLinkPath`), so `javascript:`, off-site and other stores'\n * URLs are dropped.\n *\n * Nothing is mounted outside the app (`useIsNativeApp()`), so a browser runs none of it.\n */\nexport function NativeAppEvents({ locale }: { locale?: string }) {\n return useIsNativeApp() ? <Listeners locale={locale} /> : null;\n}\n\nfunction Listeners({ locale }: { locale?: string }) {\n useNativeAppEvents(locale);\n return null;\n}\n\n/** The listeners themselves. `NativeAppEvents` mounts them inside the app only. */\nexport function useNativeAppEvents(locale?: string): void {\n const router = useRouter();\n const { store } = useTwilight();\n const storeUrl = store?.url;\n const username = store?.username;\n\n useEffect(() => {\n // `href`, not `to`: the router parses the query and the hash out of it.\n const open = (path: string) =>\n void router.navigate({ href: localizeDestination(path, locale) });\n\n const refresh = () => {\n void Promise.allSettled([\n router.invalidate(),\n getTwilightContext().queryClient?.refetchQueries({ type: 'active' }),\n ]);\n };\n const openOrder = (data?: unknown) => {\n const rawId = (data as { id?: unknown } | undefined)?.id;\n if (typeof rawId !== 'string' && typeof rawId !== 'number') return;\n\n const id = String(rawId).trim();\n if (!id) return;\n\n void getTwilightContext().queryClient?.invalidateQueries({ queryKey: ['cart'] });\n open(`/account/orders/${encodeURIComponent(id)}`);\n };\n const navigateTo = (data?: unknown) => {\n const url = (data as { url?: unknown } | undefined)?.url;\n if (typeof url !== 'string' || !url.trim() || !storeUrl) return;\n\n const path = deepLinkPath(url.trim(), storeUrl, username);\n if (path) void router.navigate({ href: inLocale(path, locale) });\n };\n\n const offs = [\n onSallaEvent(UI_UPDATE_EVENT, refresh),\n onSallaEvent(OPEN_ORDER_EVENT, openOrder),\n onSallaEvent(NAVIGATE_TO_EVENT, navigateTo),\n ];\n return () => offs.forEach((off) => off());\n }, [router, locale, storeUrl, username]);\n}\n\n/** A URL that names its host: `https://…` or `//…`. Anything else is a path of this app. */\nfunction isAbsoluteUrl(url: string): boolean {\n if (url.startsWith('//')) return true;\n try {\n // Without a base, only a URL with its own scheme parses.\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * The application path of a deep link to this store, or null for any other link.\n *\n * It passes the test a tapped link does (`resolveRelativePath`: the store's origin, the\n * username taken off), and one more. On a shared host that origin is every store's, so\n * an absolute link has to carry this store's username: without it, another store's\n * `/ar/offers` would open this store's offers.\n */\nfunction deepLinkPath(url: string, storeUrl: string, username?: string): string | null {\n const path = resolveRelativePath(url, storeUrl, username);\n if (!path || !isAbsoluteUrl(url)) return path;\n\n // Both parse: `resolveRelativePath` returns null when either does not.\n const { pathname } = new URL(url, window.location.href);\n return hasStoreUrlBase(pathname, new URL(storeUrl).pathname, username) ? path : null;\n}\n\n/**\n * A deep link in the locale the visitor is browsing in. A notification is written in one\n * language and opened in whichever is on screen, so the link's own locale gives way.\n *\n * The prefix is written here, not by `localizeDestination`: that one leaves a path alone\n * when it already starts with a locale, and would take the slug of `/ar/en/p456` for one.\n */\nfunction inLocale(path: string, locale?: string): string {\n const first = path.split('/')[1]?.split(/[?#]/)[0];\n const own = isLocale(first) ? path.slice(first.length + 1) : path;\n const rest = own.startsWith('/') ? own : `/${own}`;\n\n if (!locale) return rest;\n return rest === '/' ? `/${locale}` : `/${locale}${rest}`;\n}\n","/**\n * What the request itself is enough to describe: its host.\n *\n * Small, and deliberately its own module rather than a helper inside the\n * middleware. This value decides two things — which store a live storefront is,\n * and whether the request is allowed to name a store at all — so it is worth\n * testing directly instead of only through the wiring that calls it.\n */\nimport { isLoopback } from './cookies';\n\n/** The part of a `Request` this needs, so a test does not have to build a whole one. */\nexport interface HostSource {\n url: string;\n headers: { get(name: string): string | null };\n}\n\n/**\n * The host this request arrived on, with its port when it has one.\n *\n * Taken from the request URL, which in a Worker is the address the platform\n * actually routed on, and from the `Host` header only when that fails.\n *\n * **`X-Forwarded-Host` is deliberately not consulted.** A client can set it, and\n * this value gates `allowsRequestStoreId` — so honouring it would be a way to\n * talk a merchant's own domain into behaving like the preview host, and from\n * there into serving a stranger's shop. The dispatcher strips that header today;\n * a theme must not be one edit to another repository's allowlist away from a\n * spoofable identity.\n */\nexport function requestHostOf(request: HostSource): string | null {\n try {\n const fromUrl = new URL(request.url).host;\n if (fromUrl) return fromUrl;\n } catch {\n /* an unparseable URL falls through to the header */\n }\n\n return request.headers.get('Host')?.trim() || null;\n}\n\n/** The origin a browser reached this host on: `http` for a dev server, `https` otherwise. */\nexport function requestOriginOf(host: string): string {\n return `${isLoopback(host.replace(/:\\d+$/, '')) ? 'http' : 'https'}://${host}`;\n}\n","import {\n useNavigate,\n useParams,\n redirect as tanstackRedirect,\n notFound as tanstackNotFound,\n} from '@tanstack/react-router';\nimport {\n NavigationProvider,\n configureNavigation,\n type NavigateOptions,\n} from '../providers/NavigationProvider';\nimport { LinkProvider } from '../providers/LinkProvider';\nimport { TanStackLinkAdapter, localizeDestination } from './link';\nimport { NativeAppEvents } from './native-app-events';\nimport { useCallback, type ReactNode } from 'react';\nimport { UnauthorizedError, type RedirectOptions } from '../providers/NavigationProvider';\nimport { getRequestStore, getTwilightContext } from '../twilight/context';\nimport { resolveStoreBase, resolveStoreBaseFollowsLocale } from '../utils/store-identity';\nimport { loginRedirectHref } from '../utils/store-base';\nimport { requestOriginOf } from '../utils/request-host';\n\n/**\n * Where a document redirect (`reloadDocument`) may go: an http(s) URL, or a path on this host. A\n * protocol-relative `//host` or any other scheme is refused here, as an error the caller made:\n * the router throws on those too, and a page that cannot redirect safely must not try.\n */\nexport function documentRedirectHref(target: string): string {\n if (target.startsWith('/') && !target.startsWith('//')) return target;\n const url = new URL(target);\n if (url.protocol !== 'http:' && url.protocol !== 'https:') {\n throw new Error(`A document redirect needs an http(s) URL, not ${url.protocol}`);\n }\n return url.href;\n}\n\nfunction currentOrigin(): string | null {\n if (typeof window !== 'undefined') return window.location.origin;\n const host = getRequestStore().requestHost;\n return host ? requestOriginOf(host) : null;\n}\n\nconfigureNavigation({\n notFound: (message?: string) => {\n throw tanstackNotFound({ data: message });\n },\n redirect: (path: string, opts?: RedirectOptions) => {\n if (opts?.reloadDocument) {\n // `href`, not `to`: the router neither matches it nor adds the store base to it.\n const href = documentRedirectHref(path);\n throw tanstackRedirect({\n href,\n reloadDocument: true,\n replace: opts.replace,\n statusCode: opts.statusCode,\n });\n }\n throw tanstackRedirect({ to: path, replace: opts?.replace, statusCode: opts?.statusCode });\n },\n unauthorized: (message?: string) => {\n const origin = currentOrigin();\n const { pathname, searchStr } = getTwilightContext().location;\n const href =\n origin &&\n loginRedirectHref({\n pathname,\n searchStr,\n origin,\n base: resolveStoreBase(),\n baseFollowsLocale: resolveStoreBaseFollowsLocale(),\n });\n // A full load, because the SDK only reads `intended_to` when a page starts.\n if (href) throw tanstackRedirect({ href, reloadDocument: true, replace: true });\n throw new UnauthorizedError(message);\n },\n});\n\n/**\n * TanStack navigation setup - wraps children with NavigationProvider and LinkProvider.\n * Called by TwilightProvider when client.framework === 'tanstack'.\n */\nexport function NavigationSetup({ children }: { children: ReactNode }) {\n const navigate = useNavigate();\n const { locale } = useParams({ strict: false }) as { locale?: string };\n const navigateFn = useCallback(\n (to: string, opts?: NavigateOptions) =>\n navigate({ to: localizeDestination(to, locale), replace: opts?.replace }),\n [navigate, locale]\n );\n\n return (\n <NavigationProvider navigate={navigateFn}>\n <NativeAppEvents locale={locale} />\n <LinkProvider adapter={TanStackLinkAdapter}>{children}</LinkProvider>\n </NavigationProvider>\n );\n}\n\n/** @deprecated Use NavigationSetup instead */\nexport function TanStackNavigationProvider({ children }: { children: ReactNode }) {\n const navigate = useNavigate();\n return (\n <NavigationProvider\n navigate={(to: string, opts?: NavigateOptions) => navigate({ to, replace: opts?.replace })}\n >\n <LinkProvider adapter={TanStackLinkAdapter}>{children}</LinkProvider>\n </NavigationProvider>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/tanstack/link.tsx","../src/tanstack/native-app-events.tsx","../src/utils/request-host.ts","../src/tanstack/navigation.tsx"],"names":["TanStackLink","tanstackNotFound","tanstackRedirect","useParams","jsx"],"mappings":";;;;;;;;;;;;AAWO,SAAS,mBAAA,CAAoB,aAAqB,MAAA,EAAiB;AAExE,EAAA,IAAI,CAAC,QAAA,CAAS,MAAM,CAAA,IAAK,CAAC,WAAA,CAAY,UAAA,CAAW,GAAG,CAAA,IAAK,WAAA,CAAY,UAAA,CAAW,IAAI,CAAA,EAAG;AACrF,IAAA,OAAO,WAAA;AAAA,EACT;AACA,EAAA,MAAM,YAAA,GAAe,WAAA,CAAY,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,CAAA,EAAG,KAAA,CAAM,MAAM,CAAA,CAAE,CAAC,CAAA;AAC/D,EAAA,IAAI,QAAA,CAAS,YAAY,CAAA,EAAG,OAAO,WAAA;AACnC,EAAA,OAAO,WAAA,KAAgB,MAAM,CAAA,CAAA,EAAI,MAAM,KAAK,CAAA,CAAA,EAAI,MAAM,GAAG,WAAW,CAAA,CAAA;AACtE;AAMO,IAAM,mBAAA,GAAsB,UAAA;AAAA,EACjC,CACE;AAAA,IACE,EAAA;AAAA,IACA,IAAA;AAAA,IACA,QAAA;AAAA,IACA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AAA;AAAA,oBACjCA,GAAAA,CAAC,YAAA,EAAA,EAAa,OAAA,EAAS,qBAAsB,QAAA,EAAS;AAAA,GAAA,EACxD,CAAA;AAEJ;AAGO,SAAS,0BAAA,CAA2B,EAAE,QAAA,EAAS,EAA4B;AAChF,EAAA,MAAM,WAAW,WAAA,EAAY;AAC7B,EAAA,uBACEA,GAAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACC,QAAA,EAAU,CAAC,EAAA,EAAY,IAAA,KAA2B,QAAA,CAAS,EAAE,EAAA,EAAI,OAAA,EAAS,IAAA,EAAM,OAAA,EAAS,CAAA;AAAA,MAEzF,QAAA,kBAAAA,GAAAA,CAAC,YAAA,EAAA,EAAa,OAAA,EAAS,qBAAsB,QAAA,EAAS;AAAA;AAAA,GACxD;AAEJ","file":"chunk-YXSKW2QR.js","sourcesContent":["import { forwardRef, createElement } from 'react';\nimport { Link as TanStackLink, useParams } from '@tanstack/react-router';\nimport { isLocale } from '../providers/locale-constants';\nimport type { BaseLinkProps } from '../components/common/Link.types';\n\n/**\n * Routes live under an optional `/{-$locale}` param, so a bare `to=\"/brands\"`\n * resolves with the locale omitted and the $locale loader bounces the user to\n * the fallback locale. Prefix the current locale onto internal paths that\n * don't already carry one.\n */\nexport function localizeDestination(destination: string, locale?: string) {\n // On the not-found page a first segment that is no language binds as the locale (`/p1-x`).\n if (!isLocale(locale) || !destination.startsWith('/') || destination.startsWith('//')) {\n return destination;\n }\n const firstSegment = destination.split('/')[1]?.split(/[?#]/)[0];\n if (isLocale(firstSegment)) return destination;\n return destination === '/' ? `/${locale}` : `/${locale}${destination}`;\n}\n\n/**\n * TanStack Router Link adapter.\n * Translates framework-agnostic props to TanStack Router Link props.\n */\nexport const TanStackLinkAdapter = forwardRef<HTMLAnchorElement, BaseLinkProps>(\n (\n {\n to,\n href,\n children,\n className,\n style,\n title,\n target,\n rel,\n onClick,\n preload,\n replace,\n 'aria-label': ariaLabel,\n ...rest\n },\n ref\n ) => {\n const { locale } = useParams({ strict: false }) as { locale?: string };\n const destination = localizeDestination(to ?? href ?? '/', locale);\n\n // `#` is how a block says it has nowhere to go, such as a banner with no URL. An anchor with\n // no href keeps the theme's `a` styles, and the router can neither preload nor follow it.\n if (destination === '#') {\n return createElement(\n 'a',\n { ref, className, style, title, onClick, 'aria-label': ariaLabel, ...rest },\n children\n );\n }\n\n return createElement(\n TanStackLink,\n {\n ref,\n to: destination,\n className,\n style,\n title,\n target,\n rel,\n onClick,\n preload: preload === 'intent' || preload === false ? preload : undefined,\n replace,\n 'aria-label': ariaLabel,\n ...(rest as Record<string, unknown>),\n },\n children\n );\n }\n);\n\nTanStackLinkAdapter.displayName = 'TanStackLinkAdapter';\n\n/**\n * Create a TanStack Router Link adapter component.\n */\nexport function createTanStackLinkAdapter() {\n return TanStackLinkAdapter;\n}\n","import { useEffect } from 'react';\nimport { useRouter } from '@tanstack/react-router';\nimport { resolveRelativePath } from '../providers/NavigationProvider';\nimport { useTwilight } from '../providers/twilight-context';\nimport { isLocale } from '../providers/locale-constants';\nimport { getTwilightContext } from '../twilight/context';\nimport { useIsNativeApp } from '../native-app';\nimport { onSallaEvent } from '../utils/sdk-helpers';\nimport { hasStoreUrlBase } from '../utils/store-base';\nimport { localizeDestination } from './link';\n\nconst UI_UPDATE_EVENT = 'mobile::ui.update';\nconst OPEN_ORDER_EVENT = 'mobile::open.order';\nconst NAVIGATE_TO_EVENT = 'mobile::navigate.to';\n\n/**\n * Events the native app sends into its webview. `NavigationSetup` mounts this once, so a\n * theme adds no listener of its own:\n *\n * - `mobile::ui.update` re-runs the route loaders and refetches what is on screen.\n * - `mobile::open.order` `{ id }` opens that order, with a fresh cart.\n * - `mobile::navigate.to` `{ url }` opens a notification deep link in-app. Only a link to\n * this store is followed (`deepLinkPath`), so `javascript:`, off-site and other stores'\n * URLs are dropped.\n *\n * Nothing is mounted outside the app (`useIsNativeApp()`), so a browser runs none of it.\n */\nexport function NativeAppEvents({ locale }: { locale?: string }) {\n return useIsNativeApp() ? <Listeners locale={locale} /> : null;\n}\n\nfunction Listeners({ locale }: { locale?: string }) {\n useNativeAppEvents(locale);\n return null;\n}\n\n/** The listeners themselves. `NativeAppEvents` mounts them inside the app only. */\nexport function useNativeAppEvents(locale?: string): void {\n const router = useRouter();\n const { store } = useTwilight();\n const storeUrl = store?.url;\n const username = store?.username;\n\n useEffect(() => {\n // `href`, not `to`: the router parses the query and the hash out of it.\n const open = (path: string) =>\n void router.navigate({ href: localizeDestination(path, locale) });\n\n const refresh = () => {\n void Promise.allSettled([\n router.invalidate(),\n getTwilightContext().queryClient?.refetchQueries({ type: 'active' }),\n ]);\n };\n const openOrder = (data?: unknown) => {\n const rawId = (data as { id?: unknown } | undefined)?.id;\n if (typeof rawId !== 'string' && typeof rawId !== 'number') return;\n\n const id = String(rawId).trim();\n if (!id) return;\n\n void getTwilightContext().queryClient?.invalidateQueries({ queryKey: ['cart'] });\n open(`/account/orders/${encodeURIComponent(id)}`);\n };\n const navigateTo = (data?: unknown) => {\n const url = (data as { url?: unknown } | undefined)?.url;\n if (typeof url !== 'string' || !url.trim() || !storeUrl) return;\n\n const path = deepLinkPath(url.trim(), storeUrl, username);\n if (path) void router.navigate({ href: inLocale(path, locale) });\n };\n\n const offs = [\n onSallaEvent(UI_UPDATE_EVENT, refresh),\n onSallaEvent(OPEN_ORDER_EVENT, openOrder),\n onSallaEvent(NAVIGATE_TO_EVENT, navigateTo),\n ];\n return () => offs.forEach((off) => off());\n }, [router, locale, storeUrl, username]);\n}\n\n/** A URL that names its host: `https://…` or `//…`. Anything else is a path of this app. */\nfunction isAbsoluteUrl(url: string): boolean {\n if (url.startsWith('//')) return true;\n try {\n // Without a base, only a URL with its own scheme parses.\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * The application path of a deep link to this store, or null for any other link.\n *\n * It passes the test a tapped link does (`resolveRelativePath`: the store's origin, the\n * username taken off), and one more. On a shared host that origin is every store's, so\n * an absolute link has to carry this store's username: without it, another store's\n * `/ar/offers` would open this store's offers.\n */\nfunction deepLinkPath(url: string, storeUrl: string, username?: string): string | null {\n const path = resolveRelativePath(url, storeUrl, username);\n if (!path || !isAbsoluteUrl(url)) return path;\n\n // Both parse: `resolveRelativePath` returns null when either does not.\n const { pathname } = new URL(url, window.location.href);\n return hasStoreUrlBase(pathname, new URL(storeUrl).pathname, username) ? path : null;\n}\n\n/**\n * A deep link in the locale the visitor is browsing in. A notification is written in one\n * language and opened in whichever is on screen, so the link's own locale gives way.\n *\n * The prefix is written here, not by `localizeDestination`: that one leaves a path alone\n * when it already starts with a locale, and would take the slug of `/ar/en/p456` for one.\n */\nfunction inLocale(path: string, locale?: string): string {\n const first = path.split('/')[1]?.split(/[?#]/)[0];\n const own = isLocale(first) ? path.slice(first.length + 1) : path;\n const rest = own.startsWith('/') ? own : `/${own}`;\n\n if (!locale) return rest;\n return rest === '/' ? `/${locale}` : `/${locale}${rest}`;\n}\n","/**\n * What the request itself is enough to describe: its host.\n *\n * Small, and deliberately its own module rather than a helper inside the\n * middleware. This value decides two things — which store a live storefront is,\n * and whether the request is allowed to name a store at all — so it is worth\n * testing directly instead of only through the wiring that calls it.\n */\nimport { isLoopback } from './cookies';\n\n/** The part of a `Request` this needs, so a test does not have to build a whole one. */\nexport interface HostSource {\n url: string;\n headers: { get(name: string): string | null };\n}\n\n/**\n * The host this request arrived on, with its port when it has one.\n *\n * Taken from the request URL, which in a Worker is the address the platform\n * actually routed on, and from the `Host` header only when that fails.\n *\n * **`X-Forwarded-Host` is deliberately not consulted.** A client can set it, and\n * this value gates `allowsRequestStoreId` — so honouring it would be a way to\n * talk a merchant's own domain into behaving like the preview host, and from\n * there into serving a stranger's shop. The dispatcher strips that header today;\n * a theme must not be one edit to another repository's allowlist away from a\n * spoofable identity.\n */\nexport function requestHostOf(request: HostSource): string | null {\n try {\n const fromUrl = new URL(request.url).host;\n if (fromUrl) return fromUrl;\n } catch {\n /* an unparseable URL falls through to the header */\n }\n\n return request.headers.get('Host')?.trim() || null;\n}\n\n/** The origin a browser reached this host on: `http` for a dev server, `https` otherwise. */\nexport function requestOriginOf(host: string): string {\n return `${isLoopback(host.replace(/:\\d+$/, '')) ? 'http' : 'https'}://${host}`;\n}\n","import {\n useNavigate,\n useParams,\n redirect as tanstackRedirect,\n notFound as tanstackNotFound,\n} from '@tanstack/react-router';\nimport {\n NavigationProvider,\n configureNavigation,\n type NavigateOptions,\n} from '../providers/NavigationProvider';\nimport { LinkProvider } from '../providers/LinkProvider';\nimport { TanStackLinkAdapter, localizeDestination } from './link';\nimport { NativeAppEvents } from './native-app-events';\nimport { useCallback, type ReactNode } from 'react';\nimport { UnauthorizedError, type RedirectOptions } from '../providers/NavigationProvider';\nimport { getRequestStore, getTwilightContext } from '../twilight/context';\nimport { resolveStoreBase, resolveStoreBaseFollowsLocale } from '../utils/store-identity';\nimport { loginRedirectHref } from '../utils/store-base';\nimport { requestOriginOf } from '../utils/request-host';\n\n/**\n * Where a document redirect (`reloadDocument`) may go: an http(s) URL, or a path on this host. A\n * protocol-relative `//host` or any other scheme is refused here, as an error the caller made:\n * the router throws on those too, and a page that cannot redirect safely must not try.\n */\nexport function documentRedirectHref(target: string): string {\n if (target.startsWith('/') && !target.startsWith('//')) return target;\n const url = new URL(target);\n if (url.protocol !== 'http:' && url.protocol !== 'https:') {\n throw new Error(`A document redirect needs an http(s) URL, not ${url.protocol}`);\n }\n return url.href;\n}\n\nfunction currentOrigin(): string | null {\n if (typeof window !== 'undefined') return window.location.origin;\n const host = getRequestStore().requestHost;\n return host ? requestOriginOf(host) : null;\n}\n\nconfigureNavigation({\n notFound: (message?: string) => {\n throw tanstackNotFound({ data: message });\n },\n redirect: (path: string, opts?: RedirectOptions) => {\n if (opts?.reloadDocument) {\n // `href`, not `to`: the router neither matches it nor adds the store base to it.\n const href = documentRedirectHref(path);\n throw tanstackRedirect({\n href,\n reloadDocument: true,\n replace: opts.replace,\n statusCode: opts.statusCode,\n });\n }\n throw tanstackRedirect({ to: path, replace: opts?.replace, statusCode: opts?.statusCode });\n },\n unauthorized: (message?: string) => {\n const origin = currentOrigin();\n const { pathname, searchStr } = getTwilightContext().location;\n const href =\n origin &&\n loginRedirectHref({\n pathname,\n searchStr,\n origin,\n base: resolveStoreBase(),\n baseFollowsLocale: resolveStoreBaseFollowsLocale(),\n });\n // A full load, because the SDK only reads `intended_to` when a page starts.\n if (href) throw tanstackRedirect({ href, reloadDocument: true, replace: true });\n throw new UnauthorizedError(message);\n },\n});\n\n/**\n * TanStack navigation setup - wraps children with NavigationProvider and LinkProvider.\n * Called by TwilightProvider when client.framework === 'tanstack'.\n */\nexport function NavigationSetup({ children }: { children: ReactNode }) {\n const navigate = useNavigate();\n const { locale } = useParams({ strict: false }) as { locale?: string };\n const navigateFn = useCallback(\n (to: string, opts?: NavigateOptions) =>\n navigate({ to: localizeDestination(to, locale), replace: opts?.replace }),\n [navigate, locale]\n );\n\n return (\n <NavigationProvider navigate={navigateFn}>\n <NativeAppEvents locale={locale} />\n <LinkProvider adapter={TanStackLinkAdapter}>{children}</LinkProvider>\n </NavigationProvider>\n );\n}\n\n/** @deprecated Use NavigationSetup instead */\nexport function TanStackNavigationProvider({ children }: { children: ReactNode }) {\n const navigate = useNavigate();\n return (\n <NavigationProvider\n navigate={(to: string, opts?: NavigateOptions) => navigate({ to, replace: opts?.replace })}\n >\n <LinkProvider adapter={TanStackLinkAdapter}>{children}</LinkProvider>\n </NavigationProvider>\n );\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { registry } from './chunk-Y32RHCOH.js';
|
|
2
|
-
import { useMoney, useNumber } from './chunk-
|
|
2
|
+
import { useMoney, useNumber } from './chunk-6DTT6DFS.js';
|
|
3
3
|
import { useAsset } from './chunk-Z653O7MX.js';
|
|
4
4
|
import { useWishlist } from './chunk-DVJGKIFQ.js';
|
|
5
5
|
import { useTranslation } from './chunk-TYNZ5B2B.js';
|
|
@@ -230,5 +230,5 @@ var ProductCard = memo(function ProductCard2(props) {
|
|
|
230
230
|
});
|
|
231
231
|
|
|
232
232
|
export { ProductCard };
|
|
233
|
-
//# sourceMappingURL=chunk-
|
|
234
|
-
//# sourceMappingURL=chunk-
|
|
233
|
+
//# sourceMappingURL=chunk-Z7SE66QV.js.map
|
|
234
|
+
//# sourceMappingURL=chunk-Z7SE66QV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/product/ProductCard.tsx"],"names":["ProductCardContent","ProductCard"],"mappings":";;;;;;;;;;;;;AAcA,IAAM,gBAAA,GAAmB,cAAA;AAEzB,IAAM,2BAAA,GAA8B,CAAC,GAAA,EAAK,GAAA,EAAK,KAAK,GAAG,CAAA;AAEvD,IAAM,mBAAA,GAAsB,+BAAA;AAE5B,IAAM,wBAAA,GAA2B,iCAAA;AAoCjC,IAAM,kBAAA,GAAqB,IAAA,CAAK,SAASA,mBAAAA,CAAmB;AAAA,EAC1D,OAAA;AAAA,EACA,MAAA,GAAS,UAAA;AAAA,EACT,SAAA,GAAY,EAAA;AAAA,EACZ,UAAA,GAAa,KAAA;AAAA,EACb,YAAA,GAAe,KAAA;AAAA,EACf,gBAAA,GAAmB,KAAA;AAAA,EACnB,KAAA,GAAQ,CAAA;AAAA,EACR,aAAA,GAAgB,KAAA;AAAA,EAChB;AACF,CAAA,EAAqB;AACnB,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,QAAA,EAAS;AAC5B,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,cAAA,EAAe;AAC7B,EAAA,MAAM,EAAE,KAAA,EAAO,KAAA,EAAO,QAAA,KAAa,WAAA,EAAY;AAC/C,EAAA,MAAM,WAAW,WAAA,EAAY;AAC7B,EAAA,MAAM,EAAE,aAAA,EAAc,GAAI,QAAA,EAAS;AACnC,EAAA,MAAM,EAAE,MAAA,EAAQ,YAAA,EAAa,GAAI,SAAA,EAAU;AAI3C,EAAA,MAAM,YAAA,GAAe,KAAA,EAAO,QAAA,EAAU,6BAAA,KAAkC,KAA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AAA,EACT,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,IAAI,SAAA,EAAW;AACb,IAAA,uBAAO,GAAA,CAAC,SAAA,EAAA,EAAW,GAAG,KAAA,EAAO,CAAA;AAAA,EAC/B;AAEA,EAAA,uBAAO,GAAA,CAAC,kBAAA,EAAA,EAAoB,GAAG,KAAA,EAAO,CAAA;AACxC,CAAC","file":"chunk-SFZBBDO5.js","sourcesContent":["import { memo, useCallback, useMemo } from 'react';\nimport { SallaAddProductButton } from '@salla.sa/twilight-components-react/add-product-button';\nimport { SallaButton } from '@salla.sa/twilight-components-react/button';\nimport { useHostAttributes } from '@salla.sa/twilight-theme-engine/hooks/useHostAttributes';\nimport { useMoney } from '../../hooks/useMoney';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport { useTwilight } from '../../providers/TwilightProvider';\nimport { useWishlist } from '../../hooks/useWishlist';\nimport { useAsset } from '../../hooks/useAsset';\nimport { useNumber } from '../../hooks/useNumber';\nimport { registry } from '../ComponentRegistry';\nimport { Image } from '../common';\nimport type { Product } from '../../types';\n\nconst PRODUCT_CARD_KEY = 'product:card';\n\nconst PRODUCT_IMAGE_SRCSET_WIDTHS = [150, 300, 450, 600] as const;\n/** Matches `.s-products-list-vertical-cards`: 2-col below 768px, 4-col above. */\nconst PRODUCT_IMAGE_SIZES = '(min-width: 768px) 25vw, 50vw';\n/** fullImage / minimal slots in FeaturedProductsStyle3 (`lg:grid-cols-2`). */\nconst PRODUCT_WIDE_IMAGE_SIZES = '(min-width: 1024px) 50vw, 100vw';\n\n/** Product card layout variants - mutually exclusive */\nexport type ProductCardLayout = 'vertical' | 'horizontal' | 'fullImage' | 'minimal' | 'special';\n\nexport interface ProductCardProps {\n product: Product;\n layout?: ProductCardLayout;\n className?: string;\n withShadow?: boolean;\n withQuantity?: boolean;\n withoutAddButton?: boolean;\n index?: number;\n imagePriority?: boolean;\n /** Overrides the layout-based image `sizes` hint. */\n sizes?: string;\n}\n\n/**\n * ProductCard - Displays a product in various layouts\n *\n * Layouts:\n * - vertical: Default card with image top, content bottom\n * - horizontal: Side-by-side image and content\n * - fullImage: Full bleed image with overlay content\n * - minimal: Compact version with reduced info\n * - special: Featured card with quantity pie chart\n *\n * Features:\n * - Native lazy loading for images\n * - Product badges (promotion, preorder, quantity, out of stock)\n * - Wishlist toggle button\n * - Price display (sale, starting, regular)\n * - Rating display\n * - Add to cart button via SallaAddProductButton (handles labels internally)\n */\nconst ProductCardContent = memo(function ProductCardContent({\n product,\n layout = 'vertical',\n className = '',\n withShadow = false,\n withQuantity = false,\n withoutAddButton = false,\n index = 0,\n imagePriority = false,\n sizes,\n}: ProductCardProps) {\n const { format } = useMoney();\n const { t } = useTranslation();\n const { store, theme, currency } = useTwilight();\n const wishlist = useWishlist();\n const { isPlaceholder } = useAsset();\n const { format: formatNumber } = useNumber();\n\n // Out-of-stock cards offer \"notify me when available\" instead of a dead button, unless\n // the merchant switched `notify_when_available_in_card` off (Twig theme-raed parity).\n const notifyInCard = theme?.settings?.notify_when_available_in_card !== false;\n const addButtonStatus =\n notifyInCard &&\n product.is_out_of_stock &&\n product.type !== 'donating' &&\n product.type !== 'financial_support'\n ? 'out-and-notify'\n : product.status;\n\n const addButtonRef = useHostAttributes({ fill: 'outline', width: 'wide' });\n\n // Layout flags\n const isVertical = layout === 'vertical';\n const isHorizontal = layout === 'horizontal';\n const isFullImage = layout === 'fullImage';\n const isMinimal = layout === 'minimal';\n const isSpecial = layout === 'special';\n\n // Wishlist status\n const productInWishlist = wishlist.has(Number(product.id));\n const handleWishlistToggle = useCallback(() => {\n wishlist.toggle(Number(product.id));\n }, [wishlist, product.id]);\n\n // Get image fit type from store settings\n const fitImageHeight = store?.settings?.product?.fit_type;\n\n // Product badge component\n const getProductBadge = () => {\n if (product?.preorder?.label && typeof product.preorder.label === 'string') {\n return <div className=\"s-product-card-promotion-title\">{product.preorder.label}</div>;\n }\n if (product.promotion_title) {\n return <div className=\"s-product-card-promotion-title\">{product.promotion_title}</div>;\n }\n if (withQuantity && product?.quantity) {\n const formattedQty = formatNumber(product.quantity);\n return (\n <div className=\"s-product-card-quantity\">\n {t('pages.products.remained', 'Remained')} {formattedQty}\n </div>\n );\n }\n if (withQuantity && product?.is_out_of_stock) {\n return (\n <div className=\"s-product-card-out-badge\">\n {t('pages.products.out_of_stock', 'Out of Stock')}\n </div>\n );\n }\n return null;\n };\n\n // List responses can convert prices to the visitor's currency while retaining the source currency.\n const priceOptions = { currency: currency?.code ?? product.currency };\n const getProductPrice = () => {\n if (product.is_on_sale && product.sale_price) {\n return (\n <div className=\"s-product-card-sale-price\">\n <h4>{format(product.sale_price, priceOptions)}</h4>\n {product.regular_price && <span>{format(product.regular_price, priceOptions)}</span>}\n </div>\n );\n }\n if (product.starting_price) {\n return (\n <div className=\"s-product-card-starting-price\">\n <p>{t('pages.products.starting_price', 'Starting from')}</p>\n <h4>{format(product.starting_price, priceOptions)}</h4>\n </div>\n );\n }\n return <h4 className=\"s-product-card-price\">{format(product.price, priceOptions)}</h4>;\n };\n\n // Build card class names\n const cardClassName = [\n 's-product-card',\n 's-product-card-entry',\n isVertical ? 's-product-card-vertical' : '',\n isHorizontal ? 's-product-card-horizontal' : '',\n // As Twig's card: the store's unified image height sizes horizontal cards too.\n fitImageHeight && (isVertical || isHorizontal) ? `s-product-card-fit-height` : '',\n isSpecial ? 's-product-card-special' : '',\n isFullImage ? 's-product-card-full-image' : '',\n isMinimal ? 's-product-card-minimal' : '',\n product?.donation ? 's-product-card-donation' : '',\n withShadow ? 's-product-card-shadow' : '',\n product?.is_out_of_stock ? 's-product-card-out-of-stock' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n // Image fit class\n const isProductPlaceholder = isPlaceholder(product.image?.url);\n const imageFitClass = isProductPlaceholder ? 'contain' : fitImageHeight || 'cover';\n\n return (\n <div\n id={`product-card-${product.id}`}\n className={cardClassName}\n data-product-id={product.id}\n style={{\n animationDelay: `${index * 100}ms`,\n }}\n >\n <div className={isFullImage ? 's-product-card-image-full' : 's-product-card-image'}>\n <a href={product.url} aria-label={product.image?.alt || product.name}>\n <Image\n className={`s-product-card-image-${imageFitClass}`}\n src={product.image?.url}\n alt={product.image?.alt ?? product.name}\n width={300}\n height={300}\n sizes={\n sizes ?? (isFullImage || isMinimal ? PRODUCT_WIDE_IMAGE_SIZES : PRODUCT_IMAGE_SIZES)\n }\n srcSetWidths={PRODUCT_IMAGE_SRCSET_WIDTHS}\n aspectRatio=\"1/1\"\n priority={imagePriority}\n />\n {!isFullImage && !isMinimal && getProductBadge()}\n </a>\n {isFullImage && (\n <a href={product.url} aria-label={product.name} className=\"s-product-card-overlay\" />\n )}\n {!isHorizontal && !isFullImage && (\n <SallaButton\n shape=\"icon\"\n fill=\"outline\"\n color=\"light\"\n ariaLabel={t('pages.wishlist.toggle', 'Add or remove to wishlist')}\n className={`s-product-card-wishlist-btn animated ${productInWishlist ? 's-product-card-wishlist-added pulse-anime' : 'not-added un-favorited'}`}\n onClick={handleWishlistToggle}\n data-id={product.id}\n >\n <i className=\"sicon-heart\" />\n </SallaButton>\n )}\n </div>\n <div className=\"s-product-card-content\">\n {/* Special card: quantity pie */}\n {isSpecial && product?.quantity && (\n <div className=\"s-product-card-content-pie\">\n <span>\n <b>{formatNumber(product.quantity)}</b>\n {t('pages.products.remained', 'Remained')}\n </span>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"-2 -1 36 34\"\n className=\"s-product-card-content-pie-svg\"\n >\n <circle cx=\"16\" cy=\"16\" r=\"15.9155\" className=\"s-product-card-content-pie-svg-base\" />\n <circle cx=\"16\" cy=\"16\" r=\"15.9155\" className=\"s-product-card-content-pie-svg-bar\" />\n </svg>\n </div>\n )}\n\n <div\n className={`s-product-card-content-main ${isSpecial ? 's-product-card-content-extra-padding' : ''}`}\n >\n <h3 className=\"s-product-card-content-title\">\n <a href={product.url}>{product.name}</a>\n </h3>\n {product.subtitle && !isMinimal && (\n <p className=\"s-product-card-content-subtitle opacity-80\">{product.subtitle}</p>\n )}\n </div>\n\n <div\n className={`s-product-card-content-sub ${isSpecial ? 's-product-card-content-extra-padding' : ''}`}\n >\n {!product?.donation?.can_donate && getProductPrice()}\n {product.rating?.stars && (\n <div className=\"s-product-card-rating\">\n <i className=\"sicon-star2 text-orange-300\" />\n <span>{product.rating.stars}</span>\n </div>\n )}\n </div>\n\n {!withoutAddButton && (\n <div className=\"s-product-card-content-footer gap-2\">\n <SallaAddProductButton\n ref={addButtonRef}\n fill=\"outline\"\n width=\"wide\"\n productId={product.id}\n productStatus={addButtonStatus}\n productType={product.type}\n hasPreOrder={product.has_preorder_campaign}\n />\n {(isHorizontal || isFullImage) && (\n <SallaButton\n shape=\"icon\"\n fill=\"outline\"\n color=\"light\"\n ariaLabel={t('pages.wishlist.toggle', 'Add or remove to wishlist')}\n className={`s-product-card-wishlist-btn animated ${productInWishlist ? 's-product-card-wishlist-added pulse-anime' : 'not-added un-favorited'}`}\n onClick={handleWishlistToggle}\n data-id={product.id}\n >\n <i className=\"sicon-heart\" />\n </SallaButton>\n )}\n </div>\n )}\n </div>\n </div>\n );\n});\n\nexport const ProductCard = memo(function ProductCard(props: ProductCardProps) {\n const Component = useMemo(() => {\n const hasOverride = registry.getOriginal<ProductCardProps>(PRODUCT_CARD_KEY) !== null;\n if (hasOverride) {\n return registry.resolve<ProductCardProps>(PRODUCT_CARD_KEY);\n }\n return null;\n }, []);\n\n if (Component) {\n return <Component {...props} />;\n }\n\n return <ProductCardContent {...props} />;\n});\n\nexport default ProductCard;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/product/ProductCard.tsx"],"names":["ProductCardContent","ProductCard"],"mappings":";;;;;;;;;;;;;AAcA,IAAM,gBAAA,GAAmB,cAAA;AAEzB,IAAM,2BAAA,GAA8B,CAAC,GAAA,EAAK,GAAA,EAAK,KAAK,GAAG,CAAA;AAEvD,IAAM,mBAAA,GAAsB,+BAAA;AAE5B,IAAM,wBAAA,GAA2B,iCAAA;AAoCjC,IAAM,kBA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AAA,gBACN,SAAA,EAAW,CAAA,CAAE,uBAAA,EAAyB,2BAA2B,CAAA;AAAA,gBACjE,SAAA,EAAW,CAAA,qCAAA,EAAwC,iBAAA,GAAoB,2CAAA,GAA8C,wBAAwB,CAAA,CAAA;AAAA,gBAC7I,OAAA,EAAS,oBAAA;AAAA,gBACT,WAAS,OAAA,CAAQ,EAAA;AAAA,gBAEjB,QAAA,kBAAA,GAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,aAAA,EAAc;AAAA;AAAA;AAC7B,WAAA,EAEJ;AAAA,SAAA,EAEJ;AAAA;AAAA;AAAA,GACF;AAEJ,CAAC,CAAA;AAEM,IAAM,WAAA,GAAc,IAAA,CAAK,SAASC,YAAAA,CAAY,KAAA,EAAyB;AAC5E,EAAA,MAAM,SAAA,GAAY,QAAQ,MAAM;AAC9B,IAAA,MAAM,WAAA,GAAc,QAAA,CAAS,WAAA,CAA8B,gBAAgB,CAAA,KAAM,IAAA;AACjF,IAAA,IAAI,WAAA,EAAa;AACf,MAAA,OAAO,QAAA,CAAS,QAA0B,gBAAgB,CAAA;AAAA,IAC5D;AACA,IAAA,OAAO,IAAA;AAAA,EACT,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,IAAI,SAAA,EAAW;AACb,IAAA,uBAAO,GAAA,CAAC,SAAA,EAAA,EAAW,GAAG,KAAA,EAAO,CAAA;AAAA,EAC/B;AAEA,EAAA,uBAAO,GAAA,CAAC,kBAAA,EAAA,EAAoB,GAAG,KAAA,EAAO,CAAA;AACxC,CAAC","file":"chunk-Z7SE66QV.js","sourcesContent":["import { memo, useCallback, useMemo } from 'react';\nimport { SallaAddProductButton } from '@salla.sa/twilight-components-react/add-product-button';\nimport { SallaButton } from '@salla.sa/twilight-components-react/button';\nimport { useHostAttributes } from '@salla.sa/twilight-theme-engine/hooks/useHostAttributes';\nimport { useMoney } from '../../hooks/useMoney';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport { useTwilight } from '../../providers/TwilightProvider';\nimport { useWishlist } from '../../hooks/useWishlist';\nimport { useAsset } from '../../hooks/useAsset';\nimport { useNumber } from '../../hooks/useNumber';\nimport { registry } from '../ComponentRegistry';\nimport { Image } from '../common';\nimport type { Product } from '../../types';\n\nconst PRODUCT_CARD_KEY = 'product:card';\n\nconst PRODUCT_IMAGE_SRCSET_WIDTHS = [150, 300, 450, 600] as const;\n/** Matches `.s-products-list-vertical-cards`: 2-col below 768px, 4-col above. */\nconst PRODUCT_IMAGE_SIZES = '(min-width: 768px) 25vw, 50vw';\n/** fullImage / minimal slots in FeaturedProductsStyle3 (`lg:grid-cols-2`). */\nconst PRODUCT_WIDE_IMAGE_SIZES = '(min-width: 1024px) 50vw, 100vw';\n\n/** Product card layout variants - mutually exclusive */\nexport type ProductCardLayout = 'vertical' | 'horizontal' | 'fullImage' | 'minimal' | 'special';\n\nexport interface ProductCardProps {\n product: Product;\n layout?: ProductCardLayout;\n className?: string;\n withShadow?: boolean;\n withQuantity?: boolean;\n withoutAddButton?: boolean;\n index?: number;\n imagePriority?: boolean;\n /** Overrides the layout-based image `sizes` hint. */\n sizes?: string;\n}\n\n/**\n * ProductCard - Displays a product in various layouts\n *\n * Layouts:\n * - vertical: Default card with image top, content bottom\n * - horizontal: Side-by-side image and content\n * - fullImage: Full bleed image with overlay content\n * - minimal: Compact version with reduced info\n * - special: Featured card with quantity pie chart\n *\n * Features:\n * - Native lazy loading for images\n * - Product badges (promotion, preorder, quantity, out of stock)\n * - Wishlist toggle button\n * - Price display (sale, starting, regular)\n * - Rating display\n * - Add to cart button via SallaAddProductButton (handles labels internally)\n */\nconst ProductCardContent = memo(function ProductCardContent({\n product,\n layout = 'vertical',\n className = '',\n withShadow = false,\n withQuantity = false,\n withoutAddButton = false,\n index = 0,\n imagePriority = false,\n sizes,\n}: ProductCardProps) {\n const { format } = useMoney();\n const { t } = useTranslation();\n const { store, theme, currency } = useTwilight();\n const wishlist = useWishlist();\n const { isPlaceholder } = useAsset();\n const { format: formatNumber } = useNumber();\n\n // Out-of-stock cards offer \"notify me when available\" instead of a dead button, unless\n // the merchant switched `notify_when_available_in_card` off (Twig theme-raed parity).\n const notifyInCard = theme?.settings?.notify_when_available_in_card !== false;\n const addButtonStatus =\n notifyInCard &&\n product.is_out_of_stock &&\n product.type !== 'donating' &&\n product.type !== 'financial_support'\n ? 'out-and-notify'\n : product.status;\n\n const addButtonRef = useHostAttributes({ fill: 'outline', width: 'wide' });\n\n // Layout flags\n const isVertical = layout === 'vertical';\n const isHorizontal = layout === 'horizontal';\n const isFullImage = layout === 'fullImage';\n const isMinimal = layout === 'minimal';\n const isSpecial = layout === 'special';\n\n // Wishlist status\n const productInWishlist = wishlist.has(Number(product.id));\n const handleWishlistToggle = useCallback(() => {\n wishlist.toggle(Number(product.id));\n }, [wishlist, product.id]);\n\n // Get image fit type from store settings\n const fitImageHeight = store?.settings?.product?.fit_type;\n\n // Product badge component\n const getProductBadge = () => {\n if (product?.preorder?.label && typeof product.preorder.label === 'string') {\n return <div className=\"s-product-card-promotion-title\">{product.preorder.label}</div>;\n }\n if (product.promotion_title) {\n return <div className=\"s-product-card-promotion-title\">{product.promotion_title}</div>;\n }\n if (withQuantity && product?.quantity) {\n const formattedQty = formatNumber(product.quantity);\n return (\n <div className=\"s-product-card-quantity\">\n {t('pages.products.remained', 'Remained')} {formattedQty}\n </div>\n );\n }\n if (withQuantity && product?.is_out_of_stock) {\n return (\n <div className=\"s-product-card-out-badge\">\n {t('pages.products.out_of_stock', 'Out of Stock')}\n </div>\n );\n }\n return null;\n };\n\n // List responses can convert prices to the visitor's currency while retaining the source currency.\n const priceOptions = { currency: currency?.code ?? product.currency };\n const getProductPrice = () => {\n if (product.is_on_sale && product.sale_price) {\n return (\n <div className=\"s-product-card-sale-price\">\n <h4>{format(product.sale_price, priceOptions)}</h4>\n {product.regular_price && <span>{format(product.regular_price, priceOptions)}</span>}\n </div>\n );\n }\n if (product.starting_price) {\n return (\n <div className=\"s-product-card-starting-price\">\n <p>{t('pages.products.starting_price', 'Starting from')}</p>\n <h4>{format(product.starting_price, priceOptions)}</h4>\n </div>\n );\n }\n return <h4 className=\"s-product-card-price\">{format(product.price, priceOptions)}</h4>;\n };\n\n // Build card class names\n const cardClassName = [\n 's-product-card',\n 's-product-card-entry',\n isVertical ? 's-product-card-vertical' : '',\n isHorizontal ? 's-product-card-horizontal' : '',\n // As Twig's card: the store's unified image height sizes horizontal cards too.\n fitImageHeight && (isVertical || isHorizontal) ? `s-product-card-fit-height` : '',\n isSpecial ? 's-product-card-special' : '',\n isFullImage ? 's-product-card-full-image' : '',\n isMinimal ? 's-product-card-minimal' : '',\n product?.donation ? 's-product-card-donation' : '',\n withShadow ? 's-product-card-shadow' : '',\n product?.is_out_of_stock ? 's-product-card-out-of-stock' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n // Image fit class\n const isProductPlaceholder = isPlaceholder(product.image?.url);\n const imageFitClass = isProductPlaceholder ? 'contain' : fitImageHeight || 'cover';\n\n return (\n <div\n id={`product-card-${product.id}`}\n className={cardClassName}\n data-product-id={product.id}\n style={{\n animationDelay: `${index * 100}ms`,\n }}\n >\n <div className={isFullImage ? 's-product-card-image-full' : 's-product-card-image'}>\n <a href={product.url} aria-label={product.image?.alt || product.name}>\n <Image\n className={`s-product-card-image-${imageFitClass}`}\n src={product.image?.url}\n alt={product.image?.alt ?? product.name}\n width={300}\n height={300}\n sizes={\n sizes ?? (isFullImage || isMinimal ? PRODUCT_WIDE_IMAGE_SIZES : PRODUCT_IMAGE_SIZES)\n }\n srcSetWidths={PRODUCT_IMAGE_SRCSET_WIDTHS}\n aspectRatio=\"1/1\"\n priority={imagePriority}\n />\n {!isFullImage && !isMinimal && getProductBadge()}\n </a>\n {isFullImage && (\n <a href={product.url} aria-label={product.name} className=\"s-product-card-overlay\" />\n )}\n {!isHorizontal && !isFullImage && (\n <SallaButton\n shape=\"icon\"\n fill=\"outline\"\n color=\"light\"\n ariaLabel={t('pages.wishlist.toggle', 'Add or remove to wishlist')}\n className={`s-product-card-wishlist-btn animated ${productInWishlist ? 's-product-card-wishlist-added pulse-anime' : 'not-added un-favorited'}`}\n onClick={handleWishlistToggle}\n data-id={product.id}\n >\n <i className=\"sicon-heart\" />\n </SallaButton>\n )}\n </div>\n <div className=\"s-product-card-content\">\n {/* Special card: quantity pie */}\n {isSpecial && product?.quantity && (\n <div className=\"s-product-card-content-pie\">\n <span>\n <b>{formatNumber(product.quantity)}</b>\n {t('pages.products.remained', 'Remained')}\n </span>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"-2 -1 36 34\"\n className=\"s-product-card-content-pie-svg\"\n >\n <circle cx=\"16\" cy=\"16\" r=\"15.9155\" className=\"s-product-card-content-pie-svg-base\" />\n <circle cx=\"16\" cy=\"16\" r=\"15.9155\" className=\"s-product-card-content-pie-svg-bar\" />\n </svg>\n </div>\n )}\n\n <div\n className={`s-product-card-content-main ${isSpecial ? 's-product-card-content-extra-padding' : ''}`}\n >\n <h3 className=\"s-product-card-content-title\">\n <a href={product.url}>{product.name}</a>\n </h3>\n {product.subtitle && !isMinimal && (\n <p className=\"s-product-card-content-subtitle opacity-80\">{product.subtitle}</p>\n )}\n </div>\n\n <div\n className={`s-product-card-content-sub ${isSpecial ? 's-product-card-content-extra-padding' : ''}`}\n >\n {!product?.donation?.can_donate && getProductPrice()}\n {product.rating?.stars && (\n <div className=\"s-product-card-rating\">\n <i className=\"sicon-star2 text-orange-300\" />\n <span>{product.rating.stars}</span>\n </div>\n )}\n </div>\n\n {!withoutAddButton && (\n <div className=\"s-product-card-content-footer gap-2\">\n <SallaAddProductButton\n ref={addButtonRef}\n fill=\"outline\"\n width=\"wide\"\n productId={product.id}\n productStatus={addButtonStatus}\n productType={product.type}\n hasPreOrder={product.has_preorder_campaign}\n />\n {(isHorizontal || isFullImage) && (\n <SallaButton\n shape=\"icon\"\n fill=\"outline\"\n color=\"light\"\n ariaLabel={t('pages.wishlist.toggle', 'Add or remove to wishlist')}\n className={`s-product-card-wishlist-btn animated ${productInWishlist ? 's-product-card-wishlist-added pulse-anime' : 'not-added un-favorited'}`}\n onClick={handleWishlistToggle}\n data-id={product.id}\n >\n <i className=\"sicon-heart\" />\n </SallaButton>\n )}\n </div>\n )}\n </div>\n </div>\n );\n});\n\nexport const ProductCard = memo(function ProductCard(props: ProductCardProps) {\n const Component = useMemo(() => {\n const hasOverride = registry.getOriginal<ProductCardProps>(PRODUCT_CARD_KEY) !== null;\n if (hasOverride) {\n return registry.resolve<ProductCardProps>(PRODUCT_CARD_KEY);\n }\n return null;\n }, []);\n\n if (Component) {\n return <Component {...props} />;\n }\n\n return <ProductCardContent {...props} />;\n});\n\nexport default ProductCard;\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-P3OYCAO3.js';
|
|
2
2
|
import '../../chunk-TLHZBTPZ.js';
|
|
3
3
|
import '../../chunk-T43GL7UN.js';
|
|
4
4
|
import '../../chunk-DGUM43GV.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { BlogSkeleton, BreadcrumbSkeleton, CustomerLayoutSkeleton, CustomerPageSkeleton, DeferredData, Image, PageSkeleton, ProductCardSkeleton, ProductDetailSkeleton, ProductGridSkeleton, SkeletonPulse, resolveDeferred } from '../../chunk-IVO6YRRK.js';
|
|
2
2
|
export { Link } from '../../chunk-3GFD7WTJ.js';
|
|
3
|
-
export { LazyBreadcrumb as Breadcrumb, LazyCurrencySymbol as CurrencySymbol, LazyErrorPage as ErrorPage, LazyNoContent as NoContent, LazyRenderWhenVisible as RenderWhenVisible } from '../../chunk-
|
|
3
|
+
export { LazyBreadcrumb as Breadcrumb, LazyCurrencySymbol as CurrencySymbol, LazyErrorPage as ErrorPage, LazyNoContent as NoContent, LazyRenderWhenVisible as RenderWhenVisible } from '../../chunk-OVYHHD2Q.js';
|
|
4
4
|
import '../../chunk-EDCNCBSC.js';
|
|
5
5
|
import '../../chunk-SKLEJJ6M.js';
|
|
6
6
|
import '../../chunk-TLHZBTPZ.js';
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
export { Drawer } from '../../chunk-OLN2QRGA.js';
|
|
2
|
-
import '../../chunk-
|
|
2
|
+
import '../../chunk-6DTT6DFS.js';
|
|
3
3
|
import '../../chunk-K4HCMVAQ.js';
|
|
4
|
-
import '../../chunk-
|
|
4
|
+
import '../../chunk-UBU4OIGW.js';
|
|
5
5
|
import '../../chunk-TJK4DVQM.js';
|
|
6
6
|
import '../../chunk-Q77J3D2W.js';
|
|
7
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-6QEKTZWT.js';
|
|
8
8
|
import '../../chunk-K4QQRA6L.js';
|
|
9
|
-
import '../../chunk-
|
|
9
|
+
import '../../chunk-5ZARPSEZ.js';
|
|
10
10
|
import '../../chunk-OXMUPNMH.js';
|
|
11
|
-
import '../../chunk-
|
|
11
|
+
import '../../chunk-MUJEGFLE.js';
|
|
12
12
|
import '../../chunk-ZF2YZB7F.js';
|
|
13
13
|
import '../../chunk-UAPBMOOV.js';
|
|
14
14
|
import '../../chunk-VVZNW5CB.js';
|
|
15
15
|
import '../../chunk-QJOTD2GJ.js';
|
|
16
16
|
import '../../chunk-GD26FI4J.js';
|
|
17
|
-
import '../../chunk-
|
|
18
|
-
import '../../chunk-
|
|
17
|
+
import '../../chunk-GTNCHLXK.js';
|
|
18
|
+
import '../../chunk-V6ZHJMFD.js';
|
|
19
19
|
import '../../chunk-EUHIN5FN.js';
|
|
20
20
|
import '../../chunk-6T55LXJL.js';
|
|
21
|
-
import '../../chunk-
|
|
21
|
+
import '../../chunk-FY36SODO.js';
|
|
22
22
|
import '../../chunk-O7JTXTGP.js';
|
|
23
23
|
import '../../chunk-SDBR4X3K.js';
|
|
24
|
-
import '../../chunk-
|
|
24
|
+
import '../../chunk-I6FORV4B.js';
|
|
25
25
|
import '../../chunk-OUW6WESU.js';
|
|
26
26
|
import '../../chunk-OAMIDZKW.js';
|
|
27
27
|
import '../../chunk-UY4VIWNH.js';
|
|
28
28
|
import '../../chunk-HI5V5X3S.js';
|
|
29
|
-
import '../../chunk-
|
|
30
|
-
import '../../chunk-
|
|
29
|
+
import '../../chunk-YUTDUIB5.js';
|
|
30
|
+
import '../../chunk-NSCZTGJU.js';
|
|
31
31
|
import '../../chunk-Z653O7MX.js';
|
|
32
32
|
import '../../chunk-ZCH7W7DZ.js';
|
|
33
33
|
import '../../chunk-R3FQW5X3.js';
|
|
@@ -37,17 +37,17 @@ import '../../chunk-7V36I5GT.js';
|
|
|
37
37
|
import '../../chunk-6WI7R2BD.js';
|
|
38
38
|
import '../../chunk-DVJGKIFQ.js';
|
|
39
39
|
import '../../chunk-CBP4AT5U.js';
|
|
40
|
-
import '../../chunk-
|
|
40
|
+
import '../../chunk-TZ3DCT3S.js';
|
|
41
41
|
import '../../chunk-FWNSNBLY.js';
|
|
42
|
-
import '../../chunk-
|
|
42
|
+
import '../../chunk-6O2TYPUP.js';
|
|
43
43
|
import '../../chunk-XZFWBF3P.js';
|
|
44
44
|
import '../../chunk-GCPEMNSU.js';
|
|
45
|
-
import '../../chunk-
|
|
45
|
+
import '../../chunk-7IL5RSR5.js';
|
|
46
46
|
import '../../chunk-Z5M4YYWT.js';
|
|
47
47
|
import '../../chunk-TYNZ5B2B.js';
|
|
48
48
|
import '../../chunk-IVO6YRRK.js';
|
|
49
49
|
import '../../chunk-3GFD7WTJ.js';
|
|
50
|
-
import '../../chunk-
|
|
50
|
+
import '../../chunk-OVYHHD2Q.js';
|
|
51
51
|
import '../../chunk-EDCNCBSC.js';
|
|
52
52
|
import '../../chunk-SKLEJJ6M.js';
|
|
53
53
|
import '../../chunk-6BZ5TKEV.js';
|
|
@@ -1,38 +1,38 @@
|
|
|
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-3FGCLNM6.js';
|
|
2
|
+
import '../../chunk-5DRX6ZKG.js';
|
|
3
|
+
import '../../chunk-KYOGYOMA.js';
|
|
4
|
+
import '../../chunk-WFTPOJUF.js';
|
|
5
|
+
import '../../chunk-Z7SE66QV.js';
|
|
6
6
|
import '../../chunk-Y32RHCOH.js';
|
|
7
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-6DTT6DFS.js';
|
|
8
8
|
import '../../chunk-K4HCMVAQ.js';
|
|
9
|
-
import '../../chunk-
|
|
9
|
+
import '../../chunk-UBU4OIGW.js';
|
|
10
10
|
import '../../chunk-TJK4DVQM.js';
|
|
11
11
|
import '../../chunk-Q77J3D2W.js';
|
|
12
|
-
import '../../chunk-
|
|
12
|
+
import '../../chunk-6QEKTZWT.js';
|
|
13
13
|
import '../../chunk-K4QQRA6L.js';
|
|
14
|
-
import '../../chunk-
|
|
14
|
+
import '../../chunk-5ZARPSEZ.js';
|
|
15
15
|
import '../../chunk-OXMUPNMH.js';
|
|
16
|
-
import '../../chunk-
|
|
16
|
+
import '../../chunk-MUJEGFLE.js';
|
|
17
17
|
import '../../chunk-ZF2YZB7F.js';
|
|
18
18
|
import '../../chunk-UAPBMOOV.js';
|
|
19
19
|
import '../../chunk-VVZNW5CB.js';
|
|
20
20
|
import '../../chunk-QJOTD2GJ.js';
|
|
21
21
|
import '../../chunk-GD26FI4J.js';
|
|
22
|
-
import '../../chunk-
|
|
23
|
-
import '../../chunk-
|
|
22
|
+
import '../../chunk-GTNCHLXK.js';
|
|
23
|
+
import '../../chunk-V6ZHJMFD.js';
|
|
24
24
|
import '../../chunk-EUHIN5FN.js';
|
|
25
25
|
import '../../chunk-6T55LXJL.js';
|
|
26
|
-
import '../../chunk-
|
|
26
|
+
import '../../chunk-FY36SODO.js';
|
|
27
27
|
import '../../chunk-O7JTXTGP.js';
|
|
28
28
|
import '../../chunk-SDBR4X3K.js';
|
|
29
|
-
import '../../chunk-
|
|
29
|
+
import '../../chunk-I6FORV4B.js';
|
|
30
30
|
import '../../chunk-OUW6WESU.js';
|
|
31
31
|
import '../../chunk-OAMIDZKW.js';
|
|
32
32
|
import '../../chunk-UY4VIWNH.js';
|
|
33
33
|
import '../../chunk-HI5V5X3S.js';
|
|
34
|
-
import '../../chunk-
|
|
35
|
-
import '../../chunk-
|
|
34
|
+
import '../../chunk-YUTDUIB5.js';
|
|
35
|
+
import '../../chunk-NSCZTGJU.js';
|
|
36
36
|
import '../../chunk-Z653O7MX.js';
|
|
37
37
|
import '../../chunk-ZCH7W7DZ.js';
|
|
38
38
|
import '../../chunk-R3FQW5X3.js';
|
|
@@ -42,17 +42,17 @@ import '../../chunk-7V36I5GT.js';
|
|
|
42
42
|
import '../../chunk-6WI7R2BD.js';
|
|
43
43
|
import '../../chunk-DVJGKIFQ.js';
|
|
44
44
|
import '../../chunk-CBP4AT5U.js';
|
|
45
|
-
import '../../chunk-
|
|
45
|
+
import '../../chunk-TZ3DCT3S.js';
|
|
46
46
|
import '../../chunk-FWNSNBLY.js';
|
|
47
|
-
import '../../chunk-
|
|
47
|
+
import '../../chunk-6O2TYPUP.js';
|
|
48
48
|
import '../../chunk-XZFWBF3P.js';
|
|
49
49
|
import '../../chunk-GCPEMNSU.js';
|
|
50
|
-
import '../../chunk-
|
|
50
|
+
import '../../chunk-7IL5RSR5.js';
|
|
51
51
|
import '../../chunk-Z5M4YYWT.js';
|
|
52
52
|
import '../../chunk-TYNZ5B2B.js';
|
|
53
53
|
import '../../chunk-IVO6YRRK.js';
|
|
54
54
|
import '../../chunk-3GFD7WTJ.js';
|
|
55
|
-
import '../../chunk-
|
|
55
|
+
import '../../chunk-OVYHHD2Q.js';
|
|
56
56
|
import '../../chunk-EDCNCBSC.js';
|
|
57
57
|
import '../../chunk-SKLEJJ6M.js';
|
|
58
58
|
import '../../chunk-6BZ5TKEV.js';
|