@salla.sa/twilight-components 2.14.409 → 2.14.411

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 (303) hide show
  1. package/dist/cjs/{filepond-_YUCqjZz.js → filepond-DmIUNeKc.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-DETXDGSa.js → filepond-plugin-file-poster-C8AOgqzV.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-DI4aQsrT.js → filepond-plugin-file-validate-size-C1uEA-N4.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-wP_qhQ5Z.js → filepond-plugin-file-validate-type-CAYEi5xZ.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-pumLkq4m.js → filepond-plugin-image-edit-DeGtwB2d.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-Df4RWDaf.js → filepond-plugin-image-exif-orientation-BL0bCUVQ.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-CiISL9NZ.js → filepond-plugin-image-preview-Dih1Wn_X.js} +1 -1
  8. package/dist/cjs/{functions-C8UUG2MA.js → functions-CcFdqlpK.js} +1 -1
  9. package/dist/cjs/{index-Db0Qrz4u.js → index-BBXwu2T_.js} +1 -1
  10. package/dist/cjs/{index-DJN7HwcX.js → index-PZNCZxVn.js} +6 -6
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-add-product-button_4.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
  21. package/dist/cjs/salla-bullet-delivery.cjs.entry.js +2 -2
  22. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-conditional-offer.cjs.entry.js +12 -3
  26. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-delivery-promise.cjs.entry.js +294 -157
  31. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  43. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  44. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  45. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  47. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  48. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-map.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-product-card_2.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
  78. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  93. package/dist/cjs/{tracked-promise-NByRrgen.js → tracked-promise-DDi0ylD7.js} +1 -1
  94. package/dist/cjs/twilight.cjs.js +2 -2
  95. package/dist/cjs/{vanilla-picker-2VN_UkJg.js → vanilla-picker-OPSqChB9.js} +1 -1
  96. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +1 -1
  97. package/dist/collection/components/salla-conditional-offer/salla-conditional-offer.js +11 -2
  98. package/dist/collection/components/salla-delivery-promise/delivery-promise-api.js +40 -0
  99. package/dist/collection/components/salla-delivery-promise/delivery-promise-city-filter.js +11 -0
  100. package/dist/collection/components/salla-delivery-promise/delivery-promise-intent.js +55 -0
  101. package/dist/collection/components/salla-delivery-promise/delivery-promise-labels.js +39 -0
  102. package/dist/collection/components/salla-delivery-promise/salla-delivery-promise.js +175 -167
  103. package/dist/components/index.js +2 -2
  104. package/dist/components/salla-bullet-delivery.js +1 -1
  105. package/dist/components/salla-conditional-offer.js +11 -2
  106. package/dist/components/salla-delivery-promise.js +324 -165
  107. package/dist/esm/{filepond-C_gsIK2H.js → filepond-905U04xY.js} +1 -1
  108. package/dist/esm/{filepond-plugin-file-poster-BBBLzUWp.js → filepond-plugin-file-poster-BWkARu_j.js} +1 -1
  109. package/dist/esm/{filepond-plugin-file-validate-size-hafSzBsP.js → filepond-plugin-file-validate-size-C0PJYzhi.js} +1 -1
  110. package/dist/esm/{filepond-plugin-file-validate-type-DEKO_1D3.js → filepond-plugin-file-validate-type-Bglz2iC6.js} +1 -1
  111. package/dist/esm/{filepond-plugin-image-edit-DfPaLALg.js → filepond-plugin-image-edit-3aH_4pIL.js} +1 -1
  112. package/dist/esm/{filepond-plugin-image-exif-orientation-CjK9SG2x.js → filepond-plugin-image-exif-orientation-B1h3s1nQ.js} +1 -1
  113. package/dist/esm/{filepond-plugin-image-preview-BEbkyXKY.js → filepond-plugin-image-preview-CAiiia6W.js} +1 -1
  114. package/dist/esm/{functions-DUlq3N7K.js → functions-GzuwX5HS.js} +1 -1
  115. package/dist/esm/{index-CNVLmZO5.js → index-rIbWLXjW.js} +6 -6
  116. package/dist/esm/{index-DgbtFfph.js → index-xT-Vt0D7.js} +1 -1
  117. package/dist/esm/loader.js +3 -3
  118. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  119. package/dist/esm/salla-accordion_6.entry.js +1 -1
  120. package/dist/esm/salla-add-product-button_4.entry.js +1 -1
  121. package/dist/esm/salla-advertisement.entry.js +1 -1
  122. package/dist/esm/salla-alert_2.entry.js +1 -1
  123. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  124. package/dist/esm/salla-apps-icons.entry.js +1 -1
  125. package/dist/esm/salla-badge.entry.js +1 -1
  126. package/dist/esm/salla-booking-field_7.entry.js +10 -10
  127. package/dist/esm/salla-bullet-delivery.entry.js +2 -2
  128. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  129. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  130. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  131. package/dist/esm/salla-conditional-offer.entry.js +12 -3
  132. package/dist/esm/salla-contacts.entry.js +1 -1
  133. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  134. package/dist/esm/salla-count-down.entry.js +1 -1
  135. package/dist/esm/salla-custom-fields.entry.js +1 -1
  136. package/dist/esm/salla-delivery-promise.entry.js +294 -157
  137. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  138. package/dist/esm/salla-filters-widget.entry.js +1 -1
  139. package/dist/esm/salla-filters.entry.js +1 -1
  140. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  141. package/dist/esm/salla-gifting.entry.js +1 -1
  142. package/dist/esm/salla-hook.entry.js +1 -1
  143. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  144. package/dist/esm/salla-installment.entry.js +1 -1
  145. package/dist/esm/salla-list-tile.entry.js +1 -1
  146. package/dist/esm/salla-localization-modal.entry.js +1 -1
  147. package/dist/esm/salla-login-modal.entry.js +1 -1
  148. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  149. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  150. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  151. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  152. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  153. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  154. package/dist/esm/salla-loyalty.entry.js +1 -1
  155. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  156. package/dist/esm/salla-map.entry.js +1 -1
  157. package/dist/esm/salla-menu.entry.js +1 -1
  158. package/dist/esm/salla-metadata.entry.js +1 -1
  159. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  160. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  161. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  162. package/dist/esm/salla-notification-item.entry.js +1 -1
  163. package/dist/esm/salla-notifications.entry.js +1 -1
  164. package/dist/esm/salla-offer-modal.entry.js +1 -1
  165. package/dist/esm/salla-offer.entry.js +1 -1
  166. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  167. package/dist/esm/salla-order-details-options.entry.js +1 -1
  168. package/dist/esm/salla-order-details.entry.js +1 -1
  169. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  170. package/dist/esm/salla-order-edit.entry.js +1 -1
  171. package/dist/esm/salla-order-summary.entry.js +1 -1
  172. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  173. package/dist/esm/salla-orders.entry.js +1 -1
  174. package/dist/esm/salla-payments.entry.js +1 -1
  175. package/dist/esm/salla-placeholder.entry.js +1 -1
  176. package/dist/esm/salla-price-range.entry.js +1 -1
  177. package/dist/esm/salla-product-card_2.entry.js +1 -1
  178. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  179. package/dist/esm/salla-products-list.entry.js +1 -1
  180. package/dist/esm/salla-progress-bar.entry.js +1 -1
  181. package/dist/esm/salla-quick-order.entry.js +1 -1
  182. package/dist/esm/salla-rating-modal.entry.js +1 -1
  183. package/dist/esm/salla-reward-action_4.entry.js +3 -3
  184. package/dist/esm/salla-scopes.entry.js +1 -1
  185. package/dist/esm/salla-search.entry.js +1 -1
  186. package/dist/esm/salla-skeleton.entry.js +1 -1
  187. package/dist/esm/salla-slider.entry.js +1 -1
  188. package/dist/esm/salla-social-share.entry.js +1 -1
  189. package/dist/esm/salla-social.entry.js +1 -1
  190. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  191. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  192. package/dist/esm/salla-tooltip.entry.js +1 -1
  193. package/dist/esm/salla-trust-badges.entry.js +1 -1
  194. package/dist/esm/salla-user-menu.entry.js +1 -1
  195. package/dist/esm/salla-user-profile.entry.js +1 -1
  196. package/dist/esm/salla-user-settings.entry.js +1 -1
  197. package/dist/esm/salla-verify.entry.js +1 -1
  198. package/dist/esm/salla-wallet.entry.js +1 -1
  199. package/dist/esm/{tracked-promise-XIu_8oOZ.js → tracked-promise-BQ3oDpFo.js} +1 -1
  200. package/dist/esm/twilight.js +3 -3
  201. package/dist/esm/{vanilla-picker-BQQSG79j.js → vanilla-picker-Cv_dc6oT.js} +1 -1
  202. package/dist/twilight/{p-f27157cd.entry.js → p-03327bdb.entry.js} +1 -1
  203. package/dist/twilight/{p-8dcdc70a.entry.js → p-0362115c.entry.js} +1 -1
  204. package/dist/twilight/{p-7c8dcb34.entry.js → p-05618953.entry.js} +1 -1
  205. package/dist/twilight/{p-41e6423e.entry.js → p-09de8e38.entry.js} +1 -1
  206. package/dist/twilight/{p-f878fb20.entry.js → p-0a39c576.entry.js} +1 -1
  207. package/dist/twilight/{p-c705cacb.entry.js → p-0ad7c855.entry.js} +1 -1
  208. package/dist/twilight/{p-fa9ef9b1.entry.js → p-0c751ad3.entry.js} +1 -1
  209. package/dist/twilight/{p-8c2279bc.entry.js → p-0d04fb8c.entry.js} +1 -1
  210. package/dist/twilight/{p-9904bede.entry.js → p-15a53fe6.entry.js} +1 -1
  211. package/dist/twilight/{p-ef601fe4.entry.js → p-1716e7bf.entry.js} +1 -1
  212. package/dist/twilight/{p-5a19f60e.entry.js → p-17bc3083.entry.js} +1 -1
  213. package/dist/twilight/{p-11702812.entry.js → p-18b593a9.entry.js} +1 -1
  214. package/dist/twilight/{p-a22dc765.entry.js → p-1da1f13f.entry.js} +1 -1
  215. package/dist/twilight/{p-1f73b5f3.entry.js → p-24216a35.entry.js} +1 -1
  216. package/dist/twilight/{p-0f233258.entry.js → p-2a45676f.entry.js} +1 -1
  217. package/dist/twilight/{p-d8a26e22.entry.js → p-3134ec55.entry.js} +1 -1
  218. package/dist/twilight/{p-20e35224.entry.js → p-31a5bd84.entry.js} +1 -1
  219. package/dist/twilight/{p-cc83a6ac.entry.js → p-38b0d747.entry.js} +1 -1
  220. package/dist/twilight/{p-34e6f981.entry.js → p-4597e9a0.entry.js} +1 -1
  221. package/dist/twilight/{p-b9e80f97.entry.js → p-464ebb66.entry.js} +1 -1
  222. package/dist/twilight/{p-7bdce00d.entry.js → p-49457497.entry.js} +1 -1
  223. package/dist/twilight/{p-7d16d5b8.entry.js → p-4a549dd4.entry.js} +1 -1
  224. package/dist/twilight/{p-3c4026ad.entry.js → p-4aacfcb8.entry.js} +1 -1
  225. package/dist/twilight/{p-57eea6b7.entry.js → p-4c527044.entry.js} +1 -1
  226. package/dist/twilight/{p-ceeb2973.entry.js → p-56f8e93f.entry.js} +1 -1
  227. package/dist/twilight/{p-34ea3d80.entry.js → p-57a1bd5e.entry.js} +1 -1
  228. package/dist/twilight/{p-cb6cb968.entry.js → p-5c3711fb.entry.js} +1 -1
  229. package/dist/twilight/{p-92cfb983.entry.js → p-5f08ca5c.entry.js} +1 -1
  230. package/dist/twilight/{p-bcff0988.entry.js → p-62a8bf31.entry.js} +1 -1
  231. package/dist/twilight/{p-c7c54f82.entry.js → p-6477aa16.entry.js} +1 -1
  232. package/dist/twilight/{p-9b745575.entry.js → p-67ec0369.entry.js} +1 -1
  233. package/dist/twilight/{p-d114b843.entry.js → p-6c84e2a0.entry.js} +1 -1
  234. package/dist/twilight/{p-c4ab3a40.entry.js → p-70b821e0.entry.js} +1 -1
  235. package/dist/twilight/{p-263a896f.entry.js → p-70e21348.entry.js} +1 -1
  236. package/dist/twilight/{p-a413523f.entry.js → p-7179b561.entry.js} +1 -1
  237. package/dist/twilight/{p-18725939.entry.js → p-746b703c.entry.js} +1 -1
  238. package/dist/twilight/{p-19a87a29.entry.js → p-78647833.entry.js} +1 -1
  239. package/dist/twilight/{p-7ddaeea0.entry.js → p-78bcabea.entry.js} +1 -1
  240. package/dist/twilight/{p-96cab303.entry.js → p-7ac1d258.entry.js} +1 -1
  241. package/dist/twilight/{p-1ed43874.entry.js → p-7dd1b438.entry.js} +1 -1
  242. package/dist/twilight/{p-3a1b2bef.entry.js → p-7ea9101c.entry.js} +1 -1
  243. package/dist/twilight/{p-aa4ba8d7.entry.js → p-80adbd86.entry.js} +1 -1
  244. package/dist/twilight/{p-20ac2718.entry.js → p-8afeb013.entry.js} +1 -1
  245. package/dist/twilight/{p-f8f6c6dc.entry.js → p-8b5ab33f.entry.js} +1 -1
  246. package/dist/twilight/{p-DPY7gSSB.js → p-8oz_tYCT.js} +1 -1
  247. package/dist/twilight/{p-14e6815f.entry.js → p-9020d179.entry.js} +1 -1
  248. package/dist/twilight/{p-8374dc0e.entry.js → p-92863280.entry.js} +1 -1
  249. package/dist/twilight/{p-bd70bbb8.entry.js → p-941e5a4a.entry.js} +1 -1
  250. package/dist/twilight/{p-f15653a8.entry.js → p-98862c7d.entry.js} +1 -1
  251. package/dist/twilight/{p-abaea280.entry.js → p-9adacf19.entry.js} +1 -1
  252. package/dist/twilight/{p-a38d4343.entry.js → p-9b289072.entry.js} +1 -1
  253. package/dist/twilight/{p-306e7b36.entry.js → p-9f597738.entry.js} +1 -1
  254. package/dist/twilight/{p-d12388a3.entry.js → p-9faa8a9e.entry.js} +1 -1
  255. package/dist/twilight/{p-BtX1c92T.js → p-B5aVfdOq.js} +1 -1
  256. package/dist/twilight/{p-vyrufVPp.js → p-B6nHsUmY.js} +1 -1
  257. package/dist/twilight/{p-ZcLtdl4h.js → p-BEG98TtY.js} +1 -1
  258. package/dist/twilight/{p-B2zrudLY.js → p-CTLj8xU3.js} +1 -1
  259. package/dist/twilight/{p-cvi2AidY.js → p-D-wDhUx5.js} +1 -1
  260. package/dist/twilight/{p-ZtftOSrB.js → p-D0khSRlI.js} +1 -1
  261. package/dist/twilight/{p-BwITjP3T.js → p-_9i6OtFf.js} +1 -1
  262. package/dist/twilight/{p-yGPVu3Cw.js → p-_uYeO1XY.js} +1 -1
  263. package/dist/twilight/{p-6032aa21.entry.js → p-a0c775b0.entry.js} +1 -1
  264. package/dist/twilight/{p-0039bfa0.entry.js → p-a492282a.entry.js} +1 -1
  265. package/dist/twilight/{p-53a239b8.entry.js → p-a5a4a9c4.entry.js} +1 -1
  266. package/dist/twilight/{p-2706d0ec.entry.js → p-a9f516c8.entry.js} +1 -1
  267. package/dist/twilight/p-aad3c860.entry.js +4 -0
  268. package/dist/twilight/{p-0dd8797a.entry.js → p-b003a630.entry.js} +1 -1
  269. package/dist/twilight/{p-D0Ft2F4m.js → p-ba7hQHgb.js} +1 -1
  270. package/dist/twilight/{p-d0f3a488.entry.js → p-c2c428e7.entry.js} +1 -1
  271. package/dist/twilight/{p-92bac59b.entry.js → p-c3087e4b.entry.js} +1 -1
  272. package/dist/twilight/{p-25332ded.entry.js → p-c39c381b.entry.js} +1 -1
  273. package/dist/twilight/{p-31794b61.entry.js → p-c8dedc2d.entry.js} +1 -1
  274. package/dist/twilight/{p-f0e920fb.entry.js → p-c9e78561.entry.js} +1 -1
  275. package/dist/twilight/{p-4bb7bbbe.entry.js → p-ca62e17c.entry.js} +1 -1
  276. package/dist/twilight/{p-d2b898e8.entry.js → p-cb77c16b.entry.js} +1 -1
  277. package/dist/twilight/{p-85604eb3.entry.js → p-cc551a73.entry.js} +1 -1
  278. package/dist/twilight/{p-110474f8.entry.js → p-d218c2ff.entry.js} +1 -1
  279. package/dist/twilight/{p-ad5791fe.entry.js → p-d29c6154.entry.js} +1 -1
  280. package/dist/twilight/{p-6d305158.entry.js → p-d680ef32.entry.js} +1 -1
  281. package/dist/twilight/{p-c04b664d.entry.js → p-d6b4621a.entry.js} +1 -1
  282. package/dist/twilight/{p-88e3d40c.entry.js → p-d950df54.entry.js} +1 -1
  283. package/dist/twilight/{p-dbd3f746.entry.js → p-dcbd52a9.entry.js} +1 -1
  284. package/dist/twilight/{p-d872a471.entry.js → p-dde28f2e.entry.js} +1 -1
  285. package/dist/twilight/{p-b6deb4a4.entry.js → p-df55b402.entry.js} +1 -1
  286. package/dist/twilight/{p-410569ac.entry.js → p-dfa1ddc1.entry.js} +1 -1
  287. package/dist/twilight/{p-3477d272.entry.js → p-dfeeb15e.entry.js} +1 -1
  288. package/dist/twilight/{p-cdb79b26.entry.js → p-e37fe440.entry.js} +1 -1
  289. package/dist/twilight/{p-008d5700.entry.js → p-f2203ac6.entry.js} +1 -1
  290. package/dist/twilight/{p-aae40c4f.entry.js → p-fb9806d9.entry.js} +1 -1
  291. package/dist/twilight/{p-107fb612.entry.js → p-fda57a16.entry.js} +1 -1
  292. package/dist/twilight/{p-b8320f71.entry.js → p-ffeb8d66.entry.js} +1 -1
  293. package/dist/twilight/{p-DzkWqggv.js → p-l3RnLhEs.js} +1 -1
  294. package/dist/twilight/{p-CNVLmZO5.js → p-rIbWLXjW.js} +1 -1
  295. package/dist/twilight/twilight.esm.js +1 -1
  296. package/dist/types/components/salla-delivery-promise/delivery-promise-api.d.ts +8 -0
  297. package/dist/types/components/salla-delivery-promise/delivery-promise-city-filter.d.ts +3 -0
  298. package/dist/types/components/salla-delivery-promise/delivery-promise-intent.d.ts +18 -0
  299. package/dist/types/components/salla-delivery-promise/delivery-promise-labels.d.ts +8 -0
  300. package/dist/types/components/salla-delivery-promise/interfaces.d.ts +16 -7
  301. package/dist/types/components/salla-delivery-promise/salla-delivery-promise.d.ts +31 -33
  302. package/package.json +5 -5
  303. package/dist/twilight/p-bfbae3a8.entry.js +0 -4
@@ -1,111 +1,269 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host, a as getElement } from './index-CNVLmZO5.js';
4
+ import { r as registerInstance, h, H as Host, a as getElement } from './index-rIbWLXjW.js';
5
+
6
+ const DEBUG_KEY = 'salla-delivery-promise-debug';
7
+ function log(message, data) {
8
+ if (localStorage.getItem(DEBUG_KEY)) {
9
+ data !== undefined ? console.log(message, data) : console.log(message);
10
+ }
11
+ }
12
+ /** Fetch available cities for a product's delivery promises. */
13
+ async function fetchCities(productId) {
14
+ log('fetchCities start', { productId });
15
+ const response = await salla.api.request(salla.url.api(`products/${productId}/delivery-promises/cities`));
16
+ if (!response.success || !Array.isArray(response.data) || response.data.length === 0) {
17
+ log('fetchCities: no data', { response });
18
+ return { cities: [], preselected: undefined };
19
+ }
20
+ const preselected = response.data.find((c) => c.is_selected);
21
+ log('fetchCities success', { count: response.data.length, preselected });
22
+ return { cities: response.data, preselected };
23
+ }
24
+ /** Fetch the delivery promise message for a given city or branch. */
25
+ async function fetchDeliveryMessage(productId, id, optionType, isLoginCycleEnabled) {
26
+ log('fetchDeliveryMessage start', { productId, id, optionType });
27
+ let queryString = '';
28
+ if (optionType === 'city' && !isLoginCycleEnabled) {
29
+ queryString = `?reference_id=${id}`;
30
+ }
31
+ else {
32
+ queryString = `?reference_id=${id}&reference_type=${optionType}`;
33
+ }
34
+ const response = (await salla.api.withoutNotifier(() => salla.api.request(salla.url.api(`products/${productId}/delivery-promises${queryString}`))));
35
+ if (!response.success) {
36
+ log('fetchDeliveryMessage error', { response });
37
+ throw new Error(response.error?.message || 'Failed to fetch delivery promise');
38
+ }
39
+ const message = response.data?.message?.trim();
40
+ log('fetchDeliveryMessage success', { message });
41
+ return message || null;
42
+ }
43
+
44
+ /** Filters cities by Arabic/English name (used inside the city-change modal). */
45
+ function filterCitiesForModal(cities, query) {
46
+ const q = query.trim().toLowerCase();
47
+ if (!q) {
48
+ return [...cities];
49
+ }
50
+ return cities.filter(city => city.name.toLowerCase().includes(q) || (city.name_en || '').toLowerCase().includes(q));
51
+ }
52
+
53
+ const INTENT_KEY = 'bullet_delivery_intent';
54
+ function getIntentStorage() {
55
+ const rememberLastSession = Boolean(salla.config.get('store.settings.bullet_delivery.settings.remember_last_session'));
56
+ return rememberLastSession ? salla.storage.store : salla.storage.session;
57
+ }
58
+ function getStoredIntent() {
59
+ const raw = getIntentStorage().get(INTENT_KEY);
60
+ return raw && typeof raw === 'object' ? raw : null;
61
+ }
62
+ /** Resolve the stored intent into a city or branch selection. Returns null when no usable intent. */
63
+ function resolveIntent() {
64
+ const intent = getStoredIntent();
65
+ if (!intent)
66
+ return null;
67
+ if (intent.type === 'address') {
68
+ const city = intent.address_details?.city;
69
+ const cityId = city?.id != null ? Number(city.id) : intent.city_id != null ? Number(intent.city_id) : null;
70
+ const cityName = city?.name?.trim() || '';
71
+ if (cityId != null) {
72
+ return { type: 'address', option: { id: cityId, name: cityName } };
73
+ }
74
+ return null;
75
+ }
76
+ if (intent.type === 'branch') {
77
+ const branchId = intent.branch_id != null
78
+ ? Number(intent.branch_id)
79
+ : intent.branch_details?.id != null
80
+ ? Number(intent.branch_details.id)
81
+ : null;
82
+ const branchName = intent.branch_details?.name?.trim() || '';
83
+ if (branchId != null) {
84
+ return { type: 'branch', option: { id: branchId, name: branchName } };
85
+ }
86
+ return null;
87
+ }
88
+ return null;
89
+ }
90
+ /** Build the payload for opening the bullet delivery modal with preselection. */
91
+ function buildBulletOpenPayload() {
92
+ const intent = getStoredIntent();
93
+ const payload = {};
94
+ if (intent?.type === 'address' && intent.address_id != null) {
95
+ payload.preselected_address_id = Number(intent.address_id);
96
+ }
97
+ if (intent?.type === 'branch') {
98
+ const branchId = intent.branch_id ?? intent.branch_details?.id;
99
+ if (branchId != null) {
100
+ payload.preselected_branch_id = Number(branchId);
101
+ }
102
+ }
103
+ return payload;
104
+ }
105
+
106
+ const DEFAULT_LABELS = {
107
+ deliveryTo: 'توصيل إلى',
108
+ pickupFromBranch: 'الاستلام من فرع',
109
+ noResults: 'لا توجد نتائج',
110
+ selectCity: 'اختر المدينة',
111
+ changeCityTitle: 'تغيير المدينة',
112
+ changeCitySubtitle: '',
113
+ cityFieldLabel: 'المدينة',
114
+ modalSearchPlaceholder: 'ابحث عن مدينة',
115
+ confirmAddress: 'تأكيد العنوان',
116
+ errorDeliveryPromise: 'لا يتوفر وعد تسليم لهذه المدينة',
117
+ errorPickupPromise: 'لا يتوفر وعد تسليم لهذا الفرع',
118
+ };
119
+ function loadLabels() {
120
+ return {
121
+ deliveryTo: salla.lang.getWithDefault('pages.products.promise_deliver_to', DEFAULT_LABELS.deliveryTo),
122
+ pickupFromBranch: salla.lang.getWithDefault('pages.products.promise_pickup_from_branch', DEFAULT_LABELS.pickupFromBranch),
123
+ noResults: salla.lang.getWithDefault('common.elements.no_options', DEFAULT_LABELS.noResults),
124
+ selectCity: salla.lang.getWithDefault('common.elements.select_city', DEFAULT_LABELS.selectCity),
125
+ changeCityTitle: salla.lang.getWithDefault('pages.products.promise_change_city_title', DEFAULT_LABELS.changeCityTitle),
126
+ changeCitySubtitle: salla.lang.getWithDefault('pages.products.promise_change_city_subtitle', 'قد تتغيّر مدة التوصيل حسب المدينة.'),
127
+ cityFieldLabel: salla.lang.getWithDefault('pages.products.promise_city_field', DEFAULT_LABELS.cityFieldLabel),
128
+ modalSearchPlaceholder: salla.lang.getWithDefault('pages.products.promise_search_city', DEFAULT_LABELS.modalSearchPlaceholder),
129
+ confirmAddress: salla.lang.getWithDefault('pages.checkout.confirm_address', DEFAULT_LABELS.confirmAddress),
130
+ errorDeliveryPromise: salla.lang.getWithDefault('pages.products.promise_delivery_not_available', DEFAULT_LABELS.errorDeliveryPromise),
131
+ errorPickupPromise: salla.lang.getWithDefault('pages.products.promise_pickup_not_available', DEFAULT_LABELS.errorPickupPromise),
132
+ };
133
+ }
134
+ /** Localized city display name (English when available and user language is not Arabic). */
135
+ function getCityDisplayName(city) {
136
+ const lang = salla.config.get('user.language_code');
137
+ if (lang && lang !== 'ar' && city.name_en?.trim()) {
138
+ return city.name_en.trim();
139
+ }
140
+ return city.name;
141
+ }
5
142
 
6
143
  const SallaDeliveryPromise = class {
7
144
  constructor(hostRef) {
8
145
  registerInstance(this, hostRef);
9
- this.cities = [];
10
- this.filteredCities = [];
11
- this.selectedCity = null;
146
+ // ── Feature flags & config ────────────────────────────────────────────
147
+ this.isDeliveryPromiseEnabled = false;
148
+ this.isLoginCycleEnabled = false;
149
+ this.canRender = false;
150
+ // ── Shared display state ──────────────────────────────────────────────
151
+ this.labels = DEFAULT_LABELS;
152
+ this.selectedLabel = null;
12
153
  this.deliveryMessage = null;
13
- this.isLoadingCities = false;
14
- this.isLoadingPromises = false;
15
- this.isDropdownOpen = false;
16
- this.searchQuery = '';
17
154
  this.hasError = false;
18
155
  this.errorMessage = '';
19
- /** i18n labels for city selector only; message comes from BE */
20
- this.labels = {
21
- deliveryTo: 'توصيل إلى',
22
- pickupFromBranch: 'الاستلام من فرع',
23
- searchPlaceholder: 'بحث...',
24
- noResults: 'لا توجد نتائج',
25
- selectCity: 'اختر المدينة',
156
+ this.isLoadingPromises = false;
157
+ // ── Login-cycle state (bullet delivery integration) ───────────────────
158
+ this.selectedCityLoginCycle = null;
159
+ this.selectedBranchLoginCycle = null;
160
+ // ── Standard flow state (city list) ───────────────────────────────────
161
+ this.cities = [];
162
+ this.selectedCity = null;
163
+ this.isLoadingCities = false;
164
+ // ── City-change modal state (non–login-cycle) ─────────────────────────
165
+ this.modalSearchQuery = '';
166
+ this.cityPendingSelection = null;
167
+ this.isCityPopoverOpen = false;
168
+ // ═══════════════════════════════════════════════════════════════════════
169
+ // Login-cycle (bullet delivery) integration
170
+ // ═══════════════════════════════════════════════════════════════════════
171
+ this.onBulletDeliveryConfirmed = () => {
172
+ this.applyBulletIntent();
26
173
  };
27
- this.canRender = false;
28
- this.requiresShipping = false;
29
- /** Used only for API calls, not rendered — no need for @State */
30
- this.productId = undefined;
31
- this.onClickOutside = (e) => {
32
- if (this.host.contains(e.target)) {
33
- return; // click inside component (e.g. search input, city list) — don't close
34
- }
35
- this.isDropdownOpen = false;
36
- window.removeEventListener('click', this.onClickOutside);
174
+ this.handleModalSearchInput = (event) => {
175
+ this.modalSearchQuery = event.target.value;
176
+ this.isCityPopoverOpen = true;
37
177
  };
38
- }
39
- setLabels() {
40
- this.labels = {
41
- deliveryTo: salla.lang.getWithDefault('pages.products.promise_deliver_to', 'توصيل إلى'),
42
- pickupFromBranch: salla.lang.getWithDefault('pages.products.promise_pickup_from_branch', 'الاستلام من فرع'),
43
- searchPlaceholder: salla.lang.getWithDefault('blocks.header.search_placeholder', 'بحث...'),
44
- noResults: salla.lang.getWithDefault('common.elements.no_options', 'لا توجد نتائج'),
45
- selectCity: salla.lang.getWithDefault('common.elements.select_city', 'اختر المدينة'),
178
+ this.handleModalComboboxActivate = () => {
179
+ this.isCityPopoverOpen = true;
46
180
  };
47
- }
48
- logger(message, data) {
49
- if (localStorage.getItem('salla-delivery-promise-debug')) {
50
- if (data) {
51
- console.log(message, data);
181
+ // ═══════════════════════════════════════════════════════════════════════
182
+ // Header click (dispatches to correct flow)
183
+ // ═══════════════════════════════════════════════════════════════════════
184
+ this.handleHeaderClick = (e) => {
185
+ e.stopPropagation();
186
+ if (this.isLoginCycleEnabled) {
187
+ this.openBulletDeliveryModal();
52
188
  }
53
189
  else {
54
- console.log(message);
190
+ void this.openCityChangeModal();
55
191
  }
56
- }
192
+ };
57
193
  }
194
+ // ═══════════════════════════════════════════════════════════════════════
195
+ // Lifecycle
196
+ // ═══════════════════════════════════════════════════════════════════════
58
197
  async componentDidLoad() {
59
198
  await salla.onReady();
60
199
  await salla.lang.onLoaded();
61
- this.setLabels();
62
- this.requiresShipping = salla.url.is_page('product.single') &&
63
- salla.config.get('store.features', []).includes('delivery-promises');
64
- if (this.requiresShipping) {
65
- this.logger('requiresShipping', this.requiresShipping);
66
- this.productId = salla.config.get('page.id');
67
- this.logger('productId', this.productId);
200
+ this.labels = loadLabels();
201
+ this.isDeliveryPromiseEnabled = salla.config.get('store.features', []).includes('delivery-promises');
202
+ this.isLoginCycleEnabled = salla.config.get('store.features', []).includes('bullet-delivery-v2');
203
+ this.productId = salla.config.get('page.id');
204
+ if (!this.isDeliveryPromiseEnabled) {
205
+ this.canRender = false;
206
+ return;
207
+ }
208
+ if (this.isLoginCycleEnabled) {
209
+ this.applyBulletIntent();
210
+ this.canRender = true;
211
+ window.addEventListener('bulletDeliveryConfirmed', this.onBulletDeliveryConfirmed);
68
212
  }
69
213
  else {
70
- this.canRender = false;
71
- this.logger('not requiresShipping', {
72
- is_product_single: salla.url.is_page('product.single'),
73
- includesDeliveryPromises: salla.config.get('store.features', []).includes('delivery-promises')
74
- });
214
+ this.selectedLabel = `${this.labels.deliveryTo} ${this.labels.selectCity}`;
215
+ await this.loadCities();
216
+ }
217
+ }
218
+ disconnectedCallback() {
219
+ window.removeEventListener('bulletDeliveryConfirmed', this.onBulletDeliveryConfirmed);
220
+ }
221
+ applyBulletIntent() {
222
+ const resolved = resolveIntent();
223
+ if (!resolved) {
224
+ this.selectedLabel = `${this.labels.deliveryTo} ${this.labels.selectCity}`;
225
+ this.selectedCityLoginCycle = null;
226
+ this.selectedBranchLoginCycle = null;
227
+ this.deliveryMessage = null;
75
228
  return;
76
229
  }
77
- await this.fetchCities();
230
+ if (resolved.type === 'address') {
231
+ this.selectedCityLoginCycle = resolved.option;
232
+ this.selectedBranchLoginCycle = null;
233
+ this.selectedLabel = `${this.labels.deliveryTo} ${resolved.option.name || this.labels.selectCity}`;
234
+ void this.loadDeliveryMessage(resolved.option.id, 'city');
235
+ }
236
+ else {
237
+ this.selectedBranchLoginCycle = resolved.option;
238
+ this.selectedCityLoginCycle = null;
239
+ this.selectedLabel = `${this.labels.pickupFromBranch} ${resolved.option.name}`;
240
+ void this.loadDeliveryMessage(resolved.option.id, 'branch');
241
+ }
78
242
  }
79
- async fetchCities() {
80
- this.logger('start startfetchCities');
243
+ openBulletDeliveryModal() {
244
+ salla.event.emit('bullet-delivery::open', buildBulletOpenPayload());
245
+ }
246
+ // ═══════════════════════════════════════════════════════════════════════
247
+ // Standard flow (city list, no login cycle)
248
+ // ═══════════════════════════════════════════════════════════════════════
249
+ async loadCities() {
81
250
  this.isLoadingCities = true;
82
251
  this.hasError = false;
83
252
  try {
84
- const response = await salla.api.request(salla.url.api(`products/${this.productId}/delivery-promises/cities`));
85
- if (response.success && Array.isArray(response.data) && response.data.length > 0) {
86
- this.logger('fetchCities success', { cities: response.data });
87
- // Sort cities: explicit cities first (id !== -1), then "Rest of cities" (id === -1)
88
- this.cities = this.sortCities(response.data);
89
- this.filteredCities = [...this.cities];
90
- // First, check if API returns a selected city (is_selected: true)
91
- let cityToSelect = this.cities.find(c => c.is_selected);
92
- if (!cityToSelect) {
93
- this.logger('no selectedCity from API response');
94
- }
95
- else {
96
- this.logger('selectedCity', cityToSelect);
97
- this.selectedCity = cityToSelect;
98
- await this.fetchDeliveryMessage(cityToSelect.id);
99
- }
100
- this.canRender = true;
101
- }
102
- else {
103
- this.logger('no data returned from fetchCities', { response: response });
253
+ const { cities, preselected } = await fetchCities(this.productId);
254
+ if (cities.length === 0) {
104
255
  this.canRender = false;
256
+ return;
105
257
  }
258
+ this.cities = cities;
259
+ if (preselected) {
260
+ this.selectedCity = preselected;
261
+ this.selectedLabel = `${this.labels.deliveryTo} ${getCityDisplayName(preselected)}`;
262
+ await this.loadDeliveryMessage(preselected.id, 'city');
263
+ }
264
+ this.canRender = true;
106
265
  }
107
266
  catch (error) {
108
- this.logger('fetchCities error', { error: error.message });
109
267
  this.hasError = true;
110
268
  this.errorMessage = error.message || 'Failed to load cities';
111
269
  this.canRender = false;
@@ -114,113 +272,92 @@ const SallaDeliveryPromise = class {
114
272
  this.isLoadingCities = false;
115
273
  }
116
274
  }
117
- async fetchDeliveryMessage(cityId) {
118
- this.logger('start fetchDeliveryMessage', { cityId });
275
+ // ═══════════════════════════════════════════════════════════════════════
276
+ // Delivery message (shared by both flows)
277
+ // ═══════════════════════════════════════════════════════════════════════
278
+ async loadDeliveryMessage(id, optionType) {
119
279
  this.isLoadingPromises = true;
120
280
  this.hasError = false;
121
281
  this.deliveryMessage = null;
122
282
  try {
123
- const response = await salla.api.withoutNotifier(() => salla.api.request(salla.url.api(`products/${this.productId}/delivery-promises?city_id=${cityId}`)));
124
- if (response.success && response.data?.message) {
125
- const message = response.data.message.trim();
126
- this.logger('fetchDeliveryMessage success', { message });
127
- this.deliveryMessage = message || null;
128
- }
129
- else {
130
- this.logger('deliveryMessage not valid', { response });
131
- }
283
+ this.deliveryMessage = await fetchDeliveryMessage(this.productId, id, optionType, this.isLoginCycleEnabled);
132
284
  }
133
285
  catch (error) {
134
- this.logger('fetchDeliveryMessage error', { error: error.message });
135
286
  this.hasError = true;
136
- this.errorMessage = error.message || 'Failed to load delivery message';
287
+ this.errorMessage = optionType === 'city' ? this.labels.errorDeliveryPromise : this.labels.errorPickupPromise;
137
288
  }
138
289
  finally {
139
290
  this.isLoadingPromises = false;
140
291
  }
141
292
  }
142
- toggleDropdown(e) {
143
- e?.stopPropagation();
144
- this.isDropdownOpen = !this.isDropdownOpen;
145
- if (this.isDropdownOpen) {
146
- window.addEventListener('click', this.onClickOutside);
147
- if (this.searchInputRef) {
148
- setTimeout(() => this.searchInputRef.focus(), 100);
149
- }
150
- }
151
- else {
152
- window.removeEventListener('click', this.onClickOutside);
153
- }
293
+ // ═══════════════════════════════════════════════════════════════════════
294
+ // City-change modal handlers (non–login-cycle)
295
+ // ═══════════════════════════════════════════════════════════════════════
296
+ async openCityChangeModal() {
297
+ if (!this.cityModalRef)
298
+ return;
299
+ this.cityPendingSelection = null;
300
+ this.modalSearchQuery = '';
301
+ this.isCityPopoverOpen = false;
302
+ await this.cityModalRef.setTitle(this.labels.changeCityTitle);
303
+ await this.cityModalRef.open();
154
304
  }
155
- disconnectedCallback() {
156
- window.removeEventListener('click', this.onClickOutside);
157
- }
158
- /**
159
- * Sort cities: explicit cities first (id !== -1), then "Rest of cities" (id === -1) at the end
160
- */
161
- sortCities(cities) {
162
- return [...cities].sort((a, b) => {
163
- // "Rest of cities" (id === -1) should always be at the end
164
- if (a.id === -1)
165
- return 1;
166
- if (b.id === -1)
167
- return -1;
168
- return 0;
169
- });
170
- }
171
- handleSearch(event) {
172
- const query = event.target.value.toLowerCase();
173
- this.searchQuery = query;
174
- if (query.length > 0) {
175
- this.filteredCities = this.cities.filter(city => city.name.toLowerCase()?.includes(query) ||
176
- (city.name_en || '').toLowerCase()?.includes(query));
177
- }
178
- else {
179
- this.filteredCities = [...this.cities];
180
- }
305
+ handleModalSelectCity(city) {
306
+ this.cityPendingSelection = city;
307
+ this.modalSearchQuery = getCityDisplayName(city);
308
+ this.isCityPopoverOpen = false;
181
309
  }
182
- async selectCity(city) {
183
- this.logger('selectCity', { city: city });
310
+ async handleConfirmCityModal() {
311
+ if (!this.cityPendingSelection) {
312
+ await this.cityModalRef?.close();
313
+ return;
314
+ }
315
+ const city = this.cityPendingSelection;
184
316
  this.selectedCity = city;
185
- this.isDropdownOpen = false;
186
- window.removeEventListener('click', this.onClickOutside);
187
- this.searchQuery = '';
188
- this.filteredCities = [...this.cities];
189
- await this.fetchDeliveryMessage(city.id);
190
- }
191
- renderDropdown() {
192
- return (h("div", { class: "s-delivery-promise-dropdown" }, h("div", { class: "s-delivery-promise-dropdown-search" }, h("i", { class: "sicon-search" }), h("input", { type: "text", placeholder: this.labels.searchPlaceholder, value: this.searchQuery, onInput: (e) => this.handleSearch(e), ref: el => this.searchInputRef = el })), h("div", { class: "s-delivery-promise-dropdown-list" }, this.filteredCities.length === 0 ? (h("div", { class: "s-delivery-promise-dropdown-empty" }, this.labels.noResults)) : (this.filteredCities.map(city => (h("div", { key: city.id, class: `s-delivery-promise-dropdown-item ${this.selectedCity?.id === city.id ? 'selected' : ''}`, onClick: () => this.selectCity(city) }, h("span", { class: "s-delivery-promise-city-name" }, city.name), this.selectedCity?.id === city.id && (h("i", { class: "sicon-check" })))))))));
193
- }
194
- /**
195
- * Skeleton shown during initial city fetch to avoid blank period and layout shift.
196
- * Matches the structure/size of the real content (header + message area).
197
- */
198
- renderInitialLoadingSkeleton() {
317
+ this.selectedLabel = `${this.labels.deliveryTo} ${getCityDisplayName(city)}`;
318
+ await this.loadDeliveryMessage(city.id, 'city');
319
+ await this.cityModalRef?.close();
320
+ }
321
+ // ═══════════════════════════════════════════════════════════════════════
322
+ // Render helpers
323
+ // ═══════════════════════════════════════════════════════════════════════
324
+ renderLoadingSkeleton() {
199
325
  return (h(Host, { class: "s-delivery-promise-wrapper s-delivery-promise-skeleton" }, h("div", { class: "s-delivery-promise-container" }, h("div", { class: "s-delivery-promise-header s-delivery-promise-header-skeleton" }, h("div", { class: "s-delivery-promise-location" }, h("salla-skeleton", { height: "14px", width: "180px" })), h("salla-skeleton", { height: "18px", width: "18px" })), h("div", { class: "s-delivery-promise-loading" }, h("salla-skeleton", { height: "20px", width: "80%" })))));
200
326
  }
201
327
  renderDeliveryMessage() {
202
328
  if (this.isLoadingPromises) {
203
329
  return (h("div", { class: "s-delivery-promise-loading" }, h("salla-skeleton", { height: "20px", width: "80%" })));
204
330
  }
205
- if (!this.deliveryMessage) {
331
+ if (!this.deliveryMessage)
206
332
  return null;
207
- }
208
- return (h("div", { class: "s-delivery-promise-message" }, this.deliveryMessage));
333
+ return h("div", { class: "s-delivery-promise-message" }, this.deliveryMessage);
334
+ }
335
+ renderCityModalBody() {
336
+ const filtered = filterCitiesForModal(this.cities, this.modalSearchQuery);
337
+ return (h("div", { class: "s-delivery-promise-modal-body" }, h("label", { class: "s-delivery-promise-modal-field-label", htmlFor: "s-delivery-promise-modal-search" }, this.labels.cityFieldLabel, h("span", { class: "s-delivery-promise-required", "aria-hidden": "true" }, " *")), h("div", { class: "s-delivery-promise-modal-combobox" }, h("div", { class: "s-delivery-promise-modal-search", onClick: this.handleModalComboboxActivate }, h("i", { class: "sicon-search", "aria-hidden": "true" }), h("input", { id: "s-delivery-promise-modal-search", type: "text", class: "form-input", placeholder: this.labels.modalSearchPlaceholder, value: this.modalSearchQuery, onInput: this.handleModalSearchInput, autocomplete: "off", "aria-autocomplete": "list", "aria-expanded": this.isCityPopoverOpen ? 'true' : 'false', "aria-controls": "s-delivery-promise-modal-listbox" })), h("div", { id: "s-delivery-promise-modal-listbox", class: "s-delivery-promise-modal-popover", role: "listbox", hidden: !this.isCityPopoverOpen }, h("div", { class: "s-delivery-promise-modal-list s-scrollbar" }, filtered.length === 0 ? (h("div", { class: "s-delivery-promise-modal-empty" }, this.labels.noResults)) : (filtered.map(city => (h("button", { key: city.id, type: "button", role: "option", class: {
338
+ 's-delivery-promise-modal-item': true,
339
+ 's-delivery-promise-modal-item--selected': this.cityPendingSelection?.id === city.id,
340
+ }, "aria-selected": this.cityPendingSelection?.id === city.id ? 'true' : 'false', onClick: e => {
341
+ e.stopPropagation();
342
+ this.handleModalSelectCity(city);
343
+ } }, h("span", { class: "s-delivery-promise-modal-item-name" }, city.name), this.cityPendingSelection?.id === city.id ? h("i", { class: "sicon-check", "aria-hidden": "true" }) : null)))))))));
344
+ }
345
+ renderCityChangeModal() {
346
+ if (this.isLoginCycleEnabled)
347
+ return null;
348
+ return (h("salla-modal", { id: "s-delivery-promise-city-modal", ref: el => { this.cityModalRef = el; }, class: "s-delivery-promise-city-modal", isClosable: true, width: "md", "modal-title": this.labels.changeCityTitle, subTitle: this.labels.changeCitySubtitle }, this.renderCityModalBody(), h("salla-button", { slot: "footer", width: "wide", disabled: !this.cityPendingSelection, onClick: () => this.handleConfirmCityModal() }, !this.isLoadingPromises && this.labels.confirmAddress)));
209
349
  }
350
+ // ═══════════════════════════════════════════════════════════════════════
351
+ // Main render
352
+ // ═══════════════════════════════════════════════════════════════════════
210
353
  render() {
211
- // Not on product page or delivery-promises disabled — hide entirely
212
- if (!this.requiresShipping) {
354
+ if (!this.isDeliveryPromiseEnabled)
213
355
  return null;
214
- }
215
- // Initial city fetch: show skeleton to avoid blank period and layout shift
216
- if (this.isLoadingCities) {
217
- return this.renderInitialLoadingSkeleton();
218
- }
219
- // Fetch done but no cities / error — hide
220
- if (!this.canRender || this.cities.length === 0) {
356
+ if (this.isLoadingCities)
357
+ return this.renderLoadingSkeleton();
358
+ if (!this.canRender)
221
359
  return null;
222
- }
223
- return (h(Host, { class: "s-delivery-promise-wrapper" }, h("div", { class: "s-delivery-promise-container" }, h("div", { class: "s-delivery-promise-header", onClick: (e) => this.toggleDropdown(e) }, h("div", { class: "s-delivery-promise-location" }, h("span", { class: "s-delivery-promise-title" }, this.labels.deliveryTo, " ", this.selectedCity?.name || this.labels.selectCity)), h("i", { class: `sicon-keyboard_arrow_down s-delivery-promise-arrow ${this.isDropdownOpen ? 'open' : ''}` })), this.hasError && (h("div", { class: "s-delivery-promise-error" }, this.errorMessage)), this.isDropdownOpen && this.renderDropdown(), !this.hasError && this.renderDeliveryMessage())));
360
+ return (h(Host, { class: "s-delivery-promise-wrapper" }, h("div", { class: "s-delivery-promise-container" }, h("div", { class: "s-delivery-promise-header", onClick: this.handleHeaderClick }, h("div", { class: "s-delivery-promise-location" }, h("span", { class: "s-delivery-promise-title" }, this.selectedLabel)), h("i", { class: `sicon-keyboard_arrow_down s-delivery-promise-arrow` })), this.hasError && h("div", { class: "s-delivery-promise-error" }, this.errorMessage), !this.hasError && this.renderDeliveryMessage()), this.renderCityChangeModal()));
224
361
  }
225
362
  get host() { return getElement(this); }
226
363
  };
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-CNVLmZO5.js';
4
+ import { r as registerInstance, h, H as Host } from './index-rIbWLXjW.js';
5
5
 
6
6
  const sallaEditOrderButtonCss = ":host{display:block}";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-CNVLmZO5.js';
4
+ import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-rIbWLXjW.js';
5
5
  import { H as Helper } from './Helper-DFMXF2_h.js';
6
6
  import { F as FilterOptionTypes } from './interfaces-DL4h2bc3.js';
7
7
  import './anime.es-CgtvEd63.js';
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-CNVLmZO5.js';
4
+ import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-rIbWLXjW.js';
5
5
  import { F as FilterOptionTypes } from './interfaces-DL4h2bc3.js';
6
6
  import { H as Helper } from './Helper-DFMXF2_h.js';
7
7
  import './anime.es-CgtvEd63.js';
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-CNVLmZO5.js';
4
+ import { r as registerInstance, h, H as Host } from './index-rIbWLXjW.js';
5
5
 
6
6
  const SallaFulfillmentMethods = class {
7
7
  constructor(hostRef) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h } from './index-CNVLmZO5.js';
4
+ import { r as registerInstance, h } from './index-rIbWLXjW.js';
5
5
  import { a as anime } from './anime.es-CgtvEd63.js';
6
6
  import { a as arrowLeft } from './arrow-left-BedNk7k1.js';
7
7
  import { S as SICancel } from './cancel-8Tsmrwno.js';
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host, a as getElement } from './index-CNVLmZO5.js';
4
+ import { r as registerInstance, h, H as Host, a as getElement } from './index-rIbWLXjW.js';
5
5
 
6
6
  const SallaHook = class {
7
7
  constructor(hostRef) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host, a as getElement } from './index-CNVLmZO5.js';
4
+ import { r as registerInstance, h, H as Host, a as getElement } from './index-rIbWLXjW.js';
5
5
  import { H as Helper } from './Helper-DFMXF2_h.js';
6
6
  import './anime.es-CgtvEd63.js';
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host, a as getElement } from './index-CNVLmZO5.js';
4
+ import { r as registerInstance, h, H as Host, a as getElement } from './index-rIbWLXjW.js';
5
5
 
6
6
  const sallaInstallmentCss = "salla-installment:empty{display:none}#tabbyPromoWrapper{background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px;border:unset !important;font-weight:500}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--main-text-color);font-size:var(--font-sm);line-height:1.25;padding:20px 20px 20px 115px !important;background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);border:unset !important;font-family:inherit !important;font-weight:500}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.tamara-product-widget .spotii-logo,.spotii-wrapper .spotii-logo{float:left;margin:0 0 0 -75px}.ltr .tamara-product-widget,.ltr .spotii-wrapper{text-align:left;padding:18px 100px 18px 20px !important}.ltr .tamara-product-widget .spotii-logo,.ltr .spotii-wrapper .spotii-logo{float:right;margin:0 -75px 0 0}.ltr .tamara-product-widget .spotii-product-widget,.ltr .spotii-wrapper .spotii-product-widget{text-align:left !important}.spotii-wrapper{margin-bottom:20px}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm) !important;margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px !important;top:35px !important;margin:0 !important;height:24px !important}.ltr .tamara-product-widget .tamara-logo{right:20px !important;left:auto !important}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}.s-installment-mispay-wrapper,.s-installment-madfu-wrapper,.s-installment-emkan-wrapper,.s-installment-rajehi-wrapper{font-size:14px;text-align:right;padding:20px;gap:42px;line-height:22px;color:rgb(0, 0, 0);min-width:100%;box-sizing:border-box;position:relative;background-color:white;border-radius:10px;margin:15px 0;display:flex;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.s-installment-mispay-wrapper:hover,.s-installment-madfu-wrapper:hover,.s-installment-emkan-wrapper:hover,.s-installment-rajehi-wrapper:hover{box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.s-installment-mispay-content,.s-installment-madfu-content,.s-installment-emkan-content,.s-installment-rajehi-content{display:flex;flex-direction:row-reverse;width:100%;justify-content:space-between;align-items:center;gap:1rem}.s-installment-mispay-content-text,.s-installment-madfu-content-text,.s-installment-emkan-content-text,.s-installment-rajehi-content-text{color:var(--main-text-color);font-size:14px;font-weight:500;margin:0 16px 0 0;width:80%;left:14px;text-align:left}.s-installment-mispay-content img,.s-installment-madfu-content img,.s-installment-emkan-content img,.s-installment-rajehi-content img{height:28px;width:70px;display:inline-block;max-height:100%;vertical-align:middle;fill:none;stroke:unset;width:auto}.rtl .s-installment-mispay-content-text,.rtl .s-installment-madfu-content-text,.rtl .s-installment-emkan-content-text,.rtl .s-installment-rajehi-content-text{right:14px;text-align:right;margin:0 0 0 16px}.rtl .s-installment-mispay-content img,.rtl .s-installment-madfu-content img,.rtl .s-installment-emkan-content img,.rtl .s-installment-rajehi-content img{left:14px !important}.ltr .s-installment-mispay-content img,.ltr .s-installment-madfu-content img,.ltr .s-installment-emkan-content img,.ltr .s-installment-rajehi-content img{right:14px !important}.s-installment-rajehi-content img{width:70px !important;height:40px !important}.s-installment-emkan-content img{height:35px !important}";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-CNVLmZO5.js';
4
+ import { r as registerInstance, h, H as Host } from './index-rIbWLXjW.js';
5
5
 
6
6
  const sallaListTileCss = "";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, a as getElement } from './index-CNVLmZO5.js';
4
+ import { r as registerInstance, h, a as getElement } from './index-rIbWLXjW.js';
5
5
 
6
6
  const SallaLocalizationModal = class {
7
7
  constructor(hostRef) {