@salla.sa/twilight-components 2.14.225 → 2.14.227
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-CTD_ReSe.js → app-globals-hFnZzUKs.js} +3 -3
- package/dist/cjs/{app-globals-CTD_ReSe.js.map → app-globals-hFnZzUKs.js.map} +1 -1
- package/dist/cjs/{index-BboPJvVk.js → index-BMPxDNpo.js} +4 -4
- package/dist/cjs/index-BMPxDNpo.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion-head.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_51.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +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-BpGR-kiQ.js → app-globals-hq3RnNav.js} +3 -3
- package/dist/esm/{app-globals-BpGR-kiQ.js.map → app-globals-hq3RnNav.js.map} +1 -1
- package/dist/esm/{index-BuEDxKhL.js → index-bWnWhxOm.js} +4 -4
- package/dist/esm/index-bWnWhxOm.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body.entry.js +1 -1
- package/dist/esm/salla-accordion-head.entry.js +1 -1
- package/dist/esm/salla-accordion.entry.js +1 -1
- package/dist/esm/salla-add-product-button_51.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-booking-field_2.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +1 -1
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-options.entry.js +1 -1
- package/dist/esm/salla-review-card.entry.js +1 -1
- package/dist/esm/salla-reviews-page.entry.js +1 -1
- package/dist/esm/salla-reviews.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +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-BpGR-kiQ.js → app-globals-hq3RnNav.js} +2 -2
- package/dist/esm-es5/{app-globals-BpGR-kiQ.js.map → app-globals-hq3RnNav.js.map} +1 -1
- package/dist/esm-es5/{index-BuEDxKhL.js → index-bWnWhxOm.js} +3 -3
- package/dist/esm-es5/index-bWnWhxOm.js.map +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-accordion-body.entry.js +1 -1
- package/dist/esm-es5/salla-accordion-head.entry.js +1 -1
- package/dist/esm-es5/salla-accordion.entry.js +1 -1
- package/dist/esm-es5/salla-add-product-button_51.entry.js +1 -1
- package/dist/esm-es5/salla-advertisement.entry.js +1 -1
- package/dist/esm-es5/salla-app-install-alert.entry.js +1 -1
- package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
- package/dist/esm-es5/salla-booking-field_2.entry.js +1 -1
- package/dist/esm-es5/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm-es5/salla-conditional-offer.entry.js +1 -1
- package/dist/esm-es5/salla-contacts.entry.js +1 -1
- package/dist/esm-es5/salla-filters-widget.entry.js +1 -1
- package/dist/esm-es5/salla-filters.entry.js +1 -1
- package/dist/esm-es5/salla-installment.entry.js +1 -1
- package/dist/esm-es5/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm-es5/salla-loyalty-program.entry.js +1 -1
- package/dist/esm-es5/salla-metadata.entry.js +1 -1
- package/dist/esm-es5/salla-notification-item.entry.js +1 -1
- package/dist/esm-es5/salla-notifications.entry.js +1 -1
- package/dist/esm-es5/salla-offer.entry.js +1 -1
- package/dist/esm-es5/salla-order-summary.entry.js +1 -1
- package/dist/esm-es5/salla-orders.entry.js +1 -1
- package/dist/esm-es5/salla-payments.entry.js +1 -1
- package/dist/esm-es5/salla-price-range.entry.js +1 -1
- package/dist/esm-es5/salla-product-options.entry.js +1 -1
- package/dist/esm-es5/salla-review-card.entry.js +1 -1
- package/dist/esm-es5/salla-reviews-page.entry.js +1 -1
- package/dist/esm-es5/salla-reviews.entry.js +1 -1
- package/dist/esm-es5/salla-social.entry.js +1 -1
- package/dist/esm-es5/salla-tiered-offer.entry.js +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-5c052357.system.entry.js → p-05aa9a60.system.entry.js} +2 -2
- package/dist/twilight/{p-87cdfd0c.system.entry.js → p-06043c02.system.entry.js} +2 -2
- package/dist/twilight/{p-e80d7e2d.entry.js → p-0b430727.entry.js} +2 -2
- package/dist/twilight/{p-1621ce48.system.entry.js → p-10da3994.system.entry.js} +2 -2
- package/dist/twilight/{p-81ccc9b4.system.entry.js → p-1b569b10.system.entry.js} +2 -2
- package/dist/twilight/{p-0a7ef531.system.entry.js → p-1d8bff13.system.entry.js} +2 -2
- package/dist/twilight/{p-234psyG4.system.js.map → p-1f_p-pyh.system.js.map} +1 -1
- package/dist/twilight/{p-c9a6cd5e.entry.js → p-1ff003ae.entry.js} +2 -2
- package/dist/twilight/{p-45c86f18.entry.js → p-2009a3b2.entry.js} +2 -2
- package/dist/twilight/{p-e42cf6fa.system.entry.js → p-2982aef4.system.entry.js} +2 -2
- package/dist/twilight/{p-9dc2b009.entry.js → p-2b36aa10.entry.js} +2 -2
- package/dist/twilight/{p-35b811d5.system.entry.js → p-2c15e135.system.entry.js} +2 -2
- package/dist/twilight/{p-2597d91f.entry.js → p-318cb424.entry.js} +2 -2
- package/dist/twilight/{p-fac7b966.entry.js → p-322c43c3.entry.js} +2 -2
- package/dist/twilight/{p-5841f384.system.entry.js → p-32cadc2e.system.entry.js} +2 -2
- package/dist/twilight/{p-67e8ce01.entry.js → p-32fa0012.entry.js} +2 -2
- package/dist/twilight/{p-66383c6f.system.entry.js → p-35a1f4f8.system.entry.js} +2 -2
- package/dist/twilight/{p-874e236e.system.entry.js → p-39c71f65.system.entry.js} +2 -2
- package/dist/twilight/{p-301356e4.system.entry.js → p-3d2f33db.system.entry.js} +2 -2
- package/dist/twilight/{p-d719437a.entry.js → p-41a2ff58.entry.js} +2 -2
- package/dist/twilight/{p-1fa6c0ee.entry.js → p-44088065.entry.js} +2 -2
- package/dist/twilight/{p-36b1f945.entry.js → p-49b0682d.entry.js} +2 -2
- package/dist/twilight/{p-cd65e281.entry.js → p-5062de31.entry.js} +2 -2
- package/dist/twilight/{p-8c80c30f.system.entry.js → p-52f71fe5.system.entry.js} +2 -2
- package/dist/twilight/{p-450e1424.entry.js → p-53a27112.entry.js} +2 -2
- package/dist/twilight/{p-95f8ce0e.system.entry.js → p-56439c4f.system.entry.js} +2 -2
- package/dist/twilight/{p-1f4c5504.system.entry.js → p-5a6cdba6.system.entry.js} +2 -2
- package/dist/twilight/{p-4c418786.entry.js → p-636fec68.entry.js} +2 -2
- package/dist/twilight/{p-7f262d03.system.entry.js → p-692cd8b6.system.entry.js} +2 -2
- package/dist/twilight/{p-9c62b55a.entry.js → p-69f12323.entry.js} +2 -2
- package/dist/twilight/{p-58434030.entry.js → p-6c7e91e1.entry.js} +2 -2
- package/dist/twilight/{p-08818bf6.entry.js → p-6d0cbbaf.entry.js} +2 -2
- package/dist/twilight/{p-3146a7d0.entry.js → p-6ee49c5b.entry.js} +2 -2
- package/dist/twilight/{p-e3599746.system.entry.js → p-7d438ff1.system.entry.js} +2 -2
- package/dist/twilight/{p-eae01aed.system.entry.js → p-7f79cd75.system.entry.js} +2 -2
- package/dist/twilight/{p-5b4470bf.entry.js → p-887601b7.entry.js} +2 -2
- package/dist/twilight/{p-bd43fadf.entry.js → p-88b4dd5f.entry.js} +2 -2
- package/dist/twilight/{p-7f59cd9f.system.entry.js → p-8cfdf2b6.system.entry.js} +2 -2
- package/dist/twilight/{p-d55dc6ed.entry.js → p-8ed8db80.entry.js} +2 -2
- package/dist/twilight/{p-653e7373.system.entry.js → p-8fc86179.system.entry.js} +2 -2
- package/dist/twilight/{p-fa8949b0.entry.js → p-97c4bb25.entry.js} +2 -2
- package/dist/twilight/{p-e0208463.entry.js → p-99e29723.entry.js} +2 -2
- package/dist/twilight/{p-3dff2f76.system.entry.js → p-99f7a496.system.entry.js} +2 -2
- package/dist/twilight/{p-aa5a65e7.entry.js → p-9cf6352b.entry.js} +2 -2
- package/dist/twilight/{p-84d97c1a.system.entry.js → p-9e0f4279.system.entry.js} +2 -2
- package/dist/twilight/{p-BAlSNS7p.system.js.map → p-B466X8UK.system.js.map} +1 -1
- package/dist/twilight/{p-By0rW4rq.system.js → p-B6dZG1Ey.system.js} +3 -3
- package/dist/twilight/p-B6dZG1Ey.system.js.map +1 -0
- package/dist/twilight/{p-BBWAcIuZ.system.js.map → p-BZ1NPYKG.system.js.map} +1 -1
- package/dist/twilight/{p-BaL0Khy-.system.js.map → p-BaeOPjTV.system.js.map} +1 -1
- package/dist/twilight/{p-Dm4CLY1C.system.js → p-Bn-ITW9-.system.js} +2 -2
- package/dist/twilight/{p-Dm4CLY1C.system.js.map → p-Bn-ITW9-.system.js.map} +1 -1
- package/dist/twilight/{p-BAUuwpBC.system.js.map → p-BzQ9Vv1k.system.js.map} +1 -1
- package/dist/twilight/{p-B_hCOF74.system.js.map → p-C37SsRx_.system.js.map} +1 -1
- package/dist/twilight/{p-BmjgV4Yf.system.js.map → p-C70-bXs3.system.js.map} +1 -1
- package/dist/twilight/{p-puB6JvZi.system.js.map → p-C81PoUd5.system.js.map} +1 -1
- package/dist/twilight/{p-DXuq_yem.system.js.map → p-CEuZm94z.system.js.map} +1 -1
- package/dist/twilight/{p-DvYFUnj0.system.js.map → p-CJ9Rja8s.system.js.map} +1 -1
- package/dist/twilight/{p-_mhrLpJ2.system.js.map → p-CLDTPks4.system.js.map} +1 -1
- package/dist/twilight/{p-B7nw4ZLM.system.js.map → p-CMmbDbWu.system.js.map} +1 -1
- package/dist/twilight/{p-D7Catdno.system.js.map → p-CPSbLPQo.system.js.map} +1 -1
- package/dist/twilight/{p-DDHV71gy.system.js.map → p-CPbFw3rv.system.js.map} +1 -1
- package/dist/twilight/{p-DhbfXZto.system.js.map → p-CbzY9xr3.system.js.map} +1 -1
- package/dist/twilight/{p-D1iGjmVx.system.js → p-Ch0XDLlb.system.js} +2 -2
- package/dist/twilight/{p-D1iGjmVx.system.js.map → p-Ch0XDLlb.system.js.map} +1 -1
- package/dist/twilight/{p-Czhh6gjZ.system.js.map → p-CrabmjWX.system.js.map} +1 -1
- package/dist/twilight/{p-KVtMSLLa.system.js.map → p-CxEpvuoA.system.js.map} +1 -1
- package/dist/twilight/{p-DRljzN-H.system.js.map → p-D2Oj4yiI.system.js.map} +1 -1
- package/dist/twilight/{p-DTvwBUcM.system.js.map → p-D3fzmb9X.system.js.map} +1 -1
- package/dist/twilight/{p-fGl4YJ-E.system.js.map → p-D5btSzB-.system.js.map} +1 -1
- package/dist/twilight/{p-BNm-GRln.system.js.map → p-DIdHS8jD.system.js.map} +1 -1
- package/dist/twilight/{p-Bs55DB_F.system.js.map → p-DPT0ERnh.system.js.map} +1 -1
- package/dist/twilight/{p-D60VWJR5.system.js.map → p-DSEi1U9-.system.js.map} +1 -1
- package/dist/twilight/{p-CrZWdz28.system.js.map → p-DigsgNtD.system.js.map} +1 -1
- package/dist/twilight/{p-DpS2AZl2.system.js.map → p-KPLvifz6.system.js.map} +1 -1
- package/dist/twilight/{p-BDEbE-jm.system.js.map → p-KzUGBk3Y.system.js.map} +1 -1
- package/dist/twilight/{p-YXLSVX9a.system.js.map → p-SbMSZuG_.system.js.map} +1 -1
- package/dist/twilight/{p-B8g_PPaA.system.js.map → p-Ulh9NfSj.system.js.map} +1 -1
- package/dist/twilight/{p-DcqVqCF2.system.js.map → p-VFLmJZ-9.system.js.map} +1 -1
- package/dist/twilight/{p-DU7tMpvX.system.js.map → p-Yelj68cj.system.js.map} +1 -1
- package/dist/twilight/{p-CHv52V_M.js → p-ZwtGrJFn.js} +2 -2
- package/dist/twilight/{p-CHv52V_M.js.map → p-ZwtGrJFn.js.map} +1 -1
- package/dist/twilight/{p-b25f5986.system.entry.js → p-a8640b04.system.entry.js} +2 -2
- package/dist/twilight/{p-8ddfc931.system.entry.js → p-acb9d776.system.entry.js} +2 -2
- package/dist/twilight/{p-BuEDxKhL.js → p-bWnWhxOm.js} +3 -3
- package/dist/twilight/p-bWnWhxOm.js.map +1 -0
- package/dist/twilight/{p-93f3da8e.entry.js → p-c09f43d3.entry.js} +2 -2
- package/dist/twilight/{p-2c157399.system.entry.js → p-c130265a.system.entry.js} +2 -2
- package/dist/twilight/{p-9d92395a.system.entry.js → p-c1b001c4.system.entry.js} +3 -3
- package/dist/twilight/{p-9e8b0157.entry.js → p-c3e1063f.entry.js} +2 -2
- package/dist/twilight/{p-0747bd06.system.entry.js → p-c50fc635.system.entry.js} +2 -2
- package/dist/twilight/{p-63e2d5c7.system.entry.js → p-c84e4d50.system.entry.js} +2 -2
- package/dist/twilight/{p-1bd8a562.system.entry.js → p-cfe6ae96.system.entry.js} +2 -2
- package/dist/twilight/{p-28af21d8.system.entry.js → p-d26748a6.system.entry.js} +2 -2
- package/dist/twilight/p-d55ee175.system.entry.js +5 -0
- package/dist/twilight/{p-63446264.entry.js → p-d5db9404.entry.js} +2 -2
- package/dist/twilight/{p-5ed120d8.system.entry.js → p-dbc0e68a.system.entry.js} +3 -3
- package/dist/twilight/{p-c5e1d754.entry.js → p-dc44cedb.entry.js} +2 -2
- package/dist/twilight/{p-93588cb9.system.entry.js → p-e51e9d9c.system.entry.js} +2 -2
- package/dist/twilight/{p-b5d9c8b5.entry.js → p-e9fd3384.entry.js} +2 -2
- package/dist/twilight/{p-c72bc57b.entry.js → p-ea054cd3.entry.js} +2 -2
- package/dist/twilight/{p-cb64785d.entry.js → p-f879f1a9.entry.js} +2 -2
- package/dist/twilight/p-f8cf7424.entry.js +5 -0
- package/dist/twilight/{p-85b5bc6a.system.entry.js → p-fa2c92fc.system.entry.js} +2 -2
- package/dist/twilight/{p-5b0cef47.entry.js → p-fd470a27.entry.js} +2 -2
- package/dist/twilight/{p-a2935615.entry.js → p-ff6bf70d.entry.js} +2 -2
- package/dist/twilight/{p-BH3uWoHX.system.js.map → p-h3jsRynq.system.js.map} +1 -1
- package/dist/twilight/{p-DIwtupWl.system.js.map → p-lKw_UV_U.system.js.map} +1 -1
- package/dist/twilight/{p-B_EmtHdV.system.js.map → p-u7_VeCm1.system.js.map} +1 -1
- package/dist/twilight/{p-BlBBZ3CL.system.js.map → p-xjEwH2R4.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-BboPJvVk.js.map +0 -1
- package/dist/esm/index-BuEDxKhL.js.map +0 -1
- package/dist/esm-es5/index-BuEDxKhL.js.map +0 -1
- package/dist/twilight/p-4d349075.system.entry.js +0 -5
- package/dist/twilight/p-8f8b11d5.entry.js +0 -5
- package/dist/twilight/p-BuEDxKhL.js.map +0 -1
- package/dist/twilight/p-By0rW4rq.system.js.map +0 -1
- /package/dist/twilight/{p-5c052357.system.entry.js.map → p-05aa9a60.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-87cdfd0c.system.entry.js.map → p-06043c02.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e80d7e2d.entry.js.map → p-0b430727.entry.js.map} +0 -0
- /package/dist/twilight/{p-1621ce48.system.entry.js.map → p-10da3994.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-81ccc9b4.system.entry.js.map → p-1b569b10.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-0a7ef531.system.entry.js.map → p-1d8bff13.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-c9a6cd5e.entry.js.map → p-1ff003ae.entry.js.map} +0 -0
- /package/dist/twilight/{p-45c86f18.entry.js.map → p-2009a3b2.entry.js.map} +0 -0
- /package/dist/twilight/{p-e42cf6fa.system.entry.js.map → p-2982aef4.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9dc2b009.entry.js.map → p-2b36aa10.entry.js.map} +0 -0
- /package/dist/twilight/{p-35b811d5.system.entry.js.map → p-2c15e135.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2597d91f.entry.js.map → p-318cb424.entry.js.map} +0 -0
- /package/dist/twilight/{p-fac7b966.entry.js.map → p-322c43c3.entry.js.map} +0 -0
- /package/dist/twilight/{p-5841f384.system.entry.js.map → p-32cadc2e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-67e8ce01.entry.js.map → p-32fa0012.entry.js.map} +0 -0
- /package/dist/twilight/{p-66383c6f.system.entry.js.map → p-35a1f4f8.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-874e236e.system.entry.js.map → p-39c71f65.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-301356e4.system.entry.js.map → p-3d2f33db.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-d719437a.entry.js.map → p-41a2ff58.entry.js.map} +0 -0
- /package/dist/twilight/{p-1fa6c0ee.entry.js.map → p-44088065.entry.js.map} +0 -0
- /package/dist/twilight/{p-36b1f945.entry.js.map → p-49b0682d.entry.js.map} +0 -0
- /package/dist/twilight/{p-cd65e281.entry.js.map → p-5062de31.entry.js.map} +0 -0
- /package/dist/twilight/{p-8c80c30f.system.entry.js.map → p-52f71fe5.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-450e1424.entry.js.map → p-53a27112.entry.js.map} +0 -0
- /package/dist/twilight/{p-95f8ce0e.system.entry.js.map → p-56439c4f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-1f4c5504.system.entry.js.map → p-5a6cdba6.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4c418786.entry.js.map → p-636fec68.entry.js.map} +0 -0
- /package/dist/twilight/{p-7f262d03.system.entry.js.map → p-692cd8b6.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9c62b55a.entry.js.map → p-69f12323.entry.js.map} +0 -0
- /package/dist/twilight/{p-58434030.entry.js.map → p-6c7e91e1.entry.js.map} +0 -0
- /package/dist/twilight/{p-08818bf6.entry.js.map → p-6d0cbbaf.entry.js.map} +0 -0
- /package/dist/twilight/{p-3146a7d0.entry.js.map → p-6ee49c5b.entry.js.map} +0 -0
- /package/dist/twilight/{p-e3599746.system.entry.js.map → p-7d438ff1.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-eae01aed.system.entry.js.map → p-7f79cd75.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-5b4470bf.entry.js.map → p-887601b7.entry.js.map} +0 -0
- /package/dist/twilight/{p-bd43fadf.entry.js.map → p-88b4dd5f.entry.js.map} +0 -0
- /package/dist/twilight/{p-7f59cd9f.system.entry.js.map → p-8cfdf2b6.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-d55dc6ed.entry.js.map → p-8ed8db80.entry.js.map} +0 -0
- /package/dist/twilight/{p-653e7373.system.entry.js.map → p-8fc86179.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-fa8949b0.entry.js.map → p-97c4bb25.entry.js.map} +0 -0
- /package/dist/twilight/{p-e0208463.entry.js.map → p-99e29723.entry.js.map} +0 -0
- /package/dist/twilight/{p-3dff2f76.system.entry.js.map → p-99f7a496.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-aa5a65e7.entry.js.map → p-9cf6352b.entry.js.map} +0 -0
- /package/dist/twilight/{p-84d97c1a.system.entry.js.map → p-9e0f4279.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-b25f5986.system.entry.js.map → p-a8640b04.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-8ddfc931.system.entry.js.map → p-acb9d776.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-93f3da8e.entry.js.map → p-c09f43d3.entry.js.map} +0 -0
- /package/dist/twilight/{p-2c157399.system.entry.js.map → p-c130265a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9d92395a.system.entry.js.map → p-c1b001c4.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9e8b0157.entry.js.map → p-c3e1063f.entry.js.map} +0 -0
- /package/dist/twilight/{p-0747bd06.system.entry.js.map → p-c50fc635.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-63e2d5c7.system.entry.js.map → p-c84e4d50.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-1bd8a562.system.entry.js.map → p-cfe6ae96.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-28af21d8.system.entry.js.map → p-d26748a6.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4d349075.system.entry.js.map → p-d55ee175.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-63446264.entry.js.map → p-d5db9404.entry.js.map} +0 -0
- /package/dist/twilight/{p-5ed120d8.system.entry.js.map → p-dbc0e68a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-c5e1d754.entry.js.map → p-dc44cedb.entry.js.map} +0 -0
- /package/dist/twilight/{p-93588cb9.system.entry.js.map → p-e51e9d9c.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-b5d9c8b5.entry.js.map → p-e9fd3384.entry.js.map} +0 -0
- /package/dist/twilight/{p-c72bc57b.entry.js.map → p-ea054cd3.entry.js.map} +0 -0
- /package/dist/twilight/{p-cb64785d.entry.js.map → p-f879f1a9.entry.js.map} +0 -0
- /package/dist/twilight/{p-8f8b11d5.entry.js.map → p-f8cf7424.entry.js.map} +0 -0
- /package/dist/twilight/{p-85b5bc6a.system.entry.js.map → p-fa2c92fc.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-5b0cef47.entry.js.map → p-fd470a27.entry.js.map} +0 -0
- /package/dist/twilight/{p-a2935615.entry.js.map → p-ff6bf70d.entry.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(e,t,n,i){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i["throw"](e))}catch(e){s(e)}}function c(e){e.done?n(e.value):a(e.value).then(r,o)}c((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,a,s,r;return r={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function o(e){return function(t){return c([e,t])}}function c(o){if(i)throw new TypeError("Generator is already executing.");while(r&&(r=0,o[0]&&(n=0)),n)try{if(i=1,a&&(s=o[0]&2?a["return"]:o[0]?a["throw"]||((s=a["return"])&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;if(a=0,s)o=[o[0]&2,s.value];switch(o[0]){case 0:case 1:s=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;a=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(s=n.trys,s=s.length>0&&s[s.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!s||o[1]>s[0]&&o[1]<s[3])){n.label=o[1];break}if(o[0]===6&&n.label<s[1]){n.label=s[1];s=o;break}if(s&&n.label<s[2]){n.label=s[2];n.ops.push(o);break}if(s[2])n.ops.pop();n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e];a=0}finally{i=s=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-By0rW4rq.system.js"],(function(e){"use strict";var t,n,i,a,s;return{setters:[function(e){t=e.r;n=e.c;i=e.h;a=e.H;s=e.g}],execute:function(){var r='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>calendar-time</title>\n<path d="M22.667 17.333c-0.737 0-1.333 0.596-1.333 1.333v2.667h-2.667c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h4c0.737 0 1.333-0.596 1.333-1.333v-4c0-0.737-0.596-1.333-1.333-1.333zM28 2.667h-2.667v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h5.363c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-5.363c-0.736 0-1.333-0.597-1.333-1.333v-21.333c0-0.736 0.597-1.333 1.333-1.333h2.667v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333v2.696c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.696c0-2.205-1.795-4-4-4zM22 12c-5.515 0-10 4.485-10 10s4.485 10 10 10 10-4.485 10-10-4.485-10-10-10zM22 29.333c-4.043 0-7.333-3.291-7.333-7.333s3.291-7.333 7.333-7.333 7.333 3.291 7.333 7.333-3.291 7.333-7.333 7.333z"></path>\n</svg>\n';var o='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>calendar</title>\n<path d="M28 2.667h-2.667v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-21.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.599 1.333-1.333 1.333h-24c-0.736 0-1.333-0.599-1.333-1.333v-13.333h26.667zM29.333 12h-26.667v-5.333c0-0.736 0.599-1.333 1.333-1.333h2.667v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n';var c='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>time</title>\n<path d="M16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333zM16 8c-0.736 0-1.333 0.596-1.333 1.333v6.667h-4c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h5.333c0.736 0 1.333-0.596 1.333-1.333v-8c0-0.737-0.597-1.333-1.333-1.333z"></path>\n</svg>\n';var l=":host{display:block}";var u=e("salla_booking_field",function(){function e(e){var i=this;t(this,e);this.invalidInput=n(this,"invalidInput");this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment","حجز موعد");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment","تعديل الموعد");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully","تمت اضافة الموعد بنجاح");this.selectDate=salla.lang.get("pages.cart.select_appointment_date","حدد تاريخ الموعد");this.bookingUrl="";this.iframeReady=false;this.reservations=[];salla.lang.onLoaded((function(){return i.setTranslations()}));Salla.event.on("booking::open",(function(e){return i.handleBookingOpen(e)}))}e.prototype.setTranslations=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=function(e,t,n){return new Promise((function(i){salla.helpers.setNested(salla.lang.messages[e],t,n);i(true)}))};return[4,e("ar.trans","pages.cart.book_an_appointment","حجز موعد")];case 1:t.sent();return[4,e("en.trans","pages.cart.book_an_appointment","Book an Appointment")];case 2:t.sent();return[4,e("ar.trans","pages.cart.edit_an_appointment","تعديل الموعد")];case 3:t.sent();return[4,e("en.trans","pages.cart.edit_an_appointment","Edit an Appointment")];case 4:t.sent();return[4,e("ar.trans","pages.cart.booked_successfully","تمت اضافة الموعد بنجاح")];case 5:t.sent();return[4,e("en.trans","pages.cart.booked_successfully","Booked Successfully")];case 6:t.sent();return[4,e("ar.trans","pages.cart.select_appointment_date","حدد تاريخ الموعد")];case 7:t.sent();return[4,e("en.trans","pages.cart.select_appointment_date","Select appointment date")];case 8:t.sent();this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully");this.selectDate=salla.lang.get("pages.cart.select_appointment_date");return[2]}}))}))};e.prototype.openBookingModal=function(e,t){var n=this;if(t===void 0){t=false}if(t&&(!e.detail||typeof e.detail!=="number"||e.detail!==this.productId)){return}if(salla.config.isGuest()){this.setAfterReloadEvent("booking::open-after-reload",this.productId);salla.event.dispatch("login::open");return}salla.booking.add(this.productId,false).then((function(e){if(e.data.redirect.to!=="booking"){throw new Error("Unexpected redirect!")}salla.event.dispatch("booking::open",{url:e.data.redirect.url,id:n.productId})})).catch((function(e){salla.error(salla.lang.get("common.errors.error_occurred"));salla.logger.error(e.response||e)}))};e.prototype.handleBookingOpen=function(e){var t=this;if(e.id!==this.productId)return;this.bookingUrl=salla.url.addParamToUrl("product_id",e.id,e.url);this.iframeReady=true;setTimeout((function(){t.modal.setTitle(t.selectDate);t.modal.open()}),100)};e.prototype.setAfterReloadEvent=function(e,t){salla.storage.set("afterReloadEvent",{event:e,payload:t})};e.prototype.emitAfterReloadEvent=function(){var e=salla.storage.get("afterReloadEvent");if(e&&e.event){var t=new CustomEvent(e.event,{detail:e.payload});window.dispatchEvent(t);salla.storage.remove("afterReloadEvent")}};e.prototype.componentWillLoad=function(){if(this.option&&this.option.details.length){this.reservations=this.option.details}};e.prototype.componentDidLoad=function(){var e=this;window.addEventListener("booking::open-after-reload",(function(t){return e.openBookingModal(t,true)}));this.emitAfterReloadEvent();window.addEventListener("message",this.handleMessageEvent.bind(this));this.reservationsInput.addEventListener("invalid",(function(t){return e.invalidInput.emit(t)}));this.reservationsInput.addEventListener("input",(function(){e.reservationsInput.setCustomValidity("");e.reservationsInput.reportValidity()}))};e.prototype.handleMessageEvent=function(e){var t,n;if(e.data.source!=="booking")return;var i=e.data.type;var a=e.data.message;if(localStorage.getItem("debug"))console.log("Received an action:".concat(i),e.data);if(i==="error"){if((t=a.fields)===null||t===void 0?void 0:t.reservation){salla.notify.error(a.fields.reservation[0]);return}var s=Object.values(a.fields||[a.message]).flat().map((function(e){return"<li>".concat(e,"</li>")})).join("");salla.notify.error("<ul>".concat(s,"</ul>"))}if(i==="success"){if(Number(a.productId)!==Number(this.productId))return;this.reservations=a.data.reservations.map((function(e){if(e.time&&e.time.length>0){var t=e.time[0];return{date:e.date,day:e.day,from_timestamp:t.from,to_timestamp:t.to}}return null})).filter((function(e){return e!==null}));salla.notify.success(this.bookedLabel);(n=this.modal)===null||n===void 0?void 0:n.close();setTimeout((function(){return window.location.reload()}))}if(i==="height"){this.iframe.height=(a===null||a===void 0?void 0:a.height)+"px"}};e.prototype.bookingModal=function(){var e=this;return i("salla-modal",{class:"s-booking-field-modal",ref:function(t){return e.modal=t},width:"md",position:"middle",noPadding:true},i("iframe",{ref:function(t){return e.iframe=t},src:this.bookingUrl,frameborder:"0"}))};e.prototype.renderReservationDate=function(e){return i("span",{class:e.from_timestamp?"s-booking-field-reservations-has-time":""},i("i",{class:"s-booking-field-reservations-icon",innerHTML:o}),e.date)};e.prototype.renderReservationTime=function(e){if(!e.from_timestamp)return"";return i("span",{class:"s-booking-field-reservations-time"},i("i",{class:"s-booking-field-reservations-icon",innerHTML:c}),i("span",null,e.from_timestamp," - ",e.to_timestamp))};e.prototype.render=function(){var e=this;return i(a,{key:"56540a5278d395485a411e712929f32cf76f637e"},i("div",{key:"63673b28b671596d47f4f014223e9c5012f3b671",class:"s-booking-field-main"},this.option.required||this.reservations.length>0?i("div",{class:"s-booking-field-price"},i("span",{innerHTML:salla.money(this.option.price)})):"",i("salla-button",{key:"6d9ffa722391aa0234454fe9ddc90f3477268489",class:"s-booking-field-book-now",size:"small",loaderPosition:"center",fill:"outline",onClick:function(t){return e.openBookingModal(t,false)}},i("span",{key:"dcc8a2b68be4596199e7c776f4501764fd25523f",class:"s-booking-field-book-now-content"},i("span",{key:"b4b2eaf369a5fa822c84b376808c7ee16d8d2598",innerHTML:r}),this.reservations.length?this.editLabel:this.bookNowLabel))),this.reservations.length>0&&i("div",{key:"2684b88bdaf47133dbcaaf6c96f1b81d4ee7ca70",class:"s-booking-field-reservations"},this.reservations.map((function(t,n){return i("div",{key:n,class:"s-booking-field-reservations-item"},e.renderReservationDate(t),e.renderReservationTime(t))}))),i("input",{key:"3d20fcb5fbca8a9e340344d41c316619aec03050",class:"s-hidden",name:this.option.name,required:this.option.required,value:JSON.stringify(this.reservations)==="[]"?"":JSON.stringify(this.reservations),ref:function(t){return e.reservationsInput=t}}),this.iframeReady&&this.bookingModal())};Object.defineProperty(e.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());u.style=l;var f=e("salla_conditional_fields",function(){function e(e){t(this,e)}e.prototype.hideAllOptions=function(e){var t=this;this.host.querySelectorAll('[data-show-when^="options['.concat(e,'"]')).forEach((function(e){e.classList.add("hidden");t.hideAllOptions(e.dataset.optionId);t.disableInputs(e)}))};e.prototype.disableInputs=function(e){e.querySelectorAll("[name]").forEach((function(e){var t;e.setAttribute("disabled","");e.removeAttribute("required");if(((t=e===null||e===void 0?void 0:e.tagName)===null||t===void 0?void 0:t.toLowerCase())==="select"){e.value=""}if(["checkbox"].includes(e.getAttribute("type"))&&e.hasOwnProperty("checked")){e.checked=false}}))};e.prototype.changeHandler=function(e){var t=this;var n;salla.event.emit("salla-onditional-fields::change",e);salla.log("Received the change event: ",e);if(!e.target||!["SELECT"].includes(e.target.tagName)&&!["checkbox","radio"].includes(e.target.getAttribute("type"))){salla.log("Ignore the change because is not a supported input: "+(((n=e===null||e===void 0?void 0:e.target)===null||n===void 0?void 0:n.tagName)||"N/A"));return}var i=e.target.name.replace("[]","");var a=e.target.getAttribute("type")==="checkbox";var s=e.target.getAttribute("type")==="radio";salla.log("Trying to find all elements with condition:",'[data-show-when^="'.concat(i,'"]'));this.host.querySelectorAll('[data-show-when^="'.concat(i,'"]')).forEach((function(n){var i=!(n===null||n===void 0?void 0:n.dataset.showWhen.includes("!="));var r=n===null||n===void 0?void 0:n.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();var o;if(a){var c=Array.from(t.host.querySelectorAll('input[name="'.concat(e.target.name,'"]:checked')),(function(e){return e===null||e===void 0?void 0:e.value}));o=c.includes(r.toString())}else if(s){o=e.target.checked&&e.target.value===r}else{o=r===e.target.value}salla.log("The input is ",a?"Multiple":s?"Radio":"Single"," value:",o);var l=i&&o||!i&&!o;if(l){n.classList.remove("hidden");n.querySelectorAll("[name]").forEach((function(e){e.removeAttribute("disabled");var t=e.closest(".s-product-options-option");if(t.dataset.optionRequired==="true"){e.setAttribute("required","")}if(e.getAttribute("type")==="checkbox"){var n=Array.from(document.querySelectorAll('input[type="checkbox"][name="'.concat(e.getAttribute("name"),'"]')));var i=n.some((function(e){return e.checked}));if(i){n.forEach((function(e){e.removeAttribute("required")}))}}}))}else{t.hideAllOptions(n.dataset.optionId);n.classList.add("hidden");t.disableInputs(n)}}))};e.prototype.componentDidRender=function(){var e=this;this.host.querySelectorAll("[data-show-when]").forEach((function(t){var n;var i=(n=t===null||t===void 0?void 0:t.dataset)===null||n===void 0?void 0:n.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();if(!i){return}e.changeHandler({target:e.host.querySelector('[name^="'+i+'"]')})}))};e.prototype.render=function(){return i(a,{key:"aed72d12357c54338c231d5d4c259a510f8b4e95"},i("slot",{key:"84c5af881a45cee9fa71f5e2e63ee9b92aad76c9"}))};Object.defineProperty(e.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return e}())}}}));
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-B6dZG1Ey.system.js"],(function(e){"use strict";var t,n,i,a,s;return{setters:[function(e){t=e.r;n=e.c;i=e.h;a=e.H;s=e.g}],execute:function(){var r='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>calendar-time</title>\n<path d="M22.667 17.333c-0.737 0-1.333 0.596-1.333 1.333v2.667h-2.667c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h4c0.737 0 1.333-0.596 1.333-1.333v-4c0-0.737-0.596-1.333-1.333-1.333zM28 2.667h-2.667v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h5.363c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-5.363c-0.736 0-1.333-0.597-1.333-1.333v-21.333c0-0.736 0.597-1.333 1.333-1.333h2.667v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333v2.696c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.696c0-2.205-1.795-4-4-4zM22 12c-5.515 0-10 4.485-10 10s4.485 10 10 10 10-4.485 10-10-4.485-10-10-10zM22 29.333c-4.043 0-7.333-3.291-7.333-7.333s3.291-7.333 7.333-7.333 7.333 3.291 7.333 7.333-3.291 7.333-7.333 7.333z"></path>\n</svg>\n';var o='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>calendar</title>\n<path d="M28 2.667h-2.667v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-21.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.599 1.333-1.333 1.333h-24c-0.736 0-1.333-0.599-1.333-1.333v-13.333h26.667zM29.333 12h-26.667v-5.333c0-0.736 0.599-1.333 1.333-1.333h2.667v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n';var c='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>time</title>\n<path d="M16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333zM16 8c-0.736 0-1.333 0.596-1.333 1.333v6.667h-4c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h5.333c0.736 0 1.333-0.596 1.333-1.333v-8c0-0.737-0.597-1.333-1.333-1.333z"></path>\n</svg>\n';var l=":host{display:block}";var u=e("salla_booking_field",function(){function e(e){var i=this;t(this,e);this.invalidInput=n(this,"invalidInput");this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment","حجز موعد");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment","تعديل الموعد");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully","تمت اضافة الموعد بنجاح");this.selectDate=salla.lang.get("pages.cart.select_appointment_date","حدد تاريخ الموعد");this.bookingUrl="";this.iframeReady=false;this.reservations=[];salla.lang.onLoaded((function(){return i.setTranslations()}));Salla.event.on("booking::open",(function(e){return i.handleBookingOpen(e)}))}e.prototype.setTranslations=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=function(e,t,n){return new Promise((function(i){salla.helpers.setNested(salla.lang.messages[e],t,n);i(true)}))};return[4,e("ar.trans","pages.cart.book_an_appointment","حجز موعد")];case 1:t.sent();return[4,e("en.trans","pages.cart.book_an_appointment","Book an Appointment")];case 2:t.sent();return[4,e("ar.trans","pages.cart.edit_an_appointment","تعديل الموعد")];case 3:t.sent();return[4,e("en.trans","pages.cart.edit_an_appointment","Edit an Appointment")];case 4:t.sent();return[4,e("ar.trans","pages.cart.booked_successfully","تمت اضافة الموعد بنجاح")];case 5:t.sent();return[4,e("en.trans","pages.cart.booked_successfully","Booked Successfully")];case 6:t.sent();return[4,e("ar.trans","pages.cart.select_appointment_date","حدد تاريخ الموعد")];case 7:t.sent();return[4,e("en.trans","pages.cart.select_appointment_date","Select appointment date")];case 8:t.sent();this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully");this.selectDate=salla.lang.get("pages.cart.select_appointment_date");return[2]}}))}))};e.prototype.openBookingModal=function(e,t){var n=this;if(t===void 0){t=false}if(t&&(!e.detail||typeof e.detail!=="number"||e.detail!==this.productId)){return}if(salla.config.isGuest()){this.setAfterReloadEvent("booking::open-after-reload",this.productId);salla.event.dispatch("login::open");return}salla.booking.add(this.productId,false).then((function(e){if(e.data.redirect.to!=="booking"){throw new Error("Unexpected redirect!")}salla.event.dispatch("booking::open",{url:e.data.redirect.url,id:n.productId})})).catch((function(e){salla.error(salla.lang.get("common.errors.error_occurred"));salla.logger.error(e.response||e)}))};e.prototype.handleBookingOpen=function(e){var t=this;if(e.id!==this.productId)return;this.bookingUrl=salla.url.addParamToUrl("product_id",e.id,e.url);this.iframeReady=true;setTimeout((function(){t.modal.setTitle(t.selectDate);t.modal.open()}),100)};e.prototype.setAfterReloadEvent=function(e,t){salla.storage.set("afterReloadEvent",{event:e,payload:t})};e.prototype.emitAfterReloadEvent=function(){var e=salla.storage.get("afterReloadEvent");if(e&&e.event){var t=new CustomEvent(e.event,{detail:e.payload});window.dispatchEvent(t);salla.storage.remove("afterReloadEvent")}};e.prototype.componentWillLoad=function(){if(this.option&&this.option.details.length){this.reservations=this.option.details}};e.prototype.componentDidLoad=function(){var e=this;window.addEventListener("booking::open-after-reload",(function(t){return e.openBookingModal(t,true)}));this.emitAfterReloadEvent();window.addEventListener("message",this.handleMessageEvent.bind(this));this.reservationsInput.addEventListener("invalid",(function(t){return e.invalidInput.emit(t)}));this.reservationsInput.addEventListener("input",(function(){e.reservationsInput.setCustomValidity("");e.reservationsInput.reportValidity()}))};e.prototype.handleMessageEvent=function(e){var t,n;if(e.data.source!=="booking")return;var i=e.data.type;var a=e.data.message;if(localStorage.getItem("debug"))console.log("Received an action:".concat(i),e.data);if(i==="error"){if((t=a.fields)===null||t===void 0?void 0:t.reservation){salla.notify.error(a.fields.reservation[0]);return}var s=Object.values(a.fields||[a.message]).flat().map((function(e){return"<li>".concat(e,"</li>")})).join("");salla.notify.error("<ul>".concat(s,"</ul>"))}if(i==="success"){if(Number(a.productId)!==Number(this.productId))return;this.reservations=a.data.reservations.map((function(e){if(e.time&&e.time.length>0){var t=e.time[0];return{date:e.date,day:e.day,from_timestamp:t.from,to_timestamp:t.to}}return null})).filter((function(e){return e!==null}));salla.notify.success(this.bookedLabel);(n=this.modal)===null||n===void 0?void 0:n.close();setTimeout((function(){return window.location.reload()}))}if(i==="height"){this.iframe.height=(a===null||a===void 0?void 0:a.height)+"px"}};e.prototype.bookingModal=function(){var e=this;return i("salla-modal",{class:"s-booking-field-modal",ref:function(t){return e.modal=t},width:"md",position:"middle",noPadding:true},i("iframe",{ref:function(t){return e.iframe=t},src:this.bookingUrl,frameborder:"0"}))};e.prototype.renderReservationDate=function(e){return i("span",{class:e.from_timestamp?"s-booking-field-reservations-has-time":""},i("i",{class:"s-booking-field-reservations-icon",innerHTML:o}),e.date)};e.prototype.renderReservationTime=function(e){if(!e.from_timestamp)return"";return i("span",{class:"s-booking-field-reservations-time"},i("i",{class:"s-booking-field-reservations-icon",innerHTML:c}),i("span",null,e.from_timestamp," - ",e.to_timestamp))};e.prototype.render=function(){var e=this;return i(a,{key:"56540a5278d395485a411e712929f32cf76f637e"},i("div",{key:"63673b28b671596d47f4f014223e9c5012f3b671",class:"s-booking-field-main"},this.option.required||this.reservations.length>0?i("div",{class:"s-booking-field-price"},i("span",{innerHTML:salla.money(this.option.price)})):"",i("salla-button",{key:"6d9ffa722391aa0234454fe9ddc90f3477268489",class:"s-booking-field-book-now",size:"small",loaderPosition:"center",fill:"outline",onClick:function(t){return e.openBookingModal(t,false)}},i("span",{key:"dcc8a2b68be4596199e7c776f4501764fd25523f",class:"s-booking-field-book-now-content"},i("span",{key:"b4b2eaf369a5fa822c84b376808c7ee16d8d2598",innerHTML:r}),this.reservations.length?this.editLabel:this.bookNowLabel))),this.reservations.length>0&&i("div",{key:"2684b88bdaf47133dbcaaf6c96f1b81d4ee7ca70",class:"s-booking-field-reservations"},this.reservations.map((function(t,n){return i("div",{key:n,class:"s-booking-field-reservations-item"},e.renderReservationDate(t),e.renderReservationTime(t))}))),i("input",{key:"3d20fcb5fbca8a9e340344d41c316619aec03050",class:"s-hidden",name:this.option.name,required:this.option.required,value:JSON.stringify(this.reservations)==="[]"?"":JSON.stringify(this.reservations),ref:function(t){return e.reservationsInput=t}}),this.iframeReady&&this.bookingModal())};Object.defineProperty(e.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());u.style=l;var f=e("salla_conditional_fields",function(){function e(e){t(this,e)}e.prototype.hideAllOptions=function(e){var t=this;this.host.querySelectorAll('[data-show-when^="options['.concat(e,'"]')).forEach((function(e){e.classList.add("hidden");t.hideAllOptions(e.dataset.optionId);t.disableInputs(e)}))};e.prototype.disableInputs=function(e){e.querySelectorAll("[name]").forEach((function(e){var t;e.setAttribute("disabled","");e.removeAttribute("required");if(((t=e===null||e===void 0?void 0:e.tagName)===null||t===void 0?void 0:t.toLowerCase())==="select"){e.value=""}if(["checkbox"].includes(e.getAttribute("type"))&&e.hasOwnProperty("checked")){e.checked=false}}))};e.prototype.changeHandler=function(e){var t=this;var n;salla.event.emit("salla-onditional-fields::change",e);salla.log("Received the change event: ",e);if(!e.target||!["SELECT"].includes(e.target.tagName)&&!["checkbox","radio"].includes(e.target.getAttribute("type"))){salla.log("Ignore the change because is not a supported input: "+(((n=e===null||e===void 0?void 0:e.target)===null||n===void 0?void 0:n.tagName)||"N/A"));return}var i=e.target.name.replace("[]","");var a=e.target.getAttribute("type")==="checkbox";var s=e.target.getAttribute("type")==="radio";salla.log("Trying to find all elements with condition:",'[data-show-when^="'.concat(i,'"]'));this.host.querySelectorAll('[data-show-when^="'.concat(i,'"]')).forEach((function(n){var i=!(n===null||n===void 0?void 0:n.dataset.showWhen.includes("!="));var r=n===null||n===void 0?void 0:n.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();var o;if(a){var c=Array.from(t.host.querySelectorAll('input[name="'.concat(e.target.name,'"]:checked')),(function(e){return e===null||e===void 0?void 0:e.value}));o=c.includes(r.toString())}else if(s){o=e.target.checked&&e.target.value===r}else{o=r===e.target.value}salla.log("The input is ",a?"Multiple":s?"Radio":"Single"," value:",o);var l=i&&o||!i&&!o;if(l){n.classList.remove("hidden");n.querySelectorAll("[name]").forEach((function(e){e.removeAttribute("disabled");var t=e.closest(".s-product-options-option");if(t.dataset.optionRequired==="true"){e.setAttribute("required","")}if(e.getAttribute("type")==="checkbox"){var n=Array.from(document.querySelectorAll('input[type="checkbox"][name="'.concat(e.getAttribute("name"),'"]')));var i=n.some((function(e){return e.checked}));if(i){n.forEach((function(e){e.removeAttribute("required")}))}}}))}else{t.hideAllOptions(n.dataset.optionId);n.classList.add("hidden");t.disableInputs(n)}}))};e.prototype.componentDidRender=function(){var e=this;this.host.querySelectorAll("[data-show-when]").forEach((function(t){var n;var i=(n=t===null||t===void 0?void 0:t.dataset)===null||n===void 0?void 0:n.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();if(!i){return}e.changeHandler({target:e.host.querySelector('[name^="'+i+'"]')})}))};e.prototype.render=function(){return i(a,{key:"aed72d12357c54338c231d5d4c259a510f8b4e95"},i("slot",{key:"84c5af881a45cee9fa71f5e2e63ee9b92aad76c9"}))};Object.defineProperty(e.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return e}())}}}));
|
|
5
|
+
//# sourceMappingURL=p-1b569b10.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(i,t,e,n){function r(i){return i instanceof e?i:new e((function(t){t(i)}))}return new(e||(e=Promise))((function(e,s){function a(i){try{u(n.next(i))}catch(i){s(i)}}function o(i){try{u(n["throw"](i))}catch(i){s(i)}}function u(i){i.done?e(i.value):r(i.value).then(a,o)}u((n=n.apply(i,t||[])).next())}))};var __generator=this&&this.__generator||function(i,t){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,r,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(i){return function(t){return u([i,t])}}function u(o){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,o[0]&&(e=0)),e)try{if(n=1,r&&(s=o[0]&2?r["return"]:o[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,o[1])).done)return s;if(r=0,s)o=[o[0]&2,s.value];switch(o[0]){case 0:case 1:s=o;break;case 4:e.label++;return{value:o[1],done:false};case 5:e.label++;r=o[1];o=[0];continue;case 7:o=e.ops.pop();e.trys.pop();continue;default:if(!(s=e.trys,s=s.length>0&&s[s.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!s||o[1]>s[0]&&o[1]<s[3])){e.label=o[1];break}if(o[0]===6&&e.label<s[1]){e.label=s[1];s=o;break}if(s&&e.label<s[2]){e.label=s[2];e.ops.push(o);break}if(s[2])e.ops.pop();e.trys.pop();continue}o=t.call(i,e)}catch(i){o=[6,i];r=0}finally{n=s=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-B6dZG1Ey.system.js","./p-Dxc5oJG6.system.js"],(function(i){"use strict";var t,e,n,r;return{setters:[function(i){t=i.r;e=i.h;n=i.g},function(i){r=i.I}],execute:function(){var s=' <svg width="18" height="17" view-box="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9.00045 13.6951L3.71036 16.6563L4.89186 10.71L0.440918 6.59397L6.4612 5.88017L9.00045 0.375122L11.5396 5.88017L17.5599 6.59397L13.109 10.71L14.2905 16.6563L9.00045 13.6951Z" fill="currentcolor" />\n</svg>';var a=' <svg width="18" height="17" view-box="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9.00045 13.6951L3.71036 16.6563L4.89186 10.71L0.440918 6.59397L6.4612 5.88017L9.00045 0.375122L11.5396 5.88017L17.5599 6.59397L13.109 10.71L14.2905 16.6563L9.00045 13.6951Z" fill="#DDDDDD" />\n</svg>';var o=' <svg width="12" height="17" view-box="0 0 12 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6 16.2501C9.10658 16.2501 11.625 13.7317 11.625 10.6251C11.625 9.976 11.4523 9.35252 11.25 8.77232C9.99998 10.0075 9.05002 10.6251 8.4 10.6251C11.3966 5.37512 9.75 3.12512 5.25 0.125122C5.625 3.87475 3.15302 5.58043 2.14634 6.52757C1.0559 7.5535 0.375 9.00977 0.375 10.6251C0.375 13.7317 2.89339 16.2501 6 16.2501ZM6.53205 2.92636C8.96333 4.98908 8.97495 6.59185 7.09725 9.88157C6.5265 10.8815 7.2486 12.1251 8.4 12.1251C8.9163 12.1251 9.43807 11.9745 9.98917 11.6789C9.52342 13.4466 7.91393 14.7501 6 14.7501C3.72182 14.7501 1.875 12.9033 1.875 10.6251C1.875 9.47072 2.34959 8.39582 3.17419 7.62002C3.2687 7.53115 3.74812 7.1062 3.76858 7.08782C4.08646 6.8017 4.34835 6.54985 4.60718 6.2727C5.52998 5.28461 6.19283 4.18735 6.53205 2.92636Z" fill="currentcolor" />\n </svg>';var u=":host{display:block}";var l=i("salla_review_card",function(){function i(i){var e=this;t(this,i);this.currentSlide=0;this.showPurchaseCount=false;this.startPoint={x:0,y:0};this.isSwiping=false;this.isRTL="rtl";this.handlePointerDown=function(i){var t;if(!i.isPrimary)return;(t=e.sliderElement)===null||t===void 0?void 0:t.setPointerCapture(i.pointerId);e.startSwipe(i.clientX,i.clientY);i.preventDefault()};this.handlePointerMove=function(i){if(!e.isSwiping||!i.isPrimary)return;i.preventDefault()};this.handlePointerUp=function(i){var t;if(!e.isSwiping||!i.isPrimary)return;(t=e.sliderElement)===null||t===void 0?void 0:t.releasePointerCapture(i.pointerId);e.endSwipe(i.clientX,i.clientY)};this.handlePointerCancel=function(i){var t;if(!e.isSwiping||!i.isPrimary)return;(t=e.sliderElement)===null||t===void 0?void 0:t.releasePointerCapture(i.pointerId);e.isSwiping=false};this.goToSlide=function(i){e.currentSlide=Math.max(0,Math.min(i,e.images.length-1))}}i.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var i,t;return __generator(this,(function(e){switch(e.label){case 0:return[4,salla.onReady()];case 1:e.sent();this.showPurchaseCount=!!salla.config.get("store.settings.product.total_sold_enabled",false);this.isRTL=salla.config.get("theme.is_rtl",true);this.purchasedCount=salla.lang.getWithDefault("blocks.home.reviews.purchased_count",this.isRTL?" تم شراءه ".concat((i=this.review.product)===null||i===void 0?void 0:i.sold_quantity," مرة"):"Purchased ".concat(this.review.product.sold_quantity," times"),{count:(t=this.review.product)===null||t===void 0?void 0:t.sold_quantity});this.initializeSlider();return[2]}}))}))};i.prototype.disconnectedCallback=function(){this.removeEventListeners()};Object.defineProperty(i.prototype,"images",{get:function(){var i,t;var e=this.review;return((i=e===null||e===void 0?void 0:e.images)===null||i===void 0?void 0:i.length)>1?e.images.map((function(i,t){return{url:i,alt:"",id:t}})):((t=e===null||e===void 0?void 0:e.product)===null||t===void 0?void 0:t.images)||[]},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"hasMultipleImages",{get:function(){return this.images.length>1},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"slideTransform",{get:function(){var i=this.isRTL?1:-1;return"translateX(".concat(this.currentSlide*100*i,"%)")},enumerable:false,configurable:true});i.prototype.initializeSlider=function(){if(!this.hasMultipleImages)return;this.sliderElement=this.el.querySelector(".s-review-card-slider-container");if(!this.sliderElement)return;this.sliderElement.style.touchAction="pan-y pinch-zoom";this.addEventListeners()};i.prototype.addEventListeners=function(){if(!this.sliderElement)return;this.sliderElement.addEventListener("pointerdown",this.handlePointerDown,{passive:false});this.sliderElement.addEventListener("pointermove",this.handlePointerMove,{passive:false});this.sliderElement.addEventListener("pointerup",this.handlePointerUp,{passive:true});this.sliderElement.addEventListener("pointercancel",this.handlePointerCancel,{passive:true})};i.prototype.removeEventListeners=function(){if(!this.sliderElement)return;this.sliderElement.removeEventListener("pointerdown",this.handlePointerDown);this.sliderElement.removeEventListener("pointermove",this.handlePointerMove);this.sliderElement.removeEventListener("pointerup",this.handlePointerUp);this.sliderElement.removeEventListener("pointercancel",this.handlePointerCancel)};i.prototype.startSwipe=function(i,t){this.startPoint={x:i,y:t};this.isSwiping=true};i.prototype.componentDidRender=function(){this.removeEventListeners();this.addEventListeners()};i.prototype.endSwipe=function(i,t){this.isSwiping=false;var e=i-this.startPoint.x;var n=t-this.startPoint.y;this.processSwipe(e,n)};i.prototype.processSwipe=function(i,t){var e=10;if(Math.abs(i)<e||Math.abs(t)>Math.abs(i))return;var n=i<0;var r=this.isRTL?!n:n;if(r){this.goToNextSlide()}else{this.goToPrevSlide()}};i.prototype.goToNextSlide=function(){if(this.currentSlide<this.images.length-1){this.currentSlide++}};i.prototype.goToPrevSlide=function(){if(this.currentSlide>0){this.currentSlide--}};i.prototype.renderStars=function(){var i=this;return Array(5).fill(null).map((function(t,n){return e("span",{key:n,innerHTML:i.review.stars>=n+1?s:a})}))};i.prototype.renderDots=function(){var i=this;return this.images.map((function(t,n){var r=t.url;return e("button",{key:r||n,type:"button",class:"s-review-card-slider-dot ".concat(i.currentSlide===n?"active":""),onClick:function(){return i.goToSlide(n)},"aria-label":"Go to slide ".concat(n+1),onPointerDown:function(){return i.goToSlide(n)}})}))};i.prototype.renderSlider=function(){if(!this.hasMultipleImages)return null;return e("div",{class:"s-review-card-slider-container"},e("div",{class:"s-review-card-slides",style:{transform:this.slideTransform}},this.images.map((function(i){return e("div",{key:i===null||i===void 0?void 0:i.id,class:"s-review-card-slider-slide"},e("img",{src:i.url,alt:i.alt||"Product image",width:275,height:275,loading:"lazy",draggable:false}))}))),e("div",{class:"s-review-card-slider-dots"},this.renderDots()))};i.prototype.renderSingleImage=function(){var i,t;var n=(t=(i=this.review)===null||i===void 0?void 0:i.product)===null||t===void 0?void 0:t.image;if(!n||this.hasMultipleImages)return null;return e("img",{src:n.url,alt:n.alt||"Product image",class:"s-review-card-image",width:275,height:275,loading:"lazy",decoding:"async",draggable:false})};i.prototype.renderHeader=function(){var i,t;return e("div",{class:"s-review-card-header"},e("div",{class:"s-review-card-reviewer-name"},e("p",null,(i=this.review)===null||i===void 0?void 0:i.name),((t=this.review)===null||t===void 0?void 0:t.has_order)&&e("span",{class:"s-review-card-verified-icon",innerHTML:r})),e("div",{class:"s-review-card-stars"},this.renderStars()))};i.prototype.renderProductInfo=function(){var i,t,n,r,s;var a=(i=this.review)===null||i===void 0?void 0:i.product;if(!a)return null;return e("a",{href:(n=(t=this.review)===null||t===void 0?void 0:t.product)===null||n===void 0?void 0:n.url,class:"s-review-card-product-container"},e("img",{alt:((r=a.image)===null||r===void 0?void 0:r.alt)||"Product",src:(s=a.image)===null||s===void 0?void 0:s.url,class:"s-review-card-product-image",width:60,height:60,loading:"lazy",decoding:"async",draggable:false}),e("div",{class:"s-review-card-product-details"},e("p",{class:"s-review-card-product-details-name"},a.name),this.showPurchaseCount?e("p",{class:"s-review-card-product-details-purchase-count"},e("span",{innerHTML:o}),this.purchasedCount):null))};i.prototype.render=function(){var i;return e("div",{key:"8797bb6b8123ab8a8d4536eb990dcde15e1ddd06",class:"s-review-card-container"},this.renderSlider(),this.renderSingleImage(),c(),e("div",{key:"b2b3bdc4e8a63aae9103eca5274003b49d4bf19e",class:"s-review-card-content"},this.renderHeader(),e("p",{key:"0e64b3fe2ae5e59a1899515c04063f74b9828001",class:"s-review-card-review-content",innerHTML:(i=this.review)===null||i===void 0?void 0:i.content}),c(),this.renderProductInfo()))};Object.defineProperty(i.prototype,"el",{get:function(){return n(this)},enumerable:false,configurable:true});return i}());var c=function(i){return e("div",{class:"s-review-card-divider ".concat("")})};l.style=u}}}));
|
|
5
|
+
//# sourceMappingURL=p-1d8bff13.system.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-234psyG4.system.js","sources":["src/components/salla-booking-field/salla-booking-field.scss?tag=salla-booking-field","src/components/salla-booking-field/salla-booking-field.tsx","src/components/salla-conditional-fields/salla-conditional-fields.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, h, Element, State, Event, EventEmitter } from '@stencil/core';\nimport { Option, Reservation } from './interfaces';\nimport BookingTime from '../../assets/svg/calendar-time.svg';\nimport Calendar from '../../assets/svg/calendar.svg';\nimport TimeIcon from '../../assets/svg/time.svg';\n\n@Component({\n tag: 'salla-booking-field',\n styleUrl: 'salla-booking-field.scss',\n})\nexport class SallaBookingField {\n /**\n * The booking option configuration\n */\n @Prop() option: Option;\n /**\n * The ID of the product for which the booking is being made\n */\n @Prop() productId: number;\n @Element() host: HTMLElement;\n @State() bookNowLabel: string = salla.lang.get('pages.cart.book_an_appointment', 'حجز موعد');\n @State() editLabel: string = salla.lang.get('pages.cart.edit_an_appointment', 'تعديل الموعد');\n @State() bookedLabel: string = salla.lang.get('pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');\n @State() selectDate: string = salla.lang.get('pages.cart.select_appointment_date', 'حدد تاريخ الموعد');\n @State() bookingUrl: string = '';\n @State() iframeReady: boolean = false;\n @State() reservations: Reservation[] = [];\n @State() reservationsInput: HTMLInputElement;\n\n /**\n * Event emitted when the input is invalid.\n */\n @Event() invalidInput: EventEmitter<any>;\n\n private modal: HTMLSallaModalElement;\n private iframe: HTMLIFrameElement;\n\n constructor() {\n // Load translations\n salla.lang.onLoaded(() => this.setTranslations());\n // Register event listeners\n Salla.event.on('booking::open', (data) => this.handleBookingOpen(data));\n }\n\n private async setTranslations() {\n const setNestedAsync = (lang, key, value) => {\n return new Promise((resolve) => {\n salla.helpers.setNested(salla.lang.messages[lang], key, value);\n resolve(true);\n });\n };\n\n await setNestedAsync('ar.trans', 'pages.cart.book_an_appointment', 'حجز موعد');\n await setNestedAsync('en.trans', 'pages.cart.book_an_appointment', 'Book an Appointment');\n await setNestedAsync('ar.trans', 'pages.cart.edit_an_appointment', 'تعديل الموعد');\n await setNestedAsync('en.trans', 'pages.cart.edit_an_appointment', 'Edit an Appointment');\n await setNestedAsync('ar.trans', 'pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');\n await setNestedAsync('en.trans', 'pages.cart.booked_successfully', 'Booked Successfully');\n await setNestedAsync('ar.trans', 'pages.cart.select_appointment_date', 'حدد تاريخ الموعد');\n await setNestedAsync('en.trans', 'pages.cart.select_appointment_date', 'Select appointment date');\n\n this.bookNowLabel = salla.lang.get('pages.cart.book_an_appointment');\n this.editLabel = salla.lang.get('pages.cart.edit_an_appointment');\n this.bookedLabel = salla.lang.get('pages.cart.booked_successfully');\n this.selectDate = salla.lang.get('pages.cart.select_appointment_date');\n }\n\n private openBookingModal(event: any, afterReload = false) {\n if (afterReload && (!event.detail || typeof event.detail !== 'number' || event.detail !== this.productId)) {\n return;\n }\n if (salla.config.isGuest()) {\n this.setAfterReloadEvent('booking::open-after-reload', this.productId);\n salla.event.dispatch('login::open');\n return;\n }\n salla.booking.add(this.productId, false)\n .then((resp) => {\n if (resp.data.redirect.to !== 'booking') {\n throw new Error('Unexpected redirect!');\n }\n salla.event.dispatch('booking::open', { url: resp.data.redirect.url, id: this.productId });\n })\n .catch((error) => {\n salla.error(salla.lang.get('common.errors.error_occurred'));\n salla.logger.error(error.response || error);\n });\n }\n\n private handleBookingOpen(data) {\n if (data.id !== this.productId) return;\n this.bookingUrl = salla.url.addParamToUrl('product_id', data.id, data.url);\n this.iframeReady = true;\n setTimeout(() => {\n this.modal.setTitle(this.selectDate);\n this.modal.open();\n }, 100);\n }\n\n private setAfterReloadEvent(event, payload) {\n salla.storage.set('afterReloadEvent', { event, payload });\n }\n\n private emitAfterReloadEvent() {\n const eventDetails = salla.storage.get('afterReloadEvent');\n if (eventDetails && eventDetails.event) {\n const customEvent = new CustomEvent(eventDetails.event, {\n detail: eventDetails.payload\n });\n window.dispatchEvent(customEvent)\n salla.storage.remove('afterReloadEvent');\n }\n }\n\n componentWillLoad() {\n if (this.option && this.option.details.length) {\n this.reservations = this.option.details;\n }\n }\n\n componentDidLoad() {\n window.addEventListener('booking::open-after-reload', (event) => this.openBookingModal(event, true));\n this.emitAfterReloadEvent();\n window.addEventListener('message', this.handleMessageEvent.bind(this));\n this.reservationsInput.addEventListener('invalid', e => this.invalidInput.emit(e));\n this.reservationsInput.addEventListener('input', () => {\n this.reservationsInput.setCustomValidity('');\n this.reservationsInput.reportValidity();\n });\n }\n\n private handleMessageEvent(event) {\n if (event.data.source !== 'booking') return;\n const action = event.data.type;\n const value = event.data.message;\n if (localStorage.getItem('debug')) console.log(`Received an action:${action}`, event.data);\n\n if (action === 'error') {\n if (value.fields?.reservation) {\n salla.notify.error(value.fields.reservation[0]);\n return;\n }\n const errorList = Object.values(value.fields || [value.message]).flat().map(error => `<li>${error}</li>`).join('');\n salla.notify.error(`<ul>${errorList}</ul>`);\n }\n\n if (action === 'success') {\n if (Number(value.productId) !== Number(this.productId)) return;\n this.reservations = value.data.reservations.map(schedule => {\n if (schedule.time && schedule.time.length > 0) {\n const timeSlot = schedule.time[0];\n return {\n date: schedule.date,\n day: schedule.day,\n from_timestamp: timeSlot.from,\n to_timestamp: timeSlot.to,\n };\n }\n return null;\n }).filter(item => item !== null);\n\n salla.notify.success(this.bookedLabel);\n this.modal?.close();\n setTimeout(() => window.location.reload());\n }\n\n if (action === 'height') {\n this.iframe.height = value?.height + 'px';\n }\n }\n\n private bookingModal() {\n return (\n <salla-modal class=\"s-booking-field-modal\" ref={modal => (this.modal = modal)} width=\"md\" position=\"middle\" noPadding>\n <iframe ref={iframe => (this.iframe = iframe)} src={this.bookingUrl} frameborder=\"0\"></iframe>\n </salla-modal>\n );\n }\n\n renderReservationDate(reservation: Reservation) {\n return (\n <span class={reservation.from_timestamp ? 's-booking-field-reservations-has-time' : ''}>\n <i class=\"s-booking-field-reservations-icon\" innerHTML={Calendar}></i>\n {reservation.date}\n </span>\n );\n }\n\n renderReservationTime(reservation: Reservation) {\n if (!reservation.from_timestamp) return '';\n return (\n <span class=\"s-booking-field-reservations-time\">\n <i class=\"s-booking-field-reservations-icon\" innerHTML={TimeIcon}></i>\n <span>\n {reservation.from_timestamp} - {reservation.to_timestamp}\n </span>\n </span>\n );\n }\n\n render() {\n return (\n <Host>\n <div class=\"s-booking-field-main\">\n {this.option.required || this.reservations.length > 0 ? <div class=\"s-booking-field-price\">\n <span innerHTML={salla.money(this.option.price)}></span>\n </div> : ''}\n <salla-button class=\"s-booking-field-book-now\" size=\"small\" loaderPosition=\"center\" fill=\"outline\" onClick={event => this.openBookingModal(event, false)}>\n <span class=\"s-booking-field-book-now-content\">\n <span innerHTML={BookingTime}></span>\n {this.reservations.length ? this.editLabel : this.bookNowLabel}\n </span>\n </salla-button>\n </div>\n {this.reservations.length > 0 && (\n <div class=\"s-booking-field-reservations\">\n {this.reservations.map((reservation, index) => (\n <div key={index} class=\"s-booking-field-reservations-item\">\n {this.renderReservationDate(reservation)}\n {this.renderReservationTime(reservation)}\n </div>\n ))}\n </div>\n )}\n <input\n class=\"s-hidden\"\n name={this.option.name}\n required={this.option.required}\n value={JSON.stringify(this.reservations) === '[]' ? '' : JSON.stringify(this.reservations)}\n ref={reservations => this.reservationsInput = reservations}\n />\n {this.iframeReady && this.bookingModal()}\n </Host>\n );\n }\n}\n","import { Component, Element, Host, Listen, h } from '@stencil/core';\n\n/**\n * its to easy to use, currenlty its support select & checkbox input as trigger for show/hide the dom\n * the dom you can put it like this data-show-when=\"{name of the field} {= or !=} {value of the field}\"\n */\n@Component({\n tag: 'salla-conditional-fields'\n})\nexport class SallaConditionalFields {\n\n @Element() host: HTMLElement;\n\n private hideAllOptions(optionId) {\n this.host.querySelectorAll(`[data-show-when^=\"options[${optionId}\"]`).forEach((field: HTMLElement) => {\n field.classList.add('hidden');\n this.hideAllOptions(field.dataset.optionId);\n this.disableInputs(field);\n });\n }\n\n private disableInputs(field) {\n field.querySelectorAll('[name]').forEach((input) => {\n\n input.setAttribute('disabled', '');\n input.removeAttribute('required');\n if (input?.tagName?.toLowerCase() === 'select') {\n input.value = ''\n }\n if (['checkbox'].includes(input.getAttribute('type')) && input.hasOwnProperty('checked')) {\n // @ts-ignore\n input.checked = false;\n }\n });\n }\n \n @Listen('change')\n changeHandler(event) {\n salla.event.emit('salla-onditional-fields::change', event);\n salla.log('Received the change event: ', event);\n\n if (!event.target || !['SELECT'].includes(event.target.tagName) && !['checkbox', 'radio'].includes(event.target.getAttribute('type'))) {\n salla.log('Ignore the change because is not a supported input: ' + (event?.target?.tagName || 'N/A'));\n return;\n }\n\n let optionId = event.target.name.replace('[]', '');\n let isMultiple = event.target.getAttribute('type') === 'checkbox';\n let isRadio = event.target.getAttribute('type') === 'radio';\n\n salla.log('Trying to find all elements with condition:', `[data-show-when^=\"${optionId}\"]`);\n\n this.host.querySelectorAll(`[data-show-when^=\"${optionId}\"]`)\n .forEach((field: HTMLElement) => {\n let isEqual = !field?.dataset.showWhen.includes('!=');\n let value = field?.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$3').trim();\n let isSelected;\n if (isMultiple) {\n let selectedValues = Array.from(this.host.querySelectorAll(`input[name=\"${event.target.name}\"]:checked`), e => (e as HTMLInputElement)?.value);\n isSelected = selectedValues.includes(value.toString());\n } else if (isRadio) {\n // Handle radio inputs.\n isSelected = event.target.checked && event.target.value === value;\n } else {\n isSelected = value === event.target.value;\n }\n\n salla.log('The input is ', isMultiple ? 'Multiple' : isRadio ? 'Radio' : 'Single', ' value:', isSelected);\n\n let showTheInput = (isEqual && isSelected) || (!isEqual && !isSelected);\n if (showTheInput) {\n field.classList.remove('hidden');\n field.querySelectorAll('[name]').forEach((input) => {\n input.removeAttribute('disabled');\n\n const closestProductOption = (input as HTMLInputElement).closest('.s-product-options-option') as HTMLElement;\n if (closestProductOption.dataset.optionRequired === 'true') {\n input.setAttribute('required', '');\n }\n\n if (input.getAttribute('type') === 'checkbox') {\n const checkboxes = Array.from(document.querySelectorAll(`input[type=\"checkbox\"][name=\"${input.getAttribute('name')}\"]`)) as HTMLInputElement[];\n const isAnyChecked = checkboxes.some((checkbox) => checkbox.checked);\n if (isAnyChecked) {\n checkboxes.forEach((checkbox) => {\n checkbox.removeAttribute('required');\n });\n }\n }\n });\n } else {\n this.hideAllOptions(field.dataset.optionId);\n field.classList.add('hidden');\n this.disableInputs(field);\n }\n });\n } \n\n componentDidRender() {\n this.host.querySelectorAll(`[data-show-when]`).forEach((field) => {\n // @ts-ignore\n let optionName = field?.dataset?.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$1').trim();\n if (!optionName) {\n return;\n }\n\n this.changeHandler({\n target: this.host.querySelector('[name^=\"' + optionName + '\"]')\n })\n });\n }\n\n render() {\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAA,MAAM,oBAAoB,GAAG,sBAAsB;;YCUtC,iBAAiB,kCAAA,MAAA;MA2B5B,IAAA,WAAA,CAAA,OAAA,EAAA;;;MAjBS,QAAA,IAAY,CAAA,YAAA,GAAW,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,gCAAgC,EAAE,UAAU,CAAC;MACnF,QAAA,IAAS,CAAA,SAAA,GAAW,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,gCAAgC,EAAE,cAAc,CAAC;MACpF,QAAA,IAAW,CAAA,WAAA,GAAW,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,gCAAgC,EAAE,wBAAwB,CAAC;MAChG,QAAA,IAAU,CAAA,UAAA,GAAW,K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AO,CAAC;8BACpE,IAAI,YAAY,EAAE;MAChB,4BAAA,UAAU,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAI;MAC9B,gCAAA,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC;MACtC,6BAAC,CAAC;;;MAGR,iBAAC,CAAC;;uBACG;sBACL,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;MAC3C,gBAAA,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC;MAC7B,gBAAA,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;;MAE7B,SAAC,CAAC;;UAGN,kBAAkB,GAAA;MAChB,QAAA,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA,gBAAA,CAAkB,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;;;kBAE/D,IAAI,UAAU,GAAG,CAAA,EAAA,GAAA,KAAK,aAAL,KAAK,KAAA,MAAA,GAAA,MAAA,GAAL,KAAK,CAAE,OAAO,0CAAE,QAAQ,CAAC,OAAO,CAAC,kBAAkB,EAAE,IAAI,CAAA,CAAE,IAAI,EAAE;kBAClF,IAAI,CAAC,UAAU,EAAE;sBACf;;kBAGF,IAAI,CAAC,aAAa,CAAC;MACjB,gBAAA,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,GAAG,UAAU,GAAG,IAAI;MAC/D,aAAA,CAAC;MACJ,SAAC,CAAC;;UAGJ,MAAM,GAAA;cACJ,QACE,EAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACH,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"p-1f_p-pyh.system.js","sources":["src/components/salla-booking-field/salla-booking-field.scss?tag=salla-booking-field","src/components/salla-booking-field/salla-booking-field.tsx","src/components/salla-conditional-fields/salla-conditional-fields.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, h, Element, State, Event, EventEmitter } from '@stencil/core';\nimport { Option, Reservation } from './interfaces';\nimport BookingTime from '../../assets/svg/calendar-time.svg';\nimport Calendar from '../../assets/svg/calendar.svg';\nimport TimeIcon from '../../assets/svg/time.svg';\n\n@Component({\n tag: 'salla-booking-field',\n styleUrl: 'salla-booking-field.scss',\n})\nexport class SallaBookingField {\n /**\n * The booking option configuration\n */\n @Prop() option: Option;\n /**\n * The ID of the product for which the booking is being made\n */\n @Prop() productId: number;\n @Element() host: HTMLElement;\n @State() bookNowLabel: string = salla.lang.get('pages.cart.book_an_appointment', 'حجز موعد');\n @State() editLabel: string = salla.lang.get('pages.cart.edit_an_appointment', 'تعديل الموعد');\n @State() bookedLabel: string = salla.lang.get('pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');\n @State() selectDate: string = salla.lang.get('pages.cart.select_appointment_date', 'حدد تاريخ الموعد');\n @State() bookingUrl: string = '';\n @State() iframeReady: boolean = false;\n @State() reservations: Reservation[] = [];\n @State() reservationsInput: HTMLInputElement;\n\n /**\n * Event emitted when the input is invalid.\n */\n @Event() invalidInput: EventEmitter<any>;\n\n private modal: HTMLSallaModalElement;\n private iframe: HTMLIFrameElement;\n\n constructor() {\n // Load translations\n salla.lang.onLoaded(() => this.setTranslations());\n // Register event listeners\n Salla.event.on('booking::open', (data) => this.handleBookingOpen(data));\n }\n\n private async setTranslations() {\n const setNestedAsync = (lang, key, value) => {\n return new Promise((resolve) => {\n salla.helpers.setNested(salla.lang.messages[lang], key, value);\n resolve(true);\n });\n };\n\n await setNestedAsync('ar.trans', 'pages.cart.book_an_appointment', 'حجز موعد');\n await setNestedAsync('en.trans', 'pages.cart.book_an_appointment', 'Book an Appointment');\n await setNestedAsync('ar.trans', 'pages.cart.edit_an_appointment', 'تعديل الموعد');\n await setNestedAsync('en.trans', 'pages.cart.edit_an_appointment', 'Edit an Appointment');\n await setNestedAsync('ar.trans', 'pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');\n await setNestedAsync('en.trans', 'pages.cart.booked_successfully', 'Booked Successfully');\n await setNestedAsync('ar.trans', 'pages.cart.select_appointment_date', 'حدد تاريخ الموعد');\n await setNestedAsync('en.trans', 'pages.cart.select_appointment_date', 'Select appointment date');\n\n this.bookNowLabel = salla.lang.get('pages.cart.book_an_appointment');\n this.editLabel = salla.lang.get('pages.cart.edit_an_appointment');\n this.bookedLabel = salla.lang.get('pages.cart.booked_successfully');\n this.selectDate = salla.lang.get('pages.cart.select_appointment_date');\n }\n\n private openBookingModal(event: any, afterReload = false) {\n if (afterReload && (!event.detail || typeof event.detail !== 'number' || event.detail !== this.productId)) {\n return;\n }\n if (salla.config.isGuest()) {\n this.setAfterReloadEvent('booking::open-after-reload', this.productId);\n salla.event.dispatch('login::open');\n return;\n }\n salla.booking.add(this.productId, false)\n .then((resp) => {\n if (resp.data.redirect.to !== 'booking') {\n throw new Error('Unexpected redirect!');\n }\n salla.event.dispatch('booking::open', { url: resp.data.redirect.url, id: this.productId });\n })\n .catch((error) => {\n salla.error(salla.lang.get('common.errors.error_occurred'));\n salla.logger.error(error.response || error);\n });\n }\n\n private handleBookingOpen(data) {\n if (data.id !== this.productId) return;\n this.bookingUrl = salla.url.addParamToUrl('product_id', data.id, data.url);\n this.iframeReady = true;\n setTimeout(() => {\n this.modal.setTitle(this.selectDate);\n this.modal.open();\n }, 100);\n }\n\n private setAfterReloadEvent(event, payload) {\n salla.storage.set('afterReloadEvent', { event, payload });\n }\n\n private emitAfterReloadEvent() {\n const eventDetails = salla.storage.get('afterReloadEvent');\n if (eventDetails && eventDetails.event) {\n const customEvent = new CustomEvent(eventDetails.event, {\n detail: eventDetails.payload\n });\n window.dispatchEvent(customEvent)\n salla.storage.remove('afterReloadEvent');\n }\n }\n\n componentWillLoad() {\n if (this.option && this.option.details.length) {\n this.reservations = this.option.details;\n }\n }\n\n componentDidLoad() {\n window.addEventListener('booking::open-after-reload', (event) => this.openBookingModal(event, true));\n this.emitAfterReloadEvent();\n window.addEventListener('message', this.handleMessageEvent.bind(this));\n this.reservationsInput.addEventListener('invalid', e => this.invalidInput.emit(e));\n this.reservationsInput.addEventListener('input', () => {\n this.reservationsInput.setCustomValidity('');\n this.reservationsInput.reportValidity();\n });\n }\n\n private handleMessageEvent(event) {\n if (event.data.source !== 'booking') return;\n const action = event.data.type;\n const value = event.data.message;\n if (localStorage.getItem('debug')) console.log(`Received an action:${action}`, event.data);\n\n if (action === 'error') {\n if (value.fields?.reservation) {\n salla.notify.error(value.fields.reservation[0]);\n return;\n }\n const errorList = Object.values(value.fields || [value.message]).flat().map(error => `<li>${error}</li>`).join('');\n salla.notify.error(`<ul>${errorList}</ul>`);\n }\n\n if (action === 'success') {\n if (Number(value.productId) !== Number(this.productId)) return;\n this.reservations = value.data.reservations.map(schedule => {\n if (schedule.time && schedule.time.length > 0) {\n const timeSlot = schedule.time[0];\n return {\n date: schedule.date,\n day: schedule.day,\n from_timestamp: timeSlot.from,\n to_timestamp: timeSlot.to,\n };\n }\n return null;\n }).filter(item => item !== null);\n\n salla.notify.success(this.bookedLabel);\n this.modal?.close();\n setTimeout(() => window.location.reload());\n }\n\n if (action === 'height') {\n this.iframe.height = value?.height + 'px';\n }\n }\n\n private bookingModal() {\n return (\n <salla-modal class=\"s-booking-field-modal\" ref={modal => (this.modal = modal)} width=\"md\" position=\"middle\" noPadding>\n <iframe ref={iframe => (this.iframe = iframe)} src={this.bookingUrl} frameborder=\"0\"></iframe>\n </salla-modal>\n );\n }\n\n renderReservationDate(reservation: Reservation) {\n return (\n <span class={reservation.from_timestamp ? 's-booking-field-reservations-has-time' : ''}>\n <i class=\"s-booking-field-reservations-icon\" innerHTML={Calendar}></i>\n {reservation.date}\n </span>\n );\n }\n\n renderReservationTime(reservation: Reservation) {\n if (!reservation.from_timestamp) return '';\n return (\n <span class=\"s-booking-field-reservations-time\">\n <i class=\"s-booking-field-reservations-icon\" innerHTML={TimeIcon}></i>\n <span>\n {reservation.from_timestamp} - {reservation.to_timestamp}\n </span>\n </span>\n );\n }\n\n render() {\n return (\n <Host>\n <div class=\"s-booking-field-main\">\n {this.option.required || this.reservations.length > 0 ? <div class=\"s-booking-field-price\">\n <span innerHTML={salla.money(this.option.price)}></span>\n </div> : ''}\n <salla-button class=\"s-booking-field-book-now\" size=\"small\" loaderPosition=\"center\" fill=\"outline\" onClick={event => this.openBookingModal(event, false)}>\n <span class=\"s-booking-field-book-now-content\">\n <span innerHTML={BookingTime}></span>\n {this.reservations.length ? this.editLabel : this.bookNowLabel}\n </span>\n </salla-button>\n </div>\n {this.reservations.length > 0 && (\n <div class=\"s-booking-field-reservations\">\n {this.reservations.map((reservation, index) => (\n <div key={index} class=\"s-booking-field-reservations-item\">\n {this.renderReservationDate(reservation)}\n {this.renderReservationTime(reservation)}\n </div>\n ))}\n </div>\n )}\n <input\n class=\"s-hidden\"\n name={this.option.name}\n required={this.option.required}\n value={JSON.stringify(this.reservations) === '[]' ? '' : JSON.stringify(this.reservations)}\n ref={reservations => this.reservationsInput = reservations}\n />\n {this.iframeReady && this.bookingModal()}\n </Host>\n );\n }\n}\n","import { Component, Element, Host, Listen, h } from '@stencil/core';\n\n/**\n * its to easy to use, currenlty its support select & checkbox input as trigger for show/hide the dom\n * the dom you can put it like this data-show-when=\"{name of the field} {= or !=} {value of the field}\"\n */\n@Component({\n tag: 'salla-conditional-fields'\n})\nexport class SallaConditionalFields {\n\n @Element() host: HTMLElement;\n\n private hideAllOptions(optionId) {\n this.host.querySelectorAll(`[data-show-when^=\"options[${optionId}\"]`).forEach((field: HTMLElement) => {\n field.classList.add('hidden');\n this.hideAllOptions(field.dataset.optionId);\n this.disableInputs(field);\n });\n }\n\n private disableInputs(field) {\n field.querySelectorAll('[name]').forEach((input) => {\n\n input.setAttribute('disabled', '');\n input.removeAttribute('required');\n if (input?.tagName?.toLowerCase() === 'select') {\n input.value = ''\n }\n if (['checkbox'].includes(input.getAttribute('type')) && input.hasOwnProperty('checked')) {\n // @ts-ignore\n input.checked = false;\n }\n });\n }\n \n @Listen('change')\n changeHandler(event) {\n salla.event.emit('salla-onditional-fields::change', event);\n salla.log('Received the change event: ', event);\n\n if (!event.target || !['SELECT'].includes(event.target.tagName) && !['checkbox', 'radio'].includes(event.target.getAttribute('type'))) {\n salla.log('Ignore the change because is not a supported input: ' + (event?.target?.tagName || 'N/A'));\n return;\n }\n\n let optionId = event.target.name.replace('[]', '');\n let isMultiple = event.target.getAttribute('type') === 'checkbox';\n let isRadio = event.target.getAttribute('type') === 'radio';\n\n salla.log('Trying to find all elements with condition:', `[data-show-when^=\"${optionId}\"]`);\n\n this.host.querySelectorAll(`[data-show-when^=\"${optionId}\"]`)\n .forEach((field: HTMLElement) => {\n let isEqual = !field?.dataset.showWhen.includes('!=');\n let value = field?.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$3').trim();\n let isSelected;\n if (isMultiple) {\n let selectedValues = Array.from(this.host.querySelectorAll(`input[name=\"${event.target.name}\"]:checked`), e => (e as HTMLInputElement)?.value);\n isSelected = selectedValues.includes(value.toString());\n } else if (isRadio) {\n // Handle radio inputs.\n isSelected = event.target.checked && event.target.value === value;\n } else {\n isSelected = value === event.target.value;\n }\n\n salla.log('The input is ', isMultiple ? 'Multiple' : isRadio ? 'Radio' : 'Single', ' value:', isSelected);\n\n let showTheInput = (isEqual && isSelected) || (!isEqual && !isSelected);\n if (showTheInput) {\n field.classList.remove('hidden');\n field.querySelectorAll('[name]').forEach((input) => {\n input.removeAttribute('disabled');\n\n const closestProductOption = (input as HTMLInputElement).closest('.s-product-options-option') as HTMLElement;\n if (closestProductOption.dataset.optionRequired === 'true') {\n input.setAttribute('required', '');\n }\n\n if (input.getAttribute('type') === 'checkbox') {\n const checkboxes = Array.from(document.querySelectorAll(`input[type=\"checkbox\"][name=\"${input.getAttribute('name')}\"]`)) as HTMLInputElement[];\n const isAnyChecked = checkboxes.some((checkbox) => checkbox.checked);\n if (isAnyChecked) {\n checkboxes.forEach((checkbox) => {\n checkbox.removeAttribute('required');\n });\n }\n }\n });\n } else {\n this.hideAllOptions(field.dataset.optionId);\n field.classList.add('hidden');\n this.disableInputs(field);\n }\n });\n } \n\n componentDidRender() {\n this.host.querySelectorAll(`[data-show-when]`).forEach((field) => {\n // @ts-ignore\n let optionName = field?.dataset?.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$1').trim();\n if (!optionName) {\n return;\n }\n\n this.changeHandler({\n target: this.host.querySelector('[name^=\"' + optionName + '\"]')\n })\n });\n }\n\n render() {\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAA,MAAM,oBAAoB,GAAG,sBAAsB;;YCUtC,iBAAiB,kCAAA,MAAA;MA2B5B,IAAA,WAAA,CAAA,OAAA,EAAA;;;MAjBS,QAAA,IAAY,CAAA,YAAA,GAAW,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,gCAAgC,EAAE,UAAU,CAAC;MACnF,QAAA,IAAS,CAAA,SAAA,GAAW,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,gCAAgC,EAAE,cAAc,CAAC;MACpF,QAAA,IAAW,CAAA,WAAA,GAAW,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,gCAAgC,EAAE,wBAAwB,CAAC;MAChG,QAAA,IAAU,CAAA,UAAA,GAAW,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,oCAAoC,EAAE,kBAAkB,CAAC;MAC7F,QAAA,IAAU,CAAA,UAAA,GAAW,EAAE;MACvB,QAAA,IAAW,CAAA,WAAA,GAAY,KAAK;MAC5B,QAAA,IAAY,CAAA,YAAA,GAAkB,EAAE;;MAavC,QAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;;MAEjD,QAAA,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,eAAe,EAAE,CAAC,I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AAa,CAAC,KAAK,CAAC;;MAE7B,SAAC,CAAC;;UAGN,kBAAkB,GAAA;MAChB,QAAA,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA,gBAAA,CAAkB,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;;;kBAE/D,IAAI,UAAU,GAAG,CAAA,EAAA,GAAA,KAAK,aAAL,KAAK,KAAA,MAAA,GAAA,MAAA,GAAL,KAAK,CAAE,OAAO,0CAAE,QAAQ,CAAC,OAAO,CAAC,kBAAkB,EAAE,IAAI,CAAA,CAAE,IAAI,EAAE;kBAClF,IAAI,CAAC,UAAU,EAAE;sBACf;;kBAGF,IAAI,CAAC,aAAa,CAAC;MACjB,gBAAA,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,GAAG,UAAU,GAAG,IAAI;MAC/D,aAAA,CAAC;MACJ,SAAC,CAAC;;UAGJ,MAAM,GAAA;cACJ,QACE,EAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACH,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as e,g as o}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as t,h as e,g as o}from"./p-bWnWhxOm.js";const i='.s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;-webkit-transform:translateX(-39%);transform:translateX(-39%);background-color:#baf3e6;color:#004d5a;bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;opacity:0;-webkit-transition:opacity 0.3s;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:"";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#baf3e6 transparent transparent transparent}.s-tooltip-item:dir(ltr){-webkit-transform:translateX(-72%);transform:translateX(-72%)}';const s=class{constructor(e){t(this,e);this.show=false;this.targetElement=null}handleMouseOver(t){if(this.targetElement&&this.targetElement.contains(t.target)){this.show=true}}handleMouseOut(t){if(this.targetElement&&this.targetElement.contains(t.target)){this.show=false}}componentDidLoad(){this.targetElement=document.getElementById(this.targetId)}render(){return e("div",{key:"87a485eeb144377502782b6a7ac61417349423e2",class:"s-tooltip-container"},e("slot",{key:"8329e929fce52cd2ef4f9258548770576e67ee96"}),this.show&&e("div",{key:"18f9cd55110713d0b472601dc0a9ef20dd31af19",class:"s-tooltip-item"},this.text))}get el(){return o(this)}};s.style=i;export{s as salla_tooltip};
|
|
5
|
+
//# sourceMappingURL=p-1ff003ae.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as e}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as s,h as e}from"./p-bWnWhxOm.js";import{a as i}from"./p-BedNk7k1.js";import{H as t}from"./p-DjVGZdqd.js";import"./p-CgtvEd63.js";var a=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>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`;const l="";const r=class{constructor(e){s(this,e);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((()=>{this.displayAllURL=salla.url.get("testimonials");this.isRTL=salla.config.get("theme.is_rtl",true)}));salla.lang.onLoaded((()=>{this.testimonialText=salla.lang.get("blocks.home.testimonials");this.displayAllLinkText=salla.lang.get("blocks.home.display_all")}))}fetchReviews(){if(this.source==="json"){return Promise.resolve(JSON.parse(this.sourceValue))}const s=["products","categories"].includes(this.source);const 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")}componentWillLoad(){return new Promise((s=>salla.onReady(s))).then((()=>this.fetchReviews())).then((s=>s.data||[])).then((s=>{if(s.length){this.reviews=s;this.showReviews=true;t.generateReviewSchema(this.reviews)}}))}render(){return e("div",{key:"0ea9cab5b1f9d4d2b6b74cec987f24c858191217",class:"s-reviews-container"},e("div",{key:"6f17c3033b419b2eaf01f6dc858a4b7ce23bd2c4",class:"s-reviews-header-wrapper"},e("h1",{key:"1e043cca8a56542a297449e3ff5d3e52c93e0997",class:"s-reviews-header"},this.testimonialText),!!this.displayAllLink?e("a",{href:this.displayAllURL,class:"s-reviews-display-all"},this.displayAllLinkText,e("span",{class:"s-reviews-display-all-icon",innerHTML:i})):null),e("salla-slider",{key:"b5aee5d359c8604a5570991f2a7801b651d8321d",centered:true,"slides-per-view":1,type:"testimonials",class:"s-reviews-testimonials-slider","controls-outer":true,"auto-play":true,id:`testimonials-${this.source}-slider`},e("div",{key:"98428b4fde7a2c81567d387c93a9b87ef3245923",slot:"items"},this.reviews.map(((s,i)=>e("div",{key:i,class:"s-reviews-swiper-slide"},e("div",{class:"s-reviews-testimonial"},e("div",{class:"s-reviews-testimonial__inner"},e("div",{class:"s-reviews-testimonial__avatar"},e("img",{src:"images/s-empty.png","data-src":s.avatar,alt:s.name?s.name:"testimonial-"+i,class:"lazy"})),e("div",{class:"s-reviews-testimonial__text"},e("p",{innerHTML:s.content}),e("div",{class:"s-reviews-testimonial__name_wrapper"},e("div",{class:"s-reviews-testimonial__info"},s.name&&e("h2",null,`${s.name}`)),e("div",{class:"s-reviews-testimonial__rating"},e("salla-rating-stars",{size:"small",value:s.stars})))),e("span",{class:"s-reviews-testimonial__icon",innerHTML:a})))))))))}};r.style=l;export{r as salla_reviews};
|
|
5
|
+
//# sourceMappingURL=p-2009a3b2.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-B6dZG1Ey.system.js"],(function(t){"use strict";var s,n,a,i;return{setters:[function(t){s=t.r;n=t.h;a=t.H;i=t.g}],execute:function(){var r=":host{display:block}";var e=t("salla_apps_icons",function(){function t(t){var n=this;s(this,t);var a;this.apps=salla.config.get("store.apps");this.appSlot=((a=this.host.querySelector('[slot="app"]'))===null||a===void 0?void 0:a.innerHTML)||"<img alt={name} src={icon} />";salla.onReady((function(){n.apps=salla.config.get("store.apps")}));salla.lang.onLoaded((function(){n.appsTitle=salla.lang.get("blocks.footer.download_apps")}))}t.prototype.getAppsArray=function(){return Object.entries(this.apps).map((function(t){var s=t[0],n=t[1];return{name:s,value:n}}))};t.prototype.componentWillLoad=function(){return new Promise((function(t){return salla.onReady(t)}))};t.prototype.render=function(){var t=this;var s=this.getAppsArray();if(Array.isArray(s)&&!s.length){return}return n(a,{class:"s-apps-icons"},!this.hideTitle&&n("h3",null,this.appsTitle),n("div",{class:{"s-apps-icons-list":true,vertical:this.vertical}},s.map((function(s,a){return n("a",{key:a,href:s.value,rel:"noreferrer",target:"_blank",class:"s-apps-icons-item",id:"app-slot",innerHTML:t.appSlot.replace(/\{icon\}/g,salla.url.cdn("images/".concat(s.name,".png"))).replace(/\{name\}/g,s.name)})}))))};t.prototype.componentDidRender=function(){var t;(t=this.host.querySelector('[slot="app"]'))===null||t===void 0?void 0:t.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return i(this)},enumerable:false,configurable:true});return t}());e.style=r}}}));
|
|
5
|
+
//# sourceMappingURL=p-2982aef4.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as i,H as e}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as t,h as i,H as e}from"./p-bWnWhxOm.js";var s;(function(t){t["PERCENTAGE"]="percentage";t["FIXED"]="fixed";t["FREE_PRODUCT"]="free_product"})(s||(s={}));var n;(function(t){t["PRODUCT_COUNT"]="products_count";t["PRODUCT_PURCHASE"]="order_amount"})(n||(n={}));const o=":host{display:block}";const l=class{constructor(i){t(this,i);this.offer=null;this.products={};this.isLoading=false;this.canRender=true}componentWillLoad(){salla.onReady().then((()=>{var t,i,e;if(!((t=salla.config.get("store.features"))===null||t===void 0?void 0:t.includes("conditional-offer"))||salla.storage.get("cart")!==""&&!((e=(i=salla.storage.get("cart"))===null||i===void 0?void 0:i.summary)===null||e===void 0?void 0:e.count)){throw new Error("feature or cart object does not existed")}})).then((()=>salla.api.cart.offers())).then((({data:t})=>{this.offer=t.find((t=>t.type==="conditional"));if(!this.offer){this.canRender=false;return}this.isLoading=true;this.offer.details.discounts.unshift({value:0,min_spend:0});return this.updateInitialOfferValue()})).then((()=>{if(!this.offer)return;return this.getProducts()})).then((()=>{if(!this.offer)return;salla.event.on("cart::updated",(t=>this.updateOfferValues(t)))})).catch((t=>{this.canRender=false;salla.logger.warn("salla-conditional-offer:: ",t)})).finally((()=>{this.isLoading=false}))}getProducts(){const t=this.offer.details.discounts.filter((({type:t})=>t===s.FREE_PRODUCT)).map((({value:t})=>t));if(t.length>0){return salla.product.fetch({source:"selected",source_value:t}).then((({data:t})=>{t.forEach((({id:t,url:i,image:e})=>{this.products[t]={url:i,image:e}}))}))}}updateInitialOfferValue(){return salla.api.cart.details().then((({data:{cart:t}})=>this.updateOfferValues(t)))}updateOfferValues({items:t,sub_total:i}){var e;const s=this.offer.details.based_on===n.PRODUCT_COUNT?t.reduce(((t,{quantity:i})=>t+i),0):i;this.offer=Object.assign(Object.assign({},this.offer),{details:Object.assign(Object.assign({},(e=this.offer)===null||e===void 0?void 0:e.details),{current_value:s})});return this.offer}getCheckpointContent(t){var e,n;if(t.type===s.PERCENTAGE)return`${t.value}%`;if(t.type===s.FIXED)return salla.money(t.value);if(t.type!==s.FREE_PRODUCT){salla.logger.error(`salla-conditional-offer:: unexpected type (${t.type})!`);return""}const o=this.products[t.value];if(!o){salla.logger.error(`salla-conditional-offer:: there is no product with id (${t.value})!`);return""}return i("a",{class:"s-conditional-offer-product-link",href:o.url},i("img",{class:"s-conditional-offer-checkpoint-image-content",loading:"lazy",decoding:"async",alt:((e=o===null||o===void 0?void 0:o.image)===null||e===void 0?void 0:e.alt)||"",src:(n=o===null||o===void 0?void 0:o.image)===null||n===void 0?void 0:n.url}))}getOfferType(t){var i;const e=(i=this.offer.details)===null||i===void 0?void 0:i.based_on;if(e===n.PRODUCT_COUNT)return salla.lang.choice("blocks.header.products_count",t.min_spend);if(e===n.PRODUCT_PURCHASE)return salla.money(t.min_spend);salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${e}`);return`${t.min_spend}`}clamp(t,i,e){return Math.max(i,Math.min(t,e))}mapValueRanges(t,i,e,s,n){const o=(t-i)*(n-s)/(e-i)+s;if(o===Number.POSITIVE_INFINITY)return 100;if(o===Number.NEGATIVE_INFINITY)return 0;return this.clamp(o,0,100)}getCheckPointView(t,e){var s,n;const o=this.offer.details.discounts.findIndex((({min_spend:i})=>i===t.min_spend));const l=(n=(s=this.offer.details.discounts[o-1])===null||s===void 0?void 0:s.min_spend)!==null&&n!==void 0?n:0;const a=this.mapValueRanges(this.offer.details.current_value,l,t.min_spend,0,100);const r=t.min_spend<=this.offer.details.current_value;return i("div",{class:"s-conditional-offer-checkpoint-container"},e>0?[i("div",{key:"progress-line",class:"s-conditional-offer-progress-line-container"},i("div",{class:"s-conditional-offer-progress-line-inactive"}),i("div",{class:"s-conditional-offer-progress-line-active",style:{width:`${a}%`}})),i("div",{key:"checkpoint",class:`s-conditional-offer-checkpoint ${r?"s-conditional-offer-active-checkpoint":""}`},i("div",{class:`s-conditional-offer-item-avatar-content ${r?"active":""}`,innerHTML:this.products&&this.getCheckpointContent(t)}),i("div",{class:`s-conditional-offer-checkpoint-label ${r?"active":""}`,innerHTML:this.getOfferType(t)}))]:i("div",{key:"label",class:{"s-conditional-offer-checkpoint-label":true,"first-checkpoint":e===0,active:r},innerHTML:this.getOfferType(t)}))}getLoadingSkeletonView(){return i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-skeleton-inner-container"},i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"30%"})),i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"35%"})),i("div",{class:"s-conditional-offer-skeleton-checkpoints-wrapper"},Array(3).fill(null).map((()=>[i("salla-skeleton",{key:"checkpoint-line",height:"8px"}),i("div",{key:"checkpoint"},i("salla-skeleton",{height:"60px",width:"60px",type:"circle"}))])))))}render(){if(!this.canRender)return null;if(this.isLoading)return this.getLoadingSkeletonView();if(!this.offer)return null;return i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-title-wrapper"},i("div",{class:"s-conditional-offer-title"},this.offer.title),this.offer.description?i("div",{class:"s-conditional-offer-subtitle"},this.offer.description," ",i("i",{class:"sicon-information"})):null),i("div",{class:"s-conditional-offer-progress-container"},this.offer.details.discounts.map(((t,e)=>i("div",{class:{"flex-1":e>0},key:t.min_spend},this.getCheckPointView(t,e))))))}};l.style=o;export{l as salla_conditional_offer};
|
|
5
|
+
//# sourceMappingURL=p-2b36aa10.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-B6dZG1Ey.system.js","./p-C2rVu_Jb.system.js"],(function(c){"use strict";var a,e,t,i,s,d,n;return{setters:[function(c){a=c.r;e=c.c;t=c.h;i=c.H;s=c.g},function(c){d=c.p;n=c.m}],execute:function(){var o="";var r=c("salla_accordion_head",function(){function c(c){a(this,c);this.accordionToggle=e(this,"accordionToggle");this.collapsible=false;this.collapsed=true}c.prototype.emitCollapsePanel=function(){this.accordionToggle.emit({payload:{collapsed:this.collapsed}})};c.prototype.toggleCollapse=function(){var c,a,e;if(!this.collapsible)return;this.collapsed=!this.collapsed;(c=this.host.parentElement)===null||c===void 0?void 0:c.setAttribute("data-collapsed",this.collapsed.toString());(e=(a=this.host.parentElement)===null||a===void 0?void 0:a.querySelector("salla-accordion-body"))===null||e===void 0?void 0:e.setAttribute("data-collapsed",this.collapsed.toString());this.emitCollapsePanel()};c.prototype.render=function(){var c=this;return t(i,{key:"9bb7ad4ad615f5316968b48839b2433619bd3850","data-collapsed":this.collapsed.toString(),onClick:function(){return c.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("div",{key:"ddeff9dcacc42028d272298371c721ce00039176",class:"s-accordion-head-wrapper-end"},t("slot",{key:"daa4d8c9db6484f3fc67cf855250c5bc3cc59314",name:"notification"}),this.collapsible&&t("button",{key:"2bcc66dc07c3ae1ea9a31fbd0c7b8204f1eca2be",class:{"s-accordion-head-wrapper-toggle":true,active:!this.collapsed},onClick:function(a){a.stopPropagation();c.toggleCollapse()}},t("span",{key:"2853844a2fbc662c002f7e2cacb299874c9debb3",class:"s-accordion-head-wrapper-toggle-icon",innerHTML:this.collapsed?d:n}))))};Object.defineProperty(c.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return c}());r.style=o}}}));
|
|
5
|
+
//# sourceMappingURL=p-2c15e135.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}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as s,h as t}from"./p-bWnWhxOm.js";import{I as a}from"./p-uTyAzPSy.js";var e=`\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-archive</title>\n<path d="M17.333 16h-5.333c-0.737 0-1.333 0.597-1.333 1.333v2.667c0 2.205 1.795 4 4 4s4-1.795 4-4v-2.667c0-0.736-0.596-1.333-1.333-1.333zM16 20c0 0.735-0.597 1.333-1.333 1.333s-1.333-0.599-1.333-1.333v-1.333h2.667zM17.333 12h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM28.943 8.391l-8-8c-0.249-0.251-0.588-0.391-0.943-0.391h-13.333c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h18.667c2.205 0 4-1.795 4-4v-18.667c0-0.353-0.14-0.693-0.391-0.943zM26.667 28c0 0.735-0.597 1.333-1.333 1.333h-18.667c-0.736 0-1.333-0.599-1.333-1.333v-24c0-0.735 0.597-1.333 1.333-1.333h12.781l7.219 7.219zM17.333 8h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM17.333 4h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333z"></path>\n</svg>\n`;var c=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>download</title>\n<path d="M15.056 20.941c0.123 0.124 0.271 0.221 0.435 0.289 0.163 0.067 0.336 0.103 0.509 0.103s0.347-0.036 0.509-0.103c0.164-0.068 0.311-0.165 0.435-0.289l5.332-5.332c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-3.057 3.057v-12.781c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v12.781l-3.057-3.057c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885zM25.333 26.667h-18.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h18.667c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333z"></path>\n</svg>\n`;var i=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>swap-stroke</title>\n<path d="M6.667 18.667h-2.667c-0.736 0-1.333-0.597-1.333-1.333v-13.333c0-0.736 0.597-1.333 1.333-1.333h13.333c0.736 0 1.333 0.597 1.333 1.333v2.667c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-2.667c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h2.667c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333zM28 10.667h-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-4v-13.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.597 1.333-1.333 1.333h-13.333c-0.736 0-1.333-0.597-1.333-1.333v-13.333c0-0.736 0.597-1.333 1.333-1.333h13.333c0.736 0 1.333 0.597 1.333 1.333z"></path>\n</svg>\n`;var l=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>debit-card-back</title>\n<path d="M30 28h-28c-1.105 0-2-0.895-2-2v0-18c0-1.105 0.895-2 2-2v0h28c1.105 0 2 0.895 2 2v0 18c0 1.105-0.895 2-2 2v0zM30 26v0zM2 8v18h28v-18zM31 14h-30c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h30c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM11 22h-6c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h6c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM24 24c-2.209 0-4-1.791-4-4s1.791-4 4-4c2.209 0 4 1.791 4 4v0c0 2.209-1.791 4-4 4v0zM24 18c-1.105 0-2 0.895-2 2s0.895 2 2 2c1.105 0 2-0.895 2-2v0c0-1.105-0.895-2-2-2v0zM20 24c-2.209 0-4-1.791-4-4s1.791-4 4-4v0c0.002 0 0.005 0 0.007 0 1.032 0 1.972 0.398 2.673 1.048l-0.003-0.002c0.191 0.183 0.311 0.439 0.311 0.724 0 0.552-0.448 1-1 1-0.257 0-0.492-0.097-0.669-0.257l0.001 0.001c-0.345-0.319-0.807-0.514-1.315-0.514-0.002 0-0.003 0-0.005 0h0c-1.105 0-2 0.895-2 2s0.895 2 2 2v0c0.002 0 0.004 0 0.007 0 0.508 0 0.971-0.195 1.317-0.515l-0.001 0.001c0.179-0.171 0.422-0.276 0.689-0.276 0.552 0 1 0.448 1 1 0 0.295-0.128 0.56-0.331 0.743l-0.001 0.001c-0.699 0.648-1.638 1.046-2.671 1.046-0.003 0-0.007 0-0.010 0h0.001z"></path>\n</svg>\n`;const n=":host{display:block}";const h=class{constructor(t){s(this,t);this.codeCopied=null;this.noItemFound=true;this.order_items=[];this.isDigitalCard=s=>s.product.type==="codes";this.isDigitalProduct=s=>s.product.type==="digital"}async componentWillLoad(){salla.lang.onLoaded((()=>{this.codes_text=salla.lang.get("pages.thank_you.codes");this.copy_text=salla.lang.get("common.elements.copy");this.files_text=salla.lang.get("pages.thank_you.files");this.download_text=salla.lang.get("pages.thank_you.download")}));return await this.getOrderItems()}copyToClipboardHandler(s){if(navigator&&"clipboard"in navigator){try{navigator.clipboard.writeText(s).then((()=>{this.codeCopied=s;this.copyCodeButtonTimeout=setTimeout((()=>{this.codeCopied=null}),3e3)}))}catch(s){salla.loggers.error("copy functionality is not supported by the browser")}}}async getOrderItems(){const s=this.orderId||salla.config.get("page.id");const t="Failed to fetch order items";if(!s){salla.logger.error(t);throw new Error(t)}try{const{data:{items:t=[]}}=await salla.api.request(`orders/${s}`);const a=t.some((s=>this.isDigitalCard(s)||this.isDigitalProduct(s)));if(a){this.order_items=t;this.noItemFound=false}}catch(s){salla.logger.error(t)}}disconnectedCallback(){this.copyCodeButtonTimeout&&clearTimeout(this.copyCodeButtonTimeout)}render(){return t("ul",{key:"6358d81e74e1fd966b7046deab946f33391b2fc6",class:"s-order-summary-wrapper"},this.noItemFound?t("salla-placeholder",{alignment:"center"},t("span",{slot:"title"})):this.order_items.map((s=>this.isDigitalCard(s)?t("li",{key:s.product.id,class:"s-order-summary-item"},t("h2",{class:"s-order-summary-item-title"},this.codes_text," (",s.name,")"),s.codes.map((s=>t("div",{key:s.code,class:"s-order-summary-code-item-wrapper"},t("p",null,t("span",{innerHTML:l}),t("span",null,s.code)),t("salla-button",{class:`s-order-summary-item-copy-button ${this.codeCopied===s.code?"copied":""}`,onClick:()=>this.copyToClipboardHandler(s.code),shape:"link"},t("span",{innerHTML:this.codeCopied===s.code?a:i}),t("span",null,this.copy_text)))))):this.isDigitalProduct(s)?t("li",{key:s.product.id,class:"s-order-summary-item"},t("h2",{class:"s-order-summary-item-title"},this.files_text," (",s.name,")"),t("ul",null,s.files.map((s=>t("li",{class:"s-order-summary-digital-item-wrapper"},t("div",null,t("span",{innerHTML:e}),t("span",null,s.name)),t("a",{href:s.url,target:"_blank",class:"s-order-summary-item-download"},t("span",{innerHTML:c}),t("span",null,this.download_text))))))):null)))}};h.style=n;export{h as salla_order_summary};
|
|
5
|
+
//# sourceMappingURL=p-318cb424.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as a,H as i,g as s}from"./p-BuEDxKhL.js";const e="salla-installment:empty{display:none}#tabbyPromoWrapper{background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px;border:unset !important;font-weight:500}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;-webkit-box-shadow:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--main-text-color);font-size:var(--font-sm);line-height:1.25;padding:20px 20px 20px 115px !important;background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);border:unset !important;font-family:inherit !important;font-weight:500}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.tamara-product-widget .spotii-logo,.spotii-wrapper .spotii-logo{float:left;margin:0 0 0 -75px}.ltr .tamara-product-widget,.ltr .spotii-wrapper{text-align:left;padding:18px 100px 18px 20px !important}.ltr .tamara-product-widget .spotii-logo,.ltr .spotii-wrapper .spotii-logo{float:right;margin:0 -75px 0 0}.ltr .tamara-product-widget .spotii-product-widget,.ltr .spotii-wrapper .spotii-product-widget{text-align:left !important}.spotii-wrapper{margin-bottom:20px}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm) !important;margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px !important;top:35px !important;margin:0 !important;height:24px !important}.ltr .tamara-product-widget .tamara-logo{right:20px !important;left:auto !important}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}.s-installment-mispay-wrapper,.s-installment-madfu-wrapper,.s-installment-emkan-wrapper,.s-installment-rajehi-wrapper{font-size:14px;text-align:right;padding:20px;gap:42px;line-height:22px;color:rgb(0, 0, 0);min-width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;background-color:white;border-radius:10px;margin:15px 0;display:-ms-flexbox;display:flex;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.s-installment-mispay-wrapper:hover,.s-installment-madfu-wrapper:hover,.s-installment-emkan-wrapper:hover,.s-installment-rajehi-wrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.s-installment-mispay-content,.s-installment-madfu-content,.s-installment-emkan-content,.s-installment-rajehi-content{display:-ms-flexbox;display:flex;-ms-flex-direction:row-reverse;flex-direction:row-reverse;width:100%;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;gap:1rem}.s-installment-mispay-content-text,.s-installment-madfu-content-text,.s-installment-emkan-content-text,.s-installment-rajehi-content-text{color:var(--main-text-color);font-size:14px;font-weight:500;margin:0 16px 0 0;width:80%;left:14px;text-align:left}.s-installment-mispay-content img,.s-installment-madfu-content img,.s-installment-emkan-content img,.s-installment-rajehi-content img{height:28px;width:70px;display:inline-block;max-height:100%;vertical-align:middle;fill:none;stroke:unset;width:auto}.rtl .s-installment-mispay-content-text,.rtl .s-installment-madfu-content-text,.rtl .s-installment-emkan-content-text,.rtl .s-installment-rajehi-content-text{right:14px;text-align:right;margin:0 0 0 16px}.rtl .s-installment-mispay-content img,.rtl .s-installment-madfu-content img,.rtl .s-installment-emkan-content img,.rtl .s-installment-rajehi-content img{left:14px !important}.ltr .s-installment-mispay-content img,.ltr .s-installment-madfu-content img,.ltr .s-installment-emkan-content img,.ltr .s-installment-rajehi-content img{right:14px !important}.s-installment-rajehi-content img{width:70px !important;height:40px !important}.s-installment-emkan-content img{height:35px !important}";const o=class{constructor(a){t(this,a);this.tabbyBorderRemoved=false;this.tabbyRemoveBorderTries=0;this.language=salla.config.get("user.language_code");this.currency=salla.config.get("user.currency_code");this.country=salla.config.get("user.country_code");this.installment_sheria_text=(t,a)=>salla.lang.get(t,a)}async componentWillLoad(){await salla.onReady();await salla.lang.onLoaded();this.currency=salla.config.get("user.currency_code")||"SAR";this.language=salla.config.get("user.language_code")||"ar";this.country=salla.config.get("user.country_code")||"SA";const t=[{key:"pages.products.installments",installments:3},{key:"pages.products.installments_emkan",installments:5}];t.forEach((t=>{this.installment_sheria_text(t.key,{payment:salla.money(parseFloat(this.price)),amount:salla.money((parseFloat(this.price)/t.installments).toFixed(2)).replace(/\.00$/,""),installments:t.installments})}));const a=salla.config.get("store.settings.installments");if(a){this.tamaraIsActive=a.tamara;this.tabbyIsActive=a.tabby;this.spotiiIsActive=a.spotii;this.mispayActive=a.mispay;this.emkanIsActive=a.emkan;this.madfuActive=a.madfu;this.rajehiIsActive=a.mokafaa_alrajhi}salla.event.on("product::price.updated",(({data:t})=>{if(!t.price||t.price==this.price){return}this.price=t.price;this.renderInstallments(true)}))}componentDidLoad(){this.renderInstallments()}render(){var t;const s=this.currency==="SAR";if(!this.isValidPrice(this.price)){return""}return a(i,null,this.tamaraIsActive&&(((t=this.tamaraIsActive)===null||t===void 0?void 0:t.publicKey)?a("div",{class:"mb-5"},a("tamara-widget",{type:"tamara-summary","inline-type":"2",amount:this.price})):a("div",{class:"tamara-product-widget","data-price":this.price,"data-currency":this.currency,"data-lang":this.language,"data-payment-type":"installment"})),this.tabbyIsActive?a("div",{id:"tabbyPromoWrapper"},a("div",{id:"tabbyPromo"})):"",this.spotiiIsActive?a("div",{class:"spotii-wrapper"},a("div",{class:"spotii-promo"})):"",this.shouldShowMispay()&&(this.mispayActive.publicKey?a("div",{class:"mb-5"},a("mispay-widget",{amount:this.price,lang:this.language})):a("div",{class:"s-installment-mispay-wrapper"},a("div",{class:"s-installment-mispay-content"},a("img",{src:salla.url.cdn("images/payment/png/mispay.png"),alt:"mispay"}),a("span",{class:"s-installment-mispay-content-text",innerHTML:this.installment_sheria_text("pages.products.installments",{payment:salla.money(parseFloat(this.price)),amount:salla.money((parseFloat(this.price)/4).toFixed(2)),installments:4})})))),this.emkanIsActive&&this.currency==="SAR"?a("div",{class:"s-installment-emkan-wrapper"},a("div",{class:"s-installment-emkan-content"},a("img",{src:salla.url.cdn("images/payment/png/emkan.png"),alt:"emkan"}),a("span",{class:"s-installment-emkan-content-text",innerHTML:this.installment_sheria_text("pages.products.installments_emkan",{payment:salla.money(parseFloat(this.price)),installments:5})}))):"",this.madfuActive&&this.currency==="SAR"?a("div",{class:"s-installment-madfu-wrapper"},a("div",{class:"s-installment-madfu-content"},a("img",{src:salla.url.cdn("images/payment/png/madfu.png"),alt:"madfu"}),a("span",{class:"s-installment-madfu-content-text"},salla.lang.get("pages.products.installments_madfu")))):"",s&&this.rajehiIsActive?a("div",{class:"s-installment-rajehi-wrapper"},a("div",{class:"s-installment-rajehi-content"},a("img",{src:salla.url.cdn("images/payment/png/mokafaa_alrajhi_loyalty.png"),alt:"mokafaa_alrajhi_loyalty"}),a("span",{class:"s-installment-rajehi-content-text"},salla.lang.get("pages.products.rajahi_earn_points",{points:Math.floor(+this.price*this.rajehiIsActive.pointsPerRiyal)})))):"")}renderInstallments(t=false){if(!this.isValidPrice(this.price)){return}if(this.tamaraIsActive){this.loadTamara({isUpdating:t})}if(this.tabbyIsActive){if(t){var a=this.host.querySelector("#tabbyPromoWrapper");if(a){a.remove()}var i=document.createElement("div");i.setAttribute("id","tabbyPromoWrapper");var s=document.createElement("div");s.setAttribute("id","tabbyPromo");i.appendChild(s);this.host.appendChild(i);var e=document.querySelector('script[src="https://checkout.tabby.ai/tabby-promo.js"]');if(e){e.remove()}}var o=document.createElement("script");o.setAttribute("src","https://checkout.tabby.ai/tabby-promo.js");document.head.appendChild(o);o.onload=()=>{const t=window.TabbyPromo;new t({selector:"#tabbyPromo",currency:this.currency,price:this.price,lang:this.language,publicKey:salla.config.get("store.settings.installments.tabby.publicKey"),merchantCode:salla.config.get("store.settings.installments.tabby.merchantCode")});document.querySelectorAll(".tabby-promo-snippet__logo").forEach((function(t){t.setAttribute("aria-label","Tabby Logo")}))};this.removeTabbyBorder()}if(this.spotiiIsActive){if(t){var r=this.host.querySelector(".spotii-wrapper");if(r){r.remove()}var n=document.createElement("div");n.classList.add("spotii-wrapper");var l=document.createElement("div");l.classList.add("spotii-promo");n.appendChild(l);this.host.appendChild(n);var p=document.querySelector('script[src="'+salla.url.cdn("js/price-widget-ar-salla.js")+'"]');if(p){p.remove()}}let a=salla.money((Number(this.price)/3).toFixed(2),false);let i=salla.config.get("theme.is_rtl",true);window.spotiiConfig={targetXPath:[".spotii-wrapper"],renderToPath:[".spotii-promo"],numberOfPayment:3,currency:this.currency,templateLine:"${textOne} ${number} ${textTwo} "+a+"${logo} ${info}",textOne:i?"جزء الدفع على":"Split it into",textTwo:i?"أقساط متساوية بدون تكاليف اضافية بقيمة":"payments of",textThree:"مع",price:this.price};var m=document.createElement("script");m.setAttribute("src",salla.url.cdn("js/price-widget-ar-salla.js"));document.head.appendChild(m)}if(this.shouldShowMispay()&&this.mispayActive.publicKey){this.loadExternalScript({position:"head",src:`https://widget.mispay.co/v1/sdk.js?authorize=${this.mispayActive.publicKey}`})}}isValidPrice(t){const a=/^\d+(\.\d{1,2})?$/;const i=a.test(t);const s=parseFloat(t)>0;return i&&s}loadExternalScript({src:t,onLoad:a,position:i}){const s=document.createElement("script");s.src=t;s.onload=a;document[i].appendChild(s)}loadTamara({isUpdating:t}){var a,i;const s=!!((a=this.tamaraIsActive)===null||a===void 0?void 0:a.publicKey);if(t){setTimeout((()=>{var t,a;if(s){return(t=window.TamaraWidgetV2)===null||t===void 0?void 0:t.refresh()}(a=window.TamaraProductWidget)===null||a===void 0?void 0:a.render()}),300)}else{if(s){const t=salla.config.get("user.language_code");const a=["ar","en"].includes(t)?t:"ar";const s=(i=this.currency)===null||i===void 0?void 0:i.slice(0,-1);const e=["SA","AE","KW","BH","OM","QA"].includes(s)?s:null;if(!e){console.error("Tamara: Country code is not supported",s)}else{window.tamaraWidgetConfig={lang:a,country:e,publicKey:this.tamaraIsActive.publicKey,style:{fontSize:"14px"}};this.loadExternalScript({position:"head",src:"https://cdn.tamara.co/widget-v2/tamara-widget.js"})}}else{this.loadExternalScript({position:"head",src:"https://cdn.tamara.co/widget/product-widget.min.js",onLoad:()=>{window.TamaraProductWidget.init({lang:this.language});setTimeout((()=>{window.TamaraProductWidget.render()}),300)}})}}}shouldShowMispay(){return this.currency==="SAR"&&this.mispayActive}removeTabbyBorder(){if(this.tabbyBorderRemoved||this.tabbyRemoveBorderTries>5){return}this.tabbyRemoveBorderTries++;setTimeout((()=>{let t=document.querySelector("#tabbyPromo>div>div");t=t&&t.shadowRoot?t.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]'):null;if(t){t.style="border: none; margin: 15px 0!important;";this.tabbyBorderRemoved=true}else{this.removeTabbyBorder()}}),this.tabbyRemoveBorderTries*500)}get host(){return s(this)}};o.style=e;export{o as salla_installment};
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as t,h as a,H as i,g as s}from"./p-bWnWhxOm.js";const e="salla-installment:empty{display:none}#tabbyPromoWrapper{background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px;border:unset !important;font-weight:500}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;-webkit-box-shadow:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--main-text-color);font-size:var(--font-sm);line-height:1.25;padding:20px 20px 20px 115px !important;background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);border:unset !important;font-family:inherit !important;font-weight:500}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.tamara-product-widget .spotii-logo,.spotii-wrapper .spotii-logo{float:left;margin:0 0 0 -75px}.ltr .tamara-product-widget,.ltr .spotii-wrapper{text-align:left;padding:18px 100px 18px 20px !important}.ltr .tamara-product-widget .spotii-logo,.ltr .spotii-wrapper .spotii-logo{float:right;margin:0 -75px 0 0}.ltr .tamara-product-widget .spotii-product-widget,.ltr .spotii-wrapper .spotii-product-widget{text-align:left !important}.spotii-wrapper{margin-bottom:20px}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm) !important;margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px !important;top:35px !important;margin:0 !important;height:24px !important}.ltr .tamara-product-widget .tamara-logo{right:20px !important;left:auto !important}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}.s-installment-mispay-wrapper,.s-installment-madfu-wrapper,.s-installment-emkan-wrapper,.s-installment-rajehi-wrapper{font-size:14px;text-align:right;padding:20px;gap:42px;line-height:22px;color:rgb(0, 0, 0);min-width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;background-color:white;border-radius:10px;margin:15px 0;display:-ms-flexbox;display:flex;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.s-installment-mispay-wrapper:hover,.s-installment-madfu-wrapper:hover,.s-installment-emkan-wrapper:hover,.s-installment-rajehi-wrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.s-installment-mispay-content,.s-installment-madfu-content,.s-installment-emkan-content,.s-installment-rajehi-content{display:-ms-flexbox;display:flex;-ms-flex-direction:row-reverse;flex-direction:row-reverse;width:100%;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;gap:1rem}.s-installment-mispay-content-text,.s-installment-madfu-content-text,.s-installment-emkan-content-text,.s-installment-rajehi-content-text{color:var(--main-text-color);font-size:14px;font-weight:500;margin:0 16px 0 0;width:80%;left:14px;text-align:left}.s-installment-mispay-content img,.s-installment-madfu-content img,.s-installment-emkan-content img,.s-installment-rajehi-content img{height:28px;width:70px;display:inline-block;max-height:100%;vertical-align:middle;fill:none;stroke:unset;width:auto}.rtl .s-installment-mispay-content-text,.rtl .s-installment-madfu-content-text,.rtl .s-installment-emkan-content-text,.rtl .s-installment-rajehi-content-text{right:14px;text-align:right;margin:0 0 0 16px}.rtl .s-installment-mispay-content img,.rtl .s-installment-madfu-content img,.rtl .s-installment-emkan-content img,.rtl .s-installment-rajehi-content img{left:14px !important}.ltr .s-installment-mispay-content img,.ltr .s-installment-madfu-content img,.ltr .s-installment-emkan-content img,.ltr .s-installment-rajehi-content img{right:14px !important}.s-installment-rajehi-content img{width:70px !important;height:40px !important}.s-installment-emkan-content img{height:35px !important}";const o=class{constructor(a){t(this,a);this.tabbyBorderRemoved=false;this.tabbyRemoveBorderTries=0;this.language=salla.config.get("user.language_code");this.currency=salla.config.get("user.currency_code");this.country=salla.config.get("user.country_code");this.installment_sheria_text=(t,a)=>salla.lang.get(t,a)}async componentWillLoad(){await salla.onReady();await salla.lang.onLoaded();this.currency=salla.config.get("user.currency_code")||"SAR";this.language=salla.config.get("user.language_code")||"ar";this.country=salla.config.get("user.country_code")||"SA";const t=[{key:"pages.products.installments",installments:3},{key:"pages.products.installments_emkan",installments:5}];t.forEach((t=>{this.installment_sheria_text(t.key,{payment:salla.money(parseFloat(this.price)),amount:salla.money((parseFloat(this.price)/t.installments).toFixed(2)).replace(/\.00$/,""),installments:t.installments})}));const a=salla.config.get("store.settings.installments");if(a){this.tamaraIsActive=a.tamara;this.tabbyIsActive=a.tabby;this.spotiiIsActive=a.spotii;this.mispayActive=a.mispay;this.emkanIsActive=a.emkan;this.madfuActive=a.madfu;this.rajehiIsActive=a.mokafaa_alrajhi}salla.event.on("product::price.updated",(({data:t})=>{if(!t.price||t.price==this.price){return}this.price=t.price;this.renderInstallments(true)}))}componentDidLoad(){this.renderInstallments()}render(){var t;const s=this.currency==="SAR";if(!this.isValidPrice(this.price)){return""}return a(i,null,this.tamaraIsActive&&(((t=this.tamaraIsActive)===null||t===void 0?void 0:t.publicKey)?a("div",{class:"mb-5"},a("tamara-widget",{type:"tamara-summary","inline-type":"2",amount:this.price})):a("div",{class:"tamara-product-widget","data-price":this.price,"data-currency":this.currency,"data-lang":this.language,"data-payment-type":"installment"})),this.tabbyIsActive?a("div",{id:"tabbyPromoWrapper"},a("div",{id:"tabbyPromo"})):"",this.spotiiIsActive?a("div",{class:"spotii-wrapper"},a("div",{class:"spotii-promo"})):"",this.shouldShowMispay()&&(this.mispayActive.publicKey?a("div",{class:"mb-5"},a("mispay-widget",{amount:this.price,lang:this.language})):a("div",{class:"s-installment-mispay-wrapper"},a("div",{class:"s-installment-mispay-content"},a("img",{src:salla.url.cdn("images/payment/png/mispay.png"),alt:"mispay"}),a("span",{class:"s-installment-mispay-content-text",innerHTML:this.installment_sheria_text("pages.products.installments",{payment:salla.money(parseFloat(this.price)),amount:salla.money((parseFloat(this.price)/4).toFixed(2)),installments:4})})))),this.emkanIsActive&&this.currency==="SAR"?a("div",{class:"s-installment-emkan-wrapper"},a("div",{class:"s-installment-emkan-content"},a("img",{src:salla.url.cdn("images/payment/png/emkan.png"),alt:"emkan"}),a("span",{class:"s-installment-emkan-content-text",innerHTML:this.installment_sheria_text("pages.products.installments_emkan",{payment:salla.money(parseFloat(this.price)),installments:5})}))):"",this.madfuActive&&this.currency==="SAR"?a("div",{class:"s-installment-madfu-wrapper"},a("div",{class:"s-installment-madfu-content"},a("img",{src:salla.url.cdn("images/payment/png/madfu.png"),alt:"madfu"}),a("span",{class:"s-installment-madfu-content-text"},salla.lang.get("pages.products.installments_madfu")))):"",s&&this.rajehiIsActive?a("div",{class:"s-installment-rajehi-wrapper"},a("div",{class:"s-installment-rajehi-content"},a("img",{src:salla.url.cdn("images/payment/png/mokafaa_alrajhi_loyalty.png"),alt:"mokafaa_alrajhi_loyalty"}),a("span",{class:"s-installment-rajehi-content-text"},salla.lang.get("pages.products.rajahi_earn_points",{points:Math.floor(+this.price*this.rajehiIsActive.pointsPerRiyal)})))):"")}renderInstallments(t=false){if(!this.isValidPrice(this.price)){return}if(this.tamaraIsActive){this.loadTamara({isUpdating:t})}if(this.tabbyIsActive){if(t){var a=this.host.querySelector("#tabbyPromoWrapper");if(a){a.remove()}var i=document.createElement("div");i.setAttribute("id","tabbyPromoWrapper");var s=document.createElement("div");s.setAttribute("id","tabbyPromo");i.appendChild(s);this.host.appendChild(i);var e=document.querySelector('script[src="https://checkout.tabby.ai/tabby-promo.js"]');if(e){e.remove()}}var o=document.createElement("script");o.setAttribute("src","https://checkout.tabby.ai/tabby-promo.js");document.head.appendChild(o);o.onload=()=>{const t=window.TabbyPromo;new t({selector:"#tabbyPromo",currency:this.currency,price:this.price,lang:this.language,publicKey:salla.config.get("store.settings.installments.tabby.publicKey"),merchantCode:salla.config.get("store.settings.installments.tabby.merchantCode")});document.querySelectorAll(".tabby-promo-snippet__logo").forEach((function(t){t.setAttribute("aria-label","Tabby Logo")}))};this.removeTabbyBorder()}if(this.spotiiIsActive){if(t){var r=this.host.querySelector(".spotii-wrapper");if(r){r.remove()}var n=document.createElement("div");n.classList.add("spotii-wrapper");var l=document.createElement("div");l.classList.add("spotii-promo");n.appendChild(l);this.host.appendChild(n);var p=document.querySelector('script[src="'+salla.url.cdn("js/price-widget-ar-salla.js")+'"]');if(p){p.remove()}}let a=salla.money((Number(this.price)/3).toFixed(2),false);let i=salla.config.get("theme.is_rtl",true);window.spotiiConfig={targetXPath:[".spotii-wrapper"],renderToPath:[".spotii-promo"],numberOfPayment:3,currency:this.currency,templateLine:"${textOne} ${number} ${textTwo} "+a+"${logo} ${info}",textOne:i?"جزء الدفع على":"Split it into",textTwo:i?"أقساط متساوية بدون تكاليف اضافية بقيمة":"payments of",textThree:"مع",price:this.price};var m=document.createElement("script");m.setAttribute("src",salla.url.cdn("js/price-widget-ar-salla.js"));document.head.appendChild(m)}if(this.shouldShowMispay()&&this.mispayActive.publicKey){this.loadExternalScript({position:"head",src:`https://widget.mispay.co/v1/sdk.js?authorize=${this.mispayActive.publicKey}`})}}isValidPrice(t){const a=/^\d+(\.\d{1,2})?$/;const i=a.test(t);const s=parseFloat(t)>0;return i&&s}loadExternalScript({src:t,onLoad:a,position:i}){const s=document.createElement("script");s.src=t;s.onload=a;document[i].appendChild(s)}loadTamara({isUpdating:t}){var a,i;const s=!!((a=this.tamaraIsActive)===null||a===void 0?void 0:a.publicKey);if(t){setTimeout((()=>{var t,a;if(s){return(t=window.TamaraWidgetV2)===null||t===void 0?void 0:t.refresh()}(a=window.TamaraProductWidget)===null||a===void 0?void 0:a.render()}),300)}else{if(s){const t=salla.config.get("user.language_code");const a=["ar","en"].includes(t)?t:"ar";const s=(i=this.currency)===null||i===void 0?void 0:i.slice(0,-1);const e=["SA","AE","KW","BH","OM","QA"].includes(s)?s:null;if(!e){console.error("Tamara: Country code is not supported",s)}else{window.tamaraWidgetConfig={lang:a,country:e,publicKey:this.tamaraIsActive.publicKey,style:{fontSize:"14px"}};this.loadExternalScript({position:"head",src:"https://cdn.tamara.co/widget-v2/tamara-widget.js"})}}else{this.loadExternalScript({position:"head",src:"https://cdn.tamara.co/widget/product-widget.min.js",onLoad:()=>{window.TamaraProductWidget.init({lang:this.language});setTimeout((()=>{window.TamaraProductWidget.render()}),300)}})}}}shouldShowMispay(){return this.currency==="SAR"&&this.mispayActive}removeTabbyBorder(){if(this.tabbyBorderRemoved||this.tabbyRemoveBorderTries>5){return}this.tabbyRemoveBorderTries++;setTimeout((()=>{let t=document.querySelector("#tabbyPromo>div>div");t=t&&t.shadowRoot?t.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]'):null;if(t){t.style="border: none; margin: 15px 0!important;";this.tabbyBorderRemoved=true}else{this.removeTabbyBorder()}}),this.tabbyRemoveBorderTries*500)}get host(){return s(this)}};o.style=e;export{o as salla_installment};
|
|
5
|
+
//# sourceMappingURL=p-322c43c3.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,a,l,e){function s(t){return t instanceof l?t:new l((function(a){a(t)}))}return new(l||(l=Promise))((function(l,n){function r(t){try{c(e.next(t))}catch(t){n(t)}}function i(t){try{c(e["throw"](t))}catch(t){n(t)}}function c(t){t.done?l(t.value):s(t.value).then(r,i)}c((e=e.apply(t,a||[])).next())}))};var __generator=this&&this.__generator||function(t,a){var l={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},e,s,n,r;return r={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function i(t){return function(a){return c([t,a])}}function c(i){if(e)throw new TypeError("Generator is already executing.");while(r&&(r=0,i[0]&&(l=0)),l)try{if(e=1,s&&(n=i[0]&2?s["return"]:i[0]?s["throw"]||((n=s["return"])&&n.call(s),0):s.next)&&!(n=n.call(s,i[1])).done)return n;if(s=0,n)i=[i[0]&2,n.value];switch(i[0]){case 0:case 1:n=i;break;case 4:l.label++;return{value:i[1],done:false};case 5:l.label++;s=i[1];i=[0];continue;case 7:i=l.ops.pop();l.trys.pop();continue;default:if(!(n=l.trys,n=n.length>0&&n[n.length-1])&&(i[0]===6||i[0]===2)){l=0;continue}if(i[0]===3&&(!n||i[1]>n[0]&&i[1]<n[3])){l.label=i[1];break}if(i[0]===6&&l.label<n[1]){l.label=n[1];n=i;break}if(n&&l.label<n[2]){l.label=n[2];l.ops.push(i);break}if(n[2])l.ops.pop();l.trys.pop();continue}i=a.call(t,l)}catch(t){i=[6,t];s=0}finally{e=n=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-B6dZG1Ey.system.js"],(function(t){"use strict";var a,l,e;return{setters:[function(t){a=t.r;l=t.h;e=t.H}],execute:function(){var s=".s-wallet-table{min-width:100%}.s-wallet-table-balance-container{display:-ms-flexbox !important;display:flex !important;-ms-flex-align:center !important;align-items:center !important;-ms-flex-pack:start !important;justify-content:flex-start !important;gap:1rem}.s-wallet-table-balance-icon{border-radius:50%;width:52px;height:52px;font-size:25px;padding:16px 13px;background:var(--color-primary-reverse);color:var(--color-primary)}.s-wallet-table-empty-state{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.s-wallet-table-empty-state i{font-size:80px;margin:4rem 0 2rem;color:var(--infinte-color)}.s-wallet-table-transaction-status{padding:6px 19px !important;border-radius:20px;width:-webkit-max-content;width:-moz-max-content;width:max-content;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.s-wallet-table-transaction-status-default{background:#fff6eb;color:#a46f29}.s-wallet-table-transaction-status-cashback{background:#effbf6;color:#00af6c}.s-wallet-table-transaction-status-refund{background:#ecf3fe;color:#5196f3}.s-wallet-table-transaction-status-purchase{background:#feecec;color:#f55157}.s-wallet-table-transaction-status-icons-success{color:#00af6c}";var n=t("salla_wallet",function(){function t(t){var l=this;a(this,t);this.isLoading=false;this.nextPageUrl="";this.handleClick=function(){l.loadMoreTransactions()}}t.prototype.componentWillLoad=function(){var t=this;return salla.onReady().then((function(){return t.loadTransactions()}))};t.prototype.loadTransactions=function(){return __awaiter(this,void 0,void 0,(function(){var t,a,l;return __generator(this,(function(e){switch(e.label){case 0:this.isLoading=true;e.label=1;case 1:e.trys.push([1,3,4,5]);t="/balance/wallet?per_page=10&page=1";return[4,salla.api.request(t)];case 2:a=e.sent();this.nextPageUrl=a.data.transactions.next_page_url;this.transactionsArray=a.data.transactions;this.balance=a.data.balance;return[3,5];case 3:l=e.sent();console.error("Error loading wallet transactions",l);return[3,5];case 4:this.isLoading=false;return[7];case 5:return[2]}}))}))};t.prototype.loadMoreTransactions=function(){return __awaiter(this,void 0,void 0,(function(){var t,a,l;var e;return __generator(this,(function(s){switch(s.label){case 0:this.isLoading=true;s.label=1;case 1:s.trys.push([1,3,4,5]);t=this.nextPageUrl||"/balance/wallet?page=2&per_page=10";return[4,salla.api.request(t)];case 2:a=s.sent();this.nextPageUrl=a.data.transactions.next_page_url;(e=this.transactionsArray).push.apply(e,a.data.transactions.data);this.balance=a.data.balance;return[3,5];case 3:l=s.sent();console.error("Error loading wallet transactions",l);return[3,5];case 4:this.isLoading=false;return[7];case 5:return[2]}}))}))};t.prototype.render=function(){if(this.transactionsArray.length>0){return l(e,null,l("table",{class:"s-wallet-table"},l("tbody",{class:"s-wallet-table-tbody"},l("tr",{class:"s-table__tr"},l("td",null,l("div",{class:"s-wallet-table-balance-container"},l("i",{class:"s-wallet-table-balance-icon sicon-wallet"}),l("div",null,l("div",{innerHTML:salla.money(this.balance)}),l("div",{class:"font-normal text-gray-400"}," ",salla.lang.get("pages.wallet.balance")))))))),l("h2",{style:{"margin-top":"32px"}},salla.lang.get("pages.wallet.title")),l("table",{class:"s-wallet-table"},l("thead",{class:"s-wallet-table-head"},l("tr",{class:"s-wallet-table-head-tr"},l("th",{scope:"col"},salla.lang.get("pages.wallet.transaction_number")),l("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.amount")),l("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.date")),l("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.order_no")),l("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.expiry_date")),l("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.transaction_type")," "))),l("tbody",{class:"s-wallet-table-tbody"},this.transactionsArray.map((function(t){return l("tr",{class:"s-wallet-table-tbody-tr s-wallet-table-tbody-tr-shadow animated"},l("td",{class:"s-wallet-table-tbody-tr-td"},l("div",{class:"s-wallet-table-tbody-tr-td-content"},l("span",{class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.transaction_number"),":"),t.id&&l("span",{class:"hidden md:inline-block"},"#",t.id),l("div",{class:"flex items-center md:hidden"},l("salla-button",{class:"relative",color:"dark",shape:"link","data-content":t.order_id},t.order_id&&l("span",null,"#",t.order_id))))),l("td",{id:"main123",class:"s-wallet-table-tbody-tr-td"},l("div",{id:"main124",class:"s-wallet-table-tbody-tr-td-content"},l("span",{id:"main125",class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.amount"),":"),l("div",{innerHTML:salla.money(t.amount)}))),l("td",{class:"s-wallet-table-tbody-tr-td"},l("div",{class:"s-wallet-table-tbody-tr-td-content"},l("span",{class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.date"),":"),t.created_at&&new Date(t.created_at*1e3).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"}))),l("td",{id:"main133",class:"s-wallet-table-tbody-tr-td"},l("div",{id:"main134",class:"s-wallet-table-tbody-tr-td-content"},l("span",{id:"main135",class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.order_no"),":"),l("span",{class:"rtl:mr-auto ltr:ml-auto md:mx-0"},t.order_id&&l("span",null,"#",t.order_id)))),l("td",{id:"main143",class:"s-wallet-table-tbody-tr-td"},l("div",{id:"main144",class:"s-wallet-table-tbody-tr-td-content"},l("span",{id:"main145",class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.expiry_date"),":"),l("span",null,t.expired_at&&new Date(t.expired_at*1e3).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"})))),l("td",{class:"s-wallet-table-tbody-tr-td"},l("div",{class:"s-wallet-table-tbody-tr-td-content"},l("div",null,l("span",{class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.transaction_type"),":")),l("div",{class:{"s-wallet-table-transaction-status-default":true,"s-wallet-table-transaction-status-cashback":t.action_type==="cashback","s-wallet-table-transaction-status-refund":t.action_type==="refund","s-wallet-table-transaction-status-purchase":t.action_type==="purchase_by_wallet"}},!!t.description&&l("i",{id:t.id.toString(),class:"sicon-information text-lg rtl:ml-4 ltr:mr-4 s-wallet-table-transaction-status-icon-success"}),!!t.description&&l("salla-tooltip",{text:t.description,targetId:t.id.toString()}),l("span",null,t.title)))))})))),l("div",{class:"s-infinite-scroll-wrapper"},!!this.nextPageUrl&&l("salla-button",{onClick:this.handleClick,loading:this.isLoading},salla.lang.get("common.elements.load_more"))))}else{return l(e,null,l("h2",{style:{"margin-top":"32px"}},salla.lang.get("pages.wallet.title")),l("div",{class:"s-wallet-table-empty-state"},l("i",{class:"sicon-full-wallet"}),l("div",{class:"text-center p-3 text-xl font-bold "},salla.lang.get("pages.wallet.no_transactions")),l("div",{class:"text-center text-gray-400 text-sm font-normal "},salla.lang.get("pages.wallet.zero_balance")," ")))}};return t}());n.style=s}}}));
|
|
5
|
+
//# sourceMappingURL=p-32cadc2e.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 e}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as s,h as t,H as a,g as e}from"./p-bWnWhxOm.js";const o="";const i=class{constructor(t){s(this,t);this.collapsible=true;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(a,{key:"30e906d87cba59e197e71460bb24e578455f2d28",class:`s-accordion-wrapper ${this.dir}`,"data-collapsed":this.collapsed.toString()},t("slot",{key:"8c26efc12856022567e5abe587c7537a5776285b"}))}get host(){return e(this)}};i.style=o;export{i as salla_accordion};
|
|
5
|
+
//# sourceMappingURL=p-32fa0012.entry.js.map
|