@salla.sa/twilight-components 2.14.545 → 2.14.546
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/{filepond-B5aWlI3l.js → filepond-CbpPZZga.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-BYq39KHd.js → filepond-plugin-file-poster-BmWPw2D9.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-Bi3TAsJv.js → filepond-plugin-file-validate-size-De7XZguT.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-Ck6S5TuZ.js → filepond-plugin-file-validate-type-BHdxCuXU.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-DbsdnH5j.js → filepond-plugin-image-edit-DJZbgt5_.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-x7TfJR-2.js → filepond-plugin-image-exif-orientation-BtLJO8iG.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-CrU7vIRk.js → filepond-plugin-image-preview-BRUyTRh3.js} +1 -1
- package/dist/cjs/{index-DGpOR-TH.js → index-EoqYCrI-.js} +2 -2
- package/dist/cjs/{intlTelInput-DKAXRecW.js → intlTelInput-CxKIlDCD.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.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-attachment-view_9.cjs.entry.js +10 -10
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
- package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_8.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-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.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-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +7 -4
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.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-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +1 -1
- package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/salla-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.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-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.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/salla-wishlist-actions.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +1 -1
- package/dist/cjs/{vanilla-picker-DQDSSf6Q.js → vanilla-picker-ClshNzKX.js} +1 -1
- package/dist/collection/components/salla-gifting/salla-gifting.js +6 -3
- package/dist/components/index.js +2 -2
- package/dist/components/salla-gifting.js +6 -3
- package/dist/esm/{filepond-wd7_MQSV.js → filepond-CF5m44bJ.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-CkWxCmZT.js → filepond-plugin-file-poster-CcB1Ah8E.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-DlWS-oUK.js → filepond-plugin-file-validate-size-BwVhV38u.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-mdpFM1TG.js → filepond-plugin-file-validate-type-GBCLCzPk.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-BqPLKgZU.js → filepond-plugin-image-edit-CrBe3Dh3.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-CMqFjPu7.js → filepond-plugin-image-exif-orientation-C2Cj5Jrc.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-DjCwk-CI.js → filepond-plugin-image-preview-YVKQw3-Q.js} +1 -1
- package/dist/esm/{index-CHZfg_a9.js → index-FwRU05yW.js} +2 -2
- package/dist/esm/{intlTelInput-B5Q8rrU9.js → intlTelInput-B1_kbUW3.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +1 -1
- package/dist/esm/salla-add-product-button_5.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.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-attachment-view_9.entry.js +10 -10
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-basket-gap.entry.js +1 -1
- package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
- package/dist/esm/salla-cart-coupons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
- package/dist/esm/salla-cart-summary-card.entry.js +1 -1
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-factors.entry.js +1 -1
- package/dist/esm/salla-comment-form_8.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-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.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-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +7 -4
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
- package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_2.entry.js +1 -1
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-next-order-coupon.entry.js +1 -1
- package/dist/esm/salla-notification-item_2.entry.js +1 -1
- package/dist/esm/salla-offer-modal.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-branch.entry.js +1 -1
- package/dist/esm/salla-order-cancel.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-edit-item.entry.js +1 -1
- package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
- package/dist/esm/salla-order-edit.entry.js +1 -1
- package/dist/esm/salla-order-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-order-shipments.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.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-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +1 -1
- package/dist/esm/salla-products-slider.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-review-factors-tags.entry.js +1 -1
- package/dist/esm/salla-review-order-item.entry.js +1 -1
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +1 -1
- package/dist/esm/salla-skeleton.entry.js +1 -1
- package/dist/esm/salla-slider.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.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-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.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/salla-wishlist-actions.entry.js +1 -1
- package/dist/esm/twilight.js +2 -2
- package/dist/esm/{vanilla-picker-uNDULydX.js → vanilla-picker-oTEQUNmA.js} +1 -1
- package/dist/twilight/{p-98108ebe.entry.js → p-01e01e63.entry.js} +1 -1
- package/dist/twilight/{p-ffdf5f92.entry.js → p-06335f34.entry.js} +1 -1
- package/dist/twilight/{p-25d9f1b2.entry.js → p-0fc9be21.entry.js} +1 -1
- package/dist/twilight/{p-64efbb2c.entry.js → p-110bd105.entry.js} +1 -1
- package/dist/twilight/{p-2de58591.entry.js → p-1286f679.entry.js} +1 -1
- package/dist/twilight/{p-28248b6b.entry.js → p-13fc84ad.entry.js} +1 -1
- package/dist/twilight/{p-9d224252.entry.js → p-158e1872.entry.js} +1 -1
- package/dist/twilight/{p-3a8be7df.entry.js → p-176b9746.entry.js} +1 -1
- package/dist/twilight/{p-3f5bc617.entry.js → p-179625fd.entry.js} +1 -1
- package/dist/twilight/{p-5ded000f.entry.js → p-1a7b7e21.entry.js} +1 -1
- package/dist/twilight/{p-c81bce54.entry.js → p-26ae2623.entry.js} +1 -1
- package/dist/twilight/{p-6ff53523.entry.js → p-2862c6bb.entry.js} +1 -1
- package/dist/twilight/{p-279a1661.entry.js → p-298b9d8a.entry.js} +1 -1
- package/dist/twilight/{p-6d961d73.entry.js → p-2dd4ddc7.entry.js} +1 -1
- package/dist/twilight/{p-345532e5.entry.js → p-2dfd3810.entry.js} +1 -1
- package/dist/twilight/{p-12836275.entry.js → p-2f6ba6f1.entry.js} +1 -1
- package/dist/twilight/{p-88f50d7e.entry.js → p-3250ee03.entry.js} +1 -1
- package/dist/twilight/{p-c287e498.entry.js → p-3446e76a.entry.js} +1 -1
- package/dist/twilight/{p-c9146d50.entry.js → p-34f38efd.entry.js} +1 -1
- package/dist/twilight/{p-3672d4f7.entry.js → p-46d047ac.entry.js} +1 -1
- package/dist/twilight/{p-5074de7d.entry.js → p-49117243.entry.js} +1 -1
- package/dist/twilight/{p-2d62c947.entry.js → p-51add824.entry.js} +1 -1
- package/dist/twilight/{p-1ea25389.entry.js → p-52f4642b.entry.js} +1 -1
- package/dist/twilight/{p-d0d3609c.entry.js → p-53184934.entry.js} +1 -1
- package/dist/twilight/{p-b279e0bb.entry.js → p-55aa8c39.entry.js} +1 -1
- package/dist/twilight/{p-c816b198.entry.js → p-5cfc9f8c.entry.js} +1 -1
- package/dist/twilight/{p-8fc6e860.entry.js → p-5df95bdb.entry.js} +1 -1
- package/dist/twilight/{p-b33392c6.entry.js → p-6081d494.entry.js} +1 -1
- package/dist/twilight/{p-17d49c87.entry.js → p-61953ae7.entry.js} +1 -1
- package/dist/twilight/{p-54e2d320.entry.js → p-61ae00d6.entry.js} +1 -1
- package/dist/twilight/{p-f1d8729d.entry.js → p-65be2237.entry.js} +1 -1
- package/dist/twilight/{p-82fe9f82.entry.js → p-662a5816.entry.js} +1 -1
- package/dist/twilight/{p-74529abb.entry.js → p-682dc578.entry.js} +1 -1
- package/dist/twilight/{p-f07bbbc7.entry.js → p-682f00d1.entry.js} +1 -1
- package/dist/twilight/{p-b38c4e39.entry.js → p-718a5f9b.entry.js} +1 -1
- package/dist/twilight/{p-25f51a7e.entry.js → p-71ff2062.entry.js} +1 -1
- package/dist/twilight/{p-766a3291.entry.js → p-72dba918.entry.js} +1 -1
- package/dist/twilight/{p-87e10a68.entry.js → p-736e9843.entry.js} +1 -1
- package/dist/twilight/{p-dd823fde.entry.js → p-74bee051.entry.js} +1 -1
- package/dist/twilight/{p-0495bfac.entry.js → p-75de4995.entry.js} +1 -1
- package/dist/twilight/{p-84380d4a.entry.js → p-767d37bb.entry.js} +1 -1
- package/dist/twilight/{p-0573a498.entry.js → p-79e3d1dd.entry.js} +1 -1
- package/dist/twilight/{p-a785b49f.entry.js → p-7df2c1d5.entry.js} +1 -1
- package/dist/twilight/{p-419499d6.entry.js → p-7fafe29c.entry.js} +1 -1
- package/dist/twilight/{p-c26043ff.entry.js → p-87ba263e.entry.js} +1 -1
- package/dist/twilight/{p-2db5e829.entry.js → p-904ca909.entry.js} +1 -1
- package/dist/twilight/{p-2305edcc.entry.js → p-92175855.entry.js} +1 -1
- package/dist/twilight/{p-12f61ae1.entry.js → p-96826106.entry.js} +1 -1
- package/dist/twilight/{p-a0561bd1.entry.js → p-981da139.entry.js} +1 -1
- package/dist/twilight/{p-PCp-0mbL.js → p-B9dZFOmF.js} +1 -1
- package/dist/twilight/{p-BWvO3cE-.js → p-BLBFg-He.js} +1 -1
- package/dist/twilight/{p-BPkSO6gd.js → p-BcYofOgx.js} +1 -1
- package/dist/twilight/{p-CdgES2Of.js → p-BxHJHdpj.js} +1 -1
- package/dist/twilight/{p-ryHWESoh.js → p-CCPvqpeZ.js} +1 -1
- package/dist/twilight/{p-DtV7npW9.js → p-CiKg2aqy.js} +1 -1
- package/dist/twilight/{p-ZinKLSYw.js → p-DyxHX342.js} +1 -1
- package/dist/twilight/{p-CHZfg_a9.js → p-FwRU05yW.js} +1 -1
- package/dist/twilight/{p-afb03ee5.entry.js → p-a32bad0b.entry.js} +1 -1
- package/dist/twilight/{p-51a062cd.entry.js → p-a3897cf4.entry.js} +1 -1
- package/dist/twilight/{p-37163aef.entry.js → p-a7346ee5.entry.js} +1 -1
- package/dist/twilight/{p-32e3daa3.entry.js → p-a91c674c.entry.js} +1 -1
- package/dist/twilight/{p-93dabb47.entry.js → p-ad30742f.entry.js} +1 -1
- package/dist/twilight/{p-2d01a4f5.entry.js → p-ada73e68.entry.js} +1 -1
- package/dist/twilight/{p-c948a8a8.entry.js → p-ae8cbf4f.entry.js} +1 -1
- package/dist/twilight/{p-90e5c3ab.entry.js → p-b0730cef.entry.js} +1 -1
- package/dist/twilight/{p-6c18cc72.entry.js → p-b389fa5c.entry.js} +1 -1
- package/dist/twilight/{p-72ee7071.entry.js → p-b7ae6c1c.entry.js} +1 -1
- package/dist/twilight/{p-93aa1b67.entry.js → p-b95b3bf0.entry.js} +1 -1
- package/dist/twilight/{p-1419a93d.entry.js → p-b9634ee2.entry.js} +1 -1
- package/dist/twilight/{p-5933ba05.entry.js → p-b98fb8ae.entry.js} +1 -1
- package/dist/twilight/{p-ec281904.entry.js → p-bc98ccad.entry.js} +1 -1
- package/dist/twilight/{p-35557962.entry.js → p-bcf3d118.entry.js} +1 -1
- package/dist/twilight/{p-aa4daadf.entry.js → p-c078fb93.entry.js} +1 -1
- package/dist/twilight/{p-f1dfe18b.entry.js → p-c2980ef7.entry.js} +1 -1
- package/dist/twilight/{p-63b01300.entry.js → p-c3208f6d.entry.js} +1 -1
- package/dist/twilight/{p-06d9e1c5.entry.js → p-c4be5709.entry.js} +1 -1
- package/dist/twilight/{p-5d9a85b0.entry.js → p-cac60dea.entry.js} +1 -1
- package/dist/twilight/{p-8780a467.entry.js → p-cb737c93.entry.js} +1 -1
- package/dist/twilight/{p-ab41d26c.entry.js → p-cc8209fc.entry.js} +1 -1
- package/dist/twilight/{p-4ac9a3b6.entry.js → p-ceceeaed.entry.js} +1 -1
- package/dist/twilight/{p-c603722c.entry.js → p-d11f2263.entry.js} +1 -1
- package/dist/twilight/{p-72f54055.entry.js → p-d295757a.entry.js} +1 -1
- package/dist/twilight/{p-c92edd6f.entry.js → p-d550f1f9.entry.js} +1 -1
- package/dist/twilight/{p-0749cc55.entry.js → p-d76abd6d.entry.js} +1 -1
- package/dist/twilight/{p-788fd019.entry.js → p-d8313f41.entry.js} +1 -1
- package/dist/twilight/{p-0ae39262.entry.js → p-dcf9417c.entry.js} +1 -1
- package/dist/twilight/{p-fb1ad954.entry.js → p-df069a34.entry.js} +1 -1
- package/dist/twilight/{p-d9b0fa64.entry.js → p-df48abfb.entry.js} +1 -1
- package/dist/twilight/p-dfdf96be.entry.js +4 -0
- package/dist/twilight/{p-989f2adb.entry.js → p-e2df9129.entry.js} +1 -1
- package/dist/twilight/{p-bead6e6f.entry.js → p-e71c064e.entry.js} +1 -1
- package/dist/twilight/{p-e36f62a9.entry.js → p-e73bab6b.entry.js} +1 -1
- package/dist/twilight/{p-832f3a98.entry.js → p-e7819b7b.entry.js} +1 -1
- package/dist/twilight/{p-346366ba.entry.js → p-e7a672b4.entry.js} +1 -1
- package/dist/twilight/{p-67b91397.entry.js → p-eeb89f05.entry.js} +1 -1
- package/dist/twilight/{p-69119c00.entry.js → p-f15f6265.entry.js} +1 -1
- package/dist/twilight/{p-c2fe2dbe.entry.js → p-f55eb61c.entry.js} +1 -1
- package/dist/twilight/{p-391a2ec6.entry.js → p-f63aecb0.entry.js} +1 -1
- package/dist/twilight/{p-f168109d.entry.js → p-f6493289.entry.js} +1 -1
- package/dist/twilight/{p-235d7596.entry.js → p-f7b8430f.entry.js} +1 -1
- package/dist/twilight/{p-DO7S0QBX.js → p-j-4Intu2.js} +1 -1
- package/dist/twilight/{p-D9VjvNQq.js → p-qzPm0si4.js} +2 -2
- package/dist/twilight/twilight.esm.js +1 -1
- package/package.json +5 -5
- package/dist/twilight/p-e5a3b689.entry.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as n,H as e}from"./p-CHZfg_a9.js";const o=class{constructor(n){t(this,n),this.size="md",this.color="dark",this.digits="auto",this.autoSegments=!1,this.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم"),this.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة"),this.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة"),this.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية"),this.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض"),this.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح"),this.offerEnded=!1,this.parseFailed=!1,this.showDays=!0,this.showHours=!0,this.days=this.number(0),this.hours=this.number(0),this.minutes=this.number(0),this.seconds=this.number(0),salla.lang.onLoaded((()=>{this.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم"),this.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة"),this.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة"),this.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح"),this.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية"),this.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض")})),this.date&&this.isValidDate(this.date)&&this.startCountDown()}async endCountDown(){clearInterval(this.countInterval),this.offerEnded=!0,this.days=this.number(0),this.hours=this.number(0),this.minutes=this.number(0),this.seconds=this.number(0)}componentWillLoad(){if("string"==typeof this.preOrder)try{this.normalizedPreOrder=JSON.parse(this.preOrder)}catch{this.normalizedPreOrder=void 0}else this.normalizedPreOrder=this.preOrder;this.normalizedPreOrder?.end_date&&(this.date=this.normalizedPreOrder.end_date),this.date&&this.isValidDate(this.date)&&this.startCountDown()}normalizeDate(t){const n=t.match(/^(\d{1,2})-(\d{1,2})-(\d{4}),(\d{1,2}):(\d{2}):(\d{2})\s*(am|pm)$/i);if(n){const[,t,e,o,i,r,s,a]=n;let c=parseInt(i,10);"pm"===a.toLowerCase()&&c<12&&(c+=12),"am"===a.toLowerCase()&&12===c&&(c=0);const d=String(c).padStart(2,"0");return`${o}-${String(t).padStart(2,"0")}-${String(e).padStart(2,"0")} ${d}:${r}:${s}`}const e=t.match(/^(\d{1,2})-(\d{1,2})-(\d{4})$/);if(e){const[,t,n,o]=e;return`${o}-${String(t).padStart(2,"0")}-${String(n).padStart(2,"0")}`}const o=t.match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[ T](\d{1,2}:\d{2}:\d{2}))?$/);if(o){const[,t,n,e,i]=o,r=String(n).padStart(2,"0"),s=String(e).padStart(2,"0");return i?`${t}-${r}-${s} ${i}`:`${t}-${r}-${s}`}return t}isValidDate(t){const n=this.normalizeDate(t);let e,o=n.includes("-"),i=n.split(" ");return e=o?i[0].replace(/-/g,"/"):i[0],!isNaN(Date.parse(e))}number(t){const n=String(Math.max(0,Math.floor(t))).padStart(2,"0");return salla.helpers.number(n,"en"===this.digits)}startCountDown(){const t=this.normalizeDate(this.date),n=t.includes("-"),e=this.endOfDay||1===t.split(" ").length;let o;if(n){const n=e?`${t.split(" ")[0]}T23:59:59+03:00`:`${t.replace(" ","T")}+03:00`;o=new Date(n).getTime()}else{const n=new Date(t);e&&n.setHours(23,59,59,999),o=n.getTime()}if(Number.isNaN(o))return salla.logger.warn(`[salla-count-down] unable to parse date: "${this.date}"`),void(this.parseFailed=!0);const i=()=>{const t=o-Date.now(),n=Math.floor(t/864e5),e=Math.floor(t%864e5/36e5);this.days=this.number(n),this.hours=this.number(e),this.minutes=this.number(Math.floor(t%36e5/6e4)),this.seconds=this.number(Math.floor(t%6e4/1e3)),this.autoSegments&&(this.showDays=n>0,this.showHours=n>0||e>0),t<0&&this.endCountDown()};this.countInterval=setInterval(i,1e3),i()}renderCountDown(){const t=this.boxTheme?`var(--color-${this.boxTheme})`:this.boxColor,e=this.boxed&&t?{backgroundColor:t}:void 0;return n("ul",{class:`s-count-down-list ${this.boxed?"s-count-down-boxed":""} ${this.offerEnded?"s-count-down-ended":""} s-count-down-${this.size} s-count-down-${this.color}`,style:this.listPadding?{paddingLeft:this.listPadding,paddingRight:this.listPadding}:void 0},n("li",{class:"s-count-down-item",style:e},n("div",{class:"s-count-down-item-value"},this.seconds),this.labeled&&n("div",{class:"s-count-down-item-label"},this.secondsLabel)),n("li",{class:"s-count-down-item",style:e},n("div",{class:"s-count-down-item-value"},this.minutes),this.labeled&&n("div",{class:"s-count-down-item-label"},this.minutesLabel)),(!this.autoSegments||this.showHours)&&n("li",{class:"s-count-down-item",style:e},n("div",{class:"s-count-down-item-value"},this.hours),this.labeled&&n("div",{class:"s-count-down-item-label"},this.hoursLabel)),(!this.autoSegments||this.showDays)&&n("li",{class:"s-count-down-item",style:e},n("div",{class:"s-count-down-item-value"},this.days),this.labeled&&n("div",{class:"s-count-down-item-label"},this.daysLabel)))}renderInvalidDate(){return n("div",{class:"s-count-down-text-center"},this.invalidDate)}renderOfferEnded(){return n("div",{class:"s-count-down-end-text"},this.endText?this.endText:this.endLabel)}renderPreOrderToBeAvailableOn(){return this.normalizedPreOrder?.availability_date&&this.isValidDate(this.normalizedPreOrder?.availability_date)?n("div",{class:"s-count-down-info-message"},n("i",{class:"sicon-info"}),n("span",null,salla.lang.getWithDefault("pages.products.expected_to_be","متوقَّع توفُّره بتاريخ:")),n("span",null,new Date(this.normalizedPreOrder?.availability_date).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric"}))):null}renderPreOrderCountDown(){return this.normalizedPreOrder?.activate_countdown?n("div",{class:"s-count-down-pre-order-container"},n("p",{class:"text-sm "},salla.lang.getWithDefault("pages.products.pre_order_ends_in","ينتهي الطلب المسبق خلال:")),this.renderCountDown()):null}renderPreOrder(){return n("div",null,"object"==typeof this.normalizedPreOrder&&this.normalizedPreOrder?.availability_date&&this.renderPreOrderToBeAvailableOn(),this.renderPreOrderCountDown())}renderPrefixText(){return this.prefixText?n("span",{class:"s-count-down-prefix-text"},this.prefixText):null}renderButton(){return this.withButton&&this.buttonText?n("salla-button",{color:"primary",size:"medium",href:this.buttonHref},this.buttonIcon?n("i",{class:this.buttonIcon}):null,n("span",null,this.buttonText)):null}renderContent(){return this.date?!this.isValidDate(this.date)||this.parseFailed?this.renderInvalidDate():this.preOrder?this.renderPreOrder():this.renderCountDown():null}render(){return n(e,{key:"e2805e528a52b71ad71f4f1f16a473947dafb5bc",class:`s-count-down-wrapper ${this.preOrder&&this.isValidDate(this.date)?"s-count-down-pre-order":""} ${this.horizontal?"s-count-down-horizontal":""} ${this.withButton?"s-count-down-with-button":""} ${this.offerEnded?"s-count-down-ended":""}`},this.renderPrefixText(),this.renderContent(),this.offerEnded&&this.renderOfferEnded(),this.renderButton())}};o.style='/*!twlt*/.s-count-down-horizontal{background-color:rgba(0, 0, 0, 0.06);background-color:color-mix(in srgb, var(--color-primary) 10%, transparent)}.text-sm{font-size:0.875rem;line-height:1.25rem}.s-basket-gap-card-offer .s-count-down-list{margin-left:-0px !important;margin-right:-0px !important;margin-bottom:0px !important;margin-top:0px !important;display:inline-flex;flex-wrap:nowrap;align-items:center;justify-content:flex-start !important;column-gap:0px;--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.s-basket-gap-card-offer .s-count-down-list:where([dir="ltr"],[dir="ltr"] *){flex-direction:row-reverse !important}.s-basket-gap-card-offer .s-count-down-list:where([dir="rtl"],[dir="rtl"] *){flex-direction:row !important}.s-basket-gap-card-offer .s-count-down-item{position:relative !important;margin-left:0px !important;margin-right:0px !important;display:inline-flex !important;width:auto !important;flex:none !important;flex-grow:0 !important;flex-direction:row !important;align-items:center !important;justify-content:center !important;padding-top:0px !important;padding-bottom:0px !important;padding-left:0px !important;padding-right:0px !important;font-size:12px !important;font-weight:700 !important;line-height:1 !important;--tw-text-opacity:1 !important;color:rgb(21 128 61 / var(--tw-text-opacity, 1)) !important}.s-basket-gap-card-offer .s-count-down-item-value{display:inline-block !important;width:2ch !important;min-width:2ch !important;text-align:center;--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);line-height:1}.s-basket-gap-card-offer .s-count-down-item-label{display:none}.s-basket-gap-entry .s-basket-gap-card-offer.s-basket-gap-card-offer .s-count-down-item::before{content:none !important}.s-basket-gap-entry .s-basket-gap-card-offer.s-basket-gap-card-offer .s-count-down-item::after{content:none !important;position:static;left:auto;right:auto;transform:none}[dir=\'rtl\'] .s-basket-gap-entry .s-basket-gap-card-offer.s-basket-gap-card-offer .s-count-down-item:not(:last-child)::after{content:\':\' !important;position:static;left:auto;right:auto;transform:none;margin-left:0.15rem;margin-right:0.15rem;color:#15803d;font-size:12px;font-weight:700;line-height:1}[dir=\'ltr\'] .s-basket-gap-entry .s-basket-gap-card-offer.s-basket-gap-card-offer .s-count-down-item:not(:first-child)::after{content:\':\' !important;position:static;left:auto;right:auto;transform:none;margin-left:0.15rem;margin-right:0.15rem;color:#15803d;font-size:12px;font-weight:700;line-height:1}.s-count-down-wrapper{position:relative}.s-count-down-list{margin-left:-0.25rem;margin-right:-0.25rem;margin-bottom:1.25rem;margin-top:0.625rem;display:flex;align-items:center;justify-content:space-between}.s-count-down-list:where([dir="ltr"],[dir="ltr"] *){flex-direction:row-reverse}.s-count-down-list:where([dir="rtl"],[dir="rtl"] *){flex-direction:row}.s-count-down-item{position:relative;margin-left:0.25rem;margin-right:0.25rem;display:flex;flex:1 1 0%;flex-direction:column;align-items:center;justify-content:center;padding-top:0.5rem;padding-bottom:0.5rem;font-family:var(--font-main);font-weight:700}.s-count-down-item::after{position:absolute;left:-2px;font-family:inherit;--tw-content:\':\';content:var(--tw-content)}.s-count-down-item:last-child::after{--tw-content:\'\';content:var(--tw-content)}.s-count-down-item-label{margin-top:0.25rem;display:block;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1));opacity:0.4}.s-count-down-boxed .s-count-down-item{border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-count-down-boxed .s-count-down-item::after{--tw-content:\'\';content:var(--tw-content)}.s-count-down-sm .s-count-down-item{font-size:1rem;line-height:1.5rem;font-weight:400}.s-count-down-sm .s-count-down-item::after{content:var(--tw-content);font-size:1rem;line-height:1.5rem}.s-count-down-sm+.s-count-down-end-text{font-size:1rem;line-height:1.5rem;font-weight:400}.s-count-down-md .s-count-down-item{font-size:1.125rem;line-height:1.75rem;font-weight:500}.s-count-down-md .s-count-down-item::after{content:var(--tw-content);font-size:1.125rem;line-height:1.75rem}.s-count-down-md+.s-count-down-end-text{font-size:1.125rem;line-height:1.75rem;font-weight:500}.s-count-down-lg .s-count-down-item{font-size:1.875rem;line-height:2.25rem;font-weight:700}.s-count-down-lg .s-count-down-item::after{content:var(--tw-content);font-size:1.875rem;line-height:2.25rem}.s-count-down-lg+.s-count-down-end-text{font-size:1.5rem;line-height:2rem;font-weight:700}.s-count-down-light .s-count-down-item{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-count-down-light .s-count-down-item::after{content:var(--tw-content);--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-count-down-dark .s-count-down-item{--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-count-down-dark .s-count-down-item::after{content:var(--tw-content);--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-count-down-primary .s-count-down-item{color:var(--color-primary)}.s-count-down-primary .s-count-down-item::after{content:var(--tw-content);color:var(--color-primary)}.s-count-down-ended .s-count-down-item{--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));opacity:0.1}.s-count-down-ended .s-count-down-item::after{content:var(--tw-content);--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-count-down-end-text{position:absolute;top:50%;left:50%;--tw-translate-x:-50%;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));font-family:var(--font-main);--tw-text-opacity:1;color:rgb(234 84 85 / var(--tw-text-opacity, 1))}.s-count-down-text-center{text-align:center}.s-count-down-info-message{display:flex;gap:0.5rem;padding-top:0.625rem;padding-bottom:0.625rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.s-count-down-pre-order{display:flex;flex:1 1 0%;flex-direction:column;align-items:center;gap:0.5rem}@media (min-width: 1024px){.s-count-down-pre-order{flex-direction:row}}.s-count-down-pre-order .s-count-down-item{position:relative;display:flex;height:2.7rem;width:2.25rem;flex-direction:column;align-items:center;justify-content:center;border-radius:2px}.s-count-down-pre-order .s-count-down-item::after{left:-7px;--tw-content:\':\';content:var(--tw-content)}.s-count-down-pre-order .s-count-down-item:last-child::after{--tw-content:\'\';content:var(--tw-content)}.s-count-down-pre-order-container{margin-bottom:1.25rem;margin-top:0.625rem;display:flex;flex-direction:column;align-items:center;gap:0.5rem}@media (min-width: 1024px){.s-count-down-pre-order-container{flex-direction:row}}.s-count-down-pre-order-container .s-count-down-list{margin:0px;padding:0px}.s-count-down-pre-order .s-count-down-item-value{font-size:1rem;line-height:1.5rem;font-weight:700;line-height:1}.s-count-down-pre-order .s-count-down-item-label{margin-top:0px;font-size:0.6rem;opacity:1}.s-count-down-horizontal{display:inline-flex;flex-direction:row;align-items:center;gap:0.75rem;border-radius:0.75rem;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);line-height:1}.s-count-down-horizontal.s-count-down-ended{opacity:0.5}.s-count-down-horizontal .s-count-down-list{margin:0px;width:auto;justify-content:flex-start;padding-left:0px;padding-right:0px}.s-count-down-horizontal .s-count-down-list .s-count-down-item{margin-left:0.25rem;margin-right:0.25rem;height:1.75rem;min-width:2rem;flex:none;border-radius:0.375rem;background-color:var(--color-primary);padding-top:0px;padding-bottom:0px;padding-left:0.5rem;padding-right:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:600;line-height:1.5;color:var(--color-primary-reverse)}.s-count-down-horizontal .s-count-down-list .s-count-down-item::after{font-weight:600;content:var(--tw-content);color:var(--color-primary)}.s-count-down-horizontal .s-count-down-item-label{margin-top:0.125rem;font-size:0.625rem;line-height:1;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));opacity:0.7}.s-count-down-with-button{display:inline-flex;align-items:center;column-gap:0.75rem}.s-count-down-with-button button .s-button-text{display:flex;align-items:center;column-gap:0.5rem}.s-count-down-with-button button .s-button-text:where([dir="ltr"],[dir="ltr"] *){flex-direction:row-reverse}.s-count-down-with-button button .s-button-text:where([dir="rtl"],[dir="rtl"] *){flex-direction:row}.s-count-down-prefix-text{font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary)}';export{o as salla_count_down}
|
|
4
|
+
import{r as t,h as n,H as e}from"./p-FwRU05yW.js";const o=class{constructor(n){t(this,n),this.size="md",this.color="dark",this.digits="auto",this.autoSegments=!1,this.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم"),this.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة"),this.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة"),this.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية"),this.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض"),this.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح"),this.offerEnded=!1,this.parseFailed=!1,this.showDays=!0,this.showHours=!0,this.days=this.number(0),this.hours=this.number(0),this.minutes=this.number(0),this.seconds=this.number(0),salla.lang.onLoaded((()=>{this.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم"),this.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة"),this.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة"),this.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح"),this.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية"),this.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض")})),this.date&&this.isValidDate(this.date)&&this.startCountDown()}async endCountDown(){clearInterval(this.countInterval),this.offerEnded=!0,this.days=this.number(0),this.hours=this.number(0),this.minutes=this.number(0),this.seconds=this.number(0)}componentWillLoad(){if("string"==typeof this.preOrder)try{this.normalizedPreOrder=JSON.parse(this.preOrder)}catch{this.normalizedPreOrder=void 0}else this.normalizedPreOrder=this.preOrder;this.normalizedPreOrder?.end_date&&(this.date=this.normalizedPreOrder.end_date),this.date&&this.isValidDate(this.date)&&this.startCountDown()}normalizeDate(t){const n=t.match(/^(\d{1,2})-(\d{1,2})-(\d{4}),(\d{1,2}):(\d{2}):(\d{2})\s*(am|pm)$/i);if(n){const[,t,e,o,i,r,s,a]=n;let c=parseInt(i,10);"pm"===a.toLowerCase()&&c<12&&(c+=12),"am"===a.toLowerCase()&&12===c&&(c=0);const d=String(c).padStart(2,"0");return`${o}-${String(t).padStart(2,"0")}-${String(e).padStart(2,"0")} ${d}:${r}:${s}`}const e=t.match(/^(\d{1,2})-(\d{1,2})-(\d{4})$/);if(e){const[,t,n,o]=e;return`${o}-${String(t).padStart(2,"0")}-${String(n).padStart(2,"0")}`}const o=t.match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[ T](\d{1,2}:\d{2}:\d{2}))?$/);if(o){const[,t,n,e,i]=o,r=String(n).padStart(2,"0"),s=String(e).padStart(2,"0");return i?`${t}-${r}-${s} ${i}`:`${t}-${r}-${s}`}return t}isValidDate(t){const n=this.normalizeDate(t);let e,o=n.includes("-"),i=n.split(" ");return e=o?i[0].replace(/-/g,"/"):i[0],!isNaN(Date.parse(e))}number(t){const n=String(Math.max(0,Math.floor(t))).padStart(2,"0");return salla.helpers.number(n,"en"===this.digits)}startCountDown(){const t=this.normalizeDate(this.date),n=t.includes("-"),e=this.endOfDay||1===t.split(" ").length;let o;if(n){const n=e?`${t.split(" ")[0]}T23:59:59+03:00`:`${t.replace(" ","T")}+03:00`;o=new Date(n).getTime()}else{const n=new Date(t);e&&n.setHours(23,59,59,999),o=n.getTime()}if(Number.isNaN(o))return salla.logger.warn(`[salla-count-down] unable to parse date: "${this.date}"`),void(this.parseFailed=!0);const i=()=>{const t=o-Date.now(),n=Math.floor(t/864e5),e=Math.floor(t%864e5/36e5);this.days=this.number(n),this.hours=this.number(e),this.minutes=this.number(Math.floor(t%36e5/6e4)),this.seconds=this.number(Math.floor(t%6e4/1e3)),this.autoSegments&&(this.showDays=n>0,this.showHours=n>0||e>0),t<0&&this.endCountDown()};this.countInterval=setInterval(i,1e3),i()}renderCountDown(){const t=this.boxTheme?`var(--color-${this.boxTheme})`:this.boxColor,e=this.boxed&&t?{backgroundColor:t}:void 0;return n("ul",{class:`s-count-down-list ${this.boxed?"s-count-down-boxed":""} ${this.offerEnded?"s-count-down-ended":""} s-count-down-${this.size} s-count-down-${this.color}`,style:this.listPadding?{paddingLeft:this.listPadding,paddingRight:this.listPadding}:void 0},n("li",{class:"s-count-down-item",style:e},n("div",{class:"s-count-down-item-value"},this.seconds),this.labeled&&n("div",{class:"s-count-down-item-label"},this.secondsLabel)),n("li",{class:"s-count-down-item",style:e},n("div",{class:"s-count-down-item-value"},this.minutes),this.labeled&&n("div",{class:"s-count-down-item-label"},this.minutesLabel)),(!this.autoSegments||this.showHours)&&n("li",{class:"s-count-down-item",style:e},n("div",{class:"s-count-down-item-value"},this.hours),this.labeled&&n("div",{class:"s-count-down-item-label"},this.hoursLabel)),(!this.autoSegments||this.showDays)&&n("li",{class:"s-count-down-item",style:e},n("div",{class:"s-count-down-item-value"},this.days),this.labeled&&n("div",{class:"s-count-down-item-label"},this.daysLabel)))}renderInvalidDate(){return n("div",{class:"s-count-down-text-center"},this.invalidDate)}renderOfferEnded(){return n("div",{class:"s-count-down-end-text"},this.endText?this.endText:this.endLabel)}renderPreOrderToBeAvailableOn(){return this.normalizedPreOrder?.availability_date&&this.isValidDate(this.normalizedPreOrder?.availability_date)?n("div",{class:"s-count-down-info-message"},n("i",{class:"sicon-info"}),n("span",null,salla.lang.getWithDefault("pages.products.expected_to_be","متوقَّع توفُّره بتاريخ:")),n("span",null,new Date(this.normalizedPreOrder?.availability_date).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric"}))):null}renderPreOrderCountDown(){return this.normalizedPreOrder?.activate_countdown?n("div",{class:"s-count-down-pre-order-container"},n("p",{class:"text-sm "},salla.lang.getWithDefault("pages.products.pre_order_ends_in","ينتهي الطلب المسبق خلال:")),this.renderCountDown()):null}renderPreOrder(){return n("div",null,"object"==typeof this.normalizedPreOrder&&this.normalizedPreOrder?.availability_date&&this.renderPreOrderToBeAvailableOn(),this.renderPreOrderCountDown())}renderPrefixText(){return this.prefixText?n("span",{class:"s-count-down-prefix-text"},this.prefixText):null}renderButton(){return this.withButton&&this.buttonText?n("salla-button",{color:"primary",size:"medium",href:this.buttonHref},this.buttonIcon?n("i",{class:this.buttonIcon}):null,n("span",null,this.buttonText)):null}renderContent(){return this.date?!this.isValidDate(this.date)||this.parseFailed?this.renderInvalidDate():this.preOrder?this.renderPreOrder():this.renderCountDown():null}render(){return n(e,{key:"e2805e528a52b71ad71f4f1f16a473947dafb5bc",class:`s-count-down-wrapper ${this.preOrder&&this.isValidDate(this.date)?"s-count-down-pre-order":""} ${this.horizontal?"s-count-down-horizontal":""} ${this.withButton?"s-count-down-with-button":""} ${this.offerEnded?"s-count-down-ended":""}`},this.renderPrefixText(),this.renderContent(),this.offerEnded&&this.renderOfferEnded(),this.renderButton())}};o.style='/*!twlt*/.s-count-down-horizontal{background-color:rgba(0, 0, 0, 0.06);background-color:color-mix(in srgb, var(--color-primary) 10%, transparent)}.text-sm{font-size:0.875rem;line-height:1.25rem}.s-basket-gap-card-offer .s-count-down-list{margin-left:-0px !important;margin-right:-0px !important;margin-bottom:0px !important;margin-top:0px !important;display:inline-flex;flex-wrap:nowrap;align-items:center;justify-content:flex-start !important;column-gap:0px;--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.s-basket-gap-card-offer .s-count-down-list:where([dir="ltr"],[dir="ltr"] *){flex-direction:row-reverse !important}.s-basket-gap-card-offer .s-count-down-list:where([dir="rtl"],[dir="rtl"] *){flex-direction:row !important}.s-basket-gap-card-offer .s-count-down-item{position:relative !important;margin-left:0px !important;margin-right:0px !important;display:inline-flex !important;width:auto !important;flex:none !important;flex-grow:0 !important;flex-direction:row !important;align-items:center !important;justify-content:center !important;padding-top:0px !important;padding-bottom:0px !important;padding-left:0px !important;padding-right:0px !important;font-size:12px !important;font-weight:700 !important;line-height:1 !important;--tw-text-opacity:1 !important;color:rgb(21 128 61 / var(--tw-text-opacity, 1)) !important}.s-basket-gap-card-offer .s-count-down-item-value{display:inline-block !important;width:2ch !important;min-width:2ch !important;text-align:center;--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);line-height:1}.s-basket-gap-card-offer .s-count-down-item-label{display:none}.s-basket-gap-entry .s-basket-gap-card-offer.s-basket-gap-card-offer .s-count-down-item::before{content:none !important}.s-basket-gap-entry .s-basket-gap-card-offer.s-basket-gap-card-offer .s-count-down-item::after{content:none !important;position:static;left:auto;right:auto;transform:none}[dir=\'rtl\'] .s-basket-gap-entry .s-basket-gap-card-offer.s-basket-gap-card-offer .s-count-down-item:not(:last-child)::after{content:\':\' !important;position:static;left:auto;right:auto;transform:none;margin-left:0.15rem;margin-right:0.15rem;color:#15803d;font-size:12px;font-weight:700;line-height:1}[dir=\'ltr\'] .s-basket-gap-entry .s-basket-gap-card-offer.s-basket-gap-card-offer .s-count-down-item:not(:first-child)::after{content:\':\' !important;position:static;left:auto;right:auto;transform:none;margin-left:0.15rem;margin-right:0.15rem;color:#15803d;font-size:12px;font-weight:700;line-height:1}.s-count-down-wrapper{position:relative}.s-count-down-list{margin-left:-0.25rem;margin-right:-0.25rem;margin-bottom:1.25rem;margin-top:0.625rem;display:flex;align-items:center;justify-content:space-between}.s-count-down-list:where([dir="ltr"],[dir="ltr"] *){flex-direction:row-reverse}.s-count-down-list:where([dir="rtl"],[dir="rtl"] *){flex-direction:row}.s-count-down-item{position:relative;margin-left:0.25rem;margin-right:0.25rem;display:flex;flex:1 1 0%;flex-direction:column;align-items:center;justify-content:center;padding-top:0.5rem;padding-bottom:0.5rem;font-family:var(--font-main);font-weight:700}.s-count-down-item::after{position:absolute;left:-2px;font-family:inherit;--tw-content:\':\';content:var(--tw-content)}.s-count-down-item:last-child::after{--tw-content:\'\';content:var(--tw-content)}.s-count-down-item-label{margin-top:0.25rem;display:block;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1));opacity:0.4}.s-count-down-boxed .s-count-down-item{border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-count-down-boxed .s-count-down-item::after{--tw-content:\'\';content:var(--tw-content)}.s-count-down-sm .s-count-down-item{font-size:1rem;line-height:1.5rem;font-weight:400}.s-count-down-sm .s-count-down-item::after{content:var(--tw-content);font-size:1rem;line-height:1.5rem}.s-count-down-sm+.s-count-down-end-text{font-size:1rem;line-height:1.5rem;font-weight:400}.s-count-down-md .s-count-down-item{font-size:1.125rem;line-height:1.75rem;font-weight:500}.s-count-down-md .s-count-down-item::after{content:var(--tw-content);font-size:1.125rem;line-height:1.75rem}.s-count-down-md+.s-count-down-end-text{font-size:1.125rem;line-height:1.75rem;font-weight:500}.s-count-down-lg .s-count-down-item{font-size:1.875rem;line-height:2.25rem;font-weight:700}.s-count-down-lg .s-count-down-item::after{content:var(--tw-content);font-size:1.875rem;line-height:2.25rem}.s-count-down-lg+.s-count-down-end-text{font-size:1.5rem;line-height:2rem;font-weight:700}.s-count-down-light .s-count-down-item{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-count-down-light .s-count-down-item::after{content:var(--tw-content);--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-count-down-dark .s-count-down-item{--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-count-down-dark .s-count-down-item::after{content:var(--tw-content);--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-count-down-primary .s-count-down-item{color:var(--color-primary)}.s-count-down-primary .s-count-down-item::after{content:var(--tw-content);color:var(--color-primary)}.s-count-down-ended .s-count-down-item{--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));opacity:0.1}.s-count-down-ended .s-count-down-item::after{content:var(--tw-content);--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-count-down-end-text{position:absolute;top:50%;left:50%;--tw-translate-x:-50%;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));font-family:var(--font-main);--tw-text-opacity:1;color:rgb(234 84 85 / var(--tw-text-opacity, 1))}.s-count-down-text-center{text-align:center}.s-count-down-info-message{display:flex;gap:0.5rem;padding-top:0.625rem;padding-bottom:0.625rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.s-count-down-pre-order{display:flex;flex:1 1 0%;flex-direction:column;align-items:center;gap:0.5rem}@media (min-width: 1024px){.s-count-down-pre-order{flex-direction:row}}.s-count-down-pre-order .s-count-down-item{position:relative;display:flex;height:2.7rem;width:2.25rem;flex-direction:column;align-items:center;justify-content:center;border-radius:2px}.s-count-down-pre-order .s-count-down-item::after{left:-7px;--tw-content:\':\';content:var(--tw-content)}.s-count-down-pre-order .s-count-down-item:last-child::after{--tw-content:\'\';content:var(--tw-content)}.s-count-down-pre-order-container{margin-bottom:1.25rem;margin-top:0.625rem;display:flex;flex-direction:column;align-items:center;gap:0.5rem}@media (min-width: 1024px){.s-count-down-pre-order-container{flex-direction:row}}.s-count-down-pre-order-container .s-count-down-list{margin:0px;padding:0px}.s-count-down-pre-order .s-count-down-item-value{font-size:1rem;line-height:1.5rem;font-weight:700;line-height:1}.s-count-down-pre-order .s-count-down-item-label{margin-top:0px;font-size:0.6rem;opacity:1}.s-count-down-horizontal{display:inline-flex;flex-direction:row;align-items:center;gap:0.75rem;border-radius:0.75rem;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);line-height:1}.s-count-down-horizontal.s-count-down-ended{opacity:0.5}.s-count-down-horizontal .s-count-down-list{margin:0px;width:auto;justify-content:flex-start;padding-left:0px;padding-right:0px}.s-count-down-horizontal .s-count-down-list .s-count-down-item{margin-left:0.25rem;margin-right:0.25rem;height:1.75rem;min-width:2rem;flex:none;border-radius:0.375rem;background-color:var(--color-primary);padding-top:0px;padding-bottom:0px;padding-left:0.5rem;padding-right:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:600;line-height:1.5;color:var(--color-primary-reverse)}.s-count-down-horizontal .s-count-down-list .s-count-down-item::after{font-weight:600;content:var(--tw-content);color:var(--color-primary)}.s-count-down-horizontal .s-count-down-item-label{margin-top:0.125rem;font-size:0.625rem;line-height:1;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));opacity:0.7}.s-count-down-with-button{display:inline-flex;align-items:center;column-gap:0.75rem}.s-count-down-with-button button .s-button-text{display:flex;align-items:center;column-gap:0.5rem}.s-count-down-with-button button .s-button-text:where([dir="ltr"],[dir="ltr"] *){flex-direction:row-reverse}.s-count-down-with-button button .s-button-text:where([dir="rtl"],[dir="rtl"] *){flex-direction:row}.s-count-down-prefix-text{font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary)}';export{o as salla_count_down}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as t,a as r}from"./p-CHZfg_a9.js";import{S as o}from"./p-Ctkfc4K-.js";import{T as i,C as a}from"./p-DRvZV5oe.js";const l=class{constructor(t){e(this,t),this.offer=null,this.hasError=!1,this.translationLoaded=!1,this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),salla.event.on("offer-modal::open",(e=>this.open(e))),salla.lang.onLoaded((()=>{this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),this.translationLoaded=!0})),this.categorySlot=this.host.querySelector('[slot="category"]')?.innerHTML||'<span class="s-offer-modal-badge-icon">{tagIcon}</span><span class="s-offer-modal-badge-text">{name}</span>',salla.event.on("offer-modal::open",(e=>this.open(e))),salla.product.event.onOfferExisted((e=>{salla.storage.get("remember-offer-"+e.id)?salla.log("User selected to don't show this offer again."):this.open(e.product_id)}))}emitPromotionViewed(e){e&&salla.event.emit("promotion::viewed",[{id:e.id?.toString(),creative:e.message,name:e.name,position:`${this.offer_type}_offer_modal`}])}emitPromotionClicked(e){e&&salla.event.emit("promotion::clicked",[{id:e.id?.toString(),creative:e.message,name:e.name,position:`${this.offer_type}_offer_modal`}])}async open(e){return this.productID=e,this.hasError=!1,this.modal.loading(),await salla.api.withoutNotifier((()=>salla.product.offers(e))).then((e=>{e.data&&e.data.length&&(this.modal.open(),this.showOffer(e.data[0]))})).catch((e=>{this.hasError=!0,this.errorMessage=e.response?.data?.error?.message||e.response?.data,this.modal.open()})).finally((()=>{this.modal.visible&&setTimeout((()=>this.modal.stopLoading()),1e3)}))}async showOffer(e){this.offer=e,this.offer_name=e.name,this.offer_message=e.message,this.offer.get.discounts_table?this.offer_type="discounts-table":this.offer.get.products?.length?this.offer_type="products":this.offer.get.categories?.length?this.offer_type="categories":this.offer.get.brands?.length?this.offer_type="brands":this.offer.get.tags?.length&&(this.offer_type="tags"),this.modal.setTitle(this.offer_name),this.emitPromotionViewed(this.offer)}rememberMe(e){salla.storage.set("remember-offer-"+this.offer.id,e.target.checked)}addToCart(e){this.emitPromotionClicked(this.offer),salla.api.withoutNotifier((()=>salla.cart.quickAdd(this.productID,e,this.offer_type))).then((()=>this.modal.close()))}getOfferContent(){if(this.offer.get.discounts_table)return t("div",{class:"s-offer-modal-discount-table"},t("table",null,t("tbody",null,this.offer.get.discounts_table?.map((e=>t("tr",null,t("td",null,e.text),t("td",{class:"s-offer-modal-discount-table-cell"},t("salla-button",{fill:"outline",shape:"btn",color:"primary",size:"medium",width:"normal",onClick:()=>this.addToCart(e.quantity)},this.addToCartLabel))))))));if(this.offer.get.products?.length){const e=this.offer.get.products?.length||0,r={slidesPerView:"auto",spaceBetween:16,breakpoints:{768:{slidesPerView:Math.min(2,e),spaceBetween:16},1024:{slidesPerView:Math.min(3,e),spaceBetween:16}}};return t("salla-products-slider",{key:(this.offer.get.products?.map((e=>e.id))||[]).join(","),source:"selected","source-value":`[${(this.offer.get.products?.map((e=>e.id))||[]).join(",")}]`,"slider-config":JSON.stringify(r)})}return this.offer.get.categories?.length?t("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.categories?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.categories?.length<=2?"false":"true"},t("div",{slot:"items"},this.offer.get.categories.map((e=>t("a",{href:e.urls.customer,class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-cat-item",innerHTML:this.categorySlot.replace(/\{tagIcon\}/g,i).replace(/\{name\}/g,e.name).replace(/\{url\}/g,e.urls.customer)}))))):this.offer.get.brands?.length?t("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.brands?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.brands?.length<=2?"false":"true"},t("div",{slot:"items"},this.offer.get.brands.map((e=>t("a",{href:e.url||salla.url.create("brands",e.id),class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-brand-item"},t("div",{class:"s-offer-modal-brand-logo"},t("img",{src:e.logo,alt:e.name})),t("span",{class:"s-offer-modal-badge-text"},e.name)))))):this.offer.get.tags?.length?t("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.tags?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.tags?.length<=2?"false":"true"},t("div",{slot:"items"},this.offer.get.tags.map((e=>t("a",{href:e.url||salla.url.create("tags",e.id),class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-tag-item"},t("span",{class:"s-offer-modal-badge-icon",innerHTML:i}),t("span",{class:"s-offer-modal-badge-text"},e.name)))))):void 0}render(){return t("salla-modal",{key:"570466318b6cd66a7a8b3dd0d80424c2fd73328d","has-skeleton":!0,"sub-title":this.offer_message,ref:e=>this.modal=e,isLoading:!0,class:`s-offer-modal-type-${this.offer_type?this.offer_type:""}`},t("div",{key:"ded0c8df17d5e5c1d6e77b8e1be469e69d3ee12f",slot:"loading"},t("div",{key:"fc96c54fcecc896b3e5a1838e2d07d545fce2f85",class:"s-offer-modal-skeleton"},t("div",{key:"ee7a6f25aabbf4263b43fc7545bbb2c7bfca9b3a",class:"s-offer-modal-skeleton-header"},t("salla-skeleton",{key:"9604f5f33d1d8e074cc3c314addb945b087431ee",type:"circle",height:"80px",width:"80px"}),t("salla-skeleton",{key:"65194ecfee0a01f7c38aa72f7ce2c8c81c893b1f",height:"15px",width:"50%"}),t("salla-skeleton",{key:"21d466bf32f435a511dcece76f51f4052089c130",height:"10px",width:"30%"})),t("div",{key:"53fb44c7c60ca8236dc7ec60ff65cb71df39c03b",class:"s-offer-modal-skeleton-items"},[...Array(3)].map((()=>t("div",{class:"s-offer-modal-skeleton-item"},t("salla-skeleton",{height:"9rem"}),t("div",{class:"s-offer-modal-skeleton-item-title"},t("salla-skeleton",{height:"15px",width:"100%"})),t("div",{class:"s-offer-modal-skeleton-item-subtitle"},t("salla-skeleton",{height:"9px",width:"50%"}),t("div",{innerHTML:a})))))),t("div",{key:"52ad47514b0c00b73ec7d98073b09d21ce6a2b12",class:"s-offer-modal-skeleton-footer"},t("salla-skeleton",{key:"a271e30ab34d96731cc1f51c32cba9aaefee1953",height:"15px",width:"50%"}),t("salla-skeleton",{key:"6e199a5b1283c9d82588c60c712d3799b88c5c8d",height:"15px",width:"30%"})))),this.hasError||null===this.offer?t("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?t("span",{slot:"description"},this.errorMessage):""):[t("span",{slot:"icon",class:"s-offer-modal-header-icon",innerHTML:o}),this.getOfferContent(),t("div",{class:"s-offer-modal-footer",slot:"footer"},this.offer.formatted_date?t("p",{class:"s-offer-modal-expiry"},salla.lang.get("pages.products.offer_expires_in")," ",this.offer.formatted_date):"",t("label",{class:"s-offer-modal-remember-label"},t("input",{type:"checkbox",onChange:e=>this.rememberMe(e),class:"s-offer-modal-remember-input"})," ",salla.lang.get("common.elements.remember_my_choice")))])}get host(){return r(this)}};l.style='/*!twlt*/.s-offer-modal-type-products .s-modal-body{min-height:690px;position:relative}.visible{visibility:visible}.table{display:table}.outline{outline-style:solid}.s-loyalty-placeholder{display:flex;align-items:center;justify-content:center}.btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.btn:hover{opacity:0.8}.s-modal-header{flex-direction:column}.s-offer-modal-body{display:flex;overflow-x:auto;margin-left:-32px;margin-right:-32px;padding-left:32px;padding-right:32px;gap:24px;padding-bottom:32px;-webkit-overflow-scrolling:touch}.s-offer-modal-body::-webkit-scrollbar{display:none}.s-offer-modal-badge{margin-bottom:0.625rem;display:inline-flex;align-items:center;justify-content:center;border-radius:1.5rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding-top:0.625rem;padding-bottom:0.625rem;padding-left:1rem;padding-right:1rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-offer-modal-badge:where([dir="ltr"],[dir="ltr"] *){margin-left:0.625rem}.s-offer-modal-badge:where([dir="rtl"],[dir="rtl"] *){margin-left:0.625rem}.s-offer-modal-badge-icon:where([dir="ltr"],[dir="ltr"] *){margin-left:0.375rem}.s-offer-modal-badge-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.375rem}.s-offer-modal-badge-icon svg{margin-bottom:1rem;display:inline-block;height:1.5rem;width:1.5rem;fill:var(--color-primary)}.s-offer-modal-badge-text{font-size:0.875rem;line-height:1.25rem;font-weight:700}.s-offer-modal-cat-item.swiper-slide{margin-top:1rem;margin-bottom:1rem;display:flex;height:9rem;max-width:180px;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-offer-modal-cat-item.swiper-slide:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-modal-brand-item.swiper-slide{margin-top:1rem;margin-bottom:1rem;display:flex;height:9rem;max-width:180px;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-offer-modal-brand-item.swiper-slide:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-modal-brand-logo{margin-bottom:0.75rem;height:4rem;width:4rem;object-fit:contain}.s-offer-modal-brand-logo img{height:100%;width:100%;object-fit:contain}.s-offer-modal-tag-item.swiper-slide{margin-top:1rem;margin-bottom:1rem;display:flex;height:9rem;max-width:180px;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-offer-modal-tag-item.swiper-slide:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-modal-product.swiper-slide{display:flex;width:70%;flex-shrink:0;flex-grow:1;flex-direction:column}@media (min-width: 640px){.s-offer-modal-product.swiper-slide{width:40%}}@media (min-width: 1024px){.s-offer-modal-product.swiper-slide{width:28%}}.s-offer-modal-product-image-wrap{position:relative;margin-bottom:1rem;display:block;height:8rem;overflow:hidden;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-offer-modal-product-image{height:100%;width:100%;object-fit:cover}.s-offer-modal-not-available{--tw-grayscale:grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-offer-modal-product-info{margin-bottom:1rem}.s-offer-modal-product-name{margin-bottom:0.375rem;display:inline-block;width:11rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-offer-modal-product-name:hover{color:var(--color-primary)}.s-offer-modal-product-price{margin-bottom:1.25rem;display:flex;width:100%;align-items:center;font-size:0.875rem;line-height:1.25rem;font-weight:700}@media (min-width: 768px){.s-offer-modal-product-price{margin-bottom:0px}}@media (min-width: 640px){.s-offer-modal-product-price:where([dir="ltr"],[dir="ltr"] *){margin-left:0.5rem}.s-offer-modal-product-price:where([dir="rtl"],[dir="rtl"] *){margin-right:0.5rem}}.s-offer-modal-product-sale-price{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-offer-modal-product-old-price{margin-left:0.25rem;margin-right:0.25rem;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-offer-modal-btn-wrap{margin-top:auto}.s-offer-modal-header-icon{display:inline-flex;height:4rem;width:4rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-style:solid;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}@media (min-width: 640px){.s-offer-modal-header-icon{margin-left:auto;margin-right:auto;margin-bottom:1rem;height:5rem;width:5rem}}.s-offer-modal-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}@media (min-width: 640px){.s-offer-modal-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}}.s-offer-modal-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}@media (min-width: 640px){.s-offer-modal-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}}.s-offer-modal-header-icon svg{height:1.75rem;width:1.75rem;flex-shrink:0;fill:#9ca3af}.s-offer-modal-footer{margin-top:1rem;display:flex;flex-direction:column;justify-content:space-between;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.s-offer-modal-footer{margin-top:2rem;flex-direction:row}}.s-offer-modal-expiry{margin-bottom:1.25rem}@media (min-width: 768px){.s-offer-modal-expiry{margin-bottom:0px}}.s-offer-modal-remember-label{display:flex;cursor:pointer;font-size:0.875rem;line-height:1.25rem;font-weight:500;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-offer-modal-remember-label:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.s-offer-modal-remember-label:where([dir="ltr"],[dir="ltr"] *){margin-left:0.5rem}.s-offer-modal-remember-label:where([dir="rtl"],[dir="rtl"] *){margin-right:0.5rem}}.s-offer-modal-remember-input{height:1.5rem;width:1.5rem;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));color:var(--color-primary)}.s-offer-modal-remember-input:focus{--tw-ring-color:transparent}.s-offer-modal-slider-centered .swiper-wrapper{justify-content:center}.s-offer-modal-slider-centered .s-offer-modal-slider-item{display:flex;max-width:28%;flex-shrink:0;flex-grow:1;flex-direction:column}.s-offer-modal-skeleton{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-offer-modal-skeleton-items{margin-top:1.5rem;margin-bottom:1.5rem;display:flex;width:100%;align-items:center}.s-offer-modal-skeleton-item{position:relative;margin-right:1.25rem;width:33.333333%;cursor:unset !important;text-align:center}.s-offer-modal-skeleton-item:last-child{margin-right:0px}.s-offer-modal-skeleton-item:where([dir="rtl"],[dir="rtl"] *){margin-right:0px;margin-left:1.25rem}.s-offer-modal-skeleton-item:last-child:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}.s-offer-modal-skeleton-header{width:100%}.s-offer-modal-skeleton-header salla-skeleton{margin-left:auto;margin-right:auto}.s-offer-modal-skeleton-header salla-skeleton:nth-child(1){margin-bottom:1.25rem}.s-offer-modal-skeleton-header salla-skeleton:nth-child(2){margin-bottom:0.75rem}.s-offer-modal-skeleton-header salla-skeleton:nth-child(3){margin-bottom:1.25rem}.s-offer-modal-skeleton-item-subtitle{display:flex;width:100%;align-items:center;justify-content:space-between}.s-offer-modal-skeleton-item-subtitle div svg{height:1rem;width:1rem;fill:currentColor;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-offer-modal-skeleton-item-title{margin-top:0.75rem;margin-bottom:0.75rem}.s-offer-modal-skeleton-footer{margin-top:1.5rem;display:flex;width:100%;align-items:center;justify-content:space-between}.s-offer-modal-discount-table{width:100%;border-width:1px;--tw-border-opacity:1;border-color:rgb(238 238 238 / var(--tw-border-opacity, 1))}.s-offer-modal-discount-table table{width:100%;text-align:left;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(119 119 119 / var(--tw-text-opacity, 1))}.s-offer-modal-discount-table tr{border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(238 238 238 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(252 252 252 / var(--tw-bg-opacity, 1))}.s-offer-modal-discount-table tr:last-child{border-bottom-width:0px}.s-offer-modal-discount-table tr td{padding-top:1rem;padding-bottom:1rem;padding-left:1.5rem;padding-right:1.5rem}.s-offer-modal-discount-table tr td:where([dir="rtl"],[dir="rtl"] *){text-align:right}.s-offer-modal-discount-table-cell{text-align:right}.s-offer-modal-discount-table-cell:where([dir="rtl"],[dir="rtl"] *){text-align:left !important}.s-offer-modal-type-discounts-table .s-modal-body{position:relative !important}';export{l as salla_offer_modal}
|
|
4
|
+
import{r as e,h as t,a as r}from"./p-FwRU05yW.js";import{S as o}from"./p-Ctkfc4K-.js";import{T as i,C as a}from"./p-DRvZV5oe.js";const l=class{constructor(t){e(this,t),this.offer=null,this.hasError=!1,this.translationLoaded=!1,this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),salla.event.on("offer-modal::open",(e=>this.open(e))),salla.lang.onLoaded((()=>{this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),this.translationLoaded=!0})),this.categorySlot=this.host.querySelector('[slot="category"]')?.innerHTML||'<span class="s-offer-modal-badge-icon">{tagIcon}</span><span class="s-offer-modal-badge-text">{name}</span>',salla.event.on("offer-modal::open",(e=>this.open(e))),salla.product.event.onOfferExisted((e=>{salla.storage.get("remember-offer-"+e.id)?salla.log("User selected to don't show this offer again."):this.open(e.product_id)}))}emitPromotionViewed(e){e&&salla.event.emit("promotion::viewed",[{id:e.id?.toString(),creative:e.message,name:e.name,position:`${this.offer_type}_offer_modal`}])}emitPromotionClicked(e){e&&salla.event.emit("promotion::clicked",[{id:e.id?.toString(),creative:e.message,name:e.name,position:`${this.offer_type}_offer_modal`}])}async open(e){return this.productID=e,this.hasError=!1,this.modal.loading(),await salla.api.withoutNotifier((()=>salla.product.offers(e))).then((e=>{e.data&&e.data.length&&(this.modal.open(),this.showOffer(e.data[0]))})).catch((e=>{this.hasError=!0,this.errorMessage=e.response?.data?.error?.message||e.response?.data,this.modal.open()})).finally((()=>{this.modal.visible&&setTimeout((()=>this.modal.stopLoading()),1e3)}))}async showOffer(e){this.offer=e,this.offer_name=e.name,this.offer_message=e.message,this.offer.get.discounts_table?this.offer_type="discounts-table":this.offer.get.products?.length?this.offer_type="products":this.offer.get.categories?.length?this.offer_type="categories":this.offer.get.brands?.length?this.offer_type="brands":this.offer.get.tags?.length&&(this.offer_type="tags"),this.modal.setTitle(this.offer_name),this.emitPromotionViewed(this.offer)}rememberMe(e){salla.storage.set("remember-offer-"+this.offer.id,e.target.checked)}addToCart(e){this.emitPromotionClicked(this.offer),salla.api.withoutNotifier((()=>salla.cart.quickAdd(this.productID,e,this.offer_type))).then((()=>this.modal.close()))}getOfferContent(){if(this.offer.get.discounts_table)return t("div",{class:"s-offer-modal-discount-table"},t("table",null,t("tbody",null,this.offer.get.discounts_table?.map((e=>t("tr",null,t("td",null,e.text),t("td",{class:"s-offer-modal-discount-table-cell"},t("salla-button",{fill:"outline",shape:"btn",color:"primary",size:"medium",width:"normal",onClick:()=>this.addToCart(e.quantity)},this.addToCartLabel))))))));if(this.offer.get.products?.length){const e=this.offer.get.products?.length||0,r={slidesPerView:"auto",spaceBetween:16,breakpoints:{768:{slidesPerView:Math.min(2,e),spaceBetween:16},1024:{slidesPerView:Math.min(3,e),spaceBetween:16}}};return t("salla-products-slider",{key:(this.offer.get.products?.map((e=>e.id))||[]).join(","),source:"selected","source-value":`[${(this.offer.get.products?.map((e=>e.id))||[]).join(",")}]`,"slider-config":JSON.stringify(r)})}return this.offer.get.categories?.length?t("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.categories?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.categories?.length<=2?"false":"true"},t("div",{slot:"items"},this.offer.get.categories.map((e=>t("a",{href:e.urls.customer,class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-cat-item",innerHTML:this.categorySlot.replace(/\{tagIcon\}/g,i).replace(/\{name\}/g,e.name).replace(/\{url\}/g,e.urls.customer)}))))):this.offer.get.brands?.length?t("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.brands?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.brands?.length<=2?"false":"true"},t("div",{slot:"items"},this.offer.get.brands.map((e=>t("a",{href:e.url||salla.url.create("brands",e.id),class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-brand-item"},t("div",{class:"s-offer-modal-brand-logo"},t("img",{src:e.logo,alt:e.name})),t("span",{class:"s-offer-modal-badge-text"},e.name)))))):this.offer.get.tags?.length?t("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.tags?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.tags?.length<=2?"false":"true"},t("div",{slot:"items"},this.offer.get.tags.map((e=>t("a",{href:e.url||salla.url.create("tags",e.id),class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-tag-item"},t("span",{class:"s-offer-modal-badge-icon",innerHTML:i}),t("span",{class:"s-offer-modal-badge-text"},e.name)))))):void 0}render(){return t("salla-modal",{key:"570466318b6cd66a7a8b3dd0d80424c2fd73328d","has-skeleton":!0,"sub-title":this.offer_message,ref:e=>this.modal=e,isLoading:!0,class:`s-offer-modal-type-${this.offer_type?this.offer_type:""}`},t("div",{key:"ded0c8df17d5e5c1d6e77b8e1be469e69d3ee12f",slot:"loading"},t("div",{key:"fc96c54fcecc896b3e5a1838e2d07d545fce2f85",class:"s-offer-modal-skeleton"},t("div",{key:"ee7a6f25aabbf4263b43fc7545bbb2c7bfca9b3a",class:"s-offer-modal-skeleton-header"},t("salla-skeleton",{key:"9604f5f33d1d8e074cc3c314addb945b087431ee",type:"circle",height:"80px",width:"80px"}),t("salla-skeleton",{key:"65194ecfee0a01f7c38aa72f7ce2c8c81c893b1f",height:"15px",width:"50%"}),t("salla-skeleton",{key:"21d466bf32f435a511dcece76f51f4052089c130",height:"10px",width:"30%"})),t("div",{key:"53fb44c7c60ca8236dc7ec60ff65cb71df39c03b",class:"s-offer-modal-skeleton-items"},[...Array(3)].map((()=>t("div",{class:"s-offer-modal-skeleton-item"},t("salla-skeleton",{height:"9rem"}),t("div",{class:"s-offer-modal-skeleton-item-title"},t("salla-skeleton",{height:"15px",width:"100%"})),t("div",{class:"s-offer-modal-skeleton-item-subtitle"},t("salla-skeleton",{height:"9px",width:"50%"}),t("div",{innerHTML:a})))))),t("div",{key:"52ad47514b0c00b73ec7d98073b09d21ce6a2b12",class:"s-offer-modal-skeleton-footer"},t("salla-skeleton",{key:"a271e30ab34d96731cc1f51c32cba9aaefee1953",height:"15px",width:"50%"}),t("salla-skeleton",{key:"6e199a5b1283c9d82588c60c712d3799b88c5c8d",height:"15px",width:"30%"})))),this.hasError||null===this.offer?t("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?t("span",{slot:"description"},this.errorMessage):""):[t("span",{slot:"icon",class:"s-offer-modal-header-icon",innerHTML:o}),this.getOfferContent(),t("div",{class:"s-offer-modal-footer",slot:"footer"},this.offer.formatted_date?t("p",{class:"s-offer-modal-expiry"},salla.lang.get("pages.products.offer_expires_in")," ",this.offer.formatted_date):"",t("label",{class:"s-offer-modal-remember-label"},t("input",{type:"checkbox",onChange:e=>this.rememberMe(e),class:"s-offer-modal-remember-input"})," ",salla.lang.get("common.elements.remember_my_choice")))])}get host(){return r(this)}};l.style='/*!twlt*/.s-offer-modal-type-products .s-modal-body{min-height:690px;position:relative}.visible{visibility:visible}.table{display:table}.outline{outline-style:solid}.s-loyalty-placeholder{display:flex;align-items:center;justify-content:center}.btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.btn:hover{opacity:0.8}.s-modal-header{flex-direction:column}.s-offer-modal-body{display:flex;overflow-x:auto;margin-left:-32px;margin-right:-32px;padding-left:32px;padding-right:32px;gap:24px;padding-bottom:32px;-webkit-overflow-scrolling:touch}.s-offer-modal-body::-webkit-scrollbar{display:none}.s-offer-modal-badge{margin-bottom:0.625rem;display:inline-flex;align-items:center;justify-content:center;border-radius:1.5rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding-top:0.625rem;padding-bottom:0.625rem;padding-left:1rem;padding-right:1rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-offer-modal-badge:where([dir="ltr"],[dir="ltr"] *){margin-left:0.625rem}.s-offer-modal-badge:where([dir="rtl"],[dir="rtl"] *){margin-left:0.625rem}.s-offer-modal-badge-icon:where([dir="ltr"],[dir="ltr"] *){margin-left:0.375rem}.s-offer-modal-badge-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.375rem}.s-offer-modal-badge-icon svg{margin-bottom:1rem;display:inline-block;height:1.5rem;width:1.5rem;fill:var(--color-primary)}.s-offer-modal-badge-text{font-size:0.875rem;line-height:1.25rem;font-weight:700}.s-offer-modal-cat-item.swiper-slide{margin-top:1rem;margin-bottom:1rem;display:flex;height:9rem;max-width:180px;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-offer-modal-cat-item.swiper-slide:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-modal-brand-item.swiper-slide{margin-top:1rem;margin-bottom:1rem;display:flex;height:9rem;max-width:180px;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-offer-modal-brand-item.swiper-slide:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-modal-brand-logo{margin-bottom:0.75rem;height:4rem;width:4rem;object-fit:contain}.s-offer-modal-brand-logo img{height:100%;width:100%;object-fit:contain}.s-offer-modal-tag-item.swiper-slide{margin-top:1rem;margin-bottom:1rem;display:flex;height:9rem;max-width:180px;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-offer-modal-tag-item.swiper-slide:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-modal-product.swiper-slide{display:flex;width:70%;flex-shrink:0;flex-grow:1;flex-direction:column}@media (min-width: 640px){.s-offer-modal-product.swiper-slide{width:40%}}@media (min-width: 1024px){.s-offer-modal-product.swiper-slide{width:28%}}.s-offer-modal-product-image-wrap{position:relative;margin-bottom:1rem;display:block;height:8rem;overflow:hidden;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-offer-modal-product-image{height:100%;width:100%;object-fit:cover}.s-offer-modal-not-available{--tw-grayscale:grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-offer-modal-product-info{margin-bottom:1rem}.s-offer-modal-product-name{margin-bottom:0.375rem;display:inline-block;width:11rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-offer-modal-product-name:hover{color:var(--color-primary)}.s-offer-modal-product-price{margin-bottom:1.25rem;display:flex;width:100%;align-items:center;font-size:0.875rem;line-height:1.25rem;font-weight:700}@media (min-width: 768px){.s-offer-modal-product-price{margin-bottom:0px}}@media (min-width: 640px){.s-offer-modal-product-price:where([dir="ltr"],[dir="ltr"] *){margin-left:0.5rem}.s-offer-modal-product-price:where([dir="rtl"],[dir="rtl"] *){margin-right:0.5rem}}.s-offer-modal-product-sale-price{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-offer-modal-product-old-price{margin-left:0.25rem;margin-right:0.25rem;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-offer-modal-btn-wrap{margin-top:auto}.s-offer-modal-header-icon{display:inline-flex;height:4rem;width:4rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-style:solid;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}@media (min-width: 640px){.s-offer-modal-header-icon{margin-left:auto;margin-right:auto;margin-bottom:1rem;height:5rem;width:5rem}}.s-offer-modal-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}@media (min-width: 640px){.s-offer-modal-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}}.s-offer-modal-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}@media (min-width: 640px){.s-offer-modal-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}}.s-offer-modal-header-icon svg{height:1.75rem;width:1.75rem;flex-shrink:0;fill:#9ca3af}.s-offer-modal-footer{margin-top:1rem;display:flex;flex-direction:column;justify-content:space-between;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.s-offer-modal-footer{margin-top:2rem;flex-direction:row}}.s-offer-modal-expiry{margin-bottom:1.25rem}@media (min-width: 768px){.s-offer-modal-expiry{margin-bottom:0px}}.s-offer-modal-remember-label{display:flex;cursor:pointer;font-size:0.875rem;line-height:1.25rem;font-weight:500;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-offer-modal-remember-label:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.s-offer-modal-remember-label:where([dir="ltr"],[dir="ltr"] *){margin-left:0.5rem}.s-offer-modal-remember-label:where([dir="rtl"],[dir="rtl"] *){margin-right:0.5rem}}.s-offer-modal-remember-input{height:1.5rem;width:1.5rem;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));color:var(--color-primary)}.s-offer-modal-remember-input:focus{--tw-ring-color:transparent}.s-offer-modal-slider-centered .swiper-wrapper{justify-content:center}.s-offer-modal-slider-centered .s-offer-modal-slider-item{display:flex;max-width:28%;flex-shrink:0;flex-grow:1;flex-direction:column}.s-offer-modal-skeleton{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-offer-modal-skeleton-items{margin-top:1.5rem;margin-bottom:1.5rem;display:flex;width:100%;align-items:center}.s-offer-modal-skeleton-item{position:relative;margin-right:1.25rem;width:33.333333%;cursor:unset !important;text-align:center}.s-offer-modal-skeleton-item:last-child{margin-right:0px}.s-offer-modal-skeleton-item:where([dir="rtl"],[dir="rtl"] *){margin-right:0px;margin-left:1.25rem}.s-offer-modal-skeleton-item:last-child:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}.s-offer-modal-skeleton-header{width:100%}.s-offer-modal-skeleton-header salla-skeleton{margin-left:auto;margin-right:auto}.s-offer-modal-skeleton-header salla-skeleton:nth-child(1){margin-bottom:1.25rem}.s-offer-modal-skeleton-header salla-skeleton:nth-child(2){margin-bottom:0.75rem}.s-offer-modal-skeleton-header salla-skeleton:nth-child(3){margin-bottom:1.25rem}.s-offer-modal-skeleton-item-subtitle{display:flex;width:100%;align-items:center;justify-content:space-between}.s-offer-modal-skeleton-item-subtitle div svg{height:1rem;width:1rem;fill:currentColor;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-offer-modal-skeleton-item-title{margin-top:0.75rem;margin-bottom:0.75rem}.s-offer-modal-skeleton-footer{margin-top:1.5rem;display:flex;width:100%;align-items:center;justify-content:space-between}.s-offer-modal-discount-table{width:100%;border-width:1px;--tw-border-opacity:1;border-color:rgb(238 238 238 / var(--tw-border-opacity, 1))}.s-offer-modal-discount-table table{width:100%;text-align:left;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(119 119 119 / var(--tw-text-opacity, 1))}.s-offer-modal-discount-table tr{border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(238 238 238 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(252 252 252 / var(--tw-bg-opacity, 1))}.s-offer-modal-discount-table tr:last-child{border-bottom-width:0px}.s-offer-modal-discount-table tr td{padding-top:1rem;padding-bottom:1rem;padding-left:1.5rem;padding-right:1.5rem}.s-offer-modal-discount-table tr td:where([dir="rtl"],[dir="rtl"] *){text-align:right}.s-offer-modal-discount-table-cell{text-align:right}.s-offer-modal-discount-table-cell:where([dir="rtl"],[dir="rtl"] *){text-align:left !important}.s-offer-modal-type-discounts-table .s-modal-body{position:relative !important}';export{l as salla_offer_modal}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as i}from"./p-
|
|
4
|
+
import{r as e,h as i}from"./p-FwRU05yW.js";import{G as s}from"./p-OF8QcbMM.js";const l=class{constructor(i){e(this,i),this.minAge=10,this.isEditable=!0,this.disableAction=!1,this.isLoading=!0,this.first_name_trans=salla.lang.get("pages.profile.first_name"),this.last_name_trans=salla.lang.get("pages.profile.last_name"),this.birthday_trans=salla.lang.get("pages.profile.birthday"),this.birthday_placeholder_trans=salla.lang.get("pages.profile.birthday_placeholder"),this.gender_trans=salla.lang.get("pages.profile.gender"),this.gender_placeholder_trans=salla.lang.get("pages.profile.gender_placeholder"),this.male_trans=salla.lang.get("pages.profile.male"),this.female_trans=salla.lang.get("pages.profile.female"),this.email_trans=salla.lang.get("common.elements.email"),this.mobile_trans=salla.lang.get("common.elements.mobile"),this.save_btn_trans=salla.lang.get("common.elements.save"),this.drag_and_drop_trans=salla.lang.get("common.uploader.drag_and_drop"),this.browse_trans=salla.lang.get("common.uploader.browse"),this.email_required_trans=salla.lang.get("pages.checkout.email_required"),this.invalid_email_trans=salla.lang.get("pages.error.invalid_value",{attribute:"email"}),salla.lang.onLoaded((()=>{this.first_name_trans=salla.lang.get("pages.profile.first_name"),this.last_name_trans=salla.lang.get("pages.profile.last_name"),this.birthday_trans=salla.lang.get("pages.profile.birthday"),this.birthday_placeholder_trans=salla.lang.get("pages.profile.birthday_placeholder"),this.gender_trans=salla.lang.get("pages.profile.gender"),this.gender_placeholder_trans=salla.lang.get("pages.profile.gender_placeholder"),this.male_trans=salla.lang.get("pages.profile.male"),this.female_trans=salla.lang.get("pages.profile.female"),this.email_trans=salla.lang.get("common.elements.email"),this.mobile_trans=salla.lang.get("common.elements.mobile"),this.save_btn_trans=salla.lang.get("common.elements.save"),this.drag_and_drop_trans=salla.lang.get("common.uploader.drag_and_drop"),this.browse_trans=salla.lang.get("common.uploader.browse"),this.email_required_trans=salla.lang.get("pages.checkout.email_required"),this.invalid_email_trans=salla.lang.get("pages.error.invalid_value",{attribute:"email"})}))}phoneNumberFieldEventHandler(e){e.detail.number?(this.userData.phone.number=Number.parseInt(e.detail.number),this.userData.phone.country=e.detail.country_code,this.disableAction=!1):this.disableAction=!0}handleFieldChange(e,i,s=!1){i.target.value?(this.userData[e]=i.target.value,this.disableAction=!1):s&&(this.disableAction=!0)}handleEmailInput(e,i){const s=document.getElementById("email-error"),l=i.target.value;if(!l)return this.disableAction=!0,void(s.textContent=this.email_required_trans);/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(l)||(this.disableAction=!0,s.textContent=this.invalid_email_trans),s.textContent="",this.userData[e]=l,this.disableAction=!1}submitForm(e){e.preventDefault(),this.disableAction=!0;const i=Object.assign({},this.userData);i.phone=void 0,i.phone=this.userData.phone.number,i.country_code=this.userData.phone.country,salla.api.profile.update(i).finally((()=>{this.disableAction=!1}))}getBirthDateRestriction(){const e=new Date,i=e.getFullYear()-this.minAge;return e.setFullYear(i),e}fetchData(){return salla.api.profile.info().then((e=>{this.userData=e.data})).finally((()=>{this.isLoading=!1,this.isEditable=!Salla.config.get("store.features").includes("sso-login")}))}renderLoadingSection(){return i("div",{class:"s-user-profile-skeleton-wrapper"},Array.from({length:6},((e,s)=>i("salla-skeleton",{class:"skeleton-item",width:"100%",height:"50px",key:s}))))}componentWillLoad(){Salla.onReady().then((()=>this.fetchData()))}render(){return this.isLoading?this.renderLoadingSection():i("form",{onSubmit:e=>this.submitForm(e)},i("div",{class:"s-user-profile-wrapper"},i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"first-name",class:"s-user-profile-field-label"},this.first_name_trans),i("input",{disabled:!this.isEditable,type:"text",name:"first_name",value:this.userData.first_name,id:"first-name",required:!0,autocomplete:"first_name",class:"form-input",onChange:e=>this.handleFieldChange("first_name",e)})),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"last-name",class:"s-user-profile-field-label"},this.last_name_trans),i("input",{disabled:!this.isEditable,type:"text",name:"last_name",value:this.userData.last_name,id:"last-name",required:!0,autocomplete:"last_name",class:"form-input",onChange:e=>this.handleFieldChange("last_name",e)})),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"birthday",class:"s-user-profile-field-label"},this.birthday_trans),i("salla-datetime-picker",{disabled:!this.isEditable,dateFormat:"Y-m-d",value:this.userData.birthday,placeholder:this.birthday_placeholder_trans,required:!0,maxDate:this.getBirthDateRestriction(),name:"birthday",onPicked:e=>this.handleFieldChange("birthday",e)})),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"gender",class:"s-user-profile-field-label"},this.gender_trans),i("select",{disabled:!this.isEditable,class:"form-input",name:"gender",required:!0,onChange:e=>this.handleFieldChange("gender",e)},i("option",{value:""},this.gender_placeholder_trans),i("option",{value:s.Male,selected:this.userData.gender===s.Male},this.male_trans),i("option",{value:s.Female,selected:this.userData.gender===s.Female},this.female_trans))),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"email",class:"s-user-profile-field-label"},this.email_trans),i("input",{disabled:!this.isEditable,type:"email",name:"email",value:this.userData.email,id:"email",class:"form-input",required:!0,onInput:e=>this.handleEmailInput("email",e)}),i("p",{id:"email-error",class:"s-user-profile-field-error"})),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"international-mobile",class:"s-user-profile-field-label"},this.mobile_trans),i("salla-tel-input",{disabled:!this.isEditable,name:"international-mobile","country-code":this.userData.phone.country,phone:`${this.userData.phone.number}`,onPhoneEntered:e=>this.phoneNumberFieldEventHandler(e)}))),i("salla-button",{type:"submit",loading:this.disableAction,disabled:this.disableAction||!this.isEditable,"loader-position":"end",class:"s-user-profile-submit"},this.save_btn_trans))}};l.style="/*!twlt*/:host{display:block}.form-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.form-input:focus{border-color:var(--color-primary);--tw-ring-color:transparent}.form-input:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.form-input:focus:is(.dark *){border-color:var(--color-primary)}@media (min-width: 640px){.form-input{font-size:0.875rem;line-height:1.25rem}}.s-user-profile-wrapper{display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));gap:1.5rem}@media (min-width: 640px){.s-user-profile-wrapper{grid-template-columns:repeat(2, minmax(0, 1fr));gap:2rem}}.s-user-profile-field-label{margin-bottom:0.5rem;display:block;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-user-profile-field-error{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-user-profile-submit{margin-top:1.5rem;width:100%}.s-user-profile-filepond-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-user-profile-filepond-placeholder-icon{margin-bottom:0.25rem}.s-user-profile-filepond-placeholder-icon svg{height:1.5rem;width:1.5rem;fill:#7c8082}.s-user-profile-skeleton-wrapper{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));grid-template-rows:repeat(3, minmax(0, 1fr));gap:3rem}";export{l as salla_user_profile}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r,h as a,H as t}from"./p-
|
|
4
|
+
import{r,h as a,H as t}from"./p-FwRU05yW.js";import{S as s}from"./p-D4oPi1Ov.js";import{f as e,r as o}from"./p-DqXpn47Z.js";const i=class{constructor(a){r(this,a),this.loadedFactors=[]}async componentWillLoad(){await salla.onReady(),await this.loadFactors()}async onPropsChange(){await this.loadFactors()}getDisplayFactors(){return this.factors?.length?this.factors:this.loadedFactors}async loadFactors(){if(this.factors?.length)this.loadedFactors=[];else if(this.orderId)try{const r=await e(this.orderId);this.loadedFactors=o(r,this.ratingId,this.productId,this.itemId)}catch(r){console.error("[salla-review-factors-tags] failed to load order rating factors",r),this.loadedFactors=[]}else this.loadedFactors=[]}renderFactorTags(){const r=this.getDisplayFactors();return r.length?a("div",{class:"s-review-factors-tags-factors"},r.map((r=>a("div",{class:"s-review-factors-tags-factor-tag"},a("span",{class:"s-review-factors-tags-factor-name"},r.name),a("span",{class:"s-review-factors-tags-factor-star",innerHTML:s}),a("span",{class:"s-review-factors-tags-factor-rating"},r.rating||""))))):null}render(){return a(t,{key:"b9df42d369cd5a7c66d1275202a883f6dc8ac594",class:"s-review-factors-tags-wrapper"},this.renderFactorTags())}static get watchers(){return{factors:["onPropsChange"],orderId:["onPropsChange"],ratingId:["onPropsChange"],productId:["onPropsChange"],itemId:["onPropsChange"]}}};i.style="/*!twlt*/:host{display:inline-flex}.s-review-factors-tags-factors{display:flex;flex-wrap:wrap;gap:0.5rem;justify-content:flex-start;margin-bottom:0.6rem}.s-review-factors-tags-factor-tag{display:inline-flex;align-items:center;gap:0.25rem;border-radius:999px;border:1px solid #e8e8e8;background:rgba(255, 255, 255, 0.3);font-size:0.85rem;line-height:1;padding:0.4rem 0.65rem}.s-review-factors-tags-factor-rating{font-weight:600;color:var(--color-primary) !important}.s-review-factors-tags-factor-star{display:inline-flex;width:0.8rem;height:0.8rem;fill:var(--color-primary) !important}.s-review-factors-tags-factor-star svg{width:100%;height:100%}.s-review-factors-tags-factor-name{color:var(--main-text-color) !important;font-weight:unset !important}.s-review-factors-tags-wrapper{display:inline-flex}.s-review-factors-tags-factors{display:flex;flex-direction:row;flex-wrap:wrap;gap:0.5rem}.s-review-factors-tags-factor-tag{display:inline-flex;align-items:center;gap:0.25rem;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));background-color:rgb(255 255 255 / 0.3);padding-top:0.25rem;padding-bottom:0.25rem;padding-left:0.625rem;padding-right:0.625rem;font-size:0.875rem;line-height:1.25rem}.s-review-factors-tags-factor-name{font-weight:600;color:var(--color-primary-dark)}.s-review-factors-tags-factor-rating{font-weight:600;color:var(--color-primary-dark)}.s-review-factors-tags-factor-star{display:inline-flex;height:0.75rem;width:0.75rem;fill:var(--color-primary-dark)}.s-review-factors-tags-factor-star svg{height:100%;width:100%}";export{i as salla_review_factors_tags}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as a,F as s,a as e}from"./p-
|
|
4
|
+
import{r as t,h as a,F as s,a as e}from"./p-FwRU05yW.js";const i=class{constructor(a){t(this,a),this.isMobileAllowed=!0,this.isEmailRequired=!1,this.supportWebAuth=!0,this.withoutReload=!1,this.source="",this.htmlElement=document.documentElement,this.messages=[],this.isClosable=!0,this.iframeLoaded=!1,this.scrolling="no",this.direction=document.dir,this.canRenderIframe=!1,salla.event.on("login::open",(t=>this.onLoginOpen(t))),salla.event.on("modal::close",(t=>{this.iframe&&this.sendMessageToIframe({source:"login",type:"modal_closed",data:t})})),salla.onReady((()=>{this.api=salla.config.get("store.api"),this.storeId=salla.config.get("store.id")}))}onLoginOpen(t){salla.mobile?.isNativeLoginEnabled?.()||(this.isEmailAllowed||this.isMobileAllowed?(this.source=t?.source??!1,this.withoutReload=t?.withoutReload??this.withoutReload,this.open(t),this.openModal()):salla.logger.warn("Please enable atleast one login type to use this component."))}componentDidLoad(){window.addEventListener("message",(t=>{if(!this.isTrustedMessage(t)||"login"!=t.data?.source)return;if(!this.inline&&!this.canRenderIframe)return;salla.log("salla-account:: recived an event",t.data);let a=t.data?.type?.replace("iframe::",""),s=t.data.message;if("ready"==a)return s.isPasskeyPage?void this.createPassKey.postMessage({source:"login",type:"init_passkey_page",data:{token:salla.storage.get("token"),store_id:salla.config.get("store.id"),locale:salla.config.get("user.language_code"),redirect:salla.config.get("store.url")}},salla.config.get("login.url")):void this.handleIframeReadyAction();if("height"==a)return this.iframe.height=s?.height+"px";if("storage"==a)return this.handleIframeStorageAction(s);if("scrolling"==a)return this.scrolling=s,void(this.isClosable=!1);if("direction"==a)return document.dir=this.direction=s?"rtl":"ltr";if("notify"==a)return salla.notify[s.type](s.message);if("authenticated"==a||"authenticated_web_auth"==a)return!s?.withoutClose&&this.close(),salla.auth.api.handlAfterAuthenticatedResponse(s,this.supportWebAuth).then((()=>!(s?.withoutReload||this.withoutReload)&&setTimeout((()=>window.location.reload()),1e3)));if("dispatchEvent"!=a||"auth::verified"!=s.event){if("dispatchEvent"==a)return salla.event.emit(s.event,...s.payload);if("reload"==a)return s?.withClose&&this.modal.close(),window.location.reload();if("open_page"===a){if(!this.isSafeUrl(s?.url))return;return window.location.href=s.url}if("open_passkey_page"!==a)return"guest-checkout"===a?this.handleGuestCheckout():void("close"==a&&this.close());this.createPassKey=window.open(`${salla.config.get("login.url")}/create-passkey`)}else salla.log("Ignored dispatchEvent `auth::verified` from iframe")})),this.observeDarkModeChanges(),setTimeout((()=>Salla.event.emit("salla-login::ready")),1)}async open(t=null){return Salla.config.isGuest()?this.modal.open():this.withoutReload?void 0:location.reload()}close(){Salla.event.emit("salla-login::closing"),this.modal.close(),this.iframeLoaded=!1,this.canRenderIframe=!1,this.host.dispatchEvent(new CustomEvent("salla-login:closed",{cancelable:!0,bubbles:!0,detail:null})),Salla.event.emit("salla-login::closed")}handleIframeReadyAction(){this.sendInitMessage(),this.sendMessageToIframe({source:"login",type:"width",data:document.body.clientWidth})}observeDarkModeChanges(){new MutationObserver((t=>{t.forEach((t=>{"class"===t.attributeName&&this.sendMessageToIframe({source:"login",type:"darkMode",data:{isDark:!!this.htmlElement.classList.contains("dark")}})}))})).observe(this.htmlElement,{attributes:!0})}async handleIframeStorageAction(t){let a,s=salla.storage.get("cart.user_id"),e=!1;if(Object.entries(t).filter((t=>!Salla.storage.get(t[0]))).forEach((([t,i])=>{salla.log("Shared storage from accounts domain",t,i);let l="string"==typeof i?i?.replace(/^"|"$/g,""):i;salla.storage.set(t,l),"token"===t&&(a=l),"user"===t&&s&&l.id!==s&&(e=!0)})),a){this.modal.close(),Salla.auth.event.tokenFetched(a);try{await Salla.api.cart.assign()}catch(t){Salla.log("Error on assign after handle iframe",t)}e&&Salla.cart.reset();try{!Salla.auth.api.isSessionless()&&await Salla.auth.api.request("auth/jwt"),Salla.auth.api.canRedirect()?setTimeout((()=>window.location.reload()),100):await Salla.auth.event.loggedIn({data:{token:a}}).then((()=>Salla.auth.api.afterUserLogin()))}catch(t){this.modal.open(),Salla.log("Error on request auth/jwt after handle iframe",t)}}else e&&Salla.cart.reset()}isTrustedMessage(t){if(!(this.iframe&&t.source===this.iframe.contentWindow||this.createPassKey&&t.source===this.createPassKey))return!1;let a;try{a=new URL(salla.config.get("login.url","https://accounts.salla.com")).origin}catch(t){a="https://accounts.salla.com"}return t.origin===a}isSafeUrl(t){if("string"!=typeof t||!t)return!1;try{const{protocol:a}=new URL(t,location.href);return"https:"===a||"http:"===a}catch(t){return!1}}sendMessageToIframe(t){if(this.iframe)return this.iframe.contentWindow.postMessage(t,"*")}sendInitMessage(){let t=this.headers;try{t="string"==typeof t?JSON.parse(t):t}catch(a){console.error("Failed to parse headers!",this.headers,a),t=void 0}const a={user:salla.storage.get("user"),s_translations:salla.storage.get("s_translations"),token:salla.storage.get("token")};a.user||delete a.user,a.s_translations||delete a.s_translations,a.token||delete a.token,this.sendMessageToIframe({source:"login",type:"init",data:{id:this.storeId,lang:salla.lang.locale,isDark:!!this.htmlElement.classList.contains("dark"),apiUrl:this.api?.replace(/\/+$/,""),supportWebAuth:this.supportWebAuth,withoutReload:this.withoutReload,inline:this.inline,settings:salla.config.all(),headers:t,storage:a}})}async handleGuestCheckout(){if(this.modal.close(),salla.config.isGuest())return salla.cart.submit(!1,!0)}openModal(){this.canRenderIframe||(this.canRenderIframe=!0),this.modal.open()}render(){if(!Salla.config.isUser())return this.inline?this.getLoginDom():a("salla-modal",{class:"s-login-modal",ref:t=>this.modal=t,width:"xs"},this.getLoginDom())}getLoginDom(){if(this.canRenderIframe)return a(s,null,a("iframe",{src:`${salla.config.get("login.url","https://accounts.salla.com")}?src=${this.source}&version=${salla.config.get("login.version","0.1.78")}`,title:"Salla Login",class:"hide-scroll",loading:"lazy",ref:t=>{this.iframe=t},allow:"publickey-credentials-get; publickey-credentials-create",scrolling:this.scrolling,frameborder:"0",width:"100%"}))}get host(){return e(this)}};i.style="/*!twlt*/iframe{-moz-transition:height 0.3s;-ms-transition:height 0.3s;-o-transition:height 0.3s;-webkit-transition:height 0.3s;transition:height 0.3s;width:100%}.inline{display:inline}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}";export{i as salla_login_modal}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as s,H as r,a as i}from"./p-
|
|
4
|
+
import{r as t,h as s,H as r,a as i}from"./p-FwRU05yW.js";import{H as e}from"./p-DOBDDG4K.js";import"./p-CgtvEd63.js";const a=class{constructor(s){t(this,s),this.productCardComponent="custom-salla-product-card",this.apiUrl="",this.onWishlistStorageSynced=()=>e.syncWishlistIcons(this.host,`${this.productCardComponent}, salla-product-card`)}componentWillLoad(){return salla.onReady().then((async()=>{if(this.includes=e.parseJson(this.includes||this.host.getAttribute("includes")),Array.isArray(this.includes)||(this.includes=null),e.setIncludes(this.includes),this.sourceValueIsValid=!(!this.getSourceValue()&&!this.isSourceWithoutValue()),this.sourceValueIsValid){if(this.hasCustomComponent=!!customElements.get(this.productCardComponent),"json"===this.source)return this.productsData=await this.applyBeforeAppendItems(this.getSourceValue()),void(this.isReady=!0);if("related"!=this.getSource()||salla.config.get("store.settings.product.related_products_enabled"))return"related"===this.getSource()&&salla.config.get("store.settings.product.related_products_enabled")&&"random"===salla.config.get("store.settings.product.product-recommendation-type")&&salla.config.get("store.features")?.includes("ai-driven-personalized-product")&&(this.sourceValue=await salla.recommendations.similarProducts(this.sourceValue,{limit:this.limit||12}).extractProductIds(),this.source="selected"),salla.api.withoutNotifier((()=>salla.product.api.fetch({source:e.getApiSource(this.getSource()),source_value:this.getSourceValue(),limit:this.limit}))).then((t=>e.injectExtraFieldsToResponse(t))).then((async t=>{this.productsData=await this.applyBeforeAppendItems(t.data),this.isReady=!0,t.source=this.getSource(),t.sourceValue=this.getSourceValue(),salla.event.emit("salla-products-slider::products.fetched",this.productsData)}));this.isReady=!1}else salla.logger.warn(`source-value prop is required for source [${this.getSource()}]`)}))}componentDidRender(){let t=0;const s=setInterval((()=>{this.host.querySelectorAll('[loading="lazy"]')?.forEach((t=>t.removeAttribute("loading"))),t++,t>=10&&clearInterval(s)}),1e3)}connectedCallback(){salla.event.on("wishlist::storage.synced",this.onWishlistStorageSynced)}disconnectedCallback(){salla.event.off("wishlist::storage.synced",this.onWishlistStorageSynced)}async componentDidLoad(){await Salla.hooks.registerComponent("salla-products-slider",this)}onReadyChanged(t){t&&salla.wishlist.api.syncStorageFromServer()}isSourceWithoutValue(){return["offers","latest","sales","top-rated"].includes(this.getSource())}getItemHTML(t){const r="landing-page"===this.getSource();r&&(t.url="");const i=r?void 0:()=>{e.saveProductSource(this.getSource()),e.saveProductPosition(t.position)};if(this.hasCustomComponent&&"custom-salla-product-card"==this.productCardComponent.toLowerCase())return s("div",{class:"s-products-slider-card",onClick:i},s("custom-salla-product-card",{product:t,source:this.getSource(),"source-value":this.getSourceValue()}));if(this.hasCustomComponent){const r=document.createElement(this.productCardComponent);return r.setAttribute("product",JSON.stringify(t)),r.setAttribute("source",this.getSource()),r.setAttribute("source-value",this.getSourceValue()),s("div",{class:"s-products-slider-card",onClick:i,innerHTML:r.outerHTML})}return s("div",{class:"s-products-slider-card",onClick:i},s("salla-product-card",{"show-quantity":r,"hide-add-btn":r,"shadow-on-hover":!0,product:t}))}canRender(){return this.sourceValueIsValid&&this.isReady}getSource(){return e.getProductsSource(this.source)}getSourceValue(){return e.getProductsSourceValue(this.source,this.sourceValue)}async applyBeforeAppendItems(t){const s=Array.isArray(t)?t:[],r={component:this,items:s};try{return await salla.hooks.call("salla-products-slider","beforeAppendItems",r),Array.isArray(r.items)?r.items:s}catch{return s}}render(){if(this.canRender())return s(r,{class:"s-products-slider-wrapper"},s("salla-slider",{class:"s-products-slider-slider",id:this.sliderId||`s-products-slider-${Math.random().toString(36).substr(2,9)}`,...this.sliderProps||{},"auto-play":this.autoplay,type:"carousel","block-title":this.blockTitle,"block-subTitle":this.subTitle,"display-all-url":this.displayAllUrl,sliderConfig:this.sliderConfig?this.sliderConfig:null},s("div",{slot:"items"},this.productsData?.map((t=>this.getItemHTML(t))))))}get host(){return i(this)}static get watchers(){return{isReady:["onReadyChanged"]}}};a.style='/*!twlt*/.block{display:block}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-products-slider-wrapper{margin-bottom:2rem}@media (min-width: 768px){.s-products-slider-wrapper{margin-bottom:5rem}}@media (min-width: 1024px){.s-products-slider-wrapper{overflow:hidden}}.s-products-slider-wrapper:where([dir="ltr"],[dir="ltr"] *){padding-right:0px}.s-products-slider-wrapper:where([dir="rtl"],[dir="rtl"] *){padding-left:0px}.s-products-slider-card{height:auto !important;width:100%;max-width:250px;padding-left:0.5rem;padding-right:0.5rem}@media (min-width: 640px){.s-products-slider-card{width:50%;max-width:320px}}@media (min-width: 768px){.s-products-slider-card{width:33.333333%}}@media (min-width: 1024px){.s-products-slider-card{width:25%}}';export{a as salla_products_slider}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,c as s,h as i,H as e,a as n}from"./p-CHZfg_a9.js";import{A as o,a as l}from"./p-Vqpj4CWE.js";const d=class{constructor(i){t(this,i),this.optionsSaved=s(this,"optionsSaved"),this.productSelected=s(this,"productSelected"),this.product=null,this.sectionId=null,this.sectionIndex=0,this.productIndex=0,this.selectedOptions={},this.optionsResetTokens={},this.isLoading=!1,this.hasUnsavedChanges=!1,this.validationErrors=[],this.isProductAlreadySelected=!1}generateCacheKey(t,s,i){return`${t||"unknown"}-${s||0}-${i||"unknown"}`}handleProductChange(t){setTimeout((()=>{this.modal&&t&&this.modal.setTitle(t.name||"")}),100),this.validationErrors=[],this.hasUnsavedChanges=!1}async open(){this.modal?(this.isLoading=!0,this.product?.name&&this.modal.setTitle(this.product.name),this.modal.open(),setTimeout((async()=>{this.product?.id&&await this.initializeSelectedOptions(),this.product?.name&&this.modal.setTitle(this.product.name),this.modal.stopLoading(),this.isLoading=!1}),300)):requestAnimationFrame((()=>this.open()))}async close(){this.modal&&this.modal.close()}async refreshOptionsState(){this.selectedOptions={...this.selectedOptions}}componentDidLoad(){this.modalOpenListener=t=>{this.product=t.product,this.sectionId=t.sectionId||null,this.sectionIndex=t.sectionIndex||0,this.productIndex=t.productIndex||0,this.isProductAlreadySelected=!!t.isProductAlreadySelected,this.open()},salla.event.on("multiple-bundle-product-modal::open",this.modalOpenListener),this.clearOptionsListener=t=>{t&&t.productId&&this.clearProductOptions(t.productId,t.sectionId,t.productIndex)},salla.event.on("multiple-bundle-product-modal::clear-options",this.clearOptionsListener),this.optionChangeListener=t=>{const s=t.detail||t,{option:i,detail:e}=s,n=i||s.option_id&&this.product?.options?.find((t=>t.id===s.option_id||String(t.id)===String(s.option_id))),o=e||(s.id?s:null);this.product?.id&&n&&this.handleOptionChange(Number(this.product.id),n,o)},salla.event.on("product-options::change",this.optionChangeListener),this.checkboxChangeListener=t=>{const s=t.target;if(s&&"checkbox"===s.type&&s.name&&s.name.includes("bundle[")&&s.name.includes("][id]")){const t=s.name.match(/^bundle\[([^\]]+)\]\[([^\]]+)\]\[id\]$/);if(t&&!s.checked){if("true"===s.getAttribute("data-selection-locked"))return void(s.checked=!0);const[,i,e]=t,n=s.value,o=this.host.closest("form");this.cleanupProductDeselection({sectionId:i,productIndex:parseInt(e,10),productId:n,form:o,uncheckedInput:s})}}},document.addEventListener("change",this.checkboxChangeListener)}disconnectedCallback(){this.checkboxChangeListener&&document.removeEventListener("change",this.checkboxChangeListener),this.optionChangeListener&&salla.event.off("product-options::change",this.optionChangeListener),this.modalOpenListener&&salla.event.off("multiple-bundle-product-modal::open",this.modalOpenListener),this.clearOptionsListener&&salla.event.off("multiple-bundle-product-modal::clear-options",this.clearOptionsListener)}cleanupProductDeselection(t){const{sectionId:s,productIndex:i,productId:e,form:n,uncheckedInput:o}=t;if(this.clearProductOptions(e,s,i),n){const t=`bundle[${s}][${i}]`;Array.from(n.querySelectorAll(`input[name^="${t}"]`)).forEach((s=>{if(s===o)return;const i="hidden"===s.type,n=s.getAttribute("data-product-id")===String(e)&&s.name?.startsWith(t);(i||n)&&s.remove()})),requestAnimationFrame((()=>{const t=new window.Event("change",{bubbles:!0});n.dispatchEvent(t)}))}}generateFormInputName(t,s,i){return`bundle[${t}][${s}][options][${i}]`}async initializeSelectedOptions(){if(!this.product?.id)return;const t=this.product.id,s=this.generateCacheKey(this.sectionId,this.productIndex,t),i=document.querySelector(`salla-product-options[product-id="${t}"]`);if(i)try{const t=await i.getSelectedOptions();t&&t.length>0&&(this.selectedOptions={...this.selectedOptions,[s]:t})}catch(t){console.warn("Could not initialize selected options:",t)}}clearProductOptions(t,s,i){const e={...this.selectedOptions};if(null==s||null==i||Number.isNaN(i)){const s=`-${String(t)}`,i=[];Object.keys(e).forEach((t=>{t.endsWith(s)&&(delete e[t],i.push(t))})),i.forEach((t=>this.bumpOptionsResetToken(t)))}else{const n=this.generateCacheKey(s,i,t);delete e[n],this.bumpOptionsResetToken(n)}this.selectedOptions=e,this.validationErrors=[],this.hasUnsavedChanges=!1}bumpOptionsResetToken(t){t&&(this.optionsResetTokens={...this.optionsResetTokens,[t]:(this.optionsResetTokens[t]||0)+1})}async handleOptionChange(t,s,i){const e=this.generateCacheKey(this.sectionId,this.productIndex,t),n=document.querySelector(`salla-product-options[product-id="${t}"]`);let o=[];if(n)try{o=await n.getSelectedOptions()||[]}catch(t){console.warn("Could not get current selections from component:",t)}if(o.length>0)this.selectedOptions={...this.selectedOptions,[e]:o};else if(this.selectedOptions[e]&&this.selectedOptions[e].length>0){const t=[...this.selectedOptions[e]||[]],n=t.findIndex((t=>t.option_id===s.id));n>-1?i&&null!=i.id?t[n]={...i,option_id:s.id}:t.splice(n,1):i&&null!=i.id&&t.push({...i,option_id:s.id}),this.selectedOptions={...this.selectedOptions,[e]:t}}else i&&null!=i.id&&(this.selectedOptions={...this.selectedOptions,[e]:[{...i,option_id:s.id}]});this.hasUnsavedChanges=!0,this.validationErrors=[]}async validateOptions(){if(!this.product?.options)return!0;const t=[],s=this.product.id,i=this.generateCacheKey(this.sectionId,this.productIndex,s),e=document.querySelector(`salla-product-options[product-id="${s}"]`);let n=[];if(e)try{n=await e.getSelectedOptions()||[];const t=this.selectedOptions[i]||[];(t.length>n.length||0===n.length&&t.length>0)&&(n=t)}catch(t){n=this.selectedOptions[i]||[]}else n=this.selectedOptions[i]||[];return 0===n.length&&t.push(salla.lang.get("pages.products.no_options_selected")),this.product.options.forEach((s=>{s.required&&(n.some((t=>t.option_id==s.id))||t.push(salla.lang.get("pages.products.required_option_missing",{option:s.name})))})),this.validationErrors=t,0===t.length}async onSave(t){t.preventDefault();const s=this.product?.id;if(!s)return;const i=this.generateCacheKey(this.sectionId,this.productIndex,s);if(await new Promise((t=>setTimeout(t,100))),await this.validateOptions()){if(!this.isProductAlreadySelected&&null!=this.sectionId){const t=this.host.closest("salla-multiple-bundle-product-details");if(!await(t?.canSelectBundleProduct(this.sectionId,s)))return void salla.notify.error(salla.lang.getWithDefault("pages.products.bundle_selection_limit_reached","لا يمكنك اختيار المزيد من المنتجات في هذا القسم"))}this.isLoading=!0;try{const t=document.querySelector(`salla-product-options[product-id="${s}"]`);let e=await(t?.getSelectedOptions());if((!e||0===e.length)&&this.selectedOptions[i]?.length>0&&(e=this.selectedOptions[i]),!e||0===e.length)return void(this.isLoading=!1);this.selectedOptions={...this.selectedOptions,[i]:e};const n=this.host.closest("form");if(!n)return void(this.isLoading=!1);const o=`bundle[${this.sectionId}][${this.productIndex}]`;Array.from(n.querySelectorAll(`input[name^="${o}"][type="hidden"]`)).forEach((t=>t.remove())),Array.from(n.querySelectorAll(`[data-product-id="${s}"][name^="${o}"]`)).forEach((t=>t.remove()));const l=`bundle[${this.sectionId}][${this.productIndex}][id]`,d=document.getElementById(l);if(d)d.checked=!0;else{const t=document.createElement("input");t.type="hidden",t.name=`bundle[${this.sectionId}][${this.productIndex}][id]`,t.value=String(s),t.dataset.productId=String(s),n.appendChild(t)}e.forEach((t=>{const i=t.option_id,e=document.createElement("input");e.type="hidden",e.name=this.generateFormInputName(this.sectionId,this.productIndex??0,i),e.value=String(t.id),e.dataset.productId=String(s),n.appendChild(e)}));const a=new window.Event("change",{bubbles:!0});n.dispatchEvent(a),this.optionsSaved.emit({productId:Number(s),selectedOptions:e,sectionId:this.sectionId,productIndex:this.productIndex}),this.sectionId&&this.productSelected.emit({productId:Number(s),sectionId:this.sectionId,product:this.product,fromModal:!0}),salla.notify.success(salla.lang.get("pages.products.options_saved")),this.hasUnsavedChanges=!1,this.validationErrors=[],this.modal.close()}catch(t){salla.notify.error(salla.lang.get("pages.products.options_save_error"))}finally{this.isLoading=!1}}else salla.notify.error(this.validationErrors.join(", "))}getOptionsWithSelectedState(){if(!this.product?.options)return[];const t=this.generateCacheKey(this.sectionId,this.productIndex,this.product.id),s=this.selectedOptions[t]||[];return this.product.options.map((t=>({...t,details:t.details.map((t=>{const i=s.some((s=>s.id===t.id));return{...t,is_selected:i}}))})))}render(){const t=this.product?.id,s=this.getOptionsWithSelectedState(),n=this.generateCacheKey(this.sectionId,this.productIndex,t),o=this.optionsResetTokens[n]||0,l=this.isLoading||s.some((t=>t.details.some((t=>t.is_selected&&!0===t.is_out))));return i(e,{key:"610ae038d4f9db109e3f25830e82b39a2b07a010"},i("salla-modal",{key:"b06c130448cd1862d2e879a0285fd385395cc11b",isLoading:this.isLoading,ref:t=>this.modal=t,width:"md",centered:!1,id:`s-multiple-bundle-product-options-modal-options-${t}`,class:"s-multiple-bundle-product-options-modal-wrapper"},i("div",{key:"1f8b9ffa80a40f8240ede4b8996943f7eecf4098",slot:"loading"},i("salla-skeleton",{key:"26463b16022e1f66fd66f4e9cd8907521352bac1",height:"100%",width:"100%"})),this.product?.images&&this.product?.images.length>0&&i("salla-slider",{key:"bae60782cbe4ac7dc325fd666258198cd871a52e",id:`details-slider-${this.product?.id}`,type:"thumbs",loop:!1,"auto-height":!0,"listen-to-thumbnails-option":!0,showThumbsControls:!1,controlsOuter:!1,showControls:!1,class:"s-multiple-bundle-product-options-modal-slider",verticalThumbs:!0,thumbsConfig:{centeredSlides:!0,centeredSlidesBounds:!0,slidesPerView:Math.min(5,Math.max(1,this.product?.images.length)),watchOverflow:!0,watchSlidesProgress:!0,direction:"vertical",spaceBetween:10}},i("div",{key:"998afc3297e89df7e0a6b2514a6d5f4f75152492",slot:"items"},this.product?.images&&this.product?.images.map(((t,s)=>i("div",{key:s,class:"swiper-slide"},i("img",{src:t.url,alt:t.alt||`${this.product?.name} - Image ${s+1}`,loading:"lazy",onError:t=>{t.target.style.display="none"}}))))),this.product?.images&&this.product?.images.length>1&&i("div",{key:"935a3d01a417926e904507d0a64da43c84924068",slot:"thumbs"},this.product?.images&&this.product?.images.map(((t,s)=>i("div",{key:s,"data-caption":`${this.product?.name} - Image ${s+1}`},i("img",{src:t.url,loading:"eager",class:"s-multiple-bundle-product-options-modal-slider-thumb",title:`${this.product?.name} - ${s+1}`,alt:t.alt||`${this.product?.name} - ${s+1}`,onError:t=>{t.target.style.display="none"}})))))),i("salla-product-options",{options:JSON.stringify(s),key:`${n}-reset-${o}`,"product-id":t,"unique-key":`${n}-reset-${o}`}),i("div",{key:"eeb710a27917f6134a2595ebb8e4ec485bb26254",slot:"footer"},i("div",{key:"2ae3d47c461b68d61fcaa1d8f279ae6402aedf2e",class:"s-multiple-bundle-product-options-modal-footer"},i("salla-button",{key:"436f64a89183f0e6d56b6800ad031449c49cc751",onClick:t=>this.onSave(t),loading:this.isLoading,disabled:l},this.isLoading?salla.lang.get("common.elements.saving"):salla.lang.get("common.elements.save"))))))}get host(){return n(this)}static get watchers(){return{product:["handleProductChange"]}}};d.style=":host{display:block}";const a=class{constructor(i){t(this,i),this.productSelected=s(this,"productSelected"),this.productOptionsSelected=s(this,"productOptionsSelected"),this.selectedProducts={},this.isSelectionLocked=!1,this.selectionLimit=0,this.savedOptionsByInstance={},this.handleProductClick=(t,s)=>{const i=this.selectedProducts[this.section.id]?.has(t.id)||!1,e=this.getCheckbox(this.section.id,s);if(i&&this.isSelectionLocked)return void(e&&(e.checked=!0));if(!i&&this.isMaxSelectionReached()&&1!==this.selectionLimit)return;if(1===this.selectionLimit&&!i)return void this.productSelected.emit({product:t,sectionId:this.section.id});if(!e)return;const n=!e.checked;n||(this.dispatchClearOptionsEvent(t,s),this.clearSavedOptionsState(this.section.id,s)),e.checked=n,requestAnimationFrame((()=>{const t=new window.Event("change",{bubbles:!0});e.dispatchEvent(t)})),this.productSelected.emit({product:t,sectionId:this.section.id})},this.handleOptionsClick=t=>{!this.selectedProducts[this.section.id]?.has(t.id)&&this.isMaxSelectionReached()&&1!==this.selectionLimit||this.productOptionsSelected.emit({product:t,sectionId:this.section.id})}}getSelectedCount(){return this.selectedProducts[this.section?.id]?.size??0}isMaxSelectionReached(){return this.selectionLimit>1&&this.getSelectedCount()>=this.selectionLimit}isProductSelectionDisabled(t,s){return 0===t.quantity||!s&&this.isMaxSelectionReached()}getProductInstanceKey(t,s){return`${t}::${s}`}dispatchClearOptionsEvent(t,s){salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t.id,sectionId:this.section.id,sectionIndex:this.sectionIndex,productIndex:s})}handleOptionsSaved(t){const s=t.detail;if(!s)return;const{sectionId:i,productIndex:e,selectedOptions:n}=s;if(null==i||i!==this.section?.id)return;if(null==e||Number.isNaN(e))return;const o=this.getProductInstanceKey(i,e);if(n?.length)this.savedOptionsByInstance={...this.savedOptionsByInstance,[o]:!0};else if(this.savedOptionsByInstance[o]){const t={...this.savedOptionsByInstance};delete t[o],this.savedOptionsByInstance=t}}clearSavedOptionsState(t,s){const i=this.getProductInstanceKey(t,s);if(!this.savedOptionsByInstance[i])return;const e={...this.savedOptionsByInstance};delete e[i],this.savedOptionsByInstance=e}generateEventName(t,s){return`bundle[${t}][${s}][id]`}getCheckbox(t,s){const i=this.generateEventName(t,s);return this.host.querySelector(`input.s-multiple-bundle-product-checkbox[name="${i}"]`)}preventLockedDeselect(t,s){if(!this.isSelectionLocked||!s)return;t.preventDefault(),t.stopPropagation();const i=t.target;"checkbox"===i?.type&&(i.checked=!0)}render(){return i(e,{key:"e473b6089ee0e7026dfec042462ed827dabd0083"},i("salla-slider",{key:"492187e1a1c105c21c48543aa227888d122cfa20",type:"carousel",controlsOuter:!1,showControls:!1,id:`accordion-multiple-bundle-product-${this.section.id}`,pagination:!0,class:"s-multiple-bundle-product-wrapper-slider",sliderConfig:{spaceBetween:0}},i("div",{key:"e40e816439f3b3e1bee12ebdcea60438a45fec12",slot:"items"},this?.section?.products?.map(((t,s)=>{const e=this.selectedProducts[this.section.id]?.has(t.id)||!1,n=e&&this.isSelectionLocked,d=this.isProductSelectionDisabled(t,e),a=this.savedOptionsByInstance[this.getProductInstanceKey(this.section.id,s)]?salla.lang.getWithDefault("pages.products.edit_selected_options","تعديل الخيارات"):salla.lang.get("pages.products.choose_from_options");let c=salla.config.get("theme.is_rtl",!0)?o:l;return i("div",{class:"s-multiple-bundle-product-slide-one-third"+(d?" s-multiple-bundle-product-slide-one-third-disabled":""),key:t.id},i("div",{class:"s-multiple-bundle-product-card"},i("div",{class:"s-multiple-bundle-product-image-wrapper",onClick:()=>this.handleProductClick(t,s)},i("input",{id:this.generateEventName(this.section.id,s),type:"checkbox",class:"s-multiple-bundle-product-checkbox",checked:e,"data-selection-locked":n?"true":void 0,name:this.generateEventName(this.section.id,s),value:t.id,onClick:t=>this.preventLockedDeselect(t,e),onChange:t=>this.preventLockedDeselect(t,e)}),i("img",{src:t.image.url||salla.url.cdn("images/s-empty.png"),loading:"lazy",alt:t.image.alt||t.name,class:"s-multiple-bundle-product-image"})),i("div",{class:"s-multiple-bundle-product-content-wrapper"},i("div",{class:"s-multiple-bundle-product-content"},i("div",{class:"s-multiple-bundle-product-details"},i("div",{class:"s-multiple-bundle-product-title-wrapper"},i("h2",{class:"s-multiple-bundle-product-title"},i("a",{href:t?.url||"#",target:"_blank",rel:"noopener noreferrer"},t.name))),i("div",{class:"s-multiple-bundle-product-price-wrapper"},i("span",{class:"s-multiple-bundle-product-price"},i("span",{innerHTML:salla.money(t.price)})),t.sale_price>0&&i("span",{class:"s-multiple-bundle-product-price-discount"},i("span",{innerHTML:salla.money(t.regular_price)})))),t.quantity_in_group>0&&0!==t.quantity&&i("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.pieces"),i("span",null,t.quantity_in_group)),0===t.quantity&&i("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.quantity_in_group_finished"))),t.options?.length>0&&i("button",{class:"s-multiple-bundle-product-button",onClick:()=>this.handleOptionsClick(t),type:"button"},a,i("span",{class:"s-multiple-bundle-product-button-icon",innerHTML:c})))))})))))}get host(){return n(this)}};a.style="";export{d as salla_multiple_bundle_product_options_modal,a as salla_multiple_bundle_product_slider}
|
|
4
|
+
import{r as t,c as s,h as i,H as e,a as n}from"./p-FwRU05yW.js";import{A as o,a as l}from"./p-Vqpj4CWE.js";const d=class{constructor(i){t(this,i),this.optionsSaved=s(this,"optionsSaved"),this.productSelected=s(this,"productSelected"),this.product=null,this.sectionId=null,this.sectionIndex=0,this.productIndex=0,this.selectedOptions={},this.optionsResetTokens={},this.isLoading=!1,this.hasUnsavedChanges=!1,this.validationErrors=[],this.isProductAlreadySelected=!1}generateCacheKey(t,s,i){return`${t||"unknown"}-${s||0}-${i||"unknown"}`}handleProductChange(t){setTimeout((()=>{this.modal&&t&&this.modal.setTitle(t.name||"")}),100),this.validationErrors=[],this.hasUnsavedChanges=!1}async open(){this.modal?(this.isLoading=!0,this.product?.name&&this.modal.setTitle(this.product.name),this.modal.open(),setTimeout((async()=>{this.product?.id&&await this.initializeSelectedOptions(),this.product?.name&&this.modal.setTitle(this.product.name),this.modal.stopLoading(),this.isLoading=!1}),300)):requestAnimationFrame((()=>this.open()))}async close(){this.modal&&this.modal.close()}async refreshOptionsState(){this.selectedOptions={...this.selectedOptions}}componentDidLoad(){this.modalOpenListener=t=>{this.product=t.product,this.sectionId=t.sectionId||null,this.sectionIndex=t.sectionIndex||0,this.productIndex=t.productIndex||0,this.isProductAlreadySelected=!!t.isProductAlreadySelected,this.open()},salla.event.on("multiple-bundle-product-modal::open",this.modalOpenListener),this.clearOptionsListener=t=>{t&&t.productId&&this.clearProductOptions(t.productId,t.sectionId,t.productIndex)},salla.event.on("multiple-bundle-product-modal::clear-options",this.clearOptionsListener),this.optionChangeListener=t=>{const s=t.detail||t,{option:i,detail:e}=s,n=i||s.option_id&&this.product?.options?.find((t=>t.id===s.option_id||String(t.id)===String(s.option_id))),o=e||(s.id?s:null);this.product?.id&&n&&this.handleOptionChange(Number(this.product.id),n,o)},salla.event.on("product-options::change",this.optionChangeListener),this.checkboxChangeListener=t=>{const s=t.target;if(s&&"checkbox"===s.type&&s.name&&s.name.includes("bundle[")&&s.name.includes("][id]")){const t=s.name.match(/^bundle\[([^\]]+)\]\[([^\]]+)\]\[id\]$/);if(t&&!s.checked){if("true"===s.getAttribute("data-selection-locked"))return void(s.checked=!0);const[,i,e]=t,n=s.value,o=this.host.closest("form");this.cleanupProductDeselection({sectionId:i,productIndex:parseInt(e,10),productId:n,form:o,uncheckedInput:s})}}},document.addEventListener("change",this.checkboxChangeListener)}disconnectedCallback(){this.checkboxChangeListener&&document.removeEventListener("change",this.checkboxChangeListener),this.optionChangeListener&&salla.event.off("product-options::change",this.optionChangeListener),this.modalOpenListener&&salla.event.off("multiple-bundle-product-modal::open",this.modalOpenListener),this.clearOptionsListener&&salla.event.off("multiple-bundle-product-modal::clear-options",this.clearOptionsListener)}cleanupProductDeselection(t){const{sectionId:s,productIndex:i,productId:e,form:n,uncheckedInput:o}=t;if(this.clearProductOptions(e,s,i),n){const t=`bundle[${s}][${i}]`;Array.from(n.querySelectorAll(`input[name^="${t}"]`)).forEach((s=>{if(s===o)return;const i="hidden"===s.type,n=s.getAttribute("data-product-id")===String(e)&&s.name?.startsWith(t);(i||n)&&s.remove()})),requestAnimationFrame((()=>{const t=new window.Event("change",{bubbles:!0});n.dispatchEvent(t)}))}}generateFormInputName(t,s,i){return`bundle[${t}][${s}][options][${i}]`}async initializeSelectedOptions(){if(!this.product?.id)return;const t=this.product.id,s=this.generateCacheKey(this.sectionId,this.productIndex,t),i=document.querySelector(`salla-product-options[product-id="${t}"]`);if(i)try{const t=await i.getSelectedOptions();t&&t.length>0&&(this.selectedOptions={...this.selectedOptions,[s]:t})}catch(t){console.warn("Could not initialize selected options:",t)}}clearProductOptions(t,s,i){const e={...this.selectedOptions};if(null==s||null==i||Number.isNaN(i)){const s=`-${String(t)}`,i=[];Object.keys(e).forEach((t=>{t.endsWith(s)&&(delete e[t],i.push(t))})),i.forEach((t=>this.bumpOptionsResetToken(t)))}else{const n=this.generateCacheKey(s,i,t);delete e[n],this.bumpOptionsResetToken(n)}this.selectedOptions=e,this.validationErrors=[],this.hasUnsavedChanges=!1}bumpOptionsResetToken(t){t&&(this.optionsResetTokens={...this.optionsResetTokens,[t]:(this.optionsResetTokens[t]||0)+1})}async handleOptionChange(t,s,i){const e=this.generateCacheKey(this.sectionId,this.productIndex,t),n=document.querySelector(`salla-product-options[product-id="${t}"]`);let o=[];if(n)try{o=await n.getSelectedOptions()||[]}catch(t){console.warn("Could not get current selections from component:",t)}if(o.length>0)this.selectedOptions={...this.selectedOptions,[e]:o};else if(this.selectedOptions[e]&&this.selectedOptions[e].length>0){const t=[...this.selectedOptions[e]||[]],n=t.findIndex((t=>t.option_id===s.id));n>-1?i&&null!=i.id?t[n]={...i,option_id:s.id}:t.splice(n,1):i&&null!=i.id&&t.push({...i,option_id:s.id}),this.selectedOptions={...this.selectedOptions,[e]:t}}else i&&null!=i.id&&(this.selectedOptions={...this.selectedOptions,[e]:[{...i,option_id:s.id}]});this.hasUnsavedChanges=!0,this.validationErrors=[]}async validateOptions(){if(!this.product?.options)return!0;const t=[],s=this.product.id,i=this.generateCacheKey(this.sectionId,this.productIndex,s),e=document.querySelector(`salla-product-options[product-id="${s}"]`);let n=[];if(e)try{n=await e.getSelectedOptions()||[];const t=this.selectedOptions[i]||[];(t.length>n.length||0===n.length&&t.length>0)&&(n=t)}catch(t){n=this.selectedOptions[i]||[]}else n=this.selectedOptions[i]||[];return 0===n.length&&t.push(salla.lang.get("pages.products.no_options_selected")),this.product.options.forEach((s=>{s.required&&(n.some((t=>t.option_id==s.id))||t.push(salla.lang.get("pages.products.required_option_missing",{option:s.name})))})),this.validationErrors=t,0===t.length}async onSave(t){t.preventDefault();const s=this.product?.id;if(!s)return;const i=this.generateCacheKey(this.sectionId,this.productIndex,s);if(await new Promise((t=>setTimeout(t,100))),await this.validateOptions()){if(!this.isProductAlreadySelected&&null!=this.sectionId){const t=this.host.closest("salla-multiple-bundle-product-details");if(!await(t?.canSelectBundleProduct(this.sectionId,s)))return void salla.notify.error(salla.lang.getWithDefault("pages.products.bundle_selection_limit_reached","لا يمكنك اختيار المزيد من المنتجات في هذا القسم"))}this.isLoading=!0;try{const t=document.querySelector(`salla-product-options[product-id="${s}"]`);let e=await(t?.getSelectedOptions());if((!e||0===e.length)&&this.selectedOptions[i]?.length>0&&(e=this.selectedOptions[i]),!e||0===e.length)return void(this.isLoading=!1);this.selectedOptions={...this.selectedOptions,[i]:e};const n=this.host.closest("form");if(!n)return void(this.isLoading=!1);const o=`bundle[${this.sectionId}][${this.productIndex}]`;Array.from(n.querySelectorAll(`input[name^="${o}"][type="hidden"]`)).forEach((t=>t.remove())),Array.from(n.querySelectorAll(`[data-product-id="${s}"][name^="${o}"]`)).forEach((t=>t.remove()));const l=`bundle[${this.sectionId}][${this.productIndex}][id]`,d=document.getElementById(l);if(d)d.checked=!0;else{const t=document.createElement("input");t.type="hidden",t.name=`bundle[${this.sectionId}][${this.productIndex}][id]`,t.value=String(s),t.dataset.productId=String(s),n.appendChild(t)}e.forEach((t=>{const i=t.option_id,e=document.createElement("input");e.type="hidden",e.name=this.generateFormInputName(this.sectionId,this.productIndex??0,i),e.value=String(t.id),e.dataset.productId=String(s),n.appendChild(e)}));const a=new window.Event("change",{bubbles:!0});n.dispatchEvent(a),this.optionsSaved.emit({productId:Number(s),selectedOptions:e,sectionId:this.sectionId,productIndex:this.productIndex}),this.sectionId&&this.productSelected.emit({productId:Number(s),sectionId:this.sectionId,product:this.product,fromModal:!0}),salla.notify.success(salla.lang.get("pages.products.options_saved")),this.hasUnsavedChanges=!1,this.validationErrors=[],this.modal.close()}catch(t){salla.notify.error(salla.lang.get("pages.products.options_save_error"))}finally{this.isLoading=!1}}else salla.notify.error(this.validationErrors.join(", "))}getOptionsWithSelectedState(){if(!this.product?.options)return[];const t=this.generateCacheKey(this.sectionId,this.productIndex,this.product.id),s=this.selectedOptions[t]||[];return this.product.options.map((t=>({...t,details:t.details.map((t=>{const i=s.some((s=>s.id===t.id));return{...t,is_selected:i}}))})))}render(){const t=this.product?.id,s=this.getOptionsWithSelectedState(),n=this.generateCacheKey(this.sectionId,this.productIndex,t),o=this.optionsResetTokens[n]||0,l=this.isLoading||s.some((t=>t.details.some((t=>t.is_selected&&!0===t.is_out))));return i(e,{key:"610ae038d4f9db109e3f25830e82b39a2b07a010"},i("salla-modal",{key:"b06c130448cd1862d2e879a0285fd385395cc11b",isLoading:this.isLoading,ref:t=>this.modal=t,width:"md",centered:!1,id:`s-multiple-bundle-product-options-modal-options-${t}`,class:"s-multiple-bundle-product-options-modal-wrapper"},i("div",{key:"1f8b9ffa80a40f8240ede4b8996943f7eecf4098",slot:"loading"},i("salla-skeleton",{key:"26463b16022e1f66fd66f4e9cd8907521352bac1",height:"100%",width:"100%"})),this.product?.images&&this.product?.images.length>0&&i("salla-slider",{key:"bae60782cbe4ac7dc325fd666258198cd871a52e",id:`details-slider-${this.product?.id}`,type:"thumbs",loop:!1,"auto-height":!0,"listen-to-thumbnails-option":!0,showThumbsControls:!1,controlsOuter:!1,showControls:!1,class:"s-multiple-bundle-product-options-modal-slider",verticalThumbs:!0,thumbsConfig:{centeredSlides:!0,centeredSlidesBounds:!0,slidesPerView:Math.min(5,Math.max(1,this.product?.images.length)),watchOverflow:!0,watchSlidesProgress:!0,direction:"vertical",spaceBetween:10}},i("div",{key:"998afc3297e89df7e0a6b2514a6d5f4f75152492",slot:"items"},this.product?.images&&this.product?.images.map(((t,s)=>i("div",{key:s,class:"swiper-slide"},i("img",{src:t.url,alt:t.alt||`${this.product?.name} - Image ${s+1}`,loading:"lazy",onError:t=>{t.target.style.display="none"}}))))),this.product?.images&&this.product?.images.length>1&&i("div",{key:"935a3d01a417926e904507d0a64da43c84924068",slot:"thumbs"},this.product?.images&&this.product?.images.map(((t,s)=>i("div",{key:s,"data-caption":`${this.product?.name} - Image ${s+1}`},i("img",{src:t.url,loading:"eager",class:"s-multiple-bundle-product-options-modal-slider-thumb",title:`${this.product?.name} - ${s+1}`,alt:t.alt||`${this.product?.name} - ${s+1}`,onError:t=>{t.target.style.display="none"}})))))),i("salla-product-options",{options:JSON.stringify(s),key:`${n}-reset-${o}`,"product-id":t,"unique-key":`${n}-reset-${o}`}),i("div",{key:"eeb710a27917f6134a2595ebb8e4ec485bb26254",slot:"footer"},i("div",{key:"2ae3d47c461b68d61fcaa1d8f279ae6402aedf2e",class:"s-multiple-bundle-product-options-modal-footer"},i("salla-button",{key:"436f64a89183f0e6d56b6800ad031449c49cc751",onClick:t=>this.onSave(t),loading:this.isLoading,disabled:l},this.isLoading?salla.lang.get("common.elements.saving"):salla.lang.get("common.elements.save"))))))}get host(){return n(this)}static get watchers(){return{product:["handleProductChange"]}}};d.style=":host{display:block}";const a=class{constructor(i){t(this,i),this.productSelected=s(this,"productSelected"),this.productOptionsSelected=s(this,"productOptionsSelected"),this.selectedProducts={},this.isSelectionLocked=!1,this.selectionLimit=0,this.savedOptionsByInstance={},this.handleProductClick=(t,s)=>{const i=this.selectedProducts[this.section.id]?.has(t.id)||!1,e=this.getCheckbox(this.section.id,s);if(i&&this.isSelectionLocked)return void(e&&(e.checked=!0));if(!i&&this.isMaxSelectionReached()&&1!==this.selectionLimit)return;if(1===this.selectionLimit&&!i)return void this.productSelected.emit({product:t,sectionId:this.section.id});if(!e)return;const n=!e.checked;n||(this.dispatchClearOptionsEvent(t,s),this.clearSavedOptionsState(this.section.id,s)),e.checked=n,requestAnimationFrame((()=>{const t=new window.Event("change",{bubbles:!0});e.dispatchEvent(t)})),this.productSelected.emit({product:t,sectionId:this.section.id})},this.handleOptionsClick=t=>{!this.selectedProducts[this.section.id]?.has(t.id)&&this.isMaxSelectionReached()&&1!==this.selectionLimit||this.productOptionsSelected.emit({product:t,sectionId:this.section.id})}}getSelectedCount(){return this.selectedProducts[this.section?.id]?.size??0}isMaxSelectionReached(){return this.selectionLimit>1&&this.getSelectedCount()>=this.selectionLimit}isProductSelectionDisabled(t,s){return 0===t.quantity||!s&&this.isMaxSelectionReached()}getProductInstanceKey(t,s){return`${t}::${s}`}dispatchClearOptionsEvent(t,s){salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t.id,sectionId:this.section.id,sectionIndex:this.sectionIndex,productIndex:s})}handleOptionsSaved(t){const s=t.detail;if(!s)return;const{sectionId:i,productIndex:e,selectedOptions:n}=s;if(null==i||i!==this.section?.id)return;if(null==e||Number.isNaN(e))return;const o=this.getProductInstanceKey(i,e);if(n?.length)this.savedOptionsByInstance={...this.savedOptionsByInstance,[o]:!0};else if(this.savedOptionsByInstance[o]){const t={...this.savedOptionsByInstance};delete t[o],this.savedOptionsByInstance=t}}clearSavedOptionsState(t,s){const i=this.getProductInstanceKey(t,s);if(!this.savedOptionsByInstance[i])return;const e={...this.savedOptionsByInstance};delete e[i],this.savedOptionsByInstance=e}generateEventName(t,s){return`bundle[${t}][${s}][id]`}getCheckbox(t,s){const i=this.generateEventName(t,s);return this.host.querySelector(`input.s-multiple-bundle-product-checkbox[name="${i}"]`)}preventLockedDeselect(t,s){if(!this.isSelectionLocked||!s)return;t.preventDefault(),t.stopPropagation();const i=t.target;"checkbox"===i?.type&&(i.checked=!0)}render(){return i(e,{key:"e473b6089ee0e7026dfec042462ed827dabd0083"},i("salla-slider",{key:"492187e1a1c105c21c48543aa227888d122cfa20",type:"carousel",controlsOuter:!1,showControls:!1,id:`accordion-multiple-bundle-product-${this.section.id}`,pagination:!0,class:"s-multiple-bundle-product-wrapper-slider",sliderConfig:{spaceBetween:0}},i("div",{key:"e40e816439f3b3e1bee12ebdcea60438a45fec12",slot:"items"},this?.section?.products?.map(((t,s)=>{const e=this.selectedProducts[this.section.id]?.has(t.id)||!1,n=e&&this.isSelectionLocked,d=this.isProductSelectionDisabled(t,e),a=this.savedOptionsByInstance[this.getProductInstanceKey(this.section.id,s)]?salla.lang.getWithDefault("pages.products.edit_selected_options","تعديل الخيارات"):salla.lang.get("pages.products.choose_from_options");let c=salla.config.get("theme.is_rtl",!0)?o:l;return i("div",{class:"s-multiple-bundle-product-slide-one-third"+(d?" s-multiple-bundle-product-slide-one-third-disabled":""),key:t.id},i("div",{class:"s-multiple-bundle-product-card"},i("div",{class:"s-multiple-bundle-product-image-wrapper",onClick:()=>this.handleProductClick(t,s)},i("input",{id:this.generateEventName(this.section.id,s),type:"checkbox",class:"s-multiple-bundle-product-checkbox",checked:e,"data-selection-locked":n?"true":void 0,name:this.generateEventName(this.section.id,s),value:t.id,onClick:t=>this.preventLockedDeselect(t,e),onChange:t=>this.preventLockedDeselect(t,e)}),i("img",{src:t.image.url||salla.url.cdn("images/s-empty.png"),loading:"lazy",alt:t.image.alt||t.name,class:"s-multiple-bundle-product-image"})),i("div",{class:"s-multiple-bundle-product-content-wrapper"},i("div",{class:"s-multiple-bundle-product-content"},i("div",{class:"s-multiple-bundle-product-details"},i("div",{class:"s-multiple-bundle-product-title-wrapper"},i("h2",{class:"s-multiple-bundle-product-title"},i("a",{href:t?.url||"#",target:"_blank",rel:"noopener noreferrer"},t.name))),i("div",{class:"s-multiple-bundle-product-price-wrapper"},i("span",{class:"s-multiple-bundle-product-price"},i("span",{innerHTML:salla.money(t.price)})),t.sale_price>0&&i("span",{class:"s-multiple-bundle-product-price-discount"},i("span",{innerHTML:salla.money(t.regular_price)})))),t.quantity_in_group>0&&0!==t.quantity&&i("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.pieces"),i("span",null,t.quantity_in_group)),0===t.quantity&&i("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.quantity_in_group_finished"))),t.options?.length>0&&i("button",{class:"s-multiple-bundle-product-button",onClick:()=>this.handleOptionsClick(t),type:"button"},a,i("span",{class:"s-multiple-bundle-product-button-icon",innerHTML:c})))))})))))}get host(){return n(this)}};a.style="";export{d as salla_multiple_bundle_product_options_modal,a as salla_multiple_bundle_product_slider}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as e,H as o,a}from"./p-CHZfg_a9.js";import{P as r}from"./p-DY4LZmNP.js";import{I as s}from"./p-C-tzSDxw.js";const i=class{constructor(e){t(this,e),this.variant="info"}renderIcon(){const t=this.icon||this.variant;if("none"===t)return null;switch(t){case"success":return e("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},e("path",{d:"M9 16.2l-3.5-3.5L4 14.2l5 5 11-11-1.5-1.5z"}));case"warning":return e("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},e("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}));case"error":return e("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},e("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 \n 10 10 10-4.48 10-10S17.52 2 12 2zm5 \n 13.59L15.59 17 12 13.41 8.41 17 \n 7 15.59 10.59 12 7 8.41 8.41 7 \n 12 10.59 15.59 7 17 8.41 13.41 \n 12 17 15.59z"}));default:return e("span",{innerHTML:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.99935 18.3332C5.39697 18.3332 1.66602 14.6022 1.66602 9.99984C1.66602 5.39746 5.39697 1.6665 9.99935 1.6665C14.6017 1.6665 18.3327 5.39746 18.3327 9.99984C18.3327 14.6022 14.6017 18.3332 9.99935 18.3332ZM9.99935 16.6665C13.6813 16.6665 16.666 13.6818 16.666 9.99984C16.666 6.31794 13.6813 3.33317 9.99935 3.33317C6.31745 3.33317 3.33268 6.31794 3.33268 9.99984C3.33268 13.6818 6.31745 16.6665 9.99935 16.6665ZM9.16602 5.83317H10.8327V7.49984H9.16602V5.83317ZM9.16602 9.1665H10.8327V14.1665H9.16602V9.1665Z" fill="#417AC8"/>\n</svg>\n'})}}render(){return e(o,{key:"e26a52cc275ac4c2e4090c113cb7e7d4d578fc11",class:`s-alert-wrapper s-alert-${this.variant}`},e("span",{key:"bdb1c6693b226a4e136e89640fcc19fbefc6e29e",class:"s-alert-icon"},this.renderIcon()),e("span",{key:"de8997f9617e74fc082ae9603bf16eac4c0a4b17",class:"s-alert-text"},this.message,e("slot",{key:"37fb1adba1fa7f0226143250632cf20b514ee06b"})))}};i.style="/*!twlt*/:host{display:block}.s-alert-wrapper{display:flex;align-items:center;justify-content:flex-end;border-radius:0.375rem;border-width:1px;border-color:transparent;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;font-size:0.75rem;line-height:1.5rem}.s-alert-info{--tw-border-opacity:1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1));--tw-text-opacity:1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.s-alert-success{--tw-border-opacity:1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1));--tw-text-opacity:1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.s-alert-warning{--tw-border-opacity:1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1));--tw-text-opacity:1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.s-alert-error{--tw-border-opacity:1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1));--tw-text-opacity:1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.s-alert-icon{margin-left:0.5rem;display:flex;align-items:center}.s-alert-text{flex:1 1 0%;text-align:start}";const l=class{constructor(e){t(this,e),this.storeId=salla.config.get("store.id"),this.template=salla.config.get("store.template"),this.loading=!1,this.templateData={},this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.storePrice=salla.lang.getWithDefault("common.elements.store_price","سعر المتجر"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template"),this.isRtl=salla.config.get("theme.is_rtl",!0),this.storeName=salla.config.get("store.name"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","تفاصيل أكثر"),this.type="popup",salla.lang.onLoaded((()=>{this.defaultMessage=salla.lang.get("common.elements.experimental_and_available_store"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template");const t=salla.lang.messages?.["ar.trans"],e=salla.lang.messages?.["en.trans"];t&&e&&(salla.helpers.setNested(t,"common.elements.more_details","تفاصيل أكثر"),salla.helpers.setNested(e,"common.elements.more_details","More Details"),salla.helpers.setNested(t,"common.elements.store_price","سعر المتجر"),salla.helpers.setNested(e,"common.elements.store_price","Store Price"),salla.helpers.setNested(t,"common.elements.the_developer","المطور"),salla.helpers.setNested(e,"common.elements.the_developer","the developer"),salla.helpers.setNested(t,"common.elements.store_price_details","السعر يشمل"),salla.helpers.setNested(e,"common.elements.store_price_details","Price Includes"),salla.helpers.setNested(t,"common.elements.salla","سلة"),salla.helpers.setNested(e,"common.elements.salla","Salla"),salla.helpers.setNested(t,"common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),salla.helpers.setNested(e,"common.elements.store_is_available_for_purchase","This ready store is available for purchase from"),salla.helpers.setNested(t,"common.elements.ready_stores","المتاجر الجاهزة"),salla.helpers.setNested(e,"common.elements.ready_stores","Ready Stores"),setTimeout((()=>{this.storePrice=salla.lang.get("common.elements.store_price"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","More Details")}),100))}))}componentDidLoad(){this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0&&this.fetchTemplateData()}open(){return this.drawer.open()}fetchTemplateData(){if(!Object.keys(this.templateData).length)return this.loading=!0,salla.api.request("/store/template",{},"get",{"Store-Identifier":this.storeId}).then((t=>{this.templateData=t.data,this.loading=!1})).catch((()=>{this.loading=!1}))}handleAction(){"link"===this.type&&(window.location.href=this.actionUrl),"popup"===this.type&&this.open()}popup(){return e("salla-drawer",{class:"s-bottom-alert-modal",ref:t=>this.drawer=t,"no-padding":!0,onLoad:()=>{this.drawer&&Object.keys(this.templateData).length&&this.drawer.setTitle(this.storeDetails+" "+this.storeName)}},Object.keys(this.templateData).length?[e("div",{class:"s-bottom-alert-modal-inner s-scrollbar"},e("div",{class:{"s-bottom-alert-modal-content":!0}},this.templateData?.features?[e("div",{class:"s-bottom-alert-modal-content-title"},e("i",{innerHTML:s,class:"s-bottom-alert-modal-content-icon"}),e("span",null,this.storeFeatures)),e("div",{class:"s-bottom-alert-modal-content-features",innerHTML:this.templateData?.features})]:""),e("div",{class:{"s-bottom-alert-modal-content":!0,"s-bottom-alert-modal-content-extra-padding":this.templateData?.price}},this.templateData?.features?[e("div",{class:"s-bottom-alert-modal-content-title"},e("i",{innerHTML:'\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>money-card</title>\n<path d="M17.333 14.667h-2.667c-0.736 0-1.333-0.599-1.333-1.333s0.597-1.333 1.333-1.333h4c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333h-1.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333c-2.205 0-4 1.795-4 4s1.795 4 4 4h2.667c0.736 0 1.333 0.597 1.333 1.333s-0.597 1.333-1.333 1.333h-4c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h1.333v1.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-1.333c2.205 0 4-1.795 4-4s-1.795-4-4-4zM28 2.667h-24c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-18.667c0-2.205-1.795-4-4-4zM29.333 25.333c0 0.736-0.597 1.333-1.333 1.333h-24c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.735 0.597-1.333 1.333-1.333h24c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-icon"}),e("span",null,this.storePriceDetails)),e("div",{class:"s-bottom-alert-modal-content-price-details"},this.templateData?.price_details?.items.map((t=>e("div",{class:"s-bottom-alert-modal-content-price-details-item"},e("i",{innerHTML:'\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>check-circle</title>\n<path d="M19.557 11.26l-4.593 6.891-2.891-1.927c-0.616-0.411-1.441-0.243-1.849 0.369-0.409 0.612-0.244 1.441 0.369 1.849l4 2.667c0.228 0.152 0.485 0.224 0.739 0.224 0.431 0 0.855-0.208 1.111-0.593l5.333-8c0.409-0.612 0.244-1.441-0.369-1.849-0.616-0.411-1.443-0.243-1.849 0.369zM16 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.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-price-details-item-icon"}),e("span",{class:"s-bottom-alert-modal-content-price-details-item-name"},t.name),e("span",{class:"s-bottom-alert-modal-content-price-details-item-price",innerHTML:salla.money(t.price)})))))]:""),this.templateData?.link?e("div",{class:"s-bottom-alert-modal-content-footer"},e("salla-button",{color:"primary",size:"medium",width:"wide",href:this.templateData?.link},e("i",{innerHTML:r}),this.buyTheTemplate)):"")]:"")}render(){const t=this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0;return e(o,{key:"1e598df3c91be1e357fc5d771061ec386573f968",class:"s-bottom-alert-wrapper "+(t?"s-bottom-alert-wrapper-with-template":"")},t&&e("div",{key:"20a0173dfa6a01b793f8e1e9416d295ee4e61783",class:"s-bottom-alert-logo-section"},e("img",{key:"2c9042f0ce022aeb9b2879496ec2837ed14dfe9f",src:"https://cdn.salla.network/images/logo/logo-light.svg",alt:"Salla",class:"s-bottom-alert-logo"}),e("span",{key:"69c2bc09acca8a535d2f982131ccc09d65ea44e6",class:"s-bottom-alert-logo-text"},this.readyStores)),e("div",{key:"553122bac6f1f11c2bcc41a92ac798b3701ebfb9",class:"s-bottom-alert-content"},e("div",{key:"e0df96405998b70c15a8320c8400fa75db77d041",class:"flex items-center gap-2"},e("div",{key:"26f241c725c763dfc25f58cdcd0f2979571a2061",class:"s-bottom-alert-icon"},e("i",this.icon?{class:this.icon}:{innerHTML:'\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>info</title>\n<path d="M16 13.333c-0.737 0-1.333 0.596-1.333 1.333v9.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-9.333c0-0.737-0.596-1.333-1.333-1.333zM16 7.987c-0.737 0-1.333 0.596-1.333 1.333v0.013c0 0.737 0.596 1.327 1.333 1.327s1.333-0.603 1.333-1.34-0.596-1.333-1.333-1.333zM16 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.333z"></path>\n</svg>\n'})),e("div",{key:"5e6ba42a2924aec3b99050e8f53634716023a535",class:"s-bottom-alert-message"},this.message?this.message:t?e("span",{class:"flex flex-wrap items-center gap-1"},this.defaultMessage,e("span",{class:{"s-bottom-alert-message-highlight":!0},"aria-label":"Developer"},this.salla),e("span",{innerHTML:salla.money(this.template.price)})):this.defaultMessage)),"banner"!==this.type&&e("div",{key:"44c4d9499736d84da97b640b8ab063a6b9dd6d3c",class:t?"s-bottom-alert-actions-group":"s-bottom-alert-action"},t?this.loading?e("salla-loading",{size:"20"}):e("div",{class:"s-bottom-alert-actions-group-container"},e("a",{class:"s-bottom-alert-action-link",onClick:()=>this.handleAction()},this.actionLabel||this.moreDetailsLabel),this.templateData?.link?e("button",{type:"button",class:"s-bottom-alert-action-purchase-button",onClick:()=>window.open(this.templateData?.link,"_blank")},this.buyTheTemplate):null):e("salla-button",{href:this.actionUrl,size:"medium",onClick:()=>this.handleAction(),width:"normal"},this.actionLabel||this.defaultActionLabel)),"popup"===this.type&&this.popup()))}get host(){return a(this)}};l.style="/*!twlt*/:host{display:block}.flex{display:flex}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.gap-1{gap:0.25rem}.gap-2{gap:0.5rem}.s-scrollbar::-webkit-scrollbar{width:5px}.s-scrollbar::-webkit-scrollbar-track{background-color:#eee}.s-scrollbar::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}.s-bottom-alert-wrapper{position:fixed;bottom:0px;z-index:50;display:flex;min-height:4rem;width:100%;flex-direction:column;align-items:center;justify-content:center;background-color:var(--color-primary);padding-left:0.625rem;padding-right:0.625rem;padding-top:0.625rem;padding-bottom:0.625rem}@media (min-width: 768px){.s-bottom-alert-wrapper{padding-left:2.5rem;padding-right:2.5rem}}.s-bottom-alert-wrapper-with-template{flex-direction:column;align-items:center;justify-content:space-between;--tw-bg-opacity:1;background-color:rgb(0 73 86 / var(--tw-bg-opacity, 1));font-family:PingARLT,system-ui;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 768px){.s-bottom-alert-wrapper-with-template{flex-direction:row}}.s-bottom-alert-logo-section{display:flex;align-items:center;gap:0.5rem;padding-left:1rem;padding-right:1rem;padding-top:0.5rem;padding-bottom:0.5rem}.s-bottom-alert-logo{height:auto;width:3rem}.s-bottom-alert-logo-text{font-size:1.25rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(186 243 230 / var(--tw-text-opacity, 1))}.s-bottom-alert-icon svg{height:1rem;width:1rem;fill:#fff}.s-bottom-alert-message{font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-bottom-alert-message-highlight{cursor:default;font-size:1rem;line-height:1.5rem;font-weight:700}.s-bottom-alert-message-splitter{margin-left:0.5rem;margin-right:0.5rem}.s-bottom-alert-message-link{cursor:pointer;text-decoration-line:underline}.s-bottom-alert-content{display:flex;height:100%;flex-direction:column;align-items:center;justify-content:center;gap:1rem}@media (min-width: 768px){.s-bottom-alert-content{flex-direction:row}}.s-bottom-alert-action button{background-color:var(--color-primary-reverse);font-size:0.875rem;line-height:1.25rem;color:var(--color-primary)}.s-bottom-alert-actions-group{display:flex;align-items:center;gap:1rem}.s-bottom-alert-action-link{cursor:pointer;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(186 243 230 / var(--tw-text-opacity, 1));text-decoration-line:underline;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bottom-alert-action-link:hover{opacity:0.8}.s-bottom-alert-action-purchase-button{border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(186 243 230 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.5rem;padding-bottom:0.5rem;--tw-text-opacity:1;color:rgb(0 73 86 / var(--tw-text-opacity, 1))}.s-bottom-alert-actions-group-container{display:flex;align-items:center;gap:1rem}.s-bottom-alert-modal .s-modal-body{padding-top:1rem;padding-bottom:1rem}.s-bottom-alert-modal-cover img{height:300px;width:100%;object-fit:cover}.s-bottom-alert-modal-inner{max-height:80vh;overflow-y:auto;overflow-x:hidden;padding-left:1rem;padding-right:1rem}.s-bottom-alert-modal-content-title{margin-top:1rem;margin-bottom:1rem;display:flex;align-items:center;gap:0.5rem;font-size:1.125rem;line-height:1.75rem;font-weight:700;color:var(--color-primary-dark)}.s-bottom-alert-modal-content-icon svg{height:1.25rem;width:1.25rem;fill:var(--color-primary-dark)}.s-bottom-alert-modal-content-extra-padding{padding-bottom:100px}.s-bottom-alert-modal-content hr{margin-top:1rem}.s-bottom-alert-modal-content-screenshots{margin-top:1rem;margin-bottom:1rem}.s-bottom-alert-modal-content-screenshot.swiper-slide{height:200px !important;width:370px !important}.s-bottom-alert-modal-content-screenshot img{height:100%;width:100%;object-fit:cover}.s-bottom-alert-modal-content-footer button .s-button-text{display:flex;align-items:center;gap:0.5rem}.s-bottom-alert-modal-content-footer{position:fixed;left:0px;right:0px;bottom:0px;z-index:2;width:100%;--tw-bg-opacity:1;background-color:rgb(252 252 252 / var(--tw-bg-opacity, 1));padding:0.625rem}.s-bottom-alert-modal-content-price-details{display:flex;flex-direction:column;gap:0.5rem}.s-bottom-alert-modal-content-price-details-item{display:flex;align-items:center;gap:0.375rem}.s-bottom-alert-modal-content-price-details-item-icon svg{height:1rem;width:1rem;fill:var(--color-primary-dark)}.s-bottom-alert-modal-content-price-details-item-name{--tw-text-opacity:1;color:rgb(68 68 68 / var(--tw-text-opacity, 1))}.s-bottom-alert-modal-content-price-details-item-price{font-weight:500;--tw-text-opacity:1;color:rgb(102 102 102 / var(--tw-text-opacity, 1))}.s-bottom-alert-modal-price-wrapper{margin-bottom:0.625rem;display:flex;align-items:center;justify-content:space-between;font-size:1rem;line-height:1.5rem}.s-bottom-alert-modal-price-wrapper-amount{font-size:1.125rem;line-height:1.75rem;font-weight:700}";export{i as salla_alert,l as salla_bottom_alert}
|
|
4
|
+
import{r as t,h as e,H as o,a}from"./p-FwRU05yW.js";import{P as r}from"./p-DY4LZmNP.js";import{I as s}from"./p-C-tzSDxw.js";const i=class{constructor(e){t(this,e),this.variant="info"}renderIcon(){const t=this.icon||this.variant;if("none"===t)return null;switch(t){case"success":return e("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},e("path",{d:"M9 16.2l-3.5-3.5L4 14.2l5 5 11-11-1.5-1.5z"}));case"warning":return e("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},e("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}));case"error":return e("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},e("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 \n 10 10 10-4.48 10-10S17.52 2 12 2zm5 \n 13.59L15.59 17 12 13.41 8.41 17 \n 7 15.59 10.59 12 7 8.41 8.41 7 \n 12 10.59 15.59 7 17 8.41 13.41 \n 12 17 15.59z"}));default:return e("span",{innerHTML:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.99935 18.3332C5.39697 18.3332 1.66602 14.6022 1.66602 9.99984C1.66602 5.39746 5.39697 1.6665 9.99935 1.6665C14.6017 1.6665 18.3327 5.39746 18.3327 9.99984C18.3327 14.6022 14.6017 18.3332 9.99935 18.3332ZM9.99935 16.6665C13.6813 16.6665 16.666 13.6818 16.666 9.99984C16.666 6.31794 13.6813 3.33317 9.99935 3.33317C6.31745 3.33317 3.33268 6.31794 3.33268 9.99984C3.33268 13.6818 6.31745 16.6665 9.99935 16.6665ZM9.16602 5.83317H10.8327V7.49984H9.16602V5.83317ZM9.16602 9.1665H10.8327V14.1665H9.16602V9.1665Z" fill="#417AC8"/>\n</svg>\n'})}}render(){return e(o,{key:"e26a52cc275ac4c2e4090c113cb7e7d4d578fc11",class:`s-alert-wrapper s-alert-${this.variant}`},e("span",{key:"bdb1c6693b226a4e136e89640fcc19fbefc6e29e",class:"s-alert-icon"},this.renderIcon()),e("span",{key:"de8997f9617e74fc082ae9603bf16eac4c0a4b17",class:"s-alert-text"},this.message,e("slot",{key:"37fb1adba1fa7f0226143250632cf20b514ee06b"})))}};i.style="/*!twlt*/:host{display:block}.s-alert-wrapper{display:flex;align-items:center;justify-content:flex-end;border-radius:0.375rem;border-width:1px;border-color:transparent;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;font-size:0.75rem;line-height:1.5rem}.s-alert-info{--tw-border-opacity:1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1));--tw-text-opacity:1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.s-alert-success{--tw-border-opacity:1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1));--tw-text-opacity:1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.s-alert-warning{--tw-border-opacity:1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1));--tw-text-opacity:1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.s-alert-error{--tw-border-opacity:1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1));--tw-text-opacity:1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.s-alert-icon{margin-left:0.5rem;display:flex;align-items:center}.s-alert-text{flex:1 1 0%;text-align:start}";const l=class{constructor(e){t(this,e),this.storeId=salla.config.get("store.id"),this.template=salla.config.get("store.template"),this.loading=!1,this.templateData={},this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.storePrice=salla.lang.getWithDefault("common.elements.store_price","سعر المتجر"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template"),this.isRtl=salla.config.get("theme.is_rtl",!0),this.storeName=salla.config.get("store.name"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","تفاصيل أكثر"),this.type="popup",salla.lang.onLoaded((()=>{this.defaultMessage=salla.lang.get("common.elements.experimental_and_available_store"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template");const t=salla.lang.messages?.["ar.trans"],e=salla.lang.messages?.["en.trans"];t&&e&&(salla.helpers.setNested(t,"common.elements.more_details","تفاصيل أكثر"),salla.helpers.setNested(e,"common.elements.more_details","More Details"),salla.helpers.setNested(t,"common.elements.store_price","سعر المتجر"),salla.helpers.setNested(e,"common.elements.store_price","Store Price"),salla.helpers.setNested(t,"common.elements.the_developer","المطور"),salla.helpers.setNested(e,"common.elements.the_developer","the developer"),salla.helpers.setNested(t,"common.elements.store_price_details","السعر يشمل"),salla.helpers.setNested(e,"common.elements.store_price_details","Price Includes"),salla.helpers.setNested(t,"common.elements.salla","سلة"),salla.helpers.setNested(e,"common.elements.salla","Salla"),salla.helpers.setNested(t,"common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),salla.helpers.setNested(e,"common.elements.store_is_available_for_purchase","This ready store is available for purchase from"),salla.helpers.setNested(t,"common.elements.ready_stores","المتاجر الجاهزة"),salla.helpers.setNested(e,"common.elements.ready_stores","Ready Stores"),setTimeout((()=>{this.storePrice=salla.lang.get("common.elements.store_price"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","More Details")}),100))}))}componentDidLoad(){this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0&&this.fetchTemplateData()}open(){return this.drawer.open()}fetchTemplateData(){if(!Object.keys(this.templateData).length)return this.loading=!0,salla.api.request("/store/template",{},"get",{"Store-Identifier":this.storeId}).then((t=>{this.templateData=t.data,this.loading=!1})).catch((()=>{this.loading=!1}))}handleAction(){"link"===this.type&&(window.location.href=this.actionUrl),"popup"===this.type&&this.open()}popup(){return e("salla-drawer",{class:"s-bottom-alert-modal",ref:t=>this.drawer=t,"no-padding":!0,onLoad:()=>{this.drawer&&Object.keys(this.templateData).length&&this.drawer.setTitle(this.storeDetails+" "+this.storeName)}},Object.keys(this.templateData).length?[e("div",{class:"s-bottom-alert-modal-inner s-scrollbar"},e("div",{class:{"s-bottom-alert-modal-content":!0}},this.templateData?.features?[e("div",{class:"s-bottom-alert-modal-content-title"},e("i",{innerHTML:s,class:"s-bottom-alert-modal-content-icon"}),e("span",null,this.storeFeatures)),e("div",{class:"s-bottom-alert-modal-content-features",innerHTML:this.templateData?.features})]:""),e("div",{class:{"s-bottom-alert-modal-content":!0,"s-bottom-alert-modal-content-extra-padding":this.templateData?.price}},this.templateData?.features?[e("div",{class:"s-bottom-alert-modal-content-title"},e("i",{innerHTML:'\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>money-card</title>\n<path d="M17.333 14.667h-2.667c-0.736 0-1.333-0.599-1.333-1.333s0.597-1.333 1.333-1.333h4c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333h-1.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333c-2.205 0-4 1.795-4 4s1.795 4 4 4h2.667c0.736 0 1.333 0.597 1.333 1.333s-0.597 1.333-1.333 1.333h-4c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h1.333v1.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-1.333c2.205 0 4-1.795 4-4s-1.795-4-4-4zM28 2.667h-24c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-18.667c0-2.205-1.795-4-4-4zM29.333 25.333c0 0.736-0.597 1.333-1.333 1.333h-24c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.735 0.597-1.333 1.333-1.333h24c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-icon"}),e("span",null,this.storePriceDetails)),e("div",{class:"s-bottom-alert-modal-content-price-details"},this.templateData?.price_details?.items.map((t=>e("div",{class:"s-bottom-alert-modal-content-price-details-item"},e("i",{innerHTML:'\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>check-circle</title>\n<path d="M19.557 11.26l-4.593 6.891-2.891-1.927c-0.616-0.411-1.441-0.243-1.849 0.369-0.409 0.612-0.244 1.441 0.369 1.849l4 2.667c0.228 0.152 0.485 0.224 0.739 0.224 0.431 0 0.855-0.208 1.111-0.593l5.333-8c0.409-0.612 0.244-1.441-0.369-1.849-0.616-0.411-1.443-0.243-1.849 0.369zM16 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.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-price-details-item-icon"}),e("span",{class:"s-bottom-alert-modal-content-price-details-item-name"},t.name),e("span",{class:"s-bottom-alert-modal-content-price-details-item-price",innerHTML:salla.money(t.price)})))))]:""),this.templateData?.link?e("div",{class:"s-bottom-alert-modal-content-footer"},e("salla-button",{color:"primary",size:"medium",width:"wide",href:this.templateData?.link},e("i",{innerHTML:r}),this.buyTheTemplate)):"")]:"")}render(){const t=this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0;return e(o,{key:"1e598df3c91be1e357fc5d771061ec386573f968",class:"s-bottom-alert-wrapper "+(t?"s-bottom-alert-wrapper-with-template":"")},t&&e("div",{key:"20a0173dfa6a01b793f8e1e9416d295ee4e61783",class:"s-bottom-alert-logo-section"},e("img",{key:"2c9042f0ce022aeb9b2879496ec2837ed14dfe9f",src:"https://cdn.salla.network/images/logo/logo-light.svg",alt:"Salla",class:"s-bottom-alert-logo"}),e("span",{key:"69c2bc09acca8a535d2f982131ccc09d65ea44e6",class:"s-bottom-alert-logo-text"},this.readyStores)),e("div",{key:"553122bac6f1f11c2bcc41a92ac798b3701ebfb9",class:"s-bottom-alert-content"},e("div",{key:"e0df96405998b70c15a8320c8400fa75db77d041",class:"flex items-center gap-2"},e("div",{key:"26f241c725c763dfc25f58cdcd0f2979571a2061",class:"s-bottom-alert-icon"},e("i",this.icon?{class:this.icon}:{innerHTML:'\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>info</title>\n<path d="M16 13.333c-0.737 0-1.333 0.596-1.333 1.333v9.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-9.333c0-0.737-0.596-1.333-1.333-1.333zM16 7.987c-0.737 0-1.333 0.596-1.333 1.333v0.013c0 0.737 0.596 1.327 1.333 1.327s1.333-0.603 1.333-1.34-0.596-1.333-1.333-1.333zM16 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.333z"></path>\n</svg>\n'})),e("div",{key:"5e6ba42a2924aec3b99050e8f53634716023a535",class:"s-bottom-alert-message"},this.message?this.message:t?e("span",{class:"flex flex-wrap items-center gap-1"},this.defaultMessage,e("span",{class:{"s-bottom-alert-message-highlight":!0},"aria-label":"Developer"},this.salla),e("span",{innerHTML:salla.money(this.template.price)})):this.defaultMessage)),"banner"!==this.type&&e("div",{key:"44c4d9499736d84da97b640b8ab063a6b9dd6d3c",class:t?"s-bottom-alert-actions-group":"s-bottom-alert-action"},t?this.loading?e("salla-loading",{size:"20"}):e("div",{class:"s-bottom-alert-actions-group-container"},e("a",{class:"s-bottom-alert-action-link",onClick:()=>this.handleAction()},this.actionLabel||this.moreDetailsLabel),this.templateData?.link?e("button",{type:"button",class:"s-bottom-alert-action-purchase-button",onClick:()=>window.open(this.templateData?.link,"_blank")},this.buyTheTemplate):null):e("salla-button",{href:this.actionUrl,size:"medium",onClick:()=>this.handleAction(),width:"normal"},this.actionLabel||this.defaultActionLabel)),"popup"===this.type&&this.popup()))}get host(){return a(this)}};l.style="/*!twlt*/:host{display:block}.flex{display:flex}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.gap-1{gap:0.25rem}.gap-2{gap:0.5rem}.s-scrollbar::-webkit-scrollbar{width:5px}.s-scrollbar::-webkit-scrollbar-track{background-color:#eee}.s-scrollbar::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}.s-bottom-alert-wrapper{position:fixed;bottom:0px;z-index:50;display:flex;min-height:4rem;width:100%;flex-direction:column;align-items:center;justify-content:center;background-color:var(--color-primary);padding-left:0.625rem;padding-right:0.625rem;padding-top:0.625rem;padding-bottom:0.625rem}@media (min-width: 768px){.s-bottom-alert-wrapper{padding-left:2.5rem;padding-right:2.5rem}}.s-bottom-alert-wrapper-with-template{flex-direction:column;align-items:center;justify-content:space-between;--tw-bg-opacity:1;background-color:rgb(0 73 86 / var(--tw-bg-opacity, 1));font-family:PingARLT,system-ui;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 768px){.s-bottom-alert-wrapper-with-template{flex-direction:row}}.s-bottom-alert-logo-section{display:flex;align-items:center;gap:0.5rem;padding-left:1rem;padding-right:1rem;padding-top:0.5rem;padding-bottom:0.5rem}.s-bottom-alert-logo{height:auto;width:3rem}.s-bottom-alert-logo-text{font-size:1.25rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(186 243 230 / var(--tw-text-opacity, 1))}.s-bottom-alert-icon svg{height:1rem;width:1rem;fill:#fff}.s-bottom-alert-message{font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-bottom-alert-message-highlight{cursor:default;font-size:1rem;line-height:1.5rem;font-weight:700}.s-bottom-alert-message-splitter{margin-left:0.5rem;margin-right:0.5rem}.s-bottom-alert-message-link{cursor:pointer;text-decoration-line:underline}.s-bottom-alert-content{display:flex;height:100%;flex-direction:column;align-items:center;justify-content:center;gap:1rem}@media (min-width: 768px){.s-bottom-alert-content{flex-direction:row}}.s-bottom-alert-action button{background-color:var(--color-primary-reverse);font-size:0.875rem;line-height:1.25rem;color:var(--color-primary)}.s-bottom-alert-actions-group{display:flex;align-items:center;gap:1rem}.s-bottom-alert-action-link{cursor:pointer;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(186 243 230 / var(--tw-text-opacity, 1));text-decoration-line:underline;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bottom-alert-action-link:hover{opacity:0.8}.s-bottom-alert-action-purchase-button{border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(186 243 230 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.5rem;padding-bottom:0.5rem;--tw-text-opacity:1;color:rgb(0 73 86 / var(--tw-text-opacity, 1))}.s-bottom-alert-actions-group-container{display:flex;align-items:center;gap:1rem}.s-bottom-alert-modal .s-modal-body{padding-top:1rem;padding-bottom:1rem}.s-bottom-alert-modal-cover img{height:300px;width:100%;object-fit:cover}.s-bottom-alert-modal-inner{max-height:80vh;overflow-y:auto;overflow-x:hidden;padding-left:1rem;padding-right:1rem}.s-bottom-alert-modal-content-title{margin-top:1rem;margin-bottom:1rem;display:flex;align-items:center;gap:0.5rem;font-size:1.125rem;line-height:1.75rem;font-weight:700;color:var(--color-primary-dark)}.s-bottom-alert-modal-content-icon svg{height:1.25rem;width:1.25rem;fill:var(--color-primary-dark)}.s-bottom-alert-modal-content-extra-padding{padding-bottom:100px}.s-bottom-alert-modal-content hr{margin-top:1rem}.s-bottom-alert-modal-content-screenshots{margin-top:1rem;margin-bottom:1rem}.s-bottom-alert-modal-content-screenshot.swiper-slide{height:200px !important;width:370px !important}.s-bottom-alert-modal-content-screenshot img{height:100%;width:100%;object-fit:cover}.s-bottom-alert-modal-content-footer button .s-button-text{display:flex;align-items:center;gap:0.5rem}.s-bottom-alert-modal-content-footer{position:fixed;left:0px;right:0px;bottom:0px;z-index:2;width:100%;--tw-bg-opacity:1;background-color:rgb(252 252 252 / var(--tw-bg-opacity, 1));padding:0.625rem}.s-bottom-alert-modal-content-price-details{display:flex;flex-direction:column;gap:0.5rem}.s-bottom-alert-modal-content-price-details-item{display:flex;align-items:center;gap:0.375rem}.s-bottom-alert-modal-content-price-details-item-icon svg{height:1rem;width:1rem;fill:var(--color-primary-dark)}.s-bottom-alert-modal-content-price-details-item-name{--tw-text-opacity:1;color:rgb(68 68 68 / var(--tw-text-opacity, 1))}.s-bottom-alert-modal-content-price-details-item-price{font-weight:500;--tw-text-opacity:1;color:rgb(102 102 102 / var(--tw-text-opacity, 1))}.s-bottom-alert-modal-price-wrapper{margin-bottom:0.625rem;display:flex;align-items:center;justify-content:space-between;font-size:1rem;line-height:1.5rem}.s-bottom-alert-modal-price-wrapper-amount{font-size:1.125rem;line-height:1.75rem;font-weight:700}";export{i as salla_alert,l as salla_bottom_alert}
|