@salla.sa/twilight-components 2.14.543 → 2.14.545
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{filepond-uhJt4caG.js → filepond-B5aWlI3l.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-Dy-GRHf0.js → filepond-plugin-file-poster-BYq39KHd.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-BWIBGLW-.js → filepond-plugin-file-validate-size-Bi3TAsJv.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-DEVtMF0l.js → filepond-plugin-file-validate-type-Ck6S5TuZ.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-DSDoJaLw.js → filepond-plugin-image-edit-DbsdnH5j.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-BdZit5hj.js → filepond-plugin-image-exif-orientation-x7TfJR-2.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-Z3_zQyYR.js → filepond-plugin-image-preview-CrU7vIRk.js} +1 -1
- package/dist/cjs/helpers-DHdDjm5V.js +340 -0
- package/dist/cjs/{index-Bw3b6O6G.js → index-DGpOR-TH.js} +14 -14
- package/dist/cjs/{intlTelInput-CXe3TkdL.js → intlTelInput-DKAXRecW.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{mail-CO8cFZH7.js → mail-C9D8MHae.js} +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-attachment-view_9.cjs.entry.js +10 -10
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
- package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +156 -401
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
- package/dist/cjs/{salla-comment-form_9.cjs.entry.js → salla-comment-form_8.cjs.entry.js} +3 -259
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +3 -3
- 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 +21 -5
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +3 -3
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +14 -73
- package/dist/cjs/salla-rating-modal.cjs.entry.js +7 -22
- package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +1 -1
- package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/salla-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +4 -4
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +3 -3
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-GTx-kpDm.js → vanilla-picker-DQDSSf6Q.js} +1 -1
- package/dist/collection/collection-manifest.json +12 -14
- package/dist/collection/components/salla-bullet-delivery/helpers.js +3 -0
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +82 -16
- package/dist/collection/components/salla-comments/interfaces.js +0 -12
- package/dist/collection/components/salla-comments/salla-comment-item.js +1 -1
- package/dist/collection/components/salla-comments/salla-comments.js +5 -38
- package/dist/collection/components/salla-delivery-promise/delivery-promise-api.js +1 -1
- package/dist/collection/components/salla-delivery-promise/delivery-promise-intent.js +9 -0
- package/dist/collection/components/salla-delivery-promise/salla-delivery-promise.js +10 -3
- package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +16 -119
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +10 -69
- package/dist/components/helpers.js +319 -0
- package/dist/components/index.js +2 -2
- package/dist/components/salla-bullet-delivery.js +82 -327
- package/dist/components/salla-comment-item2.js +1 -1
- package/dist/components/salla-comments.js +1 -40
- package/dist/components/salla-delivery-promise.js +20 -4
- package/dist/components/salla-rating-modal-v22.js +12 -73
- package/dist/components/salla-rating-modal.js +591 -1
- package/dist/esm/{filepond-plugin-file-poster-BTU_WzVu.js → filepond-plugin-file-poster-CkWxCmZT.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-c_09APqP.js → filepond-plugin-file-validate-size-DlWS-oUK.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-Dz2Lgh8V.js → filepond-plugin-file-validate-type-mdpFM1TG.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-DK7eXs2p.js → filepond-plugin-image-edit-BqPLKgZU.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-DYBURwn_.js → filepond-plugin-image-exif-orientation-CMqFjPu7.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-4WNiH-ie.js → filepond-plugin-image-preview-DjCwk-CI.js} +1 -1
- package/dist/esm/{filepond-BcXR53L3.js → filepond-wd7_MQSV.js} +1 -1
- package/dist/esm/helpers-BDChq2t4.js +319 -0
- package/dist/esm/{index-BW1au-Nh.js → index-CHZfg_a9.js} +14 -14
- package/dist/esm/{intlTelInput-DvPcVtVG.js → intlTelInput-B5Q8rrU9.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{mail-DmgxDvXL.js → mail-DzAIgzdz.js} +2 -2
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +1 -1
- package/dist/esm/salla-add-product-button_5.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-attachment-view_9.entry.js +10 -10
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-basket-gap.entry.js +1 -1
- package/dist/esm/salla-bullet-delivery_2.entry.js +83 -328
- package/dist/esm/salla-cart-coupons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
- package/dist/esm/salla-cart-summary-card.entry.js +1 -1
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-factors.entry.js +1 -1
- package/dist/esm/{salla-comment-form_9.entry.js → salla-comment-form_8.entry.js} +4 -259
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +3 -3
- 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 +21 -5
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +1 -1
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-banner_10.entry.js +3 -3
- package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_2.entry.js +1 -1
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-next-order-coupon.entry.js +1 -1
- package/dist/esm/salla-notification-item_2.entry.js +1 -1
- package/dist/esm/salla-offer-modal.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-branch.entry.js +1 -1
- package/dist/esm/salla-order-cancel.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-edit-item.entry.js +1 -1
- package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
- package/dist/esm/salla-order-edit.entry.js +1 -1
- package/dist/esm/salla-order-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-order-shipments.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +1 -1
- package/dist/esm/salla-products-slider.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +3 -3
- package/dist/esm/salla-rating-modal-v2.entry.js +14 -73
- package/dist/esm/salla-rating-modal.entry.js +7 -22
- package/dist/esm/salla-review-factors-tags.entry.js +1 -1
- package/dist/esm/salla-review-order-item.entry.js +1 -1
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +1 -1
- package/dist/esm/salla-skeleton.entry.js +1 -1
- package/dist/esm/salla-slider.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +4 -4
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +3 -3
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-CDk_knNu.js → vanilla-picker-uNDULydX.js} +1 -1
- package/dist/twilight/{p-df202b1d.entry.js → p-0495bfac.entry.js} +1 -1
- package/dist/twilight/{p-13dbbbdc.entry.js → p-0573a498.entry.js} +1 -1
- package/dist/twilight/{p-b89d8c3c.entry.js → p-06d9e1c5.entry.js} +1 -1
- package/dist/twilight/{p-b1dfc455.entry.js → p-0749cc55.entry.js} +1 -1
- package/dist/twilight/p-0ae39262.entry.js +4 -0
- package/dist/twilight/{p-de83979a.entry.js → p-12836275.entry.js} +1 -1
- package/dist/twilight/p-12f61ae1.entry.js +4 -0
- package/dist/twilight/{p-69f4a089.entry.js → p-1419a93d.entry.js} +1 -1
- package/dist/twilight/{p-baa06c65.entry.js → p-17d49c87.entry.js} +1 -1
- package/dist/twilight/{p-1282e22a.entry.js → p-1ea25389.entry.js} +1 -1
- package/dist/twilight/{p-80c11fae.entry.js → p-2305edcc.entry.js} +1 -1
- package/dist/twilight/{p-10534171.entry.js → p-235d7596.entry.js} +1 -1
- package/dist/twilight/{p-50c0b6fa.entry.js → p-25d9f1b2.entry.js} +1 -1
- package/dist/twilight/{p-16ccbce5.entry.js → p-25f51a7e.entry.js} +1 -1
- package/dist/twilight/{p-3c28560f.entry.js → p-279a1661.entry.js} +1 -1
- package/dist/twilight/{p-ac794ed6.entry.js → p-28248b6b.entry.js} +1 -1
- package/dist/twilight/{p-7afd066a.entry.js → p-2d01a4f5.entry.js} +1 -1
- package/dist/twilight/{p-66c7b9e4.entry.js → p-2d62c947.entry.js} +1 -1
- package/dist/twilight/{p-489d084c.entry.js → p-2db5e829.entry.js} +1 -1
- package/dist/twilight/{p-362792d6.entry.js → p-2de58591.entry.js} +1 -1
- package/dist/twilight/{p-16296dce.entry.js → p-32e3daa3.entry.js} +1 -1
- package/dist/twilight/{p-beb2110d.entry.js → p-345532e5.entry.js} +1 -1
- package/dist/twilight/{p-280e67f0.entry.js → p-346366ba.entry.js} +1 -1
- package/dist/twilight/{p-46399dc8.entry.js → p-35557962.entry.js} +1 -1
- package/dist/twilight/{p-d54acab0.entry.js → p-3672d4f7.entry.js} +1 -1
- package/dist/twilight/{p-315890b5.entry.js → p-37163aef.entry.js} +1 -1
- package/dist/twilight/{p-e184cd72.entry.js → p-391a2ec6.entry.js} +1 -1
- package/dist/twilight/{p-b2b818a5.entry.js → p-3a8be7df.entry.js} +1 -1
- package/dist/twilight/{p-ceb40475.entry.js → p-3f5bc617.entry.js} +1 -1
- package/dist/twilight/{p-cf4efddb.entry.js → p-419499d6.entry.js} +1 -1
- package/dist/twilight/{p-d018fc49.entry.js → p-4ac9a3b6.entry.js} +1 -1
- package/dist/twilight/{p-aa9fb9f5.entry.js → p-5074de7d.entry.js} +1 -1
- package/dist/twilight/{p-65a86613.entry.js → p-51a062cd.entry.js} +1 -1
- package/dist/twilight/p-54e2d320.entry.js +1024 -0
- package/dist/twilight/{p-84679cc1.entry.js → p-5933ba05.entry.js} +1 -1
- package/dist/twilight/{p-4b14e0f8.entry.js → p-5d9a85b0.entry.js} +1 -1
- package/dist/twilight/{p-d7a68f6c.entry.js → p-5ded000f.entry.js} +1 -1
- package/dist/twilight/{p-a3fdec51.entry.js → p-63b01300.entry.js} +1 -1
- package/dist/twilight/{p-677bcf4c.entry.js → p-64efbb2c.entry.js} +1 -1
- package/dist/twilight/{p-feb80402.entry.js → p-67b91397.entry.js} +1 -1
- package/dist/twilight/{p-9b1403fc.entry.js → p-69119c00.entry.js} +1 -1
- package/dist/twilight/{p-6e78ee63.entry.js → p-6c18cc72.entry.js} +1 -1
- package/dist/twilight/{p-1ba8fb02.entry.js → p-6d961d73.entry.js} +1 -1
- package/dist/twilight/{p-64f0c216.entry.js → p-6ff53523.entry.js} +1 -1
- package/dist/twilight/{p-75065cbf.entry.js → p-72ee7071.entry.js} +1 -1
- package/dist/twilight/{p-6d6618f8.entry.js → p-72f54055.entry.js} +1 -1
- package/dist/twilight/{p-3b9dcb0f.entry.js → p-74529abb.entry.js} +1 -1
- package/dist/twilight/{p-664d428e.entry.js → p-766a3291.entry.js} +1 -1
- package/dist/twilight/{p-d3692caf.entry.js → p-788fd019.entry.js} +1 -1
- package/dist/twilight/{p-a15b4245.entry.js → p-82fe9f82.entry.js} +1 -1
- package/dist/twilight/{p-f45f5f91.entry.js → p-832f3a98.entry.js} +1 -1
- package/dist/twilight/{p-89fe5237.entry.js → p-84380d4a.entry.js} +1 -1
- package/dist/twilight/{p-311a905b.entry.js → p-8780a467.entry.js} +1 -1
- package/dist/twilight/{p-7adefcd6.entry.js → p-87e10a68.entry.js} +1 -1
- package/dist/twilight/{p-3cfd4fcd.entry.js → p-88f50d7e.entry.js} +1 -1
- package/dist/twilight/{p-f0a04676.entry.js → p-8fc6e860.entry.js} +1 -1
- package/dist/twilight/{p-cc3a9188.entry.js → p-90e5c3ab.entry.js} +1 -1
- package/dist/twilight/{p-641cc01d.entry.js → p-93aa1b67.entry.js} +1 -1
- package/dist/twilight/{p-a4436d17.entry.js → p-93dabb47.entry.js} +1 -1
- package/dist/twilight/{p-07c013f9.entry.js → p-98108ebe.entry.js} +1 -1
- package/dist/twilight/{p-72960bb3.entry.js → p-989f2adb.entry.js} +1 -1
- package/dist/twilight/{p-4be8900d.entry.js → p-9d224252.entry.js} +1 -1
- package/dist/twilight/p-BDChq2t4.js +4 -0
- package/dist/twilight/{p-D9Y6HNvi.js → p-BPkSO6gd.js} +1 -1
- package/dist/twilight/{p-BUMDIRU5.js → p-BWvO3cE-.js} +1 -1
- package/dist/twilight/{p-BW1au-Nh.js → p-CHZfg_a9.js} +1 -1
- package/dist/twilight/{p-AncUY1nn.js → p-CdgES2Of.js} +1 -1
- package/dist/twilight/{p-DPMPVhgw.js → p-D9VjvNQq.js} +2 -2
- package/dist/twilight/{p-C6nX89oY.js → p-DO7S0QBX.js} +1 -1
- package/dist/twilight/{p-UDPL8zGN.js → p-DtV7npW9.js} +1 -1
- package/dist/twilight/{p-DmgxDvXL.js → p-DzAIgzdz.js} +1 -1
- package/dist/twilight/{p-UIEwOe70.js → p-PCp-0mbL.js} +1 -1
- package/dist/twilight/{p-BjS2Vb6h.js → p-ZinKLSYw.js} +1 -1
- package/dist/twilight/{p-1c82117c.entry.js → p-a0561bd1.entry.js} +1 -1
- package/dist/twilight/{p-1187210a.entry.js → p-a785b49f.entry.js} +1 -1
- package/dist/twilight/{p-13bf1c47.entry.js → p-aa4daadf.entry.js} +1 -1
- package/dist/twilight/p-ab41d26c.entry.js +4 -0
- package/dist/twilight/{p-87cc2e08.entry.js → p-afb03ee5.entry.js} +1 -1
- package/dist/twilight/{p-caa8d5ae.entry.js → p-b279e0bb.entry.js} +1 -1
- package/dist/twilight/{p-bcee5564.entry.js → p-b33392c6.entry.js} +1 -1
- package/dist/twilight/{p-e1eb70d2.entry.js → p-b38c4e39.entry.js} +1 -1
- package/dist/twilight/{p-26f8a482.entry.js → p-bead6e6f.entry.js} +1 -1
- package/dist/twilight/{p-8643930a.entry.js → p-c26043ff.entry.js} +1 -1
- package/dist/twilight/{p-a7a10dbf.entry.js → p-c287e498.entry.js} +1 -1
- package/dist/twilight/{p-87af932a.entry.js → p-c2fe2dbe.entry.js} +1 -1
- package/dist/twilight/{p-6d3a4c41.entry.js → p-c603722c.entry.js} +1 -1
- package/dist/twilight/{p-edebecb3.entry.js → p-c816b198.entry.js} +1 -1
- package/dist/twilight/{p-f3f9d1fb.entry.js → p-c81bce54.entry.js} +1 -1
- package/dist/twilight/{p-40555637.entry.js → p-c9146d50.entry.js} +1 -1
- package/dist/twilight/{p-5335f307.entry.js → p-c92edd6f.entry.js} +1 -1
- package/dist/twilight/{p-821aa95a.entry.js → p-c948a8a8.entry.js} +1 -1
- package/dist/twilight/{p-93c006fc.entry.js → p-d0d3609c.entry.js} +1 -1
- package/dist/twilight/{p-a38dc391.entry.js → p-d9b0fa64.entry.js} +1 -1
- package/dist/twilight/{p-534e7760.entry.js → p-dd823fde.entry.js} +1 -1
- package/dist/twilight/p-e36f62a9.entry.js +4 -0
- package/dist/twilight/{p-beaab93e.entry.js → p-e5a3b689.entry.js} +1 -1
- package/dist/twilight/{p-c7e980aa.entry.js → p-ec281904.entry.js} +1 -1
- package/dist/twilight/{p-68d6fa66.entry.js → p-f07bbbc7.entry.js} +1 -1
- package/dist/twilight/{p-3ad55c42.entry.js → p-f168109d.entry.js} +1 -1
- package/dist/twilight/{p-e8153a9a.entry.js → p-f1d8729d.entry.js} +1 -1
- package/dist/twilight/{p-2a8f1ed4.entry.js → p-f1dfe18b.entry.js} +1 -1
- package/dist/twilight/{p-c23f7b95.entry.js → p-fb1ad954.entry.js} +1 -1
- package/dist/twilight/{p-c214700a.entry.js → p-ffdf5f92.entry.js} +1 -1
- package/dist/twilight/{p-CMWS1gyZ.js → p-ryHWESoh.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-bullet-delivery/helpers.d.ts +1 -0
- package/dist/types/components/salla-bullet-delivery/interfaces.d.ts +14 -4
- package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +2 -0
- package/dist/types/components/salla-comments/interfaces.d.ts +0 -15
- package/dist/types/components/salla-comments/salla-comments.d.ts +2 -5
- package/dist/types/components/salla-delivery-promise/delivery-promise-intent.d.ts +0 -4
- package/dist/types/components/salla-delivery-promise/interfaces.d.ts +2 -1
- package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +3 -16
- package/dist/types/components/salla-rating-modal/salla-rating-modal.d.ts +2 -10
- package/dist/types/components.d.ts +12 -45
- package/package.json +5 -5
- package/dist/collection/components/salla-verified-review/salla-verified-review.css +0 -162
- package/dist/collection/components/salla-verified-review/salla-verified-review.js +0 -264
- package/dist/components/salla-rating-modal2.js +0 -613
- package/dist/components/salla-verified-review.d.ts +0 -11
- package/dist/components/salla-verified-review.js +0 -325
- package/dist/twilight/p-03d77f90.entry.js +0 -4
- package/dist/twilight/p-4f052df8.entry.js +0 -4
- package/dist/twilight/p-a9674965.entry.js +0 -4
- package/dist/twilight/p-cbe760ce.entry.js +0 -4
- package/dist/twilight/p-e29f28eb.entry.js +0 -1019
- package/dist/types/components/salla-verified-review/salla-verified-review.d.ts +0 -51
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
4
|
import { proxyCustomElement, HTMLElement as HTMLElement$1, createEvent, h as h$4, Host } from '@stencil/core/internal/client';
|
|
5
|
+
import { i as isSaudiArabia, b as bulletDeliveryAPI, r as requireRegionAndDistrictForSA, g as getIntentLatitude, a as getIntentLongitude, h as hasSessionAddressIntent, c as getIntentCityId, d as getIntentCountryId, e as getIntentRegionId, f as getIntentDistrictId, j as filterBranches, k as findNearestBranch, l as getGeolocationErrorMessage, m as buildAddressLocationPayloadFromSelection, n as clearApiCache, o as getIntentSubtitle, p as getIntentBranchId, q as isMapOriginIntent, s as isBranchSelectable, t as getIntentCountryCode } from './helpers.js';
|
|
5
6
|
import { S as SILocation } from './location.js';
|
|
6
7
|
import { S as Search } from './search.js';
|
|
7
8
|
import { d as defineCustomElement$7 } from './salla-button2.js';
|
|
@@ -11,318 +12,6 @@ import { d as defineCustomElement$4 } from './salla-placeholder2.js';
|
|
|
11
12
|
import { d as defineCustomElement$3 } from './salla-searchable-dropdown2.js';
|
|
12
13
|
import { d as defineCustomElement$2 } from './salla-skeleton2.js';
|
|
13
14
|
|
|
14
|
-
/**
|
|
15
|
-
* API Service for salla-bullet-delivery component
|
|
16
|
-
* Uses Salla's shipping API and scope API for delivery location management
|
|
17
|
-
*/
|
|
18
|
-
const API_LOG_PREFIX = 'BulletDeliveryAPI';
|
|
19
|
-
const validId = (id) => {
|
|
20
|
-
const n = id == null ? Number.NaN : Number(id);
|
|
21
|
-
return !Number.isNaN(n) && n !== 0;
|
|
22
|
-
};
|
|
23
|
-
async function withApiErrorHandling(fn, fallback, logLabel) {
|
|
24
|
-
try {
|
|
25
|
-
return await fn();
|
|
26
|
-
}
|
|
27
|
-
catch (error) {
|
|
28
|
-
console.error(`${API_LOG_PREFIX}: ${logLabel}`, error);
|
|
29
|
-
return fallback;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
const apiCache = new Map();
|
|
33
|
-
const CACHE_TTL = 5 * 60 * 1000;
|
|
34
|
-
function getCached(key) {
|
|
35
|
-
const entry = apiCache.get(key);
|
|
36
|
-
if (!entry || Date.now() - entry.timestamp > CACHE_TTL) {
|
|
37
|
-
apiCache.delete(key);
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
return entry.data;
|
|
41
|
-
}
|
|
42
|
-
function setCache(key, data) {
|
|
43
|
-
apiCache.set(key, { data, timestamp: Date.now() });
|
|
44
|
-
}
|
|
45
|
-
/** Uses country code from API (e.g. 'SA'). */
|
|
46
|
-
const isSaudiArabia = (countryCode) => String(countryCode).toUpperCase() === 'SA';
|
|
47
|
-
/**
|
|
48
|
-
* Fast Delivery API Service
|
|
49
|
-
* Uses Salla's shipping API and scopes API. Branch and address data are used as returned by the API (no mapping).
|
|
50
|
-
*/
|
|
51
|
-
const bulletDeliveryAPI = {
|
|
52
|
-
/**
|
|
53
|
-
* Get available countries from Salla shipping API
|
|
54
|
-
* @param forBranch - when true, use for_branch=1 (e.g. for pickup/branches tab)
|
|
55
|
-
*/
|
|
56
|
-
async getCountries(forBranch = false, query) {
|
|
57
|
-
const cacheKey = !query?.trim() ? `countries_${forBranch ? 1 : 0}` : null;
|
|
58
|
-
if (cacheKey) {
|
|
59
|
-
const cached = getCached(cacheKey);
|
|
60
|
-
if (cached)
|
|
61
|
-
return cached;
|
|
62
|
-
}
|
|
63
|
-
const result = await withApiErrorHandling(async () => {
|
|
64
|
-
const params = { for_branch: forBranch ? 1 : 0 };
|
|
65
|
-
if (forBranch) {
|
|
66
|
-
params.for_allocation = 1;
|
|
67
|
-
}
|
|
68
|
-
if (query?.trim())
|
|
69
|
-
params.query = query.trim();
|
|
70
|
-
const data = (await salla.api.request("shipping/countries", { params }))?.data ?? [];
|
|
71
|
-
return data.map((c) => ({ id: c.id, code: c.code, name: c.name, has_regions: isSaudiArabia(c.code) }));
|
|
72
|
-
}, [], 'Error getting countries');
|
|
73
|
-
if (cacheKey && result.length > 0)
|
|
74
|
-
setCache(cacheKey, result);
|
|
75
|
-
return result;
|
|
76
|
-
},
|
|
77
|
-
/**
|
|
78
|
-
* Get regions for a country from Salla shipping API
|
|
79
|
-
* Endpoint: GET /shipping/countries/<COUNTRY_ID>/region
|
|
80
|
-
*/
|
|
81
|
-
async getRegions(countryId, query) {
|
|
82
|
-
if (!validId(countryId)) {
|
|
83
|
-
console.warn(`${API_LOG_PREFIX}: getRegions called without valid country_id`);
|
|
84
|
-
return [];
|
|
85
|
-
}
|
|
86
|
-
const cacheKey = !query?.trim() ? `regions_${countryId}` : null;
|
|
87
|
-
if (cacheKey) {
|
|
88
|
-
const cached = getCached(cacheKey);
|
|
89
|
-
if (cached)
|
|
90
|
-
return cached;
|
|
91
|
-
}
|
|
92
|
-
const result = await withApiErrorHandling(async () => {
|
|
93
|
-
const params = {};
|
|
94
|
-
if (query?.trim())
|
|
95
|
-
params.query = query.trim();
|
|
96
|
-
const data = (await salla.api.request(`shipping/countries/${countryId}/regions`, { params }))?.data ?? [];
|
|
97
|
-
return data.map((r) => ({ id: r.id, name: r.name, code: r.code, country_id: Number(countryId) }));
|
|
98
|
-
}, [], 'Error fetching regions');
|
|
99
|
-
if (cacheKey && result.length > 0)
|
|
100
|
-
setCache(cacheKey, result);
|
|
101
|
-
return result;
|
|
102
|
-
},
|
|
103
|
-
/**
|
|
104
|
-
* Get cities from Salla shipping API
|
|
105
|
-
* @param regionId - Optional; when provided (e.g. for SA), cities are filtered by region
|
|
106
|
-
*/
|
|
107
|
-
async getCities(countryId, regionId, query) {
|
|
108
|
-
if (!validId(countryId)) {
|
|
109
|
-
console.warn(`${API_LOG_PREFIX}: getCities called without valid country_id`);
|
|
110
|
-
return [];
|
|
111
|
-
}
|
|
112
|
-
const cacheKey = !query?.trim() ? `cities_${countryId}_${regionId || 'all'}` : null;
|
|
113
|
-
if (cacheKey) {
|
|
114
|
-
const cached = getCached(cacheKey);
|
|
115
|
-
if (cached)
|
|
116
|
-
return cached;
|
|
117
|
-
}
|
|
118
|
-
const result = await withApiErrorHandling(async () => {
|
|
119
|
-
const params = { for_branch: 0, country_id: countryId };
|
|
120
|
-
if (regionId)
|
|
121
|
-
params.region_id = regionId;
|
|
122
|
-
if (query?.trim())
|
|
123
|
-
params.query = query.trim();
|
|
124
|
-
const data = (await salla.api.request("shipping/cities", { params }))?.data ?? [];
|
|
125
|
-
return data.map((c) => ({ id: c.id, name: c.name, country_id: countryId, ...(c.region_id != null && { region_id: c.region_id }) }));
|
|
126
|
-
}, [], 'Error fetching cities');
|
|
127
|
-
if (cacheKey && result.length > 0)
|
|
128
|
-
setCache(cacheKey, result);
|
|
129
|
-
return result;
|
|
130
|
-
},
|
|
131
|
-
/**
|
|
132
|
-
* Get districts from Salla shipping API
|
|
133
|
-
*/
|
|
134
|
-
async getDistricts(cityId, query) {
|
|
135
|
-
if (!validId(cityId)) {
|
|
136
|
-
console.warn(`${API_LOG_PREFIX}: getDistricts called without valid city_id`);
|
|
137
|
-
return [];
|
|
138
|
-
}
|
|
139
|
-
return withApiErrorHandling(async () => {
|
|
140
|
-
const params = { for_branch: 0, city_id: cityId };
|
|
141
|
-
if (query?.trim())
|
|
142
|
-
params.query = query.trim();
|
|
143
|
-
const raw = (await salla.api.request("shipping/districts", { params }))?.data;
|
|
144
|
-
const list = Array.isArray(raw) ? raw : (Array.isArray(raw?.districts) ? raw.districts : []);
|
|
145
|
-
return list.map((d) => ({ id: d.id, name: d.name, name_en: d.name_en, city_id: cityId }));
|
|
146
|
-
}, [], 'Error fetching districts');
|
|
147
|
-
},
|
|
148
|
-
async getSavedAddresses() {
|
|
149
|
-
return withApiErrorHandling(async () => {
|
|
150
|
-
const data = (await salla.api.request("address"))?.data;
|
|
151
|
-
return Array.isArray(data) ? data : [];
|
|
152
|
-
}, [], 'Error fetching user addresses');
|
|
153
|
-
},
|
|
154
|
-
async getBranches({ query, lat, lng, country_id, per_page = 20 } = {}) {
|
|
155
|
-
const hasSearchParams = query?.trim()?.length >= 2 || lat || lng;
|
|
156
|
-
const cacheKey = !hasSearchParams && country_id ? `branches_${country_id}` : null;
|
|
157
|
-
if (cacheKey) {
|
|
158
|
-
const cached = getCached(cacheKey);
|
|
159
|
-
if (cached)
|
|
160
|
-
return cached;
|
|
161
|
-
}
|
|
162
|
-
const result = await withApiErrorHandling(async () => {
|
|
163
|
-
const params = { per_page };
|
|
164
|
-
if (query?.trim().length >= 2)
|
|
165
|
-
params.query = query;
|
|
166
|
-
if (lat)
|
|
167
|
-
params.lat = lat;
|
|
168
|
-
if (lng)
|
|
169
|
-
params.lng = lng;
|
|
170
|
-
if (country_id)
|
|
171
|
-
params.country_id = country_id;
|
|
172
|
-
const res = await salla.api.request("branches", { params });
|
|
173
|
-
return (Array.isArray(res?.data) ? res.data : []);
|
|
174
|
-
}, [], 'Error fetching branches');
|
|
175
|
-
if (cacheKey && result.length > 0)
|
|
176
|
-
setCache(cacheKey, result);
|
|
177
|
-
return result;
|
|
178
|
-
},
|
|
179
|
-
async saveAddressLocation(payload) {
|
|
180
|
-
return withApiErrorHandling(async () => {
|
|
181
|
-
const res = await salla.api.request('address/location', { ...payload, for_allocation: true }, 'post');
|
|
182
|
-
const data = res?.data ?? res;
|
|
183
|
-
const address = typeof data === 'object' && data != null && 'id' in data ? data : undefined;
|
|
184
|
-
return { success: true, address };
|
|
185
|
-
}, { success: false }, 'Error saving address/location');
|
|
186
|
-
},
|
|
187
|
-
async setDeliveryScope(scopeId) {
|
|
188
|
-
return withApiErrorHandling(async () => {
|
|
189
|
-
await salla.api.withoutNotifier(() => salla.scope.change({ id: scopeId }));
|
|
190
|
-
salla.storage.set("scope", { ...(salla.storage.get("scope") || {}), id: scopeId });
|
|
191
|
-
return true;
|
|
192
|
-
}, false, 'Error setting delivery scope');
|
|
193
|
-
},
|
|
194
|
-
async allocateScope(payload) {
|
|
195
|
-
const errMsg = (d) => d?.error?.message ?? d?.message ?? 'Failed to allocate scope';
|
|
196
|
-
try {
|
|
197
|
-
const response = await salla.api.withoutNotifier(() => salla.api.request("scopes/allocation", payload, 'post'));
|
|
198
|
-
// SDK resolves with { data } and throws on non-2xx; any resolved value is success
|
|
199
|
-
const data = response?.data ?? response;
|
|
200
|
-
return { success: true, data: data };
|
|
201
|
-
}
|
|
202
|
-
catch (error) {
|
|
203
|
-
console.error(`${API_LOG_PREFIX}: Error allocating scope`, error);
|
|
204
|
-
const err = error;
|
|
205
|
-
return { success: false, error: err?.response?.data != null ? errMsg(err.response.data) : (err?.message ?? 'Unknown error') };
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
async getAddressToken() {
|
|
209
|
-
return withApiErrorHandling(async () => {
|
|
210
|
-
const res = await salla.api.request('address/autocomplete-token');
|
|
211
|
-
return res?.data?.token ?? null;
|
|
212
|
-
}, null, 'Error fetching address autocomplete token');
|
|
213
|
-
},
|
|
214
|
-
};
|
|
215
|
-
function clearApiCache() {
|
|
216
|
-
apiCache.clear();
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* Helper functions for salla-bullet-delivery component
|
|
221
|
-
*/
|
|
222
|
-
const EARTH_RADIUS_KM = 6371;
|
|
223
|
-
const deg2rad = (deg) => deg * (Math.PI / 180);
|
|
224
|
-
/** Haversine distance in km */
|
|
225
|
-
function calculateDistance(lat1, lon1, lat2, lon2) {
|
|
226
|
-
const dLat = deg2rad(lat2 - lat1);
|
|
227
|
-
const dLon = deg2rad(lon2 - lon1);
|
|
228
|
-
const a = Math.sin(dLat / 2) ** 2 +
|
|
229
|
-
Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.sin(dLon / 2) ** 2;
|
|
230
|
-
return EARTH_RADIUS_KM * 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Whether a pickup branch can be selected.
|
|
234
|
-
*
|
|
235
|
-
* `pickup_readiness` is the richer, backend-computed verdict (INV-357) and wins whenever the API
|
|
236
|
-
* sends it. Not every store's `GET /branches` returns it though, so we fall back to the original
|
|
237
|
-
* `is_open` rule instead of treating a missing object as "not selectable" — otherwise every branch
|
|
238
|
-
* in the list renders disabled and pickup cannot be chosen at all (SP-22202).
|
|
239
|
-
*/
|
|
240
|
-
const isBranchSelectable = (branch) => {
|
|
241
|
-
if (!branch)
|
|
242
|
-
return false;
|
|
243
|
-
const selectable = branch.pickup_readiness?.selectable;
|
|
244
|
-
return typeof selectable === 'boolean' ? selectable : branch.is_open !== false;
|
|
245
|
-
};
|
|
246
|
-
/** Nearest available branch by distance; single pass O(n). */
|
|
247
|
-
function findNearestBranch(branches, userLat, userLon) {
|
|
248
|
-
let nearest = null;
|
|
249
|
-
let minD = Number.POSITIVE_INFINITY;
|
|
250
|
-
for (const b of branches) {
|
|
251
|
-
const lat = b.location?.lat != null ? Number(b.location.lat) : Number.NaN;
|
|
252
|
-
const lng = b.location?.lng != null ? Number(b.location.lng) : Number.NaN;
|
|
253
|
-
if (Number.isNaN(lat) || Number.isNaN(lng) || b.is_open === false)
|
|
254
|
-
continue;
|
|
255
|
-
const d = calculateDistance(userLat, userLon, lat, lng);
|
|
256
|
-
if (d < minD) {
|
|
257
|
-
minD = d;
|
|
258
|
-
nearest = b;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
return nearest;
|
|
262
|
-
}
|
|
263
|
-
const filterBranches = (branches, searchQuery) => {
|
|
264
|
-
if (!searchQuery)
|
|
265
|
-
return branches;
|
|
266
|
-
const q = searchQuery.toLowerCase();
|
|
267
|
-
return branches.filter((b) => b.name.toLowerCase().includes(q) || b.city?.name?.toLowerCase().includes(q));
|
|
268
|
-
};
|
|
269
|
-
const getIntentSubtitle = (intent, toAddress, fromBranch) => {
|
|
270
|
-
if (intent.type === 'branch') {
|
|
271
|
-
const loc = intent.branch_details?.city ?? intent.branch_details?.name;
|
|
272
|
-
return loc ? `${fromBranch} ${loc}`.trim() : '';
|
|
273
|
-
}
|
|
274
|
-
if (intent.type === 'address' && intent.address_details) {
|
|
275
|
-
const addr = [intent.address_details.district?.name, intent.address_details.city?.name, intent.address_details.country?.name].filter(Boolean).join('، ') || intent.address_details.short_address || '';
|
|
276
|
-
return addr ? `${toAddress} ${addr}`.trim() : '';
|
|
277
|
-
}
|
|
278
|
-
return '';
|
|
279
|
-
};
|
|
280
|
-
const idFrom = (val) => (val != null ? Number(val) : undefined);
|
|
281
|
-
const getIntentCountryId = (i) => idFrom(i?.address_details?.country?.id);
|
|
282
|
-
const getIntentCountryCode = (i) => i?.country_code ?? i?.address_details?.country?.code ?? '';
|
|
283
|
-
const getIntentRegionId = (i) => idFrom(i?.address_details?.region?.id);
|
|
284
|
-
const getIntentCityId = (i) => idFrom(i?.address_details?.city?.id);
|
|
285
|
-
const getIntentDistrictId = (i) => idFrom(i?.address_details?.district?.id);
|
|
286
|
-
const getIntentBranchId = (i) => i?.branch_details?.id;
|
|
287
|
-
/** Intent coordinates (branch tab only; address flow no longer uses coordinates). */
|
|
288
|
-
const getIntentLatitude = (i) => i?.branch_details?.latitude;
|
|
289
|
-
const getIntentLongitude = (i) => i?.branch_details?.longitude;
|
|
290
|
-
const hasSessionAddressIntent = (intent) => {
|
|
291
|
-
if (!intent || intent.type !== 'address' || intent.address_id)
|
|
292
|
-
return false;
|
|
293
|
-
const c = getIntentCountryId(intent);
|
|
294
|
-
const city = getIntentCityId(intent);
|
|
295
|
-
const d = getIntentDistrictId(intent);
|
|
296
|
-
const code = getIntentCountryCode(intent);
|
|
297
|
-
const hasDistrictId = d != null && Number(d) !== 0;
|
|
298
|
-
const hasDistrictName = Boolean(intent.address_details?.district?.name?.trim());
|
|
299
|
-
const districtOk = !isSaudiArabia(code) || hasDistrictId || hasDistrictName;
|
|
300
|
-
return !!(c && city && districtOk);
|
|
301
|
-
};
|
|
302
|
-
const requireRegionAndDistrictForSA = (countryCode, regionId, districtIdOrName) => !countryCode || !isSaudiArabia(countryCode)
|
|
303
|
-
? true
|
|
304
|
-
: (regionId != null && Number(regionId) !== 0) && (districtIdOrName != null && (typeof districtIdOrName === 'number' ? districtIdOrName !== 0 : String(districtIdOrName).trim().length > 0));
|
|
305
|
-
function buildAddressLocationPayloadFromSelection(options) {
|
|
306
|
-
const { countryId, countryCode, regionId, cityId, districtId, description = '', lat, lng, shortAddress } = options;
|
|
307
|
-
const desc = description || '';
|
|
308
|
-
return {
|
|
309
|
-
country_id: Number(countryId) || undefined,
|
|
310
|
-
region_id: regionId != null ? Number(regionId) : undefined,
|
|
311
|
-
city_id: cityId != null ? Number(cityId) : undefined,
|
|
312
|
-
district_id: districtId != null ? Number(districtId) : undefined,
|
|
313
|
-
description: desc,
|
|
314
|
-
...(countryCode && isSaudiArabia(countryCode) && { local: desc }),
|
|
315
|
-
...(lat != null && lng != null && { lat, lng }),
|
|
316
|
-
...(shortAddress && { short_address: shortAddress }),
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
const GEO_ERROR_MESSAGES = {
|
|
320
|
-
[GeolocationPositionError.PERMISSION_DENIED]: 'Location permission denied',
|
|
321
|
-
[GeolocationPositionError.POSITION_UNAVAILABLE]: 'Location unavailable',
|
|
322
|
-
[GeolocationPositionError.TIMEOUT]: 'Location timeout',
|
|
323
|
-
};
|
|
324
|
-
const getGeolocationErrorMessage = (errorCode) => GEO_ERROR_MESSAGES[errorCode] ?? 'An error occurred while detecting location';
|
|
325
|
-
|
|
326
15
|
/**
|
|
327
16
|
* @license
|
|
328
17
|
* Copyright 2019 Google LLC
|
|
@@ -5816,6 +5505,9 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
5816
5505
|
? `${address.district.name}، ${address.city.name}`
|
|
5817
5506
|
: (address.city?.name ?? "");
|
|
5818
5507
|
}
|
|
5508
|
+
else if (this.isGuestMapPick) {
|
|
5509
|
+
locationText = result.address_details?.formatted_address ?? "";
|
|
5510
|
+
}
|
|
5819
5511
|
else if (this.selectedCity) {
|
|
5820
5512
|
locationText = this.selectedDistrict
|
|
5821
5513
|
? `${this.selectedDistrict.name}، ${this.selectedCity.name}`
|
|
@@ -5824,11 +5516,14 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
5824
5516
|
else if (result.address_details) {
|
|
5825
5517
|
const parts = [
|
|
5826
5518
|
result.address_details.district?.name,
|
|
5827
|
-
result.address_details.city
|
|
5828
|
-
result.address_details.country
|
|
5519
|
+
result.address_details.city?.name,
|
|
5520
|
+
result.address_details.country?.name,
|
|
5829
5521
|
].filter(Boolean);
|
|
5830
5522
|
locationText =
|
|
5831
|
-
parts.join("، ") ||
|
|
5523
|
+
parts.join("، ") ||
|
|
5524
|
+
result.address_details.formatted_address ||
|
|
5525
|
+
result.address_details.short_address ||
|
|
5526
|
+
"";
|
|
5832
5527
|
}
|
|
5833
5528
|
}
|
|
5834
5529
|
else if (branch) {
|
|
@@ -6104,6 +5799,10 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
6104
5799
|
get isMapModeAvailable() {
|
|
6105
5800
|
return this.isMapSettingEnabled && !!salla.config.get('store.settings.keys.maps') && !!this.addressToken;
|
|
6106
5801
|
}
|
|
5802
|
+
/** Guest is in map mode and has already dropped a pin (as opposed to still using the dropdowns). */
|
|
5803
|
+
get isGuestMapPick() {
|
|
5804
|
+
return !this.isLoggedIn && this.isMapModeAvailable && this.hasMapLocation();
|
|
5805
|
+
}
|
|
6107
5806
|
/** Center shown before geolocation resolves — the customer's IP-based default (falls back to Riyadh). */
|
|
6108
5807
|
get mapInitialCenter() {
|
|
6109
5808
|
const geo = salla.config.get('user.default_geo_location');
|
|
@@ -6244,6 +5943,10 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
6244
5943
|
if (this.isLoggedIn && this.selectedSavedAddress) {
|
|
6245
5944
|
return this.selectedSavedAddress.is_in_coverage === false;
|
|
6246
5945
|
}
|
|
5946
|
+
// Guest map pick: a pin is the only requirement, independent of any incidental dropdown state.
|
|
5947
|
+
if (!this.isLoggedIn && this.isMapModeAvailable) {
|
|
5948
|
+
return !this.isGuestMapPick;
|
|
5949
|
+
}
|
|
6247
5950
|
// Guest: require country + city; for SA require region + district
|
|
6248
5951
|
if (!this.selectedCountry || !this.selectedCity)
|
|
6249
5952
|
return true;
|
|
@@ -6269,9 +5972,26 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
6269
5972
|
resolve();
|
|
6270
5973
|
}
|
|
6271
5974
|
buildIntentAddress() {
|
|
6272
|
-
if (this.activeTab !== "address"
|
|
6273
|
-
|
|
6274
|
-
|
|
5975
|
+
if (this.activeTab !== "address")
|
|
5976
|
+
return undefined;
|
|
5977
|
+
if (this.isGuestMapPick && this.mapLocationData) {
|
|
5978
|
+
const { lat, lng, formattedAddress, shortAddress } = this.mapLocationData;
|
|
5979
|
+
return {
|
|
5980
|
+
country: this.selectedCountry
|
|
5981
|
+
? {
|
|
5982
|
+
id: this.selectedCountry.id,
|
|
5983
|
+
name: this.selectedCountry.name,
|
|
5984
|
+
code: this.selectedCountry.code,
|
|
5985
|
+
}
|
|
5986
|
+
: undefined,
|
|
5987
|
+
lat,
|
|
5988
|
+
lng,
|
|
5989
|
+
formatted_address: formattedAddress,
|
|
5990
|
+
place_id: shortAddress,
|
|
5991
|
+
description: this.addressDescription?.trim() || undefined,
|
|
5992
|
+
};
|
|
5993
|
+
}
|
|
5994
|
+
if (!this.selectedCountry || !this.selectedCity) {
|
|
6275
5995
|
return undefined;
|
|
6276
5996
|
}
|
|
6277
5997
|
const country = {
|
|
@@ -6350,6 +6070,9 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
6350
6070
|
district_name: this.districtName?.trim() || undefined,
|
|
6351
6071
|
short_address: selectedAddress?.short_address ?? this.selectedSavedAddress?.short_address,
|
|
6352
6072
|
form_data: { ...this.newAddressForm },
|
|
6073
|
+
lat: this.mapLocationData?.lat,
|
|
6074
|
+
lng: this.mapLocationData?.lng,
|
|
6075
|
+
formatted_address: this.mapLocationData?.formattedAddress,
|
|
6353
6076
|
};
|
|
6354
6077
|
}
|
|
6355
6078
|
/**
|
|
@@ -6557,6 +6280,13 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
6557
6280
|
}
|
|
6558
6281
|
else {
|
|
6559
6282
|
result.address_details = this.buildIntentAddress();
|
|
6283
|
+
if (this.isGuestMapPick) {
|
|
6284
|
+
// Guest + map pin: defer to login instead of the blocked guest allocation (422, SHPD-9558).
|
|
6285
|
+
this.setStoredIntent(result);
|
|
6286
|
+
this.confirmBtn?.stop();
|
|
6287
|
+
this.handleLogin();
|
|
6288
|
+
return;
|
|
6289
|
+
}
|
|
6560
6290
|
}
|
|
6561
6291
|
}
|
|
6562
6292
|
else {
|
|
@@ -6575,7 +6305,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
6575
6305
|
};
|
|
6576
6306
|
}
|
|
6577
6307
|
else {
|
|
6578
|
-
// Case 1: Guest user or logged-in user without saved address
|
|
6308
|
+
// Case 1: Guest user (dropdown selection) or logged-in user without saved address
|
|
6579
6309
|
allocationPayload = {
|
|
6580
6310
|
type: "address",
|
|
6581
6311
|
country_id: String(this.selectedCountry?.id || 0),
|
|
@@ -6812,6 +6542,28 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
6812
6542
|
*/
|
|
6813
6543
|
async saveSessionAddressToProfile() {
|
|
6814
6544
|
const intent = this.getStoredIntent();
|
|
6545
|
+
if (isMapOriginIntent(intent)) {
|
|
6546
|
+
const details = intent.address_details;
|
|
6547
|
+
const payload = {
|
|
6548
|
+
lat: details.lat,
|
|
6549
|
+
lng: details.lng,
|
|
6550
|
+
...(details.place_id && { short_address: details.place_id }),
|
|
6551
|
+
...(details.description && { description: details.description }),
|
|
6552
|
+
};
|
|
6553
|
+
try {
|
|
6554
|
+
const { success, address } = await bulletDeliveryAPI.saveAddressLocation(payload);
|
|
6555
|
+
if (!success || !address)
|
|
6556
|
+
return null;
|
|
6557
|
+
// Persist address_id immediately to avoid duplicate creation on retry.
|
|
6558
|
+
this.setStoredIntent({ ...intent, address_id: address.id });
|
|
6559
|
+
this.addressCreated.emit({ address });
|
|
6560
|
+
return address;
|
|
6561
|
+
}
|
|
6562
|
+
catch (error) {
|
|
6563
|
+
console.error("SallaBulletDelivery: Error saving session address (map)", error);
|
|
6564
|
+
return null;
|
|
6565
|
+
}
|
|
6566
|
+
}
|
|
6815
6567
|
const countryId = getIntentCountryId(intent);
|
|
6816
6568
|
const cityId = getIntentCityId(intent);
|
|
6817
6569
|
const districtId = getIntentDistrictId(intent);
|
|
@@ -6855,12 +6607,15 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
6855
6607
|
}
|
|
6856
6608
|
const intent = this.getStoredIntent();
|
|
6857
6609
|
const hasSessionAddress = hasSessionAddressIntent(intent);
|
|
6610
|
+
const isMapSession = isMapOriginIntent(intent);
|
|
6858
6611
|
const sessionLine1 = hasSessionAddress && intent?.address_details
|
|
6859
|
-
?
|
|
6860
|
-
.
|
|
6861
|
-
.
|
|
6612
|
+
? isMapSession
|
|
6613
|
+
? (intent.address_details.formatted_address ?? "")
|
|
6614
|
+
: [intent.address_details.city?.name, intent.address_details.country?.name]
|
|
6615
|
+
.filter(Boolean)
|
|
6616
|
+
.join("، ") || ""
|
|
6862
6617
|
: "";
|
|
6863
|
-
const sessionLine2 = hasSessionAddress && intent?.address_details
|
|
6618
|
+
const sessionLine2 = hasSessionAddress && intent?.address_details && !isMapSession
|
|
6864
6619
|
? (intent.address_details.district?.name ?? "").trim()
|
|
6865
6620
|
: "";
|
|
6866
6621
|
if (this.savedAddresses.length === 0 && !hasSessionAddress) {
|
|
@@ -6956,7 +6711,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
6956
6711
|
const isConfirmStep = this.mapStep === 'confirm' && hasMapLoc;
|
|
6957
6712
|
const canAdvanceToConfirm = this.canConfirmMapLocation();
|
|
6958
6713
|
const submitLabel = isConfirmStep
|
|
6959
|
-
? (this.
|
|
6714
|
+
? (this.confirming
|
|
6960
6715
|
? Salla.lang.get("pages.checkout.loading")
|
|
6961
6716
|
: Salla.lang.get("pages.checkout.confirm_address"))
|
|
6962
6717
|
: Salla.lang.get('pages.checkout.confirm_location');
|
|
@@ -6966,9 +6721,9 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
6966
6721
|
this.mapStep = 'confirm';
|
|
6967
6722
|
return;
|
|
6968
6723
|
}
|
|
6969
|
-
this.
|
|
6724
|
+
this.handleConfirm();
|
|
6970
6725
|
};
|
|
6971
|
-
return (h$4("form", { onSubmit: handleSubmit }, this.renderGuestDeliveryForm(), h$4("div", { class: "s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single", style: { padding: '24px' } }, h$4("salla-button", { type: "submit", loading: this.
|
|
6726
|
+
return (h$4("form", { onSubmit: handleSubmit }, this.renderGuestDeliveryForm(), h$4("div", { class: "s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single", style: { padding: '24px' } }, h$4("salla-button", { type: "submit", loading: this.confirming, disabled: isConfirmStep ? this.confirming : !canAdvanceToConfirm, width: "wide" }, submitLabel), !this.isLoggedIn && (h$4("button", { type: "button", class: "s-bullet-delivery-login-prompt", onClick: () => this.handleLogin() }, Salla.lang.get('pages.checkout.login_to_use_saved_addresses'))))));
|
|
6972
6727
|
}
|
|
6973
6728
|
renderBranchSearch() {
|
|
6974
6729
|
return (h$4("div", { class: "s-bullet-delivery-branch-search" }, h$4("div", { class: "s-bullet-delivery-search-row" }, h$4("div", { class: "s-bullet-delivery-search s-bullet-delivery-branch-search-wrap" }, h$4("span", { class: "s-bullet-delivery-search-icon s-bullet-delivery-branch-search-icon", innerHTML: Search, "aria-hidden": "true" }), h$4("input", { type: "text", class: "s-bullet-delivery-branch-search-input form-input", placeholder: Salla.lang.get("pages.checkout.search_for_city_or_branch"), value: this.branchSearchQuery, onInput: (e) => this.handleBranchSearch(e), autocomplete: "off" })), h$4("button", { type: "button", class: {
|
|
@@ -7063,7 +6818,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
7063
6818
|
this.confirmBtn = btn;
|
|
7064
6819
|
}, disabled: this.isConfirmDisabled(), onClick: () => this.handleConfirm(), "loader-position": "center", width: "wide" }, this.activeTab === "branch"
|
|
7065
6820
|
? Salla.lang.get("pages.checkout.confirm_receipt_from_the_branch")
|
|
7066
|
-
: Salla.lang.get("pages.checkout.confirm_address")), showAddAddressInFooter && (h$4("salla-button", { onClick: () => this.handleAddNewAddress(), width: "wide", shape: "link" }, Salla.lang.get("pages.checkout.add_new_address"))), !this.isLoggedIn && (h$4("salla-button", { shape: "link", onClick: this.handleLogin }, Salla.lang.get("pages.checkout.login_to_use_saved_addresses")))));
|
|
6821
|
+
: Salla.lang.get("pages.checkout.confirm_address")), showAddAddressInFooter && (h$4("salla-button", { onClick: () => this.handleAddNewAddress(), width: "wide", shape: "link" }, Salla.lang.get("pages.checkout.add_new_address"))), !this.isLoggedIn && (h$4("salla-button", { shape: "link", onClick: () => this.handleLogin() }, Salla.lang.get("pages.checkout.login_to_use_saved_addresses")))));
|
|
7067
6822
|
}
|
|
7068
6823
|
renderMainView() {
|
|
7069
6824
|
const isAddressEmptyState = this.isLoggedIn &&
|
|
@@ -188,7 +188,7 @@ const SallaCommentItem = /*@__PURE__*/ proxyCustomElement(class SallaCommentItem
|
|
|
188
188
|
: null, (this.comment.has_order || !!this.comment.rating) && !this.comment.is_pending && !this.hideBought ?
|
|
189
189
|
h("div", { class: "s-comments-flex" }, this.comment.has_order ?
|
|
190
190
|
[h("span", { class: "s-comments-item-has-order-check-icon", innerHTML: IconVerified }), h("span", { class: "s-comments-item-has-order-check-text" }, this.has_bought_trans, " ", this.comment.rating ? ', ' : '')] : null, !!this.comment.rating ?
|
|
191
|
-
h("span", { class: "s-comments-item-
|
|
191
|
+
h("span", { class: "s-comments-item-rated-widget" }, this.rated_trans) : null)
|
|
192
192
|
: null), h("p", { class: "s-comments-item-timestamp s-ltr" }, this.getDate(this.comment.created_at?.date), h("span", { class: "s-comments-item-time" }, " - ", this.getTime(this.comment.created_at?.date)))), (!!this.comment.rating || !!this.comment.stars || hasReviewFactors) && (h("div", { class: "flex flex-row gap-4 mt-2 mb-4" }, (!!this.comment.rating || !!this.comment.stars) ? (h("salla-rating-stars", { class: "w-auto", size: "medium", value: this.comment.rating || this.comment.stars })) : null, hasReviewFactors && (h("button", { class: "s-comments-item-review-factors-toggle", type: "button", onClick: () => (this.showReviewFactors = !this.showReviewFactors) }, h("span", null, this.reviewDetailsLabel), h("span", { class: {
|
|
193
193
|
"s-comments-item-review-factors-chevron": true,
|
|
194
194
|
"is-open": this.showReviewFactors,
|
|
@@ -25,18 +25,6 @@ var CommentType;
|
|
|
25
25
|
CommentType["PRODUCT"] = "product";
|
|
26
26
|
CommentType["BLOG"] = "blog";
|
|
27
27
|
})(CommentType || (CommentType = {}));
|
|
28
|
-
function isFeatureEnabled(feature) {
|
|
29
|
-
return !!salla.config.get('store.features')?.includes(feature);
|
|
30
|
-
}
|
|
31
|
-
function buildCommentSortOptions({ mostHelpfulLabel, verifiedPurchasesLabel, allowLikes, allowVerifiedPurchasesFilter, }) {
|
|
32
|
-
const options = [
|
|
33
|
-
{ value: 'latest', label: salla.lang.get('pages.testimonials.sort_by_date_desc'), selected: true },
|
|
34
|
-
{ value: 'oldest', label: salla.lang.get('pages.testimonials.sort_by_date_asc') },
|
|
35
|
-
{ value: 'most_helpful', label: mostHelpfulLabel, show: allowLikes },
|
|
36
|
-
{ value: 'verified_purchases', label: verifiedPurchasesLabel, show: allowVerifiedPurchasesFilter },
|
|
37
|
-
];
|
|
38
|
-
return options.filter(option => option.show !== false);
|
|
39
|
-
}
|
|
40
28
|
|
|
41
29
|
var ChatBubbles = `<!-- Generated by IcoMoon.io -->
|
|
42
30
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
@@ -76,7 +64,6 @@ const SallaComments$1 = /*@__PURE__*/ proxyCustomElement(class SallaComments ext
|
|
|
76
64
|
this.comment_name = salla.lang.get('blocks.comments.comment');
|
|
77
65
|
this.showRatingSummary = salla.config.get('store.settings.rating.show_rating_summary');
|
|
78
66
|
this.allowLikes = salla.config.get('store.settings.rating.allow_likes');
|
|
79
|
-
this.allowVerifiedPurchasesFilter = isFeatureEnabled('allow-reviews-from-product-page');
|
|
80
67
|
salla.onReady(() => {
|
|
81
68
|
this.allowLikes = salla.config.get('store.settings.rating.allow_likes');
|
|
82
69
|
this.showRatingSummary = salla.config.get('store.settings.rating.show_rating_summary');
|
|
@@ -97,10 +84,7 @@ const SallaComments$1 = /*@__PURE__*/ proxyCustomElement(class SallaComments ext
|
|
|
97
84
|
const setTranslations = async () => {
|
|
98
85
|
await setNestedAsync('ar.trans', 'blocks.comments.most_helpful', 'الأكثر إفادة');
|
|
99
86
|
await setNestedAsync('en.trans', 'blocks.comments.most_helpful', 'Most helpful');
|
|
100
|
-
await setNestedAsync('ar.trans', 'blocks.comments.verified_purchases', 'عمليات شراء موثقة');
|
|
101
|
-
await setNestedAsync('en.trans', 'blocks.comments.verified_purchases', 'Verified purchases');
|
|
102
87
|
this.mostHelpfulLabel = salla.lang.get('blocks.comments.most_helpful');
|
|
103
|
-
this.verifiedPurchasesLabel = salla.lang.get('blocks.comments.verified_purchases');
|
|
104
88
|
this.comment_title = salla.lang.get('blocks.comments.overall_rating');
|
|
105
89
|
this.comment_name = salla.lang.get('blocks.comments.comment');
|
|
106
90
|
this.noComments = salla.lang.get('pages.rating.no_ratings');
|
|
@@ -108,14 +92,6 @@ const SallaComments$1 = /*@__PURE__*/ proxyCustomElement(class SallaComments ext
|
|
|
108
92
|
setTranslations();
|
|
109
93
|
});
|
|
110
94
|
}
|
|
111
|
-
get sortOptions() {
|
|
112
|
-
return buildCommentSortOptions({
|
|
113
|
-
mostHelpfulLabel: this.mostHelpfulLabel,
|
|
114
|
-
verifiedPurchasesLabel: this.verifiedPurchasesLabel,
|
|
115
|
-
allowLikes: this.allowLikes,
|
|
116
|
-
allowVerifiedPurchasesFilter: this.allowVerifiedPurchasesFilter,
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
95
|
// TOOD: it's a good idea to move this into lang.js
|
|
120
96
|
// Pluralize a string based on the count
|
|
121
97
|
pluralize(phrases, count) {
|
|
@@ -316,19 +292,6 @@ const SallaComments$1 = /*@__PURE__*/ proxyCustomElement(class SallaComments ext
|
|
|
316
292
|
}
|
|
317
293
|
if (!resp.data || !resp.data.length) {
|
|
318
294
|
this.showPlaceholder = false;
|
|
319
|
-
this.comments = [];
|
|
320
|
-
this.nextPage = '';
|
|
321
|
-
// The wrapper is populated imperatively (see the success branch and
|
|
322
|
-
// onCommentAdded below), so swap its content directly instead of
|
|
323
|
-
// toggling showPlaceholder: that would tear down the header/sort
|
|
324
|
-
// filter too, losing the ability to switch sort back.
|
|
325
|
-
if (this.wrapper) {
|
|
326
|
-
this.wrapper.innerHTML = '';
|
|
327
|
-
const empty = document.createElement('div');
|
|
328
|
-
empty.className = 's-comments-placeholder';
|
|
329
|
-
empty.innerHTML = `<span>${ChatBubbles}</span><p>${this.noComments}</p>`;
|
|
330
|
-
this.wrapper.append(empty);
|
|
331
|
-
}
|
|
332
295
|
this.loading(false);
|
|
333
296
|
return;
|
|
334
297
|
}
|
|
@@ -368,7 +331,7 @@ const SallaComments$1 = /*@__PURE__*/ proxyCustomElement(class SallaComments ext
|
|
|
368
331
|
h("div", { class: "s-comments-filter-wrapper" }, h("label", { class: "s-comments-filter-label", htmlFor: "comments-filter" }, salla.lang.get('pages.categories.sorting')), h("select", { id: "comments-filter", "aria-label": salla.lang.get('pages.categories.sorting'), class: "s-form-control s-comments-sort-input", onChange: (e) => {
|
|
369
332
|
this.sort = e.target.value;
|
|
370
333
|
this.reload();
|
|
371
|
-
} },
|
|
334
|
+
} }, h("option", { value: "latest", selected: true }, salla.lang.get("pages.testimonials.sort_by_date_desc")), h("option", { value: "oldest" }, salla.lang.get("pages.testimonials.sort_by_date_asc")), this.allowLikes && h("option", { value: "most_helpful" }, this.mostHelpfulLabel)))
|
|
372
335
|
: ''), h("div", { ref: wrapper => {
|
|
373
336
|
this.wrapper = wrapper;
|
|
374
337
|
} }), this.nextPage && (h("div", { class: "s-infinite-scroll-wrapper", ref: status => {
|
|
@@ -396,14 +359,12 @@ const SallaComments$1 = /*@__PURE__*/ proxyCustomElement(class SallaComments ext
|
|
|
396
359
|
"showPlaceholder": [32],
|
|
397
360
|
"nextPage": [32],
|
|
398
361
|
"mostHelpfulLabel": [32],
|
|
399
|
-
"verifiedPurchasesLabel": [32],
|
|
400
362
|
"noComments": [32],
|
|
401
363
|
"comment_title": [32],
|
|
402
364
|
"comment_name": [32],
|
|
403
365
|
"placeholder_text": [32],
|
|
404
366
|
"showRatingSummary": [32],
|
|
405
367
|
"allowLikes": [32],
|
|
406
|
-
"allowVerifiedPurchasesFilter": [32],
|
|
407
368
|
"reload": [64]
|
|
408
369
|
}, [[0, "commentAdded", "onCommentAdded"]]]);
|
|
409
370
|
function defineCustomElement$1() {
|