@searchcraft/javascript-sdk 0.1.5 → 0.1.7

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 (222) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +7 -0
  2. package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
  3. package/dist/cjs/index-5b0b9d4c.js +84 -0
  4. package/dist/cjs/index-5b0b9d4c.js.map +1 -0
  5. package/dist/cjs/index-7b49313c.js +1273 -0
  6. package/dist/cjs/index-7b49313c.js.map +1 -0
  7. package/dist/cjs/index.cjs.js +17 -0
  8. package/dist/cjs/index.cjs.js.map +1 -0
  9. package/dist/cjs/loader.cjs.js +17 -0
  10. package/dist/cjs/loader.cjs.js.map +1 -0
  11. package/dist/cjs/searchcraft-auto-search-form_13.cjs.entry.js +492 -0
  12. package/dist/cjs/searchcraft-auto-search-form_13.cjs.entry.js.map +1 -0
  13. package/dist/cjs/searchcraft-base-search-form.cjs.entry.js +64 -0
  14. package/dist/cjs/searchcraft-base-search-form.cjs.entry.js.map +1 -0
  15. package/dist/cjs/searchcraft-button-icon.cjs.entry.js +18 -0
  16. package/dist/cjs/searchcraft-button-icon.cjs.entry.js.map +1 -0
  17. package/dist/cjs/searchcraft-button.cjs.entry.js +37 -0
  18. package/dist/cjs/searchcraft-button.cjs.entry.js.map +1 -0
  19. package/dist/cjs/searchcraft-javascript-sdk.cjs.js +27 -0
  20. package/dist/cjs/searchcraft-javascript-sdk.cjs.js.map +1 -0
  21. package/dist/cjs/store-3d577aac.js +251 -0
  22. package/dist/cjs/store-3d577aac.js.map +1 -0
  23. package/dist/cjs/utils-39791159.js +53 -0
  24. package/dist/cjs/utils-39791159.js.map +1 -0
  25. package/dist/collection/assets/searchcraft-button-icons.js +9 -0
  26. package/dist/collection/assets/searchcraft-button-icons.js.map +1 -0
  27. package/dist/collection/assets/searchcraft-clear-icon-set.js +45 -0
  28. package/dist/collection/assets/searchcraft-clear-icon-set.js.map +1 -0
  29. package/dist/collection/assets/searchcraft-search-icon-set.js +84 -0
  30. package/dist/collection/assets/searchcraft-search-icon-set.js.map +1 -0
  31. package/dist/collection/collection-manifest.json +27 -0
  32. package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js +339 -0
  33. package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js.map +1 -0
  34. package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.module.css +19 -0
  35. package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js +168 -0
  36. package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js.map +1 -0
  37. package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.module.css +14 -0
  38. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +308 -0
  39. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +1 -0
  40. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.module.css +209 -0
  41. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +166 -0
  42. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +1 -0
  43. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.module.css +36 -0
  44. package/dist/collection/components/searchcraft-button/searchcraft-button.js +137 -0
  45. package/dist/collection/components/searchcraft-button/searchcraft-button.js.map +1 -0
  46. package/dist/collection/components/searchcraft-button/searchcraft-button.module.css +82 -0
  47. package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js +96 -0
  48. package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js.map +1 -0
  49. package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.module.css +33 -0
  50. package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js +64 -0
  51. package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js.map +1 -0
  52. package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.module.css +21 -0
  53. package/dist/collection/components/searchcraft-input/searchcraft-input.js +333 -0
  54. package/dist/collection/components/searchcraft-input/searchcraft-input.js.map +1 -0
  55. package/dist/collection/components/searchcraft-input/searchcraft-input.module.css +241 -0
  56. package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js +122 -0
  57. package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js.map +1 -0
  58. package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.module.css +79 -0
  59. package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js +109 -0
  60. package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js.map +1 -0
  61. package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.module.css +17 -0
  62. package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js +77 -0
  63. package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js.map +1 -0
  64. package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.module.css +21 -0
  65. package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.js +19 -0
  66. package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.js.map +1 -0
  67. package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.module.css +35 -0
  68. package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.js +19 -0
  69. package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.js.map +1 -0
  70. package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.module.css +26 -0
  71. package/dist/collection/index.js +14 -0
  72. package/dist/collection/index.js.map +1 -0
  73. package/dist/collection/provider/store.js +68 -0
  74. package/dist/collection/provider/store.js.map +1 -0
  75. package/dist/collection/utils/utils.js +45 -0
  76. package/dist/collection/utils/utils.js.map +1 -0
  77. package/dist/components/index.js +5 -0
  78. package/dist/components/index.js.map +1 -0
  79. package/dist/components/p-04bad430.js +34 -0
  80. package/dist/components/p-04bad430.js.map +1 -0
  81. package/dist/components/p-07fba086.js +69 -0
  82. package/dist/components/p-07fba086.js.map +1 -0
  83. package/dist/components/p-17c94ac1.js +48 -0
  84. package/dist/components/p-17c94ac1.js.map +1 -0
  85. package/dist/components/p-3ea9ba3a.js +62 -0
  86. package/dist/components/p-3ea9ba3a.js.map +1 -0
  87. package/dist/{searchcraft-javascript-sdk/index-d6567b9c.js → components/p-5cdc6210.js} +2 -10
  88. package/dist/components/p-5cdc6210.js.map +1 -0
  89. package/dist/{searchcraft-javascript-sdk/searchcraft-input.entry.js → components/p-62f37242.js} +83 -11
  90. package/dist/components/p-62f37242.js.map +1 -0
  91. package/dist/components/p-6b1d0cba.js +54 -0
  92. package/dist/components/p-6b1d0cba.js.map +1 -0
  93. package/dist/components/p-781a9a8c.js +34 -0
  94. package/dist/components/p-781a9a8c.js.map +1 -0
  95. package/dist/{searchcraft-javascript-sdk/searchcraft-input-caption.entry.js → components/p-85d96d9b.js} +32 -10
  96. package/dist/components/p-85d96d9b.js.map +1 -0
  97. package/dist/components/p-9c617862.js +247 -0
  98. package/dist/components/p-9c617862.js.map +1 -0
  99. package/dist/{searchcraft-javascript-sdk/searchcraft-clear-icon-set.entry.js → components/p-a3ea7edc.js} +25 -7
  100. package/dist/components/p-a3ea7edc.js.map +1 -0
  101. package/dist/components/p-af65953e.js +1109 -0
  102. package/dist/components/p-af65953e.js.map +1 -0
  103. package/dist/components/p-c14731ca.js +41 -0
  104. package/dist/components/p-c14731ca.js.map +1 -0
  105. package/dist/{searchcraft-javascript-sdk/searchcraft-search-icon-set.entry.js → components/p-d33fdd81.js} +27 -7
  106. package/dist/components/p-d33fdd81.js.map +1 -0
  107. package/dist/components/p-d73bc01d.js +50 -0
  108. package/dist/components/p-d73bc01d.js.map +1 -0
  109. package/dist/{searchcraft-javascript-sdk/searchcraft-base-search-result.entry.js → components/p-f3af2b04.js} +38 -9
  110. package/dist/{searchcraft-javascript-sdk/searchcraft-base-search-result.entry.js.map → components/p-f3af2b04.js.map} +1 -1
  111. package/dist/components/searchcraft-auto-search-form.js +196 -0
  112. package/dist/components/searchcraft-auto-search-form.js.map +1 -0
  113. package/dist/components/searchcraft-base-search-form.js +153 -0
  114. package/dist/components/searchcraft-base-search-form.js.map +1 -0
  115. package/dist/components/searchcraft-base-search-result.js +8 -0
  116. package/dist/components/searchcraft-base-search-result.js.map +1 -0
  117. package/dist/{searchcraft-javascript-sdk/searchcraft-base-search-results.entry.js → components/searchcraft-base-search-results.js} +49 -11
  118. package/dist/components/searchcraft-base-search-results.js.map +1 -0
  119. package/dist/components/searchcraft-button-icon.js +33 -0
  120. package/dist/components/searchcraft-button-icon.js.map +1 -0
  121. package/dist/components/searchcraft-button.js +8 -0
  122. package/dist/components/searchcraft-button.js.map +1 -0
  123. package/dist/components/searchcraft-clear-icon-set.js +8 -0
  124. package/dist/components/searchcraft-clear-icon-set.js.map +1 -0
  125. package/dist/components/searchcraft-clear-input-button.js +8 -0
  126. package/dist/components/searchcraft-clear-input-button.js.map +1 -0
  127. package/dist/components/searchcraft-error-message.js +8 -0
  128. package/dist/components/searchcraft-error-message.js.map +1 -0
  129. package/dist/components/searchcraft-input-caption.js +8 -0
  130. package/dist/components/searchcraft-input-caption.js.map +1 -0
  131. package/dist/components/searchcraft-input-icon.js +8 -0
  132. package/dist/components/searchcraft-input-icon.js.map +1 -0
  133. package/dist/components/searchcraft-input-label.js +8 -0
  134. package/dist/components/searchcraft-input-label.js.map +1 -0
  135. package/dist/components/searchcraft-input.js +8 -0
  136. package/dist/components/searchcraft-input.js.map +1 -0
  137. package/dist/components/searchcraft-search-icon-set.js +8 -0
  138. package/dist/components/searchcraft-search-icon-set.js.map +1 -0
  139. package/dist/components/searchcraft-spinner-dark.js +8 -0
  140. package/dist/components/searchcraft-spinner-dark.js.map +1 -0
  141. package/dist/components/searchcraft-spinner-light.js +8 -0
  142. package/dist/components/searchcraft-spinner-light.js.map +1 -0
  143. package/dist/esm/index-72ac5051.js +82 -0
  144. package/dist/esm/index-72ac5051.js.map +1 -0
  145. package/dist/esm/index-e4a4f86d.js +1245 -0
  146. package/dist/esm/index-e4a4f86d.js.map +1 -0
  147. package/dist/esm/index.js +4 -0
  148. package/dist/esm/index.js.map +1 -0
  149. package/dist/esm/loader.js +13 -0
  150. package/dist/esm/loader.js.map +1 -0
  151. package/dist/esm/searchcraft-auto-search-form_13.entry.js +476 -0
  152. package/dist/esm/searchcraft-auto-search-form_13.entry.js.map +1 -0
  153. package/dist/{searchcraft-javascript-sdk → esm}/searchcraft-base-search-form.entry.js +4 -4
  154. package/dist/esm/searchcraft-base-search-form.entry.js.map +1 -0
  155. package/dist/{searchcraft-javascript-sdk → esm}/searchcraft-button-icon.entry.js +1 -1
  156. package/dist/esm/searchcraft-button-icon.entry.js.map +1 -0
  157. package/dist/{searchcraft-javascript-sdk → esm}/searchcraft-button.entry.js +4 -4
  158. package/dist/esm/searchcraft-button.entry.js.map +1 -0
  159. package/dist/esm/searchcraft-javascript-sdk.js +22 -0
  160. package/dist/esm/searchcraft-javascript-sdk.js.map +1 -0
  161. package/dist/esm/store-03dc618f.js +247 -0
  162. package/dist/esm/store-03dc618f.js.map +1 -0
  163. package/dist/index.cjs.js +1 -0
  164. package/dist/index.js +1 -0
  165. package/dist/searchcraft-javascript-sdk/index.esm.js +1 -14
  166. package/dist/searchcraft-javascript-sdk/index.esm.js.map +1 -1
  167. package/dist/searchcraft-javascript-sdk/p-17c94ac1.js +2 -0
  168. package/dist/searchcraft-javascript-sdk/p-17c94ac1.js.map +1 -0
  169. package/dist/searchcraft-javascript-sdk/p-5cdc6210.js +7 -0
  170. package/dist/searchcraft-javascript-sdk/p-5cdc6210.js.map +1 -0
  171. package/dist/searchcraft-javascript-sdk/p-6a17384e.entry.js +2 -0
  172. package/dist/searchcraft-javascript-sdk/p-6a17384e.entry.js.map +1 -0
  173. package/dist/searchcraft-javascript-sdk/p-6c825f8c.entry.js +2 -0
  174. package/dist/searchcraft-javascript-sdk/p-6c825f8c.entry.js.map +1 -0
  175. package/dist/searchcraft-javascript-sdk/p-98eab6f9.entry.js +2 -0
  176. package/dist/searchcraft-javascript-sdk/p-98eab6f9.entry.js.map +1 -0
  177. package/dist/searchcraft-javascript-sdk/p-9c617862.js +11 -0
  178. package/dist/searchcraft-javascript-sdk/p-9c617862.js.map +1 -0
  179. package/dist/searchcraft-javascript-sdk/p-e1255160.js +2 -0
  180. package/dist/searchcraft-javascript-sdk/p-e1255160.js.map +1 -0
  181. package/dist/searchcraft-javascript-sdk/p-e6f6972c.js +3 -0
  182. package/dist/searchcraft-javascript-sdk/p-e6f6972c.js.map +1 -0
  183. package/dist/searchcraft-javascript-sdk/p-f77e9c21.entry.js +2 -0
  184. package/dist/searchcraft-javascript-sdk/p-f77e9c21.entry.js.map +1 -0
  185. package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js +1 -48
  186. package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js.map +1 -1
  187. package/package.json +1 -1
  188. package/dist/searchcraft-javascript-sdk/_commonjsHelpers-63cbe26c.js +0 -34
  189. package/dist/searchcraft-javascript-sdk/_commonjsHelpers-63cbe26c.js.map +0 -1
  190. package/dist/searchcraft-javascript-sdk/index-2e19f875.js +0 -3043
  191. package/dist/searchcraft-javascript-sdk/index-2e19f875.js.map +0 -1
  192. package/dist/searchcraft-javascript-sdk/index-d6567b9c.js.map +0 -1
  193. package/dist/searchcraft-javascript-sdk/searchcraft-auto-search-form.entry.js +0 -101
  194. package/dist/searchcraft-javascript-sdk/searchcraft-auto-search-form.entry.js.map +0 -1
  195. package/dist/searchcraft-javascript-sdk/searchcraft-base-search-form.entry.js.map +0 -1
  196. package/dist/searchcraft-javascript-sdk/searchcraft-base-search-results.entry.js.map +0 -1
  197. package/dist/searchcraft-javascript-sdk/searchcraft-button-icon.entry.js.map +0 -1
  198. package/dist/searchcraft-javascript-sdk/searchcraft-button.entry.js.map +0 -1
  199. package/dist/searchcraft-javascript-sdk/searchcraft-clear-icon-set.entry.js.map +0 -1
  200. package/dist/searchcraft-javascript-sdk/searchcraft-clear-input-button.entry.js +0 -31
  201. package/dist/searchcraft-javascript-sdk/searchcraft-clear-input-button.entry.js.map +0 -1
  202. package/dist/searchcraft-javascript-sdk/searchcraft-error-message.entry.js +0 -22
  203. package/dist/searchcraft-javascript-sdk/searchcraft-error-message.entry.js.map +0 -1
  204. package/dist/searchcraft-javascript-sdk/searchcraft-input-caption.entry.js.map +0 -1
  205. package/dist/searchcraft-javascript-sdk/searchcraft-input-icon.entry.js +0 -25
  206. package/dist/searchcraft-javascript-sdk/searchcraft-input-icon.entry.js.map +0 -1
  207. package/dist/searchcraft-javascript-sdk/searchcraft-input-label.entry.js +0 -30
  208. package/dist/searchcraft-javascript-sdk/searchcraft-input-label.entry.js.map +0 -1
  209. package/dist/searchcraft-javascript-sdk/searchcraft-input.entry.js.map +0 -1
  210. package/dist/searchcraft-javascript-sdk/searchcraft-search-icon-set.entry.js.map +0 -1
  211. package/dist/searchcraft-javascript-sdk/searchcraft-spinner-dark.entry.js +0 -17
  212. package/dist/searchcraft-javascript-sdk/searchcraft-spinner-dark.entry.js.map +0 -1
  213. package/dist/searchcraft-javascript-sdk/searchcraft-spinner-light.entry.js +0 -17
  214. package/dist/searchcraft-javascript-sdk/searchcraft-spinner-light.entry.js.map +0 -1
  215. package/dist/searchcraft-javascript-sdk/shadow-css-423dab2c.js +0 -334
  216. package/dist/searchcraft-javascript-sdk/shadow-css-423dab2c.js.map +0 -1
  217. package/dist/searchcraft-javascript-sdk/store-7a83a5d7.js +0 -3008
  218. package/dist/searchcraft-javascript-sdk/store-7a83a5d7.js.map +0 -1
  219. /package/dist/{searchcraft-javascript-sdk → esm}/app-globals-0f993ce5.js +0 -0
  220. /package/dist/{searchcraft-javascript-sdk → esm}/app-globals-0f993ce5.js.map +0 -0
  221. /package/dist/{searchcraft-javascript-sdk → esm}/utils-7bff0c78.js +0 -0
  222. /package/dist/{searchcraft-javascript-sdk → esm}/utils-7bff0c78.js.map +0 -0
@@ -0,0 +1,476 @@
1
+ import { r as registerInstance, c as createEvent, h, F as Fragment } from './index-e4a4f86d.js';
2
+ import { u as useSearchcraftStore, g } from './store-03dc618f.js';
3
+ import { p as parseCustomStyles, a as parseSearchKeys, s as serializeStyles, e as extractDynamicProperties } from './utils-7bff0c78.js';
4
+ import { c as classNames } from './index-72ac5051.js';
5
+
6
+ const searchcraftAutoSearchFormModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.formLTR{text-align:left;width:100%}.formRTL{text-align:right;width:100%}.searchContainer{align-items:center;display:flex;width:100%}";
7
+ const SearchcraftAutoSearchFormStyle0 = searchcraftAutoSearchFormModuleCss;
8
+
9
+ const SearchcraftAutoSearchForm = class {
10
+ constructor(hostRef) {
11
+ registerInstance(this, hostRef);
12
+ this.querySubmit = createEvent(this, "querySubmit", 7);
13
+ this.debounceTimeout = null;
14
+ this.debounceDelay = 300; // 300ms debounce delay
15
+ this.searchStore = useSearchcraftStore.getState();
16
+ this.handleInputChange = (event) => {
17
+ this.query = event.detail;
18
+ this.querySubmit.emit(this.query);
19
+ // Clear the previous debounce timeout
20
+ if (this.debounceTimeout) {
21
+ clearTimeout(this.debounceTimeout);
22
+ }
23
+ // Set a new debounce timeout
24
+ this.debounceTimeout = setTimeout(() => {
25
+ this.runSearch();
26
+ }, this.debounceDelay);
27
+ };
28
+ this.handleClearInput = () => {
29
+ this.query = '';
30
+ if (typeof this.clearInput === 'function') {
31
+ this.clearInput();
32
+ }
33
+ if (this.debounceTimeout) {
34
+ clearTimeout(this.debounceTimeout);
35
+ }
36
+ this.error = false;
37
+ this.searchResults = '';
38
+ };
39
+ this.runSearch = async () => {
40
+ if (this.query.trim() === '') {
41
+ this.error = true;
42
+ this.searchResults = '';
43
+ }
44
+ else {
45
+ this.error = false;
46
+ this.searchStore.setQuery(this.query);
47
+ try {
48
+ await this.searchStore.search();
49
+ this.searchResults = JSON.stringify(this.searchStore.searchResults);
50
+ }
51
+ catch (error) {
52
+ this.error = true;
53
+ }
54
+ }
55
+ };
56
+ this.handleFormSubmit = async (event) => {
57
+ event.preventDefault();
58
+ await this.runSearch();
59
+ };
60
+ this.autoSearchFormClass = '';
61
+ this.clearInput = () => { };
62
+ this.config = {
63
+ apiKey: '',
64
+ endpointURL: '',
65
+ index: [],
66
+ };
67
+ this.customStylesForInput = {};
68
+ this.inputCaptionValue = '';
69
+ this.inputIconHeight = 20;
70
+ this.inputIconWidth = 20;
71
+ this.labelForInput = '';
72
+ this.placeholderValue = 'Search here';
73
+ this.rightToLeftOrientation = false;
74
+ this.searchContainerClass = '';
75
+ this.error = false;
76
+ this.isRequesting = false;
77
+ this.query = '';
78
+ this.searchResults = '';
79
+ }
80
+ componentDidLoad() {
81
+ const searchcraft = new g(this.config);
82
+ this.searchStore.initialize(searchcraft, true);
83
+ this.unsubscribe = useSearchcraftStore.subscribe((state) => {
84
+ this.isRequesting = state.isRequesting;
85
+ });
86
+ }
87
+ disconnectedCallback() {
88
+ if (this.unsubscribe) {
89
+ this.unsubscribe();
90
+ }
91
+ }
92
+ render() {
93
+ const formClass = this.rightToLeftOrientation ? 'formRTL' : 'formLTR';
94
+ const parsedCustomStyles = parseCustomStyles(this.customStylesForInput);
95
+ return (h("form", { key: '6b735bbdba6e7ff105d176fffa32b9431d5c4e49', class: `${formClass}`, onSubmit: this.handleFormSubmit }, h("searchcraft-input-label", { key: 'c7284dead137677ee7cd6aedac4dbfb38fac8c4c', label: this.labelForInput }), h("div", { key: 'a59294d9b406a1df9beb6264808f6e6a43cedbdd', class: 'searchContainer' }, h("searchcraft-input", { key: 'c1faa2d11c94ec3d4d39456612209e72fd208629', customStyles: parsedCustomStyles, "input-caption-value": this.inputCaptionValue, "is-requesting": this.isRequesting, "input-icon-height": this.inputIconHeight, "input-icon-width": this.inputIconWidth, onClearInput: this.handleClearInput, onSearchInputChange: this.handleInputChange, "placeholder-value": this.placeholderValue, query: this.query, "right-to-left-orientation": this.rightToLeftOrientation })), this.error && (h("searchcraft-error-message", { key: 'b8b1e5b4b212a30f07f3756c8ce33c142e520420', errorMessage: 'Please enter a search query.' }))));
96
+ }
97
+ };
98
+ SearchcraftAutoSearchForm.style = SearchcraftAutoSearchFormStyle0;
99
+
100
+ const searchcraftBaseSearchResultModuleCss = ":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-height:540px;max-width:100%}@media (min-width: 600px){.imageContainer{max-height:175px}}.contentContainer{max-height:100%;max-width:100%}@media (min-width: 600px){.contentContainer{max-width:50%}}.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}.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}";
101
+ const SearchcraftBaseSearchResultStyle0 = searchcraftBaseSearchResultModuleCss;
102
+
103
+ const SearchcraftBaseSearchResult = class {
104
+ constructor(hostRef) {
105
+ registerInstance(this, hostRef);
106
+ this.buttonCallback = createEvent(this, "buttonCallback", 7);
107
+ this.keyDownCallback = createEvent(this, "keyDownCallback", 7);
108
+ this.resultCallback = createEvent(this, "resultCallback", 7);
109
+ this.buttonCallback = () => { }; // Callback for button click
110
+ this.keyDownCallback = () => { }; // Callback for key down event
111
+ this.resultCallback = () => { }; // Callback for result container click
112
+ this.handleButtonClick = () => {
113
+ this.buttonCallback();
114
+ };
115
+ this.handleContainerClick = () => {
116
+ if (this.isInteractive) {
117
+ this.resultCallback();
118
+ }
119
+ };
120
+ this.buttonText = '';
121
+ this.imageDescription = '';
122
+ this.imageSource = '';
123
+ this.isInteractive = false;
124
+ this.primaryContent = '';
125
+ this.secondaryContent = '';
126
+ this.tertiaryContent = '';
127
+ this.headingText = '';
128
+ this.subheadingText = '';
129
+ this.themeMode = 'light';
130
+ this.customStyles = '{}';
131
+ }
132
+ parseStyles() {
133
+ try {
134
+ return JSON.parse(this.customStyles);
135
+ }
136
+ catch (error) {
137
+ console.error('Error parsing custom styles:', error);
138
+ return {};
139
+ }
140
+ }
141
+ render() {
142
+ const isLightTheme = this.themeMode === 'light';
143
+ const styles = this.parseStyles();
144
+ return (h("div", { key: 'e16bae2d337d064e057645cfb0ebf52346229b83', class: this.isInteractive
145
+ ? isLightTheme
146
+ ? 'interactiveResultContainerLight'
147
+ : 'interactiveResultContainerDark'
148
+ : 'resultContainer', style: styles.container || {}, tabindex: '0', onClick: this.handleContainerClick, onKeyDown: this.keyDownCallback }, h("div", { key: 'f2154ce85febbe54956a7f28292b13113e3048dd', class: 'imageContainer' }, h("img", { key: '8063fa3b88ba56b9cba63ded99967c8097b8b185', alt: this.imageDescription, src: this.imageSource, style: styles.image || {}, class: isLightTheme ? 'imageLight' : 'imageDark' })), h("div", { key: 'e04a38165dc98b0d72f215e4252f7065db3664d6', class: 'contentContainer' }, h("h2", { key: '33d2d3483d7c0f4e1ae7e15ba5895a8b15b45a34', style: styles.heading || {}, class: isLightTheme ? 'headingLight' : 'headingDark' }, this.headingText), h("h3", { key: '9587d0acea25ede251eba3e79dba932a5565f51a', style: styles.subheading || {}, class: isLightTheme ? 'subheadingLight' : 'subheadingDark' }, this.subheadingText), h("p", { key: '74f55a23963d5ddc8753d68b164587865da2dd13', style: styles.primaryContent || {}, class: isLightTheme ? 'primaryContentLight' : 'primaryContentDark' }, this.primaryContent), h("div", { key: 'db4e498b08c7075b276e90d8ed233dd48992ecdd' }, h("p", { key: 'c09d3164a15452c5fbfa23a54028f2080dd56550', style: styles.secondaryContent || {}, class: isLightTheme ? 'secondaryContentLight' : 'secondaryContentDark' }, this.secondaryContent), h("p", { key: 'ae78c4f53d9b12d62cad6b408aad5caf103303db', style: styles.tertiaryContent || {}, class: isLightTheme ? 'tertiaryContentLight' : 'tertiaryContentDark' }, this.tertiaryContent)), this.buttonText && (h("button", { key: '3ea036c680f3970e9d6f1b00b3505f11e338922c', onClick: this.handleButtonClick, style: styles.button || {}, type: 'button' }, this.buttonText)))));
149
+ }
150
+ };
151
+ SearchcraftBaseSearchResult.style = SearchcraftBaseSearchResultStyle0;
152
+
153
+ const searchcraftBaseSearchResultsModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.resultsContainer{display:flex;flex-direction:column;justify-content:center;margin:100px 20px}.resultsContainer>p{align-self:center}.resultsContainer>div{margin-bottom:20px}.resultsContainer>div img{height:300px;width:200px}.adSection{align-items:center;border:1px solid #DCDDDE;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}";
154
+ const SearchcraftBaseSearchResultsStyle0 = searchcraftBaseSearchResultsModuleCss;
155
+
156
+ const SearchcraftBaseSearchResults = class {
157
+ constructor(hostRef) {
158
+ registerInstance(this, hostRef);
159
+ this.query = '';
160
+ this.searchResults = null;
161
+ this.searchKeys = '';
162
+ this.customStylesForResults = {};
163
+ this.placeAdAtEnd = false;
164
+ this.adInterval = 4;
165
+ }
166
+ componentDidLoad() {
167
+ if (!this.searchKeys || this.searchKeys.length === 0) {
168
+ console.warn('No searchKeys provided; using empty keys array.');
169
+ this.searchKeys = '';
170
+ }
171
+ this.unsubscribe = useSearchcraftStore.subscribe((state) => {
172
+ this.searchResults = Object.assign({}, state.searchResults);
173
+ this.query = state.query;
174
+ });
175
+ const { searchResults, query } = useSearchcraftStore.getState();
176
+ this.searchResults = searchResults;
177
+ this.query = query;
178
+ }
179
+ disconnectedCallback() {
180
+ if (this.unsubscribe) {
181
+ this.unsubscribe();
182
+ }
183
+ }
184
+ render() {
185
+ var _a, _b, _c, _d, _e, _f, _g;
186
+ if (!((_a = this.searchResults) === null || _a === void 0 ? void 0 : _a.data)) {
187
+ console.warn('No search results data available');
188
+ return h("div", null, "No results to display.");
189
+ }
190
+ const parsedSearchKeys = parseSearchKeys(this.searchKeys);
191
+ const serializedStyles = typeof this.customStylesForResults === 'string'
192
+ ? this.customStylesForResults
193
+ : serializeStyles(this.customStylesForResults);
194
+ 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) => {
195
+ const { doc: result } = document;
196
+ const dynamicProperties = extractDynamicProperties(result, parsedSearchKeys);
197
+ return (h("searchcraft-base-search-result", { key: `${document.document_id}-${index}`, "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 }));
198
+ });
199
+ const finalComponents = [];
200
+ // Add ads at specified intervals
201
+ if (this.adInterval > 0) {
202
+ resultsComponents.forEach((component, index) => {
203
+ finalComponents.push(component);
204
+ if ((index + 1) % this.adInterval === 0) {
205
+ finalComponents.push(h("div", { key: `ad-section-${index + 1}`, class: 'adSection' }, h("span", null, "##"), h("p", null, " Ad Impressions")));
206
+ }
207
+ });
208
+ }
209
+ else {
210
+ finalComponents.push(...resultsComponents);
211
+ }
212
+ // Add ad at the end if specified
213
+ if (this.placeAdAtEnd) {
214
+ finalComponents.push(h("div", { key: 'ad-section-end', class: 'adSection' }, h("span", null, "##"), h("p", null, " Ad Impressions")));
215
+ }
216
+ return (h("div", { class: 'resultsContainer' }, finalComponents, this.query.length > 0 &&
217
+ ((_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 && (h("searchcraft-error-message", { "error-message": `No search results found for "${this.query}" query` }))));
218
+ }
219
+ };
220
+ SearchcraftBaseSearchResults.style = SearchcraftBaseSearchResultsStyle0;
221
+
222
+ const SearchcraftClearIconSet = class {
223
+ constructor(hostRef) {
224
+ registerInstance(this, hostRef);
225
+ this.type = 'clear-light';
226
+ }
227
+ render() {
228
+ switch (this.type) {
229
+ case 'clear-light':
230
+ return (h("svg", { width: '22', height: '22', viewBox: '0 0 22 22', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, h("title", { id: 'icon-title' }, "Searchcraft Clear Input Icon Light"), 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' })));
231
+ case 'clear-dark':
232
+ return (h("svg", { width: '22', height: '22', viewBox: '0 0 22 22', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, h("title", { id: 'icon-title' }, "Searchcraft Clear Input Icon Dark"), 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' })));
233
+ case 'arrow-light':
234
+ return (h("svg", { width: '20', height: '21', viewBox: '0 0 20 21', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, h("title", { id: 'icon-title' }, "Searchcraft Arrow Right Icon Light"), 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' })));
235
+ case 'arrow-dark':
236
+ return (h("svg", { width: '8', height: '12', viewBox: '0 0 8 12', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, h("title", { id: 'icon-title' }, "Searchcraft Arrow Right Icon Dark"), h("path", { d: 'M1.5 11L6.5 6L1.5 1', stroke: '#BFBFBF', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
237
+ default:
238
+ return null;
239
+ }
240
+ }
241
+ };
242
+
243
+ 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:25px;top:50%;transform:translateY(-50%);width:20px}.inputClearButtonRTL{align-items:center;background:none;border:none;display:flex;height:20px;justify-content:center;left:25px;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:20px}";
244
+ const SearchcraftClearInputButtonStyle0 = searchcraftClearInputButtonModuleCss;
245
+
246
+ const SearchcraftClearInputButton = class {
247
+ constructor(hostRef) {
248
+ registerInstance(this, hostRef);
249
+ this.clearInput = createEvent(this, "clearInput", 7);
250
+ // Added a click handler to emit the event
251
+ this.handleClearClick = (event) => {
252
+ event.preventDefault(); // Prevent default if necessary
253
+ this.clearInput.emit(); // Emit the event
254
+ };
255
+ this.isRequesting = false;
256
+ this.rightToLeftOrientation = false;
257
+ this.theme = 'light';
258
+ }
259
+ isLightTheme() {
260
+ return this.theme === 'light';
261
+ }
262
+ render() {
263
+ return this.rightToLeftOrientation ? (h("button", { class: classNames('inputClearButtonRTL', '.sc-clear-input-button-rtl'), onClick: this.handleClearClick, type: 'button' }, this.isRequesting ? (this.isLightTheme ? (h("searchcraft-spinner-light", null)) : (h("searchcraft-spinner-dark", null))) : this.isLightTheme ? (h("searchcraft-clear-icon-set", { type: 'clear-light' })) : (h("searchcraft-clear-icon-set", { type: 'clear-dark' })))) : (h("button", { class: classNames('inputClearButtonLTR', '.sc-clear-input-button-ltr'), onClick: this.handleClearClick, type: 'button' }, this.isRequesting ? (this.isLightTheme ? (h("searchcraft-spinner-light", null)) : (h("searchcraft-spinner-dark", null))) : this.isLightTheme ? (h("searchcraft-clear-icon-set", { type: 'clear-light' })) : (h("searchcraft-clear-icon-set", { type: 'clear-dark' }))));
264
+ }
265
+ };
266
+ SearchcraftClearInputButton.style = SearchcraftClearInputButtonStyle0;
267
+
268
+ 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}";
269
+ const SearchcraftErrorMessageStyle0 = searchcraftErrorMessageModuleCss;
270
+
271
+ const SearchcraftErrorMessage = class {
272
+ constructor(hostRef) {
273
+ registerInstance(this, hostRef);
274
+ this.errorMessage = undefined;
275
+ this.theme = 'light';
276
+ }
277
+ render() {
278
+ const errorMessageStyle = this.theme === 'light' ? 'errorMessageLight' : 'errorMessageDark';
279
+ return (h("p", { key: 'f520ac38f2f42e9780454aef5e25576095ae5ee9', class: classNames(errorMessageStyle) }, this.errorMessage || 'Search term is required.'));
280
+ }
281
+ };
282
+ SearchcraftErrorMessage.style = SearchcraftErrorMessageStyle0;
283
+
284
+ 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%}";
285
+ const SearchcraftInputStyle0 = searchcraftInputModuleCss;
286
+
287
+ const SearchcraftInput = class {
288
+ constructor(hostRef) {
289
+ registerInstance(this, hostRef);
290
+ this.clearInput = createEvent(this, "clearInput", 7);
291
+ this.searchInputChange = createEvent(this, "searchInputChange", 7);
292
+ this.customStyles = {};
293
+ this.error = false;
294
+ this.formClassName = '';
295
+ this.inputCaptionClassName = '';
296
+ this.inputCaptionValue = '';
297
+ this.inputClassName = '';
298
+ this.inputIconHeight = 20;
299
+ this.inputIconWidth = 20;
300
+ this.isRequesting = false;
301
+ this.placeholderValue = 'Enter Search';
302
+ this.rightToLeftOrientation = false;
303
+ this.query = '';
304
+ this.theme = 'light';
305
+ }
306
+ get isLightTheme() {
307
+ return this.theme === 'light';
308
+ }
309
+ handleInputChange(event) {
310
+ const input = event.target;
311
+ this.searchInputChange.emit(input.value);
312
+ }
313
+ handleClearInput() {
314
+ if (this.clearInput) {
315
+ this.clearInput.emit();
316
+ }
317
+ }
318
+ render() {
319
+ const containerClassName = this.rightToLeftOrientation
320
+ ? 'inputContainerRTL'
321
+ : 'inputContainerLTR';
322
+ const inputClassName = classNames(this.error
323
+ ? this.isLightTheme
324
+ ? 'inputErrorLightRTL'
325
+ : 'inputErrorDarkRTL'
326
+ : this.isLightTheme
327
+ ? 'inputLightLTR'
328
+ : 'inputDarkLTR', 'searchcraft-input');
329
+ const validatedCustomStyles = parseCustomStyles(this.customStyles);
330
+ const placeholderStyle = {
331
+ fontSize: validatedCustomStyles.placeholderFontSize || '16px',
332
+ };
333
+ return (h("div", { key: '41f29f98e95d5811e81dd885cd282cd8f50cb776', class: classNames(containerClassName, this.formClassName, 'searchcraft-input-form') }, this.rightToLeftOrientation ? (h(Fragment, null, h("input", { class: classNames(inputClassName, 'searchcraft-input'), id: 'searchcraft-input-id', onChange: this.handleInputChange.bind(this), placeholder: this.placeholderValue, type: 'text', value: this.query, style: validatedCustomStyles }), h("style", null, `
334
+ #searchcraft-input-id::placeholder {
335
+ font-size: ${placeholderStyle.fontSize};
336
+ }
337
+ `), this.inputCaptionValue && (h("searchcraft-input-caption", { inputCaptionClassName: this.inputCaptionClassName, inputCaptionValue: this.inputCaptionValue, rightToLeftOrientation: this.rightToLeftOrientation })), this.query.length > 0 && (h("searchcraft-clear-input-button", { isRequesting: this.isRequesting, onClearInput: this.handleClearInput, rightToLeftOrientation: this.rightToLeftOrientation })), h("searchcraft-input-icon", { error: this.error, height: this.inputIconHeight, rightToLeftOrientation: this.rightToLeftOrientation, width: this.inputIconWidth }))) : (h("div", { class: 'inputWrapper' }, h("searchcraft-input-icon", { error: this.error, height: this.inputIconHeight, rightToLeftOrientation: this.rightToLeftOrientation, width: this.inputIconWidth }), h("input", { class: classNames(inputClassName, 'searchcraft-input'), id: 'searchcraft-input-id', onChange: this.handleInputChange.bind(this), placeholder: this.placeholderValue, type: 'text', value: this.query, style: validatedCustomStyles }), h("style", null, `
338
+ #searchcraft-input-id::placeholder {
339
+ font-size: ${placeholderStyle.fontSize};
340
+ }
341
+ `), this.inputCaptionValue && (h("searchcraft-input-caption", { inputCaptionClassName: this.inputCaptionClassName, inputCaptionValue: this.inputCaptionValue, rightToLeftOrientation: this.rightToLeftOrientation })), this.query.length > 0 && (h("searchcraft-clear-input-button", { isRequesting: this.isRequesting, onClearInput: this.handleClearInput, rightToLeftOrientation: this.rightToLeftOrientation }))))));
342
+ }
343
+ };
344
+ SearchcraftInput.style = SearchcraftInputStyle0;
345
+
346
+ 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}";
347
+ const SearchcraftInputCaptionStyle0 = searchcraftInputCaptionModuleCss;
348
+
349
+ const SearchcraftInputCaption = class {
350
+ constructor(hostRef) {
351
+ registerInstance(this, hostRef);
352
+ this.error = undefined;
353
+ this.inputCaptionClassName = '';
354
+ this.inputCaptionValue = 'Enter Search';
355
+ this.rightToLeftOrientation = false;
356
+ this.theme = 'light';
357
+ }
358
+ isLightTheme() {
359
+ return this.theme === 'light';
360
+ }
361
+ render() {
362
+ return this.rightToLeftOrientation ? (h("p", { class: classNames(this.error
363
+ ? this.isLightTheme
364
+ ? 'inputCaptionErrorLightRTL'
365
+ : 'inputCaptionErrorDarkRTL'
366
+ : this.isLightTheme
367
+ ? 'inputCaptionLightRTL'
368
+ : 'inputCaptionDarkRTL', this.inputCaptionClassName, '.searchcraft-input-caption') }, this.inputCaptionValue)) : (h("p", { class: classNames(this.error
369
+ ? this.isLightTheme
370
+ ? 'inputCaptionErrorLightLTR'
371
+ : 'inputCaptionErrorDarkLTR'
372
+ : this.isLightTheme
373
+ ? 'inputCaptionLightLTR'
374
+ : 'inputCaptionDarkLTR', this.inputCaptionClassName, '.searchcraft-input-caption') }, this.inputCaptionValue));
375
+ }
376
+ };
377
+ SearchcraftInputCaption.style = SearchcraftInputCaptionStyle0;
378
+
379
+ 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%)}";
380
+ const SearchcraftInputIconStyle0 = searchcraftInputIconModuleCss;
381
+
382
+ const SearchcraftInputIcon = class {
383
+ constructor(hostRef) {
384
+ registerInstance(this, hostRef);
385
+ this.error = undefined;
386
+ this.rightToLeftOrientation = false;
387
+ this.height = 20;
388
+ this.width = 20;
389
+ this.theme = 'light';
390
+ }
391
+ isLightTheme() {
392
+ return this.theme === 'light';
393
+ }
394
+ render() {
395
+ return this.error ? (h("div", { class: this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR' }, this.isLightTheme() ? (h("searchcraft-search-icon-set", { height: this.height, type: 'error-light', width: this.width })) : (h("searchcraft-search-icon-set", { height: this.height, type: 'error-dark', width: this.width })))) : (h("div", { class: this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR' }, this.isLightTheme() ? (h("searchcraft-search-icon-set", { height: this.height, type: 'search-light', width: this.width })) : (h("searchcraft-search-icon-set", { height: this.height, type: 'search-dark', width: this.width }))));
396
+ }
397
+ };
398
+ SearchcraftInputIcon.style = SearchcraftInputIconStyle0;
399
+
400
+ 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}";
401
+ const SearchcraftInputLabelStyle0 = searchcraftInputLabelModuleCss;
402
+
403
+ const SearchcraftInputLabel = class {
404
+ constructor(hostRef) {
405
+ registerInstance(this, hostRef);
406
+ this.inputLabelClassName = '';
407
+ this.label = undefined;
408
+ this.theme = 'light';
409
+ }
410
+ isLightTheme() {
411
+ return this.theme === 'light';
412
+ }
413
+ render() {
414
+ // Render nothing if no label prop is provided
415
+ if (!this.label) {
416
+ return null;
417
+ }
418
+ const labelStyle = this.isLightTheme() ? 'labelLight' : 'labelDark';
419
+ return (h("label", { class: classNames(labelStyle, this.inputLabelClassName), htmlFor: 'searchcraft-input-id' }, this.label));
420
+ }
421
+ };
422
+ SearchcraftInputLabel.style = SearchcraftInputLabelStyle0;
423
+
424
+ const SearchcraftSearchIconSet = class {
425
+ constructor(hostRef) {
426
+ registerInstance(this, hostRef);
427
+ this.type = 'search-dark';
428
+ this.width = 20;
429
+ this.height = 20;
430
+ }
431
+ render() {
432
+ const { width, height } = this;
433
+ switch (this.type) {
434
+ case 'search-light':
435
+ return (h("svg", { width: width, height: height, viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, h("title", { id: 'searchcraft-title' }, "Searchcraft Search Icon Light"), 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' })));
436
+ case 'search-dark':
437
+ return (h("svg", { width: width, height: height, viewBox: '0 0 18 18', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, h("title", { id: 'searchcraft-title' }, "Searchcraft Search Icon Dark"), 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' })));
438
+ case 'error-light':
439
+ return (h("svg", { width: width, height: height, viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, h("title", { id: 'searchcraft-title' }, "Searchcraft Error Search Icon Light"), 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' })));
440
+ case 'error-dark':
441
+ return (h("svg", { width: width, height: height, viewBox: '0 0 18 18', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, h("title", { id: 'searchcraft-title' }, "Searchcraft Error Search Icon Dark"), 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' })));
442
+ default:
443
+ return null;
444
+ }
445
+ }
446
+ };
447
+
448
+ 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)}}";
449
+ const SearchcraftSpinnerDarkStyle0 = searchcraftSpinnerDarkModuleCss;
450
+
451
+ const SearchcraftSpinnerDark = class {
452
+ constructor(hostRef) {
453
+ registerInstance(this, hostRef);
454
+ }
455
+ render() {
456
+ return (h("div", { key: '76685b09609a42adbff41ee43ecb4b4e161d4598', class: 'spinnerContainer' }, h("div", { key: '7e7a01010f21e5b95358b7385d41a45e90a5b3bd', class: 'spinnerDark' })));
457
+ }
458
+ };
459
+ SearchcraftSpinnerDark.style = SearchcraftSpinnerDarkStyle0;
460
+
461
+ 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)}}";
462
+ const SearchcraftSpinnerLightStyle0 = searchcraftSpinnerLightModuleCss;
463
+
464
+ const SearchcraftSpinnerLight = class {
465
+ constructor(hostRef) {
466
+ registerInstance(this, hostRef);
467
+ }
468
+ render() {
469
+ return (h("div", { key: '7bd4d997ef43d35ee60033a27b6bc46c6d693c33', class: 'spinnerContainer' }, h("div", { key: 'f8cc9948aa6a264719ffc54d25a10af27dc0f802', class: 'spinnerLight' })));
470
+ }
471
+ };
472
+ SearchcraftSpinnerLight.style = SearchcraftSpinnerLightStyle0;
473
+
474
+ export { SearchcraftAutoSearchForm as searchcraft_auto_search_form, SearchcraftBaseSearchResult as searchcraft_base_search_result, SearchcraftBaseSearchResults as searchcraft_base_search_results, SearchcraftClearIconSet as searchcraft_clear_icon_set, SearchcraftClearInputButton as searchcraft_clear_input_button, SearchcraftErrorMessage as searchcraft_error_message, SearchcraftInput as searchcraft_input, SearchcraftInputCaption as searchcraft_input_caption, SearchcraftInputIcon as searchcraft_input_icon, SearchcraftInputLabel as searchcraft_input_label, SearchcraftSearchIconSet as searchcraft_search_icon_set, SearchcraftSpinnerDark as searchcraft_spinner_dark, SearchcraftSpinnerLight as searchcraft_spinner_light };
475
+
476
+ //# sourceMappingURL=searchcraft-auto-search-form_13.entry.js.map