@salla.sa/twilight-components 2.14.169 → 2.14.171
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-BoUZB3a1.js → app-globals-CoUrP7Bc.js} +3 -3
- package/dist/cjs/{app-globals-BoUZB3a1.js.map → app-globals-CoUrP7Bc.js.map} +1 -1
- package/dist/cjs/{index-BWKozh1s.js → index-C0Vb2Bnd.js} +4 -4
- package/dist/cjs/index-C0Vb2Bnd.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-add-product-button_49.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +11 -7
- package/dist/cjs/salla-offer.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-offer.entry.cjs.js.map +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/collection/components/salla-offer/salla-offer.js +10 -6
- package/dist/collection/components/salla-offer/salla-offer.js.map +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/salla-offer.js +10 -6
- package/dist/components/salla-offer.js.map +1 -1
- package/dist/esm/{app-globals-CwEDGq3R.js → app-globals-CSF3zqJZ.js} +3 -3
- package/dist/esm/{app-globals-CwEDGq3R.js.map → app-globals-CSF3zqJZ.js.map} +1 -1
- package/dist/esm/{index-CuX9W8-2.js → index-LiUkE7QA.js} +4 -4
- package/dist/esm/index-LiUkE7QA.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-add-product-button_49.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-booking-field_2.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +1 -1
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +11 -7
- package/dist/esm/salla-offer.entry.js.map +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-options.entry.js +1 -1
- package/dist/esm/salla-review-card.entry.js +1 -1
- package/dist/esm/salla-reviews-page.entry.js +1 -1
- package/dist/esm/salla-reviews.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm-es5/{app-globals-CwEDGq3R.js → app-globals-CSF3zqJZ.js} +2 -2
- package/dist/esm-es5/{app-globals-CwEDGq3R.js.map → app-globals-CSF3zqJZ.js.map} +1 -1
- package/dist/esm-es5/{index-CuX9W8-2.js → index-LiUkE7QA.js} +3 -3
- package/dist/esm-es5/index-LiUkE7QA.js.map +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-add-product-button_49.entry.js +1 -1
- package/dist/esm-es5/salla-advertisement.entry.js +1 -1
- package/dist/esm-es5/salla-app-install-alert.entry.js +1 -1
- package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
- package/dist/esm-es5/salla-booking-field_2.entry.js +1 -1
- package/dist/esm-es5/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm-es5/salla-conditional-offer.entry.js +1 -1
- package/dist/esm-es5/salla-contacts.entry.js +1 -1
- package/dist/esm-es5/salla-filters-widget.entry.js +2 -2
- package/dist/esm-es5/salla-filters.entry.js +1 -1
- package/dist/esm-es5/salla-installment.entry.js +1 -1
- package/dist/esm-es5/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm-es5/salla-metadata.entry.js +1 -1
- package/dist/esm-es5/salla-notification-item.entry.js +1 -1
- package/dist/esm-es5/salla-notifications.entry.js +1 -1
- package/dist/esm-es5/salla-offer.entry.js +2 -2
- package/dist/esm-es5/salla-offer.entry.js.map +1 -1
- package/dist/esm-es5/salla-order-summary.entry.js +1 -1
- package/dist/esm-es5/salla-orders.entry.js +1 -1
- package/dist/esm-es5/salla-payments.entry.js +1 -1
- package/dist/esm-es5/salla-price-range.entry.js +1 -1
- package/dist/esm-es5/salla-product-options.entry.js +1 -1
- package/dist/esm-es5/salla-review-card.entry.js +1 -1
- package/dist/esm-es5/salla-reviews-page.entry.js +1 -1
- package/dist/esm-es5/salla-reviews.entry.js +1 -1
- package/dist/esm-es5/salla-social.entry.js +1 -1
- package/dist/esm-es5/salla-tooltip.entry.js +1 -1
- package/dist/esm-es5/salla-verify.entry.js +1 -1
- package/dist/esm-es5/salla-wallet.entry.js +1 -1
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/twilight/{p-47934c4e.entry.js → p-02844499.entry.js} +2 -2
- package/dist/twilight/{p-ad0fbfa6.system.entry.js → p-0398e027.system.entry.js} +2 -2
- package/dist/twilight/p-0736f49e.system.entry.js +5 -0
- package/dist/twilight/p-0736f49e.system.entry.js.map +1 -0
- package/dist/twilight/{p-f6e7ecbc.system.entry.js → p-09f9b1c7.system.entry.js} +2 -2
- package/dist/twilight/{p-2843bbc2.entry.js → p-12bfaebb.entry.js} +2 -2
- package/dist/twilight/{p-a89f68e7.system.entry.js → p-1d364b10.system.entry.js} +2 -2
- package/dist/twilight/{p-8048f1d6.entry.js → p-1e6cc35c.entry.js} +2 -2
- package/dist/twilight/{p-a79ef46e.system.entry.js → p-228e378a.system.entry.js} +2 -2
- package/dist/twilight/{p-112bf141.system.entry.js → p-2780506f.system.entry.js} +2 -2
- package/dist/twilight/{p-201024e0.system.entry.js → p-27fa210f.system.entry.js} +2 -2
- package/dist/twilight/{p-18f66902.entry.js → p-2c6b0290.entry.js} +2 -2
- package/dist/twilight/p-30d8107f.system.entry.js +5 -0
- package/dist/twilight/{p-370845af.entry.js → p-3c82a2ea.entry.js} +2 -2
- package/dist/twilight/{p-3785e723.entry.js → p-3f9cd841.entry.js} +2 -2
- package/dist/twilight/{p-4ac5fe2f.system.entry.js → p-41a0c995.system.entry.js} +2 -2
- package/dist/twilight/{p-e5da17ea.system.entry.js → p-4b94b4d5.system.entry.js} +2 -2
- package/dist/twilight/{p-1d188da4.system.entry.js → p-4d3191f1.system.entry.js} +3 -3
- package/dist/twilight/{p-8789b6c2.entry.js → p-524f35f6.entry.js} +2 -2
- package/dist/twilight/{p-b7ac1f59.entry.js → p-573b6006.entry.js} +2 -2
- package/dist/twilight/{p-29f68ed0.system.entry.js → p-5d01641c.system.entry.js} +2 -2
- package/dist/twilight/{p-e417e90b.system.entry.js → p-65518c0a.system.entry.js} +2 -2
- package/dist/twilight/p-702258d0.entry.js +5 -0
- package/dist/twilight/p-702258d0.entry.js.map +1 -0
- package/dist/twilight/{p-179bb8bf.entry.js → p-7222192c.entry.js} +2 -2
- package/dist/twilight/{p-56c65079.entry.js → p-733cb343.entry.js} +2 -2
- package/dist/twilight/{p-CsC_yQhI.system.js.map → p-80ECHVzY.system.js.map} +1 -1
- package/dist/twilight/{p-36f98cde.entry.js → p-872e0e93.entry.js} +2 -2
- package/dist/twilight/{p-8a91e472.entry.js → p-8d39c410.entry.js} +2 -2
- package/dist/twilight/{p-cebe179f.entry.js → p-8d6211ec.entry.js} +2 -2
- package/dist/twilight/{p-235cbf70.system.entry.js → p-8e2e5da6.system.entry.js} +2 -2
- package/dist/twilight/{p-029699d6.system.entry.js → p-8f046206.system.entry.js} +2 -2
- package/dist/twilight/{p-3bfff977.entry.js → p-8ff9f4d9.entry.js} +2 -2
- package/dist/twilight/{p-293146f5.entry.js → p-9141f034.entry.js} +2 -2
- package/dist/twilight/p-93c132a7.entry.js +5 -0
- package/dist/twilight/{p-12acc282.entry.js → p-97314074.entry.js} +2 -2
- package/dist/twilight/{p-pkeNY4bC.js → p-B41fVqSK.js} +2 -2
- package/dist/twilight/{p-pkeNY4bC.js.map → p-B41fVqSK.js.map} +1 -1
- package/dist/twilight/{p-D7Dloap6.system.js.map → p-BPkmPLyb.system.js.map} +1 -1
- package/dist/twilight/{p-D9KnO5hQ.system.js.map → p-BRyMdU18.system.js.map} +1 -1
- package/dist/twilight/{p-PUBQuNfU.system.js → p-BcXA9D_n.system.js} +2 -2
- package/dist/twilight/{p-PUBQuNfU.system.js.map → p-BcXA9D_n.system.js.map} +1 -1
- package/dist/twilight/{p-COgBa8Lc.system.js.map → p-Bdm0DMVs.system.js.map} +1 -1
- package/dist/twilight/{p-BTQ1EOg3.system.js.map → p-BgqCi424.system.js.map} +1 -1
- package/dist/twilight/{p-C4-v3Net.system.js → p-BjC8fmj6.system.js} +2 -2
- package/dist/twilight/{p-C4-v3Net.system.js.map → p-BjC8fmj6.system.js.map} +1 -1
- package/dist/twilight/{p-Cvl19kge.system.js.map → p-Bjw432F2.system.js.map} +1 -1
- package/dist/twilight/{p-YNjvWyUK.system.js.map → p-BnJBAsTe.system.js.map} +1 -1
- package/dist/twilight/{p-DUGe2rzI.system.js.map → p-BuUD_anz.system.js.map} +1 -1
- package/dist/twilight/{p-BIw4a5uz.system.js.map → p-C0YKkJRc.system.js.map} +1 -1
- package/dist/twilight/{p-NkwyCRc1.system.js.map → p-C7fl3xeP.system.js.map} +1 -1
- package/dist/twilight/{p-CZoKJ5-E.system.js.map → p-CDy0KAOd.system.js.map} +1 -1
- package/dist/twilight/{p-CaYouQpI.system.js.map → p-CHrCH5-b.system.js.map} +1 -1
- package/dist/twilight/{p-Bhruxjmw.system.js.map → p-CK-QWMoJ.system.js.map} +1 -1
- package/dist/twilight/{p-DpFp-2Zs.system.js.map → p-CKJsTcpM.system.js.map} +1 -1
- package/dist/twilight/{p-BuOx76hB.system.js.map → p-CLu8tbvy.system.js.map} +1 -1
- package/dist/twilight/{p-P7DlFA1O.system.js.map → p-CNOk3SrL.system.js.map} +1 -1
- package/dist/twilight/p-CjFQPix4.system.js.map +1 -0
- package/dist/twilight/{p-CoOGtM-m.system.js → p-D-0D-Csi.system.js} +3 -3
- package/dist/twilight/p-D-0D-Csi.system.js.map +1 -0
- package/dist/twilight/{p-Cw14WboL.system.js.map → p-D1W-OG00.system.js.map} +1 -1
- package/dist/twilight/{p-MMQ6xKef.system.js.map → p-D4qzuSae.system.js.map} +1 -1
- package/dist/twilight/{p-CRkmHFb4.system.js.map → p-DBJi00fV.system.js.map} +1 -1
- package/dist/twilight/{p-C6isiqjE.system.js.map → p-DEYXxIq_.system.js.map} +1 -1
- package/dist/twilight/{p-CJB03tTB.system.js.map → p-DJ4xzdd6.system.js.map} +1 -1
- package/dist/twilight/{p-npoaNj5c.system.js.map → p-DJxn4O4E.system.js.map} +1 -1
- package/dist/twilight/{p-WH24PIzv.system.js.map → p-Drwx-n0N.system.js.map} +1 -1
- package/dist/twilight/{p-BIaBuVSh.system.js.map → p-Dw0aLYK1.system.js.map} +1 -1
- package/dist/twilight/{p-OLdxVyC9.system.js.map → p-DyTZuKIw.system.js.map} +1 -1
- package/dist/twilight/{p-CuX9W8-2.js → p-LiUkE7QA.js} +3 -3
- package/dist/twilight/p-LiUkE7QA.js.map +1 -0
- package/dist/twilight/{p-DWfLJYvk.system.js.map → p-Oac7J1zA.system.js.map} +1 -1
- package/dist/twilight/{p-DTQ2hhZt.system.js.map → p-Om_u4Egx.system.js.map} +1 -1
- package/dist/twilight/{p-CIxoSry2.system.js.map → p-WXH08GLX.system.js.map} +1 -1
- package/dist/twilight/{p-24bc4da0.system.entry.js → p-a1ce8510.system.entry.js} +2 -2
- package/dist/twilight/{p-a6c6a6c3.entry.js → p-a5f6800a.entry.js} +2 -2
- package/dist/twilight/{p-ed87b8dd.system.entry.js → p-ab2e6e46.system.entry.js} +2 -2
- package/dist/twilight/{p-42ce7ef4.entry.js → p-aecbfd1d.entry.js} +2 -2
- package/dist/twilight/{p-8f4e1a84.entry.js → p-aef8742e.entry.js} +2 -2
- package/dist/twilight/{p-07f036e4.system.entry.js → p-b5d67a2f.system.entry.js} +2 -2
- package/dist/twilight/{p-30502659.system.entry.js → p-b905ab43.system.entry.js} +6 -6
- package/dist/twilight/{p-34a905a7.system.entry.js → p-bf53423f.system.entry.js} +2 -2
- package/dist/twilight/{p-536654d3.system.entry.js → p-c37c4334.system.entry.js} +2 -2
- package/dist/twilight/{p-7cdc853e.entry.js → p-c58c7583.entry.js} +2 -2
- package/dist/twilight/{p-94089b7a.system.entry.js → p-d5ce6328.system.entry.js} +2 -2
- package/dist/twilight/{p-dcacb98b.system.entry.js → p-d6c38604.system.entry.js} +2 -2
- package/dist/twilight/{p-4587e3ce.system.entry.js → p-d7f60971.system.entry.js} +2 -2
- package/dist/twilight/{p-e9fc448e.entry.js → p-dc49a423.entry.js} +2 -2
- package/dist/twilight/{p-30c6ae2a.system.entry.js → p-e287bf7a.system.entry.js} +2 -2
- package/dist/twilight/{p-62b56fba.entry.js → p-e34ad807.entry.js} +2 -2
- package/dist/twilight/{p-42b2e187.system.entry.js → p-e776a27b.system.entry.js} +2 -2
- package/dist/twilight/{p-ff618221.system.entry.js → p-e9bf33ee.system.entry.js} +2 -2
- package/dist/twilight/{p-6689a066.entry.js → p-ea280e73.entry.js} +2 -2
- package/dist/twilight/{p-775b84cc.entry.js → p-edf6d3c2.entry.js} +2 -2
- package/dist/twilight/{p-21ee087a.entry.js → p-f77d0e8b.entry.js} +2 -2
- package/dist/twilight/{p-9f59ac19.entry.js → p-f8478e12.entry.js} +7 -7
- package/dist/twilight/{p-a03eaa39.system.entry.js → p-fd05b59d.system.entry.js} +2 -2
- package/dist/twilight/salla-offer.entry.esm.js.map +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/package.json +5 -5
- package/dist/cjs/index-BWKozh1s.js.map +0 -1
- package/dist/esm/index-CuX9W8-2.js.map +0 -1
- package/dist/esm-es5/index-CuX9W8-2.js.map +0 -1
- package/dist/twilight/p-6ec40d48.system.entry.js +0 -5
- package/dist/twilight/p-6ec40d48.system.entry.js.map +0 -1
- package/dist/twilight/p-BLZE-bTt.system.js.map +0 -1
- package/dist/twilight/p-CoOGtM-m.system.js.map +0 -1
- package/dist/twilight/p-CuX9W8-2.js.map +0 -1
- package/dist/twilight/p-a8a838f0.entry.js +0 -5
- package/dist/twilight/p-a8a838f0.entry.js.map +0 -1
- package/dist/twilight/p-c27511c1.entry.js +0 -5
- package/dist/twilight/p-f92ef489.system.entry.js +0 -5
- /package/dist/twilight/{p-47934c4e.entry.js.map → p-02844499.entry.js.map} +0 -0
- /package/dist/twilight/{p-ad0fbfa6.system.entry.js.map → p-0398e027.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-f6e7ecbc.system.entry.js.map → p-09f9b1c7.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2843bbc2.entry.js.map → p-12bfaebb.entry.js.map} +0 -0
- /package/dist/twilight/{p-a89f68e7.system.entry.js.map → p-1d364b10.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-8048f1d6.entry.js.map → p-1e6cc35c.entry.js.map} +0 -0
- /package/dist/twilight/{p-a79ef46e.system.entry.js.map → p-228e378a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-112bf141.system.entry.js.map → p-2780506f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-201024e0.system.entry.js.map → p-27fa210f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-18f66902.entry.js.map → p-2c6b0290.entry.js.map} +0 -0
- /package/dist/twilight/{p-f92ef489.system.entry.js.map → p-30d8107f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-370845af.entry.js.map → p-3c82a2ea.entry.js.map} +0 -0
- /package/dist/twilight/{p-3785e723.entry.js.map → p-3f9cd841.entry.js.map} +0 -0
- /package/dist/twilight/{p-4ac5fe2f.system.entry.js.map → p-41a0c995.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e5da17ea.system.entry.js.map → p-4b94b4d5.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-1d188da4.system.entry.js.map → p-4d3191f1.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-8789b6c2.entry.js.map → p-524f35f6.entry.js.map} +0 -0
- /package/dist/twilight/{p-b7ac1f59.entry.js.map → p-573b6006.entry.js.map} +0 -0
- /package/dist/twilight/{p-29f68ed0.system.entry.js.map → p-5d01641c.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e417e90b.system.entry.js.map → p-65518c0a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-179bb8bf.entry.js.map → p-7222192c.entry.js.map} +0 -0
- /package/dist/twilight/{p-56c65079.entry.js.map → p-733cb343.entry.js.map} +0 -0
- /package/dist/twilight/{p-36f98cde.entry.js.map → p-872e0e93.entry.js.map} +0 -0
- /package/dist/twilight/{p-8a91e472.entry.js.map → p-8d39c410.entry.js.map} +0 -0
- /package/dist/twilight/{p-cebe179f.entry.js.map → p-8d6211ec.entry.js.map} +0 -0
- /package/dist/twilight/{p-235cbf70.system.entry.js.map → p-8e2e5da6.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-029699d6.system.entry.js.map → p-8f046206.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-3bfff977.entry.js.map → p-8ff9f4d9.entry.js.map} +0 -0
- /package/dist/twilight/{p-293146f5.entry.js.map → p-9141f034.entry.js.map} +0 -0
- /package/dist/twilight/{p-c27511c1.entry.js.map → p-93c132a7.entry.js.map} +0 -0
- /package/dist/twilight/{p-12acc282.entry.js.map → p-97314074.entry.js.map} +0 -0
- /package/dist/twilight/{p-24bc4da0.system.entry.js.map → p-a1ce8510.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-a6c6a6c3.entry.js.map → p-a5f6800a.entry.js.map} +0 -0
- /package/dist/twilight/{p-ed87b8dd.system.entry.js.map → p-ab2e6e46.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-42ce7ef4.entry.js.map → p-aecbfd1d.entry.js.map} +0 -0
- /package/dist/twilight/{p-8f4e1a84.entry.js.map → p-aef8742e.entry.js.map} +0 -0
- /package/dist/twilight/{p-07f036e4.system.entry.js.map → p-b5d67a2f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-30502659.system.entry.js.map → p-b905ab43.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-34a905a7.system.entry.js.map → p-bf53423f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-536654d3.system.entry.js.map → p-c37c4334.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-7cdc853e.entry.js.map → p-c58c7583.entry.js.map} +0 -0
- /package/dist/twilight/{p-94089b7a.system.entry.js.map → p-d5ce6328.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-dcacb98b.system.entry.js.map → p-d6c38604.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4587e3ce.system.entry.js.map → p-d7f60971.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e9fc448e.entry.js.map → p-dc49a423.entry.js.map} +0 -0
- /package/dist/twilight/{p-30c6ae2a.system.entry.js.map → p-e287bf7a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-62b56fba.entry.js.map → p-e34ad807.entry.js.map} +0 -0
- /package/dist/twilight/{p-42b2e187.system.entry.js.map → p-e776a27b.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ff618221.system.entry.js.map → p-e9bf33ee.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6689a066.entry.js.map → p-ea280e73.entry.js.map} +0 -0
- /package/dist/twilight/{p-775b84cc.entry.js.map → p-edf6d3c2.entry.js.map} +0 -0
- /package/dist/twilight/{p-21ee087a.entry.js.map → p-f77d0e8b.entry.js.map} +0 -0
- /package/dist/twilight/{p-9f59ac19.entry.js.map → p-f8478e12.entry.js.map} +0 -0
- /package/dist/twilight/{p-a03eaa39.system.entry.js.map → p-fd05b59d.system.entry.js.map} +0 -0
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
import{r as s,h as e,g as t}from"./p-CuX9W8-2.js";var r;(function(s){s["ProductDetail"]="product.single";s["Cart"]="cart"})(r||(r={}));var a;(function(s){s["Conditional"]="conditional";s["PercentageOrFixed"]="fixed";s["DiscountsTable"]="discounts_table";s["Bank"]="bank";s["BuyXGetY"]="buy_x_get_y"})(a||(a={}));const i='.s-offer-wrapper .s-slider-block__title h2{font-size:1.125rem;line-height:1.75rem;color:#f87171}.s-offer-wrapper .s-slider-block__title h2::before{font-family:"sallaicons";content:"\\ee30" !important;position:absolute;top:1rem;font-size:3rem;font-weight:400;line-height:1;color:#fef2f2}.s-offer-bank-wrapper-sinlge-item{display:-ms-flexbox;display:flex;-ms-flex-align:center !important;align-items:center !important;gap:14px}.s-offer-bank-wrapper{display:-ms-flexbox !important;display:flex !important;width:100% !important}';const l=class{constructor(e){s(this,e);var t;this.productCardComponent="custom-salla-product-card";this.offersList=[];this.isMultipleBank=false;this.isBankOffer=false;this.canRender=false;this.showOffer=salla.config.get("store.settings.product.show_special_offers");this.offer_with_price_text=salla.lang.get("pages.offer.with_price",{price:""});this.with_discount_text=salla.lang.get("pages.products.with_a_discount");this.product_discount_text=salla.lang.get("pages.products.discount");this.special_offer_text=salla.lang.get("pages.products.special_offer");this.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");this.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");this.buy_quantity_text=s=>salla.lang.get("pages.offer.buy_quantity",{quantity:s});salla.lang.onLoaded((()=>{this.offer_with_price_text=salla.lang.get("pages.offer.with_price");this.with_discount_text=salla.lang.get("pages.products.with_a_discount");this.product_discount_text=salla.lang.get("pages.products.discount");this.special_offer_text=salla.lang.get("pages.products.special_offer");this.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");this.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");this.buy_quantity_text(0)}));salla.onReady((()=>{this.currentPage=salla.config.get("page.slug");this.userCurrency=salla.config.get("currencies")[salla.config.get("user.currency_code")].symbol}));this.categorySlot=((t=this.host.querySelector('[slot="category"]'))===null||t===void 0?void 0:t.innerHTML)||'<a href={url} class="s-offer-slide-cat-entry"><i class={icon}></i><h4>{name}</h4></a>'}getEndpointByPageName(){return{[r.Cart]:`offers/cart/${salla.storage.get("cart.id")}`,[r.ProductDetail]:`offers/product/${salla.config.get("page.id")}`}[this.currentPage]||"offers"}componentWillLoad(){this.hasCustomComponent=!!customElements.get(this.productCardComponent);return new Promise((s=>salla.onReady(s))).then((()=>{this.showOffer=!salla.url.is_page("product.single")||salla.config.get("store.settings.product.show_special_offers");if(this.showOffer){return}throw new Error("Merchant disabled showing the offers on product page")})).then((()=>salla.api.request(this.getEndpointByPageName()))).then((s=>{if(!(this.offersList=s.data).length){throw new Error("salla-offers:: There is no offers!")}const e=this.offersList.find((s=>[a.Bank,a.BuyXGetY,a.DiscountsTable].includes(s.type)));if(!e){throw new Error("salla-offers:: Offer type not supported yet!")}if(e.type===a.DiscountsTable){return this.offersList=[e]}if(this.isBankOffer=e.type===a.Bank){this.offersList=this.offersList.filter((s=>s.type===a.Bank));this.isMultipleBank=this.offersList.length>1;return this.offersList}const t=e.details.get;return t.source==="products"?salla.product.api.fetch({source:"selected",source_value:t.source_value}).then((s=>{t.products=s.data;e.details.get=t;return this.offersList=[e]})):salla.product.api.categories().then((s=>{t.categories=this.findCategories(s.data,t.source_value);e.details.get=t;return this.offersList=[e]}))})).then((s=>{salla.storage.set(this.getStorageKey(),{offers:s,stored_at:(new Date).getTime()});this.canRender=true})).catch((s=>{salla.logger.warn(s)}))}componentDidLoad(){let s=this.host.querySelector(".s-slider-block__title-nav");s===null||s===void 0?void 0:s.classList.add("s-offer-bank-payment-nav")}findCategories(s,e){var t;let r=[];for(const a of s){if(e.includes(a.id_||a.id)){r.push(a)}if(((t=a.sub_categories)===null||t===void 0?void 0:t.length)>0){r=r.concat(this.findCategories(a.sub_categories,e))}}return r}getStorageKey(){try{const s=salla.config.get("page.slug").replace(".","_");const e=salla.lang.getLocale();const t=salla.config.currency().code;if(!s||!e||!t){throw new Error("Unable to get the storage key.")}return`s-offers-${s}-${salla.config.get("page.id")}-${e}-${t}`}catch(s){return""}}getOffersFromStorage(){let s=salla.storage.get(this.getStorageKey());if(!s||s.stored_at<(new Date).getTime()-10*60*1e3){salla.storage.remove(this.getStorageKey());return null}this.canRender=true;return Promise.resolve(s.offers)}render(){if(!this.offersList.length||!this.canRender||!this.showOffer)return null;const s=this.offersList[0];const t=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleText:null:s.title;const r=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleDescription:null:s.description;const a={"block-title":t,"block-subTitle":r,"show-controls":this.isMultipleBank};return e("div",{class:"s-offer-wrapper"},e("p",{class:"s-offer-corner-badge"},this.special_offer_text),e("salla-slider",Object.assign({type:"carousel",id:"offer-slider"},a),e("div",{slot:"items"},this.renderSectionForOfferType(s.type))))}renderSectionForOfferType(s){if(this.isBankOffer){return this.renderBankSection()}if(s==a.BuyXGetY){return this.renderBuyXGetYSection()}return this.renderDiscountTableSection()}getCategoriesSection(s){return e("div",{class:"s-offer-slide-one-sixth swiper-slide",innerHTML:this.categorySlot.replace(/\{url\}/g,s.url).replace(/\{icon\}/g,s.icon||"sicon-store").replace(/\{name\}/g,s.name)})}renderBuyXGetYSection(){var s,t;const r=this.offersList[0].details;return[(s=r.get.products)===null||s===void 0?void 0:s.map((s=>e("div",{class:"s-offer-slide-one-fourth"},this.hasCustomComponent?e(this.productCardComponent,{product:s}):e("salla-product-card",{"shadow-on-hover":true,product:s})))),(t=r.get.categories)===null||t===void 0?void 0:t.map((s=>this.getCategoriesSection(s)))]}renderBankSection(){return this.offersList.map((s=>e("div",{class:{"s-offer-slide-one-sixth":this.isMultipleBank,"s-offer-bank-wrapper-sinlge-item":!this.isMultipleBank}},e("div",{class:{"s-offer-bank-wrapper":true,"s-offer-slide-one-sixth":!this.isMultipleBank,"s-offer-bank-wrapper-multi-spacer":this.isMultipleBank}},e("div",{class:"s-offer-bank-logo"},e("img",{src:s.details.logo||salla.url.cdn("images/s-empty.png"),"data-src":s.details.logo,alt:s.title+" offer"})),e("ul",{class:"s-offer-bank-payment-wrapper"},s.details.payments.map((s=>e("li",{class:"s-offer-bank-payment-single"},e("img",{src:salla.url.cdn("images/payment/"+s+".png")||salla.url.cdn("images/s-empty.png"),"data-src":salla.url.cdn("images/payment/"+s+".png"),alt:"payment"}))))),this.isMultipleBank?e("p",{class:"s-offer-bank-payment-discount-percent"},`${this.product_discount_text} ${s.details.discount_value}${s.details.discount_type==="percentage"&&"%"}`):""),!this.isMultipleBank?e("div",{class:"s-offer-bank-message s-offer-slide-one-fourth"},e("h2",null,this.offersList[0].title),e("p",{innerHTML:this.generateBankDescription(this.offersList[0].description,s.details.discount_value)})):"")))}generateBankDescription(s,e){return s.replace(new RegExp(`${e} %`),`<span class="s-offer-bank-message-amount">${e} %</span>`)}renderDiscountTableSection(){var s;const t=this.offersList[0];let r=t.details.show_price_after_discount;return(s=this.offersList[0].details.discounts)===null||s===void 0?void 0:s.map((s=>e("div",{class:"s-offer-slide-one-fourth"},e("div",{class:"s-offer-slide-offer-entry"},e("div",{class:"s-offer-slide-offer-entry-price-quantity-container"},e("p",{class:"s-offer-slide-offer-entry-quantity"},this.buy_quantity_text(s.quantity)),r?e("div",{class:"s-offer-slide-offer-entry-price"},e("span",null,this.offer_with_price_text),e("span",{class:"s-offer-slide-offer-entry-price-amount"},s.discounted_amount)," ",e("span",null,this.userCurrency)):""),e("p",{class:"s-offer-slide-offer-entry-price-amount-percent"},this.with_discount_text,"(",e("span",null,s.percentage,!!s.percentage&&"%"),")")))))}get host(){return t(this)}};l.style=i;export{l as salla_offer};
|
|
5
|
-
//# sourceMappingURL=p-a8a838f0.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["PageType","OfferType","sallaOfferCss","SallaOffer","constructor","hostRef","this","productCardComponent","offersList","isMultipleBank","isBankOffer","canRender","showOffer","salla","config","get","offer_with_price_text","lang","price","with_discount_text","product_discount_text","special_offer_text","multipleBankOfferTitleText","multipleBankOfferTitleDescription","buy_quantity_text","quantity","onLoaded","onReady","currentPage","userCurrency","symbol","categorySlot","_a","host","querySelector","innerHTML","getEndpointByPageName","Cart","storage","ProductDetail","componentWillLoad","hasCustomComponent","customElements","Promise","resolve","then","url","is_page","Error","api","request","res","data","length","offer","find","Bank","BuyXGetY","DiscountsTable","includes","type","filter","getY","details","source","product","fetch","source_value","response","products","categories","findCategories","offers","set","getStorageKey","stored_at","Date","getTime","catch","error","logger","warn","componentDidLoad","nav","classList","add","ids","found","category","id_","id","push","sub_categories","concat","pageSlug","replace","locale","getLocale","currencyCode","currency","code","getOffersFromStorage","storageOffers","remove","render","blockTitle","title","blockSubTitle","description","titles","h","class","Object","assign","slot","renderSectionForOfferType","offerType","renderBankSection","renderBuyXGetYSection","renderDiscountTableSection","getCategoriesSection","icon","name","map","_b","bankOffer","src","logo","cdn","alt","payments","payment","discount_value","discount_type","generateBankDescription","desc","value","RegExp","show_discounted_price","show_price_after_discount","discounts","discount","discounted_amount","percentage"],"sources":["src/components/salla-offer/interfaces.ts","src/components/salla-offer/salla-offer.scss?tag=salla-offer","src/components/salla-offer/salla-offer.tsx"],"sourcesContent":["export enum PageType {\n ProductDetail = \"product.single\",\n Cart = \"cart\"\n}\n\nexport enum OfferType {\n Conditional = \"conditional\",\n PercentageOrFixed = \"fixed\",\n DiscountsTable = \"discounts_table\",\n Bank = \"bank\",\n BuyXGetY = \"buy_x_get_y\"\n}\n\n\nexport interface DiscountDetailFixed {\n discount_type: \"fixed\";\n min_spend: number;\n discount_value: number;\n}\n\nexport interface DiscountDetailFreeProduct {\n discount_type: \"free_product\";\n min_spend: number;\n discount_value: number;\n}\n\nexport interface DiscountDetailConditional extends Array<DiscountDetailFixed | DiscountDetailFreeProduct> {}\n\nexport interface DiscountDetailPercentageFixed {\n apply_to: \"all\" | \"products\" | \"categories\" | \"payment_methods\";\n targets: Array<string | number>;\n ends_at: number;\n min_spend: number;\n discount_value: number;\n}\n\nexport interface Discount {\n discounted_amount: any;\n quantity: number;\n percentage: number;\n}\n\nexport interface DiscountDetailTable {\n apply_to: \"all\" | \"products\" | \"categories\" | \"payment_methods\" | \"order\";\n discount_value: number;\n ends_at: string;\n min_items: number;\n min_spend: number;\n show_price_after_discount: boolean;\n discounts: Discount[];\n}\n\nexport interface BankOffer {\n logo: string;\n discount_value: number;\n discount_type: string;\n minimum_spend: number;\n payments: string[];\n}\n\nexport interface BuyXGetYDetail {\n ends_at: number;\n buy: {\n source: \"product\" | \"category\";\n source_value: number[];\n quantity: number;\n };\n get: {\n source: \"products\" | \"category\";\n source_value: number[];\n type: \"free_product\" | \"percentage\" | \"fixed\";\n value: number;\n products?: Product[];//we will set this dynamically\n categories?: Category[];//we will set this dynamically\n };\n}\n\nexport interface Offer {\n id: number;\n title: string;\n description: string;\n type: OfferType | \"conditional\" | \"fixed\" | \"discounts_table\" | \"bank\" | \"buy_x_get_y\";\n details: DiscountDetailConditional | DiscountDetailPercentageFixed | DiscountDetailTable | BankOffer | BuyXGetYDetail;\n}\n\nexport interface Product {\n id: number;\n type: string;\n status: string;\n is_available: boolean;\n sku: string;\n name: string;\n price: { amount: number; currency: string; };\n promotion: { title: string; sub_title: string; };\n sale_price: { amount: number; currency: string; };\n regular_price: { amount: number; currency: string; };\n currency: string;\n url: string;\n thumbnail: string;\n has_special_price: boolean;\n favorite?: any;\n}\n\nexport interface Category {\n id?: string;\n id_?: number;\n name?: string;\n url?: string;\n icon?: string;\n sub_categories?: Category[];\n items?: any[] | null;\n}\n\nexport interface Currency {\n code: string | 'SAR';\n name: string;\n symbol: string;\n amount?: number;\n country_code?: string;\n}\n",".s-offer-wrapper .s-slider-block__title {\n h2 {\n font-size: 1.125rem;\n line-height: 1.75rem;\n color: #f87171;\n\n &::before {\n font-family: \"sallaicons\";\n content: \"\\ee30\" !important;\n position: absolute;\n top: 1rem;\n font-size: 3rem;\n font-weight: 400;\n line-height: 1;\n color: #fef2f2;\n }\n }\n}\n\n.s-offer-bank-wrapper-sinlge-item{\n display: flex;\n align-items: center !important;\n gap: 14px;\n}\n\n.s-offer-bank-wrapper {\n display: flex !important;\n width: 100% !important;\n}\n\n// .s-offer-bank-wrapper {\n // \n// }","import { Component, Element, Prop, State, h } from '@stencil/core';\nimport { Offer, Category, Product, Discount, Currency, BuyXGetYDetail, PageType, OfferType, BankOffer, DiscountDetailTable } from './interfaces';\n\n\n/**\n * `salla-offer` is a StencilJS component that displays offers, categories, products, banks, and discount information.\n * It uses the `salla-slider` component for carousel functionality.\n *\n * @slot category - The slot for customizing the category entry layout.\n * \n * @csspart custom - Custom CSS part to target specific elements in the component.\n *\n * @example\n * <salla-offer product-id=\"123\"></salla-offer>\n */\n@Component({\n tag: 'salla-offer',\n styleUrl: 'salla-offer.scss',\n})\nexport class SallaOffer {\n\n constructor() {\n // Language\n salla.lang.onLoaded(() => {\n this.offer_with_price_text = salla.lang.get('pages.offer.with_price');\n this.with_discount_text = salla.lang.get('pages.products.with_a_discount');\n this.product_discount_text = salla.lang.get('pages.products.discount');\n this.special_offer_text = salla.lang.get('pages.products.special_offer');\n this.multipleBankOfferTitleText = salla.lang.get('pages.offer.multiple_bank_offers_title');\n this.multipleBankOfferTitleDescription = salla.lang.get('pages.offer.multiple_bank_offers_message');\n this.buy_quantity_text(0);\n })\n\n salla.onReady(() => {\n this.currentPage = salla.config.get('page.slug')\n this.userCurrency = salla.config.get('currencies')[salla.config.get('user.currency_code')].symbol\n });\n\n this.categorySlot = this.host.querySelector('[slot=\"category\"]')?.innerHTML || '<a href={url} class=\"s-offer-slide-cat-entry\"><i class={icon}></i><h4>{name}</h4></a>';\n }\n\n /**\n * Custom Card Component for the Salla Products List.\n *\n * This component allows you to customize the appearance of individual product cards within a Salla Products List.\n *\n * @example\n * <salla-products-list product-card-component=\"my-custom-card-style1\" ...\n * <salla-products-list product-card-component=\"my-custom-card-style2\" ...\n */\n @Prop() productCardComponent: string = 'custom-salla-product-card';\n\n // Declare component state variables\n @State() offersList: Offer[] = [];\n @State() userCurrency: Currency;\n @State() isMultipleBank: boolean = false;\n @State() title?: string;\n @State() currentPage: string;\n @State() hasCustomComponent: boolean;\n\n @State() isBankOffer: boolean = false;\n @State() canRender: boolean = false;\n @State() showOffer: boolean = salla.config.get('store.settings.product.show_special_offers');\n\n // Default translated texts\n @State() offer_with_price_text: string = salla.lang.get('pages.offer.with_price', { price: '' });\n @State() with_discount_text: string = salla.lang.get('pages.products.with_a_discount')\n @State() product_discount_text: string = salla.lang.get('pages.products.discount')\n @State() special_offer_text: string = salla.lang.get('pages.products.special_offer')\n @State() multipleBankOfferTitleText: string = salla.lang.get('pages.offer.multiple_bank_offers_title')\n @State() multipleBankOfferTitleDescription: string = salla.lang.get('pages.offer.multiple_bank_offers_message')\n @State() buy_quantity_text: (quantity: number) => string = (quantity) => salla.lang.get('pages.offer.buy_quantity', { quantity })\n\n // Reference to the host element\n @Element() host: HTMLElement;\n\n private categorySlot: string;\n\n private getEndpointByPageName(): string {\n return {\n [PageType.Cart]: `offers/cart/${salla.storage.get('cart.id')}`,\n [PageType.ProductDetail]: `offers/product/${salla.config.get('page.id')}`,\n }[this.currentPage] || \"offers\";\n }\n\n componentWillLoad() {\n this.hasCustomComponent = !!customElements.get(this.productCardComponent);\n // let offers = this.getOffersFromStorage();\n // if (offers) {\n // return offers.then(offersFromStorage => this.offersList = offersFromStorage);\n // }\n\n return (new Promise(resolve => salla.onReady(resolve)))\n .then(() => {\n this.showOffer = !salla.url.is_page('product.single') || salla.config.get('store.settings.product.show_special_offers')\n if (this.showOffer) {\n return;\n }\n throw new Error(\"Merchant disabled showing the offers on product page\");\n }\n )\n .then(() => salla.api.request(this.getEndpointByPageName()))\n .then((res) => {\n if (!(this.offersList = res.data).length) {\n throw new Error('salla-offers:: There is no offers!');\n }\n //we support these offers only\n const offer = this.offersList.find(offer => [OfferType.Bank, OfferType.BuyXGetY, OfferType.DiscountsTable].includes(offer.type as any));\n if (!offer) {\n throw new Error('salla-offers:: Offer type not supported yet!');\n }\n //because there is no need for special handling for discounts table, just skip the other cases\n if (offer.type === OfferType.DiscountsTable) {\n return this.offersList = [offer];\n }\n\n //if it's banks offer, we need to include the other banks overs\n if ((this.isBankOffer = offer.type === OfferType.Bank)) {\n this.offersList = this.offersList.filter(offer => offer.type === OfferType.Bank);\n this.isMultipleBank = this.offersList.length > 1;\n return this.offersList;\n }\n //BuyXGetY offers\n const getY = (offer.details as BuyXGetYDetail).get;\n\n return getY.source === 'products'\n //todo:: avoid this request, and the handling for the products, just use `salla-products-slider` and don't forget to pass the customcard\n ? salla.product.api.fetch({ source: \"selected\", source_value: getY.source_value })\n .then((response: any) => {\n getY.products = response.data;\n (offer.details as any).get = getY;\n return this.offersList = [offer];\n })//set the products\n : salla.product.api.categories()//get all categories in one query, then extract only the selected one, instead of sending multi requests\n .then((res) => {\n getY.categories = this.findCategories(res.data, getY.source_value);\n (offer.details as any).get = getY;\n return this.offersList = [offer];\n });\n })\n .then((offers: Offer[]) => {\n salla.storage.set(this.getStorageKey(), { offers, stored_at: new Date().getTime() });\n this.canRender = true;\n })\n .catch((error) => {\n salla.logger.warn(error)\n });\n }\n\n componentDidLoad() {\n let nav = this.host.querySelector('.s-slider-block__title-nav');\n nav?.classList.add(\"s-offer-bank-payment-nav\")\n }\n\n\n findCategories(categories: Category[], ids: any[]): Category[] {\n let found: Category[] = [];\n\n for (const category of categories) {\n if (ids.includes(category.id_ || category.id)) { //here we are using || because we are planning to drop `id_`\n found.push(category);\n }\n if (category.sub_categories?.length > 0) {\n found = found.concat(this.findCategories(category.sub_categories, ids));\n }\n }\n\n return found;\n }\n\n //todo::add to the key params, to make sure it will support multi offers in the same page if it's wanted\n getStorageKey(): string {\n try {\n const pageSlug = salla.config.get('page.slug').replace('.', '_');\n const locale = salla.lang.getLocale();\n const currencyCode = salla.config.currency().code;\n\n if (!pageSlug || !locale || !currencyCode) {\n throw new Error('Unable to get the storage key.');\n }\n\n return `s-offers-${pageSlug}-${salla.config.get('page.id')}-${locale}-${currencyCode}`;\n } catch (error) {\n return '';\n }\n }\n\n //@ts-ignore\n getOffersFromStorage(): null | Promise<Offer[]> {\n let storageOffers = salla.storage.get(this.getStorageKey());\n //if the offers not existed, or it has been stored before 10 minutes from now, ignore it;\n if (!storageOffers || storageOffers.stored_at < (new Date().getTime() - 10 * 60 * 1000)) {\n salla.storage.remove(this.getStorageKey());\n return null;\n }\n this.canRender = true;\n\n //return it as resolve to support .then\n return Promise.resolve(storageOffers.offers);\n }\n\n render() {\n if (!this.offersList.length || !this.canRender || !this.showOffer) return null;\n const offer: Offer = this.offersList[0];\n\n const blockTitle = this.isBankOffer ? (this.isMultipleBank ? this.multipleBankOfferTitleText : null) : offer.title;\n const blockSubTitle = this.isBankOffer ? (this.isMultipleBank ? this.multipleBankOfferTitleDescription : null) : offer.description;\n\n const titles = {\n 'block-title': blockTitle,\n 'block-subTitle': blockSubTitle,\n 'show-controls': this.isMultipleBank\n };\n\n return (\n <div class=\"s-offer-wrapper\">\n {<p class=\"s-offer-corner-badge\">{this.special_offer_text}</p>}\n {/* discounts table is not a slider, it's a table🤔 */}\n {/* single bank offer is not a slider, it's a dom without slider🤔 */}\n <salla-slider type=\"carousel\" id=\"offer-slider\" {...titles}>\n <div slot='items'>\n {this.renderSectionForOfferType(offer.type)}\n </div>\n </salla-slider>\n </div>\n );\n }\n\n private renderSectionForOfferType(offerType: OfferType | string) {\n if (this.isBankOffer) {\n return this.renderBankSection();\n }\n if (offerType == OfferType.BuyXGetY) {\n return this.renderBuyXGetYSection();\n }\n\n return this.renderDiscountTableSection();\n }\n\n /**\n * Generates content for the categories section.\n *\n * @param offeredCategories - An array of Category objects.\n * @returns An array of HTML elements representing categories.\n */\n private getCategoriesSection(category: Category) {\n return <div class=\"s-offer-slide-one-sixth swiper-slide\" innerHTML={this.categorySlot\n .replace(/\\{url\\}/g, category.url)\n .replace(/\\{icon\\}/g, category.icon || \"sicon-store\")\n .replace(/\\{name\\}/g, category.name)}></div>\n }\n\n private renderBuyXGetYSection() {\n const details = (this.offersList[0].details as BuyXGetYDetail)\n return [\n details.get.products?.map((product: Product) => (\n <div class=\"s-offer-slide-one-fourth\">\n {this.hasCustomComponent\n ? <this.productCardComponent product={product}></this.productCardComponent>\n : <salla-product-card shadow-on-hover product={product}></salla-product-card>}\n </div>\n )),\n details.get.categories?.map((category: Category) => this.getCategoriesSection(category))\n ];\n }\n\n /**\n * Generates content for the bank section.\n *\n * @param offeredBank - An array of Bank objects.\n * @param name - The title of the current offer.\n * @param description - The description of the current offer.\n * @returns An array of HTML elements representing banks.\n * \n * TODO: loop over the list and filter bank types and pass it to this function\n */\n private renderBankSection() {\n return this.offersList.map((bankOffer: Offer) => {\n return <div class={{ \"s-offer-slide-one-sixth\": this.isMultipleBank, \"s-offer-bank-wrapper-sinlge-item\": !this.isMultipleBank }}>\n <div class={{ \"s-offer-bank-wrapper\": true, \"s-offer-slide-one-sixth\": !this.isMultipleBank, \"s-offer-bank-wrapper-multi-spacer\": this.isMultipleBank }}>\n <div class=\"s-offer-bank-logo\">\n <img src={(bankOffer.details as BankOffer).logo || salla.url.cdn('images/s-empty.png')} data-src={(bankOffer.details as BankOffer).logo} alt={bankOffer.title + \" offer\"} />\n </div>\n <ul class=\"s-offer-bank-payment-wrapper\">\n {(bankOffer.details as BankOffer).payments.map((payment: string) => {\n return <li class=\"s-offer-bank-payment-single\">\n <img\n src={salla.url.cdn('images/payment/' + payment + '.png') || salla.url.cdn('images/s-empty.png')}\n data-src={salla.url.cdn('images/payment/' + payment + '.png')}\n alt=\"payment\" />\n </li>\n })}\n </ul>\n {this.isMultipleBank ?\n <p class=\"s-offer-bank-payment-discount-percent\">\n {`${this.product_discount_text} ${(bankOffer.details as BankOffer).discount_value}${(bankOffer.details as BankOffer).discount_type === \"percentage\" && '%'}`}\n </p>\n : \"\"}\n </div>\n {!this.isMultipleBank ?\n <div class=\"s-offer-bank-message s-offer-slide-one-fourth\">\n <h2>{this.offersList[0].title}</h2>\n <p innerHTML={this.generateBankDescription(this.offersList[0].description, (bankOffer.details as BankOffer).discount_value)}></p>\n </div>\n : \"\"}\n </div>\n })\n }\n\n private generateBankDescription(desc: string, value): string {\n return desc.replace(new RegExp(`${value} %`), `<span class=\"s-offer-bank-message-amount\">${value} %</span>`)\n }\n\n /**\n * Generates content for the discount table section.\n *\n * @param discountTable - An array of Discount objects.\n * @returns An array of HTML elements representing discounts_table.\n */\n private renderDiscountTableSection() {\n const offer: Offer = this.offersList[0];\n let show_discounted_price = (offer.details as DiscountDetailTable).show_price_after_discount;\n return (this.offersList[0].details as DiscountDetailTable).discounts?.map((discount: Discount) => <div class=\"s-offer-slide-one-fourth\">\n <div class=\"s-offer-slide-offer-entry\">\n <div class=\"s-offer-slide-offer-entry-price-quantity-container\">\n <p class=\"s-offer-slide-offer-entry-quantity\">{this.buy_quantity_text(discount.quantity)}</p>\n {show_discounted_price ?\n <div class=\"s-offer-slide-offer-entry-price\">\n <span>{this.offer_with_price_text}</span>\n <span class=\"s-offer-slide-offer-entry-price-amount\">{discount.discounted_amount}</span> <span>{this.userCurrency}</span>\n </div> : \"\"}\n </div>\n <p class=\"s-offer-slide-offer-entry-price-amount-percent\">{this.with_discount_text}\n (<span>{discount.percentage}{!!discount.percentage && '%'}</span>)</p>\n </div>\n </div>\n )\n }\n\n}\n"],"mappings":";;;kDAAA,IAAYA,GAAZ,SAAYA,GACVA,EAAA,kCACAA,EAAA,cACD,EAHD,CAAYA,MAGX,KAED,IAAYC,GAAZ,SAAYA,GACVA,EAAA,6BACAA,EAAA,6BACAA,EAAA,oCACAA,EAAA,eACAA,EAAA,yBACD,EAND,CAAYA,MAMX,KCXD,MAAMC,EAAgB,+gB,MCmBTC,EAAU,MAErB,WAAAC,CAAAC,G,gBA6BQC,KAAoBC,qBAAW,4BAG9BD,KAAUE,WAAY,GAEtBF,KAAcG,eAAY,MAK1BH,KAAWI,YAAY,MACvBJ,KAASK,UAAY,MACrB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6CA,a,CASrF,0BAAAjB,G,MACN,MAAMjE,EAAehD,KAAKE,WAAW,GACrC,IAAIkI,EAAyBpF,EAAMS,QAAgC4E,0BACnE,OAAO3G,EAAC1B,KAAKE,WAAW,GAAGuD,QAAgC6E,aAAS,MAAA5G,SAAA,SAAAA,EAAE2F,KAAKkB,GAAuB/B,EAAA,OAAKC,MAAM,4BAC3GD,EAAK,OAAAC,MAAM,6BACTD,EAAK,OAAAC,MAAM,sDACTD,EAAA,KAAGC,MAAM,sCAAsCzG,KAAKkB,kBAAkBqH,EAASpH,WAC9EiH,EACC5B,EAAK,OAAAC,MAAM,mCACTD,EAAO,YAAAxG,KAAKU,uBACZ8F,EAAA,QAAMC,MAAM,0CAA0C8B,EAASC,mBAAyB,IAAChC,EAAO,YAAAxG,KAAKuB,eAC9F,IAEbiF,EAAG,KAAAC,MAAM,kDAAkDzG,KAAKa,mBAAkB,IAC/E2F,EAAA,YAAO+B,EAASE,aAAcF,EAASE,YAAc,KAAW,Q","ignoreList":[]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
import{r as t,h as i,H as e}from"./p-CuX9W8-2.js";var s;(function(t){t["PERCENTAGE"]="percentage";t["FIXED"]="fixed";t["FREE_PRODUCT"]="free_product"})(s||(s={}));var o;(function(t){t["PRODUCT_COUNT"]="products_count";t["PRODUCT_PURCHASE"]="order_amount"})(o||(o={}));const n=":host{display:block}";const a=class{constructor(i){t(this,i);this.offer=null;this.products={};this.isLoading=true;this.canRender=true}componentWillLoad(){salla.onReady().then((()=>{var t,i,e;if(!((t=salla.config.get("store.features"))===null||t===void 0?void 0:t.includes("conditional-offer"))||salla.storage.get("cart")!==""&&!((e=(i=salla.storage.get("cart"))===null||i===void 0?void 0:i.summary)===null||e===void 0?void 0:e.count)){throw new Error("feature or cart object does not existed")}})).then((()=>salla.api.cart.offers())).then((({data:t})=>{this.offer=t.find((t=>t.type==="conditional"));if(!this.offer){throw new Error("No conditional offer has been activated in the merchant dashboard")}this.offer.details.discounts.unshift({value:0,min_spend:0});return this.updateInitialOfferValue()})).then((()=>this.getProducts())).then((()=>salla.event.on("cart::updated",(t=>this.updateOfferValues(t))))).catch((t=>{this.canRender=false;salla.logger.warn("salla-conditional-offer:: ",t)})).finally((()=>{this.isLoading=false}))}getProducts(){const t=this.offer.details.discounts.filter((({type:t})=>t===s.FREE_PRODUCT)).map((({value:t})=>t));if(t.length>0){return salla.product.fetch({source:"selected",source_value:t}).then((({data:t})=>{t.forEach((({id:t,url:i,image:e})=>{this.products[t]={url:i,image:e}}))}))}}updateInitialOfferValue(){return salla.api.cart.details().then((({data:{cart:t}})=>this.updateOfferValues(t)))}updateOfferValues({items:t,sub_total:i}){var e;const s=this.offer.details.based_on===o.PRODUCT_COUNT?t.reduce(((t,{quantity:i})=>t+i),0):i;this.offer=Object.assign(Object.assign({},this.offer),{details:Object.assign(Object.assign({},(e=this.offer)===null||e===void 0?void 0:e.details),{current_value:s})});return this.offer}getCheckpointContent(t){var e,o;if(t.type===s.PERCENTAGE)return`${t.value}%`;if(t.type===s.FIXED)return salla.money(t.value);if(t.type!==s.FREE_PRODUCT){salla.logger.error(`salla-conditional-offer:: unexpected type (${t.type})!`);return""}const n=this.products[t.value];if(!n){salla.logger.error(`salla-conditional-offer:: there is no product with id (${t.value})!`);return""}return i("a",{class:"s-conditional-offer-product-link",href:n.url},i("img",{class:"s-conditional-offer-checkpoint-image-content",loading:"lazy",decoding:"async",alt:((e=n===null||n===void 0?void 0:n.image)===null||e===void 0?void 0:e.alt)||"",src:(o=n===null||n===void 0?void 0:n.image)===null||o===void 0?void 0:o.url}))}getOfferType(t){var i;const e=(i=this.offer.details)===null||i===void 0?void 0:i.based_on;if(e===o.PRODUCT_COUNT)return salla.lang.choice("blocks.header.products_count",t.min_spend);if(e===o.PRODUCT_PURCHASE)return salla.money(t.min_spend);salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${e}`);return`${t.min_spend}`}clamp(t,i,e){return Math.max(i,Math.min(t,e))}mapValueRanges(t,i,e,s,o){const n=(t-i)*(o-s)/(e-i)+s;if(n===Number.POSITIVE_INFINITY)return 100;if(n===Number.NEGATIVE_INFINITY)return 0;return this.clamp(n,0,100)}getCheckPointView(t,e){var s,o;const n=this.offer.details.discounts.findIndex((({min_spend:i})=>i===t.min_spend));const a=(o=(s=this.offer.details.discounts[n-1])===null||s===void 0?void 0:s.min_spend)!==null&&o!==void 0?o:0;const l=this.mapValueRanges(this.offer.details.current_value,a,t.min_spend,0,100);const r=t.min_spend<=this.offer.details.current_value;return i("div",{class:"s-conditional-offer-checkpoint-container"},e>0?[i("div",{key:"progress-line",class:"s-conditional-offer-progress-line-container"},i("div",{class:"s-conditional-offer-progress-line-inactive"}),i("div",{class:"s-conditional-offer-progress-line-active",style:{width:`${l}%`}})),i("div",{key:"checkpoint",class:`s-conditional-offer-checkpoint ${r?"s-conditional-offer-active-checkpoint":""}`},i("div",{class:`s-conditional-offer-item-avatar-content ${r?"active":""}`,innerHTML:this.products&&this.getCheckpointContent(t)}),i("div",{class:`s-conditional-offer-checkpoint-label ${r?"active":""}`,innerHTML:this.getOfferType(t)}))]:i("div",{key:"label",class:{"s-conditional-offer-checkpoint-label":true,"first-checkpoint":e===0,active:r},innerHTML:this.getOfferType(t)}))}getLoadingSkeletonView(){return i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-skeleton-inner-container"},i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"30%"})),i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"35%"})),i("div",{class:"s-conditional-offer-skeleton-checkpoints-wrapper"},Array(3).fill(null).map((()=>[i("salla-skeleton",{key:"checkpoint-line",height:"8px"}),i("div",{key:"checkpoint"},i("salla-skeleton",{height:"60px",width:"60px",type:"circle"}))])))))}render(){if(!this.canRender)return null;if(this.isLoading)return this.getLoadingSkeletonView();return i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-title-wrapper"},i("div",{class:"s-conditional-offer-title"},this.offer.title),this.offer.description?i("div",{class:"s-conditional-offer-subtitle"},this.offer.description," ",i("i",{class:"sicon-information"})):null),i("div",{class:"s-conditional-offer-progress-container"},this.offer.details.discounts.map(((t,e)=>i("div",{class:{"flex-1":e>0},key:t.min_spend},this.getCheckPointView(t,e))))))}};a.style=n;export{a as salla_conditional_offer};
|
|
5
|
-
//# sourceMappingURL=p-c27511c1.entry.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
System.register(["./p-CoOGtM-m.system.js"],(function(t){"use strict";var s,n,a,i;return{setters:[function(t){s=t.r;n=t.h;a=t.H;i=t.g}],execute:function(){var r=":host{display:block}";var e=t("salla_apps_icons",function(){function t(t){var n=this;s(this,t);var a;this.apps=salla.config.get("store.apps");this.appSlot=((a=this.host.querySelector('[slot="app"]'))===null||a===void 0?void 0:a.innerHTML)||"<img alt={name} src={icon} />";salla.onReady((function(){n.apps=salla.config.get("store.apps")}));salla.lang.onLoaded((function(){n.appsTitle=salla.lang.get("blocks.footer.download_apps")}))}t.prototype.getAppsArray=function(){return Object.entries(this.apps).map((function(t){var s=t[0],n=t[1];return{name:s,value:n}}))};t.prototype.componentWillLoad=function(){return new Promise((function(t){return salla.onReady(t)}))};t.prototype.render=function(){var t=this;var s=this.getAppsArray();if(Array.isArray(s)&&!s.length){return}return n(a,{class:"s-apps-icons"},!this.hideTitle&&n("h3",null,this.appsTitle),n("div",{class:{"s-apps-icons-list":true,vertical:this.vertical}},s.map((function(s,a){return n("a",{key:a,href:s.value,rel:"noreferrer",target:"_blank",class:"s-apps-icons-item",id:"app-slot",innerHTML:t.appSlot.replace(/\{icon\}/g,salla.url.cdn("images/".concat(s.name,".png"))).replace(/\{name\}/g,s.name)})}))))};t.prototype.componentDidRender=function(){var t;(t=this.host.querySelector('[slot="app"]'))===null||t===void 0?void 0:t.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return i(this)},enumerable:false,configurable:true});return t}());e.style=r}}}));
|
|
5
|
-
//# sourceMappingURL=p-f92ef489.system.entry.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|