@tanstack/router-devtools 0.0.1-alpha.0 → 0.0.1-beta.84

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.
Files changed (73) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -1
  3. package/build/cjs/Explorer.js +57 -81
  4. package/build/cjs/Explorer.js.map +1 -1
  5. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js +1 -19
  6. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
  7. package/build/cjs/devtools.js +256 -266
  8. package/build/cjs/devtools.js.map +1 -1
  9. package/build/cjs/index.js +3 -3
  10. package/build/cjs/styledComponents.js +10 -38
  11. package/build/cjs/styledComponents.js.map +1 -1
  12. package/build/cjs/theme.js +5 -8
  13. package/build/cjs/theme.js.map +1 -1
  14. package/build/cjs/useLocalStorage.js +3 -10
  15. package/build/cjs/useLocalStorage.js.map +1 -1
  16. package/build/cjs/useMediaQuery.js +13 -12
  17. package/build/cjs/useMediaQuery.js.map +1 -1
  18. package/build/cjs/utils.js +25 -35
  19. package/build/cjs/utils.js.map +1 -1
  20. package/build/esm/index.js +308 -1337
  21. package/build/esm/index.js.map +1 -1
  22. package/build/stats-html.html +59 -49
  23. package/build/stats-react.json +223 -9444
  24. package/build/types/index.d.ts +6 -5
  25. package/build/umd/index.development.js +347 -1316
  26. package/build/umd/index.development.js.map +1 -1
  27. package/build/umd/index.production.js +22 -2
  28. package/build/umd/index.production.js.map +1 -1
  29. package/package.json +9 -11
  30. package/src/Explorer.tsx +14 -12
  31. package/src/devtools.tsx +263 -240
  32. package/src/useLocalStorage.ts +5 -5
  33. package/src/useMediaQuery.ts +3 -0
  34. package/src/utils.ts +35 -17
  35. package/build/cjs/Logo.js +0 -73
  36. package/build/cjs/Logo.js.map +0 -1
  37. package/build/cjs/packages/react-location-devtools/src/Explorer.js +0 -240
  38. package/build/cjs/packages/react-location-devtools/src/Explorer.js.map +0 -1
  39. package/build/cjs/packages/react-location-devtools/src/Logo.js +0 -73
  40. package/build/cjs/packages/react-location-devtools/src/Logo.js.map +0 -1
  41. package/build/cjs/packages/react-location-devtools/src/devtools.js +0 -614
  42. package/build/cjs/packages/react-location-devtools/src/devtools.js.map +0 -1
  43. package/build/cjs/packages/react-location-devtools/src/index.js +0 -21
  44. package/build/cjs/packages/react-location-devtools/src/index.js.map +0 -1
  45. package/build/cjs/packages/react-location-devtools/src/styledComponents.js +0 -107
  46. package/build/cjs/packages/react-location-devtools/src/styledComponents.js.map +0 -1
  47. package/build/cjs/packages/react-location-devtools/src/theme.js +0 -54
  48. package/build/cjs/packages/react-location-devtools/src/theme.js.map +0 -1
  49. package/build/cjs/packages/react-location-devtools/src/useLocalStorage.js +0 -65
  50. package/build/cjs/packages/react-location-devtools/src/useLocalStorage.js.map +0 -1
  51. package/build/cjs/packages/react-location-devtools/src/useMediaQuery.js +0 -57
  52. package/build/cjs/packages/react-location-devtools/src/useMediaQuery.js.map +0 -1
  53. package/build/cjs/packages/react-location-devtools/src/utils.js +0 -117
  54. package/build/cjs/packages/react-location-devtools/src/utils.js.map +0 -1
  55. package/build/cjs/packages/react-router-devtools/src/Explorer.js +0 -245
  56. package/build/cjs/packages/react-router-devtools/src/Explorer.js.map +0 -1
  57. package/build/cjs/packages/react-router-devtools/src/Logo.js +0 -73
  58. package/build/cjs/packages/react-router-devtools/src/Logo.js.map +0 -1
  59. package/build/cjs/packages/react-router-devtools/src/devtools.js +0 -654
  60. package/build/cjs/packages/react-router-devtools/src/devtools.js.map +0 -1
  61. package/build/cjs/packages/react-router-devtools/src/index.js +0 -21
  62. package/build/cjs/packages/react-router-devtools/src/index.js.map +0 -1
  63. package/build/cjs/packages/react-router-devtools/src/styledComponents.js +0 -107
  64. package/build/cjs/packages/react-router-devtools/src/styledComponents.js.map +0 -1
  65. package/build/cjs/packages/react-router-devtools/src/theme.js +0 -54
  66. package/build/cjs/packages/react-router-devtools/src/theme.js.map +0 -1
  67. package/build/cjs/packages/react-router-devtools/src/useLocalStorage.js +0 -65
  68. package/build/cjs/packages/react-router-devtools/src/useLocalStorage.js.map +0 -1
  69. package/build/cjs/packages/react-router-devtools/src/useMediaQuery.js +0 -57
  70. package/build/cjs/packages/react-router-devtools/src/useMediaQuery.js.map +0 -1
  71. package/build/cjs/packages/react-router-devtools/src/utils.js +0 -117
  72. package/build/cjs/packages/react-router-devtools/src/utils.js.map +0 -1
  73. package/src/Logo.tsx +0 -37
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router-devtools
2
+ * router-devtools
3
3
  *
4
4
  * Copyright (c) TanStack
5
5
  *
@@ -9,10 +9,10 @@
9
9
  * @license MIT
10
10
  */
11
11
  (function (global, factory) {
12
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@tanstack/react-router')) :
13
- typeof define === 'function' && define.amd ? define(['exports', 'react', '@tanstack/react-router'], factory) :
14
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactLocationDevtools = {}, global.React, global.ReactLocation));
15
- })(this, (function (exports, React, reactRouter) { 'use strict';
12
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('use-sync-external-store/shim/with-selector')) :
13
+ typeof define === 'function' && define.amd ? define(['exports', 'react', 'use-sync-external-store/shim/with-selector'], factory) :
14
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TanStackRouterDevtools = {}, global.React, global.withSelector));
15
+ })(this, (function (exports, React, withSelector) { 'use strict';
16
16
 
17
17
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
18
 
@@ -34,894 +34,99 @@
34
34
  return Object.freeze(n);
35
35
  }
36
36
 
37
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
38
37
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
38
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
39
39
 
40
40
  function _extends() {
41
41
  _extends = Object.assign ? Object.assign.bind() : function (target) {
42
42
  for (var i = 1; i < arguments.length; i++) {
43
43
  var source = arguments[i];
44
-
45
44
  for (var key in source) {
46
45
  if (Object.prototype.hasOwnProperty.call(source, key)) {
47
46
  target[key] = source[key];
48
47
  }
49
48
  }
50
49
  }
51
-
52
50
  return target;
53
51
  };
54
52
  return _extends.apply(this, arguments);
55
53
  }
56
54
 
57
- function _objectWithoutPropertiesLoose(source, excluded) {
58
- if (source == null) return {};
59
- var target = {};
60
- var sourceKeys = Object.keys(source);
61
- var key, i;
62
-
63
- for (i = 0; i < sourceKeys.length; i++) {
64
- key = sourceKeys[i];
65
- if (excluded.indexOf(key) >= 0) continue;
66
- target[key] = source[key];
67
- }
68
-
69
- return target;
70
- }
71
-
72
- function requiredArgs(required, args) {
73
- if (args.length < required) {
74
- throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
75
- }
76
- }
77
-
78
- /**
79
- * @name toDate
80
- * @category Common Helpers
81
- * @summary Convert the given argument to an instance of Date.
82
- *
83
- * @description
84
- * Convert the given argument to an instance of Date.
85
- *
86
- * If the argument is an instance of Date, the function returns its clone.
87
- *
88
- * If the argument is a number, it is treated as a timestamp.
89
- *
90
- * If the argument is none of the above, the function returns Invalid Date.
91
- *
92
- * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
93
- *
94
- * @param {Date|Number} argument - the value to convert
95
- * @returns {Date} the parsed date in the local time zone
96
- * @throws {TypeError} 1 argument required
97
- *
98
- * @example
99
- * // Clone the date:
100
- * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
101
- * //=> Tue Feb 11 2014 11:30:30
102
- *
103
- * @example
104
- * // Convert the timestamp to date:
105
- * const result = toDate(1392098430000)
106
- * //=> Tue Feb 11 2014 11:30:30
107
- */
108
-
109
- function toDate(argument) {
110
- requiredArgs(1, arguments);
111
- var argStr = Object.prototype.toString.call(argument); // Clone the date
112
-
113
- if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {
114
- // Prevent the date to lose the milliseconds when passed to new Date() in IE10
115
- return new Date(argument.getTime());
116
- } else if (typeof argument === 'number' || argStr === '[object Number]') {
117
- return new Date(argument);
118
- } else {
119
- if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
120
- // eslint-disable-next-line no-console
121
- console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"); // eslint-disable-next-line no-console
122
-
123
- console.warn(new Error().stack);
55
+ var prefix = 'Invariant failed';
56
+ function invariant(condition, message) {
57
+ if (condition) {
58
+ return;
124
59
  }
125
-
126
- return new Date(NaN);
127
- }
128
- }
129
-
130
- var defaultOptions = {};
131
- function getDefaultOptions() {
132
- return defaultOptions;
60
+ var provided = typeof message === 'function' ? message() : message;
61
+ var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
62
+ throw new Error(value);
133
63
  }
134
64
 
135
65
  /**
136
- * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
137
- * They usually appear for dates that denote time before the timezones were introduced
138
- * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
139
- * and GMT+01:00:00 after that date)
66
+ * react-store
140
67
  *
141
- * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
142
- * which would lead to incorrect calculations.
68
+ * Copyright (c) TanStack
143
69
  *
144
- * This function returns the timezone offset in milliseconds that takes seconds in account.
145
- */
146
- function getTimezoneOffsetInMilliseconds(date) {
147
- var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
148
- utcDate.setUTCFullYear(date.getFullYear());
149
- return date.getTime() - utcDate.getTime();
150
- }
151
-
152
- /**
153
- * @name compareAsc
154
- * @category Common Helpers
155
- * @summary Compare the two dates and return -1, 0 or 1.
156
- *
157
- * @description
158
- * Compare the two dates and return 1 if the first date is after the second,
159
- * -1 if the first date is before the second or 0 if dates are equal.
160
- *
161
- * @param {Date|Number} dateLeft - the first date to compare
162
- * @param {Date|Number} dateRight - the second date to compare
163
- * @returns {Number} the result of the comparison
164
- * @throws {TypeError} 2 arguments required
165
- *
166
- * @example
167
- * // Compare 11 February 1987 and 10 July 1989:
168
- * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))
169
- * //=> -1
70
+ * This source code is licensed under the MIT license found in the
71
+ * LICENSE.md file in the root directory of this source tree.
170
72
  *
171
- * @example
172
- * // Sort the array of dates:
173
- * const result = [
174
- * new Date(1995, 6, 2),
175
- * new Date(1987, 1, 11),
176
- * new Date(1989, 6, 10)
177
- * ].sort(compareAsc)
178
- * //=> [
179
- * // Wed Feb 11 1987 00:00:00,
180
- * // Mon Jul 10 1989 00:00:00,
181
- * // Sun Jul 02 1995 00:00:00
182
- * // ]
73
+ * @license MIT
183
74
  */
184
75
 
185
- function compareAsc(dirtyDateLeft, dirtyDateRight) {
186
- requiredArgs(2, arguments);
187
- var dateLeft = toDate(dirtyDateLeft);
188
- var dateRight = toDate(dirtyDateRight);
189
- var diff = dateLeft.getTime() - dateRight.getTime();
190
-
191
- if (diff < 0) {
192
- return -1;
193
- } else if (diff > 0) {
194
- return 1; // Return 0 if diff is 0; return NaN if diff is NaN
195
- } else {
196
- return diff;
197
- }
198
- }
199
-
200
- var formatDistanceLocale = {
201
- lessThanXSeconds: {
202
- one: 'less than a second',
203
- other: 'less than {{count}} seconds'
204
- },
205
- xSeconds: {
206
- one: '1 second',
207
- other: '{{count}} seconds'
208
- },
209
- halfAMinute: 'half a minute',
210
- lessThanXMinutes: {
211
- one: 'less than a minute',
212
- other: 'less than {{count}} minutes'
213
- },
214
- xMinutes: {
215
- one: '1 minute',
216
- other: '{{count}} minutes'
217
- },
218
- aboutXHours: {
219
- one: 'about 1 hour',
220
- other: 'about {{count}} hours'
221
- },
222
- xHours: {
223
- one: '1 hour',
224
- other: '{{count}} hours'
225
- },
226
- xDays: {
227
- one: '1 day',
228
- other: '{{count}} days'
229
- },
230
- aboutXWeeks: {
231
- one: 'about 1 week',
232
- other: 'about {{count}} weeks'
233
- },
234
- xWeeks: {
235
- one: '1 week',
236
- other: '{{count}} weeks'
237
- },
238
- aboutXMonths: {
239
- one: 'about 1 month',
240
- other: 'about {{count}} months'
241
- },
242
- xMonths: {
243
- one: '1 month',
244
- other: '{{count}} months'
245
- },
246
- aboutXYears: {
247
- one: 'about 1 year',
248
- other: 'about {{count}} years'
249
- },
250
- xYears: {
251
- one: '1 year',
252
- other: '{{count}} years'
253
- },
254
- overXYears: {
255
- one: 'over 1 year',
256
- other: 'over {{count}} years'
257
- },
258
- almostXYears: {
259
- one: 'almost 1 year',
260
- other: 'almost {{count}} years'
261
- }
262
- };
263
-
264
- var formatDistance = function (token, count, options) {
265
- var result;
266
- var tokenValue = formatDistanceLocale[token];
267
-
268
- if (typeof tokenValue === 'string') {
269
- result = tokenValue;
270
- } else if (count === 1) {
271
- result = tokenValue.one;
272
- } else {
273
- result = tokenValue.other.replace('{{count}}', count.toString());
274
- }
275
-
276
- if (options !== null && options !== void 0 && options.addSuffix) {
277
- if (options.comparison && options.comparison > 0) {
278
- return 'in ' + result;
279
- } else {
280
- return result + ' ago';
281
- }
282
- }
283
-
284
- return result;
285
- };
286
-
287
- var formatDistance$1 = formatDistance;
288
-
289
- function buildFormatLongFn(args) {
290
- return function () {
291
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
292
- // TODO: Remove String()
293
- var width = options.width ? String(options.width) : args.defaultWidth;
294
- var format = args.formats[width] || args.formats[args.defaultWidth];
295
- return format;
296
- };
297
- }
298
-
299
- var dateFormats = {
300
- full: 'EEEE, MMMM do, y',
301
- long: 'MMMM do, y',
302
- medium: 'MMM d, y',
303
- short: 'MM/dd/yyyy'
304
- };
305
- var timeFormats = {
306
- full: 'h:mm:ss a zzzz',
307
- long: 'h:mm:ss a z',
308
- medium: 'h:mm:ss a',
309
- short: 'h:mm a'
310
- };
311
- var dateTimeFormats = {
312
- full: "{{date}} 'at' {{time}}",
313
- long: "{{date}} 'at' {{time}}",
314
- medium: '{{date}}, {{time}}',
315
- short: '{{date}}, {{time}}'
316
- };
317
- var formatLong = {
318
- date: buildFormatLongFn({
319
- formats: dateFormats,
320
- defaultWidth: 'full'
321
- }),
322
- time: buildFormatLongFn({
323
- formats: timeFormats,
324
- defaultWidth: 'full'
325
- }),
326
- dateTime: buildFormatLongFn({
327
- formats: dateTimeFormats,
328
- defaultWidth: 'full'
329
- })
330
- };
331
- var formatLong$1 = formatLong;
332
-
333
- var formatRelativeLocale = {
334
- lastWeek: "'last' eeee 'at' p",
335
- yesterday: "'yesterday at' p",
336
- today: "'today at' p",
337
- tomorrow: "'tomorrow at' p",
338
- nextWeek: "eeee 'at' p",
339
- other: 'P'
340
- };
341
-
342
- var formatRelative = function (token, _date, _baseDate, _options) {
343
- return formatRelativeLocale[token];
344
- };
345
-
346
- var formatRelative$1 = formatRelative;
347
-
348
- function buildLocalizeFn(args) {
349
- return function (dirtyIndex, options) {
350
- var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
351
- var valuesArray;
352
-
353
- if (context === 'formatting' && args.formattingValues) {
354
- var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
355
- var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
356
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
357
- } else {
358
- var _defaultWidth = args.defaultWidth;
359
-
360
- var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
361
-
362
- valuesArray = args.values[_width] || args.values[_defaultWidth];
363
- }
364
-
365
- var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
366
-
367
- return valuesArray[index];
368
- };
369
- }
370
-
371
- var eraValues = {
372
- narrow: ['B', 'A'],
373
- abbreviated: ['BC', 'AD'],
374
- wide: ['Before Christ', 'Anno Domini']
375
- };
376
- var quarterValues = {
377
- narrow: ['1', '2', '3', '4'],
378
- abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
379
- wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
380
- }; // Note: in English, the names of days of the week and months are capitalized.
381
- // If you are making a new locale based on this one, check if the same is true for the language you're working on.
382
- // Generally, formatted dates should look like they are in the middle of a sentence,
383
- // e.g. in Spanish language the weekdays and months should be in the lowercase.
384
-
385
- var monthValues = {
386
- narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
387
- abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
388
- wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
389
- };
390
- var dayValues = {
391
- narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
392
- short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
393
- abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
394
- wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
395
- };
396
- var dayPeriodValues = {
397
- narrow: {
398
- am: 'a',
399
- pm: 'p',
400
- midnight: 'mi',
401
- noon: 'n',
402
- morning: 'morning',
403
- afternoon: 'afternoon',
404
- evening: 'evening',
405
- night: 'night'
406
- },
407
- abbreviated: {
408
- am: 'AM',
409
- pm: 'PM',
410
- midnight: 'midnight',
411
- noon: 'noon',
412
- morning: 'morning',
413
- afternoon: 'afternoon',
414
- evening: 'evening',
415
- night: 'night'
416
- },
417
- wide: {
418
- am: 'a.m.',
419
- pm: 'p.m.',
420
- midnight: 'midnight',
421
- noon: 'noon',
422
- morning: 'morning',
423
- afternoon: 'afternoon',
424
- evening: 'evening',
425
- night: 'night'
426
- }
427
- };
428
- var formattingDayPeriodValues = {
429
- narrow: {
430
- am: 'a',
431
- pm: 'p',
432
- midnight: 'mi',
433
- noon: 'n',
434
- morning: 'in the morning',
435
- afternoon: 'in the afternoon',
436
- evening: 'in the evening',
437
- night: 'at night'
438
- },
439
- abbreviated: {
440
- am: 'AM',
441
- pm: 'PM',
442
- midnight: 'midnight',
443
- noon: 'noon',
444
- morning: 'in the morning',
445
- afternoon: 'in the afternoon',
446
- evening: 'in the evening',
447
- night: 'at night'
448
- },
449
- wide: {
450
- am: 'a.m.',
451
- pm: 'p.m.',
452
- midnight: 'midnight',
453
- noon: 'noon',
454
- morning: 'in the morning',
455
- afternoon: 'in the afternoon',
456
- evening: 'in the evening',
457
- night: 'at night'
458
- }
459
- };
460
-
461
- var ordinalNumber = function (dirtyNumber, _options) {
462
- var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
463
- // if they are different for different grammatical genders,
464
- // use `options.unit`.
465
- //
466
- // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
467
- // 'day', 'hour', 'minute', 'second'.
468
-
469
- var rem100 = number % 100;
470
-
471
- if (rem100 > 20 || rem100 < 10) {
472
- switch (rem100 % 10) {
473
- case 1:
474
- return number + 'st';
475
-
476
- case 2:
477
- return number + 'nd';
478
-
479
- case 3:
480
- return number + 'rd';
481
- }
482
- }
483
-
484
- return number + 'th';
485
- };
486
-
487
- var localize = {
488
- ordinalNumber: ordinalNumber,
489
- era: buildLocalizeFn({
490
- values: eraValues,
491
- defaultWidth: 'wide'
492
- }),
493
- quarter: buildLocalizeFn({
494
- values: quarterValues,
495
- defaultWidth: 'wide',
496
- argumentCallback: function (quarter) {
497
- return quarter - 1;
498
- }
499
- }),
500
- month: buildLocalizeFn({
501
- values: monthValues,
502
- defaultWidth: 'wide'
503
- }),
504
- day: buildLocalizeFn({
505
- values: dayValues,
506
- defaultWidth: 'wide'
507
- }),
508
- dayPeriod: buildLocalizeFn({
509
- values: dayPeriodValues,
510
- defaultWidth: 'wide',
511
- formattingValues: formattingDayPeriodValues,
512
- defaultFormattingWidth: 'wide'
513
- })
514
- };
515
- var localize$1 = localize;
516
-
517
- function buildMatchFn(args) {
518
- return function (string) {
519
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
520
- var width = options.width;
521
- var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
522
- var matchResult = string.match(matchPattern);
523
-
524
- if (!matchResult) {
525
- return null;
526
- }
527
-
528
- var matchedString = matchResult[0];
529
- var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
530
- var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
531
- return pattern.test(matchedString);
532
- }) : findKey(parsePatterns, function (pattern) {
533
- return pattern.test(matchedString);
534
- });
535
- var value;
536
- value = args.valueCallback ? args.valueCallback(key) : key;
537
- value = options.valueCallback ? options.valueCallback(value) : value;
538
- var rest = string.slice(matchedString.length);
539
- return {
540
- value: value,
541
- rest: rest
542
- };
543
- };
76
+ function useStore(store, selector = d => d) {
77
+ const slice = withSelector.useSyncExternalStoreWithSelector(store.subscribe, () => store.state, () => store.state, selector, shallow);
78
+ return slice;
544
79
  }
545
-
546
- function findKey(object, predicate) {
547
- for (var key in object) {
548
- if (object.hasOwnProperty(key) && predicate(object[key])) {
549
- return key;
550
- }
80
+ function shallow(objA, objB) {
81
+ if (Object.is(objA, objB)) {
82
+ return true;
551
83
  }
552
-
553
- return undefined;
554
- }
555
-
556
- function findIndex(array, predicate) {
557
- for (var key = 0; key < array.length; key++) {
558
- if (predicate(array[key])) {
559
- return key;
560
- }
84
+ if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
85
+ return false;
561
86
  }
562
-
563
- return undefined;
564
- }
565
-
566
- function buildMatchPatternFn(args) {
567
- return function (string) {
568
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
569
- var matchResult = string.match(args.matchPattern);
570
- if (!matchResult) return null;
571
- var matchedString = matchResult[0];
572
- var parseResult = string.match(args.parsePattern);
573
- if (!parseResult) return null;
574
- var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
575
- value = options.valueCallback ? options.valueCallback(value) : value;
576
- var rest = string.slice(matchedString.length);
577
- return {
578
- value: value,
579
- rest: rest
580
- };
581
- };
582
- }
583
-
584
- var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
585
- var parseOrdinalNumberPattern = /\d+/i;
586
- var matchEraPatterns = {
587
- narrow: /^(b|a)/i,
588
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
589
- wide: /^(before christ|before common era|anno domini|common era)/i
590
- };
591
- var parseEraPatterns = {
592
- any: [/^b/i, /^(a|c)/i]
593
- };
594
- var matchQuarterPatterns = {
595
- narrow: /^[1234]/i,
596
- abbreviated: /^q[1234]/i,
597
- wide: /^[1234](th|st|nd|rd)? quarter/i
598
- };
599
- var parseQuarterPatterns = {
600
- any: [/1/i, /2/i, /3/i, /4/i]
601
- };
602
- var matchMonthPatterns = {
603
- narrow: /^[jfmasond]/i,
604
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
605
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
606
- };
607
- var parseMonthPatterns = {
608
- narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
609
- any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
610
- };
611
- var matchDayPatterns = {
612
- narrow: /^[smtwf]/i,
613
- short: /^(su|mo|tu|we|th|fr|sa)/i,
614
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
615
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
616
- };
617
- var parseDayPatterns = {
618
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
619
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
620
- };
621
- var matchDayPeriodPatterns = {
622
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
623
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
624
- };
625
- var parseDayPeriodPatterns = {
626
- any: {
627
- am: /^a/i,
628
- pm: /^p/i,
629
- midnight: /^mi/i,
630
- noon: /^no/i,
631
- morning: /morning/i,
632
- afternoon: /afternoon/i,
633
- evening: /evening/i,
634
- night: /night/i
87
+ const keysA = Object.keys(objA);
88
+ if (keysA.length !== Object.keys(objB).length) {
89
+ return false;
635
90
  }
636
- };
637
- var match = {
638
- ordinalNumber: buildMatchPatternFn({
639
- matchPattern: matchOrdinalNumberPattern,
640
- parsePattern: parseOrdinalNumberPattern,
641
- valueCallback: function (value) {
642
- return parseInt(value, 10);
643
- }
644
- }),
645
- era: buildMatchFn({
646
- matchPatterns: matchEraPatterns,
647
- defaultMatchWidth: 'wide',
648
- parsePatterns: parseEraPatterns,
649
- defaultParseWidth: 'any'
650
- }),
651
- quarter: buildMatchFn({
652
- matchPatterns: matchQuarterPatterns,
653
- defaultMatchWidth: 'wide',
654
- parsePatterns: parseQuarterPatterns,
655
- defaultParseWidth: 'any',
656
- valueCallback: function (index) {
657
- return index + 1;
91
+ for (let i = 0; i < keysA.length; i++) {
92
+ if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {
93
+ return false;
658
94
  }
659
- }),
660
- month: buildMatchFn({
661
- matchPatterns: matchMonthPatterns,
662
- defaultMatchWidth: 'wide',
663
- parsePatterns: parseMonthPatterns,
664
- defaultParseWidth: 'any'
665
- }),
666
- day: buildMatchFn({
667
- matchPatterns: matchDayPatterns,
668
- defaultMatchWidth: 'wide',
669
- parsePatterns: parseDayPatterns,
670
- defaultParseWidth: 'any'
671
- }),
672
- dayPeriod: buildMatchFn({
673
- matchPatterns: matchDayPeriodPatterns,
674
- defaultMatchWidth: 'any',
675
- parsePatterns: parseDayPeriodPatterns,
676
- defaultParseWidth: 'any'
677
- })
678
- };
679
- var match$1 = match;
680
-
681
- /**
682
- * @type {Locale}
683
- * @category Locales
684
- * @summary English locale (United States).
685
- * @language English
686
- * @iso-639-2 eng
687
- * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
688
- * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
689
- */
690
- var locale = {
691
- code: 'en-US',
692
- formatDistance: formatDistance$1,
693
- formatLong: formatLong$1,
694
- formatRelative: formatRelative$1,
695
- localize: localize$1,
696
- match: match$1,
697
- options: {
698
- weekStartsOn: 0
699
- /* Sunday */
700
- ,
701
- firstWeekContainsDate: 1
702
- }
703
- };
704
- var defaultLocale = locale;
705
-
706
- function assign(target, object) {
707
- if (target == null) {
708
- throw new TypeError('assign requires that input parameter not be null or undefined');
709
95
  }
710
-
711
- for (var property in object) {
712
- if (Object.prototype.hasOwnProperty.call(object, property)) {
713
- target[property] = object[property];
714
- }
715
- }
716
-
717
- return target;
718
- }
719
-
720
- function cloneObject(object) {
721
- return assign({}, object);
96
+ return true;
722
97
  }
723
98
 
724
- var MILLISECONDS_IN_MINUTE = 1000 * 60;
725
- var MINUTES_IN_DAY = 60 * 24;
726
- var MINUTES_IN_MONTH = MINUTES_IN_DAY * 30;
727
- var MINUTES_IN_YEAR = MINUTES_IN_DAY * 365;
728
99
  /**
729
- * @name formatDistanceStrict
730
- * @category Common Helpers
731
- * @summary Return the distance between the given dates in words.
100
+ * router
732
101
  *
733
- * @description
734
- * Return the distance between the given dates in words, using strict units.
735
- * This is like `formatDistance`, but does not use helpers like 'almost', 'over',
736
- * 'less than' and the like.
102
+ * Copyright (c) TanStack
737
103
  *
738
- * | Distance between dates | Result |
739
- * |------------------------|---------------------|
740
- * | 0 ... 59 secs | [0..59] seconds |
741
- * | 1 ... 59 mins | [1..59] minutes |
742
- * | 1 ... 23 hrs | [1..23] hours |
743
- * | 1 ... 29 days | [1..29] days |
744
- * | 1 ... 11 months | [1..11] months |
745
- * | 1 ... N years | [1..N] years |
104
+ * This source code is licensed under the MIT license found in the
105
+ * LICENSE.md file in the root directory of this source tree.
746
106
  *
747
- * @param {Date|Number} date - the date
748
- * @param {Date|Number} baseDate - the date to compare with
749
- * @param {Object} [options] - an object with options.
750
- * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first
751
- * @param {'second'|'minute'|'hour'|'day'|'month'|'year'} [options.unit] - if specified, will force a unit
752
- * @param {'floor'|'ceil'|'round'} [options.roundingMethod='round'] - which way to round partial units
753
- * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
754
- * @returns {String} the distance in words
755
- * @throws {TypeError} 2 arguments required
756
- * @throws {RangeError} `date` must not be Invalid Date
757
- * @throws {RangeError} `baseDate` must not be Invalid Date
758
- * @throws {RangeError} `options.roundingMethod` must be 'floor', 'ceil' or 'round'
759
- * @throws {RangeError} `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year'
760
- * @throws {RangeError} `options.locale` must contain `formatDistance` property
761
- *
762
- * @example
763
- * // What is the distance between 2 July 2014 and 1 January 2015?
764
- * const result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2))
765
- * //=> '6 months'
766
- *
767
- * @example
768
- * // What is the distance between 1 January 2015 00:00:15
769
- * // and 1 January 2015 00:00:00?
770
- * const result = formatDistanceStrict(
771
- * new Date(2015, 0, 1, 0, 0, 15),
772
- * new Date(2015, 0, 1, 0, 0, 0)
773
- * )
774
- * //=> '15 seconds'
775
- *
776
- * @example
777
- * // What is the distance from 1 January 2016
778
- * // to 1 January 2015, with a suffix?
779
- * const result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), {
780
- * addSuffix: true
781
- * })
782
- * //=> '1 year ago'
783
- *
784
- * @example
785
- * // What is the distance from 1 January 2016
786
- * // to 1 January 2015, in minutes?
787
- * const result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), {
788
- * unit: 'minute'
789
- * })
790
- * //=> '525600 minutes'
791
- *
792
- * @example
793
- * // What is the distance from 1 January 2015
794
- * // to 28 January 2015, in months, rounded up?
795
- * const result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), {
796
- * unit: 'month',
797
- * roundingMethod: 'ceil'
798
- * })
799
- * //=> '1 month'
800
- *
801
- * @example
802
- * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?
803
- * import { eoLocale } from 'date-fns/locale/eo'
804
- * const result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), {
805
- * locale: eoLocale
806
- * })
807
- * //=> '1 jaro'
107
+ * @license MIT
808
108
  */
809
109
 
810
- function formatDistanceStrict(dirtyDate, dirtyBaseDate, options) {
811
- var _ref, _options$locale, _options$roundingMeth;
812
-
813
- requiredArgs(2, arguments);
814
- var defaultOptions = getDefaultOptions();
815
- var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : defaultLocale;
816
-
817
- if (!locale.formatDistance) {
818
- throw new RangeError('locale must contain localize.formatDistance property');
819
- }
820
-
821
- var comparison = compareAsc(dirtyDate, dirtyBaseDate);
822
-
823
- if (isNaN(comparison)) {
824
- throw new RangeError('Invalid time value');
825
- }
826
-
827
- var localizeOptions = assign(cloneObject(options), {
828
- addSuffix: Boolean(options === null || options === void 0 ? void 0 : options.addSuffix),
829
- comparison: comparison
830
- });
831
- var dateLeft;
832
- var dateRight;
833
-
834
- if (comparison > 0) {
835
- dateLeft = toDate(dirtyBaseDate);
836
- dateRight = toDate(dirtyDate);
837
- } else {
838
- dateLeft = toDate(dirtyDate);
839
- dateRight = toDate(dirtyBaseDate);
840
- }
841
-
842
- var roundingMethod = String((_options$roundingMeth = options === null || options === void 0 ? void 0 : options.roundingMethod) !== null && _options$roundingMeth !== void 0 ? _options$roundingMeth : 'round');
843
- var roundingMethodFn;
844
-
845
- if (roundingMethod === 'floor') {
846
- roundingMethodFn = Math.floor;
847
- } else if (roundingMethod === 'ceil') {
848
- roundingMethodFn = Math.ceil;
849
- } else if (roundingMethod === 'round') {
850
- roundingMethodFn = Math.round;
851
- } else {
852
- throw new RangeError("roundingMethod must be 'floor', 'ceil' or 'round'");
853
- }
854
-
855
- var milliseconds = dateRight.getTime() - dateLeft.getTime();
856
- var minutes = milliseconds / MILLISECONDS_IN_MINUTE;
857
- var timezoneOffset = getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft); // Use DST-normalized difference in minutes for years, months and days;
858
- // use regular difference in minutes for hours, minutes and seconds.
859
-
860
- var dstNormalizedMinutes = (milliseconds - timezoneOffset) / MILLISECONDS_IN_MINUTE;
861
- var defaultUnit = options === null || options === void 0 ? void 0 : options.unit;
862
- var unit;
863
-
864
- if (!defaultUnit) {
865
- if (minutes < 1) {
866
- unit = 'second';
867
- } else if (minutes < 60) {
868
- unit = 'minute';
869
- } else if (minutes < MINUTES_IN_DAY) {
870
- unit = 'hour';
871
- } else if (dstNormalizedMinutes < MINUTES_IN_MONTH) {
872
- unit = 'day';
873
- } else if (dstNormalizedMinutes < MINUTES_IN_YEAR) {
874
- unit = 'month';
875
- } else {
876
- unit = 'year';
877
- }
878
- } else {
879
- unit = String(defaultUnit);
880
- } // 0 up to 60 seconds
881
-
882
-
883
- if (unit === 'second') {
884
- var seconds = roundingMethodFn(milliseconds / 1000);
885
- return locale.formatDistance('xSeconds', seconds, localizeOptions); // 1 up to 60 mins
886
- } else if (unit === 'minute') {
887
- var roundedMinutes = roundingMethodFn(minutes);
888
- return locale.formatDistance('xMinutes', roundedMinutes, localizeOptions); // 1 up to 24 hours
889
- } else if (unit === 'hour') {
890
- var hours = roundingMethodFn(minutes / 60);
891
- return locale.formatDistance('xHours', hours, localizeOptions); // 1 up to 30 days
892
- } else if (unit === 'day') {
893
- var days = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_DAY);
894
- return locale.formatDistance('xDays', days, localizeOptions); // 1 up to 12 months
895
- } else if (unit === 'month') {
896
- var months = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_MONTH);
897
- return months === 12 && defaultUnit !== 'month' ? locale.formatDistance('xYears', 1, localizeOptions) : locale.formatDistance('xMonths', months, localizeOptions); // 1 year up to max Date
898
- } else if (unit === 'year') {
899
- var years = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_YEAR);
900
- return locale.formatDistance('xYears', years, localizeOptions);
901
- }
902
-
903
- throw new RangeError("unit must be 'second', 'minute', 'hour', 'day', 'month' or 'year'");
110
+ function last(arr) {
111
+ return arr[arr.length - 1];
904
112
  }
113
+ const routerContext = /*#__PURE__*/React__namespace.createContext(null);
905
114
 
906
115
  const getItem = key => {
907
116
  try {
908
117
  const itemValue = localStorage.getItem(key);
909
-
910
118
  if (typeof itemValue === 'string') {
911
119
  return JSON.parse(itemValue);
912
120
  }
913
-
914
121
  return undefined;
915
- } catch (_unused) {
122
+ } catch {
916
123
  return undefined;
917
124
  }
918
125
  };
919
-
920
126
  function useLocalStorage(key, defaultValue) {
921
127
  const [value, setValue] = React__default["default"].useState();
922
128
  React__default["default"].useEffect(() => {
923
129
  const initialValue = getItem(key);
924
-
925
130
  if (typeof initialValue === 'undefined' || initialValue === null) {
926
131
  setValue(typeof defaultValue === 'function' ? defaultValue() : defaultValue);
927
132
  } else {
@@ -931,22 +136,18 @@
931
136
  const setter = React__default["default"].useCallback(updater => {
932
137
  setValue(old => {
933
138
  let newVal = updater;
934
-
935
139
  if (typeof updater == 'function') {
936
140
  newVal = updater(old);
937
141
  }
938
-
939
142
  try {
940
143
  localStorage.setItem(key, JSON.stringify(newVal));
941
- } catch (_unused2) {}
942
-
144
+ } catch {}
943
145
  return newVal;
944
146
  });
945
147
  }, [key]);
946
148
  return [value, setter];
947
149
  }
948
150
 
949
- const _excluded$3 = ["theme"];
950
151
  const defaultTheme = {
951
152
  background: '#0b1521',
952
153
  backgroundAlt: '#132337',
@@ -961,12 +162,10 @@
961
162
  warning: '#ffb200'
962
163
  };
963
164
  const ThemeContext = /*#__PURE__*/React__default["default"].createContext(defaultTheme);
964
- function ThemeProvider(_ref) {
965
- let {
966
- theme
967
- } = _ref,
968
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
969
-
165
+ function ThemeProvider({
166
+ theme,
167
+ ...rest
168
+ }) {
970
169
  return /*#__PURE__*/React__default["default"].createElement(ThemeContext.Provider, _extends({
971
170
  value: theme
972
171
  }, rest));
@@ -981,70 +180,62 @@
981
180
  if (typeof window !== 'undefined') {
982
181
  return window.matchMedia && window.matchMedia(query).matches;
983
182
  }
984
- }); // Watch for changes
183
+ return;
184
+ });
985
185
 
186
+ // Watch for changes
986
187
  React__default["default"].useEffect(() => {
987
188
  if (typeof window !== 'undefined') {
988
189
  if (!window.matchMedia) {
989
190
  return;
990
- } // Create a matcher
991
-
992
-
993
- const matcher = window.matchMedia(query); // Create our handler
191
+ }
994
192
 
995
- const onChange = _ref => {
996
- let {
997
- matches
998
- } = _ref;
999
- return setIsMatch(matches);
1000
- }; // Listen for changes
193
+ // Create a matcher
194
+ const matcher = window.matchMedia(query);
1001
195
 
196
+ // Create our handler
197
+ const onChange = ({
198
+ matches
199
+ }) => setIsMatch(matches);
1002
200
 
201
+ // Listen for changes
1003
202
  matcher.addListener(onChange);
1004
203
  return () => {
1005
204
  // Stop listening for changes
1006
205
  matcher.removeListener(onChange);
1007
206
  };
1008
207
  }
208
+ return;
1009
209
  }, [isMatch, query, setIsMatch]);
1010
210
  return isMatch;
1011
211
  }
1012
212
 
1013
- const _excluded$2 = ["style"];
1014
213
  const isServer$1 = typeof window === 'undefined';
1015
214
  function getStatusColor(match, theme) {
1016
- return match.isPending ? theme.warning : match.isFetching ? theme.active : match.status === 'error' ? theme.danger : match.status === 'success' ? theme.success : theme.gray;
1017
- } // export function getQueryStatusLabel(query: Query) {
1018
- // return query.state.isFetching
1019
- // ? 'fetching'
1020
- // : !query.getObserversCount()
1021
- // ? 'inactive'
1022
- // : query.isStale()
1023
- // ? 'stale'
1024
- // : 'fresh'
1025
- // }
1026
-
1027
- function styled(type, newStyles, queries) {
1028
- if (queries === void 0) {
1029
- queries = {};
1030
- }
1031
-
1032
- return /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
1033
- let {
1034
- style
1035
- } = _ref,
1036
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
1037
-
215
+ return match.state.status === 'pending' ? theme.active : match.state.status === 'error' ? theme.danger : match.state.status === 'success' ? theme.success : theme.gray;
216
+ }
217
+ function styled(type, newStyles, queries = {}) {
218
+ return /*#__PURE__*/React__default["default"].forwardRef(({
219
+ style,
220
+ ...rest
221
+ }, ref) => {
1038
222
  const theme = useTheme();
1039
- const mediaStyles = Object.entries(queries).reduce((current, _ref2) => {
1040
- let [key, value] = _ref2;
223
+ const mediaStyles = Object.entries(queries).reduce((current, [key, value]) => {
1041
224
  // eslint-disable-next-line react-hooks/rules-of-hooks
1042
- return useMediaQuery(key) ? _extends({}, current, typeof value === 'function' ? value(rest, theme) : value) : current;
225
+ return useMediaQuery(key) ? {
226
+ ...current,
227
+ ...(typeof value === 'function' ? value(rest, theme) : value)
228
+ } : current;
1043
229
  }, {});
1044
- return /*#__PURE__*/React__default["default"].createElement(type, _extends({}, rest, {
1045
- style: _extends({}, typeof newStyles === 'function' ? newStyles(rest, theme) : newStyles, style, mediaStyles),
230
+ return /*#__PURE__*/React__default["default"].createElement(type, {
231
+ ...rest,
232
+ style: {
233
+ ...(typeof newStyles === 'function' ? newStyles(rest, theme) : newStyles),
234
+ ...style,
235
+ ...mediaStyles
236
+ },
1046
237
  ref
1047
- }));
238
+ });
1048
239
  });
1049
240
  }
1050
241
  function useIsMounted() {
@@ -1058,22 +249,22 @@
1058
249
  }, []);
1059
250
  return isMounted;
1060
251
  }
252
+
1061
253
  /**
1062
254
  * Displays a string regardless the type of the data
1063
255
  * @param {unknown} value Value to be stringified
1064
256
  */
1065
-
1066
257
  const displayValue = value => {
1067
258
  const name = Object.getOwnPropertyNames(Object(value));
1068
- const newValue = typeof value === 'bigint' ? value.toString() + "n" : value;
259
+ const newValue = typeof value === 'bigint' ? `${value.toString()}n` : value;
1069
260
  return JSON.stringify(newValue, name);
1070
261
  };
262
+
1071
263
  /**
1072
264
  * This hook is a safe useState version which schedules state updates in microtasks
1073
265
  * to prevent updating a component state while React is rendering different components
1074
266
  * or when the component is not mounted anymore.
1075
267
  */
1076
-
1077
268
  function useSafeState(initialState) {
1078
269
  const isMounted = useIsMounted();
1079
270
  const [state, setState] = React__default["default"].useState(initialState);
@@ -1086,11 +277,11 @@
1086
277
  }, [isMounted]);
1087
278
  return [state, safeSetState];
1088
279
  }
280
+
1089
281
  /**
1090
282
  * Schedules a microtask.
1091
283
  * This can be useful to schedule state updates after rendering.
1092
284
  */
1093
-
1094
285
  function scheduleMicrotask(callback) {
1095
286
  Promise.resolve().then(callback).catch(error => setTimeout(() => {
1096
287
  throw error;
@@ -1099,7 +290,7 @@
1099
290
 
1100
291
  const Panel = styled('div', (_props, theme) => ({
1101
292
  fontSize: 'clamp(12px, 1.5vw, 14px)',
1102
- fontFamily: "sans-serif",
293
+ fontFamily: `sans-serif`,
1103
294
  display: 'flex',
1104
295
  backgroundColor: theme.background,
1105
296
  color: theme.foreground
@@ -1108,10 +299,11 @@
1108
299
  flexDirection: 'column'
1109
300
  },
1110
301
  '(max-width: 600px)': {
1111
- fontSize: '.9em' // flexDirection: 'column',
1112
-
302
+ fontSize: '.9em'
303
+ // flexDirection: 'column',
1113
304
  }
1114
305
  });
306
+
1115
307
  const ActivePanel = styled('div', () => ({
1116
308
  flex: '1 1 500px',
1117
309
  display: 'flex',
@@ -1120,7 +312,7 @@
1120
312
  height: '100%'
1121
313
  }), {
1122
314
  '(max-width: 700px)': (_props, theme) => ({
1123
- borderTop: "2px solid " + theme.gray
315
+ borderTop: `2px solid ${theme.gray}`
1124
316
  })
1125
317
  });
1126
318
  const Button = styled('button', (props, theme) => ({
@@ -1134,10 +326,13 @@
1134
326
  padding: '.5em',
1135
327
  opacity: props.disabled ? '.5' : undefined,
1136
328
  cursor: 'pointer'
1137
- })); // export const QueryKeys = styled('span', {
329
+ }));
330
+
331
+ // export const QueryKeys = styled('span', {
1138
332
  // display: 'inline-block',
1139
333
  // fontSize: '0.9em',
1140
334
  // })
335
+
1141
336
  // export const QueryKey = styled('span', {
1142
337
  // display: 'inline-flex',
1143
338
  // alignItems: 'center',
@@ -1150,40 +345,7 @@
1150
345
  const Code = styled('code', {
1151
346
  fontSize: '.9em'
1152
347
  });
1153
- styled('input', (_props, theme) => ({
1154
- backgroundColor: theme.inputBackgroundColor,
1155
- border: 0,
1156
- borderRadius: '.2em',
1157
- color: theme.inputTextColor,
1158
- fontSize: '.9em',
1159
- lineHeight: "1.3",
1160
- padding: '.3em .4em'
1161
- }));
1162
- styled('select', (_props, theme) => ({
1163
- display: "inline-block",
1164
- fontSize: ".9em",
1165
- fontFamily: "sans-serif",
1166
- fontWeight: 'normal',
1167
- lineHeight: "1.3",
1168
- padding: ".3em 1.5em .3em .5em",
1169
- height: 'auto',
1170
- border: 0,
1171
- borderRadius: ".2em",
1172
- appearance: "none",
1173
- WebkitAppearance: 'none',
1174
- backgroundColor: theme.inputBackgroundColor,
1175
- backgroundImage: "url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23444444'><polygon points='0,25 100,25 50,75'/></svg>\")",
1176
- backgroundRepeat: "no-repeat",
1177
- backgroundPosition: "right .55em center",
1178
- backgroundSize: ".65em auto, 100%",
1179
- color: theme.inputTextColor
1180
- }), {
1181
- '(max-width: 500px)': {
1182
- display: 'none'
1183
- }
1184
- });
1185
348
 
1186
- const _excluded$1 = ["value", "defaultExpanded", "renderer", "pageSize"];
1187
349
  const Entry = styled('div', {
1188
350
  fontFamily: 'Menlo, monospace',
1189
351
  fontSize: '.7rem',
@@ -1219,20 +381,17 @@
1219
381
  color: 'grey',
1220
382
  fontSize: '.7em'
1221
383
  });
1222
- const Expander = _ref => {
1223
- let {
1224
- expanded,
1225
- style = {}
1226
- } = _ref;
1227
- return /*#__PURE__*/React__namespace.createElement("span", {
1228
- style: _extends({
1229
- display: 'inline-block',
1230
- transition: 'all .1s ease',
1231
- transform: "rotate(" + (expanded ? 90 : 0) + "deg) " + (style.transform || '')
1232
- }, style)
1233
- }, "\u25B6");
1234
- };
1235
-
384
+ const Expander = ({
385
+ expanded,
386
+ style = {}
387
+ }) => /*#__PURE__*/React__namespace.createElement("span", {
388
+ style: {
389
+ display: 'inline-block',
390
+ transition: 'all .1s ease',
391
+ transform: `rotate(${expanded ? 90 : 0}deg) ${style.transform || ''}`,
392
+ ...style
393
+ }
394
+ }, "\u25B6");
1236
395
  /**
1237
396
  * Chunk elements in the array by size
1238
397
  *
@@ -1246,53 +405,40 @@
1246
405
  if (size < 1) return [];
1247
406
  let i = 0;
1248
407
  const result = [];
1249
-
1250
408
  while (i < array.length) {
1251
409
  result.push(array.slice(i, i + size));
1252
410
  i = i + size;
1253
411
  }
1254
-
1255
412
  return result;
1256
413
  }
1257
- const DefaultRenderer = _ref2 => {
1258
- let {
1259
- HandleEntry,
1260
- label,
1261
- value,
1262
- subEntries = [],
1263
- subEntryPages = [],
1264
- type,
1265
- expanded = false,
1266
- toggleExpanded,
1267
- pageSize,
1268
- renderer
1269
- } = _ref2;
414
+ const DefaultRenderer = ({
415
+ handleEntry,
416
+ label,
417
+ value,
418
+ subEntries = [],
419
+ subEntryPages = [],
420
+ type,
421
+ expanded = false,
422
+ toggleExpanded,
423
+ pageSize,
424
+ renderer
425
+ }) => {
1270
426
  const [expandedPages, setExpandedPages] = React__namespace.useState([]);
1271
427
  const [valueSnapshot, setValueSnapshot] = React__namespace.useState(undefined);
1272
-
1273
428
  const refreshValueSnapshot = () => {
1274
429
  setValueSnapshot(value());
1275
430
  };
1276
-
1277
- return /*#__PURE__*/React__namespace.createElement(Entry, {
1278
- key: label
1279
- }, subEntryPages.length ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ExpandButton, {
431
+ return /*#__PURE__*/React__namespace.createElement(Entry, null, subEntryPages.length ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ExpandButton, {
1280
432
  onClick: () => toggleExpanded()
1281
433
  }, /*#__PURE__*/React__namespace.createElement(Expander, {
1282
434
  expanded: expanded
1283
- }), " ", label, ' ', /*#__PURE__*/React__namespace.createElement(Info, null, String(type).toLowerCase() === 'iterable' ? '(Iterable) ' : '', subEntries.length, " ", subEntries.length > 1 ? "items" : "item")), expanded ? subEntryPages.length === 1 ? /*#__PURE__*/React__namespace.createElement(SubEntries, null, subEntries.map(entry => /*#__PURE__*/React__namespace.createElement(HandleEntry, {
1284
- key: entry.label,
1285
- entry: entry
1286
- }))) : /*#__PURE__*/React__namespace.createElement(SubEntries, null, subEntryPages.map((entries, index) => /*#__PURE__*/React__namespace.createElement("div", {
435
+ }), " ", label, ' ', /*#__PURE__*/React__namespace.createElement(Info, null, String(type).toLowerCase() === 'iterable' ? '(Iterable) ' : '', subEntries.length, " ", subEntries.length > 1 ? `items` : `item`)), expanded ? subEntryPages.length === 1 ? /*#__PURE__*/React__namespace.createElement(SubEntries, null, subEntries.map((entry, index) => handleEntry(entry))) : /*#__PURE__*/React__namespace.createElement(SubEntries, null, subEntryPages.map((entries, index) => /*#__PURE__*/React__namespace.createElement("div", {
1287
436
  key: index
1288
437
  }, /*#__PURE__*/React__namespace.createElement(Entry, null, /*#__PURE__*/React__namespace.createElement(LabelButton, {
1289
438
  onClick: () => setExpandedPages(old => old.includes(index) ? old.filter(d => d !== index) : [...old, index])
1290
439
  }, /*#__PURE__*/React__namespace.createElement(Expander, {
1291
440
  expanded: expanded
1292
- }), " [", index * pageSize, " ...", ' ', index * pageSize + pageSize - 1, "]"), expandedPages.includes(index) ? /*#__PURE__*/React__namespace.createElement(SubEntries, null, entries.map(entry => /*#__PURE__*/React__namespace.createElement(HandleEntry, {
1293
- key: entry.label,
1294
- entry: entry
1295
- }))) : null)))) : null) : type === 'function' ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Explorer, {
441
+ }), " [", index * pageSize, " ...", ' ', index * pageSize + pageSize - 1, "]"), expandedPages.includes(index) ? /*#__PURE__*/React__namespace.createElement(SubEntries, null, entries.map(entry => handleEntry(entry))) : null)))) : null) : type === 'function' ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Explorer, {
1296
442
  renderer: renderer,
1297
443
  label: /*#__PURE__*/React__namespace.createElement("button", {
1298
444
  onClick: refreshValueSnapshot,
@@ -1306,34 +452,29 @@
1306
452
  defaultExpanded: {}
1307
453
  })) : /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Label, null, label, ":"), " ", /*#__PURE__*/React__namespace.createElement(Value, null, displayValue(value))));
1308
454
  };
1309
-
1310
455
  function isIterable(x) {
1311
456
  return Symbol.iterator in x;
1312
457
  }
1313
-
1314
- function Explorer(_ref3) {
1315
- let {
1316
- value,
1317
- defaultExpanded,
1318
- renderer = DefaultRenderer,
1319
- pageSize = 100
1320
- } = _ref3,
1321
- rest = _objectWithoutPropertiesLoose(_ref3, _excluded$1);
1322
-
458
+ function Explorer({
459
+ value,
460
+ defaultExpanded,
461
+ renderer = DefaultRenderer,
462
+ pageSize = 100,
463
+ ...rest
464
+ }) {
1323
465
  const [expanded, setExpanded] = React__namespace.useState(Boolean(defaultExpanded));
1324
466
  const toggleExpanded = React__namespace.useCallback(() => setExpanded(old => !old), []);
1325
467
  let type = typeof value;
1326
468
  let subEntries = [];
1327
-
1328
469
  const makeProperty = sub => {
1329
470
  const subDefaultExpanded = defaultExpanded === true ? {
1330
471
  [sub.label]: true
1331
- } : defaultExpanded == null ? void 0 : defaultExpanded[sub.label];
1332
- return _extends({}, sub, {
472
+ } : defaultExpanded?.[sub.label];
473
+ return {
474
+ ...sub,
1333
475
  defaultExpanded: subDefaultExpanded
1334
- });
476
+ };
1335
477
  };
1336
-
1337
478
  if (Array.isArray(value)) {
1338
479
  type = 'array';
1339
480
  subEntries = value.map((d, i) => makeProperty({
@@ -1348,87 +489,68 @@
1348
489
  }));
1349
490
  } else if (typeof value === 'object' && value !== null) {
1350
491
  type = 'object';
1351
- subEntries = Object.entries(value).map(_ref4 => {
1352
- let [key, val] = _ref4;
1353
- return makeProperty({
1354
- label: key,
1355
- value: val
1356
- });
1357
- });
492
+ subEntries = Object.entries(value).map(([key, val]) => makeProperty({
493
+ label: key,
494
+ value: val
495
+ }));
1358
496
  }
1359
-
1360
497
  const subEntryPages = chunkArray(subEntries, pageSize);
1361
- return renderer(_extends({
1362
- HandleEntry: _ref5 => {
1363
- let {
1364
- entry
1365
- } = _ref5;
1366
- return /*#__PURE__*/React__namespace.createElement(Explorer, _extends({
1367
- value: value,
1368
- renderer: renderer
1369
- }, rest, entry));
1370
- },
498
+ return renderer({
499
+ handleEntry: entry => /*#__PURE__*/React__namespace.createElement(Explorer, _extends({
500
+ key: entry.label,
501
+ value: value,
502
+ renderer: renderer
503
+ }, rest, entry)),
1371
504
  type,
1372
505
  subEntries,
1373
506
  subEntryPages,
1374
507
  value,
1375
508
  expanded,
1376
509
  toggleExpanded,
1377
- pageSize
1378
- }, rest));
510
+ pageSize,
511
+ ...rest
512
+ });
1379
513
  }
1380
514
 
515
+ const isServer = typeof window === 'undefined';
1381
516
  function Logo(props) {
1382
- return /*#__PURE__*/React__namespace.createElement("svg", _extends({
1383
- width: "40px",
1384
- height: "40px",
1385
- viewBox: "0 0 190 190",
1386
- version: "1.1"
1387
- }, props), /*#__PURE__*/React__namespace.createElement("g", {
1388
- stroke: "none",
1389
- strokeWidth: "1",
1390
- fill: "none",
1391
- fillRule: "evenodd"
1392
- }, /*#__PURE__*/React__namespace.createElement("g", {
1393
- id: "og-white",
1394
- transform: "translate(-28.000000, -21.000000)"
1395
- }, /*#__PURE__*/React__namespace.createElement("g", {
1396
- id: "Group-2",
1397
- transform: "translate(28.000000, 31.000000)"
1398
- }, /*#__PURE__*/React__namespace.createElement("path", {
1399
- d: "M39.7239712,51.3436237 C36.631224,36.362877 35.9675112,24.8727722 37.9666331,16.5293551 C39.1555965,11.5671678 41.3293088,7.51908462 44.6346064,4.59846305 C48.1241394,1.51504777 52.5360327,0.00201216606 57.493257,0.00201216606 C65.6712013,0.00201216606 74.2682602,3.72732143 83.4557246,10.8044264 C87.2031203,13.6910458 91.0924366,17.170411 95.1316515,21.2444746 C95.4531404,20.8310265 95.8165416,20.4410453 96.2214301,20.0806152 C107.64098,9.91497158 117.255245,3.59892716 125.478408,1.16365068 C130.367899,-0.284364005 134.958526,-0.422317978 139.138936,0.983031021 C143.551631,2.46646844 147.06766,5.53294888 149.548314,9.82810912 C153.642288,16.9166735 154.721918,26.2310983 153.195595,37.7320243 C152.573451,42.4199112 151.50985,47.5263831 150.007094,53.0593153 C150.574045,53.1277086 151.142416,53.2532808 151.705041,53.4395297 C166.193932,58.2358678 176.453582,63.3937462 182.665021,69.2882839 C186.360669,72.7953831 188.773972,76.6998434 189.646365,81.0218204 C190.567176,85.5836746 189.669313,90.1593316 187.191548,94.4512967 C183.105211,101.529614 175.591643,107.11221 164.887587,111.534031 C160.589552,113.309539 155.726579,114.917559 150.293259,116.363748 C150.541176,116.92292 150.733521,117.516759 150.862138,118.139758 C153.954886,133.120505 154.618598,144.61061 152.619477,152.954027 C151.430513,157.916214 149.256801,161.964297 145.951503,164.884919 C142.46197,167.968334 138.050077,169.48137 133.092853,169.48137 C124.914908,169.48137 116.31785,165.756061 107.130385,158.678956 C103.343104,155.761613 99.4108655,152.238839 95.3254337,148.108619 C94.9050753,148.765474 94.3889681,149.376011 93.7785699,149.919385 C82.3590198,160.085028 72.744755,166.401073 64.5215915,168.836349 C59.6321009,170.284364 55.0414736,170.422318 50.8610636,169.016969 C46.4483686,167.533532 42.9323404,164.467051 40.4516862,160.171891 C36.3577116,153.083327 35.2780823,143.768902 36.8044053,132.267976 C37.449038,127.410634 38.56762,122.103898 40.1575891,116.339009 C39.5361041,116.276104 38.9120754,116.144816 38.2949591,115.940529 C23.8060684,111.144191 13.5464184,105.986312 7.33497892,100.091775 C3.63933121,96.5846754 1.22602752,92.6802151 0.353635235,88.3582381 C-0.567176333,83.7963839 0.330686581,79.2207269 2.80845236,74.9287618 C6.89478863,67.8504443 14.4083565,62.2678481 25.1124133,57.8460273 C29.5385143,56.0176154 34.5637208,54.366822 40.1939394,52.8874674 C39.9933393,52.3969171 39.8349374,51.8811235 39.7239712,51.3436237 Z",
1400
- id: "Path",
1401
- fill: "#002C4B",
1402
- fillRule: "nonzero",
1403
- transform: "translate(95.000000, 85.000000) scale(-1, 1) translate(-95.000000, -85.000000) "
1404
- }), /*#__PURE__*/React__namespace.createElement("path", {
1405
- d: "M76.1109918,91 L89.6216773,114.999606 L80.3968824,115 C78.6058059,115 76.9515387,114.041975 76.0601262,112.488483 L69.9456773,101.831606 L76.1109918,91 Z M118.814677,103.999606 L113.944933,112.488483 C113.053521,114.041975 111.399254,115 109.608177,115 L97.1836773,114.999606 L91,104 L118.814677,103.999606 Z M102.995798,71 L111,84.540954 L103.052984,98 L87.0061086,98 L79,84.3838793 L86.9562003,71 L102.995798,71 Z M124.136677,74.2726062 L128.577138,82.0115174 C129.461464,83.5526583 129.461464,85.4473417 128.577138,86.9884826 L122.257677,97.9996062 L110,98 L124.136677,74.2726062 Z M80,72 L66.1336773,95.1896062 L61.4279211,86.9884826 C60.543596,85.4473417 60.543596,83.5526583 61.4279211,82.0115174 L67.1716773,71.9996062 L80,72 Z M109.608177,54 C111.399254,54 113.053521,54.958025 113.944933,56.5115174 L120.835677,68.5206062 L114.929178,79 L100.820677,53.9996062 L109.608177,54 Z M93.7696773,53.9996062 L100,65 L71.1886773,64.9996062 L76.0601262,56.5115174 C76.9515387,54.958025 78.6058059,54 80.3968824,54 L93.7696773,53.9996062 Z",
1406
- id: "Polygon-3",
1407
- fill: "#FFD94C"
1408
- }), /*#__PURE__*/React__namespace.createElement("path", {
1409
- d: "M54.8601729,98.3577578 C56.1715224,97.6082856 57.8360246,98.0746014 58.5779424,99.3993034 L58.5779424,99.3993034 L59.0525843,100.24352 C62.8563392,106.982993 66.8190116,113.380176 70.9406016,119.435068 C75.8078808,126.585427 81.28184,133.82411 87.3624792,141.151115 C88.3168778,142.30114 88.1849437,144.011176 87.065686,144.997937 L87.065686,144.997937 L86.4542085,145.534625 C66.3465389,163.103314 53.2778188,166.612552 47.2480482,156.062341 C41.3500652,145.742717 43.4844915,126.982888 53.6513274,99.7828526 C53.876818,99.1795821 54.3045861,98.675291 54.8601729,98.3577578 Z M140.534177,119.041504 C141.986131,118.785177 143.375496,119.742138 143.65963,121.194242 L143.65963,121.194242 L143.812815,121.986376 C148.782365,147.995459 145.283348,161 133.315764,161 C121.609745,161 106.708724,149.909007 88.6127018,127.727022 C88.2113495,127.235047 87.9945723,126.617371 88,125.981509 C88.013158,124.480686 89.2357854,123.274651 90.730918,123.287756 L90.730918,123.287756 L91.6846544,123.294531 C99.3056979,123.335994 106.714387,123.071591 113.910723,122.501323 C122.409039,121.82788 131.283523,120.674607 140.534177,119.041504 Z M147.408726,63.8119663 C147.932139,62.4026903 149.508386,61.6634537 150.954581,62.149012 L150.954581,62.149012 L151.742552,62.4154854 C177.583763,71.217922 187.402356,80.8916805 181.198332,91.4367609 C175.129904,101.751366 157.484347,109.260339 128.26166,113.963678 C127.613529,114.067994 126.948643,113.945969 126.382735,113.618843 C125.047025,112.846729 124.602046,111.158214 125.388848,109.847438 L125.388848,109.847438 L125.889328,109.0105 C129.877183,102.31633 133.481358,95.6542621 136.701854,89.0242957 C140.50501,81.1948179 144.073967,72.7907081 147.408726,63.8119663 Z M61.7383398,56.0363218 C62.3864708,55.9320063 63.0513565,56.0540315 63.6172646,56.3811573 C64.9529754,57.153271 65.3979538,58.8417862 64.6111517,60.1525615 L64.6111517,60.1525615 L64.1106718,60.9895001 C60.1228168,67.6836699 56.5186416,74.3457379 53.2981462,80.9757043 C49.49499,88.8051821 45.9260328,97.2092919 42.5912744,106.188034 C42.0678608,107.59731 40.4916142,108.336546 39.045419,107.850988 L39.045419,107.850988 L38.2574475,107.584515 C12.4162372,98.782078 2.59764398,89.1083195 8.80166786,78.5632391 C14.8700957,68.2486335 32.515653,60.7396611 61.7383398,56.0363218 Z M103.545792,24.4653746 C123.653461,6.89668641 136.722181,3.38744778 142.751952,13.9376587 C148.649935,24.2572826 146.515508,43.0171122 136.348673,70.2171474 C136.123182,70.8204179 135.695414,71.324709 135.139827,71.6422422 C133.828478,72.3917144 132.163975,71.9253986 131.422058,70.6006966 L131.422058,70.6006966 L130.947416,69.7564798 C127.143661,63.0170065 123.180988,56.6198239 119.059398,50.564932 C114.192119,43.4145727 108.71816,36.1758903 102.637521,28.8488847 C101.683122,27.6988602 101.815056,25.9888243 102.934314,25.0020629 L102.934314,25.0020629 Z M57.6842361,8 C69.3902551,8 84.2912758,19.0909926 102.387298,41.2729777 C102.788651,41.7649527 103.005428,42.3826288 103,43.0184911 C102.986842,44.5193144 101.764215,45.7253489 100.269082,45.7122445 L100.269082,45.7122445 L99.3153456,45.7054689 C91.6943021,45.6640063 84.2856126,45.9284091 77.0892772,46.4986773 C68.5909612,47.17212 59.7164767,48.325393 50.4658235,49.9584962 C49.0138691,50.2148231 47.6245044,49.2578618 47.3403697,47.805758 L47.3403697,47.805758 L47.1871846,47.0136235 C42.2176347,21.0045412 45.7166519,8 57.6842361,8 Z",
1410
- id: "Combined-Shape",
1411
- fill: "#FF4154"
1412
- })))));
517
+ return /*#__PURE__*/React__default["default"].createElement("div", _extends({}, props, {
518
+ style: {
519
+ ...(props.style ?? {}),
520
+ display: 'flex',
521
+ alignItems: 'center',
522
+ flexDirection: 'column',
523
+ fontSize: '0.8rem',
524
+ fontWeight: 'bolder',
525
+ lineHeight: '1'
526
+ }
527
+ }), /*#__PURE__*/React__default["default"].createElement("div", {
528
+ style: {
529
+ letterSpacing: '-0.05rem'
530
+ }
531
+ }, "TANSTACK"), /*#__PURE__*/React__default["default"].createElement("div", {
532
+ style: {
533
+ backgroundImage: 'linear-gradient(to right, var(--tw-gradient-stops))',
534
+ // @ts-ignore
535
+ '--tw-gradient-from': '#84cc16',
536
+ '--tw-gradient-stops': 'var(--tw-gradient-from), var(--tw-gradient-to)',
537
+ '--tw-gradient-to': '#10b981',
538
+ WebkitBackgroundClip: 'text',
539
+ color: 'transparent',
540
+ letterSpacing: '0.1rem',
541
+ marginRight: '-0.2rem'
542
+ }
543
+ }, "ROUTER"));
1413
544
  }
1414
-
1415
- const _excluded = ["style"],
1416
- _excluded2 = ["style", "onClick"],
1417
- _excluded3 = ["style", "onClick"],
1418
- _excluded4 = ["isOpen", "setIsOpen", "handleDragStart", "useRouter"],
1419
- _excluded5 = ["listeners", "buildLocation", "mount", "update", "buildNext", "navigate", "cancelMatches", "loadLocation", "cleanPreloadCache", "loadRoute", "matchRoutes", "loadMatches", "invalidateRoute", "resolvePath", "matchRoute", "buildLink", "__experimental__createSnapshot", "destroy"],
1420
- _excluded6 = ["cancel", "load", "router", "Link", "MatchRoute", "buildLink", "linkProps", "matchRoute", "navigate"];
1421
- const isServer = typeof window === 'undefined';
1422
- function TanStackRouterDevtools(_ref) {
1423
- let {
1424
- initialIsOpen,
1425
- panelProps = {},
1426
- closeButtonProps = {},
1427
- toggleButtonProps = {},
1428
- position = 'bottom-left',
1429
- containerElement: Container = 'footer',
1430
- useRouter: useRouterImpl = reactRouter.useRouter
1431
- } = _ref;
545
+ function TanStackRouterDevtools({
546
+ initialIsOpen,
547
+ panelProps = {},
548
+ closeButtonProps = {},
549
+ toggleButtonProps = {},
550
+ position = 'bottom-left',
551
+ containerElement: Container = 'footer',
552
+ router
553
+ }) {
1432
554
  const rootRef = React__default["default"].useRef(null);
1433
555
  const panelRef = React__default["default"].useRef(null);
1434
556
  const [isOpen, setIsOpen] = useLocalStorage('tanstackRouterDevtoolsOpen', initialIsOpen);
@@ -1436,61 +558,51 @@
1436
558
  const [isResolvedOpen, setIsResolvedOpen] = useSafeState(false);
1437
559
  const [isResizing, setIsResizing] = useSafeState(false);
1438
560
  const isMounted = useIsMounted();
1439
-
1440
- const _handleDragStart = (panelElement, startEvent) => {
1441
- var _panelElement$getBoun;
1442
-
561
+ const handleDragStart = (panelElement, startEvent) => {
1443
562
  if (startEvent.button !== 0) return; // Only allow left click for drag
1444
563
 
1445
564
  setIsResizing(true);
1446
565
  const dragInfo = {
1447
- originalHeight: (_panelElement$getBoun = panelElement == null ? void 0 : panelElement.getBoundingClientRect().height) != null ? _panelElement$getBoun : 0,
566
+ originalHeight: panelElement?.getBoundingClientRect().height ?? 0,
1448
567
  pageY: startEvent.pageY
1449
568
  };
1450
-
1451
569
  const run = moveEvent => {
1452
570
  const delta = dragInfo.pageY - moveEvent.pageY;
1453
- const newHeight = (dragInfo == null ? void 0 : dragInfo.originalHeight) + delta;
571
+ const newHeight = dragInfo?.originalHeight + delta;
1454
572
  setDevtoolsHeight(newHeight);
1455
-
1456
573
  if (newHeight < 70) {
1457
574
  setIsOpen(false);
1458
575
  } else {
1459
576
  setIsOpen(true);
1460
577
  }
1461
578
  };
1462
-
1463
579
  const unsub = () => {
1464
580
  setIsResizing(false);
1465
581
  document.removeEventListener('mousemove', run);
1466
582
  document.removeEventListener('mouseUp', unsub);
1467
583
  };
1468
-
1469
584
  document.addEventListener('mousemove', run);
1470
585
  document.addEventListener('mouseup', unsub);
1471
586
  };
1472
-
1473
587
  React__default["default"].useEffect(() => {
1474
- setIsResolvedOpen(isOpen != null ? isOpen : false);
1475
- }, [isOpen, isResolvedOpen, setIsResolvedOpen]); // Toggle panel visibility before/after transition (depending on direction).
1476
- // Prevents focusing in a closed panel.
588
+ setIsResolvedOpen(isOpen ?? false);
589
+ }, [isOpen, isResolvedOpen, setIsResolvedOpen]);
1477
590
 
591
+ // Toggle panel visibility before/after transition (depending on direction).
592
+ // Prevents focusing in a closed panel.
1478
593
  React__default["default"].useEffect(() => {
1479
594
  const ref = panelRef.current;
1480
-
1481
595
  if (ref) {
1482
596
  const handlePanelTransitionStart = () => {
1483
597
  if (ref && isResolvedOpen) {
1484
598
  ref.style.visibility = 'visible';
1485
599
  }
1486
600
  };
1487
-
1488
601
  const handlePanelTransitionEnd = () => {
1489
602
  if (ref && !isResolvedOpen) {
1490
603
  ref.style.visibility = 'hidden';
1491
604
  }
1492
605
  };
1493
-
1494
606
  ref.addEventListener('transitionstart', handlePanelTransitionStart);
1495
607
  ref.addEventListener('transitionend', handlePanelTransitionEnd);
1496
608
  return () => {
@@ -1498,62 +610,46 @@
1498
610
  ref.removeEventListener('transitionend', handlePanelTransitionEnd);
1499
611
  };
1500
612
  }
1501
-
1502
613
  return;
1503
614
  }, [isResolvedOpen]);
1504
615
  React__default["default"][isServer ? 'useEffect' : 'useLayoutEffect'](() => {
1505
616
  if (isResolvedOpen) {
1506
- var _rootRef$current, _rootRef$current$pare;
1507
-
1508
- const previousValue = (_rootRef$current = rootRef.current) == null ? void 0 : (_rootRef$current$pare = _rootRef$current.parentElement) == null ? void 0 : _rootRef$current$pare.style.paddingBottom;
1509
-
617
+ const previousValue = rootRef.current?.parentElement?.style.paddingBottom;
1510
618
  const run = () => {
1511
- var _panelRef$current, _rootRef$current2;
1512
-
1513
- const containerHeight = (_panelRef$current = panelRef.current) == null ? void 0 : _panelRef$current.getBoundingClientRect().height;
1514
-
1515
- if ((_rootRef$current2 = rootRef.current) != null && _rootRef$current2.parentElement) {
1516
- rootRef.current.parentElement.style.paddingBottom = containerHeight + "px";
619
+ const containerHeight = panelRef.current?.getBoundingClientRect().height;
620
+ if (rootRef.current?.parentElement) {
621
+ rootRef.current.parentElement.style.paddingBottom = `${containerHeight}px`;
1517
622
  }
1518
623
  };
1519
-
1520
624
  run();
1521
-
1522
625
  if (typeof window !== 'undefined') {
1523
626
  window.addEventListener('resize', run);
1524
627
  return () => {
1525
- var _rootRef$current3;
1526
-
1527
628
  window.removeEventListener('resize', run);
1528
-
1529
- if ((_rootRef$current3 = rootRef.current) != null && _rootRef$current3.parentElement && typeof previousValue === 'string') {
629
+ if (rootRef.current?.parentElement && typeof previousValue === 'string') {
1530
630
  rootRef.current.parentElement.style.paddingBottom = previousValue;
1531
631
  }
1532
632
  };
1533
633
  }
1534
634
  }
1535
-
1536
635
  return;
1537
636
  }, [isResolvedOpen]);
1538
-
1539
637
  const {
1540
- style: panelStyle = {}
1541
- } = panelProps,
1542
- otherPanelProps = _objectWithoutPropertiesLoose(panelProps, _excluded);
1543
-
638
+ style: panelStyle = {},
639
+ ...otherPanelProps
640
+ } = panelProps;
1544
641
  const {
1545
642
  style: closeButtonStyle = {},
1546
- onClick: onCloseClick
1547
- } = closeButtonProps,
1548
- otherCloseButtonProps = _objectWithoutPropertiesLoose(closeButtonProps, _excluded2);
1549
-
643
+ onClick: onCloseClick,
644
+ ...otherCloseButtonProps
645
+ } = closeButtonProps;
1550
646
  const {
1551
647
  style: toggleButtonStyle = {},
1552
- onClick: onToggleClick
1553
- } = toggleButtonProps,
1554
- otherToggleButtonProps = _objectWithoutPropertiesLoose(toggleButtonProps, _excluded3); // Do not render on the server
1555
-
648
+ onClick: onToggleClick,
649
+ ...otherToggleButtonProps
650
+ } = toggleButtonProps;
1556
651
 
652
+ // Do not render on the server
1557
653
  if (!isMounted()) return null;
1558
654
  return /*#__PURE__*/React__default["default"].createElement(Container, {
1559
655
  ref: rootRef,
@@ -1563,36 +659,39 @@
1563
659
  }, /*#__PURE__*/React__default["default"].createElement(TanStackRouterDevtoolsPanel, _extends({
1564
660
  ref: panelRef
1565
661
  }, otherPanelProps, {
1566
- useRouter: useRouterImpl,
1567
- style: _extends({
662
+ router: router,
663
+ style: {
1568
664
  position: 'fixed',
1569
665
  bottom: '0',
1570
666
  right: '0',
1571
667
  zIndex: 99999,
1572
668
  width: '100%',
1573
- height: devtoolsHeight != null ? devtoolsHeight : 500,
669
+ height: devtoolsHeight ?? 500,
1574
670
  maxHeight: '90%',
1575
671
  boxShadow: '0 0 20px rgba(0,0,0,.3)',
1576
- borderTop: "1px solid " + defaultTheme.gray,
672
+ borderTop: `1px solid ${defaultTheme.gray}`,
1577
673
  transformOrigin: 'top',
1578
674
  // visibility will be toggled after transitions, but set initial state here
1579
- visibility: isOpen ? 'visible' : 'hidden'
1580
- }, panelStyle, isResizing ? {
1581
- transition: "none"
1582
- } : {
1583
- transition: "all .2s ease"
1584
- }, isResolvedOpen ? {
1585
- opacity: 1,
1586
- pointerEvents: 'all',
1587
- transform: "translateY(0) scale(1)"
1588
- } : {
1589
- opacity: 0,
1590
- pointerEvents: 'none',
1591
- transform: "translateY(15px) scale(1.02)"
1592
- }),
675
+ visibility: isOpen ? 'visible' : 'hidden',
676
+ ...panelStyle,
677
+ ...(isResizing ? {
678
+ transition: `none`
679
+ } : {
680
+ transition: `all .2s ease`
681
+ }),
682
+ ...(isResolvedOpen ? {
683
+ opacity: 1,
684
+ pointerEvents: 'all',
685
+ transform: `translateY(0) scale(1)`
686
+ } : {
687
+ opacity: 0,
688
+ pointerEvents: 'none',
689
+ transform: `translateY(15px) scale(1.02)`
690
+ })
691
+ },
1593
692
  isOpen: isResolvedOpen,
1594
693
  setIsOpen: setIsOpen,
1595
- handleDragStart: e => _handleDragStart(panelRef.current, e)
694
+ handleDragStart: e => handleDragStart(panelRef.current, e)
1596
695
  })), isResolvedOpen ? /*#__PURE__*/React__default["default"].createElement(Button, _extends({
1597
696
  type: "button",
1598
697
  "aria-label": "Close TanStack Router Devtools"
@@ -1601,20 +700,22 @@
1601
700
  setIsOpen(false);
1602
701
  onCloseClick && onCloseClick(e);
1603
702
  },
1604
- style: _extends({
703
+ style: {
1605
704
  position: 'fixed',
1606
705
  zIndex: 99999,
1607
706
  margin: '.5em',
1608
- bottom: 0
1609
- }, position === 'top-right' ? {
1610
- right: '0'
1611
- } : position === 'top-left' ? {
1612
- left: '0'
1613
- } : position === 'bottom-right' ? {
1614
- right: '0'
1615
- } : {
1616
- left: '0'
1617
- }, closeButtonStyle)
707
+ bottom: 0,
708
+ ...(position === 'top-right' ? {
709
+ right: '0'
710
+ } : position === 'top-left' ? {
711
+ left: '0'
712
+ } : position === 'bottom-right' ? {
713
+ right: '0'
714
+ } : {
715
+ left: '0'
716
+ }),
717
+ ...closeButtonStyle
718
+ }
1618
719
  }), "Close") : null), !isResolvedOpen ? /*#__PURE__*/React__default["default"].createElement("button", _extends({
1619
720
  type: "button"
1620
721
  }, otherToggleButtonProps, {
@@ -1623,7 +724,7 @@
1623
724
  setIsOpen(true);
1624
725
  onToggleClick && onToggleClick(e);
1625
726
  },
1626
- style: _extends({
727
+ style: {
1627
728
  appearance: 'none',
1628
729
  background: 'none',
1629
730
  border: 0,
@@ -1634,46 +735,45 @@
1634
735
  fontSize: '1.5em',
1635
736
  margin: '.5em',
1636
737
  cursor: 'pointer',
1637
- width: 'fit-content'
1638
- }, position === 'top-right' ? {
1639
- top: '0',
1640
- right: '0'
1641
- } : position === 'top-left' ? {
1642
- top: '0',
1643
- left: '0'
1644
- } : position === 'bottom-right' ? {
1645
- bottom: '0',
1646
- right: '0'
1647
- } : {
1648
- bottom: '0',
1649
- left: '0'
1650
- }, toggleButtonStyle)
738
+ width: 'fit-content',
739
+ ...(position === 'top-right' ? {
740
+ top: '0',
741
+ right: '0'
742
+ } : position === 'top-left' ? {
743
+ top: '0',
744
+ left: '0'
745
+ } : position === 'bottom-right' ? {
746
+ bottom: '0',
747
+ right: '0'
748
+ } : {
749
+ bottom: '0',
750
+ left: '0'
751
+ }),
752
+ ...toggleButtonStyle
753
+ }
1651
754
  }), /*#__PURE__*/React__default["default"].createElement(Logo, {
1652
755
  "aria-hidden": true
1653
756
  })) : null);
1654
757
  }
1655
758
  const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default["default"].forwardRef(function TanStackRouterDevtoolsPanel(props, ref) {
1656
- var _router$state$matches, _router$state$pending, _last, _last2, _last3, _last4, _last5, _last6;
1657
-
1658
759
  const {
1659
760
  isOpen = true,
761
+ setIsOpen,
1660
762
  handleDragStart,
1661
- useRouter
1662
- } = props,
1663
- panelProps = _objectWithoutPropertiesLoose(props, _excluded4);
1664
-
1665
- const router = useRouter();
1666
- React__default["default"].useEffect(() => {
1667
- let interval = setInterval(() => {
1668
- router.cleanPreloadCache();
1669
- router.notify();
1670
- }, 1000);
1671
- return () => {
1672
- clearInterval(interval);
1673
- };
1674
- }, []);
763
+ router: userRouter,
764
+ ...panelProps
765
+ } = props;
766
+ const routerContextValue = React__default["default"].useContext(routerContext);
767
+ const router = userRouter ?? routerContextValue?.router;
768
+ invariant(router, 'No router was found for the TanStack Router Devtools. Please place the devtools in the <RouterProvider> component tree or pass the router instance to the devtools manually.');
769
+ useStore(router.__store);
1675
770
  const [activeRouteId, setActiveRouteId] = useLocalStorage('tanstackRouterDevtoolsActiveRouteId', '');
1676
- const activeMatch = (_router$state$matches = router.state.matches) == null ? void 0 : _router$state$matches.find(d => d.routeId === activeRouteId);
771
+ const [activeMatchId, setActiveMatchId] = useLocalStorage('tanstackRouterDevtoolsActiveMatchId', '');
772
+ React__default["default"].useEffect(() => {
773
+ setActiveMatchId('');
774
+ }, [activeRouteId]);
775
+ const allMatches = React__default["default"].useMemo(() => [...Object.values(router.state.currentMatches), ...Object.values(router.state.pendingMatches ?? [])], [router.state.currentMatches, router.state.pendingMatches]);
776
+ const activeMatch = allMatches?.find(d => d.id === activeMatchId) || allMatches?.find(d => d.route.id === activeRouteId);
1677
777
  return /*#__PURE__*/React__default["default"].createElement(ThemeProvider, {
1678
778
  theme: defaultTheme
1679
779
  }, /*#__PURE__*/React__default["default"].createElement(Panel, _extends({
@@ -1681,7 +781,49 @@
1681
781
  className: "TanStackRouterDevtoolsPanel"
1682
782
  }, panelProps), /*#__PURE__*/React__default["default"].createElement("style", {
1683
783
  dangerouslySetInnerHTML: {
1684
- __html: "\n\n .TanStackRouterDevtoolsPanel * {\n scrollbar-color: " + defaultTheme.backgroundAlt + " " + defaultTheme.gray + ";\n }\n\n .TanStackRouterDevtoolsPanel *::-webkit-scrollbar, .TanStackRouterDevtoolsPanel scrollbar {\n width: 1em;\n height: 1em;\n }\n\n .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-track, .TanStackRouterDevtoolsPanel scrollbar-track {\n background: " + defaultTheme.backgroundAlt + ";\n }\n\n .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-thumb, .TanStackRouterDevtoolsPanel scrollbar-thumb {\n background: " + defaultTheme.gray + ";\n border-radius: .5em;\n border: 3px solid " + defaultTheme.backgroundAlt + ";\n }\n\n .TanStackRouterDevtoolsPanel table {\n width: 100%;\n }\n\n .TanStackRouterDevtoolsPanel table tr {\n border-bottom: 2px dotted rgba(255, 255, 255, .2);\n }\n\n .TanStackRouterDevtoolsPanel table tr:last-child {\n border-bottom: none\n }\n\n .TanStackRouterDevtoolsPanel table td {\n padding: .25rem .5rem;\n border-right: 2px dotted rgba(255, 255, 255, .05);\n }\n\n .TanStackRouterDevtoolsPanel table td:last-child {\n border-right: none\n }\n\n "
784
+ __html: `
785
+
786
+ .TanStackRouterDevtoolsPanel * {
787
+ scrollbar-color: ${defaultTheme.backgroundAlt} ${defaultTheme.gray};
788
+ }
789
+
790
+ .TanStackRouterDevtoolsPanel *::-webkit-scrollbar, .TanStackRouterDevtoolsPanel scrollbar {
791
+ width: 1em;
792
+ height: 1em;
793
+ }
794
+
795
+ .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-track, .TanStackRouterDevtoolsPanel scrollbar-track {
796
+ background: ${defaultTheme.backgroundAlt};
797
+ }
798
+
799
+ .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-thumb, .TanStackRouterDevtoolsPanel scrollbar-thumb {
800
+ background: ${defaultTheme.gray};
801
+ border-radius: .5em;
802
+ border: 3px solid ${defaultTheme.backgroundAlt};
803
+ }
804
+
805
+ .TanStackRouterDevtoolsPanel table {
806
+ width: 100%;
807
+ }
808
+
809
+ .TanStackRouterDevtoolsPanel table tr {
810
+ border-bottom: 2px dotted rgba(255, 255, 255, .2);
811
+ }
812
+
813
+ .TanStackRouterDevtoolsPanel table tr:last-child {
814
+ border-bottom: none
815
+ }
816
+
817
+ .TanStackRouterDevtoolsPanel table td {
818
+ padding: .25rem .5rem;
819
+ border-right: 2px dotted rgba(255, 255, 255, .05);
820
+ }
821
+
822
+ .TanStackRouterDevtoolsPanel table td:last-child {
823
+ border-right: none
824
+ }
825
+
826
+ `
1685
827
  }
1686
828
  }), /*#__PURE__*/React__default["default"].createElement("div", {
1687
829
  style: {
@@ -1701,30 +843,27 @@
1701
843
  minHeight: '40%',
1702
844
  maxHeight: '100%',
1703
845
  overflow: 'auto',
1704
- borderRight: "1px solid " + defaultTheme.grayAlt,
846
+ borderRight: `1px solid ${defaultTheme.grayAlt}`,
1705
847
  display: 'flex',
1706
848
  flexDirection: 'column'
1707
849
  }
1708
850
  }, /*#__PURE__*/React__default["default"].createElement("div", {
1709
851
  style: {
1710
- padding: '.5em',
1711
- background: defaultTheme.backgroundAlt,
1712
852
  display: 'flex',
1713
- justifyContent: 'space-between',
1714
- alignItems: 'center'
853
+ justifyContent: 'start',
854
+ gap: '1rem',
855
+ padding: '1rem',
856
+ alignItems: 'center',
857
+ background: defaultTheme.backgroundAlt
1715
858
  }
1716
859
  }, /*#__PURE__*/React__default["default"].createElement(Logo, {
1717
- "aria-hidden": true,
1718
- style: {
1719
- marginRight: '.5em'
1720
- }
860
+ "aria-hidden": true
1721
861
  }), /*#__PURE__*/React__default["default"].createElement("div", {
1722
862
  style: {
1723
- marginRight: 'auto',
1724
863
  fontSize: 'clamp(.8rem, 2vw, 1.3rem)',
1725
864
  fontWeight: 'bold'
1726
865
  }
1727
- }, "TanStack Router", ' ', /*#__PURE__*/React__default["default"].createElement("span", {
866
+ }, /*#__PURE__*/React__default["default"].createElement("span", {
1728
867
  style: {
1729
868
  fontWeight: 100
1730
869
  }
@@ -1739,11 +878,7 @@
1739
878
  }
1740
879
  }, /*#__PURE__*/React__default["default"].createElement(Explorer, {
1741
880
  label: "Router",
1742
- value: (() => {
1743
- const rest = _objectWithoutPropertiesLoose(router, _excluded5);
1744
-
1745
- return rest;
1746
- })(),
881
+ value: router,
1747
882
  defaultExpanded: {}
1748
883
  })))), /*#__PURE__*/React__default["default"].createElement("div", {
1749
884
  style: {
@@ -1751,7 +886,7 @@
1751
886
  minHeight: '40%',
1752
887
  maxHeight: '100%',
1753
888
  overflow: 'auto',
1754
- borderRight: "1px solid " + defaultTheme.grayAlt,
889
+ borderRight: `1px solid ${defaultTheme.grayAlt}`,
1755
890
  display: 'flex',
1756
891
  flexDirection: 'column'
1757
892
  }
@@ -1763,15 +898,15 @@
1763
898
  top: 0,
1764
899
  zIndex: 1
1765
900
  }
1766
- }, "Current Matches"), router.state.matches.map((match, i) => {
901
+ }, "Active Matches"), router.state.currentMatches.map((match, i) => {
1767
902
  return /*#__PURE__*/React__default["default"].createElement("div", {
1768
- key: match.routeId || i,
903
+ key: match.route.id || i,
1769
904
  role: "button",
1770
- "aria-label": "Open match details for " + match.routeId,
1771
- onClick: () => setActiveRouteId(activeRouteId === match.routeId ? '' : match.routeId),
905
+ "aria-label": `Open match details for ${match.route.id}`,
906
+ onClick: () => setActiveRouteId(activeRouteId === match.route.id ? '' : match.route.id),
1772
907
  style: {
1773
908
  display: 'flex',
1774
- borderBottom: "solid 1px " + defaultTheme.grayAlt,
909
+ borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
1775
910
  cursor: 'pointer',
1776
911
  alignItems: 'center',
1777
912
  background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
@@ -1793,8 +928,8 @@
1793
928
  style: {
1794
929
  padding: '.5em'
1795
930
  }
1796
- }, "" + match.matchId));
1797
- }), /*#__PURE__*/React__default["default"].createElement("div", {
931
+ }, `${match.id}`));
932
+ }), router.state.pendingMatches?.length ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
1798
933
  style: {
1799
934
  marginTop: '2rem',
1800
935
  padding: '.5em',
@@ -1803,15 +938,15 @@
1803
938
  top: 0,
1804
939
  zIndex: 1
1805
940
  }
1806
- }, "Pending Matches"), (_router$state$pending = router.state.pending) == null ? void 0 : _router$state$pending.matches.map((match, i) => {
941
+ }, "Pending Matches"), router.state.pendingMatches?.map((match, i) => {
1807
942
  return /*#__PURE__*/React__default["default"].createElement("div", {
1808
- key: match.routeId || i,
943
+ key: match.route.id || i,
1809
944
  role: "button",
1810
- "aria-label": "Open match details for " + match.routeId,
1811
- onClick: () => setActiveRouteId(activeRouteId === match.routeId ? '' : match.routeId),
945
+ "aria-label": `Open match details for ${match.route.id}`,
946
+ onClick: () => setActiveRouteId(activeRouteId === match.route.id ? '' : match.route.id),
1812
947
  style: {
1813
948
  display: 'flex',
1814
- borderBottom: "solid 1px " + defaultTheme.grayAlt,
949
+ borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
1815
950
  cursor: 'pointer',
1816
951
  background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
1817
952
  }
@@ -1832,77 +967,14 @@
1832
967
  style: {
1833
968
  padding: '.5em'
1834
969
  }
1835
- }, "" + match.matchId));
1836
- }), /*#__PURE__*/React__default["default"].createElement("div", {
1837
- style: {
1838
- marginTop: '2rem',
1839
- padding: '.5em',
1840
- background: defaultTheme.backgroundAlt,
1841
- position: 'sticky',
1842
- top: 0,
1843
- zIndex: 1
1844
- }
1845
- }, "Preloading Matches"), Object.keys(router.preloadCache).filter(key => {
1846
- var _cacheEntry$match$upd;
1847
-
1848
- const cacheEntry = router.preloadCache[key];
1849
- return ((_cacheEntry$match$upd = cacheEntry.match.updatedAt) != null ? _cacheEntry$match$upd : Date.now()) + cacheEntry.maxAge > Date.now();
1850
- }).map((key, i) => {
1851
- var _match$updatedAt;
1852
-
1853
- const {
1854
- match,
1855
- maxAge
1856
- } = router.preloadCache[key];
1857
- return /*#__PURE__*/React__default["default"].createElement("div", {
1858
- key: match.matchId || i,
1859
- role: "button",
1860
- "aria-label": "Open match details for " + match.matchId,
1861
- onClick: () => setActiveRouteId(activeRouteId === match.routeId ? '' : match.routeId),
1862
- style: {
1863
- display: 'flex',
1864
- borderBottom: "solid 1px " + defaultTheme.grayAlt,
1865
- cursor: 'pointer',
1866
- background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
1867
- }
1868
- }, /*#__PURE__*/React__default["default"].createElement("div", {
1869
- style: {
1870
- display: 'flex',
1871
- flexDirection: 'column',
1872
- padding: '.5rem',
1873
- gap: '.3rem'
1874
- }
1875
- }, /*#__PURE__*/React__default["default"].createElement("div", {
1876
- style: {
1877
- display: 'flex',
1878
- alignItems: 'center',
1879
- gap: '.5rem'
1880
- }
1881
- }, /*#__PURE__*/React__default["default"].createElement("div", {
1882
- style: {
1883
- flex: '0 0 auto',
1884
- width: '1.3rem',
1885
- height: '1.3rem',
1886
- background: getStatusColor(match, defaultTheme),
1887
- alignItems: 'center',
1888
- justifyContent: 'center',
1889
- fontWeight: 'bold',
1890
- borderRadius: '.25rem',
1891
- transition: 'all .2s ease-out'
1892
- }
1893
- }), /*#__PURE__*/React__default["default"].createElement(Code, null, "" + match.matchId)), /*#__PURE__*/React__default["default"].createElement("span", {
1894
- style: {
1895
- opacity: '.5'
1896
- }
1897
- }, "Expires", ' ', formatDistanceStrict(new Date(), new Date(((_match$updatedAt = match.updatedAt) != null ? _match$updatedAt : Date.now()) + maxAge), {
1898
- addSuffix: true
1899
- }))));
1900
- })), activeMatch ? /*#__PURE__*/React__default["default"].createElement(ActivePanel, null, /*#__PURE__*/React__default["default"].createElement("div", {
970
+ }, `${match.id}`));
971
+ })) : null), activeMatch ? /*#__PURE__*/React__default["default"].createElement(ActivePanel, null, /*#__PURE__*/React__default["default"].createElement("div", {
1901
972
  style: {
1902
973
  padding: '.5em',
1903
974
  background: defaultTheme.backgroundAlt,
1904
975
  position: 'sticky',
1905
976
  top: 0,
977
+ bottom: 0,
1906
978
  zIndex: 1
1907
979
  }
1908
980
  }, "Match Details"), /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("table", null, /*#__PURE__*/React__default["default"].createElement("tbody", null, /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
@@ -1913,28 +985,21 @@
1913
985
  style: {
1914
986
  lineHeight: '1.8em'
1915
987
  }
1916
- }, JSON.stringify(activeMatch.matchId, null, 2)))), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
1917
- style: {
1918
- opacity: '.5'
1919
- }
1920
- }, "Status"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.status)), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
1921
- style: {
1922
- opacity: '.5'
1923
- }
1924
- }, "Pending"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.isPending.toString())), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
988
+ }, JSON.stringify(activeMatch.id, null, 2)))), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
1925
989
  style: {
1926
990
  opacity: '.5'
1927
991
  }
1928
- }, "Invalid"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.isInvalid.toString())), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
992
+ }, "Status"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.state.status)), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
1929
993
  style: {
1930
994
  opacity: '.5'
1931
995
  }
1932
- }, "Last Updated"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.updatedAt ? new Date(activeMatch.updatedAt).toLocaleTimeString() : 'N/A'))))), /*#__PURE__*/React__default["default"].createElement("div", {
996
+ }, "Last Updated"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.state.updatedAt ? new Date(activeMatch.state.updatedAt).toLocaleTimeString() : 'N/A'))))), /*#__PURE__*/React__default["default"].createElement("div", {
1933
997
  style: {
1934
998
  background: defaultTheme.backgroundAlt,
1935
999
  padding: '.5em',
1936
1000
  position: 'sticky',
1937
1001
  top: 0,
1002
+ bottom: 0,
1938
1003
  zIndex: 1
1939
1004
  }
1940
1005
  }, "Actions"), /*#__PURE__*/React__default["default"].createElement("div", {
@@ -1943,17 +1008,7 @@
1943
1008
  }
1944
1009
  }, /*#__PURE__*/React__default["default"].createElement(Button, {
1945
1010
  type: "button",
1946
- onClick: () => {
1947
- router.invalidateRoute(activeMatch);
1948
- router.notify();
1949
- },
1950
- style: {
1951
- background: defaultTheme.warning,
1952
- color: defaultTheme.inputTextColor
1953
- }
1954
- }, "Invalidate"), ' ', /*#__PURE__*/React__default["default"].createElement(Button, {
1955
- type: "button",
1956
- onClick: () => router.reload(),
1011
+ onClick: () => activeMatch.load(),
1957
1012
  style: {
1958
1013
  background: defaultTheme.gray
1959
1014
  }
@@ -1963,6 +1018,7 @@
1963
1018
  padding: '.5em',
1964
1019
  position: 'sticky',
1965
1020
  top: 0,
1021
+ bottom: 0,
1966
1022
  zIndex: 1
1967
1023
  }
1968
1024
  }, "Explorer"), /*#__PURE__*/React__default["default"].createElement("div", {
@@ -1971,11 +1027,7 @@
1971
1027
  }
1972
1028
  }, /*#__PURE__*/React__default["default"].createElement(Explorer, {
1973
1029
  label: "Match",
1974
- value: (() => {
1975
- const rest = _objectWithoutPropertiesLoose(activeMatch, _excluded6);
1976
-
1977
- return rest;
1978
- })(),
1030
+ value: activeMatch,
1979
1031
  defaultExpanded: {}
1980
1032
  }))) : null, /*#__PURE__*/React__default["default"].createElement("div", {
1981
1033
  style: {
@@ -1983,7 +1035,7 @@
1983
1035
  minHeight: '40%',
1984
1036
  maxHeight: '100%',
1985
1037
  overflow: 'auto',
1986
- borderRight: "1px solid " + defaultTheme.grayAlt,
1038
+ borderRight: `1px solid ${defaultTheme.grayAlt}`,
1987
1039
  display: 'flex',
1988
1040
  flexDirection: 'column'
1989
1041
  }
@@ -1993,37 +1045,16 @@
1993
1045
  background: defaultTheme.backgroundAlt,
1994
1046
  position: 'sticky',
1995
1047
  top: 0,
1996
- zIndex: 1
1997
- }
1998
- }, "Loader Data"), /*#__PURE__*/React__default["default"].createElement("div", {
1999
- style: {
2000
- padding: '.5em'
2001
- }
2002
- }, Object.keys(((_last = reactRouter.last(router.state.matches)) == null ? void 0 : _last.loaderData) || {}).length ? /*#__PURE__*/React__default["default"].createElement(Explorer, {
2003
- value: ((_last2 = reactRouter.last(router.state.matches)) == null ? void 0 : _last2.loaderData) || {},
2004
- defaultExpanded: Object.keys(((_last3 = reactRouter.last(router.state.matches)) == null ? void 0 : _last3.loaderData) || {}).reduce((obj, next) => {
2005
- obj[next] = {};
2006
- return obj;
2007
- }, {})
2008
- }) : /*#__PURE__*/React__default["default"].createElement("em", {
2009
- style: {
2010
- opacity: 0.5
2011
- }
2012
- }, '{ }')), /*#__PURE__*/React__default["default"].createElement("div", {
2013
- style: {
2014
- padding: '.5em',
2015
- background: defaultTheme.backgroundAlt,
2016
- position: 'sticky',
2017
- top: 0,
1048
+ bottom: 0,
2018
1049
  zIndex: 1
2019
1050
  }
2020
1051
  }, "Search Params"), /*#__PURE__*/React__default["default"].createElement("div", {
2021
1052
  style: {
2022
1053
  padding: '.5em'
2023
1054
  }
2024
- }, Object.keys(((_last4 = reactRouter.last(router.state.matches)) == null ? void 0 : _last4.search) || {}).length ? /*#__PURE__*/React__default["default"].createElement(Explorer, {
2025
- value: ((_last5 = reactRouter.last(router.state.matches)) == null ? void 0 : _last5.search) || {},
2026
- defaultExpanded: Object.keys(((_last6 = reactRouter.last(router.state.matches)) == null ? void 0 : _last6.search) || {}).reduce((obj, next) => {
1055
+ }, Object.keys(last(router.state.currentMatches)?.state.search || {}).length ? /*#__PURE__*/React__default["default"].createElement(Explorer, {
1056
+ value: last(router.state.currentMatches)?.state.search || {},
1057
+ defaultExpanded: Object.keys(last(router.state.currentMatches)?.state.search || {}).reduce((obj, next) => {
2027
1058
  obj[next] = {};
2028
1059
  return obj;
2029
1060
  }, {})