solid-js 1.8.7 → 1.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/dev.cjs +30 -20
  2. package/dist/dev.js +327 -552
  3. package/dist/server.js +75 -170
  4. package/dist/solid.cjs +30 -20
  5. package/dist/solid.js +285 -479
  6. package/h/dist/h.js +8 -34
  7. package/h/jsx-runtime/dist/jsx.js +1 -1
  8. package/h/jsx-runtime/types/index.d.ts +8 -11
  9. package/h/jsx-runtime/types/jsx.d.ts +15 -1
  10. package/h/types/hyperscript.d.ts +11 -11
  11. package/html/dist/html.js +94 -216
  12. package/html/types/lit.d.ts +33 -47
  13. package/package.json +2 -2
  14. package/store/dist/dev.cjs +3 -2
  15. package/store/dist/dev.js +44 -115
  16. package/store/dist/server.js +8 -19
  17. package/store/dist/store.cjs +3 -2
  18. package/store/dist/store.js +41 -106
  19. package/store/types/index.d.ts +7 -21
  20. package/store/types/modifiers.d.ts +3 -6
  21. package/store/types/mutable.d.ts +2 -5
  22. package/store/types/server.d.ts +4 -12
  23. package/store/types/store.d.ts +61 -218
  24. package/types/index.d.ts +10 -75
  25. package/types/jsx.d.ts +15 -1
  26. package/types/reactive/array.d.ts +4 -12
  27. package/types/reactive/observable.d.ts +17 -25
  28. package/types/reactive/scheduler.d.ts +6 -9
  29. package/types/reactive/signal.d.ts +142 -231
  30. package/types/render/Suspense.d.ts +5 -5
  31. package/types/render/component.d.ts +33 -62
  32. package/types/render/flow.d.ts +31 -43
  33. package/types/render/hydration.d.ts +13 -13
  34. package/types/server/index.d.ts +2 -57
  35. package/types/server/reactive.d.ts +42 -73
  36. package/types/server/rendering.d.ts +96 -167
  37. package/universal/dist/dev.js +12 -28
  38. package/universal/dist/universal.js +12 -28
  39. package/universal/types/index.d.ts +1 -3
  40. package/universal/types/universal.d.ts +1 -0
  41. package/web/dist/dev.js +81 -620
  42. package/web/dist/server.cjs +7 -2
  43. package/web/dist/server.js +102 -179
  44. package/web/dist/storage.js +3 -3
  45. package/web/dist/web.js +80 -614
  46. package/web/types/client.d.ts +2 -2
  47. package/web/types/core.d.ts +1 -10
  48. package/web/types/index.d.ts +10 -27
  49. package/web/types/server-mock.d.ts +32 -47
package/dist/dev.js CHANGED
@@ -52,11 +52,9 @@ function enqueue(taskQueue, task) {
52
52
  let m = 0;
53
53
  let n = taskQueue.length - 1;
54
54
  while (m <= n) {
55
- const k = (n + m) >> 1;
55
+ const k = n + m >> 1;
56
56
  const cmp = task.expirationTime - taskQueue[k].expirationTime;
57
- if (cmp > 0) m = k + 1;
58
- else if (cmp < 0) n = k - 1;
59
- else return k;
57
+ if (cmp > 0) m = k + 1;else if (cmp < 0) n = k - 1;else return k;
60
58
  }
61
59
  return m;
62
60
  }
@@ -152,7 +150,7 @@ const NO_INIT = {};
152
150
  var Owner = null;
153
151
  let Transition = null;
154
152
  let Scheduler = null;
155
- let ExternalSourceFactory = null;
153
+ let ExternalSourceConfig = null;
156
154
  let Listener = null;
157
155
  let Updates = null;
158
156
  let Effects = null;
@@ -167,25 +165,20 @@ function createRoot(fn, detachedOwner) {
167
165
  owner = Owner,
168
166
  unowned = fn.length === 0,
169
167
  current = detachedOwner === undefined ? owner : detachedOwner,
170
- root = unowned
171
- ? {
172
- owned: null,
173
- cleanups: null,
174
- context: null,
175
- owner: null
176
- }
177
- : {
178
- owned: null,
179
- cleanups: null,
180
- context: current ? current.context : null,
181
- owner: current
182
- },
183
- updateFn = unowned
184
- ? () =>
185
- fn(() => {
186
- throw new Error("Dispose method must be an explicit argument to createRoot function");
187
- })
188
- : () => fn(() => untrack(() => cleanNode(root)));
168
+ root = unowned ? {
169
+ owned: null,
170
+ cleanups: null,
171
+ context: null,
172
+ owner: null
173
+ } : {
174
+ owned: null,
175
+ cleanups: null,
176
+ context: current ? current.context : null,
177
+ owner: current
178
+ },
179
+ updateFn = unowned ? () => fn(() => {
180
+ throw new Error("Dispose method must be an explicit argument to createRoot function");
181
+ }) : () => fn(() => untrack(() => cleanNode(root)));
189
182
  DevHooks.afterCreateOwner && DevHooks.afterCreateOwner(root);
190
183
  Owner = root;
191
184
  Listener = null;
@@ -211,26 +204,23 @@ function createSignal(value, options) {
211
204
  }
212
205
  const setter = value => {
213
206
  if (typeof value === "function") {
214
- if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);
215
- else value = value(s.value);
207
+ if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);else value = value(s.value);
216
208
  }
217
209
  return writeSignal(s, value);
218
210
  };
219
211
  return [readSignal.bind(s), setter];
220
212
  }
221
213
  function createComputed(fn, value, options) {
222
- const c = createComputation(fn, value, true, STALE, options);
223
- if (Scheduler && Transition && Transition.running) Updates.push(c);
224
- else updateComputation(c);
214
+ const c = createComputation(fn, value, true, STALE, options );
215
+ if (Scheduler && Transition && Transition.running) Updates.push(c);else updateComputation(c);
225
216
  }
226
217
  function createRenderEffect(fn, value, options) {
227
- const c = createComputation(fn, value, false, STALE, options);
228
- if (Scheduler && Transition && Transition.running) Updates.push(c);
229
- else updateComputation(c);
218
+ const c = createComputation(fn, value, false, STALE, options );
219
+ if (Scheduler && Transition && Transition.running) Updates.push(c);else updateComputation(c);
230
220
  }
231
221
  function createEffect(fn, value, options) {
232
222
  runEffects = runUserEffects;
233
- const c = createComputation(fn, value, false, STALE, options),
223
+ const c = createComputation(fn, value, false, STALE, options ),
234
224
  s = SuspenseContext && useContext(SuspenseContext);
235
225
  if (s) c.suspense = s;
236
226
  if (!options || !options.render) c.user = true;
@@ -238,16 +228,10 @@ function createEffect(fn, value, options) {
238
228
  }
239
229
  function createReaction(onInvalidate, options) {
240
230
  let fn;
241
- const c = createComputation(
242
- () => {
243
- fn ? fn() : untrack(onInvalidate);
244
- fn = undefined;
245
- },
246
- undefined,
247
- false,
248
- 0,
249
- options
250
- ),
231
+ const c = createComputation(() => {
232
+ fn ? fn() : untrack(onInvalidate);
233
+ fn = undefined;
234
+ }, undefined, false, 0, options ),
251
235
  s = SuspenseContext && useContext(SuspenseContext);
252
236
  if (s) c.suspense = s;
253
237
  c.user = true;
@@ -258,7 +242,7 @@ function createReaction(onInvalidate, options) {
258
242
  }
259
243
  function createMemo(fn, value, options) {
260
244
  options = options ? Object.assign({}, signalOptions, options) : signalOptions;
261
- const c = createComputation(fn, value, true, 0, options);
245
+ const c = createComputation(fn, value, true, 0, options );
262
246
  c.observers = null;
263
247
  c.observerSlots = null;
264
248
  c.comparator = options.equals || undefined;
@@ -275,7 +259,7 @@ function createResource(pSource, pFetcher, pOptions) {
275
259
  let source;
276
260
  let fetcher;
277
261
  let options;
278
- if ((arguments.length === 2 && typeof pFetcher === "object") || arguments.length === 1) {
262
+ if (arguments.length === 2 && typeof pFetcher === "object" || arguments.length === 1) {
279
263
  source = true;
280
264
  fetcher = pSource;
281
265
  options = pFetcher || {};
@@ -289,7 +273,7 @@ function createResource(pSource, pFetcher, pOptions) {
289
273
  id = null,
290
274
  loadedUnderTransition = false,
291
275
  scheduled = false,
292
- resolved = "initialValue" in options,
276
+ resolved = ("initialValue" in options),
293
277
  dynamic = typeof source === "function" && createMemo(source);
294
278
  const contexts = new Set(),
295
279
  [value, setValue] = (options.storage || createSignal)(options.initialValue),
@@ -301,19 +285,15 @@ function createResource(pSource, pFetcher, pOptions) {
301
285
  if (sharedConfig.context) {
302
286
  id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;
303
287
  let v;
304
- if (options.ssrLoadFrom === "initial") initP = options.initialValue;
305
- else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v;
288
+ if (options.ssrLoadFrom === "initial") initP = options.initialValue;else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v;
306
289
  }
307
290
  function loadEnd(p, v, error, key) {
308
291
  if (pr === p) {
309
292
  pr = null;
310
293
  key !== undefined && (resolved = true);
311
- if ((p === initP || v === initP) && options.onHydrated)
312
- queueMicrotask(() =>
313
- options.onHydrated(key, {
314
- value: v
315
- })
316
- );
294
+ if ((p === initP || v === initP) && options.onHydrated) queueMicrotask(() => options.onHydrated(key, {
295
+ value: v
296
+ }));
317
297
  initP = NO_INIT;
318
298
  if (Transition && p && loadedUnderTransition) {
319
299
  Transition.promises.delete(p);
@@ -344,8 +324,7 @@ function createResource(pSource, pFetcher, pOptions) {
344
324
  createComputed(() => {
345
325
  track();
346
326
  if (pr) {
347
- if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);
348
- else if (!contexts.has(c)) {
327
+ if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);else if (!contexts.has(c)) {
349
328
  c.increment();
350
329
  contexts.add(c);
351
330
  }
@@ -364,35 +343,26 @@ function createResource(pSource, pFetcher, pOptions) {
364
343
  return;
365
344
  }
366
345
  if (Transition && pr) Transition.promises.delete(pr);
367
- const p =
368
- initP !== NO_INIT
369
- ? initP
370
- : untrack(() =>
371
- fetcher(lookup, {
372
- value: value(),
373
- refetching
374
- })
375
- );
346
+ const p = initP !== NO_INIT ? initP : untrack(() => fetcher(lookup, {
347
+ value: value(),
348
+ refetching
349
+ }));
376
350
  if (!isPromise(p)) {
377
351
  loadEnd(pr, p, undefined, lookup);
378
352
  return p;
379
353
  }
380
354
  pr = p;
381
355
  if ("value" in p) {
382
- if (p.status === "success") loadEnd(pr, p.value, undefined, lookup);
383
- else loadEnd(pr, undefined, undefined, lookup);
356
+ if (p.status === "success") loadEnd(pr, p.value, undefined, lookup);else loadEnd(pr, undefined, undefined, lookup);
384
357
  return p;
385
358
  }
386
359
  scheduled = true;
387
- queueMicrotask(() => (scheduled = false));
360
+ queueMicrotask(() => scheduled = false);
388
361
  runUpdates(() => {
389
362
  setState(resolved ? "refreshing" : "pending");
390
363
  trigger();
391
364
  }, false);
392
- return p.then(
393
- v => loadEnd(p, v, undefined, lookup),
394
- e => loadEnd(p, undefined, castError(e), lookup)
395
- );
365
+ return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, undefined, castError(e), lookup));
396
366
  }
397
367
  Object.defineProperties(read, {
398
368
  state: {
@@ -416,91 +386,61 @@ function createResource(pSource, pFetcher, pOptions) {
416
386
  }
417
387
  }
418
388
  });
419
- if (dynamic) createComputed(() => load(false));
420
- else load(false);
421
- return [
422
- read,
423
- {
424
- refetch: load,
425
- mutate: setValue
426
- }
427
- ];
389
+ if (dynamic) createComputed(() => load(false));else load(false);
390
+ return [read, {
391
+ refetch: load,
392
+ mutate: setValue
393
+ }];
428
394
  }
429
395
  function createDeferred(source, options) {
430
396
  let t,
431
397
  timeout = options ? options.timeoutMs : undefined;
432
- const node = createComputation(
433
- () => {
434
- if (!t || !t.fn)
435
- t = requestCallback(
436
- () => setDeferred(() => node.value),
437
- timeout !== undefined
438
- ? {
439
- timeout
440
- }
441
- : undefined
442
- );
443
- return source();
444
- },
445
- undefined,
446
- true
447
- );
448
- const [deferred, setDeferred] = createSignal(
449
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
450
- options
451
- );
398
+ const node = createComputation(() => {
399
+ if (!t || !t.fn) t = requestCallback(() => setDeferred(() => node.value), timeout !== undefined ? {
400
+ timeout
401
+ } : undefined);
402
+ return source();
403
+ }, undefined, true);
404
+ const [deferred, setDeferred] = createSignal(Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, options);
452
405
  updateComputation(node);
453
- setDeferred(() =>
454
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value
455
- );
406
+ setDeferred(() => Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);
456
407
  return deferred;
457
408
  }
458
409
  function createSelector(source, fn = equalFn, options) {
459
410
  const subs = new Map();
460
- const node = createComputation(
461
- p => {
462
- const v = source();
463
- for (const [key, val] of subs.entries())
464
- if (fn(key, v) !== fn(key, p)) {
465
- for (const c of val.values()) {
466
- c.state = STALE;
467
- if (c.pure) Updates.push(c);
468
- else Effects.push(c);
469
- }
470
- }
471
- return v;
472
- },
473
- undefined,
474
- true,
475
- STALE,
476
- options
477
- );
411
+ const node = createComputation(p => {
412
+ const v = source();
413
+ for (const [key, val] of subs.entries()) if (fn(key, v) !== fn(key, p)) {
414
+ for (const c of val.values()) {
415
+ c.state = STALE;
416
+ if (c.pure) Updates.push(c);else Effects.push(c);
417
+ }
418
+ }
419
+ return v;
420
+ }, undefined, true, STALE, options );
478
421
  updateComputation(node);
479
422
  return key => {
480
423
  const listener = Listener;
481
424
  if (listener) {
482
425
  let l;
483
- if ((l = subs.get(key))) l.add(listener);
484
- else subs.set(key, (l = new Set([listener])));
426
+ if (l = subs.get(key)) l.add(listener);else subs.set(key, l = new Set([listener]));
485
427
  onCleanup(() => {
486
428
  l.delete(listener);
487
429
  !l.size && subs.delete(key);
488
430
  });
489
431
  }
490
- return fn(
491
- key,
492
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value
493
- );
432
+ return fn(key, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);
494
433
  };
495
434
  }
496
435
  function batch(fn) {
497
436
  return runUpdates(fn, false);
498
437
  }
499
438
  function untrack(fn) {
500
- if (Listener === null) return fn();
439
+ if (!ExternalSourceConfig && Listener === null) return fn();
501
440
  const listener = Listener;
502
441
  Listener = null;
503
442
  try {
443
+ if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);
504
444
  return fn();
505
445
  } finally {
506
446
  Listener = listener;
@@ -529,10 +469,7 @@ function onMount(fn) {
529
469
  createEffect(() => untrack(fn));
530
470
  }
531
471
  function onCleanup(fn) {
532
- if (Owner === null)
533
- console.warn("cleanups created outside a `createRoot` or `render` will never be run");
534
- else if (Owner.cleanups === null) Owner.cleanups = [fn];
535
- else Owner.cleanups.push(fn);
472
+ if (Owner === null) console.warn("cleanups created outside a `createRoot` or `render` will never be run");else if (Owner.cleanups === null) Owner.cleanups = [fn];else Owner.cleanups.push(fn);
536
473
  return fn;
537
474
  }
538
475
  function catchError(fn, handler) {
@@ -586,17 +523,15 @@ function startTransition(fn) {
586
523
  Owner = o;
587
524
  let t;
588
525
  if (Scheduler || SuspenseContext) {
589
- t =
590
- Transition ||
591
- (Transition = {
592
- sources: new Set(),
593
- effects: [],
594
- promises: new Set(),
595
- disposed: new Set(),
596
- queue: new Set(),
597
- running: true
598
- });
599
- t.done || (t.done = new Promise(res => (t.resolve = res)));
526
+ t = Transition || (Transition = {
527
+ sources: new Set(),
528
+ effects: [],
529
+ promises: new Set(),
530
+ disposed: new Set(),
531
+ queue: new Set(),
532
+ running: true
533
+ });
534
+ t.done || (t.done = new Promise(res => t.resolve = res));
600
535
  t.running = true;
601
536
  }
602
537
  runUpdates(fn, false);
@@ -604,7 +539,7 @@ function startTransition(fn) {
604
539
  return t ? t.done : undefined;
605
540
  });
606
541
  }
607
- const [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);
542
+ const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
608
543
  function useTransition() {
609
544
  return [transPending, startTransition];
610
545
  }
@@ -613,18 +548,12 @@ function resumeEffects(e) {
613
548
  e.length = 0;
614
549
  }
615
550
  function devComponent(Comp, props) {
616
- const c = createComputation(
617
- () =>
618
- untrack(() => {
619
- Object.assign(Comp, {
620
- [$DEVCOMP]: true
621
- });
622
- return Comp(props);
623
- }),
624
- undefined,
625
- true,
626
- 0
627
- );
551
+ const c = createComputation(() => untrack(() => {
552
+ Object.assign(Comp, {
553
+ [$DEVCOMP]: true
554
+ });
555
+ return Comp(props);
556
+ }), undefined, true, 0);
628
557
  c.props = props;
629
558
  c.observers = null;
630
559
  c.observerSlots = null;
@@ -635,8 +564,7 @@ function devComponent(Comp, props) {
635
564
  }
636
565
  function registerGraph(value) {
637
566
  if (!Owner) return;
638
- if (Owner.sourceMap) Owner.sourceMap.push(value);
639
- else Owner.sourceMap = [value];
567
+ if (Owner.sourceMap) Owner.sourceMap.push(value);else Owner.sourceMap = [value];
640
568
  value.graph = Owner;
641
569
  }
642
570
  function createContext(defaultValue, options) {
@@ -648,15 +576,13 @@ function createContext(defaultValue, options) {
648
576
  };
649
577
  }
650
578
  function useContext(context) {
651
- return Owner && Owner.context && Owner.context[context.id] !== undefined
652
- ? Owner.context[context.id]
653
- : context.defaultValue;
579
+ return Owner && Owner.context && Owner.context[context.id] !== undefined ? Owner.context[context.id] : context.defaultValue;
654
580
  }
655
581
  function children(fn) {
656
582
  const children = createMemo(fn);
657
583
  const memo = createMemo(() => resolveChildren(children()), undefined, {
658
584
  name: "children"
659
- });
585
+ }) ;
660
586
  memo.toArray = () => {
661
587
  const c = memo();
662
588
  return Array.isArray(c) ? c : c != null ? [c] : [];
@@ -667,29 +593,37 @@ let SuspenseContext;
667
593
  function getSuspenseContext() {
668
594
  return SuspenseContext || (SuspenseContext = createContext());
669
595
  }
670
- function enableExternalSource(factory) {
671
- if (ExternalSourceFactory) {
672
- const oldFactory = ExternalSourceFactory;
673
- ExternalSourceFactory = (fn, trigger) => {
674
- const oldSource = oldFactory(fn, trigger);
675
- const source = factory(x => oldSource.track(x), trigger);
676
- return {
677
- track: x => source.track(x),
678
- dispose() {
679
- source.dispose();
680
- oldSource.dispose();
681
- }
682
- };
596
+ function enableExternalSource(factory, untrack = fn => fn()) {
597
+ if (ExternalSourceConfig) {
598
+ const {
599
+ factory: oldFactory,
600
+ untrack: oldUntrack
601
+ } = ExternalSourceConfig;
602
+ ExternalSourceConfig = {
603
+ factory: (fn, trigger) => {
604
+ const oldSource = oldFactory(fn, trigger);
605
+ const source = factory(x => oldSource.track(x), trigger);
606
+ return {
607
+ track: x => source.track(x),
608
+ dispose() {
609
+ source.dispose();
610
+ oldSource.dispose();
611
+ }
612
+ };
613
+ },
614
+ untrack: fn => oldUntrack(() => untrack(fn))
683
615
  };
684
616
  } else {
685
- ExternalSourceFactory = factory;
617
+ ExternalSourceConfig = {
618
+ factory,
619
+ untrack
620
+ };
686
621
  }
687
622
  }
688
623
  function readSignal() {
689
624
  const runningTransition = Transition && Transition.running;
690
625
  if (this.sources && (runningTransition ? this.tState : this.state)) {
691
- if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);
692
- else {
626
+ if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);else {
693
627
  const updates = Updates;
694
628
  Updates = null;
695
629
  runUpdates(() => lookUpstream(this), false);
@@ -717,12 +651,11 @@ function readSignal() {
717
651
  return this.value;
718
652
  }
719
653
  function writeSignal(node, value, isComp) {
720
- let current =
721
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
654
+ let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
722
655
  if (!node.comparator || !node.comparator(current, value)) {
723
656
  if (Transition) {
724
657
  const TransitionRunning = Transition.running;
725
- if (TransitionRunning || (!isComp && Transition.sources.has(node))) {
658
+ if (TransitionRunning || !isComp && Transition.sources.has(node)) {
726
659
  Transition.sources.add(node);
727
660
  node.tValue = value;
728
661
  }
@@ -735,12 +668,10 @@ function writeSignal(node, value, isComp) {
735
668
  const TransitionRunning = Transition && Transition.running;
736
669
  if (TransitionRunning && Transition.disposed.has(o)) continue;
737
670
  if (TransitionRunning ? !o.tState : !o.state) {
738
- if (o.pure) Updates.push(o);
739
- else Effects.push(o);
671
+ if (o.pure) Updates.push(o);else Effects.push(o);
740
672
  if (o.observers) markDownstream(o);
741
673
  }
742
- if (!TransitionRunning) o.state = STALE;
743
- else o.tState = STALE;
674
+ if (!TransitionRunning) o.state = STALE;else o.tState = STALE;
744
675
  }
745
676
  if (Updates.length > 10e5) {
746
677
  Updates = [];
@@ -756,11 +687,7 @@ function updateComputation(node) {
756
687
  if (!node.fn) return;
757
688
  cleanNode(node);
758
689
  const time = ExecCount;
759
- runComputation(
760
- node,
761
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
762
- time
763
- );
690
+ runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
764
691
  if (Transition && !Transition.running && Transition.sources.has(node)) {
765
692
  queueMicrotask(() => {
766
693
  runUpdates(() => {
@@ -825,26 +752,22 @@ function createComputation(fn, init, pure, state = STALE, options) {
825
752
  c.state = 0;
826
753
  c.tState = state;
827
754
  }
828
- if (Owner === null)
829
- console.warn("computations created outside a `createRoot` or `render` will never be disposed");
830
- else if (Owner !== UNOWNED) {
755
+ if (Owner === null) console.warn("computations created outside a `createRoot` or `render` will never be disposed");else if (Owner !== UNOWNED) {
831
756
  if (Transition && Transition.running && Owner.pure) {
832
- if (!Owner.tOwned) Owner.tOwned = [c];
833
- else Owner.tOwned.push(c);
757
+ if (!Owner.tOwned) Owner.tOwned = [c];else Owner.tOwned.push(c);
834
758
  } else {
835
- if (!Owner.owned) Owner.owned = [c];
836
- else Owner.owned.push(c);
759
+ if (!Owner.owned) Owner.owned = [c];else Owner.owned.push(c);
837
760
  }
838
761
  }
839
762
  if (options && options.name) c.name = options.name;
840
- if (ExternalSourceFactory) {
763
+ if (ExternalSourceConfig && c.fn) {
841
764
  const [track, trigger] = createSignal(undefined, {
842
765
  equals: false
843
766
  });
844
- const ordinary = ExternalSourceFactory(c.fn, trigger);
767
+ const ordinary = ExternalSourceConfig.factory(c.fn, trigger);
845
768
  onCleanup(() => ordinary.dispose());
846
769
  const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());
847
- const inTransition = ExternalSourceFactory(c.fn, triggerInTransition);
770
+ const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);
848
771
  c.fn = x => {
849
772
  track();
850
773
  return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);
@@ -886,8 +809,7 @@ function runUpdates(fn, init) {
886
809
  if (Updates) return fn();
887
810
  let wait = false;
888
811
  if (!init) Updates = [];
889
- if (Effects) wait = true;
890
- else Effects = [];
812
+ if (Effects) wait = true;else Effects = [];
891
813
  ExecCount++;
892
814
  try {
893
815
  const res = fn();
@@ -901,8 +823,7 @@ function runUpdates(fn, init) {
901
823
  }
902
824
  function completeUpdates(wait) {
903
825
  if (Updates) {
904
- if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);
905
- else runQueue(Updates);
826
+ if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);else runQueue(Updates);
906
827
  Updates = null;
907
828
  }
908
829
  if (wait) return;
@@ -942,8 +863,7 @@ function completeUpdates(wait) {
942
863
  }
943
864
  const e = Effects;
944
865
  Effects = null;
945
- if (e.length) runUpdates(() => runEffects(e), false);
946
- else DevHooks.afterUpdate && DevHooks.afterUpdate();
866
+ if (e.length) runUpdates(() => runEffects(e), false);else DevHooks.afterUpdate && DevHooks.afterUpdate();
947
867
  if (res) res();
948
868
  }
949
869
  function runQueue(queue) {
@@ -971,8 +891,7 @@ function runUserEffects(queue) {
971
891
  userLength = 0;
972
892
  for (i = 0; i < queue.length; i++) {
973
893
  const e = queue[i];
974
- if (!e.user) runTop(e);
975
- else queue[userLength++] = e;
894
+ if (!e.user) runTop(e);else queue[userLength++] = e;
976
895
  }
977
896
  if (sharedConfig.context) {
978
897
  if (sharedConfig.count) {
@@ -990,15 +909,13 @@ function runUserEffects(queue) {
990
909
  }
991
910
  function lookUpstream(node, ignore) {
992
911
  const runningTransition = Transition && Transition.running;
993
- if (runningTransition) node.tState = 0;
994
- else node.state = 0;
912
+ if (runningTransition) node.tState = 0;else node.state = 0;
995
913
  for (let i = 0; i < node.sources.length; i += 1) {
996
914
  const source = node.sources[i];
997
915
  if (source.sources) {
998
916
  const state = runningTransition ? source.tState : source.state;
999
917
  if (state === STALE) {
1000
- if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
1001
- runTop(source);
918
+ if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);
1002
919
  } else if (state === PENDING) lookUpstream(source, ignore);
1003
920
  }
1004
921
  }
@@ -1008,10 +925,8 @@ function markDownstream(node) {
1008
925
  for (let i = 0; i < node.observers.length; i += 1) {
1009
926
  const o = node.observers[i];
1010
927
  if (runningTransition ? !o.tState : !o.state) {
1011
- if (runningTransition) o.tState = PENDING;
1012
- else o.state = PENDING;
1013
- if (o.pure) Updates.push(o);
1014
- else Effects.push(o);
928
+ if (runningTransition) o.tState = PENDING;else o.state = PENDING;
929
+ if (o.pure) Updates.push(o);else Effects.push(o);
1015
930
  o.observers && markDownstream(o);
1016
931
  }
1017
932
  }
@@ -1048,8 +963,7 @@ function cleanNode(node) {
1048
963
  for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
1049
964
  node.cleanups = null;
1050
965
  }
1051
- if (Transition && Transition.running) node.tState = 0;
1052
- else node.state = 0;
966
+ if (Transition && Transition.running) node.tState = 0;else node.state = 0;
1053
967
  delete node.sourceMap;
1054
968
  }
1055
969
  function reset(node, top) {
@@ -1071,21 +985,19 @@ function runErrors(err, fns, owner) {
1071
985
  try {
1072
986
  for (const f of fns) f(err);
1073
987
  } catch (e) {
1074
- handleError(e, (owner && owner.owner) || null);
988
+ handleError(e, owner && owner.owner || null);
1075
989
  }
1076
990
  }
1077
991
  function handleError(err, owner = Owner) {
1078
992
  const fns = ERROR && owner && owner.context && owner.context[ERROR];
1079
993
  const error = castError(err);
1080
994
  if (!fns) throw error;
1081
- if (Effects)
1082
- Effects.push({
1083
- fn() {
1084
- runErrors(error, fns, owner);
1085
- },
1086
- state: STALE
1087
- });
1088
- else runErrors(error, fns, owner);
995
+ if (Effects) Effects.push({
996
+ fn() {
997
+ runErrors(error, fns, owner);
998
+ },
999
+ state: STALE
1000
+ });else runErrors(error, fns, owner);
1089
1001
  }
1090
1002
  function resolveChildren(children) {
1091
1003
  if (typeof children === "function" && !children.length) return resolveChildren(children());
@@ -1102,26 +1014,19 @@ function resolveChildren(children) {
1102
1014
  function createProvider(id, options) {
1103
1015
  return function provider(props) {
1104
1016
  let res;
1105
- createRenderEffect(
1106
- () =>
1107
- (res = untrack(() => {
1108
- Owner.context = {
1109
- ...Owner.context,
1110
- [id]: props.value
1111
- };
1112
- return children(() => props.children);
1113
- })),
1114
- undefined,
1115
- options
1116
- );
1017
+ createRenderEffect(() => res = untrack(() => {
1018
+ Owner.context = {
1019
+ ...Owner.context,
1020
+ [id]: props.value
1021
+ };
1022
+ return children(() => props.children);
1023
+ }), undefined, options);
1117
1024
  return res;
1118
1025
  };
1119
1026
  }
1120
1027
  function onError(fn) {
1121
1028
  ERROR || (ERROR = Symbol("error"));
1122
- if (Owner === null)
1123
- console.warn("error handlers created outside a `createRoot` or `render` will never be run");
1124
- else if (Owner.context === null || !Owner.context[ERROR]) {
1029
+ if (Owner === null) console.warn("error handlers created outside a `createRoot` or `render` will never be run");else if (Owner.context === null || !Owner.context[ERROR]) {
1125
1030
  Owner.context = {
1126
1031
  ...Owner.context,
1127
1032
  [ERROR]: [fn]
@@ -1150,8 +1055,7 @@ function observable(input) {
1150
1055
  if (!(observer instanceof Object) || observer == null) {
1151
1056
  throw new TypeError("Expected the observer to be an object.");
1152
1057
  }
1153
- const handler =
1154
- typeof observer === "function" ? observer : observer.next && observer.next.bind(observer);
1058
+ const handler = typeof observer === "function" ? observer : observer.next && observer.next.bind(observer);
1155
1059
  if (!handler) {
1156
1060
  return {
1157
1061
  unsubscribe() {}
@@ -1182,7 +1086,7 @@ function from(producer) {
1182
1086
  });
1183
1087
  if ("subscribe" in producer) {
1184
1088
  const unsub = producer.subscribe(v => set(() => v));
1185
- onCleanup(() => ("unsubscribe" in unsub ? unsub.unsubscribe() : unsub()));
1089
+ onCleanup(() => "unsubscribe" in unsub ? unsub.unsubscribe() : unsub());
1186
1090
  } else {
1187
1091
  const clean = producer(set);
1188
1092
  onCleanup(clean);
@@ -1234,7 +1138,8 @@ function mapArray(list, mapFn, options = {}) {
1234
1138
  });
1235
1139
  len = 1;
1236
1140
  }
1237
- } else if (len === 0) {
1141
+ }
1142
+ else if (len === 0) {
1238
1143
  mapped = new Array(newLen);
1239
1144
  for (j = 0; j < newLen; j++) {
1240
1145
  items[j] = newItems[j];
@@ -1245,16 +1150,8 @@ function mapArray(list, mapFn, options = {}) {
1245
1150
  temp = new Array(newLen);
1246
1151
  tempdisposers = new Array(newLen);
1247
1152
  indexes && (tempIndexes = new Array(newLen));
1248
- for (
1249
- start = 0, end = Math.min(len, newLen);
1250
- start < end && items[start] === newItems[start];
1251
- start++
1252
- );
1253
- for (
1254
- end = len - 1, newEnd = newLen - 1;
1255
- end >= start && newEnd >= start && items[end] === newItems[newEnd];
1256
- end--, newEnd--
1257
- ) {
1153
+ for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++);
1154
+ for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {
1258
1155
  temp[newEnd] = mapped[end];
1259
1156
  tempdisposers[newEnd] = disposers[end];
1260
1157
  indexes && (tempIndexes[newEnd] = indexes[end]);
@@ -1288,7 +1185,7 @@ function mapArray(list, mapFn, options = {}) {
1288
1185
  }
1289
1186
  } else mapped[j] = createRoot(mapper);
1290
1187
  }
1291
- mapped = mapped.slice(0, (len = newLen));
1188
+ mapped = mapped.slice(0, len = newLen);
1292
1189
  items = newItems.slice(0);
1293
1190
  }
1294
1191
  return mapped;
@@ -1298,7 +1195,7 @@ function mapArray(list, mapFn, options = {}) {
1298
1195
  if (indexes) {
1299
1196
  const [s, set] = createSignal(j, {
1300
1197
  name: "index"
1301
- });
1198
+ }) ;
1302
1199
  indexes[j] = set;
1303
1200
  return mapFn(newItems[j], s);
1304
1201
  }
@@ -1356,13 +1253,13 @@ function indexArray(list, mapFn, options = {}) {
1356
1253
  }
1357
1254
  len = signals.length = disposers.length = newItems.length;
1358
1255
  items = newItems.slice(0);
1359
- return (mapped = mapped.slice(0, len));
1256
+ return mapped = mapped.slice(0, len);
1360
1257
  });
1361
1258
  function mapper(disposer) {
1362
1259
  disposers[i] = disposer;
1363
1260
  const [s, set] = createSignal(newItems[i], {
1364
1261
  name: "value"
1365
- });
1262
+ }) ;
1366
1263
  signals[i] = set;
1367
1264
  return mapFn(s, i);
1368
1265
  }
@@ -1378,7 +1275,7 @@ function createComponent(Comp, props) {
1378
1275
  if (sharedConfig.context) {
1379
1276
  const c = sharedConfig.context;
1380
1277
  setHydrateContext(nextHydrateContext());
1381
- const r = devComponent(Comp, props || {});
1278
+ const r = devComponent(Comp, props || {}) ;
1382
1279
  setHydrateContext(c);
1383
1280
  return r;
1384
1281
  }
@@ -1427,33 +1324,29 @@ function mergeProps(...sources) {
1427
1324
  let proxy = false;
1428
1325
  for (let i = 0; i < sources.length; i++) {
1429
1326
  const s = sources[i];
1430
- proxy = proxy || (!!s && $PROXY in s);
1431
- sources[i] = typeof s === "function" ? ((proxy = true), createMemo(s)) : s;
1327
+ proxy = proxy || !!s && $PROXY in s;
1328
+ sources[i] = typeof s === "function" ? (proxy = true, createMemo(s)) : s;
1432
1329
  }
1433
1330
  if (proxy) {
1434
- return new Proxy(
1435
- {
1436
- get(property) {
1437
- for (let i = sources.length - 1; i >= 0; i--) {
1438
- const v = resolveSource(sources[i])[property];
1439
- if (v !== undefined) return v;
1440
- }
1441
- },
1442
- has(property) {
1443
- for (let i = sources.length - 1; i >= 0; i--) {
1444
- if (property in resolveSource(sources[i])) return true;
1445
- }
1446
- return false;
1447
- },
1448
- keys() {
1449
- const keys = [];
1450
- for (let i = 0; i < sources.length; i++)
1451
- keys.push(...Object.keys(resolveSource(sources[i])));
1452
- return [...new Set(keys)];
1331
+ return new Proxy({
1332
+ get(property) {
1333
+ for (let i = sources.length - 1; i >= 0; i--) {
1334
+ const v = resolveSource(sources[i])[property];
1335
+ if (v !== undefined) return v;
1453
1336
  }
1454
1337
  },
1455
- propTraps
1456
- );
1338
+ has(property) {
1339
+ for (let i = sources.length - 1; i >= 0; i--) {
1340
+ if (property in resolveSource(sources[i])) return true;
1341
+ }
1342
+ return false;
1343
+ },
1344
+ keys() {
1345
+ const keys = [];
1346
+ for (let i = 0; i < sources.length; i++) keys.push(...Object.keys(resolveSource(sources[i])));
1347
+ return [...new Set(keys)];
1348
+ }
1349
+ }, propTraps);
1457
1350
  }
1458
1351
  const target = {};
1459
1352
  const sourcesMap = {};
@@ -1472,7 +1365,7 @@ function mergeProps(...sources) {
1472
1365
  Object.defineProperty(target, key, {
1473
1366
  enumerable: true,
1474
1367
  configurable: true,
1475
- get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))
1368
+ get: resolveSources.bind(sourcesMap[key] = [desc.get.bind(source)])
1476
1369
  });
1477
1370
  } else {
1478
1371
  if (desc.value !== undefined) defined.add(key);
@@ -1496,60 +1389,47 @@ function splitProps(props, ...keys) {
1496
1389
  if ($PROXY in props) {
1497
1390
  const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);
1498
1391
  const res = keys.map(k => {
1499
- return new Proxy(
1500
- {
1501
- get(property) {
1502
- return k.includes(property) ? props[property] : undefined;
1503
- },
1504
- has(property) {
1505
- return k.includes(property) && property in props;
1506
- },
1507
- keys() {
1508
- return k.filter(property => property in props);
1509
- }
1392
+ return new Proxy({
1393
+ get(property) {
1394
+ return k.includes(property) ? props[property] : undefined;
1510
1395
  },
1511
- propTraps
1512
- );
1513
- });
1514
- res.push(
1515
- new Proxy(
1516
- {
1517
- get(property) {
1518
- return blocked.has(property) ? undefined : props[property];
1519
- },
1520
- has(property) {
1521
- return blocked.has(property) ? false : property in props;
1522
- },
1523
- keys() {
1524
- return Object.keys(props).filter(k => !blocked.has(k));
1525
- }
1396
+ has(property) {
1397
+ return k.includes(property) && property in props;
1526
1398
  },
1527
- propTraps
1528
- )
1529
- );
1399
+ keys() {
1400
+ return k.filter(property => property in props);
1401
+ }
1402
+ }, propTraps);
1403
+ });
1404
+ res.push(new Proxy({
1405
+ get(property) {
1406
+ return blocked.has(property) ? undefined : props[property];
1407
+ },
1408
+ has(property) {
1409
+ return blocked.has(property) ? false : property in props;
1410
+ },
1411
+ keys() {
1412
+ return Object.keys(props).filter(k => !blocked.has(k));
1413
+ }
1414
+ }, propTraps));
1530
1415
  return res;
1531
1416
  }
1532
1417
  const otherObject = {};
1533
1418
  const objects = keys.map(() => ({}));
1534
1419
  for (const propName of Object.getOwnPropertyNames(props)) {
1535
1420
  const desc = Object.getOwnPropertyDescriptor(props, propName);
1536
- const isDefaultDesc =
1537
- !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;
1421
+ const isDefaultDesc = !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;
1538
1422
  let blocked = false;
1539
1423
  let objectIndex = 0;
1540
1424
  for (const k of keys) {
1541
1425
  if (k.includes(propName)) {
1542
1426
  blocked = true;
1543
- isDefaultDesc
1544
- ? (objects[objectIndex][propName] = desc.value)
1545
- : Object.defineProperty(objects[objectIndex], propName, desc);
1427
+ isDefaultDesc ? objects[objectIndex][propName] = desc.value : Object.defineProperty(objects[objectIndex], propName, desc);
1546
1428
  }
1547
1429
  ++objectIndex;
1548
1430
  }
1549
1431
  if (!blocked) {
1550
- isDefaultDesc
1551
- ? (otherObject[propName] = desc.value)
1552
- : Object.defineProperty(otherObject, propName, desc);
1432
+ isDefaultDesc ? otherObject[propName] = desc.value : Object.defineProperty(otherObject, propName, desc);
1553
1433
  }
1554
1434
  }
1555
1435
  return [...objects, otherObject];
@@ -1575,24 +1455,19 @@ function lazy(fn) {
1575
1455
  comp = s;
1576
1456
  }
1577
1457
  let Comp;
1578
- return createMemo(
1579
- () =>
1580
- (Comp = comp()) &&
1581
- untrack(() => {
1582
- if (true)
1583
- Object.assign(Comp, {
1584
- [$DEVCOMP]: true
1585
- });
1586
- if (!ctx) return Comp(props);
1587
- const c = sharedConfig.context;
1588
- setHydrateContext(ctx);
1589
- const r = Comp(props);
1590
- setHydrateContext(c);
1591
- return r;
1592
- })
1593
- );
1458
+ return createMemo(() => (Comp = comp()) && untrack(() => {
1459
+ if (true) Object.assign(Comp, {
1460
+ [$DEVCOMP]: true
1461
+ });
1462
+ if (!ctx) return Comp(props);
1463
+ const c = sharedConfig.context;
1464
+ setHydrateContext(ctx);
1465
+ const r = Comp(props);
1466
+ setHydrateContext(c);
1467
+ return r;
1468
+ }));
1594
1469
  };
1595
- wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);
1470
+ wrap.preload = () => p || ((p = fn()).then(mod => comp = () => mod.default), p);
1596
1471
  return wrap;
1597
1472
  }
1598
1473
  let counter = 0;
@@ -1601,113 +1476,75 @@ function createUniqueId() {
1601
1476
  return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;
1602
1477
  }
1603
1478
 
1604
- const narrowedError = name =>
1605
- `Attempting to access a stale value from <${name}> that could possibly be undefined. This may occur because you are reading the accessor returned from the component at a time where it has already been unmounted. We recommend cleaning up any stale timers or async, or reading from the initial condition.`;
1479
+ const narrowedError = name => `Attempting to access a stale value from <${name}> that could possibly be undefined. This may occur because you are reading the accessor returned from the component at a time where it has already been unmounted. We recommend cleaning up any stale timers or async, or reading from the initial condition.` ;
1606
1480
  function For(props) {
1607
1481
  const fallback = "fallback" in props && {
1608
1482
  fallback: () => props.fallback
1609
1483
  };
1610
- return createMemo(
1611
- mapArray(() => props.each, props.children, fallback || undefined),
1612
- undefined,
1613
- {
1614
- name: "value"
1615
- }
1616
- );
1484
+ return createMemo(mapArray(() => props.each, props.children, fallback || undefined), undefined, {
1485
+ name: "value"
1486
+ }) ;
1617
1487
  }
1618
1488
  function Index(props) {
1619
1489
  const fallback = "fallback" in props && {
1620
1490
  fallback: () => props.fallback
1621
1491
  };
1622
- return createMemo(
1623
- indexArray(() => props.each, props.children, fallback || undefined),
1624
- undefined,
1625
- {
1626
- name: "value"
1627
- }
1628
- );
1492
+ return createMemo(indexArray(() => props.each, props.children, fallback || undefined), undefined, {
1493
+ name: "value"
1494
+ }) ;
1629
1495
  }
1630
1496
  function Show(props) {
1631
1497
  const keyed = props.keyed;
1632
1498
  const condition = createMemo(() => props.when, undefined, {
1633
- equals: (a, b) => (keyed ? a === b : !a === !b),
1499
+ equals: (a, b) => keyed ? a === b : !a === !b,
1634
1500
  name: "condition"
1635
- });
1636
- return createMemo(
1637
- () => {
1638
- const c = condition();
1639
- if (c) {
1640
- const child = props.children;
1641
- const fn = typeof child === "function" && child.length > 0;
1642
- return fn
1643
- ? untrack(() =>
1644
- child(
1645
- keyed
1646
- ? c
1647
- : () => {
1648
- if (!untrack(condition)) throw narrowedError("Show");
1649
- return props.when;
1650
- }
1651
- )
1652
- )
1653
- : child;
1654
- }
1655
- return props.fallback;
1656
- },
1657
- undefined,
1658
- {
1659
- name: "value"
1501
+ } );
1502
+ return createMemo(() => {
1503
+ const c = condition();
1504
+ if (c) {
1505
+ const child = props.children;
1506
+ const fn = typeof child === "function" && child.length > 0;
1507
+ return fn ? untrack(() => child(keyed ? c : () => {
1508
+ if (!untrack(condition)) throw narrowedError("Show");
1509
+ return props.when;
1510
+ })) : child;
1660
1511
  }
1661
- );
1512
+ return props.fallback;
1513
+ }, undefined, {
1514
+ name: "value"
1515
+ } );
1662
1516
  }
1663
1517
  function Switch(props) {
1664
1518
  let keyed = false;
1665
- const equals = (a, b) =>
1666
- a[0] === b[0] && (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
1519
+ const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
1667
1520
  const conditions = children(() => props.children),
1668
- evalConditions = createMemo(
1669
- () => {
1670
- let conds = conditions();
1671
- if (!Array.isArray(conds)) conds = [conds];
1672
- for (let i = 0; i < conds.length; i++) {
1673
- const c = conds[i].when;
1674
- if (c) {
1675
- keyed = !!conds[i].keyed;
1676
- return [i, c, conds[i]];
1677
- }
1521
+ evalConditions = createMemo(() => {
1522
+ let conds = conditions();
1523
+ if (!Array.isArray(conds)) conds = [conds];
1524
+ for (let i = 0; i < conds.length; i++) {
1525
+ const c = conds[i].when;
1526
+ if (c) {
1527
+ keyed = !!conds[i].keyed;
1528
+ return [i, c, conds[i]];
1678
1529
  }
1679
- return [-1];
1680
- },
1681
- undefined,
1682
- {
1683
- equals,
1684
- name: "eval conditions"
1685
1530
  }
1686
- );
1687
- return createMemo(
1688
- () => {
1689
- const [index, when, cond] = evalConditions();
1690
- if (index < 0) return props.fallback;
1691
- const c = cond.children;
1692
- const fn = typeof c === "function" && c.length > 0;
1693
- return fn
1694
- ? untrack(() =>
1695
- c(
1696
- keyed
1697
- ? when
1698
- : () => {
1699
- if (untrack(evalConditions)[0] !== index) throw narrowedError("Match");
1700
- return cond.when;
1701
- }
1702
- )
1703
- )
1704
- : c;
1705
- },
1706
- undefined,
1707
- {
1708
- name: "value"
1709
- }
1710
- );
1531
+ return [-1];
1532
+ }, undefined, {
1533
+ equals,
1534
+ name: "eval conditions"
1535
+ } );
1536
+ return createMemo(() => {
1537
+ const [index, when, cond] = evalConditions();
1538
+ if (index < 0) return props.fallback;
1539
+ const c = cond.children;
1540
+ const fn = typeof c === "function" && c.length > 0;
1541
+ return fn ? untrack(() => c(keyed ? when : () => {
1542
+ if (untrack(evalConditions)[0] !== index) throw narrowedError("Match");
1543
+ return cond.when;
1544
+ })) : c;
1545
+ }, undefined, {
1546
+ name: "value"
1547
+ } );
1711
1548
  }
1712
1549
  function Match(props) {
1713
1550
  return props;
@@ -1718,33 +1555,27 @@ function resetErrorBoundaries() {
1718
1555
  }
1719
1556
  function ErrorBoundary(props) {
1720
1557
  let err;
1721
- if (sharedConfig.context && sharedConfig.load)
1722
- err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count);
1558
+ if (sharedConfig.context && sharedConfig.load) err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count);
1723
1559
  const [errored, setErrored] = createSignal(err, {
1724
1560
  name: "errored"
1725
- });
1561
+ } );
1726
1562
  Errors || (Errors = new Set());
1727
1563
  Errors.add(setErrored);
1728
1564
  onCleanup(() => Errors.delete(setErrored));
1729
- return createMemo(
1730
- () => {
1731
- let e;
1732
- if ((e = errored())) {
1733
- const f = props.fallback;
1734
- if (typeof f !== "function" || f.length == 0) console.error(e);
1735
- return typeof f === "function" && f.length ? untrack(() => f(e, () => setErrored())) : f;
1736
- }
1737
- return catchError(() => props.children, setErrored);
1738
- },
1739
- undefined,
1740
- {
1741
- name: "value"
1565
+ return createMemo(() => {
1566
+ let e;
1567
+ if (e = errored()) {
1568
+ const f = props.fallback;
1569
+ if ((typeof f !== "function" || f.length == 0)) console.error(e);
1570
+ return typeof f === "function" && f.length ? untrack(() => f(e, () => setErrored())) : f;
1742
1571
  }
1743
- );
1572
+ return catchError(() => props.children, setErrored);
1573
+ }, undefined, {
1574
+ name: "value"
1575
+ } );
1744
1576
  }
1745
1577
 
1746
- const suspenseListEquals = (a, b) =>
1747
- a.showContent === b.showContent && a.showFallback === b.showFallback;
1578
+ const suspenseListEquals = (a, b) => a.showContent === b.showContent && a.showFallback === b.showFallback;
1748
1579
  const SuspenseListContext = createContext();
1749
1580
  function SuspenseList(props) {
1750
1581
  let [wrapper, setWrapper] = createSignal(() => ({
@@ -1756,51 +1587,51 @@ function SuspenseList(props) {
1756
1587
  if (listContext) {
1757
1588
  show = listContext.register(createMemo(() => wrapper()().inFallback));
1758
1589
  }
1759
- const resolved = createMemo(
1760
- prev => {
1761
- const reveal = props.revealOrder,
1762
- tail = props.tail,
1763
- { showContent = true, showFallback = true } = show ? show() : {},
1764
- reg = registry(),
1765
- reverse = reveal === "backwards";
1766
- if (reveal === "together") {
1767
- const all = reg.every(inFallback => !inFallback());
1768
- const res = reg.map(() => ({
1769
- showContent: all && showContent,
1590
+ const resolved = createMemo(prev => {
1591
+ const reveal = props.revealOrder,
1592
+ tail = props.tail,
1593
+ {
1594
+ showContent = true,
1595
+ showFallback = true
1596
+ } = show ? show() : {},
1597
+ reg = registry(),
1598
+ reverse = reveal === "backwards";
1599
+ if (reveal === "together") {
1600
+ const all = reg.every(inFallback => !inFallback());
1601
+ const res = reg.map(() => ({
1602
+ showContent: all && showContent,
1603
+ showFallback
1604
+ }));
1605
+ res.inFallback = !all;
1606
+ return res;
1607
+ }
1608
+ let stop = false;
1609
+ let inFallback = prev.inFallback;
1610
+ const res = [];
1611
+ for (let i = 0, len = reg.length; i < len; i++) {
1612
+ const n = reverse ? len - i - 1 : i,
1613
+ s = reg[n]();
1614
+ if (!stop && !s) {
1615
+ res[n] = {
1616
+ showContent,
1770
1617
  showFallback
1771
- }));
1772
- res.inFallback = !all;
1773
- return res;
1774
- }
1775
- let stop = false;
1776
- let inFallback = prev.inFallback;
1777
- const res = [];
1778
- for (let i = 0, len = reg.length; i < len; i++) {
1779
- const n = reverse ? len - i - 1 : i,
1780
- s = reg[n]();
1781
- if (!stop && !s) {
1782
- res[n] = {
1783
- showContent,
1784
- showFallback
1785
- };
1786
- } else {
1787
- const next = !stop;
1788
- if (next) inFallback = true;
1789
- res[n] = {
1790
- showContent: next,
1791
- showFallback: !tail || (next && tail === "collapsed") ? showFallback : false
1792
- };
1793
- stop = true;
1794
- }
1618
+ };
1619
+ } else {
1620
+ const next = !stop;
1621
+ if (next) inFallback = true;
1622
+ res[n] = {
1623
+ showContent: next,
1624
+ showFallback: !tail || next && tail === "collapsed" ? showFallback : false
1625
+ };
1626
+ stop = true;
1795
1627
  }
1796
- if (!stop) inFallback = false;
1797
- res.inFallback = inFallback;
1798
- return res;
1799
- },
1800
- {
1801
- inFallback: false
1802
1628
  }
1803
- );
1629
+ if (!stop) inFallback = false;
1630
+ res.inFallback = inFallback;
1631
+ return res;
1632
+ }, {
1633
+ inFallback: false
1634
+ });
1804
1635
  setWrapper(() => resolved);
1805
1636
  return createComponent(SuspenseListContext.Provider, {
1806
1637
  value: {
@@ -1875,14 +1706,17 @@ function Suspense(props) {
1875
1706
  ctx = sharedConfig.context;
1876
1707
  if (flicker) {
1877
1708
  flicker();
1878
- return (flicker = undefined);
1709
+ return flicker = undefined;
1879
1710
  }
1880
1711
  if (ctx && p === "$$f") setHydrateContext();
1881
1712
  const rendered = createMemo(() => props.children);
1882
1713
  return createMemo(prev => {
1883
1714
  const inFallback = store.inFallback(),
1884
- { showContent = true, showFallback = true } = show ? show() : {};
1885
- if ((!inFallback || (p && p !== "$$f")) && showContent) {
1715
+ {
1716
+ showContent = true,
1717
+ showFallback = true
1718
+ } = show ? show() : {};
1719
+ if ((!inFallback || p && p !== "$$f") && showContent) {
1886
1720
  store.resolved = true;
1887
1721
  dispose && dispose();
1888
1722
  dispose = ctx = p = undefined;
@@ -1912,68 +1746,9 @@ const DEV = {
1912
1746
  hooks: DevHooks,
1913
1747
  writeSignal,
1914
1748
  registerGraph
1915
- };
1749
+ } ;
1916
1750
  if (globalThis) {
1917
- if (!globalThis.Solid$$) globalThis.Solid$$ = true;
1918
- else
1919
- console.warn(
1920
- "You appear to have multiple instances of Solid. This can lead to unexpected behavior."
1921
- );
1751
+ if (!globalThis.Solid$$) globalThis.Solid$$ = true;else console.warn("You appear to have multiple instances of Solid. This can lead to unexpected behavior.");
1922
1752
  }
1923
1753
 
1924
- export {
1925
- $DEVCOMP,
1926
- $PROXY,
1927
- $TRACK,
1928
- DEV,
1929
- ErrorBoundary,
1930
- For,
1931
- Index,
1932
- Match,
1933
- Show,
1934
- Suspense,
1935
- SuspenseList,
1936
- Switch,
1937
- batch,
1938
- cancelCallback,
1939
- catchError,
1940
- children,
1941
- createComponent,
1942
- createComputed,
1943
- createContext,
1944
- createDeferred,
1945
- createEffect,
1946
- createMemo,
1947
- createReaction,
1948
- createRenderEffect,
1949
- createResource,
1950
- createRoot,
1951
- createSelector,
1952
- createSignal,
1953
- createUniqueId,
1954
- enableExternalSource,
1955
- enableHydration,
1956
- enableScheduling,
1957
- equalFn,
1958
- from,
1959
- getListener,
1960
- getOwner,
1961
- indexArray,
1962
- lazy,
1963
- mapArray,
1964
- mergeProps,
1965
- observable,
1966
- on,
1967
- onCleanup,
1968
- onError,
1969
- onMount,
1970
- requestCallback,
1971
- resetErrorBoundaries,
1972
- runWithOwner,
1973
- sharedConfig,
1974
- splitProps,
1975
- startTransition,
1976
- untrack,
1977
- useContext,
1978
- useTransition
1979
- };
1754
+ export { $DEVCOMP, $PROXY, $TRACK, DEV, ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, batch, cancelCallback, catchError, children, createComponent, createComputed, createContext, createDeferred, createEffect, createMemo, createReaction, createRenderEffect, createResource, createRoot, createSelector, createSignal, createUniqueId, enableExternalSource, enableHydration, enableScheduling, equalFn, from, getListener, getOwner, indexArray, lazy, mapArray, mergeProps, observable, on, onCleanup, onError, onMount, requestCallback, resetErrorBoundaries, runWithOwner, sharedConfig, splitProps, startTransition, untrack, useContext, useTransition };