@salla.sa/twilight-components 2.14.573 → 2.14.574

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 (372) hide show
  1. package/dist/cjs/{Helper-N5wrs9vm.js → Helper-8U7zlpC3.js} +171 -117
  2. package/dist/cjs/{filepond-B2iMbV1F.js → filepond-BqzmHqFG.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-poster-rXYiM_Ob.js → filepond-plugin-file-poster-Rc_hYm4g.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-size-BF5dedmz.js → filepond-plugin-file-validate-size-MQOyXwCH.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-file-validate-type-DJHYRny2.js → filepond-plugin-file-validate-type-0_gq-gig.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-edit-BgtH5f4u.js → filepond-plugin-image-edit-DjWvYOF_.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-exif-orientation-C9JH8EBn.js → filepond-plugin-image-exif-orientation-BGNpJuyh.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-preview-CpSCiqfj.js → filepond-plugin-image-preview-BoPR2rRr.js} +1 -1
  9. package/dist/cjs/heart-ClVn_Co8.js +13 -0
  10. package/dist/cjs/{index-DpXwHFVO.js → index-BGm5j5Zj.js} +14 -10
  11. package/dist/cjs/index-CIbBkRPw.js +4413 -0
  12. package/dist/cjs/{intlTelInput-CdZOfaWd.js → intlTelInput-CIZvknP0.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 +2 -2
  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 +11 -11
  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 +9 -4403
  26. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +2 -2
  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 +2 -2
  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 +1 -1
  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-fulfillment-methods.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-gift-card-redeem.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
  46. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-notification-item_2.cjs.entry.js +2 -2
  65. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-orders.cjs.entry.js +2 -2
  80. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-product-card.cjs.entry.js +5 -11
  85. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-products-list.cjs.entry.js +2 -2
  87. package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
  88. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +5 -6
  90. package/dist/cjs/salla-rating-modal.cjs.entry.js +5 -6
  91. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-user-menu.cjs.entry.js +3 -3
  104. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  105. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  106. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  107. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  108. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  109. package/dist/cjs/salla-wishlist-summary.cjs.entry.js +48 -0
  110. package/dist/cjs/{shipping-fast-CsqEQE78.js → star-tn5w5Um0.js} +8 -0
  111. package/dist/cjs/twilight.cjs.js +2 -2
  112. package/dist/cjs/{vanilla-picker-BT9OjZCy.js → vanilla-picker-BwaB87Xi.js} +1 -1
  113. package/dist/collection/Helpers/Helper.js +171 -117
  114. package/dist/collection/collection-manifest.json +2 -1
  115. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +8 -4
  116. package/dist/collection/components/salla-cart-summary/salla-cart-summary.css +1 -1
  117. package/dist/collection/components/salla-user-menu/salla-user-menu.js +1 -1
  118. package/dist/collection/components/salla-wishlist-summary/salla-wishlist-summary.css +62 -0
  119. package/dist/collection/components/salla-wishlist-summary/salla-wishlist-summary.js +65 -0
  120. package/dist/components/Helper.js +171 -117
  121. package/dist/components/heart.js +11 -0
  122. package/dist/components/index.js +2 -2
  123. package/dist/components/index2.js +4322 -2471
  124. package/dist/components/index3.js +2553 -0
  125. package/dist/components/salla-bullet-delivery.js +44 -4438
  126. package/dist/components/salla-cart-summary.js +1 -1
  127. package/dist/components/salla-datetime-picker2.js +1 -1
  128. package/dist/components/salla-product-card2.js +4 -10
  129. package/dist/components/salla-rating-modal-v2.js +1 -1
  130. package/dist/components/salla-rating-modal-v22.js +9 -3
  131. package/dist/components/salla-rating-modal2.js +2 -3
  132. package/dist/components/salla-user-menu.js +2 -2
  133. package/dist/components/salla-wishlist-summary.d.ts +11 -0
  134. package/dist/components/salla-wishlist-summary.js +67 -0
  135. package/dist/esm/{Helper-Cql-WbqR.js → Helper-ivBHT_nn.js} +171 -117
  136. package/dist/esm/{filepond-BsuscqtG.js → filepond-DcoYtlMX.js} +1 -1
  137. package/dist/esm/{filepond-plugin-file-poster-DZ4ckjsP.js → filepond-plugin-file-poster-CBcS6Ln1.js} +1 -1
  138. package/dist/esm/{filepond-plugin-file-validate-size-BV6807xx.js → filepond-plugin-file-validate-size-HuNTwpc9.js} +1 -1
  139. package/dist/esm/{filepond-plugin-file-validate-type-cWCM2RqT.js → filepond-plugin-file-validate-type-BOjEfXdn.js} +1 -1
  140. package/dist/esm/{filepond-plugin-image-edit-aQvaKLxK.js → filepond-plugin-image-edit-BL7zREI5.js} +1 -1
  141. package/dist/esm/{filepond-plugin-image-exif-orientation-FgW7hBXK.js → filepond-plugin-image-exif-orientation-BJgL9era.js} +1 -1
  142. package/dist/esm/{filepond-plugin-image-preview-DxogdDqd.js → filepond-plugin-image-preview-DPUJHFk0.js} +1 -1
  143. package/dist/esm/heart-00vBRoH3.js +11 -0
  144. package/dist/esm/{index-DSEA3vdh.js → index-BXNtVhVe.js} +14 -10
  145. package/dist/esm/index-wXSgmenB.js +4404 -0
  146. package/dist/esm/{intlTelInput-BLEGv9EO.js → intlTelInput-wU6Kly2g.js} +1 -1
  147. package/dist/esm/loader.js +3 -3
  148. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  149. package/dist/esm/salla-accordion_6.entry.js +2 -2
  150. package/dist/esm/salla-add-product-button_5.entry.js +2 -2
  151. package/dist/esm/salla-advertisement.entry.js +1 -1
  152. package/dist/esm/salla-alert_2.entry.js +1 -1
  153. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  154. package/dist/esm/salla-applied-filters.entry.js +2 -2
  155. package/dist/esm/salla-apps-icons.entry.js +1 -1
  156. package/dist/esm/salla-attachment-view_9.entry.js +11 -11
  157. package/dist/esm/salla-badge.entry.js +1 -1
  158. package/dist/esm/salla-basket-gap.entry.js +1 -1
  159. package/dist/esm/salla-bullet-delivery_3.entry.js +53 -4447
  160. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  161. package/dist/esm/salla-cart-item-offers_2.entry.js +2 -2
  162. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  163. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  164. package/dist/esm/salla-comment-factors.entry.js +1 -1
  165. package/dist/esm/salla-comment-form_9.entry.js +2 -2
  166. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  167. package/dist/esm/salla-contacts.entry.js +1 -1
  168. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  169. package/dist/esm/salla-count-down.entry.js +1 -1
  170. package/dist/esm/salla-custom-fields.entry.js +1 -1
  171. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  172. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  173. package/dist/esm/salla-filters-widget.entry.js +2 -2
  174. package/dist/esm/salla-filters.entry.js +2 -2
  175. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  176. package/dist/esm/salla-gift-card-redeem.entry.js +1 -1
  177. package/dist/esm/salla-gifting.entry.js +1 -1
  178. package/dist/esm/salla-hook.entry.js +1 -1
  179. package/dist/esm/salla-infinite-scroll.entry.js +2 -2
  180. package/dist/esm/salla-installment.entry.js +1 -1
  181. package/dist/esm/salla-list-tile.entry.js +1 -1
  182. package/dist/esm/salla-localization-modal.entry.js +1 -1
  183. package/dist/esm/salla-login-modal.entry.js +1 -1
  184. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  185. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  186. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  187. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  188. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  189. package/dist/esm/salla-loyalty.entry.js +1 -1
  190. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  191. package/dist/esm/salla-map_3.entry.js +1 -1
  192. package/dist/esm/salla-menu.entry.js +1 -1
  193. package/dist/esm/salla-metadata.entry.js +1 -1
  194. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  195. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  196. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  197. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  198. package/dist/esm/salla-notification-item_2.entry.js +2 -2
  199. package/dist/esm/salla-offer-modal.entry.js +1 -1
  200. package/dist/esm/salla-offer.entry.js +1 -1
  201. package/dist/esm/salla-order-branch.entry.js +1 -1
  202. package/dist/esm/salla-order-cancel.entry.js +1 -1
  203. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  204. package/dist/esm/salla-order-details-options.entry.js +1 -1
  205. package/dist/esm/salla-order-details.entry.js +1 -1
  206. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  207. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  208. package/dist/esm/salla-order-edit.entry.js +1 -1
  209. package/dist/esm/salla-order-options-modal.entry.js +1 -1
  210. package/dist/esm/salla-order-shipments.entry.js +1 -1
  211. package/dist/esm/salla-order-summary.entry.js +1 -1
  212. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  213. package/dist/esm/salla-orders.entry.js +2 -2
  214. package/dist/esm/salla-payments.entry.js +1 -1
  215. package/dist/esm/salla-placeholder.entry.js +1 -1
  216. package/dist/esm/salla-price-range.entry.js +1 -1
  217. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  218. package/dist/esm/salla-product-card.entry.js +2 -8
  219. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  220. package/dist/esm/salla-products-list.entry.js +2 -2
  221. package/dist/esm/salla-products-slider.entry.js +2 -2
  222. package/dist/esm/salla-quick-order.entry.js +1 -1
  223. package/dist/esm/salla-rating-modal-v2.entry.js +3 -4
  224. package/dist/esm/salla-rating-modal.entry.js +3 -4
  225. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  226. package/dist/esm/salla-review-order-item.entry.js +1 -1
  227. package/dist/esm/salla-scopes.entry.js +1 -1
  228. package/dist/esm/salla-search-product-card.entry.js +1 -1
  229. package/dist/esm/salla-search.entry.js +1 -1
  230. package/dist/esm/salla-skeleton.entry.js +1 -1
  231. package/dist/esm/salla-social-share.entry.js +1 -1
  232. package/dist/esm/salla-social.entry.js +1 -1
  233. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  234. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  235. package/dist/esm/salla-tooltip.entry.js +1 -1
  236. package/dist/esm/salla-trust-badges.entry.js +1 -1
  237. package/dist/esm/salla-user-menu.entry.js +5 -5
  238. package/dist/esm/salla-user-profile.entry.js +1 -1
  239. package/dist/esm/salla-user-settings.entry.js +1 -1
  240. package/dist/esm/salla-verify.entry.js +1 -1
  241. package/dist/esm/salla-wallet.entry.js +1 -1
  242. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  243. package/dist/esm/salla-wishlist-summary.entry.js +46 -0
  244. package/dist/esm/{shipping-fast-lMgMt31Q.js → star-cq6TcfoH.js} +8 -1
  245. package/dist/esm/twilight.js +3 -3
  246. package/dist/esm/{vanilla-picker-BpgJFvog.js → vanilla-picker-CFcUgW74.js} +1 -1
  247. package/dist/twilight/p-00vBRoH3.js +4 -0
  248. package/dist/twilight/{p-035b561c.entry.js → p-02eccebc.entry.js} +1 -1
  249. package/dist/twilight/p-043b2382.entry.js +4 -0
  250. package/dist/twilight/{p-2304f0a4.entry.js → p-0a135b25.entry.js} +1 -1
  251. package/dist/twilight/{p-5d41dc4e.entry.js → p-0bcaa1af.entry.js} +1 -1
  252. package/dist/twilight/{p-bbb72d38.entry.js → p-0d18b6f2.entry.js} +1 -1
  253. package/dist/twilight/p-12822eba.entry.js +4 -0
  254. package/dist/twilight/{p-82455313.entry.js → p-16b9ea73.entry.js} +1 -1
  255. package/dist/twilight/{p-5d0fd545.entry.js → p-1853b5ba.entry.js} +1 -1
  256. package/dist/twilight/p-1a4028e2.entry.js +4 -0
  257. package/dist/twilight/{p-010fa509.entry.js → p-1bcacd6b.entry.js} +1 -1
  258. package/dist/twilight/{p-f306bfe3.entry.js → p-1ea4c8e4.entry.js} +1 -1
  259. package/dist/twilight/{p-e5bb52fb.entry.js → p-22087f33.entry.js} +1 -1
  260. package/dist/twilight/{p-5d97cf2d.entry.js → p-23540811.entry.js} +1 -1
  261. package/dist/twilight/{p-3c665085.entry.js → p-2e08cf78.entry.js} +1 -1
  262. package/dist/twilight/{p-4a3701ca.entry.js → p-2ee3c58e.entry.js} +1 -1
  263. package/dist/twilight/{p-901217bc.entry.js → p-38806031.entry.js} +1 -1
  264. package/dist/twilight/{p-d654b4b0.entry.js → p-3ae64529.entry.js} +1 -1
  265. package/dist/twilight/{p-f173ada5.entry.js → p-3e7a7eb0.entry.js} +1 -1
  266. package/dist/twilight/{p-3eb55e32.entry.js → p-43124a9d.entry.js} +1 -1
  267. package/dist/twilight/{p-7afeb088.entry.js → p-44899fd8.entry.js} +1 -1
  268. package/dist/twilight/{p-c15d08ae.entry.js → p-4563fd77.entry.js} +1 -1
  269. package/dist/twilight/{p-276171ac.entry.js → p-48f47f92.entry.js} +1 -1
  270. package/dist/twilight/{p-b6ece925.entry.js → p-50a88286.entry.js} +1 -1
  271. package/dist/twilight/{p-6fb16543.entry.js → p-52c31b1a.entry.js} +1 -1
  272. package/dist/twilight/{p-77dc1637.entry.js → p-565eda17.entry.js} +1 -1
  273. package/dist/twilight/p-6142183b.entry.js +4 -0
  274. package/dist/twilight/{p-909ae4c5.entry.js → p-6210a661.entry.js} +1 -1
  275. package/dist/twilight/{p-69e8750f.entry.js → p-6665f42e.entry.js} +1 -1
  276. package/dist/twilight/{p-e0b085e4.entry.js → p-6b378bcd.entry.js} +1 -1
  277. package/dist/twilight/{p-75652fd4.entry.js → p-6d56ebac.entry.js} +1 -1
  278. package/dist/twilight/{p-6904ad04.entry.js → p-6fe398ae.entry.js} +1 -1
  279. package/dist/twilight/{p-aadeb35a.entry.js → p-70147959.entry.js} +1 -1
  280. package/dist/twilight/{p-09e126b0.entry.js → p-70eaceea.entry.js} +1 -1
  281. package/dist/twilight/{p-1f1dda08.entry.js → p-71ec3f8a.entry.js} +1 -1
  282. package/dist/twilight/p-747153bc.entry.js +4 -0
  283. package/dist/twilight/{p-4944d10a.entry.js → p-76403e24.entry.js} +1 -1
  284. package/dist/twilight/{p-77323c2a.entry.js → p-78a84f80.entry.js} +1 -1
  285. package/dist/twilight/p-79f495b7.entry.js +4 -0
  286. package/dist/twilight/{p-e5c07741.entry.js → p-7a099b00.entry.js} +1 -1
  287. package/dist/twilight/{p-51434773.entry.js → p-817cfe1a.entry.js} +1 -1
  288. package/dist/twilight/{p-6a605835.entry.js → p-853b2efe.entry.js} +1 -1
  289. package/dist/twilight/{p-4a447633.entry.js → p-8666489e.entry.js} +1 -1
  290. package/dist/twilight/{p-9fe36a97.entry.js → p-88f762de.entry.js} +1 -1
  291. package/dist/twilight/{p-1acd987a.entry.js → p-8e114c27.entry.js} +1 -1
  292. package/dist/twilight/{p-b1c21e5c.entry.js → p-8f3642d1.entry.js} +1 -1
  293. package/dist/twilight/{p-db53fade.entry.js → p-900f78b6.entry.js} +1 -1
  294. package/dist/twilight/{p-7e0698c6.entry.js → p-90aa29f3.entry.js} +1 -1
  295. package/dist/twilight/{p-5329003d.entry.js → p-91e4594d.entry.js} +1 -1
  296. package/dist/twilight/{p-84ec7be7.entry.js → p-9282b995.entry.js} +1 -1
  297. package/dist/twilight/{p-06419603.entry.js → p-98137b26.entry.js} +1 -1
  298. package/dist/twilight/{p-62a44e65.entry.js → p-987a75aa.entry.js} +1 -1
  299. package/dist/twilight/{p-3c5e2710.entry.js → p-9979ada5.entry.js} +1 -1
  300. package/dist/twilight/{p-d9be4036.entry.js → p-9cca8055.entry.js} +1 -1
  301. package/dist/twilight/{p-3040407e.entry.js → p-9d667925.entry.js} +1 -1
  302. package/dist/twilight/{p-8ae70528.entry.js → p-9dfe1ec1.entry.js} +1 -1
  303. package/dist/twilight/{p-0764c46b.entry.js → p-9f23104d.entry.js} +1 -1
  304. package/dist/twilight/{p-WgGO2Pjy.js → p-BFib9jF0.js} +1 -1
  305. package/dist/twilight/{p-DSEA3vdh.js → p-BXNtVhVe.js} +2 -2
  306. package/dist/twilight/{p-VBuS91fQ.js → p-BpnCDmiM.js} +1 -1
  307. package/dist/twilight/{p-B3sbQMcp.js → p-C3JsXKHY.js} +1 -1
  308. package/dist/twilight/{p-BZt79QeE.js → p-CDojVREu.js} +1 -1
  309. package/dist/twilight/{p-DDcSXlpO.js → p-CMcDoqmG.js} +1 -1
  310. package/dist/twilight/{p-BF2su8FM.js → p-COQlWLWv.js} +1 -1
  311. package/dist/twilight/{p-Bj6lP8RV.js → p-CPkPdW2Q.js} +1 -1
  312. package/dist/twilight/p-CbVZf-Q4.js +4 -0
  313. package/dist/twilight/{p-Bt0GXtZG.js → p-D9StCBh9.js} +2 -2
  314. package/dist/twilight/p-DI6PJLEJ.js +1024 -0
  315. package/dist/twilight/{p-6cc3e44d.entry.js → p-a0c5bc92.entry.js} +1 -1
  316. package/dist/twilight/{p-c419a909.entry.js → p-a34258d2.entry.js} +1 -1
  317. package/dist/twilight/{p-1063f3d1.entry.js → p-a57e299a.entry.js} +1 -1
  318. package/dist/twilight/{p-89ed6dbc.entry.js → p-a581c552.entry.js} +1 -1
  319. package/dist/twilight/{p-0b514a47.entry.js → p-ab97de5d.entry.js} +1 -1
  320. package/dist/twilight/{p-901a961f.entry.js → p-ac2926d9.entry.js} +1 -1
  321. package/dist/twilight/{p-dd3aacf3.entry.js → p-aec3d7ce.entry.js} +1 -1
  322. package/dist/twilight/{p-663aa63b.entry.js → p-b0671070.entry.js} +1 -1
  323. package/dist/twilight/{p-e90a201a.entry.js → p-b0ff401e.entry.js} +1 -1
  324. package/dist/twilight/{p-ad930532.entry.js → p-b11508cb.entry.js} +1 -1
  325. package/dist/twilight/{p-5c863789.entry.js → p-b5329852.entry.js} +1 -1
  326. package/dist/twilight/{p-DdScDjtA.js → p-b84FyDqk.js} +1 -1
  327. package/dist/twilight/{p-bb2170ac.entry.js → p-bb0bc7ed.entry.js} +1 -1
  328. package/dist/twilight/{p-68aecf40.entry.js → p-bc2203b6.entry.js} +1 -1
  329. package/dist/twilight/{p-bc0f3f06.entry.js → p-bd89bcf5.entry.js} +1 -1
  330. package/dist/twilight/{p-d1c973ce.entry.js → p-bdb558a2.entry.js} +1 -1
  331. package/dist/twilight/{p-b3063b70.entry.js → p-bee482ce.entry.js} +1 -1
  332. package/dist/twilight/{p-f919f0b5.entry.js → p-c0c23759.entry.js} +1 -1
  333. package/dist/twilight/{p-6be347e5.entry.js → p-c163a216.entry.js} +1 -1
  334. package/dist/twilight/{p-ec341307.entry.js → p-c5f087a3.entry.js} +1 -1
  335. package/dist/twilight/{p-5b949ccc.entry.js → p-c67dcc94.entry.js} +1 -1
  336. package/dist/twilight/{p-lMgMt31Q.js → p-cq6TcfoH.js} +1 -1
  337. package/dist/twilight/{p-78ee03f8.entry.js → p-d1520e68.entry.js} +1 -1
  338. package/dist/twilight/{p-54c36ba4.entry.js → p-d365bd72.entry.js} +1 -1
  339. package/dist/twilight/{p-2c07e8ac.entry.js → p-d702af41.entry.js} +1 -1
  340. package/dist/twilight/{p-3b3a1c87.entry.js → p-dbd9523b.entry.js} +1 -1
  341. package/dist/twilight/{p-4557e342.entry.js → p-dc9b9ef7.entry.js} +1 -1
  342. package/dist/twilight/{p-47b1aa89.entry.js → p-de3eeec4.entry.js} +1 -1
  343. package/dist/twilight/{p-e676c627.entry.js → p-dedfcc58.entry.js} +1 -1
  344. package/dist/twilight/{p-66561f9e.entry.js → p-e50b99cb.entry.js} +1 -1
  345. package/dist/twilight/{p-6cdc7f8a.entry.js → p-e6233f15.entry.js} +1 -1
  346. package/dist/twilight/{p-457a256d.entry.js → p-e63f5b80.entry.js} +1 -1
  347. package/dist/twilight/{p-8f2b2e42.entry.js → p-e77d6649.entry.js} +1 -1
  348. package/dist/twilight/{p-855a9db7.entry.js → p-e9cc9f4f.entry.js} +1 -1
  349. package/dist/twilight/{p-6e43f8a7.entry.js → p-eccd8aa9.entry.js} +1 -1
  350. package/dist/twilight/{p-a89fb313.entry.js → p-f174afea.entry.js} +1 -1
  351. package/dist/twilight/{p-360b6388.entry.js → p-f4583bb2.entry.js} +1 -1
  352. package/dist/twilight/{p-fc6adc90.entry.js → p-f48ada4a.entry.js} +1 -1
  353. package/dist/twilight/{p-b414760b.entry.js → p-f583571c.entry.js} +1 -1
  354. package/dist/twilight/{p-fac05e8f.entry.js → p-f7e38710.entry.js} +1 -1
  355. package/dist/twilight/{p-2733e78f.entry.js → p-fc0a3c91.entry.js} +1 -1
  356. package/dist/twilight/{p-61580839.entry.js → p-fd6aed5e.entry.js} +1 -1
  357. package/dist/twilight/twilight.esm.js +1 -1
  358. package/dist/types/Helpers/Helper.d.ts +14 -12
  359. package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +0 -1
  360. package/dist/types/components/salla-wishlist-summary/salla-wishlist-summary.d.ts +18 -0
  361. package/dist/types/components.d.ts +45 -0
  362. package/package.json +5 -5
  363. package/dist/cjs/star-DMzrN05M.js +0 -13
  364. package/dist/components/star.js +0 -11
  365. package/dist/esm/star-CeFAfcTv.js +0 -11
  366. package/dist/twilight/p-5a86a794.entry.js +0 -4
  367. package/dist/twilight/p-8ed45c28.entry.js +0 -4
  368. package/dist/twilight/p-CUSw0W26.js +0 -4
  369. package/dist/twilight/p-CeFAfcTv.js +0 -4
  370. package/dist/twilight/p-b98ae2c1.entry.js +0 -4
  371. package/dist/twilight/p-e91bba7e.entry.js +0 -1024
  372. package/dist/twilight/p-f10fca84.entry.js +0 -4
@@ -1,4411 +1,11 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, c as createEvent, h as h$4, H as Host, a as getElement } from './index-DSEA3vdh.js';
4
+ import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-BXNtVhVe.js';
5
5
  import { a as isSaudiArabia, b as bulletDeliveryAPI, r as requireRegionAndDistrictForSA, g as getIntentLatitude, c as getIntentLongitude, h as hasSessionAddressIntent, d as getIntentCityId, e as getIntentCountryId, f as getIntentRegionId, j as getIntentDistrictId, k as filterBranches, l as findNearestBranch, m as getGeolocationErrorMessage, n as buildAddressLocationPayloadFromSelection, o as clearApiCache, p as getIntentSubtitle, q as getIntentBranchId, i as isMapOriginIntent, s as isBranchSelectable, t as getIntentCountryCode } from './helpers-CV6uPJEJ.js';
6
6
  import { L as Location } from './location-BO5AoBAP.js';
7
7
  import { S as Search } from './search-BscTeWDc.js';
8
8
 
9
- /**
10
- * @license
11
- * Copyright 2019 Google LLC
12
- * SPDX-License-Identifier: BSD-3-Clause
13
- */
14
- const t$1=globalThis,e$2=t$1.ShadowRoot&&(void 0===t$1.ShadyCSS||t$1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$2=Symbol(),o$3=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$2)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$2&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$3.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$3.set(s,t));}return t}toString(){return this.cssText}};const r$2=t=>new n$3("string"==typeof t?t:t+"",void 0,s$2),i$3=(t,...e)=>{const o=1===t.length?t[0]:e.reduce((e,s,o)=>e+(t=>{if(true===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1],t[0]);return new n$3(o,t,s$2)},S$3=(s,o)=>{if(e$2)s.adoptedStyleSheets=o.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of o){const o=document.createElement("style"),n=t$1.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$3=e$2?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$2(e)})(t):t;
15
-
16
- /**
17
- * @license
18
- * Copyright 2017 Google LLC
19
- * SPDX-License-Identifier: BSD-3-Clause
20
- */const{is:i$2,defineProperty:e$1,getOwnPropertyDescriptor:h$3,getOwnPropertyNames:r$1,getOwnPropertySymbols:o$2,getPrototypeOf:n$2}=Object,a$1=globalThis,c$2=a$1.trustedTypes,l$2=c$2?c$2.emptyScript:"",p$2=a$1.reactiveElementPolyfillSupport,d$3=(t,s)=>t,u$2={toAttribute(t,s){switch(s){case Boolean:t=t?l$2:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$3=(t,s)=>!i$2(t,s),b$3={attribute:true,type:String,converter:u$2,reflect:false,useDefault:false,hasChanged:f$3};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;let y$1 = class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b$3){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$1(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$3(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b$3}static _$Ei(){if(this.hasOwnProperty(d$3("elementProperties")))return;const t=n$2(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$3("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$3("properties"))){const t=this.properties,s=[...r$1(t),...o$2(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$3(s));}else void 0!==s&&i.push(c$3(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$3(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach(t=>t.hostConnected?.());}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.());}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u$2).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$2;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null;}}requestUpdate(t,s,i,e=false,h){if(void 0!==t){const r=this.constructor;if(false===e&&(h=this[t]),i??=r.getPropertyOptions(t),!((i.hasChanged??f$3)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM();}updated(t){}firstUpdated(t){}};y$1.elementStyles=[],y$1.shadowRootOptions={mode:"open"},y$1[d$3("elementProperties")]=new Map,y$1[d$3("finalized")]=new Map,p$2?.({ReactiveElement:y$1}),(a$1.reactiveElementVersions??=[]).push("2.1.2");
21
-
22
- /**
23
- * @license
24
- * Copyright 2017 Google LLC
25
- * SPDX-License-Identifier: BSD-3-Clause
26
- */
27
- const t=globalThis,i$1=t=>t,s$1=t.trustedTypes,e=s$1?s$1.createPolicy("lit-html",{createHTML:t=>t}):void 0,h$2="$lit$",o$1=`lit$${Math.random().toFixed(9).slice(2)}$`,n$1="?"+o$1,r=`<${n$1}>`,l$1=document,c$1=()=>l$1.createComment(""),a=t=>null===t||"object"!=typeof t&&"function"!=typeof t,u$1=Array.isArray,d$2=t=>u$1(t)||"function"==typeof t?.[Symbol.iterator],f$2="[ \t\n\f\r]",v$2=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_$2=/-->/g,m=/>/g,p$1=RegExp(`>|${f$2}(?:([^\\s"'>=/]+)(${f$2}*=${f$2}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),g$1=/'/g,$$1=/"/g,y=/^(?:script|style|textarea|title)$/i,x$2=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),b$2=x$2(1),E$1=Symbol.for("lit-noChange"),A$2=Symbol.for("lit-nothing"),C$2=new WeakMap,P$2=l$1.createTreeWalker(l$1,129);function V$2(t,i){if(!u$1(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==e?e.createHTML(i):i}const N$1=(t,i)=>{const s=t.length-1,e=[];let n,l=2===i?"<svg>":3===i?"<math>":"",c=v$2;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,f=0;for(;f<s.length&&(c.lastIndex=f,u=c.exec(s),null!==u);)f=c.lastIndex,c===v$2?"!--"===u[1]?c=_$2:void 0!==u[1]?c=m:void 0!==u[2]?(y.test(u[2])&&(n=RegExp("</"+u[2],"g")),c=p$1):void 0!==u[3]&&(c=p$1):c===p$1?">"===u[0]?(c=n??v$2,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?p$1:'"'===u[3]?$$1:g$1):c===$$1||c===g$1?c=p$1:c===_$2||c===m?c=v$2:(c=p$1,n=void 0);const x=c===p$1&&t[i+1].startsWith("/>")?" ":"";l+=c===v$2?s+r:d>=0?(e.push(a),s.slice(0,d)+h$2+s.slice(d)+o$1+x):s+o$1+(-2===d?i:x);}return [V$2(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),e]};let S$2 = class S{constructor({strings:t,_$litType$:i},e){let r;this.parts=[];let l=0,a=0;const u=t.length-1,d=this.parts,[f,v]=N$1(t,i);if(this.el=S.createElement(f,e),P$2.currentNode=this.el.content,2===i||3===i){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=P$2.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(h$2)){const i=v[a++],s=r.getAttribute(t).split(o$1),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:l,name:e[2],strings:s,ctor:"."===e[1]?I$2:"?"===e[1]?L$2:"@"===e[1]?z$2:H$1}),r.removeAttribute(t);}else t.startsWith(o$1)&&(d.push({type:6,index:l}),r.removeAttribute(t));if(y.test(r.tagName)){const t=r.textContent.split(o$1),i=t.length-1;if(i>0){r.textContent=s$1?s$1.emptyScript:"";for(let s=0;s<i;s++)r.append(t[s],c$1()),P$2.nextNode(),d.push({type:2,index:++l});r.append(t[i],c$1());}}}else if(8===r.nodeType)if(r.data===n$1)d.push({type:2,index:l});else {let t=-1;for(;-1!==(t=r.data.indexOf(o$1,t+1));)d.push({type:7,index:l}),t+=o$1.length-1;}l++;}}static createElement(t,i){const s=l$1.createElement("template");return s.innerHTML=t,s}};function M$2(t,i,s=t,e){if(i===E$1)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=a(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=M$2(t,h._$AS(t,i.values),h,e)),i}let R$2 = class R{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??l$1).importNode(i,true);P$2.currentNode=e;let h=P$2.nextNode(),o=0,n=0,r=s[0];for(;void 0!==r;){if(o===r.index){let i;2===r.type?i=new k$2(h,h.nextSibling,this,t):1===r.type?i=new r.ctor(h,r.name,r.strings,this,t):6===r.type&&(i=new Z$2(h,this,t)),this._$AV.push(i),r=s[++n];}o!==r?.index&&(h=P$2.nextNode(),o++);}return P$2.currentNode=l$1,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}};let k$2 = class k{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=A$2,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=M$2(this,t,i),a(t)?t===A$2||null==t||""===t?(this._$AH!==A$2&&this._$AR(),this._$AH=A$2):t!==this._$AH&&t!==E$1&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):d$2(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==A$2&&a(this._$AH)?this._$AA.nextSibling.data=t:this.T(l$1.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=S$2.createElement(V$2(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new R$2(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=C$2.get(t.strings);return void 0===i&&C$2.set(t.strings,i=new S$2(t)),i}k(t){u$1(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new k(this.O(c$1()),this.O(c$1()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(false,true,s);t!==this._$AB;){const s=i$1(t).nextSibling;i$1(t).remove(),t=s;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}};let H$1 = class H{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=A$2,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=A$2;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=M$2(this,t,i,0),o=!a(t)||t!==this._$AH&&t!==E$1,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=M$2(this,e[s+n],i,n),r===E$1&&(r=this._$AH[n]),o||=!a(r)||r!==this._$AH[n],r===A$2?t=A$2:t!==A$2&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===A$2?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}};let I$2 = class I extends H$1{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===A$2?void 0:t;}};let L$2 = class L extends H$1{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==A$2);}};let z$2 = class z extends H$1{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=M$2(this,t,i,0)??A$2)===E$1)return;const s=this._$AH,e=t===A$2&&s!==A$2||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==A$2&&(s===A$2||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}};let Z$2 = class Z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){M$2(this,t);}};const B$2=t.litHtmlPolyfillSupport;B$2?.(S$2,k$2),(t.litHtmlVersions??=[]).push("3.3.2");const D$2=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new k$2(i.insertBefore(c$1(),t),t,void 0,s??{});}return h._$AI(t),h};
28
-
29
- /**
30
- * @license
31
- * Copyright 2017 Google LLC
32
- * SPDX-License-Identifier: BSD-3-Clause
33
- */const s=globalThis;class i extends y$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=D$2(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return E$1}}i._$litElement$=true,i["finalized"]=true,s.litElementHydrateSupport?.({LitElement:i});const o=s.litElementPolyfillSupport;o?.({LitElement:i});(s.litElementVersions??=[]).push("4.2.2");
34
-
35
- const O$1 = globalThis, H = O$1.ShadowRoot && (O$1.ShadyCSS === void 0 || O$1.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, j$1 = /* @__PURE__ */ Symbol(), Z$1 = /* @__PURE__ */ new WeakMap();
36
- let de = class {
37
- constructor(e, i, r) {
38
- if (this._$cssResult$ = true, r !== j$1) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
39
- this.cssText = e, this.t = i;
40
- }
41
- get styleSheet() {
42
- let e = this.o;
43
- const i = this.t;
44
- if (H && e === void 0) {
45
- const r = i !== void 0 && i.length === 1;
46
- r && (e = Z$1.get(i)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), r && Z$1.set(i, e));
47
- }
48
- return e;
49
- }
50
- toString() {
51
- return this.cssText;
52
- }
53
- };
54
- const ge = (t) => new de(typeof t == "string" ? t : t + "", void 0, j$1), ve = (t, ...e) => {
55
- const i = t.length === 1 ? t[0] : e.reduce((r, s, o) => r + ((a) => {
56
- if (a._$cssResult$ === true) return a.cssText;
57
- if (typeof a == "number") return a;
58
- throw Error("Value passed to 'css' function must be a 'css' function result: " + a + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
59
- })(s) + t[o + 1], t[0]);
60
- return new de(i, t, j$1);
61
- }, be = (t, e) => {
62
- if (H) t.adoptedStyleSheets = e.map((i) => i instanceof CSSStyleSheet ? i : i.styleSheet);
63
- else for (const i of e) {
64
- const r = document.createElement("style"), s = O$1.litNonce;
65
- s !== void 0 && r.setAttribute("nonce", s), r.textContent = i.cssText, t.appendChild(r);
66
- }
67
- }, J$1 = H ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
68
- let i = "";
69
- for (const r of e.cssRules) i += r.cssText;
70
- return ge(i);
71
- })(t) : t;
72
- const { is: ye, defineProperty: $e, getOwnPropertyDescriptor: Ae, getOwnPropertyNames: we, getOwnPropertySymbols: _e, getPrototypeOf: xe } = Object, M$1 = globalThis, X$1 = M$1.trustedTypes, Se = X$1 ? X$1.emptyScript : "", Ee = M$1.reactiveElementPolyfillSupport, T$1 = (t, e) => t, V$1 = { toAttribute(t, e) {
73
- switch (e) {
74
- case Boolean:
75
- t = t ? Se : null;
76
- break;
77
- case Object:
78
- case Array:
79
- t = t == null ? t : JSON.stringify(t);
80
- }
81
- return t;
82
- }, fromAttribute(t, e) {
83
- let i = t;
84
- switch (e) {
85
- case Boolean:
86
- i = t !== null;
87
- break;
88
- case Number:
89
- i = t === null ? null : Number(t);
90
- break;
91
- case Object:
92
- case Array:
93
- try {
94
- i = JSON.parse(t);
95
- } catch {
96
- i = null;
97
- }
98
- }
99
- return i;
100
- } }, W$1 = (t, e) => !ye(t, e), Q$1 = { attribute: true, type: String, converter: V$1, reflect: false, useDefault: false, hasChanged: W$1 };
101
- Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), M$1.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
102
- let E = class extends HTMLElement {
103
- static addInitializer(e) {
104
- this._$Ei(), (this.l ??= []).push(e);
105
- }
106
- static get observedAttributes() {
107
- return this.finalize(), this._$Eh && [...this._$Eh.keys()];
108
- }
109
- static createProperty(e, i = Q$1) {
110
- if (i.state && (i.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(e) && ((i = Object.create(i)).wrapped = true), this.elementProperties.set(e, i), !i.noAccessor) {
111
- const r = /* @__PURE__ */ Symbol(), s = this.getPropertyDescriptor(e, r, i);
112
- s !== void 0 && $e(this.prototype, e, s);
113
- }
114
- }
115
- static getPropertyDescriptor(e, i, r) {
116
- const { get: s, set: o } = Ae(this.prototype, e) ?? { get() {
117
- return this[i];
118
- }, set(a) {
119
- this[i] = a;
120
- } };
121
- return { get: s, set(a) {
122
- const n = s?.call(this);
123
- o?.call(this, a), this.requestUpdate(e, n, r);
124
- }, configurable: true, enumerable: true };
125
- }
126
- static getPropertyOptions(e) {
127
- return this.elementProperties.get(e) ?? Q$1;
128
- }
129
- static _$Ei() {
130
- if (this.hasOwnProperty(T$1("elementProperties"))) return;
131
- const e = xe(this);
132
- e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
133
- }
134
- static finalize() {
135
- if (this.hasOwnProperty(T$1("finalized"))) return;
136
- if (this.finalized = true, this._$Ei(), this.hasOwnProperty(T$1("properties"))) {
137
- const i = this.properties, r = [...we(i), ..._e(i)];
138
- for (const s of r) this.createProperty(s, i[s]);
139
- }
140
- const e = this[Symbol.metadata];
141
- if (e !== null) {
142
- const i = litPropertyMetadata.get(e);
143
- if (i !== void 0) for (const [r, s] of i) this.elementProperties.set(r, s);
144
- }
145
- this._$Eh = /* @__PURE__ */ new Map();
146
- for (const [i, r] of this.elementProperties) {
147
- const s = this._$Eu(i, r);
148
- s !== void 0 && this._$Eh.set(s, i);
149
- }
150
- this.elementStyles = this.finalizeStyles(this.styles);
151
- }
152
- static finalizeStyles(e) {
153
- const i = [];
154
- if (Array.isArray(e)) {
155
- const r = new Set(e.flat(1 / 0).reverse());
156
- for (const s of r) i.unshift(J$1(s));
157
- } else e !== void 0 && i.push(J$1(e));
158
- return i;
159
- }
160
- static _$Eu(e, i) {
161
- const r = i.attribute;
162
- return r === false ? void 0 : typeof r == "string" ? r : typeof e == "string" ? e.toLowerCase() : void 0;
163
- }
164
- constructor() {
165
- super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
166
- }
167
- _$Ev() {
168
- this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((e) => e(this));
169
- }
170
- addController(e) {
171
- (this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
172
- }
173
- removeController(e) {
174
- this._$EO?.delete(e);
175
- }
176
- _$E_() {
177
- const e = /* @__PURE__ */ new Map(), i = this.constructor.elementProperties;
178
- for (const r of i.keys()) this.hasOwnProperty(r) && (e.set(r, this[r]), delete this[r]);
179
- e.size > 0 && (this._$Ep = e);
180
- }
181
- createRenderRoot() {
182
- const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
183
- return be(e, this.constructor.elementStyles), e;
184
- }
185
- connectedCallback() {
186
- this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((e) => e.hostConnected?.());
187
- }
188
- enableUpdating(e) {
189
- }
190
- disconnectedCallback() {
191
- this._$EO?.forEach((e) => e.hostDisconnected?.());
192
- }
193
- attributeChangedCallback(e, i, r) {
194
- this._$AK(e, r);
195
- }
196
- _$ET(e, i) {
197
- const r = this.constructor.elementProperties.get(e), s = this.constructor._$Eu(e, r);
198
- if (s !== void 0 && r.reflect === true) {
199
- const o = (r.converter?.toAttribute !== void 0 ? r.converter : V$1).toAttribute(i, r.type);
200
- this._$Em = e, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null;
201
- }
202
- }
203
- _$AK(e, i) {
204
- const r = this.constructor, s = r._$Eh.get(e);
205
- if (s !== void 0 && this._$Em !== s) {
206
- const o = r.getPropertyOptions(s), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : V$1;
207
- this._$Em = s;
208
- const n = a.fromAttribute(i, o.type);
209
- this[s] = n ?? this._$Ej?.get(s) ?? n, this._$Em = null;
210
- }
211
- }
212
- requestUpdate(e, i, r, s = false, o) {
213
- if (e !== void 0) {
214
- const a = this.constructor;
215
- if (s === false && (o = this[e]), r ??= a.getPropertyOptions(e), !((r.hasChanged ?? W$1)(o, i) || r.useDefault && r.reflect && o === this._$Ej?.get(e) && !this.hasAttribute(a._$Eu(e, r)))) return;
216
- this.C(e, i, r);
217
- }
218
- this.isUpdatePending === false && (this._$ES = this._$EP());
219
- }
220
- C(e, i, { useDefault: r, reflect: s, wrapped: o }, a) {
221
- r && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, a ?? i ?? this[e]), o !== true || a !== void 0) || (this._$AL.has(e) || (this.hasUpdated || r || (i = void 0), this._$AL.set(e, i)), s === true && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
222
- }
223
- async _$EP() {
224
- this.isUpdatePending = true;
225
- try {
226
- await this._$ES;
227
- } catch (i) {
228
- Promise.reject(i);
229
- }
230
- const e = this.scheduleUpdate();
231
- return e != null && await e, !this.isUpdatePending;
232
- }
233
- scheduleUpdate() {
234
- return this.performUpdate();
235
- }
236
- performUpdate() {
237
- if (!this.isUpdatePending) return;
238
- if (!this.hasUpdated) {
239
- if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
240
- for (const [s, o] of this._$Ep) this[s] = o;
241
- this._$Ep = void 0;
242
- }
243
- const r = this.constructor.elementProperties;
244
- if (r.size > 0) for (const [s, o] of r) {
245
- const { wrapped: a } = o, n = this[s];
246
- a !== true || this._$AL.has(s) || n === void 0 || this.C(s, void 0, o, n);
247
- }
248
- }
249
- let e = false;
250
- const i = this._$AL;
251
- try {
252
- e = this.shouldUpdate(i), e ? (this.willUpdate(i), this._$EO?.forEach((r) => r.hostUpdate?.()), this.update(i)) : this._$EM();
253
- } catch (r) {
254
- throw e = false, this._$EM(), r;
255
- }
256
- e && this._$AE(i);
257
- }
258
- willUpdate(e) {
259
- }
260
- _$AE(e) {
261
- this._$EO?.forEach((i) => i.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(e)), this.updated(e);
262
- }
263
- _$EM() {
264
- this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
265
- }
266
- get updateComplete() {
267
- return this.getUpdateComplete();
268
- }
269
- getUpdateComplete() {
270
- return this._$ES;
271
- }
272
- shouldUpdate(e) {
273
- return true;
274
- }
275
- update(e) {
276
- this._$Eq &&= this._$Eq.forEach((i) => this._$ET(i, this[i])), this._$EM();
277
- }
278
- updated(e) {
279
- }
280
- firstUpdated(e) {
281
- }
282
- };
283
- E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[T$1("elementProperties")] = /* @__PURE__ */ new Map(), E[T$1("finalized")] = /* @__PURE__ */ new Map(), Ee?.({ ReactiveElement: E }), (M$1.reactiveElementVersions ??= []).push("2.1.2");
284
- const K$1 = globalThis, ee$1 = (t) => t, D$1 = K$1.trustedTypes, te = D$1 ? D$1.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, he = "$lit$", A$1 = `lit$${Math.random().toFixed(9).slice(2)}$`, ce = "?" + A$1, ke = `<${ce}>`, S$1 = document, R$1 = () => S$1.createComment(""), I$1 = (t) => t === null || typeof t != "object" && typeof t != "function", Y$1 = Array.isArray, Pe = (t) => Y$1(t) || typeof t?.[Symbol.iterator] == "function", L$1 = `[
285
- \f\r]`, P$1 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ie = /-->/g, re = />/g, w$1 = RegExp(`>|${L$1}(?:([^\\s"'>=/]+)(${L$1}*=${L$1}*(?:[^
286
- \f\r"'\`<>=]|("|')|))|$)`, "g"), se = /'/g, oe = /"/g, pe = /^(?:script|style|textarea|title)$/i, Te = (t) => (e, ...i) => ({ _$litType$: t, strings: e, values: i }), g = Te(1), v$1 = /* @__PURE__ */ Symbol.for("lit-noChange"), f$1 = /* @__PURE__ */ Symbol.for("lit-nothing"), ae = /* @__PURE__ */ new WeakMap(), x$1 = S$1.createTreeWalker(S$1, 129);
287
- function ue(t, e) {
288
- if (!Y$1(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
289
- return te !== void 0 ? te.createHTML(e) : e;
290
- }
291
- const Ce = (t, e) => {
292
- const i = t.length - 1, r = [];
293
- let s, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", a = P$1;
294
- for (let n = 0; n < i; n++) {
295
- const l = t[n];
296
- let m, c, u = -1, y = 0;
297
- for (; y < l.length && (a.lastIndex = y, c = a.exec(l), c !== null); ) y = a.lastIndex, a === P$1 ? c[1] === "!--" ? a = ie : c[1] !== void 0 ? a = re : c[2] !== void 0 ? (pe.test(c[2]) && (s = RegExp("</" + c[2], "g")), a = w$1) : c[3] !== void 0 && (a = w$1) : a === w$1 ? c[0] === ">" ? (a = s ?? P$1, u = -1) : c[1] === void 0 ? u = -2 : (u = a.lastIndex - c[2].length, m = c[1], a = c[3] === void 0 ? w$1 : c[3] === '"' ? oe : se) : a === oe || a === se ? a = w$1 : a === ie || a === re ? a = P$1 : (a = w$1, s = void 0);
298
- const $ = a === w$1 && t[n + 1].startsWith("/>") ? " " : "";
299
- o += a === P$1 ? l + ke : u >= 0 ? (r.push(m), l.slice(0, u) + he + l.slice(u) + A$1 + $) : l + A$1 + (u === -2 ? n : $);
300
- }
301
- return [ue(t, o + (t[i] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), r];
302
- };
303
- class N {
304
- constructor({ strings: e, _$litType$: i }, r) {
305
- let s;
306
- this.parts = [];
307
- let o = 0, a = 0;
308
- const n = e.length - 1, l = this.parts, [m, c] = Ce(e, i);
309
- if (this.el = N.createElement(m, r), x$1.currentNode = this.el.content, i === 2 || i === 3) {
310
- const u = this.el.content.firstChild;
311
- u.replaceWith(...u.childNodes);
312
- }
313
- for (; (s = x$1.nextNode()) !== null && l.length < n; ) {
314
- if (s.nodeType === 1) {
315
- if (s.hasAttributes()) for (const u of s.getAttributeNames()) if (u.endsWith(he)) {
316
- const y = c[a++], $ = s.getAttribute(u).split(A$1), F = /([.?@])?(.*)/.exec(y);
317
- l.push({ type: 1, index: o, name: F[2], strings: $, ctor: F[1] === "." ? Ie : F[1] === "?" ? Ne : F[1] === "@" ? ze : B$1 }), s.removeAttribute(u);
318
- } else u.startsWith(A$1) && (l.push({ type: 6, index: o }), s.removeAttribute(u));
319
- if (pe.test(s.tagName)) {
320
- const u = s.textContent.split(A$1), y = u.length - 1;
321
- if (y > 0) {
322
- s.textContent = D$1 ? D$1.emptyScript : "";
323
- for (let $ = 0; $ < y; $++) s.append(u[$], R$1()), x$1.nextNode(), l.push({ type: 2, index: ++o });
324
- s.append(u[y], R$1());
325
- }
326
- }
327
- } else if (s.nodeType === 8) if (s.data === ce) l.push({ type: 2, index: o });
328
- else {
329
- let u = -1;
330
- for (; (u = s.data.indexOf(A$1, u + 1)) !== -1; ) l.push({ type: 7, index: o }), u += A$1.length - 1;
331
- }
332
- o++;
333
- }
334
- }
335
- static createElement(e, i) {
336
- const r = S$1.createElement("template");
337
- return r.innerHTML = e, r;
338
- }
339
- }
340
- function k$1(t, e, i = t, r) {
341
- if (e === v$1) return e;
342
- let s = r !== void 0 ? i._$Co?.[r] : i._$Cl;
343
- const o = I$1(e) ? void 0 : e._$litDirective$;
344
- return s?.constructor !== o && (s?._$AO?.(false), o === void 0 ? s = void 0 : (s = new o(t), s._$AT(t, i, r)), r !== void 0 ? (i._$Co ??= [])[r] = s : i._$Cl = s), s !== void 0 && (e = k$1(t, s._$AS(t, e.values), s, r)), e;
345
- }
346
- class Re {
347
- constructor(e, i) {
348
- this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = i;
349
- }
350
- get parentNode() {
351
- return this._$AM.parentNode;
352
- }
353
- get _$AU() {
354
- return this._$AM._$AU;
355
- }
356
- u(e) {
357
- const { el: { content: i }, parts: r } = this._$AD, s = (e?.creationScope ?? S$1).importNode(i, true);
358
- x$1.currentNode = s;
359
- let o = x$1.nextNode(), a = 0, n = 0, l = r[0];
360
- for (; l !== void 0; ) {
361
- if (a === l.index) {
362
- let m;
363
- l.type === 2 ? m = new z$1(o, o.nextSibling, this, e) : l.type === 1 ? m = new l.ctor(o, l.name, l.strings, this, e) : l.type === 6 && (m = new Fe(o, this, e)), this._$AV.push(m), l = r[++n];
364
- }
365
- a !== l?.index && (o = x$1.nextNode(), a++);
366
- }
367
- return x$1.currentNode = S$1, s;
368
- }
369
- p(e) {
370
- let i = 0;
371
- for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(e, r, i), i += r.strings.length - 2) : r._$AI(e[i])), i++;
372
- }
373
- }
374
- let z$1 = class z {
375
- get _$AU() {
376
- return this._$AM?._$AU ?? this._$Cv;
377
- }
378
- constructor(e, i, r, s) {
379
- this.type = 2, this._$AH = f$1, this._$AN = void 0, this._$AA = e, this._$AB = i, this._$AM = r, this.options = s, this._$Cv = s?.isConnected ?? true;
380
- }
381
- get parentNode() {
382
- let e = this._$AA.parentNode;
383
- const i = this._$AM;
384
- return i !== void 0 && e?.nodeType === 11 && (e = i.parentNode), e;
385
- }
386
- get startNode() {
387
- return this._$AA;
388
- }
389
- get endNode() {
390
- return this._$AB;
391
- }
392
- _$AI(e, i = this) {
393
- e = k$1(this, e, i), I$1(e) ? e === f$1 || e == null || e === "" ? (this._$AH !== f$1 && this._$AR(), this._$AH = f$1) : e !== this._$AH && e !== v$1 && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Pe(e) ? this.k(e) : this._(e);
394
- }
395
- O(e) {
396
- return this._$AA.parentNode.insertBefore(e, this._$AB);
397
- }
398
- T(e) {
399
- this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
400
- }
401
- _(e) {
402
- this._$AH !== f$1 && I$1(this._$AH) ? this._$AA.nextSibling.data = e : this.T(S$1.createTextNode(e)), this._$AH = e;
403
- }
404
- $(e) {
405
- const { values: i, _$litType$: r } = e, s = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = N.createElement(ue(r.h, r.h[0]), this.options)), r);
406
- if (this._$AH?._$AD === s) this._$AH.p(i);
407
- else {
408
- const o = new Re(s, this), a = o.u(this.options);
409
- o.p(i), this.T(a), this._$AH = o;
410
- }
411
- }
412
- _$AC(e) {
413
- let i = ae.get(e.strings);
414
- return i === void 0 && ae.set(e.strings, i = new N(e)), i;
415
- }
416
- k(e) {
417
- Y$1(this._$AH) || (this._$AH = [], this._$AR());
418
- const i = this._$AH;
419
- let r, s = 0;
420
- for (const o of e) s === i.length ? i.push(r = new z(this.O(R$1()), this.O(R$1()), this, this.options)) : r = i[s], r._$AI(o), s++;
421
- s < i.length && (this._$AR(r && r._$AB.nextSibling, s), i.length = s);
422
- }
423
- _$AR(e = this._$AA.nextSibling, i) {
424
- for (this._$AP?.(false, true, i); e !== this._$AB; ) {
425
- const r = ee$1(e).nextSibling;
426
- ee$1(e).remove(), e = r;
427
- }
428
- }
429
- setConnected(e) {
430
- this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
431
- }
432
- };
433
- let B$1 = class B {
434
- get tagName() {
435
- return this.element.tagName;
436
- }
437
- get _$AU() {
438
- return this._$AM._$AU;
439
- }
440
- constructor(e, i, r, s, o) {
441
- this.type = 1, this._$AH = f$1, this._$AN = void 0, this.element = e, this.name = i, this._$AM = s, this.options = o, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = f$1;
442
- }
443
- _$AI(e, i = this, r, s) {
444
- const o = this.strings;
445
- let a = false;
446
- if (o === void 0) e = k$1(this, e, i, 0), a = !I$1(e) || e !== this._$AH && e !== v$1, a && (this._$AH = e);
447
- else {
448
- const n = e;
449
- let l, m;
450
- for (e = o[0], l = 0; l < o.length - 1; l++) m = k$1(this, n[r + l], i, l), m === v$1 && (m = this._$AH[l]), a ||= !I$1(m) || m !== this._$AH[l], m === f$1 ? e = f$1 : e !== f$1 && (e += (m ?? "") + o[l + 1]), this._$AH[l] = m;
451
- }
452
- a && !s && this.j(e);
453
- }
454
- j(e) {
455
- e === f$1 ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
456
- }
457
- };
458
- class Ie extends B$1 {
459
- constructor() {
460
- super(...arguments), this.type = 3;
461
- }
462
- j(e) {
463
- this.element[this.name] = e === f$1 ? void 0 : e;
464
- }
465
- }
466
- class Ne extends B$1 {
467
- constructor() {
468
- super(...arguments), this.type = 4;
469
- }
470
- j(e) {
471
- this.element.toggleAttribute(this.name, !!e && e !== f$1);
472
- }
473
- }
474
- class ze extends B$1 {
475
- constructor(e, i, r, s, o) {
476
- super(e, i, r, s, o), this.type = 5;
477
- }
478
- _$AI(e, i = this) {
479
- if ((e = k$1(this, e, i, 0) ?? f$1) === v$1) return;
480
- const r = this._$AH, s = e === f$1 && r !== f$1 || e.capture !== r.capture || e.once !== r.once || e.passive !== r.passive, o = e !== f$1 && (r === f$1 || s);
481
- s && this.element.removeEventListener(this.name, this, r), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
482
- }
483
- handleEvent(e) {
484
- typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
485
- }
486
- }
487
- class Fe {
488
- constructor(e, i, r) {
489
- this.element = e, this.type = 6, this._$AN = void 0, this._$AM = i, this.options = r;
490
- }
491
- get _$AU() {
492
- return this._$AM._$AU;
493
- }
494
- _$AI(e) {
495
- k$1(this, e);
496
- }
497
- }
498
- const Ue = K$1.litHtmlPolyfillSupport;
499
- Ue?.(N, z$1), (K$1.litHtmlVersions ??= []).push("3.3.2");
500
- const Oe = (t, e, i) => {
501
- const r = i?.renderBefore ?? e;
502
- let s = r._$litPart$;
503
- if (s === void 0) {
504
- const o = i?.renderBefore ?? null;
505
- r._$litPart$ = s = new z$1(e.insertBefore(R$1(), o), o, void 0, i ?? {});
506
- }
507
- return s._$AI(t), s;
508
- };
509
- const G$1 = globalThis;
510
- let C$1 = class C extends E {
511
- constructor() {
512
- super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
513
- }
514
- createRenderRoot() {
515
- const e = super.createRenderRoot();
516
- return this.renderOptions.renderBefore ??= e.firstChild, e;
517
- }
518
- update(e) {
519
- const i = this.render();
520
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Oe(i, this.renderRoot, this.renderOptions);
521
- }
522
- connectedCallback() {
523
- super.connectedCallback(), this._$Do?.setConnected(true);
524
- }
525
- disconnectedCallback() {
526
- super.disconnectedCallback(), this._$Do?.setConnected(false);
527
- }
528
- render() {
529
- return v$1;
530
- }
531
- };
532
- C$1._$litElement$ = true, C$1.finalized = true, G$1.litElementHydrateSupport?.({ LitElement: C$1 });
533
- const Ve = G$1.litElementPolyfillSupport;
534
- Ve?.({ LitElement: C$1 });
535
- (G$1.litElementVersions ??= []).push("4.2.2");
536
- const De = (t) => (e, i) => {
537
- i !== void 0 ? i.addInitializer(() => {
538
- customElements.define(t, e);
539
- }) : customElements.define(t, e);
540
- };
541
- const Me = { attribute: true, type: String, converter: V$1, reflect: false, hasChanged: W$1 }, Be = (t = Me, e, i) => {
542
- const { kind: r, metadata: s } = i;
543
- let o = globalThis.litPropertyMetadata.get(s);
544
- if (o === void 0 && globalThis.litPropertyMetadata.set(s, o = /* @__PURE__ */ new Map()), r === "setter" && ((t = Object.create(t)).wrapped = true), o.set(i.name, t), r === "accessor") {
545
- const { name: a } = i;
546
- return { set(n) {
547
- const l = e.get.call(this);
548
- e.set.call(this, n), this.requestUpdate(a, l, t, true, n);
549
- }, init(n) {
550
- return n !== void 0 && this.C(a, void 0, t, n), n;
551
- } };
552
- }
553
- if (r === "setter") {
554
- const { name: a } = i;
555
- return function(n) {
556
- const l = this[a];
557
- e.call(this, n), this.requestUpdate(a, l, t, true, n);
558
- };
559
- }
560
- throw Error("Unsupported decorator location: " + r);
561
- };
562
- function p(t) {
563
- return (e, i) => typeof i == "object" ? Be(t, e, i) : ((r, s, o) => {
564
- const a = s.hasOwnProperty(o);
565
- return s.constructor.createProperty(o, r), a ? Object.getOwnPropertyDescriptor(s, o) : void 0;
566
- })(t, e, i);
567
- }
568
- function b$1(t) {
569
- return p({ ...t, state: true, attribute: false });
570
- }
571
- const Le = (t, e, i) => (i.configurable = true, i.enumerable = true, Reflect.decorate && typeof e != "object" && Object.defineProperty(t, e, i), i);
572
- function qe(t, e) {
573
- return (i, r, s) => {
574
- const o = (a) => a.renderRoot?.querySelector(t) ?? null;
575
- return Le(i, r, { get() {
576
- return o(this);
577
- } });
578
- };
579
- }
580
- const _$1 = { ATTRIBUTE: 1, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4 }, me = (t) => (...e) => ({ _$litDirective$: t, values: e });
581
- class fe {
582
- constructor(e) {
583
- }
584
- get _$AU() {
585
- return this._$AM._$AU;
586
- }
587
- _$AT(e, i, r) {
588
- this._$Ct = e, this._$AM = i, this._$Ci = r;
589
- }
590
- _$AS(e, i) {
591
- return this.update(e, i);
592
- }
593
- update(e, i) {
594
- return this.render(...i);
595
- }
596
- }
597
- const U$1 = me(class extends fe {
598
- constructor(t) {
599
- if (super(t), t.type !== _$1.ATTRIBUTE || t.name !== "class" || t.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
600
- }
601
- render(t) {
602
- return " " + Object.keys(t).filter((e) => t[e]).join(" ") + " ";
603
- }
604
- update(t, [e]) {
605
- if (this.st === void 0) {
606
- this.st = /* @__PURE__ */ new Set(), t.strings !== void 0 && (this.nt = new Set(t.strings.join(" ").split(/\s/).filter((r) => r !== "")));
607
- for (const r in e) e[r] && !this.nt?.has(r) && this.st.add(r);
608
- return this.render(e);
609
- }
610
- const i = t.element.classList;
611
- for (const r of this.st) r in e || (i.remove(r), this.st.delete(r));
612
- for (const r in e) {
613
- const s = !!e[r];
614
- s === this.st.has(r) || this.nt?.has(r) || (s ? (i.add(r), this.st.add(r)) : (i.remove(r), this.st.delete(r)));
615
- }
616
- return v$1;
617
- }
618
- });
619
- const He = (t) => t.strings === void 0, je = {}, We = (t, e = je) => t._$AH = e;
620
- const Ke = me(class extends fe {
621
- constructor(t) {
622
- if (super(t), t.type !== _$1.PROPERTY && t.type !== _$1.ATTRIBUTE && t.type !== _$1.BOOLEAN_ATTRIBUTE) throw Error("The `live` directive is not allowed on child or event bindings");
623
- if (!He(t)) throw Error("`live` bindings can only contain a single expression");
624
- }
625
- render(t) {
626
- return t;
627
- }
628
- update(t, [e]) {
629
- if (e === v$1 || e === f$1) return e;
630
- const i = t.element, r = t.name;
631
- if (t.type === _$1.PROPERTY) {
632
- if (e === i[r]) return v$1;
633
- } else if (t.type === _$1.BOOLEAN_ATTRIBUTE) {
634
- if (!!e === i.hasAttribute(r)) return v$1;
635
- } else if (t.type === _$1.ATTRIBUTE && i.getAttribute(r) === e + "") return v$1;
636
- return We(t), e;
637
- }
638
- }), Ye = [
639
- "AE",
640
- "AR",
641
- "AT",
642
- "AU",
643
- "BE",
644
- "BG",
645
- "BR",
646
- "CA",
647
- "CH",
648
- "CL",
649
- "CO",
650
- "CZ",
651
- "DE",
652
- "DK",
653
- "EE",
654
- "ES",
655
- "FI",
656
- "FR",
657
- "GB",
658
- "GR",
659
- "HK",
660
- "HR",
661
- "HU",
662
- "ID",
663
- "IE",
664
- "IL",
665
- "IN",
666
- "IT",
667
- "JP",
668
- "KR",
669
- "LT",
670
- "LU",
671
- "LV",
672
- "MX",
673
- "MY",
674
- "NL",
675
- "NO",
676
- "NZ",
677
- "PE",
678
- "PH",
679
- "PL",
680
- "PT",
681
- "RO",
682
- "SE",
683
- "SG",
684
- "SI",
685
- "SK",
686
- "TH",
687
- "TR",
688
- "TW",
689
- "US",
690
- "VN",
691
- "ZA"
692
- ];
693
- function Ge(t, e) {
694
- let i = null;
695
- return function(...r) {
696
- i && clearTimeout(i), i = setTimeout(() => {
697
- t.apply(this, r);
698
- }, e);
699
- };
700
- }
701
- function Ze() {
702
- return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t) {
703
- const e = Math.random() * 16 | 0;
704
- return (t === "x" ? e : e & 3 | 8).toString(16);
705
- });
706
- }
707
- function Je(t) {
708
- if (!t) return null;
709
- const e = t.find(
710
- (i) => i.types?.includes("country")
711
- );
712
- return e ? e.short_name : null;
713
- }
714
- function ne(t, e) {
715
- let i = null;
716
- return t.address_components ? i = Je(t.address_components) : e && e.length === 1 && (i = e[0].toUpperCase()), i ? {
717
- isSupported: Ye.includes(i),
718
- countryCode: i
719
- } : {
720
- isSupported: null,
721
- countryCode: null
722
- };
723
- }
724
- const le = {
725
- en: {
726
- placeholder: "Search for an address...",
727
- noResults: "No address found for this search. Try different keywords.",
728
- errorFetchPredictions: "Unable to search for addresses. Please try again.",
729
- errorFetchDetails: "Unable to load address details. Please try again.",
730
- errorNetwork: "Network error. Please check your connection and try again.",
731
- validationRequired: "This field is required",
732
- validationPattern: "Invalid format",
733
- validationSaudiFormat: "Please enter a valid Saudi national address (format: AAAA1234)"
734
- },
735
- ar: {
736
- placeholder: "ابحث عن عنوان...",
737
- noResults: "لم يتم العثور على عنوان لهذا البحث. جرب كلمات مختلفة.",
738
- errorFetchPredictions: "تعذر البحث عن العناوين. يرجى المحاولة مرة أخرى.",
739
- errorFetchDetails: "تعذر تحميل تفاصيل العنوان. يرجى المحاولة مرة أخرى.",
740
- errorNetwork: "خطأ في الشبكة. يرجى التحقق من اتصالك والمحاولة مرة أخرى.",
741
- validationRequired: "هذا الحقل مطلوب",
742
- validationPattern: "صيغة غير صحيحة",
743
- validationSaudiFormat: "الرجاء إدخال عنوان وطني صحيح (الصيغة: AAAA1234)"
744
- },
745
- es: {
746
- placeholder: "Buscar una dirección...",
747
- noResults: "No se encontró ninguna dirección para esta búsqueda. Intenta con diferentes palabras.",
748
- errorFetchPredictions: "No se pueden buscar direcciones. Por favor, inténtelo de nuevo.",
749
- errorFetchDetails: "No se pueden cargar los detalles de la dirección. Por favor, inténtelo de nuevo.",
750
- errorNetwork: "Error de red. Verifique su conexión e inténtelo de nuevo.",
751
- validationRequired: "Este campo es obligatorio",
752
- validationPattern: "Formato inválido",
753
- validationSaudiFormat: "Por favor ingrese una dirección nacional saudí válida (formato: AAAA1234)"
754
- },
755
- fr: {
756
- placeholder: "Rechercher une adresse...",
757
- noResults: "Aucune adresse trouvée pour cette recherche. Essayez différents mots-clés.",
758
- errorFetchPredictions: "Impossible de rechercher des adresses. Veuillez réessayer.",
759
- errorFetchDetails: "Impossible de charger les détails de l'adresse. Veuillez réessayer.",
760
- errorNetwork: "Erreur réseau. Vérifiez votre connexion et réessayez.",
761
- validationRequired: "Ce champ est obligatoire",
762
- validationPattern: "Format invalide",
763
- validationSaudiFormat: "Veuillez saisir une adresse nationale saoudienne valide (format: AAAA1234)"
764
- },
765
- de: {
766
- placeholder: "Nach einer Adresse suchen...",
767
- noResults: "Keine Adresse für diese Suche gefunden. Versuchen Sie es mit anderen Stichwörtern.",
768
- errorFetchPredictions: "Adressen können nicht gesucht werden. Bitte versuchen Sie es erneut.",
769
- errorFetchDetails: "Adressdetails können nicht geladen werden. Bitte versuchen Sie es erneut.",
770
- errorNetwork: "Netzwerkfehler. Bitte überprüfen Sie Ihre Verbindung und versuchen Sie es erneut.",
771
- validationRequired: "Dieses Feld ist erforderlich",
772
- validationPattern: "Ungültiges Format",
773
- validationSaudiFormat: "Bitte geben Sie eine gültige saudi-arabische nationale Adresse ein (Format: AAAA1234)"
774
- },
775
- it: {
776
- placeholder: "Cerca un indirizzo...",
777
- noResults: "Nessun indirizzo trovato per questa ricerca. Prova con parole chiave diverse.",
778
- errorFetchPredictions: "Impossibile cercare indirizzi. Riprova.",
779
- errorFetchDetails: "Impossibile caricare i dettagli dell'indirizzo. Riprova.",
780
- errorNetwork: "Errore di rete. Controlla la connessione e riprova.",
781
- validationRequired: "Questo campo è obbligatorio",
782
- validationPattern: "Formato non valido",
783
- validationSaudiFormat: "Inserisci un indirizzo nazionale saudita valido (formato: AAAA1234)"
784
- },
785
- pt: {
786
- placeholder: "Pesquisar um endereço...",
787
- noResults: "Nenhum endereço encontrado para esta pesquisa. Tente palavras-chave diferentes.",
788
- errorFetchPredictions: "Não é possível pesquisar endereços. Por favor, tente novamente.",
789
- errorFetchDetails: "Não é possível carregar os detalhes do endereço. Por favor, tente novamente.",
790
- errorNetwork: "Erro de rede. Verifique sua conexão e tente novamente.",
791
- validationRequired: "Este campo é obrigatório",
792
- validationPattern: "Formato inválido",
793
- validationSaudiFormat: "Por favor, insira um endereço nacional saudita válido (formato: AAAA1234)"
794
- },
795
- ru: {
796
- placeholder: "Поиск адреса...",
797
- noResults: "Адрес для этого поиска не найден. Попробуйте другие ключевые слова.",
798
- errorFetchPredictions: "Невозможно выполнить поиск адресов. Пожалуйста, попробуйте еще раз.",
799
- errorFetchDetails: "Невозможно загрузить детали адреса. Пожалуйста, попробуйте еще раз.",
800
- errorNetwork: "Ошибка сети. Проверьте соединение и попробуйте еще раз.",
801
- validationRequired: "Это поле обязательно",
802
- validationPattern: "Неверный формат",
803
- validationSaudiFormat: "Пожалуйста, введите действительный национальный адрес Саудовской Аравии (формат: AAAA1234)"
804
- },
805
- ja: {
806
- placeholder: "住所を検索...",
807
- noResults: "この検索では住所が見つかりませんでした。別のキーワードをお試しください。",
808
- errorFetchPredictions: "住所を検索できません。もう一度お試しください。",
809
- errorFetchDetails: "住所の詳細を読み込めません。もう一度お試しください。",
810
- errorNetwork: "ネットワークエラー。接続を確認してもう一度お試しください。",
811
- validationRequired: "この項目は必須です",
812
- validationPattern: "無効な形式",
813
- validationSaudiFormat: "有効なサウジアラビアの国内住所を入力してください(形式:AAAA1234)"
814
- },
815
- zh: {
816
- placeholder: "搜索地址...",
817
- noResults: "未找到此搜索的地址。请尝试不同的关键词。",
818
- errorFetchPredictions: "无法搜索地址。请重试。",
819
- errorFetchDetails: "无法加载地址详情。请重试。",
820
- errorNetwork: "网络错误。请检查您的连接并重试。",
821
- validationRequired: "此字段为必填项",
822
- validationPattern: "格式无效",
823
- validationSaudiFormat: "请输入有效的沙特国家地址(格式:AAAA1234)"
824
- },
825
- ko: {
826
- placeholder: "주소 검색...",
827
- noResults: "이 검색에 대한 주소를 찾을 수 없습니다. 다른 키워드를 시도해보세요.",
828
- errorFetchPredictions: "주소를 검색할 수 없습니다. 다시 시도해주세요.",
829
- errorFetchDetails: "주소 세부정보를 불러올 수 없습니다. 다시 시도해주세요.",
830
- errorNetwork: "네트워크 오류입니다. 연결을 확인하고 다시 시도해주세요.",
831
- validationRequired: "이 필드는 필수입니다",
832
- validationPattern: "유효하지 않은 형식",
833
- validationSaudiFormat: "유효한 사우디 국가 주소를 입력하세요 (형식: AAAA1234)"
834
- },
835
- hi: {
836
- placeholder: "पता खोजें...",
837
- noResults: "इस खोज के लिए कोई पता नहीं मिला। विभिन्न कीवर्ड आज़माएं।",
838
- errorFetchPredictions: "पते खोजने में असमर्थ। कृपया पुनः प्रयास करें।",
839
- errorFetchDetails: "पते का विवरण लोड करने में असमर्थ। कृपया पुनः प्रयास करें।",
840
- errorNetwork: "नेटवर्क त्रुटि। कृपया अपना कनेक्शन जांचें और पुनः प्रयास करें।",
841
- validationRequired: "यह फ़ील्ड आवश्यक है",
842
- validationPattern: "अमान्य प्रारूप",
843
- validationSaudiFormat: "कृपया एक मान्य सऊदी राष्ट्रीय पता दर्ज करें (प्रारूप: AAAA1234)"
844
- },
845
- tr: {
846
- placeholder: "Adres ara...",
847
- noResults: "Bu arama için adres bulunamadı. Farklı anahtar kelimeler deneyin.",
848
- errorFetchPredictions: "Adresler aranamıyor. Lütfen tekrar deneyin.",
849
- errorFetchDetails: "Adres detayları yüklenemiyor. Lütfen tekrar deneyin.",
850
- errorNetwork: "Ağ hatası. Lütfen bağlantınızı kontrol edin ve tekrar deneyin.",
851
- validationRequired: "Bu alan zorunludur",
852
- validationPattern: "Geçersiz format",
853
- validationSaudiFormat: "Lütfen geçerli bir Suudi ulusal adresi girin (format: AAAA1234)"
854
- }
855
- };
856
- function q$1(t = "en") {
857
- return le[t] || le.en;
858
- }
859
- function Xe(t) {
860
- return ["ar"].includes(t);
861
- }
862
- var Qe = Object.defineProperty, et$1 = Object.getOwnPropertyDescriptor, h$1 = (t, e, i, r) => {
863
- for (var s = r > 1 ? void 0 : r ? et$1(e, i) : e, o = t.length - 1, a; o >= 0; o--)
864
- (a = t[o]) && (s = (r ? a(e, i, s) : a(s)) || s);
865
- return r && s && Qe(e, i, s), s;
866
- };
867
- let d$1 = class d extends C$1 {
868
- constructor() {
869
- super(), this.proxyUrl = "https://api.salla.dev", this.authToken = null, this.placeholder = "", this.defaultPlace = "", this.label = null, this.className = "", this.language = "en", this.dir = "auto", this.mode = "search", this.name = "", this.required = false, this.pattern = null, this.tooltip = null, this.selectedId = null, this.errors = [], this.disabled = false, this._value = "", this._country = null, this.locationBias = null, this.locationRestriction = null, this.types = null, this._fields = ["formatted_address", "geometry"], this.strictBounds = false, this.useSessionToken = true, this.resolve = false, this.onValidateAddress = null, this.debounceDelay = 300, this.minChars = 3, this.predictions = [], this.isOpen = false, this.isLoading = false, this.error = null, this.activeIndex = -1, this.inputValue = "", this.sessionToken = null, this.validationError = null, this.touched = false, this.showNationalAddressIcon = false, this.abortController = null, this._internals = this.attachInternals();
870
- }
871
- set value(t) {
872
- const e = this._value;
873
- this._value = t || "", this.requestUpdate("value", e);
874
- }
875
- get value() {
876
- return this._value;
877
- }
878
- set country(t) {
879
- t == null ? this._country = null : Array.isArray(t) ? this._country = t.filter((e) => e && e.trim()).map((e) => e.trim()) : this._country = t.split(",").map((e) => e.trim()).filter((e) => e);
880
- }
881
- get country() {
882
- return this._country;
883
- }
884
- set fieldsStr(t) {
885
- this._fields = t ? t.split(",").map((e) => e.trim()).filter((e) => e) : ["formatted_address", "geometry"];
886
- }
887
- get fieldsStr() {
888
- return this._fields.join(",");
889
- }
890
- set fields(t) {
891
- this._fields = t && t.length > 0 ? t : ["formatted_address", "geometry"];
892
- }
893
- get fields() {
894
- return this._fields;
895
- }
896
- connectedCallback() {
897
- super.connectedCallback(), this.createNewSession(), this.initializeDebounce();
898
- }
899
- disconnectedCallback() {
900
- super.disconnectedCallback(), this.terminateSession(), this.cancelPendingRequest();
901
- }
902
- initializeDebounce() {
903
- this.debouncedFetch = Ge(this.fetchPredictions.bind(this), this.debounceDelay);
904
- }
905
- firstUpdated() {
906
- const t = this.value || this.defaultPlace || "";
907
- t && (this.inputValue = t, this.isSaudiFormMode() && this.isShortAddressFormat(t) && (this.showNationalAddressIcon = true));
908
- }
909
- $nextTick(t) {
910
- Promise.resolve().then(t);
911
- }
912
- isShortAddressFormat(t) {
913
- return /^[a-zA-Z]{4}\d{4}$/.test(t?.trim());
914
- }
915
- updated(t) {
916
- if (t.has("value")) {
917
- const e = this.value || "";
918
- e !== this.inputValue && (this.inputValue = e, this.isSaudiFormMode() && e && this.isShortAddressFormat(e) ? this.showNationalAddressIcon = true : this.showNationalAddressIcon = false);
919
- }
920
- t.has("defaultPlace") && !this.value && this.defaultPlace !== this.inputValue && (this.inputValue = this.defaultPlace || "", this.isSaudiFormMode() && this.defaultPlace && this.isShortAddressFormat(this.defaultPlace) ? this.showNationalAddressIcon = true : this.showNationalAddressIcon = false), t.has("selectedId") && this.selectedId && this.selectedId !== this.inputValue && this.isSaudiFormMode() && this.isShortAddressFormat(this.selectedId) && (this.inputValue = this.selectedId || "", this.showNationalAddressIcon = true, this._internals.setFormValue(this.selectedId || "")), t.has("debounceDelay") && this.initializeDebounce();
921
- }
922
- createNewSession() {
923
- this.useSessionToken && (this.sessionToken = Ze());
924
- }
925
- terminateSession() {
926
- this.sessionToken = null;
927
- }
928
- cancelPendingRequest() {
929
- this.abortController && (this.abortController.abort(), this.abortController = null);
930
- }
931
- isSaudiFormMode() {
932
- return this.mode === "form" && this.country !== null && this.country.length === 1 && this.country[0].toLowerCase() === "sa";
933
- }
934
- getWhatsAppLink() {
935
- const t = "966112898888", e = encodeURIComponent("العنوان الوطني");
936
- return `https://wa.me/${t}?text=${e}`;
937
- }
938
- renderWhatsAppIcon() {
939
- return g`
940
- <svg class="whatsapp-icon" viewBox="0 0 24 24" fill="currentColor" part="whatsapp-icon">
941
- <path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/>
942
- </svg>
943
- `;
944
- }
945
- getSaudiHelpTextContent() {
946
- return {
947
- helpText: this.language === "ar" ? "لا تعرف العنوان الوطني؟" : "Don't know your national address?",
948
- linkText: this.language === "ar" ? "احصل على العنوان الوطني عبر الواتساب" : "Get your national address via WhatsApp"
949
- };
950
- }
951
- renderSaudiFriendlyError() {
952
- const t = this.inputValue && this.inputValue.trim().length > 0;
953
- let e, i;
954
- t ? (e = "العنوان الوطني المختصر غير صحيح (الصيغة: AAAA1234). يمكنك الحصول عليه بسهولة", i = "The short national address format is incorrect (format: AAAA1234). You can easily get it") : (e = "العنوان الوطني المختصر مطلوب. يمكنك الحصول عليه بسهولة", i = "The short national address is required. You can easily get it");
955
- const r = "عبر الواتساب (اضغط هنا)", s = "via WhatsApp (click here)", o = "أو ابحث أعلاه", a = "or search above", n = this.language === "ar" ? e : i, l = this.language === "ar" ? r : s, m = this.language === "ar" ? o : a;
956
- return g`
957
- <span>
958
- ${n}
959
- <a
960
- href="${this.getWhatsAppLink()}"
961
- target="_blank"
962
- rel="noopener noreferrer"
963
- class="whatsapp-link-inline"
964
- part="whatsapp-link"
965
- >
966
- ${this.renderWhatsAppIcon()}
967
- ${l}
968
- </a>
969
- ${m}
970
- </span>
971
- `;
972
- }
973
- renderSaudiHelpText() {
974
- if (!this.isSaudiFormMode() || this.validationError || this.errors && this.errors.length > 0)
975
- return "";
976
- const t = "لا تعرف العنوان الوطني؟ احصل عليه بسهولة", e = "Don't know your national address? Get it easily", i = "عبر الواتساب (اضغط هنا)", r = "via WhatsApp (click here)", s = "أو ابحث أعلاه", o = "or search above", a = this.language === "ar" ? t : e, n = this.language === "ar" ? i : r, l = this.language === "ar" ? s : o;
977
- return g`
978
- <div class="help-text" part="help-text">
979
- <span>
980
- ${a}
981
- <a
982
- href="${this.getWhatsAppLink()}"
983
- target="_blank"
984
- rel="noopener noreferrer"
985
- class="whatsapp-link-inline"
986
- part="whatsapp-link"
987
- >
988
- ${this.renderWhatsAppIcon()}
989
- ${n}
990
- </a>
991
- ${l}
992
- </span>
993
- </div>
994
- `;
995
- }
996
- async fetchPredictions(t) {
997
- if (!t.trim()) {
998
- this.predictions = [], this.isOpen = false, this.isLoading = false;
999
- return;
1000
- }
1001
- if (t.trim().length < this.minChars) {
1002
- this.predictions = [], this.isOpen = false, this.isLoading = false;
1003
- return;
1004
- }
1005
- this.cancelPendingRequest(), this.abortController = new AbortController();
1006
- const e = this.abortController.signal;
1007
- this.isLoading = true, this.error = null;
1008
- try {
1009
- const i = { input: t, language: this.language };
1010
- this.sessionToken && (i.sessiontoken = this.sessionToken), this.country && this.country.length > 0 && (i.country = this.country.join(",")), this.types && this.types.length > 0 && (i.types = this.types.join("|")), this.locationBias && this.locationBias.radius && this.locationBias.center && (i.location = `${this.locationBias.center.lat},${this.locationBias.center.lng}`, i.radius = this.locationBias.radius.toString()), this.strictBounds && (i.strictbounds = "true");
1011
- const r = new URLSearchParams(i), o = `${this.proxyUrl || ""}/store/v1/checkout/address/autocomplete/query?${r.toString()}`, a = {};
1012
- this.authToken && (a.Authorization = `Bearer ${this.authToken}`);
1013
- const n = await fetch(o, { signal: e, headers: a });
1014
- if (!n.ok)
1015
- throw new Error(`HTTP ${n.status}: ${n.statusText}`);
1016
- const l = await n.json();
1017
- l.success && Array.isArray(l.data) ? (this.error = null, l.data.length > 0 ? (this.predictions = l.data.map((c) => ({
1018
- place_id: c.id,
1019
- description: c.description || c.formatted_address,
1020
- formatted_address: c.formatted_address,
1021
- short_address: c.short_address,
1022
- structured_formatting: {
1023
- main_text: c.formatted_address || c.description,
1024
- main_text_matched_substrings: [],
1025
- secondary_text: c.description || ""
1026
- },
1027
- types: c.types || [],
1028
- geometry: c.geometry,
1029
- address_components: c.address_components
1030
- })), this.isOpen = true, this.activeIndex = -1) : (this.predictions = [], this.isOpen = true)) : (this.predictions = [], this.isOpen = true);
1031
- } catch (i) {
1032
- if (i instanceof Error && i.name === "AbortError")
1033
- return;
1034
- this.predictions = [], this.isOpen = true;
1035
- } finally {
1036
- this.isLoading = false, this.abortController = null;
1037
- }
1038
- }
1039
- async fetchPlaceDetails(t) {
1040
- this.isLoading = true, this.error = null;
1041
- try {
1042
- const e = { place_id: t, language: this.language };
1043
- this.fields && this.fields.length > 0 && (e.fields = this.fields.join(",")), this.sessionToken && (e.sessiontoken = this.sessionToken), this.country && this.country.length > 0 && (e.country = this.country.join(",")), this.resolve && (e.resolve = "true");
1044
- const i = new URLSearchParams(e), s = `${this.proxyUrl || ""}/store/v1/checkout/address/autocomplete/details?${i.toString()}`, o = {};
1045
- this.authToken && (o.Authorization = `Bearer ${this.authToken}`);
1046
- const a = await fetch(s, { headers: o });
1047
- if (!a.ok)
1048
- throw new Error(`HTTP ${a.status}: ${a.statusText}`);
1049
- const n = await a.json();
1050
- return !n.success || n.message ? (this.error = n.message || "Failed to fetch place details", null) : n.success && n.data && n.data.id ? {
1051
- place_id: n.data.id,
1052
- ...n.data,
1053
- components: n.data.address_components?.reduce((m, c) => (c.types?.forEach((u) => {
1054
- m[u] || (m[u] = []), m[u].push({
1055
- long_name: c.long_name,
1056
- short_name: c.short_name
1057
- });
1058
- }), m), {})
1059
- } : null;
1060
- } catch (e) {
1061
- console.error("Error fetching place details:", e);
1062
- const i = q$1(this.language);
1063
- return this.error = e instanceof Error ? e.message : i.errorFetchDetails, null;
1064
- } finally {
1065
- this.isLoading = false;
1066
- }
1067
- }
1068
- /**
1069
- * Validates the selected address using the provided callback
1070
- * @param place - The place details to validate
1071
- * @returns Promise resolving to validation result
1072
- */
1073
- async validateAddress(t) {
1074
- try {
1075
- if (!t || !t.formatted_address)
1076
- return console.error("Cannot validate address - place or formatted_address is missing"), null;
1077
- if (!this.onValidateAddress || typeof this.onValidateAddress != "function")
1078
- return console.error("onValidateAddress callback is required for address validation"), null;
1079
- const e = ne(t, this.country), i = await this.onValidateAddress({
1080
- place: t,
1081
- sessionToken: this.sessionToken,
1082
- validationSupport: e
1083
- });
1084
- return this.terminateSession(), i;
1085
- } catch (e) {
1086
- return console.error("Error validating address:", e), this.terminateSession(), null;
1087
- }
1088
- }
1089
- /**
1090
- * Gets validation support information for a place
1091
- * @param place - The place details to check
1092
- * @returns ValidationSupport object indicating what validation is supported
1093
- */
1094
- getValidationSupport(t) {
1095
- return ne(t, this.country);
1096
- }
1097
- checkValidity() {
1098
- return this.validate();
1099
- }
1100
- reportValidity() {
1101
- this.touched = true;
1102
- const t = this.validate();
1103
- return t || this.dispatchEvent(new CustomEvent("invalid", {
1104
- detail: { error: this.validationError },
1105
- bubbles: true,
1106
- composed: true
1107
- })), t;
1108
- }
1109
- /**
1110
- * Resets the component to its initial state
1111
- */
1112
- reset() {
1113
- this.inputValue = "", this.selectedId = null, this.validationError = null, this.errors = [], this.touched = false, this.predictions = [], this.isOpen = false, this.error = null, this.showNationalAddressIcon = false, this.mode === "form" && (this._internals.setFormValue(null), this._internals.setValidity({}));
1114
- }
1115
- // Form lifecycle callbacks
1116
- formResetCallback() {
1117
- this.reset();
1118
- }
1119
- formStateRestoreCallback(t) {
1120
- t && this.mode === "form" && (this.selectedId = t);
1121
- }
1122
- validate() {
1123
- if (this.mode !== "form")
1124
- return true;
1125
- const t = q$1(this.language), e = this.inputValue || "";
1126
- return this.required && !e.trim() ? (this.validationError = t.validationRequired, this._internals.setValidity(
1127
- { valueMissing: true },
1128
- this.validationError,
1129
- this.inputElement
1130
- ), false) : this.isSaudiFormMode() && e.trim() && !this.isShortAddressFormat(e) ? (this.validationError = t.validationSaudiFormat, this._internals.setValidity(
1131
- { patternMismatch: true },
1132
- this.validationError,
1133
- this.inputElement
1134
- ), false) : this.pattern && e.trim() && !new RegExp(this.pattern).test(e) ? (this.validationError = t.validationPattern, this._internals.setValidity(
1135
- { patternMismatch: true },
1136
- this.validationError,
1137
- this.inputElement
1138
- ), false) : (this.validationError = null, this._internals.setValidity({}), true);
1139
- }
1140
- /**
1141
- * Normalize numerals from various scripts to Arabic numerals (0-9).
1142
- * Handles Arabic-Indic, Devanagari (Hindi), Persian, and Bengali numerals.
1143
- * Works consistently across all browsers and operating systems.
1144
- */
1145
- normalizeNumerals(t) {
1146
- if (!t) return t;
1147
- const e = {
1148
- // Arabic-Indic numerals (used in Arab countries): ٠١٢٣٤٥٦٧٨٩
1149
- "٠": "0",
1150
- "١": "1",
1151
- "٢": "2",
1152
- "٣": "3",
1153
- "٤": "4",
1154
- "٥": "5",
1155
- "٦": "6",
1156
- "٧": "7",
1157
- "٨": "8",
1158
- "٩": "9",
1159
- // Devanagari (Hindi) numerals (used in India, Nepal): ०१२३४५६७८९
1160
- "०": "0",
1161
- "१": "1",
1162
- "२": "2",
1163
- "३": "3",
1164
- "४": "4",
1165
- "५": "5",
1166
- "६": "6",
1167
- "७": "7",
1168
- "८": "8",
1169
- "९": "9",
1170
- // Persian/Dari numerals (used in Iran, Afghanistan): ۰۱۲۳۴۵۶۷۸۹
1171
- "۰": "0",
1172
- "۱": "1",
1173
- "۲": "2",
1174
- "۳": "3",
1175
- "۴": "4",
1176
- "۵": "5",
1177
- "۶": "6",
1178
- "۷": "7",
1179
- "۸": "8",
1180
- "۹": "9",
1181
- // Bengali numerals (used in Bangladesh, India): ০১২৩৪৫৬৭৮৯
1182
- "০": "0",
1183
- "১": "1",
1184
- "২": "2",
1185
- "৩": "3",
1186
- "৪": "4",
1187
- "৫": "5",
1188
- "৬": "6",
1189
- "৭": "7",
1190
- "৮": "8",
1191
- "৯": "9"
1192
- };
1193
- return t.split("").map((i) => e[i] ?? i).join("");
1194
- }
1195
- handleInput(t) {
1196
- if (this.disabled) return;
1197
- const e = t.target, i = e.selectionStart ?? 0, r = this.inputValue, s = e.value, o = this.normalizeNumerals(s);
1198
- o !== s && (e.value = o, requestAnimationFrame(() => {
1199
- e.setSelectionRange(i, i);
1200
- })), this.inputValue = o, this.touched = true, this.showNationalAddressIcon && (this.showNationalAddressIcon = false), this.mode === "form" && (this.validationError && (this.validationError = null), this.selectedId = null, this._internals.setFormValue(this.inputValue || null), this.validate()), this.errors && this.errors.length > 0 && (this.errors = []), this.inputValue.trim().length >= this.minChars && (this.isLoading = true), this.debouncedFetch(this.inputValue), this._value = this.inputValue, this.requestUpdate("value", r), this.dispatchEvent(new CustomEvent("input", {
1201
- detail: { value: this.inputValue },
1202
- bubbles: true,
1203
- composed: true
1204
- })), this.dispatchEvent(new Event("change", {
1205
- bubbles: true,
1206
- composed: true
1207
- })), this.dispatchEvent(new InputEvent("input", {
1208
- data: this.inputValue,
1209
- bubbles: true,
1210
- composed: true
1211
- }));
1212
- }
1213
- async handleSelect(t) {
1214
- if (this.disabled) return;
1215
- this.isSaudiFormMode() && t.place_id && this.isShortAddressFormat(t.place_id) ? (this.inputValue = t.place_id, this.showNationalAddressIcon = true) : (this.inputValue = t.formatted_address, this.showNationalAddressIcon = false), this.isOpen = false, this.predictions = [], this.touched = true;
1216
- let e = null;
1217
- if (this.mode === "form" ? e = await this.fetchPlaceDetails(t.place_id) : t.geometry?.location ? e = {
1218
- place_id: t.place_id,
1219
- formatted_address: t.formatted_address || t.description,
1220
- geometry: t.geometry,
1221
- types: t.types,
1222
- address_components: t.address_components
1223
- } : e = await this.fetchPlaceDetails(t.place_id), e) {
1224
- this.isSaudiFormMode() && e.place_id && this.isShortAddressFormat(e.place_id) ? (this.inputValue = e.place_id, this.showNationalAddressIcon = true) : (e.formatted_address && (this.inputValue = e.formatted_address), this.showNationalAddressIcon = false), this.mode === "form" && (this.selectedId = e.place_id, this._internals.setFormValue(this.inputValue), this.validate()), this._value = this.inputValue, this.dispatchEvent(new CustomEvent("input", {
1225
- detail: { value: this.inputValue },
1226
- bubbles: true,
1227
- composed: true
1228
- })), this.dispatchEvent(new Event("change", {
1229
- bubbles: true,
1230
- composed: true
1231
- }));
1232
- const i = this.getValidationSupport(e);
1233
- this.dispatchEvent(new CustomEvent("place-select", {
1234
- detail: { place: e, validationSupport: i },
1235
- bubbles: true,
1236
- composed: true
1237
- })), this.dispatchEvent(new CustomEvent("place-changed", {
1238
- detail: { place: e, validationSupport: i },
1239
- bubbles: true,
1240
- composed: true
1241
- }));
1242
- }
1243
- }
1244
- handleKeyDown(t) {
1245
- if (!this.disabled && !(!this.isOpen || this.predictions.length === 0))
1246
- switch (t.key) {
1247
- case "ArrowDown":
1248
- t.preventDefault(), this.activeIndex = Math.min(this.activeIndex + 1, this.predictions.length - 1);
1249
- break;
1250
- case "ArrowUp":
1251
- t.preventDefault(), this.activeIndex = Math.max(this.activeIndex - 1, -1);
1252
- break;
1253
- case "Enter":
1254
- t.preventDefault(), this.activeIndex >= 0 && this.activeIndex < this.predictions.length && this.handleSelect(this.predictions[this.activeIndex]);
1255
- break;
1256
- case "Escape":
1257
- t.preventDefault(), this.isOpen = false, this.activeIndex = -1;
1258
- break;
1259
- }
1260
- }
1261
- handleBlur() {
1262
- setTimeout(() => {
1263
- this.isOpen = false, this.activeIndex = -1, this.mode === "form" && this.touched && this.validate(), this.dispatchEvent(new Event("blur", {
1264
- bubbles: true,
1265
- composed: true
1266
- }));
1267
- }, 200);
1268
- }
1269
- handleFocus() {
1270
- this.disabled || this.predictions.length > 0 && (this.isOpen = true);
1271
- }
1272
- renderLocationIcon() {
1273
- return g`
1274
- <svg class="location-icon" fill="currentColor" viewBox="0 0 20 20">
1275
- <path fill-rule="evenodd" d="M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z" clip-rule="evenodd" />
1276
- </svg>
1277
- `;
1278
- }
1279
- renderTooltip() {
1280
- return this.tooltip ? g`
1281
- <span class="tooltip-toggle" part="tooltip-toggle">
1282
- <svg class="tooltip-icon" part="tooltip-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
1283
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
1284
- </svg>
1285
- <span class="tooltip-content" part="tooltip-content">${this.tooltip}</span>
1286
- </span>
1287
- ` : "";
1288
- }
1289
- renderPrediction(t, e) {
1290
- const i = {
1291
- "dropdown-item": true,
1292
- active: e === this.activeIndex
1293
- };
1294
- let r = t.structured_formatting.main_text;
1295
- return t.short_address && r.includes(t.short_address) && (r = r.replace(t.short_address, "").trim(), r = r.replace(/\s*,\s*,\s*/g, ", ").replace(/^\s*,\s*|\s*,\s*$/g, "").trim()), g`
1296
- <div
1297
- class=${U$1(i)}
1298
- part="dropdown-item ${e === this.activeIndex ? "dropdown-item-active" : ""}"
1299
- @click=${() => this.handleSelect(t)}
1300
- role="option"
1301
- aria-selected=${e === this.activeIndex}
1302
- >
1303
- ${this.renderLocationIcon()}
1304
- <div class="place-info" part="place-info">
1305
- <div class="main-text" part="main-text">
1306
- ${t.short_address ? g`
1307
- <span class="national-address-badge" part="national-address-badge">
1308
- <img
1309
- src="https://cdn.salla.network/images/shipping/png/national-address-icon-small-min.png"
1310
- alt="national address icon"
1311
- class="national-address-icon"
1312
- />
1313
- <span class="national-address-text">${t.short_address}</span>
1314
- <span class="national-address-separator">-</span>
1315
- </span>
1316
- ` : ""}
1317
- ${r}
1318
- </div>
1319
- ${t.structured_formatting.secondary_text ? g`
1320
- <div class="secondary-text" part="secondary-text">
1321
- ${t.structured_formatting.secondary_text}
1322
- </div>
1323
- ` : ""}
1324
- </div>
1325
- </div>
1326
- `;
1327
- }
1328
- render() {
1329
- const t = {
1330
- dropdown: true,
1331
- open: this.isOpen
1332
- }, e = {
1333
- "is-invalid": !!(this.mode === "form" && this.validationError) || this.errors && this.errors.length > 0,
1334
- "with-national-icon": this.showNationalAddressIcon
1335
- }, i = {
1336
- required: this.mode === "form" && this.required
1337
- }, r = q$1(this.language), s = this.dir === "auto" ? Xe(this.language) ? "rtl" : "ltr" : this.dir, o = this.placeholder || r.placeholder, a = this.name || "salla-address-search";
1338
- return g`
1339
- <div class="wrapper ${this.className}" part="wrapper" dir="${s}">
1340
- <div class="input-container" part="input-container">
1341
- ${this.label ? g`
1342
- <label part="label" class=${U$1(i)}>
1343
- <span class="label-content">
1344
- <span>${this.label}</span>
1345
- ${this.renderTooltip()}
1346
- </span>
1347
- </label>
1348
- ` : ""}
1349
- <div class="input-wrapper">
1350
- <input
1351
- part="input"
1352
- class=${U$1(e)}
1353
- type="text"
1354
- name="${a}"
1355
- .value=${Ke(this.inputValue)}
1356
- placeholder=${o}
1357
- ?disabled=${this.disabled}
1358
- @input=${this.handleInput}
1359
- @keydown=${this.handleKeyDown}
1360
- @blur=${this.handleBlur}
1361
- @focus=${this.handleFocus}
1362
- role="combobox"
1363
- aria-expanded=${this.isOpen}
1364
- aria-autocomplete="list"
1365
- aria-controls="predictions-list"
1366
- aria-invalid=${this.mode === "form" && this.validationError || this.errors && this.errors.length > 0 ? "true" : "false"}
1367
- aria-required=${this.mode === "form" && this.required ? "true" : "false"}
1368
- autocomplete="off"
1369
- autocorrect="off"
1370
- autocapitalize="off"
1371
- spellcheck="false"
1372
- />
1373
- ${this.isLoading ? g`<div class="loading-spinner" part="spinner"></div>` : ""}
1374
-
1375
- <div
1376
- id="predictions-list"
1377
- class=${U$1(t)}
1378
- part="dropdown"
1379
- role="listbox"
1380
- >
1381
- ${this.predictions.length > 0 ? this.predictions.map((n, l) => this.renderPrediction(n, l)) : this.inputValue && !this.isLoading ? g`<div class="no-results" part="no-results">${r.noResults}</div>` : ""}
1382
- </div>
1383
- </div>
1384
- ${this.mode === "form" && this.validationError ? g`
1385
- <div class="validation-error" part="validation-error">
1386
- ${this.isSaudiFormMode() ? this.renderSaudiFriendlyError() : g`<span>${this.validationError}</span>`}
1387
- </div>
1388
- ` : ""}
1389
- ${this.errors && this.errors.length > 0 ? g`
1390
- <div class="validation-error" part="validation-error">${this.errors[0]}</div>
1391
- ` : ""}
1392
- ${this.error ? g`<div class="error-message" part="error">${this.error}</div>` : ""}
1393
- ${this.renderSaudiHelpText()}
1394
- </div>
1395
- </div>
1396
- `;
1397
- }
1398
- };
1399
- d$1.formAssociated = true;
1400
- d$1.styles = ve`
1401
- :host {
1402
- display: block;
1403
- position: relative;
1404
- font-family: var(--salla-autocomplete-font-family, system-ui, -apple-system, sans-serif);
1405
- }
1406
-
1407
- .wrapper {
1408
- position: relative;
1409
- }
1410
-
1411
- .input-container {
1412
- display: flex;
1413
- flex-direction: column;
1414
- }
1415
-
1416
- .input-wrapper {
1417
- position: relative;
1418
- }
1419
-
1420
- label {
1421
- display: block;
1422
- margin-bottom: var(--salla-autocomplete-label-margin, 0.5rem);
1423
- font-size: var(--salla-autocomplete-label-font-size, 0.875rem);
1424
- font-weight: var(--salla-autocomplete-label-font-weight, 500);
1425
- color: var(--salla-autocomplete-label-color, #374151);
1426
- }
1427
-
1428
- label.required::after {
1429
- content: ' *';
1430
- color: var(--salla-autocomplete-required-color, #dc2626);
1431
- }
1432
-
1433
- .label-content {
1434
- display: inline-flex;
1435
- align-items: center;
1436
- gap: 0.5rem;
1437
- }
1438
-
1439
- .tooltip-toggle {
1440
- position: relative;
1441
- display: inline-flex;
1442
- align-items: center;
1443
- cursor: help;
1444
- }
1445
-
1446
- .tooltip-icon {
1447
- width: 1rem;
1448
- height: 1rem;
1449
- color: var(--salla-autocomplete-tooltip-icon-color, #6b7280);
1450
- }
1451
-
1452
- .tooltip-content {
1453
- display: none;
1454
- position: absolute;
1455
- bottom: 125%;
1456
- left: 50%;
1457
- transform: translateX(-50%);
1458
- background: var(--salla-autocomplete-tooltip-bg, #1f2937);
1459
- color: var(--salla-autocomplete-tooltip-color, white);
1460
- padding: 0.5rem 0.75rem;
1461
- border-radius: 0.375rem;
1462
- font-size: 0.75rem;
1463
- line-height: 1.4;
1464
- white-space: nowrap;
1465
- z-index: 1000;
1466
- box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
1467
- }
1468
-
1469
- .tooltip-content::after {
1470
- content: '';
1471
- position: absolute;
1472
- top: 100%;
1473
- left: 50%;
1474
- transform: translateX(-50%);
1475
- border: 5px solid transparent;
1476
- border-top-color: var(--salla-autocomplete-tooltip-bg, #1f2937);
1477
- }
1478
-
1479
- .tooltip-toggle:hover .tooltip-content,
1480
- .tooltip-toggle:focus .tooltip-content {
1481
- display: block;
1482
- }
1483
-
1484
- input {
1485
- width: 100%;
1486
- padding-block: 0.75rem;
1487
- padding-inline-start: var(--salla-autocomplete-input-padding-start, 0.875rem);
1488
- padding-inline-end: var(--salla-autocomplete-input-padding-end, 2.75rem);
1489
- font-family: var(--salla-autocomplete-font-family, system-ui, -apple-system, sans-serif);
1490
- font-size: var(--salla-autocomplete-input-font-size, 1rem);
1491
- line-height: var(--salla-autocomplete-input-line-height, 1.5);
1492
- border: var(--salla-autocomplete-input-border, 1px solid #d1d5db);
1493
- border-radius: var(--salla-autocomplete-input-border-radius, 0.5rem);
1494
- background: var(--salla-autocomplete-input-background, white);
1495
- color: var(--salla-autocomplete-input-color, #111827);
1496
- outline: none;
1497
- transition: all 0.2s;
1498
- box-sizing: border-box;
1499
- height: var(--salla-autocomplete-input-height, auto);
1500
- min-height: var(--salla-autocomplete-input-height, 44px);
1501
- -webkit-appearance: none;
1502
- appearance: none;
1503
- }
1504
-
1505
- input.with-national-icon {
1506
- padding-inline-start: var(--salla-autocomplete-input-padding-start-icon, 2rem);
1507
- background-image: url('https://cdn.salla.network/images/shipping/png/national-address-icon-small-min.png');
1508
- background-repeat: no-repeat;
1509
- background-position: 0.75rem center;
1510
- background-size: 16px;
1511
- }
1512
-
1513
- input.with-national-icon[dir="rtl"],
1514
- :host([dir="rtl"]) input.with-national-icon {
1515
- padding-inline-start: var(--salla-autocomplete-input-padding-start, 0.875rem);
1516
- padding-inline-end: var(--salla-autocomplete-input-padding-end-icon, 2.75rem);
1517
- background-position: calc(100% - 0.75rem) center;
1518
- }
1519
-
1520
- @media (max-width: 640px) {
1521
- input {
1522
- font-size: var(--salla-autocomplete-input-font-size-mobile, 16px);
1523
- padding-block: 0.75rem;
1524
- padding-inline-start: var(--salla-autocomplete-input-padding-start-mobile, 0.875rem);
1525
- padding-inline-end: var(--salla-autocomplete-input-padding-end-mobile, 2.75rem);
1526
- min-height: 44px;
1527
- touch-action: manipulation;
1528
- }
1529
-
1530
- input.with-national-icon {
1531
- padding-inline-start: var(--salla-autocomplete-input-padding-start-icon-mobile, 2rem);
1532
- background-position: 0.875rem center;
1533
- }
1534
-
1535
- input.with-national-icon[dir="rtl"],
1536
- :host([dir="rtl"]) input.with-national-icon {
1537
- padding-inline-start: var(--salla-autocomplete-input-padding-start-mobile, 0.875rem);
1538
- padding-inline-end: var(--salla-autocomplete-input-padding-end-icon-mobile, 2.75rem);
1539
- background-position: calc(100% - 0.875rem) center;
1540
- }
1541
- }
1542
-
1543
- input:focus {
1544
- border-color: var(--salla-autocomplete-input-focus-border-color, #3b82f6);
1545
- box-shadow: var(--salla-autocomplete-input-focus-shadow, 0 0 0 3px rgba(59, 130, 246, 0.1));
1546
- }
1547
-
1548
- input:disabled {
1549
- background-color: var(--salla-autocomplete-input-disabled-bg, #f3f4f6);
1550
- cursor: not-allowed;
1551
- }
1552
-
1553
- input.is-invalid {
1554
- border-color: var(--salla-autocomplete-input-error-border-color, #dc2626);
1555
- }
1556
-
1557
- input.is-invalid:focus {
1558
- border-color: var(--salla-autocomplete-input-error-border-color, #dc2626);
1559
- box-shadow: var(--salla-autocomplete-input-error-shadow, 0 0 0 3px rgba(220, 38, 38, 0.1));
1560
- }
1561
-
1562
- input::placeholder {
1563
- color: var(--salla-autocomplete-input-placeholder-color, #9ca3af);
1564
- }
1565
-
1566
- .validation-error {
1567
- display: flex;
1568
- flex-wrap: wrap;
1569
- align-items: center;
1570
- gap: 0.5rem;
1571
- margin-top: 0.375rem;
1572
- font-size: var(--salla-autocomplete-error-font-size, 0.875rem);
1573
- color: var(--salla-autocomplete-error-color, #dc2626);
1574
- line-height: 1.5;
1575
- }
1576
-
1577
- .validation-error > span {
1578
- line-height: 1.5;
1579
- }
1580
-
1581
- .whatsapp-link-inline {
1582
- color: var(--salla-autocomplete-whatsapp-brand-color, #25D366);
1583
- white-space: nowrap;
1584
- line-height: inherit;
1585
- display: inline-flex;
1586
- align-items: center;
1587
- vertical-align: middle;
1588
- text-decoration: underline;
1589
- cursor: pointer;
1590
- transition: all 0.2s ease;
1591
- gap: 0.25rem;
1592
- margin-inline: 0.25rem;
1593
- font-weight: 500;
1594
- }
1595
-
1596
- .whatsapp-link-inline:hover {
1597
- color: var(--salla-autocomplete-whatsapp-brand-hover, #1da851);
1598
- opacity: 0.9;
1599
- }
1600
-
1601
- .whatsapp-link-inline:active {
1602
- transform: scale(0.98);
1603
- }
1604
-
1605
- .whatsapp-link-inline .whatsapp-icon {
1606
- color: var(--salla-autocomplete-whatsapp-brand-color, #25D366);
1607
- }
1608
-
1609
- .help-text {
1610
- display: block;
1611
- margin-top: 0.5rem;
1612
- font-size: var(--salla-autocomplete-help-font-size, 0.875rem);
1613
- color: var(--salla-autocomplete-help-color, #6b7280);
1614
- line-height: 1.5;
1615
- }
1616
-
1617
- .help-text span {
1618
- line-height: 1.5;
1619
- }
1620
-
1621
- .whatsapp-icon {
1622
- width: 1rem;
1623
- height: 1rem;
1624
- }
1625
-
1626
- .loading-spinner {
1627
- position: absolute;
1628
- inset-inline-end: 0.875rem;
1629
- top: 50%;
1630
- transform: translateY(-50%);
1631
- width: var(--salla-autocomplete-spinner-size, 1.25rem);
1632
- height: var(--salla-autocomplete-spinner-size, 1.25rem);
1633
- border: 2px solid var(--salla-autocomplete-spinner-border-color, #e5e7eb);
1634
- border-top-color: var(--salla-autocomplete-spinner-color, #3b82f6);
1635
- border-radius: 50%;
1636
- animation: spin 0.6s linear infinite;
1637
- }
1638
-
1639
- @media (max-width: 640px) {
1640
- .loading-spinner {
1641
- width: var(--salla-autocomplete-spinner-size-mobile, 1.375rem);
1642
- height: var(--salla-autocomplete-spinner-size-mobile, 1.375rem);
1643
- inset-inline-end: 1rem;
1644
- }
1645
- }
1646
-
1647
- @keyframes spin {
1648
- to { transform: translateY(-50%) rotate(360deg); }
1649
- }
1650
-
1651
- /* Custom scrollbar styling */
1652
- .dropdown::-webkit-scrollbar {
1653
- width: 6px;
1654
- }
1655
-
1656
- .dropdown::-webkit-scrollbar-track {
1657
- background: #f1f1f1;
1658
- border-radius: 3px;
1659
- }
1660
-
1661
- .dropdown::-webkit-scrollbar-thumb {
1662
- background: #c1c1c1;
1663
- border-radius: 3px;
1664
- }
1665
-
1666
- .dropdown::-webkit-scrollbar-thumb:hover {
1667
- background: #a8a8a8;
1668
- }
1669
-
1670
- .dropdown {
1671
- position: absolute;
1672
- top: 100%;
1673
- left: 0;
1674
- right: 0;
1675
- margin-top: var(--salla-autocomplete-dropdown-margin-top, 0.375rem);
1676
- background: var(--salla-autocomplete-dropdown-background, white);
1677
- border: var(--salla-autocomplete-dropdown-border, 1px solid #e5e7eb);
1678
- border-radius: var(--salla-autocomplete-dropdown-border-radius, 0.5rem);
1679
- box-shadow: var(--salla-autocomplete-dropdown-shadow, 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1));
1680
- max-height: var(--salla-autocomplete-dropdown-max-height, 240px);
1681
- overflow-y: auto;
1682
- overflow-x: hidden;
1683
- z-index: var(--salla-autocomplete-dropdown-z-index, 100);
1684
- display: none;
1685
- -webkit-overflow-scrolling: touch;
1686
- overscroll-behavior: contain;
1687
- scroll-behavior: smooth;
1688
- }
1689
-
1690
- @media (max-width: 640px) {
1691
- .dropdown {
1692
- max-height: var(--salla-autocomplete-dropdown-max-height-mobile, 25vh);
1693
- border-radius: var(--salla-autocomplete-dropdown-border-radius-mobile, 0.5rem);
1694
- margin-top: var(--salla-autocomplete-dropdown-margin-top-mobile, 0.25rem);
1695
- }
1696
- }
1697
-
1698
- @media (max-width: 640px) and (max-height: 667px) {
1699
- /* Smaller phones (iPhone SE, iPhone 8, etc.) */
1700
- .dropdown {
1701
- max-height: var(--salla-autocomplete-dropdown-max-height-small, 22vh);
1702
- }
1703
- }
1704
-
1705
- @media (max-width: 640px) and (min-height: 668px) and (max-height: 896px) {
1706
- /* Standard phones (iPhone 12, iPhone 13, etc.) */
1707
- .dropdown {
1708
- max-height: var(--salla-autocomplete-dropdown-max-height-standard, 28vh);
1709
- }
1710
- }
1711
-
1712
- @media (max-width: 640px) and (min-height: 897px) {
1713
- /* Larger phones (iPhone 14 Pro Max, etc.) */
1714
- .dropdown {
1715
- max-height: var(--salla-autocomplete-dropdown-max-height-large, 30vh);
1716
- }
1717
- }
1718
-
1719
- .dropdown.open {
1720
- display: block;
1721
- }
1722
-
1723
- .dropdown-item {
1724
- display: flex;
1725
- align-items: flex-start;
1726
- padding: var(--salla-autocomplete-item-padding, 0.625rem 0.75rem);
1727
- cursor: pointer;
1728
- transition: background-color 0.15s;
1729
- border-bottom: 1px solid var(--salla-autocomplete-item-border-color, #e5e7eb);
1730
- min-height: 35px;
1731
- -webkit-tap-highlight-color: transparent;
1732
- }
1733
-
1734
- @media (max-width: 640px) {
1735
- .dropdown-item {
1736
- padding: var(--salla-autocomplete-item-padding-mobile, 0.75rem 0.875rem);
1737
- min-height: 35px;
1738
- }
1739
- }
1740
-
1741
- .dropdown-item:last-child {
1742
- border-bottom: none;
1743
- }
1744
-
1745
- .dropdown-item:hover,
1746
- .dropdown-item.selected {
1747
- background-color: var(--salla-autocomplete-item-hover-bg, #f9fafb);
1748
- }
1749
-
1750
- .dropdown-item.active {
1751
- background-color: var(--salla-autocomplete-item-active-bg, #eff6ff);
1752
- }
1753
-
1754
- @media (hover: none) and (pointer: coarse) {
1755
- .dropdown-item:hover {
1756
- background-color: transparent;
1757
- }
1758
-
1759
- .dropdown-item:active {
1760
- background-color: var(--salla-autocomplete-item-active-bg, #eff6ff);
1761
- }
1762
- }
1763
-
1764
- .location-icon {
1765
- display: none;
1766
- }
1767
-
1768
- .place-info {
1769
- flex: 1;
1770
- min-width: 0;
1771
- display: flex;
1772
- flex-direction: column;
1773
- gap: 0.25rem;
1774
- }
1775
-
1776
- .main-text {
1777
- font-size: var(--salla-autocomplete-main-text-font-size, 0.875rem);
1778
- font-weight: var(--salla-autocomplete-main-text-font-weight, 600);
1779
- color: var(--salla-autocomplete-main-text-color, #111827);
1780
- line-height: 1.4;
1781
- word-wrap: break-word;
1782
- overflow-wrap: break-word;
1783
- hyphens: auto;
1784
- }
1785
-
1786
- @media (max-width: 640px) {
1787
- .main-text {
1788
- font-size: var(--salla-autocomplete-main-text-font-size-mobile, 0.9375rem);
1789
- line-height: 1.3;
1790
- }
1791
- }
1792
-
1793
- .main-text .highlight {
1794
- font-weight: var(--salla-autocomplete-highlight-font-weight, 700);
1795
- color: var(--salla-autocomplete-highlight-color, inherit);
1796
- }
1797
-
1798
- .national-address-badge {
1799
- display: inline-flex;
1800
- align-items: center;
1801
- font-size: 0.8125rem;
1802
- line-height: 1;
1803
- vertical-align: middle;
1804
- }
1805
-
1806
- .national-address-icon {
1807
- width: 11px;
1808
- height: auto;
1809
- flex-shrink: 0;
1810
- display: inline-block;
1811
- }
1812
-
1813
- .national-address-text {
1814
- padding-inline-start: 3px;
1815
- -webkit-text-fill-color: transparent;
1816
- background-clip: text;
1817
- -webkit-background-clip: text;
1818
- background-image: linear-gradient(135deg, #0052cc, #00b8d9 50%, #36b37e);
1819
- font-weight: 600;
1820
- display: inline-block;
1821
- }
1822
-
1823
- .national-address-separator {
1824
- padding-inline: 4px;
1825
- color: #6b7280;
1826
- display: inline-block;
1827
- }
1828
-
1829
- .secondary-text {
1830
- font-size: var(--salla-autocomplete-secondary-text-font-size, 0.75rem);
1831
- color: var(--salla-autocomplete-secondary-text-color, #6b7280);
1832
- line-height: 1.4;
1833
- word-wrap: break-word;
1834
- overflow-wrap: break-word;
1835
- hyphens: auto;
1836
- }
1837
-
1838
- @media (max-width: 640px) {
1839
- .secondary-text {
1840
- font-size: var(--salla-autocomplete-secondary-text-font-size-mobile, 0.8125rem);
1841
- line-height: 1.3;
1842
- }
1843
- }
1844
-
1845
- .error-message {
1846
- margin-top: 0.5rem;
1847
- font-size: var(--salla-autocomplete-error-font-size, 0.875rem);
1848
- color: var(--salla-autocomplete-error-color, #dc2626);
1849
- }
1850
-
1851
- .no-results {
1852
- padding: 1rem;
1853
- text-align: start;
1854
- color: var(--salla-autocomplete-no-results-color, #6b7280);
1855
- font-size: var(--salla-autocomplete-no-results-font-size, 0.875rem);
1856
- }
1857
-
1858
- .no-results.error-state {
1859
- color: var(--salla-autocomplete-error-color, #dc2626);
1860
- background-color: var(--salla-autocomplete-error-bg, #fef2f2);
1861
- border-radius: 0.375rem;
1862
- margin: 0.5rem;
1863
- padding: 0.875rem;
1864
- }
1865
-
1866
- @media (max-width: 640px) {
1867
- .no-results {
1868
- padding: 0.875rem;
1869
- font-size: var(--salla-autocomplete-no-results-font-size-mobile, 0.8125rem);
1870
- }
1871
-
1872
- .no-results.error-state {
1873
- margin: 0.375rem;
1874
- padding: 0.75rem;
1875
- }
1876
- }
1877
- `;
1878
- h$1([
1879
- p({ type: String })
1880
- ], d$1.prototype, "proxyUrl", 2);
1881
- h$1([
1882
- p({ type: String })
1883
- ], d$1.prototype, "authToken", 2);
1884
- h$1([
1885
- p({ type: String })
1886
- ], d$1.prototype, "placeholder", 2);
1887
- h$1([
1888
- p({ type: String })
1889
- ], d$1.prototype, "defaultPlace", 2);
1890
- h$1([
1891
- p({ type: String })
1892
- ], d$1.prototype, "label", 2);
1893
- h$1([
1894
- p({ type: String })
1895
- ], d$1.prototype, "className", 2);
1896
- h$1([
1897
- p({ type: String })
1898
- ], d$1.prototype, "language", 2);
1899
- h$1([
1900
- p({ type: String })
1901
- ], d$1.prototype, "dir", 2);
1902
- h$1([
1903
- p({ type: String })
1904
- ], d$1.prototype, "mode", 2);
1905
- h$1([
1906
- p({ type: String })
1907
- ], d$1.prototype, "name", 2);
1908
- h$1([
1909
- p({ type: Boolean })
1910
- ], d$1.prototype, "required", 2);
1911
- h$1([
1912
- p({ type: String })
1913
- ], d$1.prototype, "pattern", 2);
1914
- h$1([
1915
- p({ type: String })
1916
- ], d$1.prototype, "tooltip", 2);
1917
- h$1([
1918
- p({ type: String })
1919
- ], d$1.prototype, "selectedId", 2);
1920
- h$1([
1921
- p({ type: Array })
1922
- ], d$1.prototype, "errors", 2);
1923
- h$1([
1924
- p({ type: Boolean })
1925
- ], d$1.prototype, "disabled", 2);
1926
- h$1([
1927
- p({ type: String })
1928
- ], d$1.prototype, "value", 1);
1929
- h$1([
1930
- p({ type: String })
1931
- ], d$1.prototype, "country", 1);
1932
- h$1([
1933
- p({ type: Object })
1934
- ], d$1.prototype, "locationBias", 2);
1935
- h$1([
1936
- p({ type: Object })
1937
- ], d$1.prototype, "locationRestriction", 2);
1938
- h$1([
1939
- p({ type: Array })
1940
- ], d$1.prototype, "types", 2);
1941
- h$1([
1942
- p({ type: String })
1943
- ], d$1.prototype, "fieldsStr", 1);
1944
- h$1([
1945
- p({ type: Array })
1946
- ], d$1.prototype, "fields", 1);
1947
- h$1([
1948
- p({ type: Boolean })
1949
- ], d$1.prototype, "strictBounds", 2);
1950
- h$1([
1951
- p({ type: Boolean })
1952
- ], d$1.prototype, "useSessionToken", 2);
1953
- h$1([
1954
- p({ type: Boolean })
1955
- ], d$1.prototype, "resolve", 2);
1956
- h$1([
1957
- p({ type: Function })
1958
- ], d$1.prototype, "onValidateAddress", 2);
1959
- h$1([
1960
- p({ type: Number })
1961
- ], d$1.prototype, "debounceDelay", 2);
1962
- h$1([
1963
- p({ type: Number })
1964
- ], d$1.prototype, "minChars", 2);
1965
- h$1([
1966
- b$1()
1967
- ], d$1.prototype, "predictions", 2);
1968
- h$1([
1969
- b$1()
1970
- ], d$1.prototype, "isOpen", 2);
1971
- h$1([
1972
- b$1()
1973
- ], d$1.prototype, "isLoading", 2);
1974
- h$1([
1975
- b$1()
1976
- ], d$1.prototype, "error", 2);
1977
- h$1([
1978
- b$1()
1979
- ], d$1.prototype, "activeIndex", 2);
1980
- h$1([
1981
- b$1()
1982
- ], d$1.prototype, "inputValue", 2);
1983
- h$1([
1984
- b$1()
1985
- ], d$1.prototype, "sessionToken", 2);
1986
- h$1([
1987
- b$1()
1988
- ], d$1.prototype, "validationError", 2);
1989
- h$1([
1990
- b$1()
1991
- ], d$1.prototype, "touched", 2);
1992
- h$1([
1993
- b$1()
1994
- ], d$1.prototype, "showNationalAddressIcon", 2);
1995
- h$1([
1996
- qe("input")
1997
- ], d$1.prototype, "inputElement", 2);
1998
- d$1 = h$1([
1999
- De("salla-address-autocomplete")
2000
- ], d$1);
2001
-
2002
- let K = false;
2003
- const W = /* @__PURE__ */ new Map();
2004
- const D = new Promise((t, e) => {
2005
- if (typeof window > "u") {
2006
- t();
2007
- return;
2008
- }
2009
- window.googleMapsInitCallback = t, window.gm_authFailure = () => {
2010
- e(new Error("Google Maps authentication failed"));
2011
- };
2012
- });
2013
- async function st(t) {
2014
- if (W.has(t))
2015
- return W.get(t);
2016
- if (await D, typeof google < "u" && google.maps && google.maps.importLibrary) {
2017
- const e = await google.maps.importLibrary(t);
2018
- return W.set(t, e), e;
2019
- }
2020
- return google.maps[t] || google.maps;
2021
- }
2022
- function ee(t, e, o) {
2023
- if (typeof document > "u")
2024
- return Promise.resolve();
2025
- if (K)
2026
- return D;
2027
- K = true;
2028
- let i;
2029
- if (typeof t == "string")
2030
- i = { key: t };
2031
- else if (typeof t == "object")
2032
- i = { ...t };
2033
- else
2034
- throw new Error("API key should be a string or an object");
2035
- Array.isArray(i.libraries) && (i.libraries = i.libraries), !e && !i.v && (e = "quarterly"), i.loading || (i.loading = "async"), i.callback = "googleMapsInitCallback";
2036
- let a = `https://maps.googleapis.com/maps/api/js?${Object.keys(i).map((p) => `${encodeURIComponent(p)}=${encodeURIComponent(i[p])}`).join("&")}`;
2037
- e && (a += `&v=${e}`);
2038
- const r = document.createElement("script");
2039
- return r.src = a, r.async = true, r.defer = true, r.onerror = (p) => {
2040
- console.error("Failed to load Google Maps script:", p);
2041
- }, document.body.appendChild(r), D;
2042
- }
2043
- const L = (t) => (e, o) => {
2044
- o !== void 0 ? o.addInitializer(() => {
2045
- customElements.define(t, e);
2046
- }) : customElements.define(t, e);
2047
- };
2048
- const j = globalThis, q = j.ShadowRoot && (j.ShadyCSS === void 0 || j.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, it = /* @__PURE__ */ Symbol(), J = /* @__PURE__ */ new WeakMap();
2049
- let at = class {
2050
- constructor(e, o, i) {
2051
- if (this._$cssResult$ = true, i !== it) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
2052
- this.cssText = e, this.t = o;
2053
- }
2054
- get styleSheet() {
2055
- let e = this.o;
2056
- const o = this.t;
2057
- if (q && e === void 0) {
2058
- const i = o !== void 0 && o.length === 1;
2059
- i && (e = J.get(o)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && J.set(o, e));
2060
- }
2061
- return e;
2062
- }
2063
- toString() {
2064
- return this.cssText;
2065
- }
2066
- };
2067
- const nt = (t) => new at(typeof t == "string" ? t : t + "", void 0, it), rt = (t, e) => {
2068
- if (q) t.adoptedStyleSheets = e.map((o) => o instanceof CSSStyleSheet ? o : o.styleSheet);
2069
- else for (const o of e) {
2070
- const i = document.createElement("style"), s = j.litNonce;
2071
- s !== void 0 && i.setAttribute("nonce", s), i.textContent = o.cssText, t.appendChild(i);
2072
- }
2073
- }, Y = q ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
2074
- let o = "";
2075
- for (const i of e.cssRules) o += i.cssText;
2076
- return nt(o);
2077
- })(t) : t;
2078
- const { is: lt, defineProperty: ct, getOwnPropertyDescriptor: pt, getOwnPropertyNames: ht, getOwnPropertySymbols: ut, getPrototypeOf: dt } = Object, G = globalThis, X = G.trustedTypes, mt = X ? X.emptyScript : "", gt = G.reactiveElementPolyfillSupport, U = (t, e) => t, R = { toAttribute(t, e) {
2079
- switch (e) {
2080
- case Boolean:
2081
- t = t ? mt : null;
2082
- break;
2083
- case Object:
2084
- case Array:
2085
- t = t == null ? t : JSON.stringify(t);
2086
- }
2087
- return t;
2088
- }, fromAttribute(t, e) {
2089
- let o = t;
2090
- switch (e) {
2091
- case Boolean:
2092
- o = t !== null;
2093
- break;
2094
- case Number:
2095
- o = t === null ? null : Number(t);
2096
- break;
2097
- case Object:
2098
- case Array:
2099
- try {
2100
- o = JSON.parse(t);
2101
- } catch {
2102
- o = null;
2103
- }
2104
- }
2105
- return o;
2106
- } }, V = (t, e) => !lt(t, e), Q = { attribute: true, type: String, converter: R, reflect: false, useDefault: false, hasChanged: V };
2107
- Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), G.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
2108
- class A extends HTMLElement {
2109
- static addInitializer(e) {
2110
- this._$Ei(), (this.l ??= []).push(e);
2111
- }
2112
- static get observedAttributes() {
2113
- return this.finalize(), this._$Eh && [...this._$Eh.keys()];
2114
- }
2115
- static createProperty(e, o = Q) {
2116
- if (o.state && (o.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(e) && ((o = Object.create(o)).wrapped = true), this.elementProperties.set(e, o), !o.noAccessor) {
2117
- const i = /* @__PURE__ */ Symbol(), s = this.getPropertyDescriptor(e, i, o);
2118
- s !== void 0 && ct(this.prototype, e, s);
2119
- }
2120
- }
2121
- static getPropertyDescriptor(e, o, i) {
2122
- const { get: s, set: a } = pt(this.prototype, e) ?? { get() {
2123
- return this[o];
2124
- }, set(r) {
2125
- this[o] = r;
2126
- } };
2127
- return { get: s, set(r) {
2128
- const p = s?.call(this);
2129
- a?.call(this, r), this.requestUpdate(e, p, i);
2130
- }, configurable: true, enumerable: true };
2131
- }
2132
- static getPropertyOptions(e) {
2133
- return this.elementProperties.get(e) ?? Q;
2134
- }
2135
- static _$Ei() {
2136
- if (this.hasOwnProperty(U("elementProperties"))) return;
2137
- const e = dt(this);
2138
- e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
2139
- }
2140
- static finalize() {
2141
- if (this.hasOwnProperty(U("finalized"))) return;
2142
- if (this.finalized = true, this._$Ei(), this.hasOwnProperty(U("properties"))) {
2143
- const o = this.properties, i = [...ht(o), ...ut(o)];
2144
- for (const s of i) this.createProperty(s, o[s]);
2145
- }
2146
- const e = this[Symbol.metadata];
2147
- if (e !== null) {
2148
- const o = litPropertyMetadata.get(e);
2149
- if (o !== void 0) for (const [i, s] of o) this.elementProperties.set(i, s);
2150
- }
2151
- this._$Eh = /* @__PURE__ */ new Map();
2152
- for (const [o, i] of this.elementProperties) {
2153
- const s = this._$Eu(o, i);
2154
- s !== void 0 && this._$Eh.set(s, o);
2155
- }
2156
- this.elementStyles = this.finalizeStyles(this.styles);
2157
- }
2158
- static finalizeStyles(e) {
2159
- const o = [];
2160
- if (Array.isArray(e)) {
2161
- const i = new Set(e.flat(1 / 0).reverse());
2162
- for (const s of i) o.unshift(Y(s));
2163
- } else e !== void 0 && o.push(Y(e));
2164
- return o;
2165
- }
2166
- static _$Eu(e, o) {
2167
- const i = o.attribute;
2168
- return i === false ? void 0 : typeof i == "string" ? i : typeof e == "string" ? e.toLowerCase() : void 0;
2169
- }
2170
- constructor() {
2171
- super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
2172
- }
2173
- _$Ev() {
2174
- this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((e) => e(this));
2175
- }
2176
- addController(e) {
2177
- (this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
2178
- }
2179
- removeController(e) {
2180
- this._$EO?.delete(e);
2181
- }
2182
- _$E_() {
2183
- const e = /* @__PURE__ */ new Map(), o = this.constructor.elementProperties;
2184
- for (const i of o.keys()) this.hasOwnProperty(i) && (e.set(i, this[i]), delete this[i]);
2185
- e.size > 0 && (this._$Ep = e);
2186
- }
2187
- createRenderRoot() {
2188
- const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
2189
- return rt(e, this.constructor.elementStyles), e;
2190
- }
2191
- connectedCallback() {
2192
- this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((e) => e.hostConnected?.());
2193
- }
2194
- enableUpdating(e) {
2195
- }
2196
- disconnectedCallback() {
2197
- this._$EO?.forEach((e) => e.hostDisconnected?.());
2198
- }
2199
- attributeChangedCallback(e, o, i) {
2200
- this._$AK(e, i);
2201
- }
2202
- _$ET(e, o) {
2203
- const i = this.constructor.elementProperties.get(e), s = this.constructor._$Eu(e, i);
2204
- if (s !== void 0 && i.reflect === true) {
2205
- const a = (i.converter?.toAttribute !== void 0 ? i.converter : R).toAttribute(o, i.type);
2206
- this._$Em = e, a == null ? this.removeAttribute(s) : this.setAttribute(s, a), this._$Em = null;
2207
- }
2208
- }
2209
- _$AK(e, o) {
2210
- const i = this.constructor, s = i._$Eh.get(e);
2211
- if (s !== void 0 && this._$Em !== s) {
2212
- const a = i.getPropertyOptions(s), r = typeof a.converter == "function" ? { fromAttribute: a.converter } : a.converter?.fromAttribute !== void 0 ? a.converter : R;
2213
- this._$Em = s;
2214
- const p = r.fromAttribute(o, a.type);
2215
- this[s] = p ?? this._$Ej?.get(s) ?? p, this._$Em = null;
2216
- }
2217
- }
2218
- requestUpdate(e, o, i, s = false, a) {
2219
- if (e !== void 0) {
2220
- const r = this.constructor;
2221
- if (s === false && (a = this[e]), i ??= r.getPropertyOptions(e), !((i.hasChanged ?? V)(a, o) || i.useDefault && i.reflect && a === this._$Ej?.get(e) && !this.hasAttribute(r._$Eu(e, i)))) return;
2222
- this.C(e, o, i);
2223
- }
2224
- this.isUpdatePending === false && (this._$ES = this._$EP());
2225
- }
2226
- C(e, o, { useDefault: i, reflect: s, wrapped: a }, r) {
2227
- i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, r ?? o ?? this[e]), a !== true || r !== void 0) || (this._$AL.has(e) || (this.hasUpdated || i || (o = void 0), this._$AL.set(e, o)), s === true && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
2228
- }
2229
- async _$EP() {
2230
- this.isUpdatePending = true;
2231
- try {
2232
- await this._$ES;
2233
- } catch (o) {
2234
- Promise.reject(o);
2235
- }
2236
- const e = this.scheduleUpdate();
2237
- return e != null && await e, !this.isUpdatePending;
2238
- }
2239
- scheduleUpdate() {
2240
- return this.performUpdate();
2241
- }
2242
- performUpdate() {
2243
- if (!this.isUpdatePending) return;
2244
- if (!this.hasUpdated) {
2245
- if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
2246
- for (const [s, a] of this._$Ep) this[s] = a;
2247
- this._$Ep = void 0;
2248
- }
2249
- const i = this.constructor.elementProperties;
2250
- if (i.size > 0) for (const [s, a] of i) {
2251
- const { wrapped: r } = a, p = this[s];
2252
- r !== true || this._$AL.has(s) || p === void 0 || this.C(s, void 0, a, p);
2253
- }
2254
- }
2255
- let e = false;
2256
- const o = this._$AL;
2257
- try {
2258
- e = this.shouldUpdate(o), e ? (this.willUpdate(o), this._$EO?.forEach((i) => i.hostUpdate?.()), this.update(o)) : this._$EM();
2259
- } catch (i) {
2260
- throw e = false, this._$EM(), i;
2261
- }
2262
- e && this._$AE(o);
2263
- }
2264
- willUpdate(e) {
2265
- }
2266
- _$AE(e) {
2267
- this._$EO?.forEach((o) => o.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(e)), this.updated(e);
2268
- }
2269
- _$EM() {
2270
- this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
2271
- }
2272
- get updateComplete() {
2273
- return this.getUpdateComplete();
2274
- }
2275
- getUpdateComplete() {
2276
- return this._$ES;
2277
- }
2278
- shouldUpdate(e) {
2279
- return true;
2280
- }
2281
- update(e) {
2282
- this._$Eq &&= this._$Eq.forEach((o) => this._$ET(o, this[o])), this._$EM();
2283
- }
2284
- updated(e) {
2285
- }
2286
- firstUpdated(e) {
2287
- }
2288
- }
2289
- A.elementStyles = [], A.shadowRootOptions = { mode: "open" }, A[U("elementProperties")] = /* @__PURE__ */ new Map(), A[U("finalized")] = /* @__PURE__ */ new Map(), gt?.({ ReactiveElement: A }), (G.reactiveElementVersions ??= []).push("2.1.2");
2290
- const bt = { attribute: true, type: String, converter: R, reflect: false, hasChanged: V }, yt = (t = bt, e, o) => {
2291
- const { kind: i, metadata: s } = o;
2292
- let a = globalThis.litPropertyMetadata.get(s);
2293
- if (a === void 0 && globalThis.litPropertyMetadata.set(s, a = /* @__PURE__ */ new Map()), i === "setter" && ((t = Object.create(t)).wrapped = true), a.set(o.name, t), i === "accessor") {
2294
- const { name: r } = o;
2295
- return { set(p) {
2296
- const m = e.get.call(this);
2297
- e.set.call(this, p), this.requestUpdate(r, m, t, true, p);
2298
- }, init(p) {
2299
- return p !== void 0 && this.C(r, void 0, t, p), p;
2300
- } };
2301
- }
2302
- if (i === "setter") {
2303
- const { name: r } = o;
2304
- return function(p) {
2305
- const m = this[r];
2306
- e.call(this, p), this.requestUpdate(r, m, t, true, p);
2307
- };
2308
- }
2309
- throw Error("Unsupported decorator location: " + i);
2310
- };
2311
- function n(t) {
2312
- return (e, o) => typeof o == "object" ? yt(t, e, o) : ((i, s, a) => {
2313
- const r = s.hasOwnProperty(a);
2314
- return s.constructor.createProperty(a, i), r ? Object.getOwnPropertyDescriptor(s, a) : void 0;
2315
- })(t, e, o);
2316
- }
2317
- function h(t) {
2318
- return n({ ...t, state: true, attribute: false });
2319
- }
2320
- const ft = (t, e, o) => (o.configurable = true, o.enumerable = true, Reflect.decorate && typeof e != "object" && Object.defineProperty(t, e, o), o);
2321
- function F(t, e) {
2322
- return (o, i, s) => {
2323
- const a = (r) => r.renderRoot?.querySelector(t) ?? null;
2324
- return ft(o, i, { get() {
2325
- return a(this);
2326
- } });
2327
- };
2328
- }
2329
- function _(t, e, o) {
2330
- const i = [];
2331
- return e.forEach((s) => {
2332
- if (!t || !google || !google.maps || !google.maps.event) return;
2333
- const a = google.maps.event.addListener(t, s, (r) => {
2334
- o(s, r);
2335
- });
2336
- i.push(() => {
2337
- a && google.maps.event.removeListener(a);
2338
- });
2339
- }), i;
2340
- }
2341
- function x(t) {
2342
- t.forEach((e) => e()), t.length = 0;
2343
- }
2344
- function B(t, e, o) {
2345
- if (!t) return;
2346
- const i = `set${e.charAt(0).toUpperCase()}${e.slice(1)}`;
2347
- typeof t[i] == "function" ? t[i](o) : e in t && (t[e] = o);
2348
- }
2349
- const vt = {
2350
- buttonLabel: "Use my current location",
2351
- errorTitle: "Unable to Access Location",
2352
- closeButton: "Continue",
2353
- loading: "Getting your location...",
2354
- loadingInstructions: "Please allow location access in your browser to continue",
2355
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2356
- permissionDenied: "Location access was denied. Please enable location services in your browser settings.",
2357
- positionUnavailable: "Your location is currently unavailable. Please check your device settings.",
2358
- timeout: "Location request timed out. Please try again.",
2359
- generalError: "Unable to get your location. Please try entering your address manually.",
2360
- clickToSelectLocation: "You can also choose your location by clicking on the map"
2361
- }, wt = {
2362
- buttonLabel: "استخدم موقعي الحالي",
2363
- errorTitle: "تعذر الوصول إلى الموقع",
2364
- closeButton: "متابعة",
2365
- loading: "جار الحصول على موقعك...",
2366
- loadingInstructions: "يرجى السماح بالوصول إلى الموقع في المتصفح للمتابعة",
2367
- timerMessage: "ستختفي هذه الرسالة تلقائياً بعد 7 ثوانٍ أو انقر متابعة",
2368
- permissionDenied: "تم رفض الوصول إلى الموقع. يرجى تفعيل خدمات الموقع في إعدادات المتصفح.",
2369
- positionUnavailable: "موقعك غير متاح حالياً. يرجى التحقق من إعدادات جهازك.",
2370
- timeout: "انتهت مهلة طلب الموقع. يرجى المحاولة مرة أخرى.",
2371
- generalError: "تعذر الحصول على موقعك. يرجى إدخال عنوانك يدوياً.",
2372
- clickToSelectLocation: "يمكنك أيضاً اختيار موقعك بالنقر على الخريطة"
2373
- }, kt = {
2374
- buttonLabel: "Usar mi ubicación actual",
2375
- errorTitle: "Error de ubicación",
2376
- closeButton: "Cerrar",
2377
- loading: "Obteniendo tu ubicación...",
2378
- loadingInstructions: "Permite el acceso a la ubicación en tu navegador para continuar",
2379
- timerMessage: "Este mensaje se ocultará automáticamente en 7 segundos o haz clic en Cerrar",
2380
- permissionDenied: "Se denegó el acceso a la ubicación. Habilita los servicios de ubicación en la configuración de tu navegador.",
2381
- positionUnavailable: "Tu ubicación no está disponible actualmente. Verifica la configuración de tu dispositivo.",
2382
- timeout: "La solicitud de ubicación expiró. Inténtalo de nuevo.",
2383
- generalError: "No se pudo obtener tu ubicación. Intenta ingresar tu dirección manualmente.",
2384
- clickToSelectLocation: "Haz clic en el mapa para seleccionar una ubicación"
2385
- }, Ct = {
2386
- buttonLabel: "Utiliser ma position actuelle",
2387
- errorTitle: "Erreur de localisation",
2388
- closeButton: "Continuer",
2389
- loading: "Obtention de votre position...",
2390
- loadingInstructions: "Veuillez autoriser l'accès à la localisation dans votre navigateur pour continuer",
2391
- timerMessage: "Ce message se masquera automatiquement dans 7 secondes ou cliquez sur Continuer",
2392
- permissionDenied: "L'accès à la localisation a été refusé. Veuillez activer les services de localisation dans les paramètres de votre navigateur.",
2393
- positionUnavailable: "Votre position n'est pas disponible actuellement. Veuillez vérifier les paramètres de votre appareil.",
2394
- timeout: "La demande de localisation a expiré. Veuillez réessayer.",
2395
- generalError: "Impossible d'obtenir votre position. Veuillez entrer votre adresse manuellement.",
2396
- clickToSelectLocation: "Vous pouvez également choisir votre position en cliquant sur la carte"
2397
- }, Et = {
2398
- buttonLabel: "Meinen aktuellen Standort verwenden",
2399
- errorTitle: "Standortfehler",
2400
- closeButton: "Schließen",
2401
- loading: "Getting your location...",
2402
- loadingInstructions: "Please allow location access in your browser to continue",
2403
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2404
- permissionDenied: "Der Zugriff auf den Standort wurde verweigert. Bitte aktivieren Sie die Standortdienste in Ihren Browsereinstellungen.",
2405
- positionUnavailable: "Ihr Standort ist derzeit nicht verfügbar. Bitte überprüfen Sie Ihre Geräteeinstellungen.",
2406
- timeout: "Standortanfrage ist abgelaufen. Bitte versuchen Sie es erneut.",
2407
- generalError: "Ihr Standort konnte nicht abgerufen werden. Bitte geben Sie Ihre Adresse manuell ein.",
2408
- clickToSelectLocation: "Klicken Sie auf die Karte, um einen Standort auszuwählen"
2409
- }, Lt = {
2410
- buttonLabel: "使用我的当前位置",
2411
- errorTitle: "位置错误",
2412
- closeButton: "关闭",
2413
- loading: "Getting your location...",
2414
- loadingInstructions: "Please allow location access in your browser to continue",
2415
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2416
- permissionDenied: "位置访问被拒绝。请在浏览器设置中启用位置服务。",
2417
- positionUnavailable: "您的位置当前不可用。请检查您的设备设置。",
2418
- timeout: "位置请求超时。请重试。",
2419
- generalError: "无法获取您的位置。请尝试手动输入地址。",
2420
- clickToSelectLocation: "点击地图选择位置"
2421
- }, Mt = {
2422
- buttonLabel: "現在地を使用",
2423
- errorTitle: "位置情報エラー",
2424
- closeButton: "閉じる",
2425
- loading: "Getting your location...",
2426
- loadingInstructions: "Please allow location access in your browser to continue",
2427
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2428
- permissionDenied: "位置情報へのアクセスが拒否されました。ブラウザの設定で位置情報サービスを有効にしてください。",
2429
- positionUnavailable: "現在位置が利用できません。デバイスの設定を確認してください。",
2430
- timeout: "位置情報リクエストがタイムアウトしました。もう一度お試しください。",
2431
- generalError: "位置情報を取得できませんでした。住所を手動で入力してください。",
2432
- clickToSelectLocation: "地図をクリックして場所を選択"
2433
- }, St = {
2434
- buttonLabel: "Usar minha localização atual",
2435
- errorTitle: "Erro de localização",
2436
- closeButton: "Fechar",
2437
- loading: "Getting your location...",
2438
- loadingInstructions: "Please allow location access in your browser to continue",
2439
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2440
- permissionDenied: "O acesso à localização foi negado. Ative os serviços de localização nas configurações do navegador.",
2441
- positionUnavailable: "Sua localização não está disponível no momento. Verifique as configurações do dispositivo.",
2442
- timeout: "A solicitação de localização expirou. Tente novamente.",
2443
- generalError: "Não foi possível obter sua localização. Tente inserir seu endereço manualmente.",
2444
- clickToSelectLocation: "Clique no mapa para selecionar um local"
2445
- }, _t = {
2446
- buttonLabel: "Использовать мое текущее местоположение",
2447
- errorTitle: "Ошибка местоположения",
2448
- closeButton: "Закрыть",
2449
- loading: "Getting your location...",
2450
- loadingInstructions: "Please allow location access in your browser to continue",
2451
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2452
- permissionDenied: "Доступ к местоположению был запрещен. Включите службы определения местоположения в настройках браузера.",
2453
- positionUnavailable: "Ваше местоположение в настоящее время недоступно. Проверьте настройки устройства.",
2454
- timeout: "Время ожидания запроса местоположения истекло. Попробуйте еще раз.",
2455
- generalError: "Не удалось получить ваше местоположение. Попробуйте ввести адрес вручную.",
2456
- clickToSelectLocation: "Нажмите на карту, чтобы выбрать местоположение"
2457
- }, xt = {
2458
- buttonLabel: "Usa la mia posizione attuale",
2459
- errorTitle: "Errore di posizione",
2460
- closeButton: "Chiudi",
2461
- loading: "Getting your location...",
2462
- loadingInstructions: "Please allow location access in your browser to continue",
2463
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2464
- permissionDenied: "L'accesso alla posizione è stato negato. Abilita i servizi di localizzazione nelle impostazioni del browser.",
2465
- positionUnavailable: "La tua posizione non è attualmente disponibile. Controlla le impostazioni del dispositivo.",
2466
- timeout: "La richiesta di posizione è scaduta. Riprova.",
2467
- generalError: "Impossibile ottenere la tua posizione. Prova a inserire manualmente il tuo indirizzo.",
2468
- clickToSelectLocation: "Fai clic sulla mappa per selezionare una posizione"
2469
- }, Pt = {
2470
- buttonLabel: "Gebruik mijn huidige locatie",
2471
- errorTitle: "Locatiefout",
2472
- closeButton: "Sluiten",
2473
- loading: "Getting your location...",
2474
- loadingInstructions: "Please allow location access in your browser to continue",
2475
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2476
- permissionDenied: "Toegang tot locatie is geweigerd. Schakel locatieservices in in uw browserinstellingen.",
2477
- positionUnavailable: "Uw locatie is momenteel niet beschikbaar. Controleer uw apparaatinstellingen.",
2478
- timeout: "Locatieverzoek is verlopen. Probeer het opnieuw.",
2479
- generalError: "Kan uw locatie niet ophalen. Probeer uw adres handmatig in te voeren.",
2480
- clickToSelectLocation: "Klik op de kaart om een locatie te selecteren"
2481
- }, Ot = {
2482
- buttonLabel: "Mevcut konumumu kullan",
2483
- errorTitle: "Konum Hatası",
2484
- closeButton: "Kapat",
2485
- loading: "Getting your location...",
2486
- loadingInstructions: "Please allow location access in your browser to continue",
2487
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2488
- permissionDenied: "Konum erişimi reddedildi. Lütfen tarayıcı ayarlarınızda konum hizmetlerini etkinleştirin.",
2489
- positionUnavailable: "Konumunuz şu anda kullanılamıyor. Lütfen cihaz ayarlarınızı kontrol edin.",
2490
- timeout: "Konum isteği zaman aşımına uğradı. Lütfen tekrar deneyin.",
2491
- generalError: "Konumunuz alınamadı. Lütfen adresinizi manuel olarak girmeyi deneyin.",
2492
- clickToSelectLocation: "Bir konum seçmek için haritaya tıklayın"
2493
- }, $t = {
2494
- buttonLabel: "현재 위치 사용",
2495
- errorTitle: "위치 오류",
2496
- closeButton: "닫기",
2497
- loading: "Getting your location...",
2498
- loadingInstructions: "Please allow location access in your browser to continue",
2499
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2500
- permissionDenied: "위치 액세스가 거부되었습니다. 브라우저 설정에서 위치 서비스를 활성화하십시오.",
2501
- positionUnavailable: "현재 위치를 사용할 수 없습니다. 기기 설정을 확인하십시오.",
2502
- timeout: "위치 요청 시간이 초과되었습니다. 다시 시도하십시오.",
2503
- generalError: "위치를 가져올 수 없습니다. 수동으로 주소를 입력해 보십시오.",
2504
- clickToSelectLocation: "지도를 클릭하여 위치를 선택하십시오"
2505
- }, Tt = {
2506
- buttonLabel: "मेरा वर्तमान स्थान उपयोग करें",
2507
- errorTitle: "स्थान त्रुटि",
2508
- closeButton: "बंद करें",
2509
- loading: "Getting your location...",
2510
- loadingInstructions: "Please allow location access in your browser to continue",
2511
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2512
- permissionDenied: "स्थान पहुंच अस्वीकार कर दी गई थी। कृपया अपनी ब्राउज़र सेटिंग में स्थान सेवाएं सक्षम करें।",
2513
- positionUnavailable: "आपका स्थान वर्तमान में उपलब्ध नहीं है। कृपया अपनी डिवाइस सेटिंग्स जांचें।",
2514
- timeout: "स्थान अनुरोध समय समाप्त हो गया। कृपया पुनः प्रयास करें।",
2515
- generalError: "आपका स्थान प्राप्त करने में असमर्थ। कृपया अपना पता मैन्युअल रूप से दर्ज करने का प्रयास करें।",
2516
- clickToSelectLocation: "स्थान चुनने के लिए मानचित्र पर क्लिक करें"
2517
- }, Z = {
2518
- en: vt,
2519
- ar: wt,
2520
- es: kt,
2521
- fr: Ct,
2522
- de: Et,
2523
- zh: Lt,
2524
- ja: Mt,
2525
- pt: St,
2526
- ru: _t,
2527
- it: xt,
2528
- nl: Pt,
2529
- tr: Ot,
2530
- ko: $t,
2531
- hi: Tt
2532
- }, zt = /* @__PURE__ */ new Set(["ar", "he", "fa", "ur"]);
2533
- function tt(t = "en") {
2534
- return Z[t] || Z.en;
2535
- }
2536
- function et(t) {
2537
- return zt.has(t);
2538
- }
2539
- var It = Object.defineProperty, At = Object.getOwnPropertyDescriptor, c = (t, e, o, i) => {
2540
- for (var s = i > 1 ? void 0 : i ? At(e, o) : e, a = t.length - 1, r; a >= 0; a--)
2541
- (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
2542
- return i && s && It(e, o, s), s;
2543
- };
2544
- let l = class extends i {
2545
- constructor() {
2546
- super(...arguments), this.zoom = 15, this.mapTypeId = "roadmap", this.heading = 0, this.tilt = 0, this.gestureHandling = "cooperative", this.minZoom = 2, this.maxZoom = 19, this.disableDefaultUI = false, this.mapTypeControl = false, this.streetViewControl = false, this.rotateControl = false, this.fullscreenControl = false, this.enableGeolocation = false, this.showLocationMarker = true, this.geolocationOptions = {
2547
- maximumAge: 6e4,
2548
- timeout: 1e4,
2549
- enableHighAccuracy: true
2550
- }, this.locationMarkerBackground = "#4285F4", this.locationMarkerBorderColor = "#1967D2", this.locationMarkerGlyphColor = "#FFFFFF", this.locationMarkerScale = 1.3, this.locationCircleOptions = {}, this.language = "en", this.options = {}, this.enableAutocomplete = false, this.autocompleteProxyUrl = "https://api.salla.dev", this.autocompleteStrictBounds = false, this.autocompleteResolve = false, this.autocompleteDebounceDelay = 300, this.autocompleteMinChars = 3, this.geolocationLoading = false, this.geolocationError = null, this.showLoadingOverlay = false, this.buttonState = "normal", this.eventListeners = [], this.autocompleteListenerAttached = false;
2551
- }
2552
- async connectedCallback() {
2553
- super.connectedCallback(), et(this.language) && (document.dir = "rtl");
2554
- }
2555
- async firstUpdated() {
2556
- await D, this.createMap();
2557
- }
2558
- clearAutocompleteInput() {
2559
- if (!this.autocompleteElement) return;
2560
- const t = this.autocompleteElement.shadowRoot?.querySelector("input");
2561
- t && (t.value = "", this.autocompleteElement.inputValue = "", this.autocompleteElement.value = "");
2562
- }
2563
- setupAutocompleteListener() {
2564
- !this.enableAutocomplete || !this.autocompleteElement || this.autocompleteListenerAttached || (this.autocompleteElement.addEventListener("place-select", ((t) => {
2565
- const { place: e } = t.detail;
2566
- if (e?.geometry?.location) {
2567
- const { lat: o, lng: i } = e.geometry.location;
2568
- this.setLocation(o, i, 50, true), this.dispatchMapEvent("location_changed", {
2569
- position: { lat: o, lng: i },
2570
- accuracy: 50,
2571
- source: "autocomplete",
2572
- place: {
2573
- placeId: e.place_id,
2574
- formattedAddress: e.formatted_address,
2575
- addressComponents: e.address_components,
2576
- name: e.name,
2577
- types: e.types
2578
- }
2579
- }), this.dispatchMapEvent("autocomplete_place_selected", {
2580
- place: e
2581
- });
2582
- }
2583
- })), this.autocompleteListenerAttached = true);
2584
- }
2585
- disconnectedCallback() {
2586
- super.disconnectedCallback(), this.cleanup();
2587
- }
2588
- updated(t) {
2589
- super.updated(t), this.enableAutocomplete && !this.autocompleteListenerAttached && setTimeout(() => this.setupAutocompleteListener(), 0), this.map && (t.has("center") && this.center && B(this.map, "center", this.center), t.has("zoom") && this.zoom !== void 0 && B(this.map, "zoom", this.zoom), t.has("minZoom") && this.minZoom !== void 0 && this.map && this.map.setOptions({ minZoom: this.minZoom }), t.has("maxZoom") && this.maxZoom !== void 0 && this.map && this.map.setOptions({ maxZoom: this.maxZoom }), t.has("mapTypeId") && this.mapTypeId && B(this.map, "mapTypeId", this.mapTypeId), t.has("heading") && this.heading !== void 0 && B(this.map, "heading", this.heading), t.has("tilt") && this.tilt !== void 0 && B(this.map, "tilt", this.tilt), t.has("locationMarkerPosition") && this.locationMarkerPosition && this.showLocationMarker && this.setLocation(
2590
- this.locationMarkerPosition.lat,
2591
- this.locationMarkerPosition.lng,
2592
- this.locationMarkerPosition.accuracy
2593
- ));
2594
- }
2595
- createMap() {
2596
- if (!this.mapElement) return;
2597
- const t = {
2598
- center: this.center,
2599
- zoom: this.zoom,
2600
- mapId: this.mapId,
2601
- mapTypeId: this.mapTypeId,
2602
- heading: this.heading,
2603
- tilt: this.tilt,
2604
- gestureHandling: this.gestureHandling,
2605
- minZoom: this.minZoom,
2606
- maxZoom: this.maxZoom,
2607
- disableDefaultUI: this.disableDefaultUI,
2608
- zoomControl: this.zoomControl,
2609
- mapTypeControl: this.mapTypeControl,
2610
- scaleControl: this.scaleControl,
2611
- streetViewControl: this.streetViewControl,
2612
- rotateControl: this.rotateControl,
2613
- fullscreenControl: this.fullscreenControl,
2614
- disableDoubleClickZoom: true,
2615
- keyboardShortcuts: false,
2616
- zoomControlOptions: {
2617
- position: google.maps.ControlPosition.RIGHT_BOTTOM
2618
- },
2619
- ...this.options
2620
- };
2621
- this.map = new google.maps.Map(this.mapElement, t);
2622
- const e = google.maps.event.addListener(this.map, "click", (s) => {
2623
- if (s.latLng && this.showLocationMarker) {
2624
- const a = s.latLng.lat(), r = s.latLng.lng();
2625
- this.setLocation(a, r, 50, false), this.clearAutocompleteInput(), this.dispatchMapEvent("location_changed", {
2626
- position: { lat: a, lng: r },
2627
- accuracy: 50,
2628
- source: "map-click"
2629
- });
2630
- }
2631
- }), o = [
2632
- "click",
2633
- "dblclick",
2634
- "drag",
2635
- "dragend",
2636
- "dragstart",
2637
- "idle",
2638
- "mousemove",
2639
- "mouseout",
2640
- "mouseover",
2641
- "resize",
2642
- "rightclick",
2643
- "tilesloaded"
2644
- ];
2645
- this.eventListeners = _(this.map, o, (s, a) => {
2646
- this.dispatchMapEvent(s, a);
2647
- }), this.eventListeners.push(() => {
2648
- e && google.maps.event.removeListener(e);
2649
- }), ["center", "zoom", "bounds", "mapTypeId"].forEach((s) => {
2650
- const a = `${s}_changed`, r = google.maps.event.addListener(this.map, a, () => {
2651
- const p = `get${s.charAt(0).toUpperCase()}${s.slice(1)}`;
2652
- if (typeof this.map[p] == "function") {
2653
- const m = this.map[p]();
2654
- this.dispatchMapEvent(a, m);
2655
- }
2656
- });
2657
- this.eventListeners.push(() => {
2658
- r && google.maps.event.removeListener(r);
2659
- });
2660
- }), this.dispatchEvent(
2661
- new CustomEvent("gmap-ready", {
2662
- detail: { map: this.map },
2663
- bubbles: true,
2664
- composed: true
2665
- })
2666
- ), this.locationMarkerPosition && this.showLocationMarker && this.setLocation(
2667
- this.locationMarkerPosition.lat,
2668
- this.locationMarkerPosition.lng,
2669
- this.locationMarkerPosition.accuracy
2670
- );
2671
- }
2672
- dispatchMapEvent(t, e) {
2673
- let o = t;
2674
- t.includes("_changed") ? o = `gmap-${t.replace(/_/g, "-")}` : (t.startsWith("geolocation_") || t.startsWith("location_")) && (o = `gmap-${t.replace(/_/g, "-")}`), this.dispatchEvent(
2675
- new CustomEvent(o, {
2676
- detail: e,
2677
- bubbles: true,
2678
- composed: true
2679
- })
2680
- );
2681
- }
2682
- cleanup() {
2683
- x(this.eventListeners), this.locationMarker && (this.locationMarker.map = null, this.locationMarker = void 0), this.locationCircle && (this.locationCircle.setMap(null), this.locationCircle = void 0), this.map = void 0;
2684
- }
2685
- // Public API methods
2686
- panBy(t, e) {
2687
- this.map?.panBy(t, e);
2688
- }
2689
- panTo(t) {
2690
- this.map?.panTo(t);
2691
- }
2692
- panToBounds(t) {
2693
- this.map?.panToBounds(t);
2694
- }
2695
- fitBounds(t) {
2696
- this.map?.fitBounds(t);
2697
- }
2698
- resize() {
2699
- this.map && google.maps.event.trigger(this.map, "resize");
2700
- }
2701
- resizePreserveCenter() {
2702
- if (!this.map) return;
2703
- const t = this.map.getCenter();
2704
- google.maps.event.trigger(this.map, "resize"), t && this.map.setCenter(t);
2705
- }
2706
- /**
2707
- * Programmatically set the location marker position
2708
- * @param lat Latitude
2709
- * @param lng Longitude
2710
- * @param accuracy Optional accuracy in meters (default: 50)
2711
- * @param panTo Optional, pan map to location (default: true)
2712
- */
2713
- setLocation(t, e, o = 50, i = true) {
2714
- if (!this.map) {
2715
- console.warn("GMapMap: Cannot set location before map is initialized");
2716
- return;
2717
- }
2718
- const s = { lat: t, lng: e };
2719
- i && this.map.panTo(s), this.showLocationMarker && this.addLocationMarker(s, o), this.dispatchMapEvent("location_changed", {
2720
- position: s,
2721
- accuracy: o,
2722
- source: "programmatic"
2723
- });
2724
- }
2725
- async getCurrentLocation(t = false) {
2726
- if (!navigator.geolocation) {
2727
- const i = {
2728
- code: "NOT_SUPPORTED",
2729
- message: "Geolocation is not supported by this browser"
2730
- };
2731
- throw this.dispatchMapEvent("geolocation_error", i), t || this.showGeolocationError(this.getTranslation("generalError")), new Error("NOT_SUPPORTED");
2732
- }
2733
- this.geolocationLoading = true, this.buttonState = "loading", this.dispatchMapEvent("geolocation_loading", { message: "Getting your location..." });
2734
- const o = t ? null : setTimeout(() => {
2735
- this.geolocationLoading && (this.showLoadingOverlay = true);
2736
- }, 150);
2737
- return new Promise((i, s) => {
2738
- navigator.geolocation.getCurrentPosition(
2739
- (a) => {
2740
- const r = {
2741
- lat: a.coords.latitude,
2742
- lng: a.coords.longitude
2743
- };
2744
- if (o && clearTimeout(o), this.geolocationLoading = false, this.showLoadingOverlay = false, this.buttonState = "success", setTimeout(() => {
2745
- this.buttonState = "normal";
2746
- }, 2e3), this.map) {
2747
- this.map.panTo(r);
2748
- const m = a.coords.accuracy;
2749
- let y = 15;
2750
- m > 1e3 ? y = 12 : m > 500 ? y = 13 : m > 100 ? y = 14 : y = 16, this.map.setZoom(y), this.showLocationMarker && this.addLocationMarker(r, m), this.clearAutocompleteInput();
2751
- }
2752
- const p = {
2753
- position: r,
2754
- accuracy: a.coords.accuracy,
2755
- altitude: a.coords.altitude,
2756
- altitudeAccuracy: a.coords.altitudeAccuracy,
2757
- heading: a.coords.heading,
2758
- speed: a.coords.speed,
2759
- timestamp: a.timestamp
2760
- };
2761
- this.dispatchMapEvent("geolocation_success", p), this.dispatchMapEvent("location_changed", {
2762
- position: r,
2763
- accuracy: a.coords.accuracy,
2764
- source: "geolocation"
2765
- }), i(r);
2766
- },
2767
- (a) => {
2768
- o && clearTimeout(o), this.geolocationLoading = false, this.showLoadingOverlay = false, this.buttonState = "error", setTimeout(() => {
2769
- this.buttonState = "normal";
2770
- }, 2e3);
2771
- let r = "GENERAL_ERROR", p = this.getTranslation("generalError");
2772
- a.code === a.PERMISSION_DENIED ? (r = "PERMISSION_DENIED", p = this.getTranslation("permissionDenied")) : a.code === a.POSITION_UNAVAILABLE ? (r = "POSITION_UNAVAILABLE", p = this.getTranslation("positionUnavailable")) : a.code === a.TIMEOUT && (r = "TIMEOUT", p = this.getTranslation("timeout"));
2773
- const m = {
2774
- code: r,
2775
- message: p,
2776
- error: a
2777
- };
2778
- this.dispatchMapEvent("geolocation_error", m), t || this.showGeolocationError(p), s(a);
2779
- },
2780
- this.geolocationOptions
2781
- );
2782
- });
2783
- }
2784
- handleGeolocationClick() {
2785
- this.geolocationError = null, this.getCurrentLocation();
2786
- }
2787
- async addLocationMarker(t, e) {
2788
- if (this.map) {
2789
- if (this.locationMarker && (this.locationMarker.map = null, this.locationMarker = void 0), this.locationCircle && (this.locationCircle.setMap(null), this.locationCircle = void 0), !this.mapId) {
2790
- console.warn(
2791
- "GMapMap: mapId is required for location marker. Please set the mapId property on <gmap-map>. Get a Map ID from: https://console.cloud.google.com/google/maps-apis/studio/maps"
2792
- );
2793
- return;
2794
- }
2795
- try {
2796
- const { AdvancedMarkerElement: o, PinElement: i } = await google.maps.importLibrary("marker"), s = new i({
2797
- background: this.locationMarkerBackground,
2798
- borderColor: this.locationMarkerBorderColor,
2799
- glyphColor: this.locationMarkerGlyphColor,
2800
- scale: this.locationMarkerScale
2801
- });
2802
- this.locationMarker = new o({
2803
- map: this.map,
2804
- position: t,
2805
- title: "Your Location (Drag to adjust)",
2806
- content: s.element,
2807
- gmpDraggable: true
2808
- }), this.locationMarker.addListener("dragend", () => {
2809
- if (this.locationMarker && this.locationCircle) {
2810
- const a = this.locationMarker.position, r = a.toJSON ? a.toJSON() : { lat: a.lat(), lng: a.lng() };
2811
- this.locationCircle.setCenter(r);
2812
- const p = this.locationCircle.getRadius();
2813
- this.clearAutocompleteInput(), this.dispatchMapEvent("location_marker_dragend", {
2814
- position: r,
2815
- accuracy: p
2816
- }), this.dispatchMapEvent("location_changed", {
2817
- position: r,
2818
- accuracy: p,
2819
- source: "marker-drag"
2820
- });
2821
- }
2822
- });
2823
- } catch (o) {
2824
- console.error("Error creating AdvancedMarkerElement:", o);
2825
- }
2826
- this.locationCircle = new google.maps.Circle({
2827
- map: this.map,
2828
- center: t,
2829
- radius: e,
2830
- fillColor: "#4285F4",
2831
- fillOpacity: 0.15,
2832
- strokeColor: "#4285F4",
2833
- strokeOpacity: 0.4,
2834
- strokeWeight: 1,
2835
- clickable: false,
2836
- ...this.locationCircleOptions
2837
- // Allow customization
2838
- });
2839
- }
2840
- }
2841
- showGeolocationError(t) {
2842
- this.geolocationError = t, setTimeout(() => {
2843
- this.geolocationError = null;
2844
- }, 7e3);
2845
- }
2846
- getTranslation(t) {
2847
- const o = {
2848
- loading: this.geolocationLoadingTitle,
2849
- loadingInstructions: this.geolocationLoadingInstructions,
2850
- errorTitle: this.geolocationErrorTitle,
2851
- closeButton: this.geolocationErrorButtonText,
2852
- timerMessage: this.geolocationErrorTimerMessage,
2853
- clickToSelectLocation: this.geolocationClickToSelectMessage,
2854
- generalError: this.geolocationGeneralErrorMessage,
2855
- permissionDenied: this.geolocationPermissionDeniedMessage,
2856
- positionUnavailable: this.geolocationPositionUnavailableMessage,
2857
- timeout: this.geolocationTimeoutMessage
2858
- }[t];
2859
- if (o != null && o !== "")
2860
- return o;
2861
- const i = tt(this.language);
2862
- return i[t] || i.generalError;
2863
- }
2864
- get buttonLabel() {
2865
- return this.geolocationButtonLabel !== void 0 ? this.geolocationButtonLabel : tt(this.language).buttonLabel || "";
2866
- }
2867
- getButtonIconColor() {
2868
- switch (this.buttonState) {
2869
- case "loading":
2870
- return "#999";
2871
- // Gray while loading
2872
- case "success":
2873
- return "#4285F4";
2874
- // Blue on success
2875
- case "error":
2876
- return "#EA4335";
2877
- default:
2878
- return "#666";
2879
- }
2880
- }
2881
- getMap() {
2882
- return this.map;
2883
- }
2884
- render() {
2885
- const t = et(this.language) ? "rtl" : "ltr";
2886
- return b$2`
2887
- <div class="map-page-wrapper">
2888
- ${this.enableAutocomplete ? b$2`
2889
- <div class="auto-complete-map-wrapper">
2890
- <div class="auto-complete-map-box" dir="${t}">
2891
- <salla-address-autocomplete
2892
- .proxyUrl=${this.autocompleteProxyUrl}
2893
- .authToken=${this.autocompleteAuthToken || null}
2894
- .placeholder=${this.autocompletePlaceholder || ""}
2895
- .label=${this.autocompleteLabel || null}
2896
- .language=${this.language}
2897
- .country=${this.autocompleteCountry || null}
2898
- .locationBias=${this.autocompleteLocationBias || null}
2899
- .locationRestriction=${this.autocompleteLocationRestriction || null}
2900
- .types=${this.autocompleteTypes ? this.autocompleteTypes.split(",").map((e) => e.trim()) : null}
2901
- .fieldsStr=${this.autocompleteFields || null}
2902
- .strictBounds=${this.autocompleteStrictBounds}
2903
- .resolve=${this.autocompleteResolve}
2904
- .debounceDelay=${this.autocompleteDebounceDelay}
2905
- .minChars=${this.autocompleteMinChars}
2906
- ></salla-address-autocomplete>
2907
- ${this.autocompleteHint ? b$2`<span class="hint-wrapper">${this.autocompleteHint}</span>` : ""}
2908
- </div>
2909
- </div>
2910
- ` : ""}
2911
-
2912
- <div class="map-container">
2913
- <div class="map"></div>
2914
- <slot></slot>
2915
-
2916
- ${this.enableGeolocation ? b$2`
2917
- <div class="controls-overlay">
2918
- <button
2919
- class="geolocation-button ${this.buttonLabel && this.buttonLabel.trim() ? "has-label" : ""}"
2920
- @click=${this.handleGeolocationClick}
2921
- title="Show your location"
2922
- ?disabled=${this.geolocationLoading}
2923
- >
2924
- <svg width="18" height="18" viewBox="0 0 24 24" fill="${this.getButtonIconColor()}">
2925
- <path
2926
- d="M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3A8.994 8.994 0 0 0 13 3.06V1h-2v2.06A8.994 8.994 0 0 0 3.06 11H1v2h2.06A8.994 8.994 0 0 0 11 20.94V23h2v-2.06A8.994 8.994 0 0 0 20.94 13H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"
2927
- />
2928
- </svg>
2929
- ${this.buttonLabel && this.buttonLabel.trim() ? b$2`<span class="label">${this.buttonLabel}</span>` : ""}
2930
- </button>
2931
- </div>
2932
- ` : ""}
2933
-
2934
- ${this.showLoadingOverlay && !this.geolocationError ? b$2`
2935
- <div class="loading-overlay">
2936
- <div class="spinner"></div>
2937
- <div class="title">
2938
- ${this.getTranslation("loading")}
2939
- </div>
2940
- <div class="instructions">
2941
- ${this.getTranslation("loadingInstructions")}
2942
- </div>
2943
- </div>
2944
- ` : ""}
2945
-
2946
- ${this.geolocationError && !this.showLoadingOverlay ? b$2`
2947
- <div class="error-overlay">
2948
- <div class="error-icon">
2949
- <svg width="40" height="40" viewBox="0 0 24 24" fill="none">
2950
- <circle cx="12" cy="12" r="10" stroke="#ef4444" stroke-width="2" fill="none"/>
2951
- <path d="M12 8v4M12 16h.01" stroke="#ef4444" stroke-width="2" stroke-linecap="round"/>
2952
- </svg>
2953
- </div>
2954
- <div class="error-title">
2955
- ${this.getTranslation("errorTitle")}
2956
- </div>
2957
- <div class="error-message">${this.geolocationError}</div>
2958
- <div class="map-hint">
2959
- ${this.getTranslation("clickToSelectLocation")}
2960
- </div>
2961
- <div class="timer-message">
2962
- ${this.getTranslation("timerMessage")}
2963
- </div>
2964
- <button @click=${() => this.geolocationError = null}>
2965
- ${this.getTranslation("closeButton")}
2966
- </button>
2967
- </div>
2968
- ` : ""}
2969
- </div>
2970
- </div>
2971
- `;
2972
- }
2973
- };
2974
- l.styles = i$3`
2975
- :host {
2976
- display: block;
2977
- position: relative;
2978
- width: 100%;
2979
- height: 400px;
2980
- }
2981
-
2982
- @media (max-width: 640px) {
2983
- :host {
2984
- height: 65vh;
2985
- min-height: 300px;
2986
- }
2987
- }
2988
-
2989
- @media (max-width: 640px) and (min-height: 700px) {
2990
- :host {
2991
- height: 65vh;
2992
- }
2993
- }
2994
-
2995
- .map-container {
2996
- width: 100%;
2997
- height: 100%;
2998
- position: relative;
2999
- }
3000
-
3001
- .map {
3002
- width: 100%;
3003
- height: 100%;
3004
- }
3005
-
3006
- .controls-overlay {
3007
- position: absolute;
3008
- top: 0;
3009
- left: 0;
3010
- right: 0;
3011
- bottom: 0;
3012
- pointer-events: none;
3013
- z-index: 40;
3014
- }
3015
-
3016
- .controls-overlay > * {
3017
- pointer-events: auto;
3018
- }
3019
-
3020
- .geolocation-button {
3021
- position: absolute;
3022
- bottom: 23px;
3023
- left: 10px;
3024
- right: auto;
3025
- background: #fff;
3026
- border: none;
3027
- border-radius: 2px;
3028
- box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;
3029
- cursor: pointer;
3030
- padding: 10px;
3031
- height: 40px;
3032
- display: flex;
3033
- align-items: center;
3034
- justify-content: center;
3035
- gap: 8px;
3036
- outline: none;
3037
- color: rgb(86, 86, 86);
3038
- font-family: var(--gmap-font-family, Roboto, Arial, sans-serif);
3039
- font-size: 14px;
3040
- white-space: nowrap;
3041
- }
3042
-
3043
- @media (max-width: 640px) {
3044
- .geolocation-button {
3045
- bottom: 23px;
3046
- left: 10px;
3047
- right: auto;
3048
- }
3049
-
3050
- .geolocation-button .label {
3051
- display: none;
3052
- }
3053
-
3054
- .geolocation-button {
3055
- width: 40px !important;
3056
- padding: 10px !important;
3057
- }
3058
- }
3059
-
3060
- .geolocation-button.has-label {
3061
- width: auto;
3062
- padding: 8px 12px;
3063
- }
3064
-
3065
- .geolocation-button:not(.has-label) {
3066
- width: 40px;
3067
- }
3068
-
3069
- .geolocation-button:hover:not(:disabled) {
3070
- background: #ebebeb;
3071
- }
3072
-
3073
- .geolocation-button:disabled {
3074
- cursor: wait;
3075
- opacity: 0.6;
3076
- }
3077
-
3078
- .geolocation-button svg {
3079
- flex-shrink: 0;
3080
- }
3081
-
3082
- .geolocation-button .label {
3083
- font-weight: 500;
3084
- }
3085
-
3086
- .loading-overlay {
3087
- position: absolute;
3088
- top: 0;
3089
- left: 0;
3090
- right: 0;
3091
- bottom: 0;
3092
- background: rgba(0, 0, 0, 0.7);
3093
- z-index: 200;
3094
- display: flex;
3095
- flex-direction: column;
3096
- align-items: center;
3097
- justify-content: center;
3098
- gap: 16px;
3099
- padding: 16px;
3100
- font-family: var(--gmap-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
3101
- }
3102
-
3103
- .loading-overlay .spinner {
3104
- width: 48px;
3105
- height: 48px;
3106
- border: 4px solid rgba(255, 255, 255, 0.3);
3107
- border-top-color: #ffffff;
3108
- border-radius: 50%;
3109
- animation: spin 1s linear infinite;
3110
- }
3111
-
3112
- @keyframes spin {
3113
- to { transform: rotate(360deg); }
3114
- }
3115
-
3116
- .loading-overlay .title {
3117
- font-size: 18px;
3118
- font-weight: 600;
3119
- color: #ffffff;
3120
- margin: 0;
3121
- text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
3122
- }
3123
-
3124
- .loading-overlay .instructions {
3125
- font-size: 14px;
3126
- color: #ffffff;
3127
- line-height: 1.5;
3128
- margin: 0;
3129
- text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
3130
- text-align: center;
3131
- max-width: 90%;
3132
- }
3133
-
3134
- .error-overlay {
3135
- position: absolute;
3136
- top: 0;
3137
- left: 0;
3138
- right: 0;
3139
- bottom: 0;
3140
- background: rgba(0, 0, 0, 0.7);
3141
- z-index: 200;
3142
- display: flex;
3143
- flex-direction: column;
3144
- align-items: center;
3145
- justify-content: center;
3146
- gap: 12px;
3147
- padding: 16px;
3148
- font-family: var(--gmap-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
3149
- }
3150
-
3151
- .error-overlay .error-icon svg {
3152
- display: block;
3153
- }
3154
-
3155
- .error-overlay .error-title {
3156
- font-size: 17px;
3157
- font-weight: 600;
3158
- color: #ef4444;
3159
- margin: 0;
3160
- text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
3161
- }
3162
-
3163
- .error-overlay .error-message {
3164
- font-size: 14px;
3165
- color: #ffffff;
3166
- line-height: 1.4;
3167
- margin: 0;
3168
- text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
3169
- text-align: center;
3170
- max-width: 90%;
3171
- }
3172
-
3173
- .error-overlay .map-hint {
3174
- font-size: 12px;
3175
- color: #d4d4d4;
3176
- line-height: 1.4;
3177
- margin: 0;
3178
- text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
3179
- text-align: center;
3180
- font-style: italic;
3181
- }
3182
-
3183
- .error-overlay .timer-message {
3184
- font-size: 12px;
3185
- color: #d4d4d4;
3186
- margin: 0;
3187
- text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
3188
- }
3189
-
3190
- .error-overlay button {
3191
- margin-top: 4px;
3192
- padding: 8px 24px;
3193
- background: #ffffff;
3194
- color: #18181b;
3195
- border: none;
3196
- border-radius: 8px;
3197
- font-size: 14px;
3198
- font-weight: 600;
3199
- cursor: pointer;
3200
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
3201
- }
3202
-
3203
- .error-overlay button:hover {
3204
- background: #f4f4f5;
3205
- }
3206
-
3207
- .map-page-wrapper {
3208
- position: relative;
3209
- width: 100%;
3210
- height: 100%;
3211
- }
3212
-
3213
- .auto-complete-map-wrapper {
3214
- position: absolute;
3215
- z-index: 50;
3216
- padding: 1rem;
3217
- width: 100%;
3218
- top: 0;
3219
- left: 0;
3220
- right: 0;
3221
- pointer-events: none;
3222
- box-sizing: border-box;
3223
- }
3224
-
3225
- @media (max-width: 640px) {
3226
- .auto-complete-map-wrapper {
3227
- padding: 0.75rem 0.5rem;
3228
- }
3229
- }
3230
-
3231
- .auto-complete-map-wrapper > * {
3232
- pointer-events: auto;
3233
- }
3234
-
3235
- .auto-complete-map-box {
3236
- width: 100%;
3237
- display: flex;
3238
- flex-direction: column;
3239
- padding: 1rem;
3240
- background-color: #ffffffb2;
3241
- border-radius: 8px;
3242
- backdrop-filter: blur(4px);
3243
- box-sizing: border-box;
3244
- }
3245
-
3246
- @media (max-width: 640px) {
3247
- .auto-complete-map-box {
3248
- padding: 0.75rem;
3249
- }
3250
- }
3251
-
3252
- .auto-complete-map-box .hint-wrapper {
3253
- font-size: 12px;
3254
- color: #666666;
3255
- margin-top: 0.5rem;
3256
- text-align: start;
3257
- direction: inherit;
3258
- }
3259
- `;
3260
- c([
3261
- n({ type: Object })
3262
- ], l.prototype, "center", 2);
3263
- c([
3264
- n({ type: Number })
3265
- ], l.prototype, "zoom", 2);
3266
- c([
3267
- n({ type: String, attribute: "map-id" })
3268
- ], l.prototype, "mapId", 2);
3269
- c([
3270
- n({ type: String, attribute: "map-type-id" })
3271
- ], l.prototype, "mapTypeId", 2);
3272
- c([
3273
- n({ type: Number })
3274
- ], l.prototype, "heading", 2);
3275
- c([
3276
- n({ type: Number })
3277
- ], l.prototype, "tilt", 2);
3278
- c([
3279
- n({ type: Object })
3280
- ], l.prototype, "bounds", 2);
3281
- c([
3282
- n({ type: String })
3283
- ], l.prototype, "gestureHandling", 2);
3284
- c([
3285
- n({ type: Number })
3286
- ], l.prototype, "minZoom", 2);
3287
- c([
3288
- n({ type: Number })
3289
- ], l.prototype, "maxZoom", 2);
3290
- c([
3291
- n({ type: Boolean })
3292
- ], l.prototype, "disableDefaultUI", 2);
3293
- c([
3294
- n({ type: Boolean })
3295
- ], l.prototype, "zoomControl", 2);
3296
- c([
3297
- n({ type: Boolean })
3298
- ], l.prototype, "mapTypeControl", 2);
3299
- c([
3300
- n({ type: Boolean })
3301
- ], l.prototype, "scaleControl", 2);
3302
- c([
3303
- n({ type: Boolean })
3304
- ], l.prototype, "streetViewControl", 2);
3305
- c([
3306
- n({ type: Boolean })
3307
- ], l.prototype, "rotateControl", 2);
3308
- c([
3309
- n({ type: Boolean })
3310
- ], l.prototype, "fullscreenControl", 2);
3311
- c([
3312
- n({ type: Boolean, attribute: "enable-geolocation" })
3313
- ], l.prototype, "enableGeolocation", 2);
3314
- c([
3315
- n({ type: Boolean, attribute: "show-location-marker" })
3316
- ], l.prototype, "showLocationMarker", 2);
3317
- c([
3318
- n({ type: Object })
3319
- ], l.prototype, "geolocationOptions", 2);
3320
- c([
3321
- n({ type: Object, attribute: "location-marker-position" })
3322
- ], l.prototype, "locationMarkerPosition", 2);
3323
- c([
3324
- n({ type: String, attribute: "location-marker-background" })
3325
- ], l.prototype, "locationMarkerBackground", 2);
3326
- c([
3327
- n({ type: String, attribute: "location-marker-border-color" })
3328
- ], l.prototype, "locationMarkerBorderColor", 2);
3329
- c([
3330
- n({ type: String, attribute: "location-marker-glyph-color" })
3331
- ], l.prototype, "locationMarkerGlyphColor", 2);
3332
- c([
3333
- n({ type: Number, attribute: "location-marker-scale" })
3334
- ], l.prototype, "locationMarkerScale", 2);
3335
- c([
3336
- n({ type: Object, attribute: "location-circle-options" })
3337
- ], l.prototype, "locationCircleOptions", 2);
3338
- c([
3339
- n({ type: String })
3340
- ], l.prototype, "language", 2);
3341
- c([
3342
- n({ type: Object })
3343
- ], l.prototype, "options", 2);
3344
- c([
3345
- n({ type: String, attribute: "geolocation-button-label" })
3346
- ], l.prototype, "geolocationButtonLabel", 2);
3347
- c([
3348
- n({ type: String, attribute: "geolocation-loading-title" })
3349
- ], l.prototype, "geolocationLoadingTitle", 2);
3350
- c([
3351
- n({ type: String, attribute: "geolocation-loading-instructions" })
3352
- ], l.prototype, "geolocationLoadingInstructions", 2);
3353
- c([
3354
- n({ type: String, attribute: "geolocation-error-title" })
3355
- ], l.prototype, "geolocationErrorTitle", 2);
3356
- c([
3357
- n({ type: String, attribute: "geolocation-error-button-text" })
3358
- ], l.prototype, "geolocationErrorButtonText", 2);
3359
- c([
3360
- n({ type: String, attribute: "geolocation-error-timer-message" })
3361
- ], l.prototype, "geolocationErrorTimerMessage", 2);
3362
- c([
3363
- n({ type: String, attribute: "geolocation-click-to-select-message" })
3364
- ], l.prototype, "geolocationClickToSelectMessage", 2);
3365
- c([
3366
- n({ type: String, attribute: "geolocation-permission-denied-message" })
3367
- ], l.prototype, "geolocationPermissionDeniedMessage", 2);
3368
- c([
3369
- n({ type: String, attribute: "geolocation-position-unavailable-message" })
3370
- ], l.prototype, "geolocationPositionUnavailableMessage", 2);
3371
- c([
3372
- n({ type: String, attribute: "geolocation-timeout-message" })
3373
- ], l.prototype, "geolocationTimeoutMessage", 2);
3374
- c([
3375
- n({ type: String, attribute: "geolocation-general-error-message" })
3376
- ], l.prototype, "geolocationGeneralErrorMessage", 2);
3377
- c([
3378
- n({ type: Boolean, attribute: "enable-autocomplete" })
3379
- ], l.prototype, "enableAutocomplete", 2);
3380
- c([
3381
- n({ type: String, attribute: "autocomplete-hint" })
3382
- ], l.prototype, "autocompleteHint", 2);
3383
- c([
3384
- n({ type: String, attribute: "autocomplete-proxy-url" })
3385
- ], l.prototype, "autocompleteProxyUrl", 2);
3386
- c([
3387
- n({ type: String, attribute: "autocomplete-auth-token" })
3388
- ], l.prototype, "autocompleteAuthToken", 2);
3389
- c([
3390
- n({ type: String, attribute: "autocomplete-placeholder" })
3391
- ], l.prototype, "autocompletePlaceholder", 2);
3392
- c([
3393
- n({ type: String, attribute: "autocomplete-label" })
3394
- ], l.prototype, "autocompleteLabel", 2);
3395
- c([
3396
- n({ type: String, attribute: "autocomplete-country" })
3397
- ], l.prototype, "autocompleteCountry", 2);
3398
- c([
3399
- n({ type: Object, attribute: "autocomplete-location-bias" })
3400
- ], l.prototype, "autocompleteLocationBias", 2);
3401
- c([
3402
- n({ type: Object, attribute: "autocomplete-location-restriction" })
3403
- ], l.prototype, "autocompleteLocationRestriction", 2);
3404
- c([
3405
- n({ type: String, attribute: "autocomplete-types" })
3406
- ], l.prototype, "autocompleteTypes", 2);
3407
- c([
3408
- n({ type: String, attribute: "autocomplete-fields" })
3409
- ], l.prototype, "autocompleteFields", 2);
3410
- c([
3411
- n({ type: Boolean, attribute: "autocomplete-strict-bounds" })
3412
- ], l.prototype, "autocompleteStrictBounds", 2);
3413
- c([
3414
- n({ type: Boolean, attribute: "autocomplete-resolve" })
3415
- ], l.prototype, "autocompleteResolve", 2);
3416
- c([
3417
- n({ type: Number, attribute: "autocomplete-debounce-delay" })
3418
- ], l.prototype, "autocompleteDebounceDelay", 2);
3419
- c([
3420
- n({ type: Number, attribute: "autocomplete-min-chars" })
3421
- ], l.prototype, "autocompleteMinChars", 2);
3422
- c([
3423
- F(".map")
3424
- ], l.prototype, "mapElement", 2);
3425
- c([
3426
- F("salla-address-autocomplete")
3427
- ], l.prototype, "autocompleteElement", 2);
3428
- c([
3429
- h()
3430
- ], l.prototype, "geolocationLoading", 2);
3431
- c([
3432
- h()
3433
- ], l.prototype, "geolocationError", 2);
3434
- c([
3435
- h()
3436
- ], l.prototype, "showLoadingOverlay", 2);
3437
- c([
3438
- h()
3439
- ], l.prototype, "buttonState", 2);
3440
- l = c([
3441
- L("gmap-map")
3442
- ], l);
3443
- var Bt = Object.defineProperty, Ut = Object.getOwnPropertyDescriptor, d = (t, e, o, i) => {
3444
- for (var s = i > 1 ? void 0 : i ? Ut(e, o) : e, a = t.length - 1, r; a >= 0; a--)
3445
- (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
3446
- return i && s && Bt(e, o, s), s;
3447
- };
3448
- let u = class extends i {
3449
- constructor() {
3450
- super(...arguments), this.title = "", this.gmpDraggable = false, this.gmpClickable = true, this.scale = 1, this.draggable = false, this.clickable = true, this.eventListeners = [];
3451
- }
3452
- async connectedCallback() {
3453
- super.connectedCallback(), await this.initMarker();
3454
- }
3455
- disconnectedCallback() {
3456
- super.disconnectedCallback(), this.cleanup();
3457
- }
3458
- async updated(t) {
3459
- super.updated(t), this.marker && (t.has("position") && this.position && (this.marker.position = this.normalizePosition(this.position)), t.has("title") && this.title && (this.marker.title = this.title), t.has("gmpDraggable") && (this.marker.gmpDraggable = this.gmpDraggable || this.draggable), t.has("gmpClickable") && (this.marker.gmpClickable = this.gmpClickable !== false && this.clickable !== false), t.has("zIndex") && this.zIndex !== void 0 && (this.marker.zIndex = this.zIndex), (t.has("content") || t.has("background") || t.has("borderColor") || t.has("glyphColor") || t.has("scale") || t.has("icon") || t.has("label")) && this.updateMarkerContent());
3460
- }
3461
- async initMarker() {
3462
- this.addEventListener("gmap-ready", ((e) => {
3463
- this.map = e.detail.map, this.createMarker();
3464
- }));
3465
- const t = this.closest("gmap-map");
3466
- t?.getMap && (this.map = t.getMap(), this.map && await this.createMarker());
3467
- }
3468
- async createMarker() {
3469
- if (!this.map) {
3470
- console.error("GMapMarker: No map found. Make sure the marker is inside a <gmap-map> element.");
3471
- return;
3472
- }
3473
- if (!this.map.get?.("mapId")) {
3474
- console.error(
3475
- 'GMapMarker: AdvancedMarkerElement requires a mapId to be set on the map. Add mapId to your map. Example: mapId="YOUR_MAP_ID". Get a Map ID from: https://console.cloud.google.com/google/maps-apis/studio/maps'
3476
- );
3477
- return;
3478
- }
3479
- this.markerLibrary = await st("marker");
3480
- const { AdvancedMarkerElement: e, PinElement: o } = this.markerLibrary, i = this.gmpDraggable || this.draggable, s = this.gmpClickable !== false && this.clickable !== false, a = {
3481
- map: this.map,
3482
- position: this.normalizePosition(this.position),
3483
- title: this.title,
3484
- gmpDraggable: i,
3485
- gmpClickable: s
3486
- };
3487
- if (this.zIndex !== void 0 && (a.zIndex = this.zIndex), this.content)
3488
- if (typeof this.content == "string") {
3489
- const p = document.createElement("div");
3490
- p.innerHTML = this.content, a.content = p;
3491
- } else
3492
- a.content = this.content;
3493
- else if (this.icon) {
3494
- const p = document.createElement("img");
3495
- p.src = this.icon, p.style.width = "32px", p.style.height = "32px", a.content = p;
3496
- } else {
3497
- const p = {
3498
- scale: this.scale || 1
3499
- };
3500
- this.background && (p.background = this.background), this.borderColor && (p.borderColor = this.borderColor), this.glyphColor && (p.glyphColor = this.glyphColor), this.label && typeof this.label == "string" && (p.glyph = this.label), this.pinElement = new o(p), this.pinElement?.element && (a.content = this.pinElement.element);
3501
- }
3502
- this.marker = new e(a);
3503
- const r = ["click", "drag", "dragstart", "dragend", "gmp-click"];
3504
- this.eventListeners = _(this.marker, r, (p, m) => {
3505
- if (p === "dragend" && this.marker && this.marker.position) {
3506
- const y = this.marker.position, H = y.toJSON ? y.toJSON() : { lat: y.lat(), lng: y.lng() };
3507
- this.dispatchEvent(
3508
- new CustomEvent("dragend", {
3509
- detail: { latLng: H },
3510
- bubbles: true,
3511
- composed: true
3512
- })
3513
- ), this.dispatchEvent(
3514
- new CustomEvent("gmap-position-changed", {
3515
- detail: H,
3516
- bubbles: true,
3517
- composed: true
3518
- })
3519
- );
3520
- } else
3521
- this.dispatchEvent(
3522
- new CustomEvent(p, {
3523
- detail: m,
3524
- bubbles: true,
3525
- composed: true
3526
- })
3527
- );
3528
- }), this.dispatchEvent(
3529
- new CustomEvent("gmap-marker-ready", {
3530
- detail: { marker: this.marker },
3531
- bubbles: true,
3532
- composed: true
3533
- })
3534
- );
3535
- }
3536
- updateMarkerContent() {
3537
- if (!this.marker || !this.markerLibrary) return;
3538
- const { PinElement: t } = this.markerLibrary;
3539
- if (this.content)
3540
- if (typeof this.content == "string") {
3541
- const e = document.createElement("div");
3542
- e.innerHTML = this.content, this.marker.content = e;
3543
- } else
3544
- this.marker.content = this.content;
3545
- else if (this.icon) {
3546
- const e = document.createElement("img");
3547
- e.src = this.icon, e.style.width = "32px", e.style.height = "32px", this.marker.content = e;
3548
- } else {
3549
- const e = {
3550
- scale: this.scale || 1
3551
- };
3552
- this.background && (e.background = this.background), this.borderColor && (e.borderColor = this.borderColor), this.glyphColor && (e.glyphColor = this.glyphColor), this.label && typeof this.label == "string" && (e.glyph = this.label), this.pinElement = new t(e), this.pinElement?.element && (this.marker.content = this.pinElement.element);
3553
- }
3554
- }
3555
- normalizePosition(t) {
3556
- return t ? {
3557
- lat: typeof t.lat == "number" ? t.lat : parseFloat(t.lat),
3558
- lng: typeof t.lng == "number" ? t.lng : parseFloat(t.lng)
3559
- } : { lat: 0, lng: 0 };
3560
- }
3561
- cleanup() {
3562
- x(this.eventListeners), this.marker && (this.marker.map = null, this.marker = void 0);
3563
- }
3564
- getMarker() {
3565
- return this.marker;
3566
- }
3567
- render() {
3568
- return b$2`<slot></slot>`;
3569
- }
3570
- };
3571
- d([
3572
- n({ type: Object })
3573
- ], u.prototype, "position", 2);
3574
- d([
3575
- n({ type: String })
3576
- ], u.prototype, "title", 2);
3577
- d([
3578
- n({ type: Boolean })
3579
- ], u.prototype, "gmpDraggable", 2);
3580
- d([
3581
- n({ type: Boolean })
3582
- ], u.prototype, "gmpClickable", 2);
3583
- d([
3584
- n({ type: Number })
3585
- ], u.prototype, "zIndex", 2);
3586
- d([
3587
- n({ type: Object })
3588
- ], u.prototype, "content", 2);
3589
- d([
3590
- n({ type: String })
3591
- ], u.prototype, "background", 2);
3592
- d([
3593
- n({ type: String })
3594
- ], u.prototype, "borderColor", 2);
3595
- d([
3596
- n({ type: String })
3597
- ], u.prototype, "glyphColor", 2);
3598
- d([
3599
- n({ type: Number })
3600
- ], u.prototype, "scale", 2);
3601
- d([
3602
- n({ type: Boolean })
3603
- ], u.prototype, "draggable", 2);
3604
- d([
3605
- n({ type: Boolean })
3606
- ], u.prototype, "clickable", 2);
3607
- d([
3608
- n({ type: String })
3609
- ], u.prototype, "icon", 2);
3610
- d([
3611
- n({ type: String })
3612
- ], u.prototype, "label", 2);
3613
- d([
3614
- h()
3615
- ], u.prototype, "marker", 2);
3616
- d([
3617
- h()
3618
- ], u.prototype, "map", 2);
3619
- u = d([
3620
- L("gmap-marker")
3621
- ], u);
3622
- var Dt = Object.defineProperty, jt = Object.getOwnPropertyDescriptor, P = (t, e, o, i) => {
3623
- for (var s = i > 1 ? void 0 : i ? jt(e, o) : e, a = t.length - 1, r; a >= 0; a--)
3624
- (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
3625
- return i && s && Dt(e, o, s), s;
3626
- };
3627
- let f = class extends i {
3628
- constructor() {
3629
- super(...arguments), this.opened = true, this.options = {}, this.eventListeners = [];
3630
- }
3631
- async connectedCallback() {
3632
- super.connectedCallback(), await this.initInfoWindow();
3633
- }
3634
- disconnectedCallback() {
3635
- super.disconnectedCallback(), this.cleanup();
3636
- }
3637
- updated(t) {
3638
- super.updated(t), this.infoWindow && (t.has("opened") && (this.opened ? this.open() : this.close()), t.has("position") && this.position && !this.marker && this.infoWindow.setPosition(this.position), t.has("zIndex") && this.zIndex !== void 0 && this.infoWindow.setZIndex(this.zIndex));
3639
- }
3640
- async initInfoWindow() {
3641
- const t = this.closest("gmap-marker");
3642
- if (t)
3643
- this.addEventListener("gmap-marker-ready", ((e) => {
3644
- this.marker = e.detail.marker, this.createInfoWindow();
3645
- })), t.getMarker && (this.marker = t.getMarker(), this.marker && await this.createInfoWindow());
3646
- else {
3647
- const e = this.closest("gmap-map");
3648
- e && (this.addEventListener("gmap-ready", ((o) => {
3649
- this.map = o.detail.map, this.createInfoWindow();
3650
- })), e.getMap && (this.map = e.getMap(), this.map && await this.createInfoWindow()));
3651
- }
3652
- }
3653
- async createInfoWindow() {
3654
- const t = document.createElement("div");
3655
- t.style.cssText = "min-width: 200px;";
3656
- const e = {
3657
- content: t,
3658
- ...this.options
3659
- };
3660
- this.zIndex !== void 0 && (e.zIndex = this.zIndex), this.position && !this.marker && (e.position = this.position), this.infoWindow = new google.maps.InfoWindow(e), this.observeSlotContent(t);
3661
- const o = ["closeclick", "domready", "content_changed"];
3662
- this.eventListeners = _(this.infoWindow, o, (i) => {
3663
- i === "closeclick" && (this.opened = false), this.dispatchEvent(
3664
- new CustomEvent(i, {
3665
- bubbles: true,
3666
- composed: true
3667
- })
3668
- );
3669
- }), this.opened && this.open();
3670
- }
3671
- observeSlotContent(t) {
3672
- this.renderSlotContent(t);
3673
- const e = this.shadowRoot?.querySelector("slot");
3674
- e && e.addEventListener("slotchange", () => {
3675
- this.renderSlotContent(t);
3676
- }), this.contentObserver = new MutationObserver(() => {
3677
- this.renderSlotContent(t);
3678
- }), this.contentObserver.observe(this, {
3679
- childList: true,
3680
- subtree: true,
3681
- characterData: true
3682
- });
3683
- }
3684
- renderSlotContent(t) {
3685
- const e = this.shadowRoot?.querySelector("slot");
3686
- if (e) {
3687
- const o = e.assignedNodes({ flatten: true });
3688
- t.innerHTML = "", o.forEach((i) => {
3689
- (i.nodeType === Node.ELEMENT_NODE || i.nodeType === Node.TEXT_NODE && i.textContent?.trim()) && t.appendChild(i.cloneNode(true));
3690
- });
3691
- }
3692
- }
3693
- open() {
3694
- this.infoWindow && (this.marker ? this.infoWindow.open({
3695
- anchor: this.marker,
3696
- map: this.map
3697
- }) : this.map && this.infoWindow.open(this.map));
3698
- }
3699
- close() {
3700
- this.infoWindow?.close();
3701
- }
3702
- cleanup() {
3703
- x(this.eventListeners), this.contentObserver && (this.contentObserver.disconnect(), this.contentObserver = void 0), this.infoWindow && (this.infoWindow.close(), this.infoWindow = void 0);
3704
- }
3705
- getInfoWindow() {
3706
- return this.infoWindow;
3707
- }
3708
- render() {
3709
- return b$2`<slot></slot>`;
3710
- }
3711
- };
3712
- f.styles = i$3`
3713
- :host {
3714
- display: contents;
3715
- }
3716
- `;
3717
- P([
3718
- n({ type: Boolean })
3719
- ], f.prototype, "opened", 2);
3720
- P([
3721
- n({ type: Object })
3722
- ], f.prototype, "position", 2);
3723
- P([
3724
- n({ type: Number })
3725
- ], f.prototype, "zIndex", 2);
3726
- P([
3727
- n({ type: Object })
3728
- ], f.prototype, "options", 2);
3729
- P([
3730
- h()
3731
- ], f.prototype, "infoWindow", 2);
3732
- P([
3733
- h()
3734
- ], f.prototype, "map", 2);
3735
- P([
3736
- h()
3737
- ], f.prototype, "marker", 2);
3738
- f = P([
3739
- L("gmap-info-window")
3740
- ], f);
3741
- var Rt = Object.defineProperty, Gt = Object.getOwnPropertyDescriptor, z = (t, e, o, i) => {
3742
- for (var s = i > 1 ? void 0 : i ? Gt(e, o) : e, a = t.length - 1, r; a >= 0; a--)
3743
- (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
3744
- return i && s && Rt(e, o, s), s;
3745
- };
3746
- let M = class extends i {
3747
- constructor() {
3748
- super(...arguments), this.path = [], this.editable = false, this.draggable = false, this.options = {}, this.eventListeners = [];
3749
- }
3750
- async connectedCallback() {
3751
- super.connectedCallback(), await this.initPolyline();
3752
- }
3753
- disconnectedCallback() {
3754
- super.disconnectedCallback(), this.cleanup();
3755
- }
3756
- updated(t) {
3757
- super.updated(t), this.polyline && (t.has("path") && this.path && this.polyline.setPath(this.path), t.has("editable") && this.polyline.setEditable(this.editable), t.has("draggable") && this.polyline.setDraggable(this.draggable), t.has("options") && this.polyline.setOptions(this.options));
3758
- }
3759
- async initPolyline() {
3760
- const t = this.closest("gmap-map");
3761
- t && (this.addEventListener("gmap-ready", ((e) => {
3762
- this.map = e.detail.map, this.createPolyline();
3763
- })), t.getMap && (this.map = t.getMap(), this.map && await this.createPolyline()));
3764
- }
3765
- async createPolyline() {
3766
- if (!this.map) return;
3767
- const t = {
3768
- map: this.map,
3769
- path: this.path,
3770
- editable: this.editable,
3771
- draggable: this.draggable,
3772
- ...this.options
3773
- };
3774
- this.polyline = new google.maps.Polyline(t);
3775
- const e = [
3776
- "click",
3777
- "dblclick",
3778
- "drag",
3779
- "dragend",
3780
- "dragstart",
3781
- "mousedown",
3782
- "mousemove",
3783
- "mouseout",
3784
- "mouseover",
3785
- "mouseup",
3786
- "rightclick"
3787
- ];
3788
- this.eventListeners = _(this.polyline, e, (a, r) => {
3789
- this.dispatchEvent(
3790
- new CustomEvent(a, {
3791
- detail: r,
3792
- bubbles: true,
3793
- composed: true
3794
- })
3795
- );
3796
- });
3797
- const o = google.maps.event.addListener(this.polyline.getPath(), "set_at", () => {
3798
- this.emitPathChanged();
3799
- }), i = google.maps.event.addListener(this.polyline.getPath(), "insert_at", () => {
3800
- this.emitPathChanged();
3801
- }), s = google.maps.event.addListener(this.polyline.getPath(), "remove_at", () => {
3802
- this.emitPathChanged();
3803
- });
3804
- this.eventListeners.push(
3805
- () => google.maps.event.removeListener(o),
3806
- () => google.maps.event.removeListener(i),
3807
- () => google.maps.event.removeListener(s)
3808
- );
3809
- }
3810
- emitPathChanged() {
3811
- if (!this.polyline) return;
3812
- const t = this.polyline.getPath().getArray().map((e) => ({
3813
- lat: e.lat(),
3814
- lng: e.lng()
3815
- }));
3816
- this.dispatchEvent(
3817
- new CustomEvent("gmap-path-changed", {
3818
- detail: t,
3819
- bubbles: true,
3820
- composed: true
3821
- })
3822
- );
3823
- }
3824
- cleanup() {
3825
- x(this.eventListeners), this.polyline && (this.polyline.setMap(null), this.polyline = void 0);
3826
- }
3827
- getPolyline() {
3828
- return this.polyline;
3829
- }
3830
- render() {
3831
- return b$2``;
3832
- }
3833
- };
3834
- z([
3835
- n({ type: Array })
3836
- ], M.prototype, "path", 2);
3837
- z([
3838
- n({ type: Boolean })
3839
- ], M.prototype, "editable", 2);
3840
- z([
3841
- n({ type: Boolean })
3842
- ], M.prototype, "draggable", 2);
3843
- z([
3844
- n({ type: Object })
3845
- ], M.prototype, "options", 2);
3846
- z([
3847
- h()
3848
- ], M.prototype, "polyline", 2);
3849
- z([
3850
- h()
3851
- ], M.prototype, "map", 2);
3852
- M = z([
3853
- L("gmap-polyline")
3854
- ], M);
3855
- var Wt = Object.defineProperty, Zt = Object.getOwnPropertyDescriptor, O = (t, e, o, i) => {
3856
- for (var s = i > 1 ? void 0 : i ? Zt(e, o) : e, a = t.length - 1, r; a >= 0; a--)
3857
- (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
3858
- return i && s && Wt(e, o, s), s;
3859
- };
3860
- let w = class extends i {
3861
- constructor() {
3862
- super(...arguments), this.editable = false, this.draggable = false, this.options = {}, this.eventListeners = [];
3863
- }
3864
- async connectedCallback() {
3865
- super.connectedCallback(), await this.initPolygon();
3866
- }
3867
- disconnectedCallback() {
3868
- super.disconnectedCallback(), this.cleanup();
3869
- }
3870
- updated(t) {
3871
- super.updated(t), this.polygon && (t.has("path") && this.path && this.polygon.setPath(this.path), t.has("paths") && this.paths && this.polygon.setPaths(this.paths), t.has("editable") && this.polygon.setEditable(this.editable), t.has("draggable") && this.polygon.setDraggable(this.draggable), t.has("options") && this.polygon.setOptions(this.options));
3872
- }
3873
- async initPolygon() {
3874
- const t = this.closest("gmap-map");
3875
- t && (this.addEventListener("gmap-ready", ((e) => {
3876
- this.map = e.detail.map, this.createPolygon();
3877
- })), t.getMap && (this.map = t.getMap(), this.map && await this.createPolygon()));
3878
- }
3879
- async createPolygon() {
3880
- if (!this.map) return;
3881
- const t = {
3882
- map: this.map,
3883
- editable: this.editable,
3884
- draggable: this.draggable,
3885
- ...this.options
3886
- };
3887
- this.paths ? t.paths = this.paths : this.path && (t.paths = this.path), this.polygon = new google.maps.Polygon(t);
3888
- const e = [
3889
- "click",
3890
- "dblclick",
3891
- "drag",
3892
- "dragend",
3893
- "dragstart",
3894
- "mousedown",
3895
- "mousemove",
3896
- "mouseout",
3897
- "mouseover",
3898
- "mouseup",
3899
- "rightclick"
3900
- ];
3901
- this.eventListeners = _(this.polygon, e, (o, i) => {
3902
- this.dispatchEvent(
3903
- new CustomEvent(o, {
3904
- detail: i,
3905
- bubbles: true,
3906
- composed: true
3907
- })
3908
- );
3909
- }), this.paths ? this.bindPathsChanges() : this.bindPathChanges();
3910
- }
3911
- bindPathChanges() {
3912
- if (!this.polygon) return;
3913
- const t = this.polygon.getPath(), e = google.maps.event.addListener(t, "set_at", () => {
3914
- this.emitPathChanged();
3915
- }), o = google.maps.event.addListener(t, "insert_at", () => {
3916
- this.emitPathChanged();
3917
- }), i = google.maps.event.addListener(t, "remove_at", () => {
3918
- this.emitPathChanged();
3919
- });
3920
- this.eventListeners.push(
3921
- () => google.maps.event.removeListener(e),
3922
- () => google.maps.event.removeListener(o),
3923
- () => google.maps.event.removeListener(i)
3924
- );
3925
- }
3926
- bindPathsChanges() {
3927
- if (!this.polygon) return;
3928
- this.polygon.getPaths().forEach((e, o) => {
3929
- const i = google.maps.event.addListener(e, "set_at", () => {
3930
- this.emitPathsChanged();
3931
- }), s = google.maps.event.addListener(e, "insert_at", () => {
3932
- this.emitPathsChanged();
3933
- }), a = google.maps.event.addListener(e, "remove_at", () => {
3934
- this.emitPathsChanged();
3935
- });
3936
- this.eventListeners.push(
3937
- () => google.maps.event.removeListener(i),
3938
- () => google.maps.event.removeListener(s),
3939
- () => google.maps.event.removeListener(a)
3940
- );
3941
- });
3942
- }
3943
- emitPathChanged() {
3944
- if (!this.polygon) return;
3945
- const t = this.polygon.getPath().getArray().map((e) => ({
3946
- lat: e.lat(),
3947
- lng: e.lng()
3948
- }));
3949
- this.dispatchEvent(
3950
- new CustomEvent("gmap-path-changed", {
3951
- detail: t,
3952
- bubbles: true,
3953
- composed: true
3954
- })
3955
- );
3956
- }
3957
- emitPathsChanged() {
3958
- if (!this.polygon) return;
3959
- const t = this.polygon.getPaths().getArray().map(
3960
- (e) => e.getArray().map((o) => ({
3961
- lat: o.lat(),
3962
- lng: o.lng()
3963
- }))
3964
- );
3965
- this.dispatchEvent(
3966
- new CustomEvent("gmap-paths-changed", {
3967
- detail: t,
3968
- bubbles: true,
3969
- composed: true
3970
- })
3971
- );
3972
- }
3973
- cleanup() {
3974
- x(this.eventListeners), this.polygon && (this.polygon.setMap(null), this.polygon = void 0);
3975
- }
3976
- getPolygon() {
3977
- return this.polygon;
3978
- }
3979
- render() {
3980
- return b$2``;
3981
- }
3982
- };
3983
- O([
3984
- n({ type: Array })
3985
- ], w.prototype, "path", 2);
3986
- O([
3987
- n({ type: Array })
3988
- ], w.prototype, "paths", 2);
3989
- O([
3990
- n({ type: Boolean })
3991
- ], w.prototype, "editable", 2);
3992
- O([
3993
- n({ type: Boolean })
3994
- ], w.prototype, "draggable", 2);
3995
- O([
3996
- n({ type: Object })
3997
- ], w.prototype, "options", 2);
3998
- O([
3999
- h()
4000
- ], w.prototype, "polygon", 2);
4001
- O([
4002
- h()
4003
- ], w.prototype, "map", 2);
4004
- w = O([
4005
- L("gmap-polygon")
4006
- ], w);
4007
- var Nt = Object.defineProperty, qt = Object.getOwnPropertyDescriptor, $ = (t, e, o, i) => {
4008
- for (var s = i > 1 ? void 0 : i ? qt(e, o) : e, a = t.length - 1, r; a >= 0; a--)
4009
- (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
4010
- return i && s && Nt(e, o, s), s;
4011
- };
4012
- let k = class extends i {
4013
- constructor() {
4014
- super(...arguments), this.radius = 1e3, this.editable = false, this.draggable = false, this.options = {}, this.eventListeners = [];
4015
- }
4016
- async connectedCallback() {
4017
- super.connectedCallback(), await this.initCircle();
4018
- }
4019
- disconnectedCallback() {
4020
- super.disconnectedCallback(), this.cleanup();
4021
- }
4022
- updated(t) {
4023
- super.updated(t), this.circle && (t.has("center") && this.center && this.circle.setCenter(this.center), t.has("radius") && this.radius !== void 0 && this.circle.setRadius(this.radius), t.has("editable") && this.circle.setEditable(this.editable), t.has("draggable") && this.circle.setDraggable(this.draggable), t.has("options") && this.circle.setOptions(this.options));
4024
- }
4025
- async initCircle() {
4026
- const t = this.closest("gmap-map");
4027
- t && (this.addEventListener("gmap-ready", ((e) => {
4028
- this.map = e.detail.map, this.createCircle();
4029
- })), t.getMap && (this.map = t.getMap(), this.map && await this.createCircle()));
4030
- }
4031
- async createCircle() {
4032
- if (!this.map) return;
4033
- const t = {
4034
- map: this.map,
4035
- center: this.center,
4036
- radius: this.radius,
4037
- editable: this.editable,
4038
- draggable: this.draggable,
4039
- ...this.options
4040
- };
4041
- this.circle = new google.maps.Circle(t);
4042
- const e = [
4043
- "click",
4044
- "dblclick",
4045
- "drag",
4046
- "dragend",
4047
- "dragstart",
4048
- "mousedown",
4049
- "mousemove",
4050
- "mouseout",
4051
- "mouseover",
4052
- "mouseup",
4053
- "rightclick",
4054
- "center_changed",
4055
- "radius_changed",
4056
- "bounds_changed"
4057
- ];
4058
- this.eventListeners = _(this.circle, e, (o, i) => {
4059
- if (o === "center_changed") {
4060
- const s = this.circle.getCenter(), a = s ? { lat: s.lat(), lng: s.lng() } : null;
4061
- this.dispatchEvent(
4062
- new CustomEvent(o, {
4063
- detail: a,
4064
- bubbles: true,
4065
- composed: true
4066
- })
4067
- );
4068
- } else if (o === "radius_changed") {
4069
- const s = this.circle.getRadius();
4070
- this.dispatchEvent(
4071
- new CustomEvent(o, {
4072
- detail: s,
4073
- bubbles: true,
4074
- composed: true
4075
- })
4076
- );
4077
- } else
4078
- this.dispatchEvent(
4079
- new CustomEvent(o, {
4080
- detail: i,
4081
- bubbles: true,
4082
- composed: true
4083
- })
4084
- );
4085
- });
4086
- }
4087
- cleanup() {
4088
- x(this.eventListeners), this.circle && (this.circle.setMap(null), this.circle = void 0);
4089
- }
4090
- getCircle() {
4091
- return this.circle;
4092
- }
4093
- render() {
4094
- return b$2``;
4095
- }
4096
- };
4097
- $([
4098
- n({ type: Object })
4099
- ], k.prototype, "center", 2);
4100
- $([
4101
- n({ type: Number })
4102
- ], k.prototype, "radius", 2);
4103
- $([
4104
- n({ type: Boolean })
4105
- ], k.prototype, "editable", 2);
4106
- $([
4107
- n({ type: Boolean })
4108
- ], k.prototype, "draggable", 2);
4109
- $([
4110
- n({ type: Object })
4111
- ], k.prototype, "options", 2);
4112
- $([
4113
- h()
4114
- ], k.prototype, "circle", 2);
4115
- $([
4116
- h()
4117
- ], k.prototype, "map", 2);
4118
- k = $([
4119
- L("gmap-circle")
4120
- ], k);
4121
- var Vt = Object.defineProperty, Ft = Object.getOwnPropertyDescriptor, I = (t, e, o, i) => {
4122
- for (var s = i > 1 ? void 0 : i ? Ft(e, o) : e, a = t.length - 1, r; a >= 0; a--)
4123
- (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
4124
- return i && s && Vt(e, o, s), s;
4125
- };
4126
- let S = class extends i {
4127
- constructor() {
4128
- super(...arguments), this.editable = false, this.draggable = false, this.options = {}, this.eventListeners = [];
4129
- }
4130
- async connectedCallback() {
4131
- super.connectedCallback(), await this.initRectangle();
4132
- }
4133
- disconnectedCallback() {
4134
- super.disconnectedCallback(), this.cleanup();
4135
- }
4136
- updated(t) {
4137
- super.updated(t), this.rectangle && (t.has("bounds") && this.bounds && this.rectangle.setBounds(this.bounds), t.has("editable") && this.rectangle.setEditable(this.editable), t.has("draggable") && this.rectangle.setDraggable(this.draggable), t.has("options") && this.rectangle.setOptions(this.options));
4138
- }
4139
- async initRectangle() {
4140
- const t = this.closest("gmap-map");
4141
- t && (this.addEventListener("gmap-ready", ((e) => {
4142
- this.map = e.detail.map, this.createRectangle();
4143
- })), t.getMap && (this.map = t.getMap(), this.map && await this.createRectangle()));
4144
- }
4145
- async createRectangle() {
4146
- if (!this.map) return;
4147
- const t = {
4148
- map: this.map,
4149
- bounds: this.bounds,
4150
- editable: this.editable,
4151
- draggable: this.draggable,
4152
- ...this.options
4153
- };
4154
- this.rectangle = new google.maps.Rectangle(t);
4155
- const e = [
4156
- "click",
4157
- "dblclick",
4158
- "drag",
4159
- "dragend",
4160
- "dragstart",
4161
- "mousedown",
4162
- "mousemove",
4163
- "mouseout",
4164
- "mouseover",
4165
- "mouseup",
4166
- "rightclick",
4167
- "bounds_changed"
4168
- ];
4169
- this.eventListeners = _(this.rectangle, e, (o, i) => {
4170
- if (o === "bounds_changed") {
4171
- const s = this.rectangle.getBounds();
4172
- if (s) {
4173
- const a = {
4174
- north: s.getNorthEast().lat(),
4175
- south: s.getSouthWest().lat(),
4176
- east: s.getNorthEast().lng(),
4177
- west: s.getSouthWest().lng()
4178
- };
4179
- this.dispatchEvent(
4180
- new CustomEvent(o, {
4181
- detail: a,
4182
- bubbles: true,
4183
- composed: true
4184
- })
4185
- );
4186
- }
4187
- } else
4188
- this.dispatchEvent(
4189
- new CustomEvent(o, {
4190
- detail: i,
4191
- bubbles: true,
4192
- composed: true
4193
- })
4194
- );
4195
- });
4196
- }
4197
- cleanup() {
4198
- x(this.eventListeners), this.rectangle && (this.rectangle.setMap(null), this.rectangle = void 0);
4199
- }
4200
- getRectangle() {
4201
- return this.rectangle;
4202
- }
4203
- render() {
4204
- return b$2``;
4205
- }
4206
- };
4207
- I([
4208
- n({ type: Object })
4209
- ], S.prototype, "bounds", 2);
4210
- I([
4211
- n({ type: Boolean })
4212
- ], S.prototype, "editable", 2);
4213
- I([
4214
- n({ type: Boolean })
4215
- ], S.prototype, "draggable", 2);
4216
- I([
4217
- n({ type: Object })
4218
- ], S.prototype, "options", 2);
4219
- I([
4220
- h()
4221
- ], S.prototype, "rectangle", 2);
4222
- I([
4223
- h()
4224
- ], S.prototype, "map", 2);
4225
- S = I([
4226
- L("gmap-rectangle")
4227
- ], S);
4228
- var Ht = Object.defineProperty, Kt = Object.getOwnPropertyDescriptor, T = (t, e, o, i) => {
4229
- for (var s = i > 1 ? void 0 : i ? Kt(e, o) : e, a = t.length - 1, r; a >= 0; a--)
4230
- (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
4231
- return i && s && Ht(e, o, s), s;
4232
- };
4233
- let C = class extends i {
4234
- constructor() {
4235
- super(...arguments), this.gridSize = 60, this.markers = [];
4236
- }
4237
- async connectedCallback() {
4238
- super.connectedCallback(), await this.initCluster();
4239
- }
4240
- disconnectedCallback() {
4241
- super.disconnectedCallback(), this.cleanup();
4242
- }
4243
- async initCluster() {
4244
- const t = this.closest("gmap-map");
4245
- t && (this.addEventListener("gmap-ready", ((e) => {
4246
- this.map = e.detail.map, this.createCluster();
4247
- })), t.getMap && (this.map = t.getMap(), this.map && await this.createCluster())), this.addEventListener("gmap-marker-ready", ((e) => {
4248
- const o = e.detail.marker;
4249
- this.addMarker(o);
4250
- }));
4251
- }
4252
- async createCluster() {
4253
- if (this.map)
4254
- try {
4255
- const t = await import('./index.esm-BkPzCq-C.js').catch(() => null);
4256
- if (!t) {
4257
- console.error(
4258
- "GMapCluster: @googlemaps/markerclusterer not found. Install with: npm install @googlemaps/markerclusterer"
4259
- );
4260
- return;
4261
- }
4262
- const { MarkerClusterer: e } = t, o = {
4263
- map: this.map,
4264
- markers: this.markers
4265
- };
4266
- this.gridSize && (o.gridSize = this.gridSize), this.maxZoom !== void 0 && (o.maxZoom = this.maxZoom), this.styles && (o.styles = this.styles), this.calculator && (o.calculator = this.calculator), this.markerClusterer = new e(o);
4267
- } catch (t) {
4268
- console.error("GMapCluster: Error creating cluster:", t);
4269
- }
4270
- }
4271
- addMarker(t) {
4272
- this.markers.includes(t) || (this.markers.push(t), this.markerClusterer && this.markerClusterer.addMarker(t));
4273
- }
4274
- cleanup() {
4275
- this.markerClusterer && (this.markerClusterer.clearMarkers(), this.markerClusterer = void 0), this.markers = [];
4276
- }
4277
- getClusterer() {
4278
- return this.markerClusterer;
4279
- }
4280
- render() {
4281
- return b$2`<slot></slot>`;
4282
- }
4283
- };
4284
- T([
4285
- n({ type: Number })
4286
- ], C.prototype, "gridSize", 2);
4287
- T([
4288
- n({ type: Number })
4289
- ], C.prototype, "maxZoom", 2);
4290
- T([
4291
- n({ type: Array })
4292
- ], C.prototype, "styles", 2);
4293
- T([
4294
- n({ type: Function })
4295
- ], C.prototype, "calculator", 2);
4296
- T([
4297
- h()
4298
- ], C.prototype, "map", 2);
4299
- T([
4300
- h()
4301
- ], C.prototype, "markerClusterer", 2);
4302
- T([
4303
- h()
4304
- ], C.prototype, "markers", 2);
4305
- C = T([
4306
- L("gmap-cluster")
4307
- ], C);
4308
- var Jt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, v = (t, e, o, i) => {
4309
- for (var s = i > 1 ? void 0 : i ? Yt(e, o) : e, a = t.length - 1, r; a >= 0; a--)
4310
- (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
4311
- return i && s && Jt(e, o, s), s;
4312
- };
4313
- let b = class extends i {
4314
- constructor() {
4315
- super(...arguments), this.zoom = 0, this.visible = true, this.motionTracking = true, this.options = {}, this.eventListeners = [];
4316
- }
4317
- async connectedCallback() {
4318
- super.connectedCallback();
4319
- }
4320
- async firstUpdated() {
4321
- await D, this.createPanorama();
4322
- }
4323
- disconnectedCallback() {
4324
- super.disconnectedCallback(), this.cleanup();
4325
- }
4326
- updated(t) {
4327
- super.updated(t), this.panorama && (t.has("position") && this.position && this.panorama.setPosition(this.position), t.has("pano") && this.pano && this.panorama.setPano(this.pano), t.has("zoom") && this.zoom !== void 0 && this.panorama.setZoom(this.zoom), t.has("pov") && this.pov && this.panorama.setPov(this.pov), t.has("visible") && this.panorama.setVisible(this.visible), t.has("motionTracking") && this.panorama.setMotionTracking(this.motionTracking));
4328
- }
4329
- createPanorama() {
4330
- if (!this.panoramaElement) return;
4331
- const t = {
4332
- position: this.position,
4333
- pano: this.pano,
4334
- zoom: this.zoom,
4335
- pov: this.pov,
4336
- visible: this.visible,
4337
- motionTracking: this.motionTracking,
4338
- ...this.options
4339
- };
4340
- this.panorama = new google.maps.StreetViewPanorama(this.panoramaElement, t);
4341
- const e = ["closeclick", "status_changed"];
4342
- this.eventListeners = _(this.panorama, e, (o, i) => {
4343
- this.dispatchEvent(
4344
- new CustomEvent(o, {
4345
- detail: i,
4346
- bubbles: true,
4347
- composed: true
4348
- })
4349
- );
4350
- });
4351
- }
4352
- cleanup() {
4353
- x(this.eventListeners), this.panorama = void 0;
4354
- }
4355
- resize() {
4356
- this.panorama && google.maps.event.trigger(this.panorama, "resize");
4357
- }
4358
- getPanorama() {
4359
- return this.panorama;
4360
- }
4361
- render() {
4362
- return b$2`<div class="panorama"></div>`;
4363
- }
4364
- };
4365
- b.styles = i$3`
4366
- :host {
4367
- display: block;
4368
- position: relative;
4369
- width: 100%;
4370
- height: 400px;
4371
- }
4372
-
4373
- .panorama {
4374
- width: 100%;
4375
- height: 100%;
4376
- }
4377
- `;
4378
- v([
4379
- n({ type: Object })
4380
- ], b.prototype, "position", 2);
4381
- v([
4382
- n({ type: String })
4383
- ], b.prototype, "pano", 2);
4384
- v([
4385
- n({ type: Number })
4386
- ], b.prototype, "zoom", 2);
4387
- v([
4388
- n({ type: Object })
4389
- ], b.prototype, "pov", 2);
4390
- v([
4391
- n({ type: Boolean })
4392
- ], b.prototype, "visible", 2);
4393
- v([
4394
- n({ type: Boolean })
4395
- ], b.prototype, "motionTracking", 2);
4396
- v([
4397
- n({ type: Object })
4398
- ], b.prototype, "options", 2);
4399
- v([
4400
- F(".panorama")
4401
- ], b.prototype, "panoramaElement", 2);
4402
- v([
4403
- h()
4404
- ], b.prototype, "panorama", 2);
4405
- b = v([
4406
- L("gmap-street-view-panorama")
4407
- ], b);
4408
-
4409
9
  var GetDirections = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
4410
10
  <path
4411
11
  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"
@@ -5710,11 +1310,17 @@ const SallaBulletDelivery = class {
5710
1310
  try {
5711
1311
  const mapsKey = salla.config.get('store.settings.keys.maps');
5712
1312
  if (mapsKey) {
5713
- ee({
1313
+ const bootMaps = () => import('./index-wXSgmenB.js')
1314
+ .then(({ load }) => load({
5714
1315
  key: mapsKey,
5715
1316
  libraries: ['marker', 'places'],
5716
1317
  language: salla.config.get('user.language_code') || 'ar',
5717
- }).catch(err => log('Failed to load Google Maps SDK', err));
1318
+ }))
1319
+ .catch(err => log('Failed to load Google Maps SDK', err));
1320
+ if (document.readyState === 'complete')
1321
+ bootMaps();
1322
+ else
1323
+ window.addEventListener('load', bootMaps, { once: true });
5718
1324
  }
5719
1325
  this.addressToken = await bulletDeliveryAPI.getAddressToken();
5720
1326
  }
@@ -6551,16 +2157,16 @@ const SallaBulletDelivery = class {
6551
2157
  // tab is shown only when bullet delivery supports delivery (`isSupportsDelivery`).
6552
2158
  if (!this.supportsPickup)
6553
2159
  return null;
6554
- return (h$4("div", { class: "s-bullet-delivery-tabs" }, this.isSupportsDelivery && (h$4("button", { type: "button", class: {
2160
+ return (h("div", { class: "s-bullet-delivery-tabs" }, this.isSupportsDelivery && (h("button", { type: "button", class: {
6555
2161
  "s-bullet-delivery-tab": true,
6556
2162
  "s-bullet-delivery-tab--active": this.activeTab === "address",
6557
- }, onClick: () => this.handleTabChange("address") }, h$4("span", { class: "s-bullet-delivery-tab-icon", innerHTML: Location, "aria-hidden": "true" }), h$4("span", null, Salla.lang.get("mobile_app.strings.delivery")))), h$4("button", { type: "button", class: {
2163
+ }, onClick: () => this.handleTabChange("address") }, h("span", { class: "s-bullet-delivery-tab-icon", innerHTML: Location, "aria-hidden": "true" }), h("span", null, Salla.lang.get("mobile_app.strings.delivery")))), h("button", { type: "button", class: {
6558
2164
  "s-bullet-delivery-tab": true,
6559
2165
  "s-bullet-delivery-tab--active": this.activeTab === "branch",
6560
- }, onClick: () => this.handleTabChange("branch") }, h$4("span", { class: "s-bullet-delivery-tab-icon", innerHTML: Store, "aria-hidden": "true" }), h$4("span", null, Salla.lang.get("mobile_app.strings.pickup")))));
2166
+ }, onClick: () => this.handleTabChange("branch") }, h("span", { class: "s-bullet-delivery-tab-icon", innerHTML: Store, "aria-hidden": "true" }), h("span", null, Salla.lang.get("mobile_app.strings.pickup")))));
6561
2167
  }
6562
2168
  renderAlert(message) {
6563
- return (h$4("div", { class: "s-bullet-delivery-allocation-out-of-coverage", role: "alert" }, h$4("span", { class: "s-bullet-delivery-allocation-out-of-coverage-icon", "aria-hidden": "true" }, h$4("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-hidden": "true" }, h$4("title", null, "Information"), h$4("circle", { cx: "10", cy: "10", r: "9", stroke: "currentColor", "stroke-width": "1.5", fill: "currentColor" }), h$4("text", { x: "10", y: "14", "text-anchor": "middle", fill: "white", "font-size": "12", "font-weight": "bold" }, "i"))), h$4("span", { class: "s-bullet-delivery-allocation-out-of-coverage-text", style: { textAlign: this.isRTL ? 'right' : 'left' } }, message)));
2169
+ return (h("div", { class: "s-bullet-delivery-allocation-out-of-coverage", role: "alert" }, h("span", { class: "s-bullet-delivery-allocation-out-of-coverage-icon", "aria-hidden": "true" }, h("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-hidden": "true" }, h("title", null, "Information"), h("circle", { cx: "10", cy: "10", r: "9", stroke: "currentColor", "stroke-width": "1.5", fill: "currentColor" }), h("text", { x: "10", y: "14", "text-anchor": "middle", fill: "white", "font-size": "12", "font-weight": "bold" }, "i"))), h("span", { class: "s-bullet-delivery-allocation-out-of-coverage-text", style: { textAlign: this.isRTL ? 'right' : 'left' } }, message)));
6564
2170
  }
6565
2171
  renderAllocationOutOfCoverageAlert() {
6566
2172
  const message = this.allocationOutOfCoverageMessage ||
@@ -6576,20 +2182,20 @@ const SallaBulletDelivery = class {
6576
2182
  if (this.supportsPickup) {
6577
2183
  return this.renderAlert([
6578
2184
  `${message} ${Salla.lang.getWithDefault('pages.cart.choose_another_address_pickup', 'Choose another address or')} `,
6579
- h$4("button", { type: "button", class: "underline !text-blue-600", onClick: () => this.handleTabChange('branch') }, Salla.lang.getWithDefault('pages.cart.branch_pickup', 'pick up from a branch')),
2185
+ h("button", { type: "button", class: "underline !text-blue-600", onClick: () => this.handleTabChange('branch') }, Salla.lang.getWithDefault('pages.cart.branch_pickup', 'pick up from a branch')),
6580
2186
  ]);
6581
2187
  }
6582
2188
  return this.renderAlert(`${message} ${Salla.lang.getWithDefault('pages.cart.choose_another_address', 'Choose another address')}`);
6583
2189
  }
6584
2190
  renderCountrySelect() {
6585
- return (h$4("div", { class: "s-bullet-delivery-field" }, h$4("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: true, inputId: "bullet-delivery-country", searchQuery: this.countrySearchQuery, clientSearch: true, onItemSelected: (e) => this.handleCountrySelected(e.detail), onSearchInput: (e) => this.handleCountrySearch(e.detail), onDropdownClosed: () => this.handleCountryDropdownClosed() })));
2191
+ return (h("div", { class: "s-bullet-delivery-field" }, h("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: true, inputId: "bullet-delivery-country", searchQuery: this.countrySearchQuery, clientSearch: true, onItemSelected: (e) => this.handleCountrySelected(e.detail), onSearchInput: (e) => this.handleCountrySearch(e.detail), onDropdownClosed: () => this.handleCountryDropdownClosed() })));
6586
2192
  }
6587
2193
  /** Region select (SA only): shown when SA is selected; city and district disabled until region selected. */
6588
2194
  renderRegionSelect() {
6589
2195
  const isSA = isSaudiArabia(this.selectedCountry?.code ?? '');
6590
2196
  if (!isSA || !this.selectedCountry)
6591
2197
  return null;
6592
- return (h$4("div", { class: "s-bullet-delivery-field" }, h$4("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 || this.regions.length === 0, required: true, inputId: "bullet-delivery-region", searchQuery: this.regionSearchQuery, clientSearch: true, onItemSelected: (e) => this.handleRegionSelected(e.detail), onSearchInput: (e) => this.handleRegionSearch(e.detail), onDropdownClosed: () => this.handleRegionDropdownClosed() })));
2198
+ return (h("div", { class: "s-bullet-delivery-field" }, h("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 || this.regions.length === 0, required: true, inputId: "bullet-delivery-region", searchQuery: this.regionSearchQuery, clientSearch: true, onItemSelected: (e) => this.handleRegionSelected(e.detail), onSearchInput: (e) => this.handleRegionSearch(e.detail), onDropdownClosed: () => this.handleRegionDropdownClosed() })));
6593
2199
  }
6594
2200
  renderCityDistrictSelects() {
6595
2201
  const isSA = isSaudiArabia(this.selectedCountry?.code ?? '');
@@ -6606,14 +2212,14 @@ const SallaBulletDelivery = class {
6606
2212
  (isSA && !this.selectedRegion) ||
6607
2213
  !this.selectedCity ||
6608
2214
  this.loadingDistricts;
6609
- return (h$4("div", { class: "s-bullet-delivery-field-row" }, h$4("div", { class: "s-bullet-delivery-field" }, h$4("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: cityDisabled, required: true, inputId: "bullet-delivery-city", searchQuery: this.citySearchQuery, onItemSelected: (e) => this.handleCitySelected(e.detail), onSearchInput: (e) => this.handleCitySearch(e.detail), onDropdownClosed: () => this.handleCityDropdownClosed(), dropUp: true })), showDistrict && (h$4("div", { class: "s-bullet-delivery-field" }, showDistrictInput ? (h$4("div", null, h$4("label", { class: "s-bullet-delivery-label", htmlFor: "bullet-delivery-district" }, Salla.lang.get("pages.checkout.district_field"), h$4("span", { class: "text-red-500" }, " *")), h$4("input", { id: "bullet-delivery-district", type: "text", class: "form-input", placeholder: Salla.lang.get("pages.checkout.select_district"), value: this.districtName, disabled: districtDisabled, onInput: (e) => {
2215
+ return (h("div", { class: "s-bullet-delivery-field-row" }, h("div", { class: "s-bullet-delivery-field" }, h("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: cityDisabled, required: true, inputId: "bullet-delivery-city", searchQuery: this.citySearchQuery, onItemSelected: (e) => this.handleCitySelected(e.detail), onSearchInput: (e) => this.handleCitySearch(e.detail), onDropdownClosed: () => this.handleCityDropdownClosed(), dropUp: true })), showDistrict && (h("div", { class: "s-bullet-delivery-field" }, showDistrictInput ? (h("div", null, h("label", { class: "s-bullet-delivery-label", htmlFor: "bullet-delivery-district" }, Salla.lang.get("pages.checkout.district_field"), h("span", { class: "text-red-500" }, " *")), h("input", { id: "bullet-delivery-district", type: "text", class: "form-input", placeholder: Salla.lang.get("pages.checkout.select_district"), value: this.districtName, disabled: districtDisabled, onInput: (e) => {
6610
2216
  const input = e.target;
6611
2217
  this.districtName = input.value;
6612
2218
  this.updateNewAddressForm({ district: undefined });
6613
- } }))) : (h$4("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: districtDisabled || this.districts.length === 0, required: true, inputId: "bullet-delivery-district", searchQuery: this.districtSearchQuery, clientSearch: true, onItemSelected: (e) => this.handleDistrictSelected(e.detail), onSearchInput: (e) => this.handleDistrictSearch(e.detail), onDropdownClosed: () => this.handleDistrictDropdownClosed(), dropUp: true }))))));
2219
+ } }))) : (h("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: districtDisabled || this.districts.length === 0, required: true, inputId: "bullet-delivery-district", searchQuery: this.districtSearchQuery, clientSearch: true, onItemSelected: (e) => this.handleDistrictSelected(e.detail), onSearchInput: (e) => this.handleDistrictSearch(e.detail), onDropdownClosed: () => this.handleDistrictDropdownClosed(), dropUp: true }))))));
6614
2220
  }
6615
2221
  renderSavedAddressesEmptyState() {
6616
- return (h$4("div", { class: "s-bullet-delivery-saved-addresses-empty" }, h$4("div", { class: "s-bullet-delivery-saved-addresses-empty-icon", "aria-hidden": "true" }, h$4("svg", { width: "28", height: "28", viewBox: "0 0 28 29", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h$4("title", null, "No Saved Adresses"), h$4("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" }))), h$4("p", { class: "s-bullet-delivery-saved-addresses-empty-title" }, Salla.lang.get("pages.checkout.no_saved_addresses")), h$4("p", { class: "s-bullet-delivery-saved-addresses-empty-desc" }, Salla.lang.get("pages.checkout.add_address_simplify_shipping")), h$4("salla-button", { onClick: () => this.handleAddNewAddress(), onKeyUp: () => this.handleAddNewAddress() }, Salla.lang.get("pages.checkout.add_new_address"))));
2222
+ return (h("div", { class: "s-bullet-delivery-saved-addresses-empty" }, h("div", { class: "s-bullet-delivery-saved-addresses-empty-icon", "aria-hidden": "true" }, h("svg", { width: "28", height: "28", viewBox: "0 0 28 29", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("title", null, "No Saved Adresses"), h("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" }))), h("p", { class: "s-bullet-delivery-saved-addresses-empty-title" }, Salla.lang.get("pages.checkout.no_saved_addresses")), h("p", { class: "s-bullet-delivery-saved-addresses-empty-desc" }, Salla.lang.get("pages.checkout.add_address_simplify_shipping")), h("salla-button", { onClick: () => this.handleAddNewAddress(), onKeyUp: () => this.handleAddNewAddress() }, Salla.lang.get("pages.checkout.add_new_address"))));
6617
2223
  }
6618
2224
  /**
6619
2225
  * Save session address (guest intent) to user profile. Returns the newly saved address or null.
@@ -6681,7 +2287,7 @@ const SallaBulletDelivery = class {
6681
2287
  if (!this.isLoggedIn)
6682
2288
  return null;
6683
2289
  if (this.loadingSavedAddresses) {
6684
- return (h$4("div", { class: "s-bullet-delivery-addresses-list s-scrollbar" }, [1, 2, 3].map((v) => (h$4("div", { key: v, class: "s-bullet-delivery-address-item s-bullet-delivery-address-item--skeleton" }, h$4("salla-skeleton", { class: "s-bullet-delivery-skel-radio", height: "18px", width: "18px" }), h$4("salla-skeleton", { class: "s-bullet-delivery-skel-map", height: "36px", width: "36px" }), h$4("div", { class: "s-bullet-delivery-address-content" }, h$4("div", { class: "s-bullet-delivery-address-lines" }, h$4("salla-skeleton", { height: "18px", width: "72%" }), h$4("salla-skeleton", { height: "16px", width: "56%" }))))))));
2290
+ return (h("div", { class: "s-bullet-delivery-addresses-list s-scrollbar" }, [1, 2, 3].map((v) => (h("div", { key: v, class: "s-bullet-delivery-address-item s-bullet-delivery-address-item--skeleton" }, h("salla-skeleton", { class: "s-bullet-delivery-skel-radio", height: "18px", width: "18px" }), h("salla-skeleton", { class: "s-bullet-delivery-skel-map", height: "36px", width: "36px" }), h("div", { class: "s-bullet-delivery-address-content" }, h("div", { class: "s-bullet-delivery-address-lines" }, h("salla-skeleton", { height: "18px", width: "72%" }), h("salla-skeleton", { height: "16px", width: "56%" }))))))));
6685
2291
  }
6686
2292
  const intent = this.getStoredIntent();
6687
2293
  const hasSessionAddress = hasSessionAddressIntent(intent);
@@ -6699,7 +2305,7 @@ const SallaBulletDelivery = class {
6699
2305
  if (this.savedAddresses.length === 0 && !hasSessionAddress) {
6700
2306
  return this.renderSavedAddressesEmptyState();
6701
2307
  }
6702
- return (h$4("div", { class: "s-bullet-delivery-addresses-list s-scrollbar" }, hasSessionAddress &&
2308
+ return (h("div", { class: "s-bullet-delivery-addresses-list s-scrollbar" }, hasSessionAddress &&
6703
2309
  this.renderAddressRow({
6704
2310
  key: "session-address",
6705
2311
  line1: sessionLine1,
@@ -6732,7 +2338,7 @@ const SallaBulletDelivery = class {
6732
2338
  }
6733
2339
  renderAddressRow(options) {
6734
2340
  const { key, line1, line2, selected, disabled = false, onClick } = options;
6735
- return (h$4("button", { key: key, class: {
2341
+ return (h("button", { key: key, class: {
6736
2342
  "s-bullet-delivery-address-item": true,
6737
2343
  "s-bullet-delivery-address-item--selected": selected,
6738
2344
  "s-bullet-delivery-address-item--disabled": disabled,
@@ -6742,7 +2348,7 @@ const SallaBulletDelivery = class {
6742
2348
  if (!disabled)
6743
2349
  onClick();
6744
2350
  }
6745
- } }, h$4("input", { type: "radio", name: "saved_address", class: "s-bullet-delivery-radio", checked: selected, disabled: disabled }), h$4("span", { class: "s-bullet-delivery-address-map-icon", innerHTML: MiniMap, "aria-hidden": "true" }), h$4("div", { class: "s-bullet-delivery-address-content" }, h$4("div", { class: "s-bullet-delivery-address-lines" }, h$4("span", { class: "s-bullet-delivery-address-line1", style: { textAlign: this.isRTL ? 'right' : 'left' } }, line1), h$4("span", { class: "s-bullet-delivery-address-line2", style: { textAlign: this.isRTL ? 'right' : 'left' } }, line2)))));
2351
+ } }, h("input", { type: "radio", name: "saved_address", class: "s-bullet-delivery-radio", checked: selected, disabled: disabled }), h("span", { class: "s-bullet-delivery-address-map-icon", innerHTML: MiniMap, "aria-hidden": "true" }), h("div", { class: "s-bullet-delivery-address-content" }, h("div", { class: "s-bullet-delivery-address-lines" }, h("span", { class: "s-bullet-delivery-address-line1", style: { textAlign: this.isRTL ? 'right' : 'left' } }, line1), h("span", { class: "s-bullet-delivery-address-line2", style: { textAlign: this.isRTL ? 'right' : 'left' } }, line2)))));
6746
2352
  }
6747
2353
  renderMapSection() {
6748
2354
  const isSA = isSaudiArabia(this.selectedCountry?.code ?? '');
@@ -6752,12 +2358,12 @@ const SallaBulletDelivery = class {
6752
2358
  // map never opens "empty": before a selection the marker sits on the IP/Riyadh default and is
6753
2359
  // dragged/replaced once auto-geolocation or the user picks a real position.
6754
2360
  const center = hasLoc ? { lat: loc.lat, lng: loc.lng } : this.mapInitialCenter;
6755
- return (h$4("div", { class: "s-bullet-delivery-map-container" }, h$4("gmap-map", { ref: (el) => (this.gmapRef = el), center: center, zoom: 16, "min-zoom": 4, "max-zoom": 21, "map-id": "DEMO_MAP_ID", "enable-autocomplete": true, "enable-geolocation": true, "show-location-marker": true, "location-marker-position": hasLoc ? { lat: loc.lat, lng: loc.lng, accuracy: 50 } : { ...center, 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": isSA ? Salla.lang.get('pages.checkout.short_address_format_validation') : undefined, "autocomplete-country": this.selectedCountry?.code?.toLowerCase(), "autocomplete-resolve": false, "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 })));
2361
+ return (h("div", { class: "s-bullet-delivery-map-container" }, h("gmap-map", { ref: (el) => (this.gmapRef = el), center: center, zoom: 16, "min-zoom": 4, "max-zoom": 21, "map-id": "DEMO_MAP_ID", "enable-autocomplete": true, "enable-geolocation": true, "show-location-marker": true, "location-marker-position": hasLoc ? { lat: loc.lat, lng: loc.lng, accuracy: 50 } : { ...center, 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": isSA ? Salla.lang.get('pages.checkout.short_address_format_validation') : undefined, "autocomplete-country": this.selectedCountry?.code?.toLowerCase(), "autocomplete-resolve": false, "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 })));
6756
2362
  }
6757
2363
  renderAddressConfirmation() {
6758
2364
  const address = this.mapLocationData?.formattedAddress ?? '';
6759
2365
  const shortCode = this.mapLocationData?.shortAddress;
6760
- return (h$4("div", { class: "s-bullet-delivery-address-confirm" }, h$4("div", { class: "s-bullet-delivery-address-confirm-card" }, h$4("div", { class: "s-bullet-delivery-address-confirm-details" }, h$4("span", { class: "s-bullet-delivery-address-confirm-label" }, Salla.lang.get('pages.checkout.selected_address')), h$4("p", { class: "s-bullet-delivery-address-confirm-text" }, address), shortCode && (h$4("span", { class: "s-bullet-delivery-address-confirm-tag" }, shortCode, h$4("span", { class: "s-bullet-delivery-address-confirm-tag-icon", innerHTML: LocationTag })))), h$4("button", { type: "button", class: "s-bullet-delivery-address-confirm-edit", onClick: () => { this.mapStep = 'map'; } }, Salla.lang.get('common.elements.edit'))), h$4("div", { class: "s-bullet-delivery-address-confirm-description" }, h$4("label", { class: "s-bullet-delivery-address-confirm-description-label" }, Salla.lang.get('pages.checkout.address_description'), h$4("span", { class: "s-bullet-delivery-address-confirm-description-optional" }, Salla.lang.get('common.elements.optional'))), h$4("input", { type: "text", class: "s-bullet-delivery-address-confirm-description-input form-input", placeholder: Salla.lang.get('pages.checkout.address_description_placeholder'), value: this.addressDescription, onInput: (e) => { this.addressDescription = e.target.value; } }))));
2366
+ return (h("div", { class: "s-bullet-delivery-address-confirm" }, h("div", { class: "s-bullet-delivery-address-confirm-card" }, h("div", { class: "s-bullet-delivery-address-confirm-details" }, h("span", { class: "s-bullet-delivery-address-confirm-label" }, Salla.lang.get('pages.checkout.selected_address')), h("p", { class: "s-bullet-delivery-address-confirm-text" }, address), shortCode && (h("span", { class: "s-bullet-delivery-address-confirm-tag" }, shortCode, h("span", { class: "s-bullet-delivery-address-confirm-tag-icon", innerHTML: LocationTag })))), h("button", { type: "button", class: "s-bullet-delivery-address-confirm-edit", onClick: () => { this.mapStep = 'map'; } }, Salla.lang.get('common.elements.edit'))), h("div", { class: "s-bullet-delivery-address-confirm-description" }, h("label", { class: "s-bullet-delivery-address-confirm-description-label" }, Salla.lang.get('pages.checkout.address_description'), h("span", { class: "s-bullet-delivery-address-confirm-description-optional" }, Salla.lang.get('common.elements.optional'))), h("input", { type: "text", class: "s-bullet-delivery-address-confirm-description-input form-input", placeholder: Salla.lang.get('pages.checkout.address_description_placeholder'), value: this.addressDescription, onInput: (e) => { this.addressDescription = e.target.value; } }))));
6761
2367
  }
6762
2368
  renderGuestDeliveryForm() {
6763
2369
  if (this.isMapModeAvailable) {
@@ -6773,7 +2379,7 @@ const SallaBulletDelivery = class {
6773
2379
  ];
6774
2380
  }
6775
2381
  renderDeliveryTab() {
6776
- return (h$4("div", { class: {
2382
+ return (h("div", { class: {
6777
2383
  "s-bullet-delivery-content": true,
6778
2384
  "s-bullet-delivery-content--active": this.activeTab === "address",
6779
2385
  "s-hidden": this.activeTab !== "address",
@@ -6801,14 +2407,14 @@ const SallaBulletDelivery = class {
6801
2407
  }
6802
2408
  this.handleConfirm();
6803
2409
  };
6804
- return (h$4("form", { onSubmit: handleSubmit }, this.renderGuestDeliveryForm(), h$4("div", { class: "s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single", style: { padding: '24px' } }, h$4("salla-button", { type: "submit", loading: this.confirming, disabled: isConfirmStep ? this.confirming : !canAdvanceToConfirm, width: "wide" }, submitLabel), !this.isLoggedIn && (h$4("button", { type: "button", class: "s-bullet-delivery-login-prompt", onClick: () => this.handleLogin() }, Salla.lang.get('pages.checkout.login_to_use_saved_addresses'))))));
2410
+ return (h("form", { onSubmit: handleSubmit }, this.renderGuestDeliveryForm(), h("div", { class: "s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single", style: { padding: '24px' } }, h("salla-button", { type: "submit", loading: this.confirming, disabled: isConfirmStep ? this.confirming : !canAdvanceToConfirm, width: "wide" }, submitLabel), !this.isLoggedIn && (h("button", { type: "button", class: "s-bullet-delivery-login-prompt", onClick: () => this.handleLogin() }, Salla.lang.get('pages.checkout.login_to_use_saved_addresses'))))));
6805
2411
  }
6806
2412
  renderBranchSearch() {
6807
- return (h$4("div", { class: "s-bullet-delivery-branch-search" }, h$4("div", { class: "s-bullet-delivery-search-row" }, h$4("div", { class: "s-bullet-delivery-search s-bullet-delivery-branch-search-wrap" }, h$4("span", { class: "s-bullet-delivery-search-icon s-bullet-delivery-branch-search-icon", innerHTML: Search, "aria-hidden": "true" }), h$4("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: (e) => this.handleBranchSearch(e), autocomplete: "off" })), h$4("button", { type: "button", class: {
2413
+ return (h("div", { class: "s-bullet-delivery-branch-search" }, h("div", { class: "s-bullet-delivery-search-row" }, h("div", { class: "s-bullet-delivery-search s-bullet-delivery-branch-search-wrap" }, h("span", { class: "s-bullet-delivery-search-icon s-bullet-delivery-branch-search-icon", innerHTML: Search, "aria-hidden": "true" }), h("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: (e) => this.handleBranchSearch(e), autocomplete: "off" })), h("button", { type: "button", class: {
6808
2414
  "s-bullet-delivery-location-btn": true,
6809
2415
  "s-bullet-delivery-location-btn--full": true,
6810
2416
  "s-bullet-delivery-location-btn--loading": this.loadingNearestBranch,
6811
- }, onClick: () => this.handleFindNearestBranch(), disabled: this.loadingNearestBranch }, this.loadingNearestBranch ? (h$4("span", { class: "s-bullet-delivery-location-icon", "aria-hidden": "true" }, h$4("salla-skeleton", { height: "18px", width: "18px" }))) : (h$4("span", { class: "s-bullet-delivery-location-icon", innerHTML: GPS, "aria-hidden": "true" })), h$4("span", null, Salla.lang.get("pages.checkout.nearest_to_my_location")))), this.locationError && this.activeTab === "branch" && (h$4("span", { class: "s-bullet-delivery-error" }, this.locationError))));
2417
+ }, onClick: () => this.handleFindNearestBranch(), disabled: this.loadingNearestBranch }, this.loadingNearestBranch ? (h("span", { class: "s-bullet-delivery-location-icon", "aria-hidden": "true" }, h("salla-skeleton", { height: "18px", width: "18px" }))) : (h("span", { class: "s-bullet-delivery-location-icon", innerHTML: GPS, "aria-hidden": "true" })), h("span", null, Salla.lang.get("pages.checkout.nearest_to_my_location")))), this.locationError && this.activeTab === "branch" && (h("span", { class: "s-bullet-delivery-error" }, this.locationError))));
6812
2418
  }
6813
2419
  /** Renders a branch's `preparation_time_range` as a localized "from - to <unit>" label. */
6814
2420
  getPreparationTimeLabel(range) {
@@ -6829,19 +2435,19 @@ const SallaBulletDelivery = class {
6829
2435
  }
6830
2436
  renderBranchList() {
6831
2437
  if (this.loadingBranches) {
6832
- return (h$4("div", { class: "s-bullet-delivery-branches-wrap" }, h$4("div", { class: "s-bullet-delivery-branches-loading" }, [1, 2, 3, 4].map((v) => (h$4("div", { key: v, class: "s-bullet-delivery-branch-skeleton" }, h$4("salla-skeleton", { class: "s-bullet-delivery-branch-skeleton-radio", type: "circle", height: "16px", width: "16px" }), h$4("div", { class: "s-bullet-delivery-branch-skeleton-icon" }, h$4("salla-skeleton", { height: "34px", width: "34px" })), h$4("div", { class: "s-bullet-delivery-branch-skeleton-content" }, h$4("salla-skeleton", { class: "s-bullet-delivery-branch-skeleton-title", height: "12px", width: "124px" })), h$4("salla-skeleton", { class: "s-bullet-delivery-branch-skeleton-time", height: "12px", width: "88px" }), h$4("div", { class: "s-bullet-delivery-branch-skeleton-map" }, h$4("salla-skeleton", { height: "32px", width: "32px" }))))))));
2438
+ return (h("div", { class: "s-bullet-delivery-branches-wrap" }, h("div", { class: "s-bullet-delivery-branches-loading" }, [1, 2, 3, 4].map((v) => (h("div", { key: v, class: "s-bullet-delivery-branch-skeleton" }, h("salla-skeleton", { class: "s-bullet-delivery-branch-skeleton-radio", type: "circle", height: "16px", width: "16px" }), h("div", { class: "s-bullet-delivery-branch-skeleton-icon" }, h("salla-skeleton", { height: "34px", width: "34px" })), h("div", { class: "s-bullet-delivery-branch-skeleton-content" }, h("salla-skeleton", { class: "s-bullet-delivery-branch-skeleton-title", height: "12px", width: "124px" })), h("salla-skeleton", { class: "s-bullet-delivery-branch-skeleton-time", height: "12px", width: "88px" }), h("div", { class: "s-bullet-delivery-branch-skeleton-map" }, h("salla-skeleton", { height: "32px", width: "32px" }))))))));
6833
2439
  }
6834
2440
  if (this.filteredBranches.length === 0) {
6835
- return (h$4("salla-placeholder", { alignment: "center", class: "s-bullet-delivery-placeholder" }, h$4("span", { slot: "title" }, Salla.lang.get("pages.checkout.no_pickup_branches_found"))));
2441
+ return (h("salla-placeholder", { alignment: "center", class: "s-bullet-delivery-placeholder" }, h("span", { slot: "title" }, Salla.lang.get("pages.checkout.no_pickup_branches_found"))));
6836
2442
  }
6837
- return (h$4("div", { class: "s-bullet-delivery-branches-wrap" }, h$4("ul", { class: "s-bullet-delivery-branches-list s-scrollbar" }, this.filteredBranches.map(branch => {
2443
+ return (h("div", { class: "s-bullet-delivery-branches-wrap" }, h("ul", { class: "s-bullet-delivery-branches-list s-scrollbar" }, this.filteredBranches.map(branch => {
6838
2444
  const selectable = isBranchSelectable(branch);
6839
2445
  const readiness = branch?.pickup_readiness;
6840
2446
  const locationText = [branch.country?.name, branch.city?.name, branch.district?.name]
6841
2447
  .filter(Boolean)
6842
2448
  .join(', ');
6843
2449
  const preparationTimeLabel = this.getPreparationTimeLabel(branch.preparation_time_range);
6844
- return (h$4("li", { key: branch.id, class: {
2450
+ return (h("li", { key: branch.id, class: {
6845
2451
  's-bullet-delivery-branch-item': true,
6846
2452
  's-bullet-delivery-branch-item--selected': this.selectedBranch?.id === branch.id,
6847
2453
  's-bullet-delivery-branch-item--disabled': !selectable,
@@ -6851,15 +2457,15 @@ const SallaBulletDelivery = class {
6851
2457
  if (selectable)
6852
2458
  this.handleBranchSelect(branch);
6853
2459
  }
6854
- } }, h$4("input", { type: "radio", name: "branch", class: "s-bullet-delivery-radio", checked: this.selectedBranch?.id === branch.id, disabled: !selectable }), h$4("span", { class: "s-bullet-delivery-branch-icon", "aria-hidden": "true" }, h$4("span", { innerHTML: Store })), h$4("div", { class: "flex flex-col" }, h$4("div", { class: "flex items-center gap-1 mb-1" }, h$4("p", { class: "s-bullet-delivery-branch-name text-start" }, branch.name), readiness?.label && (h$4("p", { class: `branch-status-badge${readiness.color ? ` ${readiness.color}` : ''}` }, readiness.label))), locationText ? (h$4("span", { class: "s-bullet-delivery-branch-prep", style: { fontSize: '0.8rem', lineHeight: '1.1rem', textAlign: this.isRTL ? 'right' : 'left' } }, h$4("i", { class: "sicon-location" }), "\u00A0", h$4("span", { class: "first-letter-cap" }, locationText))) : null, preparationTimeLabel ? (h$4("span", { class: "s-bullet-delivery-branch-prep", style: { fontSize: '0.8rem', lineHeight: '1.1rem', textAlign: this.isRTL ? 'right' : 'left' } }, h$4("i", { class: "sicon-clock" }), "\u00A0", h$4("span", { class: "first-letter-cap" }, Salla.lang.get('pages.checkout.pickup_duration'), ": ", preparationTimeLabel))) : null, readiness?.detail_line && (h$4("span", { class: "s-bullet-delivery-branch-prep", style: { fontSize: '0.8rem', lineHeight: '1.1rem', textAlign: this.isRTL ? 'right' : 'left' } }, h$4("i", { class: "sicon-store" }), "\u00A0", readiness.detail_line))), h$4("div", { style: {
2460
+ } }, h("input", { type: "radio", name: "branch", class: "s-bullet-delivery-radio", checked: this.selectedBranch?.id === branch.id, disabled: !selectable }), h("span", { class: "s-bullet-delivery-branch-icon", "aria-hidden": "true" }, h("span", { innerHTML: Store })), h("div", { class: "flex flex-col" }, h("div", { class: "flex items-center gap-1 mb-1" }, h("p", { class: "s-bullet-delivery-branch-name text-start" }, branch.name), readiness?.label && (h("p", { class: `branch-status-badge${readiness.color ? ` ${readiness.color}` : ''}` }, readiness.label))), locationText ? (h("span", { class: "s-bullet-delivery-branch-prep", style: { fontSize: '0.8rem', lineHeight: '1.1rem', textAlign: this.isRTL ? 'right' : 'left' } }, h("i", { class: "sicon-location" }), "\u00A0", h("span", { class: "first-letter-cap" }, locationText))) : null, preparationTimeLabel ? (h("span", { class: "s-bullet-delivery-branch-prep", style: { fontSize: '0.8rem', lineHeight: '1.1rem', textAlign: this.isRTL ? 'right' : 'left' } }, h("i", { class: "sicon-clock" }), "\u00A0", h("span", { class: "first-letter-cap" }, Salla.lang.get('pages.checkout.pickup_duration'), ": ", preparationTimeLabel))) : null, readiness?.detail_line && (h("span", { class: "s-bullet-delivery-branch-prep", style: { fontSize: '0.8rem', lineHeight: '1.1rem', textAlign: this.isRTL ? 'right' : 'left' } }, h("i", { class: "sicon-store" }), "\u00A0", readiness.detail_line))), h("div", { style: {
6855
2461
  width: 'full',
6856
2462
  maxWidth: '50px',
6857
2463
  marginInlineStart: 'auto',
6858
- } }, branch.location?.lat != null && branch.location?.lng != null && (h$4("a", { href: `https://www.google.com/maps?q=${branch.location.lat},${branch.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: e => e.stopPropagation() }, h$4("span", { class: "s-bullet-delivery-branch-map-link-icon", innerHTML: GetDirections.replace(/mask0_25437_34440/g, `mask0_branch_${branch.id}`), "aria-hidden": "true" }), h$4("span", { class: "sr-only" }, Salla.lang.get('common.elements.open_in_google_maps')))))));
2464
+ } }, branch.location?.lat != null && branch.location?.lng != null && (h("a", { href: `https://www.google.com/maps?q=${branch.location.lat},${branch.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: e => e.stopPropagation() }, h("span", { class: "s-bullet-delivery-branch-map-link-icon", innerHTML: GetDirections.replace(/mask0_25437_34440/g, `mask0_branch_${branch.id}`), "aria-hidden": "true" }), h("span", { class: "sr-only" }, Salla.lang.get('common.elements.open_in_google_maps')))))));
6859
2465
  }))));
6860
2466
  }
6861
2467
  renderPickupTab() {
6862
- return (h$4("div", { class: {
2468
+ return (h("div", { class: {
6863
2469
  "s-bullet-delivery-content": true,
6864
2470
  "s-bullet-delivery-content--active": this.activeTab === "branch",
6865
2471
  "s-hidden": this.activeTab !== "branch",
@@ -6906,18 +2512,18 @@ const SallaBulletDelivery = class {
6906
2512
  }
6907
2513
  this.handleSubmitAddAddress(e);
6908
2514
  };
6909
- return (h$4("div", { class: "s-bullet-delivery-add-address" }, h$4("form", { class: "s-bullet-delivery-add-address-form", onSubmit: handleFormSubmit }, this.renderGuestDeliveryForm(), h$4("div", { class: "s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single" }, h$4("salla-button", { type: "submit", loading: this.savingAddress, disabled: !canSubmit || this.savingAddress, class: "s-bullet-delivery-add-address-submit" }, submitLabel)))));
2515
+ return (h("div", { class: "s-bullet-delivery-add-address" }, h("form", { class: "s-bullet-delivery-add-address-form", onSubmit: handleFormSubmit }, this.renderGuestDeliveryForm(), h("div", { class: "s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single" }, h("salla-button", { type: "submit", loading: this.savingAddress, disabled: !canSubmit || this.savingAddress, class: "s-bullet-delivery-add-address-submit" }, submitLabel)))));
6910
2516
  }
6911
2517
  renderFooter() {
6912
2518
  if (this.activeTab === "address" && !this.isLoggedIn && this.isMapModeAvailable) {
6913
2519
  return null;
6914
2520
  }
6915
2521
  const showAddAddressInFooter = this.activeTab === "address" && this.isLoggedIn;
6916
- return (h$4("div", { class: "s-bullet-delivery-footer" }, h$4("salla-button", { ref: (btn) => {
2522
+ return (h("div", { class: "s-bullet-delivery-footer" }, h("salla-button", { ref: (btn) => {
6917
2523
  this.confirmBtn = btn;
6918
2524
  }, disabled: this.isConfirmDisabled(), onClick: () => this.handleConfirm(), "loader-position": "center", width: "wide" }, this.activeTab === "branch"
6919
2525
  ? Salla.lang.get("pages.checkout.confirm_receipt_from_the_branch")
6920
- : Salla.lang.get("pages.checkout.confirm_address")), showAddAddressInFooter && (h$4("salla-button", { onClick: () => this.handleAddNewAddress(), width: "wide", shape: "link" }, Salla.lang.get("pages.checkout.add_new_address"))), !this.isLoggedIn && (h$4("salla-button", { shape: "link", onClick: () => this.handleLogin() }, Salla.lang.get("pages.checkout.login_to_use_saved_addresses")))));
2526
+ : Salla.lang.get("pages.checkout.confirm_address")), showAddAddressInFooter && (h("salla-button", { onClick: () => this.handleAddNewAddress(), width: "wide", shape: "link" }, Salla.lang.get("pages.checkout.add_new_address"))), !this.isLoggedIn && (h("salla-button", { shape: "link", onClick: () => this.handleLogin() }, Salla.lang.get("pages.checkout.login_to_use_saved_addresses")))));
6921
2527
  }
6922
2528
  renderMainView() {
6923
2529
  const isAddressEmptyState = this.isLoggedIn &&
@@ -6927,7 +2533,7 @@ const SallaBulletDelivery = class {
6927
2533
  const activeTabView = this.activeTab === "branch" && this.supportsPickup
6928
2534
  ? this.renderPickupTab()
6929
2535
  : this.renderDeliveryTab();
6930
- return (h$4("div", null, this.showCartWillBeClearedBanner &&
2536
+ return (h("div", null, this.showCartWillBeClearedBanner &&
6931
2537
  this.renderAlert(Salla.lang.get("blocks.scope.empty_cart_warning")), this.allocationOutOfCoverageMessage &&
6932
2538
  this.renderAllocationOutOfCoverageAlert(), activeTabView, !isAddressEmptyState && this.renderFooter()));
6933
2539
  }
@@ -7070,11 +2676,11 @@ const SallaBulletDelivery = class {
7070
2676
  render() {
7071
2677
  if (this.isMobileApp || !this.isEnabled)
7072
2678
  return null; // no-op when disabled
7073
- return (h$4(Host, { class: "s-bullet-delivery" }, h$4("salla-modal", { ref: modal => {
2679
+ return (h(Host, { class: "s-bullet-delivery" }, h("salla-modal", { ref: modal => {
7074
2680
  this.modal = modal;
7075
- }, isClosable: !this.isRequired && !this.shouldForceNonClosable(), class: "s-bullet-delivery-modal", width: "sm" }, h$4("div", { class: "s-bullet-delivery-inner" }, h$4("div", { class: "s-bullet-delivery-header" }, h$4("h2", { class: "s-bullet-delivery-title" }, this.activeTab === 'address'
2681
+ }, isClosable: !this.isRequired && !this.shouldForceNonClosable(), class: "s-bullet-delivery-modal", width: "sm" }, h("div", { class: "s-bullet-delivery-inner" }, h("div", { class: "s-bullet-delivery-header" }, h("h2", { class: "s-bullet-delivery-title" }, this.activeTab === 'address'
7076
2682
  ? Salla.lang.get('blocks.home.add_address_for_order_delivery')
7077
- : Salla.lang.get('blocks.home.choose_branch_for_order_pickup')), h$4("p", { class: "s-bullet-delivery-subtitle" }, this.activeTab === 'address'
2683
+ : Salla.lang.get('blocks.home.choose_branch_for_order_pickup')), h("p", { class: "s-bullet-delivery-subtitle" }, this.activeTab === 'address'
7078
2684
  ? Salla.lang.get('blocks.home.products_available_for_delivery_shown_while_shopping')
7079
2685
  : Salla.lang.get('blocks.home.choose_branch_for_order_pickup_description'))), this.renderTabs(), this.viewMode === 'main' && this.renderMainView(), this.viewMode === 'add-address' && this.renderAddAddressForm()))));
7080
2686
  }
@@ -7258,7 +2864,7 @@ const SallaBulletDeliveryTag = class {
7258
2864
  if (!this.isEligible) {
7259
2865
  return null;
7260
2866
  }
7261
- return (h$4(Host, { class: "s-bullet-delivery-tag-wrapper" }, h$4("span", { class: "s-bullet-delivery-tag-container", "data-testid": "bd-tag" }, h$4("span", { class: "s-bullet-delivery-tag-icon", innerHTML: FlashIcon }), h$4("span", { class: "s-bullet-delivery-tag-label" }, this.getTagLabel()))));
2867
+ return (h(Host, { class: "s-bullet-delivery-tag-wrapper" }, h("span", { class: "s-bullet-delivery-tag-container", "data-testid": "bd-tag" }, h("span", { class: "s-bullet-delivery-tag-icon", innerHTML: FlashIcon }), h("span", { class: "s-bullet-delivery-tag-label" }, this.getTagLabel()))));
7262
2868
  }
7263
2869
  };
7264
2870
  SallaBulletDeliveryTag.style = sallaBulletDeliveryTagCss;
@@ -7456,38 +3062,38 @@ const SallaSearchableDropdown = class {
7456
3062
  render() {
7457
3063
  const hasSelection = this.selectedItem != null;
7458
3064
  const listboxId = `${this.inputId}-listbox`;
7459
- return (h$4(Host, { key: 'adb5cc56df221951bb9c2cfece436ca47297e7c6', class: "s-searchable-dropdown" }, h$4("div", { key: 'c53f13b55284ea7e6288fbf47c65ea8741946dad', class: { 's-searchable-dropdown': true, 's-searchable-dropdown--open': this.isOpen } }, this.label && (h$4("label", { key: '80694c905aa7c4106047c03100bac6494bd46d65', class: "s-searchable-dropdown-label", htmlFor: this.inputId }, this.label, this.required && h$4("span", { key: '93d82dcbac374bf19fe93ea0fe283b6223392ad9', class: "s-searchable-dropdown-required" }, " *"))), h$4("div", { key: '930ae1e3c99ca272dc3ef5849a147b97c60cdaa3', class: {
3065
+ return (h(Host, { key: 'adb5cc56df221951bb9c2cfece436ca47297e7c6', class: "s-searchable-dropdown" }, h("div", { key: 'c53f13b55284ea7e6288fbf47c65ea8741946dad', class: { 's-searchable-dropdown': true, 's-searchable-dropdown--open': this.isOpen } }, this.label && (h("label", { key: '80694c905aa7c4106047c03100bac6494bd46d65', class: "s-searchable-dropdown-label", htmlFor: this.inputId }, this.label, this.required && h("span", { key: '93d82dcbac374bf19fe93ea0fe283b6223392ad9', class: "s-searchable-dropdown-required" }, " *"))), h("div", { key: '930ae1e3c99ca272dc3ef5849a147b97c60cdaa3', class: {
7460
3066
  's-searchable-dropdown-trigger': true,
7461
3067
  's-searchable-dropdown-trigger--disabled': this.disabled || this.loading,
7462
3068
  's-searchable-dropdown-trigger--open': this.isOpen,
7463
- }, role: "combobox", "aria-expanded": this.isOpen ? 'true' : 'false', "aria-haspopup": "listbox", "aria-controls": listboxId, "aria-disabled": this.disabled || this.loading ? 'true' : 'false', tabIndex: this.disabled || this.loading ? -1 : 0, onClick: this.handleTriggerClick, onKeyDown: this.handleTriggerKeyDown }, hasSelection ? (h$4("span", { class: "s-searchable-dropdown-trigger-text" }, this.getDisplayName(this.selectedItem))) : (h$4("span", { class: "s-searchable-dropdown-trigger-placeholder" }, this.placeholder)), h$4("i", { key: '37a5061c5c0b2b287f83d688fae1e87c89ba3638', class: {
3069
+ }, role: "combobox", "aria-expanded": this.isOpen ? 'true' : 'false', "aria-haspopup": "listbox", "aria-controls": listboxId, "aria-disabled": this.disabled || this.loading ? 'true' : 'false', tabIndex: this.disabled || this.loading ? -1 : 0, onClick: this.handleTriggerClick, onKeyDown: this.handleTriggerKeyDown }, hasSelection ? (h("span", { class: "s-searchable-dropdown-trigger-text" }, this.getDisplayName(this.selectedItem))) : (h("span", { class: "s-searchable-dropdown-trigger-placeholder" }, this.placeholder)), h("i", { key: '37a5061c5c0b2b287f83d688fae1e87c89ba3638', class: {
7464
3070
  'sicon-keyboard_arrow_down': true,
7465
3071
  's-searchable-dropdown-trigger-icon': true,
7466
3072
  's-searchable-dropdown-trigger-icon--open': this.isOpen,
7467
- }, "aria-hidden": "true" })), this.isOpen && (h$4("div", { key: 'a6fb5cb55a7e9d993667dbd330a01d62e32643be', class: {
3073
+ }, "aria-hidden": "true" })), this.isOpen && (h("div", { key: 'a6fb5cb55a7e9d993667dbd330a01d62e32643be', class: {
7468
3074
  's-searchable-dropdown-panel': true,
7469
3075
  's-searchable-dropdown-panel--up': this.dropUp,
7470
- }, ref: (el) => (this.panelRef = el) }, this.searchable && (h$4("div", { key: 'b31a7cb0268f56ced610e729cafc75d73a535cab', class: "s-searchable-dropdown-search-wrap" }, h$4("i", { key: '4b34fe7e5f80778dacae009a7b533f7078450a86', class: "sicon-search s-searchable-dropdown-search-icon", "aria-hidden": "true" }), h$4("input", { key: '7c0179801f4250d863b74d3907cde02ddc5defdb', ref: (el) => (this.searchInputRef = el), 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": listboxId }))), h$4("div", { key: 'f857ce0cf6738ee4c30135667f914dbfef33cb48', id: listboxId, class: "s-searchable-dropdown-list s-scrollbar", role: "listbox" }, this.renderListContent()))))));
3076
+ }, ref: (el) => (this.panelRef = el) }, this.searchable && (h("div", { key: 'b31a7cb0268f56ced610e729cafc75d73a535cab', class: "s-searchable-dropdown-search-wrap" }, h("i", { key: '4b34fe7e5f80778dacae009a7b533f7078450a86', class: "sicon-search s-searchable-dropdown-search-icon", "aria-hidden": "true" }), h("input", { key: '7c0179801f4250d863b74d3907cde02ddc5defdb', ref: (el) => (this.searchInputRef = el), 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": listboxId }))), h("div", { key: 'f857ce0cf6738ee4c30135667f914dbfef33cb48', id: listboxId, class: "s-searchable-dropdown-list s-scrollbar", role: "listbox" }, this.renderListContent()))))));
7471
3077
  }
7472
3078
  renderListContent() {
7473
3079
  if (this.searching || this.loading) {
7474
- return (h$4("div", { class: "s-searchable-dropdown-loading" }, h$4("svg", { class: "s-searchable-dropdown-spinner", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h$4("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", "stroke-width": "3", "stroke-linecap": "round", opacity: "0.25" }), h$4("path", { d: "M12 2a10 10 0 0 1 10 10", stroke: "currentColor", "stroke-width": "3", "stroke-linecap": "round" }))));
3080
+ return (h("div", { class: "s-searchable-dropdown-loading" }, h("svg", { class: "s-searchable-dropdown-spinner", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", "stroke-width": "3", "stroke-linecap": "round", opacity: "0.25" }), h("path", { d: "M12 2a10 10 0 0 1 10 10", stroke: "currentColor", "stroke-width": "3", "stroke-linecap": "round" }))));
7475
3081
  }
7476
3082
  const visibleItems = this.filteredItems;
7477
3083
  if (visibleItems.length === 0) {
7478
- return (h$4("div", { class: "s-searchable-dropdown-empty" }, this.noResultsText || salla?.lang?.get('common.elements.no_options') || 'No results found'));
3084
+ return (h("div", { class: "s-searchable-dropdown-empty" }, this.noResultsText || salla?.lang?.get('common.elements.no_options') || 'No results found'));
7479
3085
  }
7480
3086
  return visibleItems.map((item, index) => {
7481
3087
  const isSelected = this.selectedItem?.id === item.id;
7482
3088
  const isFocused = this.focusedIndex === index;
7483
- return (h$4("button", { key: item.id, type: "button", role: "option", class: {
3089
+ return (h("button", { key: item.id, type: "button", role: "option", class: {
7484
3090
  's-searchable-dropdown-item': true,
7485
3091
  's-searchable-dropdown-item--selected': isSelected,
7486
3092
  's-searchable-dropdown-item--focused': isFocused && !isSelected,
7487
- }, "aria-selected": isSelected ? 'true' : 'false', onClick: () => this.selectItem(item) }, h$4("span", { class: {
3093
+ }, "aria-selected": isSelected ? 'true' : 'false', onClick: () => this.selectItem(item) }, h("span", { class: {
7488
3094
  's-searchable-dropdown-item-name': true,
7489
3095
  's-searchable-dropdown-item-name--selected': isSelected,
7490
- } }, this.getDisplayName(item)), isSelected && (h$4("i", { class: "sicon-check s-searchable-dropdown-item-check", "aria-hidden": "true" }))));
3096
+ } }, this.getDisplayName(item)), isSelected && (h("i", { class: "sicon-check s-searchable-dropdown-item-check", "aria-hidden": "true" }))));
7491
3097
  });
7492
3098
  }
7493
3099
  get host() { return getElement(this); }