@indxsearch/intrface 1.2.0 → 2.0.1

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