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