@salla.sa/twilight-theme-engine 1.0.180 → 1.0.182
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-OZGZROUJ.js → AddToCartForm-6UAS7JIW.js} +3 -3
- package/dist/{AddToCartForm-OZGZROUJ.js.map → AddToCartForm-6UAS7JIW.js.map} +1 -1
- package/dist/{BlogAuthorPage-Y4PJPT7L.js → BlogAuthorPage-ATDUQ466.js} +19 -19
- package/dist/{BlogAuthorPage-Y4PJPT7L.js.map → BlogAuthorPage-ATDUQ466.js.map} +1 -1
- package/dist/{BlogCategoryPage-4J335KY4.js → BlogCategoryPage-C55VAV4F.js} +19 -19
- package/dist/{BlogCategoryPage-4J335KY4.js.map → BlogCategoryPage-C55VAV4F.js.map} +1 -1
- package/dist/{BlogPage-MUIHZYXB.js → BlogPage-UQXMNC6I.js} +17 -17
- package/dist/{BlogPage-MUIHZYXB.js.map → BlogPage-UQXMNC6I.js.map} +1 -1
- package/dist/{BlogSinglePage-4JOY3UVT.js → BlogSinglePage-AFVLH7EU.js} +17 -17
- package/dist/{BlogSinglePage-4JOY3UVT.js.map → BlogSinglePage-AFVLH7EU.js.map} +1 -1
- package/dist/{BlogTagPage-M7ZQFHUT.js → BlogTagPage-ZFUL4MMJ.js} +19 -19
- package/dist/{BlogTagPage-M7ZQFHUT.js.map → BlogTagPage-ZFUL4MMJ.js.map} +1 -1
- package/dist/{BrandsPage-BC4BMJG4.js → BrandsPage-XW4PAOQ2.js} +18 -18
- package/dist/{BrandsPage-BC4BMJG4.js.map → BrandsPage-XW4PAOQ2.js.map} +1 -1
- package/dist/{Breadcrumb-V2URFP4B.js → Breadcrumb-HNGUTJAF.js} +17 -17
- package/dist/{Breadcrumb-V2URFP4B.js.map → Breadcrumb-HNGUTJAF.js.map} +1 -1
- package/dist/{CartItem-3AMNNBOL.js → CartItem-6JZTKWPN.js} +17 -17
- package/dist/{CartItem-3AMNNBOL.js.map → CartItem-6JZTKWPN.js.map} +1 -1
- package/dist/{CartSummary-KSVVKDUG.js → CartSummary-FVMOXTW4.js} +17 -17
- package/dist/{CartSummary-KSVVKDUG.js.map → CartSummary-FVMOXTW4.js.map} +1 -1
- package/dist/{Copyright-NUPXDALZ.js → Copyright-AEAMRPF6.js} +3 -3
- package/dist/{Copyright-NUPXDALZ.js.map → Copyright-AEAMRPF6.js.map} +1 -1
- package/dist/{CustomerLayout-R3L5PIOS.js → CustomerLayout-W2KYMLFV.js} +17 -17
- package/dist/{CustomerLayout-R3L5PIOS.js.map → CustomerLayout-W2KYMLFV.js.map} +1 -1
- package/dist/{Footer-KMBA7SPY.js → Footer-VA5QEMJT.js} +3 -3
- package/dist/{Footer-KMBA7SPY.js.map → Footer-VA5QEMJT.js.map} +1 -1
- package/dist/GoogleTag-YOJ2NCZD.js +15 -0
- package/dist/{GoogleTag-NWYDC6WD.js.map → GoogleTag-YOJ2NCZD.js.map} +1 -1
- package/dist/{Header-2XH6SHUO.js → Header-FU2LPTGO.js} +8 -8
- package/dist/{Header-2XH6SHUO.js.map → Header-FU2LPTGO.js.map} +1 -1
- package/dist/{LatestProducts-57JGQJVN.js → LatestProducts-QDK4C35P.js} +19 -19
- package/dist/{LatestProducts-57JGQJVN.js.map → LatestProducts-QDK4C35P.js.map} +1 -1
- package/dist/{LiveEditorBar-3DUDCCSM.js → LiveEditorBar-NHUTCSF2.js} +3 -3
- package/dist/{LiveEditorBar-3DUDCCSM.js.map → LiveEditorBar-NHUTCSF2.js.map} +1 -1
- package/dist/{LoyaltyPage-WPQ34KLX.js → LoyaltyPage-6S2O35FJ.js} +17 -17
- package/dist/{LoyaltyPage-WPQ34KLX.js.map → LoyaltyPage-6S2O35FJ.js.map} +1 -1
- package/dist/{LoyaltyPointsPage-RSSXJM6I.js → LoyaltyPointsPage-4WCDQDAT.js} +6 -6
- package/dist/{LoyaltyPointsPage-RSSXJM6I.js.map → LoyaltyPointsPage-4WCDQDAT.js.map} +1 -1
- package/dist/{MainMenu-LB3XL25D.js → MainMenu-6CZ5JFBX.js} +5 -5
- package/dist/{MainMenu-LB3XL25D.js.map → MainMenu-6CZ5JFBX.js.map} +1 -1
- package/dist/{MasterLayout-KGUQ4N2G.js → MasterLayout-PBARTDT2.js} +17 -17
- package/dist/{MasterLayout-KGUQ4N2G.js.map → MasterLayout-PBARTDT2.js.map} +1 -1
- package/dist/{MobileMenu-ZAFU2ZN6.js → MobileMenu-WZ4BWLCR.js} +18 -18
- package/dist/{MobileMenu-ZAFU2ZN6.js.map → MobileMenu-WZ4BWLCR.js.map} +1 -1
- package/dist/{NotificationsPage-D7ZTDST7.js → NotificationsPage-72O3QRPH.js} +17 -17
- package/dist/{NotificationsPage-D7ZTDST7.js.map → NotificationsPage-72O3QRPH.js.map} +1 -1
- package/dist/{OrderSinglePage-FT5NO5M4.js → OrderSinglePage-KBZNLHBH.js} +18 -18
- package/dist/{OrderSinglePage-FT5NO5M4.js.map → OrderSinglePage-KBZNLHBH.js.map} +1 -1
- package/dist/{OrdersPage-CHH2UX5S.js → OrdersPage-JI644YDE.js} +17 -17
- package/dist/{OrdersPage-CHH2UX5S.js.map → OrdersPage-JI644YDE.js.map} +1 -1
- package/dist/{PageSingle-5ZX3FUBB.js → PageSingle-N5FNOITW.js} +3 -3
- package/dist/{PageSingle-5ZX3FUBB.js.map → PageSingle-N5FNOITW.js.map} +1 -1
- package/dist/{ProductDetails-6HTLTQBT.js → ProductDetails-EQVBWJ6N.js} +4 -4
- package/dist/{ProductDetails-6HTLTQBT.js.map → ProductDetails-EQVBWJ6N.js.map} +1 -1
- package/dist/{ProfilePage-2YWL4JWQ.js → ProfilePage-AQRZT2XO.js} +17 -17
- package/dist/{ProfilePage-2YWL4JWQ.js.map → ProfilePage-AQRZT2XO.js.map} +1 -1
- package/dist/{ReviewsPage-ADWCW5P6.js → ReviewsPage-PS6KUW2G.js} +3 -3
- package/dist/{ReviewsPage-ADWCW5P6.js.map → ReviewsPage-PS6KUW2G.js.map} +1 -1
- package/dist/{SeoCartWidget-FFZXG7GS.js → SeoCartWidget-RZHQOFIM.js} +17 -17
- package/dist/{SeoCartWidget-FFZXG7GS.js.map → SeoCartWidget-RZHQOFIM.js.map} +1 -1
- package/dist/{SettingsPage-O5E4SCHB.js → SettingsPage-FR4RHLQT.js} +17 -17
- package/dist/{SettingsPage-O5E4SCHB.js.map → SettingsPage-FR4RHLQT.js.map} +1 -1
- package/dist/{StoreClosedNotification-4HPWJKWS.js → StoreClosedNotification-BFZYZAPB.js} +18 -18
- package/dist/{StoreClosedNotification-4HPWJKWS.js.map → StoreClosedNotification-BFZYZAPB.js.map} +1 -1
- package/dist/{TestimonialsPage-YAXINHYG.js → TestimonialsPage-3YEKHU3I.js} +3 -3
- package/dist/{TestimonialsPage-YAXINHYG.js.map → TestimonialsPage-3YEKHU3I.js.map} +1 -1
- package/dist/{ThankYouPage-DCQZVYIA.js → ThankYouPage-5364A5NA.js} +17 -17
- package/dist/{ThankYouPage-DCQZVYIA.js.map → ThankYouPage-5364A5NA.js.map} +1 -1
- package/dist/{WalletPage-NPBCYOBS.js → WalletPage-524UGX2C.js} +18 -18
- package/dist/{WalletPage-NPBCYOBS.js.map → WalletPage-524UGX2C.js.map} +1 -1
- package/dist/{WebMcpTools-VNHKJNI7.js → WebMcpTools-UTSIV5ZJ.js} +5 -5
- package/dist/{WebMcpTools-VNHKJNI7.js.map → WebMcpTools-UTSIV5ZJ.js.map} +1 -1
- package/dist/{WishlistPage-ISSKWME2.js → WishlistPage-EVKHYKVI.js} +19 -19
- package/dist/{WishlistPage-ISSKWME2.js.map → WishlistPage-EVKHYKVI.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-BSWV7U3V.js → chunk-3NFN57KF.js} +3 -3
- package/dist/{chunk-BSWV7U3V.js.map → chunk-3NFN57KF.js.map} +1 -1
- package/dist/{chunk-H22ABA6K.js → chunk-3XUIPPPX.js} +4 -4
- package/dist/{chunk-H22ABA6K.js.map → chunk-3XUIPPPX.js.map} +1 -1
- package/dist/{chunk-M4GK6JZO.js → chunk-4RI6HIGS.js} +3 -3
- package/dist/{chunk-M4GK6JZO.js.map → chunk-4RI6HIGS.js.map} +1 -1
- package/dist/{chunk-TUM4ABEA.js → chunk-4XL4V3TX.js} +5 -5
- package/dist/{chunk-TUM4ABEA.js.map → chunk-4XL4V3TX.js.map} +1 -1
- package/dist/{chunk-YZDL6GF7.js → chunk-5XB3ZB46.js} +3 -3
- package/dist/{chunk-YZDL6GF7.js.map → chunk-5XB3ZB46.js.map} +1 -1
- package/dist/{chunk-WHNF7WBH.js → chunk-7DNYKCQK.js} +3 -3
- package/dist/{chunk-WHNF7WBH.js.map → chunk-7DNYKCQK.js.map} +1 -1
- package/dist/{chunk-NQXXID34.js → chunk-7OB6AB6R.js} +4 -4
- package/dist/{chunk-NQXXID34.js.map → chunk-7OB6AB6R.js.map} +1 -1
- package/dist/{chunk-IHHJGUI3.js → chunk-7Z4ESL2L.js} +4 -4
- package/dist/{chunk-IHHJGUI3.js.map → chunk-7Z4ESL2L.js.map} +1 -1
- package/dist/{chunk-P6FREDWL.js → chunk-A7BDFM2C.js} +4 -4
- package/dist/{chunk-P6FREDWL.js.map → chunk-A7BDFM2C.js.map} +1 -1
- package/dist/{chunk-DCDWTP6S.js → chunk-B6FAKL6U.js} +5 -5
- package/dist/{chunk-DCDWTP6S.js.map → chunk-B6FAKL6U.js.map} +1 -1
- package/dist/{chunk-KAQV2WZ6.js → chunk-DE5QLYBD.js} +3 -3
- package/dist/{chunk-KAQV2WZ6.js.map → chunk-DE5QLYBD.js.map} +1 -1
- package/dist/{chunk-AWOMNZIJ.js → chunk-DGEXG3FP.js} +4 -4
- package/dist/{chunk-AWOMNZIJ.js.map → chunk-DGEXG3FP.js.map} +1 -1
- package/dist/{chunk-OAH2JE3U.js → chunk-FCMOS2UJ.js} +3 -3
- package/dist/{chunk-OAH2JE3U.js.map → chunk-FCMOS2UJ.js.map} +1 -1
- package/dist/{chunk-RKSWLLP7.js → chunk-G2EDQO46.js} +4 -4
- package/dist/{chunk-RKSWLLP7.js.map → chunk-G2EDQO46.js.map} +1 -1
- package/dist/{chunk-VY2TPXFO.js → chunk-HGYZPNWO.js} +3 -3
- package/dist/{chunk-VY2TPXFO.js.map → chunk-HGYZPNWO.js.map} +1 -1
- package/dist/{chunk-X4VIKIQM.js → chunk-HNOCZOHR.js} +5 -5
- package/dist/{chunk-X4VIKIQM.js.map → chunk-HNOCZOHR.js.map} +1 -1
- package/dist/{chunk-YA4O3EZC.js → chunk-HQNAM7Y4.js} +3 -3
- package/dist/{chunk-YA4O3EZC.js.map → chunk-HQNAM7Y4.js.map} +1 -1
- package/dist/{chunk-UD4NGJML.js → chunk-IH54NYKV.js} +4 -4
- package/dist/{chunk-UD4NGJML.js.map → chunk-IH54NYKV.js.map} +1 -1
- package/dist/{chunk-PGX4SXVF.js → chunk-IHWF6GCB.js} +3 -3
- package/dist/{chunk-PGX4SXVF.js.map → chunk-IHWF6GCB.js.map} +1 -1
- package/dist/{chunk-AY2XD3S2.js → chunk-JUG4JHR7.js} +7 -7
- package/dist/{chunk-AY2XD3S2.js.map → chunk-JUG4JHR7.js.map} +1 -1
- package/dist/{chunk-O6KQRFTR.js → chunk-KMU3HLVB.js} +14 -14
- package/dist/{chunk-O6KQRFTR.js.map → chunk-KMU3HLVB.js.map} +1 -1
- package/dist/{chunk-YEVLRCSL.js → chunk-KZQICDF2.js} +5 -5
- package/dist/{chunk-YEVLRCSL.js.map → chunk-KZQICDF2.js.map} +1 -1
- package/dist/{chunk-ZWX33T7S.js → chunk-LWJVLCCA.js} +3 -3
- package/dist/{chunk-ZWX33T7S.js.map → chunk-LWJVLCCA.js.map} +1 -1
- package/dist/{chunk-EOZAJ6SP.js → chunk-O6LWGK2G.js} +8 -8
- package/dist/{chunk-EOZAJ6SP.js.map → chunk-O6LWGK2G.js.map} +1 -1
- package/dist/{chunk-CB473WUX.js → chunk-OB6L6M2T.js} +3 -3
- package/dist/{chunk-CB473WUX.js.map → chunk-OB6L6M2T.js.map} +1 -1
- package/dist/{chunk-UA6LTD55.js → chunk-OIEBC7N6.js} +4 -4
- package/dist/{chunk-UA6LTD55.js.map → chunk-OIEBC7N6.js.map} +1 -1
- package/dist/{chunk-OP7DHR4L.js → chunk-OS5H7BNV.js} +4 -4
- package/dist/{chunk-OP7DHR4L.js.map → chunk-OS5H7BNV.js.map} +1 -1
- package/dist/{chunk-5ZVKOLFZ.js → chunk-P43LC5TV.js} +7 -7
- package/dist/{chunk-5ZVKOLFZ.js.map → chunk-P43LC5TV.js.map} +1 -1
- package/dist/{chunk-XEGALTQJ.js → chunk-QG2BU24D.js} +3 -3
- package/dist/{chunk-XEGALTQJ.js.map → chunk-QG2BU24D.js.map} +1 -1
- package/dist/{chunk-I7LWEJDL.js → chunk-RDT2CI5O.js} +3 -3
- package/dist/{chunk-I7LWEJDL.js.map → chunk-RDT2CI5O.js.map} +1 -1
- package/dist/{chunk-D4ACJS2K.js → chunk-RSSHK3JC.js} +3 -3
- package/dist/{chunk-D4ACJS2K.js.map → chunk-RSSHK3JC.js.map} +1 -1
- package/dist/{chunk-QPRU3PVD.js → chunk-SLMOKFUU.js} +4 -4
- package/dist/{chunk-QPRU3PVD.js.map → chunk-SLMOKFUU.js.map} +1 -1
- package/dist/{chunk-5MUY4AUU.js → chunk-SLOGMIWR.js} +19 -19
- package/dist/{chunk-5MUY4AUU.js.map → chunk-SLOGMIWR.js.map} +1 -1
- package/dist/{chunk-YL6X3ZMG.js → chunk-SQAAODYN.js} +12 -3
- package/dist/chunk-SQAAODYN.js.map +1 -0
- package/dist/{chunk-UYY5FXLW.js → chunk-T3LHKGD6.js} +4 -4
- package/dist/{chunk-UYY5FXLW.js.map → chunk-T3LHKGD6.js.map} +1 -1
- package/dist/{chunk-6MTG5HRF.js → chunk-TBWR3H3J.js} +4 -4
- package/dist/{chunk-6MTG5HRF.js.map → chunk-TBWR3H3J.js.map} +1 -1
- package/dist/{chunk-VXTPMEFC.js → chunk-TRLFPQBT.js} +3 -3
- package/dist/{chunk-VXTPMEFC.js.map → chunk-TRLFPQBT.js.map} +1 -1
- package/dist/{chunk-QRG7YWRL.js → chunk-TW4MCKDB.js} +3 -3
- package/dist/{chunk-QRG7YWRL.js.map → chunk-TW4MCKDB.js.map} +1 -1
- package/dist/{chunk-DASAKSKN.js → chunk-UWGHQLEW.js} +4 -4
- package/dist/{chunk-DASAKSKN.js.map → chunk-UWGHQLEW.js.map} +1 -1
- package/dist/{chunk-BTQ2SAMS.js → chunk-WC2XULCS.js} +6 -6
- package/dist/{chunk-BTQ2SAMS.js.map → chunk-WC2XULCS.js.map} +1 -1
- package/dist/{chunk-K6AQYYJR.js → chunk-WCA25DUZ.js} +3 -3
- package/dist/{chunk-K6AQYYJR.js.map → chunk-WCA25DUZ.js.map} +1 -1
- package/dist/{chunk-6UUBYWC4.js → chunk-WMOSPN6L.js} +4 -4
- package/dist/{chunk-6UUBYWC4.js.map → chunk-WMOSPN6L.js.map} +1 -1
- package/dist/{chunk-PFUDIAWY.js → chunk-WPMRMORF.js} +4 -4
- package/dist/{chunk-PFUDIAWY.js.map → chunk-WPMRMORF.js.map} +1 -1
- package/dist/{chunk-CRXXKAFW.js → chunk-WYPMPXMW.js} +3 -3
- package/dist/{chunk-CRXXKAFW.js.map → chunk-WYPMPXMW.js.map} +1 -1
- package/dist/{chunk-Z5LSS25A.js → chunk-XCYWOZGV.js} +3 -3
- package/dist/{chunk-Z5LSS25A.js.map → chunk-XCYWOZGV.js.map} +1 -1
- package/dist/{chunk-IAVHDEMZ.js → chunk-XF33VTAA.js} +3 -3
- package/dist/{chunk-IAVHDEMZ.js.map → chunk-XF33VTAA.js.map} +1 -1
- package/dist/{chunk-WLRNZYCA.js → chunk-YEER2VOP.js} +3 -3
- package/dist/{chunk-WLRNZYCA.js.map → chunk-YEER2VOP.js.map} +1 -1
- package/dist/{chunk-F6MAM7HZ.js → chunk-YVFQ46DK.js} +3 -3
- package/dist/{chunk-F6MAM7HZ.js.map → chunk-YVFQ46DK.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/live-editor/frame.d.ts.map +1 -1
- 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-SNKCSUFH.js → custom-urls-GA4EQODA.js} +7 -7
- package/dist/{custom-urls-SNKCSUFH.js.map → custom-urls-GA4EQODA.js.map} +1 -1
- package/dist/dev/editor/index.js +2 -2
- package/dist/dev/index.js +1 -1
- package/dist/{document-class-GMZDY55X.js → document-class-AFX34W3O.js} +17 -17
- package/dist/{document-class-GMZDY55X.js.map → document-class-AFX34W3O.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-PVCAQHKP.js → navigation-EML4VCRE.js} +5 -5
- package/dist/{navigation-PVCAQHKP.js.map → navigation-EML4VCRE.js.map} +1 -1
- package/dist/{navigation-MEWHF2SI.js → navigation-XTIOGZ5F.js} +4 -4
- package/dist/{navigation-MEWHF2SI.js.map → navigation-XTIOGZ5F.js.map} +1 -1
- package/dist/{not-found-AWSO6GKQ.js → not-found-2NDDVRRU.js} +18 -18
- package/dist/{not-found-AWSO6GKQ.js.map → not-found-2NDDVRRU.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 +23 -23
- 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-listing.js +41 -36
- package/dist/routes/product-listing.js.map +1 -1
- package/dist/routes/product.js +24 -24
- 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 +21 -21
- package/dist/{store-lookup-GPDB2LWO.js → store-lookup-EP64Y6W4.js} +8 -8
- package/dist/{store-lookup-GPDB2LWO.js.map → store-lookup-EP64Y6W4.js.map} +1 -1
- package/dist/tanstack.js +17 -17
- package/dist/utils/index.js +2 -2
- package/package.json +1 -1
- package/tailwind/components/live-editor/frame.ts.txt +17 -1
- package/tailwind/routes/product-listing/loader.ts.txt +25 -11
- package/dist/GoogleTag-NWYDC6WD.js +0 -15
- package/dist/chunk-YL6X3ZMG.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/analytics/gtm-page.ts"],"names":["user"],"mappings":";;;;;;;;AAuCO,IAAM,qBAAA,GAAwB;AAErC,IAAI,KAAA,GAAuB,QAAQ,OAAA,EAAQ;AAC3C,IAAI,iBAAA,GAAoB,KAAA;AACxB,IAAI,WAAA,GAA6B,IAAA;AACjC,IAAI,oBAAgC,MAAM;AAAC,CAAA;AAC3C,IAAI,gBAAgB,IAAI,OAAA,CAAc,CAAC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A,KAAS,OAAA,CAAQ,SAAA,IAAa,KAAA,CAAM,OAAO,OAAO,YAAA,CAAa,KAAA,CAAM,KAAA,EAAO,QAAQ,CAAA;AAC9F,EAAA,OAAO,IAAA;AACT;AASA,SAAS,oBAAA,GAA6B;AACpC,EAAA,IAAI,eAAA,EAAiB;AACrB,EAAA,eAAA,GAAkB,YAAA,CAAa,uCAAA,EAAyC,CAAC,OAAA,KAAY;AACnF,IAAA,MAAM,OAAA,GAAU,OAAA;AAChB,IAAA,IAAI,CAAC,MAAM,OAAA,CAAQ,OAAA,EAAS,IAAI,CAAA,IAAK,OAAO,OAAA,CAAQ,OAAA,KAAY,SAAA,EAAW;AAC3E,IAAA,MAAM,WAAW,OAAA,CAAQ,IAAA;AACzB,IAAA,MAAM,WAAW,mBAAA,EAAoB;AACrC,IAAA,IAAI,CAAC,QAAA,CAAS,MAAA,IAAU,CAAC,UAAA,CAAW,QAAQ,CAAA,EAAG;AAE/C,IAAA,MAAM,cAAc,cAAA,CAAe,QAAA,EAAU,oBAAmB,CAAE,IAAA,IAAQ,QAAW,QAAQ,CAAA;AAC7F,IAAA,OAAA,CAAQ,MAAM;AACZ,MAAA,eAAA,CAAgB,EAAE,SAAA,EAAW,EAAE,WAAA,EAAa,IAAA,IAAQ,CAAA;AACpD,MAAA,eAAA,CAAgB,WAAW,CAAA;AAAA,IAC7B,CAAC,CAAA;AAAA,EACH,CAAC,CAAA;AACH","file":"chunk-QPRU3PVD.js","sourcesContent":["/**\n * The order a Twig page fills the data layer in, for a storefront that loads once.\n *\n * A Twig page opens with its own data (`page`, `store`, `customer`, and the page's ecommerce\n * block), then loads the containers, then hands the SDK `twilight::init` and each\n * `services::<name>.init`, which the SDK copies into the data layer. Tags fire on those events\n * and read the data pushed before them, so the order is the contract.\n *\n * Here the first page is pushed once its customer is known (the signed-in one loads in the\n * browser) and, on the cart, once the cart has; GTM waits for that push ({@link whenGtmPageData}).\n * Every later page pushes its own `page` and ecommerce block too, after clearing the previous\n * page's ecommerce (GTM merges objects into what it holds, arrays index by index). Those pages\n * load nothing, so they announce no services again: Salla's container would load its Google\n * tags and Clarity a second time. Every push the engine makes goes through one queue, so a\n * page's data is always in before its events.\n */\nimport type { Cart, Product, User } from '../../types';\nimport type { Order } from '../../routes/account/types';\nimport { user as userApi } from '../../api/user';\nimport type { StoreContext } from '../../api/store';\nimport { getTwilightContext, type PageContext } from '../../twilight/context';\nimport { isNativeApp } from '../../native-app';\nimport { RouteId } from '../../router/route-ids';\nimport { onSallaEvent, whenSallaLoaded } from '../../utils/sdk-helpers';\nimport {\n gtmCartCheckout,\n gtmCustomer,\n gtmDetail,\n gtmEnabled,\n gtmImpressions,\n gtmPage,\n gtmPurchase,\n gtmStore,\n pushToDataLayer,\n servicesInitEvents,\n type DataLayerEntry,\n} from './gtm';\n\n/** How long the first page waits for its customer or its cart before it is pushed without. */\nexport const GTM_PAGE_DATA_WAIT_MS = 3000;\n\nlet queue: Promise<void> = Promise.resolve();\nlet firstPageReported = false;\nlet previousUrl: string | null = null;\nlet markPageDataReady: () => void = () => {};\nlet pageDataReady = new Promise<void>((resolve) => (markPageDataReady = resolve));\nlet stopImpressions: (() => void) | null = null;\n/** Orders this document has pushed a `purchase` for, whether or not GTM has taken it yet. */\nlet purchasesPushed = new Set<string>();\n\n/** Resolves once the first page's data is in the data layer, as Twig's head pushes it before GTM. */\nexport function whenGtmPageData(): Promise<void> {\n return pageDataReady;\n}\n\nfunction settingsOrUndefined(): StoreContext | undefined {\n try {\n return getTwilightContext().settings;\n } catch {\n return undefined;\n }\n}\n\nfunction enqueue(task: () => void | Promise<void>): void {\n queue = queue.then(task).catch((error: unknown) => {\n console.warn('[gtm] Could not push to the data layer:', error);\n });\n}\n\nfunction withDeadline<T>(value: T | Promise<T>, fallback: T): Promise<T> {\n let timer: ReturnType<typeof setTimeout> | undefined;\n const deadline = new Promise<T>((resolve) => {\n timer = setTimeout(() => resolve(fallback), GTM_PAGE_DATA_WAIT_MS);\n });\n return Promise.race([Promise.resolve(value), deadline])\n .catch(() => fallback)\n .finally(() => clearTimeout(timer));\n}\n\n/** The signed-in customer, from the query `useUser` already loads; a guest has no token. */\nasync function currentUser(): Promise<User | null> {\n const { authToken, queryClient } = getTwilightContext();\n if (!authToken || !queryClient) return null;\n return withDeadline(\n queryClient.ensureQueryData(userApi.queries.current()).catch(() => null),\n null\n );\n}\n\n/** The Salla app's webview: the SDK knows once loaded, the settings carry the app's headers before. */\nfunction inNativeApp(settings: StoreContext | undefined): boolean {\n const os = settings?.jitsu?.context?.extra?.headers?.['s-app-os']?.toLowerCase();\n return os === 'ios' || os === 'android' || isNativeApp();\n}\n\n/**\n * The `user` Twig's `twilight::init` carries (the SDK's own config), as far as tags read it:\n * Salla's container identifies the customer to a chat service from `user.id` when that\n * service's `services::<name>.init` arrives, which is before the SDK pushes a user of its own.\n */\nfunction initUser(settings: StoreContext | undefined, user: User | null): DataLayerEntry {\n const visitor = settings?.user;\n return {\n id: user ? (user.id ?? null) : (visitor?.id ?? null),\n type: user ? 'user' : (visitor?.type ?? 'guest'),\n country_code: user?.country_code ?? visitor?.country_code,\n language_code: visitor?.language_code,\n currency_code: visitor?.currency_code,\n };\n}\n\n/** `twilight::init`, then each `services::<name>.init`, once per document, as Twig's page does. */\nfunction announceServices(settings: StoreContext | undefined, user: User | null): void {\n const snippetServices = (getTwilightContext().appsSnippets ?? []).map((app) => app.service);\n const events = servicesInitEvents(settings?.external_services, snippetServices);\n whenSallaLoaded((sdk) => {\n // The engine calls `salla.init` itself; Twig hands it the event, which the SDK records.\n pushToDataLayer({ event: 'twilight::init', user: initUser(settings, user) });\n for (const [name, payload] of events) sdk.event.dispatch(name, payload);\n });\n}\n\nexport interface GtmPageView {\n page: PageContext;\n /** The page's ecommerce block, or a promise of it: the cart loads in the browser. */\n ecommerce?: DataLayerEntry | Promise<DataLayerEntry | null> | null;\n}\n\n/** Push a page's data, once per page view: the first opens the document's data layer. */\nexport function reportGtmPageView(view: GtmPageView): void {\n if (typeof window === 'undefined') return;\n const settings = settingsOrUndefined();\n if (!gtmEnabled(settings)) {\n markPageDataReady();\n return;\n }\n watchListImpressions();\n\n const first = !firstPageReported;\n firstPageReported = true;\n // `url()->previous()`: the page before, or the store itself when the visitor came from nowhere.\n const referrer = (first ? document.referrer : previousUrl) || window.location.origin;\n previousUrl = window.location.href;\n\n enqueue(async () => {\n const [user, ecommerce] = await Promise.all([\n currentUser(),\n withDeadline(view.ecommerce ?? null, null),\n ]);\n const customer = await gtmCustomer(user, settings);\n const page = gtmPage(\n { slug: view.page.slug, referrer, mobileApp: inNativeApp(settings) },\n settings\n );\n if (first) {\n const entry = { ...ecommerce, page, store: gtmStore(settings), customer };\n pushToDataLayer(entry);\n rememberPurchaseOnceReceived(entry);\n announceServices(settings, user);\n markPageDataReady();\n return;\n }\n // GTM merges each push into what it holds: a guest's `{ isGuest: true }` would keep the\n // signed-out customer's details, and a shorter product list the last page's extra lines.\n pushToDataLayer({ customer: null, ecommerce: null });\n pushToDataLayer({ page, customer });\n if (ecommerce) {\n pushToDataLayer(ecommerce);\n rememberPurchaseOnceReceived(ecommerce);\n }\n });\n}\n\n/** How long a browser remembers an order it reported, as `SeoThankYouWidget` caches it. */\nconst PURCHASE_REMEMBERED_MS = 24 * 60 * 60 * 1000;\n/** How often, and for how long, a pushed purchase is checked for GTM having taken it. */\nexport const PURCHASE_RECEIVED_POLL_MS = 500;\nconst PURCHASE_RECEIVED_WAIT_MS = 60_000;\nconst purchaseKey = (orderId: unknown) => `google_tagged_order_${String(orderId)}`;\n\nfunction reportedRecently(orderId: unknown): boolean {\n try {\n const at = Number(window.localStorage.getItem(purchaseKey(orderId)));\n return Boolean(at) && Date.now() - at < PURCHASE_REMEMBERED_MS;\n } catch {\n // No storage (a private window): report it, as a Twig page would the first time.\n return false;\n }\n}\n\n/**\n * Remember a pushed `purchase` once GTM has taken it (GTM stamps `gtm.uniqueEventId` on each\n * message it handles). GTM loads seconds after the page here, so a shopper who leaves before\n * then has reported nothing, and the next visit reports it. Twig renders the push and its\n * container together, so it remembers the order as it renders the page.\n */\nfunction rememberPurchaseOnceReceived(entry: DataLayerEntry): void {\n if (entry.event !== 'purchase') return;\n const orderId = (entry.ecommerce as { event_id?: unknown } | undefined)?.event_id;\n const started = Date.now();\n const check = () => {\n if ('gtm.uniqueEventId' in entry) {\n try {\n window.localStorage.setItem(purchaseKey(orderId), String(Date.now()));\n } catch {\n // No storage: nothing to remember it in.\n }\n } else if (Date.now() - started < PURCHASE_RECEIVED_WAIT_MS) {\n setTimeout(check, PURCHASE_RECEIVED_POLL_MS);\n }\n };\n check();\n}\n\n/**\n * An order's `purchase`, once: Twig caches each order it reported for a day, so a reload of\n * the thank-you page counts nothing. Not inside the Salla app, which logs the order itself.\n */\nfunction purchaseOnce(order: Order, settings: StoreContext | undefined): DataLayerEntry | null {\n const id = String(order.id);\n // A return to the page in this document waits on the first push; only a new load retries.\n if (inNativeApp(settings) || purchasesPushed.has(id) || reportedRecently(order.id)) return null;\n purchasesPushed.add(id);\n return gtmPurchase(order, settings);\n}\n\nexport interface GtmPageEcommerceInput {\n slug: string;\n product?: Product;\n order?: Order;\n /** The cart page's cart, once the page has loaded it. */\n cart?: Promise<Cart | null> | null;\n}\n\n/** A page's own ecommerce block: a product's `detail`, the cart's `checkout`, an order's `purchase`. */\nexport function gtmPageEcommerce(input: GtmPageEcommerceInput): GtmPageView['ecommerce'] {\n if (typeof window === 'undefined') return null;\n const settings = settingsOrUndefined();\n if (!gtmEnabled(settings)) return null;\n if (input.slug === RouteId.PRODUCT_SINGLE && input.product)\n return gtmDetail(input.product, settings);\n if (input.slug === RouteId.CART && input.cart)\n return input.cart.then((cart) => (cart ? gtmCartCheckout(cart, settings) : null));\n if (input.slug === RouteId.THANK_YOU && input.order) return purchaseOnce(input.order, settings);\n return null;\n}\n\n/**\n * `impressions` for each page of a product listing the engine or the theme reports through\n * `salla-products-list::products.fetched`, as `<salla-products-list>` pushes on Twig. That\n * component pushes its own before it emits the API's answer (`success`), so those are skipped.\n * Each batch first clears the last one's list (GTM merges arrays index by index), and only that:\n * the page's own block, such as the cart's `checkout`, stays for the tags still to read it.\n */\nfunction watchListImpressions(): void {\n if (stopImpressions) return;\n stopImpressions = onSallaEvent('salla-products-list::products.fetched', (payload) => {\n const fetched = payload as { data?: unknown; success?: unknown } | undefined;\n if (!Array.isArray(fetched?.data) || typeof fetched.success === 'boolean') return;\n const products = fetched.data as Product[];\n const settings = settingsOrUndefined();\n if (!products.length || !gtmEnabled(settings)) return;\n // The page the products were fetched for, not the one the queue gets to them on.\n const impressions = gtmImpressions(products, getTwilightContext().page ?? undefined, settings);\n enqueue(() => {\n pushToDataLayer({ ecommerce: { impressions: null } });\n pushToDataLayer(impressions);\n });\n });\n}\n\n/** Test seam: forget the document's first page and every listener. */\nexport function resetGtmPageTracking(): void {\n stopImpressions?.();\n stopImpressions = null;\n queue = Promise.resolve();\n firstPageReported = false;\n previousUrl = null;\n purchasesPushed = new Set();\n pageDataReady = new Promise<void>((resolve) => (markPageDataReady = resolve));\n}\n\n/** Test seam: settle every push queued so far. */\nexport function flushGtmQueue(): Promise<void> {\n return queue;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/lib/analytics/gtm-page.ts"],"names":["user"],"mappings":";;;;;;;;AAuCO,IAAM,qBAAA,GAAwB;AAErC,IAAI,KAAA,GAAuB,QAAQ,OAAA,EAAQ;AAC3C,IAAI,iBAAA,GAAoB,KAAA;AACxB,IAAI,WAAA,GAA6B,IAAA;AACjC,IAAI,oBAAgC,MAAM;AAAC,CAAA;AAC3C,IAAI,gBAAgB,IAAI,OAAA,CAAc,CAAC,OAAA,KAAa,oBAAoB,OAAQ,CAAA;AAChF,IAAI,eAAA,GAAuC,IAAA;AAE3C,IAAI,eAAA,uBAAsB,GAAA,EAAY;AAG/B,SAAS,eAAA,GAAiC;AAC/C,EAAA,OAAO,aAAA;AACT;AAEA,SAAS,mBAAA,GAAgD;AACvD,EAAA,IAAI;AACF,IAAA,OAAO,oBAAm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,uCAAA,EAAyC,CAAC,OAAA,KAAY;AACnF,IAAA,MAAM,OAAA,GAAU,OAAA;AAChB,IAAA,IAAI,CAAC,MAAM,OAAA,CAAQ,OAAA,EAAS,IAAI,CAAA,IAAK,OAAO,OAAA,CAAQ,OAAA,KAAY,SAAA,EAAW;AAC3E,IAAA,MAAM,WAAW,OAAA,CAAQ,IAAA;AACzB,IAAA,MAAM,WAAW,mBAAA,EAAoB;AACrC,IAAA,IAAI,CAAC,QAAA,CAAS,MAAA,IAAU,CAAC,UAAA,CAAW,QAAQ,CAAA,EAAG;AAE/C,IAAA,MAAM,cAAc,cAAA,CAAe,QAAA,EAAU,oBAAmB,CAAE,IAAA,IAAQ,QAAW,QAAQ,CAAA;AAC7F,IAAA,OAAA,CAAQ,MAAM;AACZ,MAAA,eAAA,CAAgB,EAAE,SAAA,EAAW,EAAE,WAAA,EAAa,IAAA,IAAQ,CAAA;AACpD,MAAA,eAAA,CAAgB,WAAW,CAAA;AAAA,IAC7B,CAAC,CAAA;AAAA,EACH,CAAC,CAAA;AACH","file":"chunk-SLMOKFUU.js","sourcesContent":["/**\n * The order a Twig page fills the data layer in, for a storefront that loads once.\n *\n * A Twig page opens with its own data (`page`, `store`, `customer`, and the page's ecommerce\n * block), then loads the containers, then hands the SDK `twilight::init` and each\n * `services::<name>.init`, which the SDK copies into the data layer. Tags fire on those events\n * and read the data pushed before them, so the order is the contract.\n *\n * Here the first page is pushed once its customer is known (the signed-in one loads in the\n * browser) and, on the cart, once the cart has; GTM waits for that push ({@link whenGtmPageData}).\n * Every later page pushes its own `page` and ecommerce block too, after clearing the previous\n * page's ecommerce (GTM merges objects into what it holds, arrays index by index). Those pages\n * load nothing, so they announce no services again: Salla's container would load its Google\n * tags and Clarity a second time. Every push the engine makes goes through one queue, so a\n * page's data is always in before its events.\n */\nimport type { Cart, Product, User } from '../../types';\nimport type { Order } from '../../routes/account/types';\nimport { user as userApi } from '../../api/user';\nimport type { StoreContext } from '../../api/store';\nimport { getTwilightContext, type PageContext } from '../../twilight/context';\nimport { isNativeApp } from '../../native-app';\nimport { RouteId } from '../../router/route-ids';\nimport { onSallaEvent, whenSallaLoaded } from '../../utils/sdk-helpers';\nimport {\n gtmCartCheckout,\n gtmCustomer,\n gtmDetail,\n gtmEnabled,\n gtmImpressions,\n gtmPage,\n gtmPurchase,\n gtmStore,\n pushToDataLayer,\n servicesInitEvents,\n type DataLayerEntry,\n} from './gtm';\n\n/** How long the first page waits for its customer or its cart before it is pushed without. */\nexport const GTM_PAGE_DATA_WAIT_MS = 3000;\n\nlet queue: Promise<void> = Promise.resolve();\nlet firstPageReported = false;\nlet previousUrl: string | null = null;\nlet markPageDataReady: () => void = () => {};\nlet pageDataReady = new Promise<void>((resolve) => (markPageDataReady = resolve));\nlet stopImpressions: (() => void) | null = null;\n/** Orders this document has pushed a `purchase` for, whether or not GTM has taken it yet. */\nlet purchasesPushed = new Set<string>();\n\n/** Resolves once the first page's data is in the data layer, as Twig's head pushes it before GTM. */\nexport function whenGtmPageData(): Promise<void> {\n return pageDataReady;\n}\n\nfunction settingsOrUndefined(): StoreContext | undefined {\n try {\n return getTwilightContext().settings;\n } catch {\n return undefined;\n }\n}\n\nfunction enqueue(task: () => void | Promise<void>): void {\n queue = queue.then(task).catch((error: unknown) => {\n console.warn('[gtm] Could not push to the data layer:', error);\n });\n}\n\nfunction withDeadline<T>(value: T | Promise<T>, fallback: T): Promise<T> {\n let timer: ReturnType<typeof setTimeout> | undefined;\n const deadline = new Promise<T>((resolve) => {\n timer = setTimeout(() => resolve(fallback), GTM_PAGE_DATA_WAIT_MS);\n });\n return Promise.race([Promise.resolve(value), deadline])\n .catch(() => fallback)\n .finally(() => clearTimeout(timer));\n}\n\n/** The signed-in customer, from the query `useUser` already loads; a guest has no token. */\nasync function currentUser(): Promise<User | null> {\n const { authToken, queryClient } = getTwilightContext();\n if (!authToken || !queryClient) return null;\n return withDeadline(\n queryClient.ensureQueryData(userApi.queries.current()).catch(() => null),\n null\n );\n}\n\n/** The Salla app's webview: the SDK knows once loaded, the settings carry the app's headers before. */\nfunction inNativeApp(settings: StoreContext | undefined): boolean {\n const os = settings?.jitsu?.context?.extra?.headers?.['s-app-os']?.toLowerCase();\n return os === 'ios' || os === 'android' || isNativeApp();\n}\n\n/**\n * The `user` Twig's `twilight::init` carries (the SDK's own config), as far as tags read it:\n * Salla's container identifies the customer to a chat service from `user.id` when that\n * service's `services::<name>.init` arrives, which is before the SDK pushes a user of its own.\n */\nfunction initUser(settings: StoreContext | undefined, user: User | null): DataLayerEntry {\n const visitor = settings?.user;\n return {\n id: user ? (user.id ?? null) : (visitor?.id ?? null),\n type: user ? 'user' : (visitor?.type ?? 'guest'),\n country_code: user?.country_code ?? visitor?.country_code,\n language_code: visitor?.language_code,\n currency_code: visitor?.currency_code,\n };\n}\n\n/** `twilight::init`, then each `services::<name>.init`, once per document, as Twig's page does. */\nfunction announceServices(settings: StoreContext | undefined, user: User | null): void {\n const snippetServices = (getTwilightContext().appsSnippets ?? []).map((app) => app.service);\n const events = servicesInitEvents(settings?.external_services, snippetServices);\n whenSallaLoaded((sdk) => {\n // The engine calls `salla.init` itself; Twig hands it the event, which the SDK records.\n pushToDataLayer({ event: 'twilight::init', user: initUser(settings, user) });\n for (const [name, payload] of events) sdk.event.dispatch(name, payload);\n });\n}\n\nexport interface GtmPageView {\n page: PageContext;\n /** The page's ecommerce block, or a promise of it: the cart loads in the browser. */\n ecommerce?: DataLayerEntry | Promise<DataLayerEntry | null> | null;\n}\n\n/** Push a page's data, once per page view: the first opens the document's data layer. */\nexport function reportGtmPageView(view: GtmPageView): void {\n if (typeof window === 'undefined') return;\n const settings = settingsOrUndefined();\n if (!gtmEnabled(settings)) {\n markPageDataReady();\n return;\n }\n watchListImpressions();\n\n const first = !firstPageReported;\n firstPageReported = true;\n // `url()->previous()`: the page before, or the store itself when the visitor came from nowhere.\n const referrer = (first ? document.referrer : previousUrl) || window.location.origin;\n previousUrl = window.location.href;\n\n enqueue(async () => {\n const [user, ecommerce] = await Promise.all([\n currentUser(),\n withDeadline(view.ecommerce ?? null, null),\n ]);\n const customer = await gtmCustomer(user, settings);\n const page = gtmPage(\n { slug: view.page.slug, referrer, mobileApp: inNativeApp(settings) },\n settings\n );\n if (first) {\n const entry = { ...ecommerce, page, store: gtmStore(settings), customer };\n pushToDataLayer(entry);\n rememberPurchaseOnceReceived(entry);\n announceServices(settings, user);\n markPageDataReady();\n return;\n }\n // GTM merges each push into what it holds: a guest's `{ isGuest: true }` would keep the\n // signed-out customer's details, and a shorter product list the last page's extra lines.\n pushToDataLayer({ customer: null, ecommerce: null });\n pushToDataLayer({ page, customer });\n if (ecommerce) {\n pushToDataLayer(ecommerce);\n rememberPurchaseOnceReceived(ecommerce);\n }\n });\n}\n\n/** How long a browser remembers an order it reported, as `SeoThankYouWidget` caches it. */\nconst PURCHASE_REMEMBERED_MS = 24 * 60 * 60 * 1000;\n/** How often, and for how long, a pushed purchase is checked for GTM having taken it. */\nexport const PURCHASE_RECEIVED_POLL_MS = 500;\nconst PURCHASE_RECEIVED_WAIT_MS = 60_000;\nconst purchaseKey = (orderId: unknown) => `google_tagged_order_${String(orderId)}`;\n\nfunction reportedRecently(orderId: unknown): boolean {\n try {\n const at = Number(window.localStorage.getItem(purchaseKey(orderId)));\n return Boolean(at) && Date.now() - at < PURCHASE_REMEMBERED_MS;\n } catch {\n // No storage (a private window): report it, as a Twig page would the first time.\n return false;\n }\n}\n\n/**\n * Remember a pushed `purchase` once GTM has taken it (GTM stamps `gtm.uniqueEventId` on each\n * message it handles). GTM loads seconds after the page here, so a shopper who leaves before\n * then has reported nothing, and the next visit reports it. Twig renders the push and its\n * container together, so it remembers the order as it renders the page.\n */\nfunction rememberPurchaseOnceReceived(entry: DataLayerEntry): void {\n if (entry.event !== 'purchase') return;\n const orderId = (entry.ecommerce as { event_id?: unknown } | undefined)?.event_id;\n const started = Date.now();\n const check = () => {\n if ('gtm.uniqueEventId' in entry) {\n try {\n window.localStorage.setItem(purchaseKey(orderId), String(Date.now()));\n } catch {\n // No storage: nothing to remember it in.\n }\n } else if (Date.now() - started < PURCHASE_RECEIVED_WAIT_MS) {\n setTimeout(check, PURCHASE_RECEIVED_POLL_MS);\n }\n };\n check();\n}\n\n/**\n * An order's `purchase`, once: Twig caches each order it reported for a day, so a reload of\n * the thank-you page counts nothing. Not inside the Salla app, which logs the order itself.\n */\nfunction purchaseOnce(order: Order, settings: StoreContext | undefined): DataLayerEntry | null {\n const id = String(order.id);\n // A return to the page in this document waits on the first push; only a new load retries.\n if (inNativeApp(settings) || purchasesPushed.has(id) || reportedRecently(order.id)) return null;\n purchasesPushed.add(id);\n return gtmPurchase(order, settings);\n}\n\nexport interface GtmPageEcommerceInput {\n slug: string;\n product?: Product;\n order?: Order;\n /** The cart page's cart, once the page has loaded it. */\n cart?: Promise<Cart | null> | null;\n}\n\n/** A page's own ecommerce block: a product's `detail`, the cart's `checkout`, an order's `purchase`. */\nexport function gtmPageEcommerce(input: GtmPageEcommerceInput): GtmPageView['ecommerce'] {\n if (typeof window === 'undefined') return null;\n const settings = settingsOrUndefined();\n if (!gtmEnabled(settings)) return null;\n if (input.slug === RouteId.PRODUCT_SINGLE && input.product)\n return gtmDetail(input.product, settings);\n if (input.slug === RouteId.CART && input.cart)\n return input.cart.then((cart) => (cart ? gtmCartCheckout(cart, settings) : null));\n if (input.slug === RouteId.THANK_YOU && input.order) return purchaseOnce(input.order, settings);\n return null;\n}\n\n/**\n * `impressions` for each page of a product listing the engine or the theme reports through\n * `salla-products-list::products.fetched`, as `<salla-products-list>` pushes on Twig. That\n * component pushes its own before it emits the API's answer (`success`), so those are skipped.\n * Each batch first clears the last one's list (GTM merges arrays index by index), and only that:\n * the page's own block, such as the cart's `checkout`, stays for the tags still to read it.\n */\nfunction watchListImpressions(): void {\n if (stopImpressions) return;\n stopImpressions = onSallaEvent('salla-products-list::products.fetched', (payload) => {\n const fetched = payload as { data?: unknown; success?: unknown } | undefined;\n if (!Array.isArray(fetched?.data) || typeof fetched.success === 'boolean') return;\n const products = fetched.data as Product[];\n const settings = settingsOrUndefined();\n if (!products.length || !gtmEnabled(settings)) return;\n // The page the products were fetched for, not the one the queue gets to them on.\n const impressions = gtmImpressions(products, getTwilightContext().page ?? undefined, settings);\n enqueue(() => {\n pushToDataLayer({ ecommerce: { impressions: null } });\n pushToDataLayer(impressions);\n });\n });\n}\n\n/** Test seam: forget the document's first page and every listener. */\nexport function resetGtmPageTracking(): void {\n stopImpressions?.();\n stopImpressions = null;\n queue = Promise.resolve();\n firstPageReported = false;\n previousUrl = null;\n purchasesPushed = new Set();\n pageDataReady = new Promise<void>((resolve) => (markPageDataReady = resolve));\n}\n\n/** Test seam: settle every push queued so far. */\nexport function flushGtmQueue(): Promise<void> {\n return queue;\n}\n"]}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { Footer } from './chunk-QT2D7JMW.js';
|
|
2
2
|
import { getModelContext } from './chunk-Q77J3D2W.js';
|
|
3
|
-
import { Header } from './chunk-
|
|
4
|
-
import { editorFrame, previewTheme, postToEditor, FRAME_LOADED_ACTION } from './chunk-
|
|
5
|
-
import { useDevSettingsOverrides, useDevReportSettingsFetchedAt } from './chunk-
|
|
6
|
-
import { resolveTwilightSdkUrl, TICKETING_SCRIPT_URL } from './chunk-
|
|
3
|
+
import { Header } from './chunk-WC2XULCS.js';
|
|
4
|
+
import { editorFrame, previewTheme, postToEditor, FRAME_LOADED_ACTION } from './chunk-SQAAODYN.js';
|
|
5
|
+
import { useDevSettingsOverrides, useDevReportSettingsFetchedAt } from './chunk-7DNYKCQK.js';
|
|
6
|
+
import { resolveTwilightSdkUrl, TICKETING_SCRIPT_URL } from './chunk-YVFQ46DK.js';
|
|
7
7
|
import { color } from './chunk-VVZNW5CB.js';
|
|
8
8
|
import { applyThemeHookSlots, installAppScope } from './chunk-QJOTD2GJ.js';
|
|
9
|
-
import { apps } from './chunk-
|
|
10
|
-
import { cart, replaceSdkCart } from './chunk-
|
|
9
|
+
import { apps } from './chunk-HGYZPNWO.js';
|
|
10
|
+
import { cart, replaceSdkCart } from './chunk-DGEXG3FP.js';
|
|
11
11
|
import { withOwnerMaintenanceButton, withoutMaintenanceOnPreviewHost } from './chunk-O7JTXTGP.js';
|
|
12
|
-
import { useLocation, useIsHome, NavigationInterceptor } from './chunk-
|
|
13
|
-
import { useUser } from './chunk-
|
|
12
|
+
import { useLocation, useIsHome, NavigationInterceptor } from './chunk-YEER2VOP.js';
|
|
13
|
+
import { useUser } from './chunk-XCYWOZGV.js';
|
|
14
14
|
import { DocumentClassProvider, useDocumentClass } from './chunk-JWXJPJBO.js';
|
|
15
15
|
import { WidgetHead } from './chunk-V2ZDTY6H.js';
|
|
16
16
|
import { HookSlot } from './chunk-5XDPAKF5.js';
|
|
17
17
|
import { hookRegistry } from './chunk-GCPEMNSU.js';
|
|
18
|
-
import { getActiveCurrency, ENGINE_VERSION } from './chunk-
|
|
18
|
+
import { getActiveCurrency, ENGINE_VERSION } from './chunk-3NFN57KF.js';
|
|
19
19
|
import { useTranslation, I18nProvider } from './chunk-TYNZ5B2B.js';
|
|
20
20
|
import { Toaster } from './chunk-AXX7A2JJ.js';
|
|
21
21
|
import { isNativeApp } from './chunk-BZ2QSBXM.js';
|
|
@@ -389,16 +389,16 @@ function useWebMcpSupported() {
|
|
|
389
389
|
}
|
|
390
390
|
var navigationSetups = {
|
|
391
391
|
tanstack: lazyComponent(
|
|
392
|
-
() => import('./navigation-
|
|
392
|
+
() => import('./navigation-EML4VCRE.js').then((m) => ({ default: m.NavigationSetup }))
|
|
393
393
|
),
|
|
394
394
|
// Not preloaded with the rest: a TanStack worker would load Next.js code it never runs.
|
|
395
|
-
nextjs: lazy(() => import('./navigation-
|
|
395
|
+
nextjs: lazy(() => import('./navigation-XTIOGZ5F.js').then((m) => ({ default: m.NavigationSetup })))
|
|
396
396
|
};
|
|
397
397
|
|
|
398
398
|
// src/providers/DocumentSyncRegistry.ts
|
|
399
399
|
var routeDocumentSyncs = {
|
|
400
400
|
tanstack: lazyComponent(
|
|
401
|
-
() => import('./document-class-
|
|
401
|
+
() => import('./document-class-AFX34W3O.js').then((m) => ({
|
|
402
402
|
default: m.TanStackDocumentSync
|
|
403
403
|
}))
|
|
404
404
|
)
|
|
@@ -911,7 +911,7 @@ function injectFastCheckoutScript() {
|
|
|
911
911
|
document.head.appendChild(s);
|
|
912
912
|
}
|
|
913
913
|
var GoogleTagBody = lazyComponent(
|
|
914
|
-
() => import('./GoogleTag-
|
|
914
|
+
() => import('./GoogleTag-YOJ2NCZD.js').then((m) => ({ default: m.GoogleTagBody }))
|
|
915
915
|
);
|
|
916
916
|
var TwilightBundles = lazyComponent(
|
|
917
917
|
() => import('./TwilightBundles-G6GHWBID.js').then((m) => ({ default: m.TwilightBundles }))
|
|
@@ -920,7 +920,7 @@ var LazySiftSnippet = lazyComponent(
|
|
|
920
920
|
() => import('./SiftSnippet-5FCU6TR6.js').then((m) => ({ default: m.SiftSnippet }))
|
|
921
921
|
);
|
|
922
922
|
var LazyStoreClosedNotification = lazyComponent(
|
|
923
|
-
() => import('./StoreClosedNotification-
|
|
923
|
+
() => import('./StoreClosedNotification-BFZYZAPB.js').then((m) => ({
|
|
924
924
|
default: m.StoreClosedNotification
|
|
925
925
|
}))
|
|
926
926
|
);
|
|
@@ -1166,7 +1166,7 @@ function SallaSdkScripts({ settings }) {
|
|
|
1166
1166
|
|
|
1167
1167
|
// src/components/store/lazy.ts
|
|
1168
1168
|
var LazyStoreClosedNotification2 = lazyComponent(
|
|
1169
|
-
() => import('./StoreClosedNotification-
|
|
1169
|
+
() => import('./StoreClosedNotification-BFZYZAPB.js').then((m) => ({
|
|
1170
1170
|
default: m.StoreClosedNotification
|
|
1171
1171
|
}))
|
|
1172
1172
|
);
|
|
@@ -1216,7 +1216,7 @@ function MaintenanceDevBar() {
|
|
|
1216
1216
|
] });
|
|
1217
1217
|
}
|
|
1218
1218
|
var LazyLiveEditorBar = lazyComponent(
|
|
1219
|
-
() => import('./LiveEditorBar-
|
|
1219
|
+
() => import('./LiveEditorBar-NHUTCSF2.js').then((m) => ({ default: m.LiveEditorBar }))
|
|
1220
1220
|
);
|
|
1221
1221
|
function LiveEditor() {
|
|
1222
1222
|
const [frame, setFrame] = useState(null);
|
|
@@ -1236,7 +1236,7 @@ function LiveEditor() {
|
|
|
1236
1236
|
if (!frame) return null;
|
|
1237
1237
|
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyLiveEditorBar, { origin: frame.origin, dev: frame.dev }) });
|
|
1238
1238
|
}
|
|
1239
|
-
var LazyWebMcpTools = React2.lazy(() => import('./WebMcpTools-
|
|
1239
|
+
var LazyWebMcpTools = React2.lazy(() => import('./WebMcpTools-UTSIV5ZJ.js'));
|
|
1240
1240
|
function WebMcpMount() {
|
|
1241
1241
|
if (!useWebMcpSupported()) return null;
|
|
1242
1242
|
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyWebMcpTools, {}) });
|
|
@@ -1528,5 +1528,5 @@ function useStore() {
|
|
|
1528
1528
|
}
|
|
1529
1529
|
|
|
1530
1530
|
export { LazyMaintenancePage, LazyStoreClosedNotification2 as LazyStoreClosedNotification, MasterLayout, TwilightProvider, fastCheckoutScript, registerDefaultHooks, registerDocumentSync, routeDocumentSyncs, useBreadcrumbs, useDate, useGtm, useMoney, useNumber, useOpeningHours, usePageConfig, useStore };
|
|
1531
|
-
//# sourceMappingURL=chunk-
|
|
1532
|
-
//# sourceMappingURL=chunk-
|
|
1531
|
+
//# sourceMappingURL=chunk-SLOGMIWR.js.map
|
|
1532
|
+
//# sourceMappingURL=chunk-SLOGMIWR.js.map
|