@indxsearch/intrface 1.0.9 → 1.1.1

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