@thyn/core 0.0.232 → 0.0.233

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/dist/element.js CHANGED
@@ -9,17 +9,6 @@ export function collectEffect(effectFn) {
9
9
  }
10
10
  collectingHead = effectFn;
11
11
  }
12
- // export function createReactiveTextNode(v) {
13
- // let n;
14
- // staticEffect(() => {
15
- // if (n) {
16
- // n.nodeValue = v();
17
- // } else {
18
- // n = document.createTextNode(v());
19
- // }
20
- // });
21
- // return n;
22
- // }
23
12
  export function createReactiveTextNode(v) {
24
13
  const n = document.createTextNode(v());
25
14
  staticEffect(() => {
@@ -252,9 +241,7 @@ export function list(props, terminal = false) {
252
241
  const teardownNode = terminal ? shallowTeardown : teardown;
253
242
  let parent;
254
243
  let outlet = document.createDocumentFragment();
255
- // State
256
- let prevItems = [];
257
- let rowNodes = []; // The "Shadow Array" - avoids reading DOM
244
+ let prevItems;
258
245
  const startBookend = document.createComment("");
259
246
  const endBookend = document.createComment("");
260
247
  startBookend.$frag = outlet;
@@ -262,151 +249,156 @@ export function list(props, terminal = false) {
262
249
  const render = props.render;
263
250
  staticEffect(() => {
264
251
  parent = startBookend.parentNode;
265
- // 1. Initialization / First Render
266
252
  if (!parent) {
267
- const items = props.items();
268
- // Render all items
269
- const newNodes = items.map(render);
270
- outlet.append(startBookend, ...newNodes, endBookend);
271
- // Save state
272
- prevItems = items;
273
- rowNodes = newNodes;
253
+ prevItems = props.items();
254
+ outlet.append(startBookend, ...prevItems.map(render), endBookend);
274
255
  return;
275
256
  }
276
- const nextItems = props.items();
277
- const newLength = nextItems.length;
257
+ let nextItems = props.items();
258
+ let newLength = nextItems.length;
278
259
  let oldLength = prevItems.length;
279
- // 2. Fast Path: Clear All
280
- if (newLength === 0) {
281
- if (oldLength !== 0) {
282
- for (let i = 0; i < oldLength; i++) {
283
- teardownNode(rowNodes[i]);
284
- remove(rowNodes[i]);
285
- }
286
- rowNodes = [];
287
- prevItems = [];
260
+ if (!oldLength && newLength) {
261
+ endBookend.before(...nextItems.map(render));
262
+ prevItems = nextItems;
263
+ nextItems = null;
264
+ return;
265
+ }
266
+ const childNodeList = parent.childNodes;
267
+ const childNodes = Array.from(childNodeList);
268
+ const offset = childNodes.indexOf(startBookend) + 1;
269
+ if (!newLength) {
270
+ const removalQueue = [];
271
+ const end = prevItems.length + offset;
272
+ for (let i = offset; i < end; i++) {
273
+ const ch = childNodeList[i];
274
+ teardownNode(ch);
275
+ removalQueue.push(ch);
288
276
  }
277
+ for (const ch of removalQueue) {
278
+ remove(ch);
279
+ }
280
+ prevItems = nextItems;
281
+ nextItems = null;
289
282
  return;
290
283
  }
291
- // 3. Fast Path: Create All (from empty)
292
- if (oldLength === 0) {
293
- const newNodes = nextItems.map(render);
294
- endBookend.before(...newNodes);
295
- rowNodes = newNodes;
284
+ let start = nextItems.findIndex((item, index) => prevItems[index] !== item);
285
+ if (start === oldLength) {
286
+ endBookend.before(...nextItems.slice(start).map(render));
296
287
  prevItems = nextItems;
288
+ nextItems = null;
297
289
  return;
298
290
  }
299
- // 4. Reconciliation
300
- let start = 0;
301
- let minLen = Math.min(oldLength, newLength);
302
- // Prefix Scan (Cheaper JS Array read vs DOM read)
303
- while (start < minLen && prevItems[start] === nextItems[start]) {
304
- start++;
291
+ if (start < 0) {
292
+ for (let i = nextItems.length; i < oldLength; i++) {
293
+ const e = childNodes[offset + --oldLength];
294
+ teardownNode(e);
295
+ remove(e);
296
+ }
297
+ prevItems = nextItems;
298
+ nextItems = null;
299
+ return;
305
300
  }
306
- // Optimization: Append only
307
- if (start === oldLength && newLength > oldLength) {
308
- const newPart = nextItems.slice(start);
309
- const newNodes = newPart.map(render);
310
- endBookend.before(...newNodes);
311
- rowNodes = rowNodes.concat(newNodes);
301
+ if (start >= newLength) {
302
+ while (start < oldLength) {
303
+ const e = childNodes[offset + --oldLength];
304
+ teardownNode(e);
305
+ remove(e);
306
+ }
312
307
  prevItems = nextItems;
308
+ nextItems = null;
313
309
  return;
314
310
  }
315
- // Optimization: Truncate only
316
- if (start === newLength && oldLength > newLength) {
317
- for (let i = start; i < oldLength; i++) {
318
- teardownNode(rowNodes[i]);
319
- remove(rowNodes[i]);
311
+ // suffix
312
+ for (oldLength--, newLength--; newLength > start &&
313
+ oldLength >= start &&
314
+ nextItems[newLength] === prevItems[oldLength]; oldLength--, newLength--)
315
+ ;
316
+ const nextKeys = new Set(nextItems);
317
+ const removalQueue = [];
318
+ for (let i = start; i <= oldLength; i++) {
319
+ if (!nextKeys.has(prevItems[i])) {
320
+ const ch = childNodes[i + offset];
321
+ teardownNode(ch);
322
+ removalQueue.push(ch);
323
+ childNodes[i + offset] = null;
320
324
  }
321
- rowNodes.length = newLength; // JS Array Truncate
325
+ }
326
+ for (const e of removalQueue) {
327
+ remove(e);
328
+ }
329
+ if (oldLength - start === removalQueue.length) {
322
330
  prevItems = nextItems;
331
+ nextItems = null;
323
332
  return;
324
333
  }
325
- // Suffix Scan
326
- let end = 0;
327
- // We stop if the suffix hits the prefix
328
- while (newLength - 1 - end >= start &&
329
- oldLength - 1 - end >= start &&
330
- nextItems[newLength - 1 - end] === prevItems[oldLength - 1 - end]) {
331
- end++;
332
- }
333
- // 5. Complex Diff (The Middle)
334
- const oldStart = start;
335
- const oldEnd = oldLength - end;
336
- const newEnd = newLength - end;
337
- // A. Build Map of existing items in the "changed" region
338
- // key -> { node, index }
339
- const keyMap = new Map();
340
- for (let i = oldStart; i < oldEnd; i++) {
341
- const item = prevItems[i];
342
- // If duplicate items exist, first one wins or logic needs to be more robust.
343
- // Assuming unique keys for simplicity or using last-write-wins:
344
- // if (!keyMap.has(item)) {
345
- keyMap.set(item, rowNodes[i]);
346
- // } else {
347
- // Handle duplicates by removing the extra immediately?
348
- // Or handle collision. For now, assume distinct items or standard behavior.
349
- // }
334
+ let keyMap = new Map();
335
+ for (let i = start; i <= oldLength; i++) {
336
+ if (childNodes[i + offset] &&
337
+ (!nextItems[i] ||
338
+ prevItems[i] !== nextItems[i])) {
339
+ keyMap.set(prevItems[i], {
340
+ el: childNodes[i + offset],
341
+ item: prevItems[i],
342
+ });
343
+ }
350
344
  }
351
- // B. Setup for new node list construction
352
- const nextRowNodes = new Array(newLength);
353
- // Copy Prefix
354
- for (let i = 0; i < start; i++) {
355
- nextRowNodes[i] = rowNodes[i];
356
- }
357
- // Copy Suffix
358
- for (let i = 0; i < end; i++) {
359
- nextRowNodes[newLength - 1 - i] = rowNodes[oldLength - 1 - i];
360
- }
361
- // C. Find anchor for insertions
362
- // We insert before the first node of the suffix, or the endBookend.
363
- const anchor = (end > 0) ? rowNodes[oldLength - end] : endBookend;
364
- // D. Iterate new middle
365
- for (let i = oldStart; i < newEnd; i++) {
366
- const newItem = nextItems[i];
367
- let node;
368
- if (keyMap.has(newItem)) {
369
- // Reuse existing
370
- node = keyMap.get(newItem);
371
- keyMap.delete(newItem);
372
- // DOM Move:
373
- // We always insertBefore the anchor.
374
- // Since we are iterating forward, "anchor" isn't static.
375
- // Actually, simply inserting before the *current* anchor works if we
376
- // process carefully, but standard "place and move cursor" is safer.
377
- parent.insertBefore(node, anchor);
345
+ if (newLength === oldLength && keyMap.size > (newLength - start + 1) / 2) {
346
+ const lastOrdered = childNodes[start + offset - 1];
347
+ const set = [];
348
+ for (let i = start; i <= newLength; i++) {
349
+ set.push(keyMap.get(nextItems[i])?.el ?? childNodes[i + offset]);
378
350
  }
379
- else {
380
- // Create new
381
- node = render(newItem);
382
- parent.insertBefore(node, anchor);
351
+ lastOrdered.after(...set);
352
+ prevItems = nextItems;
353
+ keyMap = null;
354
+ nextItems = null;
355
+ return;
356
+ }
357
+ while (start <= newLength) {
358
+ const newChd = nextItems[start];
359
+ const oldChd = prevItems[start];
360
+ if (newChd === oldChd) {
361
+ start++;
362
+ continue;
363
+ }
364
+ if (oldChd === undefined) {
365
+ parent.insertBefore(render(newChd), endBookend);
366
+ start++;
367
+ continue;
368
+ }
369
+ const mappedOld = keyMap.get(newChd);
370
+ if (mappedOld) {
371
+ const oldDom = childNodeList[start + offset];
372
+ const { el, item } = mappedOld;
373
+ if (oldDom !== el) {
374
+ const tmp = el.nextSibling;
375
+ parent.insertBefore(el, oldDom);
376
+ parent.insertBefore(oldDom, tmp);
377
+ }
378
+ else if (item !== newChd) {
379
+ replaceWith(newChd, el, render);
380
+ }
381
+ keyMap.delete(newChd);
383
382
  }
384
- nextRowNodes[i] = node;
385
- }
386
- // E. Cleanup
387
- // Anything remaining in keyMap is gone
388
- for (const node of keyMap.values()) {
389
- teardownNode(node);
390
- remove(node);
391
- }
392
- // Handle "middle" items that weren't in keyMap (duplicates logic)
393
- // or implicit removals handled by the map logic.
394
- // Specifically: We iterated [oldStart...oldEnd] to build the map.
395
- // If an item was in that range but NOT in the new range, it's in the map.
396
- // If it WAS in the new range, we removed it from the map.
397
- // So map.values() is exactly what needs to die.
398
- // Update State
399
- rowNodes = nextRowNodes;
383
+ else if (oldChd !== newChd) {
384
+ parent.insertBefore(render(newChd), childNodeList[start + offset]);
385
+ }
386
+ start++;
387
+ }
388
+ for (const { el } of keyMap.values()) {
389
+ teardownNode(el);
390
+ remove(el);
391
+ }
392
+ keyMap = null;
400
393
  prevItems = nextItems;
394
+ nextItems = null;
401
395
  });
402
396
  return outlet;
403
397
  }
404
398
  export function isolatedTerminalList(props) {
405
399
  let parent;
406
400
  let outlet = document.createDocumentFragment();
407
- // State
408
- let prevItems = [];
409
- let rowNodes = []; // The "Shadow Array"
401
+ let prevItems;
410
402
  const startBookend = document.createComment("");
411
403
  const endBookend = document.createComment("");
412
404
  startBookend.$frag = outlet;
@@ -414,121 +406,160 @@ export function isolatedTerminalList(props) {
414
406
  const render = props.render;
415
407
  staticEffect(() => {
416
408
  parent = startBookend.parentNode;
417
- // 1. Initialization
418
409
  if (!parent) {
419
- const items = props.items();
420
- const newNodes = items.map(render);
421
- outlet.append(startBookend, ...newNodes, endBookend);
422
- prevItems = items;
423
- rowNodes = newNodes;
410
+ prevItems = props.items();
411
+ outlet.append(startBookend, ...prevItems.map(render), endBookend);
424
412
  return;
425
413
  }
426
- const nextItems = props.items();
427
- const newLength = nextItems.length;
428
- const oldLength = prevItems.length;
429
- // 2. Fast Path: Clear All
430
- if (newLength === 0) {
431
- if (oldLength !== 0) {
432
- // Optimization: If the parent only contains our list (between bookends),
433
- // we might want to use textContent = "". However, to be safe with
434
- // bookends logic, we remove specifically known nodes.
435
- for (let i = 0; i < oldLength; i++) {
436
- const node = rowNodes[i];
437
- shallowTeardown(node);
438
- // node.remove();
439
- }
440
- parent.textContent = "";
441
- parent.append(startBookend, endBookend);
442
- rowNodes = [];
443
- prevItems = [];
414
+ let nextItems = props.items();
415
+ let newLength = nextItems.length;
416
+ let oldLength = prevItems.length;
417
+ if (!oldLength && newLength) {
418
+ endBookend.before(...nextItems.map(render));
419
+ prevItems = nextItems;
420
+ nextItems = null;
421
+ return;
422
+ }
423
+ const childNodeList = parent.childNodes;
424
+ if (!newLength) {
425
+ const end = childNodeList.length - 1;
426
+ for (let i = 1; i < end; i++) {
427
+ shallowTeardown(childNodeList[i]);
444
428
  }
429
+ parent.textContent = "";
430
+ parent.append(startBookend, endBookend);
431
+ prevItems = nextItems;
432
+ nextItems = null;
445
433
  return;
446
434
  }
447
- // 3. Fast Path: Create All
448
- if (oldLength === 0) {
449
- const newNodes = nextItems.map(render);
450
- endBookend.before(...newNodes);
451
- rowNodes = newNodes;
435
+ let start = nextItems.findIndex((item, index) => prevItems[index] !== item);
436
+ if (start === oldLength) {
437
+ endBookend.before(...nextItems.slice(start).map(render));
452
438
  prevItems = nextItems;
439
+ nextItems = null;
453
440
  return;
454
441
  }
455
- // 4. Reconciliation
456
- let start = 0;
457
- const minLen = Math.min(oldLength, newLength);
458
- // Prefix Scan
459
- while (start < minLen && prevItems[start] === nextItems[start]) {
460
- start++;
442
+ let childNodes = Array.from(childNodeList);
443
+ if (start < 0) {
444
+ for (let i = nextItems.length; i < oldLength; i++) {
445
+ const e = childNodes[1 + --oldLength];
446
+ shallowTeardown(e);
447
+ e.remove();
448
+ }
449
+ prevItems = nextItems;
450
+ nextItems = null;
451
+ childNodes = null;
452
+ return;
453
+ }
454
+ if (start >= newLength) {
455
+ while (start < oldLength) {
456
+ const e = childNodes[1 + --oldLength];
457
+ shallowTeardown(e);
458
+ e.remove();
459
+ }
460
+ prevItems = nextItems;
461
+ nextItems = null;
462
+ childNodes = null;
463
+ return;
464
+ }
465
+ // suffix
466
+ for (oldLength--, newLength--; newLength > start &&
467
+ oldLength >= start &&
468
+ nextItems[newLength] === prevItems[oldLength]; oldLength--, newLength--)
469
+ ;
470
+ const nextKeys = new Set(nextItems);
471
+ const removalQueue = [];
472
+ for (let i = start; i <= oldLength; i++) {
473
+ if (!nextKeys.has(prevItems[i])) {
474
+ const ch = childNodes[i + 1];
475
+ shallowTeardown(ch);
476
+ removalQueue.push(ch);
477
+ childNodes[i + 1] = null;
478
+ }
461
479
  }
462
- // Optimization: Append Suffix
463
- if (start === oldLength && newLength > oldLength) {
464
- const newPart = nextItems.slice(start);
465
- const newNodes = newPart.map(render);
466
- endBookend.before(...newNodes);
467
- rowNodes = rowNodes.concat(newNodes);
480
+ if (removalQueue.length === prevItems.length) {
481
+ parent.textContent = "";
482
+ parent.append(startBookend, ...nextItems.map(render), endBookend);
468
483
  prevItems = nextItems;
484
+ nextItems = null;
485
+ childNodes = null;
469
486
  return;
470
487
  }
471
- // Optimization: Truncate Suffix
472
- if (start === newLength && oldLength > newLength) {
473
- for (let i = start; i < oldLength; i++) {
474
- const node = rowNodes[i];
475
- shallowTeardown(node);
476
- node.remove();
488
+ for (const e of removalQueue) {
489
+ e.remove();
490
+ }
491
+ if (oldLength - start === removalQueue.length) {
492
+ prevItems = nextItems;
493
+ nextItems = null;
494
+ childNodes = null;
495
+ return;
496
+ }
497
+ let keyMap = new Map();
498
+ for (let i = start; i <= oldLength; i++) {
499
+ if (childNodes[i + 1] &&
500
+ (!nextItems[i] ||
501
+ prevItems[i] !== nextItems[i])) {
502
+ keyMap.set(prevItems[i], {
503
+ el: childNodes[i + 1],
504
+ item: prevItems[i],
505
+ });
506
+ }
507
+ }
508
+ if (newLength === oldLength && keyMap.size > (newLength - start + 1) / 2) {
509
+ const lastOrdered = childNodes[start];
510
+ // const set = [];
511
+ // for (let i = start; i <= newLength; i++) {
512
+ // set.push(keyMap.get(nextItems[i])?.el ?? childNodes[i + 1]);
513
+ // }
514
+ // lastOrdered.after(...set);
515
+ for (let i = newLength; i >= start; i--) {
516
+ lastOrdered.after(keyMap.get(nextItems[i])?.el ?? childNodes[i + 1]);
477
517
  }
478
- rowNodes.length = newLength;
479
518
  prevItems = nextItems;
519
+ keyMap = null;
520
+ nextItems = null;
521
+ childNodes = null;
480
522
  return;
481
523
  }
482
- // Suffix Scan
483
- let end = 0;
484
- while (newLength - 1 - end >= start &&
485
- oldLength - 1 - end >= start &&
486
- nextItems[newLength - 1 - end] === prevItems[oldLength - 1 - end]) {
487
- end++;
488
- }
489
- // 5. Complex Diff (The Middle)
490
- const oldStart = start;
491
- const oldEnd = oldLength - end;
492
- const newEnd = newLength - end;
493
- // A. Build Map
494
- const keyMap = new Map();
495
- for (let i = oldStart; i < oldEnd; i++) {
496
- const item = prevItems[i];
497
- keyMap.set(item, rowNodes[i]);
498
- }
499
- const nextRowNodes = new Array(newLength);
500
- // Copy Prefix
501
- for (let i = 0; i < start; i++) {
502
- nextRowNodes[i] = rowNodes[i];
503
- }
504
- // Copy Suffix
505
- for (let i = 0; i < end; i++) {
506
- nextRowNodes[newLength - 1 - i] = rowNodes[oldLength - 1 - i];
507
- }
508
- // Determine Anchor (The first node of the suffix, or the end bookend)
509
- const anchor = (end > 0) ? rowNodes[oldLength - end] : endBookend;
510
- // B. Process Middle
511
- for (let i = oldStart; i < newEnd; i++) {
512
- const newItem = nextItems[i];
513
- if (keyMap.has(newItem)) {
514
- const node = keyMap.get(newItem);
515
- keyMap.delete(newItem);
516
- parent.insertBefore(node, anchor);
517
- nextRowNodes[i] = node;
524
+ while (start <= newLength) {
525
+ const newChd = nextItems[start];
526
+ const oldChd = prevItems[start];
527
+ if (newChd === oldChd) {
528
+ start++;
529
+ continue;
518
530
  }
519
- else {
520
- const node = render(newItem);
521
- parent.insertBefore(node, anchor);
522
- nextRowNodes[i] = node;
531
+ if (oldChd === undefined) {
532
+ parent.insertBefore(render(newChd), endBookend);
533
+ start++;
534
+ continue;
523
535
  }
536
+ const mappedOld = keyMap.get(newChd);
537
+ if (mappedOld) {
538
+ const oldDom = childNodeList[start + 1];
539
+ const { el, item } = mappedOld;
540
+ if (oldDom !== el) {
541
+ const tmp = el.nextSibling;
542
+ parent.insertBefore(el, oldDom);
543
+ parent.insertBefore(oldDom, tmp);
544
+ }
545
+ else if (item !== newChd) {
546
+ replaceWith(newChd, el, render);
547
+ }
548
+ keyMap.delete(newChd);
549
+ }
550
+ else if (oldChd !== newChd) {
551
+ parent.insertBefore(render(newChd), childNodeList[start + 1]);
552
+ }
553
+ start++;
524
554
  }
525
- // C. Cleanup Unused
526
- for (const node of keyMap.values()) {
527
- shallowTeardown(node);
528
- node.remove();
555
+ for (const { el } of keyMap.values()) {
556
+ shallowTeardown(el);
557
+ el.remove();
529
558
  }
530
- rowNodes = nextRowNodes;
559
+ keyMap = null;
531
560
  prevItems = nextItems;
561
+ nextItems = null;
562
+ childNodes = null;
532
563
  });
533
564
  return outlet;
534
565
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thyn/core",
3
- "version": "0.0.232",
3
+ "version": "0.0.233",
4
4
  "scripts": {
5
5
  "build": "tsc",
6
6
  "pub": "tsc && npm version patch -f && npm -f publish --access=public",
package/src/element.ts CHANGED
@@ -13,18 +13,6 @@ export function collectEffect(effectFn) {
13
13
  collectingHead = effectFn;
14
14
  }
15
15
 
16
- // export function createReactiveTextNode(v) {
17
- // let n;
18
- // staticEffect(() => {
19
- // if (n) {
20
- // n.nodeValue = v();
21
- // } else {
22
- // n = document.createTextNode(v());
23
- // }
24
- // });
25
- // return n;
26
- // }
27
-
28
16
  export function createReactiveTextNode(v) {
29
17
  const n = document.createTextNode(v());
30
18
  staticEffect(() => {
@@ -270,342 +258,347 @@ export function list(props, terminal = false) {
270
258
  const teardownNode = terminal ? shallowTeardown : teardown;
271
259
  let parent;
272
260
  let outlet = document.createDocumentFragment();
273
-
274
- // State
275
- let prevItems = [];
276
- let rowNodes = []; // The "Shadow Array" - avoids reading DOM
277
-
261
+ let prevItems;
278
262
  const startBookend = document.createComment("") as any;
279
263
  const endBookend = document.createComment("") as any;
280
-
281
264
  startBookend.$frag = outlet;
282
265
  startBookend.$end = endBookend;
283
-
284
266
  const render = props.render;
285
267
 
286
268
  staticEffect(() => {
287
269
  parent = startBookend.parentNode;
288
-
289
- // 1. Initialization / First Render
290
270
  if (!parent) {
291
- const items = props.items();
292
- // Render all items
293
- const newNodes = items.map(render);
294
-
295
- outlet.append(startBookend, ...newNodes, endBookend);
296
-
297
- // Save state
298
- prevItems = items;
299
- rowNodes = newNodes;
271
+ prevItems = props.items();
272
+ outlet.append(startBookend, ...prevItems.map(render), endBookend);
300
273
  return;
301
274
  }
302
-
303
- const nextItems = props.items();
304
- const newLength = nextItems.length;
275
+ let nextItems = props.items();
276
+ let newLength = nextItems.length;
305
277
  let oldLength = prevItems.length;
306
-
307
- // 2. Fast Path: Clear All
308
- if (newLength === 0) {
309
- if (oldLength !== 0) {
310
- for (let i = 0; i < oldLength; i++) {
311
- teardownNode(rowNodes[i]);
312
- remove(rowNodes[i]);
313
- }
314
- rowNodes = [];
315
- prevItems = [];
316
- }
278
+ if (!oldLength && newLength) {
279
+ endBookend.before(...nextItems.map(render))
280
+ prevItems = nextItems;
281
+ nextItems = null;
317
282
  return;
318
283
  }
319
-
320
- // 3. Fast Path: Create All (from empty)
321
- if (oldLength === 0) {
322
- const newNodes = nextItems.map(render);
323
- endBookend.before(...newNodes);
324
- rowNodes = newNodes;
284
+ const childNodeList = parent.childNodes as NodeListOf<ChildNode>;
285
+ const childNodes = Array.from(childNodeList);
286
+ const offset = childNodes.indexOf(startBookend) + 1;
287
+ if (!newLength) {
288
+ const removalQueue = [];
289
+ const end = prevItems.length + offset;
290
+ for (let i = offset; i < end; i++) {
291
+ const ch = childNodeList[i];
292
+ teardownNode(ch);
293
+ removalQueue.push(ch);
294
+ }
295
+ for (const ch of removalQueue) {
296
+ remove(ch);
297
+ }
325
298
  prevItems = nextItems;
299
+ nextItems = null;
326
300
  return;
327
301
  }
328
302
 
329
- // 4. Reconciliation
330
- let start = 0;
331
- let minLen = Math.min(oldLength, newLength);
332
-
333
- // Prefix Scan (Cheaper JS Array read vs DOM read)
334
- while (start < minLen && prevItems[start] === nextItems[start]) {
335
- start++;
303
+ let start = nextItems.findIndex((item, index) => prevItems[index] !== item);
304
+ if (start === oldLength) {
305
+ endBookend.before(...nextItems.slice(start).map(render));
306
+ prevItems = nextItems;
307
+ nextItems = null;
308
+ return;
336
309
  }
337
310
 
338
- // Optimization: Append only
339
- if (start === oldLength && newLength > oldLength) {
340
- const newPart = nextItems.slice(start);
341
- const newNodes = newPart.map(render);
342
- endBookend.before(...newNodes);
343
-
344
- rowNodes = rowNodes.concat(newNodes);
311
+ if (start < 0) {
312
+ for (let i = nextItems.length; i < oldLength; i++) {
313
+ const e = childNodes[offset + --oldLength];
314
+ teardownNode(e);
315
+ remove(e);
316
+ }
345
317
  prevItems = nextItems;
318
+ nextItems = null;
346
319
  return;
347
320
  }
348
321
 
349
- // Optimization: Truncate only
350
- if (start === newLength && oldLength > newLength) {
351
- for (let i = start; i < oldLength; i++) {
352
- teardownNode(rowNodes[i]);
353
- remove(rowNodes[i]);
322
+ if (start >= newLength) {
323
+ while (start < oldLength) {
324
+ const e = childNodes[offset + --oldLength];
325
+ teardownNode(e);
326
+ remove(e);
354
327
  }
355
- rowNodes.length = newLength; // JS Array Truncate
356
328
  prevItems = nextItems;
329
+ nextItems = null;
357
330
  return;
358
331
  }
359
332
 
360
- // Suffix Scan
361
- let end = 0;
362
- // We stop if the suffix hits the prefix
363
- while (
364
- newLength - 1 - end >= start &&
365
- oldLength - 1 - end >= start &&
366
- nextItems[newLength - 1 - end] === prevItems[oldLength - 1 - end]
367
- ) {
368
- end++;
369
- }
370
-
371
- // 5. Complex Diff (The Middle)
372
- const oldStart = start;
373
- const oldEnd = oldLength - end;
374
- const newEnd = newLength - end;
375
-
376
- // A. Build Map of existing items in the "changed" region
377
- // key -> { node, index }
378
- const keyMap = new Map();
379
- for (let i = oldStart; i < oldEnd; i++) {
380
- const item = prevItems[i];
381
- // If duplicate items exist, first one wins or logic needs to be more robust.
382
- // Assuming unique keys for simplicity or using last-write-wins:
383
- // if (!keyMap.has(item)) {
384
- keyMap.set(item, rowNodes[i]);
385
- // } else {
386
- // Handle duplicates by removing the extra immediately?
387
- // Or handle collision. For now, assume distinct items or standard behavior.
388
- // }
333
+ // suffix
334
+ for (
335
+ oldLength--, newLength--;
336
+ newLength > start &&
337
+ oldLength >= start &&
338
+ nextItems[newLength] === prevItems[oldLength];
339
+ oldLength--, newLength--
340
+ );
341
+
342
+ const nextKeys = new Set(nextItems);
343
+ const removalQueue = [];
344
+ for (let i = start; i <= oldLength; i++) {
345
+ if (!nextKeys.has(prevItems[i])) {
346
+ const ch = childNodes[i + offset];
347
+ teardownNode(ch);
348
+ removalQueue.push(ch);
349
+ childNodes[i + offset] = null;
350
+ }
389
351
  }
390
-
391
- // B. Setup for new node list construction
392
- const nextRowNodes = new Array(newLength);
393
-
394
- // Copy Prefix
395
- for (let i = 0; i < start; i++) {
396
- nextRowNodes[i] = rowNodes[i];
352
+ for (const e of removalQueue) {
353
+ remove(e);
397
354
  }
398
- // Copy Suffix
399
- for (let i = 0; i < end; i++) {
400
- nextRowNodes[newLength - 1 - i] = rowNodes[oldLength - 1 - i];
355
+ if (oldLength - start === removalQueue.length) {
356
+ prevItems = nextItems;
357
+ nextItems = null;
358
+ return;
401
359
  }
402
-
403
- // C. Find anchor for insertions
404
- // We insert before the first node of the suffix, or the endBookend.
405
- const anchor = (end > 0) ? rowNodes[oldLength - end] : endBookend;
406
-
407
- // D. Iterate new middle
408
- for (let i = oldStart; i < newEnd; i++) {
409
- const newItem = nextItems[i];
410
- let node;
411
-
412
- if (keyMap.has(newItem)) {
413
- // Reuse existing
414
- node = keyMap.get(newItem);
415
- keyMap.delete(newItem);
416
-
417
- // DOM Move:
418
- // We always insertBefore the anchor.
419
- // Since we are iterating forward, "anchor" isn't static.
420
- // Actually, simply inserting before the *current* anchor works if we
421
- // process carefully, but standard "place and move cursor" is safer.
422
- parent.insertBefore(node, anchor);
423
- } else {
424
- // Create new
425
- node = render(newItem);
426
- parent.insertBefore(node, anchor);
360
+ let keyMap = new Map();
361
+ for (let i = start; i <= oldLength; i++) {
362
+ if (
363
+ childNodes[i + offset] &&
364
+ (!nextItems[i] ||
365
+ prevItems[i] !== nextItems[i])
366
+ ) {
367
+ keyMap.set(prevItems[i], {
368
+ el: childNodes[i + offset],
369
+ item: prevItems[i],
370
+ });
427
371
  }
428
- nextRowNodes[i] = node;
429
372
  }
430
-
431
- // E. Cleanup
432
- // Anything remaining in keyMap is gone
433
- for (const node of keyMap.values()) {
434
- teardownNode(node);
435
- remove(node);
373
+ if (newLength === oldLength && keyMap.size > (newLength - start + 1) / 2) {
374
+ const lastOrdered = childNodes[start + offset - 1];
375
+ const set = [];
376
+ for (let i = start; i <= newLength; i++) {
377
+ set.push(keyMap.get(nextItems[i])?.el ?? childNodes[i + offset]);
378
+ }
379
+ lastOrdered.after(...set);
380
+ prevItems = nextItems;
381
+ keyMap = null;
382
+ nextItems = null;
383
+ return;
436
384
  }
437
385
 
438
- // Handle "middle" items that weren't in keyMap (duplicates logic)
439
- // or implicit removals handled by the map logic.
440
- // Specifically: We iterated [oldStart...oldEnd] to build the map.
441
- // If an item was in that range but NOT in the new range, it's in the map.
442
- // If it WAS in the new range, we removed it from the map.
443
- // So map.values() is exactly what needs to die.
444
-
445
- // Update State
446
- rowNodes = nextRowNodes;
386
+ while (start <= newLength) {
387
+ const newChd = nextItems[start];
388
+ const oldChd = prevItems[start];
389
+ if (newChd === oldChd) {
390
+ start++;
391
+ continue;
392
+ }
393
+ if (oldChd === undefined) {
394
+ parent.insertBefore(render(newChd), endBookend);
395
+ start++;
396
+ continue;
397
+ }
398
+ const mappedOld = keyMap.get(newChd);
399
+ if (mappedOld) {
400
+ const oldDom = childNodeList[start + offset];
401
+ const { el, item } = mappedOld;
402
+ if (oldDom !== el) {
403
+ const tmp = el.nextSibling;
404
+ parent.insertBefore(el, oldDom);
405
+ parent.insertBefore(oldDom, tmp);
406
+ } else if (item !== newChd) {
407
+ replaceWith(newChd, el, render);
408
+ }
409
+ keyMap.delete(newChd);
410
+ } else if (oldChd !== newChd) {
411
+ parent.insertBefore(render(newChd), childNodeList[start + offset]);
412
+ }
413
+ start++;
414
+ }
415
+ for (const { el } of keyMap.values()) {
416
+ teardownNode(el);
417
+ remove(el);
418
+ }
419
+ keyMap = null;
447
420
  prevItems = nextItems;
421
+ nextItems = null;
448
422
  });
449
-
450
423
  return outlet;
451
424
  }
425
+
452
426
  export function isolatedTerminalList(props) {
453
427
  let parent;
454
428
  let outlet = document.createDocumentFragment();
455
-
456
- // State
457
- let prevItems = [];
458
- let rowNodes = []; // The "Shadow Array"
459
-
429
+ let prevItems;
460
430
  const startBookend = document.createComment("") as any;
461
431
  const endBookend = document.createComment("") as any;
462
-
463
432
  startBookend.$frag = outlet;
464
433
  startBookend.$end = endBookend;
465
-
466
434
  const render = props.render;
467
435
 
468
436
  staticEffect(() => {
469
437
  parent = startBookend.parentNode;
470
-
471
- // 1. Initialization
472
438
  if (!parent) {
473
- const items = props.items();
474
- const newNodes = items.map(render);
475
-
476
- outlet.append(startBookend, ...newNodes, endBookend);
477
-
478
- prevItems = items;
479
- rowNodes = newNodes;
439
+ prevItems = props.items();
440
+ outlet.append(startBookend, ...prevItems.map(render), endBookend);
480
441
  return;
481
442
  }
482
-
483
- const nextItems = props.items();
484
- const newLength = nextItems.length;
485
- const oldLength = prevItems.length;
486
-
487
- // 2. Fast Path: Clear All
488
- if (newLength === 0) {
489
- if (oldLength !== 0) {
490
- // Optimization: If the parent only contains our list (between bookends),
491
- // we might want to use textContent = "". However, to be safe with
492
- // bookends logic, we remove specifically known nodes.
493
- for (let i = 0; i < oldLength; i++) {
494
- const node = rowNodes[i];
495
- shallowTeardown(node);
496
- // node.remove();
497
- }
498
- parent.textContent = "";
499
- parent.append(startBookend, endBookend);
500
- rowNodes = [];
501
- prevItems = [];
443
+ let nextItems = props.items();
444
+ let newLength = nextItems.length;
445
+ let oldLength = prevItems.length;
446
+ if (!oldLength && newLength) {
447
+ endBookend.before(...nextItems.map(render))
448
+ prevItems = nextItems;
449
+ nextItems = null;
450
+ return;
451
+ }
452
+ const childNodeList = parent.childNodes as NodeListOf<ChildNode>;
453
+ if (!newLength) {
454
+ const end = childNodeList.length - 1;
455
+ for (let i = 1; i < end; i++) {
456
+ shallowTeardown(childNodeList[i]);
502
457
  }
458
+ parent.textContent = "";
459
+ parent.append(startBookend, endBookend);
460
+ prevItems = nextItems;
461
+ nextItems = null;
503
462
  return;
504
463
  }
505
464
 
506
- // 3. Fast Path: Create All
507
- if (oldLength === 0) {
508
- const newNodes = nextItems.map(render);
509
- endBookend.before(...newNodes);
510
-
511
- rowNodes = newNodes;
465
+ let start = nextItems.findIndex((item, index) => prevItems[index] !== item);
466
+ if (start === oldLength) {
467
+ endBookend.before(...nextItems.slice(start).map(render));
512
468
  prevItems = nextItems;
469
+ nextItems = null;
513
470
  return;
514
471
  }
515
472
 
516
- // 4. Reconciliation
517
- let start = 0;
518
- const minLen = Math.min(oldLength, newLength);
519
-
520
- // Prefix Scan
521
- while (start < minLen && prevItems[start] === nextItems[start]) {
522
- start++;
473
+ let childNodes = Array.from(childNodeList);
474
+ if (start < 0) {
475
+ for (let i = nextItems.length; i < oldLength; i++) {
476
+ const e = childNodes[1 + --oldLength];
477
+ shallowTeardown(e);
478
+ e.remove();
479
+ }
480
+ prevItems = nextItems;
481
+ nextItems = null;
482
+ childNodes = null;
483
+ return;
523
484
  }
524
485
 
525
- // Optimization: Append Suffix
526
- if (start === oldLength && newLength > oldLength) {
527
- const newPart = nextItems.slice(start);
528
- const newNodes = newPart.map(render);
529
- endBookend.before(...newNodes);
530
-
531
- rowNodes = rowNodes.concat(newNodes);
486
+ if (start >= newLength) {
487
+ while (start < oldLength) {
488
+ const e = childNodes[1 + --oldLength];
489
+ shallowTeardown(e);
490
+ e.remove();
491
+ }
532
492
  prevItems = nextItems;
493
+ nextItems = null;
494
+ childNodes = null;
533
495
  return;
534
496
  }
535
497
 
536
- // Optimization: Truncate Suffix
537
- if (start === newLength && oldLength > newLength) {
538
- for (let i = start; i < oldLength; i++) {
539
- const node = rowNodes[i];
540
- shallowTeardown(node);
541
- node.remove();
498
+ // suffix
499
+ for (
500
+ oldLength--, newLength--;
501
+ newLength > start &&
502
+ oldLength >= start &&
503
+ nextItems[newLength] === prevItems[oldLength];
504
+ oldLength--, newLength--
505
+ );
506
+
507
+ const nextKeys = new Set(nextItems);
508
+ const removalQueue = [];
509
+ for (let i = start; i <= oldLength; i++) {
510
+ if (!nextKeys.has(prevItems[i])) {
511
+ const ch = childNodes[i + 1];
512
+ shallowTeardown(ch);
513
+ removalQueue.push(ch);
514
+ childNodes[i + 1] = null;
542
515
  }
543
- rowNodes.length = newLength;
516
+ }
517
+ if (removalQueue.length === prevItems.length) {
518
+ parent.textContent = "";
519
+ parent.append(startBookend, ...nextItems.map(render), endBookend);
544
520
  prevItems = nextItems;
521
+ nextItems = null;
522
+ childNodes = null;
545
523
  return;
546
524
  }
547
-
548
- // Suffix Scan
549
- let end = 0;
550
- while (
551
- newLength - 1 - end >= start &&
552
- oldLength - 1 - end >= start &&
553
- nextItems[newLength - 1 - end] === prevItems[oldLength - 1 - end]
554
- ) {
555
- end++;
525
+ for (const e of removalQueue) {
526
+ e.remove();
556
527
  }
557
-
558
- // 5. Complex Diff (The Middle)
559
- const oldStart = start;
560
- const oldEnd = oldLength - end;
561
- const newEnd = newLength - end;
562
-
563
- // A. Build Map
564
- const keyMap = new Map();
565
- for (let i = oldStart; i < oldEnd; i++) {
566
- const item = prevItems[i];
567
- keyMap.set(item, rowNodes[i]);
528
+ if (oldLength - start === removalQueue.length) {
529
+ prevItems = nextItems;
530
+ nextItems = null;
531
+ childNodes = null;
532
+ return;
568
533
  }
569
-
570
- const nextRowNodes = new Array(newLength);
571
-
572
- // Copy Prefix
573
- for (let i = 0; i < start; i++) {
574
- nextRowNodes[i] = rowNodes[i];
534
+ let keyMap = new Map();
535
+ for (let i = start; i <= oldLength; i++) {
536
+ if (
537
+ childNodes[i + 1] &&
538
+ (!nextItems[i] ||
539
+ prevItems[i] !== nextItems[i])
540
+ ) {
541
+ keyMap.set(prevItems[i], {
542
+ el: childNodes[i + 1],
543
+ item: prevItems[i],
544
+ });
545
+ }
575
546
  }
576
- // Copy Suffix
577
- for (let i = 0; i < end; i++) {
578
- nextRowNodes[newLength - 1 - i] = rowNodes[oldLength - 1 - i];
547
+ if (newLength === oldLength && keyMap.size > (newLength - start + 1) / 2) {
548
+ const lastOrdered = childNodes[start];
549
+ // const set = [];
550
+ // for (let i = start; i <= newLength; i++) {
551
+ // set.push(keyMap.get(nextItems[i])?.el ?? childNodes[i + 1]);
552
+ // }
553
+ // lastOrdered.after(...set);
554
+ for (let i = newLength; i >= start; i--) {
555
+ lastOrdered.after(keyMap.get(nextItems[i])?.el ?? childNodes[i + 1]);
556
+ }
557
+ prevItems = nextItems;
558
+ keyMap = null;
559
+ nextItems = null;
560
+ childNodes = null;
561
+ return;
579
562
  }
580
563
 
581
- // Determine Anchor (The first node of the suffix, or the end bookend)
582
- const anchor = (end > 0) ? rowNodes[oldLength - end] : endBookend;
583
-
584
- // B. Process Middle
585
- for (let i = oldStart; i < newEnd; i++) {
586
- const newItem = nextItems[i];
587
-
588
- if (keyMap.has(newItem)) {
589
- const node = keyMap.get(newItem);
590
- keyMap.delete(newItem);
591
- parent.insertBefore(node, anchor);
592
- nextRowNodes[i] = node;
593
- } else {
594
- const node = render(newItem);
595
- parent.insertBefore(node, anchor);
596
- nextRowNodes[i] = node;
564
+ while (start <= newLength) {
565
+ const newChd = nextItems[start];
566
+ const oldChd = prevItems[start];
567
+ if (newChd === oldChd) {
568
+ start++;
569
+ continue;
570
+ }
571
+ if (oldChd === undefined) {
572
+ parent.insertBefore(render(newChd), endBookend);
573
+ start++;
574
+ continue;
597
575
  }
576
+ const mappedOld = keyMap.get(newChd);
577
+ if (mappedOld) {
578
+ const oldDom = childNodeList[start + 1];
579
+ const { el, item } = mappedOld;
580
+ if (oldDom !== el) {
581
+ const tmp = el.nextSibling;
582
+ parent.insertBefore(el, oldDom);
583
+ parent.insertBefore(oldDom, tmp);
584
+ } else if (item !== newChd) {
585
+ replaceWith(newChd, el, render);
586
+ }
587
+ keyMap.delete(newChd);
588
+ } else if (oldChd !== newChd) {
589
+ parent.insertBefore(render(newChd), childNodeList[start + 1]);
590
+ }
591
+ start++;
598
592
  }
599
-
600
- // C. Cleanup Unused
601
- for (const node of keyMap.values()) {
602
- shallowTeardown(node);
603
- node.remove();
593
+ for (const { el } of keyMap.values()) {
594
+ shallowTeardown(el);
595
+ el.remove();
604
596
  }
605
-
606
- rowNodes = nextRowNodes;
597
+ keyMap = null;
607
598
  prevItems = nextItems;
599
+ nextItems = null;
600
+ childNodes = null;
608
601
  });
609
-
610
602
  return outlet;
611
- }
603
+ }
604
+
@@ -1 +1 @@
1
- {"fileNames":["./node_modules/typescript/lib/lib.es5.d.ts","./node_modules/typescript/lib/lib.es2015.d.ts","./node_modules/typescript/lib/lib.es2016.d.ts","./node_modules/typescript/lib/lib.es2017.d.ts","./node_modules/typescript/lib/lib.es2018.d.ts","./node_modules/typescript/lib/lib.es2019.d.ts","./node_modules/typescript/lib/lib.es2020.d.ts","./node_modules/typescript/lib/lib.dom.d.ts","./node_modules/typescript/lib/lib.dom.iterable.d.ts","./node_modules/typescript/lib/lib.dom.asynciterable.d.ts","./node_modules/typescript/lib/lib.webworker.importscripts.d.ts","./node_modules/typescript/lib/lib.scripthost.d.ts","./node_modules/typescript/lib/lib.es2015.core.d.ts","./node_modules/typescript/lib/lib.es2015.collection.d.ts","./node_modules/typescript/lib/lib.es2015.generator.d.ts","./node_modules/typescript/lib/lib.es2015.iterable.d.ts","./node_modules/typescript/lib/lib.es2015.promise.d.ts","./node_modules/typescript/lib/lib.es2015.proxy.d.ts","./node_modules/typescript/lib/lib.es2015.reflect.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2016.array.include.d.ts","./node_modules/typescript/lib/lib.es2016.intl.d.ts","./node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","./node_modules/typescript/lib/lib.es2017.date.d.ts","./node_modules/typescript/lib/lib.es2017.object.d.ts","./node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2017.string.d.ts","./node_modules/typescript/lib/lib.es2017.intl.d.ts","./node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","./node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","./node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","./node_modules/typescript/lib/lib.es2018.intl.d.ts","./node_modules/typescript/lib/lib.es2018.promise.d.ts","./node_modules/typescript/lib/lib.es2018.regexp.d.ts","./node_modules/typescript/lib/lib.es2019.array.d.ts","./node_modules/typescript/lib/lib.es2019.object.d.ts","./node_modules/typescript/lib/lib.es2019.string.d.ts","./node_modules/typescript/lib/lib.es2019.symbol.d.ts","./node_modules/typescript/lib/lib.es2019.intl.d.ts","./node_modules/typescript/lib/lib.es2020.bigint.d.ts","./node_modules/typescript/lib/lib.es2020.date.d.ts","./node_modules/typescript/lib/lib.es2020.promise.d.ts","./node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2020.string.d.ts","./node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2020.intl.d.ts","./node_modules/typescript/lib/lib.es2020.number.d.ts","./node_modules/typescript/lib/lib.decorators.d.ts","./node_modules/typescript/lib/lib.decorators.legacy.d.ts","./node_modules/typescript/lib/lib.es2020.full.d.ts","./src/signals.ts","./src/element.ts","./src/index.ts","./src/router.ts","./node_modules/@types/deep-eql/index.d.ts","./node_modules/assertion-error/index.d.ts","./node_modules/@types/chai/index.d.ts","./node_modules/@types/estree/index.d.ts"],"fileIdsList":[[56,57],[52],[52,53],[53]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2e80ee7a49e8ac312cc11b77f1475804bee36b3b2bc896bead8b6e1266befb43","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7a3c8b952931daebdfc7a2897c53c0a1c73624593fa070e46bd537e64dcd20a","affectsGlobalScope":true,"impliedFormat":1},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true,"impliedFormat":1},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"1305d1e76ca44e30fb8b2b8075fa522b83f60c0bcf5d4326a9d2cf79b53724f8","impliedFormat":1},{"version":"2834d3d5f4c0526c760679f15c35791e91f4e51d54d24d00610e35b7ce7a9e01","signature":"a53dff95094f1f7fee261ff1879f5909cd440f02aa68ff6893d017b2343181d1"},{"version":"b33d036c5c7a309dcef7c008214bd6dc62bb9379987f5b3f7f3d407e38739836","signature":"4e15936f04a7ab7370e9a897f6d9befa980662283d92660ba0b5cacfab78e5d1"},{"version":"ac16f8022e1d86594d058f84a530164af4b03dcc8bb45ac4a00736fe8aab62e7","signature":"1e325d171d22aa3144736ace94df4b5bf779c6083bc0f9ce684855844f8abcbc"},{"version":"a155e9ebe821846c43103394346639a6a19a7f844be4892bbe4352aa20ee6707","signature":"166554555b2dc6392155b045bb33ce964f7d5f092f50fada34eb4d5828d7740e"},{"version":"427fe2004642504828c1476d0af4270e6ad4db6de78c0b5da3e4c5ca95052a99","impliedFormat":1},{"version":"2eeffcee5c1661ddca53353929558037b8cf305ffb86a803512982f99bcab50d","impliedFormat":99},{"version":"9afb4cb864d297e4092a79ee2871b5d3143ea14153f62ef0bb04ede25f432030","affectsGlobalScope":true,"impliedFormat":99},{"version":"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","impliedFormat":1}],"root":[[52,55]],"options":{"allowJs":true,"checkJs":false,"composite":true,"esModuleInterop":true,"module":99,"outDir":"./dist","rootDir":"./src","skipLibCheck":true,"target":7},"referencedMap":[[58,1],[53,2],[54,3],[55,3],[52,4]],"latestChangedDtsFile":"./dist/element.d.ts","version":"5.9.3"}
1
+ {"fileNames":["./node_modules/typescript/lib/lib.es5.d.ts","./node_modules/typescript/lib/lib.es2015.d.ts","./node_modules/typescript/lib/lib.es2016.d.ts","./node_modules/typescript/lib/lib.es2017.d.ts","./node_modules/typescript/lib/lib.es2018.d.ts","./node_modules/typescript/lib/lib.es2019.d.ts","./node_modules/typescript/lib/lib.es2020.d.ts","./node_modules/typescript/lib/lib.dom.d.ts","./node_modules/typescript/lib/lib.dom.iterable.d.ts","./node_modules/typescript/lib/lib.dom.asynciterable.d.ts","./node_modules/typescript/lib/lib.webworker.importscripts.d.ts","./node_modules/typescript/lib/lib.scripthost.d.ts","./node_modules/typescript/lib/lib.es2015.core.d.ts","./node_modules/typescript/lib/lib.es2015.collection.d.ts","./node_modules/typescript/lib/lib.es2015.generator.d.ts","./node_modules/typescript/lib/lib.es2015.iterable.d.ts","./node_modules/typescript/lib/lib.es2015.promise.d.ts","./node_modules/typescript/lib/lib.es2015.proxy.d.ts","./node_modules/typescript/lib/lib.es2015.reflect.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2016.array.include.d.ts","./node_modules/typescript/lib/lib.es2016.intl.d.ts","./node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","./node_modules/typescript/lib/lib.es2017.date.d.ts","./node_modules/typescript/lib/lib.es2017.object.d.ts","./node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2017.string.d.ts","./node_modules/typescript/lib/lib.es2017.intl.d.ts","./node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","./node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","./node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","./node_modules/typescript/lib/lib.es2018.intl.d.ts","./node_modules/typescript/lib/lib.es2018.promise.d.ts","./node_modules/typescript/lib/lib.es2018.regexp.d.ts","./node_modules/typescript/lib/lib.es2019.array.d.ts","./node_modules/typescript/lib/lib.es2019.object.d.ts","./node_modules/typescript/lib/lib.es2019.string.d.ts","./node_modules/typescript/lib/lib.es2019.symbol.d.ts","./node_modules/typescript/lib/lib.es2019.intl.d.ts","./node_modules/typescript/lib/lib.es2020.bigint.d.ts","./node_modules/typescript/lib/lib.es2020.date.d.ts","./node_modules/typescript/lib/lib.es2020.promise.d.ts","./node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2020.string.d.ts","./node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2020.intl.d.ts","./node_modules/typescript/lib/lib.es2020.number.d.ts","./node_modules/typescript/lib/lib.decorators.d.ts","./node_modules/typescript/lib/lib.decorators.legacy.d.ts","./node_modules/typescript/lib/lib.es2020.full.d.ts","./src/signals.ts","./src/element.ts","./src/index.ts","./src/router.ts","./node_modules/@types/deep-eql/index.d.ts","./node_modules/assertion-error/index.d.ts","./node_modules/@types/chai/index.d.ts","./node_modules/@types/estree/index.d.ts"],"fileIdsList":[[56,57],[52],[52,53],[53]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2e80ee7a49e8ac312cc11b77f1475804bee36b3b2bc896bead8b6e1266befb43","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7a3c8b952931daebdfc7a2897c53c0a1c73624593fa070e46bd537e64dcd20a","affectsGlobalScope":true,"impliedFormat":1},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true,"impliedFormat":1},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"1305d1e76ca44e30fb8b2b8075fa522b83f60c0bcf5d4326a9d2cf79b53724f8","impliedFormat":1},{"version":"2834d3d5f4c0526c760679f15c35791e91f4e51d54d24d00610e35b7ce7a9e01","signature":"a53dff95094f1f7fee261ff1879f5909cd440f02aa68ff6893d017b2343181d1"},{"version":"8b93b0656412692139068362a59281bf5ee64e327a6ba8a9f0ef21cd1f5e7c49","signature":"4e15936f04a7ab7370e9a897f6d9befa980662283d92660ba0b5cacfab78e5d1"},{"version":"ac16f8022e1d86594d058f84a530164af4b03dcc8bb45ac4a00736fe8aab62e7","signature":"1e325d171d22aa3144736ace94df4b5bf779c6083bc0f9ce684855844f8abcbc"},{"version":"a155e9ebe821846c43103394346639a6a19a7f844be4892bbe4352aa20ee6707","signature":"166554555b2dc6392155b045bb33ce964f7d5f092f50fada34eb4d5828d7740e"},{"version":"427fe2004642504828c1476d0af4270e6ad4db6de78c0b5da3e4c5ca95052a99","impliedFormat":1},{"version":"2eeffcee5c1661ddca53353929558037b8cf305ffb86a803512982f99bcab50d","impliedFormat":99},{"version":"9afb4cb864d297e4092a79ee2871b5d3143ea14153f62ef0bb04ede25f432030","affectsGlobalScope":true,"impliedFormat":99},{"version":"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","impliedFormat":1}],"root":[[52,55]],"options":{"allowJs":true,"checkJs":false,"composite":true,"esModuleInterop":true,"module":99,"outDir":"./dist","rootDir":"./src","skipLibCheck":true,"target":7},"referencedMap":[[58,1],[53,2],[54,3],[55,3],[52,4]],"latestChangedDtsFile":"./dist/element.d.ts","version":"5.9.3"}