@salla.sa/twilight-components 2.14.573 → 2.14.574
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/{Helper-N5wrs9vm.js → Helper-8U7zlpC3.js} +171 -117
- package/dist/cjs/{filepond-B2iMbV1F.js → filepond-BqzmHqFG.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-rXYiM_Ob.js → filepond-plugin-file-poster-Rc_hYm4g.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-BF5dedmz.js → filepond-plugin-file-validate-size-MQOyXwCH.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-DJHYRny2.js → filepond-plugin-file-validate-type-0_gq-gig.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-BgtH5f4u.js → filepond-plugin-image-edit-DjWvYOF_.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-C9JH8EBn.js → filepond-plugin-image-exif-orientation-BGNpJuyh.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-CpSCiqfj.js → filepond-plugin-image-preview-BoPR2rRr.js} +1 -1
- package/dist/cjs/heart-ClVn_Co8.js +13 -0
- package/dist/cjs/{index-DpXwHFVO.js → index-BGm5j5Zj.js} +14 -10
- package/dist/cjs/index-CIbBkRPw.js +4413 -0
- package/dist/cjs/{intlTelInput-CdZOfaWd.js → intlTelInput-CIZvknP0.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +2 -2
- 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-applied-filters.cjs.entry.js +2 -2
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-attachment-view_9.cjs.entry.js +11 -11
- 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_3.cjs.entry.js +9 -4403
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/cjs/salla-filters.cjs.entry.js +2 -2
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gift-card-redeem.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 +2 -2
- 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_3.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 +2 -2
- 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.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 +2 -2
- 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-card.cjs.entry.js +5 -11
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +2 -2
- package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +5 -6
- package/dist/cjs/salla-rating-modal.cjs.entry.js +5 -6
- 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-product-card.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-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 +3 -3
- 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/salla-wishlist-summary.cjs.entry.js +48 -0
- package/dist/cjs/{shipping-fast-CsqEQE78.js → star-tn5w5Um0.js} +8 -0
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-BT9OjZCy.js → vanilla-picker-BwaB87Xi.js} +1 -1
- package/dist/collection/Helpers/Helper.js +171 -117
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +8 -4
- package/dist/collection/components/salla-cart-summary/salla-cart-summary.css +1 -1
- package/dist/collection/components/salla-user-menu/salla-user-menu.js +1 -1
- package/dist/collection/components/salla-wishlist-summary/salla-wishlist-summary.css +62 -0
- package/dist/collection/components/salla-wishlist-summary/salla-wishlist-summary.js +65 -0
- package/dist/components/Helper.js +171 -117
- package/dist/components/heart.js +11 -0
- package/dist/components/index.js +2 -2
- package/dist/components/index2.js +4322 -2471
- package/dist/components/index3.js +2553 -0
- package/dist/components/salla-bullet-delivery.js +44 -4438
- package/dist/components/salla-cart-summary.js +1 -1
- package/dist/components/salla-datetime-picker2.js +1 -1
- package/dist/components/salla-product-card2.js +4 -10
- package/dist/components/salla-rating-modal-v2.js +1 -1
- package/dist/components/salla-rating-modal-v22.js +9 -3
- package/dist/components/salla-rating-modal2.js +2 -3
- package/dist/components/salla-user-menu.js +2 -2
- package/dist/components/salla-wishlist-summary.d.ts +11 -0
- package/dist/components/salla-wishlist-summary.js +67 -0
- package/dist/esm/{Helper-Cql-WbqR.js → Helper-ivBHT_nn.js} +171 -117
- package/dist/esm/{filepond-BsuscqtG.js → filepond-DcoYtlMX.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-DZ4ckjsP.js → filepond-plugin-file-poster-CBcS6Ln1.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-BV6807xx.js → filepond-plugin-file-validate-size-HuNTwpc9.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-cWCM2RqT.js → filepond-plugin-file-validate-type-BOjEfXdn.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-aQvaKLxK.js → filepond-plugin-image-edit-BL7zREI5.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-FgW7hBXK.js → filepond-plugin-image-exif-orientation-BJgL9era.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-DxogdDqd.js → filepond-plugin-image-preview-DPUJHFk0.js} +1 -1
- package/dist/esm/heart-00vBRoH3.js +11 -0
- package/dist/esm/{index-DSEA3vdh.js → index-BXNtVhVe.js} +14 -10
- package/dist/esm/index-wXSgmenB.js +4404 -0
- package/dist/esm/{intlTelInput-BLEGv9EO.js → intlTelInput-wU6Kly2g.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +2 -2
- package/dist/esm/salla-add-product-button_5.entry.js +2 -2
- 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-applied-filters.entry.js +2 -2
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-attachment-view_9.entry.js +11 -11
- 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_3.entry.js +53 -4447
- package/dist/esm/salla-cart-coupons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/esm/salla-filters.entry.js +2 -2
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gift-card-redeem.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 +2 -2
- 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_3.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 +2 -2
- 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.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 +2 -2
- 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-card.entry.js +2 -8
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +2 -2
- package/dist/esm/salla-products-slider.entry.js +2 -2
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +3 -4
- package/dist/esm/salla-rating-modal.entry.js +3 -4
- 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-product-card.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-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 +5 -5
- 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/salla-wishlist-summary.entry.js +46 -0
- package/dist/esm/{shipping-fast-lMgMt31Q.js → star-cq6TcfoH.js} +8 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-BpgJFvog.js → vanilla-picker-CFcUgW74.js} +1 -1
- package/dist/twilight/p-00vBRoH3.js +4 -0
- package/dist/twilight/{p-035b561c.entry.js → p-02eccebc.entry.js} +1 -1
- package/dist/twilight/p-043b2382.entry.js +4 -0
- package/dist/twilight/{p-2304f0a4.entry.js → p-0a135b25.entry.js} +1 -1
- package/dist/twilight/{p-5d41dc4e.entry.js → p-0bcaa1af.entry.js} +1 -1
- package/dist/twilight/{p-bbb72d38.entry.js → p-0d18b6f2.entry.js} +1 -1
- package/dist/twilight/p-12822eba.entry.js +4 -0
- package/dist/twilight/{p-82455313.entry.js → p-16b9ea73.entry.js} +1 -1
- package/dist/twilight/{p-5d0fd545.entry.js → p-1853b5ba.entry.js} +1 -1
- package/dist/twilight/p-1a4028e2.entry.js +4 -0
- package/dist/twilight/{p-010fa509.entry.js → p-1bcacd6b.entry.js} +1 -1
- package/dist/twilight/{p-f306bfe3.entry.js → p-1ea4c8e4.entry.js} +1 -1
- package/dist/twilight/{p-e5bb52fb.entry.js → p-22087f33.entry.js} +1 -1
- package/dist/twilight/{p-5d97cf2d.entry.js → p-23540811.entry.js} +1 -1
- package/dist/twilight/{p-3c665085.entry.js → p-2e08cf78.entry.js} +1 -1
- package/dist/twilight/{p-4a3701ca.entry.js → p-2ee3c58e.entry.js} +1 -1
- package/dist/twilight/{p-901217bc.entry.js → p-38806031.entry.js} +1 -1
- package/dist/twilight/{p-d654b4b0.entry.js → p-3ae64529.entry.js} +1 -1
- package/dist/twilight/{p-f173ada5.entry.js → p-3e7a7eb0.entry.js} +1 -1
- package/dist/twilight/{p-3eb55e32.entry.js → p-43124a9d.entry.js} +1 -1
- package/dist/twilight/{p-7afeb088.entry.js → p-44899fd8.entry.js} +1 -1
- package/dist/twilight/{p-c15d08ae.entry.js → p-4563fd77.entry.js} +1 -1
- package/dist/twilight/{p-276171ac.entry.js → p-48f47f92.entry.js} +1 -1
- package/dist/twilight/{p-b6ece925.entry.js → p-50a88286.entry.js} +1 -1
- package/dist/twilight/{p-6fb16543.entry.js → p-52c31b1a.entry.js} +1 -1
- package/dist/twilight/{p-77dc1637.entry.js → p-565eda17.entry.js} +1 -1
- package/dist/twilight/p-6142183b.entry.js +4 -0
- package/dist/twilight/{p-909ae4c5.entry.js → p-6210a661.entry.js} +1 -1
- package/dist/twilight/{p-69e8750f.entry.js → p-6665f42e.entry.js} +1 -1
- package/dist/twilight/{p-e0b085e4.entry.js → p-6b378bcd.entry.js} +1 -1
- package/dist/twilight/{p-75652fd4.entry.js → p-6d56ebac.entry.js} +1 -1
- package/dist/twilight/{p-6904ad04.entry.js → p-6fe398ae.entry.js} +1 -1
- package/dist/twilight/{p-aadeb35a.entry.js → p-70147959.entry.js} +1 -1
- package/dist/twilight/{p-09e126b0.entry.js → p-70eaceea.entry.js} +1 -1
- package/dist/twilight/{p-1f1dda08.entry.js → p-71ec3f8a.entry.js} +1 -1
- package/dist/twilight/p-747153bc.entry.js +4 -0
- package/dist/twilight/{p-4944d10a.entry.js → p-76403e24.entry.js} +1 -1
- package/dist/twilight/{p-77323c2a.entry.js → p-78a84f80.entry.js} +1 -1
- package/dist/twilight/p-79f495b7.entry.js +4 -0
- package/dist/twilight/{p-e5c07741.entry.js → p-7a099b00.entry.js} +1 -1
- package/dist/twilight/{p-51434773.entry.js → p-817cfe1a.entry.js} +1 -1
- package/dist/twilight/{p-6a605835.entry.js → p-853b2efe.entry.js} +1 -1
- package/dist/twilight/{p-4a447633.entry.js → p-8666489e.entry.js} +1 -1
- package/dist/twilight/{p-9fe36a97.entry.js → p-88f762de.entry.js} +1 -1
- package/dist/twilight/{p-1acd987a.entry.js → p-8e114c27.entry.js} +1 -1
- package/dist/twilight/{p-b1c21e5c.entry.js → p-8f3642d1.entry.js} +1 -1
- package/dist/twilight/{p-db53fade.entry.js → p-900f78b6.entry.js} +1 -1
- package/dist/twilight/{p-7e0698c6.entry.js → p-90aa29f3.entry.js} +1 -1
- package/dist/twilight/{p-5329003d.entry.js → p-91e4594d.entry.js} +1 -1
- package/dist/twilight/{p-84ec7be7.entry.js → p-9282b995.entry.js} +1 -1
- package/dist/twilight/{p-06419603.entry.js → p-98137b26.entry.js} +1 -1
- package/dist/twilight/{p-62a44e65.entry.js → p-987a75aa.entry.js} +1 -1
- package/dist/twilight/{p-3c5e2710.entry.js → p-9979ada5.entry.js} +1 -1
- package/dist/twilight/{p-d9be4036.entry.js → p-9cca8055.entry.js} +1 -1
- package/dist/twilight/{p-3040407e.entry.js → p-9d667925.entry.js} +1 -1
- package/dist/twilight/{p-8ae70528.entry.js → p-9dfe1ec1.entry.js} +1 -1
- package/dist/twilight/{p-0764c46b.entry.js → p-9f23104d.entry.js} +1 -1
- package/dist/twilight/{p-WgGO2Pjy.js → p-BFib9jF0.js} +1 -1
- package/dist/twilight/{p-DSEA3vdh.js → p-BXNtVhVe.js} +2 -2
- package/dist/twilight/{p-VBuS91fQ.js → p-BpnCDmiM.js} +1 -1
- package/dist/twilight/{p-B3sbQMcp.js → p-C3JsXKHY.js} +1 -1
- package/dist/twilight/{p-BZt79QeE.js → p-CDojVREu.js} +1 -1
- package/dist/twilight/{p-DDcSXlpO.js → p-CMcDoqmG.js} +1 -1
- package/dist/twilight/{p-BF2su8FM.js → p-COQlWLWv.js} +1 -1
- package/dist/twilight/{p-Bj6lP8RV.js → p-CPkPdW2Q.js} +1 -1
- package/dist/twilight/p-CbVZf-Q4.js +4 -0
- package/dist/twilight/{p-Bt0GXtZG.js → p-D9StCBh9.js} +2 -2
- package/dist/twilight/p-DI6PJLEJ.js +1024 -0
- package/dist/twilight/{p-6cc3e44d.entry.js → p-a0c5bc92.entry.js} +1 -1
- package/dist/twilight/{p-c419a909.entry.js → p-a34258d2.entry.js} +1 -1
- package/dist/twilight/{p-1063f3d1.entry.js → p-a57e299a.entry.js} +1 -1
- package/dist/twilight/{p-89ed6dbc.entry.js → p-a581c552.entry.js} +1 -1
- package/dist/twilight/{p-0b514a47.entry.js → p-ab97de5d.entry.js} +1 -1
- package/dist/twilight/{p-901a961f.entry.js → p-ac2926d9.entry.js} +1 -1
- package/dist/twilight/{p-dd3aacf3.entry.js → p-aec3d7ce.entry.js} +1 -1
- package/dist/twilight/{p-663aa63b.entry.js → p-b0671070.entry.js} +1 -1
- package/dist/twilight/{p-e90a201a.entry.js → p-b0ff401e.entry.js} +1 -1
- package/dist/twilight/{p-ad930532.entry.js → p-b11508cb.entry.js} +1 -1
- package/dist/twilight/{p-5c863789.entry.js → p-b5329852.entry.js} +1 -1
- package/dist/twilight/{p-DdScDjtA.js → p-b84FyDqk.js} +1 -1
- package/dist/twilight/{p-bb2170ac.entry.js → p-bb0bc7ed.entry.js} +1 -1
- package/dist/twilight/{p-68aecf40.entry.js → p-bc2203b6.entry.js} +1 -1
- package/dist/twilight/{p-bc0f3f06.entry.js → p-bd89bcf5.entry.js} +1 -1
- package/dist/twilight/{p-d1c973ce.entry.js → p-bdb558a2.entry.js} +1 -1
- package/dist/twilight/{p-b3063b70.entry.js → p-bee482ce.entry.js} +1 -1
- package/dist/twilight/{p-f919f0b5.entry.js → p-c0c23759.entry.js} +1 -1
- package/dist/twilight/{p-6be347e5.entry.js → p-c163a216.entry.js} +1 -1
- package/dist/twilight/{p-ec341307.entry.js → p-c5f087a3.entry.js} +1 -1
- package/dist/twilight/{p-5b949ccc.entry.js → p-c67dcc94.entry.js} +1 -1
- package/dist/twilight/{p-lMgMt31Q.js → p-cq6TcfoH.js} +1 -1
- package/dist/twilight/{p-78ee03f8.entry.js → p-d1520e68.entry.js} +1 -1
- package/dist/twilight/{p-54c36ba4.entry.js → p-d365bd72.entry.js} +1 -1
- package/dist/twilight/{p-2c07e8ac.entry.js → p-d702af41.entry.js} +1 -1
- package/dist/twilight/{p-3b3a1c87.entry.js → p-dbd9523b.entry.js} +1 -1
- package/dist/twilight/{p-4557e342.entry.js → p-dc9b9ef7.entry.js} +1 -1
- package/dist/twilight/{p-47b1aa89.entry.js → p-de3eeec4.entry.js} +1 -1
- package/dist/twilight/{p-e676c627.entry.js → p-dedfcc58.entry.js} +1 -1
- package/dist/twilight/{p-66561f9e.entry.js → p-e50b99cb.entry.js} +1 -1
- package/dist/twilight/{p-6cdc7f8a.entry.js → p-e6233f15.entry.js} +1 -1
- package/dist/twilight/{p-457a256d.entry.js → p-e63f5b80.entry.js} +1 -1
- package/dist/twilight/{p-8f2b2e42.entry.js → p-e77d6649.entry.js} +1 -1
- package/dist/twilight/{p-855a9db7.entry.js → p-e9cc9f4f.entry.js} +1 -1
- package/dist/twilight/{p-6e43f8a7.entry.js → p-eccd8aa9.entry.js} +1 -1
- package/dist/twilight/{p-a89fb313.entry.js → p-f174afea.entry.js} +1 -1
- package/dist/twilight/{p-360b6388.entry.js → p-f4583bb2.entry.js} +1 -1
- package/dist/twilight/{p-fc6adc90.entry.js → p-f48ada4a.entry.js} +1 -1
- package/dist/twilight/{p-b414760b.entry.js → p-f583571c.entry.js} +1 -1
- package/dist/twilight/{p-fac05e8f.entry.js → p-f7e38710.entry.js} +1 -1
- package/dist/twilight/{p-2733e78f.entry.js → p-fc0a3c91.entry.js} +1 -1
- package/dist/twilight/{p-61580839.entry.js → p-fd6aed5e.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/Helpers/Helper.d.ts +14 -12
- package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +0 -1
- package/dist/types/components/salla-wishlist-summary/salla-wishlist-summary.d.ts +18 -0
- package/dist/types/components.d.ts +45 -0
- package/package.json +5 -5
- package/dist/cjs/star-DMzrN05M.js +0 -13
- package/dist/components/star.js +0 -11
- package/dist/esm/star-CeFAfcTv.js +0 -11
- package/dist/twilight/p-5a86a794.entry.js +0 -4
- package/dist/twilight/p-8ed45c28.entry.js +0 -4
- package/dist/twilight/p-CUSw0W26.js +0 -4
- package/dist/twilight/p-CeFAfcTv.js +0 -4
- package/dist/twilight/p-b98ae2c1.entry.js +0 -4
- package/dist/twilight/p-e91bba7e.entry.js +0 -1024
- package/dist/twilight/p-f10fca84.entry.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as e,F as i}from"./p-
|
|
4
|
+
import{r as t,h as e,F as i}from"./p-BXNtVhVe.js";const r=class{constructor(e){t(this,e),this.source="header",this.useReactLink=!1,this.menus=[],this.displayAllText=""}async componentWillLoad(){return salla.onReady((()=>{if(this.displayAllText=salla.lang.get("blocks.home.display_all"),!this.sourceValue||"json"!==this.source)return this.getMenuItems();this.menus="string"==typeof this.sourceValue?JSON.parse(this.sourceValue):this.sourceValue||[]}))}getMenuItems(){return salla.api.component.getMenus(this.source).then((async({data:t})=>{this.menus=t,await salla.hooks.call("salla-menu","afterFetchMenuItems",this)})).catch((t=>{salla.logger.error("salla-menu::Error fetching menus",t)}))}hasChildren(t){return t?.children?.length>0}hasProducts(t){return t?.products?.length>0}getDesktopClasses(t,e){return`!hidden lg:!block ${e?"root-level lg:!inline-block":"relative"} ${t.products?" mega-menu":""}\n ${this.hasChildren(t)?"has-children":""}`}getAttributes(t){return t.trim().split(" ").reduce(((t,e)=>{let[i,r]=e.split("=");return t[i]=r.replace(/"/g,""),t}),{})}getMobileMenu(t,r){const l=t.image?e("img",{src:t.image,class:"rounded-full",width:"48",height:"48",alt:t.title}):null;return e("li",{class:"lg:hidden text-sm font-bold",...this.getAttributes(t.attrs)},this.hasChildren(t)?e(i,null,e("span",{class:t.image?"!py-3":""},l,t.title),e("ul",null,e("li",{class:"text-sm font-bold"},e("a",{href:t.url,class:"text-gray-500"},r)),t.children.map((t=>this.getMobileMenu(t,r))))):e("a",{href:t.url,"aria-label":t.title||"category",class:"text-gray-500 "+(t.image?"!py-3":""),...this.getAttributes(t.link_attrs)},l,e("span",null,t.title||"")))}getDesktopMenu(t,i){return e("li",{class:this.getDesktopClasses(t,i),...this.getAttributes(t.attrs)},e("a",{href:t.url,"aria-label":t.title||"category",...this.getAttributes(t.link_attrs)},e("span",null,t.title)),this.hasChildren(t)?e("div",{class:"sub-menu shadow-default "+(this.hasProducts(t)?"w-full left-0 flex":"w-56")},e("ul",{class:this.hasProducts(t)?"w-56 shrink-0 m-8 rtl:ml-0 ltr:mr-0":""},t.children.map((t=>this.getDesktopMenu(t,!1)))),this.hasProducts(t)?e("salla-products-list",{source:"selected","shadow-on-hover":!0,"source-value":`[${t.products}]`}):null):null)}getFooterMenu(t){const i=this.topnav||this.limit?t.slice(0,this.limit||3):t;return e("div",null,e("div",{class:{"s-menu-footer-list":!this.topnav,"s-menu-topnav-list":this.topnav}},i.map((t=>e("a",{key:t.id,href:t.url,target:t.target,class:{"s-menu-footer-item":!this.topnav,"s-menu-topnav-item topnav-link-item right-side":this.topnav},...t.callback?{onClick:t.callback}:{}},t.title)))))}getHeaderMenu(t){return t.map((t=>[this.getMobileMenu(t,this.displayAllText),this.getDesktopMenu(t,!0)]))}render(){return"footer"===this.source?this.getFooterMenu(this.menus):[e("nav",{key:"main-nav",id:"mobile-menu",class:"mobile-menu"},e("ul",{class:"main-menu"},this.getHeaderMenu(this.menus)),e("button",{class:"btn--close close-mobile-menu sicon-cancel lg:hidden"})),e("button",{key:"close-btn",class:"btn--close-sm close-mobile-menu sicon-cancel hidden"})]}};r.style='/*!twlt*/:host{display:block}.relative{position:relative}.left-0{left:0px}.m-8{margin:2rem}.flex{display:flex}.\\!hidden{display:none !important}.hidden{display:none}.w-56{width:14rem}.w-full{width:100%}.shrink-0{flex-shrink:0}.rounded-full{border-radius:9999px}.\\!py-3{padding-top:0.75rem !important;padding-bottom:0.75rem !important}.text-sm{font-size:0.875rem;line-height:1.25rem}.font-bold{font-weight:700}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.shadow-default{--tw-shadow:5px 10px 30px #2B2D340D;--tw-shadow-colored:5px 10px 30px 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-menu-item{display:none !important}@media (min-width: 1024px){.s-menu-item{display:block !important}.s-menu-root-level{display:inline-block !important}}.s-menu-non-root-level{position:relative}.s-menu-products-wrapper{flex-grow:1;padding:2rem}.s-menu-products-container{display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));gap:1rem}.s-menu-submenu-unordered-list{margin:2rem;width:14rem;flex-shrink:0}.s-menu-submenu-unordered-list:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}.s-menu-submenu-unordered-list:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}.s-menu-submenu-with-product{left:0px;display:flex;width:100%}.s-menu-submenu-without-product{width:14rem}.s-menu-footer-item{margin-bottom:1.25rem;display:block;font-size:0.875rem;line-height:1.25rem;line-height:1}.s-menu-footer-item:last-child{margin-bottom:0px}.s-menu-topnav-list{display:none;align-items:center;white-space:nowrap}@media (min-width: 1024px){.s-menu-topnav-list{display:flex}}.s-menu-topnav-list:where([dir="ltr"],[dir="ltr"] *){padding-right:1rem}.s-menu-topnav-list:where([dir="rtl"],[dir="rtl"] *){padding-left:1rem}.s-menu-topnav-item{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-menu-topnav-item:hover{opacity:0.8}.s-menu-topnav-item:where([dir="ltr"],[dir="ltr"] *){border-right-width:1px}.s-menu-topnav-item:first-child:where([dir="ltr"],[dir="ltr"] *){padding-left:0px}.s-menu-topnav-item:last-child:where([dir="ltr"],[dir="ltr"] *){border-width:0px;padding-right:0px}.s-menu-topnav-item:where([dir="rtl"],[dir="rtl"] *){border-left-width:1px}.s-menu-topnav-item:first-child:where([dir="rtl"],[dir="rtl"] *){padding-right:0px}.s-menu-topnav-item:last-child:where([dir="rtl"],[dir="rtl"] *){border-width:0px;padding-left:0px}@media (min-width: 1024px){.lg\\:\\!block{display:block !important}.lg\\:\\!inline-block{display:inline-block !important}.lg\\:hidden{display:none}}.ltr\\:mr-0:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}.rtl\\:ml-0:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}';export{r as salla_menu}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as s,H as r}from"./p-
|
|
4
|
+
import{r as e,h as s,H as r}from"./p-BXNtVhVe.js";const t=class{constructor(s){e(this,s),this.dark=!1,this.commercialRegisterLabel="",this.freelanceLabel=""}componentWillLoad(){this.initializeTranslations()}isVisibilityEnforced(){return"SA"===salla.config.get("store.store_country")}initializeTranslations(){salla.lang.onLoaded((()=>{const e=(e,s,r)=>{salla.helpers.setNested(salla.lang.messages[e],s,r)};e("ar.trans","blocks.footer.commercial_register","السجل التجاري"),e("en.trans","blocks.footer.commercial_register","Commercial Register"),e("ar.trans","blocks.footer.freelance","وثيقة العمل الحر"),e("en.trans","blocks.footer.freelance","Freelance Certificate"),this.commercialRegisterLabel=salla.lang.getWithDefault("blocks.footer.commercial_register","السجل التجاري"),this.freelanceLabel=salla.lang.getWithDefault("blocks.footer.freelance","وثيقة العمل الحر")}))}getBadgeData(){const e=salla.config.get("store.settings.commercial_number"),s=salla.config.get("store.settings.freelance_number");return e?{number:e,label:this.commercialRegisterLabel||"السجل التجاري",imageUrl:salla.url.cdn("images/commercial-register.png",70,70),type:"commercial"}:s?{number:s,label:this.freelanceLabel||"وثيقة العمل الحر",imageUrl:this.dark?salla.url.cdn("images/freelance-white.png"):salla.url.cdn("images/freelance.png"),type:"freelance"}:null}render(){const e=this.getBadgeData();return e?s(r,{class:"s-trust-badges-wrapper "+(this.dark?"dark":"")},this.isVisibilityEnforced()?s("img",{class:"s-trust-badges-image",width:"55",height:"55",src:e.imageUrl,alt:e.label}):null,s("div",{class:"s-trust-badges-content"},s("p",{class:"s-trust-badges-label"},e.label),s("b",{class:"s-trust-badges-number"},e.number))):null}};t.style='/*!twlt*/.s-trust-badges-wrapper{display:flex;align-items:center}.s-trust-badges-wrapper>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}.s-trust-badges-wrapper:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-trust-badges-label{margin-bottom:0.25rem;font-size:0.875rem;line-height:1.25rem}.s-trust-badges-number{font-size:0.875rem;line-height:1.25rem}';export{t as salla_trust_badges}
|
|
@@ -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}from"./p-DSEA3vdh.js";import{S as r}from"./p-Ctkfc4K-.js";import{l as i}from"./p-BChI23pG.js";import{T as o}from"./p-CJUR4sUM.js";import{A as c}from"./p-DCZbpt2a.js";import{C as n}from"./p-gFG8By9O.js";import{a as l}from"./p-CgtvEd63.js";const f=class{constructor(e){t(this,e),this.internalOffers=[],this.showAll=!1,this.freeLabel="",this.receivedOffer="",this.discountAmountLabel="",this.showMoreOffers="",this.icons={DiscountCouponIcon:'\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>discount-coupon</title>\n<path d="M27 28h-22c-0.552 0-1-0.448-1-1v0c0-1.657-1.343-3-3-3v0c-0.552 0-1-0.448-1-1v0-12c0-0.552 0.448-1 1-1v0c1.657 0 3-1.343 3-3v0c0-0.552 0.448-1 1-1v0h22c0.552 0 1 0.448 1 1v0c0 1.657 1.343 3 3 3v0c0.552 0 1 0.448 1 1v0 12c0 0.552-0.448 1-1 1v0c-1.657 0-3 1.343-3 3v0c0 0.552-0.448 1-1 1v0zM5.9 26h20.2c0.415-1.964 1.936-3.485 3.867-3.894l0.033-0.006v-10.2c-1.964-0.415-3.485-1.936-3.894-3.867l-0.006-0.033h-20.2c-0.415 1.964-1.936 3.485-3.867 3.894l-0.033 0.006v10.2c1.964 0.415 3.485 1.936 3.894 3.867l0.006 0.033zM20 7h2v3h-2v-3zM20 12h2v4h-2v-4zM20 18h2v4h-2v-4zM20 24h2v3h-2v-3zM9 16c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM9 12c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM15 24c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM15 20c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM7 24c-0.552-0-1-0.448-1-1 0-0.244 0.088-0.468 0.233-0.642l-0.001 0.002 10-12c0.185-0.221 0.461-0.36 0.769-0.36 0.553 0 1.001 0.448 1.001 1.001 0 0.245-0.088 0.469-0.233 0.643l0.001-0.002-10 12c-0.185 0.22-0.46 0.358-0.767 0.358-0.001 0-0.002 0-0.003 0h0z"></path>\n</svg>\n',GiftIcon:i,FireIcon:'\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>fire</title>\n<path d="M21.56 3.009c-0.052-0.047-0.116-0.065-0.173-0.103-0.073-0.048-0.143-0.1-0.223-0.132-0.083-0.033-0.165-0.047-0.252-0.063-0.081-0.016-0.16-0.035-0.243-0.035-0.089 0-0.172 0.020-0.26 0.037-0.080 0.016-0.159 0.028-0.236 0.059-0.084 0.035-0.157 0.088-0.235 0.14-0.053 0.036-0.115 0.053-0.165 0.097-0.049 0.044-0.988 0.895-2.288 2.255-2.364-2.839-4.476-4.815-4.576-4.908-0.056-0.052-0.127-0.075-0.188-0.115-0.075-0.049-0.143-0.105-0.224-0.137-0.080-0.032-0.163-0.041-0.245-0.057-0.085-0.016-0.167-0.040-0.252-0.040-0.084 0-0.163 0.023-0.245 0.039-0.087 0.016-0.172 0.025-0.253 0.059-0.080 0.032-0.147 0.087-0.22 0.135-0.063 0.041-0.133 0.064-0.189 0.116-0.453 0.423-11.092 10.408-11.092 18.095 0 7.977 4.935 13.549 12 13.549h8.667c6.673 0 11.333-5.115 11.333-12.439 0-7.052-10.013-16.167-10.44-16.552zM20.667 29.333h-7.777c-2.924 0-4.889-2.044-4.889-5.084 0-2.317 2.816-6.441 4.888-8.887 0.76 0.909 2.755 3.397 3.969 5.869 0.212 0.431 0.639 0.715 1.117 0.743 0.489 0.031 0.937-0.203 1.197-0.605 0.552-0.849 1.109-1.596 1.497-2.093 1.491 1.897 3.331 4.78 3.331 6.399 0 2.188-1.34 3.659-3.333 3.659zM26.537 27.052c0.081-0.44 0.129-0.899 0.129-1.377 0-3.269-3.713-7.847-4.46-8.735l-0.523-0.617c-0.507-0.599-1.528-0.599-2.035 0l-0.531 0.627c-0.147 0.175-0.495 0.599-0.936 1.187-1.595-2.597-3.495-4.776-3.595-4.889l-0.697-0.793c-0.507-0.577-1.499-0.577-2.004 0l-0.697 0.795c-0.6 0.684-5.856 6.803-5.856 11.001 0 0.881 0.127 1.712 0.356 2.484-1.896-1.933-3.023-4.821-3.023-8.283 0-4.915 6.073-11.997 9.329-15.255 1.001 1.008 2.692 2.789 4.368 4.927 0.243 0.309 0.609 0.496 1.001 0.509h0.048c0.376 0 0.735-0.159 0.988-0.439 0.889-0.981 1.693-1.795 2.269-2.359 3.051 2.965 8.663 9.323 8.663 13.727 0 3.171-1.031 5.769-2.796 7.491z"></path>\n</svg>\n',SpecialDiscountIcon:r,TagMoneyIcon:o},this.visibleOffersCount=3,this.handleCartItemUpdated=t=>{const e=t.data?.cart?.items?.find((t=>String(t.id)===String(this.itemId)));e&&(this.internalQuantity=e.quantity,this.internalOffers=e.detailed_offers||[],this.internalProductPrice=e.product_price)},this.toggleShowAll=()=>{this.showAll=!this.showAll}}async componentWillLoad(){await Salla.onReady(),await salla.lang.onLoaded((()=>{this.freeLabel=salla.lang.get("common.elements.freeExclam"),this.receivedOffer=salla.lang.get("pages.cart.received_offer"),this.discountAmountLabel=salla.lang.get("pages.cart.discount_amount"),this.showMoreOffers=salla.lang.get("pages.cart.show_more_offers")})),this.internalQuantity=this.quantity,this.internalOffers=this.parseOffers(this.offers),this.internalProductPrice=this.productPrice}componentDidLoad(){Salla.cart.event.onLatestFetched(this.handleCartItemUpdated),Salla.cart.event.onItemUpdated(this.handleCartItemUpdated),Salla.cart.event.onCouponAdded(this.handleCartItemUpdated),Salla.cart.event.onCouponDeleted(this.handleCartItemUpdated)}parseOffers(t){try{if("string"!=typeof t)return console.warn("Offers is not a string. Returning as-is.",t),Array.isArray(t)?t:[];const e=JSON.parse(t||"[]");return Array.isArray(e)?e:[]}catch(t){return console.error("Failed to parse offers",t),[]}}get visibleOffers(){return this.internalOffers.slice(0,this.visibleOffersCount)}get hiddenOffers(){return this.internalOffers.slice(this.visibleOffersCount)}getPaidQty(t,e){return t-e.free_quantity}renderOffer(t,s){const a=this.getPaidQty(t,s);return e("div",{class:"s-cart-item-offers-box"},s.free_quantity>0&&a>0&&e("div",{class:"s-cart-item-offers-paid-free"},e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(a)," × ",e("span",{innerHTML:salla.money(this.internalProductPrice)})),e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(s.free_quantity)," ×",e("span",{class:"s-cart-item-offers-regular-price",innerHTML:salla.money(this.internalProductPrice)}),e("span",{class:"s-cart-item-offers-free-label"},this.freeLabel))),e("div",{class:"s-cart-item-offers-details"},e("span",{class:"s-cart-item-offers-icon",innerHTML:this.icons[s.discount_icon]||""}),e("div",null,e("p",{class:"s-cart-item-offers-title"},this.receivedOffer.replace(":offer",s.offer_name)),e("p",{class:"s-cart-item-offers-discount"},e("span",{innerHTML:this.discountAmountLabel.replace(":amount",salla.money(s.discount_amount.toFixed(2)))})))))}render(){return this.internalOffers?.length?e("div",{class:"s-cart-item-offers-container",id:`offers_list_${this.itemId}`},this.visibleOffers.map((t=>this.renderOffer(this.internalQuantity,t))),this.internalOffers?.length>this.visibleOffersCount&&e("div",{class:"s-cart-item-offers-show-more"},e("button",{class:"s-cart-item-offers-show-more-btn",onClick:this.toggleShowAll,type:"button"},e("span",{class:"s-cart-item-offers-show-more-label"},"+",this.hiddenOffers.length," ",this.showMoreOffers,e("span",{innerHTML:c,class:{"s-cart-item-offers-arrow-icon":!0,"s-cart-item-offers-arrow-open":this.showAll}})))),this.showAll&&e("div",{class:"s-cart-item-offers-collapsed",id:`offers_${this.itemId}`},this.hiddenOffers.map((t=>this.renderOffer(this.internalQuantity,t))))):null}};f.style="/*!twlt*/:host{display:block}.s-cart-item-offers-box{margin-bottom:0.75rem}.s-cart-item-offers-container{margin-top:1.25rem}.s-cart-item-offers-paid-free{margin-bottom:0.75rem}.s-cart-item-offers-paid-free>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.25rem * var(--tw-space-y-reverse))}.s-cart-item-offers-paid-free{font-weight:500}.s-cart-item-offers-line{text-align:start}.s-cart-item-offers-regular-price{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-cart-item-offers-free-label{margin-left:0.5rem;margin-right:0.5rem;display:inline-block;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.s-cart-item-offers-details{display:flex;align-items:flex-start;gap:0.625rem;--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.s-cart-item-offers-icon{--tw-translate-y:-3px;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.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.s-cart-item-offers-icon svg{width:18px;fill:currentColor}.s-cart-item-offers-title{margin-bottom:0.5rem;font-weight:500}.s-cart-item-offers-message{font-size:0.875rem;line-height:1.25rem}.s-cart-item-offers-discount{margin-top:0px;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-cart-item-offers-show-more-btn{display:flex;align-items:center;justify-content:flex-start !important;background-color:transparent !important;padding-left:0px !important;padding-right:0px !important;font-size:0.875rem;line-height:1.25rem}.s-cart-item-offers-show-more-btn:hover{--tw-text-opacity:1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.s-cart-item-offers-arrow-icon{margin-left:0.125rem;margin-right:0.125rem;transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-cart-item-offers-arrow-open{--tw-rotate:-180deg;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))}.s-cart-item-offers-show-more-btn svg{width:18px}.s-cart-item-offers-show-more-label{display:flex;align-items:center}.s-cart-item-offers-collapsed{margin-top:0.5rem}";const m=class{constructor(e){t(this,e),this.cartSummaryCount=salla.storage.get("cart.summary.count")||0,this.cartSummaryTotal=salla.storage.get("cart.summary.total")||0,this.cartLabel="ar"===salla.config.get("user.language_code")?"السلة":"Cart",this.handleCheckoutClick=t=>{salla.mobile?.isSpaWebview?.()&&salla.mobile.openCheckout&&(t.preventDefault(),salla.mobile.openCheckout(this.getCartLink()))},salla.cart.event.onUpdated((t=>{this.cartSummaryCount=t.count||0,this.cartSummaryTotal=t.total||0}))}async animateToCart(t){if(document.querySelectorAll(".s-cart-thumb").forEach((t=>t.remove())),!t?.src)return void salla.log("Failed to get the img element");let e=this.host.querySelector("#s-cart-icon"),s=e.getBoundingClientRect(),a=s.top+window.scrollY,r=s.left+window.scrollX,i=t.getBoundingClientRect(),o=t.offsetWidth+"px",c=t.offsetHeight+"px",n=i.top,f=i.left,m=document.createElement("img");m.src=t.getAttribute("src"),m.className="s-cart-thumb",m.setAttribute("style","object-fit:cover; width:"+o+"; height:"+c+"; top:"+n+"px; left:"+f+"px;z-index:99999999; "),document.body.append(m);let h=document.querySelector(".s-cart-thumb");e.classList.remove("animated","rubberBand"),(new l.timeline).add({targets:h,width:[150,30],height:[150,30],top:[n,window.scrollY>0?a-window.scrollY-40:a-40],left:[f,r],borderRadius:["20%","50%"],easing:"easeOutExpo",duration:1200},"+=200").add({targets:h,width:[30,0],height:[30,0],opacity:[1,0],easing:"easeOutExpo",top:[window.scrollY>0?a-window.scrollY-40:a-40,window.scrollY>0?a-window.scrollY+10:a+10],left:[r,r+10]},"-=500").add({complete:function(){e.classList.add("animated","rubberBand"),h.remove()}},"-=1700")}componentWillLoad(){return new Promise((t=>salla.onReady(t)))}getCartLink(){let t=salla.url.get("cart");const e=salla.storage.get("scope")||salla.config.get("store.scope");if(e&&e.id)try{const s=new URL(t);return s.searchParams.set("scope",e.id),e.allocation_type&&s.searchParams.set("allocation_type",e.allocation_type),e.allocation_id&&s.searchParams.set("allocation_id",e.allocation_id),s.toString()}catch(s){const a=t.includes("?")?"&":"?",r=new URLSearchParams;return r.set("scope",String(e.id)),e.allocation_type&&r.set("allocation_type",e.allocation_type),e.allocation_id&&r.set("allocation_id",e.allocation_id),`${t}${a}${r.toString()}`}return t}render(){return e(s,{key:"46871f78da79e4ef5e80ab6b840972fedea6b032"},e("a",{key:"c3736429c17efab127aa1546eab87af22987ac1b",class:"s-cart-summary-wrapper",href:this.getCartLink(),onClick:this.handleCheckoutClick},e("div",{key:"ee82c1ff2176f9d04574c63aaad2db6c59799f0d",id:"s-cart-icon"},e("slot",{key:"483cfc04976a7ced4222bcaad065e370a72a8061",name:"icon"},e("i",{key:"0fa8e99e5fea7e88056784e0e0472ff4e927d4ef",class:"s-cart-summary-icon",innerHTML:n}))),e("span",{key:"2091f2ef2aed4c1b34011890c7b0f1fe78813ce4",class:"s-cart-summary-count"},salla.helpers.number(this.cartSummaryCount)),e("p",{key:"c2f6277c2742a9ca339ca39652a6a9119b260eee",class:"s-cart-summary-content"},this.showCartLabel&&e("span",{key:"7d2416455c34c1a4625d1131d99ab94e681f202a",class:"s-cart-summary-label"},this.cartLabel),e("b",{key:"e6546fda5426fbae3b7b7a96217cf15a45e662c9",class:"s-cart-summary-total",innerHTML:salla.money(this.cartSummaryTotal)}))))}get host(){return a(this)}};m.style='/*!twlt*/.block{display:block}.s-cart-summary-wrapper{text-decoration:none;color:var(--color-text);transition:all .5s cubic-bezier(0.2, 1, 0.3, 1);align-items:center;font-weight:bolder;position:relative;display:inline-flex}.s-cart-thumb{position:fixed;transition:all 0.3s cubic-bezier(0.2, 1, 0.3, 1)}.s-cart-summary-icon svg{height:1.25rem;width:1.25rem;fill:var(--color-text)}.s-cart-summary-count{position:absolute;top:-8px;left:-15px;display:inline-flex;height:1.25rem;width:1.25rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1));padding:0.25rem;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-cart-summary-count:where([dir="rtl"],[dir="rtl"] *){left:unset;right:-15px}';export{f as salla_cart_item_offers,m as salla_cart_summary}
|
|
4
|
+
import{r as t,h as e,H as s,a}from"./p-BXNtVhVe.js";import{S as r}from"./p-Ctkfc4K-.js";import{l as i}from"./p-BChI23pG.js";import{T as o}from"./p-CJUR4sUM.js";import{A as c}from"./p-DCZbpt2a.js";import{C as n}from"./p-gFG8By9O.js";import{a as l}from"./p-CgtvEd63.js";const f=class{constructor(e){t(this,e),this.internalOffers=[],this.showAll=!1,this.freeLabel="",this.receivedOffer="",this.discountAmountLabel="",this.showMoreOffers="",this.icons={DiscountCouponIcon:'\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>discount-coupon</title>\n<path d="M27 28h-22c-0.552 0-1-0.448-1-1v0c0-1.657-1.343-3-3-3v0c-0.552 0-1-0.448-1-1v0-12c0-0.552 0.448-1 1-1v0c1.657 0 3-1.343 3-3v0c0-0.552 0.448-1 1-1v0h22c0.552 0 1 0.448 1 1v0c0 1.657 1.343 3 3 3v0c0.552 0 1 0.448 1 1v0 12c0 0.552-0.448 1-1 1v0c-1.657 0-3 1.343-3 3v0c0 0.552-0.448 1-1 1v0zM5.9 26h20.2c0.415-1.964 1.936-3.485 3.867-3.894l0.033-0.006v-10.2c-1.964-0.415-3.485-1.936-3.894-3.867l-0.006-0.033h-20.2c-0.415 1.964-1.936 3.485-3.867 3.894l-0.033 0.006v10.2c1.964 0.415 3.485 1.936 3.894 3.867l0.006 0.033zM20 7h2v3h-2v-3zM20 12h2v4h-2v-4zM20 18h2v4h-2v-4zM20 24h2v3h-2v-3zM9 16c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM9 12c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM15 24c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM15 20c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM7 24c-0.552-0-1-0.448-1-1 0-0.244 0.088-0.468 0.233-0.642l-0.001 0.002 10-12c0.185-0.221 0.461-0.36 0.769-0.36 0.553 0 1.001 0.448 1.001 1.001 0 0.245-0.088 0.469-0.233 0.643l0.001-0.002-10 12c-0.185 0.22-0.46 0.358-0.767 0.358-0.001 0-0.002 0-0.003 0h0z"></path>\n</svg>\n',GiftIcon:i,FireIcon:'\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>fire</title>\n<path d="M21.56 3.009c-0.052-0.047-0.116-0.065-0.173-0.103-0.073-0.048-0.143-0.1-0.223-0.132-0.083-0.033-0.165-0.047-0.252-0.063-0.081-0.016-0.16-0.035-0.243-0.035-0.089 0-0.172 0.020-0.26 0.037-0.080 0.016-0.159 0.028-0.236 0.059-0.084 0.035-0.157 0.088-0.235 0.14-0.053 0.036-0.115 0.053-0.165 0.097-0.049 0.044-0.988 0.895-2.288 2.255-2.364-2.839-4.476-4.815-4.576-4.908-0.056-0.052-0.127-0.075-0.188-0.115-0.075-0.049-0.143-0.105-0.224-0.137-0.080-0.032-0.163-0.041-0.245-0.057-0.085-0.016-0.167-0.040-0.252-0.040-0.084 0-0.163 0.023-0.245 0.039-0.087 0.016-0.172 0.025-0.253 0.059-0.080 0.032-0.147 0.087-0.22 0.135-0.063 0.041-0.133 0.064-0.189 0.116-0.453 0.423-11.092 10.408-11.092 18.095 0 7.977 4.935 13.549 12 13.549h8.667c6.673 0 11.333-5.115 11.333-12.439 0-7.052-10.013-16.167-10.44-16.552zM20.667 29.333h-7.777c-2.924 0-4.889-2.044-4.889-5.084 0-2.317 2.816-6.441 4.888-8.887 0.76 0.909 2.755 3.397 3.969 5.869 0.212 0.431 0.639 0.715 1.117 0.743 0.489 0.031 0.937-0.203 1.197-0.605 0.552-0.849 1.109-1.596 1.497-2.093 1.491 1.897 3.331 4.78 3.331 6.399 0 2.188-1.34 3.659-3.333 3.659zM26.537 27.052c0.081-0.44 0.129-0.899 0.129-1.377 0-3.269-3.713-7.847-4.46-8.735l-0.523-0.617c-0.507-0.599-1.528-0.599-2.035 0l-0.531 0.627c-0.147 0.175-0.495 0.599-0.936 1.187-1.595-2.597-3.495-4.776-3.595-4.889l-0.697-0.793c-0.507-0.577-1.499-0.577-2.004 0l-0.697 0.795c-0.6 0.684-5.856 6.803-5.856 11.001 0 0.881 0.127 1.712 0.356 2.484-1.896-1.933-3.023-4.821-3.023-8.283 0-4.915 6.073-11.997 9.329-15.255 1.001 1.008 2.692 2.789 4.368 4.927 0.243 0.309 0.609 0.496 1.001 0.509h0.048c0.376 0 0.735-0.159 0.988-0.439 0.889-0.981 1.693-1.795 2.269-2.359 3.051 2.965 8.663 9.323 8.663 13.727 0 3.171-1.031 5.769-2.796 7.491z"></path>\n</svg>\n',SpecialDiscountIcon:r,TagMoneyIcon:o},this.visibleOffersCount=3,this.handleCartItemUpdated=t=>{const e=t.data?.cart?.items?.find((t=>String(t.id)===String(this.itemId)));e&&(this.internalQuantity=e.quantity,this.internalOffers=e.detailed_offers||[],this.internalProductPrice=e.product_price)},this.toggleShowAll=()=>{this.showAll=!this.showAll}}async componentWillLoad(){await Salla.onReady(),await salla.lang.onLoaded((()=>{this.freeLabel=salla.lang.get("common.elements.freeExclam"),this.receivedOffer=salla.lang.get("pages.cart.received_offer"),this.discountAmountLabel=salla.lang.get("pages.cart.discount_amount"),this.showMoreOffers=salla.lang.get("pages.cart.show_more_offers")})),this.internalQuantity=this.quantity,this.internalOffers=this.parseOffers(this.offers),this.internalProductPrice=this.productPrice}componentDidLoad(){Salla.cart.event.onLatestFetched(this.handleCartItemUpdated),Salla.cart.event.onItemUpdated(this.handleCartItemUpdated),Salla.cart.event.onCouponAdded(this.handleCartItemUpdated),Salla.cart.event.onCouponDeleted(this.handleCartItemUpdated)}parseOffers(t){try{if("string"!=typeof t)return console.warn("Offers is not a string. Returning as-is.",t),Array.isArray(t)?t:[];const e=JSON.parse(t||"[]");return Array.isArray(e)?e:[]}catch(t){return console.error("Failed to parse offers",t),[]}}get visibleOffers(){return this.internalOffers.slice(0,this.visibleOffersCount)}get hiddenOffers(){return this.internalOffers.slice(this.visibleOffersCount)}getPaidQty(t,e){return t-e.free_quantity}renderOffer(t,s){const a=this.getPaidQty(t,s);return e("div",{class:"s-cart-item-offers-box"},s.free_quantity>0&&a>0&&e("div",{class:"s-cart-item-offers-paid-free"},e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(a)," × ",e("span",{innerHTML:salla.money(this.internalProductPrice)})),e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(s.free_quantity)," ×",e("span",{class:"s-cart-item-offers-regular-price",innerHTML:salla.money(this.internalProductPrice)}),e("span",{class:"s-cart-item-offers-free-label"},this.freeLabel))),e("div",{class:"s-cart-item-offers-details"},e("span",{class:"s-cart-item-offers-icon",innerHTML:this.icons[s.discount_icon]||""}),e("div",null,e("p",{class:"s-cart-item-offers-title"},this.receivedOffer.replace(":offer",s.offer_name)),e("p",{class:"s-cart-item-offers-discount"},e("span",{innerHTML:this.discountAmountLabel.replace(":amount",salla.money(s.discount_amount.toFixed(2)))})))))}render(){return this.internalOffers?.length?e("div",{class:"s-cart-item-offers-container",id:`offers_list_${this.itemId}`},this.visibleOffers.map((t=>this.renderOffer(this.internalQuantity,t))),this.internalOffers?.length>this.visibleOffersCount&&e("div",{class:"s-cart-item-offers-show-more"},e("button",{class:"s-cart-item-offers-show-more-btn",onClick:this.toggleShowAll,type:"button"},e("span",{class:"s-cart-item-offers-show-more-label"},"+",this.hiddenOffers.length," ",this.showMoreOffers,e("span",{innerHTML:c,class:{"s-cart-item-offers-arrow-icon":!0,"s-cart-item-offers-arrow-open":this.showAll}})))),this.showAll&&e("div",{class:"s-cart-item-offers-collapsed",id:`offers_${this.itemId}`},this.hiddenOffers.map((t=>this.renderOffer(this.internalQuantity,t))))):null}};f.style="/*!twlt*/:host{display:block}.s-cart-item-offers-box{margin-bottom:0.75rem}.s-cart-item-offers-container{margin-top:1.25rem}.s-cart-item-offers-paid-free{margin-bottom:0.75rem}.s-cart-item-offers-paid-free>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.25rem * var(--tw-space-y-reverse))}.s-cart-item-offers-paid-free{font-weight:500}.s-cart-item-offers-line{text-align:start}.s-cart-item-offers-regular-price{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-cart-item-offers-free-label{margin-left:0.5rem;margin-right:0.5rem;display:inline-block;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.s-cart-item-offers-details{display:flex;align-items:flex-start;gap:0.625rem;--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.s-cart-item-offers-icon{--tw-translate-y:-3px;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.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.s-cart-item-offers-icon svg{width:18px;fill:currentColor}.s-cart-item-offers-title{margin-bottom:0.5rem;font-weight:500}.s-cart-item-offers-message{font-size:0.875rem;line-height:1.25rem}.s-cart-item-offers-discount{margin-top:0px;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-cart-item-offers-show-more-btn{display:flex;align-items:center;justify-content:flex-start !important;background-color:transparent !important;padding-left:0px !important;padding-right:0px !important;font-size:0.875rem;line-height:1.25rem}.s-cart-item-offers-show-more-btn:hover{--tw-text-opacity:1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.s-cart-item-offers-arrow-icon{margin-left:0.125rem;margin-right:0.125rem;transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-cart-item-offers-arrow-open{--tw-rotate:-180deg;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))}.s-cart-item-offers-show-more-btn svg{width:18px}.s-cart-item-offers-show-more-label{display:flex;align-items:center}.s-cart-item-offers-collapsed{margin-top:0.5rem}";const m=class{constructor(e){t(this,e),this.cartSummaryCount=salla.storage.get("cart.summary.count")||0,this.cartSummaryTotal=salla.storage.get("cart.summary.total")||0,this.cartLabel="ar"===salla.config.get("user.language_code")?"السلة":"Cart",this.handleCheckoutClick=t=>{salla.mobile?.isSpaWebview?.()&&salla.mobile.openCheckout&&(t.preventDefault(),salla.mobile.openCheckout(this.getCartLink()))},salla.cart.event.onUpdated((t=>{this.cartSummaryCount=t.count||0,this.cartSummaryTotal=t.total||0}))}async animateToCart(t){if(document.querySelectorAll(".s-cart-thumb").forEach((t=>t.remove())),!t?.src)return void salla.log("Failed to get the img element");let e=this.host.querySelector("#s-cart-icon"),s=e.getBoundingClientRect(),a=s.top+window.scrollY,r=s.left+window.scrollX,i=t.getBoundingClientRect(),o=t.offsetWidth+"px",c=t.offsetHeight+"px",n=i.top,f=i.left,m=document.createElement("img");m.src=t.getAttribute("src"),m.className="s-cart-thumb",m.setAttribute("style","object-fit:cover; width:"+o+"; height:"+c+"; top:"+n+"px; left:"+f+"px;z-index:99999999; "),document.body.append(m);let h=document.querySelector(".s-cart-thumb");e.classList.remove("animated","rubberBand"),(new l.timeline).add({targets:h,width:[150,30],height:[150,30],top:[n,window.scrollY>0?a-window.scrollY-40:a-40],left:[f,r],borderRadius:["20%","50%"],easing:"easeOutExpo",duration:1200},"+=200").add({targets:h,width:[30,0],height:[30,0],opacity:[1,0],easing:"easeOutExpo",top:[window.scrollY>0?a-window.scrollY-40:a-40,window.scrollY>0?a-window.scrollY+10:a+10],left:[r,r+10]},"-=500").add({complete:function(){e.classList.add("animated","rubberBand"),h.remove()}},"-=1700")}componentWillLoad(){return new Promise((t=>salla.onReady(t)))}getCartLink(){let t=salla.url.get("cart");const e=salla.storage.get("scope")||salla.config.get("store.scope");if(e&&e.id)try{const s=new URL(t);return s.searchParams.set("scope",e.id),e.allocation_type&&s.searchParams.set("allocation_type",e.allocation_type),e.allocation_id&&s.searchParams.set("allocation_id",e.allocation_id),s.toString()}catch(s){const a=t.includes("?")?"&":"?",r=new URLSearchParams;return r.set("scope",String(e.id)),e.allocation_type&&r.set("allocation_type",e.allocation_type),e.allocation_id&&r.set("allocation_id",e.allocation_id),`${t}${a}${r.toString()}`}return t}render(){return e(s,{key:"46871f78da79e4ef5e80ab6b840972fedea6b032"},e("a",{key:"c3736429c17efab127aa1546eab87af22987ac1b",class:"s-cart-summary-wrapper",href:this.getCartLink(),onClick:this.handleCheckoutClick},e("div",{key:"ee82c1ff2176f9d04574c63aaad2db6c59799f0d",id:"s-cart-icon"},e("slot",{key:"483cfc04976a7ced4222bcaad065e370a72a8061",name:"icon"},e("i",{key:"0fa8e99e5fea7e88056784e0e0472ff4e927d4ef",class:"s-cart-summary-icon",innerHTML:n}))),e("span",{key:"2091f2ef2aed4c1b34011890c7b0f1fe78813ce4",class:"s-cart-summary-count"},salla.helpers.number(this.cartSummaryCount)),e("p",{key:"c2f6277c2742a9ca339ca39652a6a9119b260eee",class:"s-cart-summary-content"},this.showCartLabel&&e("span",{key:"7d2416455c34c1a4625d1131d99ab94e681f202a",class:"s-cart-summary-label"},this.cartLabel),e("b",{key:"e6546fda5426fbae3b7b7a96217cf15a45e662c9",class:"s-cart-summary-total",innerHTML:salla.money(this.cartSummaryTotal)}))))}get host(){return a(this)}};m.style='/*!twlt*/.block{display:block}.s-cart-summary-wrapper{text-decoration:none;color:var(--color-text);transition:all .5s cubic-bezier(0.2, 1, 0.3, 1);align-items:center;font-weight:bolder;position:relative;display:inline-flex}.s-cart-thumb{position:fixed;transition:all 0.3s cubic-bezier(0.2, 1, 0.3, 1)}.s-cart-summary-icon svg{height:1.25rem;width:1.25rem;fill:var(--color-text)}.s-cart-summary-count{position:absolute;top:-8px;left:-15px;display:inline-flex;height:1.25rem;width:1.25rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1));padding:0.25rem;font-size:0.75rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-cart-summary-count:where([dir="rtl"],[dir="rtl"] *){left:unset;right:-15px}';export{f as salla_cart_item_offers,m as salla_cart_summary}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as t,H as s}from"./p-
|
|
4
|
+
import{r as e,h as t,H as s}from"./p-BXNtVhVe.js";const r=class{constructor(t){e(this,t),this.type="normal",this.width="100%",this.height="100%"}render(){return t(s,{key:"ce408ebbf729ec0b7a044d1146a007ce897a385a",class:"s-skeleton-wrapper",style:{width:this.width,height:this.height}},t("div",{key:"8d9c37eb98c07cd82a3c334650c1220d7715e92e",class:{"s-skeleton-item":!0,"s-skeleton-item-circular":"circle"==this.type}}," "))}};r.style="/*!twlt*/:host{display:block}.s-loyalty-skeleton .s-loyalty-prize-item .s-skeleton-wrapper{margin-left:auto;margin-right:auto}.s-skeleton-wrapper{display:block}@keyframes pulse{50%{opacity:.5}}.s-skeleton-wrapper{animation:pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite}.s-skeleton-item{height:100%;width:100%;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-skeleton-item:is(.dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.s-skeleton-item-circular{border-radius:9999px}";export{r as salla_skeleton}
|
|
@@ -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,a as i}from"./p-DSEA3vdh.js";import{C as o}from"./p-BsLF_HK7.js";const a=class{constructor(e){s(this,e),this.isVisible=!0,this.step="consent",this.isMobile=!1,this.mobileBreakpoint=768,this.mobileQueryHandler=s=>this.isMobile=s.matches,this.openRequestedHandler=()=>this.open(),this.authLoggedInHandler=()=>this.syncConsentAfterLogin(),this.authLoggedOutHandler=()=>this.clearLocalConsent(),this.necessaryCookieKey="necessary_cookies",this.performanceCookieKey="performance_cookies",this.functionalCookieKey="functional_cookies",this.advertisingCookieKey="advertising_cookies",this.consentCookieDays=365,this.trackingCookiesByCategory={performance_cookies:["_ga","_ga_*","_gid","_gat","_gat_gtag_*","_hjSessionUser_*","_hjSession_*","_hjIncludedInSessionSample_*","_hjAbsoluteSessionInProgress","_hjFirstSeen","_clck","_clsk","MUID","MR","ANONCHK","_ym_uid","_ym_d","_ym_isad"],advertising_cookies:["_gcl_au","_gcl_aw","_gcl_dc","IDE","test_cookie","1P_JAR","NID","_fbp","_fbc","fr","_ttp","_scid","sc_at","personalization_id","guest_id","muc_ads","_pin_unauth","_pinterest_ct_ua","li_sugr","bcookie","lidc","UserMatchHistory","AnalyticsSyncHistory"],functional_cookies:["intercom-id-*","intercom-session-*","__zlcmid","crisp-client%2Fsession%2F*","YSC","VISITOR_INFO1_LIVE","PREF"]},this.performanceEnabled=!1,this.functionsEnabled=!1,this.adsEnabled=!1}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),this.loadTranslations(),Salla.event.on("salla-cookies-bar::open",this.openRequestedHandler),Salla.event.on("auth::logged.in",this.authLoggedInHandler),Salla.event.on("auth::logged.out",this.authLoggedOutHandler),this.unregisterAfterFetchMenuItemsHook=Salla.hooks.registerHook("salla-menu","afterFetchMenuItems",(s=>this.appendCookiesSettingsLink(s))),this.hydrateToggleState(),Salla.storage.get("cookies-consent")&&(this.isVisible=!1),this.enforceCurrentConsent()}isArabicLocale(){return(Salla.lang.getLocale?.()??document.documentElement.lang??"ar").toLowerCase().startsWith("ar")}translate(s,e,t){const i=Salla.lang.get(s);return i&&i!==s?i:this.isArabicLocale()?e:t}loadTranslations(){this.titleLabel=this.translate("common.cookies.settings_title","تخصيص إعدادات ملفات تعريف الارتباط","Customize Cookie Preferences Settings"),this.saveLabel=this.translate("common.cookies.save","حفظ الخيارات","Save Options"),this.messageLabel=Salla.lang.get("common.cookies.message"),this.linkLabel=Salla.lang.get("common.cookies.link"),this.acceptLabel=this.translate("common.cookies.accept","قبول","Accept"),this.acceptAllLabel=this.translate("common.cookies.accept_all","قبول الكل","Accept All"),this.customizeLabel=this.translate("common.cookies.customize","تخصيص","Customize"),this.essentialTitleLabel=this.translate("common.cookies.categories.essential.title","ملفات تعريف الارتباط الضرورية","Essential Cookies"),this.essentialDescriptionLabel=this.translate("common.cookies.categories.essential.description","ضروريه لتشغيل الوظائف الأساسية للموقع الإلكتروني.","Required for the website's basic functions."),this.essentialBadgeLabel=this.translate("common.cookies.categories.essential.badge","إجباري","Required"),this.performanceTitleLabel=this.translate("common.cookies.categories.performance.title","ملفات تعريف الارتباط الخاصة بالأداء","Performance Cookies"),this.performanceDescriptionLabel=this.translate("common.cookies.categories.performance.description","تساعدنا في تحليل كيفية استخدامك للموقع وتحسين أدائه.","Help us analyze site usage and improve performance."),this.functionsTitleLabel=this.translate("common.cookies.categories.functions.title","ملفات تعريف الارتباط الوظيفية","Functional Cookies"),this.functionsDescriptionLabel=this.translate("common.cookies.categories.functions.description","تُتيح لك تجربة مخصصة وتفعيل ميزات متقدمة داخل الموقع.","Enable enhanced functionality and personalization."),this.adsTitleLabel=this.translate("common.cookies.categories.ads.title","ملفات تعريف الارتباط الإعلانية","Advertising Cookies"),this.adsDescriptionLabel=this.translate("common.cookies.categories.ads.description","تُستخدم لعرض محتوى تسويقي مخصص يناسب اهتماماتك.","Allow personalized content.")}componentDidLoad(){this.mobileQuery=window.matchMedia(`(max-width: ${this.mobileBreakpoint-1}px)`),this.isMobile=this.mobileQuery.matches,this.mobileQuery.addEventListener("change",this.mobileQueryHandler)}disconnectedCallback(){this.mobileQuery?.removeEventListener("change",this.mobileQueryHandler),Salla.event.off("salla-cookies-bar::open",this.openRequestedHandler),Salla.event.off("auth::logged.in",this.authLoggedInHandler),Salla.event.off("auth::logged.out",this.authLoggedOutHandler),this.unregisterAfterFetchMenuItemsHook?.(),this.unregisterAfterFetchMenuItemsHook=void 0}allCategoryKeys(){return[this.necessaryCookieKey,this.performanceCookieKey,this.functionalCookieKey,this.advertisingCookieKey]}writeLocalConsentCookies(s){for(const e of this.allCategoryKeys())Salla.cookie.set(e,String(e===this.necessaryCookieKey||s.includes(e)),this.consentCookieDays)}applyConsent(s){this.writeLocalConsentCookies(s),this.sweepDisabledCategoryCookies(s),Salla.config.isGuest()||Salla.api.request("account/data-privacy",{points:s},"post").catch((()=>{}))}currentConsentPoints(){return Salla.storage.get("cookies-consent")?this.allCategoryKeys().filter((s=>s===this.necessaryCookieKey||"true"===Salla.cookie.get(s))):null}enforceCurrentConsent(){const s=this.currentConsentPoints();s&&this.sweepDisabledCategoryCookies(s)}hydrateToggleState(){const s=this.currentConsentPoints();s&&(this.performanceEnabled=s.includes(this.performanceCookieKey),this.functionsEnabled=s.includes(this.functionalCookieKey),this.adsEnabled=s.includes(this.advertisingCookieKey))}clearLocalConsent(){for(const s of this.allCategoryKeys())Salla.cookie.remove(s);Salla.storage.remove("cookies-consent"),this.isVisible=!0}syncConsentAfterLogin(){const s=this.currentConsentPoints();s&&Salla.api.request("account/data-privacy",{points:s},"post").catch((()=>{}))}cookieNameMatchesPattern(s,e){return e.endsWith("*")?s.startsWith(e.slice(0,-1)):s===e}sweepDisabledCategoryCookies(s){const e=Object.keys(this.trackingCookiesByCategory).filter((e=>!s.includes(e)));if(!e.length)return;const t=e.flatMap((s=>this.trackingCookiesByCategory[s]));document.cookie.split(";").map((s=>s.split("=")[0].trim())).filter((s=>t.some((e=>this.cookieNameMatchesPattern(s,e))))).forEach((s=>Salla.cookie.remove(s)))}dismiss(s){this.isVisible=!1,Salla.event.emit(`salla-cookies-bar::${s}`),Salla.storage.set("cookies-consent",s)}savePreferences(){const s=[this.necessaryCookieKey];this.performanceEnabled&&s.push(this.performanceCookieKey),this.functionsEnabled&&s.push(this.functionalCookieKey),this.adsEnabled&&s.push(this.advertisingCookieKey),this.applyConsent(s),this.dismiss("accepted")}async accept(){return this.applyConsent(this.allCategoryKeys()),this.dismiss("accepted"),this.host}async reject(){return this.applyConsent([this.necessaryCookieKey]),this.dismiss("rejected"),this.host}async open(){return this.hydrateToggleState(),this.step="consent",this.isVisible=!0,this.host}openPreferences(){this.hydrateToggleState(),this.step="preferences"}isRtl(){return Salla.config.get("theme.is_rtl",!0)}appendCookiesSettingsLink(s){const e=Salla.config.get("store.features")?.includes("website-cookies");if(!e||!s?.withCookiePreferences||"footer"!==s?.source)return;const t="#cookies-settings",i=s?.menus.some((s=>s?.url===t));i||(s.menus=[...s.menus,{id:"cookies-settings",order:null,title:Salla.lang.get("common.cookies.settings"),url:t,target:"_self",is_by_form_builder:!1,children:[],image:null,callback:()=>Salla.event.emit("salla-cookies-bar::open")}])}renderToggle(s,t,i,o){return e("label",{class:{"s-toggle":!0,"s-toggle--disabled":t}},e("input",{class:"s-toggle-input",type:"checkbox",checked:s,disabled:t,"aria-label":i,onChange:()=>o?.()}),e("div",{class:"s-toggle-switcher"}))}renderCategory(s,t,i,o){return e("div",{class:"s-cookies-bar-category"},e("div",{class:"s-cookies-bar-category-content"},e("div",{class:"s-cookies-bar-category-title-row"},e("span",{class:"s-cookies-bar-category-title"},s),o&&e("span",{class:"s-cookies-bar-badge"},o)),e("p",{class:"s-cookies-bar-category-description m-0"},t)),i)}renderMessage(){return e("p",{class:"s-cookies-bar-message m-0"},this.messageLabel,Salla.config.get("policy_url")&&e("a",{href:Salla.config.get("policy_url"),target:"_blank",class:"s-cookies-bar-link text-primary ms-1"}," ",this.linkLabel))}renderConsentStep(){return e("div",{class:"s-cookies-bar-consent"},this.renderMessage(),e("div",{class:"s-cookies-bar-consent-actions"},e("salla-button",{class:"s-cookies-bar-btn--customize",color:"primary",fill:"outline",type:"button",size:this.isMobile?"small":"medium",onClick:()=>this.openPreferences()},this.customizeLabel),e("salla-button",{class:"s-cookies-bar-btn--accept",color:"primary",fill:"solid",type:"button",size:this.isMobile?"small":"medium",onClick:()=>this.accept()},this.acceptAllLabel)))}renderPreferencesStep(){return e("div",null,e("div",{class:"s-cookies-bar-header"},e("h3",{class:"s-cookies-bar-title m-0"},this.titleLabel),e("button",{type:"button",class:"s-cookies-bar-close","aria-label":this.titleLabel,onClick:()=>this.reject()},e("span",{innerHTML:o}))),e("div",{class:"s-cookies-bar-categories"},this.renderCategory(this.essentialTitleLabel,this.essentialDescriptionLabel,this.renderToggle(!0,!0,this.essentialTitleLabel),this.essentialBadgeLabel),this.renderCategory(this.performanceTitleLabel,this.performanceDescriptionLabel,this.renderToggle(this.performanceEnabled,!1,this.performanceTitleLabel,(()=>this.performanceEnabled=!this.performanceEnabled))),this.renderCategory(this.functionsTitleLabel,this.functionsDescriptionLabel,this.renderToggle(this.functionsEnabled,!1,this.functionsTitleLabel,(()=>this.functionsEnabled=!this.functionsEnabled))),this.renderCategory(this.adsTitleLabel,this.adsDescriptionLabel,this.renderToggle(this.adsEnabled,!1,this.adsTitleLabel,(()=>this.adsEnabled=!this.adsEnabled)))),e("div",{class:"s-cookies-bar-footer"},this.renderMessage(),e("salla-button",{class:"s-cookies-bar-btn--save",color:"primary",fill:"solid",type:"button",size:this.isMobile?"small":"medium",onClick:()=>this.savePreferences()},this.saveLabel)))}render(){return this.isVisible?e(t,null,e("div",{dir:this.isRtl()?"rtl":"ltr",class:"s-cookies-bar"},"consent"===this.step?this.renderConsentStep():this.renderPreferencesStep())):e(t,null)}get host(){return i(this)}};a.style='/*!twlt*/:host{display:block;overflow:visible}.s-cookies-bar{position:fixed;bottom:1rem;left:50%;transform:translateX(-50%);z-index:100;background-color:#fff;border-radius:1rem;padding:1.25rem;width:calc(100% - 2rem);max-width:48rem;box-shadow:0 10px 30px -5px rgba(0, 0, 0, 0.2)}.s-cookies-bar-consent{display:flex;flex-direction:row;align-items:center;gap:1rem;flex-wrap:wrap}@media (max-width: 640px){.s-cookies-bar-consent{flex-direction:column;align-items:end}}.s-cookies-bar-consent-actions{display:flex;align-items:center;gap:0.75rem;flex-shrink:0}.s-cookies-bar-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1.25rem}.s-cookies-bar-title{font-size:1rem;font-weight:bold;color:#1f2937}.s-cookies-bar-close{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;border:none;background:transparent;cursor:pointer;flex-shrink:0}.s-cookies-bar-close svg{width:1.125rem;height:1.125rem;fill:currentColor}.s-cookies-bar-close:hover{color:#4b5563}.s-cookies-bar-categories{display:flex;flex-direction:column;gap:1rem}.s-cookies-bar-category{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.s-cookies-bar-category .s-toggle{flex-shrink:0}.s-cookies-bar-category .s-toggle--disabled{cursor:not-allowed}.s-cookies-bar-category-title-row{display:flex;align-items:center;gap:0.5rem}.s-cookies-bar-category-title{font-size:0.875rem;font-weight:500;color:#1f2937}.s-cookies-bar-category-description{font-size:0.75rem;color:#9ca3af;margin-top:0.25rem}.s-cookies-bar-badge{display:inline-flex;align-items:center;padding:0.0625rem 0.5rem;border-radius:9999px;background-color:#f3f4f6;color:#6b7280;font-size:0.6875rem;font-weight:500;white-space:nowrap}.s-cookies-bar-footer{display:flex;align-items:center;gap:0.75rem;margin-top:1.25rem;padding-top:1.25rem;border-top:1px solid #e5e7eb}.s-cookies-bar-message{flex:1;font-size:0.75rem;line-height:1.625;font-weight:700}.s-cookies-bar-btn--save{flex-shrink:0}.visible{visibility:visible}.invisible{visibility:hidden}.m-0{margin:0px}.ms-1{margin-inline-start:0.25rem}.resize{resize:both}.text-primary{color:var(--color-primary)}.shadow{--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)}.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)}.toggle-checkbox .s-toggle-input{position:absolute;visibility:hidden}.toggle-checkbox .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.toggle-checkbox .s-toggle-switcher:before,.toggle-checkbox .s-toggle-switcher:after{content:""}.toggle-checkbox .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.toggle-checkbox .s-toggle-input:checked+div{background:#30D158}.toggle-checkbox .s-toggle-input:checked+div:before{left:18px}.s-toggle{cursor:pointer;display:inline-block}.s-toggle .s-toggle-input{position:absolute;visibility:hidden}.s-toggle .s-toggle-label{margin-left:5px;position:relative;top:2px}.s-toggle .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.s-toggle .s-toggle-switcher:before,.s-toggle .s-toggle-switcher:after{content:""}.s-toggle .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.s-toggle .s-toggle-input:checked+div{background:#30D158}.s-toggle .s-toggle-input:checked+div:before{left:18px}';export{a as salla_cookies_bar}
|
|
4
|
+
import{r as s,h as e,H as t,a as i}from"./p-BXNtVhVe.js";import{C as o}from"./p-BsLF_HK7.js";const a=class{constructor(e){s(this,e),this.isVisible=!0,this.step="consent",this.isMobile=!1,this.mobileBreakpoint=768,this.mobileQueryHandler=s=>this.isMobile=s.matches,this.openRequestedHandler=()=>this.open(),this.authLoggedInHandler=()=>this.syncConsentAfterLogin(),this.authLoggedOutHandler=()=>this.clearLocalConsent(),this.necessaryCookieKey="necessary_cookies",this.performanceCookieKey="performance_cookies",this.functionalCookieKey="functional_cookies",this.advertisingCookieKey="advertising_cookies",this.consentCookieDays=365,this.trackingCookiesByCategory={performance_cookies:["_ga","_ga_*","_gid","_gat","_gat_gtag_*","_hjSessionUser_*","_hjSession_*","_hjIncludedInSessionSample_*","_hjAbsoluteSessionInProgress","_hjFirstSeen","_clck","_clsk","MUID","MR","ANONCHK","_ym_uid","_ym_d","_ym_isad"],advertising_cookies:["_gcl_au","_gcl_aw","_gcl_dc","IDE","test_cookie","1P_JAR","NID","_fbp","_fbc","fr","_ttp","_scid","sc_at","personalization_id","guest_id","muc_ads","_pin_unauth","_pinterest_ct_ua","li_sugr","bcookie","lidc","UserMatchHistory","AnalyticsSyncHistory"],functional_cookies:["intercom-id-*","intercom-session-*","__zlcmid","crisp-client%2Fsession%2F*","YSC","VISITOR_INFO1_LIVE","PREF"]},this.performanceEnabled=!1,this.functionsEnabled=!1,this.adsEnabled=!1}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),this.loadTranslations(),Salla.event.on("salla-cookies-bar::open",this.openRequestedHandler),Salla.event.on("auth::logged.in",this.authLoggedInHandler),Salla.event.on("auth::logged.out",this.authLoggedOutHandler),this.unregisterAfterFetchMenuItemsHook=Salla.hooks.registerHook("salla-menu","afterFetchMenuItems",(s=>this.appendCookiesSettingsLink(s))),this.hydrateToggleState(),Salla.storage.get("cookies-consent")&&(this.isVisible=!1),this.enforceCurrentConsent()}isArabicLocale(){return(Salla.lang.getLocale?.()??document.documentElement.lang??"ar").toLowerCase().startsWith("ar")}translate(s,e,t){const i=Salla.lang.get(s);return i&&i!==s?i:this.isArabicLocale()?e:t}loadTranslations(){this.titleLabel=this.translate("common.cookies.settings_title","تخصيص إعدادات ملفات تعريف الارتباط","Customize Cookie Preferences Settings"),this.saveLabel=this.translate("common.cookies.save","حفظ الخيارات","Save Options"),this.messageLabel=Salla.lang.get("common.cookies.message"),this.linkLabel=Salla.lang.get("common.cookies.link"),this.acceptLabel=this.translate("common.cookies.accept","قبول","Accept"),this.acceptAllLabel=this.translate("common.cookies.accept_all","قبول الكل","Accept All"),this.customizeLabel=this.translate("common.cookies.customize","تخصيص","Customize"),this.essentialTitleLabel=this.translate("common.cookies.categories.essential.title","ملفات تعريف الارتباط الضرورية","Essential Cookies"),this.essentialDescriptionLabel=this.translate("common.cookies.categories.essential.description","ضروريه لتشغيل الوظائف الأساسية للموقع الإلكتروني.","Required for the website's basic functions."),this.essentialBadgeLabel=this.translate("common.cookies.categories.essential.badge","إجباري","Required"),this.performanceTitleLabel=this.translate("common.cookies.categories.performance.title","ملفات تعريف الارتباط الخاصة بالأداء","Performance Cookies"),this.performanceDescriptionLabel=this.translate("common.cookies.categories.performance.description","تساعدنا في تحليل كيفية استخدامك للموقع وتحسين أدائه.","Help us analyze site usage and improve performance."),this.functionsTitleLabel=this.translate("common.cookies.categories.functions.title","ملفات تعريف الارتباط الوظيفية","Functional Cookies"),this.functionsDescriptionLabel=this.translate("common.cookies.categories.functions.description","تُتيح لك تجربة مخصصة وتفعيل ميزات متقدمة داخل الموقع.","Enable enhanced functionality and personalization."),this.adsTitleLabel=this.translate("common.cookies.categories.ads.title","ملفات تعريف الارتباط الإعلانية","Advertising Cookies"),this.adsDescriptionLabel=this.translate("common.cookies.categories.ads.description","تُستخدم لعرض محتوى تسويقي مخصص يناسب اهتماماتك.","Allow personalized content.")}componentDidLoad(){this.mobileQuery=window.matchMedia(`(max-width: ${this.mobileBreakpoint-1}px)`),this.isMobile=this.mobileQuery.matches,this.mobileQuery.addEventListener("change",this.mobileQueryHandler)}disconnectedCallback(){this.mobileQuery?.removeEventListener("change",this.mobileQueryHandler),Salla.event.off("salla-cookies-bar::open",this.openRequestedHandler),Salla.event.off("auth::logged.in",this.authLoggedInHandler),Salla.event.off("auth::logged.out",this.authLoggedOutHandler),this.unregisterAfterFetchMenuItemsHook?.(),this.unregisterAfterFetchMenuItemsHook=void 0}allCategoryKeys(){return[this.necessaryCookieKey,this.performanceCookieKey,this.functionalCookieKey,this.advertisingCookieKey]}writeLocalConsentCookies(s){for(const e of this.allCategoryKeys())Salla.cookie.set(e,String(e===this.necessaryCookieKey||s.includes(e)),this.consentCookieDays)}applyConsent(s){this.writeLocalConsentCookies(s),this.sweepDisabledCategoryCookies(s),Salla.config.isGuest()||Salla.api.request("account/data-privacy",{points:s},"post").catch((()=>{}))}currentConsentPoints(){return Salla.storage.get("cookies-consent")?this.allCategoryKeys().filter((s=>s===this.necessaryCookieKey||"true"===Salla.cookie.get(s))):null}enforceCurrentConsent(){const s=this.currentConsentPoints();s&&this.sweepDisabledCategoryCookies(s)}hydrateToggleState(){const s=this.currentConsentPoints();s&&(this.performanceEnabled=s.includes(this.performanceCookieKey),this.functionsEnabled=s.includes(this.functionalCookieKey),this.adsEnabled=s.includes(this.advertisingCookieKey))}clearLocalConsent(){for(const s of this.allCategoryKeys())Salla.cookie.remove(s);Salla.storage.remove("cookies-consent"),this.isVisible=!0}syncConsentAfterLogin(){const s=this.currentConsentPoints();s&&Salla.api.request("account/data-privacy",{points:s},"post").catch((()=>{}))}cookieNameMatchesPattern(s,e){return e.endsWith("*")?s.startsWith(e.slice(0,-1)):s===e}sweepDisabledCategoryCookies(s){const e=Object.keys(this.trackingCookiesByCategory).filter((e=>!s.includes(e)));if(!e.length)return;const t=e.flatMap((s=>this.trackingCookiesByCategory[s]));document.cookie.split(";").map((s=>s.split("=")[0].trim())).filter((s=>t.some((e=>this.cookieNameMatchesPattern(s,e))))).forEach((s=>Salla.cookie.remove(s)))}dismiss(s){this.isVisible=!1,Salla.event.emit(`salla-cookies-bar::${s}`),Salla.storage.set("cookies-consent",s)}savePreferences(){const s=[this.necessaryCookieKey];this.performanceEnabled&&s.push(this.performanceCookieKey),this.functionsEnabled&&s.push(this.functionalCookieKey),this.adsEnabled&&s.push(this.advertisingCookieKey),this.applyConsent(s),this.dismiss("accepted")}async accept(){return this.applyConsent(this.allCategoryKeys()),this.dismiss("accepted"),this.host}async reject(){return this.applyConsent([this.necessaryCookieKey]),this.dismiss("rejected"),this.host}async open(){return this.hydrateToggleState(),this.step="consent",this.isVisible=!0,this.host}openPreferences(){this.hydrateToggleState(),this.step="preferences"}isRtl(){return Salla.config.get("theme.is_rtl",!0)}appendCookiesSettingsLink(s){const e=Salla.config.get("store.features")?.includes("website-cookies");if(!e||!s?.withCookiePreferences||"footer"!==s?.source)return;const t="#cookies-settings",i=s?.menus.some((s=>s?.url===t));i||(s.menus=[...s.menus,{id:"cookies-settings",order:null,title:Salla.lang.get("common.cookies.settings"),url:t,target:"_self",is_by_form_builder:!1,children:[],image:null,callback:()=>Salla.event.emit("salla-cookies-bar::open")}])}renderToggle(s,t,i,o){return e("label",{class:{"s-toggle":!0,"s-toggle--disabled":t}},e("input",{class:"s-toggle-input",type:"checkbox",checked:s,disabled:t,"aria-label":i,onChange:()=>o?.()}),e("div",{class:"s-toggle-switcher"}))}renderCategory(s,t,i,o){return e("div",{class:"s-cookies-bar-category"},e("div",{class:"s-cookies-bar-category-content"},e("div",{class:"s-cookies-bar-category-title-row"},e("span",{class:"s-cookies-bar-category-title"},s),o&&e("span",{class:"s-cookies-bar-badge"},o)),e("p",{class:"s-cookies-bar-category-description m-0"},t)),i)}renderMessage(){return e("p",{class:"s-cookies-bar-message m-0"},this.messageLabel,Salla.config.get("policy_url")&&e("a",{href:Salla.config.get("policy_url"),target:"_blank",class:"s-cookies-bar-link text-primary ms-1"}," ",this.linkLabel))}renderConsentStep(){return e("div",{class:"s-cookies-bar-consent"},this.renderMessage(),e("div",{class:"s-cookies-bar-consent-actions"},e("salla-button",{class:"s-cookies-bar-btn--customize",color:"primary",fill:"outline",type:"button",size:this.isMobile?"small":"medium",onClick:()=>this.openPreferences()},this.customizeLabel),e("salla-button",{class:"s-cookies-bar-btn--accept",color:"primary",fill:"solid",type:"button",size:this.isMobile?"small":"medium",onClick:()=>this.accept()},this.acceptAllLabel)))}renderPreferencesStep(){return e("div",null,e("div",{class:"s-cookies-bar-header"},e("h3",{class:"s-cookies-bar-title m-0"},this.titleLabel),e("button",{type:"button",class:"s-cookies-bar-close","aria-label":this.titleLabel,onClick:()=>this.reject()},e("span",{innerHTML:o}))),e("div",{class:"s-cookies-bar-categories"},this.renderCategory(this.essentialTitleLabel,this.essentialDescriptionLabel,this.renderToggle(!0,!0,this.essentialTitleLabel),this.essentialBadgeLabel),this.renderCategory(this.performanceTitleLabel,this.performanceDescriptionLabel,this.renderToggle(this.performanceEnabled,!1,this.performanceTitleLabel,(()=>this.performanceEnabled=!this.performanceEnabled))),this.renderCategory(this.functionsTitleLabel,this.functionsDescriptionLabel,this.renderToggle(this.functionsEnabled,!1,this.functionsTitleLabel,(()=>this.functionsEnabled=!this.functionsEnabled))),this.renderCategory(this.adsTitleLabel,this.adsDescriptionLabel,this.renderToggle(this.adsEnabled,!1,this.adsTitleLabel,(()=>this.adsEnabled=!this.adsEnabled)))),e("div",{class:"s-cookies-bar-footer"},this.renderMessage(),e("salla-button",{class:"s-cookies-bar-btn--save",color:"primary",fill:"solid",type:"button",size:this.isMobile?"small":"medium",onClick:()=>this.savePreferences()},this.saveLabel)))}render(){return this.isVisible?e(t,null,e("div",{dir:this.isRtl()?"rtl":"ltr",class:"s-cookies-bar"},"consent"===this.step?this.renderConsentStep():this.renderPreferencesStep())):e(t,null)}get host(){return i(this)}};a.style='/*!twlt*/:host{display:block;overflow:visible}.s-cookies-bar{position:fixed;bottom:1rem;left:50%;transform:translateX(-50%);z-index:100;background-color:#fff;border-radius:1rem;padding:1.25rem;width:calc(100% - 2rem);max-width:48rem;box-shadow:0 10px 30px -5px rgba(0, 0, 0, 0.2)}.s-cookies-bar-consent{display:flex;flex-direction:row;align-items:center;gap:1rem;flex-wrap:wrap}@media (max-width: 640px){.s-cookies-bar-consent{flex-direction:column;align-items:end}}.s-cookies-bar-consent-actions{display:flex;align-items:center;gap:0.75rem;flex-shrink:0}.s-cookies-bar-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1.25rem}.s-cookies-bar-title{font-size:1rem;font-weight:bold;color:#1f2937}.s-cookies-bar-close{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;border:none;background:transparent;cursor:pointer;flex-shrink:0}.s-cookies-bar-close svg{width:1.125rem;height:1.125rem;fill:currentColor}.s-cookies-bar-close:hover{color:#4b5563}.s-cookies-bar-categories{display:flex;flex-direction:column;gap:1rem}.s-cookies-bar-category{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.s-cookies-bar-category .s-toggle{flex-shrink:0}.s-cookies-bar-category .s-toggle--disabled{cursor:not-allowed}.s-cookies-bar-category-title-row{display:flex;align-items:center;gap:0.5rem}.s-cookies-bar-category-title{font-size:0.875rem;font-weight:500;color:#1f2937}.s-cookies-bar-category-description{font-size:0.75rem;color:#9ca3af;margin-top:0.25rem}.s-cookies-bar-badge{display:inline-flex;align-items:center;padding:0.0625rem 0.5rem;border-radius:9999px;background-color:#f3f4f6;color:#6b7280;font-size:0.6875rem;font-weight:500;white-space:nowrap}.s-cookies-bar-footer{display:flex;align-items:center;gap:0.75rem;margin-top:1.25rem;padding-top:1.25rem;border-top:1px solid #e5e7eb}.s-cookies-bar-message{flex:1;font-size:0.75rem;line-height:1.625;font-weight:700}.s-cookies-bar-btn--save{flex-shrink:0}.visible{visibility:visible}.invisible{visibility:hidden}.m-0{margin:0px}.ms-1{margin-inline-start:0.25rem}.resize{resize:both}.text-primary{color:var(--color-primary)}.shadow{--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)}.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)}.toggle-checkbox .s-toggle-input{position:absolute;visibility:hidden}.toggle-checkbox .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.toggle-checkbox .s-toggle-switcher:before,.toggle-checkbox .s-toggle-switcher:after{content:""}.toggle-checkbox .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.toggle-checkbox .s-toggle-input:checked+div{background:#30D158}.toggle-checkbox .s-toggle-input:checked+div:before{left:18px}.s-toggle{cursor:pointer;display:inline-block}.s-toggle .s-toggle-input{position:absolute;visibility:hidden}.s-toggle .s-toggle-label{margin-left:5px;position:relative;top:2px}.s-toggle .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.s-toggle .s-toggle-switcher:before,.s-toggle .s-toggle-switcher:after{content:""}.s-toggle .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.s-toggle .s-toggle-input:checked+div{background:#30D158}.s-toggle .s-toggle-input:checked+div:before{left:18px}';export{a as salla_cookies_bar}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,c as i,h as e,H as s,a as r}from"./p-DSEA3vdh.js";import{F as a,H as o}from"./p-CUSw0W26.js";import"./p-CgtvEd63.js";const n=class{constructor(e){t(this,e),this.changed=i(this,"changed"),this.initialItemCount=10,this.expandedItemCount=15,this.calculatedInitialHeight=0,this.calculatedExpandedHeight=0,this.isOpen=!0,this.isShowMore=!1,this.showMoreLabel="عرض المزيد",this.showLessLabel="عرض أقل",this.page=salla.config.get("page"),this.searchQuery="",this.filteredCount=0}connectedCallback(){this.withLoadMore="price"!=this.option.key&&Array.isArray(this.option.values)&&this.option.values.length>this.initialItemCount,salla.onReady((()=>{this.page=salla.config.get("page")})),salla.lang.onLoaded((()=>{this.showMoreLabel=salla.lang.getWithDefault("common.titles.more",this.showMoreLabel),this.showLessLabel=salla.lang.getWithDefault("common.elements.show_less",this.showLessLabel)}))}componentDidLoad(){const t=this.widgetValues.querySelectorAll(".s-filters-label");if(t.length>0){const i=Math.min(this.initialItemCount,t.length);this.calculatedInitialHeight=35*this.initialItemCount,this.calculatedExpandedHeight=t.length>this.initialItemCount?35*this.expandedItemCount:35*i}this.widgetValues.scrollHeight<this.calculatedInitialHeight&&(this.withLoadMore=!1),this.withLoadMore&&this.widgetValues&&(this.widgetValues.style.maxHeight=`${this.calculatedInitialHeight}px`),this.widgetContent.style.height=`${this.widgetContent.scrollHeight}px`}async setWidgetHeight(t=250){this.widgetContent.removeAttribute("style"),setTimeout((()=>{this.widgetContent.style.height=this.widgetContent.scrollHeight+"px"}),t)}async reset(){this.option.type===a.RANGE&&this.priceRange.reset(),Array.from(this.host.querySelectorAll("input")).forEach((t=>t.checked=!1))}async showMore(){this.isShowMore=!this.isShowMore,this.widgetContent.style.height="auto",this.isShowMore||(this.widgetValues.scrollTop=0);const t=this.isShowMore?this.calculatedExpandedHeight:this.calculatedInitialHeight,i=this.searchQuery?this.filteredCount:Array.isArray(this.option.values)?this.option.values.length:0;this.widgetValues.style.maxHeight=`${t}px`,this.widgetValues.style.overflowY=this.isShowMore&&i>this.expandedItemCount?"auto":"hidden",setTimeout((()=>{this.widgetContent.style.height=`${this.widgetContent.scrollHeight}px`}),400)}async toggleWidget(){this.isOpen=!this.isOpen,o.toggleElementClassIf(this.widgetContent,"s-filters-widget-opened","s-filters-widget-closed",(()=>this.isOpen))}renderFilterOption(t){if(![a.VALUES,a.MINIMUM,a.VARIANTS].includes(t.type))return"";const i=t.values.filter((t=>{if(!this.searchQuery)return!0;const i="number"==typeof t?String(t):t?.value||t?.key||"";return String(i).toLowerCase().includes(this.searchQuery.toLowerCase())}));return this.filteredCount=i.length,0===i.length?e("div",{class:"s-filters-widget-empty-state"},salla.lang.get("common.elements.no_options")||"لا توجد نتائج"):i.map((i=>{let s="number"==typeof i?i:i.key||i.value;return e("label",{class:"s-filters-label",htmlFor:`${t.key}-option-${s}`,key:`${t.key}-option-${s}`},e("input",{id:`${t.key}-option-${s}`,name:t.key,type:t.type===a.VALUES?"checkbox":"radio",checked:this.isSelectedOption(t,s),class:t.type===a.VALUES?"s-filters-checkbox":"s-filters-radio",onChange:i=>this.changed.emit({event:i,option:t,value:s})}),this.getOptionLabel(t,i))}))}isSelectedOption(t,i){if(t.type===a.MINIMUM)return this.filtersData[t.key]==i;if(t.type===a.VARIANTS)return this.filtersData[t.type]&&this.filtersData[t.type][t.key]==i;if(t.type===a.RANGE)return this.filtersData[t.key]&&this.filtersData[t.key].min==i.min&&this.filtersData[t.key].max==i.max;if(t.type===a.VALUES){const e=this.filtersData[t.key];return Array.isArray(e)?e.some((t=>Number(t)===Number(i))):null!=e&&Number(e)===Number(i)}return!1}getOptionLabel(t,i){if("rating"==t.key)return e("salla-rating-stars",{size:"small",value:i});let s=i.value||"null";return null!=i.count&&(s+=` (${salla.helpers.number(i.count)})`),e("span",{class:"s-filters-option-name"},s)}render(){return e(s,{key:"af3f05601697115a001949d5c23d8925f6c68135",class:"s-filters-widget-container"},e("h3",{key:"689046ac453166e29fdb4e3ad10568a989446bfb",class:"s-filters-widget-title",onClick:()=>this.toggleWidget()},e("span",{key:"00d65abda360e88e26a08016bb1bd23eceee9f4b"},this.option.label),e("span",{key:"1915aaec2e1ea66235071f0b4f872bd6d9717a21",class:"s-filters-widget-plusminus "+(this.isOpen?"s-filters-widget-plusminus-active":"")})),e("div",{key:"d94f99643aa914391f131acebfb71d4183263df5",class:"s-filters-widget-content",ref:t=>this.widgetContent=t},Array.isArray(this.option.values)&&this.option.values.length>5&&e("div",{key:"0b67486012b38ce82a377b0f3cb6465892d718ae",class:"s-filters-widget-search-wrapper",style:{padding:"8px 0",marginBottom:"8px"}},e("input",{key:"00bf03c96c9fa7199872f1444c4484bf23049dd4",type:"text",class:"s-filters-widget-search-input",placeholder:salla.lang.get("blocks.header.search_placeholder")||"بحث...",value:this.searchQuery,onInput:t=>this.searchQuery=t.target.value})),e("div",{key:"79b29b30854583559ee8b0082210ad2f34e31e1a",class:"s-filters-widget-values",ref:t=>this.widgetValues=t},e("slot",{key:"0e657a77d5e62ee04cf2d3bd30982bb6addf06ef"}),this.option.type!==a.RANGE?this.renderFilterOption(this.option):e("salla-price-range",{onChanged:t=>{this.changed.emit(t.detail)},ref:t=>this.priceRange=t,filtersData:this.filtersData,option:this.option})),this.withLoadMore&&(!this.searchQuery||this.filteredCount>this.initialItemCount)&&e("a",{key:"29a3578886c0c88b6af2dc529004f9f4ab663986",class:"s-filters-widget-more",onClick:()=>this.showMore()},this.isShowMore?this.showLessLabel:this.showMoreLabel)))}get host(){return r(this)}};n.style="/*!twlt*/:host{display:block}.collapse{visibility:collapse}.fixed{position:fixed}.hidden{display:none}.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)}.duration-300{transition-duration:300ms}.s-filters-widget-container{display:block;overflow:hidden;border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1.25rem;padding-bottom:0.5rem}@media (min-width: 768px){.s-filters-widget-container{margin-bottom:1.25rem;padding-bottom:1.25rem;padding-top:1.25rem}}.s-filters-widget-content{transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-filters-widget-opened{visibility:visible;opacity:1}.s-filters-widget-closed{visibility:hidden;height:0px !important;padding:0px;opacity:0}.s-filters-widget-title{display:flex;cursor:pointer;align-items:center;justify-content:space-between;font-size:1rem;line-height:1.5rem;font-weight:700}.s-filters-widget-arrow{font-size:1.25rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-filters-widget-arrow svg{height:1.25rem;width:1.25rem}.s-filters-widget-active-arrow{--tw-rotate:90deg;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));--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-filters-widget-values{overflow:hidden;padding-top:1rem;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-filters-widget-more{margin-top:0.5rem;display:block;cursor:pointer;font-size:0.875rem;line-height:1.25rem;color:var(--color-primary)}.s-filters-widget-plusminus{position:relative;height:0.75rem;width:0.75rem;--tw-rotate:90deg;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))}.s-filters-widget-plusminus::before{position:absolute;left:0px;top:50%;display:block;height:0.125rem;width:100%;--tw-bg-opacity:1;background-color:rgb(153 153 153 / var(--tw-bg-opacity, 1));transition-property:0.35s;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;--tw-content:'';content:var(--tw-content)}.s-filters-widget-plusminus::after{position:absolute;left:0px;top:50%;display:block;height:0.125rem;width:100%;--tw-bg-opacity:1;background-color:rgb(153 153 153 / var(--tw-bg-opacity, 1));transition-property:0.35s;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;--tw-content:'';content:var(--tw-content)}.s-filters-widget-plusminus-active:before{transform:translatey(-50%) rotate(-90deg);opacity:0}.s-filters-widget-plusminus-active:after{transform:translatey(-50%) rotate(0);background-color:var(--color-primary)}.s-filters-widget-plusminus:before{transform:translatey(-50%)}.s-filters-widget-plusminus:after{transform:translatey(-50%) rotate(90deg)}.s-filters-widget-search-input{width:100%;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));padding:0.5rem}.s-filters-widget-search-input:focus{border-color:var(--color-primary);outline:2px solid transparent;outline-offset:2px;--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(2px + 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);--tw-ring-color:var(--color-primary)}.s-filters-widget-empty-state{padding:0.5rem;text-align:center;font-size:1.125rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}";export{n as salla_filters_widget}
|
|
4
|
+
import{r as t,c as i,h as e,H as s,a as r}from"./p-BXNtVhVe.js";import{F as a,H as o}from"./p-CbVZf-Q4.js";import"./p-CgtvEd63.js";const n=class{constructor(e){t(this,e),this.changed=i(this,"changed"),this.initialItemCount=10,this.expandedItemCount=15,this.calculatedInitialHeight=0,this.calculatedExpandedHeight=0,this.isOpen=!0,this.isShowMore=!1,this.showMoreLabel="عرض المزيد",this.showLessLabel="عرض أقل",this.page=salla.config.get("page"),this.searchQuery="",this.filteredCount=0}connectedCallback(){this.withLoadMore="price"!=this.option.key&&Array.isArray(this.option.values)&&this.option.values.length>this.initialItemCount,salla.onReady((()=>{this.page=salla.config.get("page")})),salla.lang.onLoaded((()=>{this.showMoreLabel=salla.lang.getWithDefault("common.titles.more",this.showMoreLabel),this.showLessLabel=salla.lang.getWithDefault("common.elements.show_less",this.showLessLabel)}))}componentDidLoad(){const t=this.widgetValues.querySelectorAll(".s-filters-label");if(t.length>0){const i=Math.min(this.initialItemCount,t.length);this.calculatedInitialHeight=35*this.initialItemCount,this.calculatedExpandedHeight=t.length>this.initialItemCount?35*this.expandedItemCount:35*i}this.widgetValues.scrollHeight<this.calculatedInitialHeight&&(this.withLoadMore=!1),this.withLoadMore&&this.widgetValues&&(this.widgetValues.style.maxHeight=`${this.calculatedInitialHeight}px`),this.widgetContent.style.height=`${this.widgetContent.scrollHeight}px`}async setWidgetHeight(t=250){this.widgetContent.removeAttribute("style"),setTimeout((()=>{this.widgetContent.style.height=this.widgetContent.scrollHeight+"px"}),t)}async reset(){this.option.type===a.RANGE&&this.priceRange.reset(),Array.from(this.host.querySelectorAll("input")).forEach((t=>t.checked=!1))}async showMore(){this.isShowMore=!this.isShowMore,this.widgetContent.style.height="auto",this.isShowMore||(this.widgetValues.scrollTop=0);const t=this.isShowMore?this.calculatedExpandedHeight:this.calculatedInitialHeight,i=this.searchQuery?this.filteredCount:Array.isArray(this.option.values)?this.option.values.length:0;this.widgetValues.style.maxHeight=`${t}px`,this.widgetValues.style.overflowY=this.isShowMore&&i>this.expandedItemCount?"auto":"hidden",setTimeout((()=>{this.widgetContent.style.height=`${this.widgetContent.scrollHeight}px`}),400)}async toggleWidget(){this.isOpen=!this.isOpen,o.toggleElementClassIf(this.widgetContent,"s-filters-widget-opened","s-filters-widget-closed",(()=>this.isOpen))}renderFilterOption(t){if(![a.VALUES,a.MINIMUM,a.VARIANTS].includes(t.type))return"";const i=t.values.filter((t=>{if(!this.searchQuery)return!0;const i="number"==typeof t?String(t):t?.value||t?.key||"";return String(i).toLowerCase().includes(this.searchQuery.toLowerCase())}));return this.filteredCount=i.length,0===i.length?e("div",{class:"s-filters-widget-empty-state"},salla.lang.get("common.elements.no_options")||"لا توجد نتائج"):i.map((i=>{let s="number"==typeof i?i:i.key||i.value;return e("label",{class:"s-filters-label",htmlFor:`${t.key}-option-${s}`,key:`${t.key}-option-${s}`},e("input",{id:`${t.key}-option-${s}`,name:t.key,type:t.type===a.VALUES?"checkbox":"radio",checked:this.isSelectedOption(t,s),class:t.type===a.VALUES?"s-filters-checkbox":"s-filters-radio",onChange:i=>this.changed.emit({event:i,option:t,value:s})}),this.getOptionLabel(t,i))}))}isSelectedOption(t,i){if(t.type===a.MINIMUM)return this.filtersData[t.key]==i;if(t.type===a.VARIANTS)return this.filtersData[t.type]&&this.filtersData[t.type][t.key]==i;if(t.type===a.RANGE)return this.filtersData[t.key]&&this.filtersData[t.key].min==i.min&&this.filtersData[t.key].max==i.max;if(t.type===a.VALUES){const e=this.filtersData[t.key];return Array.isArray(e)?e.some((t=>Number(t)===Number(i))):null!=e&&Number(e)===Number(i)}return!1}getOptionLabel(t,i){if("rating"==t.key)return e("salla-rating-stars",{size:"small",value:i});let s=i.value||"null";return null!=i.count&&(s+=` (${salla.helpers.number(i.count)})`),e("span",{class:"s-filters-option-name"},s)}render(){return e(s,{key:"af3f05601697115a001949d5c23d8925f6c68135",class:"s-filters-widget-container"},e("h3",{key:"689046ac453166e29fdb4e3ad10568a989446bfb",class:"s-filters-widget-title",onClick:()=>this.toggleWidget()},e("span",{key:"00d65abda360e88e26a08016bb1bd23eceee9f4b"},this.option.label),e("span",{key:"1915aaec2e1ea66235071f0b4f872bd6d9717a21",class:"s-filters-widget-plusminus "+(this.isOpen?"s-filters-widget-plusminus-active":"")})),e("div",{key:"d94f99643aa914391f131acebfb71d4183263df5",class:"s-filters-widget-content",ref:t=>this.widgetContent=t},Array.isArray(this.option.values)&&this.option.values.length>5&&e("div",{key:"0b67486012b38ce82a377b0f3cb6465892d718ae",class:"s-filters-widget-search-wrapper",style:{padding:"8px 0",marginBottom:"8px"}},e("input",{key:"00bf03c96c9fa7199872f1444c4484bf23049dd4",type:"text",class:"s-filters-widget-search-input",placeholder:salla.lang.get("blocks.header.search_placeholder")||"بحث...",value:this.searchQuery,onInput:t=>this.searchQuery=t.target.value})),e("div",{key:"79b29b30854583559ee8b0082210ad2f34e31e1a",class:"s-filters-widget-values",ref:t=>this.widgetValues=t},e("slot",{key:"0e657a77d5e62ee04cf2d3bd30982bb6addf06ef"}),this.option.type!==a.RANGE?this.renderFilterOption(this.option):e("salla-price-range",{onChanged:t=>{this.changed.emit(t.detail)},ref:t=>this.priceRange=t,filtersData:this.filtersData,option:this.option})),this.withLoadMore&&(!this.searchQuery||this.filteredCount>this.initialItemCount)&&e("a",{key:"29a3578886c0c88b6af2dc529004f9f4ab663986",class:"s-filters-widget-more",onClick:()=>this.showMore()},this.isShowMore?this.showLessLabel:this.showMoreLabel)))}get host(){return r(this)}};n.style="/*!twlt*/:host{display:block}.collapse{visibility:collapse}.fixed{position:fixed}.hidden{display:none}.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)}.duration-300{transition-duration:300ms}.s-filters-widget-container{display:block;overflow:hidden;border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1.25rem;padding-bottom:0.5rem}@media (min-width: 768px){.s-filters-widget-container{margin-bottom:1.25rem;padding-bottom:1.25rem;padding-top:1.25rem}}.s-filters-widget-content{transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-filters-widget-opened{visibility:visible;opacity:1}.s-filters-widget-closed{visibility:hidden;height:0px !important;padding:0px;opacity:0}.s-filters-widget-title{display:flex;cursor:pointer;align-items:center;justify-content:space-between;font-size:1rem;line-height:1.5rem;font-weight:700}.s-filters-widget-arrow{font-size:1.25rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-filters-widget-arrow svg{height:1.25rem;width:1.25rem}.s-filters-widget-active-arrow{--tw-rotate:90deg;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));--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-filters-widget-values{overflow:hidden;padding-top:1rem;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-filters-widget-more{margin-top:0.5rem;display:block;cursor:pointer;font-size:0.875rem;line-height:1.25rem;color:var(--color-primary)}.s-filters-widget-plusminus{position:relative;height:0.75rem;width:0.75rem;--tw-rotate:90deg;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))}.s-filters-widget-plusminus::before{position:absolute;left:0px;top:50%;display:block;height:0.125rem;width:100%;--tw-bg-opacity:1;background-color:rgb(153 153 153 / var(--tw-bg-opacity, 1));transition-property:0.35s;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;--tw-content:'';content:var(--tw-content)}.s-filters-widget-plusminus::after{position:absolute;left:0px;top:50%;display:block;height:0.125rem;width:100%;--tw-bg-opacity:1;background-color:rgb(153 153 153 / var(--tw-bg-opacity, 1));transition-property:0.35s;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;--tw-content:'';content:var(--tw-content)}.s-filters-widget-plusminus-active:before{transform:translatey(-50%) rotate(-90deg);opacity:0}.s-filters-widget-plusminus-active:after{transform:translatey(-50%) rotate(0);background-color:var(--color-primary)}.s-filters-widget-plusminus:before{transform:translatey(-50%)}.s-filters-widget-plusminus:after{transform:translatey(-50%) rotate(90deg)}.s-filters-widget-search-input{width:100%;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));padding:0.5rem}.s-filters-widget-search-input:focus{border-color:var(--color-primary);outline:2px solid transparent;outline-offset:2px;--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(2px + 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);--tw-ring-color:var(--color-primary)}.s-filters-widget-empty-state{padding:0.5rem;text-align:center;font-size:1.125rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}";export{n as salla_filters_widget}
|
|
@@ -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-BXNtVhVe.js";import{W as n}from"./p-CgR-T_ZS.js";import{M as a}from"./p-DmgxDvXL.js";const r=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)}};r.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{r as salla_contacts}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,c as i,h as s,H as e}from"./p-DSEA3vdh.js";const r=class{constructor(s){t(this,s),this.giftCardRedeemed=i(this,"giftCardRedeemed"),this.code="",this.inlineForm=!1,this.pending=!1,this.error=null,this.redeemedOnce=!1,this.isDesktop=!1,this.modalView=null,this.result=null,this.mediaQueryList=null,this.mqlChangeHandler=t=>{this.isDesktop=t.matches,"form"===this.modalView&&this.isDesktop?(this.modalView=null,this.inlineForm=!0):this.inlineForm&&!this.isDesktop&&(this.inlineForm=!1,this.openModal("form"))},this.closeModal=()=>{this.modalView=null,this.modal?.close?.()},this.start=()=>{if(this.error=null,this.code="",this.isDesktop)return this.inlineForm=!0,void setTimeout((()=>this.field?.focus()),0);this.openModal("form")},this.cancel=()=>{this.inlineForm=!1,this.code="",this.error=null,this.closeModal()},this.handleInput=t=>{const i=t.target;this.code=(i.value||"").toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,16),i.value=this.code,this.error=null},this.onKeyUp=t=>{"Enter"===t.key&&(t.preventDefault(),this.redeem())},this.shopNow=()=>{this.closeModal(),window.location.href=salla.url.get("/")}}breakpointPx(){return 768}async componentWillLoad(){await salla.onReady(),this.mediaQueryList=window.matchMedia(`(min-width: ${this.breakpointPx()}px)`),this.isDesktop=this.mediaQueryList.matches,this.mediaQueryList.addEventListener?this.mediaQueryList.addEventListener("change",this.mqlChangeHandler):this.mediaQueryList.addListener&&this.mediaQueryList.addListener(this.mqlChangeHandler),await salla.lang.onLoaded()}disconnectedCallback(){this.mediaQueryList?.removeEventListener?this.mediaQueryList.removeEventListener("change",this.mqlChangeHandler):this.mediaQueryList?.removeListener&&this.mediaQueryList.removeListener(this.mqlChangeHandler)}tFirst(t,i){for(const s of t){const t=salla.lang.get(s,i);if(t&&t!==s)return t}return""}t(t,i){return this.tFirst([`pages.checkout.${t}`],i)}get canRedeem(){const t=salla.config.get("store.features",[]);return!salla.config.isGuest()&&t.includes("wallet-gift-card")&&t.includes("giftcard-redemption-form-enabled")}get isValidCode(){return/^[A-Z0-9]{16}$/.test(this.code)}get addLabel(){return this.t(this.redeemedOnce?"gift_card_add_another":"gift_card_add")}openModal(t){this.modalView=t,this.modal?.open?.(),"form"===t&&setTimeout((()=>this.field?.focus()),0)}toDate(t){if(!t)return null;const i="object"==typeof t?t.date??t.datetime??null:t;if("number"==typeof i){const t=new Date(i<1e12?1e3*i:i);return isNaN(t.getTime())?null:t}if("string"!=typeof i)return null;const s=new Date(i.replace(" ","T"));return isNaN(s.getTime())?null:s}expiryMonths(t){const i=this.toDate(t);if(!i)return null;const s=Math.round((i.getTime()-Date.now())/2630016e3);return s>0?s:null}formatMoney(t){try{return salla.money(t)||""}catch(t){return salla.logger?.warn?.("gift-card: could not format amount",t),""}}trackRedeem(t,i,s={}){salla.event.dispatch("giftcard::redeemed",{status:t,code:i?i.slice(0,4)+"X".repeat(Math.max(0,i.length-4)):"",...s})}async redeem(){if(this.pending||!this.isValidCode||!this.canRedeem)return;this.pending=!0,this.error=null;const t=this.code;try{const i=await salla.api.request("wallet/gift-card/redeem",{code:this.code},"post"),s=i?.data||{};this.code="",this.field&&(this.field.value=""),this.inlineForm=!1,this.redeemedOnce=!0,this.result=s,this.openModal("success"),this.giftCardRedeemed.emit(s),this.trackRedeem("success",t,{amount:s.amount,new_balance:s.new_balance,expires_at:s.expires_at})}catch(i){const s=i?.response?.data?.error?.fields;this.error=s?Object.values(s).flat().join(", "):i?.response?.data?.error?.message||this.t("gift_card_redeem_error"),this.inlineForm=!1,this.openModal("error"),this.trackRedeem("failed",t,{reason:this.error})}finally{this.pending=!1}}renderPrompt(){return s("div",{class:"s-gift-card-prompt"},s("div",{class:"s-gift-card-intro"},s("span",{class:"s-gift-card-mark"},s("i",{class:"sicon-gift","aria-hidden":"true"})),s("div",{class:"s-gift-card-copy"},s("p",{class:"s-gift-card-title"},this.t("gift_card_title")),s("p",{class:"s-gift-card-subtitle"},this.t("gift_card_subtitle")))),s("salla-button",{class:"s-gift-card-trigger",color:"primary",fill:"outline",onClick:this.start},s("span",null,this.addLabel)))}renderField(){return[s("label",{class:"s-gift-card-label",htmlFor:"gift_card_redeem_field"},this.tFirst(["pages.gift.code"])),s("input",{id:"gift_card_redeem_field",ref:t=>this.field=t,type:"text",maxlength:16,autocomplete:"off",class:"s-gift-card-input",value:this.code,disabled:this.pending,placeholder:this.t("gift_card_redeem_placeholder"),onInput:this.handleInput,onKeyUp:this.onKeyUp})]}renderSubmit(t=!1){return s("salla-button",{id:"gift_card_redeem_submit",color:"primary",width:t?"wide":"normal",loading:this.pending,"loader-position":"center",disabled:this.pending||!this.isValidCode,onClick:()=>this.redeem()},s("span",null,this.t("gift_card_redeem_confirm")))}renderInlineForm(){return s("div",{class:"s-gift-card-form"},s("div",{class:"s-gift-card-field"},this.renderField()),this.renderSubmit(),s("button",{type:"button",class:"s-gift-card-cancel",disabled:this.pending,onClick:this.cancel},this.t("gift_card_cancel")))}renderSheetForm(){return s("div",{class:"s-gift-card-sheet"},s("div",{class:"s-gift-card-field"},this.renderField()),this.renderSubmit(!0))}renderSuccess(){const t=this.formatMoney(this.result?.amount),i=this.expiryMonths(this.result?.expires_at),e=this.t("gift_card_success_title");return s("div",{class:"s-gift-card-result"},s("span",{class:"s-gift-card-result-mark s-gift-card-result-mark-success",innerHTML:'\n<svg viewBox="0 0 96 96" width="72" height="72" role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">\n \x3c!-- burst --\x3e\n <g fill="#F5C242">\n <path d="M48 8l3.2 7.6L59 18l-6.2 5.3L54 31l-6-4-6 4 1.2-7.7L37 18l7.8-2.4z"/>\n <path d="M71 26l1.9 4.4L77 32l-3.6 3 .7 4.5-4.1-2.3-4.1 2.3.7-4.5L63 32l4.1-1.6z"/>\n <path d="M25 26l1.9 4.4L31 32l-3.6 3 .7 4.5L24 37.2 19.9 39.5l.7-4.5L17 32l4.1-1.6z"/>\n </g>\n <g fill="#E4572E" opacity=".9">\n <circle cx="30" cy="18" r="2.4"/>\n <circle cx="66" cy="18" r="2.4"/>\n <circle cx="48" cy="44" r="2.2"/>\n </g>\n \x3c!-- lid --\x3e\n <rect x="20" y="46" width="56" height="12" rx="3" fill="#2E8B57"/>\n \x3c!-- box --\x3e\n <path d="M25 58h46v26a4 4 0 0 1-4 4H29a4 4 0 0 1-4-4z" fill="#3AA76D"/>\n \x3c!-- ribbon --\x3e\n <rect x="44" y="46" width="8" height="42" fill="#F5F7F6"/>\n <rect x="20" y="46" width="56" height="12" rx="3" fill="#2E8B57" opacity="0"/>\n <rect x="44" y="46" width="8" height="12" fill="#E9EFEB"/>\n</svg>\n'}),e&&s("h3",{class:"s-gift-card-result-title"},e),s("p",{class:"s-gift-card-result-text",innerHTML:i?this.tFirst(["pages.checkout.gift_card_success_body_expiring","pages.checkout.gift_card_success_body","pages.checkout.gift_card_redeem_success"],{amount:t,months:i}):this.tFirst(["pages.checkout.gift_card_success_body","pages.checkout.gift_card_redeem_success"],{amount:t})}),s("salla-button",{color:"primary",width:"wide",onClick:this.shopNow},s("span",null,this.tFirst(["pages.loyalty_program.shop_now"]))))}renderError(){return s("div",{class:"s-gift-card-result"},s("span",{class:"s-gift-card-result-mark s-gift-card-result-mark-error"},s("i",{class:"sicon-cancel","aria-hidden":"true"})),s("h3",{class:"s-gift-card-result-title"},this.tFirst(["pages.checkout.gift_card_failure_title","pages.checkout.gift_card_redeem_error"])),s("p",{class:"s-gift-card-result-text"},this.error))}render(){return this.canRedeem?s(e,{class:"s-gift-card"},s("div",{class:"s-gift-card-panel"},this.inlineForm&&this.isDesktop?this.renderInlineForm():this.renderPrompt()),s("salla-modal",{ref:t=>this.modal=t,class:"s-gift-card-modal",width:"sm",position:this.isDesktop?"middle":"bottom","modal-title":this.t("gift_card_redeem_label"),onModalVisibilityChanged:t=>{t.detail||(this.modalView=null)}},s("div",{class:"s-gift-card-modal-body"},"form"===this.modalView&&this.renderSheetForm(),"success"===this.modalView&&this.renderSuccess(),"error"===this.modalView&&this.renderError()))):null}};r.style='/*!twlt*/@charset "UTF-8";.s-gift-card{display:block;flex:1 1 auto;min-width:0}.s-gift-card-panel{height:100%;background:#fff;border-radius:12px;padding:20px;box-sizing:border-box}.s-gift-card-prompt{display:flex;flex-direction:column;align-items:stretch;gap:16px;height:100%}.s-gift-card-intro{display:flex;align-items:center;gap:12px}.s-gift-card-mark{flex:0 0 auto;width:48px;height:48px;border-radius:9999px;background:#fdecef;color:#e8637c;display:inline-flex;align-items:center;justify-content:center;font-size:22px}.s-gift-card-copy{min-width:0}.s-gift-card-title{margin:0;font-weight:700;font-size:15px;color:#1c1c1c}.s-gift-card-subtitle{margin:2px 0 0;font-size:12px;color:#9aa0a6}.s-gift-card-trigger{display:block}.s-gift-card-form{display:flex;align-items:flex-end;gap:12px}.s-gift-card-field{flex:1 1 auto;min-width:0}.s-gift-card-label{display:block;margin-bottom:6px;font-size:13px;font-weight:700;color:#1c1c1c}.s-gift-card-input{width:100%;height:44px;padding:0 14px;box-sizing:border-box;border:1px solid #e6e8eb;border-radius:8px;background:#fff;font-size:13px;color:#1c1c1c}.s-gift-card-input::placeholder{color:#b7bcc2}.s-gift-card-input:focus{outline:none;border-color:var(--color-primary, #2e8b57)}.s-gift-card-cancel{flex:0 0 auto;height:44px;padding:0 8px;border:0;background:none;color:#6b7280;font-size:13px;cursor:pointer}.s-gift-card-cancel:disabled{opacity:0.5;cursor:default}.s-gift-card-sheet{display:flex;flex-direction:column;gap:16px;padding-top:4px}.s-gift-card-result{display:flex;flex-direction:column;align-items:center;text-align:center;padding:12px 8px 8px}.s-gift-card-result-mark{width:120px;height:120px;border-radius:9999px;display:inline-flex;align-items:center;justify-content:center;margin-bottom:20px}.s-gift-card-result-mark-success{background:#eaf7f0}.s-gift-card-result-mark-error{background:#fdeaea;color:#fff;font-size:34px}.s-gift-card-result-mark-error i{width:72px;height:72px;border-radius:9999px;background:#ea4b4b;display:inline-flex;align-items:center;justify-content:center}.s-gift-card-result-title{margin:0 0 10px;font-size:19px;font-weight:700;color:#1c1c1c}.s-gift-card-result-text{margin:0 0 22px;font-size:13px;line-height:1.7;color:#6b7280}@media screen and (min-width: 768px){.s-gift-card-panel{padding:22px 24px;display:flex;align-items:center}.s-gift-card-prompt{flex-direction:row;align-items:center;justify-content:space-between;gap:24px;width:100%}.s-gift-card-trigger{flex:0 0 auto}.s-gift-card-form{width:100%}.s-gift-card-result{padding:8px 24px 16px}}.inline{display:inline}.contents{display:contents}.resize{resize:both}.uppercase{text-transform:uppercase}.outline{outline-style:solid}';export{r as salla_gift_card_redeem}
|
|
4
|
+
import{r as t,c as i,h as s,H as e}from"./p-BXNtVhVe.js";const r=class{constructor(s){t(this,s),this.giftCardRedeemed=i(this,"giftCardRedeemed"),this.code="",this.inlineForm=!1,this.pending=!1,this.error=null,this.redeemedOnce=!1,this.isDesktop=!1,this.modalView=null,this.result=null,this.mediaQueryList=null,this.mqlChangeHandler=t=>{this.isDesktop=t.matches,"form"===this.modalView&&this.isDesktop?(this.modalView=null,this.inlineForm=!0):this.inlineForm&&!this.isDesktop&&(this.inlineForm=!1,this.openModal("form"))},this.closeModal=()=>{this.modalView=null,this.modal?.close?.()},this.start=()=>{if(this.error=null,this.code="",this.isDesktop)return this.inlineForm=!0,void setTimeout((()=>this.field?.focus()),0);this.openModal("form")},this.cancel=()=>{this.inlineForm=!1,this.code="",this.error=null,this.closeModal()},this.handleInput=t=>{const i=t.target;this.code=(i.value||"").toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,16),i.value=this.code,this.error=null},this.onKeyUp=t=>{"Enter"===t.key&&(t.preventDefault(),this.redeem())},this.shopNow=()=>{this.closeModal(),window.location.href=salla.url.get("/")}}breakpointPx(){return 768}async componentWillLoad(){await salla.onReady(),this.mediaQueryList=window.matchMedia(`(min-width: ${this.breakpointPx()}px)`),this.isDesktop=this.mediaQueryList.matches,this.mediaQueryList.addEventListener?this.mediaQueryList.addEventListener("change",this.mqlChangeHandler):this.mediaQueryList.addListener&&this.mediaQueryList.addListener(this.mqlChangeHandler),await salla.lang.onLoaded()}disconnectedCallback(){this.mediaQueryList?.removeEventListener?this.mediaQueryList.removeEventListener("change",this.mqlChangeHandler):this.mediaQueryList?.removeListener&&this.mediaQueryList.removeListener(this.mqlChangeHandler)}tFirst(t,i){for(const s of t){const t=salla.lang.get(s,i);if(t&&t!==s)return t}return""}t(t,i){return this.tFirst([`pages.checkout.${t}`],i)}get canRedeem(){const t=salla.config.get("store.features",[]);return!salla.config.isGuest()&&t.includes("wallet-gift-card")&&t.includes("giftcard-redemption-form-enabled")}get isValidCode(){return/^[A-Z0-9]{16}$/.test(this.code)}get addLabel(){return this.t(this.redeemedOnce?"gift_card_add_another":"gift_card_add")}openModal(t){this.modalView=t,this.modal?.open?.(),"form"===t&&setTimeout((()=>this.field?.focus()),0)}toDate(t){if(!t)return null;const i="object"==typeof t?t.date??t.datetime??null:t;if("number"==typeof i){const t=new Date(i<1e12?1e3*i:i);return isNaN(t.getTime())?null:t}if("string"!=typeof i)return null;const s=new Date(i.replace(" ","T"));return isNaN(s.getTime())?null:s}expiryMonths(t){const i=this.toDate(t);if(!i)return null;const s=Math.round((i.getTime()-Date.now())/2630016e3);return s>0?s:null}formatMoney(t){try{return salla.money(t)||""}catch(t){return salla.logger?.warn?.("gift-card: could not format amount",t),""}}trackRedeem(t,i,s={}){salla.event.dispatch("giftcard::redeemed",{status:t,code:i?i.slice(0,4)+"X".repeat(Math.max(0,i.length-4)):"",...s})}async redeem(){if(this.pending||!this.isValidCode||!this.canRedeem)return;this.pending=!0,this.error=null;const t=this.code;try{const i=await salla.api.request("wallet/gift-card/redeem",{code:this.code},"post"),s=i?.data||{};this.code="",this.field&&(this.field.value=""),this.inlineForm=!1,this.redeemedOnce=!0,this.result=s,this.openModal("success"),this.giftCardRedeemed.emit(s),this.trackRedeem("success",t,{amount:s.amount,new_balance:s.new_balance,expires_at:s.expires_at})}catch(i){const s=i?.response?.data?.error?.fields;this.error=s?Object.values(s).flat().join(", "):i?.response?.data?.error?.message||this.t("gift_card_redeem_error"),this.inlineForm=!1,this.openModal("error"),this.trackRedeem("failed",t,{reason:this.error})}finally{this.pending=!1}}renderPrompt(){return s("div",{class:"s-gift-card-prompt"},s("div",{class:"s-gift-card-intro"},s("span",{class:"s-gift-card-mark"},s("i",{class:"sicon-gift","aria-hidden":"true"})),s("div",{class:"s-gift-card-copy"},s("p",{class:"s-gift-card-title"},this.t("gift_card_title")),s("p",{class:"s-gift-card-subtitle"},this.t("gift_card_subtitle")))),s("salla-button",{class:"s-gift-card-trigger",color:"primary",fill:"outline",onClick:this.start},s("span",null,this.addLabel)))}renderField(){return[s("label",{class:"s-gift-card-label",htmlFor:"gift_card_redeem_field"},this.tFirst(["pages.gift.code"])),s("input",{id:"gift_card_redeem_field",ref:t=>this.field=t,type:"text",maxlength:16,autocomplete:"off",class:"s-gift-card-input",value:this.code,disabled:this.pending,placeholder:this.t("gift_card_redeem_placeholder"),onInput:this.handleInput,onKeyUp:this.onKeyUp})]}renderSubmit(t=!1){return s("salla-button",{id:"gift_card_redeem_submit",color:"primary",width:t?"wide":"normal",loading:this.pending,"loader-position":"center",disabled:this.pending||!this.isValidCode,onClick:()=>this.redeem()},s("span",null,this.t("gift_card_redeem_confirm")))}renderInlineForm(){return s("div",{class:"s-gift-card-form"},s("div",{class:"s-gift-card-field"},this.renderField()),this.renderSubmit(),s("button",{type:"button",class:"s-gift-card-cancel",disabled:this.pending,onClick:this.cancel},this.t("gift_card_cancel")))}renderSheetForm(){return s("div",{class:"s-gift-card-sheet"},s("div",{class:"s-gift-card-field"},this.renderField()),this.renderSubmit(!0))}renderSuccess(){const t=this.formatMoney(this.result?.amount),i=this.expiryMonths(this.result?.expires_at),e=this.t("gift_card_success_title");return s("div",{class:"s-gift-card-result"},s("span",{class:"s-gift-card-result-mark s-gift-card-result-mark-success",innerHTML:'\n<svg viewBox="0 0 96 96" width="72" height="72" role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">\n \x3c!-- burst --\x3e\n <g fill="#F5C242">\n <path d="M48 8l3.2 7.6L59 18l-6.2 5.3L54 31l-6-4-6 4 1.2-7.7L37 18l7.8-2.4z"/>\n <path d="M71 26l1.9 4.4L77 32l-3.6 3 .7 4.5-4.1-2.3-4.1 2.3.7-4.5L63 32l4.1-1.6z"/>\n <path d="M25 26l1.9 4.4L31 32l-3.6 3 .7 4.5L24 37.2 19.9 39.5l.7-4.5L17 32l4.1-1.6z"/>\n </g>\n <g fill="#E4572E" opacity=".9">\n <circle cx="30" cy="18" r="2.4"/>\n <circle cx="66" cy="18" r="2.4"/>\n <circle cx="48" cy="44" r="2.2"/>\n </g>\n \x3c!-- lid --\x3e\n <rect x="20" y="46" width="56" height="12" rx="3" fill="#2E8B57"/>\n \x3c!-- box --\x3e\n <path d="M25 58h46v26a4 4 0 0 1-4 4H29a4 4 0 0 1-4-4z" fill="#3AA76D"/>\n \x3c!-- ribbon --\x3e\n <rect x="44" y="46" width="8" height="42" fill="#F5F7F6"/>\n <rect x="20" y="46" width="56" height="12" rx="3" fill="#2E8B57" opacity="0"/>\n <rect x="44" y="46" width="8" height="12" fill="#E9EFEB"/>\n</svg>\n'}),e&&s("h3",{class:"s-gift-card-result-title"},e),s("p",{class:"s-gift-card-result-text",innerHTML:i?this.tFirst(["pages.checkout.gift_card_success_body_expiring","pages.checkout.gift_card_success_body","pages.checkout.gift_card_redeem_success"],{amount:t,months:i}):this.tFirst(["pages.checkout.gift_card_success_body","pages.checkout.gift_card_redeem_success"],{amount:t})}),s("salla-button",{color:"primary",width:"wide",onClick:this.shopNow},s("span",null,this.tFirst(["pages.loyalty_program.shop_now"]))))}renderError(){return s("div",{class:"s-gift-card-result"},s("span",{class:"s-gift-card-result-mark s-gift-card-result-mark-error"},s("i",{class:"sicon-cancel","aria-hidden":"true"})),s("h3",{class:"s-gift-card-result-title"},this.tFirst(["pages.checkout.gift_card_failure_title","pages.checkout.gift_card_redeem_error"])),s("p",{class:"s-gift-card-result-text"},this.error))}render(){return this.canRedeem?s(e,{class:"s-gift-card"},s("div",{class:"s-gift-card-panel"},this.inlineForm&&this.isDesktop?this.renderInlineForm():this.renderPrompt()),s("salla-modal",{ref:t=>this.modal=t,class:"s-gift-card-modal",width:"sm",position:this.isDesktop?"middle":"bottom","modal-title":this.t("gift_card_redeem_label"),onModalVisibilityChanged:t=>{t.detail||(this.modalView=null)}},s("div",{class:"s-gift-card-modal-body"},"form"===this.modalView&&this.renderSheetForm(),"success"===this.modalView&&this.renderSuccess(),"error"===this.modalView&&this.renderError()))):null}};r.style='/*!twlt*/@charset "UTF-8";.s-gift-card{display:block;flex:1 1 auto;min-width:0}.s-gift-card-panel{height:100%;background:#fff;border-radius:12px;padding:20px;box-sizing:border-box}.s-gift-card-prompt{display:flex;flex-direction:column;align-items:stretch;gap:16px;height:100%}.s-gift-card-intro{display:flex;align-items:center;gap:12px}.s-gift-card-mark{flex:0 0 auto;width:48px;height:48px;border-radius:9999px;background:#fdecef;color:#e8637c;display:inline-flex;align-items:center;justify-content:center;font-size:22px}.s-gift-card-copy{min-width:0}.s-gift-card-title{margin:0;font-weight:700;font-size:15px;color:#1c1c1c}.s-gift-card-subtitle{margin:2px 0 0;font-size:12px;color:#9aa0a6}.s-gift-card-trigger{display:block}.s-gift-card-form{display:flex;align-items:flex-end;gap:12px}.s-gift-card-field{flex:1 1 auto;min-width:0}.s-gift-card-label{display:block;margin-bottom:6px;font-size:13px;font-weight:700;color:#1c1c1c}.s-gift-card-input{width:100%;height:44px;padding:0 14px;box-sizing:border-box;border:1px solid #e6e8eb;border-radius:8px;background:#fff;font-size:13px;color:#1c1c1c}.s-gift-card-input::placeholder{color:#b7bcc2}.s-gift-card-input:focus{outline:none;border-color:var(--color-primary, #2e8b57)}.s-gift-card-cancel{flex:0 0 auto;height:44px;padding:0 8px;border:0;background:none;color:#6b7280;font-size:13px;cursor:pointer}.s-gift-card-cancel:disabled{opacity:0.5;cursor:default}.s-gift-card-sheet{display:flex;flex-direction:column;gap:16px;padding-top:4px}.s-gift-card-result{display:flex;flex-direction:column;align-items:center;text-align:center;padding:12px 8px 8px}.s-gift-card-result-mark{width:120px;height:120px;border-radius:9999px;display:inline-flex;align-items:center;justify-content:center;margin-bottom:20px}.s-gift-card-result-mark-success{background:#eaf7f0}.s-gift-card-result-mark-error{background:#fdeaea;color:#fff;font-size:34px}.s-gift-card-result-mark-error i{width:72px;height:72px;border-radius:9999px;background:#ea4b4b;display:inline-flex;align-items:center;justify-content:center}.s-gift-card-result-title{margin:0 0 10px;font-size:19px;font-weight:700;color:#1c1c1c}.s-gift-card-result-text{margin:0 0 22px;font-size:13px;line-height:1.7;color:#6b7280}@media screen and (min-width: 768px){.s-gift-card-panel{padding:22px 24px;display:flex;align-items:center}.s-gift-card-prompt{flex-direction:row;align-items:center;justify-content:space-between;gap:24px;width:100%}.s-gift-card-trigger{flex:0 0 auto}.s-gift-card-form{width:100%}.s-gift-card-result{padding:8px 24px 16px}}.inline{display:inline}.contents{display:contents}.resize{resize:both}.uppercase{text-transform:uppercase}.outline{outline-style:solid}';export{r as salla_gift_card_redeem}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import{r as t,f as i,h as a,H as s,a as e}from"./p-BXNtVhVe.js";import{S as r,a as o}from"./p-cq6TcfoH.js";import{C as n}from"./p-BV4kqbdL.js";import{H as l}from"./p-CbVZf-Q4.js";import{I as d}from"./p-C-tzSDxw.js";import{W as h}from"./p-CgR-T_ZS.js";import{M as m}from"./p-DmgxDvXL.js";import{b as c}from"./p-DrXX8XG8.js";import"./p-CgtvEd63.js";function g(t){const i=t.split(/[?#]/,1)[0];return/\.(mp4|webm|mov|avi|mkv)$/i.test(i)}function p(t){return t.reduce(((t,i)=>i?(g(i)?t.videos.push(i):t.images.push(i),t):t),{images:[],videos:[]})}function u(t){return p(t.map((t=>t?.url||"")).filter(Boolean))}function f(t){return t?Array.isArray(t)?t.filter(Boolean):t.split(",").map((t=>t.trim())).filter(Boolean):[]}function w(t){return t.reduce(((t,i)=>(g(i?.url||"")?t.video+=1:t.image+=1,t)),{image:0,video:0})}function v(t,i){const a=String(i);let s=!1;return t.filter((t=>{const i=null!=t?.id?String(t.id):"",e=String(t?.url??"");return!(i===a||e===a)||!!s||(s=!0,!1)}))}function b(t,i,a){const{images:s,videos:e}=u(a);t&&(t.value=s.join(",")),i&&(i.value=e.join(","))}function y(t,i,a){i||delete t.images,a||delete t.videos}const _="600px",x=class{constructor(i){t(this,i),this.hasError=!1,this.showContactWidget=!0,this.errorMessage="",this.images=[],this.productImages={},this.editItemImages=[],this.productReviewFactors={},this.editFactorRatings={},this.productMainRatings={},this.productFactorRatings={},this.contact_body=(t,i,a)=>salla.lang.get("pages.rating.contact_subject",{store:t,id:i,customer:a}),this.editMode=!1,this.defaultMode=!1,this.deleteMode=!1,this.shouldOpenDeleteModal=!1,this.editItem=null,this.allowAttachImages=!1,this.allowAttachVideos=!1,this.allowContactSupport=!1,this.uploadCounts={},this.uploadImageCounts={},this.uploadVideoCounts={},this.hasUploadsInProgress=!1,this.loyaltyImageRatingPoints=0,this.dragAndDropFilesLabel=salla.lang.get("common.uploader.drag_and_drop_files"),this.contactSubjectLabel=salla.lang.get("pages.rating.contact_subject"),this.editReviewLabel=salla.lang.get("pages.rating.edit_review"),this.allowedImagesTypesLabel=salla.lang.get("common.uploader.allowed_images_types"),this.threeImagesMax=salla.lang.get("common.uploader.max_three_images"),this.areYouSureLabel=salla.lang.get("pages.rating.are_you_sure_you_want_to_delete_review"),this.confirmDeletionLabel=salla.lang.get("pages.rating.confirm_deletion"),this.cancelLabel=salla.lang.get("common.elements.cancel"),this.confirmDeleteBtn=salla.lang.get("common.elements.confirm_delete"),this.updatedSuccessfullyLabel=salla.lang.get("pages.rating.review_updated_successfully"),this.deletedSuccessfullyLabel=salla.lang.get("pages.rating.review_deleted_successfully"),this.nothingToRateLabel=salla.lang.get("pages.rating.nothing_to_rate"),this.contactUsLabel=salla.lang.get("blocks.footer.social"),this.requiredFactorsLabel=salla.lang.get("pages.rating.rate_required_factors"),this.rateTheFollowingLabel=salla.lang.get("pages.rating.rate_the_following_factors"),this.loyaltyPointsForImagesLabel=salla.lang.get("pages.rating.loyalty_points_for_images",{points:":points"}),this.contentRefs=[],this.hiddenInputs=[],this.hiddenVideoInputs=[],this.uploadingByProductId={},this.userFilledFactorKeys={},this.boundRatingRows=new WeakSet,this.stepsCount=0,this.currentIndex=0,this.submitted=[],this.thanksCountdownInterval=null,this.MAX_IMAGE_UPLOAD_LIMIT=10,this.MAX_VIDEO_UPLOAD_LIMIT=5,this.MAX_VIDEO_FILE_SIZE="100MB",this.MAX_VIDEO_DURATION=60,this.MAX_PARALLEL_UPLOADS=10,this.scheduleWizardSetup=!1}syncStoreSettings(){void 0===this.orderId&&(this.orderId=salla.config.get("page.id")),this.allowAttachImages=!!salla.config.get("store.settings.rating.allow_attach_images"),this.allowAttachVideos=!!salla.config.get("store.settings.rating.allow_attach_videos"),this.allowContactSupport=!!salla.config.get("store.settings.rating.allow_contact_support"),this.refreshMediaLabels()}canAttachMedia(){return this.allowAttachImages||this.allowAttachVideos}getMediaUploadAccept(){return c(this.allowAttachImages,this.allowAttachVideos)}refreshMediaLabels(){this.allowedImagesTypesLabel=this.getAllowedMediaTypesLabel(),this.threeImagesMax=this.getMaxUploadHintLabel()}getAllowedMediaTypesLabel(){return this.allowAttachImages&&this.allowAttachVideos?salla.lang.get("common.uploader.allowed_media_types"):this.allowAttachImages?salla.lang.get("common.uploader.allowed_images_types"):this.allowAttachVideos?salla.lang.get("common.uploader.allowed_videos_types"):""}getMaxUploadHintLabel(){return this.allowAttachImages&&this.allowAttachVideos?salla.lang.get("common.uploader.max_three_images"):this.allowAttachImages?salla.lang.get("common.uploader.max_images_count",{count:this.MAX_IMAGE_UPLOAD_LIMIT}):this.allowAttachVideos?salla.lang.get("common.uploader.max_videos_count",{count:this.MAX_VIDEO_UPLOAD_LIMIT}):""}setUploadCount(t,i,a,s){this.uploadCounts={...this.uploadCounts,[t]:i},null!=a&&(this.uploadImageCounts={...this.uploadImageCounts,[t]:a}),null!=s&&(this.uploadVideoCounts={...this.uploadVideoCounts,[t]:s})}setUploaderProcessing(t,i){this.uploadingByProductId={...this.uploadingByProductId,[t]:i},this.hasUploadsInProgress=Object.values(this.uploadingByProductId).some(Boolean)}scheduleUploaderHeightRefresh(){[50,150,350].forEach((t=>{setTimeout((()=>this.updateBodyHeight()),t)}))}handleGalleryCountUpdate(t,i){this.setUploadCount(t,i.count,i.imageCount,i.videoCount),this.setUploaderProcessing(t,!!i.uploading),this.scheduleUploaderHeightRefresh()}isUnverifiedReview(){return null===this.orderId&&!!this.productId}getRatingOrderId(){return this.orderId||salla.config.get("page.id")}getSubmitOrderId(){return this.orderId}isCustomerOrderShape(t){if(!t||"object"!=typeof t)return!1;const i=t;return!!i.rating&&(Array.isArray(i.items)||Array.isArray(i.products)||Array.isArray(i.rating?.product)||Array.isArray(i.rating?.products))}getBootstrapOrder(){const t=salla.config.get("page");if(this.isCustomerOrderShape(t))return t;if(t&&"object"==typeof t){const i=t;if(Array.isArray(i.products))return t;const a=i.order;if(this.isCustomerOrderShape(a))return a}}async loadCustomerOrderForEdit(){const t=this.getBootstrapOrder();if(t?.rating?.product||t?.rating?.products)this.order=t;else try{const t=await salla.api.withoutNotifier((()=>salla.order.api.getDetails(this.getRatingOrderId())));t?.data&&(this.order=t.data)}catch(t){if(!this.order){const t=await salla.api.withoutNotifier((()=>salla.rating.api.order(this.getRatingOrderId())));this.order=t.data}}}getOrderProductRatings(t=this.order){return t?.rating?[...this.normalizeToArray(t.rating.product),...this.normalizeToArray(t.rating.products)]:[]}getMatchedProductRating(t=this.order,i,a){return this.getOrderProductRatings(t).find((t=>Number(t?.id??t?.feedback_id)===Number(a)||Number(t?.product_id??t?.product?.id)===Number(i)))}hasRatingFeedback(t){const i=t?.rating;return null!=i&&""!==i&&Number(i)>0}isTestimonialsEnabled(t=this.order){return!(this.productId||!1===t?.testimonials_enabled||this.hasRatingFeedback(t?.store?.feedback)||!0!==t?.testimonials_enabled&&!t?.allowed_ratings?.testimonials_enabled)}isProductsEnabled(t=this.order){return!1!==t?.products_enabled&&this.getRateableProducts(t).length>0}isShippingEnabled(t=this.order){return!(this.productId||!1===t?.shipping_enabled||this.hasRatingFeedback(t?.shipping?.feedback)||!t?.shipping?.company||!0!==t?.shipping_enabled&&!t?.allowed_ratings?.shipping_enabled)}getOrderProducts(t=this.order){return Array.isArray(t?.products)?t.products.filter((t=>t?.product?.id)):[]}getRateableProducts(t=this.order){return this.getOrderProducts(t).filter((t=>!(this.hasRatingFeedback(t?.feedback)||this.productId&&String(t.product.id)!==String(this.productId))))}hasNothingToRate(t=this.order){if(!t)return!0;const i=!1!==t.testimonials_enabled&&(!0===t.testimonials_enabled||!!t.allowed_ratings?.testimonials_enabled),a=!(!t.shipping?.company||!1===t.shipping_enabled||!0!==t.shipping_enabled&&!t.allowed_ratings?.shipping_enabled),s=!1!==t.products_enabled&&this.getOrderProducts(t).length>0;return!i&&!a&&!s}getStepsCount(t=this.order){if(!t)return 0;let i=0;return this.isTestimonialsEnabled(t)&&i++,this.isProductsEnabled(t)&&(i+=this.getRateableProducts(t).length),this.isShippingEnabled(t)&&t.shipping?.company&&i++,i}afterOrderLoaded(){this.stepsCount=this.getStepsCount(),this.scheduleWizardSetup=!0,i(this)}async setOrder(t,i){this.orderId=t,this.productId=i,this.order=void 0,this.hasError=!1,this.errorMessage=void 0,this.showContactWidget=!0}async loadUnverifiedProductOrder(){const t=await salla.api.withoutNotifier((()=>salla.product.api.getDetails(this.productId))).catch((()=>null)),i=t?.data;this.order={products:[{feedback:void 0,product:{id:Number(this.productId),name:i?.name||"",thumbnail:i?.image?.url||salla.url.cdn("images/s-empty.png")}}],products_enabled:!0,testimonials_enabled:!1,shipping_enabled:!1,thanks_message:""},this.productReviewFactors=await this.fetchAllProductReviewFactors(this.order)}escapeHtml(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}getModalTitle(){if(this.isUnverifiedReview()){const t=this.escapeHtml(this.getRateableProducts()[0]?.product?.name||"");return`${salla.lang.get("pages.rating.rate")} ${t}`.trim()}return`${salla.lang.get("pages.rating.rate_order")} <span class="unicode">(#${this.order?.id})</span>`}async open(){await salla.onReady(),this.syncStoreSettings(),this.defaultMode=!0,this.currentIndex=0,this.submitted=[];const t=this.getRatingOrderId();return new Promise((i=>{setTimeout((()=>{this.modal?.open().then((()=>this.order&&this.order.id===t||(this.isUnverifiedReview()?this.loadUnverifiedProductOrder():salla.api.withoutNotifier((()=>salla.rating.api.order(t))).then((async t=>{this.order=t.data,this.productReviewFactors=await this.fetchAllProductReviewFactors(t.data)}))))).then((()=>this.readyUpLoyaltyPoints())).then((()=>this.modal?.setTitle(this.getModalTitle()))).then((()=>{const t={};for(const i of this.getRateableProducts())t[i.product.id]=[];this.productImages=t,this.uploadCounts=Object.fromEntries(Object.keys(t).map((t=>[Number(t),0])))})).then((()=>this.modal?.stopLoading())).then((()=>this.afterOrderLoaded())).catch((t=>{i(!1),this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data,this.modal?.stopLoading()})),i(!0)}),50)}))}async openEditModal(t){await salla.onReady(),this.syncStoreSettings(),this.defaultMode=!1,this.editMode=!0,this.editType=t.type,this.editFeedbackId=t.feedback_id;try{await this.fetchEditItem(t.feedback_id),await this.readyUpLoyaltyPoints(),"product"===this.editType&&this.editItem?.product?.id&&(await this.loadCustomerOrderForEdit(),await this.ensureProductFactorsLoaded(this.editItem.product.id),this.editFactorRatings={...this.buildEditFactorRatings(this.editItem.product.id)},this.markExistingFactorRatingsAsUserFilled(this.editItem.product.id,this.editFactorRatings)),this.editModal?.open(),"product"===this.editType&&this.canAttachMedia()&&this.scheduleUploaderHeightRefresh()}catch(t){this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data}}async fetchEditItem(t){const i=`rating/${t}/show`,a=await salla.api.request(i);if(this.editItem=a.data,this.canAttachMedia()&&"product"==this.editType){const t=(this.editItem.images||[]).filter(Boolean),i=(this.editItem.videos||[]).filter(Boolean);let a=[...t,...i];if(!i.length&&t.length){const i=p(t);a=[...i.images,...i.videos]}if(a=a.filter((t=>g(t)?this.allowAttachVideos:this.allowAttachImages)),a.length){this.editItemImages=a.map((t=>function(t){return{id:t,url:t}}(t)));const t=w(this.editItemImages);this.setUploadCount(this.editItem.product.id,this.editItemImages.length,t.image,t.video)}}}async editReview(){if(this.hasUploadsInProgress)return;const t=`rating/${this.editFeedbackId}`;let i;if("product"===this.editType){const t=this.editModal?.querySelector('[data-type="products"]')||this.currentTab;if(i=this.buildProductRatingPayload(this.collectFormData(t),t),!i.product_id&&this.editItem?.product?.id&&(i.product_id=String(this.editItem.product.id)),this.canAttachMedia()){const{images:t,videos:a}=u(this.editItemImages);this.allowAttachImages&&(i.images=t),this.allowAttachVideos&&(i.videos=a)}y(i,this.allowAttachImages,this.allowAttachVideos)}else i=this.collectFormData(this.editModal),i.images&&(i.images=f(i.images)),i.videos&&(i.videos=f(i.videos)),y(i,this.allowAttachImages,this.allowAttachVideos);await salla.api.request(t,i,"put").then((t=>{this.editModal?.close(),salla.notify.success(t.message||this.updatedSuccessfullyLabel),setTimeout((()=>{window.location.reload()}),500)}))}async openDeleteModal(t){return this.defaultMode=!1,this.deleteMode=!0,this.deleteFeedbackId=t.feedback_id,this.shouldOpenDeleteModal=!0,new Promise((t=>{setTimeout((()=>{this.deleteModal?.open().then((()=>t(!0)))}),50)}))}async deleteReview(){const t=`rating/${this.deleteFeedbackId}`;await salla.api.request(t,null,"delete").then((()=>{this.deleteModal?.close(),salla.notify.success(this.deletedSuccessfullyLabel),setTimeout((()=>{window.location.reload()}),500)}))}async close(){return this.modal?.close()}handleWizard(){if(this.steps=this.modal?.querySelectorAll(".s-rating-modal-step"),this.dots=this.modal?.querySelectorAll(".s-rating-modal-step-dot"),0===this.stepsCount)return this.hasNothingToRate()?(this.hasError=!0,void(this.errorMessage=this.nothingToRateLabel)):void this.showThankYou();this.showActiveStep()}refreshWizardRefs(){this.modal&&(this.steps=this.modal.querySelectorAll(".s-rating-modal-step"),this.dots=this.modal.querySelectorAll(".s-rating-modal-step-dot"))}showActiveStep(t=null){if(this.refreshWizardRefs(),this.currentTab=t||this.steps?.[this.currentIndex],!this.currentTab)return;l.toggleClassIf(".s-rating-modal-step-dot","s-rating-modal-bg-gray","s-rating-modal-bg-primary",(t=>t!=this.dots?.[this.currentIndex])).toggleClassIf(".s-rating-modal-step","s-rating-modal-active","s-rating-modal-hidden",(t=>t==this.currentTab)),0!==this.currentIndex&&(l.toggleElementClassIf(this.currentTab,"s-rating-modal-unactive","s-rating-modal-hidden",(()=>!0)),setTimeout((()=>l.toggleElementClassIf(this.currentTab,"s-rating-modal-active","s-rating-modal-unactive",(()=>!0))),300));const i=this.steps?.[this.currentIndex+1]?.dataset.type;this.nextBtn?.setText(i?`${salla.lang.get("pages.rating.rate")} ${salla.lang.get(`pages.rating.${i}`)}`:salla.lang.get("pages.rating.send_ratings")),setTimeout((()=>this.updateBodyHeight()),0),setTimeout((()=>this.updateBodyHeight()),150)}updateBodyHeight(){this.body&&this.currentTab&&(this.body.style.height="products"!==this.currentTab.dataset.type?`${this.currentTab.offsetHeight+(this.editMode?60:0)}px`:"auto")}previousTab(){this.currentIndex>0&&this.currentIndex--,l.toggleElementClassIf(this.backBtn,"s-rating-modal-unvisiable","block",(()=>0==this.currentIndex)),this.showActiveStep()}async submit(){if(!this.hasUploadsInProgress){this.refreshWizardRefs();try{this.submittedBefore()||this.validate(),salla.config.canLeave=!1,await(this.nextBtn?.load()),this.submittedBefore()||await this.sendFeedback(),this.currentTab?.querySelectorAll("[name],.s-rating-modal-btn-star").forEach((t=>t.setAttribute("disabled",""))),this.currentIndex<this.stepsCount&&this.currentIndex++,this.showActiveStep(),l.toggleClassIf("#prev-btn","block","s-rating-modal-unvisiable",(()=>!0)),this.currentIndex===this.stepsCount&&(this.showThankYou(),this.showContactWidget=!1)}finally{this.nextBtn?.stop(),salla.config.canLeave=!0}}}submittedBefore(){return this.submitted.includes(this.currentIndex)}getRatingHiddenInput(t){const i=t,a=i.querySelector?.(".rating_hidden_input");if(a?.name)return a;const s=i.querySelector?.("salla-rating-stars");return s?.shadowRoot?.querySelector(".rating_hidden_input")||null}collectNamedInputs(t){const i=new Set,a=[],s=t=>{t?.name&&!i.has(t)&&(i.add(t),a.push(t))};return t.querySelectorAll("[name]").forEach((t=>{t.closest("salla-file-upload")||s(t)})),t.querySelectorAll("salla-rating-stars").forEach((t=>{s(this.getRatingHiddenInput(t))})),a}normalizeFactorsList(t){return t?Array.isArray(t)?t:"object"==typeof t?Object.values(t).filter((t=>t&&"object"==typeof t)):[]:[]}validate(t=null,i=null){if(!t&&"products"===this.currentTab?.dataset?.type)return void this.currentTab.querySelectorAll(".rating-outer-form").forEach((t=>this.validate(t,"product")));const a=t??this.currentTab;if(!a)return;const s=a.querySelector(".s-rating-modal-product-rating-row-main"),e=this.getRatingHiddenInput(s||a),r=e?.value,o=a.querySelector(".s-rating-modal-validation-msg"),n=i||a.getAttribute("data-type");if(!r)throw o.innerHTML=salla.lang.get(`pages.rating.rate_${n}_stars`).replace(" (:item)",""),new Error(o.innerHTML);if("product"===n&&Array.from(a.querySelectorAll('.s-rating-modal-product-factor-row[data-required="true"]')).some((t=>{const i=this.getRatingHiddenInput(t);return!i?.value})))throw o.innerHTML=this.requiredFactorsLabel,new Error(o.innerHTML);o&&(o.innerHTML="")}collectFormData(t=this.currentTab){if(!t)return{};const i={};return this.collectNamedInputs(t).forEach((t=>{const a=salla.helpers.inputData(t.name,t.value,i);i[a.name]=a.value})),i}buildProductRatingPayload(t,i=this.currentTab){if(!i)return{};if(!t.rating){const a=i.querySelector(".s-rating-modal-product-rating-row-main"),s=this.getRatingHiddenInput(a||i);s?.value&&(t.rating=s.value)}const a=Number(t.product_id);let s=[],e=[];t.images?s=f(t.images):this.editMode&&this.canAttachMedia()&&a?s=u(this.editItemImages).images:this.canAttachMedia()&&a&&(s=u(this.productImages[a]||[]).images),t.videos?e=f(t.videos):this.editMode&&this.canAttachMedia()&&a?e=u(this.editItemImages).videos:this.canAttachMedia()&&a&&(e=u(this.productImages[a]||[]).videos);const r=this.normalizeFactorsList(t.factors).filter((t=>t?.id&&t?.rating)).map((t=>({id:String(t.id),rating:String(t.rating)}))),o={order_id:this.getSubmitOrderId(),product_id:String(t.product_id),rating:String(t.rating),comment:t.comment||t.content||"",factors:r,type:"products"};return this.allowAttachImages&&(o.images=s),this.allowAttachVideos&&(o.videos=e),o}async sendFeedback(){this.refreshWizardRefs();const t=this.currentTab?.dataset?.type;if("products"===t){const t=this.collectFormData(this.currentTab),i=this.buildProductRatingPayload(t,this.currentTab);if(!i.product_id||!i.rating)throw new Error("Missing product rating data");const a=await salla.rating.api.products(i);return this.submitted.push(this.currentIndex),a}const i=this.collectFormData(this.currentTab);if(0===Object.keys(i).length)return;if(i.order_id=this.getSubmitOrderId(),i.type=t,!t)return;const a=await salla.rating.api[t](i);return this.submitted.push(this.currentIndex),a}clearThanksCountdown(){null!==this.thanksCountdownInterval&&(clearInterval(this.thanksCountdownInterval),this.thanksCountdownInterval=null)}showThankYou(){let t=10;this.clearThanksCountdown(),this.thanksCountdownInterval=setInterval((()=>{this.thanksTime&&(this.thanksTime.innerHTML="00:0"+t--,t>0||(this.clearThanksCountdown(),this.thanksTime.remove(),this.close().then((()=>window.location.reload()))))}),1e3),this.modal?.querySelector(".s-rating-modal-footer")?.classList.add("s-rating-modal-unvisiable"),this.showActiveStep(this.thanksTab)}getFilepondPlaceholder(){return`<div class="s-rating-modal-filepond-placeholder"><span class="s-rating-modal-filepond-placeholder-icon">${d}</span><p class="s-rating-modal-filepond-placeholder-text">${this.dragAndDropFilesLabel}<br>\n <span> ${this.allowedImagesTypesLabel} <br> ${this.threeImagesMax} </span></p></div>`}getCustomerName(){return`${salla.config.get("user.first_name")||salla.storage.get("user.first_name")||""} ${salla.config.get("user.last_name")||salla.storage.get("user.last_name")||""}`}async readyUpLoyaltyPoints(){const t=salla.loyalty?.isFeatureEnabled?.();if(!t)return void(this.loyaltyImageRatingPoints=0);const i=salla.config.get("store.settings.rating.rating_product_points")||0,a=salla.config.get("store.settings.rating.rating_product_with_image_points")||0;this.loyaltyImageRatingPoints=Number(a)+Number(i)}loyaltyPointsNote(){if(!this.loyaltyImageRatingPoints||!this.loyaltyPointsForImagesLabel||this.isUnverifiedReview())return null;const t=a("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M10 0C13.6819 0 16.6667 2.98477 16.6667 6.66664C16.6667 9.37047 15.057 11.6984 12.7437 12.7444C11.6978 15.0575 9.3701 16.6666 6.66668 16.6666C2.98477 16.6666 0 13.6819 0 9.99998C0 7.29656 1.60918 4.96894 3.92195 3.92276C4.96827 1.60964 7.29618 0 10 0ZM6.66668 5C3.90524 5 1.66667 7.23856 1.66667 9.99998C1.66667 12.7614 3.90524 15 6.66668 15C9.4281 15 11.6667 12.7614 11.6667 9.99998C11.6667 7.23856 9.4281 5 6.66668 5ZM7.50002 5.83333V6.66664H9.16668V8.33331H5.83333C5.60322 8.33331 5.41667 8.51989 5.41667 8.74998C5.41667 8.95456 5.56407 9.12464 5.75844 9.15998L5.83333 9.16664H7.50002C8.6506 9.16664 9.58335 10.0994 9.58335 11.25C9.58335 12.4006 8.6506 13.3333 7.50002 13.3333V14.1666H5.83333V13.3333H4.16667V11.6666H7.50002C7.7301 11.6666 7.91668 11.4801 7.91668 11.25C7.91668 11.0455 7.76927 10.8753 7.57493 10.8401L7.50002 10.8333H5.83333C4.68274 10.8333 3.75 9.90056 3.75 8.74998C3.75 7.59939 4.68274 6.66664 5.83333 6.66664V5.83333H7.50002ZM10 1.66667C8.51377 1.66667 7.17893 2.31513 6.26313 3.34457C6.39704 3.33736 6.53138 3.33333 6.66668 3.33333C10.3486 3.33333 13.3333 6.3181 13.3333 9.99998C13.3333 10.1356 13.3293 10.2702 13.3213 10.4037C14.3513 9.48814 15 8.15314 15 6.66664C15 3.90524 12.7614 1.66667 10 1.66667Z",fill:"#008C56"}));return a("div",{class:"s-rating-modal-loyalty-points-note-container"},a("span",{class:"s-rating-modal-loyalty-points-note-icon"},t),a("p",{class:"s-rating-modal-loyalty-points-note-text"},this.loyaltyPointsForImagesLabel.replace(":points",String(this.loyaltyImageRatingPoints))))}normalizeReviewFactorsPayload(t){const i=t?.data??t?.factors;return Array.isArray(i)?i.flatMap((t=>{const i=Array.isArray(t?.items)?[...t.items]:null;if(i?.length){i.sort(((t,i)=>(Number(t?.sort)||0)-(Number(i?.sort)||0)));const a=!!t?.is_required;return i.filter((t=>null!=t?.id&&""!==t?.id)).map((t=>({id:t.id,name:t?.name,required:a})))}return null==t?.id||""===t?.id?[]:[{id:t.id,name:t?.name,required:t?.required??t?.is_required??!1}]})):[]}async fetchProductReviewFactors(t){try{const i=await salla.api.request(`review/factors/${t}/form`);return this.normalizeReviewFactorsPayload(i)}catch(t){return[]}}async fetchAllProductReviewFactors(t){const i=this.getRateableProducts(t);if(!i.length)return{};const a=await Promise.all(i.map((async t=>{const i=await this.fetchProductReviewFactors(t.product.id);return[t.product.id,i]})));return Object.fromEntries(a)}async ensureProductFactorsLoaded(t){if(!t||this.productReviewFactors[t])return;const i=await this.fetchProductReviewFactors(t);this.productReviewFactors={...this.productReviewFactors,[t]:i}}getFactorFieldName(t,i,a){return t?`${t}[factors][${i}][${a}]`:`factors[${i}][${a}]`}normalizeToArray(t){return null==t?[]:Array.isArray(t)?t:[t]}isFactorReviewsList(t){return Array.isArray(t)&&t.length>0&&t.every((t=>t&&"object"==typeof t&&(void 0!==t.rating||void 0!==t.stars||void 0!==t.value)))}getFactorReviewsFromRecord(t){if(!t)return[];for(const i of["factor_reviews","review_factors","factors"]){const a=t[i];if(this.isFactorReviewsList(a))return a}return[]}getEditFactorReviewsList(t){const i=[this.order,this.getBootstrapOrder()].filter(Boolean);for(const a of i){const i=this.getMatchedProductRating(a,t,this.editFeedbackId),s=this.getFactorReviewsFromRecord(i);if(s.length)return s}const a=this.getOrderProducts(this.order).find((i=>Number(i.product?.id)===Number(t))),s=[this.editItem?.factor_reviews,this.editItem?.review_factors,this.editItem?.product?.review_factors,this.editItem?.product?.factor_reviews,this.editItem?.factors,a?.factor_reviews,a?.review_factors,a?.feedback?.factor_reviews];for(const t of s)if(Array.isArray(t)&&t.length>0)return t;return[]}getFactorKey(t,i){return null!=t.id&&""!==t.id?`id:${t.id}`:t.name?`name:${t.name.trim()}`:`index:${i}`}getFactorRatingsForProduct(t){return this.editMode?this.editFactorRatings:this.productFactorRatings[t]||{}}setFactorRatingsForProduct(t,i){this.editMode?this.editFactorRatings=i:this.productFactorRatings={...this.productFactorRatings,[t]:i}}markExistingFactorRatingsAsUserFilled(t,i){const a=this.productReviewFactors[t]||[],s=new Set;a.forEach(((t,a)=>{const e=this.getFactorKey(t,a),r=void 0!==t.id?i[String(t.id)]:void 0,o=t.name?i[t.name.trim()]:void 0;void 0===r&&void 0===o&&void 0===i[`__index_${a}`]||s.add(e)})),this.userFilledFactorKeys[t]=s}shouldAutofillFactors(t){return t>=4}autofillUnfilledFactors(t,i){const a=this.productReviewFactors[t]||[];if(!a.length)return;const s=this.userFilledFactorKeys[t]||new Set,e={...this.getFactorRatingsForProduct(t)},r=this.shouldAutofillFactors(i);let o=!1;a.forEach(((t,a)=>{const n=this.getFactorKey(t,a);if(!s.has(n)){if(r)return void 0!==t.id&&(e[String(t.id)]=i),t.name&&(e[t.name.trim()]=i),e[`__index_${a}`]=i,void(o=!0);void 0!==t.id&&void 0!==e[String(t.id)]&&(delete e[String(t.id)],o=!0),t.name&&void 0!==e[t.name.trim()]&&(delete e[t.name.trim()],o=!0),void 0!==e[`__index_${a}`]&&(delete e[`__index_${a}`],o=!0)}})),o&&this.setFactorRatingsForProduct(t,e)}handleMainRatingChange(t,i){this.editMode?this.editMainRating=i:this.productMainRatings={...this.productMainRatings,[t]:i},this.autofillUnfilledFactors(t,i)}handleFactorRatingChange(t,i,a){this.userFilledFactorKeys[t]||(this.userFilledFactorKeys[t]=new Set),this.userFilledFactorKeys[t].add(i);const s=this.productReviewFactors[t]||[],e=s.findIndex(((t,a)=>this.getFactorKey(t,a)===i));if(e<0)return;const r=s[e],o={...this.getFactorRatingsForProduct(t)};void 0!==r.id&&(o[String(r.id)]=a),r.name&&(o[r.name.trim()]=a),o[`__index_${e}`]=a,this.setFactorRatingsForProduct(t,o)}setupProductRatingAutofill(t,i){t&&!this.boundRatingRows.has(t)&&(this.boundRatingRows.add(t),t.addEventListener("click",(a=>{const s=a.target;if(!s.closest(".s-rating-stars-btn-star"))return;const e=s.closest(".s-rating-modal-product-rating-row-main"),r=s.closest(".s-rating-modal-product-factor-row");requestAnimationFrame((()=>{if(e&&t.contains(e)){const t=Number(this.getRatingHiddenInput(e)?.value);t>0&&this.handleMainRatingChange(i,t)}else if(r&&t.contains(r)){const t=r.getAttribute("data-factor-key"),a=Number(this.getRatingHiddenInput(r)?.value);t&&a>0&&this.handleFactorRatingChange(i,t,a)}}))})))}buildEditFactorRatings(t){return this.getEditFactorReviewsList(t).reduce(((t,i,a)=>{const s=Number(i?.rating??i?.stars??i?.value);if(Number.isNaN(s))return t;const e=i?.id??i?.factor_id;return null!=e&&""!==e&&(t[String(e)]=s),i?.name&&(t[i.name.trim()]=s),t[`__index_${a}`]=s,t}),{})}renderProductStep(t,i){return a("section",{class:"s-rating-modal-step s-rating-modal-hidden","data-type":"products","data-product-id":t.product.id,key:t.product.id},a("div",{class:"s-rating-modal-product"},this.allowAttachImages&&this.loyaltyPointsNote(),a("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},a("div",{class:"s-rating-modal-product-details",ref:i=>i&&this.setupProductRatingAutofill(i,t.product.id)},a("div",{class:"s-rating-modal-step-wrap"},a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:t.product.thumbnail,alt:t.product.name,class:"s-rating-modal-product-img"})),a("h3",{class:"s-rating-modal-title"},t.product.name),a("p",{class:"s-rating-modal-subtitle"},salla.lang.get("pages.rating.write_product_rate")),this.renderProductMainRating(t.product.id,0,{fieldPrefix:""})),this.renderProductReviewFactors(t.product.id,0,{fieldPrefix:""}),a("input",{type:"hidden",name:"product_id",value:t.product.id}),a("textarea",{placeholder:salla.lang.get("pages.rating.write_product_rate"),name:"comment",class:"s-rating-modal-comment"}),a("small",{class:"s-rating-modal-validation-msg"}))),this.canAttachMedia()&&a("div",{class:"s-rating-modal-uploader is-opened",ref:t=>{t&&(this.contentRefs[i]=t)}},a("salla-file-upload",{name:"image",enableGallery:!0,maxImagesCount:this.allowAttachImages?this.MAX_IMAGE_UPLOAD_LIMIT:void 0,maxVideosCount:this.allowAttachVideos?this.MAX_VIDEO_UPLOAD_LIMIT:void 0,maxVideoFileSize:this.allowAttachVideos?this.MAX_VIDEO_FILE_SIZE:void 0,maxVideoDuration:this.allowAttachVideos?this.MAX_VIDEO_DURATION:void 0,maxParallelUploads:this.MAX_PARALLEL_UPLOADS,imagePreviewHeight:75,filePosterHeight:75,"instant-upload":!0,type:"feedback",payloadName:"files[]",id:`file-${t.product.id}`,title:t.product.name,allowMultiple:!0,instantUpload:!0,accept:this.getMediaUploadAccept(),url:salla.url.api("upload"),onUploaded:a=>{const s=t.product.id,e=[...this.productImages[s]||[],a.detail];this.productImages={...this.productImages,[s]:e};const r=w(e);this.setUploadCount(s,e.length,r.image,r.video),b(this.hiddenInputs[i],this.hiddenVideoInputs[i],e),this.scheduleUploaderHeightRefresh()},onRemoved:a=>{const s=a.detail,e=t.product.id;if(!s||!this.productImages[e])return;const r=v(this.productImages[e],s);this.productImages={...this.productImages,[e]:r};const o=w(r);this.setUploadCount(e,r.length,o.image,o.video),b(this.hiddenInputs[i],this.hiddenVideoInputs[i],r),this.scheduleUploaderHeightRefresh()},labelIdle:this.getFilepondPlaceholder(),onGalleryUpdated:i=>this.handleGalleryCountUpdate(t.product.id,i.detail)}),this.allowAttachImages&&a("input",{type:"hidden",name:"images",value:u(this.productImages[t.product.id]||[]).images.join(","),ref:t=>{t&&(this.hiddenInputs[i]=t)}}),this.allowAttachVideos&&a("input",{type:"hidden",name:"videos",value:u(this.productImages[t.product.id]||[]).videos.join(","),ref:t=>{t&&(this.hiddenVideoInputs[i]=t)}}),this.renderUploadedImagesCount(t.product.id))))}renderProductMainRating(t,i,s={}){const e=s.fieldPrefix??`products[${i}]`,r=e?`${e}[rating]`:"rating",o=Number(s.mainRating??(this.editMode?this.editMainRating:this.productMainRatings[t])),n=!Number.isNaN(o);return a("div",{class:"s-rating-modal-stars-product s-rating-modal-product-rating-row-main"},a("salla-rating-stars",{size:"large",name:r,key:n?`main-rating-${o}`:"main-rating-empty",value:n?o:void 0,editable:n,withLabel:!0}))}renderProductReviewFactors(t,i,s={}){const e=this.productReviewFactors[t]||[],r=s.fieldPrefix??`products[${i}]`,o={...this.editMode?{}:this.productFactorRatings[t]||{},...s.factorRatings||{}},n=(t,i)=>{const a=void 0!==t.id?o[String(t.id)]:void 0,s=t.name?o[t.name.trim()]:void 0,e=Number(a??s??o[`__index_${i}`]);return Number.isNaN(e)?void 0:e};if(!e.length)return null;const l=e.some((t=>t.required));return a("div",{class:"s-rating-modal-product-factors-card"},a("div",{class:"s-rating-modal-product-factors-heading"},this.rateTheFollowingLabel,l?a("span",{class:"s-rating-modal-product-factor-required"},"*"):""),a("div",{class:"s-rating-modal-product-rating-rows"},e.map(((t,i)=>a("div",{class:"s-rating-modal-product-rating-row s-rating-modal-product-factor-row","data-required":t.required?"true":"false","data-factor-key":this.getFactorKey(t,i)},a("input",{type:"hidden",name:this.getFactorFieldName(r,i,"name"),value:t.name}),!!t.id&&a("input",{type:"hidden",name:this.getFactorFieldName(r,i,"id"),value:String(t.id)}),a("span",{class:"s-rating-modal-product-factor-name"},t.name),a("salla-rating-stars",{size:"medium",name:this.getFactorFieldName(r,i,"rating"),key:`factor-rating-${t.id??i}-${n(t,i)??0}`,value:n(t,i),editable:s.alwaysEditable||"number"==typeof n(t,i),tag:!1}))))))}handleSendEmail(){if(!this.order)return;const t=`${this.contactSubjectLabel} #${this.order.id}`,i=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),a=`mailto:${salla.config.get("store.contacts.email")}?subject=${encodeURIComponent(t)}&body=${encodeURIComponent(i)}`;window.open(a,"_blank")}handleSendWhatsApp(){if(!this.order)return;const t=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),i=`https://wa.me/${salla.config.get("store.contacts.whatsapp")}?text=${encodeURIComponent(t)}`;window.open(i,"_blank")}resetData(t){t.detail||(this.clearThanksCountdown(),this.modal?.close(),this.editItem=null,this.editItemImages=[],this.editFactorRatings={},this.productMainRatings={},this.productFactorRatings={},this.editMainRating=void 0,this.userFilledFactorKeys={},this.uploadingByProductId={},this.hasUploadsInProgress=!1,this.hiddenInputs[1]&&(this.hiddenInputs[1].value=""),this.editHiddenVideosInput&&(this.editHiddenVideosInput.value=""),this.body&&(this.body.style.height="",this.body.style.minHeight=""),this.deleteFeedbackId=void 0,this.editFeedbackId=void 0,this.shouldOpenDeleteModal=!1,this.editMode=!1,this.deleteMode=!1,this.defaultMode=!1,this.currentIndex=0,this.submitted=[],this.scheduleWizardSetup=!1,this.loyaltyImageRatingPoints=0)}getDeleteModal(){return a("salla-modal",{ref:t=>{t&&(this.deleteModal=t)},width:"xs",onModalVisibilityChanged:t=>this.resetData(t)},a("div",{class:"s-rating-modal-delete-wrapper",ref:t=>{t&&(this.body=t)}},a("h3",null,this.confirmDeletionLabel),a("p",null,this.areYouSureLabel),a("div",{class:"s-rating-modal-delete-actions"},a("salla-button",{loaderPosition:"center",onClick:()=>this.deleteReview()},this.confirmDeleteBtn),a("salla-button",{color:"danger",fill:"outline",onClick:()=>this.deleteModal?.close()},this.cancelLabel))))}renderUploadedImagesCount(t){const i=w(this.editMode?this.editItemImages:this.productImages[t]||[]),s=this.uploadImageCounts[t]??i.image,e=this.uploadVideoCounts[t]??i.video;return this.allowAttachImages&&this.allowAttachVideos?a("span",{class:"s-rating-modal-upload-count"},salla.lang.get("pages.rating.media_count",{imageCurrent:s,imageTotal:this.MAX_IMAGE_UPLOAD_LIMIT,videoCurrent:e,videoTotal:this.MAX_VIDEO_UPLOAD_LIMIT})):this.allowAttachImages?a("span",{class:"s-rating-modal-upload-count"},salla.lang.choice("pages.rating.images_count",s,{current:s,total:this.MAX_IMAGE_UPLOAD_LIMIT})):this.allowAttachVideos?a("span",{class:"s-rating-modal-upload-count"},salla.lang.choice("pages.rating.videos_count",e,{current:e,total:this.MAX_VIDEO_UPLOAD_LIMIT})):null}getEditModal(){return a("salla-modal",{ref:t=>{t&&(this.editModal=t)},width:"custom",customWidth:_,onModalVisibilityChanged:t=>this.resetData(t)},a("div",{class:"s-rating-modal-edit-wrapper",ref:t=>{t&&(this.body=t)}},"store"===this.editType&&this.editItem?a("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step","data-type":"store",ref:t=>{t&&(this.currentTab=t)}},a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:salla.config.get("store.logo","https://assets.salla.sa/cp/assets/images/logo-new.png"),alt:"store name",class:"s-rating-modal-store-logo"})),a("h2",{class:"s-rating-modal-title"},salla.config.get("store.name")),a("p",{class:"s-rating-modal-subtitle"},salla.lang.get("pages.rating.rate_the_store")),a("div",{class:"s-rating-modal-stars-company"},a("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),a("textarea",{name:"content",value:this.editItem.content,class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),a("small",{class:"s-rating-modal-validation-msg"})):null,"shipping"===this.editType&&this.editItem?a("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step","data-type":"shipping",ref:t=>{t&&(this.currentTab=t)}},this.editItem.shipping.logo?a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:this.editItem.shipping.logo,class:"s-rating-modal-shipping-logo",alt:this.editItem.shipping.name})):a("span",{class:"s-rating-modal-icon",innerHTML:r}),a("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.editItem.shipping.name}`),a("p",{class:"s-rating-modal-subtitle"},salla.lang.get("pages.rating.write_shipping_rate")),a("div",{class:"s-rating-modal-stars-company"},a("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),a("textarea",{name:"content",class:"s-rating-modal-comment",value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),a("small",{class:"s-rating-modal-validation-msg"})):null,"product"==this.editType&&this.editItem?a("section",{class:"s-rating-modal-step","data-type":"products",ref:t=>{t&&(this.currentTab=t)}},a("div",{class:"s-rating-modal-product"},this.allowAttachImages&&this.loyaltyPointsNote(),a("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},a("div",{class:"s-rating-modal-product-details",ref:t=>t&&this.setupProductRatingAutofill(t,this.editItem.product.id)},a("div",{class:"s-rating-modal-step-wrap"},a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:this.editItem.product.image.url,alt:this.editItem.product.name,class:"s-rating-modal-product-img"})),a("h3",{class:"s-rating-modal-title"},this.editItem.product.name),a("p",{class:"s-rating-modal-subtitle"},salla.lang.get("pages.rating.write_product_rate")),this.renderProductMainRating(this.editItem.product.id,0,{fieldPrefix:"",mainRating:this.editMainRating??Number(this.editItem.stars??this.editItem.rating)})),this.renderProductReviewFactors(this.editItem.product.id,0,{fieldPrefix:"",factorRatings:this.editFactorRatings,alwaysEditable:!0}),a("input",{type:"hidden",name:"product_id",value:this.editItem.product.id}),a("textarea",{value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_product_rate"),name:"comment",class:"s-rating-modal-comment"}),a("small",{class:"s-rating-modal-validation-msg"}))),this.canAttachMedia()&&a("div",{class:"s-rating-modal-uploader is-opened",ref:t=>{t&&(this.contentRefs[1]=t)}},a("salla-file-upload",{name:"images",allowMultiple:!0,enableGallery:!0,maxImagesCount:this.allowAttachImages?this.MAX_IMAGE_UPLOAD_LIMIT:void 0,maxVideosCount:this.allowAttachVideos?this.MAX_VIDEO_UPLOAD_LIMIT:void 0,maxVideoFileSize:this.allowAttachVideos?this.MAX_VIDEO_FILE_SIZE:void 0,maxVideoDuration:this.allowAttachVideos?this.MAX_VIDEO_DURATION:void 0,maxParallelUploads:this.MAX_PARALLEL_UPLOADS,imagePreviewHeight:75,filePosterHeight:75,"instant-upload":!0,type:"feedback",files:JSON.stringify(this.editItemImages),payloadName:"files[]",id:`file-${this.editItem.product.id}`,title:this.editItem.product.name,instantUpload:!0,accept:this.getMediaUploadAccept(),url:salla.url.api("upload"),onUploaded:t=>{this.editItemImages=[...this.editItemImages,t.detail];const i=w(this.editItemImages);this.setUploadCount(this.editItem.product.id,this.editItemImages.length,i.image,i.video),b(this.hiddenInputs[1],this.editHiddenVideosInput,this.editItemImages),this.scheduleUploaderHeightRefresh()},onRemoved:t=>{const i=t.detail;if(!i)return;this.editItemImages=v(this.editItemImages,i);const a=w(this.editItemImages);this.setUploadCount(this.editItem.product.id,this.editItemImages.length,a.image,a.video),b(this.hiddenInputs[1],this.editHiddenVideosInput,this.editItemImages),this.scheduleUploaderHeightRefresh()},labelIdle:this.getFilepondPlaceholder(),onGalleryUpdated:t=>this.handleGalleryCountUpdate(this.editItem.product.id,t.detail)}),this.allowAttachImages&&a("input",{type:"hidden",name:"images",value:u(this.editItemImages).images.join(","),ref:t=>{t&&(this.hiddenInputs[1]=t)}}),this.allowAttachVideos&&a("input",{type:"hidden",name:"videos",value:u(this.editItemImages).videos.join(","),ref:t=>{t&&(this.editHiddenVideosInput=t)}}),this.renderUploadedImagesCount(this.editItem.product.id)))):null,a("div",{class:"s-rating-modal-footer s-rating-modal-footer-end"},a("salla-button",{"loader-position":"center",loading:this.hasUploadsInProgress,disabled:this.hasUploadsInProgress,onClick:()=>this.editReview()},this.editReviewLabel))))}render(){return this.deleteMode?a(s,{class:"s-rating-modal"},this.getDeleteModal()):this.editMode?a(s,{class:"s-rating-modal"},this.getEditModal()):this.defaultMode?a(s,{class:"s-rating-modal"},a("salla-modal",{class:"s-rating-modal-wrap",onModalVisibilityChanged:t=>this.resetData(t),isLoading:!0,width:"custom",customWidth:_,ref:t=>{t&&(this.modal=t)}},a("div",{slot:"loading"},a("div",{class:"s-rating-modal-skeleton"},a("salla-skeleton",{type:"circle",height:"80px",width:"80px"}),a("salla-skeleton",{height:"15px",width:"60%"}),a("salla-skeleton",{height:"10px",width:"30%"}),a("div",{class:"s-rating-modal-skeleton-stars"},[...Array(5)].map((t=>a("div",{key:t,innerHTML:o})))),a("salla-skeleton",{height:"100px",width:"100%"}),a("div",{class:"s-rating-modal-skeleton-footer"},a("salla-skeleton",{height:"40px",width:"30%"})))),!this.hasError&&this.order?[a("div",{class:"s-rating-modal-wrapper",ref:t=>{t&&(this.body=t)}},this.isTestimonialsEnabled()?a("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"store"},a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:salla.config.get("store.logo","https://assets.salla.sa/cp/assets/images/logo-new.png"),alt:"store name",class:"s-rating-modal-store-logo"})),a("h2",{class:"s-rating-modal-title"},salla.config.get("store.name")),a("p",{class:"s-rating-modal-subtitle"},salla.lang.get("pages.rating.rate_the_store")),a("div",{class:"s-rating-modal-stars-company"},a("salla-rating-stars",{withLabel:!0,size:"large"})),a("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),a("small",{class:"s-rating-modal-validation-msg"})):"",this.isProductsEnabled()&&this.getRateableProducts().map(((t,i)=>this.renderProductStep(t,i))),this.isShippingEnabled()&&this.order.shipping?.company?a("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"shipping"},a("input",{type:"hidden",name:"shipping_company_id",value:this.order.shipping.company.id}),this.order.shipping.company.logo?a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:this.order.shipping.company.logo,class:"s-rating-modal-shipping-logo",alt:this.order.shipping.company.name})):a("span",{class:"s-rating-modal-icon",innerHTML:r}),a("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.order.shipping.company.name}`),a("p",{class:"s-rating-modal-subtitle"},salla.lang.get("pages.rating.write_shipping_rate")),a("div",{class:"s-rating-modal-stars-company"},a("salla-rating-stars",{withLabel:!0,size:"large"})),a("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),a("small",{class:"s-rating-modal-validation-msg"})):"",a("div",{class:"s-rating-modal-thanks s-rating-modal-hidden",ref:t=>{t&&(this.thanksTab=t)}},a("span",{class:"s-rating-modal-icon",innerHTML:n}),a("h3",{class:"s-rating-modal-thanks-title"},salla.lang.get("pages.rating.thanks")),a("div",{class:"s-rating-modal-thanks-msg",innerHTML:this.order.thanks_message}),a("time",{class:"s-rating-modal-thanks-time",ref:t=>{t&&(this.thanksTime=t)}}))),this.allowContactSupport&&this.showContactWidget&&(salla.config.get("store.contacts.whatsapp")||salla.config.get("store.contacts.email"))?a("div",{class:"s-rating-modal-contact"},a("p",null,this.contactUsLabel),a("div",{class:"s-rating-modal-contact-icons"},salla.config.get("store.contacts.whatsapp")&&a("span",{onClick:()=>this.handleSendWhatsApp(),innerHTML:h}),salla.config.get("store.contacts.email")&&a("span",{onClick:()=>this.handleSendEmail(),innerHTML:m}))):"",a("div",{class:"s-rating-modal-footer"},a("button",{ref:t=>{t&&(this.backBtn=t)},onClick:()=>this.previousTab(),class:"s-rating-modal-btn s-rating-modal-unvisiable"},salla.lang.get("common.elements.back")),this.stepsCount>1?a("ul",{class:"s-rating-modal-dots"},[...Array(this.stepsCount)].map(((t,i)=>a("li",{key:i,class:"s-rating-modal-bg-gray s-rating-modal-step-dot"})))):"",a("salla-button",{"loader-position":"center",loading:this.hasUploadsInProgress,disabled:this.hasUploadsInProgress,ref:t=>{t&&(this.nextBtn=t)},onClick:()=>this.submit()},salla.lang.get("common.elements.next")))]:a("div",{class:"s-rating-modal-wrapper"},a("salla-placeholder",{alignment:"center"},this.errorMessage?a("span",{slot:"description"},this.errorMessage):null)))):void 0}async componentWillLoad(){await salla.onReady(),await salla.lang.onLoaded(),this.registerTranslations(),this.syncStoreSettings()}registerTranslations(){salla.lang.addBulk({"common.uploader.drag_and_drop_files":{ar:"اسحب الملفات وأفلتها هنا",en:"Drag and drop files here"},"common.uploader.allowed_images_types":{ar:" .jpg أو jpeg أو png يُسمح بإضافة صور بصيغة",en:"Images in jpg, jpeg, or png format are allowed."},"pages.rating.add_images":{ar:"اضافة صور",en:"Add Images"},"pages.rating.edit_images":{ar:"تعديل الصور",en:"Edit Images"},"pages.rating.edit_review":{ar:"تعديل التقييم",en:"Edit review"},"pages.rating.confirm_deletion":{ar:"تأكيد حذف التقييم",en:"Confirm review deletion"},"pages.rating.are_you_sure_you_want_to_delete_review":{ar:"هل أنت متأكد من حذف تقييمك؟",en:"Are you sure you want to delete your review?"},"pages.rating.review_updated_successfully":{ar:"تم تعديل التقييم بنجاح",en:"The review has been successfully updated."},"pages.rating.review_deleted_successfully":{ar:"تم حذف التقييم بنجاح",en:"The review has been successfully deleted."},"pages.rating.images_count":{ar:"الصور ( :current من أصل :total )",en:"Images ( :current of :total )"},"pages.rating.media_count":{ar:"الصور (:imageCurrent/:imageTotal) · الفيديو (:videoCurrent/:videoTotal)",en:"Images (:imageCurrent/:imageTotal) · Videos (:videoCurrent/:videoTotal)"},"common.uploader.allowed_videos_types":{ar:"يُسمح بفيديوهات mp4 أو mov أو avi أو mkv",en:"Videos in mp4, mov, avi, or mkv format are allowed."},"pages.rating.videos_count":{ar:"الفيديو ( :current من أصل :total )",en:"Videos ( :current of :total )"},"common.uploader.allowed_media_types":{ar:"يُسمح بصور jpg أو jpeg أو png وفيديوهات mp4 أو mov أو avi أو mkv",en:"Images in jpg, jpeg, or png and videos in mp4, mov, avi, or mkv are allowed."},"common.uploader.max_three_images":{ar:"أضف حتى 10 صور و 5 فيديوهات كحد أقصى",en:"Add up to 10 images and 5 videos maximum."},"common.uploader.max_images_count":{ar:"أضف :count صور كحد أقصى",en:"Add up to :count images maximum."},"common.uploader.max_videos_count":{ar:"أضف :count فيديوهات كحد أقصى",en:"Add up to :count videos maximum."},"common.elements.confirm_delete":{ar:"تأكيد الحذف",en:"Confirm deletion"},"pages.rating.rate_required_factors":{ar:"يرجى تقييم جميع المعايير لإتمام مراجعتك.",en:"Please rate all required factors to complete your review."},"pages.rating.overall_product_rating":{ar:"التقييم العام للمنتج",en:"Overall product rating"},"pages.rating.rate_the_following_factors":{ar:"كيف تقيِّم التالي؟",en:"How would you rate the following?"},"pages.rating.loyalty_points_for_images":{ar:"شاركنا صورة مع تقييمك للطلب واكسب :points نقطة ولاء",en:"Share a photo with your order review and earn :points loyalty points"},"pages.rating.nothing_to_rate":{ar:"لا يوجد شيء متاح للتقييم في هذا الطلب حاليًا.",en:"There is nothing available to rate for this order right now."}}),this.contactUsLabel=salla.lang.get("blocks.footer.social"),this.dragAndDropFilesLabel=salla.lang.get("common.uploader.drag_and_drop_files"),this.allowedImagesTypesLabel=this.getAllowedMediaTypesLabel(),this.threeImagesMax=this.getMaxUploadHintLabel(),this.contactSubjectLabel=salla.lang.get("pages.rating.contact_subject"),this.editReviewLabel=salla.lang.get("pages.rating.edit_review"),this.areYouSureLabel=salla.lang.get("pages.rating.are_you_sure_you_want_to_delete_review"),this.confirmDeletionLabel=salla.lang.get("pages.rating.confirm_deletion"),this.cancelLabel=salla.lang.get("common.elements.cancel"),this.updatedSuccessfullyLabel=salla.lang.get("pages.rating.review_updated_successfully"),this.deletedSuccessfullyLabel=salla.lang.get("pages.rating.review_deleted_successfully"),this.nothingToRateLabel=salla.lang.get("pages.rating.nothing_to_rate"),this.confirmDeleteBtn=salla.lang.get("common.elements.confirm_delete"),this.requiredFactorsLabel=salla.lang.get("pages.rating.rate_required_factors"),this.rateTheFollowingLabel=salla.lang.get("pages.rating.rate_the_following_factors"),this.loyaltyPointsForImagesLabel=salla.lang.get("pages.rating.loyalty_points_for_images",{points:":points"}),this.contact_body=(t,i,a)=>salla.lang.get("pages.rating.contact_body",{store:t,id:i,customer:a})}componentDidRender(){this.scheduleWizardSetup&&this.defaultMode&&this.order&&(this.scheduleWizardSetup=!1,requestAnimationFrame((()=>this.handleWizard())))}disconnectedCallback(){this.clearThanksCountdown()}get host(){return e(this)}};x.style='/*!twlt*/.s-rating-modal-uploader{overflow:visible}.s-rating-modal-uploader.is-opened{height:auto !important;opacity:1 !important;overflow:visible;pointer-events:auto !important;margin-bottom:1rem}.s-rating-modal-uploader .s-file-upload-gallery{overflow:visible}.s-rating-modal-edit-wrapper,.s-rating-modal-wrapper{transition:height 0.15s ease}.s-rating-modal-product-details{padding-bottom:0.5rem}.s-rating-modal-comment{margin-top:0.35rem}.s-rating-modal-product{margin-bottom:1rem}.s-rating-modal-product-img{position:absolute !important;inset:0;display:block;width:100% !important;max-width:100% !important;height:100% !important;object-fit:cover}.s-rating-modal-product-title{font-size:0.95rem;font-weight:600;line-height:1.5;margin:0}.s-rating-modal-stars-product{margin-top:0.5rem}.s-rating-modal-loyalty-points-note-container{display:flex;align-items:center;gap:0.625rem;width:100%;margin-top:1.5rem;margin-bottom:0.75rem;padding:0.75rem;border-radius:0.5rem;background-color:#E6F4EA}.s-rating-modal-loyalty-points-note-icon{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;color:#1B7F5C}.s-rating-modal-loyalty-points-note-icon svg{width:1.5rem;height:1.5rem;fill:currentColor}.s-rating-modal-loyalty-points-note-text{flex:1;margin:0;font-size:0.875rem;line-height:1.25rem;color:#1f2937}.s-rating-modal-product-details-main{display:flex;align-items:center;margin-bottom:0.5rem;padding-bottom:0;border-bottom:0}.s-rating-modal-product-info-row{display:flex;align-items:center;gap:0.6rem;margin-bottom:0.5rem;padding-bottom:0;border-bottom:0}.s-rating-modal-product-main-review{width:100%;text-align:right}.s-rating-modal-product-rating-rows{display:grid;gap:0.45rem;margin:0.2rem 0 0.7rem}.s-rating-modal-product-rating-row{display:flex;align-items:center;justify-content:space-between;gap:0.75rem;min-height:2rem}.s-rating-modal-product-rating-row salla-rating-stars{flex-shrink:0}.s-rating-modal-product-rating-row .s-rating-stars-wrapper{align-items:center;min-height:1.75rem}.s-rating-modal-product-rating-row .s-rating-stars-label,.s-rating-modal-product-rating-row .s-rating-stars-label-without-tag{min-width:auto;min-height:1.25rem;line-height:1.25rem;font-size:0.8rem;color:#5b6470;white-space:nowrap;text-align:end;transition:opacity 0.15s ease}.s-rating-modal-product-rating-row .s-rating-stars-label--empty,.s-rating-modal-product-rating-row .s-rating-stars-label-without-tag--empty{opacity:0}.s-rating-modal-product-factor-name{color:#5b6470;font-size:0.9rem;line-height:1.25}.s-rating-modal-product-factor-required{color:#f87171;margin-inline-start:0.2rem}.s-rating-modal-product-img-wrap{position:relative;width:5rem !important;min-width:5rem !important;max-width:5rem !important;height:3.5rem !important;flex-shrink:0 !important;overflow:hidden;border-radius:0.375rem;background:#f3f4f6}.mt-0{margin-top:0px}.block{display:block}.hidden{display:none}.shadow{--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)}.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-comments-item-like-btn{margin-top:0.5rem}.s-comments-item-like-btn .s-button-text{display:flex;flex-direction:row-reverse;gap:0.5rem}.s-comments-item-like-btn span svg{height:0.75rem;width:0.75rem}.s-rating-modal-wrapper{margin-bottom:1.5rem;transition-property:all;transition-duration:100ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.s-rating-modal-edit-wrapper{margin-top:0.625rem}.s-rating-modal-footer{position:relative;display:flex;align-items:center;justify-content:space-between}.s-rating-modal-footer salla-button button{padding-left:1rem !important;padding-right:1rem !important;font-size:0.75rem !important}.s-rating-modal-btn{height:2.5rem;padding-left:1rem;padding-right:1rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-rating-modal-btn:hover{color:var(--color-primary-dark)}.s-rating-modal-dots{display:flex;flex-shrink:0;flex-grow:1;justify-content:center}.s-rating-modal-dots>: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-rating-modal-dots{text-align:center}.s-rating-modal-dots:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-rating-modal-step-dot{height:0.625rem;width:0.625rem;border-radius:9999px;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-rating-modal-step{transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-rating-modal-active{--tw-translate-x:0px;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-rating-modal-unactive{--tw-translate-x:0.75rem;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:0}.s-rating-modal-hidden{display:none !important}.s-rating-modal-unvisiable{pointer-events:none;opacity:0}.s-rating-modal-step-wrap{position:relative;display:flex;flex-direction:column;align-items:center;padding-bottom:1rem}.s-rating-modal-product-details{position:relative;display:flex;flex:1 1 0%;flex-direction:column;padding-bottom:1rem}.s-rating-modal-product-details-main{display:flex;align-items:flex-start;justify-content:space-between}.s-rating-modal-product-details-main .s-rating-stars-wrapper{margin-bottom:0.375rem;flex-direction:column;align-items:center}@media (min-width: 640px){.s-rating-modal-product-details-main .s-rating-stars-wrapper{margin-bottom:0px;flex-direction:row;gap:0px}}.s-rating-modal-rounded-icon{position:relative;margin-bottom:0.25rem;display:flex;height:6rem;width:6rem;align-items:center;justify-content:center;overflow:hidden;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-rating-modal-title{margin-bottom:0.25rem;font-size:1.125rem;line-height:1.75rem;font-weight:700}.s-rating-modal-subtitle{margin-bottom:0.25rem;padding-left:0.5rem;padding-right:0.5rem;text-align:center;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-rating-modal-store-logo{width:4rem;object-fit:contain}.s-rating-modal-shipping-logo{height:100%;width:100%;object-fit:contain}.s-rating-modal-shipping-icon{font-size:3rem;line-height:1;color:var(--color-primary)}.s-rating-modal-comment{margin-bottom:0.5rem;height:5rem !important;width:100%;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:0.75rem;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:150ms}.s-rating-modal-comment:focus{border-color:var(--color-primary)}.s-rating-modal-comment:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.s-rating-modal-validation-msg{margin-top:-3px;line-height:1rem;--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-rating-modal-product{margin-bottom:1.5rem}.s-rating-modal-product:last-child{margin-bottom:0px}.s-rating-modal-product .rating-outer-form{display:flex}.s-rating-modal-product .rating-outer-form>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}@media (min-width: 640px){.s-rating-modal-product .rating-outer-form>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}}.s-rating-modal-product .rating-outer-form:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-rating-modal-product-img-wrap{height:3.5rem;width:auto;overflow:hidden;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}@media (min-width: 640px){.s-rating-modal-product-img-wrap{width:5rem}}.s-rating-modal-product-img{position:relative;height:100%;width:100%;object-fit:cover;font-size:0px}.s-rating-modal-product-img::before{position:absolute;top:0px;left:0px;height:100%;width:100%;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-rating-modal-product-title{margin-bottom:0.375rem;font-size:0.875rem;font-weight:700;line-height:1.25rem}.s-rating-modal-thanks{padding-left:2rem;padding-right:2rem;text-align:center;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-rating-modal-icon{display:inline-flex;height:5rem;width:5rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));color:var(--color-primary)}.s-rating-modal-icon svg{height:1.75rem;width:1.75rem;fill:var(--color-primary)}.s-rating-modal-thanks-title{margin-top:1rem;font-weight:700}.s-rating-modal-thanks-msg{margin-bottom:1.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-rating-modal-thanks-btn{height:2.5rem;flex:none;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}.s-rating-modal-thanks-btn:hover{opacity:0.8}.s-rating-modal-thanks-btn{border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-rating-modal-thanks-time{margin-top:0.75rem;display:block;height:1.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-rating-modal-product-factors-card{margin-bottom:1rem;border-radius:0.5rem;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));padding:1rem}.s-rating-modal-product-factors-heading{margin-bottom:0.75rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-rating-modal-stars-company{margin-bottom:1.25rem}.s-rating-modal-stars-company .s-rating-stars-wrapper{flex-direction:column;align-items:center;justify-content:center;gap:0.5rem}.s-rating-modal-stars-product .s-rating-stars-wrapper{flex-direction:column;align-items:center;justify-content:center}.s-rating-modal-upload-count{font-size:0.875rem;line-height:1.25rem;font-weight:500}.s-rating-modal-bg-gray{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-rating-modal-bg-primary{background-color:var(--color-primary)}unicode{unicode-bidi:plaintext}.s-rating-modal-wrap .s-modal-body{position:relative !important}.s-rating-modal-skeleton{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-rating-modal-skeleton salla-skeleton:nth-child(1){margin-bottom:1.25rem}.s-rating-modal-skeleton salla-skeleton:nth-child(2){margin-bottom:0.75rem}.s-rating-modal-skeleton salla-skeleton:nth-child(3){margin-bottom:1.25rem}.s-rating-modal-skeleton salla-skeleton:nth-child(4){margin-bottom:2rem}.s-rating-modal-skeleton-footer{margin-top:1.5rem;display:flex;width:100%;justify-content:flex-end}.s-rating-modal-skeleton-footer salla-skeleton{margin-bottom:0px !important}.s-rating-modal-skeleton-stars{margin-bottom:0.75rem;display:flex;align-items:center}.s-rating-modal-skeleton-stars>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}.s-rating-modal-skeleton-stars:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-rating-modal-skeleton-stars div svg{width:25px;fill:currentColor;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-rating-modal-uploader{height:0px;opacity:0;transition-property:all;transition-duration:100ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.s-rating-modal-uploader.is-opened{margin-bottom:1.5rem;overflow:visible}.s-rating-modal-uploader.is-closed{pointer-events:none;z-index:0}.s-rating-modal-uploader .filepond--drop-label{--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-rating-modal-uploader .filepond--file-status .filepond--file-status-main{font-size:11px}.s-rating-modal-uploader .filepond--file-info-main{font-size:11px}.s-rating-modal-uploader li[data-filepond-item-state=\'load-invalid\'] .filepond--file-info{display:none}.s-rating-modal-filepond-placeholder-text{font-size:0.75rem !important;line-height:1rem !important}.s-rating-modal-filepond-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-rating-modal-filepond-placeholder-icon{margin-bottom:0.25rem}.s-rating-modal-filepond-placeholder-icon svg{height:1.5rem;width:1.5rem;fill:#7c8082}.s-rating-modal-contact{margin-bottom:1rem;display:flex;align-items:center;justify-content:space-between;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding:0.5rem}.s-rating-modal-contact p{font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-rating-modal-contact-icons{display:flex;align-items:center;gap:0.5rem}.s-rating-modal-contact-icons span{display:flex;cursor:pointer;align-items:center;justify-content:center;border-radius:0.375rem;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(255 255 255 / var(--tw-bg-opacity, 1));padding:0.375rem}.s-rating-modal-contact-icons span svg{height:1rem;width:1rem;fill:var(--color-primary)}.s-rating-modal-footer-end{justify-content:flex-end}.s-rating-modal-delete-wrapper{text-align:center}.s-rating-modal-delete-wrapper h3{margin-top:1.25rem;font-size:1.125rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-rating-modal-delete-wrapper p{margin-top:1.25rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-rating-modal-delete-actions{margin-top:1.25rem;display:flex;align-items:center;gap:0.625rem}.s-rating-modal-delete-actions salla-button{width:100%}.s-rating-modal-delete-actions salla-button button{width:100%}';export{x as salla_rating_modal_v2}
|