@appbaseio/reactivesearch-vue 2.0.0-alpha.4 → 3.0.0-alpha.1

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 (109) hide show
  1. package/README.md +9 -9
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js +21316 -29369
  3. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -19
  5. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  6. package/dist/cjs/Button-ad042719.js +59 -0
  7. package/dist/cjs/Card-f5ab024a.js +27 -0
  8. package/dist/cjs/{ComponentWrapper-ad3dad02.js → ComponentWrapper-611cf7f9.js} +44 -58
  9. package/dist/cjs/Container-29f049b2.js +12 -0
  10. package/dist/cjs/DropDown-dc184468.js +700 -0
  11. package/dist/cjs/DynamicRangeSlider.js +106 -157
  12. package/dist/cjs/Flex-d5675ea6.js +48 -0
  13. package/dist/cjs/FormControlList-fadd792f.js +42 -0
  14. package/dist/cjs/Input-088dfcb4.js +74 -0
  15. package/dist/cjs/ListItem-d57d648d.js +42 -0
  16. package/dist/cjs/MultiDropdownList.js +124 -240
  17. package/dist/cjs/MultiList.js +124 -262
  18. package/dist/cjs/MultiRange.js +87 -133
  19. package/dist/cjs/{Pagination-71e85fa9.js → Pagination-b5ddc906.js} +70 -83
  20. package/dist/cjs/PreferencesConsumer-22d1b49f.js +73 -0
  21. package/dist/cjs/RangeInput.js +163 -171
  22. package/dist/cjs/RangeSlider.js +81 -109
  23. package/dist/cjs/ReactiveBase.js +139 -156
  24. package/dist/cjs/ReactiveComponent-a6108189.js +2184 -0
  25. package/dist/cjs/ReactiveComponent.js +46 -340
  26. package/dist/cjs/ReactiveGoogleMap.js +451 -660
  27. package/dist/cjs/ReactiveList.js +180 -305
  28. package/dist/cjs/ResultCard.js +36 -36
  29. package/dist/cjs/ResultList.js +48 -56
  30. package/dist/cjs/SelectedFilters.js +62 -69
  31. package/dist/cjs/SingleDropdownList.js +117 -177
  32. package/dist/cjs/SingleList.js +122 -206
  33. package/dist/cjs/SingleRange.js +78 -105
  34. package/dist/cjs/StateProvider.js +35 -38
  35. package/dist/cjs/Title-8802a218.js +12 -0
  36. package/dist/cjs/ToggleButton.js +72 -119
  37. package/dist/cjs/{_rollupPluginBabelHelpers-c705cbe6.js → _rollupPluginBabelHelpers-f8b843f8.js} +0 -15
  38. package/dist/cjs/{index-6a167fe0.js → index-d8d8f291.js} +38 -108
  39. package/dist/cjs/index.js +44 -41
  40. package/dist/cjs/initReactivesearch.js +63 -150
  41. package/dist/cjs/install.js +47 -43
  42. package/dist/cjs/ssr-6c8a72e1.js +66 -0
  43. package/dist/cjs/{utils-d6a52588.js → utils-83fd01e9.js} +7 -16
  44. package/dist/cjs/version.js +1 -1
  45. package/dist/cjs/{vueTypes-727b7c63.js → vueTypes-1bf00978.js} +8 -19
  46. package/dist/es/Button-474510e3.js +53 -0
  47. package/dist/es/{Card-450683f1.js → Card-38cbe652.js} +3 -3
  48. package/dist/es/{ComponentWrapper-424e86fd.js → ComponentWrapper-3dfe6931.js} +44 -58
  49. package/dist/es/{Container-ba826e96.js → Container-d00219f7.js} +2 -2
  50. package/dist/es/DropDown-029ffd42.js +690 -0
  51. package/dist/es/DynamicRangeSlider.js +106 -157
  52. package/dist/es/Flex-a08e22d7.js +46 -0
  53. package/dist/es/FormControlList-fe6eaee4.js +38 -0
  54. package/dist/es/Input-ad474a55.js +69 -0
  55. package/dist/es/{ListItem-cad14c5e.js → ListItem-16756c02.js} +7 -8
  56. package/dist/es/MultiDropdownList.js +124 -240
  57. package/dist/es/MultiList.js +124 -262
  58. package/dist/es/MultiRange.js +87 -133
  59. package/dist/es/{Pagination-784bf143.js → Pagination-72bd1d9e.js} +70 -83
  60. package/dist/es/PreferencesConsumer-24e88f3b.js +71 -0
  61. package/dist/es/RangeInput.js +163 -170
  62. package/dist/es/RangeSlider.js +81 -109
  63. package/dist/es/ReactiveBase.js +138 -154
  64. package/dist/es/ReactiveComponent-0a97eb1e.js +2178 -0
  65. package/dist/es/ReactiveComponent.js +42 -337
  66. package/dist/es/ReactiveGoogleMap.js +446 -654
  67. package/dist/es/ReactiveList.js +178 -302
  68. package/dist/es/ResultCard.js +36 -36
  69. package/dist/es/ResultList.js +48 -56
  70. package/dist/es/SelectedFilters.js +62 -69
  71. package/dist/es/SingleDropdownList.js +117 -177
  72. package/dist/es/SingleList.js +122 -206
  73. package/dist/es/SingleRange.js +78 -105
  74. package/dist/es/StateProvider.js +36 -39
  75. package/dist/es/{Title-3342664a.js → Title-863dfa42.js} +2 -2
  76. package/dist/es/ToggleButton.js +72 -119
  77. package/dist/es/{_rollupPluginBabelHelpers-76660dab.js → _rollupPluginBabelHelpers-ded08042.js} +0 -15
  78. package/dist/es/{index-7788a843.js → index-4520a598.js} +39 -107
  79. package/dist/es/index.js +30 -32
  80. package/dist/es/initReactivesearch.js +63 -150
  81. package/dist/es/install.js +49 -41
  82. package/dist/es/{ssr-b2c0b401.js → ssr-584c278d.js} +37 -8
  83. package/dist/es/{utils-9e68acee.js → utils-9e5a16a1.js} +7 -16
  84. package/dist/es/version.js +1 -1
  85. package/dist/es/{vueTypes-b8146772.js → vueTypes-f1923c72.js} +8 -19
  86. package/package.json +10 -9
  87. package/dist/cjs/Button-446f819e.js +0 -68
  88. package/dist/cjs/CancelSvg-9f258f4f.js +0 -449
  89. package/dist/cjs/Card-642547a8.js +0 -30
  90. package/dist/cjs/Container-daf30918.js +0 -15
  91. package/dist/cjs/DataSearch-aa04dc6e.js +0 -2352
  92. package/dist/cjs/DataSearch.js +0 -30
  93. package/dist/cjs/DropDown-c479bbb0.js +0 -328
  94. package/dist/cjs/Flex-aa517a13.js +0 -52
  95. package/dist/cjs/FormControlList-c195a592.js +0 -47
  96. package/dist/cjs/Input-e6603a7e.js +0 -79
  97. package/dist/cjs/ListItem-8c9e0d68.js +0 -46
  98. package/dist/cjs/Title-1de7d0f4.js +0 -15
  99. package/dist/cjs/install-b97dbac4.js +0 -1409
  100. package/dist/cjs/ssr-3027b848.js +0 -39
  101. package/dist/es/Button-d8bc15ea.js +0 -59
  102. package/dist/es/CancelSvg-4cfae5fd.js +0 -440
  103. package/dist/es/DataSearch-b86a6675.js +0 -2337
  104. package/dist/es/DataSearch.js +0 -22
  105. package/dist/es/DropDown-05a644a5.js +0 -322
  106. package/dist/es/Flex-1f0795c3.js +0 -47
  107. package/dist/es/FormControlList-c22d64f6.js +0 -40
  108. package/dist/es/Input-7a2a9fac.js +0 -71
  109. package/dist/es/install-ac8a1edb.js +0 -1402
@@ -0,0 +1,2178 @@
1
+ import { helper, Actions, causes } from '@appbaseio/reactivecore';
2
+ import { SEARCH_COMPONENTS_MODES, componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
3
+ import _transformOn from '@vue/babel-helper-vue-transform-on';
4
+ import { _ as _taggedTemplateLiteralLoose, a as _extends, b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-ded08042.js';
5
+ import { createVNode, createTextVNode, defineComponent, isVNode, mergeProps, h } from 'vue';
6
+ import VueTypes from 'vue-types';
7
+ import { getQueryOptions, suggestionTypes } from '@appbaseio/reactivecore/lib/utils/helper';
8
+ import { styled, createGlobalStyle } from '@appbaseio/vue-emotion';
9
+ import { css, cx } from 'emotion';
10
+ import { B as Button } from './Button-474510e3.js';
11
+ import { t as types } from './vueTypes-f1923c72.js';
12
+ import { RLConnected } from './ReactiveList.js';
13
+ import { g as getComponent, h as hasCustomRenderer, f as decodeHtml, i as isQueryIdentical, u as updateDefaultQuery, j as updateCustomQuery, a as isFunction, k as isEmpty, p as parseFocusShortcuts, l as extractModifierKeysFromFocusShortcuts, c as connect } from './index-4520a598.js';
14
+ import { C as ComponentWrapper } from './ComponentWrapper-3dfe6931.js';
15
+ import { P as PreferencesConsumer } from './PreferencesConsumer-24e88f3b.js';
16
+ import { T as Title } from './Title-863dfa42.js';
17
+ import { F as Flex } from './Flex-a08e22d7.js';
18
+ import hotkeys from 'hotkeys-js';
19
+ import { I as IconWrapper, C as CancelSvg, a as IconGroup, D as Downshift, b as InputWrapper } from './DropDown-029ffd42.js';
20
+ import { n as noSuggestions, s as suggestionsContainer, I as Input, a as suggestions } from './Input-ad474a55.js';
21
+ import { C as Container } from './Container-d00219f7.js';
22
+ import Highlight from 'vue-highlight-words';
23
+ import { ListConnected as ListConnected$3 } from './SingleList.js';
24
+ import { ListConnected as ListConnected$2 } from './MultiList.js';
25
+ import { ListConnected as ListConnected$1 } from './SingleDropdownList.js';
26
+ import { ListConnected } from './MultiDropdownList.js';
27
+ import { TBConnected } from './ToggleButton.js';
28
+ import { RangeConnected as RangeConnected$4 } from './DynamicRangeSlider.js';
29
+ import { RangeConnected as RangeConnected$3 } from './SingleRange.js';
30
+ import { RangeConnected as RangeConnected$2 } from './MultiRange.js';
31
+ import { RangeConnected as RangeConnected$1 } from './RangeSlider.js';
32
+ import { RangeConnected } from './RangeInput.js';
33
+
34
+ var _templateObject;
35
+ var InputGroup = styled('div')(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: stretch;\n width: 100%;\n"])));
36
+ InputGroup.defaultProps = {
37
+ className: 'input-group'
38
+ };
39
+
40
+ var _templateObject$1;
41
+ var InputAddon = styled('span')(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: #fafafa;\n border: 1px solid #ccc;\n border-radius: 2px;\n color: rgba(0, 0, 0, 0.85);\n font-size: 14px;\n font-weight: 400;\n padding: 0 11px;\n position: relative;\n transition: all 0.3s;\n box-sizing: border-box;\n overflow: hidden;\n\n &:first-of-type {\n border-right: none;\n }\n &:last-of-type {\n border-left: none;\n }\n"])));
42
+ InputAddon.defaultProps = {
43
+ className: 'input-addon'
44
+ };
45
+
46
+ var getClassName = helper.getClassName;
47
+ var SuggestionWrapper = {
48
+ name: 'SuggestionWrapper',
49
+ props: {
50
+ innerClassName: types.string,
51
+ themePreset: types.themePreset,
52
+ innerClass: types.style
53
+ },
54
+ render: function render() {
55
+ var _this$$props = this.$props,
56
+ themePreset = _this$$props.themePreset,
57
+ innerClass = _this$$props.innerClass,
58
+ innerClassName = _this$$props.innerClassName;
59
+ return createVNode("div", {
60
+ "class": noSuggestions(themePreset) + " " + getClassName(innerClass, innerClassName || '')
61
+ }, [createVNode("li", null, [this.$slots["default"]()])]);
62
+ }
63
+ };
64
+
65
+ var _templateObject$2;
66
+ var highlightStyle = {
67
+ fontWeight: 600,
68
+ padding: 0,
69
+ backgroundColor: 'transparent',
70
+ color: 'inherit'
71
+ };
72
+ var PredictiveSuggestion = styled('span')(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteralLoose(["\n\t.highlight {\n\t\tbackground: transparent;\n\t\tcolor: inherit;\n\t\tfont-weight: 600;\n\t\tpadding: 0;\n\t}\n"])));
73
+ var SuggestionItem = {
74
+ name: 'SuggestionItem',
75
+ props: {
76
+ currentValue: types.string,
77
+ suggestion: types.any
78
+ },
79
+ render: function render() {
80
+ var _this = this;
81
+ var _this$suggestion = this.suggestion,
82
+ label = _this$suggestion.label,
83
+ value = _this$suggestion.value,
84
+ title = _this$suggestion.title,
85
+ description = _this$suggestion.description,
86
+ image = _this$suggestion.image,
87
+ isPredictiveSuggestion = _this$suggestion.isPredictiveSuggestion,
88
+ _suggestion_type = _this$suggestion._suggestion_type,
89
+ _category = _this$suggestion._category;
90
+ if (label) {
91
+ // label has highest precedence
92
+ return typeof label === 'string' ? createVNode("div", {
93
+ "class": "trim"
94
+ }, [(_category ? false : isPredictiveSuggestion
95
+ // eslint-disable-next-line
96
+ || !!_suggestion_type) ? createVNode(PredictiveSuggestion, {
97
+ "innerHTML": label
98
+ }, null) : createVNode(Highlight, {
99
+ "searchWords": _category ? [_category] : this.currentValue.split(' '),
100
+ "textToHighlight": label,
101
+ "autoEscape": true,
102
+ "highlightStyle": highlightStyle
103
+ }, null)]) : label;
104
+ }
105
+ if (title || image || description) {
106
+ return createVNode(Flex, {
107
+ "alignItems": "center",
108
+ "css": {
109
+ width: '100%'
110
+ }
111
+ }, {
112
+ "default": function _default() {
113
+ return [image && createVNode("div", {
114
+ "css": {
115
+ margin: 'auto',
116
+ marginRight: 10
117
+ }
118
+ }, [createVNode("img", {
119
+ "src": image,
120
+ "alt": " ",
121
+ "height": "50px",
122
+ "width": "50px",
123
+ "css": {
124
+ objectFit: 'contain'
125
+ }
126
+ }, null)]), createVNode(Flex, {
127
+ "direction": "column",
128
+ "css": {
129
+ width: image ? 'calc(100% - 60px)' : '100%'
130
+ }
131
+ }, {
132
+ "default": function _default() {
133
+ return [title && createVNode("div", {
134
+ "class": "trim"
135
+ }, [createVNode(Highlight, {
136
+ "searchWords": _this.currentValue.split(' '),
137
+ "textToHighlight": title,
138
+ "highlightStyle": highlightStyle,
139
+ "class": css({
140
+ fontSize: '1rem'
141
+ })
142
+ }, null)]), description && createVNode("div", {
143
+ "class": cx('trim', css({
144
+ marginTop: 3
145
+ }))
146
+ }, [createVNode(Highlight, {
147
+ "searchWords": _this.currentValue.split(' '),
148
+ "textToHighlight": description,
149
+ "highlightStyle": highlightStyle
150
+ }, null)])];
151
+ }
152
+ })];
153
+ }
154
+ });
155
+ }
156
+ return value;
157
+ }
158
+ };
159
+
160
+ var SearchSvg = {
161
+ name: 'SearchSvg',
162
+ props: ['styles'],
163
+ render: function render() {
164
+ return createVNode("svg", {
165
+ "alt": "Search",
166
+ "class": "search-icon",
167
+ "height": "12",
168
+ "xmlns": "http://www.w3.org/2000/svg",
169
+ "viewBox": "0 0 15 15",
170
+ "style": _extends({
171
+ transform: 'scale(1.35)',
172
+ position: 'relative'
173
+ }, this.$props.styles ? this.$props.styles : {})
174
+ }, [createVNode("title", null, [createTextVNode("Search")]), createVNode("path", {
175
+ "d": 'M6.02945,10.20327a4.17382,4.17382,0,1,1,4.17382-4.17382A4.15609,4.15609,0,0,1,6.02945,10.20327Zm9.69195,4.2199L10.8989,9.59979A5.88021,5.88021,0,0,0,12.058,6.02856,6.00467,6.00467,0,1,0,9.59979,10.8989l4.82338,4.82338a.89729.89729,0,0,0,1.29912,0,.89749.89749,0,0,0-.00087-1.29909Z'
176
+ }, null)]);
177
+ }
178
+ };
179
+
180
+ var _templateObject$3;
181
+
182
+ // eslint-disable-next-line
183
+ createGlobalStyle(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteralLoose(["\n\t#el_TvxDfTAtKp {\n\t\tstroke: none;\n\t\tstroke-width: 1;\n\t\tfill: none;\n\t}\n\t#el_D93PK3GbmJ {\n\t\t-webkit-transform: translate(163px, 131px);\n\t\ttransform: translate(163px, 131px);\n\t\tfill: #d8d8d8;\n\t}\n"])));
184
+ var MicSvg = {
185
+ name: 'MicSvg',
186
+ props: ['className'],
187
+ render: function render() {
188
+ return createVNode("svg", {
189
+ "viewBox": "0 0 480 480",
190
+ "xmlns": "http://www.w3.org/2000/svg",
191
+ "id": "el_xS0FRzQjJ",
192
+ "width": 28,
193
+ "height": 28,
194
+ "className": this.$props.className,
195
+ "style": {
196
+ transform: 'scale(1.5)'
197
+ }
198
+ }, [createVNode("g", {
199
+ "id": "el_TvxDfTAtKp",
200
+ "fillRule": "evenodd"
201
+ }, [createVNode("g", {
202
+ "id": "el_D93PK3GbmJ",
203
+ "fillRule": "nonzero",
204
+ "style": {
205
+ fill: '#595959'
206
+ }
207
+ }, [createVNode("path", {
208
+ "d": "M142.731204,111 C137.280427,111 132.719573,114.852 131.82965,120.095 C127.268796,145.24 104.464526,164.5 76.9881611,164.5 C49.5117965,164.5 26.7075263,145.24 22.1466723,120.095 C21.2567496,114.852 16.6958955,111 11.2451187,111 C4.45945784,111 -0.880078594,116.778 0.121084488,123.198 C5.57186127,155.298 32.2695435,180.443 65.8641269,185.044 L65.8641269,207.3 C65.8641269,213.185 70.8699423,218 76.9881611,218 C83.10638,218 88.1121954,213.185 88.1121954,207.3 L88.1121954,185.044 C121.706779,180.443 148.404461,155.298 153.855238,123.198 C154.967641,116.778 149.516864,111 142.731204,111 Z",
209
+ "id": "el_uly3EwA2O3"
210
+ }, null), createVNode("path", {
211
+ "d": "M76.9864699,147.789474 C98.090352,147.789474 115.126016,131.286316 115.126016,110.842105 L115.126016,36.9473684 C115.126016,16.5031579 98.090352,-2.84217094e-14 76.9864699,-2.84217094e-14 C55.8825877,-2.84217094e-14 38.8469239,16.5031579 38.8469239,36.9473684 L38.8469239,110.842105 C38.8469239,131.286316 55.8825877,147.789474 76.9864699,147.789474 Z",
212
+ "id": "el_tnDbR4ytu4"
213
+ }, null)])])]);
214
+ }
215
+ };
216
+
217
+ var _templateObject$4;
218
+
219
+ // eslint-disable-next-line
220
+ createGlobalStyle(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteralLoose(["\n\t#el_X81iT9kZYo {\n\t\tstroke: none;\n\t\tstroke-width: 1;\n\t\tfill: none;\n\t}\n\t#el_gMpyalCphp {\n\t\t-webkit-transform: translate(163px, 131px);\n\t\ttransform: translate(163px, 131px);\n\t}\n\t#el_c7H-3u-D4l {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_qhFcdAAFwo {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_M8X8g37WOI {\n\t\tstroke: #e83137;\n\t\tstroke-width: 21;\n\t}\n"])));
221
+ var MuteSvg = {
222
+ name: 'MuteSvg',
223
+ props: ['className'],
224
+ render: function render() {
225
+ return createVNode("svg", {
226
+ "style": {
227
+ transform: 'scale(1.5)'
228
+ },
229
+ "viewBox": "0 0 480 480",
230
+ "xmlns": "http://www.w3.org/2000/svg",
231
+ "id": "el_D1rEpH2zj",
232
+ "width": 28,
233
+ "height": 28,
234
+ "className": this.$props.className
235
+ }, [createVNode("g", {
236
+ "id": "el_X81iT9kZYo",
237
+ "fillRule": "evenodd"
238
+ }, [createVNode("g", {
239
+ "id": "el_gMpyalCphp"
240
+ }, [createVNode("path", {
241
+ "d": "M142.731204,111 C137.280427,111 132.719573,114.852 131.82965,120.095 C127.268796,145.24 104.464526,164.5 76.9881611,164.5 C49.5117965,164.5 26.7075263,145.24 22.1466723,120.095 C21.2567496,114.852 16.6958955,111 11.2451187,111 C4.45945784,111 -0.880078594,116.778 0.121084488,123.198 C5.57186127,155.298 32.2695435,180.443 65.8641269,185.044 L65.8641269,207.3 C65.8641269,213.185 70.8699423,218 76.9881611,218 C83.10638,218 88.1121954,213.185 88.1121954,207.3 L88.1121954,185.044 C121.706779,180.443 148.404461,155.298 153.855238,123.198 C154.967641,116.778 149.516864,111 142.731204,111 Z",
242
+ "id": "el_c7H-3u-D4l",
243
+ "fillRule": "nonzero",
244
+ "style": {
245
+ fill: '#595959'
246
+ }
247
+ }, null), createVNode("path", {
248
+ "d": "M76.9864699,147.789474 C98.090352,147.789474 115.126016,131.286316 115.126016,110.842105 L115.126016,36.9473684 C115.126016,16.5031579 98.090352,-2.84217094e-14 76.9864699,-2.84217094e-14 C55.8825877,-2.84217094e-14 38.8469239,16.5031579 38.8469239,36.9473684 L38.8469239,110.842105 C38.8469239,131.286316 55.8825877,147.789474 76.9864699,147.789474 Z",
249
+ "id": "el_qhFcdAAFwo",
250
+ "fillRule": "nonzero",
251
+ "style": {
252
+ fill: '#595959'
253
+ }
254
+ }, null), createVNode("path", {
255
+ "d": "M11.5,206.5 L142.5,12.5",
256
+ "id": "el_M8X8g37WOI",
257
+ "strokeLinecap": "round",
258
+ "strokeLinejoin": "round"
259
+ }, null)])])]);
260
+ }
261
+ };
262
+
263
+ var _templateObject$5;
264
+
265
+ // eslint-disable-next-line
266
+ createGlobalStyle(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteralLoose(["\n\t@-webkit-keyframes kf_el_6WKby7wXqV_an_qqO-rxbNc {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t13.89% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_6WKby7wXqV_an_qqO-rxbNc {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t13.89% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_Wi-my975tM_an_XhXP1epXB {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t27.78% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_Wi-my975tM_an_XhXP1epXB {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t27.78% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_DkfFFTaFxy8_an_T2XxzvIaA {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t41.67% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_DkfFFTaFxy8_an_T2XxzvIaA {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t41.67% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_34IgwiMB5rf_an_TPom3H2LI {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t55.56% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_34IgwiMB5rf_an_TPom3H2LI {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t55.56% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_DeebuCsPTGA_an_aYTRBE7Na {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t69.44% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_DeebuCsPTGA_an_aYTRBE7Na {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t69.44% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_ZOjjrPTvyrv_an_l_BjBNzXw {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t83.33% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_ZOjjrPTvyrv_an_l_BjBNzXw {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t83.33% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_2FATegVmf0K_an_wLg4ofuFx {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t97.22% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_2FATegVmf0K_an_wLg4ofuFx {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t97.22% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t#el_hiibMG0x- * {\n\t\t-webkit-animation-duration: 1.2s;\n\t\tanimation-duration: 1.2s;\n\t\t-webkit-animation-iteration-count: infinite;\n\t\tanimation-iteration-count: infinite;\n\t\t-webkit-animation-timing-function: cubic-bezier(0, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0, 0, 1, 1);\n\t}\n\t#el_QJeJ_2CDw5 {\n\t\tstroke: none;\n\t\tstroke-width: 1;\n\t\tfill: none;\n\t}\n\t#el_UYYCfubTRf {\n\t\t-webkit-transform: translate(163px, 123px);\n\t\ttransform: translate(163px, 123px);\n\t}\n\t#el_uzZNtK32Zi {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_EYKQ2N9Kgy {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_6SDP2LAgKC {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t}\n\t#el_-Vm65Ltfy7 {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_q04iZcSim4 {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_6WKby7wXqV {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_6WKby7wXqV_an_qqO-rxbNc;\n\t\tanimation-name: kf_el_6WKby7wXqV_an_qqO-rxbNc;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_9bggsfQOtU {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_NKxqi9eIym {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_Wi-my975tM {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_Wi-my975tM_an_XhXP1epXB;\n\t\tanimation-name: kf_el_Wi-my975tM_an_XhXP1epXB;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_zclQ34fvf7 {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_1OsvRT8HkeZ {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_DkfFFTaFxy8 {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_DkfFFTaFxy8_an_T2XxzvIaA;\n\t\tanimation-name: kf_el_DkfFFTaFxy8_an_T2XxzvIaA;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_aa9sjx4H0vA {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_tea114vWg0J {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_34IgwiMB5rf {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_34IgwiMB5rf_an_TPom3H2LI;\n\t\tanimation-name: kf_el_34IgwiMB5rf_an_TPom3H2LI;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_z5u6RAFhx7d {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_7nfuWmA5Uhy {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_DeebuCsPTGA {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_DeebuCsPTGA_an_aYTRBE7Na;\n\t\tanimation-name: kf_el_DeebuCsPTGA_an_aYTRBE7Na;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el__ZcqlS20zcw {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_8DnEQnD7VWV {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_ZOjjrPTvyrv {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_ZOjjrPTvyrv_an_l_BjBNzXw;\n\t\tanimation-name: kf_el_ZOjjrPTvyrv_an_l_BjBNzXw;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_FYYKCI_u24e {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_XZty4MnTp5Y {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_2FATegVmf0K {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_2FATegVmf0K_an_wLg4ofuFx;\n\t\tanimation-name: kf_el_2FATegVmf0K_an_wLg4ofuFx;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_RMT1KUfbdF8 {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_RgLcovvFiO1 {\n\t\tfill: #d8d8d8;\n\t}\n"])));
267
+ var ListenSvg = {
268
+ name: 'ListenSvg',
269
+ props: ['className'],
270
+ render: function render() {
271
+ return createVNode("svg", {
272
+ "viewBox": "0 0 480 480",
273
+ "xmlns": "http://www.w3.org/2000/svg",
274
+ "xmlnsXlink": "http://www.w3.org/1999/xlink",
275
+ "id": "el_hiibMG0x-",
276
+ "width": 28,
277
+ "height": 29,
278
+ "className": this.$props.className,
279
+ "style": {
280
+ transform: 'scale(1.5)'
281
+ }
282
+ }, [createVNode("defs", null, [createVNode("path", {
283
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
284
+ "id": "path-1"
285
+ }, null), createVNode("path", {
286
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
287
+ "id": "path-3"
288
+ }, null), createVNode("path", {
289
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
290
+ "id": "path-5"
291
+ }, null), createVNode("path", {
292
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
293
+ "id": "path-7"
294
+ }, null), createVNode("path", {
295
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
296
+ "id": "path-9"
297
+ }, null), createVNode("path", {
298
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
299
+ "id": "path-11"
300
+ }, null), createVNode("path", {
301
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
302
+ "id": "path-13"
303
+ }, null), createVNode("path", {
304
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
305
+ "id": "path-15"
306
+ }, null)]), createVNode("g", {
307
+ "id": "el_QJeJ_2CDw5",
308
+ "fillRule": "evenodd"
309
+ }, [createVNode("g", {
310
+ "id": "el_UYYCfubTRf"
311
+ }, [createVNode("path", {
312
+ "d": "M142.731204,111 C137.280427,111 132.719573,114.852 131.82965,120.095 C127.268796,145.24 104.464526,164.5 76.9881611,164.5 C49.5117965,164.5 26.7075263,145.24 22.1466723,120.095 C21.2567496,114.852 16.6958955,111 11.2451187,111 C4.45945784,111 -0.880078594,116.778 0.121084488,123.198 C5.57186127,155.298 32.2695435,180.443 65.8641269,185.044 L65.8641269,207.3 C65.8641269,213.185 70.8699423,218 76.9881611,218 C83.10638,218 88.1121954,213.185 88.1121954,207.3 L88.1121954,185.044 C121.706779,180.443 148.404461,155.298 153.855238,123.198 C154.967641,116.778 149.516864,111 142.731204,111 Z",
313
+ "id": "el_uzZNtK32Zi",
314
+ "fillRule": "nonzero",
315
+ "style": {
316
+ fill: '#0B6AFF'
317
+ }
318
+ }, null), createVNode("path", {
319
+ "d": "M76.9864699,147.789474 C98.090352,147.789474 115.126016,131.286316 115.126016,110.842105 L115.126016,36.9473684 C115.126016,16.5031579 98.090352,0 76.9864699,0 C55.8825877,0 38.8469239,16.5031579 38.8469239,36.9473684 L38.8469239,110.842105 C38.8469239,131.286316 55.8825877,147.789474 76.9864699,147.789474 Z",
320
+ "id": "el_EYKQ2N9Kgy",
321
+ "fillRule": "nonzero"
322
+ }, null), createVNode("g", {
323
+ "id": "el_6SDP2LAgKC"
324
+ }, [createVNode("mask", {
325
+ "id": "mask-2",
326
+ "fill": "#fff"
327
+ }, [createVNode("use", {
328
+ "xlink:href": "#path-1"
329
+ }, null)]), createVNode("path", {
330
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
331
+ "id": "el_-Vm65Ltfy7",
332
+ "fillRule": "nonzero",
333
+ "mask": "url(#mask-2)"
334
+ }, null), createVNode("rect", {
335
+ "id": "el_q04iZcSim4",
336
+ "mask": "url(#mask-2)",
337
+ "x": "0.279",
338
+ "width": "77",
339
+ "height": "130"
340
+ }, null)]), createVNode("g", {
341
+ "id": "el_6WKby7wXqV"
342
+ }, [createVNode("mask", {
343
+ "id": "mask-4",
344
+ "fill": "#fff"
345
+ }, [createVNode("use", {
346
+ "xlink:href": "#path-3"
347
+ }, null)]), createVNode("path", {
348
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
349
+ "id": "el_9bggsfQOtU",
350
+ "fillRule": "nonzero",
351
+ "mask": "url(#mask-4)"
352
+ }, null), createVNode("rect", {
353
+ "id": "el_NKxqi9eIym",
354
+ "mask": "url(#mask-4)",
355
+ "x": "0.279",
356
+ "width": "77",
357
+ "height": "115"
358
+ }, null)]), createVNode("g", {
359
+ "id": "el_Wi-my975tM"
360
+ }, [createVNode("mask", {
361
+ "id": "mask-6",
362
+ "fill": "#fff"
363
+ }, [createVNode("use", {
364
+ "xlink:href": "#path-5"
365
+ }, null)]), createVNode("path", {
366
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
367
+ "id": "el_zclQ34fvf7",
368
+ "fillRule": "nonzero",
369
+ "mask": "url(#mask-6)"
370
+ }, null), createVNode("rect", {
371
+ "id": "el_1OsvRT8HkeZ",
372
+ "mask": "url(#mask-6)",
373
+ "x": "0.279",
374
+ "width": "77",
375
+ "height": "100"
376
+ }, null)]), createVNode("g", {
377
+ "id": "el_DkfFFTaFxy8"
378
+ }, [createVNode("mask", {
379
+ "id": "mask-8",
380
+ "fill": "#fff"
381
+ }, [createVNode("use", {
382
+ "xlink:href": "#path-7"
383
+ }, null)]), createVNode("path", {
384
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
385
+ "id": "el_aa9sjx4H0vA",
386
+ "fillRule": "nonzero",
387
+ "mask": "url(#mask-8)"
388
+ }, null), createVNode("rect", {
389
+ "id": "el_tea114vWg0J",
390
+ "mask": "url(#mask-8)",
391
+ "x": "0.279",
392
+ "width": "77",
393
+ "height": "85"
394
+ }, null)]), createVNode("g", {
395
+ "id": "el_34IgwiMB5rf"
396
+ }, [createVNode("mask", {
397
+ "id": "mask-10",
398
+ "fill": "#fff"
399
+ }, [createVNode("use", {
400
+ "xlink:href": "#path-9"
401
+ }, null)]), createVNode("path", {
402
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
403
+ "id": "el_z5u6RAFhx7d",
404
+ "fillRule": "nonzero",
405
+ "mask": "url(#mask-10)"
406
+ }, null), createVNode("rect", {
407
+ "id": "el_7nfuWmA5Uhy",
408
+ "mask": "url(#mask-10)",
409
+ "x": "0.279",
410
+ "width": "77",
411
+ "height": "70"
412
+ }, null)]), createVNode("g", {
413
+ "id": "el_DeebuCsPTGA"
414
+ }, [createVNode("mask", {
415
+ "id": "mask-12",
416
+ "fill": "#fff"
417
+ }, [createVNode("use", {
418
+ "xlink:href": "#path-11"
419
+ }, null)]), createVNode("path", {
420
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
421
+ "id": "el__ZcqlS20zcw",
422
+ "fillRule": "nonzero",
423
+ "mask": "url(#mask-12)"
424
+ }, null), createVNode("rect", {
425
+ "id": "el_8DnEQnD7VWV",
426
+ "mask": "url(#mask-12)",
427
+ "x": "0.279",
428
+ "width": "77",
429
+ "height": "55"
430
+ }, null)]), createVNode("g", {
431
+ "id": "el_ZOjjrPTvyrv"
432
+ }, [createVNode("mask", {
433
+ "id": "mask-14",
434
+ "fill": "#fff"
435
+ }, [createVNode("use", {
436
+ "xlink:href": "#path-13"
437
+ }, null)]), createVNode("path", {
438
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
439
+ "id": "el_FYYKCI_u24e",
440
+ "fillRule": "nonzero",
441
+ "mask": "url(#mask-14)"
442
+ }, null), createVNode("rect", {
443
+ "id": "el_XZty4MnTp5Y",
444
+ "mask": "url(#mask-14)",
445
+ "x": "0.279",
446
+ "width": "77",
447
+ "height": "40"
448
+ }, null)]), createVNode("g", {
449
+ "id": "el_2FATegVmf0K"
450
+ }, [createVNode("mask", {
451
+ "id": "mask-16",
452
+ "fill": "#fff"
453
+ }, [createVNode("use", {
454
+ "xlink:href": "#path-15"
455
+ }, null)]), createVNode("path", {
456
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
457
+ "id": "el_RMT1KUfbdF8",
458
+ "fillRule": "nonzero",
459
+ "mask": "url(#mask-16)"
460
+ }, null), createVNode("rect", {
461
+ "id": "el_RgLcovvFiO1",
462
+ "mask": "url(#mask-16)",
463
+ "x": "0.279",
464
+ "width": "77",
465
+ "height": "25"
466
+ }, null)])])])]);
467
+ }
468
+ };
469
+
470
+ var STATUS = {
471
+ inactive: 'INACTIVE',
472
+ stopped: 'STOPPED',
473
+ active: 'ACTIVE',
474
+ denied: 'DENIED'
475
+ };
476
+ var Mic = {
477
+ name: 'Mic',
478
+ props: {
479
+ children: types.title,
480
+ lang: VueTypes.string.def('en-US'),
481
+ iconPosition: VueTypes.string.def('left'),
482
+ handleResult: types.func,
483
+ onNoMatch: types.func,
484
+ onError: types.func,
485
+ getInstance: types.func,
486
+ render: types.func,
487
+ className: types.string,
488
+ applyClearStyle: VueTypes.bool,
489
+ showIcon: VueTypes.bool
490
+ },
491
+ methods: {
492
+ getComponent: function getComponent$1() {
493
+ var status = this.$data.status;
494
+ var data = {
495
+ handleClick: this.handleClick,
496
+ status: status
497
+ };
498
+ return getComponent(data, this);
499
+ },
500
+ stopMic: function stopMic() {
501
+ if (this.instance) {
502
+ this.status = STATUS.inactive;
503
+ this.instance.stop();
504
+ this.instance = null;
505
+ }
506
+ },
507
+ handleClick: function handleClick() {
508
+ var _this = this;
509
+ this.results = [];
510
+ if (window && window.SpeechRecognition) {
511
+ var status = this.$data.status;
512
+ if (status === STATUS.active) {
513
+ this.status = STATUS.inactive;
514
+ }
515
+ var _this$$props = this.$props,
516
+ handleResult = _this$$props.handleResult,
517
+ onNoMatch = _this$$props.onNoMatch,
518
+ onError = _this$$props.onError,
519
+ lang = _this$$props.lang,
520
+ getInstance = _this$$props.getInstance;
521
+ var _window = window,
522
+ SpeechRecognition = _window.SpeechRecognition;
523
+ if (this.instance && this.status !== STATUS.denied) {
524
+ this.status = STATUS.inactive;
525
+ this.instance.stop();
526
+ this.instance = null;
527
+ return;
528
+ }
529
+ this.instance = new SpeechRecognition();
530
+ this.instance.continuous = true;
531
+ this.instance.interimResults = true;
532
+ this.instance.lang = lang;
533
+ if (getInstance) {
534
+ getInstance(this.instance);
535
+ }
536
+ this.instance.start();
537
+ this.instance.onstart = function () {
538
+ _this.status = STATUS.active;
539
+ };
540
+ this.instance.onresult = function (_ref) {
541
+ var results = _ref.results,
542
+ timeStamp = _ref.timeStamp;
543
+ _this.stopMic();
544
+ if (handleResult) {
545
+ handleResult({
546
+ results: results,
547
+ timeStamp: timeStamp
548
+ });
549
+ }
550
+ _this.results.push({
551
+ results: results,
552
+ timeStamp: timeStamp
553
+ });
554
+ };
555
+ this.instance.onnomatch = function (e) {
556
+ return onNoMatch ? onNoMatch(e) : console.warn(e);
557
+ };
558
+ this.instance.onerror = function (e) {
559
+ if (e.error === 'no-speech' || e.error === 'audio-capture') {
560
+ _this.status = STATUS.inactive;
561
+ } else if (e.error === 'not-allowed') {
562
+ _this.status = STATUS.denied;
563
+ }
564
+ console.error(e);
565
+ if (onError) {
566
+ onError(e);
567
+ }
568
+ };
569
+
570
+ /* Below Two methods run when Continuous is False */
571
+ this.instance.onspeechend = function () {
572
+ _this.status = STATUS.inactive;
573
+ };
574
+ this.instance.onaudioend = function () {
575
+ _this.status = STATUS.inactive;
576
+ };
577
+ }
578
+ }
579
+ },
580
+ computed: {
581
+ hasCustomRenderer: function hasCustomRenderer$1() {
582
+ return hasCustomRenderer(this);
583
+ },
584
+ Icon: function Icon() {
585
+ var status = this.$data.status;
586
+ var className = this.$props.className;
587
+ switch (status) {
588
+ case STATUS.active:
589
+ return createVNode(ListenSvg, {
590
+ "className": className,
591
+ "nativeOnClick": this.handleClick
592
+ }, null);
593
+ case STATUS.stopped:
594
+ case STATUS.denied:
595
+ return createVNode(MuteSvg, {
596
+ "className": className,
597
+ "nativeOnClick": this.handleClick
598
+ }, null);
599
+ default:
600
+ return createVNode(MicSvg, {
601
+ "className": className,
602
+ "nativeOnClick": this.handleClick
603
+ }, null);
604
+ }
605
+ }
606
+ },
607
+ data: function data() {
608
+ return {
609
+ status: STATUS.inactive
610
+ };
611
+ },
612
+ created: function created() {
613
+ this.results = [];
614
+ if (typeof window !== 'undefined') {
615
+ window.SpeechRecognition = window.webkitSpeechRecognition || window.SpeechRecognition || null;
616
+ if (!window.SpeechRecognition) {
617
+ console.error('SpeechRecognition is not supported in this browser. Please check the browser compatibility at https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition#Browser_compatibility.');
618
+ }
619
+ }
620
+ },
621
+ render: function render() {
622
+ var _this2 = this;
623
+ if (this.hasCustomRenderer) {
624
+ return this.getComponent();
625
+ }
626
+ return createVNode(IconWrapper, null, {
627
+ "default": function _default() {
628
+ return [_this2.Icon];
629
+ }
630
+ });
631
+ }
632
+ };
633
+
634
+ var CustomSvg = {
635
+ name: 'CustomSvg',
636
+ props: {
637
+ className: String,
638
+ icon: Function,
639
+ type: String
640
+ },
641
+ data: function data() {
642
+ return {
643
+ customIcon: this.$props.icon && typeof this.$props.icon === 'function' ? this.$props.icon() : null
644
+ };
645
+ },
646
+ render: function render() {
647
+ if (this.customIcon) {
648
+ return createVNode("div", {
649
+ "class": this.$props.className
650
+ }, [this.customIcon]);
651
+ }
652
+ if (this.$props.type === 'recent-search-icon') {
653
+ return createVNode("svg", {
654
+ "xmlns": "http://www.w3.org/2000/svg",
655
+ "alt": "Recent Search",
656
+ "height": "20",
657
+ "width": "20",
658
+ "viewBox": "0 0 24 24",
659
+ "style": {
660
+ fill: '#707070'
661
+ },
662
+ "class": this.$props.className
663
+ }, [createVNode("path", {
664
+ "d": "M0 0h24v24H0z",
665
+ "fill": "none"
666
+ }, null), createVNode("path", {
667
+ "d": "M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"
668
+ }, null)]);
669
+ }
670
+ if (this.$props.type === 'promoted-search-icon') {
671
+ return createVNode("svg", {
672
+ "xmlns": "http://www.w3.org/2000/svg",
673
+ "width": "20",
674
+ "alt": "promoted search",
675
+ "height": "20",
676
+ "viewBox": "0 0 24 24",
677
+ "class": this.$props.className,
678
+ "style": {
679
+ fill: '#707070'
680
+ }
681
+ }, [createVNode("path", {
682
+ "d": "M12 .587l3.668 7.568 8.332 1.151-6.064 5.828 1.48 8.279-7.416-3.967-7.417 3.967 1.481-8.279-6.064-5.828 8.332-1.151z"
683
+ }, null)]);
684
+ }
685
+ if (this.$props.type === 'popular-search-icon') {
686
+ return createVNode("svg", {
687
+ "xmlns": "http://www.w3.org/2000/svg",
688
+ "alt": "Popular Search",
689
+ "height": "20",
690
+ "width": "20",
691
+ "viewBox": "0 0 24 24",
692
+ "style": {
693
+ fill: '#707070'
694
+ },
695
+ "class": this.$props.className
696
+ }, [createVNode("path", {
697
+ "d": "M0 0h24v24H0z",
698
+ "fill": "none"
699
+ }, null), createVNode("path", {
700
+ "d": "M16 6l2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"
701
+ }, null)]);
702
+ }
703
+ return createVNode(SearchSvg, {
704
+ "styles": {
705
+ position: 'relative',
706
+ fill: '#707070',
707
+ left: '3px',
708
+ marginRight: '8px'
709
+ }
710
+ }, null);
711
+ }
712
+ };
713
+
714
+ var _templateObject$6;
715
+ var AutofillSvgIcon = styled('button')(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tmargin-left: auto;\n\tposition: relative;\n\tright: -3px;\n\tborder: none;\n\toutline: none;\n\tbackground: transparent;\n\tpadding: 0;\n\tz-index: 111000;\n\n\tsvg {\n\t\tcursor: pointer;\n\t\tfill: #707070;\n\t\theight: 20px;\n\t}\n\n\t&:hover {\n\t\tsvg {\n\t\t\tfill: #1c1a1a;\n\t\t}\n\t}\n"])));
716
+ var AutoFillSvg = {
717
+ name: 'AutoFillSvg',
718
+ render: function render() {
719
+ return createVNode(AutofillSvgIcon, {
720
+ "onClick": this.$attrs.click
721
+ }, {
722
+ "default": function _default() {
723
+ return [createVNode("svg", {
724
+ "viewBox": "0 0 24 24"
725
+ }, [createVNode("path", {
726
+ "d": "M8 17v-7.586l8.293 8.293c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414l-8.293-8.293h7.586c0.552 0 1-0.448 1-1s-0.448-1-1-1h-10c-0.552 0-1 0.448-1 1v10c0 0.552 0.448 1 1 1s1-0.448 1-1z"
727
+ }, null)])];
728
+ }
729
+ });
730
+ },
731
+ methods: {
732
+ clicked: function clicked(e) {
733
+ e.stopPropagation();
734
+ window.console.log('hey', e);
735
+ }
736
+ }
737
+ };
738
+
739
+ var _templateObject$7, _templateObject2;
740
+ var TagsContainer = styled('div')(_templateObject$7 || (_templateObject$7 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tmargin-top: 10px;\n\twidth: 100%;\n"])));
741
+ var TagItem = styled('span')(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n\tcursor: default;\n\tbox-sizing: border-box;\n\tmargin: 0 4px 4px 0;\n\tcolor: #000000d9;\n\tfont-size: 14px;\n\tfont-variant: tabular-nums;\n\tline-height: 1.5715;\n\tlist-style: none;\n\tfont-feature-settings: 'tnum';\n\tdisplay: inline-block;\n\theight: auto;\n\tpadding: 0 2px 0 7px;\n\tfont-size: 12px;\n\tline-height: 22px;\n\twhite-space: nowrap;\n\tbackground: #fafafa;\n\tborder: 1px solid #d9d9d9;\n\tborder-radius: 2px;\n\topacity: 1;\n\ttransition: all 0.3s;\n\n\tspan.close-icon {\n\t\tsvg {\n\t\t\tcursor: pointer;\n\t\t\theight: 15px;\n\t\t\tposition: relative;\n\t\t\ttop: 4px;\n\t\t\tfill: #262626;\n\t\t}\n\t}\n"])));
742
+
743
+ function _isSlot(s) {
744
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
745
+ }
746
+ var updateQuery = Actions.updateQuery,
747
+ setCustomQuery = Actions.setCustomQuery,
748
+ setDefaultQuery = Actions.setDefaultQuery,
749
+ recordSuggestionClick = Actions.recordSuggestionClick;
750
+ var _debounce = helper.debounce,
751
+ checkValueChange = helper.checkValueChange,
752
+ getClassName$1 = helper.getClassName,
753
+ isEqual = helper.isEqual,
754
+ getCompositeAggsQuery = helper.getCompositeAggsQuery,
755
+ withClickIds = helper.withClickIds,
756
+ getResultStats = helper.getResultStats;
757
+ var SearchBox = defineComponent({
758
+ name: 'SearchBox',
759
+ isTagsMode: false,
760
+ data: function data() {
761
+ var props = this.$props;
762
+ this.__state = {
763
+ currentValue: '',
764
+ selectedTags: [],
765
+ isOpen: false,
766
+ normalizedSuggestions: []
767
+ };
768
+ this.internalComponent = props.componentId + "__internal";
769
+ return this.__state;
770
+ },
771
+ inject: {
772
+ theme: {
773
+ from: 'theme_reactivesearch'
774
+ }
775
+ },
776
+ created: function created() {
777
+ var mode = this.$props.mode;
778
+ if (mode === SEARCH_COMPONENTS_MODES.TAG) {
779
+ this.$options.isTagsMode = true;
780
+ }
781
+ if (this.$options.isTagsMode) {
782
+ console.warn('Warning(ReactiveSearch): The `categoryField` prop is not supported when `mode` prop is set to `tag`');
783
+ }
784
+ this.currentValue = decodeHtml(this.selectedValue || this.value || this.defaultValue || '');
785
+ if (this.$options.isTagsMode) {
786
+ this.currentValue = '';
787
+ }
788
+ this.handleTextChange = _debounce(this.handleText, this.$props.debounce);
789
+
790
+ // Set custom and default queries in store
791
+ this.triggerCustomQuery(this.currentValue, this.selectedCategory);
792
+ this.triggerDefaultQuery(this.currentValue);
793
+ },
794
+ computed: {
795
+ hasCustomRenderer: function hasCustomRenderer$1() {
796
+ return hasCustomRenderer(this);
797
+ },
798
+ stats: function stats() {
799
+ return getResultStats(this);
800
+ }
801
+ },
802
+ props: {
803
+ autoFocus: VueTypes.bool,
804
+ autosuggest: VueTypes.bool.def(true),
805
+ beforeValueChange: types.func,
806
+ className: VueTypes.string.def(''),
807
+ clearIcon: types.children,
808
+ componentId: types.stringRequired,
809
+ customHighlight: types.func,
810
+ customQuery: types.func,
811
+ defaultQuery: types.func,
812
+ dataField: VueTypes.oneOfType([VueTypes.string, VueTypes.shape({
813
+ field: VueTypes.string,
814
+ weight: VueTypes.number
815
+ }), VueTypes.arrayOf(VueTypes.string), VueTypes.arrayOf({
816
+ field: VueTypes.string,
817
+ weight: VueTypes.number
818
+ })]),
819
+ aggregationField: types.string,
820
+ aggregationSize: VueTypes.number,
821
+ size: VueTypes.number,
822
+ debounce: VueTypes.number.def(0),
823
+ defaultValue: types.string,
824
+ excludeFields: types.excludeFields,
825
+ value: VueTypes.oneOfType([VueTypes.arrayOf(VueTypes.string), types.value]),
826
+ defaultSuggestions: types.suggestions,
827
+ enableSynonyms: VueTypes.bool.def(true),
828
+ enableQuerySuggestions: VueTypes.bool.def(false),
829
+ enablePopularSuggestions: VueTypes.bool.def(false),
830
+ enableRecentSuggestions: VueTypes.bool.def(false),
831
+ fieldWeights: types.fieldWeights,
832
+ filterLabel: types.string,
833
+ fuzziness: types.fuzziness,
834
+ highlight: VueTypes.bool,
835
+ highlightField: types.stringOrArray,
836
+ icon: types.children,
837
+ iconPosition: VueTypes.oneOf(['left', 'right']).def('left'),
838
+ includeFields: types.includeFields,
839
+ innerClass: types.style,
840
+ innerRef: VueTypes.string.def('searchInputField'),
841
+ render: types.func,
842
+ renderNoSuggestion: types.title,
843
+ renderError: types.title,
844
+ placeholder: VueTypes.string.def('Search'),
845
+ queryFormat: VueTypes.oneOf(['and', 'or']).def('or'),
846
+ react: types.react,
847
+ showClear: VueTypes.bool.def(true),
848
+ showDistinctSuggestions: VueTypes.bool.def(true),
849
+ showFilter: VueTypes.bool.def(true),
850
+ showIcon: VueTypes.bool.def(true),
851
+ title: types.title,
852
+ URLParams: VueTypes.bool.def(false),
853
+ strictSelection: VueTypes.bool.def(false),
854
+ nestedField: types.string,
855
+ enablePredictiveSuggestions: VueTypes.bool.def(false),
856
+ recentSearchesIcon: VueTypes.any,
857
+ popularSearchesIcon: VueTypes.any,
858
+ // mic props
859
+ showVoiceSearch: VueTypes.bool.def(false),
860
+ getMicInstance: types.func,
861
+ renderMic: types.func,
862
+ distinctField: types.string,
863
+ distinctFieldConfig: types.props,
864
+ //
865
+ focusShortcuts: VueTypes.arrayOf(VueTypes.oneOfType([VueTypes.string, VueTypes.number])).def(['/']),
866
+ addonBefore: VueTypes.any,
867
+ addonAfter: VueTypes.any,
868
+ expandSuggestionsContainer: VueTypes.bool.def(true),
869
+ index: VueTypes.string,
870
+ popularSuggestionsConfig: VueTypes.object,
871
+ recentSuggestionsConfig: VueTypes.object,
872
+ applyStopwords: VueTypes.bool,
873
+ customStopwords: types.stringArray,
874
+ onData: types.func,
875
+ renderItem: types.func,
876
+ enterButton: VueTypes.bool.def(false),
877
+ renderEnterButton: VueTypes.any,
878
+ mode: VueTypes.oneOf(['select', 'tag']).def('select'),
879
+ renderSelectedTags: VueTypes.any,
880
+ searchboxId: VueTypes.string,
881
+ endpoint: types.endpointConfig
882
+ },
883
+ beforeMount: function beforeMount() {
884
+ if (this.selectedValue) {
885
+ this.setValue(this.selectedValue, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined);
886
+ } else if (this.$props.value) {
887
+ this.setValue(this.$props.value, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined);
888
+ } else if (this.$props.defaultValue) {
889
+ this.setValue(this.$props.defaultValue, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined);
890
+ }
891
+ },
892
+ mounted: function mounted() {
893
+ this.listenForFocusShortcuts();
894
+ },
895
+ watch: {
896
+ dataField: function dataField(newVal, oldVal) {
897
+ if (!isEqual(newVal, oldVal)) {
898
+ this.triggerCustomQuery(this.$data.currentValue);
899
+ }
900
+ },
901
+ fieldWeights: function fieldWeights() {
902
+ this.triggerCustomQuery(this.$data.currentValue);
903
+ },
904
+ fuzziness: function fuzziness() {
905
+ this.triggerCustomQuery(this.$data.currentValue);
906
+ },
907
+ queryFormat: function queryFormat() {
908
+ this.triggerCustomQuery(this.$data.currentValue);
909
+ },
910
+ defaultValue: function defaultValue(newVal) {
911
+ this.setValue(newVal, true, this.$props);
912
+ },
913
+ value: function value(newVal, oldVal) {
914
+ if (!isEqual(newVal, oldVal)) {
915
+ this.setValue(newVal, true, this.$props, newVal === '' ? causes.CLEAR_VALUE : undefined, false);
916
+ }
917
+ },
918
+ defaultQuery: function defaultQuery(newVal, oldVal) {
919
+ if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
920
+ this.triggerDefaultQuery(this.$data.currentValue);
921
+ }
922
+ },
923
+ customQuery: function customQuery(newVal, oldVal) {
924
+ if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
925
+ this.triggerCustomQuery(this.$data.currentValue);
926
+ }
927
+ },
928
+ suggestions: function suggestions(newVal) {
929
+ var suggestionsList = [];
930
+ if (Array.isArray(newVal) && newVal.length) {
931
+ suggestionsList = [].concat(withClickIds(newVal));
932
+ } else if (Array.isArray(this.$props.defaultSuggestions) && this.$props.defaultSuggestions.length) {
933
+ suggestionsList = [].concat(withClickIds(this.$props.defaultSuggestions));
934
+ }
935
+ this.normalizedSuggestions = suggestionsList;
936
+ },
937
+ selectedValue: function selectedValue(newVal, oldVal) {
938
+ if (!isEqual(newVal, oldVal) && (this.$options.isTagsMode ? !isEqual(this.$data.selectedTags, newVal) : this.$data.currentValue !== newVal)) {
939
+ if (!newVal && this.$data.currentValue) {
940
+ // selected value is cleared, call onValueSelected
941
+ this.onValueSelectedHandler('', causes.CLEAR_VALUE);
942
+ }
943
+ if (this.$options.isTagsMode) {
944
+ // handling reset of tags through SelectedFilters or URL
945
+ this.selectedTags = [];
946
+ }
947
+ var cause = !newVal ? causes.CLEAR_VALUE : undefined;
948
+ if (this.$options.isTagsMode) {
949
+ cause = causes.SUGGESTION_SELECT;
950
+ }
951
+ this.setValue(newVal || '', true, this.$props, cause);
952
+ }
953
+ },
954
+ focusShortcuts: function focusShortcuts() {
955
+ this.listenForFocusShortcuts();
956
+ },
957
+ rawData: function rawData(newVal) {
958
+ this.$emit('on-data', {
959
+ data: this.normalizedSuggestions,
960
+ rawData: newVal,
961
+ aggregationData: this.aggregationData,
962
+ loading: this.isLoading,
963
+ error: this.isError
964
+ });
965
+ },
966
+ aggregationData: function aggregationData(newVal) {
967
+ this.$emit('on-data', {
968
+ data: this.normalizedSuggestions,
969
+ rawData: this.rawData,
970
+ aggregationData: newVal,
971
+ loading: this.isLoading,
972
+ error: this.isError
973
+ });
974
+ },
975
+ loading: function loading(newVal) {
976
+ this.$emit('on-data', {
977
+ data: this.normalizedSuggestions,
978
+ rawData: this.rawData,
979
+ aggregationData: this.aggregationData,
980
+ loading: newVal,
981
+ error: this.isError
982
+ });
983
+ },
984
+ error: function error(newVal) {
985
+ this.$emit('on-data', {
986
+ data: this.normalizedSuggestions,
987
+ rawData: this.rawData,
988
+ aggregationData: this.aggregationData,
989
+ loading: this.isLoading,
990
+ error: newVal
991
+ });
992
+ },
993
+ debounce: function debounce(newVal, oldVal) {
994
+ if (!isEqual(newVal, oldVal)) {
995
+ this.handleTextChange = _debounce(this.handleText, newVal);
996
+ }
997
+ }
998
+ },
999
+ methods: {
1000
+ handleText: function handleText(value, cause) {
1001
+ if (cause === causes.CLEAR_VALUE) {
1002
+ this.triggerCustomQuery(value);
1003
+ this.triggerDefaultQuery(value);
1004
+ } else if (this.$props.autosuggest) {
1005
+ this.triggerDefaultQuery(value);
1006
+ } else if (!this.$props.enterButton) {
1007
+ this.triggerCustomQuery(value);
1008
+ }
1009
+ },
1010
+ getComponent: function getComponent$1(downshiftProps) {
1011
+ if (downshiftProps === void 0) {
1012
+ downshiftProps = {};
1013
+ }
1014
+ var currentValue = this.$data.currentValue;
1015
+ var data = {
1016
+ error: this.error,
1017
+ loading: this.isLoading,
1018
+ downshiftProps: downshiftProps,
1019
+ data: this.normalizedSuggestions,
1020
+ rawData: this.rawData,
1021
+ value: currentValue,
1022
+ resultStats: this.stats
1023
+ };
1024
+ return getComponent(data, this);
1025
+ },
1026
+ // returns size and aggs property
1027
+ getBasicQueryOptions: function getBasicQueryOptions() {
1028
+ var aggregationField = this.$props.aggregationField;
1029
+ var queryOptions = getQueryOptions(this.$props);
1030
+ if (aggregationField) {
1031
+ queryOptions.aggs = getCompositeAggsQuery({
1032
+ props: this.$props,
1033
+ showTopHits: true
1034
+ }).aggs;
1035
+ }
1036
+ return queryOptions;
1037
+ },
1038
+ handleSearchIconClick: function handleSearchIconClick() {
1039
+ var currentValue = this.currentValue;
1040
+ if (currentValue.trim()) {
1041
+ this.setValue(currentValue, true);
1042
+ this.onValueSelectedHandler(currentValue, causes.SEARCH_ICON_CLICK);
1043
+ }
1044
+ },
1045
+ setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue) {
1046
+ var _this = this;
1047
+ if (isDefaultValue === void 0) {
1048
+ isDefaultValue = false;
1049
+ }
1050
+ if (props === void 0) {
1051
+ props = this.$props;
1052
+ }
1053
+ if (toggleIsOpen === void 0) {
1054
+ toggleIsOpen = true;
1055
+ }
1056
+ if (categoryValue === void 0) {
1057
+ categoryValue = undefined;
1058
+ }
1059
+ var performUpdate = function performUpdate() {
1060
+ if (_this.$options.isTagsMode && isEqual(value, _this.selectedTags)) {
1061
+ return;
1062
+ }
1063
+ if (_this.$options.isTagsMode && cause === causes.SUGGESTION_SELECT) {
1064
+ if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
1065
+ // check if value already present in selectedTags
1066
+ if (typeof value === 'string' && _this.selectedTags.includes(value)) {
1067
+ _this.isOpen = false;
1068
+ return;
1069
+ }
1070
+ _this.selectedTags = [].concat(_this.selectedTags);
1071
+ if (typeof value === 'string' && !!value) {
1072
+ _this.selectedTags.push(value);
1073
+ } else if (Array.isArray(value) && !isEqual(_this.selectedTags, value)) {
1074
+ _this.selectedTags = value;
1075
+ }
1076
+ } else if (value) {
1077
+ _this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
1078
+ }
1079
+ _this.currentValue = '';
1080
+ } else {
1081
+ _this.currentValue = decodeHtml(value);
1082
+ }
1083
+ var queryHandlerValue = value;
1084
+ if (_this.$options.isTagsMode && cause === causes.SUGGESTION_SELECT) {
1085
+ queryHandlerValue = Array.isArray(_this.selectedTags) && _this.selectedTags.length ? _this.selectedTags : undefined;
1086
+ }
1087
+ if (isDefaultValue) {
1088
+ if (_this.$props.autosuggest) {
1089
+ if (toggleIsOpen) {
1090
+ _this.isOpen = false;
1091
+ }
1092
+ if (typeof _this.currentValue === 'string') _this.triggerDefaultQuery(_this.currentValue);
1093
+ } // in case of strict selection only SUGGESTION_SELECT should be able
1094
+ // to set the query otherwise the value should reset
1095
+ if (props.strictSelection) {
1096
+ if (cause === causes.SUGGESTION_SELECT || (_this.$options.isTagsMode ? _this.selectedTags.length === 0 : value === '')) {
1097
+ _this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
1098
+ } else {
1099
+ _this.setValue('', true);
1100
+ }
1101
+ } else if (props.value === undefined || cause === causes.SUGGESTION_SELECT || cause === causes.CLEAR_VALUE) {
1102
+ _this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
1103
+ }
1104
+ } else {
1105
+ // debounce for handling text while typing
1106
+ _this.handleTextChange(value, cause);
1107
+ }
1108
+ _this.$emit('valueChange', value);
1109
+ _this.$emit('value-change', value);
1110
+ };
1111
+ checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
1112
+ },
1113
+ triggerDefaultQuery: function triggerDefaultQuery(paramValue) {
1114
+ if (!this.$props.autosuggest) {
1115
+ return;
1116
+ }
1117
+ var value = typeof paramValue !== 'string' ? this.currentValue : paramValue;
1118
+ var query = SearchBox.defaultQuery(value, this.$props);
1119
+ if (this.defaultQuery) {
1120
+ var defaultQueryToBeSet = this.defaultQuery(value, this.$props) || {};
1121
+ if (defaultQueryToBeSet.query) {
1122
+ query = defaultQueryToBeSet.query;
1123
+ }
1124
+
1125
+ // Update calculated default query in store
1126
+ updateDefaultQuery(this.$props.componentId, this.setDefaultQuery, this.$props, value);
1127
+ }
1128
+ this.updateQuery({
1129
+ componentId: this.internalComponent,
1130
+ query: query,
1131
+ value: value,
1132
+ componentType: componentTypes.searchBox
1133
+ });
1134
+ },
1135
+ triggerCustomQuery: function triggerCustomQuery(paramValue, categoryValue) {
1136
+ if (categoryValue === void 0) {
1137
+ categoryValue = undefined;
1138
+ }
1139
+ var _this$$props = this.$props,
1140
+ customQuery = _this$$props.customQuery,
1141
+ filterLabel = _this$$props.filterLabel,
1142
+ showFilter = _this$$props.showFilter,
1143
+ URLParams = _this$$props.URLParams;
1144
+ var value = typeof paramValue !== 'string' ? this.$data.currentValue : paramValue;
1145
+ if (this.$options.isTagsMode) {
1146
+ value = paramValue;
1147
+ }
1148
+ var defaultQueryTobeSet = SearchBox.defaultQuery("" + value + (categoryValue ? " in " + categoryValue : ''), this.$props);
1149
+ var query = defaultQueryTobeSet;
1150
+ if (customQuery) {
1151
+ var customQueryTobeSet = customQuery(value, this.$props);
1152
+ var queryTobeSet = customQueryTobeSet.query;
1153
+ if (queryTobeSet) {
1154
+ query = queryTobeSet;
1155
+ }
1156
+ updateCustomQuery(this.$props.componentId, this.setCustomQuery, this.$props, value);
1157
+ }
1158
+ this.updateQuery({
1159
+ componentId: this.$props.componentId,
1160
+ query: query,
1161
+ value: value,
1162
+ label: filterLabel,
1163
+ showFilter: showFilter,
1164
+ URLParams: URLParams,
1165
+ componentType: componentTypes.searchBox,
1166
+ category: categoryValue
1167
+ });
1168
+ },
1169
+ handleFocus: function handleFocus(event) {
1170
+ if (this.$props.autosuggest) {
1171
+ this.isOpen = true;
1172
+ }
1173
+ this.$emit('focus', event);
1174
+ },
1175
+ handleVoiceResults: function handleVoiceResults(_ref) {
1176
+ var results = _ref.results;
1177
+ if (results && results[0] && results[0].isFinal && results[0][0] && results[0][0].transcript && results[0][0].transcript.trim()) {
1178
+ this.setValue(results[0][0].transcript.trim(), true);
1179
+ }
1180
+ },
1181
+ triggerQuery: function triggerQuery(_ref2) {
1182
+ var _ref2$isOpen = _ref2.isOpen,
1183
+ isOpen = _ref2$isOpen === void 0 ? undefined : _ref2$isOpen,
1184
+ _ref2$customQuery = _ref2.customQuery,
1185
+ customQuery = _ref2$customQuery === void 0 ? true : _ref2$customQuery,
1186
+ _ref2$defaultQuery = _ref2.defaultQuery,
1187
+ defaultQuery = _ref2$defaultQuery === void 0 ? true : _ref2$defaultQuery,
1188
+ _ref2$value = _ref2.value,
1189
+ value = _ref2$value === void 0 ? undefined : _ref2$value,
1190
+ _ref2$categoryValue = _ref2.categoryValue,
1191
+ categoryValue = _ref2$categoryValue === void 0 ? undefined : _ref2$categoryValue;
1192
+ if (typeof isOpen === 'boolean') {
1193
+ this.isOpen = isOpen;
1194
+ }
1195
+ if (customQuery) {
1196
+ this.triggerCustomQuery(value, categoryValue);
1197
+ }
1198
+ if (defaultQuery) {
1199
+ this.triggerDefaultQuery(value);
1200
+ }
1201
+ },
1202
+ triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
1203
+ // click analytics would only work client side and after javascript loads
1204
+ var docId = documentId;
1205
+ if (!docId) {
1206
+ var hitData = this.normalizedSuggestions.find(function (hit) {
1207
+ return hit._click_id === searchPosition;
1208
+ });
1209
+ if (hitData && hitData.source && hitData.source._id) {
1210
+ docId = hitData.source._id;
1211
+ }
1212
+ }
1213
+ this.recordSuggestionClick(searchPosition, docId);
1214
+ },
1215
+ clearValue: function clearValue() {
1216
+ this.setValue('', false, this.$props, causes.CLEAR_VALUE, false);
1217
+ this.onValueSelectedHandler('', causes.CLEAR_VALUE);
1218
+ },
1219
+ handleKeyDown: function handleKeyDown(event, highlightedIndex) {
1220
+ if (highlightedIndex === void 0) {
1221
+ highlightedIndex = null;
1222
+ }
1223
+ // if a suggestion was selected, delegate the handling to suggestion handler
1224
+ if (event.key === 'Enter') {
1225
+ if (this.$props.autosuggest === false) {
1226
+ this.enterButtonOnClick();
1227
+ } else if (highlightedIndex === null) {
1228
+ this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined // to handle tags
1229
+ );
1230
+
1231
+ this.onValueSelectedHandler(event.target.value, causes.ENTER_PRESS);
1232
+ }
1233
+ }
1234
+
1235
+ // Need to review
1236
+ this.$emit('keyDown', event, this.triggerQuery);
1237
+ this.$emit('key-down', event, this.triggerQuery);
1238
+ },
1239
+ onInputChange: function onInputChange(e) {
1240
+ var _this2 = this;
1241
+ var inputValue = e.target.value;
1242
+ if (!this.$data.isOpen && this.$props.autosuggest) {
1243
+ this.isOpen = true;
1244
+ }
1245
+ var value = this.$props.value;
1246
+ if (value === undefined) {
1247
+ this.setValue(inputValue, false, this.$props, inputValue === '' ? causes.CLEAR_VALUE : undefined);
1248
+ } else {
1249
+ this.$emit('change', inputValue, function (_ref3) {
1250
+ var isOpen = _ref3.isOpen;
1251
+ return _this2.triggerQuery({
1252
+ defaultQuery: true,
1253
+ customQuery: true,
1254
+ value: inputValue,
1255
+ isOpen: isOpen
1256
+ });
1257
+ }, e);
1258
+ }
1259
+ },
1260
+ onSuggestionSelected: function onSuggestionSelected(suggestion) {
1261
+ var _this3 = this;
1262
+ this.isOpen = false;
1263
+ var value = this.$props.value;
1264
+ // Record analytics for selected suggestions
1265
+ this.triggerClickAnalytics(suggestion._click_id);
1266
+ if (value === undefined) {
1267
+ this.setValue(suggestion.value, true, this.$props, causes.SUGGESTION_SELECT, false, suggestion._category);
1268
+ } else {
1269
+ var emitValue = suggestion.value;
1270
+ if (this.$options.isTagsMode) {
1271
+ emitValue = Array.isArray(this.selectedTags) ? [].concat(this.selectedTags) : [];
1272
+ if (this.selectedTags.includes(suggestion.value)) {
1273
+ // avoid duplicates in tags array
1274
+ this.isOpen = false;
1275
+ return;
1276
+ }
1277
+ emitValue.push(suggestion.value);
1278
+ }
1279
+ this.setValue(emitValue, true, this.$props, causes.SUGGESTION_SELECT, false, suggestion._category);
1280
+ this.$emit('change', emitValue, function (_ref4) {
1281
+ var isOpen = _ref4.isOpen;
1282
+ return _this3.triggerQuery(_extends({
1283
+ isOpen: isOpen,
1284
+ value: emitValue
1285
+ }, !_this3.$options.isTagsMode && {
1286
+ categoryValue: suggestion._category
1287
+ }));
1288
+ });
1289
+ }
1290
+ this.onValueSelectedHandler(suggestion.value, causes.SUGGESTION_SELECT, suggestion.source);
1291
+ },
1292
+ onValueSelectedHandler: function onValueSelectedHandler(currentValue) {
1293
+ if (currentValue === void 0) {
1294
+ currentValue = this.$data.currentValue;
1295
+ }
1296
+ for (var _len = arguments.length, cause = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1297
+ cause[_key - 1] = arguments[_key];
1298
+ }
1299
+ this.$emit.apply(this, ['valueSelected', currentValue].concat(cause));
1300
+ this.$emit.apply(this, ['value-selected', currentValue].concat(cause));
1301
+ },
1302
+ handleStateChange: function handleStateChange(changes) {
1303
+ var isOpen = changes.isOpen;
1304
+ this.isOpen = isOpen;
1305
+ },
1306
+ getBackgroundColor: function getBackgroundColor(highlightedIndex, index) {
1307
+ var isDark = this.themePreset === 'dark';
1308
+ if (isDark) {
1309
+ return highlightedIndex === index ? '#555' : '#424242';
1310
+ }
1311
+ return highlightedIndex === index ? '#eee' : '#fff';
1312
+ },
1313
+ renderIcon: function renderIcon() {
1314
+ if (this.$props.showIcon) {
1315
+ return this.$props.icon || createVNode(SearchSvg, null, null);
1316
+ }
1317
+ return null;
1318
+ },
1319
+ renderErrorComponent: function renderErrorComponent() {
1320
+ var _this4 = this;
1321
+ var renderError = this.$slots.renderError || this.$props.renderError;
1322
+ if (this.error && renderError && this.$data.currentValue && !this.isLoading) {
1323
+ return createVNode(SuggestionWrapper, {
1324
+ "innerClass": this.$props.innerClass,
1325
+ "innerClassName": "error",
1326
+ "theme": this.theme,
1327
+ "themePreset": this.themePreset
1328
+ }, {
1329
+ "default": function _default() {
1330
+ return [isFunction(renderError) ? renderError(_this4.error) : renderError];
1331
+ }
1332
+ });
1333
+ }
1334
+ return null;
1335
+ },
1336
+ renderCancelIcon: function renderCancelIcon() {
1337
+ if (this.$props.showClear) {
1338
+ return this.$props.clearIcon || createVNode(CancelSvg, null, null);
1339
+ }
1340
+ return null;
1341
+ },
1342
+ renderNoSuggestions: function renderNoSuggestions(finalSuggestionsList) {
1343
+ if (finalSuggestionsList === void 0) {
1344
+ finalSuggestionsList = [];
1345
+ }
1346
+ var innerClass = this.$props.innerClass;
1347
+ var renderNoSuggestion = this.$slots.renderNoSuggestion || this.$props.renderNoSuggestion;
1348
+ var renderError = this.$slots.renderError || this.$props.renderError;
1349
+ var _this$$data = this.$data,
1350
+ isOpen = _this$$data.isOpen,
1351
+ currentValue = _this$$data.currentValue;
1352
+ if (renderNoSuggestion && isOpen && !finalSuggestionsList.length && !this.isLoading && currentValue && !(renderError && this.error)) {
1353
+ return createVNode(SuggestionWrapper, {
1354
+ "innerClass": innerClass,
1355
+ "themePreset": this.themePreset,
1356
+ "theme": this.theme,
1357
+ "innerClassName": "noSuggestion"
1358
+ }, {
1359
+ "default": function _default() {
1360
+ return typeof renderNoSuggestion === 'function' ? renderNoSuggestion(currentValue) : renderNoSuggestion;
1361
+ }
1362
+ });
1363
+ }
1364
+ return null;
1365
+ },
1366
+ renderInputAddonBefore: function renderInputAddonBefore() {
1367
+ var addonBefore = this.$slots.addonBefore;
1368
+ if (addonBefore) {
1369
+ var _slot;
1370
+ return createVNode(InputAddon, {
1371
+ "class": "addon-before"
1372
+ }, _isSlot(_slot = addonBefore()) ? _slot : {
1373
+ "default": function _default() {
1374
+ return [_slot];
1375
+ }
1376
+ });
1377
+ }
1378
+ return null;
1379
+ },
1380
+ renderInputAddonAfter: function renderInputAddonAfter() {
1381
+ var addonAfter = this.$slots.addonAfter;
1382
+ if (addonAfter) {
1383
+ var _slot2;
1384
+ return createVNode(InputAddon, {
1385
+ "class": "addon-after"
1386
+ }, _isSlot(_slot2 = addonAfter()) ? _slot2 : {
1387
+ "default": function _default() {
1388
+ return [_slot2];
1389
+ }
1390
+ });
1391
+ }
1392
+ return null;
1393
+ },
1394
+ enterButtonOnClick: function enterButtonOnClick() {
1395
+ this.triggerQuery({
1396
+ isOpen: false,
1397
+ value: this.currentValue,
1398
+ customQuery: true
1399
+ });
1400
+ },
1401
+ renderEnterButtonElement: function renderEnterButtonElement() {
1402
+ var _this5 = this;
1403
+ var _this$$props2 = this.$props,
1404
+ enterButton = _this$$props2.enterButton,
1405
+ innerClass = _this$$props2.innerClass;
1406
+ var renderEnterButton = this.$slots.renderEnterButton;
1407
+ if (enterButton) {
1408
+ var getEnterButtonMarkup = function getEnterButtonMarkup() {
1409
+ if (renderEnterButton) {
1410
+ return renderEnterButton(_this5.enterButtonOnClick);
1411
+ }
1412
+ return createVNode(Button, {
1413
+ "class": "enter-btn " + getClassName$1(innerClass, 'enter-button'),
1414
+ "primary": true,
1415
+ "onClick": _this5.enterButtonOnClick
1416
+ }, {
1417
+ "default": function _default() {
1418
+ return [createTextVNode("Search")];
1419
+ }
1420
+ });
1421
+ };
1422
+ return createVNode("div", {
1423
+ "class": "enter-button-wrapper"
1424
+ }, [getEnterButtonMarkup()]);
1425
+ }
1426
+ return null;
1427
+ },
1428
+ renderIcons: function renderIcons() {
1429
+ var _this6 = this;
1430
+ var _slot3, _slot4, _slot5;
1431
+ var _this$$props3 = this.$props,
1432
+ iconPosition = _this$$props3.iconPosition,
1433
+ showClear = _this$$props3.showClear,
1434
+ innerClass = _this$$props3.innerClass,
1435
+ getMicInstance = _this$$props3.getMicInstance,
1436
+ showVoiceSearch = _this$$props3.showVoiceSearch,
1437
+ showIcon = _this$$props3.showIcon;
1438
+ var renderMic = this.$slots.renderMic || this.$props.renderMic;
1439
+ var currentValue = this.$data.currentValue;
1440
+ return createVNode("div", null, [createVNode(IconGroup, {
1441
+ "groupPosition": "right",
1442
+ "positionType": "absolute"
1443
+ }, {
1444
+ "default": function _default() {
1445
+ return [currentValue && showClear && createVNode(IconWrapper, {
1446
+ "onClick": _this6.clearValue,
1447
+ "showIcon": showIcon,
1448
+ "isClearIcon": true
1449
+ }, _isSlot(_slot3 = _this6.renderCancelIcon()) ? _slot3 : {
1450
+ "default": function _default() {
1451
+ return [_slot3];
1452
+ }
1453
+ }), showVoiceSearch && createVNode(Mic, {
1454
+ "getInstance": getMicInstance,
1455
+ "render": renderMic,
1456
+ "handleResult": _this6.handleVoiceResults,
1457
+ "className": getClassName$1(innerClass, 'mic') || null
1458
+ }, null), iconPosition === 'right' && showIcon && createVNode(IconWrapper, {
1459
+ "onClick": _this6.handleSearchIconClick
1460
+ }, _isSlot(_slot4 = _this6.renderIcon()) ? _slot4 : {
1461
+ "default": function _default() {
1462
+ return [_slot4];
1463
+ }
1464
+ })];
1465
+ }
1466
+ }), createVNode(IconGroup, {
1467
+ "groupPosition": "left",
1468
+ "positionType": "absolute"
1469
+ }, {
1470
+ "default": function _default() {
1471
+ return [iconPosition === 'left' && showIcon && createVNode(IconWrapper, {
1472
+ "onClick": _this6.handleSearchIconClick
1473
+ }, _isSlot(_slot5 = _this6.renderIcon()) ? _slot5 : {
1474
+ "default": function _default() {
1475
+ return [_slot5];
1476
+ }
1477
+ })];
1478
+ }
1479
+ })]);
1480
+ },
1481
+ focusSearchBox: function focusSearchBox(event) {
1482
+ var _this$$refs, _this$$refs$this$$pro;
1483
+ var elt = event.target || event.srcElement;
1484
+ var tagName = elt.tagName;
1485
+ if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
1486
+ // already in an input
1487
+ return;
1488
+ }
1489
+ (_this$$refs = this.$refs) == null ? void 0 : (_this$$refs$this$$pro = _this$$refs[this.$props.innerRef]) == null ? void 0 : _this$$refs$this$$pro.focus(); // eslint-disable-line
1490
+ },
1491
+ listenForFocusShortcuts: function listenForFocusShortcuts() {
1492
+ var _this7 = this;
1493
+ var _this$$props$focusSho = this.$props.focusShortcuts,
1494
+ focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
1495
+ if (isEmpty(focusShortcuts)) {
1496
+ return;
1497
+ }
1498
+ var shortcutsString = parseFocusShortcuts(focusShortcuts).join(',');
1499
+
1500
+ // handler for alphabets and other key combinations
1501
+ hotkeys(shortcutsString,
1502
+ // eslint-disable-next-line no-unused-vars
1503
+ /* eslint-disable no-shadow */
1504
+ function (event, handler) {
1505
+ // Prevent the default refresh event under WINDOWS system
1506
+ event.preventDefault();
1507
+ _this7.focusSearchBox(event);
1508
+ });
1509
+
1510
+ // if one of modifier keys are used, they are handled below
1511
+ hotkeys('*', function (event) {
1512
+ var modifierKeys = extractModifierKeysFromFocusShortcuts(focusShortcuts);
1513
+ if (modifierKeys.length === 0) return;
1514
+ for (var index = 0; index < modifierKeys.length; index += 1) {
1515
+ var element = modifierKeys[index];
1516
+ if (hotkeys[element]) {
1517
+ _this7.focusSearchBox(event);
1518
+ break;
1519
+ }
1520
+ }
1521
+ });
1522
+ },
1523
+ onAutofillClick: function onAutofillClick(suggestion) {
1524
+ var value = suggestion.value;
1525
+ this.isOpen = true;
1526
+ this.currentValue = decodeHtml(value);
1527
+ this.triggerDefaultQuery(value);
1528
+ },
1529
+ renderAutoFill: function renderAutoFill(suggestion) {
1530
+ var _this8 = this;
1531
+ var handleAutoFillClick = function handleAutoFillClick(e) {
1532
+ e.stopPropagation();
1533
+ _this8.onAutofillClick(suggestion);
1534
+ };
1535
+ /* 👇 avoid showing autofill for category suggestions👇 */
1536
+ return suggestion._category ? null : createVNode(AutoFillSvg, {
1537
+ "onClick": handleAutoFillClick
1538
+ }, null);
1539
+ },
1540
+ renderTag: function renderTag(item) {
1541
+ var _this9 = this;
1542
+ var innerClass = this.$props.innerClass;
1543
+ return createVNode(TagItem, {
1544
+ "class": getClassName$1(innerClass, 'selected-tag') || ''
1545
+ }, {
1546
+ "default": function _default() {
1547
+ return [createVNode("span", null, [item]), createVNode("span", {
1548
+ "role": "img",
1549
+ "aria-label": "delete-tag",
1550
+ "class": "close-icon",
1551
+ "onClick": function onClick() {
1552
+ return _this9.clearTag(item);
1553
+ }
1554
+ }, [createVNode(CancelSvg, null, null)])];
1555
+ }
1556
+ });
1557
+ },
1558
+ clearAllTags: function clearAllTags() {
1559
+ this.selectedTags = [];
1560
+ this.setValue('', true, this.$props, causes.SUGGESTION_SELECT);
1561
+ if (this.$props.value !== undefined) {
1562
+ this.$emit('change', this.selectedTags, this.triggerQuery);
1563
+ }
1564
+ },
1565
+ clearTag: function clearTag(tagValue) {
1566
+ this.selectedTags = [].concat(this.selectedTags.filter(function (tag) {
1567
+ return tag !== tagValue;
1568
+ }));
1569
+ this.setValue('', true, this.$props, causes.SUGGESTION_SELECT);
1570
+ if (this.$props.value !== undefined) {
1571
+ this.$emit('change', this.selectedTags, this.triggerQuery);
1572
+ }
1573
+ },
1574
+ renderTags: function renderTags() {
1575
+ var _this10 = this;
1576
+ if (!Array.isArray(this.selectedTags)) {
1577
+ return null;
1578
+ }
1579
+ var tagsList = [].concat(this.selectedTags);
1580
+ var shouldRenderClearAllTag = tagsList.length > 1;
1581
+ var renderSelectedTags = this.$slots.renderSelectedTags || this.$props.renderSelectedTags;
1582
+ return renderSelectedTags ? renderSelectedTags({
1583
+ values: this.selectedTags,
1584
+ handleClear: this.clearTag,
1585
+ handleClearAll: this.clearAllTags
1586
+ }) : createVNode(TagsContainer, null, {
1587
+ "default": function _default() {
1588
+ return [tagsList.map(function (item) {
1589
+ return _this10.renderTag(item);
1590
+ }), shouldRenderClearAllTag && createVNode(TagItem, {
1591
+ "class": getClassName$1(_this10.$props.innerClass, 'selected-tag') || ''
1592
+ }, {
1593
+ "default": function _default() {
1594
+ return [createVNode("span", null, [createTextVNode("Clear All")]), createVNode("span", {
1595
+ "role": "img",
1596
+ "aria-label": "delete-tag",
1597
+ "class": "close-icon",
1598
+ "onClick": _this10.clearAllTags
1599
+ }, [createVNode(CancelSvg, null, null)])];
1600
+ }
1601
+ })];
1602
+ }
1603
+ });
1604
+ }
1605
+ },
1606
+ render: function render() {
1607
+ var _this11 = this;
1608
+ var expandSuggestionsContainer = this.$props.expandSuggestionsContainer;
1609
+ var _this$$slots = this.$slots,
1610
+ recentSearchesIcon = _this$$slots.recentSearchesIcon,
1611
+ popularSearchesIcon = _this$$slots.popularSearchesIcon;
1612
+ var hasSuggestions = Array.isArray(this.normalizedSuggestions) && this.normalizedSuggestions.length;
1613
+ var renderItem = this.$slots.renderItem || this.$props.renderItem;
1614
+ return createVNode(Container, {
1615
+ "class": this.$props.className
1616
+ }, {
1617
+ "default": function _default() {
1618
+ return [_this11.$props.title && createVNode(Title, {
1619
+ "class": getClassName$1(_this11.$props.innerClass, 'title') || ''
1620
+ }, {
1621
+ "default": function _default() {
1622
+ return [_this11.$props.title];
1623
+ }
1624
+ }), _this11.$props.autosuggest ? createVNode(Downshift, {
1625
+ "id": _this11.$props.componentId + "-downshift",
1626
+ "handleChange": _this11.onSuggestionSelected,
1627
+ "handleMouseup": _this11.handleStateChange,
1628
+ "isOpen": _this11.$data.isOpen
1629
+ }, {
1630
+ "default": function _default(_ref5) {
1631
+ var getInputEvents = _ref5.getInputEvents,
1632
+ getInputProps = _ref5.getInputProps,
1633
+ getItemProps = _ref5.getItemProps,
1634
+ getItemEvents = _ref5.getItemEvents,
1635
+ isOpen = _ref5.isOpen,
1636
+ highlightedIndex = _ref5.highlightedIndex,
1637
+ setHighlightedIndex = _ref5.setHighlightedIndex;
1638
+ var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
1639
+ var getIcon = function getIcon(iconType) {
1640
+ switch (iconType) {
1641
+ case suggestionTypes.Recent:
1642
+ return recentSearchesIcon;
1643
+ case suggestionTypes.Popular:
1644
+ return popularSearchesIcon;
1645
+ default:
1646
+ return null;
1647
+ }
1648
+ };
1649
+ return createVNode("div", null, [_this11.hasCustomRenderer && _this11.getComponent({
1650
+ isOpen: isOpen,
1651
+ getItemProps: getItemProps,
1652
+ getItemEvents: getItemEvents,
1653
+ highlightedIndex: highlightedIndex
1654
+ }), _this11.renderErrorComponent(), !_this11.hasCustomRenderer && isOpen && hasSuggestions ? createVNode("ul", {
1655
+ "class": suggestions(_this11.themePreset, _this11.theme) + " " + getClassName$1(_this11.$props.innerClass, 'list')
1656
+ }, [_this11.normalizedSuggestions.map(function (item, index) {
1657
+ return renderItem ? createVNode("li", mergeProps(getItemProps({
1658
+ item: item
1659
+ }), getItemEvents({
1660
+ item: item
1661
+ }), {
1662
+ "key": index + 1 + "-" + item.value,
1663
+ "style": {
1664
+ backgroundColor: _this11.getBackgroundColor(highlightedIndex, index),
1665
+ justifyContent: 'flex-start',
1666
+ alignItems: 'center'
1667
+ }
1668
+ }), [renderItem(item)]) : createVNode("li", mergeProps(getItemProps({
1669
+ item: item
1670
+ }), _transformOn(getItemEvents({
1671
+ item: item
1672
+ })), {
1673
+ "key": index + 1 + "-" + item.value,
1674
+ "style": {
1675
+ backgroundColor: _this11.getBackgroundColor(highlightedIndex, index),
1676
+ justifyContent: 'flex-start',
1677
+ alignItems: 'center'
1678
+ }
1679
+ }), [createVNode("div", {
1680
+ "style": {
1681
+ padding: '0 10px 0 0',
1682
+ display: 'flex'
1683
+ }
1684
+ }, [createVNode(CustomSvg, {
1685
+ "className": getClassName$1(_this11.$props.innerClass, item._suggestion_type + "-search-icon") || null,
1686
+ "icon": getIcon(item._suggestion_type),
1687
+ "type": item._suggestion_type + "-search-icon"
1688
+ }, null)]), createVNode(SuggestionItem, {
1689
+ "currentValue": _this11.currentValue,
1690
+ "suggestion": item
1691
+ }, null), _this11.renderAutoFill(item)]);
1692
+ })]) : _this11.renderNoSuggestions(_this11.normalizedSuggestions)]);
1693
+ };
1694
+ return createVNode("div", {
1695
+ "class": suggestionsContainer
1696
+ }, [createVNode(InputGroup, null, {
1697
+ "default": function _default() {
1698
+ return [_this11.renderInputAddonBefore(), createVNode(InputWrapper, null, {
1699
+ "default": function _default() {
1700
+ return [createVNode(Input, mergeProps(_transformOn(getInputEvents({
1701
+ onInput: _this11.onInputChange,
1702
+ onBlur: function onBlur(e) {
1703
+ _this11.$emit('blur', e, _this11.triggerQuery);
1704
+ },
1705
+ onFocus: _this11.handleFocus,
1706
+ onKeyPress: function onKeyPress(e) {
1707
+ _this11.$emit('keyPress', e, _this11.triggerQuery);
1708
+ _this11.$emit('key-press', e, _this11.triggerQuery);
1709
+ },
1710
+ onKeyDown: function onKeyDown(e) {
1711
+ return _this11.handleKeyDown(e, highlightedIndex);
1712
+ },
1713
+ onKeyUp: function onKeyUp(e) {
1714
+ _this11.$emit('keyUp', e, _this11.triggerQuery);
1715
+ _this11.$emit('key-up', e, _this11.triggerQuery);
1716
+ },
1717
+ onClick: function onClick() {
1718
+ setHighlightedIndex(null);
1719
+ }
1720
+ })), {
1721
+ "id": _this11.$props.componentId + "-input",
1722
+ "showIcon": _this11.$props.showIcon,
1723
+ "showClear": _this11.$props.showClear,
1724
+ "iconPosition": _this11.$props.iconPosition,
1725
+ "ref": _this11.$props.innerRef,
1726
+ "class": getClassName$1(_this11.$props.innerClass, 'input'),
1727
+ "placeholder": _this11.$props.placeholder,
1728
+ "autoFocus": _this11.$props.autoFocus
1729
+ }, getInputProps({
1730
+ value: _this11.$data.currentValue === null ? '' : _this11.$data.currentValue
1731
+ }), {
1732
+ "themePreset": _this11.themePreset,
1733
+ "autocomplete": "off"
1734
+ }), null), _this11.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()];
1735
+ }
1736
+ }), _this11.renderInputAddonAfter(), _this11.renderEnterButtonElement()];
1737
+ }
1738
+ }), expandSuggestionsContainer && renderSuggestionsDropdown(), _this11.renderTags()]);
1739
+ }
1740
+ }) : createVNode("div", {
1741
+ "class": suggestionsContainer
1742
+ }, [createVNode(InputGroup, null, {
1743
+ "default": function _default() {
1744
+ return [_this11.renderInputAddonBefore(), createVNode(InputWrapper, null, {
1745
+ "default": function _default() {
1746
+ return [createVNode(Input, mergeProps(_transformOn({
1747
+ blur: function blur(e) {
1748
+ _this11.$emit('blur', e, _this11.triggerQuery);
1749
+ },
1750
+ keypress: function keypress(e) {
1751
+ _this11.$emit('keyPress', e, _this11.triggerQuery);
1752
+ _this11.$emit('key-press', e, _this11.triggerQuery);
1753
+ },
1754
+ input: _this11.onInputChange,
1755
+ focus: function focus(e) {
1756
+ _this11.$emit('focus', e, _this11.triggerQuery);
1757
+ },
1758
+ keydown: _this11.handleKeyDown,
1759
+ keyup: function keyup(e) {
1760
+ _this11.$emit('keyUp', e, _this11.triggerQuery);
1761
+ _this11.$emit('key-up', e, _this11.triggerQuery);
1762
+ }
1763
+ }), {
1764
+ "class": getClassName$1(_this11.$props.innerClass, 'input') || '',
1765
+ "placeholder": _this11.$props.placeholder,
1766
+ "autofocus": _this11.$props.autoFocus,
1767
+ "value": _this11.$data.currentValue ? _this11.$data.currentValue : '',
1768
+ "iconPosition": _this11.$props.iconPosition,
1769
+ "showIcon": _this11.$props.showIcon,
1770
+ "showClear": _this11.$props.showClear,
1771
+ "ref": _this11.$props.innerRef,
1772
+ "themePreset": _this11.themePreset
1773
+ }), null), _this11.renderIcons()];
1774
+ }
1775
+ }), _this11.renderInputAddonAfter(), _this11.renderEnterButtonElement()];
1776
+ }
1777
+ })])];
1778
+ }
1779
+ });
1780
+ },
1781
+ destroyed: function destroyed() {
1782
+ document.removeEventListener('keydown', this.onKeyDown);
1783
+ }
1784
+ });
1785
+ SearchBox.defaultQuery = function (value, props) {
1786
+ var finalQuery = null;
1787
+ finalQuery = {
1788
+ bool: {
1789
+ should: SearchBox.shouldQuery(value, props),
1790
+ minimum_should_match: '1'
1791
+ }
1792
+ };
1793
+ if (finalQuery && props.nestedField) {
1794
+ return {
1795
+ query: {
1796
+ nested: {
1797
+ path: props.nestedField,
1798
+ query: finalQuery
1799
+ }
1800
+ }
1801
+ };
1802
+ }
1803
+ return finalQuery;
1804
+ };
1805
+ SearchBox.shouldQuery = function (value, props) {
1806
+ return {
1807
+ query: {
1808
+ queryFormat: props.queryFormat,
1809
+ dataField: props.dataField,
1810
+ value: value,
1811
+ nestedField: props.nestedField,
1812
+ queryString: props.queryString,
1813
+ searchOperators: props.searchOperators
1814
+ }
1815
+ };
1816
+ };
1817
+ var mapStateToProps = function mapStateToProps(state, props) {
1818
+ return {
1819
+ selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
1820
+ selectedCategory: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].category || null,
1821
+ suggestions: state.hits[props.componentId] && state.hits[props.componentId].hits,
1822
+ rawData: state.rawData[props.componentId],
1823
+ aggregationData: state.compositeAggregations[props.componentId] || [],
1824
+ themePreset: state.config.themePreset,
1825
+ isLoading: !!state.isLoading[props.componentId + "_active"],
1826
+ error: state.error[props.componentId],
1827
+ time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
1828
+ total: state.hits[props.componentId] && state.hits[props.componentId].total,
1829
+ hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden
1830
+ };
1831
+ };
1832
+ var mapDispatchToProps = {
1833
+ updateQuery: updateQuery,
1834
+ setCustomQuery: setCustomQuery,
1835
+ setDefaultQuery: setDefaultQuery,
1836
+ recordSuggestionClick: recordSuggestionClick
1837
+ };
1838
+ var SBConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps, mapDispatchToProps)(SearchBox), {
1839
+ componentType: componentTypes.searchBox,
1840
+ internalComponent: true
1841
+ }));
1842
+ SBConnected.name = SearchBox.name;
1843
+ SBConnected.install = function (Vue) {
1844
+ Vue.component(SBConnected.name, SBConnected);
1845
+ };
1846
+ // Add componentType for SSR
1847
+ SBConnected.componentType = componentTypes.searchBox;
1848
+
1849
+ var _excluded = ["options"];
1850
+ var updateQuery$1 = Actions.updateQuery,
1851
+ setQueryOptions = Actions.setQueryOptions,
1852
+ setCustomQuery$1 = Actions.setCustomQuery,
1853
+ setDefaultQuery$1 = Actions.setDefaultQuery;
1854
+ var parseHits = helper.parseHits,
1855
+ isEqual$1 = helper.isEqual,
1856
+ getCompositeAggsQuery$1 = helper.getCompositeAggsQuery,
1857
+ getResultStats$1 = helper.getResultStats,
1858
+ extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
1859
+ getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
1860
+ var ReactiveComponent = {
1861
+ name: 'ReactiveComponent',
1862
+ props: {
1863
+ componentId: types.stringRequired,
1864
+ aggregationField: types.string,
1865
+ aggregationSize: VueTypes.number,
1866
+ size: VueTypes.number,
1867
+ defaultQuery: types.func,
1868
+ customQuery: types.func,
1869
+ filterLabel: types.string,
1870
+ react: types.react,
1871
+ showFilter: VueTypes.bool.def(true),
1872
+ URLParams: VueTypes.bool.def(false),
1873
+ distinctField: types.string,
1874
+ distinctFieldConfig: types.props,
1875
+ index: VueTypes.string,
1876
+ endpoint: types.endpointConfig
1877
+ },
1878
+ created: function created() {
1879
+ var _this = this;
1880
+ var props = this.$props;
1881
+ this.internalComponent = null;
1882
+ this.$defaultQuery = null;
1883
+ // Set custom query in store
1884
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
1885
+ var customQuery = props.customQuery,
1886
+ componentId = props.componentId,
1887
+ filterLabel = props.filterLabel,
1888
+ showFilter = props.showFilter,
1889
+ URLParams = props.URLParams;
1890
+ if (customQuery) {
1891
+ var calcCustomQuery = customQuery(this.selectedValue, props);
1892
+ var query = extractQueryFromCustomQuery(calcCustomQuery);
1893
+ var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery(calcCustomQuery) : null;
1894
+ if (customQueryOptions) {
1895
+ this.setQueryOptions(componentId, _extends({}, customQueryOptions, this.getAggsQuery()), false);
1896
+ } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
1897
+ this.updateQuery({
1898
+ componentId: componentId,
1899
+ query: query,
1900
+ value: this.selectedValue || null,
1901
+ label: filterLabel,
1902
+ showFilter: showFilter,
1903
+ URLParams: URLParams
1904
+ });
1905
+ }
1906
+ this.setQuery = function (_ref) {
1907
+ var options = _ref.options,
1908
+ obj = _objectWithoutPropertiesLoose(_ref, _excluded);
1909
+ var queryToBeSet = obj.query;
1910
+
1911
+ // when enableAppbase is true, Backend throws error because of repeated query in request body
1912
+ if (queryToBeSet && queryToBeSet.query) {
1913
+ queryToBeSet = queryToBeSet.query;
1914
+ }
1915
+ var customQueryCalc = _extends({}, options, {
1916
+ query: queryToBeSet
1917
+ });
1918
+ var rsAPIQuery = customQueryCalc;
1919
+ // handle stored queries
1920
+ if (queryToBeSet && queryToBeSet.id) {
1921
+ rsAPIQuery = queryToBeSet;
1922
+ }
1923
+ // Update customQuery field for RS API
1924
+ _this.setCustomQuery(props.componentId, rsAPIQuery);
1925
+ if (options) {
1926
+ _this.setQueryOptions(props.componentId, _extends({}, _this.getAggsQuery(), options), false);
1927
+ }
1928
+ _this.updateQuery(_extends({}, obj, {
1929
+ query: customQueryCalc.query,
1930
+ componentId: props.componentId,
1931
+ label: props.filterLabel,
1932
+ showFilter: props.showFilter,
1933
+ URLParams: props.URLParams
1934
+ }));
1935
+ };
1936
+ if (props.defaultQuery) {
1937
+ this.internalComponent = props.componentId + "__internal";
1938
+ }
1939
+ if (this.internalComponent && this.$props.defaultQuery) {
1940
+ updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
1941
+ this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
1942
+ var _query = extractQueryFromCustomQuery(this.$defaultQuery);
1943
+ var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
1944
+ if (queryOptions) {
1945
+ this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
1946
+ } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
1947
+ this.updateQuery({
1948
+ componentId: this.internalComponent,
1949
+ query: _query
1950
+ });
1951
+ }
1952
+ },
1953
+ watch: {
1954
+ hits: function hits(newVal, oldVal) {
1955
+ if (!isEqual$1(newVal, oldVal)) {
1956
+ this.$emit('data', this.getData());
1957
+ }
1958
+ },
1959
+ rawData: function rawData(newVal, oldVal) {
1960
+ if (!isEqual$1(newVal, oldVal)) {
1961
+ this.$emit('data', this.getData());
1962
+ }
1963
+ },
1964
+ aggregations: function aggregations(newVal, oldVal) {
1965
+ if (!isEqual$1(newVal, oldVal)) {
1966
+ this.$emit('data', this.getData());
1967
+ }
1968
+ },
1969
+ aggregationData: function aggregationData(newVal, oldVal) {
1970
+ if (!isEqual$1(newVal, oldVal)) {
1971
+ this.$emit('data', this.getData());
1972
+ }
1973
+ },
1974
+ promotedResults: function promotedResults(newVal, oldVal) {
1975
+ if (!isEqual$1(newVal, oldVal)) {
1976
+ this.$emit('data', this.getData());
1977
+ }
1978
+ },
1979
+ hidden: function hidden(newVal, oldVal) {
1980
+ if (!isEqual$1(newVal, oldVal)) {
1981
+ this.$emit('data', this.getData());
1982
+ }
1983
+ },
1984
+ total: function total(newVal, oldVal) {
1985
+ if (!isEqual$1(newVal, oldVal)) {
1986
+ this.$emit('data', this.getData());
1987
+ }
1988
+ },
1989
+ time: function time(newVal, oldVal) {
1990
+ if (!isEqual$1(newVal, oldVal)) {
1991
+ this.$emit('data', this.getData());
1992
+ }
1993
+ },
1994
+ defaultQuery: function defaultQuery(newVal, oldVal) {
1995
+ if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
1996
+ this.$defaultQuery = newVal(this.selectedValue, this.$props);
1997
+ var query = extractQueryFromCustomQuery(this.$defaultQuery);
1998
+ var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
1999
+ if (queryOptions) {
2000
+ this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
2001
+ } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
2002
+ // Update default query for RS API
2003
+ updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
2004
+ this.updateQuery({
2005
+ componentId: this.internalComponent,
2006
+ query: query
2007
+ });
2008
+ }
2009
+ },
2010
+ customQuery: function customQuery(newVal, oldVal) {
2011
+ if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
2012
+ var componentId = this.$props.componentId;
2013
+ this.$customQuery = newVal(this.selectedValue, this.$props);
2014
+ var query = extractQueryFromCustomQuery(this.$customQuery);
2015
+ var queryOptions = getOptionsForCustomQuery(this.$customQuery);
2016
+ if (queryOptions) {
2017
+ this.setQueryOptions(componentId, _extends({}, queryOptions, this.getAggsQuery()), false);
2018
+ } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
2019
+
2020
+ // Update custom query for RS API
2021
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
2022
+ this.updateQuery({
2023
+ componentId: componentId,
2024
+ query: query
2025
+ });
2026
+ }
2027
+ }
2028
+ },
2029
+ render: function render() {
2030
+ try {
2031
+ var dom = this.$slots["default"];
2032
+ var error = this.error,
2033
+ isLoading = this.isLoading,
2034
+ selectedValue = this.selectedValue;
2035
+ var propsToBePassed = _extends({
2036
+ error: error,
2037
+ loading: isLoading
2038
+ }, this.getData(), {
2039
+ value: selectedValue,
2040
+ setQuery: this.setQuery
2041
+ });
2042
+ return createVNode("div", null, [dom(propsToBePassed)]);
2043
+ } catch (e) {
2044
+ return null;
2045
+ }
2046
+ },
2047
+ methods: {
2048
+ getAggsQuery: function getAggsQuery() {
2049
+ if (this.aggregationField) {
2050
+ return {
2051
+ aggs: getCompositeAggsQuery$1({
2052
+ props: this.$props,
2053
+ showTopHits: true,
2054
+ value: this.selectedValue
2055
+ }).aggs
2056
+ };
2057
+ }
2058
+ return {};
2059
+ },
2060
+ getData: function getData() {
2061
+ var hits = this.hits,
2062
+ aggregations = this.aggregations,
2063
+ aggregationData = this.aggregationData,
2064
+ promotedResults = this.promotedResults,
2065
+ rawData = this.rawData;
2066
+ var filteredResults = parseHits(hits);
2067
+ if (promotedResults.length) {
2068
+ var ids = promotedResults.map(function (item) {
2069
+ return item._id;
2070
+ }).filter(Boolean);
2071
+ if (ids) {
2072
+ filteredResults = filteredResults.filter(function (item) {
2073
+ return !ids.includes(item._id);
2074
+ });
2075
+ }
2076
+ filteredResults = [].concat(promotedResults, filteredResults);
2077
+ }
2078
+ return {
2079
+ data: filteredResults,
2080
+ aggregationData: aggregationData,
2081
+ rawData: rawData,
2082
+ aggregations: aggregations,
2083
+ promotedData: promotedResults,
2084
+ resultStats: this.stats
2085
+ };
2086
+ }
2087
+ },
2088
+ computed: {
2089
+ stats: function stats() {
2090
+ return getResultStats$1(this);
2091
+ }
2092
+ }
2093
+ };
2094
+ ReactiveComponent.hasInternalComponent = function (props) {
2095
+ return !!props.defaultQuery;
2096
+ };
2097
+ var mapStateToProps$1 = function mapStateToProps(state, props) {
2098
+ return {
2099
+ aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
2100
+ aggregationData: state.compositeAggregations[props.componentId] || [],
2101
+ hits: state.hits[props.componentId] && state.hits[props.componentId].hits || [],
2102
+ rawData: state.rawData[props.componentId],
2103
+ error: state.error[props.componentId],
2104
+ isLoading: state.isLoading[props.componentId],
2105
+ selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
2106
+ promotedResults: state.promotedResults[props.componentId] || [],
2107
+ time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
2108
+ total: state.hits[props.componentId] && state.hits[props.componentId].total,
2109
+ hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
2110
+ componentProps: state.props[props.componentId]
2111
+ };
2112
+ };
2113
+ var mapDispatchtoProps = {
2114
+ setQueryOptions: setQueryOptions,
2115
+ updateQuery: updateQuery$1,
2116
+ setCustomQuery: setCustomQuery$1,
2117
+ setDefaultQuery: setDefaultQuery$1
2118
+ };
2119
+ var ConnectedComponent = ComponentWrapper(connect(mapStateToProps$1, mapDispatchtoProps)(ReactiveComponent), {
2120
+ componentType: componentTypes.reactiveComponent
2121
+ });
2122
+ var RcConnected = PreferencesConsumer({
2123
+ name: 'RcConnected',
2124
+ render: function render() {
2125
+ var component = ConnectedComponent;
2126
+ switch (this.$attrs.componentType) {
2127
+ case componentTypes.reactiveList:
2128
+ component = RLConnected;
2129
+ break;
2130
+ case componentTypes.searchBox:
2131
+ component = SBConnected;
2132
+ break;
2133
+ // list components
2134
+ case componentTypes.singleList:
2135
+ component = ListConnected$3;
2136
+ break;
2137
+ case componentTypes.multiList:
2138
+ component = ListConnected$2;
2139
+ break;
2140
+ case componentTypes.singleDropdownList:
2141
+ component = ListConnected$1;
2142
+ break;
2143
+ case componentTypes.multiDropdownList:
2144
+ component = ListConnected;
2145
+ break;
2146
+ // basic components
2147
+ case componentTypes.toggleButton:
2148
+ component = TBConnected;
2149
+ break;
2150
+ // range components
2151
+ case componentTypes.dynamicRangeSlider:
2152
+ component = RangeConnected$4;
2153
+ break;
2154
+ case componentTypes.singleRange:
2155
+ component = RangeConnected$3;
2156
+ break;
2157
+ case componentTypes.multiRange:
2158
+ component = RangeConnected$2;
2159
+ break;
2160
+ case componentTypes.rangeSlider:
2161
+ component = RangeConnected$1;
2162
+ break;
2163
+ case componentTypes.rangeInput:
2164
+ component = RangeConnected;
2165
+ break;
2166
+ }
2167
+ return h(component, null, this.$slots);
2168
+ }
2169
+ });
2170
+ RcConnected.name = ReactiveComponent.name;
2171
+ RcConnected.install = function (Vue) {
2172
+ Vue.component(RcConnected.name, RcConnected);
2173
+ };
2174
+
2175
+ // Add componentType for SSR
2176
+ RcConnected.componentType = componentTypes.reactiveComponent;
2177
+
2178
+ export { RcConnected as R, SBConnected as S };