@salla.sa/twilight-components 2.14.385 → 2.14.387
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-CH0EhqTR.js → filepond-DY8Bk_1p.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-DB_nSU5H.js → filepond-plugin-file-poster-DRBpp2WC.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-DhmLgwAd.js → filepond-plugin-file-validate-size-Ps1G9vOF.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-BP6pXR9l.js → filepond-plugin-file-validate-type-fVUTClJE.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-H28z0oor.js → filepond-plugin-image-edit-Bh4Pqw-q.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-B3aPmsvW.js → filepond-plugin-image-exif-orientation-D_Tfa9YD.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-2UoG7SNa.js → filepond-plugin-image-preview-Bsg4ZULY.js} +1 -1
- package/dist/cjs/{index-C0Kew27I.js → index-B99uI20k.js} +6 -2
- package/dist/cjs/{index-0Q56lC1x.js → index-DjO53bco.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_3.cjs.entry.js +4 -4
- package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
- package/dist/cjs/salla-add-product-button_4.cjs.entry.js +3 -3
- 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-booking-field_7.cjs.entry.js +17 -17
- package/dist/cjs/salla-bullet-delivery.cjs.entry.js +248 -188
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +251 -0
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +8 -8
- 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_2.cjs.entry.js +7 -7
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +3 -3
- package/dist/cjs/salla-filters.cjs.entry.js +2 -2
- package/dist/cjs/salla-gifting.cjs.entry.js +3 -3
- package/dist/cjs/salla-hook.cjs.entry.js +2 -2
- 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 +2 -2
- package/dist/cjs/salla-localization-modal.cjs.entry.js +2 -2
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +2 -2
- 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 +4 -4
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +6 -6
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +2 -2
- package/dist/cjs/salla-notification-item.cjs.entry.js +2 -2
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer-modal.cjs.entry.js +2 -2
- package/dist/cjs/salla-offer.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 +2 -2
- package/dist/cjs/salla-order-summary.cjs.entry.js +2 -2
- 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 +3 -3
- package/dist/cjs/salla-placeholder.cjs.entry.js +2 -2
- package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +3 -3
- 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-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +2 -2
- package/dist/cjs/salla-search.cjs.entry.js +6 -6
- package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/salla-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
- package/dist/cjs/salla-social.cjs.entry.js +2 -2
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
- 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 +2 -2
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-D_FRjdtf.js → vanilla-picker-DmWOIwng.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/salla-bullet-delivery/helpers.js +4 -20
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +244 -168
- package/dist/collection/components/salla-cart-coupons/interfaces.js +1 -0
- package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.css +0 -0
- package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.js +293 -0
- package/dist/collection/components/salla-cart-summary/salla-cart-summary.js +1 -1
- package/dist/collection/components/salla-color-picker/salla-color-picker.js +1 -1
- package/dist/collection/components/salla-comment-form/salla-comment-form.js +1 -1
- package/dist/collection/components/salla-comments/salla-comment-item.js +3 -3
- package/dist/collection/components/salla-conditional-fields/salla-conditional-fields.js +1 -1
- package/dist/collection/components/salla-count-down/salla-count-down.js +1 -1
- package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +1 -1
- package/dist/collection/components/salla-file-upload/salla-file-upload.js +2 -2
- package/dist/collection/components/salla-filters/salla-filters.js +1 -1
- package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +2 -2
- package/dist/collection/components/salla-gifting/salla-gifting.js +2 -2
- package/dist/collection/components/salla-hook/salla-hook.js +1 -1
- package/dist/collection/components/salla-list-tile/salla-list-tile.js +1 -1
- package/dist/collection/components/salla-loading/salla-loading.js +1 -1
- package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +1 -1
- package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +1 -1
- package/dist/collection/components/salla-loyalty-program/salla-loyalty-program.js +1 -1
- package/dist/collection/components/salla-maintenance-alert/salla-maintenance-alert.js +1 -1
- package/dist/collection/components/salla-map/salla-map.js +3 -3
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +1 -1
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +2 -2
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +4 -4
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +1 -1
- package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +1 -1
- package/dist/collection/components/salla-notifications/salla-notification-item.js +1 -1
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +1 -1
- package/dist/collection/components/salla-order-details/salla-order-details.js +1 -1
- package/dist/collection/components/salla-order-summary/salla-order-summary.js +1 -1
- package/dist/collection/components/salla-payments/salla-payments.js +2 -2
- package/dist/collection/components/salla-placeholder/salla-placeholder.js +1 -1
- package/dist/collection/components/salla-price-range/salla-price-range.js +2 -2
- package/dist/collection/components/salla-product-availability/salla-product-availability.js +1 -1
- package/dist/collection/components/salla-product-card/salla-product-card.js +5 -5
- package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +2 -2
- package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +1 -1
- package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +1 -1
- package/dist/collection/components/salla-review-card/salla-review-card.js +1 -1
- package/dist/collection/components/salla-reviews/salla-reviews.js +1 -1
- package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
- package/dist/collection/components/salla-scopes/salla-scopes.js +1 -1
- package/dist/collection/components/salla-search/salla-search.js +5 -5
- package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
- package/dist/collection/components/salla-social/salla-social.js +1 -1
- package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
- package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
- package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/salla-bullet-delivery.js +247 -187
- package/dist/components/salla-cart-coupons.d.ts +11 -0
- package/dist/components/salla-cart-coupons.js +287 -0
- package/dist/components/salla-cart-summary.js +1 -1
- package/dist/components/salla-color-picker2.js +1 -1
- package/dist/components/salla-comment-form2.js +1 -1
- package/dist/components/salla-comment-item2.js +3 -3
- package/dist/components/salla-conditional-fields2.js +1 -1
- package/dist/components/salla-count-down2.js +1 -1
- package/dist/components/salla-datetime-picker2.js +1 -1
- package/dist/components/salla-file-upload2.js +2 -2
- package/dist/components/salla-filters-widget2.js +2 -2
- package/dist/components/salla-filters.js +1 -1
- package/dist/components/salla-gifting.js +2 -2
- package/dist/components/salla-hook.js +1 -1
- package/dist/components/salla-list-tile2.js +1 -1
- package/dist/components/salla-loading2.js +1 -1
- package/dist/components/salla-localization-modal.js +1 -1
- package/dist/components/salla-loyalty-prize-item.js +1 -1
- package/dist/components/salla-loyalty-program.js +1 -1
- package/dist/components/salla-maintenance-alert.js +1 -1
- package/dist/components/salla-map2.js +3 -3
- package/dist/components/salla-multiple-bundle-product-cart2.js +1 -1
- package/dist/components/salla-multiple-bundle-product-details2.js +2 -2
- package/dist/components/salla-multiple-bundle-product-options-modal2.js +4 -4
- package/dist/components/salla-multiple-bundle-product-slider2.js +1 -1
- package/dist/components/salla-multiple-bundle-product.js +1 -1
- package/dist/components/salla-notification-item2.js +1 -1
- package/dist/components/salla-offer-modal.js +1 -1
- package/dist/components/salla-order-details.js +1 -1
- package/dist/components/salla-order-summary.js +1 -1
- package/dist/components/salla-payments.js +2 -2
- package/dist/components/salla-placeholder2.js +1 -1
- package/dist/components/salla-price-range2.js +2 -2
- package/dist/components/salla-product-availability2.js +1 -1
- package/dist/components/salla-product-card2.js +5 -5
- package/dist/components/salla-product-size-guide.js +2 -2
- package/dist/components/salla-quantity-input.js +1 -1
- package/dist/components/salla-quick-buy2.js +1 -1
- package/dist/components/salla-review-card2.js +1 -1
- package/dist/components/salla-reviews-page.js +1 -1
- package/dist/components/salla-reviews.js +1 -1
- package/dist/components/salla-scopes.js +1 -1
- package/dist/components/salla-search.js +5 -5
- package/dist/components/salla-skeleton2.js +1 -1
- package/dist/components/salla-social-share.js +1 -1
- package/dist/components/salla-social.js +1 -1
- package/dist/components/salla-tab-content2.js +1 -1
- package/dist/components/salla-tab-header2.js +1 -1
- package/dist/components/salla-tabs2.js +1 -1
- package/dist/components/salla-tel-input2.js +1 -1
- package/dist/components/salla-tooltip2.js +1 -1
- package/dist/components/salla-user-settings.js +1 -1
- package/dist/esm/{filepond-C6DmvP0k.js → filepond-CqDfFTVp.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-aflPfdvq.js → filepond-plugin-file-poster-Bj5ejqRD.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-2ysTkym4.js → filepond-plugin-file-validate-size-CDa3pirY.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-CvlSQE9k.js → filepond-plugin-file-validate-type-BHJfNcLt.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-CPNOb0bn.js → filepond-plugin-image-edit-CzuXmnyp.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-DSOEX9W9.js → filepond-plugin-image-exif-orientation-Bxdqligt.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-ZVPoyaGu.js → filepond-plugin-image-preview-DRM_r5yF.js} +1 -1
- package/dist/esm/{index-DygKr0gG.js → index-Dbv0I4re.js} +6 -2
- package/dist/esm/{index-Dt1F_uJO.js → index-nTW4l4L5.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_3.entry.js +4 -4
- package/dist/esm/salla-accordion_6.entry.js +2 -2
- package/dist/esm/salla-add-product-button_4.entry.js +3 -3
- 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-booking-field_7.entry.js +17 -17
- package/dist/esm/salla-bullet-delivery.entry.js +248 -188
- package/dist/esm/salla-cart-coupons.entry.js +249 -0
- package/dist/esm/salla-cart-item-offers_2.entry.js +2 -2
- package/dist/esm/salla-comment-form_8.entry.js +8 -8
- 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_2.entry.js +7 -7
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +3 -3
- package/dist/esm/salla-filters.entry.js +2 -2
- package/dist/esm/salla-gifting.entry.js +3 -3
- package/dist/esm/salla-hook.entry.js +2 -2
- 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 +2 -2
- package/dist/esm/salla-localization-modal.entry.js +2 -2
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +2 -2
- package/dist/esm/salla-loyalty-program.entry.js +2 -2
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +2 -2
- 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 +4 -4
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +6 -6
- package/dist/esm/salla-multiple-bundle-product.entry.js +2 -2
- package/dist/esm/salla-notification-item.entry.js +2 -2
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer-modal.entry.js +2 -2
- package/dist/esm/salla-offer.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 +2 -2
- package/dist/esm/salla-order-summary.entry.js +2 -2
- 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 +3 -3
- package/dist/esm/salla-placeholder.entry.js +2 -2
- package/dist/esm/salla-price-range.entry.js +3 -3
- package/dist/esm/salla-product-size-guide.entry.js +3 -3
- package/dist/esm/salla-products-list.entry.js +1 -1
- package/dist/esm/salla-products-slider.entry.js +1 -1
- package/dist/esm/salla-progress-bar.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-scopes.entry.js +2 -2
- package/dist/esm/salla-search.entry.js +6 -6
- package/dist/esm/salla-skeleton.entry.js +2 -2
- package/dist/esm/salla-slider.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +2 -2
- package/dist/esm/salla-social.entry.js +2 -2
- package/dist/esm/salla-tab-content_3.entry.js +4 -4
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +2 -2
- 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 +2 -2
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-vpLzwiOX.js → vanilla-picker-CYgHVJAF.js} +1 -1
- package/dist/twilight/{p-d87a6578.entry.js → p-05911caf.entry.js} +1 -1
- package/dist/twilight/{p-f001a716.entry.js → p-07cdbd6f.entry.js} +1 -1
- package/dist/twilight/{p-97e204bf.entry.js → p-08702001.entry.js} +1 -1
- package/dist/twilight/p-08d98540.entry.js +4 -0
- package/dist/twilight/{p-b503ed92.entry.js → p-0c31270e.entry.js} +1 -1
- package/dist/twilight/{p-b667c2d4.entry.js → p-0da615ba.entry.js} +1 -1
- package/dist/twilight/{p-b17de694.entry.js → p-1706c904.entry.js} +1 -1
- package/dist/twilight/{p-abda287b.entry.js → p-1881e1df.entry.js} +1 -1
- package/dist/twilight/{p-ba9ea832.entry.js → p-1ab7646d.entry.js} +1 -1
- package/dist/twilight/{p-ba2754b0.entry.js → p-1b4cb4f3.entry.js} +1 -1
- package/dist/twilight/{p-5609c0a2.entry.js → p-1e58ee3f.entry.js} +1 -1
- package/dist/twilight/{p-4c8d6286.entry.js → p-2110682a.entry.js} +1 -1
- package/dist/twilight/{p-e3725374.entry.js → p-224c2f65.entry.js} +1 -1
- package/dist/twilight/{p-e8562b9e.entry.js → p-258e8407.entry.js} +1 -1
- package/dist/twilight/{p-a265395a.entry.js → p-2d089b2b.entry.js} +1 -1
- package/dist/twilight/{p-4f0da42e.entry.js → p-31b1f09e.entry.js} +1 -1
- package/dist/twilight/p-323012d3.entry.js +4 -0
- package/dist/twilight/{p-91c7b197.entry.js → p-34a94492.entry.js} +1 -1
- package/dist/twilight/p-34ab1e5c.entry.js +4 -0
- package/dist/twilight/{p-6a9c0acd.entry.js → p-3d1043b6.entry.js} +1 -1
- package/dist/twilight/{p-8d40cb2a.entry.js → p-416b578d.entry.js} +1 -1
- package/dist/twilight/{p-31feb28e.entry.js → p-462c51a2.entry.js} +1 -1
- package/dist/twilight/{p-11d1af5a.entry.js → p-4aa4dcec.entry.js} +1 -1
- package/dist/twilight/{p-26dbba19.entry.js → p-4bc9bc63.entry.js} +1 -1
- package/dist/twilight/{p-d1c0eb72.entry.js → p-543bc44f.entry.js} +1 -1
- package/dist/twilight/{p-7c05380e.entry.js → p-58d796a0.entry.js} +1 -1
- package/dist/twilight/{p-b8f61fb6.entry.js → p-595983cf.entry.js} +1 -1
- package/dist/twilight/{p-e6909519.entry.js → p-5a936889.entry.js} +1 -1
- package/dist/twilight/p-6d7d53fa.entry.js +4 -0
- package/dist/twilight/{p-b900e4bf.entry.js → p-74a9e4dd.entry.js} +1 -1
- package/dist/twilight/{p-7ff1a66d.entry.js → p-7a886993.entry.js} +1 -1
- package/dist/twilight/{p-0e06763b.entry.js → p-7d932e81.entry.js} +1 -1
- package/dist/twilight/{p-3174a7da.entry.js → p-814a00c6.entry.js} +1 -1
- package/dist/twilight/{p-069a93a0.entry.js → p-8465d71e.entry.js} +1 -1
- package/dist/twilight/p-876ed9cf.entry.js +4 -0
- package/dist/twilight/{p-3306e240.entry.js → p-8a8cc10a.entry.js} +1 -1
- package/dist/twilight/p-8b19cac5.entry.js +4 -0
- package/dist/twilight/{p-fa071bdf.entry.js → p-8e120858.entry.js} +1 -1
- package/dist/twilight/{p-b64af3e6.entry.js → p-926bdbde.entry.js} +1 -1
- package/dist/twilight/{p-64aaf5d1.entry.js → p-940c57a3.entry.js} +1 -1
- package/dist/twilight/{p-7f5da469.entry.js → p-969f4a67.entry.js} +1 -1
- package/dist/twilight/{p-717f98a9.entry.js → p-9722f5ed.entry.js} +1 -1
- package/dist/twilight/{p-bf5c3fb6.entry.js → p-9770a33e.entry.js} +1 -1
- package/dist/twilight/{p-7e6ac5b6.entry.js → p-99e87c67.entry.js} +1 -1
- package/dist/twilight/{p-CckfqYjO.js → p-CQc5Pmlu.js} +1 -1
- package/dist/twilight/{p-BlNhJOfK.js → p-CWQNB-G4.js} +1 -1
- package/dist/twilight/{p-PRDr-VhL.js → p-Cp5Iu5XS.js} +1 -1
- package/dist/twilight/{p-CiQozo5Q.js → p-Ct4jcDIY.js} +1 -1
- package/dist/twilight/{p-DBSxANjD.js → p-DL3ab5Vo.js} +1 -1
- package/dist/twilight/{p-DygKr0gG.js → p-Dbv0I4re.js} +1 -1
- package/dist/twilight/{p-kltSiNjL.js → p-DjEHkwKr.js} +1 -1
- package/dist/twilight/{p-CU9SaqqL.js → p-Dlb0Gd5v.js} +1 -1
- package/dist/twilight/p-a083cc65.entry.js +4 -0
- package/dist/twilight/p-a1210656.entry.js +4 -0
- package/dist/twilight/{p-15ad8b57.entry.js → p-a19637e3.entry.js} +1 -1
- package/dist/twilight/{p-9f92c538.entry.js → p-a28f7329.entry.js} +1 -1
- package/dist/twilight/{p-42a88fbe.entry.js → p-ad66730c.entry.js} +1 -1
- package/dist/twilight/{p-590aa84f.entry.js → p-aeaa9d52.entry.js} +1 -1
- package/dist/twilight/{p-61891d9d.entry.js → p-b176814d.entry.js} +1 -1
- package/dist/twilight/{p-db8f128a.entry.js → p-b951691e.entry.js} +1 -1
- package/dist/twilight/{p-04b0d99d.entry.js → p-c27bfa01.entry.js} +1 -1
- package/dist/twilight/{p-16956de8.entry.js → p-c5a13ec9.entry.js} +1 -1
- package/dist/twilight/{p-c18afdd4.entry.js → p-c944064d.entry.js} +1 -1
- package/dist/twilight/{p-313de30b.entry.js → p-cdd125b8.entry.js} +1 -1
- package/dist/twilight/{p-2f1dc423.entry.js → p-d3f4480c.entry.js} +1 -1
- package/dist/twilight/{p-c1d5778e.entry.js → p-d8093d37.entry.js} +1 -1
- package/dist/twilight/{p-07aaf6fb.entry.js → p-dbec33e9.entry.js} +1 -1
- package/dist/twilight/{p-93fafdb9.entry.js → p-decce284.entry.js} +1 -1
- package/dist/twilight/{p-0ac97966.entry.js → p-e2d073fb.entry.js} +1 -1
- package/dist/twilight/{p-28c10ffc.entry.js → p-e50916c1.entry.js} +1 -1
- package/dist/twilight/{p-d46b9b12.entry.js → p-ecdb3842.entry.js} +1 -1
- package/dist/twilight/{p-01cd6efd.entry.js → p-ef9c28da.entry.js} +1 -1
- package/dist/twilight/{p-64da3ca2.entry.js → p-f265dd49.entry.js} +1 -1
- package/dist/twilight/{p-e294f075.entry.js → p-f51c98c3.entry.js} +1 -1
- package/dist/twilight/p-f5465c7d.entry.js +4 -0
- package/dist/twilight/{p-4329e96a.entry.js → p-f5bf4c88.entry.js} +1 -1
- package/dist/twilight/{p-1dac71bd.entry.js → p-fdc30e0c.entry.js} +1 -1
- package/dist/twilight/{p-BqgMCU7i.js → p-jBYzSajd.js} +1 -1
- package/dist/twilight/{p-DxwvrO7V.js → p-njEAbf-H.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-bullet-delivery/helpers.d.ts +1 -3
- package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +19 -16
- package/dist/types/components/salla-cart-coupons/interfaces.d.ts +26 -0
- package/dist/types/components/salla-cart-coupons/salla-cart-coupons.d.ts +39 -0
- package/dist/types/components.d.ts +19 -0
- package/package.json +5 -5
- package/dist/twilight/p-1570c69c.entry.js +0 -4
- package/dist/twilight/p-72dfb078.entry.js +0 -4
- package/dist/twilight/p-7725e637.entry.js +0 -4
- package/dist/twilight/p-7e6cc902.entry.js +0 -4
- package/dist/twilight/p-a5a159b8.entry.js +0 -4
- package/dist/twilight/p-d7440521.entry.js +0 -4
- package/dist/twilight/p-ee30137a.entry.js +0 -4
- package/dist/twilight/p-fdd668a8.entry.js +0 -4
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-B99uI20k.js');
|
|
7
7
|
var search = require('./search-c7Aa7lM9.js');
|
|
8
8
|
var location = require('./location-DIyESLuI.js');
|
|
9
9
|
var keyboard_arrow_right = require('./keyboard_arrow_right-BayM_Il2.js');
|
|
@@ -191,25 +191,6 @@ const filterBranches = (branches, searchQuery) => {
|
|
|
191
191
|
const q = searchQuery.toLowerCase();
|
|
192
192
|
return branches.filter((b) => b.name.toLowerCase().includes(q) || b.city?.name?.toLowerCase().includes(q));
|
|
193
193
|
};
|
|
194
|
-
/** Match saved address to guest intent by city/district (and optional street). */
|
|
195
|
-
function findMatchingAddress(guestIntent, userAddresses) {
|
|
196
|
-
const cityId = getIntentCityId(guestIntent);
|
|
197
|
-
const districtId = getIntentDistrictId(guestIntent);
|
|
198
|
-
return userAddresses.find((addr) => {
|
|
199
|
-
const addrCity = addr.city?.id ?? addr.city_id;
|
|
200
|
-
const addrDistrict = addr.district?.id ?? addr.district_id;
|
|
201
|
-
if (cityId == null || addrCity !== cityId)
|
|
202
|
-
return false;
|
|
203
|
-
if (districtId != null) {
|
|
204
|
-
if (addrDistrict !== districtId)
|
|
205
|
-
return false;
|
|
206
|
-
if (guestIntent.street && addr.street)
|
|
207
|
-
return guestIntent.street.toLowerCase() === addr.street.toLowerCase();
|
|
208
|
-
return true;
|
|
209
|
-
}
|
|
210
|
-
return true;
|
|
211
|
-
}) ?? null;
|
|
212
|
-
}
|
|
213
194
|
const getIntentSubtitle = (intent, toAddress, fromBranch) => {
|
|
214
195
|
if (intent.type === 'branch') {
|
|
215
196
|
const loc = intent.branch_details?.city ?? intent.branch_details?.name;
|
|
@@ -238,7 +219,10 @@ const hasSessionAddressIntent = (intent) => {
|
|
|
238
219
|
const city = getIntentCityId(intent);
|
|
239
220
|
const d = getIntentDistrictId(intent);
|
|
240
221
|
const code = getIntentCountryCode(intent);
|
|
241
|
-
|
|
222
|
+
const hasDistrictId = d != null && Number(d) !== 0;
|
|
223
|
+
const hasDistrictName = Boolean(intent.address_details?.district?.name?.trim());
|
|
224
|
+
const districtOk = !isSaudiArabia(code) || hasDistrictId || hasDistrictName;
|
|
225
|
+
return !!(c && city && districtOk);
|
|
242
226
|
};
|
|
243
227
|
const requireRegionAndDistrictForSA = (countryCode, regionId, districtIdOrName) => !countryCode || !isSaudiArabia(countryCode)
|
|
244
228
|
? true
|
|
@@ -344,22 +328,33 @@ const SallaBulletDelivery = class {
|
|
|
344
328
|
this.addressCreated = index.createEvent(this, "addressCreated");
|
|
345
329
|
this.headerContextUpdate = index.createEvent(this, "headerContextUpdate");
|
|
346
330
|
this.confirming = false;
|
|
331
|
+
this.pendingCartSubmitResolver = null;
|
|
332
|
+
this.pendingCartSubmitPromise = null;
|
|
333
|
+
this.cartSubmitConfirmationPending = false;
|
|
347
334
|
this.branchSearchDebounceTimer = null;
|
|
348
335
|
this.componentReady = false;
|
|
349
336
|
this.pendingOpen = false;
|
|
350
337
|
this.tabChanging = false;
|
|
351
338
|
this.intentStorageKey = "bullet_delivery_intent";
|
|
352
|
-
this.sessionShownKey = "
|
|
339
|
+
this.sessionShownKey = "bullet_delivery_shown";
|
|
340
|
+
this.incompleteIntentPromptKey = "bullet_delivery_incomplete_intent_prompted";
|
|
353
341
|
this.cartItemAddedEvent = "cart::item.added";
|
|
354
342
|
this.cartItemAddedHandler = null;
|
|
343
|
+
this.cartSubmittingHandler = null;
|
|
355
344
|
this.useCartEventApi = false;
|
|
345
|
+
this.authLoggedInHandler = null;
|
|
346
|
+
this.authLoggedOutHandler = null;
|
|
347
|
+
this.loginClosedHandler = null;
|
|
348
|
+
this.hasExplicitPreselectedIdsForOpen = false;
|
|
356
349
|
this.bulletDeliveryOpenHandler = (eventData) => {
|
|
357
350
|
this.preselectedAddressId = eventData?.preselected_address_id;
|
|
358
351
|
this.preselectedBranchId = eventData?.preselected_branch_id;
|
|
352
|
+
this.hasExplicitPreselectedIdsForOpen =
|
|
353
|
+
eventData?.preselected_address_id != null ||
|
|
354
|
+
eventData?.preselected_branch_id != null;
|
|
359
355
|
this.open();
|
|
360
356
|
};
|
|
361
357
|
this.closeHandler = null;
|
|
362
|
-
this.guestLoginSyncHandler = null;
|
|
363
358
|
/** True after saved addresses have been loaded (lazy: only when address tab is shown). */
|
|
364
359
|
this.savedAddressesLoaded = false;
|
|
365
360
|
// Core state
|
|
@@ -468,17 +463,9 @@ const SallaBulletDelivery = class {
|
|
|
468
463
|
// Open modal immediately to show skeleton/loading state
|
|
469
464
|
this.modal.open();
|
|
470
465
|
try {
|
|
471
|
-
|
|
472
|
-
const
|
|
473
|
-
this.
|
|
474
|
-
const savedIntent = this.getStoredIntent();
|
|
475
|
-
// When opening from a stored intent, treat its IDs as preselected targets
|
|
476
|
-
if (savedIntent?.type === "address" && savedIntent.address_id) {
|
|
477
|
-
this.preselectedAddressId = savedIntent.address_id;
|
|
478
|
-
}
|
|
479
|
-
if (savedIntent?.type === "branch" && savedIntent.branch_id) {
|
|
480
|
-
this.preselectedBranchId = savedIntent.branch_id;
|
|
481
|
-
}
|
|
466
|
+
this.isLoggedIn = !this.isGuestUser();
|
|
467
|
+
const savedIntent = this.cleanStaleGuestAddressIdIfNeeded(this.getStoredIntent());
|
|
468
|
+
this.applyPreselectedIdsFromIntent(savedIntent);
|
|
482
469
|
const hasStoredAddressIds = !this.isLoggedIn &&
|
|
483
470
|
savedIntent?.type === "address" &&
|
|
484
471
|
getIntentCountryId(savedIntent) != null &&
|
|
@@ -538,12 +525,17 @@ const SallaBulletDelivery = class {
|
|
|
538
525
|
// Only hide loading after all data is loaded and UI is ready
|
|
539
526
|
this.loading = false;
|
|
540
527
|
this.modal?.stopLoading();
|
|
528
|
+
this.overrideScopeSwitchUI();
|
|
541
529
|
}
|
|
542
530
|
}
|
|
543
531
|
/**
|
|
544
532
|
* Closes the bullet delivery modal
|
|
545
533
|
*/
|
|
546
534
|
async close() {
|
|
535
|
+
// If submit flow is waiting and user dismissed the modal, release the pending gate.
|
|
536
|
+
if (this.cartSubmitConfirmationPending && !this.confirming) {
|
|
537
|
+
this.resolvePendingCartSubmit();
|
|
538
|
+
}
|
|
547
539
|
this.bulletDeliveryClosed.emit();
|
|
548
540
|
return this.modal?.close();
|
|
549
541
|
}
|
|
@@ -575,14 +567,87 @@ const SallaBulletDelivery = class {
|
|
|
575
567
|
const rememberLastSession = Boolean(Salla.config.get("store.settings.bullet_delivery.settings.remember_last_session"));
|
|
576
568
|
return Salla.storage[rememberLastSession ? "store" : "session"];
|
|
577
569
|
}
|
|
570
|
+
getShownStorage() {
|
|
571
|
+
// Always session-scoped. `remember_last_session` applies to intent persistence only.
|
|
572
|
+
return Salla.storage.session;
|
|
573
|
+
}
|
|
578
574
|
getStoredIntent() {
|
|
579
575
|
return this.getIntentStorage().get(this.intentStorageKey);
|
|
580
576
|
}
|
|
577
|
+
isGuestUser() {
|
|
578
|
+
return String(Salla.config.get("user.type") ?? "guest") === "guest";
|
|
579
|
+
}
|
|
580
|
+
cleanStaleGuestAddressIdIfNeeded(intent) {
|
|
581
|
+
if (!this.isGuestUser() || intent?.type !== "address" || !intent.address_id)
|
|
582
|
+
return intent;
|
|
583
|
+
const cleaned = {
|
|
584
|
+
...intent,
|
|
585
|
+
address_id: undefined,
|
|
586
|
+
};
|
|
587
|
+
this.setStoredIntent(cleaned);
|
|
588
|
+
return cleaned;
|
|
589
|
+
}
|
|
590
|
+
applyPreselectedIdsFromIntent(intent) {
|
|
591
|
+
if (this.hasExplicitPreselectedIdsForOpen) {
|
|
592
|
+
this.hasExplicitPreselectedIdsForOpen = false;
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
this.preselectedAddressId = undefined;
|
|
596
|
+
this.preselectedBranchId = undefined;
|
|
597
|
+
if (this.isGuestUser()) {
|
|
598
|
+
if (intent?.type === "branch" && intent.branch_id) {
|
|
599
|
+
this.preselectedBranchId = intent.branch_id;
|
|
600
|
+
}
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
if (intent?.type === "address" && intent.address_id) {
|
|
604
|
+
this.preselectedAddressId = intent.address_id;
|
|
605
|
+
}
|
|
606
|
+
else if (intent?.type === "branch" && intent.branch_id) {
|
|
607
|
+
this.preselectedBranchId = intent.branch_id;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
hasIncompleteUserAddressIntent() {
|
|
611
|
+
if (this.isGuestUser())
|
|
612
|
+
return false;
|
|
613
|
+
const intent = this.getStoredIntent();
|
|
614
|
+
if (!intent || intent.type !== "address" || intent.address_id || !intent.address_details)
|
|
615
|
+
return false;
|
|
616
|
+
// Intent is an address without address_id; consider it "incomplete"
|
|
617
|
+
// only when it represents a valid session-style address.
|
|
618
|
+
return hasSessionAddressIntent(intent);
|
|
619
|
+
}
|
|
620
|
+
hasCompleteIntentForLoggedInUser() {
|
|
621
|
+
if (this.isGuestUser())
|
|
622
|
+
return false;
|
|
623
|
+
const intent = this.getStoredIntent();
|
|
624
|
+
if (!intent)
|
|
625
|
+
return false;
|
|
626
|
+
if (intent.type === "address")
|
|
627
|
+
return !!intent.address_id;
|
|
628
|
+
if (intent.type === "branch")
|
|
629
|
+
return !!intent.branch_id;
|
|
630
|
+
return false;
|
|
631
|
+
}
|
|
632
|
+
shouldPromptIncompleteIntentThisSession() {
|
|
633
|
+
const storage = this.getShownStorage();
|
|
634
|
+
return (this.hasIncompleteUserAddressIntent() &&
|
|
635
|
+
storage.get(this.incompleteIntentPromptKey) !== true);
|
|
636
|
+
}
|
|
637
|
+
markIncompleteIntentPrompted() {
|
|
638
|
+
this.getShownStorage().set(this.incompleteIntentPromptKey, true);
|
|
639
|
+
}
|
|
581
640
|
setStoredIntent(intent) {
|
|
582
641
|
this.getIntentStorage().set(this.intentStorageKey, intent);
|
|
642
|
+
this.overrideScopeSwitchUI();
|
|
583
643
|
}
|
|
584
|
-
|
|
585
|
-
|
|
644
|
+
clearBulletDeliveryStoredData() {
|
|
645
|
+
// Clear all bullet-delivery keys from both scopes to avoid stale state across auth transitions.
|
|
646
|
+
Salla.storage.session.remove(this.intentStorageKey);
|
|
647
|
+
Salla.storage.store.remove(this.intentStorageKey);
|
|
648
|
+
Salla.storage.session.remove(this.sessionShownKey);
|
|
649
|
+
Salla.storage.session.remove(this.incompleteIntentPromptKey);
|
|
650
|
+
this.overrideScopeSwitchUI();
|
|
586
651
|
}
|
|
587
652
|
/**
|
|
588
653
|
* Single prefill flow: load geography from stored intent and set selected location + form.
|
|
@@ -640,17 +705,23 @@ const SallaBulletDelivery = class {
|
|
|
640
705
|
this.selectedDistrict = district;
|
|
641
706
|
}
|
|
642
707
|
}
|
|
708
|
+
// When district is captured as free text (or couldn't be matched), keep it in the text input state.
|
|
709
|
+
if (!this.selectedDistrict && districtName) {
|
|
710
|
+
this.districtName = districtName;
|
|
711
|
+
}
|
|
643
712
|
}
|
|
644
713
|
updateNewAddressForm(partial) {
|
|
645
714
|
this.newAddressForm = { ...this.newAddressForm, ...partial };
|
|
646
715
|
}
|
|
647
716
|
/** Whether allocation completed successfully this session (modal won't auto-open again). */
|
|
648
717
|
hasBeenShownThisSession() {
|
|
649
|
-
|
|
718
|
+
const storage = this.getShownStorage();
|
|
719
|
+
return storage.get(this.sessionShownKey) === true;
|
|
650
720
|
}
|
|
651
721
|
/** Mark allocation as completed this session (called only after allocateScope succeeds). */
|
|
652
722
|
markShownThisSession() {
|
|
653
|
-
|
|
723
|
+
const storage = this.getShownStorage();
|
|
724
|
+
storage.set(this.sessionShownKey, true);
|
|
654
725
|
}
|
|
655
726
|
async loadCountries(skipEagerSubFetch = false) {
|
|
656
727
|
const forBranch = this.activeTab === "branch";
|
|
@@ -847,110 +918,6 @@ const SallaBulletDelivery = class {
|
|
|
847
918
|
this.loadingRegions = false;
|
|
848
919
|
}
|
|
849
920
|
}
|
|
850
|
-
/**
|
|
851
|
-
* AC7: Guest-to-Registered Sync
|
|
852
|
-
* Syncs guest session location to user profile on login
|
|
853
|
-
*/
|
|
854
|
-
async handleGuestToRegisteredSync() {
|
|
855
|
-
try {
|
|
856
|
-
// Check if user is now logged in
|
|
857
|
-
const userId = Salla.config.get("user.id");
|
|
858
|
-
if (!userId)
|
|
859
|
-
return;
|
|
860
|
-
// Get the guest session location from session storage
|
|
861
|
-
const guestIntent = this.getStoredIntent();
|
|
862
|
-
if (!guestIntent || guestIntent.type !== "address") {
|
|
863
|
-
// No guest address intent to sync, or it's a branch intent
|
|
864
|
-
return;
|
|
865
|
-
}
|
|
866
|
-
// Get user's saved addresses
|
|
867
|
-
const userAddresses = await bulletDeliveryAPI.getSavedAddresses();
|
|
868
|
-
const matchingAddress = findMatchingAddress(guestIntent, userAddresses);
|
|
869
|
-
if (matchingAddress) {
|
|
870
|
-
await this.setAddressAsActive(matchingAddress.id);
|
|
871
|
-
const updatedIntent = {
|
|
872
|
-
...guestIntent,
|
|
873
|
-
address_id: matchingAddress.id,
|
|
874
|
-
address_details: this.buildIntentAddressFromSaved(matchingAddress),
|
|
875
|
-
};
|
|
876
|
-
this.setStoredIntent(updatedIntent);
|
|
877
|
-
}
|
|
878
|
-
else if (getIntentCityId(guestIntent)) {
|
|
879
|
-
// No match - create new address from guest session data
|
|
880
|
-
const newAddress = await this.createAddressFromGuestSession(guestIntent);
|
|
881
|
-
if (newAddress) {
|
|
882
|
-
const updatedIntent = {
|
|
883
|
-
...guestIntent,
|
|
884
|
-
address_id: newAddress.id,
|
|
885
|
-
address_details: this.buildIntentAddressFromSaved(newAddress),
|
|
886
|
-
};
|
|
887
|
-
this.setStoredIntent(updatedIntent);
|
|
888
|
-
this.addressCreated.emit({ address: newAddress });
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
// Emit event to notify that sync is complete
|
|
892
|
-
Salla.event.emit("bullet-delivery::guest-synced", {
|
|
893
|
-
guest_intent: guestIntent,
|
|
894
|
-
matched_address_id: matchingAddress?.id,
|
|
895
|
-
});
|
|
896
|
-
}
|
|
897
|
-
catch (error) {
|
|
898
|
-
console.error("SallaBulletDelivery: Error syncing guest session to user profile", error);
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
/**
|
|
902
|
-
* Set an address as active/last used
|
|
903
|
-
*/
|
|
904
|
-
async setAddressAsActive(addressId) {
|
|
905
|
-
try {
|
|
906
|
-
// Call API to mark address as default/active
|
|
907
|
-
await Salla.address?.api?.setDefault?.(addressId);
|
|
908
|
-
}
|
|
909
|
-
catch (error) {
|
|
910
|
-
// If setDefault API doesn't exist, just update local state
|
|
911
|
-
console.warn("SallaBulletDelivery: Could not set address as default", error);
|
|
912
|
-
}
|
|
913
|
-
}
|
|
914
|
-
/**
|
|
915
|
-
* Create a new address from guest session: only country, city and district IDs (no street, etc.).
|
|
916
|
-
* Uses address/location API; after fetch we return the newly created address from the list.
|
|
917
|
-
*/
|
|
918
|
-
async createAddressFromGuestSession(guestIntent) {
|
|
919
|
-
const countryId = getIntentCountryId(guestIntent);
|
|
920
|
-
const cityId = getIntentCityId(guestIntent);
|
|
921
|
-
if (!countryId || !cityId)
|
|
922
|
-
return null;
|
|
923
|
-
const isSA = isSaudiArabia(getIntentCountryCode(guestIntent));
|
|
924
|
-
const districtName = guestIntent.address_details?.district?.name ?? "";
|
|
925
|
-
const payload = {
|
|
926
|
-
country_id: countryId,
|
|
927
|
-
region_id: getIntentRegionId(guestIntent),
|
|
928
|
-
city_id: cityId,
|
|
929
|
-
district_id: getIntentDistrictId(guestIntent),
|
|
930
|
-
description: districtName,
|
|
931
|
-
};
|
|
932
|
-
if (isSA) {
|
|
933
|
-
payload.local = districtName;
|
|
934
|
-
}
|
|
935
|
-
try {
|
|
936
|
-
const { success, address } = await bulletDeliveryAPI.saveAddressLocation(payload);
|
|
937
|
-
if (!success)
|
|
938
|
-
return null;
|
|
939
|
-
if (address)
|
|
940
|
-
return address;
|
|
941
|
-
const addresses = await bulletDeliveryAPI.getSavedAddresses();
|
|
942
|
-
const districtId = getIntentDistrictId(guestIntent);
|
|
943
|
-
const newAddress = addresses.find((a) => (a.city_id ?? a.city?.id) === cityId &&
|
|
944
|
-
(a.district_id ?? a.district?.id) === districtId) ??
|
|
945
|
-
addresses[0] ??
|
|
946
|
-
null;
|
|
947
|
-
return newAddress;
|
|
948
|
-
}
|
|
949
|
-
catch (error) {
|
|
950
|
-
console.error("SallaBulletDelivery: Could not create address from guest session", error);
|
|
951
|
-
return null;
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
921
|
emitHeaderContextUpdate(result, address, branch) {
|
|
955
922
|
let locationText = "";
|
|
956
923
|
if (result.type === "address") {
|
|
@@ -1221,8 +1188,21 @@ const SallaBulletDelivery = class {
|
|
|
1221
1188
|
return false;
|
|
1222
1189
|
}
|
|
1223
1190
|
handleLogin() {
|
|
1191
|
+
// Keep bullet-delivery flow in-place and avoid full page reload after login.
|
|
1192
|
+
Salla.auth.setCanRedirect(false);
|
|
1224
1193
|
Salla.event.dispatch("bullet-delivery::close");
|
|
1225
|
-
Salla.event.dispatch("login::open")
|
|
1194
|
+
Salla.event.dispatch("login::open", Salla.url.is_page("cart")
|
|
1195
|
+
? { withoutReload: true, source: "cart-submit" }
|
|
1196
|
+
: { withoutReload: true, source: "bullet-delivery" });
|
|
1197
|
+
}
|
|
1198
|
+
resolvePendingCartSubmit() {
|
|
1199
|
+
if (!this.pendingCartSubmitResolver)
|
|
1200
|
+
return;
|
|
1201
|
+
const resolve = this.pendingCartSubmitResolver;
|
|
1202
|
+
this.pendingCartSubmitResolver = null;
|
|
1203
|
+
this.pendingCartSubmitPromise = null;
|
|
1204
|
+
this.cartSubmitConfirmationPending = false;
|
|
1205
|
+
resolve();
|
|
1226
1206
|
}
|
|
1227
1207
|
buildIntentAddress() {
|
|
1228
1208
|
if (this.activeTab !== "address" ||
|
|
@@ -1308,10 +1288,8 @@ const SallaBulletDelivery = class {
|
|
|
1308
1288
|
};
|
|
1309
1289
|
let selectedAddress;
|
|
1310
1290
|
let selectedBranchData;
|
|
1311
|
-
let usedSessionAddress = false;
|
|
1312
1291
|
if (this.activeTab === "address") {
|
|
1313
1292
|
if (this.isLoggedIn && this.selectedSessionAddress) {
|
|
1314
|
-
usedSessionAddress = true;
|
|
1315
1293
|
const savedAddress = await this.saveSessionAddressToProfile();
|
|
1316
1294
|
if (!savedAddress) {
|
|
1317
1295
|
Salla.notify?.error(Salla.lang.get("common.errors.error_occurred"));
|
|
@@ -1418,14 +1396,9 @@ const SallaBulletDelivery = class {
|
|
|
1418
1396
|
}
|
|
1419
1397
|
// After allocation success: mark session so we don't show modal again this session
|
|
1420
1398
|
this.markShownThisSession();
|
|
1421
|
-
// After allocation success:
|
|
1422
|
-
//
|
|
1423
|
-
|
|
1424
|
-
this.removeStoredIntent();
|
|
1425
|
-
}
|
|
1426
|
-
else {
|
|
1427
|
-
this.setStoredIntent(result);
|
|
1428
|
-
}
|
|
1399
|
+
// After allocation success: persist latest intent so switch UI can always reflect
|
|
1400
|
+
// the selected address/branch once confirmed.
|
|
1401
|
+
this.setStoredIntent(result);
|
|
1429
1402
|
if (allocatedScopeId) {
|
|
1430
1403
|
await bulletDeliveryAPI.setDeliveryScope(allocatedScopeId);
|
|
1431
1404
|
}
|
|
@@ -1441,6 +1414,10 @@ const SallaBulletDelivery = class {
|
|
|
1441
1414
|
this.confirmBtn?.stop();
|
|
1442
1415
|
this.close();
|
|
1443
1416
|
this.confirming = false;
|
|
1417
|
+
if (this.cartSubmitConfirmationPending) {
|
|
1418
|
+
this.resolvePendingCartSubmit();
|
|
1419
|
+
return;
|
|
1420
|
+
}
|
|
1444
1421
|
if (allocatedScopeId) {
|
|
1445
1422
|
const scope = Salla.storage.get("scope") || {};
|
|
1446
1423
|
let url = Salla.helpers.addParamToUrl("scope", allocatedScopeId);
|
|
@@ -1559,7 +1536,7 @@ const SallaBulletDelivery = class {
|
|
|
1559
1536
|
} }, index.h("option", { value: "", disabled: true, selected: !this.selectedCountry }, Salla.lang.get("pages.checkout.select_country")), this.countries.map((country) => (index.h("option", { key: country.id, value: country.id, selected: this.selectedCountry?.id === country.id }, country.name))))));
|
|
1560
1537
|
}
|
|
1561
1538
|
renderSelectLoader() {
|
|
1562
|
-
return (index.h("span", { class: "s-bullet-delivery-select-loader", "aria-hidden": "true" }, index.h("salla-
|
|
1539
|
+
return (index.h("span", { class: "s-bullet-delivery-select-loader", "aria-hidden": "true" }, index.h("salla-skeleton", { height: "16px", width: "16px" })));
|
|
1563
1540
|
}
|
|
1564
1541
|
renderLoadingLabel(label, htmlFor, isLoading = false, isRequired = true) {
|
|
1565
1542
|
return (index.h("label", { class: "s-bullet-delivery-label", htmlFor: htmlFor }, index.h("span", { class: "s-bullet-delivery-label-content" }, index.h("span", null, label, isRequired && index.h("span", { class: "text-red-500" }, " *")), isLoading && this.renderSelectLoader())));
|
|
@@ -1684,22 +1661,17 @@ const SallaBulletDelivery = class {
|
|
|
1684
1661
|
if (!this.isLoggedIn)
|
|
1685
1662
|
return null;
|
|
1686
1663
|
if (this.loadingSavedAddresses) {
|
|
1687
|
-
return (index.h("div",
|
|
1664
|
+
return (index.h("div", { class: "s-bullet-delivery-addresses-list s-scrollbar" }, [1, 2, 3].map((v) => (index.h("div", { key: v, class: "s-bullet-delivery-address-item s-bullet-delivery-address-item--skeleton" }, index.h("salla-skeleton", { class: "s-bullet-delivery-skel-radio", height: "18px", width: "18px" }), index.h("salla-skeleton", { class: "s-bullet-delivery-skel-map", height: "36px", width: "36px" }), index.h("div", { class: "s-bullet-delivery-address-content" }, index.h("div", { class: "s-bullet-delivery-address-lines" }, index.h("salla-skeleton", { height: "18px", width: "72%" }), index.h("salla-skeleton", { height: "16px", width: "56%" }))))))));
|
|
1688
1665
|
}
|
|
1689
1666
|
const intent = this.getStoredIntent();
|
|
1690
1667
|
const hasSessionAddress = hasSessionAddressIntent(intent);
|
|
1691
|
-
const
|
|
1692
|
-
? [
|
|
1693
|
-
intent.address_details.district?.name,
|
|
1694
|
-
intent.address_details.city.name,
|
|
1695
|
-
intent.address_details.country.name,
|
|
1696
|
-
]
|
|
1668
|
+
const sessionLine1 = hasSessionAddress && intent?.address_details
|
|
1669
|
+
? [intent.address_details.city?.name, intent.address_details.country?.name]
|
|
1697
1670
|
.filter(Boolean)
|
|
1698
|
-
.join("، ") ||
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
].join(", ")
|
|
1671
|
+
.join("، ") || ""
|
|
1672
|
+
: "";
|
|
1673
|
+
const sessionLine2 = hasSessionAddress && intent?.address_details
|
|
1674
|
+
? (intent.address_details.district?.name ?? "").trim()
|
|
1703
1675
|
: "";
|
|
1704
1676
|
if (this.savedAddresses.length === 0 && !hasSessionAddress) {
|
|
1705
1677
|
return this.renderSavedAddressesEmptyState();
|
|
@@ -1707,8 +1679,8 @@ const SallaBulletDelivery = class {
|
|
|
1707
1679
|
return (index.h("div", { class: "s-bullet-delivery-addresses-list s-scrollbar" }, hasSessionAddress &&
|
|
1708
1680
|
this.renderAddressRow({
|
|
1709
1681
|
key: "session-address",
|
|
1710
|
-
line1:
|
|
1711
|
-
line2:
|
|
1682
|
+
line1: sessionLine1,
|
|
1683
|
+
line2: sessionLine2,
|
|
1712
1684
|
selected: this.selectedSessionAddress,
|
|
1713
1685
|
onClick: () => this.handleSessionAddressSelect(),
|
|
1714
1686
|
}), this.savedAddresses.map((address) => {
|
|
@@ -1723,7 +1695,7 @@ const SallaBulletDelivery = class {
|
|
|
1723
1695
|
]
|
|
1724
1696
|
.filter(Boolean)
|
|
1725
1697
|
.join("، ");
|
|
1726
|
-
const line2 = (
|
|
1698
|
+
const line2 = (address.formatted?.address_two || builtLine2) ?? "";
|
|
1727
1699
|
const inCoverage = address.is_in_coverage !== false;
|
|
1728
1700
|
return this.renderAddressRow({
|
|
1729
1701
|
key: String(address.id),
|
|
@@ -1771,7 +1743,7 @@ const SallaBulletDelivery = class {
|
|
|
1771
1743
|
"s-bullet-delivery-location-btn": true,
|
|
1772
1744
|
"s-bullet-delivery-location-btn--full": true,
|
|
1773
1745
|
"s-bullet-delivery-location-btn--loading": this.loadingNearestBranch,
|
|
1774
|
-
}, onClick: () => this.handleFindNearestBranch(), disabled: this.loadingNearestBranch }, this.loadingNearestBranch ? (index.h("salla-
|
|
1746
|
+
}, onClick: () => this.handleFindNearestBranch(), disabled: this.loadingNearestBranch }, this.loadingNearestBranch ? (index.h("span", { class: "s-bullet-delivery-location-icon", "aria-hidden": "true" }, index.h("salla-skeleton", { height: "18px", width: "18px" }))) : (index.h("span", { class: "s-bullet-delivery-location-icon", innerHTML: GPS, "aria-hidden": "true" })), index.h("span", null, Salla.lang.get("pages.checkout.nearest_to_my_location")))), this.locationError && this.activeTab === "branch" && (index.h("span", { class: "s-bullet-delivery-error" }, this.locationError))));
|
|
1775
1747
|
}
|
|
1776
1748
|
renderBranchList() {
|
|
1777
1749
|
if (this.loadingBranches) {
|
|
@@ -1841,10 +1813,14 @@ const SallaBulletDelivery = class {
|
|
|
1841
1813
|
handleAfterAddToCart() {
|
|
1842
1814
|
if (this.openingType !== "after_add_to_cart")
|
|
1843
1815
|
return;
|
|
1844
|
-
|
|
1816
|
+
const canOpenForIncompleteIntent = this.shouldPromptIncompleteIntentThisSession();
|
|
1817
|
+
if (this.hasBeenShownThisSession() && !canOpenForIncompleteIntent)
|
|
1845
1818
|
return;
|
|
1846
1819
|
if (this.modal?.hasAttribute?.("visible"))
|
|
1847
1820
|
return;
|
|
1821
|
+
if (canOpenForIncompleteIntent) {
|
|
1822
|
+
this.markIncompleteIntentPrompted();
|
|
1823
|
+
}
|
|
1848
1824
|
this.open();
|
|
1849
1825
|
}
|
|
1850
1826
|
overrideScopeSwitchUI() {
|
|
@@ -1852,13 +1828,17 @@ const SallaBulletDelivery = class {
|
|
|
1852
1828
|
const btn = document.querySelector('[onclick*="scopes"]');
|
|
1853
1829
|
if (!btn)
|
|
1854
1830
|
return;
|
|
1831
|
+
const hasIntentWithType = !!intent && (intent.type === "address" || intent.type === "branch");
|
|
1832
|
+
if (!hasIntentWithType) {
|
|
1833
|
+
btn.style.display = "none";
|
|
1834
|
+
btn.onclick = () => this.open();
|
|
1835
|
+
return;
|
|
1836
|
+
}
|
|
1855
1837
|
const trunc = (s, max) => s && s.length > max ? `${s.slice(0, max)}...` : (s ?? "");
|
|
1856
|
-
const label =
|
|
1857
|
-
? Salla.lang.get("common.
|
|
1858
|
-
:
|
|
1859
|
-
|
|
1860
|
-
: `${Salla.lang.get("mobile_app.strings.delivery")} ${Salla.lang.get("common.elements.to")} ${trunc(intent.address_details?.city?.name, 10)}`;
|
|
1861
|
-
btn.style.display = intent ? "" : "none";
|
|
1838
|
+
const label = intent.type === "branch"
|
|
1839
|
+
? `${Salla.lang.get("mobile_app.strings.pickup")} ${Salla.lang.get("common.elements.from")} ${trunc(intent.branch_details?.name, 20)}`
|
|
1840
|
+
: `${Salla.lang.get("mobile_app.strings.delivery")} ${Salla.lang.get("common.elements.to")} ${trunc(intent.address_details?.city?.name, 10)}`;
|
|
1841
|
+
btn.style.display = "inline-flex";
|
|
1862
1842
|
btn.onclick = () => this.open();
|
|
1863
1843
|
const span = btn.querySelector('span:not([class*="sicon"]):not([class*="icon"])');
|
|
1864
1844
|
if (span) {
|
|
@@ -1874,6 +1854,31 @@ const SallaBulletDelivery = class {
|
|
|
1874
1854
|
await Salla.onReady();
|
|
1875
1855
|
try {
|
|
1876
1856
|
this.overrideScopeSwitchUI();
|
|
1857
|
+
this.cartSubmittingHandler = async () => {
|
|
1858
|
+
if (this.pendingCartSubmitPromise) {
|
|
1859
|
+
await this.pendingCartSubmitPromise;
|
|
1860
|
+
return;
|
|
1861
|
+
}
|
|
1862
|
+
// Logged-in users with a complete intent can continue checkout without re-prompting.
|
|
1863
|
+
if (this.hasCompleteIntentForLoggedInUser()) {
|
|
1864
|
+
return;
|
|
1865
|
+
}
|
|
1866
|
+
this.cartSubmitConfirmationPending = true;
|
|
1867
|
+
this.pendingCartSubmitPromise = new Promise((resolve) => {
|
|
1868
|
+
this.pendingCartSubmitResolver = resolve;
|
|
1869
|
+
if (this.isGuestUser()) {
|
|
1870
|
+
Salla.auth.setCanRedirect(false);
|
|
1871
|
+
Salla.event.dispatch("login::open", {
|
|
1872
|
+
withoutReload: true,
|
|
1873
|
+
source: "cart-submit",
|
|
1874
|
+
});
|
|
1875
|
+
return;
|
|
1876
|
+
}
|
|
1877
|
+
this.open();
|
|
1878
|
+
});
|
|
1879
|
+
await this.pendingCartSubmitPromise;
|
|
1880
|
+
};
|
|
1881
|
+
Salla.cart.event.onSubmitting(this.cartSubmittingHandler);
|
|
1877
1882
|
}
|
|
1878
1883
|
catch (e) {
|
|
1879
1884
|
console.warn("SallaBulletDelivery: overrideScopeSwitchUI failed", e);
|
|
@@ -1881,11 +1886,40 @@ const SallaBulletDelivery = class {
|
|
|
1881
1886
|
Salla.event.on("bullet-delivery::open", this.bulletDeliveryOpenHandler);
|
|
1882
1887
|
this.closeHandler = this.close.bind(this);
|
|
1883
1888
|
Salla.event.on("bullet-delivery::close", this.closeHandler);
|
|
1884
|
-
// Listen for successful login to sync guest session to user profile (AC7)
|
|
1885
|
-
this.guestLoginSyncHandler = this.handleGuestToRegisteredSync.bind(this);
|
|
1886
|
-
Salla.event.on("login::success", this.guestLoginSyncHandler);
|
|
1887
|
-
Salla.event.on("auth::logged-in", this.guestLoginSyncHandler);
|
|
1888
1889
|
this.isRTL = Salla.config.get("theme.is_rtl");
|
|
1890
|
+
this.authLoggedInHandler = () => {
|
|
1891
|
+
if (this.cartSubmitConfirmationPending) {
|
|
1892
|
+
Salla.event.dispatch("login::close");
|
|
1893
|
+
if (this.hasCompleteIntentForLoggedInUser()) {
|
|
1894
|
+
this.resolvePendingCartSubmit();
|
|
1895
|
+
return;
|
|
1896
|
+
}
|
|
1897
|
+
if (!this.modal?.hasAttribute?.("visible")) {
|
|
1898
|
+
this.open();
|
|
1899
|
+
}
|
|
1900
|
+
return;
|
|
1901
|
+
}
|
|
1902
|
+
// Always prompt after login when intent is incomplete, regardless of prior prompted flags.
|
|
1903
|
+
if (!this.hasIncompleteUserAddressIntent())
|
|
1904
|
+
return;
|
|
1905
|
+
if (this.modal?.hasAttribute?.("visible"))
|
|
1906
|
+
return;
|
|
1907
|
+
this.open();
|
|
1908
|
+
};
|
|
1909
|
+
Salla.event.on("auth::logged.in", this.authLoggedInHandler);
|
|
1910
|
+
this.authLoggedOutHandler = () => {
|
|
1911
|
+
this.clearBulletDeliveryStoredData();
|
|
1912
|
+
};
|
|
1913
|
+
Salla.event.on("auth::logged.out", this.authLoggedOutHandler);
|
|
1914
|
+
this.loginClosedHandler = () => {
|
|
1915
|
+
// Guest cart-submit flow opens login first; if login is dismissed, unblock submit gate.
|
|
1916
|
+
if (!this.cartSubmitConfirmationPending || !this.isGuestUser())
|
|
1917
|
+
return;
|
|
1918
|
+
if (this.hasCompleteIntentForLoggedInUser())
|
|
1919
|
+
return;
|
|
1920
|
+
this.resolvePendingCartSubmit();
|
|
1921
|
+
};
|
|
1922
|
+
Salla.event.on("salla-login::closed", this.loginClosedHandler);
|
|
1889
1923
|
// Listen for add-to-cart events for 'after_add_to_cart' opening strategy (after salla is ready)
|
|
1890
1924
|
this.cartItemAddedHandler = () => this.handleAfterAddToCart();
|
|
1891
1925
|
if (typeof Salla.cart?.event?.onItemAdded === "function") {
|
|
@@ -1897,7 +1931,7 @@ const SallaBulletDelivery = class {
|
|
|
1897
1931
|
}
|
|
1898
1932
|
}
|
|
1899
1933
|
render() {
|
|
1900
|
-
return (index.h(index.Host, { key: '
|
|
1934
|
+
return (index.h(index.Host, { key: '751566707c28202b5ccf4ecde28bfb09550ae886', class: "s-bullet-delivery" }, index.h("salla-modal", { key: '25a18755aa4aa85b55f08bb73829e30833ca5328', ref: (modal) => {
|
|
1901
1935
|
this.modal = modal;
|
|
1902
1936
|
}, isClosable: !this.isRequired, class: "s-bullet-delivery-modal", isLoading: this.loading, width: "sm" }, this.loading ? (this.renderSkeleton()) : (index.h("div", { class: "s-bullet-delivery-inner" }, this.viewMode === "main" && this.renderMainView(), this.viewMode === "add-address" && this.renderAddAddressForm())))));
|
|
1903
1937
|
}
|
|
@@ -1917,12 +1951,22 @@ const SallaBulletDelivery = class {
|
|
|
1917
1951
|
if (!this.hasBeenShownThisSession()) {
|
|
1918
1952
|
this.open();
|
|
1919
1953
|
}
|
|
1954
|
+
else if (this.shouldPromptIncompleteIntentThisSession()) {
|
|
1955
|
+
this.markIncompleteIntentPrompted();
|
|
1956
|
+
this.open();
|
|
1957
|
+
}
|
|
1920
1958
|
break;
|
|
1921
1959
|
case "on_cart_click":
|
|
1922
1960
|
// Open automatically when user is on the cart page
|
|
1923
1961
|
if (Salla.url.is_page("cart")) {
|
|
1924
|
-
|
|
1962
|
+
const shown = this.getShownStorage().get(this.sessionShownKey) === true;
|
|
1963
|
+
if (!shown) {
|
|
1925
1964
|
this.open();
|
|
1965
|
+
}
|
|
1966
|
+
else if (this.shouldPromptIncompleteIntentThisSession()) {
|
|
1967
|
+
this.markIncompleteIntentPrompted();
|
|
1968
|
+
this.open();
|
|
1969
|
+
}
|
|
1926
1970
|
}
|
|
1927
1971
|
break;
|
|
1928
1972
|
}
|
|
@@ -1941,11 +1985,6 @@ const SallaBulletDelivery = class {
|
|
|
1941
1985
|
Salla.event.off("bullet-delivery::close", this.closeHandler);
|
|
1942
1986
|
this.closeHandler = null;
|
|
1943
1987
|
}
|
|
1944
|
-
if (this.guestLoginSyncHandler) {
|
|
1945
|
-
Salla.event.off("login::success", this.guestLoginSyncHandler);
|
|
1946
|
-
Salla.event.off("auth::logged-in", this.guestLoginSyncHandler);
|
|
1947
|
-
this.guestLoginSyncHandler = null;
|
|
1948
|
-
}
|
|
1949
1988
|
if (this.cartItemAddedHandler) {
|
|
1950
1989
|
if (this.useCartEventApi && typeof Salla.cart?.event?.offItemAdded === "function") {
|
|
1951
1990
|
Salla.cart.event.offItemAdded(this.cartItemAddedHandler);
|
|
@@ -1955,6 +1994,27 @@ const SallaBulletDelivery = class {
|
|
|
1955
1994
|
}
|
|
1956
1995
|
this.cartItemAddedHandler = null;
|
|
1957
1996
|
}
|
|
1997
|
+
if (this.cartSubmittingHandler) {
|
|
1998
|
+
if (typeof Salla.cart?.event?.offSubmitting === "function") {
|
|
1999
|
+
Salla.cart.event.offSubmitting(this.cartSubmittingHandler);
|
|
2000
|
+
}
|
|
2001
|
+
else {
|
|
2002
|
+
Salla.event.off("cart::submitting", this.cartSubmittingHandler);
|
|
2003
|
+
}
|
|
2004
|
+
this.cartSubmittingHandler = null;
|
|
2005
|
+
}
|
|
2006
|
+
if (this.authLoggedInHandler) {
|
|
2007
|
+
Salla.event.off("auth::logged.in", this.authLoggedInHandler);
|
|
2008
|
+
this.authLoggedInHandler = null;
|
|
2009
|
+
}
|
|
2010
|
+
if (this.authLoggedOutHandler) {
|
|
2011
|
+
Salla.event.off("auth::logged.out", this.authLoggedOutHandler);
|
|
2012
|
+
this.authLoggedOutHandler = null;
|
|
2013
|
+
}
|
|
2014
|
+
if (this.loginClosedHandler) {
|
|
2015
|
+
Salla.event.off("salla-login::closed", this.loginClosedHandler);
|
|
2016
|
+
this.loginClosedHandler = null;
|
|
2017
|
+
}
|
|
1958
2018
|
}
|
|
1959
2019
|
};
|
|
1960
2020
|
/**
|