@searchcraft/javascript-sdk 0.2.2 → 0.2.3

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 (273) hide show
  1. package/dist/searchcraft-javascript-sdk/_commonjsHelpers-63cbe26c.js +34 -0
  2. package/dist/searchcraft-javascript-sdk/_commonjsHelpers-63cbe26c.js.map +1 -0
  3. package/dist/searchcraft-javascript-sdk/index-8211f330.js +3043 -0
  4. package/dist/searchcraft-javascript-sdk/index-8211f330.js.map +1 -0
  5. package/dist/{components/p-5cdc6210.js → searchcraft-javascript-sdk/index-d6567b9c.js} +10 -2
  6. package/dist/searchcraft-javascript-sdk/index-d6567b9c.js.map +1 -0
  7. package/dist/searchcraft-javascript-sdk/index.esm.js +14 -1
  8. package/dist/searchcraft-javascript-sdk/index.esm.js.map +1 -1
  9. package/dist/searchcraft-javascript-sdk/searchcraft-auto-search-form.entry.js +113 -0
  10. package/dist/searchcraft-javascript-sdk/searchcraft-auto-search-form.entry.js.map +1 -0
  11. package/dist/{esm → searchcraft-javascript-sdk}/searchcraft-base-search-form.entry.js +6 -6
  12. package/dist/searchcraft-javascript-sdk/searchcraft-base-search-form.entry.js.map +1 -0
  13. package/dist/searchcraft-javascript-sdk/searchcraft-base-search-result.entry.js +57 -0
  14. package/dist/searchcraft-javascript-sdk/searchcraft-base-search-result.entry.js.map +1 -0
  15. package/dist/{components/searchcraft-base-search-results.js → searchcraft-javascript-sdk/searchcraft-base-search-results.entry.js} +22 -83
  16. package/dist/searchcraft-javascript-sdk/searchcraft-base-search-results.entry.js.map +1 -0
  17. package/dist/{esm → searchcraft-javascript-sdk}/searchcraft-button-icon.entry.js +1 -1
  18. package/dist/searchcraft-javascript-sdk/searchcraft-button-icon.entry.js.map +1 -0
  19. package/dist/{esm → searchcraft-javascript-sdk}/searchcraft-button.entry.js +4 -4
  20. package/dist/searchcraft-javascript-sdk/searchcraft-button.entry.js.map +1 -0
  21. package/dist/{components/p-70722ab2.js → searchcraft-javascript-sdk/searchcraft-clear-icon-set.entry.js} +7 -24
  22. package/dist/searchcraft-javascript-sdk/searchcraft-clear-icon-set.entry.js.map +1 -0
  23. package/dist/searchcraft-javascript-sdk/searchcraft-clear-input-button.entry.js +30 -0
  24. package/dist/searchcraft-javascript-sdk/searchcraft-clear-input-button.entry.js.map +1 -0
  25. package/dist/searchcraft-javascript-sdk/searchcraft-error-message.entry.js +22 -0
  26. package/dist/searchcraft-javascript-sdk/searchcraft-error-message.entry.js.map +1 -0
  27. package/dist/{components/searchcraft-filters-list.js → searchcraft-javascript-sdk/searchcraft-filters-list.entry.js} +16 -43
  28. package/dist/searchcraft-javascript-sdk/searchcraft-filters-list.entry.js.map +1 -0
  29. package/dist/{components/p-6237f03e.js → searchcraft-javascript-sdk/searchcraft-input-caption.entry.js} +10 -31
  30. package/dist/searchcraft-javascript-sdk/searchcraft-input-caption.entry.js.map +1 -0
  31. package/dist/searchcraft-javascript-sdk/searchcraft-input-icon.entry.js +25 -0
  32. package/dist/searchcraft-javascript-sdk/searchcraft-input-icon.entry.js.map +1 -0
  33. package/dist/searchcraft-javascript-sdk/searchcraft-input-label.entry.js +29 -0
  34. package/dist/searchcraft-javascript-sdk/searchcraft-input-label.entry.js.map +1 -0
  35. package/dist/{components/p-2350c0ab.js → searchcraft-javascript-sdk/searchcraft-input.entry.js} +12 -83
  36. package/dist/searchcraft-javascript-sdk/searchcraft-input.entry.js.map +1 -0
  37. package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js +48 -1
  38. package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js.map +1 -1
  39. package/dist/{collection/components/searchcraft-results-info/searchcraft-results-info.js → searchcraft-javascript-sdk/searchcraft-results-info.entry.js} +15 -26
  40. package/dist/searchcraft-javascript-sdk/searchcraft-results-info.entry.js.map +1 -0
  41. package/dist/{components/p-a3bd1bc8.js → searchcraft-javascript-sdk/searchcraft-search-icon-set.entry.js} +7 -26
  42. package/dist/searchcraft-javascript-sdk/searchcraft-search-icon-set.entry.js.map +1 -0
  43. package/dist/searchcraft-javascript-sdk/searchcraft-slider.entry.js +76 -0
  44. package/dist/searchcraft-javascript-sdk/searchcraft-slider.entry.js.map +1 -0
  45. package/dist/searchcraft-javascript-sdk/searchcraft-spinner-dark.entry.js +17 -0
  46. package/dist/searchcraft-javascript-sdk/searchcraft-spinner-dark.entry.js.map +1 -0
  47. package/dist/searchcraft-javascript-sdk/searchcraft-spinner-light.entry.js +17 -0
  48. package/dist/searchcraft-javascript-sdk/searchcraft-spinner-light.entry.js.map +1 -0
  49. package/dist/{collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js → searchcraft-javascript-sdk/searchcraft-toggle-button.entry.js} +15 -47
  50. package/dist/searchcraft-javascript-sdk/searchcraft-toggle-button.entry.js.map +1 -0
  51. package/dist/searchcraft-javascript-sdk/shadow-css-423dab2c.js +334 -0
  52. package/dist/searchcraft-javascript-sdk/shadow-css-423dab2c.js.map +1 -0
  53. package/dist/searchcraft-javascript-sdk/store-0451a982.js +3070 -0
  54. package/dist/searchcraft-javascript-sdk/store-0451a982.js.map +1 -0
  55. package/dist/searchcraft-javascript-sdk/store-18b7e3ea.js +3071 -0
  56. package/dist/searchcraft-javascript-sdk/store-18b7e3ea.js.map +1 -0
  57. package/dist/searchcraft-javascript-sdk/store-910b9836.js +3071 -0
  58. package/dist/searchcraft-javascript-sdk/store-910b9836.js.map +1 -0
  59. package/dist/searchcraft-javascript-sdk/store-935525f8.js +3071 -0
  60. package/dist/searchcraft-javascript-sdk/store-935525f8.js.map +1 -0
  61. package/dist/{components/p-aff5cd24.js → searchcraft-javascript-sdk/utils-6d98c145.js} +21 -2
  62. package/dist/searchcraft-javascript-sdk/utils-6d98c145.js.map +1 -0
  63. package/dist/{esm/utils-e2076797.js → searchcraft-javascript-sdk/utils-d88ac15c.js} +22 -4
  64. package/dist/searchcraft-javascript-sdk/utils-d88ac15c.js.map +1 -0
  65. package/dist/{cjs/utils-bd99e8b0.js → searchcraft-javascript-sdk/utils-dbb6302b.js} +23 -10
  66. package/dist/searchcraft-javascript-sdk/utils-dbb6302b.js.map +1 -0
  67. package/dist/types/components/searchcraft-auto-search-form/searchcraft-auto-search-form.d.ts +1 -1
  68. package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +3 -3
  69. package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +8 -9
  70. package/dist/types/components/searchcraft-filters-list/searchcraft-filters-list.d.ts +1 -1
  71. package/dist/types/components/searchcraft-input-icon/searchcraft-input-icon.d.ts +1 -7
  72. package/dist/types/components/searchcraft-slider/searchcraft-slider.d.ts +4 -4
  73. package/dist/types/components.d.ts +1 -13
  74. package/dist/types/provider/store.d.ts +8 -8
  75. package/dist/types/utils/utils.d.ts +1 -0
  76. package/package.json +1 -1
  77. package/dist/cjs/app-globals-3a1e7e63.js +0 -7
  78. package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
  79. package/dist/cjs/index-5b0b9d4c.js +0 -84
  80. package/dist/cjs/index-5b0b9d4c.js.map +0 -1
  81. package/dist/cjs/index-6c5282a0.js +0 -1279
  82. package/dist/cjs/index-6c5282a0.js.map +0 -1
  83. package/dist/cjs/index.cjs.js +0 -17
  84. package/dist/cjs/index.cjs.js.map +0 -1
  85. package/dist/cjs/loader.cjs.js +0 -17
  86. package/dist/cjs/loader.cjs.js.map +0 -1
  87. package/dist/cjs/searchcraft-auto-search-form_17.cjs.entry.js +0 -804
  88. package/dist/cjs/searchcraft-auto-search-form_17.cjs.entry.js.map +0 -1
  89. package/dist/cjs/searchcraft-base-search-form.cjs.entry.js +0 -64
  90. package/dist/cjs/searchcraft-base-search-form.cjs.entry.js.map +0 -1
  91. package/dist/cjs/searchcraft-button-icon.cjs.entry.js +0 -18
  92. package/dist/cjs/searchcraft-button-icon.cjs.entry.js.map +0 -1
  93. package/dist/cjs/searchcraft-button.cjs.entry.js +0 -37
  94. package/dist/cjs/searchcraft-button.cjs.entry.js.map +0 -1
  95. package/dist/cjs/searchcraft-javascript-sdk.cjs.js +0 -27
  96. package/dist/cjs/searchcraft-javascript-sdk.cjs.js.map +0 -1
  97. package/dist/cjs/store-ccdd30e6.js +0 -314
  98. package/dist/cjs/store-ccdd30e6.js.map +0 -1
  99. package/dist/cjs/utils-bd99e8b0.js.map +0 -1
  100. package/dist/collection/assets/searchcraft-button-icons.js +0 -9
  101. package/dist/collection/assets/searchcraft-button-icons.js.map +0 -1
  102. package/dist/collection/assets/searchcraft-clear-icon-set.js +0 -45
  103. package/dist/collection/assets/searchcraft-clear-icon-set.js.map +0 -1
  104. package/dist/collection/assets/searchcraft-search-icon-set.js +0 -84
  105. package/dist/collection/assets/searchcraft-search-icon-set.js.map +0 -1
  106. package/dist/collection/collection-manifest.json +0 -31
  107. package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js +0 -365
  108. package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js.map +0 -1
  109. package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.module.css +0 -13
  110. package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js +0 -168
  111. package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js.map +0 -1
  112. package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.module.css +0 -14
  113. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +0 -308
  114. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +0 -1
  115. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.module.css +0 -216
  116. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +0 -271
  117. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +0 -1
  118. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.module.css +0 -47
  119. package/dist/collection/components/searchcraft-button/searchcraft-button.js +0 -137
  120. package/dist/collection/components/searchcraft-button/searchcraft-button.js.map +0 -1
  121. package/dist/collection/components/searchcraft-button/searchcraft-button.module.css +0 -82
  122. package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js +0 -96
  123. package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js.map +0 -1
  124. package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.module.css +0 -33
  125. package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js +0 -64
  126. package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js.map +0 -1
  127. package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.module.css +0 -21
  128. package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.js +0 -155
  129. package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.js.map +0 -1
  130. package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.module.css +0 -70
  131. package/dist/collection/components/searchcraft-input/searchcraft-input.js +0 -352
  132. package/dist/collection/components/searchcraft-input/searchcraft-input.js.map +0 -1
  133. package/dist/collection/components/searchcraft-input/searchcraft-input.module.css +0 -241
  134. package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js +0 -122
  135. package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js.map +0 -1
  136. package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.module.css +0 -79
  137. package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js +0 -109
  138. package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js.map +0 -1
  139. package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.module.css +0 -17
  140. package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js +0 -77
  141. package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js.map +0 -1
  142. package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.module.css +0 -21
  143. package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js.map +0 -1
  144. package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.module.css +0 -16
  145. package/dist/collection/components/searchcraft-slider/searchcraft-slider.js +0 -121
  146. package/dist/collection/components/searchcraft-slider/searchcraft-slider.js.map +0 -1
  147. package/dist/collection/components/searchcraft-slider/searchcraft-slider.module.css +0 -77
  148. package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.js +0 -19
  149. package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.js.map +0 -1
  150. package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.module.css +0 -35
  151. package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.js +0 -19
  152. package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.js.map +0 -1
  153. package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.module.css +0 -26
  154. package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js.map +0 -1
  155. package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.module.css +0 -31
  156. package/dist/collection/index.js +0 -14
  157. package/dist/collection/index.js.map +0 -1
  158. package/dist/collection/provider/store.js +0 -97
  159. package/dist/collection/provider/store.js.map +0 -1
  160. package/dist/collection/utils/utils.js +0 -45
  161. package/dist/collection/utils/utils.js.map +0 -1
  162. package/dist/components/index.js +0 -58
  163. package/dist/components/index.js.map +0 -1
  164. package/dist/components/p-1101288c.js +0 -53
  165. package/dist/components/p-1101288c.js.map +0 -1
  166. package/dist/components/p-15dd4fe4.js +0 -33
  167. package/dist/components/p-15dd4fe4.js.map +0 -1
  168. package/dist/components/p-2350c0ab.js.map +0 -1
  169. package/dist/components/p-5cdc6210.js.map +0 -1
  170. package/dist/components/p-6237f03e.js.map +0 -1
  171. package/dist/components/p-70722ab2.js.map +0 -1
  172. package/dist/components/p-7498e493.js +0 -1113
  173. package/dist/components/p-7498e493.js.map +0 -1
  174. package/dist/components/p-848301b7.js +0 -40
  175. package/dist/components/p-848301b7.js.map +0 -1
  176. package/dist/components/p-85693c64.js +0 -61
  177. package/dist/components/p-85693c64.js.map +0 -1
  178. package/dist/components/p-8fe6289d.js +0 -49
  179. package/dist/components/p-8fe6289d.js.map +0 -1
  180. package/dist/components/p-99971aa9.js +0 -310
  181. package/dist/components/p-99971aa9.js.map +0 -1
  182. package/dist/components/p-a3bd1bc8.js.map +0 -1
  183. package/dist/components/p-aff5cd24.js.map +0 -1
  184. package/dist/components/p-bd90d9b4.js +0 -85
  185. package/dist/components/p-bd90d9b4.js.map +0 -1
  186. package/dist/components/p-c70cd874.js +0 -68
  187. package/dist/components/p-c70cd874.js.map +0 -1
  188. package/dist/components/p-c815eb98.js +0 -33
  189. package/dist/components/p-c815eb98.js.map +0 -1
  190. package/dist/components/searchcraft-auto-search-form.js +0 -207
  191. package/dist/components/searchcraft-auto-search-form.js.map +0 -1
  192. package/dist/components/searchcraft-base-search-form.js +0 -152
  193. package/dist/components/searchcraft-base-search-form.js.map +0 -1
  194. package/dist/components/searchcraft-base-search-result.js +0 -8
  195. package/dist/components/searchcraft-base-search-result.js.map +0 -1
  196. package/dist/components/searchcraft-base-search-results.js.map +0 -1
  197. package/dist/components/searchcraft-button-icon.js +0 -32
  198. package/dist/components/searchcraft-button-icon.js.map +0 -1
  199. package/dist/components/searchcraft-button.js +0 -8
  200. package/dist/components/searchcraft-button.js.map +0 -1
  201. package/dist/components/searchcraft-clear-icon-set.js +0 -8
  202. package/dist/components/searchcraft-clear-icon-set.js.map +0 -1
  203. package/dist/components/searchcraft-clear-input-button.js +0 -8
  204. package/dist/components/searchcraft-clear-input-button.js.map +0 -1
  205. package/dist/components/searchcraft-error-message.js +0 -8
  206. package/dist/components/searchcraft-error-message.js.map +0 -1
  207. package/dist/components/searchcraft-filters-list.js.map +0 -1
  208. package/dist/components/searchcraft-input-caption.js +0 -8
  209. package/dist/components/searchcraft-input-caption.js.map +0 -1
  210. package/dist/components/searchcraft-input-icon.js +0 -8
  211. package/dist/components/searchcraft-input-icon.js.map +0 -1
  212. package/dist/components/searchcraft-input-label.js +0 -8
  213. package/dist/components/searchcraft-input-label.js.map +0 -1
  214. package/dist/components/searchcraft-input.js +0 -8
  215. package/dist/components/searchcraft-input.js.map +0 -1
  216. package/dist/components/searchcraft-results-info.js +0 -63
  217. package/dist/components/searchcraft-results-info.js.map +0 -1
  218. package/dist/components/searchcraft-search-icon-set.js +0 -8
  219. package/dist/components/searchcraft-search-icon-set.js.map +0 -1
  220. package/dist/components/searchcraft-slider.js +0 -95
  221. package/dist/components/searchcraft-slider.js.map +0 -1
  222. package/dist/components/searchcraft-spinner-dark.js +0 -8
  223. package/dist/components/searchcraft-spinner-dark.js.map +0 -1
  224. package/dist/components/searchcraft-spinner-light.js +0 -8
  225. package/dist/components/searchcraft-spinner-light.js.map +0 -1
  226. package/dist/components/searchcraft-toggle-button.js +0 -83
  227. package/dist/components/searchcraft-toggle-button.js.map +0 -1
  228. package/dist/esm/index-0ac5bb53.js +0 -1251
  229. package/dist/esm/index-0ac5bb53.js.map +0 -1
  230. package/dist/esm/index-72ac5051.js +0 -82
  231. package/dist/esm/index-72ac5051.js.map +0 -1
  232. package/dist/esm/index.js +0 -4
  233. package/dist/esm/index.js.map +0 -1
  234. package/dist/esm/loader.js +0 -13
  235. package/dist/esm/loader.js.map +0 -1
  236. package/dist/esm/searchcraft-auto-search-form_17.entry.js +0 -784
  237. package/dist/esm/searchcraft-auto-search-form_17.entry.js.map +0 -1
  238. package/dist/esm/searchcraft-base-search-form.entry.js.map +0 -1
  239. package/dist/esm/searchcraft-button-icon.entry.js.map +0 -1
  240. package/dist/esm/searchcraft-button.entry.js.map +0 -1
  241. package/dist/esm/searchcraft-javascript-sdk.js +0 -22
  242. package/dist/esm/searchcraft-javascript-sdk.js.map +0 -1
  243. package/dist/esm/store-311de204.js +0 -310
  244. package/dist/esm/store-311de204.js.map +0 -1
  245. package/dist/esm/utils-e2076797.js.map +0 -1
  246. package/dist/index.cjs.js +0 -1
  247. package/dist/index.js +0 -1
  248. package/dist/loader/cdn.js +0 -1
  249. package/dist/loader/index.cjs.js +0 -1
  250. package/dist/loader/index.d.ts +0 -24
  251. package/dist/loader/index.es2017.js +0 -1
  252. package/dist/loader/index.js +0 -2
  253. package/dist/loader/package.json +0 -11
  254. package/dist/searchcraft-javascript-sdk/p-0880cfbb.js +0 -3
  255. package/dist/searchcraft-javascript-sdk/p-0880cfbb.js.map +0 -1
  256. package/dist/searchcraft-javascript-sdk/p-5cdc6210.js +0 -7
  257. package/dist/searchcraft-javascript-sdk/p-5cdc6210.js.map +0 -1
  258. package/dist/searchcraft-javascript-sdk/p-5ec960bd.entry.js +0 -2
  259. package/dist/searchcraft-javascript-sdk/p-5ec960bd.entry.js.map +0 -1
  260. package/dist/searchcraft-javascript-sdk/p-6108dd80.entry.js +0 -2
  261. package/dist/searchcraft-javascript-sdk/p-6108dd80.entry.js.map +0 -1
  262. package/dist/searchcraft-javascript-sdk/p-80ea9602.js +0 -11
  263. package/dist/searchcraft-javascript-sdk/p-80ea9602.js.map +0 -1
  264. package/dist/searchcraft-javascript-sdk/p-a9bac3ca.entry.js +0 -2
  265. package/dist/searchcraft-javascript-sdk/p-a9bac3ca.entry.js.map +0 -1
  266. package/dist/searchcraft-javascript-sdk/p-aff5cd24.js +0 -2
  267. package/dist/searchcraft-javascript-sdk/p-aff5cd24.js.map +0 -1
  268. package/dist/searchcraft-javascript-sdk/p-cc454542.entry.js +0 -2
  269. package/dist/searchcraft-javascript-sdk/p-cc454542.entry.js.map +0 -1
  270. package/dist/searchcraft-javascript-sdk/p-e1255160.js +0 -2
  271. package/dist/searchcraft-javascript-sdk/p-e1255160.js.map +0 -1
  272. /package/dist/{esm → searchcraft-javascript-sdk}/app-globals-0f993ce5.js +0 -0
  273. /package/dist/{esm → searchcraft-javascript-sdk}/app-globals-0f993ce5.js.map +0 -0
@@ -1,804 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-6c5282a0.js');
6
- const store = require('./store-ccdd30e6.js');
7
- const utils = require('./utils-bd99e8b0.js');
8
- const index$1 = require('./index-5b0b9d4c.js');
9
-
10
- const searchcraftAutoSearchFormModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.formLTR{text-align:left;width:100%}.formRTL{text-align:right;width:100%}";
11
- const SearchcraftAutoSearchFormStyle0 = searchcraftAutoSearchFormModuleCss;
12
-
13
- const SearchcraftAutoSearchForm = class {
14
- constructor(hostRef) {
15
- index.registerInstance(this, hostRef);
16
- this.querySubmit = index.createEvent(this, "querySubmit", 7);
17
- this.inputClearedOrNoResults = index.createEvent(this, "inputClearedOrNoResults", 7);
18
- this.debounceTimeout = null;
19
- this.debounceDelay = 0;
20
- this.searchStore = store.useSearchcraftStore.getState();
21
- this.handleInputChange = (event) => {
22
- this.query = event.detail;
23
- this.searchStore.setQuery(this.query);
24
- this.querySubmit.emit(this.query);
25
- };
26
- this.handleInputKeyUp = (event) => {
27
- const target = event.detail;
28
- this.query = target;
29
- this.searchStore.setQuery(this.query);
30
- this.querySubmit.emit(this.query);
31
- if (this.debounceTimeout) {
32
- clearTimeout(this.debounceTimeout);
33
- }
34
- this.debounceTimeout = setTimeout(() => {
35
- this.query.trim() !== '' && this.runSearch();
36
- }, this.debounceDelay);
37
- };
38
- this.handleClearInput = () => {
39
- this.query = '';
40
- this.searchStore.setQuery('');
41
- if (typeof this.clearInput === 'function') {
42
- this.clearInput();
43
- }
44
- if (this.debounceTimeout) {
45
- clearTimeout(this.debounceTimeout);
46
- }
47
- this.error = false;
48
- this.inputClearedOrNoResults.emit();
49
- };
50
- this.runSearch = async () => {
51
- if (this.query.trim() === '') {
52
- this.error = true;
53
- this.inputClearedOrNoResults.emit();
54
- }
55
- else {
56
- this.error = false;
57
- this.searchStore.setQuery(this.query);
58
- try {
59
- await this.searchStore.search();
60
- }
61
- catch (error) {
62
- this.error = true;
63
- this.inputClearedOrNoResults.emit();
64
- }
65
- }
66
- };
67
- this.handleFormSubmit = async (event) => {
68
- event.preventDefault();
69
- await this.runSearch();
70
- };
71
- this.autoSearchFormClass = '';
72
- this.clearInput = () => { };
73
- this.config = {
74
- apiKey: '',
75
- endpointURL: '',
76
- index: [],
77
- };
78
- this.customStylesForInput = {};
79
- this.inputCaptionValue = '';
80
- this.inputIconHeight = 20;
81
- this.inputIconWidth = 20;
82
- this.labelForInput = '';
83
- this.placeholderValue = 'Search here';
84
- this.rightToLeftOrientation = false;
85
- this.searchContainerClass = '';
86
- this.error = false;
87
- this.isRequesting = false;
88
- this.query = '';
89
- this.searchResults = null;
90
- }
91
- componentDidLoad() {
92
- const searchcraft = new store.g(this.config);
93
- this.searchStore.initialize(searchcraft, true);
94
- this.unsubscribe = store.useSearchcraftStore.subscribe((state) => {
95
- this.isRequesting = state.isRequesting;
96
- this.searchResults = Object.assign({}, state.searchResults);
97
- });
98
- }
99
- disconnectedCallback() {
100
- if (this.unsubscribe) {
101
- this.unsubscribe();
102
- }
103
- }
104
- render() {
105
- var _a, _b, _c;
106
- const formClass = this.rightToLeftOrientation ? 'formRTL' : 'formLTR';
107
- const parsedCustomStyles = utils.parseCustomStyles(this.customStylesForInput);
108
- if (this.query.length > 0 && ((_c = (_b = (_a = this.searchResults) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.hits) === null || _c === void 0 ? void 0 : _c.length) === 0) {
109
- this.inputClearedOrNoResults.emit();
110
- }
111
- return (index.h("form", { key: '49950058e612dc1017fb56235affd3b8077b6926', class: `${formClass}`, onSubmit: this.handleFormSubmit }, index.h("searchcraft-input-label", { key: 'ce2cb4d74c139fc4f010d1ca51739c49a8e9f6c2', label: this.labelForInput }), index.h("searchcraft-input", { key: '8fb1eee5dca952ba472f03e768b57663528f5c84', customStyles: parsedCustomStyles, "input-caption-value": this.inputCaptionValue, "is-requesting": this.isRequesting, "input-icon-height": this.inputIconHeight, "input-icon-width": this.inputIconWidth, onClearInput: this.handleClearInput, onInputKeyUp: this.handleInputKeyUp, onSearchInputChange: this.handleInputChange, "placeholder-value": this.placeholderValue, query: this.query, "right-to-left-orientation": this.rightToLeftOrientation }), this.error && (index.h("searchcraft-error-message", { key: 'd1c893186af4cdb927f31b086aa7d027947c1d2c', errorMessage: 'Please enter a search query.' }))));
112
- }
113
- };
114
- SearchcraftAutoSearchForm.style = SearchcraftAutoSearchFormStyle0;
115
-
116
- const searchcraftBaseSearchResultModuleCss = "@charset \"UTF-8\";:root{--font-stack:Helvetica, Arial, sans-serif}.interactiveResultContainerLight{background-color:#FAFAFA;align-items:flex-start;border-radius:16px;display:flex;position:relative;flex-direction:column;gap:16px;padding:8px}@media (min-width: 600px){.interactiveResultContainerLight{flex-direction:row}}.interactiveResultContainerDark{background-color:#2E2E2E;align-items:flex-start;border-radius:16px;display:flex;position:relative;flex-direction:column;gap:16px;padding:8px}@media (min-width: 600px){.interactiveResultContainerDark{flex-direction:row}}.resultContainer{align-items:flex-start;display:flex;flex-direction:column;gap:16px}@media (min-width: 600px){.resultContainer{flex-direction:row}}.interactiveIconLarge{display:inline-block;position:absolute;right:5px;top:8px}@media (max-width: 600px){.interactiveIconLarge{display:none}}.interactiveIconSmall{position:absolute;right:5px;top:-2px;display:inline-block}@media (min-width: 600px){.interactiveIconSmall{display:none}}.imageContainer{max-width:100%}.contentContainer{max-height:100%;max-width:100%}@media (min-width: 600px){.contentContainer{max-width:50%}}.secondaryContentContainer{display:flex}.imageLight{aspect-ratio:2/1;border-radius:8px;max-height:100%;max-width:100%;border:1px solid #D9D9D9}.imageDark{aspect-ratio:2/1;border-radius:8px;max-height:100%;max-width:100%;border:1px solid #333}.headingLight{font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0px;position:relative;color:#292929}.headingDark{font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0px;position:relative;color:#FFF}.subheadingLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px;margin-top:0px;color:#737373}.subheadingDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px;margin-top:0px;color:#BFBFBF}.primaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#404040}.primaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#E6E6E6}.secondaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#404040}.secondaryContentLight::after{content:\"•\";color:#404040;font-size:1em;margin-left:5px;margin-right:5px}.secondaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#E6E6E6}.tertiaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#404040}.tertiaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#E6E6E6}";
117
- const SearchcraftBaseSearchResultStyle0 = searchcraftBaseSearchResultModuleCss;
118
-
119
- const SearchcraftBaseSearchResult = class {
120
- constructor(hostRef) {
121
- index.registerInstance(this, hostRef);
122
- this.buttonCallback = index.createEvent(this, "buttonCallback", 7);
123
- this.keyDownCallback = index.createEvent(this, "keyDownCallback", 7);
124
- this.resultCallback = index.createEvent(this, "resultCallback", 7);
125
- this.buttonCallback = () => { }; // Callback for button click
126
- this.keyDownCallback = () => { }; // Callback for key down event
127
- this.resultCallback = () => { }; // Callback for result container click
128
- this.handleButtonClick = () => {
129
- this.buttonCallback();
130
- };
131
- this.handleContainerClick = () => {
132
- if (this.isInteractive) {
133
- this.resultCallback();
134
- }
135
- };
136
- this.buttonText = '';
137
- this.imageDescription = '';
138
- this.imageSource = '';
139
- this.isInteractive = false;
140
- this.primaryContent = '';
141
- this.secondaryContent = '';
142
- this.tertiaryContent = '';
143
- this.headingText = '';
144
- this.subheadingText = '';
145
- this.themeMode = 'light';
146
- this.customStyles = '{}';
147
- }
148
- parseStyles() {
149
- try {
150
- return JSON.parse(this.customStyles);
151
- }
152
- catch (error) {
153
- console.error('Error parsing custom styles:', error);
154
- return {};
155
- }
156
- }
157
- render() {
158
- const isLightTheme = this.themeMode === 'light';
159
- const styles = this.parseStyles();
160
- return (index.h("div", { key: '91cfc671b0b99082915df3eaafa053a9a7f77929', class: this.isInteractive
161
- ? isLightTheme
162
- ? 'interactiveResultContainerLight'
163
- : 'interactiveResultContainerDark'
164
- : 'resultContainer', style: styles.container || {}, tabindex: '0', onClick: this.handleContainerClick, onKeyDown: this.keyDownCallback }, index.h("div", { key: 'ccda236ef60aee285472155889c5490c69a86415', class: 'imageContainer' }, index.h("img", { key: 'e55d743952e2997d91f6486436e3a7955ffc1dcc', alt: this.imageDescription, src: this.imageSource, style: styles.image || {}, class: isLightTheme ? 'imageLight' : 'imageDark' })), index.h("div", { key: 'b0e831c0c7bfef46b8b6da4e84536adf3ebd7158', class: 'contentContainer' }, index.h("h2", { key: '54137612623a39d711f4e3c888bf2015b6fb9500', style: styles.heading || {}, class: isLightTheme ? 'headingLight' : 'headingDark' }, this.headingText), index.h("h3", { key: 'de46df990be3d0b5d2134d272e1766e911ab094a', style: styles.subheading || {}, class: isLightTheme ? 'subheadingLight' : 'subheadingDark' }, this.subheadingText), index.h("p", { key: 'd9e7656bc739b0dd2267f86ac51b17d9ca16da6a', style: styles.primaryContent || {}, class: isLightTheme ? 'primaryContentLight' : 'primaryContentDark' }, this.primaryContent), index.h("div", { key: 'd05813b3da29b8b21c2e370db9c0cbc7b48b9556', class: 'secondaryContentContainer' }, index.h("p", { key: 'e8d2ede937705a5bd88927779ee24e35ba2efbd8', style: styles.secondaryContent || {}, class: isLightTheme ? 'secondaryContentLight' : 'secondaryContentDark' }, this.secondaryContent), index.h("p", { key: '2f9b9f603d55bcefe8347675cb31f705b1f7a0e8', style: styles.tertiaryContent || {}, class: isLightTheme ? 'tertiaryContentLight' : 'tertiaryContentDark' }, this.tertiaryContent)), this.buttonText && (index.h("button", { key: '58724046c9704974cb3ae1c34335ebb7131b91ab', onClick: this.handleButtonClick, style: styles.button || {}, type: 'button' }, this.buttonText)))));
165
- }
166
- };
167
- SearchcraftBaseSearchResult.style = SearchcraftBaseSearchResultStyle0;
168
-
169
- const searchcraftBaseSearchResultsModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.resultsContainer{display:flex;flex-direction:column;justify-content:center;margin:16px 0}.resultsContainer>p{align-self:center}.resultsContainer>div{margin-bottom:20px}.resultsContainer>div img{height:300px;width:200px}.adSection{align-items:center;background-color:#F1F1F1;border:1px solid #DCDDDE;border-radius:16px;display:flex;flex-direction:column;font-size:16px;justify-content:center;margin:auto;min-height:150px;text-align:center;width:100%}.adSection p{margin-top:5px}.emptyState{width:100%;text-align:center}.errorMessageContainer{text-align:center}";
170
- const SearchcraftBaseSearchResultsStyle0 = searchcraftBaseSearchResultsModuleCss;
171
-
172
- const SearchcraftBaseSearchResults = class {
173
- constructor(hostRef) {
174
- index.registerInstance(this, hostRef);
175
- this.query = '';
176
- this.searchResults = null;
177
- this.hasSearched = false;
178
- this.documentAttributesForDisplay = '';
179
- this.customStylesForResults = {};
180
- this.placeAdAtStart = true;
181
- this.placeAdAtEnd = false;
182
- this.adInterval = 4;
183
- this.formatTime = true;
184
- this.fallbackElement = null;
185
- }
186
- componentDidLoad() {
187
- if (!this.documentAttributesForDisplay ||
188
- this.documentAttributesForDisplay.length === 0) {
189
- console.warn('No document attributes provided; using empty keys array.');
190
- this.documentAttributesForDisplay = '';
191
- }
192
- this.unsubscribe = store.useSearchcraftStore.subscribe((state) => {
193
- if (state.query.length > 0) {
194
- this.hasSearched = true;
195
- }
196
- else {
197
- this.hasSearched = false;
198
- }
199
- this.searchResults = Object.assign({}, state.searchResults);
200
- this.query = state.query;
201
- });
202
- const { searchResults, query } = store.useSearchcraftStore.getState();
203
- this.searchResults = searchResults;
204
- this.query = query;
205
- }
206
- disconnectedCallback() {
207
- if (this.unsubscribe) {
208
- this.unsubscribe();
209
- }
210
- }
211
- timeAgo(timestamp) {
212
- const now = new Date();
213
- const inputTime = new Date(timestamp);
214
- const diffInSeconds = Math.floor((now.getTime() - inputTime.getTime()) / 1000);
215
- const minutes = Math.floor(diffInSeconds / 60);
216
- const hours = Math.floor(minutes / 60);
217
- const days = Math.floor(hours / 24);
218
- const years = Math.floor(days / 365);
219
- if (minutes < 60) {
220
- return `${minutes}m ago`;
221
- }
222
- if (hours < 24) {
223
- return `${hours}h ago`;
224
- }
225
- if (days < 365) {
226
- return `${days}d ago`;
227
- }
228
- return `${years}y ago`;
229
- }
230
- render() {
231
- var _a, _b, _c, _d, _e, _f, _g;
232
- if (!this.hasSearched) {
233
- return (index.h("div", { class: 'emptyState' }, index.h("slot", { name: 'empty-search' })));
234
- }
235
- if (!((_a = this.searchResults) === null || _a === void 0 ? void 0 : _a.data)) {
236
- console.warn('No search results data available');
237
- return index.h("div", { class: 'emptyState' }, "No results to display.");
238
- }
239
- const parsedSearchKeys = utils.parseSearchKeys(this.documentAttributesForDisplay);
240
- const serializedStyles = typeof this.customStylesForResults === 'string'
241
- ? this.customStylesForResults
242
- : utils.serializeStyles(this.customStylesForResults);
243
- const resultsComponents = (_d = (_c = (_b = this.searchResults) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.hits) === null || _d === void 0 ? void 0 : _d.map((document, index$1) => {
244
- const { doc: result } = document;
245
- const dynamicProperties = utils.extractDynamicProperties(result, parsedSearchKeys);
246
- // Apply timeAgo formatting if formatTime is true
247
- if (this.formatTime) {
248
- for (const key of parsedSearchKeys) {
249
- if (dynamicProperties[key]) {
250
- const value = dynamicProperties[key];
251
- // Check if the value is a valid ISO timestamp
252
- if (typeof value === 'string' &&
253
- !Number.isNaN(Date.parse(value))) {
254
- dynamicProperties[key] = this.timeAgo(value);
255
- }
256
- }
257
- }
258
- }
259
- return (index.h("searchcraft-base-search-result", { key: `${document.document_id}-${index$1}`, "button-callback": () => console.log('button callback'), "result-callback": () => console.log('interactive element'), "keydown-callback": () => console.log('keydown'), "is-interactive": true, "heading-text": dynamicProperties[parsedSearchKeys[0]], "subheading-text": dynamicProperties[parsedSearchKeys[1]], "primary-content": dynamicProperties[parsedSearchKeys[2]], "secondary-content": dynamicProperties[parsedSearchKeys[3]], "tertiary-content": dynamicProperties[parsedSearchKeys[4]], "image-source": dynamicProperties[parsedSearchKeys[parsedSearchKeys.length - 1]], "custom-styles": serializedStyles }));
260
- });
261
- const finalComponents = [];
262
- if (this.placeAdAtStart) {
263
- finalComponents.push(index.h("div", { key: 'ad-section-start', class: 'adSection' }, index.h("span", null, "##"), index.h("p", null, " Ad Impressions")));
264
- }
265
- if (this.adInterval > 0) {
266
- resultsComponents.forEach((component, index$1) => {
267
- finalComponents.push(component);
268
- if ((index$1 + 1) % this.adInterval === 0) {
269
- finalComponents.push(index.h("div", { key: `ad-section-${index$1 + 1}`, class: 'adSection' }, index.h("span", null, "##"), index.h("p", null, " Ad Impressions")));
270
- }
271
- });
272
- }
273
- else {
274
- finalComponents.push(...resultsComponents);
275
- }
276
- if (this.placeAdAtEnd) {
277
- finalComponents.push(index.h("div", { key: 'ad-section-end', class: 'adSection' }, index.h("span", null, "##"), index.h("p", null, " Ad Impressions")));
278
- }
279
- return (index.h("div", { class: 'resultsContainer' }, finalComponents, this.query.length > 0 &&
280
- ((_g = (_f = (_e = this.searchResults) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.hits) === null || _g === void 0 ? void 0 : _g.length) === 0 && (index.h("div", { class: 'errorMessageContainer' }, index.h("searchcraft-error-message", { "error-message": `No search results found for "${this.query}" query` })))));
281
- }
282
- };
283
- SearchcraftBaseSearchResults.style = SearchcraftBaseSearchResultsStyle0;
284
-
285
- const SearchcraftClearIconSet = class {
286
- constructor(hostRef) {
287
- index.registerInstance(this, hostRef);
288
- this.type = 'clear-light';
289
- }
290
- render() {
291
- switch (this.type) {
292
- case 'clear-light':
293
- return (index.h("svg", { width: '22', height: '22', viewBox: '0 0 22 22', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, index.h("title", { id: 'icon-title' }, "Searchcraft Clear Input Icon Light"), index.h("path", { d: 'M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z', stroke: 'black', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
294
- case 'clear-dark':
295
- return (index.h("svg", { width: '22', height: '22', viewBox: '0 0 22 22', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, index.h("title", { id: 'icon-title' }, "Searchcraft Clear Input Icon Dark"), index.h("path", { d: 'M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z', stroke: 'white', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
296
- case 'arrow-light':
297
- return (index.h("svg", { width: '20', height: '21', viewBox: '0 0 20 21', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, index.h("title", { id: 'icon-title' }, "Searchcraft Arrow Right Icon Light"), index.h("path", { d: 'M7.5 15.0444L12.5 10.0444L7.5 5.04443', stroke: '#737373', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
298
- case 'arrow-dark':
299
- return (index.h("svg", { width: '8', height: '12', viewBox: '0 0 8 12', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, index.h("title", { id: 'icon-title' }, "Searchcraft Arrow Right Icon Dark"), index.h("path", { d: 'M1.5 11L6.5 6L1.5 1', stroke: '#BFBFBF', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
300
- default:
301
- return null;
302
- }
303
- }
304
- };
305
-
306
- const searchcraftClearInputButtonModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputClearButtonLTR{align-items:center;background:none;border:none;display:flex;height:20px;justify-content:center;padding:0;position:absolute;right:0;top:50%;transform:translateY(-50%);width:20px}.inputClearButtonRTL{align-items:center;background:none;border:none;display:flex;height:20px;justify-content:center;left:0px;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:20px}";
307
- const SearchcraftClearInputButtonStyle0 = searchcraftClearInputButtonModuleCss;
308
-
309
- const SearchcraftClearInputButton = class {
310
- constructor(hostRef) {
311
- index.registerInstance(this, hostRef);
312
- this.clearInput = index.createEvent(this, "clearInput", 7);
313
- // Added a click handler to emit the event
314
- this.handleClearClick = (event) => {
315
- event.preventDefault(); // Prevent default if necessary
316
- this.clearInput.emit(); // Emit the event
317
- };
318
- this.isRequesting = false;
319
- this.rightToLeftOrientation = false;
320
- this.theme = 'light';
321
- }
322
- isLightTheme() {
323
- return this.theme === 'light';
324
- }
325
- render() {
326
- return this.rightToLeftOrientation ? (index.h("button", { class: index$1.classNames('inputClearButtonRTL', '.sc-clear-input-button-rtl'), onClick: this.handleClearClick, type: 'button' }, this.isRequesting ? (this.isLightTheme ? (index.h("searchcraft-spinner-light", null)) : (index.h("searchcraft-spinner-dark", null))) : this.isLightTheme ? (index.h("searchcraft-clear-icon-set", { type: 'clear-light' })) : (index.h("searchcraft-clear-icon-set", { type: 'clear-dark' })))) : (index.h("button", { class: index$1.classNames('inputClearButtonLTR', '.sc-clear-input-button-ltr'), onClick: this.handleClearClick, type: 'button' }, this.isRequesting ? (this.isLightTheme ? (index.h("searchcraft-spinner-light", null)) : (index.h("searchcraft-spinner-dark", null))) : this.isLightTheme ? (index.h("searchcraft-clear-icon-set", { type: 'clear-light' })) : (index.h("searchcraft-clear-icon-set", { type: 'clear-dark' }))));
327
- }
328
- };
329
- SearchcraftClearInputButton.style = SearchcraftClearInputButtonStyle0;
330
-
331
- const searchcraftErrorMessageModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.errorMessageLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#990000}.errorMessageDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFB3B3}";
332
- const SearchcraftErrorMessageStyle0 = searchcraftErrorMessageModuleCss;
333
-
334
- const SearchcraftErrorMessage = class {
335
- constructor(hostRef) {
336
- index.registerInstance(this, hostRef);
337
- this.errorMessage = undefined;
338
- this.theme = 'light';
339
- }
340
- render() {
341
- const errorMessageStyle = this.theme === 'light' ? 'errorMessageLight' : 'errorMessageDark';
342
- return (index.h("p", { key: '544903d700810ed5d6efdefedab646cafed2376d', class: index$1.classNames(errorMessageStyle) }, this.errorMessage || 'Search term is required.'));
343
- }
344
- };
345
- SearchcraftErrorMessage.style = SearchcraftErrorMessageStyle0;
346
-
347
- const searchcraftFiltersListModuleCss = "@charset \"UTF-8\";.filtersList{width:100%}.checkboxLabel{align-items:center;color:#292929;display:flex;font-family:\"Source Sans Pro\";font-size:14px;font-weight:600;gap:14px}.checkboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:#EDEDED;border:1px solid #D9D9D9;cursor:pointer;display:flex;height:24px;justify-content:center;width:24px}.checkboxLabel input[type=checkbox]:checked{background-color:#000}.checkboxLabel input[type=checkbox]:checked::before{color:#fff;content:\"✔\"}.remainingFilterListCheckbox{margin-left:16px}.childCheckboxLabel{align-items:center;color:#292929;display:flex;font-family:\"Source Sans Pro\";font-size:14px;font-weight:600;gap:12px}.childCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:#EDEDED;border:1px solid #D9D9D9;cursor:pointer;display:flex;height:24px;justify-content:center;width:24px}.childCheckboxLabel input[type=checkbox]:checked{background-color:#000}.childCheckboxLabel input[type=checkbox]:checked::before{color:#fff;content:\"✔\"}";
348
- const SearchcraftFiltersListStyle0 = searchcraftFiltersListModuleCss;
349
-
350
- const SearchcraftFiltersList = class {
351
- constructor(hostRef) {
352
- index.registerInstance(this, hostRef);
353
- this.filtersUpdated = index.createEvent(this, "filtersUpdated", 7);
354
- this.searchStore = store.useSearchcraftStore.getState();
355
- this.handleFilterChange = (value, checked) => {
356
- if (checked) {
357
- this.selectedFilters.add(value);
358
- }
359
- else {
360
- this.selectedFilters.delete(value);
361
- }
362
- const selectedFiltersArray = Array.from(this.selectedFilters);
363
- this.filtersUpdated.emit(selectedFiltersArray);
364
- this.searchStore.setSelectedFilters(selectedFiltersArray);
365
- this.searchStore.search();
366
- };
367
- this.filters = [];
368
- this.dynamicFilters = [];
369
- this.initialFilters = [];
370
- this.isRequesting = false;
371
- this.selectedFilters = new Set();
372
- this.originalFilterCounts = {};
373
- this.query = '';
374
- this.resultsCount = 0;
375
- }
376
- connectedCallback() {
377
- this.unsubscribe = store.useSearchcraftStore.subscribe((state) => {
378
- var _a, _b, _c, _d;
379
- this.isRequesting = state.isRequesting;
380
- this.query = state.query || '';
381
- this.resultsCount = ((_c = (_b = (_a = state.searchResults) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.hits) === null || _c === void 0 ? void 0 : _c.length) || 0;
382
- const facets = (_d = state.searchResults) === null || _d === void 0 ? void 0 : _d.data.facets;
383
- if (facets) {
384
- this.populateFiltersFromFacets(facets);
385
- }
386
- });
387
- }
388
- disconnectedCallback() {
389
- if (this.unsubscribe) {
390
- this.unsubscribe();
391
- }
392
- }
393
- populateFiltersFromFacets(facets) {
394
- var _a;
395
- const newFilters = Object.entries(((_a = facets.section) === null || _a === void 0 ? void 0 : _a.counts) || {}).map(([key, count]) => {
396
- const filterValue = key;
397
- this.originalFilterCounts[filterValue] = `${count}`;
398
- return {
399
- label: `${key.replace(/^\//, '')} (${count})`,
400
- value: filterValue,
401
- };
402
- });
403
- // Update dynamic filters while preserving the initial filters
404
- const updatedFilters = [
405
- ...this.initialFilters,
406
- ...newFilters.filter((filter) => !this.initialFilters.some((initial) => initial.value === filter.value)),
407
- ];
408
- this.dynamicFilters = updatedFilters;
409
- // Store the initial filters only once
410
- if (this.initialFilters.length === 0) {
411
- this.initialFilters = [...updatedFilters];
412
- }
413
- }
414
- formatLabel(label) {
415
- return label
416
- .replace(/-/g, ' ') // Replace dashes with spaces
417
- .split(' ') // Split words
418
- .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) // Capitalize the first letter
419
- .join(' '); // Join words back into a single string
420
- }
421
- render() {
422
- if (!this.query || this.resultsCount === 0) {
423
- return null;
424
- }
425
- const filtersToRender = this.initialFilters.map((initialFilter) => {
426
- const isChecked = this.selectedFilters.has(initialFilter.value);
427
- const dynamicChildren = this.dynamicFilters.filter((dynamicFilter) => dynamicFilter.value.startsWith(initialFilter.value) &&
428
- dynamicFilter.value !== initialFilter.value);
429
- return Object.assign(Object.assign({}, initialFilter), { isChecked, children: dynamicChildren });
430
- });
431
- return (index.h("div", { class: 'filtersList' }, filtersToRender.map((filter) => (index.h("div", { key: filter.value }, index.h("label", { class: 'checkboxLabel' }, index.h("input", { class: 'filterCheckbox', checked: filter.isChecked, onChange: (event) => this.handleFilterChange(filter.value, event.target.checked), type: 'checkbox', value: filter.value }), this.formatLabel(filter.label)), filter.isChecked &&
432
- filter.children.map((childFilter) => {
433
- const childLabel = childFilter.label.split('/').pop(); // Get only the part after the last '/'
434
- return (index.h("label", { class: 'childCheckboxLabel', key: childFilter.value, style: { marginLeft: '20px' } }, index.h("input", { class: 'childFilterCheckbox', checked: this.selectedFilters.has(childFilter.value), onChange: (event) => this.handleFilterChange(childFilter.value, event.target.checked), type: 'checkbox', value: childFilter.value }), this.formatLabel(childLabel || '')));
435
- }))))));
436
- }
437
- };
438
- SearchcraftFiltersList.style = SearchcraftFiltersListStyle0;
439
-
440
- const searchcraftInputModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputContainerLTR{position:relative;width:100%}.inputContainerRTL{position:relative;width:100%;margin-left:8px}.inputLightLTR{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#EDEDED;color:#292929;margin-right:8px;padding-left:36px;padding-right:16px}.inputLightLTR::placeholder{font-family:var(--font-stack);font-size:16px}.inputLightLTR::placeholder{color:#737373}.inputLightLTR:focus{outline:2px solid #000}.inputDarkLTR{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#1A1A1A;color:#FFF;margin-right:8px;padding-left:36px;padding-right:16px}.inputDarkLTR::placeholder{font-family:var(--font-stack);font-size:16px}.inputDarkLTR::placeholder{color:#BFBFBF}.inputDarkLTR:focus{outline:2px solid #FFF}.inputErrorLightLTR{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#EDEDED;color:#292929;outline:2px solid #c00;margin-right:8px;padding-left:36px;padding-right:16px}.inputErrorLightLTR::placeholder{font-family:var(--font-stack);font-size:16px}.inputErrorLightLTR::placeholder{color:#737373}.inputErrorLightLTR:focus{outline:2px solid #000}.inputErrorLightLTR:focus-visible{outline:2px solid #c00}.inputErrorDarkLTR{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#1A1A1A;color:#FFF;outline:2px solid #FFB3B3;margin-right:8px;padding-left:36px;padding-right:16px}.inputErrorDarkLTR::placeholder{font-family:var(--font-stack);font-size:16px}.inputErrorDarkLTR::placeholder{color:#BFBFBF}.inputErrorDarkLTR:focus{outline:2px solid #FFF}.inputErrorDarkLTR:focus-visible{outline:2px solid #FFB3B3}.inputLightRTL{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#EDEDED;color:#292929;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputLightRTL::placeholder{font-family:var(--font-stack);font-size:16px}.inputLightRTL::placeholder{color:#737373}.inputLightRTL:focus{outline:2px solid #000}.inputDarkRTL{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#1A1A1A;color:#FFF;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputDarkRTL::placeholder{font-family:var(--font-stack);font-size:16px}.inputDarkRTL::placeholder{color:#BFBFBF}.inputDarkRTL:focus{outline:2px solid #FFF}.inputErrorLightRTL{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#EDEDED;color:#292929;outline:2px solid #c00;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputErrorLightRTL::placeholder{font-family:var(--font-stack);font-size:16px}.inputErrorLightRTL::placeholder{color:#737373}.inputErrorLightRTL:focus{outline:2px solid #000}.inputErrorLightRTL:focus-visible{outline:2px solid #c00}.inputErrorDarkRTL{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#1A1A1A;color:#FFF;outline:2px solid #FFB3B3;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputErrorDarkRTL::placeholder{font-family:var(--font-stack);font-size:16px}.inputErrorDarkRTL::placeholder{color:#BFBFBF}.inputErrorDarkRTL:focus{outline:2px solid #FFF}.inputErrorDarkRTL:focus-visible{outline:2px solid #FFB3B3}.inputWrapper{align-items:center;display:flex;position:relative;width:100%}";
441
- const SearchcraftInputStyle0 = searchcraftInputModuleCss;
442
-
443
- const SearchcraftInput = class {
444
- constructor(hostRef) {
445
- index.registerInstance(this, hostRef);
446
- this.clearInput = index.createEvent(this, "clearInput", 7);
447
- this.searchInputChange = index.createEvent(this, "searchInputChange", 7);
448
- this.inputKeyUp = index.createEvent(this, "inputKeyUp", 7);
449
- this.customStyles = {};
450
- this.error = false;
451
- this.formClassName = '';
452
- this.inputCaptionClassName = '';
453
- this.inputCaptionValue = '';
454
- this.inputClassName = '';
455
- this.inputIconHeight = 20;
456
- this.inputIconWidth = 20;
457
- this.isRequesting = false;
458
- this.placeholderValue = 'Enter Search';
459
- this.rightToLeftOrientation = false;
460
- this.query = '';
461
- this.theme = 'light';
462
- }
463
- get isLightTheme() {
464
- return this.theme === 'light';
465
- }
466
- handleInputChange(event) {
467
- const input = event.target;
468
- this.searchInputChange.emit(input.value);
469
- }
470
- handleInputKeyUp(event) {
471
- const input = event.target;
472
- this.inputKeyUp.emit(input.value);
473
- }
474
- handleClearInput() {
475
- if (this.clearInput) {
476
- this.clearInput.emit();
477
- }
478
- }
479
- render() {
480
- const containerClassName = this.rightToLeftOrientation
481
- ? 'inputContainerRTL'
482
- : 'inputContainerLTR';
483
- const inputClassName = index$1.classNames(this.error
484
- ? this.isLightTheme
485
- ? 'inputErrorLightRTL'
486
- : 'inputErrorDarkRTL'
487
- : this.isLightTheme
488
- ? 'inputLightLTR'
489
- : 'inputDarkLTR', 'searchcraft-input');
490
- const validatedCustomStyles = utils.parseCustomStyles(this.customStyles);
491
- const placeholderStyle = {
492
- fontSize: validatedCustomStyles.placeholderFontSize || '16px',
493
- };
494
- return (index.h("div", { key: 'ca2698b808ef606d890817f6b8c133503663570e', class: index$1.classNames(containerClassName, this.formClassName, 'searchcraft-input-form') }, this.rightToLeftOrientation ? (index.h(index.Fragment, null, index.h("input", { autoComplete: 'off', class: index$1.classNames(inputClassName, 'searchcraft-input'), id: 'searchcraft-input-id', onChange: this.handleInputChange.bind(this), onKeyUp: this.handleInputKeyUp.bind(this), placeholder: this.placeholderValue, type: 'text', value: this.query, style: validatedCustomStyles }), index.h("style", null, `
495
- #searchcraft-input-id::placeholder {
496
- font-size: ${placeholderStyle.fontSize};
497
- }
498
- `), this.inputCaptionValue && (index.h("searchcraft-input-caption", { inputCaptionClassName: this.inputCaptionClassName, inputCaptionValue: this.inputCaptionValue, rightToLeftOrientation: this.rightToLeftOrientation })), this.query.length > 0 && (index.h("searchcraft-clear-input-button", { isRequesting: this.isRequesting, onClearInput: this.handleClearInput, rightToLeftOrientation: this.rightToLeftOrientation })), index.h("searchcraft-input-icon", { error: this.error, height: this.inputIconHeight, rightToLeftOrientation: this.rightToLeftOrientation, width: this.inputIconWidth }))) : (index.h(index.Fragment, null, index.h("searchcraft-input-icon", { error: this.error, height: this.inputIconHeight, rightToLeftOrientation: this.rightToLeftOrientation, width: this.inputIconWidth }), index.h("input", { autoComplete: 'off', class: index$1.classNames(inputClassName, 'searchcraft-input'), id: 'searchcraft-input-id', onChange: this.handleInputChange.bind(this), onKeyUp: this.handleInputKeyUp.bind(this), placeholder: this.placeholderValue, type: 'text', value: this.query, style: validatedCustomStyles }), index.h("style", null, `
499
- #searchcraft-input-id::placeholder {
500
- font-size: ${placeholderStyle.fontSize};
501
- }
502
- `), this.inputCaptionValue && (index.h("searchcraft-input-caption", { inputCaptionClassName: this.inputCaptionClassName, inputCaptionValue: this.inputCaptionValue, rightToLeftOrientation: this.rightToLeftOrientation })), this.query.length > 0 && (index.h("searchcraft-clear-input-button", { isRequesting: this.isRequesting, onClearInput: this.handleClearInput, rightToLeftOrientation: this.rightToLeftOrientation }))))));
503
- }
504
- };
505
- SearchcraftInput.style = SearchcraftInputStyle0;
506
-
507
- const searchcraftInputCaptionModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputCaptionLightLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#404040}.inputCaptionDarkLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#E6E6E6}.inputCaptionErrorLightLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#990000}.inputCaptionErrorDarkLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFB3B3}.inputCaptionLightRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#404040;text-align:right}.inputCaptionDarkRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#E6E6E6;text-align:right}.inputCaptionErrorLightRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#990000;text-align:right}.inputCaptionErrorDarkRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFB3B3;text-align:right}";
508
- const SearchcraftInputCaptionStyle0 = searchcraftInputCaptionModuleCss;
509
-
510
- const SearchcraftInputCaption = class {
511
- constructor(hostRef) {
512
- index.registerInstance(this, hostRef);
513
- this.error = undefined;
514
- this.inputCaptionClassName = '';
515
- this.inputCaptionValue = 'Enter Search';
516
- this.rightToLeftOrientation = false;
517
- this.theme = 'light';
518
- }
519
- isLightTheme() {
520
- return this.theme === 'light';
521
- }
522
- render() {
523
- return this.rightToLeftOrientation ? (index.h("p", { class: index$1.classNames(this.error
524
- ? this.isLightTheme
525
- ? 'inputCaptionErrorLightRTL'
526
- : 'inputCaptionErrorDarkRTL'
527
- : this.isLightTheme
528
- ? 'inputCaptionLightRTL'
529
- : 'inputCaptionDarkRTL', this.inputCaptionClassName, '.searchcraft-input-caption') }, this.inputCaptionValue)) : (index.h("p", { class: index$1.classNames(this.error
530
- ? this.isLightTheme
531
- ? 'inputCaptionErrorLightLTR'
532
- : 'inputCaptionErrorDarkLTR'
533
- : this.isLightTheme
534
- ? 'inputCaptionLightLTR'
535
- : 'inputCaptionDarkLTR', this.inputCaptionClassName, '.searchcraft-input-caption') }, this.inputCaptionValue));
536
- }
537
- };
538
- SearchcraftInputCaption.style = SearchcraftInputCaptionStyle0;
539
-
540
- const searchcraftInputIconModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputIconLTR{left:15px;position:absolute;top:50%;transform:translateY(-50%)}.inputIconRTL{position:absolute;right:15px;top:50%;transform:translateY(-50%)}";
541
- const SearchcraftInputIconStyle0 = searchcraftInputIconModuleCss;
542
-
543
- const SearchcraftInputIcon = class {
544
- constructor(hostRef) {
545
- index.registerInstance(this, hostRef);
546
- this.error = undefined;
547
- this.rightToLeftOrientation = false;
548
- this.height = 20;
549
- this.width = 20;
550
- this.theme = 'light';
551
- }
552
- isLightTheme() {
553
- return this.theme === 'light';
554
- }
555
- render() {
556
- return this.error ? (index.h("div", { class: this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR' }, this.isLightTheme() ? (index.h("searchcraft-search-icon-set", { height: this.height, type: 'error-light', width: this.width })) : (index.h("searchcraft-search-icon-set", { height: this.height, type: 'error-dark', width: this.width })))) : (index.h("div", { class: this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR' }, this.isLightTheme() ? (index.h("searchcraft-search-icon-set", { height: this.height, type: 'search-light', width: this.width })) : (index.h("searchcraft-search-icon-set", { height: this.height, type: 'search-dark', width: this.width }))));
557
- }
558
- };
559
- SearchcraftInputIcon.style = SearchcraftInputIconStyle0;
560
-
561
- const searchcraftInputLabelModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.labelLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#292929}.labelDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFF}";
562
- const SearchcraftInputLabelStyle0 = searchcraftInputLabelModuleCss;
563
-
564
- const SearchcraftInputLabel = class {
565
- constructor(hostRef) {
566
- index.registerInstance(this, hostRef);
567
- this.inputLabelClassName = '';
568
- this.label = undefined;
569
- this.theme = 'light';
570
- }
571
- isLightTheme() {
572
- return this.theme === 'light';
573
- }
574
- render() {
575
- // Render nothing if no label prop is provided
576
- if (!this.label) {
577
- return null;
578
- }
579
- const labelStyle = this.isLightTheme() ? 'labelLight' : 'labelDark';
580
- return (index.h("label", { class: index$1.classNames(labelStyle, this.inputLabelClassName), htmlFor: 'searchcraft-input-id' }, this.label));
581
- }
582
- };
583
- SearchcraftInputLabel.style = SearchcraftInputLabelStyle0;
584
-
585
- const searchcraftResultsInfoModuleCss = ".container{border-bottom:1px solid #D9D9D9;display:flex;justify-content:flex-start;width:100%}.resultsInfo{color:#292929;font-family:\"Brygada 1918\";font-size:18px;font-weight:600;line-height:20px;margin:0;margin-bottom:8px}";
586
- const SearchcraftResultsInfoStyle0 = searchcraftResultsInfoModuleCss;
587
-
588
- const SearchcraftResultsInfo = class {
589
- constructor(hostRef) {
590
- index.registerInstance(this, hostRef);
591
- this.isRequesting = false;
592
- this.resultsCount = 0;
593
- this.responseTime = '';
594
- this.query = '';
595
- }
596
- connectedCallback() {
597
- this.unsubscribe = store.useSearchcraftStore.subscribe((state) => {
598
- var _a, _b, _c, _d;
599
- this.isRequesting = state.isRequesting;
600
- this.resultsCount = ((_b = (_a = state.searchResults) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.count) || 0;
601
- this.responseTime = ((((_d = (_c = state.searchResults) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.time_taken) || 0) * 1000).toFixed(2);
602
- this.query = state.query || ''; // Update query from store
603
- });
604
- }
605
- disconnectedCallback() {
606
- if (this.unsubscribe) {
607
- this.unsubscribe();
608
- }
609
- }
610
- render() {
611
- if (!this.query || this.resultsCount === 0) {
612
- return null;
613
- }
614
- return (index.h("div", { class: 'container' }, index.h("p", { class: 'resultsInfo' }, this.resultsCount, " results found in ", this.responseTime, "ms")));
615
- }
616
- };
617
- SearchcraftResultsInfo.style = SearchcraftResultsInfoStyle0;
618
-
619
- const SearchcraftSearchIconSet = class {
620
- constructor(hostRef) {
621
- index.registerInstance(this, hostRef);
622
- this.type = 'search-dark';
623
- this.width = 20;
624
- this.height = 20;
625
- }
626
- render() {
627
- const { width, height } = this;
628
- switch (this.type) {
629
- case 'search-light':
630
- return (index.h("svg", { width: width, height: height, viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, index.h("title", { id: 'searchcraft-title' }, "Searchcraft Search Icon Light"), index.h("path", { d: 'M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z', stroke: '#404040', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
631
- case 'search-dark':
632
- return (index.h("svg", { width: width, height: height, viewBox: '0 0 18 18', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, index.h("title", { id: 'searchcraft-title' }, "Searchcraft Search Icon Dark"), index.h("path", { d: 'M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z', stroke: '#E6E6E6', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
633
- case 'error-light':
634
- return (index.h("svg", { width: width, height: height, viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, index.h("title", { id: 'searchcraft-title' }, "Searchcraft Error Search Icon Light"), index.h("path", { d: 'M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z', stroke: '#737373', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
635
- case 'error-dark':
636
- return (index.h("svg", { width: width, height: height, viewBox: '0 0 18 18', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, index.h("title", { id: 'searchcraft-title' }, "Searchcraft Error Search Icon Dark"), index.h("path", { d: 'M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z', stroke: '#BFBFBF', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
637
- default:
638
- return null;
639
- }
640
- }
641
- };
642
-
643
- const searchcraftSliderModuleCss = ".slider-container{display:flex;flex-direction:column;gap:10px;font-family:Arial, sans-serif;align-items:center}label{font-size:14px;font-weight:bold;margin-bottom:10px}.range-container{display:flex;width:100%;align-items:center}.range-slider{width:100%;height:4px;background:#ddd;border-radius:2px;outline:none;margin:0 -1px;position:relative}.range-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background-color:#FFF;border-radius:50%;border:1px solid #E6E6E6;cursor:pointer;position:relative}.range-slider::-moz-range-thumb{width:20px;height:20px;background-color:#FFF;border-radius:50%;border:1px solid #E6E6E6;cursor:pointer}.range-slider:before{content:\"\";position:absolute;height:4px;background-color:#FFF;border-radius:2px;left:0;right:0;z-index:-1}.year-labels{display:flex;justify-content:space-between;width:100%;margin-top:10px;font-size:15px;font-weight:600;font-family:\"Source Sans Pro\";color:#666}.year-label{min-width:30px;text-align:center}";
644
- const SearchcraftSliderStyle0 = searchcraftSliderModuleCss;
645
-
646
- const SearchcraftSlider = class {
647
- constructor(hostRef) {
648
- index.registerInstance(this, hostRef);
649
- this.searchStore = store.useSearchcraftStore.getState();
650
- this.updateYears = async () => {
651
- this.searchStore.setYearsRange([this.startYear, this.endYear]);
652
- try {
653
- if (typeof this.query === 'string' && this.query.trim() !== '') {
654
- await this.searchStore.search();
655
- }
656
- else {
657
- console.warn('Query is missing or empty, skipping search request.');
658
- }
659
- }
660
- catch (error) {
661
- console.error('Search failed:', error);
662
- }
663
- };
664
- this.handleStartYearChange = (event) => {
665
- const value = Number.parseInt(event.target.value, 10);
666
- this.startYear = Math.min(value, this.endYear);
667
- this.updateYears();
668
- };
669
- this.handleEndYearChange = (event) => {
670
- const value = Number.parseInt(event.target.value, 10);
671
- this.endYear = Math.max(value, this.startYear);
672
- this.updateYears();
673
- };
674
- this.minYear = 2000;
675
- this.maxYear = new Date().getFullYear();
676
- this.endYear = this.maxYear;
677
- this.query = '';
678
- this.startYear = this.minYear;
679
- this.hasSearched = false;
680
- this.resultsCount = 0;
681
- }
682
- componentDidLoad() {
683
- this.unsubscribe = store.useSearchcraftStore.subscribe((state) => {
684
- var _a, _b, _c;
685
- if (state.query.length > 0) {
686
- this.hasSearched = true;
687
- this.resultsCount = ((_c = (_b = (_a = state.searchResults) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.hits) === null || _c === void 0 ? void 0 : _c.length) || 0;
688
- }
689
- this.query = state.query;
690
- });
691
- }
692
- disconnectedCallback() {
693
- if (this.unsubscribe) {
694
- this.unsubscribe();
695
- }
696
- }
697
- render() {
698
- if (!this.query || this.resultsCount === 0) {
699
- return null;
700
- }
701
- return (index.h("div", { class: 'slider-container' }, index.h("div", { class: 'range-container' }, index.h("input", { class: 'range-slider', max: this.maxYear, min: this.minYear, onInput: this.handleStartYearChange, step: '1', type: 'range', value: this.startYear }), index.h("input", { class: 'range-slider', max: this.maxYear, min: this.minYear, onInput: this.handleEndYearChange, step: '1', type: 'range', value: this.endYear })), index.h("div", { class: 'year-labels' }, index.h("span", { class: 'year-label' }, this.startYear), index.h("span", { class: 'year-label' }, this.endYear))));
702
- }
703
- };
704
- SearchcraftSlider.style = SearchcraftSliderStyle0;
705
-
706
- const searchcraftSpinnerDarkModuleCss = ".spinnerContainer{background-color:transparent;height:20px;width:20px}.spinnerDark{height:100%;width:100%;background:conic-gradient(#000 50%, #FFFFFF);clip-path:circle(50%);mask-image:radial-gradient(circle at center, rgba(0, 0, 0, 0) 6.6666666667px, rgb(0, 0, 0) 6.6666666667px);animation:spinning 1s linear infinite}.spinnerLight{height:100%;width:100%;background:conic-gradient(#737373 50%, #FFFFFF);clip-path:circle(50%);mask-image:radial-gradient(circle at center, rgba(0, 0, 0, 0) 6.6666666667px, rgb(0, 0, 0) 6.6666666667px);animation:spinning 1s linear infinite}@keyframes spinning{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}";
707
- const SearchcraftSpinnerDarkStyle0 = searchcraftSpinnerDarkModuleCss;
708
-
709
- const SearchcraftSpinnerDark = class {
710
- constructor(hostRef) {
711
- index.registerInstance(this, hostRef);
712
- }
713
- render() {
714
- return (index.h("div", { key: '60b629930c2e2795236f6768b40c95ce9390e882', class: 'spinnerContainer' }, index.h("div", { key: 'bfef3329f2e81ecf6538738ac0213da6259dd1c3', class: 'spinnerDark' })));
715
- }
716
- };
717
- SearchcraftSpinnerDark.style = SearchcraftSpinnerDarkStyle0;
718
-
719
- const searchcraftSpinnerLightModuleCss = ".spinnerContainer{background-color:transparent;height:20px;width:20px}.spinnerLight{height:100%;width:100%;background:conic-gradient(#737373 50%, #FFFFFF);clip-path:circle(50%);mask-image:radial-gradient(circle at center, rgba(0, 0, 0, 0) 6.6666666667px, rgb(0, 0, 0) 6.6666666667px);animation:spinning 1s linear infinite}@keyframes spinning{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}";
720
- const SearchcraftSpinnerLightStyle0 = searchcraftSpinnerLightModuleCss;
721
-
722
- const SearchcraftSpinnerLight = class {
723
- constructor(hostRef) {
724
- index.registerInstance(this, hostRef);
725
- }
726
- render() {
727
- return (index.h("div", { key: 'ad5224c97faf7e329d2a8904488c17dfd7414b9e', class: 'spinnerContainer' }, index.h("div", { key: '6336ce7737af65eedac46ee290b20291ce5b6096', class: 'spinnerLight' })));
728
- }
729
- };
730
- SearchcraftSpinnerLight.style = SearchcraftSpinnerLightStyle0;
731
-
732
- const searchcraftToggleButtonModuleCss = ".toggle-wrapper{box-shadow:0px 0px 0px 1px rgba(0, 0, 0, 0.05);margin-left:10px;border:none;border-radius:16px;width:44px;height:26px;background:#ddd;position:relative;cursor:pointer}.toggle-wrapper.active{box-shadow:0px 0px 0px 1px rgba(0, 0, 0, 0.05);background:#007DB3}.toggle-wrapper .toggle-switch{width:18px;height:18px;background:#fff;border-radius:50%;position:absolute;top:calc(50% - 9px);left:4px;transition:transform 0.3s ease}.toggle-wrapper .toggle-switch.active{transform:translateX(16px)}";
733
- const SearchcraftToggleButtonStyle0 = searchcraftToggleButtonModuleCss;
734
-
735
- const SearchcraftToggleButton = class {
736
- constructor(hostRef) {
737
- index.registerInstance(this, hostRef);
738
- this.searchStore = store.useSearchcraftStore.getState();
739
- this.handleToggle = async () => {
740
- this.isActive = !this.isActive;
741
- if (this.type === 'mode') {
742
- const mode = this.isActive ? 'normal' : 'fuzzy';
743
- this.searchStore.setSearchParams({
744
- mode,
745
- });
746
- }
747
- else if (this.type === 'sort') {
748
- const sort = this.isActive ? 'desc' : 'asc';
749
- this.searchStore.setSearchParams({
750
- sort,
751
- });
752
- }
753
- try {
754
- await this.searchStore.search();
755
- }
756
- catch (error) {
757
- console.error('Search failed:', error);
758
- }
759
- };
760
- this.type = 'mode';
761
- this.isActive = false;
762
- this.query = '';
763
- this.resultsCount = 0;
764
- }
765
- componentDidLoad() {
766
- this.unsubscribe = store.useSearchcraftStore.subscribe((state) => {
767
- var _a, _b, _c;
768
- this.query = state.query || '';
769
- this.resultsCount = ((_c = (_b = (_a = state.searchResults) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.hits) === null || _c === void 0 ? void 0 : _c.length) || 0;
770
- });
771
- }
772
- disconnectedCallback() {
773
- if (this.unsubscribe) {
774
- this.unsubscribe();
775
- }
776
- }
777
- render() {
778
- if (!this.query || this.resultsCount === 0) {
779
- return null;
780
- }
781
- return (index.h("button", { class: `toggle-wrapper ${this.isActive ? 'active' : ''}`, onClick: this.handleToggle, type: 'button' }, index.h("div", { class: `toggle-switch ${this.isActive ? 'active' : ''}` })));
782
- }
783
- };
784
- SearchcraftToggleButton.style = SearchcraftToggleButtonStyle0;
785
-
786
- exports.searchcraft_auto_search_form = SearchcraftAutoSearchForm;
787
- exports.searchcraft_base_search_result = SearchcraftBaseSearchResult;
788
- exports.searchcraft_base_search_results = SearchcraftBaseSearchResults;
789
- exports.searchcraft_clear_icon_set = SearchcraftClearIconSet;
790
- exports.searchcraft_clear_input_button = SearchcraftClearInputButton;
791
- exports.searchcraft_error_message = SearchcraftErrorMessage;
792
- exports.searchcraft_filters_list = SearchcraftFiltersList;
793
- exports.searchcraft_input = SearchcraftInput;
794
- exports.searchcraft_input_caption = SearchcraftInputCaption;
795
- exports.searchcraft_input_icon = SearchcraftInputIcon;
796
- exports.searchcraft_input_label = SearchcraftInputLabel;
797
- exports.searchcraft_results_info = SearchcraftResultsInfo;
798
- exports.searchcraft_search_icon_set = SearchcraftSearchIconSet;
799
- exports.searchcraft_slider = SearchcraftSlider;
800
- exports.searchcraft_spinner_dark = SearchcraftSpinnerDark;
801
- exports.searchcraft_spinner_light = SearchcraftSpinnerLight;
802
- exports.searchcraft_toggle_button = SearchcraftToggleButton;
803
-
804
- //# sourceMappingURL=searchcraft-auto-search-form_17.cjs.entry.js.map