@indxsearch/intrface 2.0.0 → 2.1.0

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