@salla.sa/twilight-components 3.0.18 → 3.0.20

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 (481) hide show
  1. package/dist/cjs/{Helper-D2VNt6eb.js → Helper-C3MBaLHQ.js} +1 -1
  2. package/dist/cjs/delivery-promise-intent-5WTKLkFZ.js +71 -0
  3. package/dist/cjs/{filepond-DkCudLhG.js → filepond-DGt10gCq.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-poster-C-uxFWfW.js → filepond-plugin-file-poster-NSV7ClY6.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-file-validate-size-BikXTQW2.js → filepond-plugin-file-validate-size-C08-fDj7.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-file-validate-type-Drs7PouU.js → filepond-plugin-file-validate-type-CbbTh4qd.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-edit-hxr0h9kt.js → filepond-plugin-image-edit-CqqtsmjD.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-exif-orientation-CVZmWU_4.js → filepond-plugin-image-exif-orientation-D60HJIiL.js} +1 -1
  9. package/dist/cjs/{filepond-plugin-image-preview-CBjPKx-d.js → filepond-plugin-image-preview-B7bWOXFm.js} +1 -1
  10. package/dist/cjs/helpers-wRMwEkLy.js +627 -0
  11. package/dist/cjs/{index-CTYg2zC6.js → index-U-OadFju.js} +14 -10
  12. package/dist/cjs/{intlTelInput-C9X0hKXV.js → intlTelInput-Cp6WJvPO.js} +1 -1
  13. package/dist/cjs/loader.cjs.js +2 -2
  14. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
  16. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +164 -7
  17. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-applied-filters.cjs.entry.js +2 -2
  21. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +13 -13
  23. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +435 -134
  26. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-comment-form_9.cjs.entry.js +4 -4
  32. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-delivery-promise.cjs.entry.js +5 -65
  38. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-filters-widget.cjs.entry.js +2 -2
  40. package/dist/cjs/salla-filters.cjs.entry.js +2 -2
  41. package/dist/cjs/salla-free-shipping-banner.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-free-shipping-tag.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-gift-card-redeem_2.cjs.entry.js +2 -2
  45. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
  48. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-login-modal.cjs.entry.js +7 -2
  52. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-mobile-update-modal.cjs.entry.js +188 -0
  63. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +4 -4
  64. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +6 -6
  65. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +2 -2
  66. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-notification-item_2.cjs.entry.js +3 -3
  68. package/dist/cjs/salla-offer-modal.cjs.entry.js +2 -2
  69. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-details.cjs.entry.js +2 -2
  75. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +2 -2
  77. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-order-items.cjs.entry.js +2 -2
  79. package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-order-payment.cjs.entry.js +2 -2
  81. package/dist/cjs/salla-order-rewards.cjs.entry.js +2 -2
  82. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-order-summary.cjs.entry.js +2 -2
  84. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-orders.cjs.entry.js +2 -2
  86. package/dist/cjs/salla-payments.cjs.entry.js +3 -3
  87. package/dist/cjs/salla-placeholder.cjs.entry.js +2 -2
  88. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-product-card-embed.cjs.entry.js +2 -2
  90. package/dist/cjs/salla-product-card.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-product-size-guide.cjs.entry.js +3 -3
  92. package/dist/cjs/salla-products-list.cjs.entry.js +9 -2
  93. package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
  94. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +33 -7
  96. package/dist/cjs/salla-rating-modal.cjs.entry.js +2 -2
  97. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +2 -2
  98. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-search-product-card.cjs.entry.js +3 -3
  101. package/dist/cjs/salla-search.cjs.entry.js +2 -2
  102. package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
  103. package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
  104. package/dist/cjs/salla-social.cjs.entry.js +2 -2
  105. package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
  106. package/dist/cjs/salla-thank-you-header.cjs.entry.js +2 -2
  107. package/dist/cjs/salla-thank-you-page.cjs.entry.js +2 -2
  108. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  109. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  110. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  111. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  112. package/dist/cjs/salla-user-settings.cjs.entry.js +2 -2
  113. package/dist/cjs/salla-verify.cjs.entry.js +3 -3
  114. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  115. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +2 -2
  116. package/dist/cjs/salla-wishlist-summary.cjs.entry.js +2 -2
  117. package/dist/cjs/twilight.cjs.js +2 -2
  118. package/dist/cjs/{vanilla-picker-BsLm8rHT.js → vanilla-picker-C-rN_NiT.js} +1 -1
  119. package/dist/collection/collection-manifest.json +1 -0
  120. package/dist/collection/components/salla-bullet-delivery/api-service.js +156 -25
  121. package/dist/collection/components/salla-bullet-delivery/helpers.js +166 -15
  122. package/dist/collection/components/salla-bullet-delivery/icons.js +17 -0
  123. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.css +490 -52
  124. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +423 -101
  125. package/dist/collection/components/salla-login-modal/salla-login-modal.js +6 -1
  126. package/dist/collection/components/salla-mobile-update-modal/salla-mobile-update-modal.css +43 -0
  127. package/dist/collection/components/salla-mobile-update-modal/salla-mobile-update-modal.js +235 -0
  128. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +1 -1
  129. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +2 -2
  130. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +4 -4
  131. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +1 -1
  132. package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +1 -1
  133. package/dist/collection/components/salla-notifications/salla-notification-item.js +1 -1
  134. package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +1 -1
  135. package/dist/collection/components/salla-order-details/salla-order-details.js +1 -1
  136. package/dist/collection/components/salla-order-edit/salla-order-edit-product-card.js +1 -1
  137. package/dist/collection/components/salla-order-items/salla-order-items.js +1 -1
  138. package/dist/collection/components/salla-order-payment/salla-order-payment.js +1 -1
  139. package/dist/collection/components/salla-order-rewards/salla-order-rewards.js +1 -1
  140. package/dist/collection/components/salla-order-summary/salla-order-summary.js +1 -1
  141. package/dist/collection/components/salla-payments/salla-payments.js +2 -2
  142. package/dist/collection/components/salla-placeholder/salla-placeholder.js +1 -1
  143. package/dist/collection/components/salla-product-availability/salla-product-availability.js +1 -1
  144. package/dist/collection/components/salla-product-card-embed/salla-product-card-embed.js +1 -1
  145. package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +2 -2
  146. package/dist/collection/components/salla-products-list/salla-products-list.js +7 -0
  147. package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +1 -1
  148. package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +91 -2
  149. package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +31 -5
  150. package/dist/collection/components/salla-review-card/salla-review-card.js +1 -1
  151. package/dist/collection/components/salla-review-factors-tags/salla-review-factors-tags.js +1 -1
  152. package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
  153. package/dist/collection/components/salla-search-product-card/salla-search-product-card.js +2 -2
  154. package/dist/collection/components/salla-searchable-dropdown/salla-searchable-dropdown.js +4 -4
  155. package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
  156. package/dist/collection/components/salla-social/salla-social.js +1 -1
  157. package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
  158. package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
  159. package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
  160. package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
  161. package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
  162. package/dist/collection/components/salla-thank-you-header/salla-thank-you-header.js +1 -1
  163. package/dist/collection/components/salla-thank-you-page/salla-thank-you-page.js +1 -1
  164. package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
  165. package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
  166. package/dist/collection/components/salla-verify/salla-verify.js +48 -2
  167. package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.js +1 -1
  168. package/dist/components/delivery-promise-intent.js +67 -0
  169. package/dist/components/helpers.js +322 -40
  170. package/dist/components/index.js +2 -2
  171. package/dist/components/mail.js +2 -2
  172. package/dist/components/salla-bullet-delivery.js +436 -129
  173. package/dist/components/salla-contacts.js +2 -2
  174. package/dist/components/salla-delivery-promise.js +1 -62
  175. package/dist/components/salla-login-modal2.js +6 -1
  176. package/dist/components/salla-loyalty-point2.js +2 -2
  177. package/dist/components/salla-mobile-update-modal.d.ts +11 -0
  178. package/dist/components/salla-mobile-update-modal.js +241 -0
  179. package/dist/components/salla-multiple-bundle-product-cart2.js +1 -1
  180. package/dist/components/salla-multiple-bundle-product-details2.js +2 -2
  181. package/dist/components/salla-multiple-bundle-product-options-modal2.js +4 -4
  182. package/dist/components/salla-multiple-bundle-product-slider2.js +1 -1
  183. package/dist/components/salla-multiple-bundle-product.js +1 -1
  184. package/dist/components/salla-notification-item2.js +1 -1
  185. package/dist/components/salla-offer-modal.js +1 -1
  186. package/dist/components/salla-order-details.js +1 -1
  187. package/dist/components/salla-order-edit-product-card.js +1 -1
  188. package/dist/components/salla-order-items2.js +1 -1
  189. package/dist/components/salla-order-payment.js +1 -1
  190. package/dist/components/salla-order-rewards.js +1 -1
  191. package/dist/components/salla-order-summary.js +1 -1
  192. package/dist/components/salla-payments.js +2 -2
  193. package/dist/components/salla-placeholder2.js +1 -1
  194. package/dist/components/salla-product-availability2.js +1 -1
  195. package/dist/components/salla-product-card-embed.js +1 -1
  196. package/dist/components/salla-product-size-guide.js +2 -2
  197. package/dist/components/salla-products-list2.js +7 -0
  198. package/dist/components/salla-quantity-input2.js +1 -1
  199. package/dist/components/salla-quick-buy2.js +161 -4
  200. package/dist/components/salla-quick-order.js +2 -2
  201. package/dist/components/salla-rating-modal-v22.js +33 -7
  202. package/dist/components/salla-rating-modal2.js +2 -2
  203. package/dist/components/salla-review-card2.js +1 -1
  204. package/dist/components/salla-review-factors-tags2.js +1 -1
  205. package/dist/components/salla-reviews-page.js +1 -1
  206. package/dist/components/salla-search-product-card2.js +2 -2
  207. package/dist/components/salla-searchable-dropdown2.js +4 -4
  208. package/dist/components/salla-skeleton2.js +1 -1
  209. package/dist/components/salla-social-share2.js +4 -4
  210. package/dist/components/salla-social.js +1 -1
  211. package/dist/components/salla-tab-content2.js +1 -1
  212. package/dist/components/salla-tab-header2.js +1 -1
  213. package/dist/components/salla-tabs2.js +1 -1
  214. package/dist/components/salla-tel-input2.js +1 -1
  215. package/dist/components/salla-thank-you-header.js +1 -1
  216. package/dist/components/salla-thank-you-page.js +1 -1
  217. package/dist/components/salla-tooltip2.js +1 -1
  218. package/dist/components/salla-user-settings.js +1 -1
  219. package/dist/components/salla-verify.js +1 -321
  220. package/dist/components/salla-verify2.js +328 -0
  221. package/dist/components/salla-wishlist-actions.js +1 -1
  222. package/dist/docs.json +158 -2
  223. package/dist/esm/{Helper-C1T-oD4J.js → Helper-BKruFMBN.js} +1 -1
  224. package/dist/esm/delivery-promise-intent-C6pZjRut.js +67 -0
  225. package/dist/esm/{filepond-BoWJzHeN.js → filepond-Vl6a--vT.js} +1 -1
  226. package/dist/esm/{filepond-plugin-file-poster-B6MkMtuC.js → filepond-plugin-file-poster-CrQqmzd5.js} +1 -1
  227. package/dist/esm/{filepond-plugin-file-validate-size-Dds_462B.js → filepond-plugin-file-validate-size-BrHjddJa.js} +1 -1
  228. package/dist/esm/{filepond-plugin-file-validate-type-DrfGXNay.js → filepond-plugin-file-validate-type-BeMZq9Fl.js} +1 -1
  229. package/dist/esm/{filepond-plugin-image-edit-CN7eGg-7.js → filepond-plugin-image-edit-DW6JzY39.js} +1 -1
  230. package/dist/esm/{filepond-plugin-image-exif-orientation-CyhxK_6R.js → filepond-plugin-image-exif-orientation-gzIIB75B.js} +1 -1
  231. package/dist/esm/{filepond-plugin-image-preview-DdKqAzT9.js → filepond-plugin-image-preview-BwbtnJIU.js} +1 -1
  232. package/dist/esm/helpers-BVaKfTMx.js +591 -0
  233. package/dist/esm/{index-DgUQRYr2.js → index-CrXKQnBu.js} +14 -10
  234. package/dist/esm/{intlTelInput-SwlavcFB.js → intlTelInput-BkjSbnO6.js} +1 -1
  235. package/dist/esm/loader.js +3 -3
  236. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  237. package/dist/esm/salla-accordion_6.entry.js +2 -2
  238. package/dist/esm/salla-add-product-button_5.entry.js +164 -7
  239. package/dist/esm/salla-advertisement.entry.js +1 -1
  240. package/dist/esm/salla-alert_2.entry.js +1 -1
  241. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  242. package/dist/esm/salla-applied-filters.entry.js +2 -2
  243. package/dist/esm/salla-apps-icons.entry.js +1 -1
  244. package/dist/esm/salla-attachment-view_9.entry.js +13 -13
  245. package/dist/esm/salla-badge.entry.js +1 -1
  246. package/dist/esm/salla-basket-gap.entry.js +1 -1
  247. package/dist/esm/salla-bullet-delivery_3.entry.js +435 -134
  248. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  249. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  250. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  251. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  252. package/dist/esm/salla-comment-factors.entry.js +1 -1
  253. package/dist/esm/salla-comment-form_9.entry.js +4 -4
  254. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  255. package/dist/esm/salla-contacts.entry.js +1 -1
  256. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  257. package/dist/esm/salla-count-down.entry.js +1 -1
  258. package/dist/esm/salla-custom-fields.entry.js +1 -1
  259. package/dist/esm/salla-delivery-promise.entry.js +3 -63
  260. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  261. package/dist/esm/salla-filters-widget.entry.js +2 -2
  262. package/dist/esm/salla-filters.entry.js +2 -2
  263. package/dist/esm/salla-free-shipping-banner.entry.js +1 -1
  264. package/dist/esm/salla-free-shipping-tag.entry.js +1 -1
  265. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  266. package/dist/esm/salla-gift-card-redeem_2.entry.js +2 -2
  267. package/dist/esm/salla-gifting.entry.js +1 -1
  268. package/dist/esm/salla-hook.entry.js +1 -1
  269. package/dist/esm/salla-infinite-scroll.entry.js +2 -2
  270. package/dist/esm/salla-installment.entry.js +1 -1
  271. package/dist/esm/salla-list-tile.entry.js +1 -1
  272. package/dist/esm/salla-localization-modal.entry.js +1 -1
  273. package/dist/esm/salla-login-modal.entry.js +7 -2
  274. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  275. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  276. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  277. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  278. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  279. package/dist/esm/salla-loyalty.entry.js +1 -1
  280. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  281. package/dist/esm/salla-map_3.entry.js +1 -1
  282. package/dist/esm/salla-menu.entry.js +1 -1
  283. package/dist/esm/salla-metadata.entry.js +1 -1
  284. package/dist/esm/salla-mobile-update-modal.entry.js +186 -0
  285. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +4 -4
  286. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +6 -6
  287. package/dist/esm/salla-multiple-bundle-product.entry.js +2 -2
  288. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  289. package/dist/esm/salla-notification-item_2.entry.js +3 -3
  290. package/dist/esm/salla-offer-modal.entry.js +2 -2
  291. package/dist/esm/salla-offer.entry.js +1 -1
  292. package/dist/esm/salla-order-branch.entry.js +1 -1
  293. package/dist/esm/salla-order-cancel.entry.js +1 -1
  294. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  295. package/dist/esm/salla-order-details-options.entry.js +1 -1
  296. package/dist/esm/salla-order-details.entry.js +2 -2
  297. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  298. package/dist/esm/salla-order-edit-product-card.entry.js +2 -2
  299. package/dist/esm/salla-order-edit.entry.js +1 -1
  300. package/dist/esm/salla-order-items.entry.js +2 -2
  301. package/dist/esm/salla-order-options-modal.entry.js +1 -1
  302. package/dist/esm/salla-order-payment.entry.js +2 -2
  303. package/dist/esm/salla-order-rewards.entry.js +2 -2
  304. package/dist/esm/salla-order-shipments.entry.js +1 -1
  305. package/dist/esm/salla-order-summary.entry.js +2 -2
  306. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  307. package/dist/esm/salla-orders.entry.js +2 -2
  308. package/dist/esm/salla-payments.entry.js +3 -3
  309. package/dist/esm/salla-placeholder.entry.js +2 -2
  310. package/dist/esm/salla-price-range.entry.js +1 -1
  311. package/dist/esm/salla-product-card-embed.entry.js +2 -2
  312. package/dist/esm/salla-product-card.entry.js +1 -1
  313. package/dist/esm/salla-product-size-guide.entry.js +3 -3
  314. package/dist/esm/salla-products-list.entry.js +9 -2
  315. package/dist/esm/salla-products-slider.entry.js +2 -2
  316. package/dist/esm/salla-quick-order.entry.js +1 -1
  317. package/dist/esm/salla-rating-modal-v2.entry.js +33 -7
  318. package/dist/esm/salla-rating-modal.entry.js +2 -2
  319. package/dist/esm/salla-review-factors-tags.entry.js +2 -2
  320. package/dist/esm/salla-review-order-item.entry.js +1 -1
  321. package/dist/esm/salla-scopes.entry.js +1 -1
  322. package/dist/esm/salla-search-product-card.entry.js +3 -3
  323. package/dist/esm/salla-search.entry.js +2 -2
  324. package/dist/esm/salla-skeleton.entry.js +2 -2
  325. package/dist/esm/salla-social-share.entry.js +2 -2
  326. package/dist/esm/salla-social.entry.js +2 -2
  327. package/dist/esm/salla-tab-content_3.entry.js +4 -4
  328. package/dist/esm/salla-thank-you-header.entry.js +2 -2
  329. package/dist/esm/salla-thank-you-page.entry.js +2 -2
  330. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  331. package/dist/esm/salla-trust-badges.entry.js +1 -1
  332. package/dist/esm/salla-user-menu.entry.js +1 -1
  333. package/dist/esm/salla-user-profile.entry.js +1 -1
  334. package/dist/esm/salla-user-settings.entry.js +2 -2
  335. package/dist/esm/salla-verify.entry.js +3 -3
  336. package/dist/esm/salla-wallet.entry.js +1 -1
  337. package/dist/esm/salla-wishlist-actions.entry.js +2 -2
  338. package/dist/esm/salla-wishlist-summary.entry.js +2 -2
  339. package/dist/esm/twilight.js +3 -3
  340. package/dist/esm/{vanilla-picker-Buy50D7t.js → vanilla-picker-eSagUASw.js} +1 -1
  341. package/dist/twilight/p-0050dd2a.entry.js +4 -0
  342. package/dist/twilight/{p-3d8b77f7.entry.js → p-012ff05c.entry.js} +1 -1
  343. package/dist/twilight/{p-08a15c81.entry.js → p-02ce2139.entry.js} +1 -1
  344. package/dist/twilight/{p-b0d2e31f.entry.js → p-059aa8a9.entry.js} +1 -1
  345. package/dist/twilight/{p-0d795b58.entry.js → p-09798a10.entry.js} +1 -1
  346. package/dist/twilight/p-0af7555c.entry.js +4 -0
  347. package/dist/twilight/{p-bed68e52.entry.js → p-11075f15.entry.js} +1 -1
  348. package/dist/twilight/{p-6e52b649.entry.js → p-12b2b553.entry.js} +1 -1
  349. package/dist/twilight/{p-8c1d14f0.entry.js → p-14fb124b.entry.js} +1 -1
  350. package/dist/twilight/{p-9e0a9a5a.entry.js → p-1ca3525d.entry.js} +1 -1
  351. package/dist/twilight/{p-7f97335a.entry.js → p-1f54638c.entry.js} +1 -1
  352. package/dist/twilight/{p-5694edf1.entry.js → p-201c816d.entry.js} +1 -1
  353. package/dist/twilight/{p-92fd20a0.entry.js → p-203b2723.entry.js} +1 -1
  354. package/dist/twilight/{p-1af9db24.entry.js → p-224c35e6.entry.js} +1 -1
  355. package/dist/twilight/{p-6dccd40f.entry.js → p-22bd8281.entry.js} +1 -1
  356. package/dist/twilight/{p-d4fb9921.entry.js → p-25ac8744.entry.js} +1 -1
  357. package/dist/twilight/{p-0ba159db.entry.js → p-25b964c0.entry.js} +1 -1
  358. package/dist/twilight/{p-da0df10b.entry.js → p-2a469c80.entry.js} +1 -1
  359. package/dist/twilight/{p-26d2b28a.entry.js → p-2a6f93a8.entry.js} +1 -1
  360. package/dist/twilight/{p-7fd9dc36.entry.js → p-2b0f98fc.entry.js} +1 -1
  361. package/dist/twilight/{p-259c995a.entry.js → p-2e66576c.entry.js} +1 -1
  362. package/dist/twilight/{p-be6f8551.entry.js → p-2e8e7cf2.entry.js} +1 -1
  363. package/dist/twilight/{p-ee479819.entry.js → p-2f05393f.entry.js} +1 -1
  364. package/dist/twilight/{p-1960020c.entry.js → p-3054e1c1.entry.js} +1 -1
  365. package/dist/twilight/{p-70dfb2b4.entry.js → p-3295390b.entry.js} +1 -1
  366. package/dist/twilight/{p-a95b0dc1.entry.js → p-33678067.entry.js} +1 -1
  367. package/dist/twilight/{p-c4cf0b4d.entry.js → p-33c05de2.entry.js} +1 -1
  368. package/dist/twilight/{p-d0ff9a3e.entry.js → p-381a9e70.entry.js} +1 -1
  369. package/dist/twilight/{p-f9e5ed10.entry.js → p-38270121.entry.js} +1 -1
  370. package/dist/twilight/{p-027cbda6.entry.js → p-385bf37d.entry.js} +1 -1
  371. package/dist/twilight/{p-d0aeeb7f.entry.js → p-40ee2ca3.entry.js} +1 -1
  372. package/dist/twilight/{p-cb48a5ef.entry.js → p-43a3401b.entry.js} +1 -1
  373. package/dist/twilight/{p-9d15f22d.entry.js → p-4616033a.entry.js} +1 -1
  374. package/dist/twilight/p-484af8cc.entry.js +4 -0
  375. package/dist/twilight/{p-516e4edc.entry.js → p-4b6627f5.entry.js} +1 -1
  376. package/dist/twilight/p-4ed8ae08.entry.js +4 -0
  377. package/dist/twilight/{p-6af8a7b6.entry.js → p-4fb442c2.entry.js} +1 -1
  378. package/dist/twilight/{p-4b70e6c4.entry.js → p-516f9b83.entry.js} +1 -1
  379. package/dist/twilight/{p-d1204965.entry.js → p-56aebb36.entry.js} +1 -1
  380. package/dist/twilight/{p-6b5de500.entry.js → p-56fbe5ff.entry.js} +1 -1
  381. package/dist/twilight/{p-66ad7a30.entry.js → p-58af47e4.entry.js} +1 -1
  382. package/dist/twilight/{p-3f842f32.entry.js → p-616e6781.entry.js} +1 -1
  383. package/dist/twilight/{p-254cff9a.entry.js → p-62077080.entry.js} +1 -1
  384. package/dist/twilight/p-6427664a.entry.js +4 -0
  385. package/dist/twilight/{p-bb8b2c85.entry.js → p-65253725.entry.js} +1 -1
  386. package/dist/twilight/{p-fcb1009f.entry.js → p-6a05f69c.entry.js} +1 -1
  387. package/dist/twilight/{p-ac736b30.entry.js → p-6afa5aa8.entry.js} +1 -1
  388. package/dist/twilight/{p-f7a58656.entry.js → p-6ff116eb.entry.js} +1 -1
  389. package/dist/twilight/{p-f9587127.entry.js → p-710b19d2.entry.js} +1 -1
  390. package/dist/twilight/{p-84b0e7a9.entry.js → p-71297800.entry.js} +1 -1
  391. package/dist/twilight/{p-53735934.entry.js → p-7234a066.entry.js} +1 -1
  392. package/dist/twilight/{p-b1f808f5.entry.js → p-73af6a02.entry.js} +1 -1
  393. package/dist/twilight/{p-4ab5ee99.entry.js → p-7428deca.entry.js} +1 -1
  394. package/dist/twilight/{p-b5a45f87.entry.js → p-75b509cd.entry.js} +1 -1
  395. package/dist/twilight/{p-071aa0e7.entry.js → p-79e446b2.entry.js} +1 -1
  396. package/dist/twilight/{p-eaf0c514.entry.js → p-7a8c9411.entry.js} +1 -1
  397. package/dist/twilight/{p-5f6fee0e.entry.js → p-86533832.entry.js} +1 -1
  398. package/dist/twilight/p-8a4af12c.entry.js +4 -0
  399. package/dist/twilight/{p-9cf1cfd4.entry.js → p-8ddf6933.entry.js} +1 -1
  400. package/dist/twilight/{p-7b5f97e7.entry.js → p-93fe31b9.entry.js} +1 -1
  401. package/dist/twilight/{p-4891c565.entry.js → p-9c96a9e7.entry.js} +1 -1
  402. package/dist/twilight/{p-CBLWEyM9.js → p-BNr49RmW.js} +1 -1
  403. package/dist/twilight/{p-DMvhNbgN.js → p-BUzdlb7Q.js} +1 -1
  404. package/dist/twilight/p-BVaKfTMx.js +4 -0
  405. package/dist/twilight/{p-BK9YeXWp.js → p-BYWjrTuB.js} +1 -1
  406. package/dist/twilight/{p-CCwsxMbZ.js → p-Bo_J3Do4.js} +1 -1
  407. package/dist/twilight/{p-CgNJWeaK.js → p-ChxhrML8.js} +1 -1
  408. package/dist/twilight/p-CrXKQnBu.js +5 -0
  409. package/dist/twilight/{p-Y2ZIN9Ok.js → p-D1oKTNWQ.js} +1 -1
  410. package/dist/twilight/{p-De1tLqQF.js → p-DUNRPrqt.js} +1 -1
  411. package/dist/twilight/{p-BxQMWsr9.js → p-DUuRpwsl.js} +1 -1
  412. package/dist/twilight/{p-NqQdbGu6.js → p-DZR3BP63.js} +1 -1
  413. package/dist/twilight/{p-12a25415.entry.js → p-a52a3664.entry.js} +1 -1
  414. package/dist/twilight/{p-d346dabd.entry.js → p-a7114995.entry.js} +1 -1
  415. package/dist/twilight/{p-8c40278d.entry.js → p-aa7494cd.entry.js} +1 -1
  416. package/dist/twilight/{p-34148827.entry.js → p-ae5d26da.entry.js} +1 -1
  417. package/dist/twilight/{p-d1121b3f.entry.js → p-b5434bcc.entry.js} +1 -1
  418. package/dist/twilight/p-b9fabd92.entry.js +4 -0
  419. package/dist/twilight/{p-bed54154.entry.js → p-bac38ed2.entry.js} +1 -1
  420. package/dist/twilight/{p-cdeb9bcc.entry.js → p-bbcfcdb0.entry.js} +1 -1
  421. package/dist/twilight/{p-f7ab5825.entry.js → p-c097cfa1.entry.js} +1 -1
  422. package/dist/twilight/p-c13e7efb.entry.js +4 -0
  423. package/dist/twilight/{p-bfd5e263.entry.js → p-d0ea4c3a.entry.js} +1 -1
  424. package/dist/twilight/{p-a44670a9.entry.js → p-d0ec7ca7.entry.js} +1 -1
  425. package/dist/twilight/{p-fddf1997.entry.js → p-d31fbdea.entry.js} +1 -1
  426. package/dist/twilight/{p-37192614.entry.js → p-d482d43e.entry.js} +1 -1
  427. package/dist/twilight/{p-b3ada3d0.entry.js → p-d5368882.entry.js} +1 -1
  428. package/dist/twilight/{p-4a3fa153.entry.js → p-d5a2a231.entry.js} +1 -1
  429. package/dist/twilight/{p-e457e68f.entry.js → p-d6705759.entry.js} +1 -1
  430. package/dist/twilight/p-d7f2a028.entry.js +4 -0
  431. package/dist/twilight/{p-0418c2df.entry.js → p-d84dedaf.entry.js} +1 -1
  432. package/dist/twilight/{p-419d6d71.entry.js → p-d8d9ff09.entry.js} +1 -1
  433. package/dist/twilight/{p-361f6033.entry.js → p-d902ad13.entry.js} +1 -1
  434. package/dist/twilight/{p-481f52b1.entry.js → p-d941dc58.entry.js} +1 -1
  435. package/dist/twilight/{p-8766e236.entry.js → p-dd046bbd.entry.js} +1 -1
  436. package/dist/twilight/{p-23772523.entry.js → p-dd21db09.entry.js} +1 -1
  437. package/dist/twilight/{p-3a632c69.entry.js → p-dd83b424.entry.js} +1 -1
  438. package/dist/twilight/{p-aa35cf98.entry.js → p-e04fb844.entry.js} +1 -1
  439. package/dist/twilight/{p-6c3084c9.entry.js → p-e60d784c.entry.js} +1 -1
  440. package/dist/twilight/{p-d8955835.entry.js → p-e6cc7742.entry.js} +1 -1
  441. package/dist/twilight/{p-5e8d019e.entry.js → p-e853ac07.entry.js} +1 -1
  442. package/dist/twilight/{p-0f25fedd.entry.js → p-e9ecae21.entry.js} +1 -1
  443. package/dist/twilight/{p-6ba3808a.entry.js → p-ebe3d316.entry.js} +1 -1
  444. package/dist/twilight/{p-5bbf17dd.entry.js → p-ec2a45fb.entry.js} +1 -1
  445. package/dist/twilight/{p-a5b732b3.entry.js → p-ef216c0a.entry.js} +1 -1
  446. package/dist/twilight/{p-78a56dc6.entry.js → p-f3306980.entry.js} +1 -1
  447. package/dist/twilight/{p-d9a1bf08.entry.js → p-f65205d5.entry.js} +1 -1
  448. package/dist/twilight/{p-e9b03e9c.entry.js → p-f6e5cd28.entry.js} +1 -1
  449. package/dist/twilight/{p-af49191f.entry.js → p-f8cfc9f7.entry.js} +1 -1
  450. package/dist/twilight/{p-9e65451e.entry.js → p-faa0b9aa.entry.js} +1 -1
  451. package/dist/twilight/{p-9e042cce.entry.js → p-fb10df18.entry.js} +1 -1
  452. package/dist/twilight/{p-e38a6793.entry.js → p-fcb1cff7.entry.js} +1 -1
  453. package/dist/twilight/{p-487b4411.entry.js → p-ff3cb99b.entry.js} +1 -1
  454. package/dist/twilight/{p-ee65c489.entry.js → p-ff4680ea.entry.js} +1 -1
  455. package/dist/twilight/p-oL7bxwey.js +9 -0
  456. package/dist/twilight/p-q5NJ0uS-.js +4 -0
  457. package/dist/twilight/twilight.esm.js +1 -1
  458. package/dist/types/components/salla-bullet-delivery/api-service.d.ts +23 -7
  459. package/dist/types/components/salla-bullet-delivery/helpers.d.ts +68 -6
  460. package/dist/types/components/salla-bullet-delivery/icons.d.ts +14 -0
  461. package/dist/types/components/salla-bullet-delivery/interfaces.d.ts +40 -1
  462. package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +73 -4
  463. package/dist/types/components/salla-mobile-update-modal/salla-mobile-update-modal.d.ts +44 -0
  464. package/dist/types/components/salla-quick-buy/salla-quick-buy.d.ts +18 -0
  465. package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +4 -0
  466. package/dist/types/components/salla-verify/salla-verify.d.ts +8 -0
  467. package/dist/types/components.d.ts +50 -0
  468. package/package.json +5 -5
  469. package/dist/cjs/helpers-8bMfm_mm.js +0 -329
  470. package/dist/esm/helpers-DqzaeXrL.js +0 -309
  471. package/dist/twilight/p-76584a5b.entry.js +0 -4
  472. package/dist/twilight/p-79822d99.entry.js +0 -4
  473. package/dist/twilight/p-Ca_SZn0u.js +0 -9
  474. package/dist/twilight/p-DgUQRYr2.js +0 -5
  475. package/dist/twilight/p-DqzaeXrL.js +0 -4
  476. package/dist/twilight/p-b9d67694.entry.js +0 -4
  477. package/dist/twilight/p-ba6dd59c.entry.js +0 -4
  478. package/dist/twilight/p-bac25e34.entry.js +0 -4
  479. package/dist/twilight/p-d1093a59.entry.js +0 -4
  480. package/dist/twilight/p-e24fbbb4.entry.js +0 -4
  481. package/dist/twilight/p-eefced26.entry.js +0 -4
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- const n="BulletDeliveryAPI",t=n=>{const t=null==n?Number.NaN:Number(n);return!Number.isNaN(t)&&0!==t};async function r(t,r,e){try{return await t()}catch(t){return console.error(`${n}: ${e}`,t),r}}const e=new Map;function a(n){const t=e.get(n);return!t||Date.now()-t.timestamp>3e5?(e.delete(n),null):t.data}function s(n,t){e.set(n,{data:t,timestamp:Date.now()})}const o=n=>"SA"===String(n).toUpperCase(),i={async getCountries(n=!1,t){const e=t?.trim()?null:"countries_"+(n?1:0);if(e){const n=a(e);if(n)return n}const i=await r((async()=>{const r={for_branch:n?1:0};return n&&(r.for_allocation=1),t?.trim()&&(r.query=t.trim()),((await salla.api.request("shipping/countries",{params:r}))?.data??[]).map((n=>({id:n.id,code:n.code,name:n.name,has_regions:o(n.code)})))}),[],"Error getting countries");return e&&i.length>0&&s(e,i),i},async getRegions(e,o){if(!t(e))return console.warn(`${n}: getRegions called without valid country_id`),[];const i=o?.trim()?null:`regions_${e}`;if(i){const n=a(i);if(n)return n}const c=await r((async()=>{const n={};return o?.trim()&&(n.query=o.trim()),((await salla.api.request(`shipping/countries/${e}/regions`,{params:n}))?.data??[]).map((n=>({id:n.id,name:n.name,code:n.code,country_id:Number(e)})))}),[],"Error fetching regions");return i&&c.length>0&&s(i,c),c},async getCities(e,o,i){if(!t(e))return console.warn(`${n}: getCities called without valid country_id`),[];const c=i?.trim()?null:`cities_${e}_${o||"all"}`;if(c){const n=a(c);if(n)return n}const l=await r((async()=>{const n={for_branch:0,country_id:e};return o&&(n.region_id=o),i?.trim()&&(n.query=i.trim()),((await salla.api.request("shipping/cities",{params:n}))?.data??[]).map((n=>({id:n.id,name:n.name,country_id:e,...null!=n.region_id&&{region_id:n.region_id}})))}),[],"Error fetching cities");return c&&l.length>0&&s(c,l),l},getDistricts:async(e,a)=>t(e)?r((async()=>{const n={for_branch:0,city_id:e};a?.trim()&&(n.query=a.trim());const t=(await salla.api.request("shipping/districts",{params:n}))?.data;return(Array.isArray(t)?t:Array.isArray(t?.districts)?t.districts:[]).map((n=>({id:n.id,name:n.name,name_en:n.name_en,city_id:e})))}),[],"Error fetching districts"):(console.warn(`${n}: getDistricts called without valid city_id`),[]),getSavedAddresses:async()=>r((async()=>{const n=(await salla.api.request("address"))?.data;return Array.isArray(n)?n:[]}),[],"Error fetching user addresses"),async getBranches({query:n,lat:t,lng:e,country_id:o,per_page:i=20}={}){const c=n?.trim()?.length>=2||t||e||!o?null:`branches_${o}`;if(c){const n=a(c);if(n)return n}const l=await r((async()=>{const r={per_page:i};n?.trim().length>=2&&(r.query=n),t&&(r.lat=t),e&&(r.lng=e),o&&(r.country_id=o);const a=await salla.api.request("branches",{params:r});return Array.isArray(a?.data)?a.data:[]}),[],"Error fetching branches");return c&&l.length>0&&s(c,l),l},saveAddressLocation:async n=>r((async()=>{const t=await salla.api.request("address/location",{...n,for_allocation:!0},"post"),r=t?.data??t;return{success:!0,address:"object"==typeof r&&null!=r&&"id"in r?r:void 0}}),{success:!1},"Error saving address/location"),setDeliveryScope:async n=>r((async()=>(await salla.api.withoutNotifier((()=>salla.scope.change({id:n}))),salla.storage.set("scope",{...salla.storage.get("scope")||{},id:n}),!0)),!1,"Error setting delivery scope"),async allocateScope(t){try{const n=await salla.api.withoutNotifier((()=>salla.api.request("scopes/allocation",t,"post")));return{success:!0,data:n?.data??n}}catch(t){console.error(`${n}: Error allocating scope`,t);const e=t;return{success:!1,error:null!=e?.response?.data?(r=e.response.data,r?.error?.message??r?.message??"Failed to allocate scope"):e?.message??"Unknown error"}}var r},getAddressToken:async()=>r((async()=>{const n=await salla.api.request("address/autocomplete-token");return n?.data?.token??null}),null,"Error fetching address autocomplete token")};function c(){e.clear()}const l=n=>n*(Math.PI/180);function u(n,t,r,e){const a=l(r-n),s=l(e-t),o=Math.sin(a/2)**2+Math.cos(l(n))*Math.cos(l(r))*Math.sin(s/2)**2;return 12742*Math.atan2(Math.sqrt(o),Math.sqrt(1-o))}const d=n=>{if(!n)return!1;const t=n.pickup_readiness?.selectable;return"boolean"==typeof t?t:!1!==n.is_open};function f(n,t,r){let e=null,a=Number.POSITIVE_INFINITY;for(const s of n){const n=null!=s.location?.lat?Number(s.location.lat):Number.NaN,o=null!=s.location?.lng?Number(s.location.lng):Number.NaN;if(Number.isNaN(n)||Number.isNaN(o)||!d(s))continue;const i=u(t,r,n,o);i<a&&(a=i,e=s)}return e}const y=(n,t)=>{if(!t)return n;const r=t.toLowerCase();return n.filter((n=>n.name.toLowerCase().includes(r)||n.city?.name?.toLowerCase().includes(r)))},p=(n,t,r)=>{if("branch"===n.type){const t=[n.branch_details?.country,n.branch_details?.city,n.branch_details?.district].filter(Boolean).join("، ");return t?`${r} ${t}`.trim():""}if("address"===n.type&&n.address_details){const r=[n.address_details.country?.name,n.address_details.city?.name,n.address_details.district?.name].filter(Boolean).join("، ")||n.address_details.short_address||"";return r?`${t} ${r}`.trim():""}return""},g=n=>null!=n?Number(n):void 0,h=n=>g(n?.address_details?.country?.id),m=n=>n?.country_code??n?.address_details?.country?.code??"",b=n=>g(n?.address_details?.region?.id),_=n=>g(n?.address_details?.city?.id),w=n=>g(n?.address_details?.district?.id),E=n=>n?.branch_details?.id,$=n=>n?.branch_details?.latitude,N=n=>n?.branch_details?.longitude,v=n=>!!n&&"address"===n.type&&null!=n.address_details?.lat&&null!=n.address_details?.lng,A=n=>{if(!n||"address"!==n.type||n.address_id)return!1;if(v(n))return!0;const t=h(n),r=_(n),e=w(n),a=m(n),s=null!=e&&0!==Number(e),i=Boolean(n.address_details?.district?.name?.trim()),c=!o(a)||s||i;return!!(t&&r&&c)},M=(n,t,r)=>!n||!o(n)||null!=t&&0!==Number(t)&&null!=r&&("number"==typeof r?0!==r:String(r).trim().length>0),P="undefined"!=typeof GeolocationPositionError?GeolocationPositionError.PERMISSION_DENIED:1,D="undefined"!=typeof GeolocationPositionError?GeolocationPositionError.POSITION_UNAVAILABLE:2,G="undefined"!=typeof GeolocationPositionError?GeolocationPositionError.TIMEOUT:3,S={[P]:"Location permission denied",[D]:"Location unavailable",[G]:"Location timeout"},k=n=>S[n]??"An error occurred while detecting location";export{o as a,i as b,N as c,_ as d,h as e,b as f,$ as g,A as h,v as i,w as j,d as k,y as l,E as m,f as n,k as o,c as p,p as q,M as r,m as s}
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as t,f as i,h as a,H as s,a as e}from"./p-DgUQRYr2.js";import{S as r,a as o}from"./p-cq6TcfoH.js";import{C as n}from"./p-BV4kqbdL.js";import{H as l}from"./p-DMvhNbgN.js";import{I as d}from"./p-C-tzSDxw.js";import{W as h}from"./p-CgR-T_ZS.js";import{M as m}from"./p-DmgxDvXL.js";import{b as c}from"./p-DrXX8XG8.js";function g(t){const i=t.split(/[?#]/,1)[0];return/\.(mp4|webm|mov|avi|mkv)$/i.test(i)}function p(t){return t.reduce(((t,i)=>i?(g(i)?t.videos.push(i):t.images.push(i),t):t),{images:[],videos:[]})}function u(t){return p(t.map((t=>t?.url||"")).filter(Boolean))}function f(t){return t?Array.isArray(t)?t.filter(Boolean):t.split(",").map((t=>t.trim())).filter(Boolean):[]}function w(t){return t.reduce(((t,i)=>(g(i?.url||"")?t.video+=1:t.image+=1,t)),{image:0,video:0})}function v(t,i){const a=String(i);let s=!1;return t.filter((t=>{const i=null!=t?.id?String(t.id):"",e=String(t?.url??"");return!(i===a||e===a)||!!s||(s=!0,!1)}))}function b(t,i,a){const{images:s,videos:e}=u(a);t&&(t.value=s.join(",")),i&&(i.value=e.join(","))}function y(t,i,a){i||delete t.images,a||delete t.videos}const _="600px",x=class{constructor(i){t(this,i),this.hasError=!1,this.showContactWidget=!0,this.errorMessage="",this.images=[],this.productImages={},this.editItemImages=[],this.productReviewFactors={},this.editFactorRatings={},this.productMainRatings={},this.productFactorRatings={},this.contact_body=(t,i,a)=>salla.lang.get("pages.rating.contact_subject",{store:t,id:i,customer:a}),this.editMode=!1,this.defaultMode=!1,this.deleteMode=!1,this.shouldOpenDeleteModal=!1,this.editItem=null,this.allowAttachImages=!1,this.allowAttachVideos=!1,this.allowContactSupport=!1,this.uploadCounts={},this.uploadImageCounts={},this.uploadVideoCounts={},this.hasUploadsInProgress=!1,this.loyaltyImageRatingPoints=0,this.dragAndDropFilesLabel=salla.lang.get("common.uploader.drag_and_drop_files"),this.contactSubjectLabel=salla.lang.get("pages.rating.contact_subject"),this.editReviewLabel=salla.lang.get("pages.rating.edit_review"),this.allowedImagesTypesLabel=salla.lang.get("common.uploader.allowed_images_types"),this.threeImagesMax=salla.lang.get("common.uploader.max_three_images"),this.areYouSureLabel=salla.lang.get("pages.rating.are_you_sure_you_want_to_delete_review"),this.confirmDeletionLabel=salla.lang.get("pages.rating.confirm_deletion"),this.cancelLabel=salla.lang.get("common.elements.cancel"),this.confirmDeleteBtn=salla.lang.get("common.elements.confirm_delete"),this.updatedSuccessfullyLabel=salla.lang.get("pages.rating.review_updated_successfully"),this.deletedSuccessfullyLabel=salla.lang.get("pages.rating.review_deleted_successfully"),this.nothingToRateLabel=salla.lang.get("pages.rating.nothing_to_rate"),this.contactUsLabel=salla.lang.get("blocks.footer.social"),this.requiredFactorsLabel=salla.lang.get("pages.rating.rate_required_factors"),this.rateTheFollowingLabel=salla.lang.get("pages.rating.rate_the_following_factors"),this.loyaltyPointsForImagesLabel=salla.lang.get("pages.rating.loyalty_points_for_images",{points:":points"}),this.contentRefs=[],this.hiddenInputs=[],this.hiddenVideoInputs=[],this.uploadingByProductId={},this.userFilledFactorKeys={},this.boundRatingRows=new WeakSet,this.stepsCount=0,this.currentIndex=0,this.submitted=[],this.isSubmitting=!1,this.thanksCountdownInterval=null,this.MAX_IMAGE_UPLOAD_LIMIT=10,this.MAX_VIDEO_UPLOAD_LIMIT=5,this.MAX_VIDEO_FILE_SIZE="100MB",this.MAX_VIDEO_DURATION=60,this.MAX_PARALLEL_UPLOADS=10,this.scheduleWizardSetup=!1}syncStoreSettings(){void 0===this.orderId&&(this.orderId=salla.config.get("page.id")),this.allowAttachImages=!!salla.config.get("store.settings.rating.allow_attach_images"),this.allowAttachVideos=!!salla.config.get("store.settings.rating.allow_attach_videos"),this.allowContactSupport=!!salla.config.get("store.settings.rating.allow_contact_support"),this.refreshMediaLabels()}canAttachMedia(){return this.allowAttachImages||this.allowAttachVideos}getMediaUploadAccept(){return c(this.allowAttachImages,this.allowAttachVideos)}refreshMediaLabels(){this.allowedImagesTypesLabel=this.getAllowedMediaTypesLabel(),this.threeImagesMax=this.getMaxUploadHintLabel()}getAllowedMediaTypesLabel(){return this.allowAttachImages&&this.allowAttachVideos?salla.lang.get("common.uploader.allowed_media_types"):this.allowAttachImages?salla.lang.get("common.uploader.allowed_images_types"):this.allowAttachVideos?salla.lang.get("common.uploader.allowed_videos_types"):""}getMaxUploadHintLabel(){return this.allowAttachImages&&this.allowAttachVideos?salla.lang.get("common.uploader.max_three_images"):this.allowAttachImages?salla.lang.get("common.uploader.max_images_count",{count:this.MAX_IMAGE_UPLOAD_LIMIT}):this.allowAttachVideos?salla.lang.get("common.uploader.max_videos_count",{count:this.MAX_VIDEO_UPLOAD_LIMIT}):""}setUploadCount(t,i,a,s){this.uploadCounts={...this.uploadCounts,[t]:i},null!=a&&(this.uploadImageCounts={...this.uploadImageCounts,[t]:a}),null!=s&&(this.uploadVideoCounts={...this.uploadVideoCounts,[t]:s})}setUploaderProcessing(t,i){this.uploadingByProductId={...this.uploadingByProductId,[t]:i},this.hasUploadsInProgress=Object.values(this.uploadingByProductId).some(Boolean)}scheduleUploaderHeightRefresh(){[50,150,350].forEach((t=>{setTimeout((()=>this.updateBodyHeight()),t)}))}handleGalleryCountUpdate(t,i){this.setUploadCount(t,i.count,i.imageCount,i.videoCount),this.setUploaderProcessing(t,!!i.uploading),this.scheduleUploaderHeightRefresh()}isUnverifiedReview(){return null===this.orderId&&!!this.productId}getRatingOrderId(){return this.orderId||salla.config.get("page.id")}getSubmitOrderId(){return this.orderId}isCustomerOrderShape(t){if(!t||"object"!=typeof t)return!1;const i=t;return!!i.rating&&(Array.isArray(i.items)||Array.isArray(i.products)||Array.isArray(i.rating?.product)||Array.isArray(i.rating?.products))}getBootstrapOrder(){const t=salla.config.get("page");if(this.isCustomerOrderShape(t))return t;if(t&&"object"==typeof t){const i=t;if(Array.isArray(i.products))return t;const a=i.order;if(this.isCustomerOrderShape(a))return a}}async loadCustomerOrderForEdit(){const t=this.getBootstrapOrder();if(t?.rating?.product||t?.rating?.products)this.order=t;else try{const t=await salla.api.withoutNotifier((()=>salla.order.api.getDetails(this.getRatingOrderId())));t?.data&&(this.order=t.data)}catch(t){if(!this.order){const t=await salla.api.withoutNotifier((()=>salla.rating.api.order(this.getRatingOrderId())));this.order=t.data}}}getOrderProductRatings(t=this.order){return t?.rating?[...this.normalizeToArray(t.rating.product),...this.normalizeToArray(t.rating.products)]:[]}getMatchedProductRating(t=this.order,i,a){return this.getOrderProductRatings(t).find((t=>Number(t?.id??t?.feedback_id)===Number(a)||Number(t?.product_id??t?.product?.id)===Number(i)))}hasRatingFeedback(t){const i=t?.rating;return null!=i&&""!==i&&Number(i)>0}isTestimonialsEnabled(t=this.order){return!(this.productId||!1===t?.testimonials_enabled||this.hasRatingFeedback(t?.store?.feedback)||!0!==t?.testimonials_enabled&&!t?.allowed_ratings?.testimonials_enabled)}isProductsEnabled(t=this.order){return!1!==t?.products_enabled&&this.getRateableProducts(t).length>0}isShippingEnabled(t=this.order){return!(this.productId||!1===t?.shipping_enabled||this.hasRatingFeedback(t?.shipping?.feedback)||!t?.shipping?.company||!0!==t?.shipping_enabled&&!t?.allowed_ratings?.shipping_enabled)}getOrderProducts(t=this.order){return Array.isArray(t?.products)?t.products.filter((t=>t?.product?.id)):[]}getRateableProducts(t=this.order){return this.getOrderProducts(t).filter((t=>!(this.hasRatingFeedback(t?.feedback)||this.productId&&String(t.product.id)!==String(this.productId))))}hasNothingToRate(t=this.order){if(!t)return!0;const i=!1!==t.testimonials_enabled&&(!0===t.testimonials_enabled||!!t.allowed_ratings?.testimonials_enabled),a=!(!t.shipping?.company||!1===t.shipping_enabled||!0!==t.shipping_enabled&&!t.allowed_ratings?.shipping_enabled),s=!1!==t.products_enabled&&this.getOrderProducts(t).length>0;return!i&&!a&&!s}getStepsCount(t=this.order){if(!t)return 0;let i=0;return this.isTestimonialsEnabled(t)&&i++,this.isProductsEnabled(t)&&(i+=this.getRateableProducts(t).length),this.isShippingEnabled(t)&&t.shipping?.company&&i++,i}afterOrderLoaded(){this.stepsCount=this.getStepsCount(),this.scheduleWizardSetup=!0,i(this)}async setOrder(t,i){this.orderId=t,this.productId=i,this.order=void 0,this.hasError=!1,this.errorMessage=void 0,this.showContactWidget=!0}async loadUnverifiedProductOrder(){const t=await salla.api.withoutNotifier((()=>salla.product.api.getDetails(this.productId))).catch((()=>null)),i=t?.data;this.order={products:[{feedback:void 0,product:{id:Number(this.productId),name:i?.name||"",thumbnail:i?.image?.url||salla.url.cdn("images/s-empty.png")}}],products_enabled:!0,testimonials_enabled:!1,shipping_enabled:!1,thanks_message:""},this.productReviewFactors=await this.fetchAllProductReviewFactors(this.order)}escapeHtml(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}getModalTitle(){if(this.isUnverifiedReview()){const t=this.escapeHtml(this.getRateableProducts()[0]?.product?.name||"");return`${salla.lang.get("pages.rating.rate")} ${t}`.trim()}return`${salla.lang.get("pages.rating.rate_order")} <span class="unicode">(#${this.order?.id})</span>`}async open(){await salla.onReady(),this.syncStoreSettings(),this.defaultMode=!0,this.currentIndex=0,this.submitted=[];const t=this.getRatingOrderId();return new Promise((i=>{setTimeout((()=>{this.modal?.open().then((()=>this.order&&this.order.id===t||(this.isUnverifiedReview()?this.loadUnverifiedProductOrder():salla.api.withoutNotifier((()=>salla.rating.api.order(t))).then((async t=>{this.order=t.data,this.productReviewFactors=await this.fetchAllProductReviewFactors(t.data)}))))).then((()=>this.readyUpLoyaltyPoints())).then((()=>this.modal?.setTitle(this.getModalTitle()))).then((()=>{const t={};for(const i of this.getRateableProducts())t[i.product.id]=[];this.productImages=t,this.uploadCounts=Object.fromEntries(Object.keys(t).map((t=>[Number(t),0])))})).then((()=>this.modal?.stopLoading())).then((()=>this.afterOrderLoaded())).catch((t=>{i(!1),this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data,this.modal?.stopLoading()})),i(!0)}),50)}))}async openEditModal(t){await salla.onReady(),this.syncStoreSettings(),this.defaultMode=!1,this.editMode=!0,this.editType=t.type,this.editFeedbackId=t.feedback_id;try{await this.fetchEditItem(t.feedback_id),await this.readyUpLoyaltyPoints(),"product"===this.editType&&this.editItem?.product?.id&&(await this.loadCustomerOrderForEdit(),await this.ensureProductFactorsLoaded(this.editItem.product.id),this.editFactorRatings={...this.buildEditFactorRatings(this.editItem.product.id)},this.markExistingFactorRatingsAsUserFilled(this.editItem.product.id,this.editFactorRatings)),this.editModal?.open(),"product"===this.editType&&this.canAttachMedia()&&this.scheduleUploaderHeightRefresh()}catch(t){this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data}}async fetchEditItem(t){const i=`rating/${t}/show`,a=await salla.api.request(i);if(this.editItem=a.data,this.canAttachMedia()&&"product"==this.editType){const t=(this.editItem.images||[]).filter(Boolean),i=(this.editItem.videos||[]).filter(Boolean);let a=[...t,...i];if(!i.length&&t.length){const i=p(t);a=[...i.images,...i.videos]}if(a=a.filter((t=>g(t)?this.allowAttachVideos:this.allowAttachImages)),a.length){this.editItemImages=a.map((t=>function(t){return{id:t,url:t}}(t)));const t=w(this.editItemImages);this.setUploadCount(this.editItem.product.id,this.editItemImages.length,t.image,t.video)}}}async editReview(){if(this.hasUploadsInProgress)return;const t=`rating/${this.editFeedbackId}`;let i;if("product"===this.editType){const t=this.editModal?.querySelector('[data-type="products"]')||this.currentTab;if(i=this.buildProductRatingPayload(this.collectFormData(t),t),!i.product_id&&this.editItem?.product?.id&&(i.product_id=String(this.editItem.product.id)),this.canAttachMedia()){const{images:t,videos:a}=u(this.editItemImages);this.allowAttachImages&&(i.images=t),this.allowAttachVideos&&(i.videos=a)}y(i,this.allowAttachImages,this.allowAttachVideos)}else i=this.collectFormData(this.editModal),i.images&&(i.images=f(i.images)),i.videos&&(i.videos=f(i.videos)),y(i,this.allowAttachImages,this.allowAttachVideos);await salla.api.request(t,i,"put").then((t=>{this.editModal?.close(),salla.notify.success(t.message||this.updatedSuccessfullyLabel),setTimeout((()=>{window.location.reload()}),500)}))}async openDeleteModal(t){return this.defaultMode=!1,this.deleteMode=!0,this.deleteFeedbackId=t.feedback_id,this.shouldOpenDeleteModal=!0,new Promise((t=>{setTimeout((()=>{this.deleteModal?.open().then((()=>t(!0)))}),50)}))}async deleteReview(){const t=`rating/${this.deleteFeedbackId}`;await salla.api.request(t,null,"delete").then((()=>{this.deleteModal?.close(),salla.notify.success(this.deletedSuccessfullyLabel),setTimeout((()=>{window.location.reload()}),500)}))}async close(){return this.modal?.close()}handleWizard(){if(this.steps=this.modal?.querySelectorAll(".s-rating-modal-step"),this.dots=this.modal?.querySelectorAll(".s-rating-modal-step-dot"),0===this.stepsCount)return this.hasNothingToRate()?(this.hasError=!0,void(this.errorMessage=this.nothingToRateLabel)):void this.showThankYou();this.showActiveStep()}refreshWizardRefs(){this.modal&&(this.steps=this.modal.querySelectorAll(".s-rating-modal-step"),this.dots=this.modal.querySelectorAll(".s-rating-modal-step-dot"))}showActiveStep(t=null){if(this.refreshWizardRefs(),this.currentTab=t||this.steps?.[this.currentIndex],!this.currentTab)return;l.toggleClassIf(".s-rating-modal-step-dot","s-rating-modal-bg-gray","s-rating-modal-bg-primary",(t=>t!=this.dots?.[this.currentIndex])).toggleClassIf(".s-rating-modal-step","s-rating-modal-active","s-rating-modal-hidden",(t=>t==this.currentTab)),0!==this.currentIndex&&(l.toggleElementClassIf(this.currentTab,"s-rating-modal-unactive","s-rating-modal-hidden",(()=>!0)),setTimeout((()=>l.toggleElementClassIf(this.currentTab,"s-rating-modal-active","s-rating-modal-unactive",(()=>!0))),300));const i=this.steps?.[this.currentIndex+1]?.dataset.type;this.nextBtn?.setText(i?`${salla.lang.get("pages.rating.rate")} ${salla.lang.get(`pages.rating.${i}`)}`:salla.lang.get("pages.rating.send_ratings")),setTimeout((()=>this.updateBodyHeight()),0),setTimeout((()=>this.updateBodyHeight()),150)}updateBodyHeight(){this.body&&this.currentTab&&(this.body.style.height="products"!==this.currentTab.dataset.type?`${this.currentTab.offsetHeight+(this.editMode?60:0)}px`:"auto")}previousTab(){this.currentIndex>0&&this.currentIndex--,l.toggleElementClassIf(this.backBtn,"s-rating-modal-unvisiable","block",(()=>0==this.currentIndex)),this.showActiveStep()}async submit(){if(!this.hasUploadsInProgress&&!this.isSubmitting){this.isSubmitting=!0;try{this.refreshWizardRefs(),this.submittedBefore()||this.validate(),salla.config.canLeave=!1,await(this.nextBtn?.load()),this.submittedBefore()||await this.sendFeedback(),this.currentTab?.querySelectorAll("[name],.s-rating-modal-btn-star").forEach((t=>t.setAttribute("disabled",""))),this.currentIndex<this.stepsCount&&this.currentIndex++,this.showActiveStep(),l.toggleClassIf("#prev-btn","block","s-rating-modal-unvisiable",(()=>!0)),this.currentIndex===this.stepsCount&&(this.showThankYou(),this.showContactWidget=!1)}finally{this.isSubmitting=!1,this.nextBtn?.stop(),salla.config.canLeave=!0}}}submittedBefore(){return this.submitted.includes(this.currentIndex)}getRatingHiddenInput(t){const i=t,a=i.querySelector?.(".rating_hidden_input");if(a?.name)return a;const s=i.querySelector?.("salla-rating-stars");return s?.shadowRoot?.querySelector(".rating_hidden_input")||null}collectNamedInputs(t){const i=new Set,a=[],s=t=>{t?.name&&!i.has(t)&&(i.add(t),a.push(t))};return t.querySelectorAll("[name]").forEach((t=>{t.closest("salla-file-upload")||s(t)})),t.querySelectorAll("salla-rating-stars").forEach((t=>{s(this.getRatingHiddenInput(t))})),a}normalizeFactorsList(t){return t?Array.isArray(t)?t:"object"==typeof t?Object.values(t).filter((t=>t&&"object"==typeof t)):[]:[]}validate(t=null,i=null){if(!t&&"products"===this.currentTab?.dataset?.type)return void this.currentTab.querySelectorAll(".rating-outer-form").forEach((t=>this.validate(t,"product")));const a=t??this.currentTab;if(!a)return;const s=a.querySelector(".s-rating-modal-product-rating-row-main"),e=this.getRatingHiddenInput(s||a),r=e?.value,o=a.querySelector(".s-rating-modal-validation-msg"),n=i||a.getAttribute("data-type");if(!r)throw o.innerHTML=salla.lang.get(`pages.rating.rate_${n}_stars`).replace(" (:item)",""),new Error(o.innerHTML);if("product"===n&&Array.from(a.querySelectorAll('.s-rating-modal-product-factor-row[data-required="true"]')).some((t=>{const i=this.getRatingHiddenInput(t);return!i?.value})))throw o.innerHTML=this.requiredFactorsLabel,new Error(o.innerHTML);o&&(o.innerHTML="")}collectFormData(t=this.currentTab){if(!t)return{};const i={};return this.collectNamedInputs(t).forEach((t=>{const a=salla.helpers.inputData(t.name,t.value,i);i[a.name]=a.value})),i}buildProductRatingPayload(t,i=this.currentTab){if(!i)return{};if(!t.rating){const a=i.querySelector(".s-rating-modal-product-rating-row-main"),s=this.getRatingHiddenInput(a||i);s?.value&&(t.rating=s.value)}const a=Number(t.product_id);let s=[],e=[];t.images?s=f(t.images):this.editMode&&this.canAttachMedia()&&a?s=u(this.editItemImages).images:this.canAttachMedia()&&a&&(s=u(this.productImages[a]||[]).images),t.videos?e=f(t.videos):this.editMode&&this.canAttachMedia()&&a?e=u(this.editItemImages).videos:this.canAttachMedia()&&a&&(e=u(this.productImages[a]||[]).videos);const r=this.normalizeFactorsList(t.factors).filter((t=>t?.id&&t?.rating)).map((t=>({id:String(t.id),rating:String(t.rating)}))),o={order_id:this.getSubmitOrderId(),product_id:String(t.product_id),rating:String(t.rating),comment:t.comment||t.content||"",factors:r,type:"products"};return this.allowAttachImages&&(o.images=s),this.allowAttachVideos&&(o.videos=e),o}async sendFeedback(){this.refreshWizardRefs();const t=this.currentTab?.dataset?.type;if("products"===t){const t=this.collectFormData(this.currentTab),i=this.buildProductRatingPayload(t,this.currentTab);if(!i.product_id||!i.rating)throw new Error("Missing product rating data");const a=await salla.rating.api.products(i);return this.submitted.push(this.currentIndex),a}const i=this.collectFormData(this.currentTab);if(0===Object.keys(i).length)return;if(i.order_id=this.getSubmitOrderId(),i.type=t,!t)return;const a=await salla.rating.api[t](i);return this.submitted.push(this.currentIndex),a}clearThanksCountdown(){null!==this.thanksCountdownInterval&&(clearInterval(this.thanksCountdownInterval),this.thanksCountdownInterval=null)}showThankYou(){let t=10;this.clearThanksCountdown(),this.thanksCountdownInterval=setInterval((()=>{this.thanksTime&&(this.thanksTime.innerHTML="00:0"+t--,t>0||(this.clearThanksCountdown(),this.thanksTime.remove(),this.close().then((()=>window.location.reload()))))}),1e3),this.modal?.querySelector(".s-rating-modal-footer")?.classList.add("s-rating-modal-unvisiable"),this.showActiveStep(this.thanksTab)}getFilepondPlaceholder(){return`<div class="s-rating-modal-filepond-placeholder"><span class="s-rating-modal-filepond-placeholder-icon">${d}</span><p class="s-rating-modal-filepond-placeholder-text">${this.dragAndDropFilesLabel}<br>\n <span> ${this.allowedImagesTypesLabel} <br> ${this.threeImagesMax} </span></p></div>`}getCustomerName(){return`${salla.config.get("user.first_name")||salla.storage.get("user.first_name")||""} ${salla.config.get("user.last_name")||salla.storage.get("user.last_name")||""}`}async readyUpLoyaltyPoints(){const t=salla.loyalty?.isFeatureEnabled?.();if(!t)return void(this.loyaltyImageRatingPoints=0);const i=salla.config.get("store.settings.rating.rating_product_points")||0,a=salla.config.get("store.settings.rating.rating_product_with_image_points")||0;this.loyaltyImageRatingPoints=Number(a)+Number(i)}loyaltyPointsNote(){if(!this.loyaltyImageRatingPoints||!this.loyaltyPointsForImagesLabel||this.isUnverifiedReview())return null;const t=a("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M10 0C13.6819 0 16.6667 2.98477 16.6667 6.66664C16.6667 9.37047 15.057 11.6984 12.7437 12.7444C11.6978 15.0575 9.3701 16.6666 6.66668 16.6666C2.98477 16.6666 0 13.6819 0 9.99998C0 7.29656 1.60918 4.96894 3.92195 3.92276C4.96827 1.60964 7.29618 0 10 0ZM6.66668 5C3.90524 5 1.66667 7.23856 1.66667 9.99998C1.66667 12.7614 3.90524 15 6.66668 15C9.4281 15 11.6667 12.7614 11.6667 9.99998C11.6667 7.23856 9.4281 5 6.66668 5ZM7.50002 5.83333V6.66664H9.16668V8.33331H5.83333C5.60322 8.33331 5.41667 8.51989 5.41667 8.74998C5.41667 8.95456 5.56407 9.12464 5.75844 9.15998L5.83333 9.16664H7.50002C8.6506 9.16664 9.58335 10.0994 9.58335 11.25C9.58335 12.4006 8.6506 13.3333 7.50002 13.3333V14.1666H5.83333V13.3333H4.16667V11.6666H7.50002C7.7301 11.6666 7.91668 11.4801 7.91668 11.25C7.91668 11.0455 7.76927 10.8753 7.57493 10.8401L7.50002 10.8333H5.83333C4.68274 10.8333 3.75 9.90056 3.75 8.74998C3.75 7.59939 4.68274 6.66664 5.83333 6.66664V5.83333H7.50002ZM10 1.66667C8.51377 1.66667 7.17893 2.31513 6.26313 3.34457C6.39704 3.33736 6.53138 3.33333 6.66668 3.33333C10.3486 3.33333 13.3333 6.3181 13.3333 9.99998C13.3333 10.1356 13.3293 10.2702 13.3213 10.4037C14.3513 9.48814 15 8.15314 15 6.66664C15 3.90524 12.7614 1.66667 10 1.66667Z",fill:"#008C56"}));return a("div",{class:"s-rating-modal-loyalty-points-note-container"},a("span",{class:"s-rating-modal-loyalty-points-note-icon"},t),a("p",{class:"s-rating-modal-loyalty-points-note-text"},this.loyaltyPointsForImagesLabel.replace(":points",String(this.loyaltyImageRatingPoints))))}normalizeReviewFactorsPayload(t){const i=t?.data??t?.factors;return Array.isArray(i)?i.flatMap((t=>{const i=Array.isArray(t?.items)?[...t.items]:null;if(i?.length){i.sort(((t,i)=>(Number(t?.sort)||0)-(Number(i?.sort)||0)));const a=!!t?.is_required;return i.filter((t=>null!=t?.id&&""!==t?.id)).map((t=>({id:t.id,name:t?.name,required:a})))}return null==t?.id||""===t?.id?[]:[{id:t.id,name:t?.name,required:t?.required??t?.is_required??!1}]})):[]}async fetchProductReviewFactors(t){try{const i=await salla.api.request(`review/factors/${t}/form`);return this.normalizeReviewFactorsPayload(i)}catch(t){return[]}}async fetchAllProductReviewFactors(t){const i=this.getRateableProducts(t);if(!i.length)return{};const a=await Promise.all(i.map((async t=>{const i=await this.fetchProductReviewFactors(t.product.id);return[t.product.id,i]})));return Object.fromEntries(a)}async ensureProductFactorsLoaded(t){if(!t||this.productReviewFactors[t])return;const i=await this.fetchProductReviewFactors(t);this.productReviewFactors={...this.productReviewFactors,[t]:i}}getFactorFieldName(t,i,a){return t?`${t}[factors][${i}][${a}]`:`factors[${i}][${a}]`}normalizeToArray(t){return null==t?[]:Array.isArray(t)?t:[t]}isFactorReviewsList(t){return Array.isArray(t)&&t.length>0&&t.every((t=>t&&"object"==typeof t&&(void 0!==t.rating||void 0!==t.stars||void 0!==t.value)))}getFactorReviewsFromRecord(t){if(!t)return[];for(const i of["factor_reviews","review_factors","factors"]){const a=t[i];if(this.isFactorReviewsList(a))return a}return[]}getEditFactorReviewsList(t){const i=[this.order,this.getBootstrapOrder()].filter(Boolean);for(const a of i){const i=this.getMatchedProductRating(a,t,this.editFeedbackId),s=this.getFactorReviewsFromRecord(i);if(s.length)return s}const a=this.getOrderProducts(this.order).find((i=>Number(i.product?.id)===Number(t))),s=[this.editItem?.factor_reviews,this.editItem?.review_factors,this.editItem?.product?.review_factors,this.editItem?.product?.factor_reviews,this.editItem?.factors,a?.factor_reviews,a?.review_factors,a?.feedback?.factor_reviews];for(const t of s)if(Array.isArray(t)&&t.length>0)return t;return[]}getFactorKey(t,i){return null!=t.id&&""!==t.id?`id:${t.id}`:t.name?`name:${t.name.trim()}`:`index:${i}`}getFactorRatingsForProduct(t){return this.editMode?this.editFactorRatings:this.productFactorRatings[t]||{}}setFactorRatingsForProduct(t,i){this.editMode?this.editFactorRatings=i:this.productFactorRatings={...this.productFactorRatings,[t]:i}}markExistingFactorRatingsAsUserFilled(t,i){const a=this.productReviewFactors[t]||[],s=new Set;a.forEach(((t,a)=>{const e=this.getFactorKey(t,a),r=void 0!==t.id?i[String(t.id)]:void 0,o=t.name?i[t.name.trim()]:void 0;void 0===r&&void 0===o&&void 0===i[`__index_${a}`]||s.add(e)})),this.userFilledFactorKeys[t]=s}shouldAutofillFactors(t){return t>=4}autofillUnfilledFactors(t,i){const a=this.productReviewFactors[t]||[];if(!a.length)return;const s=this.userFilledFactorKeys[t]||new Set,e={...this.getFactorRatingsForProduct(t)},r=this.shouldAutofillFactors(i);let o=!1;a.forEach(((t,a)=>{const n=this.getFactorKey(t,a);if(!s.has(n)){if(r)return void 0!==t.id&&(e[String(t.id)]=i),t.name&&(e[t.name.trim()]=i),e[`__index_${a}`]=i,void(o=!0);void 0!==t.id&&void 0!==e[String(t.id)]&&(delete e[String(t.id)],o=!0),t.name&&void 0!==e[t.name.trim()]&&(delete e[t.name.trim()],o=!0),void 0!==e[`__index_${a}`]&&(delete e[`__index_${a}`],o=!0)}})),o&&this.setFactorRatingsForProduct(t,e)}handleMainRatingChange(t,i){this.editMode?this.editMainRating=i:this.productMainRatings={...this.productMainRatings,[t]:i},this.autofillUnfilledFactors(t,i)}handleFactorRatingChange(t,i,a){this.userFilledFactorKeys[t]||(this.userFilledFactorKeys[t]=new Set),this.userFilledFactorKeys[t].add(i);const s=this.productReviewFactors[t]||[],e=s.findIndex(((t,a)=>this.getFactorKey(t,a)===i));if(e<0)return;const r=s[e],o={...this.getFactorRatingsForProduct(t)};void 0!==r.id&&(o[String(r.id)]=a),r.name&&(o[r.name.trim()]=a),o[`__index_${e}`]=a,this.setFactorRatingsForProduct(t,o)}setupProductRatingAutofill(t,i){t&&!this.boundRatingRows.has(t)&&(this.boundRatingRows.add(t),t.addEventListener("click",(a=>{const s=a.target;if(!s.closest(".s-rating-stars-btn-star"))return;const e=s.closest(".s-rating-modal-product-rating-row-main"),r=s.closest(".s-rating-modal-product-factor-row");requestAnimationFrame((()=>{if(e&&t.contains(e)){const t=Number(this.getRatingHiddenInput(e)?.value);t>0&&this.handleMainRatingChange(i,t)}else if(r&&t.contains(r)){const t=r.getAttribute("data-factor-key"),a=Number(this.getRatingHiddenInput(r)?.value);t&&a>0&&this.handleFactorRatingChange(i,t,a)}}))})))}buildEditFactorRatings(t){return this.getEditFactorReviewsList(t).reduce(((t,i,a)=>{const s=Number(i?.rating??i?.stars??i?.value);if(Number.isNaN(s))return t;const e=i?.id??i?.factor_id;return null!=e&&""!==e&&(t[String(e)]=s),i?.name&&(t[i.name.trim()]=s),t[`__index_${a}`]=s,t}),{})}renderProductStep(t,i){return a("section",{class:"s-rating-modal-step s-rating-modal-hidden","data-type":"products","data-product-id":t.product.id,key:t.product.id},a("div",{class:"s-rating-modal-product"},this.allowAttachImages&&this.loyaltyPointsNote(),a("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},a("div",{class:"s-rating-modal-product-details",ref:i=>i&&this.setupProductRatingAutofill(i,t.product.id)},a("div",{class:"s-rating-modal-step-wrap"},a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:t.product.thumbnail,alt:t.product.name,class:"s-rating-modal-product-img"})),a("h3",{class:"s-rating-modal-title"},t.product.name),a("p",{class:"s-rating-modal-subtitle"},salla.lang.get("pages.rating.write_product_rate")),this.renderProductMainRating(t.product.id,0,{fieldPrefix:""})),this.renderProductReviewFactors(t.product.id,0,{fieldPrefix:""}),a("input",{type:"hidden",name:"product_id",value:t.product.id}),a("textarea",{placeholder:salla.lang.get("pages.rating.write_product_rate"),name:"comment",class:"s-rating-modal-comment"}),a("small",{class:"s-rating-modal-validation-msg"}))),this.canAttachMedia()&&a("div",{class:"s-rating-modal-uploader is-opened",ref:t=>{t&&(this.contentRefs[i]=t)}},a("salla-file-upload",{name:"image",enableGallery:!0,maxImagesCount:this.allowAttachImages?this.MAX_IMAGE_UPLOAD_LIMIT:void 0,maxVideosCount:this.allowAttachVideos?this.MAX_VIDEO_UPLOAD_LIMIT:void 0,maxVideoFileSize:this.allowAttachVideos?this.MAX_VIDEO_FILE_SIZE:void 0,maxVideoDuration:this.allowAttachVideos?this.MAX_VIDEO_DURATION:void 0,maxParallelUploads:this.MAX_PARALLEL_UPLOADS,imagePreviewHeight:75,filePosterHeight:75,"instant-upload":!0,type:"feedback",payloadName:"files[]",id:`file-${t.product.id}`,title:t.product.name,allowMultiple:!0,instantUpload:!0,accept:this.getMediaUploadAccept(),url:salla.url.api("upload"),onUploaded:a=>{const s=t.product.id,e=[...this.productImages[s]||[],a.detail];this.productImages={...this.productImages,[s]:e};const r=w(e);this.setUploadCount(s,e.length,r.image,r.video),b(this.hiddenInputs[i],this.hiddenVideoInputs[i],e),this.scheduleUploaderHeightRefresh()},onRemoved:a=>{const s=a.detail,e=t.product.id;if(!s||!this.productImages[e])return;const r=v(this.productImages[e],s);this.productImages={...this.productImages,[e]:r};const o=w(r);this.setUploadCount(e,r.length,o.image,o.video),b(this.hiddenInputs[i],this.hiddenVideoInputs[i],r),this.scheduleUploaderHeightRefresh()},labelIdle:this.getFilepondPlaceholder(),onGalleryUpdated:i=>this.handleGalleryCountUpdate(t.product.id,i.detail)}),this.allowAttachImages&&a("input",{type:"hidden",name:"images",value:u(this.productImages[t.product.id]||[]).images.join(","),ref:t=>{t&&(this.hiddenInputs[i]=t)}}),this.allowAttachVideos&&a("input",{type:"hidden",name:"videos",value:u(this.productImages[t.product.id]||[]).videos.join(","),ref:t=>{t&&(this.hiddenVideoInputs[i]=t)}}),this.renderUploadedImagesCount(t.product.id))))}renderProductMainRating(t,i,s={}){const e=s.fieldPrefix??`products[${i}]`,r=e?`${e}[rating]`:"rating",o=Number(s.mainRating??(this.editMode?this.editMainRating:this.productMainRatings[t])),n=!Number.isNaN(o);return a("div",{class:"s-rating-modal-stars-product s-rating-modal-product-rating-row-main"},a("salla-rating-stars",{size:"large",name:r,key:n?`main-rating-${o}`:"main-rating-empty",value:n?o:void 0,editable:n,withLabel:!0}))}renderProductReviewFactors(t,i,s={}){const e=this.productReviewFactors[t]||[],r=s.fieldPrefix??`products[${i}]`,o={...this.editMode?{}:this.productFactorRatings[t]||{},...s.factorRatings||{}},n=(t,i)=>{const a=void 0!==t.id?o[String(t.id)]:void 0,s=t.name?o[t.name.trim()]:void 0,e=Number(a??s??o[`__index_${i}`]);return Number.isNaN(e)?void 0:e};if(!e.length)return null;const l=e.some((t=>t.required));return a("div",{class:"s-rating-modal-product-factors-card"},a("div",{class:"s-rating-modal-product-factors-heading"},this.rateTheFollowingLabel,l?a("span",{class:"s-rating-modal-product-factor-required"},"*"):""),a("div",{class:"s-rating-modal-product-rating-rows"},e.map(((t,i)=>a("div",{class:"s-rating-modal-product-rating-row s-rating-modal-product-factor-row","data-required":t.required?"true":"false","data-factor-key":this.getFactorKey(t,i)},a("input",{type:"hidden",name:this.getFactorFieldName(r,i,"name"),value:t.name}),!!t.id&&a("input",{type:"hidden",name:this.getFactorFieldName(r,i,"id"),value:String(t.id)}),a("span",{class:"s-rating-modal-product-factor-name"},t.name),a("salla-rating-stars",{size:"medium",name:this.getFactorFieldName(r,i,"rating"),key:`factor-rating-${t.id??i}-${n(t,i)??0}`,value:n(t,i),editable:s.alwaysEditable||"number"==typeof n(t,i),tag:!1}))))))}handleSendEmail(){if(!this.order)return;const t=`${this.contactSubjectLabel} #${this.order.id}`,i=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),a=`mailto:${salla.config.get("store.contacts.email")}?subject=${encodeURIComponent(t)}&body=${encodeURIComponent(i)}`;window.open(a,"_blank")}handleSendWhatsApp(){if(!this.order)return;const t=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),i=`https://wa.me/${salla.config.get("store.contacts.whatsapp")}?text=${encodeURIComponent(t)}`;window.open(i,"_blank")}resetData(t){t.detail||(this.clearThanksCountdown(),this.modal?.close(),this.editItem=null,this.editItemImages=[],this.editFactorRatings={},this.productMainRatings={},this.productFactorRatings={},this.editMainRating=void 0,this.userFilledFactorKeys={},this.uploadingByProductId={},this.hasUploadsInProgress=!1,this.hiddenInputs[1]&&(this.hiddenInputs[1].value=""),this.editHiddenVideosInput&&(this.editHiddenVideosInput.value=""),this.body&&(this.body.style.height="",this.body.style.minHeight=""),this.deleteFeedbackId=void 0,this.editFeedbackId=void 0,this.shouldOpenDeleteModal=!1,this.editMode=!1,this.deleteMode=!1,this.defaultMode=!1,this.currentIndex=0,this.submitted=[],this.scheduleWizardSetup=!1,this.loyaltyImageRatingPoints=0)}getDeleteModal(){return a("salla-modal",{ref:t=>{t&&(this.deleteModal=t)},width:"xs",onModalVisibilityChanged:t=>this.resetData(t)},a("div",{class:"s-rating-modal-delete-wrapper",ref:t=>{t&&(this.body=t)}},a("h3",null,this.confirmDeletionLabel),a("p",null,this.areYouSureLabel),a("div",{class:"s-rating-modal-delete-actions"},a("salla-button",{loaderPosition:"center",onClick:()=>this.deleteReview()},this.confirmDeleteBtn),a("salla-button",{color:"danger",fill:"outline",onClick:()=>this.deleteModal?.close()},this.cancelLabel))))}renderUploadedImagesCount(t){const i=w(this.editMode?this.editItemImages:this.productImages[t]||[]),s=this.uploadImageCounts[t]??i.image,e=this.uploadVideoCounts[t]??i.video;return this.allowAttachImages&&this.allowAttachVideos?a("span",{class:"s-rating-modal-upload-count"},salla.lang.get("pages.rating.media_count",{imageCurrent:s,imageTotal:this.MAX_IMAGE_UPLOAD_LIMIT,videoCurrent:e,videoTotal:this.MAX_VIDEO_UPLOAD_LIMIT})):this.allowAttachImages?a("span",{class:"s-rating-modal-upload-count"},salla.lang.choice("pages.rating.images_count",s,{current:s,total:this.MAX_IMAGE_UPLOAD_LIMIT})):this.allowAttachVideos?a("span",{class:"s-rating-modal-upload-count"},salla.lang.choice("pages.rating.videos_count",e,{current:e,total:this.MAX_VIDEO_UPLOAD_LIMIT})):null}getEditModal(){return a("salla-modal",{ref:t=>{t&&(this.editModal=t)},width:"custom",customWidth:_,onModalVisibilityChanged:t=>this.resetData(t)},a("div",{class:"s-rating-modal-edit-wrapper",ref:t=>{t&&(this.body=t)}},"store"===this.editType&&this.editItem?a("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step","data-type":"store",ref:t=>{t&&(this.currentTab=t)}},a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:salla.config.get("store.logo","https://assets.salla.sa/cp/assets/images/logo-new.png"),alt:"store name",class:"s-rating-modal-store-logo"})),a("h2",{class:"s-rating-modal-title"},salla.config.get("store.name")),a("p",{class:"s-rating-modal-subtitle"},salla.lang.get("pages.rating.rate_the_store")),a("div",{class:"s-rating-modal-stars-company"},a("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),a("textarea",{name:"content",value:this.editItem.content,class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),a("small",{class:"s-rating-modal-validation-msg"})):null,"shipping"===this.editType&&this.editItem?a("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step","data-type":"shipping",ref:t=>{t&&(this.currentTab=t)}},this.editItem.shipping.logo?a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:this.editItem.shipping.logo,class:"s-rating-modal-shipping-logo",alt:this.editItem.shipping.name})):a("span",{class:"s-rating-modal-icon",innerHTML:r}),a("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.editItem.shipping.name}`),a("p",{class:"s-rating-modal-subtitle"},salla.lang.get("pages.rating.write_shipping_rate")),a("div",{class:"s-rating-modal-stars-company"},a("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),a("textarea",{name:"content",class:"s-rating-modal-comment",value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),a("small",{class:"s-rating-modal-validation-msg"})):null,"product"==this.editType&&this.editItem?a("section",{class:"s-rating-modal-step","data-type":"products",ref:t=>{t&&(this.currentTab=t)}},a("div",{class:"s-rating-modal-product"},this.allowAttachImages&&this.loyaltyPointsNote(),a("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},a("div",{class:"s-rating-modal-product-details",ref:t=>t&&this.setupProductRatingAutofill(t,this.editItem.product.id)},a("div",{class:"s-rating-modal-step-wrap"},a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:this.editItem.product.image.url,alt:this.editItem.product.name,class:"s-rating-modal-product-img"})),a("h3",{class:"s-rating-modal-title"},this.editItem.product.name),a("p",{class:"s-rating-modal-subtitle"},salla.lang.get("pages.rating.write_product_rate")),this.renderProductMainRating(this.editItem.product.id,0,{fieldPrefix:"",mainRating:this.editMainRating??Number(this.editItem.stars??this.editItem.rating)})),this.renderProductReviewFactors(this.editItem.product.id,0,{fieldPrefix:"",factorRatings:this.editFactorRatings,alwaysEditable:!0}),a("input",{type:"hidden",name:"product_id",value:this.editItem.product.id}),a("textarea",{value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_product_rate"),name:"comment",class:"s-rating-modal-comment"}),a("small",{class:"s-rating-modal-validation-msg"}))),this.canAttachMedia()&&a("div",{class:"s-rating-modal-uploader is-opened",ref:t=>{t&&(this.contentRefs[1]=t)}},a("salla-file-upload",{name:"images",allowMultiple:!0,enableGallery:!0,maxImagesCount:this.allowAttachImages?this.MAX_IMAGE_UPLOAD_LIMIT:void 0,maxVideosCount:this.allowAttachVideos?this.MAX_VIDEO_UPLOAD_LIMIT:void 0,maxVideoFileSize:this.allowAttachVideos?this.MAX_VIDEO_FILE_SIZE:void 0,maxVideoDuration:this.allowAttachVideos?this.MAX_VIDEO_DURATION:void 0,maxParallelUploads:this.MAX_PARALLEL_UPLOADS,imagePreviewHeight:75,filePosterHeight:75,"instant-upload":!0,type:"feedback",files:JSON.stringify(this.editItemImages),payloadName:"files[]",id:`file-${this.editItem.product.id}`,title:this.editItem.product.name,instantUpload:!0,accept:this.getMediaUploadAccept(),url:salla.url.api("upload"),onUploaded:t=>{this.editItemImages=[...this.editItemImages,t.detail];const i=w(this.editItemImages);this.setUploadCount(this.editItem.product.id,this.editItemImages.length,i.image,i.video),b(this.hiddenInputs[1],this.editHiddenVideosInput,this.editItemImages),this.scheduleUploaderHeightRefresh()},onRemoved:t=>{const i=t.detail;if(!i)return;this.editItemImages=v(this.editItemImages,i);const a=w(this.editItemImages);this.setUploadCount(this.editItem.product.id,this.editItemImages.length,a.image,a.video),b(this.hiddenInputs[1],this.editHiddenVideosInput,this.editItemImages),this.scheduleUploaderHeightRefresh()},labelIdle:this.getFilepondPlaceholder(),onGalleryUpdated:t=>this.handleGalleryCountUpdate(this.editItem.product.id,t.detail)}),this.allowAttachImages&&a("input",{type:"hidden",name:"images",value:u(this.editItemImages).images.join(","),ref:t=>{t&&(this.hiddenInputs[1]=t)}}),this.allowAttachVideos&&a("input",{type:"hidden",name:"videos",value:u(this.editItemImages).videos.join(","),ref:t=>{t&&(this.editHiddenVideosInput=t)}}),this.renderUploadedImagesCount(this.editItem.product.id)))):null,a("div",{class:"s-rating-modal-footer s-rating-modal-footer-end"},a("salla-button",{"loader-position":"center",loading:this.hasUploadsInProgress,disabled:this.hasUploadsInProgress,onClick:()=>this.editReview()},this.editReviewLabel))))}render(){return this.deleteMode?a(s,{class:"s-rating-modal"},this.getDeleteModal()):this.editMode?a(s,{class:"s-rating-modal"},this.getEditModal()):this.defaultMode?a(s,{class:"s-rating-modal"},a("salla-modal",{class:"s-rating-modal-wrap",onModalVisibilityChanged:t=>this.resetData(t),isLoading:!0,width:"custom",customWidth:_,ref:t=>{t&&(this.modal=t)}},a("div",{slot:"loading"},a("div",{class:"s-rating-modal-skeleton"},a("salla-skeleton",{type:"circle",height:"80px",width:"80px"}),a("salla-skeleton",{height:"15px",width:"60%"}),a("salla-skeleton",{height:"10px",width:"30%"}),a("div",{class:"s-rating-modal-skeleton-stars"},[...Array(5)].map((t=>a("div",{key:t,innerHTML:o})))),a("salla-skeleton",{height:"100px",width:"100%"}),a("div",{class:"s-rating-modal-skeleton-footer"},a("salla-skeleton",{height:"40px",width:"30%"})))),!this.hasError&&this.order?[a("div",{class:"s-rating-modal-wrapper",ref:t=>{t&&(this.body=t)}},this.isTestimonialsEnabled()?a("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"store"},a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:salla.config.get("store.logo","https://assets.salla.sa/cp/assets/images/logo-new.png"),alt:"store name",class:"s-rating-modal-store-logo"})),a("h2",{class:"s-rating-modal-title"},salla.config.get("store.name")),a("p",{class:"s-rating-modal-subtitle"},salla.lang.get("pages.rating.rate_the_store")),a("div",{class:"s-rating-modal-stars-company"},a("salla-rating-stars",{withLabel:!0,size:"large"})),a("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),a("small",{class:"s-rating-modal-validation-msg"})):"",this.isProductsEnabled()&&this.getRateableProducts().map(((t,i)=>this.renderProductStep(t,i))),this.isShippingEnabled()&&this.order.shipping?.company?a("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"shipping"},a("input",{type:"hidden",name:"shipping_company_id",value:this.order.shipping.company.id}),this.order.shipping.company.logo?a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:this.order.shipping.company.logo,class:"s-rating-modal-shipping-logo",alt:this.order.shipping.company.name})):a("span",{class:"s-rating-modal-icon",innerHTML:r}),a("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.order.shipping.company.name}`),a("p",{class:"s-rating-modal-subtitle"},salla.lang.get("pages.rating.write_shipping_rate")),a("div",{class:"s-rating-modal-stars-company"},a("salla-rating-stars",{withLabel:!0,size:"large"})),a("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),a("small",{class:"s-rating-modal-validation-msg"})):"",a("div",{class:"s-rating-modal-thanks s-rating-modal-hidden",ref:t=>{t&&(this.thanksTab=t)}},a("span",{class:"s-rating-modal-icon",innerHTML:n}),a("h3",{class:"s-rating-modal-thanks-title"},salla.lang.get("pages.rating.thanks")),a("div",{class:"s-rating-modal-thanks-msg",innerHTML:this.order.thanks_message}),a("time",{class:"s-rating-modal-thanks-time",ref:t=>{t&&(this.thanksTime=t)}}))),this.allowContactSupport&&this.showContactWidget&&(salla.config.get("store.contacts.whatsapp")||salla.config.get("store.contacts.email"))?a("div",{class:"s-rating-modal-contact"},a("p",null,this.contactUsLabel),a("div",{class:"s-rating-modal-contact-icons"},salla.config.get("store.contacts.whatsapp")&&a("span",{onClick:()=>this.handleSendWhatsApp(),innerHTML:h}),salla.config.get("store.contacts.email")&&a("span",{onClick:()=>this.handleSendEmail(),innerHTML:m}))):"",a("div",{class:"s-rating-modal-footer"},a("button",{ref:t=>{t&&(this.backBtn=t)},onClick:()=>this.previousTab(),class:"s-rating-modal-btn s-rating-modal-unvisiable"},salla.lang.get("common.elements.back")),this.stepsCount>1?a("ul",{class:"s-rating-modal-dots"},[...Array(this.stepsCount)].map(((t,i)=>a("li",{key:i,class:"s-rating-modal-bg-gray s-rating-modal-step-dot"})))):"",a("salla-button",{"loader-position":"center",loading:this.hasUploadsInProgress,disabled:this.hasUploadsInProgress,ref:t=>{t&&(this.nextBtn=t)},onClick:()=>this.submit()},salla.lang.get("common.elements.next")))]:a("div",{class:"s-rating-modal-wrapper"},a("salla-placeholder",{alignment:"center"},this.errorMessage?a("span",{slot:"description"},this.errorMessage):null)))):void 0}async componentWillLoad(){await salla.onReady(),await salla.lang.onLoaded(),this.registerTranslations(),this.syncStoreSettings()}registerTranslations(){salla.lang.addBulk({"common.uploader.drag_and_drop_files":{ar:"اسحب الملفات وأفلتها هنا",en:"Drag and drop files here"},"common.uploader.allowed_images_types":{ar:" .jpg أو jpeg أو png يُسمح بإضافة صور بصيغة",en:"Images in jpg, jpeg, or png format are allowed."},"pages.rating.add_images":{ar:"اضافة صور",en:"Add Images"},"pages.rating.edit_images":{ar:"تعديل الصور",en:"Edit Images"},"pages.rating.edit_review":{ar:"تعديل التقييم",en:"Edit review"},"pages.rating.confirm_deletion":{ar:"تأكيد حذف التقييم",en:"Confirm review deletion"},"pages.rating.are_you_sure_you_want_to_delete_review":{ar:"هل أنت متأكد من حذف تقييمك؟",en:"Are you sure you want to delete your review?"},"pages.rating.review_updated_successfully":{ar:"تم تعديل التقييم بنجاح",en:"The review has been successfully updated."},"pages.rating.review_deleted_successfully":{ar:"تم حذف التقييم بنجاح",en:"The review has been successfully deleted."},"pages.rating.images_count":{ar:"الصور ( :current من أصل :total )",en:"Images ( :current of :total )"},"pages.rating.media_count":{ar:"الصور (:imageCurrent/:imageTotal) · الفيديو (:videoCurrent/:videoTotal)",en:"Images (:imageCurrent/:imageTotal) · Videos (:videoCurrent/:videoTotal)"},"common.uploader.allowed_videos_types":{ar:"يُسمح بفيديوهات mp4 أو mov أو avi أو mkv",en:"Videos in mp4, mov, avi, or mkv format are allowed."},"pages.rating.videos_count":{ar:"الفيديو ( :current من أصل :total )",en:"Videos ( :current of :total )"},"common.uploader.allowed_media_types":{ar:"يُسمح بصور jpg أو jpeg أو png وفيديوهات mp4 أو mov أو avi أو mkv",en:"Images in jpg, jpeg, or png and videos in mp4, mov, avi, or mkv are allowed."},"common.uploader.max_three_images":{ar:"أضف حتى 10 صور و 5 فيديوهات كحد أقصى",en:"Add up to 10 images and 5 videos maximum."},"common.uploader.max_images_count":{ar:"أضف :count صور كحد أقصى",en:"Add up to :count images maximum."},"common.uploader.max_videos_count":{ar:"أضف :count فيديوهات كحد أقصى",en:"Add up to :count videos maximum."},"common.elements.confirm_delete":{ar:"تأكيد الحذف",en:"Confirm deletion"},"pages.rating.rate_required_factors":{ar:"يرجى تقييم جميع المعايير لإتمام مراجعتك.",en:"Please rate all required factors to complete your review."},"pages.rating.overall_product_rating":{ar:"التقييم العام للمنتج",en:"Overall product rating"},"pages.rating.rate_the_following_factors":{ar:"كيف تقيِّم التالي؟",en:"How would you rate the following?"},"pages.rating.loyalty_points_for_images":{ar:"شاركنا صورة مع تقييمك للطلب واكسب :points نقطة ولاء",en:"Share a photo with your order review and earn :points loyalty points"},"pages.rating.nothing_to_rate":{ar:"لا يوجد شيء متاح للتقييم في هذا الطلب حاليًا.",en:"There is nothing available to rate for this order right now."}}),this.contactUsLabel=salla.lang.get("blocks.footer.social"),this.dragAndDropFilesLabel=salla.lang.get("common.uploader.drag_and_drop_files"),this.allowedImagesTypesLabel=this.getAllowedMediaTypesLabel(),this.threeImagesMax=this.getMaxUploadHintLabel(),this.contactSubjectLabel=salla.lang.get("pages.rating.contact_subject"),this.editReviewLabel=salla.lang.get("pages.rating.edit_review"),this.areYouSureLabel=salla.lang.get("pages.rating.are_you_sure_you_want_to_delete_review"),this.confirmDeletionLabel=salla.lang.get("pages.rating.confirm_deletion"),this.cancelLabel=salla.lang.get("common.elements.cancel"),this.updatedSuccessfullyLabel=salla.lang.get("pages.rating.review_updated_successfully"),this.deletedSuccessfullyLabel=salla.lang.get("pages.rating.review_deleted_successfully"),this.nothingToRateLabel=salla.lang.get("pages.rating.nothing_to_rate"),this.confirmDeleteBtn=salla.lang.get("common.elements.confirm_delete"),this.requiredFactorsLabel=salla.lang.get("pages.rating.rate_required_factors"),this.rateTheFollowingLabel=salla.lang.get("pages.rating.rate_the_following_factors"),this.loyaltyPointsForImagesLabel=salla.lang.get("pages.rating.loyalty_points_for_images",{points:":points"}),this.contact_body=(t,i,a)=>salla.lang.get("pages.rating.contact_body",{store:t,id:i,customer:a})}componentDidRender(){this.scheduleWizardSetup&&this.defaultMode&&this.order&&(this.scheduleWizardSetup=!1,requestAnimationFrame((()=>this.handleWizard())))}disconnectedCallback(){this.clearThanksCountdown()}get host(){return e(this)}};x.style='/*!twlt*/.s-rating-modal-uploader{overflow:visible}.s-rating-modal-uploader.is-opened{height:auto !important;opacity:1 !important;overflow:visible;pointer-events:auto !important;margin-bottom:1rem}.s-rating-modal-uploader .s-file-upload-gallery{overflow:visible}.s-rating-modal-edit-wrapper,.s-rating-modal-wrapper{transition:height 0.15s ease}.s-rating-modal-product-details{padding-bottom:0.5rem}.s-rating-modal-comment{margin-top:0.35rem}.s-rating-modal-product{margin-bottom:1rem}.s-rating-modal-product-img{position:absolute !important;inset:0;display:block;width:100% !important;max-width:100% !important;height:100% !important;object-fit:cover}.s-rating-modal-product-title{font-size:0.95rem;font-weight:600;line-height:1.5;margin:0}.s-rating-modal-stars-product{margin-top:0.5rem}.s-rating-modal-loyalty-points-note-container{display:flex;align-items:center;gap:0.625rem;width:100%;margin-top:1.5rem;margin-bottom:0.75rem;padding:0.75rem;border-radius:0.5rem;background-color:#E6F4EA}.s-rating-modal-loyalty-points-note-icon{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;color:#1B7F5C}.s-rating-modal-loyalty-points-note-icon svg{width:1.5rem;height:1.5rem;fill:currentColor}.s-rating-modal-loyalty-points-note-text{flex:1;margin:0;font-size:0.875rem;line-height:1.25rem;color:#1f2937}.s-rating-modal-product-details-main{display:flex;align-items:center;margin-bottom:0.5rem;padding-bottom:0;border-bottom:0}.s-rating-modal-product-info-row{display:flex;align-items:center;gap:0.6rem;margin-bottom:0.5rem;padding-bottom:0;border-bottom:0}.s-rating-modal-product-main-review{width:100%;text-align:right}.s-rating-modal-product-rating-rows{display:grid;gap:0.45rem;margin:0.2rem 0 0.7rem}.s-rating-modal-product-rating-row{display:flex;align-items:center;justify-content:space-between;gap:0.75rem;min-height:2rem}.s-rating-modal-product-rating-row salla-rating-stars{flex-shrink:0}.s-rating-modal-product-rating-row .s-rating-stars-wrapper{align-items:center;min-height:1.75rem}.s-rating-modal-product-rating-row .s-rating-stars-label,.s-rating-modal-product-rating-row .s-rating-stars-label-without-tag{min-width:auto;min-height:1.25rem;line-height:1.25rem;font-size:0.8rem;color:#5b6470;white-space:nowrap;text-align:end;transition:opacity 0.15s ease}.s-rating-modal-product-rating-row .s-rating-stars-label--empty,.s-rating-modal-product-rating-row .s-rating-stars-label-without-tag--empty{opacity:0}.s-rating-modal-product-factor-name{color:#5b6470;font-size:0.9rem;line-height:1.25}.s-rating-modal-product-factor-required{color:#f87171;margin-inline-start:0.2rem}.s-rating-modal-product-img-wrap{position:relative;width:5rem !important;min-width:5rem !important;max-width:5rem !important;height:3.5rem !important;flex-shrink:0 !important;overflow:hidden;border-radius:0.375rem;background:#f3f4f6}.s-rating-modal-uploader-closing{animation:s-rating-modal-uploader-close 220ms linear both}@keyframes s-rating-modal-uploader-close{0%{height:var(--s-rating-modal-uploader-from);opacity:1}9.09%{height:calc(var(--s-rating-modal-uploader-from) * 0.979);opacity:0.979}18.18%{height:calc(var(--s-rating-modal-uploader-from) * 0.913);opacity:0.913}27.27%{height:calc(var(--s-rating-modal-uploader-from) * 0.83);opacity:0.83}36.36%{height:calc(var(--s-rating-modal-uploader-from) * 0.749);opacity:0.749}45.45%{height:calc(var(--s-rating-modal-uploader-from) * 0.673);opacity:0.673}54.55%{height:calc(var(--s-rating-modal-uploader-from) * 0.577);opacity:0.577}63.64%{height:calc(var(--s-rating-modal-uploader-from) * 0.355);opacity:0.355}72.73%{height:calc(var(--s-rating-modal-uploader-from) * 0.136);opacity:0.136}81.82%{height:calc(var(--s-rating-modal-uploader-from) * 0.035);opacity:0.035}90.91%{height:calc(var(--s-rating-modal-uploader-from) * 0.005);opacity:0.005}100%{height:0;opacity:0}}.mt-0{margin-top:0px}.block{display:block}.inline{display:inline}.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)}.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)}.s-comments-item-like-btn{margin-top:0.5rem}.s-comments-item-like-btn .s-button-text{display:flex;flex-direction:row-reverse;gap:0.5rem}.s-comments-item-like-btn span svg{height:0.75rem;width:0.75rem}.s-rating-modal-wrapper{margin-bottom:1.5rem;transition-property:all;transition-duration:100ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.s-rating-modal-edit-wrapper{margin-top:0.625rem}.s-rating-modal-footer{position:relative;display:flex;align-items:center;justify-content:space-between}.s-rating-modal-footer salla-button button{padding-left:1rem !important;padding-right:1rem !important;font-size:0.75rem !important}.s-rating-modal-btn{height:2.5rem;padding-left:1rem;padding-right:1rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-rating-modal-btn:hover{color:var(--color-primary-dark)}.s-rating-modal-dots{display:flex;flex-shrink:0;flex-grow:1;justify-content:center}.s-rating-modal-dots>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.375rem * var(--tw-space-x-reverse));margin-left:calc(0.375rem * calc(1 - var(--tw-space-x-reverse)))}.s-rating-modal-dots{text-align:center}.s-rating-modal-dots:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-rating-modal-step-dot{height:0.625rem;width:0.625rem;border-radius:9999px;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-rating-modal-step{transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-rating-modal-active{--tw-translate-x:0px;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));opacity:1}.s-rating-modal-unactive{--tw-translate-x:0.75rem;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));opacity:0}.s-rating-modal-hidden{display:none !important}.s-rating-modal-unvisiable{pointer-events:none;opacity:0}.s-rating-modal-step-wrap{position:relative;display:flex;flex-direction:column;align-items:center;padding-bottom:1rem}.s-rating-modal-product-details{position:relative;display:flex;flex:1 1 0%;flex-direction:column;padding-bottom:1rem}.s-rating-modal-product-details-main{display:flex;align-items:flex-start;justify-content:space-between}.s-rating-modal-product-details-main .s-rating-stars-wrapper{margin-bottom:0.375rem;flex-direction:column;align-items:center}@media (min-width: 640px){.s-rating-modal-product-details-main .s-rating-stars-wrapper{margin-bottom:0px;flex-direction:row;gap:0px}}.s-rating-modal-rounded-icon{position:relative;margin-bottom:0.25rem;display:flex;height:6rem;width:6rem;align-items:center;justify-content:center;overflow:hidden;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-rating-modal-title{margin-bottom:0.25rem;font-size:1.125rem;line-height:1.75rem;font-weight:700}.s-rating-modal-subtitle{margin-bottom:0.25rem;padding-left:0.5rem;padding-right:0.5rem;text-align:center;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-rating-modal-store-logo{width:4rem;object-fit:contain}.s-rating-modal-shipping-logo{height:100%;width:100%;object-fit:contain}.s-rating-modal-shipping-icon{font-size:3rem;line-height:1;color:var(--color-primary)}.s-rating-modal-comment{margin-bottom:0.5rem;height:5rem !important;width:100%;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:0.75rem;font-size:0.875rem;line-height:1.25rem;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-rating-modal-comment:focus{border-color:var(--color-primary)}.s-rating-modal-comment: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))}.s-rating-modal-validation-msg{margin-top:-3px;line-height:1rem;--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-rating-modal-product{margin-bottom:1.5rem}.s-rating-modal-product:last-child{margin-bottom:0px}.s-rating-modal-product .rating-outer-form{display:flex}.s-rating-modal-product .rating-outer-form>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}@media (min-width: 640px){.s-rating-modal-product .rating-outer-form>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}}.s-rating-modal-product .rating-outer-form:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-rating-modal-product-img-wrap{height:3.5rem;width:auto;overflow:hidden;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}@media (min-width: 640px){.s-rating-modal-product-img-wrap{width:5rem}}.s-rating-modal-product-img{position:relative;height:100%;width:100%;object-fit:cover;font-size:0px}.s-rating-modal-product-img::before{position:absolute;top:0px;left:0px;height:100%;width:100%;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-rating-modal-product-title{margin-bottom:0.375rem;font-size:0.875rem;font-weight:700;line-height:1.25rem}.s-rating-modal-thanks{padding-left:2rem;padding-right:2rem;text-align:center;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-rating-modal-icon{display:inline-flex;height:5rem;width:5rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));color:var(--color-primary)}.s-rating-modal-icon svg{height:1.75rem;width:1.75rem;fill:var(--color-primary)}.s-rating-modal-thanks-title{margin-top:1rem;font-weight:700}.s-rating-modal-thanks-msg{margin-bottom:1.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-rating-modal-thanks-btn{height:2.5rem;flex:none;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}.s-rating-modal-thanks-btn:hover{opacity:0.8}.s-rating-modal-thanks-btn{border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-rating-modal-thanks-time{margin-top:0.75rem;display:block;height:1.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-rating-modal-product-factors-card{margin-bottom:1rem;border-radius:0.5rem;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));padding:1rem}.s-rating-modal-product-factors-heading{margin-bottom:0.75rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-rating-modal-stars-company{margin-bottom:1.25rem}.s-rating-modal-stars-company .s-rating-stars-wrapper{flex-direction:column;align-items:center;justify-content:center;gap:0.5rem}.s-rating-modal-stars-product .s-rating-stars-wrapper{flex-direction:column;align-items:center;justify-content:center}.s-rating-modal-upload-count{font-size:0.875rem;line-height:1.25rem;font-weight:500}.s-rating-modal-bg-gray{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-rating-modal-bg-primary{background-color:var(--color-primary)}unicode{unicode-bidi:plaintext}.s-rating-modal-wrap .s-modal-body{position:relative !important}.s-rating-modal-skeleton{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-rating-modal-skeleton salla-skeleton:nth-child(1){margin-bottom:1.25rem}.s-rating-modal-skeleton salla-skeleton:nth-child(2){margin-bottom:0.75rem}.s-rating-modal-skeleton salla-skeleton:nth-child(3){margin-bottom:1.25rem}.s-rating-modal-skeleton salla-skeleton:nth-child(4){margin-bottom:2rem}.s-rating-modal-skeleton-footer{margin-top:1.5rem;display:flex;width:100%;justify-content:flex-end}.s-rating-modal-skeleton-footer salla-skeleton{margin-bottom:0px !important}.s-rating-modal-skeleton-stars{margin-bottom:0.75rem;display:flex;align-items:center}.s-rating-modal-skeleton-stars>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}.s-rating-modal-skeleton-stars:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-rating-modal-skeleton-stars div svg{width:25px;fill:currentColor;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-rating-modal-uploader{height:0px;opacity:0;transition-property:all;transition-duration:100ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.s-rating-modal-uploader.is-opened{margin-bottom:1.5rem;overflow:visible}.s-rating-modal-uploader.is-closed{pointer-events:none;z-index:0}.s-rating-modal-uploader .filepond--drop-label{--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-rating-modal-uploader .filepond--file-status .filepond--file-status-main{font-size:11px}.s-rating-modal-uploader .filepond--file-info-main{font-size:11px}.s-rating-modal-uploader li[data-filepond-item-state=\'load-invalid\'] .filepond--file-info{display:none}.s-rating-modal-filepond-placeholder-text{font-size:0.75rem !important;line-height:1rem !important}.s-rating-modal-filepond-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-rating-modal-filepond-placeholder-icon{margin-bottom:0.25rem}.s-rating-modal-filepond-placeholder-icon svg{height:1.5rem;width:1.5rem;fill:#7c8082}.s-rating-modal-contact{margin-bottom:1rem;display:flex;align-items:center;justify-content:space-between;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding:0.5rem}.s-rating-modal-contact p{font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-rating-modal-contact-icons{display:flex;align-items:center;gap:0.5rem}.s-rating-modal-contact-icons span{display:flex;cursor:pointer;align-items:center;justify-content:center;border-radius:0.375rem;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:0.375rem}.s-rating-modal-contact-icons span svg{height:1rem;width:1rem;fill:var(--color-primary)}.s-rating-modal-footer-end{justify-content:flex-end}.s-rating-modal-delete-wrapper{text-align:center}.s-rating-modal-delete-wrapper h3{margin-top:1.25rem;font-size:1.125rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-rating-modal-delete-wrapper p{margin-top:1.25rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-rating-modal-delete-actions{margin-top:1.25rem;display:flex;align-items:center;gap:0.625rem}.s-rating-modal-delete-actions salla-button{width:100%}.s-rating-modal-delete-actions salla-button button{width:100%}';export{x as salla_rating_modal_v2}
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as e,h as r}from"./p-DgUQRYr2.js";import{s as t}from"./p-BQHBj1u_.js";import{m as a,a as i}from"./p-DfHdQUMm.js";const o=class{constructor(r){e(this,r),this.logoFailed=!1}resetLogo(){this.logoFailed=!1}async componentWillLoad(){await salla.onReady(),await salla.lang.onLoaded()}charged(e){return null!=e&&/[1-9١-٩۱-۹]/.test(String(e))}row(e,t,o=!1,s=""){if(null==t||""===t)return null;const n=Number(t);return r("div",{class:{"s-order-payment-row":!0,"s-order-payment-total":o}},r("dt",null,e),Number.isFinite(n)?r("dd",{innerHTML:s+a(n,this.currency)}):r("dd",{innerHTML:i(String(t))}))}get discountList(){try{const e="string"==typeof this.discounts?JSON.parse(this.discounts):this.discounts;return Array.isArray(e)?e.map((e=>{const r=Math.abs(Number(e?.amount??e?.discount)),t="string"==typeof e?.discount?e.discount:"",a=Number.isFinite(r)&&r>0&&(!t||this.currency);return{name:e?.name,amount:a?r:t}})).filter((e=>"string"==typeof e.amount||e.amount>0)):[]}catch{return[]}}render(){const e=t(this.invoiceUrl);return r("section",{key:"315ef59766e984af72300af056bf8a6b920abbee",class:"s-order-payment-wrapper"},r("dl",{key:"ef6dec3310faaaaeafcfe3eb8ca1d0567949a005",class:"s-order-payment-list"},r("div",{key:"dd63e14441f534433d2e9b409015fcefe48fe5d3",class:"s-order-payment-row"},r("dt",{key:"a799bda3655a1efb1abb37edd24a1951083e8f1f"},salla.lang.get("pages.cart.payment_way")),r("dd",{key:"6bf67863696911d79ada40086eb9a8b8f1001145"},this.paymentLogo&&!this.logoFailed?r("span",{class:"s-order-payment-logo"},r("img",{src:this.paymentLogo,alt:this.paymentMethod||"",loading:"lazy",onError:()=>{this.logoFailed=!0}})):this.paymentMethod)),this.row(salla.lang.get("pages.thank_you.sub_total"),this.subTotal),this.discountList.map((e=>this.row(e.name,e.amount,!1,"string"==typeof e.amount?"":"-"))),this.charged(this.taxAmount)?this.row(salla.lang.get("pages.cart.tax"),this.taxAmount):null,this.charged(this.shippingCost)?this.row(salla.lang.get("pages.orders.shipping_cost"),this.shippingCost):null,this.charged(this.codCost)?this.row(salla.lang.get("pages.cart.cash_on_delivery"),this.codCost):null,this.row(salla.lang.get("pages.orders.final_total"),this.total,!0)),e?r("a",{href:e,target:"_blank",rel:"noopener","data-testid":"store-thankyou-payment-view-invoice",class:"s-order-payment-invoice"},r("span",{"aria-hidden":"true",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>receipt</title>\n<path d="M21.333 18.667h-10.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h10.667c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM21.333 10.667h-10.667c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h10.667c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333zM27.263 1.473c-0.453-0.225-0.993-0.176-1.396 0.127l-2.66 1.995-2.739-2.568c-0.513-0.48-1.311-0.48-1.824 0l-2.644 2.479-2.643-2.479c-0.513-0.48-1.311-0.48-1.824 0l-2.74 2.568-2.66-1.995c-0.407-0.303-0.945-0.352-1.396-0.127-0.452 0.227-0.737 0.688-0.737 1.193v26.667c0 0.505 0.285 0.967 0.737 1.193 0.451 0.223 0.992 0.176 1.396-0.127l2.66-1.995 2.739 2.568c0.513 0.481 1.311 0.481 1.824 0l2.644-2.479 2.643 2.477c0.256 0.241 0.584 0.361 0.912 0.361s0.656-0.12 0.912-0.361l2.739-2.568 2.661 1.996c0.404 0.304 0.944 0.351 1.396 0.127 0.452-0.227 0.737-0.688 0.737-1.193v-26.667c0-0.505-0.285-0.967-0.737-1.193zM25.333 26.667l-1.421-1.067c-0.519-0.388-1.239-0.352-1.712 0.093l-2.644 2.477-2.643-2.477c-0.257-0.24-0.585-0.36-0.913-0.36s-0.656 0.12-0.912 0.361l-2.643 2.477-2.644-2.477c-0.473-0.445-1.195-0.481-1.712-0.093l-1.423 1.065v-21.333l1.421 1.067c0.517 0.388 1.237 0.348 1.712-0.093l2.644-2.479 2.643 2.479c0.513 0.48 1.311 0.48 1.824 0l2.643-2.479 2.644 2.479c0.473 0.443 1.195 0.483 1.712 0.093l1.424-1.067z"></path>\n</svg>\n'}),salla.lang.get("pages.thank_you.view_invoice")):null)}static get watchers(){return{paymentLogo:["resetLogo"]}}};o.style='/*!twlt*/:host{display:block}.-my-1{margin-top:-0.25rem;margin-bottom:-0.25rem}.-my-1\\.5{margin-top:-0.375rem;margin-bottom:-0.375rem}.hidden{display:none}.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-order-payment-wrapper{display:flex;width:100%;flex-direction:column;align-items:flex-end;gap:1rem;border-radius:0.5rem;border-width:1px;border-color:var(--color-border-light,#f4f4f4);background-color:var(--color-surface,#fff);padding:1rem}@media (min-width: 640px){.s-order-payment-wrapper{padding:1.5rem}}.s-order-payment-list{margin:0px;display:flex;width:100%;flex-direction:column;gap:0.75rem}.s-order-payment-row{display:flex;width:100%;align-items:center;gap:1rem;font-size:0.875rem;line-height:1.25rem;color:var(--color-text-secondary,#666)}.s-order-payment-row dt{flex:1 1 0%;text-align:start}.s-order-payment-row dd{margin:0px;display:flex;align-items:center;gap:0.25rem}.s-order-payment-logo{margin-top:-0.375rem;margin-bottom:-0.375rem;display:inline-flex;height:1.75rem;width:3.5rem;flex-shrink:0}.s-order-payment-logo img{height:100%;width:100%;object-fit:contain}.s-order-payment-logo img:where([dir="ltr"],[dir="ltr"] *){object-position:right}.s-order-payment-logo img:where([dir="rtl"],[dir="rtl"] *){object-position:left}.s-order-payment-total{font-size:1rem;font-weight:700;line-height:1.5rem;color:var(--color-text-primary,#333)}.s-order-payment-invoice{display:flex;min-height:3rem;width:100%;align-items:center;justify-content:center;gap:0.5rem;border-radius:0.5rem;border-width:1px;border-color:var(--color-border,#eee);font-size:1rem;line-height:1.5rem;font-weight:500;color:var(--color-text-primary,#333);text-decoration-line:none}.s-order-payment-invoice svg{height:1.25rem;width:1.25rem;fill:currentColor}';export{o as salla_order_payment}
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{h as t,r as e,c as i,H as s,a as r}from"./p-DgUQRYr2.js";import{a as l,b as o,r as a,g as n,c as d,h,d as c,e as p,f as u,j as b,k as g,l as m,m as y,n as w,o as v,p as f,q as x,i as k,s as _}from"./p-DqzaeXrL.js";import{L as S}from"./p-BO5AoBAP.js";import{S as C}from"./p-BscTeWDc.js";const z={closeButtonClick:"close_button",backdropClick:"backdrop"},M=()=>"function"==typeof crypto.randomUUID?crypto.randomUUID():"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(t=>(Number(t)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>Number(t)/4).toString(16))),A=t=>{const e=String(t?.allocation_headers?.["s-scope-allocation-id"]??t?.branch_id??"").split(",").map(Number).filter((t=>Number.isSafeInteger(t)&&t>0));return[...new Set(e)].sort(((t,e)=>t-e))};class I{constructor(){this.impressionId=null,this.visibleAt=0}viewed(t){this.guarded((()=>{this.impressionId=M(),this.visibleAt=Date.now(),this.send("Branch Selector Viewed",{...t})}))}dismissed(t,e,i){this.guarded((()=>this.send("Branch Selector Dismissed",{...t,close_reason:e,had_accepted_selection:i,elapsed_ms:this.visibleAt?Date.now()-this.visibleAt:0})))}result(t,e){this.guarded((()=>{const i=this.session(),s=i.seq+1,r="accepted"===e.outcome,l=i.first_accepted_branch_ids??(r?e.new_branch_ids:null),o=i.last_accepted_branch_ids??e.previous_branch_ids;var a,n;this.save({...i,seq:s,first_accepted_branch_ids:l,last_accepted_branch_ids:r?e.new_branch_ids:o}),this.send("Branch Selector Completed",{...t,...e,previous_branch_ids:o,selection_attempt_id:M(),selection_seq:s,first_accepted_branch_ids:l,changed:r&&o.length>0&&(a=o,n=e.new_branch_ids,!(a.length===n.length&&a.every((t=>n.includes(t)))))})}))}guarded(t){try{t()}catch{}}send(t,e){const i={event:t,session_id:this.session().id,impression_id:this.impressionId,...e};Promise.resolve(salla.api.axios.post("selector-events",i,{timeout:5e3,adapter:["fetch","xhr"],fetchOptions:{keepalive:!0}})).catch((()=>{}))}session(){const t=Salla.storage.session.get(this.storageName());if(t?.id)return t;const e={id:M(),seq:0,first_accepted_branch_ids:null};return this.save(e),e}storageName(){return`sc_selector_session:${Salla.config.get("store.id")}`}save(t){Salla.storage.session.set(this.storageName(),t)}}var L='<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 B=t=>"prompt"===t||"denied"===t;async function D(){try{return navigator?.permissions?.query&&navigator.geolocation?await navigator.permissions.query({name:"geolocation"}):null}catch{return null}}const T=({isRTL:e=!1,onActivate:i})=>t("div",{class:"s-bullet-delivery-location-permission"},t("button",{type:"button",class:"s-bullet-delivery-location-permission-btn",onClick:i},t("span",{class:"s-bullet-delivery-location-permission-icon",innerHTML:L,"aria-hidden":"true"}),t("span",{class:"s-bullet-delivery-location-permission-text",style:{textAlign:e?"right":"left"},"data-testid":"salla-bullet-delivery-location-permission-text"},Salla.lang.getWithDefault("pages.checkout.allow_location_permission","اسمح بمشاركة موقعك لتحديد عنوانك تلقائيًا وبشكل أدق.")),t("i",{class:"s-bullet-delivery-location-permission-arrow "+(e?"sicon-keyboard_arrow_left":"sicon-keyboard_arrow_right"),"aria-hidden":"true"}))),F=t=>t*(Math.PI/180),j=({distanceKm:e,isRTL:i=!1})=>{const s=e.toFixed(1),r=Salla.lang.getWithDefault("pages.checkout.location_distance_warning","تبعد عن موقعك {distance} كم، وقد تكون اخترت عنوان توصيل غير صحيح.")?.replace("{distance}",s);return t("div",{class:"s-bullet-delivery-location-distance-warning",role:"alert"},t("span",{class:"s-bullet-delivery-location-distance-warning-icon",innerHTML:L,"aria-hidden":"true"}),t("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 P='<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',N='<svg width="15" height="14" viewBox="0 0 15 14" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M1.14453 5.83032L1.14453 9.16486C1.14453 11.0511 1.14453 11.9943 1.73032 12.5803C2.3161 13.1663 3.25891 13.1663 5.14453 13.1663L9.14453 13.1663C11.0301 13.1663 11.9729 13.1663 12.5587 12.5803C13.1445 11.9943 13.1445 11.0511 13.1445 9.16486V5.83032"\n stroke="currentcolor" stroke-linecap="round" />\n <path\n d="M9.14453 10.1619C8.68846 10.5667 7.9624 10.8285 7.14453 10.8285C6.32666 10.8285 5.60059 10.5667 5.14453 10.1619"\n stroke="currentcolor" stroke-linecap="round" />\n <path\n d="M5.90256 4.44533C5.71455 5.12426 5.03086 6.29542 3.73185 6.46516C2.58488 6.61502 1.71497 6.11437 1.49277 5.90504C1.24779 5.7353 0.689441 5.19216 0.552703 4.85269C0.415966 4.51322 0.575492 3.77771 0.689441 3.47785L1.14495 2.15892C1.25615 1.82765 1.51646 1.04411 1.78334 0.779094C2.05022 0.514073 2.59054 0.502543 2.81294 0.502543L7.48329 0.502543C8.68543 0.519525 11.3139 0.491824 11.8335 0.502545C12.3532 0.513266 12.6654 0.948828 12.7565 1.13553C13.5318 3.01341 13.8333 4.08889 13.8333 4.54717C13.7321 5.03605 13.3133 5.95787 11.8335 6.36332C10.2956 6.7847 9.42363 5.96509 9.15007 5.65043M5.27015 5.65044C5.48665 5.91635 6.16578 6.45158 7.15029 6.46516C8.1348 6.47873 8.98485 5.79188 9.28681 5.44676C9.37227 5.34492 9.55687 5.04279 9.7483 4.44533"\n stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" />\n</svg>\n ';const q={lat:24.7756042,lng:46.7360729},$="salla-bullet-delivery-override-ip";function H(t,e){localStorage.getItem("salla-bullet-delivery-debug")&&(void 0!==e?console.log(t,e):console.log(t))}const E=class{constructor(t){e(this,t),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.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=t=>{this.preselectedAddressId=t?.preselected_address_id,this.preselectedBranchId=t?.preselected_branch_id,this.hasExplicitPreselectedIdsForOpen=null!=t?.preselected_address_id||null!=t?.preselected_branch_id,this.open()},this.closeHandler=null,this.selectorTracker=new I,this.openTrigger="customer_requested",this.pendingDismissReason=null,this.modalCloseHandler=t=>{var e;this.pendingDismissReason=(e=t?.reason,z[e??""]??"escape"),queueMicrotask((()=>this.pendingDismissReason=null))},this.bulletDeliveryMobileSelectHandler=null,this.savedAddressesLoaded=!1,this.gmapRef=null,this.autoGeolocationTriggered=!1,this.geocodeRequestId=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.filteredBranches=[],this.selectedBranch=null,this.branchSearchQuery="",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={...E.INITIAL_ADDRESS_FORM},this.handleCountrySearch=t=>{this.countrySearchQuery=t},this.handleRegionSearch=t=>{this.regionSearchQuery=t},this.handleCitySearch=t=>{if(this.citySearchQuery=t,this.citySearchTimer&&clearTimeout(this.citySearchTimer),!t.trim())return this.displayedCities=this.cities,void(this.searchingCities=!1);if(t.trim().length<E.DROPDOWN_SEARCH_MIN_CHARS)return;const e=++this.citySearchCounter;this.citySearchTimer=setTimeout((async()=>{this.searchingCities=!0;try{const i=l(this.selectedCountry?.code??"")?this.selectedRegion?.id:void 0,s=await o.getCities(this.selectedCountry?.id,i,t);e===this.citySearchCounter&&(this.displayedCities=s)}catch{e===this.citySearchCounter&&(this.displayedCities=this.cities)}finally{e===this.citySearchCounter&&(this.searchingCities=!1)}}),E.DROPDOWN_SEARCH_DEBOUNCE_MS)},this.handleDistrictSearch=t=>{this.districtSearchQuery=t},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.handleMapLocationChanged=t=>{const e=t.detail;if(!e?.position?.lat||!e?.position?.lng)return;const{lat:i,lng:s}=e.position;this.mapLocationData={lat:i,lng:s,shortAddress:e.place?.placeId??e.place?.place_id??void 0,formattedAddress:e.place?.formattedAddress??e.place?.formatted_address??void 0};const r=this.extractCountryCode(e.place?.addressComponents);this.mapCountryCode=r,this.mapCountryResolved=!!r,this.updateLocationBias(),setTimeout((()=>{const t=this.gmapRef?.locationMarker;t&&(t.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 t=await async function(){const t=await async function(){const t=await D();return t?.state??"unknown"}();if(function(){const t="undefined"!=typeof Salla?Salla.mobile:null;return!!t?.isSpaWebview?.()&&(t.action?.("location.settings.open"),!0)}())return{state:t,handledByApp:!0};if(!navigator?.geolocation)return{state:"denied",handledByApp:!1};try{const{coords:t}=await new Promise(((t,e)=>navigator.geolocation.getCurrentPosition(t,e,{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})));return{state:"granted",handledByApp:!1,position:{lat:t.latitude,lng:t.longitude}}}catch(e){return{state:1===e?.code?"denied":t,handledByApp:!1}}}();t.handledByApp||(await this.handleLocationPermissionChanged(t.state,t.position),"granted"===t.state&&this.locateOnMap(!0))},this.handleLocationPermissionChanged=async(t,e)=>{if(this.locationPermission=t,"granted"===t){if(e)this.liveLocation=e;else if(navigator.geolocation&&this.mapReady)try{const t=await new Promise(((t,e)=>navigator.geolocation.getCurrentPosition(t,e,{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})));this.liveLocation={lat:t.coords.latitude,lng:t.coords.longitude}}catch(t){H("Live location capture failed",t)}}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 t=>{if(t.preventDefault(),this.confirming)return;const e=this.canConfirmMapLocation();if(!(e||this.selectedCountry&&this.selectedCity))return;if(!e&&!a(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=t=>{const e=this.countries.find((e=>String(e.id)===String(t.id)))||t;this.countrySearchQuery="",this.displayedCountries=this.countries,this.applyCountryChange(e||null)},this.handleRegionSelected=t=>{const e=this.regions.find((e=>String(e.id)===String(t.id)))||t;this.selectedRegion=e||null,this.regionSearchQuery="",this.displayedRegions=this.regions,this.updateNewAddressForm({region_id:e?.id,city_id:void 0,district_id:void 0,city:void 0,district:void 0}),e&&this.selectedCountry&&this.loadCities(this.selectedCountry.id,e.id)},this.handleCitySelected=t=>{const e=l(this.selectedCountry?.code??""),i=this.cities.find((e=>String(e.id)===String(t.id)))||t;this.selectedCity=i||null,this.selectedDistrict=null,this.districtName="",this.citySearchQuery="",this.displayedCities=this.cities,i&&(this.updateNewAddressForm({city:i,district:void 0}),e&&this.loadDistricts(i.id))},this.handleDistrictSelected=t=>{const e=this.districts.find((e=>String(e.id)===String(t.id)))||t;this.selectedDistrict=e||null,this.districtName="",this.districtSearchQuery="",this.displayedDistricts=this.districts,e&&this.updateNewAddressForm({district:e})}}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(t=!1,e="customer_requested"){if(this.isEnabled)if(this.openTrigger=e,this.isMobileApp)Salla.event.dispatch("salla::bullet-delivery.open-sheet");else if(this.componentReady&&this.modal){this.resetState(),t||(this.modal.open(),Salla.event.dispatch("salla::bullet-delivery.modal.opened"));try{this.isLoggedIn=!this.isGuestUser();const t=this.cleanStaleGuestAddressIdIfNeeded(this.getStoredIntent());this.applyPreselectedIdsFromIntent(t);const e=!this.isLoggedIn&&"address"===t?.type&&null!=p(t)&&null!=c(t);if(this.activeTab=this.supportsPickup&&!this.isSupportsDelivery?"branch":this.supportsPickup&&t?.type&&("address"===t.type||"branch"===t.type)?t.type:"address",this.needsMap&&this.fetchAddressToken(),this.isLoggedIn&&"address"===this.activeTab&&(this.loadingSavedAddresses=!0),await Promise.all([this.loadCountries(e),this.isLoggedIn&&"address"===this.activeTab?this.loadSavedAddresses().then((()=>{this.savedAddressesLoaded=!0})).finally((()=>{this.loadingSavedAddresses=!1})):Promise.resolve()]),this.isLoggedIn&&this.preselectedAddressId){const t=this.savedAddresses.find((t=>t.id===this.preselectedAddressId));t&&(this.selectedSessionAddress=!1,this.selectedSavedAddress=t)}if("branch"===this.activeTab){const e=n(t),i=d(t);null!=e&&null!=i?await this.loadBranchesWithLocation(e,i):await this.loadBranches(),this.preselectedBranchId&&this.preselectBranch(this.preselectedBranchId)}await this.prefillFromSessionStorage()}catch(t){console.error("SallaBulletDelivery: Error loading data",t)}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(t){t?this.selectorTracker.viewed(this.selectorContext()):this.pendingDismissReason&&(this.selectorTracker.dismissed(this.selectorContext(),this.pendingDismissReason,!!this.getStoredIntent()?.scope_allocated),this.pendingDismissReason=null)}trackSelectorResult(t,e,i,s){this.selectorTracker.result(this.selectorContext(),{outcome:t,fulfilment_method:"branch"===this.activeTab?"pickup":"delivery",previous_branch_ids:e?.scope_allocated?A(e):[],new_branch_ids:i,scope_id:s??null})}resetState(){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.regions=[],this.cities=[],this.districts=[],this.branches=[],this.filteredBranches=[],this.newAddressForm={...E.INITIAL_ADDRESS_FORM},this.showCartWillBeClearedBanner=!1,this.allocationOutOfCoverageMessage=null,this.locationError="",this.savedAddressesLoaded=!1,this.loadingSavedAddresses=!1,this.loadingCountries=!1,this.resetSearchState()}getIntentStorage(){const t=Boolean(Salla.config.get("store.settings.bullet_delivery.settings.remember_last_session"));return Salla.storage[t?"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(t){if(!this.isGuestUser()||"address"!==t?.type||!t.address_id)return t;const e={...t,address_id:void 0};return this.setStoredIntent(e),e}applyPreselectedIdsFromIntent(t){this.hasExplicitPreselectedIdsForOpen?this.hasExplicitPreselectedIdsForOpen=!1:(this.preselectedAddressId=void 0,this.preselectedBranchId=void 0,this.isGuestUser()?"branch"===t?.type&&t.branch_id&&(this.preselectedBranchId=t.branch_id):"address"===t?.type&&t.address_id?this.preselectedAddressId=t.address_id:"branch"===t?.type&&t.branch_id&&(this.preselectedBranchId=t.branch_id))}hasIncompleteUserAddressIntent(){if(this.isGuestUser())return!1;const t=this.getStoredIntent();return!(!t||"address"!==t.type||t.address_id||!t.address_details)&&h(t)}isIntentMethodSupported(t){return"branch"===t.type?this.supportsPickup:"address"===t.type&&this.isSupportsDelivery}hasCompleteIntentForLoggedInUser(){if(this.isGuestUser())return!1;const t=this.getStoredIntent();return!!(t&&this.isIntentMethodSupported(t)&&!1!==t.scope_allocated&&("address"===t.type?t.address_id:"branch"===t.type&&t.branch_id))}async tryAutoConfirmAfterLogin(){if(this.confirming||this.autoConfirmAfterLoginInFlight)return!1;if(!this.hasIncompleteUserAddressIntent())return!1;this.autoConfirmAfterLoginInFlight=!0;const t=!!this.modal?.hasAttribute?.("visible");try{return t||await this.open(!0,"after_login"),this.selectedSessionAddress?(await this.handleConfirm(),!(!t&&!this.hasCompleteIntentForLoggedInUser()&&(this.modal?.open(),1))):(t||this.modal?.open(),!1)}finally{this.autoConfirmAfterLoginInFlight=!1}}shouldForceNonClosable(){return!this.isGuestUser()&&!!Salla.url.is_page("cart")&&!this.hasCompleteIntentForLoggedInUser()}shouldPromptIncompleteIntentThisSession(){const t=this.getShownStorage();return this.hasIncompleteUserAddressIntent()&&!0!==t.get(this.incompleteIntentPromptKey)}markIncompleteIntentPrompted(){this.getShownStorage().set(this.incompleteIntentPromptKey,!0)}setStoredIntent(t){this.getIntentStorage().set(this.intentStorageKey,t),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 t=this.getStoredIntent();if(!t||"address"!==t.type||null==c(t))return;const e=p(t);if(!e)return;const i=this.countries.find((t=>String(t.id)===String(e)));if(!i)return;this.selectedCountry=i,this.updateNewAddressForm({country_id:Number(i.id)});const s=l(i.code),r=c(t),a=u(t),n=b(t),d=t.address_details?.district?.name,[h,g,m]=await Promise.all([s?o.getRegions(i.id):Promise.resolve([]),o.getCities(i.id,s&&null!=a?a:void 0),null!=r?o.getDistricts(Number(r)):Promise.resolve([])]);if(s&&(this.regions=h,this.displayedRegions=this.regions),this.cities=g,this.displayedCities=this.cities,this.districts=m,this.displayedDistricts=this.districts,this.loadingCities=!1,this.loadingRegions=!1,this.loadingDistricts=!1,s&&null!=a){const t=this.regions.find((t=>String(t.id)===String(a)));t&&(this.selectedRegion=t,this.updateNewAddressForm({region_id:t.id}))}if(null!=r&&this.cities.length>0){const t=this.cities.find((t=>String(t.id)===String(r)));t&&(this.selectedCity=t,this.updateNewAddressForm({city_id:t.id,city:t}))}if(this.districts.length>0){const t=this.findPrefillDistrict(n,d);t&&(this.updateNewAddressForm({district_id:t.id,district:t}),this.selectedDistrict=t)}!this.selectedDistrict&&d&&(this.districtName=d)}updateNewAddressForm(t){this.newAddressForm={...this.newAddressForm,...t}}hasBeenShownThisSession(){return!0===this.getShownStorage().get(this.sessionShownKey)}markShownThisSession(){this.getShownStorage().set(this.sessionShownKey,!0)}getIPLocationConfig(){const t="store.shipping.delivery_location",e={countryId:Salla.config.get(`${t}.country_id`),regionId:Salla.config.get(`${t}.region_id`),cityId:Salla.config.get(`${t}.city_id`),districtId:Salla.config.get(`${t}.district_id`)};return localStorage.getItem($)?JSON.parse(localStorage.getItem($)):e}async loadCountries(t=!1){this.loadingCountries=!0;const e="branch"===this.activeTab;try{this.countries=await o.getCountries(e),this.displayedCountries=this.countries;const{countryId:i,regionId:s,cityId:r,districtId:a}=this.getIPLocationConfig();H("getIPLocationConfig",this.getIPLocationConfig());const n=i&&this.countries.length>0?this.countries.find((t=>String(t.id)===String(i))):null;n&&(this.selectedCountry=n,this.updateNewAddressForm({country_id:Number(this.selectedCountry.id)}),!t)&&(null!=s||null!=r||null!=a?await this.prefillFromIPLocation(n,{regionId:s,cityId:r,districtId:a}):l(this.selectedCountry.code)?await this.loadRegions(this.selectedCountry.id):await this.loadCities(this.selectedCountry.id))}finally{this.loadingCountries=!1}}async prefillFromIPLocation(t,e){const i=l(t.code),{regionId:s,cityId:r,districtId:a}=e,[n,d,h]=await Promise.all([i?o.getRegions(t.id):Promise.resolve([]),o.getCities(t.id,i&&null!=s?s:void 0),null!=r?o.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 t=this.regions.find((t=>String(t.id)===String(s)));t&&(this.selectedRegion=t,this.updateNewAddressForm({region_id:t.id}))}if(null!=r&&this.cities.length>0){const t=this.cities.find((t=>String(t.id)===String(r)));t&&(this.selectedCity=t,this.updateNewAddressForm({city_id:t.id,city:t}))}if(null!=a&&this.districts.length>0){const t=this.findPrefillDistrict(a);t&&(this.selectedDistrict=t,this.updateNewAddressForm({district_id:t.id,district:t}))}}async loadCities(t,e){this.loadingCities=!0,this.cities=[],this.displayedCities=[],this.districts=[],this.displayedDistricts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="";try{this.cities=await o.getCities(t,e),this.displayedCities=this.cities}finally{this.loadingCities=!1}}async loadDistricts(t){this.loadingDistricts=!0,this.districts=[],this.displayedDistricts=[],this.selectedDistrict=null,this.districtName="";try{this.districts=await o.getDistricts(t),this.displayedDistricts=this.districts}finally{this.loadingDistricts=!1}}findPrefillDistrict(t,e){if(0===this.districts.length)return;if(null!=t){const e=this.districts.find((e=>String(e.id)===String(t)));if(e)return e}const i=e?.trim().toLowerCase();return i?this.districts.find((t=>{const e=t.name?.trim().toLowerCase(),s=t.name_en?.trim().toLowerCase();return e===i||s===i})):void 0}async loadBranches(){this.loadingBranches=!0;try{this.applyLoadedBranches(await o.getBranches({country_id:this.selectedCountry?.id}))}finally{this.loadingBranches=!1}}applyLoadedBranches(t){if(this.branches=t,this.selectedBranch){const e=t.find((t=>t.id===this.selectedBranch?.id));e&&(this.selectedBranch=g(e)?e:null)}this.filterBranches()}filterBranches(){this.filteredBranches=m(this.branches,this.branchSearchQuery)}async prefillFromSessionStorage(){try{const t=this.getStoredIntent();if(!t)return;if("address"!==this.activeTab||"address"!==t.type||this.isLoggedIn||await this.prefillAddressFromStoredIntent(),"branch"===this.activeTab&&"branch"===t.type){const e=p(t);if(null!=e){const i=this.countries.find((t=>String(t.id)===String(e)));i&&(this.selectedCountry=i,this.updateNewAddressForm({country_id:Number(i.id)}),this.preselectBranch(y(t)))}}}catch(t){console.error("[BulletDelivery] Error prefilling from session storage:",t)}}async loadSavedAddresses(){const t=this.selectedSavedAddress?.id;this.savedAddresses=await o.getSavedAddresses();const e=this.getStoredIntent();if(h(e))return this.selectedSessionAddress=!0,void(this.selectedSavedAddress=null);if(null!=t){const e=this.savedAddresses.find((e=>e.id===t&&!1!==e.is_in_coverage));if(e)return this.selectedSessionAddress=!1,void(this.selectedSavedAddress=e)}const i=this.savedAddresses.find((t=>t.is_default&&!1!==t.is_in_coverage));if(i)this.selectedSavedAddress=i;else{const t=this.savedAddresses.find((t=>!1!==t.is_in_coverage));t&&(this.selectedSavedAddress=t)}}applyCountryChange(t){this.selectedCountry=t,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(t){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 o.getRegions(t),this.displayedRegions=this.regions}finally{this.loadingRegions=!1}}emitHeaderContextUpdate(t,e,i){let s="";"address"===t.type?e?s=e.district?.name&&e.city?.name?`${e.district.name}، ${e.city.name}`:e.city?.name??"":this.isGuestMapPick?s=t.address_details?.formatted_address??"":this.selectedCity?s=this.selectedDistrict?`${this.selectedDistrict.name}، ${this.selectedCity.name}`:this.selectedCity.name:t.address_details&&(s=[t.address_details.district?.name,t.address_details.city?.name,t.address_details.country?.name].filter(Boolean).join("، ")||t.address_details.formatted_address||t.address_details.short_address||""):i?s=i.name:t.branch_details&&(s=t.branch_details.city??t.branch_details.name);const r="address"===t.type?Salla.lang.get("mobile_app.strings.delivery"):Salla.lang.get("mobile_app.strings.pickup");this.headerContextUpdate.emit({type:t.type,display_text:s?`${r}: ${s}`:"",country_code:t.country_code,city:this.selectedCity?.name??t.address_details?.city?.name,district:this.selectedDistrict?.name??t.address_details?.district?.name,branch_name:i?.name??t.branch_details?.name})}handleBranchSearch(t){const e=t.target.value;if(this.branchSearchQuery=e,this.branchSearchDebounceTimer&&clearTimeout(this.branchSearchDebounceTimer),!e?.trim())return this.branchSearchQuery="",void this.loadBranches();this.branchSearchDebounceTimer=setTimeout((async()=>{if(!(e.trim().length<2)){this.loadingBranches=!0;try{this.applyLoadedBranches(await o.getBranches({country_id:this.selectedCountry?.id,query:e}))}finally{this.loadingBranches=!1}}}),1e3)}clearSearchTimers(){[this.countrySearchTimer,this.regionSearchTimer,this.citySearchTimer,this.districtSearchTimer].forEach((t=>{t&&clearTimeout(t)})),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(t,e){this.loadingBranches=!0;try{if(this.applyLoadedBranches(await o.getBranches({country_id:this.selectedCountry?.id,lat:t,lng:e})),!this.selectedCountry&&this.branches.length>0){const t=this.branches[0];if(t.country){const e=this.countries.find((e=>e.id===t.country.id));e&&(this.selectedCountry=e,this.updateNewAddressForm({country_id:Number(e.id)}))}}}finally{this.loadingBranches=!1}}async handleFindNearestBranch(){if(navigator.geolocation){this.loadingNearestBranch=!0,this.locationError="";try{const t=await new Promise(((t,e)=>{navigator.geolocation.getCurrentPosition(t,e,{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})})),{latitude:e,longitude:i}=t.coords;await this.loadBranchesWithLocation(e,i);const s=w(this.branches,e,i);s&&(this.selectedBranch=s,this.branchSearchQuery="",this.filterBranches())}catch(t){const e=t;this.locationError=v("number"==typeof e?.code?e.code:-1)}finally{this.loadingNearestBranch=!1}}else this.locationError=Salla.lang.get("pages.checkout.current_location_not_supported")}handleBranchSelect(t){this.selectedBranch=t,this.allocationOutOfCoverageMessage=null}preselectBranch(t){if(null==t)return;const e=this.branches.find((e=>e.id===t));e&&g(e)&&(this.selectedBranch=e)}handleSavedAddressSelect(t){!1!==t.is_in_coverage?(this.selectedSavedAddress=t,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 t=this.getStoredIntent(),e=p(t);if(e&&this.countries.length>0){const t=this.countries.find((t=>t.id===e));t&&(this.selectedCountry=t,this.updateNewAddressForm({country_id:Number(t.id)}),l(t.code)?await this.loadRegions(t.id):await this.loadCities(t.id))}}handleBackToAddressList(){this.viewMode="main",this.mapLocationData=null,this.invalidatePendingGeocode(),this.addressDescription="",this.autoGeolocationTriggered=!1}hasAddressesToGoBack(){return this.savedAddresses.length>0||h(this.getStoredIntent())}async fetchAddressToken(){if(this.canUseMap&&!this.addressToken&&!this.loadingToken){this.loadingToken=!0;try{const t=salla.config.get("store.settings.keys.maps"),e=()=>import("./p-DI6PJLEJ.js").then((({load:e})=>e({key:t,libraries:["marker","places"],language:salla.config.get("user.language_code")||"ar"}))).catch((t=>H("Failed to load Google Maps SDK",t)));"complete"===document.readyState?e():window.addEventListener("load",e,{once:!0}),this.addressToken=await o.getAddressToken()}catch{H("SallaBulletDelivery: Failed to fetch address token")}finally{this.loadingToken=!1}}}extractCountryCode(t){const e=t?.find((t=>t?.types?.includes("country"))),i=e?.short_name??e?.shortText;return"string"==typeof i&&i.trim()?i.trim().toUpperCase():null}invalidatePendingGeocode(){this.reverseGeocoding=!1,this.geocodeRequestId++}applyCoordsFallback(t,e){this.mapLocationData={...this.mapLocationData,formattedAddress:this.mapLocationData?.formattedAddress??`${t.toFixed(6)}, ${e.toFixed(6)}`},this.mapCountryResolved=!0}reverseGeocodeLocation(t,e,i=!1){this.mapCountryCode=null,this.mapCountryResolved=!1;const s=window.google?.maps?.Geocoder;if(!s)return this.geocodeRequestId++,void this.applyCoordsFallback(t,e);this.reverseGeocoding=!0;const r=++this.geocodeRequestId;(new s).geocode({location:{lat:t,lng:e}},((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 t of s)if(this.mapCountryCode=this.extractCountryCode(t.address_components),this.mapCountryCode)break;this.mapCountryResolved=!0}else H("Reverse geocoding failed for map location",l),this.applyCoordsFallback(t,e)}))}updateLocationBias(){if(!this.gmapRef)return;const t=this.hasMapLocation()?{lat:this.mapLocationData.lat,lng:this.mapLocationData.lng}:this.mapInitialCenter;this.gmapRef.autocompleteLocationBias={center:t,radius:5e5}}locateOnMap(t=!1){if(!this.gmapRef)return;if(!t){if(this.autoGeolocationTriggered||this.hasMapLocation())return;if(!this.locationPermissionResolved||B(this.locationPermission))return}const e=this.gmapRef.getCurrentLocation;if("function"==typeof e){this.autoGeolocationTriggered=!0;try{const t=e.call(this.gmapRef,!0);t&&"function"==typeof t.catch&&t.catch((t=>H("Auto geolocation failed",t)))}catch(t){H("Auto geolocation threw",t)}}}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((t=>String(t.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 e=this.mapCountryStatus;return"unsupported"===e?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"!==e?null:t("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.")),t("salla-button",{shape:"link",onClick:this.retryMapCountryLookup},Salla.lang.getWithDefault("pages.checkout.try_again","Try again")))}get mapInitialCenter(){const t=salla.config.get("user.default_geo_location"),e=this.toCoordinate(t?.lat),i=this.toCoordinate(t?.lng);return null!=e&&null!=i&&e>=-90&&e<=90&&i>=-180&&i<=180?{lat:e,lng:i}:q}toCoordinate(t){if("string"==typeof t&&""===t.trim())return null;if(null==t)return null;const e=Number(t);return Number.isFinite(e)?e:null}async handleTabChange(t){if(!this.tabChanging){this.tabChanging=!0;try{this.activeTab=t,"add-address"===this.viewMode&&(this.viewMode="main",this.invalidatePendingGeocode()),this.showCartWillBeClearedBanner=!1,this.allocationOutOfCoverageMessage=null,this.resetSearchState();const e="branch"===t;this.countries=await o.getCountries(e),this.displayedCountries=this.countries;const i=this.selectedCountry?.id;if(null!=i&&(this.selectedCountry=this.countries.find((t=>t.id===i))||null),!this.selectedCountry){const{countryId:t}=this.getIPLocationConfig();t&&this.countries.length>0&&(this.selectedCountry=this.countries.find((e=>String(e.id)===String(t)))||null),this.selectedCountry||1!==this.countries.length||(this.selectedCountry=this.countries[0])}if("address"===t&&this.needsMap&&this.fetchAddressToken(),this.selectedCountry)if("branch"===t){const t=this.getStoredIntent(),e=n(t),i=d(t);null!=e&&null!=i?await this.loadBranchesWithLocation(e,i):await this.loadBranches(),this.preselectBranch(y(t))}else if("address"===t){if(this.isLoggedIn&&!this.savedAddressesLoaded){this.loadingSavedAddresses=!0;try{await this.loadSavedAddresses(),this.savedAddressesLoaded=!0}finally{this.loadingSavedAddresses=!1}}if(!this.isLoggedIn){const t=this.getStoredIntent();t&&c(t)&&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||!a(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 t=this.pendingCartSubmitResolver;this.pendingCartSubmitResolver=null,this.pendingCartSubmitPromise=null,this.cartSubmitConfirmationPending=!1,t()}armPendingCartSubmitGate(){this.isEnabled&&!this.cartSubmitConfirmationPending&&(this.cartSubmitConfirmationPending=!0,this.pendingCartSubmitPromise=new Promise((t=>{this.pendingCartSubmitResolver=t})))}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:t,lng:e,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:t,lng:e,formatted_address:i,place_id:s,description:this.addressDescription?.trim()||void 0}}if(!this.selectedCountry||!this.selectedCity)return;const t={id:this.selectedCountry.id,name:this.selectedCountry.name,code:this.selectedCountry.code},e={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:t,region:i,city:e,district:s,short_address:r}}buildIntentAddressFromSaved(t){return{country:{id:t.country?.id??t.country_id??0,name:t.country?.name??"",code:t.country?.code},region:t.region?{id:t.region.id,name:t.region.name,code:t.region.code}:void 0,city:{id:t.city?.id??t.city_id??0,name:t.city?.name??""},district:t.district?{id:t.district.id,name:t.district.name}:void 0,short_address:t.short_address}}buildIntentBranch(){if("branch"!==this.activeTab||!this.selectedBranch)return;const t=this.selectedBranch,e=null!=t.location?.lat?Number(t.location.lat):void 0,i=null!=t.location?.lng?Number(t.location.lng):void 0;return{id:t.id,name:t.name,city:t.city?.name,country:t.country?.name,district:t.district?.name,latitude:e,longitude:i}}buildAllocationConfirmedAddressData(t){return"address"!==this.activeTab?null:{saved_address:t??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:t?.short_address??this.selectedSavedAddress?.short_address,form_data:{...this.newAddressForm},lat:this.mapLocationData?.lat,lng:this.mapLocationData?.lng,formatted_address:this.mapLocationData?.formattedAddress}}buildAllocationConfirmedAddressFromIntent(t){if("address"!==t.type)return null;const e=t.address_details,i=Number(t.country_id)||0;return{country:e?.country?{id:e.country.id,name:e.country.name,code:e.country.code??t.country_code??""}:void 0,region:e?.region?{id:Number(e.region.id),name:e.region.name,country_id:i,code:e.region.code??void 0}:void 0,city:e?.city?{id:Number(e.city.id),name:e.city.name,country_id:i}:void 0,district:e?.district?{id:Number(e.district.id),name:e.district.name,city_id:Number(e.city?.id)||0}:void 0,short_address:e?.short_address}}buildBranchFromIntent(t){if("branch"!==t.type||!t.branch_details)return null;const e=t.branch_details,i={id:e.id,name:e.name};return e.city&&(i.city={id:0,name:e.city}),null!=e.latitude&&null!=e.longitude&&(i.location={lat:String(e.latitude),lng:String(e.longitude)}),i}buildAllocationRequestFromIntent(t){if("branch"===t.type)return{type:"branch",branch_id:null!=t.branch_id?String(t.branch_id):""};if(null!=t.address_id)return{type:"address",address_id:String(t.address_id)};const e=t.address_details,i={type:"address",country_id:null!=t.country_id?String(t.country_id):"",city_id:null!=e?.city?.id?String(e.city.id):""};return null!=e?.region?.id&&(i.region_id=String(e.region.id)),null!=e?.district?.id&&(i.district_id=String(e.district.id)),i}applyMobileBulletDeliverySelection(t){if(!t||"address"!==t.type&&"branch"!==t.type)return void console.warn("SallaBulletDelivery: ignoring invalid mobile select payload",t);const e=t.allocation_headers??{},i=e["s-scope-allocation-type"]??t.type,s=e["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={...t,allocation_headers:{"s-scope-allocation-type":i,"s-scope-allocation-id":s?String(s):void 0}};this.setStoredIntent(l),f();const o=this.buildBranchFromIntent(l),a={...l,address:this.buildAllocationConfirmedAddressFromIntent(l),branch:o,allocation_request:this.buildAllocationRequestFromIntent(l),allocation_response:null};Salla.event.dispatch("salla::bullet-delivery.allocation.confirmed",a),this.bulletDeliveryConfirmed.emit({...l,branch:o??void 0}),this.emitHeaderContextUpdate(l,void 0,o??void 0),setTimeout((()=>window.location.reload()),100)}extractMobileSelectPayload(t){return t&&"object"==typeof t?"payload"in t&&t.payload?t.payload:t:null}async handleConfirm(t){if(this.isConfirmDisabled()||this.confirming)return;this.allocationOutOfCoverageMessage=null,this.confirming=!0,this.confirmBtn?.load();let e=!1;const i=void 0===t?this.getStoredIntent():t;try{const t="address"===this.activeTab&&this.isGuestMapPick?this.mapCountry:this.selectedCountry,s={type:this.activeTab,country_id:Number(t?.id)||0,country_code:t?.code||""};let r,a,n;if("address"===this.activeTab)if(this.isLoggedIn&&this.selectedSessionAddress){const t=await this.saveSessionAddressToProfile();if(!t)return Salla.notify?.error(Salla.lang.get("common.errors.error_occurred")),this.trackSelectorResult("failed",i,[]),void this.confirmBtn?.stop();s.address_id=t.id,r=t,this.selectedSessionAddress=!1,this.selectedSavedAddress=t,s.address_details=this.buildIntentAddressFromSaved(t)}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,a=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 o.allocateScope(n);if(!d.success){console.error("BulletDelivery: Scope allocation failed",d.error);const t=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=`${t}.`,this.trackSelectorResult("failed",i,[]),this.confirmBtn?.stop(),void(this.confirming=!1)}let h;if(d.data){const t=d.data;h=t.id;const e=t?.allocation?.type,r=t?.allocation?.branch_id;e&&Salla.api.setHeader("s-scope-allocation-type",e),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:e,allocation_id:r?String(r):void 0}),h){if(!await o.setDeliveryScope(h))return this.allocationOutOfCoverageMessage=`${Salla.lang.get("common.errors.error_occurred")}.`,this.trackSelectorResult("failed",i,[],h),this.confirmBtn?.stop(),void(this.confirming=!1);f()}s.allocation_headers={"s-scope-allocation-type":e,"s-scope-allocation-id":r?String(r):void 0}}this.markShownThisSession(),this.setStoredIntent({...s,scope_allocated:!0}),this.trackSelectorResult("accepted",i,A(s),h);const c={...s,address:this.buildAllocationConfirmedAddressData(r),branch:a??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:a}),this.emitHeaderContextUpdate(s,r,a),e=!0,setTimeout((()=>{if(this.confirmBtn?.stop(),this.close(),this.confirming=!1,this.cartSubmitConfirmationPending)setTimeout((()=>this.resolvePendingCartSubmit()),350);else if(h){const t=Salla.storage.get("scope")||{};let e=Salla.helpers.addParamToUrl("scope",h);t.allocation_id&&(e=Salla.helpers.addParamToUrl("allocation_id",t.allocation_id,e)),t.allocation_type&&(e=Salla.helpers.addParamToUrl("allocation_type",t.allocation_type,e)),window.location.replace(e)}else window.location.reload()}),500)}finally{e||(this.confirming=!1)}}getCartViewConfig(t){if(!t||!Salla.url.is_page("cart"))return null;if(!this.isIntentMethodSupported(t))return null;const e="branch"===t.type,i="address"===t.type,s=t.branch_details?.name?.trim();return{title:e?[Salla.lang.get("pages.checkout.pickup_option"),s].filter(Boolean).join(": "):Salla.lang.get("pages.checkout.delivery_option"),subtitle:x(t,Salla.lang.get("common.elements.to"),""),buttonText:Salla.lang.get("common.elements.edit"),isAddress:i,intent:t}}createCartViewElement(){const t=this.getStoredIntent(),e=this.getCartViewConfig(t);if(!e)return null;const{title:i,subtitle:s,buttonText:r,intent:l}=e,o="branch"===l.type?{preselected_branch_id:y(l)}:{preselected_address_id:l.address_id},a=document.createElement("span");a.className="s-bullet-delivery-cart-view-icon s-bullet-delivery-tab-icon",a.setAttribute("aria-hidden","true"),a.innerHTML=S;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(a,h);const p=document.createElement("salla-button");p.className="s-bullet-delivery-cart-view-button",p.setAttribute("fill","outline"),p.setAttribute("color","primary"),p.textContent=r,p.addEventListener("click",(()=>Salla.event.emit("salla::bullet-delivery.modal.open.requested",o)));const u=document.createElement("div");return u.className="s-bullet-delivery-cart-view",u.append(c,p),u}renderTabs(){return this.supportsPickup?t("div",{class:"s-bullet-delivery-tabs"},this.isSupportsDelivery&&t("button",{type:"button",class:{"s-bullet-delivery-tab":!0,"s-bullet-delivery-tab--active":"address"===this.activeTab},onClick:()=>this.handleTabChange("address")},t("span",{class:"s-bullet-delivery-tab-icon",innerHTML:S,"aria-hidden":"true"}),t("span",null,Salla.lang.get("mobile_app.strings.delivery"))),t("button",{type:"button",class:{"s-bullet-delivery-tab":!0,"s-bullet-delivery-tab--active":"branch"===this.activeTab},onClick:()=>this.handleTabChange("branch")},t("span",{class:"s-bullet-delivery-tab-icon",innerHTML:N,"aria-hidden":"true"}),t("span",null,Salla.lang.get("mobile_app.strings.pickup")))):null}renderAlert(e){return t("div",{class:"s-bullet-delivery-allocation-out-of-coverage",role:"alert"},t("span",{class:"s-bullet-delivery-allocation-out-of-coverage-icon","aria-hidden":"true"},t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true"},t("title",null,"Information"),t("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor","stroke-width":"1.5",fill:"currentColor"}),t("text",{x:"10",y:"14","text-anchor":"middle",fill:"white","font-size":"12","font-weight":"bold"},"i"))),t("span",{class:"s-bullet-delivery-allocation-out-of-coverage-text",style:{textAlign:this.isRTL?"right":"left"}},e))}renderAllocationOutOfCoverageAlert(){const e=this.allocationOutOfCoverageMessage||Salla.lang.get("pages.checkout.shipping_not_available");return this.renderAlert("address"!==this.activeTab?e:this.supportsPickup?[`${e} ${Salla.lang.getWithDefault("pages.cart.choose_another_address_pickup","Choose another address or")} `,t("button",{type:"button",class:"underline !text-blue-600",onClick:()=>this.handleTabChange("branch")},Salla.lang.getWithDefault("pages.cart.branch_pickup","pick up from a branch"))]:`${e} ${Salla.lang.getWithDefault("pages.cart.choose_another_address","Choose another address")}`)}renderCountrySelect(){return t("div",{class:"s-bullet-delivery-field"},t("salla-searchable-dropdown",{label:Salla.lang.get("blocks.buy_as_gift.receiver_country"),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:t=>this.handleCountrySelected(t.detail),onSearchInput:t=>this.handleCountrySearch(t.detail),onDropdownClosed:()=>this.handleCountryDropdownClosed()}))}renderRegionSelect(){return l(this.selectedCountry?.code??"")&&this.selectedCountry?t("div",{class:"s-bullet-delivery-field"},t("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:t=>this.handleRegionSelected(t.detail),onSearchInput:t=>this.handleRegionSearch(t.detail),onDropdownClosed:()=>this.handleRegionDropdownClosed()})):null}renderCityDistrictSelects(){const e=l(this.selectedCountry?.code??""),i=e,s=i&&this.selectedCity&&!this.loadingDistricts&&0===this.districts.length,r=!this.selectedCountry||e&&!this.selectedRegion||this.loadingCities||0===this.cities.length,o=!this.selectedCountry||e&&!this.selectedRegion||!this.selectedCity||this.loadingDistricts;return t("div",{class:"s-bullet-delivery-field-row"},t("div",{class:"s-bullet-delivery-field"},t("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:t=>this.handleCitySelected(t.detail),onSearchInput:t=>this.handleCitySearch(t.detail),onDropdownClosed:()=>this.handleCityDropdownClosed(),dropUp:!0})),i&&t("div",{class:"s-bullet-delivery-field"},s?t("div",null,t("label",{class:"s-bullet-delivery-label",htmlFor:"bullet-delivery-district"},Salla.lang.get("pages.checkout.district_field"),t("span",{class:"text-red-500"}," *")),t("input",{id:"bullet-delivery-district",type:"text",class:"form-input",placeholder:Salla.lang.get("pages.checkout.select_district"),value:this.districtName,disabled:o,onInput:t=>{this.districtName=t.target.value,this.updateNewAddressForm({district:void 0})}})):t("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:o||0===this.districts.length,required:!0,inputId:"bullet-delivery-district",searchQuery:this.districtSearchQuery,clientSearch:!0,onItemSelected:t=>this.handleDistrictSelected(t.detail),onSearchInput:t=>this.handleDistrictSearch(t.detail),onDropdownClosed:()=>this.handleDistrictDropdownClosed(),dropUp:!0})))}renderSavedAddressesEmptyState(){return t("div",{class:"s-bullet-delivery-saved-addresses-empty"},t("div",{class:"s-bullet-delivery-saved-addresses-empty-icon","aria-hidden":"true"},t("svg",{width:"28",height:"28",viewBox:"0 0 28 29",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("title",null,"No Saved Adresses"),t("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"}))),t("p",{class:"s-bullet-delivery-saved-addresses-empty-title"},Salla.lang.get("pages.checkout.no_saved_addresses")),t("p",{class:"s-bullet-delivery-saved-addresses-empty-desc"},Salla.lang.get("pages.checkout.add_address_simplify_shipping")),t("salla-button",{onClick:()=>this.handleAddNewAddress(),onKeyUp:()=>this.handleAddNewAddress()},Salla.lang.get("pages.checkout.add_new_address")))}async saveSessionAddressToProfile(){const t=this.getStoredIntent();if(k(t)){const e=t.address_details,i={lat:e.lat,lng:e.lng,...e.place_id&&{short_address:e.place_id},...e.description&&{description:e.description}};try{const{success:e,address:s}=await o.saveAddressLocation(i);return e&&s?(this.setStoredIntent({...t,address_id:s.id,scope_allocated:!1}),this.addressCreated.emit({address:s}),s):null}catch(t){return console.error("SallaBulletDelivery: Error saving session address (map)",t),null}}const e=p(t),i=c(t),s=b(t);if(!t||"address"!==t.type||!e||!i)return null;const r=_(t);if(l(r)&&!s)return null;const a=l(r),n=t.address_details?.district?.name??"",d={country_id:e,region_id:u(t),city_id:i,district_id:s,description:n};a&&(d.local=n);try{const{success:e,address:i}=await o.saveAddressLocation(d);if(!e)return null;const s=i??null;return s&&(this.setStoredIntent({...t,address_id:s.id,scope_allocated:!1}),this.addressCreated.emit({address:s})),s}catch(t){return console.error("SallaBulletDelivery: Error saving session address",t),null}}renderSavedAddresses(){if(!this.isLoggedIn)return null;if(this.loadingSavedAddresses)return t("div",{class:"s-bullet-delivery-addresses-list s-scrollbar"},[1,2,3].map((e=>t("div",{key:e,class:"s-bullet-delivery-address-item s-bullet-delivery-address-item--skeleton"},t("salla-skeleton",{class:"s-bullet-delivery-skel-radio",height:"18px",width:"18px"}),t("salla-skeleton",{class:"s-bullet-delivery-skel-map",height:"36px",width:"36px"}),t("div",{class:"s-bullet-delivery-address-content"},t("div",{class:"s-bullet-delivery-address-lines"},t("salla-skeleton",{height:"18px",width:"72%"}),t("salla-skeleton",{height:"16px",width:"56%"})))))));const e=this.getStoredIntent(),i=h(e),s=k(e),r=i&&e?.address_details?s?e.address_details.formatted_address??"":[e.address_details.city?.name,e.address_details.country?.name].filter(Boolean).join("، ")||"":"",l=i&&e?.address_details&&!s?(e.address_details.district?.name??"").trim():"";return 0!==this.savedAddresses.length||i?t("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((t=>{const e=[t.building_number,t.street].filter(Boolean).join("، ")||t.formatted?.address_one||t.short_address||"",i=[t.district?.name,t.city?.name,t.country?.name].filter(Boolean).join("، "),s=(t.formatted?.address_two||i)??"",r=!1!==t.is_in_coverage;return this.renderAddressRow({key:String(t.id),line1:e,line2:s,selected:this.selectedSavedAddress?.id===t.id,disabled:!r,onClick:()=>r&&this.handleSavedAddressSelect(t)})}))):this.renderSavedAddressesEmptyState()}renderAddressRow(e){const{key:i,line1:s,line2:r,selected:l,disabled:o=!1,onClick:a}=e;return t("button",{key:i,class:{"s-bullet-delivery-address-item":!0,"s-bullet-delivery-address-item--selected":l,"s-bullet-delivery-address-item--disabled":o},type:"button",onClick:o?void 0:a,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),o||a())}},t("input",{type:"radio",name:"saved_address",class:"s-bullet-delivery-radio",checked:l,disabled:o}),t("span",{class:"s-bullet-delivery-address-map-icon",innerHTML:P,"aria-hidden":"true"}),t("div",{class:"s-bullet-delivery-address-content"},t("div",{class:"s-bullet-delivery-address-lines"},t("span",{class:"s-bullet-delivery-address-line1",style:{textAlign:this.isRTL?"right":"left"}},s),t("span",{class:"s-bullet-delivery-address-line2",style:{textAlign:this.isRTL?"right":"left"}},r))))}renderMapSection(){const e=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 t("div",{class:"s-bullet-delivery-map-container"},t("gmap-map",{ref:t=>this.gmapRef=t,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":e?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 e=this.mapLocationData?.formattedAddress??"";return t("div",{class:"s-bullet-delivery-address-confirm"},t("div",{class:"s-bullet-delivery-address-confirm-card"},t("span",{class:"s-bullet-delivery-address-map-icon",innerHTML:P,"aria-hidden":"true"}),t("div",{class:"s-bullet-delivery-address-confirm-details"},t("span",{class:"s-bullet-delivery-address-confirm-label"},Salla.lang.get("pages.checkout.selected_address")),t("p",{class:"s-bullet-delivery-address-confirm-text"},e))),t("div",{class:"s-bullet-delivery-address-confirm-description"},t("label",{class:"s-bullet-delivery-address-confirm-description-label"},Salla.lang.get("pages.checkout.address_description"),t("span",{class:"s-bullet-delivery-address-confirm-description-optional"},Salla.lang.get("common.elements.optional"))),t("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:t=>{this.addressDescription=t.target.value}})))}renderLocationPermissionNotice(){return B(this.locationPermission)?t(T,{isRTL:this.isRTL,onActivate:this.handleLocationPermissionRequest}):null}renderLocationDistanceWarning(){const e=this.mapLocationData;if("granted"!==this.locationPermission||!this.liveLocation||null==e?.lat||null==e?.lng)return null;const i=function(t,e){const i=F(e.lat-t.lat),s=F(e.lng-t.lng),r=F(t.lat),l=F(e.lat),o=Math.sin(i/2)**2+Math.cos(r)*Math.cos(l)*Math.sin(s/2)**2;return 12742*Math.atan2(Math.sqrt(o),Math.sqrt(1-o))}(this.liveLocation,{lat:e.lat,lng:e.lng});return i<=.5?null:t(j,{distanceKm:i,isRTL:this.isRTL})}renderGuestDeliveryForm(){if(this.isMapModeAvailable)return[this.renderMapSection(),this.renderLocationPermissionNotice(),this.renderLocationDistanceWarning(),this.hasMapLocation()?this.renderAddressConfirmation():null,this.renderMapCountryNotice()];const t=l(this.selectedCountry?.code??"");return[this.renderCountrySelect(),t?this.renderRegionSelect():null,this.renderCityDistrictSelects()]}renderDeliveryTab(){return t("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 e=this.canConfirmMapLocation()&&!this.isGuestMapCountryBlocked(),i=this.confirming?Salla.lang.get("pages.checkout.loading"):Salla.lang.get("pages.checkout.confirm_address");return t("form",{onSubmit:t=>{t.preventDefault(),this.handleConfirm()}},this.renderGuestDeliveryForm(),t("div",{class:"s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single",style:{padding:"24px"}},t("salla-button",{type:"submit",loading:this.confirming,disabled:!e||this.confirming,width:"wide"},i),!this.isLoggedIn&&t("button",{type:"button",class:"s-bullet-delivery-login-prompt",onClick:()=>this.handleLogin()},Salla.lang.get("pages.checkout.login_to_use_saved_addresses"))))}renderBranchSearch(){return t("div",{class:"s-bullet-delivery-branch-search"},t("div",{class:"s-bullet-delivery-search-row"},t("div",{class:"s-bullet-delivery-search s-bullet-delivery-branch-search-wrap"},t("span",{class:"s-bullet-delivery-search-icon s-bullet-delivery-branch-search-icon",innerHTML:C,"aria-hidden":"true"}),t("input",{type:"text",class:"s-bullet-delivery-branch-search-input form-input",placeholder:Salla.lang.get("pages.checkout.search_for_city_or_branch"),value:this.branchSearchQuery,onInput:t=>this.handleBranchSearch(t),autocomplete:"off"})),t("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},this.loadingNearestBranch?t("span",{class:"s-bullet-delivery-location-icon","aria-hidden":"true"},t("salla-skeleton",{height:"18px",width:"18px"})):t("span",{class:"s-bullet-delivery-location-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="M13.3258 7.65006C13.3258 10.7797 10.7888 13.3167 7.65916 13.3167C4.52955 13.3167 1.99249 10.7797 1.99249 7.65006C1.99249 4.52045 4.52955 1.9834 7.65916 1.9834C10.7888 1.9834 13.3258 4.52045 13.3258 7.65006Z"\n stroke="#555555" stroke-width="1.3" />\n <path d="M14.65 7.65039H13.3167" stroke="#555555" stroke-width="1.3" stroke-linecap="round"\n stroke-linejoin="round" />\n <path d="M1.98336 7.65039L0.650024 7.65039" stroke="#555555" stroke-width="1.3"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M7.65002 0.650065L7.65002 1.9834" stroke="#555555" stroke-width="1.3"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M7.65002 13.3171L7.65002 14.6504" stroke="#555555" stroke-width="1.3"\n stroke-linecap="round" stroke-linejoin="round" />\n <path\n d="M9.64999 7.65039C9.64999 8.75496 8.75456 9.65039 7.64999 9.65039C6.54542 9.65039 5.64999 8.75496 5.64999 7.65039C5.64999 6.54582 6.54542 5.65039 7.64999 5.65039C8.75456 5.65039 9.64999 6.54582 9.64999 7.65039Z"\n stroke="#555555" stroke-width="1.3" />\n</svg>\n ',"aria-hidden":"true"}),t("span",null,Salla.lang.get("pages.checkout.nearest_to_my_location")))),this.locationError&&"branch"===this.activeTab&&t("span",{class:"s-bullet-delivery-error"},this.locationError))}getPreparationTimeLabel(t){if(!t)return null;const e={hour:"pages.checkout.preparation_time_hours",minute:"pages.checkout.preparation_time_minutes",day:"pages.checkout.preparation_time_days"}[t.from.unit];return e?Salla.lang.getWithDefault(e,"من {from} إلى {to} دقائق")?.replace("{from}",String(t.from.value))?.replace("{to}",String(t.to.value)):null}renderBranchList(){return this.loadingBranches?t("div",{class:"s-bullet-delivery-branches-wrap"},t("div",{class:"s-bullet-delivery-branches-loading"},[1,2,3,4].map((e=>t("div",{key:e,class:"s-bullet-delivery-branch-skeleton"},t("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-radio",type:"circle",height:"16px",width:"16px"}),t("div",{class:"s-bullet-delivery-branch-skeleton-icon"},t("salla-skeleton",{height:"34px",width:"34px"})),t("div",{class:"s-bullet-delivery-branch-skeleton-content"},t("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-title",height:"12px",width:"124px"})),t("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-time",height:"12px",width:"88px"}),t("div",{class:"s-bullet-delivery-branch-skeleton-map"},t("salla-skeleton",{height:"32px",width:"32px"}))))))):0===this.filteredBranches.length?t("salla-placeholder",{alignment:"center",class:"s-bullet-delivery-placeholder"},t("span",{slot:"title"},Salla.lang.get("pages.checkout.no_pickup_branches_found"))):t("div",{class:"s-bullet-delivery-branches-wrap"},t("ul",{class:"s-bullet-delivery-branches-list s-scrollbar"},this.filteredBranches.map((e=>{const i=g(e),s=e?.pickup_readiness,r=[e.country?.name,e.city?.name,e.district?.name].filter(Boolean).join(", "),l=this.getPreparationTimeLabel(e.preparation_time_range);return t("li",{key:e.id,class:{"s-bullet-delivery-branch-item":!0,"s-bullet-delivery-branch-item--selected":this.selectedBranch?.id===e.id,"s-bullet-delivery-branch-item--disabled":!i},tabIndex:i?0:-1,role:"option","aria-disabled":!i,onClick:()=>i&&this.handleBranchSelect(e),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),i&&this.handleBranchSelect(e))}},t("input",{type:"radio",name:"branch",class:"s-bullet-delivery-radio",checked:this.selectedBranch?.id===e.id,disabled:!i}),t("span",{class:"s-bullet-delivery-branch-icon","aria-hidden":"true"},t("span",{innerHTML:N})),t("div",{class:"flex flex-col"},t("div",{class:"flex items-center gap-1 mb-1"},t("p",{class:"s-bullet-delivery-branch-name text-start"},e.name),s?.label&&t("p",{class:"branch-status-badge"+(s.color?` ${s.color}`:"")},s.label)),r?t("span",{class:"s-bullet-delivery-branch-prep",style:{fontSize:"0.8rem",lineHeight:"1.1rem",textAlign:this.isRTL?"right":"left"}},t("i",{class:"sicon-location"})," ",t("span",{class:"first-letter-cap"},r)):null,l?t("span",{class:"s-bullet-delivery-branch-prep",style:{fontSize:"0.8rem",lineHeight:"1.1rem",textAlign:this.isRTL?"right":"left"}},t("i",{class:"sicon-clock"})," ",t("span",{class:"first-letter-cap"},Salla.lang.get("pages.checkout.pickup_duration"),": ",l)):null,s?.detail_line&&t("span",{class:"s-bullet-delivery-branch-prep",style:{fontSize:"0.8rem",lineHeight:"1.1rem",textAlign:this.isRTL?"right":"left"}},t("i",{class:"sicon-store"})," ",s.detail_line)),t("div",{style:{width:"full",maxWidth:"50px",marginInlineStart:"auto"}},null!=e.location?.lat&&null!=e.location?.lng&&t("a",{href:`https://www.google.com/maps?q=${e.location.lat},${e.location.lng}`,target:"_blank",rel:"noopener noreferrer",class:"s-bullet-delivery-branch-map-link",title:Salla.lang.get("common.elements.open_in_google_maps"),onClick:t=>t.stopPropagation()},t("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_${e.id}`),"aria-hidden":"true"}),t("span",{class:"sr-only"},Salla.lang.get("common.elements.open_in_google_maps")))))}))))}renderPickupTab(){return t("div",{class:{"s-bullet-delivery-content":!0,"s-bullet-delivery-content--active":"branch"===this.activeTab,"s-hidden":"branch"!==this.activeTab}},this.renderCountrySelect(),this.renderBranchSearch(),this.renderBranchList())}renderAddAddressForm(){const e=this.isMapModeAvailable,i=l(this.selectedCountry?.code??""),s=this.hasMapLocation();let r,o;if(e)r=this.canConfirmMapLocation(),o=this.confirming?Salla.lang.get("pages.checkout.loading"):Salla.lang.get("pages.checkout.confirm_address");else{const t=this.selectedCountry&&this.selectedCity&&(!i||this.selectedRegion)&&(!i||!!this.selectedDistrict||!!(this.districtName&&this.districtName.trim().length>0));r=s||t,o=this.confirming?Salla.lang.get("pages.checkout.loading"):Salla.lang.get("pages.checkout.confirm_address")}return t("div",{class:"s-bullet-delivery-add-address"},this.allocationOutOfCoverageMessage&&this.renderAllocationOutOfCoverageAlert(),t("form",{class:"s-bullet-delivery-add-address-form",onSubmit:t=>{t.preventDefault(),this.handleSubmitNewAddress(t)}},this.renderGuestDeliveryForm(),t("div",{class:"s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single"},t("salla-button",{type:"submit",loading:this.confirming,disabled:!r||this.confirming,class:"s-bullet-delivery-add-address-submit"},o),this.hasAddressesToGoBack()&&t("salla-button",{shape:"link",class:"s-bullet-delivery-back-to-list-link",onClick:()=>this.handleBackToAddressList()},Salla.lang.getWithDefault("pages.checkout.saved_addresses","العناوين المحفوظة"),t("i",{class:"sicon-arrow-left"})))))}renderFooter(){if("address"===this.activeTab&&!this.isLoggedIn&&this.isMapModeAvailable)return null;const e="address"===this.activeTab&&this.isLoggedIn;return t("div",{class:"s-bullet-delivery-footer"},t("salla-button",{ref:t=>{this.confirmBtn=t},disabled:this.isConfirmDisabled(),onClick:()=>this.handleConfirm(),"loader-position":"center",width:"wide"},"branch"===this.activeTab?Salla.lang.get("pages.checkout.confirm_receipt_from_the_branch"):Salla.lang.get("pages.checkout.confirm_address")),e&&t("salla-button",{onClick:()=>this.handleAddNewAddress(),width:"wide",shape:"link"},Salla.lang.get("pages.checkout.add_new_address")),!this.isLoggedIn&&t("salla-button",{shape:"link",onClick:()=>this.handleLogin()},Salla.lang.get("pages.checkout.login_to_use_saved_addresses")))}renderMainView(){const e=this.isLoggedIn&&"address"===this.activeTab&&0===this.savedAddresses.length&&!h(this.getStoredIntent()),i="branch"===this.activeTab&&this.supportsPickup?this.renderPickupTab():this.renderDeliveryTab();return t("div",null,this.showCartWillBeClearedBanner&&this.renderAlert(Salla.lang.get("blocks.scope.empty_cart_warning")),this.allocationOutOfCoverageMessage&&this.renderAllocationOutOfCoverageAlert(),i,!e&&this.renderFooter())}handleAfterAddToCart(){if("after_add_to_cart"!==this.openingType)return;const t=this.shouldPromptIncompleteIntentThisSession();this.hasBeenShownThisSession()&&!t||this.modal?.hasAttribute?.("visible")||(t&&this.markIncompleteIntentPrompted(),this.open(!1,t?"incomplete_intent":"after_add_to_cart"))}overrideScopeSwitchUI(){const t=this.getStoredIntent(),e=document.querySelector('[onclick*="scopes"]');if(!e)return;const i=(t,e)=>t&&t.length>e?`${t.slice(0,e)}...`:t??"",s=t?"branch"===t.type?`${Salla.lang.get("mobile_app.strings.pickup")} ${Salla.lang.get("common.elements.from")} ${i(t.branch_details?.name,20)}`:`${Salla.lang.get("mobile_app.strings.delivery")} ${Salla.lang.get("common.elements.to")} ${i(t.address_details?.city?.name||(k(t)?t.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)();e.style.display="inline-flex",e.onclick=()=>this.open();const r=e.querySelector('span:not([class*="sicon"]):not([class*="icon"])');if(r)r.textContent=s;else{const t=Array.from(e.childNodes).find((t=>t.nodeType===Node.TEXT_NODE&&t.textContent?.trim()));t&&(t.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((t=>{this.pendingCartSubmitResolver=t,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(t){console.warn("SallaBulletDelivery: overrideScopeSwitchUI failed",t)}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(t){let e=!1,i=null;const s=()=>{!e&&i&&t(i.state)};return D().then((r=>{e||(i=r,i?(t(i.state),i.addEventListener?.("change",s)):t("unknown"))})),()=>{e=!0,i?.removeEventListener?.("change",s),i=null}}((t=>{this.locationPermissionResolved=!0,this.handleLocationPermissionChanged(t).then((()=>{this.mapReady&&!B(t)&&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=t=>{t?.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:t(s,{class:"s-bullet-delivery"},t("salla-modal",{ref:t=>{this.modal=t},isClosable:!this.isRequired&&!this.shouldForceNonClosable(),onModalVisibilityChanged:t=>{t.target===this.modal&&this.handleModalVisibility(Boolean(t.detail))},class:"s-bullet-delivery-modal",width:"sm","data-testid":"salla-bullet-delivery-modal"},t("div",{class:"s-bullet-delivery-inner"},t("div",{class:"s-bullet-delivery-header"},t("h2",{class:"s-bullet-delivery-title"},"address"===this.activeTab?Salla.lang.get("blocks.home.add_address_for_order_delivery"):Salla.lang.get("blocks.home.choose_branch_for_order_pickup")),t("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=t=>{const e=this.extractMobileSelectPayload(t);e?this.applyMobileBulletDeliverySelection(e):console.warn("SallaBulletDelivery: received empty mobile select payload",t)},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 t=this.createCartViewElement();t&&"function"==typeof salla?.hooks?.mount&&Salla.hooks.mount("cart:items.start",t).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)}};E.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},E.DROPDOWN_SEARCH_DEBOUNCE_MS=400,E.DROPDOWN_SEARCH_MIN_CHARS=2,E.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}.first-letter-cap::first-letter{text-transform:uppercase}.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)}}.branch-status-badge{display:inline-flex;align-items:center;justify-content:center;padding:2px 6px;max-height:20px;border-radius:20px;font-size:9px;font-weight:500;border:1px solid transparent;white-space:nowrap}.branch-status-badge.green{color:#43a047;background:#e8f5e9;border-color:#43a047}.branch-status-badge.blue{color:#1e88e5;background:#e3f2fd;border-color:#1e88e5}.branch-status-badge.red{color:#e53935;background:#fdf2f2;border-color:#e53935}.branch-status-badge.yellow{color:#f9a825;background:#fff8e1;border-color:#f9a825}.branch-status-badge.gray{color:#757575;background:#f5f5f5;border-color:#757575}.branch-status-badge.brown{color:#6d4c41;background:#efebe9;border-color:#6d4c41}.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}.static{position:static}.mb-1{margin-bottom:0.25rem}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.resize{resize:both}.flex-col{flex-direction:column}.items-center{align-items:center}.gap-1{gap:0.25rem}.text-start{text-align:start}.\\!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 G=class{constructor(t){e(this,t),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(t){salla?.logger?.warn?.("salla-bullet-delivery-tag: init failed",t),this.isEligible=!1}}getTagLabel(){const t="en"===salla.config.get("user.language_code")?"Get it within 2 hours":"توصيل خلال ساعتين";return salla.lang.getWithDefault("pages.products.quick_delivery_tag",t)}render(){return this.isEligible?t(s,{class:"s-bullet-delivery-tag-wrapper"},t("span",{class:"s-bullet-delivery-tag-container","data-testid":"bd-tag"},t("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'}),t("span",{class:"s-bullet-delivery-tag-label"},this.getTagLabel()))):null}};G.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 R=class{constructor(t){e(this,t),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=t=>{this.isOpen?this.navigateItems(t):"Enter"===t.key||" "===t.key||"ArrowDown"===t.key?(t.preventDefault(),this.open()):"Escape"===t.key&&this.close()},this.handleSearchInputChange=t=>{const e=t.target.value;this.clientSearch&&(this.clientSearchQuery=e),this.searchInput.emit(e),this.focusedIndex=-1},this.handleSearchKeyDown=t=>{this.navigateItems(t)}}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(t){return t.replace(/[أإآا]/g,"ا")}get filteredItems(){if(!this.clientSearch||!this.clientSearchQuery.trim())return this.items;const t=this.normalizeArabic(this.clientSearchQuery.trim().toLowerCase());return this.items.filter((e=>{const i=this.normalizeArabic(e.name.toLowerCase()),s=e.name_en?e.name_en.toLowerCase():"";return i.includes(t)||s.includes(t)}))}getDisplayName(t){const e=salla?.config?.get("user.language_code");return e&&"ar"!==e&&t.name_en?.trim()?t.name_en.trim():t.name}handleClickOutside(t){this.isOpen&&(this.host.contains(t.target)||this.close())}findScrollableAncestor(){let t=this.host.parentElement;for(;t;){const e=getComputedStyle(t),i=e.overflowY;if("auto"===i||"scroll"===i||"hidden"===i||"clip"===e.overflow)return t;t=t.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(t){const e=this.filteredItems,i=e.length;switch(t.key){case"ArrowDown":t.preventDefault(),this.focusedIndex=i>0?(this.focusedIndex+1)%i:-1,this.scrollFocusedIntoView();break;case"ArrowUp":t.preventDefault(),this.focusedIndex=i>0?(this.focusedIndex-1+i)%i:-1,this.scrollFocusedIntoView();break;case"Enter":t.preventDefault(),this.focusedIndex>=0&&this.focusedIndex<i&&this.selectItem(e[this.focusedIndex]);break;case"Escape":t.preventDefault(),this.close()}}scrollFocusedIntoView(){this.focusedIndex<0||requestAnimationFrame((()=>{const t=this.panelRef?.querySelector(".s-searchable-dropdown-list"),e=t?.children[this.focusedIndex];e?.scrollIntoView({block:"nearest"})}))}selectItem(t){this.itemSelected.emit(t),this.close()}render(){const e=null!=this.selectedItem,i=`${this.inputId}-listbox`;return t(s,{key:"eadd6ff762e66bc3458d19f7d2490da939a268d0",class:"s-searchable-dropdown"},t("div",{key:"0cb614d73e06626c0cd3b5e5eadc76ebfc296093",class:{"s-searchable-dropdown":!0,"s-searchable-dropdown--open":this.isOpen}},this.label&&t("label",{key:"6f3c440ccad07f3ab271f85f508ddf6294464947",class:"s-searchable-dropdown-label",htmlFor:this.inputId},this.label,this.required&&t("span",{key:"9415e3b6b87e702079c2fc810aa7621e623e5641",class:"s-searchable-dropdown-required"}," *")),t("div",{key:"7ed8979005ef68e40976a536ead5da4c736bb0ba",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},e?t("span",{class:"s-searchable-dropdown-trigger-text"},this.getDisplayName(this.selectedItem)):t("span",{class:"s-searchable-dropdown-trigger-placeholder"},this.placeholder),t("i",{key:"7df0a517cb916ad6652544c1b738c569ab2f290f",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&&t("div",{key:"797dea9a0b0a26402132f5d33c49b74cde5f617d",class:{"s-searchable-dropdown-panel":!0,"s-searchable-dropdown-panel--up":this.dropUp},ref:t=>this.panelRef=t},this.searchable&&t("div",{key:"e7b7ec94dbc99ac40a1f833b7aa61c5d2a8742b7",class:"s-searchable-dropdown-search-wrap"},t("i",{key:"59fc0e1986726f99639688c18bc6c501fae966b4",class:"sicon-search s-searchable-dropdown-search-icon","aria-hidden":"true"}),t("input",{key:"70a63f4297d7f1f204d95336cc6aaea28d8f14e1",ref:t=>this.searchInputRef=t,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})),t("div",{key:"f998cc8115062d98befdb814cba0a282c491ef4e",id:i,class:"s-searchable-dropdown-list s-scrollbar",role:"listbox"},this.renderListContent()))))}renderListContent(){if(this.searching||this.loading)return t("div",{class:"s-searchable-dropdown-loading"},t("svg",{class:"s-searchable-dropdown-spinner",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round",opacity:"0.25"}),t("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round"})));const e=this.filteredItems;return 0===e.length?t("div",{class:"s-searchable-dropdown-empty"},this.noResultsText||salla?.lang?.get("common.elements.no_options")||"No results found"):e.map(((e,i)=>{const s=this.selectedItem?.id===e.id;return t("button",{key:e.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(e)},t("span",{class:{"s-searchable-dropdown-item-name":!0,"s-searchable-dropdown-item-name--selected":s}},this.getDisplayName(e)),s&&t("i",{class:"sicon-check s-searchable-dropdown-item-check","aria-hidden":"true"}))}))}get host(){return r(this)}static get watchers(){return{items:["onItemsChange"]}}};R.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{E as salla_bullet_delivery,G as salla_bullet_delivery_tag,R as salla_searchable_dropdown}