@salla.sa/twilight-components 2.14.449 → 2.14.451

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 (320) hide show
  1. package/dist/cjs/{filepond-f9KbKIYn.js → filepond-CFAfS398.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-BSdUMAjs.js → filepond-plugin-file-poster-CGV3AN8S.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-YLL5nfmo.js → filepond-plugin-file-validate-size-5lxojxa3.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-DnRb2szA.js → filepond-plugin-file-validate-type-DU3FUIcL.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-BDCQgpe-.js → filepond-plugin-image-edit-DYML2Igz.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-CDJWoL6I.js → filepond-plugin-image-exif-orientation-PyHdAMQE.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-1OlWyiTm.js → filepond-plugin-image-preview-B723diKP.js} +1 -1
  8. package/dist/cjs/{functions-BZosuGw4.js → functions-CCmv-cGP.js} +1 -1
  9. package/dist/cjs/{index-Dj3X-WjA.js → index-CL8sn0_c.js} +1 -1
  10. package/dist/cjs/{index-C7gO-zm5.js → index-lbHgh2oF.js} +6 -6
  11. package/dist/cjs/index.esm-DOwgk2YK.js +2444 -0
  12. package/dist/cjs/loader.cjs.js +2 -2
  13. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-alert_2.cjs.entry.js +21 -17
  18. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
  22. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +4611 -24
  23. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  45. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  46. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  47. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  50. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  51. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-map.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-product-card_2.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
  84. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  99. package/dist/cjs/{tracked-promise-CMALwoa6.js → tracked-promise-BEZGH5zy.js} +1 -1
  100. package/dist/cjs/twilight.cjs.js +2 -2
  101. package/dist/cjs/{vanilla-picker-BEliYBNM.js → vanilla-picker-DEoSMlkf.js} +1 -1
  102. package/dist/collection/assets/svg/location-tag.svg +10 -0
  103. package/dist/collection/components/salla-bottom-alert/salla-bottom-alert.js +20 -16
  104. package/dist/collection/components/salla-bullet-delivery/api-service.js +6 -0
  105. package/dist/collection/components/salla-bullet-delivery/helpers.js +3 -1
  106. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.css +128 -0
  107. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +195 -20
  108. package/dist/components/index.esm.js +2424 -0
  109. package/dist/components/index.js +2 -2
  110. package/dist/components/salla-bottom-alert.js +20 -16
  111. package/dist/components/salla-bullet-delivery.js +4644 -51
  112. package/dist/esm/{filepond-CDpPHT7z.js → filepond-CCUaTwJO.js} +1 -1
  113. package/dist/esm/{filepond-plugin-file-poster-BOtfCgt6.js → filepond-plugin-file-poster-C3FfmUV2.js} +1 -1
  114. package/dist/esm/{filepond-plugin-file-validate-size--uO_3T9g.js → filepond-plugin-file-validate-size-27nMbGKo.js} +1 -1
  115. package/dist/esm/{filepond-plugin-file-validate-type-DnJbL2zb.js → filepond-plugin-file-validate-type-RRO4qH5n.js} +1 -1
  116. package/dist/esm/{filepond-plugin-image-edit-CjUUwl1o.js → filepond-plugin-image-edit-wY6LYrlF.js} +1 -1
  117. package/dist/esm/{filepond-plugin-image-exif-orientation-DkjfYMVD.js → filepond-plugin-image-exif-orientation-OrAkjCVu.js} +1 -1
  118. package/dist/esm/{filepond-plugin-image-preview-3LlHu8_B.js → filepond-plugin-image-preview-COtDiNmq.js} +1 -1
  119. package/dist/esm/{functions-BQD6jHG4.js → functions-BBStjquJ.js} +1 -1
  120. package/dist/esm/{index-CFtXUFT2.js → index-BAOl7AJU.js} +6 -6
  121. package/dist/esm/{index-B5mrC7UX.js → index-BgFU58I4.js} +1 -1
  122. package/dist/esm/index.esm-BkPzCq-C.js +2424 -0
  123. package/dist/esm/loader.js +3 -3
  124. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  125. package/dist/esm/salla-accordion_6.entry.js +1 -1
  126. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  127. package/dist/esm/salla-advertisement.entry.js +1 -1
  128. package/dist/esm/salla-alert_2.entry.js +21 -17
  129. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  130. package/dist/esm/salla-apps-icons.entry.js +1 -1
  131. package/dist/esm/salla-badge.entry.js +1 -1
  132. package/dist/esm/salla-booking-field_7.entry.js +10 -10
  133. package/dist/esm/salla-bullet-delivery_2.entry.js +4646 -59
  134. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  135. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  136. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  137. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  138. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  139. package/dist/esm/salla-contacts.entry.js +1 -1
  140. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  141. package/dist/esm/salla-count-down.entry.js +1 -1
  142. package/dist/esm/salla-custom-fields.entry.js +1 -1
  143. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  144. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  145. package/dist/esm/salla-filters-widget.entry.js +1 -1
  146. package/dist/esm/salla-filters.entry.js +1 -1
  147. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  148. package/dist/esm/salla-gifting.entry.js +1 -1
  149. package/dist/esm/salla-hook.entry.js +1 -1
  150. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  151. package/dist/esm/salla-installment.entry.js +1 -1
  152. package/dist/esm/salla-list-tile.entry.js +1 -1
  153. package/dist/esm/salla-localization-modal.entry.js +1 -1
  154. package/dist/esm/salla-login-modal.entry.js +1 -1
  155. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  156. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  157. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  158. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  159. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  160. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  161. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  162. package/dist/esm/salla-loyalty.entry.js +1 -1
  163. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  164. package/dist/esm/salla-map.entry.js +1 -1
  165. package/dist/esm/salla-menu.entry.js +1 -1
  166. package/dist/esm/salla-metadata.entry.js +1 -1
  167. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  168. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  169. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  170. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  171. package/dist/esm/salla-notification-item.entry.js +1 -1
  172. package/dist/esm/salla-notifications.entry.js +1 -1
  173. package/dist/esm/salla-offer-modal.entry.js +1 -1
  174. package/dist/esm/salla-offer.entry.js +1 -1
  175. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  176. package/dist/esm/salla-order-details-options.entry.js +1 -1
  177. package/dist/esm/salla-order-details.entry.js +1 -1
  178. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  179. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  180. package/dist/esm/salla-order-edit.entry.js +1 -1
  181. package/dist/esm/salla-order-summary.entry.js +1 -1
  182. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  183. package/dist/esm/salla-orders.entry.js +1 -1
  184. package/dist/esm/salla-payments.entry.js +1 -1
  185. package/dist/esm/salla-placeholder.entry.js +1 -1
  186. package/dist/esm/salla-price-range.entry.js +1 -1
  187. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  188. package/dist/esm/salla-product-card_2.entry.js +1 -1
  189. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  190. package/dist/esm/salla-products-list.entry.js +1 -1
  191. package/dist/esm/salla-progress-bar.entry.js +1 -1
  192. package/dist/esm/salla-quick-order.entry.js +1 -1
  193. package/dist/esm/salla-rating-modal.entry.js +1 -1
  194. package/dist/esm/salla-reward-action_4.entry.js +3 -3
  195. package/dist/esm/salla-scopes.entry.js +1 -1
  196. package/dist/esm/salla-search.entry.js +1 -1
  197. package/dist/esm/salla-skeleton.entry.js +1 -1
  198. package/dist/esm/salla-slider.entry.js +1 -1
  199. package/dist/esm/salla-social-share.entry.js +1 -1
  200. package/dist/esm/salla-social.entry.js +1 -1
  201. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  202. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  203. package/dist/esm/salla-tooltip.entry.js +1 -1
  204. package/dist/esm/salla-trust-badges.entry.js +1 -1
  205. package/dist/esm/salla-user-menu.entry.js +1 -1
  206. package/dist/esm/salla-user-profile.entry.js +1 -1
  207. package/dist/esm/salla-user-settings.entry.js +1 -1
  208. package/dist/esm/salla-verify.entry.js +1 -1
  209. package/dist/esm/salla-wallet.entry.js +1 -1
  210. package/dist/esm/{tracked-promise-7zOvv3M6.js → tracked-promise-CPfI_VcX.js} +1 -1
  211. package/dist/esm/twilight.js +3 -3
  212. package/dist/esm/{vanilla-picker-yptjYbav.js → vanilla-picker-D6ctFQpu.js} +1 -1
  213. package/dist/twilight/{p-DZLwjHmr.js → p--sGcI7SX.js} +1 -1
  214. package/dist/twilight/{p-c6ed7a7f.entry.js → p-01359d46.entry.js} +1 -1
  215. package/dist/twilight/{p-a22f93c7.entry.js → p-02668306.entry.js} +1 -1
  216. package/dist/twilight/{p-a709602c.entry.js → p-02e4b3f7.entry.js} +1 -1
  217. package/dist/twilight/{p-187ddba3.entry.js → p-059a362b.entry.js} +1 -1
  218. package/dist/twilight/{p-564d8c45.entry.js → p-082ac280.entry.js} +1 -1
  219. package/dist/twilight/{p-effe5301.entry.js → p-091ef563.entry.js} +1 -1
  220. package/dist/twilight/p-0bb2ae4a.entry.js +4 -0
  221. package/dist/twilight/{p-a4de6d64.entry.js → p-0c2af75c.entry.js} +1 -1
  222. package/dist/twilight/{p-c24749d7.entry.js → p-1090cced.entry.js} +1 -1
  223. package/dist/twilight/{p-6ccdae0e.entry.js → p-14319930.entry.js} +1 -1
  224. package/dist/twilight/{p-f31595be.entry.js → p-1b028d1e.entry.js} +1 -1
  225. package/dist/twilight/{p-c987e5c4.entry.js → p-1c8f540e.entry.js} +1 -1
  226. package/dist/twilight/{p-52dada7c.entry.js → p-1f98bb26.entry.js} +1 -1
  227. package/dist/twilight/{p-210b5cd5.entry.js → p-20d5f87f.entry.js} +1 -1
  228. package/dist/twilight/{p-f92040a1.entry.js → p-224d3c26.entry.js} +1 -1
  229. package/dist/twilight/{p-8b578d2c.entry.js → p-26ef7b3c.entry.js} +1 -1
  230. package/dist/twilight/{p-7d3b048e.entry.js → p-2879b9ac.entry.js} +1 -1
  231. package/dist/twilight/{p-764f3053.entry.js → p-2b706f7e.entry.js} +1 -1
  232. package/dist/twilight/{p-26a0fdd4.entry.js → p-3400cfe4.entry.js} +1 -1
  233. package/dist/twilight/{p-fbdf7bc2.entry.js → p-34bea7ca.entry.js} +1 -1
  234. package/dist/twilight/{p-c2fa334e.entry.js → p-37ad673f.entry.js} +1 -1
  235. package/dist/twilight/{p-10f3641c.entry.js → p-3829e7fb.entry.js} +1 -1
  236. package/dist/twilight/{p-b5bf31c8.entry.js → p-436ff3dd.entry.js} +1 -1
  237. package/dist/twilight/{p-a5f6b737.entry.js → p-4b061d3d.entry.js} +1 -1
  238. package/dist/twilight/{p-536d29ce.entry.js → p-4c67cd2d.entry.js} +1 -1
  239. package/dist/twilight/{p-237ae017.entry.js → p-4f9a39de.entry.js} +1 -1
  240. package/dist/twilight/{p-5e30b0bd.entry.js → p-5165a1aa.entry.js} +1 -1
  241. package/dist/twilight/{p-54d8c2ca.entry.js → p-53c543c6.entry.js} +1 -1
  242. package/dist/twilight/{p-dad1b803.entry.js → p-56c33728.entry.js} +1 -1
  243. package/dist/twilight/{p-76bbabcb.entry.js → p-5851ae3f.entry.js} +1 -1
  244. package/dist/twilight/{p-b96744fc.entry.js → p-58d38f43.entry.js} +1 -1
  245. package/dist/twilight/{p-e89bfadd.entry.js → p-5cd566f6.entry.js} +1 -1
  246. package/dist/twilight/{p-b3123f77.entry.js → p-5ce3a659.entry.js} +1 -1
  247. package/dist/twilight/{p-a832d2f6.entry.js → p-6446fca2.entry.js} +1 -1
  248. package/dist/twilight/{p-97b47164.entry.js → p-66026d3b.entry.js} +1 -1
  249. package/dist/twilight/{p-58face3f.entry.js → p-66fc6ca0.entry.js} +1 -1
  250. package/dist/twilight/{p-cc06234d.entry.js → p-69824501.entry.js} +1 -1
  251. package/dist/twilight/{p-3c328960.entry.js → p-6bd2e89b.entry.js} +1 -1
  252. package/dist/twilight/{p-ca38de68.entry.js → p-6e60ba3f.entry.js} +1 -1
  253. package/dist/twilight/{p-b4108a9a.entry.js → p-72770a46.entry.js} +1 -1
  254. package/dist/twilight/{p-bcbb8488.entry.js → p-76dbef2b.entry.js} +1 -1
  255. package/dist/twilight/{p-d8cb14bd.entry.js → p-77020583.entry.js} +1 -1
  256. package/dist/twilight/{p-d8d6f688.entry.js → p-7a80b4d6.entry.js} +1 -1
  257. package/dist/twilight/{p-967fbc9c.entry.js → p-80ac1d80.entry.js} +1 -1
  258. package/dist/twilight/{p-2174a8e6.entry.js → p-87593f7e.entry.js} +1 -1
  259. package/dist/twilight/{p-0f7f0c9a.entry.js → p-8ab015d1.entry.js} +1 -1
  260. package/dist/twilight/{p-e1b2f1cd.entry.js → p-8bbe9a50.entry.js} +1 -1
  261. package/dist/twilight/{p-947aea47.entry.js → p-8bd255f1.entry.js} +1 -1
  262. package/dist/twilight/{p-fe8417b0.entry.js → p-8c06c63a.entry.js} +1 -1
  263. package/dist/twilight/{p-c4f9029a.entry.js → p-9b9851cc.entry.js} +1 -1
  264. package/dist/twilight/{p-b5184ea5.entry.js → p-9f09fd9c.entry.js} +1 -1
  265. package/dist/twilight/{p-99fa8ba6.entry.js → p-9f7d63e8.entry.js} +1 -1
  266. package/dist/twilight/{p-c0491160.entry.js → p-9fff0a8c.entry.js} +1 -1
  267. package/dist/twilight/{p-CFtXUFT2.js → p-BAOl7AJU.js} +1 -1
  268. package/dist/twilight/{p-4HuZkmYv.js → p-BjvOwYKG.js} +1 -1
  269. package/dist/twilight/p-BkPzCq-C.js +4 -0
  270. package/dist/twilight/{p-DRqWSUhZ.js → p-C2ha2a9w.js} +1 -1
  271. package/dist/twilight/{p-DVY4bWKx.js → p-COOk2-xF.js} +2 -2
  272. package/dist/twilight/{p-Cz2LJSD1.js → p-CiN9P6Vs.js} +1 -1
  273. package/dist/twilight/p-CjFUdilz.js +4 -0
  274. package/dist/twilight/{p-BmPGKoL7.js → p-DAZuaKqm.js} +1 -1
  275. package/dist/twilight/{p-CUBlD0Kt.js → p-DrBLhfjt.js} +1 -1
  276. package/dist/twilight/{p-59337a84.entry.js → p-a07f60cc.entry.js} +1 -1
  277. package/dist/twilight/{p-00c80ce0.entry.js → p-a16e2ac6.entry.js} +1 -1
  278. package/dist/twilight/{p-3a067383.entry.js → p-a2a8fe83.entry.js} +1 -1
  279. package/dist/twilight/{p-af8f9d9d.entry.js → p-a3868737.entry.js} +1 -1
  280. package/dist/twilight/{p-3c479c07.entry.js → p-a64f0aff.entry.js} +1 -1
  281. package/dist/twilight/p-a83d78fb.entry.js +1019 -0
  282. package/dist/twilight/{p-a19b9fcd.entry.js → p-ac57e992.entry.js} +1 -1
  283. package/dist/twilight/{p-d4db02e7.entry.js → p-ac9bf5bf.entry.js} +1 -1
  284. package/dist/twilight/{p-2bb0e5c5.entry.js → p-acf12c83.entry.js} +1 -1
  285. package/dist/twilight/{p-400ecb0a.entry.js → p-afd1364b.entry.js} +1 -1
  286. package/dist/twilight/{p-a2b9f075.entry.js → p-b0a99b96.entry.js} +1 -1
  287. package/dist/twilight/{p-31d281ab.entry.js → p-b2069f14.entry.js} +1 -1
  288. package/dist/twilight/{p-7fcbc3ef.entry.js → p-b42c7823.entry.js} +1 -1
  289. package/dist/twilight/{p-dfd0bf16.entry.js → p-b6661dd0.entry.js} +1 -1
  290. package/dist/twilight/{p-469c8350.entry.js → p-b929dda0.entry.js} +1 -1
  291. package/dist/twilight/{p-bf4257bb.entry.js → p-b9385507.entry.js} +1 -1
  292. package/dist/twilight/{p-bf76d88f.entry.js → p-bb4205bf.entry.js} +1 -1
  293. package/dist/twilight/{p-2b3e3ca7.entry.js → p-bec9d32a.entry.js} +1 -1
  294. package/dist/twilight/{p-03aed385.entry.js → p-c69e79ac.entry.js} +1 -1
  295. package/dist/twilight/{p-d69b9a02.entry.js → p-c82f5b3f.entry.js} +1 -1
  296. package/dist/twilight/{p-10adfec3.entry.js → p-caaff989.entry.js} +1 -1
  297. package/dist/twilight/{p-121ca1bf.entry.js → p-d18cb38a.entry.js} +1 -1
  298. package/dist/twilight/{p-61269cd6.entry.js → p-d1cabb89.entry.js} +1 -1
  299. package/dist/twilight/{p-c79ac487.entry.js → p-db744497.entry.js} +1 -1
  300. package/dist/twilight/{p-b04933fd.entry.js → p-e0bf3d3e.entry.js} +1 -1
  301. package/dist/twilight/{p-eabd1eef.entry.js → p-e632fbe1.entry.js} +1 -1
  302. package/dist/twilight/{p-3db06266.entry.js → p-e6f50fda.entry.js} +1 -1
  303. package/dist/twilight/{p-eb2e5d15.entry.js → p-e725ca51.entry.js} +1 -1
  304. package/dist/twilight/{p-fab8d485.entry.js → p-ea1f6f62.entry.js} +1 -1
  305. package/dist/twilight/{p-fc49d9c6.entry.js → p-eb9802ec.entry.js} +1 -1
  306. package/dist/twilight/{p-6ba1c14e.entry.js → p-eeb759a2.entry.js} +1 -1
  307. package/dist/twilight/{p-5e1b51dd.entry.js → p-f13ab7c3.entry.js} +1 -1
  308. package/dist/twilight/{p-918178f5.entry.js → p-f9a6bd74.entry.js} +1 -1
  309. package/dist/twilight/{p-B9HPqa9u.js → p-fngctMOB.js} +1 -1
  310. package/dist/twilight/{p-CxOW9p-m.js → p-nNw4abgW.js} +1 -1
  311. package/dist/twilight/{p-CsCwHOvQ.js → p-saXA_VGx.js} +2 -2
  312. package/dist/twilight/twilight.esm.js +1 -1
  313. package/dist/types/components/salla-bullet-delivery/api-service.d.ts +1 -0
  314. package/dist/types/components/salla-bullet-delivery/helpers.d.ts +3 -0
  315. package/dist/types/components/salla-bullet-delivery/interfaces.d.ts +3 -0
  316. package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +23 -1
  317. package/package.json +8 -5
  318. package/dist/twilight/p-2a3b2509.entry.js +0 -4
  319. package/dist/twilight/p-Dw1i2i3R.js +0 -4
  320. package/dist/twilight/p-b57b8cae.entry.js +0 -4
@@ -3,8 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-C7gO-zm5.js');
7
- var keyboard_arrow_right = require('./keyboard_arrow_right-BayM_Il2.js');
6
+ var index = require('./index-lbHgh2oF.js');
8
7
  var location = require('./location-DIyESLuI.js');
9
8
  var search = require('./search-c7Aa7lM9.js');
10
9
 
@@ -202,6 +201,12 @@ const bulletDeliveryAPI = {
202
201
  return { success: false, error: err?.response?.data != null ? errMsg(err.response.data) : (err?.message ?? 'Unknown error') };
203
202
  }
204
203
  },
204
+ async getAddressToken() {
205
+ return withApiErrorHandling(async () => {
206
+ const res = await salla.api.request('address/autocomplete-token');
207
+ return res?.data?.token ?? null;
208
+ }, null, 'Error fetching address autocomplete token');
209
+ },
205
210
  };
206
211
  function clearApiCache() {
207
212
  apiCache.clear();
@@ -295,7 +300,7 @@ const requireRegionAndDistrictForSA = (countryCode, regionId, districtIdOrName)
295
300
  ? true
296
301
  : (regionId != null && Number(regionId) !== 0) && (districtIdOrName != null && (typeof districtIdOrName === 'number' ? districtIdOrName !== 0 : String(districtIdOrName).trim().length > 0));
297
302
  function buildAddressLocationPayloadFromSelection(options) {
298
- const { countryId, countryCode, regionId, cityId, districtId, description = '' } = options;
303
+ const { countryId, countryCode, regionId, cityId, districtId, description = '', lat, lng, shortAddress } = options;
299
304
  const desc = description || '';
300
305
  return {
301
306
  country_id: Number(countryId) || undefined,
@@ -304,6 +309,8 @@ function buildAddressLocationPayloadFromSelection(options) {
304
309
  district_id: districtId != null ? Number(districtId) : undefined,
305
310
  description: desc,
306
311
  ...(countryCode && isSaudiArabia(countryCode) && { local: desc }),
312
+ ...(lat != null && lng != null && { lat, lng }),
313
+ ...(shortAddress && { short_address: shortAddress }),
307
314
  };
308
315
  }
309
316
  const GEO_ERROR_MESSAGES = {
@@ -313,6 +320,4406 @@ const GEO_ERROR_MESSAGES = {
313
320
  };
314
321
  const getGeolocationErrorMessage = (errorCode) => GEO_ERROR_MESSAGES[errorCode] ?? 'An error occurred while detecting location';
315
322
 
323
+ /**
324
+ * @license
325
+ * Copyright 2019 Google LLC
326
+ * SPDX-License-Identifier: BSD-3-Clause
327
+ */
328
+ 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;
329
+
330
+ /**
331
+ * @license
332
+ * Copyright 2017 Google LLC
333
+ * SPDX-License-Identifier: BSD-3-Clause
334
+ */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");
335
+
336
+ /**
337
+ * @license
338
+ * Copyright 2017 Google LLC
339
+ * SPDX-License-Identifier: BSD-3-Clause
340
+ */
341
+ 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};
342
+
343
+ /**
344
+ * @license
345
+ * Copyright 2017 Google LLC
346
+ * SPDX-License-Identifier: BSD-3-Clause
347
+ */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");
348
+
349
+ 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();
350
+ let de = class {
351
+ constructor(e, i, r) {
352
+ if (this._$cssResult$ = true, r !== j$1) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
353
+ this.cssText = e, this.t = i;
354
+ }
355
+ get styleSheet() {
356
+ let e = this.o;
357
+ const i = this.t;
358
+ if (H && e === void 0) {
359
+ const r = i !== void 0 && i.length === 1;
360
+ r && (e = Z$1.get(i)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), r && Z$1.set(i, e));
361
+ }
362
+ return e;
363
+ }
364
+ toString() {
365
+ return this.cssText;
366
+ }
367
+ };
368
+ const ge = (t) => new de(typeof t == "string" ? t : t + "", void 0, j$1), ve = (t, ...e) => {
369
+ const i = t.length === 1 ? t[0] : e.reduce((r, s, o) => r + ((a) => {
370
+ if (a._$cssResult$ === true) return a.cssText;
371
+ if (typeof a == "number") return a;
372
+ 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.");
373
+ })(s) + t[o + 1], t[0]);
374
+ return new de(i, t, j$1);
375
+ }, be = (t, e) => {
376
+ if (H) t.adoptedStyleSheets = e.map((i) => i instanceof CSSStyleSheet ? i : i.styleSheet);
377
+ else for (const i of e) {
378
+ const r = document.createElement("style"), s = O$1.litNonce;
379
+ s !== void 0 && r.setAttribute("nonce", s), r.textContent = i.cssText, t.appendChild(r);
380
+ }
381
+ }, J$1 = H ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
382
+ let i = "";
383
+ for (const r of e.cssRules) i += r.cssText;
384
+ return ge(i);
385
+ })(t) : t;
386
+ 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) {
387
+ switch (e) {
388
+ case Boolean:
389
+ t = t ? Se : null;
390
+ break;
391
+ case Object:
392
+ case Array:
393
+ t = t == null ? t : JSON.stringify(t);
394
+ }
395
+ return t;
396
+ }, fromAttribute(t, e) {
397
+ let i = t;
398
+ switch (e) {
399
+ case Boolean:
400
+ i = t !== null;
401
+ break;
402
+ case Number:
403
+ i = t === null ? null : Number(t);
404
+ break;
405
+ case Object:
406
+ case Array:
407
+ try {
408
+ i = JSON.parse(t);
409
+ } catch {
410
+ i = null;
411
+ }
412
+ }
413
+ return i;
414
+ } }, W$1 = (t, e) => !ye(t, e), Q$1 = { attribute: true, type: String, converter: V$1, reflect: false, useDefault: false, hasChanged: W$1 };
415
+ Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), M$1.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
416
+ let E = class extends HTMLElement {
417
+ static addInitializer(e) {
418
+ this._$Ei(), (this.l ??= []).push(e);
419
+ }
420
+ static get observedAttributes() {
421
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
422
+ }
423
+ static createProperty(e, i = Q$1) {
424
+ 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) {
425
+ const r = /* @__PURE__ */ Symbol(), s = this.getPropertyDescriptor(e, r, i);
426
+ s !== void 0 && $e(this.prototype, e, s);
427
+ }
428
+ }
429
+ static getPropertyDescriptor(e, i, r) {
430
+ const { get: s, set: o } = Ae(this.prototype, e) ?? { get() {
431
+ return this[i];
432
+ }, set(a) {
433
+ this[i] = a;
434
+ } };
435
+ return { get: s, set(a) {
436
+ const n = s?.call(this);
437
+ o?.call(this, a), this.requestUpdate(e, n, r);
438
+ }, configurable: true, enumerable: true };
439
+ }
440
+ static getPropertyOptions(e) {
441
+ return this.elementProperties.get(e) ?? Q$1;
442
+ }
443
+ static _$Ei() {
444
+ if (this.hasOwnProperty(T$1("elementProperties"))) return;
445
+ const e = xe(this);
446
+ e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
447
+ }
448
+ static finalize() {
449
+ if (this.hasOwnProperty(T$1("finalized"))) return;
450
+ if (this.finalized = true, this._$Ei(), this.hasOwnProperty(T$1("properties"))) {
451
+ const i = this.properties, r = [...we(i), ..._e(i)];
452
+ for (const s of r) this.createProperty(s, i[s]);
453
+ }
454
+ const e = this[Symbol.metadata];
455
+ if (e !== null) {
456
+ const i = litPropertyMetadata.get(e);
457
+ if (i !== void 0) for (const [r, s] of i) this.elementProperties.set(r, s);
458
+ }
459
+ this._$Eh = /* @__PURE__ */ new Map();
460
+ for (const [i, r] of this.elementProperties) {
461
+ const s = this._$Eu(i, r);
462
+ s !== void 0 && this._$Eh.set(s, i);
463
+ }
464
+ this.elementStyles = this.finalizeStyles(this.styles);
465
+ }
466
+ static finalizeStyles(e) {
467
+ const i = [];
468
+ if (Array.isArray(e)) {
469
+ const r = new Set(e.flat(1 / 0).reverse());
470
+ for (const s of r) i.unshift(J$1(s));
471
+ } else e !== void 0 && i.push(J$1(e));
472
+ return i;
473
+ }
474
+ static _$Eu(e, i) {
475
+ const r = i.attribute;
476
+ return r === false ? void 0 : typeof r == "string" ? r : typeof e == "string" ? e.toLowerCase() : void 0;
477
+ }
478
+ constructor() {
479
+ super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
480
+ }
481
+ _$Ev() {
482
+ this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((e) => e(this));
483
+ }
484
+ addController(e) {
485
+ (this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
486
+ }
487
+ removeController(e) {
488
+ this._$EO?.delete(e);
489
+ }
490
+ _$E_() {
491
+ const e = /* @__PURE__ */ new Map(), i = this.constructor.elementProperties;
492
+ for (const r of i.keys()) this.hasOwnProperty(r) && (e.set(r, this[r]), delete this[r]);
493
+ e.size > 0 && (this._$Ep = e);
494
+ }
495
+ createRenderRoot() {
496
+ const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
497
+ return be(e, this.constructor.elementStyles), e;
498
+ }
499
+ connectedCallback() {
500
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((e) => e.hostConnected?.());
501
+ }
502
+ enableUpdating(e) {
503
+ }
504
+ disconnectedCallback() {
505
+ this._$EO?.forEach((e) => e.hostDisconnected?.());
506
+ }
507
+ attributeChangedCallback(e, i, r) {
508
+ this._$AK(e, r);
509
+ }
510
+ _$ET(e, i) {
511
+ const r = this.constructor.elementProperties.get(e), s = this.constructor._$Eu(e, r);
512
+ if (s !== void 0 && r.reflect === true) {
513
+ const o = (r.converter?.toAttribute !== void 0 ? r.converter : V$1).toAttribute(i, r.type);
514
+ this._$Em = e, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null;
515
+ }
516
+ }
517
+ _$AK(e, i) {
518
+ const r = this.constructor, s = r._$Eh.get(e);
519
+ if (s !== void 0 && this._$Em !== s) {
520
+ const o = r.getPropertyOptions(s), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : V$1;
521
+ this._$Em = s;
522
+ const n = a.fromAttribute(i, o.type);
523
+ this[s] = n ?? this._$Ej?.get(s) ?? n, this._$Em = null;
524
+ }
525
+ }
526
+ requestUpdate(e, i, r, s = false, o) {
527
+ if (e !== void 0) {
528
+ const a = this.constructor;
529
+ 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;
530
+ this.C(e, i, r);
531
+ }
532
+ this.isUpdatePending === false && (this._$ES = this._$EP());
533
+ }
534
+ C(e, i, { useDefault: r, reflect: s, wrapped: o }, a) {
535
+ 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));
536
+ }
537
+ async _$EP() {
538
+ this.isUpdatePending = true;
539
+ try {
540
+ await this._$ES;
541
+ } catch (i) {
542
+ Promise.reject(i);
543
+ }
544
+ const e = this.scheduleUpdate();
545
+ return e != null && await e, !this.isUpdatePending;
546
+ }
547
+ scheduleUpdate() {
548
+ return this.performUpdate();
549
+ }
550
+ performUpdate() {
551
+ if (!this.isUpdatePending) return;
552
+ if (!this.hasUpdated) {
553
+ if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
554
+ for (const [s, o] of this._$Ep) this[s] = o;
555
+ this._$Ep = void 0;
556
+ }
557
+ const r = this.constructor.elementProperties;
558
+ if (r.size > 0) for (const [s, o] of r) {
559
+ const { wrapped: a } = o, n = this[s];
560
+ a !== true || this._$AL.has(s) || n === void 0 || this.C(s, void 0, o, n);
561
+ }
562
+ }
563
+ let e = false;
564
+ const i = this._$AL;
565
+ try {
566
+ e = this.shouldUpdate(i), e ? (this.willUpdate(i), this._$EO?.forEach((r) => r.hostUpdate?.()), this.update(i)) : this._$EM();
567
+ } catch (r) {
568
+ throw e = false, this._$EM(), r;
569
+ }
570
+ e && this._$AE(i);
571
+ }
572
+ willUpdate(e) {
573
+ }
574
+ _$AE(e) {
575
+ this._$EO?.forEach((i) => i.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(e)), this.updated(e);
576
+ }
577
+ _$EM() {
578
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
579
+ }
580
+ get updateComplete() {
581
+ return this.getUpdateComplete();
582
+ }
583
+ getUpdateComplete() {
584
+ return this._$ES;
585
+ }
586
+ shouldUpdate(e) {
587
+ return true;
588
+ }
589
+ update(e) {
590
+ this._$Eq &&= this._$Eq.forEach((i) => this._$ET(i, this[i])), this._$EM();
591
+ }
592
+ updated(e) {
593
+ }
594
+ firstUpdated(e) {
595
+ }
596
+ };
597
+ 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");
598
+ 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 = `[
599
+ \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}*(?:[^
600
+ \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);
601
+ function ue(t, e) {
602
+ if (!Y$1(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
603
+ return te !== void 0 ? te.createHTML(e) : e;
604
+ }
605
+ const Ce = (t, e) => {
606
+ const i = t.length - 1, r = [];
607
+ let s, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", a = P$1;
608
+ for (let n = 0; n < i; n++) {
609
+ const l = t[n];
610
+ let m, c, u = -1, y = 0;
611
+ 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);
612
+ const $ = a === w$1 && t[n + 1].startsWith("/>") ? " " : "";
613
+ 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 : $);
614
+ }
615
+ return [ue(t, o + (t[i] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), r];
616
+ };
617
+ class N {
618
+ constructor({ strings: e, _$litType$: i }, r) {
619
+ let s;
620
+ this.parts = [];
621
+ let o = 0, a = 0;
622
+ const n = e.length - 1, l = this.parts, [m, c] = Ce(e, i);
623
+ if (this.el = N.createElement(m, r), x$1.currentNode = this.el.content, i === 2 || i === 3) {
624
+ const u = this.el.content.firstChild;
625
+ u.replaceWith(...u.childNodes);
626
+ }
627
+ for (; (s = x$1.nextNode()) !== null && l.length < n; ) {
628
+ if (s.nodeType === 1) {
629
+ if (s.hasAttributes()) for (const u of s.getAttributeNames()) if (u.endsWith(he)) {
630
+ const y = c[a++], $ = s.getAttribute(u).split(A$1), F = /([.?@])?(.*)/.exec(y);
631
+ 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);
632
+ } else u.startsWith(A$1) && (l.push({ type: 6, index: o }), s.removeAttribute(u));
633
+ if (pe.test(s.tagName)) {
634
+ const u = s.textContent.split(A$1), y = u.length - 1;
635
+ if (y > 0) {
636
+ s.textContent = D$1 ? D$1.emptyScript : "";
637
+ for (let $ = 0; $ < y; $++) s.append(u[$], R$1()), x$1.nextNode(), l.push({ type: 2, index: ++o });
638
+ s.append(u[y], R$1());
639
+ }
640
+ }
641
+ } else if (s.nodeType === 8) if (s.data === ce) l.push({ type: 2, index: o });
642
+ else {
643
+ let u = -1;
644
+ for (; (u = s.data.indexOf(A$1, u + 1)) !== -1; ) l.push({ type: 7, index: o }), u += A$1.length - 1;
645
+ }
646
+ o++;
647
+ }
648
+ }
649
+ static createElement(e, i) {
650
+ const r = S$1.createElement("template");
651
+ return r.innerHTML = e, r;
652
+ }
653
+ }
654
+ function k$1(t, e, i = t, r) {
655
+ if (e === v$1) return e;
656
+ let s = r !== void 0 ? i._$Co?.[r] : i._$Cl;
657
+ const o = I$1(e) ? void 0 : e._$litDirective$;
658
+ 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;
659
+ }
660
+ class Re {
661
+ constructor(e, i) {
662
+ this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = i;
663
+ }
664
+ get parentNode() {
665
+ return this._$AM.parentNode;
666
+ }
667
+ get _$AU() {
668
+ return this._$AM._$AU;
669
+ }
670
+ u(e) {
671
+ const { el: { content: i }, parts: r } = this._$AD, s = (e?.creationScope ?? S$1).importNode(i, true);
672
+ x$1.currentNode = s;
673
+ let o = x$1.nextNode(), a = 0, n = 0, l = r[0];
674
+ for (; l !== void 0; ) {
675
+ if (a === l.index) {
676
+ let m;
677
+ 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];
678
+ }
679
+ a !== l?.index && (o = x$1.nextNode(), a++);
680
+ }
681
+ return x$1.currentNode = S$1, s;
682
+ }
683
+ p(e) {
684
+ let i = 0;
685
+ 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++;
686
+ }
687
+ }
688
+ let z$1 = class z {
689
+ get _$AU() {
690
+ return this._$AM?._$AU ?? this._$Cv;
691
+ }
692
+ constructor(e, i, r, s) {
693
+ 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;
694
+ }
695
+ get parentNode() {
696
+ let e = this._$AA.parentNode;
697
+ const i = this._$AM;
698
+ return i !== void 0 && e?.nodeType === 11 && (e = i.parentNode), e;
699
+ }
700
+ get startNode() {
701
+ return this._$AA;
702
+ }
703
+ get endNode() {
704
+ return this._$AB;
705
+ }
706
+ _$AI(e, i = this) {
707
+ 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);
708
+ }
709
+ O(e) {
710
+ return this._$AA.parentNode.insertBefore(e, this._$AB);
711
+ }
712
+ T(e) {
713
+ this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
714
+ }
715
+ _(e) {
716
+ this._$AH !== f$1 && I$1(this._$AH) ? this._$AA.nextSibling.data = e : this.T(S$1.createTextNode(e)), this._$AH = e;
717
+ }
718
+ $(e) {
719
+ 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);
720
+ if (this._$AH?._$AD === s) this._$AH.p(i);
721
+ else {
722
+ const o = new Re(s, this), a = o.u(this.options);
723
+ o.p(i), this.T(a), this._$AH = o;
724
+ }
725
+ }
726
+ _$AC(e) {
727
+ let i = ae.get(e.strings);
728
+ return i === void 0 && ae.set(e.strings, i = new N(e)), i;
729
+ }
730
+ k(e) {
731
+ Y$1(this._$AH) || (this._$AH = [], this._$AR());
732
+ const i = this._$AH;
733
+ let r, s = 0;
734
+ 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++;
735
+ s < i.length && (this._$AR(r && r._$AB.nextSibling, s), i.length = s);
736
+ }
737
+ _$AR(e = this._$AA.nextSibling, i) {
738
+ for (this._$AP?.(false, true, i); e !== this._$AB; ) {
739
+ const r = ee$1(e).nextSibling;
740
+ ee$1(e).remove(), e = r;
741
+ }
742
+ }
743
+ setConnected(e) {
744
+ this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
745
+ }
746
+ };
747
+ let B$1 = class B {
748
+ get tagName() {
749
+ return this.element.tagName;
750
+ }
751
+ get _$AU() {
752
+ return this._$AM._$AU;
753
+ }
754
+ constructor(e, i, r, s, o) {
755
+ 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;
756
+ }
757
+ _$AI(e, i = this, r, s) {
758
+ const o = this.strings;
759
+ let a = false;
760
+ 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);
761
+ else {
762
+ const n = e;
763
+ let l, m;
764
+ 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;
765
+ }
766
+ a && !s && this.j(e);
767
+ }
768
+ j(e) {
769
+ e === f$1 ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
770
+ }
771
+ };
772
+ class Ie extends B$1 {
773
+ constructor() {
774
+ super(...arguments), this.type = 3;
775
+ }
776
+ j(e) {
777
+ this.element[this.name] = e === f$1 ? void 0 : e;
778
+ }
779
+ }
780
+ class Ne extends B$1 {
781
+ constructor() {
782
+ super(...arguments), this.type = 4;
783
+ }
784
+ j(e) {
785
+ this.element.toggleAttribute(this.name, !!e && e !== f$1);
786
+ }
787
+ }
788
+ class ze extends B$1 {
789
+ constructor(e, i, r, s, o) {
790
+ super(e, i, r, s, o), this.type = 5;
791
+ }
792
+ _$AI(e, i = this) {
793
+ if ((e = k$1(this, e, i, 0) ?? f$1) === v$1) return;
794
+ 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);
795
+ s && this.element.removeEventListener(this.name, this, r), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
796
+ }
797
+ handleEvent(e) {
798
+ typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
799
+ }
800
+ }
801
+ class Fe {
802
+ constructor(e, i, r) {
803
+ this.element = e, this.type = 6, this._$AN = void 0, this._$AM = i, this.options = r;
804
+ }
805
+ get _$AU() {
806
+ return this._$AM._$AU;
807
+ }
808
+ _$AI(e) {
809
+ k$1(this, e);
810
+ }
811
+ }
812
+ const Ue = K$1.litHtmlPolyfillSupport;
813
+ Ue?.(N, z$1), (K$1.litHtmlVersions ??= []).push("3.3.2");
814
+ const Oe = (t, e, i) => {
815
+ const r = i?.renderBefore ?? e;
816
+ let s = r._$litPart$;
817
+ if (s === void 0) {
818
+ const o = i?.renderBefore ?? null;
819
+ r._$litPart$ = s = new z$1(e.insertBefore(R$1(), o), o, void 0, i ?? {});
820
+ }
821
+ return s._$AI(t), s;
822
+ };
823
+ const G$1 = globalThis;
824
+ let C$1 = class C extends E {
825
+ constructor() {
826
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
827
+ }
828
+ createRenderRoot() {
829
+ const e = super.createRenderRoot();
830
+ return this.renderOptions.renderBefore ??= e.firstChild, e;
831
+ }
832
+ update(e) {
833
+ const i = this.render();
834
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Oe(i, this.renderRoot, this.renderOptions);
835
+ }
836
+ connectedCallback() {
837
+ super.connectedCallback(), this._$Do?.setConnected(true);
838
+ }
839
+ disconnectedCallback() {
840
+ super.disconnectedCallback(), this._$Do?.setConnected(false);
841
+ }
842
+ render() {
843
+ return v$1;
844
+ }
845
+ };
846
+ C$1._$litElement$ = true, C$1.finalized = true, G$1.litElementHydrateSupport?.({ LitElement: C$1 });
847
+ const Ve = G$1.litElementPolyfillSupport;
848
+ Ve?.({ LitElement: C$1 });
849
+ (G$1.litElementVersions ??= []).push("4.2.2");
850
+ const De = (t) => (e, i) => {
851
+ i !== void 0 ? i.addInitializer(() => {
852
+ customElements.define(t, e);
853
+ }) : customElements.define(t, e);
854
+ };
855
+ const Me = { attribute: true, type: String, converter: V$1, reflect: false, hasChanged: W$1 }, Be = (t = Me, e, i) => {
856
+ const { kind: r, metadata: s } = i;
857
+ let o = globalThis.litPropertyMetadata.get(s);
858
+ 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") {
859
+ const { name: a } = i;
860
+ return { set(n) {
861
+ const l = e.get.call(this);
862
+ e.set.call(this, n), this.requestUpdate(a, l, t, true, n);
863
+ }, init(n) {
864
+ return n !== void 0 && this.C(a, void 0, t, n), n;
865
+ } };
866
+ }
867
+ if (r === "setter") {
868
+ const { name: a } = i;
869
+ return function(n) {
870
+ const l = this[a];
871
+ e.call(this, n), this.requestUpdate(a, l, t, true, n);
872
+ };
873
+ }
874
+ throw Error("Unsupported decorator location: " + r);
875
+ };
876
+ function p(t) {
877
+ return (e, i) => typeof i == "object" ? Be(t, e, i) : ((r, s, o) => {
878
+ const a = s.hasOwnProperty(o);
879
+ return s.constructor.createProperty(o, r), a ? Object.getOwnPropertyDescriptor(s, o) : void 0;
880
+ })(t, e, i);
881
+ }
882
+ function b$1(t) {
883
+ return p({ ...t, state: true, attribute: false });
884
+ }
885
+ const Le = (t, e, i) => (i.configurable = true, i.enumerable = true, Reflect.decorate && typeof e != "object" && Object.defineProperty(t, e, i), i);
886
+ function qe(t, e) {
887
+ return (i, r, s) => {
888
+ const o = (a) => a.renderRoot?.querySelector(t) ?? null;
889
+ return Le(i, r, { get() {
890
+ return o(this);
891
+ } });
892
+ };
893
+ }
894
+ const _$1 = { ATTRIBUTE: 1, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4 }, me = (t) => (...e) => ({ _$litDirective$: t, values: e });
895
+ class fe {
896
+ constructor(e) {
897
+ }
898
+ get _$AU() {
899
+ return this._$AM._$AU;
900
+ }
901
+ _$AT(e, i, r) {
902
+ this._$Ct = e, this._$AM = i, this._$Ci = r;
903
+ }
904
+ _$AS(e, i) {
905
+ return this.update(e, i);
906
+ }
907
+ update(e, i) {
908
+ return this.render(...i);
909
+ }
910
+ }
911
+ const U$1 = me(class extends fe {
912
+ constructor(t) {
913
+ 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.");
914
+ }
915
+ render(t) {
916
+ return " " + Object.keys(t).filter((e) => t[e]).join(" ") + " ";
917
+ }
918
+ update(t, [e]) {
919
+ if (this.st === void 0) {
920
+ this.st = /* @__PURE__ */ new Set(), t.strings !== void 0 && (this.nt = new Set(t.strings.join(" ").split(/\s/).filter((r) => r !== "")));
921
+ for (const r in e) e[r] && !this.nt?.has(r) && this.st.add(r);
922
+ return this.render(e);
923
+ }
924
+ const i = t.element.classList;
925
+ for (const r of this.st) r in e || (i.remove(r), this.st.delete(r));
926
+ for (const r in e) {
927
+ const s = !!e[r];
928
+ s === this.st.has(r) || this.nt?.has(r) || (s ? (i.add(r), this.st.add(r)) : (i.remove(r), this.st.delete(r)));
929
+ }
930
+ return v$1;
931
+ }
932
+ });
933
+ const He = (t) => t.strings === void 0, je = {}, We = (t, e = je) => t._$AH = e;
934
+ const Ke = me(class extends fe {
935
+ constructor(t) {
936
+ 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");
937
+ if (!He(t)) throw Error("`live` bindings can only contain a single expression");
938
+ }
939
+ render(t) {
940
+ return t;
941
+ }
942
+ update(t, [e]) {
943
+ if (e === v$1 || e === f$1) return e;
944
+ const i = t.element, r = t.name;
945
+ if (t.type === _$1.PROPERTY) {
946
+ if (e === i[r]) return v$1;
947
+ } else if (t.type === _$1.BOOLEAN_ATTRIBUTE) {
948
+ if (!!e === i.hasAttribute(r)) return v$1;
949
+ } else if (t.type === _$1.ATTRIBUTE && i.getAttribute(r) === e + "") return v$1;
950
+ return We(t), e;
951
+ }
952
+ }), Ye = [
953
+ "AE",
954
+ "AR",
955
+ "AT",
956
+ "AU",
957
+ "BE",
958
+ "BG",
959
+ "BR",
960
+ "CA",
961
+ "CH",
962
+ "CL",
963
+ "CO",
964
+ "CZ",
965
+ "DE",
966
+ "DK",
967
+ "EE",
968
+ "ES",
969
+ "FI",
970
+ "FR",
971
+ "GB",
972
+ "GR",
973
+ "HK",
974
+ "HR",
975
+ "HU",
976
+ "ID",
977
+ "IE",
978
+ "IL",
979
+ "IN",
980
+ "IT",
981
+ "JP",
982
+ "KR",
983
+ "LT",
984
+ "LU",
985
+ "LV",
986
+ "MX",
987
+ "MY",
988
+ "NL",
989
+ "NO",
990
+ "NZ",
991
+ "PE",
992
+ "PH",
993
+ "PL",
994
+ "PT",
995
+ "RO",
996
+ "SE",
997
+ "SG",
998
+ "SI",
999
+ "SK",
1000
+ "TH",
1001
+ "TR",
1002
+ "TW",
1003
+ "US",
1004
+ "VN",
1005
+ "ZA"
1006
+ ];
1007
+ function Ge(t, e) {
1008
+ let i = null;
1009
+ return function(...r) {
1010
+ i && clearTimeout(i), i = setTimeout(() => {
1011
+ t.apply(this, r);
1012
+ }, e);
1013
+ };
1014
+ }
1015
+ function Ze() {
1016
+ return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t) {
1017
+ const e = Math.random() * 16 | 0;
1018
+ return (t === "x" ? e : e & 3 | 8).toString(16);
1019
+ });
1020
+ }
1021
+ function Je(t) {
1022
+ if (!t) return null;
1023
+ const e = t.find(
1024
+ (i) => i.types?.includes("country")
1025
+ );
1026
+ return e ? e.short_name : null;
1027
+ }
1028
+ function ne(t, e) {
1029
+ let i = null;
1030
+ return t.address_components ? i = Je(t.address_components) : e && e.length === 1 && (i = e[0].toUpperCase()), i ? {
1031
+ isSupported: Ye.includes(i),
1032
+ countryCode: i
1033
+ } : {
1034
+ isSupported: null,
1035
+ countryCode: null
1036
+ };
1037
+ }
1038
+ const le = {
1039
+ en: {
1040
+ placeholder: "Search for an address...",
1041
+ noResults: "No address found for this search. Try different keywords.",
1042
+ errorFetchPredictions: "Unable to search for addresses. Please try again.",
1043
+ errorFetchDetails: "Unable to load address details. Please try again.",
1044
+ errorNetwork: "Network error. Please check your connection and try again.",
1045
+ validationRequired: "This field is required",
1046
+ validationPattern: "Invalid format",
1047
+ validationSaudiFormat: "Please enter a valid Saudi national address (format: AAAA1234)"
1048
+ },
1049
+ ar: {
1050
+ placeholder: "ابحث عن عنوان...",
1051
+ noResults: "لم يتم العثور على عنوان لهذا البحث. جرب كلمات مختلفة.",
1052
+ errorFetchPredictions: "تعذر البحث عن العناوين. يرجى المحاولة مرة أخرى.",
1053
+ errorFetchDetails: "تعذر تحميل تفاصيل العنوان. يرجى المحاولة مرة أخرى.",
1054
+ errorNetwork: "خطأ في الشبكة. يرجى التحقق من اتصالك والمحاولة مرة أخرى.",
1055
+ validationRequired: "هذا الحقل مطلوب",
1056
+ validationPattern: "صيغة غير صحيحة",
1057
+ validationSaudiFormat: "الرجاء إدخال عنوان وطني صحيح (الصيغة: AAAA1234)"
1058
+ },
1059
+ es: {
1060
+ placeholder: "Buscar una dirección...",
1061
+ noResults: "No se encontró ninguna dirección para esta búsqueda. Intenta con diferentes palabras.",
1062
+ errorFetchPredictions: "No se pueden buscar direcciones. Por favor, inténtelo de nuevo.",
1063
+ errorFetchDetails: "No se pueden cargar los detalles de la dirección. Por favor, inténtelo de nuevo.",
1064
+ errorNetwork: "Error de red. Verifique su conexión e inténtelo de nuevo.",
1065
+ validationRequired: "Este campo es obligatorio",
1066
+ validationPattern: "Formato inválido",
1067
+ validationSaudiFormat: "Por favor ingrese una dirección nacional saudí válida (formato: AAAA1234)"
1068
+ },
1069
+ fr: {
1070
+ placeholder: "Rechercher une adresse...",
1071
+ noResults: "Aucune adresse trouvée pour cette recherche. Essayez différents mots-clés.",
1072
+ errorFetchPredictions: "Impossible de rechercher des adresses. Veuillez réessayer.",
1073
+ errorFetchDetails: "Impossible de charger les détails de l'adresse. Veuillez réessayer.",
1074
+ errorNetwork: "Erreur réseau. Vérifiez votre connexion et réessayez.",
1075
+ validationRequired: "Ce champ est obligatoire",
1076
+ validationPattern: "Format invalide",
1077
+ validationSaudiFormat: "Veuillez saisir une adresse nationale saoudienne valide (format: AAAA1234)"
1078
+ },
1079
+ de: {
1080
+ placeholder: "Nach einer Adresse suchen...",
1081
+ noResults: "Keine Adresse für diese Suche gefunden. Versuchen Sie es mit anderen Stichwörtern.",
1082
+ errorFetchPredictions: "Adressen können nicht gesucht werden. Bitte versuchen Sie es erneut.",
1083
+ errorFetchDetails: "Adressdetails können nicht geladen werden. Bitte versuchen Sie es erneut.",
1084
+ errorNetwork: "Netzwerkfehler. Bitte überprüfen Sie Ihre Verbindung und versuchen Sie es erneut.",
1085
+ validationRequired: "Dieses Feld ist erforderlich",
1086
+ validationPattern: "Ungültiges Format",
1087
+ validationSaudiFormat: "Bitte geben Sie eine gültige saudi-arabische nationale Adresse ein (Format: AAAA1234)"
1088
+ },
1089
+ it: {
1090
+ placeholder: "Cerca un indirizzo...",
1091
+ noResults: "Nessun indirizzo trovato per questa ricerca. Prova con parole chiave diverse.",
1092
+ errorFetchPredictions: "Impossibile cercare indirizzi. Riprova.",
1093
+ errorFetchDetails: "Impossibile caricare i dettagli dell'indirizzo. Riprova.",
1094
+ errorNetwork: "Errore di rete. Controlla la connessione e riprova.",
1095
+ validationRequired: "Questo campo è obbligatorio",
1096
+ validationPattern: "Formato non valido",
1097
+ validationSaudiFormat: "Inserisci un indirizzo nazionale saudita valido (formato: AAAA1234)"
1098
+ },
1099
+ pt: {
1100
+ placeholder: "Pesquisar um endereço...",
1101
+ noResults: "Nenhum endereço encontrado para esta pesquisa. Tente palavras-chave diferentes.",
1102
+ errorFetchPredictions: "Não é possível pesquisar endereços. Por favor, tente novamente.",
1103
+ errorFetchDetails: "Não é possível carregar os detalhes do endereço. Por favor, tente novamente.",
1104
+ errorNetwork: "Erro de rede. Verifique sua conexão e tente novamente.",
1105
+ validationRequired: "Este campo é obrigatório",
1106
+ validationPattern: "Formato inválido",
1107
+ validationSaudiFormat: "Por favor, insira um endereço nacional saudita válido (formato: AAAA1234)"
1108
+ },
1109
+ ru: {
1110
+ placeholder: "Поиск адреса...",
1111
+ noResults: "Адрес для этого поиска не найден. Попробуйте другие ключевые слова.",
1112
+ errorFetchPredictions: "Невозможно выполнить поиск адресов. Пожалуйста, попробуйте еще раз.",
1113
+ errorFetchDetails: "Невозможно загрузить детали адреса. Пожалуйста, попробуйте еще раз.",
1114
+ errorNetwork: "Ошибка сети. Проверьте соединение и попробуйте еще раз.",
1115
+ validationRequired: "Это поле обязательно",
1116
+ validationPattern: "Неверный формат",
1117
+ validationSaudiFormat: "Пожалуйста, введите действительный национальный адрес Саудовской Аравии (формат: AAAA1234)"
1118
+ },
1119
+ ja: {
1120
+ placeholder: "住所を検索...",
1121
+ noResults: "この検索では住所が見つかりませんでした。別のキーワードをお試しください。",
1122
+ errorFetchPredictions: "住所を検索できません。もう一度お試しください。",
1123
+ errorFetchDetails: "住所の詳細を読み込めません。もう一度お試しください。",
1124
+ errorNetwork: "ネットワークエラー。接続を確認してもう一度お試しください。",
1125
+ validationRequired: "この項目は必須です",
1126
+ validationPattern: "無効な形式",
1127
+ validationSaudiFormat: "有効なサウジアラビアの国内住所を入力してください(形式:AAAA1234)"
1128
+ },
1129
+ zh: {
1130
+ placeholder: "搜索地址...",
1131
+ noResults: "未找到此搜索的地址。请尝试不同的关键词。",
1132
+ errorFetchPredictions: "无法搜索地址。请重试。",
1133
+ errorFetchDetails: "无法加载地址详情。请重试。",
1134
+ errorNetwork: "网络错误。请检查您的连接并重试。",
1135
+ validationRequired: "此字段为必填项",
1136
+ validationPattern: "格式无效",
1137
+ validationSaudiFormat: "请输入有效的沙特国家地址(格式:AAAA1234)"
1138
+ },
1139
+ ko: {
1140
+ placeholder: "주소 검색...",
1141
+ noResults: "이 검색에 대한 주소를 찾을 수 없습니다. 다른 키워드를 시도해보세요.",
1142
+ errorFetchPredictions: "주소를 검색할 수 없습니다. 다시 시도해주세요.",
1143
+ errorFetchDetails: "주소 세부정보를 불러올 수 없습니다. 다시 시도해주세요.",
1144
+ errorNetwork: "네트워크 오류입니다. 연결을 확인하고 다시 시도해주세요.",
1145
+ validationRequired: "이 필드는 필수입니다",
1146
+ validationPattern: "유효하지 않은 형식",
1147
+ validationSaudiFormat: "유효한 사우디 국가 주소를 입력하세요 (형식: AAAA1234)"
1148
+ },
1149
+ hi: {
1150
+ placeholder: "पता खोजें...",
1151
+ noResults: "इस खोज के लिए कोई पता नहीं मिला। विभिन्न कीवर्ड आज़माएं।",
1152
+ errorFetchPredictions: "पते खोजने में असमर्थ। कृपया पुनः प्रयास करें।",
1153
+ errorFetchDetails: "पते का विवरण लोड करने में असमर्थ। कृपया पुनः प्रयास करें।",
1154
+ errorNetwork: "नेटवर्क त्रुटि। कृपया अपना कनेक्शन जांचें और पुनः प्रयास करें।",
1155
+ validationRequired: "यह फ़ील्ड आवश्यक है",
1156
+ validationPattern: "अमान्य प्रारूप",
1157
+ validationSaudiFormat: "कृपया एक मान्य सऊदी राष्ट्रीय पता दर्ज करें (प्रारूप: AAAA1234)"
1158
+ },
1159
+ tr: {
1160
+ placeholder: "Adres ara...",
1161
+ noResults: "Bu arama için adres bulunamadı. Farklı anahtar kelimeler deneyin.",
1162
+ errorFetchPredictions: "Adresler aranamıyor. Lütfen tekrar deneyin.",
1163
+ errorFetchDetails: "Adres detayları yüklenemiyor. Lütfen tekrar deneyin.",
1164
+ errorNetwork: "Ağ hatası. Lütfen bağlantınızı kontrol edin ve tekrar deneyin.",
1165
+ validationRequired: "Bu alan zorunludur",
1166
+ validationPattern: "Geçersiz format",
1167
+ validationSaudiFormat: "Lütfen geçerli bir Suudi ulusal adresi girin (format: AAAA1234)"
1168
+ }
1169
+ };
1170
+ function q$1(t = "en") {
1171
+ return le[t] || le.en;
1172
+ }
1173
+ function Xe(t) {
1174
+ return ["ar"].includes(t);
1175
+ }
1176
+ var Qe = Object.defineProperty, et$1 = Object.getOwnPropertyDescriptor, h$1 = (t, e, i, r) => {
1177
+ for (var s = r > 1 ? void 0 : r ? et$1(e, i) : e, o = t.length - 1, a; o >= 0; o--)
1178
+ (a = t[o]) && (s = (r ? a(e, i, s) : a(s)) || s);
1179
+ return r && s && Qe(e, i, s), s;
1180
+ };
1181
+ let d$1 = class d extends C$1 {
1182
+ constructor() {
1183
+ 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();
1184
+ }
1185
+ set value(t) {
1186
+ const e = this._value;
1187
+ this._value = t || "", this.requestUpdate("value", e);
1188
+ }
1189
+ get value() {
1190
+ return this._value;
1191
+ }
1192
+ set country(t) {
1193
+ 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);
1194
+ }
1195
+ get country() {
1196
+ return this._country;
1197
+ }
1198
+ set fieldsStr(t) {
1199
+ this._fields = t ? t.split(",").map((e) => e.trim()).filter((e) => e) : ["formatted_address", "geometry"];
1200
+ }
1201
+ get fieldsStr() {
1202
+ return this._fields.join(",");
1203
+ }
1204
+ set fields(t) {
1205
+ this._fields = t && t.length > 0 ? t : ["formatted_address", "geometry"];
1206
+ }
1207
+ get fields() {
1208
+ return this._fields;
1209
+ }
1210
+ connectedCallback() {
1211
+ super.connectedCallback(), this.createNewSession(), this.initializeDebounce();
1212
+ }
1213
+ disconnectedCallback() {
1214
+ super.disconnectedCallback(), this.terminateSession(), this.cancelPendingRequest();
1215
+ }
1216
+ initializeDebounce() {
1217
+ this.debouncedFetch = Ge(this.fetchPredictions.bind(this), this.debounceDelay);
1218
+ }
1219
+ firstUpdated() {
1220
+ const t = this.value || this.defaultPlace || "";
1221
+ t && (this.inputValue = t, this.isSaudiFormMode() && this.isShortAddressFormat(t) && (this.showNationalAddressIcon = true));
1222
+ }
1223
+ $nextTick(t) {
1224
+ Promise.resolve().then(t);
1225
+ }
1226
+ isShortAddressFormat(t) {
1227
+ return /^[a-zA-Z]{4}\d{4}$/.test(t?.trim());
1228
+ }
1229
+ updated(t) {
1230
+ if (t.has("value")) {
1231
+ const e = this.value || "";
1232
+ e !== this.inputValue && (this.inputValue = e, this.isSaudiFormMode() && e && this.isShortAddressFormat(e) ? this.showNationalAddressIcon = true : this.showNationalAddressIcon = false);
1233
+ }
1234
+ 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();
1235
+ }
1236
+ createNewSession() {
1237
+ this.useSessionToken && (this.sessionToken = Ze());
1238
+ }
1239
+ terminateSession() {
1240
+ this.sessionToken = null;
1241
+ }
1242
+ cancelPendingRequest() {
1243
+ this.abortController && (this.abortController.abort(), this.abortController = null);
1244
+ }
1245
+ isSaudiFormMode() {
1246
+ return this.mode === "form" && this.country !== null && this.country.length === 1 && this.country[0].toLowerCase() === "sa";
1247
+ }
1248
+ getWhatsAppLink() {
1249
+ const t = "966112898888", e = encodeURIComponent("العنوان الوطني");
1250
+ return `https://wa.me/${t}?text=${e}`;
1251
+ }
1252
+ renderWhatsAppIcon() {
1253
+ return g`
1254
+ <svg class="whatsapp-icon" viewBox="0 0 24 24" fill="currentColor" part="whatsapp-icon">
1255
+ <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"/>
1256
+ </svg>
1257
+ `;
1258
+ }
1259
+ getSaudiHelpTextContent() {
1260
+ return {
1261
+ helpText: this.language === "ar" ? "لا تعرف العنوان الوطني؟" : "Don't know your national address?",
1262
+ linkText: this.language === "ar" ? "احصل على العنوان الوطني عبر الواتساب" : "Get your national address via WhatsApp"
1263
+ };
1264
+ }
1265
+ renderSaudiFriendlyError() {
1266
+ const t = this.inputValue && this.inputValue.trim().length > 0;
1267
+ let e, i;
1268
+ 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");
1269
+ 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;
1270
+ return g`
1271
+ <span>
1272
+ ${n}
1273
+ <a
1274
+ href="${this.getWhatsAppLink()}"
1275
+ target="_blank"
1276
+ rel="noopener noreferrer"
1277
+ class="whatsapp-link-inline"
1278
+ part="whatsapp-link"
1279
+ >
1280
+ ${this.renderWhatsAppIcon()}
1281
+ ${l}
1282
+ </a>
1283
+ ${m}
1284
+ </span>
1285
+ `;
1286
+ }
1287
+ renderSaudiHelpText() {
1288
+ if (!this.isSaudiFormMode() || this.validationError || this.errors && this.errors.length > 0)
1289
+ return "";
1290
+ 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;
1291
+ return g`
1292
+ <div class="help-text" part="help-text">
1293
+ <span>
1294
+ ${a}
1295
+ <a
1296
+ href="${this.getWhatsAppLink()}"
1297
+ target="_blank"
1298
+ rel="noopener noreferrer"
1299
+ class="whatsapp-link-inline"
1300
+ part="whatsapp-link"
1301
+ >
1302
+ ${this.renderWhatsAppIcon()}
1303
+ ${n}
1304
+ </a>
1305
+ ${l}
1306
+ </span>
1307
+ </div>
1308
+ `;
1309
+ }
1310
+ async fetchPredictions(t) {
1311
+ if (!t.trim()) {
1312
+ this.predictions = [], this.isOpen = false, this.isLoading = false;
1313
+ return;
1314
+ }
1315
+ if (t.trim().length < this.minChars) {
1316
+ this.predictions = [], this.isOpen = false, this.isLoading = false;
1317
+ return;
1318
+ }
1319
+ this.cancelPendingRequest(), this.abortController = new AbortController();
1320
+ const e = this.abortController.signal;
1321
+ this.isLoading = true, this.error = null;
1322
+ try {
1323
+ const i = { input: t, language: this.language };
1324
+ 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");
1325
+ const r = new URLSearchParams(i), o = `${this.proxyUrl || ""}/store/v1/checkout/address/autocomplete/query?${r.toString()}`, a = {};
1326
+ this.authToken && (a.Authorization = `Bearer ${this.authToken}`);
1327
+ const n = await fetch(o, { signal: e, headers: a });
1328
+ if (!n.ok)
1329
+ throw new Error(`HTTP ${n.status}: ${n.statusText}`);
1330
+ const l = await n.json();
1331
+ l.success && Array.isArray(l.data) ? (this.error = null, l.data.length > 0 ? (this.predictions = l.data.map((c) => ({
1332
+ place_id: c.id,
1333
+ description: c.description || c.formatted_address,
1334
+ formatted_address: c.formatted_address,
1335
+ short_address: c.short_address,
1336
+ structured_formatting: {
1337
+ main_text: c.formatted_address || c.description,
1338
+ main_text_matched_substrings: [],
1339
+ secondary_text: c.description || ""
1340
+ },
1341
+ types: c.types || [],
1342
+ geometry: c.geometry,
1343
+ address_components: c.address_components
1344
+ })), this.isOpen = true, this.activeIndex = -1) : (this.predictions = [], this.isOpen = true)) : (this.predictions = [], this.isOpen = true);
1345
+ } catch (i) {
1346
+ if (i instanceof Error && i.name === "AbortError")
1347
+ return;
1348
+ this.predictions = [], this.isOpen = true;
1349
+ } finally {
1350
+ this.isLoading = false, this.abortController = null;
1351
+ }
1352
+ }
1353
+ async fetchPlaceDetails(t) {
1354
+ this.isLoading = true, this.error = null;
1355
+ try {
1356
+ const e = { place_id: t, language: this.language };
1357
+ 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");
1358
+ const i = new URLSearchParams(e), s = `${this.proxyUrl || ""}/store/v1/checkout/address/autocomplete/details?${i.toString()}`, o = {};
1359
+ this.authToken && (o.Authorization = `Bearer ${this.authToken}`);
1360
+ const a = await fetch(s, { headers: o });
1361
+ if (!a.ok)
1362
+ throw new Error(`HTTP ${a.status}: ${a.statusText}`);
1363
+ const n = await a.json();
1364
+ return !n.success || n.message ? (this.error = n.message || "Failed to fetch place details", null) : n.success && n.data && n.data.id ? {
1365
+ place_id: n.data.id,
1366
+ ...n.data,
1367
+ components: n.data.address_components?.reduce((m, c) => (c.types?.forEach((u) => {
1368
+ m[u] || (m[u] = []), m[u].push({
1369
+ long_name: c.long_name,
1370
+ short_name: c.short_name
1371
+ });
1372
+ }), m), {})
1373
+ } : null;
1374
+ } catch (e) {
1375
+ console.error("Error fetching place details:", e);
1376
+ const i = q$1(this.language);
1377
+ return this.error = e instanceof Error ? e.message : i.errorFetchDetails, null;
1378
+ } finally {
1379
+ this.isLoading = false;
1380
+ }
1381
+ }
1382
+ /**
1383
+ * Validates the selected address using the provided callback
1384
+ * @param place - The place details to validate
1385
+ * @returns Promise resolving to validation result
1386
+ */
1387
+ async validateAddress(t) {
1388
+ try {
1389
+ if (!t || !t.formatted_address)
1390
+ return console.error("Cannot validate address - place or formatted_address is missing"), null;
1391
+ if (!this.onValidateAddress || typeof this.onValidateAddress != "function")
1392
+ return console.error("onValidateAddress callback is required for address validation"), null;
1393
+ const e = ne(t, this.country), i = await this.onValidateAddress({
1394
+ place: t,
1395
+ sessionToken: this.sessionToken,
1396
+ validationSupport: e
1397
+ });
1398
+ return this.terminateSession(), i;
1399
+ } catch (e) {
1400
+ return console.error("Error validating address:", e), this.terminateSession(), null;
1401
+ }
1402
+ }
1403
+ /**
1404
+ * Gets validation support information for a place
1405
+ * @param place - The place details to check
1406
+ * @returns ValidationSupport object indicating what validation is supported
1407
+ */
1408
+ getValidationSupport(t) {
1409
+ return ne(t, this.country);
1410
+ }
1411
+ checkValidity() {
1412
+ return this.validate();
1413
+ }
1414
+ reportValidity() {
1415
+ this.touched = true;
1416
+ const t = this.validate();
1417
+ return t || this.dispatchEvent(new CustomEvent("invalid", {
1418
+ detail: { error: this.validationError },
1419
+ bubbles: true,
1420
+ composed: true
1421
+ })), t;
1422
+ }
1423
+ /**
1424
+ * Resets the component to its initial state
1425
+ */
1426
+ reset() {
1427
+ 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({}));
1428
+ }
1429
+ // Form lifecycle callbacks
1430
+ formResetCallback() {
1431
+ this.reset();
1432
+ }
1433
+ formStateRestoreCallback(t) {
1434
+ t && this.mode === "form" && (this.selectedId = t);
1435
+ }
1436
+ validate() {
1437
+ if (this.mode !== "form")
1438
+ return true;
1439
+ const t = q$1(this.language), e = this.inputValue || "";
1440
+ return this.required && !e.trim() ? (this.validationError = t.validationRequired, this._internals.setValidity(
1441
+ { valueMissing: true },
1442
+ this.validationError,
1443
+ this.inputElement
1444
+ ), false) : this.isSaudiFormMode() && e.trim() && !this.isShortAddressFormat(e) ? (this.validationError = t.validationSaudiFormat, this._internals.setValidity(
1445
+ { patternMismatch: true },
1446
+ this.validationError,
1447
+ this.inputElement
1448
+ ), false) : this.pattern && e.trim() && !new RegExp(this.pattern).test(e) ? (this.validationError = t.validationPattern, this._internals.setValidity(
1449
+ { patternMismatch: true },
1450
+ this.validationError,
1451
+ this.inputElement
1452
+ ), false) : (this.validationError = null, this._internals.setValidity({}), true);
1453
+ }
1454
+ /**
1455
+ * Normalize numerals from various scripts to Arabic numerals (0-9).
1456
+ * Handles Arabic-Indic, Devanagari (Hindi), Persian, and Bengali numerals.
1457
+ * Works consistently across all browsers and operating systems.
1458
+ */
1459
+ normalizeNumerals(t) {
1460
+ if (!t) return t;
1461
+ const e = {
1462
+ // Arabic-Indic numerals (used in Arab countries): ٠١٢٣٤٥٦٧٨٩
1463
+ "٠": "0",
1464
+ "١": "1",
1465
+ "٢": "2",
1466
+ "٣": "3",
1467
+ "٤": "4",
1468
+ "٥": "5",
1469
+ "٦": "6",
1470
+ "٧": "7",
1471
+ "٨": "8",
1472
+ "٩": "9",
1473
+ // Devanagari (Hindi) numerals (used in India, Nepal): ०१२३४५६७८९
1474
+ "०": "0",
1475
+ "१": "1",
1476
+ "२": "2",
1477
+ "३": "3",
1478
+ "४": "4",
1479
+ "५": "5",
1480
+ "६": "6",
1481
+ "७": "7",
1482
+ "८": "8",
1483
+ "९": "9",
1484
+ // Persian/Dari numerals (used in Iran, Afghanistan): ۰۱۲۳۴۵۶۷۸۹
1485
+ "۰": "0",
1486
+ "۱": "1",
1487
+ "۲": "2",
1488
+ "۳": "3",
1489
+ "۴": "4",
1490
+ "۵": "5",
1491
+ "۶": "6",
1492
+ "۷": "7",
1493
+ "۸": "8",
1494
+ "۹": "9",
1495
+ // Bengali numerals (used in Bangladesh, India): ০১২৩৪৫৬৭৮৯
1496
+ "০": "0",
1497
+ "১": "1",
1498
+ "২": "2",
1499
+ "৩": "3",
1500
+ "৪": "4",
1501
+ "৫": "5",
1502
+ "৬": "6",
1503
+ "৭": "7",
1504
+ "৮": "8",
1505
+ "৯": "9"
1506
+ };
1507
+ return t.split("").map((i) => e[i] ?? i).join("");
1508
+ }
1509
+ handleInput(t) {
1510
+ if (this.disabled) return;
1511
+ const e = t.target, i = e.selectionStart ?? 0, r = this.inputValue, s = e.value, o = this.normalizeNumerals(s);
1512
+ o !== s && (e.value = o, requestAnimationFrame(() => {
1513
+ e.setSelectionRange(i, i);
1514
+ })), 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", {
1515
+ detail: { value: this.inputValue },
1516
+ bubbles: true,
1517
+ composed: true
1518
+ })), this.dispatchEvent(new Event("change", {
1519
+ bubbles: true,
1520
+ composed: true
1521
+ })), this.dispatchEvent(new InputEvent("input", {
1522
+ data: this.inputValue,
1523
+ bubbles: true,
1524
+ composed: true
1525
+ }));
1526
+ }
1527
+ async handleSelect(t) {
1528
+ if (this.disabled) return;
1529
+ 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;
1530
+ let e = null;
1531
+ if (this.mode === "form" ? e = await this.fetchPlaceDetails(t.place_id) : t.geometry?.location ? e = {
1532
+ place_id: t.place_id,
1533
+ formatted_address: t.formatted_address || t.description,
1534
+ geometry: t.geometry,
1535
+ types: t.types,
1536
+ address_components: t.address_components
1537
+ } : e = await this.fetchPlaceDetails(t.place_id), e) {
1538
+ 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", {
1539
+ detail: { value: this.inputValue },
1540
+ bubbles: true,
1541
+ composed: true
1542
+ })), this.dispatchEvent(new Event("change", {
1543
+ bubbles: true,
1544
+ composed: true
1545
+ }));
1546
+ const i = this.getValidationSupport(e);
1547
+ this.dispatchEvent(new CustomEvent("place-select", {
1548
+ detail: { place: e, validationSupport: i },
1549
+ bubbles: true,
1550
+ composed: true
1551
+ })), this.dispatchEvent(new CustomEvent("place-changed", {
1552
+ detail: { place: e, validationSupport: i },
1553
+ bubbles: true,
1554
+ composed: true
1555
+ }));
1556
+ }
1557
+ }
1558
+ handleKeyDown(t) {
1559
+ if (!this.disabled && !(!this.isOpen || this.predictions.length === 0))
1560
+ switch (t.key) {
1561
+ case "ArrowDown":
1562
+ t.preventDefault(), this.activeIndex = Math.min(this.activeIndex + 1, this.predictions.length - 1);
1563
+ break;
1564
+ case "ArrowUp":
1565
+ t.preventDefault(), this.activeIndex = Math.max(this.activeIndex - 1, -1);
1566
+ break;
1567
+ case "Enter":
1568
+ t.preventDefault(), this.activeIndex >= 0 && this.activeIndex < this.predictions.length && this.handleSelect(this.predictions[this.activeIndex]);
1569
+ break;
1570
+ case "Escape":
1571
+ t.preventDefault(), this.isOpen = false, this.activeIndex = -1;
1572
+ break;
1573
+ }
1574
+ }
1575
+ handleBlur() {
1576
+ setTimeout(() => {
1577
+ this.isOpen = false, this.activeIndex = -1, this.mode === "form" && this.touched && this.validate(), this.dispatchEvent(new Event("blur", {
1578
+ bubbles: true,
1579
+ composed: true
1580
+ }));
1581
+ }, 200);
1582
+ }
1583
+ handleFocus() {
1584
+ this.disabled || this.predictions.length > 0 && (this.isOpen = true);
1585
+ }
1586
+ renderLocationIcon() {
1587
+ return g`
1588
+ <svg class="location-icon" fill="currentColor" viewBox="0 0 20 20">
1589
+ <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" />
1590
+ </svg>
1591
+ `;
1592
+ }
1593
+ renderTooltip() {
1594
+ return this.tooltip ? g`
1595
+ <span class="tooltip-toggle" part="tooltip-toggle">
1596
+ <svg class="tooltip-icon" part="tooltip-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
1597
+ <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" />
1598
+ </svg>
1599
+ <span class="tooltip-content" part="tooltip-content">${this.tooltip}</span>
1600
+ </span>
1601
+ ` : "";
1602
+ }
1603
+ renderPrediction(t, e) {
1604
+ const i = {
1605
+ "dropdown-item": true,
1606
+ active: e === this.activeIndex
1607
+ };
1608
+ let r = t.structured_formatting.main_text;
1609
+ 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`
1610
+ <div
1611
+ class=${U$1(i)}
1612
+ part="dropdown-item ${e === this.activeIndex ? "dropdown-item-active" : ""}"
1613
+ @click=${() => this.handleSelect(t)}
1614
+ role="option"
1615
+ aria-selected=${e === this.activeIndex}
1616
+ >
1617
+ ${this.renderLocationIcon()}
1618
+ <div class="place-info" part="place-info">
1619
+ <div class="main-text" part="main-text">
1620
+ ${t.short_address ? g`
1621
+ <span class="national-address-badge" part="national-address-badge">
1622
+ <img
1623
+ src="https://cdn.salla.network/images/shipping/png/national-address-icon-small-min.png"
1624
+ alt="national address icon"
1625
+ class="national-address-icon"
1626
+ />
1627
+ <span class="national-address-text">${t.short_address}</span>
1628
+ <span class="national-address-separator">-</span>
1629
+ </span>
1630
+ ` : ""}
1631
+ ${r}
1632
+ </div>
1633
+ ${t.structured_formatting.secondary_text ? g`
1634
+ <div class="secondary-text" part="secondary-text">
1635
+ ${t.structured_formatting.secondary_text}
1636
+ </div>
1637
+ ` : ""}
1638
+ </div>
1639
+ </div>
1640
+ `;
1641
+ }
1642
+ render() {
1643
+ const t = {
1644
+ dropdown: true,
1645
+ open: this.isOpen
1646
+ }, e = {
1647
+ "is-invalid": !!(this.mode === "form" && this.validationError) || this.errors && this.errors.length > 0,
1648
+ "with-national-icon": this.showNationalAddressIcon
1649
+ }, i = {
1650
+ required: this.mode === "form" && this.required
1651
+ }, 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";
1652
+ return g`
1653
+ <div class="wrapper ${this.className}" part="wrapper" dir="${s}">
1654
+ <div class="input-container" part="input-container">
1655
+ ${this.label ? g`
1656
+ <label part="label" class=${U$1(i)}>
1657
+ <span class="label-content">
1658
+ <span>${this.label}</span>
1659
+ ${this.renderTooltip()}
1660
+ </span>
1661
+ </label>
1662
+ ` : ""}
1663
+ <div class="input-wrapper">
1664
+ <input
1665
+ part="input"
1666
+ class=${U$1(e)}
1667
+ type="text"
1668
+ name="${a}"
1669
+ .value=${Ke(this.inputValue)}
1670
+ placeholder=${o}
1671
+ ?disabled=${this.disabled}
1672
+ @input=${this.handleInput}
1673
+ @keydown=${this.handleKeyDown}
1674
+ @blur=${this.handleBlur}
1675
+ @focus=${this.handleFocus}
1676
+ role="combobox"
1677
+ aria-expanded=${this.isOpen}
1678
+ aria-autocomplete="list"
1679
+ aria-controls="predictions-list"
1680
+ aria-invalid=${this.mode === "form" && this.validationError || this.errors && this.errors.length > 0 ? "true" : "false"}
1681
+ aria-required=${this.mode === "form" && this.required ? "true" : "false"}
1682
+ autocomplete="off"
1683
+ autocorrect="off"
1684
+ autocapitalize="off"
1685
+ spellcheck="false"
1686
+ />
1687
+ ${this.isLoading ? g`<div class="loading-spinner" part="spinner"></div>` : ""}
1688
+
1689
+ <div
1690
+ id="predictions-list"
1691
+ class=${U$1(t)}
1692
+ part="dropdown"
1693
+ role="listbox"
1694
+ >
1695
+ ${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>` : ""}
1696
+ </div>
1697
+ </div>
1698
+ ${this.mode === "form" && this.validationError ? g`
1699
+ <div class="validation-error" part="validation-error">
1700
+ ${this.isSaudiFormMode() ? this.renderSaudiFriendlyError() : g`<span>${this.validationError}</span>`}
1701
+ </div>
1702
+ ` : ""}
1703
+ ${this.errors && this.errors.length > 0 ? g`
1704
+ <div class="validation-error" part="validation-error">${this.errors[0]}</div>
1705
+ ` : ""}
1706
+ ${this.error ? g`<div class="error-message" part="error">${this.error}</div>` : ""}
1707
+ ${this.renderSaudiHelpText()}
1708
+ </div>
1709
+ </div>
1710
+ `;
1711
+ }
1712
+ };
1713
+ d$1.formAssociated = true;
1714
+ d$1.styles = ve`
1715
+ :host {
1716
+ display: block;
1717
+ position: relative;
1718
+ font-family: var(--salla-autocomplete-font-family, system-ui, -apple-system, sans-serif);
1719
+ }
1720
+
1721
+ .wrapper {
1722
+ position: relative;
1723
+ }
1724
+
1725
+ .input-container {
1726
+ display: flex;
1727
+ flex-direction: column;
1728
+ }
1729
+
1730
+ .input-wrapper {
1731
+ position: relative;
1732
+ }
1733
+
1734
+ label {
1735
+ display: block;
1736
+ margin-bottom: var(--salla-autocomplete-label-margin, 0.5rem);
1737
+ font-size: var(--salla-autocomplete-label-font-size, 0.875rem);
1738
+ font-weight: var(--salla-autocomplete-label-font-weight, 500);
1739
+ color: var(--salla-autocomplete-label-color, #374151);
1740
+ }
1741
+
1742
+ label.required::after {
1743
+ content: ' *';
1744
+ color: var(--salla-autocomplete-required-color, #dc2626);
1745
+ }
1746
+
1747
+ .label-content {
1748
+ display: inline-flex;
1749
+ align-items: center;
1750
+ gap: 0.5rem;
1751
+ }
1752
+
1753
+ .tooltip-toggle {
1754
+ position: relative;
1755
+ display: inline-flex;
1756
+ align-items: center;
1757
+ cursor: help;
1758
+ }
1759
+
1760
+ .tooltip-icon {
1761
+ width: 1rem;
1762
+ height: 1rem;
1763
+ color: var(--salla-autocomplete-tooltip-icon-color, #6b7280);
1764
+ }
1765
+
1766
+ .tooltip-content {
1767
+ display: none;
1768
+ position: absolute;
1769
+ bottom: 125%;
1770
+ left: 50%;
1771
+ transform: translateX(-50%);
1772
+ background: var(--salla-autocomplete-tooltip-bg, #1f2937);
1773
+ color: var(--salla-autocomplete-tooltip-color, white);
1774
+ padding: 0.5rem 0.75rem;
1775
+ border-radius: 0.375rem;
1776
+ font-size: 0.75rem;
1777
+ line-height: 1.4;
1778
+ white-space: nowrap;
1779
+ z-index: 1000;
1780
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
1781
+ }
1782
+
1783
+ .tooltip-content::after {
1784
+ content: '';
1785
+ position: absolute;
1786
+ top: 100%;
1787
+ left: 50%;
1788
+ transform: translateX(-50%);
1789
+ border: 5px solid transparent;
1790
+ border-top-color: var(--salla-autocomplete-tooltip-bg, #1f2937);
1791
+ }
1792
+
1793
+ .tooltip-toggle:hover .tooltip-content,
1794
+ .tooltip-toggle:focus .tooltip-content {
1795
+ display: block;
1796
+ }
1797
+
1798
+ input {
1799
+ width: 100%;
1800
+ padding-block: 0.75rem;
1801
+ padding-inline-start: var(--salla-autocomplete-input-padding-start, 0.875rem);
1802
+ padding-inline-end: var(--salla-autocomplete-input-padding-end, 2.75rem);
1803
+ font-family: var(--salla-autocomplete-font-family, system-ui, -apple-system, sans-serif);
1804
+ font-size: var(--salla-autocomplete-input-font-size, 1rem);
1805
+ line-height: var(--salla-autocomplete-input-line-height, 1.5);
1806
+ border: var(--salla-autocomplete-input-border, 1px solid #d1d5db);
1807
+ border-radius: var(--salla-autocomplete-input-border-radius, 0.5rem);
1808
+ background: var(--salla-autocomplete-input-background, white);
1809
+ color: var(--salla-autocomplete-input-color, #111827);
1810
+ outline: none;
1811
+ transition: all 0.2s;
1812
+ box-sizing: border-box;
1813
+ height: var(--salla-autocomplete-input-height, auto);
1814
+ min-height: var(--salla-autocomplete-input-height, 44px);
1815
+ -webkit-appearance: none;
1816
+ appearance: none;
1817
+ }
1818
+
1819
+ input.with-national-icon {
1820
+ padding-inline-start: var(--salla-autocomplete-input-padding-start-icon, 2rem);
1821
+ background-image: url('https://cdn.salla.network/images/shipping/png/national-address-icon-small-min.png');
1822
+ background-repeat: no-repeat;
1823
+ background-position: 0.75rem center;
1824
+ background-size: 16px;
1825
+ }
1826
+
1827
+ input.with-national-icon[dir="rtl"],
1828
+ :host([dir="rtl"]) input.with-national-icon {
1829
+ padding-inline-start: var(--salla-autocomplete-input-padding-start, 0.875rem);
1830
+ padding-inline-end: var(--salla-autocomplete-input-padding-end-icon, 2.75rem);
1831
+ background-position: calc(100% - 0.75rem) center;
1832
+ }
1833
+
1834
+ @media (max-width: 640px) {
1835
+ input {
1836
+ font-size: var(--salla-autocomplete-input-font-size-mobile, 16px);
1837
+ padding-block: 0.75rem;
1838
+ padding-inline-start: var(--salla-autocomplete-input-padding-start-mobile, 0.875rem);
1839
+ padding-inline-end: var(--salla-autocomplete-input-padding-end-mobile, 2.75rem);
1840
+ min-height: 44px;
1841
+ touch-action: manipulation;
1842
+ }
1843
+
1844
+ input.with-national-icon {
1845
+ padding-inline-start: var(--salla-autocomplete-input-padding-start-icon-mobile, 2rem);
1846
+ background-position: 0.875rem center;
1847
+ }
1848
+
1849
+ input.with-national-icon[dir="rtl"],
1850
+ :host([dir="rtl"]) input.with-national-icon {
1851
+ padding-inline-start: var(--salla-autocomplete-input-padding-start-mobile, 0.875rem);
1852
+ padding-inline-end: var(--salla-autocomplete-input-padding-end-icon-mobile, 2.75rem);
1853
+ background-position: calc(100% - 0.875rem) center;
1854
+ }
1855
+ }
1856
+
1857
+ input:focus {
1858
+ border-color: var(--salla-autocomplete-input-focus-border-color, #3b82f6);
1859
+ box-shadow: var(--salla-autocomplete-input-focus-shadow, 0 0 0 3px rgba(59, 130, 246, 0.1));
1860
+ }
1861
+
1862
+ input:disabled {
1863
+ background-color: var(--salla-autocomplete-input-disabled-bg, #f3f4f6);
1864
+ cursor: not-allowed;
1865
+ }
1866
+
1867
+ input.is-invalid {
1868
+ border-color: var(--salla-autocomplete-input-error-border-color, #dc2626);
1869
+ }
1870
+
1871
+ input.is-invalid:focus {
1872
+ border-color: var(--salla-autocomplete-input-error-border-color, #dc2626);
1873
+ box-shadow: var(--salla-autocomplete-input-error-shadow, 0 0 0 3px rgba(220, 38, 38, 0.1));
1874
+ }
1875
+
1876
+ input::placeholder {
1877
+ color: var(--salla-autocomplete-input-placeholder-color, #9ca3af);
1878
+ }
1879
+
1880
+ .validation-error {
1881
+ display: flex;
1882
+ flex-wrap: wrap;
1883
+ align-items: center;
1884
+ gap: 0.5rem;
1885
+ margin-top: 0.375rem;
1886
+ font-size: var(--salla-autocomplete-error-font-size, 0.875rem);
1887
+ color: var(--salla-autocomplete-error-color, #dc2626);
1888
+ line-height: 1.5;
1889
+ }
1890
+
1891
+ .validation-error > span {
1892
+ line-height: 1.5;
1893
+ }
1894
+
1895
+ .whatsapp-link-inline {
1896
+ color: var(--salla-autocomplete-whatsapp-brand-color, #25D366);
1897
+ white-space: nowrap;
1898
+ line-height: inherit;
1899
+ display: inline-flex;
1900
+ align-items: center;
1901
+ vertical-align: middle;
1902
+ text-decoration: underline;
1903
+ cursor: pointer;
1904
+ transition: all 0.2s ease;
1905
+ gap: 0.25rem;
1906
+ margin-inline: 0.25rem;
1907
+ font-weight: 500;
1908
+ }
1909
+
1910
+ .whatsapp-link-inline:hover {
1911
+ color: var(--salla-autocomplete-whatsapp-brand-hover, #1da851);
1912
+ opacity: 0.9;
1913
+ }
1914
+
1915
+ .whatsapp-link-inline:active {
1916
+ transform: scale(0.98);
1917
+ }
1918
+
1919
+ .whatsapp-link-inline .whatsapp-icon {
1920
+ color: var(--salla-autocomplete-whatsapp-brand-color, #25D366);
1921
+ }
1922
+
1923
+ .help-text {
1924
+ display: block;
1925
+ margin-top: 0.5rem;
1926
+ font-size: var(--salla-autocomplete-help-font-size, 0.875rem);
1927
+ color: var(--salla-autocomplete-help-color, #6b7280);
1928
+ line-height: 1.5;
1929
+ }
1930
+
1931
+ .help-text span {
1932
+ line-height: 1.5;
1933
+ }
1934
+
1935
+ .whatsapp-icon {
1936
+ width: 1rem;
1937
+ height: 1rem;
1938
+ }
1939
+
1940
+ .loading-spinner {
1941
+ position: absolute;
1942
+ inset-inline-end: 0.875rem;
1943
+ top: 50%;
1944
+ transform: translateY(-50%);
1945
+ width: var(--salla-autocomplete-spinner-size, 1.25rem);
1946
+ height: var(--salla-autocomplete-spinner-size, 1.25rem);
1947
+ border: 2px solid var(--salla-autocomplete-spinner-border-color, #e5e7eb);
1948
+ border-top-color: var(--salla-autocomplete-spinner-color, #3b82f6);
1949
+ border-radius: 50%;
1950
+ animation: spin 0.6s linear infinite;
1951
+ }
1952
+
1953
+ @media (max-width: 640px) {
1954
+ .loading-spinner {
1955
+ width: var(--salla-autocomplete-spinner-size-mobile, 1.375rem);
1956
+ height: var(--salla-autocomplete-spinner-size-mobile, 1.375rem);
1957
+ inset-inline-end: 1rem;
1958
+ }
1959
+ }
1960
+
1961
+ @keyframes spin {
1962
+ to { transform: translateY(-50%) rotate(360deg); }
1963
+ }
1964
+
1965
+ /* Custom scrollbar styling */
1966
+ .dropdown::-webkit-scrollbar {
1967
+ width: 6px;
1968
+ }
1969
+
1970
+ .dropdown::-webkit-scrollbar-track {
1971
+ background: #f1f1f1;
1972
+ border-radius: 3px;
1973
+ }
1974
+
1975
+ .dropdown::-webkit-scrollbar-thumb {
1976
+ background: #c1c1c1;
1977
+ border-radius: 3px;
1978
+ }
1979
+
1980
+ .dropdown::-webkit-scrollbar-thumb:hover {
1981
+ background: #a8a8a8;
1982
+ }
1983
+
1984
+ .dropdown {
1985
+ position: absolute;
1986
+ top: 100%;
1987
+ left: 0;
1988
+ right: 0;
1989
+ margin-top: var(--salla-autocomplete-dropdown-margin-top, 0.375rem);
1990
+ background: var(--salla-autocomplete-dropdown-background, white);
1991
+ border: var(--salla-autocomplete-dropdown-border, 1px solid #e5e7eb);
1992
+ border-radius: var(--salla-autocomplete-dropdown-border-radius, 0.5rem);
1993
+ 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));
1994
+ max-height: var(--salla-autocomplete-dropdown-max-height, 240px);
1995
+ overflow-y: auto;
1996
+ overflow-x: hidden;
1997
+ z-index: var(--salla-autocomplete-dropdown-z-index, 100);
1998
+ display: none;
1999
+ -webkit-overflow-scrolling: touch;
2000
+ overscroll-behavior: contain;
2001
+ scroll-behavior: smooth;
2002
+ }
2003
+
2004
+ @media (max-width: 640px) {
2005
+ .dropdown {
2006
+ max-height: var(--salla-autocomplete-dropdown-max-height-mobile, 25vh);
2007
+ border-radius: var(--salla-autocomplete-dropdown-border-radius-mobile, 0.5rem);
2008
+ margin-top: var(--salla-autocomplete-dropdown-margin-top-mobile, 0.25rem);
2009
+ }
2010
+ }
2011
+
2012
+ @media (max-width: 640px) and (max-height: 667px) {
2013
+ /* Smaller phones (iPhone SE, iPhone 8, etc.) */
2014
+ .dropdown {
2015
+ max-height: var(--salla-autocomplete-dropdown-max-height-small, 22vh);
2016
+ }
2017
+ }
2018
+
2019
+ @media (max-width: 640px) and (min-height: 668px) and (max-height: 896px) {
2020
+ /* Standard phones (iPhone 12, iPhone 13, etc.) */
2021
+ .dropdown {
2022
+ max-height: var(--salla-autocomplete-dropdown-max-height-standard, 28vh);
2023
+ }
2024
+ }
2025
+
2026
+ @media (max-width: 640px) and (min-height: 897px) {
2027
+ /* Larger phones (iPhone 14 Pro Max, etc.) */
2028
+ .dropdown {
2029
+ max-height: var(--salla-autocomplete-dropdown-max-height-large, 30vh);
2030
+ }
2031
+ }
2032
+
2033
+ .dropdown.open {
2034
+ display: block;
2035
+ }
2036
+
2037
+ .dropdown-item {
2038
+ display: flex;
2039
+ align-items: flex-start;
2040
+ padding: var(--salla-autocomplete-item-padding, 0.625rem 0.75rem);
2041
+ cursor: pointer;
2042
+ transition: background-color 0.15s;
2043
+ border-bottom: 1px solid var(--salla-autocomplete-item-border-color, #e5e7eb);
2044
+ min-height: 35px;
2045
+ -webkit-tap-highlight-color: transparent;
2046
+ }
2047
+
2048
+ @media (max-width: 640px) {
2049
+ .dropdown-item {
2050
+ padding: var(--salla-autocomplete-item-padding-mobile, 0.75rem 0.875rem);
2051
+ min-height: 35px;
2052
+ }
2053
+ }
2054
+
2055
+ .dropdown-item:last-child {
2056
+ border-bottom: none;
2057
+ }
2058
+
2059
+ .dropdown-item:hover,
2060
+ .dropdown-item.selected {
2061
+ background-color: var(--salla-autocomplete-item-hover-bg, #f9fafb);
2062
+ }
2063
+
2064
+ .dropdown-item.active {
2065
+ background-color: var(--salla-autocomplete-item-active-bg, #eff6ff);
2066
+ }
2067
+
2068
+ @media (hover: none) and (pointer: coarse) {
2069
+ .dropdown-item:hover {
2070
+ background-color: transparent;
2071
+ }
2072
+
2073
+ .dropdown-item:active {
2074
+ background-color: var(--salla-autocomplete-item-active-bg, #eff6ff);
2075
+ }
2076
+ }
2077
+
2078
+ .location-icon {
2079
+ display: none;
2080
+ }
2081
+
2082
+ .place-info {
2083
+ flex: 1;
2084
+ min-width: 0;
2085
+ display: flex;
2086
+ flex-direction: column;
2087
+ gap: 0.25rem;
2088
+ }
2089
+
2090
+ .main-text {
2091
+ font-size: var(--salla-autocomplete-main-text-font-size, 0.875rem);
2092
+ font-weight: var(--salla-autocomplete-main-text-font-weight, 600);
2093
+ color: var(--salla-autocomplete-main-text-color, #111827);
2094
+ line-height: 1.4;
2095
+ word-wrap: break-word;
2096
+ overflow-wrap: break-word;
2097
+ hyphens: auto;
2098
+ }
2099
+
2100
+ @media (max-width: 640px) {
2101
+ .main-text {
2102
+ font-size: var(--salla-autocomplete-main-text-font-size-mobile, 0.9375rem);
2103
+ line-height: 1.3;
2104
+ }
2105
+ }
2106
+
2107
+ .main-text .highlight {
2108
+ font-weight: var(--salla-autocomplete-highlight-font-weight, 700);
2109
+ color: var(--salla-autocomplete-highlight-color, inherit);
2110
+ }
2111
+
2112
+ .national-address-badge {
2113
+ display: inline-flex;
2114
+ align-items: center;
2115
+ font-size: 0.8125rem;
2116
+ line-height: 1;
2117
+ vertical-align: middle;
2118
+ }
2119
+
2120
+ .national-address-icon {
2121
+ width: 11px;
2122
+ height: auto;
2123
+ flex-shrink: 0;
2124
+ display: inline-block;
2125
+ }
2126
+
2127
+ .national-address-text {
2128
+ padding-inline-start: 3px;
2129
+ -webkit-text-fill-color: transparent;
2130
+ background-clip: text;
2131
+ -webkit-background-clip: text;
2132
+ background-image: linear-gradient(135deg, #0052cc, #00b8d9 50%, #36b37e);
2133
+ font-weight: 600;
2134
+ display: inline-block;
2135
+ }
2136
+
2137
+ .national-address-separator {
2138
+ padding-inline: 4px;
2139
+ color: #6b7280;
2140
+ display: inline-block;
2141
+ }
2142
+
2143
+ .secondary-text {
2144
+ font-size: var(--salla-autocomplete-secondary-text-font-size, 0.75rem);
2145
+ color: var(--salla-autocomplete-secondary-text-color, #6b7280);
2146
+ line-height: 1.4;
2147
+ word-wrap: break-word;
2148
+ overflow-wrap: break-word;
2149
+ hyphens: auto;
2150
+ }
2151
+
2152
+ @media (max-width: 640px) {
2153
+ .secondary-text {
2154
+ font-size: var(--salla-autocomplete-secondary-text-font-size-mobile, 0.8125rem);
2155
+ line-height: 1.3;
2156
+ }
2157
+ }
2158
+
2159
+ .error-message {
2160
+ margin-top: 0.5rem;
2161
+ font-size: var(--salla-autocomplete-error-font-size, 0.875rem);
2162
+ color: var(--salla-autocomplete-error-color, #dc2626);
2163
+ }
2164
+
2165
+ .no-results {
2166
+ padding: 1rem;
2167
+ text-align: start;
2168
+ color: var(--salla-autocomplete-no-results-color, #6b7280);
2169
+ font-size: var(--salla-autocomplete-no-results-font-size, 0.875rem);
2170
+ }
2171
+
2172
+ .no-results.error-state {
2173
+ color: var(--salla-autocomplete-error-color, #dc2626);
2174
+ background-color: var(--salla-autocomplete-error-bg, #fef2f2);
2175
+ border-radius: 0.375rem;
2176
+ margin: 0.5rem;
2177
+ padding: 0.875rem;
2178
+ }
2179
+
2180
+ @media (max-width: 640px) {
2181
+ .no-results {
2182
+ padding: 0.875rem;
2183
+ font-size: var(--salla-autocomplete-no-results-font-size-mobile, 0.8125rem);
2184
+ }
2185
+
2186
+ .no-results.error-state {
2187
+ margin: 0.375rem;
2188
+ padding: 0.75rem;
2189
+ }
2190
+ }
2191
+ `;
2192
+ h$1([
2193
+ p({ type: String })
2194
+ ], d$1.prototype, "proxyUrl", 2);
2195
+ h$1([
2196
+ p({ type: String })
2197
+ ], d$1.prototype, "authToken", 2);
2198
+ h$1([
2199
+ p({ type: String })
2200
+ ], d$1.prototype, "placeholder", 2);
2201
+ h$1([
2202
+ p({ type: String })
2203
+ ], d$1.prototype, "defaultPlace", 2);
2204
+ h$1([
2205
+ p({ type: String })
2206
+ ], d$1.prototype, "label", 2);
2207
+ h$1([
2208
+ p({ type: String })
2209
+ ], d$1.prototype, "className", 2);
2210
+ h$1([
2211
+ p({ type: String })
2212
+ ], d$1.prototype, "language", 2);
2213
+ h$1([
2214
+ p({ type: String })
2215
+ ], d$1.prototype, "dir", 2);
2216
+ h$1([
2217
+ p({ type: String })
2218
+ ], d$1.prototype, "mode", 2);
2219
+ h$1([
2220
+ p({ type: String })
2221
+ ], d$1.prototype, "name", 2);
2222
+ h$1([
2223
+ p({ type: Boolean })
2224
+ ], d$1.prototype, "required", 2);
2225
+ h$1([
2226
+ p({ type: String })
2227
+ ], d$1.prototype, "pattern", 2);
2228
+ h$1([
2229
+ p({ type: String })
2230
+ ], d$1.prototype, "tooltip", 2);
2231
+ h$1([
2232
+ p({ type: String })
2233
+ ], d$1.prototype, "selectedId", 2);
2234
+ h$1([
2235
+ p({ type: Array })
2236
+ ], d$1.prototype, "errors", 2);
2237
+ h$1([
2238
+ p({ type: Boolean })
2239
+ ], d$1.prototype, "disabled", 2);
2240
+ h$1([
2241
+ p({ type: String })
2242
+ ], d$1.prototype, "value", 1);
2243
+ h$1([
2244
+ p({ type: String })
2245
+ ], d$1.prototype, "country", 1);
2246
+ h$1([
2247
+ p({ type: Object })
2248
+ ], d$1.prototype, "locationBias", 2);
2249
+ h$1([
2250
+ p({ type: Object })
2251
+ ], d$1.prototype, "locationRestriction", 2);
2252
+ h$1([
2253
+ p({ type: Array })
2254
+ ], d$1.prototype, "types", 2);
2255
+ h$1([
2256
+ p({ type: String })
2257
+ ], d$1.prototype, "fieldsStr", 1);
2258
+ h$1([
2259
+ p({ type: Array })
2260
+ ], d$1.prototype, "fields", 1);
2261
+ h$1([
2262
+ p({ type: Boolean })
2263
+ ], d$1.prototype, "strictBounds", 2);
2264
+ h$1([
2265
+ p({ type: Boolean })
2266
+ ], d$1.prototype, "useSessionToken", 2);
2267
+ h$1([
2268
+ p({ type: Boolean })
2269
+ ], d$1.prototype, "resolve", 2);
2270
+ h$1([
2271
+ p({ type: Function })
2272
+ ], d$1.prototype, "onValidateAddress", 2);
2273
+ h$1([
2274
+ p({ type: Number })
2275
+ ], d$1.prototype, "debounceDelay", 2);
2276
+ h$1([
2277
+ p({ type: Number })
2278
+ ], d$1.prototype, "minChars", 2);
2279
+ h$1([
2280
+ b$1()
2281
+ ], d$1.prototype, "predictions", 2);
2282
+ h$1([
2283
+ b$1()
2284
+ ], d$1.prototype, "isOpen", 2);
2285
+ h$1([
2286
+ b$1()
2287
+ ], d$1.prototype, "isLoading", 2);
2288
+ h$1([
2289
+ b$1()
2290
+ ], d$1.prototype, "error", 2);
2291
+ h$1([
2292
+ b$1()
2293
+ ], d$1.prototype, "activeIndex", 2);
2294
+ h$1([
2295
+ b$1()
2296
+ ], d$1.prototype, "inputValue", 2);
2297
+ h$1([
2298
+ b$1()
2299
+ ], d$1.prototype, "sessionToken", 2);
2300
+ h$1([
2301
+ b$1()
2302
+ ], d$1.prototype, "validationError", 2);
2303
+ h$1([
2304
+ b$1()
2305
+ ], d$1.prototype, "touched", 2);
2306
+ h$1([
2307
+ b$1()
2308
+ ], d$1.prototype, "showNationalAddressIcon", 2);
2309
+ h$1([
2310
+ qe("input")
2311
+ ], d$1.prototype, "inputElement", 2);
2312
+ d$1 = h$1([
2313
+ De("salla-address-autocomplete")
2314
+ ], d$1);
2315
+
2316
+ let K = false;
2317
+ const W = /* @__PURE__ */ new Map();
2318
+ const D = new Promise((t, e) => {
2319
+ if (typeof window > "u") {
2320
+ t();
2321
+ return;
2322
+ }
2323
+ window.googleMapsInitCallback = t, window.gm_authFailure = () => {
2324
+ e(new Error("Google Maps authentication failed"));
2325
+ };
2326
+ });
2327
+ async function st(t) {
2328
+ if (W.has(t))
2329
+ return W.get(t);
2330
+ if (await D, typeof google < "u" && google.maps && google.maps.importLibrary) {
2331
+ const e = await google.maps.importLibrary(t);
2332
+ return W.set(t, e), e;
2333
+ }
2334
+ return google.maps[t] || google.maps;
2335
+ }
2336
+ function ee(t, e, o) {
2337
+ if (typeof document > "u")
2338
+ return Promise.resolve();
2339
+ if (K)
2340
+ return D;
2341
+ K = true;
2342
+ let i;
2343
+ if (typeof t == "string")
2344
+ i = { key: t };
2345
+ else if (typeof t == "object")
2346
+ i = { ...t };
2347
+ else
2348
+ throw new Error("API key should be a string or an object");
2349
+ Array.isArray(i.libraries) && (i.libraries = i.libraries), !e && !i.v && (e = "quarterly"), i.loading || (i.loading = "async"), i.callback = "googleMapsInitCallback";
2350
+ let a = `https://maps.googleapis.com/maps/api/js?${Object.keys(i).map((p) => `${encodeURIComponent(p)}=${encodeURIComponent(i[p])}`).join("&")}`;
2351
+ e && (a += `&v=${e}`);
2352
+ const r = document.createElement("script");
2353
+ return r.src = a, r.async = true, r.defer = true, r.onerror = (p) => {
2354
+ console.error("Failed to load Google Maps script:", p);
2355
+ }, document.body.appendChild(r), D;
2356
+ }
2357
+ const L = (t) => (e, o) => {
2358
+ o !== void 0 ? o.addInitializer(() => {
2359
+ customElements.define(t, e);
2360
+ }) : customElements.define(t, e);
2361
+ };
2362
+ 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();
2363
+ let at = class {
2364
+ constructor(e, o, i) {
2365
+ if (this._$cssResult$ = true, i !== it) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
2366
+ this.cssText = e, this.t = o;
2367
+ }
2368
+ get styleSheet() {
2369
+ let e = this.o;
2370
+ const o = this.t;
2371
+ if (q && e === void 0) {
2372
+ const i = o !== void 0 && o.length === 1;
2373
+ i && (e = J.get(o)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && J.set(o, e));
2374
+ }
2375
+ return e;
2376
+ }
2377
+ toString() {
2378
+ return this.cssText;
2379
+ }
2380
+ };
2381
+ const nt = (t) => new at(typeof t == "string" ? t : t + "", void 0, it), rt = (t, e) => {
2382
+ if (q) t.adoptedStyleSheets = e.map((o) => o instanceof CSSStyleSheet ? o : o.styleSheet);
2383
+ else for (const o of e) {
2384
+ const i = document.createElement("style"), s = j.litNonce;
2385
+ s !== void 0 && i.setAttribute("nonce", s), i.textContent = o.cssText, t.appendChild(i);
2386
+ }
2387
+ }, Y = q ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
2388
+ let o = "";
2389
+ for (const i of e.cssRules) o += i.cssText;
2390
+ return nt(o);
2391
+ })(t) : t;
2392
+ 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) {
2393
+ switch (e) {
2394
+ case Boolean:
2395
+ t = t ? mt : null;
2396
+ break;
2397
+ case Object:
2398
+ case Array:
2399
+ t = t == null ? t : JSON.stringify(t);
2400
+ }
2401
+ return t;
2402
+ }, fromAttribute(t, e) {
2403
+ let o = t;
2404
+ switch (e) {
2405
+ case Boolean:
2406
+ o = t !== null;
2407
+ break;
2408
+ case Number:
2409
+ o = t === null ? null : Number(t);
2410
+ break;
2411
+ case Object:
2412
+ case Array:
2413
+ try {
2414
+ o = JSON.parse(t);
2415
+ } catch {
2416
+ o = null;
2417
+ }
2418
+ }
2419
+ return o;
2420
+ } }, V = (t, e) => !lt(t, e), Q = { attribute: true, type: String, converter: R, reflect: false, useDefault: false, hasChanged: V };
2421
+ Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), G.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
2422
+ class A extends HTMLElement {
2423
+ static addInitializer(e) {
2424
+ this._$Ei(), (this.l ??= []).push(e);
2425
+ }
2426
+ static get observedAttributes() {
2427
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
2428
+ }
2429
+ static createProperty(e, o = Q) {
2430
+ 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) {
2431
+ const i = /* @__PURE__ */ Symbol(), s = this.getPropertyDescriptor(e, i, o);
2432
+ s !== void 0 && ct(this.prototype, e, s);
2433
+ }
2434
+ }
2435
+ static getPropertyDescriptor(e, o, i) {
2436
+ const { get: s, set: a } = pt(this.prototype, e) ?? { get() {
2437
+ return this[o];
2438
+ }, set(r) {
2439
+ this[o] = r;
2440
+ } };
2441
+ return { get: s, set(r) {
2442
+ const p = s?.call(this);
2443
+ a?.call(this, r), this.requestUpdate(e, p, i);
2444
+ }, configurable: true, enumerable: true };
2445
+ }
2446
+ static getPropertyOptions(e) {
2447
+ return this.elementProperties.get(e) ?? Q;
2448
+ }
2449
+ static _$Ei() {
2450
+ if (this.hasOwnProperty(U("elementProperties"))) return;
2451
+ const e = dt(this);
2452
+ e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
2453
+ }
2454
+ static finalize() {
2455
+ if (this.hasOwnProperty(U("finalized"))) return;
2456
+ if (this.finalized = true, this._$Ei(), this.hasOwnProperty(U("properties"))) {
2457
+ const o = this.properties, i = [...ht(o), ...ut(o)];
2458
+ for (const s of i) this.createProperty(s, o[s]);
2459
+ }
2460
+ const e = this[Symbol.metadata];
2461
+ if (e !== null) {
2462
+ const o = litPropertyMetadata.get(e);
2463
+ if (o !== void 0) for (const [i, s] of o) this.elementProperties.set(i, s);
2464
+ }
2465
+ this._$Eh = /* @__PURE__ */ new Map();
2466
+ for (const [o, i] of this.elementProperties) {
2467
+ const s = this._$Eu(o, i);
2468
+ s !== void 0 && this._$Eh.set(s, o);
2469
+ }
2470
+ this.elementStyles = this.finalizeStyles(this.styles);
2471
+ }
2472
+ static finalizeStyles(e) {
2473
+ const o = [];
2474
+ if (Array.isArray(e)) {
2475
+ const i = new Set(e.flat(1 / 0).reverse());
2476
+ for (const s of i) o.unshift(Y(s));
2477
+ } else e !== void 0 && o.push(Y(e));
2478
+ return o;
2479
+ }
2480
+ static _$Eu(e, o) {
2481
+ const i = o.attribute;
2482
+ return i === false ? void 0 : typeof i == "string" ? i : typeof e == "string" ? e.toLowerCase() : void 0;
2483
+ }
2484
+ constructor() {
2485
+ super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
2486
+ }
2487
+ _$Ev() {
2488
+ this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((e) => e(this));
2489
+ }
2490
+ addController(e) {
2491
+ (this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
2492
+ }
2493
+ removeController(e) {
2494
+ this._$EO?.delete(e);
2495
+ }
2496
+ _$E_() {
2497
+ const e = /* @__PURE__ */ new Map(), o = this.constructor.elementProperties;
2498
+ for (const i of o.keys()) this.hasOwnProperty(i) && (e.set(i, this[i]), delete this[i]);
2499
+ e.size > 0 && (this._$Ep = e);
2500
+ }
2501
+ createRenderRoot() {
2502
+ const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
2503
+ return rt(e, this.constructor.elementStyles), e;
2504
+ }
2505
+ connectedCallback() {
2506
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((e) => e.hostConnected?.());
2507
+ }
2508
+ enableUpdating(e) {
2509
+ }
2510
+ disconnectedCallback() {
2511
+ this._$EO?.forEach((e) => e.hostDisconnected?.());
2512
+ }
2513
+ attributeChangedCallback(e, o, i) {
2514
+ this._$AK(e, i);
2515
+ }
2516
+ _$ET(e, o) {
2517
+ const i = this.constructor.elementProperties.get(e), s = this.constructor._$Eu(e, i);
2518
+ if (s !== void 0 && i.reflect === true) {
2519
+ const a = (i.converter?.toAttribute !== void 0 ? i.converter : R).toAttribute(o, i.type);
2520
+ this._$Em = e, a == null ? this.removeAttribute(s) : this.setAttribute(s, a), this._$Em = null;
2521
+ }
2522
+ }
2523
+ _$AK(e, o) {
2524
+ const i = this.constructor, s = i._$Eh.get(e);
2525
+ if (s !== void 0 && this._$Em !== s) {
2526
+ const a = i.getPropertyOptions(s), r = typeof a.converter == "function" ? { fromAttribute: a.converter } : a.converter?.fromAttribute !== void 0 ? a.converter : R;
2527
+ this._$Em = s;
2528
+ const p = r.fromAttribute(o, a.type);
2529
+ this[s] = p ?? this._$Ej?.get(s) ?? p, this._$Em = null;
2530
+ }
2531
+ }
2532
+ requestUpdate(e, o, i, s = false, a) {
2533
+ if (e !== void 0) {
2534
+ const r = this.constructor;
2535
+ 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;
2536
+ this.C(e, o, i);
2537
+ }
2538
+ this.isUpdatePending === false && (this._$ES = this._$EP());
2539
+ }
2540
+ C(e, o, { useDefault: i, reflect: s, wrapped: a }, r) {
2541
+ 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));
2542
+ }
2543
+ async _$EP() {
2544
+ this.isUpdatePending = true;
2545
+ try {
2546
+ await this._$ES;
2547
+ } catch (o) {
2548
+ Promise.reject(o);
2549
+ }
2550
+ const e = this.scheduleUpdate();
2551
+ return e != null && await e, !this.isUpdatePending;
2552
+ }
2553
+ scheduleUpdate() {
2554
+ return this.performUpdate();
2555
+ }
2556
+ performUpdate() {
2557
+ if (!this.isUpdatePending) return;
2558
+ if (!this.hasUpdated) {
2559
+ if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
2560
+ for (const [s, a] of this._$Ep) this[s] = a;
2561
+ this._$Ep = void 0;
2562
+ }
2563
+ const i = this.constructor.elementProperties;
2564
+ if (i.size > 0) for (const [s, a] of i) {
2565
+ const { wrapped: r } = a, p = this[s];
2566
+ r !== true || this._$AL.has(s) || p === void 0 || this.C(s, void 0, a, p);
2567
+ }
2568
+ }
2569
+ let e = false;
2570
+ const o = this._$AL;
2571
+ try {
2572
+ e = this.shouldUpdate(o), e ? (this.willUpdate(o), this._$EO?.forEach((i) => i.hostUpdate?.()), this.update(o)) : this._$EM();
2573
+ } catch (i) {
2574
+ throw e = false, this._$EM(), i;
2575
+ }
2576
+ e && this._$AE(o);
2577
+ }
2578
+ willUpdate(e) {
2579
+ }
2580
+ _$AE(e) {
2581
+ this._$EO?.forEach((o) => o.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(e)), this.updated(e);
2582
+ }
2583
+ _$EM() {
2584
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
2585
+ }
2586
+ get updateComplete() {
2587
+ return this.getUpdateComplete();
2588
+ }
2589
+ getUpdateComplete() {
2590
+ return this._$ES;
2591
+ }
2592
+ shouldUpdate(e) {
2593
+ return true;
2594
+ }
2595
+ update(e) {
2596
+ this._$Eq &&= this._$Eq.forEach((o) => this._$ET(o, this[o])), this._$EM();
2597
+ }
2598
+ updated(e) {
2599
+ }
2600
+ firstUpdated(e) {
2601
+ }
2602
+ }
2603
+ 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");
2604
+ const bt = { attribute: true, type: String, converter: R, reflect: false, hasChanged: V }, yt = (t = bt, e, o) => {
2605
+ const { kind: i, metadata: s } = o;
2606
+ let a = globalThis.litPropertyMetadata.get(s);
2607
+ 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") {
2608
+ const { name: r } = o;
2609
+ return { set(p) {
2610
+ const m = e.get.call(this);
2611
+ e.set.call(this, p), this.requestUpdate(r, m, t, true, p);
2612
+ }, init(p) {
2613
+ return p !== void 0 && this.C(r, void 0, t, p), p;
2614
+ } };
2615
+ }
2616
+ if (i === "setter") {
2617
+ const { name: r } = o;
2618
+ return function(p) {
2619
+ const m = this[r];
2620
+ e.call(this, p), this.requestUpdate(r, m, t, true, p);
2621
+ };
2622
+ }
2623
+ throw Error("Unsupported decorator location: " + i);
2624
+ };
2625
+ function n(t) {
2626
+ return (e, o) => typeof o == "object" ? yt(t, e, o) : ((i, s, a) => {
2627
+ const r = s.hasOwnProperty(a);
2628
+ return s.constructor.createProperty(a, i), r ? Object.getOwnPropertyDescriptor(s, a) : void 0;
2629
+ })(t, e, o);
2630
+ }
2631
+ function h(t) {
2632
+ return n({ ...t, state: true, attribute: false });
2633
+ }
2634
+ const ft = (t, e, o) => (o.configurable = true, o.enumerable = true, Reflect.decorate && typeof e != "object" && Object.defineProperty(t, e, o), o);
2635
+ function F(t, e) {
2636
+ return (o, i, s) => {
2637
+ const a = (r) => r.renderRoot?.querySelector(t) ?? null;
2638
+ return ft(o, i, { get() {
2639
+ return a(this);
2640
+ } });
2641
+ };
2642
+ }
2643
+ function _(t, e, o) {
2644
+ const i = [];
2645
+ return e.forEach((s) => {
2646
+ if (!t || !google || !google.maps || !google.maps.event) return;
2647
+ const a = google.maps.event.addListener(t, s, (r) => {
2648
+ o(s, r);
2649
+ });
2650
+ i.push(() => {
2651
+ a && google.maps.event.removeListener(a);
2652
+ });
2653
+ }), i;
2654
+ }
2655
+ function x(t) {
2656
+ t.forEach((e) => e()), t.length = 0;
2657
+ }
2658
+ function B(t, e, o) {
2659
+ if (!t) return;
2660
+ const i = `set${e.charAt(0).toUpperCase()}${e.slice(1)}`;
2661
+ typeof t[i] == "function" ? t[i](o) : e in t && (t[e] = o);
2662
+ }
2663
+ const vt = {
2664
+ buttonLabel: "Use my current location",
2665
+ errorTitle: "Unable to Access Location",
2666
+ closeButton: "Continue",
2667
+ loading: "Getting your location...",
2668
+ loadingInstructions: "Please allow location access in your browser to continue",
2669
+ timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2670
+ permissionDenied: "Location access was denied. Please enable location services in your browser settings.",
2671
+ positionUnavailable: "Your location is currently unavailable. Please check your device settings.",
2672
+ timeout: "Location request timed out. Please try again.",
2673
+ generalError: "Unable to get your location. Please try entering your address manually.",
2674
+ clickToSelectLocation: "You can also choose your location by clicking on the map"
2675
+ }, wt = {
2676
+ buttonLabel: "استخدم موقعي الحالي",
2677
+ errorTitle: "تعذر الوصول إلى الموقع",
2678
+ closeButton: "متابعة",
2679
+ loading: "جار الحصول على موقعك...",
2680
+ loadingInstructions: "يرجى السماح بالوصول إلى الموقع في المتصفح للمتابعة",
2681
+ timerMessage: "ستختفي هذه الرسالة تلقائياً بعد 7 ثوانٍ أو انقر متابعة",
2682
+ permissionDenied: "تم رفض الوصول إلى الموقع. يرجى تفعيل خدمات الموقع في إعدادات المتصفح.",
2683
+ positionUnavailable: "موقعك غير متاح حالياً. يرجى التحقق من إعدادات جهازك.",
2684
+ timeout: "انتهت مهلة طلب الموقع. يرجى المحاولة مرة أخرى.",
2685
+ generalError: "تعذر الحصول على موقعك. يرجى إدخال عنوانك يدوياً.",
2686
+ clickToSelectLocation: "يمكنك أيضاً اختيار موقعك بالنقر على الخريطة"
2687
+ }, kt = {
2688
+ buttonLabel: "Usar mi ubicación actual",
2689
+ errorTitle: "Error de ubicación",
2690
+ closeButton: "Cerrar",
2691
+ loading: "Obteniendo tu ubicación...",
2692
+ loadingInstructions: "Permite el acceso a la ubicación en tu navegador para continuar",
2693
+ timerMessage: "Este mensaje se ocultará automáticamente en 7 segundos o haz clic en Cerrar",
2694
+ permissionDenied: "Se denegó el acceso a la ubicación. Habilita los servicios de ubicación en la configuración de tu navegador.",
2695
+ positionUnavailable: "Tu ubicación no está disponible actualmente. Verifica la configuración de tu dispositivo.",
2696
+ timeout: "La solicitud de ubicación expiró. Inténtalo de nuevo.",
2697
+ generalError: "No se pudo obtener tu ubicación. Intenta ingresar tu dirección manualmente.",
2698
+ clickToSelectLocation: "Haz clic en el mapa para seleccionar una ubicación"
2699
+ }, Ct = {
2700
+ buttonLabel: "Utiliser ma position actuelle",
2701
+ errorTitle: "Erreur de localisation",
2702
+ closeButton: "Continuer",
2703
+ loading: "Obtention de votre position...",
2704
+ loadingInstructions: "Veuillez autoriser l'accès à la localisation dans votre navigateur pour continuer",
2705
+ timerMessage: "Ce message se masquera automatiquement dans 7 secondes ou cliquez sur Continuer",
2706
+ permissionDenied: "L'accès à la localisation a été refusé. Veuillez activer les services de localisation dans les paramètres de votre navigateur.",
2707
+ positionUnavailable: "Votre position n'est pas disponible actuellement. Veuillez vérifier les paramètres de votre appareil.",
2708
+ timeout: "La demande de localisation a expiré. Veuillez réessayer.",
2709
+ generalError: "Impossible d'obtenir votre position. Veuillez entrer votre adresse manuellement.",
2710
+ clickToSelectLocation: "Vous pouvez également choisir votre position en cliquant sur la carte"
2711
+ }, Et = {
2712
+ buttonLabel: "Meinen aktuellen Standort verwenden",
2713
+ errorTitle: "Standortfehler",
2714
+ closeButton: "Schließen",
2715
+ loading: "Getting your location...",
2716
+ loadingInstructions: "Please allow location access in your browser to continue",
2717
+ timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2718
+ permissionDenied: "Der Zugriff auf den Standort wurde verweigert. Bitte aktivieren Sie die Standortdienste in Ihren Browsereinstellungen.",
2719
+ positionUnavailable: "Ihr Standort ist derzeit nicht verfügbar. Bitte überprüfen Sie Ihre Geräteeinstellungen.",
2720
+ timeout: "Standortanfrage ist abgelaufen. Bitte versuchen Sie es erneut.",
2721
+ generalError: "Ihr Standort konnte nicht abgerufen werden. Bitte geben Sie Ihre Adresse manuell ein.",
2722
+ clickToSelectLocation: "Klicken Sie auf die Karte, um einen Standort auszuwählen"
2723
+ }, Lt = {
2724
+ buttonLabel: "使用我的当前位置",
2725
+ errorTitle: "位置错误",
2726
+ closeButton: "关闭",
2727
+ loading: "Getting your location...",
2728
+ loadingInstructions: "Please allow location access in your browser to continue",
2729
+ timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2730
+ permissionDenied: "位置访问被拒绝。请在浏览器设置中启用位置服务。",
2731
+ positionUnavailable: "您的位置当前不可用。请检查您的设备设置。",
2732
+ timeout: "位置请求超时。请重试。",
2733
+ generalError: "无法获取您的位置。请尝试手动输入地址。",
2734
+ clickToSelectLocation: "点击地图选择位置"
2735
+ }, Mt = {
2736
+ buttonLabel: "現在地を使用",
2737
+ errorTitle: "位置情報エラー",
2738
+ closeButton: "閉じる",
2739
+ loading: "Getting your location...",
2740
+ loadingInstructions: "Please allow location access in your browser to continue",
2741
+ timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2742
+ permissionDenied: "位置情報へのアクセスが拒否されました。ブラウザの設定で位置情報サービスを有効にしてください。",
2743
+ positionUnavailable: "現在位置が利用できません。デバイスの設定を確認してください。",
2744
+ timeout: "位置情報リクエストがタイムアウトしました。もう一度お試しください。",
2745
+ generalError: "位置情報を取得できませんでした。住所を手動で入力してください。",
2746
+ clickToSelectLocation: "地図をクリックして場所を選択"
2747
+ }, St = {
2748
+ buttonLabel: "Usar minha localização atual",
2749
+ errorTitle: "Erro de localização",
2750
+ closeButton: "Fechar",
2751
+ loading: "Getting your location...",
2752
+ loadingInstructions: "Please allow location access in your browser to continue",
2753
+ timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2754
+ permissionDenied: "O acesso à localização foi negado. Ative os serviços de localização nas configurações do navegador.",
2755
+ positionUnavailable: "Sua localização não está disponível no momento. Verifique as configurações do dispositivo.",
2756
+ timeout: "A solicitação de localização expirou. Tente novamente.",
2757
+ generalError: "Não foi possível obter sua localização. Tente inserir seu endereço manualmente.",
2758
+ clickToSelectLocation: "Clique no mapa para selecionar um local"
2759
+ }, _t = {
2760
+ buttonLabel: "Использовать мое текущее местоположение",
2761
+ errorTitle: "Ошибка местоположения",
2762
+ closeButton: "Закрыть",
2763
+ loading: "Getting your location...",
2764
+ loadingInstructions: "Please allow location access in your browser to continue",
2765
+ timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2766
+ permissionDenied: "Доступ к местоположению был запрещен. Включите службы определения местоположения в настройках браузера.",
2767
+ positionUnavailable: "Ваше местоположение в настоящее время недоступно. Проверьте настройки устройства.",
2768
+ timeout: "Время ожидания запроса местоположения истекло. Попробуйте еще раз.",
2769
+ generalError: "Не удалось получить ваше местоположение. Попробуйте ввести адрес вручную.",
2770
+ clickToSelectLocation: "Нажмите на карту, чтобы выбрать местоположение"
2771
+ }, xt = {
2772
+ buttonLabel: "Usa la mia posizione attuale",
2773
+ errorTitle: "Errore di posizione",
2774
+ closeButton: "Chiudi",
2775
+ loading: "Getting your location...",
2776
+ loadingInstructions: "Please allow location access in your browser to continue",
2777
+ timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2778
+ permissionDenied: "L'accesso alla posizione è stato negato. Abilita i servizi di localizzazione nelle impostazioni del browser.",
2779
+ positionUnavailable: "La tua posizione non è attualmente disponibile. Controlla le impostazioni del dispositivo.",
2780
+ timeout: "La richiesta di posizione è scaduta. Riprova.",
2781
+ generalError: "Impossibile ottenere la tua posizione. Prova a inserire manualmente il tuo indirizzo.",
2782
+ clickToSelectLocation: "Fai clic sulla mappa per selezionare una posizione"
2783
+ }, Pt = {
2784
+ buttonLabel: "Gebruik mijn huidige locatie",
2785
+ errorTitle: "Locatiefout",
2786
+ closeButton: "Sluiten",
2787
+ loading: "Getting your location...",
2788
+ loadingInstructions: "Please allow location access in your browser to continue",
2789
+ timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2790
+ permissionDenied: "Toegang tot locatie is geweigerd. Schakel locatieservices in in uw browserinstellingen.",
2791
+ positionUnavailable: "Uw locatie is momenteel niet beschikbaar. Controleer uw apparaatinstellingen.",
2792
+ timeout: "Locatieverzoek is verlopen. Probeer het opnieuw.",
2793
+ generalError: "Kan uw locatie niet ophalen. Probeer uw adres handmatig in te voeren.",
2794
+ clickToSelectLocation: "Klik op de kaart om een locatie te selecteren"
2795
+ }, Ot = {
2796
+ buttonLabel: "Mevcut konumumu kullan",
2797
+ errorTitle: "Konum Hatası",
2798
+ closeButton: "Kapat",
2799
+ loading: "Getting your location...",
2800
+ loadingInstructions: "Please allow location access in your browser to continue",
2801
+ timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2802
+ permissionDenied: "Konum erişimi reddedildi. Lütfen tarayıcı ayarlarınızda konum hizmetlerini etkinleştirin.",
2803
+ positionUnavailable: "Konumunuz şu anda kullanılamıyor. Lütfen cihaz ayarlarınızı kontrol edin.",
2804
+ timeout: "Konum isteği zaman aşımına uğradı. Lütfen tekrar deneyin.",
2805
+ generalError: "Konumunuz alınamadı. Lütfen adresinizi manuel olarak girmeyi deneyin.",
2806
+ clickToSelectLocation: "Bir konum seçmek için haritaya tıklayın"
2807
+ }, $t = {
2808
+ buttonLabel: "현재 위치 사용",
2809
+ errorTitle: "위치 오류",
2810
+ closeButton: "닫기",
2811
+ loading: "Getting your location...",
2812
+ loadingInstructions: "Please allow location access in your browser to continue",
2813
+ timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2814
+ permissionDenied: "위치 액세스가 거부되었습니다. 브라우저 설정에서 위치 서비스를 활성화하십시오.",
2815
+ positionUnavailable: "현재 위치를 사용할 수 없습니다. 기기 설정을 확인하십시오.",
2816
+ timeout: "위치 요청 시간이 초과되었습니다. 다시 시도하십시오.",
2817
+ generalError: "위치를 가져올 수 없습니다. 수동으로 주소를 입력해 보십시오.",
2818
+ clickToSelectLocation: "지도를 클릭하여 위치를 선택하십시오"
2819
+ }, Tt = {
2820
+ buttonLabel: "मेरा वर्तमान स्थान उपयोग करें",
2821
+ errorTitle: "स्थान त्रुटि",
2822
+ closeButton: "बंद करें",
2823
+ loading: "Getting your location...",
2824
+ loadingInstructions: "Please allow location access in your browser to continue",
2825
+ timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2826
+ permissionDenied: "स्थान पहुंच अस्वीकार कर दी गई थी। कृपया अपनी ब्राउज़र सेटिंग में स्थान सेवाएं सक्षम करें।",
2827
+ positionUnavailable: "आपका स्थान वर्तमान में उपलब्ध नहीं है। कृपया अपनी डिवाइस सेटिंग्स जांचें।",
2828
+ timeout: "स्थान अनुरोध समय समाप्त हो गया। कृपया पुनः प्रयास करें।",
2829
+ generalError: "आपका स्थान प्राप्त करने में असमर्थ। कृपया अपना पता मैन्युअल रूप से दर्ज करने का प्रयास करें।",
2830
+ clickToSelectLocation: "स्थान चुनने के लिए मानचित्र पर क्लिक करें"
2831
+ }, Z = {
2832
+ en: vt,
2833
+ ar: wt,
2834
+ es: kt,
2835
+ fr: Ct,
2836
+ de: Et,
2837
+ zh: Lt,
2838
+ ja: Mt,
2839
+ pt: St,
2840
+ ru: _t,
2841
+ it: xt,
2842
+ nl: Pt,
2843
+ tr: Ot,
2844
+ ko: $t,
2845
+ hi: Tt
2846
+ }, zt = /* @__PURE__ */ new Set(["ar", "he", "fa", "ur"]);
2847
+ function tt(t = "en") {
2848
+ return Z[t] || Z.en;
2849
+ }
2850
+ function et(t) {
2851
+ return zt.has(t);
2852
+ }
2853
+ var It = Object.defineProperty, At = Object.getOwnPropertyDescriptor, c = (t, e, o, i) => {
2854
+ for (var s = i > 1 ? void 0 : i ? At(e, o) : e, a = t.length - 1, r; a >= 0; a--)
2855
+ (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
2856
+ return i && s && It(e, o, s), s;
2857
+ };
2858
+ let l = class extends i {
2859
+ constructor() {
2860
+ 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 = {
2861
+ maximumAge: 6e4,
2862
+ timeout: 1e4,
2863
+ enableHighAccuracy: true
2864
+ }, 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;
2865
+ }
2866
+ async connectedCallback() {
2867
+ super.connectedCallback(), et(this.language) && (document.dir = "rtl");
2868
+ }
2869
+ async firstUpdated() {
2870
+ await D, this.createMap();
2871
+ }
2872
+ clearAutocompleteInput() {
2873
+ if (!this.autocompleteElement) return;
2874
+ const t = this.autocompleteElement.shadowRoot?.querySelector("input");
2875
+ t && (t.value = "", this.autocompleteElement.inputValue = "", this.autocompleteElement.value = "");
2876
+ }
2877
+ setupAutocompleteListener() {
2878
+ !this.enableAutocomplete || !this.autocompleteElement || this.autocompleteListenerAttached || (this.autocompleteElement.addEventListener("place-select", ((t) => {
2879
+ const { place: e } = t.detail;
2880
+ if (e?.geometry?.location) {
2881
+ const { lat: o, lng: i } = e.geometry.location;
2882
+ this.setLocation(o, i, 50, true), this.dispatchMapEvent("location_changed", {
2883
+ position: { lat: o, lng: i },
2884
+ accuracy: 50,
2885
+ source: "autocomplete",
2886
+ place: {
2887
+ placeId: e.place_id,
2888
+ formattedAddress: e.formatted_address,
2889
+ addressComponents: e.address_components,
2890
+ name: e.name,
2891
+ types: e.types
2892
+ }
2893
+ }), this.dispatchMapEvent("autocomplete_place_selected", {
2894
+ place: e
2895
+ });
2896
+ }
2897
+ })), this.autocompleteListenerAttached = true);
2898
+ }
2899
+ disconnectedCallback() {
2900
+ super.disconnectedCallback(), this.cleanup();
2901
+ }
2902
+ updated(t) {
2903
+ 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(
2904
+ this.locationMarkerPosition.lat,
2905
+ this.locationMarkerPosition.lng,
2906
+ this.locationMarkerPosition.accuracy
2907
+ ));
2908
+ }
2909
+ createMap() {
2910
+ if (!this.mapElement) return;
2911
+ const t = {
2912
+ center: this.center,
2913
+ zoom: this.zoom,
2914
+ mapId: this.mapId,
2915
+ mapTypeId: this.mapTypeId,
2916
+ heading: this.heading,
2917
+ tilt: this.tilt,
2918
+ gestureHandling: this.gestureHandling,
2919
+ minZoom: this.minZoom,
2920
+ maxZoom: this.maxZoom,
2921
+ disableDefaultUI: this.disableDefaultUI,
2922
+ zoomControl: this.zoomControl,
2923
+ mapTypeControl: this.mapTypeControl,
2924
+ scaleControl: this.scaleControl,
2925
+ streetViewControl: this.streetViewControl,
2926
+ rotateControl: this.rotateControl,
2927
+ fullscreenControl: this.fullscreenControl,
2928
+ disableDoubleClickZoom: true,
2929
+ keyboardShortcuts: false,
2930
+ zoomControlOptions: {
2931
+ position: google.maps.ControlPosition.RIGHT_BOTTOM
2932
+ },
2933
+ ...this.options
2934
+ };
2935
+ this.map = new google.maps.Map(this.mapElement, t);
2936
+ const e = google.maps.event.addListener(this.map, "click", (s) => {
2937
+ if (s.latLng && this.showLocationMarker) {
2938
+ const a = s.latLng.lat(), r = s.latLng.lng();
2939
+ this.setLocation(a, r, 50, false), this.clearAutocompleteInput(), this.dispatchMapEvent("location_changed", {
2940
+ position: { lat: a, lng: r },
2941
+ accuracy: 50,
2942
+ source: "map-click"
2943
+ });
2944
+ }
2945
+ }), o = [
2946
+ "click",
2947
+ "dblclick",
2948
+ "drag",
2949
+ "dragend",
2950
+ "dragstart",
2951
+ "idle",
2952
+ "mousemove",
2953
+ "mouseout",
2954
+ "mouseover",
2955
+ "resize",
2956
+ "rightclick",
2957
+ "tilesloaded"
2958
+ ];
2959
+ this.eventListeners = _(this.map, o, (s, a) => {
2960
+ this.dispatchMapEvent(s, a);
2961
+ }), this.eventListeners.push(() => {
2962
+ e && google.maps.event.removeListener(e);
2963
+ }), ["center", "zoom", "bounds", "mapTypeId"].forEach((s) => {
2964
+ const a = `${s}_changed`, r = google.maps.event.addListener(this.map, a, () => {
2965
+ const p = `get${s.charAt(0).toUpperCase()}${s.slice(1)}`;
2966
+ if (typeof this.map[p] == "function") {
2967
+ const m = this.map[p]();
2968
+ this.dispatchMapEvent(a, m);
2969
+ }
2970
+ });
2971
+ this.eventListeners.push(() => {
2972
+ r && google.maps.event.removeListener(r);
2973
+ });
2974
+ }), this.dispatchEvent(
2975
+ new CustomEvent("gmap-ready", {
2976
+ detail: { map: this.map },
2977
+ bubbles: true,
2978
+ composed: true
2979
+ })
2980
+ ), this.locationMarkerPosition && this.showLocationMarker && this.setLocation(
2981
+ this.locationMarkerPosition.lat,
2982
+ this.locationMarkerPosition.lng,
2983
+ this.locationMarkerPosition.accuracy
2984
+ );
2985
+ }
2986
+ dispatchMapEvent(t, e) {
2987
+ let o = t;
2988
+ t.includes("_changed") ? o = `gmap-${t.replace(/_/g, "-")}` : (t.startsWith("geolocation_") || t.startsWith("location_")) && (o = `gmap-${t.replace(/_/g, "-")}`), this.dispatchEvent(
2989
+ new CustomEvent(o, {
2990
+ detail: e,
2991
+ bubbles: true,
2992
+ composed: true
2993
+ })
2994
+ );
2995
+ }
2996
+ cleanup() {
2997
+ 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;
2998
+ }
2999
+ // Public API methods
3000
+ panBy(t, e) {
3001
+ this.map?.panBy(t, e);
3002
+ }
3003
+ panTo(t) {
3004
+ this.map?.panTo(t);
3005
+ }
3006
+ panToBounds(t) {
3007
+ this.map?.panToBounds(t);
3008
+ }
3009
+ fitBounds(t) {
3010
+ this.map?.fitBounds(t);
3011
+ }
3012
+ resize() {
3013
+ this.map && google.maps.event.trigger(this.map, "resize");
3014
+ }
3015
+ resizePreserveCenter() {
3016
+ if (!this.map) return;
3017
+ const t = this.map.getCenter();
3018
+ google.maps.event.trigger(this.map, "resize"), t && this.map.setCenter(t);
3019
+ }
3020
+ /**
3021
+ * Programmatically set the location marker position
3022
+ * @param lat Latitude
3023
+ * @param lng Longitude
3024
+ * @param accuracy Optional accuracy in meters (default: 50)
3025
+ * @param panTo Optional, pan map to location (default: true)
3026
+ */
3027
+ setLocation(t, e, o = 50, i = true) {
3028
+ if (!this.map) {
3029
+ console.warn("GMapMap: Cannot set location before map is initialized");
3030
+ return;
3031
+ }
3032
+ const s = { lat: t, lng: e };
3033
+ i && this.map.panTo(s), this.showLocationMarker && this.addLocationMarker(s, o), this.dispatchMapEvent("location_changed", {
3034
+ position: s,
3035
+ accuracy: o,
3036
+ source: "programmatic"
3037
+ });
3038
+ }
3039
+ async getCurrentLocation(t = false) {
3040
+ if (!navigator.geolocation) {
3041
+ const i = {
3042
+ code: "NOT_SUPPORTED",
3043
+ message: "Geolocation is not supported by this browser"
3044
+ };
3045
+ throw this.dispatchMapEvent("geolocation_error", i), t || this.showGeolocationError(this.getTranslation("generalError")), new Error("NOT_SUPPORTED");
3046
+ }
3047
+ this.geolocationLoading = true, this.buttonState = "loading", this.dispatchMapEvent("geolocation_loading", { message: "Getting your location..." });
3048
+ const o = t ? null : setTimeout(() => {
3049
+ this.geolocationLoading && (this.showLoadingOverlay = true);
3050
+ }, 150);
3051
+ return new Promise((i, s) => {
3052
+ navigator.geolocation.getCurrentPosition(
3053
+ (a) => {
3054
+ const r = {
3055
+ lat: a.coords.latitude,
3056
+ lng: a.coords.longitude
3057
+ };
3058
+ if (o && clearTimeout(o), this.geolocationLoading = false, this.showLoadingOverlay = false, this.buttonState = "success", setTimeout(() => {
3059
+ this.buttonState = "normal";
3060
+ }, 2e3), this.map) {
3061
+ this.map.panTo(r);
3062
+ const m = a.coords.accuracy;
3063
+ let y = 15;
3064
+ 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();
3065
+ }
3066
+ const p = {
3067
+ position: r,
3068
+ accuracy: a.coords.accuracy,
3069
+ altitude: a.coords.altitude,
3070
+ altitudeAccuracy: a.coords.altitudeAccuracy,
3071
+ heading: a.coords.heading,
3072
+ speed: a.coords.speed,
3073
+ timestamp: a.timestamp
3074
+ };
3075
+ this.dispatchMapEvent("geolocation_success", p), this.dispatchMapEvent("location_changed", {
3076
+ position: r,
3077
+ accuracy: a.coords.accuracy,
3078
+ source: "geolocation"
3079
+ }), i(r);
3080
+ },
3081
+ (a) => {
3082
+ o && clearTimeout(o), this.geolocationLoading = false, this.showLoadingOverlay = false, this.buttonState = "error", setTimeout(() => {
3083
+ this.buttonState = "normal";
3084
+ }, 2e3);
3085
+ let r = "GENERAL_ERROR", p = this.getTranslation("generalError");
3086
+ 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"));
3087
+ const m = {
3088
+ code: r,
3089
+ message: p,
3090
+ error: a
3091
+ };
3092
+ this.dispatchMapEvent("geolocation_error", m), t || this.showGeolocationError(p), s(a);
3093
+ },
3094
+ this.geolocationOptions
3095
+ );
3096
+ });
3097
+ }
3098
+ handleGeolocationClick() {
3099
+ this.geolocationError = null, this.getCurrentLocation();
3100
+ }
3101
+ async addLocationMarker(t, e) {
3102
+ if (this.map) {
3103
+ if (this.locationMarker && (this.locationMarker.map = null, this.locationMarker = void 0), this.locationCircle && (this.locationCircle.setMap(null), this.locationCircle = void 0), !this.mapId) {
3104
+ console.warn(
3105
+ "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"
3106
+ );
3107
+ return;
3108
+ }
3109
+ try {
3110
+ const { AdvancedMarkerElement: o, PinElement: i } = await google.maps.importLibrary("marker"), s = new i({
3111
+ background: this.locationMarkerBackground,
3112
+ borderColor: this.locationMarkerBorderColor,
3113
+ glyphColor: this.locationMarkerGlyphColor,
3114
+ scale: this.locationMarkerScale
3115
+ });
3116
+ this.locationMarker = new o({
3117
+ map: this.map,
3118
+ position: t,
3119
+ title: "Your Location (Drag to adjust)",
3120
+ content: s.element,
3121
+ gmpDraggable: true
3122
+ }), this.locationMarker.addListener("dragend", () => {
3123
+ if (this.locationMarker && this.locationCircle) {
3124
+ const a = this.locationMarker.position, r = a.toJSON ? a.toJSON() : { lat: a.lat(), lng: a.lng() };
3125
+ this.locationCircle.setCenter(r);
3126
+ const p = this.locationCircle.getRadius();
3127
+ this.clearAutocompleteInput(), this.dispatchMapEvent("location_marker_dragend", {
3128
+ position: r,
3129
+ accuracy: p
3130
+ }), this.dispatchMapEvent("location_changed", {
3131
+ position: r,
3132
+ accuracy: p,
3133
+ source: "marker-drag"
3134
+ });
3135
+ }
3136
+ });
3137
+ } catch (o) {
3138
+ console.error("Error creating AdvancedMarkerElement:", o);
3139
+ }
3140
+ this.locationCircle = new google.maps.Circle({
3141
+ map: this.map,
3142
+ center: t,
3143
+ radius: e,
3144
+ fillColor: "#4285F4",
3145
+ fillOpacity: 0.15,
3146
+ strokeColor: "#4285F4",
3147
+ strokeOpacity: 0.4,
3148
+ strokeWeight: 1,
3149
+ clickable: false,
3150
+ ...this.locationCircleOptions
3151
+ // Allow customization
3152
+ });
3153
+ }
3154
+ }
3155
+ showGeolocationError(t) {
3156
+ this.geolocationError = t, setTimeout(() => {
3157
+ this.geolocationError = null;
3158
+ }, 7e3);
3159
+ }
3160
+ getTranslation(t) {
3161
+ const o = {
3162
+ loading: this.geolocationLoadingTitle,
3163
+ loadingInstructions: this.geolocationLoadingInstructions,
3164
+ errorTitle: this.geolocationErrorTitle,
3165
+ closeButton: this.geolocationErrorButtonText,
3166
+ timerMessage: this.geolocationErrorTimerMessage,
3167
+ clickToSelectLocation: this.geolocationClickToSelectMessage,
3168
+ generalError: this.geolocationGeneralErrorMessage,
3169
+ permissionDenied: this.geolocationPermissionDeniedMessage,
3170
+ positionUnavailable: this.geolocationPositionUnavailableMessage,
3171
+ timeout: this.geolocationTimeoutMessage
3172
+ }[t];
3173
+ if (o != null && o !== "")
3174
+ return o;
3175
+ const i = tt(this.language);
3176
+ return i[t] || i.generalError;
3177
+ }
3178
+ get buttonLabel() {
3179
+ return this.geolocationButtonLabel !== void 0 ? this.geolocationButtonLabel : tt(this.language).buttonLabel || "";
3180
+ }
3181
+ getButtonIconColor() {
3182
+ switch (this.buttonState) {
3183
+ case "loading":
3184
+ return "#999";
3185
+ // Gray while loading
3186
+ case "success":
3187
+ return "#4285F4";
3188
+ // Blue on success
3189
+ case "error":
3190
+ return "#EA4335";
3191
+ default:
3192
+ return "#666";
3193
+ }
3194
+ }
3195
+ getMap() {
3196
+ return this.map;
3197
+ }
3198
+ render() {
3199
+ const t = et(this.language) ? "rtl" : "ltr";
3200
+ return b$2`
3201
+ <div class="map-page-wrapper">
3202
+ ${this.enableAutocomplete ? b$2`
3203
+ <div class="auto-complete-map-wrapper">
3204
+ <div class="auto-complete-map-box" dir="${t}">
3205
+ <salla-address-autocomplete
3206
+ .proxyUrl=${this.autocompleteProxyUrl}
3207
+ .authToken=${this.autocompleteAuthToken || null}
3208
+ .placeholder=${this.autocompletePlaceholder || ""}
3209
+ .label=${this.autocompleteLabel || null}
3210
+ .language=${this.language}
3211
+ .country=${this.autocompleteCountry || null}
3212
+ .locationBias=${this.autocompleteLocationBias || null}
3213
+ .locationRestriction=${this.autocompleteLocationRestriction || null}
3214
+ .types=${this.autocompleteTypes ? this.autocompleteTypes.split(",").map((e) => e.trim()) : null}
3215
+ .fieldsStr=${this.autocompleteFields || null}
3216
+ .strictBounds=${this.autocompleteStrictBounds}
3217
+ .resolve=${this.autocompleteResolve}
3218
+ .debounceDelay=${this.autocompleteDebounceDelay}
3219
+ .minChars=${this.autocompleteMinChars}
3220
+ ></salla-address-autocomplete>
3221
+ ${this.autocompleteHint ? b$2`<span class="hint-wrapper">${this.autocompleteHint}</span>` : ""}
3222
+ </div>
3223
+ </div>
3224
+ ` : ""}
3225
+
3226
+ <div class="map-container">
3227
+ <div class="map"></div>
3228
+ <slot></slot>
3229
+
3230
+ ${this.enableGeolocation ? b$2`
3231
+ <div class="controls-overlay">
3232
+ <button
3233
+ class="geolocation-button ${this.buttonLabel && this.buttonLabel.trim() ? "has-label" : ""}"
3234
+ @click=${this.handleGeolocationClick}
3235
+ title="Show your location"
3236
+ ?disabled=${this.geolocationLoading}
3237
+ >
3238
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="${this.getButtonIconColor()}">
3239
+ <path
3240
+ 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"
3241
+ />
3242
+ </svg>
3243
+ ${this.buttonLabel && this.buttonLabel.trim() ? b$2`<span class="label">${this.buttonLabel}</span>` : ""}
3244
+ </button>
3245
+ </div>
3246
+ ` : ""}
3247
+
3248
+ ${this.showLoadingOverlay && !this.geolocationError ? b$2`
3249
+ <div class="loading-overlay">
3250
+ <div class="spinner"></div>
3251
+ <div class="title">
3252
+ ${this.getTranslation("loading")}
3253
+ </div>
3254
+ <div class="instructions">
3255
+ ${this.getTranslation("loadingInstructions")}
3256
+ </div>
3257
+ </div>
3258
+ ` : ""}
3259
+
3260
+ ${this.geolocationError && !this.showLoadingOverlay ? b$2`
3261
+ <div class="error-overlay">
3262
+ <div class="error-icon">
3263
+ <svg width="40" height="40" viewBox="0 0 24 24" fill="none">
3264
+ <circle cx="12" cy="12" r="10" stroke="#ef4444" stroke-width="2" fill="none"/>
3265
+ <path d="M12 8v4M12 16h.01" stroke="#ef4444" stroke-width="2" stroke-linecap="round"/>
3266
+ </svg>
3267
+ </div>
3268
+ <div class="error-title">
3269
+ ${this.getTranslation("errorTitle")}
3270
+ </div>
3271
+ <div class="error-message">${this.geolocationError}</div>
3272
+ <div class="map-hint">
3273
+ ${this.getTranslation("clickToSelectLocation")}
3274
+ </div>
3275
+ <div class="timer-message">
3276
+ ${this.getTranslation("timerMessage")}
3277
+ </div>
3278
+ <button @click=${() => this.geolocationError = null}>
3279
+ ${this.getTranslation("closeButton")}
3280
+ </button>
3281
+ </div>
3282
+ ` : ""}
3283
+ </div>
3284
+ </div>
3285
+ `;
3286
+ }
3287
+ };
3288
+ l.styles = i$3`
3289
+ :host {
3290
+ display: block;
3291
+ position: relative;
3292
+ width: 100%;
3293
+ height: 400px;
3294
+ }
3295
+
3296
+ @media (max-width: 640px) {
3297
+ :host {
3298
+ height: 65vh;
3299
+ min-height: 300px;
3300
+ }
3301
+ }
3302
+
3303
+ @media (max-width: 640px) and (min-height: 700px) {
3304
+ :host {
3305
+ height: 65vh;
3306
+ }
3307
+ }
3308
+
3309
+ .map-container {
3310
+ width: 100%;
3311
+ height: 100%;
3312
+ position: relative;
3313
+ }
3314
+
3315
+ .map {
3316
+ width: 100%;
3317
+ height: 100%;
3318
+ }
3319
+
3320
+ .controls-overlay {
3321
+ position: absolute;
3322
+ top: 0;
3323
+ left: 0;
3324
+ right: 0;
3325
+ bottom: 0;
3326
+ pointer-events: none;
3327
+ z-index: 40;
3328
+ }
3329
+
3330
+ .controls-overlay > * {
3331
+ pointer-events: auto;
3332
+ }
3333
+
3334
+ .geolocation-button {
3335
+ position: absolute;
3336
+ bottom: 23px;
3337
+ left: 10px;
3338
+ right: auto;
3339
+ background: #fff;
3340
+ border: none;
3341
+ border-radius: 2px;
3342
+ box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;
3343
+ cursor: pointer;
3344
+ padding: 10px;
3345
+ height: 40px;
3346
+ display: flex;
3347
+ align-items: center;
3348
+ justify-content: center;
3349
+ gap: 8px;
3350
+ outline: none;
3351
+ color: rgb(86, 86, 86);
3352
+ font-family: var(--gmap-font-family, Roboto, Arial, sans-serif);
3353
+ font-size: 14px;
3354
+ white-space: nowrap;
3355
+ }
3356
+
3357
+ @media (max-width: 640px) {
3358
+ .geolocation-button {
3359
+ bottom: 23px;
3360
+ left: 10px;
3361
+ right: auto;
3362
+ }
3363
+
3364
+ .geolocation-button .label {
3365
+ display: none;
3366
+ }
3367
+
3368
+ .geolocation-button {
3369
+ width: 40px !important;
3370
+ padding: 10px !important;
3371
+ }
3372
+ }
3373
+
3374
+ .geolocation-button.has-label {
3375
+ width: auto;
3376
+ padding: 8px 12px;
3377
+ }
3378
+
3379
+ .geolocation-button:not(.has-label) {
3380
+ width: 40px;
3381
+ }
3382
+
3383
+ .geolocation-button:hover:not(:disabled) {
3384
+ background: #ebebeb;
3385
+ }
3386
+
3387
+ .geolocation-button:disabled {
3388
+ cursor: wait;
3389
+ opacity: 0.6;
3390
+ }
3391
+
3392
+ .geolocation-button svg {
3393
+ flex-shrink: 0;
3394
+ }
3395
+
3396
+ .geolocation-button .label {
3397
+ font-weight: 500;
3398
+ }
3399
+
3400
+ .loading-overlay {
3401
+ position: absolute;
3402
+ top: 0;
3403
+ left: 0;
3404
+ right: 0;
3405
+ bottom: 0;
3406
+ background: rgba(0, 0, 0, 0.7);
3407
+ z-index: 200;
3408
+ display: flex;
3409
+ flex-direction: column;
3410
+ align-items: center;
3411
+ justify-content: center;
3412
+ gap: 16px;
3413
+ padding: 16px;
3414
+ font-family: var(--gmap-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
3415
+ }
3416
+
3417
+ .loading-overlay .spinner {
3418
+ width: 48px;
3419
+ height: 48px;
3420
+ border: 4px solid rgba(255, 255, 255, 0.3);
3421
+ border-top-color: #ffffff;
3422
+ border-radius: 50%;
3423
+ animation: spin 1s linear infinite;
3424
+ }
3425
+
3426
+ @keyframes spin {
3427
+ to { transform: rotate(360deg); }
3428
+ }
3429
+
3430
+ .loading-overlay .title {
3431
+ font-size: 18px;
3432
+ font-weight: 600;
3433
+ color: #ffffff;
3434
+ margin: 0;
3435
+ text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
3436
+ }
3437
+
3438
+ .loading-overlay .instructions {
3439
+ font-size: 14px;
3440
+ color: #ffffff;
3441
+ line-height: 1.5;
3442
+ margin: 0;
3443
+ text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
3444
+ text-align: center;
3445
+ max-width: 90%;
3446
+ }
3447
+
3448
+ .error-overlay {
3449
+ position: absolute;
3450
+ top: 0;
3451
+ left: 0;
3452
+ right: 0;
3453
+ bottom: 0;
3454
+ background: rgba(0, 0, 0, 0.7);
3455
+ z-index: 200;
3456
+ display: flex;
3457
+ flex-direction: column;
3458
+ align-items: center;
3459
+ justify-content: center;
3460
+ gap: 12px;
3461
+ padding: 16px;
3462
+ font-family: var(--gmap-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
3463
+ }
3464
+
3465
+ .error-overlay .error-icon svg {
3466
+ display: block;
3467
+ }
3468
+
3469
+ .error-overlay .error-title {
3470
+ font-size: 17px;
3471
+ font-weight: 600;
3472
+ color: #ef4444;
3473
+ margin: 0;
3474
+ text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
3475
+ }
3476
+
3477
+ .error-overlay .error-message {
3478
+ font-size: 14px;
3479
+ color: #ffffff;
3480
+ line-height: 1.4;
3481
+ margin: 0;
3482
+ text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
3483
+ text-align: center;
3484
+ max-width: 90%;
3485
+ }
3486
+
3487
+ .error-overlay .map-hint {
3488
+ font-size: 12px;
3489
+ color: #d4d4d4;
3490
+ line-height: 1.4;
3491
+ margin: 0;
3492
+ text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
3493
+ text-align: center;
3494
+ font-style: italic;
3495
+ }
3496
+
3497
+ .error-overlay .timer-message {
3498
+ font-size: 12px;
3499
+ color: #d4d4d4;
3500
+ margin: 0;
3501
+ text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
3502
+ }
3503
+
3504
+ .error-overlay button {
3505
+ margin-top: 4px;
3506
+ padding: 8px 24px;
3507
+ background: #ffffff;
3508
+ color: #18181b;
3509
+ border: none;
3510
+ border-radius: 8px;
3511
+ font-size: 14px;
3512
+ font-weight: 600;
3513
+ cursor: pointer;
3514
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
3515
+ }
3516
+
3517
+ .error-overlay button:hover {
3518
+ background: #f4f4f5;
3519
+ }
3520
+
3521
+ .map-page-wrapper {
3522
+ position: relative;
3523
+ width: 100%;
3524
+ height: 100%;
3525
+ }
3526
+
3527
+ .auto-complete-map-wrapper {
3528
+ position: absolute;
3529
+ z-index: 50;
3530
+ padding: 1rem;
3531
+ width: 100%;
3532
+ top: 0;
3533
+ left: 0;
3534
+ right: 0;
3535
+ pointer-events: none;
3536
+ box-sizing: border-box;
3537
+ }
3538
+
3539
+ @media (max-width: 640px) {
3540
+ .auto-complete-map-wrapper {
3541
+ padding: 0.75rem 0.5rem;
3542
+ }
3543
+ }
3544
+
3545
+ .auto-complete-map-wrapper > * {
3546
+ pointer-events: auto;
3547
+ }
3548
+
3549
+ .auto-complete-map-box {
3550
+ width: 100%;
3551
+ display: flex;
3552
+ flex-direction: column;
3553
+ padding: 1rem;
3554
+ background-color: #ffffffb2;
3555
+ border-radius: 8px;
3556
+ backdrop-filter: blur(4px);
3557
+ box-sizing: border-box;
3558
+ }
3559
+
3560
+ @media (max-width: 640px) {
3561
+ .auto-complete-map-box {
3562
+ padding: 0.75rem;
3563
+ }
3564
+ }
3565
+
3566
+ .auto-complete-map-box .hint-wrapper {
3567
+ font-size: 12px;
3568
+ color: #666666;
3569
+ margin-top: 0.5rem;
3570
+ text-align: start;
3571
+ direction: inherit;
3572
+ }
3573
+ `;
3574
+ c([
3575
+ n({ type: Object })
3576
+ ], l.prototype, "center", 2);
3577
+ c([
3578
+ n({ type: Number })
3579
+ ], l.prototype, "zoom", 2);
3580
+ c([
3581
+ n({ type: String, attribute: "map-id" })
3582
+ ], l.prototype, "mapId", 2);
3583
+ c([
3584
+ n({ type: String, attribute: "map-type-id" })
3585
+ ], l.prototype, "mapTypeId", 2);
3586
+ c([
3587
+ n({ type: Number })
3588
+ ], l.prototype, "heading", 2);
3589
+ c([
3590
+ n({ type: Number })
3591
+ ], l.prototype, "tilt", 2);
3592
+ c([
3593
+ n({ type: Object })
3594
+ ], l.prototype, "bounds", 2);
3595
+ c([
3596
+ n({ type: String })
3597
+ ], l.prototype, "gestureHandling", 2);
3598
+ c([
3599
+ n({ type: Number })
3600
+ ], l.prototype, "minZoom", 2);
3601
+ c([
3602
+ n({ type: Number })
3603
+ ], l.prototype, "maxZoom", 2);
3604
+ c([
3605
+ n({ type: Boolean })
3606
+ ], l.prototype, "disableDefaultUI", 2);
3607
+ c([
3608
+ n({ type: Boolean })
3609
+ ], l.prototype, "zoomControl", 2);
3610
+ c([
3611
+ n({ type: Boolean })
3612
+ ], l.prototype, "mapTypeControl", 2);
3613
+ c([
3614
+ n({ type: Boolean })
3615
+ ], l.prototype, "scaleControl", 2);
3616
+ c([
3617
+ n({ type: Boolean })
3618
+ ], l.prototype, "streetViewControl", 2);
3619
+ c([
3620
+ n({ type: Boolean })
3621
+ ], l.prototype, "rotateControl", 2);
3622
+ c([
3623
+ n({ type: Boolean })
3624
+ ], l.prototype, "fullscreenControl", 2);
3625
+ c([
3626
+ n({ type: Boolean, attribute: "enable-geolocation" })
3627
+ ], l.prototype, "enableGeolocation", 2);
3628
+ c([
3629
+ n({ type: Boolean, attribute: "show-location-marker" })
3630
+ ], l.prototype, "showLocationMarker", 2);
3631
+ c([
3632
+ n({ type: Object })
3633
+ ], l.prototype, "geolocationOptions", 2);
3634
+ c([
3635
+ n({ type: Object, attribute: "location-marker-position" })
3636
+ ], l.prototype, "locationMarkerPosition", 2);
3637
+ c([
3638
+ n({ type: String, attribute: "location-marker-background" })
3639
+ ], l.prototype, "locationMarkerBackground", 2);
3640
+ c([
3641
+ n({ type: String, attribute: "location-marker-border-color" })
3642
+ ], l.prototype, "locationMarkerBorderColor", 2);
3643
+ c([
3644
+ n({ type: String, attribute: "location-marker-glyph-color" })
3645
+ ], l.prototype, "locationMarkerGlyphColor", 2);
3646
+ c([
3647
+ n({ type: Number, attribute: "location-marker-scale" })
3648
+ ], l.prototype, "locationMarkerScale", 2);
3649
+ c([
3650
+ n({ type: Object, attribute: "location-circle-options" })
3651
+ ], l.prototype, "locationCircleOptions", 2);
3652
+ c([
3653
+ n({ type: String })
3654
+ ], l.prototype, "language", 2);
3655
+ c([
3656
+ n({ type: Object })
3657
+ ], l.prototype, "options", 2);
3658
+ c([
3659
+ n({ type: String, attribute: "geolocation-button-label" })
3660
+ ], l.prototype, "geolocationButtonLabel", 2);
3661
+ c([
3662
+ n({ type: String, attribute: "geolocation-loading-title" })
3663
+ ], l.prototype, "geolocationLoadingTitle", 2);
3664
+ c([
3665
+ n({ type: String, attribute: "geolocation-loading-instructions" })
3666
+ ], l.prototype, "geolocationLoadingInstructions", 2);
3667
+ c([
3668
+ n({ type: String, attribute: "geolocation-error-title" })
3669
+ ], l.prototype, "geolocationErrorTitle", 2);
3670
+ c([
3671
+ n({ type: String, attribute: "geolocation-error-button-text" })
3672
+ ], l.prototype, "geolocationErrorButtonText", 2);
3673
+ c([
3674
+ n({ type: String, attribute: "geolocation-error-timer-message" })
3675
+ ], l.prototype, "geolocationErrorTimerMessage", 2);
3676
+ c([
3677
+ n({ type: String, attribute: "geolocation-click-to-select-message" })
3678
+ ], l.prototype, "geolocationClickToSelectMessage", 2);
3679
+ c([
3680
+ n({ type: String, attribute: "geolocation-permission-denied-message" })
3681
+ ], l.prototype, "geolocationPermissionDeniedMessage", 2);
3682
+ c([
3683
+ n({ type: String, attribute: "geolocation-position-unavailable-message" })
3684
+ ], l.prototype, "geolocationPositionUnavailableMessage", 2);
3685
+ c([
3686
+ n({ type: String, attribute: "geolocation-timeout-message" })
3687
+ ], l.prototype, "geolocationTimeoutMessage", 2);
3688
+ c([
3689
+ n({ type: String, attribute: "geolocation-general-error-message" })
3690
+ ], l.prototype, "geolocationGeneralErrorMessage", 2);
3691
+ c([
3692
+ n({ type: Boolean, attribute: "enable-autocomplete" })
3693
+ ], l.prototype, "enableAutocomplete", 2);
3694
+ c([
3695
+ n({ type: String, attribute: "autocomplete-hint" })
3696
+ ], l.prototype, "autocompleteHint", 2);
3697
+ c([
3698
+ n({ type: String, attribute: "autocomplete-proxy-url" })
3699
+ ], l.prototype, "autocompleteProxyUrl", 2);
3700
+ c([
3701
+ n({ type: String, attribute: "autocomplete-auth-token" })
3702
+ ], l.prototype, "autocompleteAuthToken", 2);
3703
+ c([
3704
+ n({ type: String, attribute: "autocomplete-placeholder" })
3705
+ ], l.prototype, "autocompletePlaceholder", 2);
3706
+ c([
3707
+ n({ type: String, attribute: "autocomplete-label" })
3708
+ ], l.prototype, "autocompleteLabel", 2);
3709
+ c([
3710
+ n({ type: String, attribute: "autocomplete-country" })
3711
+ ], l.prototype, "autocompleteCountry", 2);
3712
+ c([
3713
+ n({ type: Object, attribute: "autocomplete-location-bias" })
3714
+ ], l.prototype, "autocompleteLocationBias", 2);
3715
+ c([
3716
+ n({ type: Object, attribute: "autocomplete-location-restriction" })
3717
+ ], l.prototype, "autocompleteLocationRestriction", 2);
3718
+ c([
3719
+ n({ type: String, attribute: "autocomplete-types" })
3720
+ ], l.prototype, "autocompleteTypes", 2);
3721
+ c([
3722
+ n({ type: String, attribute: "autocomplete-fields" })
3723
+ ], l.prototype, "autocompleteFields", 2);
3724
+ c([
3725
+ n({ type: Boolean, attribute: "autocomplete-strict-bounds" })
3726
+ ], l.prototype, "autocompleteStrictBounds", 2);
3727
+ c([
3728
+ n({ type: Boolean, attribute: "autocomplete-resolve" })
3729
+ ], l.prototype, "autocompleteResolve", 2);
3730
+ c([
3731
+ n({ type: Number, attribute: "autocomplete-debounce-delay" })
3732
+ ], l.prototype, "autocompleteDebounceDelay", 2);
3733
+ c([
3734
+ n({ type: Number, attribute: "autocomplete-min-chars" })
3735
+ ], l.prototype, "autocompleteMinChars", 2);
3736
+ c([
3737
+ F(".map")
3738
+ ], l.prototype, "mapElement", 2);
3739
+ c([
3740
+ F("salla-address-autocomplete")
3741
+ ], l.prototype, "autocompleteElement", 2);
3742
+ c([
3743
+ h()
3744
+ ], l.prototype, "geolocationLoading", 2);
3745
+ c([
3746
+ h()
3747
+ ], l.prototype, "geolocationError", 2);
3748
+ c([
3749
+ h()
3750
+ ], l.prototype, "showLoadingOverlay", 2);
3751
+ c([
3752
+ h()
3753
+ ], l.prototype, "buttonState", 2);
3754
+ l = c([
3755
+ L("gmap-map")
3756
+ ], l);
3757
+ var Bt = Object.defineProperty, Ut = Object.getOwnPropertyDescriptor, d = (t, e, o, i) => {
3758
+ for (var s = i > 1 ? void 0 : i ? Ut(e, o) : e, a = t.length - 1, r; a >= 0; a--)
3759
+ (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
3760
+ return i && s && Bt(e, o, s), s;
3761
+ };
3762
+ let u = class extends i {
3763
+ constructor() {
3764
+ super(...arguments), this.title = "", this.gmpDraggable = false, this.gmpClickable = true, this.scale = 1, this.draggable = false, this.clickable = true, this.eventListeners = [];
3765
+ }
3766
+ async connectedCallback() {
3767
+ super.connectedCallback(), await this.initMarker();
3768
+ }
3769
+ disconnectedCallback() {
3770
+ super.disconnectedCallback(), this.cleanup();
3771
+ }
3772
+ async updated(t) {
3773
+ 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());
3774
+ }
3775
+ async initMarker() {
3776
+ this.addEventListener("gmap-ready", ((e) => {
3777
+ this.map = e.detail.map, this.createMarker();
3778
+ }));
3779
+ const t = this.closest("gmap-map");
3780
+ t?.getMap && (this.map = t.getMap(), this.map && await this.createMarker());
3781
+ }
3782
+ async createMarker() {
3783
+ if (!this.map) {
3784
+ console.error("GMapMarker: No map found. Make sure the marker is inside a <gmap-map> element.");
3785
+ return;
3786
+ }
3787
+ if (!this.map.get?.("mapId")) {
3788
+ console.error(
3789
+ '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'
3790
+ );
3791
+ return;
3792
+ }
3793
+ this.markerLibrary = await st("marker");
3794
+ const { AdvancedMarkerElement: e, PinElement: o } = this.markerLibrary, i = this.gmpDraggable || this.draggable, s = this.gmpClickable !== false && this.clickable !== false, a = {
3795
+ map: this.map,
3796
+ position: this.normalizePosition(this.position),
3797
+ title: this.title,
3798
+ gmpDraggable: i,
3799
+ gmpClickable: s
3800
+ };
3801
+ if (this.zIndex !== void 0 && (a.zIndex = this.zIndex), this.content)
3802
+ if (typeof this.content == "string") {
3803
+ const p = document.createElement("div");
3804
+ p.innerHTML = this.content, a.content = p;
3805
+ } else
3806
+ a.content = this.content;
3807
+ else if (this.icon) {
3808
+ const p = document.createElement("img");
3809
+ p.src = this.icon, p.style.width = "32px", p.style.height = "32px", a.content = p;
3810
+ } else {
3811
+ const p = {
3812
+ scale: this.scale || 1
3813
+ };
3814
+ 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);
3815
+ }
3816
+ this.marker = new e(a);
3817
+ const r = ["click", "drag", "dragstart", "dragend", "gmp-click"];
3818
+ this.eventListeners = _(this.marker, r, (p, m) => {
3819
+ if (p === "dragend" && this.marker && this.marker.position) {
3820
+ const y = this.marker.position, H = y.toJSON ? y.toJSON() : { lat: y.lat(), lng: y.lng() };
3821
+ this.dispatchEvent(
3822
+ new CustomEvent("dragend", {
3823
+ detail: { latLng: H },
3824
+ bubbles: true,
3825
+ composed: true
3826
+ })
3827
+ ), this.dispatchEvent(
3828
+ new CustomEvent("gmap-position-changed", {
3829
+ detail: H,
3830
+ bubbles: true,
3831
+ composed: true
3832
+ })
3833
+ );
3834
+ } else
3835
+ this.dispatchEvent(
3836
+ new CustomEvent(p, {
3837
+ detail: m,
3838
+ bubbles: true,
3839
+ composed: true
3840
+ })
3841
+ );
3842
+ }), this.dispatchEvent(
3843
+ new CustomEvent("gmap-marker-ready", {
3844
+ detail: { marker: this.marker },
3845
+ bubbles: true,
3846
+ composed: true
3847
+ })
3848
+ );
3849
+ }
3850
+ updateMarkerContent() {
3851
+ if (!this.marker || !this.markerLibrary) return;
3852
+ const { PinElement: t } = this.markerLibrary;
3853
+ if (this.content)
3854
+ if (typeof this.content == "string") {
3855
+ const e = document.createElement("div");
3856
+ e.innerHTML = this.content, this.marker.content = e;
3857
+ } else
3858
+ this.marker.content = this.content;
3859
+ else if (this.icon) {
3860
+ const e = document.createElement("img");
3861
+ e.src = this.icon, e.style.width = "32px", e.style.height = "32px", this.marker.content = e;
3862
+ } else {
3863
+ const e = {
3864
+ scale: this.scale || 1
3865
+ };
3866
+ 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);
3867
+ }
3868
+ }
3869
+ normalizePosition(t) {
3870
+ return t ? {
3871
+ lat: typeof t.lat == "number" ? t.lat : parseFloat(t.lat),
3872
+ lng: typeof t.lng == "number" ? t.lng : parseFloat(t.lng)
3873
+ } : { lat: 0, lng: 0 };
3874
+ }
3875
+ cleanup() {
3876
+ x(this.eventListeners), this.marker && (this.marker.map = null, this.marker = void 0);
3877
+ }
3878
+ getMarker() {
3879
+ return this.marker;
3880
+ }
3881
+ render() {
3882
+ return b$2`<slot></slot>`;
3883
+ }
3884
+ };
3885
+ d([
3886
+ n({ type: Object })
3887
+ ], u.prototype, "position", 2);
3888
+ d([
3889
+ n({ type: String })
3890
+ ], u.prototype, "title", 2);
3891
+ d([
3892
+ n({ type: Boolean })
3893
+ ], u.prototype, "gmpDraggable", 2);
3894
+ d([
3895
+ n({ type: Boolean })
3896
+ ], u.prototype, "gmpClickable", 2);
3897
+ d([
3898
+ n({ type: Number })
3899
+ ], u.prototype, "zIndex", 2);
3900
+ d([
3901
+ n({ type: Object })
3902
+ ], u.prototype, "content", 2);
3903
+ d([
3904
+ n({ type: String })
3905
+ ], u.prototype, "background", 2);
3906
+ d([
3907
+ n({ type: String })
3908
+ ], u.prototype, "borderColor", 2);
3909
+ d([
3910
+ n({ type: String })
3911
+ ], u.prototype, "glyphColor", 2);
3912
+ d([
3913
+ n({ type: Number })
3914
+ ], u.prototype, "scale", 2);
3915
+ d([
3916
+ n({ type: Boolean })
3917
+ ], u.prototype, "draggable", 2);
3918
+ d([
3919
+ n({ type: Boolean })
3920
+ ], u.prototype, "clickable", 2);
3921
+ d([
3922
+ n({ type: String })
3923
+ ], u.prototype, "icon", 2);
3924
+ d([
3925
+ n({ type: String })
3926
+ ], u.prototype, "label", 2);
3927
+ d([
3928
+ h()
3929
+ ], u.prototype, "marker", 2);
3930
+ d([
3931
+ h()
3932
+ ], u.prototype, "map", 2);
3933
+ u = d([
3934
+ L("gmap-marker")
3935
+ ], u);
3936
+ var Dt = Object.defineProperty, jt = Object.getOwnPropertyDescriptor, P = (t, e, o, i) => {
3937
+ for (var s = i > 1 ? void 0 : i ? jt(e, o) : e, a = t.length - 1, r; a >= 0; a--)
3938
+ (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
3939
+ return i && s && Dt(e, o, s), s;
3940
+ };
3941
+ let f = class extends i {
3942
+ constructor() {
3943
+ super(...arguments), this.opened = true, this.options = {}, this.eventListeners = [];
3944
+ }
3945
+ async connectedCallback() {
3946
+ super.connectedCallback(), await this.initInfoWindow();
3947
+ }
3948
+ disconnectedCallback() {
3949
+ super.disconnectedCallback(), this.cleanup();
3950
+ }
3951
+ updated(t) {
3952
+ 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));
3953
+ }
3954
+ async initInfoWindow() {
3955
+ const t = this.closest("gmap-marker");
3956
+ if (t)
3957
+ this.addEventListener("gmap-marker-ready", ((e) => {
3958
+ this.marker = e.detail.marker, this.createInfoWindow();
3959
+ })), t.getMarker && (this.marker = t.getMarker(), this.marker && await this.createInfoWindow());
3960
+ else {
3961
+ const e = this.closest("gmap-map");
3962
+ e && (this.addEventListener("gmap-ready", ((o) => {
3963
+ this.map = o.detail.map, this.createInfoWindow();
3964
+ })), e.getMap && (this.map = e.getMap(), this.map && await this.createInfoWindow()));
3965
+ }
3966
+ }
3967
+ async createInfoWindow() {
3968
+ const t = document.createElement("div");
3969
+ t.style.cssText = "min-width: 200px;";
3970
+ const e = {
3971
+ content: t,
3972
+ ...this.options
3973
+ };
3974
+ 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);
3975
+ const o = ["closeclick", "domready", "content_changed"];
3976
+ this.eventListeners = _(this.infoWindow, o, (i) => {
3977
+ i === "closeclick" && (this.opened = false), this.dispatchEvent(
3978
+ new CustomEvent(i, {
3979
+ bubbles: true,
3980
+ composed: true
3981
+ })
3982
+ );
3983
+ }), this.opened && this.open();
3984
+ }
3985
+ observeSlotContent(t) {
3986
+ this.renderSlotContent(t);
3987
+ const e = this.shadowRoot?.querySelector("slot");
3988
+ e && e.addEventListener("slotchange", () => {
3989
+ this.renderSlotContent(t);
3990
+ }), this.contentObserver = new MutationObserver(() => {
3991
+ this.renderSlotContent(t);
3992
+ }), this.contentObserver.observe(this, {
3993
+ childList: true,
3994
+ subtree: true,
3995
+ characterData: true
3996
+ });
3997
+ }
3998
+ renderSlotContent(t) {
3999
+ const e = this.shadowRoot?.querySelector("slot");
4000
+ if (e) {
4001
+ const o = e.assignedNodes({ flatten: true });
4002
+ t.innerHTML = "", o.forEach((i) => {
4003
+ (i.nodeType === Node.ELEMENT_NODE || i.nodeType === Node.TEXT_NODE && i.textContent?.trim()) && t.appendChild(i.cloneNode(true));
4004
+ });
4005
+ }
4006
+ }
4007
+ open() {
4008
+ this.infoWindow && (this.marker ? this.infoWindow.open({
4009
+ anchor: this.marker,
4010
+ map: this.map
4011
+ }) : this.map && this.infoWindow.open(this.map));
4012
+ }
4013
+ close() {
4014
+ this.infoWindow?.close();
4015
+ }
4016
+ cleanup() {
4017
+ x(this.eventListeners), this.contentObserver && (this.contentObserver.disconnect(), this.contentObserver = void 0), this.infoWindow && (this.infoWindow.close(), this.infoWindow = void 0);
4018
+ }
4019
+ getInfoWindow() {
4020
+ return this.infoWindow;
4021
+ }
4022
+ render() {
4023
+ return b$2`<slot></slot>`;
4024
+ }
4025
+ };
4026
+ f.styles = i$3`
4027
+ :host {
4028
+ display: contents;
4029
+ }
4030
+ `;
4031
+ P([
4032
+ n({ type: Boolean })
4033
+ ], f.prototype, "opened", 2);
4034
+ P([
4035
+ n({ type: Object })
4036
+ ], f.prototype, "position", 2);
4037
+ P([
4038
+ n({ type: Number })
4039
+ ], f.prototype, "zIndex", 2);
4040
+ P([
4041
+ n({ type: Object })
4042
+ ], f.prototype, "options", 2);
4043
+ P([
4044
+ h()
4045
+ ], f.prototype, "infoWindow", 2);
4046
+ P([
4047
+ h()
4048
+ ], f.prototype, "map", 2);
4049
+ P([
4050
+ h()
4051
+ ], f.prototype, "marker", 2);
4052
+ f = P([
4053
+ L("gmap-info-window")
4054
+ ], f);
4055
+ var Rt = Object.defineProperty, Gt = Object.getOwnPropertyDescriptor, z = (t, e, o, i) => {
4056
+ for (var s = i > 1 ? void 0 : i ? Gt(e, o) : e, a = t.length - 1, r; a >= 0; a--)
4057
+ (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
4058
+ return i && s && Rt(e, o, s), s;
4059
+ };
4060
+ let M = class extends i {
4061
+ constructor() {
4062
+ super(...arguments), this.path = [], this.editable = false, this.draggable = false, this.options = {}, this.eventListeners = [];
4063
+ }
4064
+ async connectedCallback() {
4065
+ super.connectedCallback(), await this.initPolyline();
4066
+ }
4067
+ disconnectedCallback() {
4068
+ super.disconnectedCallback(), this.cleanup();
4069
+ }
4070
+ updated(t) {
4071
+ 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));
4072
+ }
4073
+ async initPolyline() {
4074
+ const t = this.closest("gmap-map");
4075
+ t && (this.addEventListener("gmap-ready", ((e) => {
4076
+ this.map = e.detail.map, this.createPolyline();
4077
+ })), t.getMap && (this.map = t.getMap(), this.map && await this.createPolyline()));
4078
+ }
4079
+ async createPolyline() {
4080
+ if (!this.map) return;
4081
+ const t = {
4082
+ map: this.map,
4083
+ path: this.path,
4084
+ editable: this.editable,
4085
+ draggable: this.draggable,
4086
+ ...this.options
4087
+ };
4088
+ this.polyline = new google.maps.Polyline(t);
4089
+ const e = [
4090
+ "click",
4091
+ "dblclick",
4092
+ "drag",
4093
+ "dragend",
4094
+ "dragstart",
4095
+ "mousedown",
4096
+ "mousemove",
4097
+ "mouseout",
4098
+ "mouseover",
4099
+ "mouseup",
4100
+ "rightclick"
4101
+ ];
4102
+ this.eventListeners = _(this.polyline, e, (a, r) => {
4103
+ this.dispatchEvent(
4104
+ new CustomEvent(a, {
4105
+ detail: r,
4106
+ bubbles: true,
4107
+ composed: true
4108
+ })
4109
+ );
4110
+ });
4111
+ const o = google.maps.event.addListener(this.polyline.getPath(), "set_at", () => {
4112
+ this.emitPathChanged();
4113
+ }), i = google.maps.event.addListener(this.polyline.getPath(), "insert_at", () => {
4114
+ this.emitPathChanged();
4115
+ }), s = google.maps.event.addListener(this.polyline.getPath(), "remove_at", () => {
4116
+ this.emitPathChanged();
4117
+ });
4118
+ this.eventListeners.push(
4119
+ () => google.maps.event.removeListener(o),
4120
+ () => google.maps.event.removeListener(i),
4121
+ () => google.maps.event.removeListener(s)
4122
+ );
4123
+ }
4124
+ emitPathChanged() {
4125
+ if (!this.polyline) return;
4126
+ const t = this.polyline.getPath().getArray().map((e) => ({
4127
+ lat: e.lat(),
4128
+ lng: e.lng()
4129
+ }));
4130
+ this.dispatchEvent(
4131
+ new CustomEvent("gmap-path-changed", {
4132
+ detail: t,
4133
+ bubbles: true,
4134
+ composed: true
4135
+ })
4136
+ );
4137
+ }
4138
+ cleanup() {
4139
+ x(this.eventListeners), this.polyline && (this.polyline.setMap(null), this.polyline = void 0);
4140
+ }
4141
+ getPolyline() {
4142
+ return this.polyline;
4143
+ }
4144
+ render() {
4145
+ return b$2``;
4146
+ }
4147
+ };
4148
+ z([
4149
+ n({ type: Array })
4150
+ ], M.prototype, "path", 2);
4151
+ z([
4152
+ n({ type: Boolean })
4153
+ ], M.prototype, "editable", 2);
4154
+ z([
4155
+ n({ type: Boolean })
4156
+ ], M.prototype, "draggable", 2);
4157
+ z([
4158
+ n({ type: Object })
4159
+ ], M.prototype, "options", 2);
4160
+ z([
4161
+ h()
4162
+ ], M.prototype, "polyline", 2);
4163
+ z([
4164
+ h()
4165
+ ], M.prototype, "map", 2);
4166
+ M = z([
4167
+ L("gmap-polyline")
4168
+ ], M);
4169
+ var Wt = Object.defineProperty, Zt = Object.getOwnPropertyDescriptor, O = (t, e, o, i) => {
4170
+ for (var s = i > 1 ? void 0 : i ? Zt(e, o) : e, a = t.length - 1, r; a >= 0; a--)
4171
+ (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
4172
+ return i && s && Wt(e, o, s), s;
4173
+ };
4174
+ let w = class extends i {
4175
+ constructor() {
4176
+ super(...arguments), this.editable = false, this.draggable = false, this.options = {}, this.eventListeners = [];
4177
+ }
4178
+ async connectedCallback() {
4179
+ super.connectedCallback(), await this.initPolygon();
4180
+ }
4181
+ disconnectedCallback() {
4182
+ super.disconnectedCallback(), this.cleanup();
4183
+ }
4184
+ updated(t) {
4185
+ 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));
4186
+ }
4187
+ async initPolygon() {
4188
+ const t = this.closest("gmap-map");
4189
+ t && (this.addEventListener("gmap-ready", ((e) => {
4190
+ this.map = e.detail.map, this.createPolygon();
4191
+ })), t.getMap && (this.map = t.getMap(), this.map && await this.createPolygon()));
4192
+ }
4193
+ async createPolygon() {
4194
+ if (!this.map) return;
4195
+ const t = {
4196
+ map: this.map,
4197
+ editable: this.editable,
4198
+ draggable: this.draggable,
4199
+ ...this.options
4200
+ };
4201
+ this.paths ? t.paths = this.paths : this.path && (t.paths = this.path), this.polygon = new google.maps.Polygon(t);
4202
+ const e = [
4203
+ "click",
4204
+ "dblclick",
4205
+ "drag",
4206
+ "dragend",
4207
+ "dragstart",
4208
+ "mousedown",
4209
+ "mousemove",
4210
+ "mouseout",
4211
+ "mouseover",
4212
+ "mouseup",
4213
+ "rightclick"
4214
+ ];
4215
+ this.eventListeners = _(this.polygon, e, (o, i) => {
4216
+ this.dispatchEvent(
4217
+ new CustomEvent(o, {
4218
+ detail: i,
4219
+ bubbles: true,
4220
+ composed: true
4221
+ })
4222
+ );
4223
+ }), this.paths ? this.bindPathsChanges() : this.bindPathChanges();
4224
+ }
4225
+ bindPathChanges() {
4226
+ if (!this.polygon) return;
4227
+ const t = this.polygon.getPath(), e = google.maps.event.addListener(t, "set_at", () => {
4228
+ this.emitPathChanged();
4229
+ }), o = google.maps.event.addListener(t, "insert_at", () => {
4230
+ this.emitPathChanged();
4231
+ }), i = google.maps.event.addListener(t, "remove_at", () => {
4232
+ this.emitPathChanged();
4233
+ });
4234
+ this.eventListeners.push(
4235
+ () => google.maps.event.removeListener(e),
4236
+ () => google.maps.event.removeListener(o),
4237
+ () => google.maps.event.removeListener(i)
4238
+ );
4239
+ }
4240
+ bindPathsChanges() {
4241
+ if (!this.polygon) return;
4242
+ this.polygon.getPaths().forEach((e, o) => {
4243
+ const i = google.maps.event.addListener(e, "set_at", () => {
4244
+ this.emitPathsChanged();
4245
+ }), s = google.maps.event.addListener(e, "insert_at", () => {
4246
+ this.emitPathsChanged();
4247
+ }), a = google.maps.event.addListener(e, "remove_at", () => {
4248
+ this.emitPathsChanged();
4249
+ });
4250
+ this.eventListeners.push(
4251
+ () => google.maps.event.removeListener(i),
4252
+ () => google.maps.event.removeListener(s),
4253
+ () => google.maps.event.removeListener(a)
4254
+ );
4255
+ });
4256
+ }
4257
+ emitPathChanged() {
4258
+ if (!this.polygon) return;
4259
+ const t = this.polygon.getPath().getArray().map((e) => ({
4260
+ lat: e.lat(),
4261
+ lng: e.lng()
4262
+ }));
4263
+ this.dispatchEvent(
4264
+ new CustomEvent("gmap-path-changed", {
4265
+ detail: t,
4266
+ bubbles: true,
4267
+ composed: true
4268
+ })
4269
+ );
4270
+ }
4271
+ emitPathsChanged() {
4272
+ if (!this.polygon) return;
4273
+ const t = this.polygon.getPaths().getArray().map(
4274
+ (e) => e.getArray().map((o) => ({
4275
+ lat: o.lat(),
4276
+ lng: o.lng()
4277
+ }))
4278
+ );
4279
+ this.dispatchEvent(
4280
+ new CustomEvent("gmap-paths-changed", {
4281
+ detail: t,
4282
+ bubbles: true,
4283
+ composed: true
4284
+ })
4285
+ );
4286
+ }
4287
+ cleanup() {
4288
+ x(this.eventListeners), this.polygon && (this.polygon.setMap(null), this.polygon = void 0);
4289
+ }
4290
+ getPolygon() {
4291
+ return this.polygon;
4292
+ }
4293
+ render() {
4294
+ return b$2``;
4295
+ }
4296
+ };
4297
+ O([
4298
+ n({ type: Array })
4299
+ ], w.prototype, "path", 2);
4300
+ O([
4301
+ n({ type: Array })
4302
+ ], w.prototype, "paths", 2);
4303
+ O([
4304
+ n({ type: Boolean })
4305
+ ], w.prototype, "editable", 2);
4306
+ O([
4307
+ n({ type: Boolean })
4308
+ ], w.prototype, "draggable", 2);
4309
+ O([
4310
+ n({ type: Object })
4311
+ ], w.prototype, "options", 2);
4312
+ O([
4313
+ h()
4314
+ ], w.prototype, "polygon", 2);
4315
+ O([
4316
+ h()
4317
+ ], w.prototype, "map", 2);
4318
+ w = O([
4319
+ L("gmap-polygon")
4320
+ ], w);
4321
+ var Nt = Object.defineProperty, qt = Object.getOwnPropertyDescriptor, $ = (t, e, o, i) => {
4322
+ for (var s = i > 1 ? void 0 : i ? qt(e, o) : e, a = t.length - 1, r; a >= 0; a--)
4323
+ (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
4324
+ return i && s && Nt(e, o, s), s;
4325
+ };
4326
+ let k = class extends i {
4327
+ constructor() {
4328
+ super(...arguments), this.radius = 1e3, this.editable = false, this.draggable = false, this.options = {}, this.eventListeners = [];
4329
+ }
4330
+ async connectedCallback() {
4331
+ super.connectedCallback(), await this.initCircle();
4332
+ }
4333
+ disconnectedCallback() {
4334
+ super.disconnectedCallback(), this.cleanup();
4335
+ }
4336
+ updated(t) {
4337
+ 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));
4338
+ }
4339
+ async initCircle() {
4340
+ const t = this.closest("gmap-map");
4341
+ t && (this.addEventListener("gmap-ready", ((e) => {
4342
+ this.map = e.detail.map, this.createCircle();
4343
+ })), t.getMap && (this.map = t.getMap(), this.map && await this.createCircle()));
4344
+ }
4345
+ async createCircle() {
4346
+ if (!this.map) return;
4347
+ const t = {
4348
+ map: this.map,
4349
+ center: this.center,
4350
+ radius: this.radius,
4351
+ editable: this.editable,
4352
+ draggable: this.draggable,
4353
+ ...this.options
4354
+ };
4355
+ this.circle = new google.maps.Circle(t);
4356
+ const e = [
4357
+ "click",
4358
+ "dblclick",
4359
+ "drag",
4360
+ "dragend",
4361
+ "dragstart",
4362
+ "mousedown",
4363
+ "mousemove",
4364
+ "mouseout",
4365
+ "mouseover",
4366
+ "mouseup",
4367
+ "rightclick",
4368
+ "center_changed",
4369
+ "radius_changed",
4370
+ "bounds_changed"
4371
+ ];
4372
+ this.eventListeners = _(this.circle, e, (o, i) => {
4373
+ if (o === "center_changed") {
4374
+ const s = this.circle.getCenter(), a = s ? { lat: s.lat(), lng: s.lng() } : null;
4375
+ this.dispatchEvent(
4376
+ new CustomEvent(o, {
4377
+ detail: a,
4378
+ bubbles: true,
4379
+ composed: true
4380
+ })
4381
+ );
4382
+ } else if (o === "radius_changed") {
4383
+ const s = this.circle.getRadius();
4384
+ this.dispatchEvent(
4385
+ new CustomEvent(o, {
4386
+ detail: s,
4387
+ bubbles: true,
4388
+ composed: true
4389
+ })
4390
+ );
4391
+ } else
4392
+ this.dispatchEvent(
4393
+ new CustomEvent(o, {
4394
+ detail: i,
4395
+ bubbles: true,
4396
+ composed: true
4397
+ })
4398
+ );
4399
+ });
4400
+ }
4401
+ cleanup() {
4402
+ x(this.eventListeners), this.circle && (this.circle.setMap(null), this.circle = void 0);
4403
+ }
4404
+ getCircle() {
4405
+ return this.circle;
4406
+ }
4407
+ render() {
4408
+ return b$2``;
4409
+ }
4410
+ };
4411
+ $([
4412
+ n({ type: Object })
4413
+ ], k.prototype, "center", 2);
4414
+ $([
4415
+ n({ type: Number })
4416
+ ], k.prototype, "radius", 2);
4417
+ $([
4418
+ n({ type: Boolean })
4419
+ ], k.prototype, "editable", 2);
4420
+ $([
4421
+ n({ type: Boolean })
4422
+ ], k.prototype, "draggable", 2);
4423
+ $([
4424
+ n({ type: Object })
4425
+ ], k.prototype, "options", 2);
4426
+ $([
4427
+ h()
4428
+ ], k.prototype, "circle", 2);
4429
+ $([
4430
+ h()
4431
+ ], k.prototype, "map", 2);
4432
+ k = $([
4433
+ L("gmap-circle")
4434
+ ], k);
4435
+ var Vt = Object.defineProperty, Ft = Object.getOwnPropertyDescriptor, I = (t, e, o, i) => {
4436
+ for (var s = i > 1 ? void 0 : i ? Ft(e, o) : e, a = t.length - 1, r; a >= 0; a--)
4437
+ (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
4438
+ return i && s && Vt(e, o, s), s;
4439
+ };
4440
+ let S = class extends i {
4441
+ constructor() {
4442
+ super(...arguments), this.editable = false, this.draggable = false, this.options = {}, this.eventListeners = [];
4443
+ }
4444
+ async connectedCallback() {
4445
+ super.connectedCallback(), await this.initRectangle();
4446
+ }
4447
+ disconnectedCallback() {
4448
+ super.disconnectedCallback(), this.cleanup();
4449
+ }
4450
+ updated(t) {
4451
+ 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));
4452
+ }
4453
+ async initRectangle() {
4454
+ const t = this.closest("gmap-map");
4455
+ t && (this.addEventListener("gmap-ready", ((e) => {
4456
+ this.map = e.detail.map, this.createRectangle();
4457
+ })), t.getMap && (this.map = t.getMap(), this.map && await this.createRectangle()));
4458
+ }
4459
+ async createRectangle() {
4460
+ if (!this.map) return;
4461
+ const t = {
4462
+ map: this.map,
4463
+ bounds: this.bounds,
4464
+ editable: this.editable,
4465
+ draggable: this.draggable,
4466
+ ...this.options
4467
+ };
4468
+ this.rectangle = new google.maps.Rectangle(t);
4469
+ const e = [
4470
+ "click",
4471
+ "dblclick",
4472
+ "drag",
4473
+ "dragend",
4474
+ "dragstart",
4475
+ "mousedown",
4476
+ "mousemove",
4477
+ "mouseout",
4478
+ "mouseover",
4479
+ "mouseup",
4480
+ "rightclick",
4481
+ "bounds_changed"
4482
+ ];
4483
+ this.eventListeners = _(this.rectangle, e, (o, i) => {
4484
+ if (o === "bounds_changed") {
4485
+ const s = this.rectangle.getBounds();
4486
+ if (s) {
4487
+ const a = {
4488
+ north: s.getNorthEast().lat(),
4489
+ south: s.getSouthWest().lat(),
4490
+ east: s.getNorthEast().lng(),
4491
+ west: s.getSouthWest().lng()
4492
+ };
4493
+ this.dispatchEvent(
4494
+ new CustomEvent(o, {
4495
+ detail: a,
4496
+ bubbles: true,
4497
+ composed: true
4498
+ })
4499
+ );
4500
+ }
4501
+ } else
4502
+ this.dispatchEvent(
4503
+ new CustomEvent(o, {
4504
+ detail: i,
4505
+ bubbles: true,
4506
+ composed: true
4507
+ })
4508
+ );
4509
+ });
4510
+ }
4511
+ cleanup() {
4512
+ x(this.eventListeners), this.rectangle && (this.rectangle.setMap(null), this.rectangle = void 0);
4513
+ }
4514
+ getRectangle() {
4515
+ return this.rectangle;
4516
+ }
4517
+ render() {
4518
+ return b$2``;
4519
+ }
4520
+ };
4521
+ I([
4522
+ n({ type: Object })
4523
+ ], S.prototype, "bounds", 2);
4524
+ I([
4525
+ n({ type: Boolean })
4526
+ ], S.prototype, "editable", 2);
4527
+ I([
4528
+ n({ type: Boolean })
4529
+ ], S.prototype, "draggable", 2);
4530
+ I([
4531
+ n({ type: Object })
4532
+ ], S.prototype, "options", 2);
4533
+ I([
4534
+ h()
4535
+ ], S.prototype, "rectangle", 2);
4536
+ I([
4537
+ h()
4538
+ ], S.prototype, "map", 2);
4539
+ S = I([
4540
+ L("gmap-rectangle")
4541
+ ], S);
4542
+ var Ht = Object.defineProperty, Kt = Object.getOwnPropertyDescriptor, T = (t, e, o, i) => {
4543
+ for (var s = i > 1 ? void 0 : i ? Kt(e, o) : e, a = t.length - 1, r; a >= 0; a--)
4544
+ (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
4545
+ return i && s && Ht(e, o, s), s;
4546
+ };
4547
+ let C = class extends i {
4548
+ constructor() {
4549
+ super(...arguments), this.gridSize = 60, this.markers = [];
4550
+ }
4551
+ async connectedCallback() {
4552
+ super.connectedCallback(), await this.initCluster();
4553
+ }
4554
+ disconnectedCallback() {
4555
+ super.disconnectedCallback(), this.cleanup();
4556
+ }
4557
+ async initCluster() {
4558
+ const t = this.closest("gmap-map");
4559
+ t && (this.addEventListener("gmap-ready", ((e) => {
4560
+ this.map = e.detail.map, this.createCluster();
4561
+ })), t.getMap && (this.map = t.getMap(), this.map && await this.createCluster())), this.addEventListener("gmap-marker-ready", ((e) => {
4562
+ const o = e.detail.marker;
4563
+ this.addMarker(o);
4564
+ }));
4565
+ }
4566
+ async createCluster() {
4567
+ if (this.map)
4568
+ try {
4569
+ const t = await Promise.resolve().then(function () { return require('./index.esm-DOwgk2YK.js'); }).catch(() => null);
4570
+ if (!t) {
4571
+ console.error(
4572
+ "GMapCluster: @googlemaps/markerclusterer not found. Install with: npm install @googlemaps/markerclusterer"
4573
+ );
4574
+ return;
4575
+ }
4576
+ const { MarkerClusterer: e } = t, o = {
4577
+ map: this.map,
4578
+ markers: this.markers
4579
+ };
4580
+ 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);
4581
+ } catch (t) {
4582
+ console.error("GMapCluster: Error creating cluster:", t);
4583
+ }
4584
+ }
4585
+ addMarker(t) {
4586
+ this.markers.includes(t) || (this.markers.push(t), this.markerClusterer && this.markerClusterer.addMarker(t));
4587
+ }
4588
+ cleanup() {
4589
+ this.markerClusterer && (this.markerClusterer.clearMarkers(), this.markerClusterer = void 0), this.markers = [];
4590
+ }
4591
+ getClusterer() {
4592
+ return this.markerClusterer;
4593
+ }
4594
+ render() {
4595
+ return b$2`<slot></slot>`;
4596
+ }
4597
+ };
4598
+ T([
4599
+ n({ type: Number })
4600
+ ], C.prototype, "gridSize", 2);
4601
+ T([
4602
+ n({ type: Number })
4603
+ ], C.prototype, "maxZoom", 2);
4604
+ T([
4605
+ n({ type: Array })
4606
+ ], C.prototype, "styles", 2);
4607
+ T([
4608
+ n({ type: Function })
4609
+ ], C.prototype, "calculator", 2);
4610
+ T([
4611
+ h()
4612
+ ], C.prototype, "map", 2);
4613
+ T([
4614
+ h()
4615
+ ], C.prototype, "markerClusterer", 2);
4616
+ T([
4617
+ h()
4618
+ ], C.prototype, "markers", 2);
4619
+ C = T([
4620
+ L("gmap-cluster")
4621
+ ], C);
4622
+ var Jt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, v = (t, e, o, i) => {
4623
+ for (var s = i > 1 ? void 0 : i ? Yt(e, o) : e, a = t.length - 1, r; a >= 0; a--)
4624
+ (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
4625
+ return i && s && Jt(e, o, s), s;
4626
+ };
4627
+ let b = class extends i {
4628
+ constructor() {
4629
+ super(...arguments), this.zoom = 0, this.visible = true, this.motionTracking = true, this.options = {}, this.eventListeners = [];
4630
+ }
4631
+ async connectedCallback() {
4632
+ super.connectedCallback();
4633
+ }
4634
+ async firstUpdated() {
4635
+ await D, this.createPanorama();
4636
+ }
4637
+ disconnectedCallback() {
4638
+ super.disconnectedCallback(), this.cleanup();
4639
+ }
4640
+ updated(t) {
4641
+ 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));
4642
+ }
4643
+ createPanorama() {
4644
+ if (!this.panoramaElement) return;
4645
+ const t = {
4646
+ position: this.position,
4647
+ pano: this.pano,
4648
+ zoom: this.zoom,
4649
+ pov: this.pov,
4650
+ visible: this.visible,
4651
+ motionTracking: this.motionTracking,
4652
+ ...this.options
4653
+ };
4654
+ this.panorama = new google.maps.StreetViewPanorama(this.panoramaElement, t);
4655
+ const e = ["closeclick", "status_changed"];
4656
+ this.eventListeners = _(this.panorama, e, (o, i) => {
4657
+ this.dispatchEvent(
4658
+ new CustomEvent(o, {
4659
+ detail: i,
4660
+ bubbles: true,
4661
+ composed: true
4662
+ })
4663
+ );
4664
+ });
4665
+ }
4666
+ cleanup() {
4667
+ x(this.eventListeners), this.panorama = void 0;
4668
+ }
4669
+ resize() {
4670
+ this.panorama && google.maps.event.trigger(this.panorama, "resize");
4671
+ }
4672
+ getPanorama() {
4673
+ return this.panorama;
4674
+ }
4675
+ render() {
4676
+ return b$2`<div class="panorama"></div>`;
4677
+ }
4678
+ };
4679
+ b.styles = i$3`
4680
+ :host {
4681
+ display: block;
4682
+ position: relative;
4683
+ width: 100%;
4684
+ height: 400px;
4685
+ }
4686
+
4687
+ .panorama {
4688
+ width: 100%;
4689
+ height: 100%;
4690
+ }
4691
+ `;
4692
+ v([
4693
+ n({ type: Object })
4694
+ ], b.prototype, "position", 2);
4695
+ v([
4696
+ n({ type: String })
4697
+ ], b.prototype, "pano", 2);
4698
+ v([
4699
+ n({ type: Number })
4700
+ ], b.prototype, "zoom", 2);
4701
+ v([
4702
+ n({ type: Object })
4703
+ ], b.prototype, "pov", 2);
4704
+ v([
4705
+ n({ type: Boolean })
4706
+ ], b.prototype, "visible", 2);
4707
+ v([
4708
+ n({ type: Boolean })
4709
+ ], b.prototype, "motionTracking", 2);
4710
+ v([
4711
+ n({ type: Object })
4712
+ ], b.prototype, "options", 2);
4713
+ v([
4714
+ F(".panorama")
4715
+ ], b.prototype, "panoramaElement", 2);
4716
+ v([
4717
+ h()
4718
+ ], b.prototype, "panorama", 2);
4719
+ b = v([
4720
+ L("gmap-street-view-panorama")
4721
+ ], b);
4722
+
316
4723
  var GetDirections = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
317
4724
  <path
318
4725
  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"
@@ -338,6 +4745,18 @@ var GPS = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="ht
338
4745
  </svg>
339
4746
  `;
340
4747
 
4748
+ var LocationTag = `<svg width="13" height="15" viewBox="0 0 8.97576 11.7781" fill="none" xmlns="http://www.w3.org/2000/svg">
4749
+ <path d="M6.2453 8.52122L5.8322 8.24311L5.86126 8.20024L6.27435 8.47694L6.2453 8.52122ZM6.42386 8.25126L6.00758 7.97882C5.96896 8.03798 5.92999 8.0975 5.88995 8.15737L6.30376 8.43372C6.34414 8.37136 6.38489 8.31184 6.42386 8.25126ZM6.63572 7.92213L6.21518 7.65677L6.11244 7.81797L6.5305 8.08723L6.63572 7.92213ZM6.43484 9.81081L5.92538 9.45547C5.32487 10.316 4.76617 11.0388 4.48664 11.3927L4.97413 11.7781C5.25827 11.4182 5.82512 10.6831 6.43484 9.81081ZM3.55487 10.1647C3.44257 10.0113 3.33097 9.85652 3.22327 9.70417L2.717 10.0638C2.82611 10.2179 2.93913 10.3745 3.0525 10.5307L3.55487 10.1647ZM3.11734 9.55006L2.99688 9.37823L2.48707 9.73216L2.60965 9.90753L3.11734 9.55006ZM6.58577 9.59257L6.07206 9.24113L5.95266 9.41402L6.46248 9.76865C6.50499 9.71091 6.54538 9.65174 6.58577 9.59151V9.59257ZM2.96535 9.33607C2.46191 8.60767 2.02898 7.92319 1.68072 7.30887L1.14044 7.61461C1.49933 8.24736 1.94182 8.9453 2.4566 9.68929L2.96535 9.33607ZM7.01161 8.95416L6.49152 8.6144C6.39055 8.7678 6.28533 8.92652 6.17763 9.08453L6.69134 9.43386C6.80329 9.27018 6.911 9.11146 7.01374 8.95486L7.01161 8.95416ZM8.97363 4.48559C8.97434 3.96621 8.88471 3.45073 8.70898 2.96217L8.12442 3.17262C8.27605 3.5935 8.35364 4.03777 8.35293 4.48559C8.35293 4.99505 8.11733 5.71955 7.65216 6.63927L8.2059 6.91916C8.72599 5.89847 8.97576 5.10204 8.97576 4.4863L8.97363 4.48559ZM0.749309 5.26111C0.699001 5.09389 0.661447 4.92313 0.637001 4.75059L0.0216118 4.83208C0.0488916 5.03579 0.0921143 5.23738 0.150217 5.43436L0.749309 5.26111ZM0.621058 4.58443V4.39737L0 4.3832V4.48594C0 4.51995 5.62238e-07 4.5738 0.00389767 4.6188L0.621058 4.58443ZM1.3275 2.25361L0.820874 1.89472C0.314958 2.60824 0.0297605 3.45427 0.000709258 4.32864L0.621058 4.35061C0.645858 3.59705 0.89173 2.86793 1.3275 2.25361ZM8.69233 2.91151C8.66612 2.84065 8.63706 2.76944 8.60766 2.70106L8.03797 2.94835C8.06348 3.00752 8.08792 3.06846 8.11131 3.12939L8.69233 2.91151ZM8.52227 2.51684C8.43264 2.33367 8.33025 2.15689 8.21653 1.98754L7.70282 2.33367C7.80095 2.47928 7.88846 2.63163 7.96534 2.78964L8.52227 2.51684ZM6.33848 0.397516C5.7571 0.13393 5.12577 -0.00140612 4.48735 1.10152e-05C4.25494 1.10152e-05 4.02288 0.0177252 3.79331 0.0531534L3.88825 0.664646C4.08665 0.634178 4.28682 0.618943 4.48735 0.618589C5.0372 0.617526 5.58137 0.73444 6.08197 0.961535L6.33848 0.397516ZM3.47906 0.752862L3.31644 0.150581C3.11946 0.203369 2.92602 0.269974 2.73825 0.349688L2.97987 0.921501C3.14214 0.853125 3.30865 0.796084 3.47835 0.750382L3.47906 0.752862ZM3.84184 0.673858L3.7391 0.061657C3.6647 0.0737026 3.58959 0.0885822 3.51519 0.104525L3.64876 0.710702C3.71182 0.694051 3.77666 0.681651 3.84078 0.671023L3.84184 0.673858ZM4.68149 10.6292C4.68149 10.6253 5.02975 10.2041 5.49138 9.58159L5.08998 9.28293C4.8434 9.6156 4.63083 9.8884 4.4877 10.0705C4.2436 9.76121 3.79791 9.18302 3.32069 8.49819L2.91043 8.78481C3.63494 9.82286 4.28824 10.6218 4.29462 10.6296L4.48735 10.8659L4.68149 10.6292ZM5.57039 9.47318L5.16757 9.17629L5.10344 9.26097L5.50556 9.55821C5.52752 9.52739 5.54843 9.50117 5.56968 9.47212L5.57039 9.47318ZM6.01997 8.85035L5.60759 8.56445C5.48359 8.74123 5.35463 8.92156 5.22213 9.10154L5.62566 9.39772C5.75993 9.21278 5.89137 9.02927 6.0175 8.85L6.01997 8.85035ZM8.12194 4.47708C8.12229 3.76958 7.91539 3.07731 7.52639 2.48601L7.10833 2.76023C7.44419 3.2704 7.62311 3.86807 7.62204 4.47886C7.62204 5.12436 7.14872 6.20669 6.25309 7.60788L6.67434 7.87714C7.63196 6.37108 8.11875 5.2271 8.11875 4.47567L8.12194 4.47708ZM2.68015 7.53667C2.55863 7.34394 2.44314 7.15653 2.33791 6.97584L1.9064 7.22951C2.01481 7.41444 2.13314 7.60788 2.25785 7.8077L2.68015 7.53667ZM2.29009 6.89436L2.23801 6.80366L1.80365 7.05237L1.8568 7.14554L2.29009 6.89436ZM2.22596 6.78205C1.65627 5.78155 1.35513 4.98371 1.35513 4.47567C1.35513 4.17453 1.39835 3.87516 1.48338 3.58642L1.00368 3.44541C0.905193 3.77915 0.854885 4.12528 0.855239 4.47319C0.855239 5.07618 1.16984 5.93567 1.79161 7.02757L2.22596 6.78205ZM7.50867 2.46263C7.48812 2.43181 7.46616 2.39851 7.44455 2.36946L7.03535 2.65465C7.05413 2.68087 7.07326 2.7078 7.09133 2.73508L7.50867 2.46263ZM2.36732 2.17389L2.02579 1.8026C1.85148 1.9638 1.69312 2.14201 1.55389 2.33438L1.95777 2.62985C2.07893 2.46369 2.21604 2.30994 2.36767 2.1707L2.36732 2.17389ZM7.38396 2.28726C7.24012 2.09772 7.07786 1.9227 6.90037 1.76434L6.5677 2.13811C6.7211 2.27415 6.86104 2.42472 6.98504 2.58769L7.38396 2.28726ZM2.50726 2.04848L2.19124 1.66302C2.16183 1.68675 2.13278 1.7112 2.10373 1.73635L2.43286 2.11402C2.45731 2.08993 2.48246 2.06867 2.50726 2.04848ZM4.48664 1.34203C4.8884 1.34133 5.28626 1.41856 5.65861 1.56878L5.84602 1.10431C4.62658 0.613984 3.23744 0.819114 2.21214 1.6414L2.52568 2.03112C3.08084 1.58295 3.77311 1.34026 4.48664 1.3431V1.34203ZM4.72649 9.03245C4.86927 8.82839 5.00708 8.62609 5.13817 8.43053C5.67207 7.64862 6.15567 6.83342 6.58506 5.98987C7.08141 4.98406 7.12463 4.54723 7.12853 4.47035V4.45618C7.12853 2.99689 5.94558 1.81394 4.48628 1.81394C3.02699 1.81394 1.84404 2.99689 1.84404 4.45618V4.47035C1.84404 4.54759 1.89081 4.98406 2.3868 5.98987C2.8169 6.83342 3.3005 7.64862 3.83476 8.43053C3.96336 8.62326 4.10401 8.82874 4.24643 9.03245L4.48522 9.3754L4.72649 9.03245ZM3.0316 3.00362C3.83547 2.19975 5.13887 2.20011 5.94274 3.00398C6.32537 3.3866 6.54183 3.90456 6.54538 4.44555C6.53971 4.49374 6.48125 4.87707 6.06178 5.73018C5.64373 6.55177 5.17289 7.34571 4.6528 8.10671C4.59895 8.18749 4.54368 8.26933 4.48699 8.35223C4.43102 8.26933 4.37504 8.18784 4.32119 8.10671C3.80146 7.34536 3.33061 6.55177 2.91221 5.73018C2.48636 4.86644 2.43357 4.48346 2.42932 4.44555C2.43109 3.90421 2.64791 3.38589 3.0316 3.00362Z" fill="url(#paint0_linear_0_471)"/>
4750
+ <defs>
4751
+ <linearGradient id="paint0_linear_0_471" x1="-0.000253536" y1="5.88509" x2="8.97608" y2="5.88509" gradientUnits="userSpaceOnUse">
4752
+ <stop offset="0.2" stop-color="#4498B6"/>
4753
+ <stop offset="0.49" stop-color="#273265"/>
4754
+ <stop offset="1" stop-color="#C93732"/>
4755
+ </linearGradient>
4756
+ </defs>
4757
+ </svg>
4758
+ `;
4759
+
341
4760
  var MiniMap = `<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">
342
4761
  <g filter="url(#filter0_d_24181_220540)">
343
4762
  <mask id="mask0_24181_220540" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="1" y="0" width="33" height="32">
@@ -383,7 +4802,7 @@ var Store = `<svg width="15" height="14" viewBox="0 0 15 14" fill="none" xmlns="
383
4802
  </svg>
384
4803
  `;
385
4804
 
386
- const sallaBulletDeliveryCss = "@supports (interpolate-size: allow-keywords) and (block-size: calc-size(auto, size)) {\n .s-bullet-delivery .s-bullet-delivery-modal .s-modal-body, .s-bullet-delivery-inner {\n @apply [interpolate-size:allow-keywords];\n }\n .s-bullet-delivery .s-bullet-delivery-modal .s-modal-body {\n @apply [overflow:clip] [transition:block-size_500ms_ease];\n }\n .s-bullet-delivery-inner {\n @apply [overflow:clip] [transition:block-size_500ms_ease];\n block-size: calc-size(auto, size);\n }\n}\n\n/* Allow searchable dropdown popover to paint outside the modal body */\n.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body:has(.s-searchable-dropdown--open) {\n overflow: visible !important;\n}\n\n@keyframes s-bullet-delivery-fade-in {\n from {\n opacity: 0;\n transform: translateY(6px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}";
4805
+ const sallaBulletDeliveryCss = "@supports (interpolate-size: allow-keywords) and (block-size: calc-size(auto, size)) {\n .s-bullet-delivery .s-bullet-delivery-modal .s-modal-body, .s-bullet-delivery-inner {\n @apply [interpolate-size:allow-keywords];\n }\n .s-bullet-delivery .s-bullet-delivery-modal .s-modal-body {\n @apply [overflow:clip] [transition:block-size_500ms_ease];\n }\n .s-bullet-delivery-inner {\n @apply [overflow:clip] [transition:block-size_500ms_ease];\n block-size: calc-size(auto, size);\n }\n}\n\n/* Allow searchable dropdown popover to paint outside the modal body */\n.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body:has(.s-searchable-dropdown--open) {\n overflow: visible !important;\n}\n\n.s-bullet-delivery-map-container {\n width: 100%;\n height: 450px;\n border-radius: 8px;\n overflow: hidden;\n margin-bottom: 12px;\n}\n.s-bullet-delivery-map-container gmap-map {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n.s-bullet-delivery-address-confirm {\n display: flex;\n flex-direction: column;\n gap: 20px;\n padding: 0 24px;\n}\n\n.s-bullet-delivery-address-confirm-card {\n display: flex;\n align-items: flex-start;\n gap: 12px;\n}\n\n.s-bullet-delivery-address-confirm-edit {\n border: 1px solid #eee;\n border-radius: 8px;\n padding: 6px 12px;\n font-size: 12px;\n font-weight: 500;\n line-height: 1;\n color: #333;\n background: white;\n cursor: pointer;\n white-space: nowrap;\n height: 32px;\n flex-shrink: 0;\n align-self: center;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\n.s-bullet-delivery-address-confirm-details {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 4px;\n flex: 1;\n min-width: 0;\n}\n\n.s-bullet-delivery-address-confirm-label {\n font-size: 12px;\n color: #666;\n}\n\n.s-bullet-delivery-address-confirm-text {\n font-size: 14px;\n font-weight: 700;\n color: #333;\n margin: 0;\n word-break: break-word;\n}\n\n.s-bullet-delivery-address-confirm-tag {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n border: 1px solid #eee;\n border-radius: 140px;\n padding: 4px 8px;\n font-size: 12px;\n color: #333;\n margin-top: 4px;\n}\n\n.s-bullet-delivery-address-confirm-tag-icon {\n width: 9px;\n display: inline-flex;\n flex-shrink: 0;\n}\n.s-bullet-delivery-address-confirm-tag-icon svg {\n width: 100%;\n height: 100%;\n}\n\n.s-bullet-delivery-address-confirm-description {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.s-bullet-delivery-address-confirm-description-label {\n font-size: 14px;\n font-weight: 500;\n color: #444;\n}\n\n.s-bullet-delivery-address-confirm-description-optional {\n font-weight: 400;\n color: #999;\n margin-inline-start: 4px;\n}\n\n.s-bullet-delivery-address-confirm-description-input {\n width: 100%;\n border: 1px solid #eee;\n border-radius: 8px;\n padding: 10px 12px;\n font-size: 14px;\n}\n\n.s-bullet-delivery-login-prompt {\n display: block;\n width: 100%;\n text-align: center;\n background: none;\n border: none;\n color: var(--color-primary, #004956);\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n padding: 12px 0;\n}\n\n@keyframes s-bullet-delivery-fade-in {\n from {\n opacity: 0;\n transform: translateY(6px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}";
387
4806
 
388
4807
  const BRANCH_SEARCH_DEBOUNCE_MS = 1000;
389
4808
  const GEOLOCATION_TIMEOUT = 10000;
@@ -437,6 +4856,7 @@ const SallaBulletDelivery = class {
437
4856
  this.bulletDeliveryMobileSelectHandler = null;
438
4857
  /** True after saved addresses have been loaded (lazy: only when address tab is shown). */
439
4858
  this.savedAddressesLoaded = false;
4859
+ this.gmapRef = null;
440
4860
  // Core state
441
4861
  this.activeTab = "address";
442
4862
  this.isLoggedIn = false;
@@ -487,6 +4907,13 @@ const SallaBulletDelivery = class {
487
4907
  this.displayedDistricts = [];
488
4908
  /** Shown when scopes/allocation returns 422 (address outside delivery coverage). Only on delivery tab. */
489
4909
  this.allocationOutOfCoverageMessage = null;
4910
+ // Map state
4911
+ this.mapLocationData = null;
4912
+ this.addressToken = null;
4913
+ this.loadingToken = false;
4914
+ this.mapReady = false;
4915
+ this.mapStep = 'map';
4916
+ this.addressDescription = '';
490
4917
  this.newAddressForm = {
491
4918
  ...SallaBulletDelivery.INITIAL_ADDRESS_FORM,
492
4919
  };
@@ -561,6 +4988,28 @@ const SallaBulletDelivery = class {
561
4988
  this.displayedDistricts = this.districts;
562
4989
  this.searchingDistricts = false;
563
4990
  };
4991
+ this.handleMapLocationChanged = (event) => {
4992
+ const detail = event.detail;
4993
+ if (!detail?.position?.lat || !detail?.position?.lng)
4994
+ return;
4995
+ this.mapLocationData = {
4996
+ lat: detail.position.lat,
4997
+ lng: detail.position.lng,
4998
+ shortAddress: detail.place?.placeId ?? detail.place?.place_id ?? undefined,
4999
+ formattedAddress: detail.place?.formattedAddress ?? detail.place?.formatted_address ?? undefined,
5000
+ };
5001
+ setTimeout(() => {
5002
+ const marker = this.gmapRef?.locationMarker;
5003
+ if (marker)
5004
+ marker.gmpDraggable = false;
5005
+ }, 100);
5006
+ };
5007
+ this.handleMapReady = () => {
5008
+ this.mapReady = true;
5009
+ if (this.gmapRef && typeof this.gmapRef.resize === 'function') {
5010
+ this.gmapRef.resize();
5011
+ }
5012
+ };
564
5013
  /**
565
5014
  * Submit add-address form: create address via API then switch back to list.
566
5015
  */
@@ -568,9 +5017,12 @@ const SallaBulletDelivery = class {
568
5017
  e.preventDefault();
569
5018
  if (this.savingAddress)
570
5019
  return;
571
- if (!this.selectedCountry || !this.selectedCity)
5020
+ const hasMap = this.hasMapLocation();
5021
+ const hasDropdowns = this.selectedCountry && this.selectedCity;
5022
+ if (!hasMap && !hasDropdowns)
572
5023
  return;
573
- if (!requireRegionAndDistrictForSA(this.selectedCountry?.code, this.selectedRegion?.id, this.selectedDistrict?.id ?? (this.districtName?.trim() || null)))
5024
+ if (!hasMap &&
5025
+ !requireRegionAndDistrictForSA(this.selectedCountry?.code, this.selectedRegion?.id, this.selectedDistrict?.id ?? (this.districtName?.trim() || null)))
574
5026
  return;
575
5027
  this.savingAddress = true;
576
5028
  try {
@@ -586,14 +5038,29 @@ const SallaBulletDelivery = class {
586
5038
  this.addressCreated.emit({ address: latest });
587
5039
  this.viewMode = "main";
588
5040
  this.districtName = "";
5041
+ this.mapLocationData = null;
5042
+ this.mapStep = 'map';
5043
+ this.addressDescription = '';
589
5044
  }
590
5045
  else {
591
- Salla.notify?.error(Salla.lang.get("common.errors.error_occurred"));
5046
+ if (!this.isLoggedIn) {
5047
+ Salla.notify?.error(Salla.lang.get('pages.checkout.login_to_use_saved_addresses'));
5048
+ this.handleLogin();
5049
+ }
5050
+ else {
5051
+ Salla.notify?.error(Salla.lang.get("common.errors.error_occurred"));
5052
+ }
592
5053
  }
593
5054
  }
594
5055
  catch (error) {
595
5056
  console.error("SallaBulletDelivery: Error saving address", error);
596
- Salla.notify?.error(Salla.lang.get("common.errors.error_occurred"));
5057
+ if (!this.isLoggedIn) {
5058
+ Salla.notify?.error(Salla.lang.get('pages.checkout.login_to_use_saved_addresses'));
5059
+ this.handleLogin();
5060
+ }
5061
+ else {
5062
+ Salla.notify?.error(Salla.lang.get("common.errors.error_occurred"));
5063
+ }
597
5064
  }
598
5065
  finally {
599
5066
  this.savingAddress = false;
@@ -704,6 +5171,8 @@ const SallaBulletDelivery = class {
704
5171
  else {
705
5172
  this.activeTab = "address";
706
5173
  }
5174
+ // Fetch address token for map (fire-and-forget, non-blocking)
5175
+ this.fetchAddressToken();
707
5176
  // Load countries always; load saved addresses only when address tab is active (lazy tab data).
708
5177
  if (this.isLoggedIn && this.activeTab === "address") {
709
5178
  this.loadingSavedAddresses = true;
@@ -1430,6 +5899,8 @@ const SallaBulletDelivery = class {
1430
5899
  */
1431
5900
  async handleAddNewAddress() {
1432
5901
  this.viewMode = "add-address";
5902
+ this.mapLocationData = null;
5903
+ this.fetchAddressToken();
1433
5904
  const intent = this.getStoredIntent();
1434
5905
  const sessionCountryId = getIntentCountryId(intent);
1435
5906
  if (sessionCountryId && this.countries.length > 0) {
@@ -1448,11 +5919,56 @@ const SallaBulletDelivery = class {
1448
5919
  }
1449
5920
  handleBackToAddressList() {
1450
5921
  this.viewMode = "main";
5922
+ this.mapLocationData = null;
5923
+ this.mapStep = 'map';
5924
+ this.addressDescription = '';
1451
5925
  }
5926
+ // ─── Map methods ───
5927
+ async fetchAddressToken() {
5928
+ if (this.addressToken || this.loadingToken)
5929
+ return;
5930
+ this.loadingToken = true;
5931
+ try {
5932
+ const mapsKey = salla.config.get('store.settings.keys.maps');
5933
+ if (mapsKey) {
5934
+ ee({
5935
+ key: mapsKey,
5936
+ libraries: ['marker', 'places'],
5937
+ language: salla.config.get('user.language_code') || 'ar',
5938
+ }).catch(err => log('Failed to load Google Maps SDK', err));
5939
+ }
5940
+ this.addressToken = await bulletDeliveryAPI.getAddressToken();
5941
+ }
5942
+ catch {
5943
+ log('SallaBulletDelivery: Failed to fetch address token');
5944
+ }
5945
+ finally {
5946
+ this.loadingToken = false;
5947
+ }
5948
+ }
5949
+ hasMapLocation() {
5950
+ return this.mapLocationData?.lat != null && this.mapLocationData?.lng != null;
5951
+ }
5952
+ // TODO: replace with actual setting key once dashboard setting is built
5953
+ get isMapSettingEnabled() {
5954
+ return Salla.config.get('store.settings.bullet_delivery.settings.map_enabled');
5955
+ }
5956
+ get isMapModeAvailable() {
5957
+ return this.isMapSettingEnabled && !!salla.config.get('store.settings.keys.maps') && !!this.addressToken;
5958
+ }
5959
+ // ─── End Map methods ───
1452
5960
  /**
1453
5961
  * Build address/location payload from guest-form state (same fields as add-address).
1454
5962
  */
1455
5963
  buildAddressLocationPayload() {
5964
+ if (this.isMapModeAvailable && this.hasMapLocation()) {
5965
+ return {
5966
+ lat: this.mapLocationData.lat,
5967
+ lng: this.mapLocationData.lng,
5968
+ ...(this.mapLocationData.shortAddress && { short_address: this.mapLocationData.shortAddress }),
5969
+ ...(this.addressDescription?.trim() && { description: this.addressDescription.trim() }),
5970
+ };
5971
+ }
1456
5972
  const districtName = this.selectedDistrict?.name ?? this.districtName?.trim() ?? "";
1457
5973
  return buildAddressLocationPayloadFromSelection({
1458
5974
  countryId: this.selectedCountry?.id ?? 0,
@@ -1461,6 +5977,9 @@ const SallaBulletDelivery = class {
1461
5977
  cityId: this.selectedCity?.id,
1462
5978
  districtId: this.selectedDistrict?.id,
1463
5979
  description: districtName,
5980
+ lat: this.mapLocationData?.lat,
5981
+ lng: this.mapLocationData?.lng,
5982
+ shortAddress: this.mapLocationData?.shortAddress,
1464
5983
  });
1465
5984
  }
1466
5985
  async handleTabChange(tab) {
@@ -1469,6 +5988,9 @@ const SallaBulletDelivery = class {
1469
5988
  this.tabChanging = true;
1470
5989
  try {
1471
5990
  this.activeTab = tab;
5991
+ if (this.viewMode === 'add-address') {
5992
+ this.viewMode = 'main';
5993
+ }
1472
5994
  this.showCartWillBeClearedBanner = false;
1473
5995
  this.allocationOutOfCoverageMessage = null;
1474
5996
  this.resetSearchState();
@@ -2214,7 +6736,21 @@ const SallaBulletDelivery = class {
2214
6736
  }
2215
6737
  } }, index.h("input", { type: "radio", name: "saved_address", class: "s-bullet-delivery-radio", checked: selected, disabled: disabled, onClick: (e) => e.stopPropagation() }), index.h("span", { class: "s-bullet-delivery-address-map-icon", innerHTML: MiniMap, "aria-hidden": "true" }), index.h("div", { class: "s-bullet-delivery-address-content" }, index.h("div", { class: "s-bullet-delivery-address-lines" }, index.h("span", { class: "s-bullet-delivery-address-line1" }, line1), index.h("span", { class: "s-bullet-delivery-address-line2" }, line2)))));
2216
6738
  }
6739
+ renderMapSection() {
6740
+ const isSA = isSaudiArabia(this.selectedCountry?.code ?? '');
6741
+ return (index.h("div", { class: "s-bullet-delivery-map-container" }, index.h("gmap-map", { ref: (el) => (this.gmapRef = el), zoom: 16, "map-id": "DEMO_MAP_ID", "enable-autocomplete": true, "enable-geolocation": true, "show-location-marker": true, 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 })));
6742
+ }
6743
+ renderAddressConfirmation() {
6744
+ const address = this.mapLocationData?.formattedAddress ?? '';
6745
+ const shortCode = this.mapLocationData?.shortAddress;
6746
+ return (index.h("div", { class: "s-bullet-delivery-address-confirm" }, index.h("div", { class: "s-bullet-delivery-address-confirm-card" }, index.h("div", { class: "s-bullet-delivery-address-confirm-details" }, index.h("span", { class: "s-bullet-delivery-address-confirm-label" }, Salla.lang.get('pages.checkout.selected_address')), index.h("p", { class: "s-bullet-delivery-address-confirm-text" }, address), shortCode && (index.h("span", { class: "s-bullet-delivery-address-confirm-tag" }, shortCode, index.h("span", { class: "s-bullet-delivery-address-confirm-tag-icon", innerHTML: LocationTag })))), index.h("button", { type: "button", class: "s-bullet-delivery-address-confirm-edit", onClick: () => { this.mapStep = 'map'; } }, Salla.lang.get('common.elements.edit'))), index.h("div", { class: "s-bullet-delivery-address-confirm-description" }, index.h("label", { class: "s-bullet-delivery-address-confirm-description-label" }, Salla.lang.get('pages.checkout.address_description'), index.h("span", { class: "s-bullet-delivery-address-confirm-description-optional" }, Salla.lang.get('common.elements.optional'))), index.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; } }))));
6747
+ }
2217
6748
  renderGuestDeliveryForm() {
6749
+ if (this.isMapModeAvailable) {
6750
+ return this.mapStep === 'confirm' && this.hasMapLocation()
6751
+ ? this.renderAddressConfirmation()
6752
+ : this.renderMapSection();
6753
+ }
2218
6754
  const isSA = isSaudiArabia(this.selectedCountry?.code ?? '');
2219
6755
  return [
2220
6756
  this.renderCountrySelect(),
@@ -2229,7 +6765,28 @@ const SallaBulletDelivery = class {
2229
6765
  "s-hidden": this.activeTab !== "address",
2230
6766
  } }, this.isLoggedIn
2231
6767
  ? this.renderSavedAddresses()
2232
- : this.renderGuestDeliveryForm()));
6768
+ : this.renderGuestDeliveryContent()));
6769
+ }
6770
+ renderGuestDeliveryContent() {
6771
+ if (!this.isMapModeAvailable) {
6772
+ return this.renderGuestDeliveryForm();
6773
+ }
6774
+ const hasMapLoc = this.hasMapLocation();
6775
+ const isConfirmStep = this.mapStep === 'confirm' && hasMapLoc;
6776
+ const submitLabel = isConfirmStep
6777
+ ? (this.savingAddress
6778
+ ? Salla.lang.get("pages.checkout.loading")
6779
+ : Salla.lang.get("pages.checkout.confirm_address"))
6780
+ : Salla.lang.get('pages.checkout.confirm_location');
6781
+ const handleSubmit = (e) => {
6782
+ e.preventDefault();
6783
+ if (!isConfirmStep && hasMapLoc) {
6784
+ this.mapStep = 'confirm';
6785
+ return;
6786
+ }
6787
+ this.handleSubmitAddAddress(e);
6788
+ };
6789
+ return (index.h("form", { onSubmit: handleSubmit }, this.renderGuestDeliveryForm(), index.h("div", { class: "s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single", style: { padding: '24px' } }, index.h("salla-button", { type: "submit", loading: this.savingAddress, disabled: !hasMapLoc || this.savingAddress, width: "wide" }, submitLabel), !this.isLoggedIn && (index.h("button", { type: "button", class: "s-bullet-delivery-login-prompt", onClick: () => this.handleLogin() }, Salla.lang.get('pages.checkout.login_to_use_saved_addresses'))))));
2233
6790
  }
2234
6791
  renderBranchSearch() {
2235
6792
  return (index.h("div", { class: "s-bullet-delivery-branch-search" }, index.h("div", { class: "s-bullet-delivery-search-row" }, index.h("div", { class: "s-bullet-delivery-search s-bullet-delivery-branch-search-wrap" }, index.h("span", { class: "s-bullet-delivery-search-icon s-bullet-delivery-branch-search-icon", innerHTML: search.Search, "aria-hidden": "true" }), index.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" })), index.h("button", { type: "button", class: {
@@ -2268,23 +6825,53 @@ const SallaBulletDelivery = class {
2268
6825
  "s-hidden": this.activeTab !== "branch",
2269
6826
  } }, this.renderCountrySelect(), this.renderBranchSearch(), this.renderBranchList()));
2270
6827
  }
2271
- /** Add-address form: same fields as guest form (country, region, city, district) only. */
6828
+ /** Add-address form: map two-step flow or dropdown fallback. */
2272
6829
  renderAddAddressForm() {
2273
- const title = Salla.lang.get("pages.checkout.add_new_address");
6830
+ Salla.lang.get("pages.checkout.add_new_address");
6831
+ const mapMode = this.isMapModeAvailable;
2274
6832
  const isSA = isSaudiArabia(this.selectedCountry?.code ?? '');
2275
- const canSubmit = this.selectedCountry &&
2276
- this.selectedCity &&
2277
- (!isSA || this.selectedRegion) &&
2278
- (!isSA ||
2279
- !!this.selectedDistrict ||
2280
- !!(this.districtName && this.districtName.trim().length > 0));
2281
- const submitLabel = this.savingAddress
2282
- ? Salla.lang.get("pages.checkout.loading")
2283
- : Salla.lang.get("pages.checkout.confirm_address");
2284
- const hasAddressesToGoBack = this.savedAddresses.length > 0 || hasSessionAddressIntent(this.getStoredIntent());
2285
- return (index.h("div", { class: "s-bullet-delivery-add-address" }, index.h("div", { class: "s-bullet-delivery-add-address-header" }, hasAddressesToGoBack ? (index.h("button", { type: "button", class: "s-bullet-delivery-add-address-title", onClick: () => this.handleBackToAddressList(), onKeyDown: (e) => e.key === "Enter" && this.handleBackToAddressList() }, index.h("span", { innerHTML: this.isRTL ? keyboard_arrow_right.ArrowRightIcon : keyboard_arrow_right.ArrowLeftIcon, "aria-hidden": "true" }), index.h("span", { class: "s-bullet-delivery-add-address-title-text" }, title))) : (index.h("span", { class: "s-bullet-delivery-add-address-title" }, index.h("span", { class: "s-bullet-delivery-add-address-title-text" }, title)))), index.h("form", { class: "s-bullet-delivery-add-address-form", onSubmit: (e) => this.handleSubmitAddAddress(e) }, this.renderGuestDeliveryForm(), index.h("div", { class: "s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single" }, index.h("salla-button", { type: "submit", loading: this.savingAddress, disabled: !canSubmit || this.savingAddress, class: "s-bullet-delivery-add-address-submit" }, submitLabel)))));
6833
+ const hasMapLoc = this.hasMapLocation();
6834
+ let canSubmit;
6835
+ let submitLabel;
6836
+ if (mapMode) {
6837
+ if (this.mapStep === 'map') {
6838
+ canSubmit = hasMapLoc;
6839
+ submitLabel = Salla.lang.get('pages.checkout.confirm_location');
6840
+ }
6841
+ else {
6842
+ canSubmit = hasMapLoc;
6843
+ submitLabel = this.savingAddress
6844
+ ? Salla.lang.get("pages.checkout.loading")
6845
+ : Salla.lang.get("pages.checkout.confirm_address");
6846
+ }
6847
+ }
6848
+ else {
6849
+ const canSubmitDropdowns = this.selectedCountry &&
6850
+ this.selectedCity &&
6851
+ (!isSA || this.selectedRegion) &&
6852
+ (!isSA ||
6853
+ !!this.selectedDistrict ||
6854
+ !!(this.districtName && this.districtName.trim().length > 0));
6855
+ canSubmit = hasMapLoc || canSubmitDropdowns;
6856
+ submitLabel = this.savingAddress
6857
+ ? Salla.lang.get("pages.checkout.loading")
6858
+ : Salla.lang.get("pages.checkout.confirm_address");
6859
+ }
6860
+ this.savedAddresses.length > 0 || hasSessionAddressIntent(this.getStoredIntent());
6861
+ const handleFormSubmit = (e) => {
6862
+ e.preventDefault();
6863
+ if (mapMode && this.mapStep === 'map' && hasMapLoc) {
6864
+ this.mapStep = 'confirm';
6865
+ return;
6866
+ }
6867
+ this.handleSubmitAddAddress(e);
6868
+ };
6869
+ return (index.h("div", { class: "s-bullet-delivery-add-address" }, index.h("form", { class: "s-bullet-delivery-add-address-form", onSubmit: handleFormSubmit }, this.renderGuestDeliveryForm(), index.h("div", { class: "s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single" }, index.h("salla-button", { type: "submit", loading: this.savingAddress, disabled: !canSubmit || this.savingAddress, class: "s-bullet-delivery-add-address-submit" }, submitLabel)))));
2286
6870
  }
2287
6871
  renderFooter() {
6872
+ if (this.activeTab === "address" && !this.isLoggedIn && this.isMapModeAvailable) {
6873
+ return null;
6874
+ }
2288
6875
  const showAddAddressInFooter = this.activeTab === "address" && this.isLoggedIn;
2289
6876
  return (index.h("div", { class: "s-bullet-delivery-footer" }, index.h("salla-button", { ref: (btn) => {
2290
6877
  this.confirmBtn = btn;
@@ -2300,7 +6887,7 @@ const SallaBulletDelivery = class {
2300
6887
  const activeTabView = this.activeTab === "branch" && this.supportsPickup
2301
6888
  ? this.renderPickupTab()
2302
6889
  : this.renderDeliveryTab();
2303
- return (index.h("div", null, index.h("div", { class: "s-bullet-delivery-header" }, index.h("h2", { class: "s-bullet-delivery-title" }, this.activeTab === 'address' ? Salla.lang.get('blocks.home.add_address_for_order_delivery') : Salla.lang.get('blocks.home.how_prefer_to_receive_order')), index.h("p", { class: "s-bullet-delivery-subtitle" }, this.activeTab === 'address' ? Salla.lang.get('blocks.home.products_available_for_delivery_shown_while_shopping') : Salla.lang.get('blocks.home.products_available_for_delivery_or_pickup_shown_while_shopping'))), this.renderTabs(), this.showCartWillBeClearedBanner &&
6890
+ return (index.h("div", null, this.showCartWillBeClearedBanner &&
2304
6891
  this.renderAlert(Salla.lang.get("blocks.scope.empty_cart_warning")), this.allocationOutOfCoverageMessage &&
2305
6892
  this.renderAllocationOutOfCoverageAlert(), activeTabView, !isAddressEmptyState && this.renderFooter()));
2306
6893
  }
@@ -2429,7 +7016,7 @@ const SallaBulletDelivery = class {
2429
7016
  return null;
2430
7017
  return (index.h(index.Host, { class: "s-bullet-delivery" }, index.h("salla-modal", { ref: (modal) => {
2431
7018
  this.modal = modal;
2432
- }, isClosable: !this.isRequired && !this.shouldForceNonClosable(), class: "s-bullet-delivery-modal", width: "sm" }, index.h("div", { class: "s-bullet-delivery-inner" }, this.viewMode === "main" && this.renderMainView(), this.viewMode === "add-address" && this.renderAddAddressForm()))));
7019
+ }, isClosable: !this.isRequired && !this.shouldForceNonClosable(), class: "s-bullet-delivery-modal", width: "sm" }, index.h("div", { class: "s-bullet-delivery-inner" }, index.h("div", { class: "s-bullet-delivery-header" }, index.h("h2", { class: "s-bullet-delivery-title" }, this.activeTab === 'address' ? Salla.lang.get('blocks.home.add_address_for_order_delivery') : Salla.lang.get('blocks.home.how_prefer_to_receive_order')), index.h("p", { class: "s-bullet-delivery-subtitle" }, this.activeTab === 'address' ? Salla.lang.get('blocks.home.products_available_for_delivery_shown_while_shopping') : Salla.lang.get('blocks.home.products_available_for_delivery_or_pickup_shown_while_shopping'))), this.renderTabs(), this.viewMode === "main" && this.renderMainView(), this.viewMode === "add-address" && this.renderAddAddressForm()))));
2433
7020
  }
2434
7021
  componentDidLoad() {
2435
7022
  // Mark component as ready