@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.
Files changed (366) hide show
  1. package/dist/cjs/{filepond-CH0EhqTR.js → filepond-DY8Bk_1p.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-DB_nSU5H.js → filepond-plugin-file-poster-DRBpp2WC.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-DhmLgwAd.js → filepond-plugin-file-validate-size-Ps1G9vOF.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-BP6pXR9l.js → filepond-plugin-file-validate-type-fVUTClJE.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-H28z0oor.js → filepond-plugin-image-edit-Bh4Pqw-q.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-B3aPmsvW.js → filepond-plugin-image-exif-orientation-D_Tfa9YD.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-2UoG7SNa.js → filepond-plugin-image-preview-Bsg4ZULY.js} +1 -1
  8. package/dist/cjs/{index-C0Kew27I.js → index-B99uI20k.js} +6 -2
  9. package/dist/cjs/{index-0Q56lC1x.js → index-DjO53bco.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/salla-accordion-body_3.cjs.entry.js +4 -4
  12. package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
  13. package/dist/cjs/salla-add-product-button_4.cjs.entry.js +3 -3
  14. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-booking-field_7.cjs.entry.js +17 -17
  19. package/dist/cjs/salla-bullet-delivery.cjs.entry.js +248 -188
  20. package/dist/cjs/salla-cart-coupons.cjs.entry.js +251 -0
  21. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +2 -2
  22. package/dist/cjs/salla-comment-form_8.cjs.entry.js +8 -8
  23. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-count-down_2.cjs.entry.js +7 -7
  27. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-filters-widget.cjs.entry.js +3 -3
  29. package/dist/cjs/salla-filters.cjs.entry.js +2 -2
  30. package/dist/cjs/salla-gifting.cjs.entry.js +3 -3
  31. package/dist/cjs/salla-hook.cjs.entry.js +2 -2
  32. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-list-tile.cjs.entry.js +2 -2
  35. package/dist/cjs/salla-localization-modal.cjs.entry.js +2 -2
  36. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +2 -2
  38. package/dist/cjs/salla-loyalty-program.cjs.entry.js +2 -2
  39. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +2 -2
  41. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +4 -4
  44. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +6 -6
  45. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +2 -2
  46. package/dist/cjs/salla-notification-item.cjs.entry.js +2 -2
  47. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-offer-modal.cjs.entry.js +2 -2
  49. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-order-details.cjs.entry.js +2 -2
  53. package/dist/cjs/salla-order-summary.cjs.entry.js +2 -2
  54. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-payments.cjs.entry.js +3 -3
  57. package/dist/cjs/salla-placeholder.cjs.entry.js +2 -2
  58. package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
  59. package/dist/cjs/salla-product-size-guide.cjs.entry.js +3 -3
  60. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-scopes.cjs.entry.js +2 -2
  66. package/dist/cjs/salla-search.cjs.entry.js +6 -6
  67. package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
  68. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
  70. package/dist/cjs/salla-social.cjs.entry.js +2 -2
  71. package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
  72. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
  74. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-user-settings.cjs.entry.js +2 -2
  78. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  80. package/dist/cjs/twilight.cjs.js +2 -2
  81. package/dist/cjs/{vanilla-picker-D_FRjdtf.js → vanilla-picker-DmWOIwng.js} +1 -1
  82. package/dist/collection/collection-manifest.json +1 -0
  83. package/dist/collection/components/salla-bullet-delivery/helpers.js +4 -20
  84. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +244 -168
  85. package/dist/collection/components/salla-cart-coupons/interfaces.js +1 -0
  86. package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.css +0 -0
  87. package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.js +293 -0
  88. package/dist/collection/components/salla-cart-summary/salla-cart-summary.js +1 -1
  89. package/dist/collection/components/salla-color-picker/salla-color-picker.js +1 -1
  90. package/dist/collection/components/salla-comment-form/salla-comment-form.js +1 -1
  91. package/dist/collection/components/salla-comments/salla-comment-item.js +3 -3
  92. package/dist/collection/components/salla-conditional-fields/salla-conditional-fields.js +1 -1
  93. package/dist/collection/components/salla-count-down/salla-count-down.js +1 -1
  94. package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +1 -1
  95. package/dist/collection/components/salla-file-upload/salla-file-upload.js +2 -2
  96. package/dist/collection/components/salla-filters/salla-filters.js +1 -1
  97. package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +2 -2
  98. package/dist/collection/components/salla-gifting/salla-gifting.js +2 -2
  99. package/dist/collection/components/salla-hook/salla-hook.js +1 -1
  100. package/dist/collection/components/salla-list-tile/salla-list-tile.js +1 -1
  101. package/dist/collection/components/salla-loading/salla-loading.js +1 -1
  102. package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +1 -1
  103. package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +1 -1
  104. package/dist/collection/components/salla-loyalty-program/salla-loyalty-program.js +1 -1
  105. package/dist/collection/components/salla-maintenance-alert/salla-maintenance-alert.js +1 -1
  106. package/dist/collection/components/salla-map/salla-map.js +3 -3
  107. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +1 -1
  108. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +2 -2
  109. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +4 -4
  110. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +1 -1
  111. package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +1 -1
  112. package/dist/collection/components/salla-notifications/salla-notification-item.js +1 -1
  113. package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +1 -1
  114. package/dist/collection/components/salla-order-details/salla-order-details.js +1 -1
  115. package/dist/collection/components/salla-order-summary/salla-order-summary.js +1 -1
  116. package/dist/collection/components/salla-payments/salla-payments.js +2 -2
  117. package/dist/collection/components/salla-placeholder/salla-placeholder.js +1 -1
  118. package/dist/collection/components/salla-price-range/salla-price-range.js +2 -2
  119. package/dist/collection/components/salla-product-availability/salla-product-availability.js +1 -1
  120. package/dist/collection/components/salla-product-card/salla-product-card.js +5 -5
  121. package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +2 -2
  122. package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +1 -1
  123. package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +1 -1
  124. package/dist/collection/components/salla-review-card/salla-review-card.js +1 -1
  125. package/dist/collection/components/salla-reviews/salla-reviews.js +1 -1
  126. package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
  127. package/dist/collection/components/salla-scopes/salla-scopes.js +1 -1
  128. package/dist/collection/components/salla-search/salla-search.js +5 -5
  129. package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
  130. package/dist/collection/components/salla-social/salla-social.js +1 -1
  131. package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
  132. package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
  133. package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
  134. package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
  135. package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
  136. package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
  137. package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
  138. package/dist/components/index.js +2 -2
  139. package/dist/components/salla-bullet-delivery.js +247 -187
  140. package/dist/components/salla-cart-coupons.d.ts +11 -0
  141. package/dist/components/salla-cart-coupons.js +287 -0
  142. package/dist/components/salla-cart-summary.js +1 -1
  143. package/dist/components/salla-color-picker2.js +1 -1
  144. package/dist/components/salla-comment-form2.js +1 -1
  145. package/dist/components/salla-comment-item2.js +3 -3
  146. package/dist/components/salla-conditional-fields2.js +1 -1
  147. package/dist/components/salla-count-down2.js +1 -1
  148. package/dist/components/salla-datetime-picker2.js +1 -1
  149. package/dist/components/salla-file-upload2.js +2 -2
  150. package/dist/components/salla-filters-widget2.js +2 -2
  151. package/dist/components/salla-filters.js +1 -1
  152. package/dist/components/salla-gifting.js +2 -2
  153. package/dist/components/salla-hook.js +1 -1
  154. package/dist/components/salla-list-tile2.js +1 -1
  155. package/dist/components/salla-loading2.js +1 -1
  156. package/dist/components/salla-localization-modal.js +1 -1
  157. package/dist/components/salla-loyalty-prize-item.js +1 -1
  158. package/dist/components/salla-loyalty-program.js +1 -1
  159. package/dist/components/salla-maintenance-alert.js +1 -1
  160. package/dist/components/salla-map2.js +3 -3
  161. package/dist/components/salla-multiple-bundle-product-cart2.js +1 -1
  162. package/dist/components/salla-multiple-bundle-product-details2.js +2 -2
  163. package/dist/components/salla-multiple-bundle-product-options-modal2.js +4 -4
  164. package/dist/components/salla-multiple-bundle-product-slider2.js +1 -1
  165. package/dist/components/salla-multiple-bundle-product.js +1 -1
  166. package/dist/components/salla-notification-item2.js +1 -1
  167. package/dist/components/salla-offer-modal.js +1 -1
  168. package/dist/components/salla-order-details.js +1 -1
  169. package/dist/components/salla-order-summary.js +1 -1
  170. package/dist/components/salla-payments.js +2 -2
  171. package/dist/components/salla-placeholder2.js +1 -1
  172. package/dist/components/salla-price-range2.js +2 -2
  173. package/dist/components/salla-product-availability2.js +1 -1
  174. package/dist/components/salla-product-card2.js +5 -5
  175. package/dist/components/salla-product-size-guide.js +2 -2
  176. package/dist/components/salla-quantity-input.js +1 -1
  177. package/dist/components/salla-quick-buy2.js +1 -1
  178. package/dist/components/salla-review-card2.js +1 -1
  179. package/dist/components/salla-reviews-page.js +1 -1
  180. package/dist/components/salla-reviews.js +1 -1
  181. package/dist/components/salla-scopes.js +1 -1
  182. package/dist/components/salla-search.js +5 -5
  183. package/dist/components/salla-skeleton2.js +1 -1
  184. package/dist/components/salla-social-share.js +1 -1
  185. package/dist/components/salla-social.js +1 -1
  186. package/dist/components/salla-tab-content2.js +1 -1
  187. package/dist/components/salla-tab-header2.js +1 -1
  188. package/dist/components/salla-tabs2.js +1 -1
  189. package/dist/components/salla-tel-input2.js +1 -1
  190. package/dist/components/salla-tooltip2.js +1 -1
  191. package/dist/components/salla-user-settings.js +1 -1
  192. package/dist/esm/{filepond-C6DmvP0k.js → filepond-CqDfFTVp.js} +1 -1
  193. package/dist/esm/{filepond-plugin-file-poster-aflPfdvq.js → filepond-plugin-file-poster-Bj5ejqRD.js} +1 -1
  194. package/dist/esm/{filepond-plugin-file-validate-size-2ysTkym4.js → filepond-plugin-file-validate-size-CDa3pirY.js} +1 -1
  195. package/dist/esm/{filepond-plugin-file-validate-type-CvlSQE9k.js → filepond-plugin-file-validate-type-BHJfNcLt.js} +1 -1
  196. package/dist/esm/{filepond-plugin-image-edit-CPNOb0bn.js → filepond-plugin-image-edit-CzuXmnyp.js} +1 -1
  197. package/dist/esm/{filepond-plugin-image-exif-orientation-DSOEX9W9.js → filepond-plugin-image-exif-orientation-Bxdqligt.js} +1 -1
  198. package/dist/esm/{filepond-plugin-image-preview-ZVPoyaGu.js → filepond-plugin-image-preview-DRM_r5yF.js} +1 -1
  199. package/dist/esm/{index-DygKr0gG.js → index-Dbv0I4re.js} +6 -2
  200. package/dist/esm/{index-Dt1F_uJO.js → index-nTW4l4L5.js} +1 -1
  201. package/dist/esm/loader.js +3 -3
  202. package/dist/esm/salla-accordion-body_3.entry.js +4 -4
  203. package/dist/esm/salla-accordion_6.entry.js +2 -2
  204. package/dist/esm/salla-add-product-button_4.entry.js +3 -3
  205. package/dist/esm/salla-advertisement.entry.js +1 -1
  206. package/dist/esm/salla-alert_2.entry.js +1 -1
  207. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  208. package/dist/esm/salla-apps-icons.entry.js +1 -1
  209. package/dist/esm/salla-booking-field_7.entry.js +17 -17
  210. package/dist/esm/salla-bullet-delivery.entry.js +248 -188
  211. package/dist/esm/salla-cart-coupons.entry.js +249 -0
  212. package/dist/esm/salla-cart-item-offers_2.entry.js +2 -2
  213. package/dist/esm/salla-comment-form_8.entry.js +8 -8
  214. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  215. package/dist/esm/salla-contacts.entry.js +1 -1
  216. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  217. package/dist/esm/salla-count-down_2.entry.js +7 -7
  218. package/dist/esm/salla-custom-fields.entry.js +1 -1
  219. package/dist/esm/salla-filters-widget.entry.js +3 -3
  220. package/dist/esm/salla-filters.entry.js +2 -2
  221. package/dist/esm/salla-gifting.entry.js +3 -3
  222. package/dist/esm/salla-hook.entry.js +2 -2
  223. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  224. package/dist/esm/salla-installment.entry.js +1 -1
  225. package/dist/esm/salla-list-tile.entry.js +2 -2
  226. package/dist/esm/salla-localization-modal.entry.js +2 -2
  227. package/dist/esm/salla-login-modal.entry.js +1 -1
  228. package/dist/esm/salla-loyalty-prize-item.entry.js +2 -2
  229. package/dist/esm/salla-loyalty-program.entry.js +2 -2
  230. package/dist/esm/salla-loyalty.entry.js +1 -1
  231. package/dist/esm/salla-maintenance-alert.entry.js +2 -2
  232. package/dist/esm/salla-menu.entry.js +1 -1
  233. package/dist/esm/salla-metadata.entry.js +1 -1
  234. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +4 -4
  235. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +6 -6
  236. package/dist/esm/salla-multiple-bundle-product.entry.js +2 -2
  237. package/dist/esm/salla-notification-item.entry.js +2 -2
  238. package/dist/esm/salla-notifications.entry.js +1 -1
  239. package/dist/esm/salla-offer-modal.entry.js +2 -2
  240. package/dist/esm/salla-offer.entry.js +1 -1
  241. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  242. package/dist/esm/salla-order-details-options.entry.js +1 -1
  243. package/dist/esm/salla-order-details.entry.js +2 -2
  244. package/dist/esm/salla-order-summary.entry.js +2 -2
  245. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  246. package/dist/esm/salla-orders.entry.js +1 -1
  247. package/dist/esm/salla-payments.entry.js +3 -3
  248. package/dist/esm/salla-placeholder.entry.js +2 -2
  249. package/dist/esm/salla-price-range.entry.js +3 -3
  250. package/dist/esm/salla-product-size-guide.entry.js +3 -3
  251. package/dist/esm/salla-products-list.entry.js +1 -1
  252. package/dist/esm/salla-products-slider.entry.js +1 -1
  253. package/dist/esm/salla-progress-bar.entry.js +1 -1
  254. package/dist/esm/salla-quick-order.entry.js +1 -1
  255. package/dist/esm/salla-rating-modal.entry.js +1 -1
  256. package/dist/esm/salla-scopes.entry.js +2 -2
  257. package/dist/esm/salla-search.entry.js +6 -6
  258. package/dist/esm/salla-skeleton.entry.js +2 -2
  259. package/dist/esm/salla-slider.entry.js +1 -1
  260. package/dist/esm/salla-social-share.entry.js +2 -2
  261. package/dist/esm/salla-social.entry.js +2 -2
  262. package/dist/esm/salla-tab-content_3.entry.js +4 -4
  263. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  264. package/dist/esm/salla-tooltip.entry.js +2 -2
  265. package/dist/esm/salla-trust-badges.entry.js +1 -1
  266. package/dist/esm/salla-user-menu.entry.js +1 -1
  267. package/dist/esm/salla-user-profile.entry.js +1 -1
  268. package/dist/esm/salla-user-settings.entry.js +2 -2
  269. package/dist/esm/salla-verify.entry.js +1 -1
  270. package/dist/esm/salla-wallet.entry.js +1 -1
  271. package/dist/esm/twilight.js +3 -3
  272. package/dist/esm/{vanilla-picker-vpLzwiOX.js → vanilla-picker-CYgHVJAF.js} +1 -1
  273. package/dist/twilight/{p-d87a6578.entry.js → p-05911caf.entry.js} +1 -1
  274. package/dist/twilight/{p-f001a716.entry.js → p-07cdbd6f.entry.js} +1 -1
  275. package/dist/twilight/{p-97e204bf.entry.js → p-08702001.entry.js} +1 -1
  276. package/dist/twilight/p-08d98540.entry.js +4 -0
  277. package/dist/twilight/{p-b503ed92.entry.js → p-0c31270e.entry.js} +1 -1
  278. package/dist/twilight/{p-b667c2d4.entry.js → p-0da615ba.entry.js} +1 -1
  279. package/dist/twilight/{p-b17de694.entry.js → p-1706c904.entry.js} +1 -1
  280. package/dist/twilight/{p-abda287b.entry.js → p-1881e1df.entry.js} +1 -1
  281. package/dist/twilight/{p-ba9ea832.entry.js → p-1ab7646d.entry.js} +1 -1
  282. package/dist/twilight/{p-ba2754b0.entry.js → p-1b4cb4f3.entry.js} +1 -1
  283. package/dist/twilight/{p-5609c0a2.entry.js → p-1e58ee3f.entry.js} +1 -1
  284. package/dist/twilight/{p-4c8d6286.entry.js → p-2110682a.entry.js} +1 -1
  285. package/dist/twilight/{p-e3725374.entry.js → p-224c2f65.entry.js} +1 -1
  286. package/dist/twilight/{p-e8562b9e.entry.js → p-258e8407.entry.js} +1 -1
  287. package/dist/twilight/{p-a265395a.entry.js → p-2d089b2b.entry.js} +1 -1
  288. package/dist/twilight/{p-4f0da42e.entry.js → p-31b1f09e.entry.js} +1 -1
  289. package/dist/twilight/p-323012d3.entry.js +4 -0
  290. package/dist/twilight/{p-91c7b197.entry.js → p-34a94492.entry.js} +1 -1
  291. package/dist/twilight/p-34ab1e5c.entry.js +4 -0
  292. package/dist/twilight/{p-6a9c0acd.entry.js → p-3d1043b6.entry.js} +1 -1
  293. package/dist/twilight/{p-8d40cb2a.entry.js → p-416b578d.entry.js} +1 -1
  294. package/dist/twilight/{p-31feb28e.entry.js → p-462c51a2.entry.js} +1 -1
  295. package/dist/twilight/{p-11d1af5a.entry.js → p-4aa4dcec.entry.js} +1 -1
  296. package/dist/twilight/{p-26dbba19.entry.js → p-4bc9bc63.entry.js} +1 -1
  297. package/dist/twilight/{p-d1c0eb72.entry.js → p-543bc44f.entry.js} +1 -1
  298. package/dist/twilight/{p-7c05380e.entry.js → p-58d796a0.entry.js} +1 -1
  299. package/dist/twilight/{p-b8f61fb6.entry.js → p-595983cf.entry.js} +1 -1
  300. package/dist/twilight/{p-e6909519.entry.js → p-5a936889.entry.js} +1 -1
  301. package/dist/twilight/p-6d7d53fa.entry.js +4 -0
  302. package/dist/twilight/{p-b900e4bf.entry.js → p-74a9e4dd.entry.js} +1 -1
  303. package/dist/twilight/{p-7ff1a66d.entry.js → p-7a886993.entry.js} +1 -1
  304. package/dist/twilight/{p-0e06763b.entry.js → p-7d932e81.entry.js} +1 -1
  305. package/dist/twilight/{p-3174a7da.entry.js → p-814a00c6.entry.js} +1 -1
  306. package/dist/twilight/{p-069a93a0.entry.js → p-8465d71e.entry.js} +1 -1
  307. package/dist/twilight/p-876ed9cf.entry.js +4 -0
  308. package/dist/twilight/{p-3306e240.entry.js → p-8a8cc10a.entry.js} +1 -1
  309. package/dist/twilight/p-8b19cac5.entry.js +4 -0
  310. package/dist/twilight/{p-fa071bdf.entry.js → p-8e120858.entry.js} +1 -1
  311. package/dist/twilight/{p-b64af3e6.entry.js → p-926bdbde.entry.js} +1 -1
  312. package/dist/twilight/{p-64aaf5d1.entry.js → p-940c57a3.entry.js} +1 -1
  313. package/dist/twilight/{p-7f5da469.entry.js → p-969f4a67.entry.js} +1 -1
  314. package/dist/twilight/{p-717f98a9.entry.js → p-9722f5ed.entry.js} +1 -1
  315. package/dist/twilight/{p-bf5c3fb6.entry.js → p-9770a33e.entry.js} +1 -1
  316. package/dist/twilight/{p-7e6ac5b6.entry.js → p-99e87c67.entry.js} +1 -1
  317. package/dist/twilight/{p-CckfqYjO.js → p-CQc5Pmlu.js} +1 -1
  318. package/dist/twilight/{p-BlNhJOfK.js → p-CWQNB-G4.js} +1 -1
  319. package/dist/twilight/{p-PRDr-VhL.js → p-Cp5Iu5XS.js} +1 -1
  320. package/dist/twilight/{p-CiQozo5Q.js → p-Ct4jcDIY.js} +1 -1
  321. package/dist/twilight/{p-DBSxANjD.js → p-DL3ab5Vo.js} +1 -1
  322. package/dist/twilight/{p-DygKr0gG.js → p-Dbv0I4re.js} +1 -1
  323. package/dist/twilight/{p-kltSiNjL.js → p-DjEHkwKr.js} +1 -1
  324. package/dist/twilight/{p-CU9SaqqL.js → p-Dlb0Gd5v.js} +1 -1
  325. package/dist/twilight/p-a083cc65.entry.js +4 -0
  326. package/dist/twilight/p-a1210656.entry.js +4 -0
  327. package/dist/twilight/{p-15ad8b57.entry.js → p-a19637e3.entry.js} +1 -1
  328. package/dist/twilight/{p-9f92c538.entry.js → p-a28f7329.entry.js} +1 -1
  329. package/dist/twilight/{p-42a88fbe.entry.js → p-ad66730c.entry.js} +1 -1
  330. package/dist/twilight/{p-590aa84f.entry.js → p-aeaa9d52.entry.js} +1 -1
  331. package/dist/twilight/{p-61891d9d.entry.js → p-b176814d.entry.js} +1 -1
  332. package/dist/twilight/{p-db8f128a.entry.js → p-b951691e.entry.js} +1 -1
  333. package/dist/twilight/{p-04b0d99d.entry.js → p-c27bfa01.entry.js} +1 -1
  334. package/dist/twilight/{p-16956de8.entry.js → p-c5a13ec9.entry.js} +1 -1
  335. package/dist/twilight/{p-c18afdd4.entry.js → p-c944064d.entry.js} +1 -1
  336. package/dist/twilight/{p-313de30b.entry.js → p-cdd125b8.entry.js} +1 -1
  337. package/dist/twilight/{p-2f1dc423.entry.js → p-d3f4480c.entry.js} +1 -1
  338. package/dist/twilight/{p-c1d5778e.entry.js → p-d8093d37.entry.js} +1 -1
  339. package/dist/twilight/{p-07aaf6fb.entry.js → p-dbec33e9.entry.js} +1 -1
  340. package/dist/twilight/{p-93fafdb9.entry.js → p-decce284.entry.js} +1 -1
  341. package/dist/twilight/{p-0ac97966.entry.js → p-e2d073fb.entry.js} +1 -1
  342. package/dist/twilight/{p-28c10ffc.entry.js → p-e50916c1.entry.js} +1 -1
  343. package/dist/twilight/{p-d46b9b12.entry.js → p-ecdb3842.entry.js} +1 -1
  344. package/dist/twilight/{p-01cd6efd.entry.js → p-ef9c28da.entry.js} +1 -1
  345. package/dist/twilight/{p-64da3ca2.entry.js → p-f265dd49.entry.js} +1 -1
  346. package/dist/twilight/{p-e294f075.entry.js → p-f51c98c3.entry.js} +1 -1
  347. package/dist/twilight/p-f5465c7d.entry.js +4 -0
  348. package/dist/twilight/{p-4329e96a.entry.js → p-f5bf4c88.entry.js} +1 -1
  349. package/dist/twilight/{p-1dac71bd.entry.js → p-fdc30e0c.entry.js} +1 -1
  350. package/dist/twilight/{p-BqgMCU7i.js → p-jBYzSajd.js} +1 -1
  351. package/dist/twilight/{p-DxwvrO7V.js → p-njEAbf-H.js} +1 -1
  352. package/dist/twilight/twilight.esm.js +1 -1
  353. package/dist/types/components/salla-bullet-delivery/helpers.d.ts +1 -3
  354. package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +19 -16
  355. package/dist/types/components/salla-cart-coupons/interfaces.d.ts +26 -0
  356. package/dist/types/components/salla-cart-coupons/salla-cart-coupons.d.ts +39 -0
  357. package/dist/types/components.d.ts +19 -0
  358. package/package.json +5 -5
  359. package/dist/twilight/p-1570c69c.entry.js +0 -4
  360. package/dist/twilight/p-72dfb078.entry.js +0 -4
  361. package/dist/twilight/p-7725e637.entry.js +0 -4
  362. package/dist/twilight/p-7e6cc902.entry.js +0 -4
  363. package/dist/twilight/p-a5a159b8.entry.js +0 -4
  364. package/dist/twilight/p-d7440521.entry.js +0 -4
  365. package/dist/twilight/p-ee30137a.entry.js +0 -4
  366. 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-C0Kew27I.js');
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
- return !!(c && city && (!isSaudiArabia(code) || d));
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 = "bullet_delivery_shown_this_session";
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
- // Check login status
472
- const userType = Salla.config.get("user.type");
473
- this.isLoggedIn = userType !== "guest";
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
- removeStoredIntent() {
585
- this.getIntentStorage().remove(this.intentStorageKey);
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
- return !!Salla.storage.session.get(this.sessionShownKey);
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
- Salla.storage.session.set(this.sessionShownKey, true);
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: update session storage for guest prefill on next visit
1422
- // When session address was confirmed, remove intent so logout shows a reset form
1423
- if (usedSessionAddress) {
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-loading", { size: "16", width: "3" })));
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", null, index.h("salla-loading", { size: "md" })));
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 sessionAddressTitle = hasSessionAddress && intent?.address_details
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
- intent.address_details.country.id,
1701
- intent.address_details.city.id,
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: sessionAddressTitle,
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 = (builtLine2 || address.formatted?.address_two) ?? "";
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-loading", { size: "sm" })) : (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))));
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
- if (this.hasBeenShownThisSession())
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 = !intent
1857
- ? Salla.lang.get("common.titles.shipping")
1858
- : intent.type === "branch"
1859
- ? `${Salla.lang.get("mobile_app.strings.pickup")} ${Salla.lang.get("common.elements.from")} ${trunc(intent.branch_details?.name, 20)}`
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: '5d79f6404692b4a68504770a54f46c9e5161e533', class: "s-bullet-delivery" }, index.h("salla-modal", { key: 'f123012f8593e20eeb14ebf59fc8dc5af9bbe12b', ref: (modal) => {
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
- Salla.storage.session.get(this.sessionShownKey) !== true &&
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
  /**