@salla.sa/twilight-theme-engine 1.0.0-beta.4
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/README.md +165 -0
- package/dist/AddToCartForm-HOWNKCKX.js +304 -0
- package/dist/AddToCartForm-HOWNKCKX.js.map +1 -0
- package/dist/BlogAuthorPage-W3BZIJHJ.js +101 -0
- package/dist/BlogAuthorPage-W3BZIJHJ.js.map +1 -0
- package/dist/BlogCategoryPage-AIAJ5JBR.js +101 -0
- package/dist/BlogCategoryPage-AIAJ5JBR.js.map +1 -0
- package/dist/BlogPage-4BYF2EQW.js +190 -0
- package/dist/BlogPage-4BYF2EQW.js.map +1 -0
- package/dist/BlogSinglePage-AMNAUMWW.js +187 -0
- package/dist/BlogSinglePage-AMNAUMWW.js.map +1 -0
- package/dist/BlogTagPage-ELG2H5N5.js +101 -0
- package/dist/BlogTagPage-ELG2H5N5.js.map +1 -0
- package/dist/BrandsPage-ZSO3PYAV.js +127 -0
- package/dist/BrandsPage-ZSO3PYAV.js.map +1 -0
- package/dist/Breadcrumb-N32QFMVK.js +152 -0
- package/dist/Breadcrumb-N32QFMVK.js.map +1 -0
- package/dist/CartItem-SGTGOTEC.js +171 -0
- package/dist/CartItem-SGTGOTEC.js.map +1 -0
- package/dist/CartSummary-OKDGVSX2.js +236 -0
- package/dist/CartSummary-OKDGVSX2.js.map +1 -0
- package/dist/Copyright-F3HLYXFJ.js +9 -0
- package/dist/Copyright-F3HLYXFJ.js.map +1 -0
- package/dist/CurrencySymbol-TARAYUOT.js +11 -0
- package/dist/CurrencySymbol-TARAYUOT.js.map +1 -0
- package/dist/CustomerLayout-LB4E2LHT.js +68 -0
- package/dist/CustomerLayout-LB4E2LHT.js.map +1 -0
- package/dist/ErrorPage-TK4U3ENF.js +6 -0
- package/dist/ErrorPage-TK4U3ENF.js.map +1 -0
- package/dist/Footer-UVCSKTW3.js +39 -0
- package/dist/Footer-UVCSKTW3.js.map +1 -0
- package/dist/GoogleTag-4LHWC365.js +52 -0
- package/dist/GoogleTag-4LHWC365.js.map +1 -0
- package/dist/Header-BF6SPZJC.js +15 -0
- package/dist/Header-BF6SPZJC.js.map +1 -0
- package/dist/ImageModal-WLJM3WIE.js +41 -0
- package/dist/ImageModal-WLJM3WIE.js.map +1 -0
- package/dist/LoyaltyPage-X4PHPUFC.js +188 -0
- package/dist/LoyaltyPage-X4PHPUFC.js.map +1 -0
- package/dist/MainMenu-R3EWTNNC.js +91 -0
- package/dist/MainMenu-R3EWTNNC.js.map +1 -0
- package/dist/MasterLayout-5JLM7IMW.js +39 -0
- package/dist/MasterLayout-5JLM7IMW.js.map +1 -0
- package/dist/MobileMenu-QXESUQXC.js +175 -0
- package/dist/MobileMenu-QXESUQXC.js.map +1 -0
- package/dist/NoContent-PBGESHBJ.js +21 -0
- package/dist/NoContent-PBGESHBJ.js.map +1 -0
- package/dist/NotificationsPage-V6UIPDJD.js +84 -0
- package/dist/NotificationsPage-V6UIPDJD.js.map +1 -0
- package/dist/OrderSinglePage-ZMEKPLE3.js +441 -0
- package/dist/OrderSinglePage-ZMEKPLE3.js.map +1 -0
- package/dist/OrdersPage-EAATVPYK.js +184 -0
- package/dist/OrdersPage-EAATVPYK.js.map +1 -0
- package/dist/PageSingle-Y6ARZ5LS.js +28 -0
- package/dist/PageSingle-Y6ARZ5LS.js.map +1 -0
- package/dist/PreOrderNotification-ZVTGNV7K.js +23 -0
- package/dist/PreOrderNotification-ZVTGNV7K.js.map +1 -0
- package/dist/PriceQuoteButton-RAAPL4N4.js +26 -0
- package/dist/PriceQuoteButton-RAAPL4N4.js.map +1 -0
- package/dist/ProductDetails-KTY4ZSFM.js +194 -0
- package/dist/ProductDetails-KTY4ZSFM.js.map +1 -0
- package/dist/ProfilePage-6SK34MDJ.js +64 -0
- package/dist/ProfilePage-6SK34MDJ.js.map +1 -0
- package/dist/RenderWhenVisible-TR7G2KUC.js +50 -0
- package/dist/RenderWhenVisible-TR7G2KUC.js.map +1 -0
- package/dist/SeoCartWidget-XF4GEJK7.js +109 -0
- package/dist/SeoCartWidget-XF4GEJK7.js.map +1 -0
- package/dist/SettingsPage-DPYARBPO.js +51 -0
- package/dist/SettingsPage-DPYARBPO.js.map +1 -0
- package/dist/SiftSnippet-X74S5KDO.js +29 -0
- package/dist/SiftSnippet-X74S5KDO.js.map +1 -0
- package/dist/StoreClosedNotification-KSB2GPEZ.js +91 -0
- package/dist/StoreClosedNotification-KSB2GPEZ.js.map +1 -0
- package/dist/Testimonials-MZCVP66E.js +26 -0
- package/dist/Testimonials-MZCVP66E.js.map +1 -0
- package/dist/TestimonialsPage-4OFS5Z4V.js +77 -0
- package/dist/TestimonialsPage-4OFS5Z4V.js.map +1 -0
- package/dist/ThankYouPage-C7PA3RJP.js +236 -0
- package/dist/ThankYouPage-C7PA3RJP.js.map +1 -0
- package/dist/TwilightBundles-5F2H75VV.js +46 -0
- package/dist/TwilightBundles-5F2H75VV.js.map +1 -0
- package/dist/WalletPage-66XGZKO7.js +189 -0
- package/dist/WalletPage-66XGZKO7.js.map +1 -0
- package/dist/WidgetHead-FXEPCB23.js +7 -0
- package/dist/WidgetHead-FXEPCB23.js.map +1 -0
- package/dist/WishlistPage-7ZZYHBSZ.js +144 -0
- package/dist/WishlistPage-7ZZYHBSZ.js.map +1 -0
- package/dist/ambient/salla-components.d.ts +312 -0
- package/dist/ambient/virtual-modules.d.ts +22 -0
- package/dist/api/apps.d.ts +28 -0
- package/dist/api/apps.d.ts.map +1 -0
- package/dist/api/apps.js +26 -0
- package/dist/api/apps.js.map +1 -0
- package/dist/api/blog.d.ts +61 -0
- package/dist/api/blog.d.ts.map +1 -0
- package/dist/api/brands.d.ts +25 -0
- package/dist/api/brands.d.ts.map +1 -0
- package/dist/api/brands.js +40 -0
- package/dist/api/brands.js.map +1 -0
- package/dist/api/cart.d.ts +21 -0
- package/dist/api/cart.d.ts.map +1 -0
- package/dist/api/cart.js +40 -0
- package/dist/api/cart.js.map +1 -0
- package/dist/api/category.d.ts +31 -0
- package/dist/api/category.d.ts.map +1 -0
- package/dist/api/category.js +40 -0
- package/dist/api/category.js.map +1 -0
- package/dist/api/client.d.ts +17 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +7 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/home.d.ts +15 -0
- package/dist/api/home.d.ts.map +1 -0
- package/dist/api/home.js +8 -0
- package/dist/api/home.js.map +1 -0
- package/dist/api/loyalty.d.ts +25 -0
- package/dist/api/loyalty.d.ts.map +1 -0
- package/dist/api/loyalty.js +40 -0
- package/dist/api/loyalty.js.map +1 -0
- package/dist/api/menu.d.ts +16 -0
- package/dist/api/menu.d.ts.map +1 -0
- package/dist/api/menu.js +8 -0
- package/dist/api/menu.js.map +1 -0
- package/dist/api/notification.d.ts +26 -0
- package/dist/api/notification.d.ts.map +1 -0
- package/dist/api/order.d.ts +74 -0
- package/dist/api/order.d.ts.map +1 -0
- package/dist/api/order.js +40 -0
- package/dist/api/order.js.map +1 -0
- package/dist/api/page.d.ts +16 -0
- package/dist/api/page.d.ts.map +1 -0
- package/dist/api/page.js +40 -0
- package/dist/api/page.js.map +1 -0
- package/dist/api/product.d.ts +80 -0
- package/dist/api/product.d.ts.map +1 -0
- package/dist/api/product.js +40 -0
- package/dist/api/product.js.map +1 -0
- package/dist/api/profile.d.ts +9 -0
- package/dist/api/profile.d.ts.map +1 -0
- package/dist/api/profile.js +23 -0
- package/dist/api/profile.js.map +1 -0
- package/dist/api/store.d.ts +46 -0
- package/dist/api/store.d.ts.map +1 -0
- package/dist/api/store.js +8 -0
- package/dist/api/store.js.map +1 -0
- package/dist/api/translations.d.ts +15 -0
- package/dist/api/translations.d.ts.map +1 -0
- package/dist/api/translations.js +8 -0
- package/dist/api/translations.js.map +1 -0
- package/dist/api/types.d.ts +54 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +3 -0
- package/dist/api/types.js.map +1 -0
- package/dist/api/user.d.ts +15 -0
- package/dist/api/user.d.ts.map +1 -0
- package/dist/api/user.js +8 -0
- package/dist/api/user.js.map +1 -0
- package/dist/api/wallet.d.ts +30 -0
- package/dist/api/wallet.d.ts.map +1 -0
- package/dist/api/wishlist.d.ts +25 -0
- package/dist/api/wishlist.d.ts.map +1 -0
- package/dist/chunk-25SSLQAJ.js +67 -0
- package/dist/chunk-25SSLQAJ.js.map +1 -0
- package/dist/chunk-2FU6CVSB.js +18 -0
- package/dist/chunk-2FU6CVSB.js.map +1 -0
- package/dist/chunk-2KF5JJU6.js +169 -0
- package/dist/chunk-2KF5JJU6.js.map +1 -0
- package/dist/chunk-2TB2LTL2.js +103 -0
- package/dist/chunk-2TB2LTL2.js.map +1 -0
- package/dist/chunk-3DCZJDDK.js +10 -0
- package/dist/chunk-3DCZJDDK.js.map +1 -0
- package/dist/chunk-3UHSMGPY.js +145 -0
- package/dist/chunk-3UHSMGPY.js.map +1 -0
- package/dist/chunk-4EQEYRZ7.js +65 -0
- package/dist/chunk-4EQEYRZ7.js.map +1 -0
- package/dist/chunk-562ZMVI3.js +592 -0
- package/dist/chunk-562ZMVI3.js.map +1 -0
- package/dist/chunk-5Q6PFLDN.js +20 -0
- package/dist/chunk-5Q6PFLDN.js.map +1 -0
- package/dist/chunk-6B6VCCMC.js +28 -0
- package/dist/chunk-6B6VCCMC.js.map +1 -0
- package/dist/chunk-6BZ5TKEV.js +44 -0
- package/dist/chunk-6BZ5TKEV.js.map +1 -0
- package/dist/chunk-6NBBXERE.js +24 -0
- package/dist/chunk-6NBBXERE.js.map +1 -0
- package/dist/chunk-6Q5BFHFA.js +88 -0
- package/dist/chunk-6Q5BFHFA.js.map +1 -0
- package/dist/chunk-6YX4RS55.js +33 -0
- package/dist/chunk-6YX4RS55.js.map +1 -0
- package/dist/chunk-7LP7D75V.js +14 -0
- package/dist/chunk-7LP7D75V.js.map +1 -0
- package/dist/chunk-A5ZRUAMT.js +16 -0
- package/dist/chunk-A5ZRUAMT.js.map +1 -0
- package/dist/chunk-B3EFOE57.js +32 -0
- package/dist/chunk-B3EFOE57.js.map +1 -0
- package/dist/chunk-BT6HEEAP.js +31 -0
- package/dist/chunk-BT6HEEAP.js.map +1 -0
- package/dist/chunk-BVSJPBJ6.js +26 -0
- package/dist/chunk-BVSJPBJ6.js.map +1 -0
- package/dist/chunk-BWFBVXT3.js +13 -0
- package/dist/chunk-BWFBVXT3.js.map +1 -0
- package/dist/chunk-CW625T2E.js +62 -0
- package/dist/chunk-CW625T2E.js.map +1 -0
- package/dist/chunk-DFMO5KBU.js +67 -0
- package/dist/chunk-DFMO5KBU.js.map +1 -0
- package/dist/chunk-DGUM43GV.js +10 -0
- package/dist/chunk-DGUM43GV.js.map +1 -0
- package/dist/chunk-EQ5ZGAVR.js +89 -0
- package/dist/chunk-EQ5ZGAVR.js.map +1 -0
- package/dist/chunk-FBFPH5BB.js +34 -0
- package/dist/chunk-FBFPH5BB.js.map +1 -0
- package/dist/chunk-G7ALL4BC.js +52 -0
- package/dist/chunk-G7ALL4BC.js.map +1 -0
- package/dist/chunk-GBWCXUPD.js +99 -0
- package/dist/chunk-GBWCXUPD.js.map +1 -0
- package/dist/chunk-GLM3RPCP.js +1167 -0
- package/dist/chunk-GLM3RPCP.js.map +1 -0
- package/dist/chunk-GN34LCTG.js +92 -0
- package/dist/chunk-GN34LCTG.js.map +1 -0
- package/dist/chunk-GO34DE35.js +247 -0
- package/dist/chunk-GO34DE35.js.map +1 -0
- package/dist/chunk-HOSHJBPS.js +52 -0
- package/dist/chunk-HOSHJBPS.js.map +1 -0
- package/dist/chunk-I5Z4NJBB.js +17 -0
- package/dist/chunk-I5Z4NJBB.js.map +1 -0
- package/dist/chunk-J37AYLWL.js +66 -0
- package/dist/chunk-J37AYLWL.js.map +1 -0
- package/dist/chunk-KCKHA75V.js +19 -0
- package/dist/chunk-KCKHA75V.js.map +1 -0
- package/dist/chunk-KIPZQN3Y.js +158 -0
- package/dist/chunk-KIPZQN3Y.js.map +1 -0
- package/dist/chunk-LBUMC5PB.js +34 -0
- package/dist/chunk-LBUMC5PB.js.map +1 -0
- package/dist/chunk-LSDIFHXZ.js +80 -0
- package/dist/chunk-LSDIFHXZ.js.map +1 -0
- package/dist/chunk-M6ICEIWY.js +25 -0
- package/dist/chunk-M6ICEIWY.js.map +1 -0
- package/dist/chunk-MTONGOJD.js +42 -0
- package/dist/chunk-MTONGOJD.js.map +1 -0
- package/dist/chunk-MXQCE3KA.js +173 -0
- package/dist/chunk-MXQCE3KA.js.map +1 -0
- package/dist/chunk-N5RSKJP4.js +65 -0
- package/dist/chunk-N5RSKJP4.js.map +1 -0
- package/dist/chunk-N7CCSGZF.js +3 -0
- package/dist/chunk-N7CCSGZF.js.map +1 -0
- package/dist/chunk-NBHI5X36.js +27 -0
- package/dist/chunk-NBHI5X36.js.map +1 -0
- package/dist/chunk-NSX6XPDU.js +673 -0
- package/dist/chunk-NSX6XPDU.js.map +1 -0
- package/dist/chunk-O2UOV5RK.js +32 -0
- package/dist/chunk-O2UOV5RK.js.map +1 -0
- package/dist/chunk-OZTGUF7K.js +66 -0
- package/dist/chunk-OZTGUF7K.js.map +1 -0
- package/dist/chunk-Q3VACSSR.js +21 -0
- package/dist/chunk-Q3VACSSR.js.map +1 -0
- package/dist/chunk-QTDGM2SO.js +123 -0
- package/dist/chunk-QTDGM2SO.js.map +1 -0
- package/dist/chunk-QYL5OHAV.js +70 -0
- package/dist/chunk-QYL5OHAV.js.map +1 -0
- package/dist/chunk-RH32IGQD.js +372 -0
- package/dist/chunk-RH32IGQD.js.map +1 -0
- package/dist/chunk-RUHSV4Z6.js +12 -0
- package/dist/chunk-RUHSV4Z6.js.map +1 -0
- package/dist/chunk-RYBA3JDM.js +33 -0
- package/dist/chunk-RYBA3JDM.js.map +1 -0
- package/dist/chunk-SBIXBX6J.js +29 -0
- package/dist/chunk-SBIXBX6J.js.map +1 -0
- package/dist/chunk-SSRNIBVV.js +75 -0
- package/dist/chunk-SSRNIBVV.js.map +1 -0
- package/dist/chunk-SVZOWI7E.js +51 -0
- package/dist/chunk-SVZOWI7E.js.map +1 -0
- package/dist/chunk-SYHTMNYF.js +89 -0
- package/dist/chunk-SYHTMNYF.js.map +1 -0
- package/dist/chunk-T72DAX7R.js +65 -0
- package/dist/chunk-T72DAX7R.js.map +1 -0
- package/dist/chunk-TCSNNCRH.js +23 -0
- package/dist/chunk-TCSNNCRH.js.map +1 -0
- package/dist/chunk-TQLEQSXE.js +48 -0
- package/dist/chunk-TQLEQSXE.js.map +1 -0
- package/dist/chunk-TRUQDEMI.js +14 -0
- package/dist/chunk-TRUQDEMI.js.map +1 -0
- package/dist/chunk-TZ3E5BN4.js +91 -0
- package/dist/chunk-TZ3E5BN4.js.map +1 -0
- package/dist/chunk-TZ4YD5CU.js +16 -0
- package/dist/chunk-TZ4YD5CU.js.map +1 -0
- package/dist/chunk-U7HAK5U7.js +105 -0
- package/dist/chunk-U7HAK5U7.js.map +1 -0
- package/dist/chunk-UE3BUFZI.js +16 -0
- package/dist/chunk-UE3BUFZI.js.map +1 -0
- package/dist/chunk-UIX3W2PN.js +56 -0
- package/dist/chunk-UIX3W2PN.js.map +1 -0
- package/dist/chunk-VVRYP6IL.js +61 -0
- package/dist/chunk-VVRYP6IL.js.map +1 -0
- package/dist/chunk-VVZNW5CB.js +49 -0
- package/dist/chunk-VVZNW5CB.js.map +1 -0
- package/dist/chunk-XHGF75TM.js +133 -0
- package/dist/chunk-XHGF75TM.js.map +1 -0
- package/dist/chunk-XUI3TRXF.js +26 -0
- package/dist/chunk-XUI3TRXF.js.map +1 -0
- package/dist/chunk-YCYTBRYB.js +30 -0
- package/dist/chunk-YCYTBRYB.js.map +1 -0
- package/dist/chunk-YMVLYYLU.js +25 -0
- package/dist/chunk-YMVLYYLU.js.map +1 -0
- package/dist/chunk-Z653O7MX.js +10 -0
- package/dist/chunk-Z653O7MX.js.map +1 -0
- package/dist/chunk-ZCH7W7DZ.js +30 -0
- package/dist/chunk-ZCH7W7DZ.js.map +1 -0
- package/dist/components/Component.d.ts +8 -0
- package/dist/components/Component.d.ts.map +1 -0
- package/dist/components/ComponentRegistry.d.ts +19 -0
- package/dist/components/ComponentRegistry.d.ts.map +1 -0
- package/dist/components/cart/CartItem.d.ts +8 -0
- package/dist/components/cart/CartItem.d.ts.map +1 -0
- package/dist/components/cart/CartSummary.d.ts +12 -0
- package/dist/components/cart/CartSummary.d.ts.map +1 -0
- package/dist/components/cart/PreOrderNotification.d.ts +2 -0
- package/dist/components/cart/PreOrderNotification.d.ts.map +1 -0
- package/dist/components/cart/PriceQuoteButton.d.ts +2 -0
- package/dist/components/cart/PriceQuoteButton.d.ts.map +1 -0
- package/dist/components/cart/SeoCartWidget.d.ts +34 -0
- package/dist/components/cart/SeoCartWidget.d.ts.map +1 -0
- package/dist/components/cart/index.d.ts +4 -0
- package/dist/components/cart/index.d.ts.map +1 -0
- package/dist/components/cart/index.js +4 -0
- package/dist/components/cart/index.js.map +1 -0
- package/dist/components/cart/lazy.d.ts +8 -0
- package/dist/components/cart/lazy.d.ts.map +1 -0
- package/dist/components/collapse/Collapse.d.ts +51 -0
- package/dist/components/collapse/Collapse.d.ts.map +1 -0
- package/dist/components/collapse/index.d.ts +36 -0
- package/dist/components/collapse/index.d.ts.map +1 -0
- package/dist/components/collapse/index.js +44 -0
- package/dist/components/collapse/index.js.map +1 -0
- package/dist/components/common/Breadcrumb.d.ts +7 -0
- package/dist/components/common/Breadcrumb.d.ts.map +1 -0
- package/dist/components/common/BreadcrumbJsonLd.d.ts +8 -0
- package/dist/components/common/BreadcrumbJsonLd.d.ts.map +1 -0
- package/dist/components/common/BreadcrumbTrail.d.ts +8 -0
- package/dist/components/common/BreadcrumbTrail.d.ts.map +1 -0
- package/dist/components/common/CurrencySymbol.d.ts +8 -0
- package/dist/components/common/CurrencySymbol.d.ts.map +1 -0
- package/dist/components/common/DeferredData.d.ts +20 -0
- package/dist/components/common/DeferredData.d.ts.map +1 -0
- package/dist/components/common/ErrorPage.d.ts +18 -0
- package/dist/components/common/ErrorPage.d.ts.map +1 -0
- package/dist/components/common/Image.d.ts +28 -0
- package/dist/components/common/Image.d.ts.map +1 -0
- package/dist/components/common/Link.d.ts +21 -0
- package/dist/components/common/Link.d.ts.map +1 -0
- package/dist/components/common/Link.types.d.ts +82 -0
- package/dist/components/common/Link.types.d.ts.map +1 -0
- package/dist/components/common/NoContent.d.ts +9 -0
- package/dist/components/common/NoContent.d.ts.map +1 -0
- package/dist/components/common/RenderWhenVisible.d.ts +23 -0
- package/dist/components/common/RenderWhenVisible.d.ts.map +1 -0
- package/dist/components/common/index.d.ts +11 -0
- package/dist/components/common/index.d.ts.map +1 -0
- package/dist/components/common/index.js +6 -0
- package/dist/components/common/index.js.map +1 -0
- package/dist/components/common/lazy.d.ts +13 -0
- package/dist/components/common/lazy.d.ts.map +1 -0
- package/dist/components/common/types.d.ts +7 -0
- package/dist/components/common/types.d.ts.map +1 -0
- package/dist/components/defineComponent.d.ts +11 -0
- package/dist/components/defineComponent.d.ts.map +1 -0
- package/dist/components/drawer/Drawer.d.ts +53 -0
- package/dist/components/drawer/Drawer.d.ts.map +1 -0
- package/dist/components/drawer/index.d.ts +32 -0
- package/dist/components/drawer/index.d.ts.map +1 -0
- package/dist/components/drawer/index.js +40 -0
- package/dist/components/drawer/index.js.map +1 -0
- package/dist/components/dropdown/Dropdown.d.ts +63 -0
- package/dist/components/dropdown/Dropdown.d.ts.map +1 -0
- package/dist/components/dropdown/index.d.ts +34 -0
- package/dist/components/dropdown/index.d.ts.map +1 -0
- package/dist/components/dropdown/index.js +67 -0
- package/dist/components/dropdown/index.js.map +1 -0
- package/dist/components/home/BundleComponent.d.ts +9 -0
- package/dist/components/home/BundleComponent.d.ts.map +1 -0
- package/dist/components/home/ComponentErrorBoundary.d.ts +22 -0
- package/dist/components/home/ComponentErrorBoundary.d.ts.map +1 -0
- package/dist/components/home/FeaturedProductsStyle1.d.ts +26 -0
- package/dist/components/home/FeaturedProductsStyle1.d.ts.map +1 -0
- package/dist/components/home/FeaturedProductsStyle2.d.ts +25 -0
- package/dist/components/home/FeaturedProductsStyle2.d.ts.map +1 -0
- package/dist/components/home/FeaturedProductsStyle3.d.ts +20 -0
- package/dist/components/home/FeaturedProductsStyle3.d.ts.map +1 -0
- package/dist/components/home/FixedBanner.d.ts +16 -0
- package/dist/components/home/FixedBanner.d.ts.map +1 -0
- package/dist/components/home/FixedProducts.d.ts +18 -0
- package/dist/components/home/FixedProducts.d.ts.map +1 -0
- package/dist/components/home/HomePageRenderer.d.ts +37 -0
- package/dist/components/home/HomePageRenderer.d.ts.map +1 -0
- package/dist/components/home/ParallaxBackground.d.ts +17 -0
- package/dist/components/home/ParallaxBackground.d.ts.map +1 -0
- package/dist/components/home/PhotosSlider.d.ts +16 -0
- package/dist/components/home/PhotosSlider.d.ts.map +1 -0
- package/dist/components/home/ProductsSlider.d.ts +25 -0
- package/dist/components/home/ProductsSlider.d.ts.map +1 -0
- package/dist/components/home/SquarePhotos.d.ts +21 -0
- package/dist/components/home/SquarePhotos.d.ts.map +1 -0
- package/dist/components/home/StoreFeatures.d.ts +9 -0
- package/dist/components/home/StoreFeatures.d.ts.map +1 -0
- package/dist/components/home/Testimonials.d.ts +15 -0
- package/dist/components/home/Testimonials.d.ts.map +1 -0
- package/dist/components/home/Youtube.d.ts +9 -0
- package/dist/components/home/Youtube.d.ts.map +1 -0
- package/dist/components/home/index.d.ts +9 -0
- package/dist/components/home/index.d.ts.map +1 -0
- package/dist/components/home/index.js +43 -0
- package/dist/components/home/index.js.map +1 -0
- package/dist/components/home/lazy.d.ts +14 -0
- package/dist/components/home/lazy.d.ts.map +1 -0
- package/dist/components/home/register.d.ts +4 -0
- package/dist/components/home/register.d.ts.map +1 -0
- package/dist/components/home/types.d.ts +6 -0
- package/dist/components/home/types.d.ts.map +1 -0
- package/dist/components/layout/Copyright.d.ts +8 -0
- package/dist/components/layout/Copyright.d.ts.map +1 -0
- package/dist/components/layout/CustomerLayout.d.ts +8 -0
- package/dist/components/layout/CustomerLayout.d.ts.map +1 -0
- package/dist/components/layout/Footer.d.ts +2 -0
- package/dist/components/layout/Footer.d.ts.map +1 -0
- package/dist/components/layout/Header.d.ts +7 -0
- package/dist/components/layout/Header.d.ts.map +1 -0
- package/dist/components/layout/MasterLayout.d.ts +3 -0
- package/dist/components/layout/MasterLayout.d.ts.map +1 -0
- package/dist/components/layout/WidgetHead.d.ts +21 -0
- package/dist/components/layout/WidgetHead.d.ts.map +1 -0
- package/dist/components/layout/index.d.ts +5 -0
- package/dist/components/layout/index.d.ts.map +1 -0
- package/dist/components/layout/index.js +25 -0
- package/dist/components/layout/index.js.map +1 -0
- package/dist/components/layout/lazy.d.ts +11 -0
- package/dist/components/layout/lazy.d.ts.map +1 -0
- package/dist/components/layout/types.d.ts +10 -0
- package/dist/components/layout/types.d.ts.map +1 -0
- package/dist/components/modal/ImageModal.d.ts +37 -0
- package/dist/components/modal/ImageModal.d.ts.map +1 -0
- package/dist/components/modal/Modal.d.ts +78 -0
- package/dist/components/modal/Modal.d.ts.map +1 -0
- package/dist/components/modal/index.d.ts +30 -0
- package/dist/components/modal/index.d.ts.map +1 -0
- package/dist/components/modal/index.js +5 -0
- package/dist/components/modal/index.js.map +1 -0
- package/dist/components/modal/lazy.d.ts +7 -0
- package/dist/components/modal/lazy.d.ts.map +1 -0
- package/dist/components/navigation/MainMenu.d.ts +2 -0
- package/dist/components/navigation/MainMenu.d.ts.map +1 -0
- package/dist/components/navigation/MobileMenu.d.ts +6 -0
- package/dist/components/navigation/MobileMenu.d.ts.map +1 -0
- package/dist/components/navigation/index.d.ts +3 -0
- package/dist/components/navigation/index.d.ts.map +1 -0
- package/dist/components/navigation/lazy.d.ts +7 -0
- package/dist/components/navigation/lazy.d.ts.map +1 -0
- package/dist/components/product/AddToCartForm.d.ts +12 -0
- package/dist/components/product/AddToCartForm.d.ts.map +1 -0
- package/dist/components/product/ProductCard.d.ts +16 -0
- package/dist/components/product/ProductCard.d.ts.map +1 -0
- package/dist/components/product/ProductDetails.d.ts +8 -0
- package/dist/components/product/ProductDetails.d.ts.map +1 -0
- package/dist/components/product/ProductGallery.d.ts +7 -0
- package/dist/components/product/ProductGallery.d.ts.map +1 -0
- package/dist/components/product/index.d.ts +8 -0
- package/dist/components/product/index.d.ts.map +1 -0
- package/dist/components/product/index.js +41 -0
- package/dist/components/product/index.js.map +1 -0
- package/dist/components/product/lazy.d.ts +3 -0
- package/dist/components/product/lazy.d.ts.map +1 -0
- package/dist/components/store/StoreClosedNotification.d.ts +17 -0
- package/dist/components/store/StoreClosedNotification.d.ts.map +1 -0
- package/dist/components/store/index.d.ts +3 -0
- package/dist/components/store/index.d.ts.map +1 -0
- package/dist/components/store/lazy.d.ts +3 -0
- package/dist/components/store/lazy.d.ts.map +1 -0
- package/dist/components/toast/Toaster.d.ts +8 -0
- package/dist/components/toast/Toaster.d.ts.map +1 -0
- package/dist/components/toast/index.d.ts +4 -0
- package/dist/components/toast/index.d.ts.map +1 -0
- package/dist/components/toast/index.js +5 -0
- package/dist/components/toast/index.js.map +1 -0
- package/dist/components/toast/types.d.ts +27 -0
- package/dist/components/toast/types.d.ts.map +1 -0
- package/dist/components/toast/useToast.d.ts +5 -0
- package/dist/components/toast/useToast.d.ts.map +1 -0
- package/dist/components/tracking/GoogleTag.d.ts +13 -0
- package/dist/components/tracking/GoogleTag.d.ts.map +1 -0
- package/dist/components/tracking/SiftSnippet.d.ts +16 -0
- package/dist/components/tracking/SiftSnippet.d.ts.map +1 -0
- package/dist/components/tracking/TwilightBundles.d.ts +11 -0
- package/dist/components/tracking/TwilightBundles.d.ts.map +1 -0
- package/dist/components/tracking/index.d.ts +5 -0
- package/dist/components/tracking/index.d.ts.map +1 -0
- package/dist/components/tracking/lazy.d.ts +5 -0
- package/dist/components/tracking/lazy.d.ts.map +1 -0
- package/dist/components/useComponent.d.ts +4 -0
- package/dist/components/useComponent.d.ts.map +1 -0
- package/dist/contexts/CartContext.d.ts +34 -0
- package/dist/contexts/CartContext.d.ts.map +1 -0
- package/dist/contexts/ProductContext.d.ts +34 -0
- package/dist/contexts/ProductContext.d.ts.map +1 -0
- package/dist/contexts/index.d.ts +3 -0
- package/dist/contexts/index.d.ts.map +1 -0
- package/dist/document-class-PLK3HUM6.js +21 -0
- package/dist/document-class-PLK3HUM6.js.map +1 -0
- package/dist/dom/document.d.ts +26 -0
- package/dist/dom/document.d.ts.map +1 -0
- package/dist/dom/index.d.ts +24 -0
- package/dist/dom/index.d.ts.map +1 -0
- package/dist/dom.d.ts +1 -0
- package/dist/dom.js +18 -0
- package/dist/dom.js.map +1 -0
- package/dist/eslint/index.d.ts +17 -0
- package/dist/eslint/index.d.ts.map +1 -0
- package/dist/eslint/index.js +86 -0
- package/dist/eslint/index.js.map +1 -0
- package/dist/hooks/HookRegistry.d.ts +47 -0
- package/dist/hooks/HookRegistry.d.ts.map +1 -0
- package/dist/hooks/HookRegistry.js +4 -0
- package/dist/hooks/HookRegistry.js.map +1 -0
- package/dist/hooks/HookSlot.d.ts +96 -0
- package/dist/hooks/HookSlot.d.ts.map +1 -0
- package/dist/hooks/HookSlot.js +6 -0
- package/dist/hooks/HookSlot.js.map +1 -0
- package/dist/hooks/index.d.ts +27 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +39 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/registerDefaultHooks.d.ts +18 -0
- package/dist/hooks/registerDefaultHooks.d.ts.map +1 -0
- package/dist/hooks/types.d.ts +100 -0
- package/dist/hooks/types.d.ts.map +1 -0
- package/dist/hooks/useAsset.d.ts +26 -0
- package/dist/hooks/useAsset.d.ts.map +1 -0
- package/dist/hooks/useAsset.js +5 -0
- package/dist/hooks/useAsset.js.map +1 -0
- package/dist/hooks/useAsyncFn.d.ts +68 -0
- package/dist/hooks/useAsyncFn.d.ts.map +1 -0
- package/dist/hooks/useAsyncFn.js +4 -0
- package/dist/hooks/useAsyncFn.js.map +1 -0
- package/dist/hooks/useBlogLike.d.ts +7 -0
- package/dist/hooks/useBlogLike.d.ts.map +1 -0
- package/dist/hooks/useBlogLike.js +7 -0
- package/dist/hooks/useBlogLike.js.map +1 -0
- package/dist/hooks/useBreadcrumbs.d.ts +3 -0
- package/dist/hooks/useBreadcrumbs.d.ts.map +1 -0
- package/dist/hooks/useComments.d.ts +36 -0
- package/dist/hooks/useComments.d.ts.map +1 -0
- package/dist/hooks/useComments.js +4 -0
- package/dist/hooks/useComments.js.map +1 -0
- package/dist/hooks/useCoupon.d.ts +66 -0
- package/dist/hooks/useCoupon.d.ts.map +1 -0
- package/dist/hooks/useCoupon.js +5 -0
- package/dist/hooks/useCoupon.js.map +1 -0
- package/dist/hooks/useDate.d.ts +24 -0
- package/dist/hooks/useDate.d.ts.map +1 -0
- package/dist/hooks/useDocumentClass.d.ts +42 -0
- package/dist/hooks/useDocumentClass.d.ts.map +1 -0
- package/dist/hooks/useDocumentClass.js +5 -0
- package/dist/hooks/useDocumentClass.js.map +1 -0
- package/dist/hooks/useGtm.d.ts +38 -0
- package/dist/hooks/useGtm.d.ts.map +1 -0
- package/dist/hooks/useHook.d.ts +24 -0
- package/dist/hooks/useHook.d.ts.map +1 -0
- package/dist/hooks/useHook.js +5 -0
- package/dist/hooks/useHook.js.map +1 -0
- package/dist/hooks/useIsClient.d.ts +7 -0
- package/dist/hooks/useIsClient.d.ts.map +1 -0
- package/dist/hooks/useMoney.d.ts +26 -0
- package/dist/hooks/useMoney.d.ts.map +1 -0
- package/dist/hooks/useMoney.js +39 -0
- package/dist/hooks/useMoney.js.map +1 -0
- package/dist/hooks/useNumber.d.ts +24 -0
- package/dist/hooks/useNumber.d.ts.map +1 -0
- package/dist/hooks/useOpeningHours.d.ts +28 -0
- package/dist/hooks/useOpeningHours.d.ts.map +1 -0
- package/dist/hooks/usePageConfig.d.ts +44 -0
- package/dist/hooks/usePageConfig.d.ts.map +1 -0
- package/dist/hooks/useProduct.d.ts +47 -0
- package/dist/hooks/useProduct.d.ts.map +1 -0
- package/dist/hooks/useProduct.js +4 -0
- package/dist/hooks/useProduct.js.map +1 -0
- package/dist/hooks/useStore.d.ts +36 -0
- package/dist/hooks/useStore.d.ts.map +1 -0
- package/dist/hooks/useStore.js +39 -0
- package/dist/hooks/useStore.js.map +1 -0
- package/dist/hooks/useTheme.d.ts +41 -0
- package/dist/hooks/useTheme.d.ts.map +1 -0
- package/dist/hooks/useTheme.js +5 -0
- package/dist/hooks/useTheme.js.map +1 -0
- package/dist/hooks/useUser.d.ts +8 -0
- package/dist/hooks/useUser.d.ts.map +1 -0
- package/dist/hooks/useUser.js +9 -0
- package/dist/hooks/useUser.js.map +1 -0
- package/dist/hooks/useWishlist.d.ts +5 -0
- package/dist/hooks/useWishlist.d.ts.map +1 -0
- package/dist/hooks/useWishlist.js +5 -0
- package/dist/hooks/useWishlist.js.map +1 -0
- package/dist/i18n.d.ts +1 -0
- package/dist/i18n.js +5 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +83 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/analytics/gtm.d.ts +38 -0
- package/dist/lib/analytics/gtm.d.ts.map +1 -0
- package/dist/lib/services/index.d.ts +1 -0
- package/dist/lib/services/index.d.ts.map +1 -0
- package/dist/navigation-N4H65RUN.js +17 -0
- package/dist/navigation-N4H65RUN.js.map +1 -0
- package/dist/navigation-YCYHW4MK.js +10 -0
- package/dist/navigation-YCYHW4MK.js.map +1 -0
- package/dist/nextjs/document-class.d.ts +92 -0
- package/dist/nextjs/document-class.d.ts.map +1 -0
- package/dist/nextjs/head.d.ts +36 -0
- package/dist/nextjs/head.d.ts.map +1 -0
- package/dist/nextjs/index.d.ts +29 -0
- package/dist/nextjs/index.d.ts.map +1 -0
- package/dist/nextjs/link.d.ts +14 -0
- package/dist/nextjs/link.d.ts.map +1 -0
- package/dist/nextjs/navigation.d.ts +9 -0
- package/dist/nextjs/navigation.d.ts.map +1 -0
- package/dist/nextjs/router.d.ts +15 -0
- package/dist/nextjs/router.d.ts.map +1 -0
- package/dist/nextjs.d.ts +1 -0
- package/dist/nextjs.js +22 -0
- package/dist/nextjs.js.map +1 -0
- package/dist/not-found-BJ3VK5VJ.js +69 -0
- package/dist/not-found-BJ3VK5VJ.js.map +1 -0
- package/dist/providers/DocumentClassProvider.d.ts +56 -0
- package/dist/providers/DocumentClassProvider.d.ts.map +1 -0
- package/dist/providers/DocumentSyncRegistry.d.ts +20 -0
- package/dist/providers/DocumentSyncRegistry.d.ts.map +1 -0
- package/dist/providers/LinkProvider.d.ts +34 -0
- package/dist/providers/LinkProvider.d.ts.map +1 -0
- package/dist/providers/NavigationProvider.d.ts +223 -0
- package/dist/providers/NavigationProvider.d.ts.map +1 -0
- package/dist/providers/TwilightProvider.d.ts +7 -0
- package/dist/providers/TwilightProvider.d.ts.map +1 -0
- package/dist/providers/i18n-factory.d.ts +17 -0
- package/dist/providers/i18n-factory.d.ts.map +1 -0
- package/dist/providers/i18n.d.ts +31 -0
- package/dist/providers/i18n.d.ts.map +1 -0
- package/dist/providers/index.d.ts +6 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/locale-constants.d.ts +17 -0
- package/dist/providers/locale-constants.d.ts.map +1 -0
- package/dist/providers/salla-sdk.types.d.ts +352 -0
- package/dist/providers/salla-sdk.types.d.ts.map +1 -0
- package/dist/providers/twilight-context.d.ts +4 -0
- package/dist/providers/twilight-context.d.ts.map +1 -0
- package/dist/providers/twilight-init.d.ts +24 -0
- package/dist/providers/twilight-init.d.ts.map +1 -0
- package/dist/providers/twilight-theme.d.ts +9 -0
- package/dist/providers/twilight-theme.d.ts.map +1 -0
- package/dist/providers/twilight.types.d.ts +95 -0
- package/dist/providers/twilight.types.d.ts.map +1 -0
- package/dist/router/context.d.ts +3 -0
- package/dist/router/context.d.ts.map +1 -0
- package/dist/router/index.d.ts +4 -0
- package/dist/router/index.d.ts.map +1 -0
- package/dist/router/route-ids.d.ts +37 -0
- package/dist/router/route-ids.d.ts.map +1 -0
- package/dist/routes/account/index.d.ts +8 -0
- package/dist/routes/account/index.d.ts.map +1 -0
- package/dist/routes/account/notifications/NotificationsPage.d.ts +3 -0
- package/dist/routes/account/notifications/NotificationsPage.d.ts.map +1 -0
- package/dist/routes/account/notifications/index.d.ts +17 -0
- package/dist/routes/account/notifications/index.d.ts.map +1 -0
- package/dist/routes/account/notifications/loader.d.ts +5 -0
- package/dist/routes/account/notifications/loader.d.ts.map +1 -0
- package/dist/routes/account/notifications/types.d.ts +17 -0
- package/dist/routes/account/notifications/types.d.ts.map +1 -0
- package/dist/routes/account/orders/OrderSinglePage.d.ts +3 -0
- package/dist/routes/account/orders/OrderSinglePage.d.ts.map +1 -0
- package/dist/routes/account/orders/OrdersPage.d.ts +3 -0
- package/dist/routes/account/orders/OrdersPage.d.ts.map +1 -0
- package/dist/routes/account/orders/index.d.ts +35 -0
- package/dist/routes/account/orders/index.d.ts.map +1 -0
- package/dist/routes/account/orders/loader.d.ts +11 -0
- package/dist/routes/account/orders/loader.d.ts.map +1 -0
- package/dist/routes/account/orders/types.d.ts +22 -0
- package/dist/routes/account/orders/types.d.ts.map +1 -0
- package/dist/routes/account/orders.d.ts +1 -0
- package/dist/routes/account/orders.js +42 -0
- package/dist/routes/account/orders.js.map +1 -0
- package/dist/routes/account/profile/ProfilePage.d.ts +3 -0
- package/dist/routes/account/profile/ProfilePage.d.ts.map +1 -0
- package/dist/routes/account/profile/index.d.ts +17 -0
- package/dist/routes/account/profile/index.d.ts.map +1 -0
- package/dist/routes/account/profile/loader.d.ts +5 -0
- package/dist/routes/account/profile/loader.d.ts.map +1 -0
- package/dist/routes/account/profile/types.d.ts +5 -0
- package/dist/routes/account/profile/types.d.ts.map +1 -0
- package/dist/routes/account/settings/SettingsPage.d.ts +3 -0
- package/dist/routes/account/settings/SettingsPage.d.ts.map +1 -0
- package/dist/routes/account/settings/index.d.ts +17 -0
- package/dist/routes/account/settings/index.d.ts.map +1 -0
- package/dist/routes/account/settings/loader.d.ts +5 -0
- package/dist/routes/account/settings/loader.d.ts.map +1 -0
- package/dist/routes/account/settings/types.d.ts +5 -0
- package/dist/routes/account/settings/types.d.ts.map +1 -0
- package/dist/routes/account/types.d.ts +300 -0
- package/dist/routes/account/types.d.ts.map +1 -0
- package/dist/routes/account/wallet/WalletPage.d.ts +3 -0
- package/dist/routes/account/wallet/WalletPage.d.ts.map +1 -0
- package/dist/routes/account/wallet/index.d.ts +16 -0
- package/dist/routes/account/wallet/index.d.ts.map +1 -0
- package/dist/routes/account/wallet/loader.d.ts +4 -0
- package/dist/routes/account/wallet/loader.d.ts.map +1 -0
- package/dist/routes/account/wallet/types.d.ts +11 -0
- package/dist/routes/account/wallet/types.d.ts.map +1 -0
- package/dist/routes/account/wishlist/WishlistPage.d.ts +3 -0
- package/dist/routes/account/wishlist/WishlistPage.d.ts.map +1 -0
- package/dist/routes/account/wishlist/index.d.ts +16 -0
- package/dist/routes/account/wishlist/index.d.ts.map +1 -0
- package/dist/routes/account/wishlist/loader.d.ts +4 -0
- package/dist/routes/account/wishlist/loader.d.ts.map +1 -0
- package/dist/routes/account/wishlist/types.d.ts +9 -0
- package/dist/routes/account/wishlist/types.d.ts.map +1 -0
- package/dist/routes/account.d.ts +1 -0
- package/dist/routes/account.js +253 -0
- package/dist/routes/account.js.map +1 -0
- package/dist/routes/blog/BlogAuthorPage.d.ts +3 -0
- package/dist/routes/blog/BlogAuthorPage.d.ts.map +1 -0
- package/dist/routes/blog/BlogCategoryPage.d.ts +3 -0
- package/dist/routes/blog/BlogCategoryPage.d.ts.map +1 -0
- package/dist/routes/blog/BlogPage.d.ts +3 -0
- package/dist/routes/blog/BlogPage.d.ts.map +1 -0
- package/dist/routes/blog/BlogSinglePage.d.ts +3 -0
- package/dist/routes/blog/BlogSinglePage.d.ts.map +1 -0
- package/dist/routes/blog/BlogTagPage.d.ts +3 -0
- package/dist/routes/blog/BlogTagPage.d.ts.map +1 -0
- package/dist/routes/blog/components.d.ts +14 -0
- package/dist/routes/blog/components.d.ts.map +1 -0
- package/dist/routes/blog/index.d.ts +76 -0
- package/dist/routes/blog/index.d.ts.map +1 -0
- package/dist/routes/blog/loader.d.ts +16 -0
- package/dist/routes/blog/loader.d.ts.map +1 -0
- package/dist/routes/blog/types.d.ts +92 -0
- package/dist/routes/blog/types.d.ts.map +1 -0
- package/dist/routes/blog.d.ts +1 -0
- package/dist/routes/blog.js +303 -0
- package/dist/routes/blog.js.map +1 -0
- package/dist/routes/brands/BrandsPage.d.ts +5 -0
- package/dist/routes/brands/BrandsPage.d.ts.map +1 -0
- package/dist/routes/brands/index.d.ts +20 -0
- package/dist/routes/brands/index.d.ts.map +1 -0
- package/dist/routes/brands/loader.d.ts +3 -0
- package/dist/routes/brands/loader.d.ts.map +1 -0
- package/dist/routes/brands/types.d.ts +32 -0
- package/dist/routes/brands/types.d.ts.map +1 -0
- package/dist/routes/brands.d.ts +1 -0
- package/dist/routes/brands.js +92 -0
- package/dist/routes/brands.js.map +1 -0
- package/dist/routes/cart/CartPage.d.ts +3 -0
- package/dist/routes/cart/CartPage.d.ts.map +1 -0
- package/dist/routes/cart/index.d.ts +20 -0
- package/dist/routes/cart/index.d.ts.map +1 -0
- package/dist/routes/cart/loader.d.ts +8 -0
- package/dist/routes/cart/loader.d.ts.map +1 -0
- package/dist/routes/cart/types.d.ts +6 -0
- package/dist/routes/cart/types.d.ts.map +1 -0
- package/dist/routes/cart.d.ts +1 -0
- package/dist/routes/cart.js +168 -0
- package/dist/routes/cart.js.map +1 -0
- package/dist/routes/home/HomePage.d.ts +5 -0
- package/dist/routes/home/HomePage.d.ts.map +1 -0
- package/dist/routes/home/index.d.ts +22 -0
- package/dist/routes/home/index.d.ts.map +1 -0
- package/dist/routes/home/loader.d.ts +12 -0
- package/dist/routes/home/loader.d.ts.map +1 -0
- package/dist/routes/home/types.d.ts +10 -0
- package/dist/routes/home/types.d.ts.map +1 -0
- package/dist/routes/home.d.ts +1 -0
- package/dist/routes/home.js +46 -0
- package/dist/routes/home.js.map +1 -0
- package/dist/routes/index.d.ts +20 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/index.js +40 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/lazy.d.ts +23 -0
- package/dist/routes/lazy.d.ts.map +1 -0
- package/dist/routes/loyalty/LoyaltyPage.d.ts +3 -0
- package/dist/routes/loyalty/LoyaltyPage.d.ts.map +1 -0
- package/dist/routes/loyalty/index.d.ts +19 -0
- package/dist/routes/loyalty/index.d.ts.map +1 -0
- package/dist/routes/loyalty/loader.d.ts +3 -0
- package/dist/routes/loyalty/loader.d.ts.map +1 -0
- package/dist/routes/loyalty/types.d.ts +96 -0
- package/dist/routes/loyalty/types.d.ts.map +1 -0
- package/dist/routes/loyalty.d.ts +1 -0
- package/dist/routes/loyalty.js +73 -0
- package/dist/routes/loyalty.js.map +1 -0
- package/dist/routes/not-found.d.ts +15 -0
- package/dist/routes/not-found.d.ts.map +1 -0
- package/dist/routes/page/PageSingle.d.ts +3 -0
- package/dist/routes/page/PageSingle.d.ts.map +1 -0
- package/dist/routes/page/index.d.ts +21 -0
- package/dist/routes/page/index.d.ts.map +1 -0
- package/dist/routes/page/loader.d.ts +6 -0
- package/dist/routes/page/loader.d.ts.map +1 -0
- package/dist/routes/page/types.d.ts +32 -0
- package/dist/routes/page/types.d.ts.map +1 -0
- package/dist/routes/page.d.ts +1 -0
- package/dist/routes/page.js +97 -0
- package/dist/routes/page.js.map +1 -0
- package/dist/routes/product/ProductPage.d.ts +3 -0
- package/dist/routes/product/ProductPage.d.ts.map +1 -0
- package/dist/routes/product/index.d.ts +21 -0
- package/dist/routes/product/index.d.ts.map +1 -0
- package/dist/routes/product/loader.d.ts +6 -0
- package/dist/routes/product/loader.d.ts.map +1 -0
- package/dist/routes/product/types.d.ts +6 -0
- package/dist/routes/product/types.d.ts.map +1 -0
- package/dist/routes/product-listing/ProductListPage.d.ts +13 -0
- package/dist/routes/product-listing/ProductListPage.d.ts.map +1 -0
- package/dist/routes/product-listing/index.d.ts +16 -0
- package/dist/routes/product-listing/index.d.ts.map +1 -0
- package/dist/routes/product-listing/loader.d.ts +3 -0
- package/dist/routes/product-listing/loader.d.ts.map +1 -0
- package/dist/routes/product-listing/types.d.ts +71 -0
- package/dist/routes/product-listing/types.d.ts.map +1 -0
- package/dist/routes/product-listing.d.ts +1 -0
- package/dist/routes/product-listing.js +516 -0
- package/dist/routes/product-listing.js.map +1 -0
- package/dist/routes/product.d.ts +1 -0
- package/dist/routes/product.js +225 -0
- package/dist/routes/product.js.map +1 -0
- package/dist/routes/root/beforeLoad.d.ts +21 -0
- package/dist/routes/root/beforeLoad.d.ts.map +1 -0
- package/dist/routes/root/head.d.ts +5 -0
- package/dist/routes/root/head.d.ts.map +1 -0
- package/dist/routes/root/index.d.ts +3 -0
- package/dist/routes/root/index.d.ts.map +1 -0
- package/dist/routes/seo-redirects.d.ts +19 -0
- package/dist/routes/seo-redirects.d.ts.map +1 -0
- package/dist/routes/seo-redirects.js +40 -0
- package/dist/routes/seo-redirects.js.map +1 -0
- package/dist/routes/testimonials/TestimonialsPage.d.ts +3 -0
- package/dist/routes/testimonials/TestimonialsPage.d.ts.map +1 -0
- package/dist/routes/testimonials/index.d.ts +19 -0
- package/dist/routes/testimonials/index.d.ts.map +1 -0
- package/dist/routes/testimonials/loader.d.ts +5 -0
- package/dist/routes/testimonials/loader.d.ts.map +1 -0
- package/dist/routes/testimonials/types.d.ts +5 -0
- package/dist/routes/testimonials/types.d.ts.map +1 -0
- package/dist/routes/testimonials.d.ts +1 -0
- package/dist/routes/testimonials.js +49 -0
- package/dist/routes/testimonials.js.map +1 -0
- package/dist/routes/thank-you/ThankYouPage.d.ts +3 -0
- package/dist/routes/thank-you/ThankYouPage.d.ts.map +1 -0
- package/dist/routes/thank-you/index.d.ts +20 -0
- package/dist/routes/thank-you/index.d.ts.map +1 -0
- package/dist/routes/thank-you/loader.d.ts +5 -0
- package/dist/routes/thank-you/loader.d.ts.map +1 -0
- package/dist/routes/thank-you/types.d.ts +14 -0
- package/dist/routes/thank-you/types.d.ts.map +1 -0
- package/dist/routes/thank-you.d.ts +1 -0
- package/dist/routes/thank-you.js +95 -0
- package/dist/routes/thank-you.js.map +1 -0
- package/dist/routes/types.d.ts +36 -0
- package/dist/routes/types.d.ts.map +1 -0
- package/dist/sentry/client.d.ts +6 -0
- package/dist/sentry/client.d.ts.map +1 -0
- package/dist/sentry/client.js +17 -0
- package/dist/sentry/client.js.map +1 -0
- package/dist/sentry/server.d.ts +10 -0
- package/dist/sentry/server.d.ts.map +1 -0
- package/dist/sentry/server.js +16 -0
- package/dist/sentry/server.js.map +1 -0
- package/dist/skeleton.d.ts +4 -0
- package/dist/skeleton.d.ts.map +1 -0
- package/dist/skeleton.js +47 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/tanstack/document-class.d.ts +44 -0
- package/dist/tanstack/document-class.d.ts.map +1 -0
- package/dist/tanstack/head.d.ts +24 -0
- package/dist/tanstack/head.d.ts.map +1 -0
- package/dist/tanstack/index.d.ts +28 -0
- package/dist/tanstack/index.d.ts.map +1 -0
- package/dist/tanstack/link.d.ts +18 -0
- package/dist/tanstack/link.d.ts.map +1 -0
- package/dist/tanstack/middleware/earlyHints.d.ts +3 -0
- package/dist/tanstack/middleware/earlyHints.d.ts.map +1 -0
- package/dist/tanstack/middleware/twilight.d.ts +7 -0
- package/dist/tanstack/middleware/twilight.d.ts.map +1 -0
- package/dist/tanstack/navigation.d.ts +13 -0
- package/dist/tanstack/navigation.d.ts.map +1 -0
- package/dist/tanstack/router.d.ts +85 -0
- package/dist/tanstack/router.d.ts.map +1 -0
- package/dist/tanstack/templates/account-layout.d.ts +8 -0
- package/dist/tanstack/templates/account-layout.d.ts.map +1 -0
- package/dist/tanstack/templates/index.d.ts +4 -0
- package/dist/tanstack/templates/index.d.ts.map +1 -0
- package/dist/tanstack/templates/locale-wrapper.d.ts +15 -0
- package/dist/tanstack/templates/locale-wrapper.d.ts.map +1 -0
- package/dist/tanstack/templates/redirect.d.ts +6 -0
- package/dist/tanstack/templates/redirect.d.ts.map +1 -0
- package/dist/tanstack.d.ts +1 -0
- package/dist/tanstack.js +137 -0
- package/dist/tanstack.js.map +1 -0
- package/dist/twilight/context.d.ts +46 -0
- package/dist/twilight/context.d.ts.map +1 -0
- package/dist/twilight/index.d.ts +3 -0
- package/dist/twilight/index.d.ts.map +1 -0
- package/dist/types/hooks.d.ts +58 -0
- package/dist/types/hooks.d.ts.map +1 -0
- package/dist/types/index.d.ts +724 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/apply-theme.d.ts +3 -0
- package/dist/utils/apply-theme.d.ts.map +1 -0
- package/dist/utils/asset.d.ts +27 -0
- package/dist/utils/asset.d.ts.map +1 -0
- package/dist/utils/baseHead.d.ts +23 -0
- package/dist/utils/baseHead.d.ts.map +1 -0
- package/dist/utils/baseHead.js +5 -0
- package/dist/utils/baseHead.js.map +1 -0
- package/dist/utils/breadcrumb.d.ts +5 -0
- package/dist/utils/breadcrumb.d.ts.map +1 -0
- package/dist/utils/cdn-image.d.ts +5 -0
- package/dist/utils/cdn-image.d.ts.map +1 -0
- package/dist/utils/color.d.ts +34 -0
- package/dist/utils/color.d.ts.map +1 -0
- package/dist/utils/cookies.d.ts +16 -0
- package/dist/utils/cookies.d.ts.map +1 -0
- package/dist/utils/device.d.ts +19 -0
- package/dist/utils/device.d.ts.map +1 -0
- package/dist/utils/document-class.d.ts +67 -0
- package/dist/utils/document-class.d.ts.map +1 -0
- package/dist/utils/errors.d.ts +4 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/head.d.ts +100 -0
- package/dist/utils/head.d.ts.map +1 -0
- package/dist/utils/head.js +4 -0
- package/dist/utils/head.js.map +1 -0
- package/dist/utils/index.d.ts +22 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +15 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/number.d.ts +21 -0
- package/dist/utils/number.d.ts.map +1 -0
- package/dist/utils/salla-plural.d.ts +14 -0
- package/dist/utils/salla-plural.d.ts.map +1 -0
- package/dist/utils/sanitize.d.ts +2 -0
- package/dist/utils/sanitize.d.ts.map +1 -0
- package/dist/utils/sdk-events.d.ts +25 -0
- package/dist/utils/sdk-events.d.ts.map +1 -0
- package/dist/utils/sdk-helpers.d.ts +30 -0
- package/dist/utils/sdk-helpers.d.ts.map +1 -0
- package/dist/utils/sort-options.d.ts +8 -0
- package/dist/utils/sort-options.d.ts.map +1 -0
- package/dist/vite/adapters/index.d.ts +18 -0
- package/dist/vite/adapters/index.d.ts.map +1 -0
- package/dist/vite/adapters/nextjs.adapter.d.ts +12 -0
- package/dist/vite/adapters/nextjs.adapter.d.ts.map +1 -0
- package/dist/vite/adapters/tanstack.adapter.d.ts +71 -0
- package/dist/vite/adapters/tanstack.adapter.d.ts.map +1 -0
- package/dist/vite/index.d.ts +6 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +2193 -0
- package/dist/vite/index.js.map +1 -0
- package/dist/vite/plugins/best-practices/best-practices.plugin.d.ts +4 -0
- package/dist/vite/plugins/best-practices/best-practices.plugin.d.ts.map +1 -0
- package/dist/vite/plugins/best-practices/hooks-registry.d.ts +27 -0
- package/dist/vite/plugins/best-practices/hooks-registry.d.ts.map +1 -0
- package/dist/vite/plugins/best-practices/reporter.d.ts +4 -0
- package/dist/vite/plugins/best-practices/reporter.d.ts.map +1 -0
- package/dist/vite/plugins/best-practices/rules/index.d.ts +4 -0
- package/dist/vite/plugins/best-practices/rules/index.d.ts.map +1 -0
- package/dist/vite/plugins/best-practices/rules/no-deep-component-import.d.ts +3 -0
- package/dist/vite/plugins/best-practices/rules/no-deep-component-import.d.ts.map +1 -0
- package/dist/vite/plugins/best-practices/rules/no-direct-product-card-import.d.ts +3 -0
- package/dist/vite/plugins/best-practices/rules/no-direct-product-card-import.d.ts.map +1 -0
- package/dist/vite/plugins/best-practices/rules/no-img-without-dimensions.d.ts +3 -0
- package/dist/vite/plugins/best-practices/rules/no-img-without-dimensions.d.ts.map +1 -0
- package/dist/vite/plugins/best-practices/rules/no-manual-dom.d.ts +3 -0
- package/dist/vite/plugins/best-practices/rules/no-manual-dom.d.ts.map +1 -0
- package/dist/vite/plugins/best-practices/rules/no-window-location-reload.d.ts +3 -0
- package/dist/vite/plugins/best-practices/rules/no-window-location-reload.d.ts.map +1 -0
- package/dist/vite/plugins/best-practices/rules/require-page-hooks.d.ts +16 -0
- package/dist/vite/plugins/best-practices/rules/require-page-hooks.d.ts.map +1 -0
- package/dist/vite/plugins/best-practices/types.d.ts +34 -0
- package/dist/vite/plugins/best-practices/types.d.ts.map +1 -0
- package/dist/vite/plugins/package-aliases.plugin.d.ts +3 -0
- package/dist/vite/plugins/package-aliases.plugin.d.ts.map +1 -0
- package/dist/vite/plugins/salla-hydration.plugin.d.ts +12 -0
- package/dist/vite/plugins/salla-hydration.plugin.d.ts.map +1 -0
- package/dist/vite/plugins/theme-translations.plugin.d.ts +20 -0
- package/dist/vite/plugins/theme-translations.plugin.d.ts.map +1 -0
- package/dist/vite/twilight-react.d.ts +22 -0
- package/dist/vite/twilight-react.d.ts.map +1 -0
- package/dist/vite/types.d.ts +110 -0
- package/dist/vite/types.d.ts.map +1 -0
- package/package.json +474 -0
|
@@ -0,0 +1,1167 @@
|
|
|
1
|
+
import { Header } from './chunk-QTDGM2SO.js';
|
|
2
|
+
import { Copyright } from './chunk-5Q6PFLDN.js';
|
|
3
|
+
import { useLocation, useIsHome, navigationSetups, NavigationInterceptor } from './chunk-GO34DE35.js';
|
|
4
|
+
import { color } from './chunk-VVZNW5CB.js';
|
|
5
|
+
import { useUser } from './chunk-I5Z4NJBB.js';
|
|
6
|
+
import { AUTH_TOKEN_COOKIE_NAME, clearAuthTokenCookie, syncSdkLocale } from './chunk-QYL5OHAV.js';
|
|
7
|
+
import { getTwilightContext, updateTwilightContext } from './chunk-KIPZQN3Y.js';
|
|
8
|
+
import { useAsset } from './chunk-Z653O7MX.js';
|
|
9
|
+
import { DocumentClassProvider, useDocumentClass } from './chunk-GN34LCTG.js';
|
|
10
|
+
import { useTranslation, I18nProvider } from './chunk-VVRYP6IL.js';
|
|
11
|
+
import { FALLBACK_LOCALE, getLanguageInfo } from './chunk-T72DAX7R.js';
|
|
12
|
+
import { WidgetHead } from './chunk-RYBA3JDM.js';
|
|
13
|
+
import { HookSlot } from './chunk-25SSLQAJ.js';
|
|
14
|
+
import { hookRegistry } from './chunk-J37AYLWL.js';
|
|
15
|
+
import { Image } from './chunk-2KF5JJU6.js';
|
|
16
|
+
import { Link } from './chunk-TZ4YD5CU.js';
|
|
17
|
+
import { LazyImageModal } from './chunk-3DCZJDDK.js';
|
|
18
|
+
import { Toaster } from './chunk-MXQCE3KA.js';
|
|
19
|
+
import { useTwilight, TwilightContext } from './chunk-BWFBVXT3.js';
|
|
20
|
+
import React2, { lazy, Suspense, useCallback, useMemo, useRef, useEffect, useState } from 'react';
|
|
21
|
+
import { SallaAppsIcons } from '@salla.sa/twilight-components-react/apps-icons';
|
|
22
|
+
import { SallaContacts } from '@salla.sa/twilight-components-react/contacts';
|
|
23
|
+
import { SallaMenu } from '@salla.sa/twilight-components-react/menu';
|
|
24
|
+
import { SallaPayments } from '@salla.sa/twilight-components-react/payments';
|
|
25
|
+
import { SallaSocial } from '@salla.sa/twilight-components-react/social';
|
|
26
|
+
import { SallaTrustBadges } from '@salla.sa/twilight-components-react/trust-badges';
|
|
27
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
28
|
+
|
|
29
|
+
// src/utils/apply-theme.ts
|
|
30
|
+
function applyTheme(theme) {
|
|
31
|
+
if (typeof document === "undefined") return;
|
|
32
|
+
const vars = [];
|
|
33
|
+
if (theme.font?.name) {
|
|
34
|
+
vars.push(
|
|
35
|
+
["--font-main", theme.font.name],
|
|
36
|
+
["--font-light", theme.font.name],
|
|
37
|
+
["--font-regular", theme.font.name],
|
|
38
|
+
["--font-medium", `${theme.font.name}-Medium`],
|
|
39
|
+
["--font-bold", `${theme.font.name}-Bold`]
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
const { color: color2 } = theme;
|
|
43
|
+
if (color2) {
|
|
44
|
+
vars.push(["--color-text", "#222222"]);
|
|
45
|
+
if (color2.primary) {
|
|
46
|
+
const c = color(color2.primary);
|
|
47
|
+
vars.push(
|
|
48
|
+
["--color-primary", color2.primary],
|
|
49
|
+
["--color-primary-dark", c.darken(0.15)],
|
|
50
|
+
["--color-primary-light", c.lighten(0.15)],
|
|
51
|
+
["--color-title", color2.primary],
|
|
52
|
+
["--color-secondary", color2.primary]
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
if (color2.reverse_text) {
|
|
56
|
+
vars.push(
|
|
57
|
+
["--color-primary-reverse", color2.reverse_text],
|
|
58
|
+
["--color-text-reverse", color2.reverse_text],
|
|
59
|
+
["--color-reverse-text", color2.reverse_text]
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
if (color2.reverse_primary) {
|
|
63
|
+
vars.push(["--color-reverse-primary", color2.reverse_primary]);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
vars.push(["--page-height", "100%"]);
|
|
67
|
+
const root = document.documentElement;
|
|
68
|
+
for (const [prop, val] of vars) {
|
|
69
|
+
root.style.setProperty(prop, val);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// src/providers/twilight-theme.ts
|
|
74
|
+
function fontToClass(name) {
|
|
75
|
+
if (!name) return null;
|
|
76
|
+
const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
77
|
+
return slug ? `font-${slug}` : null;
|
|
78
|
+
}
|
|
79
|
+
function ThemeDocumentSync({
|
|
80
|
+
theme,
|
|
81
|
+
locale,
|
|
82
|
+
direction,
|
|
83
|
+
isMobileWebview
|
|
84
|
+
}) {
|
|
85
|
+
const bodyClasses = [
|
|
86
|
+
theme.name ? `salla-${theme.name}` : null,
|
|
87
|
+
`color-mode-${theme.color?.is_dark ? "dark" : "light"}`,
|
|
88
|
+
direction,
|
|
89
|
+
theme.mode === "preview" ? "preview-mode" : null,
|
|
90
|
+
fontToClass(theme.font?.name),
|
|
91
|
+
isMobileWebview ? "mobile-webview" : null,
|
|
92
|
+
theme.settings?.footer_is_dark ? "footer-is-dark" : "footer-is-light",
|
|
93
|
+
theme.settings?.topnav_is_dark ? "topnav-is-dark" : null,
|
|
94
|
+
theme.settings?.sticky_add_to_cart ? "is-sticky-product-bar" : null
|
|
95
|
+
].filter(Boolean);
|
|
96
|
+
useDocumentClass({
|
|
97
|
+
html: { lang: locale, dir: direction },
|
|
98
|
+
body: { class: bodyClasses }
|
|
99
|
+
});
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
applyTheme(theme);
|
|
102
|
+
}, [theme]);
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
function getSalla() {
|
|
106
|
+
if (typeof window === "undefined") return void 0;
|
|
107
|
+
return window.salla;
|
|
108
|
+
}
|
|
109
|
+
function useTwilightInit({
|
|
110
|
+
debug: _debug,
|
|
111
|
+
initialData,
|
|
112
|
+
onReady,
|
|
113
|
+
onError: _onError,
|
|
114
|
+
initialLocale
|
|
115
|
+
}) {
|
|
116
|
+
const isBrowser = typeof window !== "undefined";
|
|
117
|
+
const initialLanguage = getLanguageInfo(initialLocale);
|
|
118
|
+
const settingsData = initialData;
|
|
119
|
+
const [isReady, setReady] = useState(() => !!settingsData);
|
|
120
|
+
const [storeData, setStoreData] = useState(
|
|
121
|
+
() => settingsData?.store ?? {}
|
|
122
|
+
);
|
|
123
|
+
const [themeData] = useState(() => {
|
|
124
|
+
const theme = settingsData?.theme;
|
|
125
|
+
if (theme) {
|
|
126
|
+
return {
|
|
127
|
+
...theme,
|
|
128
|
+
is_rtl: theme.is_rtl ?? initialLanguage.dir === "rtl"
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
return { is_rtl: initialLanguage.dir === "rtl" };
|
|
132
|
+
});
|
|
133
|
+
const [currency] = useState(null);
|
|
134
|
+
const [isMobileWebview] = useState(false);
|
|
135
|
+
useEffect(() => {
|
|
136
|
+
if (!isBrowser || !themeData) return;
|
|
137
|
+
const sdk = getSalla();
|
|
138
|
+
sdk?.config?.set?.("theme.is_rtl", themeData.is_rtl ?? false);
|
|
139
|
+
window.enable_more_menu = String(themeData.settings?.enable_more_menu ?? true);
|
|
140
|
+
}, [themeData, isBrowser]);
|
|
141
|
+
useEffect(() => {
|
|
142
|
+
const sdk = getSalla();
|
|
143
|
+
if (!sdk) return;
|
|
144
|
+
if (initialLocale) {
|
|
145
|
+
syncSdkLocale(initialLocale);
|
|
146
|
+
}
|
|
147
|
+
if (typeof sdk.init !== "function") return;
|
|
148
|
+
const ctx = getTwilightContext();
|
|
149
|
+
const pageCtx = ctx.page;
|
|
150
|
+
const initData = pageCtx ? {
|
|
151
|
+
...settingsData,
|
|
152
|
+
page: {
|
|
153
|
+
...pageCtx,
|
|
154
|
+
url: pageCtx.url ?? ctx.location.pathname + ctx.location.searchStr
|
|
155
|
+
}
|
|
156
|
+
} : settingsData;
|
|
157
|
+
sdk.init(initData);
|
|
158
|
+
const initSdk = async () => {
|
|
159
|
+
try {
|
|
160
|
+
await sdk.onReady();
|
|
161
|
+
} catch {
|
|
162
|
+
}
|
|
163
|
+
syncSdkLocale(initialLocale);
|
|
164
|
+
setReady(true);
|
|
165
|
+
document.dispatchEvent(new CustomEvent("theme::ready"));
|
|
166
|
+
onReady?.({
|
|
167
|
+
store: storeData,
|
|
168
|
+
theme: themeData
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
initSdk();
|
|
172
|
+
}, [initialLocale]);
|
|
173
|
+
return {
|
|
174
|
+
isReady,
|
|
175
|
+
storeData,
|
|
176
|
+
setStoreData,
|
|
177
|
+
themeData,
|
|
178
|
+
currency,
|
|
179
|
+
isMobileWebview
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
var routeDocumentSyncs = {
|
|
183
|
+
tanstack: lazy(
|
|
184
|
+
() => import('./document-class-PLK3HUM6.js').then((m) => ({
|
|
185
|
+
default: m.TanStackDocumentSync
|
|
186
|
+
}))
|
|
187
|
+
)
|
|
188
|
+
// Add other frameworks here:
|
|
189
|
+
// nextjs: lazy(() => import('../nextjs/document-sync').then(m => ({ default: m.NextjsDocumentSync }))),
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
// src/hooks/useDate.ts
|
|
193
|
+
function normalizeDate(input) {
|
|
194
|
+
if (!input) return /* @__PURE__ */ new Date();
|
|
195
|
+
if (input instanceof Date) return input;
|
|
196
|
+
if (typeof input === "number") return new Date(input);
|
|
197
|
+
if (typeof input === "object" && "date" in input) return new Date(input.date);
|
|
198
|
+
return new Date(input);
|
|
199
|
+
}
|
|
200
|
+
function useDate() {
|
|
201
|
+
const { locale } = useTranslation();
|
|
202
|
+
const format = (date, formatType = "medium") => {
|
|
203
|
+
const dateObj = normalizeDate(date);
|
|
204
|
+
const formatOptionsMap = {
|
|
205
|
+
full: { weekday: "long", year: "numeric", month: "long", day: "numeric" },
|
|
206
|
+
long: { year: "numeric", month: "long", day: "numeric" },
|
|
207
|
+
medium: { year: "numeric", month: "long", day: "numeric" },
|
|
208
|
+
short: { year: "numeric", month: "short", day: "numeric" },
|
|
209
|
+
time: { hour: "2-digit", minute: "2-digit" }
|
|
210
|
+
};
|
|
211
|
+
try {
|
|
212
|
+
return new Intl.DateTimeFormat(locale, formatOptionsMap[formatType]).format(dateObj);
|
|
213
|
+
} catch {
|
|
214
|
+
return dateObj.toLocaleDateString(locale);
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
const ago = (date) => {
|
|
218
|
+
const dateObj = normalizeDate(date);
|
|
219
|
+
const diffInSeconds = Math.floor((Date.now() - dateObj.getTime()) / 1e3);
|
|
220
|
+
const units = [
|
|
221
|
+
{ unit: "year", threshold: 31536e3, divisor: 31536e3 },
|
|
222
|
+
{ unit: "month", threshold: 2592e3, divisor: 2592e3 },
|
|
223
|
+
{ unit: "week", threshold: 604800, divisor: 604800 },
|
|
224
|
+
{ unit: "day", threshold: 86400, divisor: 86400 },
|
|
225
|
+
{ unit: "hour", threshold: 3600, divisor: 3600 },
|
|
226
|
+
{ unit: "minute", threshold: 60, divisor: 60 },
|
|
227
|
+
{ unit: "second", threshold: 1, divisor: 1 }
|
|
228
|
+
];
|
|
229
|
+
for (const { unit, threshold, divisor } of units) {
|
|
230
|
+
if (diffInSeconds >= threshold) {
|
|
231
|
+
const value = Math.floor(diffInSeconds / divisor);
|
|
232
|
+
try {
|
|
233
|
+
return new Intl.RelativeTimeFormat(locale, { numeric: "auto", style: "long" }).format(
|
|
234
|
+
-value,
|
|
235
|
+
unit
|
|
236
|
+
);
|
|
237
|
+
} catch {
|
|
238
|
+
return new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(-value, unit);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return locale.startsWith("ar") ? "\u0627\u0644\u0622\u0646" : "just now";
|
|
243
|
+
};
|
|
244
|
+
return { format, ago, now: /* @__PURE__ */ new Date() };
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// src/hooks/useNumber.ts
|
|
248
|
+
var ARABIC_NUMERALS = ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"];
|
|
249
|
+
function useNumber() {
|
|
250
|
+
const { store } = useTwilight();
|
|
251
|
+
const useArabicNumerals = store?.settings?.arabic_numbers_enabled ?? false;
|
|
252
|
+
const toArabic = (input) => {
|
|
253
|
+
const str = String(input);
|
|
254
|
+
return str.replace(/[0-9]/g, (d) => ARABIC_NUMERALS[parseInt(d)]);
|
|
255
|
+
};
|
|
256
|
+
const format = (number) => {
|
|
257
|
+
return useArabicNumerals ? toArabic(number) : String(number);
|
|
258
|
+
};
|
|
259
|
+
return {
|
|
260
|
+
/** Format number with store settings */
|
|
261
|
+
format,
|
|
262
|
+
/** Convert to Arabic numerals */
|
|
263
|
+
toArabic,
|
|
264
|
+
/** Whether Arabic numerals are enabled */
|
|
265
|
+
useArabicNumerals
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
var AR_LOCALE = "ar";
|
|
269
|
+
var SAR_CURRENCY = "SAR";
|
|
270
|
+
function useMoney() {
|
|
271
|
+
const { store } = useTwilight();
|
|
272
|
+
const { locale } = useTranslation();
|
|
273
|
+
const useArabicNumerals = store?.settings?.arabic_numbers_enabled ?? false;
|
|
274
|
+
const format = (amount, options) => {
|
|
275
|
+
const currency = options?.currency ?? "SAR";
|
|
276
|
+
const loc = options?.locale ?? locale;
|
|
277
|
+
const type = options?.type ?? "product";
|
|
278
|
+
if (amount == null || amount === "") {
|
|
279
|
+
const showDash = type === "product" ? store?.settings?.product?.show_price_as_dash : false;
|
|
280
|
+
return showDash ? "-" : "";
|
|
281
|
+
}
|
|
282
|
+
const numericAmount = typeof amount === "string" ? parseFloat(amount) : amount;
|
|
283
|
+
if (typeof amount === "string" && amount === "-") return amount;
|
|
284
|
+
if (isNaN(numericAmount)) return String(amount);
|
|
285
|
+
if (!numericAmount && numericAmount !== 0) {
|
|
286
|
+
const showDash = type === "product" ? store?.settings?.product?.show_price_as_dash : false;
|
|
287
|
+
return showDash ? "-" : "";
|
|
288
|
+
}
|
|
289
|
+
let formatted = new Intl.NumberFormat(loc, {
|
|
290
|
+
minimumFractionDigits: 2,
|
|
291
|
+
maximumFractionDigits: 2
|
|
292
|
+
}).format(numericAmount);
|
|
293
|
+
if (useArabicNumerals && loc.startsWith(AR_LOCALE)) {
|
|
294
|
+
formatted = formatted.replace(/[0-9]/g, (d) => "\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669"[parseInt(d)]);
|
|
295
|
+
}
|
|
296
|
+
if (currency === SAR_CURRENCY) {
|
|
297
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
298
|
+
formatted,
|
|
299
|
+
" ",
|
|
300
|
+
/* @__PURE__ */ jsx("i", { className: "sicon-sar" })
|
|
301
|
+
] });
|
|
302
|
+
}
|
|
303
|
+
try {
|
|
304
|
+
return new Intl.NumberFormat(loc, {
|
|
305
|
+
style: "currency",
|
|
306
|
+
currency,
|
|
307
|
+
minimumFractionDigits: 2,
|
|
308
|
+
maximumFractionDigits: 2
|
|
309
|
+
}).format(numericAmount);
|
|
310
|
+
} catch {
|
|
311
|
+
return `${formatted} ${currency}`;
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
const parse = (moneyString) => {
|
|
315
|
+
const cleaned = moneyString.replace(/[^\d.,٬٫]/g, "");
|
|
316
|
+
const normalized = cleaned.replace(/٬/g, "").replace(/٫/g, ".");
|
|
317
|
+
const parts = normalized.split(/[.,]/);
|
|
318
|
+
if (parts.length > 2) {
|
|
319
|
+
return parseFloat(`${parts.slice(0, -1).join("")}.${parts[parts.length - 1]}`);
|
|
320
|
+
}
|
|
321
|
+
return parseFloat(normalized.replace(/,/g, ""));
|
|
322
|
+
};
|
|
323
|
+
const isValid = (value) => {
|
|
324
|
+
if (typeof value === "number" && !isNaN(value) && isFinite(value)) return true;
|
|
325
|
+
if (typeof value === "string") {
|
|
326
|
+
const parsed = parseFloat(value);
|
|
327
|
+
return !isNaN(parsed) && isFinite(parsed);
|
|
328
|
+
}
|
|
329
|
+
return false;
|
|
330
|
+
};
|
|
331
|
+
return { format, parse, isValid };
|
|
332
|
+
}
|
|
333
|
+
function eventId(prefix) {
|
|
334
|
+
return `${prefix}_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
|
|
335
|
+
}
|
|
336
|
+
function toProduct(product, overrides) {
|
|
337
|
+
return {
|
|
338
|
+
id: product.id,
|
|
339
|
+
name: product.name,
|
|
340
|
+
price: product.sale_price,
|
|
341
|
+
brand: product.brand?.name,
|
|
342
|
+
category: product.category?.name,
|
|
343
|
+
quantity: 1,
|
|
344
|
+
...overrides
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
function getCurrency(product, fallback = "SAR") {
|
|
348
|
+
return product?.currency ?? fallback;
|
|
349
|
+
}
|
|
350
|
+
function useGtm() {
|
|
351
|
+
const { store } = useTwilight();
|
|
352
|
+
const { data: user } = useUser();
|
|
353
|
+
const gtmIds = store.settings?.keys?.gtm;
|
|
354
|
+
const enabled = !!(gtmIds && gtmIds.length > 0);
|
|
355
|
+
const currency = user?.preferences?.currency_code ?? "SAR";
|
|
356
|
+
const push = useCallback(
|
|
357
|
+
(data) => {
|
|
358
|
+
if (!enabled) return;
|
|
359
|
+
window.dataLayer = window.dataLayer || [];
|
|
360
|
+
window.dataLayer.push(data);
|
|
361
|
+
},
|
|
362
|
+
[enabled]
|
|
363
|
+
);
|
|
364
|
+
const viewPage = useCallback((pageType) => push({ event: "viewPage", pageType }), [push]);
|
|
365
|
+
const detail = useCallback(
|
|
366
|
+
(product) => push({
|
|
367
|
+
event: "detail",
|
|
368
|
+
ecommerce: {
|
|
369
|
+
currencyCode: getCurrency(product, currency),
|
|
370
|
+
event_id: eventId("detail"),
|
|
371
|
+
detail: { products: [toProduct(product)] }
|
|
372
|
+
}
|
|
373
|
+
}),
|
|
374
|
+
[push, currency]
|
|
375
|
+
);
|
|
376
|
+
const impressions = useCallback(
|
|
377
|
+
(products, list) => {
|
|
378
|
+
if (products.length === 0) return;
|
|
379
|
+
push({
|
|
380
|
+
event: "impressions",
|
|
381
|
+
ecommerce: {
|
|
382
|
+
currencyCode: getCurrency(products[0], currency),
|
|
383
|
+
event_id: eventId("impressions"),
|
|
384
|
+
impressions: {
|
|
385
|
+
products: products.map((p, i) => toProduct(p, { position: i + 1, list }))
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
},
|
|
390
|
+
[push, currency]
|
|
391
|
+
);
|
|
392
|
+
const click = useCallback(
|
|
393
|
+
(product, list, position) => push({
|
|
394
|
+
event: "click",
|
|
395
|
+
ecommerce: {
|
|
396
|
+
currencyCode: getCurrency(product, currency),
|
|
397
|
+
event_id: eventId("click"),
|
|
398
|
+
click: {
|
|
399
|
+
actionField: { list },
|
|
400
|
+
products: [toProduct(product, { position, list })]
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}),
|
|
404
|
+
[push, currency]
|
|
405
|
+
);
|
|
406
|
+
const add = useCallback(
|
|
407
|
+
(product, quantity = 1) => push({
|
|
408
|
+
event: "addToCart",
|
|
409
|
+
ecommerce: {
|
|
410
|
+
currencyCode: getCurrency(product, currency),
|
|
411
|
+
event_id: eventId("addToCart"),
|
|
412
|
+
add: { products: [toProduct(product, { quantity })] }
|
|
413
|
+
}
|
|
414
|
+
}),
|
|
415
|
+
[push, currency]
|
|
416
|
+
);
|
|
417
|
+
const remove = useCallback(
|
|
418
|
+
(item) => push({
|
|
419
|
+
event: "removeFromCart",
|
|
420
|
+
ecommerce: {
|
|
421
|
+
currencyCode: currency,
|
|
422
|
+
event_id: eventId("removeFromCart"),
|
|
423
|
+
remove: {
|
|
424
|
+
products: [
|
|
425
|
+
{
|
|
426
|
+
id: item.product_id,
|
|
427
|
+
name: item.product_name,
|
|
428
|
+
price: typeof item.price === "number" ? item.price : item.price.amount,
|
|
429
|
+
quantity: item.quantity
|
|
430
|
+
}
|
|
431
|
+
]
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}),
|
|
435
|
+
[push, currency]
|
|
436
|
+
);
|
|
437
|
+
const checkout = useCallback(
|
|
438
|
+
(cart, step = 1) => push({
|
|
439
|
+
event: "checkout",
|
|
440
|
+
ecommerce: {
|
|
441
|
+
currencyCode: currency,
|
|
442
|
+
event_id: eventId("checkout"),
|
|
443
|
+
checkout: {
|
|
444
|
+
actionField: { step, id: cart.id },
|
|
445
|
+
products: cart.items.map((item) => ({
|
|
446
|
+
id: item.product_id,
|
|
447
|
+
name: item.product_name,
|
|
448
|
+
price: typeof item.price === "number" ? item.price : item.price.amount,
|
|
449
|
+
quantity: item.quantity
|
|
450
|
+
}))
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}),
|
|
454
|
+
[push, currency]
|
|
455
|
+
);
|
|
456
|
+
const purchase = useCallback(
|
|
457
|
+
(orderId, cart) => push({
|
|
458
|
+
event: "purchase",
|
|
459
|
+
ecommerce: {
|
|
460
|
+
currencyCode: currency,
|
|
461
|
+
event_id: eventId("purchase"),
|
|
462
|
+
purchase: {
|
|
463
|
+
actionField: {
|
|
464
|
+
id: orderId,
|
|
465
|
+
revenue: cart.total,
|
|
466
|
+
tax: cart.tax_amount,
|
|
467
|
+
coupon: cart.coupon
|
|
468
|
+
},
|
|
469
|
+
products: cart.items.map((item) => ({
|
|
470
|
+
id: item.product_id,
|
|
471
|
+
name: item.product_name,
|
|
472
|
+
price: typeof item.price === "number" ? item.price : item.price.amount,
|
|
473
|
+
quantity: item.quantity
|
|
474
|
+
}))
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}),
|
|
478
|
+
[push, currency]
|
|
479
|
+
);
|
|
480
|
+
return { enabled, push, viewPage, detail, impressions, click, add, remove, checkout, purchase };
|
|
481
|
+
}
|
|
482
|
+
var DAYS = [
|
|
483
|
+
"monday",
|
|
484
|
+
"tuesday",
|
|
485
|
+
"wednesday",
|
|
486
|
+
"thursday",
|
|
487
|
+
"friday",
|
|
488
|
+
"saturday",
|
|
489
|
+
"sunday"
|
|
490
|
+
];
|
|
491
|
+
var DAY_NAMES = {
|
|
492
|
+
monday: "common.days.monday",
|
|
493
|
+
tuesday: "common.days.tuesday",
|
|
494
|
+
wednesday: "common.days.wednesday",
|
|
495
|
+
thursday: "common.days.thursday",
|
|
496
|
+
friday: "common.days.friday",
|
|
497
|
+
saturday: "common.days.saturday",
|
|
498
|
+
sunday: "common.days.sunday"
|
|
499
|
+
};
|
|
500
|
+
var TIME_NAMES = {
|
|
501
|
+
AM: "common.time.am",
|
|
502
|
+
PM: "common.time.pm"
|
|
503
|
+
};
|
|
504
|
+
function parseTime(timeStr) {
|
|
505
|
+
const cleaned = timeStr.trim().toLowerCase();
|
|
506
|
+
const match = cleaned.match(/^(\d{1,2}):(\d{2})(?:\s*(am|pm))?$/);
|
|
507
|
+
if (!match) {
|
|
508
|
+
return 0;
|
|
509
|
+
}
|
|
510
|
+
let hours = parseInt(match[1], 10);
|
|
511
|
+
const minutes = parseInt(match[2], 10);
|
|
512
|
+
const meridiem = match[3];
|
|
513
|
+
if (meridiem === "pm" && hours < 12) {
|
|
514
|
+
hours += 12;
|
|
515
|
+
} else if (meridiem === "am" && hours === 12) {
|
|
516
|
+
hours = 0;
|
|
517
|
+
}
|
|
518
|
+
return hours * 60 + minutes;
|
|
519
|
+
}
|
|
520
|
+
function parseRanges(ranges) {
|
|
521
|
+
return ranges.map((range) => {
|
|
522
|
+
const parts = range.split("-").map((s) => s.trim());
|
|
523
|
+
if (parts.length !== 2) return null;
|
|
524
|
+
const start = parseTime(parts[0]);
|
|
525
|
+
const end = parseTime(parts[1]);
|
|
526
|
+
return { start, end };
|
|
527
|
+
}).filter((r) => r !== null && r.start < r.end);
|
|
528
|
+
}
|
|
529
|
+
function indexToDay(index) {
|
|
530
|
+
return DAYS[index % 7];
|
|
531
|
+
}
|
|
532
|
+
function getDayIndex(date) {
|
|
533
|
+
const jsDay = date.getDay();
|
|
534
|
+
return jsDay === 0 ? 6 : jsDay - 1;
|
|
535
|
+
}
|
|
536
|
+
function getTimeInMinutes(date) {
|
|
537
|
+
return date.getHours() * 60 + date.getMinutes();
|
|
538
|
+
}
|
|
539
|
+
function isInRanges(time, ranges) {
|
|
540
|
+
return ranges.some((range) => time >= range.start && time < range.end);
|
|
541
|
+
}
|
|
542
|
+
function findNextRange(time, ranges) {
|
|
543
|
+
const sorted = [...ranges].sort((a, b) => a.start - b.start);
|
|
544
|
+
return sorted.find((range) => range.start > time) ?? null;
|
|
545
|
+
}
|
|
546
|
+
function useOpeningHours(settings) {
|
|
547
|
+
const { t } = useTranslation();
|
|
548
|
+
return useMemo(() => {
|
|
549
|
+
if (!settings?.enabled || !settings?.hours) {
|
|
550
|
+
return {
|
|
551
|
+
isOpen: true,
|
|
552
|
+
// Assume open if not configured
|
|
553
|
+
isEnabled: false,
|
|
554
|
+
nextOpen: null,
|
|
555
|
+
nextOpenFormatted: ""
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
const hours = settings.hours;
|
|
559
|
+
const now = /* @__PURE__ */ new Date();
|
|
560
|
+
const currentDayIndex = getDayIndex(now);
|
|
561
|
+
const currentTime = getTimeInMinutes(now);
|
|
562
|
+
const schedule = {};
|
|
563
|
+
for (const day of DAYS) {
|
|
564
|
+
const dayRanges = hours[day];
|
|
565
|
+
schedule[day] = {
|
|
566
|
+
ranges: dayRanges ? parseRanges(dayRanges) : []
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
const todaySchedule = schedule[indexToDay(currentDayIndex)];
|
|
570
|
+
if (isInRanges(currentTime, todaySchedule.ranges)) {
|
|
571
|
+
return {
|
|
572
|
+
isOpen: true,
|
|
573
|
+
isEnabled: true,
|
|
574
|
+
nextOpen: null,
|
|
575
|
+
nextOpenFormatted: ""
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
const nextRangeToday = findNextRange(currentTime, todaySchedule.ranges);
|
|
579
|
+
if (nextRangeToday) {
|
|
580
|
+
const nextOpen = new Date(now);
|
|
581
|
+
nextOpen.setHours(Math.floor(nextRangeToday.start / 60), nextRangeToday.start % 60, 0, 0);
|
|
582
|
+
return {
|
|
583
|
+
isOpen: false,
|
|
584
|
+
isEnabled: true,
|
|
585
|
+
nextOpen,
|
|
586
|
+
nextOpenFormatted: formatNextOpen(nextOpen, t)
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
for (let i = 1; i <= 7; i++) {
|
|
590
|
+
const nextDayIndex = (currentDayIndex + i) % 7;
|
|
591
|
+
const nextDayName = indexToDay(nextDayIndex);
|
|
592
|
+
const nextDaySchedule = schedule[nextDayName];
|
|
593
|
+
if (nextDaySchedule.ranges.length > 0) {
|
|
594
|
+
const firstRange = [...nextDaySchedule.ranges].sort((a, b) => a.start - b.start)[0];
|
|
595
|
+
const nextOpen = new Date(now);
|
|
596
|
+
nextOpen.setDate(nextOpen.getDate() + i);
|
|
597
|
+
nextOpen.setHours(Math.floor(firstRange.start / 60), firstRange.start % 60, 0, 0);
|
|
598
|
+
return {
|
|
599
|
+
isOpen: false,
|
|
600
|
+
isEnabled: true,
|
|
601
|
+
nextOpen,
|
|
602
|
+
nextOpenFormatted: formatNextOpen(nextOpen, t)
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
return {
|
|
607
|
+
isOpen: true,
|
|
608
|
+
isEnabled: true,
|
|
609
|
+
nextOpen: null,
|
|
610
|
+
nextOpenFormatted: ""
|
|
611
|
+
};
|
|
612
|
+
}, [settings, t]);
|
|
613
|
+
}
|
|
614
|
+
function formatNextOpen(date, t) {
|
|
615
|
+
const dayName = t(DAY_NAMES[indexToDay(getDayIndex(date))]);
|
|
616
|
+
const hours = date.getHours();
|
|
617
|
+
const minutes = date.getMinutes().toString().padStart(2, "0");
|
|
618
|
+
const isPM = hours >= 12;
|
|
619
|
+
const displayHours = hours > 12 ? hours - 12 : hours === 0 ? 12 : hours;
|
|
620
|
+
const meridiem = t(TIME_NAMES[isPM ? "PM" : "AM"]);
|
|
621
|
+
return `${dayName} ${displayHours}:${minutes} ${meridiem}`;
|
|
622
|
+
}
|
|
623
|
+
function usePageConfig(pageData) {
|
|
624
|
+
const pageDataRef = useRef(pageData);
|
|
625
|
+
pageDataRef.current = pageData;
|
|
626
|
+
useEffect(() => {
|
|
627
|
+
const salla = window.salla;
|
|
628
|
+
if (!salla?.config?.set) {
|
|
629
|
+
if (process.env.NODE_ENV === "development") {
|
|
630
|
+
console.warn("[usePageConfig] salla.config.set not available. Page config not set.");
|
|
631
|
+
}
|
|
632
|
+
return;
|
|
633
|
+
}
|
|
634
|
+
const current = pageDataRef.current;
|
|
635
|
+
const url = current.url ?? window.location.pathname + window.location.search;
|
|
636
|
+
salla.config.set("page", {
|
|
637
|
+
...current,
|
|
638
|
+
url
|
|
639
|
+
});
|
|
640
|
+
}, []);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
// src/utils/breadcrumb.ts
|
|
644
|
+
var BREADCRUMB_REFERRER_KEY = "breadcrumb-referrer";
|
|
645
|
+
function getBreadcrumbReferrer() {
|
|
646
|
+
try {
|
|
647
|
+
const raw = sessionStorage.getItem(BREADCRUMB_REFERRER_KEY);
|
|
648
|
+
if (!raw) return null;
|
|
649
|
+
const { name, url } = JSON.parse(raw);
|
|
650
|
+
return typeof name === "string" && typeof url === "string" ? { name, url } : null;
|
|
651
|
+
} catch {
|
|
652
|
+
return null;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
function setBreadcrumbReferrer(breadcrumb) {
|
|
656
|
+
try {
|
|
657
|
+
sessionStorage.setItem(BREADCRUMB_REFERRER_KEY, JSON.stringify(breadcrumb));
|
|
658
|
+
} catch {
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
// src/hooks/useBreadcrumbs.ts
|
|
663
|
+
function useBreadcrumbs(page) {
|
|
664
|
+
const location = useLocation();
|
|
665
|
+
const isHome = useIsHome();
|
|
666
|
+
const { t } = useTranslation();
|
|
667
|
+
const [referrerCrumb, setReferrerCrumb] = useState(null);
|
|
668
|
+
useEffect(() => {
|
|
669
|
+
if (page?.slug === "product.single") {
|
|
670
|
+
const ref = getBreadcrumbReferrer();
|
|
671
|
+
if (ref) setReferrerCrumb(ref);
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
setReferrerCrumb(null);
|
|
675
|
+
if (!isHome && page) {
|
|
676
|
+
setBreadcrumbReferrer({ name: page.title, url: location.pathname + location.searchStr });
|
|
677
|
+
}
|
|
678
|
+
}, [page, isHome, location.pathname, location.searchStr]);
|
|
679
|
+
return useMemo(() => {
|
|
680
|
+
if (!page) return [];
|
|
681
|
+
if (page.breadcrumbs?.length) {
|
|
682
|
+
if (page.slug === "product.single" && referrerCrumb) {
|
|
683
|
+
const last = page.breadcrumbs.at(-1);
|
|
684
|
+
return last ? [page.breadcrumbs[0], referrerCrumb, last] : page.breadcrumbs;
|
|
685
|
+
}
|
|
686
|
+
return page.breadcrumbs;
|
|
687
|
+
}
|
|
688
|
+
if (isHome) return [];
|
|
689
|
+
const home = { name: t("common.titles.home"), url: "/" };
|
|
690
|
+
return [home, { name: page.title, url: location.pathname }];
|
|
691
|
+
}, [isHome, location.pathname, page, t, referrerCrumb]);
|
|
692
|
+
}
|
|
693
|
+
var GoogleTagBody = lazy(
|
|
694
|
+
() => import('./GoogleTag-4LHWC365.js').then((m) => ({ default: m.GoogleTagBody }))
|
|
695
|
+
);
|
|
696
|
+
var TwilightBundles = lazy(
|
|
697
|
+
() => import('./TwilightBundles-5F2H75VV.js').then((m) => ({ default: m.TwilightBundles }))
|
|
698
|
+
);
|
|
699
|
+
var LazySiftSnippet = lazy(
|
|
700
|
+
() => import('./SiftSnippet-X74S5KDO.js').then((m) => ({ default: m.SiftSnippet }))
|
|
701
|
+
);
|
|
702
|
+
var LazyStoreClosedNotification = lazy(
|
|
703
|
+
() => import('./StoreClosedNotification-KSB2GPEZ.js').then((m) => ({
|
|
704
|
+
default: m.StoreClosedNotification
|
|
705
|
+
}))
|
|
706
|
+
);
|
|
707
|
+
var LazyPriceQuoteButton = lazy(
|
|
708
|
+
() => import('./PriceQuoteButton-RAAPL4N4.js').then((m) => ({ default: m.PriceQuoteButton }))
|
|
709
|
+
);
|
|
710
|
+
var LazyPreOrderNotification = lazy(
|
|
711
|
+
() => import('./PreOrderNotification-ZVTGNV7K.js').then((m) => ({
|
|
712
|
+
default: m.PreOrderNotification
|
|
713
|
+
}))
|
|
714
|
+
);
|
|
715
|
+
function gtmHandler({ twilight }) {
|
|
716
|
+
if (!twilight?.store?.settings?.keys?.gtm?.length) {
|
|
717
|
+
return null;
|
|
718
|
+
}
|
|
719
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(GoogleTagBody, { gtmIds: twilight.store.settings.keys.gtm }) });
|
|
720
|
+
}
|
|
721
|
+
function useSiftHandler({ twilight }) {
|
|
722
|
+
const { data: user } = useUser();
|
|
723
|
+
if (!twilight?.store?.settings?.keys?.sift) {
|
|
724
|
+
return null;
|
|
725
|
+
}
|
|
726
|
+
const customerId = user?.type === "user" && user.id ? String(user.id) : "";
|
|
727
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazySiftSnippet, { beaconKey: twilight.store.settings.keys.sift, customerId }) });
|
|
728
|
+
}
|
|
729
|
+
function storeClosedHandler({ twilight }) {
|
|
730
|
+
if (!twilight?.store?.settings?.opening_hours?.enabled) {
|
|
731
|
+
return null;
|
|
732
|
+
}
|
|
733
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyStoreClosedNotification, {}) });
|
|
734
|
+
}
|
|
735
|
+
function bundlesHandler() {
|
|
736
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(TwilightBundles, {}) });
|
|
737
|
+
}
|
|
738
|
+
function priceQuoteHandler({ twilight }) {
|
|
739
|
+
if (!twilight?.store?.settings?.features?.price_quote) {
|
|
740
|
+
return null;
|
|
741
|
+
}
|
|
742
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyPriceQuoteButton, {}) });
|
|
743
|
+
}
|
|
744
|
+
function preOrderNotificationHandler({ twilight, cartItems }) {
|
|
745
|
+
if (!twilight?.store?.settings?.features?.["pre-order-campaigns"]) {
|
|
746
|
+
return null;
|
|
747
|
+
}
|
|
748
|
+
const items = cartItems;
|
|
749
|
+
const hasPreOrder = items?.some((item) => !item.parent_id && item.has_pre_order_campaign);
|
|
750
|
+
if (!hasPreOrder) {
|
|
751
|
+
return null;
|
|
752
|
+
}
|
|
753
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyPreOrderNotification, {}) });
|
|
754
|
+
}
|
|
755
|
+
function registerDefaultHooks() {
|
|
756
|
+
hookRegistry.register("body:start" /* BODY_START */, gtmHandler, 100);
|
|
757
|
+
hookRegistry.register("body:start" /* BODY_START */, useSiftHandler, 90);
|
|
758
|
+
hookRegistry.register("body:start" /* BODY_START */, storeClosedHandler, 80);
|
|
759
|
+
hookRegistry.register("body:end" /* BODY_END */, bundlesHandler, 100);
|
|
760
|
+
hookRegistry.register("cart:submit.start", priceQuoteHandler, 100);
|
|
761
|
+
hookRegistry.register("cart:items.start", preOrderNotificationHandler, 100);
|
|
762
|
+
}
|
|
763
|
+
registerDefaultHooks();
|
|
764
|
+
function Footer() {
|
|
765
|
+
const { store, theme } = useTwilight();
|
|
766
|
+
const { cdn } = useAsset();
|
|
767
|
+
const { t } = useTranslation();
|
|
768
|
+
const [isTaxModalOpen, setIsTaxModalOpen] = useState(false);
|
|
769
|
+
const [taxImageSrc, setTaxImageSrc] = useState("");
|
|
770
|
+
const handleTaxImageClick = (event) => {
|
|
771
|
+
event.preventDefault();
|
|
772
|
+
const modalId = event.currentTarget.dataset.modalId;
|
|
773
|
+
const modal = document.getElementById(modalId || "");
|
|
774
|
+
const img = modal?.querySelector("img");
|
|
775
|
+
const imgSrc = img?.dataset.src;
|
|
776
|
+
if (imgSrc) {
|
|
777
|
+
setTaxImageSrc(imgSrc);
|
|
778
|
+
setIsTaxModalOpen(true);
|
|
779
|
+
}
|
|
780
|
+
};
|
|
781
|
+
return /* @__PURE__ */ jsxs("footer", { className: "store-footer", suppressHydrationWarning: true, children: [
|
|
782
|
+
/* @__PURE__ */ jsx(HookSlot, { name: "footer:start" }),
|
|
783
|
+
/* @__PURE__ */ jsx("div", { "aria-label": "footer", className: "store-footer__inner", children: /* @__PURE__ */ jsxs("div", { className: "container grid grid-cols-1 lg:grid-cols-6 gap-8 lg:gap-6", children: [
|
|
784
|
+
/* @__PURE__ */ jsxs("div", { className: "lg:col-span-2 rtl:lg:pl-20 ltr:lg:pr-20", children: [
|
|
785
|
+
/* @__PURE__ */ jsx(Link, { to: "/", className: "flex items-center m-0", children: /* @__PURE__ */ jsx("h3", { children: store.name }) }),
|
|
786
|
+
store.description && /* @__PURE__ */ jsx(
|
|
787
|
+
"div",
|
|
788
|
+
{
|
|
789
|
+
className: "max-w-sm leading-6 mb-6",
|
|
790
|
+
dangerouslySetInnerHTML: { __html: store.description }
|
|
791
|
+
}
|
|
792
|
+
),
|
|
793
|
+
/* @__PURE__ */ jsx("div", { className: "hidden lg:block", children: /* @__PURE__ */ jsx(SallaSocial, { className: "block mb-6" }) }),
|
|
794
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [
|
|
795
|
+
/* @__PURE__ */ jsx(SallaTrustBadges, { ...theme.settings?.footer_is_dark ? { dark: true } : {} }),
|
|
796
|
+
store.settings?.tax?.number && /* @__PURE__ */ jsxs("div", { className: "flex rtl:space-x-reverse space-x-2 items-end", children: [
|
|
797
|
+
store.settings?.tax?.certificate && /* @__PURE__ */ jsx(
|
|
798
|
+
"a",
|
|
799
|
+
{
|
|
800
|
+
"data-modal-id": "modal-value-tax",
|
|
801
|
+
href: "#/",
|
|
802
|
+
"aria-label": store.settings?.tax?.number,
|
|
803
|
+
onClick: handleTaxImageClick,
|
|
804
|
+
children: /* @__PURE__ */ jsx(
|
|
805
|
+
"img",
|
|
806
|
+
{
|
|
807
|
+
width: 40,
|
|
808
|
+
height: 40,
|
|
809
|
+
src: cdn("/images/placeholder.png"),
|
|
810
|
+
className: "w-10 rounded-sm hover:opacity-80 transition-opacity",
|
|
811
|
+
alt: "value added tax",
|
|
812
|
+
loading: "lazy",
|
|
813
|
+
decoding: "async"
|
|
814
|
+
}
|
|
815
|
+
)
|
|
816
|
+
}
|
|
817
|
+
),
|
|
818
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
819
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-text-grey mb-1", children: t("common.elements.tax_number", "Tax Number") }),
|
|
820
|
+
/* @__PURE__ */ jsx("b", { className: "text-sm", children: store.settings?.tax?.number })
|
|
821
|
+
] })
|
|
822
|
+
] })
|
|
823
|
+
] })
|
|
824
|
+
] }),
|
|
825
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
826
|
+
/* @__PURE__ */ jsx("h3", { children: t("blocks.footer.pages_links", "Important Links") }),
|
|
827
|
+
/* @__PURE__ */ jsx(SallaMenu, { source: "footer" })
|
|
828
|
+
] }),
|
|
829
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
830
|
+
/* @__PURE__ */ jsx(
|
|
831
|
+
SallaContacts,
|
|
832
|
+
{
|
|
833
|
+
contacts: store.contacts,
|
|
834
|
+
contactsTitle: t("blocks.footer.social", "Stay in touch")
|
|
835
|
+
}
|
|
836
|
+
),
|
|
837
|
+
/* @__PURE__ */ jsx("div", { className: "lg:hidden contact-social", children: /* @__PURE__ */ jsx(SallaSocial, {}) })
|
|
838
|
+
] }),
|
|
839
|
+
/* @__PURE__ */ jsx(
|
|
840
|
+
SallaAppsIcons,
|
|
841
|
+
{
|
|
842
|
+
apps: store.apps,
|
|
843
|
+
appsTitle: t("blocks.footer.download_apps", "Get our apps"),
|
|
844
|
+
className: "lg:col-span-2 rtl:lg:pr-20 ltr:lg:pl-20"
|
|
845
|
+
}
|
|
846
|
+
)
|
|
847
|
+
] }) }),
|
|
848
|
+
/* @__PURE__ */ jsxs("div", { className: "md:flex items-center justify-between py-4 container text-center", children: [
|
|
849
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm copyright-text", children: /* @__PURE__ */ jsx(
|
|
850
|
+
HookSlot,
|
|
851
|
+
{
|
|
852
|
+
name: "copyright",
|
|
853
|
+
context: { storeName: store.name },
|
|
854
|
+
fallback: /* @__PURE__ */ jsx(Copyright, { storeName: store.name })
|
|
855
|
+
}
|
|
856
|
+
) }),
|
|
857
|
+
/* @__PURE__ */ jsx(SallaPayments, {})
|
|
858
|
+
] }),
|
|
859
|
+
/* @__PURE__ */ jsx("div", { id: "modal-value-tax", className: "hidden", children: /* @__PURE__ */ jsx(Image, { src: store.settings?.tax?.certificate || void 0, alt: "Tax Certificate" }) }),
|
|
860
|
+
/* @__PURE__ */ jsx(
|
|
861
|
+
LazyImageModal,
|
|
862
|
+
{
|
|
863
|
+
isOpen: isTaxModalOpen,
|
|
864
|
+
onClose: () => setIsTaxModalOpen(false),
|
|
865
|
+
src: taxImageSrc,
|
|
866
|
+
alt: "Tax Certificate",
|
|
867
|
+
title: t("common.elements.tax_certificate", "Tax Certificate")
|
|
868
|
+
}
|
|
869
|
+
),
|
|
870
|
+
/* @__PURE__ */ jsx(HookSlot, { name: "footer:end" })
|
|
871
|
+
] });
|
|
872
|
+
}
|
|
873
|
+
var SallaLoginModal = lazy(
|
|
874
|
+
() => import('@salla.sa/twilight-components-react/login-modal').then((m) => ({
|
|
875
|
+
default: m.SallaLoginModal
|
|
876
|
+
}))
|
|
877
|
+
);
|
|
878
|
+
var SallaScopes = lazy(
|
|
879
|
+
() => import('@salla.sa/twilight-components-react/scopes').then((m) => ({
|
|
880
|
+
default: m.SallaScopes
|
|
881
|
+
}))
|
|
882
|
+
);
|
|
883
|
+
var SallaOfferModal = lazy(
|
|
884
|
+
() => import('@salla.sa/twilight-components-react/offer-modal').then((m) => ({
|
|
885
|
+
default: m.SallaOfferModal
|
|
886
|
+
}))
|
|
887
|
+
);
|
|
888
|
+
function MasterLayout({ children }) {
|
|
889
|
+
const { store } = useTwilight();
|
|
890
|
+
const { isLoggedIn } = useUser();
|
|
891
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
892
|
+
/* @__PURE__ */ jsxs("div", { className: "app-inner flex flex-col min-h-full", children: [
|
|
893
|
+
/* @__PURE__ */ jsx(Header, {}),
|
|
894
|
+
/* @__PURE__ */ jsx("main", { id: "main-content", role: "main", className: "flex-1", children }),
|
|
895
|
+
/* @__PURE__ */ jsx(Footer, {})
|
|
896
|
+
] }),
|
|
897
|
+
/* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(SallaOfferModal, {}) }),
|
|
898
|
+
!isLoggedIn && /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(
|
|
899
|
+
SallaLoginModal,
|
|
900
|
+
{
|
|
901
|
+
isEmailAllowed: store?.settings?.auth?.email_allowed,
|
|
902
|
+
isMobileAllowed: store?.settings?.auth?.mobile_allowed,
|
|
903
|
+
isEmailRequired: store?.settings?.auth?.is_email_required,
|
|
904
|
+
suppressHydrationWarning: true
|
|
905
|
+
}
|
|
906
|
+
) }),
|
|
907
|
+
store?.scope && /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(
|
|
908
|
+
SallaScopes,
|
|
909
|
+
{
|
|
910
|
+
selection: store?.scope?.display_as === "popup" ? "mandatory" : "optional",
|
|
911
|
+
suppressHydrationWarning: true
|
|
912
|
+
}
|
|
913
|
+
) })
|
|
914
|
+
] });
|
|
915
|
+
}
|
|
916
|
+
var getSalla2 = () => typeof window !== "undefined" ? window.salla : void 0;
|
|
917
|
+
var TWILIGHT_LOG_STYLES = {
|
|
918
|
+
header: "background: linear-gradient(90deg, #7c3aed, #6366f1); color: white; padding: 4px 8px; border-radius: 4px; font-weight: bold;",
|
|
919
|
+
error: "background: #dc2626; color: white; padding: 2px 6px; border-radius: 3px; font-weight: bold;",
|
|
920
|
+
warn: "background: #f59e0b; color: white; padding: 2px 6px; border-radius: 3px; font-weight: bold;",
|
|
921
|
+
info: "background: #3b82f6; color: white; padding: 2px 6px; border-radius: 3px; font-weight: bold;",
|
|
922
|
+
label: "color: #7c3aed; font-weight: bold;",
|
|
923
|
+
value: "color: inherit;"
|
|
924
|
+
};
|
|
925
|
+
function TwilightProvider({
|
|
926
|
+
children,
|
|
927
|
+
debug = false,
|
|
928
|
+
skeleton,
|
|
929
|
+
translations: themeTranslations,
|
|
930
|
+
onReady,
|
|
931
|
+
onError,
|
|
932
|
+
client = { framework: "tanstack", interceptLinks: true },
|
|
933
|
+
toast = true,
|
|
934
|
+
toastMobilePosition = "bottom-center",
|
|
935
|
+
addToCartToast = true,
|
|
936
|
+
routeClass = true,
|
|
937
|
+
layout: LayoutComponent = MasterLayout
|
|
938
|
+
}) {
|
|
939
|
+
const ctx = getTwilightContext();
|
|
940
|
+
const initialLocale = ctx.locale || FALLBACK_LOCALE;
|
|
941
|
+
let initialData;
|
|
942
|
+
try {
|
|
943
|
+
initialData = ctx.settings;
|
|
944
|
+
} catch {
|
|
945
|
+
}
|
|
946
|
+
const [authToken, setAuthToken] = useState(() => {
|
|
947
|
+
if (typeof window !== "undefined") {
|
|
948
|
+
return ctx.authToken ?? window.localStorage.getItem(AUTH_TOKEN_COOKIE_NAME);
|
|
949
|
+
}
|
|
950
|
+
return null;
|
|
951
|
+
});
|
|
952
|
+
useEffect(() => {
|
|
953
|
+
if (typeof window === "undefined") return;
|
|
954
|
+
const sdk = getSalla2();
|
|
955
|
+
if (!sdk?.auth?.event) return;
|
|
956
|
+
const writeAuthCookie = (token) => {
|
|
957
|
+
document.cookie = `${AUTH_TOKEN_COOKIE_NAME}=${token}; path=/; max-age=${60 * 60 * 24 * 30}; SameSite=Lax; Secure`;
|
|
958
|
+
};
|
|
959
|
+
const clearAuthCookie = clearAuthTokenCookie;
|
|
960
|
+
const setSdkUserType = (type) => {
|
|
961
|
+
sdk.config?.set?.("user.type", type);
|
|
962
|
+
};
|
|
963
|
+
const handleLogin = () => {
|
|
964
|
+
const newToken = sdk.storage.get(AUTH_TOKEN_COOKIE_NAME);
|
|
965
|
+
if (!newToken) return;
|
|
966
|
+
setAuthToken(newToken);
|
|
967
|
+
updateTwilightContext({ authToken: newToken });
|
|
968
|
+
setSdkUserType("user");
|
|
969
|
+
};
|
|
970
|
+
const handleTokenFetched = (token) => {
|
|
971
|
+
if (typeof token !== "string" || !token) return;
|
|
972
|
+
setAuthToken(token);
|
|
973
|
+
updateTwilightContext({ authToken: token });
|
|
974
|
+
writeAuthCookie(token);
|
|
975
|
+
setSdkUserType("user");
|
|
976
|
+
};
|
|
977
|
+
const handleLogout = () => {
|
|
978
|
+
const wasLoggedIn = Boolean(getTwilightContext().authToken);
|
|
979
|
+
setAuthToken(null);
|
|
980
|
+
updateTwilightContext({ authToken: null });
|
|
981
|
+
setSdkUserType("guest");
|
|
982
|
+
try {
|
|
983
|
+
clearAuthCookie();
|
|
984
|
+
} catch {
|
|
985
|
+
}
|
|
986
|
+
if (wasLoggedIn) {
|
|
987
|
+
window.setTimeout(() => window.location.reload(), 3500);
|
|
988
|
+
}
|
|
989
|
+
};
|
|
990
|
+
const handleTokenInvalid = () => {
|
|
991
|
+
setAuthToken(null);
|
|
992
|
+
updateTwilightContext({ authToken: null });
|
|
993
|
+
setSdkUserType("guest");
|
|
994
|
+
try {
|
|
995
|
+
window.localStorage.removeItem(AUTH_TOKEN_COOKIE_NAME);
|
|
996
|
+
sdk.storage.remove?.(AUTH_TOKEN_COOKIE_NAME);
|
|
997
|
+
clearAuthCookie();
|
|
998
|
+
} catch {
|
|
999
|
+
}
|
|
1000
|
+
};
|
|
1001
|
+
sdk.auth.event.onLoggedIn(handleLogin);
|
|
1002
|
+
sdk.auth.event.onLoggedOut(handleLogout);
|
|
1003
|
+
sdk.event.on("auth::token.invalid", handleTokenInvalid);
|
|
1004
|
+
sdk.event.on("auth::token.fetched", handleTokenFetched);
|
|
1005
|
+
sdk.event.on("api::token.injected", handleTokenFetched);
|
|
1006
|
+
return () => {
|
|
1007
|
+
sdk.event.off("auth::loggedIn", handleLogin);
|
|
1008
|
+
sdk.event.off("auth::loggedOut", handleLogout);
|
|
1009
|
+
sdk.event.off("auth::token.invalid", handleTokenInvalid);
|
|
1010
|
+
sdk.event.off("auth::token.fetched", handleTokenFetched);
|
|
1011
|
+
sdk.event.off("api::token.injected", handleTokenFetched);
|
|
1012
|
+
};
|
|
1013
|
+
}, []);
|
|
1014
|
+
const { isReady, storeData, setStoreData, themeData, currency, isMobileWebview } = useTwilightInit({
|
|
1015
|
+
debug,
|
|
1016
|
+
initialData,
|
|
1017
|
+
onReady,
|
|
1018
|
+
onError,
|
|
1019
|
+
initialLocale
|
|
1020
|
+
});
|
|
1021
|
+
const config = useMemo(() => ({ debug }), [debug]);
|
|
1022
|
+
const log = useMemo(
|
|
1023
|
+
() => ({
|
|
1024
|
+
groupCollapsed: (title) => console.groupCollapsed(`%c \u26A1 Twilight: ${title} `, TWILIGHT_LOG_STYLES.header),
|
|
1025
|
+
group: (title) => console.group(`%c${title}`, TWILIGHT_LOG_STYLES.label),
|
|
1026
|
+
groupEnd: () => console.groupEnd(),
|
|
1027
|
+
error: (label, value) => console.log(`%c[${label}]%c`, TWILIGHT_LOG_STYLES.error, TWILIGHT_LOG_STYLES.value, value),
|
|
1028
|
+
warn: (label, value) => console.log(`%c[${label}]%c`, TWILIGHT_LOG_STYLES.warn, TWILIGHT_LOG_STYLES.value, value),
|
|
1029
|
+
info: (label, value) => console.log(`%c[${label}]%c`, TWILIGHT_LOG_STYLES.info, TWILIGHT_LOG_STYLES.value, value),
|
|
1030
|
+
label: (label, value) => console.log(`%c[${label}]%c`, TWILIGHT_LOG_STYLES.label, TWILIGHT_LOG_STYLES.value, value),
|
|
1031
|
+
dir: (label, value) => {
|
|
1032
|
+
console.log(`%c${label}`, TWILIGHT_LOG_STYLES.label);
|
|
1033
|
+
console.dir(value);
|
|
1034
|
+
},
|
|
1035
|
+
trace: (label, trace) => {
|
|
1036
|
+
console.log(`%c${label}`, TWILIGHT_LOG_STYLES.label);
|
|
1037
|
+
console.error(trace);
|
|
1038
|
+
}
|
|
1039
|
+
}),
|
|
1040
|
+
[]
|
|
1041
|
+
);
|
|
1042
|
+
const contextValue = useMemo(
|
|
1043
|
+
() => ({
|
|
1044
|
+
isReady,
|
|
1045
|
+
store: storeData,
|
|
1046
|
+
_setStore: setStoreData,
|
|
1047
|
+
theme: themeData,
|
|
1048
|
+
currency,
|
|
1049
|
+
config,
|
|
1050
|
+
log,
|
|
1051
|
+
get salla() {
|
|
1052
|
+
return getSalla2();
|
|
1053
|
+
},
|
|
1054
|
+
get settings() {
|
|
1055
|
+
return getTwilightContext().settings;
|
|
1056
|
+
},
|
|
1057
|
+
get locale() {
|
|
1058
|
+
return getTwilightContext().locale;
|
|
1059
|
+
},
|
|
1060
|
+
get routeId() {
|
|
1061
|
+
return getTwilightContext().routeId;
|
|
1062
|
+
},
|
|
1063
|
+
get location() {
|
|
1064
|
+
return getTwilightContext().location;
|
|
1065
|
+
},
|
|
1066
|
+
get authToken() {
|
|
1067
|
+
return authToken;
|
|
1068
|
+
},
|
|
1069
|
+
get i18n() {
|
|
1070
|
+
return getTwilightContext().i18n;
|
|
1071
|
+
},
|
|
1072
|
+
get dir() {
|
|
1073
|
+
return getTwilightContext().dir;
|
|
1074
|
+
},
|
|
1075
|
+
get extras() {
|
|
1076
|
+
return getTwilightContext().extras;
|
|
1077
|
+
}
|
|
1078
|
+
}),
|
|
1079
|
+
[isReady, storeData, setStoreData, themeData, currency, config, log, authToken]
|
|
1080
|
+
);
|
|
1081
|
+
const framework = client !== false ? client?.framework ?? "tanstack" : null;
|
|
1082
|
+
const LazyNavSetup = framework ? navigationSetups[framework] : null;
|
|
1083
|
+
const LazyDocumentSync = routeClass && framework ? routeDocumentSyncs[framework] : null;
|
|
1084
|
+
const interceptLinks = client !== false && (client?.interceptLinks ?? true);
|
|
1085
|
+
const documentSyncElement = useMemo(
|
|
1086
|
+
() => LazyDocumentSync ? React2.createElement(LazyDocumentSync) : null,
|
|
1087
|
+
[LazyDocumentSync]
|
|
1088
|
+
);
|
|
1089
|
+
const readyShell = useMemo(() => {
|
|
1090
|
+
if (!isReady) return null;
|
|
1091
|
+
return {
|
|
1092
|
+
LayoutComponent,
|
|
1093
|
+
LazyNavSetup,
|
|
1094
|
+
toast,
|
|
1095
|
+
toastMobilePosition,
|
|
1096
|
+
addToCartToast,
|
|
1097
|
+
interceptLinks
|
|
1098
|
+
};
|
|
1099
|
+
}, [
|
|
1100
|
+
isReady,
|
|
1101
|
+
LazyNavSetup,
|
|
1102
|
+
LayoutComponent,
|
|
1103
|
+
toast,
|
|
1104
|
+
toastMobilePosition,
|
|
1105
|
+
addToCartToast,
|
|
1106
|
+
interceptLinks
|
|
1107
|
+
]);
|
|
1108
|
+
const readyContent = useMemo(() => {
|
|
1109
|
+
if (!readyShell) return null;
|
|
1110
|
+
const inner = readyShell.LayoutComponent ? /* @__PURE__ */ jsx(readyShell.LayoutComponent, { children }) : children;
|
|
1111
|
+
const wrapped = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1112
|
+
/* @__PURE__ */ jsx(WidgetHead, {}),
|
|
1113
|
+
/* @__PURE__ */ jsx(HookSlot, { name: "body:start" /* BODY_START */ }),
|
|
1114
|
+
/* @__PURE__ */ jsxs(Suspense, { fallback: null, children: [
|
|
1115
|
+
readyShell.toast && /* @__PURE__ */ jsx(
|
|
1116
|
+
Toaster,
|
|
1117
|
+
{
|
|
1118
|
+
mobilePosition: readyShell.toastMobilePosition,
|
|
1119
|
+
addToCartToast: readyShell.addToCartToast
|
|
1120
|
+
}
|
|
1121
|
+
),
|
|
1122
|
+
readyShell.interceptLinks && /* @__PURE__ */ jsx(NavigationInterceptor, {})
|
|
1123
|
+
] }),
|
|
1124
|
+
inner,
|
|
1125
|
+
/* @__PURE__ */ jsx(HookSlot, { name: "body:end" /* BODY_END */ })
|
|
1126
|
+
] });
|
|
1127
|
+
if (readyShell.LazyNavSetup) {
|
|
1128
|
+
return React2.createElement(readyShell.LazyNavSetup, null, wrapped);
|
|
1129
|
+
}
|
|
1130
|
+
return wrapped;
|
|
1131
|
+
}, [readyShell]);
|
|
1132
|
+
const i18nInstance = useMemo(() => getTwilightContext().i18n, [initialLocale]);
|
|
1133
|
+
return /* @__PURE__ */ jsx(DocumentClassProvider, { children: /* @__PURE__ */ jsx(TwilightContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(I18nProvider, { i18nInstance, themeTranslations, children: [
|
|
1134
|
+
/* @__PURE__ */ jsx(
|
|
1135
|
+
ThemeDocumentSync,
|
|
1136
|
+
{
|
|
1137
|
+
theme: themeData,
|
|
1138
|
+
locale: initialLocale,
|
|
1139
|
+
direction: getTwilightContext().dir,
|
|
1140
|
+
isMobileWebview
|
|
1141
|
+
}
|
|
1142
|
+
),
|
|
1143
|
+
documentSyncElement,
|
|
1144
|
+
!isReady && /* @__PURE__ */ jsx("div", { className: "loading-overlay", children: skeleton || /* @__PURE__ */ jsx("div", { className: "loading-spinner" }) }),
|
|
1145
|
+
readyContent
|
|
1146
|
+
] }) }) });
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
// src/hooks/useStore.ts
|
|
1150
|
+
function useStore() {
|
|
1151
|
+
const { store, _setStore, salla } = useTwilight();
|
|
1152
|
+
const refresh = useCallback(async () => {
|
|
1153
|
+
if (!salla) return;
|
|
1154
|
+
try {
|
|
1155
|
+
const data = salla.config.all();
|
|
1156
|
+
if (data?.store && typeof data.store === "object") {
|
|
1157
|
+
_setStore((prev) => ({ ...prev, ...data.store }));
|
|
1158
|
+
}
|
|
1159
|
+
} catch {
|
|
1160
|
+
}
|
|
1161
|
+
}, [salla, _setStore]);
|
|
1162
|
+
return { ...store, refresh };
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
export { Footer, MasterLayout, TwilightProvider, registerDefaultHooks, useBreadcrumbs, useDate, useGtm, useMoney, useNumber, useOpeningHours, usePageConfig, useStore };
|
|
1166
|
+
//# sourceMappingURL=chunk-GLM3RPCP.js.map
|
|
1167
|
+
//# sourceMappingURL=chunk-GLM3RPCP.js.map
|