securemark 0.260.6 → 0.261.2

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/CHANGELOG.md +12 -0
  2. package/README.md +12 -12
  3. package/design.md +0 -4
  4. package/dist/index.js +983 -630
  5. package/markdown.d.ts +5 -32
  6. package/package.json +9 -9
  7. package/src/debug.test.ts +3 -3
  8. package/src/parser/api/parse.test.ts +1 -1
  9. package/src/parser/block/blockquote.test.ts +2 -2
  10. package/src/parser/block/dlist.test.ts +1 -1
  11. package/src/parser/block/extension/example.test.ts +1 -1
  12. package/src/parser/block/extension/fig.test.ts +1 -1
  13. package/src/parser/block/heading.test.ts +2 -2
  14. package/src/parser/block/olist.ts +4 -6
  15. package/src/parser/block/paragraph.test.ts +1 -4
  16. package/src/parser/inline/autolink/anchor.test.ts +1 -0
  17. package/src/parser/inline/autolink/email.test.ts +3 -0
  18. package/src/parser/inline/autolink/email.ts +1 -1
  19. package/src/parser/inline/autolink/hashnum.test.ts +1 -2
  20. package/src/parser/inline/autolink/hashnum.ts +1 -1
  21. package/src/parser/inline/autolink/hashtag.test.ts +15 -12
  22. package/src/parser/inline/autolink/hashtag.ts +3 -3
  23. package/src/parser/inline/autolink/url.test.ts +1 -1
  24. package/src/parser/inline/autolink/url.ts +1 -1
  25. package/src/parser/inline/autolink.ts +13 -4
  26. package/src/parser/inline/deletion.test.ts +2 -2
  27. package/src/parser/inline/deletion.ts +1 -1
  28. package/src/parser/inline/emphasis.test.ts +26 -35
  29. package/src/parser/inline/emphasis.ts +5 -12
  30. package/src/parser/inline/extension/index.test.ts +2 -2
  31. package/src/parser/inline/insertion.test.ts +2 -2
  32. package/src/parser/inline/insertion.ts +1 -1
  33. package/src/parser/inline/link.test.ts +1 -1
  34. package/src/parser/inline/mark.test.ts +1 -1
  35. package/src/parser/inline/mark.ts +1 -1
  36. package/src/parser/inline/strong.test.ts +25 -32
  37. package/src/parser/inline/strong.ts +5 -9
  38. package/src/parser/inline.test.ts +18 -91
  39. package/src/parser/inline.ts +0 -6
  40. package/src/parser/locale/ja.ts +1 -9
  41. package/src/parser/locale.test.ts +1 -1
  42. package/src/parser/processor/figure.ts +2 -1
  43. package/src/parser/processor/footnote.ts +2 -1
  44. package/src/parser/source/str.ts +4 -2
  45. package/src/parser/source/text.test.ts +9 -4
  46. package/src/parser/source/text.ts +9 -16
  47. package/src/renderer/render.ts +3 -3
  48. package/src/parser/inline/emstrong.ts +0 -62
  49. package/src/parser/inline/escape.ts +0 -30
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! securemark v0.260.6 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
1
+ /*! securemark v0.261.2 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
2
2
  (function webpackUniversalModuleDefinition(root, factory) {
3
3
  if(typeof exports === 'object' && typeof module === 'object')
4
4
  module.exports = factory(require("DOMPurify"), require("Prism"));
@@ -92,6 +92,8 @@ exports.splice = exports.pop = exports.push = exports.shift = exports.unshift =
92
92
 
93
93
  const global_1 = __webpack_require__(4128);
94
94
 
95
+ const undefined = void 0;
96
+
95
97
  function indexOf(as, a) {
96
98
  if (as.length === 0) return -1;
97
99
  return a === a ? as.indexOf(a) : as.findIndex(a => a !== a);
@@ -101,7 +103,10 @@ exports.indexOf = indexOf;
101
103
 
102
104
  function unshift(as, bs) {
103
105
  if ('length' in as) {
104
- for (let i = as.length - 1; i >= 0; --i) {
106
+ if (as.length === 1) return bs.unshift(as[0]), bs;
107
+ if (global_1.Symbol.iterator in as) return bs.unshift(...as), bs;
108
+
109
+ for (let i = as.length; i--;) {
105
110
  bs.unshift(as[i]);
106
111
  }
107
112
  } else {
@@ -115,13 +120,16 @@ exports.unshift = unshift;
115
120
 
116
121
  function shift(as, count) {
117
122
  if (count < 0) throw new Error('Unexpected negative number');
118
- return count === void 0 ? [as.shift(), as] : [splice(as, 0, count), as];
123
+ return count === undefined ? [as.shift(), as] : [splice(as, 0, count), as];
119
124
  }
120
125
 
121
126
  exports.shift = shift;
122
127
 
123
128
  function push(as, bs) {
124
129
  if ('length' in bs) {
130
+ if (bs.length === 1) return as.push(bs[0]), as;
131
+ if (global_1.Symbol.iterator in bs && bs.length > 50) return as.push(...bs), as;
132
+
125
133
  for (let i = 0, len = bs.length; i < len; ++i) {
126
134
  as.push(bs[i]);
127
135
  }
@@ -138,50 +146,39 @@ exports.push = push;
138
146
 
139
147
  function pop(as, count) {
140
148
  if (count < 0) throw new Error('Unexpected negative number');
141
- return count === void 0 ? [as, as.pop()] : [as, splice(as, as.length - count, count)];
149
+ return count === undefined ? [as, as.pop()] : [as, splice(as, as.length - count, count)];
142
150
  }
143
151
 
144
152
  exports.pop = pop;
145
153
 
146
- function splice(as, index, count, ...inserts) {
147
- if (count === 0 && inserts.length === 0) return [];
154
+ function splice(as, index, count, ...values) {
155
+ if (as.length === 0) return push(as, values), [];
156
+
157
+ if (index > as.length) {
158
+ index = as.length;
159
+ } else if (index < 0) {
160
+ index = -index > as.length ? 0 : as.length + index;
161
+ }
162
+
148
163
  count = count > as.length ? as.length : count;
164
+ if (count === 0 && values.length === 0) return [];
165
+ if (count === 1 && values.length === 1) return [[as[index], as[index] = values[0]][0]];
149
166
 
150
167
  switch (index) {
151
168
  case 0:
152
- switch (count) {
153
- case 0:
154
- return [[], unshift(inserts, as)][0];
155
-
156
- case 1:
157
- return as.length === 0 ? [[], unshift(inserts, as)][0] : [[as.shift()], unshift(inserts, as)][0];
158
-
159
- case void 0:
160
- if (as.length > 1 || arguments.length > 2) break;
161
- return as.length === 0 ? [] : splice(as, index, 1);
162
- }
163
-
169
+ if (count === 0) return unshift(values, as), [];
170
+ if (count === 1) return [[as.shift()], unshift(values, as)][0];
164
171
  break;
165
172
 
166
- case -1:
167
173
  case as.length - 1:
168
- switch (count) {
169
- case 1:
170
- return as.length === 0 ? [[], push(as, inserts)][0] : [[as.pop()], push(as, inserts)][0];
171
-
172
- case void 0:
173
- if (as.length > 1 || arguments.length > 2) break;
174
- return as.length === 0 ? [] : splice(as, index, 1);
175
- }
176
-
174
+ if (count === 1) return [[as.pop()], push(as, values)][0];
177
175
  break;
178
176
 
179
177
  case as.length:
180
- case global_1.Infinity:
181
- return [[], push(as, inserts)][0];
178
+ return push(as, values), [];
182
179
  }
183
180
 
184
- return arguments.length > 2 ? as.splice(index, count, ...inserts) : as.splice(index);
181
+ return arguments.length > 2 ? as.splice(index, count, ...values) : as.splice(index);
185
182
  }
186
183
 
187
184
  exports.splice = splice;
@@ -369,15 +366,14 @@ const assign_1 = __webpack_require__(4401);
369
366
  class Cache {
370
367
  constructor(capacity, opts = {}) {
371
368
  this.settings = {
372
- window: 0,
373
369
  capacity: 0,
374
- space: global_1.Infinity,
375
370
  age: global_1.Infinity,
376
371
  earlyExpiring: false,
377
372
  capture: {
378
373
  delete: true,
379
374
  clear: true
380
375
  },
376
+ window: 0,
381
377
  resolution: 1,
382
378
  offset: 0,
383
379
  block: 20,
@@ -391,7 +387,7 @@ class Cache {
391
387
  LRU: new invlist_1.List(),
392
388
  LFU: new invlist_1.List()
393
389
  };
394
- this.expiries = new heap_1.Heap((a, b) => a.value.expiry - b.value.expiry);
390
+ this.expiries = new heap_1.Heap(heap_1.Heap.min);
395
391
  this.misses = 0;
396
392
  this.sweep = 0;
397
393
  this.ratio = 500;
@@ -407,8 +403,7 @@ class Cache {
407
403
  this.capacity = settings.capacity;
408
404
  if (this.capacity >= 1 === false) throw new Error(`Spica: Cache: Capacity must be 1 or more.`);
409
405
  this.window = settings.window || this.capacity;
410
- if (this.window * 1000 < this.capacity) throw new Error(`Spica: Cache: Window must be 0.1% of capacity or more.`);
411
- this.space = settings.space;
406
+ if (this.window * 1000 >= this.capacity === false) throw new Error(`Spica: Cache: Window must be 0.1% of capacity or more.`);
412
407
  this.block = settings.block;
413
408
  this.limit = settings.limit;
414
409
  this.earlyExpiring = settings.earlyExpiring;
@@ -438,13 +433,12 @@ class Cache {
438
433
 
439
434
  ensure(margin, skip) {
440
435
  let size = skip?.value.size ?? 0;
441
- if (margin - size <= 0) return true;
442
436
  const {
443
437
  LRU,
444
438
  LFU
445
439
  } = this.indexes;
446
440
 
447
- while (this.length === this.capacity || this.size + margin - size > this.space) {
441
+ while (this.size + margin - size > this.capacity) {
448
442
  let target;
449
443
 
450
444
  switch (true) {
@@ -494,7 +488,7 @@ class Cache {
494
488
  size = 1,
495
489
  age = this.settings.age
496
490
  } = {}) {
497
- if (size > this.space || age <= 0) {
491
+ if (size < 1 || this.capacity < size || age <= 0) {
498
492
  this.disposer?.(value, key);
499
493
  return false;
500
494
  }
@@ -510,7 +504,7 @@ class Cache {
510
504
  index.expiry = expiry;
511
505
 
512
506
  if (this.earlyExpiring && expiry !== global_1.Infinity) {
513
- index.enode ? this.expiries.update(index.enode) : index.enode = this.expiries.insert(node);
507
+ index.enode ? this.expiries.update(index.enode, expiry) : index.enode = this.expiries.insert(node, expiry);
514
508
  } else if (index.enode) {
515
509
  this.expiries.delete(index.enode);
516
510
  index.enode = void 0;
@@ -535,7 +529,7 @@ class Cache {
535
529
  }));
536
530
 
537
531
  if (this.earlyExpiring && expiry !== global_1.Infinity) {
538
- LRU.head.value.enode = this.expiries.insert(LRU.head);
532
+ LRU.head.value.enode = this.expiries.insert(LRU.head, expiry);
539
533
  }
540
534
 
541
535
  return false;
@@ -560,14 +554,14 @@ class Cache {
560
554
  ++this.misses;
561
555
  this.evict(node, true);
562
556
  return;
563
- } // Optimization for memoize.
557
+ }
564
558
 
559
+ this.misses &&= 0;
560
+ this.sweep &&= 0; // Optimization for memoize.
565
561
 
566
562
  if (this.capacity > 3 && node === node.list.head) return node.value.value;
567
563
  this.access(node);
568
564
  this.adjust();
569
- this.misses &&= 0;
570
- this.sweep = 0;
571
565
  return node.value.value;
572
566
  }
573
567
 
@@ -607,21 +601,35 @@ class Cache {
607
601
  const memory = this.memory;
608
602
  this.memory = new global_1.Map();
609
603
 
610
- for (const [key, {
611
- value: {
612
- value
604
+ for (const {
605
+ 0: key,
606
+ 1: {
607
+ value: {
608
+ value
609
+ }
613
610
  }
614
- }] of memory) {
611
+ } of memory) {
615
612
  this.disposer(value, key);
616
613
  }
617
614
  }
618
615
 
616
+ resize(capacity) {
617
+ if (this.capacity >= 1 === false) throw new Error(`Spica: Cache: Capacity must be 1 or more.`);
618
+ this.capacity = capacity;
619
+ this.window = this.settings.window || this.capacity;
620
+ if (this.window * 1000 >= this.capacity === false) throw new Error(`Spica: Cache: Window must be 0.1% of capacity or more.`);
621
+ this.ensure(0);
622
+ }
623
+
619
624
  *[Symbol.iterator]() {
620
- for (const [key, {
621
- value: {
622
- value
625
+ for (const {
626
+ 0: key,
627
+ 1: {
628
+ value: {
629
+ value
630
+ }
623
631
  }
624
- }] of this.memory) {
632
+ } of this.memory) {
625
633
  yield [key, value];
626
634
  }
627
635
 
@@ -792,58 +800,56 @@ function rate(window, hits1, hits2, offset) {
792
800
  Object.defineProperty(exports, "__esModule", ({
793
801
  value: true
794
802
  }));
795
- exports.tick = exports.clock = exports.now = void 0;
803
+ exports.tick = exports.promise = exports.clock = exports.now = void 0;
796
804
 
797
805
  const global_1 = __webpack_require__(4128);
798
806
 
799
- const alias_1 = __webpack_require__(5406);
807
+ const queue_1 = __webpack_require__(4934);
800
808
 
801
809
  const exception_1 = __webpack_require__(7822);
802
810
 
803
- let mem;
811
+ const undefined = void 0;
812
+ let time;
804
813
  let count = 0;
805
814
 
806
- function now(nocache = false) {
807
- if (mem === void 0) {
808
- tick(() => mem = void 0);
809
- } else if (!nocache && ++count !== 100) {
810
- return mem;
815
+ function now(nocache) {
816
+ if (time === undefined) {
817
+ tick(() => time = undefined);
818
+ } else if (!nocache && count++ !== 20) {
819
+ return time;
811
820
  }
812
821
 
813
- count = 0;
814
- return mem = global_1.Date.now();
822
+ count = 1;
823
+ return time = global_1.Date.now();
815
824
  }
816
825
 
817
826
  exports.now = now;
818
- exports.clock = Promise.resolve(void 0);
819
- let queue = [];
820
- let jobs = [];
821
- let index = 0;
822
- const scheduler = Promise.resolve();
827
+ exports.clock = global_1.Promise.resolve(undefined);
828
+
829
+ function promise(cb) {
830
+ global_1.Promise.resolve().then(cb);
831
+ }
832
+
833
+ exports.promise = promise;
834
+ const queue = new queue_1.Queue();
835
+ const scheduler = global_1.Promise.resolve();
823
836
 
824
837
  function tick(cb) {
825
- index === 0 && scheduler.then(run);
826
- index++ === queue.length ? queue.push(cb) : queue[index - 1] = cb;
838
+ queue.isEmpty() && scheduler.then(run);
839
+ queue.push(cb);
827
840
  }
828
841
 
829
842
  exports.tick = tick;
830
843
 
831
844
  function run() {
832
- const count = index;
833
- [index, queue, jobs] = [0, jobs, queue];
834
-
835
- for (let i = 0; i < count; ++i) {
845
+ for (let count = queue.length; count--;) {
836
846
  try {
837
- (void 0, jobs[i])(); // Release the reference.
838
-
839
- jobs[i] = void 0;
847
+ // @ts-expect-error
848
+ (0, queue.pop())();
840
849
  } catch (reason) {
841
850
  (0, exception_1.causeAsyncException)(reason);
842
851
  }
843
- } // Gradually reduce the unused buffer space.
844
-
845
-
846
- jobs.length > 1000 && count < jobs.length * 0.5 && jobs.splice((0, alias_1.floor)(jobs.length * 0.9), jobs.length);
852
+ }
847
853
  }
848
854
 
849
855
  /***/ }),
@@ -880,62 +886,51 @@ exports.MultiMap = void 0;
880
886
 
881
887
  const global_1 = __webpack_require__(4128);
882
888
 
883
- const array_1 = __webpack_require__(8112);
889
+ const ring_1 = __webpack_require__(6395);
884
890
 
885
891
  class MultiMap {
886
892
  constructor(entries = [], memory = new global_1.Map()) {
887
893
  this.memory = memory;
888
894
 
889
- for (const [k, v] of entries) {
895
+ for (const {
896
+ 0: k,
897
+ 1: v
898
+ } of entries) {
890
899
  this.set(k, v);
891
900
  }
892
901
  }
893
902
 
894
903
  get(key) {
895
- return this.memory.get(key)?.[0];
904
+ return this.memory.get(key)?.at(0);
905
+ }
906
+
907
+ getAll(key) {
908
+ return this.memory.get(key);
896
909
  }
897
910
 
898
911
  set(key, val) {
899
- this.memory.get(key)?.push(val) ?? this.memory.set(key, [val]);
912
+ let vs = this.memory.get(key);
913
+ if (vs) return vs.push(val), this;
914
+ vs = new ring_1.Ring();
915
+ vs.push(val);
916
+ this.memory.set(key, vs);
900
917
  return this;
901
918
  }
902
919
 
903
920
  has(key, value) {
904
921
  const vs = this.memory.get(key);
905
- if (!vs || vs.length === 0) return false;
922
+ if (!vs?.length) return false;
906
923
  if (arguments.length < 2) return true;
907
-
908
- switch (value) {
909
- case vs[0]:
910
- case vs[vs.length - 1]:
911
- return true;
912
-
913
- default:
914
- return (0, array_1.indexOf)(vs, value) > -1;
915
- }
924
+ return vs.includes(value);
916
925
  }
917
926
 
918
927
  delete(key, value) {
919
928
  if (arguments.length < 2) return this.memory.delete(key);
920
929
  const vs = this.memory.get(key);
921
- if (!vs || vs.length === 0) return false;
922
-
923
- switch (value) {
924
- case vs[0]:
925
- vs.shift();
926
- break;
927
-
928
- case vs[vs.length - 1]:
929
- vs.pop();
930
- break;
931
-
932
- default:
933
- const i = (0, array_1.indexOf)(vs, value);
934
- if (i === -1) return false;
935
- (0, array_1.splice)(vs, i, 1);
936
- }
937
-
938
- vs.length === 0 && this.memory.delete(key);
930
+ if (!vs?.length) return false;
931
+ const i = vs.indexOf(value);
932
+ if (i === -1) return false;
933
+ vs.splice(i, 1);
939
934
  return true;
940
935
  }
941
936
 
@@ -944,22 +939,32 @@ class MultiMap {
944
939
  }
945
940
 
946
941
  take(key, count) {
947
- const vs = this.memory.get(key) ?? [];
948
- return count === void 0 ? (0, array_1.splice)(vs, 0, 1)[0] : (0, array_1.splice)(vs, 0, count);
942
+ const vs = this.memory.get(key);
943
+ if (count === void 0) return vs?.shift();
944
+ const acc = [];
945
+
946
+ while (vs?.length && count--) {
947
+ acc.push(vs.shift());
948
+ }
949
+
950
+ return acc;
949
951
  }
950
952
 
951
953
  ref(key) {
952
954
  let vs = this.memory.get(key);
953
955
  if (vs) return vs;
954
- vs = [];
956
+ vs = new ring_1.Ring();
955
957
  this.memory.set(key, vs);
956
958
  return vs;
957
959
  }
958
960
 
959
961
  *[Symbol.iterator]() {
960
- for (const [k, vs] of this.memory) {
962
+ for (const {
963
+ 0: k,
964
+ 1: vs
965
+ } of this.memory) {
961
966
  for (let i = 0; i < vs.length; ++i) {
962
- yield [k, vs[i]];
967
+ yield [k, vs.at(i)];
963
968
  }
964
969
  }
965
970
 
@@ -981,12 +986,12 @@ exports.MultiMap = MultiMap;
981
986
  Object.defineProperty(exports, "__esModule", ({
982
987
  value: true
983
988
  }));
984
- exports.duffReduce = exports.duffEach = exports.duffbk = exports.duff = void 0;
989
+ exports.duffReduce = exports.duffEach = exports.duffbk = exports.duff = void 0; // 100,000以上でforより大幅に低速となり実用不可
985
990
 
986
991
  function duff(count, proc) {
987
992
  if (count > 0) {
988
993
  let i = 0,
989
- m = count % 8,
994
+ m = count & 7,
990
995
  d = (count - m) / 8;
991
996
 
992
997
  while (m--) {
@@ -1005,7 +1010,7 @@ function duff(count, proc) {
1005
1010
  }
1006
1011
  } else {
1007
1012
  let i = -count,
1008
- m = i % 8,
1013
+ m = i & 7,
1009
1014
  d = (i - m) / 8;
1010
1015
 
1011
1016
  while (m--) {
@@ -1025,12 +1030,12 @@ function duff(count, proc) {
1025
1030
  }
1026
1031
  }
1027
1032
 
1028
- exports.duff = duff;
1033
+ exports.duff = duff; // 100,000以上でforより大幅に低速となり実用不可
1029
1034
 
1030
1035
  function duffbk(count, proc) {
1031
1036
  if (count > 0) {
1032
1037
  let i = 0,
1033
- m = count % 8,
1038
+ m = count & 7,
1034
1039
  d = (count - m) / 8;
1035
1040
 
1036
1041
  while (m--) {
@@ -1038,18 +1043,21 @@ function duffbk(count, proc) {
1038
1043
  }
1039
1044
 
1040
1045
  while (d--) {
1041
- if (proc(i++) === false) return;
1042
- if (proc(i++) === false) return;
1043
- if (proc(i++) === false) return;
1044
- if (proc(i++) === false) return;
1045
- if (proc(i++) === false) return;
1046
- if (proc(i++) === false) return;
1047
- if (proc(i++) === false) return;
1048
- if (proc(i++) === false) return;
1046
+ switch (false) {
1047
+ case proc(i++):
1048
+ case proc(i++):
1049
+ case proc(i++):
1050
+ case proc(i++):
1051
+ case proc(i++):
1052
+ case proc(i++):
1053
+ case proc(i++):
1054
+ case proc(i++):
1055
+ return;
1056
+ }
1049
1057
  }
1050
1058
  } else {
1051
1059
  let i = -count,
1052
- m = i % 8,
1060
+ m = i & 7,
1053
1061
  d = (i - m) / 8;
1054
1062
 
1055
1063
  while (m--) {
@@ -1057,14 +1065,17 @@ function duffbk(count, proc) {
1057
1065
  }
1058
1066
 
1059
1067
  while (d--) {
1060
- if (proc(--i) === false) return;
1061
- if (proc(--i) === false) return;
1062
- if (proc(--i) === false) return;
1063
- if (proc(--i) === false) return;
1064
- if (proc(--i) === false) return;
1065
- if (proc(--i) === false) return;
1066
- if (proc(--i) === false) return;
1067
- if (proc(--i) === false) return;
1068
+ switch (false) {
1069
+ case proc(--i):
1070
+ case proc(--i):
1071
+ case proc(--i):
1072
+ case proc(--i):
1073
+ case proc(--i):
1074
+ case proc(--i):
1075
+ case proc(--i):
1076
+ case proc(--i):
1077
+ return;
1078
+ }
1068
1079
  }
1069
1080
  }
1070
1081
  }
@@ -1074,7 +1085,7 @@ exports.duffbk = duffbk;
1074
1085
  function duffEach(array, proc) {
1075
1086
  let count = array.length;
1076
1087
  let i = 0,
1077
- m = count % 8,
1088
+ m = count & 7,
1078
1089
  d = (count - m) / 8;
1079
1090
 
1080
1091
  while (m--) {
@@ -1093,30 +1104,32 @@ function duffEach(array, proc) {
1093
1104
  }
1094
1105
  }
1095
1106
 
1096
- exports.duffEach = duffEach;
1107
+ exports.duffEach = duffEach; // ベンチマークの10,000以上で急激な速度低下が見られる場合があるがNodeListなどでの
1108
+ // 実際の使用では速度低下は見られない
1097
1109
 
1098
1110
  function duffReduce(array, proc, initial) {
1099
1111
  let count = array.length;
1100
1112
  let i = 0,
1101
- m = count % 8,
1113
+ m = count & 7,
1102
1114
  d = (count - m) / 8;
1115
+ let acc = initial;
1103
1116
 
1104
1117
  while (m--) {
1105
- initial = proc(initial, array[i], i++, array);
1118
+ acc = proc(acc, array[i], i++, array);
1106
1119
  }
1107
1120
 
1108
1121
  while (d--) {
1109
- initial = proc(initial, array[i], i++, array);
1110
- initial = proc(initial, array[i], i++, array);
1111
- initial = proc(initial, array[i], i++, array);
1112
- initial = proc(initial, array[i], i++, array);
1113
- initial = proc(initial, array[i], i++, array);
1114
- initial = proc(initial, array[i], i++, array);
1115
- initial = proc(initial, array[i], i++, array);
1116
- initial = proc(initial, array[i], i++, array);
1122
+ acc = proc(acc, array[i], i++, array);
1123
+ acc = proc(acc, array[i], i++, array);
1124
+ acc = proc(acc, array[i], i++, array);
1125
+ acc = proc(acc, array[i], i++, array);
1126
+ acc = proc(acc, array[i], i++, array);
1127
+ acc = proc(acc, array[i], i++, array);
1128
+ acc = proc(acc, array[i], i++, array);
1129
+ acc = proc(acc, array[i], i++, array);
1117
1130
  }
1118
1131
 
1119
- return initial;
1132
+ return acc;
1120
1133
  }
1121
1134
 
1122
1135
  exports.duffReduce = duffReduce;
@@ -1180,18 +1193,22 @@ var global = (/* unused pure expression or super */ null && (globalThis));
1180
1193
  Object.defineProperty(exports, "__esModule", ({
1181
1194
  value: true
1182
1195
  }));
1183
- exports.Heap = void 0;
1196
+ exports.MultiHeap = exports.Heap = void 0;
1197
+
1198
+ const global_1 = __webpack_require__(4128);
1184
1199
 
1185
- const alias_1 = __webpack_require__(5406); // Min heap
1200
+ const invlist_1 = __webpack_require__(7452);
1186
1201
 
1202
+ const memoize_1 = __webpack_require__(1808);
1187
1203
 
1188
1204
  const undefined = void 0;
1205
+ let size = 16;
1189
1206
 
1190
1207
  class Heap {
1191
- constructor(cmp = (a, b) => a > b ? 1 : a < b ? -1 : 0, stable = false) {
1208
+ constructor(cmp = Heap.max, stable = false) {
1192
1209
  this.cmp = cmp;
1193
1210
  this.stable = stable;
1194
- this.array = [];
1211
+ this.array = (0, global_1.Array)(size);
1195
1212
  this.$length = 0;
1196
1213
  }
1197
1214
 
@@ -1199,19 +1216,35 @@ class Heap {
1199
1216
  return this.$length;
1200
1217
  }
1201
1218
 
1202
- insert(value, order = value) {
1219
+ isEmpty() {
1220
+ return this.array[0] !== undefined;
1221
+ }
1222
+
1223
+ peek() {
1224
+ return this.array[0]?.[1];
1225
+ }
1226
+
1227
+ insert(value, order) {
1228
+ if (arguments.length < 2) {
1229
+ order = value;
1230
+ }
1231
+
1203
1232
  const array = this.array;
1204
1233
  const node = array[this.$length] = [order, value, this.$length++];
1205
- upHeapify(array, this.cmp, this.$length);
1234
+ upHeapify(this.cmp, array, this.$length);
1206
1235
  return node;
1207
1236
  }
1208
1237
 
1209
- replace(value, order = value) {
1210
- const array = this.array;
1238
+ replace(value, order) {
1239
+ if (arguments.length < 2) {
1240
+ order = value;
1241
+ }
1242
+
1211
1243
  if (this.$length === 0) return void this.insert(value, order);
1244
+ const array = this.array;
1212
1245
  const replaced = array[0][1];
1213
1246
  array[0] = [order, value, 0];
1214
- downHeapify(array, this.cmp, 1, this.$length, this.stable);
1247
+ downHeapify(this.cmp, array, 1, this.$length, this.stable);
1215
1248
  return replaced;
1216
1249
  }
1217
1250
 
@@ -1229,47 +1262,146 @@ class Heap {
1229
1262
  swap(array, index, --this.$length); // @ts-expect-error
1230
1263
 
1231
1264
  array[this.$length] = undefined;
1232
- index < this.$length && this.sort(array[index]);
1233
-
1234
- if (array.length >= 2 ** 16 && array.length >= this.$length * 2) {
1235
- array.splice(array.length / 2, array.length / 2);
1236
- }
1237
-
1265
+ index < this.$length && sort(this.cmp, array, index, this.$length, this.stable);
1238
1266
  return node[1];
1239
1267
  }
1240
1268
 
1241
- update(node, order = node[1], value = node[1]) {
1269
+ update(node, order, value) {
1270
+ if (arguments.length < 2) {
1271
+ order = node[0];
1272
+ }
1273
+
1242
1274
  const array = this.array;
1243
1275
  if (array[node[2]] !== node) throw new Error('Invalid node');
1244
- node[1] = value;
1276
+
1277
+ if (arguments.length > 2) {
1278
+ node[1] = value;
1279
+ }
1280
+
1245
1281
  if (this.cmp(node[0], node[0] = order) === 0) return;
1246
- this.sort(node);
1282
+ sort(this.cmp, array, node[2], this.$length, this.stable);
1247
1283
  }
1248
1284
 
1249
- sort(node) {
1250
- const array = this.array;
1251
- return upHeapify(array, this.cmp, node[2] + 1) || downHeapify(array, this.cmp, node[2] + 1, this.$length, this.stable);
1285
+ clear() {
1286
+ this.array = (0, global_1.Array)(size);
1287
+ this.$length = 0;
1288
+ }
1289
+
1290
+ }
1291
+
1292
+ exports.Heap = Heap;
1293
+
1294
+ Heap.max = (a, b) => a > b ? -1 : a < b ? 1 : 0;
1295
+
1296
+ Heap.min = (a, b) => a > b ? 1 : a < b ? -1 : 0;
1297
+
1298
+ class MultiHeap {
1299
+ constructor(cmp = MultiHeap.max, clean = true) {
1300
+ this.cmp = cmp;
1301
+ this.clean = clean;
1302
+ this.heap = new Heap(this.cmp);
1303
+ this.dict = new Map();
1304
+ this.list = (0, memoize_1.memoize)(order => {
1305
+ const list = new invlist_1.List();
1306
+ list[MultiHeap.order] = order;
1307
+ list[MultiHeap.heap] = this.heap.insert(list, order);
1308
+ return list;
1309
+ }, this.dict);
1310
+ this.$length = 0;
1311
+ }
1312
+
1313
+ get length() {
1314
+ return this.$length;
1315
+ }
1316
+
1317
+ isEmpty() {
1318
+ return this.heap.isEmpty();
1252
1319
  }
1253
1320
 
1254
1321
  peek() {
1255
- return this.array[0]?.[1];
1322
+ return this.heap.peek()?.head.value;
1323
+ }
1324
+
1325
+ insert(value, order) {
1326
+ if (arguments.length < 2) {
1327
+ order = value;
1328
+ }
1329
+
1330
+ ++this.$length;
1331
+ const list = this.list(order);
1332
+ return [order, list.push(value)];
1333
+ }
1334
+
1335
+ extract() {
1336
+ if (this.$length === 0) return;
1337
+ --this.$length;
1338
+ const list = this.heap.peek();
1339
+ const value = list.shift();
1340
+
1341
+ if (list.length === 0) {
1342
+ this.heap.extract();
1343
+ this.clean && this.dict.delete(list[MultiHeap.order]);
1344
+ }
1345
+
1346
+ return value;
1347
+ }
1348
+
1349
+ delete(node) {
1350
+ if (!node[1].list) throw new Error('Invalid node');
1351
+ const {
1352
+ 0: order,
1353
+ 1: lnode
1354
+ } = node;
1355
+ --this.$length;
1356
+
1357
+ if (lnode.list.length === 1) {
1358
+ this.heap.delete(lnode[MultiHeap.heap]);
1359
+ this.clean && this.dict.delete(order);
1360
+ }
1361
+
1362
+ return lnode.delete();
1363
+ }
1364
+
1365
+ update(node, order, value) {
1366
+ if (!node[1].list) throw new Error('Invalid node');
1367
+
1368
+ if (arguments.length < 2) {
1369
+ order = node[0];
1370
+ }
1371
+
1372
+ if (arguments.length > 2) {
1373
+ node[1].value = value;
1374
+ }
1375
+
1376
+ if (this.cmp(node[0], order) === 0) return node;
1377
+ this.delete(node);
1378
+ return this.insert(node[1].value, order);
1256
1379
  }
1257
1380
 
1258
1381
  clear() {
1259
- this.array = [];
1382
+ this.heap.clear();
1383
+ this.dict.clear();
1260
1384
  this.$length = 0;
1261
1385
  }
1262
1386
 
1263
1387
  }
1264
1388
 
1265
- exports.Heap = Heap;
1389
+ exports.MultiHeap = MultiHeap;
1390
+ MultiHeap.order = Symbol('order');
1391
+ MultiHeap.heap = Symbol('heap');
1392
+ MultiHeap.max = Heap.max;
1393
+ MultiHeap.min = Heap.min;
1394
+
1395
+ function sort(cmp, array, index, length, stable) {
1396
+ return upHeapify(cmp, array, index + 1) || downHeapify(cmp, array, index + 1, length, stable);
1397
+ }
1266
1398
 
1267
- function upHeapify(array, cmp, index) {
1399
+ function upHeapify(cmp, array, index) {
1268
1400
  const order = array[index - 1][0];
1269
1401
  let changed = false;
1270
1402
 
1271
1403
  while (index > 1) {
1272
- const parent = (0, alias_1.floor)(index / 2);
1404
+ const parent = index / 2 | 0;
1273
1405
  if (cmp(array[parent - 1][0], order) <= 0) break;
1274
1406
  swap(array, index - 1, parent - 1);
1275
1407
  index = parent;
@@ -1279,7 +1411,7 @@ function upHeapify(array, cmp, index) {
1279
1411
  return changed;
1280
1412
  }
1281
1413
 
1282
- function downHeapify(array, cmp, index, length, stable) {
1414
+ function downHeapify(cmp, array, index, length, stable) {
1283
1415
  let changed = false;
1284
1416
 
1285
1417
  while (index < length) {
@@ -1357,7 +1489,7 @@ __exportStar(__webpack_require__(2310), exports);
1357
1489
  /***/ ((__unused_webpack_module, exports) => {
1358
1490
 
1359
1491
  "use strict";
1360
- // Circular inverse list
1492
+ // Circular Inverse List
1361
1493
 
1362
1494
  var _a;
1363
1495
 
@@ -1395,10 +1527,18 @@ class List {
1395
1527
  return this.head = this.push(value);
1396
1528
  }
1397
1529
 
1530
+ push(value) {
1531
+ return new Node(this, value, this.head, this.head?.prev);
1532
+ }
1533
+
1398
1534
  unshiftNode(node) {
1399
1535
  return this.head = this.pushNode(node);
1400
1536
  }
1401
1537
 
1538
+ pushNode(node) {
1539
+ return this.insert(node, this.head);
1540
+ }
1541
+
1402
1542
  unshiftRotationally(value) {
1403
1543
  const node = this.last;
1404
1544
  if (!node) return this.unshift(value);
@@ -1407,18 +1547,6 @@ class List {
1407
1547
  return node;
1408
1548
  }
1409
1549
 
1410
- shift() {
1411
- return this.head?.delete();
1412
- }
1413
-
1414
- push(value) {
1415
- return new Node(value, this.head, this.head?.prev, this);
1416
- }
1417
-
1418
- pushNode(node) {
1419
- return this.insert(node, this.head);
1420
- }
1421
-
1422
1550
  pushRotationally(value) {
1423
1551
  const node = this.head;
1424
1552
  if (!node) return this.push(value);
@@ -1427,12 +1555,16 @@ class List {
1427
1555
  return node;
1428
1556
  }
1429
1557
 
1558
+ shift() {
1559
+ return this.head?.delete();
1560
+ }
1561
+
1430
1562
  pop() {
1431
1563
  return this.last?.delete();
1432
1564
  }
1433
1565
 
1434
1566
  insert(node, before = this.head) {
1435
- if (node.list === this) return before && node.move(before), node;
1567
+ if (node.list === this) return node.moveTo(before), node;
1436
1568
  node.delete();
1437
1569
  ++this[LENGTH];
1438
1570
  this.head ??= node; // @ts-expect-error
@@ -1457,11 +1589,11 @@ class List {
1457
1589
  exports.List = List;
1458
1590
 
1459
1591
  class Node {
1460
- constructor(value, next, prev, list = next?.list ?? new List()) {
1592
+ constructor(list, value, next, prev) {
1593
+ this.list = list;
1461
1594
  this.value = value;
1462
1595
  this.next = next;
1463
1596
  this.prev = prev;
1464
- this.list = list;
1465
1597
  ++list[LENGTH];
1466
1598
  list.head ??= this;
1467
1599
  next && prev ? next.prev = prev.next = this : this.next = this.prev = this;
@@ -1470,17 +1602,21 @@ class Node {
1470
1602
  delete() {
1471
1603
  if (!this.list) return this.value;
1472
1604
  --this.list[LENGTH];
1605
+ const {
1606
+ next,
1607
+ prev
1608
+ } = this;
1473
1609
 
1474
1610
  if (this.list.head === this) {
1475
- this.list.head = this.next === this ? undefined : this.next;
1611
+ this.list.head = next === this ? undefined : next;
1476
1612
  }
1477
1613
 
1478
- if (this.next) {
1479
- this.next.prev = this.prev;
1614
+ if (next) {
1615
+ next.prev = prev;
1480
1616
  }
1481
1617
 
1482
- if (this.prev) {
1483
- this.prev.next = this.next;
1618
+ if (prev) {
1619
+ prev.next = next;
1484
1620
  } // @ts-expect-error
1485
1621
 
1486
1622
 
@@ -1491,20 +1627,19 @@ class Node {
1491
1627
  }
1492
1628
 
1493
1629
  insertBefore(value) {
1494
- return new Node(value, this, this.prev, this.list);
1630
+ return new Node(this.list, value, this, this.prev);
1495
1631
  }
1496
1632
 
1497
1633
  insertAfter(value) {
1498
- return new Node(value, this.next, this, this.list);
1634
+ return new Node(this.list, value, this.next, this);
1499
1635
  }
1500
1636
 
1501
- move(before) {
1637
+ moveTo(before) {
1502
1638
  if (!before) return false;
1503
1639
  if (this === before) return false;
1504
1640
  if (before.list !== this.list) return before.list.insert(this, before), true;
1505
1641
  const a1 = this;
1506
1642
  const b1 = before;
1507
- if (!b1) return false;
1508
1643
  if (a1.next === b1) return false;
1509
1644
  const b0 = b1.prev;
1510
1645
  const a0 = a1.prev;
@@ -1519,12 +1654,12 @@ class Node {
1519
1654
  }
1520
1655
 
1521
1656
  moveToHead() {
1522
- this.move(this.list.head);
1657
+ this.moveTo(this.list.head);
1523
1658
  this.list.head = this;
1524
1659
  }
1525
1660
 
1526
1661
  moveToLast() {
1527
- this.move(this.list.head);
1662
+ this.moveTo(this.list.head);
1528
1663
  }
1529
1664
 
1530
1665
  swap(node) {
@@ -1533,8 +1668,8 @@ class Node {
1533
1668
  if (node1 === node2) return false;
1534
1669
  const node3 = node2.next;
1535
1670
  if (node1.list !== node2.list) throw new Error(`Spica: InvList: Cannot swap nodes across lists.`);
1536
- node2.move(node1);
1537
- node1.move(node3);
1671
+ node2.moveTo(node1);
1672
+ node1.moveTo(node3);
1538
1673
 
1539
1674
  switch (this.list.head) {
1540
1675
  case node1:
@@ -1570,12 +1705,14 @@ const alias_1 = __webpack_require__(5406);
1570
1705
 
1571
1706
  const compare_1 = __webpack_require__(5529);
1572
1707
 
1708
+ const undefined = void 0;
1709
+
1573
1710
  function memoize(f, identify = (...as) => as[0], memory) {
1574
- if (typeof identify === 'object') return memoize(f, void 0, identify);
1575
- if (memory === void 0) return memoize(f, identify, new global_1.Map());
1711
+ if (typeof identify === 'object') return memoize(f, undefined, identify);
1712
+ if (memory === undefined) return memoize(f, identify, new global_1.Map());
1576
1713
  if ((0, alias_1.isArray)(memory)) return memoize(f, identify, {
1577
1714
  has(key) {
1578
- return memory[key] !== void 0;
1715
+ return memory[key] !== undefined;
1579
1716
  },
1580
1717
 
1581
1718
  get(key) {
@@ -1596,9 +1733,9 @@ function memoize(f, identify = (...as) => as[0], memory) {
1596
1733
  return (...as) => {
1597
1734
  const b = identify(...as);
1598
1735
  let z = memory.get(b);
1599
- if (z !== void 0 || nullish && memory.has(b)) return z;
1736
+ if (z !== undefined || nullish && memory.has(b)) return z;
1600
1737
  z = f(...as);
1601
- nullish ||= z === void 0;
1738
+ nullish ||= z === undefined;
1602
1739
  memory.set(b, z);
1603
1740
  return z;
1604
1741
  };
@@ -1607,8 +1744,8 @@ function memoize(f, identify = (...as) => as[0], memory) {
1607
1744
  exports.memoize = memoize;
1608
1745
 
1609
1746
  function reduce(f, identify = (...as) => as[0]) {
1610
- let key = [];
1611
- let val = [];
1747
+ let key = {};
1748
+ let val;
1612
1749
  return (...as) => {
1613
1750
  const b = identify(...as);
1614
1751
 
@@ -1662,6 +1799,210 @@ __exportStar(__webpack_require__(5084), exports);
1662
1799
 
1663
1800
  /***/ }),
1664
1801
 
1802
+ /***/ 4934:
1803
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1804
+
1805
+ "use strict";
1806
+
1807
+
1808
+ Object.defineProperty(exports, "__esModule", ({
1809
+ value: true
1810
+ }));
1811
+ exports.PriorityQueue = exports.Queue = void 0;
1812
+
1813
+ const global_1 = __webpack_require__(4128);
1814
+
1815
+ const heap_1 = __webpack_require__(818);
1816
+
1817
+ const memoize_1 = __webpack_require__(1808);
1818
+
1819
+ const undefined = void 0;
1820
+ const size = 2048;
1821
+ const initsize = 16;
1822
+
1823
+ class Queue {
1824
+ constructor() {
1825
+ this.head = new FixedQueue(initsize);
1826
+ this.tail = this.head;
1827
+ this.count = 0;
1828
+ this.irregular = 0;
1829
+ }
1830
+
1831
+ get length() {
1832
+ return this.count === 0 ? this.head.length : this.head.length + this.tail.length + (size - 1) * (this.count - 2) + (this.irregular || size) - 1;
1833
+ }
1834
+
1835
+ isEmpty() {
1836
+ return this.head.isEmpty();
1837
+ }
1838
+
1839
+ peek(index = 0) {
1840
+ return index === 0 ? this.head.peek(0) : this.tail.peek(-1);
1841
+ }
1842
+
1843
+ push(value) {
1844
+ const tail = this.tail;
1845
+
1846
+ if (tail.isFull()) {
1847
+ if (tail.next.isEmpty()) {
1848
+ this.tail = tail.next;
1849
+ } else {
1850
+ this.tail = tail.next = new FixedQueue(size, tail.next);
1851
+ }
1852
+
1853
+ ++this.count;
1854
+
1855
+ if (tail.size !== size && tail !== this.head) {
1856
+ this.irregular = tail.size;
1857
+ }
1858
+ }
1859
+
1860
+ this.tail.push(value);
1861
+ }
1862
+
1863
+ pop() {
1864
+ const head = this.head;
1865
+ const value = head.pop();
1866
+
1867
+ if (head.isEmpty() && !head.next.isEmpty()) {
1868
+ --this.count;
1869
+ this.head = head.next;
1870
+
1871
+ if (this.head.size === this.irregular) {
1872
+ this.irregular = 0;
1873
+ }
1874
+ }
1875
+
1876
+ return value;
1877
+ }
1878
+
1879
+ clear() {
1880
+ this.head = this.tail = new FixedQueue(initsize);
1881
+ this.count = 0;
1882
+ this.irregular = 0;
1883
+ }
1884
+
1885
+ *[Symbol.iterator]() {
1886
+ while (!this.isEmpty()) {
1887
+ yield this.pop();
1888
+ }
1889
+
1890
+ return;
1891
+ }
1892
+
1893
+ }
1894
+
1895
+ exports.Queue = Queue;
1896
+
1897
+ class FixedQueue {
1898
+ constructor(size, next) {
1899
+ this.size = size;
1900
+ this.array = (0, global_1.Array)(this.size);
1901
+ this.mask = this.array.length - 1;
1902
+ this.head = 0;
1903
+ this.tail = 0;
1904
+ this.next = next ?? this;
1905
+ }
1906
+
1907
+ get length() {
1908
+ return this.tail >= this.head ? this.tail - this.head : this.array.length - this.head + this.tail;
1909
+ }
1910
+
1911
+ isEmpty() {
1912
+ return this.tail === this.head;
1913
+ }
1914
+
1915
+ isFull() {
1916
+ return (this.tail + 1 & this.mask) === this.head;
1917
+ }
1918
+
1919
+ peek(index = 0) {
1920
+ return index === 0 ? this.array[this.head] : this.array[this.tail - 1 & this.mask];
1921
+ }
1922
+
1923
+ push(value) {
1924
+ this.array[this.tail] = value;
1925
+ this.tail = this.tail + 1 & this.mask;
1926
+ }
1927
+
1928
+ pop() {
1929
+ if (this.isEmpty()) return;
1930
+ const value = this.array[this.head];
1931
+ this.array[this.head] = undefined;
1932
+ this.head = this.head + 1 & this.mask;
1933
+ return value;
1934
+ }
1935
+
1936
+ }
1937
+
1938
+ class PriorityQueue {
1939
+ constructor(cmp = PriorityQueue.max, clean = true) {
1940
+ this.clean = clean;
1941
+ this.dict = new Map();
1942
+ this.queue = (0, memoize_1.memoize)(priority => {
1943
+ const queue = new Queue();
1944
+ queue[PriorityQueue.priority] = priority;
1945
+ this.heap.insert(queue, priority);
1946
+ return queue;
1947
+ }, this.dict);
1948
+ this.$length = 0;
1949
+ this.heap = new heap_1.Heap(cmp);
1950
+ }
1951
+
1952
+ get length() {
1953
+ return this.$length;
1954
+ }
1955
+
1956
+ isEmpty() {
1957
+ return this.$length === 0;
1958
+ }
1959
+
1960
+ peek() {
1961
+ return this.heap.peek()?.peek();
1962
+ }
1963
+
1964
+ push(value, priority) {
1965
+ ++this.$length;
1966
+ this.queue(priority).push(value);
1967
+ }
1968
+
1969
+ pop() {
1970
+ if (this.$length === 0) return;
1971
+ --this.$length;
1972
+ const queue = this.heap.peek();
1973
+ const value = queue.pop();
1974
+
1975
+ if (queue.isEmpty()) {
1976
+ this.heap.extract();
1977
+ this.clean && this.dict.delete(queue[PriorityQueue.priority]);
1978
+ }
1979
+
1980
+ return value;
1981
+ }
1982
+
1983
+ clear() {
1984
+ this.heap.clear();
1985
+ this.dict.clear();
1986
+ this.$length = 0;
1987
+ }
1988
+
1989
+ *[Symbol.iterator]() {
1990
+ while (!this.isEmpty()) {
1991
+ yield this.pop();
1992
+ }
1993
+
1994
+ return;
1995
+ }
1996
+
1997
+ }
1998
+
1999
+ exports.PriorityQueue = PriorityQueue;
2000
+ PriorityQueue.priority = Symbol('priority');
2001
+ PriorityQueue.max = heap_1.Heap.max;
2002
+ PriorityQueue.min = heap_1.Heap.min;
2003
+
2004
+ /***/ }),
2005
+
1665
2006
  /***/ 7325:
1666
2007
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1667
2008
 
@@ -1695,12 +2036,14 @@ function unique(rnd, len, mem) {
1695
2036
  let limit = 5;
1696
2037
  return () => {
1697
2038
  while (true) {
1698
- for (let i = 0; i < limit; ++i) {
1699
- const r = rnd(len);
1700
- if (mem.has(r)) continue;
1701
- mem.add(r);
1702
- return r;
1703
- }
2039
+ try {
2040
+ for (let i = 0; i < limit; ++i) {
2041
+ const r = rnd(len);
2042
+ if (mem.has(r)) continue;
2043
+ mem.add(r);
2044
+ return r;
2045
+ }
2046
+ } catch {}
1704
2047
 
1705
2048
  clear && mem.clear();
1706
2049
  ++len;
@@ -1722,41 +2065,270 @@ function cons(radix) {
1722
2065
  };
1723
2066
  }
1724
2067
 
1725
- function conv(rnd, dict) {
1726
- return (len = 1) => {
1727
- let acc = '';
2068
+ function conv(rnd, dict) {
2069
+ return (len = 1) => {
2070
+ let acc = '';
2071
+
2072
+ while (len--) {
2073
+ acc += dict[rnd()];
2074
+ }
2075
+
2076
+ return acc;
2077
+ };
2078
+ }
2079
+
2080
+ const buffer = new Uint16Array(512);
2081
+ const digit = 16;
2082
+ const masks = bases.map((_, i) => +`0b${'1'.repeat(i) || 0}`);
2083
+ let index = buffer.length;
2084
+ let offset = digit;
2085
+
2086
+ function random(len) {
2087
+ if (index === buffer.length) {
2088
+ global_1.crypto.getRandomValues(buffer);
2089
+ index = 0;
2090
+ }
2091
+
2092
+ if (offset === len) {
2093
+ offset = digit;
2094
+ return buffer[index++] & masks[len];
2095
+ } else if (offset > len) {
2096
+ offset -= len;
2097
+ return buffer[index] >> offset & masks[len];
2098
+ } else {
2099
+ offset = digit;
2100
+ ++index;
2101
+ return random(len);
2102
+ }
2103
+ }
2104
+
2105
+ /***/ }),
2106
+
2107
+ /***/ 6395:
2108
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2109
+
2110
+ "use strict";
2111
+
2112
+
2113
+ Object.defineProperty(exports, "__esModule", ({
2114
+ value: true
2115
+ }));
2116
+ exports.Ring = void 0;
2117
+
2118
+ const global_1 = __webpack_require__(4128);
2119
+
2120
+ const alias_1 = __webpack_require__(5406);
2121
+
2122
+ const array_1 = __webpack_require__(8112);
2123
+
2124
+ const undefined = void 0;
2125
+ const empty = Symbol('empty');
2126
+
2127
+ const unempty = value => value === empty ? undefined : value;
2128
+
2129
+ const space = Object.freeze((0, global_1.Array)(100).fill(empty));
2130
+ let size = 16;
2131
+
2132
+ class Ring {
2133
+ constructor() {
2134
+ this.array = (0, global_1.Array)(size);
2135
+ this.head = 0;
2136
+ this.tail = 0;
2137
+ this.$length = 0;
2138
+ this.excess = 0;
2139
+ }
2140
+
2141
+ get length() {
2142
+ return this.$length;
2143
+ }
2144
+
2145
+ at(index) {
2146
+ // Inline the code for optimization.
2147
+ const array = this.array;
2148
+
2149
+ if (index >= 0) {
2150
+ if (index >= this.$length) return;
2151
+ return unempty(array[(this.head - 1 + index) % array.length]);
2152
+ } else {
2153
+ if (-index > this.$length) return;
2154
+ return this.tail + index >= 0 ? unempty(array[this.tail + index]) : unempty(array[array.length + this.tail + index]);
2155
+ }
2156
+ }
2157
+
2158
+ replace(index, value, replacer) {
2159
+ const array = this.array;
2160
+
2161
+ if (index >= 0) {
2162
+ if (index >= this.$length) throw new RangeError('Invalid index');
2163
+ index = (this.head - 1 + index) % array.length;
2164
+ } else {
2165
+ if (-index > this.$length) throw new RangeError('Invalid index');
2166
+ index = this.tail + index >= 0 ? this.tail + index : array.length + this.tail + index;
2167
+ }
2168
+
2169
+ const val = unempty(array[index]);
2170
+ array[index] = replacer ? replacer(val, value) : value;
2171
+ return val;
2172
+ }
2173
+
2174
+ push(value) {
2175
+ const array = this.array;
2176
+ let {
2177
+ head,
2178
+ tail
2179
+ } = this;
2180
+ tail = this.tail = next(head, tail, array.length);
2181
+ head = this.head ||= tail;
2182
+
2183
+ if (head === tail && this.$length !== 0) {
2184
+ (0, array_1.splice)(array, tail - 1, 0, ...space);
2185
+ head = this.head += space.length;
2186
+ }
2187
+
2188
+ array[tail - 1] = value;
2189
+ ++this.$length;
2190
+ }
2191
+
2192
+ unshift(value) {
2193
+ const array = this.array;
2194
+ let {
2195
+ head,
2196
+ tail
2197
+ } = this;
2198
+ head = this.head = prev(head, tail, array.length);
2199
+ tail = this.tail ||= head;
2200
+
2201
+ if (head === tail && this.$length !== 0) {
2202
+ (0, array_1.splice)(array, head, 0, ...space);
2203
+ head = this.head += space.length;
2204
+ }
2205
+
2206
+ array[head - 1] = value;
2207
+ ++this.$length;
2208
+ }
2209
+
2210
+ pop() {
2211
+ if (this.$length === 0) return;
2212
+ const array = this.array;
2213
+ const i = this.tail - 1;
2214
+ const value = unempty(array[i]);
2215
+ array[i] = empty;
2216
+ --this.$length === 0 ? this.head = this.tail = 0 : this.tail = this.tail === 1 ? array.length : this.tail - 1;
2217
+ return value;
2218
+ }
2219
+
2220
+ shift() {
2221
+ if (this.$length === 0) return;
2222
+ const array = this.array;
2223
+ const i = this.head - 1;
2224
+ const value = unempty(array[i]);
2225
+ array[i] = empty;
2226
+ --this.$length === 0 ? this.head = this.tail = 0 : this.head = this.head === array.length ? 1 : this.head + 1;
2227
+ return value;
2228
+ }
2229
+
2230
+ splice(index, count, ...values) {
2231
+ const array = this.array;
2232
+
2233
+ if (this.excess > 100 && array.length - this.$length > 200) {
2234
+ (0, array_1.splice)(array, 0, 100 - (0, array_1.splice)(array, this.tail, 100).length);
2235
+ this.excess -= 100;
2236
+ } else if (-this.excess > array.length * 2) {
2237
+ this.excess = array.length;
2238
+ }
2239
+
2240
+ index = index < 0 ? (0, alias_1.max)(0, this.$length + index) : index <= this.$length ? index : this.$length;
2241
+ count = (0, alias_1.min)((0, alias_1.max)(count, 0), this.$length - index);
2242
+
2243
+ if (values.length === 0) {
2244
+ if (count === 0) return [];
2245
+
2246
+ switch (index) {
2247
+ case 0:
2248
+ if (count === 1) return [this.shift()];
2249
+ break;
2250
+
2251
+ case this.$length - 1:
2252
+ if (count === 1) return [this.pop()];
2253
+ break;
2254
+
2255
+ case this.$length:
2256
+ return [];
2257
+ }
2258
+ }
2259
+
2260
+ index = (this.head || 1) - 1 + index;
2261
+ index = index > array.length ? index % array.length : index;
2262
+ this.excess += values.length - count;
2263
+ this.$length += values.length - count; // |--H>*>T--|
2264
+
2265
+ if (this.head <= this.tail) {
2266
+ this.tail += values.length - count;
2267
+ return (0, array_1.splice)(array, index, count, ...values);
2268
+ } // |*>T---H>>|
2269
+
2270
+
2271
+ if (index < this.tail) {
2272
+ this.head += values.length - count;
2273
+ this.tail += values.length - count;
2274
+ return (0, array_1.splice)(array, index, count, ...values);
2275
+ } // |>>T---H>*|
2276
+
2277
+
2278
+ const cnt = (0, alias_1.min)(count, array.length - index);
2279
+ const vs = (0, array_1.splice)(array, index, cnt, ...(0, array_1.splice)(values, 0, cnt));
2280
+ vs.push(...(0, array_1.splice)(array, 0, count - vs.length, ...values));
2281
+ return vs;
2282
+ }
2283
+
2284
+ clear() {
2285
+ this.array = (0, global_1.Array)(size);
2286
+ this.$length = this.head = this.tail = 0;
2287
+ }
2288
+
2289
+ includes(value) {
2290
+ return this.array.includes(value);
2291
+ }
2292
+
2293
+ relational(index) {
2294
+ if (index === -1) return -1;
2295
+ return index + 1 >= this.head ? index + 1 - this.head : this.array.length - this.head + index;
2296
+ }
1728
2297
 
1729
- while (len--) {
1730
- acc += dict[rnd()];
1731
- }
2298
+ indexOf(value) {
2299
+ return this.relational((0, array_1.indexOf)(this.array, value));
2300
+ }
1732
2301
 
1733
- return acc;
1734
- };
1735
- }
2302
+ findIndex(f) {
2303
+ return this.relational(this.array.findIndex(value => value !== empty && f(value)));
2304
+ }
1736
2305
 
1737
- const buffer = new Uint16Array(512);
1738
- const digit = 16;
1739
- const masks = bases.map((_, i) => +`0b${'1'.repeat(i) || 0}`);
1740
- let index = buffer.length;
1741
- let offset = digit;
2306
+ find(f) {
2307
+ return unempty(this.array.find(value => value !== empty && f(value)));
2308
+ }
1742
2309
 
1743
- function random(len) {
1744
- if (index === buffer.length) {
1745
- global_1.crypto.getRandomValues(buffer);
1746
- index = 0;
2310
+ toArray() {
2311
+ return this.head <= this.tail ? this.array.slice((this.head || 1) - 1, this.tail) : this.array.slice((this.head || 1) - 1).concat(this.array.slice(0, this.tail));
1747
2312
  }
1748
2313
 
1749
- if (offset === len) {
1750
- offset = digit;
1751
- return buffer[index++] & masks[len];
1752
- } else if (offset > len) {
1753
- offset -= len;
1754
- return buffer[index] >> offset & masks[len];
1755
- } else {
1756
- offset = digit;
1757
- ++index;
1758
- return random(len);
2314
+ *[Symbol.iterator]() {
2315
+ for (let i = 0; i < this.$length; ++i) {
2316
+ yield this.at(i);
2317
+ }
2318
+
2319
+ return;
1759
2320
  }
2321
+
2322
+ }
2323
+
2324
+ exports.Ring = Ring;
2325
+
2326
+ function next(head, tail, length) {
2327
+ return tail === length && head !== 1 ? 1 : tail + 1;
2328
+ }
2329
+
2330
+ function prev(head, tail, length) {
2331
+ return head === 0 || head === 1 ? tail === length ? length + 1 : length : head - 1;
1760
2332
  }
1761
2333
 
1762
2334
  /***/ }),
@@ -1847,84 +2419,80 @@ Object.defineProperty(exports, "ReadonlyURL", ({
1847
2419
  return format_3.ReadonlyURL;
1848
2420
  }
1849
2421
  }));
1850
- const internal = Symbol.for('spica/url::internal');
1851
2422
 
1852
2423
  class URL {
1853
2424
  constructor(source, base) {
1854
2425
  this.source = source;
1855
2426
  this.base = base;
1856
- this[internal] = {
1857
- url: new format_1.ReadonlyURL(source, base),
1858
- searchParams: void 0
1859
- };
2427
+ this.url = new format_1.ReadonlyURL(source, base);
1860
2428
  }
1861
2429
 
1862
2430
  get href() {
1863
- return this[internal].searchParams?.toString().replace(/^(?=.)/, `${this[internal].url.href.slice(0, -this[internal].url.query.length - this[internal].url.fragment.length || this[internal].url.href.length)}?`).concat(this.fragment) ?? this[internal].url.href;
2431
+ return this.params?.toString().replace(/^(?=.)/, `${this.url.href.slice(0, -this.url.query.length - this.url.fragment.length || this.url.href.length)}?`).concat(this.fragment) ?? this.url.href;
1864
2432
  }
1865
2433
 
1866
2434
  get resource() {
1867
- return this[internal].searchParams?.toString().replace(/^(?=.)/, `${this[internal].url.href.slice(0, -this[internal].url.query.length - this[internal].url.fragment.length || this[internal].url.href.length)}?`) ?? this[internal].url.resource;
2435
+ return this.params?.toString().replace(/^(?=.)/, `${this.url.href.slice(0, -this.url.query.length - this.url.fragment.length || this.url.href.length)}?`) ?? this.url.resource;
1868
2436
  }
1869
2437
 
1870
2438
  get origin() {
1871
- return this[internal].url.origin;
2439
+ return this.url.origin;
1872
2440
  }
1873
2441
 
1874
2442
  get scheme() {
1875
- return this[internal].url.protocol.slice(0, -1);
2443
+ return this.url.protocol.slice(0, -1);
1876
2444
  }
1877
2445
 
1878
2446
  get protocol() {
1879
- return this[internal].url.protocol;
2447
+ return this.url.protocol;
1880
2448
  }
1881
2449
 
1882
2450
  get username() {
1883
- return this[internal].url.username;
2451
+ return this.url.username;
1884
2452
  }
1885
2453
 
1886
2454
  get password() {
1887
- return this[internal].url.password;
2455
+ return this.url.password;
1888
2456
  }
1889
2457
 
1890
2458
  get host() {
1891
- return this[internal].url.host;
2459
+ return this.url.host;
1892
2460
  }
1893
2461
 
1894
2462
  get hostname() {
1895
- return this[internal].url.hostname;
2463
+ return this.url.hostname;
1896
2464
  }
1897
2465
 
1898
2466
  get port() {
1899
- return this[internal].url.port;
2467
+ return this.url.port;
1900
2468
  }
1901
2469
 
1902
2470
  get path() {
1903
- return this[internal].searchParams?.toString().replace(/^(?=.)/, `${this.pathname}?`) ?? this[internal].url.path;
2471
+ return this.params?.toString().replace(/^(?=.)/, `${this.pathname}?`) ?? this.url.path;
1904
2472
  }
1905
2473
 
1906
2474
  get pathname() {
1907
- return this[internal].url.pathname;
2475
+ return this.url.pathname;
1908
2476
  }
1909
2477
 
1910
2478
  get search() {
1911
- return this[internal].searchParams?.toString().replace(/^(?=.)/, '?') ?? this[internal].url.search;
2479
+ return this.params?.toString().replace(/^(?=.)/, '?') ?? this.url.search;
1912
2480
  }
1913
2481
 
1914
2482
  get query() {
1915
- return this[internal].searchParams?.toString().replace(/^(?=.)/, '?') ?? this[internal].url.query;
2483
+ return this.params?.toString().replace(/^(?=.)/, '?') ?? this.url.query;
1916
2484
  }
1917
2485
 
1918
2486
  get hash() {
1919
- return this[internal].url.hash;
2487
+ return this.url.hash;
1920
2488
  }
1921
2489
 
1922
2490
  get fragment() {
1923
- return this[internal].url.fragment;
2491
+ return this.url.fragment;
1924
2492
  }
1925
2493
 
1926
2494
  get searchParams() {
1927
- return this[internal].searchParams ??= new global_1.URLSearchParams(this.search);
2495
+ return this.params ??= new global_1.URLSearchParams(this.search);
1928
2496
  }
1929
2497
 
1930
2498
  toString() {
@@ -1973,7 +2541,6 @@ function encode(url) {
1973
2541
  }
1974
2542
 
1975
2543
  exports._encode = encode;
1976
- const internal = Symbol.for('spica/url::internal');
1977
2544
 
1978
2545
  class ReadonlyURL {
1979
2546
  constructor(source, base) {
@@ -2006,74 +2573,71 @@ class ReadonlyURL {
2006
2573
 
2007
2574
  }
2008
2575
 
2009
- this[internal] = {
2010
- share: ReadonlyURL.get(source, base),
2011
- searchParams: void 0
2012
- };
2576
+ this.share = ReadonlyURL.get(source, base);
2013
2577
  }
2014
2578
 
2015
2579
  get href() {
2016
- return this[internal].share.href ??= this[internal].share.url.href;
2580
+ return this.share.href ??= this.share.url.href;
2017
2581
  }
2018
2582
 
2019
2583
  get resource() {
2020
- return this[internal].share.resource ??= this.href.slice(0, -this.fragment.length - this.query.length || this.href.length) + this.search;
2584
+ return this.share.resource ??= this.href.slice(0, -this.fragment.length - this.query.length || this.href.length) + this.search;
2021
2585
  }
2022
2586
 
2023
2587
  get origin() {
2024
- return this[internal].share.origin ??= this[internal].share.url.origin;
2588
+ return this.share.origin ??= this.share.url.origin;
2025
2589
  }
2026
2590
 
2027
2591
  get protocol() {
2028
- return this[internal].share.protocol ??= this[internal].share.url.protocol;
2592
+ return this.share.protocol ??= this.share.url.protocol;
2029
2593
  }
2030
2594
 
2031
2595
  get username() {
2032
- return this[internal].share.username ??= this[internal].share.url.username;
2596
+ return this.share.username ??= this.share.url.username;
2033
2597
  }
2034
2598
 
2035
2599
  get password() {
2036
- return this[internal].share.password ??= this[internal].share.url.password;
2600
+ return this.share.password ??= this.share.url.password;
2037
2601
  }
2038
2602
 
2039
2603
  get host() {
2040
- return this[internal].share.host ??= this[internal].share.url.host;
2604
+ return this.share.host ??= this.share.url.host;
2041
2605
  }
2042
2606
 
2043
2607
  get hostname() {
2044
- return this[internal].share.hostname ??= this[internal].share.url.hostname;
2608
+ return this.share.hostname ??= this.share.url.hostname;
2045
2609
  }
2046
2610
 
2047
2611
  get port() {
2048
- return this[internal].share.port ??= this[internal].share.url.port;
2612
+ return this.share.port ??= this.share.url.port;
2049
2613
  }
2050
2614
 
2051
2615
  get path() {
2052
- return this[internal].share.path ??= `${this.pathname}${this.search}`;
2616
+ return this.share.path ??= `${this.pathname}${this.search}`;
2053
2617
  }
2054
2618
 
2055
2619
  get pathname() {
2056
- return this[internal].share.pathname ??= this[internal].share.url.pathname;
2620
+ return this.share.pathname ??= this.share.url.pathname;
2057
2621
  }
2058
2622
 
2059
2623
  get search() {
2060
- return this[internal].share.search ??= this[internal].share.url.search;
2624
+ return this.share.search ??= this.share.url.search;
2061
2625
  }
2062
2626
 
2063
2627
  get query() {
2064
- return this[internal].share.query ??= this.search || this.href[this.href.length - this.fragment.length - 1] === '?' && '?' || '';
2628
+ return this.share.query ??= this.search || this.href[this.href.length - this.fragment.length - 1] === '?' && '?' || '';
2065
2629
  }
2066
2630
 
2067
2631
  get hash() {
2068
- return this[internal].share.hash ??= this[internal].share.url.hash;
2632
+ return this.share.hash ??= this.share.url.hash;
2069
2633
  }
2070
2634
 
2071
2635
  get fragment() {
2072
- return this[internal].share.fragment ??= this.hash || this.href[this.href.length - 1] === '#' && '#' || '';
2636
+ return this.share.fragment ??= this.hash || this.href[this.href.length - 1] === '#' && '#' || '';
2073
2637
  }
2074
2638
 
2075
2639
  get searchParams() {
2076
- return this[internal].searchParams ??= new global_1.URLSearchParams(this.search);
2640
+ return this.params ??= new global_1.URLSearchParams(this.search);
2077
2641
  }
2078
2642
 
2079
2643
  toString() {
@@ -5367,8 +5931,6 @@ const dom_1 = __webpack_require__(3252);
5367
5931
 
5368
5932
  const memoize_1 = __webpack_require__(1808);
5369
5933
 
5370
- const duff_1 = __webpack_require__(8099);
5371
-
5372
5934
  const array_1 = __webpack_require__(8112);
5373
5935
 
5374
5936
  const openers = {
@@ -5471,19 +6033,20 @@ function format(el, type, form) {
5471
6033
  'data-type': style(type) || global_1.undefined
5472
6034
  });
5473
6035
  const marker = el.firstElementChild?.getAttribute('data-marker').match(initial(type))?.[0] ?? '';
5474
- const es = el.children;
5475
- (0, duff_1.duffbk)(es.length, i => {
6036
+
6037
+ for (let es = el.children, len = es.length, i = 0; i < len; ++i) {
5476
6038
  const el = es[i];
5477
6039
 
5478
6040
  switch (el.getAttribute('data-marker')) {
5479
6041
  case '':
5480
6042
  case marker:
5481
6043
  el.removeAttribute('data-marker');
5482
- return;
6044
+ continue;
5483
6045
  }
5484
6046
 
5485
- return false;
5486
- });
6047
+ break;
6048
+ }
6049
+
5487
6050
  return el;
5488
6051
  }
5489
6052
 
@@ -5886,8 +6449,6 @@ exports.shortmedia = exports.media = exports.indexer = exports.indexee = exports
5886
6449
 
5887
6450
  const combinator_1 = __webpack_require__(2087);
5888
6451
 
5889
- const escape_1 = __webpack_require__(2778);
5890
-
5891
6452
  const annotation_1 = __webpack_require__(2736);
5892
6453
 
5893
6454
  const reference_1 = __webpack_require__(3555);
@@ -5912,8 +6473,6 @@ const deletion_1 = __webpack_require__(7501);
5912
6473
 
5913
6474
  const mark_1 = __webpack_require__(2480);
5914
6475
 
5915
- const emstrong_1 = __webpack_require__(6132);
5916
-
5917
6476
  const emphasis_1 = __webpack_require__(3867);
5918
6477
 
5919
6478
  const strong_1 = __webpack_require__(8072);
@@ -5932,7 +6491,7 @@ const bracket_1 = __webpack_require__(5196);
5932
6491
 
5933
6492
  const source_1 = __webpack_require__(6743);
5934
6493
 
5935
- exports.inline = (0, combinator_1.union)([escape_1.escape, annotation_1.annotation, reference_1.reference, template_1.template, comment_1.comment, math_1.math, extension_1.extension, ruby_1.ruby, link_1.link, media_1.media, html_1.html, insertion_1.insertion, deletion_1.deletion, mark_1.mark, emstrong_1.emstrong, strong_1.strong, emphasis_1.emphasis, code_1.code, htmlentity_1.htmlentity, shortmedia_1.shortmedia, autolink_1.autolink, bracket_1.bracket, source_1.text]);
6494
+ exports.inline = (0, combinator_1.union)([annotation_1.annotation, reference_1.reference, template_1.template, comment_1.comment, math_1.math, extension_1.extension, ruby_1.ruby, link_1.link, media_1.media, html_1.html, insertion_1.insertion, deletion_1.deletion, mark_1.mark, strong_1.strong, emphasis_1.emphasis, code_1.code, htmlentity_1.htmlentity, shortmedia_1.shortmedia, autolink_1.autolink, bracket_1.bracket, source_1.text]);
5936
6495
 
5937
6496
  var indexee_1 = __webpack_require__(1269);
5938
6497
 
@@ -6047,10 +6606,18 @@ exports.autolink = (0, combinator_1.fmap)((0, combinator_1.validate)(/^(?:[@#>0-
6047
6606
  , 1, 1, ~1
6048
6607
  /* State.shortcut */
6049
6608
  , (0, combinator_1.some)((0, combinator_1.union)([url_1.url, email_1.email, // Escape unmatched email-like strings.
6050
- (0, source_1.str)(/^[0-9a-z]+(?:[.+_-][0-9a-z]+)*(?:@(?:[0-9a-z]+(?:[.-][0-9a-z]+)*)?)*/i), channel_1.channel, account_1.account, // Escape unmatched account-like strings.
6609
+ (0, combinator_1.focus)(/^[0-9a-z](?:[_.+-](?=[0-9a-z])|[0-9a-z])*(?:@(?:[0-9a-z]+(?:[.-][0-9a-z]+)*)?)*/i, ({
6610
+ source
6611
+ }) => {
6612
+ if (source.length > 255 || source.includes('@')) return [[source], ''];
6613
+ const i = source.indexOf('_');
6614
+ if (i === -1) return [[source], ''];
6615
+ return [[source.slice(0, i)], source.slice(i)];
6616
+ }), channel_1.channel, account_1.account, // Escape unmatched account-like strings.
6051
6617
  (0, source_1.str)(/^@+[0-9a-z]*(?:-[0-9a-z]+)*/i), // Escape invalid leading characters.
6052
- (0, source_1.str)(new RegExp(/^(?:[^\p{C}\p{S}\p{P}\s]|emoji|['_])(?=#)/u.source.replace('emoji', hashtag_1.emoji), 'u')), hashtag_1.hashtag, hashnum_1.hashnum, // Escape unmatched hashtag-like strings.
6053
- (0, source_1.str)(new RegExp(/^#+(?:[^\p{C}\p{S}\p{P}\s]|emoji|['_])*/u.source.replace('emoji', hashtag_1.emoji), 'u')), anchor_1.anchor]))))), ns => ns.length === 1 ? ns : [(0, util_1.stringify)(ns)]);
6618
+ (0, source_1.str)(new RegExp(/^(?:[^\p{C}\p{S}\p{P}\s]|emoji)(?=#)/u.source.replace('emoji', hashtag_1.emoji), 'u')), hashtag_1.hashtag, hashnum_1.hashnum, // Escape unmatched hashtag-like strings.
6619
+ (0, source_1.str)(new RegExp(/^#+(?:[^\p{C}\p{S}\p{P}\s]|emoji|')*/u.source.replace('emoji', hashtag_1.emoji), 'u')), // Escape invalid leading characters.
6620
+ (0, source_1.str)(/^[0-9\p{Sc}](?=>)/u), anchor_1.anchor]))))), ns => ns.length === 1 ? ns : [(0, util_1.stringify)(ns)]);
6054
6621
 
6055
6622
  /***/ }),
6056
6623
 
@@ -6166,7 +6733,7 @@ const source_1 = __webpack_require__(6743);
6166
6733
  const dom_1 = __webpack_require__(3252); // https://html.spec.whatwg.org/multipage/input.html
6167
6734
 
6168
6735
 
6169
- exports.email = (0, combinator_1.creation)((0, combinator_1.rewrite)((0, combinator_1.verify)((0, source_1.str)(/^[0-9a-z](?:[.+_-](?=[^\W_])|[0-9a-z]){0,255}@[0-9a-z](?:(?:[0-9a-z]|-(?=\w)){0,61}[0-9a-z])?(?:\.[0-9a-z](?:(?:[0-9a-z]|-(?=\w)){0,61}[0-9a-z])?)*(?![0-9a-z])/i), ([source]) => source.length <= 255), ({
6736
+ exports.email = (0, combinator_1.creation)((0, combinator_1.rewrite)((0, combinator_1.verify)((0, source_1.str)(/^[0-9a-z](?:[_.+-](?=[0-9a-z])|[0-9a-z]){0,255}@[0-9a-z](?:(?:[0-9a-z]|-(?=\w)){0,61}[0-9a-z])?(?:\.[0-9a-z](?:(?:[0-9a-z]|-(?=\w)){0,61}[0-9a-z])?)*(?![0-9a-z])/i), ([source]) => source.length <= 255), ({
6170
6737
  source
6171
6738
  }) => [[(0, dom_1.html)('a', {
6172
6739
  class: 'email',
@@ -6198,7 +6765,7 @@ const dom_1 = __webpack_require__(3252);
6198
6765
 
6199
6766
  exports.hashnum = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.constraint)(1
6200
6767
  /* State.shortcut */
6201
- , false, (0, combinator_1.open)('#', (0, source_1.str)(new RegExp(/^[0-9]{1,16}(?![^\p{C}\p{S}\p{P}\s]|emoji|['_])/u.source.replace(/emoji/, hashtag_1.emoji), 'u')))), (0, combinator_1.convert)(source => `[${source}]{ ${source.slice(1)} }`, (0, combinator_1.union)([link_1.unsafelink]))), ([el]) => [(0, dom_1.define)(el, {
6768
+ , false, (0, combinator_1.open)('#', (0, source_1.str)(new RegExp(/^[0-9]{1,16}(?![^\p{C}\p{S}\p{P}\s]|emoji|')/u.source.replace(/emoji/, hashtag_1.emoji), 'u')))), (0, combinator_1.convert)(source => `[${source}]{ ${source.slice(1)} }`, (0, combinator_1.union)([link_1.unsafelink]))), ([el]) => [(0, dom_1.define)(el, {
6202
6769
  class: 'hashnum',
6203
6770
  href: null
6204
6771
  })]));
@@ -6229,7 +6796,7 @@ const dom_1 = __webpack_require__(3252); // https://example/hashtags/a must be a
6229
6796
  exports.emoji = String.raw`\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F`;
6230
6797
  exports.hashtag = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.constraint)(1
6231
6798
  /* State.shortcut */
6232
- , false, (0, combinator_1.open)('#', (0, combinator_1.tails)([(0, combinator_1.verify)((0, source_1.str)(/^[0-9a-z](?:(?:[0-9a-z]|-(?=\w)){0,61}[0-9a-z])?(?:\.[0-9a-z](?:(?:[0-9a-z]|-(?=\w)){0,61}[0-9a-z])?)*\//i), ([source]) => source.length <= 253 + 1), (0, combinator_1.verify)((0, source_1.str)(new RegExp([/^(?=[0-9]{0,127}_?(?:[^\d\p{C}\p{S}\p{P}\s]|emoji))/u.source, /(?:[^\p{C}\p{S}\p{P}\s]|emoji|_(?=[^\p{C}\p{S}\p{P}\s]|emoji)){1,128}/u.source, /(?!_?(?:[^\p{C}\p{S}\p{P}\s]|emoji)|')/u.source].join('').replace(/emoji/g, exports.emoji), 'u')), ([source]) => source.length <= 128)]))), (0, combinator_1.convert)(source => `[${source}]{ ${source.includes('/') ? `https://${source.slice(1).replace('/', '/hashtags/')}` : `/hashtags/${source.slice(1)}`} }`, (0, combinator_1.union)([link_1.unsafelink]))), ([el]) => [(0, dom_1.define)(el, {
6799
+ , false, (0, combinator_1.open)('#', (0, combinator_1.tails)([(0, combinator_1.verify)((0, source_1.str)(/^[0-9a-z](?:(?:[0-9a-z]|-(?=\w)){0,61}[0-9a-z])?(?:\.[0-9a-z](?:(?:[0-9a-z]|-(?=\w)){0,61}[0-9a-z])?)*\//i), ([source]) => source.length <= 253 + 1), (0, combinator_1.verify)((0, source_1.str)(new RegExp([/^(?=(?:[0-9]{1,127}_?)?(?:[^\d\p{C}\p{S}\p{P}\s]|emoji|'))/u.source, /(?:[^\p{C}\p{S}\p{P}\s]|emoji|(?<!')'|_(?=[^\p{C}\p{S}\p{P}\s]|emoji|')){1,128}/u.source, /(?!_?(?:[^\p{C}\p{S}\p{P}\s]|emoji|(?<!')'))/u.source].join('').replace(/emoji/g, exports.emoji), 'u')), ([source]) => source.length <= 128)]))), (0, combinator_1.convert)(source => `[${source}]{ ${source.includes('/') ? `https://${source.slice(1).replace('/', '/hashtags/')}` : `/hashtags/${source.slice(1)}`} }`, (0, combinator_1.union)([link_1.unsafelink]))), ([el]) => [(0, dom_1.define)(el, {
6233
6800
  class: 'hashtag'
6234
6801
  }, el.innerText)]));
6235
6802
 
@@ -6252,7 +6819,7 @@ const link_1 = __webpack_require__(9628);
6252
6819
 
6253
6820
  const source_1 = __webpack_require__(6743);
6254
6821
 
6255
- const closer = /^[-+*=~^,.;:!?]*(?=[\\"`|\[\](){}<>]|$)/;
6822
+ const closer = /^[-+*=~^_,.;:!?]*(?=[\\"`|\[\](){}<>]|$)/;
6256
6823
  exports.url = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['http://', 'https://'], (0, combinator_1.rewrite)((0, combinator_1.open)(/^https?:\/\/(?=[\x21-\x7E])/, (0, combinator_1.focus)(/^[\x21-\x7E]+/, (0, combinator_1.some)((0, combinator_1.union)([bracket, (0, combinator_1.some)(source_1.unescsource, closer)])))), (0, combinator_1.convert)(url => `{ ${url} }`, (0, combinator_1.union)([link_1.unsafelink])))));
6257
6824
  const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.precedence)(2, (0, combinator_1.union)([(0, combinator_1.surround)('(', (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ')'), ')', true), (0, combinator_1.surround)('[', (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ']'), ']', true), (0, combinator_1.surround)('{', (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), '}'), '}', true), (0, combinator_1.surround)('"', (0, combinator_1.precedence)(8, (0, combinator_1.some)(source_1.unescsource, '"')), '"', true)]))));
6258
6825
 
@@ -6404,7 +6971,7 @@ const dom_1 = __webpack_require__(3252);
6404
6971
 
6405
6972
  const array_1 = __webpack_require__(8112);
6406
6973
 
6407
- exports.deletion = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('~~'), (0, combinator_1.syntax)(0
6974
+ exports.deletion = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('~~', '~'), (0, combinator_1.syntax)(0
6408
6975
  /* Syntax.none */
6409
6976
  , 1, 1, 0
6410
6977
  /* State.none */
@@ -6427,45 +6994,6 @@ const combinator_1 = __webpack_require__(2087);
6427
6994
 
6428
6995
  const inline_1 = __webpack_require__(1160);
6429
6996
 
6430
- const emstrong_1 = __webpack_require__(6132);
6431
-
6432
- const strong_1 = __webpack_require__(8072);
6433
-
6434
- const source_1 = __webpack_require__(6743);
6435
-
6436
- const visibility_1 = __webpack_require__(7618);
6437
-
6438
- const dom_1 = __webpack_require__(3252);
6439
-
6440
- const array_1 = __webpack_require__(8112);
6441
-
6442
- exports.emphasis = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('*'), (0, combinator_1.syntax)(0
6443
- /* Syntax.none */
6444
- , 1, 1, 0
6445
- /* State.none */
6446
- , (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([strong_1.strong, (0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('*')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), (0, combinator_1.union)([emstrong_1.emstrong, strong_1.strong, exports.emphasis]))])), '*')), (0, source_1.str)('*'), false, ([, bs], rest) => [[(0, dom_1.html)('em', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]));
6447
-
6448
- /***/ }),
6449
-
6450
- /***/ 6132:
6451
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6452
-
6453
- "use strict";
6454
-
6455
-
6456
- Object.defineProperty(exports, "__esModule", ({
6457
- value: true
6458
- }));
6459
- exports.emstrong = void 0;
6460
-
6461
- const combinator_1 = __webpack_require__(2087);
6462
-
6463
- const inline_1 = __webpack_require__(1160);
6464
-
6465
- const strong_1 = __webpack_require__(8072);
6466
-
6467
- const emphasis_1 = __webpack_require__(3867);
6468
-
6469
6997
  const source_1 = __webpack_require__(6743);
6470
6998
 
6471
6999
  const visibility_1 = __webpack_require__(7618);
@@ -6474,77 +7002,11 @@ const dom_1 = __webpack_require__(3252);
6474
7002
 
6475
7003
  const array_1 = __webpack_require__(8112);
6476
7004
 
6477
- const substrong = (0, combinator_1.lazy)(() => (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('**')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), (0, combinator_1.union)([exports.emstrong, strong_1.strong]))])));
6478
- const subemphasis = (0, combinator_1.lazy)(() => (0, combinator_1.some)((0, combinator_1.union)([strong_1.strong, (0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('*')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), (0, combinator_1.union)([exports.emstrong, strong_1.strong, emphasis_1.emphasis]))])));
6479
- exports.emstrong = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('***'), (0, combinator_1.syntax)(0
7005
+ exports.emphasis = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('_', '_'), (0, combinator_1.syntax)(0
6480
7006
  /* Syntax.none */
6481
7007
  , 1, 1, 0
6482
7008
  /* State.none */
6483
- , (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('*')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)])))), (0, source_1.str)(/^\*{1,3}/), false, ([, bs, cs], rest, context) => {
6484
- switch (cs[0]) {
6485
- case '***':
6486
- return [[(0, dom_1.html)('em', [(0, dom_1.html)('strong', (0, dom_1.defrag)(bs))])], rest];
6487
-
6488
- case '**':
6489
- return (0, combinator_1.bind)(subemphasis, (ds, rest) => rest.slice(0, 1) === '*' ? [[(0, dom_1.html)('em', (0, array_1.unshift)([(0, dom_1.html)('strong', (0, dom_1.defrag)(bs))], (0, dom_1.defrag)(ds)))], rest.slice(1)] : [(0, array_1.unshift)(['*', (0, dom_1.html)('strong', (0, dom_1.defrag)(bs))], ds), rest])({
6490
- source: rest,
6491
- context
6492
- }) ?? [['*', (0, dom_1.html)('strong', (0, dom_1.defrag)(bs))], rest];
6493
-
6494
- case '*':
6495
- return (0, combinator_1.bind)(substrong, (ds, rest) => rest.slice(0, 2) === '**' ? [[(0, dom_1.html)('strong', (0, array_1.unshift)([(0, dom_1.html)('em', (0, dom_1.defrag)(bs))], (0, dom_1.defrag)(ds)))], rest.slice(2)] : [(0, array_1.unshift)(['**', (0, dom_1.html)('em', (0, dom_1.defrag)(bs))], ds), rest])({
6496
- source: rest,
6497
- context
6498
- }) ?? [['**', (0, dom_1.html)('em', (0, dom_1.defrag)(bs))], rest];
6499
- }
6500
- }, ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]));
6501
-
6502
- /***/ }),
6503
-
6504
- /***/ 2778:
6505
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6506
-
6507
- "use strict";
6508
-
6509
-
6510
- Object.defineProperty(exports, "__esModule", ({
6511
- value: true
6512
- }));
6513
- exports.escape = void 0;
6514
-
6515
- const global_1 = __webpack_require__(4128);
6516
-
6517
- const combinator_1 = __webpack_require__(2087);
6518
-
6519
- const source_1 = __webpack_require__(6743);
6520
-
6521
- const repeat = (0, source_1.str)(/^(.)\1*/);
6522
- exports.escape = (0, combinator_1.union)([({
6523
- source,
6524
- context
6525
- }) => {
6526
- if (source.length < 3) return;
6527
-
6528
- switch (source[0]) {
6529
- case '*':
6530
- if (source.length < 4) return;
6531
- return source[3] === source[0] && source[2] === source[0] && source[1] === source[0] ? repeat({
6532
- source,
6533
- context
6534
- }) : global_1.undefined;
6535
-
6536
- case '+':
6537
- case '~':
6538
- case '=':
6539
- return source[2] === source[0] && source[1] === source[0] ? repeat({
6540
- source,
6541
- context
6542
- }) : global_1.undefined;
6543
-
6544
- default:
6545
- return;
6546
- }
6547
- }]);
7009
+ , (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('_')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '_'), exports.emphasis)])))), (0, source_1.str)('_'), false, ([, bs], rest) => [[(0, dom_1.html)('em', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]));
6548
7010
 
6549
7011
  /***/ }),
6550
7012
 
@@ -6976,7 +7438,7 @@ const dom_1 = __webpack_require__(3252);
6976
7438
 
6977
7439
  const array_1 = __webpack_require__(8112);
6978
7440
 
6979
- exports.insertion = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('++'), (0, combinator_1.syntax)(0
7441
+ exports.insertion = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('++', '+'), (0, combinator_1.syntax)(0
6980
7442
  /* Syntax.none */
6981
7443
  , 1, 1, 0
6982
7444
  /* State.none */
@@ -7182,7 +7644,7 @@ const dom_1 = __webpack_require__(3252);
7182
7644
 
7183
7645
  const array_1 = __webpack_require__(8112);
7184
7646
 
7185
- exports.mark = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('=='), (0, combinator_1.syntax)(0
7647
+ exports.mark = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('==', '='), (0, combinator_1.syntax)(0
7186
7648
  /* Syntax.none */
7187
7649
  , 1, 1, 0
7188
7650
  /* State.none */
@@ -7562,8 +8024,6 @@ const combinator_1 = __webpack_require__(2087);
7562
8024
 
7563
8025
  const inline_1 = __webpack_require__(1160);
7564
8026
 
7565
- const emstrong_1 = __webpack_require__(6132);
7566
-
7567
8027
  const source_1 = __webpack_require__(6743);
7568
8028
 
7569
8029
  const visibility_1 = __webpack_require__(7618);
@@ -7572,11 +8032,11 @@ const dom_1 = __webpack_require__(3252);
7572
8032
 
7573
8033
  const array_1 = __webpack_require__(8112);
7574
8034
 
7575
- exports.strong = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('**'), (0, combinator_1.syntax)(0
8035
+ exports.strong = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('*', '*'), (0, combinator_1.syntax)(0
7576
8036
  /* Syntax.none */
7577
8037
  , 1, 1, 0
7578
8038
  /* State.none */
7579
- , (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('**')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), (0, combinator_1.union)([emstrong_1.emstrong, exports.strong]))])), '*')), (0, source_1.str)('**'), false, ([, bs], rest) => [[(0, dom_1.html)('strong', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]));
8039
+ , (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('*')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), exports.strong)])))), (0, source_1.str)('*'), false, ([, bs], rest) => [[(0, dom_1.html)('strong', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]));
7580
8040
 
7581
8041
  /***/ }),
7582
8042
 
@@ -7702,16 +8162,7 @@ Object.defineProperty(exports, "__esModule", ({
7702
8162
  exports.japanese = void 0;
7703
8163
 
7704
8164
  function japanese(char) {
7705
- switch (char) {
7706
- case '、':
7707
- case '。':
7708
- case '!':
7709
- case '?':
7710
- return true;
7711
-
7712
- default:
7713
- return false;
7714
- }
8165
+ return /^[\p{Ideo}\p{scx=Hiragana}\p{scx=Katakana}~!?]/u.test(char);
7715
8166
  }
7716
8167
 
7717
8168
  exports.japanese = japanese;
@@ -7849,7 +8300,9 @@ function* figure(target, footnotes, opts = {}) {
7849
8300
  labels.add(label);
7850
8301
  opts.id !== '' && def.setAttribute('id', `label:${opts.id ? `${opts.id}:` : ''}${label}`);
7851
8302
 
7852
- for (const ref of refs.take(label, global_1.Infinity)) {
8303
+ for (let rs = refs.take(label, global_1.Infinity), i = 0; i < rs.length; ++i) {
8304
+ const ref = rs[i];
8305
+
7853
8306
  if (ref.getAttribute('data-invalid-message') === messages.reference) {
7854
8307
  (0, dom_1.define)(ref, {
7855
8308
  class: void ref.classList.remove('invalid'),
@@ -8018,7 +8471,8 @@ function build(syntax, marker, splitter) {
8018
8471
  if (title && !blank && def.childNodes.length === 1) {
8019
8472
  def.insertBefore(content.cloneNode(true), def.lastChild);
8020
8473
 
8021
- for (const ref of buffer.take(identifier, global_1.Infinity)) {
8474
+ for (let refs = buffer.take(identifier, global_1.Infinity), i = 0; i < refs.length; ++i) {
8475
+ const ref = refs[i];
8022
8476
  if (ref.getAttribute('data-invalid-type') !== 'content') continue;
8023
8477
  (0, dom_1.define)(ref, {
8024
8478
  title,
@@ -8335,17 +8789,19 @@ const global_1 = __webpack_require__(4128);
8335
8789
 
8336
8790
  const combinator_1 = __webpack_require__(2087);
8337
8791
 
8338
- function str(pattern) {
8792
+ function str(pattern, not) {
8339
8793
  return typeof pattern === 'string' ? (0, combinator_1.creation)(1, false, ({
8340
8794
  source
8341
8795
  }) => {
8342
8796
  if (source === '') return;
8797
+ if (not && source.slice(pattern.length, pattern.length + not.length) === not) return;
8343
8798
  return source.slice(0, pattern.length) === pattern ? [[pattern], source.slice(pattern.length)] : global_1.undefined;
8344
8799
  }) : (0, combinator_1.creation)(1, false, ({
8345
8800
  source
8346
8801
  }) => {
8347
8802
  if (source === '') return;
8348
8803
  const m = source.match(pattern);
8804
+ if (m && not && source.slice(m[0].length, m[0].length + not.length) === not) return;
8349
8805
  return m && m[0].length > 0 ? [[m[0]], source.slice(m[0].length)] : global_1.undefined;
8350
8806
  });
8351
8807
  }
@@ -8390,9 +8846,10 @@ const str_1 = __webpack_require__(2790);
8390
8846
 
8391
8847
  const dom_1 = __webpack_require__(3252);
8392
8848
 
8393
- exports.delimiter = /[\s\x00-\x7F]|\S[#>]|[()、。!?][^\S\n]*(?=\\\n)/;
8849
+ exports.delimiter = /[\s\x00-\x7F]|\S[#>]|[\p{Ideo}\p{scx=Hiragana}\p{scx=Katakana}~!?][^\S\n]*(?=\\\n)/u;
8394
8850
  exports.nonWhitespace = /[\S\n]|$/;
8395
8851
  exports.nonAlphanumeric = /[^0-9A-Za-z]|\S[#>]|$/;
8852
+ const nssb = /^[\p{Ideo}\p{scx=Hiragana}\p{scx=Katakana}~!?][^\S\n]*(?=\\\n)/u;
8396
8853
  const repeat = (0, str_1.str)(/^(.)\1*/);
8397
8854
  exports.text = (0, combinator_1.creation)(1, false, ({
8398
8855
  source,
@@ -8409,25 +8866,15 @@ exports.text = (0, combinator_1.creation)(1, false, ({
8409
8866
  switch (source[0]) {
8410
8867
  case '\x1B':
8411
8868
  case '\\':
8412
- switch (source[1]) {
8413
- case '、':
8414
- case '。':
8415
- case '!':
8416
- case '?':
8417
- return (0, exports.text)({
8418
- source: source.slice(1),
8419
- context
8420
- });
8421
- }
8422
-
8423
- break;
8869
+ if (!nssb.test(source.slice(1))) break;
8870
+ return (0, exports.text)({
8871
+ source: source.slice(1),
8872
+ context
8873
+ });
8424
8874
 
8425
- case '、':
8426
- case '。':
8427
- case '':
8428
- case '?':
8429
- const i = source.slice(1).search(exports.nonWhitespace) + 1;
8430
- if (i > 0 && source.slice(i, i + 2) === '\\\n') return [[source[0], (0, dom_1.html)('span', {
8875
+ default:
8876
+ const i = source.match(nssb)?.[0].length ?? -1;
8877
+ if (i !== -1) return [[source[0], (0, dom_1.html)('span', {
8431
8878
  class: 'linebreak'
8432
8879
  })], source.slice(i + 2)];
8433
8880
  }
@@ -8451,6 +8898,7 @@ exports.text = (0, combinator_1.creation)(1, false, ({
8451
8898
  case '\n':
8452
8899
  return [[(0, dom_1.html)('br')], source.slice(1)];
8453
8900
 
8901
+ case '_':
8454
8902
  case '*':
8455
8903
  case '+':
8456
8904
  case '~':
@@ -8864,8 +9312,8 @@ function render(source, opts = {}) {
8864
9312
  opts = extend(opts);
8865
9313
  const base = global_1.location.href;
8866
9314
 
8867
- for (const el of (0, query_1.querySelectorAll)(source, selector)) {
8868
- render_(base, el, opts);
9315
+ for (let es = (0, query_1.querySelectorAllWith)(source, selector), i = 0; i < es.length; ++i) {
9316
+ render_(base, es[i], opts);
8869
9317
  }
8870
9318
  }
8871
9319
 
@@ -9566,7 +10014,7 @@ function unlink(h) {
9566
10014
  /***/ 3252:
9567
10015
  /***/ (function(module) {
9568
10016
 
9569
- /*! typed-dom v0.0.301 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */
10017
+ /*! typed-dom v0.0.305 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */
9570
10018
  (function webpackUniversalModuleDefinition(root, factory) {
9571
10019
  if(true)
9572
10020
  module.exports = factory();
@@ -9584,9 +10032,9 @@ return /******/ (() => { // webpackBootstrap
9584
10032
  Object.defineProperty(exports, "__esModule", ({
9585
10033
  value: true
9586
10034
  }));
9587
- exports.ObjectSetPrototypeOf = exports.ObjectGetPrototypeOf = exports.ObjectCreate = exports.ObjectAssign = exports.toString = exports.isEnumerable = exports.isPrototypeOf = exports.hasOwnProperty = exports.isArray = exports.sign = exports.round = exports.random = exports.min = exports.max = exports.floor = exports.ceil = exports.abs = exports.parseInt = exports.parseFloat = exports.isSafeInteger = exports.isNaN = exports.isInteger = exports.isFinite = exports[NaN] = void 0;
10035
+ exports.ObjectSetPrototypeOf = exports.ObjectGetPrototypeOf = exports.ObjectCreate = exports.ObjectAssign = exports.toString = exports.isEnumerable = exports.isPrototypeOf = exports.hasOwnProperty = exports.isArray = exports.sqrt = exports.log = exports.tan = exports.cos = exports.sign = exports.round = exports.random = exports.min = exports.max = exports.floor = exports.ceil = exports.abs = exports.parseInt = exports.parseFloat = exports.isSafeInteger = exports.isNaN = exports.isInteger = exports.isFinite = exports[NaN] = void 0;
9588
10036
  exports[NaN] = Number.NaN, exports.isFinite = Number.isFinite, exports.isInteger = Number.isInteger, exports.isNaN = Number.isNaN, exports.isSafeInteger = Number.isSafeInteger, exports.parseFloat = Number.parseFloat, exports.parseInt = Number.parseInt;
9589
- exports.abs = Math.abs, exports.ceil = Math.ceil, exports.floor = Math.floor, exports.max = Math.max, exports.min = Math.min, exports.random = Math.random, exports.round = Math.round, exports.sign = Math.sign;
10037
+ exports.abs = Math.abs, exports.ceil = Math.ceil, exports.floor = Math.floor, exports.max = Math.max, exports.min = Math.min, exports.random = Math.random, exports.round = Math.round, exports.sign = Math.sign, exports.cos = Math.cos, exports.tan = Math.tan, exports.log = Math.log, exports.sqrt = Math.sqrt;
9590
10038
  exports.isArray = Array.isArray;
9591
10039
  exports.hasOwnProperty = Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty);
9592
10040
  exports.isPrototypeOf = Object.prototype.isPrototypeOf.call.bind(Object.prototype.isPrototypeOf);
@@ -9618,11 +10066,11 @@ exports.equal = equal;
9618
10066
  /***/ }),
9619
10067
 
9620
10068
  /***/ 128:
9621
- /***/ ((module, __unused_webpack_exports, __nested_webpack_require_2590__) => {
10069
+ /***/ ((module, __unused_webpack_exports, __nested_webpack_require_2745__) => {
9622
10070
 
9623
10071
 
9624
10072
 
9625
- __nested_webpack_require_2590__(921);
10073
+ __nested_webpack_require_2745__(921);
9626
10074
 
9627
10075
  const global = void 0 || typeof globalThis !== 'undefined' && globalThis // @ts-ignore
9628
10076
  || typeof self !== 'undefined' && self || Function('return this')();
@@ -9643,7 +10091,7 @@ var global = (/* unused pure expression or super */ null && (0));
9643
10091
  /***/ }),
9644
10092
 
9645
10093
  /***/ 808:
9646
- /***/ ((__unused_webpack_module, exports, __nested_webpack_require_3077__) => {
10094
+ /***/ ((__unused_webpack_module, exports, __nested_webpack_require_3232__) => {
9647
10095
 
9648
10096
 
9649
10097
 
@@ -9652,11 +10100,11 @@ Object.defineProperty(exports, "__esModule", ({
9652
10100
  }));
9653
10101
  exports.reduce = exports.memoize = void 0;
9654
10102
 
9655
- const global_1 = __nested_webpack_require_3077__(128);
10103
+ const global_1 = __nested_webpack_require_3232__(128);
9656
10104
 
9657
- const alias_1 = __nested_webpack_require_3077__(406);
10105
+ const alias_1 = __nested_webpack_require_3232__(406);
9658
10106
 
9659
- const compare_1 = __nested_webpack_require_3077__(529);
10107
+ const compare_1 = __nested_webpack_require_3232__(529);
9660
10108
 
9661
10109
  function memoize(f, identify = (...as) => as[0], memory) {
9662
10110
  if (typeof identify === 'object') return memoize(f, void 0, identify);
@@ -9714,7 +10162,7 @@ exports.reduce = reduce;
9714
10162
  /***/ }),
9715
10163
 
9716
10164
  /***/ 521:
9717
- /***/ ((__unused_webpack_module, exports, __nested_webpack_require_4467__) => {
10165
+ /***/ ((__unused_webpack_module, exports, __nested_webpack_require_4622__) => {
9718
10166
 
9719
10167
 
9720
10168
 
@@ -9723,11 +10171,11 @@ Object.defineProperty(exports, "__esModule", ({
9723
10171
  }));
9724
10172
  exports.defrag = exports.prepend = exports.append = exports.isChildren = exports.define = exports.element = exports.text = exports.svg = exports.html = exports.frag = exports.shadow = void 0;
9725
10173
 
9726
- const global_1 = __nested_webpack_require_4467__(128);
10174
+ const global_1 = __nested_webpack_require_4622__(128);
9727
10175
 
9728
- const alias_1 = __nested_webpack_require_4467__(406);
10176
+ const alias_1 = __nested_webpack_require_4622__(406);
9729
10177
 
9730
- const memoize_1 = __nested_webpack_require_4467__(808);
10178
+ const memoize_1 = __nested_webpack_require_4622__(808);
9731
10179
 
9732
10180
  var caches;
9733
10181
 
@@ -9768,9 +10216,8 @@ function text(source) {
9768
10216
  exports.text = text;
9769
10217
 
9770
10218
  function element(context, ns) {
9771
- const cache = (0, memoize_1.memoize)(elem, (_, ns, tag) => `${ns}:${tag}`);
9772
10219
  return (tag, attrs, children) => {
9773
- const el = tag.includes('-') ? elem(context, ns, tag) : cache(context, ns, tag).cloneNode(true);
10220
+ const el = elem(context, ns, tag);
9774
10221
  return !attrs || isChildren(attrs) ? defineChildren(el, attrs ?? children) : defineChildren(defineAttrs(el, attrs), children);
9775
10222
  };
9776
10223
  }
@@ -9963,7 +10410,7 @@ exports.defrag = defrag;
9963
10410
  /******/ var __webpack_module_cache__ = {};
9964
10411
  /******/
9965
10412
  /******/ // The require function
9966
- /******/ function __nested_webpack_require_11560__(moduleId) {
10413
+ /******/ function __nested_webpack_require_11575__(moduleId) {
9967
10414
  /******/ // Check if module is in cache
9968
10415
  /******/ var cachedModule = __webpack_module_cache__[moduleId];
9969
10416
  /******/ if (cachedModule !== undefined) {
@@ -9977,7 +10424,7 @@ exports.defrag = defrag;
9977
10424
  /******/ };
9978
10425
  /******/
9979
10426
  /******/ // Execute the module function
9980
- /******/ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_11560__);
10427
+ /******/ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_11575__);
9981
10428
  /******/
9982
10429
  /******/ // Return the exports of the module
9983
10430
  /******/ return module.exports;
@@ -9988,7 +10435,7 @@ exports.defrag = defrag;
9988
10435
  /******/ // startup
9989
10436
  /******/ // Load entry module and return exports
9990
10437
  /******/ // This entry module is referenced by other modules so it can't be inlined
9991
- /******/ var __webpack_exports__ = __nested_webpack_require_11560__(521);
10438
+ /******/ var __webpack_exports__ = __nested_webpack_require_11575__(521);
9992
10439
  /******/
9993
10440
  /******/ return __webpack_exports__;
9994
10441
  /******/ })()
@@ -10000,7 +10447,7 @@ exports.defrag = defrag;
10000
10447
  /***/ 6120:
10001
10448
  /***/ (function(module) {
10002
10449
 
10003
- /*! typed-dom v0.0.301 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */
10450
+ /*! typed-dom v0.0.305 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */
10004
10451
  (function webpackUniversalModuleDefinition(root, factory) {
10005
10452
  if(true)
10006
10453
  module.exports = factory();
@@ -10010,114 +10457,6 @@ return /******/ (() => { // webpackBootstrap
10010
10457
  /******/ "use strict";
10011
10458
  /******/ var __webpack_modules__ = ({
10012
10459
 
10013
- /***/ 112:
10014
- /***/ ((__unused_webpack_module, exports, __nested_webpack_require_645__) => {
10015
-
10016
-
10017
-
10018
- Object.defineProperty(exports, "__esModule", ({
10019
- value: true
10020
- }));
10021
- exports.splice = exports.pop = exports.push = exports.shift = exports.unshift = exports.indexOf = void 0;
10022
-
10023
- const global_1 = __nested_webpack_require_645__(128);
10024
-
10025
- function indexOf(as, a) {
10026
- if (as.length === 0) return -1;
10027
- return a === a ? as.indexOf(a) : as.findIndex(a => a !== a);
10028
- }
10029
-
10030
- exports.indexOf = indexOf;
10031
-
10032
- function unshift(as, bs) {
10033
- if ('length' in as) {
10034
- for (let i = as.length - 1; i >= 0; --i) {
10035
- bs.unshift(as[i]);
10036
- }
10037
- } else {
10038
- bs.unshift(...as);
10039
- }
10040
-
10041
- return bs;
10042
- }
10043
-
10044
- exports.unshift = unshift;
10045
-
10046
- function shift(as, count) {
10047
- if (count < 0) throw new Error('Unexpected negative number');
10048
- return count === void 0 ? [as.shift(), as] : [splice(as, 0, count), as];
10049
- }
10050
-
10051
- exports.shift = shift;
10052
-
10053
- function push(as, bs) {
10054
- if ('length' in bs) {
10055
- for (let i = 0, len = bs.length; i < len; ++i) {
10056
- as.push(bs[i]);
10057
- }
10058
- } else {
10059
- for (const b of bs) {
10060
- as.push(b);
10061
- }
10062
- }
10063
-
10064
- return as;
10065
- }
10066
-
10067
- exports.push = push;
10068
-
10069
- function pop(as, count) {
10070
- if (count < 0) throw new Error('Unexpected negative number');
10071
- return count === void 0 ? [as, as.pop()] : [as, splice(as, as.length - count, count)];
10072
- }
10073
-
10074
- exports.pop = pop;
10075
-
10076
- function splice(as, index, count, ...inserts) {
10077
- if (count === 0 && inserts.length === 0) return [];
10078
- count = count > as.length ? as.length : count;
10079
-
10080
- switch (index) {
10081
- case 0:
10082
- switch (count) {
10083
- case 0:
10084
- return [[], unshift(inserts, as)][0];
10085
-
10086
- case 1:
10087
- return as.length === 0 ? [[], unshift(inserts, as)][0] : [[as.shift()], unshift(inserts, as)][0];
10088
-
10089
- case void 0:
10090
- if (as.length > 1 || arguments.length > 2) break;
10091
- return as.length === 0 ? [] : splice(as, index, 1);
10092
- }
10093
-
10094
- break;
10095
-
10096
- case -1:
10097
- case as.length - 1:
10098
- switch (count) {
10099
- case 1:
10100
- return as.length === 0 ? [[], push(as, inserts)][0] : [[as.pop()], push(as, inserts)][0];
10101
-
10102
- case void 0:
10103
- if (as.length > 1 || arguments.length > 2) break;
10104
- return as.length === 0 ? [] : splice(as, index, 1);
10105
- }
10106
-
10107
- break;
10108
-
10109
- case as.length:
10110
- case global_1.Infinity:
10111
- return [[], push(as, inserts)][0];
10112
- }
10113
-
10114
- return arguments.length > 2 ? as.splice(index, count, ...inserts) : as.splice(index);
10115
- }
10116
-
10117
- exports.splice = splice;
10118
-
10119
- /***/ }),
10120
-
10121
10460
  /***/ 99:
10122
10461
  /***/ ((__unused_webpack_module, exports) => {
10123
10462
 
@@ -10131,7 +10470,7 @@ exports.duffReduce = exports.duffEach = exports.duffbk = exports.duff = void 0;
10131
10470
  function duff(count, proc) {
10132
10471
  if (count > 0) {
10133
10472
  let i = 0,
10134
- m = count % 8,
10473
+ m = count & 7,
10135
10474
  d = (count - m) / 8;
10136
10475
 
10137
10476
  while (m--) {
@@ -10150,7 +10489,7 @@ function duff(count, proc) {
10150
10489
  }
10151
10490
  } else {
10152
10491
  let i = -count,
10153
- m = i % 8,
10492
+ m = i & 7,
10154
10493
  d = (i - m) / 8;
10155
10494
 
10156
10495
  while (m--) {
@@ -10175,7 +10514,7 @@ exports.duff = duff;
10175
10514
  function duffbk(count, proc) {
10176
10515
  if (count > 0) {
10177
10516
  let i = 0,
10178
- m = count % 8,
10517
+ m = count & 7,
10179
10518
  d = (count - m) / 8;
10180
10519
 
10181
10520
  while (m--) {
@@ -10183,18 +10522,21 @@ function duffbk(count, proc) {
10183
10522
  }
10184
10523
 
10185
10524
  while (d--) {
10186
- if (proc(i++) === false) return;
10187
- if (proc(i++) === false) return;
10188
- if (proc(i++) === false) return;
10189
- if (proc(i++) === false) return;
10190
- if (proc(i++) === false) return;
10191
- if (proc(i++) === false) return;
10192
- if (proc(i++) === false) return;
10193
- if (proc(i++) === false) return;
10525
+ switch (false) {
10526
+ case proc(i++):
10527
+ case proc(i++):
10528
+ case proc(i++):
10529
+ case proc(i++):
10530
+ case proc(i++):
10531
+ case proc(i++):
10532
+ case proc(i++):
10533
+ case proc(i++):
10534
+ return;
10535
+ }
10194
10536
  }
10195
10537
  } else {
10196
10538
  let i = -count,
10197
- m = i % 8,
10539
+ m = i & 7,
10198
10540
  d = (i - m) / 8;
10199
10541
 
10200
10542
  while (m--) {
@@ -10202,14 +10544,17 @@ function duffbk(count, proc) {
10202
10544
  }
10203
10545
 
10204
10546
  while (d--) {
10205
- if (proc(--i) === false) return;
10206
- if (proc(--i) === false) return;
10207
- if (proc(--i) === false) return;
10208
- if (proc(--i) === false) return;
10209
- if (proc(--i) === false) return;
10210
- if (proc(--i) === false) return;
10211
- if (proc(--i) === false) return;
10212
- if (proc(--i) === false) return;
10547
+ switch (false) {
10548
+ case proc(--i):
10549
+ case proc(--i):
10550
+ case proc(--i):
10551
+ case proc(--i):
10552
+ case proc(--i):
10553
+ case proc(--i):
10554
+ case proc(--i):
10555
+ case proc(--i):
10556
+ return;
10557
+ }
10213
10558
  }
10214
10559
  }
10215
10560
  }
@@ -10219,7 +10564,7 @@ exports.duffbk = duffbk;
10219
10564
  function duffEach(array, proc) {
10220
10565
  let count = array.length;
10221
10566
  let i = 0,
10222
- m = count % 8,
10567
+ m = count & 7,
10223
10568
  d = (count - m) / 8;
10224
10569
 
10225
10570
  while (m--) {
@@ -10238,30 +10583,32 @@ function duffEach(array, proc) {
10238
10583
  }
10239
10584
  }
10240
10585
 
10241
- exports.duffEach = duffEach;
10586
+ exports.duffEach = duffEach; // ベンチマークの10,000以上で急激な速度低下が見られるがNodeListなどでの
10587
+ // 実際の使用では速度低下は見られない
10242
10588
 
10243
10589
  function duffReduce(array, proc, initial) {
10244
10590
  let count = array.length;
10245
10591
  let i = 0,
10246
- m = count % 8,
10592
+ m = count & 7,
10247
10593
  d = (count - m) / 8;
10594
+ let acc = initial;
10248
10595
 
10249
10596
  while (m--) {
10250
- initial = proc(initial, array[i], i++, array);
10597
+ acc = proc(acc, array[i], i++, array);
10251
10598
  }
10252
10599
 
10253
10600
  while (d--) {
10254
- initial = proc(initial, array[i], i++, array);
10255
- initial = proc(initial, array[i], i++, array);
10256
- initial = proc(initial, array[i], i++, array);
10257
- initial = proc(initial, array[i], i++, array);
10258
- initial = proc(initial, array[i], i++, array);
10259
- initial = proc(initial, array[i], i++, array);
10260
- initial = proc(initial, array[i], i++, array);
10261
- initial = proc(initial, array[i], i++, array);
10601
+ acc = proc(acc, array[i], i++, array);
10602
+ acc = proc(acc, array[i], i++, array);
10603
+ acc = proc(acc, array[i], i++, array);
10604
+ acc = proc(acc, array[i], i++, array);
10605
+ acc = proc(acc, array[i], i++, array);
10606
+ acc = proc(acc, array[i], i++, array);
10607
+ acc = proc(acc, array[i], i++, array);
10608
+ acc = proc(acc, array[i], i++, array);
10262
10609
  }
10263
10610
 
10264
- return initial;
10611
+ return acc;
10265
10612
  }
10266
10613
 
10267
10614
  exports.duffReduce = duffReduce;
@@ -10269,11 +10616,11 @@ exports.duffReduce = duffReduce;
10269
10616
  /***/ }),
10270
10617
 
10271
10618
  /***/ 128:
10272
- /***/ ((module, __unused_webpack_exports, __nested_webpack_require_6113__) => {
10619
+ /***/ ((module, __unused_webpack_exports, __nested_webpack_require_3560__) => {
10273
10620
 
10274
10621
 
10275
10622
 
10276
- __nested_webpack_require_6113__(921);
10623
+ __nested_webpack_require_3560__(921);
10277
10624
 
10278
10625
  const global = void 0 || typeof globalThis !== 'undefined' && globalThis // @ts-ignore
10279
10626
  || typeof self !== 'undefined' && self || Function('return this')();
@@ -10299,7 +10646,7 @@ var global = (/* unused pure expression or super */ null && (0));
10299
10646
  /******/ var __webpack_module_cache__ = {};
10300
10647
  /******/
10301
10648
  /******/ // The require function
10302
- /******/ function __nested_webpack_require_6765__(moduleId) {
10649
+ /******/ function __nested_webpack_require_4212__(moduleId) {
10303
10650
  /******/ // Check if module is in cache
10304
10651
  /******/ var cachedModule = __webpack_module_cache__[moduleId];
10305
10652
  /******/ if (cachedModule !== undefined) {
@@ -10313,7 +10660,7 @@ var global = (/* unused pure expression or super */ null && (0));
10313
10660
  /******/ };
10314
10661
  /******/
10315
10662
  /******/ // Execute the module function
10316
- /******/ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_6765__);
10663
+ /******/ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_4212__);
10317
10664
  /******/
10318
10665
  /******/ // Return the exports of the module
10319
10666
  /******/ return module.exports;
@@ -10329,26 +10676,32 @@ var exports = __webpack_exports__;
10329
10676
  Object.defineProperty(exports, "__esModule", ({
10330
10677
  value: true
10331
10678
  }));
10332
- exports.querySelectorAll = exports.querySelector = void 0;
10679
+ exports.querySelectorAll = exports.querySelectorAllWith = exports.querySelectorWith = void 0;
10333
10680
 
10334
- const duff_1 = __nested_webpack_require_6765__(99);
10681
+ const global_1 = __nested_webpack_require_4212__(128);
10335
10682
 
10336
- const array_1 = __nested_webpack_require_6765__(112);
10683
+ const duff_1 = __nested_webpack_require_4212__(99);
10337
10684
 
10338
- function querySelector(node, selector) {
10685
+ function querySelectorWith(node, selector) {
10339
10686
  return 'matches' in node && node.matches(selector) ? node : node.querySelector(selector);
10340
10687
  }
10341
10688
 
10342
- exports.querySelector = querySelector;
10689
+ exports.querySelectorWith = querySelectorWith;
10343
10690
 
10344
- function querySelectorAll(node, selector) {
10691
+ function querySelectorAllWith(node, selector) {
10345
10692
  const acc = [];
10346
10693
 
10347
10694
  if ('matches' in node && node.matches(selector)) {
10348
10695
  acc.push(node);
10349
10696
  }
10350
10697
 
10351
- return (0, duff_1.duffReduce)(node.querySelectorAll(selector), (acc, node) => (0, array_1.push)(acc, [node]), acc);
10698
+ return (0, duff_1.duffReduce)(node.querySelectorAll(selector), (acc, el) => (acc.push(el), acc), acc);
10699
+ }
10700
+
10701
+ exports.querySelectorAllWith = querySelectorAllWith;
10702
+
10703
+ function querySelectorAll(node, selector) {
10704
+ return (0, duff_1.duffReduce)(node.querySelectorAll(selector), (acc, el) => (acc.push(el), acc), (0, global_1.Array)());
10352
10705
  }
10353
10706
 
10354
10707
  exports.querySelectorAll = querySelectorAll;