@salla.sa/twilight-components 2.14.547 → 2.14.548
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-DFvIrFhD.js → filepond-CGA4aTUA.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-CHg39XJj.js → filepond-plugin-file-poster-DyVz7vP9.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-kGmw5h8R.js → filepond-plugin-file-validate-size-CgzYDBcU.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-CQSi2A-P.js → filepond-plugin-file-validate-type-Dx2CbMZ9.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-M4teY-We.js → filepond-plugin-image-edit-D3aTsFmD.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-gBQo0ofe.js → filepond-plugin-image-exif-orientation-BW3usWts.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-DTmK0D_I.js → filepond-plugin-image-preview-Bb7_UNPY.js} +1 -1
- package/dist/cjs/{index-kkUUTdZu.js → index-BssNhL-x.js} +18 -14
- package/dist/cjs/{intlTelInput-CVOJSgbc.js → intlTelInput-B7QYiZ0d.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_9.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 +1 -1
- 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-itKa_-k9.js → vanilla-picker-H1di5S1s.js} +1 -1
- package/dist/components/index.js +18 -14
- package/dist/esm/{filepond-VE8WYfjh.js → filepond-CXmbiROU.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-B5RS-KUm.js → filepond-plugin-file-poster-DrmkMK37.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-BdgcVHpq.js → filepond-plugin-file-validate-size-fRXLDtKY.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-CmH44b6j.js → filepond-plugin-file-validate-type-9x4CtZKy.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-B-XPDjr0.js → filepond-plugin-image-edit-BTjvSjn9.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-ENeGT6qs.js → filepond-plugin-image-exif-orientation-CnSOx2Lm.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-D9RKj5A_.js → filepond-plugin-image-preview-Cy0Nd8Xr.js} +1 -1
- package/dist/esm/{index-RGVg6FYq.js → index-B64o_70M.js} +18 -14
- package/dist/esm/{intlTelInput-ClLDqBrH.js → intlTelInput-FF2eKbuC.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_9.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 +1 -1
- 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-DWGLcuLb.js → vanilla-picker-DMNociUd.js} +1 -1
- package/dist/twilight/{p-380b8531.entry.js → p-003648b5.entry.js} +1 -1
- package/dist/twilight/{p-cdad8f41.entry.js → p-04cc5898.entry.js} +1 -1
- package/dist/twilight/{p-C8tT82U5.js → p-0MyCcOKI.js} +1 -1
- package/dist/twilight/{p-cf488159.entry.js → p-0c7bdda5.entry.js} +1 -1
- package/dist/twilight/{p-dd507247.entry.js → p-0dfd760b.entry.js} +1 -1
- package/dist/twilight/{p-af39795f.entry.js → p-13978ff2.entry.js} +1 -1
- package/dist/twilight/{p-9fafcedd.entry.js → p-1485dedd.entry.js} +1 -1
- package/dist/twilight/{p-aea12a46.entry.js → p-1628c63c.entry.js} +1 -1
- package/dist/twilight/{p-d02688da.entry.js → p-177e9071.entry.js} +1 -1
- package/dist/twilight/{p-25c61f91.entry.js → p-19b03612.entry.js} +1 -1
- package/dist/twilight/{p-eefcc343.entry.js → p-1ad71324.entry.js} +1 -1
- package/dist/twilight/{p-2ae585c9.entry.js → p-1ce848ab.entry.js} +1 -1
- package/dist/twilight/{p-a9476bc3.entry.js → p-1edbb249.entry.js} +1 -1
- package/dist/twilight/{p-eab06e84.entry.js → p-233b9115.entry.js} +1 -1
- package/dist/twilight/{p-582d081e.entry.js → p-26c750c8.entry.js} +1 -1
- package/dist/twilight/{p-a32e7b62.entry.js → p-2ddabee9.entry.js} +1 -1
- package/dist/twilight/{p-6288de29.entry.js → p-2f64c3b3.entry.js} +1 -1
- package/dist/twilight/{p-01dee064.entry.js → p-309f771b.entry.js} +1 -1
- package/dist/twilight/{p-15fea4e9.entry.js → p-37b73a97.entry.js} +1 -1
- package/dist/twilight/{p-df8d9655.entry.js → p-3b7cbf05.entry.js} +1 -1
- package/dist/twilight/{p-d67b4059.entry.js → p-3eb853f9.entry.js} +1 -1
- package/dist/twilight/{p-5b6fd8b5.entry.js → p-3f460184.entry.js} +1 -1
- package/dist/twilight/{p-f8e6aaac.entry.js → p-40d4ccbb.entry.js} +1 -1
- package/dist/twilight/{p-08fa1534.entry.js → p-440687a4.entry.js} +1 -1
- package/dist/twilight/{p-2d2e29fe.entry.js → p-441ee14a.entry.js} +1 -1
- package/dist/twilight/{p-e9b2c4a5.entry.js → p-49c7dc56.entry.js} +1 -1
- package/dist/twilight/{p-1f7d964d.entry.js → p-522fb030.entry.js} +1 -1
- package/dist/twilight/{p-9a8a1b47.entry.js → p-52607d64.entry.js} +1 -1
- package/dist/twilight/{p-c6859fd3.entry.js → p-5273dbb2.entry.js} +1 -1
- package/dist/twilight/{p-ef10024f.entry.js → p-55cbacd7.entry.js} +1 -1
- package/dist/twilight/{p-6ec304ac.entry.js → p-569ad58b.entry.js} +1 -1
- package/dist/twilight/{p-fcc66e23.entry.js → p-56e553e4.entry.js} +1 -1
- package/dist/twilight/{p-b73e784e.entry.js → p-5ab11313.entry.js} +1 -1
- package/dist/twilight/{p-ad884517.entry.js → p-5c9e4502.entry.js} +1 -1
- package/dist/twilight/{p-4d12b009.entry.js → p-5f860460.entry.js} +1 -1
- package/dist/twilight/{p-4663f4da.entry.js → p-5f9b8ada.entry.js} +1 -1
- package/dist/twilight/{p-97a7d4cf.entry.js → p-602e632c.entry.js} +1 -1
- package/dist/twilight/{p-d6ea5ca7.entry.js → p-63a2ee05.entry.js} +1 -1
- package/dist/twilight/{p-b02c4a37.entry.js → p-63acbca7.entry.js} +1 -1
- package/dist/twilight/{p-66ca510c.entry.js → p-63cebaef.entry.js} +1 -1
- package/dist/twilight/{p-d835a5dd.entry.js → p-6451e759.entry.js} +1 -1
- package/dist/twilight/{p-0adea51c.entry.js → p-647832d9.entry.js} +1 -1
- package/dist/twilight/{p-45734a3b.entry.js → p-660a552a.entry.js} +1 -1
- package/dist/twilight/{p-a4e382fb.entry.js → p-66ece3d6.entry.js} +1 -1
- package/dist/twilight/{p-b164cb76.entry.js → p-6cd863b9.entry.js} +1 -1
- package/dist/twilight/{p-3713dbff.entry.js → p-74a1a32f.entry.js} +1 -1
- package/dist/twilight/{p-5819795e.entry.js → p-74c7cc02.entry.js} +1 -1
- package/dist/twilight/{p-459ce78a.entry.js → p-77fa0f9f.entry.js} +1 -1
- package/dist/twilight/{p-bbc8f3dd.entry.js → p-7c2a0a8b.entry.js} +1 -1
- package/dist/twilight/{p-b9a8f977.entry.js → p-7ce5c2cd.entry.js} +1 -1
- package/dist/twilight/{p-acd88f45.entry.js → p-7eca6506.entry.js} +1 -1
- package/dist/twilight/{p-03de43a3.entry.js → p-840dd411.entry.js} +1 -1
- package/dist/twilight/{p-541bf8ef.entry.js → p-87227eb2.entry.js} +1 -1
- package/dist/twilight/{p-aff22960.entry.js → p-897b8824.entry.js} +1 -1
- package/dist/twilight/{p-d46ef139.entry.js → p-8e293878.entry.js} +1 -1
- package/dist/twilight/{p-d03e6073.entry.js → p-8e631629.entry.js} +1 -1
- package/dist/twilight/{p-a8af052d.entry.js → p-923a35da.entry.js} +1 -1
- package/dist/twilight/{p-1cef7ea2.entry.js → p-971b8ff5.entry.js} +1 -1
- package/dist/twilight/{p-61bc2e97.entry.js → p-991fa4ad.entry.js} +1 -1
- package/dist/twilight/{p-067e7e32.entry.js → p-9a617c41.entry.js} +1 -1
- package/dist/twilight/{p-fd9d7372.entry.js → p-9ae25175.entry.js} +1 -1
- package/dist/twilight/{p-4e904400.entry.js → p-9dbf3ff4.entry.js} +1 -1
- package/dist/twilight/p-B64o_70M.js +5 -0
- package/dist/twilight/{p-DvDYmxRj.js → p-BK166pHQ.js} +1 -1
- package/dist/twilight/{p-DqHR-XSp.js → p-BcGXp0zm.js} +1 -1
- package/dist/twilight/{p-BFco-_Zl.js → p-Bh11vKua.js} +1 -1
- package/dist/twilight/{p-D42LpeIl.js → p-DBnECOny.js} +2 -2
- package/dist/twilight/{p-CkrRlrjj.js → p-DWqu98fW.js} +1 -1
- package/dist/twilight/{p-B_QMCKVO.js → p-DrJZdc5M.js} +1 -1
- package/dist/twilight/{p-BVamrCNR.js → p-GwasjFLA.js} +1 -1
- package/dist/twilight/{p-DT4oJGXj.js → p-UxfFm_QX.js} +1 -1
- package/dist/twilight/{p-a56851b0.entry.js → p-a0e8ca67.entry.js} +1 -1
- package/dist/twilight/{p-f93cab86.entry.js → p-a5199e7d.entry.js} +1 -1
- package/dist/twilight/{p-a0543daf.entry.js → p-a7fccb9c.entry.js} +1 -1
- package/dist/twilight/{p-9b791c53.entry.js → p-a867beee.entry.js} +1 -1
- package/dist/twilight/{p-696cb80c.entry.js → p-ace041b9.entry.js} +1 -1
- package/dist/twilight/{p-bc9585d0.entry.js → p-b0500232.entry.js} +1 -1
- package/dist/twilight/{p-70ef6b79.entry.js → p-b0a87a8d.entry.js} +1 -1
- package/dist/twilight/{p-93ac34c7.entry.js → p-b16264a3.entry.js} +1 -1
- package/dist/twilight/{p-c1be2f63.entry.js → p-b17c6f84.entry.js} +1 -1
- package/dist/twilight/{p-44595831.entry.js → p-b4d47e7c.entry.js} +1 -1
- package/dist/twilight/{p-3ffe6fa7.entry.js → p-b4f2f280.entry.js} +1 -1
- package/dist/twilight/{p-f8609873.entry.js → p-b4fda5f4.entry.js} +1 -1
- package/dist/twilight/{p-c353a96a.entry.js → p-b8cd26a7.entry.js} +1 -1
- package/dist/twilight/{p-bef1df8a.entry.js → p-ba32a9d2.entry.js} +1 -1
- package/dist/twilight/{p-d40958e4.entry.js → p-be916b5f.entry.js} +1 -1
- package/dist/twilight/{p-f5f420c4.entry.js → p-c26f1183.entry.js} +1 -1
- package/dist/twilight/{p-c7abf516.entry.js → p-c5d1b2e4.entry.js} +1 -1
- package/dist/twilight/{p-6971174e.entry.js → p-c8dae54b.entry.js} +1 -1
- package/dist/twilight/{p-1c40b212.entry.js → p-c9b1ad01.entry.js} +1 -1
- package/dist/twilight/{p-2ba184be.entry.js → p-cacf3c75.entry.js} +1 -1
- package/dist/twilight/{p-fd94973d.entry.js → p-cb02e6db.entry.js} +1 -1
- package/dist/twilight/{p-9340d397.entry.js → p-d0847af9.entry.js} +1 -1
- package/dist/twilight/{p-e304b491.entry.js → p-d7e4f0f8.entry.js} +1 -1
- package/dist/twilight/{p-d2c1f52b.entry.js → p-db4dc7cc.entry.js} +1 -1
- package/dist/twilight/{p-57516065.entry.js → p-e0f3e985.entry.js} +1 -1
- package/dist/twilight/{p-36359288.entry.js → p-e354292f.entry.js} +1 -1
- package/dist/twilight/{p-95519dae.entry.js → p-e4db462b.entry.js} +1 -1
- package/dist/twilight/{p-272857bd.entry.js → p-e826d3aa.entry.js} +1 -1
- package/dist/twilight/{p-3286bfc2.entry.js → p-f12f8db3.entry.js} +1 -1
- package/dist/twilight/{p-8f1e13c5.entry.js → p-f99550d8.entry.js} +1 -1
- package/dist/twilight/{p-6cc61a70.entry.js → p-fa0467a7.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/package.json +5 -5
- package/dist/twilight/p-RGVg6FYq.js +0 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as e,H as s,a as l,F as i}from"./p-RGVg6FYq.js";const n=class{constructor(e){t(this,e),this.sections=[],this.itemNumber=""}deleteItem(t,e){const s=this.host.closest("form");if(s){const l=s.getAttribute("id");if(l&&"string"==typeof l){const s=l.match(/item-(\d+)/)?.[1];this.itemNumber=s||"";const i=this.host.querySelector(`#accordion-${e.id}`);salla.cart.deleteItem(`${this.itemNumber}?product_id=${e.id}§ion_id=${t}`).then((()=>i?.remove()))}}}renderRemoveButton(t,s,l=!1){return e("salla-button",{type:"button",shape:l?"btn":"icon",fill:l?"outline":"solid",size:"small",color:"danger","aria-label":"Remove from the cart",onClick:()=>this.deleteItem(t,s)},l?salla.lang.get("common.elements.delete"):e("i",{class:"sicon-cancel"}))}renderAccordionHeader(t,s){const l=s?.options&&s?.options?.length>0;return e("div",{slot:"html",class:"s-multiple-bundle-product-cart-header-wrapper"},e("div",{class:"s-multiple-bundle-product-cart-header "+(l?"":"s-multiple-bundle-product-cart-header-no-options")},e("div",{class:"s-multiple-bundle-product-cart-header-content"},e("a",{href:s?.url,class:"s-multiple-bundle-product-cart-header-image-wrapper"},e("img",{src:s?.image?.url,alt:s?.image?.alt||s?.name,class:"s-multiple-bundle-product-cart-header-image"})),e("div",{class:"s-multiple-bundle-product-cart-header-content-details"},e("h2",{class:"s-multiple-bundle-product-cart-header-content-details-title"},e("a",{href:s?.url,class:"s-multiple-bundle-product-cart-header-content-details-title-link"},s?.name)),e("div",{class:"s-multiple-bundle-product-cart-header-content-details-price"},e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-regular"},e("span",{innerHTML:s?.price?salla.money(s?.price):""})),s?.sale_price>0&&e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-sale"},e("span",{innerHTML:salla.money(s?.sale_price)}))),s?.quantity_in_group>0&&0!==s?.quantity&&e("p",{class:"s-multiple-bundle-product-cart-header-content-details-quantity"},e("span",null,salla.lang.get("pages.products.number_of_pieces")),e("span",null,s?.quantity_in_group)))),!l&&e("div",{class:"s-multiple-bundle-product-cart-header-remove-button"},this.renderRemoveButton(t,s,!1))))}render(){return e(s,{key:"78be7c4a3be811adb01cb1437473fcd9f1c17b41",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"9b0439dffc9a2dd8d31f56dacb5d835cde903e71",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>t.products.map((l=>{const i={sectionId:t.id,sectionIndex:s,productId:l.id};return e("salla-accordion",{key:l.id,collapsed:!1,bordered:!0,collapsible:!!(l.options&&l.options.length>0),size:"sm",id:`accordion-${l.id}`},e("salla-accordion-head",null,this.renderAccordionHeader(String(t.id),l)),l.options&&l.options.length>0&&e("salla-accordion-body",null,e("salla-product-options",{options:JSON.stringify(l.options),key:`${l.id}-persistent`,"product-id":l.id,"bundle-context":JSON.stringify(i)}),e("div",{class:"s-multiple-bundle-product-cart-body-remove-button"},this.renderRemoveButton(String(t.id),l,!0))))}))))))}get host(){return l(this)}};n.style="";const c=class{constructor(e){t(this,e),this.sections=[],this.selectedProducts={},this.productSelectedHandler=null,this.onSelectProduct=(t,e)=>{const s=e.id,l=this.selectedProducts[t]?.has(s)??!1,i=this.sections.find((e=>e.id==t));if(!(l&&i&&this.isProductSelectionLocked(i))){if(!l){if(!i)return;if(1!==this.getEffectiveMax(i)&&this.isAtSelectionLimit(i))return}this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])},l?(this.selectedProducts[t].delete(s),this.clearProductFormData(s,t),this.clearProductModalOptions(s,t)):1===this.getEffectiveMax(i)?this.syncSectionSelection(t,s):this.selectedProducts[t].add(s),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options,wasSelected:l,isSelected:!l})}},this.ensureProductSelected=(t,e)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const s=e.id;if(this.selectedProducts[t].has(s))return;const l=this.sections.find((e=>e.id==t));if(!l)return;const i=this.getEffectiveMax(l);if(1===i)this.syncSectionSelection(t,s);else{if(i>1&&this.isAtSelectionLimit(l))return;this.selectedProducts[t].add(s)}this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options})},this.onSelectProductOptions=(t,e)=>{const s=this.sections.find((t=>t.id==e));if(!s||!this.canSelectProductInSection(s,t.id))return;const l=this.sections.findIndex((t=>t.id==e)),i=s.products?.findIndex((e=>e.id==t.id))??0,n=this.selectedProducts[e]?.has(t.id)??!1;salla.event.dispatch("multiple-bundle-product-modal::open",{product:t,sectionId:e,sectionIndex:l,productIndex:i,isProductAlreadySelected:n})},this.handleBundleSliderProductSelected=t=>{const{product:e,sectionId:s}=t.detail;this.onSelectProduct(s,e)},this.handleBundleSliderProductOptionsSelected=t=>{const{product:e,sectionId:s}=t.detail;this.onSelectProductOptions(e,s)}}isSingleProductSection(t){return 1===(t.products?.length??0)}getObligatoryMin(t){const e=t.obligatory_products;if(null==e)return 0;const s=Number(e);return Number.isNaN(s)?0:s}isProductSelectionLocked(t){return this.isSingleProductSection(t)&&1===this.getObligatoryMin(t)}getEffectiveMax(t){const e=t.products?.length??0,s=t.max_obligatory_products;return null!=s&&s>0?Math.min(s,e):e}getSelectedCount(t){return this.selectedProducts[t]?.size??0}isAtSelectionLimit(t){return this.getSelectedCount(t.id)>=this.getEffectiveMax(t)}canSelectProductInSection(t,e){return!!this.selectedProducts[t.id]?.has(e)||1===this.getEffectiveMax(t)||!this.isAtSelectionLimit(t)}async canSelectBundleProduct(t,e){const s=this.sections.find((e=>e.id==t));return!!s&&this.canSelectProductInSection(s,e)}queryProductCheckbox(t,e){const s=`input.s-multiple-bundle-product-checkbox[name="bundle[${t}][${e}][id]"]`,l=this.host.closest("form"),i=l?.querySelector(s);if(i)return i;for(const t of this.host.querySelectorAll("salla-multiple-bundle-product-slider")){const e=(t.shadowRoot??t).querySelector(s);if(e)return e}return null}dispatchBubblingChange(t){requestAnimationFrame((()=>{t.dispatchEvent(new window.Event("change",{bubbles:!0}))}))}clearSectionProductSlot(t,e,s){const l=this.queryProductCheckbox(t,s);l&&(l.checked=!1);const i=this.host.closest("form");if(i){const e=`bundle[${t}][${s}]`;Array.from(i.querySelectorAll("input")).forEach((t=>{t.name?.startsWith(e)&&("checkbox"===t.type&&t.name?.endsWith("][id]")?t.checked=!1:t.remove())}))}this.clearProductModalOptions(e,t)}syncSectionSelection(t,e){const s=this.sections.find((e=>e.id==t));s?.products?.forEach(((s,l)=>{s.id!=e&&this.clearSectionProductSlot(t,s.id,l)})),this.selectedProducts[t]=new Set([e]);const l=s?.products?.findIndex((t=>t.id==e))??-1,i=l>=0?this.queryProductCheckbox(t,l):null;i&&(i.checked=!0,this.dispatchBubblingChange(i))}autoSelectSingleProductSections(){if(!this.sections?.length)return;const t={...this.selectedProducts};let e=!1;const s=[];for(const l of this.sections){if(!this.isProductSelectionLocked(l))continue;const i=l.products?.[0];if(!i||!i.unlimited_quantity&&(i.quantity??0)<=0)continue;const n=l.id,c=new Set(t[n]||[]);c.has(i.id)||(c.add(i.id),t[n]=c,e=!0,s.push({product:i}))}e&&(this.selectedProducts=t,s.forEach((({product:t})=>{salla.event.dispatch("on-bundle-product-selected",{id:t.id,name:t.name,options:t.options})})))}clearProductFormData(t,e){if(null!=e){const s=this.sections.find((t=>t.id==e)),l=s?.products?.findIndex((e=>e.id==t))??-1;if(l>=0)return void this.clearSectionProductSlot(e,t,l)}const s=this.host.closest("form");s&&s.querySelectorAll(`[data-product-id="${t}"]`).forEach((t=>t.remove()))}clearProductModalOptions(t,e){let s=null,l=null;if(null!=e&&(s=this.sections.findIndex((t=>t.id==e)),s>-1)){const e=this.sections[s];if(e){const s=e.products?.findIndex((e=>e.id==t));l="number"==typeof s&&s>-1?s:null}}salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t,sectionId:e,sectionIndex:s,productIndex:l})}getProgressStatus(t){const e=this.getSelectedCount(t.id),s=this.getEffectiveMax(t);return s>0?`${e}/${s}`:"0"}getSectionSelectionNote(t){const e=this.getObligatoryMin(t),s=Number(t.max_obligatory_products)||0,l=e>0,i=s>0;return l||i?l&&i?e===s?salla.lang.getWithDefault("pages.products.bundle_select_exact",`اختر ${e} منتجات`,{count:e}):salla.lang.getWithDefault("pages.products.bundle_select_range",`اختر من ${e} إلى ${s} منتجات`,{min:e,max:s}):l?salla.lang.getWithDefault("pages.products.bundle_select_min",`اختر على الأقل ${e} منتجات`,{min:e}):salla.lang.getWithDefault("pages.products.bundle_select_max",`اختر حتى ${s} منتجات`,{max:s}):null}handleSectionsChange(){this.autoSelectSingleProductSections()}componentWillLoad(){this.autoSelectSingleProductSections()}renderAccordionHeader(t){const s=this.getSectionSelectionNote(t);return e(i,null,e("h2",{slot:"title"},t?.name),s?e("span",{slot:"note"},s):null,e("span",{slot:"progress"},this.getProgressStatus(t)))}componentDidLoad(){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&(this.productSelectedHandler=t=>{const{productId:e,sectionId:s,product:l,fromModal:i}=t.detail;i?this.ensureProductSelected(s,l||{id:e}):this.onSelectProduct(s,l||{id:e})},t.addEventListener("productSelected",this.productSelectedHandler))}disconnectedCallback(){if(this.productSelectedHandler){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&t.removeEventListener("productSelected",this.productSelectedHandler),this.productSelectedHandler=null}}render(){return e(s,{key:"1ba2cde8fad73b16cfc2ccdd5e68331a9e3fdb7a",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"a72d9fc9f3df30616d3d0696c755db4e76c9a153",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>e("salla-accordion",{key:t.id,collapsed:0!==s},e("salla-accordion-head",null,this.renderAccordionHeader(t)),e("salla-accordion-body",null,e("salla-multiple-bundle-product-slider",{section:t,sectionIndex:s,selectedProducts:this.selectedProducts,selectionLimit:this.getEffectiveMax(t),isSelectionLocked:this.isProductSelectionLocked(t),onProductSelected:this.handleBundleSliderProductSelected,onProductOptionsSelected:this.handleBundleSliderProductOptionsSelected})))))),e("salla-multiple-bundle-product-options-modal",{key:"1e2f996c2d995c62ae29dedc90826a1f1d0a1320"}))}get host(){return l(this)}static get watchers(){return{sections:["handleSectionsChange"]}}};c.style="";export{n as salla_multiple_bundle_product_cart,c as salla_multiple_bundle_product_details}
|
|
4
|
+
import{r as t,h as e,H as s,a as l,F as i}from"./p-B64o_70M.js";const n=class{constructor(e){t(this,e),this.sections=[],this.itemNumber=""}deleteItem(t,e){const s=this.host.closest("form");if(s){const l=s.getAttribute("id");if(l&&"string"==typeof l){const s=l.match(/item-(\d+)/)?.[1];this.itemNumber=s||"";const i=this.host.querySelector(`#accordion-${e.id}`);salla.cart.deleteItem(`${this.itemNumber}?product_id=${e.id}§ion_id=${t}`).then((()=>i?.remove()))}}}renderRemoveButton(t,s,l=!1){return e("salla-button",{type:"button",shape:l?"btn":"icon",fill:l?"outline":"solid",size:"small",color:"danger","aria-label":"Remove from the cart",onClick:()=>this.deleteItem(t,s)},l?salla.lang.get("common.elements.delete"):e("i",{class:"sicon-cancel"}))}renderAccordionHeader(t,s){const l=s?.options&&s?.options?.length>0;return e("div",{slot:"html",class:"s-multiple-bundle-product-cart-header-wrapper"},e("div",{class:"s-multiple-bundle-product-cart-header "+(l?"":"s-multiple-bundle-product-cart-header-no-options")},e("div",{class:"s-multiple-bundle-product-cart-header-content"},e("a",{href:s?.url,class:"s-multiple-bundle-product-cart-header-image-wrapper"},e("img",{src:s?.image?.url,alt:s?.image?.alt||s?.name,class:"s-multiple-bundle-product-cart-header-image"})),e("div",{class:"s-multiple-bundle-product-cart-header-content-details"},e("h2",{class:"s-multiple-bundle-product-cart-header-content-details-title"},e("a",{href:s?.url,class:"s-multiple-bundle-product-cart-header-content-details-title-link"},s?.name)),e("div",{class:"s-multiple-bundle-product-cart-header-content-details-price"},e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-regular"},e("span",{innerHTML:s?.price?salla.money(s?.price):""})),s?.sale_price>0&&e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-sale"},e("span",{innerHTML:salla.money(s?.sale_price)}))),s?.quantity_in_group>0&&0!==s?.quantity&&e("p",{class:"s-multiple-bundle-product-cart-header-content-details-quantity"},e("span",null,salla.lang.get("pages.products.number_of_pieces")),e("span",null,s?.quantity_in_group)))),!l&&e("div",{class:"s-multiple-bundle-product-cart-header-remove-button"},this.renderRemoveButton(t,s,!1))))}render(){return e(s,{key:"78be7c4a3be811adb01cb1437473fcd9f1c17b41",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"9b0439dffc9a2dd8d31f56dacb5d835cde903e71",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>t.products.map((l=>{const i={sectionId:t.id,sectionIndex:s,productId:l.id};return e("salla-accordion",{key:l.id,collapsed:!1,bordered:!0,collapsible:!!(l.options&&l.options.length>0),size:"sm",id:`accordion-${l.id}`},e("salla-accordion-head",null,this.renderAccordionHeader(String(t.id),l)),l.options&&l.options.length>0&&e("salla-accordion-body",null,e("salla-product-options",{options:JSON.stringify(l.options),key:`${l.id}-persistent`,"product-id":l.id,"bundle-context":JSON.stringify(i)}),e("div",{class:"s-multiple-bundle-product-cart-body-remove-button"},this.renderRemoveButton(String(t.id),l,!0))))}))))))}get host(){return l(this)}};n.style="";const c=class{constructor(e){t(this,e),this.sections=[],this.selectedProducts={},this.productSelectedHandler=null,this.onSelectProduct=(t,e)=>{const s=e.id,l=this.selectedProducts[t]?.has(s)??!1,i=this.sections.find((e=>e.id==t));if(!(l&&i&&this.isProductSelectionLocked(i))){if(!l){if(!i)return;if(1!==this.getEffectiveMax(i)&&this.isAtSelectionLimit(i))return}this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])},l?(this.selectedProducts[t].delete(s),this.clearProductFormData(s,t),this.clearProductModalOptions(s,t)):1===this.getEffectiveMax(i)?this.syncSectionSelection(t,s):this.selectedProducts[t].add(s),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options,wasSelected:l,isSelected:!l})}},this.ensureProductSelected=(t,e)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const s=e.id;if(this.selectedProducts[t].has(s))return;const l=this.sections.find((e=>e.id==t));if(!l)return;const i=this.getEffectiveMax(l);if(1===i)this.syncSectionSelection(t,s);else{if(i>1&&this.isAtSelectionLimit(l))return;this.selectedProducts[t].add(s)}this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options})},this.onSelectProductOptions=(t,e)=>{const s=this.sections.find((t=>t.id==e));if(!s||!this.canSelectProductInSection(s,t.id))return;const l=this.sections.findIndex((t=>t.id==e)),i=s.products?.findIndex((e=>e.id==t.id))??0,n=this.selectedProducts[e]?.has(t.id)??!1;salla.event.dispatch("multiple-bundle-product-modal::open",{product:t,sectionId:e,sectionIndex:l,productIndex:i,isProductAlreadySelected:n})},this.handleBundleSliderProductSelected=t=>{const{product:e,sectionId:s}=t.detail;this.onSelectProduct(s,e)},this.handleBundleSliderProductOptionsSelected=t=>{const{product:e,sectionId:s}=t.detail;this.onSelectProductOptions(e,s)}}isSingleProductSection(t){return 1===(t.products?.length??0)}getObligatoryMin(t){const e=t.obligatory_products;if(null==e)return 0;const s=Number(e);return Number.isNaN(s)?0:s}isProductSelectionLocked(t){return this.isSingleProductSection(t)&&1===this.getObligatoryMin(t)}getEffectiveMax(t){const e=t.products?.length??0,s=t.max_obligatory_products;return null!=s&&s>0?Math.min(s,e):e}getSelectedCount(t){return this.selectedProducts[t]?.size??0}isAtSelectionLimit(t){return this.getSelectedCount(t.id)>=this.getEffectiveMax(t)}canSelectProductInSection(t,e){return!!this.selectedProducts[t.id]?.has(e)||1===this.getEffectiveMax(t)||!this.isAtSelectionLimit(t)}async canSelectBundleProduct(t,e){const s=this.sections.find((e=>e.id==t));return!!s&&this.canSelectProductInSection(s,e)}queryProductCheckbox(t,e){const s=`input.s-multiple-bundle-product-checkbox[name="bundle[${t}][${e}][id]"]`,l=this.host.closest("form"),i=l?.querySelector(s);if(i)return i;for(const t of this.host.querySelectorAll("salla-multiple-bundle-product-slider")){const e=(t.shadowRoot??t).querySelector(s);if(e)return e}return null}dispatchBubblingChange(t){requestAnimationFrame((()=>{t.dispatchEvent(new window.Event("change",{bubbles:!0}))}))}clearSectionProductSlot(t,e,s){const l=this.queryProductCheckbox(t,s);l&&(l.checked=!1);const i=this.host.closest("form");if(i){const e=`bundle[${t}][${s}]`;Array.from(i.querySelectorAll("input")).forEach((t=>{t.name?.startsWith(e)&&("checkbox"===t.type&&t.name?.endsWith("][id]")?t.checked=!1:t.remove())}))}this.clearProductModalOptions(e,t)}syncSectionSelection(t,e){const s=this.sections.find((e=>e.id==t));s?.products?.forEach(((s,l)=>{s.id!=e&&this.clearSectionProductSlot(t,s.id,l)})),this.selectedProducts[t]=new Set([e]);const l=s?.products?.findIndex((t=>t.id==e))??-1,i=l>=0?this.queryProductCheckbox(t,l):null;i&&(i.checked=!0,this.dispatchBubblingChange(i))}autoSelectSingleProductSections(){if(!this.sections?.length)return;const t={...this.selectedProducts};let e=!1;const s=[];for(const l of this.sections){if(!this.isProductSelectionLocked(l))continue;const i=l.products?.[0];if(!i||!i.unlimited_quantity&&(i.quantity??0)<=0)continue;const n=l.id,c=new Set(t[n]||[]);c.has(i.id)||(c.add(i.id),t[n]=c,e=!0,s.push({product:i}))}e&&(this.selectedProducts=t,s.forEach((({product:t})=>{salla.event.dispatch("on-bundle-product-selected",{id:t.id,name:t.name,options:t.options})})))}clearProductFormData(t,e){if(null!=e){const s=this.sections.find((t=>t.id==e)),l=s?.products?.findIndex((e=>e.id==t))??-1;if(l>=0)return void this.clearSectionProductSlot(e,t,l)}const s=this.host.closest("form");s&&s.querySelectorAll(`[data-product-id="${t}"]`).forEach((t=>t.remove()))}clearProductModalOptions(t,e){let s=null,l=null;if(null!=e&&(s=this.sections.findIndex((t=>t.id==e)),s>-1)){const e=this.sections[s];if(e){const s=e.products?.findIndex((e=>e.id==t));l="number"==typeof s&&s>-1?s:null}}salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t,sectionId:e,sectionIndex:s,productIndex:l})}getProgressStatus(t){const e=this.getSelectedCount(t.id),s=this.getEffectiveMax(t);return s>0?`${e}/${s}`:"0"}getSectionSelectionNote(t){const e=this.getObligatoryMin(t),s=Number(t.max_obligatory_products)||0,l=e>0,i=s>0;return l||i?l&&i?e===s?salla.lang.getWithDefault("pages.products.bundle_select_exact",`اختر ${e} منتجات`,{count:e}):salla.lang.getWithDefault("pages.products.bundle_select_range",`اختر من ${e} إلى ${s} منتجات`,{min:e,max:s}):l?salla.lang.getWithDefault("pages.products.bundle_select_min",`اختر على الأقل ${e} منتجات`,{min:e}):salla.lang.getWithDefault("pages.products.bundle_select_max",`اختر حتى ${s} منتجات`,{max:s}):null}handleSectionsChange(){this.autoSelectSingleProductSections()}componentWillLoad(){this.autoSelectSingleProductSections()}renderAccordionHeader(t){const s=this.getSectionSelectionNote(t);return e(i,null,e("h2",{slot:"title"},t?.name),s?e("span",{slot:"note"},s):null,e("span",{slot:"progress"},this.getProgressStatus(t)))}componentDidLoad(){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&(this.productSelectedHandler=t=>{const{productId:e,sectionId:s,product:l,fromModal:i}=t.detail;i?this.ensureProductSelected(s,l||{id:e}):this.onSelectProduct(s,l||{id:e})},t.addEventListener("productSelected",this.productSelectedHandler))}disconnectedCallback(){if(this.productSelectedHandler){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&t.removeEventListener("productSelected",this.productSelectedHandler),this.productSelectedHandler=null}}render(){return e(s,{key:"1ba2cde8fad73b16cfc2ccdd5e68331a9e3fdb7a",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"a72d9fc9f3df30616d3d0696c755db4e76c9a153",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>e("salla-accordion",{key:t.id,collapsed:0!==s},e("salla-accordion-head",null,this.renderAccordionHeader(t)),e("salla-accordion-body",null,e("salla-multiple-bundle-product-slider",{section:t,sectionIndex:s,selectedProducts:this.selectedProducts,selectionLimit:this.getEffectiveMax(t),isSelectionLocked:this.isProductSelectionLocked(t),onProductSelected:this.handleBundleSliderProductSelected,onProductOptionsSelected:this.handleBundleSliderProductOptionsSelected})))))),e("salla-multiple-bundle-product-options-modal",{key:"1e2f996c2d995c62ae29dedc90826a1f1d0a1320"}))}get host(){return l(this)}static get watchers(){return{sections:["handleSectionsChange"]}}};c.style="";export{n as salla_multiple_bundle_product_cart,c as salla_multiple_bundle_product_details}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as c,h as l,H as t,a as s}from"./p-RGVg6FYq.js";import{f as i,t as e}from"./p-CO-PeZ27.js";const a=class{constructor(l){c(this,l),this.links=salla.config.get("store.social"),this.iconsList={instagram:'\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>instagram</title>\n<path d="M23 32h-14c-4.971 0-9-4.029-9-9v0-14c0-4.971 4.029-9 9-9v0h14c4.971 0 9 4.029 9 9v0 14c0 4.971-4.029 9-9 9v0zM9 2c-3.866 0-7 3.134-7 7v0 14c0 3.866 3.134 7 7 7v0h14c3.866 0 7-3.134 7-7v0-14c0-3.866-3.134-7-7-7v0zM16 24c-4.418 0-8-3.582-8-8s3.582-8 8-8c4.418 0 8 3.582 8 8v0c0 4.418-3.582 8-8 8v0zM16 10c-3.314 0-6 2.686-6 6s2.686 6 6 6c3.314 0 6-2.686 6-6v0c0-3.314-2.686-6-6-6v0zM25 9c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2v0c0 1.105-0.895 2-2 2v0zM25 7v0z"></path>\n</svg>\n',twitter:e,facebook:i,youtube:'\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>youtube</title>\n<path d="M16 28c-3.666 0-8.376-0.056-10.29-0.162-0.113 0.010-0.244 0.016-0.376 0.016-1.676 0-3.139-0.91-3.922-2.264l-0.012-0.022c-0.97-1.6-1.4-4.248-1.4-8.558s0.436-6.962 1.412-8.6c0.782-1.36 2.227-2.262 3.883-2.262 0.148 0 0.293 0.007 0.437 0.021l-0.018-0.001c1.872-0.124 6.544-0.168 10.286-0.168s8.4 0.044 10.292 0.168c0.124-0.012 0.267-0.019 0.412-0.019 1.656 0 3.101 0.905 3.866 2.247l0.012 0.022c0.982 1.624 1.418 4.27 1.418 8.582 0 4.338-0.438 6.982-1.422 8.6-0.789 1.364-2.241 2.268-3.904 2.268-0.133 0-0.265-0.006-0.395-0.017l0.017 0.001c-1.926 0.092-6.632 0.148-10.296 0.148zM16 8c-3.712 0-8.334 0.042-10.168 0.164-1.688 0.094-2.14 0.306-2.702 1.268-0.756 1.81-1.195 3.913-1.195 6.119 0 0.51 0.024 1.015 0.069 1.513l-0.005-0.064c-0.042 0.435-0.065 0.941-0.065 1.453 0 2.198 0.438 4.294 1.231 6.205l-0.039-0.107c0.566 0.968 1.022 1.184 2.708 1.296 3.29 0.184 17.022 0.184 20.34 0 1.678-0.11 2.132-0.326 2.684-1.28 0.764-1.803 1.208-3.899 1.208-6.1 0-0.513-0.024-1.020-0.071-1.52l0.005 0.064c0.042-0.436 0.065-0.943 0.065-1.455 0-2.203-0.439-4.303-1.235-6.218l0.040 0.107v-0.016c-0.554-0.958-1-1.17-2.684-1.264-1.862-0.122-6.644-0.164-10.186-0.164zM13 23c-0.552 0-1-0.448-1-1v0-10c0 0 0 0 0 0 0-0.552 0.448-1 1-1 0.196 0 0.38 0.057 0.534 0.154l-0.004-0.002 8 5c0.284 0.18 0.47 0.492 0.47 0.848s-0.186 0.668-0.466 0.846l-0.004 0.002-8 5c-0.15 0.095-0.334 0.152-0.53 0.152 0 0 0 0 0 0v0zM14 13.8v6.4l5.114-3.2z"></path>\n</svg>\n',snapchat:'\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>snapchat</title>\n<path d="M16.186 30h-0.266c-1.843-0.023-3.525-0.693-4.834-1.792l0.012 0.010c-0.476-0.405-1.043-0.72-1.665-0.909l-0.033-0.009c-0.287-0.044-0.617-0.069-0.954-0.069-0.492 0-0.972 0.053-1.434 0.155l0.044-0.008c-0.261 0.061-0.564 0.102-0.875 0.114l-0.009 0c-0.017 0.001-0.036 0.001-0.056 0.001-0.811 0-1.495-0.545-1.705-1.288l-0.003-0.012c-0.076-0.26-0.132-0.506-0.186-0.746-0.961-0.157-1.822-0.412-2.633-0.76l0.073 0.028c-0.667-0.259-1.199-0.745-1.509-1.362l-0.007-0.016c-0.082-0.189-0.135-0.409-0.146-0.64l-0-0.004c-0.002-0.031-0.003-0.067-0.003-0.103 0-0.841 0.614-1.538 1.417-1.668l0.010-0.001c0.822-0.141 1.555-0.438 2.198-0.859l-0.022 0.013c0.611-0.405 1.138-0.872 1.591-1.404l0.009-0.010c0.526-0.595 0.98-1.273 1.337-2.007l0.023-0.053c0.060-0.102 0.107-0.22 0.135-0.346l0.001-0.008c-0.092-0.020-0.73-0.222-0.972-0.298s-0.374-0.12-0.506-0.17c-0.546-0.205-1.016-0.487-1.424-0.839l0.006 0.005c-0.471-0.388-0.768-0.971-0.768-1.624 0-0.126 0.011-0.249 0.032-0.369l-0.002 0.013c0.143-0.644 0.551-1.172 1.1-1.474l0.011-0.006c0.389-0.241 0.861-0.384 1.366-0.384 0.347 0 0.678 0.067 0.982 0.19l-0.018-0.006c0.128 0.060 0.242 0.106 0.344 0.142-0.082-0.573-0.129-1.235-0.129-1.908 0-1.482 0.227-2.91 0.648-4.253l-0.027 0.101c0.512-1.142 1.207-2.114 2.056-2.925l0.004-0.003c0.7-0.664 1.516-1.214 2.413-1.616l0.055-0.022c1.128-0.5 2.444-0.794 3.828-0.8h0.592c1.386 0.007 2.701 0.301 3.893 0.825l-0.063-0.025c0.956 0.42 1.777 0.967 2.485 1.632l-0.005-0.004c0.855 0.815 1.55 1.789 2.039 2.876l0.023 0.058c0.396 1.237 0.625 2.659 0.625 4.135 0 0.658-0.045 1.304-0.133 1.938l0.008-0.073 0.172-0.076c0.303-0.16 0.661-0.253 1.042-0.253 0.374 0 0.728 0.091 1.039 0.251l-0.013-0.006c0.886 0.274 1.528 1.063 1.582 2.008l0 0.006c-0.001 0.602-0.25 1.146-0.65 1.536l-0 0c-0.429 0.408-0.945 0.73-1.516 0.935l-0.030 0.009c-0.144 0.056-0.316 0.112-0.504 0.17-0.367 0.103-0.686 0.235-0.984 0.398l0.024-0.012c0.018 0.030 0.042 0.094 0.086 0.18 0.963 2.174 2.834 3.796 5.118 4.4l0.054 0.012c0.814 0.133 1.427 0.83 1.427 1.671 0 0.036-0.001 0.072-0.003 0.108l0-0.005c-0.012 0.241-0.070 0.465-0.165 0.669l0.005-0.011c-0.319 0.624-0.847 1.103-1.489 1.352l-0.019 0.006c-0.739 0.323-1.6 0.578-2.497 0.724l-0.063 0.008c-0.056 0.264-0.112 0.496-0.186 0.742-0.215 0.747-0.893 1.284-1.696 1.284-0.011 0-0.021-0-0.032-0l0.002 0c-0.328-0.004-0.644-0.042-0.949-0.11l0.031 0.006c-0.404-0.090-0.869-0.142-1.345-0.142-0.353 0-0.7 0.029-1.038 0.083l0.037-0.005c-0.653 0.195-1.218 0.508-1.699 0.917l0.007-0.005c-1.275 1.065-2.916 1.731-4.71 1.788l-0.012 0zM8.444 25.218c0.457 0.001 0.904 0.041 1.339 0.117l-0.047-0.007c0.966 0.232 1.808 0.664 2.516 1.252l-0.010-0.008c0.96 0.829 2.199 1.357 3.56 1.427l0.014 0.001h0.37c1.373-0.070 2.61-0.597 3.576-1.43l-0.008 0.006c0.701-0.583 1.546-1.016 2.474-1.239l0.042-0.009c0.394-0.063 0.849-0.1 1.312-0.1 0.615 0 1.216 0.064 1.795 0.186l-0.057-0.010c0.105 0.023 0.238 0.045 0.372 0.059l0.016 0.001c0.042-0.162 0.076-0.314 0.11-0.47 0.059-0.339 0.156-0.641 0.287-0.924l-0.009 0.023 0.234-0.44 0.492-0.078c0.99-0.119 1.892-0.359 2.738-0.705l-0.070 0.025c0.086-0.040 0.158-0.076 0.216-0.11-2.748-0.86-4.933-2.816-6.081-5.342l-0.025-0.062c-0.184-0.31-0.294-0.684-0.294-1.083 0-0.27 0.050-0.528 0.14-0.765l-0.005 0.015c0.492-0.783 1.284-1.339 2.212-1.507l0.020-0.003c0.14-0.044 0.27-0.084 0.376-0.126 0.327-0.108 0.609-0.272 0.849-0.482l-0.003 0.002c0.074-0.106 0-0.2-0.216-0.284-0.094-0.041-0.203-0.065-0.318-0.066h-0c-0.529 0.242-1.142 0.411-1.786 0.474l-0.024 0.002c-0.313-0-0.612-0.064-0.883-0.18l0.015 0.006-0.628-0.28 0.072-1.272c0.093-0.623 0.146-1.342 0.146-2.074 0-1.269-0.16-2.501-0.46-3.677l0.022 0.103c-0.396-0.896-0.936-1.659-1.598-2.296l-0.002-0.002c-0.541-0.508-1.172-0.928-1.865-1.233l-0.043-0.017c-0.895-0.396-1.939-0.629-3.036-0.634h-0.002l-0.218-1v1h-0.348c-1.105 0.003-2.155 0.237-3.106 0.656l0.050-0.020c-0.733 0.322-1.361 0.742-1.903 1.253l0.003-0.003c-0.663 0.638-1.203 1.398-1.582 2.247l-0.018 0.045c-0.279 1.065-0.44 2.287-0.44 3.547 0 0.704 0.050 1.395 0.147 2.072l-0.009-0.078 0.080 1.372-0.618 0.284c-0.31 0.108-0.666 0.17-1.038 0.17-0.6 0-1.163-0.163-1.645-0.446l0.015 0.008c-0.019-0.001-0.041-0.002-0.064-0.002-0.154 0-0.299 0.039-0.425 0.109l0.005-0.002c-0.063 0.032-0.115 0.078-0.153 0.135l-0.001 0.001c0.258 0.244 0.567 0.435 0.91 0.556l0.018 0.006c0.094 0.036 0.2 0.070 0.32 0.108 0.971 0.167 1.784 0.732 2.282 1.516l0.008 0.014c0.087 0.225 0.137 0.486 0.137 0.758 0 0.403-0.11 0.781-0.303 1.104l0.005-0.010c-0.459 0.983-1.016 1.829-1.677 2.582l0.011-0.012c-0.588 0.687-1.26 1.279-2.004 1.768l-0.036 0.022c-0.689 0.451-1.49 0.805-2.346 1.017l-0.054 0.011c0.060 0.034 0.132 0.072 0.218 0.112 0.776 0.322 1.678 0.561 2.618 0.675l0.050 0.005 0.498 0.078 0.234 0.446c0.116 0.255 0.209 0.553 0.265 0.863l0.003 0.023c0.038 0.164 0.072 0.328 0.118 0.496 0.12-0.014 0.242-0.042 0.378-0.068 0.528-0.12 1.138-0.192 1.762-0.2l0.006-0zM30.244 22.892v0z"></path>\n</svg>\n',tiktok:'\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>tiktok</title>\n<path d="M29.046 7.029c-3.359 0-6.092-2.733-6.092-6.092 0-0.518-0.42-0.938-0.938-0.938h-5.021c-0.518 0-0.938 0.42-0.938 0.938v20.585c0 1.975-1.606 3.581-3.581 3.581s-3.581-1.606-3.581-3.581c0-1.975 1.606-3.581 3.581-3.581 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938-5.777 0-10.477 4.7-10.477 10.477s4.7 10.477 10.477 10.477c5.777 0 10.477-4.7 10.477-10.477v-9.112c1.866 0.995 3.942 1.514 6.092 1.514 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938zM28.108 12.011c-2.001-0.166-3.902-0.866-5.544-2.047-0.285-0.206-0.662-0.234-0.975-0.073s-0.51 0.482-0.51 0.834v10.798c0 4.743-3.859 8.602-8.602 8.602s-8.602-3.859-8.602-8.602c0-4.427 3.361-8.083 7.665-8.552v3.176c-2.563 0.446-4.519 2.687-4.519 5.376 0 3.009 2.447 5.456 5.456 5.456s5.456-2.448 5.456-5.456v-19.648h3.201c0.429 3.645 3.329 6.545 6.974 6.974z"></path>\n</svg>\n'},this.socialSlot=this.host.querySelector('[slot="social-item"]')?.innerHTML||'<a href={link} rel="noopener" target="_blank" title={type} aria-label={type}><span class="s-social-icon">{icon}</span></a>',salla.lang.onLoaded((()=>{this.links=salla.config.get("store.social")}))}getLinksArray(){return this.links?Object.entries(this.links).filter((([c,l])=>!!l&&"whatsapp"!==c)).map((([c,l])=>({type:c,value:l}))):[]}componentWillLoad(){return new Promise((c=>salla.onReady(c)))}render(){const c=this.getLinksArray();return l(t,{key:"e7d69dbae46ef54588471875ada751103d14d393"},l("ul",{key:"ff4b15127e6664cca17fa7f6f49e4cda25829d74",class:"s-social-list"},c.map((c=>l("li",{class:"s-social-link"},l("div",{id:"social-slot",innerHTML:this.socialSlot.replace(/\{icon\}/g,this.iconsList[c.type]).replace(/\{type\}/g,c.type).replace(/\{link\}/g,c.value.toString())}))))))}componentDidRender(){this.host.querySelectorAll("#social-slot").forEach((c=>c.replaceWith(c.firstChild))),this.host.querySelector('[slot="social-item"]')?.remove()}get host(){return s(this)}};a.style="/*!twlt*/:host{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-social-list{display:flex;gap:0.625rem}.s-social-link a{display:flex;height:2rem;width:2rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;font-size:0.875rem;line-height:1.25rem;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}.s-social-link a:hover{opacity:0.75}.s-social-link a svg{height:0.875rem;width:0.875rem;fill:currentColor}";export{a as salla_social}
|
|
4
|
+
import{r as c,h as l,H as t,a as s}from"./p-B64o_70M.js";import{f as i,t as e}from"./p-CO-PeZ27.js";const o=class{constructor(l){c(this,l),this.links=salla.config.get("store.social"),this.iconsList={instagram:'\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>instagram</title>\n<path d="M23 32h-14c-4.971 0-9-4.029-9-9v0-14c0-4.971 4.029-9 9-9v0h14c4.971 0 9 4.029 9 9v0 14c0 4.971-4.029 9-9 9v0zM9 2c-3.866 0-7 3.134-7 7v0 14c0 3.866 3.134 7 7 7v0h14c3.866 0 7-3.134 7-7v0-14c0-3.866-3.134-7-7-7v0zM16 24c-4.418 0-8-3.582-8-8s3.582-8 8-8c4.418 0 8 3.582 8 8v0c0 4.418-3.582 8-8 8v0zM16 10c-3.314 0-6 2.686-6 6s2.686 6 6 6c3.314 0 6-2.686 6-6v0c0-3.314-2.686-6-6-6v0zM25 9c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2v0c0 1.105-0.895 2-2 2v0zM25 7v0z"></path>\n</svg>\n',twitter:e,facebook:i,youtube:'\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>youtube</title>\n<path d="M16 28c-3.666 0-8.376-0.056-10.29-0.162-0.113 0.010-0.244 0.016-0.376 0.016-1.676 0-3.139-0.91-3.922-2.264l-0.012-0.022c-0.97-1.6-1.4-4.248-1.4-8.558s0.436-6.962 1.412-8.6c0.782-1.36 2.227-2.262 3.883-2.262 0.148 0 0.293 0.007 0.437 0.021l-0.018-0.001c1.872-0.124 6.544-0.168 10.286-0.168s8.4 0.044 10.292 0.168c0.124-0.012 0.267-0.019 0.412-0.019 1.656 0 3.101 0.905 3.866 2.247l0.012 0.022c0.982 1.624 1.418 4.27 1.418 8.582 0 4.338-0.438 6.982-1.422 8.6-0.789 1.364-2.241 2.268-3.904 2.268-0.133 0-0.265-0.006-0.395-0.017l0.017 0.001c-1.926 0.092-6.632 0.148-10.296 0.148zM16 8c-3.712 0-8.334 0.042-10.168 0.164-1.688 0.094-2.14 0.306-2.702 1.268-0.756 1.81-1.195 3.913-1.195 6.119 0 0.51 0.024 1.015 0.069 1.513l-0.005-0.064c-0.042 0.435-0.065 0.941-0.065 1.453 0 2.198 0.438 4.294 1.231 6.205l-0.039-0.107c0.566 0.968 1.022 1.184 2.708 1.296 3.29 0.184 17.022 0.184 20.34 0 1.678-0.11 2.132-0.326 2.684-1.28 0.764-1.803 1.208-3.899 1.208-6.1 0-0.513-0.024-1.020-0.071-1.52l0.005 0.064c0.042-0.436 0.065-0.943 0.065-1.455 0-2.203-0.439-4.303-1.235-6.218l0.040 0.107v-0.016c-0.554-0.958-1-1.17-2.684-1.264-1.862-0.122-6.644-0.164-10.186-0.164zM13 23c-0.552 0-1-0.448-1-1v0-10c0 0 0 0 0 0 0-0.552 0.448-1 1-1 0.196 0 0.38 0.057 0.534 0.154l-0.004-0.002 8 5c0.284 0.18 0.47 0.492 0.47 0.848s-0.186 0.668-0.466 0.846l-0.004 0.002-8 5c-0.15 0.095-0.334 0.152-0.53 0.152 0 0 0 0 0 0v0zM14 13.8v6.4l5.114-3.2z"></path>\n</svg>\n',snapchat:'\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>snapchat</title>\n<path d="M16.186 30h-0.266c-1.843-0.023-3.525-0.693-4.834-1.792l0.012 0.010c-0.476-0.405-1.043-0.72-1.665-0.909l-0.033-0.009c-0.287-0.044-0.617-0.069-0.954-0.069-0.492 0-0.972 0.053-1.434 0.155l0.044-0.008c-0.261 0.061-0.564 0.102-0.875 0.114l-0.009 0c-0.017 0.001-0.036 0.001-0.056 0.001-0.811 0-1.495-0.545-1.705-1.288l-0.003-0.012c-0.076-0.26-0.132-0.506-0.186-0.746-0.961-0.157-1.822-0.412-2.633-0.76l0.073 0.028c-0.667-0.259-1.199-0.745-1.509-1.362l-0.007-0.016c-0.082-0.189-0.135-0.409-0.146-0.64l-0-0.004c-0.002-0.031-0.003-0.067-0.003-0.103 0-0.841 0.614-1.538 1.417-1.668l0.010-0.001c0.822-0.141 1.555-0.438 2.198-0.859l-0.022 0.013c0.611-0.405 1.138-0.872 1.591-1.404l0.009-0.010c0.526-0.595 0.98-1.273 1.337-2.007l0.023-0.053c0.060-0.102 0.107-0.22 0.135-0.346l0.001-0.008c-0.092-0.020-0.73-0.222-0.972-0.298s-0.374-0.12-0.506-0.17c-0.546-0.205-1.016-0.487-1.424-0.839l0.006 0.005c-0.471-0.388-0.768-0.971-0.768-1.624 0-0.126 0.011-0.249 0.032-0.369l-0.002 0.013c0.143-0.644 0.551-1.172 1.1-1.474l0.011-0.006c0.389-0.241 0.861-0.384 1.366-0.384 0.347 0 0.678 0.067 0.982 0.19l-0.018-0.006c0.128 0.060 0.242 0.106 0.344 0.142-0.082-0.573-0.129-1.235-0.129-1.908 0-1.482 0.227-2.91 0.648-4.253l-0.027 0.101c0.512-1.142 1.207-2.114 2.056-2.925l0.004-0.003c0.7-0.664 1.516-1.214 2.413-1.616l0.055-0.022c1.128-0.5 2.444-0.794 3.828-0.8h0.592c1.386 0.007 2.701 0.301 3.893 0.825l-0.063-0.025c0.956 0.42 1.777 0.967 2.485 1.632l-0.005-0.004c0.855 0.815 1.55 1.789 2.039 2.876l0.023 0.058c0.396 1.237 0.625 2.659 0.625 4.135 0 0.658-0.045 1.304-0.133 1.938l0.008-0.073 0.172-0.076c0.303-0.16 0.661-0.253 1.042-0.253 0.374 0 0.728 0.091 1.039 0.251l-0.013-0.006c0.886 0.274 1.528 1.063 1.582 2.008l0 0.006c-0.001 0.602-0.25 1.146-0.65 1.536l-0 0c-0.429 0.408-0.945 0.73-1.516 0.935l-0.030 0.009c-0.144 0.056-0.316 0.112-0.504 0.17-0.367 0.103-0.686 0.235-0.984 0.398l0.024-0.012c0.018 0.030 0.042 0.094 0.086 0.18 0.963 2.174 2.834 3.796 5.118 4.4l0.054 0.012c0.814 0.133 1.427 0.83 1.427 1.671 0 0.036-0.001 0.072-0.003 0.108l0-0.005c-0.012 0.241-0.070 0.465-0.165 0.669l0.005-0.011c-0.319 0.624-0.847 1.103-1.489 1.352l-0.019 0.006c-0.739 0.323-1.6 0.578-2.497 0.724l-0.063 0.008c-0.056 0.264-0.112 0.496-0.186 0.742-0.215 0.747-0.893 1.284-1.696 1.284-0.011 0-0.021-0-0.032-0l0.002 0c-0.328-0.004-0.644-0.042-0.949-0.11l0.031 0.006c-0.404-0.090-0.869-0.142-1.345-0.142-0.353 0-0.7 0.029-1.038 0.083l0.037-0.005c-0.653 0.195-1.218 0.508-1.699 0.917l0.007-0.005c-1.275 1.065-2.916 1.731-4.71 1.788l-0.012 0zM8.444 25.218c0.457 0.001 0.904 0.041 1.339 0.117l-0.047-0.007c0.966 0.232 1.808 0.664 2.516 1.252l-0.010-0.008c0.96 0.829 2.199 1.357 3.56 1.427l0.014 0.001h0.37c1.373-0.070 2.61-0.597 3.576-1.43l-0.008 0.006c0.701-0.583 1.546-1.016 2.474-1.239l0.042-0.009c0.394-0.063 0.849-0.1 1.312-0.1 0.615 0 1.216 0.064 1.795 0.186l-0.057-0.010c0.105 0.023 0.238 0.045 0.372 0.059l0.016 0.001c0.042-0.162 0.076-0.314 0.11-0.47 0.059-0.339 0.156-0.641 0.287-0.924l-0.009 0.023 0.234-0.44 0.492-0.078c0.99-0.119 1.892-0.359 2.738-0.705l-0.070 0.025c0.086-0.040 0.158-0.076 0.216-0.11-2.748-0.86-4.933-2.816-6.081-5.342l-0.025-0.062c-0.184-0.31-0.294-0.684-0.294-1.083 0-0.27 0.050-0.528 0.14-0.765l-0.005 0.015c0.492-0.783 1.284-1.339 2.212-1.507l0.020-0.003c0.14-0.044 0.27-0.084 0.376-0.126 0.327-0.108 0.609-0.272 0.849-0.482l-0.003 0.002c0.074-0.106 0-0.2-0.216-0.284-0.094-0.041-0.203-0.065-0.318-0.066h-0c-0.529 0.242-1.142 0.411-1.786 0.474l-0.024 0.002c-0.313-0-0.612-0.064-0.883-0.18l0.015 0.006-0.628-0.28 0.072-1.272c0.093-0.623 0.146-1.342 0.146-2.074 0-1.269-0.16-2.501-0.46-3.677l0.022 0.103c-0.396-0.896-0.936-1.659-1.598-2.296l-0.002-0.002c-0.541-0.508-1.172-0.928-1.865-1.233l-0.043-0.017c-0.895-0.396-1.939-0.629-3.036-0.634h-0.002l-0.218-1v1h-0.348c-1.105 0.003-2.155 0.237-3.106 0.656l0.050-0.020c-0.733 0.322-1.361 0.742-1.903 1.253l0.003-0.003c-0.663 0.638-1.203 1.398-1.582 2.247l-0.018 0.045c-0.279 1.065-0.44 2.287-0.44 3.547 0 0.704 0.050 1.395 0.147 2.072l-0.009-0.078 0.080 1.372-0.618 0.284c-0.31 0.108-0.666 0.17-1.038 0.17-0.6 0-1.163-0.163-1.645-0.446l0.015 0.008c-0.019-0.001-0.041-0.002-0.064-0.002-0.154 0-0.299 0.039-0.425 0.109l0.005-0.002c-0.063 0.032-0.115 0.078-0.153 0.135l-0.001 0.001c0.258 0.244 0.567 0.435 0.91 0.556l0.018 0.006c0.094 0.036 0.2 0.070 0.32 0.108 0.971 0.167 1.784 0.732 2.282 1.516l0.008 0.014c0.087 0.225 0.137 0.486 0.137 0.758 0 0.403-0.11 0.781-0.303 1.104l0.005-0.010c-0.459 0.983-1.016 1.829-1.677 2.582l0.011-0.012c-0.588 0.687-1.26 1.279-2.004 1.768l-0.036 0.022c-0.689 0.451-1.49 0.805-2.346 1.017l-0.054 0.011c0.060 0.034 0.132 0.072 0.218 0.112 0.776 0.322 1.678 0.561 2.618 0.675l0.050 0.005 0.498 0.078 0.234 0.446c0.116 0.255 0.209 0.553 0.265 0.863l0.003 0.023c0.038 0.164 0.072 0.328 0.118 0.496 0.12-0.014 0.242-0.042 0.378-0.068 0.528-0.12 1.138-0.192 1.762-0.2l0.006-0zM30.244 22.892v0z"></path>\n</svg>\n',tiktok:'\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>tiktok</title>\n<path d="M29.046 7.029c-3.359 0-6.092-2.733-6.092-6.092 0-0.518-0.42-0.938-0.938-0.938h-5.021c-0.518 0-0.938 0.42-0.938 0.938v20.585c0 1.975-1.606 3.581-3.581 3.581s-3.581-1.606-3.581-3.581c0-1.975 1.606-3.581 3.581-3.581 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938-5.777 0-10.477 4.7-10.477 10.477s4.7 10.477 10.477 10.477c5.777 0 10.477-4.7 10.477-10.477v-9.112c1.866 0.995 3.942 1.514 6.092 1.514 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938zM28.108 12.011c-2.001-0.166-3.902-0.866-5.544-2.047-0.285-0.206-0.662-0.234-0.975-0.073s-0.51 0.482-0.51 0.834v10.798c0 4.743-3.859 8.602-8.602 8.602s-8.602-3.859-8.602-8.602c0-4.427 3.361-8.083 7.665-8.552v3.176c-2.563 0.446-4.519 2.687-4.519 5.376 0 3.009 2.447 5.456 5.456 5.456s5.456-2.448 5.456-5.456v-19.648h3.201c0.429 3.645 3.329 6.545 6.974 6.974z"></path>\n</svg>\n'},this.socialSlot=this.host.querySelector('[slot="social-item"]')?.innerHTML||'<a href={link} rel="noopener" target="_blank" title={type} aria-label={type}><span class="s-social-icon">{icon}</span></a>',salla.lang.onLoaded((()=>{this.links=salla.config.get("store.social")}))}getLinksArray(){return this.links?Object.entries(this.links).filter((([c,l])=>!!l&&"whatsapp"!==c)).map((([c,l])=>({type:c,value:l}))):[]}componentWillLoad(){return new Promise((c=>salla.onReady(c)))}render(){const c=this.getLinksArray();return l(t,{key:"e7d69dbae46ef54588471875ada751103d14d393"},l("ul",{key:"ff4b15127e6664cca17fa7f6f49e4cda25829d74",class:"s-social-list"},c.map((c=>l("li",{class:"s-social-link"},l("div",{id:"social-slot",innerHTML:this.socialSlot.replace(/\{icon\}/g,this.iconsList[c.type]).replace(/\{type\}/g,c.type).replace(/\{link\}/g,c.value.toString())}))))))}componentDidRender(){this.host.querySelectorAll("#social-slot").forEach((c=>c.replaceWith(c.firstChild))),this.host.querySelector('[slot="social-item"]')?.remove()}get host(){return s(this)}};o.style="/*!twlt*/:host{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-social-list{display:flex;gap:0.625rem}.s-social-link a{display:flex;height:2rem;width:2rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;font-size:0.875rem;line-height:1.25rem;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}.s-social-link a:hover{opacity:0.75}.s-social-link a svg{height:0.875rem;width:0.875rem;fill:currentColor}";export{o as salla_social}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as i}from"./p-RGVg6FYq.js";import{a as e}from"./p-CgtvEd63.js";import{a as s}from"./p-BedNk7k1.js";import{C as r}from"./p-BsLF_HK7.js";import{G as a}from"./p-DxkgAGoT.js";const o=class{constructor(i){t(this,i),this.defaultEvent="gifting:open",this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_for_your_gift"),this.currentStep=1,this.showCalendar=!1,this.showGiftText=!1,this.currentLang="",this.parentClass="is-current-step-1",this.errors={},this.gift=void 0,this.selectedGiftTextOption=void 0,this.selectedCountryId=void 0,this.selectedCountryCode=void 0,this.loadingCities=!1,this.loadingRegions=!1,this.regions=[],this.selectedRegionId=void 0,this.isKSA=!1,this.selectedCountry=null,this.selectedRegion=null,this.displayedCities=[],this.selectedCity=null,this.searchingCities=!1,this.enableCityAjaxSearch=!1,this.citySearchQuery="",this.step2Animated=!1,this.citySearchTimer=null,this.citySearchCounter=0,this.locationRequestCounter=0,this.showTextArea=!1,this.selectedImage=void 0,this.uploadedImage=void 0,this.selectedText=void 0,this.hasError=!1,this.timeZone=null,this.receiverCountryCode=salla.config.get("store.scope.countries")?.[0]||salla.config.get("store.store_country")||"SA",this.hostId=`salla-gifting-${Math.random().toString(36).slice(2,10)}`,this.disableClass=this.gift?.show_image_upload?"":"pointer-events-none",this.formSelector="form.product-form, form.form--product-options",this.handleCitySearch=t=>{if(this.citySearchQuery=t,!this.enableCityAjaxSearch)return;this.citySearchTimer&&clearTimeout(this.citySearchTimer);const i=++this.citySearchCounter;this.citySearchTimer=setTimeout((async()=>{this.searchingCities=!0;try{const e=await this.fetchCities(t);i===this.citySearchCounter&&(this.displayedCities=e)}catch(t){i===this.citySearchCounter&&(this.displayedCities=[])}finally{i===this.citySearchCounter&&(this.searchingCities=!1)}}),o.CITY_SEARCH_DEBOUNCE_MS)},this.handleCitySelected=t=>{this.selectedCity=t,this.receiverCity=String(t.id),this.clearError("receiver.city_id")},this.handleCityDropdownClosed=()=>{this.citySearchQuery="",this.citySearchTimer&&(clearTimeout(this.citySearchTimer),this.citySearchTimer=null),++this.citySearchCounter,this.displayedCities=this.gift?.cities??[],this.searchingCities=!1},this.handleCountryDropdownClosed=()=>{},this.handleRegionDropdownClosed=()=>{},salla.lang.onLoaded((()=>{this.selectImageOrUpload=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_for_your_gift"),this.sectionTitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love"),this.sectionSubtitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love_message"),this.sectionBtnText=salla.lang.get("blocks.buy_as_gift.send_as_a_gift"),this.giftDetails=salla.lang.get("blocks.buy_as_gift.gift_details"),this.selectGiftMessage=salla.lang.get("blocks.buy_as_gift.select_gift_message"),this.giftText=salla.lang.get("blocks.buy_as_gift.gift_text"),this.giftCustomText=salla.lang.get("blocks.buy_as_gift.gift_custom_text"),this.textId=salla.lang.get("blocks.buy_as_gift.text_id"),this.incorrectGiftText=salla.lang.get("blocks.buy_as_gift.incorrect_gift_text"),this.nextStep=salla.lang.get("blocks.buy_as_gift.next_step"),this.senderNameLabel=salla.lang.get("blocks.buy_as_gift.sender_name"),this.receiverNameFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_name"),this.receiverMobileFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_mobile"),this.receiverCountryFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_country"),this.ksa=salla.lang.get("pages.checkout.ksa"),this.selectCity=salla.lang.get("pages.checkout.select_city"),this.selectCountry=salla.lang.get("pages.checkout.select_country"),this.selectCityInfo=salla.lang.get("blocks.buy_as_gift.city_info"),this.cityChangeNotice=salla.lang.get("blocks.buy_as_gift.city_change_notice"),this.receiverCityFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_city"),this.receiverRegionFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_region")||salla.lang.get("pages.checkout.region"),this.selectRegion=salla.lang.get("pages.checkout.select_region"),this.receiverEmailFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_email"),this.emailPlaceholder=salla.lang.get("common.elements.email_placeholder"),this.sendLater=salla.lang.get("blocks.buy_as_gift.send_later"),this.selectSendDateAndTime=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time"),this.canNotEditOrderAfterSelectDate=salla.lang.get("blocks.buy_as_gift.can_not_edit_order_after_select_date"),this.sendGift=salla.lang.get("blocks.buy_as_gift.send_gift"),this.donationRequired=salla.lang.get("pages.products.donation_amount_required"),this.currentLang=salla.lang.locale})),salla.event.on(this.defaultEvent,(()=>{this.open()}))}isPhysical(){return this.physicalProducts||this.physical}cityNoticeText(){return this.gift?.recipient_can_change_address?this.gift?.allows_different_shipping_cost?null:this.cityChangeNotice:this.selectCityInfo}componentDidLoad(){salla.event.product.onPriceUpdated((()=>{const t=document.querySelector(".s-quantity-input-input");this.quantity=t?.value}))}getFormDataFromForm(){if(!this.formSelector)return null;const t=document.querySelector(this.formSelector);return t?new FormData(t):null}mergeObjectToFormData(t,i,e){for(let s in t){if(!t.hasOwnProperty(s)||null==t[s])continue;const r=e?`${e}[${s}]`:s;"object"!=typeof t[s]||null===t[s]||t[s]instanceof File?i.set(r,t[s]):this.mergeObjectToFormData(t[s],i,r)}return i}async open(){if(salla.config.isGuest())return salla.api.auth.setAfterLoginEvent(this.defaultEvent),void salla.event.dispatch("login::open",{withoutReload:!0});this.resetStepsAnimation(),this.currentStep=1,this.parentClass="is-current-step-1",this.step2Animated=!1,this.stepsWrapper?.style.removeProperty("height"),await this.modal.open();const t=this.productId?()=>salla.product.getGiftProductDetails(this.productId):()=>salla.cart.getGiftCartDetails();return await salla.api.withoutNotifier(t).then((t=>{this.gift=t.data,this.senderName=this.gift.sender_name,this.disableClass=this.gift?.show_image_upload?"":"pointer-events-none",this.gift.show_texts||(this.selectedGiftTextOption=void 0,this.selectedText=void 0),this.gift.show_images||(this.selectedImage=void 0,this.uploadedImage=void 0),this.skipStep1()&&(this.currentStep=2,this.parentClass="is-current-step-2",this.step2Animated=!0)})).catch((t=>{this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data})).finally((()=>this.modal.stopLoading()))}skipStep1(){return!!this.gift&&!this.gift.show_images&&!this.gift.show_texts}resetStepsAnimation(){[this.step1Elems,this.step2Elems].forEach((t=>{t?.querySelectorAll(".anime-item").forEach((t=>t.removeAttribute("style")))})),this.step1Elems?.removeAttribute("style"),this.step2Elems&&!this.skipStep1()&&(this.step2Elems.style.removeProperty("opacity"),this.step2Elems.style.removeProperty("transform"))}async close(){return this.modal.close()}async setWrapperHeight(t=1,i=250,e=0,s=0){let r=document.querySelector(`#${this.hostId} .gift-step-${t}`);const a=()=>{this.stepsWrapper.style.height=s?`${s}px`:r.offsetHeight+e+"px"};this.step2Animated&&2===t?requestAnimationFrame(a):setTimeout(a,i)}toggleCalendar(){this.showCalendar=!this.showCalendar,this.setWrapperHeight(2,150,0)}toggleGiftText(t){this.textSelect?.classList.remove("s-form-has-error");let i=t.target.children[t.target.selectedIndex].getAttribute("data-id"),e="custom"==i;const s=this.showGiftText!==e;this.showGiftText=e,i?(this.selectedGiftTextOption=i,this.selectedText=e?void 0:t.target.value):(this.textArea.value="",this.selectedText=void 0,this.selectedGiftTextOption=void 0),s&&this.setWrapperHeight(1,150,5)}async goToStep2(t=!0){this.step1Elems&&(t&&!this.validateStep1()||(this.stepsWrapper&&this.step1Elems&&(this.stepsWrapper.style.height=`${this.step1Elems.offsetHeight}px`),this.setWrapperHeight(2,50,0),(new e.timeline).add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,50],delay:e.stagger(70),duration:1200}).add({targets:".gift-step-2",translateX:["-110%",0],opacity:[0,1]},"-=1800").add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[-50,0],delay:e.stagger(70),duration:1200,complete:()=>{this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((t=>{t.classList.remove("opacity-0"),t.removeAttribute("style")})),this.step2Animated=!0}},"-=1200"),this.currentStep=2,this.parentClass=`is-current-step-${this.currentStep}`))}validateStep1(){return!(this.gift?.show_texts&&(this.selectedGiftTextOption?"custom"!=this.selectedGiftTextOption||this.selectedText?(this.textSelect?.classList.remove("s-form-has-error"),this.customTextArea?.classList.remove("s-form-has-error"),0):(this.textSelect?.classList.remove("s-form-has-error"),this.customTextArea?.classList.add("s-form-has-error"),1):(this.textSelect?.classList.add("s-form-has-error"),this.customTextArea?.classList.remove("s-form-has-error"),1)))}goToStep1(t){t.preventDefault();let i=new e.timeline({autoplay:!1});i.add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,-50],delay:e.stagger(70),duration:1200}).add({targets:".gift-step-1",translateX:["110%",0],opacity:[0,1]},"-=1800").add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[50,0],delay:e.stagger(70),duration:1200,complete:()=>{this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((t=>{t.classList.remove("opacity-0"),t.removeAttribute("style")}))}},"-=1200"),i.play(),this.step2Animated=!1,this.setWrapperHeight(1,600,0),this.currentStep=1,this.parentClass=`is-current-step-${this.currentStep}`}getFilepondPlaceholder(){return`<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>images</title>\n<path d="M22.667 29.333h-13.333c-3.676 0-6.667-2.991-6.667-6.667v-13.333c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v13.333c0 5.145 4.187 9.333 9.333 9.333h13.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM22.667 5.333c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 10.667c-0.735 0-1.333-0.597-1.333-1.333s0.599-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.599 1.333-1.333 1.333zM25.333 0h-13.333c-3.676 0-6.667 2.991-6.667 6.667v13.333c0 1.055 0.268 2.040 0.707 2.927 0.039 0.099 0.088 0.188 0.151 0.277 1.137 2.053 3.301 3.463 5.809 3.463h13.333c3.676 0 6.667-2.991 6.667-6.667v-13.333c0-3.676-2.991-6.667-6.667-6.667zM12 24c-1.244 0-2.344-0.583-3.077-1.476l5.721-7.047 6.629 8.523zM29.333 20c0 2.205-1.795 4-4 4h-0.68l-8.933-11.485c-0.251-0.32-0.633-0.511-1.039-0.515h-0.015c-0.401 0-0.781 0.181-1.035 0.492l-5.632 6.935v-12.76c0-2.205 1.795-4 4-4h13.333c2.205 0 4 1.795 4 4z"></path>\n</svg>\n</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload&&this.gift.show_image_upload?this.selectImageOrUpload:this.selectImageForYourGift}</p></div>`}setPreview(t){this.uploader?.classList.add("has-bg");var i=document.querySelector(`#${this.hostId}.filepond-bg`)?document.querySelector(`#${this.hostId} .filepond-bg`):document.createElement("div");i.classList.add("filepond-bg"),i.classList.remove("s-hidden"),i.style.backgroundImage="url('"+t.url+"')",this.uploader?.querySelector(".filepond--root")?.appendChild(i),this.uploadedImage=t.url,this.gift&&this.gift.gift_images?.length&&this.setWrapperHeight(1,150,0)}removePreview(){this.uploader.classList.remove("has-bg");let t=document.querySelector(`#${this.hostId} .filepond-bg`);t.removeAttribute("style"),t.classList.add("s-hidden"),this.handleRemoveImage()}handleTextAreaChange(t){this.selectedText=t.target.value,this.customTextArea?.classList.remove("s-form-has-error")}clearError(t){if(this.errors?.[t]){const{[t]:i,...e}=this.errors;this.errors=e}}handleSenderName(t){this.senderName=t.target.value,this.clearError("sender_name")}handleReceiverName(t){this.receiverName=t.target.value,this.clearError("receiver.name")}resetCityState(){this.citySearchTimer&&(clearTimeout(this.citySearchTimer),this.citySearchTimer=null),++this.citySearchCounter,this.gift={...this.gift,cities:[]},this.displayedCities=[],this.receiverCity=void 0,this.selectedCity=null,this.citySearchQuery="",this.searchingCities=!1,this.enableCityAjaxSearch=!1}setInitialCities(t){this.gift={...this.gift,cities:t},this.displayedCities=t,this.enableCityAjaxSearch=t.length>=o.CITY_AJAX_THRESHOLD}async fetchCities(t=""){if(!this.selectedCountryId)return[];if(this.isKSA&&!this.selectedRegionId)return[];const i=["for_branch=0",`country_id=${this.selectedCountryId}`];this.isKSA&&this.selectedRegionId&&i.push(`region_id=${this.selectedRegionId}`),t?.trim()&&i.push(`query=${encodeURIComponent(t.trim())}`);const e=await salla.api.request(`shipping/cities?${i.join("&")}`);return e?.data??[]}async handleCountrySelected(t){const i=t?.id;this.selectedCountry=t??null,this.selectedCountryId=i,this.selectedCountryCode=t?.country_code,this.isKSA="SA"===t?.country_code,this.clearError("receiver.country"),this.regions=[],this.selectedRegionId=void 0,this.selectedRegion=null,this.resetCityState();const e=++this.locationRequestCounter;if(!i)return this.selectedCountryCode=void 0,this.isKSA=!1,void this.setWrapperHeight(2,0,0);if(this.isKSA){this.loadingRegions=!0,this.setWrapperHeight(2,0,0);try{const t=await salla.api.request(`shipping/countries/${i}/regions`);if(e!==this.locationRequestCounter)return;t&&t.data&&(this.regions=t.data)}catch(t){if(e!==this.locationRequestCounter)return;console.error("Error fetching regions:",t)}finally{e===this.locationRequestCounter&&(this.loadingRegions=!1,this.setWrapperHeight(2,0,0))}}else{this.loadingCities=!0,this.setWrapperHeight(2,0,0);try{const t=await this.fetchCities();if(e!==this.locationRequestCounter)return;this.setInitialCities(t)}catch(t){if(e!==this.locationRequestCounter)return;console.error("Error fetching cities:",t)}finally{e===this.locationRequestCounter&&(this.loadingCities=!1)}}}async handleRegionSelected(t){const i=t?.id;this.selectedRegion=t??null,this.selectedRegionId=i,this.clearError("receiver.region"),this.resetCityState();const e=++this.locationRequestCounter;if(i){this.loadingCities=!0;try{const t=await this.fetchCities();if(e!==this.locationRequestCounter)return;this.setInitialCities(t)}catch(t){if(e!==this.locationRequestCounter)return;console.error("Error fetching cities:",t)}finally{e===this.locationRequestCounter&&(this.loadingCities=!1,this.setWrapperHeight(2,0,0))}}}handleUploadImage(t){this.uploadedImage="object"!=typeof t?t:t&&t.url,this.gift&&this.gift.gift_images?.length&&this.setWrapperHeight(1,150,0)}handleRemoveImage(){this.uploadedImage="",this.gift&&this.gift.gift_images?.length&&this.setWrapperHeight(1,150,0)}handlePhoneInputChange(t){let i=t.detail;this.receiverMobile=i.number,this.receiverCountryCode=i.country_code,this.clearError("receiver.mobile")}handleDateTimePicker(t){this.deliveryDate=t.detail}getCalendarClasses(){return{"s-form-group":!0,"anime-item":!0,"s-gifting-calendar":!0,shown:this.showCalendar,hide:!this.showCalendar,"s-form-has-error":!!this.errors&&this.errors.deliver_at}}async submitForm(){const t=document.querySelector("#donating-amount")?.value;if(this.calendarFormGroup.classList.remove("s-form-has-error"),this.errors&&(this.errors={},this.setWrapperHeight(2,150,0)),this.showCalendar&&!this.deliveryDate)return void this.calendarFormGroup.classList.add("s-form-has-error");const i=[{key:"sender_name",value:this.senderName,label:this.senderNameLabel},{key:"receiver.name",value:this.receiverName,label:this.receiverNameFieldLabel},{key:"receiver.mobile",value:this.receiverMobile,label:this.receiverMobileFieldLabel},...this.isPhysical()?[{key:"receiver.country",value:this.selectedCountryId,label:this.receiverCountryFieldLabel},...this.isKSA?[{key:"receiver.region",value:this.selectedRegionId,label:this.receiverRegionFieldLabel}]:[],{key:"receiver.city_id",value:this.receiverCity,label:this.receiverCityFieldLabel}]:[]],e={};if(i.forEach((({key:t,value:i,label:s})=>{i||(e[t]=salla.lang.get("common.errors.field_required",{attribute:s}))})),Object.keys(e).length)return this.errors=e,void this.setWrapperHeight(2,150,0);const s="custom"===this.selectedGiftTextOption,r={text:s?this.selectedText:void 0,text_id:!s&&this.selectedGiftTextOption?Number(this.selectedGiftTextOption):void 0,sender_name:this.senderName,quantity:this.quantity,deliver_at:this.showCalendar?this.deliveryDate:null,image_url:this.uploadedImage??this.selectedImage,donation_amount:t||null,receiver:{name:this.receiverName,mobile_country_code:this.receiverCountryCode,mobile:this.receiverMobile,...this.isPhysical()&&this.selectedCountryCode?{country_code:this.selectedCountryCode}:{},...this.isPhysical()&&this.selectedRegionId?{region_id:this.selectedRegionId}:{},...this.receiverCity&&this.isPhysical()?{city_id:this.receiverCity}:{}},has_apple_pay:salla.helpers.hasApplePay()};let a;this.productId&&this.formSelector&&(a=this.getFormDataFromForm()||new FormData,a=this.mergeObjectToFormData(r,a));const o=this.productId?()=>salla.product.addProductGiftToCart(this.productId,a,!0):()=>salla.cart.addCartGiftToCart(r,!0);return await o().then((()=>this.modal.close())).catch((t=>{t.response&&422==t.response.status?this.errors=t.response.data.error.fields:console.log(t),this.setWrapperHeight(2,150,0)}))}step2ItemClass(t=""){const i="anime-item"+(this.step2Animated?"":" opacity-0");return t?`${t} ${i}`:i}generateClass(){return{"s-gifting-widget":!0,"s-gifting-widget-vertical":!!this.vertical,"s-gifting-widget-horizontal":!this.vertical}}async handleGiftButtonClick(){if(this.productId&&this.formSelector){const t=document.querySelector(this.formSelector);if(!t)return void console.error("SallaGifting:: Form not found in the document!");if(!(t instanceof HTMLFormElement))return void console.error("SallaGifting:: The specified selector does not correspond to a form tag!");if(!t.reportValidity())return console.error("SallaGifting:: Form is not valid!"),void salla.error(salla.lang.get("common.messages.required_fields"))}const t=document.querySelector(`salla-product-options[product-id="${this.productId}"]`);!t||await t.reportValidity()?this.open():salla.error(salla.lang.get("common.messages.required_fields"))}render(){return[i("div",{key:"3795180f3f719218220086c66f6bfbe6e57dc1d4"},i("salla-list-tile",{key:"cb9fd3e10b02bb429b25c028fcd2d328e73eab6e",class:this.generateClass()},i("div",{key:"cca448eae1144b0606bf8f07844974cd7f966236",slot:"title"},this.vertical?i("span",{innerHTML:a}):"",i("h3",{key:"c33210bdf1a72cdf0151138ce2949fc462efaf94"},this.widgetTitle?this.widgetTitle:this.sectionTitle)),i("div",{key:"007fc138265e6ab82dbdfab8169baa407b111e60",slot:"subtitle"},i("div",{key:"89de9cc780511609d294f67a3d639a0305300b17"},this.widgetSubtitle?this.widgetSubtitle:this.sectionSubtitle)),i("div",{key:"ea647e47079ab8e57580675f485bc99c2b213cd4",slot:"action"},i("salla-button",{key:"e87bcc03e5ab02204ca9f1d590421cae13282269",color:"primary",fill:"outline",width:"wide",class:"s-gifting-widget-action",onClick:()=>this.handleGiftButtonClick()},i("slot",{key:"ce294391f8c18e345ec2117a15e2942dd00790fc",name:"widget-btn-content"},i("div",{key:"7106257d9f44b869fcd3933ae8a1d2a50f4486dd",class:"s-gifting-widget-action-content"},i("span",{key:"305822ae865b6da9275ced4600933d83d42e54e7",innerHTML:a})," ",i("span",{key:"13f2d03213e1fea9fe9911a94259b89085406ab3"},this.sectionBtnText)))))),i("salla-modal",{key:"b55185fbd34776043661ca6f15a739e34e98e0ef",id:this.hostId,isLoading:!0,class:"s-gifting-modal",width:"sm",ref:t=>this.modal=t},i("div",{key:"9f59cea6e2835d80e24bc269b78a5bc47b354f6a",slot:"loading"},i("div",{key:"3f74f3384be120a0733e921de696d2beeccd49ce",class:"s-gifting-skeleton"},i("div",{key:"e3ffb5b8d712bc391ad6b4190556ac870e37db0c",class:"s-gifting-modal-header"},i("salla-skeleton",{key:"b9b154ab445516fa1fae66cc458dd68114024d9d",type:"circle",height:"5rem",width:"5rem"}),i("h2",{key:"1ecf5c6ea1ebeccbd6ed7f259045647148863826",class:"s-gifting-modal-title"},i("div",{key:"165d927a3bcaf47dd5c7657db8543ad02b47dc44",class:"s-gifting-modal-badge-wrapper"},i("salla-skeleton",{key:"cba1667fa446566c5bc862c206313d8f48a0991e",height:"15px",width:"150px"})))),i("div",{key:"f56f8e8820f789ca117a0e19cf660bc4d836ec6a",class:"s-gifting-skeleton-content"},i("salla-skeleton",{key:"74b8cec4be6e18ec8a1b340d8fed0b2d136bb1d3",height:"10px",width:"150px"}),i("salla-skeleton",{key:"5c615a0c0eb72908e601c2cfd28fe12a6391ef80",height:"230px"}),i("salla-skeleton",{key:"5c432b6e3f8c70574e1d05d26f57443ff5da45fe",height:"10px",width:"150px"}),i("salla-skeleton",{key:"7f5d7ec5cf3ef50f945e2a57363ac215e41f306b",height:"30px"}),i("salla-skeleton",{key:"47c0e823643dc9c2d4908dde353adf5b0e4355ad",height:"40px"})))),i("slot",{key:"3ad3a57a07cb8182e5cd86783ba19c8ae8f34d3b",name:"header"}),this.hasError?i("salla-placeholder",{alignment:"center"},i("span",{slot:"title"},this.errorMessage||salla.lang.get("common.errors.empty_results")),i("span",{slot:"description"}," ")):[i("div",{class:"s-gifting-modal-header"},i("span",{class:"s-gifting-modal-icon"},i("span",{innerHTML:a})),i("h2",{class:"s-gifting-modal-title"},i("div",{class:"s-gifting-modal-badge-wrapper"},!this.skipStep1()&&i("div",{class:"s-gifting-modal-badge"},i("span",null,i("span",null,this.currentStep),"/2")),i("span",null,this.giftDetails)))),i("div",{class:"s-gifting-steps-wrapper "+this.parentClass,ref:t=>this.stepsWrapper=t},!this.skipStep1()&&i("div",{class:"s-gifting-step-one gift-step-1",ref:t=>this.step1Elems=t},this.gift&&this.gift.show_images&&i("div",{class:"s-gifting-modal-uploader-title anime-item"},this.selectImageForYourGift),this.gift&&this.gift.show_images&&i("div",{class:"s-gifting-image-section"},i("div",{class:`s-gifting-modal-uploader anime-item ${this.disableClass}`,ref:t=>this.uploader=t},i("span",{class:"s-gifting-remove-preview pointer-events-auto",onClick:()=>this.removePreview(),innerHTML:r}),this.selectImageOrUpload&&this.gift&&i("salla-file-upload",{"instant-upload":!0,name:"image_url",url:salla.url.api(salla.product.api.getUrl("giftImage")),onUploaded:t=>this.handleUploadImage(t.detail),labelIdle:this.getFilepondPlaceholder(),onRemoved:()=>this.handleRemoveImage()})),i("div",{class:"anime-item"},!this.uploadedImage&&this.gift&&this.gift.gift_images&&this.gift.gift_images.length>0?i("salla-slider",{id:"gifting-slider",loop:!1,"controls-outer":!0,class:"s-gifting-slider",type:"carousel"},i("div",{slot:"items"},this.gift&&this.gift.gift_images?this.gift?.gift_images.map((t=>i("a",{class:"s-gifting-clickable s-gifting-image",onClick:()=>this.setPreview(t)},i("img",{src:t.url,alt:`${t.id}`})))):"")):"")),this.gift&&this.gift.show_texts?i("div",{class:"anime-item"},i("div",{class:"s-gifting-modal-uploader-title s-gifting-text-title"},this.giftText),i("div",{class:"s-form-group s-gifting-selectText",ref:t=>this.textSelect=t},i("select",{id:"gift-text-selection",name:"gift-text-selection",class:"s-form-control s-gifting-select",onChange:t=>this.toggleGiftText(t)},i("option",{"data-id":null,selected:!this.selectedGiftTextOption},this.selectGiftMessage),this.gift&&this.gift.gift_texts?this.gift?.gift_texts.map((t=>i("option",{"data-id":t.id,value:t.text,key:t.id,selected:String(this.selectedGiftTextOption)===String(t.id)},t.text))):"",this.gift&&this.gift.show_custom_text?i("option",{"data-id":"custom",selected:"custom"===this.selectedGiftTextOption},this.giftCustomText):null)),i("div",{class:this.showGiftText&&this.gift&&this.gift.show_custom_text?"s-form-group s-gifting-textarea shown":"s-form-group s-gifting-textarea hide",ref:t=>this.customTextArea=t},i("label",{htmlFor:"gift-custom-text",class:"s-form-label"},this.giftCustomText),i("div",{class:"mt-1"},i("textarea",{onInput:t=>this.handleTextAreaChange(t),rows:4,ref:t=>this.textArea=t,name:"gift-custom-text",id:"gift-custom-text",class:"s-form-control"})))):null,i("div",{class:"anime-item"},i("salla-button",{color:"primary",width:"wide",onClick:()=>this.goToStep2(!!this.gift?.show_texts)},i("span",null,this.nextStep)))),i("div",{class:"s-gifting-step-two gift-step-2",style:this.skipStep1()?{opacity:"1",transform:"translateX(0)",position:"relative"}:void 0,ref:t=>this.step2Elems=t},i("div",{class:this.step2ItemClass(this.errors?.sender_name?"s-form-group s-form-has-error":"s-form-group")},i("label",{htmlFor:"sender_name",class:"s-form-label"},this.senderNameLabel),i("input",{type:"text",class:"s-form-control",name:"sender_name",id:"sender_name",value:this.senderName,onInput:t=>this.handleSenderName(t),placeholder:""}),this.errors&&this.errors.sender_name?i("span",{class:"s-gifting-error"},this.errors.sender_name):""),i("div",{class:this.step2ItemClass(this.errors?.["receiver.name"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{htmlFor:"receiver_name",class:"s-form-label"},this.receiverNameFieldLabel),i("input",{type:"text",class:"s-form-control",name:"receiver_name",id:"receiver_name",value:"",onInput:t=>this.handleReceiverName(t),placeholder:""}),this.errors&&this.errors["receiver.name"]?i("span",{class:"s-gifting-error"},this.errors["receiver.name"]):""),i("div",{class:this.step2ItemClass(this.errors?.["receiver.mobile"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{class:"s-form-label"},this.receiverMobileFieldLabel),i("salla-tel-input",{class:"s-gifting-tel-input",phone:this.receiverMobile,countryCode:this.receiverCountryCode,onPhoneEntered:t=>this.handlePhoneInputChange(t)}),this.errors&&this.errors["receiver.mobile"]?i("span",{class:"s-gifting-error"},this.errors["receiver.mobile"]):""),this.isPhysical()&&i("div",{class:this.step2ItemClass(this.errors?.["receiver.country"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{class:"s-form-label",htmlFor:`${this.hostId}-country`},this.receiverCountryFieldLabel),i("salla-searchable-dropdown",{placeholder:this.selectCountry,items:this.gift?.countries??[],selectedItem:this.selectedCountry,disabled:!this.gift?.countries?.length,required:!0,inputId:`${this.hostId}-country`,searchable:!1,keepParentScroll:!0,onItemSelected:t=>this.handleCountrySelected(t.detail),onDropdownClosed:()=>this.handleCountryDropdownClosed()}),this.errors&&this.errors["receiver.country"]?i("span",{class:"s-gifting-error"},this.errors["receiver.country"]):""),this.isPhysical()&&this.isKSA&&i("div",{class:this.step2ItemClass(this.errors?.["receiver.region"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{class:"s-form-label",htmlFor:`${this.hostId}-region`},this.receiverRegionFieldLabel),i("salla-searchable-dropdown",{placeholder:this.selectRegion,items:this.regions??[],selectedItem:this.selectedRegion,loading:this.loadingRegions,disabled:this.loadingRegions||!this.regions?.length,required:!0,inputId:`${this.hostId}-region`,searchable:!1,keepParentScroll:!0,onItemSelected:t=>this.handleRegionSelected(t.detail),onDropdownClosed:()=>this.handleRegionDropdownClosed()}),this.errors&&this.errors["receiver.region"]?i("span",{class:"s-gifting-error"},this.errors["receiver.region"]):""),this.isPhysical()&&i("div",{class:this.step2ItemClass(this.errors?.["receiver.city_id"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{class:"s-form-label",htmlFor:`${this.hostId}-city`},this.receiverCityFieldLabel),i("salla-searchable-dropdown",{placeholder:this.selectCity,items:this.displayedCities,selectedItem:this.selectedCity,loading:this.loadingCities,searching:this.searchingCities,disabled:this.loadingCities||this.isKSA&&!this.selectedRegionId,required:!0,inputId:`${this.hostId}-city`,searchQuery:this.citySearchQuery,clientSearch:!this.enableCityAjaxSearch,dropUp:!0,keepParentScroll:!0,onItemSelected:t=>this.handleCitySelected(t.detail),onSearchInput:t=>this.handleCitySearch(t.detail),onDropdownClosed:()=>this.handleCityDropdownClosed()}),this.errors&&this.errors["receiver.city_id"]?i("span",{class:"s-gifting-error"},this.errors["receiver.city_id"]):""),this.isPhysical()&&this.cityNoticeText()&&i("div",{class:this.step2ItemClass("s-gifting-info")},i("span",{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>alert</title>\n<path d="M16 13.333c-0.736 0-1.333 0.597-1.333 1.333v8c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-8c0-0.736-0.597-1.333-1.333-1.333zM16 9.327c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM27.313 4.687c-6.237-6.237-16.389-6.239-22.628 0-6.237 6.239-6.237 16.389 0 22.628 3.119 3.119 7.216 4.679 11.313 4.679s8.195-1.559 11.313-4.679c6.24-6.239 6.24-16.391 0.001-22.628zM25.428 25.428c-5.199 5.197-13.657 5.197-18.857 0-5.197-5.199-5.197-13.659 0-18.857 5.199-5.197 13.659-5.197 18.857 0 5.199 5.2 5.199 13.659 0 18.857z"></path>\n</svg>\n'}),i("span",null,this.cityNoticeText())),!this.isPhysical()&&i("div",{class:this.step2ItemClass()},i("label",{class:"s-gifting-schedule s-gifting-clickable",htmlFor:`schedule-${this.hostId}`},i("input",{type:"checkbox",name:"schedule",id:`schedule-${this.hostId}`,onChange:()=>this.toggleCalendar(),class:"s-checkbox"}),i("span",{class:"s-form-label"}," ",this.sendLater," "))),i("div",{class:this.getCalendarClasses(),ref:t=>this.calendarFormGroup=t},i("label",{class:"s-form-label"},this.selectSendDateAndTime),i("salla-datetime-picker",{value:this.deliveryDate,placeholder:this.selectSendDateAndTime,"enable-time":!0,"date-format":"Y-m-d h:i K",onPicked:t=>this.handleDateTimePicker(t)}),i("span",{class:"s-gifting-calendar-hint"},this.canNotEditOrderAfterSelectDate)),i("div",{class:this.step2ItemClass("s-gifting-step-two-footer")},!this.skipStep1()&&i("a",{href:"#!",innerHTML:s,onClick:t=>this.goToStep1(t)}),i("salla-button",{onClick:()=>this.submitForm(),color:"primary",width:"wide"},i("span",null,this.sendGift)))))],i("slot",{key:"4b5e340be26e46c09508d192207fa6af9ec0cc44",name:"footer"})))]}};o.CITY_AJAX_THRESHOLD=400,o.CITY_SEARCH_DEBOUNCE_MS=100,o.style='/*!twlt*/.s-gifting-steps-wrapper{transition:height 0.8s cubic-bezier(0.55, 0, 0.1, 1) 0s}.s-gifting-select{background-image:url("data:image/svg+xml;utf8,<svg version=\'1.1\' fill=\'gray\' xmlns=\'http://www.w3.org/2000/svg\' width=\'32\' height=\'32\' viewBox=\'0 0 32 32\'><title>keyboard_arrow_down</title><path d=\'M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z\'></path></svg>");background-size:24px;background-repeat:no-repeat;background-position:99%;appearance:none}[dir=rtl] .s-gifting-select{background-position:5px}.s-gifting-widget-vertical .s-list-tile-item [slot=title]{display:flex;align-items:center;gap:1.5rem}.s-gifting-widget-vertical .s-list-tile-item-content{width:100%}.s-gifting-modal .s-searchable-dropdown-trigger{border-color:#d1d5db}.s-gifting-modal .s-searchable-dropdown-trigger:hover:not(.s-searchable-dropdown-trigger--disabled){border-color:#d1d5db}.s-gifting-modal .s-searchable-dropdown-trigger--open,.s-gifting-modal .s-searchable-dropdown-trigger:focus{border-color:var(--color-primary, #00897b);box-shadow:0 0 0 1px var(--color-primary, #00897b)}.s-gifting-modal .s-searchable-dropdown-trigger-placeholder{color:#000}.s-gifting-modal .s-gifting-image-section{margin-bottom:1.5rem}.s-gifting-modal .s-gifting-slider{margin-bottom:0.5rem}.s-gifting-modal .s-gifting-image{display:block}.s-gifting-modal .s-gifting-image img{display:block;width:auto;height:100px;object-fit:contain}.s-gifting-modal .s-gifting-image-section+.anime-item .s-gifting-text-title{margin-top:1rem}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.static{position:static}.fixed{position:fixed}.relative{position:relative}.mt-1{margin-top:0.25rem}.inline{display:inline}.hidden{display:none}.grow{flex-grow:1}.transform{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))}.resize{resize:both}.opacity-0{opacity:0}.outline{outline-style:solid}.transition{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:150ms}.s-hidden{display:none}.has-error .s-form-label{color:#ff443a}.has-error .s-form-control,.has-error .s-tel-input-control,.has-error .s-datetime-picker-input{border-color:#ff443a;color:#ff443a}.s-hidden{display:none}.s-form-control{display:block;width:100%;border-radius:var(--s-radius, 0.25rem);border-width:1px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-form-control:focus{border-color:var(--color-primary);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.s-form-label{margin-bottom:0.25rem;display:block;font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-form-group{margin-top:0.75rem;margin-bottom:0.75rem}.s-checkbox{cursor:pointer;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));appearance:none;background-color:#fff;margin:0;width:18px;height:18px;border-width:1px;border-radius:4px;display:grid;place-content:center}.s-checkbox:before{width:10px;height:10px;clip-path:polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);transform:scale(0);transform-origin:bottom left;transition:120ms transform ease-in-out;box-shadow:inset 1em 1em #444;background-color:#444}.s-checkbox:checked:before{transform:scale(1)}.s-checkbox::before{--tw-content:\'\';content:var(--tw-content)}.s-form-has-error .s-form-label{color:#ff443a}.s-form-has-error .s-form-control,.s-form-has-error .s-tel-input-control,.s-form-has-error .s-datetime-picker-input{border-color:#ff443a;color:#ff443a}.s-gifting-widget .s-list-tile-item-icon{display:none}.s-gifting-widget-vertical .s-list-tile-item-icon{display:block}.s-gifting-widget-vertical .s-list-tile-item-title svg{fill:var(--color-primary)}.s-gifting-widget-vertical .s-list-tile-item-subtitle{padding-right:3.5rem;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-gifting-widget-vertical .s-list-tile-item{flex-wrap:wrap;padding:0px}@media (min-width: 1024px){.s-gifting-widget-vertical .s-list-tile-item-action{flex:1 1 0%}}.s-gifting-widget-vertical .widget-icon{--tw-translate-y:0.625rem;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-size:1.875rem;line-height:2.25rem;color:var(--color-primary)}.s-gifting-widget .s-button-text{display:flex}.s-gifting-widget .s-list-tile-item{flex-direction:column;justify-content:space-between;gap:1rem;border-radius:0.75rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:1.25rem;text-align:center}@media (min-width: 768px){.s-gifting-widget .s-list-tile-item{text-align:left}}@media (min-width: 1024px){.s-gifting-widget .s-list-tile-item{flex-direction:row}}@media (min-width: 768px){.s-gifting-widget .s-list-tile-item:where([dir="rtl"],[dir="rtl"] *){text-align:right}}.s-gifting-widget-horizontal .s-gifting-widget-action button{padding-left:2rem;padding-right:2rem;font-weight:400}.s-gifting-info{display:flex;align-items:center;gap:0.5rem;border-radius:0.5rem;--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));padding:1rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.s-gifting-info svg{height:1.25rem;width:1.25rem;fill:#1d4ed8}.s-gifting-error{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-gifting-info span{font-size:0.75rem;line-height:1rem}.s-gifting-widget-action-content{display:flex;align-items:center}.s-gifting-widget-action-content svg{margin-left:0.5rem;margin-right:0.5rem}.s-gifting-modal-header{margin-bottom:1.25rem;display:flex;flex-direction:column;align-items:center;justify-content:center}.s-gifting-modal .s-modal-header{display:block}.s-gifting-modal .s-modal-body{position:relative !important;left:unset !important;bottom:unset !important;padding-bottom:2rem}@media (min-width: 640px){.s-gifting-modal .s-modal-body{padding-bottom:1.5rem}}.s-gifting-modal-icon{margin-bottom:1.25rem;display:flex;height:5rem;width:5rem;flex-direction:row;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));font-size:1.875rem;line-height:2.25rem}.s-gifting-modal-title{display:flex;width:100%;align-items:center;justify-content:space-between}.s-gifting-modal-title::before{display:block;height:1px;flex:1 1 auto;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-gifting-modal-title::after{display:block;height:1px;flex:1 1 auto;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-gifting-modal-badge-wrapper{display:flex;align-items:center;padding-left:0.75rem;padding-right:0.75rem}.s-gifting-modal-badge{margin-right:0.5rem;border-radius:0.5rem;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));padding-left:0.5rem;padding-right:0.5rem;padding-top:0.25rem;padding-bottom:0.25rem;font-size:0.875rem;line-height:1.25rem}.s-gifting-modal-badge:where([dir="rtl"],[dir="rtl"] *){margin-right:0px;margin-left:0.5rem}.s-gifting-modal-uploader.has-bg{position:relative}.s-gifting-modal-uploader.has-bg .s-gifting-remove-preview{pointer-events:auto;--tw-scale-x:1;--tw-scale-y:1;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));opacity:1}.s-gifting-modal-uploader-title{margin-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem}.s-gifting-steps-wrapper{position:relative}.s-gifting-steps-wrapper .s-button-wrap{pointer-events:auto !important}.is-current-step-2 .gift-step-1,.is-current-step-1 .gift-step-2{pointer-events:none;z-index:-1}.s-gifting-step-one{padding-top:1.25rem}.s-gifting-step-two{position:absolute;top:0px;left:0px;margin-left:auto;margin-right:auto;display:flex;width:100%;--tw-translate-x:-105%;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));flex-direction:column;opacity:0}.s-gifting-step-one .swiper-wrapper{height:100px}.s-gifting-step-one .swiper-slide{width:auto !important}.s-gifting-step-one .filepond--list-scroller{overflow-y:hidden}.s-gifting-step-one .swiper-wrapper img{border-radius:0.375rem;object-fit:cover}.s-gifting-step-one .filepond--root{height:230px}.s-gifting-step-one .filepond--list{left:0px !important;height:100% !important}.s-gifting-step-one .filepond-bg{position:absolute;top:0px;z-index:10;height:100%;width:100%;border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1));background-size:cover}.s-gifting-step-one .s-slider-button-next{top:35% !important}.s-gifting-step-one .s-slider-button-next button{height:35px;width:35px;--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px 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-gifting-step-one .s-slider-button-prev{top:35% !important}.s-gifting-step-one .s-slider-button-prev button{height:35px;width:35px;--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px 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-gifting-tel-input .s-tel-input-control{--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.s-gifting-tel-input .s-tel-input-error-msg{display:none}.s-gifting-step-two-footer{margin-top:1.25rem;display:flex;flex-direction:row;align-items:center;justify-content:center}.s-gifting-step-two-footer>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.625rem * var(--tw-space-x-reverse));margin-left:calc(0.625rem * calc(1 - var(--tw-space-x-reverse)))}.s-gifting-step-two-footer:where([dir="rtl"],[dir="rtl"] *){flex-direction:row-reverse}.s-gifting-step-two-footer a{border-radius:0.375rem;border-width:1px;border-color:var(--color-primary);fill:var(--color-primary);padding-top:8px;padding-bottom:8px;padding-left:25px;padding-right:25px}.s-gifting-step-two-footer a svg{height:1.25rem;width:1.25rem}.s-gifting-step-two .s-form-group.s-form-has-error .s-tel-input-control{--tw-border-opacity:1 !important;border-color:rgb(255 68 58 / var(--tw-border-opacity, 1)) !important}.s-gifting-selectText{margin-bottom:20px !important}.s-gifting-schedule .s-form-label{margin-bottom:0px !important}.s-gifting-schedule{margin-bottom:0.5rem;display:flex;align-items:center;justify-content:flex-start}.s-gifting-schedule>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.375rem * var(--tw-space-x-reverse));margin-left:calc(0.375rem * calc(1 - var(--tw-space-x-reverse)))}.s-gifting-schedule:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-gifting-clickable{cursor:pointer}.s-gifting-remove-preview{pointer-events:none;position:absolute;top:-7px;left:-7px;z-index:10;display:flex;height:1.25rem;width:1.25rem;--tw-scale-x:0;--tw-scale-y:0;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));cursor:pointer;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1));text-align:center;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));opacity:0;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-gifting-remove-preview:where([dir="rtl"],[dir="rtl"] *){left:unset;right:-7px}.s-gifting-remove-preview svg{height:100%;width:15px;fill:#fff}.s-gifting-textarea{transition-property:all;transition-duration:200ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.s-gifting-calendar-hint{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.s-gifting-calendar.shown{margin-top:0.75rem;height:75px;opacity:1}.s-gifting-textarea.shown{height:122px;opacity:1}.s-gifting-calendar.hide{pointer-events:none;visibility:hidden;margin:0px;height:0px;opacity:0}.s-gifting-textarea.hide{pointer-events:none;visibility:hidden;margin:0px;height:0px;opacity:0}.s-gifting-filepond-placeholder-icon svg{margin-top:12px;margin-bottom:12px;margin-left:auto;margin-right:auto;height:4rem;width:3rem;fill:#e5e7eb}.s-gifting-filepond-placeholder-text{margin-left:auto;margin-right:auto;width:65%;min-width:18rem;font-size:0.75rem !important;line-height:1rem !important;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));margin-top:0.75rem;margin-bottom:0.75rem;font-family:var(--font-main), -apple-system, BlinkMacSystemFont}.s-gifting-skeleton-content salla-skeleton:nth-child(1){margin-bottom:0.75rem}.s-gifting-skeleton-content salla-skeleton:nth-child(2){margin-bottom:1.25rem}.s-gifting-skeleton-content salla-skeleton:nth-child(3){margin-bottom:0.75rem}.s-gifting-skeleton-content salla-skeleton:nth-child(4){margin-bottom:1.25rem}.s-gifting-skeleton .s-gifting-modal-header salla-skeleton{margin-bottom:1.25rem}.s-gifting-skeleton .s-gifting-modal-title{margin-bottom:1.25rem}.s-gifting-image{margin-left:5px;margin-right:5px}';export{o as salla_gifting}
|
|
4
|
+
import{r as t,h as i}from"./p-B64o_70M.js";import{a as e}from"./p-CgtvEd63.js";import{a as s}from"./p-BedNk7k1.js";import{C as r}from"./p-BsLF_HK7.js";import{G as a}from"./p-DxkgAGoT.js";const o=class{constructor(i){t(this,i),this.defaultEvent="gifting:open",this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_for_your_gift"),this.currentStep=1,this.showCalendar=!1,this.showGiftText=!1,this.currentLang="",this.parentClass="is-current-step-1",this.errors={},this.gift=void 0,this.selectedGiftTextOption=void 0,this.selectedCountryId=void 0,this.selectedCountryCode=void 0,this.loadingCities=!1,this.loadingRegions=!1,this.regions=[],this.selectedRegionId=void 0,this.isKSA=!1,this.selectedCountry=null,this.selectedRegion=null,this.displayedCities=[],this.selectedCity=null,this.searchingCities=!1,this.enableCityAjaxSearch=!1,this.citySearchQuery="",this.step2Animated=!1,this.citySearchTimer=null,this.citySearchCounter=0,this.locationRequestCounter=0,this.showTextArea=!1,this.selectedImage=void 0,this.uploadedImage=void 0,this.selectedText=void 0,this.hasError=!1,this.timeZone=null,this.receiverCountryCode=salla.config.get("store.scope.countries")?.[0]||salla.config.get("store.store_country")||"SA",this.hostId=`salla-gifting-${Math.random().toString(36).slice(2,10)}`,this.disableClass=this.gift?.show_image_upload?"":"pointer-events-none",this.formSelector="form.product-form, form.form--product-options",this.handleCitySearch=t=>{if(this.citySearchQuery=t,!this.enableCityAjaxSearch)return;this.citySearchTimer&&clearTimeout(this.citySearchTimer);const i=++this.citySearchCounter;this.citySearchTimer=setTimeout((async()=>{this.searchingCities=!0;try{const e=await this.fetchCities(t);i===this.citySearchCounter&&(this.displayedCities=e)}catch(t){i===this.citySearchCounter&&(this.displayedCities=[])}finally{i===this.citySearchCounter&&(this.searchingCities=!1)}}),o.CITY_SEARCH_DEBOUNCE_MS)},this.handleCitySelected=t=>{this.selectedCity=t,this.receiverCity=String(t.id),this.clearError("receiver.city_id")},this.handleCityDropdownClosed=()=>{this.citySearchQuery="",this.citySearchTimer&&(clearTimeout(this.citySearchTimer),this.citySearchTimer=null),++this.citySearchCounter,this.displayedCities=this.gift?.cities??[],this.searchingCities=!1},this.handleCountryDropdownClosed=()=>{},this.handleRegionDropdownClosed=()=>{},salla.lang.onLoaded((()=>{this.selectImageOrUpload=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_for_your_gift"),this.sectionTitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love"),this.sectionSubtitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love_message"),this.sectionBtnText=salla.lang.get("blocks.buy_as_gift.send_as_a_gift"),this.giftDetails=salla.lang.get("blocks.buy_as_gift.gift_details"),this.selectGiftMessage=salla.lang.get("blocks.buy_as_gift.select_gift_message"),this.giftText=salla.lang.get("blocks.buy_as_gift.gift_text"),this.giftCustomText=salla.lang.get("blocks.buy_as_gift.gift_custom_text"),this.textId=salla.lang.get("blocks.buy_as_gift.text_id"),this.incorrectGiftText=salla.lang.get("blocks.buy_as_gift.incorrect_gift_text"),this.nextStep=salla.lang.get("blocks.buy_as_gift.next_step"),this.senderNameLabel=salla.lang.get("blocks.buy_as_gift.sender_name"),this.receiverNameFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_name"),this.receiverMobileFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_mobile"),this.receiverCountryFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_country"),this.ksa=salla.lang.get("pages.checkout.ksa"),this.selectCity=salla.lang.get("pages.checkout.select_city"),this.selectCountry=salla.lang.get("pages.checkout.select_country"),this.selectCityInfo=salla.lang.get("blocks.buy_as_gift.city_info"),this.cityChangeNotice=salla.lang.get("blocks.buy_as_gift.city_change_notice"),this.receiverCityFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_city"),this.receiverRegionFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_region")||salla.lang.get("pages.checkout.region"),this.selectRegion=salla.lang.get("pages.checkout.select_region"),this.receiverEmailFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_email"),this.emailPlaceholder=salla.lang.get("common.elements.email_placeholder"),this.sendLater=salla.lang.get("blocks.buy_as_gift.send_later"),this.selectSendDateAndTime=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time"),this.canNotEditOrderAfterSelectDate=salla.lang.get("blocks.buy_as_gift.can_not_edit_order_after_select_date"),this.sendGift=salla.lang.get("blocks.buy_as_gift.send_gift"),this.donationRequired=salla.lang.get("pages.products.donation_amount_required"),this.currentLang=salla.lang.locale})),salla.event.on(this.defaultEvent,(()=>{this.open()}))}isPhysical(){return this.physicalProducts||this.physical}cityNoticeText(){return this.gift?.recipient_can_change_address?this.gift?.allows_different_shipping_cost?null:this.cityChangeNotice:this.selectCityInfo}componentDidLoad(){salla.event.product.onPriceUpdated((()=>{const t=document.querySelector(".s-quantity-input-input");this.quantity=t?.value}))}getFormDataFromForm(){if(!this.formSelector)return null;const t=document.querySelector(this.formSelector);return t?new FormData(t):null}mergeObjectToFormData(t,i,e){for(let s in t){if(!t.hasOwnProperty(s)||null==t[s])continue;const r=e?`${e}[${s}]`:s;"object"!=typeof t[s]||null===t[s]||t[s]instanceof File?i.set(r,t[s]):this.mergeObjectToFormData(t[s],i,r)}return i}async open(){if(salla.config.isGuest())return salla.api.auth.setAfterLoginEvent(this.defaultEvent),void salla.event.dispatch("login::open",{withoutReload:!0});this.resetStepsAnimation(),this.currentStep=1,this.parentClass="is-current-step-1",this.step2Animated=!1,this.stepsWrapper?.style.removeProperty("height"),await this.modal.open();const t=this.productId?()=>salla.product.getGiftProductDetails(this.productId):()=>salla.cart.getGiftCartDetails();return await salla.api.withoutNotifier(t).then((t=>{this.gift=t.data,this.senderName=this.gift.sender_name,this.disableClass=this.gift?.show_image_upload?"":"pointer-events-none",this.gift.show_texts||(this.selectedGiftTextOption=void 0,this.selectedText=void 0),this.gift.show_images||(this.selectedImage=void 0,this.uploadedImage=void 0),this.skipStep1()&&(this.currentStep=2,this.parentClass="is-current-step-2",this.step2Animated=!0)})).catch((t=>{this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data})).finally((()=>this.modal.stopLoading()))}skipStep1(){return!!this.gift&&!this.gift.show_images&&!this.gift.show_texts}resetStepsAnimation(){[this.step1Elems,this.step2Elems].forEach((t=>{t?.querySelectorAll(".anime-item").forEach((t=>t.removeAttribute("style")))})),this.step1Elems?.removeAttribute("style"),this.step2Elems&&!this.skipStep1()&&(this.step2Elems.style.removeProperty("opacity"),this.step2Elems.style.removeProperty("transform"))}async close(){return this.modal.close()}async setWrapperHeight(t=1,i=250,e=0,s=0){let r=document.querySelector(`#${this.hostId} .gift-step-${t}`);const a=()=>{this.stepsWrapper.style.height=s?`${s}px`:r.offsetHeight+e+"px"};this.step2Animated&&2===t?requestAnimationFrame(a):setTimeout(a,i)}toggleCalendar(){this.showCalendar=!this.showCalendar,this.setWrapperHeight(2,150,0)}toggleGiftText(t){this.textSelect?.classList.remove("s-form-has-error");let i=t.target.children[t.target.selectedIndex].getAttribute("data-id"),e="custom"==i;const s=this.showGiftText!==e;this.showGiftText=e,i?(this.selectedGiftTextOption=i,this.selectedText=e?void 0:t.target.value):(this.textArea.value="",this.selectedText=void 0,this.selectedGiftTextOption=void 0),s&&this.setWrapperHeight(1,150,5)}async goToStep2(t=!0){this.step1Elems&&(t&&!this.validateStep1()||(this.stepsWrapper&&this.step1Elems&&(this.stepsWrapper.style.height=`${this.step1Elems.offsetHeight}px`),this.setWrapperHeight(2,50,0),(new e.timeline).add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,50],delay:e.stagger(70),duration:1200}).add({targets:".gift-step-2",translateX:["-110%",0],opacity:[0,1]},"-=1800").add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[-50,0],delay:e.stagger(70),duration:1200,complete:()=>{this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((t=>{t.classList.remove("opacity-0"),t.removeAttribute("style")})),this.step2Animated=!0}},"-=1200"),this.currentStep=2,this.parentClass=`is-current-step-${this.currentStep}`))}validateStep1(){return!(this.gift?.show_texts&&(this.selectedGiftTextOption?"custom"!=this.selectedGiftTextOption||this.selectedText?(this.textSelect?.classList.remove("s-form-has-error"),this.customTextArea?.classList.remove("s-form-has-error"),0):(this.textSelect?.classList.remove("s-form-has-error"),this.customTextArea?.classList.add("s-form-has-error"),1):(this.textSelect?.classList.add("s-form-has-error"),this.customTextArea?.classList.remove("s-form-has-error"),1)))}goToStep1(t){t.preventDefault();let i=new e.timeline({autoplay:!1});i.add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,-50],delay:e.stagger(70),duration:1200}).add({targets:".gift-step-1",translateX:["110%",0],opacity:[0,1]},"-=1800").add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[50,0],delay:e.stagger(70),duration:1200,complete:()=>{this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((t=>{t.classList.remove("opacity-0"),t.removeAttribute("style")}))}},"-=1200"),i.play(),this.step2Animated=!1,this.setWrapperHeight(1,600,0),this.currentStep=1,this.parentClass=`is-current-step-${this.currentStep}`}getFilepondPlaceholder(){return`<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>images</title>\n<path d="M22.667 29.333h-13.333c-3.676 0-6.667-2.991-6.667-6.667v-13.333c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v13.333c0 5.145 4.187 9.333 9.333 9.333h13.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM22.667 5.333c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 10.667c-0.735 0-1.333-0.597-1.333-1.333s0.599-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.599 1.333-1.333 1.333zM25.333 0h-13.333c-3.676 0-6.667 2.991-6.667 6.667v13.333c0 1.055 0.268 2.040 0.707 2.927 0.039 0.099 0.088 0.188 0.151 0.277 1.137 2.053 3.301 3.463 5.809 3.463h13.333c3.676 0 6.667-2.991 6.667-6.667v-13.333c0-3.676-2.991-6.667-6.667-6.667zM12 24c-1.244 0-2.344-0.583-3.077-1.476l5.721-7.047 6.629 8.523zM29.333 20c0 2.205-1.795 4-4 4h-0.68l-8.933-11.485c-0.251-0.32-0.633-0.511-1.039-0.515h-0.015c-0.401 0-0.781 0.181-1.035 0.492l-5.632 6.935v-12.76c0-2.205 1.795-4 4-4h13.333c2.205 0 4 1.795 4 4z"></path>\n</svg>\n</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload&&this.gift.show_image_upload?this.selectImageOrUpload:this.selectImageForYourGift}</p></div>`}setPreview(t){this.uploader?.classList.add("has-bg");var i=document.querySelector(`#${this.hostId}.filepond-bg`)?document.querySelector(`#${this.hostId} .filepond-bg`):document.createElement("div");i.classList.add("filepond-bg"),i.classList.remove("s-hidden"),i.style.backgroundImage="url('"+t.url+"')",this.uploader?.querySelector(".filepond--root")?.appendChild(i),this.uploadedImage=t.url,this.gift&&this.gift.gift_images?.length&&this.setWrapperHeight(1,150,0)}removePreview(){this.uploader.classList.remove("has-bg");let t=document.querySelector(`#${this.hostId} .filepond-bg`);t.removeAttribute("style"),t.classList.add("s-hidden"),this.handleRemoveImage()}handleTextAreaChange(t){this.selectedText=t.target.value,this.customTextArea?.classList.remove("s-form-has-error")}clearError(t){if(this.errors?.[t]){const{[t]:i,...e}=this.errors;this.errors=e}}handleSenderName(t){this.senderName=t.target.value,this.clearError("sender_name")}handleReceiverName(t){this.receiverName=t.target.value,this.clearError("receiver.name")}resetCityState(){this.citySearchTimer&&(clearTimeout(this.citySearchTimer),this.citySearchTimer=null),++this.citySearchCounter,this.gift={...this.gift,cities:[]},this.displayedCities=[],this.receiverCity=void 0,this.selectedCity=null,this.citySearchQuery="",this.searchingCities=!1,this.enableCityAjaxSearch=!1}setInitialCities(t){this.gift={...this.gift,cities:t},this.displayedCities=t,this.enableCityAjaxSearch=t.length>=o.CITY_AJAX_THRESHOLD}async fetchCities(t=""){if(!this.selectedCountryId)return[];if(this.isKSA&&!this.selectedRegionId)return[];const i=["for_branch=0",`country_id=${this.selectedCountryId}`];this.isKSA&&this.selectedRegionId&&i.push(`region_id=${this.selectedRegionId}`),t?.trim()&&i.push(`query=${encodeURIComponent(t.trim())}`);const e=await salla.api.request(`shipping/cities?${i.join("&")}`);return e?.data??[]}async handleCountrySelected(t){const i=t?.id;this.selectedCountry=t??null,this.selectedCountryId=i,this.selectedCountryCode=t?.country_code,this.isKSA="SA"===t?.country_code,this.clearError("receiver.country"),this.regions=[],this.selectedRegionId=void 0,this.selectedRegion=null,this.resetCityState();const e=++this.locationRequestCounter;if(!i)return this.selectedCountryCode=void 0,this.isKSA=!1,void this.setWrapperHeight(2,0,0);if(this.isKSA){this.loadingRegions=!0,this.setWrapperHeight(2,0,0);try{const t=await salla.api.request(`shipping/countries/${i}/regions`);if(e!==this.locationRequestCounter)return;t&&t.data&&(this.regions=t.data)}catch(t){if(e!==this.locationRequestCounter)return;console.error("Error fetching regions:",t)}finally{e===this.locationRequestCounter&&(this.loadingRegions=!1,this.setWrapperHeight(2,0,0))}}else{this.loadingCities=!0,this.setWrapperHeight(2,0,0);try{const t=await this.fetchCities();if(e!==this.locationRequestCounter)return;this.setInitialCities(t)}catch(t){if(e!==this.locationRequestCounter)return;console.error("Error fetching cities:",t)}finally{e===this.locationRequestCounter&&(this.loadingCities=!1)}}}async handleRegionSelected(t){const i=t?.id;this.selectedRegion=t??null,this.selectedRegionId=i,this.clearError("receiver.region"),this.resetCityState();const e=++this.locationRequestCounter;if(i){this.loadingCities=!0;try{const t=await this.fetchCities();if(e!==this.locationRequestCounter)return;this.setInitialCities(t)}catch(t){if(e!==this.locationRequestCounter)return;console.error("Error fetching cities:",t)}finally{e===this.locationRequestCounter&&(this.loadingCities=!1,this.setWrapperHeight(2,0,0))}}}handleUploadImage(t){this.uploadedImage="object"!=typeof t?t:t&&t.url,this.gift&&this.gift.gift_images?.length&&this.setWrapperHeight(1,150,0)}handleRemoveImage(){this.uploadedImage="",this.gift&&this.gift.gift_images?.length&&this.setWrapperHeight(1,150,0)}handlePhoneInputChange(t){let i=t.detail;this.receiverMobile=i.number,this.receiverCountryCode=i.country_code,this.clearError("receiver.mobile")}handleDateTimePicker(t){this.deliveryDate=t.detail}getCalendarClasses(){return{"s-form-group":!0,"anime-item":!0,"s-gifting-calendar":!0,shown:this.showCalendar,hide:!this.showCalendar,"s-form-has-error":!!this.errors&&this.errors.deliver_at}}async submitForm(){const t=document.querySelector("#donating-amount")?.value;if(this.calendarFormGroup.classList.remove("s-form-has-error"),this.errors&&(this.errors={},this.setWrapperHeight(2,150,0)),this.showCalendar&&!this.deliveryDate)return void this.calendarFormGroup.classList.add("s-form-has-error");const i=[{key:"sender_name",value:this.senderName,label:this.senderNameLabel},{key:"receiver.name",value:this.receiverName,label:this.receiverNameFieldLabel},{key:"receiver.mobile",value:this.receiverMobile,label:this.receiverMobileFieldLabel},...this.isPhysical()?[{key:"receiver.country",value:this.selectedCountryId,label:this.receiverCountryFieldLabel},...this.isKSA?[{key:"receiver.region",value:this.selectedRegionId,label:this.receiverRegionFieldLabel}]:[],{key:"receiver.city_id",value:this.receiverCity,label:this.receiverCityFieldLabel}]:[]],e={};if(i.forEach((({key:t,value:i,label:s})=>{i||(e[t]=salla.lang.get("common.errors.field_required",{attribute:s}))})),Object.keys(e).length)return this.errors=e,void this.setWrapperHeight(2,150,0);const s="custom"===this.selectedGiftTextOption,r={text:s?this.selectedText:void 0,text_id:!s&&this.selectedGiftTextOption?Number(this.selectedGiftTextOption):void 0,sender_name:this.senderName,quantity:this.quantity,deliver_at:this.showCalendar?this.deliveryDate:null,image_url:this.uploadedImage??this.selectedImage,donation_amount:t||null,receiver:{name:this.receiverName,mobile_country_code:this.receiverCountryCode,mobile:this.receiverMobile,...this.isPhysical()&&this.selectedCountryCode?{country_code:this.selectedCountryCode}:{},...this.isPhysical()&&this.selectedRegionId?{region_id:this.selectedRegionId}:{},...this.receiverCity&&this.isPhysical()?{city_id:this.receiverCity}:{}},has_apple_pay:salla.helpers.hasApplePay()};let a;this.productId&&this.formSelector&&(a=this.getFormDataFromForm()||new FormData,a=this.mergeObjectToFormData(r,a));const o=this.productId?()=>salla.product.addProductGiftToCart(this.productId,a,!0):()=>salla.cart.addCartGiftToCart(r,!0);return await o().then((()=>this.modal.close())).catch((t=>{t.response&&422==t.response.status?this.errors=t.response.data.error.fields:console.log(t),this.setWrapperHeight(2,150,0)}))}step2ItemClass(t=""){const i="anime-item"+(this.step2Animated?"":" opacity-0");return t?`${t} ${i}`:i}generateClass(){return{"s-gifting-widget":!0,"s-gifting-widget-vertical":!!this.vertical,"s-gifting-widget-horizontal":!this.vertical}}async handleGiftButtonClick(){if(this.productId&&this.formSelector){const t=document.querySelector(this.formSelector);if(!t)return void console.error("SallaGifting:: Form not found in the document!");if(!(t instanceof HTMLFormElement))return void console.error("SallaGifting:: The specified selector does not correspond to a form tag!");if(!t.reportValidity())return console.error("SallaGifting:: Form is not valid!"),void salla.error(salla.lang.get("common.messages.required_fields"))}const t=document.querySelector(`salla-product-options[product-id="${this.productId}"]`);!t||await t.reportValidity()?this.open():salla.error(salla.lang.get("common.messages.required_fields"))}render(){return[i("div",{key:"3795180f3f719218220086c66f6bfbe6e57dc1d4"},i("salla-list-tile",{key:"cb9fd3e10b02bb429b25c028fcd2d328e73eab6e",class:this.generateClass()},i("div",{key:"cca448eae1144b0606bf8f07844974cd7f966236",slot:"title"},this.vertical?i("span",{innerHTML:a}):"",i("h3",{key:"c33210bdf1a72cdf0151138ce2949fc462efaf94"},this.widgetTitle?this.widgetTitle:this.sectionTitle)),i("div",{key:"007fc138265e6ab82dbdfab8169baa407b111e60",slot:"subtitle"},i("div",{key:"89de9cc780511609d294f67a3d639a0305300b17"},this.widgetSubtitle?this.widgetSubtitle:this.sectionSubtitle)),i("div",{key:"ea647e47079ab8e57580675f485bc99c2b213cd4",slot:"action"},i("salla-button",{key:"e87bcc03e5ab02204ca9f1d590421cae13282269",color:"primary",fill:"outline",width:"wide",class:"s-gifting-widget-action",onClick:()=>this.handleGiftButtonClick()},i("slot",{key:"ce294391f8c18e345ec2117a15e2942dd00790fc",name:"widget-btn-content"},i("div",{key:"7106257d9f44b869fcd3933ae8a1d2a50f4486dd",class:"s-gifting-widget-action-content"},i("span",{key:"305822ae865b6da9275ced4600933d83d42e54e7",innerHTML:a})," ",i("span",{key:"13f2d03213e1fea9fe9911a94259b89085406ab3"},this.sectionBtnText)))))),i("salla-modal",{key:"b55185fbd34776043661ca6f15a739e34e98e0ef",id:this.hostId,isLoading:!0,class:"s-gifting-modal",width:"sm",ref:t=>this.modal=t},i("div",{key:"9f59cea6e2835d80e24bc269b78a5bc47b354f6a",slot:"loading"},i("div",{key:"3f74f3384be120a0733e921de696d2beeccd49ce",class:"s-gifting-skeleton"},i("div",{key:"e3ffb5b8d712bc391ad6b4190556ac870e37db0c",class:"s-gifting-modal-header"},i("salla-skeleton",{key:"b9b154ab445516fa1fae66cc458dd68114024d9d",type:"circle",height:"5rem",width:"5rem"}),i("h2",{key:"1ecf5c6ea1ebeccbd6ed7f259045647148863826",class:"s-gifting-modal-title"},i("div",{key:"165d927a3bcaf47dd5c7657db8543ad02b47dc44",class:"s-gifting-modal-badge-wrapper"},i("salla-skeleton",{key:"cba1667fa446566c5bc862c206313d8f48a0991e",height:"15px",width:"150px"})))),i("div",{key:"f56f8e8820f789ca117a0e19cf660bc4d836ec6a",class:"s-gifting-skeleton-content"},i("salla-skeleton",{key:"74b8cec4be6e18ec8a1b340d8fed0b2d136bb1d3",height:"10px",width:"150px"}),i("salla-skeleton",{key:"5c615a0c0eb72908e601c2cfd28fe12a6391ef80",height:"230px"}),i("salla-skeleton",{key:"5c432b6e3f8c70574e1d05d26f57443ff5da45fe",height:"10px",width:"150px"}),i("salla-skeleton",{key:"7f5d7ec5cf3ef50f945e2a57363ac215e41f306b",height:"30px"}),i("salla-skeleton",{key:"47c0e823643dc9c2d4908dde353adf5b0e4355ad",height:"40px"})))),i("slot",{key:"3ad3a57a07cb8182e5cd86783ba19c8ae8f34d3b",name:"header"}),this.hasError?i("salla-placeholder",{alignment:"center"},i("span",{slot:"title"},this.errorMessage||salla.lang.get("common.errors.empty_results")),i("span",{slot:"description"}," ")):[i("div",{class:"s-gifting-modal-header"},i("span",{class:"s-gifting-modal-icon"},i("span",{innerHTML:a})),i("h2",{class:"s-gifting-modal-title"},i("div",{class:"s-gifting-modal-badge-wrapper"},!this.skipStep1()&&i("div",{class:"s-gifting-modal-badge"},i("span",null,i("span",null,this.currentStep),"/2")),i("span",null,this.giftDetails)))),i("div",{class:"s-gifting-steps-wrapper "+this.parentClass,ref:t=>this.stepsWrapper=t},!this.skipStep1()&&i("div",{class:"s-gifting-step-one gift-step-1",ref:t=>this.step1Elems=t},this.gift&&this.gift.show_images&&i("div",{class:"s-gifting-modal-uploader-title anime-item"},this.selectImageForYourGift),this.gift&&this.gift.show_images&&i("div",{class:"s-gifting-image-section"},i("div",{class:`s-gifting-modal-uploader anime-item ${this.disableClass}`,ref:t=>this.uploader=t},i("span",{class:"s-gifting-remove-preview pointer-events-auto",onClick:()=>this.removePreview(),innerHTML:r}),this.selectImageOrUpload&&this.gift&&i("salla-file-upload",{"instant-upload":!0,name:"image_url",url:salla.url.api(salla.product.api.getUrl("giftImage")),onUploaded:t=>this.handleUploadImage(t.detail),labelIdle:this.getFilepondPlaceholder(),onRemoved:()=>this.handleRemoveImage()})),i("div",{class:"anime-item"},!this.uploadedImage&&this.gift&&this.gift.gift_images&&this.gift.gift_images.length>0?i("salla-slider",{id:"gifting-slider",loop:!1,"controls-outer":!0,class:"s-gifting-slider",type:"carousel"},i("div",{slot:"items"},this.gift&&this.gift.gift_images?this.gift?.gift_images.map((t=>i("a",{class:"s-gifting-clickable s-gifting-image",onClick:()=>this.setPreview(t)},i("img",{src:t.url,alt:`${t.id}`})))):"")):"")),this.gift&&this.gift.show_texts?i("div",{class:"anime-item"},i("div",{class:"s-gifting-modal-uploader-title s-gifting-text-title"},this.giftText),i("div",{class:"s-form-group s-gifting-selectText",ref:t=>this.textSelect=t},i("select",{id:"gift-text-selection",name:"gift-text-selection",class:"s-form-control s-gifting-select",onChange:t=>this.toggleGiftText(t)},i("option",{"data-id":null,selected:!this.selectedGiftTextOption},this.selectGiftMessage),this.gift&&this.gift.gift_texts?this.gift?.gift_texts.map((t=>i("option",{"data-id":t.id,value:t.text,key:t.id,selected:String(this.selectedGiftTextOption)===String(t.id)},t.text))):"",this.gift&&this.gift.show_custom_text?i("option",{"data-id":"custom",selected:"custom"===this.selectedGiftTextOption},this.giftCustomText):null)),i("div",{class:this.showGiftText&&this.gift&&this.gift.show_custom_text?"s-form-group s-gifting-textarea shown":"s-form-group s-gifting-textarea hide",ref:t=>this.customTextArea=t},i("label",{htmlFor:"gift-custom-text",class:"s-form-label"},this.giftCustomText),i("div",{class:"mt-1"},i("textarea",{onInput:t=>this.handleTextAreaChange(t),rows:4,ref:t=>this.textArea=t,name:"gift-custom-text",id:"gift-custom-text",class:"s-form-control"})))):null,i("div",{class:"anime-item"},i("salla-button",{color:"primary",width:"wide",onClick:()=>this.goToStep2(!!this.gift?.show_texts)},i("span",null,this.nextStep)))),i("div",{class:"s-gifting-step-two gift-step-2",style:this.skipStep1()?{opacity:"1",transform:"translateX(0)",position:"relative"}:void 0,ref:t=>this.step2Elems=t},i("div",{class:this.step2ItemClass(this.errors?.sender_name?"s-form-group s-form-has-error":"s-form-group")},i("label",{htmlFor:"sender_name",class:"s-form-label"},this.senderNameLabel),i("input",{type:"text",class:"s-form-control",name:"sender_name",id:"sender_name",value:this.senderName,onInput:t=>this.handleSenderName(t),placeholder:""}),this.errors&&this.errors.sender_name?i("span",{class:"s-gifting-error"},this.errors.sender_name):""),i("div",{class:this.step2ItemClass(this.errors?.["receiver.name"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{htmlFor:"receiver_name",class:"s-form-label"},this.receiverNameFieldLabel),i("input",{type:"text",class:"s-form-control",name:"receiver_name",id:"receiver_name",value:"",onInput:t=>this.handleReceiverName(t),placeholder:""}),this.errors&&this.errors["receiver.name"]?i("span",{class:"s-gifting-error"},this.errors["receiver.name"]):""),i("div",{class:this.step2ItemClass(this.errors?.["receiver.mobile"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{class:"s-form-label"},this.receiverMobileFieldLabel),i("salla-tel-input",{class:"s-gifting-tel-input",phone:this.receiverMobile,countryCode:this.receiverCountryCode,onPhoneEntered:t=>this.handlePhoneInputChange(t)}),this.errors&&this.errors["receiver.mobile"]?i("span",{class:"s-gifting-error"},this.errors["receiver.mobile"]):""),this.isPhysical()&&i("div",{class:this.step2ItemClass(this.errors?.["receiver.country"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{class:"s-form-label",htmlFor:`${this.hostId}-country`},this.receiverCountryFieldLabel),i("salla-searchable-dropdown",{placeholder:this.selectCountry,items:this.gift?.countries??[],selectedItem:this.selectedCountry,disabled:!this.gift?.countries?.length,required:!0,inputId:`${this.hostId}-country`,searchable:!1,keepParentScroll:!0,onItemSelected:t=>this.handleCountrySelected(t.detail),onDropdownClosed:()=>this.handleCountryDropdownClosed()}),this.errors&&this.errors["receiver.country"]?i("span",{class:"s-gifting-error"},this.errors["receiver.country"]):""),this.isPhysical()&&this.isKSA&&i("div",{class:this.step2ItemClass(this.errors?.["receiver.region"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{class:"s-form-label",htmlFor:`${this.hostId}-region`},this.receiverRegionFieldLabel),i("salla-searchable-dropdown",{placeholder:this.selectRegion,items:this.regions??[],selectedItem:this.selectedRegion,loading:this.loadingRegions,disabled:this.loadingRegions||!this.regions?.length,required:!0,inputId:`${this.hostId}-region`,searchable:!1,keepParentScroll:!0,onItemSelected:t=>this.handleRegionSelected(t.detail),onDropdownClosed:()=>this.handleRegionDropdownClosed()}),this.errors&&this.errors["receiver.region"]?i("span",{class:"s-gifting-error"},this.errors["receiver.region"]):""),this.isPhysical()&&i("div",{class:this.step2ItemClass(this.errors?.["receiver.city_id"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{class:"s-form-label",htmlFor:`${this.hostId}-city`},this.receiverCityFieldLabel),i("salla-searchable-dropdown",{placeholder:this.selectCity,items:this.displayedCities,selectedItem:this.selectedCity,loading:this.loadingCities,searching:this.searchingCities,disabled:this.loadingCities||this.isKSA&&!this.selectedRegionId,required:!0,inputId:`${this.hostId}-city`,searchQuery:this.citySearchQuery,clientSearch:!this.enableCityAjaxSearch,dropUp:!0,keepParentScroll:!0,onItemSelected:t=>this.handleCitySelected(t.detail),onSearchInput:t=>this.handleCitySearch(t.detail),onDropdownClosed:()=>this.handleCityDropdownClosed()}),this.errors&&this.errors["receiver.city_id"]?i("span",{class:"s-gifting-error"},this.errors["receiver.city_id"]):""),this.isPhysical()&&this.cityNoticeText()&&i("div",{class:this.step2ItemClass("s-gifting-info")},i("span",{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>alert</title>\n<path d="M16 13.333c-0.736 0-1.333 0.597-1.333 1.333v8c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-8c0-0.736-0.597-1.333-1.333-1.333zM16 9.327c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM27.313 4.687c-6.237-6.237-16.389-6.239-22.628 0-6.237 6.239-6.237 16.389 0 22.628 3.119 3.119 7.216 4.679 11.313 4.679s8.195-1.559 11.313-4.679c6.24-6.239 6.24-16.391 0.001-22.628zM25.428 25.428c-5.199 5.197-13.657 5.197-18.857 0-5.197-5.199-5.197-13.659 0-18.857 5.199-5.197 13.659-5.197 18.857 0 5.199 5.2 5.199 13.659 0 18.857z"></path>\n</svg>\n'}),i("span",null,this.cityNoticeText())),!this.isPhysical()&&i("div",{class:this.step2ItemClass()},i("label",{class:"s-gifting-schedule s-gifting-clickable",htmlFor:`schedule-${this.hostId}`},i("input",{type:"checkbox",name:"schedule",id:`schedule-${this.hostId}`,onChange:()=>this.toggleCalendar(),class:"s-checkbox"}),i("span",{class:"s-form-label"}," ",this.sendLater," "))),i("div",{class:this.getCalendarClasses(),ref:t=>this.calendarFormGroup=t},i("label",{class:"s-form-label"},this.selectSendDateAndTime),i("salla-datetime-picker",{value:this.deliveryDate,placeholder:this.selectSendDateAndTime,"enable-time":!0,"date-format":"Y-m-d h:i K",onPicked:t=>this.handleDateTimePicker(t)}),i("span",{class:"s-gifting-calendar-hint"},this.canNotEditOrderAfterSelectDate)),i("div",{class:this.step2ItemClass("s-gifting-step-two-footer")},!this.skipStep1()&&i("a",{href:"#!",innerHTML:s,onClick:t=>this.goToStep1(t)}),i("salla-button",{onClick:()=>this.submitForm(),color:"primary",width:"wide"},i("span",null,this.sendGift)))))],i("slot",{key:"4b5e340be26e46c09508d192207fa6af9ec0cc44",name:"footer"})))]}};o.CITY_AJAX_THRESHOLD=400,o.CITY_SEARCH_DEBOUNCE_MS=100,o.style='/*!twlt*/.s-gifting-steps-wrapper{transition:height 0.8s cubic-bezier(0.55, 0, 0.1, 1) 0s}.s-gifting-select{background-image:url("data:image/svg+xml;utf8,<svg version=\'1.1\' fill=\'gray\' xmlns=\'http://www.w3.org/2000/svg\' width=\'32\' height=\'32\' viewBox=\'0 0 32 32\'><title>keyboard_arrow_down</title><path d=\'M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z\'></path></svg>");background-size:24px;background-repeat:no-repeat;background-position:99%;appearance:none}[dir=rtl] .s-gifting-select{background-position:5px}.s-gifting-widget-vertical .s-list-tile-item [slot=title]{display:flex;align-items:center;gap:1.5rem}.s-gifting-widget-vertical .s-list-tile-item-content{width:100%}.s-gifting-modal .s-searchable-dropdown-trigger{border-color:#d1d5db}.s-gifting-modal .s-searchable-dropdown-trigger:hover:not(.s-searchable-dropdown-trigger--disabled){border-color:#d1d5db}.s-gifting-modal .s-searchable-dropdown-trigger--open,.s-gifting-modal .s-searchable-dropdown-trigger:focus{border-color:var(--color-primary, #00897b);box-shadow:0 0 0 1px var(--color-primary, #00897b)}.s-gifting-modal .s-searchable-dropdown-trigger-placeholder{color:#000}.s-gifting-modal .s-gifting-image-section{margin-bottom:1.5rem}.s-gifting-modal .s-gifting-slider{margin-bottom:0.5rem}.s-gifting-modal .s-gifting-image{display:block}.s-gifting-modal .s-gifting-image img{display:block;width:auto;height:100px;object-fit:contain}.s-gifting-modal .s-gifting-image-section+.anime-item .s-gifting-text-title{margin-top:1rem}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.static{position:static}.fixed{position:fixed}.relative{position:relative}.mt-1{margin-top:0.25rem}.inline{display:inline}.hidden{display:none}.grow{flex-grow:1}.transform{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))}.resize{resize:both}.opacity-0{opacity:0}.outline{outline-style:solid}.transition{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:150ms}.s-hidden{display:none}.has-error .s-form-label{color:#ff443a}.has-error .s-form-control,.has-error .s-tel-input-control,.has-error .s-datetime-picker-input{border-color:#ff443a;color:#ff443a}.s-hidden{display:none}.s-form-control{display:block;width:100%;border-radius:var(--s-radius, 0.25rem);border-width:1px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-form-control:focus{border-color:var(--color-primary);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.s-form-label{margin-bottom:0.25rem;display:block;font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-form-group{margin-top:0.75rem;margin-bottom:0.75rem}.s-checkbox{cursor:pointer;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));appearance:none;background-color:#fff;margin:0;width:18px;height:18px;border-width:1px;border-radius:4px;display:grid;place-content:center}.s-checkbox:before{width:10px;height:10px;clip-path:polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);transform:scale(0);transform-origin:bottom left;transition:120ms transform ease-in-out;box-shadow:inset 1em 1em #444;background-color:#444}.s-checkbox:checked:before{transform:scale(1)}.s-checkbox::before{--tw-content:\'\';content:var(--tw-content)}.s-form-has-error .s-form-label{color:#ff443a}.s-form-has-error .s-form-control,.s-form-has-error .s-tel-input-control,.s-form-has-error .s-datetime-picker-input{border-color:#ff443a;color:#ff443a}.s-gifting-widget .s-list-tile-item-icon{display:none}.s-gifting-widget-vertical .s-list-tile-item-icon{display:block}.s-gifting-widget-vertical .s-list-tile-item-title svg{fill:var(--color-primary)}.s-gifting-widget-vertical .s-list-tile-item-subtitle{padding-right:3.5rem;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-gifting-widget-vertical .s-list-tile-item{flex-wrap:wrap;padding:0px}@media (min-width: 1024px){.s-gifting-widget-vertical .s-list-tile-item-action{flex:1 1 0%}}.s-gifting-widget-vertical .widget-icon{--tw-translate-y:0.625rem;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-size:1.875rem;line-height:2.25rem;color:var(--color-primary)}.s-gifting-widget .s-button-text{display:flex}.s-gifting-widget .s-list-tile-item{flex-direction:column;justify-content:space-between;gap:1rem;border-radius:0.75rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:1.25rem;text-align:center}@media (min-width: 768px){.s-gifting-widget .s-list-tile-item{text-align:left}}@media (min-width: 1024px){.s-gifting-widget .s-list-tile-item{flex-direction:row}}@media (min-width: 768px){.s-gifting-widget .s-list-tile-item:where([dir="rtl"],[dir="rtl"] *){text-align:right}}.s-gifting-widget-horizontal .s-gifting-widget-action button{padding-left:2rem;padding-right:2rem;font-weight:400}.s-gifting-info{display:flex;align-items:center;gap:0.5rem;border-radius:0.5rem;--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));padding:1rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.s-gifting-info svg{height:1.25rem;width:1.25rem;fill:#1d4ed8}.s-gifting-error{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-gifting-info span{font-size:0.75rem;line-height:1rem}.s-gifting-widget-action-content{display:flex;align-items:center}.s-gifting-widget-action-content svg{margin-left:0.5rem;margin-right:0.5rem}.s-gifting-modal-header{margin-bottom:1.25rem;display:flex;flex-direction:column;align-items:center;justify-content:center}.s-gifting-modal .s-modal-header{display:block}.s-gifting-modal .s-modal-body{position:relative !important;left:unset !important;bottom:unset !important;padding-bottom:2rem}@media (min-width: 640px){.s-gifting-modal .s-modal-body{padding-bottom:1.5rem}}.s-gifting-modal-icon{margin-bottom:1.25rem;display:flex;height:5rem;width:5rem;flex-direction:row;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));font-size:1.875rem;line-height:2.25rem}.s-gifting-modal-title{display:flex;width:100%;align-items:center;justify-content:space-between}.s-gifting-modal-title::before{display:block;height:1px;flex:1 1 auto;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-gifting-modal-title::after{display:block;height:1px;flex:1 1 auto;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-gifting-modal-badge-wrapper{display:flex;align-items:center;padding-left:0.75rem;padding-right:0.75rem}.s-gifting-modal-badge{margin-right:0.5rem;border-radius:0.5rem;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));padding-left:0.5rem;padding-right:0.5rem;padding-top:0.25rem;padding-bottom:0.25rem;font-size:0.875rem;line-height:1.25rem}.s-gifting-modal-badge:where([dir="rtl"],[dir="rtl"] *){margin-right:0px;margin-left:0.5rem}.s-gifting-modal-uploader.has-bg{position:relative}.s-gifting-modal-uploader.has-bg .s-gifting-remove-preview{pointer-events:auto;--tw-scale-x:1;--tw-scale-y:1;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));opacity:1}.s-gifting-modal-uploader-title{margin-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem}.s-gifting-steps-wrapper{position:relative}.s-gifting-steps-wrapper .s-button-wrap{pointer-events:auto !important}.is-current-step-2 .gift-step-1,.is-current-step-1 .gift-step-2{pointer-events:none;z-index:-1}.s-gifting-step-one{padding-top:1.25rem}.s-gifting-step-two{position:absolute;top:0px;left:0px;margin-left:auto;margin-right:auto;display:flex;width:100%;--tw-translate-x:-105%;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));flex-direction:column;opacity:0}.s-gifting-step-one .swiper-wrapper{height:100px}.s-gifting-step-one .swiper-slide{width:auto !important}.s-gifting-step-one .filepond--list-scroller{overflow-y:hidden}.s-gifting-step-one .swiper-wrapper img{border-radius:0.375rem;object-fit:cover}.s-gifting-step-one .filepond--root{height:230px}.s-gifting-step-one .filepond--list{left:0px !important;height:100% !important}.s-gifting-step-one .filepond-bg{position:absolute;top:0px;z-index:10;height:100%;width:100%;border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1));background-size:cover}.s-gifting-step-one .s-slider-button-next{top:35% !important}.s-gifting-step-one .s-slider-button-next button{height:35px;width:35px;--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px 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-gifting-step-one .s-slider-button-prev{top:35% !important}.s-gifting-step-one .s-slider-button-prev button{height:35px;width:35px;--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px 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-gifting-tel-input .s-tel-input-control{--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.s-gifting-tel-input .s-tel-input-error-msg{display:none}.s-gifting-step-two-footer{margin-top:1.25rem;display:flex;flex-direction:row;align-items:center;justify-content:center}.s-gifting-step-two-footer>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.625rem * var(--tw-space-x-reverse));margin-left:calc(0.625rem * calc(1 - var(--tw-space-x-reverse)))}.s-gifting-step-two-footer:where([dir="rtl"],[dir="rtl"] *){flex-direction:row-reverse}.s-gifting-step-two-footer a{border-radius:0.375rem;border-width:1px;border-color:var(--color-primary);fill:var(--color-primary);padding-top:8px;padding-bottom:8px;padding-left:25px;padding-right:25px}.s-gifting-step-two-footer a svg{height:1.25rem;width:1.25rem}.s-gifting-step-two .s-form-group.s-form-has-error .s-tel-input-control{--tw-border-opacity:1 !important;border-color:rgb(255 68 58 / var(--tw-border-opacity, 1)) !important}.s-gifting-selectText{margin-bottom:20px !important}.s-gifting-schedule .s-form-label{margin-bottom:0px !important}.s-gifting-schedule{margin-bottom:0.5rem;display:flex;align-items:center;justify-content:flex-start}.s-gifting-schedule>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.375rem * var(--tw-space-x-reverse));margin-left:calc(0.375rem * calc(1 - var(--tw-space-x-reverse)))}.s-gifting-schedule:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-gifting-clickable{cursor:pointer}.s-gifting-remove-preview{pointer-events:none;position:absolute;top:-7px;left:-7px;z-index:10;display:flex;height:1.25rem;width:1.25rem;--tw-scale-x:0;--tw-scale-y:0;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));cursor:pointer;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1));text-align:center;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));opacity:0;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-gifting-remove-preview:where([dir="rtl"],[dir="rtl"] *){left:unset;right:-7px}.s-gifting-remove-preview svg{height:100%;width:15px;fill:#fff}.s-gifting-textarea{transition-property:all;transition-duration:200ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.s-gifting-calendar-hint{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.s-gifting-calendar.shown{margin-top:0.75rem;height:75px;opacity:1}.s-gifting-textarea.shown{height:122px;opacity:1}.s-gifting-calendar.hide{pointer-events:none;visibility:hidden;margin:0px;height:0px;opacity:0}.s-gifting-textarea.hide{pointer-events:none;visibility:hidden;margin:0px;height:0px;opacity:0}.s-gifting-filepond-placeholder-icon svg{margin-top:12px;margin-bottom:12px;margin-left:auto;margin-right:auto;height:4rem;width:3rem;fill:#e5e7eb}.s-gifting-filepond-placeholder-text{margin-left:auto;margin-right:auto;width:65%;min-width:18rem;font-size:0.75rem !important;line-height:1rem !important;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));margin-top:0.75rem;margin-bottom:0.75rem;font-family:var(--font-main), -apple-system, BlinkMacSystemFont}.s-gifting-skeleton-content salla-skeleton:nth-child(1){margin-bottom:0.75rem}.s-gifting-skeleton-content salla-skeleton:nth-child(2){margin-bottom:1.25rem}.s-gifting-skeleton-content salla-skeleton:nth-child(3){margin-bottom:0.75rem}.s-gifting-skeleton-content salla-skeleton:nth-child(4){margin-bottom:1.25rem}.s-gifting-skeleton .s-gifting-modal-header salla-skeleton{margin-bottom:1.25rem}.s-gifting-skeleton .s-gifting-modal-title{margin-bottom:1.25rem}.s-gifting-image{margin-left:5px;margin-right:5px}';export{o as salla_gifting}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as a,h as e,H as s,c,a as d}from"./p-
|
|
4
|
+
import{r as a,h as e,H as s,c,a as d}from"./p-B64o_70M.js";import{p as t,m as o}from"./p-DfeagqF1.js";const i=class{constructor(e){a(this,e)}render(){return e(s,{key:"6407cbdb46897f683d1339287bcd0dc0df3dd409",class:"s-accordion-body-wrapper"},e("slot",{key:"ca050dff0df1dbee3d42a35582386829390dbdd3"}))}};i.style="";const r=class{constructor(e){a(this,e),this.accordionToggle=c(this,"accordionToggle"),this.collapsible=!1,this.collapsed=!0}emitCollapsePanel(){this.accordionToggle.emit({payload:{collapsed:this.collapsed}})}toggleCollapse(){this.collapsible&&(this.collapsed=!this.collapsed,this.host.parentElement?.setAttribute("data-collapsed",this.collapsed.toString()),this.host.parentElement?.querySelector("salla-accordion-body")?.setAttribute("data-collapsed",this.collapsed.toString()),this.emitCollapsePanel())}render(){return e(s,{key:"8fea8adefb7bd0b6aa4d88be25cb4e3f62bd4b0c","data-collapsed":this.collapsed.toString(),onClick:()=>this.toggleCollapse(),class:"s-accordion-head-wrapper"},e("div",{key:"d64952e2ec87c3f4de27f85800a0659b8cfbe08b",class:"s-accordion-head-wrapper-start"},e("slot",{key:"876bb377bef979afdb3b88e35d66ebe95e90ada8",name:"title"}),e("slot",{key:"b2a81aa92c0032098dd271931933679815660e6d",name:"progress"}),e("slot",{key:"9df2e816a0308cdd632bf13a7f16b553b5e877c2",name:"html"})),(this.collapsible||this.host.querySelector('[slot="note"]'))&&e("div",{key:"06f75d18708331176cdb1c80fd67dae352bd0550",class:"s-accordion-head-wrapper-end"},e("slot",{key:"04c7b9f174b6fff7aed4b1a045f160c4b11bbf55",name:"note"}),this.collapsible&&e("button",{key:"311aa1946afea02eb64b1c8e15c7e2fe97c76ecf",class:{"s-accordion-head-wrapper-toggle":!0,active:!this.collapsed},onClick:a=>{a.stopPropagation(),this.toggleCollapse()}},e("span",{key:"9758c580c6ca64c88079a76c0775ec727e0c488f",class:"s-accordion-head-wrapper-toggle-icon",innerHTML:this.collapsed?t:o}))))}get host(){return d(this)}};r.style="";export{i as salla_accordion_body,r as salla_accordion_head}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as e,H as t}from"./p-RGVg6FYq.js";import{S as o}from"./p-BscTeWDc.js";var i;!function(s){s.DEFAULT="default",s.AVAILABILITY="availability"}(i||(i={}));const r=class{constructor(e){s(this,e),this.loadedScopes={[i.DEFAULT]:null,[i.AVAILABILITY]:null},this.translationLoaded=!1,this.mode=i.DEFAULT,this.scopes=[],this.originalScopesList=[],this.isOpenedBefore=salla.storage.get("branch-choosed-before"),this.hasError=!1,this.loading=!1,this.selection="optional",this.searchDisplayLimit=6,this.getFormTitle=()=>{if(this.originalScopesList?.length<2)return"";const s=salla.config.get("store.features")?.includes("multi-countries");return this.mode===i.DEFAULT?salla.lang.get(s?"blocks.scope.shopping_from_another_market":"blocks.scope.shopping_from_another_branch"):salla.lang.get("blocks.scope.search_for_availability_in_other_branches")},salla.event.on("scopes::open",(({mode:s=null,product_id:e=null}={})=>{this.open(s,e)})),salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}get isNativeApp(){return!!salla.mobile?.isSpaWebview?.()}async close(){return await(this.modal?.close())}async open(s=i.DEFAULT,e=null){return this.isNativeApp?(salla.log("SallaScope:: delegated open to native app"),void salla.mobile?.openScopes?.()):(this.hasError=!1,this.mode=[i.AVAILABILITY,i.DEFAULT].includes(s)?s:i.DEFAULT,this.loading=!this.loadedScopes[this.mode],this.setScopeValues([]),salla.log("SallaScope:: opened"),this.modal.open(),this.loading?await salla.api.withoutNotifier((()=>s==i.AVAILABILITY?salla.scope.getProductAvailability(e):salla.scope.get())).then((e=>{if(s==i.AVAILABILITY)return this.setScopeValues(this.loadedScopes[i.AVAILABILITY]=e.data);this.setScopeValues(this.loadedScopes[this.mode]=e.data.scopes)})).catch((s=>{console.log(s),this.hasError=!0})).finally((()=>{this.modal.stopLoading(),this.loading=!1})):(this.setScopeValues(this.loadedScopes[this.mode]),this.modal.stopLoading()))}async handleSubmit(){let s={id:this.current_scope.id};return this.changeBtn.load(),await salla.scope.change(s).then((()=>{salla.storage.set("branch-choosed-before",!0),salla.storage.set("scope",{type:this.current_scope.type,id:this.current_scope.id}),salla.cart.reset(),window.location.replace(salla.helpers.addParamToUrl("scope",this.current_scope.id))})).catch((s=>console.log(s))).finally((()=>{this.changeBtn.stop()}))}setScopeValues(s){this.scopes=s,this.originalScopesList=s,1==s?.length?(this.current_scope=s[0],this.selected_scope=s[0],this.scopes=[s[0]]):(this.current_scope=s?.find((s=>s.selected)),this.selected_scope=s?.find((s=>s.selected)))}handleSearchFieldTyping(s){let e=s.target.value.toLocaleLowerCase();this.scopes=e?this.originalScopesList.filter((s=>s.name.toLowerCase().includes(e))):this.originalScopesList}handleScopeSelection(s){this.current_scope=this.scopes?.find((e=>e.id==s.target.value))}placeholderContent(){return e("salla-placeholder",{alignment:"center",class:"s-scopes-placeholder"},e("span",{slot:"title"},salla.lang.get("blocks.scope.branch_looking_for_not_found")),e("span",{slot:"description"},salla.lang.get("blocks.scope.our_services_not_available_in_this_branch")))}defaultContent(){return[e("div",{class:"s-scopes-container s-scrollbar"},this.scopes?.map((s=>e("div",{class:"s-scopes-input-wrap","data-selection":this.selection},e("input",{id:`${this.selection} + '_scope_' + ${s.id}`,name:"lang",type:"radio",value:s.id,onChange:s=>this.handleScopeSelection(s),class:"s-scopes-input",checked:!!this.current_scope&&this.current_scope.id==s.id}),e("label",{htmlFor:`${this.selection} + '_scope_' + ${s.id}`,class:"s-scopes-label s-scopes-clickable"},e("span",null,s.name)))))),this.footerContent()]}availabilityContent(){return e("div",{class:"s-scopes-container"},this.scopes?.map((s=>e("div",{class:"s-scopes-input-wrap","data-selection":this.selection},e("h2",{class:{"s-scopes-label":!0,"s-scopes-clickable":this.mode===i.DEFAULT}},e("span",null,s.name)),e("h2",{style:{color:s?.availability?.color},class:`s-scopes-${s?.availability?.key}`},s?.availability?.label)))))}footerContent(){return e("div",{class:"s-scopes-footer"},e("slot",{name:"footer"},e("salla-button",{ref:s=>this.changeBtn=s,disabled:!this.current_scope,onClick:()=>this.handleSubmit(),class:"s-scopes-submit","loader-position":"center",width:"wide"},salla.lang.get("common.elements.confirm"))))}componentWillLoad(){return salla.onReady()}render(){return this.isNativeApp?null:e(t,null,e("salla-modal",{ref:s=>this.modal=s,isClosable:!(!this.isOpenedBefore&&"optional"!=this.selection),class:"s-scopes-modal",isLoading:this.loading,"has-skeleton":!0},this.loading?e("div",{slot:"loading"},e("div",{class:"s-scopes-skeleton"},e("salla-list-tile",{class:"s-scopes-header"},e("div",{slot:"icon",class:"s-scopes-header-icon"},e("salla-skeleton",{type:"circle"})),e("div",{slot:"title",class:"s-scopes-header-title mb-5"},e("salla-skeleton",{height:"15px",width:"50%"})),e("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},e("salla-skeleton",{height:"10px"}),e("salla-skeleton",{height:"10px",width:"75%"}))),e("div",{class:"s-scopes-skeleton-search"},e("salla-skeleton",{height:"10px",width:"50%"}),e("salla-skeleton",{height:"30px",width:"100%"})),e("div",{class:"s-scopes-skeleton-scopes"},e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"}),e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"}),e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"}),e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"})),e("div",{class:"s-scopes-skeleton-btn"},e("salla-skeleton",{height:"40px",width:"100%"})))):[e("salla-list-tile",{class:this.originalScopesList?.length?"s-scopes-header block":"s-hidden"},e("div",{slot:"icon",class:"s-scopes-header-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>store-alt</title>\n<path d="M6.667 24h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333zM31.86 10.071l-4-8c-0.227-0.452-0.688-0.737-1.193-0.737h-21.333c-0.505 0-0.967 0.285-1.193 0.737l-4 8c-0.092 0.184-0.14 0.389-0.14 0.596v18.667c0 0.737 0.597 1.333 1.333 1.333h29.333c0.736 0 1.333-0.596 1.333-1.333v-18.667c0-0.207-0.048-0.412-0.14-0.596zM6.157 4h19.685l3.333 6.667h-26.352zM24 28h-5.333v-9.333h5.333zM29.333 28h-2.667v-10.667c0-0.737-0.597-1.333-1.333-1.333h-8c-0.736 0-1.333 0.596-1.333 1.333v10.667h-13.333v-14.667h26.667zM6.667 18.667h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n'}),e("div",{slot:"title",class:"s-scopes-header-title"},salla.lang.get("blocks.scope.you_are_browse_store_from")),e("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},this.selected_scope?this.selected_scope.name:"")),e("div",{class:"s-scopes-wrap"},!!this.originalScopesList?.length&&e("h4",{class:"s-scopes-title"},this.getFormTitle()),this.originalScopesList?.length>this.searchDisplayLimit?e("div",{class:"s-scopes-search-wrapper"},e("div",{class:"s-scopes-search-icon",innerHTML:o}),e("input",{type:"text",class:"s-scopes-search-input",onInput:s=>this.handleSearchFieldTyping(s),enterkeyhint:"search",placeholder:salla.lang.get("blocks.scope.searching_for_a_branch")})):"",this.hasError||!this.originalScopesList?.length&&this.mode!==i.AVAILABILITY?this.placeholderContent():this.mode===i.DEFAULT?this.defaultContent():this.availabilityContent())]))}async componentDidLoad(){await Salla.hooks.registerComponent("salla-scopes",this),salla.config.isMobileApp()||this.isNativeApp||this.isOpenedBefore||"mandatory"!=this.selection||this.open()}};r.style='/*!twlt*/.s-scopes-availability-content{display:flex;justify-content:center;align-items:center}.s-scopes-placeholder{flex:0 0 85%}.mb-5{margin-bottom:1.25rem}.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-hidden{display:none}.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-hidden{display:none}.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-scopes-title{margin-bottom:0.75rem}.s-scopes-header{margin-bottom:0.5rem;display:block;text-align:center}.s-scopes-header-icon{margin:auto;display:flex;height:5rem;width:5rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(252 252 252 / var(--tw-bg-opacity, 1))}.s-scopes-header-icon svg{height:2rem;fill:var(--color-primary)}.s-scopes-header-title{font-size:1.125rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-scopes-header-subtitle{text-align:left;font-size:1.25rem;line-height:1.75rem}.s-scopes-header-subtitle:where([dir="rtl"],[dir="rtl"] *){text-align:right}.s-scopes-search-wrapper{position:relative;width:100%}.s-scopes-search-icon{pointer-events:none;position:absolute;top:0px;bottom:0px;left:0px;display:flex;align-items:center;padding-left:0.75rem}.s-scopes-search-icon:where([dir="rtl"],[dir="rtl"] *){left:auto;right:0px;padding-left:0px;padding-right:0.75rem}.s-scopes-search-icon svg{height:1.25rem;width:1.25rem;fill:#9ca3af}.s-scopes-search-input{display:block;width:100%;border-radius:var(--s-radius, 0.25rem);border-width:1px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));padding:0.625rem;padding-left:2.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-scopes-search-input:focus{--tw-ring-color:var(--color-primary)}.s-scopes-search-input:where([dir="rtl"],[dir="rtl"] *){padding-left:0px;padding-right:2.5rem}.s-scopes-input-wrap{margin-bottom:1.25rem;display:flex;align-items:center}.s-scopes-input-wrap:last-child{margin-bottom:0px}.s-scopes-input{height:1rem;width:1rem;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));color:var(--color-primary)}.s-scopes-input:focus{--tw-ring-color:var(--color-primary)}.s-scopes-input:where([dir="ltr"],[dir="ltr"] *){margin-right:0.75rem}.s-scopes-input:where([dir="rtl"],[dir="rtl"] *){margin-left:0.75rem}.s-scopes-label{display:flex;flex-grow:1;align-items:center;justify-content:space-between;font-size:1rem;line-height:1.5rem;font-weight:500;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-scopes-select{height:2.5rem;width:100%;appearance:none;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;font-size:0.875rem;line-height:1.25rem;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}.s-scopes-select:focus{border-color:var(--color-primary)}.s-scopes-container{margin-top:1.25rem;max-height:300px;overflow-y:auto;padding-left:0.5rem}.s-scopes-container:where([dir="rtl"],[dir="rtl"] *){padding-left:0px;padding-right:0.5rem}.s-scopes-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.s-scopes-is-closed{opacity:0.5}.s-scopes-closed-badge{--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-scopes-clickable{cursor:pointer}.s-scopes-submit{margin-top:1.5rem;height:auto}.s-scopes-color-red{--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-scopes-color-green{--tw-text-opacity:1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.s-scopes-color-gray{--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-scopes-hidden{display:none}.s-scopes-input-wrap.is-hidden-branch{display:none}.s-scopes-wrap{display:flex;max-height:350px;flex-direction:column}.s-scopes-wrap .s-placeholder-wrapper{display:flex;height:12rem;flex-direction:column;align-items:center;justify-content:center}.s-scopes-footer{margin-top:auto}.s-scopes-modal .s-modal-header{display:block !important}.s-scopes-skeleton .s-list-tile-item-content{display:block;width:100%}.s-scopes-skeleton .s-scopes-header-title>salla-skeleton{margin-top:0.75rem;margin-bottom:0.75rem;display:block}.s-scopes-skeleton .s-scopes-header-subtitle>salla-skeleton{margin-bottom:0.75rem;display:block}.s-scopes-skeleton .s-scopes-skeleton-scopes>salla-skeleton{margin-bottom:1.25rem;display:block}.s-scopes-skeleton .s-scopes-skeleton-search{margin-top:2rem;margin-bottom:2rem}.s-scopes-skeleton .s-scopes-skeleton-search>salla-skeleton{margin-bottom:0.75rem;display:block}.s-scopes-skeleton .s-list-tile-item-icon{margin-right:2rem}.s-scopes-skeleton .s-list-tile-item-icon:where([dir="rtl"],[dir="rtl"] *){margin-right:0px;margin-left:2rem}.s-scopes-skeleton-btn{margin-top:2rem}';export{r as salla_scopes}
|
|
4
|
+
import{r as s,h as e,H as t}from"./p-B64o_70M.js";import{S as o}from"./p-BscTeWDc.js";var i;!function(s){s.DEFAULT="default",s.AVAILABILITY="availability"}(i||(i={}));const r=class{constructor(e){s(this,e),this.loadedScopes={[i.DEFAULT]:null,[i.AVAILABILITY]:null},this.translationLoaded=!1,this.mode=i.DEFAULT,this.scopes=[],this.originalScopesList=[],this.isOpenedBefore=salla.storage.get("branch-choosed-before"),this.hasError=!1,this.loading=!1,this.selection="optional",this.searchDisplayLimit=6,this.getFormTitle=()=>{if(this.originalScopesList?.length<2)return"";const s=salla.config.get("store.features")?.includes("multi-countries");return this.mode===i.DEFAULT?salla.lang.get(s?"blocks.scope.shopping_from_another_market":"blocks.scope.shopping_from_another_branch"):salla.lang.get("blocks.scope.search_for_availability_in_other_branches")},salla.event.on("scopes::open",(({mode:s=null,product_id:e=null}={})=>{this.open(s,e)})),salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}get isNativeApp(){return!!salla.mobile?.isSpaWebview?.()}async close(){return await(this.modal?.close())}async open(s=i.DEFAULT,e=null){return this.isNativeApp?(salla.log("SallaScope:: delegated open to native app"),void salla.mobile?.openScopes?.()):(this.hasError=!1,this.mode=[i.AVAILABILITY,i.DEFAULT].includes(s)?s:i.DEFAULT,this.loading=!this.loadedScopes[this.mode],this.setScopeValues([]),salla.log("SallaScope:: opened"),this.modal.open(),this.loading?await salla.api.withoutNotifier((()=>s==i.AVAILABILITY?salla.scope.getProductAvailability(e):salla.scope.get())).then((e=>{if(s==i.AVAILABILITY)return this.setScopeValues(this.loadedScopes[i.AVAILABILITY]=e.data);this.setScopeValues(this.loadedScopes[this.mode]=e.data.scopes)})).catch((s=>{console.log(s),this.hasError=!0})).finally((()=>{this.modal.stopLoading(),this.loading=!1})):(this.setScopeValues(this.loadedScopes[this.mode]),this.modal.stopLoading()))}async handleSubmit(){let s={id:this.current_scope.id};return this.changeBtn.load(),await salla.scope.change(s).then((()=>{salla.storage.set("branch-choosed-before",!0),salla.storage.set("scope",{type:this.current_scope.type,id:this.current_scope.id}),salla.cart.reset(),window.location.replace(salla.helpers.addParamToUrl("scope",this.current_scope.id))})).catch((s=>console.log(s))).finally((()=>{this.changeBtn.stop()}))}setScopeValues(s){this.scopes=s,this.originalScopesList=s,1==s?.length?(this.current_scope=s[0],this.selected_scope=s[0],this.scopes=[s[0]]):(this.current_scope=s?.find((s=>s.selected)),this.selected_scope=s?.find((s=>s.selected)))}handleSearchFieldTyping(s){let e=s.target.value.toLocaleLowerCase();this.scopes=e?this.originalScopesList.filter((s=>s.name.toLowerCase().includes(e))):this.originalScopesList}handleScopeSelection(s){this.current_scope=this.scopes?.find((e=>e.id==s.target.value))}placeholderContent(){return e("salla-placeholder",{alignment:"center",class:"s-scopes-placeholder"},e("span",{slot:"title"},salla.lang.get("blocks.scope.branch_looking_for_not_found")),e("span",{slot:"description"},salla.lang.get("blocks.scope.our_services_not_available_in_this_branch")))}defaultContent(){return[e("div",{class:"s-scopes-container s-scrollbar"},this.scopes?.map((s=>e("div",{class:"s-scopes-input-wrap","data-selection":this.selection},e("input",{id:`${this.selection} + '_scope_' + ${s.id}`,name:"lang",type:"radio",value:s.id,onChange:s=>this.handleScopeSelection(s),class:"s-scopes-input",checked:!!this.current_scope&&this.current_scope.id==s.id}),e("label",{htmlFor:`${this.selection} + '_scope_' + ${s.id}`,class:"s-scopes-label s-scopes-clickable"},e("span",null,s.name)))))),this.footerContent()]}availabilityContent(){return e("div",{class:"s-scopes-container"},this.scopes?.map((s=>e("div",{class:"s-scopes-input-wrap","data-selection":this.selection},e("h2",{class:{"s-scopes-label":!0,"s-scopes-clickable":this.mode===i.DEFAULT}},e("span",null,s.name)),e("h2",{style:{color:s?.availability?.color},class:`s-scopes-${s?.availability?.key}`},s?.availability?.label)))))}footerContent(){return e("div",{class:"s-scopes-footer"},e("slot",{name:"footer"},e("salla-button",{ref:s=>this.changeBtn=s,disabled:!this.current_scope,onClick:()=>this.handleSubmit(),class:"s-scopes-submit","loader-position":"center",width:"wide"},salla.lang.get("common.elements.confirm"))))}componentWillLoad(){return salla.onReady()}render(){return this.isNativeApp?null:e(t,null,e("salla-modal",{ref:s=>this.modal=s,isClosable:!(!this.isOpenedBefore&&"optional"!=this.selection),class:"s-scopes-modal",isLoading:this.loading,"has-skeleton":!0},this.loading?e("div",{slot:"loading"},e("div",{class:"s-scopes-skeleton"},e("salla-list-tile",{class:"s-scopes-header"},e("div",{slot:"icon",class:"s-scopes-header-icon"},e("salla-skeleton",{type:"circle"})),e("div",{slot:"title",class:"s-scopes-header-title mb-5"},e("salla-skeleton",{height:"15px",width:"50%"})),e("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},e("salla-skeleton",{height:"10px"}),e("salla-skeleton",{height:"10px",width:"75%"}))),e("div",{class:"s-scopes-skeleton-search"},e("salla-skeleton",{height:"10px",width:"50%"}),e("salla-skeleton",{height:"30px",width:"100%"})),e("div",{class:"s-scopes-skeleton-scopes"},e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"}),e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"}),e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"}),e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"})),e("div",{class:"s-scopes-skeleton-btn"},e("salla-skeleton",{height:"40px",width:"100%"})))):[e("salla-list-tile",{class:this.originalScopesList?.length?"s-scopes-header block":"s-hidden"},e("div",{slot:"icon",class:"s-scopes-header-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>store-alt</title>\n<path d="M6.667 24h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333zM31.86 10.071l-4-8c-0.227-0.452-0.688-0.737-1.193-0.737h-21.333c-0.505 0-0.967 0.285-1.193 0.737l-4 8c-0.092 0.184-0.14 0.389-0.14 0.596v18.667c0 0.737 0.597 1.333 1.333 1.333h29.333c0.736 0 1.333-0.596 1.333-1.333v-18.667c0-0.207-0.048-0.412-0.14-0.596zM6.157 4h19.685l3.333 6.667h-26.352zM24 28h-5.333v-9.333h5.333zM29.333 28h-2.667v-10.667c0-0.737-0.597-1.333-1.333-1.333h-8c-0.736 0-1.333 0.596-1.333 1.333v10.667h-13.333v-14.667h26.667zM6.667 18.667h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n'}),e("div",{slot:"title",class:"s-scopes-header-title"},salla.lang.get("blocks.scope.you_are_browse_store_from")),e("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},this.selected_scope?this.selected_scope.name:"")),e("div",{class:"s-scopes-wrap"},!!this.originalScopesList?.length&&e("h4",{class:"s-scopes-title"},this.getFormTitle()),this.originalScopesList?.length>this.searchDisplayLimit?e("div",{class:"s-scopes-search-wrapper"},e("div",{class:"s-scopes-search-icon",innerHTML:o}),e("input",{type:"text",class:"s-scopes-search-input",onInput:s=>this.handleSearchFieldTyping(s),enterkeyhint:"search",placeholder:salla.lang.get("blocks.scope.searching_for_a_branch")})):"",this.hasError||!this.originalScopesList?.length&&this.mode!==i.AVAILABILITY?this.placeholderContent():this.mode===i.DEFAULT?this.defaultContent():this.availabilityContent())]))}async componentDidLoad(){await Salla.hooks.registerComponent("salla-scopes",this),salla.config.isMobileApp()||this.isNativeApp||this.isOpenedBefore||"mandatory"!=this.selection||this.open()}};r.style='/*!twlt*/.s-scopes-availability-content{display:flex;justify-content:center;align-items:center}.s-scopes-placeholder{flex:0 0 85%}.mb-5{margin-bottom:1.25rem}.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-hidden{display:none}.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-hidden{display:none}.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-scopes-title{margin-bottom:0.75rem}.s-scopes-header{margin-bottom:0.5rem;display:block;text-align:center}.s-scopes-header-icon{margin:auto;display:flex;height:5rem;width:5rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(252 252 252 / var(--tw-bg-opacity, 1))}.s-scopes-header-icon svg{height:2rem;fill:var(--color-primary)}.s-scopes-header-title{font-size:1.125rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-scopes-header-subtitle{text-align:left;font-size:1.25rem;line-height:1.75rem}.s-scopes-header-subtitle:where([dir="rtl"],[dir="rtl"] *){text-align:right}.s-scopes-search-wrapper{position:relative;width:100%}.s-scopes-search-icon{pointer-events:none;position:absolute;top:0px;bottom:0px;left:0px;display:flex;align-items:center;padding-left:0.75rem}.s-scopes-search-icon:where([dir="rtl"],[dir="rtl"] *){left:auto;right:0px;padding-left:0px;padding-right:0.75rem}.s-scopes-search-icon svg{height:1.25rem;width:1.25rem;fill:#9ca3af}.s-scopes-search-input{display:block;width:100%;border-radius:var(--s-radius, 0.25rem);border-width:1px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));padding:0.625rem;padding-left:2.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-scopes-search-input:focus{--tw-ring-color:var(--color-primary)}.s-scopes-search-input:where([dir="rtl"],[dir="rtl"] *){padding-left:0px;padding-right:2.5rem}.s-scopes-input-wrap{margin-bottom:1.25rem;display:flex;align-items:center}.s-scopes-input-wrap:last-child{margin-bottom:0px}.s-scopes-input{height:1rem;width:1rem;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));color:var(--color-primary)}.s-scopes-input:focus{--tw-ring-color:var(--color-primary)}.s-scopes-input:where([dir="ltr"],[dir="ltr"] *){margin-right:0.75rem}.s-scopes-input:where([dir="rtl"],[dir="rtl"] *){margin-left:0.75rem}.s-scopes-label{display:flex;flex-grow:1;align-items:center;justify-content:space-between;font-size:1rem;line-height:1.5rem;font-weight:500;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-scopes-select{height:2.5rem;width:100%;appearance:none;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;font-size:0.875rem;line-height:1.25rem;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}.s-scopes-select:focus{border-color:var(--color-primary)}.s-scopes-container{margin-top:1.25rem;max-height:300px;overflow-y:auto;padding-left:0.5rem}.s-scopes-container:where([dir="rtl"],[dir="rtl"] *){padding-left:0px;padding-right:0.5rem}.s-scopes-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.s-scopes-is-closed{opacity:0.5}.s-scopes-closed-badge{--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-scopes-clickable{cursor:pointer}.s-scopes-submit{margin-top:1.5rem;height:auto}.s-scopes-color-red{--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-scopes-color-green{--tw-text-opacity:1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.s-scopes-color-gray{--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-scopes-hidden{display:none}.s-scopes-input-wrap.is-hidden-branch{display:none}.s-scopes-wrap{display:flex;max-height:350px;flex-direction:column}.s-scopes-wrap .s-placeholder-wrapper{display:flex;height:12rem;flex-direction:column;align-items:center;justify-content:center}.s-scopes-footer{margin-top:auto}.s-scopes-modal .s-modal-header{display:block !important}.s-scopes-skeleton .s-list-tile-item-content{display:block;width:100%}.s-scopes-skeleton .s-scopes-header-title>salla-skeleton{margin-top:0.75rem;margin-bottom:0.75rem;display:block}.s-scopes-skeleton .s-scopes-header-subtitle>salla-skeleton{margin-bottom:0.75rem;display:block}.s-scopes-skeleton .s-scopes-skeleton-scopes>salla-skeleton{margin-bottom:1.25rem;display:block}.s-scopes-skeleton .s-scopes-skeleton-search{margin-top:2rem;margin-bottom:2rem}.s-scopes-skeleton .s-scopes-skeleton-search>salla-skeleton{margin-bottom:0.75rem;display:block}.s-scopes-skeleton .s-list-tile-item-icon{margin-right:2rem}.s-scopes-skeleton .s-list-tile-item-icon:where([dir="rtl"],[dir="rtl"] *){margin-right:0px;margin-left:2rem}.s-scopes-skeleton-btn{margin-top:2rem}';export{r as salla_scopes}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as a,H as e,a as r}from"./p-
|
|
4
|
+
import{r as t,h as a,H as e,a as r}from"./p-B64o_70M.js";const s=class{constructor(a){if(t(this,a),this.entity="product",this.specs=[],this.download=salla.lang.get("pages.thank_you.download"),this.entityId)try{return void(this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId))}catch(t){salla.log("Bad json passed via entityId prop")}}getValue(t){if("file"===t.type)return`<a href="${t.value}" class="text-primary" target="_blank"><span class="sicon-download"></span> ${this.download}</a>`;if("url"===t.type)return`<a href="${t.value}" class="text-blue-700 underline" target="_blank">${t.value}</a>`;if("date"===t.type){const a=new Date(t.value);return`${String(a.getDate()).padStart(2,"0")}/${String(a.getMonth()+1).padStart(2,"0")}/${a.getFullYear()}`}return t.value}async componentWillLoad(){if(await salla.onReady(),!salla.config.get("store.features")?.includes("custom-fields"))return salla.logger.error("feature custom-fields is not activated");if(this.entityId||!salla.url.is_page("product.single")&&!salla.url.is_page("product.showNewUrls")||(this.entityId=salla.config.get("page.id")),!this.entityId)return salla.logger.error("can't render salla-metadata without enity-id prop!");await salla.lang.onLoaded(),this.download=salla.lang.get("pages.thank_you.download");const t=await Salla.api.metadata.fetchValues(this.entity,this.entityId);this.specs=t.data[0]?.sections}render(){if(this.specs.length)return a(e,{class:"s-metadata-wrapper"},this.specs.map((t=>a("div",{class:"s-metadata-box"},a("div",{class:"s-metadata-box-header"},a("i",{class:"sicon-list"}),t.name),t.fields.map((t=>a("div",{class:"s-metadata-row"},a("p",{class:"s-metadata-row-name"},t.name),a("p",{class:"s-metadata-row-value",innerHTML:this.getValue(t)}))))))))}get host(){return r(this)}};s.style="/*!twlt*/.text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-primary{color:var(--color-primary)}.underline{text-decoration-line:underline}.s-metadata-box{margin-bottom:1.25rem;display:block;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1.25rem}.s-metadata-box-header{margin-bottom:0.75rem;display:flex;align-items:center;column-gap:0.5rem;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-bottom:0.75rem;font-size:1rem;line-height:1.5rem;font-weight:700}.s-metadata-row{margin-bottom:0.75rem;display:flex;flex-direction:row;justify-content:space-between;gap:0.5rem;line-height:1.25rem}.s-metadata-row:last-child{margin-bottom:0px}.s-metadata-row-name{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))}";export{s as salla_metadata}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as s,H as i,a as e}from"./p-
|
|
4
|
+
import{r as t,h as s,H as i,a as e}from"./p-B64o_70M.js";import{W as n}from"./p-CgR-T_ZS.js";import{M as a}from"./p-DmgxDvXL.js";const o=class{constructor(s){t(this,s),this.contacts=salla.config.get("store.contacts"),this.iconsList={mobile:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>iphone</title>\n<path d="M15.053 27.613c0.133 0.12 0.28 0.213 0.44 0.28s0.333 0.107 0.507 0.107c0.36 0 0.693-0.135 0.947-0.387 0.12-0.135 0.213-0.28 0.28-0.44 0.080-0.16 0.107-0.333 0.107-0.507 0-0.347-0.147-0.695-0.387-0.947-0.507-0.493-1.387-0.493-1.893 0-0.12 0.12-0.213 0.267-0.28 0.44-0.067 0.16-0.107 0.333-0.107 0.507s0.040 0.347 0.107 0.507 0.16 0.305 0.28 0.44zM24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.599 1.333-1.333 1.333h-16c-0.735 0-1.333-0.597-1.333-1.333v-4h18.667zM25.333 21.333h-18.667v-17.333c0-0.735 0.599-1.333 1.333-1.333h16c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',whatsapp:n,phone:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>\n</svg>\n',telegram:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>paper-plane-o</title>\n<path d="M31.5 0.482c0.375 0.268 0.554 0.696 0.482 1.143l-4.571 27.429c-0.054 0.339-0.268 0.625-0.571 0.804-0.161 0.089-0.357 0.143-0.554 0.143-0.143 0-0.286-0.036-0.429-0.089l-9.411-3.839-5.321 5.839c-0.214 0.25-0.518 0.375-0.839 0.375-0.143 0-0.286-0.018-0.411-0.071-0.446-0.179-0.732-0.607-0.732-1.071v-8.071l-8.429-3.446c-0.411-0.161-0.679-0.536-0.714-0.982-0.036-0.429 0.196-0.839 0.571-1.054l29.714-17.143c0.375-0.232 0.857-0.214 1.214 0.036zM25.393 27.25l3.946-23.625-25.607 14.768 6 2.446 15.411-11.411-8.536 14.232z"></path>\n</svg>\n',email:a},this.contactSlot=this.host.querySelector('[slot="contact"]')?.innerHTML||`<a href={link} class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>${!this.iconsOnly&&"<span class='unicode'>{value}</span>"}</a>`,salla.onReady((()=>{this.contacts=salla.config.get("store.contacts")})),salla.lang.onLoaded((()=>{this.contactsTitle=this.contactsTitle||salla.lang.get("blocks.footer.social")}))}getContactsArray(){return Object.entries(this.contacts).filter((([t,s])=>""!==s)).map((([t,s])=>({type:t,value:s})))}getContactLink(t){const s=this.contacts[t];switch(t){case"phone":case"mobile":return`tel:${s}`;case"whatsapp":const t=(s||"").toString().replace(/[^\d]/g,"");return t?`https://wa.me/${t}`:salla.url.get("whatsapp/send");case"email":return`mailto:${s}`;case"telegram":return s.startsWith("https://t.me/")?s:`https://t.me/${s}`;default:return s}}getContactIcon(t){return this.iconsList[t]}componentWillLoad(){return new Promise((t=>salla.onReady(t)))}render(){const t=this.getContactsArray();if(t&&0!=t.length)return this.isHeader?s(i,{class:"s-contacts s-contacts-header"},t.filter((t=>"phone"==t.type||"email"==t.type)).map(((t,i)=>s("a",{href:this.getContactLink(t.type),key:i,class:"s-contacts-topnav-link"},"email"===t.type?t.value:[s("span",null,this.contactsTitle,": "),s("a",{class:"unicode",href:this.iconsList[t.type]},t.value)])))):s(i,{class:"s-contacts"},!this.hideTitle&&s("h3",{class:"s-contacts-title"},this.contactsTitle),s("div",{class:{"s-contacts-list":!0,"s-contacts-list-horizontal":this.horizontal,"s-contacts-list-vertical":!this.horizontal,"s-contacts-list-icons-only":this.iconsOnly}},t.map(((t,i)=>s("div",{key:i,id:"contact-slot",innerHTML:this.contactSlot.replace(/\{icon\}/g,this.getContactIcon(t.type)).replace(/\{value\}/g,t.value.toString()).replace(/\{link\}/g,this.getContactLink(t.type))})))))}componentDidRender(){this.host.querySelector('[slot="contact"]')?.remove()}get host(){return e(this)}};o.style='/*!twlt*/.unicode{unicode-bidi:plaintext}.block{display:block}.contents{display:contents}.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-contacts-title{margin-bottom:0.75rem;font-size:1.125rem;line-height:1.75rem;font-weight:700}@media (min-width: 1024px){.s-contacts-title{margin-bottom:1.25rem}}.s-contacts-header{display:none;align-items:center}@media (min-width: 1024px){.s-contacts-header{display:flex}}.s-contacts-topnav-link{display:inline-block;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1px;padding-bottom:1px;font-size:0.875rem;line-height:1.25rem;line-height: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:300ms}.s-contacts-topnav-link:hover{opacity:0.8}.s-contacts-topnav-link:where([dir="ltr"],[dir="ltr"] *){border-right-width:1px}.s-contacts-topnav-link:last-child:where([dir="ltr"],[dir="ltr"] *){border-width:0px;padding-right:0px}.s-contacts-topnav-link:where([dir="rtl"],[dir="rtl"] *){border-left-width:1px}.s-contacts-topnav-link:last-child:where([dir="rtl"],[dir="rtl"] *){border-width:0px;padding-left:0px}.s-contacts-item{display:flex;align-items:center;font-size:0.875rem;line-height:1.25rem;line-height:1}.s-contacts-icon{display:flex;height:2rem;width:2rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;border-width:1px}.s-contacts-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.625rem}.s-contacts-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.625rem}.s-contacts-icon svg{height:0.875rem;width:0.875rem;fill:currentColor}.s-contacts-list{display:flex;gap:1rem}.s-contacts-list-horizontal{align-items:center}.s-contacts-list-vertical{flex-direction:column}.s-contacts-list-icons-only .s-contacts-icon{margin-left:0px;margin-right:0px}';export{o as salla_contacts}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,c as t,h as i,H as r}from"./p-
|
|
4
|
+
import{r as e,c as t,h as i,H as r}from"./p-B64o_70M.js";import{a}from"./p-BedNk7k1.js";import{a as s}from"./p-B9q7ymSg.js";const n=class{constructor(i){e(this,i),this.changed=t(this,"changed"),this.min=0,this.max=1e4,this.moreThanLabel="أكثر من",this.lessThanLabel="أقل من",this.toLabel="الى",this.fromLabel="من",this.typing=!1,this.isMin=!1,this.isRTL=salla.config.get("theme.is_rtl",!0),this.filterValues=[]}connectedCallback(){if(this.filtersData&&this.filtersData?.price&&(this.minPrice=this.filtersData.price.min,this.maxPrice=this.filtersData.price.max),salla.lang.onLoaded((()=>{this.moreThanLabel=salla.lang.getWithDefault("common.elements.more_than",this.moreThanLabel),this.lessThanLabel=salla.lang.getWithDefault("common.elements.less_than",this.lessThanLabel),this.toLabel=salla.lang.getWithDefault("common.elements.to",this.toLabel),this.fromLabel=salla.lang.getWithDefault("common.elements.from",this.fromLabel)})),1==this.option.values.length)return;if(this.option.values.length<=5)return void(this.filterValues=this.option.values);const e=Math.ceil(this.option.values.length/5);for(let t=0;t<this.option.values.length;t+=e)this.filterValues.push(this.option.values.slice(t,t+e).reduce(((e,t)=>(e.to=t.to,e.count+=t.count,e))))}async reset(){this.minInput.value=null,this.maxInput.value=null,this.minPrice=null,this.maxPrice=null}getPriceLabel(e){return isNaN(e.from)||e.from<1?`${this.lessThanLabel} ${salla.money(e.to)}`:isNaN(e.to)||e.to<1?`${this.moreThanLabel} ${salla.money(e.from)}`:`${salla.money(e.from)} ${this.toLabel} ${salla.money(e.to)}`}minInputValidation(e){e&&(e>this.max||this.maxPrice&&e>this.maxPrice)||(e<this.min?this.minPrice=this.min:e&&(this.minPrice=e))}maxInputValidation(e){e&&(e<this.min||this.minPrice&&e<this.minPrice)||e>this.max&&(this.maxPrice=this.max)}async changedEventHandler(e){salla.helpers.inputDigitsOnly(this.minInput),salla.helpers.inputDigitsOnly(this.maxInput);const t=this.minPrice?1*+this.minPrice:null,i=this.maxPrice?1*+this.maxPrice:null;this.maxPrice||(this.maxPrice=""),this.isMin?this.minInputValidation(t):(this.minPrice||(this.minPrice=0),this.maxInputValidation(i)),this.isReady&&this.changed.emit({event:e,option:this.option,value:{max:this.maxPrice,min:this.minPrice}})}handleMinMaxPrice(e,t){this.minPrice=t.from,this.maxPrice="*"!==t.to?t.to:"",this.changedEventHandler(e)}isChecked(e){return!(!this.minPrice&&!this.maxPrice)&&(((e.from<1||"*"==e.from)&&0==this.minPrice||e.from==this.minPrice)&&("*"==e.to||!e.to||e.to==this.maxPrice))}handleMinPrice(e){this.isMin=!0;const t=e.target.value;this.minPrice=""===t?0:t}handleMaxPrice(e){this.isMin=!1;const t=e.target.value;this.maxPrice=void 0===t?"":t}render(){return i(r,{key:"dc74966c1d2d9e5626b23db0a80b693fef047f41"},this.filterValues.map(((e,t)=>i("label",{class:"s-filters-label",htmlFor:`${this.option.key}-${t}`,key:t},i("input",{id:`${this.option.key}-${t}`,name:"price",type:"radio",checked:this.isChecked(e),class:"s-filters-radio",onChange:t=>this.handleMinMaxPrice(t,e)}),i("span",{innerHTML:this.getPriceLabel(e)})))),i("div",{key:"b12dad0c27f3fbe9ad8a9c98b9bd1302388b35ef",class:"flex justify-center items-center"},i("div",{key:"e034058e195a94c2434e99c5b30b2e5909daff87",class:"relative max-w-xl w-full"},i("div",{key:"4c59f5a3c8249717c4c6decbcdb63d97343bd871",class:"s-price-range-inputs"},i("div",{key:"65de0733e3ce1ea7b37976f1d077d1f3192056c5",class:"s-price-range-relative"},i("div",{key:"ed842802aff5cd874e708c062aa79e8185d330f3",class:"s-price-range-currency"}," ",salla.config.currency().symbol),i("input",{key:"78d020948e3edc4e53fff976fa8e00b2e6ac6868",type:"number",maxlength:"5",ref:e=>this.minInput=e,onBlur:e=>this.handleMinPrice(e),value:this.minPrice,placeholder:this.fromLabel,class:"s-price-range-number-input"})),i("div",{key:"edfb3dd62b7898d4493a1adefeee20bdb305c89a",class:"s-price-range-gray-text"}," -"),i("div",{key:"f2227f09a344b8cc8c1160c23a6dbc9cd96cb260",class:"s-price-range-relative"},i("div",{key:"e528e7766eb7f6b9e0791116c87374441c73afe6",class:"s-price-range-currency"}," ",salla.config.currency().symbol),i("input",{key:"6dda7a17097ae51c50c3d4aae290ce1b0369dcfa",type:"number",maxlength:"5",ref:e=>this.maxInput=e,onBlur:e=>this.handleMaxPrice(e),value:this.maxPrice,placeholder:this.toLabel,class:"s-price-range-number-input","aria-describedby":"price-currency"})),i("salla-button",{key:"970d39060c565e7dc18e6a2039452a3b3df04082",color:"gray",shape:"icon",size:"small",fill:"outline",onClick:e=>this.changedEventHandler(e)},i("span",{key:"da9b6ed688a64d624eedc3834ad3be47533c9dd5",innerHTML:this.isRTL?a:s}))))))}componentDidLoad(){this.isReady=!0}};n.style="/*!twlt*/:host{display:block}.rtl .rtl-range-slider,[dir=rtl] .rtl-range-slider{transform:rotateY(180deg)}.rtl .rtl-range-numbers,[dir=rtl] .rtl-range-numbers{flex-direction:row-reverse}.rtl .form-select,.rtl select,[dir=rtl] .form-select,[dir=rtl] select{background-position:left 0.5rem center;padding-right:12px}.rtl .menu-divide li:not(:last-child):after,[dir=rtl] .menu-divide li:not(:last-child):after{left:0;right:auto}input[type=range]::-webkit-slider-thumb{pointer-events:all;width:24px;height:24px;-webkit-appearance:none}[type=checkbox]:checked{background-size:80%}.relative{position:relative}.flex{display:flex}.w-full{width:100%}.max-w-xl{max-width:36rem}.items-center{align-items:center}.justify-center{justify-content:center}.outline{outline-style:solid}.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-price-range-input{pointer-events:none;position:absolute;z-index:20;height:0.5rem;width:100%;cursor:pointer;appearance:none;opacity:0}.s-price-range-bar{position:absolute;left:0px;right:0px;bottom:0px;top:0px;z-index:10;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-price-range-bar-container{position:relative;z-index:10;height:0.5rem}.s-price-range-active-bar{position:absolute;top:0px;bottom:0px;z-index:20;border-radius:0.375rem;background-color:var(--color-primary)}.s-price-range-left-handle{position:absolute;top:0px;left:0px;z-index:30;margin-top:-0.25rem;margin-left:-0px;height:1rem;width:1rem;cursor:pointer;border-radius:9999px;background-color:var(--color-primary);--tw-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px 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-price-range-right-handle{position:absolute;top:0px;right:0px;z-index:30;margin-top:-0.25rem;margin-right:-0px;height:1rem;width:1rem;cursor:pointer;border-radius:9999px;background-color:var(--color-primary);--tw-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px 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-price-range-inputs{display:flex;align-items:center;justify-content:flex-start;gap:0.5rem;padding-top:1rem}.s-price-range-number-input{width:6rem;border-radius:var(--s-radius, 0.25rem);border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-right:0.75rem;padding-top:0.5rem;padding-bottom:0.5rem;padding-left:2.25rem;text-align:center;font-size:0.875rem;line-height:1.25rem}.s-price-range-number-input:focus{--tw-border-opacity:1;border-color:rgb(156 163 175 / var(--tw-border-opacity, 1))}.s-price-range-gray-text{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-price-range-currency{pointer-events:none;position:absolute;top:0px;bottom:0px;left:0px;display:flex;align-items:center;padding-left:0.5rem;padding-right:0.5rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.s-price-range-currency{font-size:0.875rem;line-height:1.25rem}}.s-price-range-relative{position:relative}";export{n as salla_price_range}
|