@salla.sa/twilight-components 2.14.219 → 2.14.221
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-DwcsRV1q.js → app-globals-CURclN4K.js} +3 -3
- package/dist/cjs/{app-globals-DwcsRV1q.js.map → app-globals-CURclN4K.js.map} +1 -1
- package/dist/cjs/{index-CcKYmcmm.js → index-1TYwVkJb.js} +8 -4
- package/dist/cjs/index-1TYwVkJb.js.map +1 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/salla-accordion-body.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion-head.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_51.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-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-tiered-offer.cjs.entry.js +338 -0
- package/dist/cjs/salla-tiered-offer.cjs.entry.js.map +1 -0
- package/dist/cjs/salla-tiered-offer.entry.cjs.js.map +1 -0
- 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 +3 -3
- package/dist/collection/assets/svg/diamond-02.svg +4 -0
- package/dist/collection/assets/svg/gold.svg +6 -0
- package/dist/collection/assets/svg/star-rounded.svg +3 -0
- package/dist/collection/assets/svg/stars.svg +5 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/salla-tiered-offer/constants.js +12 -0
- package/dist/collection/components/salla-tiered-offer/constants.js.map +1 -0
- package/dist/collection/components/salla-tiered-offer/interfaces.js +9 -0
- package/dist/collection/components/salla-tiered-offer/interfaces.js.map +1 -0
- package/dist/collection/components/salla-tiered-offer/salla-tiered-offer.css +26 -0
- package/dist/collection/components/salla-tiered-offer/salla-tiered-offer.js +288 -0
- package/dist/collection/components/salla-tiered-offer/salla-tiered-offer.js.map +1 -0
- package/dist/collection/components/salla-tiered-offer/utils.js +38 -0
- package/dist/collection/components/salla-tiered-offer/utils.js.map +1 -0
- package/dist/components/index.js +2 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/salla-tiered-offer.d.ts +11 -0
- package/dist/components/salla-tiered-offer.js +371 -0
- package/dist/components/salla-tiered-offer.js.map +1 -0
- package/dist/esm/{app-globals-C4AMOceU.js → app-globals-CIvCwBrC.js} +3 -3
- package/dist/esm/{app-globals-C4AMOceU.js.map → app-globals-CIvCwBrC.js.map} +1 -1
- package/dist/esm/{index-5Ng8LPjI.js → index-DJeJWTdD.js} +8 -4
- package/dist/esm/index-DJeJWTdD.js.map +1 -0
- package/dist/esm/loader.js +4 -4
- package/dist/esm/salla-accordion-body.entry.js +1 -1
- package/dist/esm/salla-accordion-head.entry.js +1 -1
- package/dist/esm/salla-accordion.entry.js +1 -1
- package/dist/esm/salla-add-product-button_51.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-booking-field_2.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-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-tiered-offer.entry.js +336 -0
- package/dist/esm/salla-tiered-offer.entry.js.map +1 -0
- 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 +4 -4
- package/dist/esm-es5/{app-globals-C4AMOceU.js → app-globals-CIvCwBrC.js} +2 -2
- package/dist/esm-es5/{app-globals-C4AMOceU.js.map → app-globals-CIvCwBrC.js.map} +1 -1
- package/dist/esm-es5/{index-5Ng8LPjI.js → index-DJeJWTdD.js} +3 -3
- package/dist/esm-es5/index-DJeJWTdD.js.map +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-accordion-body.entry.js +1 -1
- package/dist/esm-es5/salla-accordion-head.entry.js +1 -1
- package/dist/esm-es5/salla-accordion.entry.js +1 -1
- package/dist/esm-es5/salla-add-product-button_51.entry.js +4 -4
- package/dist/esm-es5/salla-advertisement.entry.js +1 -1
- package/dist/esm-es5/salla-app-install-alert.entry.js +1 -1
- package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
- package/dist/esm-es5/salla-booking-field_2.entry.js +1 -1
- package/dist/esm-es5/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm-es5/salla-conditional-offer.entry.js +1 -1
- package/dist/esm-es5/salla-contacts.entry.js +1 -1
- package/dist/esm-es5/salla-filters-widget.entry.js +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 +2 -2
- package/dist/esm-es5/salla-metadata.entry.js +1 -1
- package/dist/esm-es5/salla-notification-item.entry.js +1 -1
- package/dist/esm-es5/salla-notifications.entry.js +1 -1
- package/dist/esm-es5/salla-offer.entry.js +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-tiered-offer.entry.js +5 -0
- package/dist/esm-es5/salla-tiered-offer.entry.js.map +1 -0
- 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-7f275c07.entry.js → p-018db6d5.entry.js} +2 -2
- package/dist/twilight/{p-592ab962.system.entry.js → p-01ab98b8.system.entry.js} +2 -2
- package/dist/twilight/{p-0997acd6.system.entry.js → p-0213d2ff.system.entry.js} +2 -2
- package/dist/twilight/{p-27b836fc.entry.js → p-0530fecd.entry.js} +2 -2
- package/dist/twilight/{p-a3867f03.system.entry.js → p-0a564fe6.system.entry.js} +2 -2
- package/dist/twilight/{p-3f87edc6.entry.js → p-0bd54dae.entry.js} +2 -2
- package/dist/twilight/{p-87ed46f2.entry.js → p-11542446.entry.js} +2 -2
- package/dist/twilight/{p-817c183a.entry.js → p-1196a23a.entry.js} +2 -2
- package/dist/twilight/{p-5bcba29f.system.entry.js → p-125e8e09.system.entry.js} +2 -2
- package/dist/twilight/{p-bb0a64fb.system.entry.js → p-137b9ced.system.entry.js} +2 -2
- package/dist/twilight/{p-4aec7d12.system.entry.js → p-14bce2e7.system.entry.js} +2 -2
- package/dist/twilight/{p-63f7bf97.system.entry.js → p-1bc7d70c.system.entry.js} +2 -2
- package/dist/twilight/{p-026b2234.system.entry.js → p-1c1baf96.system.entry.js} +2 -2
- package/dist/twilight/{p-7e2380cb.entry.js → p-1e32544e.entry.js} +2 -2
- package/dist/twilight/{p-CW47XnO5.system.js → p-1xnr2J3b.system.js} +6 -6
- package/dist/twilight/p-1xnr2J3b.system.js.map +1 -0
- package/dist/twilight/{p-b56edfc7.system.entry.js → p-2411b6cb.system.entry.js} +2 -2
- package/dist/twilight/{p-cd1a5066.system.entry.js → p-2943fae2.system.entry.js} +2 -2
- package/dist/twilight/{p-fe03bd17.entry.js → p-2e1838fc.entry.js} +2 -2
- package/dist/twilight/{p-606c8dfc.entry.js → p-2ecd9c73.entry.js} +2 -2
- package/dist/twilight/{p-917f2e0d.entry.js → p-345e7510.entry.js} +2 -2
- package/dist/twilight/{p-uTVeOuzK.system.js.map → p-3_GHqNLe.system.js.map} +1 -1
- package/dist/twilight/{p-B5V-3iwA.system.js.map → p-3iOHI_bZ.system.js.map} +1 -1
- package/dist/twilight/{p-50348764.entry.js → p-4719adfd.entry.js} +2 -2
- package/dist/twilight/{p-27fa775d.system.entry.js → p-512dbfd8.system.entry.js} +2 -2
- package/dist/twilight/{p-5092bc1b.system.entry.js → p-5222370a.system.entry.js} +2 -2
- package/dist/twilight/p-56329c93.system.entry.js +5 -0
- package/dist/twilight/{p-4defb732.entry.js → p-594c82e8.entry.js} +2 -2
- package/dist/twilight/{p-4260bfbf.entry.js → p-5a3e638f.entry.js} +2 -2
- package/dist/twilight/{p-89b36aa5.entry.js → p-5f22ded8.entry.js} +2 -2
- package/dist/twilight/{p-d39080ee.system.entry.js → p-60550d95.system.entry.js} +2 -2
- package/dist/twilight/{p-e7267b4b.system.entry.js → p-611a0591.system.entry.js} +2 -2
- package/dist/twilight/{p-6ccab36e.entry.js → p-62372bb6.entry.js} +2 -2
- package/dist/twilight/{p-2378fcc3.system.entry.js → p-64346d4f.system.entry.js} +2 -2
- package/dist/twilight/{p-725de283.system.entry.js → p-65f8266c.system.entry.js} +2 -2
- package/dist/twilight/{p-0c73100c.entry.js → p-7dc53e3e.entry.js} +2 -2
- package/dist/twilight/{p-e182183b.entry.js → p-84aaa78d.entry.js} +2 -2
- package/dist/twilight/{p-b66d9649.system.entry.js → p-8b0b63d3.system.entry.js} +2 -2
- package/dist/twilight/p-8b9cdaa8.system.entry.js +5 -0
- package/dist/twilight/p-8b9cdaa8.system.entry.js.map +1 -0
- package/dist/twilight/{p-74922500.entry.js → p-8d171391.entry.js} +2 -2
- package/dist/twilight/{p-568ca254.system.entry.js → p-8d241400.system.entry.js} +2 -2
- package/dist/twilight/{p-b0b3047d.entry.js → p-8f504c22.entry.js} +2 -2
- package/dist/twilight/{p-059307d0.system.entry.js → p-96c0dbe6.system.entry.js} +2 -2
- package/dist/twilight/{p-6831d2b2.entry.js → p-9c6d592b.entry.js} +2 -2
- package/dist/twilight/{p-jJ43wXLr.system.js.map → p-B0iUa0dk.system.js.map} +1 -1
- package/dist/twilight/{p-C435-Ngu.system.js.map → p-B78CJAeo.system.js.map} +1 -1
- package/dist/twilight/{p-7SiswGu5.system.js.map → p-BEAZDb3Z.system.js.map} +1 -1
- package/dist/twilight/{p-D0yWDY14.system.js.map → p-BQW3a64v.system.js.map} +1 -1
- package/dist/twilight/p-BYmyEppC.system.js.map +1 -0
- package/dist/twilight/{p-BKj6IZd9.system.js.map → p-BbGRMLwX.system.js.map} +1 -1
- package/dist/twilight/{p-F2JLu9jF.system.js.map → p-BiWj3BdY.system.js.map} +1 -1
- package/dist/twilight/{p-Qk6u-mnz.system.js.map → p-BmpTR30a.system.js.map} +1 -1
- package/dist/twilight/{p-Q3cnmL-k.system.js.map → p-BwBcvX6V.system.js.map} +1 -1
- package/dist/twilight/{p-DO1cm8rG.system.js.map → p-C1YpO4ps.system.js.map} +1 -1
- package/dist/twilight/{p-nXvqfF6q.system.js.map → p-CS3lHUTW.system.js.map} +1 -1
- package/dist/twilight/{p-gVMnKsEU.system.js.map → p-CW5Y_Ilm.system.js.map} +1 -1
- package/dist/twilight/{p-TbCQaUz_.system.js.map → p-CW_Wih48.system.js.map} +1 -1
- package/dist/twilight/{p-DkgAOYre.system.js.map → p-Cny8cSf0.system.js.map} +1 -1
- package/dist/twilight/{p-DUpLpWDY.system.js.map → p-Cv-fXCMq.system.js.map} +1 -1
- package/dist/twilight/{p-DvQyp25Z.js → p-D4Rc_kre.js} +2 -2
- package/dist/twilight/{p-DvQyp25Z.js.map → p-D4Rc_kre.js.map} +1 -1
- package/dist/twilight/{p-C1RajKkq.system.js.map → p-D8gfPwyY.system.js.map} +1 -1
- package/dist/twilight/{p-Uyr4Flns.system.js.map → p-DDxbK6va.system.js.map} +1 -1
- package/dist/twilight/{p-BC9d2sk2.system.js.map → p-DF0wZDI-.system.js.map} +1 -1
- package/dist/twilight/{p-0n3Z0RlT.system.js.map → p-DJO9K4n7.system.js.map} +1 -1
- package/dist/twilight/{p-5Ng8LPjI.js → p-DJeJWTdD.js} +3 -3
- package/dist/twilight/p-DJeJWTdD.js.map +1 -0
- package/dist/twilight/{p-SmO-pF11.system.js.map → p-DYXzVtwh.system.js.map} +1 -1
- package/dist/twilight/{p-W-D1NGNr.system.js.map → p-D_GDndNn.system.js.map} +1 -1
- package/dist/twilight/{p-B_XWr5W4.system.js.map → p-DanADfyI.system.js.map} +1 -1
- package/dist/twilight/{p-DrkjWDOn.system.js.map → p-DlFxCb4V.system.js.map} +1 -1
- package/dist/twilight/{p-DyTthv6s.system.js → p-Dtkyz9uf.system.js} +2 -2
- package/dist/twilight/{p-DyTthv6s.system.js.map → p-Dtkyz9uf.system.js.map} +1 -1
- package/dist/twilight/{p-DAcwScl7.system.js.map → p-DuXM8liP.system.js.map} +1 -1
- package/dist/twilight/{p-D5qlTBkb.system.js.map → p-DvaxAP4E.system.js.map} +1 -1
- package/dist/twilight/{p-D66T0o_K.system.js.map → p-DygvAhI4.system.js.map} +1 -1
- package/dist/twilight/{p-BRVKF1oX.system.js.map → p-V-F3jS9L.system.js.map} +1 -1
- package/dist/twilight/{p-CVCIt2lC.system.js.map → p-Vh3TFQnV.system.js.map} +1 -1
- package/dist/twilight/{p-38dbabf3.system.entry.js → p-a4376ad7.system.entry.js} +2 -2
- package/dist/twilight/{p-7425415e.entry.js → p-a52f5483.entry.js} +2 -2
- package/dist/twilight/{p-2bbb1442.system.entry.js → p-a8541cb2.system.entry.js} +2 -2
- package/dist/twilight/{p-b932035d.entry.js → p-aae55c3c.entry.js} +2 -2
- package/dist/twilight/{p-83ec57bf.system.entry.js → p-ab9a81e5.system.entry.js} +2 -2
- package/dist/twilight/{p-9a610905.entry.js → p-b311d422.entry.js} +2 -2
- package/dist/twilight/{p-8fee4078.entry.js → p-b734e69f.entry.js} +2 -2
- package/dist/twilight/{p-5cdc0973.entry.js → p-bdef02e0.entry.js} +2 -2
- package/dist/twilight/{p-ab25e4b2.system.entry.js → p-bec1f4a2.system.entry.js} +2 -2
- package/dist/twilight/{p-52d9262a.system.entry.js → p-c62d7968.system.entry.js} +2 -2
- package/dist/twilight/{p-2406c822.entry.js → p-cba454b7.entry.js} +2 -2
- package/dist/twilight/{p-3fcf491f.entry.js → p-d0db93be.entry.js} +2 -2
- package/dist/twilight/{p-30635b42.system.entry.js → p-d78f9304.system.entry.js} +2 -2
- package/dist/twilight/{p-DA5WTaBt.system.js.map → p-dKVQW-4Z.system.js.map} +1 -1
- package/dist/twilight/{p-fa63f709.entry.js → p-ddfc02db.entry.js} +2 -2
- package/dist/twilight/p-df86fa35.entry.js +5 -0
- package/dist/twilight/p-df86fa35.entry.js.map +1 -0
- package/dist/twilight/{p-727b5970.system.entry.js → p-e09dbe92.system.entry.js} +2 -2
- package/dist/twilight/{p-8aebf618.system.entry.js → p-e45781c5.system.entry.js} +2 -2
- package/dist/twilight/{p-1d9751af.system.entry.js → p-e490de2f.system.entry.js} +2 -2
- package/dist/twilight/{p-e38dcdec.entry.js → p-e9e4a641.entry.js} +7 -7
- package/dist/twilight/{p-c8833f02.system.entry.js → p-eb847afb.system.entry.js} +2 -2
- package/dist/twilight/{p-DAzL0lXn.system.js.map → p-eyvPNcBM.system.js.map} +1 -1
- package/dist/twilight/{p-1fec50ba.entry.js → p-f26aa117.entry.js} +2 -2
- package/dist/twilight/{p-e0039759.entry.js → p-f5364a4e.entry.js} +2 -2
- package/dist/twilight/{p-0f6f5c5a.system.entry.js → p-f6e14858.system.entry.js} +2 -2
- package/dist/twilight/{p-f0eacf55.entry.js → p-f8f0dd3d.entry.js} +2 -2
- package/dist/twilight/{p-f0443b95.entry.js → p-fd20f996.entry.js} +2 -2
- package/dist/twilight/{p-b0218d53.system.entry.js → p-fe4d5abb.system.entry.js} +2 -2
- package/dist/twilight/{p-BwQkR44B.system.js.map → p-rHIfLORZ.system.js.map} +1 -1
- package/dist/twilight/p-t_BLXxaT.system.js +5 -0
- package/dist/twilight/{p-DF9ZFyzo.system.js.map → p-t_BLXxaT.system.js.map} +1 -1
- package/dist/twilight/{p-DEap41uW.system.js.map → p-urL630v4.system.js.map} +1 -1
- package/dist/twilight/salla-tiered-offer.entry.esm.js.map +1 -0
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/dist/types/components/salla-tiered-offer/constants.d.ts +2 -0
- package/dist/types/components/salla-tiered-offer/interfaces.d.ts +44 -0
- package/dist/types/components/salla-tiered-offer/salla-tiered-offer.d.ts +39 -0
- package/dist/types/components/salla-tiered-offer/utils.d.ts +19 -0
- package/dist/types/components.d.ts +13 -0
- package/package.json +5 -5
- package/dist/cjs/index-CcKYmcmm.js.map +0 -1
- package/dist/esm/index-5Ng8LPjI.js.map +0 -1
- package/dist/esm-es5/index-5Ng8LPjI.js.map +0 -1
- package/dist/twilight/p-5Ng8LPjI.js.map +0 -1
- package/dist/twilight/p-CW47XnO5.system.js.map +0 -1
- package/dist/twilight/p-DF9ZFyzo.system.js +0 -5
- package/dist/twilight/p-bed89c3a.system.entry.js +0 -5
- /package/dist/twilight/{p-7f275c07.entry.js.map → p-018db6d5.entry.js.map} +0 -0
- /package/dist/twilight/{p-592ab962.system.entry.js.map → p-01ab98b8.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-0997acd6.system.entry.js.map → p-0213d2ff.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-27b836fc.entry.js.map → p-0530fecd.entry.js.map} +0 -0
- /package/dist/twilight/{p-a3867f03.system.entry.js.map → p-0a564fe6.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-3f87edc6.entry.js.map → p-0bd54dae.entry.js.map} +0 -0
- /package/dist/twilight/{p-87ed46f2.entry.js.map → p-11542446.entry.js.map} +0 -0
- /package/dist/twilight/{p-817c183a.entry.js.map → p-1196a23a.entry.js.map} +0 -0
- /package/dist/twilight/{p-5bcba29f.system.entry.js.map → p-125e8e09.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-bb0a64fb.system.entry.js.map → p-137b9ced.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4aec7d12.system.entry.js.map → p-14bce2e7.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-63f7bf97.system.entry.js.map → p-1bc7d70c.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-026b2234.system.entry.js.map → p-1c1baf96.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-7e2380cb.entry.js.map → p-1e32544e.entry.js.map} +0 -0
- /package/dist/twilight/{p-b56edfc7.system.entry.js.map → p-2411b6cb.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-cd1a5066.system.entry.js.map → p-2943fae2.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-fe03bd17.entry.js.map → p-2e1838fc.entry.js.map} +0 -0
- /package/dist/twilight/{p-606c8dfc.entry.js.map → p-2ecd9c73.entry.js.map} +0 -0
- /package/dist/twilight/{p-917f2e0d.entry.js.map → p-345e7510.entry.js.map} +0 -0
- /package/dist/twilight/{p-50348764.entry.js.map → p-4719adfd.entry.js.map} +0 -0
- /package/dist/twilight/{p-27fa775d.system.entry.js.map → p-512dbfd8.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-5092bc1b.system.entry.js.map → p-5222370a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-bed89c3a.system.entry.js.map → p-56329c93.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4defb732.entry.js.map → p-594c82e8.entry.js.map} +0 -0
- /package/dist/twilight/{p-4260bfbf.entry.js.map → p-5a3e638f.entry.js.map} +0 -0
- /package/dist/twilight/{p-89b36aa5.entry.js.map → p-5f22ded8.entry.js.map} +0 -0
- /package/dist/twilight/{p-d39080ee.system.entry.js.map → p-60550d95.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e7267b4b.system.entry.js.map → p-611a0591.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6ccab36e.entry.js.map → p-62372bb6.entry.js.map} +0 -0
- /package/dist/twilight/{p-2378fcc3.system.entry.js.map → p-64346d4f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-725de283.system.entry.js.map → p-65f8266c.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-0c73100c.entry.js.map → p-7dc53e3e.entry.js.map} +0 -0
- /package/dist/twilight/{p-e182183b.entry.js.map → p-84aaa78d.entry.js.map} +0 -0
- /package/dist/twilight/{p-b66d9649.system.entry.js.map → p-8b0b63d3.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-74922500.entry.js.map → p-8d171391.entry.js.map} +0 -0
- /package/dist/twilight/{p-568ca254.system.entry.js.map → p-8d241400.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-b0b3047d.entry.js.map → p-8f504c22.entry.js.map} +0 -0
- /package/dist/twilight/{p-059307d0.system.entry.js.map → p-96c0dbe6.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6831d2b2.entry.js.map → p-9c6d592b.entry.js.map} +0 -0
- /package/dist/twilight/{p-38dbabf3.system.entry.js.map → p-a4376ad7.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-7425415e.entry.js.map → p-a52f5483.entry.js.map} +0 -0
- /package/dist/twilight/{p-2bbb1442.system.entry.js.map → p-a8541cb2.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-b932035d.entry.js.map → p-aae55c3c.entry.js.map} +0 -0
- /package/dist/twilight/{p-83ec57bf.system.entry.js.map → p-ab9a81e5.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9a610905.entry.js.map → p-b311d422.entry.js.map} +0 -0
- /package/dist/twilight/{p-8fee4078.entry.js.map → p-b734e69f.entry.js.map} +0 -0
- /package/dist/twilight/{p-5cdc0973.entry.js.map → p-bdef02e0.entry.js.map} +0 -0
- /package/dist/twilight/{p-ab25e4b2.system.entry.js.map → p-bec1f4a2.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-52d9262a.system.entry.js.map → p-c62d7968.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2406c822.entry.js.map → p-cba454b7.entry.js.map} +0 -0
- /package/dist/twilight/{p-3fcf491f.entry.js.map → p-d0db93be.entry.js.map} +0 -0
- /package/dist/twilight/{p-30635b42.system.entry.js.map → p-d78f9304.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-fa63f709.entry.js.map → p-ddfc02db.entry.js.map} +0 -0
- /package/dist/twilight/{p-727b5970.system.entry.js.map → p-e09dbe92.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-8aebf618.system.entry.js.map → p-e45781c5.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-1d9751af.system.entry.js.map → p-e490de2f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e38dcdec.entry.js.map → p-e9e4a641.entry.js.map} +0 -0
- /package/dist/twilight/{p-c8833f02.system.entry.js.map → p-eb847afb.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-1fec50ba.entry.js.map → p-f26aa117.entry.js.map} +0 -0
- /package/dist/twilight/{p-e0039759.entry.js.map → p-f5364a4e.entry.js.map} +0 -0
- /package/dist/twilight/{p-0f6f5c5a.system.entry.js.map → p-f6e14858.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-f0eacf55.entry.js.map → p-f8f0dd3d.entry.js.map} +0 -0
- /package/dist/twilight/{p-f0443b95.entry.js.map → p-fd20f996.entry.js.map} +0 -0
- /package/dist/twilight/{p-b0218d53.system.entry.js.map → p-fe4d5abb.system.entry.js.map} +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,r,i){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i["throw"](t))}catch(t){s(t)}}function l(t){t.done?r(t.value):n(t.value).then(o,a)}l((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(t){return function(e){return l([t,e])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(r=0)),r)try{if(i=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;n=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(s=r.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(a[0]===6&&r.label<s[1]){r.label=s[1];s=a;break}if(s&&r.label<s[2]){r.label=s[2];r.ops.push(a);break}if(s[2])r.ops.pop();r.trys.pop();continue}a=e.call(t,r)}catch(t){a=[6,t];n=0}finally{i=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,s;i<n;i++){if(s||!(i in e)){if(!s)s=Array.prototype.slice.call(e,0,i);s[i]=e[i]}}return t.concat(s||Array.prototype.slice.call(e))};
|
|
2
|
+
/*!
|
|
3
|
+
* Crafted with ❤ by Salla
|
|
4
|
+
*/System.register(["./p-1xnr2J3b.system.js"],(function(t){"use strict";var e,r,i;return{setters:[function(t){e=t.r;r=t.h;i=t.H}],execute:function(){var n;(function(t){t["PERCENTAGE"]="percentage";t["FIXED"]="fixed"})(n||(n={}));var s='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M13.7276 3.44418L15.4874 6.99288C15.7274 7.48687 16.3673 7.9607 16.9073 8.05143L20.0969 8.58575C22.1367 8.92853 22.6167 10.4206 21.1468 11.8925L18.6671 14.3927C18.2471 14.8161 18.0172 15.6327 18.1471 16.2175L18.8571 19.3125C19.417 21.7623 18.1271 22.71 15.9774 21.4296L12.9877 19.6452C12.4478 19.3226 11.5579 19.3226 11.0079 19.6452L8.01827 21.4296C5.8785 22.71 4.57865 21.7522 5.13859 19.3125L5.84851 16.2175C5.97849 15.6327 5.74852 14.8161 5.32856 14.3927L2.84884 11.8925C1.389 10.4206 1.85895 8.92853 3.89872 8.58575L7.08837 8.05143C7.61831 7.9607 8.25824 7.48687 8.49821 6.99288L10.258 3.44418C11.2179 1.51861 12.7777 1.51861 13.7276 3.44418Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>';var o='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M3 12C7.5 12 12 7.5 12 3C12 7.5 16.5 12 21 12C16.5 12 12 16.5 12 21C12 16.5 7.5 12 3 12Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M2 19.5C2.83333 19.5 4.5 17.8333 4.5 17C4.5 17.8333 6.16667 19.5 7 19.5C6.16667 19.5 4.5 21.1667 4.5 22C4.5 21.1667 2.83333 19.5 2 19.5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M16 5C17 5 19 3 19 2C19 3 21 5 22 5C21 5 19 7 19 8C19 7 17 5 16 5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n</svg>';var a='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M14.2644 18.3717C14.5806 17.407 14.7387 16.9247 15.0616 16.593C15.215 16.4354 15.3932 16.3048 15.5887 16.2066C16.0003 16 16.5003 16 17.5002 16C18.5001 16 19.0001 16 19.4116 16.2066C19.6072 16.3048 19.7853 16.4354 19.9388 16.593C20.2617 16.9247 20.4198 17.407 20.736 18.3717L21.0624 19.3675C21.4561 20.5688 21.653 21.1694 21.3587 21.5847C21.0643 22 20.4418 22 19.1966 22H15.8038C14.5586 22 13.936 22 13.6417 21.5847C13.3473 21.1694 13.5442 20.5688 13.938 19.3675L14.2644 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M8.76421 10.3717C9.08041 9.40705 9.23851 8.92471 9.56143 8.59298C9.71485 8.43537 9.89299 8.3048 10.0885 8.20663C10.5001 8 11.0001 8 12 8C12.9999 8 13.4999 8 13.9115 8.20663C14.107 8.3048 14.2851 8.43537 14.4386 8.59298C14.7615 8.92471 14.9196 9.40705 15.2358 10.3717L15.5622 11.3675C15.956 12.5688 16.1528 13.1694 15.8585 13.5847C15.5642 14 14.9416 14 13.6964 14H10.3036C9.05842 14 8.43585 14 8.1415 13.5847C7.84716 13.1694 8.04404 12.5688 8.43779 11.3675L8.76421 10.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M3.26439 18.3717C3.58059 17.407 3.73869 16.9247 4.06162 16.593C4.21504 16.4354 4.39317 16.3048 4.58872 16.2066C5.00031 16 5.50027 16 6.50018 16C7.5001 16 8.00006 16 8.41165 16.2066C8.6072 16.3048 8.78533 16.4354 8.93875 16.593C9.26167 16.9247 9.41977 17.407 9.73597 18.3717L10.0624 19.3675C10.4561 20.5688 10.653 21.1694 10.3587 21.5847C10.0643 22 9.44176 22 8.19661 22H4.80375C3.5586 22 2.93603 22 2.64169 21.5847C2.34735 21.1694 2.54422 20.5688 2.93797 19.3675L3.26439 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M12 2V4M7.5 3.5L9 5M16.5 3.5L15 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>\n</svg>';var l='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M5.78223 4.18192C6.43007 3.68319 6.754 3.43383 7.12788 3.27323C7.29741 3.20041 7.47367 3.14158 7.65459 3.09741C8.0536 3 8.4767 3 9.32289 3H14.6771C15.5233 3 15.9464 3 16.3454 3.09741C16.5263 3.14158 16.7026 3.20041 16.8721 3.27323C17.246 3.43383 17.5699 3.68319 18.2178 4.18192C20.3644 5.83448 21.4378 6.66077 21.8057 7.73078C21.9694 8.20673 22.0305 8.70728 21.9858 9.20461C21.8852 10.3227 21.0379 11.346 19.3433 13.3925L15.3498 18.2153C13.8126 20.0718 13.044 21 12 21C10.956 21 10.1874 20.0718 8.65018 18.2153L4.65671 13.3925C2.96208 11.346 2.11476 10.3227 2.0142 9.20461C1.96947 8.70728 2.03064 8.20673 2.1943 7.73078C2.56224 6.66077 3.63557 5.83448 5.78223 4.18192Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M10 8.5H14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>';var f={staticIcons:[s,o,a,l],staticColors:["#993018","#444444","#D18F36","#315F9C"]};var u=function(){function t(){}t.findTierByIndex=function(t,e){return t.find((function(t){return t.index===e}))||null};t.findTierByName=function(t,e){return t.find((function(t){return t.tier_name===e}))||null};t.getTierNameByIndex=function(t,e){var r;return(r=this.findTierByIndex(t,e))===null||r===void 0?void 0:r.tier_name};t.findCurrentTierIndex=function(t,e){if(!e)return 0;for(var r=e.length-1;r>=0;r--){if(t>=e[r].threshold){return e[r].index}}return 0};return t}();var c=".s-tiered-offer-milestone-icon svg{color:currentColor}.s-tiered-offer-milestone-icon svg path{stroke:currentColor;fill:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg path{fill:currentColor;stroke:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg[fill=none] path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg[fill=none] path{fill:none;stroke:currentColor}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-bg{-webkit-transform:scaleX(-1);transform:scaleX(-1)}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-fill{-webkit-transform:scaleX(-1);transform:scaleX(-1);left:auto}[dir=rtl] .flip-x{-webkit-transform:scaleX(-1);transform:scaleX(-1)}";var d=t("salla_tiered_offer",function(){function t(t){var r=this;e(this,t);this.currentTierIndex=0;this.canRender=false;this.isLoading=false;this.handleTabClick=function(t){r.activeTabTier=t};salla.lang.onLoaded((function(){r.loyaltyProgramText=salla.lang.get("blocks.tiered_offer.program_title");r.currentTierText=salla.lang.get("blocks.tiered_offer.current_tier");r.discountText=salla.lang.get("blocks.tiered_offer.discount");r.benefitText=salla.lang.get("blocks.tiered_offer.tier_description")}))}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:r.trys.push([0,3,4,5]);return[4,salla.onReady()];case 1:r.sent();if(!this.checkFeatureEnabled()){return[2]}if(!this.checkCartExists()){return[2]}this.isLoading=true;return[4,this.fetchTieredOfferData()];case 2:t=r.sent();if(!t){return[2]}this.initializeComponent(t);return[3,5];case 3:e=r.sent();this.canRender=false;salla.logger.warn("salla-tiered-offer:: ",e);return[3,5];case 4:this.isLoading=false;return[7];case 5:return[2]}}))}))};t.prototype.checkFeatureEnabled=function(){var t;return(t=salla.config.get("store.features"))===null||t===void 0?void 0:t.includes("tiered-offer")};t.prototype.checkCartExists=function(){var t,e;return!!((e=(t=salla.storage.get("cart"))===null||t===void 0?void 0:t.summary)===null||e===void 0?void 0:e.count)};t.prototype.validateCouponCompatibility=function(t,e){var r;return!(e&&!((r=t.details)===null||r===void 0?void 0:r.applied_with_coupon))};t.prototype.fetchTieredOfferData=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,i;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,salla.api.cart.offers()];case 1:e=n.sent().data;r=e.find((function(t){return t.type==="tiered_offer"}));if(!r){return[2,null]}if(!this.validateCouponCompatibility(r,(t=salla.storage.get("cart"))===null||t===void 0?void 0:t.coupon)){this.canRender=false;return[2,null]}return[2,r];case 2:i=n.sent();throw i;case 3:return[2]}}))}))};t.prototype.initializeComponent=function(t){var e;this.apiOfferData=t;this.tieredOfferData=this.mapApiDataToTiers(this.apiOfferData);this.loyaltyProgramText=this.apiOfferData.title||this.loyaltyProgramText;var r=((e=this.apiOfferData.details)===null||e===void 0?void 0:e.current_value)||0;var i=this.findCurrentTierIndex(r);if(i===0){this.canRender=false;return}this.currentTierIndex=i;this.currentTier=u.getTierNameByIndex(this.tieredOfferData.tiers,i);this.activeTabTier=this.currentTier;this.canRender=true};t.prototype.componentDidLoad=function(){var t=this;salla.event.on("cart::updated",(function(e){t.updateOfferValues(e)}))};t.prototype.mapApiDataToTiers=function(t){var e=__spreadArray([],t.details.discounts,true).sort((function(t,e){return t.min_spend-e.min_spend}));var r=e.map((function(t,e){return{name:t.name,tier_name:t.name,discount:t.type===n.PERCENTAGE?"".concat(salla.helpers.number(t.value),"%"):salla.money(t.value),icon:f.staticIcons[e]||f.staticIcons[0],threshold:t.min_spend,text_color:f.staticColors[e],index:e+1}}));return{current_tier:u.getTierNameByIndex(r,this.findCurrentTierIndex(t.details.current_value,r)),tiers:r}};t.prototype.findCurrentTierIndex=function(t,e){var r;if(e===void 0){e=(r=this.tieredOfferData)===null||r===void 0?void 0:r.tiers}return u.findCurrentTierIndex(t,e||[])};t.prototype.updateOfferValues=function(t){var e;if(!this.apiOfferData||!this.tieredOfferData){return}if(!this.validateCouponCompatibility(this.apiOfferData,t.coupon)){this.canRender=false;return}this.canRender=true;if(((e=this.apiOfferData.details)===null||e===void 0?void 0:e.with_current_cart)===false){return}var r=t.sub_total;this.apiOfferData=Object.assign(Object.assign({},this.apiOfferData),{details:Object.assign(Object.assign({},this.apiOfferData.details),{current_value:r})});var i=this.findCurrentTierIndex(r);if(i===0){this.canRender=false;return}this.canRender=true;this.currentTierIndex=i;this.currentTier=u.getTierNameByIndex(this.tieredOfferData.tiers,i);if(this.activeTabTier!==this.currentTier){this.activeTabTier=this.currentTier}};t.prototype.getLoadingSkeletonView=function(){return r(i,null,r("div",{class:"s-tiered-offer-container"},r("div",{class:"s-tiered-offer-skeleton-wrapper"},r("div",{class:"s-tiered-offer-skeleton-title"},r("salla-skeleton",{height:"16px",width:"40%"})),r("div",{class:"s-tiered-offer-skeleton-subtitle"},r("salla-skeleton",{height:"20px",width:"60%"})),r("div",{class:"s-tiered-offer-skeleton-progress"},r("salla-skeleton",{height:"16px",width:"100%"})),r("div",{class:"s-tiered-offer-skeleton-tabs"},r("salla-skeleton",{height:"50px",width:"100%"})))))};t.prototype.getCurrentTierData=function(){return u.findTierByIndex(this.tieredOfferData.tiers,this.currentTierIndex)||this.tieredOfferData.tiers[0]};t.prototype.getProgressWidth=function(){var t;var e=((t=this.apiOfferData.details)===null||t===void 0?void 0:t.current_value)||0;var r=this.tieredOfferData.tiers.length;var i=this.findCurrentTierIndex(e);var n=i;return n/r*100};t.prototype.calculateMilestonePosition=function(t,e){if(e===1){return"calc(100% - 18px)"}var r=(t+1)/e*100;var i=8/e;return"".concat(Math.max(2,Math.min(95,r-i)),"%")};t.prototype.getMilestoneStyles=function(t,e,r){var i;var n=document.documentElement.dir==="rtl";var s=this.calculateMilestonePosition(e,r);var o=t.name.length>6?"flex-end":"center";return i={},i[n?"right":"left"]=s,i.alignItems=o,i.position="absolute",i.transform=n?"translateX(50%)":"translateX(-50%)",i};t.prototype.getMilestoneIconStyles=function(t,e,r){if(e){return{color:t.text_color}}if(r){return{color:"var(--color-primary)"}}return{}};t.prototype.renderProgressBarBackground=function(t){return[r("div",{class:"s-tiered-offer-progress-bg"}),r("div",{class:"s-tiered-offer-progress-fill",style:{width:"".concat(t,"%")}})]};t.prototype.renderMilestoneIcon=function(t,e,i){var n=["s-tiered-offer-milestone-icon",e?"s-tiered-offer-milestone-active":"",i?"s-tiered-offer-milestone-completed":""].filter(Boolean).join(" ");return r("div",{class:n,style:this.getMilestoneIconStyles(t,e,i)},r("span",{innerHTML:t.icon}))};t.prototype.renderMilestoneName=function(t,e){return r("div",{class:"s-tiered-offer-milestone-name"},e&&r("span",{style:{color:t.text_color}},t.name))};t.prototype.renderMilestones=function(t,e){var i=this;var n=e===1?"s-tiered-offer-single-milestone-justify-end":"s-tiered-offer-milestones";return r("div",{class:"s-tiered-offer-milestones-wrapper"},r("div",{class:n},this.tieredOfferData.tiers.map((function(n,s){var o=t>=n.threshold;var a=n.tier_name===i.currentTier;return r("div",{class:"s-tiered-offer-milestone",style:i.getMilestoneStyles(n,s,e)},i.renderMilestoneIcon(n,a,o),i.renderMilestoneName(n,a))}))))};t.prototype.renderProgressBar=function(){var t;var e=this.getProgressWidth();var i=this.tieredOfferData.tiers.length;var n=((t=this.apiOfferData.details)===null||t===void 0?void 0:t.current_value)||0;return r("div",{class:"s-tiered-offer-progress-container"},r("div",{class:"s-tiered-offer-progress-wrapper"},this.renderProgressBarBackground(e),this.renderMilestones(n,i)))};t.prototype.renderTabs=function(){var t=this;return r("div",{class:"s-tiered-offer-tabs-container"},r("div",{class:"s-tiered-offer-tab-headers"},this.tieredOfferData.tiers.map((function(e){var i=e.tier_name===t.activeTabTier;return r("button",{class:"s-tiered-offer-tab-header ".concat(i?"s-tiered-offer-tab-active":""),onClick:function(){return t.handleTabClick(e.tier_name)}},r("span",null,e.name))}))),r("div",{class:"s-tiered-offer-tab-content-wrapper"},function(){var e=u.findTierByName(t.tieredOfferData.tiers,t.activeTabTier);if(!e)return null;return r("div",{class:"s-tiered-offer-tab-content"},r("div",{class:"s-tiered-offer-tab-content-inner"},r("div",{class:"s-tiered-offer-discount-section"},r("p",{class:"s-tiered-offer-discount-title"},t.discountText," ",r("span",{innerHTML:e.discount})),r("p",{class:"s-tiered-offer-benefit-description"},t.benefitText," ",e.name))))}()))};t.prototype.render=function(){if(this.isLoading){return this.getLoadingSkeletonView()}if(!this.canRender||!this.tieredOfferData){return null}var t=this.getCurrentTierData();return r(i,null,r("div",{class:"s-tiered-offer-container"},r("div",{class:"s-tiered-offer-header"},r("div",{class:"s-tiered-offer-header-content"},r("p",{class:"s-tiered-offer-program-title"},this.loyaltyProgramText),r("div",{class:"s-tiered-offer-current-tier-name-wrapper"},r("h2",{class:"s-tiered-offer-current-tier"},this.currentTierText," ",r("span",{class:"s-tiered-offer-tier-name"},t.name)),r("span",{innerHTML:t.icon})))),this.renderProgressBar(),this.renderTabs()))};return t}());d.style=c}}}));
|
|
5
|
+
//# sourceMappingURL=p-8b9cdaa8.system.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DiscountType","TIERED_OFFER_CONFIG","staticIcons","StarIcon","StarsIcon","GoldIcon","DiamondIcon","staticColors","TierUtils","findTierByIndex","tiers","index","find","tier","findTierByName","tierName","tier_name","getTierNameByIndex","_a","this","findCurrentTierIndex","currentValue","i","length","threshold","sallaTieredOfferCss","SallaTieredOffer","exports","class_1","hostRef","_this","currentTierIndex","canRender","isLoading","handleTabClick","activeTabTier","salla","lang","onLoaded","loyaltyProgramText","get","currentTierText","discountText","benefitText","prototype","componentWillLoad","onReady","_c","sent","checkFeatureEnabled","checkCartExists","fetchTieredOfferData","offerData","initializeComponent","logger","warn","error_1","config","includes","_b","storage","summary","count","validateCouponCompatibility","cartCoupon","details","applied_with_coupon","api","cart","offers","data","tieredOffer","offer","type","coupon","error_2","apiOfferData","tieredOfferData","mapApiDataToTiers","title","current_value","currentTier","componentDidLoad","event","on","updatedCart","updateOfferValues","apiData","sortedDiscounts","__spreadArray","discounts","sort","a","b","min_spend","map","discount","name","PERCENTAGE","concat","helpers","number","value","money","icon","text_color","current_tier","with_current_cart","sub_total","Object","assign","newTierIndex","getLoadingSkeletonView","h","Host","class","height","width","getCurrentTierData","getProgressWidth","totalTiers","completedTiers","calculateMilestonePosition","milestonePercent","offsetPercent","Math","max","min","getMilestoneStyles","isRtl","document","documentElement","dir","adjustedPercent","alignItems","position","transform","getMilestoneIconStyles","isCurrent","isReached","color","renderProgressBarBackground","progressWidth","style","renderMilestoneIcon","iconClasses","filter","Boolean","join","innerHTML","renderMilestoneName","renderMilestones","containerClass","renderProgressBar","renderTabs","isActive","onClick","activeTier","render","currentTierData"],"sources":["src/components/salla-tiered-offer/interfaces.ts","src/components/salla-tiered-offer/constants.ts","src/components/salla-tiered-offer/utils.ts","src/components/salla-tiered-offer/salla-tiered-offer.scss?tag=salla-tiered-offer","src/components/salla-tiered-offer/salla-tiered-offer.tsx"],"sourcesContent":["export enum DiscountType {\n PERCENTAGE = \"percentage\",\n FIXED = \"fixed\",\n}\n\n\nexport interface Discount {\n name?: string;\n type?: DiscountType;\n value?: number;\n min_spend?: number;\n}\n\nexport interface TieredOfferDetails {\n based_on?: string;\n ends_at?: number;\n start_value?: number;\n end_value?: number;\n current_value?: number;\n discounts?: Discount[];\n with_current_cart?: boolean;\n applied_with_coupon?: boolean;\n}\n\nexport interface Offer {\n id?: number;\n type?: string;\n title?: string;\n description?: string;\n details?: TieredOfferDetails | null;\n}\n\nexport interface TieredOfferTier {\n name: string;\n tier_name: string;\n discount: string;\n icon: string;\n threshold: number;\n text_color?: string;\n index: number;\n}\n\nexport interface TieredOfferData {\n current_tier: string;\n tiers: TieredOfferTier[];\n}\n\nexport interface TieredOfferConfig {\n staticIcons: string[];\n staticColors: string[];\n}\n","import { TieredOfferConfig } from './interfaces';\nimport StarIcon from '../../assets/svg/star-rounded.svg';\nimport StarsIcon from '../../assets/svg/stars.svg';\nimport GoldIcon from '../../assets/svg/gold.svg';\nimport DiamondIcon from '../../assets/svg/diamond-02.svg';\n\nexport const TIERED_OFFER_CONFIG: TieredOfferConfig = {\n staticIcons: [StarIcon, StarsIcon, GoldIcon, DiamondIcon],\n staticColors: ['#993018', '#444444', '#D18F36', '#315F9C']\n};","import { TieredOfferTier } from './interfaces';\n\nexport class TierUtils {\n /**\n * Find tier by index\n */\n static findTierByIndex(tiers: TieredOfferTier[], index: number): TieredOfferTier | null {\n return tiers.find(tier => tier.index === index) || null;\n }\n\n /**\n * Find tier by tier name\n */\n static findTierByName(tiers: TieredOfferTier[], tierName: string): TieredOfferTier | null {\n return tiers.find(tier => tier.tier_name === tierName) || null;\n }\n\n /**\n * Get tier name by index\n */\n static getTierNameByIndex(tiers: TieredOfferTier[], index: number): string | undefined {\n return this.findTierByIndex(tiers, index)?.tier_name;\n }\n\n /**\n * Find current tier index based on current value\n */\n static findCurrentTierIndex(currentValue: number, tiers: TieredOfferTier[]): number {\n if (!tiers) return 0;\n \n for (let i = tiers.length - 1; i >= 0; i--) {\n if (currentValue >= tiers[i].threshold) {\n return tiers[i].index;\n }\n }\n return 0;\n }\n}","\n// SVG styling for milestone icons \n.s-tiered-offer-milestone-icon {\n svg {\n color: currentColor;\n \n path {\n stroke: currentColor;\n fill: none;\n }\n }\n \n // Active and completed states - fill the star icon, keep others as stroke\n &.s-tiered-offer-milestone-active,\n &.s-tiered-offer-milestone-completed {\n svg {\n path {\n fill: currentColor;\n stroke: none;\n }\n \n // For stroke-based icons (crown, stars, diamond) \n &[fill=\"none\"] path {\n fill: none;\n stroke: currentColor;\n }\n }\n }\n}\n\n// RTL Support \n[dir=\"rtl\"] {\n .s-tiered-offer-progress-wrapper {\n .s-tiered-offer-progress-bg {\n transform: scaleX(-1);\n }\n \n .s-tiered-offer-progress-fill {\n transform: scaleX(-1);\n left: auto;\n }\n }\n\n .flip-x {\n transform: scaleX(-1);\n }\n}\n","import { Component, Host, h, State } from '@stencil/core';\nimport { Offer, TieredOfferTier, TieredOfferData, DiscountType } from './interfaces';\nimport { TIERED_OFFER_CONFIG } from './constants';\nimport { TierUtils } from './utils';\n\n@Component({\n tag: 'salla-tiered-offer',\n styleUrl: 'salla-tiered-offer.scss',\n})\nexport class SallaTieredOffer {\n\n constructor() {\n salla.lang.onLoaded(() => {\n this.loyaltyProgramText = salla.lang.get('blocks.tiered_offer.program_title');\n this.currentTierText = salla.lang.get('blocks.tiered_offer.current_tier');\n this.discountText = salla.lang.get('blocks.tiered_offer.discount');\n this.benefitText = salla.lang.get('blocks.tiered_offer.tier_description');\n });\n }\n\n\n @State() tieredOfferData: TieredOfferData;\n @State() apiOfferData: Offer;\n @State() currentTierIndex: number = 0;\n @State() currentTier: string;\n @State() activeTabTier: string;\n\n @State() canRender: boolean = false;\n @State() isLoading: boolean = false;\n\n // Language strings\n @State() loyaltyProgramText: string;\n @State() currentTierText: string;\n @State() discountText: string;\n @State() benefitText: string;\n\n async componentWillLoad() {\n try {\n await salla.onReady();\n \n if (!this.checkFeatureEnabled()) {\n return;\n }\n \n if (!this.checkCartExists()) {\n return;\n }\n \n this.isLoading = true;\n \n const offerData = await this.fetchTieredOfferData();\n if (!offerData) {\n return;\n }\n \n this.initializeComponent(offerData);\n \n } catch (error) {\n this.canRender = false;\n salla.logger.warn('salla-tiered-offer:: ', error);\n } finally {\n this.isLoading = false;\n }\n }\n \n private checkFeatureEnabled(): boolean {\n return salla.config.get('store.features')?.includes('tiered-offer');\n }\n \n private checkCartExists(): boolean {\n return !!salla.storage.get(\"cart\")?.summary?.count;\n }\n \n private validateCouponCompatibility(offerData: Offer, cartCoupon?: any): boolean {\n // If coupon is applied but offer doesn't support coupons, widget should be hidden\n return !(cartCoupon && !offerData.details?.applied_with_coupon);\n }\n \n private async fetchTieredOfferData(): Promise<Offer | null> {\n try {\n const { data }: { data: Offer[] } = await salla.api.cart.offers();\n const tieredOffer = data.find(offer => offer.type === \"tiered_offer\");\n \n if (!tieredOffer) {\n return null;\n }\n \n // Hide widget if coupon is applied and offer doesn't support coupons\n if (!this.validateCouponCompatibility(tieredOffer, salla.storage.get(\"cart\")?.coupon)) {\n this.canRender = false;\n return null;\n }\n \n return tieredOffer;\n } catch (error) {\n throw error;\n }\n }\n \n private initializeComponent(apiOfferData: Offer): void {\n this.apiOfferData = apiOfferData;\n \n // Map tiered details data to component format\n this.tieredOfferData = this.mapApiDataToTiers(this.apiOfferData);\n this.loyaltyProgramText = this.apiOfferData.title || this.loyaltyProgramText;\n \n // Find current tier index based on current_value from API\n const currentValue = this.apiOfferData.details?.current_value || 0;\n const currentTierIndex = this.findCurrentTierIndex(currentValue);\n \n // Only render if user has reached at least the first tier\n if (currentTierIndex === 0) {\n this.canRender = false;\n return;\n }\n \n this.currentTierIndex = currentTierIndex;\n this.currentTier = TierUtils.getTierNameByIndex(this.tieredOfferData.tiers, currentTierIndex);\n this.activeTabTier = this.currentTier;\n this.canRender = true;\n }\n\n componentDidLoad() {\n salla.event.on(\"cart::updated\", (updatedCart) => {\n this.updateOfferValues(updatedCart);\n });\n }\n\n private mapApiDataToTiers(apiData: Offer): TieredOfferData {\n // Sort discounts by min_spend to create proper tier order\n const sortedDiscounts = [...apiData.details.discounts].sort((a, b) => a.min_spend - b.min_spend);\n\n const tiers: TieredOfferTier[] = sortedDiscounts.map((discount, index) => ({\n name: discount.name, \n tier_name: discount.name, \n discount: discount.type === DiscountType.PERCENTAGE ? `${salla.helpers.number(discount.value)}%` : salla.money(discount.value),\n icon: TIERED_OFFER_CONFIG.staticIcons[index] || TIERED_OFFER_CONFIG.staticIcons[0], \n threshold: discount.min_spend,\n text_color: TIERED_OFFER_CONFIG.staticColors[index], \n index: index + 1\n }));\n\n return {\n current_tier: TierUtils.getTierNameByIndex(tiers, this.findCurrentTierIndex(apiData.details.current_value, tiers)),\n tiers\n };\n }\n\n private findCurrentTierIndex(currentValue: number, tiers = this.tieredOfferData?.tiers): number {\n return TierUtils.findCurrentTierIndex(currentValue, tiers || []);\n }\n\n private updateOfferValues(updatedCart: { items: any[], sub_total: number, coupon?: any }) {\n if (!this.apiOfferData || !this.tieredOfferData) {\n return;\n }\n\n // Check coupon compatibility\n if (!this.validateCouponCompatibility(this.apiOfferData, updatedCart.coupon)) {\n this.canRender = false;\n return;\n }\n\n // If no coupon conflict, show widget\n this.canRender = true;\n\n // Check if this offer should update with cart changes\n if (this.apiOfferData.details?.with_current_cart === false) {\n return;\n }\n\n // Update current_value in API offer data\n const currentValue = updatedCart.sub_total;\n this.apiOfferData = {\n ...this.apiOfferData,\n details: {\n ...this.apiOfferData.details,\n current_value: currentValue\n }\n };\n\n // Update current tier based on new value\n const newTierIndex = this.findCurrentTierIndex(currentValue);\n \n // Check if user qualifies for any tier\n if (newTierIndex === 0) {\n this.canRender = false;\n return;\n }\n\n // user qualifies show widget\n this.canRender = true;\n this.currentTierIndex = newTierIndex;\n this.currentTier = TierUtils.getTierNameByIndex(this.tieredOfferData.tiers, newTierIndex);\n \n // Update active tab if needed\n if (this.activeTabTier !== this.currentTier) {\n this.activeTabTier = this.currentTier;\n }\n }\n\n private getLoadingSkeletonView() {\n return <Host>\n <div class=\"s-tiered-offer-container\">\n <div class=\"s-tiered-offer-skeleton-wrapper\">\n <div class=\"s-tiered-offer-skeleton-title\">\n <salla-skeleton height=\"16px\" width=\"40%\" />\n </div>\n <div class=\"s-tiered-offer-skeleton-subtitle\">\n <salla-skeleton height=\"20px\" width=\"60%\" />\n </div>\n <div class=\"s-tiered-offer-skeleton-progress\">\n <salla-skeleton height=\"16px\" width=\"100%\" />\n </div>\n <div class=\"s-tiered-offer-skeleton-tabs\">\n <salla-skeleton height=\"50px\" width=\"100%\" />\n </div>\n </div>\n </div>\n </Host>\n }\n\n private getCurrentTierData(): TieredOfferTier {\n return TierUtils.findTierByIndex(this.tieredOfferData.tiers, this.currentTierIndex) || this.tieredOfferData.tiers[0];\n }\n\n private getProgressWidth(): number {\n const currentValue = this.apiOfferData.details?.current_value || 0;\n const totalTiers = this.tieredOfferData.tiers.length;\n \n // Use existing method to find current tier index (which already handles the logic)\n const currentTierIndex = this.findCurrentTierIndex(currentValue);\n \n // Convert to 0-based index for progress calculation\n const completedTiers = currentTierIndex;\n return (completedTiers / totalTiers) * 100;\n }\n\n private handleTabClick = (tierName: string) => {\n this.activeTabTier = tierName;\n }\n \n private calculateMilestonePosition(index: number, totalTiers: number): string {\n if (totalTiers === 1) {\n return 'calc(100% - 18px)';\n }\n const milestonePercent = ((index + 1) / totalTiers) * 100;\n const offsetPercent = 8 / totalTiers;\n return `${Math.max(2, Math.min(95, milestonePercent - offsetPercent))}%`;\n }\n \n private getMilestoneStyles(tier: TieredOfferTier, index: number, totalTiers: number) {\n const isRtl = document.documentElement.dir === 'rtl';\n const adjustedPercent = this.calculateMilestonePosition(index, totalTiers);\n const alignItems = tier.name.length > 6 ? 'flex-end' : 'center';\n \n return {\n [isRtl ? 'right' : 'left']: adjustedPercent,\n alignItems,\n position: 'absolute' as const,\n transform: isRtl ? 'translateX(50%)' : 'translateX(-50%)'\n };\n }\n \n private getMilestoneIconStyles(tier: TieredOfferTier, isCurrent: boolean, isReached: boolean) {\n if (isCurrent) {\n return { color: tier.text_color };\n }\n if (isReached) {\n return { color: 'var(--color-primary)' };\n }\n return {};\n }\n \n private renderProgressBarBackground(progressWidth: number) {\n return [\n <div class=\"s-tiered-offer-progress-bg\"></div>,\n <div \n class=\"s-tiered-offer-progress-fill\"\n style={{ width: `${progressWidth}%` }}>\n </div>\n ];\n }\n \n private renderMilestoneIcon(tier: TieredOfferTier, isCurrent: boolean, isReached: boolean) {\n const iconClasses = [\n 's-tiered-offer-milestone-icon',\n isCurrent ? 's-tiered-offer-milestone-active' : '',\n isReached ? 's-tiered-offer-milestone-completed' : ''\n ].filter(Boolean).join(' ');\n \n return (\n <div \n class={iconClasses}\n style={this.getMilestoneIconStyles(tier, isCurrent, isReached)}>\n <span innerHTML={tier.icon}></span>\n </div>\n );\n }\n \n private renderMilestoneName(tier: TieredOfferTier, isCurrent: boolean) {\n return (\n <div class=\"s-tiered-offer-milestone-name\">\n {isCurrent && (\n <span style={{ color: tier.text_color }}>\n {tier.name}\n </span>\n )}\n </div>\n );\n }\n \n private renderMilestones(currentValue: number, totalTiers: number) {\n const containerClass = totalTiers === 1 \n ? 's-tiered-offer-single-milestone-justify-end' \n : 's-tiered-offer-milestones';\n \n return (\n <div class=\"s-tiered-offer-milestones-wrapper\">\n <div class={containerClass}>\n {this.tieredOfferData.tiers.map((tier, index) => {\n const isReached = currentValue >= tier.threshold;\n const isCurrent = tier.tier_name === this.currentTier;\n \n return (\n <div \n class=\"s-tiered-offer-milestone\"\n style={this.getMilestoneStyles(tier, index, totalTiers)}>\n {this.renderMilestoneIcon(tier, isCurrent, isReached)}\n {this.renderMilestoneName(tier, isCurrent)}\n </div>\n );\n })}\n </div>\n </div>\n );\n }\n\n private renderProgressBar() {\n const progressWidth = this.getProgressWidth();\n const totalTiers = this.tieredOfferData.tiers.length;\n const currentValue = this.apiOfferData.details?.current_value || 0;\n\n return (\n <div class=\"s-tiered-offer-progress-container\">\n <div class=\"s-tiered-offer-progress-wrapper\">\n {this.renderProgressBarBackground(progressWidth)}\n {this.renderMilestones(currentValue, totalTiers)}\n </div>\n </div>\n );\n }\n\n private renderTabs() {\n return (\n <div class=\"s-tiered-offer-tabs-container\">\n {/* Tab Headers */}\n <div class=\"s-tiered-offer-tab-headers\">\n {this.tieredOfferData.tiers.map(tier => {\n const isActive = tier.tier_name === this.activeTabTier;\n return (\n <button \n class={`s-tiered-offer-tab-header ${isActive ? 's-tiered-offer-tab-active' : ''}`}\n onClick={() => this.handleTabClick(tier.tier_name)}>\n <span>{tier.name}</span>\n </button>\n );\n })}\n </div>\n\n {/* Tab Content */}\n <div class=\"s-tiered-offer-tab-content-wrapper\">\n {(() => {\n const activeTier = TierUtils.findTierByName(this.tieredOfferData.tiers, this.activeTabTier);\n if (!activeTier) return null;\n \n return (\n <div class=\"s-tiered-offer-tab-content\">\n <div class=\"s-tiered-offer-tab-content-inner\">\n <div class=\"s-tiered-offer-discount-section\">\n <p class=\"s-tiered-offer-discount-title\">\n {this.discountText} <span innerHTML={activeTier.discount}></span>\n </p>\n <p class=\"s-tiered-offer-benefit-description\">\n {this.benefitText} {activeTier.name}\n </p>\n </div>\n </div>\n </div>\n );\n })()}\n </div>\n </div>\n );\n }\n\n render() {\n \n if (this.isLoading) {\n return this.getLoadingSkeletonView();\n }\n\n if (!this.canRender || !this.tieredOfferData) {\n return null;\n }\n \n\n const currentTierData = this.getCurrentTierData();\n\n return (\n <Host>\n <div class=\"s-tiered-offer-container\">\n {/* Header Section */}\n <div class=\"s-tiered-offer-header\">\n <div class=\"s-tiered-offer-header-content\">\n <p class=\"s-tiered-offer-program-title\">{this.loyaltyProgramText}</p>\n <div class=\"s-tiered-offer-current-tier-name-wrapper\">\n <h2 class=\"s-tiered-offer-current-tier\">\n {this.currentTierText} <span class=\"s-tiered-offer-tier-name\">{currentTierData.name}</span>\n </h2>\n <span innerHTML={currentTierData.icon}></span>\n </div>\n </div>\n </div>\n\n {/* Progress Bar */}\n {this.renderProgressBar()}\n\n {/* Tabs */}\n {this.renderTabs()}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":";;;qJAAA,IAAYA,GAAZ,SAAYA,GACVA,EAAA,2BACAA,EAAA,gBACD,EAHD,CAAYA,MAGX,K,20ICGM,IAAMC,EAAyC,CACpDC,YAAa,CAACC,EAAUC,EAAWC,EAAUC,GAC7CC,aAAc,CAAC,UAAW,UAAW,UAAW,Y,8BC6BjD,CA/BQC,EAAAC,gBAAP,SAAuBC,EAA0BC,GAC/C,OAAOD,EAAME,MAAK,SAAAC,GAAQ,OAAAA,EAAKF,QAAUA,CAAf,KAAyB,I,EAM9CH,EAAAM,eAAP,SAAsBJ,EAA0BK,GAC9C,OAAOL,EAAME,MAAK,SAAAC,GAAQ,OAAAA,EAAKG,YAAcD,CAAnB,KAAgC,I,EAMrDP,EAAAS,mBAAP,SAA0BP,EAA0BC,G,MAClD,OAAOO,EAAAC,KAAKV,gBAAgBC,EAAOC,MAAQ,MAAAO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s,H as a,g as i}from"./p-5Ng8LPjI.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:"56540a5278d395485a411e712929f32cf76f637e"},s("div",{key:"63673b28b671596d47f4f014223e9c5012f3b671",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:"6d9ffa722391aa0234454fe9ddc90f3477268489",class:"s-booking-field-book-now",size:"small",loaderPosition:"center",fill:"outline",onClick:e=>this.openBookingModal(e,false)},s("span",{key:"dcc8a2b68be4596199e7c776f4501764fd25523f",class:"s-booking-field-book-now-content"},s("span",{key:"b4b2eaf369a5fa822c84b376808c7ee16d8d2598",innerHTML:n}),this.reservations.length?this.editLabel:this.bookNowLabel))),this.reservations.length>0&&s("div",{key:"2684b88bdaf47133dbcaaf6c96f1b81d4ee7ca70",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:"3d20fcb5fbca8a9e340344d41c316619aec03050",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:"aed72d12357c54338c231d5d4c259a510f8b4e95"},s("slot",{key:"84c5af881a45cee9fa71f5e2e63ee9b92aad76c9"}))}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-DJeJWTdD.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:"56540a5278d395485a411e712929f32cf76f637e"},s("div",{key:"63673b28b671596d47f4f014223e9c5012f3b671",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:"6d9ffa722391aa0234454fe9ddc90f3477268489",class:"s-booking-field-book-now",size:"small",loaderPosition:"center",fill:"outline",onClick:e=>this.openBookingModal(e,false)},s("span",{key:"dcc8a2b68be4596199e7c776f4501764fd25523f",class:"s-booking-field-book-now-content"},s("span",{key:"b4b2eaf369a5fa822c84b376808c7ee16d8d2598",innerHTML:n}),this.reservations.length?this.editLabel:this.bookNowLabel))),this.reservations.length>0&&s("div",{key:"2684b88bdaf47133dbcaaf6c96f1b81d4ee7ca70",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:"3d20fcb5fbca8a9e340344d41c316619aec03050",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:"aed72d12357c54338c231d5d4c259a510f8b4e95"},s("slot",{key:"84c5af881a45cee9fa71f5e2e63ee9b92aad76c9"}))}get host(){return i(this)}};export{c as salla_booking_field,d as salla_conditional_fields};
|
|
5
|
+
//# sourceMappingURL=p-8d171391.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,s,e,n){function i(t){return t instanceof e?t:new e((function(s){s(t)}))}return new(e||(e=Promise))((function(e,r){function c(t){try{a(n.next(t))}catch(t){r(t)}}function o(t){try{a(n["throw"](t))}catch(t){r(t)}}function a(t){t.done?e(t.value):i(t.value).then(c,o)}a((n=n.apply(t,s||[])).next())}))};var __generator=this&&this.__generator||function(t,s){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,c;return c={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function o(t){return function(s){return a([t,s])}}function a(o){if(n)throw new TypeError("Generator is already executing.");while(c&&(c=0,o[0]&&(e=0)),e)try{if(n=1,i&&(r=o[0]&2?i["return"]:o[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;if(i=0,r)o=[o[0]&2,r.value];switch(o[0]){case 0:case 1:r=o;break;case 4:e.label++;return{value:o[1],done:false};case 5:e.label++;i=o[1];o=[0];continue;case 7:o=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){e.label=o[1];break}if(o[0]===6&&e.label<r[1]){e.label=r[1];r=o;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(o);break}if(r[2])e.ops.pop();e.trys.pop();continue}o=s.call(t,e)}catch(t){o=[6,t];i=0}finally{n=r=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-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-1xnr2J3b.system.js","./p-BAa1Mtv9.system.js","./p-Ik1kuM1-.system.js"],(function(t){"use strict";var s,e,n,i,r;return{setters:[function(t){s=t.r;e=t.h},function(t){n=t.S;i=t.A},function(t){r=t.G}],execute:function(){var c='\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>tag-money</title>\n<path d="M20.567 11.433c-0.521-0.521-1.364-0.521-1.885 0l-0.524 0.524c-1.28-0.819-3.091-0.681-4.191 0.419-0.631 0.631-0.976 1.468-0.976 2.359 0 0.889 0.347 1.727 0.976 2.357l0.943 0.943c0.171 0.171 0.195 0.368 0.195 0.472s-0.025 0.301-0.196 0.472c-0.169 0.169-0.367 0.195-0.471 0.195s-0.301-0.025-0.472-0.195l-2.357-2.357c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l0.944 0.941-0.472 0.472c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l0.519-0.519c0.54 0.359 1.173 0.553 1.837 0.553 0.892 0 1.729-0.348 2.357-0.976 0.631-0.631 0.976-1.467 0.976-2.357s-0.347-1.727-0.976-2.357l-0.943-0.943c-0.26-0.26-0.26-0.684 0-0.944 0.259-0.259 0.683-0.261 0.944 0l1.885 1.887c0.521 0.521 1.364 0.521 1.885 0 0.521-0.52 0.521-1.364 0-1.885l-0.472-0.472 0.472-0.472c0.521-0.521 0.521-1.365 0.001-1.887zM28 0h-9.344c-1.059 0-2.056 0.411-2.809 1.153l-14.673 14.456c-1.56 1.56-1.561 4.097-0.001 5.657l9.56 9.56c0.755 0.755 1.76 1.172 2.828 1.173h0.003c1.068 0 2.072-0.416 2.833-1.179l14.451-14.668c0.743-0.753 1.153-1.751 1.153-2.809v-9.344c0-2.205-1.795-4-4-4zM29.333 13.344c0 0.353-0.137 0.685-0.385 0.937l-14.444 14.661c-0.252 0.252-0.587 0.391-0.941 0.391-0.001 0-0.001 0-0.001 0-0.356-0.001-0.691-0.139-0.943-0.392l-9.561-9.56c-0.52-0.52-0.52-1.365-0.005-1.88l14.667-14.449c0.253-0.248 0.585-0.385 0.937-0.385h9.344c0.736 0 1.333 0.597 1.333 1.333zM24 6.673c-0.737 0-1.333 0.604-1.333 1.341s0.596 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.015c0-0.737-0.596-1.327-1.333-1.327z"></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>fire</title>\n<path d="M21.56 3.009c-0.052-0.047-0.116-0.065-0.173-0.103-0.073-0.048-0.143-0.1-0.223-0.132-0.083-0.033-0.165-0.047-0.252-0.063-0.081-0.016-0.16-0.035-0.243-0.035-0.089 0-0.172 0.020-0.26 0.037-0.080 0.016-0.159 0.028-0.236 0.059-0.084 0.035-0.157 0.088-0.235 0.14-0.053 0.036-0.115 0.053-0.165 0.097-0.049 0.044-0.988 0.895-2.288 2.255-2.364-2.839-4.476-4.815-4.576-4.908-0.056-0.052-0.127-0.075-0.188-0.115-0.075-0.049-0.143-0.105-0.224-0.137-0.080-0.032-0.163-0.041-0.245-0.057-0.085-0.016-0.167-0.040-0.252-0.040-0.084 0-0.163 0.023-0.245 0.039-0.087 0.016-0.172 0.025-0.253 0.059-0.080 0.032-0.147 0.087-0.22 0.135-0.063 0.041-0.133 0.064-0.189 0.116-0.453 0.423-11.092 10.408-11.092 18.095 0 7.977 4.935 13.549 12 13.549h8.667c6.673 0 11.333-5.115 11.333-12.439 0-7.052-10.013-16.167-10.44-16.552zM20.667 29.333h-7.777c-2.924 0-4.889-2.044-4.889-5.084 0-2.317 2.816-6.441 4.888-8.887 0.76 0.909 2.755 3.397 3.969 5.869 0.212 0.431 0.639 0.715 1.117 0.743 0.489 0.031 0.937-0.203 1.197-0.605 0.552-0.849 1.109-1.596 1.497-2.093 1.491 1.897 3.331 4.78 3.331 6.399 0 2.188-1.34 3.659-3.333 3.659zM26.537 27.052c0.081-0.44 0.129-0.899 0.129-1.377 0-3.269-3.713-7.847-4.46-8.735l-0.523-0.617c-0.507-0.599-1.528-0.599-2.035 0l-0.531 0.627c-0.147 0.175-0.495 0.599-0.936 1.187-1.595-2.597-3.495-4.776-3.595-4.889l-0.697-0.793c-0.507-0.577-1.499-0.577-2.004 0l-0.697 0.795c-0.6 0.684-5.856 6.803-5.856 11.001 0 0.881 0.127 1.712 0.356 2.484-1.896-1.933-3.023-4.821-3.023-8.283 0-4.915 6.073-11.997 9.329-15.255 1.001 1.008 2.692 2.789 4.368 4.927 0.243 0.309 0.609 0.496 1.001 0.509h0.048c0.376 0 0.735-0.159 0.988-0.439 0.889-0.981 1.693-1.795 2.269-2.359 3.051 2.965 8.663 9.323 8.663 13.727 0 3.171-1.031 5.769-2.796 7.491z"></path>\n</svg>\n';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>discount-coupon</title>\n<path d="M27 28h-22c-0.552 0-1-0.448-1-1v0c0-1.657-1.343-3-3-3v0c-0.552 0-1-0.448-1-1v0-12c0-0.552 0.448-1 1-1v0c1.657 0 3-1.343 3-3v0c0-0.552 0.448-1 1-1v0h22c0.552 0 1 0.448 1 1v0c0 1.657 1.343 3 3 3v0c0.552 0 1 0.448 1 1v0 12c0 0.552-0.448 1-1 1v0c-1.657 0-3 1.343-3 3v0c0 0.552-0.448 1-1 1v0zM5.9 26h20.2c0.415-1.964 1.936-3.485 3.867-3.894l0.033-0.006v-10.2c-1.964-0.415-3.485-1.936-3.894-3.867l-0.006-0.033h-20.2c-0.415 1.964-1.936 3.485-3.867 3.894l-0.033 0.006v10.2c1.964 0.415 3.485 1.936 3.894 3.867l0.006 0.033zM20 7h2v3h-2v-3zM20 12h2v4h-2v-4zM20 18h2v4h-2v-4zM20 24h2v3h-2v-3zM9 16c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM9 12c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM15 24c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM15 20c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM7 24c-0.552-0-1-0.448-1-1 0-0.244 0.088-0.468 0.233-0.642l-0.001 0.002 10-12c0.185-0.221 0.461-0.36 0.769-0.36 0.553 0 1.001 0.448 1.001 1.001 0 0.245-0.088 0.469-0.233 0.643l0.001-0.002-10 12c-0.185 0.22-0.46 0.358-0.767 0.358-0.001 0-0.002 0-0.003 0h0z"></path>\n</svg>\n';var l=":host{display:block}";var f=t("salla_cart_item_offers",function(){function t(t){var e=this;s(this,t);this.internalOffers=[];this.showAll=false;this.freeLabel="";this.receivedOffer="";this.discountAmountLabel="";this.showMoreOffers="";this.icons={DiscountCouponIcon:a,GiftIcon:r,FireIcon:o,SpecialDiscountIcon:n,TagMoneyIcon:c};this.visibleOffersCount=3;this.handleCartItemUpdated=function(t){var s=t.data.cart.items.find((function(t){return t.id===e.itemId}));if((s===null||s===void 0?void 0:s.id)===e.itemId){e.internalQuantity=s.quantity;e.internalOffers=s.detailed_offers||[];e.internalProductPrice=s.product_price}};this.toggleShowAll=function(){e.showAll=!e.showAll}}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(s){switch(s.label){case 0:return[4,Salla.onReady()];case 1:s.sent();return[4,salla.lang.onLoaded((function(){t.freeLabel=salla.lang.get("common.elements.freeExclam");t.receivedOffer=salla.lang.get("pages.cart.received_offer");t.discountAmountLabel=salla.lang.get("pages.cart.discount_amount");t.showMoreOffers=salla.lang.get("pages.cart.show_more_offers")}))];case 2:s.sent();this.internalQuantity=this.quantity;this.internalOffers=this.parseOffers(this.offers);this.internalProductPrice=this.productPrice;return[2]}}))}))};t.prototype.componentDidLoad=function(){var t=this;salla.event.on("cart::item.updated",(function(s){return t.handleCartItemUpdated(s)}))};t.prototype.parseOffers=function(t){try{if(typeof t!=="string"){console.warn("Offers is not a string. Returning as-is.",t);return Array.isArray(t)?t:[]}return JSON.parse(t||"[]")}catch(t){console.error("Failed to parse offers",t);return[]}};Object.defineProperty(t.prototype,"visibleOffers",{get:function(){return this.internalOffers.slice(0,this.visibleOffersCount)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"hiddenOffers",{get:function(){return this.internalOffers.slice(this.visibleOffersCount)},enumerable:false,configurable:true});t.prototype.getPaidQty=function(t,s){return t-s.free_quantity};t.prototype.renderOffer=function(t,s){var n=this.getPaidQty(t,s);return e("div",{class:"s-cart-item-offers-box"},s.free_quantity>0&&n>0&&e("div",{class:"s-cart-item-offers-paid-free"},e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(n)," × ",e("span",{innerHTML:salla.money(this.internalProductPrice)})),e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(s.free_quantity)," ×",e("span",{class:"s-cart-item-offers-regular-price",innerHTML:salla.money(this.internalProductPrice)}),e("span",{class:"s-cart-item-offers-free-label"},this.freeLabel))),e("div",{class:"s-cart-item-offers-details"},e("span",{class:"s-cart-item-offers-icon",innerHTML:this.icons[s.discount_icon]||""}),e("div",null,e("p",{class:"s-cart-item-offers-title"},this.receivedOffer.replace(":offer",s.offer_name)),e("p",{class:"s-cart-item-offers-discount"},e("span",{innerHTML:this.discountAmountLabel.replace(":amount",salla.money(s.discount_amount.toFixed(2)))})))))};t.prototype.render=function(){var t=this;var s,n;if(!((s=this.internalOffers)===null||s===void 0?void 0:s.length)){return null}return e("div",{class:"s-cart-item-offers-container",id:"offers_list_".concat(this.itemId)},this.visibleOffers.map((function(s){return t.renderOffer(t.internalQuantity,s)})),((n=this.internalOffers)===null||n===void 0?void 0:n.length)>this.visibleOffersCount&&e("div",{class:"s-cart-item-offers-show-more"},e("button",{class:"s-cart-item-offers-show-more-btn",onClick:this.toggleShowAll,type:"button"},e("span",{class:"s-cart-item-offers-show-more-label"},"+",this.hiddenOffers.length," ",this.showMoreOffers,e("span",{innerHTML:i,class:{"s-cart-item-offers-arrow-icon":true,"s-cart-item-offers-arrow-open":this.showAll}})))),this.showAll&&e("div",{class:"s-cart-item-offers-collapsed",id:"offers_".concat(this.itemId)},this.hiddenOffers.map((function(s){return t.renderOffer(t.internalQuantity,s)}))))};return t}());f.style=l}}}));
|
|
5
|
+
//# sourceMappingURL=p-8d241400.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as s,H as a,g as c}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as t,h as s,H as a,g as c}from"./p-DJeJWTdD.js";import{w as e}from"./p-DWksgowB.js";import{M as n}from"./p-DmgxDvXL.js";var i=`\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>iphone</title>\n<path d="M15.053 27.613c0.133 0.12 0.28 0.213 0.44 0.28s0.333 0.107 0.507 0.107c0.36 0 0.693-0.135 0.947-0.387 0.12-0.135 0.213-0.28 0.28-0.44 0.080-0.16 0.107-0.333 0.107-0.507 0-0.347-0.147-0.695-0.387-0.947-0.507-0.493-1.387-0.493-1.893 0-0.12 0.12-0.213 0.267-0.28 0.44-0.067 0.16-0.107 0.333-0.107 0.507s0.040 0.347 0.107 0.507 0.16 0.305 0.28 0.44zM24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.599 1.333-1.333 1.333h-16c-0.735 0-1.333-0.597-1.333-1.333v-4h18.667zM25.333 21.333h-18.667v-17.333c0-0.735 0.599-1.333 1.333-1.333h16c0.735 0 1.333 0.599 1.333 1.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>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></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>paper-plane-o</title>\n<path d="M31.5 0.482c0.375 0.268 0.554 0.696 0.482 1.143l-4.571 27.429c-0.054 0.339-0.268 0.625-0.571 0.804-0.161 0.089-0.357 0.143-0.554 0.143-0.143 0-0.286-0.036-0.429-0.089l-9.411-3.839-5.321 5.839c-0.214 0.25-0.518 0.375-0.839 0.375-0.143 0-0.286-0.018-0.411-0.071-0.446-0.179-0.732-0.607-0.732-1.071v-8.071l-8.429-3.446c-0.411-0.161-0.679-0.536-0.714-0.982-0.036-0.429 0.196-0.839 0.571-1.054l29.714-17.143c0.375-0.232 0.857-0.214 1.214 0.036zM25.393 27.25l3.946-23.625-25.607 14.768 6 2.446 15.411-11.411-8.536 14.232z"></path>\n</svg>\n`;const h=".unicode{unicode-bidi:-webkit-plaintext;unicode-bidi:plaintext}";const r=class{constructor(s){t(this,s);var a;this.contacts=salla.config.get("store.contacts");this.iconsList={mobile:i,whatsapp:e,phone:o,telegram:l,email:n};this.contactSlot=((a=this.host.querySelector('[slot="contact"]'))===null||a===void 0?void 0:a.innerHTML)||`<a href={link} class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>${!this.iconsOnly&&"<span class='unicode'>{value}</span>"}</a>`;salla.onReady((()=>{this.contacts=salla.config.get("store.contacts")}));salla.lang.onLoaded((()=>{this.contactsTitle=this.contactsTitle||salla.lang.get("blocks.footer.social")}))}getContactsArray(){return Object.entries(this.contacts).filter((([t,s])=>s!=="")).map((([t,s])=>({type:t,value:s})))}getContactLink(t){const s=this.contacts[t];switch(t){case"phone":case"mobile":return`tel:${s}`;case"whatsapp":return salla.url.get("whatsapp/send");case"email":return`mailto:${s}`;case"telegram":return s.startsWith("https://t.me/")?s:`https://t.me/${s}`;default:return s}}getContactIcon(t){return this.iconsList[t]}componentWillLoad(){return new Promise((t=>salla.onReady(t)))}render(){const t=this.getContactsArray();if(!t||t.length==0){return}if(this.isHeader){return s(a,{class:"s-contacts s-contacts-header"},t.filter((t=>t.type=="phone"||t.type=="email")).map(((t,a)=>s("a",{href:this.getContactLink(t.type),key:a,class:"s-contacts-topnav-link"},t.type==="email"?t.value:[s("span",null,this.contactsTitle,": "),s("a",{class:"unicode",href:this.iconsList[t.type]},t.value)]))))}return s(a,{class:"s-contacts"},!this.hideTitle&&s("h3",{class:"s-contacts-title"},this.contactsTitle),s("div",{class:{"s-contacts-list":true,"s-contacts-list-horizontal":this.horizontal,"s-contacts-list-vertical":!this.horizontal,"s-contacts-list-icons-only":this.iconsOnly}},t.map(((t,a)=>s("div",{key:a,id:"contact-slot",innerHTML:this.contactSlot.replace(/\{icon\}/g,this.getContactIcon(t.type)).replace(/\{value\}/g,t.value.toString()).replace(/\{link\}/g,this.getContactLink(t.type))})))))}componentDidRender(){var t;(t=this.host.querySelector('[slot="contact"]'))===null||t===void 0?void 0:t.remove()}get host(){return c(this)}};r.style=h;export{r as salla_contacts};
|
|
5
|
+
//# sourceMappingURL=p-8f504c22.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-1xnr2J3b.system.js"],(function(t){"use strict";var e,i,n;return{setters:[function(t){e=t.r;i=t.h;n=t.g}],execute:function(){var o='.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%)}';var s=t("salla_tooltip",function(){function t(t){e(this,t);this.show=false;this.targetElement=null}t.prototype.handleMouseOver=function(t){if(this.targetElement&&this.targetElement.contains(t.target)){this.show=true}};t.prototype.handleMouseOut=function(t){if(this.targetElement&&this.targetElement.contains(t.target)){this.show=false}};t.prototype.componentDidLoad=function(){this.targetElement=document.getElementById(this.targetId)};t.prototype.render=function(){return i("div",{key:"87a485eeb144377502782b6a7ac61417349423e2",class:"s-tooltip-container"},i("slot",{key:"8329e929fce52cd2ef4f9258548770576e67ee96"}),this.show&&i("div",{key:"18f9cd55110713d0b472601dc0a9ef20dd31af19",class:"s-tooltip-item"},this.text))};Object.defineProperty(t.prototype,"el",{get:function(){return n(this)},enumerable:false,configurable:true});return t}());s.style=o}}}));
|
|
5
|
+
//# sourceMappingURL=p-96c0dbe6.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 t,H as i,g as a}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as s,h as t,H as i,g as a}from"./p-DJeJWTdD.js";const e=":host{display:block}";const l=class{constructor(t){s(this,t);this.exclude=[]}componentWillLoad(){return salla.onReady().then((()=>{var s,t,i;if(typeof this.exclude==="string"){try{this.exclude=JSON.parse(this.exclude)}catch(s){salla.logger.error("salla-payments:: failed to parse the exclude props!",this.exclude);this.exclude=[]}}this.placeholderImage=salla.url.cdn(`images/s-empty.png`);this.paymentSlot=((s=this.host.querySelector('[slot="payment"]'))===null||s===void 0?void 0:s.innerHTML)||`<li class="s-payments-list-item"><img class="lazy" width="100%" height="100%" src="${this.placeholderImage}" data-src="{image}" alt={payment} /><li>`;this.sbcSlot=((t=this.host.querySelector('[slot="sbc"]'))===null||t===void 0?void 0:t.innerHTML)||`<li class="s-payments-list-item"><a target="_blank" href="{link}"> <img width="100%" height="100%" src="${this.placeholderImage}" data-src={image} class="lazy s-payments-sbc-image" alt="SBC"/></a><li>`;this.codSlot=((i=this.host.querySelector('[slot="cod"]'))===null||i===void 0?void 0:i.innerHTML)||`<li class="s-payments-list-item"> <img width="100%" height="100%" src="${this.placeholderImage}" data-src={image} class="lazy" alt="COD"/><li>`;this.payments=salla.config.get("store.settings.payments")}))}render(){const s=!this.exclude.includes("made-in-ksa")&&salla.config.get("store.settings.made_in_ksa");const a=this.exclude.includes("sbc")?null:salla.config.get("store.settings.certificate.id");return t(i,{key:"6c8a1fd050822882224ee1e419f6f6dbdbfaf12d",class:"s-payments-list-wrap"},t("ul",{key:"773195024ce6f616ad9b87091c8ddfd0e153f9ec",class:"s-payments-list"},s&&t("li",{key:"203bebb61c41ca108c0ec969661d5922db2ac378",class:"s-payments-list-item"},t("img",{key:"a687fac0d968f0485a0a59d1205a0f0db1f100f4",class:"lazy",width:"100%",height:"100%",decoding:"async",loading:"lazy","data-src":salla.url.cdn(`images/made-in-ksa.svg`,58,58),alt:"made in KSA certified"})),this.payments.map((s=>s=="cod"?t("div",{id:"cod-slot",innerHTML:this.codSlot.replace(/\{image\}/g,salla.url.cdn(`images/payment/cod_mini.png`,58,58))}):t("div",{id:"payment-slot",innerHTML:this.paymentSlot.replace(/\{image\}/g,salla.url.cdn(`images/payment/${s}_mini.png`,58,58)).replace(/\{payment\}/g,s)}))),a&&t("div",{key:"f571920327b81c48f502c1d6e497955978634c08",id:"sbc-slot",innerHTML:this.sbcSlot.replace(/\{image\}/g,salla.url.cdn(`images/sbc.png`,58,58)).replace(/\{link\}/g,`https://eauthenticate.saudibusiness.gov.sa/certificate-details/${a}`)})))}componentDidLoad(){var s;(s=document.lazyLoadInstance)===null||s===void 0?void 0:s.update(this.host.querySelectorAll(".lazy"));this.host.querySelectorAll(".lazy").forEach((s=>{s.addEventListener("load",(()=>{s.setAttribute("width","100%");s.setAttribute("height","100%")}))}))}componentDidRender(){var s,t,i;this.host.querySelectorAll("#payment-slot").forEach((s=>s.replaceWith(s.firstChild)));this.host.querySelectorAll("#sbc-slot").forEach((s=>s.replaceWith(s.firstChild)));this.host.querySelectorAll("#cod-slot").forEach((s=>s.replaceWith(s.firstChild)));(s=this.host.querySelector('[slot="payment"]'))===null||s===void 0?void 0:s.remove();(t=this.host.querySelector('[slot="sbc"]'))===null||t===void 0?void 0:t.remove();(i=this.host.querySelector('[slot="cod"]'))===null||i===void 0?void 0:i.remove()}get host(){return a(this)}};l.style=e;export{l as salla_payments};
|
|
5
|
+
//# sourceMappingURL=p-9c6d592b.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-B0iUa0dk.system.js","sources":["src/components/salla-tooltip/salla-tooltip.scss?tag=salla-tooltip","src/components/salla-tooltip/salla-tooltip.tsx"],"sourcesContent":[".s-tooltip {\n &-container {\n position: relative;\n display: inline-block;\n }\n\n &-item {\n position: absolute;\n transform: translateX(-39%);\n background-color: #baf3e6;\n color: #004d5a;\n bottom: 100%;\n left: 50%;\n text-align: center;\n border-radius: 5px;\n z-index: 1;\n white-space: nowrap;\n opacity: 0;\n transition: opacity 0.3s;\n pointer-events: none;\n margin: 0 0 16px 8px;\n padding: 12px;\n max-width: 150px;\n width: 190px;\n white-space: normal;\n opacity: 1;\n\n &::after {\n content: '';\n position: absolute;\n bottom: -10px; // Position the arrow just below the tooltip\n left: 50%;\n margin-left: -5px; // Center the arrow\n border-width: 5px;\n border-style: solid;\n border-color: #baf3e6 transparent transparent transparent; // Arrow color and shape\n }\n &:dir(ltr) {\n transform: translateX(-72%);\n }\n }\n}\n","import { Component, Prop, h, State, Element, Listen } from '@stencil/core';\n\n@Component({\n tag: 'salla-tooltip',\n styleUrl: 'salla-tooltip.scss',\n shadow: false,\n})\nexport class SallaTooltip {\n /**\n * The text content to display in the tooltip\n */\n @Prop() text: string;\n /**\n * The ID of the target element to which the tooltip is attached\n */\n @Prop() targetId: string;\n @State() show: boolean = false;\n @Element() el: HTMLElement;\n\n private targetElement: HTMLElement | null = null;\n\n @Listen('mouseover', { target: 'window' })\n handleMouseOver(event: MouseEvent) {\n if (this.targetElement && this.targetElement.contains(event.target as Node)) {\n this.show = true;\n }\n }\n\n @Listen('mouseout', { target: 'window' })\n handleMouseOut(event: MouseEvent) {\n if (this.targetElement && this.targetElement.contains(event.target as Node)) {\n this.show = false;\n }\n }\n\n componentDidLoad() {\n // Find the target element based on the targetSelector prop\n this.targetElement = document.getElementById(this.targetId);\n }\n\n render() {\n return (\n <div class=\"s-tooltip-container\">\n <slot></slot>\n {this.show && <div class=\"s-tooltip-item\">{this.text}</div>}\n </div>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAAA,MAAM,eAAe,GAAG,4tBAA4tB;;YCOvuB,YAAY,4BAAA,MAAA;MALzB,IAAA,WAAA,CAAA,OAAA,EAAA;;MAcW,QAAA,IAAI,CAAA,IAAA,GAAY,KAAK;MAGtB,QAAA,IAAa,CAAA,aAAA,GAAuB,IAAI;MA6BjD;MA1BC,IAAA,eAAe,CAAC,KAAiB,EAAA;MAC/B,QAAA,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,EAAE;MAC3E,YAAA,IAAI,CAAC,IAAI,GAAG,IAAI;;;MAKpB,IAAA,cAAc,CAAC,KAAiB,EAAA;MAC9B,QAAA,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,EAAE;MAC3E,YAAA,IAAI,CAAC,IAAI,GAAG,KAAK;;;UAIrB,gBAAgB,GAAA;;cAEd,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC;;UAG7D,MAAM,GAAA;cACJ,QACE,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,qBAAqB,EAAA,EAC9B,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,EACZ,IAAI,CAAC,IAAI,IAAI,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,gBAAgB,EAAE,EAAA,IAAI,CAAC,IAAI,CAAO,CACvD;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-C435-Ngu.system.js","sources":["src/components/salla-reviews/salla-reviews.scss?tag=salla-reviews","src/components/salla-reviews/salla-reviews.tsx"],"sourcesContent":["","import { Component, Prop, State, h } from '@stencil/core';\nimport IconArrowLeft from '../../assets/svg/arrow-left.svg'\nimport IconQuoteOpen from '../../assets/svg/quote-open.svg'\n\nimport {Source, Review, ReviewType, SortingOption} from \"./interfaces\"\nimport Helper from '../../Helpers/Helper';\n\n\n@Component({\n tag: 'salla-reviews',\n styleUrl: 'salla-reviews.scss',\n})\nexport class SallaReviews {\n constructor(){\n this.source = this.source;\n salla.onReady(() => {\n this.displayAllURL = salla.url.get('testimonials')\n this.isRTL = salla.config.get('theme.is_rtl', true)\n })\n\n salla.lang.onLoaded(() => { \n this.testimonialText = salla.lang.get('blocks.home.testimonials')\n this.displayAllLinkText = salla.lang.get('blocks.home.display_all')\n })\n }\n\n /**\n * Controls the visibility of a link to the reviews page.\n * \n * When set to `true`, a link will be displayed allowing users to navigate to the full reviews section.\n * \n * @type {boolean}\n */\n @Prop({ reflect: true }) displayAllLink: boolean\n\n /**\n * Specifies the data source for reviews.\n * \n * Valid options include:\n * - 'categories': Retrieves reviews for specific product categories.\n * - 'products': Retrieves reviews for individual products.\n * - 'json': Retrieves reviews from a custom JSON payload provided in `sourceValue`.\n * \n * When using 'json' as the source, a valid payload must be provided in `sourceValue`.\n * \n * @type {Source}\n * @default \"store\"\n */\n @Prop({ reflect: true }) source?: Source;\n\n /**\n * Provides data specific to the chosen source.\n * \n * Required when using 'categories', 'products', or 'json' as the source:\n * - 'categories': An array of category IDs.\n * - 'products': An array of product IDs.\n * - 'json': A custom JSON object containing review data.\n * \n * @type {string | object | Array<number>}\n */\n @Prop({ reflect: true }) sourceValue?: string | object | Array<number>;\n\n /**\n * Defines the maximum number of reviews to retrieve from the API.\n * \n * @type {number}\n * @default 5\n */\n @Prop({ reflect: true }) limit = 5\n\n\n /**\n * Specifies the type of reviews to fetch.\n * Available options:\n * - \"all\": Fetches reviews from all sources.\n * - \"store\": Fetches reviews specific to the store.\n * - \"products\": Fetches reviews specific to products.\n * \n * @type {ReviewType}\n * @default store\n */\n @Prop() type: ReviewType = \"store\";\n\n\n /**\n * Specifies the sorting criteria for the fetched reviews.\n * Available options:\n * - \"top_rating\": Sorts reviews based on top ratings.\n * - \"random\": Sorts reviews randomly.\n * - \"latest\": Sorts reviews based on the latest ones (default).\n * \n * @type {SortingOption}\n * @default latest\n */\n @Prop() sort: SortingOption = \"latest\";\n\n\n /**\n * Specifies whether to hide customer information in the component.\n * When set to true, customer information will be hidden.\n * Defaults to false, meaning customer information will be displayed.\n */\n @Prop() hideCustomerInfo: boolean = false;\n\n\n @State() reviews: Array<Review> = [];\n @State() isRTL: boolean\n @State() showReviews: boolean = false;\n @State() testimonialText: string = salla.lang.get('blocks.home.testimonials');\n @State() displayAllLinkText: string = salla.lang.get('blocks.home.display_all');\n\n private displayAllURL = null\n\n fetchReviews() {\n if (this.source === 'json') {\n return Promise.resolve(JSON.parse(this.sourceValue as string));\n }\n const isJsonEncoded = ['products', 'categories'].includes(this.source);\n const params = {\n limit: this.limit,\n source: this.source,\n items: isJsonEncoded ? JSON.parse(this.sourceValue as string) : this.sourceValue,\n sort: this.sort,\n type: this.type,\n hide_customer_info: this.hideCustomerInfo?1:0\n };\n return salla.api.request('reviews', { params }, 'get');\n }\n\n\n componentWillLoad() {\n return (new Promise(resolve => salla.onReady(resolve)))\n .then(() => this.fetchReviews())\n .then((resp) => resp.data || [])\n .then(reviews => {\n if (reviews.length) {\n this.reviews = reviews;\n this.showReviews = true;\n Helper.generateReviewSchema(this.reviews);\n }\n });\n }\n\n render() {\n return (\n <div class=\"s-reviews-container\">\n <div class=\"s-reviews-header-wrapper\">\n <h1 class=\"s-reviews-header\">\n {this.testimonialText}\n </h1>\n {!!this.displayAllLink ? (\n <a href={this.displayAllURL} class=\"s-reviews-display-all\">\n {this.displayAllLinkText}\n <span class=\"s-reviews-display-all-icon\" innerHTML={IconArrowLeft} />\n </a>\n ) : null}\n </div>\n <salla-slider\n centered\n slides-per-view={1}\n type=\"testimonials\"\n class=\"s-reviews-testimonials-slider\"\n controls-outer\n auto-play\n id={`testimonials-${this.source}-slider`}\n >\n <div slot=\"items\">\n {this.reviews.map((item: Review, index) => (\n <div key={index} class=\"s-reviews-swiper-slide\">\n <div class=\"s-reviews-testimonial\">\n <div class=\"s-reviews-testimonial__inner\">\n <div class=\"s-reviews-testimonial__avatar\">\n <img\n src={'images/s-empty.png'}\n data-src={item.avatar}\n alt={item.name ? item.name : 'testimonial-' + index}\n class=\"lazy\"\n />\n </div>\n <div class=\"s-reviews-testimonial__text\">\n <p innerHTML={item.content}></p>\n <div class=\"s-reviews-testimonial__name_wrapper\">\n <div class=\"s-reviews-testimonial__info\">\n {item.name && <h2>{`${item.name}`}</h2>}\n </div>\n <div class=\"s-reviews-testimonial__rating\">\n {/* TODO stars is missing */}\n <salla-rating-stars size=\"small\" value={item.stars}></salla-rating-stars>\n </div>\n </div>\n </div>\n\n <span class=\"s-reviews-testimonial__icon\" innerHTML={IconQuoteOpen} />\n </div>\n </div>\n </div>\n ))}\n </div>\n </salla-slider>\n </div>\n );\n }\n\n}\n\n"],"names":["IconArrowLeft"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;YAAA,MAAM,eAAe,GAAG,EAAE;;kBCYb,YAAY,4BAAA,MAAA;YACvB,IAAA,WAAA,CAAA,OAAA,EAAA;;YAiDA;;;;;YAKG;YACsB,QAAA,IAAK,CAAA,KAAA,GAAG,CAAC;YAGlC;;;;;;;;;YASG;YACK,QAAA,IAAI,CAAA,IAAA,GAAe,OAAO;YAGlC;;;;;;;;;YASG;YACK,QAAA,IAAI,CAAA,IAAA,GAAkB,QAAQ;YAGtC;;;;YAIG;YACK,QAAA,IAAgB,CAAA,gBAAA,GAAY,KAAK;YAGhC,QAAA,IAAO,CAAA,OAAA,GAAkB,EAAE;YAE3B,QAAA,IAAW,CAAA,WAAA,GAAY,KAAK;oBAC5B,IAAe,CAAA,eAAA,GAAW,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,0BAA0B,CAAC;oBACpE,IAAkB,CAAA,kBAAA,GAAW,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,yBAAyB,CAAC;YAEvE,QAAA,IAAa,CAAA,aAAA,GAAG,IAAI;YAjG1B,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM;YACzB,QAAA,KAAK,CAAC,OAAO,CAAC,MAAK;wBACjB,IAAI,C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AK,EAAC,6BAA6B,EAAC,SAAS,EAAE,aAAa,EAAA,CAAI,CAClE,CACF,CACF,CACP,CAAC,CACE,CACO,CACX;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"p-B78CJAeo.system.js","sources":["src/components/salla-reviews/salla-reviews.scss?tag=salla-reviews","src/components/salla-reviews/salla-reviews.tsx"],"sourcesContent":["","import { Component, Prop, State, h } from '@stencil/core';\nimport IconArrowLeft from '../../assets/svg/arrow-left.svg'\nimport IconQuoteOpen from '../../assets/svg/quote-open.svg'\n\nimport {Source, Review, ReviewType, SortingOption} from \"./interfaces\"\nimport Helper from '../../Helpers/Helper';\n\n\n@Component({\n tag: 'salla-reviews',\n styleUrl: 'salla-reviews.scss',\n})\nexport class SallaReviews {\n constructor(){\n this.source = this.source;\n salla.onReady(() => {\n this.displayAllURL = salla.url.get('testimonials')\n this.isRTL = salla.config.get('theme.is_rtl', true)\n })\n\n salla.lang.onLoaded(() => { \n this.testimonialText = salla.lang.get('blocks.home.testimonials')\n this.displayAllLinkText = salla.lang.get('blocks.home.display_all')\n })\n }\n\n /**\n * Controls the visibility of a link to the reviews page.\n * \n * When set to `true`, a link will be displayed allowing users to navigate to the full reviews section.\n * \n * @type {boolean}\n */\n @Prop({ reflect: true }) displayAllLink: boolean\n\n /**\n * Specifies the data source for reviews.\n * \n * Valid options include:\n * - 'categories': Retrieves reviews for specific product categories.\n * - 'products': Retrieves reviews for individual products.\n * - 'json': Retrieves reviews from a custom JSON payload provided in `sourceValue`.\n * \n * When using 'json' as the source, a valid payload must be provided in `sourceValue`.\n * \n * @type {Source}\n * @default \"store\"\n */\n @Prop({ reflect: true }) source?: Source;\n\n /**\n * Provides data specific to the chosen source.\n * \n * Required when using 'categories', 'products', or 'json' as the source:\n * - 'categories': An array of category IDs.\n * - 'products': An array of product IDs.\n * - 'json': A custom JSON object containing review data.\n * \n * @type {string | object | Array<number>}\n */\n @Prop({ reflect: true }) sourceValue?: string | object | Array<number>;\n\n /**\n * Defines the maximum number of reviews to retrieve from the API.\n * \n * @type {number}\n * @default 5\n */\n @Prop({ reflect: true }) limit = 5\n\n\n /**\n * Specifies the type of reviews to fetch.\n * Available options:\n * - \"all\": Fetches reviews from all sources.\n * - \"store\": Fetches reviews specific to the store.\n * - \"products\": Fetches reviews specific to products.\n * \n * @type {ReviewType}\n * @default store\n */\n @Prop() type: ReviewType = \"store\";\n\n\n /**\n * Specifies the sorting criteria for the fetched reviews.\n * Available options:\n * - \"top_rating\": Sorts reviews based on top ratings.\n * - \"random\": Sorts reviews randomly.\n * - \"latest\": Sorts reviews based on the latest ones (default).\n * \n * @type {SortingOption}\n * @default latest\n */\n @Prop() sort: SortingOption = \"latest\";\n\n\n /**\n * Specifies whether to hide customer information in the component.\n * When set to true, customer information will be hidden.\n * Defaults to false, meaning customer information will be displayed.\n */\n @Prop() hideCustomerInfo: boolean = false;\n\n\n @State() reviews: Array<Review> = [];\n @State() isRTL: boolean\n @State() showReviews: boolean = false;\n @State() testimonialText: string = salla.lang.get('blocks.home.testimonials');\n @State() displayAllLinkText: string = salla.lang.get('blocks.home.display_all');\n\n private displayAllURL = null\n\n fetchReviews() {\n if (this.source === 'json') {\n return Promise.resolve(JSON.parse(this.sourceValue as string));\n }\n const isJsonEncoded = ['products', 'categories'].includes(this.source);\n const params = {\n limit: this.limit,\n source: this.source,\n items: isJsonEncoded ? JSON.parse(this.sourceValue as string) : this.sourceValue,\n sort: this.sort,\n type: this.type,\n hide_customer_info: this.hideCustomerInfo?1:0\n };\n return salla.api.request('reviews', { params }, 'get');\n }\n\n\n componentWillLoad() {\n return (new Promise(resolve => salla.onReady(resolve)))\n .then(() => this.fetchReviews())\n .then((resp) => resp.data || [])\n .then(reviews => {\n if (reviews.length) {\n this.reviews = reviews;\n this.showReviews = true;\n Helper.generateReviewSchema(this.reviews);\n }\n });\n }\n\n render() {\n return (\n <div class=\"s-reviews-container\">\n <div class=\"s-reviews-header-wrapper\">\n <h1 class=\"s-reviews-header\">\n {this.testimonialText}\n </h1>\n {!!this.displayAllLink ? (\n <a href={this.displayAllURL} class=\"s-reviews-display-all\">\n {this.displayAllLinkText}\n <span class=\"s-reviews-display-all-icon\" innerHTML={IconArrowLeft} />\n </a>\n ) : null}\n </div>\n <salla-slider\n centered\n slides-per-view={1}\n type=\"testimonials\"\n class=\"s-reviews-testimonials-slider\"\n controls-outer\n auto-play\n id={`testimonials-${this.source}-slider`}\n >\n <div slot=\"items\">\n {this.reviews.map((item: Review, index) => (\n <div key={index} class=\"s-reviews-swiper-slide\">\n <div class=\"s-reviews-testimonial\">\n <div class=\"s-reviews-testimonial__inner\">\n <div class=\"s-reviews-testimonial__avatar\">\n <img\n src={'images/s-empty.png'}\n data-src={item.avatar}\n alt={item.name ? item.name : 'testimonial-' + index}\n class=\"lazy\"\n />\n </div>\n <div class=\"s-reviews-testimonial__text\">\n <p innerHTML={item.content}></p>\n <div class=\"s-reviews-testimonial__name_wrapper\">\n <div class=\"s-reviews-testimonial__info\">\n {item.name && <h2>{`${item.name}`}</h2>}\n </div>\n <div class=\"s-reviews-testimonial__rating\">\n {/* TODO stars is missing */}\n <salla-rating-stars size=\"small\" value={item.stars}></salla-rating-stars>\n </div>\n </div>\n </div>\n\n <span class=\"s-reviews-testimonial__icon\" innerHTML={IconQuoteOpen} />\n </div>\n </div>\n </div>\n ))}\n </div>\n </salla-slider>\n </div>\n );\n }\n\n}\n\n"],"names":["IconArrowLeft"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;YAAA,MAAM,eAAe,GAAG,EAAE;;kBCYb,YAAY,4BAAA,MAAA;YACvB,IAAA,WAAA,CAAA,OAAA,EAAA;;YAiDA;;;;;YAKG;YACsB,QAAA,IAAK,CAAA,KAAA,GAAG,CAAC;YAGlC;;;;;;;;;YASG;YACK,QAAA,IAAI,CAAA,IAAA,GAAe,OAAO;YAGlC;;;;;;;;;YASG;YACK,QAAA,IAAI,CAAA,IAAA,GAAkB,QAAQ;YAGtC;;;;YAIG;YACK,QAAA,IAA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A,EAAA,EAAA,KAAK,EAAC,qCAAqC,EAAA,EAC9C,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,6BAA6B,EAAA,EACrC,IAAI,CAAC,IAAI,IAAI,CAAA,CAAA,IAAA,EAAA,IAAA,EAAK,CAAA,EAAG,IAAI,CAAC,IAAI,EAAE,CAAM,CACnC,EACN,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,+BAA+B,EAAA,EAExC,CAAA,CAAA,oBAAA,EAAA,EAAoB,IAAI,EAAC,OAAO,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAA,CAAuB,CACrE,CACF,CACF,EAEN,CAAA,CAAA,MAAA,EAAA,EAAM,KAAK,EAAC,6BAA6B,EAAC,SAAS,EAAE,aAAa,EAAA,CAAI,CAClE,CACF,CACF,CACP,CAAC,CACE,CACO,CACX;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-BEAZDb3Z.system.js","sources":["src/components/salla-app-install-alert/salla-app-install-alert.scss?tag=salla-app-install-alert","src/components/salla-app-install-alert/salla-app-install-alert.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, h, State, Element, Host } from '@stencil/core';\nimport { AppInstallAlertData } from './interfaces';\n\n@Component({\n tag: 'salla-app-install-alert',\n styleUrl: 'salla-app-install-alert.scss',\n})\nexport class SallaAppInstallAlert {\n\n alertDelay: NodeJS.Timeout = null\n\n connectedCallback() {\n salla.onReady(() => {\n this.data = salla.config.get('store.app_install_prompt')\n\n if (!this.isMobileOrTabletDevice()) return;\n\n if (!this.data) return salla.logger.error('Failed to retrieve salla-app-install-alert config')\n\n this.ctaLink = salla.url.get('app');\n this.alertDelay = setTimeout(() => (this.open = true), 3000);\n });\n }\n\n disconnectedCallback() {\n clearTimeout(this.alertDelay)\n }\n\n\n\n\n @State() data: AppInstallAlertData | null = salla.config.get('store.app_install_prompt');\n @State() ctaLink: string;\n @State() open: boolean = false;\n @State() closing: boolean = false;\n @Element() private host: HTMLElement;\n\n\n /**\n * Check if the website opens from mobile or tablet devices only (android/ios).\n *\n * @param {number} screen the width of the biggest screen to be checked\n * @returns {boolean} true if it is mobile or tablet else false\n */\n private isMobileOrTabletDevice(screen = 1024): boolean {\n const screenWidth = window.innerWidth <= screen;\n const userAgentCheck = /Macintosh|Android|iPhone|iPad|iPod/i.test(navigator.userAgent);\n const hasTouch =\n 'ontouchstart' in window ||\n 'ontouchend' in document ||\n navigator.maxTouchPoints > 0;\n\n return userAgentCheck && screenWidth && hasTouch;\n }\n\n closeAlert() {\n salla.storage.set('app_install_prompt_disabled', true);\n // handle closing animation first, then close the banner\n this.closing = true;\n this.host.addEventListener(\n 'animationend',\n () => {\n this.closing = false\n this.open = false;\n },\n { once: true }\n );\n }\n\n\n render() {\n return this.data ? (\n <Host class={`s-app-install-alert-wrapper ${this.open ? 'open' : ''} ${this.closing ? 'closing' : ''}`} position={this.data.position}>\n <div>\n <img src={this.data.icon} width=\"58\" height=\"58\" alt={`${salla.config.get('store.name')}`} />\n </div>\n <div class=\"s-app-install-alert-content\">\n <h2 class=\"s-app-install-alert-title\">{this.data.title}</h2>\n <p class=\"s-app-install-alert-sub-title\">\n {this.data.sub_title} {\" \"}\n <a href={this.ctaLink} target=\"_blank\" aria-label=\"download app\" class=\"s-app-install-alert-cta\">\n {salla.lang.getWithDefault('blocks.footer.download_app_now', 'حمله الآن')}\n </a>\n </p>\n </div>\n <button class=\"s-app-install-alert-cancel-button\" aria-label=\"close alert\" onClick={() => this.closeAlert()}>\n <i class=\"sicon-cancel\"></i>\n </button>\n </Host>\n ) : null\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAAA,MAAM,uBAAuB,GAAG,sBAAsB;;YCOzC,oBAAoB,sCAAA,MAAA;MAJjC,IAAA,WAAA,CAAA,OAAA,EAAA;;MAME,QAAA,IAAU,CAAA,UAAA,GAAmB,IAAI;cAsBxB,IAAI,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gCAAgC,EAAE,WAAW,CAAC,CACvE,CACF,CACA,EACN,CAAA,CAAA,QAAA,EAAA,EAAQ,KAAK,EAAC,mCAAmC,EAAA,YAAA,EAAY,aAAa,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE,EAAA,EACzG,CAAG,CAAA,GAAA,EAAA,EAAA,KAAK,EAAC,cAAc,EAAK,CAAA,CACrB,CACJ,IACL,IAAI;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-BQW3a64v.system.js","sources":["@lazy-external-entrypoint?app-data=conditional"],"sourcesContent":["export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\nexport const defineCustomElements = async (win, options) => {\n if (typeof window === 'undefined') return undefined;\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGY,YAAC,oBAAoB,mCAAG,OAAO,GAAG,EAAE,OAAO,KAAK;MAC5D,EAAE,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,OAAO,SAAS;MACrD,EAAE,MAAM,aAAa,EAAE;MACvB,EAAE,OAAO,aAAa,CAAC,4BAA4B,EAAE,OAAO,CAAC;MAC7D;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"p-BYmyEppC.system.js","sources":["src/components/salla-tiered-offer/interfaces.ts","src/components/salla-tiered-offer/constants.ts","src/components/salla-tiered-offer/utils.ts","src/components/salla-tiered-offer/salla-tiered-offer.scss?tag=salla-tiered-offer","src/components/salla-tiered-offer/salla-tiered-offer.tsx"],"sourcesContent":["export enum DiscountType {\n PERCENTAGE = \"percentage\",\n FIXED = \"fixed\",\n}\n\n\nexport interface Discount {\n name?: string;\n type?: DiscountType;\n value?: number;\n min_spend?: number;\n}\n\nexport interface TieredOfferDetails {\n based_on?: string;\n ends_at?: number;\n start_value?: number;\n end_value?: number;\n current_value?: number;\n discounts?: Discount[];\n with_current_cart?: boolean;\n applied_with_coupon?: boolean;\n}\n\nexport interface Offer {\n id?: number;\n type?: string;\n title?: string;\n description?: string;\n details?: TieredOfferDetails | null;\n}\n\nexport interface TieredOfferTier {\n name: string;\n tier_name: string;\n discount: string;\n icon: string;\n threshold: number;\n text_color?: string;\n index: number;\n}\n\nexport interface TieredOfferData {\n current_tier: string;\n tiers: TieredOfferTier[];\n}\n\nexport interface TieredOfferConfig {\n staticIcons: string[];\n staticColors: string[];\n}\n","import { TieredOfferConfig } from './interfaces';\nimport StarIcon from '../../assets/svg/star-rounded.svg';\nimport StarsIcon from '../../assets/svg/stars.svg';\nimport GoldIcon from '../../assets/svg/gold.svg';\nimport DiamondIcon from '../../assets/svg/diamond-02.svg';\n\nexport const TIERED_OFFER_CONFIG: TieredOfferConfig = {\n staticIcons: [StarIcon, StarsIcon, GoldIcon, DiamondIcon],\n staticColors: ['#993018', '#444444', '#D18F36', '#315F9C']\n};","import { TieredOfferTier } from './interfaces';\n\nexport class TierUtils {\n /**\n * Find tier by index\n */\n static findTierByIndex(tiers: TieredOfferTier[], index: number): TieredOfferTier | null {\n return tiers.find(tier => tier.index === index) || null;\n }\n\n /**\n * Find tier by tier name\n */\n static findTierByName(tiers: TieredOfferTier[], tierName: string): TieredOfferTier | null {\n return tiers.find(tier => tier.tier_name === tierName) || null;\n }\n\n /**\n * Get tier name by index\n */\n static getTierNameByIndex(tiers: TieredOfferTier[], index: number): string | undefined {\n return this.findTierByIndex(tiers, index)?.tier_name;\n }\n\n /**\n * Find current tier index based on current value\n */\n static findCurrentTierIndex(currentValue: number, tiers: TieredOfferTier[]): number {\n if (!tiers) return 0;\n \n for (let i = tiers.length - 1; i >= 0; i--) {\n if (currentValue >= tiers[i].threshold) {\n return tiers[i].index;\n }\n }\n return 0;\n }\n}","\n// SVG styling for milestone icons \n.s-tiered-offer-milestone-icon {\n svg {\n color: currentColor;\n \n path {\n stroke: currentColor;\n fill: none;\n }\n }\n \n // Active and completed states - fill the star icon, keep others as stroke\n &.s-tiered-offer-milestone-active,\n &.s-tiered-offer-milestone-completed {\n svg {\n path {\n fill: currentColor;\n stroke: none;\n }\n \n // For stroke-based icons (crown, stars, diamond) \n &[fill=\"none\"] path {\n fill: none;\n stroke: currentColor;\n }\n }\n }\n}\n\n// RTL Support \n[dir=\"rtl\"] {\n .s-tiered-offer-progress-wrapper {\n .s-tiered-offer-progress-bg {\n transform: scaleX(-1);\n }\n \n .s-tiered-offer-progress-fill {\n transform: scaleX(-1);\n left: auto;\n }\n }\n\n .flip-x {\n transform: scaleX(-1);\n }\n}\n","import { Component, Host, h, State } from '@stencil/core';\nimport { Offer, TieredOfferTier, TieredOfferData, DiscountType } from './interfaces';\nimport { TIERED_OFFER_CONFIG } from './constants';\nimport { TierUtils } from './utils';\n\n@Component({\n tag: 'salla-tiered-offer',\n styleUrl: 'salla-tiered-offer.scss',\n})\nexport class SallaTieredOffer {\n\n constructor() {\n salla.lang.onLoaded(() => {\n this.loyaltyProgramText = salla.lang.get('blocks.tiered_offer.program_title');\n this.currentTierText = salla.lang.get('blocks.tiered_offer.current_tier');\n this.discountText = salla.lang.get('blocks.tiered_offer.discount');\n this.benefitText = salla.lang.get('blocks.tiered_offer.tier_description');\n });\n }\n\n\n @State() tieredOfferData: TieredOfferData;\n @State() apiOfferData: Offer;\n @State() currentTierIndex: number = 0;\n @State() currentTier: string;\n @State() activeTabTier: string;\n\n @State() canRender: boolean = false;\n @State() isLoading: boolean = false;\n\n // Language strings\n @State() loyaltyProgramText: string;\n @State() currentTierText: string;\n @State() discountText: string;\n @State() benefitText: string;\n\n async componentWillLoad() {\n try {\n await salla.onReady();\n \n if (!this.checkFeatureEnabled()) {\n return;\n }\n \n if (!this.checkCartExists()) {\n return;\n }\n \n this.isLoading = true;\n \n const offerData = await this.fetchTieredOfferData();\n if (!offerData) {\n return;\n }\n \n this.initializeComponent(offerData);\n \n } catch (error) {\n this.canRender = false;\n salla.logger.warn('salla-tiered-offer:: ', error);\n } finally {\n this.isLoading = false;\n }\n }\n \n private checkFeatureEnabled(): boolean {\n return salla.config.get('store.features')?.includes('tiered-offer');\n }\n \n private checkCartExists(): boolean {\n return !!salla.storage.get(\"cart\")?.summary?.count;\n }\n \n private validateCouponCompatibility(offerData: Offer, cartCoupon?: any): boolean {\n // If coupon is applied but offer doesn't support coupons, widget should be hidden\n return !(cartCoupon && !offerData.details?.applied_with_coupon);\n }\n \n private async fetchTieredOfferData(): Promise<Offer | null> {\n try {\n const { data }: { data: Offer[] } = await salla.api.cart.offers();\n const tieredOffer = data.find(offer => offer.type === \"tiered_offer\");\n \n if (!tieredOffer) {\n return null;\n }\n \n // Hide widget if coupon is applied and offer doesn't support coupons\n if (!this.validateCouponCompatibility(tieredOffer, salla.storage.get(\"cart\")?.coupon)) {\n this.canRender = false;\n return null;\n }\n \n return tieredOffer;\n } catch (error) {\n throw error;\n }\n }\n \n private initializeComponent(apiOfferData: Offer): void {\n this.apiOfferData = apiOfferData;\n \n // Map tiered details data to component format\n this.tieredOfferData = this.mapApiDataToTiers(this.apiOfferData);\n this.loyaltyProgramText = this.apiOfferData.title || this.loyaltyProgramText;\n \n // Find current tier index based on current_value from API\n const currentValue = this.apiOfferData.details?.current_value || 0;\n const currentTierIndex = this.findCurrentTierIndex(currentValue);\n \n // Only render if user has reached at least the first tier\n if (currentTierIndex === 0) {\n this.canRender = false;\n return;\n }\n \n this.currentTierIndex = currentTierIndex;\n this.currentTier = TierUtils.getTierNameByIndex(this.tieredOfferData.tiers, currentTierIndex);\n this.activeTabTier = this.currentTier;\n this.canRender = true;\n }\n\n componentDidLoad() {\n salla.event.on(\"cart::updated\", (updatedCart) => {\n this.updateOfferValues(updatedCart);\n });\n }\n\n private mapApiDataToTiers(apiData: Offer): TieredOfferData {\n // Sort discounts by min_spend to create proper tier order\n const sortedDiscounts = [...apiData.details.discounts].sort((a, b) => a.min_spend - b.min_spend);\n\n const tiers: TieredOfferTier[] = sortedDiscounts.map((discount, index) => ({\n name: discount.name, \n tier_name: discount.name, \n discount: discount.type === DiscountType.PERCENTAGE ? `${salla.helpers.number(discount.value)}%` : salla.money(discount.value),\n icon: TIERED_OFFER_CONFIG.staticIcons[index] || TIERED_OFFER_CONFIG.staticIcons[0], \n threshold: discount.min_spend,\n text_color: TIERED_OFFER_CONFIG.staticColors[index], \n index: index + 1\n }));\n\n return {\n current_tier: TierUtils.getTierNameByIndex(tiers, this.findCurrentTierIndex(apiData.details.current_value, tiers)),\n tiers\n };\n }\n\n private findCurrentTierIndex(currentValue: number, tiers = this.tieredOfferData?.tiers): number {\n return TierUtils.findCurrentTierIndex(currentValue, tiers || []);\n }\n\n private updateOfferValues(updatedCart: { items: any[], sub_total: number, coupon?: any }) {\n if (!this.apiOfferData || !this.tieredOfferData) {\n return;\n }\n\n // Check coupon compatibility\n if (!this.validateCouponCompatibility(this.apiOfferData, updatedCart.coupon)) {\n this.canRender = false;\n return;\n }\n\n // If no coupon conflict, show widget\n this.canRender = true;\n\n // Check if this offer should update with cart changes\n if (this.apiOfferData.details?.with_current_cart === false) {\n return;\n }\n\n // Update current_value in API offer data\n const currentValue = updatedCart.sub_total;\n this.apiOfferData = {\n ...this.apiOfferData,\n details: {\n ...this.apiOfferData.details,\n current_value: currentValue\n }\n };\n\n // Update current tier based on new value\n const newTierIndex = this.findCurrentTierIndex(currentValue);\n \n // Check if user qualifies for any tier\n if (newTierIndex === 0) {\n this.canRender = false;\n return;\n }\n\n // user qualifies show widget\n this.canRender = true;\n this.currentTierIndex = newTierIndex;\n this.currentTier = TierUtils.getTierNameByIndex(this.tieredOfferData.tiers, newTierIndex);\n \n // Update active tab if needed\n if (this.activeTabTier !== this.currentTier) {\n this.activeTabTier = this.currentTier;\n }\n }\n\n private getLoadingSkeletonView() {\n return <Host>\n <div class=\"s-tiered-offer-container\">\n <div class=\"s-tiered-offer-skeleton-wrapper\">\n <div class=\"s-tiered-offer-skeleton-title\">\n <salla-skeleton height=\"16px\" width=\"40%\" />\n </div>\n <div class=\"s-tiered-offer-skeleton-subtitle\">\n <salla-skeleton height=\"20px\" width=\"60%\" />\n </div>\n <div class=\"s-tiered-offer-skeleton-progress\">\n <salla-skeleton height=\"16px\" width=\"100%\" />\n </div>\n <div class=\"s-tiered-offer-skeleton-tabs\">\n <salla-skeleton height=\"50px\" width=\"100%\" />\n </div>\n </div>\n </div>\n </Host>\n }\n\n private getCurrentTierData(): TieredOfferTier {\n return TierUtils.findTierByIndex(this.tieredOfferData.tiers, this.currentTierIndex) || this.tieredOfferData.tiers[0];\n }\n\n private getProgressWidth(): number {\n const currentValue = this.apiOfferData.details?.current_value || 0;\n const totalTiers = this.tieredOfferData.tiers.length;\n \n // Use existing method to find current tier index (which already handles the logic)\n const currentTierIndex = this.findCurrentTierIndex(currentValue);\n \n // Convert to 0-based index for progress calculation\n const completedTiers = currentTierIndex;\n return (completedTiers / totalTiers) * 100;\n }\n\n private handleTabClick = (tierName: string) => {\n this.activeTabTier = tierName;\n }\n \n private calculateMilestonePosition(index: number, totalTiers: number): string {\n if (totalTiers === 1) {\n return 'calc(100% - 18px)';\n }\n const milestonePercent = ((index + 1) / totalTiers) * 100;\n const offsetPercent = 8 / totalTiers;\n return `${Math.max(2, Math.min(95, milestonePercent - offsetPercent))}%`;\n }\n \n private getMilestoneStyles(tier: TieredOfferTier, index: number, totalTiers: number) {\n const isRtl = document.documentElement.dir === 'rtl';\n const adjustedPercent = this.calculateMilestonePosition(index, totalTiers);\n const alignItems = tier.name.length > 6 ? 'flex-end' : 'center';\n \n return {\n [isRtl ? 'right' : 'left']: adjustedPercent,\n alignItems,\n position: 'absolute' as const,\n transform: isRtl ? 'translateX(50%)' : 'translateX(-50%)'\n };\n }\n \n private getMilestoneIconStyles(tier: TieredOfferTier, isCurrent: boolean, isReached: boolean) {\n if (isCurrent) {\n return { color: tier.text_color };\n }\n if (isReached) {\n return { color: 'var(--color-primary)' };\n }\n return {};\n }\n \n private renderProgressBarBackground(progressWidth: number) {\n return [\n <div class=\"s-tiered-offer-progress-bg\"></div>,\n <div \n class=\"s-tiered-offer-progress-fill\"\n style={{ width: `${progressWidth}%` }}>\n </div>\n ];\n }\n \n private renderMilestoneIcon(tier: TieredOfferTier, isCurrent: boolean, isReached: boolean) {\n const iconClasses = [\n 's-tiered-offer-milestone-icon',\n isCurrent ? 's-tiered-offer-milestone-active' : '',\n isReached ? 's-tiered-offer-milestone-completed' : ''\n ].filter(Boolean).join(' ');\n \n return (\n <div \n class={iconClasses}\n style={this.getMilestoneIconStyles(tier, isCurrent, isReached)}>\n <span innerHTML={tier.icon}></span>\n </div>\n );\n }\n \n private renderMilestoneName(tier: TieredOfferTier, isCurrent: boolean) {\n return (\n <div class=\"s-tiered-offer-milestone-name\">\n {isCurrent && (\n <span style={{ color: tier.text_color }}>\n {tier.name}\n </span>\n )}\n </div>\n );\n }\n \n private renderMilestones(currentValue: number, totalTiers: number) {\n const containerClass = totalTiers === 1 \n ? 's-tiered-offer-single-milestone-justify-end' \n : 's-tiered-offer-milestones';\n \n return (\n <div class=\"s-tiered-offer-milestones-wrapper\">\n <div class={containerClass}>\n {this.tieredOfferData.tiers.map((tier, index) => {\n const isReached = currentValue >= tier.threshold;\n const isCurrent = tier.tier_name === this.currentTier;\n \n return (\n <div \n class=\"s-tiered-offer-milestone\"\n style={this.getMilestoneStyles(tier, index, totalTiers)}>\n {this.renderMilestoneIcon(tier, isCurrent, isReached)}\n {this.renderMilestoneName(tier, isCurrent)}\n </div>\n );\n })}\n </div>\n </div>\n );\n }\n\n private renderProgressBar() {\n const progressWidth = this.getProgressWidth();\n const totalTiers = this.tieredOfferData.tiers.length;\n const currentValue = this.apiOfferData.details?.current_value || 0;\n\n return (\n <div class=\"s-tiered-offer-progress-container\">\n <div class=\"s-tiered-offer-progress-wrapper\">\n {this.renderProgressBarBackground(progressWidth)}\n {this.renderMilestones(currentValue, totalTiers)}\n </div>\n </div>\n );\n }\n\n private renderTabs() {\n return (\n <div class=\"s-tiered-offer-tabs-container\">\n {/* Tab Headers */}\n <div class=\"s-tiered-offer-tab-headers\">\n {this.tieredOfferData.tiers.map(tier => {\n const isActive = tier.tier_name === this.activeTabTier;\n return (\n <button \n class={`s-tiered-offer-tab-header ${isActive ? 's-tiered-offer-tab-active' : ''}`}\n onClick={() => this.handleTabClick(tier.tier_name)}>\n <span>{tier.name}</span>\n </button>\n );\n })}\n </div>\n\n {/* Tab Content */}\n <div class=\"s-tiered-offer-tab-content-wrapper\">\n {(() => {\n const activeTier = TierUtils.findTierByName(this.tieredOfferData.tiers, this.activeTabTier);\n if (!activeTier) return null;\n \n return (\n <div class=\"s-tiered-offer-tab-content\">\n <div class=\"s-tiered-offer-tab-content-inner\">\n <div class=\"s-tiered-offer-discount-section\">\n <p class=\"s-tiered-offer-discount-title\">\n {this.discountText} <span innerHTML={activeTier.discount}></span>\n </p>\n <p class=\"s-tiered-offer-benefit-description\">\n {this.benefitText} {activeTier.name}\n </p>\n </div>\n </div>\n </div>\n );\n })()}\n </div>\n </div>\n );\n }\n\n render() {\n \n if (this.isLoading) {\n return this.getLoadingSkeletonView();\n }\n\n if (!this.canRender || !this.tieredOfferData) {\n return null;\n }\n \n\n const currentTierData = this.getCurrentTierData();\n\n return (\n <Host>\n <div class=\"s-tiered-offer-container\">\n {/* Header Section */}\n <div class=\"s-tiered-offer-header\">\n <div class=\"s-tiered-offer-header-content\">\n <p class=\"s-tiered-offer-program-title\">{this.loyaltyProgramText}</p>\n <div class=\"s-tiered-offer-current-tier-name-wrapper\">\n <h2 class=\"s-tiered-offer-current-tier\">\n {this.currentTierText} <span class=\"s-tiered-offer-tier-name\">{currentTierData.name}</span>\n </h2>\n <span innerHTML={currentTierData.icon}></span>\n </div>\n </div>\n </div>\n\n {/* Progress Bar */}\n {this.renderProgressBar()}\n\n {/* Tabs */}\n {this.renderTabs()}\n </div>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;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I,CAAQ,CACxF,EACL,CAAM,CAAA,MAAA,EAAA,EAAA,SAAS,EAAE,eAAe,CAAC,IAAI,EAAS,CAAA,CAC1C,CACF,CACF,EAGL,IAAI,CAAC,iBAAiB,EAAE,EAGxB,IAAI,CAAC,UAAU,EAAE,CACd,CACD;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-BbGRMLwX.system.js","sources":["src/components/salla-contacts/salla-contacts.scss?tag=salla-contacts","src/components/salla-contacts/salla-contacts.tsx"],"sourcesContent":[".unicode {\n unicode-bidi: plaintext;\n}","import { Component, Host, h, Prop, State, Element } from '@stencil/core';\nimport mobile from '../../assets/svg/iphone.svg';\nimport whatsapp from '../../assets/svg/whatsapp2.svg';\nimport phone from '../../assets/svg/phone.svg';\nimport telegram from '../../assets/svg/paper-plane-o.svg';\nimport email from '../../assets/svg/mail.svg';\n/**\n * @slot contact - Replaces contact item, has replaceable props `{icon}`, `{value}`.\n */\n@Component({\n tag: 'salla-contacts',\n styleUrl: 'salla-contacts.scss',\n})\nexport class SallaContacts {\n constructor() {\n this.contactSlot = this.host.querySelector('[slot=\"contact\"]')?.innerHTML || `<a href={link} class=\"s-contacts-item\"><span class=\"s-contacts-icon\">{icon}</span>${!this.iconsOnly && \"<span class='unicode'>{value}</span>\"}</a>`;\n\n salla.onReady(() => {\n this.contacts = salla.config.get('store.contacts');\n });\n\n salla.lang.onLoaded(() => {\n this.contactsTitle = this.contactsTitle || salla.lang.get('blocks.footer.social');\n });\n }\n private readonly contactSlot: string;\n\n /**\n * Section title for social block of footer.\n */\n @Prop({mutable: true}) contactsTitle: string;\n\n /**\n * Flag to toggle title visibility.\n */\n @Prop() hideTitle: boolean;\n\n /**\n * Conditional flag to check whether the content is header or not.\n */\n @Prop() isHeader: boolean;\n\n /**\n * Flag to toggle list of contents whether vertical or horizontal.\n */\n @Prop() horizontal: boolean;\n\n /**\n * Flag condition to show icon only or icon with label\n */\n @Prop() iconsOnly: boolean;\n\n\n @Element() host: HTMLElement;\n @State() contacts: any = salla.config.get('store.contacts');\n @State() iconsList: any = { mobile, whatsapp, phone, telegram, email }\n private getContactsArray() {\n return Object.entries(this.contacts)\n .filter(([_key, value]) => value !== '')\n .map(([type, value]) => ({ type, value }));\n }\n\n private getContactLink(type) {\n const contactValue = this.contacts[type];\n switch (type) {\n case 'phone':\n case 'mobile':\n return `tel:${contactValue}`;\n case 'whatsapp':\n return salla.url.get('whatsapp/send');\n case 'email':\n return `mailto:${contactValue}`;\n case 'telegram':\n // Check if the contact is already a full URL\n return contactValue.startsWith('https://t.me/') ? contactValue : `https://t.me/${contactValue}`;\n default:\n return contactValue;\n }\n }\n private getContactIcon(type) {\n return this.iconsList[type];\n }\n\n componentWillLoad() {\n return new Promise(resolve => salla.onReady(resolve));\n }\n\n\n render() {\n \n const contactsArray = this.getContactsArray();\n\n if(!contactsArray || contactsArray.length == 0){\n return\n }\n\n if (this.isHeader) {\n return (\n <Host class=\"s-contacts s-contacts-header\">\n {contactsArray.filter((contact) => contact.type == 'phone' || contact.type == 'email').map((contact, index) => (\n <a href={this.getContactLink(contact.type)} key={index} class=\"s-contacts-topnav-link\">\n {contact.type === 'email' ? (\n contact.value\n ) : (\n [\n <span>{this.contactsTitle}: </span>,\n <a class=\"unicode\" href={this.iconsList[contact.type]}>{contact.value}</a>\n ]\n )}\n </a>\n ))}\n </Host>\n );\n }\n\n return (\n <Host class=\"s-contacts\">\n {!this.hideTitle && <h3 class=\"s-contacts-title\">{this.contactsTitle}</h3>}\n <div class={{\n 's-contacts-list': true,\n 's-contacts-list-horizontal': this.horizontal,\n 's-contacts-list-vertical': !this.horizontal,\n 's-contacts-list-icons-only': this.iconsOnly\n }\n }>\n {contactsArray.map((contact, index) => (\n <div key={index} id=\"contact-slot\" innerHTML={this.contactSlot\n .replace(/\\{icon\\}/g, this.getContactIcon(contact.type))\n .replace(/\\{value\\}/g, contact.value.toString())\n .replace(/\\{link\\}/g, this.getContactLink(contact.type))}>\n </div>\n ))}\n </div>\n </Host>\n );\n }\n componentDidRender() {\n // this.host.querySelectorAll('#contact-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelector('[slot=\"contact\"]')?.remove();\n }\n}\n\n"],"names":["email"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAA,MAAM,gBAAgB,GAAG,iEAAiE;;YCa7E,aAAa,6BAAA,MAAA;MACxB,IAAA,WAAA,CAAA,OAAA,EAAA;;;cAwCS,IAAQ,CAAA,QAAA,GAAQ,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC;MAClD,QAAA,IAAA,CAAA,SAAS,GAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,SAAEA,QAAK,EAAE;cAxCpE,IAAI,CAAC,WAAW,GAAG,CAAA,CAAA,EAAA,GAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,SAAS,KAAI,CAAA,kFAAA,EAAqF,CAAC,IAAI,CAAC,SAAS,IAAI,sCAAsC,MAAM;MAEjO,QAAA,KAAK,CAAC,OAAO,CAAC,MAAK;kBACjB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC;MACpD,SAAC,CAAC;MAEF,QAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAK;MACvB,YAAA,IAAI,CAAC,aAAa,GAAI,IAAI,CAAC,aAAa,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,sBAAsB,CAAC;MACpF,SAAC,CAAC;MACH;UAgCO,gBAAgB,GAAA;MACtB,QAAA,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ;MAChC,aAAA,MAAM,CAAC,CAAC,CAAC,IAAI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