@tanstack/solid-query-devtools 5.94.5 → 6.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/dev.cjs CHANGED
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var web = require('solid-js/web');
4
3
  var solidJs = require('solid-js');
5
4
  var solidQuery = require('@tanstack/solid-query');
6
5
  var queryDevtools = require('@tanstack/query-devtools');
@@ -15,6 +14,1241 @@ var __export = (target, all) => {
15
14
  __defProp(target, name, { get: all[name], enumerable: true });
16
15
  };
17
16
 
17
+ // ../../node_modules/.pnpm/@solidjs+signals@0.13.6/node_modules/@solidjs/signals/dist/dev.js
18
+ function actualInsertIntoHeap(n, heap) {
19
+ const parentHeight = (n._parent?._root ? n._parent._parentComputed?._height : n._parent?._height) ?? -1;
20
+ if (parentHeight >= n._height) n._height = parentHeight + 1;
21
+ const height = n._height;
22
+ const heapAtHeight = heap._heap[height];
23
+ if (heapAtHeight === void 0) heap._heap[height] = n;
24
+ else {
25
+ const tail = heapAtHeight._prevHeap;
26
+ tail._nextHeap = n;
27
+ n._prevHeap = tail;
28
+ heapAtHeight._prevHeap = n;
29
+ }
30
+ if (height > heap._max) heap._max = height;
31
+ }
32
+ function insertIntoHeap(n, heap) {
33
+ let flags = n._flags;
34
+ if (flags & (REACTIVE_IN_HEAP | REACTIVE_RECOMPUTING_DEPS)) return;
35
+ if (flags & REACTIVE_CHECK) {
36
+ n._flags = flags & -4 | REACTIVE_DIRTY | REACTIVE_IN_HEAP;
37
+ } else n._flags = flags | REACTIVE_IN_HEAP;
38
+ if (!(flags & REACTIVE_IN_HEAP_HEIGHT)) actualInsertIntoHeap(n, heap);
39
+ }
40
+ function insertIntoHeapHeight(n, heap) {
41
+ let flags = n._flags;
42
+ if (flags & (REACTIVE_IN_HEAP | REACTIVE_RECOMPUTING_DEPS | REACTIVE_IN_HEAP_HEIGHT)) return;
43
+ n._flags = flags | REACTIVE_IN_HEAP_HEIGHT;
44
+ actualInsertIntoHeap(n, heap);
45
+ }
46
+ function deleteFromHeap(n, heap) {
47
+ const flags = n._flags;
48
+ if (!(flags & (REACTIVE_IN_HEAP | REACTIVE_IN_HEAP_HEIGHT))) return;
49
+ n._flags = flags & -25;
50
+ const height = n._height;
51
+ if (n._prevHeap === n) heap._heap[height] = void 0;
52
+ else {
53
+ const next = n._nextHeap;
54
+ const dhh = heap._heap[height];
55
+ const end = next ?? dhh;
56
+ if (n === dhh) heap._heap[height] = next;
57
+ else n._prevHeap._nextHeap = next;
58
+ end._prevHeap = n._prevHeap;
59
+ }
60
+ n._prevHeap = n;
61
+ n._nextHeap = void 0;
62
+ }
63
+ function runHeap(heap, recompute2) {
64
+ heap._marked = false;
65
+ for (heap._min = 0; heap._min <= heap._max; heap._min++) {
66
+ let el = heap._heap[heap._min];
67
+ while (el !== void 0) {
68
+ if (el._flags & REACTIVE_IN_HEAP) recompute2(el);
69
+ else adjustHeight(el, heap);
70
+ el = heap._heap[heap._min];
71
+ }
72
+ }
73
+ heap._max = 0;
74
+ }
75
+ function adjustHeight(el, heap) {
76
+ deleteFromHeap(el, heap);
77
+ let newHeight = el._height;
78
+ for (let d = el._deps; d; d = d._nextDep) {
79
+ const dep1 = d._dep;
80
+ const dep = dep1._firewall || dep1;
81
+ if (dep._fn && dep._height >= newHeight) newHeight = dep._height + 1;
82
+ }
83
+ if (el._height !== newHeight) {
84
+ el._height = newHeight;
85
+ for (let s = el._subs; s !== null; s = s._nextSub) {
86
+ insertIntoHeapHeight(s._sub, heap);
87
+ }
88
+ }
89
+ }
90
+ function runLaneEffects(type) {
91
+ for (const lane of activeLanes) {
92
+ if (lane._mergedInto || lane._pendingAsync.size > 0) continue;
93
+ const effects = lane._effectQueues[type - 1];
94
+ if (effects.length) {
95
+ lane._effectQueues[type - 1] = [];
96
+ runQueue(effects, type);
97
+ }
98
+ }
99
+ }
100
+ function queueStashedOptimisticEffects(node) {
101
+ for (let s = node._subs; s !== null; s = s._nextSub) {
102
+ const sub = s._sub;
103
+ if (!sub._type) continue;
104
+ if (sub._type === EFFECT_TRACKED) {
105
+ if (!sub._modified) {
106
+ sub._modified = true;
107
+ sub._queue.enqueue(EFFECT_USER, sub._run);
108
+ }
109
+ continue;
110
+ }
111
+ const queue = sub._flags & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
112
+ if (queue._min > sub._height) queue._min = sub._height;
113
+ insertIntoHeap(sub, queue);
114
+ }
115
+ }
116
+ function mergeTransitionState(target, outgoing) {
117
+ outgoing._done = target;
118
+ target._actions.push(...outgoing._actions);
119
+ for (const lane of activeLanes) {
120
+ if (lane._transition === outgoing) lane._transition = target;
121
+ }
122
+ target._optimisticNodes.push(...outgoing._optimisticNodes);
123
+ for (const store of outgoing._optimisticStores) target._optimisticStores.add(store);
124
+ for (const node of outgoing._asyncNodes) {
125
+ if (!target._asyncNodes.includes(node)) target._asyncNodes.push(node);
126
+ }
127
+ }
128
+ function resolveOptimisticNodes(nodes) {
129
+ for (let i = 0; i < nodes.length; i++) {
130
+ const node = nodes[i];
131
+ node._optimisticLane = void 0;
132
+ if (node._pendingValue !== NOT_PENDING) {
133
+ node._value = node._pendingValue;
134
+ node._pendingValue = NOT_PENDING;
135
+ }
136
+ const prevOverride = node._overrideValue;
137
+ node._overrideValue = NOT_PENDING;
138
+ if (prevOverride !== NOT_PENDING && node._value !== prevOverride) insertSubs(node, true);
139
+ node._transition = null;
140
+ }
141
+ nodes.length = 0;
142
+ }
143
+ function cleanupCompletedLanes(completingTransition) {
144
+ for (const lane of activeLanes) {
145
+ const owned = completingTransition ? lane._transition === completingTransition : !lane._transition;
146
+ if (!owned) continue;
147
+ if (!lane._mergedInto) {
148
+ if (lane._effectQueues[0].length) runQueue(lane._effectQueues[0], EFFECT_RENDER);
149
+ if (lane._effectQueues[1].length) runQueue(lane._effectQueues[1], EFFECT_USER);
150
+ }
151
+ if (lane._source._optimisticLane === lane) lane._source._optimisticLane = void 0;
152
+ lane._pendingAsync.clear();
153
+ lane._effectQueues[0].length = 0;
154
+ lane._effectQueues[1].length = 0;
155
+ activeLanes.delete(lane);
156
+ signalLanes.delete(lane._source);
157
+ }
158
+ }
159
+ function schedule() {
160
+ if (scheduled) return;
161
+ scheduled = true;
162
+ if (!globalQueue._running && !projectionWriteActive) queueMicrotask(flush);
163
+ }
164
+ function insertSubs(node, optimistic = false) {
165
+ const sourceLane = node._optimisticLane || currentOptimisticLane;
166
+ const hasSnapshot = node._snapshotValue !== void 0;
167
+ for (let s = node._subs; s !== null; s = s._nextSub) {
168
+ if (hasSnapshot && s._sub._inSnapshotScope) {
169
+ s._sub._flags |= REACTIVE_SNAPSHOT_STALE;
170
+ continue;
171
+ }
172
+ if (optimistic && sourceLane) {
173
+ s._sub._flags |= REACTIVE_OPTIMISTIC_DIRTY;
174
+ assignOrMergeLane(s._sub, sourceLane);
175
+ } else if (optimistic) {
176
+ s._sub._flags |= REACTIVE_OPTIMISTIC_DIRTY;
177
+ s._sub._optimisticLane = void 0;
178
+ }
179
+ const sub = s._sub;
180
+ if (sub._type === EFFECT_TRACKED) {
181
+ if (!sub._modified) {
182
+ sub._modified = true;
183
+ sub._queue.enqueue(EFFECT_USER, sub._run);
184
+ }
185
+ continue;
186
+ }
187
+ const queue = s._sub._flags & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
188
+ if (queue._min > s._sub._height) queue._min = s._sub._height;
189
+ insertIntoHeap(s._sub, queue);
190
+ }
191
+ }
192
+ function commitPendingNodes() {
193
+ const pendingNodes = globalQueue._pendingNodes;
194
+ for (let i = 0; i < pendingNodes.length; i++) {
195
+ const n = pendingNodes[i];
196
+ if (n._pendingValue !== NOT_PENDING) {
197
+ n._value = n._pendingValue;
198
+ n._pendingValue = NOT_PENDING;
199
+ if (n._type && n._type !== EFFECT_TRACKED) n._modified = true;
200
+ }
201
+ if (!(n._statusFlags & STATUS_PENDING)) n._statusFlags &= ~STATUS_UNINITIALIZED;
202
+ if (n._fn) GlobalQueue._dispose(n, false, true);
203
+ }
204
+ pendingNodes.length = 0;
205
+ }
206
+ function finalizePureQueue(completingTransition = null, incomplete = false) {
207
+ const resolvePending = !incomplete;
208
+ if (resolvePending) commitPendingNodes();
209
+ if (!incomplete) checkBoundaryChildren(globalQueue);
210
+ if (dirtyQueue._max >= dirtyQueue._min) runHeap(dirtyQueue, GlobalQueue._update);
211
+ if (resolvePending) {
212
+ commitPendingNodes();
213
+ resolveOptimisticNodes(
214
+ completingTransition ? completingTransition._optimisticNodes : globalQueue._optimisticNodes
215
+ );
216
+ const optimisticStores = completingTransition ? completingTransition._optimisticStores : globalQueue._optimisticStores;
217
+ if (GlobalQueue._clearOptimisticStore && optimisticStores.size) {
218
+ for (const store of optimisticStores) {
219
+ GlobalQueue._clearOptimisticStore(store);
220
+ }
221
+ optimisticStores.clear();
222
+ schedule();
223
+ }
224
+ cleanupCompletedLanes(completingTransition);
225
+ }
226
+ }
227
+ function checkBoundaryChildren(queue) {
228
+ for (const child of queue._children) {
229
+ child.checkSources?.();
230
+ checkBoundaryChildren(child);
231
+ }
232
+ }
233
+ function reassignPendingTransition(pendingNodes) {
234
+ for (let i = 0; i < pendingNodes.length; i++) {
235
+ pendingNodes[i]._transition = activeTransition;
236
+ }
237
+ }
238
+ function flush() {
239
+ if (globalQueue._running) {
240
+ if (inTrackedQueueCallback) {
241
+ throw new Error(
242
+ "Cannot call flush() from inside onSettled or createTrackedEffect. flush() is not reentrant there."
243
+ );
244
+ }
245
+ return;
246
+ }
247
+ let count = 0;
248
+ while (scheduled || activeTransition) {
249
+ if (++count === 1e5) throw new Error("Potential Infinite Loop Detected.");
250
+ globalQueue.flush();
251
+ }
252
+ }
253
+ function runQueue(queue, type) {
254
+ for (let i = 0; i < queue.length; i++) queue[i](type);
255
+ }
256
+ function transitionComplete(transition) {
257
+ if (transition._done) return true;
258
+ if (transition._actions.length) return false;
259
+ let done = true;
260
+ for (let i = 0; i < transition._asyncNodes.length; i++) {
261
+ const node = transition._asyncNodes[i];
262
+ if (node._statusFlags & STATUS_PENDING && node._error?.source === node) {
263
+ done = false;
264
+ break;
265
+ }
266
+ }
267
+ if (done) {
268
+ for (let i = 0; i < transition._optimisticNodes.length; i++) {
269
+ const node = transition._optimisticNodes[i];
270
+ if (hasActiveOverride(node) && "_statusFlags" in node && node._statusFlags & STATUS_PENDING && node._error instanceof NotReadyError && node._error.source !== node) {
271
+ done = false;
272
+ break;
273
+ }
274
+ }
275
+ }
276
+ done && (transition._done = true);
277
+ return done;
278
+ }
279
+ function currentTransition(transition) {
280
+ while (transition._done && typeof transition._done === "object") transition = transition._done;
281
+ return transition;
282
+ }
283
+ function runInTransition(transition, fn) {
284
+ const prevTransition = activeTransition;
285
+ try {
286
+ activeTransition = currentTransition(transition);
287
+ return fn();
288
+ } finally {
289
+ activeTransition = prevTransition;
290
+ }
291
+ }
292
+ function getOrCreateLane(signal) {
293
+ let lane = signalLanes.get(signal);
294
+ if (lane) {
295
+ return findLane(lane);
296
+ }
297
+ const parentSource = signal._parentSource;
298
+ const parentLane = parentSource?._optimisticLane ? findLane(parentSource._optimisticLane) : null;
299
+ lane = {
300
+ _source: signal,
301
+ _pendingAsync: /* @__PURE__ */ new Set(),
302
+ _effectQueues: [[], []],
303
+ _mergedInto: null,
304
+ _transition: activeTransition,
305
+ _parentLane: parentLane
306
+ };
307
+ signalLanes.set(signal, lane);
308
+ activeLanes.add(lane);
309
+ signal._overrideSinceLane = false;
310
+ return lane;
311
+ }
312
+ function findLane(lane) {
313
+ while (lane._mergedInto) lane = lane._mergedInto;
314
+ return lane;
315
+ }
316
+ function mergeLanes(lane1, lane2) {
317
+ lane1 = findLane(lane1);
318
+ lane2 = findLane(lane2);
319
+ if (lane1 === lane2) return lane1;
320
+ lane2._mergedInto = lane1;
321
+ for (const node of lane2._pendingAsync) lane1._pendingAsync.add(node);
322
+ lane1._effectQueues[0].push(...lane2._effectQueues[0]);
323
+ lane1._effectQueues[1].push(...lane2._effectQueues[1]);
324
+ return lane1;
325
+ }
326
+ function resolveLane(el) {
327
+ const lane = el._optimisticLane;
328
+ if (!lane) return void 0;
329
+ const root = findLane(lane);
330
+ if (activeLanes.has(root)) return root;
331
+ el._optimisticLane = void 0;
332
+ return void 0;
333
+ }
334
+ function resolveTransition(el) {
335
+ return resolveLane(el)?._transition ?? el._transition;
336
+ }
337
+ function hasActiveOverride(el) {
338
+ return !!(el._overrideValue !== void 0 && el._overrideValue !== NOT_PENDING);
339
+ }
340
+ function assignOrMergeLane(el, sourceLane) {
341
+ const sourceRoot = findLane(sourceLane);
342
+ const existing = el._optimisticLane;
343
+ if (existing) {
344
+ if (existing._mergedInto) {
345
+ el._optimisticLane = sourceLane;
346
+ return;
347
+ }
348
+ const existingRoot = findLane(existing);
349
+ if (activeLanes.has(existingRoot)) {
350
+ if (existingRoot !== sourceRoot && !hasActiveOverride(el)) {
351
+ if (sourceRoot._parentLane && findLane(sourceRoot._parentLane) === existingRoot) {
352
+ el._optimisticLane = sourceLane;
353
+ } else if (existingRoot._parentLane && findLane(existingRoot._parentLane) === sourceRoot) ;
354
+ else mergeLanes(sourceRoot, existingRoot);
355
+ }
356
+ return;
357
+ }
358
+ }
359
+ el._optimisticLane = sourceLane;
360
+ }
361
+ function addPendingSource(el, source) {
362
+ if (el._pendingSource === source || el._pendingSources?.has(source)) return false;
363
+ if (!el._pendingSource) {
364
+ el._pendingSource = source;
365
+ return true;
366
+ }
367
+ if (!el._pendingSources) {
368
+ el._pendingSources = /* @__PURE__ */ new Set([el._pendingSource, source]);
369
+ } else {
370
+ el._pendingSources.add(source);
371
+ }
372
+ el._pendingSource = void 0;
373
+ return true;
374
+ }
375
+ function removePendingSource(el, source) {
376
+ if (el._pendingSource) {
377
+ if (el._pendingSource !== source) return false;
378
+ el._pendingSource = void 0;
379
+ return true;
380
+ }
381
+ if (!el._pendingSources?.delete(source)) return false;
382
+ if (el._pendingSources.size === 1) {
383
+ el._pendingSource = el._pendingSources.values().next().value;
384
+ el._pendingSources = void 0;
385
+ } else if (el._pendingSources.size === 0) {
386
+ el._pendingSources = void 0;
387
+ }
388
+ return true;
389
+ }
390
+ function clearPendingSources(el) {
391
+ el._pendingSource = void 0;
392
+ el._pendingSources?.clear();
393
+ el._pendingSources = void 0;
394
+ }
395
+ function setPendingError(el, source, error) {
396
+ if (!source) {
397
+ el._error = null;
398
+ return;
399
+ }
400
+ if (error instanceof NotReadyError && error.source === source) {
401
+ el._error = error;
402
+ return;
403
+ }
404
+ const current = el._error;
405
+ if (!(current instanceof NotReadyError) || current.source !== source) {
406
+ el._error = new NotReadyError(source);
407
+ }
408
+ }
409
+ function forEachDependent(el, fn) {
410
+ for (let s = el._subs; s !== null; s = s._nextSub) fn(s._sub);
411
+ for (let child = el._child; child !== null; child = child._nextChild) {
412
+ for (let s = child._subs; s !== null; s = s._nextSub) fn(s._sub);
413
+ }
414
+ }
415
+ function settlePendingSource(el) {
416
+ let scheduled2 = false;
417
+ const visited = /* @__PURE__ */ new Set();
418
+ const settle = (node) => {
419
+ if (visited.has(node) || !removePendingSource(node, el)) return;
420
+ visited.add(node);
421
+ node._time = clock;
422
+ const source = node._pendingSource ?? node._pendingSources?.values().next().value;
423
+ if (source) {
424
+ setPendingError(node, source);
425
+ updatePendingSignal(node);
426
+ } else {
427
+ node._statusFlags &= ~STATUS_PENDING;
428
+ setPendingError(node);
429
+ updatePendingSignal(node);
430
+ if (node._blocked) {
431
+ if (node._type === EFFECT_TRACKED) {
432
+ const tracked = node;
433
+ if (!tracked._modified) {
434
+ tracked._modified = true;
435
+ tracked._queue.enqueue(EFFECT_USER, tracked._run);
436
+ }
437
+ } else {
438
+ const queue = node._flags & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
439
+ if (queue._min > node._height) queue._min = node._height;
440
+ insertIntoHeap(node, queue);
441
+ }
442
+ scheduled2 = true;
443
+ }
444
+ node._blocked = false;
445
+ }
446
+ forEachDependent(node, settle);
447
+ };
448
+ forEachDependent(el, settle);
449
+ if (scheduled2) schedule();
450
+ }
451
+ function handleAsync(el, result, setter) {
452
+ const isObject = typeof result === "object" && result !== null;
453
+ const iterator = isObject && untrack(() => result[Symbol.asyncIterator]);
454
+ const isThenable = !iterator && isObject && untrack(() => typeof result.then === "function");
455
+ if (!isThenable && !iterator) {
456
+ el._inFlight = null;
457
+ return result;
458
+ }
459
+ el._inFlight = result;
460
+ let syncValue;
461
+ const handleError = (error) => {
462
+ if (el._inFlight !== result) return;
463
+ globalQueue.initTransition(resolveTransition(el));
464
+ notifyStatus(el, error instanceof NotReadyError ? STATUS_PENDING : STATUS_ERROR, error);
465
+ el._time = clock;
466
+ };
467
+ const asyncWrite = (value, then) => {
468
+ if (el._inFlight !== result) return;
469
+ if (el._flags & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY)) return;
470
+ globalQueue.initTransition(resolveTransition(el));
471
+ clearStatus(el);
472
+ const lane = resolveLane(el);
473
+ if (lane) lane._pendingAsync.delete(el);
474
+ if (el._overrideValue !== void 0) {
475
+ if (el._overrideValue !== void 0 && el._overrideValue !== NOT_PENDING)
476
+ el._pendingValue = value;
477
+ else {
478
+ el._value = value;
479
+ insertSubs(el);
480
+ }
481
+ el._time = clock;
482
+ } else if (lane) {
483
+ const prevValue = el._value;
484
+ const equals = el._equals;
485
+ if (!equals || !equals(value, prevValue)) {
486
+ el._value = value;
487
+ el._time = clock;
488
+ if (el._latestValueComputed) {
489
+ setSignal(el._latestValueComputed, value);
490
+ }
491
+ insertSubs(el, true);
492
+ }
493
+ } else {
494
+ setSignal(el, () => value);
495
+ }
496
+ settlePendingSource(el);
497
+ schedule();
498
+ flush();
499
+ then?.();
500
+ };
501
+ if (isThenable) {
502
+ let resolved = false, isSync = true;
503
+ result.then(
504
+ (v) => {
505
+ if (isSync) {
506
+ syncValue = v;
507
+ resolved = true;
508
+ } else asyncWrite(v);
509
+ },
510
+ (e) => {
511
+ if (!isSync) handleError(e);
512
+ }
513
+ );
514
+ isSync = false;
515
+ if (!resolved) {
516
+ globalQueue.initTransition(resolveTransition(el));
517
+ throw new NotReadyError(context);
518
+ }
519
+ }
520
+ if (iterator) {
521
+ const it = result[Symbol.asyncIterator]();
522
+ let hadSyncValue = false;
523
+ const iterate = () => {
524
+ let syncResult, resolved = false, isSync = true;
525
+ it.next().then(
526
+ (r) => {
527
+ if (isSync) {
528
+ syncResult = r;
529
+ resolved = true;
530
+ } else if (!r.done) asyncWrite(r.value, iterate);
531
+ else {
532
+ schedule();
533
+ flush();
534
+ }
535
+ },
536
+ (e) => {
537
+ if (!isSync) handleError(e);
538
+ }
539
+ );
540
+ isSync = false;
541
+ if (resolved && !syncResult.done) {
542
+ syncValue = syncResult.value;
543
+ hadSyncValue = true;
544
+ return iterate();
545
+ }
546
+ return resolved && syncResult.done;
547
+ };
548
+ const immediatelyDone = iterate();
549
+ if (!hadSyncValue && !immediatelyDone) {
550
+ globalQueue.initTransition(resolveTransition(el));
551
+ throw new NotReadyError(context);
552
+ }
553
+ }
554
+ return syncValue;
555
+ }
556
+ function clearStatus(el, clearUninitialized = false) {
557
+ clearPendingSources(el);
558
+ el._blocked = false;
559
+ el._statusFlags = clearUninitialized ? 0 : el._statusFlags & STATUS_UNINITIALIZED;
560
+ setPendingError(el);
561
+ updatePendingSignal(el);
562
+ el._notifyStatus?.();
563
+ }
564
+ function notifyStatus(el, status, error, blockStatus, lane) {
565
+ if (status === STATUS_ERROR && !(error instanceof StatusError) && !(error instanceof NotReadyError))
566
+ error = new StatusError(el, error);
567
+ const pendingSource = status === STATUS_PENDING && error instanceof NotReadyError ? error.source : void 0;
568
+ const isSource = pendingSource === el;
569
+ const isOptimisticBoundary = status === STATUS_PENDING && el._overrideValue !== void 0 && !isSource;
570
+ const startsBlocking = isOptimisticBoundary && hasActiveOverride(el);
571
+ if (!blockStatus) {
572
+ if (status === STATUS_PENDING && pendingSource) {
573
+ addPendingSource(el, pendingSource);
574
+ el._statusFlags = STATUS_PENDING | el._statusFlags & STATUS_UNINITIALIZED;
575
+ setPendingError(el, pendingSource, error);
576
+ } else {
577
+ clearPendingSources(el);
578
+ el._statusFlags = status | (status !== STATUS_ERROR ? el._statusFlags & STATUS_UNINITIALIZED : 0);
579
+ el._error = error;
580
+ }
581
+ updatePendingSignal(el);
582
+ }
583
+ if (lane && !blockStatus) {
584
+ assignOrMergeLane(el, lane);
585
+ }
586
+ const downstreamBlockStatus = blockStatus || startsBlocking;
587
+ const downstreamLane = blockStatus || isOptimisticBoundary ? void 0 : lane;
588
+ if (el._notifyStatus) {
589
+ if (blockStatus && status === STATUS_PENDING) {
590
+ return;
591
+ }
592
+ if (downstreamBlockStatus) {
593
+ el._notifyStatus(status, error);
594
+ } else {
595
+ el._notifyStatus();
596
+ }
597
+ return;
598
+ }
599
+ forEachDependent(el, (sub) => {
600
+ sub._time = clock;
601
+ if (status === STATUS_PENDING && pendingSource && sub._pendingSource !== pendingSource && !sub._pendingSources?.has(pendingSource) || status !== STATUS_PENDING && (sub._error !== error || sub._pendingSource || sub._pendingSources)) {
602
+ if (!downstreamBlockStatus && !sub._transition) globalQueue._pendingNodes.push(sub);
603
+ notifyStatus(sub, status, error, downstreamBlockStatus, downstreamLane);
604
+ }
605
+ });
606
+ }
607
+ function markDisposal(el) {
608
+ let child = el._firstChild;
609
+ while (child) {
610
+ child._flags |= REACTIVE_ZOMBIE;
611
+ if (child._flags & REACTIVE_IN_HEAP) {
612
+ deleteFromHeap(child, dirtyQueue);
613
+ insertIntoHeap(child, zombieQueue);
614
+ }
615
+ markDisposal(child);
616
+ child = child._nextSibling;
617
+ }
618
+ }
619
+ function disposeChildren(node, self = false, zombie) {
620
+ if (node._flags & REACTIVE_DISPOSED) return;
621
+ if (self) node._flags = REACTIVE_DISPOSED;
622
+ let child = zombie ? node._pendingFirstChild : node._firstChild;
623
+ while (child) {
624
+ const nextChild = child._nextSibling;
625
+ if (child._deps) {
626
+ const n = child;
627
+ deleteFromHeap(n, n._flags & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
628
+ let toRemove = n._deps;
629
+ do {
630
+ toRemove = unlinkSubs(toRemove);
631
+ } while (toRemove !== null);
632
+ n._deps = null;
633
+ n._depsTail = null;
634
+ }
635
+ disposeChildren(child, true);
636
+ child = nextChild;
637
+ }
638
+ if (zombie) {
639
+ node._pendingFirstChild = null;
640
+ } else {
641
+ node._firstChild = null;
642
+ node._childCount = 0;
643
+ }
644
+ runDisposal(node, zombie);
645
+ }
646
+ function runDisposal(node, zombie) {
647
+ let disposal = zombie ? node._pendingDisposal : node._disposal;
648
+ if (!disposal) return;
649
+ if (Array.isArray(disposal)) {
650
+ for (let i = 0; i < disposal.length; i++) {
651
+ const callable = disposal[i];
652
+ callable.call(callable);
653
+ }
654
+ } else {
655
+ disposal.call(disposal);
656
+ }
657
+ zombie ? node._pendingDisposal = null : node._disposal = null;
658
+ }
659
+ function unlinkSubs(link) {
660
+ const dep = link._dep;
661
+ const nextDep = link._nextDep;
662
+ const nextSub = link._nextSub;
663
+ const prevSub = link._prevSub;
664
+ if (nextSub !== null) nextSub._prevSub = prevSub;
665
+ else dep._subsTail = prevSub;
666
+ if (prevSub !== null) prevSub._nextSub = nextSub;
667
+ else {
668
+ dep._subs = nextSub;
669
+ if (nextSub === null) {
670
+ dep._unobserved?.();
671
+ dep._fn && !dep._preventAutoDisposal && !(dep._flags & REACTIVE_ZOMBIE) && unobserved(dep);
672
+ }
673
+ }
674
+ return nextDep;
675
+ }
676
+ function unobserved(el) {
677
+ deleteFromHeap(el, el._flags & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
678
+ let dep = el._deps;
679
+ while (dep !== null) {
680
+ dep = unlinkSubs(dep);
681
+ }
682
+ el._deps = null;
683
+ disposeChildren(el, true);
684
+ }
685
+ function recompute(el, create = false) {
686
+ const isEffect = el._type;
687
+ if (!create) {
688
+ if (el._transition && (!isEffect || activeTransition) && activeTransition !== el._transition)
689
+ globalQueue.initTransition(el._transition);
690
+ deleteFromHeap(el, el._flags & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
691
+ if (el._transition || isEffect === EFFECT_TRACKED) disposeChildren(el);
692
+ else {
693
+ markDisposal(el);
694
+ el._pendingDisposal = el._disposal;
695
+ el._pendingFirstChild = el._firstChild;
696
+ el._disposal = null;
697
+ el._firstChild = null;
698
+ el._childCount = 0;
699
+ }
700
+ }
701
+ const isOptimisticDirty = !!(el._flags & REACTIVE_OPTIMISTIC_DIRTY);
702
+ const hasOverride = el._overrideValue !== void 0 && el._overrideValue !== NOT_PENDING;
703
+ const wasPending = !!(el._statusFlags & STATUS_PENDING);
704
+ const oldcontext = context;
705
+ context = el;
706
+ el._depsTail = null;
707
+ el._flags = REACTIVE_RECOMPUTING_DEPS;
708
+ el._time = clock;
709
+ let value = el._pendingValue === NOT_PENDING ? el._value : el._pendingValue;
710
+ let oldHeight = el._height;
711
+ let prevTracking = tracking;
712
+ let prevLane = currentOptimisticLane;
713
+ let prevStrictRead = false;
714
+ {
715
+ prevStrictRead = strictRead;
716
+ strictRead = false;
717
+ }
718
+ tracking = true;
719
+ if (isOptimisticDirty) {
720
+ const lane = resolveLane(el);
721
+ if (lane) currentOptimisticLane = lane;
722
+ }
723
+ try {
724
+ value = handleAsync(el, el._fn(value));
725
+ clearStatus(el, create);
726
+ const resolvedLane = resolveLane(el);
727
+ if (resolvedLane) {
728
+ resolvedLane._pendingAsync.delete(el);
729
+ updatePendingSignal(resolvedLane._source);
730
+ }
731
+ } catch (e) {
732
+ if (e instanceof NotReadyError && currentOptimisticLane) {
733
+ const lane = findLane(currentOptimisticLane);
734
+ if (lane._source !== el) {
735
+ lane._pendingAsync.add(el);
736
+ el._optimisticLane = lane;
737
+ updatePendingSignal(lane._source);
738
+ }
739
+ }
740
+ if (e instanceof NotReadyError) el._blocked = true;
741
+ notifyStatus(
742
+ el,
743
+ e instanceof NotReadyError ? STATUS_PENDING : STATUS_ERROR,
744
+ e,
745
+ void 0,
746
+ e instanceof NotReadyError ? el._optimisticLane : void 0
747
+ );
748
+ } finally {
749
+ tracking = prevTracking;
750
+ strictRead = prevStrictRead;
751
+ el._flags = REACTIVE_NONE | (create ? el._flags & REACTIVE_SNAPSHOT_STALE : 0);
752
+ context = oldcontext;
753
+ }
754
+ if (!el._error) {
755
+ const depsTail = el._depsTail;
756
+ let toRemove = depsTail !== null ? depsTail._nextDep : el._deps;
757
+ if (toRemove !== null) {
758
+ do {
759
+ toRemove = unlinkSubs(toRemove);
760
+ } while (toRemove !== null);
761
+ if (depsTail !== null) depsTail._nextDep = null;
762
+ else el._deps = null;
763
+ }
764
+ const compareValue = hasOverride ? el._overrideValue : el._pendingValue === NOT_PENDING ? el._value : el._pendingValue;
765
+ const valueChanged = !el._equals || !el._equals(compareValue, value);
766
+ if (valueChanged) {
767
+ const prevVisible = hasOverride ? el._overrideValue : void 0;
768
+ if (create || isEffect && activeTransition !== el._transition || isOptimisticDirty) {
769
+ el._value = value;
770
+ if (hasOverride && isOptimisticDirty) {
771
+ el._overrideValue = value;
772
+ el._pendingValue = value;
773
+ }
774
+ } else el._pendingValue = value;
775
+ if (hasOverride && !isOptimisticDirty && wasPending && !el._overrideSinceLane)
776
+ el._overrideValue = value;
777
+ if (!hasOverride || isOptimisticDirty || el._overrideValue !== prevVisible)
778
+ insertSubs(el, isOptimisticDirty || hasOverride);
779
+ } else if (hasOverride) {
780
+ el._pendingValue = value;
781
+ } else if (el._height != oldHeight) {
782
+ for (let s = el._subs; s !== null; s = s._nextSub) {
783
+ insertIntoHeapHeight(s._sub, s._sub._flags & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
784
+ }
785
+ }
786
+ }
787
+ currentOptimisticLane = prevLane;
788
+ (!create || el._statusFlags & STATUS_PENDING) && !el._transition && !(activeTransition && hasOverride) && globalQueue._pendingNodes.push(el);
789
+ el._transition && isEffect && activeTransition !== el._transition && runInTransition(el._transition, () => recompute(el));
790
+ }
791
+ function untrack(fn, strictReadLabel) {
792
+ if (!externalSourceConfig && !tracking && !strictRead && true) return fn();
793
+ const prevTracking = tracking;
794
+ const prevStrictRead = strictRead;
795
+ tracking = false;
796
+ strictRead = false;
797
+ try {
798
+ if (externalSourceConfig) return externalSourceConfig.untrack(fn);
799
+ return fn();
800
+ } finally {
801
+ tracking = prevTracking;
802
+ strictRead = prevStrictRead;
803
+ }
804
+ }
805
+ function setSignal(el, v) {
806
+ if (!el._pureWrite && !context?._childrenForbidden && context && el._firewall !== context)
807
+ console.warn("A Signal was written to in an owned scope.");
808
+ if (el._transition && activeTransition !== el._transition)
809
+ globalQueue.initTransition(el._transition);
810
+ const isOptimistic = el._overrideValue !== void 0 && !projectionWriteActive;
811
+ const hasOverride = el._overrideValue !== void 0 && el._overrideValue !== NOT_PENDING;
812
+ const currentValue = isOptimistic ? hasOverride ? el._overrideValue : el._value : el._pendingValue === NOT_PENDING ? el._value : el._pendingValue;
813
+ if (typeof v === "function") v = v(currentValue);
814
+ const valueChanged = !el._equals || !el._equals(currentValue, v) || !!(el._statusFlags & STATUS_UNINITIALIZED);
815
+ if (!valueChanged) {
816
+ if (isOptimistic && hasOverride && el._fn) {
817
+ insertSubs(el, true);
818
+ schedule();
819
+ }
820
+ return v;
821
+ }
822
+ if (isOptimistic) {
823
+ const firstOverride = el._overrideValue === NOT_PENDING;
824
+ if (!firstOverride) globalQueue.initTransition(resolveTransition(el));
825
+ if (firstOverride) {
826
+ el._pendingValue = el._value;
827
+ globalQueue._optimisticNodes.push(el);
828
+ }
829
+ el._overrideSinceLane = true;
830
+ const lane = getOrCreateLane(el);
831
+ el._optimisticLane = lane;
832
+ el._overrideValue = v;
833
+ } else {
834
+ if (el._pendingValue === NOT_PENDING) globalQueue._pendingNodes.push(el);
835
+ el._pendingValue = v;
836
+ }
837
+ updatePendingSignal(el);
838
+ if (el._latestValueComputed) {
839
+ setSignal(el._latestValueComputed, v);
840
+ }
841
+ el._time = clock;
842
+ insertSubs(el, isOptimistic);
843
+ schedule();
844
+ return v;
845
+ }
846
+ function computePendingState(el) {
847
+ const comp = el;
848
+ const firewall = el._firewall;
849
+ if (firewall && el._pendingValue !== NOT_PENDING) {
850
+ return !firewall._inFlight && !(firewall._statusFlags & STATUS_PENDING);
851
+ }
852
+ if (el._overrideValue !== void 0 && el._overrideValue !== NOT_PENDING) {
853
+ if (comp._statusFlags & STATUS_PENDING && !(comp._statusFlags & STATUS_UNINITIALIZED))
854
+ return true;
855
+ if (el._parentSource) {
856
+ const lane = el._optimisticLane ? findLane(el._optimisticLane) : null;
857
+ return !!(lane && lane._pendingAsync.size > 0);
858
+ }
859
+ return true;
860
+ }
861
+ if (el._overrideValue !== void 0 && el._overrideValue === NOT_PENDING && !el._parentSource) {
862
+ return false;
863
+ }
864
+ if (el._pendingValue !== NOT_PENDING && !(comp._statusFlags & STATUS_UNINITIALIZED)) return true;
865
+ return !!(comp._statusFlags & STATUS_PENDING && !(comp._statusFlags & STATUS_UNINITIALIZED));
866
+ }
867
+ function updatePendingSignal(el) {
868
+ if (el._pendingSignal) {
869
+ const pending = computePendingState(el);
870
+ const sig = el._pendingSignal;
871
+ setSignal(sig, pending);
872
+ if (!pending && sig._optimisticLane) {
873
+ const sourceLane = resolveLane(el);
874
+ if (sourceLane && sourceLane._pendingAsync.size > 0) {
875
+ const sigLane = findLane(sig._optimisticLane);
876
+ if (sigLane !== sourceLane) {
877
+ mergeLanes(sourceLane, sigLane);
878
+ }
879
+ }
880
+ signalLanes.delete(sig);
881
+ sig._optimisticLane = void 0;
882
+ }
883
+ }
884
+ }
885
+ function isWrappable(obj) {
886
+ return obj != null && typeof obj === "object" && !Object.isFrozen(obj);
887
+ }
888
+ function updatePath(current, args, i = 0) {
889
+ let part, prev = current;
890
+ if (i < args.length - 1) {
891
+ part = args[i];
892
+ const partType = typeof part;
893
+ const isArray = Array.isArray(current);
894
+ if (Array.isArray(part)) {
895
+ for (let j = 0; j < part.length; j++) {
896
+ args[i] = part[j];
897
+ updatePath(current, args, i);
898
+ }
899
+ args[i] = part;
900
+ return;
901
+ } else if (isArray && partType === "function") {
902
+ for (let j = 0; j < current.length; j++) {
903
+ if (part(current[j], j)) {
904
+ args[i] = j;
905
+ updatePath(current, args, i);
906
+ }
907
+ }
908
+ args[i] = part;
909
+ return;
910
+ } else if (isArray && partType === "object") {
911
+ const { from = 0, to = current.length - 1, by = 1 } = part;
912
+ for (let j = from; j <= to; j += by) {
913
+ args[i] = j;
914
+ updatePath(current, args, i);
915
+ }
916
+ args[i] = part;
917
+ return;
918
+ } else if (i < args.length - 2) {
919
+ updatePath(current[part], args, i + 1);
920
+ return;
921
+ }
922
+ prev = current[part];
923
+ }
924
+ let value = args[args.length - 1];
925
+ if (typeof value === "function") {
926
+ value = value(prev);
927
+ if (value === prev) return;
928
+ }
929
+ if (part === void 0 && value == void 0) return;
930
+ if (value === DELETE) {
931
+ delete current[part];
932
+ } else if (part === void 0 || isWrappable(prev) && isWrappable(value) && !Array.isArray(value)) {
933
+ const target = part !== void 0 ? current[part] : current;
934
+ const keys = Object.keys(value);
935
+ for (let i2 = 0; i2 < keys.length; i2++) target[keys[i2]] = value[keys[i2]];
936
+ } else {
937
+ current[part] = value;
938
+ }
939
+ }
940
+ var NotReadyError, StatusError, REACTIVE_NONE, REACTIVE_CHECK, REACTIVE_DIRTY, REACTIVE_RECOMPUTING_DEPS, REACTIVE_IN_HEAP, REACTIVE_IN_HEAP_HEIGHT, REACTIVE_ZOMBIE, REACTIVE_DISPOSED, REACTIVE_OPTIMISTIC_DIRTY, REACTIVE_SNAPSHOT_STALE, STATUS_PENDING, STATUS_ERROR, STATUS_UNINITIALIZED, EFFECT_RENDER, EFFECT_USER, EFFECT_TRACKED, NOT_PENDING, transitions, dirtyQueue, zombieQueue, clock, activeTransition, scheduled, projectionWriteActive, inTrackedQueueCallback, stashedOptimisticReads, Queue, GlobalQueue, globalQueue, signalLanes, activeLanes, externalSourceConfig, tracking, context, currentOptimisticLane, strictRead, DELETE;
941
+ var init_dev = __esm({
942
+ "../../node_modules/.pnpm/@solidjs+signals@0.13.6/node_modules/@solidjs/signals/dist/dev.js"() {
943
+ NotReadyError = class extends Error {
944
+ source;
945
+ constructor(source) {
946
+ super();
947
+ this.source = source;
948
+ }
949
+ };
950
+ StatusError = class extends Error {
951
+ source;
952
+ constructor(source, original) {
953
+ super(original instanceof Error ? original.message : String(original), { cause: original });
954
+ this.source = source;
955
+ }
956
+ };
957
+ REACTIVE_NONE = 0;
958
+ REACTIVE_CHECK = 1 << 0;
959
+ REACTIVE_DIRTY = 1 << 1;
960
+ REACTIVE_RECOMPUTING_DEPS = 1 << 2;
961
+ REACTIVE_IN_HEAP = 1 << 3;
962
+ REACTIVE_IN_HEAP_HEIGHT = 1 << 4;
963
+ REACTIVE_ZOMBIE = 1 << 5;
964
+ REACTIVE_DISPOSED = 1 << 6;
965
+ REACTIVE_OPTIMISTIC_DIRTY = 1 << 7;
966
+ REACTIVE_SNAPSHOT_STALE = 1 << 8;
967
+ STATUS_PENDING = 1 << 0;
968
+ STATUS_ERROR = 1 << 1;
969
+ STATUS_UNINITIALIZED = 1 << 2;
970
+ EFFECT_RENDER = 1;
971
+ EFFECT_USER = 2;
972
+ EFFECT_TRACKED = 3;
973
+ NOT_PENDING = {};
974
+ transitions = /* @__PURE__ */ new Set();
975
+ dirtyQueue = { _heap: new Array(2e3).fill(void 0), _marked: false, _min: 0, _max: 0 };
976
+ zombieQueue = { _heap: new Array(2e3).fill(void 0), _marked: false, _min: 0, _max: 0 };
977
+ clock = 0;
978
+ activeTransition = null;
979
+ scheduled = false;
980
+ projectionWriteActive = false;
981
+ inTrackedQueueCallback = false;
982
+ stashedOptimisticReads = null;
983
+ Queue = class {
984
+ _parent = null;
985
+ _queues = [[], []];
986
+ _children = [];
987
+ created = clock;
988
+ addChild(child) {
989
+ this._children.push(child);
990
+ child._parent = this;
991
+ }
992
+ removeChild(child) {
993
+ const index = this._children.indexOf(child);
994
+ if (index >= 0) {
995
+ this._children.splice(index, 1);
996
+ child._parent = null;
997
+ }
998
+ }
999
+ notify(node, mask, flags, error) {
1000
+ if (this._parent) return this._parent.notify(node, mask, flags, error);
1001
+ return false;
1002
+ }
1003
+ run(type) {
1004
+ if (this._queues[type - 1].length) {
1005
+ const effects = this._queues[type - 1];
1006
+ this._queues[type - 1] = [];
1007
+ runQueue(effects, type);
1008
+ }
1009
+ for (let i = 0; i < this._children.length; i++) this._children[i].run?.(type);
1010
+ }
1011
+ enqueue(type, fn) {
1012
+ if (type) {
1013
+ if (currentOptimisticLane) {
1014
+ const lane = findLane(currentOptimisticLane);
1015
+ lane._effectQueues[type - 1].push(fn);
1016
+ } else {
1017
+ this._queues[type - 1].push(fn);
1018
+ }
1019
+ }
1020
+ schedule();
1021
+ }
1022
+ stashQueues(stub) {
1023
+ stub._queues[0].push(...this._queues[0]);
1024
+ stub._queues[1].push(...this._queues[1]);
1025
+ this._queues = [[], []];
1026
+ for (let i = 0; i < this._children.length; i++) {
1027
+ let child = this._children[i];
1028
+ let childStub = stub._children[i];
1029
+ if (!childStub) {
1030
+ childStub = { _queues: [[], []], _children: [] };
1031
+ stub._children[i] = childStub;
1032
+ }
1033
+ child.stashQueues(childStub);
1034
+ }
1035
+ }
1036
+ restoreQueues(stub) {
1037
+ this._queues[0].push(...stub._queues[0]);
1038
+ this._queues[1].push(...stub._queues[1]);
1039
+ for (let i = 0; i < stub._children.length; i++) {
1040
+ const childStub = stub._children[i];
1041
+ let child = this._children[i];
1042
+ if (child) child.restoreQueues(childStub);
1043
+ }
1044
+ }
1045
+ };
1046
+ GlobalQueue = class _GlobalQueue extends Queue {
1047
+ _running = false;
1048
+ _pendingNodes = [];
1049
+ _optimisticNodes = [];
1050
+ _optimisticStores = /* @__PURE__ */ new Set();
1051
+ static _update;
1052
+ static _dispose;
1053
+ static _clearOptimisticStore = null;
1054
+ flush() {
1055
+ if (this._running) return;
1056
+ this._running = true;
1057
+ try {
1058
+ runHeap(dirtyQueue, _GlobalQueue._update);
1059
+ if (activeTransition) {
1060
+ const isComplete = transitionComplete(activeTransition);
1061
+ if (!isComplete) {
1062
+ const stashedTransition = activeTransition;
1063
+ runHeap(zombieQueue, _GlobalQueue._update);
1064
+ this._pendingNodes = [];
1065
+ this._optimisticNodes = [];
1066
+ this._optimisticStores = /* @__PURE__ */ new Set();
1067
+ runLaneEffects(EFFECT_RENDER);
1068
+ runLaneEffects(EFFECT_USER);
1069
+ this.stashQueues(stashedTransition._queueStash);
1070
+ clock++;
1071
+ scheduled = dirtyQueue._max >= dirtyQueue._min;
1072
+ reassignPendingTransition(stashedTransition._pendingNodes);
1073
+ activeTransition = null;
1074
+ if (!stashedTransition._actions.length && stashedTransition._optimisticNodes.length) {
1075
+ stashedOptimisticReads = /* @__PURE__ */ new Set();
1076
+ for (let i = 0; i < stashedTransition._optimisticNodes.length; i++) {
1077
+ const node = stashedTransition._optimisticNodes[i];
1078
+ if (node._fn || node._pureWrite) continue;
1079
+ stashedOptimisticReads.add(node);
1080
+ queueStashedOptimisticEffects(node);
1081
+ }
1082
+ }
1083
+ try {
1084
+ finalizePureQueue(null, true);
1085
+ } finally {
1086
+ stashedOptimisticReads = null;
1087
+ }
1088
+ return;
1089
+ }
1090
+ this._pendingNodes !== activeTransition._pendingNodes && this._pendingNodes.push(...activeTransition._pendingNodes);
1091
+ this.restoreQueues(activeTransition._queueStash);
1092
+ transitions.delete(activeTransition);
1093
+ const completingTransition = activeTransition;
1094
+ activeTransition = null;
1095
+ reassignPendingTransition(this._pendingNodes);
1096
+ finalizePureQueue(completingTransition);
1097
+ } else {
1098
+ if (transitions.size) runHeap(zombieQueue, _GlobalQueue._update);
1099
+ finalizePureQueue();
1100
+ }
1101
+ clock++;
1102
+ scheduled = dirtyQueue._max >= dirtyQueue._min;
1103
+ runLaneEffects(EFFECT_RENDER);
1104
+ this.run(EFFECT_RENDER);
1105
+ runLaneEffects(EFFECT_USER);
1106
+ this.run(EFFECT_USER);
1107
+ } finally {
1108
+ this._running = false;
1109
+ }
1110
+ }
1111
+ notify(node, mask, flags, error) {
1112
+ if (mask & STATUS_PENDING) {
1113
+ if (flags & STATUS_PENDING) {
1114
+ const actualError = error !== void 0 ? error : node._error;
1115
+ if (activeTransition && actualError) {
1116
+ const source = actualError.source;
1117
+ if (!activeTransition._asyncNodes.includes(source)) {
1118
+ activeTransition._asyncNodes.push(source);
1119
+ schedule();
1120
+ }
1121
+ }
1122
+ }
1123
+ return true;
1124
+ }
1125
+ return false;
1126
+ }
1127
+ initTransition(transition) {
1128
+ if (transition) transition = currentTransition(transition);
1129
+ if (transition && transition === activeTransition) return;
1130
+ if (!transition && activeTransition && activeTransition._time === clock) return;
1131
+ if (!activeTransition) {
1132
+ activeTransition = transition ?? {
1133
+ _time: clock,
1134
+ _pendingNodes: [],
1135
+ _asyncNodes: [],
1136
+ _optimisticNodes: [],
1137
+ _optimisticStores: /* @__PURE__ */ new Set(),
1138
+ _actions: [],
1139
+ _queueStash: { _queues: [[], []], _children: [] },
1140
+ _done: false
1141
+ };
1142
+ } else if (transition) {
1143
+ const outgoing = activeTransition;
1144
+ mergeTransitionState(transition, outgoing);
1145
+ transitions.delete(outgoing);
1146
+ activeTransition = transition;
1147
+ }
1148
+ transitions.add(activeTransition);
1149
+ activeTransition._time = clock;
1150
+ if (this._pendingNodes !== activeTransition._pendingNodes) {
1151
+ for (let i = 0; i < this._pendingNodes.length; i++) {
1152
+ const node = this._pendingNodes[i];
1153
+ node._transition = activeTransition;
1154
+ activeTransition._pendingNodes.push(node);
1155
+ }
1156
+ this._pendingNodes = activeTransition._pendingNodes;
1157
+ }
1158
+ if (this._optimisticNodes !== activeTransition._optimisticNodes) {
1159
+ for (let i = 0; i < this._optimisticNodes.length; i++) {
1160
+ const node = this._optimisticNodes[i];
1161
+ node._transition = activeTransition;
1162
+ activeTransition._optimisticNodes.push(node);
1163
+ }
1164
+ this._optimisticNodes = activeTransition._optimisticNodes;
1165
+ }
1166
+ for (const lane of activeLanes) {
1167
+ if (!lane._transition) lane._transition = activeTransition;
1168
+ }
1169
+ if (this._optimisticStores !== activeTransition._optimisticStores) {
1170
+ for (const store of this._optimisticStores) activeTransition._optimisticStores.add(store);
1171
+ this._optimisticStores = activeTransition._optimisticStores;
1172
+ }
1173
+ }
1174
+ };
1175
+ globalQueue = new GlobalQueue();
1176
+ signalLanes = /* @__PURE__ */ new WeakMap();
1177
+ activeLanes = /* @__PURE__ */ new Set();
1178
+ externalSourceConfig = null;
1179
+ GlobalQueue._update = recompute;
1180
+ GlobalQueue._dispose = disposeChildren;
1181
+ tracking = false;
1182
+ context = null;
1183
+ currentOptimisticLane = null;
1184
+ strictRead = false;
1185
+ DELETE = /* @__PURE__ */ Symbol("STORE_PATH_DELETE");
1186
+ Object.assign(
1187
+ function storePath2(...args) {
1188
+ return (state) => {
1189
+ updatePath(state, args);
1190
+ };
1191
+ },
1192
+ { DELETE }
1193
+ );
1194
+ }
1195
+ });
1196
+ function template(html, isImportNode, isSVG, isMathML) {
1197
+ let node;
1198
+ const create = (bypassGuard) => {
1199
+ if (isHydrating() && !bypassGuard) throw new Error("Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration.");
1200
+ const t = document.createElement("template");
1201
+ t.innerHTML = html;
1202
+ return t.content.firstChild;
1203
+ };
1204
+ const fn = isImportNode ? (bypassGuard) => solidJs.untrack(() => document.importNode(node || (node = create(bypassGuard)), true)) : (bypassGuard) => (node || (node = create(bypassGuard))).cloneNode(true);
1205
+ fn._html = html;
1206
+ return fn;
1207
+ }
1208
+ function setAttribute(node, name, value) {
1209
+ if (isHydrating(node)) return;
1210
+ node.removeAttribute(name);
1211
+ }
1212
+ function style(node, value, prev) {
1213
+ if (!value) {
1214
+ if (prev) setAttribute(node, "style");
1215
+ return;
1216
+ }
1217
+ const nodeStyle = node.style;
1218
+ if (typeof value === "string") return nodeStyle.cssText = value;
1219
+ typeof prev === "string" && (nodeStyle.cssText = prev = void 0);
1220
+ prev || (prev = {});
1221
+ value || (value = {});
1222
+ let v, s;
1223
+ for (s in value) {
1224
+ v = value[s];
1225
+ if (v !== prev[s]) nodeStyle.setProperty(s, v);
1226
+ delete prev[s];
1227
+ }
1228
+ for (s in prev) value[s] == null && nodeStyle.removeProperty(s);
1229
+ }
1230
+ function applyRef(r, element) {
1231
+ Array.isArray(r) ? r.flat(Infinity).forEach((f) => f && f(element)) : r(element);
1232
+ }
1233
+ function ref(fn, element) {
1234
+ const resolved = solidJs.untrack(fn);
1235
+ solidJs.runWithOwner(null, () => applyRef(resolved, element));
1236
+ }
1237
+ function isHydrating(node) {
1238
+ return solidJs.sharedConfig.hydrating && (!node || node.isConnected);
1239
+ }
1240
+ var effect, isServer, isDev;
1241
+ var init_dev2 = __esm({
1242
+ "../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.4_@solidjs+signals@0.13.6_solid-js@2.0.0-beta.4/node_modules/@solidjs/web/dist/dev.js"() {
1243
+ init_dev();
1244
+ effect = (fn, effectFn, initial) => solidJs.createRenderEffect(fn, effectFn, initial, {
1245
+ transparent: true
1246
+ });
1247
+ isServer = false;
1248
+ isDev = true;
1249
+ }
1250
+ });
1251
+
18
1252
  // src/devtools.tsx
19
1253
  var devtools_exports = {};
20
1254
  __export(devtools_exports, {
@@ -23,7 +1257,7 @@ __export(devtools_exports, {
23
1257
  function SolidQueryDevtools(props) {
24
1258
  const queryClient = solidQuery.useQueryClient(props.client);
25
1259
  const client = solidJs.createMemo(() => queryClient);
26
- let ref;
1260
+ let ref2;
27
1261
  const devtools = new queryDevtools.TanstackQueryDevtools({
28
1262
  client: client(),
29
1263
  queryFlavor: "Solid Query",
@@ -38,45 +1272,54 @@ function SolidQueryDevtools(props) {
38
1272
  hideDisabledQueries: props.hideDisabledQueries,
39
1273
  theme: props.theme
40
1274
  });
41
- solidJs.createEffect(() => {
42
- devtools.setClient(client());
1275
+ solidJs.createEffect(() => client(), (c) => {
1276
+ devtools.setClient(c);
43
1277
  });
44
- solidJs.createEffect(() => {
45
- const buttonPos = props.buttonPosition;
1278
+ solidJs.createEffect(() => props.buttonPosition, (buttonPos) => {
46
1279
  if (buttonPos) {
47
1280
  devtools.setButtonPosition(buttonPos);
48
1281
  }
49
1282
  });
50
- solidJs.createEffect(() => {
51
- const pos = props.position;
1283
+ solidJs.createEffect(() => props.position, (pos) => {
52
1284
  if (pos) {
53
1285
  devtools.setPosition(pos);
54
1286
  }
55
1287
  });
56
- solidJs.createEffect(() => {
57
- devtools.setInitialIsOpen(props.initialIsOpen || false);
1288
+ solidJs.createEffect(() => props.initialIsOpen, (initialIsOpen) => {
1289
+ devtools.setInitialIsOpen(initialIsOpen || false);
58
1290
  });
59
- solidJs.createEffect(() => {
60
- devtools.setErrorTypes(props.errorTypes || []);
1291
+ solidJs.createEffect(() => props.errorTypes, (errorTypes) => {
1292
+ devtools.setErrorTypes(errorTypes || []);
61
1293
  });
62
- solidJs.createEffect(() => {
63
- devtools.setTheme(props.theme || "system");
1294
+ solidJs.createEffect(() => props.theme, (theme) => {
1295
+ devtools.setTheme(theme || "system");
64
1296
  });
65
- solidJs.onMount(() => {
66
- devtools.mount(ref);
67
- solidJs.onCleanup(() => devtools.unmount());
1297
+ let isMounted = false;
1298
+ let isDisposed = false;
1299
+ queueMicrotask(() => {
1300
+ if (isDisposed) return;
1301
+ devtools.mount(ref2);
1302
+ isMounted = true;
1303
+ });
1304
+ solidJs.onCleanup(() => {
1305
+ isDisposed = true;
1306
+ if (isMounted) {
1307
+ devtools.unmount();
1308
+ }
68
1309
  });
69
1310
  return (() => {
70
1311
  var _el$ = _tmpl$();
71
- var _ref$ = ref;
72
- typeof _ref$ === "function" ? web.use(_ref$, _el$) : ref = _el$;
1312
+ var _ref$ = ref2;
1313
+ typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
73
1314
  return _el$;
74
1315
  })();
75
1316
  }
76
1317
  var _tmpl$;
77
1318
  var init_devtools = __esm({
78
1319
  "src/devtools.tsx"() {
79
- _tmpl$ = /* @__PURE__ */ web.template(`<div class=tsqd-parent-container>`);
1320
+ init_dev2();
1321
+ init_dev2();
1322
+ _tmpl$ = /* @__PURE__ */ template(`<div class=tsqd-parent-container>`);
80
1323
  }
81
1324
  });
82
1325
 
@@ -88,7 +1331,7 @@ __export(devtoolsPanel_exports, {
88
1331
  function SolidQueryDevtoolsPanel(props) {
89
1332
  const queryClient = solidQuery.useQueryClient(props.client);
90
1333
  const client = solidJs.createMemo(() => queryClient);
91
- let ref;
1334
+ let ref2;
92
1335
  const {
93
1336
  errorTypes,
94
1337
  styleNonce,
@@ -110,58 +1353,81 @@ function SolidQueryDevtoolsPanel(props) {
110
1353
  hideDisabledQueries,
111
1354
  theme: props.theme
112
1355
  });
113
- solidJs.createEffect(() => {
114
- devtools.setClient(client());
1356
+ solidJs.createEffect(() => client(), (c) => {
1357
+ devtools.setClient(c);
115
1358
  });
116
- solidJs.createEffect(() => {
117
- devtools.setOnClose(props.onClose ?? (() => {
1359
+ solidJs.createEffect(() => props.onClose, (onClose) => {
1360
+ devtools.setOnClose(onClose ?? (() => {
118
1361
  }));
119
1362
  });
120
- solidJs.createEffect(() => {
121
- devtools.setErrorTypes(props.errorTypes || []);
1363
+ solidJs.createEffect(() => props.errorTypes, (errorTypes2) => {
1364
+ devtools.setErrorTypes(errorTypes2 || []);
122
1365
  });
123
- solidJs.createEffect(() => {
124
- devtools.setTheme(props.theme || "system");
1366
+ solidJs.createEffect(() => props.theme, (theme) => {
1367
+ devtools.setTheme(theme || "system");
125
1368
  });
126
- solidJs.onMount(() => {
127
- devtools.mount(ref);
128
- solidJs.onCleanup(() => devtools.unmount());
1369
+ let isMounted = false;
1370
+ let isDisposed = false;
1371
+ queueMicrotask(() => {
1372
+ if (isDisposed) return;
1373
+ devtools.mount(ref2);
1374
+ isMounted = true;
1375
+ });
1376
+ solidJs.onCleanup(() => {
1377
+ isDisposed = true;
1378
+ if (isMounted) {
1379
+ devtools.unmount();
1380
+ }
129
1381
  });
130
1382
  return (() => {
131
1383
  var _el$ = _tmpl$2();
132
- var _ref$ = ref;
133
- typeof _ref$ === "function" ? web.use(_ref$, _el$) : ref = _el$;
134
- web.effect((_$p) => web.style(_el$, {
1384
+ var _ref$ = ref2;
1385
+ typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
1386
+ effect(() => ({
135
1387
  ...props.style
136
- }, _$p));
1388
+ }), (_v$, _$p) => {
1389
+ style(_el$, _v$, _$p);
1390
+ });
137
1391
  return _el$;
138
1392
  })();
139
1393
  }
140
1394
  var _tmpl$2;
141
1395
  var init_devtoolsPanel = __esm({
142
1396
  "src/devtoolsPanel.tsx"() {
143
- _tmpl$2 = /* @__PURE__ */ web.template(`<div class=tsqd-parent-container style=height:500px>`);
1397
+ init_dev2();
1398
+ init_dev2();
1399
+ init_dev2();
1400
+ init_dev2();
1401
+ _tmpl$2 = /* @__PURE__ */ template(`<div class=tsqd-parent-container style=height:500px>`);
144
1402
  }
145
1403
  });
1404
+
1405
+ // src/index.tsx
1406
+ init_dev2();
1407
+
1408
+ // src/clientOnly.tsx
1409
+ init_dev2();
146
1410
  function clientOnly(fn) {
147
- if (web.isServer) return (props) => props.fallback;
1411
+ if (isServer) return (props) => props.fallback;
148
1412
  const [comp, setComp] = solidJs.createSignal();
149
1413
  fn().then((m) => setComp(() => m.default));
150
1414
  return (props) => {
151
1415
  let Comp;
152
1416
  let m;
153
- const [, rest] = solidJs.splitProps(props, ["fallback"]);
154
- if ((Comp = comp()) && !solidJs.sharedConfig.context) return Comp(rest);
155
- const [mounted, setMounted] = solidJs.createSignal(!solidJs.sharedConfig.context);
156
- solidJs.onMount(() => setMounted(true));
1417
+ const rest = solidJs.omit(props, "fallback");
1418
+ if ((Comp = comp()) && !solidJs.sharedConfig.hydrating) return Comp(rest);
1419
+ const [mounted, setMounted] = solidJs.createSignal(!solidJs.sharedConfig.hydrating);
1420
+ solidJs.onSettled(() => {
1421
+ setMounted(true);
1422
+ });
157
1423
  return solidJs.createMemo(() => (Comp = comp(), m = mounted(), solidJs.untrack(() => Comp && m ? Comp(rest) : props.fallback)));
158
1424
  };
159
1425
  }
160
1426
 
161
1427
  // src/index.tsx
162
- exports.SolidQueryDevtools = web.isDev ? clientOnly(() => Promise.resolve().then(() => (init_devtools(), devtools_exports))) : function() {
1428
+ exports.SolidQueryDevtools = isDev ? clientOnly(() => Promise.resolve().then(() => (init_devtools(), devtools_exports))) : function() {
163
1429
  return null;
164
1430
  };
165
- exports.SolidQueryDevtoolsPanel = web.isDev ? clientOnly(() => Promise.resolve().then(() => (init_devtoolsPanel(), devtoolsPanel_exports))) : function() {
1431
+ exports.SolidQueryDevtoolsPanel = isDev ? clientOnly(() => Promise.resolve().then(() => (init_devtoolsPanel(), devtoolsPanel_exports))) : function() {
166
1432
  return null;
167
1433
  };