@appbaseio/reactivesearch-vue 1.16.0-alpha.6 → 1.16.0-alpha.62

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 (105) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +16030 -13113
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/Button-446f819e.js +68 -0
  6. package/dist/cjs/{DownShift-966a58cb.js → CancelSvg-9f258f4f.js} +60 -16
  7. package/dist/cjs/Card-642547a8.js +30 -0
  8. package/dist/cjs/{ComponentWrapper-603848ed.js → ComponentWrapper-ad3dad02.js} +40 -21
  9. package/dist/cjs/{Container-6cdd3864.js → Container-daf30918.js} +3 -11
  10. package/dist/cjs/DataSearch-86914b10.js +2322 -0
  11. package/dist/cjs/DataSearch.js +18 -2151
  12. package/dist/cjs/{DropDown-f6224ac8.js → DropDown-5513ea77.js} +80 -95
  13. package/dist/cjs/DynamicRangeSlider.js +107 -43
  14. package/dist/cjs/Flex-aa517a13.js +52 -0
  15. package/dist/cjs/FormControlList-c195a592.js +47 -0
  16. package/dist/cjs/Input-e6603a7e.js +79 -0
  17. package/dist/cjs/ListItem-8c9e0d68.js +46 -0
  18. package/dist/cjs/MultiDropdownList.js +102 -68
  19. package/dist/cjs/MultiList.js +80 -50
  20. package/dist/cjs/MultiRange.js +21 -16
  21. package/dist/cjs/{Pagination-af399262.js → Pagination-fe5452fc.js} +14 -8
  22. package/dist/cjs/RangeInput.js +29 -45
  23. package/dist/cjs/RangeSlider.js +32 -30
  24. package/dist/cjs/ReactiveBase.js +87 -56
  25. package/dist/cjs/ReactiveComponent.js +75 -62
  26. package/dist/cjs/ReactiveGoogleMap.js +262 -191
  27. package/dist/cjs/ReactiveList.js +189 -241
  28. package/dist/cjs/ResultCard.js +8 -6
  29. package/dist/cjs/ResultList.js +8 -6
  30. package/dist/cjs/SelectedFilters.js +66 -34
  31. package/dist/cjs/SingleDropdownList.js +88 -60
  32. package/dist/cjs/SingleList.js +53 -35
  33. package/dist/cjs/SingleRange.js +19 -14
  34. package/dist/cjs/StateProvider.js +39 -10
  35. package/dist/cjs/{Title-65d39104.js → Title-1de7d0f4.js} +3 -11
  36. package/dist/cjs/ToggleButton.js +36 -16
  37. package/dist/cjs/{_rollupPluginBabelHelpers-4abdbfff.js → _rollupPluginBabelHelpers-c705cbe6.js} +2 -4
  38. package/dist/cjs/{index-baca18c4.js → index-6a167fe0.js} +99 -13
  39. package/dist/cjs/index.js +31 -25
  40. package/dist/cjs/initReactivesearch.js +178 -104
  41. package/dist/cjs/install-004c6aa4.js +1408 -0
  42. package/dist/cjs/install.js +42 -44
  43. package/dist/cjs/ssr-3027b848.js +39 -0
  44. package/dist/cjs/{utils-ea846a20.js → utils-d6a52588.js} +2 -2
  45. package/dist/cjs/version.js +1 -1
  46. package/dist/cjs/{vueTypes-c21f265b.js → vueTypes-6de9d2a9.js} +9 -4
  47. package/dist/es/Button-d8bc15ea.js +59 -0
  48. package/dist/es/{DownShift-92347b5e.js → CancelSvg-4cfae5fd.js} +56 -17
  49. package/dist/es/Card-450683f1.js +23 -0
  50. package/dist/es/{ComponentWrapper-c4c91949.js → ComponentWrapper-424e86fd.js} +40 -21
  51. package/dist/es/Container-ba826e96.js +10 -0
  52. package/dist/es/DataSearch-e71a1014.js +2307 -0
  53. package/dist/es/DataSearch.js +17 -2150
  54. package/dist/es/{DropDown-3d4291f1.js → DropDown-7d9a15c1.js} +79 -94
  55. package/dist/es/DynamicRangeSlider.js +107 -43
  56. package/dist/es/Flex-1f0795c3.js +47 -0
  57. package/dist/es/FormControlList-c22d64f6.js +40 -0
  58. package/dist/es/Input-7a2a9fac.js +71 -0
  59. package/dist/es/ListItem-cad14c5e.js +39 -0
  60. package/dist/es/MultiDropdownList.js +102 -68
  61. package/dist/es/MultiList.js +80 -50
  62. package/dist/es/MultiRange.js +21 -16
  63. package/dist/es/{Pagination-c2a00175.js → Pagination-3f350098.js} +14 -8
  64. package/dist/es/RangeInput.js +29 -45
  65. package/dist/es/RangeSlider.js +32 -30
  66. package/dist/es/ReactiveBase.js +87 -56
  67. package/dist/es/ReactiveComponent.js +75 -62
  68. package/dist/es/ReactiveGoogleMap.js +262 -191
  69. package/dist/es/ReactiveList.js +189 -241
  70. package/dist/es/ResultCard.js +8 -6
  71. package/dist/es/ResultList.js +8 -6
  72. package/dist/es/SelectedFilters.js +66 -34
  73. package/dist/es/SingleDropdownList.js +88 -60
  74. package/dist/es/SingleList.js +53 -35
  75. package/dist/es/SingleRange.js +19 -14
  76. package/dist/es/StateProvider.js +39 -10
  77. package/dist/es/Title-3342664a.js +10 -0
  78. package/dist/es/ToggleButton.js +36 -16
  79. package/dist/es/{_rollupPluginBabelHelpers-ecf6c03c.js → _rollupPluginBabelHelpers-76660dab.js} +2 -4
  80. package/dist/es/{index-185b6266.js → index-7788a843.js} +95 -14
  81. package/dist/es/index.js +27 -22
  82. package/dist/es/initReactivesearch.js +179 -105
  83. package/dist/es/install-b7b604cc.js +1401 -0
  84. package/dist/es/install.js +40 -46
  85. package/dist/es/ssr-b2c0b401.js +33 -0
  86. package/dist/es/{utils-57cc8789.js → utils-9e68acee.js} +2 -2
  87. package/dist/es/version.js +1 -1
  88. package/dist/es/{vueTypes-98d938a9.js → vueTypes-9326e0be.js} +9 -4
  89. package/package.json +6 -4
  90. package/dist/cjs/Button-d48d4365.js +0 -146
  91. package/dist/cjs/Card-9748fbb2.js +0 -58
  92. package/dist/cjs/Flex-befd65fc.js +0 -160
  93. package/dist/cjs/FormControlList-f3857d4b.js +0 -105
  94. package/dist/cjs/Input-95cb19f8.js +0 -178
  95. package/dist/cjs/ListItem-84d185cf.js +0 -84
  96. package/dist/cjs/ssr-3ca8a14f.js +0 -47
  97. package/dist/es/Button-27cc8574.js +0 -137
  98. package/dist/es/Card-1f93780d.js +0 -51
  99. package/dist/es/Container-88c805ef.js +0 -18
  100. package/dist/es/Flex-16d1103a.js +0 -155
  101. package/dist/es/FormControlList-96d44e7b.js +0 -98
  102. package/dist/es/Input-1159c4b5.js +0 -170
  103. package/dist/es/ListItem-d22510c9.js +0 -77
  104. package/dist/es/Title-f0217338.js +0 -18
  105. package/dist/es/ssr-a710392b.js +0 -41
@@ -0,0 +1,2322 @@
1
+ 'use strict';
2
+
3
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
+
5
+ var configureStore = require('@appbaseio/reactivecore');
6
+ var configureStore__default = _interopDefault(configureStore);
7
+ var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-c705cbe6.js');
8
+ var VueTypes = _interopDefault(require('vue-types'));
9
+ var constants = require('@appbaseio/reactivecore/lib/utils/constants');
10
+ var helper = require('@appbaseio/reactivecore/lib/utils/helper');
11
+ var styled = require('@appbaseio/vue-emotion');
12
+ var styled__default = _interopDefault(styled);
13
+ var vueTypes = require('./vueTypes-6de9d2a9.js');
14
+ var index = require('./index-6a167fe0.js');
15
+ var ComponentWrapper = require('./ComponentWrapper-ad3dad02.js');
16
+ var Title = require('./Title-1de7d0f4.js');
17
+ var Flex = require('./Flex-aa517a13.js');
18
+ var hotkeys = _interopDefault(require('hotkeys-js'));
19
+ var CancelSvg = require('./CancelSvg-9f258f4f.js');
20
+ var Input = require('./Input-e6603a7e.js');
21
+ var Container = require('./Container-daf30918.js');
22
+ var Highlight = _interopDefault(require('vue-highlight-words'));
23
+
24
+ var _templateObject;
25
+ var InputGroup = styled__default('div')(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n display: flex;\n align-items: stretch;\n width: 100%;\n"])));
26
+ InputGroup.defaultProps = {
27
+ className: 'input-group'
28
+ };
29
+
30
+ var _templateObject$1;
31
+ var InputAddon = styled__default('span')(_templateObject$1 || (_templateObject$1 = _rollupPluginBabelHelpers._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"])));
32
+ InputAddon.defaultProps = {
33
+ className: 'input-addon'
34
+ };
35
+
36
+ var getClassName = configureStore.helper.getClassName;
37
+ var SuggestionWrapper = {
38
+ name: 'SuggestionWrapper',
39
+ props: {
40
+ innerClassName: vueTypes.types.string,
41
+ themePreset: vueTypes.types.themePreset,
42
+ innerClass: vueTypes.types.style
43
+ },
44
+ render: function render() {
45
+ var h = arguments[0];
46
+ var _this$$props = this.$props,
47
+ themePreset = _this$$props.themePreset,
48
+ innerClass = _this$$props.innerClass,
49
+ innerClassName = _this$$props.innerClassName;
50
+ return h("div", {
51
+ "class": Input.noSuggestions(themePreset) + " " + getClassName(innerClass, innerClassName || '')
52
+ }, [h("li", [this.$scopedSlots["default"]()])]);
53
+ }
54
+ };
55
+
56
+ var _templateObject$2;
57
+ var highlightStyle = {
58
+ fontWeight: 600,
59
+ padding: 0,
60
+ backgroundColor: 'transparent',
61
+ color: 'inherit'
62
+ };
63
+ var PredictiveSuggestion = styled__default('span')(_templateObject$2 || (_templateObject$2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t.highlight {\n\t\tbackground: transparent;\n\t\tcolor: inherit;\n\t\tfont-weight: 600;\n\t\tpadding: 0;\n\t}\n"])));
64
+ var SuggestionItem = {
65
+ name: 'SuggestionItem',
66
+ props: {
67
+ currentValue: vueTypes.types.string,
68
+ suggestion: vueTypes.types.any
69
+ },
70
+ render: function render() {
71
+ var h = arguments[0];
72
+ var _this$suggestion = this.suggestion,
73
+ label = _this$suggestion.label,
74
+ value = _this$suggestion.value,
75
+ title = _this$suggestion.title,
76
+ description = _this$suggestion.description,
77
+ image = _this$suggestion.image,
78
+ isPredictiveSuggestion = _this$suggestion.isPredictiveSuggestion,
79
+ _suggestion_type = _this$suggestion._suggestion_type,
80
+ _category = _this$suggestion._category;
81
+
82
+ if (label) {
83
+ // label has highest precedence
84
+ return typeof label === 'string' ? h("div", {
85
+ "class": "trim"
86
+ }, [(_category ? false : isPredictiveSuggestion // eslint-disable-next-line
87
+ || !!_suggestion_type) ? h(PredictiveSuggestion, {
88
+ "domProps": {
89
+ "innerHTML": label
90
+ }
91
+ }) : h(Highlight, {
92
+ "attrs": {
93
+ "searchWords": _category ? [_category] : this.currentValue.split(' '),
94
+ "textToHighlight": label,
95
+ "autoEscape": true,
96
+ "highlightStyle": highlightStyle
97
+ }
98
+ })]) : label;
99
+ }
100
+
101
+ if (title || image || description) {
102
+ return h(Flex.Flex, {
103
+ "attrs": {
104
+ "alignItems": "center",
105
+ "css": {
106
+ width: '100%'
107
+ }
108
+ }
109
+ }, [image && h("div", {
110
+ "attrs": {
111
+ "css": {
112
+ margin: 'auto',
113
+ marginRight: 10
114
+ }
115
+ }
116
+ }, [h("img", {
117
+ "attrs": {
118
+ "src": image,
119
+ "alt": " ",
120
+ "height": "50px",
121
+ "width": "50px",
122
+ "css": {
123
+ objectFit: 'contain'
124
+ }
125
+ }
126
+ })]), h(Flex.Flex, {
127
+ "attrs": {
128
+ "direction": "column",
129
+ "css": {
130
+ width: image ? 'calc(100% - 60px)' : '100%'
131
+ }
132
+ }
133
+ }, [title && h("div", {
134
+ "class": "trim"
135
+ }, [h(Highlight, {
136
+ "attrs": {
137
+ "searchWords": this.currentValue.split(' '),
138
+ "textToHighlight": title,
139
+ "highlightStyle": highlightStyle
140
+ },
141
+ "class": styled.css({
142
+ fontSize: '1rem'
143
+ })
144
+ })]), description && h("div", {
145
+ "class": styled.cx('trim', styled.css({
146
+ marginTop: 3
147
+ }))
148
+ }, [h(Highlight, {
149
+ "attrs": {
150
+ "searchWords": this.currentValue.split(' '),
151
+ "textToHighlight": description,
152
+ "highlightStyle": highlightStyle
153
+ }
154
+ })])])]);
155
+ }
156
+
157
+ return value;
158
+ }
159
+ };
160
+
161
+ var SearchSvg = {
162
+ name: 'SearchSvg',
163
+ props: ['styles'],
164
+ render: function render() {
165
+ var h = arguments[0];
166
+ return h("svg", {
167
+ "attrs": {
168
+ "alt": "Search",
169
+ "height": "12",
170
+ "xmlns": "http://www.w3.org/2000/svg",
171
+ "viewBox": "0 0 15 15"
172
+ },
173
+ "class": "search-icon",
174
+ "style": _rollupPluginBabelHelpers._extends({
175
+ transform: 'scale(1.35)',
176
+ position: 'relative'
177
+ }, this.$props.styles ? this.$props.styles : {})
178
+ }, [h("title", ["Search"]), h("path", {
179
+ "attrs": {
180
+ "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'
181
+ }
182
+ })]);
183
+ }
184
+ };
185
+
186
+ var _templateObject$3;
187
+
188
+ styled.injectGlobal(_templateObject$3 || (_templateObject$3 = _rollupPluginBabelHelpers._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"])));
189
+ var MicSvg = {
190
+ name: 'MicSvg',
191
+ props: ['className'],
192
+ render: function render() {
193
+ var h = arguments[0];
194
+ return h("svg", {
195
+ "attrs": {
196
+ "viewBox": "0 0 480 480",
197
+ "xmlns": "http://www.w3.org/2000/svg",
198
+ "id": "el_xS0FRzQjJ",
199
+ "width": 28,
200
+ "height": 28,
201
+ "className": this.$props.className
202
+ },
203
+ "style": {
204
+ transform: 'scale(1.5)'
205
+ }
206
+ }, [h("g", {
207
+ "attrs": {
208
+ "id": "el_TvxDfTAtKp",
209
+ "fillRule": "evenodd"
210
+ }
211
+ }, [h("g", {
212
+ "attrs": {
213
+ "id": "el_D93PK3GbmJ",
214
+ "fillRule": "nonzero"
215
+ },
216
+ "style": {
217
+ fill: '#595959'
218
+ }
219
+ }, [h("path", {
220
+ "attrs": {
221
+ "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",
222
+ "id": "el_uly3EwA2O3"
223
+ }
224
+ }), h("path", {
225
+ "attrs": {
226
+ "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",
227
+ "id": "el_tnDbR4ytu4"
228
+ }
229
+ })])])]);
230
+ }
231
+ };
232
+
233
+ var _templateObject$4;
234
+
235
+ styled.injectGlobal(_templateObject$4 || (_templateObject$4 = _rollupPluginBabelHelpers._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"])));
236
+ var MuteSvg = {
237
+ name: 'MuteSvg',
238
+ props: ['className'],
239
+ render: function render() {
240
+ var h = arguments[0];
241
+ return h("svg", {
242
+ "style": {
243
+ transform: 'scale(1.5)'
244
+ },
245
+ "attrs": {
246
+ "viewBox": "0 0 480 480",
247
+ "xmlns": "http://www.w3.org/2000/svg",
248
+ "id": "el_D1rEpH2zj",
249
+ "width": 28,
250
+ "height": 28,
251
+ "className": this.$props.className
252
+ }
253
+ }, [h("g", {
254
+ "attrs": {
255
+ "id": "el_X81iT9kZYo",
256
+ "fillRule": "evenodd"
257
+ }
258
+ }, [h("g", {
259
+ "attrs": {
260
+ "id": "el_gMpyalCphp"
261
+ }
262
+ }, [h("path", {
263
+ "attrs": {
264
+ "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",
265
+ "id": "el_c7H-3u-D4l",
266
+ "fillRule": "nonzero"
267
+ },
268
+ "style": {
269
+ fill: '#595959'
270
+ }
271
+ }), h("path", {
272
+ "attrs": {
273
+ "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",
274
+ "id": "el_qhFcdAAFwo",
275
+ "fillRule": "nonzero"
276
+ },
277
+ "style": {
278
+ fill: '#595959'
279
+ }
280
+ }), h("path", {
281
+ "attrs": {
282
+ "d": "M11.5,206.5 L142.5,12.5",
283
+ "id": "el_M8X8g37WOI",
284
+ "strokeLinecap": "round",
285
+ "strokeLinejoin": "round"
286
+ }
287
+ })])])]);
288
+ }
289
+ };
290
+
291
+ var _templateObject$5;
292
+
293
+ styled.injectGlobal(_templateObject$5 || (_templateObject$5 = _rollupPluginBabelHelpers._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"])));
294
+ var ListenSvg = {
295
+ name: 'ListenSvg',
296
+ props: ['className'],
297
+ render: function render() {
298
+ var h = arguments[0];
299
+ return h("svg", {
300
+ "attrs": {
301
+ "viewBox": "0 0 480 480",
302
+ "xmlns": "http://www.w3.org/2000/svg",
303
+ "xmlnsXlink": "http://www.w3.org/1999/xlink",
304
+ "id": "el_hiibMG0x-",
305
+ "width": 28,
306
+ "height": 29,
307
+ "className": this.$props.className
308
+ },
309
+ "style": {
310
+ transform: 'scale(1.5)'
311
+ }
312
+ }, [h("defs", [h("path", {
313
+ "attrs": {
314
+ "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",
315
+ "id": "path-1"
316
+ }
317
+ }), h("path", {
318
+ "attrs": {
319
+ "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",
320
+ "id": "path-3"
321
+ }
322
+ }), h("path", {
323
+ "attrs": {
324
+ "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",
325
+ "id": "path-5"
326
+ }
327
+ }), h("path", {
328
+ "attrs": {
329
+ "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",
330
+ "id": "path-7"
331
+ }
332
+ }), h("path", {
333
+ "attrs": {
334
+ "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",
335
+ "id": "path-9"
336
+ }
337
+ }), h("path", {
338
+ "attrs": {
339
+ "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",
340
+ "id": "path-11"
341
+ }
342
+ }), h("path", {
343
+ "attrs": {
344
+ "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",
345
+ "id": "path-13"
346
+ }
347
+ }), h("path", {
348
+ "attrs": {
349
+ "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",
350
+ "id": "path-15"
351
+ }
352
+ })]), h("g", {
353
+ "attrs": {
354
+ "id": "el_QJeJ_2CDw5",
355
+ "fillRule": "evenodd"
356
+ }
357
+ }, [h("g", {
358
+ "attrs": {
359
+ "id": "el_UYYCfubTRf"
360
+ }
361
+ }, [h("path", {
362
+ "attrs": {
363
+ "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",
364
+ "id": "el_uzZNtK32Zi",
365
+ "fillRule": "nonzero"
366
+ },
367
+ "style": {
368
+ fill: '#0B6AFF'
369
+ }
370
+ }), h("path", {
371
+ "attrs": {
372
+ "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",
373
+ "id": "el_EYKQ2N9Kgy",
374
+ "fillRule": "nonzero"
375
+ }
376
+ }), h("g", {
377
+ "attrs": {
378
+ "id": "el_6SDP2LAgKC"
379
+ }
380
+ }, [h("mask", {
381
+ "attrs": {
382
+ "id": "mask-2",
383
+ "fill": "#fff"
384
+ }
385
+ }, [h("use", {
386
+ "attrs": {
387
+ "xlink:href": "#path-1"
388
+ }
389
+ })]), h("path", {
390
+ "attrs": {
391
+ "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",
392
+ "id": "el_-Vm65Ltfy7",
393
+ "fillRule": "nonzero",
394
+ "mask": "url(#mask-2)"
395
+ }
396
+ }), h("rect", {
397
+ "attrs": {
398
+ "id": "el_q04iZcSim4",
399
+ "mask": "url(#mask-2)",
400
+ "x": "0.279",
401
+ "width": "77",
402
+ "height": "130"
403
+ }
404
+ })]), h("g", {
405
+ "attrs": {
406
+ "id": "el_6WKby7wXqV"
407
+ }
408
+ }, [h("mask", {
409
+ "attrs": {
410
+ "id": "mask-4",
411
+ "fill": "#fff"
412
+ }
413
+ }, [h("use", {
414
+ "attrs": {
415
+ "xlink:href": "#path-3"
416
+ }
417
+ })]), h("path", {
418
+ "attrs": {
419
+ "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",
420
+ "id": "el_9bggsfQOtU",
421
+ "fillRule": "nonzero",
422
+ "mask": "url(#mask-4)"
423
+ }
424
+ }), h("rect", {
425
+ "attrs": {
426
+ "id": "el_NKxqi9eIym",
427
+ "mask": "url(#mask-4)",
428
+ "x": "0.279",
429
+ "width": "77",
430
+ "height": "115"
431
+ }
432
+ })]), h("g", {
433
+ "attrs": {
434
+ "id": "el_Wi-my975tM"
435
+ }
436
+ }, [h("mask", {
437
+ "attrs": {
438
+ "id": "mask-6",
439
+ "fill": "#fff"
440
+ }
441
+ }, [h("use", {
442
+ "attrs": {
443
+ "xlink:href": "#path-5"
444
+ }
445
+ })]), h("path", {
446
+ "attrs": {
447
+ "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",
448
+ "id": "el_zclQ34fvf7",
449
+ "fillRule": "nonzero",
450
+ "mask": "url(#mask-6)"
451
+ }
452
+ }), h("rect", {
453
+ "attrs": {
454
+ "id": "el_1OsvRT8HkeZ",
455
+ "mask": "url(#mask-6)",
456
+ "x": "0.279",
457
+ "width": "77",
458
+ "height": "100"
459
+ }
460
+ })]), h("g", {
461
+ "attrs": {
462
+ "id": "el_DkfFFTaFxy8"
463
+ }
464
+ }, [h("mask", {
465
+ "attrs": {
466
+ "id": "mask-8",
467
+ "fill": "#fff"
468
+ }
469
+ }, [h("use", {
470
+ "attrs": {
471
+ "xlink:href": "#path-7"
472
+ }
473
+ })]), h("path", {
474
+ "attrs": {
475
+ "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",
476
+ "id": "el_aa9sjx4H0vA",
477
+ "fillRule": "nonzero",
478
+ "mask": "url(#mask-8)"
479
+ }
480
+ }), h("rect", {
481
+ "attrs": {
482
+ "id": "el_tea114vWg0J",
483
+ "mask": "url(#mask-8)",
484
+ "x": "0.279",
485
+ "width": "77",
486
+ "height": "85"
487
+ }
488
+ })]), h("g", {
489
+ "attrs": {
490
+ "id": "el_34IgwiMB5rf"
491
+ }
492
+ }, [h("mask", {
493
+ "attrs": {
494
+ "id": "mask-10",
495
+ "fill": "#fff"
496
+ }
497
+ }, [h("use", {
498
+ "attrs": {
499
+ "xlink:href": "#path-9"
500
+ }
501
+ })]), h("path", {
502
+ "attrs": {
503
+ "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",
504
+ "id": "el_z5u6RAFhx7d",
505
+ "fillRule": "nonzero",
506
+ "mask": "url(#mask-10)"
507
+ }
508
+ }), h("rect", {
509
+ "attrs": {
510
+ "id": "el_7nfuWmA5Uhy",
511
+ "mask": "url(#mask-10)",
512
+ "x": "0.279",
513
+ "width": "77",
514
+ "height": "70"
515
+ }
516
+ })]), h("g", {
517
+ "attrs": {
518
+ "id": "el_DeebuCsPTGA"
519
+ }
520
+ }, [h("mask", {
521
+ "attrs": {
522
+ "id": "mask-12",
523
+ "fill": "#fff"
524
+ }
525
+ }, [h("use", {
526
+ "attrs": {
527
+ "xlink:href": "#path-11"
528
+ }
529
+ })]), h("path", {
530
+ "attrs": {
531
+ "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",
532
+ "id": "el__ZcqlS20zcw",
533
+ "fillRule": "nonzero",
534
+ "mask": "url(#mask-12)"
535
+ }
536
+ }), h("rect", {
537
+ "attrs": {
538
+ "id": "el_8DnEQnD7VWV",
539
+ "mask": "url(#mask-12)",
540
+ "x": "0.279",
541
+ "width": "77",
542
+ "height": "55"
543
+ }
544
+ })]), h("g", {
545
+ "attrs": {
546
+ "id": "el_ZOjjrPTvyrv"
547
+ }
548
+ }, [h("mask", {
549
+ "attrs": {
550
+ "id": "mask-14",
551
+ "fill": "#fff"
552
+ }
553
+ }, [h("use", {
554
+ "attrs": {
555
+ "xlink:href": "#path-13"
556
+ }
557
+ })]), h("path", {
558
+ "attrs": {
559
+ "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",
560
+ "id": "el_FYYKCI_u24e",
561
+ "fillRule": "nonzero",
562
+ "mask": "url(#mask-14)"
563
+ }
564
+ }), h("rect", {
565
+ "attrs": {
566
+ "id": "el_XZty4MnTp5Y",
567
+ "mask": "url(#mask-14)",
568
+ "x": "0.279",
569
+ "width": "77",
570
+ "height": "40"
571
+ }
572
+ })]), h("g", {
573
+ "attrs": {
574
+ "id": "el_2FATegVmf0K"
575
+ }
576
+ }, [h("mask", {
577
+ "attrs": {
578
+ "id": "mask-16",
579
+ "fill": "#fff"
580
+ }
581
+ }, [h("use", {
582
+ "attrs": {
583
+ "xlink:href": "#path-15"
584
+ }
585
+ })]), h("path", {
586
+ "attrs": {
587
+ "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",
588
+ "id": "el_RMT1KUfbdF8",
589
+ "fillRule": "nonzero",
590
+ "mask": "url(#mask-16)"
591
+ }
592
+ }), h("rect", {
593
+ "attrs": {
594
+ "id": "el_RgLcovvFiO1",
595
+ "mask": "url(#mask-16)",
596
+ "x": "0.279",
597
+ "width": "77",
598
+ "height": "25"
599
+ }
600
+ })])])])]);
601
+ }
602
+ };
603
+
604
+ var STATUS = {
605
+ inactive: 'INACTIVE',
606
+ stopped: 'STOPPED',
607
+ active: 'ACTIVE',
608
+ denied: 'DENIED'
609
+ };
610
+ var Mic = {
611
+ name: 'Mic',
612
+ props: {
613
+ children: vueTypes.types.title,
614
+ lang: VueTypes.string.def('en-US'),
615
+ iconPosition: VueTypes.string.def('left'),
616
+ handleResult: vueTypes.types.func,
617
+ onNoMatch: vueTypes.types.func,
618
+ onError: vueTypes.types.func,
619
+ getInstance: vueTypes.types.func,
620
+ render: vueTypes.types.func,
621
+ className: vueTypes.types.string,
622
+ applyClearStyle: VueTypes.bool,
623
+ showIcon: VueTypes.bool
624
+ },
625
+ methods: {
626
+ getComponent: function getComponent() {
627
+ var status = this.$data.status;
628
+ var data = {
629
+ handleClick: this.handleClick,
630
+ status: status
631
+ };
632
+ return index.getComponent(data, this);
633
+ },
634
+ stopMic: function stopMic() {
635
+ if (this.instance) {
636
+ this.status = STATUS.inactive;
637
+ this.instance.stop();
638
+ this.instance = null;
639
+ }
640
+ },
641
+ handleClick: function handleClick() {
642
+ var _this = this;
643
+
644
+ this.results = [];
645
+
646
+ if (window && window.SpeechRecognition) {
647
+ var status = this.$data.status;
648
+
649
+ if (status === STATUS.active) {
650
+ this.status = STATUS.inactive;
651
+ }
652
+
653
+ var _this$$props = this.$props,
654
+ handleResult = _this$$props.handleResult,
655
+ onNoMatch = _this$$props.onNoMatch,
656
+ onError = _this$$props.onError,
657
+ lang = _this$$props.lang,
658
+ getInstance = _this$$props.getInstance;
659
+ var _window = window,
660
+ SpeechRecognition = _window.SpeechRecognition;
661
+
662
+ if (this.instance && this.status !== STATUS.denied) {
663
+ this.status = STATUS.inactive;
664
+ this.instance.stop();
665
+ this.instance = null;
666
+ return;
667
+ }
668
+
669
+ this.instance = new SpeechRecognition();
670
+ this.instance.continuous = true;
671
+ this.instance.interimResults = true;
672
+ this.instance.lang = lang;
673
+
674
+ if (getInstance) {
675
+ getInstance(this.instance);
676
+ }
677
+
678
+ this.instance.start();
679
+
680
+ this.instance.onstart = function () {
681
+ _this.status = STATUS.active;
682
+ };
683
+
684
+ this.instance.onresult = function (_ref) {
685
+ var results = _ref.results,
686
+ timeStamp = _ref.timeStamp;
687
+
688
+ _this.stopMic();
689
+
690
+ if (handleResult) {
691
+ handleResult({
692
+ results: results,
693
+ timeStamp: timeStamp
694
+ });
695
+ }
696
+
697
+ _this.results.push({
698
+ results: results,
699
+ timeStamp: timeStamp
700
+ });
701
+ };
702
+
703
+ this.instance.onnomatch = function (e) {
704
+ return onNoMatch ? onNoMatch(e) : console.warn(e);
705
+ };
706
+
707
+ this.instance.onerror = function (e) {
708
+ if (e.error === 'no-speech' || e.error === 'audio-capture') {
709
+ _this.status = STATUS.inactive;
710
+ } else if (e.error === 'not-allowed') {
711
+ _this.status = STATUS.denied;
712
+ }
713
+
714
+ console.error(e);
715
+
716
+ if (onError) {
717
+ onError(e);
718
+ }
719
+ };
720
+ /* Below Two methods run when Continuous is False */
721
+
722
+
723
+ this.instance.onspeechend = function () {
724
+ _this.status = STATUS.inactive;
725
+ };
726
+
727
+ this.instance.onaudioend = function () {
728
+ _this.status = STATUS.inactive;
729
+ };
730
+ }
731
+ }
732
+ },
733
+ computed: {
734
+ hasCustomRenderer: function hasCustomRenderer() {
735
+ return index.hasCustomRenderer(this);
736
+ },
737
+ Icon: function Icon() {
738
+ var h = this.$createElement;
739
+ var status = this.$data.status;
740
+ var className = this.$props.className;
741
+
742
+ switch (status) {
743
+ case STATUS.active:
744
+ return h(ListenSvg, {
745
+ "attrs": {
746
+ "className": className
747
+ },
748
+ "nativeOn": {
749
+ "click": this.handleClick
750
+ }
751
+ });
752
+
753
+ case STATUS.stopped:
754
+ case STATUS.denied:
755
+ return h(MuteSvg, {
756
+ "attrs": {
757
+ "className": className
758
+ },
759
+ "nativeOn": {
760
+ "click": this.handleClick
761
+ }
762
+ });
763
+
764
+ default:
765
+ return h(MicSvg, {
766
+ "attrs": {
767
+ "className": className
768
+ },
769
+ "nativeOn": {
770
+ "click": this.handleClick
771
+ }
772
+ });
773
+ }
774
+ }
775
+ },
776
+ data: function data() {
777
+ return {
778
+ status: STATUS.inactive
779
+ };
780
+ },
781
+ created: function created() {
782
+ this.results = [];
783
+
784
+ if (typeof window !== 'undefined') {
785
+ window.SpeechRecognition = window.webkitSpeechRecognition || window.SpeechRecognition || null;
786
+
787
+ if (!window.SpeechRecognition) {
788
+ 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.');
789
+ }
790
+ }
791
+ },
792
+ render: function render() {
793
+ var h = arguments[0];
794
+
795
+ if (this.hasCustomRenderer) {
796
+ return this.getComponent();
797
+ }
798
+
799
+ return h(CancelSvg.IconWrapper, [this.Icon]);
800
+ }
801
+ };
802
+
803
+ var CustomSvg = {
804
+ name: 'CustomSvg',
805
+ props: {
806
+ className: String,
807
+ icon: Function,
808
+ type: String
809
+ },
810
+ data: function data() {
811
+ return {
812
+ customIcon: this.$props.icon && typeof this.$props.icon === 'function' ? this.$props.icon() : null
813
+ };
814
+ },
815
+ render: function render() {
816
+ var h = arguments[0];
817
+
818
+ if (this.customIcon) {
819
+ return h("div", {
820
+ "class": this.$props.className
821
+ }, [this.customIcon]);
822
+ }
823
+
824
+ if (this.$props.type === 'recent-search-icon') {
825
+ return h("svg", {
826
+ "attrs": {
827
+ "xmlns": "http://www.w3.org/2000/svg",
828
+ "alt": "Recent Search",
829
+ "height": "20",
830
+ "width": "20",
831
+ "viewBox": "0 0 24 24"
832
+ },
833
+ "style": {
834
+ fill: '#707070'
835
+ },
836
+ "class": this.$props.className
837
+ }, [h("path", {
838
+ "attrs": {
839
+ "d": "M0 0h24v24H0z",
840
+ "fill": "none"
841
+ }
842
+ }), h("path", {
843
+ "attrs": {
844
+ "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"
845
+ }
846
+ })]);
847
+ }
848
+
849
+ if (this.$props.type === 'promoted-search-icon') {
850
+ return h("svg", {
851
+ "attrs": {
852
+ "xmlns": "http://www.w3.org/2000/svg",
853
+ "width": "20",
854
+ "alt": "promoted search",
855
+ "height": "20",
856
+ "viewBox": "0 0 24 24"
857
+ },
858
+ "class": this.$props.className,
859
+ "style": {
860
+ fill: '#707070'
861
+ }
862
+ }, [h("path", {
863
+ "attrs": {
864
+ "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"
865
+ }
866
+ })]);
867
+ }
868
+
869
+ if (this.$props.type === 'popular-search-icon') {
870
+ return h("svg", {
871
+ "attrs": {
872
+ "xmlns": "http://www.w3.org/2000/svg",
873
+ "alt": "Popular Search",
874
+ "height": "20",
875
+ "width": "20",
876
+ "viewBox": "0 0 24 24"
877
+ },
878
+ "style": {
879
+ fill: '#707070'
880
+ },
881
+ "class": this.$props.className
882
+ }, [h("path", {
883
+ "attrs": {
884
+ "d": "M0 0h24v24H0z",
885
+ "fill": "none"
886
+ }
887
+ }), h("path", {
888
+ "attrs": {
889
+ "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"
890
+ }
891
+ })]);
892
+ }
893
+
894
+ return h(SearchSvg, {
895
+ "attrs": {
896
+ "styles": {
897
+ position: 'relative',
898
+ fill: '#707070',
899
+ left: '3px',
900
+ marginRight: '8px'
901
+ }
902
+ }
903
+ });
904
+ }
905
+ };
906
+
907
+ var _templateObject$6, _templateObject2;
908
+ var TagsContainer = styled__default('div')(_templateObject$6 || (_templateObject$6 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tmargin-top: 10px;\n\twidth: 100%;\n"])));
909
+ var TagItem = styled__default('span')(_templateObject2 || (_templateObject2 = _rollupPluginBabelHelpers._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"])));
910
+
911
+ var updateQuery = configureStore.Actions.updateQuery,
912
+ setQueryOptions = configureStore.Actions.setQueryOptions,
913
+ setCustomQuery = configureStore.Actions.setCustomQuery,
914
+ setDefaultQuery = configureStore.Actions.setDefaultQuery,
915
+ setCustomHighlightOptions = configureStore.Actions.setCustomHighlightOptions,
916
+ recordSuggestionClick = configureStore.Actions.recordSuggestionClick,
917
+ loadPopularSuggestions = configureStore.Actions.loadPopularSuggestions,
918
+ getRecentSearches = configureStore.Actions.getRecentSearches,
919
+ resetStoreForComponent = configureStore.Actions.resetStoreForComponent;
920
+ var debounce = configureStore.helper.debounce,
921
+ checkValueChange = configureStore.helper.checkValueChange,
922
+ getClassName$1 = configureStore.helper.getClassName,
923
+ extractQueryFromCustomQuery = configureStore.helper.extractQueryFromCustomQuery,
924
+ getOptionsForCustomQuery = configureStore.helper.getOptionsForCustomQuery,
925
+ isEqual = configureStore.helper.isEqual,
926
+ getCompositeAggsQuery = configureStore.helper.getCompositeAggsQuery,
927
+ withClickIds = configureStore.helper.withClickIds,
928
+ getResultStats = configureStore.helper.getResultStats,
929
+ handleOnSuggestions = configureStore.helper.handleOnSuggestions,
930
+ getTopSuggestions = configureStore.helper.getTopSuggestions,
931
+ normalizeDataField = configureStore.helper.normalizeDataField;
932
+ var DataSearch = {
933
+ name: 'DataSearch',
934
+ isTagsMode: false,
935
+ data: function data() {
936
+ var props = this.$props;
937
+ this.__state = {
938
+ currentValue: '',
939
+ selectedTags: [],
940
+ isOpen: false,
941
+ normalizedSuggestions: [],
942
+ isPending: false
943
+ };
944
+ this.internalComponent = props.componentId + "__internal";
945
+ return this.__state;
946
+ },
947
+ inject: {
948
+ theme: {
949
+ from: 'theme_reactivesearch'
950
+ }
951
+ },
952
+ created: function created() {
953
+ var _this$$props = this.$props,
954
+ enableQuerySuggestions = _this$$props.enableQuerySuggestions,
955
+ renderQuerySuggestions = _this$$props.renderQuerySuggestions,
956
+ enableRecentSearches = _this$$props.enableRecentSearches,
957
+ distinctField = _this$$props.distinctField,
958
+ distinctFieldConfig = _this$$props.distinctFieldConfig,
959
+ index$1 = _this$$props.index,
960
+ mode = _this$$props.mode;
961
+
962
+ if (mode === constants.SEARCH_COMPONENTS_MODES.TAG) {
963
+ this.$options.isTagsMode = true;
964
+ } // TODO: Remove in 2.0
965
+
966
+
967
+ if (enableQuerySuggestions) {
968
+ console.warn('Warning(ReactiveSearch): The `enableQuerySuggestions` prop has been marked as deprecated, please use the `enablePopularSuggestions` prop instead.');
969
+ } // TODO: Remove in 2.0
970
+
971
+
972
+ if (renderQuerySuggestions) {
973
+ console.warn('Warning(ReactiveSearch): The `renderQuerySuggestions` prop has been marked as deprecated, please use the `renderPopularSuggestions` prop instead.');
974
+ }
975
+
976
+ if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
977
+ console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
978
+ }
979
+
980
+ if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
981
+ console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
982
+ }
983
+
984
+ if (!this.enableAppbase && index$1) {
985
+ console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
986
+ }
987
+
988
+ this.currentValue = '';
989
+
990
+ if (this.$options.isTagsMode) {
991
+ this.currentValue = '';
992
+ }
993
+
994
+ var shouldFetchInitialSuggestions = this.$props.enableDefaultSuggestions || this.currentValue;
995
+
996
+ if (shouldFetchInitialSuggestions) {
997
+ this.loadPopularSuggestions(this.$props.componentId);
998
+
999
+ if (enableRecentSearches) {
1000
+ this.getRecentSearches();
1001
+ }
1002
+ }
1003
+
1004
+ this.handleTextChange = debounce(this.handleText, this.$props.debounce); // Set custom and default queries in store
1005
+
1006
+ index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
1007
+ index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
1008
+ },
1009
+ computed: {
1010
+ suggestionsList: function suggestionsList() {
1011
+ var suggestionsList = [];
1012
+
1013
+ if (!this.$data.currentValue && this.$props.defaultSuggestions && this.$props.defaultSuggestions.length) {
1014
+ suggestionsList = this.$props.defaultSuggestions;
1015
+ } else if (this.$data.currentValue) {
1016
+ suggestionsList = this.normalizedSuggestions;
1017
+ }
1018
+
1019
+ return withClickIds(suggestionsList);
1020
+ },
1021
+ topSuggestions: function topSuggestions() {
1022
+ if (!this.currentValue) {
1023
+ return [];
1024
+ }
1025
+
1026
+ return this.enableQuerySuggestions || this.enablePopularSuggestions ? this.normalizedPopularSuggestions : [];
1027
+ },
1028
+ normalizedRecentSearches: function normalizedRecentSearches() {
1029
+ return this.recentSearches || [];
1030
+ },
1031
+ normalizedPopularSuggestions: function normalizedPopularSuggestions() {
1032
+ return getTopSuggestions( // use default popular suggestions if value is empty
1033
+ this.currentValue ? this.popularSuggestions : this.defaultPopularSuggestions || [], this.currentValue, this.showDistinctSuggestions);
1034
+ },
1035
+ defaultSearchSuggestions: function defaultSearchSuggestions() {
1036
+ var isPopularSuggestionsEnabled = this.enableQuerySuggestions || this.enablePopularSuggestions;
1037
+
1038
+ if (this.currentValue || !this.enableDefaultSuggestions) {
1039
+ return [];
1040
+ }
1041
+
1042
+ var customDefaultPopularSuggestions = (this.defaultPopularSuggestions || []).map(function (suggestion) {
1043
+ return _rollupPluginBabelHelpers._extends({}, suggestion, {
1044
+ _popular_suggestion: true
1045
+ });
1046
+ });
1047
+ var customNormalizedRecentSearches = (this.normalizedRecentSearches || []).map(function (search) {
1048
+ return _rollupPluginBabelHelpers._extends({}, search, {
1049
+ _recent_search: true
1050
+ });
1051
+ });
1052
+ var defaultSuggestions = isPopularSuggestionsEnabled ? [].concat(customNormalizedRecentSearches, customDefaultPopularSuggestions || []) : customNormalizedRecentSearches;
1053
+ return getTopSuggestions( // use default popular suggestions if value is empty
1054
+ defaultSuggestions, this.currentValue, this.showDistinctSuggestions);
1055
+ },
1056
+ hasCustomRenderer: function hasCustomRenderer() {
1057
+ return index.hasCustomRenderer(this);
1058
+ },
1059
+ stats: function stats() {
1060
+ return getResultStats(this);
1061
+ }
1062
+ },
1063
+ props: {
1064
+ options: vueTypes.types.options,
1065
+ autoFocus: VueTypes.bool,
1066
+ autosuggest: VueTypes.bool.def(true),
1067
+ beforeValueChange: vueTypes.types.func,
1068
+ className: VueTypes.string.def(''),
1069
+ clearIcon: vueTypes.types.children,
1070
+ componentId: vueTypes.types.stringRequired,
1071
+ customHighlight: vueTypes.types.func,
1072
+ customQuery: vueTypes.types.func,
1073
+ defaultQuery: vueTypes.types.func,
1074
+ dataField: VueTypes.oneOfType([VueTypes.string, VueTypes.shape({
1075
+ field: VueTypes.string,
1076
+ weight: VueTypes.number
1077
+ }), VueTypes.arrayOf(VueTypes.string), VueTypes.arrayOf({
1078
+ field: VueTypes.string,
1079
+ weight: VueTypes.number
1080
+ })]),
1081
+ aggregationField: vueTypes.types.string,
1082
+ aggregationSize: VueTypes.number,
1083
+ size: VueTypes.number,
1084
+ debounce: VueTypes.number.def(0),
1085
+ defaultValue: vueTypes.types.string,
1086
+ excludeFields: vueTypes.types.excludeFields,
1087
+ value: VueTypes.oneOfType([VueTypes.arrayOf(VueTypes.string), vueTypes.types.value]),
1088
+ defaultSuggestions: vueTypes.types.suggestions,
1089
+ enableSynonyms: VueTypes.bool.def(true),
1090
+ enableQuerySuggestions: VueTypes.bool.def(false),
1091
+ enablePopularSuggestions: VueTypes.bool.def(false),
1092
+ enableRecentSearches: VueTypes.bool.def(false),
1093
+ fieldWeights: vueTypes.types.fieldWeights,
1094
+ filterLabel: vueTypes.types.string,
1095
+ fuzziness: vueTypes.types.fuzziness,
1096
+ highlight: VueTypes.bool,
1097
+ highlightField: vueTypes.types.stringOrArray,
1098
+ icon: vueTypes.types.children,
1099
+ iconPosition: VueTypes.oneOf(['left', 'right']).def('left'),
1100
+ includeFields: vueTypes.types.includeFields,
1101
+ innerClass: vueTypes.types.style,
1102
+ innerRef: VueTypes.string.def('searchInputField'),
1103
+ render: vueTypes.types.func,
1104
+ renderQuerySuggestions: vueTypes.types.func,
1105
+ renderPopularSuggestions: vueTypes.types.func,
1106
+ parseSuggestion: vueTypes.types.func,
1107
+ renderNoSuggestion: vueTypes.types.title,
1108
+ renderError: vueTypes.types.title,
1109
+ placeholder: VueTypes.string.def('Search'),
1110
+ queryFormat: VueTypes.oneOf(['and', 'or']).def('or'),
1111
+ react: vueTypes.types.react,
1112
+ showClear: VueTypes.bool.def(true),
1113
+ showDistinctSuggestions: VueTypes.bool.def(true),
1114
+ showFilter: VueTypes.bool.def(true),
1115
+ showIcon: VueTypes.bool.def(true),
1116
+ title: vueTypes.types.title,
1117
+ theme: vueTypes.types.style,
1118
+ URLParams: VueTypes.bool.def(false),
1119
+ strictSelection: VueTypes.bool.def(false),
1120
+ nestedField: vueTypes.types.string,
1121
+ enablePredictiveSuggestions: VueTypes.bool.def(false),
1122
+ recentSearchesIcon: VueTypes.any,
1123
+ popularSearchesIcon: VueTypes.any,
1124
+ // mic props
1125
+ showVoiceSearch: VueTypes.bool.def(false),
1126
+ getMicInstance: vueTypes.types.func,
1127
+ renderMic: vueTypes.types.func,
1128
+ distinctField: vueTypes.types.string,
1129
+ distinctFieldConfig: vueTypes.types.props,
1130
+ //
1131
+ focusShortcuts: VueTypes.arrayOf(VueTypes.oneOfType([VueTypes.string, VueTypes.number])).def(['/']),
1132
+ addonBefore: VueTypes.any,
1133
+ addonAfter: VueTypes.any,
1134
+ expandSuggestionsContainer: VueTypes.bool.def(true),
1135
+ index: VueTypes.string,
1136
+ enableDefaultSuggestions: VueTypes.bool.def(true),
1137
+ mode: VueTypes.oneOf(['select', 'tag']).def('select'),
1138
+ renderSelectedTags: VueTypes.any
1139
+ },
1140
+ beforeMount: function beforeMount() {
1141
+ if (this.$props.highlight) {
1142
+ if (this.customHighlight && typeof this.customHighlight === 'function') {
1143
+ this.setCustomHighlightOptions(this.componentId, this.customHighlight(this.$props));
1144
+ }
1145
+
1146
+ var queryOptions = DataSearch.highlightQuery(this.$props) || {};
1147
+ this.queryOptions = _rollupPluginBabelHelpers._extends({}, queryOptions, this.getBasicQueryOptions());
1148
+ this.setQueryOptions(this.$props.componentId, this.queryOptions);
1149
+ } else {
1150
+ this.queryOptions = this.getBasicQueryOptions();
1151
+ this.setQueryOptions(this.$props.componentId, this.queryOptions);
1152
+ }
1153
+
1154
+ if (this.selectedValue) {
1155
+ this.setValue(this.selectedValue, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
1156
+ } else if (this.$props.value) {
1157
+ this.setValue(this.$props.value, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
1158
+ } else if (this.$props.defaultValue) {
1159
+ this.setValue(this.$props.defaultValue, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
1160
+ }
1161
+ },
1162
+ mounted: function mounted() {
1163
+ this.listenForFocusShortcuts();
1164
+ },
1165
+ watch: {
1166
+ highlight: function highlight() {
1167
+ this.updateQueryOptions();
1168
+ },
1169
+ dataField: function dataField() {
1170
+ this.updateQueryOptions();
1171
+ this.updateQueryHandler(this.$props.componentId, this.$options.isTagsMode ? this.$data.selectedTags : this.$data.currentValue, this.$props);
1172
+ },
1173
+ highlightField: function highlightField() {
1174
+ this.updateQueryOptions();
1175
+ },
1176
+ fieldWeights: function fieldWeights() {
1177
+ this.updateQueryHandler(this.$props.componentId, this.$options.isTagsMode ? this.$data.selectedTags : this.$data.currentValue, this.$props);
1178
+ },
1179
+ fuzziness: function fuzziness() {
1180
+ this.updateQueryHandler(this.$props.componentId, this.$options.isTagsMode ? this.$data.selectedTags : this.$data.currentValue, this.$props);
1181
+ },
1182
+ queryFormat: function queryFormat() {
1183
+ this.updateQueryHandler(this.$props.componentId, this.$options.isTagsMode ? this.$data.selectedTags : this.$data.currentValue, this.$props);
1184
+ },
1185
+ defaultValue: function defaultValue(newVal) {
1186
+ this.setValue(newVal, true, this.$props);
1187
+ },
1188
+ value: function value(newVal, oldVal) {
1189
+ if (!isEqual(newVal, oldVal)) {
1190
+ this.setValue(newVal, true, this.$props, undefined, false);
1191
+ }
1192
+ },
1193
+ defaultQuery: function defaultQuery(newVal, oldVal) {
1194
+ if (!index.isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
1195
+ this.updateDefaultQueryHandler(this.$data.currentValue, this.$props);
1196
+ }
1197
+ },
1198
+ customQuery: function customQuery(newVal, oldVal) {
1199
+ if (!index.isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
1200
+ this.updateQueryHandler(this.componentId, this.$data.currentValue, this.$props);
1201
+ }
1202
+ },
1203
+ suggestions: function suggestions(newVal) {
1204
+ if (Array.isArray(newVal) && this.$data.currentValue.trim().length) {
1205
+ // shallow check allows us to set suggestions even if the next set
1206
+ // of suggestions are same as the current one
1207
+ this.$emit('suggestions', newVal);
1208
+ this.normalizedSuggestions = this.onSuggestions(newVal);
1209
+ }
1210
+ },
1211
+ selectedValue: function selectedValue(newVal, oldVal) {
1212
+ if (!isEqual(newVal, oldVal) && (this.$options.isTagsMode ? !isEqual(this.$data.selectedTags, newVal) : this.$data.currentValue !== newVal)) {
1213
+ if (!newVal && this.$data.currentValue) {
1214
+ // selected value is cleared, call onValueSelected
1215
+ this.onValueSelectedHandler('', configureStore.causes.CLEAR_VALUE);
1216
+ }
1217
+
1218
+ if (this.$options.isTagsMode) {
1219
+ // handling reset of tags through SelectedFilters or URL
1220
+ this.selectedTags = [];
1221
+ }
1222
+
1223
+ this.setValue(newVal || '', true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
1224
+ }
1225
+ },
1226
+ focusShortcuts: function focusShortcuts() {
1227
+ this.listenForFocusShortcuts();
1228
+ }
1229
+ },
1230
+ methods: {
1231
+ handleText: function handleText(value) {
1232
+ if (this.$props.autosuggest) {
1233
+ this.updateDefaultQueryHandler(value, this.$props);
1234
+ } else {
1235
+ this.updateQueryHandler(this.$props.componentId, value, this.$props);
1236
+ }
1237
+ },
1238
+ validateDataField: function validateDataField() {
1239
+ var propName = 'dataField';
1240
+ var componentName = DataSearch.name;
1241
+ var props = this.$props;
1242
+ var requiredError = propName + " supplied to " + componentName + " is required. Validation failed.";
1243
+ var propValue = props[propName];
1244
+
1245
+ if (!this.enableAppbase) {
1246
+ if (!propValue) {
1247
+ console.error(requiredError);
1248
+ return;
1249
+ }
1250
+
1251
+ if (typeof propValue !== 'string' && typeof propValue !== 'object' && !Array.isArray(propValue)) {
1252
+ console.error("Invalid " + propName + " supplied to " + componentName + ". Validation failed.");
1253
+ return;
1254
+ }
1255
+
1256
+ if (Array.isArray(propValue) && propValue.length === 0) {
1257
+ console.error(requiredError);
1258
+ }
1259
+ }
1260
+ },
1261
+ updateQueryOptions: function updateQueryOptions() {
1262
+ if (this.customHighlight && typeof this.customHighlight === 'function') {
1263
+ this.setCustomHighlightOptions(this.componentId, this.customHighlight(this.$props));
1264
+ }
1265
+
1266
+ var queryOptions = DataSearch.highlightQuery(this.$props) || {};
1267
+ this.queryOptions = _rollupPluginBabelHelpers._extends({}, queryOptions, this.getBasicQueryOptions());
1268
+ this.setQueryOptions(this.$props.componentId, this.queryOptions);
1269
+ },
1270
+ getComponent: function getComponent(downshiftProps, isQuerySuggestionsRender) {
1271
+ if (downshiftProps === void 0) {
1272
+ downshiftProps = {};
1273
+ }
1274
+
1275
+ if (isQuerySuggestionsRender === void 0) {
1276
+ isQuerySuggestionsRender = false;
1277
+ }
1278
+
1279
+ var currentValue = this.$data.currentValue;
1280
+ var data = {
1281
+ error: this.error,
1282
+ loading: this.isLoading,
1283
+ downshiftProps: downshiftProps,
1284
+ data: this.suggestionsList,
1285
+ promotedData: this.promotedResults,
1286
+ aggregationData: this.aggregationData,
1287
+ rawData: this.rawData,
1288
+ customData: this.customData,
1289
+ value: currentValue,
1290
+ triggerClickAnalytics: this.triggerClickAnalytics,
1291
+ resultStats: this.stats,
1292
+ querySuggestions: this.normalizedPopularSuggestions,
1293
+ popularSuggestions: this.normalizedPopularSuggestions
1294
+ };
1295
+
1296
+ if (isQuerySuggestionsRender) {
1297
+ return index.getQuerySuggestionsComponent({
1298
+ downshiftProps: downshiftProps,
1299
+ data: this.normalizedPopularSuggestions,
1300
+ value: currentValue,
1301
+ loading: this.isLoading,
1302
+ error: this.error
1303
+ }, this);
1304
+ }
1305
+
1306
+ return index.getComponent(data, this);
1307
+ },
1308
+ // returns size and aggs property
1309
+ getBasicQueryOptions: function getBasicQueryOptions() {
1310
+ var aggregationField = this.$props.aggregationField;
1311
+ var queryOptions = helper.getQueryOptions(this.$props);
1312
+
1313
+ if (aggregationField) {
1314
+ queryOptions.aggs = getCompositeAggsQuery({
1315
+ props: this.$props,
1316
+ showTopHits: true
1317
+ }).aggs;
1318
+ }
1319
+
1320
+ return queryOptions;
1321
+ },
1322
+ onSuggestions: function onSuggestions(results) {
1323
+ return handleOnSuggestions(results, this.$data.currentValue, this);
1324
+ },
1325
+ handleSearchIconClick: function handleSearchIconClick() {
1326
+ var currentValue = this.currentValue;
1327
+
1328
+ if (currentValue.trim()) {
1329
+ this.isPending = false;
1330
+ this.setValue(currentValue, true);
1331
+ this.onValueSelectedHandler(currentValue, configureStore.causes.SEARCH_ICON_CLICK);
1332
+ }
1333
+ },
1334
+ setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen) {
1335
+ var _this = this;
1336
+
1337
+ if (isDefaultValue === void 0) {
1338
+ isDefaultValue = false;
1339
+ }
1340
+
1341
+ if (props === void 0) {
1342
+ props = this.$props;
1343
+ }
1344
+
1345
+ if (toggleIsOpen === void 0) {
1346
+ toggleIsOpen = true;
1347
+ }
1348
+
1349
+ var performUpdate = function performUpdate() {
1350
+ if (_this.$options.isTagsMode && isEqual(value, _this.selectedTags)) {
1351
+ return;
1352
+ } // Refresh recent searches when value becomes empty
1353
+
1354
+
1355
+ if (!value && props.enableDefaultSuggestions === false) {
1356
+ _this.resetStoreForComponent(props.componentId);
1357
+ } else if (!value && _this.currentValue && _this.enableRecentSearches) {
1358
+ _this.getRecentSearches();
1359
+ }
1360
+
1361
+ if (_this.$options.isTagsMode && cause === configureStore.causes.SUGGESTION_SELECT) {
1362
+ if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
1363
+ // check if value already present in selectedTags
1364
+ if (typeof value === 'string' && _this.selectedTags.includes(value)) {
1365
+ _this.isOpen = false;
1366
+ return;
1367
+ }
1368
+
1369
+ _this.selectedTags = [].concat(_this.selectedTags);
1370
+
1371
+ if (typeof value === 'string' && !!value) {
1372
+ _this.selectedTags.push(value);
1373
+ } else if (Array.isArray(value) && !isEqual(_this.selectedTags, value)) {
1374
+ var mergedArray = Array.from(new Set([].concat(_this.selectedTags, value)));
1375
+ _this.selectedTags = mergedArray;
1376
+ }
1377
+ } else if (value) {
1378
+ _this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
1379
+ }
1380
+
1381
+ _this.currentValue = '';
1382
+ } else {
1383
+ _this.currentValue = value;
1384
+ }
1385
+
1386
+ var queryHandlerValue = value;
1387
+
1388
+ if (_this.$options.isTagsMode && cause === configureStore.causes.SUGGESTION_SELECT) {
1389
+ queryHandlerValue = Array.isArray(_this.selectedTags) && _this.selectedTags.length ? _this.selectedTags : undefined;
1390
+ }
1391
+
1392
+ if (isDefaultValue) {
1393
+ if (_this.$props.autosuggest) {
1394
+ if (toggleIsOpen) {
1395
+ _this.isOpen = false;
1396
+ }
1397
+
1398
+ if (typeof value === 'string') _this.updateDefaultQueryHandler(value, _this.$props);
1399
+ } // in case of strict selection only SUGGESTION_SELECT should be able
1400
+ // to set the query otherwise the value should reset
1401
+
1402
+
1403
+ if (props.strictSelection) {
1404
+ if (cause === configureStore.causes.SUGGESTION_SELECT || (_this.$options.isTagsMode ? _this.selectedTags.length === 0 : value === '')) {
1405
+ _this.updateQueryHandler(props.componentId, queryHandlerValue, props);
1406
+ } else {
1407
+ _this.setValue('', true);
1408
+ }
1409
+ } else {
1410
+ _this.updateQueryHandler(props.componentId, queryHandlerValue, props);
1411
+ }
1412
+ } else {
1413
+ // debounce for handling text while typing
1414
+ _this.handleTextChange(value);
1415
+ }
1416
+
1417
+ _this.$emit('valueChange', value);
1418
+
1419
+ _this.$emit('value-change', value); // Set the already fetched suggestions if query is same as used last to fetch the hits
1420
+
1421
+
1422
+ if (value === _this.lastUsedQuery) {
1423
+ _this.suggestions = _this.onSuggestions(_this.suggestions); // invoke on suggestions
1424
+
1425
+ _this.$emit('suggestions', _this.suggestions);
1426
+ } else if (!value) {
1427
+ // reset suggestions
1428
+ _this.suggestions = []; // invoke on suggestions
1429
+
1430
+ _this.$emit('suggestions', _this.suggestions);
1431
+ }
1432
+ };
1433
+
1434
+ checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
1435
+ },
1436
+ updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
1437
+ if (!value && props.enableDefaultSuggestions === false) {
1438
+ // clear Component data from store
1439
+ this.resetStoreForComponent(props.componentId);
1440
+ return;
1441
+ }
1442
+
1443
+ var defaultQueryOptions;
1444
+ var query = DataSearch.defaultQuery(value, props);
1445
+
1446
+ if (this.defaultQuery) {
1447
+ var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
1448
+ var defaultQueryObj = extractQueryFromCustomQuery(defaultQueryToBeSet);
1449
+
1450
+ if (defaultQueryObj) {
1451
+ query = defaultQueryObj;
1452
+ }
1453
+
1454
+ defaultQueryOptions = getOptionsForCustomQuery(defaultQueryToBeSet); // Update calculated default query in store
1455
+
1456
+ index.updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
1457
+ }
1458
+
1459
+ this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, this.queryOptions, defaultQueryOptions), false);
1460
+ this.updateQuery({
1461
+ componentId: this.internalComponent,
1462
+ query: query,
1463
+ value: value,
1464
+ componentType: constants.componentTypes.dataSearch
1465
+ });
1466
+ },
1467
+ updateQueryHandler: function updateQueryHandler(componentId, value, props) {
1468
+ var customQuery = props.customQuery,
1469
+ filterLabel = props.filterLabel,
1470
+ showFilter = props.showFilter,
1471
+ URLParams = props.URLParams;
1472
+ var customQueryOptions;
1473
+ var defaultQueryTobeSet = DataSearch.defaultQuery(value, props);
1474
+ var query = defaultQueryTobeSet;
1475
+
1476
+ if (customQuery) {
1477
+ var customQueryTobeSet = customQuery(value, props);
1478
+ var queryTobeSet = extractQueryFromCustomQuery(customQueryTobeSet);
1479
+
1480
+ if (queryTobeSet) {
1481
+ query = queryTobeSet;
1482
+ }
1483
+
1484
+ customQueryOptions = getOptionsForCustomQuery(customQueryTobeSet);
1485
+ index.updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
1486
+ this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, this.queryOptions, customQueryOptions), false);
1487
+ }
1488
+
1489
+ if (!this.isPending) {
1490
+ this.updateQuery({
1491
+ componentId: componentId,
1492
+ query: query,
1493
+ value: value,
1494
+ label: filterLabel,
1495
+ showFilter: showFilter,
1496
+ URLParams: URLParams,
1497
+ componentType: 'DATASEARCH'
1498
+ });
1499
+ }
1500
+ },
1501
+ // need to review
1502
+ handleFocus: function handleFocus(event) {
1503
+ this.isOpen = true;
1504
+ this.$emit('focus', event);
1505
+ },
1506
+ handleVoiceResults: function handleVoiceResults(_ref) {
1507
+ var results = _ref.results;
1508
+
1509
+ if (results && results[0] && results[0].isFinal && results[0][0] && results[0][0].transcript && results[0][0].transcript.trim()) {
1510
+ this.isPending = false;
1511
+ this.setValue(results[0][0].transcript.trim(), true);
1512
+ }
1513
+ },
1514
+ triggerQuery: function triggerQuery(_temp) {
1515
+ var _ref2 = _temp === void 0 ? false : _temp,
1516
+ _ref2$isOpen = _ref2.isOpen,
1517
+ isOpen = _ref2$isOpen === void 0 ? false : _ref2$isOpen;
1518
+
1519
+ var value = this.$props.value;
1520
+
1521
+ if (value !== undefined) {
1522
+ this.isPending = false;
1523
+ this.setValue(this.$props.value, !isOpen);
1524
+ }
1525
+ },
1526
+ triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
1527
+ // click analytics would only work client side and after javascript loads
1528
+ var docId = documentId;
1529
+
1530
+ if (!docId) {
1531
+ var hitData = this.suggestionsList.find(function (hit) {
1532
+ return hit._click_id === searchPosition;
1533
+ });
1534
+
1535
+ if (hitData && hitData.source && hitData.source._id) {
1536
+ docId = hitData.source._id;
1537
+ }
1538
+ }
1539
+
1540
+ this.recordSuggestionClick(searchPosition, docId);
1541
+ },
1542
+ clearValue: function clearValue() {
1543
+ this.isPending = false;
1544
+ this.setValue('', true);
1545
+ this.onValueSelectedHandler('', configureStore.causes.CLEAR_VALUE);
1546
+ },
1547
+ handleKeyDown: function handleKeyDown(event, highlightedIndex) {
1548
+ var value = this.$props.value;
1549
+
1550
+ if (value !== undefined) {
1551
+ this.isPending = true;
1552
+ } // if a suggestion was selected, delegate the handling to suggestion handler
1553
+
1554
+
1555
+ if (event.key === 'Enter' && highlightedIndex === null) {
1556
+ this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined // to handle tags
1557
+ );
1558
+ this.onValueSelectedHandler(event.target.value, configureStore.causes.ENTER_PRESS);
1559
+ } // Need to review
1560
+
1561
+
1562
+ this.$emit('keyDown', event, this.triggerQuery);
1563
+ this.$emit('key-down', event, this.triggerQuery);
1564
+ },
1565
+ onInputChange: function onInputChange(e) {
1566
+ var inputValue = e.target.value;
1567
+
1568
+ if (!this.$data.isOpen) {
1569
+ this.isOpen = true;
1570
+ }
1571
+
1572
+ var value = this.$props.value;
1573
+
1574
+ if (value === undefined) {
1575
+ this.setValue(inputValue);
1576
+ } else {
1577
+ this.isPending = true;
1578
+ this.$emit('change', inputValue, this.triggerQuery, e);
1579
+ }
1580
+ },
1581
+ onSuggestionSelected: function onSuggestionSelected(suggestion) {
1582
+ var value = this.$props.value; // Record analytics for selected suggestions
1583
+
1584
+ this.triggerClickAnalytics(suggestion._click_id);
1585
+
1586
+ if (value === undefined) {
1587
+ this.setValue(suggestion.value, true, this.$props, configureStore.causes.SUGGESTION_SELECT);
1588
+ } else if (this.$options.isTagsMode) {
1589
+ var emitValue = Array.isArray(this.selectedTags) ? [].concat(this.selectedTags) : [];
1590
+
1591
+ if (this.selectedTags.includes(suggestion.value)) {
1592
+ // avoid duplicates in tags array
1593
+ this.isOpen = false;
1594
+ return;
1595
+ }
1596
+
1597
+ emitValue.push(suggestion.value);
1598
+ this.setValue(emitValue, true, this.$props, configureStore.causes.SUGGESTION_SELECT, true);
1599
+ this.$emit('change', emitValue, this.triggerQuery);
1600
+ } else {
1601
+ this.$emit('change', suggestion.value, this.triggerQuery);
1602
+ }
1603
+
1604
+ this.isPending = false;
1605
+ this.onValueSelectedHandler(suggestion.value, configureStore.causes.SUGGESTION_SELECT, suggestion.source);
1606
+ },
1607
+ onValueSelectedHandler: function onValueSelectedHandler(currentValue) {
1608
+ if (currentValue === void 0) {
1609
+ currentValue = this.$data.currentValue;
1610
+ }
1611
+
1612
+ for (var _len = arguments.length, cause = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1613
+ cause[_key - 1] = arguments[_key];
1614
+ }
1615
+
1616
+ this.$emit.apply(this, ['valueSelected', currentValue].concat(cause));
1617
+ this.$emit.apply(this, ['value-selected', currentValue].concat(cause));
1618
+ },
1619
+ handleStateChange: function handleStateChange(changes) {
1620
+ var isOpen = changes.isOpen;
1621
+ this.isOpen = isOpen;
1622
+ },
1623
+ getBackgroundColor: function getBackgroundColor(highlightedIndex, index) {
1624
+ var isDark = this.themePreset === 'dark';
1625
+
1626
+ if (isDark) {
1627
+ return highlightedIndex === index ? '#555' : '#424242';
1628
+ }
1629
+
1630
+ return highlightedIndex === index ? '#eee' : '#fff';
1631
+ },
1632
+ renderIcon: function renderIcon() {
1633
+ var h = this.$createElement;
1634
+
1635
+ if (this.$props.showIcon) {
1636
+ return this.$props.icon || h(SearchSvg);
1637
+ }
1638
+
1639
+ return null;
1640
+ },
1641
+ renderErrorComponent: function renderErrorComponent() {
1642
+ var h = this.$createElement;
1643
+ var renderError = this.$scopedSlots.renderError || this.$props.renderError;
1644
+
1645
+ if (this.error && renderError && this.$data.currentValue && !this.isLoading) {
1646
+ return h(SuggestionWrapper, {
1647
+ "attrs": {
1648
+ "innerClass": this.$props.innerClass,
1649
+ "innerClassName": "error",
1650
+ "theme": this.theme,
1651
+ "themePreset": this.themePreset
1652
+ }
1653
+ }, [index.isFunction(renderError) ? renderError(this.error) : renderError]);
1654
+ }
1655
+
1656
+ return null;
1657
+ },
1658
+ renderCancelIcon: function renderCancelIcon() {
1659
+ var h = this.$createElement;
1660
+
1661
+ if (this.$props.showClear) {
1662
+ return this.$props.clearIcon || h(CancelSvg.CancelSvg);
1663
+ }
1664
+
1665
+ return null;
1666
+ },
1667
+ renderNoSuggestions: function renderNoSuggestions(finalSuggestionsList) {
1668
+ if (finalSuggestionsList === void 0) {
1669
+ finalSuggestionsList = [];
1670
+ }
1671
+
1672
+ var h = this.$createElement;
1673
+ var _this$$props2 = this.$props,
1674
+ theme = _this$$props2.theme,
1675
+ innerClass = _this$$props2.innerClass;
1676
+ var renderNoSuggestion = this.$scopedSlots.renderNoSuggestion || this.$props.renderNoSuggestion;
1677
+ var renderError = this.$scopedSlots.renderError || this.$props.renderError;
1678
+ var _this$$data = this.$data,
1679
+ isOpen = _this$$data.isOpen,
1680
+ currentValue = _this$$data.currentValue;
1681
+
1682
+ if (renderNoSuggestion && isOpen && !finalSuggestionsList.length && !this.isLoading && currentValue && !(renderError && this.error)) {
1683
+ return h(SuggestionWrapper, {
1684
+ "attrs": {
1685
+ "innerClass": innerClass,
1686
+ "themePreset": this.themePreset,
1687
+ "theme": theme,
1688
+ "innerClassName": "noSuggestion"
1689
+ },
1690
+ "scopedSlots": {
1691
+ "default": function _default() {
1692
+ return typeof renderNoSuggestion === 'function' ? renderNoSuggestion(currentValue) : renderNoSuggestion;
1693
+ }
1694
+ }
1695
+ });
1696
+ }
1697
+
1698
+ return null;
1699
+ },
1700
+ renderInputAddonBefore: function renderInputAddonBefore() {
1701
+ var h = this.$createElement;
1702
+ var addonBefore = this.$scopedSlots.addonBefore;
1703
+
1704
+ if (addonBefore) {
1705
+ return h(InputAddon, [addonBefore()]);
1706
+ }
1707
+
1708
+ return null;
1709
+ },
1710
+ renderTag: function renderTag(item) {
1711
+ var _this2 = this;
1712
+
1713
+ var h = this.$createElement;
1714
+ var innerClass = this.$props.innerClass;
1715
+ return h(TagItem, {
1716
+ "class": getClassName$1(innerClass, 'selected-tag') || ''
1717
+ }, [h("span", [item]), h("span", {
1718
+ "attrs": {
1719
+ "role": "img",
1720
+ "aria-label": "delete-tag"
1721
+ },
1722
+ "class": "close-icon",
1723
+ "on": {
1724
+ "click": function click() {
1725
+ return _this2.clearTag(item);
1726
+ }
1727
+ }
1728
+ }, [h(CancelSvg.CancelSvg)])]);
1729
+ },
1730
+ clearAllTags: function clearAllTags() {
1731
+ this.selectedTags = [];
1732
+ this.setValue('', true, this.$props, configureStore.causes.SUGGESTION_SELECT);
1733
+
1734
+ if (this.$props.value !== undefined) {
1735
+ this.$emit('change', this.selectedTags, this.triggerQuery);
1736
+ }
1737
+ },
1738
+ clearTag: function clearTag(tagValue) {
1739
+ this.selectedTags = [].concat(this.selectedTags.filter(function (tag) {
1740
+ return tag !== tagValue;
1741
+ }));
1742
+ this.setValue('', true, this.$props, configureStore.causes.SUGGESTION_SELECT);
1743
+
1744
+ if (this.$props.value !== undefined) {
1745
+ this.$emit('change', this.selectedTags, this.triggerQuery);
1746
+ }
1747
+ },
1748
+ renderTags: function renderTags() {
1749
+ var _this3 = this;
1750
+
1751
+ var h = this.$createElement;
1752
+
1753
+ if (!Array.isArray(this.selectedTags)) {
1754
+ return null;
1755
+ }
1756
+
1757
+ var tagsList = [].concat(this.selectedTags);
1758
+ var shouldRenderClearAllTag = tagsList.length > 1;
1759
+ var renderSelectedTags = this.$scopedSlots.renderSelectedTags || this.$props.renderSelectedTags;
1760
+ return renderSelectedTags ? renderSelectedTags({
1761
+ values: this.selectedTags,
1762
+ handleClear: this.clearTag,
1763
+ handleClearAll: this.clearAllTags
1764
+ }) : h(TagsContainer, [tagsList.map(function (item) {
1765
+ return _this3.renderTag(item);
1766
+ }), shouldRenderClearAllTag && h(TagItem, {
1767
+ "class": getClassName$1(this.$props.innerClass, 'selected-tag') || ''
1768
+ }, [h("span", ["Clear All"]), h("span", {
1769
+ "attrs": {
1770
+ "role": "img",
1771
+ "aria-label": "delete-tag"
1772
+ },
1773
+ "class": "close-icon",
1774
+ "on": {
1775
+ "click": this.clearAllTags
1776
+ }
1777
+ }, [h(CancelSvg.CancelSvg)])])]);
1778
+ },
1779
+ renderInputAddonAfter: function renderInputAddonAfter() {
1780
+ var h = this.$createElement;
1781
+ var addonAfter = this.$scopedSlots.addonAfter;
1782
+
1783
+ if (addonAfter) {
1784
+ return h(InputAddon, [addonAfter()]);
1785
+ }
1786
+
1787
+ return null;
1788
+ },
1789
+ renderIcons: function renderIcons() {
1790
+ var h = this.$createElement;
1791
+ var _this$$props3 = this.$props,
1792
+ iconPosition = _this$$props3.iconPosition,
1793
+ showClear = _this$$props3.showClear,
1794
+ innerClass = _this$$props3.innerClass,
1795
+ getMicInstance = _this$$props3.getMicInstance,
1796
+ showVoiceSearch = _this$$props3.showVoiceSearch,
1797
+ showIcon = _this$$props3.showIcon;
1798
+ var renderMic = this.$scopedSlots.renderMic || this.$props.renderMic;
1799
+ var currentValue = this.$data.currentValue;
1800
+ return h("div", [h(CancelSvg.IconGroup, {
1801
+ "attrs": {
1802
+ "groupPosition": "right",
1803
+ "positionType": "absolute"
1804
+ }
1805
+ }, [currentValue && showClear && h(CancelSvg.IconWrapper, {
1806
+ "on": {
1807
+ "click": this.clearValue
1808
+ },
1809
+ "attrs": {
1810
+ "showIcon": showIcon,
1811
+ "isClearIcon": true
1812
+ }
1813
+ }, [this.renderCancelIcon()]), showVoiceSearch && h(Mic, {
1814
+ "attrs": {
1815
+ "getInstance": getMicInstance,
1816
+ "render": renderMic,
1817
+ "handleResult": this.handleVoiceResults,
1818
+ "className": getClassName$1(innerClass, 'mic') || null
1819
+ }
1820
+ }), iconPosition === 'right' && showIcon && h(CancelSvg.IconWrapper, {
1821
+ "on": {
1822
+ "click": this.handleSearchIconClick
1823
+ }
1824
+ }, [this.renderIcon()])]), h(CancelSvg.IconGroup, {
1825
+ "attrs": {
1826
+ "groupPosition": "left",
1827
+ "positionType": "absolute"
1828
+ }
1829
+ }, [iconPosition === 'left' && showIcon && h(CancelSvg.IconWrapper, {
1830
+ "on": {
1831
+ "click": this.handleSearchIconClick
1832
+ }
1833
+ }, [this.renderIcon()])])]);
1834
+ },
1835
+ focusSearchBox: function focusSearchBox(event) {
1836
+ var _this$$refs, _this$$refs$this$$pro;
1837
+
1838
+ var elt = event.target || event.srcElement;
1839
+ var tagName = elt.tagName;
1840
+
1841
+ if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
1842
+ // already in an input
1843
+ return;
1844
+ }
1845
+
1846
+ (_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
1847
+ },
1848
+ listenForFocusShortcuts: function listenForFocusShortcuts() {
1849
+ var _this4 = this;
1850
+
1851
+ var _this$$props$focusSho = this.$props.focusShortcuts,
1852
+ focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
1853
+
1854
+ if (index.isEmpty(focusShortcuts)) {
1855
+ return;
1856
+ }
1857
+
1858
+ var shortcutsString = index.parseFocusShortcuts(focusShortcuts).join(','); // handler for alphabets and other key combinations
1859
+
1860
+ hotkeys(shortcutsString, // eslint-disable-next-line no-unused-vars
1861
+
1862
+ /* eslint-disable no-shadow */
1863
+ function (event, handler) {
1864
+ // Prevent the default refresh event under WINDOWS system
1865
+ event.preventDefault();
1866
+
1867
+ _this4.focusSearchBox(event);
1868
+ }); // if one of modifier keys are used, they are handled below
1869
+
1870
+ hotkeys('*', function (event) {
1871
+ var modifierKeys = index.extractModifierKeysFromFocusShortcuts(focusShortcuts);
1872
+ if (modifierKeys.length === 0) return;
1873
+
1874
+ for (var index$1 = 0; index$1 < modifierKeys.length; index$1 += 1) {
1875
+ var element = modifierKeys[index$1];
1876
+
1877
+ if (hotkeys[element]) {
1878
+ _this4.focusSearchBox(event);
1879
+
1880
+ break;
1881
+ }
1882
+ }
1883
+ });
1884
+ }
1885
+ },
1886
+ render: function render() {
1887
+ var _this5 = this;
1888
+
1889
+ var h = arguments[0];
1890
+ var _this$$props4 = this.$props,
1891
+ theme = _this$$props4.theme,
1892
+ size = _this$$props4.size,
1893
+ expandSuggestionsContainer = _this$$props4.expandSuggestionsContainer,
1894
+ enableDefaultSuggestions = _this$$props4.enableDefaultSuggestions;
1895
+ var _this$$scopedSlots = this.$scopedSlots,
1896
+ recentSearchesIcon = _this$$scopedSlots.recentSearchesIcon,
1897
+ popularSearchesIcon = _this$$scopedSlots.popularSearchesIcon;
1898
+ var hasSuggestions = this.currentValue ? this.suggestionsList.length || this.topSuggestions.length : this.defaultSearchSuggestions.length;
1899
+
1900
+ if (enableDefaultSuggestions === false && !this.currentValue) {
1901
+ hasSuggestions = false;
1902
+ }
1903
+
1904
+ return h(Container.Container, {
1905
+ "class": this.$props.className
1906
+ }, [this.$props.title && h(Title.Title, {
1907
+ "class": getClassName$1(this.$props.innerClass, 'title') || ''
1908
+ }, [this.$props.title]), this.$props.defaultSuggestions || this.$props.autosuggest ? h(CancelSvg.Downshift, {
1909
+ "attrs": {
1910
+ "id": this.$props.componentId + "-downshift",
1911
+ "handleChange": this.onSuggestionSelected,
1912
+ "handleMouseup": this.handleStateChange,
1913
+ "isOpen": this.$data.isOpen
1914
+ },
1915
+ "scopedSlots": {
1916
+ "default": function _default(_ref3) {
1917
+ var getInputEvents = _ref3.getInputEvents,
1918
+ getInputProps = _ref3.getInputProps,
1919
+ getItemProps = _ref3.getItemProps,
1920
+ getItemEvents = _ref3.getItemEvents,
1921
+ isOpen = _ref3.isOpen,
1922
+ highlightedIndex = _ref3.highlightedIndex,
1923
+ setHighlightedIndex = _ref3.setHighlightedIndex;
1924
+
1925
+ var renderSuggestionsContainer = function renderSuggestionsContainer() {
1926
+ return h("div", [_this5.hasCustomRenderer && _this5.getComponent({
1927
+ isOpen: isOpen,
1928
+ getItemProps: getItemProps,
1929
+ getItemEvents: getItemEvents,
1930
+ highlightedIndex: highlightedIndex
1931
+ }), _this5.renderErrorComponent(), !_this5.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
1932
+ "class": Input.suggestions(_this5.themePreset, theme) + " " + getClassName$1(_this5.$props.innerClass, 'list')
1933
+ }, [_this5.suggestionsList.slice(0, size || 10).map(function (item, index) {
1934
+ return h("li", {
1935
+ "domProps": _rollupPluginBabelHelpers._extends({}, getItemProps({
1936
+ item: item
1937
+ })),
1938
+ "on": _rollupPluginBabelHelpers._extends({}, getItemEvents({
1939
+ item: item
1940
+ })),
1941
+ "key": index + 1 + "-" + item.value,
1942
+ "style": {
1943
+ backgroundColor: _this5.getBackgroundColor(highlightedIndex, index)
1944
+ }
1945
+ }, [h(SuggestionItem, {
1946
+ "attrs": {
1947
+ "currentValue": _this5.currentValue,
1948
+ "suggestion": item
1949
+ }
1950
+ })]);
1951
+ }), _this5.defaultSearchSuggestions.map(function (sugg, index) {
1952
+ return h("li", {
1953
+ "domProps": _rollupPluginBabelHelpers._extends({}, getItemProps({
1954
+ item: sugg
1955
+ })),
1956
+ "on": _rollupPluginBabelHelpers._extends({}, getItemEvents({
1957
+ item: sugg
1958
+ })),
1959
+ "key": _this5.suggestionsList.length + index + 1 + "-" + sugg.value,
1960
+ "style": {
1961
+ backgroundColor: _this5.getBackgroundColor(highlightedIndex, _this5.suggestionsList.length + index),
1962
+ justifyContent: 'flex-start'
1963
+ }
1964
+ }, [h("div", {
1965
+ "style": {
1966
+ padding: '0 10px 0 0'
1967
+ }
1968
+ }, [sugg.source && sugg.source._recent_search && h(CustomSvg, {
1969
+ "attrs": {
1970
+ "className": getClassName$1(_this5.$props.innerClass, 'recent-search-icon') || null,
1971
+ "icon": recentSearchesIcon,
1972
+ "type": "recent-search-icon"
1973
+ }
1974
+ }), sugg.source && sugg.source._popular_suggestion && h(CustomSvg, {
1975
+ "attrs": {
1976
+ "className": getClassName$1(_this5.$props.innerClass, 'popular-search-icon') || null,
1977
+ "icon": popularSearchesIcon,
1978
+ "type": "popular-search-icon"
1979
+ }
1980
+ })]), h(SuggestionItem, {
1981
+ "attrs": {
1982
+ "currentValue": _this5.currentValue,
1983
+ "suggestion": sugg
1984
+ }
1985
+ })]);
1986
+ }), index.hasQuerySuggestionsRenderer(_this5) ? _this5.getComponent({
1987
+ isOpen: isOpen,
1988
+ getItemProps: getItemProps,
1989
+ getItemEvents: getItemEvents,
1990
+ highlightedIndex: highlightedIndex
1991
+ }, true) : _this5.topSuggestions.map(function (sugg, index) {
1992
+ return h("li", {
1993
+ "domProps": _rollupPluginBabelHelpers._extends({}, getItemProps({
1994
+ item: sugg
1995
+ })),
1996
+ "on": _rollupPluginBabelHelpers._extends({}, getItemEvents({
1997
+ item: sugg
1998
+ })),
1999
+ "key": _this5.suggestionsList.length + index + 1 + "-" + sugg.value,
2000
+ "style": {
2001
+ backgroundColor: _this5.getBackgroundColor(highlightedIndex, _this5.suggestionsList.length + index),
2002
+ justifyContent: 'flex-start'
2003
+ }
2004
+ }, [h("div", {
2005
+ "style": {
2006
+ padding: '0 10px 0 0'
2007
+ }
2008
+ }, [h(CustomSvg, {
2009
+ "attrs": {
2010
+ "className": getClassName$1(_this5.$props.innerClass, 'popular-search-icon') || null,
2011
+ "icon": popularSearchesIcon,
2012
+ "type": "popular-search-icon"
2013
+ }
2014
+ })]), h(SuggestionItem, {
2015
+ "attrs": {
2016
+ "currentValue": _this5.currentValue,
2017
+ "suggestion": sugg
2018
+ }
2019
+ })]);
2020
+ })]) : _this5.renderNoSuggestions(_this5.suggestionsList)]);
2021
+ };
2022
+
2023
+ return h("div", {
2024
+ "class": Input.suggestionsContainer
2025
+ }, [h(InputGroup, [_this5.renderInputAddonBefore(), h(CancelSvg.InputWrapper, [h(Input.Input, {
2026
+ "attrs": {
2027
+ "id": _this5.$props.componentId + "-input",
2028
+ "showIcon": _this5.$props.showIcon,
2029
+ "showClear": _this5.$props.showClear,
2030
+ "iconPosition": _this5.$props.iconPosition,
2031
+ "placeholder": _this5.$props.placeholder,
2032
+ "autoFocus": _this5.$props.autoFocus,
2033
+ "themePreset": _this5.themePreset,
2034
+ "autocomplete": "off"
2035
+ },
2036
+ "ref": _this5.$props.innerRef,
2037
+ "class": getClassName$1(_this5.$props.innerClass, 'input'),
2038
+ "on": _rollupPluginBabelHelpers._extends({}, getInputEvents({
2039
+ onInput: _this5.onInputChange,
2040
+ onBlur: function onBlur(e) {
2041
+ _this5.$emit('blur', e, _this5.triggerQuery);
2042
+ },
2043
+ onFocus: _this5.handleFocus,
2044
+ onKeyPress: function onKeyPress(e) {
2045
+ _this5.$emit('keyPress', e, _this5.triggerQuery);
2046
+
2047
+ _this5.$emit('key-press', e, _this5.triggerQuery);
2048
+ },
2049
+ onKeyDown: function onKeyDown(e) {
2050
+ return _this5.handleKeyDown(e, highlightedIndex);
2051
+ },
2052
+ onKeyUp: function onKeyUp(e) {
2053
+ _this5.$emit('keyUp', e, _this5.triggerQuery);
2054
+
2055
+ _this5.$emit('key-up', e, _this5.triggerQuery);
2056
+ },
2057
+ onClick: function onClick() {
2058
+ setHighlightedIndex(null);
2059
+ }
2060
+ })),
2061
+ "domProps": _rollupPluginBabelHelpers._extends({}, getInputProps({
2062
+ value: _this5.$data.currentValue === null ? '' : _this5.$data.currentValue
2063
+ }))
2064
+ }), _this5.renderIcons(), !expandSuggestionsContainer && renderSuggestionsContainer()]), ' ', _this5.renderInputAddonAfter()]), expandSuggestionsContainer && renderSuggestionsContainer(), _this5.renderTags()]);
2065
+ }
2066
+ }
2067
+ }) : h("div", {
2068
+ "class": Input.suggestionsContainer
2069
+ }, [h(InputGroup, [this.renderInputAddonBefore(), h(CancelSvg.InputWrapper, [h(Input.Input, {
2070
+ "class": getClassName$1(this.$props.innerClass, 'input') || '',
2071
+ "attrs": {
2072
+ "placeholder": this.$props.placeholder,
2073
+ "iconPosition": this.$props.iconPosition,
2074
+ "showIcon": this.$props.showIcon,
2075
+ "showClear": this.$props.showClear,
2076
+ "themePreset": this.themePreset
2077
+ },
2078
+ "on": _rollupPluginBabelHelpers._extends({}, {
2079
+ blur: function blur(e) {
2080
+ _this5.$emit('blur', e, _this5.triggerQuery);
2081
+ },
2082
+ keypress: function keypress(e) {
2083
+ _this5.$emit('keyPress', e, _this5.triggerQuery);
2084
+
2085
+ _this5.$emit('key-press', e, _this5.triggerQuery);
2086
+ },
2087
+ input: this.onInputChange,
2088
+ focus: function focus(e) {
2089
+ _this5.$emit('focus', e, _this5.triggerQuery);
2090
+ },
2091
+ keydown: function keydown(e) {
2092
+ _this5.$emit('keyDown', e, _this5.triggerQuery);
2093
+
2094
+ _this5.$emit('key-down', e, _this5.triggerQuery);
2095
+ },
2096
+ keyup: function keyup(e) {
2097
+ _this5.$emit('keyUp', e, _this5.triggerQuery);
2098
+
2099
+ _this5.$emit('key-up', e, _this5.triggerQuery);
2100
+ }
2101
+ }),
2102
+ "domProps": _rollupPluginBabelHelpers._extends({}, {
2103
+ autofocus: this.$props.autoFocus,
2104
+ value: this.$data.currentValue ? this.$data.currentValue : ''
2105
+ }),
2106
+ "ref": this.$props.innerRef
2107
+ }), this.renderIcons()]), this.renderInputAddonAfter()])])]);
2108
+ },
2109
+ destroyed: function destroyed() {
2110
+ document.removeEventListener('keydown', this.onKeyDown);
2111
+ }
2112
+ };
2113
+
2114
+ DataSearch.defaultQuery = function (value, props) {
2115
+ var finalQuery = null;
2116
+
2117
+ if (value) {
2118
+ var fields = normalizeDataField(props.dataField, props.fieldWeights);
2119
+ finalQuery = {
2120
+ bool: {
2121
+ should: DataSearch.shouldQuery(value, fields, props),
2122
+ minimum_should_match: '1'
2123
+ }
2124
+ };
2125
+ }
2126
+
2127
+ if (value === '') {
2128
+ finalQuery = null;
2129
+ }
2130
+
2131
+ if (finalQuery && props.nestedField) {
2132
+ return {
2133
+ query: {
2134
+ nested: {
2135
+ path: props.nestedField,
2136
+ query: finalQuery
2137
+ }
2138
+ }
2139
+ };
2140
+ }
2141
+
2142
+ return finalQuery;
2143
+ };
2144
+
2145
+ DataSearch.shouldQuery = function (value, dataFields, props) {
2146
+ var finalQuery = [];
2147
+ var phrasePrefixFields = [];
2148
+ var fields = dataFields.map(function (dataField) {
2149
+ var queryField = "" + dataField.field + (dataField.weight ? "^" + dataField.weight : '');
2150
+
2151
+ if (!(dataField.field.endsWith('.keyword') || dataField.field.endsWith('.autosuggest') || dataField.field.endsWith('.search'))) {
2152
+ phrasePrefixFields.push(queryField);
2153
+ }
2154
+
2155
+ return queryField;
2156
+ });
2157
+
2158
+ if (props.searchOperators || props.queryString) {
2159
+ return {
2160
+ query: value,
2161
+ fields: fields,
2162
+ default_operator: props.queryFormat
2163
+ };
2164
+ }
2165
+
2166
+ if (props.queryFormat === 'and') {
2167
+ finalQuery.push({
2168
+ multi_match: {
2169
+ query: value,
2170
+ fields: fields,
2171
+ type: 'cross_fields',
2172
+ operator: 'and'
2173
+ }
2174
+ });
2175
+ finalQuery.push({
2176
+ multi_match: {
2177
+ query: value,
2178
+ fields: fields,
2179
+ type: 'phrase',
2180
+ operator: 'and'
2181
+ }
2182
+ });
2183
+
2184
+ if (phrasePrefixFields.length > 0) {
2185
+ finalQuery.push({
2186
+ multi_match: {
2187
+ query: value,
2188
+ fields: phrasePrefixFields,
2189
+ type: 'phrase_prefix',
2190
+ operator: 'and'
2191
+ }
2192
+ });
2193
+ }
2194
+
2195
+ return finalQuery;
2196
+ }
2197
+
2198
+ finalQuery.push({
2199
+ multi_match: {
2200
+ query: value,
2201
+ fields: fields,
2202
+ type: 'best_fields',
2203
+ operator: 'or',
2204
+ fuzziness: props.fuzziness ? props.fuzziness : 0
2205
+ }
2206
+ });
2207
+ finalQuery.push({
2208
+ multi_match: {
2209
+ query: value,
2210
+ fields: fields,
2211
+ type: 'phrase',
2212
+ operator: 'or'
2213
+ }
2214
+ });
2215
+
2216
+ if (phrasePrefixFields.length > 0) {
2217
+ finalQuery.push({
2218
+ multi_match: {
2219
+ query: value,
2220
+ fields: phrasePrefixFields,
2221
+ type: 'phrase_prefix',
2222
+ operator: 'or'
2223
+ }
2224
+ });
2225
+ }
2226
+
2227
+ return finalQuery;
2228
+ };
2229
+
2230
+ DataSearch.highlightQuery = function (props) {
2231
+ if (props.customHighlight) {
2232
+ return props.customHighlight(props);
2233
+ }
2234
+
2235
+ if (!props.highlight) {
2236
+ return null;
2237
+ }
2238
+
2239
+ var fields = {};
2240
+ var highlightField = props.highlightField ? props.highlightField : props.dataField;
2241
+
2242
+ if (typeof highlightField === 'string') {
2243
+ fields[highlightField] = {};
2244
+ } else if (Array.isArray(highlightField)) {
2245
+ highlightField.forEach(function (item) {
2246
+ fields[item] = {};
2247
+ });
2248
+ }
2249
+
2250
+ return {
2251
+ highlight: _rollupPluginBabelHelpers._extends({
2252
+ pre_tags: ['<mark>'],
2253
+ post_tags: ['</mark>'],
2254
+ fields: fields
2255
+ }, props.highlightField && {
2256
+ require_field_match: false
2257
+ })
2258
+ };
2259
+ };
2260
+
2261
+ DataSearch.hasInternalComponent = function () {
2262
+ return true;
2263
+ };
2264
+
2265
+ var mapStateToProps = function mapStateToProps(state, props) {
2266
+ return {
2267
+ selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
2268
+ suggestions: state.hits[props.componentId] && state.hits[props.componentId].hits,
2269
+ rawData: state.rawData[props.componentId],
2270
+ aggregationData: state.compositeAggregations[props.componentId] || [],
2271
+ isLoading: !!state.isLoading[props.componentId + "_active"],
2272
+ themePreset: state.config.themePreset,
2273
+ error: state.error[props.componentId],
2274
+ analytics: state.analytics,
2275
+ enableAppbase: state.config.enableAppbase,
2276
+ headers: state.appbaseRef.headers,
2277
+ promotedResults: state.promotedResults[props.componentId] || [],
2278
+ customData: state.customData[props.componentId],
2279
+ time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
2280
+ total: state.hits[props.componentId] && state.hits[props.componentId].total,
2281
+ hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
2282
+ popularSuggestions: state.querySuggestions[props.componentId],
2283
+ defaultPopularSuggestions: state.defaultPopularSuggestions[props.componentId],
2284
+ componentProps: state.props[props.componentId],
2285
+ lastUsedQuery: state.queryToHits[props.componentId],
2286
+ recentSearches: state.recentSearches.data
2287
+ };
2288
+ };
2289
+
2290
+ var mapDispatchToProps = {
2291
+ setQueryOptions: setQueryOptions,
2292
+ updateQuery: updateQuery,
2293
+ setCustomQuery: setCustomQuery,
2294
+ setDefaultQuery: setDefaultQuery,
2295
+ setCustomHighlightOptions: setCustomHighlightOptions,
2296
+ recordSuggestionClick: recordSuggestionClick,
2297
+ loadPopularSuggestions: loadPopularSuggestions,
2298
+ getRecentSearches: getRecentSearches,
2299
+ resetStoreForComponent: resetStoreForComponent
2300
+ };
2301
+ var DSConnected = ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps, mapDispatchToProps)(DataSearch), {
2302
+ componentType: constants.componentTypes.dataSearch,
2303
+ internalComponent: DataSearch.hasInternalComponent()
2304
+ });
2305
+
2306
+ DataSearch.install = function (Vue) {
2307
+ Vue.component(DataSearch.name, DSConnected);
2308
+ }; // Add componentType for SSR
2309
+
2310
+
2311
+ DataSearch.componentType = constants.componentTypes.dataSearch;
2312
+
2313
+ exports.CustomSvg = CustomSvg;
2314
+ exports.DataSearch = DataSearch;
2315
+ exports.InputAddon = InputAddon;
2316
+ exports.InputGroup = InputGroup;
2317
+ exports.Mic = Mic;
2318
+ exports.SearchSvg = SearchSvg;
2319
+ exports.SuggestionItem = SuggestionItem;
2320
+ exports.SuggestionWrapper = SuggestionWrapper;
2321
+ exports.TagItem = TagItem;
2322
+ exports.TagsContainer = TagsContainer;