@salla.sa/twilight-components 2.14.557 → 2.14.558

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 (361) hide show
  1. package/dist/{esm/cart-DY4LZmNP.js → cjs/cart-DSvlJXCH.js} +4 -2
  2. package/dist/cjs/{filepond-B0WltAUU.js → filepond-LS8ytqmE.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-poster-CY6apY0i.js → filepond-plugin-file-poster-DexU9y97.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-size-D4ROC-Be.js → filepond-plugin-file-validate-size-BJJ_spY7.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-file-validate-type-6lBH-fIm.js → filepond-plugin-file-validate-type-BYz_biwv.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-edit-zEOX3Sjw.js → filepond-plugin-image-edit-C3R9xG9P.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-exif-orientation-y0OgGNND.js → filepond-plugin-image-exif-orientation-DC7e2K9l.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-preview-C-amHd3H.js → filepond-plugin-image-preview-DLbo1P7r.js} +1 -1
  9. package/dist/cjs/{index-CyKUnNvM.js → index-BkcJlC9S.js} +10 -14
  10. package/dist/cjs/{intlTelInput-CTwMzcpE.js → intlTelInput-DvZz7cvU.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +9 -4
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +3 -3
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +3 -3
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-applied-filters.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +11 -11
  21. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +5 -5
  24. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +3 -3
  26. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-comment-form_9.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-count-down_2.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  54. package/dist/cjs/{salla-slider.cjs.entry.js → salla-map_3.cjs.entry.js} +829 -1
  55. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-notification-item_2.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-branch.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-product-card.cjs.entry.js +48 -13
  81. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-search.cjs.entry.js +279 -33
  91. package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
  92. package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
  93. package/dist/cjs/salla-social.cjs.entry.js +2 -2
  94. package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
  95. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
  97. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-user-menu.cjs.entry.js +3 -3
  99. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-user-settings.cjs.entry.js +2 -2
  101. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +2 -2
  104. package/dist/cjs/twilight.cjs.js +2 -2
  105. package/dist/cjs/{vanilla-picker-B_r1mvJW.js → vanilla-picker-COagKVR0.js} +1 -1
  106. package/dist/collection/components/salla-modal/salla-modal.css +34 -16
  107. package/dist/collection/components/salla-modal/salla-modal.js +27 -2
  108. package/dist/collection/components/salla-product-card/salla-product-card.css +22 -2
  109. package/dist/collection/components/salla-product-card/salla-product-card.js +106 -11
  110. package/dist/collection/components/salla-search/interfaces.js +1 -0
  111. package/dist/collection/components/salla-search/salla-search.css +324 -14
  112. package/dist/collection/components/salla-search/salla-search.js +179 -32
  113. package/dist/collection/components/salla-search/utils.js +111 -0
  114. package/dist/collection/components/salla-searchable-dropdown/salla-searchable-dropdown.js +4 -4
  115. package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
  116. package/dist/collection/components/salla-social/salla-social.js +1 -1
  117. package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
  118. package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
  119. package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
  120. package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
  121. package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
  122. package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
  123. package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
  124. package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.js +1 -1
  125. package/dist/components/index.js +2 -2
  126. package/dist/components/salla-modal2.js +9 -3
  127. package/dist/components/salla-product-card2.js +50 -12
  128. package/dist/components/salla-search.js +392 -39
  129. package/dist/components/salla-searchable-dropdown2.js +4 -4
  130. package/dist/components/salla-skeleton2.js +1 -1
  131. package/dist/components/salla-social-share2.js +1 -1
  132. package/dist/components/salla-social.js +1 -1
  133. package/dist/components/salla-tab-content2.js +1 -1
  134. package/dist/components/salla-tab-header2.js +1 -1
  135. package/dist/components/salla-tabs2.js +1 -1
  136. package/dist/components/salla-tel-input2.js +1 -1
  137. package/dist/components/salla-tooltip2.js +1 -1
  138. package/dist/components/salla-user-settings.js +1 -1
  139. package/dist/components/salla-wishlist-actions.js +1 -1
  140. package/dist/{cjs/cart-s-x1Fshk.js → esm/cart-gFG8By9O.js} +2 -4
  141. package/dist/esm/{filepond-B9wUqRiS.js → filepond-D5Fnwsco.js} +1 -1
  142. package/dist/esm/{filepond-plugin-file-poster-Cms0jrkz.js → filepond-plugin-file-poster-BfePPO64.js} +1 -1
  143. package/dist/esm/{filepond-plugin-file-validate-size-B2gy-nn6.js → filepond-plugin-file-validate-size-CVpLCDVB.js} +1 -1
  144. package/dist/esm/{filepond-plugin-file-validate-type-D_AqfbaS.js → filepond-plugin-file-validate-type-BhzMnQfH.js} +1 -1
  145. package/dist/esm/{filepond-plugin-image-edit-ChS3tv_T.js → filepond-plugin-image-edit-Bvj3qwXE.js} +1 -1
  146. package/dist/esm/{filepond-plugin-image-exif-orientation-iLQFxzEc.js → filepond-plugin-image-exif-orientation-NlBBLgPL.js} +1 -1
  147. package/dist/esm/{filepond-plugin-image-preview-Dm1gYrYZ.js → filepond-plugin-image-preview-CA1k8ex-.js} +1 -1
  148. package/dist/esm/{index-BLzx0e6P.js → index-B6Lo-Jz2.js} +10 -14
  149. package/dist/esm/{intlTelInput-BTOzA2B4.js → intlTelInput-nu7FH85H.js} +1 -1
  150. package/dist/esm/loader.js +3 -3
  151. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  152. package/dist/esm/salla-accordion_6.entry.js +9 -4
  153. package/dist/esm/salla-add-product-button_5.entry.js +3 -3
  154. package/dist/esm/salla-advertisement.entry.js +1 -1
  155. package/dist/esm/salla-alert_2.entry.js +3 -3
  156. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  157. package/dist/esm/salla-applied-filters.entry.js +1 -1
  158. package/dist/esm/salla-apps-icons.entry.js +1 -1
  159. package/dist/esm/salla-attachment-view_9.entry.js +11 -11
  160. package/dist/esm/salla-badge.entry.js +1 -1
  161. package/dist/esm/salla-basket-gap.entry.js +1 -1
  162. package/dist/esm/salla-bullet-delivery_3.entry.js +5 -5
  163. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  164. package/dist/esm/salla-cart-item-offers_2.entry.js +3 -3
  165. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  166. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  167. package/dist/esm/salla-comment-factors.entry.js +1 -1
  168. package/dist/esm/salla-comment-form_9.entry.js +1 -1
  169. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  170. package/dist/esm/salla-contacts.entry.js +1 -1
  171. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  172. package/dist/esm/salla-count-down_2.entry.js +1 -1
  173. package/dist/esm/salla-custom-fields.entry.js +1 -1
  174. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  175. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  176. package/dist/esm/salla-filters-widget.entry.js +1 -1
  177. package/dist/esm/salla-filters.entry.js +1 -1
  178. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  179. package/dist/esm/salla-gifting.entry.js +1 -1
  180. package/dist/esm/salla-hook.entry.js +1 -1
  181. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  182. package/dist/esm/salla-installment.entry.js +1 -1
  183. package/dist/esm/salla-list-tile.entry.js +1 -1
  184. package/dist/esm/salla-localization-modal.entry.js +1 -1
  185. package/dist/esm/salla-login-modal.entry.js +1 -1
  186. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  187. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  188. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  189. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  190. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  191. package/dist/esm/salla-loyalty.entry.js +1 -1
  192. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  193. package/dist/esm/{salla-slider.entry.js → salla-map_3.entry.js} +828 -2
  194. package/dist/esm/salla-menu.entry.js +1 -1
  195. package/dist/esm/salla-metadata.entry.js +1 -1
  196. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  197. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  198. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  199. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  200. package/dist/esm/salla-notification-item_2.entry.js +1 -1
  201. package/dist/esm/salla-offer-modal.entry.js +1 -1
  202. package/dist/esm/salla-offer.entry.js +1 -1
  203. package/dist/esm/salla-order-branch.entry.js +1 -1
  204. package/dist/esm/salla-order-cancel.entry.js +1 -1
  205. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  206. package/dist/esm/salla-order-details-options.entry.js +1 -1
  207. package/dist/esm/salla-order-details.entry.js +1 -1
  208. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  209. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  210. package/dist/esm/salla-order-edit.entry.js +1 -1
  211. package/dist/esm/salla-order-shipments.entry.js +1 -1
  212. package/dist/esm/salla-order-summary.entry.js +1 -1
  213. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  214. package/dist/esm/salla-orders.entry.js +1 -1
  215. package/dist/esm/salla-payments.entry.js +1 -1
  216. package/dist/esm/salla-placeholder.entry.js +1 -1
  217. package/dist/esm/salla-price-range.entry.js +1 -1
  218. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  219. package/dist/esm/salla-product-card.entry.js +48 -13
  220. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  221. package/dist/esm/salla-products-list.entry.js +1 -1
  222. package/dist/esm/salla-products-slider.entry.js +1 -1
  223. package/dist/esm/salla-quick-order.entry.js +1 -1
  224. package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
  225. package/dist/esm/salla-rating-modal.entry.js +1 -1
  226. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  227. package/dist/esm/salla-review-order-item.entry.js +1 -1
  228. package/dist/esm/salla-scopes.entry.js +1 -1
  229. package/dist/esm/salla-search.entry.js +279 -33
  230. package/dist/esm/salla-skeleton.entry.js +2 -2
  231. package/dist/esm/salla-social-share.entry.js +2 -2
  232. package/dist/esm/salla-social.entry.js +2 -2
  233. package/dist/esm/salla-tab-content_3.entry.js +4 -4
  234. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  235. package/dist/esm/salla-tooltip.entry.js +2 -2
  236. package/dist/esm/salla-trust-badges.entry.js +1 -1
  237. package/dist/esm/salla-user-menu.entry.js +3 -3
  238. package/dist/esm/salla-user-profile.entry.js +1 -1
  239. package/dist/esm/salla-user-settings.entry.js +2 -2
  240. package/dist/esm/salla-verify.entry.js +1 -1
  241. package/dist/esm/salla-wallet.entry.js +1 -1
  242. package/dist/esm/salla-wishlist-actions.entry.js +2 -2
  243. package/dist/esm/twilight.js +3 -3
  244. package/dist/esm/{vanilla-picker-CbIzx8P3.js → vanilla-picker-Dn7Q0By-.js} +1 -1
  245. package/dist/twilight/{p-d1ba8e6e.entry.js → p-00f3dc2a.entry.js} +1 -1
  246. package/dist/twilight/{p-7d86bc77.entry.js → p-051740db.entry.js} +1 -1
  247. package/dist/twilight/{p-595bfef8.entry.js → p-05f65278.entry.js} +1 -1
  248. package/dist/twilight/{p-c9d10c9f.entry.js → p-0e9845d3.entry.js} +1 -1
  249. package/dist/twilight/{p-46ba098a.entry.js → p-0ea66288.entry.js} +1 -1
  250. package/dist/twilight/{p-3b4b1f29.entry.js → p-0f9d25c2.entry.js} +1 -1
  251. package/dist/twilight/{p-6866b3d6.entry.js → p-100cb969.entry.js} +1 -1
  252. package/dist/twilight/{p-96a13e17.entry.js → p-11234d66.entry.js} +1 -1
  253. package/dist/twilight/{p-365745de.entry.js → p-1546f64d.entry.js} +1 -1
  254. package/dist/twilight/{p-c0fc7756.entry.js → p-191b4fa6.entry.js} +1 -1
  255. package/dist/twilight/{p-5cbd36fb.entry.js → p-19607f60.entry.js} +1 -1
  256. package/dist/twilight/p-1d1bbac7.entry.js +4 -0
  257. package/dist/twilight/{p-932e3bff.entry.js → p-1d220636.entry.js} +1 -1
  258. package/dist/twilight/{p-eb10186c.entry.js → p-1d9aa36c.entry.js} +1 -1
  259. package/dist/twilight/{p-53285f66.entry.js → p-257717f5.entry.js} +1 -1
  260. package/dist/twilight/{p-4cabeff6.entry.js → p-289574f0.entry.js} +1 -1
  261. package/dist/twilight/{p-f276a319.entry.js → p-28aeea5d.entry.js} +1 -1
  262. package/dist/twilight/{p-6ea62f2b.entry.js → p-29a9ff44.entry.js} +1 -1
  263. package/dist/twilight/{p-7767f3a7.entry.js → p-2cb160a8.entry.js} +1 -1
  264. package/dist/twilight/{p-0416a2a8.entry.js → p-2dc5f115.entry.js} +1 -1
  265. package/dist/twilight/{p-8d8c84d8.entry.js → p-2de7945d.entry.js} +1 -1
  266. package/dist/twilight/{p-9ef91e6b.entry.js → p-2ebe428c.entry.js} +1 -1
  267. package/dist/twilight/{p-2a5b180a.entry.js → p-31c017ae.entry.js} +1 -1
  268. package/dist/twilight/p-344e7a53.entry.js +4 -0
  269. package/dist/twilight/{p-59ccfd64.entry.js → p-3661b790.entry.js} +1 -1
  270. package/dist/twilight/{p-47597499.entry.js → p-3c312812.entry.js} +1 -1
  271. package/dist/twilight/{p-7ffa452c.entry.js → p-3f12a3a2.entry.js} +1 -1
  272. package/dist/twilight/{p-8e2f52b2.entry.js → p-400c631e.entry.js} +1 -1
  273. package/dist/twilight/{p-a4175383.entry.js → p-44f20e64.entry.js} +1 -1
  274. package/dist/twilight/{p-738ec366.entry.js → p-4604590c.entry.js} +1 -1
  275. package/dist/twilight/{p-07b67ef6.entry.js → p-4c422a3d.entry.js} +1 -1
  276. package/dist/twilight/{p-c428c44b.entry.js → p-4f645457.entry.js} +1 -1
  277. package/dist/twilight/{p-86cd2898.entry.js → p-529a60e2.entry.js} +1 -1
  278. package/dist/twilight/{p-cd86c231.entry.js → p-5a2150e8.entry.js} +1 -1
  279. package/dist/twilight/{p-de3b3e41.entry.js → p-5d6db148.entry.js} +1 -1
  280. package/dist/twilight/{p-fa459971.entry.js → p-5d6f9c3e.entry.js} +1 -1
  281. package/dist/twilight/{p-1bfb9675.entry.js → p-5dcf8a71.entry.js} +1 -1
  282. package/dist/twilight/{p-bba884dc.entry.js → p-5f4331f0.entry.js} +1 -1
  283. package/dist/twilight/{p-06c1c936.entry.js → p-5ffdb544.entry.js} +1 -1
  284. package/dist/twilight/{p-fa7966bd.entry.js → p-63b48fb1.entry.js} +1 -1
  285. package/dist/twilight/{p-eb9fca37.entry.js → p-647a1b63.entry.js} +1 -1
  286. package/dist/twilight/{p-cb7bc39f.entry.js → p-6840449d.entry.js} +1 -1
  287. package/dist/twilight/{p-5bb8c263.entry.js → p-747fdf8c.entry.js} +1 -1
  288. package/dist/twilight/{p-7f077279.entry.js → p-7512638e.entry.js} +1 -1
  289. package/dist/twilight/{p-f602c556.entry.js → p-75ba562a.entry.js} +1 -1
  290. package/dist/twilight/{p-3a97face.entry.js → p-7639c5a8.entry.js} +1 -1
  291. package/dist/twilight/{p-6d8b0678.entry.js → p-778f38ce.entry.js} +1 -1
  292. package/dist/twilight/{p-7c859f0c.entry.js → p-785ac87d.entry.js} +1 -1
  293. package/dist/twilight/{p-34f2d378.entry.js → p-78cba566.entry.js} +1 -1
  294. package/dist/twilight/{p-ed3fc3bb.entry.js → p-7a78cbcd.entry.js} +1 -1
  295. package/dist/twilight/{p-96ded4cf.entry.js → p-7b286e8d.entry.js} +1 -1
  296. package/dist/twilight/{p-ada5f9db.entry.js → p-8284d68b.entry.js} +1 -1
  297. package/dist/twilight/{p-6af36173.entry.js → p-86622485.entry.js} +1 -1
  298. package/dist/twilight/{p-67caf54b.entry.js → p-8ca39b58.entry.js} +1 -1
  299. package/dist/twilight/{p-a51931ba.entry.js → p-8e10a9a9.entry.js} +1 -1
  300. package/dist/twilight/{p-98e83214.entry.js → p-8ee698cc.entry.js} +1 -1
  301. package/dist/twilight/{p-a7801576.entry.js → p-8f11c556.entry.js} +1 -1
  302. package/dist/twilight/{p-18d0c69f.entry.js → p-91ab3a03.entry.js} +1 -1
  303. package/dist/twilight/{p-iB9dUe00.js → p-9L0Aq4PZ.js} +1 -1
  304. package/dist/twilight/{p-BLzx0e6P.js → p-B6Lo-Jz2.js} +1 -1
  305. package/dist/twilight/{p-BBCmWsAH.js → p-Ble2-eBI.js} +1 -1
  306. package/dist/twilight/{p-BTjFfROl.js → p-BopTxsQ2.js} +1 -1
  307. package/dist/twilight/{p-Bi7BjntU.js → p-CMHD60jb.js} +1 -1
  308. package/dist/twilight/{p-oVUukCva.js → p-CUuXQJdT.js} +1 -1
  309. package/dist/twilight/{p-BQGQ9tVS.js → p-CvrBhStg.js} +1 -1
  310. package/dist/twilight/{p-CBW4kczX.js → p-DexDAAf1.js} +1 -1
  311. package/dist/twilight/{p-C_G6bYCk.js → p-Dgq6RHqV.js} +1 -1
  312. package/dist/twilight/{p-BqaOIJsE.js → p-VJGJYEfb.js} +1 -1
  313. package/dist/twilight/{p-ee463cf9.entry.js → p-a1035984.entry.js} +1 -1
  314. package/dist/twilight/{p-61b6c754.entry.js → p-a50073b5.entry.js} +1 -1
  315. package/dist/twilight/{p-1420e962.entry.js → p-a82db499.entry.js} +1 -1
  316. package/dist/twilight/{p-c69e0669.entry.js → p-a8d3ae7e.entry.js} +1 -1
  317. package/dist/twilight/{p-bc0bc63f.entry.js → p-a8d90638.entry.js} +1 -1
  318. package/dist/twilight/{p-0c80fbcf.entry.js → p-abce7e02.entry.js} +1 -1
  319. package/dist/twilight/{p-7a19cb93.entry.js → p-ad12ab8c.entry.js} +1 -1
  320. package/dist/twilight/{p-fad4aa22.entry.js → p-adb31a76.entry.js} +1 -1
  321. package/dist/twilight/{p-9ddcdf20.entry.js → p-b5a68a1a.entry.js} +1 -1
  322. package/dist/twilight/{p-407a73f4.entry.js → p-b695db2e.entry.js} +1 -1
  323. package/dist/twilight/{p-f87ba34e.entry.js → p-ba941354.entry.js} +1 -1
  324. package/dist/twilight/{p-3ba22519.entry.js → p-bb94c4e4.entry.js} +1 -1
  325. package/dist/twilight/{p-33e0d7b8.entry.js → p-bbfaf5ac.entry.js} +1 -1
  326. package/dist/twilight/{p-809a0076.entry.js → p-be292e0b.entry.js} +1 -1
  327. package/dist/twilight/{p-b36ca739.entry.js → p-be34bd30.entry.js} +1 -1
  328. package/dist/twilight/{p-5f6c10d6.entry.js → p-bf2f2a36.entry.js} +1 -1
  329. package/dist/twilight/{p-2b7ca018.entry.js → p-bfa7a257.entry.js} +1 -1
  330. package/dist/twilight/{p-be424137.entry.js → p-c39c8112.entry.js} +1 -1
  331. package/dist/twilight/{p-99a757ac.entry.js → p-c56e1aa1.entry.js} +1 -1
  332. package/dist/twilight/{p-d84a11b8.entry.js → p-c8c09f5c.entry.js} +1 -1
  333. package/dist/twilight/{p-a0c97ac9.entry.js → p-c8c34286.entry.js} +1 -1
  334. package/dist/twilight/{p-5cc80969.entry.js → p-d41903f9.entry.js} +1 -1
  335. package/dist/twilight/{p-c4f963ea.entry.js → p-d55b86b5.entry.js} +1 -1
  336. package/dist/twilight/{p-3cc1a9b8.entry.js → p-d72e0350.entry.js} +1 -1
  337. package/dist/twilight/{p-2c0870cb.entry.js → p-d96bc0c1.entry.js} +1 -1
  338. package/dist/twilight/{p-81f8537a.entry.js → p-db9f8104.entry.js} +2 -2
  339. package/dist/twilight/{p-45706908.entry.js → p-dd734bcb.entry.js} +1 -1
  340. package/dist/twilight/p-df9d5f85.entry.js +4 -0
  341. package/dist/twilight/{p-05490b44.entry.js → p-e3a45456.entry.js} +1 -1
  342. package/dist/twilight/{p-2bd06384.entry.js → p-e5169250.entry.js} +1 -1
  343. package/dist/twilight/{p-a4b7ee47.entry.js → p-ea606acc.entry.js} +1 -1
  344. package/dist/twilight/{p-8b81811b.entry.js → p-effc8ceb.entry.js} +1 -1
  345. package/dist/twilight/{p-894fdcdd.entry.js → p-f2fb1121.entry.js} +1 -1
  346. package/dist/twilight/{p-210095ee.entry.js → p-fa7c358f.entry.js} +1 -1
  347. package/dist/twilight/{p-DY4LZmNP.js → p-gFG8By9O.js} +1 -1
  348. package/dist/twilight/twilight.esm.js +1 -1
  349. package/dist/types/components/salla-modal/salla-modal.d.ts +5 -0
  350. package/dist/types/components/salla-product-card/salla-product-card.d.ts +18 -0
  351. package/dist/types/components/salla-search/interfaces.d.ts +21 -0
  352. package/dist/types/components/salla-search/salla-search.d.ts +40 -2
  353. package/dist/types/components/salla-search/utils.d.ts +19 -0
  354. package/dist/types/components.d.ts +40 -0
  355. package/package.json +5 -5
  356. package/dist/cjs/salla-map_2.cjs.entry.js +0 -835
  357. package/dist/esm/salla-map_2.entry.js +0 -832
  358. package/dist/twilight/p-05b66ce1.entry.js +0 -4
  359. package/dist/twilight/p-56b2f8d7.entry.js +0 -4
  360. package/dist/twilight/p-8a7bb785.entry.js +0 -4
  361. package/dist/twilight/p-a8b41edc.entry.js +0 -4
@@ -3,22 +3,165 @@
3
3
  */
4
4
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
5
5
  import { S as Search } from './search.js';
6
+ import { C as Cancel } from './cancel.js';
7
+ import { K as KeyBoardArrowLeftIcon, a as KeyBoardArrowRightIcon } from './keyboard_arrow_left.js';
6
8
  import { H as Helper } from './Helper.js';
7
- import { d as defineCustomElement$4 } from './salla-button2.js';
8
- import { d as defineCustomElement$3 } from './salla-loading2.js';
9
- import { d as defineCustomElement$2 } from './salla-modal2.js';
9
+ import { d as defineCustomElement$l } from './salla-add-product-button2.js';
10
+ import { d as defineCustomElement$k } from './salla-attachment-view2.js';
11
+ import { d as defineCustomElement$j } from './salla-booking-field2.js';
12
+ import { d as defineCustomElement$i } from './salla-button2.js';
13
+ import { d as defineCustomElement$h } from './salla-color-picker2.js';
14
+ import { d as defineCustomElement$g } from './salla-conditional-fields2.js';
15
+ import { d as defineCustomElement$f } from './salla-count-down2.js';
16
+ import { d as defineCustomElement$e } from './salla-datetime-picker2.js';
17
+ import { d as defineCustomElement$d } from './salla-file-upload2.js';
18
+ import { d as defineCustomElement$c } from './salla-loading2.js';
19
+ import { d as defineCustomElement$b } from './salla-map2.js';
20
+ import { d as defineCustomElement$a } from './salla-modal2.js';
21
+ import { d as defineCustomElement$9 } from './salla-order-options-modal2.js';
22
+ import { d as defineCustomElement$8 } from './salla-product-availability2.js';
23
+ import { d as defineCustomElement$7 } from './salla-product-card2.js';
24
+ import { d as defineCustomElement$6 } from './salla-product-options2.js';
25
+ import { d as defineCustomElement$5 } from './salla-progress-bar2.js';
26
+ import { d as defineCustomElement$4 } from './salla-quick-buy2.js';
27
+ import { d as defineCustomElement$3 } from './salla-slider2.js';
28
+ import { d as defineCustomElement$2 } from './salla-tel-input2.js';
10
29
 
11
- const sallaSearchCss = "/*!twlt*/.s-search-placeholder-wrapper{position:relative;display:inline-block}.s-search-input-wrapper{position:relative}.s-search-placeholder-trigger{cursor:pointer;appearance:none;text-align:start}.block{display:block}.inline{display:inline}.border{border-width:1px}.s-search-container{position:relative;z-index:99;max-height:14rem;border-radius:0.375rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-search-oval{border-radius:20px}.s-search-inline{min-width:220px}.s-search-container-open{max-height:24rem;border-radius:0px !important}.s-search-container-open .s-search-input{border-top-left-radius:0.375rem !important;border-top-right-radius:0.375rem !important;border-bottom-right-radius:0px !important;border-bottom-left-radius:0px !important;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-search-no-results .s-search-input{border-bottom-right-radius:0px;border-bottom-left-radius:0px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-search-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-top:0px;padding-bottom:0.125rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-search-input:focus{--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-ring-color:transparent}.s-search-input:where([dir=\"ltr\"],[dir=\"ltr\"] *){padding-left:2.5rem}.s-search-input:where([dir=\"rtl\"],[dir=\"rtl\"] *){padding-right:2.5rem}.s-search-icon-wrap{position:absolute;top:50%;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));line-height:1;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-icon-wrap:where([dir=\"ltr\"],[dir=\"ltr\"] *){left:1rem}.s-search-icon-wrap:where([dir=\"rtl\"],[dir=\"rtl\"] *){right:1rem}.s-search-icon svg{height:1rem;width:1rem;fill:#9ca3af}.s-search-spinner-loader{display:block;height:1rem;width:1rem}@keyframes spin{to{transform:rotate(360deg)}}.s-search-spinner-loader{animation:spin 1s linear infinite;border-radius:9999px;border-width:2px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));border-right-color:var(--color-primary)}.s-search-results{position:absolute;margin:auto;max-height:24rem;width:100%;max-width:100%;overflow-y:auto;border-bottom-right-radius:0.375rem;border-bottom-left-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-search-no-results{border-bottom-right-radius:0px !important;border-bottom-left-radius:0px !important}.s-search-no-results-placeholder{padding:1rem;text-align:center;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-product{display:flex;height:100%;justify-content:space-around;overflow:hidden;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));background-color:transparent;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-search-product:last-child{border-bottom-width:0px}.s-search-product:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}@media (min-width: 480px){.s-search-product{padding-left:1.25rem;padding-right:1.25rem}}.s-search-product-image-container{position:relative;height:3.5rem;width:5rem;overflow:hidden;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-search-product-image{position:relative;height:100%;width:100%;object-fit:cover;font-size:0px}.s-search-product-image::before{position:absolute;top:0px;left:0px;height:100%;width:100%;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));--tw-content:'';content:var(--tw-content)}.s-search-product-details{flex:1 1 0%;padding-top:0.25rem}.s-search-product-details:where([dir=\"ltr\"],[dir=\"ltr\"] *){padding-left:1rem}@media (min-width: 480px){.s-search-product-details:where([dir=\"ltr\"],[dir=\"ltr\"] *){padding-left:1.25rem}}.s-search-product-details:where([dir=\"rtl\"],[dir=\"rtl\"] *){padding-right:1rem}@media (min-width: 480px){.s-search-product-details:where([dir=\"rtl\"],[dir=\"rtl\"] *){padding-right:1.25rem}}.s-search-product-title{margin-bottom:0.375rem;display:flex;flex-direction:column;align-items:baseline;justify-content:flex-start;font-size:0.875rem;font-weight:700;line-height:1.5rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-search-product-price{display:flex;width:100%;align-items:center;font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary)}.s-search-product-regular-price{padding-left:0.75rem;padding-right:0.75rem;font-weight:500;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-search-product-not-available{--tw-grayscale:grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-search-action{position:absolute;height:100%}.s-search-action:where([dir=\"ltr\"],[dir=\"ltr\"] *){right:0px}.s-search-action:where([dir=\"rtl\"],[dir=\"rtl\"] *){left:0px;border-top-right-radius:0px;border-bottom-right-radius:0px}.s-search-action-oval:where([dir=\"ltr\"],[dir=\"ltr\"] *){border-top-right-radius:9999px;border-bottom-right-radius:9999px}.s-search-action-oval:where([dir=\"rtl\"],[dir=\"rtl\"] *){border-top-left-radius:9999px;border-bottom-left-radius:9999px}.s-search-input-wrapper{position:relative;display:flex;flex-grow:1;align-items:center}.s-search-modal .s-modal-wrapper{align-items:flex-start;padding:0}.s-search-modal .s-modal-spacer{display:inline}.s-search-modal .s-modal-body{padding:0;width:700px;max-width:90%;margin-top:3.2rem;border-radius:0.5rem;background:transparent;overflow:visible;position:relative !important}.s-search-modal .s-modal-close{top:50%;transform:translateY(-50%)}";
30
+ const NEW_SEARCH_FEATURE_FLAG = 'new-search-ui-enabled';
31
+ const SEARCH_HISTORY_KEY = 'salla::search-history';
32
+ const SEARCH_HISTORY_LIMIT = 10;
33
+ // Multi-market stores scope search history per market via the `scope` query param.
34
+ function getSearchHistoryKey() {
35
+ if (typeof window === 'undefined') {
36
+ return SEARCH_HISTORY_KEY;
37
+ }
38
+ const scope = new URLSearchParams(window.location.search).get('scope');
39
+ return scope ? `${SEARCH_HISTORY_KEY}-${scope}` : SEARCH_HISTORY_KEY;
40
+ }
41
+ const DEFAULT_LABELS = {
42
+ searchPlaceholder: '',
43
+ noOptions: '',
44
+ outOfStock: '',
45
+ close: '',
46
+ back: '',
47
+ remove: '',
48
+ searchHistory: '',
49
+ trendingCategories: '',
50
+ mostSearched: '',
51
+ searchSuggestions: '',
52
+ categories: '',
53
+ searchResults: '',
54
+ searchViewAllTemplate: '',
55
+ };
56
+ // Labels not yet in the central translation files - seeded via addBulk only when missing.
57
+ const TRANSLATION_DEFAULTS = {
58
+ 'common.elements.search_history': { ar: 'آخر ما تم البحث عنه', en: 'Recently Searched' },
59
+ 'common.elements.trending_categories': {
60
+ ar: 'التصنيفات الأكثر بحثاً',
61
+ en: 'Trending categories',
62
+ },
63
+ 'common.elements.most_searched': { ar: 'الأكثر بحثاً', en: 'Most searched' },
64
+ 'common.elements.search_suggestions': { ar: 'اقتراحات البحث', en: 'Search suggestions' },
65
+ 'common.elements.categories': { ar: 'التصنيفات', en: 'Categories' },
66
+ 'common.elements.search_results': { ar: 'نتائج البحث', en: 'Search results' },
67
+ 'common.elements.search_view_all': {
68
+ ar: 'عرض كل النتائج لـ ":word"',
69
+ en: 'View all results for ":word"',
70
+ },
71
+ };
72
+ function isNewSearchFeatureEnabled() {
73
+ const flag = salla.storage.get(NEW_SEARCH_FEATURE_FLAG, false);
74
+ return flag === true || flag === 'true';
75
+ }
76
+ function getSearchResultsUrl(term) {
77
+ return salla.url.get('search?q=' + encodeURI(term));
78
+ }
79
+ function loadSearchHistory() {
80
+ const key = getSearchHistoryKey();
81
+ const stored = salla.storage.get(key, []);
82
+ return Array.isArray(stored) ? stored.filter(term => typeof term === 'string') : [];
83
+ }
84
+ function saveSearchHistory(history) {
85
+ const key = getSearchHistoryKey();
86
+ salla.storage.set(key, history);
87
+ }
88
+ function addToSearchHistory(history, term) {
89
+ const trimmed = term.trim();
90
+ if (!trimmed) {
91
+ return history;
92
+ }
93
+ const withoutDuplicate = history.filter(existing => existing.toLowerCase() !== trimmed.toLowerCase());
94
+ return [trimmed, ...withoutDuplicate].slice(0, SEARCH_HISTORY_LIMIT);
95
+ }
96
+ function registerTranslationDefaults() {
97
+ if (!salla?.lang?.addBulk) {
98
+ return;
99
+ }
100
+ const missing = Object.entries(TRANSLATION_DEFAULTS).reduce((acc, [key, value]) => {
101
+ if (salla.lang.get(key) === key) {
102
+ acc[key] = value;
103
+ }
104
+ return acc;
105
+ }, {});
106
+ if (Object.keys(missing).length) {
107
+ salla.lang.addBulk(missing);
108
+ }
109
+ }
110
+ function loadLabels() {
111
+ return {
112
+ searchPlaceholder: salla.lang.get('blocks.header.search_placeholder'),
113
+ noOptions: salla.lang.get('common.elements.no_options'),
114
+ outOfStock: salla.lang.get('pages.products.out_of_stock'),
115
+ close: salla.lang.get('common.elements.close'),
116
+ back: salla.lang.get('common.elements.back'),
117
+ remove: salla.lang.get('common.elements.remove'),
118
+ searchHistory: salla.lang.get('common.elements.search_history'),
119
+ trendingCategories: salla.lang.get('common.elements.trending_categories'),
120
+ mostSearched: salla.lang.get('common.elements.most_searched'),
121
+ searchSuggestions: salla.lang.get('common.elements.search_suggestions'),
122
+ categories: salla.lang.get('common.elements.categories'),
123
+ searchResults: salla.lang.get('common.elements.search_results'),
124
+ searchViewAllTemplate: salla.lang.get('common.elements.search_view_all'),
125
+ };
126
+ }
127
+ function getDefaultProductSlot() {
128
+ return ('<div class="s-search-product-image-container">' +
129
+ ' <img class="s-search-product-image" src="{image}" alt="{name}"/>' +
130
+ '</div>' +
131
+ '<div class="s-search-product-details">' +
132
+ ' <div class="s-search-product-title">{name}</div> <div class="s-search-product-price">{price} <span class="s-search-product-regular-price">{regular_price}</span></div>' +
133
+ '</div>');
134
+ }
135
+
136
+ const sallaSearchCss = "/*!twlt*/.s-search-placeholder-wrapper{position:relative;display:inline-block}.s-search-input-wrapper{position:relative}.s-search-placeholder-trigger{cursor:pointer;appearance:none;text-align:start}.visible{visibility:visible}.block{display:block}.inline{display:inline}.hidden{display:none}.border{border-width:1px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-search-container{position:relative;z-index:99;max-height:14rem;border-radius:0.375rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-search-oval{border-radius:20px}.s-search-inline{min-width:220px}.s-search-container-open{max-height:24rem;border-radius:0px !important}.s-search-container-open .s-search-input{border-top-left-radius:0.375rem !important;border-top-right-radius:0.375rem !important;border-bottom-right-radius:0px !important;border-bottom-left-radius:0px !important;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-search-no-results .s-search-input{border-bottom-right-radius:0px;border-bottom-left-radius:0px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-search-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-top:0px;padding-bottom:0.125rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-search-input:focus{--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-ring-color:transparent}.s-search-input:where([dir=\"ltr\"],[dir=\"ltr\"] *){padding-left:2.5rem}.s-search-input:where([dir=\"rtl\"],[dir=\"rtl\"] *){padding-right:2.5rem}.s-search-modal-new .s-search-input{--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-search-icon-wrap{position:absolute;top:50%;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));line-height:1;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-icon-wrap:where([dir=\"ltr\"],[dir=\"ltr\"] *){left:1rem}.s-search-icon-wrap:where([dir=\"rtl\"],[dir=\"rtl\"] *){right:1rem}.s-search-icon svg{height:1rem;width:1rem;fill:#9ca3af}.s-search-spinner-loader{display:block;height:1rem;width:1rem}@keyframes spin{to{transform:rotate(360deg)}}.s-search-spinner-loader{animation:spin 1s linear infinite;border-radius:9999px;border-width:2px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));border-right-color:var(--color-primary)}.s-search-results{position:absolute;margin:auto;max-height:24rem;width:100%;max-width:100%;overflow-y:auto;border-bottom-right-radius:0.375rem;border-bottom-left-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-search-no-results{border-bottom-right-radius:0px !important;border-bottom-left-radius:0px !important}.s-search-no-results-placeholder{grid-column:1 / -1;padding:1rem;text-align:center;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-product{display:flex;height:100%;justify-content:space-around;overflow:hidden;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));background-color:transparent;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-search-product:last-child{border-bottom-width:0px}.s-search-product:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}@media (min-width: 480px){.s-search-product{padding-left:1.25rem;padding-right:1.25rem}}.s-search-product-image-container{position:relative;height:3.5rem;width:5rem;overflow:hidden;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-search-product-image{position:relative;height:100%;width:100%;object-fit:cover;font-size:0px}.s-search-product-image::before{position:absolute;top:0px;left:0px;height:100%;width:100%;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));--tw-content:'';content:var(--tw-content)}.s-search-product-details{flex:1 1 0%;padding-top:0.25rem}.s-search-product-details:where([dir=\"ltr\"],[dir=\"ltr\"] *){padding-left:1rem}@media (min-width: 480px){.s-search-product-details:where([dir=\"ltr\"],[dir=\"ltr\"] *){padding-left:1.25rem}}.s-search-product-details:where([dir=\"rtl\"],[dir=\"rtl\"] *){padding-right:1rem}@media (min-width: 480px){.s-search-product-details:where([dir=\"rtl\"],[dir=\"rtl\"] *){padding-right:1.25rem}}.s-search-product-title{margin-bottom:0.375rem;display:flex;flex-direction:column;align-items:baseline;justify-content:flex-start;font-size:0.875rem;font-weight:700;line-height:1.5rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-search-product-price{display:flex;width:100%;align-items:center;font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary)}.s-search-product-regular-price{padding-left:0.75rem;padding-right:0.75rem;font-weight:500;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-search-product-not-available{--tw-grayscale:grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-search-action{position:absolute;height:100%}.s-search-action:where([dir=\"ltr\"],[dir=\"ltr\"] *){right:0px}.s-search-action:where([dir=\"rtl\"],[dir=\"rtl\"] *){left:0px;border-top-right-radius:0px;border-bottom-right-radius:0px}.s-search-action-oval:where([dir=\"ltr\"],[dir=\"ltr\"] *){border-top-right-radius:9999px;border-bottom-right-radius:9999px}.s-search-action-oval:where([dir=\"rtl\"],[dir=\"rtl\"] *){border-top-left-radius:9999px;border-bottom-left-radius:9999px}.s-search-input-row{display:flex;align-items:center;gap:0.25rem}.s-search-back-btn{display:flex;flex-shrink:0;align-items:center;justify-content:center;padding:0.25rem;line-height:1;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-search-back-btn:hover{--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.s-search-back-btn{display:none}}.s-search-back-btn svg{height:1.5rem;width:1.5rem;fill:#6b7280}.s-search-input-wrapper{position:relative;display:flex;flex-grow:1;align-items:center}.s-search-input-clearable:where([dir=\"ltr\"],[dir=\"ltr\"] *){padding-right:2.25rem}.s-search-input-clearable:where([dir=\"rtl\"],[dir=\"rtl\"] *){padding-left:2.25rem}.s-search-input-clearable::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none}.s-search-clear-icon{position:absolute;top:50%;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding:0.25rem;line-height:1;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-clear-icon:hover{--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-search-clear-icon:where([dir=\"ltr\"],[dir=\"ltr\"] *){right:0.75rem}.s-search-clear-icon:where([dir=\"rtl\"],[dir=\"rtl\"] *){left:0.75rem}.s-search-clear-icon svg{height:1rem;width:1rem;fill:#9ca3af}.s-search-panel{display:flex;flex-direction:column;gap:0.75rem;padding:0px}@media (min-width: 640px){.s-search-panel{padding:1rem}}.s-search-results-body{display:flex;max-height:24rem;gap:0.75rem;overflow-y:auto}.s-search-results-grid-wrap{min-width:0px;flex:1 1 0%}.s-search-results-grid{display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));align-content:flex-start;column-gap:0.75rem;row-gap:0.25rem}@media (min-width: 640px){.s-search-results-grid{grid-template-columns:repeat(2, minmax(0, 1fr))}}.s-search-grid-item{cursor:pointer;border-radius:0.375rem;padding:0.25rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-search-grid-item:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-search-grid-item .s-product-card-out-badge{--tw-bg-opacity:1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1));--tw-text-opacity:1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.s-search-view-all{display:flex;flex-shrink:0;align-items:center;justify-content:center;gap:0.25rem;border-top-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));padding-top:0.75rem;text-align:center;font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-search-view-all:hover{text-decoration-line:underline}.s-search-view-all-icon{line-height:1}.s-search-view-all-icon svg{height:1rem;width:1rem;fill:#6b7280}.s-search-sidebar{width:7rem;flex-shrink:0}.s-search-sidebar>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.s-search-sidebar{--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}@media (min-width: 480px){.s-search-sidebar{width:8rem}}.s-search-sidebar:where([dir=\"ltr\"],[dir=\"ltr\"] *){border-right-width:1px;padding-right:0.75rem}.s-search-sidebar:where([dir=\"rtl\"],[dir=\"rtl\"] *){border-left-width:1px;padding-left:0.75rem}.s-search-idle-panel{max-height:24rem;min-height:6rem}.s-search-idle-panel>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.s-search-idle-panel{overflow-y:auto}.s-search-idle-section-title{margin-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-history-list{display:flex;flex-wrap:wrap;gap:0.5rem}.s-search-history-chip{display:inline-flex;align-items:center;gap:0.375rem;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding-top:0.375rem;padding-bottom:0.375rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-search-history-chip:where([dir=\"ltr\"],[dir=\"ltr\"] *){padding-left:0.75rem;padding-right:0.5rem}.s-search-history-chip:where([dir=\"rtl\"],[dir=\"rtl\"] *){padding-right:0.75rem;padding-left:0.5rem}.s-search-history-chip-term{line-height:1}.s-search-history-chip-remove svg{height:0.625rem;width:0.625rem;fill:#9ca3af}.s-search-idle-categories-list{display:flex;flex-wrap:wrap;gap:0.5rem}.s-search-idle-category-chip{display:inline-flex;align-items:center;gap:0.25rem;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding-left:0.75rem;padding-right:0.75rem;padding-top:0.375rem;padding-bottom:0.375rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-search-idle-category-chip:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-search-idle-category-count{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-most-searched-list{display:flex;flex-direction:column}.s-search-most-searched-item{display:flex;width:100%;align-items:center;gap:0.5rem;padding-top:0.375rem;padding-bottom:0.375rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-search-most-searched-item:hover{color:var(--color-primary)}.s-search-most-searched-icon svg{height:0.875rem;width:0.875rem;fill:#9ca3af}@media (min-width: 640px){.s-search-modal .s-modal-wrapper{align-items:flex-start;padding:0}.s-search-modal .s-modal-spacer{display:inline}}@media (max-width: 639px){.s-search-modal .s-modal-body{height:100dvh;max-height:100dvh !important}}@media (min-width: 640px){.s-search-modal .s-modal-body{padding:0;width:700px;max-width:90%;margin-top:3.2rem;border-radius:0.5rem;background:transparent;overflow:visible;position:relative !important}}.s-search-modal .s-modal-close{top:50%;transform:translateY(-50%)}@media (min-width: 640px){.s-search-modal.s-search-modal-new .s-modal-body{background:white;overflow:hidden;width:1100px;max-width:95%}}";
12
137
 
13
138
  const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class SallaSearch extends HTMLElement {
14
139
  constructor() {
15
140
  super();
16
141
  this.__registerHost();
142
+ this.newSearchEnabled = isNewSearchFeatureEnabled();
17
143
  this.inputValue = '';
144
+ this.hasTrackedFocus = false;
18
145
  this.translationLoaded = false;
146
+ this.labels = DEFAULT_LABELS;
19
147
  this.loading = false;
20
148
  this.typing = false;
21
149
  this.debounce = setTimeout(() => '', 1000);
150
+ this.search_term = '';
151
+ this.hasInputValue = false;
152
+ this.searchHistory = loadSearchHistory();
153
+ /**
154
+ * Most-searched categories to surface before the customer types a query.
155
+ * Not wired to a live endpoint yet - stays empty (and hidden) until a future
156
+ * story populates it.
157
+ */
158
+ this.trendingCategories = [];
159
+ /**
160
+ * Most-searched terms, reused both as the pre-search "most searched" list and
161
+ * as the results-view "search suggestions" sidebar. Same not-wired-yet status
162
+ * as trendingCategories.
163
+ */
164
+ this.mostSearchedTerms = [];
22
165
  /**
23
166
  * Set the component to display as a placeholder (button) that will open the modal. Defaults to `false`
24
167
  */
@@ -43,37 +186,72 @@ const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class SallaSearch extends
43
186
  * Show submit action buttons at the end.
44
187
  */
45
188
  this.showAction = false;
189
+ this.tracking = {
190
+ searchFocus: () => {
191
+ if (this.hasTrackedFocus) {
192
+ return;
193
+ }
194
+ this.hasTrackedFocus = true;
195
+ salla.event.emit('salla-search::input.focused');
196
+ },
197
+ productClick: (product, position) => {
198
+ salla.event.emit('salla-search::product.clicked', [{ product, position }]);
199
+ },
200
+ recommendationClick: (term, source) => {
201
+ salla.event.emit('salla-search::recommendation.clicked', { term, source });
202
+ },
203
+ };
46
204
  this.productSlot =
47
- this.host.querySelector('[slot="product"]')?.innerHTML || this.getDefaultProductSlot();
205
+ this.host?.querySelector('[slot="product"]')?.innerHTML || getDefaultProductSlot();
48
206
  salla.event.on('search::open', () => this.open());
49
- salla.lang.onLoaded(() => {
50
- this.translationLoaded = true;
51
- });
52
207
  salla.event.on('modalClosed', () => this.onModalClose());
53
208
  }
54
209
  async open() {
55
- if (!this.inline) {
56
- await this.modal.open().then(() => setTimeout(() => this.searchInput.focus(), 300));
210
+ if (this.newSearchEnabled || !this.inline) {
211
+ await this.modal?.open().then(() => setTimeout(() => this.searchInput?.focus(), 300));
57
212
  }
58
213
  }
59
214
  onModalClose() {
60
- this.searchInput.value = '';
215
+ if (this.searchInput) {
216
+ this.searchInput.value = '';
217
+ }
61
218
  this.results = undefined;
219
+ this.hasInputValue = false;
62
220
  this.afterSearching();
63
- this.container.classList.remove('s-search-no-results');
221
+ this.container?.classList.remove('s-search-no-results');
64
222
  }
65
223
  handleKeyDown(ev) {
66
224
  if (ev.key === 'Enter' && this.search_term?.length) {
67
- window.location.href = salla.url.get('search?q=' + encodeURI(this.search_term));
225
+ window.location.href = getSearchResultsUrl(this.search_term);
68
226
  }
69
227
  }
70
- getDefaultProductSlot() {
71
- return ('<div class="s-search-product-image-container">' +
72
- ' <img class="s-search-product-image" src="{image}" alt="{name}"/>' +
73
- '</div>' +
74
- '<div class="s-search-product-details">' +
75
- ' <div class="s-search-product-title">{name}</div> <div class="s-search-product-price">{price} <span class="s-search-product-regular-price">{regular_price}</span></div>' +
76
- '</div>');
228
+ clearSearch() {
229
+ if (this.searchInput) {
230
+ this.searchInput.value = '';
231
+ }
232
+ this.hasInputValue = false;
233
+ this.search_term = '';
234
+ this.searchInput?.focus();
235
+ }
236
+ removeFromSearchHistory(term) {
237
+ this.searchHistory = this.searchHistory.filter(existing => existing !== term);
238
+ saveSearchHistory(this.searchHistory);
239
+ this.afterSearching(!this.results);
240
+ }
241
+ applySuggestedTerm(term, source) {
242
+ this.tracking.recommendationClick(term, source);
243
+ if (this.searchInput) {
244
+ this.searchInput.value = term;
245
+ }
246
+ this.hasInputValue = true;
247
+ this.search_term = term;
248
+ this.searchInput?.focus();
249
+ }
250
+ async componentWillLoad() {
251
+ await salla.lang.onLoaded();
252
+ registerTranslationDefaults();
253
+ this.labels = loadLabels();
254
+ this.translationLoaded = true;
77
255
  }
78
256
  debounceSearch(event) {
79
257
  this.typing = true;
@@ -85,10 +263,13 @@ const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class SallaSearch extends
85
263
  }
86
264
  limitWordsAndSearch(event) {
87
265
  let value = event.target.value;
266
+ this.hasInputValue = value.length > 0;
88
267
  const words = value.trim().split(/\s+/);
89
268
  if (words.length > this.maxWords) {
90
269
  const truncatedInput = words.slice(0, this.maxWords).join(' ');
91
- this.searchInput.value = truncatedInput;
270
+ if (this.searchInput) {
271
+ this.searchInput.value = truncatedInput;
272
+ }
92
273
  }
93
274
  this.debounceSearch(event);
94
275
  }
@@ -112,7 +293,7 @@ const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class SallaSearch extends
112
293
  }
113
294
  }
114
295
  search(val) {
115
- this.noResults.style.display = 'none';
296
+ this.noResults && (this.noResults.style.display = 'none');
116
297
  //run loading spinner or stop it
117
298
  this.loading = true;
118
299
  salla.product
@@ -120,22 +301,29 @@ const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class SallaSearch extends
120
301
  .then(response => {
121
302
  this.results = response;
122
303
  salla.event.emit('Products Searched', val);
304
+ if (this.newSearchEnabled) {
305
+ this.searchHistory = addToSearchHistory(this.searchHistory, val);
306
+ saveSearchHistory(this.searchHistory);
307
+ }
123
308
  })
124
309
  .catch(err => (err !== 'Query is same as previous one!' ? (this.results = undefined) : null))
125
310
  .finally(() => this.afterSearching(/*isEmpty*/ false));
126
311
  }
127
312
  afterSearching(isEmpty = true) {
128
- this.noResults.style.display = isEmpty || this.results?.data.length > 0 ? 'none' : 'block';
129
- Helper.toggleElementClassIf(this.container, 's-search-container-open', 's-search-no-results', () => this.results?.data.length);
313
+ if (this.noResults) {
314
+ this.noResults.style.display = isEmpty || !!this.results?.data?.length ? 'none' : 'block';
315
+ }
316
+ // The new search experience is always a fully-visible modal panel (no collapsed/expanded
317
+ // input trick needed), so this open/no-results cosmetic toggle only applies to the legacy UI.
318
+ if (!this.newSearchEnabled) {
319
+ Helper.toggleElementClassIf(this.container, 's-search-container-open', 's-search-no-results', () => this.results?.data.length);
320
+ }
130
321
  this.loading = false;
131
322
  salla.product.api.previousQuery = ''; //avoid having error 'Query is same as previous one!' after reopen modal;
132
- this.inputValue.length < 3 ? this.container.classList.remove('s-search-no-results') : '';
323
+ this.inputValue.length < 3 ? this.container?.classList.remove('s-search-no-results') : '';
133
324
  }
134
- render() {
135
- const searchContent = (h("div", { key: 'ca8dec5eb90cd0893a1a3364df34ba0ee4d60891', class: { 's-search-container': true, 's-search-inline': this.inline }, ref: container => (this.container = container) }, h("div", { key: '212f8180ecca220a8b89231311dec6cdf3ef0b06', class: "s-search-input-wrapper" }, h("span", { key: '51fb0f9a2e342afd35eb82b57f55471aa9e1519f', class: "s-search-icon-wrap" }, h("span", { key: 'e75117068c51c6d200e8e20fa0f00ca02ed0c61d', class: "s-search-icon", innerHTML: this.loading ? '<i class="s-search-spinner-loader"/>' : Search })), h("input", { key: '442b1704b75a33e8c9e02da8200151a1d8e8db72', type: "search", enterkeyhint: "search", autocomplete: "off", class: "s-search-input", placeholder: salla.lang.get('blocks.header.search_placeholder'), onInput: (e) => this.limitWordsAndSearch(e), onKeyDown: e => this.handleKeyDown(e), ref: input => (this.searchInput = input), style: {
136
- height: this.height + 'px',
137
- borderRadius: this.oval ? this.height / 2 + 'px' : '',
138
- } }), this.showAction ? (h("salla-button", { loading: this.loading, class: { 's-search-action': true, 's-search-action-oval': this.oval }, onClick: () => this.handleActionClick() }, !this.loading && h("span", { innerHTML: Search }))) : null), h("div", { key: 'f3b40ce4ec24678f6d8421f3da8ac9e1bd631c3a', class: "s-search-results" }, this.results?.data.map(product => (h("a", { href: product.url + '?from=search-bar', class: {
325
+ renderLegacyResults() {
326
+ return (h("div", { class: "s-search-results" }, this.results?.data.map(product => (h("a", { href: product.url + '?from=search-bar', class: {
139
327
  's-search-product': true,
140
328
  's-search-product-not-available': !product.is_available,
141
329
  }, innerHTML: this.productSlot
@@ -144,12 +332,83 @@ const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class SallaSearch extends
144
332
  .replace(/\{regular_price\}/g, product.is_on_sale && product.regular_price
145
333
  ? salla.money(product.regular_price)
146
334
  : '')
147
- .replace(/\{image\}/g, product.image.url) }))), h("p", { key: 'fdbb21061c599a59c6d828eec80e8d591a708cca', ref: el => (this.noResults = el), class: "s-search-no-results-placeholder" }, salla.lang.get('common.elements.no_options')))));
148
- const modalContent = (h("salla-modal", { key: 'ca90aea3fb92d1ba7d8270c26e2ecd82d5018784', position: "top", class: "s-search-modal", ref: modal => (this.modal = modal) }, searchContent));
149
- const placeholderContent = (h("div", { key: '73333ce51cabadc4963a9fe9d1372bb7d63925c8', class: "s-search-placeholder-wrapper s-search-inline" }, h("div", { key: '77a66e9bba504557160c8c50d91f1216cc68f253', class: "s-search-input-wrapper" }, h("span", { key: '18fb5ce6e3e72874e76dd1ef2c6db8718a68f778', class: "s-search-icon-wrap" }, h("span", { key: '63b9e9af1c51647df734cc4d5cf7a825b922ce38', class: "s-search-icon", innerHTML: Search })), h("button", { key: 'b70169ed2d80ec2ad6b09952ad104824610212df', type: "button", class: "s-search-input s-search-placeholder-trigger", onClick: () => this.open(), style: {
335
+ .replace(/\{image\}/g, product.image.url) }))), h("p", { ref: el => (this.noResults = el), class: "s-search-no-results-placeholder" }, this.labels.noOptions)));
336
+ }
337
+ renderCategoriesSection(title) {
338
+ if (!this.trendingCategories.length) {
339
+ return null;
340
+ }
341
+ return (h("div", null, h("p", { class: "s-search-idle-section-title" }, title), h("div", { class: "s-search-idle-categories-list" }, this.trendingCategories.map(category => (h("a", { class: "s-search-idle-category-chip", href: category.url, onClick: () => this.tracking.recommendationClick(category.name, 'category') }, category.name, category.count ? (h("span", { class: "s-search-idle-category-count" }, category.count)) : null))))));
342
+ }
343
+ renderTermsSection(title, source) {
344
+ if (!this.mostSearchedTerms.length) {
345
+ return null;
346
+ }
347
+ return (h("div", null, h("p", { class: "s-search-idle-section-title" }, title), h("ul", { class: "s-search-most-searched-list" }, this.mostSearchedTerms.map(term => (h("li", null, h("button", { type: "button", class: "s-search-most-searched-item", onClick: () => this.applySuggestedTerm(term, source) }, h("span", { class: "s-search-most-searched-icon", innerHTML: Search }), term)))))));
348
+ }
349
+ renderSearchHistorySection() {
350
+ // Only in the empty/zero state - hidden as soon as there's input text or results.
351
+ if (!this.searchHistory.length || this.hasInputValue) {
352
+ return null;
353
+ }
354
+ return (h("div", null, h("p", { class: "s-search-idle-section-title" }, this.labels.searchHistory), h("div", { class: "s-search-history-list" }, this.searchHistory.map(term => (h("span", { class: "s-search-history-chip" }, h("button", { type: "button", class: "s-search-history-chip-term", onClick: () => this.applySuggestedTerm(term, 'history') }, term), h("button", { type: "button", class: "s-search-history-chip-remove", "aria-label": this.labels.remove, onClick: () => this.removeFromSearchHistory(term) }, h("span", { innerHTML: Cancel }))))))));
355
+ }
356
+ renderIdlePanel() {
357
+ // Always renders - even with nothing in history/trending yet - so the panel opens as a
358
+ // visible (if empty) container rather than disappearing until there's something to show.
359
+ return (h("div", { class: "s-search-idle-panel" }, this.renderSearchHistorySection(), this.renderCategoriesSection(this.labels.trendingCategories), this.renderTermsSection(this.labels.mostSearched, 'trending')));
360
+ }
361
+ renderResultsBody() {
362
+ // Search history never shows here (only in the empty/zero state), so the sidebar's
363
+ // visibility depends only on categories/terms - not the full idle-panel content check.
364
+ const hasSidebarContent = this.trendingCategories.length > 0 || this.mostSearchedTerms.length > 0;
365
+ return (h("div", { class: "s-search-results-body" }, hasSidebarContent ? (h("div", { class: "s-search-sidebar" }, this.renderTermsSection(this.labels.searchSuggestions, 'suggestion'), this.renderCategoriesSection(this.labels.categories))) : null, h("div", { class: "s-search-results-grid-wrap" }, h("p", { class: "s-search-idle-section-title" }, this.labels.searchResults), h("div", { class: "s-search-results-grid" }, this.results?.data.map((product, position) => (h("div", { class: "s-search-grid-item", onClick: () => this.tracking.productClick(product, position) }, h("salla-product-card", { product: { ...product, url: product.url + '?from=search-bar' }, horizontal: true, compact: true, "show-quantity": !product.is_available, "show-out-of-stock-beside-price": true, hideAddBtn: true })))), this.results?.data.length === 0 ? (h("p", { class: "s-search-no-results-placeholder" }, this.labels.noOptions)) : null))));
366
+ }
367
+ renderViewAllLink() {
368
+ if (!this.results?.data.length) {
369
+ return null;
370
+ }
371
+ return (h("a", { class: "s-search-view-all", href: getSearchResultsUrl(this.search_term) }, this.labels.searchViewAllTemplate.replace(':word', this.search_term), h("span", { class: "s-search-view-all-icon", innerHTML: salla.config.get('theme.is_rtl', true) ? KeyBoardArrowLeftIcon : KeyBoardArrowRightIcon })));
372
+ }
373
+ renderDropdown() {
374
+ if (!this.newSearchEnabled) {
375
+ return this.renderLegacyResults();
376
+ }
377
+ return this.results ? this.renderResultsBody() : this.renderIdlePanel();
378
+ }
379
+ renderInputWrapper() {
380
+ const inputWrapper = (h("div", { class: "s-search-input-wrapper" }, h("span", { class: "s-search-icon-wrap" }, h("span", { class: "s-search-icon", innerHTML: this.loading ? '<i class="s-search-spinner-loader"/>' : Search })), h("input", { type: "search", enterkeyhint: "search", autocomplete: "off", class: { 's-search-input': true, 's-search-input-clearable': this.newSearchEnabled }, placeholder: this.labels.searchPlaceholder, onInput: (e) => this.limitWordsAndSearch(e), onKeyDown: e => this.handleKeyDown(e), onFocus: () => this.newSearchEnabled && this.tracking.searchFocus(), ref: input => (this.searchInput = input), style: {
381
+ height: this.height + 'px',
382
+ borderRadius: this.oval ? this.height / 2 + 'px' : '',
383
+ } }), this.newSearchEnabled && this.hasInputValue ? (h("button", { type: "button", class: "s-search-clear-icon", "aria-label": this.labels.close, onClick: () => this.clearSearch() }, h("span", { innerHTML: Cancel }))) : null, this.showAction ? (h("salla-button", { loading: this.loading, class: { 's-search-action': true, 's-search-action-oval': this.oval }, onClick: () => this.handleActionClick() }, !this.loading && h("span", { innerHTML: Search }))) : null));
384
+ if (!this.newSearchEnabled) {
385
+ return inputWrapper;
386
+ }
387
+ return (h("div", { class: "s-search-input-row" }, h("button", { type: "button", class: "s-search-back-btn", "aria-label": this.labels.back, onClick: () => this.modal?.close() }, h("span", { innerHTML: salla.config.get('theme.is_rtl', true)
388
+ ? KeyBoardArrowRightIcon
389
+ : KeyBoardArrowLeftIcon })), inputWrapper));
390
+ }
391
+ renderPlaceholderTrigger() {
392
+ return (h("div", { class: "s-search-input-wrapper" }, h("span", { class: "s-search-icon-wrap" }, h("span", { class: "s-search-icon", innerHTML: Search })), h("button", { type: "button", class: "s-search-input s-search-placeholder-trigger", onClick: () => this.open(), style: {
150
393
  height: this.height + 'px',
151
394
  borderRadius: this.oval ? this.height / 2 + 'px' : '',
152
- } }, salla.lang.get('blocks.header.search_placeholder'))), modalContent));
395
+ } }, this.labels.searchPlaceholder)));
396
+ }
397
+ /**
398
+ * The new search UI is always a modal opened from a placeholder trigger (never inline,
399
+ * never a bare/self-triggering modal), with its own padded panel layout - the input and
400
+ * dropdown content share one bordered card instead of the legacy floating-dropdown look.
401
+ */
402
+ renderNewSearchExperience() {
403
+ return (h("div", { class: "s-search-placeholder-wrapper s-search-inline" }, this.renderPlaceholderTrigger(), h("salla-modal", { position: "top", class: "s-search-modal s-search-modal-new", "hide-close-button": true, ref: modal => (this.modal = modal) }, h("div", { class: "s-search-panel", ref: container => (this.container = container) }, this.renderInputWrapper(), this.renderDropdown(), this.renderViewAllLink()))));
404
+ }
405
+ render() {
406
+ if (this.newSearchEnabled) {
407
+ return this.renderNewSearchExperience();
408
+ }
409
+ const searchContent = (h("div", { class: { 's-search-container': true, 's-search-inline': this.inline }, ref: container => (this.container = container) }, this.renderInputWrapper(), this.renderDropdown()));
410
+ const modalContent = (h("salla-modal", { position: "top", class: "s-search-modal", ref: modal => (this.modal = modal) }, searchContent));
411
+ const placeholderContent = (h("div", { class: "s-search-placeholder-wrapper s-search-inline" }, this.renderPlaceholderTrigger(), modalContent));
153
412
  return this.placeholder ? (placeholderContent) : this.inline ? (h("div", { class: "s-search-modal" }, searchContent)) : (modalContent);
154
413
  }
155
414
  /**
@@ -157,7 +416,11 @@ const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class SallaSearch extends
157
416
  */
158
417
  componentDidLoad() {
159
418
  this.afterSearching();
160
- this.searchInput.value = this.getQueryParam('q');
419
+ const initialQuery = this.getQueryParam('q');
420
+ if (initialQuery && this.searchInput) {
421
+ this.searchInput.value = initialQuery;
422
+ this.hasInputValue = true;
423
+ }
161
424
  }
162
425
  get host() { return this; }
163
426
  static get watchers() { return {
@@ -172,11 +435,16 @@ const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class SallaSearch extends
172
435
  "maxWords": [2, "max-words"],
173
436
  "showAction": [4, "show-action"],
174
437
  "translationLoaded": [32],
438
+ "labels": [32],
175
439
  "results": [32],
176
440
  "loading": [32],
177
441
  "typing": [32],
178
442
  "debounce": [32],
179
- "search_term": [32]
443
+ "search_term": [32],
444
+ "hasInputValue": [32],
445
+ "searchHistory": [32],
446
+ "trendingCategories": [32],
447
+ "mostSearchedTerms": [32]
180
448
  }, [[0, "keydown", "handleKeyDown"]], {
181
449
  "search_term": ["handleSearch"]
182
450
  }]);
@@ -184,24 +452,109 @@ function defineCustomElement$1() {
184
452
  if (typeof customElements === "undefined") {
185
453
  return;
186
454
  }
187
- const components = ["salla-search", "salla-button", "salla-loading", "salla-modal"];
455
+ const components = ["salla-search", "salla-add-product-button", "salla-attachment-view", "salla-booking-field", "salla-button", "salla-color-picker", "salla-conditional-fields", "salla-count-down", "salla-datetime-picker", "salla-file-upload", "salla-loading", "salla-map", "salla-modal", "salla-order-options-modal", "salla-product-availability", "salla-product-card", "salla-product-options", "salla-progress-bar", "salla-quick-buy", "salla-slider", "salla-tel-input"];
188
456
  components.forEach(tagName => { switch (tagName) {
189
457
  case "salla-search":
190
458
  if (!customElements.get(tagName)) {
191
459
  customElements.define(tagName, SallaSearch$1);
192
460
  }
193
461
  break;
462
+ case "salla-add-product-button":
463
+ if (!customElements.get(tagName)) {
464
+ defineCustomElement$l();
465
+ }
466
+ break;
467
+ case "salla-attachment-view":
468
+ if (!customElements.get(tagName)) {
469
+ defineCustomElement$k();
470
+ }
471
+ break;
472
+ case "salla-booking-field":
473
+ if (!customElements.get(tagName)) {
474
+ defineCustomElement$j();
475
+ }
476
+ break;
194
477
  case "salla-button":
195
478
  if (!customElements.get(tagName)) {
196
- defineCustomElement$4();
479
+ defineCustomElement$i();
480
+ }
481
+ break;
482
+ case "salla-color-picker":
483
+ if (!customElements.get(tagName)) {
484
+ defineCustomElement$h();
485
+ }
486
+ break;
487
+ case "salla-conditional-fields":
488
+ if (!customElements.get(tagName)) {
489
+ defineCustomElement$g();
490
+ }
491
+ break;
492
+ case "salla-count-down":
493
+ if (!customElements.get(tagName)) {
494
+ defineCustomElement$f();
495
+ }
496
+ break;
497
+ case "salla-datetime-picker":
498
+ if (!customElements.get(tagName)) {
499
+ defineCustomElement$e();
500
+ }
501
+ break;
502
+ case "salla-file-upload":
503
+ if (!customElements.get(tagName)) {
504
+ defineCustomElement$d();
197
505
  }
198
506
  break;
199
507
  case "salla-loading":
200
508
  if (!customElements.get(tagName)) {
201
- defineCustomElement$3();
509
+ defineCustomElement$c();
510
+ }
511
+ break;
512
+ case "salla-map":
513
+ if (!customElements.get(tagName)) {
514
+ defineCustomElement$b();
202
515
  }
203
516
  break;
204
517
  case "salla-modal":
518
+ if (!customElements.get(tagName)) {
519
+ defineCustomElement$a();
520
+ }
521
+ break;
522
+ case "salla-order-options-modal":
523
+ if (!customElements.get(tagName)) {
524
+ defineCustomElement$9();
525
+ }
526
+ break;
527
+ case "salla-product-availability":
528
+ if (!customElements.get(tagName)) {
529
+ defineCustomElement$8();
530
+ }
531
+ break;
532
+ case "salla-product-card":
533
+ if (!customElements.get(tagName)) {
534
+ defineCustomElement$7();
535
+ }
536
+ break;
537
+ case "salla-product-options":
538
+ if (!customElements.get(tagName)) {
539
+ defineCustomElement$6();
540
+ }
541
+ break;
542
+ case "salla-progress-bar":
543
+ if (!customElements.get(tagName)) {
544
+ defineCustomElement$5();
545
+ }
546
+ break;
547
+ case "salla-quick-buy":
548
+ if (!customElements.get(tagName)) {
549
+ defineCustomElement$4();
550
+ }
551
+ break;
552
+ case "salla-slider":
553
+ if (!customElements.get(tagName)) {
554
+ defineCustomElement$3();
555
+ }
556
+ break;
557
+ case "salla-tel-input":
205
558
  if (!customElements.get(tagName)) {
206
559
  defineCustomElement$2();
207
560
  }
@@ -197,18 +197,18 @@ const SallaSearchableDropdown = /*@__PURE__*/ proxyCustomElement(class SallaSear
197
197
  render() {
198
198
  const hasSelection = this.selectedItem != null;
199
199
  const listboxId = `${this.inputId}-listbox`;
200
- return (h(Host, { key: '813e07447e4b3c51180345a38e82ffe135b6aec0', class: "s-searchable-dropdown" }, h("div", { key: '34eb275b53d173015a68bd2eeb93f1621eae47d1', class: { 's-searchable-dropdown': true, 's-searchable-dropdown--open': this.isOpen } }, this.label && (h("label", { key: '3659b3ca3a882ea94656c37d2862cf2ebd0a6690', class: "s-searchable-dropdown-label", htmlFor: this.inputId }, this.label, this.required && h("span", { key: '9bbce65147d41fad44282ad04c0707b34ee12526', class: "s-searchable-dropdown-required" }, " *"))), h("div", { key: '177b983bf879eae9a4d191226c480cbb3abe21c1', class: {
200
+ return (h(Host, { key: '6661631ca1fbc9dee2c634fffa720e5f90ce3483', class: "s-searchable-dropdown" }, h("div", { key: '201df6fb1c7d201d93681acc3819d76be5da4c6a', class: { 's-searchable-dropdown': true, 's-searchable-dropdown--open': this.isOpen } }, this.label && (h("label", { key: '2a5a78700cb7c4f498140f91525e7264bcfa7555', class: "s-searchable-dropdown-label", htmlFor: this.inputId }, this.label, this.required && h("span", { key: 'ae3395c452ced56a8754466a5962acfaaef0c3b5', class: "s-searchable-dropdown-required" }, " *"))), h("div", { key: 'ca363dd594a146e9dedd6940c736e832f465d495', class: {
201
201
  's-searchable-dropdown-trigger': true,
202
202
  's-searchable-dropdown-trigger--disabled': this.disabled || this.loading,
203
203
  's-searchable-dropdown-trigger--open': this.isOpen,
204
- }, role: "combobox", "aria-expanded": this.isOpen ? 'true' : 'false', "aria-haspopup": "listbox", "aria-controls": listboxId, "aria-disabled": this.disabled || this.loading ? 'true' : 'false', tabIndex: this.disabled || this.loading ? -1 : 0, onClick: this.handleTriggerClick, onKeyDown: this.handleTriggerKeyDown }, hasSelection ? (h("span", { class: "s-searchable-dropdown-trigger-text" }, this.getDisplayName(this.selectedItem))) : (h("span", { class: "s-searchable-dropdown-trigger-placeholder" }, this.placeholder)), h("i", { key: '7887cee514ce9220a5974816700e7519c201183b', class: {
204
+ }, role: "combobox", "aria-expanded": this.isOpen ? 'true' : 'false', "aria-haspopup": "listbox", "aria-controls": listboxId, "aria-disabled": this.disabled || this.loading ? 'true' : 'false', tabIndex: this.disabled || this.loading ? -1 : 0, onClick: this.handleTriggerClick, onKeyDown: this.handleTriggerKeyDown }, hasSelection ? (h("span", { class: "s-searchable-dropdown-trigger-text" }, this.getDisplayName(this.selectedItem))) : (h("span", { class: "s-searchable-dropdown-trigger-placeholder" }, this.placeholder)), h("i", { key: '84e041b879c392a82bbaf0ebd21b50a1e035218d', class: {
205
205
  'sicon-keyboard_arrow_down': true,
206
206
  's-searchable-dropdown-trigger-icon': true,
207
207
  's-searchable-dropdown-trigger-icon--open': this.isOpen,
208
- }, "aria-hidden": "true" })), this.isOpen && (h("div", { key: 'cbca93a72a5ec382903844c60f8fef8e77d46d92', class: {
208
+ }, "aria-hidden": "true" })), this.isOpen && (h("div", { key: 'eeeb7a2c5f3ff05966150fada86eb26d38f38699', class: {
209
209
  's-searchable-dropdown-panel': true,
210
210
  's-searchable-dropdown-panel--up': this.dropUp,
211
- }, ref: (el) => (this.panelRef = el) }, this.searchable && (h("div", { key: '06f901a77c0ac9e2bfcfaa2823df51370163925c', class: "s-searchable-dropdown-search-wrap" }, h("i", { key: '5bc57c4e8022f53d1c7b64cde61fdc386c94bd65', class: "sicon-search s-searchable-dropdown-search-icon", "aria-hidden": "true" }), h("input", { key: 'b6a3db42d1785326c4be15c58f3d37c34d221f9e', ref: (el) => (this.searchInputRef = el), id: this.inputId, type: "text", class: "s-searchable-dropdown-search-input", placeholder: this.placeholder, value: this.clientSearch ? this.clientSearchQuery : this.searchQuery, onInput: this.handleSearchInputChange, onKeyDown: this.handleSearchKeyDown, autocomplete: "off", "aria-autocomplete": "list", "aria-expanded": this.isOpen ? 'true' : 'false', "aria-controls": listboxId }))), h("div", { key: 'aac10f08cd4ed51829f254990d11c103861f0984', id: listboxId, class: "s-searchable-dropdown-list s-scrollbar", role: "listbox" }, this.renderListContent()))))));
211
+ }, ref: (el) => (this.panelRef = el) }, this.searchable && (h("div", { key: '28bd784d25d2bb9928c2316aac029257140d19e9', class: "s-searchable-dropdown-search-wrap" }, h("i", { key: '78add1451d050ce225fc3e14af352af4891735a3', class: "sicon-search s-searchable-dropdown-search-icon", "aria-hidden": "true" }), h("input", { key: '94644b386f64d1312511349f1eebafb56566754a', ref: (el) => (this.searchInputRef = el), id: this.inputId, type: "text", class: "s-searchable-dropdown-search-input", placeholder: this.placeholder, value: this.clientSearch ? this.clientSearchQuery : this.searchQuery, onInput: this.handleSearchInputChange, onKeyDown: this.handleSearchKeyDown, autocomplete: "off", "aria-autocomplete": "list", "aria-expanded": this.isOpen ? 'true' : 'false', "aria-controls": listboxId }))), h("div", { key: '5e7f218ded5baac0ad6fd92a04eae8948f7c9430', id: listboxId, class: "s-searchable-dropdown-list s-scrollbar", role: "listbox" }, this.renderListContent()))))));
212
212
  }
213
213
  renderListContent() {
214
214
  if (this.searching || this.loading) {