@tanstack/react-router-devtools 0.0.1-beta.36 → 0.0.1-beta.41

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.
@@ -9,10 +9,10 @@
9
9
  * @license MIT
10
10
  */
11
11
  (function (global, factory) {
12
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@tanstack/react-router')) :
13
- typeof define === 'function' && define.amd ? define(['exports', 'react', '@tanstack/react-router'], factory) :
14
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactRouterDevtools = {}, global.React, global.ReactRouter));
15
- })(this, (function (exports, React, reactRouter) { 'use strict';
12
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('use-sync-external-store/shim')) :
13
+ typeof define === 'function' && define.amd ? define(['exports', 'react', 'use-sync-external-store/shim'], factory) :
14
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactRouterDevtools = {}, global.React, global.shim));
15
+ })(this, (function (exports, React, shim) { 'use strict';
16
16
 
17
17
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
18
 
@@ -34,8 +34,8 @@
34
34
  return Object.freeze(n);
35
35
  }
36
36
 
37
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
38
37
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
38
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
39
39
 
40
40
  function _extends() {
41
41
  _extends = Object.assign ? Object.assign.bind() : function (target) {
@@ -51,17 +51,602 @@
51
51
  };
52
52
  return _extends.apply(this, arguments);
53
53
  }
54
- function _objectWithoutPropertiesLoose(source, excluded) {
55
- if (source == null) return {};
56
- var target = {};
57
- var sourceKeys = Object.keys(source);
58
- var key, i;
59
- for (i = 0; i < sourceKeys.length; i++) {
60
- key = sourceKeys[i];
61
- if (excluded.indexOf(key) >= 0) continue;
62
- target[key] = source[key];
54
+
55
+ // src/core.ts
56
+ var CurrentReaction = void 0;
57
+ var CurrentGets = null;
58
+ var CurrentGetsIndex = 0;
59
+ var EffectQueue = null;
60
+ var CacheClean = 0;
61
+ var CacheCheck = 1;
62
+ var CacheDirty = 2;
63
+ var Root;
64
+ var Reactive = class {
65
+ value;
66
+ fn;
67
+ observers = null;
68
+ sources = null;
69
+ state;
70
+ effect;
71
+ cleanups = null;
72
+ alwaysUpdate = false;
73
+ constructor(fnOrValue, type) {
74
+ if (type != 0 /* Signal */) {
75
+ this.fn = fnOrValue;
76
+ this.value = void 0;
77
+ this.state = CacheDirty;
78
+ if (Root)
79
+ Root.push(this);
80
+ else
81
+ console.error("Memos and effects must be wrapped in a createRoot");
82
+ this.effect = type == 2 /* Effect */;
83
+ if (this.effect)
84
+ this.update();
85
+ } else {
86
+ this.fn = void 0;
87
+ this.value = fnOrValue;
88
+ this.state = CacheClean;
89
+ this.effect = false;
90
+ }
63
91
  }
64
- return target;
92
+ get() {
93
+ if (CurrentReaction) {
94
+ if (!CurrentGets && CurrentReaction.sources && CurrentReaction.sources[CurrentGetsIndex] == this) {
95
+ CurrentGetsIndex++;
96
+ } else {
97
+ if (!CurrentGets)
98
+ CurrentGets = [this];
99
+ else
100
+ CurrentGets.push(this);
101
+ }
102
+ }
103
+ if (this.fn)
104
+ this.updateIfNecessary();
105
+ return this.value;
106
+ }
107
+ set(value) {
108
+ const notInBatch = !EffectQueue;
109
+ const newValue = typeof value === "function" ? value(this.value) : value;
110
+ if ((this.value !== newValue || this.alwaysUpdate) && this.observers) {
111
+ for (let i = 0; i < this.observers.length; i++) {
112
+ this.observers[i].stale(CacheDirty);
113
+ }
114
+ }
115
+ this.value = newValue;
116
+ if (notInBatch)
117
+ stabilize();
118
+ return newValue;
119
+ }
120
+ stale(state) {
121
+ if (this.state < state) {
122
+ if (this.state === CacheClean && this.effect) {
123
+ if (EffectQueue)
124
+ EffectQueue.push(this);
125
+ else
126
+ EffectQueue = [this];
127
+ }
128
+ this.state = state;
129
+ if (this.observers) {
130
+ for (let i = 0; i < this.observers.length; i++) {
131
+ this.observers[i].stale(CacheCheck);
132
+ }
133
+ }
134
+ }
135
+ }
136
+ update() {
137
+ const oldValue = this.value;
138
+ const prevReaction = CurrentReaction;
139
+ const prevGets = CurrentGets;
140
+ const prevIndex = CurrentGetsIndex;
141
+ CurrentReaction = this;
142
+ CurrentGets = null;
143
+ CurrentGetsIndex = 0;
144
+ try {
145
+ if (this.cleanups) {
146
+ this.cleanups.forEach((c) => c());
147
+ this.cleanups = null;
148
+ }
149
+ this.value = this.fn();
150
+ if (CurrentGets) {
151
+ this.removeParentObservers(CurrentGetsIndex);
152
+ if (this.sources && CurrentGetsIndex > 0) {
153
+ this.sources.length = CurrentGetsIndex + CurrentGets.length;
154
+ for (let i = 0; i < CurrentGets.length; i++) {
155
+ this.sources[CurrentGetsIndex + i] = CurrentGets[i];
156
+ }
157
+ } else {
158
+ this.sources = CurrentGets;
159
+ }
160
+ for (let i = CurrentGetsIndex; i < this.sources.length; i++) {
161
+ const source = this.sources[i];
162
+ if (!source.observers) {
163
+ source.observers = [this];
164
+ } else {
165
+ source.observers.push(this);
166
+ }
167
+ }
168
+ } else if (this.sources && CurrentGetsIndex < this.sources.length) {
169
+ this.removeParentObservers(CurrentGetsIndex);
170
+ this.sources.length = CurrentGetsIndex;
171
+ }
172
+ } finally {
173
+ CurrentGets = prevGets;
174
+ CurrentReaction = prevReaction;
175
+ CurrentGetsIndex = prevIndex;
176
+ }
177
+ if ((oldValue !== this.value || this.alwaysUpdate) && this.observers) {
178
+ for (let i = 0; i < this.observers.length; i++) {
179
+ this.observers[i].state = CacheDirty;
180
+ }
181
+ }
182
+ this.state = CacheClean;
183
+ }
184
+ updateIfNecessary() {
185
+ if (this.state === CacheCheck) {
186
+ for (const source of this.sources) {
187
+ source.updateIfNecessary();
188
+ if (this.state === CacheDirty) {
189
+ break;
190
+ }
191
+ }
192
+ }
193
+ if (this.state === CacheDirty) {
194
+ this.update();
195
+ }
196
+ this.state = CacheClean;
197
+ }
198
+ removeParentObservers(index) {
199
+ if (!this.sources)
200
+ return;
201
+ for (let i = index; i < this.sources.length; i++) {
202
+ const source = this.sources[i];
203
+ const swap = source.observers.findIndex((v) => v === this);
204
+ source.observers[swap] = source.observers[source.observers.length - 1];
205
+ source.observers.pop();
206
+ }
207
+ }
208
+ destroy() {
209
+ if (this.cleanups) {
210
+ this.cleanups.forEach((c) => c());
211
+ this.cleanups = null;
212
+ }
213
+ this.removeParentObservers(0);
214
+ }
215
+ };
216
+ function stabilize() {
217
+ if (!EffectQueue)
218
+ return;
219
+ for (let i = 0; i < EffectQueue.length; i++) {
220
+ EffectQueue[i].get();
221
+ }
222
+ EffectQueue = null;
223
+ }
224
+ function createEffect(fn) {
225
+ const effect = new Reactive(fn, 2 /* Effect */);
226
+ return effect.get.bind(effect);
227
+ }
228
+ function createRoot(fn) {
229
+ let root = [];
230
+ Root = root;
231
+ fn();
232
+ Root = null;
233
+ return () => {
234
+ if (!root)
235
+ return;
236
+ root.forEach((r) => r.destroy());
237
+ root = null;
238
+ };
239
+ }
240
+ function batch(fn) {
241
+ EffectQueue = [];
242
+ let out = fn();
243
+ stabilize();
244
+ return out;
245
+ }
246
+ function untrack(fn) {
247
+ const listener = CurrentReaction;
248
+ CurrentReaction = void 0;
249
+ try {
250
+ return fn();
251
+ } finally {
252
+ CurrentReaction = listener;
253
+ }
254
+ }
255
+
256
+ // src/store.ts
257
+ var $RAW = Symbol("store-raw");
258
+ var $TRACK = Symbol("track");
259
+ var $PROXY = Symbol("store-proxy");
260
+ var $NODE = Symbol("store-node");
261
+ function wrap(value) {
262
+ let p = value[$PROXY];
263
+ if (!p) {
264
+ Object.defineProperty(value, $PROXY, {
265
+ value: p = new Proxy(value, proxyTraps)
266
+ });
267
+ if (!Array.isArray(value)) {
268
+ const keys = Object.keys(value);
269
+ const desc = Object.getOwnPropertyDescriptors(value);
270
+ for (let i = 0, l = keys.length; i < l; i++) {
271
+ const prop = keys[i];
272
+ if (desc[prop].get) {
273
+ const get = desc[prop].get.bind(p);
274
+ Object.defineProperty(value, prop, {
275
+ enumerable: desc[prop].enumerable,
276
+ get
277
+ });
278
+ }
279
+ }
280
+ }
281
+ }
282
+ return p;
283
+ }
284
+ function isWrappable(obj) {
285
+ let proto;
286
+ return obj != null && typeof obj === "object" && (obj[$PROXY] || !(proto = Object.getPrototypeOf(obj)) || proto === Object.prototype || Array.isArray(obj));
287
+ }
288
+ function unwrap(item, set = /* @__PURE__ */ new Set()) {
289
+ let result, unwrapped, v, prop;
290
+ if (result = item != null && item[$RAW])
291
+ return result;
292
+ if (!isWrappable(item) || set.has(item))
293
+ return item;
294
+ if (Array.isArray(item)) {
295
+ if (Object.isFrozen(item))
296
+ item = item.slice(0);
297
+ else
298
+ set.add(item);
299
+ for (let i = 0, l = item.length; i < l; i++) {
300
+ v = item[i];
301
+ if ((unwrapped = unwrap(v, set)) !== v)
302
+ item[i] = unwrapped;
303
+ }
304
+ } else {
305
+ if (Object.isFrozen(item))
306
+ item = Object.assign({}, item);
307
+ else
308
+ set.add(item);
309
+ const keys = Object.keys(item);
310
+ const desc = Object.getOwnPropertyDescriptors(item);
311
+ for (let i = 0, l = keys.length; i < l; i++) {
312
+ prop = keys[i];
313
+ if (desc[prop].get)
314
+ continue;
315
+ v = item[prop];
316
+ if ((unwrapped = unwrap(v, set)) !== v)
317
+ item[prop] = unwrapped;
318
+ }
319
+ }
320
+ return item;
321
+ }
322
+ function getDataNodes(target) {
323
+ let nodes = target[$NODE];
324
+ if (!nodes)
325
+ Object.defineProperty(target, $NODE, { value: nodes = {} });
326
+ return nodes;
327
+ }
328
+ function getDataNode(nodes, property, value) {
329
+ return nodes[property] || (nodes[property] = createDataNode(value));
330
+ }
331
+ function proxyDescriptor(target, property) {
332
+ const desc = Reflect.getOwnPropertyDescriptor(target, property);
333
+ if (!desc || desc.get || !desc.configurable || property === $PROXY || property === $NODE)
334
+ return desc;
335
+ delete desc.value;
336
+ delete desc.writable;
337
+ desc.get = () => target[$PROXY][property];
338
+ return desc;
339
+ }
340
+ function trackSelf(target) {
341
+ if (CurrentReaction) {
342
+ const nodes = getDataNodes(target);
343
+ (nodes._ || (nodes._ = createDataNode())).get();
344
+ }
345
+ }
346
+ function ownKeys(target) {
347
+ trackSelf(target);
348
+ return Reflect.ownKeys(target);
349
+ }
350
+ function createDataNode(value) {
351
+ const s = new Reactive(value, 0);
352
+ s.alwaysUpdate = true;
353
+ return s;
354
+ }
355
+ var Writing = false;
356
+ var proxyTraps = {
357
+ get(target, property, receiver) {
358
+ if (property === $RAW)
359
+ return target;
360
+ if (property === $PROXY)
361
+ return receiver;
362
+ if (property === $TRACK) {
363
+ trackSelf(target);
364
+ return receiver;
365
+ }
366
+ const nodes = getDataNodes(target);
367
+ const tracked = nodes.hasOwnProperty(property);
368
+ let value = tracked ? nodes[property].get() : target[property];
369
+ if (property === $NODE || property === "__proto__")
370
+ return value;
371
+ if (!tracked) {
372
+ const desc = Object.getOwnPropertyDescriptor(target, property);
373
+ if (CurrentReaction && (typeof value !== "function" || target.hasOwnProperty(property)) && !(desc && desc.get))
374
+ value = getDataNode(nodes, property, value).get();
375
+ }
376
+ return isWrappable(value) ? wrap(value) : value;
377
+ },
378
+ has(target, property) {
379
+ if (property === $RAW || property === $PROXY || property === $TRACK || property === $NODE || property === "__proto__")
380
+ return true;
381
+ this.get(target, property, target);
382
+ return property in target;
383
+ },
384
+ set(target, property, value) {
385
+ Writing && setProperty(target, property, unwrap(value));
386
+ return true;
387
+ },
388
+ deleteProperty(target, property) {
389
+ Writing && setProperty(target, property, void 0, true);
390
+ return true;
391
+ },
392
+ ownKeys,
393
+ getOwnPropertyDescriptor: proxyDescriptor
394
+ };
395
+ function setProperty(state, property, value, deleting = false) {
396
+ if (!deleting && state[property] === value)
397
+ return;
398
+ const prev = state[property];
399
+ const len = state.length;
400
+ if (deleting)
401
+ delete state[property];
402
+ else
403
+ state[property] = value;
404
+ const nodes = getDataNodes(state);
405
+ let node;
406
+ if (node = getDataNode(nodes, property, prev))
407
+ node.set(() => value);
408
+ if (Array.isArray(state) && state.length !== len)
409
+ (node = getDataNode(nodes, "length", len)) && node.set(state.length);
410
+ (node = nodes._) && node.set();
411
+ }
412
+ function createStore(store) {
413
+ const unwrappedStore = unwrap(store);
414
+ const wrappedStore = wrap(unwrappedStore);
415
+ const setStore = (fn) => {
416
+ batch(() => {
417
+ try {
418
+ Writing = true;
419
+ fn(wrappedStore);
420
+ } finally {
421
+ Writing = false;
422
+ }
423
+ });
424
+ };
425
+ return [wrappedStore, setStore];
426
+ }
427
+
428
+ var isProduction = "development" === 'production';
429
+ var prefix = 'Invariant failed';
430
+ function invariant(condition, message) {
431
+ if (condition) {
432
+ return;
433
+ }
434
+ if (isProduction) {
435
+ throw new Error(prefix);
436
+ }
437
+ var provided = typeof message === 'function' ? message() : message;
438
+ var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
439
+ throw new Error(value);
440
+ }
441
+
442
+ /**
443
+ * router-core
444
+ *
445
+ * Copyright (c) TanStack
446
+ *
447
+ * This source code is licensed under the MIT license found in the
448
+ * LICENSE.md file in the root directory of this source tree.
449
+ *
450
+ * @license MIT
451
+ */
452
+
453
+ function last(arr) {
454
+ return arr[arr.length - 1];
455
+ }
456
+ function warning(cond, message) {
457
+ if (cond) {
458
+ if (typeof console !== 'undefined') console.warn(message);
459
+ try {
460
+ throw new Error(message);
461
+ } catch {}
462
+ }
463
+ return true;
464
+ }
465
+
466
+ /**
467
+ * This function returns `a` if `b` is deeply equal.
468
+ * If not, it will replace any deeply equal children of `b` with those of `a`.
469
+ * This can be used for structural sharing between JSON values for example.
470
+ */
471
+ function sharedClone(prev, next, touchAll) {
472
+ const things = new Map();
473
+ function recurse(prev, next) {
474
+ if (prev === next) {
475
+ return prev;
476
+ }
477
+ if (things.has(next)) {
478
+ return things.get(next);
479
+ }
480
+ const prevIsArray = Array.isArray(prev);
481
+ const nextIsArray = Array.isArray(next);
482
+ const prevIsObj = isPlainObject(prev);
483
+ const nextIsObj = isPlainObject(next);
484
+ const isArray = prevIsArray && nextIsArray;
485
+ const isObj = prevIsObj && nextIsObj;
486
+ const isSameStructure = isArray || isObj;
487
+
488
+ // Both are arrays or objects
489
+ if (isSameStructure) {
490
+ const aSize = isArray ? prev.length : Object.keys(prev).length;
491
+ const bItems = isArray ? next : Object.keys(next);
492
+ const bSize = bItems.length;
493
+ const copy = isArray ? [] : {};
494
+ let equalItems = 0;
495
+ for (let i = 0; i < bSize; i++) {
496
+ const key = isArray ? i : bItems[i];
497
+ if (copy[key] === prev[key]) {
498
+ equalItems++;
499
+ }
500
+ }
501
+ if (aSize === bSize && equalItems === aSize) {
502
+ things.set(next, prev);
503
+ return prev;
504
+ }
505
+ things.set(next, copy);
506
+ for (let i = 0; i < bSize; i++) {
507
+ const key = isArray ? i : bItems[i];
508
+ if (typeof bItems[i] === 'function') {
509
+ copy[key] = prev[key];
510
+ } else {
511
+ copy[key] = recurse(prev[key], next[key]);
512
+ }
513
+ if (copy[key] === prev[key]) {
514
+ equalItems++;
515
+ }
516
+ }
517
+ return copy;
518
+ }
519
+ if (nextIsArray) {
520
+ const copy = [];
521
+ things.set(next, copy);
522
+ for (let i = 0; i < next.length; i++) {
523
+ copy[i] = recurse(undefined, next[i]);
524
+ }
525
+ return copy;
526
+ }
527
+ if (nextIsObj) {
528
+ const copy = {};
529
+ things.set(next, copy);
530
+ const nextKeys = Object.keys(next);
531
+ for (let i = 0; i < nextKeys.length; i++) {
532
+ const key = nextKeys[i];
533
+ copy[key] = recurse(undefined, next[key]);
534
+ }
535
+ return copy;
536
+ }
537
+ return next;
538
+ }
539
+ return recurse(prev, next);
540
+ }
541
+
542
+ // Copied from: https://github.com/jonschlinkert/is-plain-object
543
+ function isPlainObject(o) {
544
+ if (!hasObjectPrototype(o)) {
545
+ return false;
546
+ }
547
+
548
+ // If has modified constructor
549
+ const ctor = o.constructor;
550
+ if (typeof ctor === 'undefined') {
551
+ return true;
552
+ }
553
+
554
+ // If has modified prototype
555
+ const prot = ctor.prototype;
556
+ if (!hasObjectPrototype(prot)) {
557
+ return false;
558
+ }
559
+
560
+ // If constructor does not have an Object-specific method
561
+ if (!prot.hasOwnProperty('isPrototypeOf')) {
562
+ return false;
563
+ }
564
+
565
+ // Most likely a plain Object
566
+ return true;
567
+ }
568
+ function hasObjectPrototype(o) {
569
+ return Object.prototype.toString.call(o) === '[object Object]';
570
+ }
571
+
572
+ var _window$document;
573
+ // Detect if we're in the DOM
574
+ typeof window === 'undefined' || !((_window$document = window.document) != null && _window$document.createElement);
575
+
576
+ /**
577
+ * react-router
578
+ *
579
+ * Copyright (c) TanStack
580
+ *
581
+ * This source code is licensed under the MIT license found in the
582
+ * LICENSE.md file in the root directory of this source tree.
583
+ *
584
+ * @license MIT
585
+ */
586
+ const routerContext = /*#__PURE__*/React__namespace.createContext(null);
587
+ const EMPTY = {};
588
+ const __useStoreValue = (seed, selector) => {
589
+ const valueRef = React__namespace.useRef(EMPTY);
590
+
591
+ // If there is no selector, track the seed
592
+ // If there is a selector, do not track the seed
593
+ const getValue = () => !selector ? seed() : selector(untrack(() => seed()));
594
+
595
+ // If empty, initialize the value
596
+ if (valueRef.current === EMPTY) {
597
+ valueRef.current = sharedClone(undefined, getValue());
598
+ }
599
+
600
+ // Snapshot should just return the current cached value
601
+ const getSnapshot = React__namespace.useCallback(() => valueRef.current, []);
602
+ const getStore = React__namespace.useCallback(cb => {
603
+ // A root is necessary to track effects
604
+ return createRoot(() => {
605
+ createEffect(() => {
606
+ // Read and update the value
607
+ // getValue will handle which values are accessed and
608
+ // thus tracked.
609
+ // sharedClone will both recursively track the end result
610
+ // and ensure that the previous value is structurally shared
611
+ // into the new version.
612
+ valueRef.current = unwrap(
613
+ // Unwrap the value to get rid of any proxy structures
614
+ sharedClone(valueRef.current, getValue()));
615
+ cb();
616
+ });
617
+ });
618
+ }, []);
619
+ return shim.useSyncExternalStore(getStore, getSnapshot, getSnapshot);
620
+ };
621
+ const [store, setStore] = createStore({
622
+ foo: 'foo',
623
+ bar: {
624
+ baz: 'baz'
625
+ }
626
+ });
627
+ createRoot(() => {
628
+ let prev;
629
+ createEffect(() => {
630
+ console.log('effect');
631
+ const next = sharedClone(prev, store);
632
+ console.log(next);
633
+ prev = untrack(() => next);
634
+ });
635
+ });
636
+ setStore(s => {
637
+ s.foo = '1';
638
+ });
639
+ setStore(s => {
640
+ s.bar.baz = '2';
641
+ });
642
+ function useRouter() {
643
+ const value = React__namespace.useContext(routerContext);
644
+ warning(!value, 'useRouter must be used inside a <Router> component!');
645
+ return value.router;
646
+ }
647
+ function useRouterStore(selector) {
648
+ const router = useRouter();
649
+ return __useStoreValue(() => router.store, selector);
65
650
  }
66
651
 
67
652
  function requiredArgs(required, args) {
@@ -906,7 +1491,7 @@
906
1491
  return JSON.parse(itemValue);
907
1492
  }
908
1493
  return undefined;
909
- } catch (_unused) {
1494
+ } catch {
910
1495
  return undefined;
911
1496
  }
912
1497
  };
@@ -928,14 +1513,13 @@
928
1513
  }
929
1514
  try {
930
1515
  localStorage.setItem(key, JSON.stringify(newVal));
931
- } catch (_unused2) {}
1516
+ } catch {}
932
1517
  return newVal;
933
1518
  });
934
1519
  }, [key]);
935
1520
  return [value, setter];
936
1521
  }
937
1522
 
938
- const _excluded$3 = ["theme"];
939
1523
  const defaultTheme = {
940
1524
  background: '#0b1521',
941
1525
  backgroundAlt: '#132337',
@@ -952,9 +1536,9 @@
952
1536
  const ThemeContext = /*#__PURE__*/React__default["default"].createContext(defaultTheme);
953
1537
  function ThemeProvider(_ref) {
954
1538
  let {
955
- theme
956
- } = _ref,
957
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
1539
+ theme,
1540
+ ...rest
1541
+ } = _ref;
958
1542
  return /*#__PURE__*/React__default["default"].createElement(ThemeContext.Provider, _extends({
959
1543
  value: theme
960
1544
  }, rest));
@@ -1002,10 +1586,9 @@
1002
1586
  return isMatch;
1003
1587
  }
1004
1588
 
1005
- const _excluded$2 = ["style"];
1006
1589
  const isServer$1 = typeof window === 'undefined';
1007
1590
  function getStatusColor(match, theme) {
1008
- return match.isFetching ? theme.active : match.status === 'error' ? theme.danger : match.status === 'success' ? theme.success : theme.gray;
1591
+ return match.store.isFetching ? theme.active : match.store.status === 'error' ? theme.danger : match.store.status === 'success' ? theme.success : theme.gray;
1009
1592
  }
1010
1593
 
1011
1594
  // export function getQueryStatusLabel(query: Query) {
@@ -1024,19 +1607,27 @@
1024
1607
  }
1025
1608
  return /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
1026
1609
  let {
1027
- style
1028
- } = _ref,
1029
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
1610
+ style,
1611
+ ...rest
1612
+ } = _ref;
1030
1613
  const theme = useTheme();
1031
1614
  const mediaStyles = Object.entries(queries).reduce((current, _ref2) => {
1032
1615
  let [key, value] = _ref2;
1033
1616
  // eslint-disable-next-line react-hooks/rules-of-hooks
1034
- return useMediaQuery(key) ? _extends({}, current, typeof value === 'function' ? value(rest, theme) : value) : current;
1617
+ return useMediaQuery(key) ? {
1618
+ ...current,
1619
+ ...(typeof value === 'function' ? value(rest, theme) : value)
1620
+ } : current;
1035
1621
  }, {});
1036
- return /*#__PURE__*/React__default["default"].createElement(type, _extends({}, rest, {
1037
- style: _extends({}, typeof newStyles === 'function' ? newStyles(rest, theme) : newStyles, style, mediaStyles),
1622
+ return /*#__PURE__*/React__default["default"].createElement(type, {
1623
+ ...rest,
1624
+ style: {
1625
+ ...(typeof newStyles === 'function' ? newStyles(rest, theme) : newStyles),
1626
+ ...style,
1627
+ ...mediaStyles
1628
+ },
1038
1629
  ref
1039
- }));
1630
+ });
1040
1631
  });
1041
1632
  }
1042
1633
  function useIsMounted() {
@@ -1057,7 +1648,7 @@
1057
1648
  */
1058
1649
  const displayValue = value => {
1059
1650
  const name = Object.getOwnPropertyNames(Object(value));
1060
- const newValue = typeof value === 'bigint' ? value.toString() + "n" : value;
1651
+ const newValue = typeof value === 'bigint' ? `${value.toString()}n` : value;
1061
1652
  return JSON.stringify(newValue, name);
1062
1653
  };
1063
1654
 
@@ -1118,7 +1709,7 @@
1118
1709
 
1119
1710
  const Panel = styled('div', (_props, theme) => ({
1120
1711
  fontSize: 'clamp(12px, 1.5vw, 14px)',
1121
- fontFamily: "sans-serif",
1712
+ fontFamily: `sans-serif`,
1122
1713
  display: 'flex',
1123
1714
  backgroundColor: theme.background,
1124
1715
  color: theme.foreground
@@ -1140,7 +1731,7 @@
1140
1731
  height: '100%'
1141
1732
  }), {
1142
1733
  '(max-width: 700px)': (_props, theme) => ({
1143
- borderTop: "2px solid " + theme.gray
1734
+ borderTop: `2px solid ${theme.gray}`
1144
1735
  })
1145
1736
  });
1146
1737
  const Button = styled('button', (props, theme) => ({
@@ -1179,26 +1770,26 @@
1179
1770
  borderRadius: '.2em',
1180
1771
  color: theme.inputTextColor,
1181
1772
  fontSize: '.9em',
1182
- lineHeight: "1.3",
1773
+ lineHeight: `1.3`,
1183
1774
  padding: '.3em .4em'
1184
1775
  }));
1185
1776
  styled('select', (_props, theme) => ({
1186
- display: "inline-block",
1187
- fontSize: ".9em",
1188
- fontFamily: "sans-serif",
1777
+ display: `inline-block`,
1778
+ fontSize: `.9em`,
1779
+ fontFamily: `sans-serif`,
1189
1780
  fontWeight: 'normal',
1190
- lineHeight: "1.3",
1191
- padding: ".3em 1.5em .3em .5em",
1781
+ lineHeight: `1.3`,
1782
+ padding: `.3em 1.5em .3em .5em`,
1192
1783
  height: 'auto',
1193
1784
  border: 0,
1194
- borderRadius: ".2em",
1195
- appearance: "none",
1785
+ borderRadius: `.2em`,
1786
+ appearance: `none`,
1196
1787
  WebkitAppearance: 'none',
1197
1788
  backgroundColor: theme.inputBackgroundColor,
1198
- 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>\")",
1199
- backgroundRepeat: "no-repeat",
1200
- backgroundPosition: "right .55em center",
1201
- backgroundSize: ".65em auto, 100%",
1789
+ 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>")`,
1790
+ backgroundRepeat: `no-repeat`,
1791
+ backgroundPosition: `right .55em center`,
1792
+ backgroundSize: `.65em auto, 100%`,
1202
1793
  color: theme.inputTextColor
1203
1794
  }), {
1204
1795
  '(max-width: 500px)': {
@@ -1206,7 +1797,6 @@
1206
1797
  }
1207
1798
  });
1208
1799
 
1209
- const _excluded$1 = ["value", "defaultExpanded", "renderer", "pageSize"];
1210
1800
  const Entry = styled('div', {
1211
1801
  fontFamily: 'Menlo, monospace',
1212
1802
  fontSize: '.7rem',
@@ -1248,11 +1838,12 @@
1248
1838
  style = {}
1249
1839
  } = _ref;
1250
1840
  return /*#__PURE__*/React__namespace.createElement("span", {
1251
- style: _extends({
1841
+ style: {
1252
1842
  display: 'inline-block',
1253
1843
  transition: 'all .1s ease',
1254
- transform: "rotate(" + (expanded ? 90 : 0) + "deg) " + (style.transform || '')
1255
- }, style)
1844
+ transform: `rotate(${expanded ? 90 : 0}deg) ${style.transform || ''}`,
1845
+ ...style
1846
+ }
1256
1847
  }, "\u25B6");
1257
1848
  };
1258
1849
  /**
@@ -1296,7 +1887,7 @@
1296
1887
  onClick: () => toggleExpanded()
1297
1888
  }, /*#__PURE__*/React__namespace.createElement(Expander, {
1298
1889
  expanded: expanded
1299
- }), " ", label, ' ', /*#__PURE__*/React__namespace.createElement(Info, null, String(type).toLowerCase() === 'iterable' ? '(Iterable) ' : '', subEntries.length, " ", subEntries.length > 1 ? "items" : "item")), expanded ? subEntryPages.length === 1 ? /*#__PURE__*/React__namespace.createElement(SubEntries, null, subEntries.map((entry, index) => handleEntry(entry))) : /*#__PURE__*/React__namespace.createElement(SubEntries, null, subEntryPages.map((entries, index) => /*#__PURE__*/React__namespace.createElement("div", {
1890
+ }), " ", label, ' ', /*#__PURE__*/React__namespace.createElement(Info, null, String(type).toLowerCase() === 'iterable' ? '(Iterable) ' : '', subEntries.length, " ", subEntries.length > 1 ? `items` : `item`)), expanded ? subEntryPages.length === 1 ? /*#__PURE__*/React__namespace.createElement(SubEntries, null, subEntries.map((entry, index) => handleEntry(entry))) : /*#__PURE__*/React__namespace.createElement(SubEntries, null, subEntryPages.map((entries, index) => /*#__PURE__*/React__namespace.createElement("div", {
1300
1891
  key: index
1301
1892
  }, /*#__PURE__*/React__namespace.createElement(Entry, null, /*#__PURE__*/React__namespace.createElement(LabelButton, {
1302
1893
  onClick: () => setExpandedPages(old => old.includes(index) ? old.filter(d => d !== index) : [...old, index])
@@ -1321,12 +1912,12 @@
1321
1912
  }
1322
1913
  function Explorer(_ref3) {
1323
1914
  let {
1324
- value,
1325
- defaultExpanded,
1326
- renderer = DefaultRenderer,
1327
- pageSize = 100
1328
- } = _ref3,
1329
- rest = _objectWithoutPropertiesLoose(_ref3, _excluded$1);
1915
+ value,
1916
+ defaultExpanded,
1917
+ renderer = DefaultRenderer,
1918
+ pageSize = 100,
1919
+ ...rest
1920
+ } = _ref3;
1330
1921
  const [expanded, setExpanded] = React__namespace.useState(Boolean(defaultExpanded));
1331
1922
  const toggleExpanded = React__namespace.useCallback(() => setExpanded(old => !old), []);
1332
1923
  let type = typeof value;
@@ -1335,9 +1926,10 @@
1335
1926
  const subDefaultExpanded = defaultExpanded === true ? {
1336
1927
  [sub.label]: true
1337
1928
  } : defaultExpanded == null ? void 0 : defaultExpanded[sub.label];
1338
- return _extends({}, sub, {
1929
+ return {
1930
+ ...sub,
1339
1931
  defaultExpanded: subDefaultExpanded
1340
- });
1932
+ };
1341
1933
  };
1342
1934
  if (Array.isArray(value)) {
1343
1935
  type = 'array';
@@ -1362,7 +1954,7 @@
1362
1954
  });
1363
1955
  }
1364
1956
  const subEntryPages = chunkArray(subEntries, pageSize);
1365
- return renderer(_extends({
1957
+ return renderer({
1366
1958
  handleEntry: entry => /*#__PURE__*/React__namespace.createElement(Explorer, _extends({
1367
1959
  key: entry.label,
1368
1960
  value: value,
@@ -1374,26 +1966,23 @@
1374
1966
  value,
1375
1967
  expanded,
1376
1968
  toggleExpanded,
1377
- pageSize
1378
- }, rest));
1969
+ pageSize,
1970
+ ...rest
1971
+ });
1379
1972
  }
1380
1973
 
1381
- const _excluded = ["style"],
1382
- _excluded2 = ["style", "onClick"],
1383
- _excluded3 = ["style", "onClick"],
1384
- _excluded4 = ["isOpen", "setIsOpen", "handleDragStart", "router"];
1385
1974
  const isServer = typeof window === 'undefined';
1386
1975
  function Logo(props) {
1387
- var _props$style;
1388
1976
  return /*#__PURE__*/React__default["default"].createElement("div", _extends({}, props, {
1389
- style: _extends({}, (_props$style = props.style) != null ? _props$style : {}, {
1977
+ style: {
1978
+ ...(props.style ?? {}),
1390
1979
  display: 'flex',
1391
1980
  alignItems: 'center',
1392
1981
  flexDirection: 'column',
1393
1982
  fontSize: '0.8rem',
1394
1983
  fontWeight: 'bolder',
1395
1984
  lineHeight: '1'
1396
- })
1985
+ }
1397
1986
  }), /*#__PURE__*/React__default["default"].createElement("div", {
1398
1987
  style: {
1399
1988
  letterSpacing: '-0.05rem'
@@ -1429,13 +2018,12 @@
1429
2018
  const [isResolvedOpen, setIsResolvedOpen] = useSafeState(false);
1430
2019
  const [isResizing, setIsResizing] = useSafeState(false);
1431
2020
  const isMounted = useIsMounted();
1432
- const _handleDragStart = (panelElement, startEvent) => {
1433
- var _panelElement$getBoun;
2021
+ const handleDragStart = (panelElement, startEvent) => {
1434
2022
  if (startEvent.button !== 0) return; // Only allow left click for drag
1435
2023
 
1436
2024
  setIsResizing(true);
1437
2025
  const dragInfo = {
1438
- originalHeight: (_panelElement$getBoun = panelElement == null ? void 0 : panelElement.getBoundingClientRect().height) != null ? _panelElement$getBoun : 0,
2026
+ originalHeight: (panelElement == null ? void 0 : panelElement.getBoundingClientRect().height) ?? 0,
1439
2027
  pageY: startEvent.pageY
1440
2028
  };
1441
2029
  const run = moveEvent => {
@@ -1457,7 +2045,7 @@
1457
2045
  document.addEventListener('mouseup', unsub);
1458
2046
  };
1459
2047
  React__default["default"].useEffect(() => {
1460
- setIsResolvedOpen(isOpen != null ? isOpen : false);
2048
+ setIsResolvedOpen(isOpen ?? false);
1461
2049
  }, [isOpen, isResolvedOpen, setIsResolvedOpen]);
1462
2050
 
1463
2051
  // Toggle panel visibility before/after transition (depending on direction).
@@ -1492,7 +2080,7 @@
1492
2080
  var _panelRef$current, _rootRef$current2;
1493
2081
  const containerHeight = (_panelRef$current = panelRef.current) == null ? void 0 : _panelRef$current.getBoundingClientRect().height;
1494
2082
  if ((_rootRef$current2 = rootRef.current) != null && _rootRef$current2.parentElement) {
1495
- rootRef.current.parentElement.style.paddingBottom = containerHeight + "px";
2083
+ rootRef.current.parentElement.style.paddingBottom = `${containerHeight}px`;
1496
2084
  }
1497
2085
  };
1498
2086
  run();
@@ -1510,19 +2098,19 @@
1510
2098
  return;
1511
2099
  }, [isResolvedOpen]);
1512
2100
  const {
1513
- style: panelStyle = {}
1514
- } = panelProps,
1515
- otherPanelProps = _objectWithoutPropertiesLoose(panelProps, _excluded);
2101
+ style: panelStyle = {},
2102
+ ...otherPanelProps
2103
+ } = panelProps;
1516
2104
  const {
1517
- style: closeButtonStyle = {},
1518
- onClick: onCloseClick
1519
- } = closeButtonProps,
1520
- otherCloseButtonProps = _objectWithoutPropertiesLoose(closeButtonProps, _excluded2);
2105
+ style: closeButtonStyle = {},
2106
+ onClick: onCloseClick,
2107
+ ...otherCloseButtonProps
2108
+ } = closeButtonProps;
1521
2109
  const {
1522
- style: toggleButtonStyle = {},
1523
- onClick: onToggleClick
1524
- } = toggleButtonProps,
1525
- otherToggleButtonProps = _objectWithoutPropertiesLoose(toggleButtonProps, _excluded3);
2110
+ style: toggleButtonStyle = {},
2111
+ onClick: onToggleClick,
2112
+ ...otherToggleButtonProps
2113
+ } = toggleButtonProps;
1526
2114
 
1527
2115
  // Do not render on the server
1528
2116
  if (!isMounted()) return null;
@@ -1535,35 +2123,38 @@
1535
2123
  ref: panelRef
1536
2124
  }, otherPanelProps, {
1537
2125
  router: router,
1538
- style: _extends({
2126
+ style: {
1539
2127
  position: 'fixed',
1540
2128
  bottom: '0',
1541
2129
  right: '0',
1542
2130
  zIndex: 99999,
1543
2131
  width: '100%',
1544
- height: devtoolsHeight != null ? devtoolsHeight : 500,
2132
+ height: devtoolsHeight ?? 500,
1545
2133
  maxHeight: '90%',
1546
2134
  boxShadow: '0 0 20px rgba(0,0,0,.3)',
1547
- borderTop: "1px solid " + defaultTheme.gray,
2135
+ borderTop: `1px solid ${defaultTheme.gray}`,
1548
2136
  transformOrigin: 'top',
1549
2137
  // visibility will be toggled after transitions, but set initial state here
1550
- visibility: isOpen ? 'visible' : 'hidden'
1551
- }, panelStyle, isResizing ? {
1552
- transition: "none"
1553
- } : {
1554
- transition: "all .2s ease"
1555
- }, isResolvedOpen ? {
1556
- opacity: 1,
1557
- pointerEvents: 'all',
1558
- transform: "translateY(0) scale(1)"
1559
- } : {
1560
- opacity: 0,
1561
- pointerEvents: 'none',
1562
- transform: "translateY(15px) scale(1.02)"
1563
- }),
2138
+ visibility: isOpen ? 'visible' : 'hidden',
2139
+ ...panelStyle,
2140
+ ...(isResizing ? {
2141
+ transition: `none`
2142
+ } : {
2143
+ transition: `all .2s ease`
2144
+ }),
2145
+ ...(isResolvedOpen ? {
2146
+ opacity: 1,
2147
+ pointerEvents: 'all',
2148
+ transform: `translateY(0) scale(1)`
2149
+ } : {
2150
+ opacity: 0,
2151
+ pointerEvents: 'none',
2152
+ transform: `translateY(15px) scale(1.02)`
2153
+ })
2154
+ },
1564
2155
  isOpen: isResolvedOpen,
1565
2156
  setIsOpen: setIsOpen,
1566
- handleDragStart: e => _handleDragStart(panelRef.current, e)
2157
+ handleDragStart: e => handleDragStart(panelRef.current, e)
1567
2158
  })), isResolvedOpen ? /*#__PURE__*/React__default["default"].createElement(Button, _extends({
1568
2159
  type: "button",
1569
2160
  "aria-label": "Close TanStack Router Devtools"
@@ -1572,20 +2163,22 @@
1572
2163
  setIsOpen(false);
1573
2164
  onCloseClick && onCloseClick(e);
1574
2165
  },
1575
- style: _extends({
2166
+ style: {
1576
2167
  position: 'fixed',
1577
2168
  zIndex: 99999,
1578
2169
  margin: '.5em',
1579
- bottom: 0
1580
- }, position === 'top-right' ? {
1581
- right: '0'
1582
- } : position === 'top-left' ? {
1583
- left: '0'
1584
- } : position === 'bottom-right' ? {
1585
- right: '0'
1586
- } : {
1587
- left: '0'
1588
- }, closeButtonStyle)
2170
+ bottom: 0,
2171
+ ...(position === 'top-right' ? {
2172
+ right: '0'
2173
+ } : position === 'top-left' ? {
2174
+ left: '0'
2175
+ } : position === 'bottom-right' ? {
2176
+ right: '0'
2177
+ } : {
2178
+ left: '0'
2179
+ }),
2180
+ ...closeButtonStyle
2181
+ }
1589
2182
  }), "Close") : null), !isResolvedOpen ? /*#__PURE__*/React__default["default"].createElement("button", _extends({
1590
2183
  type: "button"
1591
2184
  }, otherToggleButtonProps, {
@@ -1594,7 +2187,7 @@
1594
2187
  setIsOpen(true);
1595
2188
  onToggleClick && onToggleClick(e);
1596
2189
  },
1597
- style: _extends({
2190
+ style: {
1598
2191
  appearance: 'none',
1599
2192
  background: 'none',
1600
2193
  border: 0,
@@ -1605,56 +2198,49 @@
1605
2198
  fontSize: '1.5em',
1606
2199
  margin: '.5em',
1607
2200
  cursor: 'pointer',
1608
- width: 'fit-content'
1609
- }, position === 'top-right' ? {
1610
- top: '0',
1611
- right: '0'
1612
- } : position === 'top-left' ? {
1613
- top: '0',
1614
- left: '0'
1615
- } : position === 'bottom-right' ? {
1616
- bottom: '0',
1617
- right: '0'
1618
- } : {
1619
- bottom: '0',
1620
- left: '0'
1621
- }, toggleButtonStyle)
2201
+ width: 'fit-content',
2202
+ ...(position === 'top-right' ? {
2203
+ top: '0',
2204
+ right: '0'
2205
+ } : position === 'top-left' ? {
2206
+ top: '0',
2207
+ left: '0'
2208
+ } : position === 'bottom-right' ? {
2209
+ bottom: '0',
2210
+ right: '0'
2211
+ } : {
2212
+ bottom: '0',
2213
+ left: '0'
2214
+ }),
2215
+ ...toggleButtonStyle
2216
+ }
1622
2217
  }), /*#__PURE__*/React__default["default"].createElement(Logo, {
1623
2218
  "aria-hidden": true
1624
2219
  })) : null);
1625
2220
  }
1626
2221
  const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default["default"].forwardRef(function TanStackRouterDevtoolsPanel(props, ref) {
1627
- var _Object$values$find$m, _Object$values, _Object$values$find, _router$state$current, _router$state$pending, _router$state$pending2, _last, _last2, _last3, _last4, _last5, _last6;
2222
+ var _Object$values, _Object$values$find, _router$store$current, _router$store$pending, _router$store$pending2, _last, _last2, _last3, _last4, _last5, _last6;
1628
2223
  const {
1629
- isOpen = true,
1630
- handleDragStart,
1631
- router: userRouter
1632
- } = props,
1633
- panelProps = _objectWithoutPropertiesLoose(props, _excluded4);
1634
- const routerContextValue = React__default["default"].useContext(reactRouter.routerContext);
1635
- const router = userRouter != null ? userRouter : routerContextValue == null ? void 0 : routerContextValue.router;
1636
- reactRouter.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.');
1637
- const rerender = React__default["default"].useReducer(() => ({}), {})[1];
1638
- React__default["default"].useEffect(() => {
1639
- let interval = setInterval(() => {
1640
- router.cleanMatchCache();
1641
- // router.notify()
1642
- rerender();
1643
- }, 250);
1644
- return () => {
1645
- clearInterval(interval);
1646
- };
1647
- }, []);
2224
+ isOpen = true,
2225
+ setIsOpen,
2226
+ handleDragStart,
2227
+ router: userRouter,
2228
+ ...panelProps
2229
+ } = props;
2230
+ const routerContextValue = React__default["default"].useContext(routerContext);
2231
+ const router = userRouter ?? (routerContextValue == null ? void 0 : routerContextValue.router);
2232
+ 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.');
2233
+ useRouterStore();
1648
2234
  const [activeRouteId, setActiveRouteId] = useLocalStorage('tanstackRouterDevtoolsActiveRouteId', '');
1649
2235
  const [activeMatchId, setActiveMatchId] = useLocalStorage('tanstackRouterDevtoolsActiveMatchId', '');
1650
2236
  React__default["default"].useEffect(() => {
1651
2237
  setActiveMatchId('');
1652
2238
  }, [activeRouteId]);
1653
- const activeMatch = (_Object$values$find$m = (_Object$values = Object.values(router.matchCache)) == null ? void 0 : (_Object$values$find = _Object$values.find(d => d.match.matchId === activeMatchId)) == null ? void 0 : _Object$values$find.match) != null ? _Object$values$find$m : (_router$state$current = router.state.currentMatches) == null ? void 0 : _router$state$current.find(d => d.routeId === activeRouteId);
1654
- const matchCacheValues = multiSortBy(Object.keys(router.matchCache).filter(key => {
1655
- const cacheEntry = router.matchCache[key];
2239
+ const activeMatch = ((_Object$values = Object.values(router.store.matchCache)) == null ? void 0 : (_Object$values$find = _Object$values.find(d => d.match.matchId === activeMatchId)) == null ? void 0 : _Object$values$find.match) ?? ((_router$store$current = router.store.currentMatches) == null ? void 0 : _router$store$current.find(d => d.routeId === activeRouteId));
2240
+ const matchCacheValues = multiSortBy(Object.keys(router.store.matchCache).filter(key => {
2241
+ const cacheEntry = router.store.matchCache[key];
1656
2242
  return cacheEntry.gc > Date.now();
1657
- }).map(key => router.matchCache[key]), [d => d.match.isFetching ? -1 : 1, d => -d.match.updatedAt]);
2243
+ }).map(key => router.store.matchCache[key]), [d => d.match.store.isFetching ? -1 : 1, d => -d.match.store.updatedAt]);
1658
2244
  return /*#__PURE__*/React__default["default"].createElement(ThemeProvider, {
1659
2245
  theme: defaultTheme
1660
2246
  }, /*#__PURE__*/React__default["default"].createElement(Panel, _extends({
@@ -1662,7 +2248,49 @@
1662
2248
  className: "TanStackRouterDevtoolsPanel"
1663
2249
  }, panelProps), /*#__PURE__*/React__default["default"].createElement("style", {
1664
2250
  dangerouslySetInnerHTML: {
1665
- __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 "
2251
+ __html: `
2252
+
2253
+ .TanStackRouterDevtoolsPanel * {
2254
+ scrollbar-color: ${defaultTheme.backgroundAlt} ${defaultTheme.gray};
2255
+ }
2256
+
2257
+ .TanStackRouterDevtoolsPanel *::-webkit-scrollbar, .TanStackRouterDevtoolsPanel scrollbar {
2258
+ width: 1em;
2259
+ height: 1em;
2260
+ }
2261
+
2262
+ .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-track, .TanStackRouterDevtoolsPanel scrollbar-track {
2263
+ background: ${defaultTheme.backgroundAlt};
2264
+ }
2265
+
2266
+ .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-thumb, .TanStackRouterDevtoolsPanel scrollbar-thumb {
2267
+ background: ${defaultTheme.gray};
2268
+ border-radius: .5em;
2269
+ border: 3px solid ${defaultTheme.backgroundAlt};
2270
+ }
2271
+
2272
+ .TanStackRouterDevtoolsPanel table {
2273
+ width: 100%;
2274
+ }
2275
+
2276
+ .TanStackRouterDevtoolsPanel table tr {
2277
+ border-bottom: 2px dotted rgba(255, 255, 255, .2);
2278
+ }
2279
+
2280
+ .TanStackRouterDevtoolsPanel table tr:last-child {
2281
+ border-bottom: none
2282
+ }
2283
+
2284
+ .TanStackRouterDevtoolsPanel table td {
2285
+ padding: .25rem .5rem;
2286
+ border-right: 2px dotted rgba(255, 255, 255, .05);
2287
+ }
2288
+
2289
+ .TanStackRouterDevtoolsPanel table td:last-child {
2290
+ border-right: none
2291
+ }
2292
+
2293
+ `
1666
2294
  }
1667
2295
  }), /*#__PURE__*/React__default["default"].createElement("div", {
1668
2296
  style: {
@@ -1682,7 +2310,7 @@
1682
2310
  minHeight: '40%',
1683
2311
  maxHeight: '100%',
1684
2312
  overflow: 'auto',
1685
- borderRight: "1px solid " + defaultTheme.grayAlt,
2313
+ borderRight: `1px solid ${defaultTheme.grayAlt}`,
1686
2314
  display: 'flex',
1687
2315
  flexDirection: 'column'
1688
2316
  }
@@ -1725,7 +2353,7 @@
1725
2353
  minHeight: '40%',
1726
2354
  maxHeight: '100%',
1727
2355
  overflow: 'auto',
1728
- borderRight: "1px solid " + defaultTheme.grayAlt,
2356
+ borderRight: `1px solid ${defaultTheme.grayAlt}`,
1729
2357
  display: 'flex',
1730
2358
  flexDirection: 'column'
1731
2359
  }
@@ -1737,15 +2365,15 @@
1737
2365
  top: 0,
1738
2366
  zIndex: 1
1739
2367
  }
1740
- }, "Active Matches"), router.state.currentMatches.map((match, i) => {
2368
+ }, "Active Matches"), router.store.currentMatches.map((match, i) => {
1741
2369
  return /*#__PURE__*/React__default["default"].createElement("div", {
1742
2370
  key: match.routeId || i,
1743
2371
  role: "button",
1744
- "aria-label": "Open match details for " + match.routeId,
2372
+ "aria-label": `Open match details for ${match.routeId}`,
1745
2373
  onClick: () => setActiveRouteId(activeRouteId === match.routeId ? '' : match.routeId),
1746
2374
  style: {
1747
2375
  display: 'flex',
1748
- borderBottom: "solid 1px " + defaultTheme.grayAlt,
2376
+ borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
1749
2377
  cursor: 'pointer',
1750
2378
  alignItems: 'center',
1751
2379
  background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
@@ -1767,8 +2395,8 @@
1767
2395
  style: {
1768
2396
  padding: '.5em'
1769
2397
  }
1770
- }, "" + match.matchId));
1771
- }), (_router$state$pending = router.state.pendingMatches) != null && _router$state$pending.length ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
2398
+ }, `${match.matchId}`));
2399
+ }), (_router$store$pending = router.store.pendingMatches) != null && _router$store$pending.length ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
1772
2400
  style: {
1773
2401
  marginTop: '2rem',
1774
2402
  padding: '.5em',
@@ -1777,15 +2405,15 @@
1777
2405
  top: 0,
1778
2406
  zIndex: 1
1779
2407
  }
1780
- }, "Pending Matches"), (_router$state$pending2 = router.state.pendingMatches) == null ? void 0 : _router$state$pending2.map((match, i) => {
2408
+ }, "Pending Matches"), (_router$store$pending2 = router.store.pendingMatches) == null ? void 0 : _router$store$pending2.map((match, i) => {
1781
2409
  return /*#__PURE__*/React__default["default"].createElement("div", {
1782
2410
  key: match.routeId || i,
1783
2411
  role: "button",
1784
- "aria-label": "Open match details for " + match.routeId,
2412
+ "aria-label": `Open match details for ${match.routeId}`,
1785
2413
  onClick: () => setActiveRouteId(activeRouteId === match.routeId ? '' : match.routeId),
1786
2414
  style: {
1787
2415
  display: 'flex',
1788
- borderBottom: "solid 1px " + defaultTheme.grayAlt,
2416
+ borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
1789
2417
  cursor: 'pointer',
1790
2418
  background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
1791
2419
  }
@@ -1806,7 +2434,7 @@
1806
2434
  style: {
1807
2435
  padding: '.5em'
1808
2436
  }
1809
- }, "" + match.matchId));
2437
+ }, `${match.matchId}`));
1810
2438
  })) : null, matchCacheValues.length ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
1811
2439
  style: {
1812
2440
  marginTop: '2rem',
@@ -1822,8 +2450,7 @@
1822
2450
  }
1823
2451
  }, /*#__PURE__*/React__default["default"].createElement("div", null, "Match Cache"), /*#__PURE__*/React__default["default"].createElement(Button, {
1824
2452
  onClick: () => {
1825
- router.matchCache = {};
1826
- router.notify();
2453
+ router.setStore(s => s.matchCache = {});
1827
2454
  }
1828
2455
  }, "Clear")), matchCacheValues.map((d, i) => {
1829
2456
  const {
@@ -1833,11 +2460,11 @@
1833
2460
  return /*#__PURE__*/React__default["default"].createElement("div", {
1834
2461
  key: match.matchId || i,
1835
2462
  role: "button",
1836
- "aria-label": "Open match details for " + match.matchId,
2463
+ "aria-label": `Open match details for ${match.matchId}`,
1837
2464
  onClick: () => setActiveMatchId(activeMatchId === match.matchId ? '' : match.matchId),
1838
2465
  style: {
1839
2466
  display: 'flex',
1840
- borderBottom: "solid 1px " + defaultTheme.grayAlt,
2467
+ borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
1841
2468
  cursor: 'pointer',
1842
2469
  background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
1843
2470
  }
@@ -1866,7 +2493,7 @@
1866
2493
  borderRadius: '.25rem',
1867
2494
  transition: 'all .2s ease-out'
1868
2495
  }
1869
- }), /*#__PURE__*/React__default["default"].createElement(Code, null, "" + match.matchId)), /*#__PURE__*/React__default["default"].createElement("span", {
2496
+ }), /*#__PURE__*/React__default["default"].createElement(Code, null, `${match.matchId}`)), /*#__PURE__*/React__default["default"].createElement("span", {
1870
2497
  style: {
1871
2498
  fontSize: '.7rem',
1872
2499
  opacity: '.5',
@@ -1896,15 +2523,15 @@
1896
2523
  style: {
1897
2524
  opacity: '.5'
1898
2525
  }
1899
- }, "Status"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.status)), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
2526
+ }, "Status"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.store.status)), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
1900
2527
  style: {
1901
2528
  opacity: '.5'
1902
2529
  }
1903
- }, "Invalid"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.isInvalid.toString())), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
2530
+ }, "Invalid"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.store.isInvalid.toString())), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
1904
2531
  style: {
1905
2532
  opacity: '.5'
1906
2533
  }
1907
- }, "Last Updated"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.updatedAt ? new Date(activeMatch.updatedAt).toLocaleTimeString() : 'N/A'))))), /*#__PURE__*/React__default["default"].createElement("div", {
2534
+ }, "Last Updated"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.store.updatedAt ? new Date(activeMatch.store.updatedAt).toLocaleTimeString() : 'N/A'))))), /*#__PURE__*/React__default["default"].createElement("div", {
1908
2535
  style: {
1909
2536
  background: defaultTheme.backgroundAlt,
1910
2537
  padding: '.5em',
@@ -1921,7 +2548,6 @@
1921
2548
  type: "button",
1922
2549
  onClick: () => {
1923
2550
  activeMatch.invalidate();
1924
- router.notify();
1925
2551
  },
1926
2552
  style: {
1927
2553
  background: defaultTheme.warning,
@@ -1956,7 +2582,7 @@
1956
2582
  minHeight: '40%',
1957
2583
  maxHeight: '100%',
1958
2584
  overflow: 'auto',
1959
- borderRight: "1px solid " + defaultTheme.grayAlt,
2585
+ borderRight: `1px solid ${defaultTheme.grayAlt}`,
1960
2586
  display: 'flex',
1961
2587
  flexDirection: 'column'
1962
2588
  }
@@ -1973,9 +2599,9 @@
1973
2599
  style: {
1974
2600
  padding: '.5em'
1975
2601
  }
1976
- }, Object.keys(((_last = reactRouter.last(router.state.currentMatches)) == null ? void 0 : _last.loaderData) || {}).length ? /*#__PURE__*/React__default["default"].createElement(Explorer, {
1977
- value: ((_last2 = reactRouter.last(router.state.currentMatches)) == null ? void 0 : _last2.loaderData) || {},
1978
- defaultExpanded: Object.keys(((_last3 = reactRouter.last(router.state.currentMatches)) == null ? void 0 : _last3.loaderData) || {}).reduce((obj, next) => {
2602
+ }, Object.keys(((_last = last(router.store.currentMatches)) == null ? void 0 : _last.store.loaderData) || {}).length ? /*#__PURE__*/React__default["default"].createElement(Explorer, {
2603
+ value: ((_last2 = last(router.store.currentMatches)) == null ? void 0 : _last2.store.loaderData) || {},
2604
+ defaultExpanded: Object.keys(((_last3 = last(router.store.currentMatches)) == null ? void 0 : _last3.store.loaderData) || {}).reduce((obj, next) => {
1979
2605
  obj[next] = {};
1980
2606
  return obj;
1981
2607
  }, {})
@@ -1996,9 +2622,9 @@
1996
2622
  style: {
1997
2623
  padding: '.5em'
1998
2624
  }
1999
- }, Object.keys(((_last4 = reactRouter.last(router.state.currentMatches)) == null ? void 0 : _last4.search) || {}).length ? /*#__PURE__*/React__default["default"].createElement(Explorer, {
2000
- value: ((_last5 = reactRouter.last(router.state.currentMatches)) == null ? void 0 : _last5.search) || {},
2001
- defaultExpanded: Object.keys(((_last6 = reactRouter.last(router.state.currentMatches)) == null ? void 0 : _last6.search) || {}).reduce((obj, next) => {
2625
+ }, Object.keys(((_last4 = last(router.store.currentMatches)) == null ? void 0 : _last4.store.search) || {}).length ? /*#__PURE__*/React__default["default"].createElement(Explorer, {
2626
+ value: ((_last5 = last(router.store.currentMatches)) == null ? void 0 : _last5.store.search) || {},
2627
+ defaultExpanded: Object.keys(((_last6 = last(router.store.currentMatches)) == null ? void 0 : _last6.store.search) || {}).reduce((obj, next) => {
2002
2628
  obj[next] = {};
2003
2629
  return obj;
2004
2630
  }, {})