@salla.sa/twilight-components 2.14.181 → 2.14.183
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-t0X5C0ni.js → app-globals-DP7W9Nt1.js} +3 -3
- package/dist/cjs/{app-globals-t0X5C0ni.js.map → app-globals-DP7W9Nt1.js.map} +1 -1
- package/dist/cjs/{index-N5LvLolS.js → index-DEjSdc_8.js} +4 -4
- package/dist/cjs/{index-N5LvLolS.js.map → index-DEjSdc_8.js.map} +1 -1
- 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 +2 -2
- package/dist/cjs/salla-cart-item-offers.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-cart-item-offers.entry.cjs.js.map +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-loyalty-program.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 +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-cart-item-offers/salla-cart-item-offers.js +1 -1
- package/dist/collection/components/salla-cart-item-offers/salla-cart-item-offers.js.map +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/salla-cart-item-offers.js +1 -1
- package/dist/components/salla-cart-item-offers.js.map +1 -1
- package/dist/esm/{app-globals-D5QbM3Rl.js → app-globals-DPOTFBlc.js} +3 -3
- package/dist/esm/{app-globals-D5QbM3Rl.js.map → app-globals-DPOTFBlc.js.map} +1 -1
- package/dist/esm/{index-DAlGHI9x.js → index-BsC_KPRw.js} +4 -4
- package/dist/esm/{index-DAlGHI9x.js.map → index-BsC_KPRw.js.map} +1 -1
- 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 +2 -2
- package/dist/esm/salla-cart-item-offers.entry.js.map +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-loyalty-program.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 +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-D5QbM3Rl.js → app-globals-DPOTFBlc.js} +2 -2
- package/dist/esm-es5/{app-globals-D5QbM3Rl.js.map → app-globals-DPOTFBlc.js.map} +1 -1
- package/dist/esm-es5/{index-DAlGHI9x.js → index-BsC_KPRw.js} +3 -3
- package/dist/esm-es5/{index-DAlGHI9x.js.map → index-BsC_KPRw.js.map} +1 -1
- 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 +2 -2
- package/dist/esm-es5/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm-es5/salla-cart-item-offers.entry.js.map +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 +1 -1
- 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-loyalty-program.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 +2 -2
- package/dist/esm-es5/salla-offer.entry.js +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-4b352943.entry.js → p-0047e463.entry.js} +2 -2
- package/dist/twilight/{p-c97427a3.entry.js → p-0185bdf9.entry.js} +2 -2
- package/dist/twilight/{p-a7ee5fff.system.entry.js → p-06d9633d.system.entry.js} +2 -2
- package/dist/twilight/{p-715c0aad.system.entry.js → p-09b83591.system.entry.js} +2 -2
- package/dist/twilight/{p-8e9a8f3a.system.entry.js → p-09c0aa9b.system.entry.js} +2 -2
- package/dist/twilight/{p-a84b03ef.system.entry.js → p-0d016d1d.system.entry.js} +2 -2
- package/dist/twilight/{p-70aaaee4.entry.js → p-0f4a870e.entry.js} +2 -2
- package/dist/twilight/{p-ebc9637a.entry.js → p-0fa2e49f.entry.js} +2 -2
- package/dist/twilight/{p-3186acf1.system.entry.js → p-2165bd1d.system.entry.js} +2 -2
- package/dist/twilight/{p-41ad0b93.entry.js → p-2d98f929.entry.js} +2 -2
- package/dist/twilight/{p-b3e6ca1d.entry.js → p-3092fcdb.entry.js} +2 -2
- package/dist/twilight/{p-1afdd2a3.entry.js → p-38849a98.entry.js} +2 -2
- package/dist/twilight/{p-ee469ca6.entry.js → p-39da4299.entry.js} +2 -2
- package/dist/twilight/{p-3e38af1e.entry.js → p-403bcb42.entry.js} +2 -2
- package/dist/twilight/{p-c765c344.system.entry.js → p-484536e8.system.entry.js} +2 -2
- package/dist/twilight/{p-DdxCBmL9.system.js.map → p-4Hc1BiQf.system.js.map} +1 -1
- package/dist/twilight/{p-61c07205.system.entry.js → p-4dca6aeb.system.entry.js} +2 -2
- package/dist/twilight/{p-ec8e40c6.system.entry.js → p-51fa78d1.system.entry.js} +2 -2
- package/dist/twilight/{p-3f0f0fba.system.entry.js → p-530bef5e.system.entry.js} +2 -2
- package/dist/twilight/{p-9f1d5925.entry.js → p-5332a208.entry.js} +2 -2
- package/dist/twilight/{p-3b7ad517.entry.js → p-549e1de2.entry.js} +2 -2
- package/dist/twilight/{p-243adaa4.entry.js → p-5934c2e7.entry.js} +2 -2
- package/dist/twilight/{p-d3df4df3.entry.js → p-64b33f8c.entry.js} +2 -2
- package/dist/twilight/{p-22d509b1.entry.js → p-680392a3.entry.js} +2 -2
- package/dist/twilight/{p-ee34baf8.system.entry.js → p-68fbf27e.system.entry.js} +2 -2
- package/dist/twilight/{p-c857e487.entry.js → p-6a5a300e.entry.js} +2 -2
- package/dist/twilight/{p-c4e5aeb1.system.entry.js → p-6b6d43af.system.entry.js} +2 -2
- package/dist/twilight/{p-6c0913d2.entry.js → p-744ddc76.entry.js} +2 -2
- package/dist/twilight/{p-fefce3f1.system.entry.js → p-746795d4.system.entry.js} +2 -2
- package/dist/twilight/{p-5d9ed554.system.entry.js → p-753dcafc.system.entry.js} +2 -2
- package/dist/twilight/p-753dcafc.system.entry.js.map +1 -0
- package/dist/twilight/{p-4d1f4501.system.entry.js → p-77118d49.system.entry.js} +2 -2
- package/dist/twilight/{p-97ea35f1.system.entry.js → p-77d462cb.system.entry.js} +2 -2
- package/dist/twilight/{p-e28511db.entry.js → p-7eacd230.entry.js} +2 -2
- package/dist/twilight/{p-b76619b6.system.entry.js → p-8e15dbb5.system.entry.js} +2 -2
- package/dist/twilight/{p-06f554cc.system.entry.js → p-99ee7ab8.system.entry.js} +2 -2
- package/dist/twilight/{p-a67f65f4.system.entry.js → p-9e901aaa.system.entry.js} +2 -2
- package/dist/twilight/{p-dafe7756.entry.js → p-9fb60f62.entry.js} +2 -2
- package/dist/twilight/{p-CeTDDyap.system.js.map → p-B-DslLtl.system.js.map} +1 -1
- package/dist/twilight/{p-DJvBB_BZ.system.js.map → p-B6YW8zOs.system.js.map} +1 -1
- package/dist/twilight/{p-DmzgertV.system.js.map → p-BCbpXNYB.system.js.map} +1 -1
- package/dist/twilight/{p-BY-mZQLa.system.js.map → p-BLrc8AxX.system.js.map} +1 -1
- package/dist/twilight/{p-BBnLLviH.system.js.map → p-BVRsoCDR.system.js.map} +1 -1
- package/dist/twilight/{p-DRKuNX91.system.js.map → p-BWWIcA9X.system.js.map} +1 -1
- package/dist/twilight/{p-DYanuCun.system.js.map → p-BfQdfUNV.system.js.map} +1 -1
- package/dist/twilight/{p-DAlGHI9x.js → p-BsC_KPRw.js} +3 -3
- package/dist/twilight/{p-DAlGHI9x.js.map → p-BsC_KPRw.js.map} +1 -1
- package/dist/twilight/{p-Dqf3E6NY.system.js.map → p-BuNSKyd_.system.js.map} +1 -1
- package/dist/twilight/{p-DQ00hNTg.system.js.map → p-BvotKAQ7.system.js.map} +1 -1
- package/dist/twilight/{p-Bb7EGqkN.system.js.map → p-Bww-QgQv.system.js.map} +1 -1
- package/dist/twilight/{p-DwJwIbo2.system.js.map → p-C0aFOcbV.system.js.map} +1 -1
- package/dist/twilight/{p-BfYGBd1O.system.js.map → p-C7ucCTg_.system.js.map} +1 -1
- package/dist/twilight/{p-oQYbC_P9.system.js.map → p-C82jnyB3.system.js.map} +1 -1
- package/dist/twilight/{p-B-9J9NhB.system.js.map → p-CB3SY-jt.system.js.map} +1 -1
- package/dist/twilight/{p-3mwF9q2c.system.js.map → p-CEOTYFn8.system.js.map} +1 -1
- package/dist/twilight/p-CZyRChBi.system.js.map +1 -0
- package/dist/twilight/{p-dC9B1_NT.system.js.map → p-CnoBs2BZ.system.js.map} +1 -1
- package/dist/twilight/{p-B8TtYOOQ.system.js.map → p-CoqNg2b9.system.js.map} +1 -1
- package/dist/twilight/{p-DTU428iu.system.js.map → p-Cr-REZy6.system.js.map} +1 -1
- package/dist/twilight/{p-BH64Rzky.system.js.map → p-D10vY8RV.system.js.map} +1 -1
- package/dist/twilight/{p-C1-sjeYQ.system.js.map → p-DE8NuSWA.system.js.map} +1 -1
- package/dist/twilight/{p-Bh-oF8SX.system.js.map → p-Dx1oUm8R.system.js.map} +1 -1
- package/dist/twilight/{p-B_fH5rwV.system.js.map → p-FMu6Xxgt.system.js.map} +1 -1
- package/dist/twilight/{p-BG5OQdQk.system.js → p-Ju30sl2-.system.js} +2 -2
- package/dist/twilight/{p-BG5OQdQk.system.js.map → p-Ju30sl2-.system.js.map} +1 -1
- package/dist/twilight/{p-ZHx9AVSQ.system.js.map → p-SBkeUz4z.system.js.map} +1 -1
- package/dist/twilight/{p-hnFn9PCu.system.js.map → p-UR99yZHB.system.js.map} +1 -1
- package/dist/twilight/{p-DWDv8O4E.system.js.map → p-X1pNGcy0.system.js.map} +1 -1
- package/dist/twilight/{p-wlGi3xA9.system.js.map → p-Yj7QBCGg.system.js.map} +1 -1
- package/dist/twilight/{p-m45JgquB.system.js.map → p-ZVtzqdY_.system.js.map} +1 -1
- package/dist/twilight/{p-78445f72.entry.js → p-a2bc45d1.entry.js} +2 -2
- package/dist/twilight/{p-9d4c77ca.system.entry.js → p-a72bb042.system.entry.js} +2 -2
- package/dist/twilight/{p-CccsFhGb.js → p-aXWtn0LI.js} +2 -2
- package/dist/twilight/{p-CccsFhGb.js.map → p-aXWtn0LI.js.map} +1 -1
- package/dist/twilight/{p-d10fb1ea.entry.js → p-b0729269.entry.js} +2 -2
- package/dist/twilight/{p-CzZ0reHo.system.js → p-bHKfTsJB.system.js} +2 -2
- package/dist/twilight/{p-CzZ0reHo.system.js.map → p-bHKfTsJB.system.js.map} +1 -1
- package/dist/twilight/{p-da55f9f9.system.entry.js → p-bf0b636f.system.entry.js} +2 -2
- package/dist/twilight/{p-872556b3.entry.js → p-c4009451.entry.js} +2 -2
- package/dist/twilight/p-c4009451.entry.js.map +1 -0
- package/dist/twilight/{p-fec96987.entry.js → p-c5b5f52a.entry.js} +2 -2
- package/dist/twilight/{p-ef67d700.entry.js → p-d169129b.entry.js} +2 -2
- package/dist/twilight/{p-a0cecbec.entry.js → p-d62c3afd.entry.js} +2 -2
- package/dist/twilight/{p-e050efb7.system.entry.js → p-d774769c.system.entry.js} +2 -2
- package/dist/twilight/{p-dcefa448.entry.js → p-d7cf0bca.entry.js} +2 -2
- package/dist/twilight/{p-98e0fa42.system.entry.js → p-d9047f21.system.entry.js} +2 -2
- package/dist/twilight/{p-739cb5a7.system.entry.js → p-da8982d5.system.entry.js} +2 -2
- package/dist/twilight/{p-c4dd3930.entry.js → p-e0ef58d4.entry.js} +2 -2
- package/dist/twilight/{p-fbcee9cb.entry.js → p-e436f760.entry.js} +7 -7
- package/dist/twilight/{p-83e5fee0.entry.js → p-e6bd37b4.entry.js} +2 -2
- package/dist/twilight/{p-c2081eb3.entry.js → p-e9bada64.entry.js} +2 -2
- package/dist/twilight/{p-4281b806.system.entry.js → p-ecb43959.system.entry.js} +2 -2
- package/dist/twilight/{p-14ba8ae9.system.entry.js → p-ef96cfa9.system.entry.js} +2 -2
- package/dist/twilight/{p-cc0c1f02.system.entry.js → p-f048cf7f.system.entry.js} +2 -2
- package/dist/twilight/{p-06b1e39a.system.entry.js → p-f2161f0c.system.entry.js} +2 -2
- package/dist/twilight/{p-6505a104.system.entry.js → p-f27c5021.system.entry.js} +2 -2
- package/dist/twilight/{p-9da2939b.system.entry.js → p-f783078f.system.entry.js} +3 -3
- package/dist/twilight/{p-vy_mUu-Q.system.js.map → p-jDfipULr.system.js.map} +1 -1
- package/dist/twilight/{p-CfN45V5l.system.js → p-yvGCQVwO.system.js} +3 -3
- package/dist/twilight/{p-CfN45V5l.system.js.map → p-yvGCQVwO.system.js.map} +1 -1
- package/dist/twilight/salla-cart-item-offers.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/twilight/p-5d9ed554.system.entry.js.map +0 -1
- package/dist/twilight/p-872556b3.entry.js.map +0 -1
- package/dist/twilight/p-C9MU9BVQ.system.js.map +0 -1
- /package/dist/twilight/{p-4b352943.entry.js.map → p-0047e463.entry.js.map} +0 -0
- /package/dist/twilight/{p-c97427a3.entry.js.map → p-0185bdf9.entry.js.map} +0 -0
- /package/dist/twilight/{p-a7ee5fff.system.entry.js.map → p-06d9633d.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-715c0aad.system.entry.js.map → p-09b83591.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-8e9a8f3a.system.entry.js.map → p-09c0aa9b.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-a84b03ef.system.entry.js.map → p-0d016d1d.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-70aaaee4.entry.js.map → p-0f4a870e.entry.js.map} +0 -0
- /package/dist/twilight/{p-ebc9637a.entry.js.map → p-0fa2e49f.entry.js.map} +0 -0
- /package/dist/twilight/{p-3186acf1.system.entry.js.map → p-2165bd1d.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-41ad0b93.entry.js.map → p-2d98f929.entry.js.map} +0 -0
- /package/dist/twilight/{p-b3e6ca1d.entry.js.map → p-3092fcdb.entry.js.map} +0 -0
- /package/dist/twilight/{p-1afdd2a3.entry.js.map → p-38849a98.entry.js.map} +0 -0
- /package/dist/twilight/{p-ee469ca6.entry.js.map → p-39da4299.entry.js.map} +0 -0
- /package/dist/twilight/{p-3e38af1e.entry.js.map → p-403bcb42.entry.js.map} +0 -0
- /package/dist/twilight/{p-c765c344.system.entry.js.map → p-484536e8.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-61c07205.system.entry.js.map → p-4dca6aeb.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ec8e40c6.system.entry.js.map → p-51fa78d1.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-3f0f0fba.system.entry.js.map → p-530bef5e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9f1d5925.entry.js.map → p-5332a208.entry.js.map} +0 -0
- /package/dist/twilight/{p-3b7ad517.entry.js.map → p-549e1de2.entry.js.map} +0 -0
- /package/dist/twilight/{p-243adaa4.entry.js.map → p-5934c2e7.entry.js.map} +0 -0
- /package/dist/twilight/{p-d3df4df3.entry.js.map → p-64b33f8c.entry.js.map} +0 -0
- /package/dist/twilight/{p-22d509b1.entry.js.map → p-680392a3.entry.js.map} +0 -0
- /package/dist/twilight/{p-ee34baf8.system.entry.js.map → p-68fbf27e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-c857e487.entry.js.map → p-6a5a300e.entry.js.map} +0 -0
- /package/dist/twilight/{p-c4e5aeb1.system.entry.js.map → p-6b6d43af.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6c0913d2.entry.js.map → p-744ddc76.entry.js.map} +0 -0
- /package/dist/twilight/{p-fefce3f1.system.entry.js.map → p-746795d4.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4d1f4501.system.entry.js.map → p-77118d49.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-97ea35f1.system.entry.js.map → p-77d462cb.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e28511db.entry.js.map → p-7eacd230.entry.js.map} +0 -0
- /package/dist/twilight/{p-b76619b6.system.entry.js.map → p-8e15dbb5.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-06f554cc.system.entry.js.map → p-99ee7ab8.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-a67f65f4.system.entry.js.map → p-9e901aaa.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-dafe7756.entry.js.map → p-9fb60f62.entry.js.map} +0 -0
- /package/dist/twilight/{p-78445f72.entry.js.map → p-a2bc45d1.entry.js.map} +0 -0
- /package/dist/twilight/{p-9d4c77ca.system.entry.js.map → p-a72bb042.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-d10fb1ea.entry.js.map → p-b0729269.entry.js.map} +0 -0
- /package/dist/twilight/{p-da55f9f9.system.entry.js.map → p-bf0b636f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-fec96987.entry.js.map → p-c5b5f52a.entry.js.map} +0 -0
- /package/dist/twilight/{p-ef67d700.entry.js.map → p-d169129b.entry.js.map} +0 -0
- /package/dist/twilight/{p-a0cecbec.entry.js.map → p-d62c3afd.entry.js.map} +0 -0
- /package/dist/twilight/{p-e050efb7.system.entry.js.map → p-d774769c.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-dcefa448.entry.js.map → p-d7cf0bca.entry.js.map} +0 -0
- /package/dist/twilight/{p-98e0fa42.system.entry.js.map → p-d9047f21.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-739cb5a7.system.entry.js.map → p-da8982d5.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-c4dd3930.entry.js.map → p-e0ef58d4.entry.js.map} +0 -0
- /package/dist/twilight/{p-fbcee9cb.entry.js.map → p-e436f760.entry.js.map} +0 -0
- /package/dist/twilight/{p-83e5fee0.entry.js.map → p-e6bd37b4.entry.js.map} +0 -0
- /package/dist/twilight/{p-c2081eb3.entry.js.map → p-e9bada64.entry.js.map} +0 -0
- /package/dist/twilight/{p-4281b806.system.entry.js.map → p-ecb43959.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-14ba8ae9.system.entry.js.map → p-ef96cfa9.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-cc0c1f02.system.entry.js.map → p-f048cf7f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-06b1e39a.system.entry.js.map → p-f2161f0c.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6505a104.system.entry.js.map → p-f27c5021.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9da2939b.system.entry.js.map → p-f783078f.system.entry.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["sallaCartItemOffersCss","SallaCartItemOffers","constructor","hostRef","this","internalOffers","showAll","freeLabel","receivedOffer","discountAmountLabel","showMoreOffers","icons","DiscountCouponIcon","GiftIcon","FireIcon","SpecialDiscountIcon","TagMoneyIcon","visibleOffersCount","handleCartItemUpdated","event","updatedItem","data","cart","items","find","item","id","itemId","internalQuantity","quantity","detailed_offers","internalProductPrice","product_price","toggleShowAll","componentWillLoad","Salla","onReady","salla","lang","onLoaded","get","parseOffers","offers","productPrice","componentDidLoad","on","JSON","parse","e","console","error","visibleOffers","slice","hiddenOffers","getPaidQty","offer","free_quantity","renderOffer","paidQty","h","class","helpers","number","innerHTML","money","discount_icon","replace","offer_name","discount_amount","toFixed","render","_a","length","map","_b","onClick","type","ArrowDownIcon"],"sources":["src/components/salla-cart-item-offers/salla-cart-item-offers.scss?tag=salla-cart-item-offers","src/components/salla-cart-item-offers/salla-cart-item-offers.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Prop, State, h } from '@stencil/core';\nimport SpecialDiscountIcon from '../../assets/svg/special-discount.svg';\nimport GiftIcon from '../../assets/svg/gift.svg';\nimport TagMoneyIcon from '../../assets/svg/tag-money.svg';\nimport FireIcon from '../../assets/svg/fire.svg';\nimport DiscountCouponIcon from '../../assets/svg/discount-coupon.svg';\nimport ArrowDownIcon from '../../assets/svg/keyboard_arrow_down.svg';\n\n@Component({\n tag: 'salla-cart-item-offers',\n styleUrl: 'salla-cart-item-offers.scss',\n})\nexport class SallaCartItemOffers {\n /**\n * The quantity of the cart item\n */\n @Prop() quantity!: number;\n /**\n * JSON string containing the offers associated with the cart item\n */\n @Prop() offers!: string;\n /**\n * The unique identifier of the cart item\n */\n @Prop() itemId!: number;\n /**\n * The original price of the product in the cart\n */\n @Prop() productPrice!: number;\n\n @State() internalQuantity!: number;\n @State() internalOffers: any[] = [];\n @State() internalProductPrice!: number;\n @State() showAll: boolean = false;\n // Translations\n @State() freeLabel: string = '';\n @State() receivedOffer: string = '';\n @State() discountAmountLabel: string = '';\n @State() showMoreOffers: string = '';\n\n\n private readonly icons: Record<string, string> = {\n DiscountCouponIcon,\n GiftIcon,\n FireIcon,\n SpecialDiscountIcon,\n TagMoneyIcon,\n };\n\n private visibleOffersCount = 3;\n\n async componentWillLoad() {\n await Salla.onReady();\n await salla.lang.onLoaded(() => {\n this.freeLabel = salla.lang.get('common.elements.freeExclam');\n this.receivedOffer = salla.lang.get('pages.cart.received_offer');\n this.discountAmountLabel = salla.lang.get('pages.cart.discount_amount');\n this.showMoreOffers = salla.lang.get('pages.cart.show_more_offers');\n });\n this.internalQuantity = this.quantity;\n this.internalOffers = this.parseOffers(this.offers);\n this.internalProductPrice = this.productPrice;\n }\n\n componentDidLoad() {\n salla.event.on('cart::item.updated', (event) => this.handleCartItemUpdated(event));\n }\n\n private parseOffers(offers: string): any[] {\n try {\n return JSON.parse(offers || '[]');\n } catch (e) {\n console.error('Failed to parse offers', e);\n return [];\n }\n }\n\n private handleCartItemUpdated = (event) => {\n const updatedItem = event.data.cart.items.find((item) => item.id === this.itemId);\n if (updatedItem?.id === this.itemId) {\n this.internalQuantity = updatedItem.quantity;\n this.internalOffers = updatedItem.detailed_offers || [];\n this.internalProductPrice = updatedItem.product_price;\n }\n };\n\n private get visibleOffers() {\n return this.internalOffers.slice(0, this.visibleOffersCount);\n }\n\n private get hiddenOffers() {\n return this.internalOffers.slice(this.visibleOffersCount);\n }\n\n private toggleShowAll = () => {\n this.showAll = !this.showAll;\n };\n\n private getPaidQty(quantity: number, offer: any) {\n return quantity - offer.free_quantity;\n }\n\n private renderOffer(quantity: number, offer: any) {\n const paidQty = this.getPaidQty(quantity, offer);\n\n return (\n <div class=\"s-cart-item-offers-box\">\n {offer.free_quantity > 0 && paidQty > 0 && (\n <div class=\"s-cart-item-offers-paid-free\">\n <div class=\"s-cart-item-offers-line\">\n {salla.helpers.number(paidQty)} × <span innerHTML={salla.money(this.internalProductPrice)}></span>\n </div>\n <div class=\"s-cart-item-offers-line\">\n {salla.helpers.number(offer.free_quantity)} × \n <span class=\"s-cart-item-offers-regular-price\" innerHTML={salla.money(this.internalProductPrice)}></span>\n <span class=\"s-cart-item-offers-free-label\">{this.freeLabel}</span>\n </div>\n </div>\n )}\n\n <div class=\"s-cart-item-offers-details\">\n <span class={`s-cart-item-offers-icon`} innerHTML={this.icons[offer.discount_icon] || ''}></span>\n <div>\n <p class=\"s-cart-item-offers-title\">\n {this.receivedOffer.replace(':offer', offer.offer_name)}\n </p>\n <p class=\"s-cart-item-offers-discount\">\n <span innerHTML={this.discountAmountLabel.replace(':amount', salla.money(offer.discount_amount.toFixed(2)))}></span>\n </p>\n </div>\n </div>\n </div>\n );\n }\n\n render() {\n if (!this.internalOffers?.length) {\n return null;\n }\n\n return (\n <div class=\"s-cart-item-offers-container\" id={`offers_list_${this.itemId}`}>\n {this.visibleOffers.map((offer) => this.renderOffer(this.internalQuantity, offer))}\n\n {this.internalOffers?.length > this.visibleOffersCount && (\n <div class=\"s-cart-item-offers-show-more\">\n <button\n class=\"s-cart-item-offers-show-more-btn\"\n onClick={this.toggleShowAll}\n type=\"button\">\n <span class=\"s-cart-item-offers-show-more-label\">\n +{this.hiddenOffers.length} {this.showMoreOffers}\n <span\n innerHTML={ArrowDownIcon}\n class={{\n 's-cart-item-offers-arrow-icon': true,\n 's-cart-item-offers-arrow-open': this.showAll,\n }}\n ></span>\n </span>\n </button>\n </div>\n )}\n\n {this.showAll && (\n <div class=\"s-cart-item-offers-collapsed\" id={`offers_${this.itemId}`}>\n {this.hiddenOffers.map((offer) => this.renderOffer(this.internalQuantity, offer))}\n </div>\n )}\n </div>\n );\n }\n}\n"],"mappings":";;;qgKAAA,MAAMA,EAAyB,uB,MCYlBC,EAAmB,MAJhC,WAAAC,CAAAC,G,UAuBWC,KAAcC,eAAU,GAExBD,KAAOE,QAAY,MAEnBF,KAASG,UAAW,GACpBH,KAAaI,cAAW,GACxBJ,KAAmBK,oBAAW,GAC9BL,KAAcM,eAAW,GAGjBN,KAAAO,MAAgC,CAC/CC,qBACAC,WACAC,WACAC,sBACAC,gBAGMZ,KAAkBa,mBAAG,EA4BrBb,KAAAc,sBAAyBC,IAC/B,MAAMC,EAAcD,EAAME,KAAKC,KAAKC,MAAMC,MAAMC,GAASA,EAAKC,KAAOtB,KAAKuB,SAC1E,IAAIP,IAAA,MAAAA,SAAA,SAAAA,EAAaM,MAAOtB,KAAKuB,OAAQ,CACnCvB,KAAKwB,iBAAmBR,EAAYS,SACpCzB,KAAKC,eAAiBe,EAAYU,iBAAmB,GACrD1B,KAAK2B,qBAAuBX,EAAYY,a,GAYpC5B,KAAa6B,cAAG,KACtB7B,KAAKE,SAAWF,KAAKE,OAAO,CA6E/B,CAzHC,uBAAM4B,SACEC,MAAMC,gBACNC,MAAMC,KAAKC,UAAS,KACtBnC,KAAKG,UAAY8B,MAAMC,KAAKE,IAAI,8BAChCpC,KAAKI,cAAgB6B,MAAMC,KAAKE,IAAI,6BACpCpC,KAAKK,oBAAsB4B,MAAMC,KAAKE,IAAI,8BAC1CpC,KAAKM,eAAiB2B,MAAMC,KAAKE,IAAI,8BAA8B,IAEvEpC,KAAKwB,iBAAmBxB,KAAKyB,SAC7BzB,KAAKC,eAAiBD,KAAKqC,YAAYrC,KAAKsC,QAC5CtC,KAAK2B,qBAAuB3B,KAAKuC,Y,CAGnC,gBAAAC,GACEP,MAAMlB,MAAM0B,GAAG,sBAAuB1B,GAAUf,KAAKc,sBAAsBC,I,CAGrE,WAAAsB,CAAYC,GAClB,IACE,OAAOI,KAAKC,MAAML,GAAU,K,CAC5B,MAAOM,GACPC,QAAQC,MAAM,yBAA0BF,GACxC,MAAO,E,EAaX,iBAAYG,GACV,OAAO/C,KAAKC,eAAe+C,MAAM,EAAGhD,KAAKa,mB,CAG3C,gBAAYoC,GACV,OAAOjD,KAAKC,eAAe+C,MAAMhD,KAAKa,mB,CAOhC,UAAAqC,CAAWzB,EAAkB0B,GACnC,OAAO1B,EAAW0B,EAAMC,a,CAGlB,WAAAC,CAAY5B,EAAkB0B,GACpC,MAAMG,EAAUtD,KAAKkD,WAAWzB,EAAU0B,GAE1C,OACEI,EAAA,OAAKC,MAAM,0BACRL,EAAMC,cAAgB,GAAKE,EAAU,GACpCC,EAAK,OAAAC,MAAM,gCACTD,EAAK,OAAAC,MAAM,2BACRvB,MAAMwB,QAAQC,OAAOJ,GAAQ,MAAIC,EAAM,QAAAI,UAAW1B,MAAM2B,MAAM5D,KAAK2B,yBAEtE4B,EAAK,OAAAC,MAAM,2BACRvB,MAAMwB,QAAQC,OAAOP,EAAMC,eAAc,KAC1CG,EAAA,QAAMC,MAAM,mCAAmCG,UAAW1B,MAAM2B,MAAM5D,KAAK2B,wBAC3E4B,EAAM,QAAAC,MAAM,iCAAiCxD,KAAKG,aAKxDoD,EAAK,OAAAC,MAAM,8BACTD,EAAA,QAAMC,MAAO,0BAA2BG,UAAW3D,KAAKO,MAAM4C,EAAMU,gBAAkB,KACtFN,EAAA,WACEA,EAAA,KAAGC,MAAM,4BACNxD,KAAKI,cAAc0D,QAAQ,SAAUX,EAAMY,aAE9CR,EAAG,KAAAC,MAAM,+BACPD,EAAA,QAAMI,UAAW3D,KAAKK,oBAAoByD,QAAQ,UAAW7B,MAAM2B,MAAMT,EAAMa,gBAAgBC,QAAQ,U,CAQnH,MAAAC,G,QACE,MAAKC,EAAAnE,KAAKC,kBAAgB,MAAAkE,SAAA,SAAAA,EAAAC,QAAQ,CAChC,OAAO,I,CAGT,OACEb,EAAA,OAAKC,MAAM,+BAA+BlC,GAAI,eAAetB,KAAKuB,UAC/DvB,KAAK+C,cAAcsB,KAAKlB,GAAUnD,KAAKqD,YAAYrD,KAAKwB,iBAAkB2B,OAE1EmB,EAAAtE,KAAKC,kBAAc,MAAAqE,SAAA,SAAAA,EAAEF,QAASpE,KAAKa,oBAClC0C,EAAK,OAAAC,MAAM,gCACTD,EAAA,UACEC,MAAM,mCACNe,QAASvE,KAAK6B,cACd2C,KAAK,UACLjB,EAAM,QAAAC,MAAM,sCAAoC,IAC5CxD,KAAKiD,aAAamB,OAAM,IAAGpE,KAAKM,eAClCiD,EAAA,QACEI,UAAWc,EACXjB,MAAO,CACL,gCAAiC,KACjC,gCAAiCxD,KAAKE,cAQjDF,KAAKE,SACJqD,EAAK,OAAAC,MAAM,+BAA+BlC,GAAI,UAAUtB,KAAKuB,UAC1DvB,KAAKiD,aAAaoB,KAAKlB,GAAUnD,KAAKqD,YAAYrD,KAAKwB,iBAAkB2B,M","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as e,g as o}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as t,h as e,g as o}from"./p-BsC_KPRw.js";const i='.s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;-webkit-transform:translateX(-39%);transform:translateX(-39%);background-color:#baf3e6;color:#004d5a;bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;opacity:0;-webkit-transition:opacity 0.3s;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:"";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#baf3e6 transparent transparent transparent}.s-tooltip-item:dir(ltr){-webkit-transform:translateX(-72%);transform:translateX(-72%)}';const s=class{constructor(e){t(this,e);this.show=false;this.targetElement=null}handleMouseOver(t){if(this.targetElement&&this.targetElement.contains(t.target)){this.show=true}}handleMouseOut(t){if(this.targetElement&&this.targetElement.contains(t.target)){this.show=false}}componentDidLoad(){this.targetElement=document.getElementById(this.targetId)}render(){return e("div",{key:"e2f0e642e43fd067999d1e5996ce7ee291c37a7f",class:"s-tooltip-container"},e("slot",{key:"9aebb541ef5e5e2e314f8640b8fafc8c4dee69a3"}),this.show&&e("div",{key:"a531e80d6c62c566eac572c301fab782ae3de916",class:"s-tooltip-item"},this.text))}get el(){return o(this)}};s.style=i;export{s as salla_tooltip};
|
|
5
|
+
//# sourceMappingURL=p-c5b5f52a.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as t,g as i}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as s,h as t,g as i}from"./p-BsC_KPRw.js";import{a}from"./p-CgtvEd63.js";const e=":host{display:block}";const l=class{constructor(t){s(this,t);var i;this.currentSlug=salla.config.get("page.slug");salla.onReady((()=>{this.currentSlug=salla.config.get("page.slug")}));this.advSlot=((i=this.host.querySelector('[slot="adv"]'))===null||i===void 0?void 0:i.innerHTML)||`<div class="s-advertisement-content"><h2 class="s-advertisement-content-main">{iconElem}{urlElem}</h2>{closeElem}</div>\n `}isNotVisible(s){return!!salla.storage.get(`statusAd-${s.id}`)}setCanDisplayFlag(s,t){if(!t){salla.storage.set(`statusAd-${s.id}`,"dismissed");a({targets:this.host,opacity:[1,0],duration:300,height:[this.host.clientHeight,0],easing:"easeInOutQuad"})}}render(){if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}return this.advertisements.map((s=>t("div",{class:{"s-hidden":this.isNotVisible(s),"s-advertisement":true},"data-id":s.id,style:{"background-color":s.colors.bg,color:s.colors.text}},t("div",{id:"adv-slot",innerHTML:this.advSlot.replace("{iconElem}",`<i class="s-advertisement-content-icon ${s.icon}"></i>`).replace("{urlElem}",s.url?`<a href="${s.url}" target="${s.target}">${s.description}</a>`:s.description).replace("{closeElem}",`<button class="s-advertisement-action" aria-label="close-alert"><i class="sicon-cancel"></i></button>`).replace("{icon}",s.icon).replace("{url}",s.url).replace("{target}",s.target).replace("{description}",s.description).replace("{bg_color}",s.colors.bg).replace("{text_color}",s.colors.text)}))))}componentWillLoad(){return new Promise((s=>salla.onReady(s))).then((()=>salla.api.advertisement.fetch(this.currentSlug))).then((s=>Array.isArray(s.data)?s.data.find((s=>!salla.storage.get(`statusAd-${s.id}`))):null)).then((s=>this.advertisements=s?[s]:[]))}componentDidRender(){var s;if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}setTimeout((()=>{let s=this.host.querySelector(".s-advertisement-action");if(s){s.addEventListener("click",(()=>this.setCanDisplayFlag(this.advertisements[0],false)))}}));this.host.querySelectorAll("#adv-slot").forEach((s=>s===null||s===void 0?void 0:s.replaceWith(s===null||s===void 0?void 0:s.firstChild)));(s=this.host.querySelector('[slot="adv"]'))===null||s===void 0?void 0:s.remove();a({targets:this.host,opacity:[0,1],duration:300,height:[0,this.host.clientHeight],easing:"easeInOutQuad"})}get host(){return i(this)}};l.style=e;export{l as salla_advertisement};
|
|
5
|
+
//# sourceMappingURL=p-d169129b.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,c as t,h as s,H as a,g as i}from"./p-DAlGHI9x.js";var n=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>calendar-time</title>\n<path d="M22.667 17.333c-0.737 0-1.333 0.596-1.333 1.333v2.667h-2.667c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h4c0.737 0 1.333-0.596 1.333-1.333v-4c0-0.737-0.596-1.333-1.333-1.333zM28 2.667h-2.667v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h5.363c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-5.363c-0.736 0-1.333-0.597-1.333-1.333v-21.333c0-0.736 0.597-1.333 1.333-1.333h2.667v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333v2.696c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.696c0-2.205-1.795-4-4-4zM22 12c-5.515 0-10 4.485-10 10s4.485 10 10 10 10-4.485 10-10-4.485-10-10-10zM22 29.333c-4.043 0-7.333-3.291-7.333-7.333s3.291-7.333 7.333-7.333 7.333 3.291 7.333 7.333-3.291 7.333-7.333 7.333z"></path>\n</svg>\n`;var o=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>calendar</title>\n<path d="M28 2.667h-2.667v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-21.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.599 1.333-1.333 1.333h-24c-0.736 0-1.333-0.599-1.333-1.333v-13.333h26.667zM29.333 12h-26.667v-5.333c0-0.736 0.599-1.333 1.333-1.333h2.667v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n`;var l=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>time</title>\n<path d="M16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333zM16 8c-0.736 0-1.333 0.596-1.333 1.333v6.667h-4c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h5.333c0.736 0 1.333-0.596 1.333-1.333v-8c0-0.737-0.597-1.333-1.333-1.333z"></path>\n</svg>\n`;const r=":host{display:block}";const c=class{constructor(s){e(this,s);this.invalidInput=t(this,"invalidInput");this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment","حجز موعد");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment","تعديل الموعد");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully","تمت اضافة الموعد بنجاح");this.selectDate=salla.lang.get("pages.cart.select_appointment_date","حدد تاريخ الموعد");this.bookingUrl="";this.iframeReady=false;this.reservations=[];salla.lang.onLoaded((()=>this.setTranslations()));Salla.event.on("booking::open",(e=>this.handleBookingOpen(e)))}async setTranslations(){const e=(e,t,s)=>new Promise((a=>{salla.helpers.setNested(salla.lang.messages[e],t,s);a(true)}));await e("ar.trans","pages.cart.book_an_appointment","حجز موعد");await e("en.trans","pages.cart.book_an_appointment","Book an Appointment");await e("ar.trans","pages.cart.edit_an_appointment","تعديل الموعد");await e("en.trans","pages.cart.edit_an_appointment","Edit an Appointment");await e("ar.trans","pages.cart.booked_successfully","تمت اضافة الموعد بنجاح");await e("en.trans","pages.cart.booked_successfully","Booked Successfully");await e("ar.trans","pages.cart.select_appointment_date","حدد تاريخ الموعد");await e("en.trans","pages.cart.select_appointment_date","Select appointment date");this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully");this.selectDate=salla.lang.get("pages.cart.select_appointment_date")}openBookingModal(e,t=false){if(t&&(!e.detail||typeof e.detail!=="number"||e.detail!==this.productId)){return}if(salla.config.isGuest()){this.setAfterReloadEvent("booking::open-after-reload",this.productId);salla.event.dispatch("login::open");return}salla.booking.add(this.productId,false).then((e=>{if(e.data.redirect.to!=="booking"){throw new Error("Unexpected redirect!")}salla.event.dispatch("booking::open",{url:e.data.redirect.url,id:this.productId})})).catch((e=>{salla.error(salla.lang.get("common.errors.error_occurred"));salla.logger.error(e.response||e)}))}handleBookingOpen(e){if(e.id!==this.productId)return;this.bookingUrl=salla.url.addParamToUrl("product_id",e.id,e.url);this.iframeReady=true;setTimeout((()=>{this.modal.setTitle(this.selectDate);this.modal.open()}),100)}setAfterReloadEvent(e,t){salla.storage.set("afterReloadEvent",{event:e,payload:t})}emitAfterReloadEvent(){const e=salla.storage.get("afterReloadEvent");if(e&&e.event){const t=new CustomEvent(e.event,{detail:e.payload});window.dispatchEvent(t);salla.storage.remove("afterReloadEvent")}}componentWillLoad(){if(this.option&&this.option.details.length){this.reservations=this.option.details}}componentDidLoad(){window.addEventListener("booking::open-after-reload",(e=>this.openBookingModal(e,true)));this.emitAfterReloadEvent();window.addEventListener("message",this.handleMessageEvent.bind(this));this.reservationsInput.addEventListener("invalid",(e=>this.invalidInput.emit(e)));this.reservationsInput.addEventListener("input",(()=>{this.reservationsInput.setCustomValidity("");this.reservationsInput.reportValidity()}))}handleMessageEvent(e){var t,s;if(e.data.source!=="booking")return;const a=e.data.type;const i=e.data.message;if(localStorage.getItem("debug"))console.log(`Received an action:${a}`,e.data);if(a==="error"){if((t=i.fields)===null||t===void 0?void 0:t.reservation){salla.notify.error(i.fields.reservation[0]);return}const e=Object.values(i.fields||[i.message]).flat().map((e=>`<li>${e}</li>`)).join("");salla.notify.error(`<ul>${e}</ul>`)}if(a==="success"){if(Number(i.productId)!==Number(this.productId))return;this.reservations=i.data.reservations.map((e=>{if(e.time&&e.time.length>0){const t=e.time[0];return{date:e.date,day:e.day,from_timestamp:t.from,to_timestamp:t.to}}return null})).filter((e=>e!==null));salla.notify.success(this.bookedLabel);(s=this.modal)===null||s===void 0?void 0:s.close();setTimeout((()=>window.location.reload()))}if(a==="height"){this.iframe.height=(i===null||i===void 0?void 0:i.height)+"px"}}bookingModal(){return s("salla-modal",{class:"s-booking-field-modal",ref:e=>this.modal=e,width:"md",position:"middle",noPadding:true},s("iframe",{ref:e=>this.iframe=e,src:this.bookingUrl,frameborder:"0"}))}renderReservationDate(e){return s("span",{class:e.from_timestamp?"s-booking-field-reservations-has-time":""},s("i",{class:"s-booking-field-reservations-icon",innerHTML:o}),e.date)}renderReservationTime(e){if(!e.from_timestamp)return"";return s("span",{class:"s-booking-field-reservations-time"},s("i",{class:"s-booking-field-reservations-icon",innerHTML:l}),s("span",null,e.from_timestamp," - ",e.to_timestamp))}render(){return s(a,{key:"9c5755ca98a3a3a1340414de0109133ffb6617c4"},s("div",{key:"dabd37fc3a9a1879fb0c5cb3899c28971d8724ef",class:"s-booking-field-main"},this.option.required||this.reservations.length>0?s("div",{class:"s-booking-field-price"},s("span",{innerHTML:salla.money(this.option.price)})):"",s("salla-button",{key:"7fbe8ff75abac48b86b7992c261ba0439514c786",class:"s-booking-field-book-now",size:"small",loaderPosition:"center",fill:"outline",onClick:e=>this.openBookingModal(e,false)},s("span",{key:"496907083ce40b1618c8a1b2228f91c70b83f60a",class:"s-booking-field-book-now-content"},s("span",{key:"e4455c6205055349b3137397f039125e0b3a6cf1",innerHTML:n}),this.reservations.length?this.editLabel:this.bookNowLabel))),this.reservations.length>0&&s("div",{key:"de68930ac2cab061c7f9b268f8887342528ba8e7",class:"s-booking-field-reservations"},this.reservations.map(((e,t)=>s("div",{key:t,class:"s-booking-field-reservations-item"},this.renderReservationDate(e),this.renderReservationTime(e))))),s("input",{key:"f148bc7110984389035474c47fcc963a9fa14607",class:"s-hidden",name:this.option.name,required:this.option.required,value:JSON.stringify(this.reservations)==="[]"?"":JSON.stringify(this.reservations),ref:e=>this.reservationsInput=e}),this.iframeReady&&this.bookingModal())}get host(){return i(this)}};c.style=r;const d=class{constructor(t){e(this,t)}hideAllOptions(e){this.host.querySelectorAll(`[data-show-when^="options[${e}"]`).forEach((e=>{e.classList.add("hidden");this.hideAllOptions(e.dataset.optionId);this.disableInputs(e)}))}disableInputs(e){e.querySelectorAll("[name]").forEach((e=>{var t;e.setAttribute("disabled","");e.removeAttribute("required");if(((t=e===null||e===void 0?void 0:e.tagName)===null||t===void 0?void 0:t.toLowerCase())==="select"){e.value=""}if(["checkbox"].includes(e.getAttribute("type"))&&e.hasOwnProperty("checked")){e.checked=false}}))}changeHandler(e){var t;salla.event.emit("salla-onditional-fields::change",e);salla.log("Received the change event: ",e);if(!e.target||!["SELECT"].includes(e.target.tagName)&&!["checkbox","radio"].includes(e.target.getAttribute("type"))){salla.log("Ignore the change because is not a supported input: "+(((t=e===null||e===void 0?void 0:e.target)===null||t===void 0?void 0:t.tagName)||"N/A"));return}let s=e.target.name.replace("[]","");let a=e.target.getAttribute("type")==="checkbox";let i=e.target.getAttribute("type")==="radio";salla.log("Trying to find all elements with condition:",`[data-show-when^="${s}"]`);this.host.querySelectorAll(`[data-show-when^="${s}"]`).forEach((t=>{let s=!(t===null||t===void 0?void 0:t.dataset.showWhen.includes("!="));let n=t===null||t===void 0?void 0:t.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();let o;if(a){let t=Array.from(this.host.querySelectorAll(`input[name="${e.target.name}"]:checked`),(e=>e===null||e===void 0?void 0:e.value));o=t.includes(n.toString())}else if(i){o=e.target.checked&&e.target.value===n}else{o=n===e.target.value}salla.log("The input is ",a?"Multiple":i?"Radio":"Single"," value:",o);let l=s&&o||!s&&!o;if(l){t.classList.remove("hidden");t.querySelectorAll("[name]").forEach((e=>{e.removeAttribute("disabled");const t=e.closest(".s-product-options-option");if(t.dataset.optionRequired==="true"){e.setAttribute("required","")}if(e.getAttribute("type")==="checkbox"){const t=Array.from(document.querySelectorAll(`input[type="checkbox"][name="${e.getAttribute("name")}"]`));const s=t.some((e=>e.checked));if(s){t.forEach((e=>{e.removeAttribute("required")}))}}}))}else{this.hideAllOptions(t.dataset.optionId);t.classList.add("hidden");this.disableInputs(t)}}))}componentDidRender(){this.host.querySelectorAll(`[data-show-when]`).forEach((e=>{var t;let s=(t=e===null||e===void 0?void 0:e.dataset)===null||t===void 0?void 0:t.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();if(!s){return}this.changeHandler({target:this.host.querySelector('[name^="'+s+'"]')})}))}render(){return s(a,{key:"f2c9836cd5e5667efd13ade5d4e064551c89d569"},s("slot",{key:"980eef852261b13f477a2c2ad140e7c3e96e737f"}))}get host(){return i(this)}};export{c as salla_booking_field,d as salla_conditional_fields};
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as e,c as t,h as s,H as a,g as i}from"./p-BsC_KPRw.js";var n=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>calendar-time</title>\n<path d="M22.667 17.333c-0.737 0-1.333 0.596-1.333 1.333v2.667h-2.667c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h4c0.737 0 1.333-0.596 1.333-1.333v-4c0-0.737-0.596-1.333-1.333-1.333zM28 2.667h-2.667v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h5.363c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-5.363c-0.736 0-1.333-0.597-1.333-1.333v-21.333c0-0.736 0.597-1.333 1.333-1.333h2.667v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333v2.696c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.696c0-2.205-1.795-4-4-4zM22 12c-5.515 0-10 4.485-10 10s4.485 10 10 10 10-4.485 10-10-4.485-10-10-10zM22 29.333c-4.043 0-7.333-3.291-7.333-7.333s3.291-7.333 7.333-7.333 7.333 3.291 7.333 7.333-3.291 7.333-7.333 7.333z"></path>\n</svg>\n`;var o=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>calendar</title>\n<path d="M28 2.667h-2.667v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-21.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.599 1.333-1.333 1.333h-24c-0.736 0-1.333-0.599-1.333-1.333v-13.333h26.667zM29.333 12h-26.667v-5.333c0-0.736 0.599-1.333 1.333-1.333h2.667v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n`;var l=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>time</title>\n<path d="M16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333zM16 8c-0.736 0-1.333 0.596-1.333 1.333v6.667h-4c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h5.333c0.736 0 1.333-0.596 1.333-1.333v-8c0-0.737-0.597-1.333-1.333-1.333z"></path>\n</svg>\n`;const r=":host{display:block}";const c=class{constructor(s){e(this,s);this.invalidInput=t(this,"invalidInput");this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment","حجز موعد");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment","تعديل الموعد");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully","تمت اضافة الموعد بنجاح");this.selectDate=salla.lang.get("pages.cart.select_appointment_date","حدد تاريخ الموعد");this.bookingUrl="";this.iframeReady=false;this.reservations=[];salla.lang.onLoaded((()=>this.setTranslations()));Salla.event.on("booking::open",(e=>this.handleBookingOpen(e)))}async setTranslations(){const e=(e,t,s)=>new Promise((a=>{salla.helpers.setNested(salla.lang.messages[e],t,s);a(true)}));await e("ar.trans","pages.cart.book_an_appointment","حجز موعد");await e("en.trans","pages.cart.book_an_appointment","Book an Appointment");await e("ar.trans","pages.cart.edit_an_appointment","تعديل الموعد");await e("en.trans","pages.cart.edit_an_appointment","Edit an Appointment");await e("ar.trans","pages.cart.booked_successfully","تمت اضافة الموعد بنجاح");await e("en.trans","pages.cart.booked_successfully","Booked Successfully");await e("ar.trans","pages.cart.select_appointment_date","حدد تاريخ الموعد");await e("en.trans","pages.cart.select_appointment_date","Select appointment date");this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully");this.selectDate=salla.lang.get("pages.cart.select_appointment_date")}openBookingModal(e,t=false){if(t&&(!e.detail||typeof e.detail!=="number"||e.detail!==this.productId)){return}if(salla.config.isGuest()){this.setAfterReloadEvent("booking::open-after-reload",this.productId);salla.event.dispatch("login::open");return}salla.booking.add(this.productId,false).then((e=>{if(e.data.redirect.to!=="booking"){throw new Error("Unexpected redirect!")}salla.event.dispatch("booking::open",{url:e.data.redirect.url,id:this.productId})})).catch((e=>{salla.error(salla.lang.get("common.errors.error_occurred"));salla.logger.error(e.response||e)}))}handleBookingOpen(e){if(e.id!==this.productId)return;this.bookingUrl=salla.url.addParamToUrl("product_id",e.id,e.url);this.iframeReady=true;setTimeout((()=>{this.modal.setTitle(this.selectDate);this.modal.open()}),100)}setAfterReloadEvent(e,t){salla.storage.set("afterReloadEvent",{event:e,payload:t})}emitAfterReloadEvent(){const e=salla.storage.get("afterReloadEvent");if(e&&e.event){const t=new CustomEvent(e.event,{detail:e.payload});window.dispatchEvent(t);salla.storage.remove("afterReloadEvent")}}componentWillLoad(){if(this.option&&this.option.details.length){this.reservations=this.option.details}}componentDidLoad(){window.addEventListener("booking::open-after-reload",(e=>this.openBookingModal(e,true)));this.emitAfterReloadEvent();window.addEventListener("message",this.handleMessageEvent.bind(this));this.reservationsInput.addEventListener("invalid",(e=>this.invalidInput.emit(e)));this.reservationsInput.addEventListener("input",(()=>{this.reservationsInput.setCustomValidity("");this.reservationsInput.reportValidity()}))}handleMessageEvent(e){var t,s;if(e.data.source!=="booking")return;const a=e.data.type;const i=e.data.message;if(localStorage.getItem("debug"))console.log(`Received an action:${a}`,e.data);if(a==="error"){if((t=i.fields)===null||t===void 0?void 0:t.reservation){salla.notify.error(i.fields.reservation[0]);return}const e=Object.values(i.fields||[i.message]).flat().map((e=>`<li>${e}</li>`)).join("");salla.notify.error(`<ul>${e}</ul>`)}if(a==="success"){if(Number(i.productId)!==Number(this.productId))return;this.reservations=i.data.reservations.map((e=>{if(e.time&&e.time.length>0){const t=e.time[0];return{date:e.date,day:e.day,from_timestamp:t.from,to_timestamp:t.to}}return null})).filter((e=>e!==null));salla.notify.success(this.bookedLabel);(s=this.modal)===null||s===void 0?void 0:s.close();setTimeout((()=>window.location.reload()))}if(a==="height"){this.iframe.height=(i===null||i===void 0?void 0:i.height)+"px"}}bookingModal(){return s("salla-modal",{class:"s-booking-field-modal",ref:e=>this.modal=e,width:"md",position:"middle",noPadding:true},s("iframe",{ref:e=>this.iframe=e,src:this.bookingUrl,frameborder:"0"}))}renderReservationDate(e){return s("span",{class:e.from_timestamp?"s-booking-field-reservations-has-time":""},s("i",{class:"s-booking-field-reservations-icon",innerHTML:o}),e.date)}renderReservationTime(e){if(!e.from_timestamp)return"";return s("span",{class:"s-booking-field-reservations-time"},s("i",{class:"s-booking-field-reservations-icon",innerHTML:l}),s("span",null,e.from_timestamp," - ",e.to_timestamp))}render(){return s(a,{key:"9c5755ca98a3a3a1340414de0109133ffb6617c4"},s("div",{key:"dabd37fc3a9a1879fb0c5cb3899c28971d8724ef",class:"s-booking-field-main"},this.option.required||this.reservations.length>0?s("div",{class:"s-booking-field-price"},s("span",{innerHTML:salla.money(this.option.price)})):"",s("salla-button",{key:"7fbe8ff75abac48b86b7992c261ba0439514c786",class:"s-booking-field-book-now",size:"small",loaderPosition:"center",fill:"outline",onClick:e=>this.openBookingModal(e,false)},s("span",{key:"496907083ce40b1618c8a1b2228f91c70b83f60a",class:"s-booking-field-book-now-content"},s("span",{key:"e4455c6205055349b3137397f039125e0b3a6cf1",innerHTML:n}),this.reservations.length?this.editLabel:this.bookNowLabel))),this.reservations.length>0&&s("div",{key:"de68930ac2cab061c7f9b268f8887342528ba8e7",class:"s-booking-field-reservations"},this.reservations.map(((e,t)=>s("div",{key:t,class:"s-booking-field-reservations-item"},this.renderReservationDate(e),this.renderReservationTime(e))))),s("input",{key:"f148bc7110984389035474c47fcc963a9fa14607",class:"s-hidden",name:this.option.name,required:this.option.required,value:JSON.stringify(this.reservations)==="[]"?"":JSON.stringify(this.reservations),ref:e=>this.reservationsInput=e}),this.iframeReady&&this.bookingModal())}get host(){return i(this)}};c.style=r;const d=class{constructor(t){e(this,t)}hideAllOptions(e){this.host.querySelectorAll(`[data-show-when^="options[${e}"]`).forEach((e=>{e.classList.add("hidden");this.hideAllOptions(e.dataset.optionId);this.disableInputs(e)}))}disableInputs(e){e.querySelectorAll("[name]").forEach((e=>{var t;e.setAttribute("disabled","");e.removeAttribute("required");if(((t=e===null||e===void 0?void 0:e.tagName)===null||t===void 0?void 0:t.toLowerCase())==="select"){e.value=""}if(["checkbox"].includes(e.getAttribute("type"))&&e.hasOwnProperty("checked")){e.checked=false}}))}changeHandler(e){var t;salla.event.emit("salla-onditional-fields::change",e);salla.log("Received the change event: ",e);if(!e.target||!["SELECT"].includes(e.target.tagName)&&!["checkbox","radio"].includes(e.target.getAttribute("type"))){salla.log("Ignore the change because is not a supported input: "+(((t=e===null||e===void 0?void 0:e.target)===null||t===void 0?void 0:t.tagName)||"N/A"));return}let s=e.target.name.replace("[]","");let a=e.target.getAttribute("type")==="checkbox";let i=e.target.getAttribute("type")==="radio";salla.log("Trying to find all elements with condition:",`[data-show-when^="${s}"]`);this.host.querySelectorAll(`[data-show-when^="${s}"]`).forEach((t=>{let s=!(t===null||t===void 0?void 0:t.dataset.showWhen.includes("!="));let n=t===null||t===void 0?void 0:t.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();let o;if(a){let t=Array.from(this.host.querySelectorAll(`input[name="${e.target.name}"]:checked`),(e=>e===null||e===void 0?void 0:e.value));o=t.includes(n.toString())}else if(i){o=e.target.checked&&e.target.value===n}else{o=n===e.target.value}salla.log("The input is ",a?"Multiple":i?"Radio":"Single"," value:",o);let l=s&&o||!s&&!o;if(l){t.classList.remove("hidden");t.querySelectorAll("[name]").forEach((e=>{e.removeAttribute("disabled");const t=e.closest(".s-product-options-option");if(t.dataset.optionRequired==="true"){e.setAttribute("required","")}if(e.getAttribute("type")==="checkbox"){const t=Array.from(document.querySelectorAll(`input[type="checkbox"][name="${e.getAttribute("name")}"]`));const s=t.some((e=>e.checked));if(s){t.forEach((e=>{e.removeAttribute("required")}))}}}))}else{this.hideAllOptions(t.dataset.optionId);t.classList.add("hidden");this.disableInputs(t)}}))}componentDidRender(){this.host.querySelectorAll(`[data-show-when]`).forEach((e=>{var t;let s=(t=e===null||e===void 0?void 0:e.dataset)===null||t===void 0?void 0:t.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();if(!s){return}this.changeHandler({target:this.host.querySelector('[name^="'+s+'"]')})}))}render(){return s(a,{key:"f2c9836cd5e5667efd13ade5d4e064551c89d569"},s("slot",{key:"980eef852261b13f477a2c2ad140e7c3e96e737f"}))}get host(){return i(this)}};export{c as salla_booking_field,d as salla_conditional_fields};
|
|
5
|
+
//# sourceMappingURL=p-d62c3afd.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(e,r,t,s){function n(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,a){function i(e){try{l(s.next(e))}catch(e){a(e)}}function o(e){try{l(s["throw"](e))}catch(e){a(e)}}function l(e){e.done?t(e.value):n(e.value).then(i,o)}l((s=s.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},s,n,a,i;return i={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function o(e){return function(r){return l([e,r])}}function l(o){if(s)throw new TypeError("Generator is already executing.");while(i&&(i=0,o[0]&&(t=0)),t)try{if(s=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:t.label++;return{value:o[1],done:false};case 5:t.label++;n=o[1];o=[0];continue;case 7:o=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){t.label=o[1];break}if(o[0]===6&&t.label<a[1]){t.label=a[1];a=o;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(o);break}if(a[2])t.ops.pop();t.trys.pop();continue}o=r.call(e,t)}catch(e){o=[6,e];n=0}finally{s=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-CfN45V5l.system.js"],(function(e){"use strict";var r,t,s;return{setters:[function(e){r=e.r;t=e.h;s=e.g}],execute:function(){var n;(function(e){e["ProductDetail"]="product.single";e["Cart"]="cart"})(n||(n={}));var a;(function(e){e["Conditional"]="conditional";e["PercentageOrFixed"]="fixed";e["DiscountsTable"]="discounts_table";e["Bank"]="bank";e["BuyXGetY"]="buy_x_get_y";e["SpecialPrice"]="special_price"})(a||(a={}));var 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}';var o=e("salla_offer",function(){function e(e){var t=this;r(this,e);var s;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=function(e){return salla.lang.get("pages.offer.buy_quantity",{quantity:e})};salla.lang.onLoaded((function(){t.offer_with_price_text=salla.lang.get("pages.offer.with_price");t.with_discount_text=salla.lang.get("pages.products.with_a_discount");t.product_discount_text=salla.lang.get("pages.products.discount");t.special_offer_text=salla.lang.get("pages.products.special_offer");t.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");t.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");t.buy_quantity_text(0)}));salla.onReady((function(){t.currentPage=salla.config.get("page.slug");t.userCurrency=salla.config.get("currencies")[salla.config.get("user.currency_code")].symbol}));this.categorySlot=((s=this.host.querySelector('[slot="category"]'))===null||s===void 0?void 0:s.innerHTML)||'<a href={url} class="s-offer-slide-cat-entry"><i class={icon}></i><h4>{name}</h4></a>'}e.prototype.getEndpointByPageName=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:if(!(this.currentPage==n.Cart))return[3,2];return[4,Salla.cart.getCurrentCartId()];case 1:e=r.sent();return[2,"offers/cart/".concat(e)];case 2:if(this.currentPage==n.ProductDetail){return[2,"offers/product/".concat(salla.config.get("page.id"))]}return[2,"offers"]}}))}))};e.prototype.componentWillLoad=function(){var e=this;this.hasCustomComponent=!!customElements.get(this.productCardComponent);return new Promise((function(e){return salla.onReady(e)})).then((function(){e.showOffer=!salla.url.is_page("product.single")||salla.config.get("store.settings.product.show_special_offers");if(e.showOffer){return}throw new Error("Merchant disabled showing the offers on product page")})).then((function(){return __awaiter(e,void 0,void 0,(function(){var e,r;return __generator(this,(function(t){switch(t.label){case 0:r=(e=salla.api).request;return[4,this.getEndpointByPageName()];case 1:return[2,r.apply(e,[t.sent()])]}}))}))})).then((function(r){if(!(e.offersList=r.data).length){throw new Error("salla-offers:: There is no offers!")}var t=e.offersList.find((function(e){return[a.SpecialPrice,a.Bank,a.BuyXGetY,a.DiscountsTable].includes(e.type)}));if(!t){throw new Error("salla-offers:: Offer type not supported yet!")}if(t.type===a.DiscountsTable){return e.offersList=[t]}if(e.isBankOffer=t.type===a.Bank){e.offersList=e.offersList.filter((function(e){return e.type===a.Bank}));e.isMultipleBank=e.offersList.length>1;return e.offersList}if(t.type===a.SpecialPrice){var s=t.details;return s.apply_to==="product"?salla.product.api.fetch({source:"selected",source_value:s.targets}).then((function(r){t.details.products=r.data;return e.offersList=[t]})):salla.product.api.categories().then((function(r){var n=e.findCategories(r.data,s.targets);t.details.categories=n;return e.offersList=[t]}))}var n=t.details.get;return n.source==="products"?salla.product.api.fetch({source:"selected",source_value:n.source_value}).then((function(r){n.products=r.data;t.details.get=n;return e.offersList=[t]})):salla.product.api.categories().then((function(r){n.categories=e.findCategories(r.data,n.source_value);t.details.get=n;return e.offersList=[t]}))})).then((function(r){salla.storage.set(e.getStorageKey(),{offers:r,stored_at:(new Date).getTime()});e.canRender=true})).catch((function(e){salla.logger.warn(e)}))};e.prototype.componentDidLoad=function(){var e=this.host.querySelector(".s-slider-block__title-nav");e===null||e===void 0?void 0:e.classList.add("s-offer-bank-payment-nav")};e.prototype.findCategories=function(e,r){var t;var s=[];for(var n=0,a=e;n<a.length;n++){var i=a[n];if(r.includes(i.id_||i.id)){s.push(i)}if(((t=i.sub_categories)===null||t===void 0?void 0:t.length)>0){s=s.concat(this.findCategories(i.sub_categories,r))}}return s};e.prototype.getStorageKey=function(){try{var e=salla.config.get("page.slug").replace(".","_");var r=salla.lang.getLocale();var t=salla.config.currency().code;if(!e||!r||!t){throw new Error("Unable to get the storage key.")}return"s-offers-".concat(e,"-").concat(salla.config.get("page.id"),"-").concat(r,"-").concat(t)}catch(e){return""}};e.prototype.getOffersFromStorage=function(){var e=salla.storage.get(this.getStorageKey());if(!e||e.stored_at<(new Date).getTime()-10*60*1e3){salla.storage.remove(this.getStorageKey());return null}this.canRender=true;return Promise.resolve(e.offers)};e.prototype.render=function(){if(!this.offersList.length||!this.canRender||!this.showOffer)return null;var e=this.offersList[0];var r=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleText:null:e.title;var s=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleDescription:null:e.description;var n={"block-title":r,"block-subTitle":s,"show-controls":this.isMultipleBank};return t("div",{class:"s-offer-wrapper"},t("p",{class:"s-offer-corner-badge"},this.special_offer_text),t("salla-slider",Object.assign({type:"carousel",id:"offer-slider"},n),t("div",{slot:"items"},this.renderSectionForOfferType(e.type))))};e.prototype.renderSectionForOfferType=function(e){if(this.isBankOffer){return this.renderBankSection()}if(e==a.SpecialPrice){return this.renderSpecialPriceSection()}if(e==a.BuyXGetY){return this.renderBuyXGetYSection()}return this.renderDiscountTableSection()};e.prototype.getCategoriesSection=function(e){return t("div",{class:"s-offer-slide-one-sixth swiper-slide",innerHTML:this.categorySlot.replace(/\{url\}/g,e.url).replace(/\{icon\}/g,e.icon||"sicon-store").replace(/\{name\}/g,e.name)})};e.prototype.renderBuyXGetYSection=function(){var e=this;var r,s;var n=this.offersList[0].details;return[(r=n.get.products)===null||r===void 0?void 0:r.map((function(r){return t("div",{class:"s-offer-slide-one-fourth"},e.hasCustomComponent?t(e.productCardComponent,{product:r}):t("salla-product-card",{"shadow-on-hover":true,product:r}))})),(s=n.get.categories)===null||s===void 0?void 0:s.map((function(r){return e.getCategoriesSection(r)}))]};e.prototype.renderBankSection=function(){var e=this;return this.offersList.map((function(r){return t("div",{class:{"s-offer-slide-one-sixth":e.isMultipleBank,"s-offer-bank-wrapper-sinlge-item":!e.isMultipleBank}},t("div",{class:{"s-offer-bank-wrapper":true,"s-offer-slide-one-sixth":!e.isMultipleBank,"s-offer-bank-wrapper-multi-spacer":e.isMultipleBank}},t("div",{class:"s-offer-bank-logo"},t("img",{src:r.details.logo||salla.url.cdn("images/s-empty.png"),"data-src":r.details.logo,alt:r.title+" offer"})),t("ul",{class:"s-offer-bank-payment-wrapper"},r.details.payments.map((function(e){return t("li",{class:"s-offer-bank-payment-single"},t("img",{src:salla.url.cdn("images/payment/"+e+".png")||salla.url.cdn("images/s-empty.png"),"data-src":salla.url.cdn("images/payment/"+e+".png"),alt:"payment"}))}))),e.isMultipleBank?t("p",{class:"s-offer-bank-payment-discount-percent"},"".concat(e.product_discount_text," ").concat(r.details.discount_value).concat(r.details.discount_type==="percentage"&&"%")):""),!e.isMultipleBank?t("div",{class:"s-offer-bank-message s-offer-slide-one-fourth"},t("h2",null,e.offersList[0].title),t("p",{innerHTML:e.generateBankDescription(e.offersList[0].description,r.details.discount_value)})):"")}))};e.prototype.generateBankDescription=function(e,r){return e.replace(new RegExp("".concat(r," %")),'<span class="s-offer-bank-message-amount">'.concat(r," %</span>"))};e.prototype.renderDiscountTableSection=function(){var e=this;var r;var s=this.offersList[0];var n=s.details.show_price_after_discount;return(r=this.offersList[0].details.discounts)===null||r===void 0?void 0:r.map((function(r){return t("div",{class:"s-offer-slide-one-fourth"},t("div",{class:"s-offer-slide-offer-entry"},t("div",{class:"s-offer-slide-offer-entry-price-quantity-container"},t("p",{class:"s-offer-slide-offer-entry-quantity"},e.buy_quantity_text(r.quantity)),n?t("div",{class:"s-offer-slide-offer-entry-price"},t("span",null,e.offer_with_price_text),t("span",{class:"s-offer-slide-offer-entry-price-amount"},r.discounted_amount)," ",t("span",null,e.userCurrency)):""),t("p",{class:"s-offer-slide-offer-entry-price-amount-percent"},e.with_discount_text,"(",t("span",null,r.percentage,!!r.percentage&&"%"),")")))}))};e.prototype.renderSpecialPriceSection=function(){var e=this;var r,s;var n=this.offersList[0].details;return[n.apply_to==="product"&&((r=n.products)===null||r===void 0?void 0:r.map((function(r){return t("div",{class:"s-offer-slide-one-fourth"},e.hasCustomComponent?t(e.productCardComponent,{product:r}):t("salla-product-card",{"shadow-on-hover":true,product:r}))}))),n.apply_to==="category"&&((s=n.categories)===null||s===void 0?void 0:s.map((function(r){return e.getCategoriesSection(r)})))]};Object.defineProperty(e.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());o.style=i}}}));
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-yvGCQVwO.system.js"],(function(e){"use strict";var r,t,s;return{setters:[function(e){r=e.r;t=e.h;s=e.g}],execute:function(){var n;(function(e){e["ProductDetail"]="product.single";e["Cart"]="cart"})(n||(n={}));var a;(function(e){e["Conditional"]="conditional";e["PercentageOrFixed"]="fixed";e["DiscountsTable"]="discounts_table";e["Bank"]="bank";e["BuyXGetY"]="buy_x_get_y";e["SpecialPrice"]="special_price"})(a||(a={}));var 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}';var o=e("salla_offer",function(){function e(e){var t=this;r(this,e);var s;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=function(e){return salla.lang.get("pages.offer.buy_quantity",{quantity:e})};salla.lang.onLoaded((function(){t.offer_with_price_text=salla.lang.get("pages.offer.with_price");t.with_discount_text=salla.lang.get("pages.products.with_a_discount");t.product_discount_text=salla.lang.get("pages.products.discount");t.special_offer_text=salla.lang.get("pages.products.special_offer");t.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");t.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");t.buy_quantity_text(0)}));salla.onReady((function(){t.currentPage=salla.config.get("page.slug");t.userCurrency=salla.config.get("currencies")[salla.config.get("user.currency_code")].symbol}));this.categorySlot=((s=this.host.querySelector('[slot="category"]'))===null||s===void 0?void 0:s.innerHTML)||'<a href={url} class="s-offer-slide-cat-entry"><i class={icon}></i><h4>{name}</h4></a>'}e.prototype.getEndpointByPageName=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:if(!(this.currentPage==n.Cart))return[3,2];return[4,Salla.cart.getCurrentCartId()];case 1:e=r.sent();return[2,"offers/cart/".concat(e)];case 2:if(this.currentPage==n.ProductDetail){return[2,"offers/product/".concat(salla.config.get("page.id"))]}return[2,"offers"]}}))}))};e.prototype.componentWillLoad=function(){var e=this;this.hasCustomComponent=!!customElements.get(this.productCardComponent);return new Promise((function(e){return salla.onReady(e)})).then((function(){e.showOffer=!salla.url.is_page("product.single")||salla.config.get("store.settings.product.show_special_offers");if(e.showOffer){return}throw new Error("Merchant disabled showing the offers on product page")})).then((function(){return __awaiter(e,void 0,void 0,(function(){var e,r;return __generator(this,(function(t){switch(t.label){case 0:r=(e=salla.api).request;return[4,this.getEndpointByPageName()];case 1:return[2,r.apply(e,[t.sent()])]}}))}))})).then((function(r){if(!(e.offersList=r.data).length){throw new Error("salla-offers:: There is no offers!")}var t=e.offersList.find((function(e){return[a.SpecialPrice,a.Bank,a.BuyXGetY,a.DiscountsTable].includes(e.type)}));if(!t){throw new Error("salla-offers:: Offer type not supported yet!")}if(t.type===a.DiscountsTable){return e.offersList=[t]}if(e.isBankOffer=t.type===a.Bank){e.offersList=e.offersList.filter((function(e){return e.type===a.Bank}));e.isMultipleBank=e.offersList.length>1;return e.offersList}if(t.type===a.SpecialPrice){var s=t.details;return s.apply_to==="product"?salla.product.api.fetch({source:"selected",source_value:s.targets}).then((function(r){t.details.products=r.data;return e.offersList=[t]})):salla.product.api.categories().then((function(r){var n=e.findCategories(r.data,s.targets);t.details.categories=n;return e.offersList=[t]}))}var n=t.details.get;return n.source==="products"?salla.product.api.fetch({source:"selected",source_value:n.source_value}).then((function(r){n.products=r.data;t.details.get=n;return e.offersList=[t]})):salla.product.api.categories().then((function(r){n.categories=e.findCategories(r.data,n.source_value);t.details.get=n;return e.offersList=[t]}))})).then((function(r){salla.storage.set(e.getStorageKey(),{offers:r,stored_at:(new Date).getTime()});e.canRender=true})).catch((function(e){salla.logger.warn(e)}))};e.prototype.componentDidLoad=function(){var e=this.host.querySelector(".s-slider-block__title-nav");e===null||e===void 0?void 0:e.classList.add("s-offer-bank-payment-nav")};e.prototype.findCategories=function(e,r){var t;var s=[];for(var n=0,a=e;n<a.length;n++){var i=a[n];if(r.includes(i.id_||i.id)){s.push(i)}if(((t=i.sub_categories)===null||t===void 0?void 0:t.length)>0){s=s.concat(this.findCategories(i.sub_categories,r))}}return s};e.prototype.getStorageKey=function(){try{var e=salla.config.get("page.slug").replace(".","_");var r=salla.lang.getLocale();var t=salla.config.currency().code;if(!e||!r||!t){throw new Error("Unable to get the storage key.")}return"s-offers-".concat(e,"-").concat(salla.config.get("page.id"),"-").concat(r,"-").concat(t)}catch(e){return""}};e.prototype.getOffersFromStorage=function(){var e=salla.storage.get(this.getStorageKey());if(!e||e.stored_at<(new Date).getTime()-10*60*1e3){salla.storage.remove(this.getStorageKey());return null}this.canRender=true;return Promise.resolve(e.offers)};e.prototype.render=function(){if(!this.offersList.length||!this.canRender||!this.showOffer)return null;var e=this.offersList[0];var r=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleText:null:e.title;var s=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleDescription:null:e.description;var n={"block-title":r,"block-subTitle":s,"show-controls":this.isMultipleBank};return t("div",{class:"s-offer-wrapper"},t("p",{class:"s-offer-corner-badge"},this.special_offer_text),t("salla-slider",Object.assign({type:"carousel",id:"offer-slider"},n),t("div",{slot:"items"},this.renderSectionForOfferType(e.type))))};e.prototype.renderSectionForOfferType=function(e){if(this.isBankOffer){return this.renderBankSection()}if(e==a.SpecialPrice){return this.renderSpecialPriceSection()}if(e==a.BuyXGetY){return this.renderBuyXGetYSection()}return this.renderDiscountTableSection()};e.prototype.getCategoriesSection=function(e){return t("div",{class:"s-offer-slide-one-sixth swiper-slide",innerHTML:this.categorySlot.replace(/\{url\}/g,e.url).replace(/\{icon\}/g,e.icon||"sicon-store").replace(/\{name\}/g,e.name)})};e.prototype.renderBuyXGetYSection=function(){var e=this;var r,s;var n=this.offersList[0].details;return[(r=n.get.products)===null||r===void 0?void 0:r.map((function(r){return t("div",{class:"s-offer-slide-one-fourth"},e.hasCustomComponent?t(e.productCardComponent,{product:r}):t("salla-product-card",{"shadow-on-hover":true,product:r}))})),(s=n.get.categories)===null||s===void 0?void 0:s.map((function(r){return e.getCategoriesSection(r)}))]};e.prototype.renderBankSection=function(){var e=this;return this.offersList.map((function(r){return t("div",{class:{"s-offer-slide-one-sixth":e.isMultipleBank,"s-offer-bank-wrapper-sinlge-item":!e.isMultipleBank}},t("div",{class:{"s-offer-bank-wrapper":true,"s-offer-slide-one-sixth":!e.isMultipleBank,"s-offer-bank-wrapper-multi-spacer":e.isMultipleBank}},t("div",{class:"s-offer-bank-logo"},t("img",{src:r.details.logo||salla.url.cdn("images/s-empty.png"),"data-src":r.details.logo,alt:r.title+" offer"})),t("ul",{class:"s-offer-bank-payment-wrapper"},r.details.payments.map((function(e){return t("li",{class:"s-offer-bank-payment-single"},t("img",{src:salla.url.cdn("images/payment/"+e+".png")||salla.url.cdn("images/s-empty.png"),"data-src":salla.url.cdn("images/payment/"+e+".png"),alt:"payment"}))}))),e.isMultipleBank?t("p",{class:"s-offer-bank-payment-discount-percent"},"".concat(e.product_discount_text," ").concat(r.details.discount_value).concat(r.details.discount_type==="percentage"&&"%")):""),!e.isMultipleBank?t("div",{class:"s-offer-bank-message s-offer-slide-one-fourth"},t("h2",null,e.offersList[0].title),t("p",{innerHTML:e.generateBankDescription(e.offersList[0].description,r.details.discount_value)})):"")}))};e.prototype.generateBankDescription=function(e,r){return e.replace(new RegExp("".concat(r," %")),'<span class="s-offer-bank-message-amount">'.concat(r," %</span>"))};e.prototype.renderDiscountTableSection=function(){var e=this;var r;var s=this.offersList[0];var n=s.details.show_price_after_discount;return(r=this.offersList[0].details.discounts)===null||r===void 0?void 0:r.map((function(r){return t("div",{class:"s-offer-slide-one-fourth"},t("div",{class:"s-offer-slide-offer-entry"},t("div",{class:"s-offer-slide-offer-entry-price-quantity-container"},t("p",{class:"s-offer-slide-offer-entry-quantity"},e.buy_quantity_text(r.quantity)),n?t("div",{class:"s-offer-slide-offer-entry-price"},t("span",null,e.offer_with_price_text),t("span",{class:"s-offer-slide-offer-entry-price-amount"},r.discounted_amount)," ",t("span",null,e.userCurrency)):""),t("p",{class:"s-offer-slide-offer-entry-price-amount-percent"},e.with_discount_text,"(",t("span",null,r.percentage,!!r.percentage&&"%"),")")))}))};e.prototype.renderSpecialPriceSection=function(){var e=this;var r,s;var n=this.offersList[0].details;return[n.apply_to==="product"&&((r=n.products)===null||r===void 0?void 0:r.map((function(r){return t("div",{class:"s-offer-slide-one-fourth"},e.hasCustomComponent?t(e.productCardComponent,{product:r}):t("salla-product-card",{"shadow-on-hover":true,product:r}))}))),n.apply_to==="category"&&((s=n.categories)===null||s===void 0?void 0:s.map((function(r){return e.getCategoriesSection(r)})))]};Object.defineProperty(e.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());o.style=i}}}));
|
|
5
|
+
//# sourceMappingURL=p-d774769c.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as l,h as a,H as t}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as l,h as a,H as t}from"./p-BsC_KPRw.js";import{G as s}from"./p-C0JNGIpa.js";const o="";const e=l=>{if(!l)return"";return new Date(Number(l)).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"})};const r=l=>{if(!l)return"";try{const a=l.toLowerCase();const t=salla.lang.get(`pages.loyalty_program.${a}`);return t===`pages.loyalty_program.${a}`?l:t}catch(a){return l}};const i=class{constructor(a){l(this,a);this.loyaltyPointsArray=[];this.isLoadingLoyalty=false;this.nextPageUrlLoyalty="";this.handleClick=()=>{this.loadMoreLoyaltyPoints()}}componentWillLoad(){return salla.onReady().then((()=>{this.loadLoyaltyPoints()}))}async loadLoyaltyPoints(){this.isLoadingLoyalty=true;try{let l=`/balance/points?page=1`;let a=await salla.api.request(l);this.loyaltyPointsArray=a.data;this.nextPageUrlLoyalty=a.cursor.next}catch(l){console.error("Error loading loyalty points transactions",l)}finally{this.isLoadingLoyalty=false}}async loadMoreLoyaltyPoints(){var l;if(!this.nextPageUrlLoyalty)return;this.isLoadingLoyalty=true;try{let a=await salla.api.request(this.nextPageUrlLoyalty);this.loyaltyPointsArray=[...this.loyaltyPointsArray,...a.data];this.nextPageUrlLoyalty=((l=a.cursor)===null||l===void 0?void 0:l.next)||""}catch(l){console.error("Error loading more loyalty points",l)}finally{this.isLoadingLoyalty=false}}render(){return a(t,{key:"c62612b3bcbd5938b7a7e1609c0318a11c7ad6ee"},a("div",{key:"8be48cf7e0f183e7d66a94f2ce4c8aad838e8a45"},this.isLoadingLoyalty?a("salla-loading",null):a("div",null,this.loyaltyPointsArray.length>0?a("div",null,a("table",{class:"s-loyalty-program-table"},a("thead",{class:"s-loyalty-program-table-head"},a("tr",{class:"s-loyalty-program-table-head-tr"},a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.points")),a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.date")),a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.expiry_date")),a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("common.elements.note")),a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("common.elements.status")))),a("tbody",{class:"s-loyalty-program-table-tbody"},this.loyaltyPointsArray.map((l=>a("tr",{class:"s-loyalty-program-table-tbody-tr"},a("td",{class:"s-loyalty-program-table-tbody-tr-td"},(l===null||l===void 0?void 0:l.type)==="plus"?"+":"",(l===null||l===void 0?void 0:l.points)||""," ",salla.lang.get("pages.loyalty_program.point")),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},e((l===null||l===void 0?void 0:l.created_at)?Number(l.created_at)*1e3:undefined)),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},e(l===null||l===void 0?void 0:l.points_expire_date)),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},r(l===null||l===void 0?void 0:l.key)),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},r(l===null||l===void 0?void 0:l.status_key))))))),a("div",{class:"s-infinite-scroll-wrapper"},!!this.nextPageUrlLoyalty&&a("salla-button",{onClick:this.handleClick,loading:this.isLoadingLoyalty},salla.lang.get("common.elements.load_more")))):a("div",null,a("div",{class:"s-loyalty-program-table-empty-state"},a("span",{innerHTML:s}),a("div",{class:"s-loyalty-program-table-placeholder-title"},salla.lang.get("pages.loyalty_program.no_loyality_points_title")),a("div",{class:"s-loyalty-program-table-placeholder-sub-title"},salla.lang.get("pages.loyalty_program.no_loyality_points_sub_title")))))))}};i.style=o;export{i as salla_loyalty_program};
|
|
5
|
+
//# sourceMappingURL=p-d7cf0bca.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
System.register(["./p-yvGCQVwO.system.js"],(function(t){"use strict";var e,i,s,a;return{setters:[function(t){e=t.r;i=t.c;s=t.h;a=t.H}],execute:function(){var c="salla-loyalty-prize-item:hover{-webkit-box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important;box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important}";var l=t("salla_loyalty_prize_item",function(){function t(t){e(this,t);this.prizeItemSelected=i(this,"prizeItemSelected")}t.prototype.onPrizeItemClick=function(){this.prizeItemSelected.emit(this.item)};t.prototype.render=function(){return s(a,{key:"5434064e3e54117f4df4e16282f70e81503d7489"},s("div",{key:"28b5a19dcd1f239a74d69e91a1cda66ae7521e8e",onClick:this.onPrizeItemClick.bind(this)},s("img",{key:"82917e0074006f4e462b2328405714a31d168c17",class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),s("div",{key:"089ac134ed2a0474067c79cd590154ca85a380c9",class:"s-loyalty-prize-item-title"},this.item.name),s("div",{key:"85d245c32c42701274fa29761c4345020532eac1",class:"s-loyalty-prize-item-subtitle"},this.item.description),s("div",{key:"5f37781c8c77998a0bb586ddcda4640741db0b6e",class:"s-loyalty-prize-item-points"},this.item.cost_points," Points")))};return t}());l.style=c}}}));
|
|
5
|
+
//# sourceMappingURL=p-d9047f21.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,e,i,n){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,s){function a(t){try{l(n.next(t))}catch(t){s(t)}}function c(t){try{l(n["throw"](t))}catch(t){s(t)}}function l(t){t.done?i(t.value):r(t.value).then(a,c)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,r,s,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(t){return function(e){return l([t,e])}}function l(c){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,c[0]&&(i=0)),i)try{if(n=1,r&&(s=c[0]&2?r["return"]:c[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;if(r=0,s)c=[c[0]&2,s.value];switch(c[0]){case 0:case 1:s=c;break;case 4:i.label++;return{value:c[1],done:false};case 5:i.label++;r=c[1];c=[0];continue;case 7:c=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){i.label=c[1];break}if(c[0]===6&&i.label<s[1]){i.label=s[1];s=c;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(c);break}if(s[2])i.ops.pop();i.trys.pop();continue}c=e.call(t,i)}catch(t){c=[6,t];r=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-yvGCQVwO.system.js","./p-D5o2VQTp.system.js"],(function(t){"use strict";var e,i,n,r,s;return{setters:[function(t){e=t.r;i=t.c;n=t.h;r=t.H},function(t){s=t.a}],execute:function(){var a='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>arrow-right</title>\n<path d="M29.217 15.465c-0.019-0.044-0.056-0.077-0.080-0.119-0.067-0.116-0.139-0.227-0.236-0.317-0.011-0.009-0.013-0.024-0.024-0.033l-10.667-9.333c-0.553-0.484-1.396-0.429-1.881 0.125-0.484 0.555-0.428 1.396 0.127 1.881l7.996 6.997h-20.452c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h20.452l-7.996 6.997c-0.555 0.485-0.611 1.327-0.127 1.881 0.264 0.3 0.633 0.455 1.004 0.455 0.312 0 0.625-0.109 0.877-0.331l10.667-9.333c0.011-0.009 0.015-0.024 0.024-0.033 0.097-0.091 0.169-0.201 0.236-0.317 0.024-0.041 0.060-0.075 0.080-0.119 0.073-0.163 0.116-0.343 0.116-0.533s-0.043-0.371-0.116-0.535z"></path>\n</svg>\n';var c=":host{display:block}.rtl .rtl-range-slider,[dir=rtl] .rtl-range-slider{-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}.rtl .rtl-range-numbers,[dir=rtl] .rtl-range-numbers{-ms-flex-direction:row-reverse;flex-direction:row-reverse}.rtl .form-select,.rtl select,[dir=rtl] .form-select,[dir=rtl] select{background-position:left 0.5rem center;padding-right:12px}.rtl .menu-divide li:not(:last-child):after,[dir=rtl] .menu-divide li:not(:last-child):after{left:0;right:auto}input[type=range]::-webkit-slider-thumb{pointer-events:all;width:24px;height:24px;-webkit-appearance:none}[type=checkbox]:checked{background-size:80%}";var l=t("salla_price_range",function(){function t(t){e(this,t);this.changed=i(this,"changed");this.min=0;this.max=1e4;this.moreThanLabel="أكثر من";this.lessThanLabel="أقل من";this.toLabel="الى";this.fromLabel="من";this.typing=false;this.isMin=false;this.isRTL=salla.config.get("theme.is_rtl",true);this.filterValues=[]}t.prototype.connectedCallback=function(){var t=this;var e;if(this.filtersData&&((e=this.filtersData)===null||e===void 0?void 0:e.price)){this.minPrice=this.filtersData.price.min;this.maxPrice=this.filtersData.price.max}salla.lang.onLoaded((function(){t.moreThanLabel=salla.lang.getWithDefault("common.elements.more_than",t.moreThanLabel);t.lessThanLabel=salla.lang.getWithDefault("common.elements.less_than",t.lessThanLabel);t.toLabel=salla.lang.getWithDefault("common.elements.to",t.toLabel);t.fromLabel=salla.lang.getWithDefault("common.elements.from",t.fromLabel)}));if(this.option.values.length==1){return}if(this.option.values.length<=5){this.filterValues=this.option.values;return}var i=Math.ceil(this.option.values.length/5);for(var n=0;n<this.option.values.length;n+=i){this.filterValues.push(this.option.values.slice(n,n+i).reduce((function(t,e){t.to=e.to;t.count+=e.count;return t})))}};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.minInput.value=null;this.maxInput.value=null;this.minPrice=null;this.maxPrice=null;return[2]}))}))};t.prototype.getPriceLabel=function(t){if(isNaN(t.from)||t.from<1){return"".concat(this.lessThanLabel," ").concat(salla.money(t.to))}if(isNaN(t.to)||t.to<1){return"".concat(this.moreThanLabel," ").concat(salla.money(t.from))}return"".concat(salla.money(t.from)," ").concat(this.toLabel," ").concat(salla.money(t.to))};t.prototype.minInputValidation=function(t){if(t&&(t>this.max||this.maxPrice&&t>this.maxPrice)){return}if(t<this.min){this.minPrice=this.min;return}if(t){this.minPrice=t}};t.prototype.maxInputValidation=function(t){if(t&&(t<this.min||this.minPrice&&t<this.minPrice)){return}if(t>this.max){this.maxPrice=this.max;return}};t.prototype.changedEventHandler=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(n){salla.helpers.inputDigitsOnly(this.minInput);salla.helpers.inputDigitsOnly(this.maxInput);e=this.minPrice?+this.minPrice*1:null;i=this.maxPrice?+this.maxPrice*1:null;if(!this.maxPrice){this.maxPrice=""}if(this.isMin){this.minInputValidation(e)}else{if(!this.minPrice){this.minPrice=0}this.maxInputValidation(i)}this.isReady&&this.changed.emit({event:t,option:this.option,value:{max:this.maxPrice,min:this.minPrice}});return[2]}))}))};t.prototype.handleMinMaxPrice=function(t,e){this.minPrice=e.from;this.maxPrice=e.to!=="*"?e.to:"";this.changedEventHandler(t)};t.prototype.isChecked=function(t){if(!this.minPrice&&!this.maxPrice){return false}var e=(t.from<1||t.from=="*")&&this.minPrice==0||t.from==this.minPrice;var i=t.to=="*"||!t.to||t.to==this.maxPrice;return e&&i};t.prototype.handleMinPrice=function(t){this.isMin=true;var e=t.target.value;this.minPrice=e===""?0:e};t.prototype.handleMaxPrice=function(t){this.isMin=false;var e=t.target.value;this.maxPrice=e===undefined?"":e};t.prototype.render=function(){var t=this;return n(r,{key:"3dbf536c873ce1dfa5a340d38d827a42dc9eefd6"},this.filterValues.map((function(e,i){return n("label",{class:"s-filters-label",htmlFor:"".concat(t.option.key,"-").concat(i),key:i},n("input",{id:"".concat(t.option.key,"-").concat(i),name:"price",type:"radio",checked:t.isChecked(e),class:"s-filters-radio",onChange:function(i){return t.handleMinMaxPrice(i,e)}}),n("span",{innerHTML:t.getPriceLabel(e)}))})),n("div",{key:"ba4b1e2b012f2a592a3e3fccec8af85d553e135e",class:"flex justify-center items-center"},n("div",{key:"7aa16587da39ca5ef69df278825979b9b0d7c431",class:"relative max-w-xl w-full"},n("div",{key:"9987a6c8648161cc4ffbffb5c36a74a9e4951c5a",class:"s-price-range-inputs"},n("div",{key:"5522e10855b7d343d7099775ed2d1d6adfd0993f",class:"s-price-range-relative"},n("div",{key:"cc9ecb09469f4a0244bea50e39d970817a324a82",class:"s-price-range-currency"}," ",salla.config.currency().symbol),n("input",{key:"d418bc1843338577fae373af8d9d6015f5f027fb",type:"number",maxlength:"5",ref:function(e){return t.minInput=e},onBlur:function(e){return t.handleMinPrice(e)},value:this.minPrice,placeholder:this.fromLabel,class:"s-price-range-number-input"})),n("div",{key:"73bda499ac270dd938ef0c66f732a68925f8a844",class:"s-price-range-gray-text"}," -"),n("div",{key:"ffd58f181e8274a88d4d9523f7d37fab00c69c06",class:"s-price-range-relative"},n("div",{key:"6ede40d74c8b94f232ec14fecab8ab36185a60db",class:"s-price-range-currency"}," ",salla.config.currency().symbol),n("input",{key:"5922793287d2b9c2b7909ce71960408dcc1553f4",type:"number",maxlength:"5",ref:function(e){return t.maxInput=e},onBlur:function(e){return t.handleMaxPrice(e)},value:this.maxPrice,placeholder:this.toLabel,class:"s-price-range-number-input","aria-describedby":"price-currency"})),n("salla-button",{key:"eaa18ffa9c09f4e34e3fd404735cb251e5ca9acc",color:"gray",shape:"icon",size:"small",fill:"outline",onClick:function(e){return t.changedEventHandler(e)}},n("span",{key:"904ca86a02c9a59f48cf69e9ff2d1a8abc25b0f6",innerHTML:this.isRTL?s:a}))))))};t.prototype.componentDidLoad=function(){this.isReady=true};return t}());l.style=c}}}));
|
|
5
|
+
//# sourceMappingURL=p-da8982d5.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as e,g as t}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as s,h as e,g as t}from"./p-BsC_KPRw.js";var r;(function(s){s["ProductDetail"]="product.single";s["Cart"]="cart"})(r||(r={}));var i;(function(s){s["Conditional"]="conditional";s["PercentageOrFixed"]="fixed";s["DiscountsTable"]="discounts_table";s["Bank"]="bank";s["BuyXGetY"]="buy_x_get_y";s["SpecialPrice"]="special_price"})(i||(i={}));const a='.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>'}async getEndpointByPageName(){if(this.currentPage==r.Cart){const s=await Salla.cart.getCurrentCartId();return`offers/cart/${s}`}if(this.currentPage==r.ProductDetail){return`offers/product/${salla.config.get("page.id")}`}return"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((async()=>salla.api.request(await 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=>[i.SpecialPrice,i.Bank,i.BuyXGetY,i.DiscountsTable].includes(s.type)));if(!e){throw new Error("salla-offers:: Offer type not supported yet!")}if(e.type===i.DiscountsTable){return this.offersList=[e]}if(this.isBankOffer=e.type===i.Bank){this.offersList=this.offersList.filter((s=>s.type===i.Bank));this.isMultipleBank=this.offersList.length>1;return this.offersList}if(e.type===i.SpecialPrice){const s=e.details;return s.apply_to==="product"?salla.product.api.fetch({source:"selected",source_value:s.targets}).then((s=>{e.details.products=s.data;return this.offersList=[e]})):salla.product.api.categories().then((t=>{const r=this.findCategories(t.data,s.targets);e.details.categories=r;return this.offersList=[e]}))}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 i of s){if(e.includes(i.id_||i.id)){r.push(i)}if(((t=i.sub_categories)===null||t===void 0?void 0:t.length)>0){r=r.concat(this.findCategories(i.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 i={"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"},i),e("div",{slot:"items"},this.renderSectionForOfferType(s.type))))}renderSectionForOfferType(s){if(this.isBankOffer){return this.renderBankSection()}if(s==i.SpecialPrice){return this.renderSpecialPriceSection()}if(s==i.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&&"%"),")")))))}renderSpecialPriceSection(){var s,t;const r=this.offersList[0].details;return[r.apply_to==="product"&&((s=r.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}))))),r.apply_to==="category"&&((t=r.categories)===null||t===void 0?void 0:t.map((s=>this.getCategoriesSection(s))))]}get host(){return t(this)}};l.style=a;export{l as salla_offer};
|
|
5
|
+
//# sourceMappingURL=p-e0ef58d4.entry.js.map
|