@salla.sa/twilight-components 3.0.28 → 3.0.29

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 (351) hide show
  1. package/dist/cjs/{Helper-D5nuQnlA.js → Helper-DU3zZ7Qr.js} +1 -1
  2. package/dist/cjs/{filepond-C4YwUSjY.js → filepond-Bq-ERE2c.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-poster-B-m6bwrO.js → filepond-plugin-file-poster-C2ltYy9Z.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-size-CmLAuKK8.js → filepond-plugin-file-validate-size-BygSYF-k.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-file-validate-type-HAq2ahg2.js → filepond-plugin-file-validate-type-B_PLqGws.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-edit-WPZzSlfF.js → filepond-plugin-image-edit-BQ1nPI5z.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-exif-orientation-DwRyC-Iy.js → filepond-plugin-image-exif-orientation-BQbCEIyF.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-preview-Bva7TPZg.js → filepond-plugin-image-preview-7RqoxYqp.js} +1 -1
  9. package/dist/cjs/{index-CpC602lV.js → index-CMIQ0eTF.js} +2 -2
  10. package/dist/cjs/{intlTelInput-xxeZCkBx.js → intlTelInput-BqtVcUx9.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +2 -2
  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-applied-filters.cjs.entry.js +2 -2
  19. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +11 -11
  21. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-comment-form_9.cjs.entry.js +2 -2
  30. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters-widget.cjs.entry.js +2 -2
  38. package/dist/cjs/salla-filters.cjs.entry.js +2 -2
  39. package/dist/cjs/salla-free-shipping-banner.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-free-shipping-tag.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-gift-card-redeem_2.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
  46. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-mobile-update-modal.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-notification-item_2.cjs.entry.js +2 -2
  66. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-order-items.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-order-payment.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-order-rewards.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-orders.cjs.entry.js +2 -2
  84. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-product-card.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-products-list.cjs.entry.js +2 -2
  91. package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
  92. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +2 -2
  94. package/dist/cjs/salla-rating-modal.cjs.entry.js +2 -2
  95. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-search.cjs.entry.js +2 -2
  100. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-thank-you-header.cjs.entry.js +1 -1
  105. package/dist/cjs/salla-thank-you-page.cjs.entry.js +1 -1
  106. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  107. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  108. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  109. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  110. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  111. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  112. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  113. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  114. package/dist/cjs/salla-wishlist-summary.cjs.entry.js +2 -2
  115. package/dist/cjs/twilight.cjs.js +1 -1
  116. package/dist/cjs/{vanilla-picker-B4ryCcaf.js → vanilla-picker-BzjfVl8l.js} +1 -1
  117. package/dist/components/index.js +2 -2
  118. package/dist/docs.json +1 -1
  119. package/dist/esm/{Helper-qEdrYF7X.js → Helper-c5Qfk37-.js} +1 -1
  120. package/dist/esm/{filepond-CpWsO7Mv.js → filepond-DT0RKUzJ.js} +1 -1
  121. package/dist/esm/{filepond-plugin-file-poster-BA_cB5e8.js → filepond-plugin-file-poster-BGfksGup.js} +1 -1
  122. package/dist/esm/{filepond-plugin-file-validate-size-7bfJMSeh.js → filepond-plugin-file-validate-size-CUfbYnkC.js} +1 -1
  123. package/dist/esm/{filepond-plugin-file-validate-type-y8X7We_2.js → filepond-plugin-file-validate-type-hMjZ-CIS.js} +1 -1
  124. package/dist/esm/{filepond-plugin-image-edit-D_eWaz3f.js → filepond-plugin-image-edit-BHXzx8Yi.js} +1 -1
  125. package/dist/esm/{filepond-plugin-image-exif-orientation-DHbfnm0Z.js → filepond-plugin-image-exif-orientation-j7eYGuBq.js} +1 -1
  126. package/dist/esm/{filepond-plugin-image-preview-D47iLjXV.js → filepond-plugin-image-preview-C-VIKNS5.js} +1 -1
  127. package/dist/esm/{index-DRvWpd5P.js → index-3xfbOSPM.js} +2 -2
  128. package/dist/esm/{intlTelInput-CmiKdRvm.js → intlTelInput-B1Oa-VLs.js} +1 -1
  129. package/dist/esm/loader.js +2 -2
  130. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  131. package/dist/esm/salla-accordion_6.entry.js +2 -2
  132. package/dist/esm/salla-add-product-button_5.entry.js +2 -2
  133. package/dist/esm/salla-advertisement.entry.js +1 -1
  134. package/dist/esm/salla-alert_2.entry.js +1 -1
  135. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  136. package/dist/esm/salla-applied-filters.entry.js +2 -2
  137. package/dist/esm/salla-apps-icons.entry.js +1 -1
  138. package/dist/esm/salla-attachment-view_9.entry.js +11 -11
  139. package/dist/esm/salla-badge.entry.js +1 -1
  140. package/dist/esm/salla-basket-gap.entry.js +1 -1
  141. package/dist/esm/salla-bullet-delivery_3.entry.js +1 -1
  142. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  143. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  144. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  145. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  146. package/dist/esm/salla-comment-factors.entry.js +1 -1
  147. package/dist/esm/salla-comment-form_9.entry.js +2 -2
  148. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  149. package/dist/esm/salla-contacts.entry.js +1 -1
  150. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  151. package/dist/esm/salla-count-down.entry.js +1 -1
  152. package/dist/esm/salla-custom-fields.entry.js +1 -1
  153. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  154. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  155. package/dist/esm/salla-filters-widget.entry.js +2 -2
  156. package/dist/esm/salla-filters.entry.js +2 -2
  157. package/dist/esm/salla-free-shipping-banner.entry.js +1 -1
  158. package/dist/esm/salla-free-shipping-tag.entry.js +1 -1
  159. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  160. package/dist/esm/salla-gift-card-redeem_2.entry.js +1 -1
  161. package/dist/esm/salla-gifting.entry.js +1 -1
  162. package/dist/esm/salla-hook.entry.js +1 -1
  163. package/dist/esm/salla-infinite-scroll.entry.js +2 -2
  164. package/dist/esm/salla-installment.entry.js +1 -1
  165. package/dist/esm/salla-list-tile.entry.js +1 -1
  166. package/dist/esm/salla-localization-modal.entry.js +1 -1
  167. package/dist/esm/salla-login-modal.entry.js +1 -1
  168. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  169. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  170. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  171. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  172. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  173. package/dist/esm/salla-loyalty.entry.js +1 -1
  174. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  175. package/dist/esm/salla-map_3.entry.js +1 -1
  176. package/dist/esm/salla-menu.entry.js +1 -1
  177. package/dist/esm/salla-metadata.entry.js +1 -1
  178. package/dist/esm/salla-mobile-update-modal.entry.js +1 -1
  179. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  180. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  181. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  182. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  183. package/dist/esm/salla-notification-item_2.entry.js +2 -2
  184. package/dist/esm/salla-offer-modal.entry.js +1 -1
  185. package/dist/esm/salla-offer.entry.js +1 -1
  186. package/dist/esm/salla-order-branch.entry.js +1 -1
  187. package/dist/esm/salla-order-cancel.entry.js +1 -1
  188. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  189. package/dist/esm/salla-order-details-options.entry.js +1 -1
  190. package/dist/esm/salla-order-details.entry.js +1 -1
  191. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  192. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  193. package/dist/esm/salla-order-edit.entry.js +1 -1
  194. package/dist/esm/salla-order-items.entry.js +1 -1
  195. package/dist/esm/salla-order-options-modal.entry.js +1 -1
  196. package/dist/esm/salla-order-payment.entry.js +1 -1
  197. package/dist/esm/salla-order-rewards.entry.js +1 -1
  198. package/dist/esm/salla-order-shipments.entry.js +1 -1
  199. package/dist/esm/salla-order-summary.entry.js +1 -1
  200. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  201. package/dist/esm/salla-orders.entry.js +2 -2
  202. package/dist/esm/salla-payments.entry.js +1 -1
  203. package/dist/esm/salla-placeholder.entry.js +1 -1
  204. package/dist/esm/salla-price-range.entry.js +1 -1
  205. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  206. package/dist/esm/salla-product-card.entry.js +1 -1
  207. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  208. package/dist/esm/salla-products-list.entry.js +2 -2
  209. package/dist/esm/salla-products-slider.entry.js +2 -2
  210. package/dist/esm/salla-quick-order.entry.js +1 -1
  211. package/dist/esm/salla-rating-modal-v2.entry.js +2 -2
  212. package/dist/esm/salla-rating-modal.entry.js +2 -2
  213. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  214. package/dist/esm/salla-review-order-item.entry.js +1 -1
  215. package/dist/esm/salla-scopes.entry.js +1 -1
  216. package/dist/esm/salla-search-product-card.entry.js +1 -1
  217. package/dist/esm/salla-search.entry.js +2 -2
  218. package/dist/esm/salla-skeleton.entry.js +1 -1
  219. package/dist/esm/salla-social-share.entry.js +1 -1
  220. package/dist/esm/salla-social.entry.js +1 -1
  221. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  222. package/dist/esm/salla-thank-you-header.entry.js +1 -1
  223. package/dist/esm/salla-thank-you-page.entry.js +1 -1
  224. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  225. package/dist/esm/salla-trust-badges.entry.js +1 -1
  226. package/dist/esm/salla-user-menu.entry.js +1 -1
  227. package/dist/esm/salla-user-profile.entry.js +1 -1
  228. package/dist/esm/salla-user-settings.entry.js +1 -1
  229. package/dist/esm/salla-verify.entry.js +1 -1
  230. package/dist/esm/salla-wallet.entry.js +1 -1
  231. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  232. package/dist/esm/salla-wishlist-summary.entry.js +2 -2
  233. package/dist/esm/twilight.js +2 -2
  234. package/dist/esm/{vanilla-picker-Ci35-SnN.js → vanilla-picker-B9hxPiDz.js} +1 -1
  235. package/dist/twilight/{p-c66e49f8.entry.js → p-01c524f9.entry.js} +1 -1
  236. package/dist/twilight/{p-c98da1d6.entry.js → p-03700885.entry.js} +1 -1
  237. package/dist/twilight/{p-c71bc218.entry.js → p-06567c16.entry.js} +1 -1
  238. package/dist/twilight/{p-7016175e.entry.js → p-09cd66d7.entry.js} +1 -1
  239. package/dist/twilight/{p-38619d31.entry.js → p-0a6bd345.entry.js} +1 -1
  240. package/dist/twilight/{p-bb5e4345.entry.js → p-0c94e462.entry.js} +1 -1
  241. package/dist/twilight/{p-40aa0ef0.entry.js → p-0ff82ef6.entry.js} +1 -1
  242. package/dist/twilight/{p-43b5e25d.entry.js → p-11e00cd9.entry.js} +1 -1
  243. package/dist/twilight/{p-d7615756.entry.js → p-14b953e6.entry.js} +1 -1
  244. package/dist/twilight/{p-65817439.entry.js → p-1584c95b.entry.js} +1 -1
  245. package/dist/twilight/{p-429fbb5c.entry.js → p-16486a69.entry.js} +1 -1
  246. package/dist/twilight/{p-8e43d05b.entry.js → p-16ae7123.entry.js} +1 -1
  247. package/dist/twilight/{p-c807b4ba.entry.js → p-18100032.entry.js} +1 -1
  248. package/dist/twilight/{p-47947478.entry.js → p-206e9ef5.entry.js} +1 -1
  249. package/dist/twilight/{p-d42fcaaa.entry.js → p-253751b1.entry.js} +1 -1
  250. package/dist/twilight/{p-457cc3d1.entry.js → p-2590ffab.entry.js} +1 -1
  251. package/dist/twilight/{p-823148d1.entry.js → p-27cdd027.entry.js} +1 -1
  252. package/dist/twilight/{p-9ad1c68e.entry.js → p-2b0e76d8.entry.js} +1 -1
  253. package/dist/twilight/{p-96a7975e.entry.js → p-2be46680.entry.js} +1 -1
  254. package/dist/twilight/{p-e662da2a.entry.js → p-3217b9e3.entry.js} +1 -1
  255. package/dist/twilight/{p-a77645a3.entry.js → p-322e374e.entry.js} +1 -1
  256. package/dist/twilight/{p-bacbb6e6.entry.js → p-339af879.entry.js} +1 -1
  257. package/dist/twilight/{p-e322b07f.entry.js → p-36b84542.entry.js} +1 -1
  258. package/dist/twilight/{p-a3e6a85b.entry.js → p-3aeb38dc.entry.js} +1 -1
  259. package/dist/twilight/{p-c1827b4d.entry.js → p-3d4ca11b.entry.js} +1 -1
  260. package/dist/twilight/{p-DRvWpd5P.js → p-3xfbOSPM.js} +1 -1
  261. package/dist/twilight/{p-93dff336.entry.js → p-4170b090.entry.js} +1 -1
  262. package/dist/twilight/{p-8f212f33.entry.js → p-45574ef2.entry.js} +1 -1
  263. package/dist/twilight/{p-eb1bea38.entry.js → p-471104d3.entry.js} +1 -1
  264. package/dist/twilight/{p-d0453b1b.entry.js → p-4782dd95.entry.js} +1 -1
  265. package/dist/twilight/{p-ebe11191.entry.js → p-47b37e82.entry.js} +1 -1
  266. package/dist/twilight/{p-aa52b7c9.entry.js → p-490d9f92.entry.js} +1 -1
  267. package/dist/twilight/{p-30a6af2b.entry.js → p-4bb50513.entry.js} +1 -1
  268. package/dist/twilight/{p-8d055316.entry.js → p-52472275.entry.js} +1 -1
  269. package/dist/twilight/{p-353e0af4.entry.js → p-524c27dc.entry.js} +1 -1
  270. package/dist/twilight/{p-cdb5fe5d.entry.js → p-5444b1e6.entry.js} +1 -1
  271. package/dist/twilight/{p-1aaa095a.entry.js → p-56a9fcb9.entry.js} +1 -1
  272. package/dist/twilight/{p-472e79db.entry.js → p-579e26cf.entry.js} +1 -1
  273. package/dist/twilight/{p-2453c50b.entry.js → p-59a22067.entry.js} +1 -1
  274. package/dist/twilight/{p-b20bdd64.entry.js → p-5b13fc31.entry.js} +1 -1
  275. package/dist/twilight/{p-b34f97bf.entry.js → p-5f74fe6b.entry.js} +1 -1
  276. package/dist/twilight/{p-f31d8513.entry.js → p-62b84c2a.entry.js} +1 -1
  277. package/dist/twilight/{p-67e91147.entry.js → p-661b2a59.entry.js} +1 -1
  278. package/dist/twilight/{p-d839e68a.entry.js → p-67961628.entry.js} +1 -1
  279. package/dist/twilight/{p-07ecd9d8.entry.js → p-73856c1c.entry.js} +1 -1
  280. package/dist/twilight/{p-740a85ac.entry.js → p-741bb11f.entry.js} +1 -1
  281. package/dist/twilight/{p-bdb8e50b.entry.js → p-76d7d16b.entry.js} +1 -1
  282. package/dist/twilight/{p-000493f6.entry.js → p-76ec887e.entry.js} +1 -1
  283. package/dist/twilight/{p-9d665017.entry.js → p-7830eb6a.entry.js} +1 -1
  284. package/dist/twilight/{p-762b0a48.entry.js → p-7b1cb749.entry.js} +1 -1
  285. package/dist/twilight/{p-59c7175c.entry.js → p-7b3db8b0.entry.js} +1 -1
  286. package/dist/twilight/{p-4301f0ae.entry.js → p-7d6b99d1.entry.js} +1 -1
  287. package/dist/twilight/{p-1b1cde5a.entry.js → p-7d83a1e4.entry.js} +1 -1
  288. package/dist/twilight/{p-181e17fe.entry.js → p-80c6b366.entry.js} +1 -1
  289. package/dist/twilight/{p-184d6532.entry.js → p-81539aff.entry.js} +1 -1
  290. package/dist/twilight/{p-179bd9bf.entry.js → p-8161558b.entry.js} +1 -1
  291. package/dist/twilight/{p-d2aaa905.entry.js → p-83966fd1.entry.js} +1 -1
  292. package/dist/twilight/{p-3737ffc8.entry.js → p-83a1890b.entry.js} +1 -1
  293. package/dist/twilight/{p-370d884d.entry.js → p-87a6ad96.entry.js} +1 -1
  294. package/dist/twilight/{p-b01c8601.entry.js → p-88b4cf65.entry.js} +1 -1
  295. package/dist/twilight/{p-6e778277.entry.js → p-893647e1.entry.js} +1 -1
  296. package/dist/twilight/{p-2a4e490f.entry.js → p-8ef6d1fd.entry.js} +1 -1
  297. package/dist/twilight/{p-fb621cbb.entry.js → p-915ba55c.entry.js} +1 -1
  298. package/dist/twilight/{p-8b97ac4e.entry.js → p-9602dcf1.entry.js} +1 -1
  299. package/dist/twilight/{p-C_5zZPrL.js → p-B2MFLSFA.js} +1 -1
  300. package/dist/twilight/{p-CiicuNzl.js → p-B_72Wcdd.js} +1 -1
  301. package/dist/twilight/{p-Bj0PA-Xf.js → p-BmMPNouI.js} +1 -1
  302. package/dist/twilight/p-CT0cM10j.js +9 -0
  303. package/dist/twilight/{p-C7lKOlTc.js → p-CguEi8pz.js} +1 -1
  304. package/dist/twilight/{p-Caey3A5m.js → p-CyEKxqUy.js} +1 -1
  305. package/dist/twilight/{p-BerWJEF6.js → p-D3sV8bk6.js} +1 -1
  306. package/dist/twilight/{p-D7SrsZe-.js → p-DfJQohpt.js} +1 -1
  307. package/dist/twilight/{p-DAvwtq5S.js → p-Dre0STRQ.js} +1 -1
  308. package/dist/twilight/{p-5039a05c.entry.js → p-a339becc.entry.js} +1 -1
  309. package/dist/twilight/{p-4d710e55.entry.js → p-a5f17905.entry.js} +1 -1
  310. package/dist/twilight/{p-2a124554.entry.js → p-a6156ec1.entry.js} +1 -1
  311. package/dist/twilight/{p-8d940345.entry.js → p-aab104bf.entry.js} +1 -1
  312. package/dist/twilight/{p-9512fe0d.entry.js → p-ae48dabb.entry.js} +1 -1
  313. package/dist/twilight/{p-0d61b6c5.entry.js → p-aed0fd64.entry.js} +1 -1
  314. package/dist/twilight/{p-b1c2df04.entry.js → p-b0b2c43c.entry.js} +1 -1
  315. package/dist/twilight/{p-f88ada3f.entry.js → p-b518cbbf.entry.js} +1 -1
  316. package/dist/twilight/{p-f9e2522e.entry.js → p-b72d0322.entry.js} +1 -1
  317. package/dist/twilight/{p-a5c0b2b3.entry.js → p-b7b2ddd1.entry.js} +1 -1
  318. package/dist/twilight/{p-983926d2.entry.js → p-b7e434d7.entry.js} +1 -1
  319. package/dist/twilight/{p-c4e61610.entry.js → p-b7f65b7b.entry.js} +1 -1
  320. package/dist/twilight/{p-daa00d46.entry.js → p-b8cb4594.entry.js} +1 -1
  321. package/dist/twilight/{p-09b9bdd3.entry.js → p-b9c60b02.entry.js} +1 -1
  322. package/dist/twilight/{p-18758910.entry.js → p-bb8136a5.entry.js} +1 -1
  323. package/dist/twilight/{p-448ead38.entry.js → p-bccd3e98.entry.js} +1 -1
  324. package/dist/twilight/{p-72869219.entry.js → p-beebb445.entry.js} +1 -1
  325. package/dist/twilight/{p-5c5cee6e.entry.js → p-c4269a1f.entry.js} +1 -1
  326. package/dist/twilight/{p-b08ad979.entry.js → p-c442a7ac.entry.js} +1 -1
  327. package/dist/twilight/{p-a0311373.entry.js → p-c4448d6e.entry.js} +1 -1
  328. package/dist/twilight/{p-e4f7ad14.entry.js → p-cc8f7a83.entry.js} +1 -1
  329. package/dist/twilight/{p-41b8775c.entry.js → p-d34236d4.entry.js} +1 -1
  330. package/dist/twilight/{p-34054859.entry.js → p-d569a30f.entry.js} +1 -1
  331. package/dist/twilight/{p-a10a389c.entry.js → p-d7191fdf.entry.js} +1 -1
  332. package/dist/twilight/{p-f9dc67d8.entry.js → p-d71dc484.entry.js} +1 -1
  333. package/dist/twilight/{p-3cd1ae8c.entry.js → p-da28283d.entry.js} +1 -1
  334. package/dist/twilight/{p-75ae36b8.entry.js → p-dbed337b.entry.js} +1 -1
  335. package/dist/twilight/{p-609ab0f6.entry.js → p-dd5068b3.entry.js} +1 -1
  336. package/dist/twilight/{p-943ed402.entry.js → p-de30b9ae.entry.js} +1 -1
  337. package/dist/twilight/{p-6547d545.entry.js → p-e618c3b5.entry.js} +1 -1
  338. package/dist/twilight/{p-f1d8d7eb.entry.js → p-eb40b12d.entry.js} +1 -1
  339. package/dist/twilight/{p-2c1078ae.entry.js → p-ecca6d32.entry.js} +1 -1
  340. package/dist/twilight/{p-1d13928b.entry.js → p-f611ba62.entry.js} +1 -1
  341. package/dist/twilight/{p-48bd10f2.entry.js → p-f6222191.entry.js} +1 -1
  342. package/dist/twilight/{p-c5cb3d2c.entry.js → p-f6b30227.entry.js} +1 -1
  343. package/dist/twilight/{p-47038481.entry.js → p-f8f5382c.entry.js} +1 -1
  344. package/dist/twilight/{p-8d80b93c.entry.js → p-fb934756.entry.js} +1 -1
  345. package/dist/twilight/{p-f4ca4be7.entry.js → p-fd25d593.entry.js} +1 -1
  346. package/dist/twilight/{p-132b1d58.entry.js → p-fd2ad6f4.entry.js} +1 -1
  347. package/dist/twilight/{p-cb14daa7.entry.js → p-fe99f57a.entry.js} +1 -1
  348. package/dist/twilight/{p-I3Sp2yk-.js → p-kc64jRSI.js} +1 -1
  349. package/dist/twilight/twilight.esm.js +1 -1
  350. package/package.json +5 -5
  351. package/dist/twilight/p-BPhzgwOk.js +0 -9
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{h as e,r as t,c as i,H as s,a as r}from"./p-DRvWpd5P.js";import{a as l,b as a,r as o,c as n,h as d,g as h,d as c,e as u,f as p,j as b,C as y,k as g,l as m,m as v,n as w,o as f,t as x,p as k,q as _,i as S,s as C,u as z,v as M,w as L,x as I,y as A,z as B,A as T,B as D,D as $,E as P,F,G as j,H}from"./p-BVaKfTMx.js";import{L as N}from"./p-BO5AoBAP.js";import{S as q}from"./p-BscTeWDc.js";const E={closeButtonClick:"close_button",backdropClick:"backdrop"},G=()=>"function"==typeof crypto.randomUUID?crypto.randomUUID():"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(Number(e)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>Number(e)/4).toString(16))),R=e=>{const t=String(e?.allocation_headers?.["s-scope-allocation-id"]??e?.branch_id??"").split(",").map(Number).filter((e=>Number.isSafeInteger(e)&&e>0));return[...new Set(t)].sort(((e,t)=>e-t))};class V{constructor(){this.impressionId=null,this.visibleAt=0}viewed(e){this.guarded((()=>{this.impressionId=G(),this.visibleAt=Date.now(),this.send("Branch Selector Viewed",{...e})}))}dismissed(e,t,i){this.guarded((()=>this.send("Branch Selector Dismissed",{...e,close_reason:t,had_accepted_selection:i,elapsed_ms:this.visibleAt?Date.now()-this.visibleAt:0})))}result(e,t){this.guarded((()=>{const i=this.session(),s=i.seq+1,r="accepted"===t.outcome,l=i.first_accepted_branch_ids??(r?t.new_branch_ids:null),a=i.last_accepted_branch_ids??t.previous_branch_ids;var o,n;this.save({...i,seq:s,first_accepted_branch_ids:l,last_accepted_branch_ids:r?t.new_branch_ids:a}),this.send("Branch Selector Completed",{...e,...t,previous_branch_ids:a,selection_attempt_id:G(),selection_seq:s,first_accepted_branch_ids:l,changed:r&&a.length>0&&(o=a,n=t.new_branch_ids,!(o.length===n.length&&o.every((e=>n.includes(e)))))})}))}guarded(e){try{e()}catch{}}send(e,t){const i={event:e,session_id:this.session().id,impression_id:this.impressionId,...t};Promise.resolve(salla.api.axios.post("selector-events",i,{timeout:5e3,adapter:["fetch","xhr"],fetchOptions:{keepalive:!0}})).catch((()=>{}))}session(){const e=Salla.storage.session.get(this.storageName());if(e?.id)return e;const t={id:G(),seq:0,first_accepted_branch_ids:null};return this.save(t),t}storageName(){return`sc_selector_session:${Salla.config.get("store.id")}`}save(e){Salla.storage.session.set(this.storageName(),e)}}var Z='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 172 172" width="172" height="172">\n \x3c!-- White rounded background --\x3e\n <rect width="172" height="172" rx="64" fill="#FFFFFF"/>\n\n \x3c!-- Location / navigation icon --\x3e\n <path\n d="M113.5 52.5\n C108.5 52.5 101.5 54.5 93.5 57\n L57.5 68.5\n C53.5 69.8 51.8 72.2 53 75\n C53.8 77 55.5 78.2 58 79\n L79.5 86.5\n C81.8 87.3 83.2 88.8 84 91.2\n L90.5 113\n C91.7 117 94 119.2 97 119.2\n C100.8 119.2 103 116.5 104.2 112.8\n L119 70.5\n C121 64.5 121.8 58.5 119.2 55.2\n C117.8 53.3 116 52.5 113.5 52.5 Z"\n fill="#FFFFFF"\n stroke="#000000"\n stroke-width="5.5"\n stroke-linecap="round"\n stroke-linejoin="round"\n />\n</svg>\n';const U=e=>"prompt"===e||"denied"===e;async function O(){try{return navigator?.permissions?.query&&navigator.geolocation?await navigator.permissions.query({name:"geolocation"}):null}catch{return null}}const W=({isRTL:t=!1,onActivate:i})=>e("div",{class:"s-bullet-delivery-location-permission"},e("button",{type:"button",class:"s-bullet-delivery-location-permission-btn",onClick:i},e("span",{class:"s-bullet-delivery-location-permission-icon",innerHTML:Z,"aria-hidden":"true"}),e("span",{class:"s-bullet-delivery-location-permission-text",style:{textAlign:t?"right":"left"},"data-testid":"salla-bullet-delivery-location-permission-text"},Salla.lang.getWithDefault("pages.checkout.allow_location_permission","اسمح بمشاركة موقعك لتحديد عنوانك تلقائيًا وبشكل أدق.")),e("i",{class:"s-bullet-delivery-location-permission-arrow "+(t?"sicon-keyboard_arrow_left":"sicon-keyboard_arrow_right"),"aria-hidden":"true"}))),K=e=>e*(Math.PI/180),Y=({distanceKm:t,isRTL:i=!1})=>{const s=t.toFixed(1),r=Salla.lang.getWithDefault("pages.checkout.location_distance_warning","تبعد عن موقعك {distance} كم، وقد تكون اخترت عنوان توصيل غير صحيح.")?.replace("{distance}",s);return e("div",{class:"s-bullet-delivery-location-distance-warning",role:"alert"},e("span",{class:"s-bullet-delivery-location-distance-warning-icon",innerHTML:Z,"aria-hidden":"true"}),e("span",{class:"s-bullet-delivery-location-distance-warning-text",style:{textAlign:i?"right":"left"},"data-testid":"salla-bullet-delivery-location-distance-warning-text"},r))};var Q='<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">\n <rect x="1.90958" y="0.576577" width="30.8468" height="30.8468" rx="9.22523" style="fill:#E8E8E8" stroke="white" stroke-width="1.15315"/>\n <path d="M17.9096 6.77445L28.7204 5.33301H32.4681L32.7564 11.8195V23.6393L10.4141 23.9276V10.8105L17.9096 6.77445Z" style="fill:#97E7C8"/>\n <path d="M-2.70303 10.6664H10.2699M41.6934 5.47722C38.378 5.47722 34.7744 5.47722 27.8555 5.47722C20.9366 5.47722 18.4862 6.63037 15.4591 8.64839C12.4321 10.6664 10.2699 10.6664 10.2699 10.6664M10.2699 34.4502V23.6394M10.2699 10.6664V23.6394M-6.16249 23.6394H10.2699M10.2699 23.6394H21.0807M38.8105 23.6394H21.0807M21.0807 23.6394V34.4502" style="fill:none" stroke="white" stroke-width="2.30631"/>\n <rect x="2.34202" y="1.00901" width="29.982" height="29.982" rx="8.79279" style="fill:none" stroke="white" stroke-width="2.01802"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M18.069 19.8621C19.4995 18.6902 22.171 16.0948 22.171 13.0548C22.171 11.7333 21.6461 10.466 20.7117 9.5316C19.7773 8.5972 18.51 8.07227 17.1885 8.07227C15.8671 8.07227 14.5998 8.5972 13.6654 9.5316C12.731 10.466 12.2061 11.7333 12.2061 13.0548C12.2061 16.0948 14.8776 18.6902 16.3081 19.8621C16.5553 20.0679 16.8669 20.1806 17.1885 20.1806C17.5102 20.1806 17.8218 20.0679 18.069 19.8621ZM17.1885 14.1618C17.517 14.1618 17.838 14.0644 18.1111 13.8819C18.3842 13.6995 18.597 13.4401 18.7227 13.1367C18.8484 12.8333 18.8812 12.4994 18.8172 12.1773C18.7531 11.8552 18.595 11.5593 18.3627 11.3271C18.1305 11.0948 17.8346 10.9367 17.5125 10.8726C17.1904 10.8085 16.8565 10.8414 16.5531 10.9671C16.2497 11.0928 15.9903 11.3056 15.8079 11.5787C15.6254 11.8518 15.528 12.1728 15.528 12.5012C15.528 12.9416 15.703 13.364 16.0144 13.6754C16.3258 13.9868 16.7481 14.1618 17.1885 14.1618Z" style="fill:#55575D"/>\n</svg>\n';const X='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="8.00016" cy="8.00004" r="6.66667" stroke="#555555" stroke-width="1.125"/><path d="M8 5.33337V8.00004L9.33333 9.33337" stroke="#555555" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round"/></svg>',J='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.00014 14.6667C4.31824 14.6667 1.3335 11.6819 1.3335 8.00004C1.3335 4.31814 4.31826 1.33337 8.00016 1.33337C10.9853 1.33337 13.484 3.2953 14.3335 6.00004H12.6668" stroke="#666666" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round"/><path d="M8 5.33337V8.00004L9.33333 9.33337" stroke="#666666" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.6367 8.66667C14.6565 8.44724 14.6667 8.22486 14.6667 8M10 14.6667C10.2277 14.5917 10.4502 14.5043 10.6667 14.4052M13.8604 11.3333C13.989 11.0856 14.1036 10.8288 14.2034 10.5641M12.1283 13.4862C12.358 13.2961 12.5754 13.0905 12.7792 12.871" stroke="#666666" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round"/></svg>',ee={lat:24.7756042,lng:46.7360729},te="salla-bullet-delivery-override-ip";function ie(e,t){localStorage.getItem("salla-bullet-delivery-debug")&&(void 0!==t?console.log(e,t):console.log(e))}const se=class{constructor(e){t(this,e),this.bulletDeliveryConfirmed=i(this,"bulletDeliveryConfirmed"),this.bulletDeliveryClosed=i(this,"bulletDeliveryClosed"),this.addressCreated=i(this,"addressCreated"),this.headerContextUpdate=i(this,"headerContextUpdate"),this.pendingCartSubmitResolver=null,this.pendingCartSubmitPromise=null,this.cartSubmitConfirmationPending=!1,this.branchesServerQuery="",this.branchSearchDebounceTimer=null,this.countrySearchTimer=null,this.regionSearchTimer=null,this.citySearchTimer=null,this.districtSearchTimer=null,this.citySearchCounter=0,this.componentReady=!1,this.pendingOpen=!1,this.tabChanging=!1,this.intentStorageKey="bullet_delivery_intent",this.sessionShownKey="bullet_delivery_shown",this.incompleteIntentPromptKey="bullet_delivery_incomplete_intent_prompted",this.cartItemAddedEvent="cart::item.added",this.cartItemAddedHandler=null,this.cartSubmittingHandler=null,this.useCartEventApi=!1,this.authLoggedInHandler=null,this.autoConfirmAfterLoginInFlight=!1,this.authLoggedOutHandler=null,this.loginOpenHandler=null,this.hasExplicitPreselectedIdsForOpen=!1,this.bulletDeliveryOpenHandler=e=>{this.preselectedAddressId=e?.preselected_address_id,this.preselectedBranchId=e?.preselected_branch_id,this.hasExplicitPreselectedIdsForOpen=null!=e?.preselected_address_id||null!=e?.preselected_branch_id,this.open()},this.closeHandler=null,this.selectorTracker=new V,this.openTrigger="customer_requested",this.pendingDismissReason=null,this.modalCloseHandler=e=>{var t;this.pendingDismissReason=(t=e?.reason,E[t??""]??"escape"),queueMicrotask((()=>this.pendingDismissReason=null))},this.bulletDeliveryMobileSelectHandler=null,this.savedAddressesLoaded=!1,this.gmapRef=null,this.autoGeolocationTriggered=!1,this.geocodeRequestId=0,this.pickupDiscountRequestId=0,this.activeTab="address",this.isLoggedIn=!1,this.viewMode="main",this.countries=[],this.regions=[],this.cities=[],this.districts=[],this.loadingRegions=!1,this.selectedCountry=null,this.selectedRegion=null,this.selectedCity=null,this.selectedDistrict=null,this.districtName="",this.savedAddresses=[],this.selectedSavedAddress=null,this.selectedSessionAddress=!1,this.branches=[],this.pickupDiscountRange=null,this.pickupDiscountResolved=!1,this.filteredBranches=[],this.selectedBranch=null,this.branchSearchQuery="",this.branchCities=[],this.selectedBranchCity=null,this.branchCitySearchQuery="",this.expandedScheduleBranchId=null,this.shopperLocation=null,this.shopperLocationRequestId=0,this.nearestBranchRequestId=0,this.branchesRequestId=0,this.allBranchCities=null,this.loadingCountries=!1,this.loadingCities=!1,this.loadingDistricts=!1,this.loadingBranches=!1,this.loadingNearestBranch=!1,this.locationError="",this.loadingSavedAddresses=!1,this.showCartWillBeClearedBanner=!1,this.countrySearchQuery="",this.regionSearchQuery="",this.citySearchQuery="",this.districtSearchQuery="",this.searchingCountries=!1,this.searchingRegions=!1,this.searchingCities=!1,this.searchingDistricts=!1,this.displayedCountries=[],this.displayedRegions=[],this.displayedCities=[],this.displayedDistricts=[],this.allocationOutOfCoverageMessage=null,this.mapLocationData=null,this.addressToken=null,this.loadingToken=!1,this.mapReady=!1,this.addressDescription="",this.reverseGeocoding=!1,this.mapCountryCode=null,this.mapCountryResolved=!1,this.confirming=!1,this.locationPermission="unknown",this.stopWatchingLocationPermission=null,this.locationPermissionResolved=!1,this.liveLocation=null,this.newAddressForm={...se.INITIAL_ADDRESS_FORM},this.handleCountrySearch=e=>{this.countrySearchQuery=e},this.handleRegionSearch=e=>{this.regionSearchQuery=e},this.handleCitySearch=e=>{if(this.citySearchQuery=e,this.citySearchTimer&&clearTimeout(this.citySearchTimer),!e.trim())return this.displayedCities=this.cities,void(this.searchingCities=!1);if(e.trim().length<se.DROPDOWN_SEARCH_MIN_CHARS)return;const t=++this.citySearchCounter;this.citySearchTimer=setTimeout((async()=>{this.searchingCities=!0;try{const i=l(this.selectedCountry?.code??"")?this.selectedRegion?.id:void 0,s=await a.getCities(this.selectedCountry?.id,i,e);t===this.citySearchCounter&&(this.displayedCities=s)}catch{t===this.citySearchCounter&&(this.displayedCities=this.cities)}finally{t===this.citySearchCounter&&(this.searchingCities=!1)}}),se.DROPDOWN_SEARCH_DEBOUNCE_MS)},this.handleDistrictSearch=e=>{this.districtSearchQuery=e},this.handleCountryDropdownClosed=()=>{this.countrySearchQuery="",this.displayedCountries=this.countries,this.searchingCountries=!1},this.handleRegionDropdownClosed=()=>{this.regionSearchQuery="",this.displayedRegions=this.regions,this.searchingRegions=!1},this.handleCityDropdownClosed=()=>{this.citySearchQuery="",this.citySearchTimer&&(clearTimeout(this.citySearchTimer),this.citySearchTimer=null),++this.citySearchCounter,this.displayedCities=this.cities,this.searchingCities=!1},this.handleDistrictDropdownClosed=()=>{this.districtSearchQuery="",this.displayedDistricts=this.districts,this.searchingDistricts=!1},this.handleBranchCitySelected=e=>{this.selectedBranchCity=e&&-1!==e.id?this.branchCities.find((t=>String(t.id)===String(e.id)))??e:null,this.selectedBranch=null,this.loadBranches()},this.handleMapLocationChanged=e=>{const t=e.detail;if(!t?.position?.lat||!t?.position?.lng)return;const{lat:i,lng:s}=t.position;this.mapLocationData={lat:i,lng:s,shortAddress:t.place?.placeId??t.place?.place_id??void 0,formattedAddress:t.place?.formattedAddress??t.place?.formatted_address??void 0};const r=this.extractCountryCode(t.place?.addressComponents);this.mapCountryCode=r,this.mapCountryResolved=!!r,this.updateLocationBias(),setTimeout((()=>{const e=this.gmapRef?.locationMarker;e&&(e.gmpDraggable=!1)}),100);const l=!!this.mapLocationData.formattedAddress;l&&(r||this.isLoggedIn)?(this.invalidatePendingGeocode(),this.mapCountryResolved=!0):this.reverseGeocodeLocation(i,s,l)},this.handleMapReady=()=>{this.mapReady=!0,this.gmapRef&&"function"==typeof this.gmapRef.resize&&this.gmapRef.resize(),this.updateLocationBias(),this.locateOnMap(),"granted"!==this.locationPermission||this.liveLocation||this.handleLocationPermissionChanged("granted")},this.handleLocationPermissionRequest=async()=>{const e=await async function(){const e=await async function(){const e=await O();return e?.state??"unknown"}();if(function(){const e="undefined"!=typeof Salla?Salla.mobile:null;return!!e?.isSpaWebview?.()&&(e.action?.("location.settings.open"),!0)}())return{state:e,handledByApp:!0};if(!navigator?.geolocation)return{state:"denied",handledByApp:!1};try{const{coords:e}=await new Promise(((e,t)=>navigator.geolocation.getCurrentPosition(e,t,{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})));return{state:"granted",handledByApp:!1,position:{lat:e.latitude,lng:e.longitude}}}catch(t){return{state:1===t?.code?"denied":e,handledByApp:!1}}}();e.handledByApp||(await this.handleLocationPermissionChanged(e.state,e.position),"granted"===e.state&&this.locateOnMap(!0))},this.handleLocationPermissionChanged=async(e,t)=>{if(this.locationPermission=e,"granted"===e){if(t)this.liveLocation=t;else if(navigator.geolocation&&this.mapReady)try{const e=await new Promise(((e,t)=>navigator.geolocation.getCurrentPosition(e,t,{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})));this.liveLocation={lat:e.coords.latitude,lng:e.coords.longitude}}catch(e){ie("Live location capture failed",e)}}else this.liveLocation=null},this.retryMapCountryLookup=async()=>{this.hasMapLocation()&&(0!==this.countries.length||this.loadingCountries||await this.loadCountries(!0),this.hasMapLocation()&&this.reverseGeocodeLocation(this.mapLocationData.lat,this.mapLocationData.lng))},this.handleSubmitNewAddress=async e=>{if(e.preventDefault(),this.confirming)return;const t=this.canConfirmMapLocation();if(!(t||this.selectedCountry&&this.selectedCity))return;if(!t&&!o(this.selectedCountry?.code,this.selectedRegion?.id,this.selectedDistrict?.id??(this.districtName?.trim()||null)))return;const i=this.buildIntentAddress();if(!i)return;const s=this.getStoredIntent();this.setStoredIntent({type:"address",country_id:Number(this.selectedCountry?.id)||0,country_code:this.selectedCountry?.code||"",address_details:i}),this.selectedSavedAddress=null,this.selectedSessionAddress=!0,await this.handleConfirm(s)},this.handleCountrySelected=e=>{const t=this.countries.find((t=>String(t.id)===String(e.id)))||e;this.countrySearchQuery="",this.displayedCountries=this.countries,this.applyCountryChange(t||null)},this.handleRegionSelected=e=>{const t=this.regions.find((t=>String(t.id)===String(e.id)))||e;this.selectedRegion=t||null,this.regionSearchQuery="",this.displayedRegions=this.regions,this.updateNewAddressForm({region_id:t?.id,city_id:void 0,district_id:void 0,city:void 0,district:void 0}),t&&this.selectedCountry&&this.loadCities(this.selectedCountry.id,t.id)},this.handleCitySelected=e=>{const t=l(this.selectedCountry?.code??""),i=this.cities.find((t=>String(t.id)===String(e.id)))||e;this.selectedCity=i||null,this.selectedDistrict=null,this.districtName="",this.citySearchQuery="",this.displayedCities=this.cities,i&&(this.updateNewAddressForm({city:i,district:void 0}),t&&this.loadDistricts(i.id))},this.handleDistrictSelected=e=>{const t=this.districts.find((t=>String(t.id)===String(e.id)))||e;this.selectedDistrict=t||null,this.districtName="",this.districtSearchQuery="",this.displayedDistricts=this.districts,t&&this.updateNewAddressForm({district:t})}}get supportsPickup(){return Boolean(Salla.config.get("store.shipping.support_pickup"))||Boolean(Salla.config.get("store.support_pickup"))}get openingType(){return Salla.config.get("store.settings.bullet_delivery.settings.type")}get isRequired(){return!!Salla.config.get("store.settings.bullet_delivery.settings.is_required")}get isSupportsDelivery(){return!!Salla.config.get("store.settings.bullet_delivery.supports_delivery")}get isEnabled(){return!!Salla.config.get("store.features")?.includes("bullet-delivery-v2")&&!0===Salla.config.get("store.settings.bullet_delivery.enabled")}get isMobileApp(){return Salla.config.isMobileApp()}async open(e=!1,t="customer_requested"){if(this.isEnabled)if(this.openTrigger=t,this.isMobileApp)Salla.event.dispatch("salla::bullet-delivery.open-sheet");else if(this.componentReady&&this.modal){this.resetState(),this.loadPickupDiscountRange(),e||(this.modal.open(),Salla.event.dispatch("salla::bullet-delivery.modal.opened"));try{this.isLoggedIn=!this.isGuestUser();const e=this.cleanStaleGuestAddressIdIfNeeded(this.getStoredIntent());this.applyPreselectedIdsFromIntent(e);const t=!this.isLoggedIn&&"address"===e?.type&&null!=c(e)&&null!=h(e);if(this.activeTab=this.supportsPickup&&!this.isSupportsDelivery?"branch":this.supportsPickup&&e?.type&&("address"===e.type||"branch"===e.type)?e.type:"address",this.needsMap&&this.fetchAddressToken(),this.isLoggedIn&&"address"===this.activeTab&&(this.loadingSavedAddresses=!0),await Promise.all([this.loadCountries(t),this.isLoggedIn&&"address"===this.activeTab?this.loadSavedAddresses().then((()=>{this.savedAddressesLoaded=!0})).finally((()=>{this.loadingSavedAddresses=!1})):Promise.resolve()]),this.isLoggedIn&&this.preselectedAddressId){const e=this.savedAddresses.find((e=>e.id===this.preselectedAddressId));e&&(this.selectedSessionAddress=!1,this.selectedSavedAddress=e)}if("branch"===this.activeTab){const e=this.loadBranches(),t=this.branchesRequestId;if(await e,t!==this.branchesRequestId||"branch"!==this.activeTab||this.branchSearchQuery.trim())return;if(this.preselectedBranchId&&await this.preselectBranch(this.preselectedBranchId),t!==this.branchesRequestId||"branch"!==this.activeTab||this.branchSearchQuery.trim())return}await this.prefillFromSessionStorage()}catch(e){console.error("SallaBulletDelivery: Error loading data",e)}finally{this.overrideScopeSwitchUI()}}else this.pendingOpen=!0}async close(){if(!this.shouldForceNonClosable()||this.confirming)return this.bulletDeliveryClosed.emit(),this.modal?.close()}selectorContext(){return{configured_required:this.isRequired,effective_nonclosable:this.isRequired||this.shouldForceNonClosable(),trigger_configured:this.openingType??null,trigger_actual:this.openTrigger}}handleModalVisibility(e){e?this.selectorTracker.viewed(this.selectorContext()):this.pendingDismissReason&&(this.selectorTracker.dismissed(this.selectorContext(),this.pendingDismissReason,!!this.getStoredIntent()?.scope_allocated),this.pendingDismissReason=null)}trackSelectorResult(e,t,i,s){this.selectorTracker.result(this.selectorContext(),{outcome:e,fulfilment_method:"branch"===this.activeTab?"pickup":"delivery",previous_branch_ids:t?.scope_allocated?R(t):[],new_branch_ids:i,scope_id:s??null})}resetState(){n(),this.allBranchCities=null,this.pickupDiscountRequestId++,this.branchSearchDebounceTimer&&clearTimeout(this.branchSearchDebounceTimer),++this.branchesRequestId,this.loadingBranches=!1,++this.shopperLocationRequestId,++this.nearestBranchRequestId,this.loadingNearestBranch=!1,this.shopperLocation=null,this.viewMode="main",this.mapLocationData=null,this.mapCountryCode=null,this.mapCountryResolved=!1,this.invalidatePendingGeocode(),this.autoGeolocationTriggered=!1,this.addressDescription="",this.selectedCountry=null,this.selectedRegion=null,this.selectedCity=null,this.selectedDistrict=null,this.districtName="",this.selectedSavedAddress=null,this.selectedSessionAddress=!1,this.selectedBranch=null,this.branchSearchQuery="",this.branchCities=[],this.selectedBranchCity=null,this.expandedScheduleBranchId=null,this.regions=[],this.cities=[],this.districts=[],this.branches=[],this.filteredBranches=[],this.pickupDiscountRange=null,this.pickupDiscountResolved=!1,this.newAddressForm={...se.INITIAL_ADDRESS_FORM},this.showCartWillBeClearedBanner=!1,this.allocationOutOfCoverageMessage=null,this.locationError="",this.savedAddressesLoaded=!1,this.loadingSavedAddresses=!1,this.loadingCountries=!1,this.resetSearchState()}getIntentStorage(){const e=Boolean(Salla.config.get("store.settings.bullet_delivery.settings.remember_last_session"));return Salla.storage[e?"store":"session"]}getShownStorage(){return Salla.storage.session}getStoredIntent(){return this.getIntentStorage().get(this.intentStorageKey)}isGuestUser(){return"guest"===String(Salla.config.get("user.type")??"guest")}cleanStaleGuestAddressIdIfNeeded(e){if(!this.isGuestUser()||"address"!==e?.type||!e.address_id)return e;const t={...e,address_id:void 0};return this.setStoredIntent(t),t}applyPreselectedIdsFromIntent(e){this.hasExplicitPreselectedIdsForOpen?this.hasExplicitPreselectedIdsForOpen=!1:(this.preselectedAddressId=void 0,this.preselectedBranchId=void 0,this.isGuestUser()?"branch"===e?.type&&e.branch_id&&(this.preselectedBranchId=e.branch_id):"address"===e?.type&&e.address_id?this.preselectedAddressId=e.address_id:"branch"===e?.type&&e.branch_id&&(this.preselectedBranchId=e.branch_id))}hasIncompleteUserAddressIntent(){if(this.isGuestUser())return!1;const e=this.getStoredIntent();return!(!e||"address"!==e.type||e.address_id||!e.address_details)&&d(e)}isIntentMethodSupported(e){return"branch"===e.type?this.supportsPickup:"address"===e.type&&this.isSupportsDelivery}hasCompleteIntentForLoggedInUser(){if(this.isGuestUser())return!1;const e=this.getStoredIntent();return!!(e&&this.isIntentMethodSupported(e)&&!1!==e.scope_allocated&&("address"===e.type?e.address_id:"branch"===e.type&&e.branch_id))}async tryAutoConfirmAfterLogin(){if(this.confirming||this.autoConfirmAfterLoginInFlight)return!1;if(!this.hasIncompleteUserAddressIntent())return!1;this.autoConfirmAfterLoginInFlight=!0;const e=!!this.modal?.hasAttribute?.("visible");try{return e||await this.open(!0,"after_login"),this.selectedSessionAddress?(await this.handleConfirm(),!(!e&&!this.hasCompleteIntentForLoggedInUser()&&(this.modal?.open(),1))):(e||this.modal?.open(),!1)}finally{this.autoConfirmAfterLoginInFlight=!1}}shouldForceNonClosable(){return!this.isGuestUser()&&!!Salla.url.is_page("cart")&&!this.hasCompleteIntentForLoggedInUser()}shouldPromptIncompleteIntentThisSession(){const e=this.getShownStorage();return this.hasIncompleteUserAddressIntent()&&!0!==e.get(this.incompleteIntentPromptKey)}markIncompleteIntentPrompted(){this.getShownStorage().set(this.incompleteIntentPromptKey,!0)}setStoredIntent(e){this.getIntentStorage().set(this.intentStorageKey,e),this.overrideScopeSwitchUI()}clearBulletDeliveryStoredData(){Salla.storage.session.remove(this.intentStorageKey),Salla.storage.store.remove(this.intentStorageKey),Salla.storage.session.remove(this.sessionShownKey),Salla.storage.session.remove(this.incompleteIntentPromptKey),this.overrideScopeSwitchUI()}async prefillAddressFromStoredIntent(){const e=this.getStoredIntent();if(!e||"address"!==e.type||null==h(e))return;const t=c(e);if(!t)return;const i=this.countries.find((e=>String(e.id)===String(t)));if(!i)return;this.selectedCountry=i,this.updateNewAddressForm({country_id:Number(i.id)});const s=l(i.code),r=h(e),o=u(e),n=p(e),d=e.address_details?.district?.name,[b,y,g]=await Promise.all([s?a.getRegions(i.id):Promise.resolve([]),a.getCities(i.id,s&&null!=o?o:void 0),null!=r?a.getDistricts(Number(r)):Promise.resolve([])]);if(s&&(this.regions=b,this.displayedRegions=this.regions),this.cities=y,this.displayedCities=this.cities,this.districts=g,this.displayedDistricts=this.districts,this.loadingCities=!1,this.loadingRegions=!1,this.loadingDistricts=!1,s&&null!=o){const e=this.regions.find((e=>String(e.id)===String(o)));e&&(this.selectedRegion=e,this.updateNewAddressForm({region_id:e.id}))}if(null!=r&&this.cities.length>0){const e=this.cities.find((e=>String(e.id)===String(r)));e&&(this.selectedCity=e,this.updateNewAddressForm({city_id:e.id,city:e}))}if(this.districts.length>0){const e=this.findPrefillDistrict(n,d);e&&(this.updateNewAddressForm({district_id:e.id,district:e}),this.selectedDistrict=e)}!this.selectedDistrict&&d&&(this.districtName=d)}updateNewAddressForm(e){this.newAddressForm={...this.newAddressForm,...e}}hasBeenShownThisSession(){return!0===this.getShownStorage().get(this.sessionShownKey)}markShownThisSession(){this.getShownStorage().set(this.sessionShownKey,!0)}getIPLocationConfig(){const e="store.shipping.delivery_location",t={countryId:Salla.config.get(`${e}.country_id`),regionId:Salla.config.get(`${e}.region_id`),cityId:Salla.config.get(`${e}.city_id`),districtId:Salla.config.get(`${e}.district_id`)};return localStorage.getItem(te)?JSON.parse(localStorage.getItem(te)):t}async loadCountries(e=!1){this.loadingCountries=!0;const t="branch"===this.activeTab;try{this.countries=await a.getCountries(t),this.displayedCountries=this.countries;const{countryId:i,regionId:s,cityId:r,districtId:o}=this.getIPLocationConfig();ie("getIPLocationConfig",this.getIPLocationConfig());const n=i&&this.countries.length>0?this.countries.find((e=>String(e.id)===String(i))):null;n&&(this.selectedCountry=n,this.updateNewAddressForm({country_id:Number(this.selectedCountry.id)}),!e)&&(null!=s||null!=r||null!=o?await this.prefillFromIPLocation(n,{regionId:s,cityId:r,districtId:o}):l(this.selectedCountry.code)?await this.loadRegions(this.selectedCountry.id):await this.loadCities(this.selectedCountry.id))}finally{this.loadingCountries=!1}}async prefillFromIPLocation(e,t){const i=l(e.code),{regionId:s,cityId:r,districtId:o}=t,[n,d,h]=await Promise.all([i?a.getRegions(e.id):Promise.resolve([]),a.getCities(e.id,i&&null!=s?s:void 0),null!=r?a.getDistricts(Number(r)):Promise.resolve([])]);if(i&&(this.regions=n,this.displayedRegions=this.regions),this.cities=d,this.displayedCities=this.cities,this.districts=h,this.displayedDistricts=this.districts,this.loadingRegions=!1,this.loadingCities=!1,this.loadingDistricts=!1,i&&null!=s){const e=this.regions.find((e=>String(e.id)===String(s)));e&&(this.selectedRegion=e,this.updateNewAddressForm({region_id:e.id}))}if(null!=r&&this.cities.length>0){const e=this.cities.find((e=>String(e.id)===String(r)));e&&(this.selectedCity=e,this.updateNewAddressForm({city_id:e.id,city:e}))}if(null!=o&&this.districts.length>0){const e=this.findPrefillDistrict(o);e&&(this.selectedDistrict=e,this.updateNewAddressForm({district_id:e.id,district:e}))}}async loadCities(e,t){this.loadingCities=!0,this.cities=[],this.displayedCities=[],this.districts=[],this.displayedDistricts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="";try{this.cities=await a.getCities(e,t),this.displayedCities=this.cities}finally{this.loadingCities=!1}}async loadDistricts(e){this.loadingDistricts=!0,this.districts=[],this.displayedDistricts=[],this.selectedDistrict=null,this.districtName="";try{this.districts=await a.getDistricts(e),this.displayedDistricts=this.districts}finally{this.loadingDistricts=!1}}findPrefillDistrict(e,t){if(0===this.districts.length)return;if(null!=e){const t=this.districts.find((t=>String(t.id)===String(e)));if(t)return t}const i=t?.trim().toLowerCase();return i?this.districts.find((e=>{const t=e.name?.trim().toLowerCase(),s=e.name_en?.trim().toLowerCase();return t===i||s===i})):void 0}async loadBranches(){const e=++this.branchesRequestId,t=this.branchSearchQuery.trim();this.loadingBranches=!0;try{const i=await a.getBranches({country_id:this.selectedCountry?.id,city_id:this.selectedBranchCity?.id,query:t,...await this.getListLocation()});if(e!==this.branchesRequestId)return;this.branchesServerQuery=t.length>=2?t:"",this.applyLoadedBranches(i),t.length<2&&this.refreshBranchCities()}finally{e===this.branchesRequestId&&(this.loadingBranches=!1)}}refreshBranchCities(){this.selectedBranchCity||(this.branchCities=b(this.branches));const e=this.selectedCountry?.id;if(!this.allBranchCities||this.allBranchCities.countryId!==e||Date.now()-this.allBranchCities.timestamp>y){const t=a.getAllBranches(e,20);this.allBranchCities={countryId:e,timestamp:Date.now(),branches:t,cities:t.then((e=>b(e)))}}const t=this.allBranchCities;return t.cities.then((i=>{this.allBranchCities===t&&this.selectedCountry?.id===e&&(i.length?this.branchCities=i:this.allBranchCities=null)})).catch((i=>{this.allBranchCities===t&&(this.allBranchCities=null,this.selectedCountry?.id===e&&Array.isArray(i?.branches)&&(this.branchCities=b([...this.branches,...i.branches]))),console.error("[BulletDelivery] Error fetching branch cities",i)}))}applyLoadedBranches(e){if(this.branches=e,this.selectedBranch){const t=e.find((e=>e.id===this.selectedBranch?.id));t&&(this.selectedBranch=g(t)?t:null)}this.filterBranches()}async loadPickupDiscountRange(){if(!this.supportsPickup)return;const e=++this.pickupDiscountRequestId,{branches:t,complete:i}=await a.getBranchCollection(void 0,60,{requireComplete:!0});e===this.pickupDiscountRequestId&&(this.pickupDiscountRange=i?m(t):null,this.pickupDiscountResolved=!0)}getPickupDiscountLabel(e,t,i=t){const s=t=>"percentage"===e?String(Math.round(100*t)/100):salla.money(t),r=t===i?s(t):`${s(t)} – ${s(i)}`,l="percentage"===e?`${r}%`:`${r} `;return Salla.lang.getWithDefault("pages.checkout.pickup_discount",this.isArabic?`خصم ${l}`:` ${l} discount`,{amount:l})}filterBranches(){const e=this.branchSearchQuery.trim();this.filteredBranches=e&&e===this.branchesServerQuery?this.branches:v(this.branches,e)}async prefillFromSessionStorage(){try{const e=this.getStoredIntent();if(!e)return;if("address"!==this.activeTab||"address"!==e.type||this.isLoggedIn||await this.prefillAddressFromStoredIntent(),"branch"===this.activeTab&&"branch"===e.type){const t=c(e);if(null!=t){const i=this.countries.find((e=>String(e.id)===String(t)));i&&(this.selectedCountry=i,this.updateNewAddressForm({country_id:Number(i.id)}),await this.preselectBranch(w(e)))}}}catch(e){console.error("[BulletDelivery] Error prefilling from session storage:",e)}}async loadSavedAddresses(){const e=this.selectedSavedAddress?.id;this.savedAddresses=await a.getSavedAddresses();const t=this.getStoredIntent();if(d(t))return this.selectedSessionAddress=!0,void(this.selectedSavedAddress=null);if(null!=e){const t=this.savedAddresses.find((t=>t.id===e&&!1!==t.is_in_coverage));if(t)return this.selectedSessionAddress=!1,void(this.selectedSavedAddress=t)}const i=this.savedAddresses.find((e=>e.is_default&&!1!==e.is_in_coverage));if(i)this.selectedSavedAddress=i;else{const e=this.savedAddresses.find((e=>!1!==e.is_in_coverage));e&&(this.selectedSavedAddress=e)}}applyCountryChange(e){++this.branchesRequestId,this.allBranchCities=null,this.loadingBranches=!1,this.branches=[],this.filteredBranches=[],this.selectedCountry=e,this.selectedBranchCity=null,this.branchCities=[],this.branchCitySearchQuery="",this.selectedBranch=null,this.selectedRegion=null,this.regions=[],this.displayedRegions=[],this.cities=[],this.displayedCities=[],this.districts=[],this.displayedDistricts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="",this.allocationOutOfCoverageMessage=null,this.regionSearchQuery="",this.citySearchQuery="",this.districtSearchQuery="",this.searchingRegions=!1,this.searchingCities=!1,this.searchingDistricts=!1,this.clearSearchTimers(),this.selectedCountry&&(this.updateNewAddressForm({country_id:Number(this.selectedCountry.id),region_id:void 0,city_id:void 0,district_id:void 0,city:void 0,district:void 0}),"branch"===this.activeTab?this.loadBranches():l(this.selectedCountry.code)?this.loadRegions(this.selectedCountry.id):this.loadCities(this.selectedCountry.id))}async loadRegions(e){this.loadingRegions=!0,this.regions=[],this.displayedRegions=[],this.selectedRegion=null,this.cities=[],this.displayedCities=[],this.districts=[],this.displayedDistricts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="";try{this.regions=await a.getRegions(e),this.displayedRegions=this.regions}finally{this.loadingRegions=!1}}emitHeaderContextUpdate(e,t,i){let s="";"address"===e.type?t?s=t.district?.name&&t.city?.name?`${t.district.name}، ${t.city.name}`:t.city?.name??"":this.isGuestMapPick?s=e.address_details?.formatted_address??"":this.selectedCity?s=this.selectedDistrict?`${this.selectedDistrict.name}، ${this.selectedCity.name}`:this.selectedCity.name:e.address_details&&(s=[e.address_details.district?.name,e.address_details.city?.name,e.address_details.country?.name].filter(Boolean).join("، ")||e.address_details.formatted_address||e.address_details.short_address||""):i?s=i.name:e.branch_details&&(s=e.branch_details.city??e.branch_details.name);const r="address"===e.type?Salla.lang.get("mobile_app.strings.delivery"):Salla.lang.get("mobile_app.strings.pickup");this.headerContextUpdate.emit({type:e.type,display_text:s?`${r}: ${s}`:"",country_code:e.country_code,city:this.selectedCity?.name??e.address_details?.city?.name,district:this.selectedDistrict?.name??e.address_details?.district?.name,branch_name:i?.name??e.branch_details?.name})}handleBranchSearch(e){const t=e.target.value;if(this.branchSearchQuery=t,this.branchSearchDebounceTimer&&clearTimeout(this.branchSearchDebounceTimer),!t?.trim())return this.branchSearchQuery="",void this.loadBranches();this.branchSearchDebounceTimer=setTimeout((()=>{t.trim().length<2&&!this.branchesServerQuery||this.loadBranches()}),1e3)}clearSearchTimers(){[this.countrySearchTimer,this.regionSearchTimer,this.citySearchTimer,this.districtSearchTimer].forEach((e=>{e&&clearTimeout(e)})),this.countrySearchTimer=this.regionSearchTimer=this.citySearchTimer=this.districtSearchTimer=null}resetSearchState(){this.countrySearchQuery="",this.regionSearchQuery="",this.citySearchQuery="",this.districtSearchQuery="",this.searchingCountries=!1,this.searchingRegions=!1,this.searchingCities=!1,this.searchingDistricts=!1,this.displayedCountries=[],this.displayedRegions=[],this.displayedCities=[],this.displayedDistricts=[],this.clearSearchTimers()}async loadBranchesWithLocation(e,t){++this.shopperLocationRequestId,this.shopperLocation={lat:e,lng:t};const i=++this.branchesRequestId;this.loadingBranches=!0;try{const s=await a.getBranches({country_id:this.selectedCountry?.id,city_id:this.selectedBranchCity?.id,lat:e,lng:t});if(i!==this.branchesRequestId)return!1;if(this.branchesServerQuery="",this.applyLoadedBranches(s),this.refreshBranchCities(),!this.selectedCountry&&this.branches.length>0){const e=this.branches[0];if(e.country){const t=this.countries.find((t=>t.id===e.country.id));t&&(this.selectedCountry=t,this.updateNewAddressForm({country_id:Number(t.id)}))}}return!0}finally{i===this.branchesRequestId&&(this.loadingBranches=!1)}}async handleFindNearestBranch(){if(!navigator.geolocation)return void(this.locationError=Salla.lang.get("pages.checkout.current_location_not_supported"));const e=++this.nearestBranchRequestId;this.loadingNearestBranch=!0,this.locationError="";try{const t=await new Promise(((e,t)=>{navigator.geolocation.getCurrentPosition(e,t,{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})})),{latitude:i,longitude:s}=t.coords;if(e!==this.nearestBranchRequestId)return;if(!await this.loadBranchesWithLocation(i,s))return;if(e!==this.nearestBranchRequestId)return;const r=f(this.branches,i,s);r&&(this.selectedBranch=r,this.branchSearchQuery="",this.filterBranches())}catch(t){if(e!==this.nearestBranchRequestId)return;const i=t;this.locationError=this.geolocationErrorMessage("number"==typeof i?.code?i.code:-1)}finally{e===this.nearestBranchRequestId&&(this.loadingNearestBranch=!1)}}geolocationErrorMessage(e){return 1===e?Salla.lang.getWithDefault("pages.checkout.allow_location_permission_blocked_hint",this.isArabic?"مشاركة الموقع محجوبة لهذا المتجر في متصفحك. افتح إعدادات الموقع في المتصفح، اسمح بالوصول إلى الموقع، ثم أعد المحاولة.":"Location sharing is blocked for this store in your browser. Open your browser's location settings, allow location access, then try again."):Salla.lang.getWithDefault("pages.checkout.pickup_location_unavailable",this.isArabic?"تعذَّر تحديد موقعك. حاول مرة أخرى.":"We couldn't detect your location. Try again.")}handleBranchSelect(e){this.selectedBranch=e,this.allocationOutOfCoverageMessage=null}toggleBranchSchedule(e){this.expandedScheduleBranchId=this.expandedScheduleBranchId===e?null:e}async preselectBranch(e){if(null==e||this.selectedBranch)return;let t=this.branches.find((t=>t.id===e));if(!t&&this.allBranchCities){const i=this.allBranchCities,s=this.branchesRequestId;try{t=(await i.branches).find((t=>t.id===e))}catch{return}if(s!==this.branchesRequestId||"branch"!==this.activeTab||this.allBranchCities!==i||i.countryId!==this.selectedCountry?.id||this.selectedBranch||this.branchSearchQuery.trim())return;if(this.selectedBranchCity&&String(t?.city?.id)!==String(this.selectedBranchCity.id))return;t&&g(t)&&this.applyLoadedBranches([...this.branches,t])}t&&g(t)&&(this.selectedBranch=t)}handleSavedAddressSelect(e){!1!==e.is_in_coverage?(this.selectedSavedAddress=e,this.selectedSessionAddress=!1,this.allocationOutOfCoverageMessage=null):Salla.notify?.error(Salla.lang.get("pages.checkout.shipping_not_available"))}handleSessionAddressSelect(){this.selectedSessionAddress=!0,this.selectedSavedAddress=null,this.allocationOutOfCoverageMessage=null}async handleAddNewAddress(){this.viewMode="add-address",this.mapLocationData=null,this.invalidatePendingGeocode(),this.autoGeolocationTriggered=!1,this.fetchAddressToken();const e=this.getStoredIntent(),t=c(e);if(t&&this.countries.length>0){const e=this.countries.find((e=>e.id===t));e&&(this.selectedCountry=e,this.updateNewAddressForm({country_id:Number(e.id)}),l(e.code)?await this.loadRegions(e.id):await this.loadCities(e.id))}}handleBackToAddressList(){this.viewMode="main",this.mapLocationData=null,this.invalidatePendingGeocode(),this.addressDescription="",this.autoGeolocationTriggered=!1}hasAddressesToGoBack(){return this.savedAddresses.length>0||d(this.getStoredIntent())}async fetchAddressToken(){if(this.canUseMap&&!this.addressToken&&!this.loadingToken){this.loadingToken=!0;try{const e=salla.config.get("store.settings.keys.maps"),t=()=>import("./p-DI6PJLEJ.js").then((({load:t})=>t({key:e,libraries:["marker","places"],language:salla.config.get("user.language_code")||"ar"}))).catch((e=>ie("Failed to load Google Maps SDK",e)));"complete"===document.readyState?t():window.addEventListener("load",t,{once:!0}),this.addressToken=await a.getAddressToken()}catch{ie("SallaBulletDelivery: Failed to fetch address token")}finally{this.loadingToken=!1}}}extractCountryCode(e){const t=e?.find((e=>e?.types?.includes("country"))),i=t?.short_name??t?.shortText;return"string"==typeof i&&i.trim()?i.trim().toUpperCase():null}invalidatePendingGeocode(){this.reverseGeocoding=!1,this.geocodeRequestId++}applyCoordsFallback(e,t){this.mapLocationData={...this.mapLocationData,formattedAddress:this.mapLocationData?.formattedAddress??`${e.toFixed(6)}, ${t.toFixed(6)}`},this.mapCountryResolved=!0}reverseGeocodeLocation(e,t,i=!1){this.mapCountryCode=null,this.mapCountryResolved=!1;const s=window.google?.maps?.Geocoder;if(!s)return this.geocodeRequestId++,void this.applyCoordsFallback(e,t);this.reverseGeocoding=!0;const r=++this.geocodeRequestId;(new s).geocode({location:{lat:e,lng:t}},((s,l)=>{if(r===this.geocodeRequestId)if(this.reverseGeocoding=!1,l===window.google.maps.GeocoderStatus.OK&&s?.[0]){this.mapLocationData={...this.mapLocationData,formattedAddress:i?this.mapLocationData.formattedAddress:s[0].formatted_address,shortAddress:this.mapLocationData?.shortAddress??s[0].place_id};for(const e of s)if(this.mapCountryCode=this.extractCountryCode(e.address_components),this.mapCountryCode)break;this.mapCountryResolved=!0}else ie("Reverse geocoding failed for map location",l),this.applyCoordsFallback(e,t)}))}updateLocationBias(){if(!this.gmapRef)return;const e=this.hasMapLocation()?{lat:this.mapLocationData.lat,lng:this.mapLocationData.lng}:this.mapInitialCenter;this.gmapRef.autocompleteLocationBias={center:e,radius:5e5}}locateOnMap(e=!1){if(!this.gmapRef)return;if(!e){if(this.autoGeolocationTriggered||this.hasMapLocation())return;if(!this.locationPermissionResolved||U(this.locationPermission))return}const t=this.gmapRef.getCurrentLocation;if("function"==typeof t){this.autoGeolocationTriggered=!0;try{const e=t.call(this.gmapRef,!0);e&&"function"==typeof e.catch&&e.catch((e=>ie("Auto geolocation failed",e)))}catch(e){ie("Auto geolocation threw",e)}}}hasMapLocation(){return null!=this.mapLocationData?.lat&&null!=this.mapLocationData?.lng}canConfirmMapLocation(){return this.hasMapLocation()&&!this.reverseGeocoding&&!!this.mapLocationData?.formattedAddress}get isMapSettingEnabled(){return Salla.config.get("store.settings.bullet_delivery.settings.map_enabled")}get isMapModeAvailable(){return this.canUseMap&&!!this.addressToken}get canUseMap(){return!!this.isMapSettingEnabled&&!!salla.config.get("store.settings.keys.maps")}get needsMap(){return this.canUseMap&&"address"===this.activeTab&&("add-address"===this.viewMode||!this.isLoggedIn)}get isMapPick(){return this.isMapModeAvailable&&this.hasMapLocation()}get isGuestMapPick(){return!this.isLoggedIn&&this.isMapPick}get mapCountry(){return this.mapCountryCode?this.countries.find((e=>String(e.code).toUpperCase()===this.mapCountryCode))??null:null}get mapCountryStatus(){return!this.mapCountryResolved||this.loadingCountries?"resolving":this.mapCountryCode&&0!==this.countries.length?this.mapCountry?"resolved":"unsupported":"unresolved"}isGuestMapCountryBlocked(){return this.isGuestMapPick&&"resolved"!==this.mapCountryStatus}renderMapCountryNotice(){if(!this.isGuestMapPick)return null;const t=this.mapCountryStatus;return"unsupported"===t?this.renderAlert(Salla.lang.getWithDefault("pages.checkout.map_country_unsupported","We don't deliver to this location. Move the pin to a supported country.")):"unresolved"!==t?null:e("div",null,this.renderAlert(Salla.lang.getWithDefault("pages.checkout.map_country_unresolved","We couldn't determine the country of this location. Move the pin or try again.")),e("salla-button",{shape:"link",onClick:this.retryMapCountryLookup},Salla.lang.getWithDefault("pages.checkout.try_again","Try again")))}get mapInitialCenter(){return this.defaultGeoLocation??ee}getListLocation(){const e=this.getGrantedDeviceLocation();return!this.shopperLocation&&navigator.geolocation&&navigator.permissions?.query?Promise.race([e,new Promise((e=>setTimeout((()=>e({})),1500)))]):e}async getGrantedDeviceLocation(){if(this.shopperLocation)return this.shopperLocation;if(!navigator.geolocation||!navigator.permissions?.query)return{};const e=++this.shopperLocationRequestId;try{const t=await navigator.permissions.query({name:"geolocation"});if(e!==this.shopperLocationRequestId)return this.shopperLocation??{};if("granted"!==t.state)return{};const i=await new Promise(((e,t)=>navigator.geolocation.getCurrentPosition(e,t,{timeout:5e3,maximumAge:6e5})));return e!==this.shopperLocationRequestId?this.shopperLocation??{}:(this.shopperLocation={lat:i.coords.latitude,lng:i.coords.longitude},this.shopperLocation)}catch{return{}}}get defaultGeoLocation(){const e=salla.config.get("user.default_geo_location"),t=x(e?.lat),i=x(e?.lng);return null!=t&&null!=i&&t>=-90&&t<=90&&i>=-180&&i<=180?{lat:t,lng:i}:null}async handleTabChange(e){if(!this.tabChanging){++this.branchesRequestId,this.loadingBranches=!1,this.tabChanging=!0;try{this.activeTab=e,"add-address"===this.viewMode&&(this.viewMode="main",this.invalidatePendingGeocode()),this.showCartWillBeClearedBanner=!1,this.allocationOutOfCoverageMessage=null,this.resetSearchState();const t="branch"===e;this.countries=await a.getCountries(t),this.displayedCountries=this.countries;const i=this.selectedCountry?.id;if(null!=i&&(this.selectedCountry=this.countries.find((e=>e.id===i))||null),!this.selectedCountry){const{countryId:e}=this.getIPLocationConfig();e&&this.countries.length>0&&(this.selectedCountry=this.countries.find((t=>String(t.id)===String(e)))||null),this.selectedCountry||1!==this.countries.length||(this.selectedCountry=this.countries[0])}if(String(i??"")!==String(this.selectedCountry?.id??"")&&(this.allBranchCities=null,this.selectedBranchCity=null,this.branchCities=[],this.branchCitySearchQuery="",this.selectedBranch=null,this.branches=[],this.filteredBranches=[]),"address"===e&&this.needsMap&&this.fetchAddressToken(),this.selectedCountry)if("branch"===e){const e=this.getStoredIntent();await this.loadBranches(),this.preselectBranch(w(e))}else if("address"===e){if(this.isLoggedIn&&!this.savedAddressesLoaded){this.loadingSavedAddresses=!0;try{await this.loadSavedAddresses(),this.savedAddressesLoaded=!0}finally{this.loadingSavedAddresses=!1}}if(!this.isLoggedIn){const e=this.getStoredIntent();e&&h(e)&&await this.prefillAddressFromStoredIntent()}}}finally{this.tabChanging=!1}}}isConfirmDisabled(){return"branch"===this.activeTab?!g(this.selectedBranch):"address"===this.activeTab&&(!this.isLoggedIn||!this.selectedSessionAddress)&&(this.isLoggedIn&&this.selectedSavedAddress?!1===this.selectedSavedAddress.is_in_coverage:!this.isLoggedIn&&this.isMapModeAvailable?!this.isGuestMapPick||this.isGuestMapCountryBlocked():!this.selectedCountry||!this.selectedCity||!o(this.selectedCountry?.code,this.selectedRegion?.id,this.selectedDistrict?.id??(this.districtName?.trim()||null)))}handleLogin(){Salla.auth.setCanRedirect(!1),Salla.event.dispatch("salla::bullet-delivery.modal.close.requested"),Salla.event.dispatch("login::open",Salla.url.is_page("cart")?{withoutReload:!0,source:"cart-submit"}:{withoutReload:!0,source:"bullet-delivery"})}resolvePendingCartSubmit(){if(!this.pendingCartSubmitResolver)return;const e=this.pendingCartSubmitResolver;this.pendingCartSubmitResolver=null,this.pendingCartSubmitPromise=null,this.cartSubmitConfirmationPending=!1,e()}armPendingCartSubmitGate(){this.isEnabled&&!this.cartSubmitConfirmationPending&&(this.cartSubmitConfirmationPending=!0,this.pendingCartSubmitPromise=new Promise((e=>{this.pendingCartSubmitResolver=e})))}openGuestLogin(){Salla.event.dispatch("salla::bullet-delivery.modal.close.requested"),Salla.auth.setCanRedirect(!1),Salla.event.dispatch("login::open",{withoutReload:!0,source:"cart-submit"})}async handlePendingSubmitAfterLogin(){this.isGuestUser()||(Salla.event.dispatch("login::close"),this.hasCompleteIntentForLoggedInUser()?this.resolvePendingCartSubmit():await this.tryAutoConfirmAfterLogin()||this.modal?.hasAttribute?.("visible")&&this.isLoggedIn||this.open(!1,"after_login"))}buildIntentAddress(){if("address"!==this.activeTab)return;if(this.isMapPick&&this.mapLocationData){const{lat:e,lng:t,formattedAddress:i,shortAddress:s}=this.mapLocationData,r=this.isGuestMapPick?this.mapCountry:this.selectedCountry;return{country:r?{id:r.id,name:r.name,code:r.code}:void 0,lat:e,lng:t,formatted_address:i,place_id:s,description:this.addressDescription?.trim()||void 0}}if(!this.selectedCountry||!this.selectedCity)return;const e={id:this.selectedCountry.id,name:this.selectedCountry.name,code:this.selectedCountry.code},t={id:this.selectedCity.id,name:this.selectedCity.name},i=this.selectedRegion?{id:this.selectedRegion.id,name:this.selectedRegion.name,code:this.selectedRegion.code}:void 0,s=this.selectedDistrict?{id:this.selectedDistrict.id,name:this.selectedDistrict.name}:this.districtName?{id:0,name:this.districtName}:void 0,r=this.selectedSavedAddress?.short_address;return{country:e,region:i,city:t,district:s,short_address:r}}buildIntentAddressFromSaved(e){return{country:{id:e.country?.id??e.country_id??0,name:e.country?.name??"",code:e.country?.code},region:e.region?{id:e.region.id,name:e.region.name,code:e.region.code}:void 0,city:{id:e.city?.id??e.city_id??0,name:e.city?.name??""},district:e.district?{id:e.district.id,name:e.district.name}:void 0,short_address:e.short_address,street:e.street,local:e.local,lat:e.lat,lng:e.lng}}buildIntentBranch(){if("branch"!==this.activeTab||!this.selectedBranch)return;const e=this.selectedBranch,t=null!=e.location?.lat?Number(e.location.lat):void 0,i=null!=e.location?.lng?Number(e.location.lng):void 0;return{id:e.id,name:e.name,city:e.city?.name,country:e.country?.name,district:e.district?.name,latitude:t,longitude:i}}buildAllocationConfirmedAddressData(e){return"address"!==this.activeTab?null:{saved_address:e??this.selectedSavedAddress??void 0,country:this.selectedCountry??void 0,region:this.selectedRegion??void 0,city:this.selectedCity??void 0,district:this.selectedDistrict??void 0,district_name:this.districtName?.trim()||void 0,short_address:e?.short_address??this.selectedSavedAddress?.short_address,form_data:{...this.newAddressForm},lat:this.mapLocationData?.lat,lng:this.mapLocationData?.lng,formatted_address:this.mapLocationData?.formattedAddress}}buildAllocationConfirmedAddressFromIntent(e){if("address"!==e.type)return null;const t=e.address_details,i=Number(e.country_id)||0;return{country:t?.country?{id:t.country.id,name:t.country.name,code:t.country.code??e.country_code??""}:void 0,region:t?.region?{id:Number(t.region.id),name:t.region.name,country_id:i,code:t.region.code??void 0}:void 0,city:t?.city?{id:Number(t.city.id),name:t.city.name,country_id:i}:void 0,district:t?.district?{id:Number(t.district.id),name:t.district.name,city_id:Number(t.city?.id)||0}:void 0,short_address:t?.short_address}}buildBranchFromIntent(e){if("branch"!==e.type||!e.branch_details)return null;const t=e.branch_details,i={id:t.id,name:t.name};return t.city&&(i.city={id:0,name:t.city}),null!=t.latitude&&null!=t.longitude&&(i.location={lat:String(t.latitude),lng:String(t.longitude)}),i}buildAllocationRequestFromIntent(e){if("branch"===e.type)return{type:"branch",branch_id:null!=e.branch_id?String(e.branch_id):""};if(null!=e.address_id)return{type:"address",address_id:String(e.address_id)};const t=e.address_details,i={type:"address",country_id:null!=e.country_id?String(e.country_id):"",city_id:null!=t?.city?.id?String(t.city.id):""};return null!=t?.region?.id&&(i.region_id=String(t.region.id)),null!=t?.district?.id&&(i.district_id=String(t.district.id)),i}applyMobileBulletDeliverySelection(e){if(!e||"address"!==e.type&&"branch"!==e.type)return void console.warn("SallaBulletDelivery: ignoring invalid mobile select payload",e);const t=e.allocation_headers??{},i=t["s-scope-allocation-type"]??e.type,s=t["s-scope-allocation-id"];i&&Salla.api.setHeader("s-scope-allocation-type",i),s&&Salla.api.setHeader("s-scope-allocation-id",String(s));const r=Salla.config.get("store.scope",Salla.storage.get("scope"))||{};Salla.storage.set("scope",{...r,allocation_type:i,allocation_id:s?String(s):void 0}),this.markShownThisSession();const l={...e,allocation_headers:{"s-scope-allocation-type":i,"s-scope-allocation-id":s?String(s):void 0}};this.setStoredIntent(l),k();const a=this.buildBranchFromIntent(l),o={...l,address:this.buildAllocationConfirmedAddressFromIntent(l),branch:a,allocation_request:this.buildAllocationRequestFromIntent(l),allocation_response:null};Salla.event.dispatch("salla::bullet-delivery.allocation.confirmed",o),this.bulletDeliveryConfirmed.emit({...l,branch:a??void 0}),this.emitHeaderContextUpdate(l,void 0,a??void 0),setTimeout((()=>window.location.reload()),100)}extractMobileSelectPayload(e){return e&&"object"==typeof e?"payload"in e&&e.payload?e.payload:e:null}async handleConfirm(e){if(this.isConfirmDisabled()||this.confirming)return;this.allocationOutOfCoverageMessage=null,this.confirming=!0,this.confirmBtn?.load();let t=!1;const i=void 0===e?this.getStoredIntent():e;try{const e="address"===this.activeTab&&this.isGuestMapPick?this.mapCountry:this.selectedCountry,s={type:this.activeTab,country_id:Number(e?.id)||0,country_code:e?.code||""};let r,o,n;if("address"===this.activeTab)if(this.isLoggedIn&&this.selectedSessionAddress){const e=await this.saveSessionAddressToProfile();if(!e)return Salla.notify?.error(Salla.lang.get("common.errors.error_occurred")),this.trackSelectorResult("failed",i,[]),void this.confirmBtn?.stop();s.address_id=e.id,r=e,this.selectedSessionAddress=!1,this.selectedSavedAddress=e,s.address_details=this.buildIntentAddressFromSaved(e)}else this.isLoggedIn&&this.selectedSavedAddress?(s.address_id=this.selectedSavedAddress.id,r=this.selectedSavedAddress,s.address_details=this.buildIntentAddressFromSaved(this.selectedSavedAddress)):s.address_details=this.buildIntentAddress();else s.branch_details=this.buildIntentBranch(),s.branch_id=this.selectedBranch?.id,o=this.selectedBranch||void 0;"address"===this.activeTab?this.isLoggedIn&&r?n={type:"address",address_id:String(r.id)}:this.isGuestMapPick&&s.address_details?n={type:"address",country_id:String(s.country_id),lat:s.address_details.lat,lng:s.address_details.lng}:(n={type:"address",country_id:String(this.selectedCountry?.id||0),city_id:String(this.selectedCity?.id||"")},l(this.selectedCountry?.code??"")&&(this.selectedRegion?.id&&(n.region_id=String(this.selectedRegion.id)),n.district_id=String(this.selectedDistrict?.id||""))):n={type:"branch",branch_id:String(this.selectedBranch?.id||"")};const d=await a.allocateScope(n);if(!d.success){console.error("BulletDelivery: Scope allocation failed",d.error);const e=d.error||("address"===this.activeTab?Salla.lang.get("pages.checkout.address_out_of_coverage"):Salla.lang.get("pages.checkout.failed_to_set_pickup"));return this.allocationOutOfCoverageMessage=/[.!؟?]$/.test(e.trim())?e:`${e}.`,this.trackSelectorResult("failed",i,[]),this.confirmBtn?.stop(),this.confirming=!1,void("branch"===this.activeTab&&(this.selectedBranch=null,k(),this.loadBranches()))}let h;if(d.data){const e=d.data;h=e.id;const t=e?.allocation?.type,r=e?.allocation?.branch_id;t&&Salla.api.setHeader("s-scope-allocation-type",t),r&&Salla.api.setHeader("s-scope-allocation-id",String(r));const l=Salla.config.get("store.scope",Salla.storage.get("scope"))||{};if(Salla.storage.set("scope",{...l,id:h,allocation_type:t,allocation_id:r?String(r):void 0}),h){if(!await a.setDeliveryScope(h))return this.allocationOutOfCoverageMessage=`${Salla.lang.get("common.errors.error_occurred")}.`,this.trackSelectorResult("failed",i,[],h),this.confirmBtn?.stop(),void(this.confirming=!1);k()}s.allocation_headers={"s-scope-allocation-type":t,"s-scope-allocation-id":r?String(r):void 0}}this.markShownThisSession(),this.setStoredIntent({...s,scope_allocated:!0}),this.trackSelectorResult("accepted",i,R(s),h);const c={...s,address:this.buildAllocationConfirmedAddressData(r),branch:o??null,allocation_request:n,allocation_response:d.data??null};Salla.event.dispatch("salla::bullet-delivery.allocation.confirmed",c),this.bulletDeliveryConfirmed.emit({...s,address:r,branch:o}),this.emitHeaderContextUpdate(s,r,o),t=!0,setTimeout((()=>{if(this.confirmBtn?.stop(),this.close(),this.confirming=!1,this.cartSubmitConfirmationPending)setTimeout((()=>this.resolvePendingCartSubmit()),350);else if(h){const e=Salla.storage.get("scope")||{};let t=Salla.helpers.addParamToUrl("scope",h);e.allocation_id&&(t=Salla.helpers.addParamToUrl("allocation_id",e.allocation_id,t)),e.allocation_type&&(t=Salla.helpers.addParamToUrl("allocation_type",e.allocation_type,t)),window.location.replace(t)}else window.location.reload()}),500)}finally{t||(this.confirming=!1)}}getCartViewConfig(e){if(!e||!Salla.url.is_page("cart"))return null;if(!this.isIntentMethodSupported(e))return null;const t="branch"===e.type,i="address"===e.type,s=e.branch_details?.name?.trim();return{title:t?[Salla.lang.get("pages.checkout.pickup_option"),s].filter(Boolean).join(": "):Salla.lang.get("pages.checkout.delivery_option"),subtitle:_(e,Salla.lang.get("common.elements.to"),""),buttonText:Salla.lang.get("common.elements.edit"),isAddress:i,intent:e}}createCartViewElement(){const e=this.getStoredIntent(),t=this.getCartViewConfig(e);if(!t)return null;const{title:i,subtitle:s,buttonText:r,intent:l}=t,a="branch"===l.type?{preselected_branch_id:w(l)}:{preselected_address_id:l.address_id},o=document.createElement("span");o.className="s-bullet-delivery-cart-view-icon s-bullet-delivery-tab-icon",o.setAttribute("aria-hidden","true"),o.innerHTML=N;const n=document.createElement("span");n.className="s-bullet-delivery-cart-view-title",n.textContent=i;const d=document.createElement("span");d.className="s-bullet-delivery-cart-view-subtitle",d.textContent=s;const h=document.createElement("div");h.className="s-bullet-delivery-cart-view-text",h.append(n,d);const c=document.createElement("div");c.className="s-bullet-delivery-cart-view-info",c.append(o,h);const u=document.createElement("salla-button");u.className="s-bullet-delivery-cart-view-button",u.setAttribute("fill","outline"),u.setAttribute("color","primary"),u.textContent=r,u.addEventListener("click",(()=>Salla.event.emit("salla::bullet-delivery.modal.open.requested",a)));const p=document.createElement("div");return p.className="s-bullet-delivery-cart-view",p.append(c,u),p}renderPickupTabBadge(){if(!this.pickupDiscountResolved)return null;const t=this.pickupDiscountRange;return t?e("span",{class:"s-bullet-delivery-tab-badge s-bullet-delivery-discount-badge",dir:this.isArabic?"rtl":"ltr",innerHTML:this.getPickupDiscountLabel(t.type,t.min,t.max)}):e("span",{class:"s-bullet-delivery-tab-badge"},e("span",{class:"s-bullet-delivery-tab-badge-icon",innerHTML:'<svg width="7" height="10" viewBox="0 0 7 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.41015 0.036C5.73815 0.084 5.96415 0.222 6.08815 0.45C6.21215 0.678 6.21415 0.952 6.09415 1.272C6.03815 1.432 5.89415 1.72 5.66215 2.136L5.13415 3.108C5.03015 3.308 4.96215 3.44 4.93015 3.504C4.91415 3.544 4.90215 3.576 4.89415 3.6C4.89415 3.656 4.91815 3.7 4.96615 3.732C4.99015 3.74 5.02615 3.748 5.07415 3.756H5.51815C5.79815 3.756 5.99015 3.76 6.09415 3.768C6.30215 3.784 6.45815 3.832 6.56215 3.912C6.70615 4.008 6.81215 4.138 6.88015 4.302C6.94815 4.466 6.97015 4.636 6.94615 4.812C6.93015 4.948 6.85815 5.1 6.73015 5.268C6.66615 5.356 6.53815 5.508 6.34615 5.724L3.65815 8.82C3.35415 9.172 3.14815 9.398 3.04015 9.498C2.93215 9.598 2.83415 9.664 2.74615 9.696C2.58615 9.768 2.43415 9.766 2.29015 9.69C2.14615 9.614 2.05415 9.488 2.01415 9.312C1.99815 9.208 1.99615 9.08 2.00815 8.928C2.02015 8.776 2.07415 8.472 2.17015 8.016L2.50615 6.432C2.57815 6.104 2.61815 5.888 2.62615 5.784C2.63415 5.728 2.62215 5.686 2.59015 5.658C2.55815 5.63 2.52615 5.612 2.49415 5.604C2.39815 5.588 2.18615 5.58 1.85815 5.58H1.60615C1.19815 5.58 0.918154 5.568 0.766154 5.544C0.462154 5.504 0.246154 5.38 0.118154 5.172C-0.00984615 4.964 -0.0338462 4.704 0.0461538 4.392C0.0861538 4.24 0.190154 3.968 0.358154 3.576L1.25815 1.464C1.41015 1.112 1.51815 0.872 1.58215 0.744C1.71015 0.512 1.85815 0.34 2.02615 0.228C2.19415 0.116 2.40215 0.048 2.65015 0.024C2.79415 0.008 3.05415 0 3.43015 0H4.47415C4.93815 0 5.25015 0.012 5.41015 0.036Z" fill="white"/></svg>',"aria-hidden":"true"}),Salla.lang.getWithDefault("pages.checkout.save_delivery_fees","وفّر رسوم التوصيل"))}renderTabs(){return this.supportsPickup?e("div",{class:"s-bullet-delivery-tabs"},this.isSupportsDelivery&&e("button",{type:"button",class:{"s-bullet-delivery-tab":!0,"s-bullet-delivery-tab--active":"address"===this.activeTab},onClick:()=>this.handleTabChange("address")},e("span",null,Salla.lang.get("mobile_app.strings.delivery"))),e("button",{type:"button",class:{"s-bullet-delivery-tab":!0,"s-bullet-delivery-tab--active":"branch"===this.activeTab},onClick:()=>this.handleTabChange("branch")},e("span",null,Salla.lang.get("mobile_app.strings.pickup")),this.renderPickupTabBadge())):null}renderAlert(t){return e("div",{class:"s-bullet-delivery-allocation-out-of-coverage",role:"alert"},e("span",{class:"s-bullet-delivery-allocation-out-of-coverage-icon","aria-hidden":"true"},e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true"},e("title",null,"Information"),e("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor","stroke-width":"1.5",fill:"currentColor"}),e("text",{x:"10",y:"14","text-anchor":"middle",fill:"white","font-size":"12","font-weight":"bold"},"i"))),e("span",{class:"s-bullet-delivery-allocation-out-of-coverage-text",style:{textAlign:this.isRTL?"right":"left"}},t))}renderAllocationOutOfCoverageAlert(){const t=this.allocationOutOfCoverageMessage||Salla.lang.get("pages.checkout.shipping_not_available");return this.renderAlert("address"!==this.activeTab?t:this.supportsPickup?[`${t} ${Salla.lang.getWithDefault("pages.cart.choose_another_address_pickup","Choose another address or")} `,e("button",{type:"button",class:"underline !text-blue-600",onClick:()=>this.handleTabChange("branch")},Salla.lang.getWithDefault("pages.cart.branch_pickup","pick up from a branch"))]:`${t} ${Salla.lang.getWithDefault("pages.cart.choose_another_address","Choose another address")}`)}renderCountrySelect(t=!0){return e("div",{class:"s-bullet-delivery-field"},e("salla-searchable-dropdown",{label:t?Salla.lang.get("blocks.buy_as_gift.receiver_country"):void 0,placeholder:Salla.lang.get("pages.checkout.select_country"),items:this.displayedCountries,selectedItem:this.selectedCountry,loading:this.loadingCountries,searching:this.searchingCountries,disabled:this.countries.length<=1,required:!0,inputId:"bullet-delivery-country",searchQuery:this.countrySearchQuery,clientSearch:!0,onItemSelected:e=>this.handleCountrySelected(e.detail),onSearchInput:e=>this.handleCountrySearch(e.detail),onDropdownClosed:()=>this.handleCountryDropdownClosed()}))}renderRegionSelect(){return l(this.selectedCountry?.code??"")&&this.selectedCountry?e("div",{class:"s-bullet-delivery-field"},e("salla-searchable-dropdown",{label:Salla.lang.get("pages.checkout.region_field"),placeholder:Salla.lang.get("pages.checkout.select_region"),items:this.displayedRegions,selectedItem:this.selectedRegion,loading:this.loadingRegions,searching:this.searchingRegions,disabled:this.loadingRegions||0===this.regions.length,required:!0,inputId:"bullet-delivery-region",searchQuery:this.regionSearchQuery,clientSearch:!0,onItemSelected:e=>this.handleRegionSelected(e.detail),onSearchInput:e=>this.handleRegionSearch(e.detail),onDropdownClosed:()=>this.handleRegionDropdownClosed()})):null}renderCityDistrictSelects(){const t=l(this.selectedCountry?.code??""),i=t,s=i&&this.selectedCity&&!this.loadingDistricts&&0===this.districts.length,r=!this.selectedCountry||t&&!this.selectedRegion||this.loadingCities||0===this.cities.length,a=!this.selectedCountry||t&&!this.selectedRegion||!this.selectedCity||this.loadingDistricts;return e("div",{class:"s-bullet-delivery-field-row"},e("div",{class:"s-bullet-delivery-field"},e("salla-searchable-dropdown",{label:Salla.lang.get("blocks.buy_as_gift.receiver_city"),placeholder:Salla.lang.get("pages.checkout.select_city"),items:this.displayedCities,selectedItem:this.selectedCity,loading:this.loadingCities,searching:this.searchingCities,disabled:r,required:!0,inputId:"bullet-delivery-city",searchQuery:this.citySearchQuery,onItemSelected:e=>this.handleCitySelected(e.detail),onSearchInput:e=>this.handleCitySearch(e.detail),onDropdownClosed:()=>this.handleCityDropdownClosed(),dropUp:!0})),i&&e("div",{class:"s-bullet-delivery-field"},s?e("div",null,e("label",{class:"s-bullet-delivery-label",htmlFor:"bullet-delivery-district"},Salla.lang.get("pages.checkout.district_field"),e("span",{class:"text-red-500"}," *")),e("input",{id:"bullet-delivery-district",type:"text",class:"form-input",placeholder:Salla.lang.get("pages.checkout.select_district"),value:this.districtName,disabled:a,onInput:e=>{this.districtName=e.target.value,this.updateNewAddressForm({district:void 0})}})):e("salla-searchable-dropdown",{label:Salla.lang.get("pages.checkout.district_field"),placeholder:Salla.lang.get("pages.checkout.select_district"),items:this.displayedDistricts,selectedItem:this.selectedDistrict,loading:this.loadingDistricts,searching:this.searchingDistricts,disabled:a||0===this.districts.length,required:!0,inputId:"bullet-delivery-district",searchQuery:this.districtSearchQuery,clientSearch:!0,onItemSelected:e=>this.handleDistrictSelected(e.detail),onSearchInput:e=>this.handleDistrictSearch(e.detail),onDropdownClosed:()=>this.handleDistrictDropdownClosed(),dropUp:!0})))}renderSavedAddressesEmptyState(){return e("div",{class:"s-bullet-delivery-saved-addresses-empty"},e("div",{class:"s-bullet-delivery-saved-addresses-empty-icon","aria-hidden":"true"},e("svg",{width:"28",height:"28",viewBox:"0 0 28 29",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("title",null,"No Saved Adresses"),e("path",{d:"M20.16 0C21.4613 0 22.6773 0.341333 23.808 1.024C24.9387 1.70667 25.8347 2.61333 26.496 3.744C27.1787 4.91733 27.52 6.18667 27.52 7.552C27.52 9.45067 26.8267 11.232 25.44 12.896C24.4587 14.0907 23.0827 15.2427 21.312 16.352H21.28C20.9387 16.5653 20.5653 16.672 20.16 16.672C19.7547 16.672 19.3813 16.5653 19.04 16.352H19.008C17.2373 15.2213 15.8613 14.0693 14.88 12.896C13.4933 11.232 12.8 9.45067 12.8 7.552C12.8 6.18667 13.1413 4.91733 13.824 3.744C14.4853 2.61333 15.3813 1.70667 16.512 1.024C17.6427 0.341333 18.8587 0 20.16 0ZM11.488 1.984C9.67467 2.368 8.04267 3.14667 6.592 4.32C5.14133 5.49333 4.01067 6.92267 3.2 8.608C2.34667 10.3573 1.92 12.224 1.92 14.208C1.92 14.72 1.952 15.2427 2.016 15.776L2.08 15.744C2.57067 15.488 2.94933 15.3067 3.216 15.2C3.48267 15.0933 3.73867 15.0933 3.984 15.2C4.22933 15.3067 4.4 15.488 4.496 15.744C4.592 16 4.58667 16.256 4.48 16.512C4.37333 16.768 4.19733 16.9493 3.952 17.056C3.70667 17.1627 3.36 17.3227 2.912 17.536L2.656 17.664C2.57067 17.7067 2.48533 17.7387 2.4 17.76C2.89067 19.4667 3.70133 20.9973 4.832 22.352C5.96267 23.7067 7.296 24.7573 8.832 25.504C10.432 26.272 12.1173 26.656 13.888 26.656C15.4667 26.656 16.9813 26.3467 18.432 25.728C19.8187 25.1307 21.0667 24.288 22.176 23.2C21.92 23.0507 21.7653 22.8373 21.712 22.56C21.6587 22.2827 21.7013 22.0267 21.84 21.792C21.9787 21.5573 22.176 21.408 22.432 21.344C22.8373 21.2587 23.2 21.12 23.52 20.928C23.6907 20.8427 23.8613 20.8 24.032 20.8C24.8 19.5413 25.3333 18.176 25.632 16.704C25.6747 16.4267 25.808 16.2133 26.032 16.064C26.256 15.9147 26.496 15.8667 26.752 15.92C27.008 15.9733 27.2107 16.1173 27.36 16.352C27.5093 16.5867 27.552 16.832 27.488 17.088C27.0613 19.2853 26.1973 21.264 24.896 23.024C23.5947 24.784 22.0053 26.1547 20.128 27.136C18.1653 28.16 16.0853 28.672 13.888 28.672C11.3707 28.672 9.03467 28.0107 6.88 26.688C4.78933 25.408 3.12533 23.68 1.888 21.504C0.629333 19.264 0 16.832 0 14.208C0 11.904 0.490667 9.73867 1.472 7.712C2.41067 5.74933 3.728 4.09067 5.424 2.736C7.12 1.38133 9.01333 0.48 11.104 0.032C11.36 -0.032 11.6 0.0106667 11.824 0.16C12.048 0.309333 12.1867 0.522667 12.24 0.8C12.2933 1.07733 12.2453 1.328 12.096 1.552C11.9467 1.776 11.744 1.92 11.488 1.984ZM14.72 7.552C14.72 8.96 15.2533 10.304 16.32 11.584C17.1733 12.5867 18.3893 13.6 19.968 14.624C20.032 14.6453 20.096 14.656 20.16 14.656C20.224 14.656 20.288 14.6453 20.352 14.624C21.9307 13.6213 23.1467 12.608 24 11.584C25.0667 10.304 25.6 8.96 25.6 7.552C25.6 6.57067 25.3547 5.65333 24.864 4.8C24.3733 3.94667 23.7067 3.26933 22.864 2.768C22.0213 2.26667 21.12 2.016 20.16 2.016C19.2 2.016 18.2987 2.26667 17.456 2.768C16.6133 3.26933 15.9467 3.94667 15.456 4.8C14.9653 5.65333 14.72 6.57067 14.72 7.552ZM17.28 7.68C17.28 6.848 17.5627 6.13867 18.128 5.552C18.6933 4.96533 19.3707 4.672 20.16 4.672C20.9493 4.672 21.6267 4.96533 22.192 5.552C22.7573 6.13867 23.04 6.848 23.04 7.68C23.04 8.512 22.7573 9.216 22.192 9.792C21.6267 10.368 20.9493 10.656 20.16 10.656C19.3707 10.656 18.6933 10.368 18.128 9.792C17.5627 9.216 17.28 8.512 17.28 7.68ZM6.752 14.688C7.62667 14.7733 8.53333 15.0293 9.472 15.456C9.70667 15.5627 9.87733 15.744 9.984 16C10.0907 16.256 10.0907 16.512 9.984 16.768C9.87733 17.024 9.70133 17.2 9.456 17.296C9.21067 17.392 8.97067 17.3867 8.736 17.28C7.94667 16.9387 7.22133 16.736 6.56 16.672C6.28267 16.6293 6.064 16.5013 5.904 16.288C5.744 16.0747 5.68 15.8293 5.712 15.552C5.744 15.2747 5.86133 15.0507 6.064 14.88C6.26667 14.7093 6.496 14.6453 6.752 14.688ZM17.6 20.544C18.304 20.864 18.976 21.0987 19.616 21.248C19.872 21.312 20.0693 21.4613 20.208 21.696C20.3467 21.9307 20.3893 22.1813 20.336 22.448C20.2827 22.7147 20.144 22.9227 19.92 23.072C19.696 23.2213 19.4453 23.264 19.168 23.2C18.4213 23.0293 17.632 22.752 16.8 22.368C16.5653 22.2613 16.4 22.08 16.304 21.824C16.208 21.568 16.2133 21.312 16.32 21.056C16.4267 20.8 16.6027 20.624 16.848 20.528C17.0933 20.432 17.344 20.4373 17.6 20.544ZM12.832 17.44C13.0027 17.568 13.248 17.7493 13.568 17.984L14.496 18.688C14.7093 18.8587 14.8373 19.0773 14.88 19.344C14.9227 19.6107 14.8693 19.856 14.72 20.08C14.5707 20.304 14.368 20.4427 14.112 20.496C13.856 20.5493 13.6107 20.5013 13.376 20.352L11.744 19.072C11.5307 18.9227 11.4027 18.7093 11.36 18.432C11.3173 18.1547 11.3707 17.904 11.52 17.68C11.6693 17.456 11.872 17.3227 12.128 17.28C12.384 17.2373 12.6187 17.2907 12.832 17.44ZM20.16 8.672C20.416 8.672 20.64 8.576 20.832 8.384C21.024 8.192 21.12 7.95733 21.12 7.68C21.12 7.40267 21.024 7.16267 20.832 6.96C20.64 6.75733 20.416 6.656 20.16 6.656C19.904 6.656 19.68 6.75733 19.488 6.96C19.296 7.16267 19.2 7.40267 19.2 7.68C19.2 7.95733 19.296 8.192 19.488 8.384C19.68 8.576 19.904 8.672 20.16 8.672Z",fill:"#666666"}))),e("p",{class:"s-bullet-delivery-saved-addresses-empty-title"},Salla.lang.get("pages.checkout.no_saved_addresses")),e("p",{class:"s-bullet-delivery-saved-addresses-empty-desc"},Salla.lang.get("pages.checkout.add_address_simplify_shipping")),e("salla-button",{onClick:()=>this.handleAddNewAddress(),onKeyUp:()=>this.handleAddNewAddress()},Salla.lang.get("pages.checkout.add_new_address")))}async saveSessionAddressToProfile(){const e=this.getStoredIntent();if(S(e)){const t=e.address_details,i={lat:t.lat,lng:t.lng,...t.place_id&&{short_address:t.place_id},...t.description&&{description:t.description}};try{const{success:t,address:s}=await a.saveAddressLocation(i);return t&&s?(this.setStoredIntent({...e,address_id:s.id,scope_allocated:!1}),this.addressCreated.emit({address:s}),s):null}catch(e){return console.error("SallaBulletDelivery: Error saving session address (map)",e),null}}const t=c(e),i=h(e),s=p(e);if(!e||"address"!==e.type||!t||!i)return null;const r=H(e);if(l(r)&&!s)return null;const o=l(r),n=e.address_details?.district?.name??"",d={country_id:t,region_id:u(e),city_id:i,district_id:s,description:n};o&&(d.local=n);try{const{success:t,address:i}=await a.saveAddressLocation(d);if(!t)return null;const s=i??null;return s&&(this.setStoredIntent({...e,address_id:s.id,scope_allocated:!1}),this.addressCreated.emit({address:s})),s}catch(e){return console.error("SallaBulletDelivery: Error saving session address",e),null}}renderSavedAddresses(){if(!this.isLoggedIn)return null;if(this.loadingSavedAddresses)return e("div",{class:"s-bullet-delivery-addresses-list s-scrollbar"},[1,2,3].map((t=>e("div",{key:t,class:"s-bullet-delivery-address-item s-bullet-delivery-address-item--skeleton"},e("salla-skeleton",{class:"s-bullet-delivery-skel-radio",height:"18px",width:"18px"}),e("salla-skeleton",{class:"s-bullet-delivery-skel-map",height:"36px",width:"36px"}),e("div",{class:"s-bullet-delivery-address-content"},e("div",{class:"s-bullet-delivery-address-lines"},e("salla-skeleton",{height:"18px",width:"72%"}),e("salla-skeleton",{height:"16px",width:"56%"})))))));const t=this.getStoredIntent(),i=d(t),s=S(t),r=i&&t?.address_details?s?t.address_details.formatted_address??"":[t.address_details.city?.name,t.address_details.country?.name].filter(Boolean).join("، ")||"":"",l=i&&t?.address_details&&!s?(t.address_details.district?.name??"").trim():"";return 0!==this.savedAddresses.length||i?e("div",{class:"s-bullet-delivery-addresses-list s-scrollbar"},i&&this.renderAddressRow({key:"session-address",line1:r,line2:l,selected:this.selectedSessionAddress,onClick:()=>this.handleSessionAddressSelect()}),this.savedAddresses.map((e=>{const t=[e.building_number,e.street].filter(Boolean).join("، ")||e.formatted?.address_one||e.short_address||"",i=[e.district?.name,e.city?.name,e.country?.name].filter(Boolean).join("، "),s=(e.formatted?.address_two||i)??"",r=!1!==e.is_in_coverage;return this.renderAddressRow({key:String(e.id),line1:t,line2:s,selected:this.selectedSavedAddress?.id===e.id,disabled:!r,onClick:()=>r&&this.handleSavedAddressSelect(e)})}))):this.renderSavedAddressesEmptyState()}renderAddressRow(t){const{key:i,line1:s,line2:r,selected:l,disabled:a=!1,onClick:o}=t;return e("button",{key:i,class:{"s-bullet-delivery-address-item":!0,"s-bullet-delivery-address-item--selected":l,"s-bullet-delivery-address-item--disabled":a},type:"button",onClick:a?void 0:o,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),a||o())}},e("input",{type:"radio",name:"saved_address",class:"s-bullet-delivery-radio",checked:l,disabled:a}),e("span",{class:"s-bullet-delivery-address-map-icon",innerHTML:Q,"aria-hidden":"true"}),e("div",{class:"s-bullet-delivery-address-content"},e("div",{class:"s-bullet-delivery-address-lines"},e("span",{class:"s-bullet-delivery-address-line1",style:{textAlign:this.isRTL?"right":"left"}},s),e("span",{class:"s-bullet-delivery-address-line2",style:{textAlign:this.isRTL?"right":"left"}},r))))}renderMapSection(){const t=l(this.selectedCountry?.code??""),i=this.mapLocationData,s=null!=i?.lat&&null!=i?.lng,r=s?{lat:i.lat,lng:i.lng}:this.mapInitialCenter;return e("div",{class:"s-bullet-delivery-map-container"},e("gmap-map",{ref:e=>this.gmapRef=e,center:r,zoom:16,"min-zoom":4,"max-zoom":21,"map-id":"DEMO_MAP_ID","enable-autocomplete":!0,"enable-geolocation":!0,"show-location-marker":!0,"location-marker-position":s?{lat:i.lat,lng:i.lng,accuracy:50}:{...r,accuracy:50},language:Salla.lang.getLocale?.()??document.documentElement.lang??"ar","geolocation-button-label":Salla.lang.get("pages.checkout.current_location"),"autocomplete-placeholder":Salla.lang.get("pages.checkout.search_for_address"),"autocomplete-hint":t?Salla.lang.get("pages.checkout.short_address_format_validation"):void 0,"autocomplete-country":this.selectedCountry?.code?.toLowerCase(),"autocomplete-resolve":!1,"autocomplete-auth-token":this.addressToken,"location-marker-background":"#4285F4","location-marker-border-color":"#1967D2","location-marker-glyph-color":"#FFFFFF","location-marker-scale":1.3,"onGmap-location-changed":this.handleMapLocationChanged,"onGmap-ready":this.handleMapReady}))}renderAddressConfirmation(){const t=this.mapLocationData?.formattedAddress??"";return e("div",{class:"s-bullet-delivery-address-confirm"},e("div",{class:"s-bullet-delivery-address-confirm-card"},e("span",{class:"s-bullet-delivery-address-map-icon",innerHTML:Q,"aria-hidden":"true"}),e("div",{class:"s-bullet-delivery-address-confirm-details"},e("span",{class:"s-bullet-delivery-address-confirm-label"},Salla.lang.get("pages.checkout.selected_address")),e("p",{class:"s-bullet-delivery-address-confirm-text"},t))),e("div",{class:"s-bullet-delivery-address-confirm-description"},e("label",{class:"s-bullet-delivery-address-confirm-description-label"},Salla.lang.get("pages.checkout.address_description"),e("span",{class:"s-bullet-delivery-address-confirm-description-optional"},Salla.lang.get("common.elements.optional"))),e("input",{type:"text",class:"s-bullet-delivery-address-confirm-description-input form-input",placeholder:Salla.lang.get("pages.checkout.address_description_placeholder"),value:this.addressDescription,onInput:e=>{this.addressDescription=e.target.value}})))}renderLocationPermissionNotice(){return U(this.locationPermission)?e(W,{isRTL:this.isRTL,onActivate:this.handleLocationPermissionRequest}):null}renderLocationDistanceWarning(){const t=this.mapLocationData;if("granted"!==this.locationPermission||!this.liveLocation||null==t?.lat||null==t?.lng)return null;const i=function(e,t){const i=K(t.lat-e.lat),s=K(t.lng-e.lng),r=K(e.lat),l=K(t.lat),a=Math.sin(i/2)**2+Math.cos(r)*Math.cos(l)*Math.sin(s/2)**2;return 12742*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}(this.liveLocation,{lat:t.lat,lng:t.lng});return i<=.5?null:e(Y,{distanceKm:i,isRTL:this.isRTL})}renderGuestDeliveryForm(){if(this.isMapModeAvailable)return[this.renderMapSection(),this.renderLocationPermissionNotice(),this.renderLocationDistanceWarning(),this.hasMapLocation()?this.renderAddressConfirmation():null,this.renderMapCountryNotice()];const e=l(this.selectedCountry?.code??"");return[this.renderCountrySelect(),e?this.renderRegionSelect():null,this.renderCityDistrictSelects()]}renderDeliveryTab(){return e("div",{class:{"s-bullet-delivery-content":!0,"s-bullet-delivery-content--active":"address"===this.activeTab,"s-hidden":"address"!==this.activeTab}},this.isLoggedIn?this.renderSavedAddresses():this.renderGuestDeliveryContent())}renderGuestDeliveryContent(){if(!this.isMapModeAvailable)return this.renderGuestDeliveryForm();const t=this.canConfirmMapLocation()&&!this.isGuestMapCountryBlocked(),i=this.confirming?Salla.lang.get("pages.checkout.loading"):Salla.lang.get("pages.checkout.confirm_address");return e("form",{onSubmit:e=>{e.preventDefault(),this.handleConfirm()}},this.renderGuestDeliveryForm(),e("div",{class:"s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single",style:{padding:"24px"}},e("salla-button",{type:"submit",loading:this.confirming,disabled:!t||this.confirming,width:"wide"},i),!this.isLoggedIn&&e("button",{type:"button",class:"s-bullet-delivery-login-prompt",onClick:()=>this.handleLogin()},Salla.lang.get("pages.checkout.login_to_use_saved_addresses"))))}renderBranchSearch(){return e("div",{class:"s-bullet-delivery-branch-search"},e("div",{class:"s-bullet-delivery-search-row"},e("div",{class:"s-bullet-delivery-search s-bullet-delivery-branch-search-wrap"},e("span",{class:"s-bullet-delivery-search-icon s-bullet-delivery-branch-search-icon",innerHTML:q,"aria-hidden":"true"}),e("input",{type:"text",class:"s-bullet-delivery-branch-search-input form-input",placeholder:Salla.lang.getWithDefault("pages.checkout.search_for_country_city_or_branch",this.isArabic?"ابحث عن دولة أو مدينة أو فرع":"Search for a country, city or branch"),value:this.branchSearchQuery,onInput:e=>this.handleBranchSearch(e),autocomplete:"off"})),e("button",{type:"button",class:{"s-bullet-delivery-location-btn":!0,"s-bullet-delivery-location-btn--full":!0,"s-bullet-delivery-location-btn--loading":this.loadingNearestBranch},onClick:()=>this.handleFindNearestBranch(),disabled:this.loadingNearestBranch,"aria-label":Salla.lang.get("pages.checkout.nearest_to_my_location")},this.loadingNearestBranch?e("span",{class:"s-bullet-delivery-location-icon","aria-hidden":"true"},e("salla-skeleton",{height:"16px",width:"16px"})):e("span",{class:"s-bullet-delivery-location-icon",innerHTML:N,"aria-hidden":"true"}),e("span",{class:"s-bullet-delivery-location-label"},Salla.lang.get("pages.checkout.nearest_to_my_location")))),this.locationError&&"branch"===this.activeTab&&e("span",{class:"s-bullet-delivery-error"},this.locationError))}renderBranchList(){if(this.loadingBranches)return e("div",{class:"s-bullet-delivery-branches-wrap"},e("div",{class:"s-bullet-delivery-branches-loading"},[1,2,3,4].map((t=>e("div",{key:t,class:"s-bullet-delivery-branch-skeleton"},e("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-radio",type:"circle",height:"16px",width:"16px"}),e("div",{class:"s-bullet-delivery-branch-skeleton-icon"},e("salla-skeleton",{height:"34px",width:"34px"})),e("div",{class:"s-bullet-delivery-branch-skeleton-content"},e("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-title",height:"12px",width:"124px"})),e("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-time",height:"12px",width:"88px"}),e("div",{class:"s-bullet-delivery-branch-skeleton-map"},e("salla-skeleton",{height:"32px",width:"32px"})))))));const t=this.filteredBranches.filter(C);return 0===t.length?e("salla-placeholder",{alignment:"center",class:"s-bullet-delivery-placeholder"},e("span",{slot:"title"},Salla.lang.get("pages.checkout.no_pickup_branches_found"))):e("div",{class:"s-bullet-delivery-branches-wrap"},e("ul",{class:"s-bullet-delivery-branches-list s-scrollbar",role:"listbox"},t.map((t=>{const i=g(t),s=this.selectedBranch?.id===t.id,r=[t.country?.name,t.city?.name,t.district?.name].filter(Boolean).join("، "),l=T(t.distance_km),a=z(t)??this.getReadyTodayLabel(t),o=a?null:this.getPreparationShortLabel(t.preparation_time_range),n=M(L(t)),d=n.length>0&&!$(t),h=d&&this.expandedScheduleBranchId===t.id,c=I(t),u=A(t),p=D(t),b=B(t);return e("li",{key:t.id,class:{"s-bullet-delivery-branch-item":!0,"s-bullet-delivery-branch-item--selected":s,"s-bullet-delivery-branch-item--disabled":!i},tabIndex:i?0:-1,role:"option","aria-selected":s,"aria-disabled":!i,onClick:()=>i&&this.handleBranchSelect(t),onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),i&&this.handleBranchSelect(t)))}},e("input",{type:"radio",name:"branch",class:"s-bullet-delivery-radio s-bullet-delivery-branch-radio",checked:s,disabled:!i,tabIndex:-1}),e("div",{class:"s-bullet-delivery-branch-body"},e("p",{class:"s-bullet-delivery-branch-name"},e("span",null,t.name),b?e("span",{class:"s-bullet-delivery-discount-badge",dir:this.isArabic?"rtl":"ltr",innerHTML:this.getPickupDiscountLabel(b.type,b.amount)}):null),r?e("span",{class:"s-bullet-delivery-branch-meta s-bullet-delivery-branch-location"},e("span",{class:"s-bullet-delivery-branch-meta-icon",innerHTML:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="8.00016" cy="4.66667" r="2.66667" stroke="#555555" stroke-width="1.125"/><path d="M8 7.33337L8 12" stroke="#555555" stroke-width="1.125" stroke-linecap="round"/><path d="M11.3332 12.6666C11.3332 13.403 9.84079 14 7.99984 14C6.15889 14 4.6665 13.403 4.6665 12.6666" stroke="#555555" stroke-width="1.125" stroke-linecap="round"/></svg>',"aria-hidden":"true"}),e("span",null,r)):null,s&&t.pickup_instructions?e("span",{class:"s-bullet-delivery-branch-meta s-bullet-delivery-branch-instructions"},e("span",{class:"s-bullet-delivery-branch-meta-icon",innerHTML:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.58709 4.67775L11.769 5.52554M7.90501 7.20895L9.49598 7.63284M7.98415 11.9777L8.62054 12.1472C10.4205 12.6268 11.3205 12.8666 12.0295 12.4595C12.7385 12.0525 12.9797 11.1576 13.462 9.36777L14.1441 6.83657C14.6264 5.04674 14.8675 4.15183 14.4582 3.44681C14.0488 2.7418 13.1488 2.50201 11.3489 2.02242L10.7125 1.85287C8.91249 1.37328 8.0125 1.13349 7.30349 1.54053C6.59447 1.94757 6.35332 2.84249 5.87102 4.63231L5.18894 7.16351C4.70664 8.95334 4.46549 9.84825 4.87484 10.5533C5.28419 11.2583 6.18418 11.4981 7.98415 11.9777Z" stroke="#555555" stroke-width="1.125" stroke-linecap="round"/><path d="M8.00016 13.964L7.36527 14.1369C5.56952 14.6259 4.67164 14.8704 3.96429 14.4554C3.25694 14.0404 3.01636 13.1279 2.53519 11.303L1.85471 8.72211C1.37354 6.89717 1.13295 5.98471 1.54134 5.26586C1.89461 4.64404 2.66683 4.66668 3.66683 4.66661" stroke="#555555" stroke-width="1.125" stroke-linecap="round"/></svg>',"aria-hidden":"true"}),e("span",null,t.pickup_instructions)):null,e("div",{class:"s-bullet-delivery-branch-meta-row"},l||a||o?e("div",{class:"s-bullet-delivery-branch-pills"},l?e("span",{class:"s-bullet-delivery-branch-meta s-bullet-delivery-branch-pill s-bullet-delivery-branch-distance"},e("i",{class:"sicon-location"}),e("span",null,this.renderDistanceLabel(l))):null,a?e("span",{class:"s-bullet-delivery-branch-meta s-bullet-delivery-branch-pill s-bullet-delivery-branch-prep"},e("span",{class:"s-bullet-delivery-branch-meta-icon",innerHTML:X,"aria-hidden":"true"}),e("span",{class:"s-bullet-delivery-branch-meta-value"},a)):o?e("span",{class:"s-bullet-delivery-branch-meta s-bullet-delivery-branch-pill s-bullet-delivery-branch-prep"},e("span",{class:"s-bullet-delivery-branch-meta-icon",innerHTML:X,"aria-hidden":"true"}),e("span",null,e("span",{class:"s-bullet-delivery-branch-meta-label"},Salla.lang.getWithDefault("pages.checkout.pickup_branch_ready_in","Pickup available after:")," "),e("span",{class:"s-bullet-delivery-branch-meta-value"},o))):null):null,e("hr",{class:"s-bullet-delivery-branch-divider"}),this.renderBranchOpenStatus(t,d,h)),h&&e("div",{class:"s-bullet-delivery-branch-schedule"},n.map(((t,i)=>e("div",{key:i,class:"s-bullet-delivery-branch-schedule-day"},e("span",{class:"s-bullet-delivery-branch-schedule-days"},t.days.length>1?`${t.days[0]} - ${t.days[t.days.length-1]}`:t.days[0]),e("span",{class:"s-bullet-delivery-branch-schedule-times"},t.times.map((e=>`${this.formatClock(e.start)} - ${this.formatClock(e.end)}`)).join(this.isArabic?"، ":", "))))))),e("div",{class:"s-bullet-delivery-branch-actions"},c&&e("a",{href:c,class:"s-bullet-delivery-branch-action",title:Salla.lang.getWithDefault("pages.checkout.branch_call","اتصال"),onClick:e=>e.stopPropagation()},e("i",{class:"sicon-phone"})),u&&e("a",{href:u,target:"_blank",rel:"noopener noreferrer",class:"s-bullet-delivery-branch-action",title:Salla.lang.getWithDefault("pages.checkout.branch_whatsapp","واتساب"),onClick:e=>e.stopPropagation()},e("i",{class:"sicon-whatsapp2"})),p&&e("a",{href:p,target:"_blank",rel:"noopener noreferrer",class:"s-bullet-delivery-branch-action s-bullet-delivery-branch-map-link",title:Salla.lang.get("common.elements.open_in_google_maps"),onClick:e=>e.stopPropagation()},e("span",{class:"s-bullet-delivery-branch-map-link-icon",innerHTML:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M7.94798 3.19336C11.1309 2.1083 12.7223 1.56578 13.5783 2.42174C14.4342 3.27771 13.8917 4.86914 12.8066 8.05201L12.0678 10.2195C11.2344 12.6639 10.8178 13.8861 10.131 13.9872C9.94631 14.0144 9.75517 13.9981 9.57248 13.9394C8.89297 13.7212 8.53377 12.4326 7.81538 9.8553C7.65604 9.28364 7.57637 8.99781 7.39494 8.7795C7.34228 8.71614 7.28386 8.65772 7.2205 8.60506C7.00219 8.42363 6.71636 8.34396 6.1447 8.18462C3.56741 7.46623 2.27876 7.10703 2.0606 6.42752C2.00195 6.24483 1.98558 6.05369 2.01277 5.86903C2.11392 5.18221 3.33613 4.76556 5.78054 3.93225L7.94798 3.19336Z"\n stroke="#555555" stroke-width="1.2" />\n</svg>\n '.replace(/mask0_25437_34440/g,`mask0_branch_${t.id}`),"aria-hidden":"true"}),e("span",{class:"sr-only"},Salla.lang.get("common.elements.open_in_google_maps")))))}))))}renderDistanceLabel(t){const i=Salla.lang.getWithDefault("pages.checkout.branch_distance_from_you","يبعد عنك: ~ {distance} كم"),s=i.indexOf("{distance}");return-1===s?i:[e("span",{class:"s-bullet-delivery-branch-meta-label"},i.slice(0,s)),e("span",{class:"s-bullet-delivery-branch-meta-value"},i.slice(s).replace("{distance}",t))]}get isArabic(){return"ar"===(Salla.lang.getLocale?.()??document.documentElement.lang)}formatClock(e){return P(e,this.isArabic?"ar":"en")}getReadyTodayLabel(e){const t=F(e);return t?`${Salla.lang.getWithDefault("pages.checkout.pickup_branch_ready_today_at","جاهز اليوم")} ${this.formatClock(t)}`:null}getPreparationShortLabel(e){if(!e?.from||!e?.to)return null;const t={minute:["pages.checkout.preparation_time_minute_short","د"],hour:["pages.checkout.preparation_time_hour_short","س"],day:["pages.checkout.preparation_time_day_short","يوم"]},i=e=>t[e]?Salla.lang.getWithDefault(t[e][0],t[e][1]):null,s=i(e.from.unit),r=i(e.to.unit);return s&&r?e.from.unit===e.to.unit?`${e.from.value}-${e.to.value} ${r}`:`${e.from.value} ${s} - ${e.to.value} ${r}`:null}renderBranchOpenStatus(t,i,s){const r=i&&e("button",{type:"button",class:"s-bullet-delivery-branch-schedule-toggle","aria-expanded":s?"true":"false","aria-label":Salla.lang.getWithDefault("pages.checkout.pickup_show_weekly_hours","عرض ساعات العمل الأسبوعية"),onClick:e=>{e.stopPropagation(),this.toggleBranchSchedule(t.id)}},e("i",{class:{"sicon-keyboard_arrow_down":!0,"is-expanded":s}}));if(j(t))return e("span",{class:"s-bullet-delivery-branch-meta s-bullet-delivery-branch-open-status"},e("span",{class:"s-bullet-delivery-branch-meta-icon",innerHTML:J,"aria-hidden":"true"}),e("span",{class:"s-bullet-delivery-pickup-status--busy"},Salla.lang.getWithDefault("pages.checkout.pickup_branch_busy","مشغول، لا يستقبل طلبات")),r);const l=$(t),a=t.pickup_readiness?.open_status_line;if(!l&&a)return e("span",{class:"s-bullet-delivery-branch-meta s-bullet-delivery-branch-open-status"},e("span",{class:"s-bullet-delivery-branch-meta-icon",innerHTML:J,"aria-hidden":"true"}),e("span",null,a),r);if(!l&&!i)return null;if(!l&&"boolean"!=typeof t.is_open)return e("span",{class:"s-bullet-delivery-branch-meta s-bullet-delivery-branch-open-status"},r);const o=l||t.is_open,n=l?Salla.lang.getWithDefault("pages.checkout.pickup_branch_always_open","مفتوح دائمًا 24/7"):o?Salla.lang.getWithDefault("pages.checkout.pickup_branch_open","مفتوح"):Salla.lang.getWithDefault("pages.checkout.pickup_branch_closed","مغلق");return e("span",{class:"s-bullet-delivery-branch-meta s-bullet-delivery-branch-open-status"},e("span",{class:"s-bullet-delivery-branch-meta-icon",innerHTML:J,"aria-hidden":"true"}),e("span",{class:o?"s-bullet-delivery-pickup-status--open":"s-bullet-delivery-pickup-status--closed"},n),r)}renderPickupTab(){return e("div",{class:{"s-bullet-delivery-content":!0,"s-bullet-delivery-content--active":"branch"===this.activeTab,"s-hidden":"branch"!==this.activeTab}},e("div",{class:"s-bullet-delivery-pickup-filters"},e("div",{class:"s-bullet-delivery-pickup-filters-row"},this.renderCountrySelect(!1),this.renderBranchCitySelect()),this.renderBranchSearch()),this.renderBranchList())}renderBranchCitySelect(){return e("div",{class:"s-bullet-delivery-field"},e("salla-searchable-dropdown",{placeholder:Salla.lang.get("pages.checkout.select_city"),items:[{id:-1,name:Salla.lang.getWithDefault("pages.checkout.all_cities",this.isArabic?"كل المدن":"All cities")},...this.branchCities],selectedItem:this.selectedBranchCity,loading:this.loadingBranches&&0===this.branchCities.length,disabled:0===this.branchCities.length&&!this.selectedBranchCity,inputId:"bullet-delivery-branch-city",searchQuery:this.branchCitySearchQuery,clientSearch:!0,onItemSelected:e=>{this.branchCitySearchQuery="",this.handleBranchCitySelected(e.detail)},onSearchInput:e=>{this.branchCitySearchQuery=e.detail},onDropdownClosed:()=>{this.branchCitySearchQuery=""}}))}renderAddAddressForm(){const t=this.isMapModeAvailable,i=l(this.selectedCountry?.code??""),s=this.hasMapLocation();let r,a;if(t)r=this.canConfirmMapLocation(),a=this.confirming?Salla.lang.get("pages.checkout.loading"):Salla.lang.get("pages.checkout.confirm_address");else{const e=this.selectedCountry&&this.selectedCity&&(!i||this.selectedRegion)&&(!i||!!this.selectedDistrict||!!(this.districtName&&this.districtName.trim().length>0));r=s||e,a=this.confirming?Salla.lang.get("pages.checkout.loading"):Salla.lang.get("pages.checkout.confirm_address")}return e("div",{class:"s-bullet-delivery-add-address"},this.allocationOutOfCoverageMessage&&this.renderAllocationOutOfCoverageAlert(),e("form",{class:"s-bullet-delivery-add-address-form",onSubmit:e=>{e.preventDefault(),this.handleSubmitNewAddress(e)}},this.renderGuestDeliveryForm(),e("div",{class:"s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single"},e("salla-button",{type:"submit",loading:this.confirming,disabled:!r||this.confirming,class:"s-bullet-delivery-add-address-submit"},a),this.hasAddressesToGoBack()&&e("salla-button",{shape:"link",class:"s-bullet-delivery-back-to-list-link",onClick:()=>this.handleBackToAddressList()},Salla.lang.getWithDefault("pages.checkout.saved_addresses","العناوين المحفوظة"),e("i",{class:"sicon-arrow-left"})))))}renderFooter(){if("address"===this.activeTab&&!this.isLoggedIn&&this.isMapModeAvailable)return null;const t="address"===this.activeTab&&this.isLoggedIn;return e("div",{class:"s-bullet-delivery-footer"},e("salla-button",{ref:e=>{this.confirmBtn=e},disabled:this.isConfirmDisabled(),onClick:()=>this.handleConfirm(),"loader-position":"center",width:"wide"},"branch"===this.activeTab?Salla.lang.getWithDefault("pages.checkout.confirm_receipt_from_the_branch","تأكيد الإستلام من الفرع"):Salla.lang.get("pages.checkout.confirm_address")),t&&e("salla-button",{onClick:()=>this.handleAddNewAddress(),width:"wide",shape:"link"},Salla.lang.get("pages.checkout.add_new_address")),!this.isLoggedIn&&e("salla-button",{shape:"link",onClick:()=>this.handleLogin()},Salla.lang.get("pages.checkout.login_to_use_saved_addresses")))}renderMainView(){const t=this.isLoggedIn&&"address"===this.activeTab&&0===this.savedAddresses.length&&!d(this.getStoredIntent()),i="branch"===this.activeTab&&this.supportsPickup?this.renderPickupTab():this.renderDeliveryTab();return e("div",null,this.showCartWillBeClearedBanner&&this.renderAlert(Salla.lang.get("blocks.scope.empty_cart_warning")),this.allocationOutOfCoverageMessage&&this.renderAllocationOutOfCoverageAlert(),i,!t&&this.renderFooter())}handleAfterAddToCart(){if("after_add_to_cart"!==this.openingType)return;const e=this.shouldPromptIncompleteIntentThisSession();this.hasBeenShownThisSession()&&!e||this.modal?.hasAttribute?.("visible")||(e&&this.markIncompleteIntentPrompted(),this.open(!1,e?"incomplete_intent":"after_add_to_cart"))}overrideScopeSwitchUI(){const e=this.getStoredIntent(),t=document.querySelector('[onclick*="scopes"]');if(!t)return;const i=(e,t)=>e&&e.length>t?`${e.slice(0,t)}...`:e??"",s=e?"branch"===e.type?`${Salla.lang.get("mobile_app.strings.pickup")} ${Salla.lang.get("common.elements.from")} ${i(e.branch_details?.name,20)}`:`${Salla.lang.get("mobile_app.strings.delivery")} ${Salla.lang.get("common.elements.to")} ${i(e.address_details?.city?.name||(S(e)?e.address_details.formatted_address:void 0),10)}`:(()=>this.supportsPickup&&this.isSupportsDelivery?Salla.lang.getWithDefault("mobile_app.strings.pickup_or_delivery","Pick-up or delivery"):this.supportsPickup?Salla.lang.getWithDefault("mobile_app.strings.pickup_from_branch","Pick up from branch"):this.isSupportsDelivery?Salla.lang.getWithDefault("mobile_app.strings.delivery","Delivery"):null)();t.style.display="inline-flex",t.onclick=()=>this.open();const r=t.querySelector('span:not([class*="sicon"]):not([class*="icon"])');if(r)r.textContent=s;else{const e=Array.from(t.childNodes).find((e=>e.nodeType===Node.TEXT_NODE&&e.textContent?.trim()));e&&(e.textContent=` ${s}`)}}async componentWillLoad(){await Salla.onReady();try{this.overrideScopeSwitchUI(),this.cartSubmittingHandler=async()=>{if(this.isEnabled)return this.pendingCartSubmitPromise?this.isGuestUser()?(this.pendingCartSubmitResolver=null,this.pendingCartSubmitPromise=null,this.cartSubmitConfirmationPending=!1,void await new Promise((()=>{}))):(this.modal?.hasAttribute?.("visible")||this.open(!1,"checkout_gate"),void await this.pendingCartSubmitPromise):void(this.hasCompleteIntentForLoggedInUser()||(this.cartSubmitConfirmationPending=!0,this.pendingCartSubmitPromise=new Promise((e=>{this.pendingCartSubmitResolver=e,this.isGuestUser()?this.openGuestLogin():this.open(!1,"checkout_gate")})),await this.pendingCartSubmitPromise))},Salla.cart.event.onSubmitting(this.cartSubmittingHandler),Salla.cart.event.onBeforeStartFastCheckout(this.cartSubmittingHandler)}catch(e){console.warn("SallaBulletDelivery: overrideScopeSwitchUI failed",e)}Salla.event.on("salla::bullet-delivery.modal.open.requested",this.bulletDeliveryOpenHandler),this.closeHandler=this.close.bind(this),Salla.event.on("salla::bullet-delivery.modal.close.requested",this.closeHandler),Salla.event.on("modal::close",this.modalCloseHandler),this.isRTL=Salla.config.get("theme.is_rtl"),this.stopWatchingLocationPermission=function(e){let t=!1,i=null;const s=()=>{!t&&i&&e(i.state)};return O().then((r=>{t||(i=r,i?(e(i.state),i.addEventListener?.("change",s)):e("unknown"))})),()=>{t=!0,i?.removeEventListener?.("change",s),i=null}}((e=>{this.locationPermissionResolved=!0,this.handleLocationPermissionChanged(e).then((()=>{this.mapReady&&!U(e)&&this.locateOnMap()}))})),this.authLoggedInHandler=async()=>{this.cartSubmitConfirmationPending?await this.handlePendingSubmitAfterLogin():this.hasIncompleteUserAddressIntent()&&(await this.tryAutoConfirmAfterLogin()||this.modal?.hasAttribute?.("visible")||this.open(!1,"after_login"))},Salla.event.on("auth::logged.in",this.authLoggedInHandler),this.authLoggedOutHandler=()=>{this.clearBulletDeliveryStoredData()},Salla.event.on("auth::logged.out",this.authLoggedOutHandler),this.loginOpenHandler=e=>{e?.pendingCartSubmit&&this.armPendingCartSubmitGate()},Salla.event.on("login::open",this.loginOpenHandler),this.cartItemAddedHandler=()=>this.handleAfterAddToCart(),"function"==typeof Salla.cart?.event?.onItemAdded?(this.useCartEventApi=!0,Salla.cart.event.onItemAdded(this.cartItemAddedHandler)):Salla.event.on(this.cartItemAddedEvent,this.cartItemAddedHandler)}render(){return this.isMobileApp||!this.isEnabled?null:e(s,{class:"s-bullet-delivery"},e("salla-modal",{ref:e=>{this.modal=e},isClosable:!this.isRequired&&!this.shouldForceNonClosable(),onModalVisibilityChanged:e=>{e.target===this.modal&&this.handleModalVisibility(Boolean(e.detail))},class:"s-bullet-delivery-modal",width:"sm","data-testid":"salla-bullet-delivery-modal"},e("div",{class:"s-bullet-delivery-inner"},e("div",{class:"s-bullet-delivery-header"},e("h2",{class:"s-bullet-delivery-title"},"address"===this.activeTab?Salla.lang.get("blocks.home.add_address_for_order_delivery"):Salla.lang.getWithDefault("blocks.home.choose_pickup_branch_title",this.isArabic?"اختر فرع استلام طلبك":"Choose your pickup branch")),e("p",{class:"s-bullet-delivery-subtitle"},"address"===this.activeTab?Salla.lang.get("blocks.home.products_available_for_delivery_shown_while_shopping"):Salla.lang.get("blocks.home.choose_branch_for_order_pickup_description"))),this.renderTabs(),"main"===this.viewMode&&this.renderMainView(),"add-address"===this.viewMode&&this.renderAddAddressForm())))}componentDidLoad(){if(this.componentReady=!0,this.isMobileApp)return this.isEnabled&&!this.hasBeenShownThisSession()&&Salla.event.dispatch("salla::bullet-delivery.open-sheet"),this.bulletDeliveryMobileSelectHandler=e=>{const t=this.extractMobileSelectPayload(e);t?this.applyMobileBulletDeliverySelection(t):console.warn("SallaBulletDelivery: received empty mobile select payload",e)},void Salla.event.on("salla::bullet-delivery.select",this.bulletDeliveryMobileSelectHandler);if(this.pendingOpen)return this.pendingOpen=!1,void this.open(!1,this.openTrigger);switch(this.openingType){case"first_visit":this.hasBeenShownThisSession()?this.shouldPromptIncompleteIntentThisSession()&&(this.markIncompleteIntentPrompted(),this.open(!1,"incomplete_intent")):this.open(!1,"first_visit");break;case"on_cart_click":Salla.url.is_page("cart")&&(!0===this.getShownStorage().get(this.sessionShownKey)?this.shouldPromptIncompleteIntentThisSession()&&(this.markIncompleteIntentPrompted(),this.open(!1,"incomplete_intent")):this.open(!1,"on_cart_click"))}const e=this.createCartViewElement();e&&"function"==typeof salla?.hooks?.mount&&Salla.hooks.mount("cart:items.start",e).catch((()=>{}))}disconnectedCallback(){this.componentReady=!1,this.stopWatchingLocationPermission&&(this.stopWatchingLocationPermission(),this.stopWatchingLocationPermission=null),Salla.event.off("salla::bullet-delivery.modal.open.requested",this.bulletDeliveryOpenHandler),Salla.event.off("modal::close",this.modalCloseHandler),this.closeHandler&&(Salla.event.off("salla::bullet-delivery.modal.close.requested",this.closeHandler),this.closeHandler=null),this.cartItemAddedHandler&&(this.useCartEventApi&&"function"==typeof Salla.cart?.event?.offItemAdded?Salla.cart.event.offItemAdded(this.cartItemAddedHandler):Salla.event.off(this.cartItemAddedEvent,this.cartItemAddedHandler),this.cartItemAddedHandler=null),this.cartSubmittingHandler&&("function"==typeof Salla.cart?.event?.offSubmitting?Salla.cart.event.offSubmitting(this.cartSubmittingHandler):Salla.event.off("cart::submitting",this.cartSubmittingHandler),"function"==typeof Salla.cart?.event?.offBeforeStartFastCheckout?Salla.cart.event.offBeforeStartFastCheckout(this.cartSubmittingHandler):Salla.event.off("cart::before.start.fast-checkout",this.cartSubmittingHandler),this.cartSubmittingHandler=null),this.authLoggedInHandler&&(Salla.event.off("auth::logged.in",this.authLoggedInHandler),this.authLoggedInHandler=null),this.authLoggedOutHandler&&(Salla.event.off("auth::logged.out",this.authLoggedOutHandler),this.authLoggedOutHandler=null),this.loginOpenHandler&&(Salla.event.off("login::open",this.loginOpenHandler),this.loginOpenHandler=null),this.bulletDeliveryMobileSelectHandler&&(Salla.event.off("salla::bullet-delivery.select",this.bulletDeliveryMobileSelectHandler),this.bulletDeliveryMobileSelectHandler=null)}};se.INITIAL_ADDRESS_FORM={country_id:0,is_default:!1,city_id:void 0,district_id:void 0,street:void 0,building_number:void 0,additional_number:void 0,postal_code:void 0,description:void 0},se.DROPDOWN_SEARCH_DEBOUNCE_MS=400,se.DROPDOWN_SEARCH_MIN_CHARS=2,se.style='/*!twlt*/@charset "UTF-8";@supports (interpolate-size: allow-keywords) and (block-size: calc-size(auto, size)){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body,.s-bullet-delivery-inner{interpolate-size:allow-keywords}.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body{overflow:clip;transition:block-size 500ms ease}.s-bullet-delivery-inner{overflow:clip;transition:block-size 500ms ease;block-size:calc-size(auto, size)}}@media screen and (min-width: 640px){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body:has(.s-searchable-dropdown--open){overflow:visible !important}}.s-bullet-delivery-form-actions.s-bullet-delivery-form-actions--single{padding-bottom:0;flex-direction:column;gap:0}.s-bullet-delivery-addresses-list.s-scrollbar::-webkit-scrollbar-track,.s-bullet-delivery-branches-list.s-scrollbar::-webkit-scrollbar-track{background-color:transparent}.s-bullet-delivery-back-to-list-link{display:inline-flex;align-items:center;justify-content:center;gap:2px;width:100%;margin-top:12px;background:none;border:none;color:var(--color-primary, #004956);font-size:14px;font-weight:500;cursor:pointer;padding:0}.s-bullet-delivery-back-to-list-link i{font-size:12px}.s-bullet-delivery-location-permission-btn{display:flex;align-items:center;gap:10px;width:100%;padding:12px;border:none;border-radius:8px;background:#fdf2f2;cursor:pointer;text-align:start}.s-bullet-delivery-location-permission-icon{display:inline-flex;flex-shrink:0;width:34px;height:34px}.s-bullet-delivery-location-permission-icon svg{width:100%;height:100%}.s-bullet-delivery-location-permission-text{flex:1;min-width:0;font-size:12px;line-height:18px;color:#444}.s-bullet-delivery-location-permission-arrow{flex-shrink:0;font-size:16px;color:#666}.s-bullet-delivery-location-distance-warning{display:flex;align-items:center;gap:10px;width:100%;padding:12px;border-radius:8px;background:#fff8e1;animation:s-bullet-delivery-fade-in 200ms ease}.s-bullet-delivery-location-distance-warning-icon{display:inline-flex;flex-shrink:0;width:34px;height:34px}.s-bullet-delivery-location-distance-warning-icon svg{width:100%;height:100%}.s-bullet-delivery-location-distance-warning-text{flex:1;min-width:0;font-size:12px;line-height:18px;color:#444}.s-bullet-delivery-map-container{width:100%;height:320px;border-radius:8px;overflow:hidden;margin-bottom:12px}.s-bullet-delivery-map-container gmap-map{display:block;width:100%;height:100%}.s-bullet-delivery-address-confirm{display:flex;flex-direction:column;gap:20px;animation:s-bullet-delivery-fade-in 200ms ease}.s-bullet-delivery-address-confirm-card{display:flex;align-items:center;gap:12px;border:1px solid #eee;border-radius:6px;padding:12px}.s-bullet-delivery-address-map-icon{overflow:hidden;border-radius:9px}.s-bullet-delivery-address-confirm-details{display:flex;flex-direction:column;align-items:flex-start;flex:1;min-width:0}.s-bullet-delivery-address-confirm-label{font-size:12px;line-height:16px;color:#666}.s-bullet-delivery-address-confirm-text{font-size:14px;font-weight:700;color:#333;margin:0;word-break:break-word}.s-bullet-delivery-address-confirm-description{display:flex;flex-direction:column;gap:8px}.s-bullet-delivery-address-confirm-description-label{font-size:14px;font-weight:500;color:#444}.s-bullet-delivery-address-confirm-description-optional{font-weight:400;color:#999;margin-inline-start:4px}.s-bullet-delivery-address-confirm-description-input{width:100%;border:1px solid #eee;border-radius:8px;padding:10px 12px;font-size:14px;margin-bottom:16px}.s-bullet-delivery-login-prompt{display:block;width:100%;text-align:center;background:none;border:none;color:var(--color-primary, #004956);font-size:14px;font-weight:500;cursor:pointer;padding:12px 0}@keyframes s-bullet-delivery-fade-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media (min-width: 640px){.s-bullet-delivery-modal .s-modal-sm{width:90vw !important;max-width:776px !important}}.s-bullet-delivery-modal .s-bullet-delivery-tabs{gap:4px;padding:4px;border-radius:12px;background:#f5f5f5}.s-bullet-delivery-modal .s-bullet-delivery-tab{justify-content:center;gap:8px;min-height:40px;border:0;border-radius:8px;background:transparent;color:#666;font-size:14px}.s-bullet-delivery-modal .s-bullet-delivery-tab:hover{background:transparent;color:var(--color-text, #333)}.s-bullet-delivery-modal .s-bullet-delivery-tab--active,.s-bullet-delivery-modal .s-bullet-delivery-tab--active:hover{background:#fff;color:#1a1a1a;font-weight:600;box-shadow:0 1px 2px rgba(0, 0, 0, 0.06)}.s-bullet-delivery-modal .s-bullet-delivery-tab-badge{display:inline-flex;align-items:center;gap:4px;flex:0 0 auto;padding:4px 8px;border-radius:8px;font-size:11px;font-weight:600;line-height:120%;white-space:nowrap;color:#fff;background:#5196f3}.s-bullet-delivery-modal .s-bullet-delivery-discount-badge{display:inline-flex;align-items:center;flex:0 0 auto;padding:4px 8px;border-radius:6px;font-size:12px;font-weight:600;line-height:120%;white-space:nowrap;color:#fff;background:#e5484d}.s-bullet-delivery-modal .s-bullet-delivery-tab-badge-icon{display:inline-flex}.s-bullet-delivery-modal .s-bullet-delivery-tab-badge-icon svg{width:7px;height:10px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters{display:flex;flex-direction:column;gap:12px;padding:16px;border-radius:12px;background:#fafafa}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-field{margin:0}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters-row{display:flex;gap:12px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters-row>.s-bullet-delivery-field{flex:1;min-width:0}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters{}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-branch-search-wrap{min-height:40px;border-color:#ddd;border-radius:8px;background:#fff}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-branch-search-input{font-size:14px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-btn{height:40px;min-height:40px;padding:0 14px;gap:4px;border:1px solid var(--color-primary);border-radius:8px;background:#fff;color:#1a1a1a;font-size:14px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-btn:hover{background:#fff}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-icon{display:inline-flex}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-icon svg{width:16px;height:16px}.s-bullet-delivery-modal .s-bullet-delivery-branches-list{display:flex;flex-direction:column;gap:16px;max-height:min(400px, 45svh);border:0;border-radius:0;background:transparent}.s-bullet-delivery-modal .s-bullet-delivery-branch-item{display:grid;grid-template-columns:auto minmax(0, 1fr) auto;align-items:start;column-gap:12px;row-gap:2px;padding:16px;border:1px solid #eee;border-radius:12px;background:#fff;text-align:start;transition:border-color 0.2s}.s-bullet-delivery-modal .s-bullet-delivery-branch-item:last-child{border-bottom:1px solid #eee}.s-bullet-delivery-modal .s-bullet-delivery-branch-item:hover:not(.s-bullet-delivery-branch-item--disabled){background:#fff}.s-bullet-delivery-modal .s-bullet-delivery-branch-item--selected,.s-bullet-delivery-modal .s-bullet-delivery-branch-item--selected:last-child{border-color:var(--color-primary);background:#fff}.s-bullet-delivery-modal .s-bullet-delivery-branch-item--disabled{opacity:0.5}.s-bullet-delivery-modal .s-bullet-delivery-branch-radio{grid-column:1;grid-row:1;align-self:center;width:20px;height:20px;margin-top:0;pointer-events:none}.s-bullet-delivery-modal .s-bullet-delivery-branch-body{display:contents}.s-bullet-delivery-modal .s-bullet-delivery-branch-body>*{grid-column:2/-1;min-width:0}.s-bullet-delivery-modal .s-bullet-delivery-branch-body>.s-bullet-delivery-branch-name{grid-column:2;grid-row:1;align-self:center}.s-bullet-delivery-modal .s-bullet-delivery-branch-body>.s-bullet-delivery-branch-location{grid-column:2}.s-bullet-delivery-modal .s-bullet-delivery-branch-name{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0;font-size:14px;font-weight:700;line-height:120%;color:#1a1a1a}.s-bullet-delivery-modal .s-bullet-delivery-branch-meta{display:inline-flex;align-items:center;gap:4px;font-size:13px;color:#6c757d}.s-bullet-delivery-modal .s-bullet-delivery-branch-meta i{font-size:12px}.s-bullet-delivery-modal .s-bullet-delivery-branch-meta-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-status--open{color:#43a047;font-weight:500}.s-bullet-delivery-modal .s-bullet-delivery-pickup-status--closed,.s-bullet-delivery-modal .s-bullet-delivery-pickup-status--busy{color:#e53935;font-weight:500}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule-toggle{display:inline-flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;margin:-6px;padding:0;border:0;background:none;color:inherit;line-height:1;cursor:pointer}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule-toggle i{transition:transform 0.2s ease}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule-toggle i.is-expanded{transform:rotate(180deg)}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule{display:flex;flex-direction:column;margin-top:4px;border-radius:8px;overflow:hidden}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule-day{display:flex;align-items:center;justify-content:space-between;gap:4px;padding:2px 12px;background:#f8f9fa;font-size:12px;font-weight:500}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule-days{color:#6c757d}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule-times{color:#1a1a1a}.s-bullet-delivery-modal .s-bullet-delivery-branch-instructions{align-items:flex-start;line-height:1.5;white-space:pre-line}.s-bullet-delivery-modal .s-bullet-delivery-branch-instructions .s-bullet-delivery-branch-meta-icon{margin-top:2px}.s-bullet-delivery-modal .s-bullet-delivery-branch-meta-value{color:#1a1a1a;font-weight:500}.s-bullet-delivery-modal .s-bullet-delivery-branch-meta-icon{display:inline-flex;flex-shrink:0}.s-bullet-delivery-modal .s-bullet-delivery-branch-meta-icon svg{width:16px;height:16px}.s-bullet-delivery-modal .s-bullet-delivery-branch-actions{grid-column:3;grid-row:1/span 2;display:flex;align-items:center;gap:8px}.s-bullet-delivery-modal .s-bullet-delivery-branch-action{display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:1px solid var(--color-border, #eee);border-radius:8px;background:transparent;color:var(--color-text, #333);text-decoration:none;cursor:pointer;transition:all 0.2s}.s-bullet-delivery-modal .s-bullet-delivery-branch-action i{font-size:16px}.s-bullet-delivery-modal .s-bullet-delivery-branch-action:hover{border-color:var(--color-primary);color:var(--color-primary);background:var(--color-primary-tt, transparent)}.s-bullet-delivery-modal .s-bullet-delivery-branch-action .s-bullet-delivery-branch-map-link-icon,.s-bullet-delivery-modal .s-bullet-delivery-branch-action .s-bullet-delivery-branch-map-link-icon svg{width:16px;height:16px}.s-bullet-delivery-modal .s-bullet-delivery-branch-action .s-bullet-delivery-branch-map-link-icon path{stroke:currentColor}.s-bullet-delivery-modal .s-bullet-delivery-branch-item .s-bullet-delivery-branch-action,.s-bullet-delivery-modal .s-bullet-delivery-branch-item .s-bullet-delivery-branch-schedule-toggle{pointer-events:auto}.s-bullet-delivery-modal .s-bullet-delivery-branch-pills{display:contents}.s-bullet-delivery-modal .s-bullet-delivery-branch-divider{display:none}@media (max-width: 480px){.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters{flex-direction:row;flex-wrap:wrap;gap:12px 8px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-branch-search,.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-search-row,.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-pickup-filters-row{display:contents}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-field{flex:1 1 calc(50% - 4px);min-width:0;order:1}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-branch-search-wrap{flex:1 1 0;min-width:0;order:2}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-btn{flex:0 0 auto;order:3;padding:0 10px;white-space:nowrap}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-error{flex-basis:100%;order:4}}@media (max-width: 480px) and (max-width: 400px){.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-btn{padding:0 12px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}}@media (max-width: 480px){.s-bullet-delivery-modal .s-bullet-delivery-branch-meta-row{display:contents}.s-bullet-delivery-modal .s-bullet-delivery-branch-pills,.s-bullet-delivery-modal .s-bullet-delivery-branch-divider,.s-bullet-delivery-modal .s-bullet-delivery-branch-open-status{grid-column:2/-1;min-width:0}.s-bullet-delivery-modal .s-bullet-delivery-branch-pills{display:flex;flex-wrap:wrap;gap:8px;order:1;margin-top:6px}.s-bullet-delivery-modal .s-bullet-delivery-branch-divider{order:2}.s-bullet-delivery-modal .s-bullet-delivery-branch-instructions{order:3}.s-bullet-delivery-modal .s-bullet-delivery-branch-open-status{order:4}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule{order:5}.s-bullet-delivery-modal .s-bullet-delivery-branch-location .s-bullet-delivery-branch-meta-icon{display:none}.s-bullet-delivery-modal .s-bullet-delivery-branch-pill{padding:4px 10px;border:1px solid var(--color-border, #eee);border-radius:999px;font-size:12px;line-height:1.4}.s-bullet-delivery-modal .s-bullet-delivery-branch-pill .s-bullet-delivery-branch-meta-label{display:none}.s-bullet-delivery-modal .s-bullet-delivery-branch-pill .s-bullet-delivery-branch-meta-value{color:inherit;font-weight:400}.s-bullet-delivery-modal .s-bullet-delivery-branch-divider{display:block;width:100%;height:0;margin:10px 0;border:0;border-top:1px solid #e0e0e0;opacity:1}.s-bullet-delivery-modal .s-bullet-delivery-branch-action,.s-bullet-delivery-modal .s-bullet-delivery-branch-action:hover{border-color:transparent}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.inline{display:inline}.inline-flex{display:inline-flex}.shrink{flex-shrink:1}.resize{resize:both}.\\!text-blue-600{--tw-text-opacity:1 !important;color:rgb(37 99 235 / var(--tw-text-opacity, 1)) !important}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-hidden{display:none}.form-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.form-input:focus{border-color:var(--color-primary);--tw-ring-color:transparent}.form-input:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.form-input:focus:is(.dark *){border-color:var(--color-primary)}@media (min-width: 640px){.form-input{font-size:0.875rem;line-height:1.25rem}}.\\!btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.\\!btn:hover{opacity:0.8}.btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.btn:hover{opacity:0.8}.spinner-loader.reverse{border-right-color:#9f7171 !important;background-color:#f98181}.s-hidden{display:none}.s-scrollbar::-webkit-scrollbar{width:5px}.s-scrollbar::-webkit-scrollbar-track{background-color:#eee}.s-scrollbar::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body{padding:0px}@media (min-width: 768px){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body{max-height:70dvh;overflow-y:auto}}@media (min-width: 640px){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body:has(.s-searchable-dropdown--open){overflow:visible !important}}.s-bullet-delivery-inner{min-block-size:0}.s-bullet-delivery-header{margin-bottom:1.5rem;text-align:start}.s-bullet-delivery-title{display:block;font-size:1.25rem;line-height:1.75rem;font-weight:700;color:var(--color-primary-dark)}.s-bullet-delivery-subtitle{margin-top:0.25rem;display:block;font-size:0.875rem;line-height:1.25rem;color:var(--color-primary-dark)}.s-bullet-delivery-tabs{margin-bottom:1.5rem;display:flex;gap:0.5rem}.s-bullet-delivery-tab{display:flex;flex:1 1 0%;cursor:pointer;align-items:center;gap:1rem;border-radius:0.5rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-top:0.5rem;padding-bottom:0.5rem;padding-left:0.75rem;padding-right:0.75rem;font-size:0.875rem;line-height:1.25rem;font-weight:500;color:var(--color-primary-dark);transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-bullet-delivery-tab:hover{background-color:color-mix(in srgb,var(--color-primary) 5%,transparent)}.s-bullet-delivery-tab--active{border-color:var(--color-primary-dark)}.s-bullet-delivery-tab svg{height:0.875rem;width:0.875rem;color:var(--color-primary-dark)}.s-bullet-delivery-tab-icon{display:flex;height:2rem;width:2rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:0.75rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-allocation-out-of-coverage{margin-bottom:1rem;display:flex;width:100%;align-items:center;gap:0.5rem;--tw-bg-opacity:1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1));padding-top:0.75rem;padding-bottom:0.75rem;padding-left:1rem;padding-right:1rem;text-align:end;--tw-text-opacity:1;color:rgb(127 29 29 / var(--tw-text-opacity, 1))}.s-bullet-delivery-allocation-out-of-coverage:where([dir="ltr"],[dir="ltr"] *){border-left-width:4px;border-left-color:rgb(239 68 68 / 0.5)}.s-bullet-delivery-allocation-out-of-coverage:where([dir="rtl"],[dir="rtl"] *){border-right-width:4px;border-right-color:rgb(239 68 68 / 0.5)}.s-bullet-delivery-allocation-out-of-coverage-text{font-size:0.875rem;line-height:1.25rem;line-height:1.4}.s-bullet-delivery-allocation-out-of-coverage-icon{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;--tw-text-opacity:1;color:rgb(127 29 29 / var(--tw-text-opacity, 1))}.s-bullet-delivery-content{margin-bottom:1.5rem;display:grid;gap:1rem}.s-bullet-delivery-content--active{animation:s-bullet-delivery-fade-in 220ms ease-out}.s-bullet-delivery-label{margin-bottom:0.5rem;display:block;font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-bullet-delivery-error{margin-top:0.25rem;display:block;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-bullet-delivery-footer{display:grid;gap:0.75rem;text-align:center}.s-bullet-delivery-placeholder{margin-top:1rem;margin-bottom:1rem}.s-bullet-delivery-placeholder.s-placeholder-wrapper{margin-top:1rem !important;margin-bottom:1rem !important}.s-bullet-delivery-label-content{display:inline-flex;align-items:center;gap:0.5rem}.s-bullet-delivery-select-loader{display:inline-flex;align-items:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-bullet-delivery-search-row{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:0.5rem;padding-left:1px;padding-right:1px}.s-bullet-delivery-search-row .s-bullet-delivery-search{min-width:0px;flex:1 1 0%}.s-bullet-delivery-search-row .s-bullet-delivery-location-btn{width:auto;flex-shrink:0}.s-bullet-delivery-field-row{margin-bottom:1rem;display:flex;gap:1rem}.s-bullet-delivery-field-row .s-bullet-delivery-field{margin-bottom:0px;flex:1 1 0%}.s-bullet-delivery-saved-addresses-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.s-bullet-delivery-saved-addresses-empty-icon{margin-bottom:0.75rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-bullet-delivery-saved-addresses-empty-icon svg{height:2rem;width:2rem}.s-bullet-delivery-saved-addresses-empty-title{margin-bottom:0.5rem;font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-bullet-delivery-saved-addresses-empty-desc{margin-bottom:1.5rem;max-width:24rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-addresses-list{position:relative;display:flex;max-height:260px;flex-direction:column;overflow-y:auto;border-radius:0.75rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}@media (min-width: 768px){.s-bullet-delivery-addresses-list{max-height:220px}}.s-bullet-delivery-address-item{display:flex;cursor:pointer;flex-direction:row;align-items:center;gap:0.75rem;border-bottom-width:1px;--tw-border-opacity:1;border-bottom-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.875rem;padding-bottom:0.875rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-address-item:not(.s-bullet-delivery-address-item--disabled):hover{background-color:rgb(249 250 251 / 0.5)}.s-bullet-delivery-address-item--selected{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-address-item--disabled{cursor:not-allowed;opacity:0.6}.s-bullet-delivery-address-item--skeleton{display:flex;cursor:default;align-items:center;gap:0.75rem;border-radius:0.75rem;border-width:1px;border-bottom-width:0px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:1rem}.s-bullet-delivery-address-item--skeleton .s-bullet-delivery-address-lines{gap:0.5rem}.s-bullet-delivery-address-content{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;justify-content:center;text-align:start}.s-bullet-delivery-address-lines{display:flex;flex-direction:column;gap:0.125rem}.s-bullet-delivery-address-line1{display:block;font-size:1rem;line-height:1.5rem;font-weight:400;line-height:1.375;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-bullet-delivery-address-line2{display:block;font-size:0.875rem;line-height:1.25rem;line-height:1.375;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-bullet-delivery-address-map-icon{display:grid;height:2.5rem;width:2.5rem;place-content:center}.s-bullet-delivery-address-map-icon svg{height:100%;width:100%}.s-bullet-delivery-skel-radio{flex-shrink:0;border-radius:9999px}.s-bullet-delivery-skel-map{flex-shrink:0;border-radius:0.75rem}.s-bullet-delivery-search{position:relative;flex:1 1 0%}.s-bullet-delivery-search-icon{pointer-events:none;position:absolute;top:0px;bottom:0px;left:0px;display:flex;align-items:center;padding-left:0.75rem}.s-bullet-delivery-search-icon:where([dir="rtl"],[dir="rtl"] *){left:auto;right:0px;padding-left:0px;padding-right:0.75rem}.s-bullet-delivery-search-icon svg{height:0.875rem;width:0.875rem;stroke:var(--color-primary)}.s-bullet-delivery-branch-search-wrap{display:flex;min-height:40px;min-width:0px;flex:1 1 0%;flex-direction:row;align-items:stretch;overflow:hidden;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-bullet-delivery-branch-search-wrap:focus-within{border-color:var(--color-primary-dark);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);--tw-ring-color:var(--color-primary-dark)}.s-bullet-delivery-branch-search-icon{pointer-events:none;position:static;display:flex;flex-shrink:0;align-items:center;justify-content:center;padding-inline-start:0.5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-search-icon svg{height:1.25rem;width:1.25rem}.s-bullet-delivery-branch-search-input{min-height:40px;min-width:0px;flex:1 1 0%;border-radius:0px;border-style:none;background-color:transparent;padding-top:0.5rem;padding-bottom:0.5rem;padding-inline-end:0.75rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1));--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-bullet-delivery-branch-search-input::placeholder{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-search-input:focus{outline:2px solid transparent;outline-offset:2px;border:none;box-shadow:none;--tw-ring-shadow:none}.s-bullet-delivery-location-btn{display:flex;flex-shrink:0;cursor:pointer;align-items:center;justify-content:center;gap:0.5rem;border-radius:0.5rem;border-width:1px;padding-left:1rem;padding-right:1rem;padding-top:0.5rem;padding-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-location-btn:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-location-btn:disabled{cursor:not-allowed;opacity:0.5}.s-bullet-delivery-location-btn--full{min-height:40px}.s-bullet-delivery-location-btn--loading{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-location-icon{height:0.875rem;width:0.875rem;flex-shrink:0}.s-bullet-delivery-location-icon svg{height:100%;width:100%}.s-bullet-delivery-branches-wrap{overflow:hidden}.s-bullet-delivery-branches-list{position:relative;max-height:min(260px, 32svh);overflow-y:auto;border-radius:0.5rem;border-width:1px;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}@media (min-width: 768px){.s-bullet-delivery-branches-list{max-height:220px}}.s-bullet-delivery-branches-loading{overflow:hidden;border-radius:0.5rem;border-width:1px;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-branch-info{display:flex;max-width:6.25rem;flex-direction:column;gap:0.125rem}.s-bullet-delivery-branch-name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow-wrap:break-word;font-size:0.875rem;line-height:1.25rem;font-weight:500;line-height:1.375;--tw-text-opacity:1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-prep{text-align:start;font-size:0.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-time{font-size:0.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-time:where([dir="ltr"],[dir="ltr"] *){text-align:end}.s-bullet-delivery-branch-time:where([dir="rtl"],[dir="rtl"] *){text-align:start}.s-bullet-delivery-branch-map-link{display:flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:0.5rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:0.5rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1));text-decoration-line:none;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-branch-map-link:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-branch-item>.s-bullet-delivery-branch-map-link{position:relative;z-index:10;pointer-events:auto}.s-bullet-delivery-branch-map-link-icon{display:flex;height:0.875rem;width:0.875rem;align-items:center;justify-content:center}.s-bullet-delivery-branch-map-link-icon svg{height:100%;width:100%}.s-bullet-delivery-branch-skeleton-title{max-width:100%}.s-bullet-delivery-branch-skeleton-time{justify-self:end}.s-bullet-delivery-branch-item{display:grid;min-width:0px;cursor:pointer;align-items:center;gap:0.5rem;border-bottom-width:1px;--tw-border-opacity:1;border-bottom-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;text-align:end;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;grid-template-columns:auto auto auto 1fr auto}.s-bullet-delivery-branch-item:last-child{border-bottom-width:0px}.s-bullet-delivery-branch-item:hover:not(.s-bullet-delivery-branch-item--disabled){--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-branch-item--selected{background-color:color-mix(in srgb,var(--color-primary) 5%,transparent)}.s-bullet-delivery-branch-item--disabled{cursor:not-allowed;opacity:0.5}.s-bullet-delivery-branch-icon{display:grid;place-content:center;border-radius:0.75rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));stroke:var(--color-primary-dark);padding:0.625rem;color:var(--color-primary-dark)}.s-bullet-delivery-branch-icon span{display:block;height:0.875rem;width:0.875rem}.s-bullet-delivery-branch-icon span svg{height:100%;width:100%}.s-bullet-delivery-branch-skeleton{display:grid;min-width:0px;align-items:center;gap:0.5rem;border-bottom-width:1px;--tw-border-opacity:1;border-bottom-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;grid-template-columns:auto auto auto 1fr auto}.s-bullet-delivery-branch-skeleton:last-child{border-bottom-width:0px}.s-bullet-delivery-branch-skeleton-radio{flex-shrink:0}.s-bullet-delivery-branch-skeleton-icon{flex-shrink:0;border-radius:0.75rem}.s-bullet-delivery-branch-skeleton-icon salla-skeleton{display:block}.s-bullet-delivery-branch-skeleton-map{flex-shrink:0;border-radius:0.75rem}.s-bullet-delivery-branch-skeleton-map salla-skeleton{display:block}.s-bullet-delivery-branch-skeleton-content{display:flex;min-width:0px;flex-direction:column;gap:0.5rem;overflow:hidden}.s-bullet-delivery-branch-skeleton-content salla-skeleton{min-width:0px;max-width:100%}.s-bullet-delivery-radio{margin-top:2px;height:1rem;width:1rem;flex-shrink:0;cursor:pointer;appearance:none;border-radius:9999px;border-width:2px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-radio:checked{border-color:var(--color-primary-dark);background:radial-gradient(circle,#fff 0,#fff 22%,var(--color-primary) 22%)}.s-bullet-delivery-radio:focus{outline:2px solid transparent;outline-offset:2px}.s-bullet-delivery-radio:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);--tw-ring-color:var(--color-primary-dark);--tw-ring-offset-width:2px}.s-bullet-delivery-skeleton{box-sizing:border-box;min-width:0px;max-width:100%;overflow:hidden;padding:1.25rem}.s-bullet-delivery-skeleton salla-skeleton{min-width:0px;max-width:100%}.s-bullet-delivery-skeleton-header{margin-bottom:1.5rem;display:flex;min-width:0px;max-width:100%;flex-direction:column;align-items:flex-start;gap:0.75rem}.s-bullet-delivery-skeleton-title{display:block;max-width:100%}.s-bullet-delivery-skeleton-subtitle{display:block;max-width:100%}.s-bullet-delivery-skeleton-tabs{margin-bottom:1.5rem;display:grid;min-width:0px;max-width:100%;grid-template-columns:repeat(2, minmax(0, 1fr));gap:0.5rem}.s-bullet-delivery-skeleton-tabs--single{grid-template-columns:repeat(1, minmax(0, 1fr))}.s-bullet-delivery-skeleton-tab{display:flex;align-items:center;gap:1rem;border-radius:0.75rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-bullet-delivery-skeleton-tab-icon{display:block;max-width:100%}.s-bullet-delivery-skeleton-tab-label{display:block;max-width:100%}.s-bullet-delivery-skeleton-field-label{display:block;max-width:100%}.s-bullet-delivery-skeleton-field-control{display:block;max-width:100%}.s-bullet-delivery-skeleton-content{margin-bottom:1.5rem;display:grid;min-width:0px;max-width:100%;gap:1rem}.s-bullet-delivery-skeleton-field{display:flex;min-width:0px;max-width:100%;flex-direction:column;align-items:flex-start;gap:0.5rem}.s-bullet-delivery-skeleton-footer{min-width:0px;max-width:100%}.s-bullet-delivery-add-address-header{margin-bottom:1.5rem;display:flex;align-items:center;justify-content:space-between;gap:0.75rem}.s-bullet-delivery-add-address-title{display:flex;width:100%;flex:1 1 0%;cursor:pointer;align-items:center;border-style:none;background-color:transparent;padding:0px;text-align:start;font-size:1.125rem;line-height:1.75rem;font-weight:700;color:var(--color-primary)}.s-bullet-delivery-add-address svg{height:2.5rem;width:2.5rem;fill:currentColor}.s-bullet-delivery-allocation-out-of-coverage-icon svg{height:1.25rem;width:1.25rem}.s-bullet-delivery-add-address-form{display:grid;gap:1rem}.s-bullet-delivery-add-address-submit{width:100%}.s-bullet-delivery-form-actions{display:flex;gap:0.75rem;border-top-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));padding-top:1rem}.s-bullet-delivery-form-actions salla-button{flex:1 1 0%}.s-bullet-delivery-form-actions--single{border-top-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-top:1.25rem}.s-bullet-delivery-form-actions--single salla-button{width:100%;flex:1 1 0%}.s-bullet-delivery-market-warning-overlay{position:fixed;inset:0px;z-index:60;display:flex;align-items:center;justify-content:center;background-color:rgb(0 0 0 / 0.5)}.s-bullet-delivery-market-warning{margin-left:1rem;margin-right:1rem;width:100%;max-width:24rem;border-radius:0.75rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1.5rem;--tw-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-bullet-delivery-market-warning-title{margin-bottom:0.75rem;font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-bullet-delivery-market-warning-message{margin-bottom:1.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-bullet-delivery-market-warning-actions{display:flex;gap:0.75rem}.s-bullet-delivery-market-warning-actions salla-button{flex:1 1 0%}.s-bullet-delivery-cart-view{margin-bottom:1rem;display:flex;align-items:center;justify-content:space-between;gap:1rem;border-radius:0.75rem;border-width:1px;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1rem}.s-bullet-delivery-cart-view-info{display:flex;min-width:0px;flex:1 1 0%;align-items:center;gap:0.75rem}.s-bullet-delivery-cart-view-text{display:flex;flex-direction:column;text-align:start}.s-bullet-delivery-cart-view-title{font-size:1rem;line-height:1.5rem;font-weight:600;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-bullet-delivery-cart-view-subtitle{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));margin-block-start:0.125rem}.s-bullet-delivery-cart-view-icon{display:flex;height:3.5rem;width:3.5rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:1rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));color:var(--color-primary-dark)}.s-bullet-delivery-cart-view-icon svg{height:1.25rem;width:1.25rem;stroke:currentColor}.s-bullet-delivery-cart-view-button{flex-shrink:0;align-self:center}.s-bullet-delivery-location-permission-btn{display:flex;width:100%;cursor:pointer;align-items:center;gap:0.625rem;border-radius:0.5rem;border-width:0px;padding:0.75rem;text-align:start;background:#fdf2f2}.s-bullet-delivery-location-permission-icon{display:inline-flex;height:34px;width:34px;flex-shrink:0}.s-bullet-delivery-location-permission-icon svg{height:100%;width:100%}.s-bullet-delivery-location-permission-text{min-width:0px;flex:1 1 0%;font-size:0.75rem;line-height:1rem;line-height:18px;--tw-text-opacity:1;color:rgb(68 68 68 / var(--tw-text-opacity, 1))}.s-bullet-delivery-location-permission-arrow{flex-shrink:0;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(102 102 102 / var(--tw-text-opacity, 1))}.s-bullet-delivery-location-distance-warning{display:flex;width:100%;animation:s-bullet-delivery-fade-in 200ms ease;align-items:center;gap:0.625rem;border-radius:0.5rem;padding:0.75rem;background:#fff8e1}.s-bullet-delivery-location-distance-warning-icon{display:inline-flex;height:34px;width:34px;flex-shrink:0}.s-bullet-delivery-location-distance-warning-icon svg{height:100%;width:100%}.s-bullet-delivery-location-distance-warning-text{min-width:0px;flex:1 1 0%;font-size:0.75rem;line-height:1rem;line-height:18px;--tw-text-opacity:1;color:rgb(68 68 68 / var(--tw-text-opacity, 1))}';const re=class{constructor(e){t(this,e),this.isEligible=!1}async componentWillLoad(){try{await salla.onReady(),await salla.lang.onLoaded(),this.isEligible=!0===salla.config.get("store.shipping.has_bullet_delivery_tag")}catch(e){salla?.logger?.warn?.("salla-bullet-delivery-tag: init failed",e),this.isEligible=!1}}getTagLabel(){const e="en"===salla.config.get("user.language_code")?"Get it within 2 hours":"توصيل خلال ساعتين";return salla.lang.getWithDefault("pages.products.quick_delivery_tag",e)}render(){return this.isEligible?e(s,{class:"s-bullet-delivery-tag-wrapper"},e("span",{class:"s-bullet-delivery-tag-container","data-testid":"bd-tag"},e("span",{class:"s-bullet-delivery-tag-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>flash</title>\n<path d="M29.257 14.223c-0.188-0.533-0.692-0.889-1.257-0.889h-6.5l1.159-9.844c0.063-0.537-0.205-1.061-0.68-1.323-0.472-0.261-1.059-0.211-1.481 0.131l-17.333 14c-0.44 0.355-0.608 0.948-0.419 1.481 0.185 0.532 0.689 0.888 1.255 0.888h6.5l-1.159 9.844c-0.063 0.537 0.205 1.061 0.68 1.323 0.203 0.112 0.424 0.167 0.645 0.167 0.299 0 0.595-0.1 0.837-0.296l17.333-14c0.44-0.355 0.608-0.949 0.42-1.481zM12.373 25.575l0.951-8.085c0.044-0.379-0.075-0.757-0.328-1.041-0.252-0.285-0.615-0.448-0.996-0.448h-4.227l11.855-9.575-0.951 8.085c-0.044 0.379 0.075 0.757 0.328 1.041 0.251 0.285 0.613 0.448 0.995 0.448h4.227z"></path>\n</svg>\n'}),e("span",{class:"s-bullet-delivery-tag-label"},this.getTagLabel()))):null}};re.style="/*!twlt*/.s-bullet-delivery-tag-wrapper{display:flex;width:100%}@media (min-width: 1024px){.s-bullet-delivery-tag-wrapper{display:inline-flex;width:auto}.s-bullet-delivery-tag-wrapper .s-bullet-delivery-tag-container{transform:skewX(-15deg)}.s-bullet-delivery-tag-wrapper .s-bullet-delivery-tag-icon,.s-bullet-delivery-tag-wrapper .s-bullet-delivery-tag-label{transform:skewX(15deg)}}.s-bullet-delivery-tag-wrapper .s-bullet-delivery-tag-icon svg{width:1rem;height:1rem;fill:currentColor}.hidden{display:none}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-bullet-delivery-tag-container{display:flex;width:100%;align-items:center;justify-content:center;gap:0.5rem;border-radius:0px;--tw-bg-opacity:1;background-color:rgb(43 191 134 / var(--tw-bg-opacity, 1));padding-left:0.75rem;padding-right:0.75rem;padding-top:0.5rem;padding-bottom:0.5rem;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 1024px){.s-bullet-delivery-tag-container{display:inline-flex;width:auto;gap:0.375rem;border-radius:0.375rem;padding-left:0.875rem;padding-right:0.875rem;padding-top:0.375rem;padding-bottom:0.375rem}}.s-bullet-delivery-tag-icon{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center}.s-bullet-delivery-tag-label{white-space:nowrap;font-size:0.875rem;line-height:1.25rem;font-weight:700}";const le=class{constructor(e){t(this,e),this.itemSelected=i(this,"itemSelected"),this.searchInput=i(this,"searchInput"),this.dropdownOpened=i(this,"dropdownOpened"),this.dropdownClosed=i(this,"dropdownClosed"),this.placeholder="",this.items=[],this.selectedItem=null,this.loading=!1,this.searching=!1,this.disabled=!1,this.required=!1,this.noResultsText="",this.inputId="",this.searchQuery="",this.clientSearch=!1,this.dropUp=!1,this.searchable=!0,this.keepParentScroll=!1,this.isOpen=!1,this.focusedIndex=-1,this.clientSearchQuery="",this.scrollableAncestor=null,this.handleTriggerClick=()=>{this.isOpen?this.close():this.open()},this.handleTriggerKeyDown=e=>{this.isOpen?this.navigateItems(e):"Enter"===e.key||" "===e.key||"ArrowDown"===e.key?(e.preventDefault(),this.open()):"Escape"===e.key&&this.close()},this.handleSearchInputChange=e=>{const t=e.target.value;this.clientSearch&&(this.clientSearchQuery=t),this.searchInput.emit(t),this.focusedIndex=-1},this.handleSearchKeyDown=e=>{this.navigateItems(e)}}connectedCallback(){this.boundHandleClickOutside=this.handleClickOutside.bind(this),document.addEventListener("mousedown",this.boundHandleClickOutside)}disconnectedCallback(){document.removeEventListener("mousedown",this.boundHandleClickOutside),this.scrollableAncestor&&(this.scrollableAncestor.style.overflow="",this.scrollableAncestor=null)}onItemsChange(){this.focusedIndex=-1}normalizeArabic(e){return e.replace(/[أإآا]/g,"ا")}get filteredItems(){if(!this.clientSearch||!this.clientSearchQuery.trim())return this.items;const e=this.normalizeArabic(this.clientSearchQuery.trim().toLowerCase());return this.items.filter((t=>{const i=this.normalizeArabic(t.name.toLowerCase()),s=t.name_en?t.name_en.toLowerCase():"";return i.includes(e)||s.includes(e)}))}getDisplayName(e){const t=salla?.config?.get("user.language_code");return t&&"ar"!==t&&e.name_en?.trim()?e.name_en.trim():e.name}handleClickOutside(e){this.isOpen&&(this.host.contains(e.target)||this.close())}findScrollableAncestor(){let e=this.host.parentElement;for(;e;){const t=getComputedStyle(e),i=t.overflowY;if("auto"===i||"scroll"===i||"hidden"===i||"clip"===t.overflow)return e;e=e.parentElement}return null}isCoarsePointer(){return!!window.matchMedia?.("(pointer: coarse)").matches}isNarrowViewport(){return!!window.matchMedia?.("(max-width: 639px)").matches}open(){this.disabled||this.loading||(this.isOpen=!0,this.focusedIndex=-1,this.keepParentScroll||this.isNarrowViewport()||(this.scrollableAncestor=this.findScrollableAncestor(),this.scrollableAncestor&&(this.scrollableAncestor.style.overflow="visible")),this.dropdownOpened.emit(),requestAnimationFrame((()=>{this.isCoarsePointer()||this.searchInputRef?.focus(),this.panelRef?.scrollIntoView?.({block:"nearest"})})))}close(){this.isOpen&&(this.isOpen=!1,this.focusedIndex=-1,this.clientSearchQuery="",this.scrollableAncestor&&(this.scrollableAncestor.style.overflow="",this.scrollableAncestor=null),this.dropdownClosed.emit())}navigateItems(e){const t=this.filteredItems,i=t.length;switch(e.key){case"ArrowDown":e.preventDefault(),this.focusedIndex=i>0?(this.focusedIndex+1)%i:-1,this.scrollFocusedIntoView();break;case"ArrowUp":e.preventDefault(),this.focusedIndex=i>0?(this.focusedIndex-1+i)%i:-1,this.scrollFocusedIntoView();break;case"Enter":e.preventDefault(),this.focusedIndex>=0&&this.focusedIndex<i&&this.selectItem(t[this.focusedIndex]);break;case"Escape":e.preventDefault(),this.close()}}scrollFocusedIntoView(){this.focusedIndex<0||requestAnimationFrame((()=>{const e=this.panelRef?.querySelector(".s-searchable-dropdown-list"),t=e?.children[this.focusedIndex];t?.scrollIntoView({block:"nearest"})}))}selectItem(e){this.itemSelected.emit(e),this.close()}render(){const t=null!=this.selectedItem,i=`${this.inputId}-listbox`;return e(s,{key:"02d11f844c06912b4743b820af6cee7c34b77f17",class:"s-searchable-dropdown"},e("div",{key:"e2fde5235f96206861dec5c94397a48061a2b59d",class:{"s-searchable-dropdown":!0,"s-searchable-dropdown--open":this.isOpen}},this.label&&e("label",{key:"22d43eb76b9d9b7e28be0a02e799e200499bb2d5",class:"s-searchable-dropdown-label",htmlFor:this.inputId},this.label,this.required&&e("span",{key:"a139791c05d1b494776f538deafebbf41a2d4eee",class:"s-searchable-dropdown-required"}," *")),e("div",{key:"7361971a854f54206f30f61a13bce53c19b4dd54",class:{"s-searchable-dropdown-trigger":!0,"s-searchable-dropdown-trigger--disabled":this.disabled||this.loading,"s-searchable-dropdown-trigger--open":this.isOpen},role:"combobox","aria-expanded":this.isOpen?"true":"false","aria-haspopup":"listbox","aria-controls":i,"aria-disabled":this.disabled||this.loading?"true":"false",tabIndex:this.disabled||this.loading?-1:0,onClick:this.handleTriggerClick,onKeyDown:this.handleTriggerKeyDown},t?e("span",{class:"s-searchable-dropdown-trigger-text"},this.getDisplayName(this.selectedItem)):e("span",{class:"s-searchable-dropdown-trigger-placeholder"},this.placeholder),e("i",{key:"11a8d6d198eceaff33c83167db1672709da6a334",class:{"sicon-keyboard_arrow_down":!0,"s-searchable-dropdown-trigger-icon":!0,"s-searchable-dropdown-trigger-icon--open":this.isOpen},"aria-hidden":"true"})),this.isOpen&&e("div",{key:"b1f95c4129297cb880edefdae7dd0ee55d0db89f",class:{"s-searchable-dropdown-panel":!0,"s-searchable-dropdown-panel--up":this.dropUp},ref:e=>this.panelRef=e},this.searchable&&e("div",{key:"538366b1f478b758697a6163449f02a844046c24",class:"s-searchable-dropdown-search-wrap"},e("i",{key:"d4645a414866d20b37567b0edf7cc063c0783b0e",class:"sicon-search s-searchable-dropdown-search-icon","aria-hidden":"true"}),e("input",{key:"9a1a0e9146fa1e5a2c391b75c82b8fe795207118",ref:e=>this.searchInputRef=e,id:this.inputId,type:"text",class:"s-searchable-dropdown-search-input",placeholder:this.placeholder,value:this.clientSearch?this.clientSearchQuery:this.searchQuery,onInput:this.handleSearchInputChange,onKeyDown:this.handleSearchKeyDown,autocomplete:"off","aria-autocomplete":"list","aria-expanded":this.isOpen?"true":"false","aria-controls":i})),e("div",{key:"c233695fd26f7c743af2a330c149a02171e108da",id:i,class:"s-searchable-dropdown-list s-scrollbar",role:"listbox"},this.renderListContent()))))}renderListContent(){if(this.searching||this.loading)return e("div",{class:"s-searchable-dropdown-loading"},e("svg",{class:"s-searchable-dropdown-spinner",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round",opacity:"0.25"}),e("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round"})));const t=this.filteredItems;return 0===t.length?e("div",{class:"s-searchable-dropdown-empty"},this.noResultsText||salla?.lang?.get("common.elements.no_options")||"No results found"):t.map(((t,i)=>{const s=this.selectedItem?.id===t.id;return e("button",{key:t.id,type:"button",role:"option",class:{"s-searchable-dropdown-item":!0,"s-searchable-dropdown-item--selected":s,"s-searchable-dropdown-item--focused":this.focusedIndex===i&&!s},"aria-selected":s?"true":"false",onClick:()=>this.selectItem(t)},e("span",{class:{"s-searchable-dropdown-item-name":!0,"s-searchable-dropdown-item-name--selected":s}},this.getDisplayName(t)),s&&e("i",{class:"sicon-check s-searchable-dropdown-item-check","aria-hidden":"true"}))}))}get host(){return r(this)}static get watchers(){return{items:["onItemsChange"]}}};le.style="/*!twlt*/.s-searchable-dropdown{position:relative}.s-searchable-dropdown--open{z-index:9999}.s-searchable-dropdown-label{display:block;font-size:14px;font-weight:500;color:var(--color-text-primary, #374151);margin-bottom:8px}.s-searchable-dropdown-required{color:var(--color-danger, #ef4444)}.s-searchable-dropdown-trigger{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:40px;padding:8px 12px;font-size:14px;text-align:start;background:var(--color-surface, #fff);border:1px solid var(--color-border, #e5e7eb);border-radius:6px;cursor:pointer;transition:border-color 0.15s ease, box-shadow 0.15s ease}.s-searchable-dropdown-trigger:hover:not(.s-searchable-dropdown-trigger--disabled){border-color:var(--color-border-hover, #d1d5db)}.s-searchable-dropdown-trigger:focus{outline:none;border-color:var(--color-primary, #00897b);box-shadow:0 0 0 1px var(--color-primary, #00897b)}.s-searchable-dropdown-trigger--disabled{opacity:0.5;cursor:not-allowed;background:var(--color-surface-disabled, #f9fafb)}.s-searchable-dropdown-trigger--open{border-color:var(--color-primary, #00897b);box-shadow:0 0 0 1px var(--color-primary, #00897b)}.s-searchable-dropdown-trigger-text{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-primary, #111827)}.s-searchable-dropdown-trigger-placeholder{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-secondary, #9ca3af)}.s-searchable-dropdown-trigger-icon{flex-shrink:0;color:var(--color-text-secondary, #9ca3af);font-size:18px;transition:transform 0.2s ease;margin-inline-start:8px}.s-searchable-dropdown-trigger-icon--open{transform:rotate(180deg)}.s-searchable-dropdown-panel{position:absolute;z-index:9999;width:100%;margin-top:4px;background:var(--color-surface, #fff);border:1px solid var(--color-border, #e5e7eb);border-radius:8px;box-shadow:0 8px 24px rgba(0, 0, 0, 0.12);overflow:hidden;animation:s-searchable-dropdown-in 0.15s ease}.s-searchable-dropdown-panel--up{bottom:60%}@keyframes s-searchable-dropdown-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.s-searchable-dropdown-search-wrap{display:flex;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid var(--color-border, #f3f4f6)}.s-searchable-dropdown-search-icon{flex-shrink:0;color:var(--color-text-secondary, #9ca3af);font-size:16px}.s-searchable-dropdown-search-input{flex:1;min-width:0;border:none;outline:none;background:transparent;font-size:14px;color:var(--color-text-primary, #111827);box-shadow:none}.s-searchable-dropdown-search-input::placeholder{color:var(--color-text-secondary, #9ca3af)}.s-searchable-dropdown-search-input:focus{outline:none;box-shadow:none;border:none}.s-searchable-dropdown-list{max-height:min(40vh, 220px);overflow-y:auto;scrollbar-width:thin;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y}.s-searchable-dropdown-item{display:flex;align-items:center;justify-content:space-between;width:100%;padding:10px 16px;margin:0;gap:8px;font:inherit;font-size:14px;text-align:inherit;color:var(--color-text-primary, #111827);background:transparent;border:none;border-bottom:1px solid var(--color-border-light, #f9fafb);cursor:pointer;transition:background 0.15s ease}.s-searchable-dropdown-item:last-child{border-bottom:none}.s-searchable-dropdown-item:hover{background:var(--color-hover, #f9fafb)}.s-searchable-dropdown-item--selected{background:color-mix(in srgb, var(--color-primary, #00897b) 8%, transparent)}.s-searchable-dropdown-item--focused{background:color-mix(in srgb, var(--color-primary, #165b54) 12%, transparent)}.s-searchable-dropdown-item-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.s-searchable-dropdown-item-name--selected{color:var(--color-primary, #00897b);font-weight:500}.s-searchable-dropdown-item-check{flex-shrink:0;color:var(--color-primary, #00897b);font-size:14px;margin-inline-start:8px}.s-searchable-dropdown-empty{display:flex;align-items:center;justify-content:center;padding:24px 16px;font-size:14px;color:var(--color-text-secondary, #9ca3af)}.s-searchable-dropdown-loading{display:flex;align-items:center;justify-content:center;padding:24px 16px;color:var(--color-text-secondary, #9ca3af)}.s-searchable-dropdown-spinner{width:20px;height:20px;animation:s-searchable-dropdown-spin 0.8s linear infinite}@keyframes s-searchable-dropdown-spin{to{transform:rotate(360deg)}}.visible{visibility:visible}.block{display:block}.hidden{display:none}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-scrollbar::-webkit-scrollbar{width:5px}.s-scrollbar::-webkit-scrollbar-track{background-color:#eee}.s-scrollbar::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}@media (min-width: 640px){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body:has(.s-searchable-dropdown--open){overflow:visible !important}}.s-searchable-dropdown{position:relative}.s-searchable-dropdown--open{z-index:9999}.s-searchable-dropdown-label{margin-bottom:0.5rem;display:block;font-size:0.875rem;line-height:1.25rem;font-weight:500;color:var(--color-text-primary,#374151)}.s-searchable-dropdown-required{color:var(--color-danger,#ef4444)}.s-searchable-dropdown-trigger{display:flex;min-height:40px;width:100%;cursor:pointer;align-items:center;justify-content:space-between;border-radius:0.375rem;border-width:1px;border-color:var(--color-border,#e5e7eb);background-color:var(--color-surface,#fff);padding-left:0.75rem;padding-right:0.75rem;padding-top:0.5rem;padding-bottom:0.5rem;text-align:start;font-size:0.875rem;line-height:1.25rem;transition-property:border-color,box-shadow;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-searchable-dropdown-trigger:hover{border-color:var(--color-border-hover,#d1d5db)}.s-searchable-dropdown-trigger:focus{border-color:var(--color-primary);--tw-shadow:0 0 0 1px var(--color-primary,#00897b);--tw-shadow-colored:0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}.s-searchable-dropdown-trigger--disabled{cursor:not-allowed;background-color:var(--color-surface-disabled,#f9fafb);opacity:0.5}.s-searchable-dropdown-trigger--open{border-color:var(--color-primary) !important;--tw-shadow:0 0 0 1px var(--color-primary,#00897b);--tw-shadow-colored:0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-searchable-dropdown-trigger-text{flex:1 1 0%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-primary,#111827)}.s-searchable-dropdown-trigger-placeholder{flex:1 1 0%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-trigger-icon{margin-inline-start:0.5rem;flex-shrink:0;font-size:1.125rem;line-height:1.75rem;color:var(--color-text-secondary,#9ca3af);transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-searchable-dropdown-trigger-icon--open{--tw-rotate:180deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-searchable-dropdown-panel{position:absolute;z-index:9999;margin-top:0.25rem;width:100%;overflow:hidden;border-radius:0.5rem;border-width:1px;border-color:var(--color-border,#e5e7eb);background-color:var(--color-surface,#fff);--tw-shadow:0 8px 24px rgba(0,0,0,0.12);--tw-shadow-colored:0 8px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-searchable-dropdown-panel--up{bottom:60%}.s-searchable-dropdown-search-wrap{display:flex;align-items:center;gap:0.5rem;border-bottom-width:1px;border-bottom-color:var(--color-border,#f3f4f6);padding-left:0.75rem;padding-right:0.75rem;padding-top:0.5rem;padding-bottom:0.5rem}.s-searchable-dropdown-search-icon{flex-shrink:0;font-size:1rem;line-height:1.5rem;color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-search-input{min-width:0px;flex:1 1 0%;border-width:0px;background-color:transparent;font-size:0.875rem;line-height:1.25rem;color:var(--color-text-primary,#111827);--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}.s-searchable-dropdown-search-input::placeholder{color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-search-input:focus{border-width:0px;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.s-searchable-dropdown-list{max-height:min(40vh, 220px);overflow-y:auto;scrollbar-width:thin}.s-searchable-dropdown-item{margin:0px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:space-between;gap:0.5rem;border-width:0px;border-bottom-width:1px;border-bottom-color:var(--color-border-light,#f9fafb);background-color:transparent;padding-left:1rem;padding-right:1rem;padding-top:0.625rem;padding-bottom:0.625rem;font-family:inherit;font-size:0.875rem;line-height:1.25rem;color:var(--color-text-primary,#111827);transition-property:background;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;text-align:inherit}.s-searchable-dropdown-item:last-child{border-bottom-width:0px}.s-searchable-dropdown-item--selected{background-color:color-mix(in srgb,var(--color-primary,#00897b) 8%,transparent)}.s-searchable-dropdown-item-name{flex:1 1 0%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.s-searchable-dropdown-item-name--selected{font-weight:500;color:var(--color-primary)}.s-searchable-dropdown-item-check{margin-inline-start:0.5rem;flex-shrink:0;font-size:0.875rem;line-height:1.25rem;color:var(--color-primary)}.s-searchable-dropdown-empty{display:flex;align-items:center;justify-content:center;padding-left:1rem;padding-right:1rem;padding-top:1.5rem;padding-bottom:1.5rem;font-size:0.875rem;line-height:1.25rem;color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-loading{display:flex;align-items:center;justify-content:center;padding-left:1rem;padding-right:1rem;padding-top:1.5rem;padding-bottom:1.5rem;color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-spinner{height:1.25rem;width:1.25rem}@keyframes spin{to{transform:rotate(360deg)}}.s-searchable-dropdown-spinner{animation:spin 0.8s linear infinite}";export{se as salla_bullet_delivery,re as salla_bullet_delivery_tag,le as salla_searchable_dropdown}
4
+ import{h as e,r as t,c as i,H as s,a as r}from"./p-3xfbOSPM.js";import{a as l,b as a,r as o,c as n,h as d,g as h,d as c,e as u,f as p,j as b,C as y,k as g,l as m,m as v,n as w,o as f,t as x,p as k,q as _,i as S,s as C,u as z,v as M,w as L,x as I,y as A,z as B,A as T,B as D,D as $,E as P,F,G as j,H}from"./p-BVaKfTMx.js";import{L as N}from"./p-BO5AoBAP.js";import{S as q}from"./p-BscTeWDc.js";const E={closeButtonClick:"close_button",backdropClick:"backdrop"},G=()=>"function"==typeof crypto.randomUUID?crypto.randomUUID():"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(Number(e)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>Number(e)/4).toString(16))),R=e=>{const t=String(e?.allocation_headers?.["s-scope-allocation-id"]??e?.branch_id??"").split(",").map(Number).filter((e=>Number.isSafeInteger(e)&&e>0));return[...new Set(t)].sort(((e,t)=>e-t))};class V{constructor(){this.impressionId=null,this.visibleAt=0}viewed(e){this.guarded((()=>{this.impressionId=G(),this.visibleAt=Date.now(),this.send("Branch Selector Viewed",{...e})}))}dismissed(e,t,i){this.guarded((()=>this.send("Branch Selector Dismissed",{...e,close_reason:t,had_accepted_selection:i,elapsed_ms:this.visibleAt?Date.now()-this.visibleAt:0})))}result(e,t){this.guarded((()=>{const i=this.session(),s=i.seq+1,r="accepted"===t.outcome,l=i.first_accepted_branch_ids??(r?t.new_branch_ids:null),a=i.last_accepted_branch_ids??t.previous_branch_ids;var o,n;this.save({...i,seq:s,first_accepted_branch_ids:l,last_accepted_branch_ids:r?t.new_branch_ids:a}),this.send("Branch Selector Completed",{...e,...t,previous_branch_ids:a,selection_attempt_id:G(),selection_seq:s,first_accepted_branch_ids:l,changed:r&&a.length>0&&(o=a,n=t.new_branch_ids,!(o.length===n.length&&o.every((e=>n.includes(e)))))})}))}guarded(e){try{e()}catch{}}send(e,t){const i={event:e,session_id:this.session().id,impression_id:this.impressionId,...t};Promise.resolve(salla.api.axios.post("selector-events",i,{timeout:5e3,adapter:["fetch","xhr"],fetchOptions:{keepalive:!0}})).catch((()=>{}))}session(){const e=Salla.storage.session.get(this.storageName());if(e?.id)return e;const t={id:G(),seq:0,first_accepted_branch_ids:null};return this.save(t),t}storageName(){return`sc_selector_session:${Salla.config.get("store.id")}`}save(e){Salla.storage.session.set(this.storageName(),e)}}var Z='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 172 172" width="172" height="172">\n \x3c!-- White rounded background --\x3e\n <rect width="172" height="172" rx="64" fill="#FFFFFF"/>\n\n \x3c!-- Location / navigation icon --\x3e\n <path\n d="M113.5 52.5\n C108.5 52.5 101.5 54.5 93.5 57\n L57.5 68.5\n C53.5 69.8 51.8 72.2 53 75\n C53.8 77 55.5 78.2 58 79\n L79.5 86.5\n C81.8 87.3 83.2 88.8 84 91.2\n L90.5 113\n C91.7 117 94 119.2 97 119.2\n C100.8 119.2 103 116.5 104.2 112.8\n L119 70.5\n C121 64.5 121.8 58.5 119.2 55.2\n C117.8 53.3 116 52.5 113.5 52.5 Z"\n fill="#FFFFFF"\n stroke="#000000"\n stroke-width="5.5"\n stroke-linecap="round"\n stroke-linejoin="round"\n />\n</svg>\n';const U=e=>"prompt"===e||"denied"===e;async function O(){try{return navigator?.permissions?.query&&navigator.geolocation?await navigator.permissions.query({name:"geolocation"}):null}catch{return null}}const K=({isRTL:t=!1,onActivate:i})=>e("div",{class:"s-bullet-delivery-location-permission"},e("button",{type:"button",class:"s-bullet-delivery-location-permission-btn",onClick:i},e("span",{class:"s-bullet-delivery-location-permission-icon",innerHTML:Z,"aria-hidden":"true"}),e("span",{class:"s-bullet-delivery-location-permission-text",style:{textAlign:t?"right":"left"},"data-testid":"salla-bullet-delivery-location-permission-text"},Salla.lang.getWithDefault("pages.checkout.allow_location_permission","اسمح بمشاركة موقعك لتحديد عنوانك تلقائيًا وبشكل أدق.")),e("i",{class:"s-bullet-delivery-location-permission-arrow "+(t?"sicon-keyboard_arrow_left":"sicon-keyboard_arrow_right"),"aria-hidden":"true"}))),W=e=>e*(Math.PI/180),Y=({distanceKm:t,isRTL:i=!1})=>{const s=t.toFixed(1),r=Salla.lang.getWithDefault("pages.checkout.location_distance_warning","تبعد عن موقعك {distance} كم، وقد تكون اخترت عنوان توصيل غير صحيح.")?.replace("{distance}",s);return e("div",{class:"s-bullet-delivery-location-distance-warning",role:"alert"},e("span",{class:"s-bullet-delivery-location-distance-warning-icon",innerHTML:Z,"aria-hidden":"true"}),e("span",{class:"s-bullet-delivery-location-distance-warning-text",style:{textAlign:i?"right":"left"},"data-testid":"salla-bullet-delivery-location-distance-warning-text"},r))};var Q='<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">\n <rect x="1.90958" y="0.576577" width="30.8468" height="30.8468" rx="9.22523" style="fill:#E8E8E8" stroke="white" stroke-width="1.15315"/>\n <path d="M17.9096 6.77445L28.7204 5.33301H32.4681L32.7564 11.8195V23.6393L10.4141 23.9276V10.8105L17.9096 6.77445Z" style="fill:#97E7C8"/>\n <path d="M-2.70303 10.6664H10.2699M41.6934 5.47722C38.378 5.47722 34.7744 5.47722 27.8555 5.47722C20.9366 5.47722 18.4862 6.63037 15.4591 8.64839C12.4321 10.6664 10.2699 10.6664 10.2699 10.6664M10.2699 34.4502V23.6394M10.2699 10.6664V23.6394M-6.16249 23.6394H10.2699M10.2699 23.6394H21.0807M38.8105 23.6394H21.0807M21.0807 23.6394V34.4502" style="fill:none" stroke="white" stroke-width="2.30631"/>\n <rect x="2.34202" y="1.00901" width="29.982" height="29.982" rx="8.79279" style="fill:none" stroke="white" stroke-width="2.01802"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M18.069 19.8621C19.4995 18.6902 22.171 16.0948 22.171 13.0548C22.171 11.7333 21.6461 10.466 20.7117 9.5316C19.7773 8.5972 18.51 8.07227 17.1885 8.07227C15.8671 8.07227 14.5998 8.5972 13.6654 9.5316C12.731 10.466 12.2061 11.7333 12.2061 13.0548C12.2061 16.0948 14.8776 18.6902 16.3081 19.8621C16.5553 20.0679 16.8669 20.1806 17.1885 20.1806C17.5102 20.1806 17.8218 20.0679 18.069 19.8621ZM17.1885 14.1618C17.517 14.1618 17.838 14.0644 18.1111 13.8819C18.3842 13.6995 18.597 13.4401 18.7227 13.1367C18.8484 12.8333 18.8812 12.4994 18.8172 12.1773C18.7531 11.8552 18.595 11.5593 18.3627 11.3271C18.1305 11.0948 17.8346 10.9367 17.5125 10.8726C17.1904 10.8085 16.8565 10.8414 16.5531 10.9671C16.2497 11.0928 15.9903 11.3056 15.8079 11.5787C15.6254 11.8518 15.528 12.1728 15.528 12.5012C15.528 12.9416 15.703 13.364 16.0144 13.6754C16.3258 13.9868 16.7481 14.1618 17.1885 14.1618Z" style="fill:#55575D"/>\n</svg>\n';const X='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="8.00016" cy="8.00004" r="6.66667" stroke="#555555" stroke-width="1.125"/><path d="M8 5.33337V8.00004L9.33333 9.33337" stroke="#555555" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round"/></svg>',J='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.00014 14.6667C4.31824 14.6667 1.3335 11.6819 1.3335 8.00004C1.3335 4.31814 4.31826 1.33337 8.00016 1.33337C10.9853 1.33337 13.484 3.2953 14.3335 6.00004H12.6668" stroke="#666666" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round"/><path d="M8 5.33337V8.00004L9.33333 9.33337" stroke="#666666" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.6367 8.66667C14.6565 8.44724 14.6667 8.22486 14.6667 8M10 14.6667C10.2277 14.5917 10.4502 14.5043 10.6667 14.4052M13.8604 11.3333C13.989 11.0856 14.1036 10.8288 14.2034 10.5641M12.1283 13.4862C12.358 13.2961 12.5754 13.0905 12.7792 12.871" stroke="#666666" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round"/></svg>',ee={lat:24.7756042,lng:46.7360729},te="salla-bullet-delivery-override-ip";function ie(e,t){localStorage.getItem("salla-bullet-delivery-debug")&&(void 0!==t?console.log(e,t):console.log(e))}const se=class{constructor(e){t(this,e),this.bulletDeliveryConfirmed=i(this,"bulletDeliveryConfirmed"),this.bulletDeliveryClosed=i(this,"bulletDeliveryClosed"),this.addressCreated=i(this,"addressCreated"),this.headerContextUpdate=i(this,"headerContextUpdate"),this.pendingCartSubmitResolver=null,this.pendingCartSubmitPromise=null,this.cartSubmitConfirmationPending=!1,this.branchesServerQuery="",this.branchSearchDebounceTimer=null,this.countrySearchTimer=null,this.regionSearchTimer=null,this.citySearchTimer=null,this.districtSearchTimer=null,this.citySearchCounter=0,this.componentReady=!1,this.pendingOpen=!1,this.tabChanging=!1,this.intentStorageKey="bullet_delivery_intent",this.sessionShownKey="bullet_delivery_shown",this.incompleteIntentPromptKey="bullet_delivery_incomplete_intent_prompted",this.cartItemAddedEvent="cart::item.added",this.cartItemAddedHandler=null,this.cartSubmittingHandler=null,this.useCartEventApi=!1,this.authLoggedInHandler=null,this.autoConfirmAfterLoginInFlight=!1,this.authLoggedOutHandler=null,this.loginOpenHandler=null,this.hasExplicitPreselectedIdsForOpen=!1,this.bulletDeliveryOpenHandler=e=>{this.preselectedAddressId=e?.preselected_address_id,this.preselectedBranchId=e?.preselected_branch_id,this.hasExplicitPreselectedIdsForOpen=null!=e?.preselected_address_id||null!=e?.preselected_branch_id,this.open()},this.closeHandler=null,this.selectorTracker=new V,this.openTrigger="customer_requested",this.pendingDismissReason=null,this.modalCloseHandler=e=>{var t;this.pendingDismissReason=(t=e?.reason,E[t??""]??"escape"),queueMicrotask((()=>this.pendingDismissReason=null))},this.bulletDeliveryMobileSelectHandler=null,this.savedAddressesLoaded=!1,this.gmapRef=null,this.autoGeolocationTriggered=!1,this.geocodeRequestId=0,this.pickupDiscountRequestId=0,this.activeTab="address",this.isLoggedIn=!1,this.viewMode="main",this.countries=[],this.regions=[],this.cities=[],this.districts=[],this.loadingRegions=!1,this.selectedCountry=null,this.selectedRegion=null,this.selectedCity=null,this.selectedDistrict=null,this.districtName="",this.savedAddresses=[],this.selectedSavedAddress=null,this.selectedSessionAddress=!1,this.branches=[],this.pickupDiscountRange=null,this.pickupDiscountResolved=!1,this.filteredBranches=[],this.selectedBranch=null,this.branchSearchQuery="",this.branchCities=[],this.selectedBranchCity=null,this.branchCitySearchQuery="",this.expandedScheduleBranchId=null,this.shopperLocation=null,this.shopperLocationRequestId=0,this.nearestBranchRequestId=0,this.branchesRequestId=0,this.allBranchCities=null,this.loadingCountries=!1,this.loadingCities=!1,this.loadingDistricts=!1,this.loadingBranches=!1,this.loadingNearestBranch=!1,this.locationError="",this.loadingSavedAddresses=!1,this.showCartWillBeClearedBanner=!1,this.countrySearchQuery="",this.regionSearchQuery="",this.citySearchQuery="",this.districtSearchQuery="",this.searchingCountries=!1,this.searchingRegions=!1,this.searchingCities=!1,this.searchingDistricts=!1,this.displayedCountries=[],this.displayedRegions=[],this.displayedCities=[],this.displayedDistricts=[],this.allocationOutOfCoverageMessage=null,this.mapLocationData=null,this.addressToken=null,this.loadingToken=!1,this.mapReady=!1,this.addressDescription="",this.reverseGeocoding=!1,this.mapCountryCode=null,this.mapCountryResolved=!1,this.confirming=!1,this.locationPermission="unknown",this.stopWatchingLocationPermission=null,this.locationPermissionResolved=!1,this.liveLocation=null,this.newAddressForm={...se.INITIAL_ADDRESS_FORM},this.handleCountrySearch=e=>{this.countrySearchQuery=e},this.handleRegionSearch=e=>{this.regionSearchQuery=e},this.handleCitySearch=e=>{if(this.citySearchQuery=e,this.citySearchTimer&&clearTimeout(this.citySearchTimer),!e.trim())return this.displayedCities=this.cities,void(this.searchingCities=!1);if(e.trim().length<se.DROPDOWN_SEARCH_MIN_CHARS)return;const t=++this.citySearchCounter;this.citySearchTimer=setTimeout((async()=>{this.searchingCities=!0;try{const i=l(this.selectedCountry?.code??"")?this.selectedRegion?.id:void 0,s=await a.getCities(this.selectedCountry?.id,i,e);t===this.citySearchCounter&&(this.displayedCities=s)}catch{t===this.citySearchCounter&&(this.displayedCities=this.cities)}finally{t===this.citySearchCounter&&(this.searchingCities=!1)}}),se.DROPDOWN_SEARCH_DEBOUNCE_MS)},this.handleDistrictSearch=e=>{this.districtSearchQuery=e},this.handleCountryDropdownClosed=()=>{this.countrySearchQuery="",this.displayedCountries=this.countries,this.searchingCountries=!1},this.handleRegionDropdownClosed=()=>{this.regionSearchQuery="",this.displayedRegions=this.regions,this.searchingRegions=!1},this.handleCityDropdownClosed=()=>{this.citySearchQuery="",this.citySearchTimer&&(clearTimeout(this.citySearchTimer),this.citySearchTimer=null),++this.citySearchCounter,this.displayedCities=this.cities,this.searchingCities=!1},this.handleDistrictDropdownClosed=()=>{this.districtSearchQuery="",this.displayedDistricts=this.districts,this.searchingDistricts=!1},this.handleBranchCitySelected=e=>{this.selectedBranchCity=e&&-1!==e.id?this.branchCities.find((t=>String(t.id)===String(e.id)))??e:null,this.selectedBranch=null,this.loadBranches()},this.handleMapLocationChanged=e=>{const t=e.detail;if(!t?.position?.lat||!t?.position?.lng)return;const{lat:i,lng:s}=t.position;this.mapLocationData={lat:i,lng:s,shortAddress:t.place?.placeId??t.place?.place_id??void 0,formattedAddress:t.place?.formattedAddress??t.place?.formatted_address??void 0};const r=this.extractCountryCode(t.place?.addressComponents);this.mapCountryCode=r,this.mapCountryResolved=!!r,this.updateLocationBias(),setTimeout((()=>{const e=this.gmapRef?.locationMarker;e&&(e.gmpDraggable=!1)}),100);const l=!!this.mapLocationData.formattedAddress;l&&(r||this.isLoggedIn)?(this.invalidatePendingGeocode(),this.mapCountryResolved=!0):this.reverseGeocodeLocation(i,s,l)},this.handleMapReady=()=>{this.mapReady=!0,this.gmapRef&&"function"==typeof this.gmapRef.resize&&this.gmapRef.resize(),this.updateLocationBias(),this.locateOnMap(),"granted"!==this.locationPermission||this.liveLocation||this.handleLocationPermissionChanged("granted")},this.handleLocationPermissionRequest=async()=>{const e=await async function(){const e=await async function(){const e=await O();return e?.state??"unknown"}();if(function(){const e="undefined"!=typeof Salla?Salla.mobile:null;return!!e?.isSpaWebview?.()&&(e.action?.("location.settings.open"),!0)}())return{state:e,handledByApp:!0};if(!navigator?.geolocation)return{state:"denied",handledByApp:!1};try{const{coords:e}=await new Promise(((e,t)=>navigator.geolocation.getCurrentPosition(e,t,{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})));return{state:"granted",handledByApp:!1,position:{lat:e.latitude,lng:e.longitude}}}catch(t){return{state:1===t?.code?"denied":e,handledByApp:!1}}}();e.handledByApp||(await this.handleLocationPermissionChanged(e.state,e.position),"granted"===e.state&&this.locateOnMap(!0))},this.handleLocationPermissionChanged=async(e,t)=>{if(this.locationPermission=e,"granted"===e){if(t)this.liveLocation=t;else if(navigator.geolocation&&this.mapReady)try{const e=await new Promise(((e,t)=>navigator.geolocation.getCurrentPosition(e,t,{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})));this.liveLocation={lat:e.coords.latitude,lng:e.coords.longitude}}catch(e){ie("Live location capture failed",e)}}else this.liveLocation=null},this.retryMapCountryLookup=async()=>{this.hasMapLocation()&&(0!==this.countries.length||this.loadingCountries||await this.loadCountries(!0),this.hasMapLocation()&&this.reverseGeocodeLocation(this.mapLocationData.lat,this.mapLocationData.lng))},this.handleSubmitNewAddress=async e=>{if(e.preventDefault(),this.confirming)return;const t=this.canConfirmMapLocation();if(!(t||this.selectedCountry&&this.selectedCity))return;if(!t&&!o(this.selectedCountry?.code,this.selectedRegion?.id,this.selectedDistrict?.id??(this.districtName?.trim()||null)))return;const i=this.buildIntentAddress();if(!i)return;const s=this.getStoredIntent();this.setStoredIntent({type:"address",country_id:Number(this.selectedCountry?.id)||0,country_code:this.selectedCountry?.code||"",address_details:i}),this.selectedSavedAddress=null,this.selectedSessionAddress=!0,await this.handleConfirm(s)},this.handleCountrySelected=e=>{const t=this.countries.find((t=>String(t.id)===String(e.id)))||e;this.countrySearchQuery="",this.displayedCountries=this.countries,this.applyCountryChange(t||null)},this.handleRegionSelected=e=>{const t=this.regions.find((t=>String(t.id)===String(e.id)))||e;this.selectedRegion=t||null,this.regionSearchQuery="",this.displayedRegions=this.regions,this.updateNewAddressForm({region_id:t?.id,city_id:void 0,district_id:void 0,city:void 0,district:void 0}),t&&this.selectedCountry&&this.loadCities(this.selectedCountry.id,t.id)},this.handleCitySelected=e=>{const t=l(this.selectedCountry?.code??""),i=this.cities.find((t=>String(t.id)===String(e.id)))||e;this.selectedCity=i||null,this.selectedDistrict=null,this.districtName="",this.citySearchQuery="",this.displayedCities=this.cities,i&&(this.updateNewAddressForm({city:i,district:void 0}),t&&this.loadDistricts(i.id))},this.handleDistrictSelected=e=>{const t=this.districts.find((t=>String(t.id)===String(e.id)))||e;this.selectedDistrict=t||null,this.districtName="",this.districtSearchQuery="",this.displayedDistricts=this.districts,t&&this.updateNewAddressForm({district:t})}}get supportsPickup(){return Boolean(Salla.config.get("store.shipping.support_pickup"))||Boolean(Salla.config.get("store.support_pickup"))}get openingType(){return Salla.config.get("store.settings.bullet_delivery.settings.type")}get isRequired(){return!!Salla.config.get("store.settings.bullet_delivery.settings.is_required")}get isSupportsDelivery(){return!!Salla.config.get("store.settings.bullet_delivery.supports_delivery")}get isEnabled(){return!!Salla.config.get("store.features")?.includes("bullet-delivery-v2")&&!0===Salla.config.get("store.settings.bullet_delivery.enabled")}get isMobileApp(){return Salla.config.isMobileApp()}async open(e=!1,t="customer_requested"){if(this.isEnabled)if(this.openTrigger=t,this.isMobileApp)Salla.event.dispatch("salla::bullet-delivery.open-sheet");else if(this.componentReady&&this.modal){this.resetState(),this.loadPickupDiscountRange(),e||(this.modal.open(),Salla.event.dispatch("salla::bullet-delivery.modal.opened"));try{this.isLoggedIn=!this.isGuestUser();const e=this.cleanStaleGuestAddressIdIfNeeded(this.getStoredIntent());this.applyPreselectedIdsFromIntent(e);const t=!this.isLoggedIn&&"address"===e?.type&&null!=c(e)&&null!=h(e);if(this.activeTab=this.supportsPickup&&!this.isSupportsDelivery?"branch":this.supportsPickup&&e?.type&&("address"===e.type||"branch"===e.type)?e.type:"address",this.needsMap&&this.fetchAddressToken(),this.isLoggedIn&&"address"===this.activeTab&&(this.loadingSavedAddresses=!0),await Promise.all([this.loadCountries(t),this.isLoggedIn&&"address"===this.activeTab?this.loadSavedAddresses().then((()=>{this.savedAddressesLoaded=!0})).finally((()=>{this.loadingSavedAddresses=!1})):Promise.resolve()]),this.isLoggedIn&&this.preselectedAddressId){const e=this.savedAddresses.find((e=>e.id===this.preselectedAddressId));e&&(this.selectedSessionAddress=!1,this.selectedSavedAddress=e)}if("branch"===this.activeTab){const e=this.loadBranches(),t=this.branchesRequestId;if(await e,t!==this.branchesRequestId||"branch"!==this.activeTab||this.branchSearchQuery.trim())return;if(this.preselectedBranchId&&await this.preselectBranch(this.preselectedBranchId),t!==this.branchesRequestId||"branch"!==this.activeTab||this.branchSearchQuery.trim())return}await this.prefillFromSessionStorage()}catch(e){console.error("SallaBulletDelivery: Error loading data",e)}finally{this.overrideScopeSwitchUI()}}else this.pendingOpen=!0}async close(){if(!this.shouldForceNonClosable()||this.confirming)return this.bulletDeliveryClosed.emit(),this.modal?.close()}selectorContext(){return{configured_required:this.isRequired,effective_nonclosable:this.isRequired||this.shouldForceNonClosable(),trigger_configured:this.openingType??null,trigger_actual:this.openTrigger}}handleModalVisibility(e){e?this.selectorTracker.viewed(this.selectorContext()):this.pendingDismissReason&&(this.selectorTracker.dismissed(this.selectorContext(),this.pendingDismissReason,!!this.getStoredIntent()?.scope_allocated),this.pendingDismissReason=null)}trackSelectorResult(e,t,i,s){this.selectorTracker.result(this.selectorContext(),{outcome:e,fulfilment_method:"branch"===this.activeTab?"pickup":"delivery",previous_branch_ids:t?.scope_allocated?R(t):[],new_branch_ids:i,scope_id:s??null})}resetState(){n(),this.allBranchCities=null,this.pickupDiscountRequestId++,this.branchSearchDebounceTimer&&clearTimeout(this.branchSearchDebounceTimer),++this.branchesRequestId,this.loadingBranches=!1,++this.shopperLocationRequestId,++this.nearestBranchRequestId,this.loadingNearestBranch=!1,this.shopperLocation=null,this.viewMode="main",this.mapLocationData=null,this.mapCountryCode=null,this.mapCountryResolved=!1,this.invalidatePendingGeocode(),this.autoGeolocationTriggered=!1,this.addressDescription="",this.selectedCountry=null,this.selectedRegion=null,this.selectedCity=null,this.selectedDistrict=null,this.districtName="",this.selectedSavedAddress=null,this.selectedSessionAddress=!1,this.selectedBranch=null,this.branchSearchQuery="",this.branchCities=[],this.selectedBranchCity=null,this.expandedScheduleBranchId=null,this.regions=[],this.cities=[],this.districts=[],this.branches=[],this.filteredBranches=[],this.pickupDiscountRange=null,this.pickupDiscountResolved=!1,this.newAddressForm={...se.INITIAL_ADDRESS_FORM},this.showCartWillBeClearedBanner=!1,this.allocationOutOfCoverageMessage=null,this.locationError="",this.savedAddressesLoaded=!1,this.loadingSavedAddresses=!1,this.loadingCountries=!1,this.resetSearchState()}getIntentStorage(){const e=Boolean(Salla.config.get("store.settings.bullet_delivery.settings.remember_last_session"));return Salla.storage[e?"store":"session"]}getShownStorage(){return Salla.storage.session}getStoredIntent(){return this.getIntentStorage().get(this.intentStorageKey)}isGuestUser(){return"guest"===String(Salla.config.get("user.type")??"guest")}cleanStaleGuestAddressIdIfNeeded(e){if(!this.isGuestUser()||"address"!==e?.type||!e.address_id)return e;const t={...e,address_id:void 0};return this.setStoredIntent(t),t}applyPreselectedIdsFromIntent(e){this.hasExplicitPreselectedIdsForOpen?this.hasExplicitPreselectedIdsForOpen=!1:(this.preselectedAddressId=void 0,this.preselectedBranchId=void 0,this.isGuestUser()?"branch"===e?.type&&e.branch_id&&(this.preselectedBranchId=e.branch_id):"address"===e?.type&&e.address_id?this.preselectedAddressId=e.address_id:"branch"===e?.type&&e.branch_id&&(this.preselectedBranchId=e.branch_id))}hasIncompleteUserAddressIntent(){if(this.isGuestUser())return!1;const e=this.getStoredIntent();return!(!e||"address"!==e.type||e.address_id||!e.address_details)&&d(e)}isIntentMethodSupported(e){return"branch"===e.type?this.supportsPickup:"address"===e.type&&this.isSupportsDelivery}hasCompleteIntentForLoggedInUser(){if(this.isGuestUser())return!1;const e=this.getStoredIntent();return!!(e&&this.isIntentMethodSupported(e)&&!1!==e.scope_allocated&&("address"===e.type?e.address_id:"branch"===e.type&&e.branch_id))}async tryAutoConfirmAfterLogin(){if(this.confirming||this.autoConfirmAfterLoginInFlight)return!1;if(!this.hasIncompleteUserAddressIntent())return!1;this.autoConfirmAfterLoginInFlight=!0;const e=!!this.modal?.hasAttribute?.("visible");try{return e||await this.open(!0,"after_login"),this.selectedSessionAddress?(await this.handleConfirm(),!(!e&&!this.hasCompleteIntentForLoggedInUser()&&(this.modal?.open(),1))):(e||this.modal?.open(),!1)}finally{this.autoConfirmAfterLoginInFlight=!1}}shouldForceNonClosable(){return!this.isGuestUser()&&!!Salla.url.is_page("cart")&&!this.hasCompleteIntentForLoggedInUser()}shouldPromptIncompleteIntentThisSession(){const e=this.getShownStorage();return this.hasIncompleteUserAddressIntent()&&!0!==e.get(this.incompleteIntentPromptKey)}markIncompleteIntentPrompted(){this.getShownStorage().set(this.incompleteIntentPromptKey,!0)}setStoredIntent(e){this.getIntentStorage().set(this.intentStorageKey,e),this.overrideScopeSwitchUI()}clearBulletDeliveryStoredData(){Salla.storage.session.remove(this.intentStorageKey),Salla.storage.store.remove(this.intentStorageKey),Salla.storage.session.remove(this.sessionShownKey),Salla.storage.session.remove(this.incompleteIntentPromptKey),this.overrideScopeSwitchUI()}async prefillAddressFromStoredIntent(){const e=this.getStoredIntent();if(!e||"address"!==e.type||null==h(e))return;const t=c(e);if(!t)return;const i=this.countries.find((e=>String(e.id)===String(t)));if(!i)return;this.selectedCountry=i,this.updateNewAddressForm({country_id:Number(i.id)});const s=l(i.code),r=h(e),o=u(e),n=p(e),d=e.address_details?.district?.name,[b,y,g]=await Promise.all([s?a.getRegions(i.id):Promise.resolve([]),a.getCities(i.id,s&&null!=o?o:void 0),null!=r?a.getDistricts(Number(r)):Promise.resolve([])]);if(s&&(this.regions=b,this.displayedRegions=this.regions),this.cities=y,this.displayedCities=this.cities,this.districts=g,this.displayedDistricts=this.districts,this.loadingCities=!1,this.loadingRegions=!1,this.loadingDistricts=!1,s&&null!=o){const e=this.regions.find((e=>String(e.id)===String(o)));e&&(this.selectedRegion=e,this.updateNewAddressForm({region_id:e.id}))}if(null!=r&&this.cities.length>0){const e=this.cities.find((e=>String(e.id)===String(r)));e&&(this.selectedCity=e,this.updateNewAddressForm({city_id:e.id,city:e}))}if(this.districts.length>0){const e=this.findPrefillDistrict(n,d);e&&(this.updateNewAddressForm({district_id:e.id,district:e}),this.selectedDistrict=e)}!this.selectedDistrict&&d&&(this.districtName=d)}updateNewAddressForm(e){this.newAddressForm={...this.newAddressForm,...e}}hasBeenShownThisSession(){return!0===this.getShownStorage().get(this.sessionShownKey)}markShownThisSession(){this.getShownStorage().set(this.sessionShownKey,!0)}getIPLocationConfig(){const e="store.shipping.delivery_location",t={countryId:Salla.config.get(`${e}.country_id`),regionId:Salla.config.get(`${e}.region_id`),cityId:Salla.config.get(`${e}.city_id`),districtId:Salla.config.get(`${e}.district_id`)};return localStorage.getItem(te)?JSON.parse(localStorage.getItem(te)):t}async loadCountries(e=!1){this.loadingCountries=!0;const t="branch"===this.activeTab;try{this.countries=await a.getCountries(t),this.displayedCountries=this.countries;const{countryId:i,regionId:s,cityId:r,districtId:o}=this.getIPLocationConfig();ie("getIPLocationConfig",this.getIPLocationConfig());const n=i&&this.countries.length>0?this.countries.find((e=>String(e.id)===String(i))):null;n&&(this.selectedCountry=n,this.updateNewAddressForm({country_id:Number(this.selectedCountry.id)}),!e)&&(null!=s||null!=r||null!=o?await this.prefillFromIPLocation(n,{regionId:s,cityId:r,districtId:o}):l(this.selectedCountry.code)?await this.loadRegions(this.selectedCountry.id):await this.loadCities(this.selectedCountry.id))}finally{this.loadingCountries=!1}}async prefillFromIPLocation(e,t){const i=l(e.code),{regionId:s,cityId:r,districtId:o}=t,[n,d,h]=await Promise.all([i?a.getRegions(e.id):Promise.resolve([]),a.getCities(e.id,i&&null!=s?s:void 0),null!=r?a.getDistricts(Number(r)):Promise.resolve([])]);if(i&&(this.regions=n,this.displayedRegions=this.regions),this.cities=d,this.displayedCities=this.cities,this.districts=h,this.displayedDistricts=this.districts,this.loadingRegions=!1,this.loadingCities=!1,this.loadingDistricts=!1,i&&null!=s){const e=this.regions.find((e=>String(e.id)===String(s)));e&&(this.selectedRegion=e,this.updateNewAddressForm({region_id:e.id}))}if(null!=r&&this.cities.length>0){const e=this.cities.find((e=>String(e.id)===String(r)));e&&(this.selectedCity=e,this.updateNewAddressForm({city_id:e.id,city:e}))}if(null!=o&&this.districts.length>0){const e=this.findPrefillDistrict(o);e&&(this.selectedDistrict=e,this.updateNewAddressForm({district_id:e.id,district:e}))}}async loadCities(e,t){this.loadingCities=!0,this.cities=[],this.displayedCities=[],this.districts=[],this.displayedDistricts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="";try{this.cities=await a.getCities(e,t),this.displayedCities=this.cities}finally{this.loadingCities=!1}}async loadDistricts(e){this.loadingDistricts=!0,this.districts=[],this.displayedDistricts=[],this.selectedDistrict=null,this.districtName="";try{this.districts=await a.getDistricts(e),this.displayedDistricts=this.districts}finally{this.loadingDistricts=!1}}findPrefillDistrict(e,t){if(0===this.districts.length)return;if(null!=e){const t=this.districts.find((t=>String(t.id)===String(e)));if(t)return t}const i=t?.trim().toLowerCase();return i?this.districts.find((e=>{const t=e.name?.trim().toLowerCase(),s=e.name_en?.trim().toLowerCase();return t===i||s===i})):void 0}async loadBranches(){const e=++this.branchesRequestId,t=this.branchSearchQuery.trim();this.loadingBranches=!0;try{const i=await a.getBranches({country_id:this.selectedCountry?.id,city_id:this.selectedBranchCity?.id,query:t,...await this.getListLocation()});if(e!==this.branchesRequestId)return;this.branchesServerQuery=t.length>=2?t:"",this.applyLoadedBranches(i),t.length<2&&this.refreshBranchCities()}finally{e===this.branchesRequestId&&(this.loadingBranches=!1)}}refreshBranchCities(){this.selectedBranchCity||(this.branchCities=b(this.branches));const e=this.selectedCountry?.id;if(!this.allBranchCities||this.allBranchCities.countryId!==e||Date.now()-this.allBranchCities.timestamp>y){const t=a.getAllBranches(e,20);this.allBranchCities={countryId:e,timestamp:Date.now(),branches:t,cities:t.then((e=>b(e)))}}const t=this.allBranchCities;return t.cities.then((i=>{this.allBranchCities===t&&this.selectedCountry?.id===e&&(i.length?this.branchCities=i:this.allBranchCities=null)})).catch((i=>{this.allBranchCities===t&&(this.allBranchCities=null,this.selectedCountry?.id===e&&Array.isArray(i?.branches)&&(this.branchCities=b([...this.branches,...i.branches]))),console.error("[BulletDelivery] Error fetching branch cities",i)}))}applyLoadedBranches(e){if(this.branches=e,this.selectedBranch){const t=e.find((e=>e.id===this.selectedBranch?.id));t&&(this.selectedBranch=g(t)?t:null)}this.filterBranches()}async loadPickupDiscountRange(){if(!this.supportsPickup)return;const e=++this.pickupDiscountRequestId,{branches:t,complete:i}=await a.getBranchCollection(void 0,60,{requireComplete:!0});e===this.pickupDiscountRequestId&&(this.pickupDiscountRange=i?m(t):null,this.pickupDiscountResolved=!0)}getPickupDiscountLabel(e,t,i=t){const s=t=>"percentage"===e?String(Math.round(100*t)/100):salla.money(t),r=t===i?s(t):`${s(t)} – ${s(i)}`,l="percentage"===e?`${r}%`:`${r} `;return Salla.lang.getWithDefault("pages.checkout.pickup_discount",this.isArabic?`خصم ${l}`:` ${l} discount`,{amount:l})}filterBranches(){const e=this.branchSearchQuery.trim();this.filteredBranches=e&&e===this.branchesServerQuery?this.branches:v(this.branches,e)}async prefillFromSessionStorage(){try{const e=this.getStoredIntent();if(!e)return;if("address"!==this.activeTab||"address"!==e.type||this.isLoggedIn||await this.prefillAddressFromStoredIntent(),"branch"===this.activeTab&&"branch"===e.type){const t=c(e);if(null!=t){const i=this.countries.find((e=>String(e.id)===String(t)));i&&(this.selectedCountry=i,this.updateNewAddressForm({country_id:Number(i.id)}),await this.preselectBranch(w(e)))}}}catch(e){console.error("[BulletDelivery] Error prefilling from session storage:",e)}}async loadSavedAddresses(){const e=this.selectedSavedAddress?.id;this.savedAddresses=await a.getSavedAddresses();const t=this.getStoredIntent();if(d(t))return this.selectedSessionAddress=!0,void(this.selectedSavedAddress=null);if(null!=e){const t=this.savedAddresses.find((t=>t.id===e&&!1!==t.is_in_coverage));if(t)return this.selectedSessionAddress=!1,void(this.selectedSavedAddress=t)}const i=this.savedAddresses.find((e=>e.is_default&&!1!==e.is_in_coverage));if(i)this.selectedSavedAddress=i;else{const e=this.savedAddresses.find((e=>!1!==e.is_in_coverage));e&&(this.selectedSavedAddress=e)}}applyCountryChange(e){++this.branchesRequestId,this.allBranchCities=null,this.loadingBranches=!1,this.branches=[],this.filteredBranches=[],this.selectedCountry=e,this.selectedBranchCity=null,this.branchCities=[],this.branchCitySearchQuery="",this.selectedBranch=null,this.selectedRegion=null,this.regions=[],this.displayedRegions=[],this.cities=[],this.displayedCities=[],this.districts=[],this.displayedDistricts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="",this.allocationOutOfCoverageMessage=null,this.regionSearchQuery="",this.citySearchQuery="",this.districtSearchQuery="",this.searchingRegions=!1,this.searchingCities=!1,this.searchingDistricts=!1,this.clearSearchTimers(),this.selectedCountry&&(this.updateNewAddressForm({country_id:Number(this.selectedCountry.id),region_id:void 0,city_id:void 0,district_id:void 0,city:void 0,district:void 0}),"branch"===this.activeTab?this.loadBranches():l(this.selectedCountry.code)?this.loadRegions(this.selectedCountry.id):this.loadCities(this.selectedCountry.id))}async loadRegions(e){this.loadingRegions=!0,this.regions=[],this.displayedRegions=[],this.selectedRegion=null,this.cities=[],this.displayedCities=[],this.districts=[],this.displayedDistricts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="";try{this.regions=await a.getRegions(e),this.displayedRegions=this.regions}finally{this.loadingRegions=!1}}emitHeaderContextUpdate(e,t,i){let s="";"address"===e.type?t?s=t.district?.name&&t.city?.name?`${t.district.name}، ${t.city.name}`:t.city?.name??"":this.isGuestMapPick?s=e.address_details?.formatted_address??"":this.selectedCity?s=this.selectedDistrict?`${this.selectedDistrict.name}، ${this.selectedCity.name}`:this.selectedCity.name:e.address_details&&(s=[e.address_details.district?.name,e.address_details.city?.name,e.address_details.country?.name].filter(Boolean).join("، ")||e.address_details.formatted_address||e.address_details.short_address||""):i?s=i.name:e.branch_details&&(s=e.branch_details.city??e.branch_details.name);const r="address"===e.type?Salla.lang.get("mobile_app.strings.delivery"):Salla.lang.get("mobile_app.strings.pickup");this.headerContextUpdate.emit({type:e.type,display_text:s?`${r}: ${s}`:"",country_code:e.country_code,city:this.selectedCity?.name??e.address_details?.city?.name,district:this.selectedDistrict?.name??e.address_details?.district?.name,branch_name:i?.name??e.branch_details?.name})}handleBranchSearch(e){const t=e.target.value;if(this.branchSearchQuery=t,this.branchSearchDebounceTimer&&clearTimeout(this.branchSearchDebounceTimer),!t?.trim())return this.branchSearchQuery="",void this.loadBranches();this.branchSearchDebounceTimer=setTimeout((()=>{t.trim().length<2&&!this.branchesServerQuery||this.loadBranches()}),1e3)}clearSearchTimers(){[this.countrySearchTimer,this.regionSearchTimer,this.citySearchTimer,this.districtSearchTimer].forEach((e=>{e&&clearTimeout(e)})),this.countrySearchTimer=this.regionSearchTimer=this.citySearchTimer=this.districtSearchTimer=null}resetSearchState(){this.countrySearchQuery="",this.regionSearchQuery="",this.citySearchQuery="",this.districtSearchQuery="",this.searchingCountries=!1,this.searchingRegions=!1,this.searchingCities=!1,this.searchingDistricts=!1,this.displayedCountries=[],this.displayedRegions=[],this.displayedCities=[],this.displayedDistricts=[],this.clearSearchTimers()}async loadBranchesWithLocation(e,t){++this.shopperLocationRequestId,this.shopperLocation={lat:e,lng:t};const i=++this.branchesRequestId;this.loadingBranches=!0;try{const s=await a.getBranches({country_id:this.selectedCountry?.id,city_id:this.selectedBranchCity?.id,lat:e,lng:t});if(i!==this.branchesRequestId)return!1;if(this.branchesServerQuery="",this.applyLoadedBranches(s),this.refreshBranchCities(),!this.selectedCountry&&this.branches.length>0){const e=this.branches[0];if(e.country){const t=this.countries.find((t=>t.id===e.country.id));t&&(this.selectedCountry=t,this.updateNewAddressForm({country_id:Number(t.id)}))}}return!0}finally{i===this.branchesRequestId&&(this.loadingBranches=!1)}}async handleFindNearestBranch(){if(!navigator.geolocation)return void(this.locationError=Salla.lang.get("pages.checkout.current_location_not_supported"));const e=++this.nearestBranchRequestId;this.loadingNearestBranch=!0,this.locationError="";try{const t=await new Promise(((e,t)=>{navigator.geolocation.getCurrentPosition(e,t,{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})})),{latitude:i,longitude:s}=t.coords;if(e!==this.nearestBranchRequestId)return;if(!await this.loadBranchesWithLocation(i,s))return;if(e!==this.nearestBranchRequestId)return;const r=f(this.branches,i,s);r&&(this.selectedBranch=r,this.branchSearchQuery="",this.filterBranches())}catch(t){if(e!==this.nearestBranchRequestId)return;const i=t;this.locationError=this.geolocationErrorMessage("number"==typeof i?.code?i.code:-1)}finally{e===this.nearestBranchRequestId&&(this.loadingNearestBranch=!1)}}geolocationErrorMessage(e){return 1===e?Salla.lang.getWithDefault("pages.checkout.allow_location_permission_blocked_hint",this.isArabic?"مشاركة الموقع محجوبة لهذا المتجر في متصفحك. افتح إعدادات الموقع في المتصفح، اسمح بالوصول إلى الموقع، ثم أعد المحاولة.":"Location sharing is blocked for this store in your browser. Open your browser's location settings, allow location access, then try again."):Salla.lang.getWithDefault("pages.checkout.pickup_location_unavailable",this.isArabic?"تعذَّر تحديد موقعك. حاول مرة أخرى.":"We couldn't detect your location. Try again.")}handleBranchSelect(e){this.selectedBranch=e,this.allocationOutOfCoverageMessage=null}toggleBranchSchedule(e){this.expandedScheduleBranchId=this.expandedScheduleBranchId===e?null:e}async preselectBranch(e){if(null==e||this.selectedBranch)return;let t=this.branches.find((t=>t.id===e));if(!t&&this.allBranchCities){const i=this.allBranchCities,s=this.branchesRequestId;try{t=(await i.branches).find((t=>t.id===e))}catch{return}if(s!==this.branchesRequestId||"branch"!==this.activeTab||this.allBranchCities!==i||i.countryId!==this.selectedCountry?.id||this.selectedBranch||this.branchSearchQuery.trim())return;if(this.selectedBranchCity&&String(t?.city?.id)!==String(this.selectedBranchCity.id))return;t&&g(t)&&this.applyLoadedBranches([...this.branches,t])}t&&g(t)&&(this.selectedBranch=t)}handleSavedAddressSelect(e){!1!==e.is_in_coverage?(this.selectedSavedAddress=e,this.selectedSessionAddress=!1,this.allocationOutOfCoverageMessage=null):Salla.notify?.error(Salla.lang.get("pages.checkout.shipping_not_available"))}handleSessionAddressSelect(){this.selectedSessionAddress=!0,this.selectedSavedAddress=null,this.allocationOutOfCoverageMessage=null}async handleAddNewAddress(){this.viewMode="add-address",this.mapLocationData=null,this.invalidatePendingGeocode(),this.autoGeolocationTriggered=!1,this.fetchAddressToken();const e=this.getStoredIntent(),t=c(e);if(t&&this.countries.length>0){const e=this.countries.find((e=>e.id===t));e&&(this.selectedCountry=e,this.updateNewAddressForm({country_id:Number(e.id)}),l(e.code)?await this.loadRegions(e.id):await this.loadCities(e.id))}}handleBackToAddressList(){this.viewMode="main",this.mapLocationData=null,this.invalidatePendingGeocode(),this.addressDescription="",this.autoGeolocationTriggered=!1}hasAddressesToGoBack(){return this.savedAddresses.length>0||d(this.getStoredIntent())}async fetchAddressToken(){if(this.canUseMap&&!this.addressToken&&!this.loadingToken){this.loadingToken=!0;try{const e=salla.config.get("store.settings.keys.maps"),t=()=>import("./p-DI6PJLEJ.js").then((({load:t})=>t({key:e,libraries:["marker","places"],language:salla.config.get("user.language_code")||"ar"}))).catch((e=>ie("Failed to load Google Maps SDK",e)));"complete"===document.readyState?t():window.addEventListener("load",t,{once:!0}),this.addressToken=await a.getAddressToken()}catch{ie("SallaBulletDelivery: Failed to fetch address token")}finally{this.loadingToken=!1}}}extractCountryCode(e){const t=e?.find((e=>e?.types?.includes("country"))),i=t?.short_name??t?.shortText;return"string"==typeof i&&i.trim()?i.trim().toUpperCase():null}invalidatePendingGeocode(){this.reverseGeocoding=!1,this.geocodeRequestId++}applyCoordsFallback(e,t){this.mapLocationData={...this.mapLocationData,formattedAddress:this.mapLocationData?.formattedAddress??`${e.toFixed(6)}, ${t.toFixed(6)}`},this.mapCountryResolved=!0}reverseGeocodeLocation(e,t,i=!1){this.mapCountryCode=null,this.mapCountryResolved=!1;const s=window.google?.maps?.Geocoder;if(!s)return this.geocodeRequestId++,void this.applyCoordsFallback(e,t);this.reverseGeocoding=!0;const r=++this.geocodeRequestId;(new s).geocode({location:{lat:e,lng:t}},((s,l)=>{if(r===this.geocodeRequestId)if(this.reverseGeocoding=!1,l===window.google.maps.GeocoderStatus.OK&&s?.[0]){this.mapLocationData={...this.mapLocationData,formattedAddress:i?this.mapLocationData.formattedAddress:s[0].formatted_address,shortAddress:this.mapLocationData?.shortAddress??s[0].place_id};for(const e of s)if(this.mapCountryCode=this.extractCountryCode(e.address_components),this.mapCountryCode)break;this.mapCountryResolved=!0}else ie("Reverse geocoding failed for map location",l),this.applyCoordsFallback(e,t)}))}updateLocationBias(){if(!this.gmapRef)return;const e=this.hasMapLocation()?{lat:this.mapLocationData.lat,lng:this.mapLocationData.lng}:this.mapInitialCenter;this.gmapRef.autocompleteLocationBias={center:e,radius:5e5}}locateOnMap(e=!1){if(!this.gmapRef)return;if(!e){if(this.autoGeolocationTriggered||this.hasMapLocation())return;if(!this.locationPermissionResolved||U(this.locationPermission))return}const t=this.gmapRef.getCurrentLocation;if("function"==typeof t){this.autoGeolocationTriggered=!0;try{const e=t.call(this.gmapRef,!0);e&&"function"==typeof e.catch&&e.catch((e=>ie("Auto geolocation failed",e)))}catch(e){ie("Auto geolocation threw",e)}}}hasMapLocation(){return null!=this.mapLocationData?.lat&&null!=this.mapLocationData?.lng}canConfirmMapLocation(){return this.hasMapLocation()&&!this.reverseGeocoding&&!!this.mapLocationData?.formattedAddress}get isMapSettingEnabled(){return Salla.config.get("store.settings.bullet_delivery.settings.map_enabled")}get isMapModeAvailable(){return this.canUseMap&&!!this.addressToken}get canUseMap(){return!!this.isMapSettingEnabled&&!!salla.config.get("store.settings.keys.maps")}get needsMap(){return this.canUseMap&&"address"===this.activeTab&&("add-address"===this.viewMode||!this.isLoggedIn)}get isMapPick(){return this.isMapModeAvailable&&this.hasMapLocation()}get isGuestMapPick(){return!this.isLoggedIn&&this.isMapPick}get mapCountry(){return this.mapCountryCode?this.countries.find((e=>String(e.code).toUpperCase()===this.mapCountryCode))??null:null}get mapCountryStatus(){return!this.mapCountryResolved||this.loadingCountries?"resolving":this.mapCountryCode&&0!==this.countries.length?this.mapCountry?"resolved":"unsupported":"unresolved"}isGuestMapCountryBlocked(){return this.isGuestMapPick&&"resolved"!==this.mapCountryStatus}renderMapCountryNotice(){if(!this.isGuestMapPick)return null;const t=this.mapCountryStatus;return"unsupported"===t?this.renderAlert(Salla.lang.getWithDefault("pages.checkout.map_country_unsupported","We don't deliver to this location. Move the pin to a supported country.")):"unresolved"!==t?null:e("div",null,this.renderAlert(Salla.lang.getWithDefault("pages.checkout.map_country_unresolved","We couldn't determine the country of this location. Move the pin or try again.")),e("salla-button",{shape:"link",onClick:this.retryMapCountryLookup},Salla.lang.getWithDefault("pages.checkout.try_again","Try again")))}get mapInitialCenter(){return this.defaultGeoLocation??ee}getListLocation(){const e=this.getGrantedDeviceLocation();return!this.shopperLocation&&navigator.geolocation&&navigator.permissions?.query?Promise.race([e,new Promise((e=>setTimeout((()=>e({})),1500)))]):e}async getGrantedDeviceLocation(){if(this.shopperLocation)return this.shopperLocation;if(!navigator.geolocation||!navigator.permissions?.query)return{};const e=++this.shopperLocationRequestId;try{const t=await navigator.permissions.query({name:"geolocation"});if(e!==this.shopperLocationRequestId)return this.shopperLocation??{};if("granted"!==t.state)return{};const i=await new Promise(((e,t)=>navigator.geolocation.getCurrentPosition(e,t,{timeout:5e3,maximumAge:6e5})));return e!==this.shopperLocationRequestId?this.shopperLocation??{}:(this.shopperLocation={lat:i.coords.latitude,lng:i.coords.longitude},this.shopperLocation)}catch{return{}}}get defaultGeoLocation(){const e=salla.config.get("user.default_geo_location"),t=x(e?.lat),i=x(e?.lng);return null!=t&&null!=i&&t>=-90&&t<=90&&i>=-180&&i<=180?{lat:t,lng:i}:null}async handleTabChange(e){if(!this.tabChanging){++this.branchesRequestId,this.loadingBranches=!1,this.tabChanging=!0;try{this.activeTab=e,"add-address"===this.viewMode&&(this.viewMode="main",this.invalidatePendingGeocode()),this.showCartWillBeClearedBanner=!1,this.allocationOutOfCoverageMessage=null,this.resetSearchState();const t="branch"===e;this.countries=await a.getCountries(t),this.displayedCountries=this.countries;const i=this.selectedCountry?.id;if(null!=i&&(this.selectedCountry=this.countries.find((e=>e.id===i))||null),!this.selectedCountry){const{countryId:e}=this.getIPLocationConfig();e&&this.countries.length>0&&(this.selectedCountry=this.countries.find((t=>String(t.id)===String(e)))||null),this.selectedCountry||1!==this.countries.length||(this.selectedCountry=this.countries[0])}if(String(i??"")!==String(this.selectedCountry?.id??"")&&(this.allBranchCities=null,this.selectedBranchCity=null,this.branchCities=[],this.branchCitySearchQuery="",this.selectedBranch=null,this.branches=[],this.filteredBranches=[]),"address"===e&&this.needsMap&&this.fetchAddressToken(),this.selectedCountry)if("branch"===e){const e=this.getStoredIntent();await this.loadBranches(),this.preselectBranch(w(e))}else if("address"===e){if(this.isLoggedIn&&!this.savedAddressesLoaded){this.loadingSavedAddresses=!0;try{await this.loadSavedAddresses(),this.savedAddressesLoaded=!0}finally{this.loadingSavedAddresses=!1}}if(!this.isLoggedIn){const e=this.getStoredIntent();e&&h(e)&&await this.prefillAddressFromStoredIntent()}}}finally{this.tabChanging=!1}}}isConfirmDisabled(){return"branch"===this.activeTab?!g(this.selectedBranch):"address"===this.activeTab&&(!this.isLoggedIn||!this.selectedSessionAddress)&&(this.isLoggedIn&&this.selectedSavedAddress?!1===this.selectedSavedAddress.is_in_coverage:!this.isLoggedIn&&this.isMapModeAvailable?!this.isGuestMapPick||this.isGuestMapCountryBlocked():!this.selectedCountry||!this.selectedCity||!o(this.selectedCountry?.code,this.selectedRegion?.id,this.selectedDistrict?.id??(this.districtName?.trim()||null)))}handleLogin(){Salla.auth.setCanRedirect(!1),Salla.event.dispatch("salla::bullet-delivery.modal.close.requested"),Salla.event.dispatch("login::open",Salla.url.is_page("cart")?{withoutReload:!0,source:"cart-submit"}:{withoutReload:!0,source:"bullet-delivery"})}resolvePendingCartSubmit(){if(!this.pendingCartSubmitResolver)return;const e=this.pendingCartSubmitResolver;this.pendingCartSubmitResolver=null,this.pendingCartSubmitPromise=null,this.cartSubmitConfirmationPending=!1,e()}armPendingCartSubmitGate(){this.isEnabled&&!this.cartSubmitConfirmationPending&&(this.cartSubmitConfirmationPending=!0,this.pendingCartSubmitPromise=new Promise((e=>{this.pendingCartSubmitResolver=e})))}openGuestLogin(){Salla.event.dispatch("salla::bullet-delivery.modal.close.requested"),Salla.auth.setCanRedirect(!1),Salla.event.dispatch("login::open",{withoutReload:!0,source:"cart-submit"})}async handlePendingSubmitAfterLogin(){this.isGuestUser()||(Salla.event.dispatch("login::close"),this.hasCompleteIntentForLoggedInUser()?this.resolvePendingCartSubmit():await this.tryAutoConfirmAfterLogin()||this.modal?.hasAttribute?.("visible")&&this.isLoggedIn||this.open(!1,"after_login"))}buildIntentAddress(){if("address"!==this.activeTab)return;if(this.isMapPick&&this.mapLocationData){const{lat:e,lng:t,formattedAddress:i,shortAddress:s}=this.mapLocationData,r=this.isGuestMapPick?this.mapCountry:this.selectedCountry;return{country:r?{id:r.id,name:r.name,code:r.code}:void 0,lat:e,lng:t,formatted_address:i,place_id:s,description:this.addressDescription?.trim()||void 0}}if(!this.selectedCountry||!this.selectedCity)return;const e={id:this.selectedCountry.id,name:this.selectedCountry.name,code:this.selectedCountry.code},t={id:this.selectedCity.id,name:this.selectedCity.name},i=this.selectedRegion?{id:this.selectedRegion.id,name:this.selectedRegion.name,code:this.selectedRegion.code}:void 0,s=this.selectedDistrict?{id:this.selectedDistrict.id,name:this.selectedDistrict.name}:this.districtName?{id:0,name:this.districtName}:void 0,r=this.selectedSavedAddress?.short_address;return{country:e,region:i,city:t,district:s,short_address:r}}buildIntentAddressFromSaved(e){return{country:{id:e.country?.id??e.country_id??0,name:e.country?.name??"",code:e.country?.code},region:e.region?{id:e.region.id,name:e.region.name,code:e.region.code}:void 0,city:{id:e.city?.id??e.city_id??0,name:e.city?.name??""},district:e.district?{id:e.district.id,name:e.district.name}:void 0,short_address:e.short_address,street:e.street,local:e.local,lat:e.lat,lng:e.lng}}buildIntentBranch(){if("branch"!==this.activeTab||!this.selectedBranch)return;const e=this.selectedBranch,t=null!=e.location?.lat?Number(e.location.lat):void 0,i=null!=e.location?.lng?Number(e.location.lng):void 0;return{id:e.id,name:e.name,city:e.city?.name,country:e.country?.name,district:e.district?.name,latitude:t,longitude:i}}buildAllocationConfirmedAddressData(e){return"address"!==this.activeTab?null:{saved_address:e??this.selectedSavedAddress??void 0,country:this.selectedCountry??void 0,region:this.selectedRegion??void 0,city:this.selectedCity??void 0,district:this.selectedDistrict??void 0,district_name:this.districtName?.trim()||void 0,short_address:e?.short_address??this.selectedSavedAddress?.short_address,form_data:{...this.newAddressForm},lat:this.mapLocationData?.lat,lng:this.mapLocationData?.lng,formatted_address:this.mapLocationData?.formattedAddress}}buildAllocationConfirmedAddressFromIntent(e){if("address"!==e.type)return null;const t=e.address_details,i=Number(e.country_id)||0;return{country:t?.country?{id:t.country.id,name:t.country.name,code:t.country.code??e.country_code??""}:void 0,region:t?.region?{id:Number(t.region.id),name:t.region.name,country_id:i,code:t.region.code??void 0}:void 0,city:t?.city?{id:Number(t.city.id),name:t.city.name,country_id:i}:void 0,district:t?.district?{id:Number(t.district.id),name:t.district.name,city_id:Number(t.city?.id)||0}:void 0,short_address:t?.short_address}}buildBranchFromIntent(e){if("branch"!==e.type||!e.branch_details)return null;const t=e.branch_details,i={id:t.id,name:t.name};return t.city&&(i.city={id:0,name:t.city}),null!=t.latitude&&null!=t.longitude&&(i.location={lat:String(t.latitude),lng:String(t.longitude)}),i}buildAllocationRequestFromIntent(e){if("branch"===e.type)return{type:"branch",branch_id:null!=e.branch_id?String(e.branch_id):""};if(null!=e.address_id)return{type:"address",address_id:String(e.address_id)};const t=e.address_details,i={type:"address",country_id:null!=e.country_id?String(e.country_id):"",city_id:null!=t?.city?.id?String(t.city.id):""};return null!=t?.region?.id&&(i.region_id=String(t.region.id)),null!=t?.district?.id&&(i.district_id=String(t.district.id)),i}applyMobileBulletDeliverySelection(e){if(!e||"address"!==e.type&&"branch"!==e.type)return void console.warn("SallaBulletDelivery: ignoring invalid mobile select payload",e);const t=e.allocation_headers??{},i=t["s-scope-allocation-type"]??e.type,s=t["s-scope-allocation-id"];i&&Salla.api.setHeader("s-scope-allocation-type",i),s&&Salla.api.setHeader("s-scope-allocation-id",String(s));const r=Salla.config.get("store.scope",Salla.storage.get("scope"))||{};Salla.storage.set("scope",{...r,allocation_type:i,allocation_id:s?String(s):void 0}),this.markShownThisSession();const l={...e,allocation_headers:{"s-scope-allocation-type":i,"s-scope-allocation-id":s?String(s):void 0}};this.setStoredIntent(l),k();const a=this.buildBranchFromIntent(l),o={...l,address:this.buildAllocationConfirmedAddressFromIntent(l),branch:a,allocation_request:this.buildAllocationRequestFromIntent(l),allocation_response:null};Salla.event.dispatch("salla::bullet-delivery.allocation.confirmed",o),this.bulletDeliveryConfirmed.emit({...l,branch:a??void 0}),this.emitHeaderContextUpdate(l,void 0,a??void 0),setTimeout((()=>window.location.reload()),100)}extractMobileSelectPayload(e){return e&&"object"==typeof e?"payload"in e&&e.payload?e.payload:e:null}async handleConfirm(e){if(this.isConfirmDisabled()||this.confirming)return;this.allocationOutOfCoverageMessage=null,this.confirming=!0,this.confirmBtn?.load();let t=!1;const i=void 0===e?this.getStoredIntent():e;try{const e="address"===this.activeTab&&this.isGuestMapPick?this.mapCountry:this.selectedCountry,s={type:this.activeTab,country_id:Number(e?.id)||0,country_code:e?.code||""};let r,o,n;if("address"===this.activeTab)if(this.isLoggedIn&&this.selectedSessionAddress){const e=await this.saveSessionAddressToProfile();if(!e)return Salla.notify?.error(Salla.lang.get("common.errors.error_occurred")),this.trackSelectorResult("failed",i,[]),void this.confirmBtn?.stop();s.address_id=e.id,r=e,this.selectedSessionAddress=!1,this.selectedSavedAddress=e,s.address_details=this.buildIntentAddressFromSaved(e)}else this.isLoggedIn&&this.selectedSavedAddress?(s.address_id=this.selectedSavedAddress.id,r=this.selectedSavedAddress,s.address_details=this.buildIntentAddressFromSaved(this.selectedSavedAddress)):s.address_details=this.buildIntentAddress();else s.branch_details=this.buildIntentBranch(),s.branch_id=this.selectedBranch?.id,o=this.selectedBranch||void 0;"address"===this.activeTab?this.isLoggedIn&&r?n={type:"address",address_id:String(r.id)}:this.isGuestMapPick&&s.address_details?n={type:"address",country_id:String(s.country_id),lat:s.address_details.lat,lng:s.address_details.lng}:(n={type:"address",country_id:String(this.selectedCountry?.id||0),city_id:String(this.selectedCity?.id||"")},l(this.selectedCountry?.code??"")&&(this.selectedRegion?.id&&(n.region_id=String(this.selectedRegion.id)),n.district_id=String(this.selectedDistrict?.id||""))):n={type:"branch",branch_id:String(this.selectedBranch?.id||"")};const d=await a.allocateScope(n);if(!d.success){console.error("BulletDelivery: Scope allocation failed",d.error);const e=d.error||("address"===this.activeTab?Salla.lang.get("pages.checkout.address_out_of_coverage"):Salla.lang.get("pages.checkout.failed_to_set_pickup"));return this.allocationOutOfCoverageMessage=/[.!؟?]$/.test(e.trim())?e:`${e}.`,this.trackSelectorResult("failed",i,[]),this.confirmBtn?.stop(),this.confirming=!1,void("branch"===this.activeTab&&(this.selectedBranch=null,k(),this.loadBranches()))}let h;if(d.data){const e=d.data;h=e.id;const t=e?.allocation?.type,r=e?.allocation?.branch_id;t&&Salla.api.setHeader("s-scope-allocation-type",t),r&&Salla.api.setHeader("s-scope-allocation-id",String(r));const l=Salla.config.get("store.scope",Salla.storage.get("scope"))||{};if(Salla.storage.set("scope",{...l,id:h,allocation_type:t,allocation_id:r?String(r):void 0}),h){if(!await a.setDeliveryScope(h))return this.allocationOutOfCoverageMessage=`${Salla.lang.get("common.errors.error_occurred")}.`,this.trackSelectorResult("failed",i,[],h),this.confirmBtn?.stop(),void(this.confirming=!1);k()}s.allocation_headers={"s-scope-allocation-type":t,"s-scope-allocation-id":r?String(r):void 0}}this.markShownThisSession(),this.setStoredIntent({...s,scope_allocated:!0}),this.trackSelectorResult("accepted",i,R(s),h);const c={...s,address:this.buildAllocationConfirmedAddressData(r),branch:o??null,allocation_request:n,allocation_response:d.data??null};Salla.event.dispatch("salla::bullet-delivery.allocation.confirmed",c),this.bulletDeliveryConfirmed.emit({...s,address:r,branch:o}),this.emitHeaderContextUpdate(s,r,o),t=!0,setTimeout((()=>{if(this.confirmBtn?.stop(),this.close(),this.confirming=!1,this.cartSubmitConfirmationPending)setTimeout((()=>this.resolvePendingCartSubmit()),350);else if(h){const e=Salla.storage.get("scope")||{};let t=Salla.helpers.addParamToUrl("scope",h);e.allocation_id&&(t=Salla.helpers.addParamToUrl("allocation_id",e.allocation_id,t)),e.allocation_type&&(t=Salla.helpers.addParamToUrl("allocation_type",e.allocation_type,t)),window.location.replace(t)}else window.location.reload()}),500)}finally{t||(this.confirming=!1)}}getCartViewConfig(e){if(!e||!Salla.url.is_page("cart"))return null;if(!this.isIntentMethodSupported(e))return null;const t="branch"===e.type,i="address"===e.type,s=e.branch_details?.name?.trim();return{title:t?[Salla.lang.get("pages.checkout.pickup_option"),s].filter(Boolean).join(": "):Salla.lang.get("pages.checkout.delivery_option"),subtitle:_(e,Salla.lang.get("common.elements.to"),""),buttonText:Salla.lang.get("common.elements.edit"),isAddress:i,intent:e}}createCartViewElement(){const e=this.getStoredIntent(),t=this.getCartViewConfig(e);if(!t)return null;const{title:i,subtitle:s,buttonText:r,intent:l}=t,a="branch"===l.type?{preselected_branch_id:w(l)}:{preselected_address_id:l.address_id},o=document.createElement("span");o.className="s-bullet-delivery-cart-view-icon s-bullet-delivery-tab-icon",o.setAttribute("aria-hidden","true"),o.innerHTML=N;const n=document.createElement("span");n.className="s-bullet-delivery-cart-view-title",n.textContent=i;const d=document.createElement("span");d.className="s-bullet-delivery-cart-view-subtitle",d.textContent=s;const h=document.createElement("div");h.className="s-bullet-delivery-cart-view-text",h.append(n,d);const c=document.createElement("div");c.className="s-bullet-delivery-cart-view-info",c.append(o,h);const u=document.createElement("salla-button");u.className="s-bullet-delivery-cart-view-button",u.setAttribute("fill","outline"),u.setAttribute("color","primary"),u.textContent=r,u.addEventListener("click",(()=>Salla.event.emit("salla::bullet-delivery.modal.open.requested",a)));const p=document.createElement("div");return p.className="s-bullet-delivery-cart-view",p.append(c,u),p}renderPickupTabBadge(){if(!this.pickupDiscountResolved)return null;const t=this.pickupDiscountRange;return t?e("span",{class:"s-bullet-delivery-tab-badge s-bullet-delivery-discount-badge",dir:this.isArabic?"rtl":"ltr",innerHTML:this.getPickupDiscountLabel(t.type,t.min,t.max)}):e("span",{class:"s-bullet-delivery-tab-badge"},e("span",{class:"s-bullet-delivery-tab-badge-icon",innerHTML:'<svg width="7" height="10" viewBox="0 0 7 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.41015 0.036C5.73815 0.084 5.96415 0.222 6.08815 0.45C6.21215 0.678 6.21415 0.952 6.09415 1.272C6.03815 1.432 5.89415 1.72 5.66215 2.136L5.13415 3.108C5.03015 3.308 4.96215 3.44 4.93015 3.504C4.91415 3.544 4.90215 3.576 4.89415 3.6C4.89415 3.656 4.91815 3.7 4.96615 3.732C4.99015 3.74 5.02615 3.748 5.07415 3.756H5.51815C5.79815 3.756 5.99015 3.76 6.09415 3.768C6.30215 3.784 6.45815 3.832 6.56215 3.912C6.70615 4.008 6.81215 4.138 6.88015 4.302C6.94815 4.466 6.97015 4.636 6.94615 4.812C6.93015 4.948 6.85815 5.1 6.73015 5.268C6.66615 5.356 6.53815 5.508 6.34615 5.724L3.65815 8.82C3.35415 9.172 3.14815 9.398 3.04015 9.498C2.93215 9.598 2.83415 9.664 2.74615 9.696C2.58615 9.768 2.43415 9.766 2.29015 9.69C2.14615 9.614 2.05415 9.488 2.01415 9.312C1.99815 9.208 1.99615 9.08 2.00815 8.928C2.02015 8.776 2.07415 8.472 2.17015 8.016L2.50615 6.432C2.57815 6.104 2.61815 5.888 2.62615 5.784C2.63415 5.728 2.62215 5.686 2.59015 5.658C2.55815 5.63 2.52615 5.612 2.49415 5.604C2.39815 5.588 2.18615 5.58 1.85815 5.58H1.60615C1.19815 5.58 0.918154 5.568 0.766154 5.544C0.462154 5.504 0.246154 5.38 0.118154 5.172C-0.00984615 4.964 -0.0338462 4.704 0.0461538 4.392C0.0861538 4.24 0.190154 3.968 0.358154 3.576L1.25815 1.464C1.41015 1.112 1.51815 0.872 1.58215 0.744C1.71015 0.512 1.85815 0.34 2.02615 0.228C2.19415 0.116 2.40215 0.048 2.65015 0.024C2.79415 0.008 3.05415 0 3.43015 0H4.47415C4.93815 0 5.25015 0.012 5.41015 0.036Z" fill="white"/></svg>',"aria-hidden":"true"}),Salla.lang.getWithDefault("pages.checkout.save_delivery_fees","وفّر رسوم التوصيل"))}renderTabs(){return this.supportsPickup?e("div",{class:"s-bullet-delivery-tabs"},this.isSupportsDelivery&&e("button",{type:"button",class:{"s-bullet-delivery-tab":!0,"s-bullet-delivery-tab--active":"address"===this.activeTab},onClick:()=>this.handleTabChange("address")},e("span",null,Salla.lang.get("mobile_app.strings.delivery"))),e("button",{type:"button",class:{"s-bullet-delivery-tab":!0,"s-bullet-delivery-tab--active":"branch"===this.activeTab},onClick:()=>this.handleTabChange("branch")},e("span",null,Salla.lang.get("mobile_app.strings.pickup")),this.renderPickupTabBadge())):null}renderAlert(t){return e("div",{class:"s-bullet-delivery-allocation-out-of-coverage",role:"alert"},e("span",{class:"s-bullet-delivery-allocation-out-of-coverage-icon","aria-hidden":"true"},e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true"},e("title",null,"Information"),e("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor","stroke-width":"1.5",fill:"currentColor"}),e("text",{x:"10",y:"14","text-anchor":"middle",fill:"white","font-size":"12","font-weight":"bold"},"i"))),e("span",{class:"s-bullet-delivery-allocation-out-of-coverage-text",style:{textAlign:this.isRTL?"right":"left"}},t))}renderAllocationOutOfCoverageAlert(){const t=this.allocationOutOfCoverageMessage||Salla.lang.get("pages.checkout.shipping_not_available");return this.renderAlert("address"!==this.activeTab?t:this.supportsPickup?[`${t} ${Salla.lang.getWithDefault("pages.cart.choose_another_address_pickup","Choose another address or")} `,e("button",{type:"button",class:"underline !text-blue-600",onClick:()=>this.handleTabChange("branch")},Salla.lang.getWithDefault("pages.cart.branch_pickup","pick up from a branch"))]:`${t} ${Salla.lang.getWithDefault("pages.cart.choose_another_address","Choose another address")}`)}renderCountrySelect(t=!0){return e("div",{class:"s-bullet-delivery-field"},e("salla-searchable-dropdown",{label:t?Salla.lang.get("blocks.buy_as_gift.receiver_country"):void 0,placeholder:Salla.lang.get("pages.checkout.select_country"),items:this.displayedCountries,selectedItem:this.selectedCountry,loading:this.loadingCountries,searching:this.searchingCountries,disabled:this.countries.length<=1,required:!0,inputId:"bullet-delivery-country",searchQuery:this.countrySearchQuery,clientSearch:!0,onItemSelected:e=>this.handleCountrySelected(e.detail),onSearchInput:e=>this.handleCountrySearch(e.detail),onDropdownClosed:()=>this.handleCountryDropdownClosed()}))}renderRegionSelect(){return l(this.selectedCountry?.code??"")&&this.selectedCountry?e("div",{class:"s-bullet-delivery-field"},e("salla-searchable-dropdown",{label:Salla.lang.get("pages.checkout.region_field"),placeholder:Salla.lang.get("pages.checkout.select_region"),items:this.displayedRegions,selectedItem:this.selectedRegion,loading:this.loadingRegions,searching:this.searchingRegions,disabled:this.loadingRegions||0===this.regions.length,required:!0,inputId:"bullet-delivery-region",searchQuery:this.regionSearchQuery,clientSearch:!0,onItemSelected:e=>this.handleRegionSelected(e.detail),onSearchInput:e=>this.handleRegionSearch(e.detail),onDropdownClosed:()=>this.handleRegionDropdownClosed()})):null}renderCityDistrictSelects(){const t=l(this.selectedCountry?.code??""),i=t,s=i&&this.selectedCity&&!this.loadingDistricts&&0===this.districts.length,r=!this.selectedCountry||t&&!this.selectedRegion||this.loadingCities||0===this.cities.length,a=!this.selectedCountry||t&&!this.selectedRegion||!this.selectedCity||this.loadingDistricts;return e("div",{class:"s-bullet-delivery-field-row"},e("div",{class:"s-bullet-delivery-field"},e("salla-searchable-dropdown",{label:Salla.lang.get("blocks.buy_as_gift.receiver_city"),placeholder:Salla.lang.get("pages.checkout.select_city"),items:this.displayedCities,selectedItem:this.selectedCity,loading:this.loadingCities,searching:this.searchingCities,disabled:r,required:!0,inputId:"bullet-delivery-city",searchQuery:this.citySearchQuery,onItemSelected:e=>this.handleCitySelected(e.detail),onSearchInput:e=>this.handleCitySearch(e.detail),onDropdownClosed:()=>this.handleCityDropdownClosed(),dropUp:!0})),i&&e("div",{class:"s-bullet-delivery-field"},s?e("div",null,e("label",{class:"s-bullet-delivery-label",htmlFor:"bullet-delivery-district"},Salla.lang.get("pages.checkout.district_field"),e("span",{class:"text-red-500"}," *")),e("input",{id:"bullet-delivery-district",type:"text",class:"form-input",placeholder:Salla.lang.get("pages.checkout.select_district"),value:this.districtName,disabled:a,onInput:e=>{this.districtName=e.target.value,this.updateNewAddressForm({district:void 0})}})):e("salla-searchable-dropdown",{label:Salla.lang.get("pages.checkout.district_field"),placeholder:Salla.lang.get("pages.checkout.select_district"),items:this.displayedDistricts,selectedItem:this.selectedDistrict,loading:this.loadingDistricts,searching:this.searchingDistricts,disabled:a||0===this.districts.length,required:!0,inputId:"bullet-delivery-district",searchQuery:this.districtSearchQuery,clientSearch:!0,onItemSelected:e=>this.handleDistrictSelected(e.detail),onSearchInput:e=>this.handleDistrictSearch(e.detail),onDropdownClosed:()=>this.handleDistrictDropdownClosed(),dropUp:!0})))}renderSavedAddressesEmptyState(){return e("div",{class:"s-bullet-delivery-saved-addresses-empty"},e("div",{class:"s-bullet-delivery-saved-addresses-empty-icon","aria-hidden":"true"},e("svg",{width:"28",height:"28",viewBox:"0 0 28 29",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("title",null,"No Saved Adresses"),e("path",{d:"M20.16 0C21.4613 0 22.6773 0.341333 23.808 1.024C24.9387 1.70667 25.8347 2.61333 26.496 3.744C27.1787 4.91733 27.52 6.18667 27.52 7.552C27.52 9.45067 26.8267 11.232 25.44 12.896C24.4587 14.0907 23.0827 15.2427 21.312 16.352H21.28C20.9387 16.5653 20.5653 16.672 20.16 16.672C19.7547 16.672 19.3813 16.5653 19.04 16.352H19.008C17.2373 15.2213 15.8613 14.0693 14.88 12.896C13.4933 11.232 12.8 9.45067 12.8 7.552C12.8 6.18667 13.1413 4.91733 13.824 3.744C14.4853 2.61333 15.3813 1.70667 16.512 1.024C17.6427 0.341333 18.8587 0 20.16 0ZM11.488 1.984C9.67467 2.368 8.04267 3.14667 6.592 4.32C5.14133 5.49333 4.01067 6.92267 3.2 8.608C2.34667 10.3573 1.92 12.224 1.92 14.208C1.92 14.72 1.952 15.2427 2.016 15.776L2.08 15.744C2.57067 15.488 2.94933 15.3067 3.216 15.2C3.48267 15.0933 3.73867 15.0933 3.984 15.2C4.22933 15.3067 4.4 15.488 4.496 15.744C4.592 16 4.58667 16.256 4.48 16.512C4.37333 16.768 4.19733 16.9493 3.952 17.056C3.70667 17.1627 3.36 17.3227 2.912 17.536L2.656 17.664C2.57067 17.7067 2.48533 17.7387 2.4 17.76C2.89067 19.4667 3.70133 20.9973 4.832 22.352C5.96267 23.7067 7.296 24.7573 8.832 25.504C10.432 26.272 12.1173 26.656 13.888 26.656C15.4667 26.656 16.9813 26.3467 18.432 25.728C19.8187 25.1307 21.0667 24.288 22.176 23.2C21.92 23.0507 21.7653 22.8373 21.712 22.56C21.6587 22.2827 21.7013 22.0267 21.84 21.792C21.9787 21.5573 22.176 21.408 22.432 21.344C22.8373 21.2587 23.2 21.12 23.52 20.928C23.6907 20.8427 23.8613 20.8 24.032 20.8C24.8 19.5413 25.3333 18.176 25.632 16.704C25.6747 16.4267 25.808 16.2133 26.032 16.064C26.256 15.9147 26.496 15.8667 26.752 15.92C27.008 15.9733 27.2107 16.1173 27.36 16.352C27.5093 16.5867 27.552 16.832 27.488 17.088C27.0613 19.2853 26.1973 21.264 24.896 23.024C23.5947 24.784 22.0053 26.1547 20.128 27.136C18.1653 28.16 16.0853 28.672 13.888 28.672C11.3707 28.672 9.03467 28.0107 6.88 26.688C4.78933 25.408 3.12533 23.68 1.888 21.504C0.629333 19.264 0 16.832 0 14.208C0 11.904 0.490667 9.73867 1.472 7.712C2.41067 5.74933 3.728 4.09067 5.424 2.736C7.12 1.38133 9.01333 0.48 11.104 0.032C11.36 -0.032 11.6 0.0106667 11.824 0.16C12.048 0.309333 12.1867 0.522667 12.24 0.8C12.2933 1.07733 12.2453 1.328 12.096 1.552C11.9467 1.776 11.744 1.92 11.488 1.984ZM14.72 7.552C14.72 8.96 15.2533 10.304 16.32 11.584C17.1733 12.5867 18.3893 13.6 19.968 14.624C20.032 14.6453 20.096 14.656 20.16 14.656C20.224 14.656 20.288 14.6453 20.352 14.624C21.9307 13.6213 23.1467 12.608 24 11.584C25.0667 10.304 25.6 8.96 25.6 7.552C25.6 6.57067 25.3547 5.65333 24.864 4.8C24.3733 3.94667 23.7067 3.26933 22.864 2.768C22.0213 2.26667 21.12 2.016 20.16 2.016C19.2 2.016 18.2987 2.26667 17.456 2.768C16.6133 3.26933 15.9467 3.94667 15.456 4.8C14.9653 5.65333 14.72 6.57067 14.72 7.552ZM17.28 7.68C17.28 6.848 17.5627 6.13867 18.128 5.552C18.6933 4.96533 19.3707 4.672 20.16 4.672C20.9493 4.672 21.6267 4.96533 22.192 5.552C22.7573 6.13867 23.04 6.848 23.04 7.68C23.04 8.512 22.7573 9.216 22.192 9.792C21.6267 10.368 20.9493 10.656 20.16 10.656C19.3707 10.656 18.6933 10.368 18.128 9.792C17.5627 9.216 17.28 8.512 17.28 7.68ZM6.752 14.688C7.62667 14.7733 8.53333 15.0293 9.472 15.456C9.70667 15.5627 9.87733 15.744 9.984 16C10.0907 16.256 10.0907 16.512 9.984 16.768C9.87733 17.024 9.70133 17.2 9.456 17.296C9.21067 17.392 8.97067 17.3867 8.736 17.28C7.94667 16.9387 7.22133 16.736 6.56 16.672C6.28267 16.6293 6.064 16.5013 5.904 16.288C5.744 16.0747 5.68 15.8293 5.712 15.552C5.744 15.2747 5.86133 15.0507 6.064 14.88C6.26667 14.7093 6.496 14.6453 6.752 14.688ZM17.6 20.544C18.304 20.864 18.976 21.0987 19.616 21.248C19.872 21.312 20.0693 21.4613 20.208 21.696C20.3467 21.9307 20.3893 22.1813 20.336 22.448C20.2827 22.7147 20.144 22.9227 19.92 23.072C19.696 23.2213 19.4453 23.264 19.168 23.2C18.4213 23.0293 17.632 22.752 16.8 22.368C16.5653 22.2613 16.4 22.08 16.304 21.824C16.208 21.568 16.2133 21.312 16.32 21.056C16.4267 20.8 16.6027 20.624 16.848 20.528C17.0933 20.432 17.344 20.4373 17.6 20.544ZM12.832 17.44C13.0027 17.568 13.248 17.7493 13.568 17.984L14.496 18.688C14.7093 18.8587 14.8373 19.0773 14.88 19.344C14.9227 19.6107 14.8693 19.856 14.72 20.08C14.5707 20.304 14.368 20.4427 14.112 20.496C13.856 20.5493 13.6107 20.5013 13.376 20.352L11.744 19.072C11.5307 18.9227 11.4027 18.7093 11.36 18.432C11.3173 18.1547 11.3707 17.904 11.52 17.68C11.6693 17.456 11.872 17.3227 12.128 17.28C12.384 17.2373 12.6187 17.2907 12.832 17.44ZM20.16 8.672C20.416 8.672 20.64 8.576 20.832 8.384C21.024 8.192 21.12 7.95733 21.12 7.68C21.12 7.40267 21.024 7.16267 20.832 6.96C20.64 6.75733 20.416 6.656 20.16 6.656C19.904 6.656 19.68 6.75733 19.488 6.96C19.296 7.16267 19.2 7.40267 19.2 7.68C19.2 7.95733 19.296 8.192 19.488 8.384C19.68 8.576 19.904 8.672 20.16 8.672Z",fill:"#666666"}))),e("p",{class:"s-bullet-delivery-saved-addresses-empty-title"},Salla.lang.get("pages.checkout.no_saved_addresses")),e("p",{class:"s-bullet-delivery-saved-addresses-empty-desc"},Salla.lang.get("pages.checkout.add_address_simplify_shipping")),e("salla-button",{onClick:()=>this.handleAddNewAddress(),onKeyUp:()=>this.handleAddNewAddress()},Salla.lang.get("pages.checkout.add_new_address")))}async saveSessionAddressToProfile(){const e=this.getStoredIntent();if(S(e)){const t=e.address_details,i={lat:t.lat,lng:t.lng,...t.place_id&&{short_address:t.place_id},...t.description&&{description:t.description}};try{const{success:t,address:s}=await a.saveAddressLocation(i);return t&&s?(this.setStoredIntent({...e,address_id:s.id,scope_allocated:!1}),this.addressCreated.emit({address:s}),s):null}catch(e){return console.error("SallaBulletDelivery: Error saving session address (map)",e),null}}const t=c(e),i=h(e),s=p(e);if(!e||"address"!==e.type||!t||!i)return null;const r=H(e);if(l(r)&&!s)return null;const o=l(r),n=e.address_details?.district?.name??"",d={country_id:t,region_id:u(e),city_id:i,district_id:s,description:n};o&&(d.local=n);try{const{success:t,address:i}=await a.saveAddressLocation(d);if(!t)return null;const s=i??null;return s&&(this.setStoredIntent({...e,address_id:s.id,scope_allocated:!1}),this.addressCreated.emit({address:s})),s}catch(e){return console.error("SallaBulletDelivery: Error saving session address",e),null}}renderSavedAddresses(){if(!this.isLoggedIn)return null;if(this.loadingSavedAddresses)return e("div",{class:"s-bullet-delivery-addresses-list s-scrollbar"},[1,2,3].map((t=>e("div",{key:t,class:"s-bullet-delivery-address-item s-bullet-delivery-address-item--skeleton"},e("salla-skeleton",{class:"s-bullet-delivery-skel-radio",height:"18px",width:"18px"}),e("salla-skeleton",{class:"s-bullet-delivery-skel-map",height:"36px",width:"36px"}),e("div",{class:"s-bullet-delivery-address-content"},e("div",{class:"s-bullet-delivery-address-lines"},e("salla-skeleton",{height:"18px",width:"72%"}),e("salla-skeleton",{height:"16px",width:"56%"})))))));const t=this.getStoredIntent(),i=d(t),s=S(t),r=i&&t?.address_details?s?t.address_details.formatted_address??"":[t.address_details.city?.name,t.address_details.country?.name].filter(Boolean).join("، ")||"":"",l=i&&t?.address_details&&!s?(t.address_details.district?.name??"").trim():"";return 0!==this.savedAddresses.length||i?e("div",{class:"s-bullet-delivery-addresses-list s-scrollbar"},i&&this.renderAddressRow({key:"session-address",line1:r,line2:l,selected:this.selectedSessionAddress,onClick:()=>this.handleSessionAddressSelect()}),this.savedAddresses.map((e=>{const t=[e.building_number,e.street].filter(Boolean).join("، ")||e.formatted?.address_one||e.short_address||"",i=[e.district?.name,e.city?.name,e.country?.name].filter(Boolean).join("، "),s=(e.formatted?.address_two||i)??"",r=!1!==e.is_in_coverage;return this.renderAddressRow({key:String(e.id),line1:t,line2:s,selected:this.selectedSavedAddress?.id===e.id,disabled:!r,onClick:()=>r&&this.handleSavedAddressSelect(e)})}))):this.renderSavedAddressesEmptyState()}renderAddressRow(t){const{key:i,line1:s,line2:r,selected:l,disabled:a=!1,onClick:o}=t;return e("button",{key:i,class:{"s-bullet-delivery-address-item":!0,"s-bullet-delivery-address-item--selected":l,"s-bullet-delivery-address-item--disabled":a},type:"button",onClick:a?void 0:o,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),a||o())}},e("input",{type:"radio",name:"saved_address",class:"s-bullet-delivery-radio",checked:l,disabled:a}),e("span",{class:"s-bullet-delivery-address-map-icon",innerHTML:Q,"aria-hidden":"true"}),e("div",{class:"s-bullet-delivery-address-content"},e("div",{class:"s-bullet-delivery-address-lines"},e("span",{class:"s-bullet-delivery-address-line1",style:{textAlign:this.isRTL?"right":"left"}},s),e("span",{class:"s-bullet-delivery-address-line2",style:{textAlign:this.isRTL?"right":"left"}},r))))}renderMapSection(){const t=l(this.selectedCountry?.code??""),i=this.mapLocationData,s=null!=i?.lat&&null!=i?.lng,r=s?{lat:i.lat,lng:i.lng}:this.mapInitialCenter;return e("div",{class:"s-bullet-delivery-map-container"},e("gmap-map",{ref:e=>this.gmapRef=e,center:r,zoom:16,"min-zoom":4,"max-zoom":21,"map-id":"DEMO_MAP_ID","enable-autocomplete":!0,"enable-geolocation":!0,"show-location-marker":!0,"location-marker-position":s?{lat:i.lat,lng:i.lng,accuracy:50}:{...r,accuracy:50},language:Salla.lang.getLocale?.()??document.documentElement.lang??"ar","geolocation-button-label":Salla.lang.get("pages.checkout.current_location"),"autocomplete-placeholder":Salla.lang.get("pages.checkout.search_for_address"),"autocomplete-hint":t?Salla.lang.get("pages.checkout.short_address_format_validation"):void 0,"autocomplete-country":this.selectedCountry?.code?.toLowerCase(),"autocomplete-resolve":!1,"autocomplete-auth-token":this.addressToken,"location-marker-background":"#4285F4","location-marker-border-color":"#1967D2","location-marker-glyph-color":"#FFFFFF","location-marker-scale":1.3,"onGmap-location-changed":this.handleMapLocationChanged,"onGmap-ready":this.handleMapReady}))}renderAddressConfirmation(){const t=this.mapLocationData?.formattedAddress??"";return e("div",{class:"s-bullet-delivery-address-confirm"},e("div",{class:"s-bullet-delivery-address-confirm-card"},e("span",{class:"s-bullet-delivery-address-map-icon",innerHTML:Q,"aria-hidden":"true"}),e("div",{class:"s-bullet-delivery-address-confirm-details"},e("span",{class:"s-bullet-delivery-address-confirm-label"},Salla.lang.get("pages.checkout.selected_address")),e("p",{class:"s-bullet-delivery-address-confirm-text"},t))),e("div",{class:"s-bullet-delivery-address-confirm-description"},e("label",{class:"s-bullet-delivery-address-confirm-description-label"},Salla.lang.get("pages.checkout.address_description"),e("span",{class:"s-bullet-delivery-address-confirm-description-optional"},Salla.lang.get("common.elements.optional"))),e("input",{type:"text",class:"s-bullet-delivery-address-confirm-description-input form-input",placeholder:Salla.lang.get("pages.checkout.address_description_placeholder"),value:this.addressDescription,onInput:e=>{this.addressDescription=e.target.value}})))}renderLocationPermissionNotice(){return U(this.locationPermission)?e(K,{isRTL:this.isRTL,onActivate:this.handleLocationPermissionRequest}):null}renderLocationDistanceWarning(){const t=this.mapLocationData;if("granted"!==this.locationPermission||!this.liveLocation||null==t?.lat||null==t?.lng)return null;const i=function(e,t){const i=W(t.lat-e.lat),s=W(t.lng-e.lng),r=W(e.lat),l=W(t.lat),a=Math.sin(i/2)**2+Math.cos(r)*Math.cos(l)*Math.sin(s/2)**2;return 12742*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}(this.liveLocation,{lat:t.lat,lng:t.lng});return i<=.5?null:e(Y,{distanceKm:i,isRTL:this.isRTL})}renderGuestDeliveryForm(){if(this.isMapModeAvailable)return[this.renderMapSection(),this.renderLocationPermissionNotice(),this.renderLocationDistanceWarning(),this.hasMapLocation()?this.renderAddressConfirmation():null,this.renderMapCountryNotice()];const e=l(this.selectedCountry?.code??"");return[this.renderCountrySelect(),e?this.renderRegionSelect():null,this.renderCityDistrictSelects()]}renderDeliveryTab(){return e("div",{class:{"s-bullet-delivery-content":!0,"s-bullet-delivery-content--active":"address"===this.activeTab,"s-hidden":"address"!==this.activeTab}},this.isLoggedIn?this.renderSavedAddresses():this.renderGuestDeliveryContent())}renderGuestDeliveryContent(){if(!this.isMapModeAvailable)return this.renderGuestDeliveryForm();const t=this.canConfirmMapLocation()&&!this.isGuestMapCountryBlocked(),i=this.confirming?Salla.lang.get("pages.checkout.loading"):Salla.lang.get("pages.checkout.confirm_address");return e("form",{onSubmit:e=>{e.preventDefault(),this.handleConfirm()}},this.renderGuestDeliveryForm(),e("div",{class:"s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single",style:{padding:"24px"}},e("salla-button",{type:"submit",loading:this.confirming,disabled:!t||this.confirming,width:"wide"},i),!this.isLoggedIn&&e("button",{type:"button",class:"s-bullet-delivery-login-prompt",onClick:()=>this.handleLogin()},Salla.lang.get("pages.checkout.login_to_use_saved_addresses"))))}renderBranchSearch(){return e("div",{class:"s-bullet-delivery-branch-search"},e("div",{class:"s-bullet-delivery-search-row"},e("div",{class:"s-bullet-delivery-search s-bullet-delivery-branch-search-wrap"},e("span",{class:"s-bullet-delivery-search-icon s-bullet-delivery-branch-search-icon",innerHTML:q,"aria-hidden":"true"}),e("input",{type:"text",class:"s-bullet-delivery-branch-search-input form-input",placeholder:Salla.lang.getWithDefault("pages.checkout.search_for_country_city_or_branch",this.isArabic?"ابحث عن دولة أو مدينة أو فرع":"Search for a country, city or branch"),value:this.branchSearchQuery,onInput:e=>this.handleBranchSearch(e),autocomplete:"off"})),e("button",{type:"button",class:{"s-bullet-delivery-location-btn":!0,"s-bullet-delivery-location-btn--full":!0,"s-bullet-delivery-location-btn--loading":this.loadingNearestBranch},onClick:()=>this.handleFindNearestBranch(),disabled:this.loadingNearestBranch,"aria-label":Salla.lang.get("pages.checkout.nearest_to_my_location")},this.loadingNearestBranch?e("span",{class:"s-bullet-delivery-location-icon","aria-hidden":"true"},e("salla-skeleton",{height:"16px",width:"16px"})):e("span",{class:"s-bullet-delivery-location-icon",innerHTML:N,"aria-hidden":"true"}),e("span",{class:"s-bullet-delivery-location-label"},Salla.lang.get("pages.checkout.nearest_to_my_location")))),this.locationError&&"branch"===this.activeTab&&e("span",{class:"s-bullet-delivery-error"},this.locationError))}renderBranchList(){if(this.loadingBranches)return e("div",{class:"s-bullet-delivery-branches-wrap"},e("div",{class:"s-bullet-delivery-branches-loading"},[1,2,3,4].map((t=>e("div",{key:t,class:"s-bullet-delivery-branch-skeleton"},e("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-radio",type:"circle",height:"16px",width:"16px"}),e("div",{class:"s-bullet-delivery-branch-skeleton-icon"},e("salla-skeleton",{height:"34px",width:"34px"})),e("div",{class:"s-bullet-delivery-branch-skeleton-content"},e("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-title",height:"12px",width:"124px"})),e("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-time",height:"12px",width:"88px"}),e("div",{class:"s-bullet-delivery-branch-skeleton-map"},e("salla-skeleton",{height:"32px",width:"32px"})))))));const t=this.filteredBranches.filter(C);return 0===t.length?e("salla-placeholder",{alignment:"center",class:"s-bullet-delivery-placeholder"},e("span",{slot:"title"},Salla.lang.get("pages.checkout.no_pickup_branches_found"))):e("div",{class:"s-bullet-delivery-branches-wrap"},e("ul",{class:"s-bullet-delivery-branches-list s-scrollbar",role:"listbox"},t.map((t=>{const i=g(t),s=this.selectedBranch?.id===t.id,r=[t.country?.name,t.city?.name,t.district?.name].filter(Boolean).join("، "),l=T(t.distance_km),a=z(t)??this.getReadyTodayLabel(t),o=a?null:this.getPreparationShortLabel(t.preparation_time_range),n=M(L(t)),d=n.length>0&&!$(t),h=d&&this.expandedScheduleBranchId===t.id,c=I(t),u=A(t),p=D(t),b=B(t);return e("li",{key:t.id,class:{"s-bullet-delivery-branch-item":!0,"s-bullet-delivery-branch-item--selected":s,"s-bullet-delivery-branch-item--disabled":!i},tabIndex:i?0:-1,role:"option","aria-selected":s,"aria-disabled":!i,onClick:()=>i&&this.handleBranchSelect(t),onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),i&&this.handleBranchSelect(t)))}},e("input",{type:"radio",name:"branch",class:"s-bullet-delivery-radio s-bullet-delivery-branch-radio",checked:s,disabled:!i,tabIndex:-1}),e("div",{class:"s-bullet-delivery-branch-body"},e("p",{class:"s-bullet-delivery-branch-name"},e("span",null,t.name),b?e("span",{class:"s-bullet-delivery-discount-badge",dir:this.isArabic?"rtl":"ltr",innerHTML:this.getPickupDiscountLabel(b.type,b.amount)}):null),r?e("span",{class:"s-bullet-delivery-branch-meta s-bullet-delivery-branch-location"},e("span",{class:"s-bullet-delivery-branch-meta-icon",innerHTML:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="8.00016" cy="4.66667" r="2.66667" stroke="#555555" stroke-width="1.125"/><path d="M8 7.33337L8 12" stroke="#555555" stroke-width="1.125" stroke-linecap="round"/><path d="M11.3332 12.6666C11.3332 13.403 9.84079 14 7.99984 14C6.15889 14 4.6665 13.403 4.6665 12.6666" stroke="#555555" stroke-width="1.125" stroke-linecap="round"/></svg>',"aria-hidden":"true"}),e("span",null,r)):null,s&&t.pickup_instructions?e("span",{class:"s-bullet-delivery-branch-meta s-bullet-delivery-branch-instructions"},e("span",{class:"s-bullet-delivery-branch-meta-icon",innerHTML:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.58709 4.67775L11.769 5.52554M7.90501 7.20895L9.49598 7.63284M7.98415 11.9777L8.62054 12.1472C10.4205 12.6268 11.3205 12.8666 12.0295 12.4595C12.7385 12.0525 12.9797 11.1576 13.462 9.36777L14.1441 6.83657C14.6264 5.04674 14.8675 4.15183 14.4582 3.44681C14.0488 2.7418 13.1488 2.50201 11.3489 2.02242L10.7125 1.85287C8.91249 1.37328 8.0125 1.13349 7.30349 1.54053C6.59447 1.94757 6.35332 2.84249 5.87102 4.63231L5.18894 7.16351C4.70664 8.95334 4.46549 9.84825 4.87484 10.5533C5.28419 11.2583 6.18418 11.4981 7.98415 11.9777Z" stroke="#555555" stroke-width="1.125" stroke-linecap="round"/><path d="M8.00016 13.964L7.36527 14.1369C5.56952 14.6259 4.67164 14.8704 3.96429 14.4554C3.25694 14.0404 3.01636 13.1279 2.53519 11.303L1.85471 8.72211C1.37354 6.89717 1.13295 5.98471 1.54134 5.26586C1.89461 4.64404 2.66683 4.66668 3.66683 4.66661" stroke="#555555" stroke-width="1.125" stroke-linecap="round"/></svg>',"aria-hidden":"true"}),e("span",null,t.pickup_instructions)):null,e("div",{class:"s-bullet-delivery-branch-meta-row"},l||a||o?e("div",{class:"s-bullet-delivery-branch-pills"},l?e("span",{class:"s-bullet-delivery-branch-meta s-bullet-delivery-branch-pill s-bullet-delivery-branch-distance"},e("i",{class:"sicon-location"}),e("span",null,this.renderDistanceLabel(l))):null,a?e("span",{class:"s-bullet-delivery-branch-meta s-bullet-delivery-branch-pill s-bullet-delivery-branch-prep"},e("span",{class:"s-bullet-delivery-branch-meta-icon",innerHTML:X,"aria-hidden":"true"}),e("span",{class:"s-bullet-delivery-branch-meta-value"},a)):o?e("span",{class:"s-bullet-delivery-branch-meta s-bullet-delivery-branch-pill s-bullet-delivery-branch-prep"},e("span",{class:"s-bullet-delivery-branch-meta-icon",innerHTML:X,"aria-hidden":"true"}),e("span",null,e("span",{class:"s-bullet-delivery-branch-meta-label"},Salla.lang.getWithDefault("pages.checkout.pickup_branch_ready_in","Pickup available after:")," "),e("span",{class:"s-bullet-delivery-branch-meta-value"},o))):null):null,e("hr",{class:"s-bullet-delivery-branch-divider"}),this.renderBranchOpenStatus(t,d,h)),h&&e("div",{class:"s-bullet-delivery-branch-schedule"},n.map(((t,i)=>e("div",{key:i,class:"s-bullet-delivery-branch-schedule-day"},e("span",{class:"s-bullet-delivery-branch-schedule-days"},t.days.length>1?`${t.days[0]} - ${t.days[t.days.length-1]}`:t.days[0]),e("span",{class:"s-bullet-delivery-branch-schedule-times"},t.times.map((e=>`${this.formatClock(e.start)} - ${this.formatClock(e.end)}`)).join(this.isArabic?"، ":", "))))))),e("div",{class:"s-bullet-delivery-branch-actions"},c&&e("a",{href:c,class:"s-bullet-delivery-branch-action",title:Salla.lang.getWithDefault("pages.checkout.branch_call","اتصال"),onClick:e=>e.stopPropagation()},e("i",{class:"sicon-phone"})),u&&e("a",{href:u,target:"_blank",rel:"noopener noreferrer",class:"s-bullet-delivery-branch-action",title:Salla.lang.getWithDefault("pages.checkout.branch_whatsapp","واتساب"),onClick:e=>e.stopPropagation()},e("i",{class:"sicon-whatsapp2"})),p&&e("a",{href:p,target:"_blank",rel:"noopener noreferrer",class:"s-bullet-delivery-branch-action s-bullet-delivery-branch-map-link",title:Salla.lang.get("common.elements.open_in_google_maps"),onClick:e=>e.stopPropagation()},e("span",{class:"s-bullet-delivery-branch-map-link-icon",innerHTML:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M7.94798 3.19336C11.1309 2.1083 12.7223 1.56578 13.5783 2.42174C14.4342 3.27771 13.8917 4.86914 12.8066 8.05201L12.0678 10.2195C11.2344 12.6639 10.8178 13.8861 10.131 13.9872C9.94631 14.0144 9.75517 13.9981 9.57248 13.9394C8.89297 13.7212 8.53377 12.4326 7.81538 9.8553C7.65604 9.28364 7.57637 8.99781 7.39494 8.7795C7.34228 8.71614 7.28386 8.65772 7.2205 8.60506C7.00219 8.42363 6.71636 8.34396 6.1447 8.18462C3.56741 7.46623 2.27876 7.10703 2.0606 6.42752C2.00195 6.24483 1.98558 6.05369 2.01277 5.86903C2.11392 5.18221 3.33613 4.76556 5.78054 3.93225L7.94798 3.19336Z"\n stroke="#555555" stroke-width="1.2" />\n</svg>\n '.replace(/mask0_25437_34440/g,`mask0_branch_${t.id}`),"aria-hidden":"true"}),e("span",{class:"sr-only"},Salla.lang.get("common.elements.open_in_google_maps")))))}))))}renderDistanceLabel(t){const i=Salla.lang.getWithDefault("pages.checkout.branch_distance_from_you","يبعد عنك: ~ {distance} كم"),s=i.indexOf("{distance}");return-1===s?i:[e("span",{class:"s-bullet-delivery-branch-meta-label"},i.slice(0,s)),e("span",{class:"s-bullet-delivery-branch-meta-value"},i.slice(s).replace("{distance}",t))]}get isArabic(){return"ar"===(Salla.lang.getLocale?.()??document.documentElement.lang)}formatClock(e){return P(e,this.isArabic?"ar":"en")}getReadyTodayLabel(e){const t=F(e);return t?`${Salla.lang.getWithDefault("pages.checkout.pickup_branch_ready_today_at","جاهز اليوم")} ${this.formatClock(t)}`:null}getPreparationShortLabel(e){if(!e?.from||!e?.to)return null;const t={minute:["pages.checkout.preparation_time_minute_short","د"],hour:["pages.checkout.preparation_time_hour_short","س"],day:["pages.checkout.preparation_time_day_short","يوم"]},i=e=>t[e]?Salla.lang.getWithDefault(t[e][0],t[e][1]):null,s=i(e.from.unit),r=i(e.to.unit);return s&&r?e.from.unit===e.to.unit?`${e.from.value}-${e.to.value} ${r}`:`${e.from.value} ${s} - ${e.to.value} ${r}`:null}renderBranchOpenStatus(t,i,s){const r=i&&e("button",{type:"button",class:"s-bullet-delivery-branch-schedule-toggle","aria-expanded":s?"true":"false","aria-label":Salla.lang.getWithDefault("pages.checkout.pickup_show_weekly_hours","عرض ساعات العمل الأسبوعية"),onClick:e=>{e.stopPropagation(),this.toggleBranchSchedule(t.id)}},e("i",{class:{"sicon-keyboard_arrow_down":!0,"is-expanded":s}}));if(j(t))return e("span",{class:"s-bullet-delivery-branch-meta s-bullet-delivery-branch-open-status"},e("span",{class:"s-bullet-delivery-branch-meta-icon",innerHTML:J,"aria-hidden":"true"}),e("span",{class:"s-bullet-delivery-pickup-status--busy"},Salla.lang.getWithDefault("pages.checkout.pickup_branch_busy","مشغول، لا يستقبل طلبات")),r);const l=$(t),a=t.pickup_readiness?.open_status_line;if(!l&&a)return e("span",{class:"s-bullet-delivery-branch-meta s-bullet-delivery-branch-open-status"},e("span",{class:"s-bullet-delivery-branch-meta-icon",innerHTML:J,"aria-hidden":"true"}),e("span",null,a),r);if(!l&&!i)return null;if(!l&&"boolean"!=typeof t.is_open)return e("span",{class:"s-bullet-delivery-branch-meta s-bullet-delivery-branch-open-status"},r);const o=l||t.is_open,n=l?Salla.lang.getWithDefault("pages.checkout.pickup_branch_always_open","مفتوح دائمًا 24/7"):o?Salla.lang.getWithDefault("pages.checkout.pickup_branch_open","مفتوح"):Salla.lang.getWithDefault("pages.checkout.pickup_branch_closed","مغلق");return e("span",{class:"s-bullet-delivery-branch-meta s-bullet-delivery-branch-open-status"},e("span",{class:"s-bullet-delivery-branch-meta-icon",innerHTML:J,"aria-hidden":"true"}),e("span",{class:o?"s-bullet-delivery-pickup-status--open":"s-bullet-delivery-pickup-status--closed"},n),r)}renderPickupTab(){return e("div",{class:{"s-bullet-delivery-content":!0,"s-bullet-delivery-content--active":"branch"===this.activeTab,"s-hidden":"branch"!==this.activeTab}},e("div",{class:"s-bullet-delivery-pickup-filters"},e("div",{class:"s-bullet-delivery-pickup-filters-row"},this.renderCountrySelect(!1),this.renderBranchCitySelect()),this.renderBranchSearch()),this.renderBranchList())}renderBranchCitySelect(){return e("div",{class:"s-bullet-delivery-field"},e("salla-searchable-dropdown",{placeholder:Salla.lang.get("pages.checkout.select_city"),items:[{id:-1,name:Salla.lang.getWithDefault("pages.checkout.all_cities",this.isArabic?"كل المدن":"All cities")},...this.branchCities],selectedItem:this.selectedBranchCity,loading:this.loadingBranches&&0===this.branchCities.length,disabled:0===this.branchCities.length&&!this.selectedBranchCity,inputId:"bullet-delivery-branch-city",searchQuery:this.branchCitySearchQuery,clientSearch:!0,onItemSelected:e=>{this.branchCitySearchQuery="",this.handleBranchCitySelected(e.detail)},onSearchInput:e=>{this.branchCitySearchQuery=e.detail},onDropdownClosed:()=>{this.branchCitySearchQuery=""}}))}renderAddAddressForm(){const t=this.isMapModeAvailable,i=l(this.selectedCountry?.code??""),s=this.hasMapLocation();let r,a;if(t)r=this.canConfirmMapLocation(),a=this.confirming?Salla.lang.get("pages.checkout.loading"):Salla.lang.get("pages.checkout.confirm_address");else{const e=this.selectedCountry&&this.selectedCity&&(!i||this.selectedRegion)&&(!i||!!this.selectedDistrict||!!(this.districtName&&this.districtName.trim().length>0));r=s||e,a=this.confirming?Salla.lang.get("pages.checkout.loading"):Salla.lang.get("pages.checkout.confirm_address")}return e("div",{class:"s-bullet-delivery-add-address"},this.allocationOutOfCoverageMessage&&this.renderAllocationOutOfCoverageAlert(),e("form",{class:"s-bullet-delivery-add-address-form",onSubmit:e=>{e.preventDefault(),this.handleSubmitNewAddress(e)}},this.renderGuestDeliveryForm(),e("div",{class:"s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single"},e("salla-button",{type:"submit",loading:this.confirming,disabled:!r||this.confirming,class:"s-bullet-delivery-add-address-submit"},a),this.hasAddressesToGoBack()&&e("salla-button",{shape:"link",class:"s-bullet-delivery-back-to-list-link",onClick:()=>this.handleBackToAddressList()},Salla.lang.getWithDefault("pages.checkout.saved_addresses","العناوين المحفوظة"),e("i",{class:"sicon-arrow-left"})))))}renderFooter(){if("address"===this.activeTab&&!this.isLoggedIn&&this.isMapModeAvailable)return null;const t="address"===this.activeTab&&this.isLoggedIn;return e("div",{class:"s-bullet-delivery-footer"},e("salla-button",{ref:e=>{this.confirmBtn=e},disabled:this.isConfirmDisabled(),onClick:()=>this.handleConfirm(),"loader-position":"center",width:"wide"},"branch"===this.activeTab?Salla.lang.getWithDefault("pages.checkout.confirm_receipt_from_the_branch","تأكيد الإستلام من الفرع"):Salla.lang.get("pages.checkout.confirm_address")),t&&e("salla-button",{onClick:()=>this.handleAddNewAddress(),width:"wide",shape:"link"},Salla.lang.get("pages.checkout.add_new_address")),!this.isLoggedIn&&e("salla-button",{shape:"link",onClick:()=>this.handleLogin()},Salla.lang.get("pages.checkout.login_to_use_saved_addresses")))}renderMainView(){const t=this.isLoggedIn&&"address"===this.activeTab&&0===this.savedAddresses.length&&!d(this.getStoredIntent()),i="branch"===this.activeTab&&this.supportsPickup?this.renderPickupTab():this.renderDeliveryTab();return e("div",null,this.showCartWillBeClearedBanner&&this.renderAlert(Salla.lang.get("blocks.scope.empty_cart_warning")),this.allocationOutOfCoverageMessage&&this.renderAllocationOutOfCoverageAlert(),i,!t&&this.renderFooter())}handleAfterAddToCart(){if("after_add_to_cart"!==this.openingType)return;const e=this.shouldPromptIncompleteIntentThisSession();this.hasBeenShownThisSession()&&!e||this.modal?.hasAttribute?.("visible")||(e&&this.markIncompleteIntentPrompted(),this.open(!1,e?"incomplete_intent":"after_add_to_cart"))}overrideScopeSwitchUI(){const e=this.getStoredIntent(),t=document.querySelector('[onclick*="scopes"]');if(!t)return;const i=(e,t)=>e&&e.length>t?`${e.slice(0,t)}...`:e??"",s=e?"branch"===e.type?`${Salla.lang.get("mobile_app.strings.pickup")} ${Salla.lang.get("common.elements.from")} ${i(e.branch_details?.name,20)}`:`${Salla.lang.get("mobile_app.strings.delivery")} ${Salla.lang.get("common.elements.to")} ${i(e.address_details?.city?.name||(S(e)?e.address_details.formatted_address:void 0),10)}`:(()=>this.supportsPickup&&this.isSupportsDelivery?Salla.lang.getWithDefault("mobile_app.strings.pickup_or_delivery","Pick-up or delivery"):this.supportsPickup?Salla.lang.getWithDefault("mobile_app.strings.pickup_from_branch","Pick up from branch"):this.isSupportsDelivery?Salla.lang.getWithDefault("mobile_app.strings.delivery","Delivery"):null)();t.style.display="inline-flex",t.onclick=()=>this.open();const r=t.querySelector('span:not([class*="sicon"]):not([class*="icon"])');if(r)r.textContent=s;else{const e=Array.from(t.childNodes).find((e=>e.nodeType===Node.TEXT_NODE&&e.textContent?.trim()));e&&(e.textContent=` ${s}`)}}async componentWillLoad(){await Salla.onReady();try{this.overrideScopeSwitchUI(),this.cartSubmittingHandler=async()=>{if(this.isEnabled)return this.pendingCartSubmitPromise?this.isGuestUser()?(this.pendingCartSubmitResolver=null,this.pendingCartSubmitPromise=null,this.cartSubmitConfirmationPending=!1,void await new Promise((()=>{}))):(this.modal?.hasAttribute?.("visible")||this.open(!1,"checkout_gate"),void await this.pendingCartSubmitPromise):void(this.hasCompleteIntentForLoggedInUser()||(this.cartSubmitConfirmationPending=!0,this.pendingCartSubmitPromise=new Promise((e=>{this.pendingCartSubmitResolver=e,this.isGuestUser()?this.openGuestLogin():this.open(!1,"checkout_gate")})),await this.pendingCartSubmitPromise))},Salla.cart.event.onSubmitting(this.cartSubmittingHandler),Salla.cart.event.onBeforeStartFastCheckout(this.cartSubmittingHandler)}catch(e){console.warn("SallaBulletDelivery: overrideScopeSwitchUI failed",e)}Salla.event.on("salla::bullet-delivery.modal.open.requested",this.bulletDeliveryOpenHandler),this.closeHandler=this.close.bind(this),Salla.event.on("salla::bullet-delivery.modal.close.requested",this.closeHandler),Salla.event.on("modal::close",this.modalCloseHandler),this.isRTL=Salla.config.get("theme.is_rtl"),this.stopWatchingLocationPermission=function(e){let t=!1,i=null;const s=()=>{!t&&i&&e(i.state)};return O().then((r=>{t||(i=r,i?(e(i.state),i.addEventListener?.("change",s)):e("unknown"))})),()=>{t=!0,i?.removeEventListener?.("change",s),i=null}}((e=>{this.locationPermissionResolved=!0,this.handleLocationPermissionChanged(e).then((()=>{this.mapReady&&!U(e)&&this.locateOnMap()}))})),this.authLoggedInHandler=async()=>{this.cartSubmitConfirmationPending?await this.handlePendingSubmitAfterLogin():this.hasIncompleteUserAddressIntent()&&(await this.tryAutoConfirmAfterLogin()||this.modal?.hasAttribute?.("visible")||this.open(!1,"after_login"))},Salla.event.on("auth::logged.in",this.authLoggedInHandler),this.authLoggedOutHandler=()=>{this.clearBulletDeliveryStoredData()},Salla.event.on("auth::logged.out",this.authLoggedOutHandler),this.loginOpenHandler=e=>{e?.pendingCartSubmit&&this.armPendingCartSubmitGate()},Salla.event.on("login::open",this.loginOpenHandler),this.cartItemAddedHandler=()=>this.handleAfterAddToCart(),"function"==typeof Salla.cart?.event?.onItemAdded?(this.useCartEventApi=!0,Salla.cart.event.onItemAdded(this.cartItemAddedHandler)):Salla.event.on(this.cartItemAddedEvent,this.cartItemAddedHandler)}render(){return this.isMobileApp||!this.isEnabled?null:e(s,{class:"s-bullet-delivery"},e("salla-modal",{ref:e=>{this.modal=e},isClosable:!this.isRequired&&!this.shouldForceNonClosable(),onModalVisibilityChanged:e=>{e.target===this.modal&&this.handleModalVisibility(Boolean(e.detail))},class:"s-bullet-delivery-modal",width:"sm","data-testid":"salla-bullet-delivery-modal"},e("div",{class:"s-bullet-delivery-inner"},e("div",{class:"s-bullet-delivery-header"},e("h2",{class:"s-bullet-delivery-title"},"address"===this.activeTab?Salla.lang.get("blocks.home.add_address_for_order_delivery"):Salla.lang.getWithDefault("blocks.home.choose_pickup_branch_title",this.isArabic?"اختر فرع استلام طلبك":"Choose your pickup branch")),e("p",{class:"s-bullet-delivery-subtitle"},"address"===this.activeTab?Salla.lang.get("blocks.home.products_available_for_delivery_shown_while_shopping"):Salla.lang.get("blocks.home.choose_branch_for_order_pickup_description"))),this.renderTabs(),"main"===this.viewMode&&this.renderMainView(),"add-address"===this.viewMode&&this.renderAddAddressForm())))}componentDidLoad(){if(this.componentReady=!0,this.isMobileApp)return this.isEnabled&&!this.hasBeenShownThisSession()&&Salla.event.dispatch("salla::bullet-delivery.open-sheet"),this.bulletDeliveryMobileSelectHandler=e=>{const t=this.extractMobileSelectPayload(e);t?this.applyMobileBulletDeliverySelection(t):console.warn("SallaBulletDelivery: received empty mobile select payload",e)},void Salla.event.on("salla::bullet-delivery.select",this.bulletDeliveryMobileSelectHandler);if(this.pendingOpen)return this.pendingOpen=!1,void this.open(!1,this.openTrigger);switch(this.openingType){case"first_visit":this.hasBeenShownThisSession()?this.shouldPromptIncompleteIntentThisSession()&&(this.markIncompleteIntentPrompted(),this.open(!1,"incomplete_intent")):this.open(!1,"first_visit");break;case"on_cart_click":Salla.url.is_page("cart")&&(!0===this.getShownStorage().get(this.sessionShownKey)?this.shouldPromptIncompleteIntentThisSession()&&(this.markIncompleteIntentPrompted(),this.open(!1,"incomplete_intent")):this.open(!1,"on_cart_click"))}const e=this.createCartViewElement();e&&"function"==typeof salla?.hooks?.mount&&Salla.hooks.mount("cart:items.start",e).catch((()=>{}))}disconnectedCallback(){this.componentReady=!1,this.stopWatchingLocationPermission&&(this.stopWatchingLocationPermission(),this.stopWatchingLocationPermission=null),Salla.event.off("salla::bullet-delivery.modal.open.requested",this.bulletDeliveryOpenHandler),Salla.event.off("modal::close",this.modalCloseHandler),this.closeHandler&&(Salla.event.off("salla::bullet-delivery.modal.close.requested",this.closeHandler),this.closeHandler=null),this.cartItemAddedHandler&&(this.useCartEventApi&&"function"==typeof Salla.cart?.event?.offItemAdded?Salla.cart.event.offItemAdded(this.cartItemAddedHandler):Salla.event.off(this.cartItemAddedEvent,this.cartItemAddedHandler),this.cartItemAddedHandler=null),this.cartSubmittingHandler&&("function"==typeof Salla.cart?.event?.offSubmitting?Salla.cart.event.offSubmitting(this.cartSubmittingHandler):Salla.event.off("cart::submitting",this.cartSubmittingHandler),"function"==typeof Salla.cart?.event?.offBeforeStartFastCheckout?Salla.cart.event.offBeforeStartFastCheckout(this.cartSubmittingHandler):Salla.event.off("cart::before.start.fast-checkout",this.cartSubmittingHandler),this.cartSubmittingHandler=null),this.authLoggedInHandler&&(Salla.event.off("auth::logged.in",this.authLoggedInHandler),this.authLoggedInHandler=null),this.authLoggedOutHandler&&(Salla.event.off("auth::logged.out",this.authLoggedOutHandler),this.authLoggedOutHandler=null),this.loginOpenHandler&&(Salla.event.off("login::open",this.loginOpenHandler),this.loginOpenHandler=null),this.bulletDeliveryMobileSelectHandler&&(Salla.event.off("salla::bullet-delivery.select",this.bulletDeliveryMobileSelectHandler),this.bulletDeliveryMobileSelectHandler=null)}};se.INITIAL_ADDRESS_FORM={country_id:0,is_default:!1,city_id:void 0,district_id:void 0,street:void 0,building_number:void 0,additional_number:void 0,postal_code:void 0,description:void 0},se.DROPDOWN_SEARCH_DEBOUNCE_MS=400,se.DROPDOWN_SEARCH_MIN_CHARS=2,se.style='/*!twlt*/@charset "UTF-8";@supports (interpolate-size: allow-keywords) and (block-size: calc-size(auto, size)){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body,.s-bullet-delivery-inner{interpolate-size:allow-keywords}.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body{overflow:clip;transition:block-size 500ms ease}.s-bullet-delivery-inner{overflow:clip;transition:block-size 500ms ease;block-size:calc-size(auto, size)}}@media screen and (min-width: 640px){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body:has(.s-searchable-dropdown--open){overflow:visible !important}}.s-bullet-delivery-form-actions.s-bullet-delivery-form-actions--single{padding-bottom:0;flex-direction:column;gap:0}.s-bullet-delivery-addresses-list.s-scrollbar::-webkit-scrollbar-track,.s-bullet-delivery-branches-list.s-scrollbar::-webkit-scrollbar-track{background-color:transparent}.s-bullet-delivery-back-to-list-link{display:inline-flex;align-items:center;justify-content:center;gap:2px;width:100%;margin-top:12px;background:none;border:none;color:var(--color-primary, #004956);font-size:14px;font-weight:500;cursor:pointer;padding:0}.s-bullet-delivery-back-to-list-link i{font-size:12px}.s-bullet-delivery-location-permission-btn{display:flex;align-items:center;gap:10px;width:100%;padding:12px;border:none;border-radius:8px;background:#fdf2f2;cursor:pointer;text-align:start}.s-bullet-delivery-location-permission-icon{display:inline-flex;flex-shrink:0;width:34px;height:34px}.s-bullet-delivery-location-permission-icon svg{width:100%;height:100%}.s-bullet-delivery-location-permission-text{flex:1;min-width:0;font-size:12px;line-height:18px;color:#444}.s-bullet-delivery-location-permission-arrow{flex-shrink:0;font-size:16px;color:#666}.s-bullet-delivery-location-distance-warning{display:flex;align-items:center;gap:10px;width:100%;padding:12px;border-radius:8px;background:#fff8e1;animation:s-bullet-delivery-fade-in 200ms ease}.s-bullet-delivery-location-distance-warning-icon{display:inline-flex;flex-shrink:0;width:34px;height:34px}.s-bullet-delivery-location-distance-warning-icon svg{width:100%;height:100%}.s-bullet-delivery-location-distance-warning-text{flex:1;min-width:0;font-size:12px;line-height:18px;color:#444}.s-bullet-delivery-map-container{width:100%;height:320px;border-radius:8px;overflow:hidden;margin-bottom:12px}.s-bullet-delivery-map-container gmap-map{display:block;width:100%;height:100%}.s-bullet-delivery-address-confirm{display:flex;flex-direction:column;gap:20px;animation:s-bullet-delivery-fade-in 200ms ease}.s-bullet-delivery-address-confirm-card{display:flex;align-items:center;gap:12px;border:1px solid #eee;border-radius:6px;padding:12px}.s-bullet-delivery-address-map-icon{overflow:hidden;border-radius:9px}.s-bullet-delivery-address-confirm-details{display:flex;flex-direction:column;align-items:flex-start;flex:1;min-width:0}.s-bullet-delivery-address-confirm-label{font-size:12px;line-height:16px;color:#666}.s-bullet-delivery-address-confirm-text{font-size:14px;font-weight:700;color:#333;margin:0;word-break:break-word}.s-bullet-delivery-address-confirm-description{display:flex;flex-direction:column;gap:8px}.s-bullet-delivery-address-confirm-description-label{font-size:14px;font-weight:500;color:#444}.s-bullet-delivery-address-confirm-description-optional{font-weight:400;color:#999;margin-inline-start:4px}.s-bullet-delivery-address-confirm-description-input{width:100%;border:1px solid #eee;border-radius:8px;padding:10px 12px;font-size:14px;margin-bottom:16px}.s-bullet-delivery-login-prompt{display:block;width:100%;text-align:center;background:none;border:none;color:var(--color-primary, #004956);font-size:14px;font-weight:500;cursor:pointer;padding:12px 0}@keyframes s-bullet-delivery-fade-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media (min-width: 640px){.s-bullet-delivery-modal .s-modal-sm{width:90vw !important;max-width:776px !important}}.s-bullet-delivery-modal .s-bullet-delivery-tabs{gap:4px;padding:4px;border-radius:12px;background:#f5f5f5}.s-bullet-delivery-modal .s-bullet-delivery-tab{justify-content:center;gap:8px;min-height:40px;border:0;border-radius:8px;background:transparent;color:#666;font-size:14px}.s-bullet-delivery-modal .s-bullet-delivery-tab:hover{background:transparent;color:var(--color-text, #333)}.s-bullet-delivery-modal .s-bullet-delivery-tab--active,.s-bullet-delivery-modal .s-bullet-delivery-tab--active:hover{background:#fff;color:#1a1a1a;font-weight:600;box-shadow:0 1px 2px rgba(0, 0, 0, 0.06)}.s-bullet-delivery-modal .s-bullet-delivery-tab-badge{display:inline-flex;align-items:center;gap:4px;flex:0 0 auto;padding:4px 8px;border-radius:8px;font-size:11px;font-weight:600;line-height:120%;white-space:nowrap;color:#fff;background:#5196f3}.s-bullet-delivery-modal .s-bullet-delivery-discount-badge{display:inline-flex;align-items:center;flex:0 0 auto;padding:4px 8px;border-radius:6px;font-size:12px;font-weight:600;line-height:120%;white-space:nowrap;color:#fff;background:#e5484d}.s-bullet-delivery-modal .s-bullet-delivery-tab-badge-icon{display:inline-flex}.s-bullet-delivery-modal .s-bullet-delivery-tab-badge-icon svg{width:7px;height:10px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters{display:flex;flex-direction:column;gap:12px;padding:16px;border-radius:12px;background:#fafafa}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-field{margin:0}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters-row{display:flex;gap:12px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters-row>.s-bullet-delivery-field{flex:1;min-width:0}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters{}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-branch-search-wrap{min-height:40px;border-color:#ddd;border-radius:8px;background:#fff}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-branch-search-input{font-size:14px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-btn{height:40px;min-height:40px;padding:0 14px;gap:4px;border:1px solid var(--color-primary);border-radius:8px;background:#fff;color:#1a1a1a;font-size:14px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-btn:hover{background:#fff}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-icon{display:inline-flex}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-icon svg{width:16px;height:16px}.s-bullet-delivery-modal .s-bullet-delivery-branches-list{display:flex;flex-direction:column;gap:16px;max-height:min(400px, 45svh);border:0;border-radius:0;background:transparent}.s-bullet-delivery-modal .s-bullet-delivery-branch-item{display:grid;grid-template-columns:auto minmax(0, 1fr) auto;align-items:start;column-gap:12px;row-gap:2px;padding:16px;border:1px solid #eee;border-radius:12px;background:#fff;text-align:start;transition:border-color 0.2s}.s-bullet-delivery-modal .s-bullet-delivery-branch-item:last-child{border-bottom:1px solid #eee}.s-bullet-delivery-modal .s-bullet-delivery-branch-item:hover:not(.s-bullet-delivery-branch-item--disabled){background:#fff}.s-bullet-delivery-modal .s-bullet-delivery-branch-item--selected,.s-bullet-delivery-modal .s-bullet-delivery-branch-item--selected:last-child{border-color:var(--color-primary);background:#fff}.s-bullet-delivery-modal .s-bullet-delivery-branch-item--disabled{opacity:0.5}.s-bullet-delivery-modal .s-bullet-delivery-branch-radio{grid-column:1;grid-row:1;align-self:center;width:20px;height:20px;margin-top:0;pointer-events:none}.s-bullet-delivery-modal .s-bullet-delivery-branch-body{display:contents}.s-bullet-delivery-modal .s-bullet-delivery-branch-body>*{grid-column:2/-1;min-width:0}.s-bullet-delivery-modal .s-bullet-delivery-branch-body>.s-bullet-delivery-branch-name{grid-column:2;grid-row:1;align-self:center}.s-bullet-delivery-modal .s-bullet-delivery-branch-body>.s-bullet-delivery-branch-location{grid-column:2}.s-bullet-delivery-modal .s-bullet-delivery-branch-name{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0;font-size:14px;font-weight:700;line-height:120%;color:#1a1a1a}.s-bullet-delivery-modal .s-bullet-delivery-branch-meta{display:inline-flex;align-items:center;gap:4px;font-size:13px;color:#6c757d}.s-bullet-delivery-modal .s-bullet-delivery-branch-meta i{font-size:12px}.s-bullet-delivery-modal .s-bullet-delivery-branch-meta-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-status--open{color:#43a047;font-weight:500}.s-bullet-delivery-modal .s-bullet-delivery-pickup-status--closed,.s-bullet-delivery-modal .s-bullet-delivery-pickup-status--busy{color:#e53935;font-weight:500}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule-toggle{display:inline-flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;margin:-6px;padding:0;border:0;background:none;color:inherit;line-height:1;cursor:pointer}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule-toggle i{transition:transform 0.2s ease}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule-toggle i.is-expanded{transform:rotate(180deg)}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule{display:flex;flex-direction:column;margin-top:4px;border-radius:8px;overflow:hidden}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule-day{display:flex;align-items:center;justify-content:space-between;gap:4px;padding:2px 12px;background:#f8f9fa;font-size:12px;font-weight:500}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule-days{color:#6c757d}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule-times{color:#1a1a1a}.s-bullet-delivery-modal .s-bullet-delivery-branch-instructions{align-items:flex-start;line-height:1.5;white-space:pre-line}.s-bullet-delivery-modal .s-bullet-delivery-branch-instructions .s-bullet-delivery-branch-meta-icon{margin-top:2px}.s-bullet-delivery-modal .s-bullet-delivery-branch-meta-value{color:#1a1a1a;font-weight:500}.s-bullet-delivery-modal .s-bullet-delivery-branch-meta-icon{display:inline-flex;flex-shrink:0}.s-bullet-delivery-modal .s-bullet-delivery-branch-meta-icon svg{width:16px;height:16px}.s-bullet-delivery-modal .s-bullet-delivery-branch-actions{grid-column:3;grid-row:1/span 2;display:flex;align-items:center;gap:8px}.s-bullet-delivery-modal .s-bullet-delivery-branch-action{display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:1px solid var(--color-border, #eee);border-radius:8px;background:transparent;color:var(--color-text, #333);text-decoration:none;cursor:pointer;transition:all 0.2s}.s-bullet-delivery-modal .s-bullet-delivery-branch-action i{font-size:16px}.s-bullet-delivery-modal .s-bullet-delivery-branch-action:hover{border-color:var(--color-primary);color:var(--color-primary);background:var(--color-primary-tt, transparent)}.s-bullet-delivery-modal .s-bullet-delivery-branch-action .s-bullet-delivery-branch-map-link-icon,.s-bullet-delivery-modal .s-bullet-delivery-branch-action .s-bullet-delivery-branch-map-link-icon svg{width:16px;height:16px}.s-bullet-delivery-modal .s-bullet-delivery-branch-action .s-bullet-delivery-branch-map-link-icon path{stroke:currentColor}.s-bullet-delivery-modal .s-bullet-delivery-branch-item .s-bullet-delivery-branch-action,.s-bullet-delivery-modal .s-bullet-delivery-branch-item .s-bullet-delivery-branch-schedule-toggle{pointer-events:auto}.s-bullet-delivery-modal .s-bullet-delivery-branch-pills{display:contents}.s-bullet-delivery-modal .s-bullet-delivery-branch-divider{display:none}@media (max-width: 480px){.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters{flex-direction:row;flex-wrap:wrap;gap:12px 8px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-branch-search,.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-search-row,.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-pickup-filters-row{display:contents}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-field{flex:1 1 calc(50% - 4px);min-width:0;order:1}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-branch-search-wrap{flex:1 1 0;min-width:0;order:2}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-btn{flex:0 0 auto;order:3;padding:0 10px;white-space:nowrap}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-error{flex-basis:100%;order:4}}@media (max-width: 480px) and (max-width: 400px){.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-btn{padding:0 12px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}}@media (max-width: 480px){.s-bullet-delivery-modal .s-bullet-delivery-branch-meta-row{display:contents}.s-bullet-delivery-modal .s-bullet-delivery-branch-pills,.s-bullet-delivery-modal .s-bullet-delivery-branch-divider,.s-bullet-delivery-modal .s-bullet-delivery-branch-open-status{grid-column:2/-1;min-width:0}.s-bullet-delivery-modal .s-bullet-delivery-branch-pills{display:flex;flex-wrap:wrap;gap:8px;order:1;margin-top:6px}.s-bullet-delivery-modal .s-bullet-delivery-branch-divider{order:2}.s-bullet-delivery-modal .s-bullet-delivery-branch-instructions{order:3}.s-bullet-delivery-modal .s-bullet-delivery-branch-open-status{order:4}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule{order:5}.s-bullet-delivery-modal .s-bullet-delivery-branch-location .s-bullet-delivery-branch-meta-icon{display:none}.s-bullet-delivery-modal .s-bullet-delivery-branch-pill{padding:4px 10px;border:1px solid var(--color-border, #eee);border-radius:999px;font-size:12px;line-height:1.4}.s-bullet-delivery-modal .s-bullet-delivery-branch-pill .s-bullet-delivery-branch-meta-label{display:none}.s-bullet-delivery-modal .s-bullet-delivery-branch-pill .s-bullet-delivery-branch-meta-value{color:inherit;font-weight:400}.s-bullet-delivery-modal .s-bullet-delivery-branch-divider{display:block;width:100%;height:0;margin:10px 0;border:0;border-top:1px solid #e0e0e0;opacity:1}.s-bullet-delivery-modal .s-bullet-delivery-branch-action,.s-bullet-delivery-modal .s-bullet-delivery-branch-action:hover{border-color:transparent}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.inline{display:inline}.inline-flex{display:inline-flex}.shrink{flex-shrink:1}.resize{resize:both}.\\!text-blue-600{--tw-text-opacity:1 !important;color:rgb(37 99 235 / var(--tw-text-opacity, 1)) !important}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-hidden{display:none}.form-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.form-input:focus{border-color:var(--color-primary);--tw-ring-color:transparent}.form-input:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.form-input:focus:is(.dark *){border-color:var(--color-primary)}@media (min-width: 640px){.form-input{font-size:0.875rem;line-height:1.25rem}}.\\!btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.\\!btn:hover{opacity:0.8}.btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.btn:hover{opacity:0.8}.spinner-loader.reverse{border-right-color:#9f7171 !important;background-color:#f98181}.s-hidden{display:none}.s-scrollbar::-webkit-scrollbar{width:5px}.s-scrollbar::-webkit-scrollbar-track{background-color:#eee}.s-scrollbar::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body{padding:0px}@media (min-width: 768px){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body{max-height:70dvh;overflow-y:auto}}@media (min-width: 640px){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body:has(.s-searchable-dropdown--open){overflow:visible !important}}.s-bullet-delivery-inner{min-block-size:0}.s-bullet-delivery-header{margin-bottom:1.5rem;text-align:start}.s-bullet-delivery-title{display:block;font-size:1.25rem;line-height:1.75rem;font-weight:700;color:var(--color-primary-dark)}.s-bullet-delivery-subtitle{margin-top:0.25rem;display:block;font-size:0.875rem;line-height:1.25rem;color:var(--color-primary-dark)}.s-bullet-delivery-tabs{margin-bottom:1.5rem;display:flex;gap:0.5rem}.s-bullet-delivery-tab{display:flex;flex:1 1 0%;cursor:pointer;align-items:center;gap:1rem;border-radius:0.5rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-top:0.5rem;padding-bottom:0.5rem;padding-left:0.75rem;padding-right:0.75rem;font-size:0.875rem;line-height:1.25rem;font-weight:500;color:var(--color-primary-dark);transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-bullet-delivery-tab:hover{background-color:color-mix(in srgb,var(--color-primary) 5%,transparent)}.s-bullet-delivery-tab--active{border-color:var(--color-primary-dark)}.s-bullet-delivery-tab svg{height:0.875rem;width:0.875rem;color:var(--color-primary-dark)}.s-bullet-delivery-tab-icon{display:flex;height:2rem;width:2rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:0.75rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-allocation-out-of-coverage{margin-bottom:1rem;display:flex;width:100%;align-items:center;gap:0.5rem;--tw-bg-opacity:1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1));padding-top:0.75rem;padding-bottom:0.75rem;padding-left:1rem;padding-right:1rem;text-align:end;--tw-text-opacity:1;color:rgb(127 29 29 / var(--tw-text-opacity, 1))}.s-bullet-delivery-allocation-out-of-coverage:where([dir="ltr"],[dir="ltr"] *){border-left-width:4px;border-left-color:rgb(239 68 68 / 0.5)}.s-bullet-delivery-allocation-out-of-coverage:where([dir="rtl"],[dir="rtl"] *){border-right-width:4px;border-right-color:rgb(239 68 68 / 0.5)}.s-bullet-delivery-allocation-out-of-coverage-text{font-size:0.875rem;line-height:1.25rem;line-height:1.4}.s-bullet-delivery-allocation-out-of-coverage-icon{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;--tw-text-opacity:1;color:rgb(127 29 29 / var(--tw-text-opacity, 1))}.s-bullet-delivery-content{margin-bottom:1.5rem;display:grid;gap:1rem}.s-bullet-delivery-content--active{animation:s-bullet-delivery-fade-in 220ms ease-out}.s-bullet-delivery-label{margin-bottom:0.5rem;display:block;font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-bullet-delivery-error{margin-top:0.25rem;display:block;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-bullet-delivery-footer{display:grid;gap:0.75rem;text-align:center}.s-bullet-delivery-placeholder{margin-top:1rem;margin-bottom:1rem}.s-bullet-delivery-placeholder.s-placeholder-wrapper{margin-top:1rem !important;margin-bottom:1rem !important}.s-bullet-delivery-label-content{display:inline-flex;align-items:center;gap:0.5rem}.s-bullet-delivery-select-loader{display:inline-flex;align-items:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-bullet-delivery-search-row{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:0.5rem;padding-left:1px;padding-right:1px}.s-bullet-delivery-search-row .s-bullet-delivery-search{min-width:0px;flex:1 1 0%}.s-bullet-delivery-search-row .s-bullet-delivery-location-btn{width:auto;flex-shrink:0}.s-bullet-delivery-field-row{margin-bottom:1rem;display:flex;gap:1rem}.s-bullet-delivery-field-row .s-bullet-delivery-field{margin-bottom:0px;flex:1 1 0%}.s-bullet-delivery-saved-addresses-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.s-bullet-delivery-saved-addresses-empty-icon{margin-bottom:0.75rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-bullet-delivery-saved-addresses-empty-icon svg{height:2rem;width:2rem}.s-bullet-delivery-saved-addresses-empty-title{margin-bottom:0.5rem;font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-bullet-delivery-saved-addresses-empty-desc{margin-bottom:1.5rem;max-width:24rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-addresses-list{position:relative;display:flex;max-height:260px;flex-direction:column;overflow-y:auto;border-radius:0.75rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}@media (min-width: 768px){.s-bullet-delivery-addresses-list{max-height:220px}}.s-bullet-delivery-address-item{display:flex;cursor:pointer;flex-direction:row;align-items:center;gap:0.75rem;border-bottom-width:1px;--tw-border-opacity:1;border-bottom-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.875rem;padding-bottom:0.875rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-address-item:not(.s-bullet-delivery-address-item--disabled):hover{background-color:rgb(249 250 251 / 0.5)}.s-bullet-delivery-address-item--selected{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-address-item--disabled{cursor:not-allowed;opacity:0.6}.s-bullet-delivery-address-item--skeleton{display:flex;cursor:default;align-items:center;gap:0.75rem;border-radius:0.75rem;border-width:1px;border-bottom-width:0px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:1rem}.s-bullet-delivery-address-item--skeleton .s-bullet-delivery-address-lines{gap:0.5rem}.s-bullet-delivery-address-content{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;justify-content:center;text-align:start}.s-bullet-delivery-address-lines{display:flex;flex-direction:column;gap:0.125rem}.s-bullet-delivery-address-line1{display:block;font-size:1rem;line-height:1.5rem;font-weight:400;line-height:1.375;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-bullet-delivery-address-line2{display:block;font-size:0.875rem;line-height:1.25rem;line-height:1.375;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-bullet-delivery-address-map-icon{display:grid;height:2.5rem;width:2.5rem;place-content:center}.s-bullet-delivery-address-map-icon svg{height:100%;width:100%}.s-bullet-delivery-skel-radio{flex-shrink:0;border-radius:9999px}.s-bullet-delivery-skel-map{flex-shrink:0;border-radius:0.75rem}.s-bullet-delivery-search{position:relative;flex:1 1 0%}.s-bullet-delivery-search-icon{pointer-events:none;position:absolute;top:0px;bottom:0px;left:0px;display:flex;align-items:center;padding-left:0.75rem}.s-bullet-delivery-search-icon:where([dir="rtl"],[dir="rtl"] *){left:auto;right:0px;padding-left:0px;padding-right:0.75rem}.s-bullet-delivery-search-icon svg{height:0.875rem;width:0.875rem;stroke:var(--color-primary)}.s-bullet-delivery-branch-search-wrap{display:flex;min-height:40px;min-width:0px;flex:1 1 0%;flex-direction:row;align-items:stretch;overflow:hidden;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-bullet-delivery-branch-search-wrap:focus-within{border-color:var(--color-primary-dark);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);--tw-ring-color:var(--color-primary-dark)}.s-bullet-delivery-branch-search-icon{pointer-events:none;position:static;display:flex;flex-shrink:0;align-items:center;justify-content:center;padding-inline-start:0.5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-search-icon svg{height:1.25rem;width:1.25rem}.s-bullet-delivery-branch-search-input{min-height:40px;min-width:0px;flex:1 1 0%;border-radius:0px;border-style:none;background-color:transparent;padding-top:0.5rem;padding-bottom:0.5rem;padding-inline-end:0.75rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1));--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-bullet-delivery-branch-search-input::placeholder{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-search-input:focus{outline:2px solid transparent;outline-offset:2px;border:none;box-shadow:none;--tw-ring-shadow:none}.s-bullet-delivery-location-btn{display:flex;flex-shrink:0;cursor:pointer;align-items:center;justify-content:center;gap:0.5rem;border-radius:0.5rem;border-width:1px;padding-left:1rem;padding-right:1rem;padding-top:0.5rem;padding-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-location-btn:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-location-btn:disabled{cursor:not-allowed;opacity:0.5}.s-bullet-delivery-location-btn--full{min-height:40px}.s-bullet-delivery-location-btn--loading{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-location-icon{height:0.875rem;width:0.875rem;flex-shrink:0}.s-bullet-delivery-location-icon svg{height:100%;width:100%}.s-bullet-delivery-branches-wrap{overflow:hidden}.s-bullet-delivery-branches-list{position:relative;max-height:min(260px, 32svh);overflow-y:auto;border-radius:0.5rem;border-width:1px;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}@media (min-width: 768px){.s-bullet-delivery-branches-list{max-height:220px}}.s-bullet-delivery-branches-loading{overflow:hidden;border-radius:0.5rem;border-width:1px;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-branch-info{display:flex;max-width:6.25rem;flex-direction:column;gap:0.125rem}.s-bullet-delivery-branch-name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow-wrap:break-word;font-size:0.875rem;line-height:1.25rem;font-weight:500;line-height:1.375;--tw-text-opacity:1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-prep{text-align:start;font-size:0.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-time{font-size:0.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-time:where([dir="ltr"],[dir="ltr"] *){text-align:end}.s-bullet-delivery-branch-time:where([dir="rtl"],[dir="rtl"] *){text-align:start}.s-bullet-delivery-branch-map-link{display:flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:0.5rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:0.5rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1));text-decoration-line:none;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-branch-map-link:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-branch-item>.s-bullet-delivery-branch-map-link{position:relative;z-index:10;pointer-events:auto}.s-bullet-delivery-branch-map-link-icon{display:flex;height:0.875rem;width:0.875rem;align-items:center;justify-content:center}.s-bullet-delivery-branch-map-link-icon svg{height:100%;width:100%}.s-bullet-delivery-branch-skeleton-title{max-width:100%}.s-bullet-delivery-branch-skeleton-time{justify-self:end}.s-bullet-delivery-branch-item{display:grid;min-width:0px;cursor:pointer;align-items:center;gap:0.5rem;border-bottom-width:1px;--tw-border-opacity:1;border-bottom-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;text-align:end;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;grid-template-columns:auto auto auto 1fr auto}.s-bullet-delivery-branch-item:last-child{border-bottom-width:0px}.s-bullet-delivery-branch-item:hover:not(.s-bullet-delivery-branch-item--disabled){--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-branch-item--selected{background-color:color-mix(in srgb,var(--color-primary) 5%,transparent)}.s-bullet-delivery-branch-item--disabled{cursor:not-allowed;opacity:0.5}.s-bullet-delivery-branch-icon{display:grid;place-content:center;border-radius:0.75rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));stroke:var(--color-primary-dark);padding:0.625rem;color:var(--color-primary-dark)}.s-bullet-delivery-branch-icon span{display:block;height:0.875rem;width:0.875rem}.s-bullet-delivery-branch-icon span svg{height:100%;width:100%}.s-bullet-delivery-branch-skeleton{display:grid;min-width:0px;align-items:center;gap:0.5rem;border-bottom-width:1px;--tw-border-opacity:1;border-bottom-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;grid-template-columns:auto auto auto 1fr auto}.s-bullet-delivery-branch-skeleton:last-child{border-bottom-width:0px}.s-bullet-delivery-branch-skeleton-radio{flex-shrink:0}.s-bullet-delivery-branch-skeleton-icon{flex-shrink:0;border-radius:0.75rem}.s-bullet-delivery-branch-skeleton-icon salla-skeleton{display:block}.s-bullet-delivery-branch-skeleton-map{flex-shrink:0;border-radius:0.75rem}.s-bullet-delivery-branch-skeleton-map salla-skeleton{display:block}.s-bullet-delivery-branch-skeleton-content{display:flex;min-width:0px;flex-direction:column;gap:0.5rem;overflow:hidden}.s-bullet-delivery-branch-skeleton-content salla-skeleton{min-width:0px;max-width:100%}.s-bullet-delivery-radio{margin-top:2px;height:1rem;width:1rem;flex-shrink:0;cursor:pointer;appearance:none;border-radius:9999px;border-width:2px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-radio:checked{border-color:var(--color-primary-dark);background:radial-gradient(circle,#fff 0,#fff 22%,var(--color-primary) 22%)}.s-bullet-delivery-radio:focus{outline:2px solid transparent;outline-offset:2px}.s-bullet-delivery-radio:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);--tw-ring-color:var(--color-primary-dark);--tw-ring-offset-width:2px}.s-bullet-delivery-skeleton{box-sizing:border-box;min-width:0px;max-width:100%;overflow:hidden;padding:1.25rem}.s-bullet-delivery-skeleton salla-skeleton{min-width:0px;max-width:100%}.s-bullet-delivery-skeleton-header{margin-bottom:1.5rem;display:flex;min-width:0px;max-width:100%;flex-direction:column;align-items:flex-start;gap:0.75rem}.s-bullet-delivery-skeleton-title{display:block;max-width:100%}.s-bullet-delivery-skeleton-subtitle{display:block;max-width:100%}.s-bullet-delivery-skeleton-tabs{margin-bottom:1.5rem;display:grid;min-width:0px;max-width:100%;grid-template-columns:repeat(2, minmax(0, 1fr));gap:0.5rem}.s-bullet-delivery-skeleton-tabs--single{grid-template-columns:repeat(1, minmax(0, 1fr))}.s-bullet-delivery-skeleton-tab{display:flex;align-items:center;gap:1rem;border-radius:0.75rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-bullet-delivery-skeleton-tab-icon{display:block;max-width:100%}.s-bullet-delivery-skeleton-tab-label{display:block;max-width:100%}.s-bullet-delivery-skeleton-field-label{display:block;max-width:100%}.s-bullet-delivery-skeleton-field-control{display:block;max-width:100%}.s-bullet-delivery-skeleton-content{margin-bottom:1.5rem;display:grid;min-width:0px;max-width:100%;gap:1rem}.s-bullet-delivery-skeleton-field{display:flex;min-width:0px;max-width:100%;flex-direction:column;align-items:flex-start;gap:0.5rem}.s-bullet-delivery-skeleton-footer{min-width:0px;max-width:100%}.s-bullet-delivery-add-address-header{margin-bottom:1.5rem;display:flex;align-items:center;justify-content:space-between;gap:0.75rem}.s-bullet-delivery-add-address-title{display:flex;width:100%;flex:1 1 0%;cursor:pointer;align-items:center;border-style:none;background-color:transparent;padding:0px;text-align:start;font-size:1.125rem;line-height:1.75rem;font-weight:700;color:var(--color-primary)}.s-bullet-delivery-add-address svg{height:2.5rem;width:2.5rem;fill:currentColor}.s-bullet-delivery-allocation-out-of-coverage-icon svg{height:1.25rem;width:1.25rem}.s-bullet-delivery-add-address-form{display:grid;gap:1rem}.s-bullet-delivery-add-address-submit{width:100%}.s-bullet-delivery-form-actions{display:flex;gap:0.75rem;border-top-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));padding-top:1rem}.s-bullet-delivery-form-actions salla-button{flex:1 1 0%}.s-bullet-delivery-form-actions--single{border-top-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-top:1.25rem}.s-bullet-delivery-form-actions--single salla-button{width:100%;flex:1 1 0%}.s-bullet-delivery-market-warning-overlay{position:fixed;inset:0px;z-index:60;display:flex;align-items:center;justify-content:center;background-color:rgb(0 0 0 / 0.5)}.s-bullet-delivery-market-warning{margin-left:1rem;margin-right:1rem;width:100%;max-width:24rem;border-radius:0.75rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1.5rem;--tw-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-bullet-delivery-market-warning-title{margin-bottom:0.75rem;font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-bullet-delivery-market-warning-message{margin-bottom:1.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-bullet-delivery-market-warning-actions{display:flex;gap:0.75rem}.s-bullet-delivery-market-warning-actions salla-button{flex:1 1 0%}.s-bullet-delivery-cart-view{margin-bottom:1rem;display:flex;align-items:center;justify-content:space-between;gap:1rem;border-radius:0.75rem;border-width:1px;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1rem}.s-bullet-delivery-cart-view-info{display:flex;min-width:0px;flex:1 1 0%;align-items:center;gap:0.75rem}.s-bullet-delivery-cart-view-text{display:flex;flex-direction:column;text-align:start}.s-bullet-delivery-cart-view-title{font-size:1rem;line-height:1.5rem;font-weight:600;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-bullet-delivery-cart-view-subtitle{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));margin-block-start:0.125rem}.s-bullet-delivery-cart-view-icon{display:flex;height:3.5rem;width:3.5rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:1rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));color:var(--color-primary-dark)}.s-bullet-delivery-cart-view-icon svg{height:1.25rem;width:1.25rem;stroke:currentColor}.s-bullet-delivery-cart-view-button{flex-shrink:0;align-self:center}.s-bullet-delivery-location-permission-btn{display:flex;width:100%;cursor:pointer;align-items:center;gap:0.625rem;border-radius:0.5rem;border-width:0px;padding:0.75rem;text-align:start;background:#fdf2f2}.s-bullet-delivery-location-permission-icon{display:inline-flex;height:34px;width:34px;flex-shrink:0}.s-bullet-delivery-location-permission-icon svg{height:100%;width:100%}.s-bullet-delivery-location-permission-text{min-width:0px;flex:1 1 0%;font-size:0.75rem;line-height:1rem;line-height:18px;--tw-text-opacity:1;color:rgb(68 68 68 / var(--tw-text-opacity, 1))}.s-bullet-delivery-location-permission-arrow{flex-shrink:0;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(102 102 102 / var(--tw-text-opacity, 1))}.s-bullet-delivery-location-distance-warning{display:flex;width:100%;animation:s-bullet-delivery-fade-in 200ms ease;align-items:center;gap:0.625rem;border-radius:0.5rem;padding:0.75rem;background:#fff8e1}.s-bullet-delivery-location-distance-warning-icon{display:inline-flex;height:34px;width:34px;flex-shrink:0}.s-bullet-delivery-location-distance-warning-icon svg{height:100%;width:100%}.s-bullet-delivery-location-distance-warning-text{min-width:0px;flex:1 1 0%;font-size:0.75rem;line-height:1rem;line-height:18px;--tw-text-opacity:1;color:rgb(68 68 68 / var(--tw-text-opacity, 1))}';const re=class{constructor(e){t(this,e),this.isEligible=!1}async componentWillLoad(){try{await salla.onReady(),await salla.lang.onLoaded(),this.isEligible=!0===salla.config.get("store.shipping.has_bullet_delivery_tag")}catch(e){salla?.logger?.warn?.("salla-bullet-delivery-tag: init failed",e),this.isEligible=!1}}getTagLabel(){const e="en"===salla.config.get("user.language_code")?"Get it within 2 hours":"توصيل خلال ساعتين";return salla.lang.getWithDefault("pages.products.quick_delivery_tag",e)}render(){return this.isEligible?e(s,{class:"s-bullet-delivery-tag-wrapper"},e("span",{class:"s-bullet-delivery-tag-container","data-testid":"bd-tag"},e("span",{class:"s-bullet-delivery-tag-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>flash</title>\n<path d="M29.257 14.223c-0.188-0.533-0.692-0.889-1.257-0.889h-6.5l1.159-9.844c0.063-0.537-0.205-1.061-0.68-1.323-0.472-0.261-1.059-0.211-1.481 0.131l-17.333 14c-0.44 0.355-0.608 0.948-0.419 1.481 0.185 0.532 0.689 0.888 1.255 0.888h6.5l-1.159 9.844c-0.063 0.537 0.205 1.061 0.68 1.323 0.203 0.112 0.424 0.167 0.645 0.167 0.299 0 0.595-0.1 0.837-0.296l17.333-14c0.44-0.355 0.608-0.949 0.42-1.481zM12.373 25.575l0.951-8.085c0.044-0.379-0.075-0.757-0.328-1.041-0.252-0.285-0.615-0.448-0.996-0.448h-4.227l11.855-9.575-0.951 8.085c-0.044 0.379 0.075 0.757 0.328 1.041 0.251 0.285 0.613 0.448 0.995 0.448h4.227z"></path>\n</svg>\n'}),e("span",{class:"s-bullet-delivery-tag-label"},this.getTagLabel()))):null}};re.style="/*!twlt*/.s-bullet-delivery-tag-wrapper{display:flex;width:100%}@media (min-width: 1024px){.s-bullet-delivery-tag-wrapper{display:inline-flex;width:auto}.s-bullet-delivery-tag-wrapper .s-bullet-delivery-tag-container{transform:skewX(-15deg)}.s-bullet-delivery-tag-wrapper .s-bullet-delivery-tag-icon,.s-bullet-delivery-tag-wrapper .s-bullet-delivery-tag-label{transform:skewX(15deg)}}.s-bullet-delivery-tag-wrapper .s-bullet-delivery-tag-icon svg{width:1rem;height:1rem;fill:currentColor}.hidden{display:none}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-bullet-delivery-tag-container{display:flex;width:100%;align-items:center;justify-content:center;gap:0.5rem;border-radius:0px;--tw-bg-opacity:1;background-color:rgb(43 191 134 / var(--tw-bg-opacity, 1));padding-left:0.75rem;padding-right:0.75rem;padding-top:0.5rem;padding-bottom:0.5rem;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 1024px){.s-bullet-delivery-tag-container{display:inline-flex;width:auto;gap:0.375rem;border-radius:0.375rem;padding-left:0.875rem;padding-right:0.875rem;padding-top:0.375rem;padding-bottom:0.375rem}}.s-bullet-delivery-tag-icon{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center}.s-bullet-delivery-tag-label{white-space:nowrap;font-size:0.875rem;line-height:1.25rem;font-weight:700}";const le=class{constructor(e){t(this,e),this.itemSelected=i(this,"itemSelected"),this.searchInput=i(this,"searchInput"),this.dropdownOpened=i(this,"dropdownOpened"),this.dropdownClosed=i(this,"dropdownClosed"),this.placeholder="",this.items=[],this.selectedItem=null,this.loading=!1,this.searching=!1,this.disabled=!1,this.required=!1,this.noResultsText="",this.inputId="",this.searchQuery="",this.clientSearch=!1,this.dropUp=!1,this.searchable=!0,this.keepParentScroll=!1,this.isOpen=!1,this.focusedIndex=-1,this.clientSearchQuery="",this.scrollableAncestor=null,this.handleTriggerClick=()=>{this.isOpen?this.close():this.open()},this.handleTriggerKeyDown=e=>{this.isOpen?this.navigateItems(e):"Enter"===e.key||" "===e.key||"ArrowDown"===e.key?(e.preventDefault(),this.open()):"Escape"===e.key&&this.close()},this.handleSearchInputChange=e=>{const t=e.target.value;this.clientSearch&&(this.clientSearchQuery=t),this.searchInput.emit(t),this.focusedIndex=-1},this.handleSearchKeyDown=e=>{this.navigateItems(e)}}connectedCallback(){this.boundHandleClickOutside=this.handleClickOutside.bind(this),document.addEventListener("mousedown",this.boundHandleClickOutside)}disconnectedCallback(){document.removeEventListener("mousedown",this.boundHandleClickOutside),this.scrollableAncestor&&(this.scrollableAncestor.style.overflow="",this.scrollableAncestor=null)}onItemsChange(){this.focusedIndex=-1}normalizeArabic(e){return e.replace(/[أإآا]/g,"ا")}get filteredItems(){if(!this.clientSearch||!this.clientSearchQuery.trim())return this.items;const e=this.normalizeArabic(this.clientSearchQuery.trim().toLowerCase());return this.items.filter((t=>{const i=this.normalizeArabic(t.name.toLowerCase()),s=t.name_en?t.name_en.toLowerCase():"";return i.includes(e)||s.includes(e)}))}getDisplayName(e){const t=salla?.config?.get("user.language_code");return t&&"ar"!==t&&e.name_en?.trim()?e.name_en.trim():e.name}handleClickOutside(e){this.isOpen&&(this.host.contains(e.target)||this.close())}findScrollableAncestor(){let e=this.host.parentElement;for(;e;){const t=getComputedStyle(e),i=t.overflowY;if("auto"===i||"scroll"===i||"hidden"===i||"clip"===t.overflow)return e;e=e.parentElement}return null}isCoarsePointer(){return!!window.matchMedia?.("(pointer: coarse)").matches}isNarrowViewport(){return!!window.matchMedia?.("(max-width: 639px)").matches}open(){this.disabled||this.loading||(this.isOpen=!0,this.focusedIndex=-1,this.keepParentScroll||this.isNarrowViewport()||(this.scrollableAncestor=this.findScrollableAncestor(),this.scrollableAncestor&&(this.scrollableAncestor.style.overflow="visible")),this.dropdownOpened.emit(),requestAnimationFrame((()=>{this.isCoarsePointer()||this.searchInputRef?.focus(),this.panelRef?.scrollIntoView?.({block:"nearest"})})))}close(){this.isOpen&&(this.isOpen=!1,this.focusedIndex=-1,this.clientSearchQuery="",this.scrollableAncestor&&(this.scrollableAncestor.style.overflow="",this.scrollableAncestor=null),this.dropdownClosed.emit())}navigateItems(e){const t=this.filteredItems,i=t.length;switch(e.key){case"ArrowDown":e.preventDefault(),this.focusedIndex=i>0?(this.focusedIndex+1)%i:-1,this.scrollFocusedIntoView();break;case"ArrowUp":e.preventDefault(),this.focusedIndex=i>0?(this.focusedIndex-1+i)%i:-1,this.scrollFocusedIntoView();break;case"Enter":e.preventDefault(),this.focusedIndex>=0&&this.focusedIndex<i&&this.selectItem(t[this.focusedIndex]);break;case"Escape":e.preventDefault(),this.close()}}scrollFocusedIntoView(){this.focusedIndex<0||requestAnimationFrame((()=>{const e=this.panelRef?.querySelector(".s-searchable-dropdown-list"),t=e?.children[this.focusedIndex];t?.scrollIntoView({block:"nearest"})}))}selectItem(e){this.itemSelected.emit(e),this.close()}render(){const t=null!=this.selectedItem,i=`${this.inputId}-listbox`;return e(s,{key:"02d11f844c06912b4743b820af6cee7c34b77f17",class:"s-searchable-dropdown"},e("div",{key:"e2fde5235f96206861dec5c94397a48061a2b59d",class:{"s-searchable-dropdown":!0,"s-searchable-dropdown--open":this.isOpen}},this.label&&e("label",{key:"22d43eb76b9d9b7e28be0a02e799e200499bb2d5",class:"s-searchable-dropdown-label",htmlFor:this.inputId},this.label,this.required&&e("span",{key:"a139791c05d1b494776f538deafebbf41a2d4eee",class:"s-searchable-dropdown-required"}," *")),e("div",{key:"7361971a854f54206f30f61a13bce53c19b4dd54",class:{"s-searchable-dropdown-trigger":!0,"s-searchable-dropdown-trigger--disabled":this.disabled||this.loading,"s-searchable-dropdown-trigger--open":this.isOpen},role:"combobox","aria-expanded":this.isOpen?"true":"false","aria-haspopup":"listbox","aria-controls":i,"aria-disabled":this.disabled||this.loading?"true":"false",tabIndex:this.disabled||this.loading?-1:0,onClick:this.handleTriggerClick,onKeyDown:this.handleTriggerKeyDown},t?e("span",{class:"s-searchable-dropdown-trigger-text"},this.getDisplayName(this.selectedItem)):e("span",{class:"s-searchable-dropdown-trigger-placeholder"},this.placeholder),e("i",{key:"11a8d6d198eceaff33c83167db1672709da6a334",class:{"sicon-keyboard_arrow_down":!0,"s-searchable-dropdown-trigger-icon":!0,"s-searchable-dropdown-trigger-icon--open":this.isOpen},"aria-hidden":"true"})),this.isOpen&&e("div",{key:"b1f95c4129297cb880edefdae7dd0ee55d0db89f",class:{"s-searchable-dropdown-panel":!0,"s-searchable-dropdown-panel--up":this.dropUp},ref:e=>this.panelRef=e},this.searchable&&e("div",{key:"538366b1f478b758697a6163449f02a844046c24",class:"s-searchable-dropdown-search-wrap"},e("i",{key:"d4645a414866d20b37567b0edf7cc063c0783b0e",class:"sicon-search s-searchable-dropdown-search-icon","aria-hidden":"true"}),e("input",{key:"9a1a0e9146fa1e5a2c391b75c82b8fe795207118",ref:e=>this.searchInputRef=e,id:this.inputId,type:"text",class:"s-searchable-dropdown-search-input",placeholder:this.placeholder,value:this.clientSearch?this.clientSearchQuery:this.searchQuery,onInput:this.handleSearchInputChange,onKeyDown:this.handleSearchKeyDown,autocomplete:"off","aria-autocomplete":"list","aria-expanded":this.isOpen?"true":"false","aria-controls":i})),e("div",{key:"c233695fd26f7c743af2a330c149a02171e108da",id:i,class:"s-searchable-dropdown-list s-scrollbar",role:"listbox"},this.renderListContent()))))}renderListContent(){if(this.searching||this.loading)return e("div",{class:"s-searchable-dropdown-loading"},e("svg",{class:"s-searchable-dropdown-spinner",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round",opacity:"0.25"}),e("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round"})));const t=this.filteredItems;return 0===t.length?e("div",{class:"s-searchable-dropdown-empty"},this.noResultsText||salla?.lang?.get("common.elements.no_options")||"No results found"):t.map(((t,i)=>{const s=this.selectedItem?.id===t.id;return e("button",{key:t.id,type:"button",role:"option",class:{"s-searchable-dropdown-item":!0,"s-searchable-dropdown-item--selected":s,"s-searchable-dropdown-item--focused":this.focusedIndex===i&&!s},"aria-selected":s?"true":"false",onClick:()=>this.selectItem(t)},e("span",{class:{"s-searchable-dropdown-item-name":!0,"s-searchable-dropdown-item-name--selected":s}},this.getDisplayName(t)),s&&e("i",{class:"sicon-check s-searchable-dropdown-item-check","aria-hidden":"true"}))}))}get host(){return r(this)}static get watchers(){return{items:["onItemsChange"]}}};le.style="/*!twlt*/.s-searchable-dropdown{position:relative}.s-searchable-dropdown--open{z-index:9999}.s-searchable-dropdown-label{display:block;font-size:14px;font-weight:500;color:var(--color-text-primary, #374151);margin-bottom:8px}.s-searchable-dropdown-required{color:var(--color-danger, #ef4444)}.s-searchable-dropdown-trigger{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:40px;padding:8px 12px;font-size:14px;text-align:start;background:var(--color-surface, #fff);border:1px solid var(--color-border, #e5e7eb);border-radius:6px;cursor:pointer;transition:border-color 0.15s ease, box-shadow 0.15s ease}.s-searchable-dropdown-trigger:hover:not(.s-searchable-dropdown-trigger--disabled){border-color:var(--color-border-hover, #d1d5db)}.s-searchable-dropdown-trigger:focus{outline:none;border-color:var(--color-primary, #00897b);box-shadow:0 0 0 1px var(--color-primary, #00897b)}.s-searchable-dropdown-trigger--disabled{opacity:0.5;cursor:not-allowed;background:var(--color-surface-disabled, #f9fafb)}.s-searchable-dropdown-trigger--open{border-color:var(--color-primary, #00897b);box-shadow:0 0 0 1px var(--color-primary, #00897b)}.s-searchable-dropdown-trigger-text{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-primary, #111827)}.s-searchable-dropdown-trigger-placeholder{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-secondary, #9ca3af)}.s-searchable-dropdown-trigger-icon{flex-shrink:0;color:var(--color-text-secondary, #9ca3af);font-size:18px;transition:transform 0.2s ease;margin-inline-start:8px}.s-searchable-dropdown-trigger-icon--open{transform:rotate(180deg)}.s-searchable-dropdown-panel{position:absolute;z-index:9999;width:100%;margin-top:4px;background:var(--color-surface, #fff);border:1px solid var(--color-border, #e5e7eb);border-radius:8px;box-shadow:0 8px 24px rgba(0, 0, 0, 0.12);overflow:hidden;animation:s-searchable-dropdown-in 0.15s ease}.s-searchable-dropdown-panel--up{bottom:60%}@keyframes s-searchable-dropdown-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.s-searchable-dropdown-search-wrap{display:flex;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid var(--color-border, #f3f4f6)}.s-searchable-dropdown-search-icon{flex-shrink:0;color:var(--color-text-secondary, #9ca3af);font-size:16px}.s-searchable-dropdown-search-input{flex:1;min-width:0;border:none;outline:none;background:transparent;font-size:14px;color:var(--color-text-primary, #111827);box-shadow:none}.s-searchable-dropdown-search-input::placeholder{color:var(--color-text-secondary, #9ca3af)}.s-searchable-dropdown-search-input:focus{outline:none;box-shadow:none;border:none}.s-searchable-dropdown-list{max-height:min(40vh, 220px);overflow-y:auto;scrollbar-width:thin;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y}.s-searchable-dropdown-item{display:flex;align-items:center;justify-content:space-between;width:100%;padding:10px 16px;margin:0;gap:8px;font:inherit;font-size:14px;text-align:inherit;color:var(--color-text-primary, #111827);background:transparent;border:none;border-bottom:1px solid var(--color-border-light, #f9fafb);cursor:pointer;transition:background 0.15s ease}.s-searchable-dropdown-item:last-child{border-bottom:none}.s-searchable-dropdown-item:hover{background:var(--color-hover, #f9fafb)}.s-searchable-dropdown-item--selected{background:color-mix(in srgb, var(--color-primary, #00897b) 8%, transparent)}.s-searchable-dropdown-item--focused{background:color-mix(in srgb, var(--color-primary, #165b54) 12%, transparent)}.s-searchable-dropdown-item-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.s-searchable-dropdown-item-name--selected{color:var(--color-primary, #00897b);font-weight:500}.s-searchable-dropdown-item-check{flex-shrink:0;color:var(--color-primary, #00897b);font-size:14px;margin-inline-start:8px}.s-searchable-dropdown-empty{display:flex;align-items:center;justify-content:center;padding:24px 16px;font-size:14px;color:var(--color-text-secondary, #9ca3af)}.s-searchable-dropdown-loading{display:flex;align-items:center;justify-content:center;padding:24px 16px;color:var(--color-text-secondary, #9ca3af)}.s-searchable-dropdown-spinner{width:20px;height:20px;animation:s-searchable-dropdown-spin 0.8s linear infinite}@keyframes s-searchable-dropdown-spin{to{transform:rotate(360deg)}}.visible{visibility:visible}.block{display:block}.hidden{display:none}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-scrollbar::-webkit-scrollbar{width:5px}.s-scrollbar::-webkit-scrollbar-track{background-color:#eee}.s-scrollbar::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}@media (min-width: 640px){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body:has(.s-searchable-dropdown--open){overflow:visible !important}}.s-searchable-dropdown{position:relative}.s-searchable-dropdown--open{z-index:9999}.s-searchable-dropdown-label{margin-bottom:0.5rem;display:block;font-size:0.875rem;line-height:1.25rem;font-weight:500;color:var(--color-text-primary,#374151)}.s-searchable-dropdown-required{color:var(--color-danger,#ef4444)}.s-searchable-dropdown-trigger{display:flex;min-height:40px;width:100%;cursor:pointer;align-items:center;justify-content:space-between;border-radius:0.375rem;border-width:1px;border-color:var(--color-border,#e5e7eb);background-color:var(--color-surface,#fff);padding-left:0.75rem;padding-right:0.75rem;padding-top:0.5rem;padding-bottom:0.5rem;text-align:start;font-size:0.875rem;line-height:1.25rem;transition-property:border-color,box-shadow;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-searchable-dropdown-trigger:hover{border-color:var(--color-border-hover,#d1d5db)}.s-searchable-dropdown-trigger:focus{border-color:var(--color-primary);--tw-shadow:0 0 0 1px var(--color-primary,#00897b);--tw-shadow-colored:0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}.s-searchable-dropdown-trigger--disabled{cursor:not-allowed;background-color:var(--color-surface-disabled,#f9fafb);opacity:0.5}.s-searchable-dropdown-trigger--open{border-color:var(--color-primary) !important;--tw-shadow:0 0 0 1px var(--color-primary,#00897b);--tw-shadow-colored:0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-searchable-dropdown-trigger-text{flex:1 1 0%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-primary,#111827)}.s-searchable-dropdown-trigger-placeholder{flex:1 1 0%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-trigger-icon{margin-inline-start:0.5rem;flex-shrink:0;font-size:1.125rem;line-height:1.75rem;color:var(--color-text-secondary,#9ca3af);transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-searchable-dropdown-trigger-icon--open{--tw-rotate:180deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-searchable-dropdown-panel{position:absolute;z-index:9999;margin-top:0.25rem;width:100%;overflow:hidden;border-radius:0.5rem;border-width:1px;border-color:var(--color-border,#e5e7eb);background-color:var(--color-surface,#fff);--tw-shadow:0 8px 24px rgba(0,0,0,0.12);--tw-shadow-colored:0 8px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-searchable-dropdown-panel--up{bottom:60%}.s-searchable-dropdown-search-wrap{display:flex;align-items:center;gap:0.5rem;border-bottom-width:1px;border-bottom-color:var(--color-border,#f3f4f6);padding-left:0.75rem;padding-right:0.75rem;padding-top:0.5rem;padding-bottom:0.5rem}.s-searchable-dropdown-search-icon{flex-shrink:0;font-size:1rem;line-height:1.5rem;color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-search-input{min-width:0px;flex:1 1 0%;border-width:0px;background-color:transparent;font-size:0.875rem;line-height:1.25rem;color:var(--color-text-primary,#111827);--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}.s-searchable-dropdown-search-input::placeholder{color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-search-input:focus{border-width:0px;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.s-searchable-dropdown-list{max-height:min(40vh, 220px);overflow-y:auto;scrollbar-width:thin}.s-searchable-dropdown-item{margin:0px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:space-between;gap:0.5rem;border-width:0px;border-bottom-width:1px;border-bottom-color:var(--color-border-light,#f9fafb);background-color:transparent;padding-left:1rem;padding-right:1rem;padding-top:0.625rem;padding-bottom:0.625rem;font-family:inherit;font-size:0.875rem;line-height:1.25rem;color:var(--color-text-primary,#111827);transition-property:background;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;text-align:inherit}.s-searchable-dropdown-item:last-child{border-bottom-width:0px}.s-searchable-dropdown-item--selected{background-color:color-mix(in srgb,var(--color-primary,#00897b) 8%,transparent)}.s-searchable-dropdown-item-name{flex:1 1 0%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.s-searchable-dropdown-item-name--selected{font-weight:500;color:var(--color-primary)}.s-searchable-dropdown-item-check{margin-inline-start:0.5rem;flex-shrink:0;font-size:0.875rem;line-height:1.25rem;color:var(--color-primary)}.s-searchable-dropdown-empty{display:flex;align-items:center;justify-content:center;padding-left:1rem;padding-right:1rem;padding-top:1.5rem;padding-bottom:1.5rem;font-size:0.875rem;line-height:1.25rem;color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-loading{display:flex;align-items:center;justify-content:center;padding-left:1rem;padding-right:1rem;padding-top:1.5rem;padding-bottom:1.5rem;color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-spinner{height:1.25rem;width:1.25rem}@keyframes spin{to{transform:rotate(360deg)}}.s-searchable-dropdown-spinner{animation:spin 0.8s linear infinite}";export{se as salla_bullet_delivery,re as salla_bullet_delivery_tag,le as salla_searchable_dropdown}