@salla.sa/twilight-components 2.14.255 → 2.14.256
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-CRbtFdLh.js → app-globals-DecFm_m-.js} +3 -3
- package/dist/cjs/{app-globals-CRbtFdLh.js.map → app-globals-DecFm_m-.js.map} +1 -1
- package/dist/cjs/{index-CiB3mE81.js → index-UNWHm5vs.js} +4 -4
- package/dist/cjs/index-UNWHm5vs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion_4.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_51.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +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/components/index.js +2 -2
- package/dist/components/index.js.map +1 -1
- package/dist/esm/{app-globals-CXaqPW0W.js → app-globals-BWI-Bb8y.js} +3 -3
- package/dist/esm/{app-globals-CXaqPW0W.js.map → app-globals-BWI-Bb8y.js.map} +1 -1
- package/dist/esm/{index-Cmh2bDlu.js → index-wQf8KFfR.js} +4 -4
- package/dist/esm/index-wQf8KFfR.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion_4.entry.js +1 -1
- package/dist/esm/salla-add-product-button_51.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-booking-field_2.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +1 -1
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-options.entry.js +1 -1
- package/dist/esm/salla-review-card.entry.js +1 -1
- package/dist/esm/salla-reviews-page.entry.js +1 -1
- package/dist/esm/salla-reviews.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +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-CXaqPW0W.js → app-globals-BWI-Bb8y.js} +2 -2
- package/dist/esm-es5/{app-globals-CXaqPW0W.js.map → app-globals-BWI-Bb8y.js.map} +1 -1
- package/dist/esm-es5/{index-Cmh2bDlu.js → index-wQf8KFfR.js} +3 -3
- package/dist/esm-es5/index-wQf8KFfR.js.map +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-accordion_4.entry.js +1 -1
- package/dist/esm-es5/salla-add-product-button_51.entry.js +4 -4
- package/dist/esm-es5/salla-advertisement.entry.js +1 -1
- package/dist/esm-es5/salla-app-install-alert.entry.js +1 -1
- package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
- package/dist/esm-es5/salla-booking-field_2.entry.js +1 -1
- package/dist/esm-es5/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm-es5/salla-conditional-offer.entry.js +1 -1
- package/dist/esm-es5/salla-contacts.entry.js +1 -1
- package/dist/esm-es5/salla-filters-widget.entry.js +1 -1
- package/dist/esm-es5/salla-filters.entry.js +1 -1
- package/dist/esm-es5/salla-installment.entry.js +1 -1
- package/dist/esm-es5/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm-es5/salla-loyalty-program.entry.js +1 -1
- package/dist/esm-es5/salla-metadata.entry.js +2 -2
- 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-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm-es5/salla-order-details.entry.js +1 -1
- package/dist/esm-es5/salla-order-summary.entry.js +1 -1
- package/dist/esm-es5/salla-orders.entry.js +1 -1
- package/dist/esm-es5/salla-payments.entry.js +1 -1
- package/dist/esm-es5/salla-price-range.entry.js +1 -1
- package/dist/esm-es5/salla-product-options.entry.js +1 -1
- package/dist/esm-es5/salla-review-card.entry.js +1 -1
- package/dist/esm-es5/salla-reviews-page.entry.js +1 -1
- package/dist/esm-es5/salla-reviews.entry.js +1 -1
- package/dist/esm-es5/salla-social.entry.js +1 -1
- package/dist/esm-es5/salla-tiered-offer.entry.js +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-6c2ffbdb.entry.js → p-043b451e.entry.js} +2 -2
- package/dist/twilight/{p-302eb45d.system.entry.js → p-075582a1.system.entry.js} +2 -2
- package/dist/twilight/{p-cdadd220.entry.js → p-094e1bfb.entry.js} +2 -2
- package/dist/twilight/{p-ad83b353.system.entry.js → p-0e9ab63f.system.entry.js} +2 -2
- package/dist/twilight/{p-470e16b4.entry.js → p-14bc7704.entry.js} +2 -2
- package/dist/twilight/{p-fb5d9736.system.entry.js → p-187f0de5.system.entry.js} +2 -2
- package/dist/twilight/{p-471d0c2a.entry.js → p-18a1f403.entry.js} +2 -2
- package/dist/twilight/{p-6bd9b65d.system.entry.js → p-1a4075f6.system.entry.js} +2 -2
- package/dist/twilight/{p-7cdfb2ff.system.entry.js → p-1d2dc3d6.system.entry.js} +2 -2
- package/dist/twilight/{p-BVYqexVV.system.js.map → p-1viHRpqo.system.js.map} +1 -1
- package/dist/twilight/{p-dade84c6.entry.js → p-24683c1b.entry.js} +2 -2
- package/dist/twilight/{p-bef4449d.system.entry.js → p-29137c7f.system.entry.js} +2 -2
- package/dist/twilight/{p-7d060cdd.entry.js → p-2d9b7946.entry.js} +2 -2
- package/dist/twilight/{p-68cbea08.system.entry.js → p-2df289d8.system.entry.js} +2 -2
- package/dist/twilight/{p-6bd4f5dd.entry.js → p-2e4b02b7.entry.js} +2 -2
- package/dist/twilight/{p-b1266dbc.entry.js → p-30a71342.entry.js} +2 -2
- package/dist/twilight/{p-c9736f8b.entry.js → p-3416d165.entry.js} +2 -2
- package/dist/twilight/{p-c93aca68.system.entry.js → p-3ba77caf.system.entry.js} +2 -2
- package/dist/twilight/{p-84b61e25.entry.js → p-3dea4ce1.entry.js} +2 -2
- package/dist/twilight/{p-13a215f8.system.entry.js → p-44736c1f.system.entry.js} +2 -2
- package/dist/twilight/{p-53fdce47.system.entry.js → p-47f2f18e.system.entry.js} +2 -2
- package/dist/twilight/{p-bd97e5ea.system.entry.js → p-48df560c.system.entry.js} +2 -2
- package/dist/twilight/{p-41a7a590.system.entry.js → p-48f5142e.system.entry.js} +2 -2
- package/dist/twilight/{p-7f0e3435.entry.js → p-50f4a9e2.entry.js} +2 -2
- package/dist/twilight/{p-c4741c01.system.entry.js → p-52acbaea.system.entry.js} +2 -2
- package/dist/twilight/{p-889ec51e.system.entry.js → p-54080ee2.system.entry.js} +2 -2
- package/dist/twilight/{p-6868caa4.system.entry.js → p-57fa02ea.system.entry.js} +2 -2
- package/dist/twilight/{p-e53e006e.entry.js → p-5adde2a6.entry.js} +2 -2
- package/dist/twilight/{p-51915628.entry.js → p-5ed5d8f9.entry.js} +2 -2
- package/dist/twilight/{p-231440bc.system.entry.js → p-63435ed9.system.entry.js} +2 -2
- package/dist/twilight/{p-8e14e730.entry.js → p-69492d2a.entry.js} +2 -2
- package/dist/twilight/{p-468a7324.entry.js → p-6dc24b2b.entry.js} +2 -2
- package/dist/twilight/{p-7e3906fc.system.entry.js → p-73f3f2c3.system.entry.js} +2 -2
- package/dist/twilight/{p-6ef02abc.system.entry.js → p-78cfef2d.system.entry.js} +2 -2
- package/dist/twilight/{p-963ba76e.system.entry.js → p-7bd77519.system.entry.js} +2 -2
- package/dist/twilight/{p-d54d7cd7.system.entry.js → p-7c699521.system.entry.js} +2 -2
- package/dist/twilight/{p-fc7c940d.system.entry.js → p-8177fa38.system.entry.js} +2 -2
- package/dist/twilight/{p-56a2493e.entry.js → p-83c23d48.entry.js} +2 -2
- package/dist/twilight/{p-f0e1cc94.entry.js → p-853d41e8.entry.js} +2 -2
- package/dist/twilight/{p-02187d79.system.entry.js → p-89bf2f70.system.entry.js} +2 -2
- package/dist/twilight/{p-55a9da25.entry.js → p-96daa987.entry.js} +2 -2
- package/dist/twilight/{p-47f2e097.entry.js → p-9ba75295.entry.js} +2 -2
- package/dist/twilight/{p-DvzE4oQS.system.js.map → p-B2GM_QS5.system.js.map} +1 -1
- package/dist/twilight/{p-CbJXYJ5O.system.js → p-B3l0Kfzh.system.js} +3 -3
- package/dist/twilight/p-B3l0Kfzh.system.js.map +1 -0
- package/dist/twilight/{p-CYB_tFv0.system.js.map → p-B4Pb5WLq.system.js.map} +1 -1
- package/dist/twilight/{p-Ceb-eX-0.system.js.map → p-B60IU5Vs.system.js.map} +1 -1
- package/dist/twilight/{p-uNkJ2LZM.system.js.map → p-B7Sj5qYJ.system.js.map} +1 -1
- package/dist/twilight/{p-C3pcK7CB.js → p-B8IZTKFP.js} +2 -2
- package/dist/twilight/{p-C3pcK7CB.js.map → p-B8IZTKFP.js.map} +1 -1
- package/dist/twilight/{p-DJvU6sZZ.system.js.map → p-BDPbAe1K.system.js.map} +1 -1
- package/dist/twilight/{p-BpfPcg3W.system.js.map → p-BQLYc2vY.system.js.map} +1 -1
- package/dist/twilight/{p-aI0YGy91.system.js.map → p-Bf0KbqEp.system.js.map} +1 -1
- package/dist/twilight/{p-smRaSeBI.system.js.map → p-Bj9MrCiB.system.js.map} +1 -1
- package/dist/twilight/{p-CzmyZ_Nd.system.js → p-Bt6Eygwn.system.js} +2 -2
- package/dist/twilight/{p-CzmyZ_Nd.system.js.map → p-Bt6Eygwn.system.js.map} +1 -1
- package/dist/twilight/{p-BLd878to.system.js.map → p-BxJh7xdc.system.js.map} +1 -1
- package/dist/twilight/{p-Dk6V-4d2.system.js.map → p-C7iKwuQD.system.js.map} +1 -1
- package/dist/twilight/{p-CCrcmQ6i.system.js.map → p-C8F-L_m4.system.js.map} +1 -1
- package/dist/twilight/{p-BTHt_nZ5.system.js → p-CDwjlI7z.system.js} +2 -2
- package/dist/twilight/{p-BTHt_nZ5.system.js.map → p-CDwjlI7z.system.js.map} +1 -1
- package/dist/twilight/{p-BPogbRgc.system.js.map → p-CF3S17YT.system.js.map} +1 -1
- package/dist/twilight/{p-DsgPAMoP.system.js.map → p-CUf0HPrr.system.js.map} +1 -1
- package/dist/twilight/{p-DDgmoM0z.system.js.map → p-C_HvnS58.system.js.map} +1 -1
- package/dist/twilight/{p-By_R4wyt.system.js.map → p-Ca2Teikb.system.js.map} +1 -1
- package/dist/twilight/{p-CsF4wF5j.system.js.map → p-CgeNmDtS.system.js.map} +1 -1
- package/dist/twilight/{p-DoENPAoP.system.js.map → p-CghqBHSf.system.js.map} +1 -1
- package/dist/twilight/{p-KFQPthVf.system.js.map → p-CpKX8XYB.system.js.map} +1 -1
- package/dist/twilight/{p-D5AOZnju.system.js.map → p-D0J_AaUC.system.js.map} +1 -1
- package/dist/twilight/{p-D9CSx3Wz.system.js.map → p-D4G2wIz6.system.js.map} +1 -1
- package/dist/twilight/{p-DGWMlRvt.system.js.map → p-D4zrpBeO.system.js.map} +1 -1
- package/dist/twilight/{p-Ccypd_SM.system.js.map → p-DKjm4rCf.system.js.map} +1 -1
- package/dist/twilight/{p-C_ju2ao2.system.js.map → p-DMAlL0R0.system.js.map} +1 -1
- package/dist/twilight/{p-CKwOWJLk.system.js.map → p-DZSy6aSK.system.js.map} +1 -1
- package/dist/twilight/{p-BrKg9FB7.system.js.map → p-DjpII3ev.system.js.map} +1 -1
- package/dist/twilight/{p-DRcmoz10.system.js.map → p-DwFLdhIc.system.js.map} +1 -1
- package/dist/twilight/{p-DBkWclyq.system.js.map → p-Dx_ROnUt.system.js.map} +1 -1
- package/dist/twilight/{p-DDduzQA-.system.js.map → p-DyFLUz8M.system.js.map} +1 -1
- package/dist/twilight/{p-CXiTCFrN.system.js.map → p-DzXtTDb4.system.js.map} +1 -1
- package/dist/twilight/{p-BhewmKn2.system.js.map → p-R6dLd-aW.system.js.map} +1 -1
- package/dist/twilight/{p-b6c991e2.entry.js → p-a14111b9.entry.js} +2 -2
- package/dist/twilight/{p-02b2de19.system.entry.js → p-a3a9afb0.system.entry.js} +2 -2
- package/dist/twilight/{p-cfe9931b.system.entry.js → p-a8460414.system.entry.js} +2 -2
- package/dist/twilight/{p-e5ff9041.entry.js → p-a9996489.entry.js} +2 -2
- package/dist/twilight/{p-85b17c34.system.entry.js → p-af2294d6.system.entry.js} +2 -2
- package/dist/twilight/{p-419eb9a7.entry.js → p-afdaa346.entry.js} +2 -2
- package/dist/twilight/{p-2ac46fd5.system.entry.js → p-b3dc741c.system.entry.js} +2 -2
- package/dist/twilight/{p-9cf6cc9f.system.entry.js → p-bae72263.system.entry.js} +2 -2
- package/dist/twilight/{p-8277f14f.entry.js → p-bbf5e97b.entry.js} +2 -2
- package/dist/twilight/{p-459fff65.system.entry.js → p-bcd16c4e.system.entry.js} +2 -2
- package/dist/twilight/{p-67c93900.entry.js → p-be905670.entry.js} +2 -2
- package/dist/twilight/{p-4f3c5294.entry.js → p-cd5ce889.entry.js} +2 -2
- package/dist/twilight/{p-CaIXPRFW.system.js.map → p-d1T8kqjG.system.js.map} +1 -1
- package/dist/twilight/{p-9470463b.entry.js → p-d457dc38.entry.js} +2 -2
- package/dist/twilight/{p-e574830f.system.entry.js → p-d772798f.system.entry.js} +2 -2
- package/dist/twilight/{p-4710f397.entry.js → p-e34e1fb8.entry.js} +2 -2
- package/dist/twilight/{p-3099db22.system.entry.js → p-e95b04e6.system.entry.js} +2 -2
- package/dist/twilight/{p-44206730.entry.js → p-ea5a7966.entry.js} +2 -2
- package/dist/twilight/{p-78bf11f2.system.entry.js → p-ecbb77d9.system.entry.js} +2 -2
- package/dist/twilight/{p-93bc2972.system.entry.js → p-ed841a03.system.entry.js} +2 -2
- package/dist/twilight/{p-059379d0.entry.js → p-f3ec2b53.entry.js} +2 -2
- package/dist/twilight/{p-6fd8031a.entry.js → p-fc5efdeb.entry.js} +2 -2
- package/dist/twilight/{p-78715871.system.entry.js → p-fe17bbb4.system.entry.js} +3 -3
- package/dist/twilight/{p-72a5b284.entry.js → p-fef4ac95.entry.js} +2 -2
- package/dist/twilight/{p-2f228be7.entry.js → p-ff382951.entry.js} +2 -2
- package/dist/twilight/{p-4f1f3a1a.entry.js → p-ffbb9af5.entry.js} +2 -2
- package/dist/twilight/{p-Cmh2bDlu.js → p-wQf8KFfR.js} +3 -3
- package/dist/twilight/p-wQf8KFfR.js.map +1 -0
- package/dist/twilight/{p-C8tnyQ_B.system.js.map → p-ySzjfVuw.system.js.map} +1 -1
- package/dist/twilight/{p-EEU49bnm.system.js.map → p-ys-31B6G.system.js.map} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/package.json +5 -5
- package/dist/cjs/index-CiB3mE81.js.map +0 -1
- package/dist/esm/index-Cmh2bDlu.js.map +0 -1
- package/dist/esm-es5/index-Cmh2bDlu.js.map +0 -1
- package/dist/twilight/p-CbJXYJ5O.system.js.map +0 -1
- package/dist/twilight/p-Cmh2bDlu.js.map +0 -1
- /package/dist/twilight/{p-6c2ffbdb.entry.js.map → p-043b451e.entry.js.map} +0 -0
- /package/dist/twilight/{p-302eb45d.system.entry.js.map → p-075582a1.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-cdadd220.entry.js.map → p-094e1bfb.entry.js.map} +0 -0
- /package/dist/twilight/{p-ad83b353.system.entry.js.map → p-0e9ab63f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-470e16b4.entry.js.map → p-14bc7704.entry.js.map} +0 -0
- /package/dist/twilight/{p-fb5d9736.system.entry.js.map → p-187f0de5.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-471d0c2a.entry.js.map → p-18a1f403.entry.js.map} +0 -0
- /package/dist/twilight/{p-6bd9b65d.system.entry.js.map → p-1a4075f6.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-7cdfb2ff.system.entry.js.map → p-1d2dc3d6.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-dade84c6.entry.js.map → p-24683c1b.entry.js.map} +0 -0
- /package/dist/twilight/{p-bef4449d.system.entry.js.map → p-29137c7f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-7d060cdd.entry.js.map → p-2d9b7946.entry.js.map} +0 -0
- /package/dist/twilight/{p-68cbea08.system.entry.js.map → p-2df289d8.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6bd4f5dd.entry.js.map → p-2e4b02b7.entry.js.map} +0 -0
- /package/dist/twilight/{p-b1266dbc.entry.js.map → p-30a71342.entry.js.map} +0 -0
- /package/dist/twilight/{p-c9736f8b.entry.js.map → p-3416d165.entry.js.map} +0 -0
- /package/dist/twilight/{p-c93aca68.system.entry.js.map → p-3ba77caf.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-84b61e25.entry.js.map → p-3dea4ce1.entry.js.map} +0 -0
- /package/dist/twilight/{p-13a215f8.system.entry.js.map → p-44736c1f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-53fdce47.system.entry.js.map → p-47f2f18e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-bd97e5ea.system.entry.js.map → p-48df560c.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-41a7a590.system.entry.js.map → p-48f5142e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-7f0e3435.entry.js.map → p-50f4a9e2.entry.js.map} +0 -0
- /package/dist/twilight/{p-c4741c01.system.entry.js.map → p-52acbaea.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-889ec51e.system.entry.js.map → p-54080ee2.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6868caa4.system.entry.js.map → p-57fa02ea.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e53e006e.entry.js.map → p-5adde2a6.entry.js.map} +0 -0
- /package/dist/twilight/{p-51915628.entry.js.map → p-5ed5d8f9.entry.js.map} +0 -0
- /package/dist/twilight/{p-231440bc.system.entry.js.map → p-63435ed9.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-8e14e730.entry.js.map → p-69492d2a.entry.js.map} +0 -0
- /package/dist/twilight/{p-468a7324.entry.js.map → p-6dc24b2b.entry.js.map} +0 -0
- /package/dist/twilight/{p-7e3906fc.system.entry.js.map → p-73f3f2c3.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6ef02abc.system.entry.js.map → p-78cfef2d.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-963ba76e.system.entry.js.map → p-7bd77519.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-d54d7cd7.system.entry.js.map → p-7c699521.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-fc7c940d.system.entry.js.map → p-8177fa38.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-56a2493e.entry.js.map → p-83c23d48.entry.js.map} +0 -0
- /package/dist/twilight/{p-f0e1cc94.entry.js.map → p-853d41e8.entry.js.map} +0 -0
- /package/dist/twilight/{p-02187d79.system.entry.js.map → p-89bf2f70.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-55a9da25.entry.js.map → p-96daa987.entry.js.map} +0 -0
- /package/dist/twilight/{p-47f2e097.entry.js.map → p-9ba75295.entry.js.map} +0 -0
- /package/dist/twilight/{p-b6c991e2.entry.js.map → p-a14111b9.entry.js.map} +0 -0
- /package/dist/twilight/{p-02b2de19.system.entry.js.map → p-a3a9afb0.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-cfe9931b.system.entry.js.map → p-a8460414.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e5ff9041.entry.js.map → p-a9996489.entry.js.map} +0 -0
- /package/dist/twilight/{p-85b17c34.system.entry.js.map → p-af2294d6.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-419eb9a7.entry.js.map → p-afdaa346.entry.js.map} +0 -0
- /package/dist/twilight/{p-2ac46fd5.system.entry.js.map → p-b3dc741c.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9cf6cc9f.system.entry.js.map → p-bae72263.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-8277f14f.entry.js.map → p-bbf5e97b.entry.js.map} +0 -0
- /package/dist/twilight/{p-459fff65.system.entry.js.map → p-bcd16c4e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-67c93900.entry.js.map → p-be905670.entry.js.map} +0 -0
- /package/dist/twilight/{p-4f3c5294.entry.js.map → p-cd5ce889.entry.js.map} +0 -0
- /package/dist/twilight/{p-9470463b.entry.js.map → p-d457dc38.entry.js.map} +0 -0
- /package/dist/twilight/{p-e574830f.system.entry.js.map → p-d772798f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4710f397.entry.js.map → p-e34e1fb8.entry.js.map} +0 -0
- /package/dist/twilight/{p-3099db22.system.entry.js.map → p-e95b04e6.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-44206730.entry.js.map → p-ea5a7966.entry.js.map} +0 -0
- /package/dist/twilight/{p-78bf11f2.system.entry.js.map → p-ecbb77d9.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-93bc2972.system.entry.js.map → p-ed841a03.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-059379d0.entry.js.map → p-f3ec2b53.entry.js.map} +0 -0
- /package/dist/twilight/{p-6fd8031a.entry.js.map → p-fc5efdeb.entry.js.map} +0 -0
- /package/dist/twilight/{p-78715871.system.entry.js.map → p-fe17bbb4.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-72a5b284.entry.js.map → p-fef4ac95.entry.js.map} +0 -0
- /package/dist/twilight/{p-2f228be7.entry.js.map → p-ff382951.entry.js.map} +0 -0
- /package/dist/twilight/{p-4f1f3a1a.entry.js.map → p-ffbb9af5.entry.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,c as i,h as o,H as s,g as n}from"./p-Cmh2bDlu.js";import{I as e}from"./p-uTyAzPSy.js";import{C as a}from"./p-C6jIkM-X.js";var l;(function(t){t["COLOR"]="color";t["DATE"]="date";t["DATETIME"]="datetime";t["DONATION"]="donation";t["IMAGE"]="image";t["MULTIPLE_OPTIONS"]="multiple-options";t["NUMBER"]="number";t["SINGLE_OPTION"]="single-option";t["DIGITAL_CARD_VALUE"]="digital-code-value";t["COUNTRY"]="country";t["SPLITTER"]="splitter";t["TEXT"]="text";t["TEXTAREA"]="textarea";t["THUMBNAIL"]="thumbnail";t["TIME"]="time";t["RADIO"]="radio";t["CHECKBOX"]="checkbox";t["MAP"]="map";t["FILE"]="file";t["COLOR_PICKER"]="color_picker";t["BOOKING"]="booking"})(l||(l={}));var r;(function(t){t["Sar"]="SAR"})(r||(r={}));var d=`\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>file-upload</title>\n<path d="M21.333 24c0.341 0 0.683-0.131 0.943-0.391 0.521-0.521 0.521-1.364 0-1.885l-5.333-5.333c-0.123-0.123-0.271-0.22-0.433-0.288-0.327-0.135-0.693-0.135-1.019 0-0.163 0.068-0.311 0.165-0.433 0.288l-5.333 5.333c-0.521 0.521-0.521 1.364 0 1.885s1.364 0.521 1.885 0l3.057-3.057v10.115c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-10.115l3.057 3.057c0.26 0.26 0.601 0.391 0.943 0.391zM28.943 9.724l-9.333-9.333c-0.249-0.251-0.589-0.391-0.943-0.391h-12c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h4c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-4c-0.735 0-1.333-0.599-1.333-1.333v-24c0-0.735 0.599-1.333 1.333-1.333h11.448l8.552 8.552v16.781c0 0.735-0.599 1.333-1.333 1.333h-4c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h4c2.205 0 4-1.795 4-4v-17.333c0-0.353-0.14-0.693-0.391-0.943z"></path>\n</svg>\n`;const p="";const c=class{constructor(s){t(this,s);this.changed=i(this,"changed");this.fileTypes={pdf:"application/pdf",png:"image/png",jpg:"image/jpeg",word:"application/doc,application/ms-doc,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",exl:"application/excel,application/vnd.ms-excel,application/x-excel,application/x-msexcel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",txt:"text/plain"};this.outOfStockText="";this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ");this.isCustomDonation=false;this.selectedOptions=[];this.disableCardValue=true;this.availableDigitalCardValues=[];this.outSkus=[];this.ignoreDefaultCardValue=false;this.productId=salla.config.get("page.id");this.handleDonationOptions=(t,i,o)=>{if(i==="custom"&&o==="input"){salla.helpers.inputDigitsOnly(t.target);salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value});return}t.preventDefault();t.stopPropagation();this.isCustomDonation=t.target.value==="custom";if(this.donationInput){if(t.target.value==="custom"){this.donationInput.value="";this.donationInput.focus()}else{this.donationInput.value=t.target.value}if(i==="custom"){return}salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}};this.hideLabel=t=>{if(t.type===l.DONATION&&(t.donation&&!t.donation.can_donate)){return true}return false};this.getExpireDonationMessage=t=>{if(!t.donation){return}const i=t.donation.target_amount<=t.donation.collected_amount;return o("div",{class:{"s-product-options-donation-message":true,"s-product-options-donation-completed":i,"s-product-options-donation-expired":!i}},o("p",null,t.donation.target_message),o("span",{innerHTML:i?salla.money(t.donation.target_amount):""}))};this.canDisabled=!salla.config.get("store.settings.product.notify_options_availability")||salla.url.is_page("cart");salla.lang.onLoaded((()=>{this.outOfStockText=salla.lang.get("pages.products.out_of_stock");this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ")}));if(this.options){try{this.setOptionsData(Array.isArray(this.options)?this.options:JSON.parse(this.options));return}catch(t){salla.log("Bad json passed via options prop")}}if(!Array.isArray(this.optionsData)){salla.log("Options is not an array[] ---\x3e ",this.optionsData);this.setOptionsData([])}if(this.productId&&!salla.url.is_page("cart")){salla.api.product.getDetails(this.productId,["options"]).then((t=>this.setOptionsData(t.data.options)))}}async setOptionsData(t){var i,o;this.optionsData=t;const s=this;(o=(i=this.optionsData[0])===null||i===void 0?void 0:i.details)===null||o===void 0?void 0:o.forEach((function(t){Object.entries(t.skus_availability||{}).filter((t=>!t[1])).map((t=>s.outSkus.push(Number(t[0]))))}))}async getSelectedOptionsData(){const t={};const i=this.host.getElementSallaData();i.forEach(((i,o)=>{if(o.startsWith("options[")){t[o.replace("options[","").replace("]","")]=i}}));return t}async reportValidity(){const t=this.host.querySelectorAll("[required]");let i=true;for(let o=0;o<t.length;o++){if("reportValidity"in t[o]&&!t[o].reportValidity()){i=false}}return i}async hasOutOfStockOption(){var t,i;return this.selectedOptions.some((t=>t.is_out))||((t=this.selectedSkus)===null||t===void 0?void 0:t.length)&&((i=this.selectedSkus)===null||i===void 0?void 0:i.every((t=>this.outSkus.includes(t))))}async getSelectedOptions(){return this.selectedOptions}async getOption(t){return this.optionsData.find((i=>i.id===t))}invalidHandler(t,i){const o=t.target.closest(".s-product-options-option");if(!o.classList.contains("s-product-options-option-error")){o.classList.add("s-product-options-option-error")}if(!salla.url.is_page("cart")){const t=this.host.querySelector(".s-product-options-option-error");if(t===o){this.scrollToElement(o)}}}scrollToElement(t){if(t){t.scrollIntoView({behavior:"smooth",block:"center"})}}changedHandler(t,i,o=true){const s={event:t,option:i,detail:null,productId:this.productId};if(i.details){const o=i.details.find((i=>Number(i.id)===Number(t.target.value)));s.detail=o}if(i.type==="country"){this.handleCountryOptionChange(t,s.detail)}const n=t.target.closest(".s-product-options-option");if(t.target.value||(i.type===l.FILE||i.type===l.IMAGE)&&t.type==="added"||i.type===l.MAP&&t.type==="selected"&&(t.target.lat&&t.target.lng)){setTimeout((()=>{n.classList.remove("s-product-options-option-error")}),200)}if(i.type===l.DONATION){salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}this.setSelectedSkus();this.handleRequiredMultipleOptions(i);const e=this.selectedOptions.findIndex((t=>t.option_id===s.option.id));if(s.option.type===l.MULTIPLE_OPTIONS){const t=this.selectedOptions.findIndex((t=>{var i;return t.option_id===s.option.id&&(t===null||t===void 0?void 0:t.id)===((i=s.detail)===null||i===void 0?void 0:i.id)}));if(t>-1){this.selectedOptions.splice(t,1)}else{this.selectedOptions.push(Object.assign(Object.assign({},s.detail),{option_id:s.option.id}))}}else{if(!s.detail||Object.keys(s.detail).length===0){if(e>-1){this.selectedOptions.splice(e,1)}}else{if(e>-1){this.selectedOptions[e]=Object.assign(Object.assign({},s.detail),{option_id:s.option.id})}else{this.selectedOptions.push(Object.assign(Object.assign({},s.detail),{option_id:s.option.id}))}}}this.optionsData=this.optionsData.map((t=>{if(t.id===s.option.id){return Object.assign(Object.assign({},t),{details:t.details.map((t=>{var i,o;return Object.assign(Object.assign({},t),{is_selected:s.option.type===l.MULTIPLE_OPTIONS?this.selectedOptions.some((i=>i.id===t.id)):Number(t.id)===Number((i=s.detail)===null||i===void 0?void 0:i.id),value:(o=s.detail)===null||o===void 0?void 0:o.value})}))})}return t}));if(o){this.changed.emit(s);salla.event.emit("product-options::change",s)}}setSelectedSkus(){this.selectedSkus=this.selectedOptions.map((t=>Object.keys(t.skus_availability||{}))).reduce(((t,i)=>t.filter((t=>i.includes(t)))),[]).map((t=>Number(t)))}handleRequiredMultipleOptions(t){if(t.type!==l.MULTIPLE_OPTIONS||!t.required){return}const i=this.host.querySelector(`[data-option-id="${t.id}"]`);const o=i.querySelectorAll("input:checked").length;i.querySelectorAll("input").forEach((t=>t.toggleAttribute("required",!o)))}getLatLng(t,i){return t?t.split(",")[i==="lat"?0:1]:""}getDisplayForType(t){if(this[`${t.type}Option`]){return this[`${t.type}Option`](t)}if(t.type===l.COLOR_PICKER){return this.colorPickerOption(t)}if(t.type===l.MULTIPLE_OPTIONS){return this.multipleOptions(t)}if(t.type===l.SINGLE_OPTION){return this.singleOption(t)}if(t.type===l.DIGITAL_CARD_VALUE){return this.digitalCardValuesOption(t)}if(t.type===l.COUNTRY){return this.countryOption(t)}if(t.type===l.BOOKING&&salla.url.is_page("cart")){return o("salla-booking-field",{onInvalidInput:i=>this.invalidHandler(i,t),option:t,productId:t.value})}salla.log(`Couldn't find options type(${t.type})😢`);return""}getOptionShownWhen(t){return t.visibility_condition?{"data-show-when":`options[${t.visibility_condition.option}] ${t.visibility_condition.operator} ${t.visibility_condition.value}`}:{}}getAvailableDigitalCardSKUs(t){const i=this.optionsData.find((({type:t})=>t==="digital-code-value"));if(!i)throw new Error("product-options:: No digital card options found");const o=Object.keys(t.skus_availability).filter((i=>t.skus_availability[i]===false));this.availableDigitalCardValues=i.details.filter((t=>!Object.keys(t.skus_availability).filter((t=>o.includes(t))).length))}handleCountryOptionChange(t,i){t.stopImmediatePropagation();this.ignoreDefaultCardValue=true;const o=this.host.querySelector("input[data-code-value]:checked");if(o)o.checked=false;const s=this.optionsData.find((({type:t})=>t==="digital-code-value"));if(!s)throw new Error("product-options:: No digital card options found");this.getAvailableDigitalCardSKUs(i)}getSelectedDigitalCardOptions(t){const i=t.details.find((t=>t.is_selected));const o=t.details.find((t=>!!t.is_default))||t.details[0];if(!["digital-code-value","country"].includes(t.type))return;return i||o}async componentWillLoad(){if(salla.url.is_page("cart")){this.disableCardValue=false;this.fillSelectedOptions()}if(this.config){try{this.optionConfig=typeof this.config==="string"?JSON.parse(this.config):this.config}catch(t){console.error("Failed to parse JSON in config prop:",t)}}const t=this.optionsData.filter((({type:t})=>["country","digital-card-value"].includes(t))).length>0&&salla.url.is_page("cart");if(t){const t=this.optionsData.find((t=>t.type==="country"));const i=t&&this.getSelectedDigitalCardOptions(t);if(i){this.getAvailableDigitalCardSKUs(i)}}this.outOfStockText=salla.lang.get("pages.products.out_of_stock");await salla.onReady();document.addEventListener("paste",this.handlePaste.bind(this));const i=!salla.storage.get("cart.id")&&this.optionsData.some((t=>["file","image"].includes(t.type)));return i?salla.api.cart.getCurrentCartId(false,"salla-product-options"):null}handlePaste(t){var i;const o=t.target;if(!Salla.config.get("store.settings.content_copyright")||!Salla.helpers.hasApplePay()||!(o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement)||!o.classList.contains("s-form-control")||!o.name.startsWith("options[")){return}t.preventDefault();const s=((i=t.clipboardData)===null||i===void 0?void 0:i.getData("text"))||"";const n=o.selectionStart;const e=o.selectionEnd;const a=o.value.slice(0,n)+s+o.value.slice(e);o.value=a;o.setSelectionRange(n+s.length,n+s.length)}hideDigitalCardsOptions(t){return this.disableCardValue&&t.type===l.DIGITAL_CARD_VALUE&&!salla.url.is_page("cart")}render(){var t;if(((t=this.optionsData)===null||t===void 0?void 0:t.length)===0){return}return o(s,{class:"s-product-options-wrapper"},o("salla-conditional-fields",null,this.optionsData.map((t=>o("div",Object.assign({key:t.id,class:`s-product-options-option-container${t.visibility_condition||this.hideDigitalCardsOptions(t)?" hidden":""}`,"data-option-id":t.id},this.getOptionShownWhen(t)),t.name==="splitter"?this.splitterOption():o("div",{class:{"s-product-options-option":true,"s-product-options-option-booking":t.type===l.BOOKING&&salla.url.is_page("cart")},"data-option-type":t.type,"data-option-required":`${t.required}`},o("label",{htmlFor:`options[${t.id}]`,class:`s-product-options-option-label ${this.hideLabel(t)?"s-product-options-option-label-hidden":""}`},o("b",null,t.name,t.required&&o("span",null," * ")," "),o("small",null,t.placeholder)),o("div",{class:`s-product-options-option-content ${this.hideLabel(t)||t.type===l.BOOKING&&salla.url.is_page("cart")?"s-product-options-option-content-full-width":""}`},this.getDisplayForType(t))))))))}generateUniqueKey(t){return this.uniqueKey?`${t}-${this.uniqueKey}`:t}fillSelectedOptions(){this.selectedOptions=this.optionsData.reduce(((t,i)=>{const o=i.details.filter((t=>t.is_selected));const s=o.map((t=>Object.assign(Object.assign({},t),{option_id:i.id})));return t.concat(s)}),[])}triggerProductFormSelectionEvents(){const t=t=>["change","input"].forEach((i=>t.dispatchEvent(new window.Event(i,{bubbles:true}))));const i=this.host.closest("form");if(i){t(i)}else{const i=new MutationObserver((()=>{const o=this.host.closest("form");if(o){t(o);i.disconnect()}}));i.observe(document.body,{childList:true,subtree:true})}}componentDidLoad(){var t,i;if(salla.url.is_page("product.single")){this.triggerProductFormSelectionEvents()}if(((t=this.optionsData)===null||t===void 0?void 0:t.length)===0&&!this.optionsData.some((t=>t.type===l.DONATION))){return}const o=(i=this.optionsData.find((t=>t.type===l.DONATION)))===null||i===void 0?void 0:i.details.find((t=>t.is_selected));if(!o){return}setTimeout((()=>{salla.event.emit("product-options::donation-changed",{id:this.productId,price:o.additional_price})}),1e3)}donationOption(t,i){var s,n;return o("div",{class:"s-product-options-donation-wrapper"},((s=t.donation)===null||s===void 0?void 0:s.can_donate)?[t.donation?o("div",{key:t.id,class:"s-product-options-donation-progress"},o("salla-progress-bar",{donation:t.donation})):"",t.details.length?[o("h4",{key:t.id},this.selectAmount),o("div",{key:t.id,class:"s-product-options-donation-options"},t.details.map(((i,s)=>o("div",{key:t.id,class:"s-product-options-donation-options-item"},o("input",{id:this.generateUniqueKey(`donation-option-${s}`),type:"radio",name:"donating_option",checked:i.is_selected,value:i.additional_price,onChange:t=>this.handleDonationOptions(t,i,"option")}),o("label",{htmlFor:this.generateUniqueKey(`donation-option-${s}`)},o("span",{innerHTML:salla.money(i.name)}))))),((n=t.donation)===null||n===void 0?void 0:n.custom_amount_enabled)?o("div",{class:"s-product-options-donation-options-item"},o("input",{id:this.generateUniqueKey("donation-option-custom"),type:"radio",name:"donating_option",value:"custom",onChange:t=>this.handleDonationOptions(t,"custom","option")}),o("label",{htmlFor:this.generateUniqueKey("donation-option-custom")},o("span",null," ",this.selectDonationAmount," "))):"")]:"",o("div",{key:t.id,class:{"s-product-options-donation-input-group":true,shown:!t.details.length||t.details.length&&this.isCustomDonation}},o("input",{type:"text",id:"donating-amount",name:"donation_amount",class:"s-form-control",ref:t=>{this.donationInput=t},value:t.details.length&&t.details.some((t=>t.is_selected))?t.details.find((t=>t.is_selected)).additional_price:t.value,placeholder:t.placeholder,onInput:t=>this.handleDonationOptions(t,"custom","input"),onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t)}),o("span",{class:"s-product-options-donation-amount-currency"},salla.config.currency(salla.config.get("user.currency_code")).symbol))]:this.getExpireDonationMessage(t))}fileUploader(t,i=null){var s;return o("salla-file-upload",Object.assign({},i||{},{"payload-name":"file",value:t.value,"instant-upload":true,name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,height:"120px",onAdded:i=>this.changedHandler(i,t),url:salla.cart.api.getUploadImageEndpoint(),"form-data":{cart_item_id:this.productId,product_id:this.productId},onInvalidInput:i=>this.invalidHandler(i,t),class:{"s-product-options-image-input":true,required:t.required}}),o("div",{class:"s-product-options-filepond-placeholder"},o("span",{class:"s-product-options-filepond-placeholder-icon",innerHTML:((s=i.accept)===null||s===void 0?void 0:s.split(",").every((t=>t.includes("image"))))?a:d}),o("p",{class:"s-product-options-filepond-placeholder-text"},salla.lang.get("common.uploader.drag_and_drop")),o("span",{class:"filepond--label-action"},salla.lang.get("common.uploader.browse"))))}imageOption(t){return this.fileUploader(t,{accept:"image/png,image/jpeg,image/jpg,image/gif"})}fileOption(t){const i=t.details.map((t=>this.fileTypes[t.name])).filter(Boolean);return(i===null||i===void 0?void 0:i.length)?this.fileUploader(t,{accept:i.join(",")}):"File types not selected."}numberOption(t){return o("input",{type:"text",value:t.value,class:"s-form-control",required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t),onInput:t=>salla.helpers.inputDigitsOnly(t.target)})}splitterOption(){return o("div",{class:"s-product-options-splitter"})}textOption(t){return o("div",{class:"s-product-options-text"},o("input",{type:"text",value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}))}textareaOption(t){return o("div",{class:"s-product-options-textarea"},o("div",{class:"mt-1"},o("textarea",{rows:4,value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,id:`options[${t.id}]`,name:`options[${t.id}]`,placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)})))}mapOption(t){return o("salla-map",{zoom:15,lat:this.getLatLng(t.value,"lat"),lng:this.getLatLng(t.value,"lng"),name:`options[${t.id}]`,searchable:true,required:t.required,onInvalidInput:i=>this.invalidHandler(i,t),onSelected:i=>this.changedHandler(i,t)})}colorPickerOption(t){return o("salla-color-picker",{onSubmitted:i=>this.changedHandler(i,t),name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,onInvalidInput:i=>this.invalidHandler(i,t),color:t.value})}timeOption(t){return o("salla-datetime-picker",{noCalendar:true,enableTime:true,dateFormat:"h:i K",value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,class:"s-product-options-time-element",onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)})}dateOption(t){return o("div",{class:"s-product-options-date-element"},o("salla-datetime-picker",{value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,minDate:new Date,name:`options[${t.id}]`,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}datetimeOption(t){return o("div",{class:"s-product-options-datetime-element"},o("salla-datetime-picker",{enableTime:true,value:t.value,dateFormat:"Y-m-d G:i:K",placeholder:t.name,required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,maxDate:t.to_date_time,minDate:t.from_date_time,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}getOptionDetailName(t,i=true,o){var s;let n;if(o&&o===l.COLOR){n=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` <br/> <p> ${this.outOfStockText} </p>`:"")+(t.additional_price?` <p> (${salla.money(t.additional_price,false)}) </p>`:"")}if(!n){n=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` - ${this.outOfStockText}`:"")+(t.additional_price?` (${salla.money(t.additional_price,false)})`:"")}return n.replace("<i class=sicon-sar></i>",((s=salla.config.currency())===null||s===void 0?void 0:s.symbol)||"ر.س")}isOptionDetailOut(t){var i;if(t.is_out||!t.skus_availability||!((i=this.selectedSkus)===null||i===void 0?void 0:i.length)){return t.is_out}const o=this.selectedOptions.filter((i=>i.id===t.id)).length;if(o&&this.selectedOptions.length===1){return false}if(o){const i=this.selectedSkus.filter((t=>this.outSkus.includes(t)));return Object.keys(t.skus_availability).some((t=>i.includes(Number(t))))}return this.selectedOptions.some((i=>i.is_out&&i.option_id!==t.option_id))}renderInput(t,i,s,n,e,a){const l=this.generateUniqueKey(`${t}-${s.id}-${i.id}`);const r=this.isOptionDetailOut(i);return o("label",{class:{"s-product-options-disabled":r}},o("input",{id:l,type:t,name:e,value:i.id,disabled:r,required:n,checked:i.is_selected,onInvalid:t=>this.invalidHandler(t,s),onChange:t=>this.changedHandler(t,s)}),o("div",{class:{"s-product-options-grid-mode-span":a,"s-product-options-disabled":r}},this.getOptionDetailName(i)))}renderOptionDetails(t,i,o,s=false){const n=t==="radio"?`options[${i.id}]`:`options[${i.id}][]`;return i===null||i===void 0?void 0:i.details.map((e=>this.renderInput(t,e,i,o,n,s)))}renderSelect(t){return o("div",null,o("select",{name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,class:"s-form-control",onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)},o("option",{value:""},t.placeholder),t===null||t===void 0?void 0:t.details.map((t=>o("option",{key:t.id,value:t.id,disabled:this.canDisabled&&this.isOptionDetailOut(t),selected:t.is_selected},this.getOptionDetailName(t))))))}renderButtonStyle(t,i,s){return o("div",{class:"s-product-options-grid-mode"},this.renderOptionDetails(t,i,s,true))}singleOption(t){var i,o;const s=((o=(i=this.optionConfig)===null||i===void 0?void 0:i["single-option"])===null||o===void 0?void 0:o.type)==="button";const n=!t.visibility_condition&&t.required;return s?this.renderButtonStyle("radio",t,n):this.renderSelect(t)}multipleOptions(t){var i,s;const n=((s=(i=this.optionConfig)===null||i===void 0?void 0:i["multiple-option"])===null||s===void 0?void 0:s.type)==="button";const e=t.required&&!t.details.some((t=>t.is_selected))&&!t.visibility_condition;return n?this.renderButtonStyle("checkbox",t,e):o("div",{class:{"s-product-options-multiple-options-wrapper":true,required:t.required}},this.renderOptionDetails("checkbox",t,e))}colorOption(t){return o("fieldset",{class:"s-product-options-colors-wrapper"},t===null||t===void 0?void 0:t.details.map((i=>o("div",{class:"s-product-options-colors-item",key:i.id},o("input",{type:"radio",value:i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:`options[${t.id}]`,disabled:this.canDisabled&&this.isOptionDetailOut(i),id:this.generateUniqueKey(`color-${this.productId}-${t.id}-${i.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),o("label",{htmlFor:this.generateUniqueKey(`color-${this.productId}-${t.id}-${i.id}`)},o("span",{style:{backgroundColor:i.color}}),o("div",{innerHTML:this.getOptionDetailName(i,true,t.type)}))))))}thumbnailOption(t){return o("div",{class:"s-product-options-thumbnails-wrapper"},t.details.map((i=>o("div",{key:i.id},o("input",{type:"radio",value:i.id,"data-itemid":i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:`options[${t.id}]`,"data-img-id":i.option_value,disabled:this.canDisabled&&this.isOptionDetailOut(i),id:this.generateUniqueKey(`option_${this.productId}-${t.id}_${i.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),o("label",{htmlFor:this.generateUniqueKey(`option_${this.productId}-${t.id}_${i.id}`),"data-img-id":i.option_value,class:"go-to-slide"},o("img",{"data-src":i.image,src:i.image,title:i.name,alt:i.name}),o("span",{innerHTML:e,class:"s-product-options-thumbnails-icon"}),this.isOptionDetailOut(i)?[o("small",{key:i.id,class:"s-product-options-thumbnails-stock-badge"},this.outOfStockText),this.canDisabled?o("div",{key:i.id,class:"s-product-options-thumbnails-badge-overlay"}):""]:""),o("p",null,this.getOptionDetailName(i,false)," ")))))}digitalCardValuesOption(t){return o("div",{class:"s-product-options-digital-card-wrapper"},this.availableDigitalCardValues.length>0?this.availableDigitalCardValues.map((i=>{var s,n,e;const a=String(i.id);return o("label",{htmlFor:this.generateUniqueKey(a.toString()),key:a,class:"s-product-options-digital-card-option"},o("input",Object.assign({type:"radio","data-code-value":true,class:"s-form-control s-product-options-digital-card-input",value:i.id,name:`options[${t.id}]`,id:this.generateUniqueKey(a.toString()),required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t)},!this.ignoreDefaultCardValue?{defaultChecked:((s=this.getSelectedDigitalCardOptions(t))===null||s===void 0?void 0:s.id)===i.id}:{})),o("span",null,i.name," ",(e=(n=salla.config)===null||n===void 0?void 0:n.currency())===null||e===void 0?void 0:e.symbol))})):o("div",{class:"s-product-options-digital-card-out-of-stock"}))}countryOption(t){return o("div",{class:"s-product-options-digital-card-wrapper"},t.details.map((i=>{var s;return o("label",{htmlFor:this.generateUniqueKey(i.id.toString()),key:i.id,class:{"s-product-options-digital-card-option":true,"s-product-options-digital-card-option-stock-out":i.is_out}},o("input",Object.assign({id:this.generateUniqueKey(i.id.toString()),type:"radio",class:"s-form-control s-product-options-digital-card-input",value:i.id,name:`options[${t.id}]`,disabled:i.is_out,required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t),onClick:()=>{this.disableCardValue=false}},salla.url.is_page("cart")?{defaultChecked:((s=this.getSelectedDigitalCardOptions(t))===null||s===void 0?void 0:s.id)===i.id}:{})),o("img",{loading:"lazy",alt:i.code,height:24,width:24,class:"s-product-options-country-flag",src:`https://cdn.assets.salla.network/prod/admin/cp/assets/flags/1x1/${String(i.code).toLocaleLowerCase()}.svg`}),o("span",null,i.name))})))}get host(){return n(this)}};c.style=p;export{c as salla_product_options};
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as t,c as i,h as o,H as s,g as n}from"./p-wQf8KFfR.js";import{I as e}from"./p-uTyAzPSy.js";import{C as a}from"./p-C6jIkM-X.js";var l;(function(t){t["COLOR"]="color";t["DATE"]="date";t["DATETIME"]="datetime";t["DONATION"]="donation";t["IMAGE"]="image";t["MULTIPLE_OPTIONS"]="multiple-options";t["NUMBER"]="number";t["SINGLE_OPTION"]="single-option";t["DIGITAL_CARD_VALUE"]="digital-code-value";t["COUNTRY"]="country";t["SPLITTER"]="splitter";t["TEXT"]="text";t["TEXTAREA"]="textarea";t["THUMBNAIL"]="thumbnail";t["TIME"]="time";t["RADIO"]="radio";t["CHECKBOX"]="checkbox";t["MAP"]="map";t["FILE"]="file";t["COLOR_PICKER"]="color_picker";t["BOOKING"]="booking"})(l||(l={}));var r;(function(t){t["Sar"]="SAR"})(r||(r={}));var d=`\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>file-upload</title>\n<path d="M21.333 24c0.341 0 0.683-0.131 0.943-0.391 0.521-0.521 0.521-1.364 0-1.885l-5.333-5.333c-0.123-0.123-0.271-0.22-0.433-0.288-0.327-0.135-0.693-0.135-1.019 0-0.163 0.068-0.311 0.165-0.433 0.288l-5.333 5.333c-0.521 0.521-0.521 1.364 0 1.885s1.364 0.521 1.885 0l3.057-3.057v10.115c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-10.115l3.057 3.057c0.26 0.26 0.601 0.391 0.943 0.391zM28.943 9.724l-9.333-9.333c-0.249-0.251-0.589-0.391-0.943-0.391h-12c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h4c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-4c-0.735 0-1.333-0.599-1.333-1.333v-24c0-0.735 0.599-1.333 1.333-1.333h11.448l8.552 8.552v16.781c0 0.735-0.599 1.333-1.333 1.333h-4c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h4c2.205 0 4-1.795 4-4v-17.333c0-0.353-0.14-0.693-0.391-0.943z"></path>\n</svg>\n`;const p="";const c=class{constructor(s){t(this,s);this.changed=i(this,"changed");this.fileTypes={pdf:"application/pdf",png:"image/png",jpg:"image/jpeg",word:"application/doc,application/ms-doc,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",exl:"application/excel,application/vnd.ms-excel,application/x-excel,application/x-msexcel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",txt:"text/plain"};this.outOfStockText="";this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ");this.isCustomDonation=false;this.selectedOptions=[];this.disableCardValue=true;this.availableDigitalCardValues=[];this.outSkus=[];this.ignoreDefaultCardValue=false;this.productId=salla.config.get("page.id");this.handleDonationOptions=(t,i,o)=>{if(i==="custom"&&o==="input"){salla.helpers.inputDigitsOnly(t.target);salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value});return}t.preventDefault();t.stopPropagation();this.isCustomDonation=t.target.value==="custom";if(this.donationInput){if(t.target.value==="custom"){this.donationInput.value="";this.donationInput.focus()}else{this.donationInput.value=t.target.value}if(i==="custom"){return}salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}};this.hideLabel=t=>{if(t.type===l.DONATION&&(t.donation&&!t.donation.can_donate)){return true}return false};this.getExpireDonationMessage=t=>{if(!t.donation){return}const i=t.donation.target_amount<=t.donation.collected_amount;return o("div",{class:{"s-product-options-donation-message":true,"s-product-options-donation-completed":i,"s-product-options-donation-expired":!i}},o("p",null,t.donation.target_message),o("span",{innerHTML:i?salla.money(t.donation.target_amount):""}))};this.canDisabled=!salla.config.get("store.settings.product.notify_options_availability")||salla.url.is_page("cart");salla.lang.onLoaded((()=>{this.outOfStockText=salla.lang.get("pages.products.out_of_stock");this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ")}));if(this.options){try{this.setOptionsData(Array.isArray(this.options)?this.options:JSON.parse(this.options));return}catch(t){salla.log("Bad json passed via options prop")}}if(!Array.isArray(this.optionsData)){salla.log("Options is not an array[] ---\x3e ",this.optionsData);this.setOptionsData([])}if(this.productId&&!salla.url.is_page("cart")){salla.api.product.getDetails(this.productId,["options"]).then((t=>this.setOptionsData(t.data.options)))}}async setOptionsData(t){var i,o;this.optionsData=t;const s=this;(o=(i=this.optionsData[0])===null||i===void 0?void 0:i.details)===null||o===void 0?void 0:o.forEach((function(t){Object.entries(t.skus_availability||{}).filter((t=>!t[1])).map((t=>s.outSkus.push(Number(t[0]))))}))}async getSelectedOptionsData(){const t={};const i=this.host.getElementSallaData();i.forEach(((i,o)=>{if(o.startsWith("options[")){t[o.replace("options[","").replace("]","")]=i}}));return t}async reportValidity(){const t=this.host.querySelectorAll("[required]");let i=true;for(let o=0;o<t.length;o++){if("reportValidity"in t[o]&&!t[o].reportValidity()){i=false}}return i}async hasOutOfStockOption(){var t,i;return this.selectedOptions.some((t=>t.is_out))||((t=this.selectedSkus)===null||t===void 0?void 0:t.length)&&((i=this.selectedSkus)===null||i===void 0?void 0:i.every((t=>this.outSkus.includes(t))))}async getSelectedOptions(){return this.selectedOptions}async getOption(t){return this.optionsData.find((i=>i.id===t))}invalidHandler(t,i){const o=t.target.closest(".s-product-options-option");if(!o.classList.contains("s-product-options-option-error")){o.classList.add("s-product-options-option-error")}if(!salla.url.is_page("cart")){const t=this.host.querySelector(".s-product-options-option-error");if(t===o){this.scrollToElement(o)}}}scrollToElement(t){if(t){t.scrollIntoView({behavior:"smooth",block:"center"})}}changedHandler(t,i,o=true){const s={event:t,option:i,detail:null,productId:this.productId};if(i.details){const o=i.details.find((i=>Number(i.id)===Number(t.target.value)));s.detail=o}if(i.type==="country"){this.handleCountryOptionChange(t,s.detail)}const n=t.target.closest(".s-product-options-option");if(t.target.value||(i.type===l.FILE||i.type===l.IMAGE)&&t.type==="added"||i.type===l.MAP&&t.type==="selected"&&(t.target.lat&&t.target.lng)){setTimeout((()=>{n.classList.remove("s-product-options-option-error")}),200)}if(i.type===l.DONATION){salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}this.setSelectedSkus();this.handleRequiredMultipleOptions(i);const e=this.selectedOptions.findIndex((t=>t.option_id===s.option.id));if(s.option.type===l.MULTIPLE_OPTIONS){const t=this.selectedOptions.findIndex((t=>{var i;return t.option_id===s.option.id&&(t===null||t===void 0?void 0:t.id)===((i=s.detail)===null||i===void 0?void 0:i.id)}));if(t>-1){this.selectedOptions.splice(t,1)}else{this.selectedOptions.push(Object.assign(Object.assign({},s.detail),{option_id:s.option.id}))}}else{if(!s.detail||Object.keys(s.detail).length===0){if(e>-1){this.selectedOptions.splice(e,1)}}else{if(e>-1){this.selectedOptions[e]=Object.assign(Object.assign({},s.detail),{option_id:s.option.id})}else{this.selectedOptions.push(Object.assign(Object.assign({},s.detail),{option_id:s.option.id}))}}}this.optionsData=this.optionsData.map((t=>{if(t.id===s.option.id){return Object.assign(Object.assign({},t),{details:t.details.map((t=>{var i,o;return Object.assign(Object.assign({},t),{is_selected:s.option.type===l.MULTIPLE_OPTIONS?this.selectedOptions.some((i=>i.id===t.id)):Number(t.id)===Number((i=s.detail)===null||i===void 0?void 0:i.id),value:(o=s.detail)===null||o===void 0?void 0:o.value})}))})}return t}));if(o){this.changed.emit(s);salla.event.emit("product-options::change",s)}}setSelectedSkus(){this.selectedSkus=this.selectedOptions.map((t=>Object.keys(t.skus_availability||{}))).reduce(((t,i)=>t.filter((t=>i.includes(t)))),[]).map((t=>Number(t)))}handleRequiredMultipleOptions(t){if(t.type!==l.MULTIPLE_OPTIONS||!t.required){return}const i=this.host.querySelector(`[data-option-id="${t.id}"]`);const o=i.querySelectorAll("input:checked").length;i.querySelectorAll("input").forEach((t=>t.toggleAttribute("required",!o)))}getLatLng(t,i){return t?t.split(",")[i==="lat"?0:1]:""}getDisplayForType(t){if(this[`${t.type}Option`]){return this[`${t.type}Option`](t)}if(t.type===l.COLOR_PICKER){return this.colorPickerOption(t)}if(t.type===l.MULTIPLE_OPTIONS){return this.multipleOptions(t)}if(t.type===l.SINGLE_OPTION){return this.singleOption(t)}if(t.type===l.DIGITAL_CARD_VALUE){return this.digitalCardValuesOption(t)}if(t.type===l.COUNTRY){return this.countryOption(t)}if(t.type===l.BOOKING&&salla.url.is_page("cart")){return o("salla-booking-field",{onInvalidInput:i=>this.invalidHandler(i,t),option:t,productId:t.value})}salla.log(`Couldn't find options type(${t.type})😢`);return""}getOptionShownWhen(t){return t.visibility_condition?{"data-show-when":`options[${t.visibility_condition.option}] ${t.visibility_condition.operator} ${t.visibility_condition.value}`}:{}}getAvailableDigitalCardSKUs(t){const i=this.optionsData.find((({type:t})=>t==="digital-code-value"));if(!i)throw new Error("product-options:: No digital card options found");const o=Object.keys(t.skus_availability).filter((i=>t.skus_availability[i]===false));this.availableDigitalCardValues=i.details.filter((t=>!Object.keys(t.skus_availability).filter((t=>o.includes(t))).length))}handleCountryOptionChange(t,i){t.stopImmediatePropagation();this.ignoreDefaultCardValue=true;const o=this.host.querySelector("input[data-code-value]:checked");if(o)o.checked=false;const s=this.optionsData.find((({type:t})=>t==="digital-code-value"));if(!s)throw new Error("product-options:: No digital card options found");this.getAvailableDigitalCardSKUs(i)}getSelectedDigitalCardOptions(t){const i=t.details.find((t=>t.is_selected));const o=t.details.find((t=>!!t.is_default))||t.details[0];if(!["digital-code-value","country"].includes(t.type))return;return i||o}async componentWillLoad(){if(salla.url.is_page("cart")){this.disableCardValue=false;this.fillSelectedOptions()}if(this.config){try{this.optionConfig=typeof this.config==="string"?JSON.parse(this.config):this.config}catch(t){console.error("Failed to parse JSON in config prop:",t)}}const t=this.optionsData.filter((({type:t})=>["country","digital-card-value"].includes(t))).length>0&&salla.url.is_page("cart");if(t){const t=this.optionsData.find((t=>t.type==="country"));const i=t&&this.getSelectedDigitalCardOptions(t);if(i){this.getAvailableDigitalCardSKUs(i)}}this.outOfStockText=salla.lang.get("pages.products.out_of_stock");await salla.onReady();document.addEventListener("paste",this.handlePaste.bind(this));const i=!salla.storage.get("cart.id")&&this.optionsData.some((t=>["file","image"].includes(t.type)));return i?salla.api.cart.getCurrentCartId(false,"salla-product-options"):null}handlePaste(t){var i;const o=t.target;if(!Salla.config.get("store.settings.content_copyright")||!Salla.helpers.hasApplePay()||!(o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement)||!o.classList.contains("s-form-control")||!o.name.startsWith("options[")){return}t.preventDefault();const s=((i=t.clipboardData)===null||i===void 0?void 0:i.getData("text"))||"";const n=o.selectionStart;const e=o.selectionEnd;const a=o.value.slice(0,n)+s+o.value.slice(e);o.value=a;o.setSelectionRange(n+s.length,n+s.length)}hideDigitalCardsOptions(t){return this.disableCardValue&&t.type===l.DIGITAL_CARD_VALUE&&!salla.url.is_page("cart")}render(){var t;if(((t=this.optionsData)===null||t===void 0?void 0:t.length)===0){return}return o(s,{class:"s-product-options-wrapper"},o("salla-conditional-fields",null,this.optionsData.map((t=>o("div",Object.assign({key:t.id,class:`s-product-options-option-container${t.visibility_condition||this.hideDigitalCardsOptions(t)?" hidden":""}`,"data-option-id":t.id},this.getOptionShownWhen(t)),t.name==="splitter"?this.splitterOption():o("div",{class:{"s-product-options-option":true,"s-product-options-option-booking":t.type===l.BOOKING&&salla.url.is_page("cart")},"data-option-type":t.type,"data-option-required":`${t.required}`},o("label",{htmlFor:`options[${t.id}]`,class:`s-product-options-option-label ${this.hideLabel(t)?"s-product-options-option-label-hidden":""}`},o("b",null,t.name,t.required&&o("span",null," * ")," "),o("small",null,t.placeholder)),o("div",{class:`s-product-options-option-content ${this.hideLabel(t)||t.type===l.BOOKING&&salla.url.is_page("cart")?"s-product-options-option-content-full-width":""}`},this.getDisplayForType(t))))))))}generateUniqueKey(t){return this.uniqueKey?`${t}-${this.uniqueKey}`:t}fillSelectedOptions(){this.selectedOptions=this.optionsData.reduce(((t,i)=>{const o=i.details.filter((t=>t.is_selected));const s=o.map((t=>Object.assign(Object.assign({},t),{option_id:i.id})));return t.concat(s)}),[])}triggerProductFormSelectionEvents(){const t=t=>["change","input"].forEach((i=>t.dispatchEvent(new window.Event(i,{bubbles:true}))));const i=this.host.closest("form");if(i){t(i)}else{const i=new MutationObserver((()=>{const o=this.host.closest("form");if(o){t(o);i.disconnect()}}));i.observe(document.body,{childList:true,subtree:true})}}componentDidLoad(){var t,i;if(salla.url.is_page("product.single")){this.triggerProductFormSelectionEvents()}if(((t=this.optionsData)===null||t===void 0?void 0:t.length)===0&&!this.optionsData.some((t=>t.type===l.DONATION))){return}const o=(i=this.optionsData.find((t=>t.type===l.DONATION)))===null||i===void 0?void 0:i.details.find((t=>t.is_selected));if(!o){return}setTimeout((()=>{salla.event.emit("product-options::donation-changed",{id:this.productId,price:o.additional_price})}),1e3)}donationOption(t,i){var s,n;return o("div",{class:"s-product-options-donation-wrapper"},((s=t.donation)===null||s===void 0?void 0:s.can_donate)?[t.donation?o("div",{key:t.id,class:"s-product-options-donation-progress"},o("salla-progress-bar",{donation:t.donation})):"",t.details.length?[o("h4",{key:t.id},this.selectAmount),o("div",{key:t.id,class:"s-product-options-donation-options"},t.details.map(((i,s)=>o("div",{key:t.id,class:"s-product-options-donation-options-item"},o("input",{id:this.generateUniqueKey(`donation-option-${s}`),type:"radio",name:"donating_option",checked:i.is_selected,value:i.additional_price,onChange:t=>this.handleDonationOptions(t,i,"option")}),o("label",{htmlFor:this.generateUniqueKey(`donation-option-${s}`)},o("span",{innerHTML:salla.money(i.name)}))))),((n=t.donation)===null||n===void 0?void 0:n.custom_amount_enabled)?o("div",{class:"s-product-options-donation-options-item"},o("input",{id:this.generateUniqueKey("donation-option-custom"),type:"radio",name:"donating_option",value:"custom",onChange:t=>this.handleDonationOptions(t,"custom","option")}),o("label",{htmlFor:this.generateUniqueKey("donation-option-custom")},o("span",null," ",this.selectDonationAmount," "))):"")]:"",o("div",{key:t.id,class:{"s-product-options-donation-input-group":true,shown:!t.details.length||t.details.length&&this.isCustomDonation}},o("input",{type:"text",id:"donating-amount",name:"donation_amount",class:"s-form-control",ref:t=>{this.donationInput=t},value:t.details.length&&t.details.some((t=>t.is_selected))?t.details.find((t=>t.is_selected)).additional_price:t.value,placeholder:t.placeholder,onInput:t=>this.handleDonationOptions(t,"custom","input"),onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t)}),o("span",{class:"s-product-options-donation-amount-currency"},salla.config.currency(salla.config.get("user.currency_code")).symbol))]:this.getExpireDonationMessage(t))}fileUploader(t,i=null){var s;return o("salla-file-upload",Object.assign({},i||{},{"payload-name":"file",value:t.value,"instant-upload":true,name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,height:"120px",onAdded:i=>this.changedHandler(i,t),url:salla.cart.api.getUploadImageEndpoint(),"form-data":{cart_item_id:this.productId,product_id:this.productId},onInvalidInput:i=>this.invalidHandler(i,t),class:{"s-product-options-image-input":true,required:t.required}}),o("div",{class:"s-product-options-filepond-placeholder"},o("span",{class:"s-product-options-filepond-placeholder-icon",innerHTML:((s=i.accept)===null||s===void 0?void 0:s.split(",").every((t=>t.includes("image"))))?a:d}),o("p",{class:"s-product-options-filepond-placeholder-text"},salla.lang.get("common.uploader.drag_and_drop")),o("span",{class:"filepond--label-action"},salla.lang.get("common.uploader.browse"))))}imageOption(t){return this.fileUploader(t,{accept:"image/png,image/jpeg,image/jpg,image/gif"})}fileOption(t){const i=t.details.map((t=>this.fileTypes[t.name])).filter(Boolean);return(i===null||i===void 0?void 0:i.length)?this.fileUploader(t,{accept:i.join(",")}):"File types not selected."}numberOption(t){return o("input",{type:"text",value:t.value,class:"s-form-control",required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t),onInput:t=>salla.helpers.inputDigitsOnly(t.target)})}splitterOption(){return o("div",{class:"s-product-options-splitter"})}textOption(t){return o("div",{class:"s-product-options-text"},o("input",{type:"text",value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}))}textareaOption(t){return o("div",{class:"s-product-options-textarea"},o("div",{class:"mt-1"},o("textarea",{rows:4,value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,id:`options[${t.id}]`,name:`options[${t.id}]`,placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)})))}mapOption(t){return o("salla-map",{zoom:15,lat:this.getLatLng(t.value,"lat"),lng:this.getLatLng(t.value,"lng"),name:`options[${t.id}]`,searchable:true,required:t.required,onInvalidInput:i=>this.invalidHandler(i,t),onSelected:i=>this.changedHandler(i,t)})}colorPickerOption(t){return o("salla-color-picker",{onSubmitted:i=>this.changedHandler(i,t),name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,onInvalidInput:i=>this.invalidHandler(i,t),color:t.value})}timeOption(t){return o("salla-datetime-picker",{noCalendar:true,enableTime:true,dateFormat:"h:i K",value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,class:"s-product-options-time-element",onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)})}dateOption(t){return o("div",{class:"s-product-options-date-element"},o("salla-datetime-picker",{value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,minDate:new Date,name:`options[${t.id}]`,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}datetimeOption(t){return o("div",{class:"s-product-options-datetime-element"},o("salla-datetime-picker",{enableTime:true,value:t.value,dateFormat:"Y-m-d G:i:K",placeholder:t.name,required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,maxDate:t.to_date_time,minDate:t.from_date_time,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}getOptionDetailName(t,i=true,o){var s;let n;if(o&&o===l.COLOR){n=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` <br/> <p> ${this.outOfStockText} </p>`:"")+(t.additional_price?` <p> (${salla.money(t.additional_price,false)}) </p>`:"")}if(!n){n=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` - ${this.outOfStockText}`:"")+(t.additional_price?` (${salla.money(t.additional_price,false)})`:"")}return n.replace("<i class=sicon-sar></i>",((s=salla.config.currency())===null||s===void 0?void 0:s.symbol)||"ر.س")}isOptionDetailOut(t){var i;if(t.is_out||!t.skus_availability||!((i=this.selectedSkus)===null||i===void 0?void 0:i.length)){return t.is_out}const o=this.selectedOptions.filter((i=>i.id===t.id)).length;if(o&&this.selectedOptions.length===1){return false}if(o){const i=this.selectedSkus.filter((t=>this.outSkus.includes(t)));return Object.keys(t.skus_availability).some((t=>i.includes(Number(t))))}return this.selectedOptions.some((i=>i.is_out&&i.option_id!==t.option_id))}renderInput(t,i,s,n,e,a){const l=this.generateUniqueKey(`${t}-${s.id}-${i.id}`);const r=this.isOptionDetailOut(i);return o("label",{class:{"s-product-options-disabled":r}},o("input",{id:l,type:t,name:e,value:i.id,disabled:r,required:n,checked:i.is_selected,onInvalid:t=>this.invalidHandler(t,s),onChange:t=>this.changedHandler(t,s)}),o("div",{class:{"s-product-options-grid-mode-span":a,"s-product-options-disabled":r}},this.getOptionDetailName(i)))}renderOptionDetails(t,i,o,s=false){const n=t==="radio"?`options[${i.id}]`:`options[${i.id}][]`;return i===null||i===void 0?void 0:i.details.map((e=>this.renderInput(t,e,i,o,n,s)))}renderSelect(t){return o("div",null,o("select",{name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,class:"s-form-control",onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)},o("option",{value:""},t.placeholder),t===null||t===void 0?void 0:t.details.map((t=>o("option",{key:t.id,value:t.id,disabled:this.canDisabled&&this.isOptionDetailOut(t),selected:t.is_selected},this.getOptionDetailName(t))))))}renderButtonStyle(t,i,s){return o("div",{class:"s-product-options-grid-mode"},this.renderOptionDetails(t,i,s,true))}singleOption(t){var i,o;const s=((o=(i=this.optionConfig)===null||i===void 0?void 0:i["single-option"])===null||o===void 0?void 0:o.type)==="button";const n=!t.visibility_condition&&t.required;return s?this.renderButtonStyle("radio",t,n):this.renderSelect(t)}multipleOptions(t){var i,s;const n=((s=(i=this.optionConfig)===null||i===void 0?void 0:i["multiple-option"])===null||s===void 0?void 0:s.type)==="button";const e=t.required&&!t.details.some((t=>t.is_selected))&&!t.visibility_condition;return n?this.renderButtonStyle("checkbox",t,e):o("div",{class:{"s-product-options-multiple-options-wrapper":true,required:t.required}},this.renderOptionDetails("checkbox",t,e))}colorOption(t){return o("fieldset",{class:"s-product-options-colors-wrapper"},t===null||t===void 0?void 0:t.details.map((i=>o("div",{class:"s-product-options-colors-item",key:i.id},o("input",{type:"radio",value:i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:`options[${t.id}]`,disabled:this.canDisabled&&this.isOptionDetailOut(i),id:this.generateUniqueKey(`color-${this.productId}-${t.id}-${i.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),o("label",{htmlFor:this.generateUniqueKey(`color-${this.productId}-${t.id}-${i.id}`)},o("span",{style:{backgroundColor:i.color}}),o("div",{innerHTML:this.getOptionDetailName(i,true,t.type)}))))))}thumbnailOption(t){return o("div",{class:"s-product-options-thumbnails-wrapper"},t.details.map((i=>o("div",{key:i.id},o("input",{type:"radio",value:i.id,"data-itemid":i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:`options[${t.id}]`,"data-img-id":i.option_value,disabled:this.canDisabled&&this.isOptionDetailOut(i),id:this.generateUniqueKey(`option_${this.productId}-${t.id}_${i.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),o("label",{htmlFor:this.generateUniqueKey(`option_${this.productId}-${t.id}_${i.id}`),"data-img-id":i.option_value,class:"go-to-slide"},o("img",{"data-src":i.image,src:i.image,title:i.name,alt:i.name}),o("span",{innerHTML:e,class:"s-product-options-thumbnails-icon"}),this.isOptionDetailOut(i)?[o("small",{key:i.id,class:"s-product-options-thumbnails-stock-badge"},this.outOfStockText),this.canDisabled?o("div",{key:i.id,class:"s-product-options-thumbnails-badge-overlay"}):""]:""),o("p",null,this.getOptionDetailName(i,false)," ")))))}digitalCardValuesOption(t){return o("div",{class:"s-product-options-digital-card-wrapper"},this.availableDigitalCardValues.length>0?this.availableDigitalCardValues.map((i=>{var s,n,e;const a=String(i.id);return o("label",{htmlFor:this.generateUniqueKey(a.toString()),key:a,class:"s-product-options-digital-card-option"},o("input",Object.assign({type:"radio","data-code-value":true,class:"s-form-control s-product-options-digital-card-input",value:i.id,name:`options[${t.id}]`,id:this.generateUniqueKey(a.toString()),required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t)},!this.ignoreDefaultCardValue?{defaultChecked:((s=this.getSelectedDigitalCardOptions(t))===null||s===void 0?void 0:s.id)===i.id}:{})),o("span",null,i.name," ",(e=(n=salla.config)===null||n===void 0?void 0:n.currency())===null||e===void 0?void 0:e.symbol))})):o("div",{class:"s-product-options-digital-card-out-of-stock"}))}countryOption(t){return o("div",{class:"s-product-options-digital-card-wrapper"},t.details.map((i=>{var s;return o("label",{htmlFor:this.generateUniqueKey(i.id.toString()),key:i.id,class:{"s-product-options-digital-card-option":true,"s-product-options-digital-card-option-stock-out":i.is_out}},o("input",Object.assign({id:this.generateUniqueKey(i.id.toString()),type:"radio",class:"s-form-control s-product-options-digital-card-input",value:i.id,name:`options[${t.id}]`,disabled:i.is_out,required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t),onClick:()=>{this.disableCardValue=false}},salla.url.is_page("cart")?{defaultChecked:((s=this.getSelectedDigitalCardOptions(t))===null||s===void 0?void 0:s.id)===i.id}:{})),o("img",{loading:"lazy",alt:i.code,height:24,width:24,class:"s-product-options-country-flag",src:`https://cdn.assets.salla.network/prod/admin/cp/assets/flags/1x1/${String(i.code).toLocaleLowerCase()}.svg`}),o("span",null,i.name))})))}get host(){return n(this)}};c.style=p;export{c as salla_product_options};
|
|
5
|
+
//# sourceMappingURL=p-043b451e.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(r,t,e,i){function n(r){return r instanceof e?r:new e((function(t){t(r)}))}return new(e||(e=Promise))((function(e,s){function o(r){try{l(i.next(r))}catch(r){s(r)}}function a(r){try{l(i["throw"](r))}catch(r){s(r)}}function l(r){r.done?e(r.value):n(r.value).then(o,a)}l((i=i.apply(r,t||[])).next())}))};var __generator=this&&this.__generator||function(r,t){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(r){return function(t){return l([r,t])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(e=0)),e)try{if(i=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:e.label++;return{value:a[1],done:false};case 5:e.label++;n=a[1];a=[0];continue;case 7:a=e.ops.pop();e.trys.pop();continue;default:if(!(s=e.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){e.label=a[1];break}if(a[0]===6&&e.label<s[1]){e.label=s[1];s=a;break}if(s&&e.label<s[2]){e.label=s[2];e.ops.push(a);break}if(s[2])e.ops.pop();e.trys.pop();continue}a=t.call(r,e)}catch(r){a=[6,r];n=0}finally{i=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(r,t,e){if(e||arguments.length===2)for(var i=0,n=t.length,s;i<n;i++){if(s||!(i in t)){if(!s)s=Array.prototype.slice.call(t,0,i);s[i]=t[i]}}return r.concat(s||Array.prototype.slice.call(t))};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-CbJXYJ5O.system.js"],(function(r){"use strict";var t,e,i;return{setters:[function(r){t=r.r;e=r.h;i=r.H}],execute:function(){var n;(function(r){r["PERCENTAGE"]="percentage";r["FIXED"]="fixed"})(n||(n={}));var s='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M13.7276 3.44418L15.4874 6.99288C15.7274 7.48687 16.3673 7.9607 16.9073 8.05143L20.0969 8.58575C22.1367 8.92853 22.6167 10.4206 21.1468 11.8925L18.6671 14.3927C18.2471 14.8161 18.0172 15.6327 18.1471 16.2175L18.8571 19.3125C19.417 21.7623 18.1271 22.71 15.9774 21.4296L12.9877 19.6452C12.4478 19.3226 11.5579 19.3226 11.0079 19.6452L8.01827 21.4296C5.8785 22.71 4.57865 21.7522 5.13859 19.3125L5.84851 16.2175C5.97849 15.6327 5.74852 14.8161 5.32856 14.3927L2.84884 11.8925C1.389 10.4206 1.85895 8.92853 3.89872 8.58575L7.08837 8.05143C7.61831 7.9607 8.25824 7.48687 8.49821 6.99288L10.258 3.44418C11.2179 1.51861 12.7777 1.51861 13.7276 3.44418Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>';var o='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M3 12C7.5 12 12 7.5 12 3C12 7.5 16.5 12 21 12C16.5 12 12 16.5 12 21C12 16.5 7.5 12 3 12Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M2 19.5C2.83333 19.5 4.5 17.8333 4.5 17C4.5 17.8333 6.16667 19.5 7 19.5C6.16667 19.5 4.5 21.1667 4.5 22C4.5 21.1667 2.83333 19.5 2 19.5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M16 5C17 5 19 3 19 2C19 3 21 5 22 5C21 5 19 7 19 8C19 7 17 5 16 5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n</svg>';var a='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M14.2644 18.3717C14.5806 17.407 14.7387 16.9247 15.0616 16.593C15.215 16.4354 15.3932 16.3048 15.5887 16.2066C16.0003 16 16.5003 16 17.5002 16C18.5001 16 19.0001 16 19.4116 16.2066C19.6072 16.3048 19.7853 16.4354 19.9388 16.593C20.2617 16.9247 20.4198 17.407 20.736 18.3717L21.0624 19.3675C21.4561 20.5688 21.653 21.1694 21.3587 21.5847C21.0643 22 20.4418 22 19.1966 22H15.8038C14.5586 22 13.936 22 13.6417 21.5847C13.3473 21.1694 13.5442 20.5688 13.938 19.3675L14.2644 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M8.76421 10.3717C9.08041 9.40705 9.23851 8.92471 9.56143 8.59298C9.71485 8.43537 9.89299 8.3048 10.0885 8.20663C10.5001 8 11.0001 8 12 8C12.9999 8 13.4999 8 13.9115 8.20663C14.107 8.3048 14.2851 8.43537 14.4386 8.59298C14.7615 8.92471 14.9196 9.40705 15.2358 10.3717L15.5622 11.3675C15.956 12.5688 16.1528 13.1694 15.8585 13.5847C15.5642 14 14.9416 14 13.6964 14H10.3036C9.05842 14 8.43585 14 8.1415 13.5847C7.84716 13.1694 8.04404 12.5688 8.43779 11.3675L8.76421 10.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M3.26439 18.3717C3.58059 17.407 3.73869 16.9247 4.06162 16.593C4.21504 16.4354 4.39317 16.3048 4.58872 16.2066C5.00031 16 5.50027 16 6.50018 16C7.5001 16 8.00006 16 8.41165 16.2066C8.6072 16.3048 8.78533 16.4354 8.93875 16.593C9.26167 16.9247 9.41977 17.407 9.73597 18.3717L10.0624 19.3675C10.4561 20.5688 10.653 21.1694 10.3587 21.5847C10.0643 22 9.44176 22 8.19661 22H4.80375C3.5586 22 2.93603 22 2.64169 21.5847C2.34735 21.1694 2.54422 20.5688 2.93797 19.3675L3.26439 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M12 2V4M7.5 3.5L9 5M16.5 3.5L15 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>\n</svg>';var l='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M5.78223 4.18192C6.43007 3.68319 6.754 3.43383 7.12788 3.27323C7.29741 3.20041 7.47367 3.14158 7.65459 3.09741C8.0536 3 8.4767 3 9.32289 3H14.6771C15.5233 3 15.9464 3 16.3454 3.09741C16.5263 3.14158 16.7026 3.20041 16.8721 3.27323C17.246 3.43383 17.5699 3.68319 18.2178 4.18192C20.3644 5.83448 21.4378 6.66077 21.8057 7.73078C21.9694 8.20673 22.0305 8.70728 21.9858 9.20461C21.8852 10.3227 21.0379 11.346 19.3433 13.3925L15.3498 18.2153C13.8126 20.0718 13.044 21 12 21C10.956 21 10.1874 20.0718 8.65018 18.2153L4.65671 13.3925C2.96208 11.346 2.11476 10.3227 2.0142 9.20461C1.96947 8.70728 2.03064 8.20673 2.1943 7.73078C2.56224 6.66077 3.63557 5.83448 5.78223 4.18192Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M10 8.5H14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>';var f={staticIcons:[s,o,a,l],staticColors:["#993018","#444444","#D18F36","#315F9C"]};var u=function(){function r(){}r.findTierByIndex=function(r,t){return r.find((function(r){return r.index===t}))||null};r.findTierByName=function(r,t){return r.find((function(r){return r.tier_name===t}))||null};r.getTierNameByIndex=function(r,t){var e;return(e=this.findTierByIndex(r,t))===null||e===void 0?void 0:e.tier_name};r.findCurrentTierIndex=function(r,t){if(!t)return 0;for(var e=t.length-1;e>=0;e--){if(r>=t[e].threshold){return t[e].index}}return 0};return r}();var c=".s-tiered-offer-milestone-icon svg{color:currentColor}.s-tiered-offer-milestone-icon svg path{stroke:currentColor;fill:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg path{fill:currentColor;stroke:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg[fill=none] path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg[fill=none] path{fill:none;stroke:currentColor}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-bg{-webkit-transform:scaleX(-1);transform:scaleX(-1)}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-fill{-webkit-transform:scaleX(-1);transform:scaleX(-1);left:auto}[dir=rtl] .flip-x{-webkit-transform:scaleX(-1);transform:scaleX(-1)}";var d=r("salla_tiered_offer",function(){function r(r){var e=this;t(this,r);this.currentTierIndex=0;this.canRender=false;this.isLoading=false;this.handleTabClick=function(r){e.activeTabTier=r};salla.lang.onLoaded((function(){e.loyaltyProgramText=salla.lang.get("blocks.tiered_offer.program_title");e.currentTierText=salla.lang.get("blocks.tiered_offer.current_tier");e.discountText=salla.lang.get("blocks.tiered_offer.discount");e.benefitText=salla.lang.get("blocks.tiered_offer.tier_description")}))}r.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var r,t;return __generator(this,(function(e){switch(e.label){case 0:e.trys.push([0,3,4,5]);return[4,salla.onReady()];case 1:e.sent();if(!this.checkFeatureEnabled()){return[2]}if(!this.checkCartExists()){return[2]}this.isLoading=true;return[4,this.fetchTieredOfferData()];case 2:r=e.sent();if(!r){return[2]}this.initializeComponent(r);return[3,5];case 3:t=e.sent();this.canRender=false;salla.logger.warn("salla-tiered-offer:: ",t);return[3,5];case 4:this.isLoading=false;return[7];case 5:return[2]}}))}))};r.prototype.checkFeatureEnabled=function(){var r;return(r=salla.config.get("store.features"))===null||r===void 0?void 0:r.includes("tiered-offer")};r.prototype.checkCartExists=function(){var r,t;return!!((t=(r=salla.storage.get("cart"))===null||r===void 0?void 0:r.summary)===null||t===void 0?void 0:t.count)};r.prototype.validateCouponCompatibility=function(r,t){var e;return!(t&&!((e=r.details)===null||e===void 0?void 0:e.applied_with_coupon))};r.prototype.fetchTieredOfferData=function(){return __awaiter(this,void 0,void 0,(function(){var r,t,e,i;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,salla.api.cart.offers()];case 1:t=n.sent().data;e=t.find((function(r){return r.type==="tiered_offer"}));if(!e){return[2,null]}if(!this.validateCouponCompatibility(e,(r=salla.storage.get("cart"))===null||r===void 0?void 0:r.coupon)){this.canRender=false;return[2,null]}return[2,e];case 2:i=n.sent();throw i;case 3:return[2]}}))}))};r.prototype.initializeComponent=function(r){var t;this.apiOfferData=r;this.tieredOfferData=this.mapApiDataToTiers(this.apiOfferData);this.loyaltyProgramText=this.apiOfferData.title||this.loyaltyProgramText;var e=((t=this.apiOfferData.details)===null||t===void 0?void 0:t.current_value)||0;var i=this.findCurrentTierIndex(e);if(i===0){this.canRender=false;return}this.currentTierIndex=i;this.currentTier=u.getTierNameByIndex(this.tieredOfferData.tiers,i);this.activeTabTier=this.currentTier;this.canRender=true};r.prototype.componentDidLoad=function(){var r=this;salla.event.on("cart::updated",(function(t){return __awaiter(r,void 0,void 0,(function(){var r;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.fetchTieredOfferData()];case 1:r=e.sent();if(r){this.updateOfferValues(t,r)}return[2]}}))}))}))};r.prototype.mapApiDataToTiers=function(r){var t=__spreadArray([],r.details.discounts,true).sort((function(r,t){return r.min_spend-t.min_spend}));var e=t.map((function(r,t){return{name:r.name,tier_name:r.name,discount:r.type===n.PERCENTAGE?"".concat(salla.helpers.number(r.value),"%"):salla.money(r.value),icon:f.staticIcons[t]||f.staticIcons[0],threshold:r.min_spend,text_color:f.staticColors[t],index:t+1}}));return{current_tier:u.getTierNameByIndex(e,this.findCurrentTierIndex(r.details.current_value,e)),tiers:e}};r.prototype.findCurrentTierIndex=function(r,t){var e;if(t===void 0){t=(e=this.tieredOfferData)===null||e===void 0?void 0:e.tiers}return u.findCurrentTierIndex(r,t||[])};r.prototype.updateOfferValues=function(r,t){var e,i;if(!t||!this.tieredOfferData){return}if(!this.validateCouponCompatibility(t,r.coupon)){this.canRender=false;return}this.canRender=true;if(((e=t.details)===null||e===void 0?void 0:e.with_current_cart)===false){return}var n=((i=t.details)===null||i===void 0?void 0:i.current_value)||0;this.apiOfferData=t;var s=this.findCurrentTierIndex(n);if(s===0){this.canRender=false;return}this.canRender=true;this.currentTierIndex=s;this.currentTier=u.getTierNameByIndex(this.tieredOfferData.tiers,s);if(this.activeTabTier!==this.currentTier){this.activeTabTier=this.currentTier}};r.prototype.getLoadingSkeletonView=function(){return e(i,null,e("div",{class:"s-tiered-offer-container"},e("div",{class:"s-tiered-offer-skeleton-wrapper"},e("div",{class:"s-tiered-offer-skeleton-title"},e("salla-skeleton",{height:"16px",width:"40%"})),e("div",{class:"s-tiered-offer-skeleton-subtitle"},e("salla-skeleton",{height:"20px",width:"60%"})),e("div",{class:"s-tiered-offer-skeleton-progress"},e("salla-skeleton",{height:"16px",width:"100%"})),e("div",{class:"s-tiered-offer-skeleton-tabs"},e("salla-skeleton",{height:"50px",width:"100%"})))))};r.prototype.getCurrentTierData=function(){return u.findTierByIndex(this.tieredOfferData.tiers,this.currentTierIndex)||this.tieredOfferData.tiers[0]};r.prototype.getProgressWidth=function(){var r;var t=((r=this.apiOfferData.details)===null||r===void 0?void 0:r.current_value)||0;var e=this.tieredOfferData.tiers.length;var i=this.findCurrentTierIndex(t);var n=i;return n/e*100};r.prototype.calculateMilestonePosition=function(r,t){if(t===1){return"calc(100% - 18px)"}var e=(r+1)/t*100;var i=8/t;return"".concat(Math.max(2,Math.min(95,e-i)),"%")};r.prototype.getMilestoneStyles=function(r,t,e){var i;var n=document.documentElement.dir==="rtl";var s=this.calculateMilestonePosition(t,e);var o=r.name.length>6?"flex-end":"center";return i={},i[n?"right":"left"]=s,i.alignItems=o,i.position="absolute",i.transform=n?"translateX(50%)":"translateX(-50%)",i};r.prototype.getMilestoneIconStyles=function(r,t,e){if(t){return{color:r.text_color}}if(e){return{color:"var(--color-primary)"}}return{}};r.prototype.renderProgressBarBackground=function(r){return[e("div",{class:"s-tiered-offer-progress-bg"}),e("div",{class:"s-tiered-offer-progress-fill",style:{width:"".concat(r,"%")}})]};r.prototype.renderMilestoneIcon=function(r,t,i){var n=["s-tiered-offer-milestone-icon",t?"s-tiered-offer-milestone-active":"",i?"s-tiered-offer-milestone-completed":""].filter(Boolean).join(" ");return e("div",{class:n,style:this.getMilestoneIconStyles(r,t,i)},e("span",{innerHTML:r.icon}))};r.prototype.renderMilestoneName=function(r,t){return e("div",{class:"s-tiered-offer-milestone-name"},t&&e("span",{style:{color:r.text_color}},r.name))};r.prototype.renderMilestones=function(r,t){var i=this;var n=t===1?"s-tiered-offer-single-milestone-justify-end":"s-tiered-offer-milestones";return e("div",{class:"s-tiered-offer-milestones-wrapper"},e("div",{class:n},this.tieredOfferData.tiers.map((function(n,s){var o=r>=n.threshold;var a=n.tier_name===i.currentTier;return e("div",{class:"s-tiered-offer-milestone",style:i.getMilestoneStyles(n,s,t)},i.renderMilestoneIcon(n,a,o),i.renderMilestoneName(n,a))}))))};r.prototype.renderProgressBar=function(){var r;var t=this.getProgressWidth();var i=this.tieredOfferData.tiers.length;var n=((r=this.apiOfferData.details)===null||r===void 0?void 0:r.current_value)||0;return e("div",{class:"s-tiered-offer-progress-container"},e("div",{class:"s-tiered-offer-progress-wrapper"},this.renderProgressBarBackground(t),this.renderMilestones(n,i)))};r.prototype.renderTabs=function(){var r=this;return e("div",{class:"s-tiered-offer-tabs-container"},e("div",{class:"s-tiered-offer-tab-headers"},this.tieredOfferData.tiers.map((function(t){var i=t.tier_name===r.activeTabTier;return e("button",{class:"s-tiered-offer-tab-header ".concat(i?"s-tiered-offer-tab-active":""),onClick:function(){return r.handleTabClick(t.tier_name)}},e("span",null,t.name))}))),e("div",{class:"s-tiered-offer-tab-content-wrapper"},function(){var t=u.findTierByName(r.tieredOfferData.tiers,r.activeTabTier);if(!t)return null;return e("div",{class:"s-tiered-offer-tab-content"},e("div",{class:"s-tiered-offer-tab-content-inner"},e("div",{class:"s-tiered-offer-discount-section"},e("p",{class:"s-tiered-offer-discount-title"},r.discountText," ",e("span",{innerHTML:t.discount})),e("p",{class:"s-tiered-offer-benefit-description"},r.benefitText," ",t.name))))}()))};r.prototype.render=function(){if(this.isLoading){return this.getLoadingSkeletonView()}if(!this.canRender||!this.tieredOfferData){return null}var r=this.getCurrentTierData();return e(i,null,e("div",{class:"s-tiered-offer-container"},e("div",{class:"s-tiered-offer-header"},e("div",{class:"s-tiered-offer-header-content"},e("p",{class:"s-tiered-offer-program-title"},this.loyaltyProgramText),e("div",{class:"s-tiered-offer-current-tier-name-wrapper"},e("h2",{class:"s-tiered-offer-current-tier"},this.currentTierText," ",e("span",{class:"s-tiered-offer-tier-name"},r.name)),e("span",{innerHTML:r.icon})))),this.renderProgressBar(),this.renderTabs()))};return r}());d.style=c}}}));
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-B3l0Kfzh.system.js"],(function(r){"use strict";var t,e,i;return{setters:[function(r){t=r.r;e=r.h;i=r.H}],execute:function(){var n;(function(r){r["PERCENTAGE"]="percentage";r["FIXED"]="fixed"})(n||(n={}));var s='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M13.7276 3.44418L15.4874 6.99288C15.7274 7.48687 16.3673 7.9607 16.9073 8.05143L20.0969 8.58575C22.1367 8.92853 22.6167 10.4206 21.1468 11.8925L18.6671 14.3927C18.2471 14.8161 18.0172 15.6327 18.1471 16.2175L18.8571 19.3125C19.417 21.7623 18.1271 22.71 15.9774 21.4296L12.9877 19.6452C12.4478 19.3226 11.5579 19.3226 11.0079 19.6452L8.01827 21.4296C5.8785 22.71 4.57865 21.7522 5.13859 19.3125L5.84851 16.2175C5.97849 15.6327 5.74852 14.8161 5.32856 14.3927L2.84884 11.8925C1.389 10.4206 1.85895 8.92853 3.89872 8.58575L7.08837 8.05143C7.61831 7.9607 8.25824 7.48687 8.49821 6.99288L10.258 3.44418C11.2179 1.51861 12.7777 1.51861 13.7276 3.44418Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>';var o='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M3 12C7.5 12 12 7.5 12 3C12 7.5 16.5 12 21 12C16.5 12 12 16.5 12 21C12 16.5 7.5 12 3 12Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M2 19.5C2.83333 19.5 4.5 17.8333 4.5 17C4.5 17.8333 6.16667 19.5 7 19.5C6.16667 19.5 4.5 21.1667 4.5 22C4.5 21.1667 2.83333 19.5 2 19.5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M16 5C17 5 19 3 19 2C19 3 21 5 22 5C21 5 19 7 19 8C19 7 17 5 16 5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n</svg>';var a='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M14.2644 18.3717C14.5806 17.407 14.7387 16.9247 15.0616 16.593C15.215 16.4354 15.3932 16.3048 15.5887 16.2066C16.0003 16 16.5003 16 17.5002 16C18.5001 16 19.0001 16 19.4116 16.2066C19.6072 16.3048 19.7853 16.4354 19.9388 16.593C20.2617 16.9247 20.4198 17.407 20.736 18.3717L21.0624 19.3675C21.4561 20.5688 21.653 21.1694 21.3587 21.5847C21.0643 22 20.4418 22 19.1966 22H15.8038C14.5586 22 13.936 22 13.6417 21.5847C13.3473 21.1694 13.5442 20.5688 13.938 19.3675L14.2644 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M8.76421 10.3717C9.08041 9.40705 9.23851 8.92471 9.56143 8.59298C9.71485 8.43537 9.89299 8.3048 10.0885 8.20663C10.5001 8 11.0001 8 12 8C12.9999 8 13.4999 8 13.9115 8.20663C14.107 8.3048 14.2851 8.43537 14.4386 8.59298C14.7615 8.92471 14.9196 9.40705 15.2358 10.3717L15.5622 11.3675C15.956 12.5688 16.1528 13.1694 15.8585 13.5847C15.5642 14 14.9416 14 13.6964 14H10.3036C9.05842 14 8.43585 14 8.1415 13.5847C7.84716 13.1694 8.04404 12.5688 8.43779 11.3675L8.76421 10.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M3.26439 18.3717C3.58059 17.407 3.73869 16.9247 4.06162 16.593C4.21504 16.4354 4.39317 16.3048 4.58872 16.2066C5.00031 16 5.50027 16 6.50018 16C7.5001 16 8.00006 16 8.41165 16.2066C8.6072 16.3048 8.78533 16.4354 8.93875 16.593C9.26167 16.9247 9.41977 17.407 9.73597 18.3717L10.0624 19.3675C10.4561 20.5688 10.653 21.1694 10.3587 21.5847C10.0643 22 9.44176 22 8.19661 22H4.80375C3.5586 22 2.93603 22 2.64169 21.5847C2.34735 21.1694 2.54422 20.5688 2.93797 19.3675L3.26439 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M12 2V4M7.5 3.5L9 5M16.5 3.5L15 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>\n</svg>';var l='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M5.78223 4.18192C6.43007 3.68319 6.754 3.43383 7.12788 3.27323C7.29741 3.20041 7.47367 3.14158 7.65459 3.09741C8.0536 3 8.4767 3 9.32289 3H14.6771C15.5233 3 15.9464 3 16.3454 3.09741C16.5263 3.14158 16.7026 3.20041 16.8721 3.27323C17.246 3.43383 17.5699 3.68319 18.2178 4.18192C20.3644 5.83448 21.4378 6.66077 21.8057 7.73078C21.9694 8.20673 22.0305 8.70728 21.9858 9.20461C21.8852 10.3227 21.0379 11.346 19.3433 13.3925L15.3498 18.2153C13.8126 20.0718 13.044 21 12 21C10.956 21 10.1874 20.0718 8.65018 18.2153L4.65671 13.3925C2.96208 11.346 2.11476 10.3227 2.0142 9.20461C1.96947 8.70728 2.03064 8.20673 2.1943 7.73078C2.56224 6.66077 3.63557 5.83448 5.78223 4.18192Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M10 8.5H14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>';var f={staticIcons:[s,o,a,l],staticColors:["#993018","#444444","#D18F36","#315F9C"]};var u=function(){function r(){}r.findTierByIndex=function(r,t){return r.find((function(r){return r.index===t}))||null};r.findTierByName=function(r,t){return r.find((function(r){return r.tier_name===t}))||null};r.getTierNameByIndex=function(r,t){var e;return(e=this.findTierByIndex(r,t))===null||e===void 0?void 0:e.tier_name};r.findCurrentTierIndex=function(r,t){if(!t)return 0;for(var e=t.length-1;e>=0;e--){if(r>=t[e].threshold){return t[e].index}}return 0};return r}();var c=".s-tiered-offer-milestone-icon svg{color:currentColor}.s-tiered-offer-milestone-icon svg path{stroke:currentColor;fill:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg path{fill:currentColor;stroke:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg[fill=none] path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg[fill=none] path{fill:none;stroke:currentColor}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-bg{-webkit-transform:scaleX(-1);transform:scaleX(-1)}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-fill{-webkit-transform:scaleX(-1);transform:scaleX(-1);left:auto}[dir=rtl] .flip-x{-webkit-transform:scaleX(-1);transform:scaleX(-1)}";var d=r("salla_tiered_offer",function(){function r(r){var e=this;t(this,r);this.currentTierIndex=0;this.canRender=false;this.isLoading=false;this.handleTabClick=function(r){e.activeTabTier=r};salla.lang.onLoaded((function(){e.loyaltyProgramText=salla.lang.get("blocks.tiered_offer.program_title");e.currentTierText=salla.lang.get("blocks.tiered_offer.current_tier");e.discountText=salla.lang.get("blocks.tiered_offer.discount");e.benefitText=salla.lang.get("blocks.tiered_offer.tier_description")}))}r.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var r,t;return __generator(this,(function(e){switch(e.label){case 0:e.trys.push([0,3,4,5]);return[4,salla.onReady()];case 1:e.sent();if(!this.checkFeatureEnabled()){return[2]}if(!this.checkCartExists()){return[2]}this.isLoading=true;return[4,this.fetchTieredOfferData()];case 2:r=e.sent();if(!r){return[2]}this.initializeComponent(r);return[3,5];case 3:t=e.sent();this.canRender=false;salla.logger.warn("salla-tiered-offer:: ",t);return[3,5];case 4:this.isLoading=false;return[7];case 5:return[2]}}))}))};r.prototype.checkFeatureEnabled=function(){var r;return(r=salla.config.get("store.features"))===null||r===void 0?void 0:r.includes("tiered-offer")};r.prototype.checkCartExists=function(){var r,t;return!!((t=(r=salla.storage.get("cart"))===null||r===void 0?void 0:r.summary)===null||t===void 0?void 0:t.count)};r.prototype.validateCouponCompatibility=function(r,t){var e;return!(t&&!((e=r.details)===null||e===void 0?void 0:e.applied_with_coupon))};r.prototype.fetchTieredOfferData=function(){return __awaiter(this,void 0,void 0,(function(){var r,t,e,i;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,salla.api.cart.offers()];case 1:t=n.sent().data;e=t.find((function(r){return r.type==="tiered_offer"}));if(!e){return[2,null]}if(!this.validateCouponCompatibility(e,(r=salla.storage.get("cart"))===null||r===void 0?void 0:r.coupon)){this.canRender=false;return[2,null]}return[2,e];case 2:i=n.sent();throw i;case 3:return[2]}}))}))};r.prototype.initializeComponent=function(r){var t;this.apiOfferData=r;this.tieredOfferData=this.mapApiDataToTiers(this.apiOfferData);this.loyaltyProgramText=this.apiOfferData.title||this.loyaltyProgramText;var e=((t=this.apiOfferData.details)===null||t===void 0?void 0:t.current_value)||0;var i=this.findCurrentTierIndex(e);if(i===0){this.canRender=false;return}this.currentTierIndex=i;this.currentTier=u.getTierNameByIndex(this.tieredOfferData.tiers,i);this.activeTabTier=this.currentTier;this.canRender=true};r.prototype.componentDidLoad=function(){var r=this;salla.event.on("cart::updated",(function(t){return __awaiter(r,void 0,void 0,(function(){var r;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.fetchTieredOfferData()];case 1:r=e.sent();if(r){this.updateOfferValues(t,r)}return[2]}}))}))}))};r.prototype.mapApiDataToTiers=function(r){var t=__spreadArray([],r.details.discounts,true).sort((function(r,t){return r.min_spend-t.min_spend}));var e=t.map((function(r,t){return{name:r.name,tier_name:r.name,discount:r.type===n.PERCENTAGE?"".concat(salla.helpers.number(r.value),"%"):salla.money(r.value),icon:f.staticIcons[t]||f.staticIcons[0],threshold:r.min_spend,text_color:f.staticColors[t],index:t+1}}));return{current_tier:u.getTierNameByIndex(e,this.findCurrentTierIndex(r.details.current_value,e)),tiers:e}};r.prototype.findCurrentTierIndex=function(r,t){var e;if(t===void 0){t=(e=this.tieredOfferData)===null||e===void 0?void 0:e.tiers}return u.findCurrentTierIndex(r,t||[])};r.prototype.updateOfferValues=function(r,t){var e,i;if(!t||!this.tieredOfferData){return}if(!this.validateCouponCompatibility(t,r.coupon)){this.canRender=false;return}this.canRender=true;if(((e=t.details)===null||e===void 0?void 0:e.with_current_cart)===false){return}var n=((i=t.details)===null||i===void 0?void 0:i.current_value)||0;this.apiOfferData=t;var s=this.findCurrentTierIndex(n);if(s===0){this.canRender=false;return}this.canRender=true;this.currentTierIndex=s;this.currentTier=u.getTierNameByIndex(this.tieredOfferData.tiers,s);if(this.activeTabTier!==this.currentTier){this.activeTabTier=this.currentTier}};r.prototype.getLoadingSkeletonView=function(){return e(i,null,e("div",{class:"s-tiered-offer-container"},e("div",{class:"s-tiered-offer-skeleton-wrapper"},e("div",{class:"s-tiered-offer-skeleton-title"},e("salla-skeleton",{height:"16px",width:"40%"})),e("div",{class:"s-tiered-offer-skeleton-subtitle"},e("salla-skeleton",{height:"20px",width:"60%"})),e("div",{class:"s-tiered-offer-skeleton-progress"},e("salla-skeleton",{height:"16px",width:"100%"})),e("div",{class:"s-tiered-offer-skeleton-tabs"},e("salla-skeleton",{height:"50px",width:"100%"})))))};r.prototype.getCurrentTierData=function(){return u.findTierByIndex(this.tieredOfferData.tiers,this.currentTierIndex)||this.tieredOfferData.tiers[0]};r.prototype.getProgressWidth=function(){var r;var t=((r=this.apiOfferData.details)===null||r===void 0?void 0:r.current_value)||0;var e=this.tieredOfferData.tiers.length;var i=this.findCurrentTierIndex(t);var n=i;return n/e*100};r.prototype.calculateMilestonePosition=function(r,t){if(t===1){return"calc(100% - 18px)"}var e=(r+1)/t*100;var i=8/t;return"".concat(Math.max(2,Math.min(95,e-i)),"%")};r.prototype.getMilestoneStyles=function(r,t,e){var i;var n=document.documentElement.dir==="rtl";var s=this.calculateMilestonePosition(t,e);var o=r.name.length>6?"flex-end":"center";return i={},i[n?"right":"left"]=s,i.alignItems=o,i.position="absolute",i.transform=n?"translateX(50%)":"translateX(-50%)",i};r.prototype.getMilestoneIconStyles=function(r,t,e){if(t){return{color:r.text_color}}if(e){return{color:"var(--color-primary)"}}return{}};r.prototype.renderProgressBarBackground=function(r){return[e("div",{class:"s-tiered-offer-progress-bg"}),e("div",{class:"s-tiered-offer-progress-fill",style:{width:"".concat(r,"%")}})]};r.prototype.renderMilestoneIcon=function(r,t,i){var n=["s-tiered-offer-milestone-icon",t?"s-tiered-offer-milestone-active":"",i?"s-tiered-offer-milestone-completed":""].filter(Boolean).join(" ");return e("div",{class:n,style:this.getMilestoneIconStyles(r,t,i)},e("span",{innerHTML:r.icon}))};r.prototype.renderMilestoneName=function(r,t){return e("div",{class:"s-tiered-offer-milestone-name"},t&&e("span",{style:{color:r.text_color}},r.name))};r.prototype.renderMilestones=function(r,t){var i=this;var n=t===1?"s-tiered-offer-single-milestone-justify-end":"s-tiered-offer-milestones";return e("div",{class:"s-tiered-offer-milestones-wrapper"},e("div",{class:n},this.tieredOfferData.tiers.map((function(n,s){var o=r>=n.threshold;var a=n.tier_name===i.currentTier;return e("div",{class:"s-tiered-offer-milestone",style:i.getMilestoneStyles(n,s,t)},i.renderMilestoneIcon(n,a,o),i.renderMilestoneName(n,a))}))))};r.prototype.renderProgressBar=function(){var r;var t=this.getProgressWidth();var i=this.tieredOfferData.tiers.length;var n=((r=this.apiOfferData.details)===null||r===void 0?void 0:r.current_value)||0;return e("div",{class:"s-tiered-offer-progress-container"},e("div",{class:"s-tiered-offer-progress-wrapper"},this.renderProgressBarBackground(t),this.renderMilestones(n,i)))};r.prototype.renderTabs=function(){var r=this;return e("div",{class:"s-tiered-offer-tabs-container"},e("div",{class:"s-tiered-offer-tab-headers"},this.tieredOfferData.tiers.map((function(t){var i=t.tier_name===r.activeTabTier;return e("button",{class:"s-tiered-offer-tab-header ".concat(i?"s-tiered-offer-tab-active":""),onClick:function(){return r.handleTabClick(t.tier_name)}},e("span",null,t.name))}))),e("div",{class:"s-tiered-offer-tab-content-wrapper"},function(){var t=u.findTierByName(r.tieredOfferData.tiers,r.activeTabTier);if(!t)return null;return e("div",{class:"s-tiered-offer-tab-content"},e("div",{class:"s-tiered-offer-tab-content-inner"},e("div",{class:"s-tiered-offer-discount-section"},e("p",{class:"s-tiered-offer-discount-title"},r.discountText," ",e("span",{innerHTML:t.discount})),e("p",{class:"s-tiered-offer-benefit-description"},r.benefitText," ",t.name))))}()))};r.prototype.render=function(){if(this.isLoading){return this.getLoadingSkeletonView()}if(!this.canRender||!this.tieredOfferData){return null}var r=this.getCurrentTierData();return e(i,null,e("div",{class:"s-tiered-offer-container"},e("div",{class:"s-tiered-offer-header"},e("div",{class:"s-tiered-offer-header-content"},e("p",{class:"s-tiered-offer-program-title"},this.loyaltyProgramText),e("div",{class:"s-tiered-offer-current-tier-name-wrapper"},e("h2",{class:"s-tiered-offer-current-tier"},this.currentTierText," ",e("span",{class:"s-tiered-offer-tier-name"},r.name)),e("span",{innerHTML:r.icon})))),this.renderProgressBar(),this.renderTabs()))};return r}());d.style=c}}}));
|
|
5
|
+
//# sourceMappingURL=p-075582a1.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as a,H as t,g as l}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as s,h as a,H as t,g as l}from"./p-wQf8KFfR.js";const r=":host{display:block}";const i=class{constructor(a){s(this,a);var t;this.apps=salla.config.get("store.apps");this.appSlot=((t=this.host.querySelector('[slot="app"]'))===null||t===void 0?void 0:t.innerHTML)||`<img alt={name} src={icon} />`;salla.onReady((()=>{this.apps=salla.config.get("store.apps")}));salla.lang.onLoaded((()=>{this.appsTitle=salla.lang.get("blocks.footer.download_apps")}))}getAppsArray(){return Object.entries(this.apps).map((([s,a])=>({name:s,value:a})))}componentWillLoad(){return new Promise((s=>salla.onReady(s)))}render(){const s=this.getAppsArray();if(Array.isArray(s)&&!s.length){return}return a(t,{class:"s-apps-icons"},!this.hideTitle&&a("h3",null,this.appsTitle),a("div",{class:{"s-apps-icons-list":true,vertical:this.vertical}},s.map(((s,t)=>a("a",{key:t,href:s.value,rel:"noreferrer",target:"_blank",class:"s-apps-icons-item",id:"app-slot",innerHTML:this.appSlot.replace(/\{icon\}/g,salla.url.cdn(`images/${s.name}.png`)).replace(/\{name\}/g,s.name)})))))}componentDidRender(){var s;(s=this.host.querySelector('[slot="app"]'))===null||s===void 0?void 0:s.remove()}get host(){return l(this)}};i.style=r;export{i as salla_apps_icons};
|
|
5
|
+
//# sourceMappingURL=p-094e1bfb.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,r,n,i){function e(t){return t instanceof n?t:new n((function(r){r(t)}))}return new(n||(n=Promise))((function(n,a){function s(t){try{u(i.next(t))}catch(t){a(t)}}function o(t){try{u(i["throw"](t))}catch(t){a(t)}}function u(t){t.done?n(t.value):e(t.value).then(s,o)}u((i=i.apply(t,r||[])).next())}))};var __generator=this&&this.__generator||function(t,r){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,e,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(r){return u([t,r])}}function u(o){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(n=0)),n)try{if(i=1,e&&(a=o[0]&2?e["return"]:o[0]?e["throw"]||((a=e["return"])&&a.call(e),0):e.next)&&!(a=a.call(e,o[1])).done)return a;if(e=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;e=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1];a=o;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(o);break}if(a[2])n.ops.pop();n.trys.pop();continue}o=r.call(t,n)}catch(t){o=[6,t];e=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
|
-
*/System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-B3l0Kfzh.system.js","./p-Bnro4LR3.system.js","./p-CzwwMHuN.system.js","./p-CLqFzsVe.system.js"],(function(t){"use strict";var r,n,i,e,a,s,o;return{setters:[function(t){r=t.r;n=t.c;i=t.h;e=t.H;a=t.g},function(t){s=t.F},function(t){o=t.H},null],execute:function(){var u=":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}";var f=t("salla_filters",function(){function t(t){var i=this;r(this,t);this.changed=n(this,"changed");this.isReady=false;this.filtersData={};salla.event.on("filters::hidden",(function(){return i.host.style.display="none"}));salla.lang.onLoaded((function(){i.apply=salla.lang.get("pages.checkout.apply");i.reset=salla.lang.get("pages.categories.filters_reset")}));salla.event.on("filters::fetched",(function(t){var r=t.filters;i.host.style.display="";var n={};i.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=s.VALUES;var r=t.values,e=r.max,a=r.min;t.values=[5,4,3,2,1].filter((function(t){return t>=a||t<=e}))}if(i.filtersData.variants&&t.type==s.VARIANTS){n.variants=i.filtersData.variants}if(i.filtersData[t.key]&&t.type!==s.VARIANTS){n[t.key]=i.filtersData[t.key]}var o=new URLSearchParams(window.location.search);var u=false;for(var f=0,c=o.keys();f<c.length;f++){var l=c[f];if(l.includes("filters")){u=true;break}}if(salla.config.get("page.slug")=="product.index"&&Object.keys(n).length==0&&!u){var h=window.location.href;var v=salla.config.get("page.id");var d=h.indexOf("?")!==-1?"&":"?";var w=h+d+"filters[category_id]="+v;n.category_id=v;window.history.pushState({path:w},"",w)}return t}));i.filtersData=n;i.host.childNodes.forEach((function(t){return __awaiter(i,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:r=t.setWidgetHeight;if(!r)return[3,2];return[4,t.setWidgetHeight()];case 1:r=n.sent();n.label=2;case 2:return[2,r]}}))}))}))}))}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,r,n;return __generator(this,(function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);t=new URLSearchParams(window.location.search);r=this;return[4,o.extractFiltersFromUrl(t)];case 1:r.filtersData=i.sent();return[3,3];case 2:n=i.sent();console.warn("failed to get filters from URL",n.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 r=this;return __generator(this,(function(n){if(!this.isReady){return[2]}t=Object.keys(this.filtersData).length>0;setTimeout((function(){var n;if(t){var i=new URL(window.location.href);for(var e=0,a=i.searchParams.entries();e<a.length;e++){var s=a[e][0];if(s.startsWith("filters")){i.searchParams.delete(s)}}var o=r.encodeFilters(r.filtersData);var u=i.search.split("&").filter((function(t){return!t.includes("filters")})).join("&");if(u){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);(n=i.searchParams)===null||n===void 0?void 0:n.delete("filters");window.history.pushState({},"",i.toString())}salla.event.emit("salla-filters::changed",r.filtersData);r.changed.emit(r.filtersData)}),300);return[2]}))}))};t.prototype.encodeFilters=function(t,r){if(r===void 0){r="filters"}var n=[];for(var i in t){if(Object.prototype.hasOwnProperty.call(t,i)){var e=t[i];var a=r?"".concat(r,"[").concat(i,"]"):i;if(Array.isArray(e)){for(var s=0;s<e.length;s++){n.push("".concat(a,"[").concat(s,"]=").concat(e[s]))}}else if(typeof e==="object"&&e!==null){n.push(this.encodeFilters(e,a))}else{var o="".concat(a,"=").concat(e);n.push(o)}}}return n.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 r=Array.from(t.keys()).filter((function(t){return!t.startsWith("filters[")})).map((function(r){return"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(t.get(r)))})).join("&");var n=r?"".concat(window.location.pathname,"?").concat(r):window.location.pathname;window.history.pushState({},"",n)};t.prototype.handleOptionChange=function(t,r,n){if(r.type===s.RANGE){this.filtersData[r.key]=n}var i=t.target.checked;if(r.type===s.VARIANTS){this.filtersData.variants=this.filtersData.variants||{};i&&(this.filtersData.variants[r.key]=n);i||delete this.filtersData.variants[r.key]}else if(t.target.type=="radio"){i&&(this.filtersData[r.key]=n);i||delete this.filtersData[r.key]}else if(t.target.type=="checkbox"){this.filtersData[r.key]=this.filtersData[r.key]||[];if(i){this.filtersData[r.key].push(n)}this.filtersData[r.key]=this.filtersData[r.key].filter((function(t){return t!=n}))}this.applyFilters()};t.prototype.render=function(){var t=this;var r,n;return i(e,{key:"54a625522588215230f1eb5a3ca94b8280b18040"},(r=this.filters)===null||r===void 0?void 0:r.map((function(r){return i("salla-filters-widget",{option:r,filtersData:t.filtersData,onChanged:function(r){var n=r.detail,i=n.event,e=n.option,a=n.value;t.handleOptionChange(i,e,a)}})})),((n=this.filters)===null||n===void 0?void 0:n.length)?i("div",{class:"s-filters-footer"},i("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 a(this)},enumerable:false,configurable:true});return t}());f.style=u}}}));
|
|
5
|
+
//# sourceMappingURL=p-0e9ab63f.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as t,H as a,g as i}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as s,h as t,H as a,g as i}from"./p-wQf8KFfR.js";const e=":host{display:block}";const l=class{constructor(t){s(this,t);this.exclude=[]}componentWillLoad(){return salla.onReady().then((()=>{var s,t,a;if(typeof this.exclude==="string"){try{this.exclude=JSON.parse(this.exclude)}catch(s){salla.logger.error("salla-payments:: failed to parse the exclude props!",this.exclude);this.exclude=[]}}this.placeholderImage=salla.url.cdn(`images/s-empty.png`);this.paymentSlot=((s=this.host.querySelector('[slot="payment"]'))===null||s===void 0?void 0:s.innerHTML)||`<li class="s-payments-list-item"><img class="lazy" width="100%" height="100%" src="${this.placeholderImage}" data-src="{image}" alt={payment} /><li>`;this.sbcSlot=((t=this.host.querySelector('[slot="sbc"]'))===null||t===void 0?void 0:t.innerHTML)||`<li class="s-payments-list-item"><a target="_blank" href="{link}"> <img width="100%" height="100%" src="${this.placeholderImage}" data-src={image} class="lazy s-payments-sbc-image" alt="SBC"/></a><li>`;this.codSlot=((a=this.host.querySelector('[slot="cod"]'))===null||a===void 0?void 0:a.innerHTML)||`<li class="s-payments-list-item"> <img width="100%" height="100%" src="${this.placeholderImage}" data-src={image} class="lazy" alt="COD"/><li>`;this.payments=salla.config.get("store.settings.payments")}))}render(){const s=!this.exclude.includes("made-in-ksa")&&salla.config.get("store.settings.made_in_ksa");const i=this.exclude.includes("sbc")?null:salla.config.get("store.settings.certificate.id");return t(a,{key:"a1a26ba03aa60491071f0e63bac40de3ad91bce6",class:"s-payments-list-wrap"},t("ul",{key:"d31ca162e83aade956f45d8f517029942a748646",class:"s-payments-list"},s&&t("li",{key:"552e3e57345d01ab33bfd20094cbcf8f702c6efa",class:"s-payments-list-item"},t("img",{key:"04eb9c9a1950edc9ea3c2e218fbe6c5c21d65f6a",class:"lazy",width:"100%",height:"100%",decoding:"async",loading:"lazy","data-src":salla.url.cdn(`images/made-in-ksa.svg`,58,58),alt:"made in KSA certified"})),this.payments.map((s=>s=="cod"?t("div",{id:"cod-slot",innerHTML:this.codSlot.replace(/\{image\}/g,salla.url.cdn(`images/payment/cod_mini.png`,58,58))}):t("div",{id:"payment-slot",innerHTML:this.paymentSlot.replace(/\{image\}/g,salla.url.cdn(`images/payment/${s}_mini.png`,58,58)).replace(/\{payment\}/g,s)}))),i&&t("div",{key:"5f69b3c936edf8039006d6ecd73e3c44b74b9167",id:"sbc-slot",innerHTML:this.sbcSlot.replace(/\{image\}/g,salla.url.cdn(`images/sbc.png`,58,58)).replace(/\{link\}/g,`https://eauthenticate.saudibusiness.gov.sa/certificate-details/${i}`)})))}componentDidLoad(){var s;(s=document.lazyLoadInstance)===null||s===void 0?void 0:s.update(this.host.querySelectorAll(".lazy"));this.host.querySelectorAll(".lazy").forEach((s=>{s.addEventListener("load",(()=>{s.setAttribute("width","100%");s.setAttribute("height","100%")}))}))}componentDidRender(){var s,t,a;this.host.querySelectorAll("#payment-slot").forEach((s=>s.replaceWith(s.firstChild)));this.host.querySelectorAll("#sbc-slot").forEach((s=>s.replaceWith(s.firstChild)));this.host.querySelectorAll("#cod-slot").forEach((s=>s.replaceWith(s.firstChild)));(s=this.host.querySelector('[slot="payment"]'))===null||s===void 0?void 0:s.remove();(t=this.host.querySelector('[slot="sbc"]'))===null||t===void 0?void 0:t.remove();(a=this.host.querySelector('[slot="cod"]'))===null||a===void 0?void 0:a.remove()}get host(){return i(this)}};l.style=e;export{l as salla_payments};
|
|
5
|
+
//# sourceMappingURL=p-14bc7704.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
System.register(["./p-B3l0Kfzh.system.js"],(function(i){"use strict";var s,t,r;return{setters:[function(i){s=i.r;t=i.h;r=i.H}],execute:function(){var l="";var n=i("salla_order_details_multiple_bundle_product",function(){function i(i){s(this,i);this.placeholderImage=salla.url.cdn("images/s-empty.png")}i.prototype.getProductImage=function(){var i;if(!((i=this.productDetails)===null||i===void 0?void 0:i.image)){return this.placeholderImage}if(typeof this.productDetails.image==="string"){return this.productDetails.image}return this.productDetails.image.url||this.placeholderImage||salla.url.cdn("images/s-empty.png")};i.prototype.getProductImageAlt=function(){var i,s,t;if(!((i=this.productDetails)===null||i===void 0?void 0:i.image)||typeof this.productDetails.image==="string"){return((s=this.productDetails)===null||s===void 0?void 0:s.name)||""}return this.productDetails.image.alt||((t=this.productDetails)===null||t===void 0?void 0:t.name)||""};i.prototype.getAccordionId=function(){var i;return"accordion-".concat(((i=this.productDetails)===null||i===void 0?void 0:i.id)||"default")};i.prototype.getAccordionKey=function(){var i;return((i=this.productDetails)===null||i===void 0?void 0:i.id)||"default"};i.prototype.shouldBeCollapsible=function(){var i,s;if(this.collapsible!==undefined){return this.collapsible}return((s=(i=this.productDetails)===null||i===void 0?void 0:i.options)===null||s===void 0?void 0:s.length)>0};i.prototype.renderProductPrice=function(){if(!this.productDetails){return null}var i=this.productDetails,s=i.is_on_sale,r=i.sale_price,l=i.regular_price,n=i.price;if(s&&r){return t("div",null,t("span",{class:"s-order-details-product-price s-order-details-product-price-sale"},t("span",{innerHTML:salla.money(r)})),l&&t("span",{class:"s-order-details-product-regular-price"},t("span",{innerHTML:salla.money(l)})))}return t("span",{class:"s-order-details-product-price"},t("span",{innerHTML:salla.money(n)}))};i.prototype.renderOptions=function(){var i,s;if(!((s=(i=this.productDetails)===null||i===void 0?void 0:i.options)===null||s===void 0?void 0:s.length)){return null}return t("salla-accordion-body",null,t("div",{class:"s-order-details-options"},t("salla-order-details-options",{options:this.productDetails.options})))};i.prototype.render=function(){var i,s,l;if(!this.productDetails){return null}var n=this.shouldBeCollapsible();return t(r,{class:"s-order-details-bundle-wrapper"},t("salla-accordion",{key:this.getAccordionKey(),collapsed:false,bordered:true,collapsible:n,id:this.getAccordionId(),size:"sm"},t("salla-accordion-head",null,t("div",{class:"s-order-details-product"},t("div",{class:"s-order-details-product-content"},t("div",{class:"s-order-details-product-info"},t("div",{class:"s-order-details-product-image"},t("img",{src:this.getProductImage(),alt:this.getProductImageAlt()})),t("div",{class:"s-order-details-product-details"},t("a",{href:((i=this.productDetails)===null||i===void 0?void 0:i.url)||"#",class:"s-order-details-product-name"},((s=this.productDetails)===null||s===void 0?void 0:s.name)||""),this.renderProductPrice(),((l=this.productDetails)===null||l===void 0?void 0:l.quantity)&&t("span",{class:"s-order-details-product-quantity"},"×",this.productDetails.quantity)))))),this.renderOptions()))};return i}());n.style=l}}}));
|
|
5
|
+
//# sourceMappingURL=p-187f0de5.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as t,H as e,g as a,c as o}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as s,h as t,H as e,g as a,c as o}from"./p-wQf8KFfR.js";import{p as i,m as r}from"./p-DfeagqF1.js";const c="";const l=class{constructor(t){s(this,t);this.collapsible=true;this.bordered=false;this.size="md";this.collapsed=true;this.dir=document.dir||"rtl"}directionChangedHandler(s){this.dir=s.detail.dir}handleCollapse(s){this.collapsed=s.detail.payload.collapsed}setcollapsibleProp(){const s=this.host.querySelector("salla-accordion-head");if(this.collapsible&&s){s.setAttribute("collapsible","true");s.setAttribute("collapsed",this.collapsed.toString())}}componentDidRender(){this.setcollapsibleProp();const s=this.host.querySelector("salla-accordion-body");if(this.collapsible){this.host.setAttribute("data-collapsed",this.collapsed.toString());s===null||s===void 0?void 0:s.setAttribute("data-collapsed",this.collapsed.toString())}}render(){return t(e,{key:"ed8e4c0f24fa4462654e94fa46706e892c141351",class:`s-accordion-wrapper ${this.dir} ${this.bordered?"s-accordion-wrapper-bordered":""} ${this.size?`size-${this.size}`:""}`,"data-collapsed":this.collapsed.toString()},t("slot",{key:"1dbda01c073f3018a55ebcf5d8613a82a5dc6b27"}))}get host(){return a(this)}};l.style=c;const d="";const n=class{constructor(t){s(this,t)}render(){return t(e,{key:"298d42a5bf1bcefdb181ec35060220cf749b56ed",class:"s-accordion-body-wrapper"},t("slot",{key:"6ab081e8b71b5dc69fb66fbdec82b4725ab53b0d"}))}};n.style=d;const h="";const p=class{constructor(t){s(this,t);this.accordionToggle=o(this,"accordionToggle");this.collapsible=false;this.collapsed=true}emitCollapsePanel(){this.accordionToggle.emit({payload:{collapsed:this.collapsed}})}toggleCollapse(){var s,t,e;if(!this.collapsible)return;this.collapsed=!this.collapsed;(s=this.host.parentElement)===null||s===void 0?void 0:s.setAttribute("data-collapsed",this.collapsed.toString());(e=(t=this.host.parentElement)===null||t===void 0?void 0:t.querySelector("salla-accordion-body"))===null||e===void 0?void 0:e.setAttribute("data-collapsed",this.collapsed.toString());this.emitCollapsePanel()}render(){return t(e,{key:"9bb7ad4ad615f5316968b48839b2433619bd3850","data-collapsed":this.collapsed.toString(),onClick:()=>this.toggleCollapse(),class:"s-accordion-head-wrapper"},t("div",{key:"6826492e1c552440d6407435dfe4e0ca3915cdf4",class:"s-accordion-head-wrapper-start"},t("slot",{key:"2c19c500b57444ac8f69c2f64616904a819f54da",name:"title"}),t("slot",{key:"a6ed0daccd969ec94128f5f749ccddfa9f62e5d3",name:"subtitle"}),t("slot",{key:"adc2122dce76eee34653bc3f47324188c89d80f1",name:"html"})),(this.collapsible||this.host.querySelector('[slot="note"]'))&&t("div",{key:"f61363b6836fb857a0e832de99175936ec4bce29",class:"s-accordion-head-wrapper-end"},t("slot",{key:"15ee81e943714b30bfbaf718364f5d34b14617eb",name:"note"}),this.collapsible&&t("button",{key:"c5f8d32af544ddfba7b2fc2f273ae5b2e8cb7ae5",class:{"s-accordion-head-wrapper-toggle":true,active:!this.collapsed},onClick:s=>{s.stopPropagation();this.toggleCollapse()}},t("span",{key:"4c4e3fa6ddeda1a59f65ba47665a9203356037a6",class:"s-accordion-head-wrapper-toggle-icon",innerHTML:this.collapsed?i:r}))))}get host(){return a(this)}};p.style=h;var f=`\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>swap-fill</title>\n<path d="M28 10.667h-2.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h2.667c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333v-2.667c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v2.667c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4v-13.333c0-2.205-1.795-4-4-4zM21.333 17.333v-13.333c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4zM2.667 17.333v-13.333c0-0.736 0.599-1.333 1.333-1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333z"></path>\n</svg>\n`;const b="";const u=class{constructor(t){s(this,t);this.bordered=true;this.placeholderImage="images/placeholder.png";this.optionsData=[]}componentWillLoad(){this.parseOptionsData()}componentWillUpdate(){this.parseOptionsData()}parseOptionsData(){if(!this.options){this.optionsData=[];return}if(typeof this.options==="string"){try{this.optionsData=JSON.parse(this.options)}catch(s){this.optionsData=[]}}else{this.optionsData=Array.isArray(this.options)?this.options:[]}}renderOptionValue(s){if(s.is_image){return t("div",{class:"s-order-details-option-image-container"},t("a",{href:s.value,target:"_blank"},t("img",{class:"s-order-details-option-image",src:s.value||this.placeholderImage,alt:s.name})))}if(s.color){return t("span",{title:s.value,class:"s-order-details-option-color-swatch",style:{backgroundColor:s.color}})}if(s.is_file){return t("a",{href:s.value,target:"_blank",class:"s-order-details-option-file-link"},"Attachments")}if(s.is_color_picker){return t("div",{class:"s-order-details-option-color-picker"},t("div",{class:"s-order-details-option-color-picker-content"},t("span",{class:"s-order-details-option-color-picker-text"},s.value),t("span",{class:"s-order-details-option-color-picker-swatch",style:{backgroundColor:s.value,width:"1rem"}})),t("salla-button",{onClick:t=>this.copyToClipboard(t,s.value),shape:"link",class:"s-order-details-option-color-picker-button"},t("span",{class:"s-order-details-option-color-copy-icon",innerHTML:f})))}if(s.is_map&&s.latitude&&s.longitude){return t("salla-map",{id:`location_map_${s.id}`,class:`map_${s.id}`,zoom:15,readonly:true,lat:s.latitude,lng:s.longitude},t("div",{slot:"button"},t("button",{type:"button",class:"s-order-details-option-map-button",onClick:()=>this.openMap(s.id)},"Show Location")))}return t("span",{class:"s-order-details-option-default-text"},s.display_value||s.value)}copyToClipboard(s,t){s.preventDefault();if(navigator.clipboard){navigator.clipboard.writeText(t)}}openMap(s){const t=document.querySelector(`salla-map.map_${s}`);if(t&&t.open){t.open()}}render(){if(!this.optionsData.length){return null}const s=this.bordered?"s-order-details-options-container":"s-order-details-options-container-borderless";return t(e,{class:"s-order-details-options-wrapper"},t("h2",{class:"s-order-details-options-title"},salla.lang.get("pages.cart.item_options")),t("div",{class:s},t("dl",{class:"s-order-details-options-list"},this.optionsData.map((s=>t("div",{key:s.id,class:"s-order-details-options-item"},t("dt",{class:"s-order-details-options-item-name"},s.name,":"),t("dd",{class:s.is_image?"s-order-details-options-item-value-image":"s-order-details-options-item-value-text"},this.renderOptionValue(s))))))))}};u.style=b;export{l as salla_accordion,n as salla_accordion_body,p as salla_accordion_head,u as salla_order_details_options};
|
|
5
|
+
//# sourceMappingURL=p-18a1f403.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
System.register(["./p-B3l0Kfzh.system.js","./p-C2rVu_Jb.system.js"],(function(t){"use strict";var s,e,i,a,o,n,r;return{setters:[function(t){s=t.r;e=t.h;i=t.H;a=t.g;o=t.c},function(t){n=t.p;r=t.m}],execute:function(){var c="";var l=t("salla_accordion",function(){function t(t){s(this,t);this.collapsible=true;this.bordered=false;this.size="md";this.collapsed=true;this.dir=document.dir||"rtl"}t.prototype.directionChangedHandler=function(t){this.dir=t.detail.dir};t.prototype.handleCollapse=function(t){this.collapsed=t.detail.payload.collapsed};t.prototype.setcollapsibleProp=function(){var t=this.host.querySelector("salla-accordion-head");if(this.collapsible&&t){t.setAttribute("collapsible","true");t.setAttribute("collapsed",this.collapsed.toString())}};t.prototype.componentDidRender=function(){this.setcollapsibleProp();var t=this.host.querySelector("salla-accordion-body");if(this.collapsible){this.host.setAttribute("data-collapsed",this.collapsed.toString());t===null||t===void 0?void 0:t.setAttribute("data-collapsed",this.collapsed.toString())}};t.prototype.render=function(){return e(i,{key:"ed8e4c0f24fa4462654e94fa46706e892c141351",class:"s-accordion-wrapper ".concat(this.dir," ").concat(this.bordered?"s-accordion-wrapper-bordered":""," ").concat(this.size?"size-".concat(this.size):""),"data-collapsed":this.collapsed.toString()},e("slot",{key:"1dbda01c073f3018a55ebcf5d8613a82a5dc6b27"}))};Object.defineProperty(t.prototype,"host",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());l.style=c;var d="";var h=t("salla_accordion_body",function(){function t(t){s(this,t)}t.prototype.render=function(){return e(i,{key:"298d42a5bf1bcefdb181ec35060220cf749b56ed",class:"s-accordion-body-wrapper"},e("slot",{key:"6ab081e8b71b5dc69fb66fbdec82b4725ab53b0d"}))};return t}());h.style=d;var f="";var u=t("salla_accordion_head",function(){function t(t){s(this,t);this.accordionToggle=o(this,"accordionToggle");this.collapsible=false;this.collapsed=true}t.prototype.emitCollapsePanel=function(){this.accordionToggle.emit({payload:{collapsed:this.collapsed}})};t.prototype.toggleCollapse=function(){var t,s,e;if(!this.collapsible)return;this.collapsed=!this.collapsed;(t=this.host.parentElement)===null||t===void 0?void 0:t.setAttribute("data-collapsed",this.collapsed.toString());(e=(s=this.host.parentElement)===null||s===void 0?void 0:s.querySelector("salla-accordion-body"))===null||e===void 0?void 0:e.setAttribute("data-collapsed",this.collapsed.toString());this.emitCollapsePanel()};t.prototype.render=function(){var t=this;return e(i,{key:"9bb7ad4ad615f5316968b48839b2433619bd3850","data-collapsed":this.collapsed.toString(),onClick:function(){return t.toggleCollapse()},class:"s-accordion-head-wrapper"},e("div",{key:"6826492e1c552440d6407435dfe4e0ca3915cdf4",class:"s-accordion-head-wrapper-start"},e("slot",{key:"2c19c500b57444ac8f69c2f64616904a819f54da",name:"title"}),e("slot",{key:"a6ed0daccd969ec94128f5f749ccddfa9f62e5d3",name:"subtitle"}),e("slot",{key:"adc2122dce76eee34653bc3f47324188c89d80f1",name:"html"})),(this.collapsible||this.host.querySelector('[slot="note"]'))&&e("div",{key:"f61363b6836fb857a0e832de99175936ec4bce29",class:"s-accordion-head-wrapper-end"},e("slot",{key:"15ee81e943714b30bfbaf718364f5d34b14617eb",name:"note"}),this.collapsible&&e("button",{key:"c5f8d32af544ddfba7b2fc2f273ae5b2e8cb7ae5",class:{"s-accordion-head-wrapper-toggle":true,active:!this.collapsed},onClick:function(s){s.stopPropagation();t.toggleCollapse()}},e("span",{key:"4c4e3fa6ddeda1a59f65ba47665a9203356037a6",class:"s-accordion-head-wrapper-toggle-icon",innerHTML:this.collapsed?n:r}))))};Object.defineProperty(t.prototype,"host",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());u.style=f;var p='\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>swap-fill</title>\n<path d="M28 10.667h-2.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h2.667c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333v-2.667c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v2.667c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4v-13.333c0-2.205-1.795-4-4-4zM21.333 17.333v-13.333c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4zM2.667 17.333v-13.333c0-0.736 0.599-1.333 1.333-1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333z"></path>\n</svg>\n';var b="";var v=t("salla_order_details_options",function(){function t(t){s(this,t);this.bordered=true;this.placeholderImage="images/placeholder.png";this.optionsData=[]}t.prototype.componentWillLoad=function(){this.parseOptionsData()};t.prototype.componentWillUpdate=function(){this.parseOptionsData()};t.prototype.parseOptionsData=function(){if(!this.options){this.optionsData=[];return}if(typeof this.options==="string"){try{this.optionsData=JSON.parse(this.options)}catch(t){this.optionsData=[]}}else{this.optionsData=Array.isArray(this.options)?this.options:[]}};t.prototype.renderOptionValue=function(t){var s=this;if(t.is_image){return e("div",{class:"s-order-details-option-image-container"},e("a",{href:t.value,target:"_blank"},e("img",{class:"s-order-details-option-image",src:t.value||this.placeholderImage,alt:t.name})))}if(t.color){return e("span",{title:t.value,class:"s-order-details-option-color-swatch",style:{backgroundColor:t.color}})}if(t.is_file){return e("a",{href:t.value,target:"_blank",class:"s-order-details-option-file-link"},"Attachments")}if(t.is_color_picker){return e("div",{class:"s-order-details-option-color-picker"},e("div",{class:"s-order-details-option-color-picker-content"},e("span",{class:"s-order-details-option-color-picker-text"},t.value),e("span",{class:"s-order-details-option-color-picker-swatch",style:{backgroundColor:t.value,width:"1rem"}})),e("salla-button",{onClick:function(e){return s.copyToClipboard(e,t.value)},shape:"link",class:"s-order-details-option-color-picker-button"},e("span",{class:"s-order-details-option-color-copy-icon",innerHTML:p})))}if(t.is_map&&t.latitude&&t.longitude){return e("salla-map",{id:"location_map_".concat(t.id),class:"map_".concat(t.id),zoom:15,readonly:true,lat:t.latitude,lng:t.longitude},e("div",{slot:"button"},e("button",{type:"button",class:"s-order-details-option-map-button",onClick:function(){return s.openMap(t.id)}},"Show Location")))}return e("span",{class:"s-order-details-option-default-text"},t.display_value||t.value)};t.prototype.copyToClipboard=function(t,s){t.preventDefault();if(navigator.clipboard){navigator.clipboard.writeText(s)}};t.prototype.openMap=function(t){var s=document.querySelector("salla-map.map_".concat(t));if(s&&s.open){s.open()}};t.prototype.render=function(){var t=this;if(!this.optionsData.length){return null}var s=this.bordered?"s-order-details-options-container":"s-order-details-options-container-borderless";return e(i,{class:"s-order-details-options-wrapper"},e("h2",{class:"s-order-details-options-title"},salla.lang.get("pages.cart.item_options")),e("div",{class:s},e("dl",{class:"s-order-details-options-list"},this.optionsData.map((function(s){return e("div",{key:s.id,class:"s-order-details-options-item"},e("dt",{class:"s-order-details-options-item-name"},s.name,":"),e("dd",{class:s.is_image?"s-order-details-options-item-value-image":"s-order-details-options-item-value-text"},t.renderOptionValue(s)))})))))};return t}());v.style=b}}}));
|
|
5
|
+
//# sourceMappingURL=p-1a4075f6.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
System.register(["./p-B3l0Kfzh.system.js","./p-D5o2VQTp.system.js","./p-CzwwMHuN.system.js","./p-CLqFzsVe.system.js"],(function(s){"use strict";var e,i,t,a;return{setters:[function(s){e=s.r;i=s.h},function(s){t=s.a},function(s){a=s.H},null],execute:function(){var l='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>quote-open</title>\n<path d="M8 12v-5.333c0-0.737-0.596-1.333-1.333-1.333-3.676 0-6.667 2.991-6.667 6.667v8c0 3.676 2.991 6.667 6.667 6.667h1.333c3.676 0 6.667-2.991 6.667-6.667v-1.333c0-3.676-2.991-6.667-6.667-6.667zM12 20c0 2.205-1.795 4-4 4h-1.333c-2.205 0-4-1.795-4-4v-8c0-1.739 1.115-3.221 2.667-3.772v5.105c0 0.737 0.596 1.333 1.333 1.333h1.333c2.205 0 4 1.795 4 4zM25.333 12v-5.333c0-0.737-0.596-1.333-1.333-1.333-3.676 0-6.667 2.991-6.667 6.667v8c0 3.676 2.991 6.667 6.667 6.667h1.333c3.676 0 6.667-2.991 6.667-6.667v-1.333c0-3.676-2.991-6.667-6.667-6.667zM29.333 20c0 2.205-1.795 4-4 4h-1.333c-2.205 0-4-1.795-4-4v-8c0-1.739 1.115-3.221 2.667-3.772v5.105c0 0.737 0.596 1.333 1.333 1.333h1.333c2.205 0 4 1.795 4 4z"></path>\n</svg>\n';var n="";var r=s("salla_reviews",function(){function s(s){var i=this;e(this,s);this.limit=5;this.type="store";this.sort="latest";this.hideCustomerInfo=false;this.reviews=[];this.showReviews=false;this.testimonialText=salla.lang.get("blocks.home.testimonials");this.displayAllLinkText=salla.lang.get("blocks.home.display_all");this.displayAllURL=null;this.source=this.source;salla.onReady((function(){i.displayAllURL=salla.url.get("testimonials");i.isRTL=salla.config.get("theme.is_rtl",true)}));salla.lang.onLoaded((function(){i.testimonialText=salla.lang.get("blocks.home.testimonials");i.displayAllLinkText=salla.lang.get("blocks.home.display_all")}))}s.prototype.fetchReviews=function(){if(this.source==="json"){return Promise.resolve(JSON.parse(this.sourceValue))}var s=["products","categories"].includes(this.source);var e={limit:this.limit,source:this.source,items:s?JSON.parse(this.sourceValue):this.sourceValue,sort:this.sort,type:this.type,hide_customer_info:this.hideCustomerInfo?1:0};return salla.api.request("reviews",{params:e},"get")};s.prototype.componentWillLoad=function(){var s=this;return new Promise((function(s){return salla.onReady(s)})).then((function(){return s.fetchReviews()})).then((function(s){return s.data||[]})).then((function(e){if(e.length){s.reviews=e;s.showReviews=true;a.generateReviewSchema(s.reviews)}}))};s.prototype.render=function(){return i("div",{key:"deed3cdbac9556908c110d96935d6478996caf99",class:"s-reviews-container"},i("div",{key:"3646aa3266c29d1f371cf3acedaedc726f7e6bac",class:"s-reviews-header-wrapper"},i("h1",{key:"0a47642eea4e162173374f0a1340fd3068165d30",class:"s-reviews-header"},this.testimonialText),!!this.displayAllLink?i("a",{href:this.displayAllURL,class:"s-reviews-display-all"},this.displayAllLinkText,i("span",{class:"s-reviews-display-all-icon",innerHTML:t})):null),i("salla-slider",{key:"71b0e1f246172b5ea042f7a4dcdc351190a3de3c",centered:true,"slides-per-view":1,type:"testimonials",class:"s-reviews-testimonials-slider","controls-outer":true,"auto-play":true,id:"testimonials-".concat(this.source,"-slider")},i("div",{key:"50b9ac94feca79ed29d85bfcf4808b0849e4f933",slot:"items"},this.reviews.map((function(s,e){return i("div",{key:e,class:"s-reviews-swiper-slide"},i("div",{class:"s-reviews-testimonial"},i("div",{class:"s-reviews-testimonial__inner"},i("div",{class:"s-reviews-testimonial__avatar"},i("img",{src:"images/s-empty.png","data-src":s.avatar,alt:s.name?s.name:"testimonial-"+e,class:"lazy"})),i("div",{class:"s-reviews-testimonial__text"},i("p",{innerHTML:s.content}),i("div",{class:"s-reviews-testimonial__name_wrapper"},i("div",{class:"s-reviews-testimonial__info"},s.name&&i("h2",null,"".concat(s.name))),i("div",{class:"s-reviews-testimonial__rating"},i("salla-rating-stars",{size:"small",value:s.stars})))),i("span",{class:"s-reviews-testimonial__icon",innerHTML:l}))))})))))};return s}());r.style=n}}}));
|
|
5
|
+
//# sourceMappingURL=p-1d2dc3d6.system.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-1viHRpqo.system.js","sources":["src/components/salla-loyalty/salla-loyalty-prize-item.scss?tag=salla-loyalty-prize-item","src/components/salla-loyalty/salla-loyalty-prize-item.tsx"],"sourcesContent":["\nsalla-loyalty-prize-item:hover {\n box-shadow: 0 5px 15px 1px rgb(0 0 0 / 4%)!important;\n}\n\n","import { Component, h, Prop, Host, Event, EventEmitter } from '@stencil/core';\nimport { Item } from \"./loyalty-schema\"\n\n\n@Component({\n tag: 'salla-loyalty-prize-item',\n styleUrl: 'salla-loyalty-prize-item.scss',\n})\nexport class SallaLoyaltyPrizeItem {\n\n /**\n * Prize item to be displayed in this component.\n */\n @Prop() item: Item;\n\n /**\n * Event emmited when the user select this item.\n */\n @Event() prizeItemSelected: EventEmitter<Item>\n\n onPrizeItemClick() {\n this.prizeItemSelected.emit(this.item)\n }\n\n render() {\n return (\n <Host>\n <div onClick={this.onPrizeItemClick.bind(this)}>\n <img class=\"s-loyalty-prize-item-image\" src={this.item.image} alt={this.item.name} />\n <div class=\"s-loyalty-prize-item-title\">{this.item.name}</div>\n <div class=\"s-loyalty-prize-item-subtitle\">{this.item.description}</div>\n <div class=\"s-loyalty-prize-item-points\">{this.item.cost_points} Points</div>\n </div>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAAA,MAAM,wBAAwB,GAAG,2JAA2J;;YCQ/K,qBAAqB,uCAAA,MAAA;;;;;UAY9B,gBAAgB,GAAA;cACZ,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;;UAG1C,MAAM,GAAA;MACF,QAAA,QACI,EAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACD,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAA,EAC1C,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,4BAA4B,EAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAI,CAAA,EACrF,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,4BAA4B,EAAA,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAO,EAC9D,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,+BAA+B,EAAA,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAO,EACxE,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,6BAA6B,EAAA,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,YAAc,CAC3E,CACH;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as t,g as i}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as s,h as t,g as i}from"./p-wQf8KFfR.js";import{a}from"./p-CgtvEd63.js";const e=":host{display:block}";const l=class{constructor(t){s(this,t);var i;this.currentSlug=salla.config.get("page.slug");salla.onReady((()=>{this.currentSlug=salla.config.get("page.slug")}));this.advSlot=((i=this.host.querySelector('[slot="adv"]'))===null||i===void 0?void 0:i.innerHTML)||`<div class="s-advertisement-content"><h2 class="s-advertisement-content-main">{iconElem}{urlElem}</h2>{closeElem}</div>\n `}isNotVisible(s){return!!salla.storage.get(`statusAd-${s.id}`)}setCanDisplayFlag(s,t){if(!t){salla.storage.set(`statusAd-${s.id}`,"dismissed");a({targets:this.host,opacity:[1,0],duration:300,height:[this.host.clientHeight,0],easing:"easeInOutQuad"})}}render(){if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}return this.advertisements.map((s=>t("div",{class:{"s-hidden":this.isNotVisible(s),"s-advertisement":true},"data-id":s.id,style:{"background-color":s.colors.bg,color:s.colors.text}},t("div",{id:"adv-slot",innerHTML:this.advSlot.replace("{iconElem}",`<i class="s-advertisement-content-icon ${s.icon}"></i>`).replace("{urlElem}",s.url?`<a href="${s.url}" target="${s.target}">${s.description}</a>`:s.description).replace("{closeElem}",`<button class="s-advertisement-action" aria-label="close-alert"><i class="sicon-cancel"></i></button>`).replace("{icon}",s.icon).replace("{url}",s.url).replace("{target}",s.target).replace("{description}",s.description).replace("{bg_color}",s.colors.bg).replace("{text_color}",s.colors.text)}))))}componentWillLoad(){return new Promise((s=>salla.onReady(s))).then((()=>salla.api.advertisement.fetch(this.currentSlug))).then((s=>Array.isArray(s.data)?s.data.find((s=>!salla.storage.get(`statusAd-${s.id}`))):null)).then((s=>this.advertisements=s?[s]:[]))}componentDidRender(){var s;if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}setTimeout((()=>{let s=this.host.querySelector(".s-advertisement-action");if(s){s.addEventListener("click",(()=>this.setCanDisplayFlag(this.advertisements[0],false)))}}));this.host.querySelectorAll("#adv-slot").forEach((s=>s===null||s===void 0?void 0:s.replaceWith(s===null||s===void 0?void 0:s.firstChild)));(s=this.host.querySelector('[slot="adv"]'))===null||s===void 0?void 0:s.remove();a({targets:this.host,opacity:[0,1],duration:300,height:[0,this.host.clientHeight],easing:"easeInOutQuad"})}get host(){return i(this)}};l.style=e;export{l as salla_advertisement};
|
|
5
|
+
//# sourceMappingURL=p-24683c1b.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,i,e,n){function s(t){return t instanceof e?t:new e((function(i){i(t)}))}return new(e||(e=Promise))((function(e,r){function a(t){try{c(n.next(t))}catch(t){r(t)}}function u(t){try{c(n["throw"](t))}catch(t){r(t)}}function c(t){t.done?e(t.value):s(t.value).then(a,u)}c((n=n.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(t){return function(i){return c([t,i])}}function c(u){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(e=0)),e)try{if(n=1,s&&(r=u[0]&2?s["return"]:u[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,u[1])).done)return r;if(s=0,r)u=[u[0]&2,r.value];switch(u[0]){case 0:case 1:r=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;s=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){e.label=u[1];break}if(u[0]===6&&e.label<r[1]){e.label=r[1];r=u;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(u);break}if(r[2])e.ops.pop();e.trys.pop();continue}u=i.call(t,e)}catch(t){u=[6,t];s=0}finally{n=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-B3l0Kfzh.system.js","./p-CzwwMHuN.system.js","./p-Bnro4LR3.system.js","./p-CLqFzsVe.system.js"],(function(t){"use strict";var i,e,n,s,r,a,u;return{setters:[function(t){i=t.r;e=t.c;n=t.h;s=t.H;r=t.g},function(t){a=t.H},function(t){u=t.F},null],execute:function(){var c=":host{display:block}";var o=t("salla_filters_widget",function(){function t(t){i(this,t);this.changed=e(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 i=this;if(t===void 0){t=250}return __generator(this,(function(e){this.widgetContent.removeAttribute("style");setTimeout((function(){var t=i.widgetContent.scrollHeight;i.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===u.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(i){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(i){this.isOpen=!this.isOpen;a.toggleElementClassIf(this.widgetContent,"s-filters-widget-opened","s-filters-widget-closed",(function(){return t.isOpen}));return[2]}))}))};t.prototype.renderFilterOption=function(t){var i=this;if(![u.VALUES,u.MINIMUM,u.VARIANTS].includes(t.type)){return""}return t.values.map((function(e,s){var r=typeof e=="number"?e:e.key||e.value;return n("label",{class:"s-filters-label",htmlFor:"".concat(t.key,"-option-").concat(r),key:"".concat(t.key,"-option-").concat(r)},n("input",{id:"".concat(t.key,"-option-").concat(r),name:t.key,type:"radio",checked:i.isSelectedOption(t,r),class:"s-filters-radio",onChange:function(e){return i.changed.emit({event:e,option:t,value:r})}}),i.getOptionLabel(t,e))}))};t.prototype.isSelectedOption=function(t,i){if(t.type===u.MINIMUM){return this.filtersData[t.key]==i}if(t.type===u.VARIANTS){return this.filtersData[t.type]&&this.filtersData[t.type][Object.keys(this.filtersData[t.type])[0]]==i}if(t.type===u.RANGE){return this.filtersData[t.key]&&this.filtersData[t.key].min==i.min&&this.filtersData[t.key].max==i.max}if(t.type===u.VALUES){return this.filtersData[t.key]&&Number(this.filtersData[t.key])==Number(i)}return false};t.prototype.getOptionLabel=function(t,i){if(t.key=="rating"){return n("salla-rating-stars",{size:"small",value:i})}var e=i.value||"null";return n("span",{class:"s-filters-option-name"},e)};t.prototype.render=function(){var t=this;return n(s,{key:"1987fec03cfe48cddc60af2d81bbc30a476dcb61",class:"s-filters-widget-container"},n("h3",{key:"4232775c4012d1be8bb3036d9d09e5d29d951ee4",class:"s-filters-widget-title",onClick:function(){return t.toggleWidget()}},n("span",{key:"61cf9ea5a69f3ab5377502a396cc84478c6152a1"},this.option.label),n("span",{key:"b75914eb06f9d419d0a89da2a8f2da2f891f3d27",class:"s-filters-widget-plusminus ".concat(this.isOpen?"s-filters-widget-plusminus-active":"")})),n("div",{key:"f65e2f8a44648b034dacf1bda1aa64b5398627b7",class:"s-filters-widget-content",ref:function(i){return t.widgetContent=i}},n("div",{key:"adcafe169ce8cbef671263f3624bce071b168c36",class:"s-filters-widget-values",ref:function(i){return t.widgetValues=i}},n("slot",{key:"fa006556e44e508c3c64cc5ae76cc826b7e7601e"}),this.option.type!==u.RANGE?this.renderFilterOption(this.option):n("salla-price-range",{onChanged:function(i){t.changed.emit(i.detail)},ref:function(i){return t.priceRange=i},filtersData:this.filtersData,option:this.option})),this.withLoadMore&&n("a",{key:"16a4ddeb365dc1d52fc51a8999fc6d7dbe094658",class:"s-filters-widget-more",onClick:function(){return t.showMore()}},!this.isShowMore?this.showMoreLabel:this.showLessLabel)))};Object.defineProperty(t.prototype,"host",{get:function(){return r(this)},enumerable:false,configurable:true});return t}());o.style=c}}}));
|
|
5
|
+
//# sourceMappingURL=p-29137c7f.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as a,h as t,H as s,g as e}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as a,h as t,H as s,g as e}from"./p-wQf8KFfR.js";const i="";const l=class{constructor(t){a(this,t);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")}}}getValue(a){if(a.type==="file"){return`<a href="${a.value}" class="text-primary" target="_blank"><span class="sicon-download"></span> ${this.download}</a>`}if(a.type==="url"){return`<a href="${a.value}" class="text-blue-700 underline" target="_blank">${a.value}</a>`}if(a.type==="date"){const t=new Date(a.value);const s=String(t.getDate()).padStart(2,"0");const e=String(t.getMonth()+1).padStart(2,"0");const i=t.getFullYear();const l=`${s}/${e}/${i}`;return l}return a.value}async componentWillLoad(){var a,t;await salla.onReady();if(!((a=salla.config.get("store.features"))===null||a===void 0?void 0:a.includes("custom-fields"))){return salla.logger.error("feature custom-fields is not activated")}if(!this.entityId&&(salla.url.is_page("product.single")||salla.url.is_page("product.showNewUrls"))){this.entityId=salla.config.get("page.id")}if(!this.entityId){return salla.logger.error("can't render salla-metadata without enity-id prop!")}await salla.lang.onLoaded();this.download=salla.lang.get("pages.thank_you.download");const s=await Salla.api.metadata.fetchValues(this.entity,this.entityId);this.specs=(t=s.data[0])===null||t===void 0?void 0:t.sections}render(){if(!this.specs.length){return}return t(s,{class:"s-metadata-wrapper"},this.specs.map((a=>t("div",{class:"s-metadata-box"},t("div",{class:"s-metadata-box-header"},t("i",{class:"sicon-list"}),a.name),a.fields.map((a=>t("div",{class:"s-metadata-row"},t("p",{class:"s-metadata-row-name"},a.name),t("p",{class:"s-metadata-row-value",innerHTML:this.getValue(a)}))))))))}get host(){return e(this)}};l.style=i;export{l as salla_metadata};
|
|
5
|
+
//# sourceMappingURL=p-2d9b7946.entry.js.map
|