@salla.sa/twilight-components 2.14.162 → 2.14.164
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-B6E-4pY_.js → app-globals-B0FX8nrF.js} +3 -3
- package/dist/cjs/{app-globals-B6E-4pY_.js.map → app-globals-B0FX8nrF.js.map} +1 -1
- package/dist/cjs/{index-DVBhH7TC.js → index-BQogR_9w.js} +4 -4
- package/dist/cjs/{index-DVBhH7TC.js.map → index-BQogR_9w.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-add-product-button_49.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers.cjs.entry.js +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 +30 -23
- package/dist/cjs/salla-installment.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-installment.entry.cjs.js.map +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/collection/components/salla-installment/salla-installment.js +29 -22
- package/dist/collection/components/salla-installment/salla-installment.js.map +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/salla-installment.js +29 -22
- package/dist/components/salla-installment.js.map +1 -1
- package/dist/esm/{app-globals-ClMeMb2U.js → app-globals-IYG3dX-R.js} +3 -3
- package/dist/esm/{app-globals-ClMeMb2U.js.map → app-globals-IYG3dX-R.js.map} +1 -1
- package/dist/esm/{index-BAgazOp0.js → index-BFfNxHPV.js} +4 -4
- package/dist/esm/{index-BAgazOp0.js.map → index-BFfNxHPV.js.map} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-add-product-button_49.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-booking-field_2.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers.entry.js +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 +30 -23
- package/dist/esm/salla-installment.entry.js.map +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +1 -1
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-options.entry.js +1 -1
- package/dist/esm/salla-review-card.entry.js +1 -1
- package/dist/esm/salla-reviews-page.entry.js +1 -1
- package/dist/esm/salla-reviews.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm-es5/{app-globals-ClMeMb2U.js → app-globals-IYG3dX-R.js} +2 -2
- package/dist/esm-es5/{app-globals-ClMeMb2U.js.map → app-globals-IYG3dX-R.js.map} +1 -1
- package/dist/esm-es5/{index-BAgazOp0.js → index-BFfNxHPV.js} +3 -3
- package/dist/esm-es5/{index-BAgazOp0.js.map → index-BFfNxHPV.js.map} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-add-product-button_49.entry.js +1 -1
- package/dist/esm-es5/salla-advertisement.entry.js +1 -1
- package/dist/esm-es5/salla-app-install-alert.entry.js +1 -1
- package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
- package/dist/esm-es5/salla-booking-field_2.entry.js +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 +2 -2
- package/dist/esm-es5/salla-installment.entry.js.map +1 -1
- package/dist/esm-es5/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm-es5/salla-metadata.entry.js +1 -1
- package/dist/esm-es5/salla-notification-item.entry.js +1 -1
- package/dist/esm-es5/salla-notifications.entry.js +1 -1
- package/dist/esm-es5/salla-offer.entry.js +1 -1
- package/dist/esm-es5/salla-order-summary.entry.js +1 -1
- package/dist/esm-es5/salla-orders.entry.js +1 -1
- package/dist/esm-es5/salla-payments.entry.js +1 -1
- package/dist/esm-es5/salla-price-range.entry.js +1 -1
- package/dist/esm-es5/salla-product-options.entry.js +1 -1
- package/dist/esm-es5/salla-review-card.entry.js +1 -1
- package/dist/esm-es5/salla-reviews-page.entry.js +1 -1
- package/dist/esm-es5/salla-reviews.entry.js +1 -1
- package/dist/esm-es5/salla-social.entry.js +1 -1
- package/dist/esm-es5/salla-tooltip.entry.js +1 -1
- package/dist/esm-es5/salla-verify.entry.js +1 -1
- package/dist/esm-es5/salla-wallet.entry.js +1 -1
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/twilight/p-03eeed12.entry.js +5 -0
- package/dist/twilight/p-03eeed12.entry.js.map +1 -0
- package/dist/twilight/{p-5698c6e9.entry.js → p-07be7362.entry.js} +2 -2
- package/dist/twilight/{p-3da333b4.entry.js → p-0a352565.entry.js} +2 -2
- package/dist/twilight/{p-e65f4bcc.system.entry.js → p-0bfcfa47.system.entry.js} +2 -2
- package/dist/twilight/{p-c0a421db.entry.js → p-0df2ce1c.entry.js} +2 -2
- package/dist/twilight/{p-1c96e9e1.entry.js → p-112a3593.entry.js} +2 -2
- package/dist/twilight/{p-d7e07c0a.entry.js → p-15ac73d8.entry.js} +2 -2
- package/dist/twilight/p-18cad003.system.entry.js +5 -0
- package/dist/twilight/p-18cad003.system.entry.js.map +1 -0
- package/dist/twilight/{p-dd9dedcc.system.entry.js → p-1fe13a36.system.entry.js} +2 -2
- package/dist/twilight/{p-1144f0cc.system.entry.js → p-283e5d2a.system.entry.js} +2 -2
- package/dist/twilight/{p-bd52b7f7.entry.js → p-28d837ee.entry.js} +2 -2
- package/dist/twilight/{p-07fb96e9.system.entry.js → p-2c742cef.system.entry.js} +2 -2
- package/dist/twilight/{p-65c34bb4.entry.js → p-2ce0a07a.entry.js} +2 -2
- package/dist/twilight/{p-c4201c0c.system.entry.js → p-2f7a8fd5.system.entry.js} +2 -2
- package/dist/twilight/{p-3d344929.entry.js → p-325e8a3e.entry.js} +2 -2
- package/dist/twilight/{p-d0e09b35.system.entry.js → p-34e55241.system.entry.js} +2 -2
- package/dist/twilight/{p-f1d1d12a.entry.js → p-35130be1.entry.js} +2 -2
- package/dist/twilight/{p-9b225347.system.entry.js → p-37904a9d.system.entry.js} +2 -2
- package/dist/twilight/{p-e3a80897.entry.js → p-3fc226d0.entry.js} +2 -2
- package/dist/twilight/{p-a6a8fa7f.system.entry.js → p-489c4e43.system.entry.js} +2 -2
- package/dist/twilight/{p-c34cc2fa.system.entry.js → p-594e29ef.system.entry.js} +2 -2
- package/dist/twilight/{p-f63e9987.system.entry.js → p-60e44e99.system.entry.js} +2 -2
- package/dist/twilight/{p-2255f5b7.system.entry.js → p-652c3a18.system.entry.js} +2 -2
- package/dist/twilight/p-66f5c6cb.entry.js +5 -0
- package/dist/twilight/{p-3866ee61.entry.js → p-679bcc4c.entry.js} +2 -2
- package/dist/twilight/{p-0277170f.system.entry.js → p-6f789c6a.system.entry.js} +2 -2
- package/dist/twilight/{p-340df9d9.system.entry.js → p-70db2fda.system.entry.js} +2 -2
- package/dist/twilight/{p-d902613d.entry.js → p-73c55156.entry.js} +2 -2
- package/dist/twilight/{p-2937aaed.entry.js → p-77aa48a9.entry.js} +2 -2
- package/dist/twilight/{p-0f0ab2e4.entry.js → p-780e11a1.entry.js} +2 -2
- package/dist/twilight/{p-89a93269.entry.js → p-801b8cf5.entry.js} +2 -2
- package/dist/twilight/{p-15cf96c0.system.entry.js → p-8128a6af.system.entry.js} +2 -2
- package/dist/twilight/{p-80e74360.system.entry.js → p-87eef8f5.system.entry.js} +2 -2
- package/dist/twilight/{p-CDMS4kGP.system.js.map → p-8lfy7oMG.system.js.map} +1 -1
- package/dist/twilight/{p-bd030a5f.entry.js → p-94338a6a.entry.js} +2 -2
- package/dist/twilight/{p-3531148c.entry.js → p-9900d67e.entry.js} +2 -2
- package/dist/twilight/{p-CaaH6iVg.system.js.map → p-B4QYa22q.system.js.map} +1 -1
- package/dist/twilight/{p-B68LmBtA.system.js.map → p-B8H8Zffc.system.js.map} +1 -1
- package/dist/twilight/{p-DUoUsmUD.system.js.map → p-B8TjwvAx.system.js.map} +1 -1
- package/dist/twilight/p-BC573MOT.system.js.map +1 -0
- package/dist/twilight/{p-BelmlCbB.system.js.map → p-BEq2XgoL.system.js.map} +1 -1
- package/dist/twilight/{p-BAgazOp0.js → p-BFfNxHPV.js} +3 -3
- package/dist/twilight/{p-BAgazOp0.js.map → p-BFfNxHPV.js.map} +1 -1
- package/dist/twilight/{p-BgcZRMjq.system.js.map → p-Bco_IRd2.system.js.map} +1 -1
- package/dist/twilight/{p-Cnlp7WPK.system.js.map → p-BmBnW84t.system.js.map} +1 -1
- package/dist/twilight/{p-CN68OUog.system.js.map → p-Bx-N-s4Y.system.js.map} +1 -1
- package/dist/twilight/{p-dX0LXhL0.system.js.map → p-C5EBG2Xg.system.js.map} +1 -1
- package/dist/twilight/{p-CE8dLGRS.system.js.map → p-C6uUYgzy.system.js.map} +1 -1
- package/dist/twilight/{p-ZT0r7Vji.system.js.map → p-CCj5pPN3.system.js.map} +1 -1
- package/dist/twilight/{p-JJlMEMMy.system.js.map → p-CJdQn5Cx.system.js.map} +1 -1
- package/dist/twilight/{p-Bylm5Uue.system.js.map → p-CSzSey6x.system.js.map} +1 -1
- package/dist/twilight/{p-VO5PlUPy.js → p-CV1L1K1F.js} +2 -2
- package/dist/twilight/{p-VO5PlUPy.js.map → p-CV1L1K1F.js.map} +1 -1
- package/dist/twilight/{p-BP-3aNPQ.system.js → p-Cb1UIzZb.system.js} +3 -3
- package/dist/twilight/{p-BP-3aNPQ.system.js.map → p-Cb1UIzZb.system.js.map} +1 -1
- package/dist/twilight/{p-NL7lhOit.system.js.map → p-Cbt3VvMx.system.js.map} +1 -1
- package/dist/twilight/{p-6hh4-Sgb.system.js.map → p-CerWahQp.system.js.map} +1 -1
- package/dist/twilight/{p-DItIi-Ay.system.js.map → p-D06Xx0Te.system.js.map} +1 -1
- package/dist/twilight/{p-DwnOZ1nH.system.js.map → p-DD-NUH5O.system.js.map} +1 -1
- package/dist/twilight/{p-BbucfO9P.system.js.map → p-DGrVZP6D.system.js.map} +1 -1
- package/dist/twilight/{p-nihSuODs.system.js.map → p-DHMPrdpB.system.js.map} +1 -1
- package/dist/twilight/{p-Q5nQyhzS.system.js.map → p-DQ6WGq9O.system.js.map} +1 -1
- package/dist/twilight/{p-BAB4wk9F.system.js.map → p-DW6tScyV.system.js.map} +1 -1
- package/dist/twilight/{p-DVQN0dWH.system.js.map → p-DeLChKCk.system.js.map} +1 -1
- package/dist/twilight/{p-DqktXZ1j.system.js.map → p-DyiYfLs6.system.js.map} +1 -1
- package/dist/twilight/{p-BhUesIYA.system.js → p-Dz_hUkbF.system.js} +2 -2
- package/dist/twilight/{p-BhUesIYA.system.js.map → p-Dz_hUkbF.system.js.map} +1 -1
- package/dist/twilight/{p-CF_iZ4z8.system.js.map → p-LTc0kKzI.system.js.map} +1 -1
- package/dist/twilight/{p-DdZBhqPL.system.js.map → p-UtROhnoT.system.js.map} +1 -1
- package/dist/twilight/{p-027a26ca.entry.js → p-a4335e96.entry.js} +2 -2
- package/dist/twilight/{p-ef820569.system.entry.js → p-a57e5439.system.entry.js} +2 -2
- package/dist/twilight/{p-2f1b791f.entry.js → p-a6ab5583.entry.js} +2 -2
- package/dist/twilight/{p-72870e81.entry.js → p-acd4ad3d.entry.js} +2 -2
- package/dist/twilight/{p-eedf88ca.entry.js → p-b45186d2.entry.js} +2 -2
- package/dist/twilight/{p-0762eaf0.system.entry.js → p-bced4dd5.system.entry.js} +2 -2
- package/dist/twilight/{p-cd3d3d9e.entry.js → p-bef3244d.entry.js} +2 -2
- package/dist/twilight/{p-f83a6213.system.entry.js → p-c8fa97ee.system.entry.js} +2 -2
- package/dist/twilight/{p-da3d01a8.system.entry.js → p-cf17e7f5.system.entry.js} +2 -2
- package/dist/twilight/{p-f13b5369.entry.js → p-d30e3efe.entry.js} +2 -2
- package/dist/twilight/{p-ec77fc2c.system.entry.js → p-d9e539ba.system.entry.js} +2 -2
- package/dist/twilight/{p-f774d0f8.system.entry.js → p-e0f20b16.system.entry.js} +2 -2
- package/dist/twilight/{p-dfd82b7c.system.entry.js → p-e803e9c9.system.entry.js} +2 -2
- package/dist/twilight/{p-2fb1561f.system.entry.js → p-ea2a8ec3.system.entry.js} +2 -2
- package/dist/twilight/{p-3296b6bd.system.entry.js → p-f047dc2e.system.entry.js} +2 -2
- package/dist/twilight/{p-2abce66f.entry.js → p-f14d4763.entry.js} +2 -2
- package/dist/twilight/{p-e0ffe47b.entry.js → p-f1f76cad.entry.js} +2 -2
- package/dist/twilight/{p-d0916218.system.entry.js → p-f2fb025f.system.entry.js} +2 -2
- package/dist/twilight/{p-CJI7mKPQ.system.js → p-fIRBYbgk.system.js} +2 -2
- package/dist/twilight/{p-CJI7mKPQ.system.js.map → p-fIRBYbgk.system.js.map} +1 -1
- package/dist/twilight/{p-93fb0898.system.entry.js → p-fde43494.system.entry.js} +2 -2
- package/dist/twilight/{p-88161830.entry.js → p-fe73d1f4.entry.js} +2 -2
- package/dist/twilight/{p-a592978e.system.entry.js → p-feb47683.system.entry.js} +2 -2
- package/dist/twilight/{p-CCC4Uq6-.system.js.map → p-nlqrWEsa.system.js.map} +1 -1
- package/dist/twilight/{p-BFC-QAwC.system.js.map → p-t7kMTbsj.system.js.map} +1 -1
- package/dist/twilight/{p-DeIiMaDx.system.js.map → p-wVh4stgZ.system.js.map} +1 -1
- package/dist/twilight/salla-installment.entry.esm.js.map +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/dist/types/components/salla-installment/salla-installment.d.ts +2 -1
- package/package.json +5 -5
- package/dist/twilight/p-469ecc5e.entry.js +0 -5
- package/dist/twilight/p-469ecc5e.entry.js.map +0 -1
- package/dist/twilight/p-DRrDghLw.system.js.map +0 -1
- package/dist/twilight/p-a429b5d7.entry.js +0 -5
- package/dist/twilight/p-e83a6e58.system.entry.js +0 -5
- package/dist/twilight/p-e83a6e58.system.entry.js.map +0 -1
- /package/dist/twilight/{p-5698c6e9.entry.js.map → p-07be7362.entry.js.map} +0 -0
- /package/dist/twilight/{p-3da333b4.entry.js.map → p-0a352565.entry.js.map} +0 -0
- /package/dist/twilight/{p-e65f4bcc.system.entry.js.map → p-0bfcfa47.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-c0a421db.entry.js.map → p-0df2ce1c.entry.js.map} +0 -0
- /package/dist/twilight/{p-1c96e9e1.entry.js.map → p-112a3593.entry.js.map} +0 -0
- /package/dist/twilight/{p-d7e07c0a.entry.js.map → p-15ac73d8.entry.js.map} +0 -0
- /package/dist/twilight/{p-dd9dedcc.system.entry.js.map → p-1fe13a36.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-1144f0cc.system.entry.js.map → p-283e5d2a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-bd52b7f7.entry.js.map → p-28d837ee.entry.js.map} +0 -0
- /package/dist/twilight/{p-07fb96e9.system.entry.js.map → p-2c742cef.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-65c34bb4.entry.js.map → p-2ce0a07a.entry.js.map} +0 -0
- /package/dist/twilight/{p-c4201c0c.system.entry.js.map → p-2f7a8fd5.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-3d344929.entry.js.map → p-325e8a3e.entry.js.map} +0 -0
- /package/dist/twilight/{p-d0e09b35.system.entry.js.map → p-34e55241.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-f1d1d12a.entry.js.map → p-35130be1.entry.js.map} +0 -0
- /package/dist/twilight/{p-9b225347.system.entry.js.map → p-37904a9d.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e3a80897.entry.js.map → p-3fc226d0.entry.js.map} +0 -0
- /package/dist/twilight/{p-a6a8fa7f.system.entry.js.map → p-489c4e43.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-c34cc2fa.system.entry.js.map → p-594e29ef.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-f63e9987.system.entry.js.map → p-60e44e99.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2255f5b7.system.entry.js.map → p-652c3a18.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-a429b5d7.entry.js.map → p-66f5c6cb.entry.js.map} +0 -0
- /package/dist/twilight/{p-3866ee61.entry.js.map → p-679bcc4c.entry.js.map} +0 -0
- /package/dist/twilight/{p-0277170f.system.entry.js.map → p-6f789c6a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-340df9d9.system.entry.js.map → p-70db2fda.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-d902613d.entry.js.map → p-73c55156.entry.js.map} +0 -0
- /package/dist/twilight/{p-2937aaed.entry.js.map → p-77aa48a9.entry.js.map} +0 -0
- /package/dist/twilight/{p-0f0ab2e4.entry.js.map → p-780e11a1.entry.js.map} +0 -0
- /package/dist/twilight/{p-89a93269.entry.js.map → p-801b8cf5.entry.js.map} +0 -0
- /package/dist/twilight/{p-15cf96c0.system.entry.js.map → p-8128a6af.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-80e74360.system.entry.js.map → p-87eef8f5.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-bd030a5f.entry.js.map → p-94338a6a.entry.js.map} +0 -0
- /package/dist/twilight/{p-3531148c.entry.js.map → p-9900d67e.entry.js.map} +0 -0
- /package/dist/twilight/{p-027a26ca.entry.js.map → p-a4335e96.entry.js.map} +0 -0
- /package/dist/twilight/{p-ef820569.system.entry.js.map → p-a57e5439.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2f1b791f.entry.js.map → p-a6ab5583.entry.js.map} +0 -0
- /package/dist/twilight/{p-72870e81.entry.js.map → p-acd4ad3d.entry.js.map} +0 -0
- /package/dist/twilight/{p-eedf88ca.entry.js.map → p-b45186d2.entry.js.map} +0 -0
- /package/dist/twilight/{p-0762eaf0.system.entry.js.map → p-bced4dd5.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-cd3d3d9e.entry.js.map → p-bef3244d.entry.js.map} +0 -0
- /package/dist/twilight/{p-f83a6213.system.entry.js.map → p-c8fa97ee.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-da3d01a8.system.entry.js.map → p-cf17e7f5.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-f13b5369.entry.js.map → p-d30e3efe.entry.js.map} +0 -0
- /package/dist/twilight/{p-ec77fc2c.system.entry.js.map → p-d9e539ba.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-f774d0f8.system.entry.js.map → p-e0f20b16.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-dfd82b7c.system.entry.js.map → p-e803e9c9.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2fb1561f.system.entry.js.map → p-ea2a8ec3.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-3296b6bd.system.entry.js.map → p-f047dc2e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2abce66f.entry.js.map → p-f14d4763.entry.js.map} +0 -0
- /package/dist/twilight/{p-e0ffe47b.entry.js.map → p-f1f76cad.entry.js.map} +0 -0
- /package/dist/twilight/{p-d0916218.system.entry.js.map → p-f2fb025f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-93fb0898.system.entry.js.map → p-fde43494.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-88161830.entry.js.map → p-fe73d1f4.entry.js.map} +0 -0
- /package/dist/twilight/{p-a592978e.system.entry.js.map → p-feb47683.system.entry.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as registerInstance,h,H as Host}from"./index-
|
|
4
|
+
import{r as registerInstance,h,H as Host}from"./index-BFfNxHPV.js";var DiscountType;(function(i){i["PERCENTAGE"]="percentage";i["FIXED"]="fixed";i["FREE_PRODUCT"]="free_product"})(DiscountType||(DiscountType={}));var OfferType;(function(i){i["PRODUCT_COUNT"]="products_count";i["PRODUCT_PURCHASE"]="order_amount"})(OfferType||(OfferType={}));var sallaConditionalOfferCss=":host{display:block}";var SallaConditionalOffer=function(){function i(i){registerInstance(this,i);this.offer=null;this.products={};this.isLoading=true;this.canRender=true}i.prototype.componentWillLoad=function(){var i=this;salla.onReady().then((function(){var i,n,t;if(!((i=salla.config.get("store.features"))===null||i===void 0?void 0:i.includes("conditional-offer"))||salla.storage.get("cart")!==""&&!((t=(n=salla.storage.get("cart"))===null||n===void 0?void 0:n.summary)===null||t===void 0?void 0:t.count)){throw new Error("feature or cart object does not existed")}})).then((function(){return salla.api.cart.offers()})).then((function(n){var t=n.data;i.offer=t.find((function(i){return i.type==="conditional"}));if(!i.offer){throw new Error("No conditional offer has been activated in the merchant dashboard")}i.offer.details.discounts.unshift({value:0,min_spend:0});return i.updateInitialOfferValue()})).then((function(){return i.getProducts()})).then((function(){return salla.event.on("cart::updated",(function(n){return i.updateOfferValues(n)}))})).catch((function(n){i.canRender=false;salla.logger.warn("salla-conditional-offer:: ",n)})).finally((function(){i.isLoading=false}))};i.prototype.getProducts=function(){var i=this;var n=this.offer.details.discounts.filter((function(i){var n=i.type;return n===DiscountType.FREE_PRODUCT})).map((function(i){var n=i.value;return n}));if(n.length>0){return salla.product.fetch({source:"selected",source_value:n}).then((function(n){var t=n.data;t.forEach((function(n){var t=n.id,e=n.url,o=n.image;i.products[t]={url:e,image:o}}))}))}};i.prototype.updateInitialOfferValue=function(){var i=this;return salla.api.cart.details().then((function(n){var t=n.data.cart;return i.updateOfferValues(t)}))};i.prototype.updateOfferValues=function(i){var n=i.items,t=i.total;var e;var o=this.offer.details.based_on===OfferType.PRODUCT_COUNT?n.reduce((function(i,n){var t=n.quantity;return i+t}),0):t;this.offer=Object.assign(Object.assign({},this.offer),{details:Object.assign(Object.assign({},(e=this.offer)===null||e===void 0?void 0:e.details),{current_value:o})});return this.offer};i.prototype.getCheckpointContent=function(i){var n,t;if(i.type===DiscountType.PERCENTAGE)return"".concat(i.value,"%");if(i.type===DiscountType.FIXED)return salla.money(i.value);if(i.type!==DiscountType.FREE_PRODUCT){salla.logger.error("salla-conditional-offer:: unexpected type (".concat(i.type,")!"));return""}var e=this.products[i.value];if(!e){salla.logger.error("salla-conditional-offer:: there is no product with id (".concat(i.value,")!"));return""}return h("a",{class:"s-conditional-offer-product-link",href:e.url},h("img",{class:"s-conditional-offer-checkpoint-image-content",loading:"lazy",decoding:"async",alt:((n=e===null||e===void 0?void 0:e.image)===null||n===void 0?void 0:n.alt)||"",src:(t=e===null||e===void 0?void 0:e.image)===null||t===void 0?void 0:t.url}))};i.prototype.getOfferType=function(i){var n;var t=(n=this.offer.details)===null||n===void 0?void 0:n.based_on;if(t===OfferType.PRODUCT_COUNT)return salla.lang.choice("blocks.header.products_count",i.min_spend);if(t===OfferType.PRODUCT_PURCHASE)return salla.money(i.min_spend);salla.logger.warn("salla-conditional-offer:: Unexpected offer detail's based_on value: ".concat(t));return"".concat(i.min_spend)};i.prototype.clamp=function(i,n,t){return Math.max(n,Math.min(i,t))};i.prototype.mapValueRanges=function(i,n,t,e,o){var r=(i-n)*(o-e)/(t-n)+e;if(r===Number.POSITIVE_INFINITY)return 100;if(r===Number.NEGATIVE_INFINITY)return 0;return this.clamp(r,0,100)};i.prototype.getCheckPointView=function(i,n){var t,e;var o=this.offer.details.discounts.findIndex((function(n){var t=n.min_spend;return t===i.min_spend}));var r=(e=(t=this.offer.details.discounts[o-1])===null||t===void 0?void 0:t.min_spend)!==null&&e!==void 0?e:0;var a=this.mapValueRanges(this.offer.details.current_value,r,i.min_spend,0,100);var s=i.min_spend<=this.offer.details.current_value;return h("div",{class:"s-conditional-offer-checkpoint-container"},n>0?[h("div",{key:"progress-line",class:"s-conditional-offer-progress-line-container"},h("div",{class:"s-conditional-offer-progress-line-inactive"}),h("div",{class:"s-conditional-offer-progress-line-active",style:{width:"".concat(a,"%")}})),h("div",{key:"checkpoint",class:"s-conditional-offer-checkpoint ".concat(s?"s-conditional-offer-active-checkpoint":"")},h("div",{class:"s-conditional-offer-item-avatar-content ".concat(s?"active":""),innerHTML:this.products&&this.getCheckpointContent(i)}),h("div",{class:"s-conditional-offer-checkpoint-label ".concat(s?"active":""),innerHTML:this.getOfferType(i)}))]:h("div",{key:"label",class:{"s-conditional-offer-checkpoint-label":true,"first-checkpoint":n===0,active:s},innerHTML:this.getOfferType(i)}))};i.prototype.getLoadingSkeletonView=function(){return h(Host,{class:"s-conditional-offer-container"},h("div",{class:"s-conditional-offer-skeleton-inner-container"},h("div",{class:"s-conditional-offer-skeleton-subtitle"},h("salla-skeleton",{height:"16px",width:"30%"})),h("div",{class:"s-conditional-offer-skeleton-subtitle"},h("salla-skeleton",{height:"16px",width:"35%"})),h("div",{class:"s-conditional-offer-skeleton-checkpoints-wrapper"},Array(3).fill(null).map((function(){return[h("salla-skeleton",{key:"checkpoint-line",height:"8px"}),h("div",{key:"checkpoint"},h("salla-skeleton",{height:"60px",width:"60px",type:"circle"}))]})))))};i.prototype.render=function(){var i=this;if(!this.canRender)return null;if(this.isLoading)return this.getLoadingSkeletonView();return h(Host,{class:"s-conditional-offer-container"},h("div",{class:"s-conditional-offer-title-wrapper"},h("div",{class:"s-conditional-offer-title"},this.offer.title),this.offer.description?h("div",{class:"s-conditional-offer-subtitle"},this.offer.description," ",h("i",{class:"sicon-information"})):null),h("div",{class:"s-conditional-offer-progress-container"},this.offer.details.discounts.map((function(n,t){return h("div",{class:{"flex-1":t>0},key:n.min_spend},i.getCheckPointView(n,t))}))))};return i}();SallaConditionalOffer.style=sallaConditionalOfferCss;export{SallaConditionalOffer as salla_conditional_offer};
|
|
5
5
|
//# sourceMappingURL=salla-conditional-offer.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as registerInstance,h,H as Host,g as getElement}from"./index-
|
|
4
|
+
import{r as registerInstance,h,H as Host,g as getElement}from"./index-BFfNxHPV.js";import{w as whatsapp}from"./whatsapp2-DWksgowB.js";import{M as MailIcon}from"./mail-DmgxDvXL.js";var mobile='\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 phone='\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 telegram='\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';var sallaContactsCss=".unicode{unicode-bidi:-webkit-plaintext;unicode-bidi:plaintext}";var SallaContacts=function(){function t(t){var s=this;registerInstance(this,t);var n;this.contacts=salla.config.get("store.contacts");this.iconsList={mobile:mobile,whatsapp:whatsapp,phone:phone,telegram:telegram,email:MailIcon};this.contactSlot=((n=this.host.querySelector('[slot="contact"]'))===null||n===void 0?void 0:n.innerHTML)||'<a href={link} class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>'.concat(!this.iconsOnly&&"<span class='unicode'>{value}</span>","</a>");salla.onReady((function(){s.contacts=salla.config.get("store.contacts")}));salla.lang.onLoaded((function(){s.contactsTitle=s.contactsTitle||salla.lang.get("blocks.footer.social")}))}t.prototype.getContactsArray=function(){return Object.entries(this.contacts).filter((function(t){var s=t[0],n=t[1];return n!==""})).map((function(t){var s=t[0],n=t[1];return{type:s,value:n}}))};t.prototype.getContactLink=function(t){var s=this.contacts[t];switch(t){case"phone":case"mobile":return"tel:".concat(s);case"whatsapp":return salla.url.get("whatsapp/send");case"email":return"mailto:".concat(s);case"telegram":return s.startsWith("https://t.me/")?s:"https://t.me/".concat(s);default:return s}};t.prototype.getContactIcon=function(t){return this.iconsList[t]};t.prototype.componentWillLoad=function(){return new Promise((function(t){return salla.onReady(t)}))};t.prototype.render=function(){var t=this;var s=this.getContactsArray();if(!s||s.length==0){return}if(this.isHeader){return h(Host,{class:"s-contacts s-contacts-header"},s.filter((function(t){return t.type=="phone"||t.type=="email"})).map((function(s,n){return h("a",{href:t.getContactLink(s.type),key:n,class:"s-contacts-topnav-link"},s.type==="email"?s.value:[h("span",null,t.contactsTitle,": "),h("a",{class:"unicode",href:t.iconsList[s.type]},s.value)])})))}return h(Host,{class:"s-contacts"},!this.hideTitle&&h("h3",{class:"s-contacts-title"},this.contactsTitle),h("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}},s.map((function(s,n){return h("div",{key:n,id:"contact-slot",innerHTML:t.contactSlot.replace(/\{icon\}/g,t.getContactIcon(s.type)).replace(/\{value\}/g,s.value.toString()).replace(/\{link\}/g,t.getContactLink(s.type))})}))))};t.prototype.componentDidRender=function(){var t;(t=this.host.querySelector('[slot="contact"]'))===null||t===void 0?void 0:t.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaContacts.style=sallaContactsCss;export{SallaContacts as salla_contacts};
|
|
5
5
|
//# sourceMappingURL=salla-contacts.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,e,i,n){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,s){function a(t){try{c(n.next(t))}catch(t){s(t)}}function o(t){try{c(n["throw"](t))}catch(t){s(t)}}function c(t){t.done?i(t.value):r(t.value).then(a,o)}c((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,r,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(t){return function(e){return c([t,e])}}function c(o){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,o[0]&&(i=0)),i)try{if(n=1,r&&(s=o[0]&2?r["return"]:o[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,o[1])).done)return s;if(r=0,s)o=[o[0]&2,s.value];switch(o[0]){case 0:case 1:s=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;r=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!s||o[1]>s[0]&&o[1]<s[3])){i.label=o[1];break}if(o[0]===6&&i.label<s[1]){i.label=s[1];s=o;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(o);break}if(s[2])i.ops.pop();i.trys.pop();continue}o=e.call(t,i)}catch(t){o=[6,t];r=0}finally{n=s=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
|
-
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-
|
|
4
|
+
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-BFfNxHPV.js";import{H as Helper}from"./Helper-BrCHOtZG.js";import{F as FilterOptionTypes}from"./interfaces-DL4h2bc3.js";import"./anime.es-CgtvEd63.js";var sallaFiltersWidgetCss=":host{display:block}";var SallaFiltersWidget=function(){function t(t){registerInstance(this,t);this.changed=createEvent(this,"changed");this.initHeight=195;this.isOpen=true;this.isShowMore=false;this.showMoreLabel="عرض المزيد";this.showLessLabel="عرض أقل";this.page=salla.config.get("page")}t.prototype.connectedCallback=function(){var t=this;this.withLoadMore=this.option.key!="price"&&Array.isArray(this.option.values)&&this.option.values.length>8;salla.onReady((function(){t.page=salla.config.get("page")}));salla.lang.onLoaded((function(){t.showMoreLabel=salla.lang.getWithDefault("common.titles.more",t.showMoreLabel);t.showLessLabel=salla.lang.getWithDefault("common.elements.show_less",t.showLessLabel)}))};t.prototype.componentDidLoad=function(){this.widgetValues.scrollHeight<this.initHeight&&(this.withLoadMore=false);this.withLoadMore&&this.widgetValues&&(this.widgetValues.style.maxHeight="".concat(this.initHeight,"px"));this.widgetContent.style.height="".concat(this.widgetContent.scrollHeight,"px")};t.prototype.setWidgetHeight=function(){return __awaiter(this,arguments,void 0,(function(t){var e=this;if(t===void 0){t=250}return __generator(this,(function(i){this.widgetContent.removeAttribute("style");setTimeout((function(){var t=e.widgetContent.scrollHeight;e.widgetContent.style.height=t+"px"}),t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.option.type===FilterOptionTypes.RANGE){this.priceRange.reset()}Array.from(this.host.querySelectorAll("input")).forEach((function(t){return t.checked=false}));return[2]}))}))};t.prototype.showMore=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.isShowMore=!this.isShowMore;this.widgetContent.style.height="auto";this.widgetValues.style.maxHeight=this.isShowMore?"".concat(this.widgetValues.scrollHeight,"px"):"".concat(this.initHeight,"px");setTimeout((function(){t.widgetContent.style.height="".concat(t.widgetContent.scrollHeight,"px")}),400);return[2]}))}))};t.prototype.toggleWidget=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.isOpen=!this.isOpen;Helper.toggleElementClassIf(this.widgetContent,"s-filters-widget-opened","s-filters-widget-closed",(function(){return t.isOpen}));return[2]}))}))};t.prototype.renderFilterOption=function(t){var e=this;if(![FilterOptionTypes.VALUES,FilterOptionTypes.MINIMUM,FilterOptionTypes.VARIANTS].includes(t.type)){return""}return t.values.map((function(i,n){var r=typeof i=="number"?i:i.key||i.value;return h("label",{class:"s-filters-label",htmlFor:"".concat(t.key,"-option-").concat(r),key:"".concat(t.key,"-option-").concat(r)},h("input",{id:"".concat(t.key,"-option-").concat(r),name:t.key,type:"radio",checked:e.isSelectedOption(t,r),class:"s-filters-radio",onChange:function(i){return e.changed.emit({event:i,option:t,value:r})}}),e.getOptionLabel(t,i))}))};t.prototype.isSelectedOption=function(t,e){if(t.type===FilterOptionTypes.MINIMUM){return this.filtersData[t.key]==e}if(t.type===FilterOptionTypes.VARIANTS){return this.filtersData[t.type]&&this.filtersData[t.type][Object.keys(this.filtersData[t.type])[0]]==e}if(t.type===FilterOptionTypes.RANGE){return this.filtersData[t.key]&&this.filtersData[t.key].min==e.min&&this.filtersData[t.key].max==e.max}if(t.type===FilterOptionTypes.VALUES){return this.filtersData[t.key]&&Number(this.filtersData[t.key])==Number(e)}return false};t.prototype.getOptionLabel=function(t,e){if(t.key=="rating"){return h("salla-rating-stars",{size:"small",value:e})}var i=e.value||"null";return h("span",{class:"s-filters-option-name"},i)};t.prototype.render=function(){var t=this;return h(Host,{key:"faa16285c7c2dcd248f00230aa4b1eebc1814fdd",class:"s-filters-widget-container"},h("h3",{key:"019354d300116c2d567b75e5cc93d0d1dfc4785b",class:"s-filters-widget-title",onClick:function(){return t.toggleWidget()}},h("span",{key:"8ce2bc6a789a0f5d82308afad47cbae58467439a"},this.option.label),h("span",{key:"a5dcaa63ad18d41a324b499f36c82780c0670d4f",class:"s-filters-widget-plusminus ".concat(this.isOpen?"s-filters-widget-plusminus-active":"")})),h("div",{key:"bef8427341d94bb6eb6e37d9736f9ca3e9503058",class:"s-filters-widget-content",ref:function(e){return t.widgetContent=e}},h("div",{key:"451025fa922e84970107fe6ab2752db780effd86",class:"s-filters-widget-values",ref:function(e){return t.widgetValues=e}},h("slot",{key:"cbea119413f48c302684ae52c81786dcb69c6f29"}),this.option.type!==FilterOptionTypes.RANGE?this.renderFilterOption(this.option):h("salla-price-range",{onChanged:function(e){t.changed.emit(e.detail)},ref:function(e){return t.priceRange=e},filtersData:this.filtersData,option:this.option})),this.withLoadMore&&h("a",{key:"6b2e1b91b27509b445ad4af9367b4cc464bd2d4e",class:"s-filters-widget-more",onClick:function(){return t.showMore()}},!this.isShowMore?this.showMoreLabel:this.showLessLabel)))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaFiltersWidget.style=sallaFiltersWidgetCss;export{SallaFiltersWidget as salla_filters_widget};
|
|
5
5
|
//# sourceMappingURL=salla-filters-widget.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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,a){function s(t){try{l(i.next(t))}catch(t){a(t)}}function o(t){try{l(i["throw"](t))}catch(t){a(t)}}function l(t){t.done?r(t.value):n(t.value).then(s,o)}l((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(e){return l([t,e])}}function l(o){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(r=0)),r)try{if(i=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;n=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){r.label=o[1];break}if(o[0]===6&&r.label<a[1]){r.label=a[1];a=o;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(o);break}if(a[2])r.ops.pop();r.trys.pop();continue}o=e.call(t,r)}catch(t){o=[6,t];n=0}finally{i=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-
|
|
4
|
+
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-BFfNxHPV.js";import{F as FilterOptionTypes}from"./interfaces-DL4h2bc3.js";import{H as Helper}from"./Helper-BrCHOtZG.js";import"./anime.es-CgtvEd63.js";var sallaFiltersCss=":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}";var SallaFilters=function(){function t(t){var e=this;registerInstance(this,t);this.changed=createEvent(this,"changed");this.isReady=false;this.filtersData={};salla.event.on("filters::hidden",(function(){return e.host.style.display="none"}));salla.lang.onLoaded((function(){e.apply=salla.lang.get("pages.checkout.apply");e.reset=salla.lang.get("pages.categories.filters_reset")}));salla.event.on("filters::fetched",(function(t){var r=t.filters;e.host.style.display="";var i={};e.filters=r.map((function(t){t.label={category_id:salla.lang.get("common.titles.categories"),brand_id:salla.lang.get("common.titles.brands"),rating:salla.lang.get("pages.categories.filter_rating"),price:salla.lang.get("pages.categories.filter_price")}[t.key]||t.label;if(t.key=="rating"){t.type=FilterOptionTypes.VALUES;var r=t.values,n=r.max,a=r.min;t.values=[5,4,3,2,1].filter((function(t){return t>=a||t<=n}))}if(e.filtersData.variants&&t.type==FilterOptionTypes.VARIANTS){i.variants=e.filtersData.variants}if(e.filtersData[t.key]&&t.type!==FilterOptionTypes.VARIANTS){i[t.key]=e.filtersData[t.key]}var s=new URLSearchParams(window.location.search);var o=false;for(var l=0,f=s.keys();l<f.length;l++){var c=f[l];if(c.includes("filters")){o=true;break}}if(salla.config.get("page.slug")=="product.index"&&Object.keys(i).length==0&&!o){var u=window.location.href;var h=salla.config.get("page.id");var d=u.indexOf("?")!==-1?"&":"?";var v=u+d+"filters[category_id]="+h;i.category_id=h;window.history.pushState({path:v},"",v)}return t}));e.filtersData=i;e.host.childNodes.forEach((function(t){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:e=t.setWidgetHeight;if(!e)return[3,2];return[4,t.setWidgetHeight()];case 1:e=r.sent();r.label=2;case 2:return[2,e]}}))}))}))}))}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r;return __generator(this,(function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);t=new URLSearchParams(window.location.search);e=this;return[4,Helper.extractFiltersFromUrl(t)];case 1:e.filtersData=i.sent();return[3,3];case 2:r=i.sent();console.warn("failed to get filters from URL",r.message);return[3,3];case 3:return[2]}}))}))};t.prototype.getFilters=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.filtersData]}))}))};t.prototype.applyFilters=function(){return __awaiter(this,void 0,void 0,(function(){var t;var e=this;return __generator(this,(function(r){if(!this.isReady){return[2]}t=Object.keys(this.filtersData).length>0;setTimeout((function(){var r;if(t){var i=new URL(window.location.href);for(var n=0,a=i.searchParams.entries();n<a.length;n++){var s=a[n][0];if(s.startsWith("filters")){i.searchParams.delete(s)}}var o=e.encodeFilters(e.filtersData);var l=i.search.split("&").filter((function(t){return!t.includes("filters")})).join("&");if(l){i.search=i.search.split("&filters")[0]+"&"+o}else{i.search="?".concat(o)}window.history.pushState({},"",i.href)}else{var i=new URL(window.location.href);(r=i.searchParams)===null||r===void 0?void 0:r.delete("filters");window.history.pushState({},"",i.toString())}salla.event.emit("salla-filters::changed",e.filtersData);e.changed.emit(e.filtersData)}),300);return[2]}))}))};t.prototype.encodeFilters=function(t,e){if(e===void 0){e="filters"}var r=[];for(var i in t){if(Object.prototype.hasOwnProperty.call(t,i)){var n=t[i];var a=e?"".concat(e,"[").concat(i,"]"):i;if(Array.isArray(n)){for(var s=0;s<n.length;s++){r.push("".concat(a,"[").concat(s,"]=").concat(n[s]))}}else if(typeof n==="object"&&n!==null){r.push(this.encodeFilters(n,a))}else{var o="".concat(a,"=").concat(n);r.push(o)}}}return r.join("&")};t.prototype.resetFilters=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.removeFiltersQueryParams();this.filtersData={};this.host.childNodes.forEach((function(t){return t.reset&&t.reset()}));salla.event.emit("salla-filters::reset");return[2,this.applyFilters()]}))}))};t.prototype.removeFiltersQueryParams=function(){var t=new URLSearchParams(window.location.search);var e=Array.from(t.keys()).filter((function(t){return!t.startsWith("filters[")})).map((function(e){return"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(t.get(e)))})).join("&");var r=e?"".concat(window.location.pathname,"?").concat(e):window.location.pathname;window.history.pushState({},"",r)};t.prototype.handleOptionChange=function(t,e,r){if(e.type===FilterOptionTypes.RANGE){this.filtersData[e.key]=r}var i=t.target.checked;if(e.type===FilterOptionTypes.VARIANTS){this.filtersData.variants=this.filtersData.variants||{};i&&(this.filtersData.variants[e.key]=r);i||delete this.filtersData.variants[e.key]}else if(t.target.type=="radio"){i&&(this.filtersData[e.key]=r);i||delete this.filtersData[e.key]}else if(t.target.type=="checkbox"){this.filtersData[e.key]=this.filtersData[e.key]||[];if(i){this.filtersData[e.key].push(r)}this.filtersData[e.key]=this.filtersData[e.key].filter((function(t){return t!=r}))}this.applyFilters()};t.prototype.render=function(){var t=this;var e,r;return h(Host,{key:"80fda46c33daf06c6a22d567d13375351db4e3cb"},(e=this.filters)===null||e===void 0?void 0:e.map((function(e){return h("salla-filters-widget",{option:e,filtersData:t.filtersData,onChanged:function(e){var r=e.detail,i=r.event,n=r.option,a=r.value;t.handleOptionChange(i,n,a)}})})),((r=this.filters)===null||r===void 0?void 0:r.length)?h("div",{class:"s-filters-footer"},h("salla-button",{color:"gray",fill:"outline",onClick:function(){return t.resetFilters()}},this.reset)):"")};t.prototype.componentDidLoad=function(){this.isReady=true};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaFilters.style=sallaFiltersCss;export{SallaFilters as salla_filters};
|
|
5
5
|
//# sourceMappingURL=salla-filters.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,a,i,e){function n(t){return t instanceof i?t:new i((function(a){a(t)}))}return new(i||(i=Promise))((function(i,r){function s(t){try{l(e.next(t))}catch(t){r(t)}}function o(t){try{l(e["throw"](t))}catch(t){r(t)}}function l(t){t.done?i(t.value):n(t.value).then(s,o)}l((e=e.apply(t,a||[])).next())}))};var __generator=this&&this.__generator||function(t,a){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},e,n,r,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(a){return l([t,a])}}function l(o){if(e)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(i=0)),i)try{if(e=1,n&&(r=o[0]&2?n["return"]:o[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;if(n=0,r)o=[o[0]&2,r.value];switch(o[0]){case 0:case 1:r=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;n=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){i.label=o[1];break}if(o[0]===6&&i.label<r[1]){i.label=r[1];r=o;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(o);break}if(r[2])i.ops.pop();i.trys.pop();continue}o=a.call(t,i)}catch(t){o=[6,t];n=0}finally{e=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
|
|
1
2
|
/*!
|
|
2
3
|
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
import{r as registerInstance,h,H as Host,g as getElement}from"./index-BAgazOp0.js";var sallaInstallmentCss="salla-installment:empty{display:none}#tabbyPromoWrapper{background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px;border:unset !important;font-weight:500}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;-webkit-box-shadow:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--main-text-color);font-size:var(--font-sm);line-height:1.25;padding:20px 20px 20px 115px !important;background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);border:unset !important;font-family:inherit !important;font-weight:500}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.tamara-product-widget .spotii-logo,.spotii-wrapper .spotii-logo{float:left;margin:0 0 0 -75px}.ltr .tamara-product-widget,.ltr .spotii-wrapper{text-align:left;padding:18px 100px 18px 20px !important}.ltr .tamara-product-widget .spotii-logo,.ltr .spotii-wrapper .spotii-logo{float:right;margin:0 -75px 0 0}.ltr .tamara-product-widget .spotii-product-widget,.ltr .spotii-wrapper .spotii-product-widget{text-align:left !important}.spotii-wrapper{margin-bottom:20px}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm) !important;margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px !important;top:35px !important;margin:0 !important;height:24px !important}.ltr .tamara-product-widget .tamara-logo{right:20px !important;left:auto !important}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}.s-installment-mispay-wrapper,.s-installment-madfu-wrapper,.s-installment-emkan-wrapper,.s-installment-rajehi-wrapper{font-size:14px;text-align:right;padding:20px;gap:42px;direction:rtl;line-height:22px;color:rgb(0, 0, 0);min-width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;background-color:white;border-radius:10px;margin:15px 0;display:-ms-flexbox;display:flex;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.s-installment-mispay-wrapper:hover,.s-installment-madfu-wrapper:hover,.s-installment-emkan-wrapper:hover,.s-installment-rajehi-wrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.s-installment-mispay-content,.s-installment-madfu-content,.s-installment-emkan-content,.s-installment-rajehi-content{display:-ms-flexbox;display:flex;-ms-flex-direction:row-reverse;flex-direction:row-reverse;width:100%;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;gap:1rem}.ltr .s-installment-mispay-content,.ltr .s-installment-madfu-content,.ltr .s-installment-emkan-content,.ltr .s-installment-rajehi-content{-ms-flex-direction:row;flex-direction:row}.s-installment-mispay-content-text,.s-installment-madfu-content-text,.s-installment-emkan-content-text,.s-installment-rajehi-content-text{color:var(--main-text-color);font-size:14px;font-weight:500;margin:0 16px 0 0;width:80%;left:14px;text-align:left}.s-installment-mispay-content img,.s-installment-madfu-content img,.s-installment-emkan-content img,.s-installment-rajehi-content img{height:28px;width:70px;display:inline-block;max-height:100%;vertical-align:middle;fill:none;stroke:unset;width:auto}.rtl .s-installment-mispay-content-text,.rtl .s-installment-madfu-content-text,.rtl .s-installment-emkan-content-text,.rtl .s-installment-rajehi-content-text{right:14px;text-align:right;margin:0 0 0 16px}.rtl .s-installment-mispay-content img,.rtl .s-installment-madfu-content img,.rtl .s-installment-emkan-content img,.rtl .s-installment-rajehi-content img{left:14px !important}.ltr .s-installment-mispay-content img,.ltr .s-installment-madfu-content img,.ltr .s-installment-emkan-content img,.ltr .s-installment-rajehi-content img{right:14px !important}.s-installment-rajehi-content img{width:70px !important;height:40px !important}.s-installment-emkan-content img{height:35px !important}";var SallaInstallment=function(){function t(t){var a=this;registerInstance(this,t);this.tabbyBorderRemoved=false;this.tabbyRemoveBorderTries=0;this.language=salla.config.get("user.language_code");this.currency=salla.config.get("user.currency_code");this.country=salla.config.get("user.country_code");this.installment_sheria_text=function(t,a){return salla.lang.get(t,a)};salla.lang.onLoaded((function(){var t=[{key:"pages.products.installments",installments:3},{key:"pages.products.installments_emkan",installments:5}];t.forEach((function(t){a.installment_sheria_text(t.key,{payment:salla.money(parseFloat(a.price)),amount:salla.money((parseFloat(a.price)/t.installments).toFixed(2)).replace(/\.00$/,""),installments:t.installments})}));var i=salla.config.get("store.settings.installments");if(i){a.tamaraIsActive=i.tamara;a.tabbyIsActive=i.tabby;a.spotiiIsActive=i.spotii;a.mispayActive=i.mispay;a.emkanIsActive=i.emkan;a.madfuActive=i.madfu;a.rajehiIsActive=i.mokafaa_alrajhi}a.renderInstallments()}));salla.event.on("product::price.updated",(function(t){var i=t.data;if(!i.price||i.price==a.price){return}a.price=i.price;a.renderInstallments(true)}))}t.prototype.render=function(){var t;var a=this.currency==="SAR";if(!this.isValidPrice(this.price)){return""}return h(Host,null,this.tamaraIsActive&&(((t=this.tamaraIsActive)===null||t===void 0?void 0:t.publicKey)?h("div",{class:"mb-5"},h("tamara-widget",{type:"tamara-summary","inline-type":"2",amount:this.price})):h("div",{class:"tamara-product-widget","data-price":this.price,"data-currency":this.currency,"data-lang":this.language,"data-payment-type":"installment"})),this.tabbyIsActive?h("div",{id:"tabbyPromoWrapper"},h("div",{id:"tabbyPromo"})):"",this.spotiiIsActive?h("div",{class:"spotii-wrapper"},h("div",{class:"spotii-promo"})):"",this.shouldShowMispay()&&(this.mispayActive.publicKey?h("div",{class:"mb-5"},h("mispay-widget",{amount:this.price,lang:this.language})):h("div",{class:"s-installment-mispay-wrapper"},h("div",{class:"s-installment-mispay-content"},h("img",{src:salla.url.cdn("images/payment/png/mispay.png"),alt:"mispay"}),h("span",{class:"s-installment-mispay-content-text",innerHTML:this.installment_sheria_text("pages.products.installments",{payment:salla.money(parseFloat(this.price)),amount:salla.money((parseFloat(this.price)/4).toFixed(2)),installments:4})})))),this.emkanIsActive&&this.currency==="SAR"?h("div",{class:"s-installment-emkan-wrapper"},h("div",{class:"s-installment-emkan-content"},h("img",{src:salla.url.cdn("images/payment/png/emkan.png"),alt:"emkan"}),h("span",{class:"s-installment-emkan-content-text",innerHTML:this.installment_sheria_text("pages.products.installments_emkan",{payment:salla.money(parseFloat(this.price)),amount:salla.money((parseFloat(this.price)/5).toFixed(2)),installments:5})}))):"",this.madfuActive&&this.currency==="SAR"?h("div",{class:"s-installment-madfu-wrapper"},h("div",{class:"s-installment-madfu-content"},h("img",{src:salla.url.cdn("images/payment/png/madfu.png"),alt:"madfu"}),h("span",{class:"s-installment-madfu-content-text"},salla.lang.get("pages.products.installments_madfu")))):"",a&&this.rajehiIsActive?h("div",{class:"s-installment-rajehi-wrapper"},h("div",{class:"s-installment-rajehi-content"},h("img",{src:salla.url.cdn("images/payment/png/mokafaa_alrajhi_loyalty.png"),alt:"mokafaa_alrajhi_loyalty"}),h("span",{class:"s-installment-rajehi-content-text"},salla.lang.get("pages.products.rajahi_earn_points",{points:Math.floor(+this.price*this.rajehiIsActive.pointsPerRiyal)})))):"")};t.prototype.renderInstallments=function(t){var a=this;if(t===void 0){t=false}if(!this.isValidPrice(this.price)){return}if(this.tamaraIsActive){this.loadTamara({isUpdating:t})}if(this.tabbyIsActive){if(t){var i=this.host.querySelector("#tabbyPromoWrapper");if(i){i.remove()}var e=document.createElement("div");e.setAttribute("id","tabbyPromoWrapper");var n=document.createElement("div");n.setAttribute("id","tabbyPromo");e.appendChild(n);this.host.appendChild(e);var r=document.querySelector('script[src="https://checkout.tabby.ai/tabby-promo.js"]');if(r){r.remove()}}var s=document.createElement("script");s.setAttribute("src","https://checkout.tabby.ai/tabby-promo.js");document.head.appendChild(s);s.onload=function(){var t=window.TabbyPromo;new t({selector:"#tabbyPromo",currency:a.currency,price:a.price,lang:a.language,publicKey:salla.config.get("store.settings.installments.tabby.publicKey"),merchantCode:salla.config.get("store.settings.installments.tabby.merchantCode")});document.querySelectorAll(".tabby-promo-snippet__logo").forEach((function(t){t.setAttribute("aria-label","Tabby Logo")}))};this.removeTabbyBorder()}if(this.spotiiIsActive){if(t){var o=this.host.querySelector(".spotii-wrapper");if(o){o.remove()}var l=document.createElement("div");l.classList.add("spotii-wrapper");var p=document.createElement("div");p.classList.add("spotii-promo");l.appendChild(p);this.host.appendChild(l);var m=document.querySelector('script[src="'+salla.url.cdn("js/price-widget-ar-salla.js")+'"]');if(m){m.remove()}}var d=salla.money((Number(this.price)/3).toFixed(2),false);var c=salla.config.get("theme.is_rtl",true);window.spotiiConfig={targetXPath:[".spotii-wrapper"],renderToPath:[".spotii-promo"],numberOfPayment:3,currency:this.currency,templateLine:"${textOne} ${number} ${textTwo} "+d+"${logo} ${info}",textOne:c?"جزء الدفع على":"Split it into",textTwo:c?"أقساط متساوية بدون تكاليف اضافية بقيمة":"payments of",textThree:"مع",price:this.price};var b=document.createElement("script");b.setAttribute("src",salla.url.cdn("js/price-widget-ar-salla.js"));document.head.appendChild(b)}if(this.shouldShowMispay()&&this.mispayActive.publicKey){this.loadExternalScript({position:"head",src:"https://widget.mispay.co/v1/sdk.js?authorize=".concat(this.mispayActive.publicKey)})}};t.prototype.isValidPrice=function(t){var a=/^\d+(\.\d{1,2})?$/;var i=a.test(t);var e=parseFloat(t)>0;return i&&e};t.prototype.loadExternalScript=function(t){var a=t.src,i=t.onLoad,e=t.position;var n=document.createElement("script");n.src=a;n.onload=i;document[e].appendChild(n)};t.prototype.loadTamara=function(t){var a=this;var i=t.isUpdating;var e,n;var r=!!((e=this.tamaraIsActive)===null||e===void 0?void 0:e.publicKey);if(i){setTimeout((function(){var t,a;if(r){return(t=window.TamaraWidgetV2)===null||t===void 0?void 0:t.refresh()}(a=window.TamaraProductWidget)===null||a===void 0?void 0:a.render()}),300)}else{if(r){var s=salla.config.get("user.language_code");var o=["ar","en"].includes(s)?s:"ar";var l=(n=this.currency)===null||n===void 0?void 0:n.slice(0,-1);var p=["SA","AE","KW","BH","OM","QA"].includes(l)?l:null;if(!p){console.error("Tamara: Country code is not supported",l)}else{window.tamaraWidgetConfig={lang:o,country:p,publicKey:this.tamaraIsActive.publicKey,style:{fontSize:"14px"}};this.loadExternalScript({position:"head",src:"https://cdn.tamara.co/widget-v2/tamara-widget.js"})}}else{this.loadExternalScript({position:"head",src:"https://cdn.tamara.co/widget/product-widget.min.js",onLoad:function(){window.TamaraProductWidget.init({lang:a.language});setTimeout((function(){window.TamaraProductWidget.render()}),300)}})}}};t.prototype.shouldShowMispay=function(){return this.currency==="SAR"&&this.mispayActive&&parseInt(this.price)>=200};t.prototype.removeTabbyBorder=function(){var t=this;if(this.tabbyBorderRemoved||this.tabbyRemoveBorderTries>5){return}this.tabbyRemoveBorderTries++;setTimeout((function(){var a=document.querySelector("#tabbyPromo>div>div");a=a&&a.shadowRoot?a.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]'):null;if(a){a.style="border: none; margin: 15px 0!important;";t.tabbyBorderRemoved=true}else{t.removeTabbyBorder()}}),this.tabbyRemoveBorderTries*500)};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaInstallment.style=sallaInstallmentCss;export{SallaInstallment as salla_installment};
|
|
4
|
+
*/import{r as registerInstance,h,H as Host,g as getElement}from"./index-BFfNxHPV.js";var sallaInstallmentCss="salla-installment:empty{display:none}#tabbyPromoWrapper{background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px;border:unset !important;font-weight:500}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;-webkit-box-shadow:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--main-text-color);font-size:var(--font-sm);line-height:1.25;padding:20px 20px 20px 115px !important;background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);border:unset !important;font-family:inherit !important;font-weight:500}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.tamara-product-widget .spotii-logo,.spotii-wrapper .spotii-logo{float:left;margin:0 0 0 -75px}.ltr .tamara-product-widget,.ltr .spotii-wrapper{text-align:left;padding:18px 100px 18px 20px !important}.ltr .tamara-product-widget .spotii-logo,.ltr .spotii-wrapper .spotii-logo{float:right;margin:0 -75px 0 0}.ltr .tamara-product-widget .spotii-product-widget,.ltr .spotii-wrapper .spotii-product-widget{text-align:left !important}.spotii-wrapper{margin-bottom:20px}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm) !important;margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px !important;top:35px !important;margin:0 !important;height:24px !important}.ltr .tamara-product-widget .tamara-logo{right:20px !important;left:auto !important}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}.s-installment-mispay-wrapper,.s-installment-madfu-wrapper,.s-installment-emkan-wrapper,.s-installment-rajehi-wrapper{font-size:14px;text-align:right;padding:20px;gap:42px;direction:rtl;line-height:22px;color:rgb(0, 0, 0);min-width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;background-color:white;border-radius:10px;margin:15px 0;display:-ms-flexbox;display:flex;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.s-installment-mispay-wrapper:hover,.s-installment-madfu-wrapper:hover,.s-installment-emkan-wrapper:hover,.s-installment-rajehi-wrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.s-installment-mispay-content,.s-installment-madfu-content,.s-installment-emkan-content,.s-installment-rajehi-content{display:-ms-flexbox;display:flex;-ms-flex-direction:row-reverse;flex-direction:row-reverse;width:100%;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;gap:1rem}.ltr .s-installment-mispay-content,.ltr .s-installment-madfu-content,.ltr .s-installment-emkan-content,.ltr .s-installment-rajehi-content{-ms-flex-direction:row;flex-direction:row}.s-installment-mispay-content-text,.s-installment-madfu-content-text,.s-installment-emkan-content-text,.s-installment-rajehi-content-text{color:var(--main-text-color);font-size:14px;font-weight:500;margin:0 16px 0 0;width:80%;left:14px;text-align:left}.s-installment-mispay-content img,.s-installment-madfu-content img,.s-installment-emkan-content img,.s-installment-rajehi-content img{height:28px;width:70px;display:inline-block;max-height:100%;vertical-align:middle;fill:none;stroke:unset;width:auto}.rtl .s-installment-mispay-content-text,.rtl .s-installment-madfu-content-text,.rtl .s-installment-emkan-content-text,.rtl .s-installment-rajehi-content-text{right:14px;text-align:right;margin:0 0 0 16px}.rtl .s-installment-mispay-content img,.rtl .s-installment-madfu-content img,.rtl .s-installment-emkan-content img,.rtl .s-installment-rajehi-content img{left:14px !important}.ltr .s-installment-mispay-content img,.ltr .s-installment-madfu-content img,.ltr .s-installment-emkan-content img,.ltr .s-installment-rajehi-content img{right:14px !important}.s-installment-rajehi-content img{width:70px !important;height:40px !important}.s-installment-emkan-content img{height:35px !important}";var SallaInstallment=function(){function t(t){registerInstance(this,t);this.tabbyBorderRemoved=false;this.tabbyRemoveBorderTries=0;this.language=salla.config.get("user.language_code");this.currency=salla.config.get("user.currency_code");this.country=salla.config.get("user.country_code");this.installment_sheria_text=function(t,a){return salla.lang.get(t,a)}}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,a;var i=this;return __generator(this,(function(e){switch(e.label){case 0:return[4,salla.onReady()];case 1:e.sent();return[4,salla.lang.onLoaded()];case 2:e.sent();this.currency=salla.config.get("user.currency_code")||"SAR";this.language=salla.config.get("user.language_code")||"ar";this.country=salla.config.get("user.country_code")||"SA";t=[{key:"pages.products.installments",installments:3},{key:"pages.products.installments_emkan",installments:5}];t.forEach((function(t){i.installment_sheria_text(t.key,{payment:salla.money(parseFloat(i.price)),amount:salla.money((parseFloat(i.price)/t.installments).toFixed(2)).replace(/\.00$/,""),installments:t.installments})}));a=salla.config.get("store.settings.installments");if(a){this.tamaraIsActive=a.tamara;this.tabbyIsActive=a.tabby;this.spotiiIsActive=a.spotii;this.mispayActive=a.mispay;this.emkanIsActive=a.emkan;this.madfuActive=a.madfu;this.rajehiIsActive=a.mokafaa_alrajhi}salla.event.on("product::price.updated",(function(t){var a=t.data;if(!a.price||a.price==i.price){return}i.price=a.price;i.renderInstallments(true)}));return[2]}}))}))};t.prototype.componentDidLoad=function(){this.renderInstallments()};t.prototype.render=function(){var t;var a=this.currency==="SAR";if(!this.isValidPrice(this.price)){return""}return h(Host,null,this.tamaraIsActive&&(((t=this.tamaraIsActive)===null||t===void 0?void 0:t.publicKey)?h("div",{class:"mb-5"},h("tamara-widget",{type:"tamara-summary","inline-type":"2",amount:this.price})):h("div",{class:"tamara-product-widget","data-price":this.price,"data-currency":this.currency,"data-lang":this.language,"data-payment-type":"installment"})),this.tabbyIsActive?h("div",{id:"tabbyPromoWrapper"},h("div",{id:"tabbyPromo"})):"",this.spotiiIsActive?h("div",{class:"spotii-wrapper"},h("div",{class:"spotii-promo"})):"",this.shouldShowMispay()&&(this.mispayActive.publicKey?h("div",{class:"mb-5"},h("mispay-widget",{amount:this.price,lang:this.language})):h("div",{class:"s-installment-mispay-wrapper"},h("div",{class:"s-installment-mispay-content"},h("img",{src:salla.url.cdn("images/payment/png/mispay.png"),alt:"mispay"}),h("span",{class:"s-installment-mispay-content-text",innerHTML:this.installment_sheria_text("pages.products.installments",{payment:salla.money(parseFloat(this.price)),amount:salla.money((parseFloat(this.price)/4).toFixed(2)),installments:4})})))),this.emkanIsActive&&this.currency==="SAR"?h("div",{class:"s-installment-emkan-wrapper"},h("div",{class:"s-installment-emkan-content"},h("img",{src:salla.url.cdn("images/payment/png/emkan.png"),alt:"emkan"}),h("span",{class:"s-installment-emkan-content-text",innerHTML:this.installment_sheria_text("pages.products.installments_emkan",{payment:salla.money(parseFloat(this.price)),amount:salla.money((parseFloat(this.price)/5).toFixed(2)),installments:5})}))):"",this.madfuActive&&this.currency==="SAR"?h("div",{class:"s-installment-madfu-wrapper"},h("div",{class:"s-installment-madfu-content"},h("img",{src:salla.url.cdn("images/payment/png/madfu.png"),alt:"madfu"}),h("span",{class:"s-installment-madfu-content-text"},salla.lang.get("pages.products.installments_madfu")))):"",a&&this.rajehiIsActive?h("div",{class:"s-installment-rajehi-wrapper"},h("div",{class:"s-installment-rajehi-content"},h("img",{src:salla.url.cdn("images/payment/png/mokafaa_alrajhi_loyalty.png"),alt:"mokafaa_alrajhi_loyalty"}),h("span",{class:"s-installment-rajehi-content-text"},salla.lang.get("pages.products.rajahi_earn_points",{points:Math.floor(+this.price*this.rajehiIsActive.pointsPerRiyal)})))):"")};t.prototype.renderInstallments=function(t){var a=this;if(t===void 0){t=false}if(!this.isValidPrice(this.price)){return}if(this.tamaraIsActive){this.loadTamara({isUpdating:t})}if(this.tabbyIsActive){if(t){var i=this.host.querySelector("#tabbyPromoWrapper");if(i){i.remove()}var e=document.createElement("div");e.setAttribute("id","tabbyPromoWrapper");var n=document.createElement("div");n.setAttribute("id","tabbyPromo");e.appendChild(n);this.host.appendChild(e);var r=document.querySelector('script[src="https://checkout.tabby.ai/tabby-promo.js"]');if(r){r.remove()}}var s=document.createElement("script");s.setAttribute("src","https://checkout.tabby.ai/tabby-promo.js");document.head.appendChild(s);s.onload=function(){var t=window.TabbyPromo;new t({selector:"#tabbyPromo",currency:a.currency,price:a.price,lang:a.language,publicKey:salla.config.get("store.settings.installments.tabby.publicKey"),merchantCode:salla.config.get("store.settings.installments.tabby.merchantCode")});document.querySelectorAll(".tabby-promo-snippet__logo").forEach((function(t){t.setAttribute("aria-label","Tabby Logo")}))};this.removeTabbyBorder()}if(this.spotiiIsActive){if(t){var o=this.host.querySelector(".spotii-wrapper");if(o){o.remove()}var l=document.createElement("div");l.classList.add("spotii-wrapper");var p=document.createElement("div");p.classList.add("spotii-promo");l.appendChild(p);this.host.appendChild(l);var m=document.querySelector('script[src="'+salla.url.cdn("js/price-widget-ar-salla.js")+'"]');if(m){m.remove()}}var c=salla.money((Number(this.price)/3).toFixed(2),false);var d=salla.config.get("theme.is_rtl",true);window.spotiiConfig={targetXPath:[".spotii-wrapper"],renderToPath:[".spotii-promo"],numberOfPayment:3,currency:this.currency,templateLine:"${textOne} ${number} ${textTwo} "+c+"${logo} ${info}",textOne:d?"جزء الدفع على":"Split it into",textTwo:d?"أقساط متساوية بدون تكاليف اضافية بقيمة":"payments of",textThree:"مع",price:this.price};var h=document.createElement("script");h.setAttribute("src",salla.url.cdn("js/price-widget-ar-salla.js"));document.head.appendChild(h)}if(this.shouldShowMispay()&&this.mispayActive.publicKey){this.loadExternalScript({position:"head",src:"https://widget.mispay.co/v1/sdk.js?authorize=".concat(this.mispayActive.publicKey)})}};t.prototype.isValidPrice=function(t){var a=/^\d+(\.\d{1,2})?$/;var i=a.test(t);var e=parseFloat(t)>0;return i&&e};t.prototype.loadExternalScript=function(t){var a=t.src,i=t.onLoad,e=t.position;var n=document.createElement("script");n.src=a;n.onload=i;document[e].appendChild(n)};t.prototype.loadTamara=function(t){var a=this;var i=t.isUpdating;var e,n;var r=!!((e=this.tamaraIsActive)===null||e===void 0?void 0:e.publicKey);if(i){setTimeout((function(){var t,a;if(r){return(t=window.TamaraWidgetV2)===null||t===void 0?void 0:t.refresh()}(a=window.TamaraProductWidget)===null||a===void 0?void 0:a.render()}),300)}else{if(r){var s=salla.config.get("user.language_code");var o=["ar","en"].includes(s)?s:"ar";var l=(n=this.currency)===null||n===void 0?void 0:n.slice(0,-1);var p=["SA","AE","KW","BH","OM","QA"].includes(l)?l:null;if(!p){console.error("Tamara: Country code is not supported",l)}else{window.tamaraWidgetConfig={lang:o,country:p,publicKey:this.tamaraIsActive.publicKey,style:{fontSize:"14px"}};this.loadExternalScript({position:"head",src:"https://cdn.tamara.co/widget-v2/tamara-widget.js"})}}else{this.loadExternalScript({position:"head",src:"https://cdn.tamara.co/widget/product-widget.min.js",onLoad:function(){window.TamaraProductWidget.init({lang:a.language});setTimeout((function(){window.TamaraProductWidget.render()}),300)}})}}};t.prototype.shouldShowMispay=function(){return this.currency==="SAR"&&this.mispayActive&&parseInt(this.price)>=200};t.prototype.removeTabbyBorder=function(){var t=this;if(this.tabbyBorderRemoved||this.tabbyRemoveBorderTries>5){return}this.tabbyRemoveBorderTries++;setTimeout((function(){var a=document.querySelector("#tabbyPromo>div>div");a=a&&a.shadowRoot?a.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]'):null;if(a){a.style="border: none; margin: 15px 0!important;";t.tabbyBorderRemoved=true}else{t.removeTabbyBorder()}}),this.tabbyRemoveBorderTries*500)};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaInstallment.style=sallaInstallmentCss;export{SallaInstallment as salla_installment};
|
|
5
5
|
//# sourceMappingURL=salla-installment.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"salla-installment.entry.js","sources":["src/components/salla-installment/salla-installment.scss?tag=salla-installment","src/components/salla-installment/salla-installment.tsx"],"sourcesContent":["/*\n The whole installment methods is a third-party widgets,\n So there aren't a custom classes (as other components) to style them.\n*/\n\nsalla-installment:empty {\n display: none;\n}\n\n/*\n* Installment::Tabby\n*/\n#tabbyPromoWrapper {\n background: white;\n border-radius: 0.375rem;\n transition: box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);\n margin-bottom: 20px;\n border: unset !important;\n font-weight: 500;\n\n .salla-y & {\n border: 1px solid var(--color-grey-dark);\n border-radius: 12px\n }\n\n &:hover {\n box-shadow: 0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D;\n }\n\n #tabbyPromo {\n * {\n font-family: var(--font-main);\n }\n\n >div>div {\n max-width: none;\n //padding: 15px;\n box-shadow: none;\n border: none;\n }\n\n .tabby-promo-snippet {\n max-width: 100%;\n min-height: 100px;\n padding: 18px 20px;\n // border-color: var(--color-grey-dark);\n border: none !important;\n\n\n &__text,\n &__link {\n font-size: var(--font-sm);\n color: var(--color-text) !important;\n }\n\n &__link {\n font-weight: bold;\n }\n }\n }\n}\n\n.tabby-promo-wrapper {\n #tabby-promo {\n font-family: var(--font-main) !important;\n\n .tabby-promo {\n &__feature-title {\n font-size: var(--font-md);\n }\n\n &__feature-desc {\n font-size: var(--font-sm);\n line-height: 20px;\n }\n }\n }\n}\n\n/*\n* Installment::Tamara & Spotii\n*/\n.tamara-product-widget {\n margin-bottom: 20px;\n}\n\n.tamara-product-widget,\n.spotii-wrapper {\n min-height: 100px;\n position: relative;\n color: var(--main-text-color);\n font-size: var(--font-sm);\n line-height: 1.25;\n padding: 20px 20px 20px 115px !important;\n background: white;\n border-radius: 0.375rem;\n transition: box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);\n border: unset !important;\n font-family: inherit !important;\n font-weight: 500;\n .salla-y & {\n border-radius: 12px;\n border: 1px solid var(--color-grey-dark);\n }\n\n &:hover {\n box-shadow: 0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D;\n }\n\n .spotii-logo {\n float: left;\n margin: 0 0 0 -75px;\n }\n}\n\n.ltr .tamara-product-widget,\n.ltr .spotii-wrapper {\n text-align: left;\n padding: 18px 100px 18px 20px !important;\n\n .spotii-logo {\n float: right;\n margin: 0 -75px 0 0;\n }\n\n .spotii-product-widget {\n text-align: left !important;\n }\n}\n\n.spotii-wrapper {\n margin-bottom: 20px;\n\n .spotii-promo {\n font-size: var(--font-md);\n }\n\n .spotii-product-widget {\n font-size: var(--font-sm) !important;\n margin-top: 10px;\n }\n}\n\n.tamara-product-widget {\n .tamara-logo {\n position: absolute;\n left: 20px !important;\n top: 35px !important;\n margin: 0 !important;\n height: 24px !important;\n\n .ltr & {\n right: 20px !important;\n left: auto !important;\n }\n }\n\n span {\n font-family: var(--font-main);\n font-size: var(--font-sm);\n color: var(--color-text);\n\n &:last-child {\n display: block;\n position: relative;\n margin-top: 8px;\n }\n }\n}\n\n.tamara-popup {\n &__wrap {\n overflow: auto !important;\n }\n}\n\n// mispay and madfu and emkan\n// mispay, madfu, and emkan\n.s-installment-mispay-wrapper,\n.s-installment-madfu-wrapper,\n.s-installment-emkan-wrapper,\n.s-installment-rajehi-wrapper {\n // font-family: \"Noto Sans Arabic\", sans-serif;\n font-size: 14px;\n text-align: right;\n padding: 20px;\n gap: 42px;\n direction: rtl;\n line-height: 22px;\n color: rgb(0, 0, 0);\n min-width: 100%;\n box-sizing: border-box;\n position: relative;\n background-color: white;\n border-radius: 10px;\n margin: 15px 0;\n display: flex;\n transition: box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.s-installment-mispay-wrapper:hover,\n.s-installment-madfu-wrapper:hover,\n.s-installment-emkan-wrapper:hover,\n.s-installment-rajehi-wrapper:hover{\n box-shadow: 0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D;\n}\n\n.s-installment-mispay-content,\n.s-installment-madfu-content,\n.s-installment-emkan-content,\n.s-installment-rajehi-content {\n display: flex;\n flex-direction: row-reverse;\n width: 100%;\n justify-content: space-between;\n align-items: center;\n gap: 1rem;\n}\n\n\n.ltr .s-installment-mispay-content,\n.ltr .s-installment-madfu-content,\n.ltr .s-installment-emkan-content,\n.ltr .s-installment-rajehi-content{\n flex-direction: row;\n}\n\n.s-installment-mispay-content-text,\n.s-installment-madfu-content-text,\n.s-installment-emkan-content-text,\n.s-installment-rajehi-content-text {\n color: var(--main-text-color);\n font-size: 14px;\n font-weight: 500;\n margin: 0 16px 0 0;\n width: 80%;\n // position: absolute;\n left: 14px;\n text-align: left;\n}\n\n.s-installment-mispay-content img,\n.s-installment-madfu-content img,\n.s-installment-emkan-content img,\n.s-installment-rajehi-content img{\n height: 28px;\n width: 70px;\n display: inline-block;\n max-height: 100%;\n vertical-align: middle;\n fill: none;\n stroke: unset;\n width: auto;\n // position: absolute;\n}\n\n/* RTL Support */\n.rtl .s-installment-mispay-content-text,\n.rtl .s-installment-madfu-content-text,\n.rtl .s-installment-emkan-content-text,\n.rtl .s-installment-rajehi-content-text {\n right: 14px;\n text-align: right;\n margin: 0 0 0 16px;\n}\n\n.rtl .s-installment-mispay-content img,\n.rtl .s-installment-madfu-content img,\n.rtl .s-installment-emkan-content img,\n.rtl .s-installment-rajehi-content img{\n left: 14px !important;\n}\n\n.ltr .s-installment-mispay-content img,\n.ltr .s-installment-madfu-content img,\n.ltr .s-installment-emkan-content img,\n.ltr .s-installment-rajehi-content img {\n right: 14px !important;\n}\n\n\n.s-installment-rajehi-content img {\n width: 70px !important;\n height: 40px !important;;\n}\n\n.s-installment-emkan-content img {\n height: 35px !important;\n}\n\n","import { Component, Host, h, Prop, State, Element } from '@stencil/core';\n\n@Component({\n tag: 'salla-installment',\n styleUrl: 'salla-installment.scss',\n})\nexport class SallaInstallment {\n private tabbyBorderRemoved: boolean = false;\n private tabbyRemoveBorderTries: number = 0;\n @Element() host: HTMLElement;\n constructor() {\n salla.lang.onLoaded(() => {\n const installmentOptions = [\n { key: 'pages.products.installments', installments: 3 },\n { key: 'pages.products.installments_emkan', installments: 5 },\n ];\n\n installmentOptions.forEach(option => {\n this.installment_sheria_text(option.key, {\n payment: salla.money(parseFloat(this.price)),\n amount: salla.money((parseFloat(this.price) / option.installments).toFixed(2)).replace(/\\.00$/, ''),\n installments: option.installments,\n });\n });\n\n const installment = salla.config.get('store.settings.installments');\n if (installment) {\n this.tamaraIsActive = installment.tamara;\n this.tabbyIsActive = installment.tabby;\n this.spotiiIsActive = installment.spotii;\n this.mispayActive = installment.mispay;\n this.emkanIsActive = installment.emkan;\n this.madfuActive = installment.madfu;\n this.rajehiIsActive = installment.mokafaa_alrajhi\n }\n this.renderInstallments();\n });\n\n salla.event.on('product::price.updated', ({ data }) => {\n if (!data.price || data.price == this.price) {\n return;\n }\n this.price = data.price;\n this.renderInstallments(true);\n });\n }\n\n /**\n * Current product price\n */\n @Prop() price: string;\n /**\n * Language code\n */\n @Prop() language: string = salla.config.get('user.language_code');\n /**\n * Currency code\n */\n @Prop() currency: string = salla.config.get('user.currency_code');\n /**\n * Country code\n */\n @Prop() country: string = salla.config.get('user.country_code');\n\n @State() tabbyIsActive: boolean;\n @State() spotiiIsActive: boolean;\n @State() tamaraIsActive: null | { publicKey: string };\n @State() mispayActive: null | { merchantCode: string; publicKey: string };\n @State() emkanIsActive: boolean;\n @State() madfuActive: boolean;\n @State() rajehiIsActive?: { pointsPerRiyal: number };\n\n @State() installment_sheria_text: (key: string, replacement: object) => string = (key, replacement) => salla.lang.get(key, replacement);\n\n\n render() {\n const isSAR = this.currency === 'SAR';\n\n if (!this.isValidPrice(this.price)) {\n return '';\n }\n return (\n <Host>\n {this.tamaraIsActive &&\n (this.tamaraIsActive?.publicKey ? (\n // Tamara widget v2\n <div class=\"mb-5\">\n <tamara-widget\n type=\"tamara-summary\"\n inline-type=\"2\"\n amount={this.price}\n ></tamara-widget>\n </div>\n ) : (\n // Tamara widget v1 fallback\n <div\n class=\"tamara-product-widget\"\n data-price={this.price}\n data-currency={this.currency}\n data-lang={this.language}\n data-payment-type=\"installment\"\n ></div>\n ))}\n\n {this.tabbyIsActive ? (\n <div id=\"tabbyPromoWrapper\">\n <div id=\"tabbyPromo\"></div>\n </div>\n ) : (\n ''\n )}\n\n {this.spotiiIsActive ? (\n <div class=\"spotii-wrapper\">\n {/*No need for the price, the price already in the page, and also tammara & tabby doesn't have price */}\n <div class=\"spotii-promo\"></div>\n </div>\n ) : (\n ''\n )}\n\n {this.shouldShowMispay() &&\n (this.mispayActive.publicKey ? (\n <div class=\"mb-5\">\n <mispay-widget amount={this.price} lang={this.language}></mispay-widget>\n </div>\n ) : (\n <div class=\"s-installment-mispay-wrapper\">\n <div class=\"s-installment-mispay-content\">\n <img src={salla.url.cdn('images/payment/png/mispay.png')} alt=\"mispay\" />\n <span class=\"s-installment-mispay-content-text\" innerHTML={this.installment_sheria_text('pages.products.installments',{\n payment: salla.money(parseFloat(this.price)),\n amount: salla.money((parseFloat(this.price) / 4).toFixed(2)),\n installments: 4,\n })}></span>\n </div>\n </div>\n ))}\n\n {this.emkanIsActive && this.currency === \"SAR\" ? (\n <div class=\"s-installment-emkan-wrapper\">\n <div class=\"s-installment-emkan-content\">\n <img src={salla.url.cdn('images/payment/png/emkan.png')} alt=\"emkan\" />\n <span class=\"s-installment-emkan-content-text\" innerHTML={this.installment_sheria_text('pages.products.installments_emkan', {\n payment: salla.money(parseFloat(this.price)),\n amount: salla.money((parseFloat(this.price) / 5).toFixed(2)),\n installments: 5,\n })}></span>\n </div>\n </div>\n ) : (\n ''\n )}\n {this.madfuActive && this.currency === \"SAR\" ? (\n <div class=\"s-installment-madfu-wrapper\">\n <div class=\"s-installment-madfu-content\">\n <img\n src={\n salla.url.cdn('images/payment/png/madfu.png')\n }\n alt=\"madfu\"\n />\n <span class=\"s-installment-madfu-content-text\">\n {salla.lang.get('pages.products.installments_madfu')}\n </span>\n </div>\n </div>\n ) : (\n ''\n )}\n\n {(isSAR && this.rajehiIsActive) ?\n <div class=\"s-installment-rajehi-wrapper\">\n <div class=\"s-installment-rajehi-content\">\n <img src={salla.url.cdn('images/payment/png/mokafaa_alrajhi_loyalty.png')} alt=\"mokafaa_alrajhi_loyalty\"/>\n\n <span class=\"s-installment-rajehi-content-text\">\n {salla.lang.get(\"pages.products.rajahi_earn_points\", {points: Math.floor(+this.price * this.rajehiIsActive.pointsPerRiyal)})}\n </span>\n\n </div>\n </div>\n\n : ''}\n </Host>\n );\n }\n\n renderInstallments(isUpdating: boolean = false) {\n if (!this.isValidPrice(this.price)) {\n return;\n }\n // Tamara\n if (this.tamaraIsActive) {\n this.loadTamara({isUpdating});\n }\n\n // tabby\n if (this.tabbyIsActive) {\n if (isUpdating) {\n // remove #tabbyPromoWrapper and re append it\n var oldTabbyWrapper = this.host.querySelector('#tabbyPromoWrapper');\n if (oldTabbyWrapper) {\n oldTabbyWrapper.remove();\n }\n\n var tabbyPromoWrapper = document.createElement('div');\n tabbyPromoWrapper.setAttribute('id', 'tabbyPromoWrapper');\n var tabbyPromo = document.createElement('div');\n tabbyPromo.setAttribute('id', 'tabbyPromo');\n tabbyPromoWrapper.appendChild(tabbyPromo);\n this.host.appendChild(tabbyPromoWrapper);\n\n var oldTabbyScript = document.querySelector(\n 'script[src=\"https://checkout.tabby.ai/tabby-promo.js\"]',\n );\n if (oldTabbyScript) {\n oldTabbyScript.remove();\n }\n }\n\n var tabbyScript = document.createElement('script');\n tabbyScript.setAttribute('src', 'https://checkout.tabby.ai/tabby-promo.js');\n document.head.appendChild(tabbyScript);\n tabbyScript.onload = () => {\n const TabbyPromo = window.TabbyPromo;\n new TabbyPromo({\n selector: '#tabbyPromo',\n currency: this.currency,\n price: this.price,\n lang: this.language,\n publicKey: salla.config.get('store.settings.installments.tabby.publicKey'),\n merchantCode: salla.config.get('store.settings.installments.tabby.merchantCode'),\n });\n document.querySelectorAll('.tabby-promo-snippet__logo').forEach(function (element) {\n element.setAttribute('aria-label', 'Tabby Logo');\n });\n };\n // this is a workaround to remove the default border and add margin\n this.removeTabbyBorder();\n }\n\n // Spotii\n if (this.spotiiIsActive) {\n if (isUpdating) {\n var oldSpotiiWrapper = this.host.querySelector('.spotii-wrapper');\n if (oldSpotiiWrapper) {\n oldSpotiiWrapper.remove();\n }\n\n var spotiiPromoWrapper = document.createElement('div');\n spotiiPromoWrapper.classList.add('spotii-wrapper');\n var spotiiPromo = document.createElement('div');\n spotiiPromo.classList.add('spotii-promo');\n spotiiPromoWrapper.appendChild(spotiiPromo);\n this.host.appendChild(spotiiPromoWrapper);\n var oldSpotiiScript = document.querySelector(\n 'script[src=\"' + salla.url.cdn('js/price-widget-ar-salla.js') + '\"]',\n );\n if (oldSpotiiScript) {\n oldSpotiiScript.remove();\n }\n }\n\n let amount = salla.money((Number(this.price) / 3).toFixed(2), false);\n let isRTL = salla.config.get('theme.is_rtl', true);\n window.spotiiConfig = {\n targetXPath: ['.spotii-wrapper'],\n renderToPath: ['.spotii-promo'],\n numberOfPayment: 3,\n currency: this.currency,\n templateLine: '${textOne} ${number} ${textTwo} ' + amount + '${logo} ${info}',\n //todo:: translate these\n textOne: isRTL ? 'جزء الدفع على' : 'Split it into',\n textTwo: isRTL ? 'أقساط متساوية بدون تكاليف اضافية بقيمة' : 'payments of',\n textThree: 'مع',\n price: this.price,\n // forcedShow: false,\n // merchantID: null,\n };\n\n var spotiiScript = document.createElement('script');\n spotiiScript.setAttribute('src', salla.url.cdn('js/price-widget-ar-salla.js'));\n document.head.appendChild(spotiiScript);\n // spotiiScript.onload = () => {\n // // setTimeout()\n // }\n }\n\n // Mispay\n if (this.shouldShowMispay() && this.mispayActive.publicKey) {\n this.loadExternalScript({\n position: 'head',\n src: `https://widget.mispay.co/v1/sdk.js?authorize=${this.mispayActive.publicKey}`,\n });\n }\n }\n\n private isValidPrice(price: string): boolean {\n const pricePattern = /^\\d+(\\.\\d{1,2})?$/;\n const isValid = pricePattern.test(price);\n const isGreaterThanZero = parseFloat(price) > 0;\n\n return isValid && isGreaterThanZero;\n }\n\n loadExternalScript({\n src,\n onLoad,\n position,\n }: {\n src: string;\n onLoad?: HTMLScriptElement['onload'];\n position: 'head' | 'body';\n }) {\n const script = document.createElement('script');\n script.src = src;\n script.onload = onLoad;\n document[position].appendChild(script);\n }\n\n loadTamara({ isUpdating }: { isUpdating: boolean }) {\n const isV2Enabled = !!this.tamaraIsActive?.publicKey;\n\n if (isUpdating) {\n setTimeout(() => {\n if (isV2Enabled) {\n return window.TamaraWidgetV2?.refresh();\n }\n\n // v1 fallback widget refresh\n window.TamaraProductWidget?.render();\n }, 300);\n } else {\n if (isV2Enabled) {\n const language_code = salla.config.get('user.language_code');\n const lang = ['ar', 'en'].includes(language_code) ? language_code : 'ar';\n // this used in case user change the currency to get the country code\n const countryCodeByCurrency = this.currency?.slice(0, -1);\n\n const country = ['SA', 'AE', 'KW', 'BH', 'OM', 'QA'].includes(countryCodeByCurrency)\n ? countryCodeByCurrency\n : null;\n\n if (!country) {\n console.error('Tamara: Country code is not supported', countryCodeByCurrency);\n } else {\n window.tamaraWidgetConfig = {\n lang,\n country,\n publicKey: this.tamaraIsActive.publicKey,\n style: {\n fontSize: '14px',\n },\n };\n\n this.loadExternalScript({\n position: 'head',\n src: 'https://cdn.tamara.co/widget-v2/tamara-widget.js',\n });\n }\n } else {\n // v1 fallback widget\n this.loadExternalScript({\n position: 'head',\n src: 'https://cdn.tamara.co/widget/product-widget.min.js',\n onLoad: () => {\n window.TamaraProductWidget.init({ lang: this.language });\n setTimeout(() => {\n window.TamaraProductWidget.render();\n }, 300);\n },\n });\n }\n }\n }\n\n shouldShowMispay() {\n return this.currency === 'SAR' && this.mispayActive && parseInt(this.price) >= 200;\n }\n\n /**\n * this is workaround to remove the default border and add margin\n * we will try to remove tabby border 5 times for 7.5 seconds\n */\n removeTabbyBorder() {\n if (this.tabbyBorderRemoved || this.tabbyRemoveBorderTries > 5) {\n return;\n }\n this.tabbyRemoveBorderTries++;\n setTimeout(() => {\n let promo: any = document.querySelector('#tabbyPromo>div>div');\n promo = promo && promo.shadowRoot\n ? promo.shadowRoot.querySelector('div[class^=\"styles__tabby-promo-snippet--\"]')\n : null;\n if (promo) {\n promo.style = 'border: none; margin: 15px 0!important;';\n this.tabbyBorderRemoved = true;\n } else {\n this.removeTabbyBorder();\n }\n }, this.tabbyRemoveBorderTries * 500);\n }\n}\n"],"names":[],"mappings":";;;;;AAAA,MAAM,mBAAmB,GAAG,4wMAA4wM;;MCM3xM,gBAAgB,GAAA,MAAA;AAI3B,IAAA,WAAA,CAAA,OAAA,EAAA;;AAHQ,QAAA,IAAkB,CAAA,kBAAA,GAAY,KAAK;AACnC,QAAA,IAAsB,CAAA,sBAAA,GAAW,CAAC;AA2C1C;;AAEG;QACK,IAAQ,CAAA,QAAA,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6CAA6C;kBAC5E,IAAI;YACR,IAAI,KAAK,EAAE;AACT,gBAAA,KAAK,CAAC,KAAK,GAAG,yCAAyC;AACvD,gBAAA,IAAI,CAAC,kBAAkB,GAAG,IAAI;;iBACzB;gBACL,IAAI,CAAC,iBAAiB,EAAE;;AAE5B,SAAC,EAAE,IAAI,CAAC,sBAAsB,GAAG,GAAG,CAAC;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"salla-installment.entry.js","sources":["src/components/salla-installment/salla-installment.scss?tag=salla-installment","src/components/salla-installment/salla-installment.tsx"],"sourcesContent":["/*\n The whole installment methods is a third-party widgets,\n So there aren't a custom classes (as other components) to style them.\n*/\n\nsalla-installment:empty {\n display: none;\n}\n\n/*\n* Installment::Tabby\n*/\n#tabbyPromoWrapper {\n background: white;\n border-radius: 0.375rem;\n transition: box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);\n margin-bottom: 20px;\n border: unset !important;\n font-weight: 500;\n\n .salla-y & {\n border: 1px solid var(--color-grey-dark);\n border-radius: 12px\n }\n\n &:hover {\n box-shadow: 0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D;\n }\n\n #tabbyPromo {\n * {\n font-family: var(--font-main);\n }\n\n >div>div {\n max-width: none;\n //padding: 15px;\n box-shadow: none;\n border: none;\n }\n\n .tabby-promo-snippet {\n max-width: 100%;\n min-height: 100px;\n padding: 18px 20px;\n // border-color: var(--color-grey-dark);\n border: none !important;\n\n\n &__text,\n &__link {\n font-size: var(--font-sm);\n color: var(--color-text) !important;\n }\n\n &__link {\n font-weight: bold;\n }\n }\n }\n}\n\n.tabby-promo-wrapper {\n #tabby-promo {\n font-family: var(--font-main) !important;\n\n .tabby-promo {\n &__feature-title {\n font-size: var(--font-md);\n }\n\n &__feature-desc {\n font-size: var(--font-sm);\n line-height: 20px;\n }\n }\n }\n}\n\n/*\n* Installment::Tamara & Spotii\n*/\n.tamara-product-widget {\n margin-bottom: 20px;\n}\n\n.tamara-product-widget,\n.spotii-wrapper {\n min-height: 100px;\n position: relative;\n color: var(--main-text-color);\n font-size: var(--font-sm);\n line-height: 1.25;\n padding: 20px 20px 20px 115px !important;\n background: white;\n border-radius: 0.375rem;\n transition: box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);\n border: unset !important;\n font-family: inherit !important;\n font-weight: 500;\n .salla-y & {\n border-radius: 12px;\n border: 1px solid var(--color-grey-dark);\n }\n\n &:hover {\n box-shadow: 0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D;\n }\n\n .spotii-logo {\n float: left;\n margin: 0 0 0 -75px;\n }\n}\n\n.ltr .tamara-product-widget,\n.ltr .spotii-wrapper {\n text-align: left;\n padding: 18px 100px 18px 20px !important;\n\n .spotii-logo {\n float: right;\n margin: 0 -75px 0 0;\n }\n\n .spotii-product-widget {\n text-align: left !important;\n }\n}\n\n.spotii-wrapper {\n margin-bottom: 20px;\n\n .spotii-promo {\n font-size: var(--font-md);\n }\n\n .spotii-product-widget {\n font-size: var(--font-sm) !important;\n margin-top: 10px;\n }\n}\n\n.tamara-product-widget {\n .tamara-logo {\n position: absolute;\n left: 20px !important;\n top: 35px !important;\n margin: 0 !important;\n height: 24px !important;\n\n .ltr & {\n right: 20px !important;\n left: auto !important;\n }\n }\n\n span {\n font-family: var(--font-main);\n font-size: var(--font-sm);\n color: var(--color-text);\n\n &:last-child {\n display: block;\n position: relative;\n margin-top: 8px;\n }\n }\n}\n\n.tamara-popup {\n &__wrap {\n overflow: auto !important;\n }\n}\n\n// mispay and madfu and emkan\n// mispay, madfu, and emkan\n.s-installment-mispay-wrapper,\n.s-installment-madfu-wrapper,\n.s-installment-emkan-wrapper,\n.s-installment-rajehi-wrapper {\n // font-family: \"Noto Sans Arabic\", sans-serif;\n font-size: 14px;\n text-align: right;\n padding: 20px;\n gap: 42px;\n direction: rtl;\n line-height: 22px;\n color: rgb(0, 0, 0);\n min-width: 100%;\n box-sizing: border-box;\n position: relative;\n background-color: white;\n border-radius: 10px;\n margin: 15px 0;\n display: flex;\n transition: box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.s-installment-mispay-wrapper:hover,\n.s-installment-madfu-wrapper:hover,\n.s-installment-emkan-wrapper:hover,\n.s-installment-rajehi-wrapper:hover{\n box-shadow: 0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D;\n}\n\n.s-installment-mispay-content,\n.s-installment-madfu-content,\n.s-installment-emkan-content,\n.s-installment-rajehi-content {\n display: flex;\n flex-direction: row-reverse;\n width: 100%;\n justify-content: space-between;\n align-items: center;\n gap: 1rem;\n}\n\n\n.ltr .s-installment-mispay-content,\n.ltr .s-installment-madfu-content,\n.ltr .s-installment-emkan-content,\n.ltr .s-installment-rajehi-content{\n flex-direction: row;\n}\n\n.s-installment-mispay-content-text,\n.s-installment-madfu-content-text,\n.s-installment-emkan-content-text,\n.s-installment-rajehi-content-text {\n color: var(--main-text-color);\n font-size: 14px;\n font-weight: 500;\n margin: 0 16px 0 0;\n width: 80%;\n // position: absolute;\n left: 14px;\n text-align: left;\n}\n\n.s-installment-mispay-content img,\n.s-installment-madfu-content img,\n.s-installment-emkan-content img,\n.s-installment-rajehi-content img{\n height: 28px;\n width: 70px;\n display: inline-block;\n max-height: 100%;\n vertical-align: middle;\n fill: none;\n stroke: unset;\n width: auto;\n // position: absolute;\n}\n\n/* RTL Support */\n.rtl .s-installment-mispay-content-text,\n.rtl .s-installment-madfu-content-text,\n.rtl .s-installment-emkan-content-text,\n.rtl .s-installment-rajehi-content-text {\n right: 14px;\n text-align: right;\n margin: 0 0 0 16px;\n}\n\n.rtl .s-installment-mispay-content img,\n.rtl .s-installment-madfu-content img,\n.rtl .s-installment-emkan-content img,\n.rtl .s-installment-rajehi-content img{\n left: 14px !important;\n}\n\n.ltr .s-installment-mispay-content img,\n.ltr .s-installment-madfu-content img,\n.ltr .s-installment-emkan-content img,\n.ltr .s-installment-rajehi-content img {\n right: 14px !important;\n}\n\n\n.s-installment-rajehi-content img {\n width: 70px !important;\n height: 40px !important;;\n}\n\n.s-installment-emkan-content img {\n height: 35px !important;\n}\n\n","import { Component, Host, h, Prop, State, Element } from '@stencil/core';\n\n@Component({\n tag: 'salla-installment',\n styleUrl: 'salla-installment.scss',\n})\nexport class SallaInstallment {\n private tabbyBorderRemoved: boolean = false;\n private tabbyRemoveBorderTries: number = 0;\n @Element() host: HTMLElement;\n\n /**\n * Current product price\n */\n @Prop() price: string;\n /**\n * Language code\n */\n @Prop() language: string = salla.config.get('user.language_code');\n /**\n * Currency code\n */\n @Prop() currency: string = salla.config.get('user.currency_code');\n /**\n * Country code\n */\n @Prop() country: string = salla.config.get('user.country_code');\n\n @State() tabbyIsActive: boolean;\n @State() spotiiIsActive: boolean;\n @State() tamaraIsActive: null | { publicKey: string };\n @State() mispayActive: null | { merchantCode: string; publicKey: string };\n @State() emkanIsActive: boolean;\n @State() madfuActive: boolean;\n @State() rajehiIsActive?: { pointsPerRiyal: number };\n\n @State() installment_sheria_text: (key: string, replacement: object) => string = (key, replacement) => salla.lang.get(key, replacement);\n\n async componentWillLoad() {\n await salla.onReady();\n await salla.lang.onLoaded();\n this.currency = salla.config.get('user.currency_code') || 'SAR';\n this.language = salla.config.get('user.language_code') || 'ar';\n this.country = salla.config.get('user.country_code') || 'SA';\n\n const installmentOptions = [\n { key: 'pages.products.installments', installments: 3 },\n { key: 'pages.products.installments_emkan', installments: 5 },\n ];\n\n installmentOptions.forEach(option => {\n this.installment_sheria_text(option.key, {\n payment: salla.money(parseFloat(this.price)),\n amount: salla.money((parseFloat(this.price) / option.installments).toFixed(2)).replace(/\\.00$/, ''),\n installments: option.installments,\n });\n });\n\n const installment = salla.config.get('store.settings.installments');\n if (installment) {\n this.tamaraIsActive = installment.tamara;\n this.tabbyIsActive = installment.tabby;\n this.spotiiIsActive = installment.spotii;\n this.mispayActive = installment.mispay;\n this.emkanIsActive = installment.emkan;\n this.madfuActive = installment.madfu;\n this.rajehiIsActive = installment.mokafaa_alrajhi;\n }\n\n salla.event.on('product::price.updated', ({ data }) => {\n if (!data.price || data.price == this.price) {\n return;\n }\n this.price = data.price;\n this.renderInstallments(true);\n });\n }\n\n componentDidLoad() {\n this.renderInstallments();\n }\n\n render() {\n const isSAR = this.currency === 'SAR';\n\n if (!this.isValidPrice(this.price)) {\n return '';\n }\n return (\n <Host>\n {this.tamaraIsActive &&\n (this.tamaraIsActive?.publicKey ? (\n // Tamara widget v2\n <div class=\"mb-5\">\n <tamara-widget\n type=\"tamara-summary\"\n inline-type=\"2\"\n amount={this.price}\n ></tamara-widget>\n </div>\n ) : (\n // Tamara widget v1 fallback\n <div\n class=\"tamara-product-widget\"\n data-price={this.price}\n data-currency={this.currency}\n data-lang={this.language}\n data-payment-type=\"installment\"\n ></div>\n ))}\n\n {this.tabbyIsActive ? (\n <div id=\"tabbyPromoWrapper\">\n <div id=\"tabbyPromo\"></div>\n </div>\n ) : (\n ''\n )}\n\n {this.spotiiIsActive ? (\n <div class=\"spotii-wrapper\">\n {/*No need for the price, the price already in the page, and also tammara & tabby doesn't have price */}\n <div class=\"spotii-promo\"></div>\n </div>\n ) : (\n ''\n )}\n\n {this.shouldShowMispay() &&\n (this.mispayActive.publicKey ? (\n <div class=\"mb-5\">\n <mispay-widget amount={this.price} lang={this.language}></mispay-widget>\n </div>\n ) : (\n <div class=\"s-installment-mispay-wrapper\">\n <div class=\"s-installment-mispay-content\">\n <img src={salla.url.cdn('images/payment/png/mispay.png')} alt=\"mispay\" />\n <span class=\"s-installment-mispay-content-text\" innerHTML={this.installment_sheria_text('pages.products.installments',{\n payment: salla.money(parseFloat(this.price)),\n amount: salla.money((parseFloat(this.price) / 4).toFixed(2)),\n installments: 4,\n })}></span>\n </div>\n </div>\n ))}\n\n {this.emkanIsActive && this.currency === \"SAR\" ? (\n <div class=\"s-installment-emkan-wrapper\">\n <div class=\"s-installment-emkan-content\">\n <img src={salla.url.cdn('images/payment/png/emkan.png')} alt=\"emkan\" />\n <span class=\"s-installment-emkan-content-text\" innerHTML={this.installment_sheria_text('pages.products.installments_emkan', {\n payment: salla.money(parseFloat(this.price)),\n amount: salla.money((parseFloat(this.price) / 5).toFixed(2)),\n installments: 5,\n })}></span>\n </div>\n </div>\n ) : (\n ''\n )}\n {this.madfuActive && this.currency === \"SAR\" ? (\n <div class=\"s-installment-madfu-wrapper\">\n <div class=\"s-installment-madfu-content\">\n <img\n src={\n salla.url.cdn('images/payment/png/madfu.png')\n }\n alt=\"madfu\"\n />\n <span class=\"s-installment-madfu-content-text\">\n {salla.lang.get('pages.products.installments_madfu')}\n </span>\n </div>\n </div>\n ) : (\n ''\n )}\n\n {(isSAR && this.rajehiIsActive) ?\n <div class=\"s-installment-rajehi-wrapper\">\n <div class=\"s-installment-rajehi-content\">\n <img src={salla.url.cdn('images/payment/png/mokafaa_alrajhi_loyalty.png')} alt=\"mokafaa_alrajhi_loyalty\"/>\n\n <span class=\"s-installment-rajehi-content-text\">\n {salla.lang.get(\"pages.products.rajahi_earn_points\", {points: Math.floor(+this.price * this.rajehiIsActive.pointsPerRiyal)})}\n </span>\n\n </div>\n </div>\n\n : ''}\n </Host>\n );\n }\n\n renderInstallments(isUpdating: boolean = false) {\n if (!this.isValidPrice(this.price)) {\n return;\n }\n // Tamara\n if (this.tamaraIsActive) {\n this.loadTamara({isUpdating});\n }\n\n // tabby\n if (this.tabbyIsActive) {\n if (isUpdating) {\n // remove #tabbyPromoWrapper and re append it\n var oldTabbyWrapper = this.host.querySelector('#tabbyPromoWrapper');\n if (oldTabbyWrapper) {\n oldTabbyWrapper.remove();\n }\n\n var tabbyPromoWrapper = document.createElement('div');\n tabbyPromoWrapper.setAttribute('id', 'tabbyPromoWrapper');\n var tabbyPromo = document.createElement('div');\n tabbyPromo.setAttribute('id', 'tabbyPromo');\n tabbyPromoWrapper.appendChild(tabbyPromo);\n this.host.appendChild(tabbyPromoWrapper);\n\n var oldTabbyScript = document.querySelector(\n 'script[src=\"https://checkout.tabby.ai/tabby-promo.js\"]',\n );\n if (oldTabbyScript) {\n oldTabbyScript.remove();\n }\n }\n\n var tabbyScript = document.createElement('script');\n tabbyScript.setAttribute('src', 'https://checkout.tabby.ai/tabby-promo.js');\n document.head.appendChild(tabbyScript);\n tabbyScript.onload = () => {\n const TabbyPromo = window.TabbyPromo;\n new TabbyPromo({\n selector: '#tabbyPromo',\n currency: this.currency,\n price: this.price,\n lang: this.language,\n publicKey: salla.config.get('store.settings.installments.tabby.publicKey'),\n merchantCode: salla.config.get('store.settings.installments.tabby.merchantCode'),\n });\n document.querySelectorAll('.tabby-promo-snippet__logo').forEach(function (element) {\n element.setAttribute('aria-label', 'Tabby Logo');\n });\n };\n // this is a workaround to remove the default border and add margin\n this.removeTabbyBorder();\n }\n\n // Spotii\n if (this.spotiiIsActive) {\n if (isUpdating) {\n var oldSpotiiWrapper = this.host.querySelector('.spotii-wrapper');\n if (oldSpotiiWrapper) {\n oldSpotiiWrapper.remove();\n }\n\n var spotiiPromoWrapper = document.createElement('div');\n spotiiPromoWrapper.classList.add('spotii-wrapper');\n var spotiiPromo = document.createElement('div');\n spotiiPromo.classList.add('spotii-promo');\n spotiiPromoWrapper.appendChild(spotiiPromo);\n this.host.appendChild(spotiiPromoWrapper);\n var oldSpotiiScript = document.querySelector(\n 'script[src=\"' + salla.url.cdn('js/price-widget-ar-salla.js') + '\"]',\n );\n if (oldSpotiiScript) {\n oldSpotiiScript.remove();\n }\n }\n\n let amount = salla.money((Number(this.price) / 3).toFixed(2), false);\n let isRTL = salla.config.get('theme.is_rtl', true);\n window.spotiiConfig = {\n targetXPath: ['.spotii-wrapper'],\n renderToPath: ['.spotii-promo'],\n numberOfPayment: 3,\n currency: this.currency,\n templateLine: '${textOne} ${number} ${textTwo} ' + amount + '${logo} ${info}',\n //todo:: translate these\n textOne: isRTL ? 'جزء الدفع على' : 'Split it into',\n textTwo: isRTL ? 'أقساط متساوية بدون تكاليف اضافية بقيمة' : 'payments of',\n textThree: 'مع',\n price: this.price,\n // forcedShow: false,\n // merchantID: null,\n };\n\n var spotiiScript = document.createElement('script');\n spotiiScript.setAttribute('src', salla.url.cdn('js/price-widget-ar-salla.js'));\n document.head.appendChild(spotiiScript);\n // spotiiScript.onload = () => {\n // // setTimeout()\n // }\n }\n\n // Mispay\n if (this.shouldShowMispay() && this.mispayActive.publicKey) {\n this.loadExternalScript({\n position: 'head',\n src: `https://widget.mispay.co/v1/sdk.js?authorize=${this.mispayActive.publicKey}`,\n });\n }\n }\n\n private isValidPrice(price: string): boolean {\n const pricePattern = /^\\d+(\\.\\d{1,2})?$/;\n const isValid = pricePattern.test(price);\n const isGreaterThanZero = parseFloat(price) > 0;\n\n return isValid && isGreaterThanZero;\n }\n\n loadExternalScript({\n src,\n onLoad,\n position,\n }: {\n src: string;\n onLoad?: HTMLScriptElement['onload'];\n position: 'head' | 'body';\n }) {\n const script = document.createElement('script');\n script.src = src;\n script.onload = onLoad;\n document[position].appendChild(script);\n }\n\n loadTamara({ isUpdating }: { isUpdating: boolean }) {\n const isV2Enabled = !!this.tamaraIsActive?.publicKey;\n\n if (isUpdating) {\n setTimeout(() => {\n if (isV2Enabled) {\n return window.TamaraWidgetV2?.refresh();\n }\n\n // v1 fallback widget refresh\n window.TamaraProductWidget?.render();\n }, 300);\n } else {\n if (isV2Enabled) {\n const language_code = salla.config.get('user.language_code');\n const lang = ['ar', 'en'].includes(language_code) ? language_code : 'ar';\n // this used in case user change the currency to get the country code\n const countryCodeByCurrency = this.currency?.slice(0, -1);\n\n const country = ['SA', 'AE', 'KW', 'BH', 'OM', 'QA'].includes(countryCodeByCurrency)\n ? countryCodeByCurrency\n : null;\n\n if (!country) {\n console.error('Tamara: Country code is not supported', countryCodeByCurrency);\n } else {\n window.tamaraWidgetConfig = {\n lang,\n country,\n publicKey: this.tamaraIsActive.publicKey,\n style: {\n fontSize: '14px',\n },\n };\n\n this.loadExternalScript({\n position: 'head',\n src: 'https://cdn.tamara.co/widget-v2/tamara-widget.js',\n });\n }\n } else {\n // v1 fallback widget\n this.loadExternalScript({\n position: 'head',\n src: 'https://cdn.tamara.co/widget/product-widget.min.js',\n onLoad: () => {\n window.TamaraProductWidget.init({ lang: this.language });\n setTimeout(() => {\n window.TamaraProductWidget.render();\n }, 300);\n },\n });\n }\n }\n }\n\n shouldShowMispay() {\n return this.currency === 'SAR' && this.mispayActive && parseInt(this.price) >= 200;\n }\n\n /**\n * this is workaround to remove the default border and add margin\n * we will try to remove tabby border 5 times for 7.5 seconds\n */\n removeTabbyBorder() {\n if (this.tabbyBorderRemoved || this.tabbyRemoveBorderTries > 5) {\n return;\n }\n this.tabbyRemoveBorderTries++;\n setTimeout(() => {\n let promo: any = document.querySelector('#tabbyPromo>div>div');\n promo = promo && promo.shadowRoot\n ? promo.shadowRoot.querySelector('div[class^=\"styles__tabby-promo-snippet--\"]')\n : null;\n if (promo) {\n promo.style = 'border: none; margin: 15px 0!important;';\n this.tabbyBorderRemoved = true;\n } else {\n this.removeTabbyBorder();\n }\n }, this.tabbyRemoveBorderTries * 500);\n }\n}\n"],"names":[],"mappings":";;;;;AAAA,MAAM,mBAAmB,GAAG,4wMAA4wM;;MCM3xM,gBAAgB,GAAA,MAAA;AAJ7B,IAAA,WAAA,CAAA,OAAA,EAAA;;AAKU,QAAA,IAAkB,CAAA,kBAAA,GAAY,KAAK;AACnC,QAAA,IAAsB,CAAA,sBAAA,GAAW,CAAC;AAO1C;;AAEG;QACK,IAAQ,CAAA,QAAA,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC;AACjE;;AAEG;QACK,IAAQ,CAAA,QAAA,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC;AACjE;;AAEG;QACK,IAAO,CAAA,OAAA,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC;QAUtD,IAAA,CAAA,uBAAuB,GAAiD,CAAC,GAAG,EAAE,WAAW,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC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C,6CAA6C;kBAC5E,IAAI;YACR,IAAI,KAAK,EAAE;AACT,gBAAA,KAAK,CAAC,KAAK,GAAG,yCAAyC;AACvD,gBAAA,IAAI,CAAC,kBAAkB,GAAG,IAAI;;iBACzB;gBACL,IAAI,CAAC,iBAAiB,EAAE;;AAE5B,SAAC,EAAE,IAAI,CAAC,sBAAsB,GAAG,GAAG,CAAC;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as registerInstance,c as createEvent,h,H as Host}from"./index-
|
|
4
|
+
import{r as registerInstance,c as createEvent,h,H as Host}from"./index-BFfNxHPV.js";var sallaLoyaltyPrizeItemCss="salla-loyalty-prize-item:hover{-webkit-box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important;box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important}";var SallaLoyaltyPrizeItem=function(){function e(e){registerInstance(this,e);this.prizeItemSelected=createEvent(this,"prizeItemSelected")}e.prototype.onPrizeItemClick=function(){this.prizeItemSelected.emit(this.item)};e.prototype.render=function(){return h(Host,{key:"5434064e3e54117f4df4e16282f70e81503d7489"},h("div",{key:"28b5a19dcd1f239a74d69e91a1cda66ae7521e8e",onClick:this.onPrizeItemClick.bind(this)},h("img",{key:"82917e0074006f4e462b2328405714a31d168c17",class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),h("div",{key:"089ac134ed2a0474067c79cd590154ca85a380c9",class:"s-loyalty-prize-item-title"},this.item.name),h("div",{key:"85d245c32c42701274fa29761c4345020532eac1",class:"s-loyalty-prize-item-subtitle"},this.item.description),h("div",{key:"5f37781c8c77998a0bb586ddcda4640741db0b6e",class:"s-loyalty-prize-item-points"},this.item.cost_points," Points")))};return e}();SallaLoyaltyPrizeItem.style=sallaLoyaltyPrizeItemCss;export{SallaLoyaltyPrizeItem as salla_loyalty_prize_item};
|
|
5
5
|
//# sourceMappingURL=salla-loyalty-prize-item.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as registerInstance,h,H as Host,g as getElement}from"./index-
|
|
4
|
+
import{r as registerInstance,h,H as Host,g as getElement}from"./index-BFfNxHPV.js";var sallaMetadataCss="";var SallaMetadata=function(){function a(a){registerInstance(this,a);this.entity="product";this.specs=[];this.download=salla.lang.get("pages.thank_you.download");if(this.entityId){try{this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId);return}catch(a){salla.log("Bad json passed via entityId prop")}}}a.prototype.getValue=function(a){if(a.type==="file"){return'<a href="'.concat(a.value,'" class="text-primary" target="_blank"><span class="sicon-download"></span> ').concat(this.download,"</a>")}if(a.type==="url"){return'<a href="'.concat(a.value,'" class="text-blue-700 underline" target="_blank">').concat(a.value,"</a>")}if(a.type==="date"){var t=new Date(a.value);var r=String(t.getDate()).padStart(2,"0");var e=String(t.getMonth()+1).padStart(2,"0");var s=t.getFullYear();var n="".concat(r,"/").concat(e,"/").concat(s);return n}return a.value};a.prototype.componentWillLoad=function(){var a=this;return salla.onReady().then((function(){var a;if(!((a=salla.config.get("store.features"))===null||a===void 0?void 0:a.includes("custom-fields"))){throw new Error("feature custom-fields is not activated")}})).then((function(){if(!a.entityId&&salla.url.is_page("product.single")){a.entityId=salla.config.get("page.id")}if(!a.entityId){throw new Error("can't render salla-metadata without enity-id prop!")}salla.lang.onLoaded((function(){return a.download=salla.lang.get("pages.thank_you.download")}));var t=Array.isArray(a.entityId)?a.entityId:[a.entityId];var r=t.map((function(a){return"entities[]=".concat(a)})).join("&");var e="https://api.salla.dev/store/v1/metadata/values?type=".concat(a.entity,"&").concat(r);return salla.api.request(e).then((function(a){var t;return(t=a.data[0])===null||t===void 0?void 0:t.sections}))})).then((function(t){return a.specs=t})).catch((function(a){return salla.logger.error("Error loading more specs:",a)}))};a.prototype.render=function(){var a=this;if(!this.specs.length){return}return h(Host,{class:"s-metadata-wrapper"},this.specs.map((function(t){return h("div",{class:"s-metadata-box"},h("div",{class:"s-metadata-box-header"},h("i",{class:"sicon-list"}),t.name),t.fields.map((function(t){return h("div",{class:"s-metadata-row"},h("p",{class:"s-metadata-row-name"},t.name),h("p",{class:"s-metadata-row-value",innerHTML:a.getValue(t)}))})))})))};Object.defineProperty(a.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return a}();SallaMetadata.style=sallaMetadataCss;export{SallaMetadata as salla_metadata};
|
|
5
5
|
//# sourceMappingURL=salla-metadata.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as registerInstance,h}from"./index-
|
|
4
|
+
import{r as registerInstance,h}from"./index-BFfNxHPV.js";var sallaNotificationsCss="";var SallaNotificationItem=function(){function i(i){registerInstance(this,i)}i.prototype.render=function(){return h("a",{key:"1b234e649b23636170f30dfc46884e047d0f02ce",href:this.notification.url,class:{"s-notifications-item":true,"s-notifications-item-shadow":true,"s-notifications-item-read":!this.notification.is_new}},h("span",{key:"948c47868767a413bc488287af46caac7aa35c1e",class:"s-notifications-item-icon"},h("i",{key:"2ac3ada00bd7d7f3a6d5ba85341628ac382acef5",class:{"s-notifications-item-icon sicon-bell-ring":true,"s-notifications-item-icon-new":this.notification.is_new}})),h("div",{key:"a19c06341302bc389a2f5829c06367c03372fbfb",class:"s-notifications-item-content"},h("div",{key:"77ed75864e91b39095ee2505e10f432fbc896ec5",class:"s-notifications-item-content-leading"},h("h4",{key:"cee7566266dff68eeb2d8635e1eeaf2745b1930f"},this.notification.title),h("p",{key:"459ffde17436ff4311c64ee7f53966283390c410"},this.notification.sub_title)),h("span",{key:"b681d2c40f719e7d6d1e5abda8993b1bb870cbb6",class:"s-notifications-item-content-trailing"},h("i",{key:"2cd02287aaeeeaa00f972f4e0448f66e96949525",class:"sicon-time s-notifications-item-content-trailing-icon"}),h("span",{key:"4fd57d3f80816b0e607d5e6900d7975f94cf0892"},this.notification.date))))};return i}();SallaNotificationItem.style=sallaNotificationsCss;export{SallaNotificationItem as salla_notification_item};
|
|
5
5
|
//# sourceMappingURL=salla-notification-item.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,n,i,e){function r(t){return t instanceof i?t:new i((function(n){n(t)}))}return new(i||(i=Promise))((function(i,o){function a(t){try{u(e.next(t))}catch(t){o(t)}}function s(t){try{u(e["throw"](t))}catch(t){o(t)}}function u(t){t.done?i(t.value):r(t.value).then(a,s)}u((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},e,r,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(n){return u([t,n])}}function u(s){if(e)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(i=0)),i)try{if(e=1,r&&(o=s[0]&2?r["return"]:s[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;if(r=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;r=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(s[0]===6&&i.label<o[1]){i.label=o[1];o=s;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(s);break}if(o[2])i.ops.pop();i.trys.pop();continue}s=n.call(t,i)}catch(t){s=[6,t];r=0}finally{e=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/import{r as registerInstance,h,g as getElement}from"./index-
|
|
4
|
+
*/import{r as registerInstance,h,g as getElement}from"./index-BFfNxHPV.js";import{H as Helper}from"./Helper-BrCHOtZG.js";import"./anime.es-CgtvEd63.js";var sallaNotificationsCss="";var SallaNotifications=function(){function t(t){var n=this;registerInstance(this,t);this.itemPerPage=10;this.no_notifications_trans=salla.lang.get("blocks.header.no_notifications");this.load_more_text_trans=salla.lang.get("common.elements.load_more");salla.lang.onLoaded((function(){n.no_notifications_trans=salla.lang.get("blocks.header.no_notifications");n.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}t.prototype.loading=function(t){if(t===void 0){t=true}var n;var i=(n=this.status)===null||n===void 0?void 0:n.querySelector(".s-button-text");if(i){Helper.toggleElementClassIf(i,"s-button-hide","s-button-show",(function(){return t}));this.btnLoader.style.display=t?"inherit":"none"}};t.prototype.getNotificationCard=function(t){var n=document.createElement("salla-notification-item");n.notification=t;n.classList.add("s-block");return n};t.prototype.render=function(){var t=this;var n;if(this.showPlaceholder){return h("div",{class:"s-notifications-no-content"},h("salla-placeholder",{alignment:"center"},h("span",{slot:"title"},this.no_notifications_trans)))}return h("div",{class:"s-notifications-wrapper"},h("div",{class:"s-notifications-container",ref:function(n){return t.wrapper=n}}),this.nextPage&&h("div",{class:"s-infinite-scroll-wrapper",ref:function(n){return t.status=n}},h("button",{onClick:function(){return t.loadMore()},class:"s-infinite-scroll-btn s-button-btn s-button-primary"},h("span",{class:"s-button-text s-infinite-scroll-btn-text"},(n=this.loadMoreText)!==null&&n!==void 0?n:this.load_more_text_trans),h("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:function(n){return t.btnLoader=n},style:{display:"none"}}))))};t.prototype.handleResponse=function(t){var n=this;return t.map((function(t){return n.getNotificationCard(t)}))};t.prototype.initiateInfiniteScroll=function(){var t=this;var n,i,e;if(!this.wrapper){salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.");return}this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:function(){return t.nextPage},history:true,nextPage:this.nextPage,scrollThreshold:false},true);(n=this.infiniteScroll)===null||n===void 0?void 0:n.on("request",(function(n){t.loading()}));(i=this.infiniteScroll)===null||i===void 0?void 0:i.on("load",(function(n){var i;t.loading(false);t.pagination=n.pagination;t.nextPage=((i=n.pagination.links)===null||i===void 0?void 0:i.next)||null;t.handleResponse(n.data).forEach((function(n){return t.wrapper.append(n)}));var e=t.host.querySelectorAll("salla-notification-item:not(.animated)");Helper.animateItems(e)}));(e=this.infiniteScroll)===null||e===void 0?void 0:e.on("error",(function(t){salla.logger.error("Error loading more comments:",t)}))};t.prototype.loadInitialData=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,salla.api.notifications.fetch({per_page:this.itemPerPage}).then((function(n){var i;t.pagination=n.pagination;t.total=n.pagination.total;t.nextPage=((i=n.pagination.links)===null||i===void 0?void 0:i.next)||null;setTimeout((function(){if(!n.data.length){return t.showPlaceholder=true}t.handleResponse(n.data).forEach((function(n){return t.wrapper.append(n)}));t.initiateInfiniteScroll();var i=t.wrapper.querySelectorAll("salla-notification-item:not(.animated)");Helper.animateItems(i)}),100)})).catch((function(n){salla.logger.error(n);t.showPlaceholder=true;t.loading(false)}))];case 1:n.sent();return[2]}}))}))};t.prototype.loadMore=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){(t=this.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage();return[2]}))}))};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.loadInitialData()];case 1:t.sent();return[2]}}))}))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaNotifications.style=sallaNotificationsCss;export{SallaNotifications as salla_notifications};
|
|
5
5
|
//# sourceMappingURL=salla-notifications.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as registerInstance,h,g as getElement}from"./index-
|
|
4
|
+
import{r as registerInstance,h,g as getElement}from"./index-BFfNxHPV.js";var PageType;(function(e){e["ProductDetail"]="product.single";e["Cart"]="cart"})(PageType||(PageType={}));var OfferType;(function(e){e["Conditional"]="conditional";e["PercentageOrFixed"]="fixed";e["DiscountsTable"]="discounts_table";e["Bank"]="bank";e["BuyXGetY"]="buy_x_get_y"})(OfferType||(OfferType={}));var sallaOfferCss='.s-offer-wrapper .s-slider-block__title h2{font-size:1.125rem;line-height:1.75rem;color:#f87171}.s-offer-wrapper .s-slider-block__title h2::before{font-family:"sallaicons";content:"\\ee30" !important;position:absolute;top:1rem;font-size:3rem;font-weight:400;line-height:1;color:#fef2f2}.s-offer-bank-wrapper-sinlge-item{display:-ms-flexbox;display:flex;-ms-flex-align:center !important;align-items:center !important;gap:14px}.s-offer-bank-wrapper{display:-ms-flexbox !important;display:flex !important;width:100% !important}';var SallaOffer=function(){function e(e){var s=this;registerInstance(this,e);var r;this.productCardComponent="custom-salla-product-card";this.offersList=[];this.isMultipleBank=false;this.isBankOffer=false;this.canRender=false;this.showOffer=salla.config.get("store.settings.product.show_special_offers");this.offer_with_price_text=salla.lang.get("pages.offer.with_price",{price:""});this.with_discount_text=salla.lang.get("pages.products.with_a_discount");this.product_discount_text=salla.lang.get("pages.products.discount");this.special_offer_text=salla.lang.get("pages.products.special_offer");this.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");this.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");this.buy_quantity_text=function(e){return salla.lang.get("pages.offer.buy_quantity",{quantity:e})};salla.lang.onLoaded((function(){s.offer_with_price_text=salla.lang.get("pages.offer.with_price");s.with_discount_text=salla.lang.get("pages.products.with_a_discount");s.product_discount_text=salla.lang.get("pages.products.discount");s.special_offer_text=salla.lang.get("pages.products.special_offer");s.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");s.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");s.buy_quantity_text(0)}));salla.onReady((function(){s.currentPage=salla.config.get("page.slug");s.userCurrency=salla.config.get("currencies")[salla.config.get("user.currency_code")].symbol}));this.categorySlot=((r=this.host.querySelector('[slot="category"]'))===null||r===void 0?void 0:r.innerHTML)||'<a href={url} class="s-offer-slide-cat-entry"><i class={icon}></i><h4>{name}</h4></a>'}e.prototype.getEndpointByPageName=function(){var e;return(e={},e[PageType.Cart]="offers/cart/".concat(salla.storage.get("cart.id")),e[PageType.ProductDetail]="offers/product/".concat(salla.config.get("page.id")),e)[this.currentPage]||"offers"};e.prototype.componentWillLoad=function(){var e=this;this.hasCustomComponent=!!customElements.get(this.productCardComponent);return new Promise((function(e){return salla.onReady(e)})).then((function(){e.showOffer=!salla.url.is_page("product.single")||salla.config.get("store.settings.product.show_special_offers");if(e.showOffer){return}throw new Error("Merchant disabled showing the offers on product page")})).then((function(){return salla.api.request(e.getEndpointByPageName())})).then((function(s){if(!(e.offersList=s.data).length){throw new Error("salla-offers:: There is no offers!")}var r=e.offersList.find((function(e){return[OfferType.Bank,OfferType.BuyXGetY,OfferType.DiscountsTable].includes(e.type)}));if(!r){throw new Error("salla-offers:: Offer type not supported yet!")}if(r.type===OfferType.DiscountsTable){return e.offersList=[r]}if(e.isBankOffer=r.type===OfferType.Bank){e.offersList=e.offersList.filter((function(e){return e.type===OfferType.Bank}));e.isMultipleBank=e.offersList.length>1;return e.offersList}var t=r.details.get;return t.source==="products"?salla.product.api.fetch({source:"selected",source_value:t.source_value}).then((function(s){t.products=s.data;r.details.get=t;return e.offersList=[r]})):salla.product.api.categories().then((function(s){t.categories=e.findCategories(s.data,t.source_value);r.details.get=t;return e.offersList=[r]}))})).then((function(s){salla.storage.set(e.getStorageKey(),{offers:s,stored_at:(new Date).getTime()});e.canRender=true})).catch((function(e){salla.logger.warn(e)}))};e.prototype.componentDidLoad=function(){var e=this.host.querySelector(".s-slider-block__title-nav");e===null||e===void 0?void 0:e.classList.add("s-offer-bank-payment-nav")};e.prototype.findCategories=function(e,s){var r;var t=[];for(var a=0,n=e;a<n.length;a++){var i=n[a];if(s.includes(i.id_||i.id)){t.push(i)}if(((r=i.sub_categories)===null||r===void 0?void 0:r.length)>0){t=t.concat(this.findCategories(i.sub_categories,s))}}return t};e.prototype.getStorageKey=function(){try{var e=salla.config.get("page.slug").replace(".","_");var s=salla.lang.getLocale();var r=salla.config.currency().code;if(!e||!s||!r){throw new Error("Unable to get the storage key.")}return"s-offers-".concat(e,"-").concat(salla.config.get("page.id"),"-").concat(s,"-").concat(r)}catch(e){return""}};e.prototype.getOffersFromStorage=function(){var e=salla.storage.get(this.getStorageKey());if(!e||e.stored_at<(new Date).getTime()-10*60*1e3){salla.storage.remove(this.getStorageKey());return null}this.canRender=true;return Promise.resolve(e.offers)};e.prototype.render=function(){if(!this.offersList.length||!this.canRender||!this.showOffer)return null;var e=this.offersList[0];var s=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleText:null:e.title;var r=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleDescription:null:e.description;var t={"block-title":s,"block-subTitle":r,"show-controls":this.isMultipleBank};return h("div",{class:"s-offer-wrapper"},h("p",{class:"s-offer-corner-badge"},this.special_offer_text),h("salla-slider",Object.assign({type:"carousel",id:"offer-slider"},t),h("div",{slot:"items"},this.renderSectionForOfferType(e.type))))};e.prototype.renderSectionForOfferType=function(e){if(this.isBankOffer){return this.renderBankSection()}if(e==OfferType.BuyXGetY){return this.renderBuyXGetYSection()}return this.renderDiscountTableSection()};e.prototype.getCategoriesSection=function(e){return h("div",{class:"s-offer-slide-one-sixth swiper-slide",innerHTML:this.categorySlot.replace(/\{url\}/g,e.url).replace(/\{icon\}/g,e.icon||"sicon-store").replace(/\{name\}/g,e.name)})};e.prototype.renderBuyXGetYSection=function(){var e=this;var s,r;var t=this.offersList[0].details;return[(s=t.get.products)===null||s===void 0?void 0:s.map((function(s){return h("div",{class:"s-offer-slide-one-fourth"},e.hasCustomComponent?h(e.productCardComponent,{product:s}):h("salla-product-card",{"shadow-on-hover":true,product:s}))})),(r=t.get.categories)===null||r===void 0?void 0:r.map((function(s){return e.getCategoriesSection(s)}))]};e.prototype.renderBankSection=function(){var e=this;return this.offersList.map((function(s){return h("div",{class:{"s-offer-slide-one-sixth":e.isMultipleBank,"s-offer-bank-wrapper-sinlge-item":!e.isMultipleBank}},h("div",{class:{"s-offer-bank-wrapper":true,"s-offer-slide-one-sixth":!e.isMultipleBank,"s-offer-bank-wrapper-multi-spacer":e.isMultipleBank}},h("div",{class:"s-offer-bank-logo"},h("img",{src:s.details.logo||salla.url.cdn("images/s-empty.png"),"data-src":s.details.logo,alt:s.title+" offer"})),h("ul",{class:"s-offer-bank-payment-wrapper"},s.details.payments.map((function(e){return h("li",{class:"s-offer-bank-payment-single"},h("img",{src:salla.url.cdn("images/payment/"+e+".png")||salla.url.cdn("images/s-empty.png"),"data-src":salla.url.cdn("images/payment/"+e+".png"),alt:"payment"}))}))),e.isMultipleBank?h("p",{class:"s-offer-bank-payment-discount-percent"},"".concat(e.product_discount_text," ").concat(s.details.discount_value).concat(s.details.discount_type==="percentage"&&"%")):""),!e.isMultipleBank?h("div",{class:"s-offer-bank-message s-offer-slide-one-fourth"},h("h2",null,e.offersList[0].title),h("p",{innerHTML:e.generateBankDescription(e.offersList[0].description,s.details.discount_value)})):"")}))};e.prototype.generateBankDescription=function(e,s){return e.replace(new RegExp("".concat(s," %")),'<span class="s-offer-bank-message-amount">'.concat(s," %</span>"))};e.prototype.renderDiscountTableSection=function(){var e=this;var s;var r=this.offersList[0];var t=r.details.show_price_after_discount;return(s=this.offersList[0].details.discounts)===null||s===void 0?void 0:s.map((function(s){return h("div",{class:"s-offer-slide-one-fourth"},h("div",{class:"s-offer-slide-offer-entry"},h("div",{class:"s-offer-slide-offer-entry-price-quantity-container"},h("p",{class:"s-offer-slide-offer-entry-quantity"},e.buy_quantity_text(s.quantity)),t?h("div",{class:"s-offer-slide-offer-entry-price"},h("span",null,e.offer_with_price_text),h("span",{class:"s-offer-slide-offer-entry-price-amount"},s.discounted_amount)," ",h("span",null,e.userCurrency)):""),h("p",{class:"s-offer-slide-offer-entry-price-amount-percent"},e.with_discount_text,"(",h("span",null,s.percentage,!!s.percentage&&"%"),")")))}))};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaOffer.style=sallaOfferCss;export{SallaOffer as salla_offer};
|
|
5
5
|
//# sourceMappingURL=salla-offer.entry.js.map
|