@tanstack/router-devtools 0.0.1-alpha.1 → 0.0.1-beta.101

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 (53) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -1
  3. package/build/cjs/{packages/react-router-devtools/src/Explorer.js → Explorer.js} +52 -81
  4. package/build/cjs/Explorer.js.map +1 -0
  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 +637 -0
  8. package/build/cjs/devtools.js.map +1 -0
  9. package/build/cjs/{packages/react-router-devtools/src/index.js → index.js} +1 -1
  10. package/build/cjs/{packages/react-router-devtools/src/styledComponents.js → styledComponents.js} +10 -38
  11. package/build/cjs/styledComponents.js.map +1 -0
  12. package/build/cjs/{packages/react-router-devtools/src/theme.js → theme.js} +6 -9
  13. package/build/cjs/theme.js.map +1 -0
  14. package/build/cjs/{packages/react-router-devtools/src/useLocalStorage.js → useLocalStorage.js} +3 -10
  15. package/build/cjs/useLocalStorage.js.map +1 -0
  16. package/build/cjs/{packages/react-router-devtools/src/useMediaQuery.js → useMediaQuery.js} +13 -12
  17. package/build/cjs/useMediaQuery.js.map +1 -0
  18. package/build/cjs/{packages/react-router-devtools/src/utils.js → utils.js} +30 -35
  19. package/build/cjs/utils.js.map +1 -0
  20. package/build/esm/index.js +390 -1361
  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/Explorer.d.ts +47 -0
  25. package/build/types/devtools.d.ts +65 -0
  26. package/build/types/index.d.ts +1 -76
  27. package/build/types/styledComponents.d.ts +7 -0
  28. package/build/types/theme.d.ts +34 -0
  29. package/build/types/useLocalStorage.d.ts +1 -0
  30. package/build/types/useMediaQuery.d.ts +1 -0
  31. package/build/types/utils.d.ts +23 -0
  32. package/build/umd/index.development.js +429 -1340
  33. package/build/umd/index.development.js.map +1 -1
  34. package/build/umd/index.production.js +22 -2
  35. package/build/umd/index.production.js.map +1 -1
  36. package/package.json +11 -10
  37. package/src/Explorer.tsx +14 -12
  38. package/src/devtools.tsx +354 -345
  39. package/src/useLocalStorage.ts +5 -5
  40. package/src/useMediaQuery.ts +3 -0
  41. package/src/utils.ts +57 -16
  42. package/build/cjs/packages/react-router-devtools/src/Explorer.js.map +0 -1
  43. package/build/cjs/packages/react-router-devtools/src/Logo.js +0 -73
  44. package/build/cjs/packages/react-router-devtools/src/Logo.js.map +0 -1
  45. package/build/cjs/packages/react-router-devtools/src/devtools.js +0 -654
  46. package/build/cjs/packages/react-router-devtools/src/devtools.js.map +0 -1
  47. package/build/cjs/packages/react-router-devtools/src/styledComponents.js.map +0 -1
  48. package/build/cjs/packages/react-router-devtools/src/theme.js.map +0 -1
  49. package/build/cjs/packages/react-router-devtools/src/useLocalStorage.js.map +0 -1
  50. package/build/cjs/packages/react-router-devtools/src/useMediaQuery.js.map +0 -1
  51. package/build/cjs/packages/react-router-devtools/src/utils.js.map +0 -1
  52. package/src/Logo.tsx +0 -37
  53. /package/build/cjs/{packages/react-router-devtools/src/index.js.map → index.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router-devtools
2
+ * router-devtools
3
3
  *
4
4
  * Copyright (c) TanStack
5
5
  *
@@ -10,893 +10,38 @@
10
10
  */
11
11
  import * as React from 'react';
12
12
  import React__default from 'react';
13
- import { last, useRouter } from '@tanstack/react-router';
13
+ import { routerContext, invariant, useStore, last } from '@tanstack/router';
14
14
 
15
15
  function _extends() {
16
16
  _extends = Object.assign ? Object.assign.bind() : function (target) {
17
17
  for (var i = 1; i < arguments.length; i++) {
18
18
  var source = arguments[i];
19
-
20
19
  for (var key in source) {
21
20
  if (Object.prototype.hasOwnProperty.call(source, key)) {
22
21
  target[key] = source[key];
23
22
  }
24
23
  }
25
24
  }
26
-
27
25
  return target;
28
26
  };
29
27
  return _extends.apply(this, arguments);
30
28
  }
31
29
 
32
- function _objectWithoutPropertiesLoose(source, excluded) {
33
- if (source == null) return {};
34
- var target = {};
35
- var sourceKeys = Object.keys(source);
36
- var key, i;
37
-
38
- for (i = 0; i < sourceKeys.length; i++) {
39
- key = sourceKeys[i];
40
- if (excluded.indexOf(key) >= 0) continue;
41
- target[key] = source[key];
42
- }
43
-
44
- return target;
45
- }
46
-
47
- function requiredArgs(required, args) {
48
- if (args.length < required) {
49
- throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
50
- }
51
- }
52
-
53
- /**
54
- * @name toDate
55
- * @category Common Helpers
56
- * @summary Convert the given argument to an instance of Date.
57
- *
58
- * @description
59
- * Convert the given argument to an instance of Date.
60
- *
61
- * If the argument is an instance of Date, the function returns its clone.
62
- *
63
- * If the argument is a number, it is treated as a timestamp.
64
- *
65
- * If the argument is none of the above, the function returns Invalid Date.
66
- *
67
- * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
68
- *
69
- * @param {Date|Number} argument - the value to convert
70
- * @returns {Date} the parsed date in the local time zone
71
- * @throws {TypeError} 1 argument required
72
- *
73
- * @example
74
- * // Clone the date:
75
- * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
76
- * //=> Tue Feb 11 2014 11:30:30
77
- *
78
- * @example
79
- * // Convert the timestamp to date:
80
- * const result = toDate(1392098430000)
81
- * //=> Tue Feb 11 2014 11:30:30
82
- */
83
-
84
- function toDate(argument) {
85
- requiredArgs(1, arguments);
86
- var argStr = Object.prototype.toString.call(argument); // Clone the date
87
-
88
- if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {
89
- // Prevent the date to lose the milliseconds when passed to new Date() in IE10
90
- return new Date(argument.getTime());
91
- } else if (typeof argument === 'number' || argStr === '[object Number]') {
92
- return new Date(argument);
93
- } else {
94
- if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
95
- // eslint-disable-next-line no-console
96
- 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
97
-
98
- console.warn(new Error().stack);
99
- }
100
-
101
- return new Date(NaN);
102
- }
103
- }
104
-
105
- var defaultOptions = {};
106
- function getDefaultOptions() {
107
- return defaultOptions;
108
- }
109
-
110
- /**
111
- * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
112
- * They usually appear for dates that denote time before the timezones were introduced
113
- * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
114
- * and GMT+01:00:00 after that date)
115
- *
116
- * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
117
- * which would lead to incorrect calculations.
118
- *
119
- * This function returns the timezone offset in milliseconds that takes seconds in account.
120
- */
121
- function getTimezoneOffsetInMilliseconds(date) {
122
- var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
123
- utcDate.setUTCFullYear(date.getFullYear());
124
- return date.getTime() - utcDate.getTime();
125
- }
126
-
127
- /**
128
- * @name compareAsc
129
- * @category Common Helpers
130
- * @summary Compare the two dates and return -1, 0 or 1.
131
- *
132
- * @description
133
- * Compare the two dates and return 1 if the first date is after the second,
134
- * -1 if the first date is before the second or 0 if dates are equal.
135
- *
136
- * @param {Date|Number} dateLeft - the first date to compare
137
- * @param {Date|Number} dateRight - the second date to compare
138
- * @returns {Number} the result of the comparison
139
- * @throws {TypeError} 2 arguments required
140
- *
141
- * @example
142
- * // Compare 11 February 1987 and 10 July 1989:
143
- * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))
144
- * //=> -1
145
- *
146
- * @example
147
- * // Sort the array of dates:
148
- * const result = [
149
- * new Date(1995, 6, 2),
150
- * new Date(1987, 1, 11),
151
- * new Date(1989, 6, 10)
152
- * ].sort(compareAsc)
153
- * //=> [
154
- * // Wed Feb 11 1987 00:00:00,
155
- * // Mon Jul 10 1989 00:00:00,
156
- * // Sun Jul 02 1995 00:00:00
157
- * // ]
158
- */
159
-
160
- function compareAsc(dirtyDateLeft, dirtyDateRight) {
161
- requiredArgs(2, arguments);
162
- var dateLeft = toDate(dirtyDateLeft);
163
- var dateRight = toDate(dirtyDateRight);
164
- var diff = dateLeft.getTime() - dateRight.getTime();
165
-
166
- if (diff < 0) {
167
- return -1;
168
- } else if (diff > 0) {
169
- return 1; // Return 0 if diff is 0; return NaN if diff is NaN
170
- } else {
171
- return diff;
172
- }
173
- }
174
-
175
- var formatDistanceLocale = {
176
- lessThanXSeconds: {
177
- one: 'less than a second',
178
- other: 'less than {{count}} seconds'
179
- },
180
- xSeconds: {
181
- one: '1 second',
182
- other: '{{count}} seconds'
183
- },
184
- halfAMinute: 'half a minute',
185
- lessThanXMinutes: {
186
- one: 'less than a minute',
187
- other: 'less than {{count}} minutes'
188
- },
189
- xMinutes: {
190
- one: '1 minute',
191
- other: '{{count}} minutes'
192
- },
193
- aboutXHours: {
194
- one: 'about 1 hour',
195
- other: 'about {{count}} hours'
196
- },
197
- xHours: {
198
- one: '1 hour',
199
- other: '{{count}} hours'
200
- },
201
- xDays: {
202
- one: '1 day',
203
- other: '{{count}} days'
204
- },
205
- aboutXWeeks: {
206
- one: 'about 1 week',
207
- other: 'about {{count}} weeks'
208
- },
209
- xWeeks: {
210
- one: '1 week',
211
- other: '{{count}} weeks'
212
- },
213
- aboutXMonths: {
214
- one: 'about 1 month',
215
- other: 'about {{count}} months'
216
- },
217
- xMonths: {
218
- one: '1 month',
219
- other: '{{count}} months'
220
- },
221
- aboutXYears: {
222
- one: 'about 1 year',
223
- other: 'about {{count}} years'
224
- },
225
- xYears: {
226
- one: '1 year',
227
- other: '{{count}} years'
228
- },
229
- overXYears: {
230
- one: 'over 1 year',
231
- other: 'over {{count}} years'
232
- },
233
- almostXYears: {
234
- one: 'almost 1 year',
235
- other: 'almost {{count}} years'
236
- }
237
- };
238
-
239
- var formatDistance = function (token, count, options) {
240
- var result;
241
- var tokenValue = formatDistanceLocale[token];
242
-
243
- if (typeof tokenValue === 'string') {
244
- result = tokenValue;
245
- } else if (count === 1) {
246
- result = tokenValue.one;
247
- } else {
248
- result = tokenValue.other.replace('{{count}}', count.toString());
249
- }
250
-
251
- if (options !== null && options !== void 0 && options.addSuffix) {
252
- if (options.comparison && options.comparison > 0) {
253
- return 'in ' + result;
254
- } else {
255
- return result + ' ago';
256
- }
257
- }
258
-
259
- return result;
260
- };
261
-
262
- var formatDistance$1 = formatDistance;
263
-
264
- function buildFormatLongFn(args) {
265
- return function () {
266
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
267
- // TODO: Remove String()
268
- var width = options.width ? String(options.width) : args.defaultWidth;
269
- var format = args.formats[width] || args.formats[args.defaultWidth];
270
- return format;
271
- };
272
- }
273
-
274
- var dateFormats = {
275
- full: 'EEEE, MMMM do, y',
276
- long: 'MMMM do, y',
277
- medium: 'MMM d, y',
278
- short: 'MM/dd/yyyy'
279
- };
280
- var timeFormats = {
281
- full: 'h:mm:ss a zzzz',
282
- long: 'h:mm:ss a z',
283
- medium: 'h:mm:ss a',
284
- short: 'h:mm a'
285
- };
286
- var dateTimeFormats = {
287
- full: "{{date}} 'at' {{time}}",
288
- long: "{{date}} 'at' {{time}}",
289
- medium: '{{date}}, {{time}}',
290
- short: '{{date}}, {{time}}'
291
- };
292
- var formatLong = {
293
- date: buildFormatLongFn({
294
- formats: dateFormats,
295
- defaultWidth: 'full'
296
- }),
297
- time: buildFormatLongFn({
298
- formats: timeFormats,
299
- defaultWidth: 'full'
300
- }),
301
- dateTime: buildFormatLongFn({
302
- formats: dateTimeFormats,
303
- defaultWidth: 'full'
304
- })
305
- };
306
- var formatLong$1 = formatLong;
307
-
308
- var formatRelativeLocale = {
309
- lastWeek: "'last' eeee 'at' p",
310
- yesterday: "'yesterday at' p",
311
- today: "'today at' p",
312
- tomorrow: "'tomorrow at' p",
313
- nextWeek: "eeee 'at' p",
314
- other: 'P'
315
- };
316
-
317
- var formatRelative = function (token, _date, _baseDate, _options) {
318
- return formatRelativeLocale[token];
319
- };
320
-
321
- var formatRelative$1 = formatRelative;
322
-
323
- function buildLocalizeFn(args) {
324
- return function (dirtyIndex, options) {
325
- var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
326
- var valuesArray;
327
-
328
- if (context === 'formatting' && args.formattingValues) {
329
- var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
330
- var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
331
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
332
- } else {
333
- var _defaultWidth = args.defaultWidth;
334
-
335
- var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
336
-
337
- valuesArray = args.values[_width] || args.values[_defaultWidth];
338
- }
339
-
340
- 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!
341
-
342
- return valuesArray[index];
343
- };
344
- }
345
-
346
- var eraValues = {
347
- narrow: ['B', 'A'],
348
- abbreviated: ['BC', 'AD'],
349
- wide: ['Before Christ', 'Anno Domini']
350
- };
351
- var quarterValues = {
352
- narrow: ['1', '2', '3', '4'],
353
- abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
354
- wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
355
- }; // Note: in English, the names of days of the week and months are capitalized.
356
- // If you are making a new locale based on this one, check if the same is true for the language you're working on.
357
- // Generally, formatted dates should look like they are in the middle of a sentence,
358
- // e.g. in Spanish language the weekdays and months should be in the lowercase.
359
-
360
- var monthValues = {
361
- narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
362
- abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
363
- wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
364
- };
365
- var dayValues = {
366
- narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
367
- short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
368
- abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
369
- wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
370
- };
371
- var dayPeriodValues = {
372
- narrow: {
373
- am: 'a',
374
- pm: 'p',
375
- midnight: 'mi',
376
- noon: 'n',
377
- morning: 'morning',
378
- afternoon: 'afternoon',
379
- evening: 'evening',
380
- night: 'night'
381
- },
382
- abbreviated: {
383
- am: 'AM',
384
- pm: 'PM',
385
- midnight: 'midnight',
386
- noon: 'noon',
387
- morning: 'morning',
388
- afternoon: 'afternoon',
389
- evening: 'evening',
390
- night: 'night'
391
- },
392
- wide: {
393
- am: 'a.m.',
394
- pm: 'p.m.',
395
- midnight: 'midnight',
396
- noon: 'noon',
397
- morning: 'morning',
398
- afternoon: 'afternoon',
399
- evening: 'evening',
400
- night: 'night'
401
- }
402
- };
403
- var formattingDayPeriodValues = {
404
- narrow: {
405
- am: 'a',
406
- pm: 'p',
407
- midnight: 'mi',
408
- noon: 'n',
409
- morning: 'in the morning',
410
- afternoon: 'in the afternoon',
411
- evening: 'in the evening',
412
- night: 'at night'
413
- },
414
- abbreviated: {
415
- am: 'AM',
416
- pm: 'PM',
417
- midnight: 'midnight',
418
- noon: 'noon',
419
- morning: 'in the morning',
420
- afternoon: 'in the afternoon',
421
- evening: 'in the evening',
422
- night: 'at night'
423
- },
424
- wide: {
425
- am: 'a.m.',
426
- pm: 'p.m.',
427
- midnight: 'midnight',
428
- noon: 'noon',
429
- morning: 'in the morning',
430
- afternoon: 'in the afternoon',
431
- evening: 'in the evening',
432
- night: 'at night'
433
- }
434
- };
435
-
436
- var ordinalNumber = function (dirtyNumber, _options) {
437
- var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
438
- // if they are different for different grammatical genders,
439
- // use `options.unit`.
440
- //
441
- // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
442
- // 'day', 'hour', 'minute', 'second'.
443
-
444
- var rem100 = number % 100;
445
-
446
- if (rem100 > 20 || rem100 < 10) {
447
- switch (rem100 % 10) {
448
- case 1:
449
- return number + 'st';
450
-
451
- case 2:
452
- return number + 'nd';
453
-
454
- case 3:
455
- return number + 'rd';
456
- }
457
- }
458
-
459
- return number + 'th';
460
- };
461
-
462
- var localize = {
463
- ordinalNumber: ordinalNumber,
464
- era: buildLocalizeFn({
465
- values: eraValues,
466
- defaultWidth: 'wide'
467
- }),
468
- quarter: buildLocalizeFn({
469
- values: quarterValues,
470
- defaultWidth: 'wide',
471
- argumentCallback: function (quarter) {
472
- return quarter - 1;
473
- }
474
- }),
475
- month: buildLocalizeFn({
476
- values: monthValues,
477
- defaultWidth: 'wide'
478
- }),
479
- day: buildLocalizeFn({
480
- values: dayValues,
481
- defaultWidth: 'wide'
482
- }),
483
- dayPeriod: buildLocalizeFn({
484
- values: dayPeriodValues,
485
- defaultWidth: 'wide',
486
- formattingValues: formattingDayPeriodValues,
487
- defaultFormattingWidth: 'wide'
488
- })
489
- };
490
- var localize$1 = localize;
491
-
492
- function buildMatchFn(args) {
493
- return function (string) {
494
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
495
- var width = options.width;
496
- var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
497
- var matchResult = string.match(matchPattern);
498
-
499
- if (!matchResult) {
500
- return null;
501
- }
502
-
503
- var matchedString = matchResult[0];
504
- var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
505
- var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
506
- return pattern.test(matchedString);
507
- }) : findKey(parsePatterns, function (pattern) {
508
- return pattern.test(matchedString);
509
- });
510
- var value;
511
- value = args.valueCallback ? args.valueCallback(key) : key;
512
- value = options.valueCallback ? options.valueCallback(value) : value;
513
- var rest = string.slice(matchedString.length);
514
- return {
515
- value: value,
516
- rest: rest
517
- };
518
- };
519
- }
520
-
521
- function findKey(object, predicate) {
522
- for (var key in object) {
523
- if (object.hasOwnProperty(key) && predicate(object[key])) {
524
- return key;
525
- }
526
- }
527
-
528
- return undefined;
529
- }
530
-
531
- function findIndex(array, predicate) {
532
- for (var key = 0; key < array.length; key++) {
533
- if (predicate(array[key])) {
534
- return key;
535
- }
536
- }
537
-
538
- return undefined;
539
- }
540
-
541
- function buildMatchPatternFn(args) {
542
- return function (string) {
543
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
544
- var matchResult = string.match(args.matchPattern);
545
- if (!matchResult) return null;
546
- var matchedString = matchResult[0];
547
- var parseResult = string.match(args.parsePattern);
548
- if (!parseResult) return null;
549
- var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
550
- value = options.valueCallback ? options.valueCallback(value) : value;
551
- var rest = string.slice(matchedString.length);
552
- return {
553
- value: value,
554
- rest: rest
555
- };
556
- };
557
- }
558
-
559
- var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
560
- var parseOrdinalNumberPattern = /\d+/i;
561
- var matchEraPatterns = {
562
- narrow: /^(b|a)/i,
563
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
564
- wide: /^(before christ|before common era|anno domini|common era)/i
565
- };
566
- var parseEraPatterns = {
567
- any: [/^b/i, /^(a|c)/i]
568
- };
569
- var matchQuarterPatterns = {
570
- narrow: /^[1234]/i,
571
- abbreviated: /^q[1234]/i,
572
- wide: /^[1234](th|st|nd|rd)? quarter/i
573
- };
574
- var parseQuarterPatterns = {
575
- any: [/1/i, /2/i, /3/i, /4/i]
576
- };
577
- var matchMonthPatterns = {
578
- narrow: /^[jfmasond]/i,
579
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
580
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
581
- };
582
- var parseMonthPatterns = {
583
- 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],
584
- 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]
585
- };
586
- var matchDayPatterns = {
587
- narrow: /^[smtwf]/i,
588
- short: /^(su|mo|tu|we|th|fr|sa)/i,
589
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
590
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
591
- };
592
- var parseDayPatterns = {
593
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
594
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
595
- };
596
- var matchDayPeriodPatterns = {
597
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
598
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
599
- };
600
- var parseDayPeriodPatterns = {
601
- any: {
602
- am: /^a/i,
603
- pm: /^p/i,
604
- midnight: /^mi/i,
605
- noon: /^no/i,
606
- morning: /morning/i,
607
- afternoon: /afternoon/i,
608
- evening: /evening/i,
609
- night: /night/i
610
- }
611
- };
612
- var match = {
613
- ordinalNumber: buildMatchPatternFn({
614
- matchPattern: matchOrdinalNumberPattern,
615
- parsePattern: parseOrdinalNumberPattern,
616
- valueCallback: function (value) {
617
- return parseInt(value, 10);
618
- }
619
- }),
620
- era: buildMatchFn({
621
- matchPatterns: matchEraPatterns,
622
- defaultMatchWidth: 'wide',
623
- parsePatterns: parseEraPatterns,
624
- defaultParseWidth: 'any'
625
- }),
626
- quarter: buildMatchFn({
627
- matchPatterns: matchQuarterPatterns,
628
- defaultMatchWidth: 'wide',
629
- parsePatterns: parseQuarterPatterns,
630
- defaultParseWidth: 'any',
631
- valueCallback: function (index) {
632
- return index + 1;
633
- }
634
- }),
635
- month: buildMatchFn({
636
- matchPatterns: matchMonthPatterns,
637
- defaultMatchWidth: 'wide',
638
- parsePatterns: parseMonthPatterns,
639
- defaultParseWidth: 'any'
640
- }),
641
- day: buildMatchFn({
642
- matchPatterns: matchDayPatterns,
643
- defaultMatchWidth: 'wide',
644
- parsePatterns: parseDayPatterns,
645
- defaultParseWidth: 'any'
646
- }),
647
- dayPeriod: buildMatchFn({
648
- matchPatterns: matchDayPeriodPatterns,
649
- defaultMatchWidth: 'any',
650
- parsePatterns: parseDayPeriodPatterns,
651
- defaultParseWidth: 'any'
652
- })
653
- };
654
- var match$1 = match;
655
-
656
- /**
657
- * @type {Locale}
658
- * @category Locales
659
- * @summary English locale (United States).
660
- * @language English
661
- * @iso-639-2 eng
662
- * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
663
- * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
664
- */
665
- var locale = {
666
- code: 'en-US',
667
- formatDistance: formatDistance$1,
668
- formatLong: formatLong$1,
669
- formatRelative: formatRelative$1,
670
- localize: localize$1,
671
- match: match$1,
672
- options: {
673
- weekStartsOn: 0
674
- /* Sunday */
675
- ,
676
- firstWeekContainsDate: 1
677
- }
678
- };
679
- var defaultLocale = locale;
680
-
681
- function assign(target, object) {
682
- if (target == null) {
683
- throw new TypeError('assign requires that input parameter not be null or undefined');
684
- }
685
-
686
- for (var property in object) {
687
- if (Object.prototype.hasOwnProperty.call(object, property)) {
688
- target[property] = object[property];
689
- }
690
- }
691
-
692
- return target;
693
- }
694
-
695
- function cloneObject(object) {
696
- return assign({}, object);
697
- }
698
-
699
- var MILLISECONDS_IN_MINUTE = 1000 * 60;
700
- var MINUTES_IN_DAY = 60 * 24;
701
- var MINUTES_IN_MONTH = MINUTES_IN_DAY * 30;
702
- var MINUTES_IN_YEAR = MINUTES_IN_DAY * 365;
703
- /**
704
- * @name formatDistanceStrict
705
- * @category Common Helpers
706
- * @summary Return the distance between the given dates in words.
707
- *
708
- * @description
709
- * Return the distance between the given dates in words, using strict units.
710
- * This is like `formatDistance`, but does not use helpers like 'almost', 'over',
711
- * 'less than' and the like.
712
- *
713
- * | Distance between dates | Result |
714
- * |------------------------|---------------------|
715
- * | 0 ... 59 secs | [0..59] seconds |
716
- * | 1 ... 59 mins | [1..59] minutes |
717
- * | 1 ... 23 hrs | [1..23] hours |
718
- * | 1 ... 29 days | [1..29] days |
719
- * | 1 ... 11 months | [1..11] months |
720
- * | 1 ... N years | [1..N] years |
721
- *
722
- * @param {Date|Number} date - the date
723
- * @param {Date|Number} baseDate - the date to compare with
724
- * @param {Object} [options] - an object with options.
725
- * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first
726
- * @param {'second'|'minute'|'hour'|'day'|'month'|'year'} [options.unit] - if specified, will force a unit
727
- * @param {'floor'|'ceil'|'round'} [options.roundingMethod='round'] - which way to round partial units
728
- * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
729
- * @returns {String} the distance in words
730
- * @throws {TypeError} 2 arguments required
731
- * @throws {RangeError} `date` must not be Invalid Date
732
- * @throws {RangeError} `baseDate` must not be Invalid Date
733
- * @throws {RangeError} `options.roundingMethod` must be 'floor', 'ceil' or 'round'
734
- * @throws {RangeError} `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year'
735
- * @throws {RangeError} `options.locale` must contain `formatDistance` property
736
- *
737
- * @example
738
- * // What is the distance between 2 July 2014 and 1 January 2015?
739
- * const result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2))
740
- * //=> '6 months'
741
- *
742
- * @example
743
- * // What is the distance between 1 January 2015 00:00:15
744
- * // and 1 January 2015 00:00:00?
745
- * const result = formatDistanceStrict(
746
- * new Date(2015, 0, 1, 0, 0, 15),
747
- * new Date(2015, 0, 1, 0, 0, 0)
748
- * )
749
- * //=> '15 seconds'
750
- *
751
- * @example
752
- * // What is the distance from 1 January 2016
753
- * // to 1 January 2015, with a suffix?
754
- * const result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), {
755
- * addSuffix: true
756
- * })
757
- * //=> '1 year ago'
758
- *
759
- * @example
760
- * // What is the distance from 1 January 2016
761
- * // to 1 January 2015, in minutes?
762
- * const result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), {
763
- * unit: 'minute'
764
- * })
765
- * //=> '525600 minutes'
766
- *
767
- * @example
768
- * // What is the distance from 1 January 2015
769
- * // to 28 January 2015, in months, rounded up?
770
- * const result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), {
771
- * unit: 'month',
772
- * roundingMethod: 'ceil'
773
- * })
774
- * //=> '1 month'
775
- *
776
- * @example
777
- * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?
778
- * import { eoLocale } from 'date-fns/locale/eo'
779
- * const result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), {
780
- * locale: eoLocale
781
- * })
782
- * //=> '1 jaro'
783
- */
784
-
785
- function formatDistanceStrict(dirtyDate, dirtyBaseDate, options) {
786
- var _ref, _options$locale, _options$roundingMeth;
787
-
788
- requiredArgs(2, arguments);
789
- var defaultOptions = getDefaultOptions();
790
- 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;
791
-
792
- if (!locale.formatDistance) {
793
- throw new RangeError('locale must contain localize.formatDistance property');
794
- }
795
-
796
- var comparison = compareAsc(dirtyDate, dirtyBaseDate);
797
-
798
- if (isNaN(comparison)) {
799
- throw new RangeError('Invalid time value');
800
- }
801
-
802
- var localizeOptions = assign(cloneObject(options), {
803
- addSuffix: Boolean(options === null || options === void 0 ? void 0 : options.addSuffix),
804
- comparison: comparison
805
- });
806
- var dateLeft;
807
- var dateRight;
808
-
809
- if (comparison > 0) {
810
- dateLeft = toDate(dirtyBaseDate);
811
- dateRight = toDate(dirtyDate);
812
- } else {
813
- dateLeft = toDate(dirtyDate);
814
- dateRight = toDate(dirtyBaseDate);
815
- }
816
-
817
- var roundingMethod = String((_options$roundingMeth = options === null || options === void 0 ? void 0 : options.roundingMethod) !== null && _options$roundingMeth !== void 0 ? _options$roundingMeth : 'round');
818
- var roundingMethodFn;
819
-
820
- if (roundingMethod === 'floor') {
821
- roundingMethodFn = Math.floor;
822
- } else if (roundingMethod === 'ceil') {
823
- roundingMethodFn = Math.ceil;
824
- } else if (roundingMethod === 'round') {
825
- roundingMethodFn = Math.round;
826
- } else {
827
- throw new RangeError("roundingMethod must be 'floor', 'ceil' or 'round'");
828
- }
829
-
830
- var milliseconds = dateRight.getTime() - dateLeft.getTime();
831
- var minutes = milliseconds / MILLISECONDS_IN_MINUTE;
832
- var timezoneOffset = getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft); // Use DST-normalized difference in minutes for years, months and days;
833
- // use regular difference in minutes for hours, minutes and seconds.
834
-
835
- var dstNormalizedMinutes = (milliseconds - timezoneOffset) / MILLISECONDS_IN_MINUTE;
836
- var defaultUnit = options === null || options === void 0 ? void 0 : options.unit;
837
- var unit;
838
-
839
- if (!defaultUnit) {
840
- if (minutes < 1) {
841
- unit = 'second';
842
- } else if (minutes < 60) {
843
- unit = 'minute';
844
- } else if (minutes < MINUTES_IN_DAY) {
845
- unit = 'hour';
846
- } else if (dstNormalizedMinutes < MINUTES_IN_MONTH) {
847
- unit = 'day';
848
- } else if (dstNormalizedMinutes < MINUTES_IN_YEAR) {
849
- unit = 'month';
850
- } else {
851
- unit = 'year';
852
- }
853
- } else {
854
- unit = String(defaultUnit);
855
- } // 0 up to 60 seconds
856
-
857
-
858
- if (unit === 'second') {
859
- var seconds = roundingMethodFn(milliseconds / 1000);
860
- return locale.formatDistance('xSeconds', seconds, localizeOptions); // 1 up to 60 mins
861
- } else if (unit === 'minute') {
862
- var roundedMinutes = roundingMethodFn(minutes);
863
- return locale.formatDistance('xMinutes', roundedMinutes, localizeOptions); // 1 up to 24 hours
864
- } else if (unit === 'hour') {
865
- var hours = roundingMethodFn(minutes / 60);
866
- return locale.formatDistance('xHours', hours, localizeOptions); // 1 up to 30 days
867
- } else if (unit === 'day') {
868
- var days = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_DAY);
869
- return locale.formatDistance('xDays', days, localizeOptions); // 1 up to 12 months
870
- } else if (unit === 'month') {
871
- var months = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_MONTH);
872
- return months === 12 && defaultUnit !== 'month' ? locale.formatDistance('xYears', 1, localizeOptions) : locale.formatDistance('xMonths', months, localizeOptions); // 1 year up to max Date
873
- } else if (unit === 'year') {
874
- var years = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_YEAR);
875
- return locale.formatDistance('xYears', years, localizeOptions);
876
- }
877
-
878
- throw new RangeError("unit must be 'second', 'minute', 'hour', 'day', 'month' or 'year'");
879
- }
880
-
881
30
  const getItem = key => {
882
31
  try {
883
32
  const itemValue = localStorage.getItem(key);
884
-
885
33
  if (typeof itemValue === 'string') {
886
34
  return JSON.parse(itemValue);
887
35
  }
888
-
889
36
  return undefined;
890
- } catch (_unused) {
37
+ } catch {
891
38
  return undefined;
892
39
  }
893
40
  };
894
-
895
41
  function useLocalStorage(key, defaultValue) {
896
42
  const [value, setValue] = React__default.useState();
897
43
  React__default.useEffect(() => {
898
44
  const initialValue = getItem(key);
899
-
900
45
  if (typeof initialValue === 'undefined' || initialValue === null) {
901
46
  setValue(typeof defaultValue === 'function' ? defaultValue() : defaultValue);
902
47
  } else {
@@ -906,22 +51,18 @@ function useLocalStorage(key, defaultValue) {
906
51
  const setter = React__default.useCallback(updater => {
907
52
  setValue(old => {
908
53
  let newVal = updater;
909
-
910
54
  if (typeof updater == 'function') {
911
55
  newVal = updater(old);
912
56
  }
913
-
914
57
  try {
915
58
  localStorage.setItem(key, JSON.stringify(newVal));
916
- } catch (_unused2) {}
917
-
59
+ } catch {}
918
60
  return newVal;
919
61
  });
920
62
  }, [key]);
921
63
  return [value, setter];
922
64
  }
923
65
 
924
- const _excluded$3 = ["theme"];
925
66
  const defaultTheme = {
926
67
  background: '#0b1521',
927
68
  backgroundAlt: '#132337',
@@ -936,12 +77,10 @@ const defaultTheme = {
936
77
  warning: '#ffb200'
937
78
  };
938
79
  const ThemeContext = /*#__PURE__*/React__default.createContext(defaultTheme);
939
- function ThemeProvider(_ref) {
940
- let {
941
- theme
942
- } = _ref,
943
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
944
-
80
+ function ThemeProvider({
81
+ theme,
82
+ ...rest
83
+ }) {
945
84
  return /*#__PURE__*/React__default.createElement(ThemeContext.Provider, _extends({
946
85
  value: theme
947
86
  }, rest));
@@ -956,70 +95,66 @@ function useMediaQuery(query) {
956
95
  if (typeof window !== 'undefined') {
957
96
  return window.matchMedia && window.matchMedia(query).matches;
958
97
  }
959
- }); // Watch for changes
98
+ return;
99
+ });
960
100
 
101
+ // Watch for changes
961
102
  React__default.useEffect(() => {
962
103
  if (typeof window !== 'undefined') {
963
104
  if (!window.matchMedia) {
964
105
  return;
965
- } // Create a matcher
966
-
967
-
968
- const matcher = window.matchMedia(query); // Create our handler
106
+ }
969
107
 
970
- const onChange = _ref => {
971
- let {
972
- matches
973
- } = _ref;
974
- return setIsMatch(matches);
975
- }; // Listen for changes
108
+ // Create a matcher
109
+ const matcher = window.matchMedia(query);
976
110
 
111
+ // Create our handler
112
+ const onChange = ({
113
+ matches
114
+ }) => setIsMatch(matches);
977
115
 
116
+ // Listen for changes
978
117
  matcher.addListener(onChange);
979
118
  return () => {
980
119
  // Stop listening for changes
981
120
  matcher.removeListener(onChange);
982
121
  };
983
122
  }
123
+ return;
984
124
  }, [isMatch, query, setIsMatch]);
985
125
  return isMatch;
986
126
  }
987
127
 
988
- const _excluded$2 = ["style"];
989
128
  const isServer$1 = typeof window === 'undefined';
990
129
  function getStatusColor(match, theme) {
991
- return match.isPending ? theme.warning : match.isFetching ? theme.active : match.status === 'error' ? theme.danger : match.status === 'success' ? theme.success : theme.gray;
992
- } // export function getQueryStatusLabel(query: Query) {
993
- // return query.state.isFetching
994
- // ? 'fetching'
995
- // : !query.getObserversCount()
996
- // ? 'inactive'
997
- // : query.isStale()
998
- // ? 'stale'
999
- // : 'fresh'
1000
- // }
1001
-
1002
- function styled(type, newStyles, queries) {
1003
- if (queries === void 0) {
1004
- queries = {};
1005
- }
1006
-
1007
- return /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
1008
- let {
1009
- style
1010
- } = _ref,
1011
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
1012
-
130
+ return match.state.status === 'pending' ? theme.active : match.state.status === 'error' ? theme.danger : match.state.status === 'success' ? theme.success : theme.gray;
131
+ }
132
+ function getRouteStatusColor(matches, route, theme) {
133
+ const found = matches.find(d => d.route === route);
134
+ return found ? found.route.status === 'pending' ? theme.active : found.state.status === 'error' ? theme.danger : found.state.status === 'success' ? theme.success : theme.gray : theme.gray;
135
+ }
136
+ function styled(type, newStyles, queries = {}) {
137
+ return /*#__PURE__*/React__default.forwardRef(({
138
+ style,
139
+ ...rest
140
+ }, ref) => {
1013
141
  const theme = useTheme();
1014
- const mediaStyles = Object.entries(queries).reduce((current, _ref2) => {
1015
- let [key, value] = _ref2;
142
+ const mediaStyles = Object.entries(queries).reduce((current, [key, value]) => {
1016
143
  // eslint-disable-next-line react-hooks/rules-of-hooks
1017
- return useMediaQuery(key) ? _extends({}, current, typeof value === 'function' ? value(rest, theme) : value) : current;
144
+ return useMediaQuery(key) ? {
145
+ ...current,
146
+ ...(typeof value === 'function' ? value(rest, theme) : value)
147
+ } : current;
1018
148
  }, {});
1019
- return /*#__PURE__*/React__default.createElement(type, _extends({}, rest, {
1020
- style: _extends({}, typeof newStyles === 'function' ? newStyles(rest, theme) : newStyles, style, mediaStyles),
149
+ return /*#__PURE__*/React__default.createElement(type, {
150
+ ...rest,
151
+ style: {
152
+ ...(typeof newStyles === 'function' ? newStyles(rest, theme) : newStyles),
153
+ ...style,
154
+ ...mediaStyles
155
+ },
1021
156
  ref
1022
- }));
157
+ });
1023
158
  });
1024
159
  }
1025
160
  function useIsMounted() {
@@ -1033,22 +168,22 @@ function useIsMounted() {
1033
168
  }, []);
1034
169
  return isMounted;
1035
170
  }
171
+
1036
172
  /**
1037
173
  * Displays a string regardless the type of the data
1038
174
  * @param {unknown} value Value to be stringified
1039
175
  */
1040
-
1041
176
  const displayValue = value => {
1042
177
  const name = Object.getOwnPropertyNames(Object(value));
1043
- const newValue = typeof value === 'bigint' ? value.toString() + "n" : value;
178
+ const newValue = typeof value === 'bigint' ? `${value.toString()}n` : value;
1044
179
  return JSON.stringify(newValue, name);
1045
180
  };
181
+
1046
182
  /**
1047
183
  * This hook is a safe useState version which schedules state updates in microtasks
1048
184
  * to prevent updating a component state while React is rendering different components
1049
185
  * or when the component is not mounted anymore.
1050
186
  */
1051
-
1052
187
  function useSafeState(initialState) {
1053
188
  const isMounted = useIsMounted();
1054
189
  const [state, setState] = React__default.useState(initialState);
@@ -1061,11 +196,11 @@ function useSafeState(initialState) {
1061
196
  }, [isMounted]);
1062
197
  return [state, safeSetState];
1063
198
  }
199
+
1064
200
  /**
1065
201
  * Schedules a microtask.
1066
202
  * This can be useful to schedule state updates after rendering.
1067
203
  */
1068
-
1069
204
  function scheduleMicrotask(callback) {
1070
205
  Promise.resolve().then(callback).catch(error => setTimeout(() => {
1071
206
  throw error;
@@ -1074,7 +209,7 @@ function scheduleMicrotask(callback) {
1074
209
 
1075
210
  const Panel = styled('div', (_props, theme) => ({
1076
211
  fontSize: 'clamp(12px, 1.5vw, 14px)',
1077
- fontFamily: "sans-serif",
212
+ fontFamily: `sans-serif`,
1078
213
  display: 'flex',
1079
214
  backgroundColor: theme.background,
1080
215
  color: theme.foreground
@@ -1083,10 +218,11 @@ const Panel = styled('div', (_props, theme) => ({
1083
218
  flexDirection: 'column'
1084
219
  },
1085
220
  '(max-width: 600px)': {
1086
- fontSize: '.9em' // flexDirection: 'column',
1087
-
221
+ fontSize: '.9em'
222
+ // flexDirection: 'column',
1088
223
  }
1089
224
  });
225
+
1090
226
  const ActivePanel = styled('div', () => ({
1091
227
  flex: '1 1 500px',
1092
228
  display: 'flex',
@@ -1095,7 +231,7 @@ const ActivePanel = styled('div', () => ({
1095
231
  height: '100%'
1096
232
  }), {
1097
233
  '(max-width: 700px)': (_props, theme) => ({
1098
- borderTop: "2px solid " + theme.gray
234
+ borderTop: `2px solid ${theme.gray}`
1099
235
  })
1100
236
  });
1101
237
  const Button = styled('button', (props, theme) => ({
@@ -1109,10 +245,13 @@ const Button = styled('button', (props, theme) => ({
1109
245
  padding: '.5em',
1110
246
  opacity: props.disabled ? '.5' : undefined,
1111
247
  cursor: 'pointer'
1112
- })); // export const QueryKeys = styled('span', {
248
+ }));
249
+
250
+ // export const QueryKeys = styled('span', {
1113
251
  // display: 'inline-block',
1114
252
  // fontSize: '0.9em',
1115
253
  // })
254
+
1116
255
  // export const QueryKey = styled('span', {
1117
256
  // display: 'inline-flex',
1118
257
  // alignItems: 'center',
@@ -1125,40 +264,7 @@ const Button = styled('button', (props, theme) => ({
1125
264
  const Code = styled('code', {
1126
265
  fontSize: '.9em'
1127
266
  });
1128
- styled('input', (_props, theme) => ({
1129
- backgroundColor: theme.inputBackgroundColor,
1130
- border: 0,
1131
- borderRadius: '.2em',
1132
- color: theme.inputTextColor,
1133
- fontSize: '.9em',
1134
- lineHeight: "1.3",
1135
- padding: '.3em .4em'
1136
- }));
1137
- styled('select', (_props, theme) => ({
1138
- display: "inline-block",
1139
- fontSize: ".9em",
1140
- fontFamily: "sans-serif",
1141
- fontWeight: 'normal',
1142
- lineHeight: "1.3",
1143
- padding: ".3em 1.5em .3em .5em",
1144
- height: 'auto',
1145
- border: 0,
1146
- borderRadius: ".2em",
1147
- appearance: "none",
1148
- WebkitAppearance: 'none',
1149
- backgroundColor: theme.inputBackgroundColor,
1150
- 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>\")",
1151
- backgroundRepeat: "no-repeat",
1152
- backgroundPosition: "right .55em center",
1153
- backgroundSize: ".65em auto, 100%",
1154
- color: theme.inputTextColor
1155
- }), {
1156
- '(max-width: 500px)': {
1157
- display: 'none'
1158
- }
1159
- });
1160
267
 
1161
- const _excluded$1 = ["value", "defaultExpanded", "renderer", "pageSize"];
1162
268
  const Entry = styled('div', {
1163
269
  fontFamily: 'Menlo, monospace',
1164
270
  fontSize: '.7rem',
@@ -1194,20 +300,17 @@ const Info = styled('span', {
1194
300
  color: 'grey',
1195
301
  fontSize: '.7em'
1196
302
  });
1197
- const Expander = _ref => {
1198
- let {
1199
- expanded,
1200
- style = {}
1201
- } = _ref;
1202
- return /*#__PURE__*/React.createElement("span", {
1203
- style: _extends({
1204
- display: 'inline-block',
1205
- transition: 'all .1s ease',
1206
- transform: "rotate(" + (expanded ? 90 : 0) + "deg) " + (style.transform || '')
1207
- }, style)
1208
- }, "\u25B6");
1209
- };
1210
-
303
+ const Expander = ({
304
+ expanded,
305
+ style = {}
306
+ }) => /*#__PURE__*/React.createElement("span", {
307
+ style: {
308
+ display: 'inline-block',
309
+ transition: 'all .1s ease',
310
+ transform: `rotate(${expanded ? 90 : 0}deg) ${style.transform || ''}`,
311
+ ...style
312
+ }
313
+ }, "\u25B6");
1211
314
  /**
1212
315
  * Chunk elements in the array by size
1213
316
  *
@@ -1221,53 +324,40 @@ function chunkArray(array, size) {
1221
324
  if (size < 1) return [];
1222
325
  let i = 0;
1223
326
  const result = [];
1224
-
1225
327
  while (i < array.length) {
1226
328
  result.push(array.slice(i, i + size));
1227
329
  i = i + size;
1228
330
  }
1229
-
1230
331
  return result;
1231
332
  }
1232
- const DefaultRenderer = _ref2 => {
1233
- let {
1234
- HandleEntry,
1235
- label,
1236
- value,
1237
- subEntries = [],
1238
- subEntryPages = [],
1239
- type,
1240
- expanded = false,
1241
- toggleExpanded,
1242
- pageSize,
1243
- renderer
1244
- } = _ref2;
333
+ const DefaultRenderer = ({
334
+ handleEntry,
335
+ label,
336
+ value,
337
+ subEntries = [],
338
+ subEntryPages = [],
339
+ type,
340
+ expanded = false,
341
+ toggleExpanded,
342
+ pageSize,
343
+ renderer
344
+ }) => {
1245
345
  const [expandedPages, setExpandedPages] = React.useState([]);
1246
346
  const [valueSnapshot, setValueSnapshot] = React.useState(undefined);
1247
-
1248
347
  const refreshValueSnapshot = () => {
1249
348
  setValueSnapshot(value());
1250
349
  };
1251
-
1252
- return /*#__PURE__*/React.createElement(Entry, {
1253
- key: label
1254
- }, subEntryPages.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ExpandButton, {
350
+ return /*#__PURE__*/React.createElement(Entry, null, subEntryPages.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ExpandButton, {
1255
351
  onClick: () => toggleExpanded()
1256
352
  }, /*#__PURE__*/React.createElement(Expander, {
1257
353
  expanded: expanded
1258
- }), " ", label, ' ', /*#__PURE__*/React.createElement(Info, null, String(type).toLowerCase() === 'iterable' ? '(Iterable) ' : '', subEntries.length, " ", subEntries.length > 1 ? "items" : "item")), expanded ? subEntryPages.length === 1 ? /*#__PURE__*/React.createElement(SubEntries, null, subEntries.map(entry => /*#__PURE__*/React.createElement(HandleEntry, {
1259
- key: entry.label,
1260
- entry: entry
1261
- }))) : /*#__PURE__*/React.createElement(SubEntries, null, subEntryPages.map((entries, index) => /*#__PURE__*/React.createElement("div", {
354
+ }), " ", label, ' ', /*#__PURE__*/React.createElement(Info, null, String(type).toLowerCase() === 'iterable' ? '(Iterable) ' : '', subEntries.length, " ", subEntries.length > 1 ? `items` : `item`)), expanded ? subEntryPages.length === 1 ? /*#__PURE__*/React.createElement(SubEntries, null, subEntries.map((entry, index) => handleEntry(entry))) : /*#__PURE__*/React.createElement(SubEntries, null, subEntryPages.map((entries, index) => /*#__PURE__*/React.createElement("div", {
1262
355
  key: index
1263
356
  }, /*#__PURE__*/React.createElement(Entry, null, /*#__PURE__*/React.createElement(LabelButton, {
1264
357
  onClick: () => setExpandedPages(old => old.includes(index) ? old.filter(d => d !== index) : [...old, index])
1265
358
  }, /*#__PURE__*/React.createElement(Expander, {
1266
359
  expanded: expanded
1267
- }), " [", index * pageSize, " ...", ' ', index * pageSize + pageSize - 1, "]"), expandedPages.includes(index) ? /*#__PURE__*/React.createElement(SubEntries, null, entries.map(entry => /*#__PURE__*/React.createElement(HandleEntry, {
1268
- key: entry.label,
1269
- entry: entry
1270
- }))) : null)))) : null) : type === 'function' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Explorer, {
360
+ }), " [", index * pageSize, " ...", ' ', index * pageSize + pageSize - 1, "]"), expandedPages.includes(index) ? /*#__PURE__*/React.createElement(SubEntries, null, entries.map(entry => handleEntry(entry))) : null)))) : null) : type === 'function' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Explorer, {
1271
361
  renderer: renderer,
1272
362
  label: /*#__PURE__*/React.createElement("button", {
1273
363
  onClick: refreshValueSnapshot,
@@ -1281,34 +371,29 @@ const DefaultRenderer = _ref2 => {
1281
371
  defaultExpanded: {}
1282
372
  })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Label, null, label, ":"), " ", /*#__PURE__*/React.createElement(Value, null, displayValue(value))));
1283
373
  };
1284
-
1285
374
  function isIterable(x) {
1286
375
  return Symbol.iterator in x;
1287
376
  }
1288
-
1289
- function Explorer(_ref3) {
1290
- let {
1291
- value,
1292
- defaultExpanded,
1293
- renderer = DefaultRenderer,
1294
- pageSize = 100
1295
- } = _ref3,
1296
- rest = _objectWithoutPropertiesLoose(_ref3, _excluded$1);
1297
-
377
+ function Explorer({
378
+ value,
379
+ defaultExpanded,
380
+ renderer = DefaultRenderer,
381
+ pageSize = 100,
382
+ ...rest
383
+ }) {
1298
384
  const [expanded, setExpanded] = React.useState(Boolean(defaultExpanded));
1299
385
  const toggleExpanded = React.useCallback(() => setExpanded(old => !old), []);
1300
386
  let type = typeof value;
1301
387
  let subEntries = [];
1302
-
1303
388
  const makeProperty = sub => {
1304
389
  const subDefaultExpanded = defaultExpanded === true ? {
1305
390
  [sub.label]: true
1306
- } : defaultExpanded == null ? void 0 : defaultExpanded[sub.label];
1307
- return _extends({}, sub, {
391
+ } : defaultExpanded?.[sub.label];
392
+ return {
393
+ ...sub,
1308
394
  defaultExpanded: subDefaultExpanded
1309
- });
395
+ };
1310
396
  };
1311
-
1312
397
  if (Array.isArray(value)) {
1313
398
  type = 'array';
1314
399
  subEntries = value.map((d, i) => makeProperty({
@@ -1323,87 +408,68 @@ function Explorer(_ref3) {
1323
408
  }));
1324
409
  } else if (typeof value === 'object' && value !== null) {
1325
410
  type = 'object';
1326
- subEntries = Object.entries(value).map(_ref4 => {
1327
- let [key, val] = _ref4;
1328
- return makeProperty({
1329
- label: key,
1330
- value: val
1331
- });
1332
- });
411
+ subEntries = Object.entries(value).map(([key, val]) => makeProperty({
412
+ label: key,
413
+ value: val
414
+ }));
1333
415
  }
1334
-
1335
416
  const subEntryPages = chunkArray(subEntries, pageSize);
1336
- return renderer(_extends({
1337
- HandleEntry: _ref5 => {
1338
- let {
1339
- entry
1340
- } = _ref5;
1341
- return /*#__PURE__*/React.createElement(Explorer, _extends({
1342
- value: value,
1343
- renderer: renderer
1344
- }, rest, entry));
1345
- },
417
+ return renderer({
418
+ handleEntry: entry => /*#__PURE__*/React.createElement(Explorer, _extends({
419
+ key: entry.label,
420
+ value: value,
421
+ renderer: renderer
422
+ }, rest, entry)),
1346
423
  type,
1347
424
  subEntries,
1348
425
  subEntryPages,
1349
426
  value,
1350
427
  expanded,
1351
428
  toggleExpanded,
1352
- pageSize
1353
- }, rest));
429
+ pageSize,
430
+ ...rest
431
+ });
1354
432
  }
1355
433
 
434
+ const isServer = typeof window === 'undefined';
1356
435
  function Logo(props) {
1357
- return /*#__PURE__*/React.createElement("svg", _extends({
1358
- width: "40px",
1359
- height: "40px",
1360
- viewBox: "0 0 190 190",
1361
- version: "1.1"
1362
- }, props), /*#__PURE__*/React.createElement("g", {
1363
- stroke: "none",
1364
- strokeWidth: "1",
1365
- fill: "none",
1366
- fillRule: "evenodd"
1367
- }, /*#__PURE__*/React.createElement("g", {
1368
- id: "og-white",
1369
- transform: "translate(-28.000000, -21.000000)"
1370
- }, /*#__PURE__*/React.createElement("g", {
1371
- id: "Group-2",
1372
- transform: "translate(28.000000, 31.000000)"
1373
- }, /*#__PURE__*/React.createElement("path", {
1374
- 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",
1375
- id: "Path",
1376
- fill: "#002C4B",
1377
- fillRule: "nonzero",
1378
- transform: "translate(95.000000, 85.000000) scale(-1, 1) translate(-95.000000, -85.000000) "
1379
- }), /*#__PURE__*/React.createElement("path", {
1380
- 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",
1381
- id: "Polygon-3",
1382
- fill: "#FFD94C"
1383
- }), /*#__PURE__*/React.createElement("path", {
1384
- 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",
1385
- id: "Combined-Shape",
1386
- fill: "#FF4154"
1387
- })))));
436
+ return /*#__PURE__*/React__default.createElement("div", _extends({}, props, {
437
+ style: {
438
+ ...(props.style ?? {}),
439
+ display: 'flex',
440
+ alignItems: 'center',
441
+ flexDirection: 'column',
442
+ fontSize: '0.8rem',
443
+ fontWeight: 'bolder',
444
+ lineHeight: '1'
445
+ }
446
+ }), /*#__PURE__*/React__default.createElement("div", {
447
+ style: {
448
+ letterSpacing: '-0.05rem'
449
+ }
450
+ }, "TANSTACK"), /*#__PURE__*/React__default.createElement("div", {
451
+ style: {
452
+ backgroundImage: 'linear-gradient(to right, var(--tw-gradient-stops))',
453
+ // @ts-ignore
454
+ '--tw-gradient-from': '#84cc16',
455
+ '--tw-gradient-stops': 'var(--tw-gradient-from), var(--tw-gradient-to)',
456
+ '--tw-gradient-to': '#10b981',
457
+ WebkitBackgroundClip: 'text',
458
+ color: 'transparent',
459
+ letterSpacing: '0.1rem',
460
+ marginRight: '-0.2rem'
461
+ }
462
+ }, "ROUTER"));
1388
463
  }
1389
-
1390
- const _excluded = ["style"],
1391
- _excluded2 = ["style", "onClick"],
1392
- _excluded3 = ["style", "onClick"],
1393
- _excluded4 = ["isOpen", "setIsOpen", "handleDragStart", "useRouter"],
1394
- _excluded5 = ["listeners", "buildLocation", "mount", "update", "buildNext", "navigate", "cancelMatches", "loadLocation", "cleanPreloadCache", "loadRoute", "matchRoutes", "loadMatches", "invalidateRoute", "resolvePath", "matchRoute", "buildLink", "__experimental__createSnapshot", "destroy"],
1395
- _excluded6 = ["cancel", "load", "router", "Link", "MatchRoute", "buildLink", "linkProps", "matchRoute", "navigate"];
1396
- const isServer = typeof window === 'undefined';
1397
- function TanStackRouterDevtools(_ref) {
1398
- let {
1399
- initialIsOpen,
1400
- panelProps = {},
1401
- closeButtonProps = {},
1402
- toggleButtonProps = {},
1403
- position = 'bottom-left',
1404
- containerElement: Container = 'footer',
1405
- useRouter: useRouterImpl = useRouter
1406
- } = _ref;
464
+ function TanStackRouterDevtools({
465
+ initialIsOpen,
466
+ panelProps = {},
467
+ closeButtonProps = {},
468
+ toggleButtonProps = {},
469
+ position = 'bottom-left',
470
+ containerElement: Container = 'footer',
471
+ router
472
+ }) {
1407
473
  const rootRef = React__default.useRef(null);
1408
474
  const panelRef = React__default.useRef(null);
1409
475
  const [isOpen, setIsOpen] = useLocalStorage('tanstackRouterDevtoolsOpen', initialIsOpen);
@@ -1411,61 +477,51 @@ function TanStackRouterDevtools(_ref) {
1411
477
  const [isResolvedOpen, setIsResolvedOpen] = useSafeState(false);
1412
478
  const [isResizing, setIsResizing] = useSafeState(false);
1413
479
  const isMounted = useIsMounted();
1414
-
1415
- const _handleDragStart = (panelElement, startEvent) => {
1416
- var _panelElement$getBoun;
1417
-
480
+ const handleDragStart = (panelElement, startEvent) => {
1418
481
  if (startEvent.button !== 0) return; // Only allow left click for drag
1419
482
 
1420
483
  setIsResizing(true);
1421
484
  const dragInfo = {
1422
- originalHeight: (_panelElement$getBoun = panelElement == null ? void 0 : panelElement.getBoundingClientRect().height) != null ? _panelElement$getBoun : 0,
485
+ originalHeight: panelElement?.getBoundingClientRect().height ?? 0,
1423
486
  pageY: startEvent.pageY
1424
487
  };
1425
-
1426
488
  const run = moveEvent => {
1427
489
  const delta = dragInfo.pageY - moveEvent.pageY;
1428
- const newHeight = (dragInfo == null ? void 0 : dragInfo.originalHeight) + delta;
490
+ const newHeight = dragInfo?.originalHeight + delta;
1429
491
  setDevtoolsHeight(newHeight);
1430
-
1431
492
  if (newHeight < 70) {
1432
493
  setIsOpen(false);
1433
494
  } else {
1434
495
  setIsOpen(true);
1435
496
  }
1436
497
  };
1437
-
1438
498
  const unsub = () => {
1439
499
  setIsResizing(false);
1440
500
  document.removeEventListener('mousemove', run);
1441
501
  document.removeEventListener('mouseUp', unsub);
1442
502
  };
1443
-
1444
503
  document.addEventListener('mousemove', run);
1445
504
  document.addEventListener('mouseup', unsub);
1446
505
  };
1447
-
1448
506
  React__default.useEffect(() => {
1449
- setIsResolvedOpen(isOpen != null ? isOpen : false);
1450
- }, [isOpen, isResolvedOpen, setIsResolvedOpen]); // Toggle panel visibility before/after transition (depending on direction).
1451
- // Prevents focusing in a closed panel.
507
+ setIsResolvedOpen(isOpen ?? false);
508
+ }, [isOpen, isResolvedOpen, setIsResolvedOpen]);
1452
509
 
510
+ // Toggle panel visibility before/after transition (depending on direction).
511
+ // Prevents focusing in a closed panel.
1453
512
  React__default.useEffect(() => {
1454
513
  const ref = panelRef.current;
1455
-
1456
514
  if (ref) {
1457
515
  const handlePanelTransitionStart = () => {
1458
516
  if (ref && isResolvedOpen) {
1459
517
  ref.style.visibility = 'visible';
1460
518
  }
1461
519
  };
1462
-
1463
520
  const handlePanelTransitionEnd = () => {
1464
521
  if (ref && !isResolvedOpen) {
1465
522
  ref.style.visibility = 'hidden';
1466
523
  }
1467
524
  };
1468
-
1469
525
  ref.addEventListener('transitionstart', handlePanelTransitionStart);
1470
526
  ref.addEventListener('transitionend', handlePanelTransitionEnd);
1471
527
  return () => {
@@ -1473,62 +529,46 @@ function TanStackRouterDevtools(_ref) {
1473
529
  ref.removeEventListener('transitionend', handlePanelTransitionEnd);
1474
530
  };
1475
531
  }
1476
-
1477
532
  return;
1478
533
  }, [isResolvedOpen]);
1479
534
  React__default[isServer ? 'useEffect' : 'useLayoutEffect'](() => {
1480
535
  if (isResolvedOpen) {
1481
- var _rootRef$current, _rootRef$current$pare;
1482
-
1483
- const previousValue = (_rootRef$current = rootRef.current) == null ? void 0 : (_rootRef$current$pare = _rootRef$current.parentElement) == null ? void 0 : _rootRef$current$pare.style.paddingBottom;
1484
-
536
+ const previousValue = rootRef.current?.parentElement?.style.paddingBottom;
1485
537
  const run = () => {
1486
- var _panelRef$current, _rootRef$current2;
1487
-
1488
- const containerHeight = (_panelRef$current = panelRef.current) == null ? void 0 : _panelRef$current.getBoundingClientRect().height;
1489
-
1490
- if ((_rootRef$current2 = rootRef.current) != null && _rootRef$current2.parentElement) {
1491
- rootRef.current.parentElement.style.paddingBottom = containerHeight + "px";
538
+ const containerHeight = panelRef.current?.getBoundingClientRect().height;
539
+ if (rootRef.current?.parentElement) {
540
+ rootRef.current.parentElement.style.paddingBottom = `${containerHeight}px`;
1492
541
  }
1493
542
  };
1494
-
1495
543
  run();
1496
-
1497
544
  if (typeof window !== 'undefined') {
1498
545
  window.addEventListener('resize', run);
1499
546
  return () => {
1500
- var _rootRef$current3;
1501
-
1502
547
  window.removeEventListener('resize', run);
1503
-
1504
- if ((_rootRef$current3 = rootRef.current) != null && _rootRef$current3.parentElement && typeof previousValue === 'string') {
548
+ if (rootRef.current?.parentElement && typeof previousValue === 'string') {
1505
549
  rootRef.current.parentElement.style.paddingBottom = previousValue;
1506
550
  }
1507
551
  };
1508
552
  }
1509
553
  }
1510
-
1511
554
  return;
1512
555
  }, [isResolvedOpen]);
1513
-
1514
556
  const {
1515
- style: panelStyle = {}
1516
- } = panelProps,
1517
- otherPanelProps = _objectWithoutPropertiesLoose(panelProps, _excluded);
1518
-
557
+ style: panelStyle = {},
558
+ ...otherPanelProps
559
+ } = panelProps;
1519
560
  const {
1520
561
  style: closeButtonStyle = {},
1521
- onClick: onCloseClick
1522
- } = closeButtonProps,
1523
- otherCloseButtonProps = _objectWithoutPropertiesLoose(closeButtonProps, _excluded2);
1524
-
562
+ onClick: onCloseClick,
563
+ ...otherCloseButtonProps
564
+ } = closeButtonProps;
1525
565
  const {
1526
566
  style: toggleButtonStyle = {},
1527
- onClick: onToggleClick
1528
- } = toggleButtonProps,
1529
- otherToggleButtonProps = _objectWithoutPropertiesLoose(toggleButtonProps, _excluded3); // Do not render on the server
1530
-
567
+ onClick: onToggleClick,
568
+ ...otherToggleButtonProps
569
+ } = toggleButtonProps;
1531
570
 
571
+ // Do not render on the server
1532
572
  if (!isMounted()) return null;
1533
573
  return /*#__PURE__*/React__default.createElement(Container, {
1534
574
  ref: rootRef,
@@ -1538,36 +578,39 @@ function TanStackRouterDevtools(_ref) {
1538
578
  }, /*#__PURE__*/React__default.createElement(TanStackRouterDevtoolsPanel, _extends({
1539
579
  ref: panelRef
1540
580
  }, otherPanelProps, {
1541
- useRouter: useRouterImpl,
1542
- style: _extends({
581
+ router: router,
582
+ style: {
1543
583
  position: 'fixed',
1544
584
  bottom: '0',
1545
585
  right: '0',
1546
586
  zIndex: 99999,
1547
587
  width: '100%',
1548
- height: devtoolsHeight != null ? devtoolsHeight : 500,
588
+ height: devtoolsHeight ?? 500,
1549
589
  maxHeight: '90%',
1550
590
  boxShadow: '0 0 20px rgba(0,0,0,.3)',
1551
- borderTop: "1px solid " + defaultTheme.gray,
591
+ borderTop: `1px solid ${defaultTheme.gray}`,
1552
592
  transformOrigin: 'top',
1553
593
  // visibility will be toggled after transitions, but set initial state here
1554
- visibility: isOpen ? 'visible' : 'hidden'
1555
- }, panelStyle, isResizing ? {
1556
- transition: "none"
1557
- } : {
1558
- transition: "all .2s ease"
1559
- }, isResolvedOpen ? {
1560
- opacity: 1,
1561
- pointerEvents: 'all',
1562
- transform: "translateY(0) scale(1)"
1563
- } : {
1564
- opacity: 0,
1565
- pointerEvents: 'none',
1566
- transform: "translateY(15px) scale(1.02)"
1567
- }),
594
+ visibility: isOpen ? 'visible' : 'hidden',
595
+ ...panelStyle,
596
+ ...(isResizing ? {
597
+ transition: `none`
598
+ } : {
599
+ transition: `all .2s ease`
600
+ }),
601
+ ...(isResolvedOpen ? {
602
+ opacity: 1,
603
+ pointerEvents: 'all',
604
+ transform: `translateY(0) scale(1)`
605
+ } : {
606
+ opacity: 0,
607
+ pointerEvents: 'none',
608
+ transform: `translateY(15px) scale(1.02)`
609
+ })
610
+ },
1568
611
  isOpen: isResolvedOpen,
1569
612
  setIsOpen: setIsOpen,
1570
- handleDragStart: e => _handleDragStart(panelRef.current, e)
613
+ handleDragStart: e => handleDragStart(panelRef.current, e)
1571
614
  })), isResolvedOpen ? /*#__PURE__*/React__default.createElement(Button, _extends({
1572
615
  type: "button",
1573
616
  "aria-label": "Close TanStack Router Devtools"
@@ -1576,20 +619,22 @@ function TanStackRouterDevtools(_ref) {
1576
619
  setIsOpen(false);
1577
620
  onCloseClick && onCloseClick(e);
1578
621
  },
1579
- style: _extends({
622
+ style: {
1580
623
  position: 'fixed',
1581
624
  zIndex: 99999,
1582
625
  margin: '.5em',
1583
- bottom: 0
1584
- }, position === 'top-right' ? {
1585
- right: '0'
1586
- } : position === 'top-left' ? {
1587
- left: '0'
1588
- } : position === 'bottom-right' ? {
1589
- right: '0'
1590
- } : {
1591
- left: '0'
1592
- }, closeButtonStyle)
626
+ bottom: 0,
627
+ ...(position === 'top-right' ? {
628
+ right: '0'
629
+ } : position === 'top-left' ? {
630
+ left: '0'
631
+ } : position === 'bottom-right' ? {
632
+ right: '0'
633
+ } : {
634
+ left: '0'
635
+ }),
636
+ ...closeButtonStyle
637
+ }
1593
638
  }), "Close") : null), !isResolvedOpen ? /*#__PURE__*/React__default.createElement("button", _extends({
1594
639
  type: "button"
1595
640
  }, otherToggleButtonProps, {
@@ -1598,7 +643,7 @@ function TanStackRouterDevtools(_ref) {
1598
643
  setIsOpen(true);
1599
644
  onToggleClick && onToggleClick(e);
1600
645
  },
1601
- style: _extends({
646
+ style: {
1602
647
  appearance: 'none',
1603
648
  background: 'none',
1604
649
  border: 0,
@@ -1609,46 +654,95 @@ function TanStackRouterDevtools(_ref) {
1609
654
  fontSize: '1.5em',
1610
655
  margin: '.5em',
1611
656
  cursor: 'pointer',
1612
- width: 'fit-content'
1613
- }, position === 'top-right' ? {
1614
- top: '0',
1615
- right: '0'
1616
- } : position === 'top-left' ? {
1617
- top: '0',
1618
- left: '0'
1619
- } : position === 'bottom-right' ? {
1620
- bottom: '0',
1621
- right: '0'
1622
- } : {
1623
- bottom: '0',
1624
- left: '0'
1625
- }, toggleButtonStyle)
657
+ width: 'fit-content',
658
+ ...(position === 'top-right' ? {
659
+ top: '0',
660
+ right: '0'
661
+ } : position === 'top-left' ? {
662
+ top: '0',
663
+ left: '0'
664
+ } : position === 'bottom-right' ? {
665
+ bottom: '0',
666
+ right: '0'
667
+ } : {
668
+ bottom: '0',
669
+ left: '0'
670
+ }),
671
+ ...toggleButtonStyle
672
+ }
1626
673
  }), /*#__PURE__*/React__default.createElement(Logo, {
1627
674
  "aria-hidden": true
1628
675
  })) : null);
1629
676
  }
677
+ function RouteComp({
678
+ route,
679
+ isRoot,
680
+ matches,
681
+ activeRouteId,
682
+ setActiveRouteId
683
+ }) {
684
+ const isActive = matches.find(d => d.route === route);
685
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
686
+ role: "button",
687
+ "aria-label": `Open match details for ${route.id}`,
688
+ onClick: () => setActiveRouteId(activeRouteId === route.id ? '' : route.id),
689
+ style: {
690
+ display: 'flex',
691
+ borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
692
+ cursor: 'pointer',
693
+ alignItems: 'center',
694
+ background: route.id === activeRouteId ? 'rgba(255,255,255,.1)' : undefined
695
+ }
696
+ }, isRoot ? null : /*#__PURE__*/React__default.createElement("div", {
697
+ style: {
698
+ flex: '0 0 auto',
699
+ width: '.7rem',
700
+ height: '.7rem',
701
+ margin: '.5rem .75rem',
702
+ alignItems: 'center',
703
+ justifyContent: 'center',
704
+ fontWeight: 'bold',
705
+ borderRadius: '100%',
706
+ transition: 'all .2s ease-out',
707
+ background: getRouteStatusColor(matches, route, defaultTheme),
708
+ opacity: isActive ? 1 : 0.3
709
+ }
710
+ }), /*#__PURE__*/React__default.createElement(Code, {
711
+ style: {
712
+ padding: '.25rem 0',
713
+ paddingLeft: isRoot ? '.5rem' : 0,
714
+ opacity: isActive ? 1 : 0.7
715
+ }
716
+ }, `${route.id}`)), route.children?.length ? /*#__PURE__*/React__default.createElement("div", {
717
+ style: {
718
+ marginLeft: isRoot ? 0 : '1rem',
719
+ borderLeft: isRoot ? '' : `solid 1px ${defaultTheme.grayAlt}`
720
+ }
721
+ }, route.children.map(r => /*#__PURE__*/React__default.createElement(RouteComp, {
722
+ key: r.id,
723
+ route: r,
724
+ matches: matches,
725
+ activeRouteId: activeRouteId,
726
+ setActiveRouteId: setActiveRouteId
727
+ }))) : null);
728
+ }
1630
729
  const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(function TanStackRouterDevtoolsPanel(props, ref) {
1631
- var _router$state$matches, _router$state$pending, _last, _last2, _last3, _last4, _last5, _last6;
1632
-
1633
730
  const {
1634
731
  isOpen = true,
732
+ setIsOpen,
1635
733
  handleDragStart,
1636
- useRouter
1637
- } = props,
1638
- panelProps = _objectWithoutPropertiesLoose(props, _excluded4);
1639
-
1640
- const router = useRouter();
1641
- React__default.useEffect(() => {
1642
- let interval = setInterval(() => {
1643
- router.cleanPreloadCache();
1644
- router.notify();
1645
- }, 1000);
1646
- return () => {
1647
- clearInterval(interval);
1648
- };
1649
- }, []);
734
+ router: userRouter,
735
+ ...panelProps
736
+ } = props;
737
+ const routerContextValue = React__default.useContext(routerContext);
738
+ const router = userRouter ?? routerContextValue?.router;
739
+ 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.');
740
+ useStore(router.__store);
741
+ const [showMatches, setShowMatches] = useLocalStorage('tanstackRouterDevtoolsShowMatches', true);
1650
742
  const [activeRouteId, setActiveRouteId] = useLocalStorage('tanstackRouterDevtoolsActiveRouteId', '');
1651
- const activeMatch = (_router$state$matches = router.state.matches) == null ? void 0 : _router$state$matches.find(d => d.routeId === activeRouteId);
743
+ const allMatches = React__default.useMemo(() => [...Object.values(router.state.currentMatches), ...Object.values(router.state.pendingMatches ?? [])], [router.state.currentMatches, router.state.pendingMatches]);
744
+ const activeMatch = allMatches?.find(d => d.route.id === activeRouteId);
745
+ const hasSearch = Object.keys(last(router.state.currentMatches)?.state.search || {}).length;
1652
746
  return /*#__PURE__*/React__default.createElement(ThemeProvider, {
1653
747
  theme: defaultTheme
1654
748
  }, /*#__PURE__*/React__default.createElement(Panel, _extends({
@@ -1656,7 +750,49 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
1656
750
  className: "TanStackRouterDevtoolsPanel"
1657
751
  }, panelProps), /*#__PURE__*/React__default.createElement("style", {
1658
752
  dangerouslySetInnerHTML: {
1659
- __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 "
753
+ __html: `
754
+
755
+ .TanStackRouterDevtoolsPanel * {
756
+ scrollbar-color: ${defaultTheme.backgroundAlt} ${defaultTheme.gray};
757
+ }
758
+
759
+ .TanStackRouterDevtoolsPanel *::-webkit-scrollbar, .TanStackRouterDevtoolsPanel scrollbar {
760
+ width: 1em;
761
+ height: 1em;
762
+ }
763
+
764
+ .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-track, .TanStackRouterDevtoolsPanel scrollbar-track {
765
+ background: ${defaultTheme.backgroundAlt};
766
+ }
767
+
768
+ .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-thumb, .TanStackRouterDevtoolsPanel scrollbar-thumb {
769
+ background: ${defaultTheme.gray};
770
+ border-radius: .5em;
771
+ border: 3px solid ${defaultTheme.backgroundAlt};
772
+ }
773
+
774
+ .TanStackRouterDevtoolsPanel table {
775
+ width: 100%;
776
+ }
777
+
778
+ .TanStackRouterDevtoolsPanel table tr {
779
+ border-bottom: 2px dotted rgba(255, 255, 255, .2);
780
+ }
781
+
782
+ .TanStackRouterDevtoolsPanel table tr:last-child {
783
+ border-bottom: none
784
+ }
785
+
786
+ .TanStackRouterDevtoolsPanel table td {
787
+ padding: .25rem .5rem;
788
+ border-right: 2px dotted rgba(255, 255, 255, .05);
789
+ }
790
+
791
+ .TanStackRouterDevtoolsPanel table td:last-child {
792
+ border-right: none
793
+ }
794
+
795
+ `
1660
796
  }
1661
797
  }), /*#__PURE__*/React__default.createElement("div", {
1662
798
  style: {
@@ -1676,30 +812,27 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
1676
812
  minHeight: '40%',
1677
813
  maxHeight: '100%',
1678
814
  overflow: 'auto',
1679
- borderRight: "1px solid " + defaultTheme.grayAlt,
815
+ borderRight: `1px solid ${defaultTheme.grayAlt}`,
1680
816
  display: 'flex',
1681
817
  flexDirection: 'column'
1682
818
  }
1683
819
  }, /*#__PURE__*/React__default.createElement("div", {
1684
820
  style: {
1685
- padding: '.5em',
1686
- background: defaultTheme.backgroundAlt,
1687
821
  display: 'flex',
1688
- justifyContent: 'space-between',
1689
- alignItems: 'center'
822
+ justifyContent: 'start',
823
+ gap: '1rem',
824
+ padding: '1rem',
825
+ alignItems: 'center',
826
+ background: defaultTheme.backgroundAlt
1690
827
  }
1691
828
  }, /*#__PURE__*/React__default.createElement(Logo, {
1692
- "aria-hidden": true,
1693
- style: {
1694
- marginRight: '.5em'
1695
- }
829
+ "aria-hidden": true
1696
830
  }), /*#__PURE__*/React__default.createElement("div", {
1697
831
  style: {
1698
- marginRight: 'auto',
1699
832
  fontSize: 'clamp(.8rem, 2vw, 1.3rem)',
1700
833
  fontWeight: 'bold'
1701
834
  }
1702
- }, "TanStack Router", ' ', /*#__PURE__*/React__default.createElement("span", {
835
+ }, /*#__PURE__*/React__default.createElement("span", {
1703
836
  style: {
1704
837
  fontWeight: 100
1705
838
  }
@@ -1714,11 +847,7 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
1714
847
  }
1715
848
  }, /*#__PURE__*/React__default.createElement(Explorer, {
1716
849
  label: "Router",
1717
- value: (() => {
1718
- const rest = _objectWithoutPropertiesLoose(router, _excluded5);
1719
-
1720
- return rest;
1721
- })(),
850
+ value: router,
1722
851
  defaultExpanded: {}
1723
852
  })))), /*#__PURE__*/React__default.createElement("div", {
1724
853
  style: {
@@ -1726,7 +855,7 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
1726
855
  minHeight: '40%',
1727
856
  maxHeight: '100%',
1728
857
  overflow: 'auto',
1729
- borderRight: "1px solid " + defaultTheme.grayAlt,
858
+ borderRight: `1px solid ${defaultTheme.grayAlt}`,
1730
859
  display: 'flex',
1731
860
  flexDirection: 'column'
1732
861
  }
@@ -1736,17 +865,44 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
1736
865
  background: defaultTheme.backgroundAlt,
1737
866
  position: 'sticky',
1738
867
  top: 0,
1739
- zIndex: 1
868
+ zIndex: 1,
869
+ display: 'flex',
870
+ alignItems: 'center',
871
+ gap: '.5rem'
1740
872
  }
1741
- }, "Current Matches"), router.state.matches.map((match, i) => {
873
+ }, /*#__PURE__*/React__default.createElement("button", {
874
+ type: "button",
875
+ onClick: () => {
876
+ setShowMatches(false);
877
+ },
878
+ disabled: !showMatches,
879
+ style: {
880
+ opacity: showMatches ? 0.5 : 1
881
+ }
882
+ }, "Routes"), "/", /*#__PURE__*/React__default.createElement("button", {
883
+ type: "button",
884
+ onClick: () => {
885
+ setShowMatches(true);
886
+ },
887
+ disabled: showMatches,
888
+ style: {
889
+ opacity: !showMatches ? 0.5 : 1
890
+ }
891
+ }, "Matches")), !showMatches ? /*#__PURE__*/React__default.createElement(RouteComp, {
892
+ route: router.routeTree,
893
+ isRoot: true,
894
+ matches: allMatches,
895
+ activeRouteId: activeRouteId,
896
+ setActiveRouteId: setActiveRouteId
897
+ }) : /*#__PURE__*/React__default.createElement("div", null, router.state.currentMatches.map((match, i) => {
1742
898
  return /*#__PURE__*/React__default.createElement("div", {
1743
- key: match.routeId || i,
899
+ key: match.route.id || i,
1744
900
  role: "button",
1745
- "aria-label": "Open match details for " + match.routeId,
1746
- onClick: () => setActiveRouteId(activeRouteId === match.routeId ? '' : match.routeId),
901
+ "aria-label": `Open match details for ${match.route.id}`,
902
+ onClick: () => setActiveRouteId(activeRouteId === match.route.id ? '' : match.route.id),
1747
903
  style: {
1748
904
  display: 'flex',
1749
- borderBottom: "solid 1px " + defaultTheme.grayAlt,
905
+ borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
1750
906
  cursor: 'pointer',
1751
907
  alignItems: 'center',
1752
908
  background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
@@ -1768,8 +924,8 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
1768
924
  style: {
1769
925
  padding: '.5em'
1770
926
  }
1771
- }, "" + match.matchId));
1772
- }), /*#__PURE__*/React__default.createElement("div", {
927
+ }, `${match.id}`));
928
+ }), router.state.pendingMatches?.length ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
1773
929
  style: {
1774
930
  marginTop: '2rem',
1775
931
  padding: '.5em',
@@ -1778,15 +934,15 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
1778
934
  top: 0,
1779
935
  zIndex: 1
1780
936
  }
1781
- }, "Pending Matches"), (_router$state$pending = router.state.pending) == null ? void 0 : _router$state$pending.matches.map((match, i) => {
937
+ }, "Pending Matches"), router.state.pendingMatches?.map((match, i) => {
1782
938
  return /*#__PURE__*/React__default.createElement("div", {
1783
- key: match.routeId || i,
939
+ key: match.route.id || i,
1784
940
  role: "button",
1785
- "aria-label": "Open match details for " + match.routeId,
1786
- onClick: () => setActiveRouteId(activeRouteId === match.routeId ? '' : match.routeId),
941
+ "aria-label": `Open match details for ${match.route.id}`,
942
+ onClick: () => setActiveRouteId(activeRouteId === match.route.id ? '' : match.route.id),
1787
943
  style: {
1788
944
  display: 'flex',
1789
- borderBottom: "solid 1px " + defaultTheme.grayAlt,
945
+ borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
1790
946
  cursor: 'pointer',
1791
947
  background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
1792
948
  }
@@ -1807,77 +963,14 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
1807
963
  style: {
1808
964
  padding: '.5em'
1809
965
  }
1810
- }, "" + match.matchId));
1811
- }), /*#__PURE__*/React__default.createElement("div", {
1812
- style: {
1813
- marginTop: '2rem',
1814
- padding: '.5em',
1815
- background: defaultTheme.backgroundAlt,
1816
- position: 'sticky',
1817
- top: 0,
1818
- zIndex: 1
1819
- }
1820
- }, "Preloading Matches"), Object.keys(router.preloadCache).filter(key => {
1821
- var _cacheEntry$match$upd;
1822
-
1823
- const cacheEntry = router.preloadCache[key];
1824
- return ((_cacheEntry$match$upd = cacheEntry.match.updatedAt) != null ? _cacheEntry$match$upd : Date.now()) + cacheEntry.maxAge > Date.now();
1825
- }).map((key, i) => {
1826
- var _match$updatedAt;
1827
-
1828
- const {
1829
- match,
1830
- maxAge
1831
- } = router.preloadCache[key];
1832
- return /*#__PURE__*/React__default.createElement("div", {
1833
- key: match.matchId || i,
1834
- role: "button",
1835
- "aria-label": "Open match details for " + match.matchId,
1836
- onClick: () => setActiveRouteId(activeRouteId === match.routeId ? '' : match.routeId),
1837
- style: {
1838
- display: 'flex',
1839
- borderBottom: "solid 1px " + defaultTheme.grayAlt,
1840
- cursor: 'pointer',
1841
- background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
1842
- }
1843
- }, /*#__PURE__*/React__default.createElement("div", {
1844
- style: {
1845
- display: 'flex',
1846
- flexDirection: 'column',
1847
- padding: '.5rem',
1848
- gap: '.3rem'
1849
- }
1850
- }, /*#__PURE__*/React__default.createElement("div", {
1851
- style: {
1852
- display: 'flex',
1853
- alignItems: 'center',
1854
- gap: '.5rem'
1855
- }
1856
- }, /*#__PURE__*/React__default.createElement("div", {
1857
- style: {
1858
- flex: '0 0 auto',
1859
- width: '1.3rem',
1860
- height: '1.3rem',
1861
- background: getStatusColor(match, defaultTheme),
1862
- alignItems: 'center',
1863
- justifyContent: 'center',
1864
- fontWeight: 'bold',
1865
- borderRadius: '.25rem',
1866
- transition: 'all .2s ease-out'
1867
- }
1868
- }), /*#__PURE__*/React__default.createElement(Code, null, "" + match.matchId)), /*#__PURE__*/React__default.createElement("span", {
1869
- style: {
1870
- opacity: '.5'
1871
- }
1872
- }, "Expires", ' ', formatDistanceStrict(new Date(), new Date(((_match$updatedAt = match.updatedAt) != null ? _match$updatedAt : Date.now()) + maxAge), {
1873
- addSuffix: true
1874
- }))));
1875
- })), activeMatch ? /*#__PURE__*/React__default.createElement(ActivePanel, null, /*#__PURE__*/React__default.createElement("div", {
966
+ }, `${match.id}`));
967
+ })) : null)), activeMatch ? /*#__PURE__*/React__default.createElement(ActivePanel, null, /*#__PURE__*/React__default.createElement("div", {
1876
968
  style: {
1877
969
  padding: '.5em',
1878
970
  background: defaultTheme.backgroundAlt,
1879
971
  position: 'sticky',
1880
972
  top: 0,
973
+ bottom: 0,
1881
974
  zIndex: 1
1882
975
  }
1883
976
  }, "Match Details"), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("table", null, /*#__PURE__*/React__default.createElement("tbody", null, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
@@ -1888,56 +981,21 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
1888
981
  style: {
1889
982
  lineHeight: '1.8em'
1890
983
  }
1891
- }, JSON.stringify(activeMatch.matchId, null, 2)))), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
1892
- style: {
1893
- opacity: '.5'
1894
- }
1895
- }, "Status"), /*#__PURE__*/React__default.createElement("td", null, activeMatch.status)), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
1896
- style: {
1897
- opacity: '.5'
1898
- }
1899
- }, "Pending"), /*#__PURE__*/React__default.createElement("td", null, activeMatch.isPending.toString())), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
984
+ }, JSON.stringify(activeMatch.id, null, 2)))), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
1900
985
  style: {
1901
986
  opacity: '.5'
1902
987
  }
1903
- }, "Invalid"), /*#__PURE__*/React__default.createElement("td", null, activeMatch.isInvalid.toString())), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
988
+ }, "Status"), /*#__PURE__*/React__default.createElement("td", null, activeMatch.state.status)), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
1904
989
  style: {
1905
990
  opacity: '.5'
1906
991
  }
1907
- }, "Last Updated"), /*#__PURE__*/React__default.createElement("td", null, activeMatch.updatedAt ? new Date(activeMatch.updatedAt).toLocaleTimeString() : 'N/A'))))), /*#__PURE__*/React__default.createElement("div", {
1908
- style: {
1909
- background: defaultTheme.backgroundAlt,
1910
- padding: '.5em',
1911
- position: 'sticky',
1912
- top: 0,
1913
- zIndex: 1
1914
- }
1915
- }, "Actions"), /*#__PURE__*/React__default.createElement("div", {
1916
- style: {
1917
- padding: '0.5em'
1918
- }
1919
- }, /*#__PURE__*/React__default.createElement(Button, {
1920
- type: "button",
1921
- onClick: () => {
1922
- router.invalidateRoute(activeMatch);
1923
- router.notify();
1924
- },
1925
- style: {
1926
- background: defaultTheme.warning,
1927
- color: defaultTheme.inputTextColor
1928
- }
1929
- }, "Invalidate"), ' ', /*#__PURE__*/React__default.createElement(Button, {
1930
- type: "button",
1931
- onClick: () => router.reload(),
1932
- style: {
1933
- background: defaultTheme.gray
1934
- }
1935
- }, "Reload")), /*#__PURE__*/React__default.createElement("div", {
992
+ }, "Last Updated"), /*#__PURE__*/React__default.createElement("td", null, activeMatch.state.updatedAt ? new Date(activeMatch.state.updatedAt).toLocaleTimeString() : 'N/A'))))), /*#__PURE__*/React__default.createElement("div", {
1936
993
  style: {
1937
994
  background: defaultTheme.backgroundAlt,
1938
995
  padding: '.5em',
1939
996
  position: 'sticky',
1940
997
  top: 0,
998
+ bottom: 0,
1941
999
  zIndex: 1
1942
1000
  }
1943
1001
  }, "Explorer"), /*#__PURE__*/React__default.createElement("div", {
@@ -1946,19 +1004,15 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
1946
1004
  }
1947
1005
  }, /*#__PURE__*/React__default.createElement(Explorer, {
1948
1006
  label: "Match",
1949
- value: (() => {
1950
- const rest = _objectWithoutPropertiesLoose(activeMatch, _excluded6);
1951
-
1952
- return rest;
1953
- })(),
1007
+ value: activeMatch,
1954
1008
  defaultExpanded: {}
1955
- }))) : null, /*#__PURE__*/React__default.createElement("div", {
1009
+ }))) : null, hasSearch ? /*#__PURE__*/React__default.createElement("div", {
1956
1010
  style: {
1957
1011
  flex: '1 1 500px',
1958
1012
  minHeight: '40%',
1959
1013
  maxHeight: '100%',
1960
1014
  overflow: 'auto',
1961
- borderRight: "1px solid " + defaultTheme.grayAlt,
1015
+ borderRight: `1px solid ${defaultTheme.grayAlt}`,
1962
1016
  display: 'flex',
1963
1017
  flexDirection: 'column'
1964
1018
  }
@@ -1968,45 +1022,20 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
1968
1022
  background: defaultTheme.backgroundAlt,
1969
1023
  position: 'sticky',
1970
1024
  top: 0,
1971
- zIndex: 1
1972
- }
1973
- }, "Loader Data"), /*#__PURE__*/React__default.createElement("div", {
1974
- style: {
1975
- padding: '.5em'
1976
- }
1977
- }, Object.keys(((_last = last(router.state.matches)) == null ? void 0 : _last.loaderData) || {}).length ? /*#__PURE__*/React__default.createElement(Explorer, {
1978
- value: ((_last2 = last(router.state.matches)) == null ? void 0 : _last2.loaderData) || {},
1979
- defaultExpanded: Object.keys(((_last3 = last(router.state.matches)) == null ? void 0 : _last3.loaderData) || {}).reduce((obj, next) => {
1980
- obj[next] = {};
1981
- return obj;
1982
- }, {})
1983
- }) : /*#__PURE__*/React__default.createElement("em", {
1984
- style: {
1985
- opacity: 0.5
1986
- }
1987
- }, '{ }')), /*#__PURE__*/React__default.createElement("div", {
1988
- style: {
1989
- padding: '.5em',
1990
- background: defaultTheme.backgroundAlt,
1991
- position: 'sticky',
1992
- top: 0,
1025
+ bottom: 0,
1993
1026
  zIndex: 1
1994
1027
  }
1995
1028
  }, "Search Params"), /*#__PURE__*/React__default.createElement("div", {
1996
1029
  style: {
1997
1030
  padding: '.5em'
1998
1031
  }
1999
- }, Object.keys(((_last4 = last(router.state.matches)) == null ? void 0 : _last4.search) || {}).length ? /*#__PURE__*/React__default.createElement(Explorer, {
2000
- value: ((_last5 = last(router.state.matches)) == null ? void 0 : _last5.search) || {},
2001
- defaultExpanded: Object.keys(((_last6 = last(router.state.matches)) == null ? void 0 : _last6.search) || {}).reduce((obj, next) => {
1032
+ }, /*#__PURE__*/React__default.createElement(Explorer, {
1033
+ value: last(router.state.currentMatches)?.state.search || {},
1034
+ defaultExpanded: Object.keys(last(router.state.currentMatches)?.state.search || {}).reduce((obj, next) => {
2002
1035
  obj[next] = {};
2003
1036
  return obj;
2004
1037
  }, {})
2005
- }) : /*#__PURE__*/React__default.createElement("em", {
2006
- style: {
2007
- opacity: 0.5
2008
- }
2009
- }, '{ }')))));
1038
+ }))) : null));
2010
1039
  });
2011
1040
 
2012
1041
  export { TanStackRouterDevtools, TanStackRouterDevtoolsPanel };