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