@indxsearch/intrface 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +63 -0
- package/LICENSE +1 -1
- package/README.md +11 -0
- package/dist/context/SearchContext.d.ts +1 -1
- package/dist/index.es.js +752 -770
- package/dist/index.umd.js +4 -4
- package/package.json +9 -3
package/dist/index.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var gt = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var tt = (r, o,
|
|
2
|
+
var pt = (r, o, u) => o in r ? gt(r, o, { enumerable: !0, configurable: !0, writable: !0, value: u }) : r[o] = u;
|
|
3
|
+
var tt = (r, o, u) => pt(r, typeof o != "symbol" ? o + "" : o, u);
|
|
4
4
|
import "@indxsearch/systm/styles.css";
|
|
5
|
-
import re, { createContext as
|
|
6
|
-
import { SearchField as
|
|
7
|
-
var
|
|
5
|
+
import re, { createContext as vt, useRef as he, useState as G, useEffect as ie, useCallback as ae, useContext as xt, memo as it, useMemo as Ue, Component as bt } from "react";
|
|
6
|
+
import { SearchField as yt, Button as ye, FilterPanelBase as be, ToggleSwitch as le, Checkbox as rt, Slider as lt, InputField as K, Select as St, RadioButton as jt } from "@indxsearch/systm";
|
|
7
|
+
var Be = { exports: {} }, Pe = {};
|
|
8
8
|
/**
|
|
9
9
|
* @license React
|
|
10
10
|
* react-jsx-runtime.production.js
|
|
@@ -15,26 +15,26 @@ var qe = { exports: {} }, Pe = {};
|
|
|
15
15
|
* LICENSE file in the root directory of this source tree.
|
|
16
16
|
*/
|
|
17
17
|
var nt;
|
|
18
|
-
function
|
|
18
|
+
function Ct() {
|
|
19
19
|
if (nt) return Pe;
|
|
20
20
|
nt = 1;
|
|
21
21
|
var r = Symbol.for("react.transitional.element"), o = Symbol.for("react.fragment");
|
|
22
|
-
function
|
|
23
|
-
var
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
for (var
|
|
27
|
-
|
|
28
|
-
} else
|
|
29
|
-
return
|
|
22
|
+
function u(s, c, p) {
|
|
23
|
+
var j = null;
|
|
24
|
+
if (p !== void 0 && (j = "" + p), c.key !== void 0 && (j = "" + c.key), "key" in c) {
|
|
25
|
+
p = {};
|
|
26
|
+
for (var m in c)
|
|
27
|
+
m !== "key" && (p[m] = c[m]);
|
|
28
|
+
} else p = c;
|
|
29
|
+
return c = p.ref, {
|
|
30
30
|
$$typeof: r,
|
|
31
31
|
type: s,
|
|
32
|
-
key:
|
|
33
|
-
ref:
|
|
34
|
-
props:
|
|
32
|
+
key: j,
|
|
33
|
+
ref: c !== void 0 ? c : null,
|
|
34
|
+
props: p
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
return Pe.Fragment = o, Pe.jsx =
|
|
37
|
+
return Pe.Fragment = o, Pe.jsx = u, Pe.jsxs = u, Pe;
|
|
38
38
|
}
|
|
39
39
|
var He = {};
|
|
40
40
|
/**
|
|
@@ -47,25 +47,25 @@ var He = {};
|
|
|
47
47
|
* LICENSE file in the root directory of this source tree.
|
|
48
48
|
*/
|
|
49
49
|
var st;
|
|
50
|
-
function
|
|
50
|
+
function wt() {
|
|
51
51
|
return st || (st = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
52
52
|
function r(e) {
|
|
53
53
|
if (e == null) return null;
|
|
54
54
|
if (typeof e == "function")
|
|
55
|
-
return e.$$typeof ===
|
|
55
|
+
return e.$$typeof === Q ? null : e.displayName || e.name || null;
|
|
56
56
|
if (typeof e == "string") return e;
|
|
57
57
|
switch (e) {
|
|
58
|
-
case
|
|
58
|
+
case v:
|
|
59
59
|
return "Fragment";
|
|
60
60
|
case g:
|
|
61
61
|
return "Profiler";
|
|
62
|
-
case
|
|
62
|
+
case _:
|
|
63
63
|
return "StrictMode";
|
|
64
|
-
case
|
|
64
|
+
case b:
|
|
65
65
|
return "Suspense";
|
|
66
|
-
case
|
|
66
|
+
case d:
|
|
67
67
|
return "SuspenseList";
|
|
68
|
-
case
|
|
68
|
+
case V:
|
|
69
69
|
return "Activity";
|
|
70
70
|
}
|
|
71
71
|
if (typeof e == "object")
|
|
@@ -74,16 +74,16 @@ function Ct() {
|
|
|
74
74
|
), e.$$typeof) {
|
|
75
75
|
case q:
|
|
76
76
|
return "Portal";
|
|
77
|
-
case
|
|
77
|
+
case W:
|
|
78
78
|
return e.displayName || "Context";
|
|
79
79
|
case x:
|
|
80
80
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
81
|
-
case
|
|
81
|
+
case h:
|
|
82
82
|
var a = e.render;
|
|
83
83
|
return e = e.displayName, e || (e = a.displayName || a.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
84
|
-
case
|
|
84
|
+
case X:
|
|
85
85
|
return a = e.displayName || null, a !== null ? a : r(e.type) || "Memo";
|
|
86
|
-
case
|
|
86
|
+
case z:
|
|
87
87
|
a = e._payload, e = e._init;
|
|
88
88
|
try {
|
|
89
89
|
return r(e(a));
|
|
@@ -95,7 +95,7 @@ function Ct() {
|
|
|
95
95
|
function o(e) {
|
|
96
96
|
return "" + e;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function u(e) {
|
|
99
99
|
try {
|
|
100
100
|
o(e);
|
|
101
101
|
var a = !1;
|
|
@@ -104,17 +104,17 @@ function Ct() {
|
|
|
104
104
|
}
|
|
105
105
|
if (a) {
|
|
106
106
|
a = console;
|
|
107
|
-
var
|
|
108
|
-
return
|
|
107
|
+
var y = a.error, E = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
108
|
+
return y.call(
|
|
109
109
|
a,
|
|
110
110
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
111
|
-
|
|
111
|
+
E
|
|
112
112
|
), o(e);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
function s(e) {
|
|
116
|
-
if (e ===
|
|
117
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
116
|
+
if (e === v) return "<>";
|
|
117
|
+
if (typeof e == "object" && e !== null && e.$$typeof === z)
|
|
118
118
|
return "<...>";
|
|
119
119
|
try {
|
|
120
120
|
var a = r(e);
|
|
@@ -123,47 +123,47 @@ function Ct() {
|
|
|
123
123
|
return "<...>";
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function c() {
|
|
127
127
|
var e = O.A;
|
|
128
128
|
return e === null ? null : e.getOwner();
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function p() {
|
|
131
131
|
return Error("react-stack-top-frame");
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function j(e) {
|
|
134
134
|
if (pe.call(e, "key")) {
|
|
135
135
|
var a = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
136
136
|
if (a && a.isReactWarning) return !1;
|
|
137
137
|
}
|
|
138
138
|
return e.key !== void 0;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
function
|
|
142
|
-
|
|
140
|
+
function m(e, a) {
|
|
141
|
+
function y() {
|
|
142
|
+
U || (U = !0, console.error(
|
|
143
143
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
144
144
|
a
|
|
145
145
|
));
|
|
146
146
|
}
|
|
147
|
-
|
|
148
|
-
get:
|
|
147
|
+
y.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
148
|
+
get: y,
|
|
149
149
|
configurable: !0
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
function n() {
|
|
153
153
|
var e = r(this.type);
|
|
154
|
-
return
|
|
154
|
+
return ce[e] || (ce[e] = !0, console.error(
|
|
155
155
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
156
156
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
var
|
|
158
|
+
function C(e, a, y, E, ue, ve) {
|
|
159
|
+
var T = y.ref;
|
|
160
160
|
return e = {
|
|
161
161
|
$$typeof: ne,
|
|
162
162
|
type: e,
|
|
163
163
|
key: a,
|
|
164
|
-
props:
|
|
165
|
-
_owner:
|
|
166
|
-
}, (
|
|
164
|
+
props: y,
|
|
165
|
+
_owner: E
|
|
166
|
+
}, (T !== void 0 ? T : null) !== null ? Object.defineProperty(e, "ref", {
|
|
167
167
|
enumerable: !1,
|
|
168
168
|
get: n
|
|
169
169
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
@@ -180,149 +180,149 @@ function Ct() {
|
|
|
180
180
|
configurable: !1,
|
|
181
181
|
enumerable: !1,
|
|
182
182
|
writable: !0,
|
|
183
|
-
value:
|
|
183
|
+
value: ue
|
|
184
184
|
}), Object.defineProperty(e, "_debugTask", {
|
|
185
185
|
configurable: !1,
|
|
186
186
|
enumerable: !1,
|
|
187
187
|
writable: !0,
|
|
188
|
-
value:
|
|
188
|
+
value: ve
|
|
189
189
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
190
190
|
}
|
|
191
|
-
function
|
|
192
|
-
var
|
|
193
|
-
if (
|
|
194
|
-
if (
|
|
195
|
-
if (P(
|
|
196
|
-
for (
|
|
197
|
-
|
|
198
|
-
Object.freeze && Object.freeze(
|
|
191
|
+
function A(e, a, y, E, ue, ve) {
|
|
192
|
+
var T = a.children;
|
|
193
|
+
if (T !== void 0)
|
|
194
|
+
if (E)
|
|
195
|
+
if (P(T)) {
|
|
196
|
+
for (E = 0; E < T.length; E++)
|
|
197
|
+
k(T[E]);
|
|
198
|
+
Object.freeze && Object.freeze(T);
|
|
199
199
|
} else
|
|
200
200
|
console.error(
|
|
201
201
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
202
202
|
);
|
|
203
|
-
else
|
|
203
|
+
else k(T);
|
|
204
204
|
if (pe.call(a, "key")) {
|
|
205
|
-
|
|
206
|
-
var
|
|
207
|
-
return
|
|
205
|
+
T = r(e);
|
|
206
|
+
var de = Object.keys(a).filter(function(ke) {
|
|
207
|
+
return ke !== "key";
|
|
208
208
|
});
|
|
209
|
-
|
|
209
|
+
E = 0 < de.length ? "{key: someKey, " + de.join(": ..., ") + ": ...}" : "{key: someKey}", R[T + E] || (de = 0 < de.length ? "{" + de.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
210
210
|
`A props object containing a "key" prop is being spread into JSX:
|
|
211
211
|
let props = %s;
|
|
212
212
|
<%s {...props} />
|
|
213
213
|
React keys must be passed directly to JSX without using spread:
|
|
214
214
|
let props = %s;
|
|
215
215
|
<%s key={someKey} {...props} />`,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
),
|
|
216
|
+
E,
|
|
217
|
+
T,
|
|
218
|
+
de,
|
|
219
|
+
T
|
|
220
|
+
), R[T + E] = !0);
|
|
221
221
|
}
|
|
222
|
-
if (
|
|
223
|
-
|
|
224
|
-
for (var
|
|
225
|
-
|
|
226
|
-
} else
|
|
227
|
-
return
|
|
228
|
-
|
|
222
|
+
if (T = null, y !== void 0 && (u(y), T = "" + y), j(a) && (u(a.key), T = "" + a.key), "key" in a) {
|
|
223
|
+
y = {};
|
|
224
|
+
for (var xe in a)
|
|
225
|
+
xe !== "key" && (y[xe] = a[xe]);
|
|
226
|
+
} else y = a;
|
|
227
|
+
return T && m(
|
|
228
|
+
y,
|
|
229
229
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
230
|
-
),
|
|
230
|
+
), C(
|
|
231
231
|
e,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
232
|
+
T,
|
|
233
|
+
y,
|
|
234
|
+
c(),
|
|
235
|
+
ue,
|
|
236
|
+
ve
|
|
237
237
|
);
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
L(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof ===
|
|
239
|
+
function k(e) {
|
|
240
|
+
L(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === z && (e._payload.status === "fulfilled" ? L(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
241
241
|
}
|
|
242
242
|
function L(e) {
|
|
243
243
|
return typeof e == "object" && e !== null && e.$$typeof === ne;
|
|
244
244
|
}
|
|
245
|
-
var
|
|
245
|
+
var M = re, ne = Symbol.for("react.transitional.element"), q = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), W = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), b = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), X = Symbol.for("react.memo"), z = Symbol.for("react.lazy"), V = Symbol.for("react.activity"), Q = Symbol.for("react.client.reference"), O = M.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, pe = Object.prototype.hasOwnProperty, P = Array.isArray, w = console.createTask ? console.createTask : function() {
|
|
246
246
|
return null;
|
|
247
247
|
};
|
|
248
|
-
|
|
248
|
+
M = {
|
|
249
249
|
react_stack_bottom_frame: function(e) {
|
|
250
250
|
return e();
|
|
251
251
|
}
|
|
252
252
|
};
|
|
253
|
-
var
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
)(),
|
|
257
|
-
He.Fragment =
|
|
258
|
-
var
|
|
259
|
-
return
|
|
253
|
+
var U, ce = {}, fe = M.react_stack_bottom_frame.bind(
|
|
254
|
+
M,
|
|
255
|
+
p
|
|
256
|
+
)(), f = w(s(p)), R = {};
|
|
257
|
+
He.Fragment = v, He.jsx = function(e, a, y) {
|
|
258
|
+
var E = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
259
|
+
return A(
|
|
260
260
|
e,
|
|
261
261
|
a,
|
|
262
|
-
|
|
262
|
+
y,
|
|
263
263
|
!1,
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
E ? Error("react-stack-top-frame") : fe,
|
|
265
|
+
E ? w(s(e)) : f
|
|
266
266
|
);
|
|
267
|
-
}, He.jsxs = function(e, a,
|
|
268
|
-
var
|
|
269
|
-
return
|
|
267
|
+
}, He.jsxs = function(e, a, y) {
|
|
268
|
+
var E = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
269
|
+
return A(
|
|
270
270
|
e,
|
|
271
271
|
a,
|
|
272
|
-
|
|
272
|
+
y,
|
|
273
273
|
!0,
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
E ? Error("react-stack-top-frame") : fe,
|
|
275
|
+
E ? w(s(e)) : f
|
|
276
276
|
);
|
|
277
277
|
};
|
|
278
278
|
})()), He;
|
|
279
279
|
}
|
|
280
280
|
var ot;
|
|
281
|
-
function
|
|
282
|
-
return ot || (ot = 1, process.env.NODE_ENV === "production" ?
|
|
281
|
+
function kt() {
|
|
282
|
+
return ot || (ot = 1, process.env.NODE_ENV === "production" ? Be.exports = Ct() : Be.exports = wt()), Be.exports;
|
|
283
283
|
}
|
|
284
|
-
var t =
|
|
285
|
-
const ct =
|
|
286
|
-
function
|
|
287
|
-
let
|
|
288
|
-
const s = (...
|
|
289
|
-
clearTimeout(
|
|
284
|
+
var t = kt();
|
|
285
|
+
const ct = vt(void 0);
|
|
286
|
+
function Rt(r, o) {
|
|
287
|
+
let u;
|
|
288
|
+
const s = (...c) => {
|
|
289
|
+
clearTimeout(u), u = setTimeout(() => r(...c), o);
|
|
290
290
|
};
|
|
291
|
-
return s.cancel = () => clearTimeout(
|
|
291
|
+
return s.cancel = () => clearTimeout(u), s;
|
|
292
292
|
}
|
|
293
293
|
const Qt = ({
|
|
294
294
|
children: r,
|
|
295
295
|
email: o,
|
|
296
|
-
password:
|
|
296
|
+
password: u,
|
|
297
297
|
url: s,
|
|
298
|
-
dataset:
|
|
299
|
-
allowEmptySearch:
|
|
300
|
-
maxResults:
|
|
301
|
-
facetDebounceDelayMillis:
|
|
298
|
+
dataset: c,
|
|
299
|
+
allowEmptySearch: p = !1,
|
|
300
|
+
maxResults: j = 10,
|
|
301
|
+
facetDebounceDelayMillis: m = 500,
|
|
302
302
|
// debounce faceted searches only
|
|
303
303
|
enableFacets: n = !0,
|
|
304
|
-
coverageDepth:
|
|
305
|
-
removeDuplicates:
|
|
306
|
-
enableCoverage:
|
|
304
|
+
coverageDepth: C = 500,
|
|
305
|
+
removeDuplicates: A = !0,
|
|
306
|
+
enableCoverage: k = !0,
|
|
307
307
|
initialCoverageSetup: L = {},
|
|
308
|
-
enableDebugLogs:
|
|
308
|
+
enableDebugLogs: M = !1,
|
|
309
309
|
preAuthenticatedToken: ne
|
|
310
310
|
}) => {
|
|
311
|
-
const q =
|
|
311
|
+
const q = he(0), v = he(void 0), _ = he(!1), g = he(!1), x = he(!1), W = he(!1), [h, b] = G({
|
|
312
312
|
query: "",
|
|
313
313
|
results: null,
|
|
314
314
|
isLoading: !1,
|
|
315
|
-
resultsSuppressed: !
|
|
315
|
+
resultsSuppressed: !p,
|
|
316
316
|
// Show placeholder if empty search not allowed
|
|
317
|
-
facetDebounceDelayMillis:
|
|
317
|
+
facetDebounceDelayMillis: m,
|
|
318
318
|
filters: {},
|
|
319
319
|
rangeFilters: {},
|
|
320
320
|
facetStats: {},
|
|
321
321
|
searchSettings: {
|
|
322
|
-
maxNumberOfRecordsToReturn:
|
|
323
|
-
coverageDepth:
|
|
324
|
-
enableCoverage:
|
|
325
|
-
removeDuplicates:
|
|
322
|
+
maxNumberOfRecordsToReturn: j,
|
|
323
|
+
coverageDepth: C,
|
|
324
|
+
enableCoverage: k,
|
|
325
|
+
removeDuplicates: A,
|
|
326
326
|
minimumScore: 0,
|
|
327
327
|
showScore: !0,
|
|
328
328
|
placeholderText: "Type to search",
|
|
@@ -346,345 +346,327 @@ const Qt = ({
|
|
|
346
346
|
}
|
|
347
347
|
});
|
|
348
348
|
ie(() => {
|
|
349
|
-
|
|
350
|
-
}, [
|
|
351
|
-
|
|
352
|
-
...
|
|
353
|
-
facetDebounceDelayMillis:
|
|
349
|
+
M && console.log("SearchContext mounted on client");
|
|
350
|
+
}, [M]), ie(() => {
|
|
351
|
+
b((l) => ({
|
|
352
|
+
...l,
|
|
353
|
+
facetDebounceDelayMillis: m
|
|
354
354
|
}));
|
|
355
|
-
}, [
|
|
356
|
-
const [
|
|
357
|
-
if (!
|
|
355
|
+
}, [m]);
|
|
356
|
+
const [d, X] = G(null), [z] = G(n), V = ae((l, i = {}) => {
|
|
357
|
+
if (!d)
|
|
358
358
|
throw new Error("No authentication token available");
|
|
359
|
-
return fetch(
|
|
360
|
-
...
|
|
359
|
+
return fetch(l, {
|
|
360
|
+
...i,
|
|
361
361
|
headers: {
|
|
362
|
-
...
|
|
363
|
-
Authorization: `Bearer ${
|
|
362
|
+
...i.headers,
|
|
363
|
+
Authorization: `Bearer ${d}`
|
|
364
364
|
},
|
|
365
365
|
credentials: "include"
|
|
366
366
|
});
|
|
367
|
-
}, [
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
filters: {},
|
|
372
|
-
rangeFilters: {},
|
|
373
|
-
searchSettings: {
|
|
374
|
-
...l.searchSettings,
|
|
375
|
-
maxNumberOfRecordsToReturn: S
|
|
376
|
-
}
|
|
377
|
-
}));
|
|
378
|
-
}, [S]), $ = K((i) => {
|
|
379
|
-
y((l) => ({
|
|
380
|
-
...l,
|
|
381
|
-
facetDebounceDelayMillis: i
|
|
382
|
-
}));
|
|
383
|
-
}, []), J = K((i) => {
|
|
384
|
-
y((l) => ({
|
|
385
|
-
...l,
|
|
386
|
-
searchSettings: {
|
|
387
|
-
...l.searchSettings,
|
|
367
|
+
}, [d]), [Q, O] = G([]), [pe, P] = G([]), [w, U] = G([]), [ce, fe] = G(!0), [f, R] = G({}), [e, a] = G({}), [y, E] = G({}), [ue, ve] = G(""), [T, de] = G(""), [xe, ke] = G({}), $ = he(null), I = ae((l) => {
|
|
368
|
+
W.current = !1, b((i) => {
|
|
369
|
+
const S = Object.keys(i.filters).length > 0, F = Object.keys(i.rangeFilters).length > 0;
|
|
370
|
+
return {
|
|
388
371
|
...i,
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
372
|
+
query: l,
|
|
373
|
+
filters: S ? {} : i.filters,
|
|
374
|
+
rangeFilters: F ? {} : i.rangeFilters,
|
|
375
|
+
searchSettings: {
|
|
376
|
+
...i.searchSettings,
|
|
377
|
+
maxNumberOfRecordsToReturn: j
|
|
392
378
|
}
|
|
393
|
-
}
|
|
379
|
+
};
|
|
380
|
+
});
|
|
381
|
+
}, [j]), J = ae((l) => {
|
|
382
|
+
b((i) => ({
|
|
383
|
+
...i,
|
|
384
|
+
facetDebounceDelayMillis: l
|
|
394
385
|
}));
|
|
395
|
-
}, []),
|
|
396
|
-
|
|
397
|
-
...l
|
|
386
|
+
}, []), _e = ae((l) => {
|
|
387
|
+
b((i) => {
|
|
388
|
+
const S = { ...i.searchSettings, ...l };
|
|
389
|
+
return l.coverageSetup ? S.coverageSetup = {
|
|
390
|
+
...i.searchSettings.coverageSetup,
|
|
391
|
+
...l.coverageSetup
|
|
392
|
+
} : S.coverageSetup = i.searchSettings.coverageSetup, {
|
|
393
|
+
...i,
|
|
394
|
+
searchSettings: S
|
|
395
|
+
};
|
|
396
|
+
});
|
|
397
|
+
}, []), Te = ae((l) => {
|
|
398
|
+
x.current = !0, b((i) => ({
|
|
399
|
+
...i,
|
|
398
400
|
searchSettings: {
|
|
399
|
-
...
|
|
400
|
-
maxNumberOfRecordsToReturn:
|
|
401
|
+
...i.searchSettings,
|
|
402
|
+
maxNumberOfRecordsToReturn: l
|
|
401
403
|
}
|
|
402
404
|
}));
|
|
403
|
-
}, []),
|
|
404
|
-
|
|
405
|
-
const
|
|
406
|
-
return
|
|
407
|
-
...
|
|
408
|
-
filters:
|
|
405
|
+
}, []), Ae = ae((l, i) => {
|
|
406
|
+
W.current = !0, b((S) => {
|
|
407
|
+
const F = { ...S.filters }, H = F[l] || [], B = H.includes(i) ? H.filter((ee) => ee !== i) : [...H, i];
|
|
408
|
+
return B.length ? F[l] = B : delete F[l], {
|
|
409
|
+
...S,
|
|
410
|
+
filters: F
|
|
409
411
|
};
|
|
410
412
|
});
|
|
411
|
-
}, []),
|
|
412
|
-
|
|
413
|
-
...
|
|
413
|
+
}, []), qe = ae((l, i, S) => {
|
|
414
|
+
W.current = !0, b((F) => ({
|
|
415
|
+
...F,
|
|
414
416
|
rangeFilters: {
|
|
415
|
-
...
|
|
416
|
-
[
|
|
417
|
+
...F.rangeFilters,
|
|
418
|
+
[l]: { min: i, max: S }
|
|
417
419
|
}
|
|
418
420
|
}));
|
|
419
|
-
}, []),
|
|
420
|
-
|
|
421
|
-
...
|
|
421
|
+
}, []), Le = ae(() => {
|
|
422
|
+
W.current = !0, b((l) => ({
|
|
423
|
+
...l,
|
|
422
424
|
filters: {},
|
|
423
425
|
rangeFilters: {}
|
|
424
426
|
}));
|
|
425
|
-
}, []),
|
|
426
|
-
|
|
427
|
-
const
|
|
428
|
-
if (
|
|
429
|
-
const
|
|
430
|
-
|
|
427
|
+
}, []), dt = ae((l, i, S = !0) => {
|
|
428
|
+
S && (W.current = !0), b((F) => {
|
|
429
|
+
const H = { ...F.filters }, B = { ...F.rangeFilters };
|
|
430
|
+
if (i !== void 0) {
|
|
431
|
+
const se = (H[l] || []).filter((Z) => Z !== i);
|
|
432
|
+
se.length > 0 ? H[l] = se : delete H[l];
|
|
431
433
|
} else
|
|
432
|
-
delete
|
|
434
|
+
delete B[l];
|
|
433
435
|
return {
|
|
434
|
-
...
|
|
435
|
-
filters:
|
|
436
|
-
rangeFilters:
|
|
436
|
+
...F,
|
|
437
|
+
filters: H,
|
|
438
|
+
rangeFilters: B
|
|
437
439
|
};
|
|
438
440
|
});
|
|
439
|
-
}, []),
|
|
440
|
-
|
|
441
|
-
...
|
|
442
|
-
sortBy:
|
|
443
|
-
sortAscending:
|
|
441
|
+
}, []), ht = ae((l, i) => {
|
|
442
|
+
b((S) => ({
|
|
443
|
+
...S,
|
|
444
|
+
sortBy: l || void 0,
|
|
445
|
+
sortAscending: l ? i : void 0
|
|
444
446
|
}));
|
|
445
|
-
}, []), Ge =
|
|
446
|
-
if (
|
|
447
|
-
if (
|
|
448
|
-
let
|
|
449
|
-
for (let
|
|
450
|
-
const
|
|
447
|
+
}, []), Ge = ae(async (l, i, S) => {
|
|
448
|
+
if (l.length === 0) return null;
|
|
449
|
+
if (l.length === 1) return l[0];
|
|
450
|
+
let F = l[0];
|
|
451
|
+
for (let H = 1; H < l.length; H++) {
|
|
452
|
+
const B = await V(`${i}/api/CombineFilters/${S}`, {
|
|
451
453
|
// Combine the current filter with the next filter
|
|
452
454
|
method: "PUT",
|
|
453
455
|
headers: {
|
|
454
456
|
"Content-Type": "application/json"
|
|
455
457
|
},
|
|
456
|
-
body: JSON.stringify({ A:
|
|
458
|
+
body: JSON.stringify({ A: F, B: l[H], useAndOperation: !0 })
|
|
457
459
|
});
|
|
458
|
-
if (!
|
|
459
|
-
const
|
|
460
|
-
throw console.error("CombineFilters failed:",
|
|
460
|
+
if (!B.ok) {
|
|
461
|
+
const ee = await B.json();
|
|
462
|
+
throw console.error("CombineFilters failed:", ee), new Error("CombineFilters failed");
|
|
461
463
|
}
|
|
462
|
-
|
|
464
|
+
F = await B.json();
|
|
463
465
|
}
|
|
464
|
-
return
|
|
465
|
-
}, [
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
c.searchSettings.coverageSetup.coverageQLimitForErrorTolerance,
|
|
471
|
-
c.searchSettings.coverageSetup.coverageLcsErrorToleranceRelativeq,
|
|
472
|
-
c.searchSettings.coverageSetup.coverWholeQuery,
|
|
473
|
-
c.searchSettings.coverageSetup.coverWholeWords,
|
|
474
|
-
c.searchSettings.coverageSetup.coverFuzzyWords,
|
|
475
|
-
c.searchSettings.coverageSetup.coverJoinedWords,
|
|
476
|
-
c.searchSettings.coverageSetup.coverPrefixSuffix,
|
|
477
|
-
c.searchSettings.coverageSetup.truncate
|
|
478
|
-
]), Ke = K(
|
|
479
|
-
async ({ enableFacets: i }) => {
|
|
480
|
-
if (!j) return;
|
|
481
|
-
const l = ++q.current;
|
|
482
|
-
y((C) => ({ ...C, isLoading: !0 }));
|
|
466
|
+
return F;
|
|
467
|
+
}, [V]), ze = h.searchSettings.maxNumberOfRecordsToReturn, Xe = h.searchSettings.enableCoverage, Je = h.searchSettings.removeDuplicates, Ye = h.searchSettings.coverageDepth, Qe = h.searchSettings.minimumScore, $e = h.sortBy, Ie = h.sortAscending, Ze = h.searchSettings.coverageSetup, Ke = ae(
|
|
468
|
+
async ({ enableFacets: l }) => {
|
|
469
|
+
if (!d) return;
|
|
470
|
+
const i = ++q.current;
|
|
471
|
+
b((S) => ({ ...S, isLoading: !0 }));
|
|
483
472
|
try {
|
|
484
|
-
const
|
|
485
|
-
|
|
486
|
-
async ([
|
|
473
|
+
const S = Object.entries(h.filters ?? {}), H = (await Promise.all(
|
|
474
|
+
S.map(
|
|
475
|
+
async ([D, Y]) => Promise.all(
|
|
487
476
|
Y.map(
|
|
488
|
-
(te) =>
|
|
477
|
+
(te) => V(`${s}/api/CreateValueFilter/${c}`, {
|
|
489
478
|
method: "PUT",
|
|
490
479
|
headers: {
|
|
491
480
|
"Content-Type": "application/json"
|
|
492
481
|
},
|
|
493
|
-
body: JSON.stringify({ FieldName:
|
|
482
|
+
body: JSON.stringify({ FieldName: D, Value: te })
|
|
494
483
|
}).then((ge) => ge.json())
|
|
495
484
|
)
|
|
496
485
|
)
|
|
497
486
|
)
|
|
498
|
-
)).flat(),
|
|
499
|
-
|
|
500
|
-
([
|
|
487
|
+
)).flat(), B = Object.entries(h.rangeFilters ?? {}), ee = await Promise.all(
|
|
488
|
+
B.map(
|
|
489
|
+
([D, { min: Y, max: te }]) => V(`${s}/api/CreateRangeFilter/${c}`, {
|
|
501
490
|
method: "PUT",
|
|
502
491
|
headers: {
|
|
503
492
|
"Content-Type": "application/json"
|
|
504
493
|
},
|
|
505
|
-
body: JSON.stringify({ FieldName:
|
|
494
|
+
body: JSON.stringify({ FieldName: D, LowerLimit: Y, UpperLimit: te })
|
|
506
495
|
}).then((ge) => ge.json())
|
|
507
496
|
)
|
|
508
|
-
),
|
|
509
|
-
(
|
|
510
|
-
),
|
|
511
|
-
text:
|
|
512
|
-
maxNumberOfRecordsToReturn: je ?
|
|
513
|
-
enableFacets:
|
|
514
|
-
...
|
|
497
|
+
), se = [...H, ...ee].filter(
|
|
498
|
+
(D) => D && typeof D.hashString == "string"
|
|
499
|
+
), Z = await Ge(se, s, c), je = p || h.query.trim() !== "", De = {
|
|
500
|
+
text: h.query,
|
|
501
|
+
maxNumberOfRecordsToReturn: je ? ze : 0,
|
|
502
|
+
enableFacets: l,
|
|
503
|
+
...Z ? { filter: Z } : {},
|
|
515
504
|
...$e ? { sortBy: $e } : {},
|
|
516
505
|
...Ie !== void 0 ? { sortAscending: Ie } : {},
|
|
517
506
|
enableCoverage: Xe,
|
|
518
507
|
removeDuplicates: Je,
|
|
519
|
-
coverageDepth:
|
|
508
|
+
coverageDepth: Ye,
|
|
520
509
|
coverageSetup: Ze
|
|
521
510
|
};
|
|
522
|
-
|
|
523
|
-
const
|
|
511
|
+
M && console.log("[performSearch] request body:", JSON.stringify(De, null, 2));
|
|
512
|
+
const Re = await (await V(`${s}/api/Search/${c}`, {
|
|
524
513
|
method: "POST",
|
|
525
514
|
headers: {
|
|
526
515
|
"Content-Type": "application/json"
|
|
527
516
|
},
|
|
528
|
-
body: JSON.stringify(
|
|
529
|
-
})).json(), Ce =
|
|
530
|
-
let
|
|
531
|
-
je &&
|
|
517
|
+
body: JSON.stringify(De)
|
|
518
|
+
})).json(), Ce = Re.truncationIndex ?? -1, we = Re.records || [], Me = we.map((D) => D.documentKey), N = we.map((D) => D.score);
|
|
519
|
+
let oe = [];
|
|
520
|
+
je && Me.length > 0 && (oe = (await (await V(`${s}/api/GetJson/${c}`, {
|
|
532
521
|
method: "POST",
|
|
533
522
|
headers: {
|
|
534
523
|
"Content-Type": "application/json"
|
|
535
524
|
},
|
|
536
|
-
body: JSON.stringify(
|
|
525
|
+
body: JSON.stringify(Me)
|
|
537
526
|
})).json()).map((te, ge) => ({
|
|
538
527
|
document: te,
|
|
539
|
-
documentKey:
|
|
528
|
+
documentKey: Me[ge],
|
|
540
529
|
score: N[ge]
|
|
541
530
|
})));
|
|
542
|
-
let
|
|
543
|
-
if (
|
|
544
|
-
for (const [
|
|
531
|
+
let me = {};
|
|
532
|
+
if (l && Re.facets) {
|
|
533
|
+
for (const [D, Y] of Object.entries(Re.facets))
|
|
545
534
|
if (Array.isArray(Y) && Y.length > 0) {
|
|
546
535
|
const te = Y.map((ge) => Number(ge.key)).filter((ge) => !isNaN(ge));
|
|
547
|
-
te.length > 0 && (
|
|
536
|
+
te.length > 0 && (me[D] = {
|
|
548
537
|
min: Math.min(...te),
|
|
549
538
|
max: Math.max(...te)
|
|
550
539
|
});
|
|
551
540
|
}
|
|
552
541
|
}
|
|
553
|
-
const Ve =
|
|
554
|
-
let
|
|
555
|
-
if (Ve ? (
|
|
556
|
-
const
|
|
557
|
-
for (const [Y, te] of Object.entries(
|
|
558
|
-
|
|
559
|
-
|
|
542
|
+
const Ve = h.query !== ue, ft = h.query !== T;
|
|
543
|
+
let We = h.facetStats ?? {};
|
|
544
|
+
if (Ve ? (We = { ...f, ...me }, E(We), ve(h.query)) : We = { ...y, ...me }, ft && l) {
|
|
545
|
+
const D = { ...xe };
|
|
546
|
+
for (const [Y, te] of Object.entries(me))
|
|
547
|
+
D[Y] = te;
|
|
548
|
+
ke(D), de(h.query);
|
|
560
549
|
}
|
|
561
|
-
let Oe =
|
|
562
|
-
if (
|
|
550
|
+
let Oe = Re.facets;
|
|
551
|
+
if (l && (!Oe || Object.keys(Oe).length === 0)) {
|
|
563
552
|
Oe = {};
|
|
564
|
-
for (const [
|
|
565
|
-
Oe[
|
|
553
|
+
for (const [D, Y] of Object.entries(e))
|
|
554
|
+
Oe[D] = Y.map((te) => ({ key: te, value: null }));
|
|
566
555
|
}
|
|
567
|
-
if (
|
|
556
|
+
if (i !== q.current)
|
|
568
557
|
return;
|
|
569
|
-
const
|
|
570
|
-
const Y =
|
|
571
|
-
return Y === "" || Y.length === 1 ? !0 :
|
|
558
|
+
const mt = oe.filter((D) => {
|
|
559
|
+
const Y = h.query.trim();
|
|
560
|
+
return Y === "" || Y.length === 1 ? !0 : D.score >= Qe;
|
|
572
561
|
});
|
|
573
|
-
|
|
574
|
-
...
|
|
575
|
-
results:
|
|
562
|
+
b((D) => ({
|
|
563
|
+
...D,
|
|
564
|
+
results: mt,
|
|
576
565
|
resultsSuppressed: !je,
|
|
577
|
-
...
|
|
566
|
+
...l ? {
|
|
578
567
|
facets: Oe,
|
|
579
|
-
facetStats:
|
|
568
|
+
facetStats: We
|
|
580
569
|
} : {},
|
|
581
570
|
isLoading: !1,
|
|
582
571
|
truncationIndex: Ce
|
|
583
572
|
}));
|
|
584
|
-
} catch (
|
|
585
|
-
if (console.error("[Search] ❌ Search failed:",
|
|
573
|
+
} catch (S) {
|
|
574
|
+
if (console.error("[Search] ❌ Search failed:", S), S instanceof TypeError && S.message.includes("fetch") ? (console.error("[Search] ❌ Network error - cannot reach INDX server"), console.error("[Search] 💡 Check if server is running at:", s)) : S instanceof Error && (S.message.includes("401") ? (console.error("[Search] ❌ Authentication failed"), console.error("[Search] 💡 Your token may have expired. Get a fresh token with:"), console.error('[Search] 💡 curl -X POST "' + s + `/api/Login" -H "Content-Type: application/json" -d '{"userEmail":"your@email.com","userPassWord":"yourpassword"}'`)) : S.message.includes("404") ? (console.error("[Search] ❌ Dataset not found"), console.error('[Search] 💡 Check that dataset "' + c + '" exists')) : console.error("[Search] 💡 Error:", S.message)), i !== q.current)
|
|
586
575
|
return;
|
|
587
|
-
|
|
588
|
-
...
|
|
576
|
+
b((F) => ({
|
|
577
|
+
...F,
|
|
589
578
|
results: null,
|
|
590
579
|
isLoading: !1,
|
|
591
580
|
resultsSuppressed: !1,
|
|
592
|
-
error:
|
|
581
|
+
error: S instanceof Error ? S.message : "Search failed"
|
|
593
582
|
}));
|
|
594
583
|
}
|
|
595
584
|
},
|
|
596
585
|
[
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
586
|
+
h.query,
|
|
587
|
+
h.filters,
|
|
588
|
+
h.rangeFilters,
|
|
600
589
|
$e,
|
|
601
590
|
Ie,
|
|
602
|
-
|
|
591
|
+
ze,
|
|
603
592
|
Xe,
|
|
604
593
|
Je,
|
|
605
|
-
Qe,
|
|
606
|
-
Ze,
|
|
607
594
|
Ye,
|
|
608
|
-
|
|
595
|
+
Ze,
|
|
596
|
+
Qe,
|
|
597
|
+
V,
|
|
609
598
|
Ge,
|
|
610
599
|
s,
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
600
|
+
c,
|
|
601
|
+
p,
|
|
602
|
+
d
|
|
614
603
|
]
|
|
615
604
|
);
|
|
616
605
|
ie(() => {
|
|
617
|
-
|
|
618
|
-
}, [Ke])
|
|
619
|
-
|
|
620
|
-
k && console.log("Search fired"), (i = p.current) == null || i.call(p, { enableFacets: !1 });
|
|
621
|
-
}, []);
|
|
622
|
-
const ue = me(null);
|
|
606
|
+
v.current = Ke;
|
|
607
|
+
}, [Ke]);
|
|
608
|
+
const Se = he(null);
|
|
623
609
|
return ie(() => {
|
|
624
|
-
var
|
|
625
|
-
return (
|
|
626
|
-
var
|
|
627
|
-
|
|
628
|
-
},
|
|
629
|
-
var
|
|
630
|
-
(
|
|
610
|
+
var l;
|
|
611
|
+
return (l = Se.current) == null || l.cancel(), Se.current = Rt(() => {
|
|
612
|
+
var i;
|
|
613
|
+
M && console.log("Debounced searchWithFacets fired"), (i = v.current) == null || i.call(v, { enableFacets: !0 });
|
|
614
|
+
}, h.facetDebounceDelayMillis ?? 500), () => {
|
|
615
|
+
var i;
|
|
616
|
+
(i = Se.current) == null || i.cancel();
|
|
631
617
|
};
|
|
632
|
-
}, [
|
|
633
|
-
var
|
|
634
|
-
(
|
|
635
|
-
}, []), ie(() => {
|
|
636
|
-
var
|
|
637
|
-
!
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
if (i === "" && !v) {
|
|
643
|
-
c.resultsSuppressed || y((oe) => ({
|
|
644
|
-
...oe,
|
|
618
|
+
}, [h.facetDebounceDelayMillis]), ie(() => {
|
|
619
|
+
var l;
|
|
620
|
+
!ce && d && !_.current && (p && ((l = v.current) == null || l.call(v, { enableFacets: z })), _.current = !0);
|
|
621
|
+
}, [ce, d, p, z]), ie(() => {
|
|
622
|
+
var F, H, B, ee, se;
|
|
623
|
+
if (!d || !_.current) return;
|
|
624
|
+
const l = h.query.trim(), i = l === "" && p;
|
|
625
|
+
if (l === "" && !p) {
|
|
626
|
+
h.resultsSuppressed || b((Z) => ({
|
|
627
|
+
...Z,
|
|
645
628
|
resultsSuppressed: !0
|
|
646
629
|
}));
|
|
647
630
|
return;
|
|
648
631
|
}
|
|
649
|
-
return
|
|
650
|
-
var
|
|
651
|
-
(
|
|
632
|
+
return i ? ((F = Se.current) == null || F.cancel(), (H = v.current) == null || H.call(v, { enableFacets: z })) : z ? (M && console.log("Search fired"), (B = v.current) == null || B.call(v, { enableFacets: !1 }), (ee = Se.current) == null || ee.call(Se)) : (se = v.current) == null || se.call(v, { enableFacets: !1 }), () => {
|
|
633
|
+
var Z;
|
|
634
|
+
(Z = Se.current) == null || Z.cancel();
|
|
652
635
|
};
|
|
653
|
-
}, [
|
|
654
|
-
var
|
|
655
|
-
|
|
636
|
+
}, [h.query, p, z]), ie(() => {
|
|
637
|
+
var F;
|
|
638
|
+
const l = W.current;
|
|
639
|
+
if (W.current = !1, !_.current || !d) return;
|
|
656
640
|
if (!g.current) {
|
|
657
|
-
g.current = !0
|
|
641
|
+
g.current = !0;
|
|
658
642
|
return;
|
|
659
643
|
}
|
|
660
|
-
if (
|
|
661
|
-
k && console.log("[Filter effect] Skipping because query changed");
|
|
644
|
+
if (!l)
|
|
662
645
|
return;
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
D && !(!v && i === "") && ((C = p.current) == null || C.call(p, { enableFacets: !0 }));
|
|
646
|
+
const i = h.query.trim();
|
|
647
|
+
z && !(!p && i === "") && ((F = v.current) == null || F.call(v, { enableFacets: !0 }));
|
|
648
|
+
}, [h.filters, h.rangeFilters]), ie(() => {
|
|
649
|
+
var S;
|
|
650
|
+
if (!_.current || !d) return;
|
|
651
|
+
const l = h.query.trim();
|
|
652
|
+
z && !(!p && l === "") && ((S = v.current) == null || S.call(v, { enableFacets: !0 }));
|
|
671
653
|
}, [$e, Ie]), ie(() => {
|
|
672
|
-
var
|
|
673
|
-
!
|
|
674
|
-
}, [
|
|
654
|
+
var l;
|
|
655
|
+
!_.current || !d || x.current && (x.current = !1, (l = v.current) == null || l.call(v, { enableFacets: !1 }));
|
|
656
|
+
}, [ze, d]), ie(() => {
|
|
675
657
|
(async () => {
|
|
676
658
|
try {
|
|
677
|
-
let
|
|
659
|
+
let i;
|
|
678
660
|
if (ne)
|
|
679
|
-
|
|
661
|
+
M && console.log("[Auth] ✅ Using pre-authenticated token"), i = ne;
|
|
680
662
|
else {
|
|
681
|
-
if (!o || !
|
|
682
|
-
throw console.error("[Auth] ❌ Missing credentials"), o || (console.error("[Auth] ❌ Missing email"), console.error('[Auth] 💡 Pass email="your@email.com" to SearchProvider')),
|
|
663
|
+
if (!o || !u)
|
|
664
|
+
throw console.error("[Auth] ❌ Missing credentials"), o || (console.error("[Auth] ❌ Missing email"), console.error('[Auth] 💡 Pass email="your@email.com" to SearchProvider')), u || (console.error("[Auth] ❌ Missing password"), console.error('[Auth] 💡 Pass password="yourpassword" to SearchProvider')), new Error("Email and password are required. Check console for instructions.");
|
|
683
665
|
if (!s)
|
|
684
666
|
throw console.error("[Auth] ❌ Missing INDX server URL"), console.error("[Auth] 💡 Add NEXT_PUBLIC_INDX_URL to your .env.local file"), new Error("INDX server URL is required. Check console for instructions.");
|
|
685
|
-
if (!
|
|
667
|
+
if (!c)
|
|
686
668
|
throw console.error("[Auth] ❌ Missing dataset name"), console.error('[Auth] 💡 Pass dataset="your-dataset-name" to SearchProvider'), new Error("Dataset name is required. Check console for instructions.");
|
|
687
|
-
|
|
669
|
+
M && console.log("[Auth] 🔐 Logging in to get session token...");
|
|
688
670
|
const N = await fetch(`${s}/api/Login`, {
|
|
689
671
|
method: "POST",
|
|
690
672
|
headers: {
|
|
@@ -694,235 +676,235 @@ const Qt = ({
|
|
|
694
676
|
credentials: "include",
|
|
695
677
|
body: JSON.stringify({
|
|
696
678
|
userEmail: o,
|
|
697
|
-
userPassWord:
|
|
679
|
+
userPassWord: u
|
|
698
680
|
})
|
|
699
681
|
});
|
|
700
682
|
if (!N.ok)
|
|
701
683
|
throw console.error("[Auth] ❌ Login failed:", N.status, await N.text()), new Error("Login failed. Check your email and password.");
|
|
702
|
-
if (
|
|
684
|
+
if (i = (await N.json()).token, !i)
|
|
703
685
|
throw console.error("[Auth] ❌ No token received from login response"), new Error("No token received from login.");
|
|
704
|
-
|
|
686
|
+
M && console.log("[Auth] ✅ Login successful, bearer token received (length:", i.length, ")");
|
|
705
687
|
}
|
|
706
|
-
|
|
707
|
-
const
|
|
688
|
+
M && console.log("[Auth] 🔓 Opening dataset session...");
|
|
689
|
+
const S = await fetch(`${s}/api/CreateOrOpen/${c}/400`, {
|
|
708
690
|
method: "PUT",
|
|
709
691
|
headers: {
|
|
710
692
|
"Content-Type": "application/json",
|
|
711
|
-
Authorization: `Bearer ${
|
|
693
|
+
Authorization: `Bearer ${i}`
|
|
712
694
|
},
|
|
713
695
|
body: '""'
|
|
714
696
|
});
|
|
715
|
-
if (!
|
|
716
|
-
throw console.error("[Auth] ❌ CreateOrOpen failed:",
|
|
717
|
-
|
|
718
|
-
const
|
|
697
|
+
if (!S.ok)
|
|
698
|
+
throw console.error("[Auth] ❌ CreateOrOpen failed:", S.status, await S.text()), new Error("Failed to open dataset session.");
|
|
699
|
+
X(i), M && console.log("[Auth] ✅ Dataset session established");
|
|
700
|
+
const F = (N) => fetch(N, {
|
|
719
701
|
method: "GET",
|
|
720
702
|
headers: {
|
|
721
703
|
accept: "text/plain",
|
|
722
|
-
Authorization: `Bearer ${
|
|
704
|
+
Authorization: `Bearer ${i}`
|
|
723
705
|
},
|
|
724
706
|
credentials: "include"
|
|
725
707
|
});
|
|
726
|
-
|
|
727
|
-
const
|
|
728
|
-
if (!
|
|
729
|
-
if (
|
|
708
|
+
M && console.log("[Auth] 🔍 Checking dataset status...");
|
|
709
|
+
const H = await F(`${s}/api/GetStatus/${c}`);
|
|
710
|
+
if (!H.ok) {
|
|
711
|
+
if (H.status === 401)
|
|
730
712
|
throw console.error("[Auth] ❌ Authentication failed (401 Unauthorized)"), console.error("[Auth] 💡 Your token may be expired or invalid"), console.error('[Auth] 💡 Get a fresh token with: curl -X POST "' + s + `/api/Login" -H "Content-Type: application/json" -d '{"userEmail":"your@email.com","userPassWord":"yourpassword"}'`), new Error("Authentication failed (401). Token may be expired. Check console for instructions.");
|
|
731
|
-
if (
|
|
732
|
-
throw console.error('[Auth] ❌ Dataset "' +
|
|
713
|
+
if (H.status === 404)
|
|
714
|
+
throw console.error('[Auth] ❌ Dataset "' + c + '" not found (404)'), console.error('[Auth] 💡 Available datasets can be checked with: curl -X GET "' + s + '/api/GetUserDataSets" -H "Authorization: Bearer YOUR_TOKEN"'), console.error("[Auth] 💡 Make sure you spelled the dataset name correctly"), new Error('Dataset "' + c + '" not found. Check console for instructions.');
|
|
733
715
|
{
|
|
734
|
-
const N = await
|
|
735
|
-
throw console.error("[Auth] ❌ Failed to get dataset status:",
|
|
716
|
+
const N = await H.text();
|
|
717
|
+
throw console.error("[Auth] ❌ Failed to get dataset status:", H.status, N), console.error("[Auth] 💡 Check if your INDX server is running at:", s), new Error("Failed to connect to INDX server. Check console for details.");
|
|
736
718
|
}
|
|
737
719
|
}
|
|
738
|
-
const
|
|
739
|
-
|
|
740
|
-
const
|
|
741
|
-
|
|
742
|
-
const [
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
720
|
+
const B = await H.json();
|
|
721
|
+
M && console.log("[Auth] 📊 Dataset status:", B), B.state && B.state !== "Ready" && (console.warn("[Auth] ⚠️ Dataset is not ready yet. Current state:", B.state), console.warn("[Auth] 💡 Wait for indexing to complete before searching"));
|
|
722
|
+
const ee = B.documentCount ?? B.numberOfRecords ?? 0;
|
|
723
|
+
ee === 0 ? (console.warn('[Auth] ⚠️ Dataset "' + c + '" is empty (0 records)'), console.warn("[Auth] 💡 Add documents to your dataset before searching"), console.warn("[Auth] 💡 Search will work but return no results")) : M && console.log("[Auth] ✅ Dataset has", ee, "records");
|
|
724
|
+
const [se, Z, je] = await Promise.all([
|
|
725
|
+
F(`${s}/api/GetFilterableFields/${c}`),
|
|
726
|
+
F(`${s}/api/GetFacetableFields/${c}`),
|
|
727
|
+
F(`${s}/api/GetSortableFields/${c}`)
|
|
746
728
|
]);
|
|
747
|
-
if (!
|
|
748
|
-
throw console.error("[Auth] ❌ GetFilterableFields failed:",
|
|
749
|
-
if (!
|
|
750
|
-
throw console.error("[Auth] ❌ GetFacetableFields failed:",
|
|
729
|
+
if (!se.ok)
|
|
730
|
+
throw console.error("[Auth] ❌ GetFilterableFields failed:", se.status, await se.text()), new Error("Failed to get filterable fields. Check console for details.");
|
|
731
|
+
if (!Z.ok)
|
|
732
|
+
throw console.error("[Auth] ❌ GetFacetableFields failed:", Z.status, await Z.text()), new Error("Failed to get facetable fields. Check console for details.");
|
|
751
733
|
if (!je.ok)
|
|
752
734
|
throw console.error("[Auth] ❌ GetSortableFields failed:", je.status, await je.text()), new Error("Failed to get sortable fields. Check console for details.");
|
|
753
|
-
const
|
|
754
|
-
|
|
735
|
+
const De = await se.json().catch((N) => (console.error("Failed to parse GetFilterableFields response:", N), [])), et = await Z.json().catch((N) => (console.error("Failed to parse GetFacetableFields response:", N), [])), Re = await je.json().catch((N) => (console.error("Failed to parse GetSortableFields response:", N), []));
|
|
736
|
+
O(De || []), P(et || []), U(Re || []);
|
|
755
737
|
let Ce = { facets: {} };
|
|
756
738
|
try {
|
|
757
|
-
const N = await fetch(`${s}/api/Search/${
|
|
739
|
+
const N = await fetch(`${s}/api/Search/${c}`, {
|
|
758
740
|
method: "POST",
|
|
759
741
|
headers: {
|
|
760
742
|
"Content-Type": "application/json",
|
|
761
|
-
Authorization: `Bearer ${
|
|
743
|
+
Authorization: `Bearer ${i}`
|
|
762
744
|
},
|
|
763
745
|
credentials: "include",
|
|
764
746
|
body: JSON.stringify({ text: "", maxNumberOfRecordsToReturn: 0, enableFacets: !0 })
|
|
765
747
|
});
|
|
766
|
-
N.ok ? Ce = await N.json().catch((
|
|
748
|
+
N.ok ? Ce = await N.json().catch((oe) => (console.warn("Failed to parse blank search response:", oe), { facets: {} })) : (console.warn("Blank search failed:", N.status, N.statusText), console.warn("Continuing without initial facet data - facets will be populated after first search"));
|
|
767
749
|
} catch (N) {
|
|
768
750
|
console.warn("Blank search error:", N), console.warn("Continuing without initial facet data - facets will be populated after first search");
|
|
769
751
|
}
|
|
770
752
|
const we = {};
|
|
771
753
|
if (Ce.facets) {
|
|
772
|
-
for (const [N,
|
|
773
|
-
if (Array.isArray(
|
|
774
|
-
const
|
|
775
|
-
|
|
776
|
-
min: Math.min(...
|
|
777
|
-
max: Math.max(...
|
|
754
|
+
for (const [N, oe] of Object.entries(Ce.facets))
|
|
755
|
+
if (Array.isArray(oe) && oe.length > 0) {
|
|
756
|
+
const me = oe.map((Ve) => Number(Ve.key)).filter((Ve) => !isNaN(Ve));
|
|
757
|
+
me.length > 0 && (we[N] = {
|
|
758
|
+
min: Math.min(...me),
|
|
759
|
+
max: Math.max(...me)
|
|
778
760
|
});
|
|
779
761
|
}
|
|
780
762
|
}
|
|
781
|
-
const
|
|
763
|
+
const Me = {};
|
|
782
764
|
if (Ce.facets)
|
|
783
|
-
for (const [N,
|
|
784
|
-
Array.isArray(
|
|
785
|
-
|
|
765
|
+
for (const [N, oe] of Object.entries(Ce.facets))
|
|
766
|
+
Array.isArray(oe) && (Me[N] = oe.map((me) => me.key));
|
|
767
|
+
$.current = {
|
|
786
768
|
facets: Ce.facets,
|
|
787
769
|
facetStats: we,
|
|
788
|
-
facetKeys:
|
|
789
|
-
},
|
|
770
|
+
facetKeys: Me
|
|
771
|
+
}, R(we), a(Me), ke(we), b((N) => ({
|
|
790
772
|
...N,
|
|
791
773
|
facetStats: we,
|
|
792
|
-
totalDocumentCount:
|
|
793
|
-
})),
|
|
794
|
-
} catch (
|
|
795
|
-
throw console.error("[Auth] ❌ Initialization failed:",
|
|
774
|
+
totalDocumentCount: ee
|
|
775
|
+
})), M && console.log("[Auth] ✅ Initialization complete");
|
|
776
|
+
} catch (i) {
|
|
777
|
+
throw console.error("[Auth] ❌ Initialization failed:", i), (i instanceof Error || typeof i == "object" && i !== null && "message" in i) && console.error("[Auth] 💡 Error:", i.message), i instanceof TypeError && i.message.includes("fetch") && (console.error("[Auth] ❌ Network error - cannot connect to INDX server"), console.error("[Auth] 💡 Check if the server is running at:", s), console.error("[Auth] 💡 Check your NEXT_PUBLIC_INDX_URL in .env.local"), console.error("[Auth] 💡 For local development, it should be: http://localhost:5001")), i;
|
|
796
778
|
} finally {
|
|
797
|
-
|
|
779
|
+
fe(!1);
|
|
798
780
|
}
|
|
799
781
|
})();
|
|
800
|
-
}, [o,
|
|
782
|
+
}, [o, u, s, c]), /* @__PURE__ */ t.jsx(
|
|
801
783
|
ct.Provider,
|
|
802
784
|
{
|
|
803
785
|
value: {
|
|
804
786
|
state: {
|
|
805
|
-
...
|
|
806
|
-
filterableFields:
|
|
807
|
-
facetableFields:
|
|
808
|
-
sortableFields:
|
|
809
|
-
rangeBounds:
|
|
787
|
+
...h,
|
|
788
|
+
filterableFields: Q,
|
|
789
|
+
facetableFields: pe,
|
|
790
|
+
sortableFields: w,
|
|
791
|
+
rangeBounds: xe
|
|
810
792
|
},
|
|
811
|
-
isFetchingInitial:
|
|
812
|
-
allowEmptySearch:
|
|
813
|
-
setQuery:
|
|
814
|
-
toggleFilter:
|
|
815
|
-
setRangeFilter:
|
|
816
|
-
resetFilters:
|
|
817
|
-
resetSingleFilter:
|
|
818
|
-
setSort:
|
|
819
|
-
setDebounceDelay:
|
|
820
|
-
setSearchSettings:
|
|
793
|
+
isFetchingInitial: ce,
|
|
794
|
+
allowEmptySearch: p,
|
|
795
|
+
setQuery: I,
|
|
796
|
+
toggleFilter: Ae,
|
|
797
|
+
setRangeFilter: qe,
|
|
798
|
+
resetFilters: Le,
|
|
799
|
+
resetSingleFilter: dt,
|
|
800
|
+
setSort: ht,
|
|
801
|
+
setDebounceDelay: J,
|
|
802
|
+
setSearchSettings: _e,
|
|
821
803
|
fetchMoreResults: Te
|
|
822
804
|
},
|
|
823
805
|
children: r
|
|
824
806
|
}
|
|
825
807
|
);
|
|
826
|
-
},
|
|
827
|
-
const r =
|
|
808
|
+
}, Ne = () => {
|
|
809
|
+
const r = xt(ct);
|
|
828
810
|
if (!r)
|
|
829
811
|
throw new Error("useSearchContext must be used within a SearchProvider");
|
|
830
812
|
return r;
|
|
831
|
-
},
|
|
813
|
+
}, Zt = ({
|
|
832
814
|
className: r = "",
|
|
833
815
|
autoFocus: o = !1,
|
|
834
|
-
inputSize:
|
|
816
|
+
inputSize: u = "default",
|
|
835
817
|
showClear: s = !0,
|
|
836
|
-
showFocus:
|
|
837
|
-
...
|
|
818
|
+
showFocus: c = !1,
|
|
819
|
+
...p
|
|
838
820
|
}) => {
|
|
839
|
-
const { state: { query:
|
|
840
|
-
Object.keys(
|
|
841
|
-
const
|
|
821
|
+
const { state: { query: j, filters: m, rangeFilters: n, searchSettings: C }, setQuery: A } = Ne();
|
|
822
|
+
Object.keys(m).length > 0 || Object.keys(n).length > 0;
|
|
823
|
+
const k = j.length > 0;
|
|
842
824
|
return /* @__PURE__ */ t.jsx(
|
|
843
|
-
|
|
825
|
+
yt,
|
|
844
826
|
{
|
|
845
827
|
type: "text",
|
|
846
|
-
value:
|
|
847
|
-
onChange: (L) =>
|
|
848
|
-
placeholder:
|
|
828
|
+
value: j,
|
|
829
|
+
onChange: (L) => A(L.target.value),
|
|
830
|
+
placeholder: C.placeholderText,
|
|
849
831
|
autoFocus: o,
|
|
850
832
|
className: r,
|
|
851
833
|
showSearchIcon: !0,
|
|
852
|
-
inputSize:
|
|
853
|
-
showFocusBorder:
|
|
854
|
-
...
|
|
855
|
-
children: s &&
|
|
834
|
+
inputSize: u,
|
|
835
|
+
showFocusBorder: c,
|
|
836
|
+
...p,
|
|
837
|
+
children: s && k && /* @__PURE__ */ t.jsx(
|
|
856
838
|
ye,
|
|
857
839
|
{
|
|
858
840
|
variant: "ghost",
|
|
859
841
|
size: "micro",
|
|
860
|
-
onClick: () =>
|
|
842
|
+
onClick: () => A(""),
|
|
861
843
|
"aria-label": "Clear search",
|
|
862
844
|
children: "Clear"
|
|
863
845
|
}
|
|
864
846
|
)
|
|
865
847
|
}
|
|
866
848
|
);
|
|
867
|
-
},
|
|
868
|
-
placeholder:
|
|
869
|
-
invalid:
|
|
870
|
-
row:
|
|
871
|
-
indexNumber:
|
|
872
|
-
scoreNumber:
|
|
849
|
+
}, Mt = "_placeholder_1k92x_1", Et = "_invalid_1k92x_10", Ft = "_row_1k92x_14", Nt = "_indexNumber_1k92x_38", _t = "_scoreNumber_1k92x_45", Ee = {
|
|
850
|
+
placeholder: Mt,
|
|
851
|
+
invalid: Et,
|
|
852
|
+
row: Ft,
|
|
853
|
+
indexNumber: Nt,
|
|
854
|
+
scoreNumber: _t
|
|
873
855
|
}, Tt = ({ color: r = "black", size: o = 21 }) => {
|
|
874
|
-
const
|
|
875
|
-
return t.jsx("svg", { width: s, height:
|
|
876
|
-
}, _t = ({ color: r = "black", size: o = 21 }) => {
|
|
877
|
-
const d = 0.7142857142857143, s = o, u = typeof o == "number" ? o * d : `calc(${o} * 0.7142857142857143)`;
|
|
878
|
-
return t.jsx("svg", { width: s, height: u, viewBox: "0 0 7 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: t.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5 0H4V1H5V2H4H3H2H1V3H2H3H4H5V4H4V5H5V4H6V3H7V2H6V1H5V0ZM6 2H5V3H6V2Z", fill: r }) });
|
|
856
|
+
const u = 0.7142857142857143, s = o, c = typeof o == "number" ? o * u : `calc(${o} * 0.7142857142857143)`;
|
|
857
|
+
return t.jsx("svg", { width: s, height: c, viewBox: "0 0 7 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: t.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4 0H3V1V2V3H2V2H1V3H2V4H3V5H4V4H5V3H6V2H5V3H4V2V1V0ZM4 3V4H3V3H4Z", fill: r }) });
|
|
879
858
|
}, At = ({ color: r = "black", size: o = 21 }) => {
|
|
880
|
-
const
|
|
881
|
-
return t.jsx("svg", { width: s, height:
|
|
859
|
+
const u = 0.7142857142857143, s = o, c = typeof o == "number" ? o * u : `calc(${o} * 0.7142857142857143)`;
|
|
860
|
+
return t.jsx("svg", { width: s, height: c, viewBox: "0 0 7 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: t.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5 0H4V1H5V2H4H3H2H1V3H2H3H4H5V4H4V5H5V4H6V3H7V2H6V1H5V0ZM6 2H5V3H6V2Z", fill: r }) });
|
|
861
|
+
}, Vt = ({ color: r = "black", size: o = 21 }) => {
|
|
862
|
+
const u = 0.7142857142857143, s = o, c = typeof o == "number" ? o * u : `calc(${o} * 0.7142857142857143)`;
|
|
863
|
+
return t.jsx("svg", { width: s, height: c, viewBox: "0 0 7 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: t.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5 0H6V1H5V0ZM6 1H7V2H6V1ZM0 1H1V2H0V1ZM1 1V0H2V1H1ZM6 3H7V4H6V3ZM6 4V5H5V4H6ZM1 4H2V5H1V4ZM1 4H0V3H1V4ZM2 2H5V3H2V2Z", fill: r }) });
|
|
882
864
|
}, ut = ({ color: r = "black", size: o = 21 }) => {
|
|
883
|
-
const
|
|
884
|
-
return t.jsx("svg", { width: s, height:
|
|
885
|
-
},
|
|
865
|
+
const u = 0.7142857142857143, s = o, c = typeof o == "number" ? o * u : `calc(${o} * 0.7142857142857143)`;
|
|
866
|
+
return t.jsx("svg", { width: s, height: c, viewBox: "0 0 7 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: t.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1 0H2V1H1V0ZM3 2H2V1H3V2ZM4 2H3V3H2V4H1V5H2V4H3V3H4V4H5V5H6V4H5V3H4V2ZM5 1V2H4V1H5ZM5 1V0H6V1H5Z", fill: r }) });
|
|
867
|
+
}, Kt = ({ fields: r, resultsPerPage: o, children: u }) => {
|
|
886
868
|
const {
|
|
887
|
-
state: { results: s, resultsSuppressed:
|
|
869
|
+
state: { results: s, resultsSuppressed: c, searchSettings: p, truncationIndex: j, query: m },
|
|
888
870
|
isFetchingInitial: n,
|
|
889
|
-
fetchMoreResults:
|
|
890
|
-
} =
|
|
871
|
+
fetchMoreResults: C
|
|
872
|
+
} = Ne(), A = o ?? 30, [k, L] = G(A), M = he(0), ne = he("");
|
|
891
873
|
ie(() => {
|
|
892
|
-
const
|
|
893
|
-
(!s || s.length <
|
|
894
|
-
}, [s,
|
|
895
|
-
const q = s && s.length >
|
|
896
|
-
const
|
|
897
|
-
L(
|
|
874
|
+
const _ = m !== ne.current;
|
|
875
|
+
(!s || s.length < M.current || _) && L(A), M.current = (s == null ? void 0 : s.length) ?? 0, ne.current = m;
|
|
876
|
+
}, [s, A, m]);
|
|
877
|
+
const q = s && s.length > k, v = () => {
|
|
878
|
+
const _ = k + A;
|
|
879
|
+
L(_), s && _ >= s.length && (!j || j === -1 || j > s.length) && C(s.length + A);
|
|
898
880
|
};
|
|
899
|
-
return n ||
|
|
900
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
901
|
-
const x =
|
|
902
|
-
let
|
|
881
|
+
return n || c || s === null ? /* @__PURE__ */ t.jsx("div", { className: Ee.placeholder, children: /* @__PURE__ */ t.jsx(Vt, { size: 200, color: "var(--lv5)" }) }) : s.length === 0 ? /* @__PURE__ */ t.jsx("div", { className: Ee.invalid, children: /* @__PURE__ */ t.jsx("p", { children: "No results found." }) }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
882
|
+
/* @__PURE__ */ t.jsx("div", { className: Ee.container, children: (s ?? []).slice(0, k).map((_, g) => {
|
|
883
|
+
const x = _.document, W = _.score;
|
|
884
|
+
let h;
|
|
903
885
|
try {
|
|
904
|
-
|
|
886
|
+
h = typeof x == "string" ? JSON.parse(x) : x;
|
|
905
887
|
} catch {
|
|
906
|
-
return /* @__PURE__ */ t.jsx("div", { className:
|
|
888
|
+
return /* @__PURE__ */ t.jsx("div", { className: Ee.invalid, children: /* @__PURE__ */ t.jsx("p", { children: "Invalid JSON" }) }, g);
|
|
907
889
|
}
|
|
908
|
-
let
|
|
890
|
+
let b;
|
|
909
891
|
if (r && r.length > 0) {
|
|
910
|
-
|
|
911
|
-
for (const
|
|
912
|
-
|
|
892
|
+
b = {};
|
|
893
|
+
for (const d of r)
|
|
894
|
+
d in h && (b[d] = h[d]);
|
|
913
895
|
} else
|
|
914
|
-
|
|
915
|
-
for (const
|
|
916
|
-
const
|
|
917
|
-
if (typeof
|
|
918
|
-
const
|
|
919
|
-
|
|
896
|
+
b = { ...h };
|
|
897
|
+
for (const d in b) {
|
|
898
|
+
const X = b[d];
|
|
899
|
+
if (typeof X == "string" && X.startsWith("[") && X.endsWith("]")) {
|
|
900
|
+
const V = X.replace(/^\[|\]$/g, "").split(",").map((Q) => Q.trim().replace(/^'|'$/g, "")).filter((Q) => Q.length > 0);
|
|
901
|
+
b[d] = V;
|
|
920
902
|
}
|
|
921
903
|
}
|
|
922
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
923
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
924
|
-
|
|
925
|
-
|
|
904
|
+
return /* @__PURE__ */ t.jsxs("div", { className: Ee.row, children: [
|
|
905
|
+
/* @__PURE__ */ t.jsx("div", { className: Ee.indexNumber, children: g }),
|
|
906
|
+
u(b),
|
|
907
|
+
p.showScore && /* @__PURE__ */ t.jsx("div", { className: Ee.scoreNumber, children: W })
|
|
926
908
|
] }, g);
|
|
927
909
|
}) }),
|
|
928
910
|
q && /* @__PURE__ */ t.jsx("div", { style: { textAlign: "center", marginTop: "20px" }, children: /* @__PURE__ */ t.jsx(
|
|
@@ -930,74 +912,74 @@ const Qt = ({
|
|
|
930
912
|
{
|
|
931
913
|
variant: "secondary",
|
|
932
914
|
size: "micro",
|
|
933
|
-
onClick:
|
|
934
|
-
children:
|
|
915
|
+
onClick: v,
|
|
916
|
+
children: m.trim() === "" ? "Load more" : j !== -1 && j !== void 0 && j > 0 ? `Load results ${k + 1}-${Math.min(k + A, s.length, j)} of ${j}` : "Load more"
|
|
935
917
|
}
|
|
936
918
|
) })
|
|
937
919
|
] });
|
|
938
|
-
},
|
|
939
|
-
list:
|
|
940
|
-
count:
|
|
941
|
-
grid:
|
|
942
|
-
},
|
|
920
|
+
}, Ot = "_list_mwzqq_2", Pt = "_count_mwzqq_7", Ht = "_grid_mwzqq_16", Fe = {
|
|
921
|
+
list: Ot,
|
|
922
|
+
count: Pt,
|
|
923
|
+
grid: Ht
|
|
924
|
+
}, er = ({
|
|
943
925
|
field: r,
|
|
944
926
|
label: o,
|
|
945
|
-
preserveBlankFacetState:
|
|
927
|
+
preserveBlankFacetState: u = !1,
|
|
946
928
|
preserveBlankFacetStateOrder: s = !1,
|
|
947
|
-
sortFacetsBy:
|
|
948
|
-
limit:
|
|
949
|
-
collapsible:
|
|
950
|
-
startCollapsed:
|
|
929
|
+
sortFacetsBy: c = "histogram",
|
|
930
|
+
limit: p = 10,
|
|
931
|
+
collapsible: j = !0,
|
|
932
|
+
startCollapsed: m = !1,
|
|
951
933
|
displayType: n = "checkbox",
|
|
952
|
-
layout:
|
|
953
|
-
showActivePanel:
|
|
954
|
-
showCount:
|
|
934
|
+
layout: C = "list",
|
|
935
|
+
showActivePanel: A = !1,
|
|
936
|
+
showCount: k = !0,
|
|
955
937
|
showNull: L = !1,
|
|
956
|
-
displayIfEmptyQuery:
|
|
938
|
+
displayIfEmptyQuery: M = !0,
|
|
957
939
|
displayCondition: ne = (q) => !0
|
|
958
940
|
}) => {
|
|
959
941
|
const {
|
|
960
|
-
state: { facets: q, filterableFields:
|
|
961
|
-
toggleFilter:
|
|
962
|
-
isFetchingInitial:
|
|
963
|
-
allowEmptySearch:
|
|
964
|
-
} =
|
|
942
|
+
state: { facets: q, filterableFields: v, facetableFields: _, filters: g, query: x },
|
|
943
|
+
toggleFilter: W,
|
|
944
|
+
isFetchingInitial: h,
|
|
945
|
+
allowEmptySearch: b
|
|
946
|
+
} = Ne(), d = he(null), [X, z] = G(p);
|
|
965
947
|
if (ie(() => {
|
|
966
|
-
|
|
967
|
-
}, [q == null ? void 0 : q[r],
|
|
948
|
+
z(p);
|
|
949
|
+
}, [q == null ? void 0 : q[r], p]), !b && !x || h || !q || !ne({ query: x ?? "", filters: g, facets: q }) || !M && !x && Object.keys(g).length < 1)
|
|
968
950
|
return null;
|
|
969
|
-
if (!(
|
|
970
|
-
const
|
|
971
|
-
return
|
|
951
|
+
if (!(v != null && v.includes(r)) || !(_ != null && _.includes(r))) {
|
|
952
|
+
const f = [];
|
|
953
|
+
return v != null && v.includes(r) || f.push("filterable"), _ != null && _.includes(r) || f.push("facetable"), /* @__PURE__ */ t.jsx(be, { collapsible: !1, children: /* @__PURE__ */ t.jsxs("div", { style: { color: "red", fontSize: "12px" }, children: [
|
|
972
954
|
'Cannot render filter for "',
|
|
973
955
|
r,
|
|
974
956
|
'": missing ',
|
|
975
|
-
|
|
957
|
+
f.join(" and "),
|
|
976
958
|
"."
|
|
977
959
|
] }) });
|
|
978
960
|
}
|
|
979
|
-
const
|
|
980
|
-
if (!
|
|
981
|
-
const
|
|
982
|
-
|
|
983
|
-
(
|
|
961
|
+
const V = q == null ? void 0 : q[r];
|
|
962
|
+
if (!V || !Array.isArray(V)) return null;
|
|
963
|
+
const Q = (g == null ? void 0 : g[r]) ?? [];
|
|
964
|
+
u && !d.current && V.length > 0 && (d.current = V.reduce(
|
|
965
|
+
(f, R) => (f[R.key] = R.value, f),
|
|
984
966
|
{}
|
|
985
967
|
));
|
|
986
968
|
const O = /* @__PURE__ */ new Map();
|
|
987
|
-
|
|
988
|
-
O.set(
|
|
989
|
-
}),
|
|
990
|
-
O.set(
|
|
991
|
-
})) :
|
|
992
|
-
O.set(
|
|
969
|
+
u && d.current ? (Object.keys(d.current).forEach((f) => {
|
|
970
|
+
O.set(f, 0);
|
|
971
|
+
}), V.forEach((f) => {
|
|
972
|
+
O.set(f.key, f.value);
|
|
973
|
+
})) : V.forEach((f) => {
|
|
974
|
+
O.set(f.key, f.value);
|
|
993
975
|
});
|
|
994
976
|
const pe = n === "toggle" && O.size === 2 && O.has("true") && (O.has("false") || O.has("null"));
|
|
995
977
|
if (O.has("null")) {
|
|
996
|
-
const
|
|
997
|
-
O.set("false", (
|
|
978
|
+
const f = O.get("null") ?? 0, R = O.get("false") ?? 0;
|
|
979
|
+
O.set("false", (R ?? 0) + f), O.delete("null");
|
|
998
980
|
}
|
|
999
981
|
if (n === "toggle" && !pe)
|
|
1000
|
-
return /* @__PURE__ */ t.jsx(
|
|
982
|
+
return /* @__PURE__ */ t.jsx(be, { collapsible: !1, children: /* @__PURE__ */ t.jsx("div", { className: Fe.count, children: /* @__PURE__ */ t.jsx(
|
|
1001
983
|
le,
|
|
1002
984
|
{
|
|
1003
985
|
label: o,
|
|
@@ -1008,121 +990,121 @@ const Qt = ({
|
|
|
1008
990
|
}
|
|
1009
991
|
) }) });
|
|
1010
992
|
if (pe) {
|
|
1011
|
-
const
|
|
1012
|
-
return /* @__PURE__ */ t.jsx(
|
|
993
|
+
const f = O.get("true"), R = typeof f == "number" ? f : null, e = Q.includes("true"), a = R === 0, y = k && (R ?? 0) > 0 ? `${R}` : "";
|
|
994
|
+
return /* @__PURE__ */ t.jsx(be, { collapsible: !1, children: /* @__PURE__ */ t.jsxs("div", { className: Fe.count, children: [
|
|
1013
995
|
/* @__PURE__ */ t.jsx(
|
|
1014
996
|
le,
|
|
1015
997
|
{
|
|
1016
998
|
label: o,
|
|
1017
999
|
checked: e,
|
|
1018
|
-
onChange: () =>
|
|
1000
|
+
onChange: () => W(r, "true"),
|
|
1019
1001
|
disabled: a
|
|
1020
1002
|
}
|
|
1021
1003
|
),
|
|
1022
1004
|
" ",
|
|
1023
|
-
|
|
1005
|
+
y
|
|
1024
1006
|
] }) });
|
|
1025
1007
|
}
|
|
1026
1008
|
let P = Array.from(O.entries());
|
|
1027
|
-
if (L || (P = P.filter(([
|
|
1009
|
+
if (L || (P = P.filter(([f]) => f !== "null")), P.length === 0 && !u)
|
|
1028
1010
|
return null;
|
|
1029
|
-
if (!s) if (
|
|
1030
|
-
const
|
|
1031
|
-
P = [...
|
|
1032
|
-
} else if (
|
|
1033
|
-
const
|
|
1034
|
-
const
|
|
1035
|
-
return
|
|
1036
|
-
},
|
|
1037
|
-
P = [...
|
|
1011
|
+
if (!s) if (c === "alphabetical") {
|
|
1012
|
+
const f = P.filter(([, e]) => typeof e == "number" && e > 0).sort(([e], [a]) => e.localeCompare(a)), R = P.filter(([, e]) => e === 0 || e === null).sort(([e], [a]) => e.localeCompare(a));
|
|
1013
|
+
P = [...f, ...R];
|
|
1014
|
+
} else if (c === "numeric") {
|
|
1015
|
+
const f = (a, y) => {
|
|
1016
|
+
const E = Number(a), ue = Number(y), ve = !isNaN(E), T = !isNaN(ue);
|
|
1017
|
+
return ve && T ? E - ue : a.localeCompare(y);
|
|
1018
|
+
}, R = P.filter(([, a]) => typeof a == "number" && a > 0).sort(([a], [y]) => f(a, y)), e = P.filter(([, a]) => a === 0 || a === null).sort(([a], [y]) => f(a, y));
|
|
1019
|
+
P = [...R, ...e];
|
|
1038
1020
|
} else {
|
|
1039
|
-
const
|
|
1040
|
-
P = [...
|
|
1021
|
+
const f = P.filter(([, e]) => typeof e == "number" && e > 0), R = P.filter(([, e]) => e === 0 || e === null);
|
|
1022
|
+
P = [...f, ...R];
|
|
1041
1023
|
}
|
|
1042
|
-
const
|
|
1043
|
-
const e =
|
|
1024
|
+
const w = typeof p == "number" && P.length > p, U = w ? P.slice(0, X) : P, ce = (f, R) => {
|
|
1025
|
+
const e = Q.includes(f), a = R === 0, y = k && (R ?? 0) > 0 ? ` (${R})` : "", E = k && (R ?? 0) > 0 ? R : "";
|
|
1044
1026
|
switch (n) {
|
|
1045
1027
|
case "button":
|
|
1046
|
-
return
|
|
1028
|
+
return C === "list" ? /* @__PURE__ */ t.jsxs("div", { className: Fe.count, children: [
|
|
1047
1029
|
/* @__PURE__ */ t.jsx(
|
|
1048
1030
|
ye,
|
|
1049
1031
|
{
|
|
1050
1032
|
variant: e ? "primary" : "secondary",
|
|
1051
|
-
onClick: () =>
|
|
1033
|
+
onClick: () => W(r, f),
|
|
1052
1034
|
disabled: a,
|
|
1053
1035
|
size: "micro",
|
|
1054
|
-
children:
|
|
1036
|
+
children: f
|
|
1055
1037
|
}
|
|
1056
1038
|
),
|
|
1057
|
-
/* @__PURE__ */ t.jsx("span", { children:
|
|
1039
|
+
/* @__PURE__ */ t.jsx("span", { children: E })
|
|
1058
1040
|
] }) : /* @__PURE__ */ t.jsx(
|
|
1059
1041
|
ye,
|
|
1060
1042
|
{
|
|
1061
1043
|
variant: e ? "primary" : "secondary",
|
|
1062
|
-
onClick: () =>
|
|
1044
|
+
onClick: () => W(r, f),
|
|
1063
1045
|
disabled: a,
|
|
1064
1046
|
size: "micro",
|
|
1065
|
-
children: `${
|
|
1047
|
+
children: `${f}${y}`
|
|
1066
1048
|
}
|
|
1067
1049
|
);
|
|
1068
1050
|
case "toggle":
|
|
1069
1051
|
return /* @__PURE__ */ t.jsx(
|
|
1070
1052
|
le,
|
|
1071
1053
|
{
|
|
1072
|
-
label:
|
|
1054
|
+
label: f,
|
|
1073
1055
|
checked: e,
|
|
1074
|
-
onChange: () =>
|
|
1056
|
+
onChange: () => W(r, f),
|
|
1075
1057
|
disabled: a
|
|
1076
1058
|
}
|
|
1077
1059
|
);
|
|
1078
1060
|
case "checkbox":
|
|
1079
1061
|
default:
|
|
1080
|
-
return
|
|
1062
|
+
return C === "list" ? /* @__PURE__ */ t.jsxs("div", { className: Fe.count, children: [
|
|
1081
1063
|
/* @__PURE__ */ t.jsx(
|
|
1082
1064
|
rt,
|
|
1083
1065
|
{
|
|
1084
|
-
label:
|
|
1066
|
+
label: f,
|
|
1085
1067
|
score: "",
|
|
1086
1068
|
checked: e,
|
|
1087
|
-
onChange: () =>
|
|
1069
|
+
onChange: () => W(r, f),
|
|
1088
1070
|
disabled: a
|
|
1089
1071
|
}
|
|
1090
1072
|
),
|
|
1091
|
-
/* @__PURE__ */ t.jsx("span", { children:
|
|
1073
|
+
/* @__PURE__ */ t.jsx("span", { children: E })
|
|
1092
1074
|
] }) : /* @__PURE__ */ t.jsx(
|
|
1093
1075
|
rt,
|
|
1094
1076
|
{
|
|
1095
|
-
label:
|
|
1096
|
-
score:
|
|
1077
|
+
label: f,
|
|
1078
|
+
score: y,
|
|
1097
1079
|
checked: e,
|
|
1098
|
-
onChange: () =>
|
|
1080
|
+
onChange: () => W(r, f),
|
|
1099
1081
|
disabled: a
|
|
1100
1082
|
}
|
|
1101
1083
|
);
|
|
1102
1084
|
}
|
|
1103
|
-
},
|
|
1085
|
+
}, fe = j ? m : !1;
|
|
1104
1086
|
return /* @__PURE__ */ t.jsx(
|
|
1105
|
-
|
|
1087
|
+
be,
|
|
1106
1088
|
{
|
|
1107
1089
|
title: o,
|
|
1108
|
-
collapsible:
|
|
1109
|
-
collapsed:
|
|
1090
|
+
collapsible: j,
|
|
1091
|
+
collapsed: fe,
|
|
1110
1092
|
children: /* @__PURE__ */ t.jsxs(
|
|
1111
1093
|
"ul",
|
|
1112
1094
|
{
|
|
1113
|
-
className:
|
|
1095
|
+
className: C === "grid" ? Fe.grid : Fe.list,
|
|
1114
1096
|
style: { listStyle: "none", padding: 0, margin: 0 },
|
|
1115
1097
|
children: [
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
const
|
|
1119
|
-
return /* @__PURE__ */ t.jsx("li", { className:
|
|
1098
|
+
U.map(([f, R]) => /* @__PURE__ */ t.jsx("li", { children: ce(f, R) }, f)),
|
|
1099
|
+
w && X < P.length && (() => {
|
|
1100
|
+
const f = P.length - X, R = Math.min(50, f);
|
|
1101
|
+
return /* @__PURE__ */ t.jsx("li", { className: Fe.toggleItem, children: /* @__PURE__ */ t.jsx(
|
|
1120
1102
|
ye,
|
|
1121
1103
|
{
|
|
1122
1104
|
variant: "ghost",
|
|
1123
1105
|
size: "micro",
|
|
1124
|
-
onClick: () =>
|
|
1125
|
-
children: `Show ${
|
|
1106
|
+
onClick: () => z((e) => e + 50),
|
|
1107
|
+
children: `Show ${R} more of ${P.length} total`
|
|
1126
1108
|
}
|
|
1127
1109
|
) });
|
|
1128
1110
|
})()
|
|
@@ -1131,79 +1113,79 @@ const Qt = ({
|
|
|
1131
1113
|
)
|
|
1132
1114
|
}
|
|
1133
1115
|
);
|
|
1134
|
-
},
|
|
1135
|
-
disabledMessage:
|
|
1136
|
-
},
|
|
1116
|
+
}, $t = "_disabledMessage_o89gh_1", at = {
|
|
1117
|
+
disabledMessage: $t
|
|
1118
|
+
}, tr = ({
|
|
1137
1119
|
field: r,
|
|
1138
1120
|
label: o,
|
|
1139
|
-
expectedMin:
|
|
1121
|
+
expectedMin: u = 0,
|
|
1140
1122
|
expectedMax: s = 1e3,
|
|
1141
|
-
displayType:
|
|
1142
|
-
collapsible:
|
|
1143
|
-
startCollapsed:
|
|
1123
|
+
displayType: c = "input",
|
|
1124
|
+
collapsible: p = !0,
|
|
1125
|
+
startCollapsed: j = !1
|
|
1144
1126
|
}) => {
|
|
1145
1127
|
const {
|
|
1146
|
-
state: { rangeFilters:
|
|
1128
|
+
state: { rangeFilters: m, rangeBounds: n, facetStats: C, query: A, facetDebounceDelayMillis: k },
|
|
1147
1129
|
setRangeFilter: L,
|
|
1148
|
-
resetSingleFilter:
|
|
1130
|
+
resetSingleFilter: M,
|
|
1149
1131
|
allowEmptySearch: ne,
|
|
1150
1132
|
isFetchingInitial: q
|
|
1151
|
-
} =
|
|
1152
|
-
|
|
1133
|
+
} = Ne(), v = (n == null ? void 0 : n[r]) !== void 0, _ = (n == null ? void 0 : n[r]) ?? { min: u, max: s }, g = _.min, x = _.max, W = (C == null ? void 0 : C[r]) ?? _, h = W.min, b = W.max, d = v && g === x, X = d ? u : g, z = d ? s : x, V = m == null ? void 0 : m[r], Q = V ? V.min : g, O = V ? V.max : x, pe = V !== void 0, P = h !== g || b !== x, [w, U] = re.useState([
|
|
1134
|
+
Q,
|
|
1153
1135
|
O
|
|
1154
|
-
]), [
|
|
1155
|
-
const [
|
|
1156
|
-
return { finalMin:
|
|
1157
|
-
}, [
|
|
1136
|
+
]), [ce, fe] = re.useState(!1), [f, R] = re.useState(!1), { finalMin: e, finalMax: a, isValidMin: y, isValidMax: E } = re.useMemo(() => {
|
|
1137
|
+
const [$, I] = w, J = Math.max(g, Math.min(x, $)), _e = Math.max(g, Math.min(x, I)), Te = Math.min(J, _e), Ae = Math.max(J, _e), qe = Te >= g && Te < Ae, Le = Ae <= x && Ae > Te;
|
|
1138
|
+
return { finalMin: Te, finalMax: Ae, isValidMin: qe, isValidMax: Le };
|
|
1139
|
+
}, [w, g, x]);
|
|
1158
1140
|
re.useEffect(() => {
|
|
1159
|
-
if (
|
|
1141
|
+
if (d)
|
|
1160
1142
|
return;
|
|
1161
|
-
if (
|
|
1162
|
-
|
|
1143
|
+
if (w[0] === g && w[1] === x) {
|
|
1144
|
+
fe(!1), R(!1);
|
|
1163
1145
|
return;
|
|
1164
1146
|
}
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1167
|
-
}, 300),
|
|
1168
|
-
|
|
1169
|
-
},
|
|
1147
|
+
const I = k ?? 500, J = setTimeout(() => {
|
|
1148
|
+
fe(!y), R(!E);
|
|
1149
|
+
}, 300), _e = setTimeout(() => {
|
|
1150
|
+
y && E && (e === g && a === x ? M(r, void 0, !1) : L(r, e, a));
|
|
1151
|
+
}, I);
|
|
1170
1152
|
return () => {
|
|
1171
|
-
clearTimeout(J), clearTimeout(
|
|
1153
|
+
clearTimeout(J), clearTimeout(_e);
|
|
1172
1154
|
};
|
|
1173
|
-
}, [e, a,
|
|
1174
|
-
|
|
1175
|
-
}, [
|
|
1176
|
-
const
|
|
1177
|
-
if (
|
|
1178
|
-
const
|
|
1179
|
-
|
|
1180
|
-
}, [
|
|
1181
|
-
if (
|
|
1182
|
-
const
|
|
1183
|
-
|
|
1184
|
-
}, [
|
|
1185
|
-
if (
|
|
1186
|
-
const
|
|
1187
|
-
if (!isNaN(
|
|
1188
|
-
const J = Math.max(g, Math.min(
|
|
1189
|
-
|
|
1155
|
+
}, [e, a, y, E, g, x, r, M, L, k, d]), re.useEffect(() => {
|
|
1156
|
+
U([Q, O]), fe(!1), R(!1);
|
|
1157
|
+
}, [Q, O, r]);
|
|
1158
|
+
const ue = re.useCallback(($) => {
|
|
1159
|
+
if (d) return;
|
|
1160
|
+
const I = Math.max(g, Math.min(b, $[0])), J = Math.max(h, Math.min(x, $[1]));
|
|
1161
|
+
U([I, J]);
|
|
1162
|
+
}, [d, g, x, h, b]), ve = re.useCallback(($) => {
|
|
1163
|
+
if (d) return;
|
|
1164
|
+
const I = Math.max(g, Math.min(b, $[0])), J = Math.max(h, Math.min(x, $[1]));
|
|
1165
|
+
I === g && J === x ? (U([g, x]), M(r, void 0, !0)) : U([I, J]);
|
|
1166
|
+
}, [d, g, x, h, b, r, M]), T = re.useCallback(($) => {
|
|
1167
|
+
if (d) return;
|
|
1168
|
+
const I = Number($.target.value);
|
|
1169
|
+
if (!isNaN(I)) {
|
|
1170
|
+
const J = Math.max(g, Math.min(b, I));
|
|
1171
|
+
U([J, w[1]]);
|
|
1190
1172
|
}
|
|
1191
|
-
}, [
|
|
1192
|
-
if (
|
|
1193
|
-
const
|
|
1194
|
-
if (!isNaN(
|
|
1195
|
-
const J = Math.max(
|
|
1196
|
-
|
|
1173
|
+
}, [d, w, g, b]), de = re.useCallback(($) => {
|
|
1174
|
+
if (d) return;
|
|
1175
|
+
const I = Number($.target.value);
|
|
1176
|
+
if (!isNaN(I)) {
|
|
1177
|
+
const J = Math.max(h, Math.min(x, I));
|
|
1178
|
+
U([w[0], J]);
|
|
1197
1179
|
}
|
|
1198
|
-
}, [
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1201
|
-
}, [
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1204
|
-
}, [
|
|
1205
|
-
return q || !ne && !
|
|
1206
|
-
|
|
1180
|
+
}, [d, w, h, x]), xe = re.useCallback(() => {
|
|
1181
|
+
const $ = w[0], I = Math.max(g, Math.min(b, $));
|
|
1182
|
+
I < w[1] ? U([I, w[1]]) : U([g, w[1]]);
|
|
1183
|
+
}, [w, g, b]), ke = re.useCallback(() => {
|
|
1184
|
+
const $ = w[1], I = Math.max(h, Math.min(x, $));
|
|
1185
|
+
I > w[0] ? U([w[0], I]) : U([w[0], x]);
|
|
1186
|
+
}, [w, h, x]);
|
|
1187
|
+
return q || !ne && !A ? null : c === "slider" ? /* @__PURE__ */ t.jsxs(be, { title: o, collapsed: j, collapsible: p, children: [
|
|
1188
|
+
d && /* @__PURE__ */ t.jsxs("div", { className: at.disabledMessage, children: [
|
|
1207
1189
|
"No adjustable range (all results have the same value: ",
|
|
1208
1190
|
g,
|
|
1209
1191
|
")."
|
|
@@ -1211,15 +1193,15 @@ const Qt = ({
|
|
|
1211
1193
|
/* @__PURE__ */ t.jsx("div", { style: { padding: "10px 10px 20px 10px" }, children: /* @__PURE__ */ t.jsx(
|
|
1212
1194
|
lt,
|
|
1213
1195
|
{
|
|
1214
|
-
min:
|
|
1215
|
-
max:
|
|
1216
|
-
value:
|
|
1196
|
+
min: X,
|
|
1197
|
+
max: z,
|
|
1198
|
+
value: d ? [X, z] : [e, a],
|
|
1217
1199
|
isRange: !0,
|
|
1218
|
-
onChange: (
|
|
1219
|
-
onFinalChange: (
|
|
1220
|
-
disabled:
|
|
1221
|
-
activeMin:
|
|
1222
|
-
activeMax:
|
|
1200
|
+
onChange: ($) => ue($),
|
|
1201
|
+
onFinalChange: ($) => ve($),
|
|
1202
|
+
disabled: d,
|
|
1203
|
+
activeMin: h,
|
|
1204
|
+
activeMax: b,
|
|
1223
1205
|
isFaceted: P,
|
|
1224
1206
|
highlightFaceted: pe,
|
|
1225
1207
|
"aria-label": o || `Filter by ${r}`
|
|
@@ -1237,79 +1219,79 @@ const Qt = ({
|
|
|
1237
1219
|
},
|
|
1238
1220
|
children: [
|
|
1239
1221
|
/* @__PURE__ */ t.jsx(
|
|
1240
|
-
|
|
1222
|
+
K,
|
|
1241
1223
|
{
|
|
1242
1224
|
label: "Min:",
|
|
1243
1225
|
type: "number",
|
|
1244
|
-
value:
|
|
1226
|
+
value: d ? g : w[0],
|
|
1245
1227
|
min: g,
|
|
1246
|
-
max: Math.min(
|
|
1247
|
-
onChange:
|
|
1248
|
-
onBlur:
|
|
1249
|
-
disabled:
|
|
1250
|
-
isValid:
|
|
1228
|
+
max: Math.min(b, w[1] - 1),
|
|
1229
|
+
onChange: T,
|
|
1230
|
+
onBlur: xe,
|
|
1231
|
+
disabled: d,
|
|
1232
|
+
isValid: d || !ce
|
|
1251
1233
|
}
|
|
1252
1234
|
),
|
|
1253
1235
|
/* @__PURE__ */ t.jsx(
|
|
1254
|
-
|
|
1236
|
+
K,
|
|
1255
1237
|
{
|
|
1256
1238
|
label: "Max:",
|
|
1257
1239
|
type: "number",
|
|
1258
|
-
value:
|
|
1259
|
-
min: Math.max(
|
|
1240
|
+
value: d ? x : w[1],
|
|
1241
|
+
min: Math.max(h, w[0] + 1),
|
|
1260
1242
|
max: x,
|
|
1261
|
-
onChange:
|
|
1262
|
-
onBlur:
|
|
1263
|
-
disabled:
|
|
1264
|
-
isValid:
|
|
1243
|
+
onChange: de,
|
|
1244
|
+
onBlur: ke,
|
|
1245
|
+
disabled: d,
|
|
1246
|
+
isValid: d || !f
|
|
1265
1247
|
}
|
|
1266
1248
|
)
|
|
1267
1249
|
]
|
|
1268
1250
|
}
|
|
1269
1251
|
)
|
|
1270
|
-
] }) : /* @__PURE__ */ t.jsxs(
|
|
1271
|
-
|
|
1252
|
+
] }) : /* @__PURE__ */ t.jsxs(be, { title: o, children: [
|
|
1253
|
+
d && /* @__PURE__ */ t.jsxs("div", { className: at.disabledMessage, children: [
|
|
1272
1254
|
"No adjustable range (all results have the same value: ",
|
|
1273
1255
|
g,
|
|
1274
1256
|
")."
|
|
1275
1257
|
] }),
|
|
1276
1258
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: "10px", alignItems: "flex-start" }, children: [
|
|
1277
1259
|
/* @__PURE__ */ t.jsx(
|
|
1278
|
-
|
|
1260
|
+
K,
|
|
1279
1261
|
{
|
|
1280
1262
|
label: "Min:",
|
|
1281
1263
|
type: "number",
|
|
1282
|
-
value:
|
|
1264
|
+
value: d ? g : w[0],
|
|
1283
1265
|
min: g,
|
|
1284
|
-
max: Math.min(
|
|
1285
|
-
onChange:
|
|
1286
|
-
onBlur:
|
|
1287
|
-
disabled:
|
|
1288
|
-
isValid:
|
|
1266
|
+
max: Math.min(b, w[1] - 1),
|
|
1267
|
+
onChange: T,
|
|
1268
|
+
onBlur: xe,
|
|
1269
|
+
disabled: d,
|
|
1270
|
+
isValid: d || !ce
|
|
1289
1271
|
}
|
|
1290
1272
|
),
|
|
1291
1273
|
/* @__PURE__ */ t.jsx(
|
|
1292
|
-
|
|
1274
|
+
K,
|
|
1293
1275
|
{
|
|
1294
1276
|
label: "Max:",
|
|
1295
1277
|
type: "number",
|
|
1296
|
-
value:
|
|
1297
|
-
min: Math.max(
|
|
1278
|
+
value: d ? x : w[1],
|
|
1279
|
+
min: Math.max(h, w[0] + 1),
|
|
1298
1280
|
max: x,
|
|
1299
|
-
onChange:
|
|
1300
|
-
onBlur:
|
|
1301
|
-
disabled:
|
|
1302
|
-
isValid:
|
|
1281
|
+
onChange: de,
|
|
1282
|
+
onBlur: ke,
|
|
1283
|
+
disabled: d,
|
|
1284
|
+
isValid: d || !f
|
|
1303
1285
|
}
|
|
1304
1286
|
)
|
|
1305
1287
|
] })
|
|
1306
1288
|
] });
|
|
1307
|
-
},
|
|
1308
|
-
grid:
|
|
1309
|
-
}, Wt = it(({ field: r, value: o, onReset:
|
|
1289
|
+
}, It = "_grid_nvpmn_2", Dt = {
|
|
1290
|
+
grid: It
|
|
1291
|
+
}, Wt = it(({ field: r, value: o, onReset: u }) => /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsxs(
|
|
1310
1292
|
ye,
|
|
1311
1293
|
{
|
|
1312
|
-
onClick:
|
|
1294
|
+
onClick: u,
|
|
1313
1295
|
iconRight: /* @__PURE__ */ t.jsx(ut, {}),
|
|
1314
1296
|
variant: "primary",
|
|
1315
1297
|
size: "micro",
|
|
@@ -1319,7 +1301,7 @@ const Qt = ({
|
|
|
1319
1301
|
o
|
|
1320
1302
|
]
|
|
1321
1303
|
}
|
|
1322
|
-
) })),
|
|
1304
|
+
) })), Bt = it(({ field: r, min: o, max: u, onReset: s }) => /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsxs(
|
|
1323
1305
|
ye,
|
|
1324
1306
|
{
|
|
1325
1307
|
onClick: s,
|
|
@@ -1331,51 +1313,51 @@ const Qt = ({
|
|
|
1331
1313
|
": ",
|
|
1332
1314
|
o,
|
|
1333
1315
|
" – ",
|
|
1334
|
-
|
|
1316
|
+
u
|
|
1335
1317
|
]
|
|
1336
1318
|
}
|
|
1337
1319
|
) }));
|
|
1338
|
-
function
|
|
1320
|
+
function rr() {
|
|
1339
1321
|
const {
|
|
1340
1322
|
state: { filters: r, rangeFilters: o },
|
|
1341
|
-
resetFilters:
|
|
1323
|
+
resetFilters: u,
|
|
1342
1324
|
resetSingleFilter: s
|
|
1343
|
-
} =
|
|
1325
|
+
} = Ne(), c = Ue(
|
|
1344
1326
|
() => Object.entries(r).map(
|
|
1345
|
-
([
|
|
1327
|
+
([m, n]) => n.map((C) => ({ field: m, value: C }))
|
|
1346
1328
|
).flat(),
|
|
1347
1329
|
[r]
|
|
1348
|
-
),
|
|
1349
|
-
() => Object.entries(o).map(([
|
|
1330
|
+
), p = Ue(
|
|
1331
|
+
() => Object.entries(o).map(([m, { min: n, max: C }]) => ({ field: m, min: n, max: C })),
|
|
1350
1332
|
[o]
|
|
1351
1333
|
);
|
|
1352
|
-
return
|
|
1334
|
+
return Ue(
|
|
1353
1335
|
() => Object.keys(r).length > 0 || Object.keys(o).length > 0,
|
|
1354
1336
|
[r, o]
|
|
1355
|
-
) ? /* @__PURE__ */ t.jsx(
|
|
1356
|
-
|
|
1337
|
+
) ? /* @__PURE__ */ t.jsx(be, { collapsible: !1, title: "Active filters", children: /* @__PURE__ */ t.jsxs("ul", { className: Dt.grid, children: [
|
|
1338
|
+
c.map(({ field: m, value: n }) => /* @__PURE__ */ t.jsx(
|
|
1357
1339
|
Wt,
|
|
1358
1340
|
{
|
|
1359
|
-
field:
|
|
1341
|
+
field: m,
|
|
1360
1342
|
value: n,
|
|
1361
|
-
onReset: () => s(
|
|
1343
|
+
onReset: () => s(m, n)
|
|
1362
1344
|
},
|
|
1363
|
-
`${
|
|
1345
|
+
`${m}-${n}`
|
|
1364
1346
|
)),
|
|
1365
|
-
|
|
1366
|
-
|
|
1347
|
+
p.map(({ field: m, min: n, max: C }) => /* @__PURE__ */ t.jsx(
|
|
1348
|
+
Bt,
|
|
1367
1349
|
{
|
|
1368
|
-
field:
|
|
1350
|
+
field: m,
|
|
1369
1351
|
min: n,
|
|
1370
|
-
max:
|
|
1371
|
-
onReset: () => s(
|
|
1352
|
+
max: C,
|
|
1353
|
+
onReset: () => s(m)
|
|
1372
1354
|
},
|
|
1373
|
-
|
|
1355
|
+
m
|
|
1374
1356
|
)),
|
|
1375
1357
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1376
1358
|
ye,
|
|
1377
1359
|
{
|
|
1378
|
-
onClick:
|
|
1360
|
+
onClick: u,
|
|
1379
1361
|
size: "micro",
|
|
1380
1362
|
variant: "ghost",
|
|
1381
1363
|
children: "Reset"
|
|
@@ -1383,118 +1365,118 @@ function tr() {
|
|
|
1383
1365
|
) })
|
|
1384
1366
|
] }) }) : null;
|
|
1385
1367
|
}
|
|
1386
|
-
const qt = "_radioGroup_nwf7i_6",
|
|
1368
|
+
const qt = "_radioGroup_nwf7i_6", Lt = {
|
|
1387
1369
|
radioGroup: qt
|
|
1388
|
-
},
|
|
1370
|
+
}, nr = ({ displayType: r = "dropdown", collapsible: o = !0, startCollapsed: u = !1 }) => {
|
|
1389
1371
|
const {
|
|
1390
|
-
state: { sortableFields: s, sortBy:
|
|
1391
|
-
setSort:
|
|
1392
|
-
} =
|
|
1372
|
+
state: { sortableFields: s, sortBy: c, sortAscending: p },
|
|
1373
|
+
setSort: j
|
|
1374
|
+
} = Ne();
|
|
1393
1375
|
if (!s || s.length === 0) return null;
|
|
1394
|
-
const
|
|
1376
|
+
const m = c ? `${c}:${p ? "asc" : "desc"}` : "none", n = [
|
|
1395
1377
|
{ label: "None", value: "none" },
|
|
1396
|
-
...s.flatMap((
|
|
1397
|
-
{ label: `${
|
|
1398
|
-
{ label: `${
|
|
1378
|
+
...s.flatMap((k) => [
|
|
1379
|
+
{ label: `${k} (asc)`, value: `${k}:asc` },
|
|
1380
|
+
{ label: `${k} (desc)`, value: `${k}:desc` }
|
|
1399
1381
|
])
|
|
1400
|
-
],
|
|
1401
|
-
if (
|
|
1402
|
-
|
|
1382
|
+
], C = (k) => {
|
|
1383
|
+
if (k === "none" || k === "")
|
|
1384
|
+
j(null, !0);
|
|
1403
1385
|
else {
|
|
1404
|
-
const [L,
|
|
1405
|
-
|
|
1386
|
+
const [L, M] = k.split(":");
|
|
1387
|
+
j(L, M === "asc");
|
|
1406
1388
|
}
|
|
1407
|
-
},
|
|
1389
|
+
}, A = o ? u : !1;
|
|
1408
1390
|
return /* @__PURE__ */ t.jsx(
|
|
1409
|
-
|
|
1391
|
+
be,
|
|
1410
1392
|
{
|
|
1411
1393
|
title: "Sort by",
|
|
1412
1394
|
collapsible: o,
|
|
1413
|
-
collapsed:
|
|
1395
|
+
collapsed: A,
|
|
1414
1396
|
children: r === "dropdown" ? /* @__PURE__ */ t.jsx(
|
|
1415
1397
|
St,
|
|
1416
1398
|
{
|
|
1417
|
-
value:
|
|
1418
|
-
onValueChange:
|
|
1399
|
+
value: m,
|
|
1400
|
+
onValueChange: C,
|
|
1419
1401
|
options: n,
|
|
1420
1402
|
placeholder: "Select sort...",
|
|
1421
1403
|
"aria-label": "Sort by"
|
|
1422
1404
|
}
|
|
1423
|
-
) : /* @__PURE__ */ t.jsx("div", { className:
|
|
1424
|
-
|
|
1405
|
+
) : /* @__PURE__ */ t.jsx("div", { className: Lt.radioGroup, children: n.map((k) => /* @__PURE__ */ t.jsx(
|
|
1406
|
+
jt,
|
|
1425
1407
|
{
|
|
1426
|
-
id: `sort-${
|
|
1408
|
+
id: `sort-${k.value}`,
|
|
1427
1409
|
name: "sort-by",
|
|
1428
|
-
value:
|
|
1429
|
-
label:
|
|
1430
|
-
checked:
|
|
1431
|
-
onChange: (L) =>
|
|
1410
|
+
value: k.value,
|
|
1411
|
+
label: k.label,
|
|
1412
|
+
checked: m === k.value,
|
|
1413
|
+
onChange: (L) => C(L.target.value)
|
|
1432
1414
|
},
|
|
1433
|
-
|
|
1415
|
+
k.value
|
|
1434
1416
|
)) })
|
|
1435
1417
|
}
|
|
1436
1418
|
);
|
|
1437
|
-
}, zt = "_list_1y4fk_1",
|
|
1419
|
+
}, zt = "_list_1y4fk_1", Ut = {
|
|
1438
1420
|
list: zt
|
|
1439
1421
|
};
|
|
1440
|
-
function
|
|
1422
|
+
function sr() {
|
|
1441
1423
|
const {
|
|
1442
1424
|
state: { searchSettings: r },
|
|
1443
1425
|
setSearchSettings: o
|
|
1444
|
-
} =
|
|
1445
|
-
const
|
|
1446
|
-
isNaN(
|
|
1447
|
-
[n]:
|
|
1426
|
+
} = Ne(), [u, s] = G(!1), c = (n, C) => {
|
|
1427
|
+
const A = parseInt(C, 10);
|
|
1428
|
+
isNaN(A) || o({
|
|
1429
|
+
[n]: A
|
|
1448
1430
|
});
|
|
1449
|
-
},
|
|
1431
|
+
}, p = (n, C) => {
|
|
1450
1432
|
o({
|
|
1451
|
-
[n]:
|
|
1433
|
+
[n]: C
|
|
1452
1434
|
});
|
|
1453
|
-
},
|
|
1454
|
-
const
|
|
1455
|
-
isNaN(
|
|
1435
|
+
}, j = (n, C) => {
|
|
1436
|
+
const A = parseInt(C, 10);
|
|
1437
|
+
isNaN(A) || o({
|
|
1456
1438
|
coverageSetup: {
|
|
1457
1439
|
...r.coverageSetup,
|
|
1458
|
-
[n]:
|
|
1440
|
+
[n]: A
|
|
1459
1441
|
}
|
|
1460
1442
|
});
|
|
1461
|
-
},
|
|
1443
|
+
}, m = (n, C) => {
|
|
1462
1444
|
o({
|
|
1463
1445
|
coverageSetup: {
|
|
1464
1446
|
...r.coverageSetup,
|
|
1465
|
-
[n]:
|
|
1447
|
+
[n]: C
|
|
1466
1448
|
}
|
|
1467
1449
|
});
|
|
1468
1450
|
};
|
|
1469
|
-
return /* @__PURE__ */ t.jsx(
|
|
1451
|
+
return /* @__PURE__ */ t.jsx(be, { collapsed: !0, title: "Settings", children: /* @__PURE__ */ t.jsxs("ul", { className: Ut.list, children: [
|
|
1470
1452
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1471
|
-
|
|
1453
|
+
K,
|
|
1472
1454
|
{
|
|
1473
1455
|
label: "Max Results",
|
|
1474
1456
|
type: "number",
|
|
1475
1457
|
value: r.maxNumberOfRecordsToReturn.toString(),
|
|
1476
|
-
onChange: (n) =>
|
|
1458
|
+
onChange: (n) => c("maxNumberOfRecordsToReturn", n.target.value)
|
|
1477
1459
|
}
|
|
1478
1460
|
) }),
|
|
1479
1461
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1480
|
-
|
|
1462
|
+
K,
|
|
1481
1463
|
{
|
|
1482
1464
|
label: "Coverage Depth",
|
|
1483
1465
|
type: "number",
|
|
1484
1466
|
value: r.coverageDepth.toString(),
|
|
1485
|
-
onChange: (n) =>
|
|
1467
|
+
onChange: (n) => c("coverageDepth", n.target.value)
|
|
1486
1468
|
}
|
|
1487
1469
|
) }),
|
|
1488
1470
|
/* @__PURE__ */ t.jsxs("li", { children: [
|
|
1489
1471
|
/* @__PURE__ */ t.jsx(
|
|
1490
|
-
|
|
1472
|
+
K,
|
|
1491
1473
|
{
|
|
1492
1474
|
label: "Minimum Score",
|
|
1493
1475
|
type: "number",
|
|
1494
1476
|
value: r.minimumScore.toString(),
|
|
1495
1477
|
onChange: (n) => {
|
|
1496
|
-
const
|
|
1497
|
-
isNaN(
|
|
1478
|
+
const C = parseFloat(n.target.value);
|
|
1479
|
+
isNaN(C) || o({ minimumScore: C });
|
|
1498
1480
|
}
|
|
1499
1481
|
}
|
|
1500
1482
|
),
|
|
@@ -1513,7 +1495,7 @@ function nr() {
|
|
|
1513
1495
|
) })
|
|
1514
1496
|
] }),
|
|
1515
1497
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1516
|
-
|
|
1498
|
+
K,
|
|
1517
1499
|
{
|
|
1518
1500
|
label: "Placeholder text",
|
|
1519
1501
|
type: "text",
|
|
@@ -1528,7 +1510,7 @@ function nr() {
|
|
|
1528
1510
|
{
|
|
1529
1511
|
label: "Show score",
|
|
1530
1512
|
checked: r.showScore,
|
|
1531
|
-
onChange: (n) =>
|
|
1513
|
+
onChange: (n) => p("showScore", n)
|
|
1532
1514
|
}
|
|
1533
1515
|
) }),
|
|
1534
1516
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
@@ -1536,7 +1518,7 @@ function nr() {
|
|
|
1536
1518
|
{
|
|
1537
1519
|
label: "Enable Coverage",
|
|
1538
1520
|
checked: r.enableCoverage,
|
|
1539
|
-
onChange: (n) =>
|
|
1521
|
+
onChange: (n) => p("enableCoverage", n)
|
|
1540
1522
|
}
|
|
1541
1523
|
) }),
|
|
1542
1524
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
@@ -1544,17 +1526,17 @@ function nr() {
|
|
|
1544
1526
|
{
|
|
1545
1527
|
label: "Remove Duplicates",
|
|
1546
1528
|
checked: r.removeDuplicates,
|
|
1547
|
-
onChange: (n) =>
|
|
1529
|
+
onChange: (n) => p("removeDuplicates", n)
|
|
1548
1530
|
}
|
|
1549
1531
|
) }),
|
|
1550
|
-
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(ye, { variant: "ghost", size: "micro", iconRight:
|
|
1551
|
-
|
|
1532
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(ye, { variant: "ghost", size: "micro", iconRight: u ? /* @__PURE__ */ t.jsx(Tt, {}) : /* @__PURE__ */ t.jsx(At, {}), onClick: () => s((n) => !n), children: u ? "Hide Coverage Setup" : "Show Coverage Setup" }) }),
|
|
1533
|
+
u && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1552
1534
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1553
1535
|
le,
|
|
1554
1536
|
{
|
|
1555
1537
|
label: "Cover Whole Query",
|
|
1556
1538
|
checked: r.coverageSetup.coverWholeQuery,
|
|
1557
|
-
onChange: (n) =>
|
|
1539
|
+
onChange: (n) => m("coverWholeQuery", n)
|
|
1558
1540
|
}
|
|
1559
1541
|
) }),
|
|
1560
1542
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
@@ -1562,7 +1544,7 @@ function nr() {
|
|
|
1562
1544
|
{
|
|
1563
1545
|
label: "Cover Whole Words",
|
|
1564
1546
|
checked: r.coverageSetup.coverWholeWords,
|
|
1565
|
-
onChange: (n) =>
|
|
1547
|
+
onChange: (n) => m("coverWholeWords", n)
|
|
1566
1548
|
}
|
|
1567
1549
|
) }),
|
|
1568
1550
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
@@ -1570,7 +1552,7 @@ function nr() {
|
|
|
1570
1552
|
{
|
|
1571
1553
|
label: "Cover Fuzzy Words",
|
|
1572
1554
|
checked: r.coverageSetup.coverFuzzyWords,
|
|
1573
|
-
onChange: (n) =>
|
|
1555
|
+
onChange: (n) => m("coverFuzzyWords", n)
|
|
1574
1556
|
}
|
|
1575
1557
|
) }),
|
|
1576
1558
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
@@ -1578,7 +1560,7 @@ function nr() {
|
|
|
1578
1560
|
{
|
|
1579
1561
|
label: "Cover Joined Words",
|
|
1580
1562
|
checked: r.coverageSetup.coverJoinedWords,
|
|
1581
|
-
onChange: (n) =>
|
|
1563
|
+
onChange: (n) => m("coverJoinedWords", n)
|
|
1582
1564
|
}
|
|
1583
1565
|
) }),
|
|
1584
1566
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
@@ -1586,7 +1568,7 @@ function nr() {
|
|
|
1586
1568
|
{
|
|
1587
1569
|
label: "Cover Prefix Suffix",
|
|
1588
1570
|
checked: r.coverageSetup.coverPrefixSuffix,
|
|
1589
|
-
onChange: (n) =>
|
|
1571
|
+
onChange: (n) => m("coverPrefixSuffix", n)
|
|
1590
1572
|
}
|
|
1591
1573
|
) }),
|
|
1592
1574
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
@@ -1594,79 +1576,79 @@ function nr() {
|
|
|
1594
1576
|
{
|
|
1595
1577
|
label: "Truncate list",
|
|
1596
1578
|
checked: r.coverageSetup.truncate,
|
|
1597
|
-
onChange: (n) =>
|
|
1579
|
+
onChange: (n) => m("truncate", n)
|
|
1598
1580
|
}
|
|
1599
1581
|
) }),
|
|
1600
1582
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1601
|
-
|
|
1583
|
+
K,
|
|
1602
1584
|
{
|
|
1603
1585
|
label: "Levenshtein Max Word Size",
|
|
1604
1586
|
type: "number",
|
|
1605
1587
|
value: r.coverageSetup.levenshteinMaxWordSize.toString(),
|
|
1606
|
-
onChange: (n) =>
|
|
1588
|
+
onChange: (n) => j("levenshteinMaxWordSize", n.target.value)
|
|
1607
1589
|
}
|
|
1608
1590
|
) }),
|
|
1609
1591
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1610
|
-
|
|
1592
|
+
K,
|
|
1611
1593
|
{
|
|
1612
1594
|
label: "Min Word Size",
|
|
1613
1595
|
type: "number",
|
|
1614
1596
|
value: r.coverageSetup.minWordSize.toString(),
|
|
1615
|
-
onChange: (n) =>
|
|
1597
|
+
onChange: (n) => j("minWordSize", n.target.value)
|
|
1616
1598
|
}
|
|
1617
1599
|
) }),
|
|
1618
1600
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1619
|
-
|
|
1601
|
+
K,
|
|
1620
1602
|
{
|
|
1621
1603
|
label: "Coverage Min Word Hits Abs",
|
|
1622
1604
|
type: "number",
|
|
1623
1605
|
value: r.coverageSetup.coverageMinWordHitsAbs.toString(),
|
|
1624
|
-
onChange: (n) =>
|
|
1606
|
+
onChange: (n) => j("coverageMinWordHitsAbs", n.target.value)
|
|
1625
1607
|
}
|
|
1626
1608
|
) }),
|
|
1627
1609
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1628
|
-
|
|
1610
|
+
K,
|
|
1629
1611
|
{
|
|
1630
1612
|
label: "Coverage Min Word Hits Relative",
|
|
1631
1613
|
type: "number",
|
|
1632
1614
|
value: r.coverageSetup.coverageMinWordHitsRelative.toString(),
|
|
1633
|
-
onChange: (n) =>
|
|
1615
|
+
onChange: (n) => j("coverageMinWordHitsRelative", n.target.value)
|
|
1634
1616
|
}
|
|
1635
1617
|
) }),
|
|
1636
1618
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1637
|
-
|
|
1619
|
+
K,
|
|
1638
1620
|
{
|
|
1639
1621
|
label: "Coverage Q Limit For Error Tolerance",
|
|
1640
1622
|
type: "number",
|
|
1641
1623
|
value: r.coverageSetup.coverageQLimitForErrorTolerance.toString(),
|
|
1642
|
-
onChange: (n) =>
|
|
1624
|
+
onChange: (n) => j("coverageQLimitForErrorTolerance", n.target.value)
|
|
1643
1625
|
}
|
|
1644
1626
|
) }),
|
|
1645
1627
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1646
|
-
|
|
1628
|
+
K,
|
|
1647
1629
|
{
|
|
1648
1630
|
label: "Coverage LCS Error Tolerance Relative Q",
|
|
1649
1631
|
type: "number",
|
|
1650
1632
|
value: r.coverageSetup.coverageLcsErrorToleranceRelativeq.toString(),
|
|
1651
|
-
onChange: (n) =>
|
|
1633
|
+
onChange: (n) => j("coverageLcsErrorToleranceRelativeq", n.target.value)
|
|
1652
1634
|
}
|
|
1653
1635
|
) })
|
|
1654
1636
|
] })
|
|
1655
1637
|
] }) });
|
|
1656
1638
|
}
|
|
1657
|
-
class
|
|
1658
|
-
constructor(
|
|
1659
|
-
super(
|
|
1639
|
+
class or extends bt {
|
|
1640
|
+
constructor(u) {
|
|
1641
|
+
super(u);
|
|
1660
1642
|
tt(this, "reset", () => {
|
|
1661
1643
|
this.setState({ hasError: !1, error: null });
|
|
1662
1644
|
});
|
|
1663
1645
|
this.state = { hasError: !1, error: null };
|
|
1664
1646
|
}
|
|
1665
|
-
static getDerivedStateFromError(
|
|
1666
|
-
return { hasError: !0, error:
|
|
1647
|
+
static getDerivedStateFromError(u) {
|
|
1648
|
+
return { hasError: !0, error: u };
|
|
1667
1649
|
}
|
|
1668
|
-
componentDidCatch(
|
|
1669
|
-
console.error("[SearchErrorBoundary] Caught error:",
|
|
1650
|
+
componentDidCatch(u, s) {
|
|
1651
|
+
console.error("[SearchErrorBoundary] Caught error:", u, s);
|
|
1670
1652
|
}
|
|
1671
1653
|
render() {
|
|
1672
1654
|
return this.state.hasError && this.state.error ? this.props.fallback ? this.props.fallback(this.state.error, this.reset) : /* @__PURE__ */ t.jsxs("div", { style: {
|
|
@@ -1719,15 +1701,15 @@ class sr extends xt {
|
|
|
1719
1701
|
}
|
|
1720
1702
|
}
|
|
1721
1703
|
export {
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1704
|
+
rr as ActiveFiltersPanel,
|
|
1705
|
+
tr as RangeFilterPanel,
|
|
1706
|
+
or as SearchErrorBoundary,
|
|
1707
|
+
Zt as SearchInput,
|
|
1726
1708
|
Qt as SearchProvider,
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1709
|
+
Kt as SearchResults,
|
|
1710
|
+
sr as SearchSettingsPanel,
|
|
1711
|
+
nr as SortByPanel,
|
|
1712
|
+
er as ValueFilterPanel,
|
|
1713
|
+
Ne as useSearch,
|
|
1714
|
+
Ne as useSearchContext
|
|
1733
1715
|
};
|