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

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 (108) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +17538 -25422
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +6 -15
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/Button-ad042719.js +59 -0
  6. package/dist/cjs/Card-f5ab024a.js +27 -0
  7. package/dist/cjs/{ComponentWrapper-ad3dad02.js → ComponentWrapper-75f88599.js} +42 -56
  8. package/dist/cjs/Container-29f049b2.js +12 -0
  9. package/dist/cjs/DropDown-6cf84c47.js +698 -0
  10. package/dist/cjs/DynamicRangeSlider.js +103 -155
  11. package/dist/cjs/Flex-d5675ea6.js +48 -0
  12. package/dist/cjs/FormControlList-fadd792f.js +42 -0
  13. package/dist/cjs/Input-4b434436.js +74 -0
  14. package/dist/cjs/ListItem-d57d648d.js +42 -0
  15. package/dist/cjs/MultiDropdownList.js +124 -240
  16. package/dist/cjs/MultiList.js +123 -261
  17. package/dist/cjs/MultiRange.js +87 -133
  18. package/dist/cjs/{Pagination-71e85fa9.js → Pagination-b5ddc906.js} +70 -83
  19. package/dist/cjs/PreferencesConsumer-eb265924.js +75 -0
  20. package/dist/cjs/RangeInput.js +163 -171
  21. package/dist/cjs/RangeSlider.js +81 -109
  22. package/dist/cjs/ReactiveBase.js +139 -157
  23. package/dist/cjs/ReactiveComponent-eb8db4c1.js +2189 -0
  24. package/dist/cjs/ReactiveComponent.js +46 -340
  25. package/dist/cjs/ReactiveGoogleMap.js +445 -655
  26. package/dist/cjs/ReactiveList.js +179 -304
  27. package/dist/cjs/ResultCard.js +36 -36
  28. package/dist/cjs/ResultList.js +48 -56
  29. package/dist/cjs/SelectedFilters.js +62 -69
  30. package/dist/cjs/SingleDropdownList.js +117 -177
  31. package/dist/cjs/SingleList.js +121 -205
  32. package/dist/cjs/SingleRange.js +78 -105
  33. package/dist/cjs/StateProvider.js +35 -38
  34. package/dist/cjs/Title-8802a218.js +12 -0
  35. package/dist/cjs/ToggleButton.js +72 -119
  36. package/dist/cjs/{_rollupPluginBabelHelpers-c705cbe6.js → _rollupPluginBabelHelpers-f8b843f8.js} +0 -15
  37. package/dist/cjs/{index-6a167fe0.js → index-d8d8f291.js} +38 -108
  38. package/dist/cjs/index.js +44 -41
  39. package/dist/cjs/initReactivesearch.js +63 -150
  40. package/dist/cjs/install.js +47 -43
  41. package/dist/cjs/ssr-6907ada3.js +66 -0
  42. package/dist/cjs/{utils-d6a52588.js → utils-83fd01e9.js} +7 -16
  43. package/dist/cjs/version.js +1 -1
  44. package/dist/cjs/{vueTypes-727b7c63.js → vueTypes-1bf00978.js} +8 -19
  45. package/dist/es/Button-474510e3.js +53 -0
  46. package/dist/es/{Card-450683f1.js → Card-38cbe652.js} +3 -3
  47. package/dist/es/{ComponentWrapper-424e86fd.js → ComponentWrapper-5166c76a.js} +42 -56
  48. package/dist/es/{Container-ba826e96.js → Container-d00219f7.js} +2 -2
  49. package/dist/es/DropDown-8764360c.js +688 -0
  50. package/dist/es/DynamicRangeSlider.js +103 -155
  51. package/dist/es/Flex-a08e22d7.js +46 -0
  52. package/dist/es/FormControlList-fe6eaee4.js +38 -0
  53. package/dist/es/Input-4a8ef1f3.js +69 -0
  54. package/dist/es/{ListItem-cad14c5e.js → ListItem-16756c02.js} +7 -8
  55. package/dist/es/MultiDropdownList.js +124 -240
  56. package/dist/es/MultiList.js +123 -261
  57. package/dist/es/MultiRange.js +87 -133
  58. package/dist/es/{Pagination-784bf143.js → Pagination-72bd1d9e.js} +70 -83
  59. package/dist/es/PreferencesConsumer-c276709c.js +73 -0
  60. package/dist/es/RangeInput.js +163 -170
  61. package/dist/es/RangeSlider.js +81 -109
  62. package/dist/es/ReactiveBase.js +138 -155
  63. package/dist/es/ReactiveComponent-f9fa5780.js +2183 -0
  64. package/dist/es/ReactiveComponent.js +42 -337
  65. package/dist/es/ReactiveGoogleMap.js +440 -649
  66. package/dist/es/ReactiveList.js +177 -301
  67. package/dist/es/ResultCard.js +36 -36
  68. package/dist/es/ResultList.js +48 -56
  69. package/dist/es/SelectedFilters.js +62 -69
  70. package/dist/es/SingleDropdownList.js +117 -177
  71. package/dist/es/SingleList.js +121 -205
  72. package/dist/es/SingleRange.js +78 -105
  73. package/dist/es/StateProvider.js +36 -39
  74. package/dist/es/{Title-3342664a.js → Title-863dfa42.js} +2 -2
  75. package/dist/es/ToggleButton.js +72 -119
  76. package/dist/es/{_rollupPluginBabelHelpers-76660dab.js → _rollupPluginBabelHelpers-ded08042.js} +0 -15
  77. package/dist/es/{index-7788a843.js → index-4520a598.js} +39 -107
  78. package/dist/es/index.js +30 -32
  79. package/dist/es/initReactivesearch.js +63 -150
  80. package/dist/es/install.js +49 -41
  81. package/dist/es/{ssr-b2c0b401.js → ssr-af398f0c.js} +36 -7
  82. package/dist/es/{utils-9e68acee.js → utils-9e5a16a1.js} +7 -16
  83. package/dist/es/version.js +1 -1
  84. package/dist/es/{vueTypes-b8146772.js → vueTypes-f1923c72.js} +8 -19
  85. package/package.json +10 -9
  86. package/dist/cjs/Button-446f819e.js +0 -68
  87. package/dist/cjs/CancelSvg-9f258f4f.js +0 -449
  88. package/dist/cjs/Card-642547a8.js +0 -30
  89. package/dist/cjs/Container-daf30918.js +0 -15
  90. package/dist/cjs/DataSearch-aa04dc6e.js +0 -2352
  91. package/dist/cjs/DataSearch.js +0 -30
  92. package/dist/cjs/DropDown-c479bbb0.js +0 -328
  93. package/dist/cjs/Flex-aa517a13.js +0 -52
  94. package/dist/cjs/FormControlList-c195a592.js +0 -47
  95. package/dist/cjs/Input-e6603a7e.js +0 -79
  96. package/dist/cjs/ListItem-8c9e0d68.js +0 -46
  97. package/dist/cjs/Title-1de7d0f4.js +0 -15
  98. package/dist/cjs/install-b97dbac4.js +0 -1409
  99. package/dist/cjs/ssr-3027b848.js +0 -39
  100. package/dist/es/Button-d8bc15ea.js +0 -59
  101. package/dist/es/CancelSvg-4cfae5fd.js +0 -440
  102. package/dist/es/DataSearch-b86a6675.js +0 -2337
  103. package/dist/es/DataSearch.js +0 -22
  104. package/dist/es/DropDown-05a644a5.js +0 -322
  105. package/dist/es/Flex-1f0795c3.js +0 -47
  106. package/dist/es/FormControlList-c22d64f6.js +0 -40
  107. package/dist/es/Input-7a2a9fac.js +0 -71
  108. package/dist/es/install-ac8a1edb.js +0 -1402
@@ -0,0 +1,2183 @@
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-5166c76a.js';
15
+ import { P as PreferencesConsumer } from './PreferencesConsumer-c276709c.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-8764360c.js';
20
+ import { n as noSuggestions, s as suggestionsContainer, I as Input, a as suggestions } from './Input-4a8ef1f3.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
+ theme: types.style,
853
+ URLParams: VueTypes.bool.def(false),
854
+ strictSelection: VueTypes.bool.def(false),
855
+ nestedField: types.string,
856
+ enablePredictiveSuggestions: VueTypes.bool.def(false),
857
+ recentSearchesIcon: VueTypes.any,
858
+ popularSearchesIcon: VueTypes.any,
859
+ // mic props
860
+ showVoiceSearch: VueTypes.bool.def(false),
861
+ getMicInstance: types.func,
862
+ renderMic: types.func,
863
+ distinctField: types.string,
864
+ distinctFieldConfig: types.props,
865
+ //
866
+ focusShortcuts: VueTypes.arrayOf(VueTypes.oneOfType([VueTypes.string, VueTypes.number])).def(['/']),
867
+ addonBefore: VueTypes.any,
868
+ addonAfter: VueTypes.any,
869
+ expandSuggestionsContainer: VueTypes.bool.def(true),
870
+ index: VueTypes.string,
871
+ popularSuggestionsConfig: VueTypes.object,
872
+ recentSuggestionsConfig: VueTypes.object,
873
+ applyStopwords: VueTypes.bool,
874
+ customStopwords: types.stringArray,
875
+ onData: types.func,
876
+ renderItem: types.func,
877
+ enterButton: VueTypes.bool.def(false),
878
+ renderEnterButton: VueTypes.any,
879
+ mode: VueTypes.oneOf(['select', 'tag']).def('select'),
880
+ renderSelectedTags: VueTypes.any,
881
+ searchboxId: VueTypes.string,
882
+ endpoint: types.endpointConfig
883
+ },
884
+ beforeMount: function beforeMount() {
885
+ if (this.selectedValue) {
886
+ this.setValue(this.selectedValue, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined);
887
+ } else if (this.$props.value) {
888
+ this.setValue(this.$props.value, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined);
889
+ } else if (this.$props.defaultValue) {
890
+ this.setValue(this.$props.defaultValue, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined);
891
+ }
892
+ },
893
+ mounted: function mounted() {
894
+ this.listenForFocusShortcuts();
895
+ },
896
+ watch: {
897
+ dataField: function dataField(newVal, oldVal) {
898
+ if (!isEqual(newVal, oldVal)) {
899
+ this.triggerCustomQuery(this.$data.currentValue);
900
+ }
901
+ },
902
+ fieldWeights: function fieldWeights() {
903
+ this.triggerCustomQuery(this.$data.currentValue);
904
+ },
905
+ fuzziness: function fuzziness() {
906
+ this.triggerCustomQuery(this.$data.currentValue);
907
+ },
908
+ queryFormat: function queryFormat() {
909
+ this.triggerCustomQuery(this.$data.currentValue);
910
+ },
911
+ defaultValue: function defaultValue(newVal) {
912
+ this.setValue(newVal, true, this.$props);
913
+ },
914
+ value: function value(newVal, oldVal) {
915
+ if (!isEqual(newVal, oldVal)) {
916
+ this.setValue(newVal, true, this.$props, newVal === '' ? causes.CLEAR_VALUE : undefined, false);
917
+ }
918
+ },
919
+ defaultQuery: function defaultQuery(newVal, oldVal) {
920
+ if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
921
+ this.triggerDefaultQuery(this.$data.currentValue);
922
+ }
923
+ },
924
+ customQuery: function customQuery(newVal, oldVal) {
925
+ if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
926
+ this.triggerCustomQuery(this.$data.currentValue);
927
+ }
928
+ },
929
+ suggestions: function suggestions(newVal) {
930
+ var suggestionsList = [];
931
+ if (Array.isArray(newVal) && newVal.length) {
932
+ suggestionsList = [].concat(withClickIds(newVal));
933
+ } else if (Array.isArray(this.$props.defaultSuggestions) && this.$props.defaultSuggestions.length) {
934
+ suggestionsList = [].concat(withClickIds(this.$props.defaultSuggestions));
935
+ }
936
+ this.normalizedSuggestions = suggestionsList;
937
+ },
938
+ selectedValue: function selectedValue(newVal, oldVal) {
939
+ if (!isEqual(newVal, oldVal) && (this.$options.isTagsMode ? !isEqual(this.$data.selectedTags, newVal) : this.$data.currentValue !== newVal)) {
940
+ if (!newVal && this.$data.currentValue) {
941
+ // selected value is cleared, call onValueSelected
942
+ this.onValueSelectedHandler('', causes.CLEAR_VALUE);
943
+ }
944
+ if (this.$options.isTagsMode) {
945
+ // handling reset of tags through SelectedFilters or URL
946
+ this.selectedTags = [];
947
+ }
948
+ var cause = !newVal ? causes.CLEAR_VALUE : undefined;
949
+ if (this.$options.isTagsMode) {
950
+ cause = causes.SUGGESTION_SELECT;
951
+ }
952
+ this.setValue(newVal || '', true, this.$props, cause);
953
+ }
954
+ },
955
+ focusShortcuts: function focusShortcuts() {
956
+ this.listenForFocusShortcuts();
957
+ },
958
+ rawData: function rawData(newVal) {
959
+ this.$emit('on-data', {
960
+ data: this.normalizedSuggestions,
961
+ rawData: newVal,
962
+ aggregationData: this.aggregationData,
963
+ loading: this.isLoading,
964
+ error: this.isError
965
+ });
966
+ },
967
+ aggregationData: function aggregationData(newVal) {
968
+ this.$emit('on-data', {
969
+ data: this.normalizedSuggestions,
970
+ rawData: this.rawData,
971
+ aggregationData: newVal,
972
+ loading: this.isLoading,
973
+ error: this.isError
974
+ });
975
+ },
976
+ loading: function loading(newVal) {
977
+ this.$emit('on-data', {
978
+ data: this.normalizedSuggestions,
979
+ rawData: this.rawData,
980
+ aggregationData: this.aggregationData,
981
+ loading: newVal,
982
+ error: this.isError
983
+ });
984
+ },
985
+ error: function error(newVal) {
986
+ this.$emit('on-data', {
987
+ data: this.normalizedSuggestions,
988
+ rawData: this.rawData,
989
+ aggregationData: this.aggregationData,
990
+ loading: this.isLoading,
991
+ error: newVal
992
+ });
993
+ },
994
+ debounce: function debounce(newVal, oldVal) {
995
+ if (!isEqual(newVal, oldVal)) {
996
+ this.handleTextChange = _debounce(this.handleText, newVal);
997
+ }
998
+ }
999
+ },
1000
+ methods: {
1001
+ handleText: function handleText(value, cause) {
1002
+ if (cause === causes.CLEAR_VALUE) {
1003
+ this.triggerCustomQuery(value);
1004
+ this.triggerDefaultQuery(value);
1005
+ } else if (this.$props.autosuggest) {
1006
+ this.triggerDefaultQuery(value);
1007
+ } else if (!this.$props.enterButton) {
1008
+ this.triggerCustomQuery(value);
1009
+ }
1010
+ },
1011
+ getComponent: function getComponent$1(downshiftProps) {
1012
+ if (downshiftProps === void 0) {
1013
+ downshiftProps = {};
1014
+ }
1015
+ var currentValue = this.$data.currentValue;
1016
+ var data = {
1017
+ error: this.error,
1018
+ loading: this.isLoading,
1019
+ downshiftProps: downshiftProps,
1020
+ data: this.normalizedSuggestions,
1021
+ rawData: this.rawData,
1022
+ value: currentValue,
1023
+ resultStats: this.stats
1024
+ };
1025
+ return getComponent(data, this);
1026
+ },
1027
+ // returns size and aggs property
1028
+ getBasicQueryOptions: function getBasicQueryOptions() {
1029
+ var aggregationField = this.$props.aggregationField;
1030
+ var queryOptions = getQueryOptions(this.$props);
1031
+ if (aggregationField) {
1032
+ queryOptions.aggs = getCompositeAggsQuery({
1033
+ props: this.$props,
1034
+ showTopHits: true
1035
+ }).aggs;
1036
+ }
1037
+ return queryOptions;
1038
+ },
1039
+ handleSearchIconClick: function handleSearchIconClick() {
1040
+ var currentValue = this.currentValue;
1041
+ if (currentValue.trim()) {
1042
+ this.setValue(currentValue, true);
1043
+ this.onValueSelectedHandler(currentValue, causes.SEARCH_ICON_CLICK);
1044
+ }
1045
+ },
1046
+ setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue) {
1047
+ var _this = this;
1048
+ if (isDefaultValue === void 0) {
1049
+ isDefaultValue = false;
1050
+ }
1051
+ if (props === void 0) {
1052
+ props = this.$props;
1053
+ }
1054
+ if (toggleIsOpen === void 0) {
1055
+ toggleIsOpen = true;
1056
+ }
1057
+ if (categoryValue === void 0) {
1058
+ categoryValue = undefined;
1059
+ }
1060
+ var performUpdate = function performUpdate() {
1061
+ if (_this.$options.isTagsMode && isEqual(value, _this.selectedTags)) {
1062
+ return;
1063
+ }
1064
+ if (_this.$options.isTagsMode && cause === causes.SUGGESTION_SELECT) {
1065
+ if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
1066
+ // check if value already present in selectedTags
1067
+ if (typeof value === 'string' && _this.selectedTags.includes(value)) {
1068
+ _this.isOpen = false;
1069
+ return;
1070
+ }
1071
+ _this.selectedTags = [].concat(_this.selectedTags);
1072
+ if (typeof value === 'string' && !!value) {
1073
+ _this.selectedTags.push(value);
1074
+ } else if (Array.isArray(value) && !isEqual(_this.selectedTags, value)) {
1075
+ _this.selectedTags = value;
1076
+ }
1077
+ } else if (value) {
1078
+ _this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
1079
+ }
1080
+ _this.currentValue = '';
1081
+ } else {
1082
+ _this.currentValue = decodeHtml(value);
1083
+ }
1084
+ var queryHandlerValue = value;
1085
+ if (_this.$options.isTagsMode && cause === causes.SUGGESTION_SELECT) {
1086
+ queryHandlerValue = Array.isArray(_this.selectedTags) && _this.selectedTags.length ? _this.selectedTags : undefined;
1087
+ }
1088
+ if (isDefaultValue) {
1089
+ if (_this.$props.autosuggest) {
1090
+ if (toggleIsOpen) {
1091
+ _this.isOpen = false;
1092
+ }
1093
+ if (typeof _this.currentValue === 'string') _this.triggerDefaultQuery(_this.currentValue);
1094
+ } // in case of strict selection only SUGGESTION_SELECT should be able
1095
+ // to set the query otherwise the value should reset
1096
+ if (props.strictSelection) {
1097
+ if (cause === causes.SUGGESTION_SELECT || (_this.$options.isTagsMode ? _this.selectedTags.length === 0 : value === '')) {
1098
+ _this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
1099
+ } else {
1100
+ _this.setValue('', true);
1101
+ }
1102
+ } else if (props.value === undefined || cause === causes.SUGGESTION_SELECT || cause === causes.CLEAR_VALUE) {
1103
+ _this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
1104
+ }
1105
+ } else {
1106
+ // debounce for handling text while typing
1107
+ _this.handleTextChange(value, cause);
1108
+ }
1109
+ _this.$emit('valueChange', value);
1110
+ _this.$emit('value-change', value);
1111
+ };
1112
+ checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
1113
+ },
1114
+ triggerDefaultQuery: function triggerDefaultQuery(paramValue) {
1115
+ if (!this.$props.autosuggest) {
1116
+ return;
1117
+ }
1118
+ var value = typeof paramValue !== 'string' ? this.currentValue : paramValue;
1119
+ var query = SearchBox.defaultQuery(value, this.$props);
1120
+ if (this.defaultQuery) {
1121
+ var defaultQueryToBeSet = this.defaultQuery(value, this.$props) || {};
1122
+ if (defaultQueryToBeSet.query) {
1123
+ query = defaultQueryToBeSet.query;
1124
+ }
1125
+
1126
+ // Update calculated default query in store
1127
+ updateDefaultQuery(this.$props.componentId, this.setDefaultQuery, this.$props, value);
1128
+ }
1129
+ this.updateQuery({
1130
+ componentId: this.internalComponent,
1131
+ query: query,
1132
+ value: value,
1133
+ componentType: componentTypes.searchBox
1134
+ });
1135
+ },
1136
+ triggerCustomQuery: function triggerCustomQuery(paramValue, categoryValue) {
1137
+ if (categoryValue === void 0) {
1138
+ categoryValue = undefined;
1139
+ }
1140
+ var _this$$props = this.$props,
1141
+ customQuery = _this$$props.customQuery,
1142
+ filterLabel = _this$$props.filterLabel,
1143
+ showFilter = _this$$props.showFilter,
1144
+ URLParams = _this$$props.URLParams;
1145
+ var value = typeof paramValue !== 'string' ? this.$data.currentValue : paramValue;
1146
+ if (this.$options.isTagsMode) {
1147
+ value = paramValue;
1148
+ }
1149
+ var defaultQueryTobeSet = SearchBox.defaultQuery("" + value + (categoryValue ? " in " + categoryValue : ''), this.$props);
1150
+ var query = defaultQueryTobeSet;
1151
+ if (customQuery) {
1152
+ var customQueryTobeSet = customQuery(value, this.$props);
1153
+ var queryTobeSet = customQueryTobeSet.query;
1154
+ if (queryTobeSet) {
1155
+ query = queryTobeSet;
1156
+ }
1157
+ updateCustomQuery(this.$props.componentId, this.setCustomQuery, this.$props, value);
1158
+ }
1159
+ this.updateQuery({
1160
+ componentId: this.$props.componentId,
1161
+ query: query,
1162
+ value: value,
1163
+ label: filterLabel,
1164
+ showFilter: showFilter,
1165
+ URLParams: URLParams,
1166
+ componentType: componentTypes.searchBox,
1167
+ category: categoryValue
1168
+ });
1169
+ },
1170
+ handleFocus: function handleFocus(event) {
1171
+ if (this.$props.autosuggest) {
1172
+ this.isOpen = true;
1173
+ }
1174
+ this.$emit('focus', event);
1175
+ },
1176
+ handleVoiceResults: function handleVoiceResults(_ref) {
1177
+ var results = _ref.results;
1178
+ if (results && results[0] && results[0].isFinal && results[0][0] && results[0][0].transcript && results[0][0].transcript.trim()) {
1179
+ this.setValue(results[0][0].transcript.trim(), true);
1180
+ }
1181
+ },
1182
+ triggerQuery: function triggerQuery(_ref2) {
1183
+ var _ref2$isOpen = _ref2.isOpen,
1184
+ isOpen = _ref2$isOpen === void 0 ? undefined : _ref2$isOpen,
1185
+ _ref2$customQuery = _ref2.customQuery,
1186
+ customQuery = _ref2$customQuery === void 0 ? true : _ref2$customQuery,
1187
+ _ref2$defaultQuery = _ref2.defaultQuery,
1188
+ defaultQuery = _ref2$defaultQuery === void 0 ? true : _ref2$defaultQuery,
1189
+ _ref2$value = _ref2.value,
1190
+ value = _ref2$value === void 0 ? undefined : _ref2$value,
1191
+ _ref2$categoryValue = _ref2.categoryValue,
1192
+ categoryValue = _ref2$categoryValue === void 0 ? undefined : _ref2$categoryValue;
1193
+ if (typeof isOpen === 'boolean') {
1194
+ this.isOpen = isOpen;
1195
+ }
1196
+ if (customQuery) {
1197
+ this.triggerCustomQuery(value, categoryValue);
1198
+ }
1199
+ if (defaultQuery) {
1200
+ this.triggerDefaultQuery(value);
1201
+ }
1202
+ },
1203
+ triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
1204
+ // click analytics would only work client side and after javascript loads
1205
+ var docId = documentId;
1206
+ if (!docId) {
1207
+ var hitData = this.normalizedSuggestions.find(function (hit) {
1208
+ return hit._click_id === searchPosition;
1209
+ });
1210
+ if (hitData && hitData.source && hitData.source._id) {
1211
+ docId = hitData.source._id;
1212
+ }
1213
+ }
1214
+ this.recordSuggestionClick(searchPosition, docId);
1215
+ },
1216
+ clearValue: function clearValue() {
1217
+ this.setValue('', false, this.$props, causes.CLEAR_VALUE, false);
1218
+ this.onValueSelectedHandler('', causes.CLEAR_VALUE);
1219
+ },
1220
+ handleKeyDown: function handleKeyDown(event, highlightedIndex) {
1221
+ if (highlightedIndex === void 0) {
1222
+ highlightedIndex = null;
1223
+ }
1224
+ // if a suggestion was selected, delegate the handling to suggestion handler
1225
+ if (event.key === 'Enter') {
1226
+ if (this.$props.autosuggest === false) {
1227
+ this.enterButtonOnClick();
1228
+ } else if (highlightedIndex === null) {
1229
+ this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined // to handle tags
1230
+ );
1231
+
1232
+ this.onValueSelectedHandler(event.target.value, causes.ENTER_PRESS);
1233
+ }
1234
+ }
1235
+
1236
+ // Need to review
1237
+ this.$emit('keyDown', event, this.triggerQuery);
1238
+ this.$emit('key-down', event, this.triggerQuery);
1239
+ },
1240
+ onInputChange: function onInputChange(e) {
1241
+ var _this2 = this;
1242
+ var inputValue = e.target.value;
1243
+ if (!this.$data.isOpen && this.$props.autosuggest) {
1244
+ this.isOpen = true;
1245
+ }
1246
+ var value = this.$props.value;
1247
+ if (value === undefined) {
1248
+ this.setValue(inputValue, false, this.$props, inputValue === '' ? causes.CLEAR_VALUE : undefined);
1249
+ } else {
1250
+ this.$emit('change', inputValue, function (_ref3) {
1251
+ var isOpen = _ref3.isOpen;
1252
+ return _this2.triggerQuery({
1253
+ defaultQuery: true,
1254
+ customQuery: true,
1255
+ value: inputValue,
1256
+ isOpen: isOpen
1257
+ });
1258
+ }, e);
1259
+ }
1260
+ },
1261
+ onSuggestionSelected: function onSuggestionSelected(suggestion) {
1262
+ var _this3 = this;
1263
+ this.isOpen = false;
1264
+ var value = this.$props.value;
1265
+ // Record analytics for selected suggestions
1266
+ this.triggerClickAnalytics(suggestion._click_id);
1267
+ if (value === undefined) {
1268
+ this.setValue(suggestion.value, true, this.$props, causes.SUGGESTION_SELECT, false, suggestion._category);
1269
+ } else {
1270
+ var emitValue = suggestion.value;
1271
+ if (this.$options.isTagsMode) {
1272
+ emitValue = Array.isArray(this.selectedTags) ? [].concat(this.selectedTags) : [];
1273
+ if (this.selectedTags.includes(suggestion.value)) {
1274
+ // avoid duplicates in tags array
1275
+ this.isOpen = false;
1276
+ return;
1277
+ }
1278
+ emitValue.push(suggestion.value);
1279
+ }
1280
+ this.setValue(emitValue, true, this.$props, causes.SUGGESTION_SELECT, false, suggestion._category);
1281
+ this.$emit('change', emitValue, function (_ref4) {
1282
+ var isOpen = _ref4.isOpen;
1283
+ return _this3.triggerQuery(_extends({
1284
+ isOpen: isOpen,
1285
+ value: emitValue
1286
+ }, !_this3.$options.isTagsMode && {
1287
+ categoryValue: suggestion._category
1288
+ }));
1289
+ });
1290
+ }
1291
+ this.onValueSelectedHandler(suggestion.value, causes.SUGGESTION_SELECT, suggestion.source);
1292
+ },
1293
+ onValueSelectedHandler: function onValueSelectedHandler(currentValue) {
1294
+ if (currentValue === void 0) {
1295
+ currentValue = this.$data.currentValue;
1296
+ }
1297
+ for (var _len = arguments.length, cause = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1298
+ cause[_key - 1] = arguments[_key];
1299
+ }
1300
+ this.$emit.apply(this, ['valueSelected', currentValue].concat(cause));
1301
+ this.$emit.apply(this, ['value-selected', currentValue].concat(cause));
1302
+ },
1303
+ handleStateChange: function handleStateChange(changes) {
1304
+ var isOpen = changes.isOpen;
1305
+ this.isOpen = isOpen;
1306
+ },
1307
+ getBackgroundColor: function getBackgroundColor(highlightedIndex, index) {
1308
+ var isDark = this.themePreset === 'dark';
1309
+ if (isDark) {
1310
+ return highlightedIndex === index ? '#555' : '#424242';
1311
+ }
1312
+ return highlightedIndex === index ? '#eee' : '#fff';
1313
+ },
1314
+ renderIcon: function renderIcon() {
1315
+ if (this.$props.showIcon) {
1316
+ return this.$props.icon || createVNode(SearchSvg, null, null);
1317
+ }
1318
+ return null;
1319
+ },
1320
+ renderErrorComponent: function renderErrorComponent() {
1321
+ var _this4 = this;
1322
+ var renderError = this.$slots.renderError || this.$props.renderError;
1323
+ if (this.error && renderError && this.$data.currentValue && !this.isLoading) {
1324
+ return createVNode(SuggestionWrapper, {
1325
+ "innerClass": this.$props.innerClass,
1326
+ "innerClassName": "error",
1327
+ "theme": this.theme,
1328
+ "themePreset": this.themePreset
1329
+ }, {
1330
+ "default": function _default() {
1331
+ return [isFunction(renderError) ? renderError(_this4.error) : renderError];
1332
+ }
1333
+ });
1334
+ }
1335
+ return null;
1336
+ },
1337
+ renderCancelIcon: function renderCancelIcon() {
1338
+ if (this.$props.showClear) {
1339
+ return this.$props.clearIcon || createVNode(CancelSvg, null, null);
1340
+ }
1341
+ return null;
1342
+ },
1343
+ renderNoSuggestions: function renderNoSuggestions(finalSuggestionsList) {
1344
+ if (finalSuggestionsList === void 0) {
1345
+ finalSuggestionsList = [];
1346
+ }
1347
+ var _this$$props2 = this.$props,
1348
+ theme = _this$$props2.theme,
1349
+ innerClass = _this$$props2.innerClass;
1350
+ var renderNoSuggestion = this.$slots.renderNoSuggestion || this.$props.renderNoSuggestion;
1351
+ var renderError = this.$slots.renderError || this.$props.renderError;
1352
+ var _this$$data = this.$data,
1353
+ isOpen = _this$$data.isOpen,
1354
+ currentValue = _this$$data.currentValue;
1355
+ if (renderNoSuggestion && isOpen && !finalSuggestionsList.length && !this.isLoading && currentValue && !(renderError && this.error)) {
1356
+ return createVNode(SuggestionWrapper, {
1357
+ "innerClass": innerClass,
1358
+ "themePreset": this.themePreset,
1359
+ "theme": theme,
1360
+ "innerClassName": "noSuggestion"
1361
+ }, {
1362
+ "default": function _default() {
1363
+ return typeof renderNoSuggestion === 'function' ? renderNoSuggestion(currentValue) : renderNoSuggestion;
1364
+ }
1365
+ });
1366
+ }
1367
+ return null;
1368
+ },
1369
+ renderInputAddonBefore: function renderInputAddonBefore() {
1370
+ var addonBefore = this.$slots.addonBefore;
1371
+ if (addonBefore) {
1372
+ var _slot;
1373
+ return createVNode(InputAddon, {
1374
+ "class": "addon-before"
1375
+ }, _isSlot(_slot = addonBefore()) ? _slot : {
1376
+ "default": function _default() {
1377
+ return [_slot];
1378
+ }
1379
+ });
1380
+ }
1381
+ return null;
1382
+ },
1383
+ renderInputAddonAfter: function renderInputAddonAfter() {
1384
+ var addonAfter = this.$slots.addonAfter;
1385
+ if (addonAfter) {
1386
+ var _slot2;
1387
+ return createVNode(InputAddon, {
1388
+ "class": "addon-after"
1389
+ }, _isSlot(_slot2 = addonAfter()) ? _slot2 : {
1390
+ "default": function _default() {
1391
+ return [_slot2];
1392
+ }
1393
+ });
1394
+ }
1395
+ return null;
1396
+ },
1397
+ enterButtonOnClick: function enterButtonOnClick() {
1398
+ this.triggerQuery({
1399
+ isOpen: false,
1400
+ value: this.currentValue,
1401
+ customQuery: true
1402
+ });
1403
+ },
1404
+ renderEnterButtonElement: function renderEnterButtonElement() {
1405
+ var _this5 = this;
1406
+ var _this$$props3 = this.$props,
1407
+ enterButton = _this$$props3.enterButton,
1408
+ innerClass = _this$$props3.innerClass;
1409
+ var renderEnterButton = this.$slots.renderEnterButton;
1410
+ if (enterButton) {
1411
+ var getEnterButtonMarkup = function getEnterButtonMarkup() {
1412
+ if (renderEnterButton) {
1413
+ return renderEnterButton(_this5.enterButtonOnClick);
1414
+ }
1415
+ return createVNode(Button, {
1416
+ "class": "enter-btn " + getClassName$1(innerClass, 'enter-button'),
1417
+ "primary": true,
1418
+ "onClick": _this5.enterButtonOnClick
1419
+ }, {
1420
+ "default": function _default() {
1421
+ return [createTextVNode("Search")];
1422
+ }
1423
+ });
1424
+ };
1425
+ return createVNode("div", {
1426
+ "class": "enter-button-wrapper"
1427
+ }, [getEnterButtonMarkup()]);
1428
+ }
1429
+ return null;
1430
+ },
1431
+ renderIcons: function renderIcons() {
1432
+ var _this6 = this;
1433
+ var _slot3, _slot4, _slot5;
1434
+ var _this$$props4 = this.$props,
1435
+ iconPosition = _this$$props4.iconPosition,
1436
+ showClear = _this$$props4.showClear,
1437
+ innerClass = _this$$props4.innerClass,
1438
+ getMicInstance = _this$$props4.getMicInstance,
1439
+ showVoiceSearch = _this$$props4.showVoiceSearch,
1440
+ showIcon = _this$$props4.showIcon;
1441
+ var renderMic = this.$slots.renderMic || this.$props.renderMic;
1442
+ var currentValue = this.$data.currentValue;
1443
+ return createVNode("div", null, [createVNode(IconGroup, {
1444
+ "groupPosition": "right",
1445
+ "positionType": "absolute"
1446
+ }, {
1447
+ "default": function _default() {
1448
+ return [currentValue && showClear && createVNode(IconWrapper, {
1449
+ "onClick": _this6.clearValue,
1450
+ "showIcon": showIcon,
1451
+ "isClearIcon": true
1452
+ }, _isSlot(_slot3 = _this6.renderCancelIcon()) ? _slot3 : {
1453
+ "default": function _default() {
1454
+ return [_slot3];
1455
+ }
1456
+ }), showVoiceSearch && createVNode(Mic, {
1457
+ "getInstance": getMicInstance,
1458
+ "render": renderMic,
1459
+ "handleResult": _this6.handleVoiceResults,
1460
+ "className": getClassName$1(innerClass, 'mic') || null
1461
+ }, null), iconPosition === 'right' && showIcon && createVNode(IconWrapper, {
1462
+ "onClick": _this6.handleSearchIconClick
1463
+ }, _isSlot(_slot4 = _this6.renderIcon()) ? _slot4 : {
1464
+ "default": function _default() {
1465
+ return [_slot4];
1466
+ }
1467
+ })];
1468
+ }
1469
+ }), createVNode(IconGroup, {
1470
+ "groupPosition": "left",
1471
+ "positionType": "absolute"
1472
+ }, {
1473
+ "default": function _default() {
1474
+ return [iconPosition === 'left' && showIcon && createVNode(IconWrapper, {
1475
+ "onClick": _this6.handleSearchIconClick
1476
+ }, _isSlot(_slot5 = _this6.renderIcon()) ? _slot5 : {
1477
+ "default": function _default() {
1478
+ return [_slot5];
1479
+ }
1480
+ })];
1481
+ }
1482
+ })]);
1483
+ },
1484
+ focusSearchBox: function focusSearchBox(event) {
1485
+ var _this$$refs, _this$$refs$this$$pro;
1486
+ var elt = event.target || event.srcElement;
1487
+ var tagName = elt.tagName;
1488
+ if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
1489
+ // already in an input
1490
+ return;
1491
+ }
1492
+ (_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
1493
+ },
1494
+ listenForFocusShortcuts: function listenForFocusShortcuts() {
1495
+ var _this7 = this;
1496
+ var _this$$props$focusSho = this.$props.focusShortcuts,
1497
+ focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
1498
+ if (isEmpty(focusShortcuts)) {
1499
+ return;
1500
+ }
1501
+ var shortcutsString = parseFocusShortcuts(focusShortcuts).join(',');
1502
+
1503
+ // handler for alphabets and other key combinations
1504
+ hotkeys(shortcutsString,
1505
+ // eslint-disable-next-line no-unused-vars
1506
+ /* eslint-disable no-shadow */
1507
+ function (event, handler) {
1508
+ // Prevent the default refresh event under WINDOWS system
1509
+ event.preventDefault();
1510
+ _this7.focusSearchBox(event);
1511
+ });
1512
+
1513
+ // if one of modifier keys are used, they are handled below
1514
+ hotkeys('*', function (event) {
1515
+ var modifierKeys = extractModifierKeysFromFocusShortcuts(focusShortcuts);
1516
+ if (modifierKeys.length === 0) return;
1517
+ for (var index = 0; index < modifierKeys.length; index += 1) {
1518
+ var element = modifierKeys[index];
1519
+ if (hotkeys[element]) {
1520
+ _this7.focusSearchBox(event);
1521
+ break;
1522
+ }
1523
+ }
1524
+ });
1525
+ },
1526
+ onAutofillClick: function onAutofillClick(suggestion) {
1527
+ var value = suggestion.value;
1528
+ this.isOpen = true;
1529
+ this.currentValue = decodeHtml(value);
1530
+ this.triggerDefaultQuery(value);
1531
+ },
1532
+ renderAutoFill: function renderAutoFill(suggestion) {
1533
+ var _this8 = this;
1534
+ var handleAutoFillClick = function handleAutoFillClick(e) {
1535
+ e.stopPropagation();
1536
+ _this8.onAutofillClick(suggestion);
1537
+ };
1538
+ /* 👇 avoid showing autofill for category suggestions👇 */
1539
+ return suggestion._category ? null : createVNode(AutoFillSvg, {
1540
+ "onClick": handleAutoFillClick
1541
+ }, null);
1542
+ },
1543
+ renderTag: function renderTag(item) {
1544
+ var _this9 = this;
1545
+ var innerClass = this.$props.innerClass;
1546
+ return createVNode(TagItem, {
1547
+ "class": getClassName$1(innerClass, 'selected-tag') || ''
1548
+ }, {
1549
+ "default": function _default() {
1550
+ return [createVNode("span", null, [item]), createVNode("span", {
1551
+ "role": "img",
1552
+ "aria-label": "delete-tag",
1553
+ "class": "close-icon",
1554
+ "onClick": function onClick() {
1555
+ return _this9.clearTag(item);
1556
+ }
1557
+ }, [createVNode(CancelSvg, null, null)])];
1558
+ }
1559
+ });
1560
+ },
1561
+ clearAllTags: function clearAllTags() {
1562
+ this.selectedTags = [];
1563
+ this.setValue('', true, this.$props, causes.SUGGESTION_SELECT);
1564
+ if (this.$props.value !== undefined) {
1565
+ this.$emit('change', this.selectedTags, this.triggerQuery);
1566
+ }
1567
+ },
1568
+ clearTag: function clearTag(tagValue) {
1569
+ this.selectedTags = [].concat(this.selectedTags.filter(function (tag) {
1570
+ return tag !== tagValue;
1571
+ }));
1572
+ this.setValue('', true, this.$props, causes.SUGGESTION_SELECT);
1573
+ if (this.$props.value !== undefined) {
1574
+ this.$emit('change', this.selectedTags, this.triggerQuery);
1575
+ }
1576
+ },
1577
+ renderTags: function renderTags() {
1578
+ var _this10 = this;
1579
+ if (!Array.isArray(this.selectedTags)) {
1580
+ return null;
1581
+ }
1582
+ var tagsList = [].concat(this.selectedTags);
1583
+ var shouldRenderClearAllTag = tagsList.length > 1;
1584
+ var renderSelectedTags = this.$slots.renderSelectedTags || this.$props.renderSelectedTags;
1585
+ return renderSelectedTags ? renderSelectedTags({
1586
+ values: this.selectedTags,
1587
+ handleClear: this.clearTag,
1588
+ handleClearAll: this.clearAllTags
1589
+ }) : createVNode(TagsContainer, null, {
1590
+ "default": function _default() {
1591
+ return [tagsList.map(function (item) {
1592
+ return _this10.renderTag(item);
1593
+ }), shouldRenderClearAllTag && createVNode(TagItem, {
1594
+ "class": getClassName$1(_this10.$props.innerClass, 'selected-tag') || ''
1595
+ }, {
1596
+ "default": function _default() {
1597
+ return [createVNode("span", null, [createTextVNode("Clear All")]), createVNode("span", {
1598
+ "role": "img",
1599
+ "aria-label": "delete-tag",
1600
+ "class": "close-icon",
1601
+ "onClick": _this10.clearAllTags
1602
+ }, [createVNode(CancelSvg, null, null)])];
1603
+ }
1604
+ })];
1605
+ }
1606
+ });
1607
+ }
1608
+ },
1609
+ render: function render() {
1610
+ var _this11 = this;
1611
+ var _this$$props5 = this.$props,
1612
+ theme = _this$$props5.theme,
1613
+ expandSuggestionsContainer = _this$$props5.expandSuggestionsContainer;
1614
+ var _this$$slots = this.$slots,
1615
+ recentSearchesIcon = _this$$slots.recentSearchesIcon,
1616
+ popularSearchesIcon = _this$$slots.popularSearchesIcon;
1617
+ var hasSuggestions = Array.isArray(this.normalizedSuggestions) && this.normalizedSuggestions.length;
1618
+ var renderItem = this.$slots.renderItem || this.$props.renderItem;
1619
+ return createVNode(Container, {
1620
+ "class": this.$props.className
1621
+ }, {
1622
+ "default": function _default() {
1623
+ return [_this11.$props.title && createVNode(Title, {
1624
+ "class": getClassName$1(_this11.$props.innerClass, 'title') || ''
1625
+ }, {
1626
+ "default": function _default() {
1627
+ return [_this11.$props.title];
1628
+ }
1629
+ }), _this11.$props.autosuggest ? createVNode(Downshift, {
1630
+ "id": _this11.$props.componentId + "-downshift",
1631
+ "handleChange": _this11.onSuggestionSelected,
1632
+ "handleMouseup": _this11.handleStateChange,
1633
+ "isOpen": _this11.$data.isOpen
1634
+ }, {
1635
+ "default": function _default(_ref5) {
1636
+ var getInputEvents = _ref5.getInputEvents,
1637
+ getInputProps = _ref5.getInputProps,
1638
+ getItemProps = _ref5.getItemProps,
1639
+ getItemEvents = _ref5.getItemEvents,
1640
+ isOpen = _ref5.isOpen,
1641
+ highlightedIndex = _ref5.highlightedIndex,
1642
+ setHighlightedIndex = _ref5.setHighlightedIndex;
1643
+ var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
1644
+ var getIcon = function getIcon(iconType) {
1645
+ switch (iconType) {
1646
+ case suggestionTypes.Recent:
1647
+ return recentSearchesIcon;
1648
+ case suggestionTypes.Popular:
1649
+ return popularSearchesIcon;
1650
+ default:
1651
+ return null;
1652
+ }
1653
+ };
1654
+ return createVNode("div", null, [_this11.hasCustomRenderer && _this11.getComponent({
1655
+ isOpen: isOpen,
1656
+ getItemProps: getItemProps,
1657
+ getItemEvents: getItemEvents,
1658
+ highlightedIndex: highlightedIndex
1659
+ }), _this11.renderErrorComponent(), !_this11.hasCustomRenderer && isOpen && hasSuggestions ? createVNode("ul", {
1660
+ "class": suggestions(_this11.themePreset, theme) + " " + getClassName$1(_this11.$props.innerClass, 'list')
1661
+ }, [_this11.normalizedSuggestions.map(function (item, index) {
1662
+ return renderItem ? createVNode("li", mergeProps(getItemProps({
1663
+ item: item
1664
+ }), getItemEvents({
1665
+ item: item
1666
+ }), {
1667
+ "key": index + 1 + "-" + item.value,
1668
+ "style": {
1669
+ backgroundColor: _this11.getBackgroundColor(highlightedIndex, index),
1670
+ justifyContent: 'flex-start',
1671
+ alignItems: 'center'
1672
+ }
1673
+ }), [renderItem(item)]) : createVNode("li", mergeProps(getItemProps({
1674
+ item: item
1675
+ }), _transformOn(getItemEvents({
1676
+ item: item
1677
+ })), {
1678
+ "key": index + 1 + "-" + item.value,
1679
+ "style": {
1680
+ backgroundColor: _this11.getBackgroundColor(highlightedIndex, index),
1681
+ justifyContent: 'flex-start',
1682
+ alignItems: 'center'
1683
+ }
1684
+ }), [createVNode("div", {
1685
+ "style": {
1686
+ padding: '0 10px 0 0',
1687
+ display: 'flex'
1688
+ }
1689
+ }, [createVNode(CustomSvg, {
1690
+ "className": getClassName$1(_this11.$props.innerClass, item._suggestion_type + "-search-icon") || null,
1691
+ "icon": getIcon(item._suggestion_type),
1692
+ "type": item._suggestion_type + "-search-icon"
1693
+ }, null)]), createVNode(SuggestionItem, {
1694
+ "currentValue": _this11.currentValue,
1695
+ "suggestion": item
1696
+ }, null), _this11.renderAutoFill(item)]);
1697
+ })]) : _this11.renderNoSuggestions(_this11.normalizedSuggestions)]);
1698
+ };
1699
+ return createVNode("div", {
1700
+ "class": suggestionsContainer
1701
+ }, [createVNode(InputGroup, null, {
1702
+ "default": function _default() {
1703
+ return [_this11.renderInputAddonBefore(), createVNode(InputWrapper, null, {
1704
+ "default": function _default() {
1705
+ return [createVNode(Input, mergeProps(_transformOn(getInputEvents({
1706
+ onInput: _this11.onInputChange,
1707
+ onBlur: function onBlur(e) {
1708
+ _this11.$emit('blur', e, _this11.triggerQuery);
1709
+ },
1710
+ onFocus: _this11.handleFocus,
1711
+ onKeyPress: function onKeyPress(e) {
1712
+ _this11.$emit('keyPress', e, _this11.triggerQuery);
1713
+ _this11.$emit('key-press', e, _this11.triggerQuery);
1714
+ },
1715
+ onKeyDown: function onKeyDown(e) {
1716
+ return _this11.handleKeyDown(e, highlightedIndex);
1717
+ },
1718
+ onKeyUp: function onKeyUp(e) {
1719
+ _this11.$emit('keyUp', e, _this11.triggerQuery);
1720
+ _this11.$emit('key-up', e, _this11.triggerQuery);
1721
+ },
1722
+ onClick: function onClick() {
1723
+ setHighlightedIndex(null);
1724
+ }
1725
+ })), {
1726
+ "id": _this11.$props.componentId + "-input",
1727
+ "showIcon": _this11.$props.showIcon,
1728
+ "showClear": _this11.$props.showClear,
1729
+ "iconPosition": _this11.$props.iconPosition,
1730
+ "ref": _this11.$props.innerRef,
1731
+ "class": getClassName$1(_this11.$props.innerClass, 'input'),
1732
+ "placeholder": _this11.$props.placeholder,
1733
+ "autoFocus": _this11.$props.autoFocus
1734
+ }, getInputProps({
1735
+ value: _this11.$data.currentValue === null ? '' : _this11.$data.currentValue
1736
+ }), {
1737
+ "themePreset": _this11.themePreset,
1738
+ "autocomplete": "off"
1739
+ }), null), _this11.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()];
1740
+ }
1741
+ }), _this11.renderInputAddonAfter(), _this11.renderEnterButtonElement()];
1742
+ }
1743
+ }), expandSuggestionsContainer && renderSuggestionsDropdown(), _this11.renderTags()]);
1744
+ }
1745
+ }) : createVNode("div", {
1746
+ "class": suggestionsContainer
1747
+ }, [createVNode(InputGroup, null, {
1748
+ "default": function _default() {
1749
+ return [_this11.renderInputAddonBefore(), createVNode(InputWrapper, null, {
1750
+ "default": function _default() {
1751
+ return [createVNode(Input, mergeProps(_transformOn({
1752
+ blur: function blur(e) {
1753
+ _this11.$emit('blur', e, _this11.triggerQuery);
1754
+ },
1755
+ keypress: function keypress(e) {
1756
+ _this11.$emit('keyPress', e, _this11.triggerQuery);
1757
+ _this11.$emit('key-press', e, _this11.triggerQuery);
1758
+ },
1759
+ input: _this11.onInputChange,
1760
+ focus: function focus(e) {
1761
+ _this11.$emit('focus', e, _this11.triggerQuery);
1762
+ },
1763
+ keydown: _this11.handleKeyDown,
1764
+ keyup: function keyup(e) {
1765
+ _this11.$emit('keyUp', e, _this11.triggerQuery);
1766
+ _this11.$emit('key-up', e, _this11.triggerQuery);
1767
+ }
1768
+ }), {
1769
+ "class": getClassName$1(_this11.$props.innerClass, 'input') || '',
1770
+ "placeholder": _this11.$props.placeholder,
1771
+ "autofocus": _this11.$props.autoFocus,
1772
+ "value": _this11.$data.currentValue ? _this11.$data.currentValue : '',
1773
+ "iconPosition": _this11.$props.iconPosition,
1774
+ "showIcon": _this11.$props.showIcon,
1775
+ "showClear": _this11.$props.showClear,
1776
+ "ref": _this11.$props.innerRef,
1777
+ "themePreset": _this11.themePreset
1778
+ }), null), _this11.renderIcons()];
1779
+ }
1780
+ }), _this11.renderInputAddonAfter(), _this11.renderEnterButtonElement()];
1781
+ }
1782
+ })])];
1783
+ }
1784
+ });
1785
+ },
1786
+ destroyed: function destroyed() {
1787
+ document.removeEventListener('keydown', this.onKeyDown);
1788
+ }
1789
+ });
1790
+ SearchBox.defaultQuery = function (value, props) {
1791
+ var finalQuery = null;
1792
+ finalQuery = {
1793
+ bool: {
1794
+ should: SearchBox.shouldQuery(value, props),
1795
+ minimum_should_match: '1'
1796
+ }
1797
+ };
1798
+ if (finalQuery && props.nestedField) {
1799
+ return {
1800
+ query: {
1801
+ nested: {
1802
+ path: props.nestedField,
1803
+ query: finalQuery
1804
+ }
1805
+ }
1806
+ };
1807
+ }
1808
+ return finalQuery;
1809
+ };
1810
+ SearchBox.shouldQuery = function (value, props) {
1811
+ return {
1812
+ query: {
1813
+ queryFormat: props.queryFormat,
1814
+ dataField: props.dataField,
1815
+ value: value,
1816
+ nestedField: props.nestedField,
1817
+ queryString: props.queryString,
1818
+ searchOperators: props.searchOperators
1819
+ }
1820
+ };
1821
+ };
1822
+ var mapStateToProps = function mapStateToProps(state, props) {
1823
+ return {
1824
+ selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
1825
+ selectedCategory: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].category || null,
1826
+ suggestions: state.hits[props.componentId] && state.hits[props.componentId].hits,
1827
+ rawData: state.rawData[props.componentId],
1828
+ aggregationData: state.compositeAggregations[props.componentId] || [],
1829
+ themePreset: state.config.themePreset,
1830
+ isLoading: !!state.isLoading[props.componentId + "_active"],
1831
+ error: state.error[props.componentId],
1832
+ time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
1833
+ total: state.hits[props.componentId] && state.hits[props.componentId].total,
1834
+ hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden
1835
+ };
1836
+ };
1837
+ var mapDispatchToProps = {
1838
+ updateQuery: updateQuery,
1839
+ setCustomQuery: setCustomQuery,
1840
+ setDefaultQuery: setDefaultQuery,
1841
+ recordSuggestionClick: recordSuggestionClick
1842
+ };
1843
+ var SBConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps, mapDispatchToProps)(SearchBox), {
1844
+ componentType: componentTypes.searchBox,
1845
+ internalComponent: true
1846
+ }));
1847
+ SBConnected.name = SearchBox.name;
1848
+ SBConnected.install = function (Vue) {
1849
+ Vue.component(SBConnected.name, SBConnected);
1850
+ };
1851
+ // Add componentType for SSR
1852
+ SBConnected.componentType = componentTypes.searchBox;
1853
+
1854
+ var _excluded = ["options"];
1855
+ var updateQuery$1 = Actions.updateQuery,
1856
+ setQueryOptions = Actions.setQueryOptions,
1857
+ setCustomQuery$1 = Actions.setCustomQuery,
1858
+ setDefaultQuery$1 = Actions.setDefaultQuery;
1859
+ var parseHits = helper.parseHits,
1860
+ isEqual$1 = helper.isEqual,
1861
+ getCompositeAggsQuery$1 = helper.getCompositeAggsQuery,
1862
+ getResultStats$1 = helper.getResultStats,
1863
+ extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
1864
+ getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
1865
+ var ReactiveComponent = {
1866
+ name: 'ReactiveComponent',
1867
+ props: {
1868
+ componentId: types.stringRequired,
1869
+ aggregationField: types.string,
1870
+ aggregationSize: VueTypes.number,
1871
+ size: VueTypes.number,
1872
+ defaultQuery: types.func,
1873
+ customQuery: types.func,
1874
+ filterLabel: types.string,
1875
+ react: types.react,
1876
+ showFilter: VueTypes.bool.def(true),
1877
+ URLParams: VueTypes.bool.def(false),
1878
+ distinctField: types.string,
1879
+ distinctFieldConfig: types.props,
1880
+ index: VueTypes.string,
1881
+ endpoint: types.endpointConfig
1882
+ },
1883
+ created: function created() {
1884
+ var _this = this;
1885
+ var props = this.$props;
1886
+ this.internalComponent = null;
1887
+ this.$defaultQuery = null;
1888
+ // Set custom query in store
1889
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
1890
+ var customQuery = props.customQuery,
1891
+ componentId = props.componentId,
1892
+ filterLabel = props.filterLabel,
1893
+ showFilter = props.showFilter,
1894
+ URLParams = props.URLParams;
1895
+ if (customQuery) {
1896
+ var calcCustomQuery = customQuery(this.selectedValue, props);
1897
+ var query = extractQueryFromCustomQuery(calcCustomQuery);
1898
+ var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery(calcCustomQuery) : null;
1899
+ if (customQueryOptions) {
1900
+ this.setQueryOptions(componentId, _extends({}, customQueryOptions, this.getAggsQuery()), false);
1901
+ } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
1902
+ this.updateQuery({
1903
+ componentId: componentId,
1904
+ query: query,
1905
+ value: this.selectedValue || null,
1906
+ label: filterLabel,
1907
+ showFilter: showFilter,
1908
+ URLParams: URLParams
1909
+ });
1910
+ }
1911
+ this.setQuery = function (_ref) {
1912
+ var options = _ref.options,
1913
+ obj = _objectWithoutPropertiesLoose(_ref, _excluded);
1914
+ var queryToBeSet = obj.query;
1915
+
1916
+ // when enableAppbase is true, Backend throws error because of repeated query in request body
1917
+ if (queryToBeSet && queryToBeSet.query) {
1918
+ queryToBeSet = queryToBeSet.query;
1919
+ }
1920
+ var customQueryCalc = _extends({}, options, {
1921
+ query: queryToBeSet
1922
+ });
1923
+ var rsAPIQuery = customQueryCalc;
1924
+ // handle stored queries
1925
+ if (queryToBeSet && queryToBeSet.id) {
1926
+ rsAPIQuery = queryToBeSet;
1927
+ }
1928
+ // Update customQuery field for RS API
1929
+ _this.setCustomQuery(props.componentId, rsAPIQuery);
1930
+ if (options) {
1931
+ _this.setQueryOptions(props.componentId, _extends({}, _this.getAggsQuery(), options), false);
1932
+ }
1933
+ _this.updateQuery(_extends({}, obj, {
1934
+ query: customQueryCalc.query,
1935
+ componentId: props.componentId,
1936
+ label: props.filterLabel,
1937
+ showFilter: props.showFilter,
1938
+ URLParams: props.URLParams
1939
+ }));
1940
+ };
1941
+ if (props.defaultQuery) {
1942
+ this.internalComponent = props.componentId + "__internal";
1943
+ }
1944
+ if (this.internalComponent && this.$props.defaultQuery) {
1945
+ updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
1946
+ this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
1947
+ var _query = extractQueryFromCustomQuery(this.$defaultQuery);
1948
+ var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
1949
+ if (queryOptions) {
1950
+ this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
1951
+ } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
1952
+ this.updateQuery({
1953
+ componentId: this.internalComponent,
1954
+ query: _query
1955
+ });
1956
+ }
1957
+ },
1958
+ watch: {
1959
+ hits: function hits(newVal, oldVal) {
1960
+ if (!isEqual$1(newVal, oldVal)) {
1961
+ this.$emit('data', this.getData());
1962
+ }
1963
+ },
1964
+ rawData: function rawData(newVal, oldVal) {
1965
+ if (!isEqual$1(newVal, oldVal)) {
1966
+ this.$emit('data', this.getData());
1967
+ }
1968
+ },
1969
+ aggregations: function aggregations(newVal, oldVal) {
1970
+ if (!isEqual$1(newVal, oldVal)) {
1971
+ this.$emit('data', this.getData());
1972
+ }
1973
+ },
1974
+ aggregationData: function aggregationData(newVal, oldVal) {
1975
+ if (!isEqual$1(newVal, oldVal)) {
1976
+ this.$emit('data', this.getData());
1977
+ }
1978
+ },
1979
+ promotedResults: function promotedResults(newVal, oldVal) {
1980
+ if (!isEqual$1(newVal, oldVal)) {
1981
+ this.$emit('data', this.getData());
1982
+ }
1983
+ },
1984
+ hidden: function hidden(newVal, oldVal) {
1985
+ if (!isEqual$1(newVal, oldVal)) {
1986
+ this.$emit('data', this.getData());
1987
+ }
1988
+ },
1989
+ total: function total(newVal, oldVal) {
1990
+ if (!isEqual$1(newVal, oldVal)) {
1991
+ this.$emit('data', this.getData());
1992
+ }
1993
+ },
1994
+ time: function time(newVal, oldVal) {
1995
+ if (!isEqual$1(newVal, oldVal)) {
1996
+ this.$emit('data', this.getData());
1997
+ }
1998
+ },
1999
+ defaultQuery: function defaultQuery(newVal, oldVal) {
2000
+ if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
2001
+ this.$defaultQuery = newVal(this.selectedValue, this.$props);
2002
+ var query = extractQueryFromCustomQuery(this.$defaultQuery);
2003
+ var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
2004
+ if (queryOptions) {
2005
+ this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
2006
+ } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
2007
+ // Update default query for RS API
2008
+ updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
2009
+ this.updateQuery({
2010
+ componentId: this.internalComponent,
2011
+ query: query
2012
+ });
2013
+ }
2014
+ },
2015
+ customQuery: function customQuery(newVal, oldVal) {
2016
+ if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
2017
+ var componentId = this.$props.componentId;
2018
+ this.$customQuery = newVal(this.selectedValue, this.$props);
2019
+ var query = extractQueryFromCustomQuery(this.$customQuery);
2020
+ var queryOptions = getOptionsForCustomQuery(this.$customQuery);
2021
+ if (queryOptions) {
2022
+ this.setQueryOptions(componentId, _extends({}, queryOptions, this.getAggsQuery()), false);
2023
+ } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
2024
+
2025
+ // Update custom query for RS API
2026
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
2027
+ this.updateQuery({
2028
+ componentId: componentId,
2029
+ query: query
2030
+ });
2031
+ }
2032
+ }
2033
+ },
2034
+ render: function render() {
2035
+ try {
2036
+ var dom = this.$slots["default"];
2037
+ var error = this.error,
2038
+ isLoading = this.isLoading,
2039
+ selectedValue = this.selectedValue;
2040
+ var propsToBePassed = _extends({
2041
+ error: error,
2042
+ loading: isLoading
2043
+ }, this.getData(), {
2044
+ value: selectedValue,
2045
+ setQuery: this.setQuery
2046
+ });
2047
+ return createVNode("div", null, [dom(propsToBePassed)]);
2048
+ } catch (e) {
2049
+ return null;
2050
+ }
2051
+ },
2052
+ methods: {
2053
+ getAggsQuery: function getAggsQuery() {
2054
+ if (this.aggregationField) {
2055
+ return {
2056
+ aggs: getCompositeAggsQuery$1({
2057
+ props: this.$props,
2058
+ showTopHits: true,
2059
+ value: this.selectedValue
2060
+ }).aggs
2061
+ };
2062
+ }
2063
+ return {};
2064
+ },
2065
+ getData: function getData() {
2066
+ var hits = this.hits,
2067
+ aggregations = this.aggregations,
2068
+ aggregationData = this.aggregationData,
2069
+ promotedResults = this.promotedResults,
2070
+ rawData = this.rawData;
2071
+ var filteredResults = parseHits(hits);
2072
+ if (promotedResults.length) {
2073
+ var ids = promotedResults.map(function (item) {
2074
+ return item._id;
2075
+ }).filter(Boolean);
2076
+ if (ids) {
2077
+ filteredResults = filteredResults.filter(function (item) {
2078
+ return !ids.includes(item._id);
2079
+ });
2080
+ }
2081
+ filteredResults = [].concat(promotedResults, filteredResults);
2082
+ }
2083
+ return {
2084
+ data: filteredResults,
2085
+ aggregationData: aggregationData,
2086
+ rawData: rawData,
2087
+ aggregations: aggregations,
2088
+ promotedData: promotedResults,
2089
+ resultStats: this.stats
2090
+ };
2091
+ }
2092
+ },
2093
+ computed: {
2094
+ stats: function stats() {
2095
+ return getResultStats$1(this);
2096
+ }
2097
+ }
2098
+ };
2099
+ ReactiveComponent.hasInternalComponent = function (props) {
2100
+ return !!props.defaultQuery;
2101
+ };
2102
+ var mapStateToProps$1 = function mapStateToProps(state, props) {
2103
+ return {
2104
+ aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
2105
+ aggregationData: state.compositeAggregations[props.componentId] || [],
2106
+ hits: state.hits[props.componentId] && state.hits[props.componentId].hits || [],
2107
+ rawData: state.rawData[props.componentId],
2108
+ error: state.error[props.componentId],
2109
+ isLoading: state.isLoading[props.componentId],
2110
+ selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
2111
+ promotedResults: state.promotedResults[props.componentId] || [],
2112
+ time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
2113
+ total: state.hits[props.componentId] && state.hits[props.componentId].total,
2114
+ hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
2115
+ componentProps: state.props[props.componentId]
2116
+ };
2117
+ };
2118
+ var mapDispatchtoProps = {
2119
+ setQueryOptions: setQueryOptions,
2120
+ updateQuery: updateQuery$1,
2121
+ setCustomQuery: setCustomQuery$1,
2122
+ setDefaultQuery: setDefaultQuery$1
2123
+ };
2124
+ var ConnectedComponent = ComponentWrapper(connect(mapStateToProps$1, mapDispatchtoProps)(ReactiveComponent), {
2125
+ componentType: componentTypes.reactiveComponent
2126
+ });
2127
+ var RcConnected = PreferencesConsumer({
2128
+ name: 'RcConnected',
2129
+ render: function render() {
2130
+ var component = ConnectedComponent;
2131
+ switch (this.$attrs.componentType) {
2132
+ case componentTypes.reactiveList:
2133
+ component = RLConnected;
2134
+ break;
2135
+ case componentTypes.searchBox:
2136
+ component = SBConnected;
2137
+ break;
2138
+ // list components
2139
+ case componentTypes.singleList:
2140
+ component = ListConnected$3;
2141
+ break;
2142
+ case componentTypes.multiList:
2143
+ component = ListConnected$2;
2144
+ break;
2145
+ case componentTypes.singleDropdownList:
2146
+ component = ListConnected$1;
2147
+ break;
2148
+ case componentTypes.multiDropdownList:
2149
+ component = ListConnected;
2150
+ break;
2151
+ // basic components
2152
+ case componentTypes.toggleButton:
2153
+ component = TBConnected;
2154
+ break;
2155
+ // range components
2156
+ case componentTypes.dynamicRangeSlider:
2157
+ component = RangeConnected$4;
2158
+ break;
2159
+ case componentTypes.singleRange:
2160
+ component = RangeConnected$3;
2161
+ break;
2162
+ case componentTypes.multiRange:
2163
+ component = RangeConnected$2;
2164
+ break;
2165
+ case componentTypes.rangeSlider:
2166
+ component = RangeConnected$1;
2167
+ break;
2168
+ case componentTypes.rangeInput:
2169
+ component = RangeConnected;
2170
+ break;
2171
+ }
2172
+ return h(component, null, this.$slots);
2173
+ }
2174
+ });
2175
+ RcConnected.name = ReactiveComponent.name;
2176
+ RcConnected.install = function (Vue) {
2177
+ Vue.component(RcConnected.name, RcConnected);
2178
+ };
2179
+
2180
+ // Add componentType for SSR
2181
+ RcConnected.componentType = componentTypes.reactiveComponent;
2182
+
2183
+ export { RcConnected as R, SBConnected as S };