securemark 0.243.1 → 0.244.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /*! securemark v0.243.1 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED */
1
+ /*! securemark v0.244.1 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED */
2
2
  require = function () {
3
3
  function r(e, n, t) {
4
4
  function o(i, f) {
@@ -670,7 +670,7 @@ require = function () {
670
670
  ];
671
671
  for (let i = 0; i < count; ++i) {
672
672
  try {
673
- jobs[i]();
673
+ (void 0, jobs[i])();
674
674
  jobs[i] = void 0;
675
675
  } catch (reason) {
676
676
  (0, exception_1.causeAsyncException)(reason);
@@ -796,12 +796,13 @@ require = function () {
796
796
  'use strict';
797
797
  Object.defineProperty(exports, '__esModule', { value: true });
798
798
  exports.causeAsyncException = void 0;
799
+ const global_1 = _dereq_('./global');
799
800
  function causeAsyncException(reason) {
800
- void Promise.reject(reason);
801
+ global_1.Promise.reject(reason);
801
802
  }
802
803
  exports.causeAsyncException = causeAsyncException;
803
804
  },
804
- {}
805
+ { './global': 13 }
805
806
  ],
806
807
  13: [
807
808
  function (_dereq_, module, exports) {
@@ -1225,6 +1226,7 @@ require = function () {
1225
1226
  'use strict';
1226
1227
  Object.defineProperty(exports, '__esModule', { value: true });
1227
1228
  exports.isPrimitive = exports.isType = exports.type = void 0;
1229
+ const global_1 = _dereq_('./global');
1228
1230
  const alias_1 = _dereq_('./alias');
1229
1231
  const toString = Object.prototype.toString.call.bind(Object.prototype.toString);
1230
1232
  const ObjectPrototype = Object.prototype;
@@ -1236,8 +1238,10 @@ require = function () {
1236
1238
  return 'null';
1237
1239
  const type = typeof value;
1238
1240
  if (type === 'object') {
1241
+ if (value[global_1.Symbol.toStringTag])
1242
+ return value[global_1.Symbol.toStringTag];
1239
1243
  const proto = (0, alias_1.ObjectGetPrototypeOf)(value);
1240
- if (proto === ObjectPrototype || proto === null)
1244
+ if (proto === ObjectPrototype)
1241
1245
  return 'Object';
1242
1246
  if (proto === ArrayPrototype)
1243
1247
  return 'Array';
@@ -1262,7 +1266,10 @@ require = function () {
1262
1266
  }
1263
1267
  exports.isPrimitive = isPrimitive;
1264
1268
  },
1265
- { './alias': 5 }
1269
+ {
1270
+ './alias': 5,
1271
+ './global': 13
1272
+ }
1266
1273
  ],
1267
1274
  21: [
1268
1275
  function (_dereq_, module, exports) {
@@ -1589,6 +1596,7 @@ require = function () {
1589
1596
  }
1590
1597
  exports.define = define;
1591
1598
  function defineAttrs(el, attrs) {
1599
+ var _a, _b;
1592
1600
  for (const name in attrs) {
1593
1601
  if (!(0, alias_1.hasOwnProperty)(attrs, name))
1594
1602
  continue;
@@ -1602,9 +1610,10 @@ require = function () {
1602
1610
  throw new Error(`TypedDOM: Attribute names for event listeners must have an event name but got "${ name }".`);
1603
1611
  const names = name.split(/\s+/);
1604
1612
  for (const name of names) {
1605
- if (name.slice(0, 2) !== 'on')
1613
+ if (!name.startsWith('on'))
1606
1614
  throw new Error(`TypedDOM: Attribute names for event listeners must start with "on" but got "${ name }".`);
1607
- el.addEventListener(name.slice(2), value, {
1615
+ const eventname = name.slice(2).toLowerCase();
1616
+ el.addEventListener(eventname, value, {
1608
1617
  passive: [
1609
1618
  'wheel',
1610
1619
  'mousewheel',
@@ -1612,8 +1621,15 @@ require = function () {
1612
1621
  'touchmove',
1613
1622
  'touchend',
1614
1623
  'touchcancel'
1615
- ].includes(name.slice(2))
1624
+ ].includes(eventname)
1616
1625
  });
1626
+ switch (eventname) {
1627
+ case 'mutate':
1628
+ case 'connect':
1629
+ case 'disconnect':
1630
+ const prop = `on${ eventname }`;
1631
+ prop in el ? (_a = el[prop]) !== null && _a !== void 0 ? _a : el[prop] = ev => ev.returnValue : (_b = el[prop]) !== null && _b !== void 0 ? _b : el[prop] = '';
1632
+ }
1617
1633
  }
1618
1634
  continue;
1619
1635
  case 'object':
@@ -2067,24 +2083,37 @@ require = function () {
2067
2083
  return;
2068
2084
  let block = '';
2069
2085
  let closer = '';
2070
- for (let count = 1, next = (0, line_1.firstline)(rest);; ++count) {
2086
+ let overflow = '';
2087
+ for (let count = 1;; ++count) {
2071
2088
  if (rest === '')
2072
2089
  break;
2073
- const line = next;
2074
- next = (0, line_1.firstline)(rest.slice(line.length));
2075
- if (count > limit + 1 && (0, line_1.isEmpty)(line))
2076
- break;
2077
- if (count <= limit + 1 && line.slice(0, delim.length) === delim && line.trimEnd() === delim && (!separation || (0, line_1.isEmpty)(next))) {
2078
- closer = delim;
2079
- rest = rest.slice(line.length);
2090
+ const line = (0, line_1.firstline)(rest);
2091
+ if ((closer || count > limit + 1) && (0, line_1.isEmpty)(line))
2080
2092
  break;
2093
+ if (closer) {
2094
+ overflow += line;
2095
+ }
2096
+ if (!closer && count <= limit + 1 && line.slice(0, delim.length) === delim && line.trimEnd() === delim) {
2097
+ closer = line;
2098
+ if ((0, line_1.isEmpty)((0, line_1.firstline)(rest.slice(line.length)))) {
2099
+ rest = rest.slice(line.length);
2100
+ break;
2101
+ }
2102
+ if (!separation) {
2103
+ rest = rest.slice(line.length);
2104
+ break;
2105
+ }
2106
+ overflow = line;
2107
+ }
2108
+ if (!overflow) {
2109
+ block += line;
2081
2110
  }
2082
- block += line;
2083
2111
  rest = rest.slice(line.length);
2084
2112
  }
2085
2113
  return [
2086
2114
  (0, array_1.unshift)([
2087
2115
  block,
2116
+ overflow,
2088
2117
  closer
2089
2118
  ], matches),
2090
2119
  rest
@@ -2457,6 +2486,7 @@ require = function () {
2457
2486
  'use strict';
2458
2487
  Object.defineProperty(exports, '__esModule', { value: true });
2459
2488
  exports.check = exports.exec = exports.eval = exports.Delimiters = void 0;
2489
+ const global_1 = _dereq_('spica/global');
2460
2490
  class Delimiters {
2461
2491
  constructor() {
2462
2492
  this.matchers = [];
@@ -2465,7 +2495,7 @@ require = function () {
2465
2495
  push(delimiter) {
2466
2496
  const {signature, matcher, escape} = delimiter;
2467
2497
  if (this.record[signature] === !escape) {
2468
- this.matchers.unshift(() => undefined);
2498
+ this.matchers.unshift(() => global_1.undefined);
2469
2499
  } else {
2470
2500
  this.matchers.unshift(matcher);
2471
2501
  this.record[signature] = !escape;
@@ -2501,7 +2531,7 @@ require = function () {
2501
2531
  }
2502
2532
  exports.check = check;
2503
2533
  },
2504
- {}
2534
+ { 'spica/global': 13 }
2505
2535
  ],
2506
2536
  46: [
2507
2537
  function (_dereq_, module, exports) {
@@ -3403,7 +3433,7 @@ require = function () {
3403
3433
  const language = /^[0-9a-z]+(?:-[a-z][0-9a-z]*)*$/i;
3404
3434
  exports.segment = (0, combinator_1.block)((0, combinator_1.validate)('```', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 300))));
3405
3435
  exports.segment_ = (0, combinator_1.block)((0, combinator_1.validate)('```', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 300, false))), false);
3406
- exports.codeblock = (0, combinator_1.block)((0, combinator_1.validate)('```', (0, combinator_1.fmap)((0, combinator_1.fence)(opener, 300), ([body, closer, opener, delim, param], _, context) => {
3436
+ exports.codeblock = (0, combinator_1.block)((0, combinator_1.validate)('```', (0, combinator_1.fmap)((0, combinator_1.fence)(opener, 300), ([body, overflow, closer, opener, delim, param], _, context) => {
3407
3437
  var _a, _b, _c, _d, _e, _f;
3408
3438
  const params = (_b = (_a = param.match(/(?:\\.?|\S)+/g)) === null || _a === void 0 ? void 0 : _a.reduce((params, value, i) => {
3409
3439
  var _a, _b, _c;
@@ -3423,17 +3453,17 @@ require = function () {
3423
3453
  params.lang = file && file.includes('.', 1) ? (_c = (_b = file.split('.').pop()) === null || _b === void 0 ? void 0 : _b.match(language)) === null || _c === void 0 ? void 0 : _c[0].toLowerCase() : params.lang;
3424
3454
  }
3425
3455
  }
3426
- name in params ? params.invalid = `Duplicate ${ name } value` : params[name] = value;
3456
+ name in params ? params.invalid = `Duplicate ${ name } attribute` : params[name] = value;
3427
3457
  return params;
3428
3458
  }, {})) !== null && _b !== void 0 ? _b : {};
3429
- if (!closer || params.invalid)
3459
+ if (!closer || overflow || params.invalid)
3430
3460
  return [(0, dom_1.html)('pre', {
3431
3461
  class: 'invalid',
3432
3462
  translate: 'no',
3433
3463
  'data-invalid-syntax': 'codeblock',
3434
- 'data-invalid-type': !closer ? 'fence' : 'argument',
3435
- 'data-invalid-message': !closer ? `Missing the closing delimiter "${ delim }"` : params.invalid
3436
- }, `${ opener }${ body }${ closer }`)];
3464
+ 'data-invalid-type': !closer || overflow ? 'fence' : 'argument',
3465
+ 'data-invalid-message': !closer ? `Missing the closing delimiter "${ delim }"` : overflow ? `Invalid trailing line after the closing delimiter "${ delim }"` : params.invalid
3466
+ }, `${ opener }${ body }${ overflow || closer }`)];
3437
3467
  const el = (0, dom_1.html)('pre', {
3438
3468
  class: params.lang ? `code language-${ params.lang }` : 'text',
3439
3469
  translate: params.lang ? 'no' : global_1.undefined,
@@ -3554,16 +3584,16 @@ require = function () {
3554
3584
  const indexee_1 = _dereq_('../../inline/extension/indexee');
3555
3585
  const parse_1 = _dereq_('../../api/parse');
3556
3586
  const dom_1 = _dereq_('typed-dom/dom');
3557
- exports.aside = (0, combinator_1.creator)(100, (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.fmap)((0, combinator_1.fence)(/^(~{3,})aside(?!\S)([^\n]*)(?:$|\n)/, 300), ([body, closer, opener, delim, param], _, context) => {
3587
+ exports.aside = (0, combinator_1.creator)(100, (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.fmap)((0, combinator_1.fence)(/^(~{3,})aside(?!\S)([^\n]*)(?:$|\n)/, 300), ([body, overflow, closer, opener, delim, param], _, context) => {
3558
3588
  var _a;
3559
- if (!closer || param.trimStart())
3589
+ if (!closer || overflow || param.trimStart())
3560
3590
  return [(0, dom_1.html)('pre', {
3561
3591
  class: 'invalid',
3562
3592
  translate: 'no',
3563
3593
  'data-invalid-syntax': 'aside',
3564
- 'data-invalid-type': !closer ? 'fence' : 'argument',
3565
- 'data-invalid-message': !closer ? `Missing the closing delimiter "${ delim }"` : 'Invalid argument'
3566
- }, `${ opener }${ body }${ closer }`)];
3594
+ 'data-invalid-type': !closer || overflow ? 'fence' : 'argument',
3595
+ 'data-invalid-message': !closer ? `Missing the closing delimiter "${ delim }"` : overflow ? `Invalid trailing line after the closing delimiter "${ delim }"` : 'Invalid argument'
3596
+ }, `${ opener }${ body }${ overflow || closer }`)];
3567
3597
  const annotations = (0, dom_1.html)('ol', { class: 'annotations' });
3568
3598
  const references = (0, dom_1.html)('ol', { class: 'references' });
3569
3599
  const document = (0, parse_1.parse)(body.slice(0, -1), {
@@ -3610,15 +3640,15 @@ require = function () {
3610
3640
  const mathblock_1 = _dereq_('../mathblock');
3611
3641
  const dom_1 = _dereq_('typed-dom/dom');
3612
3642
  const opener = /^(~{3,})(?:example\/(\S+))?(?!\S)([^\n]*)(?:$|\n)/;
3613
- exports.example = (0, combinator_1.creator)(100, (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.fmap)((0, combinator_1.fence)(opener, 300), ([body, closer, opener, delim, type = 'markdown', param], _, context) => {
3614
- if (!closer || param.trimStart())
3643
+ exports.example = (0, combinator_1.creator)(100, (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.fmap)((0, combinator_1.fence)(opener, 300), ([body, overflow, closer, opener, delim, type = 'markdown', param], _, context) => {
3644
+ if (!closer || overflow || param.trimStart())
3615
3645
  return [(0, dom_1.html)('pre', {
3616
3646
  class: 'invalid',
3617
3647
  translate: 'no',
3618
3648
  'data-invalid-syntax': 'example',
3619
- 'data-invalid-type': !closer ? 'fence' : 'argument',
3620
- 'data-invalid-message': !closer ? `Missing the closing delimiter "${ delim }"` : 'Invalid argument'
3621
- }, `${ opener }${ body }${ closer }`)];
3649
+ 'data-invalid-type': !closer || overflow ? 'fence' : 'argument',
3650
+ 'data-invalid-message': !closer ? `Missing the closing delimiter "${ delim }"` : overflow ? `Invalid trailing line after the closing delimiter "${ delim }"` : 'Invalid argument'
3651
+ }, `${ opener }${ body }${ overflow || closer }`)];
3622
3652
  switch (type) {
3623
3653
  case 'markdown': {
3624
3654
  const annotations = (0, dom_1.html)('ol', { class: 'annotations' });
@@ -3657,6 +3687,7 @@ require = function () {
3657
3687
  class: 'invalid',
3658
3688
  translate: 'no',
3659
3689
  'data-invalid-syntax': 'example',
3690
+ 'data-invalid-type': 'type',
3660
3691
  'data-invalid-message': 'Invalid example type'
3661
3692
  }, `${ opener }${ body }${ closer }`)];
3662
3693
  }
@@ -3782,7 +3813,7 @@ require = function () {
3782
3813
  ])
3783
3814
  ])
3784
3815
  ]), closer), ([, fence]) => fence.length, [])));
3785
- exports.figure = (0, combinator_1.block)((0, combinator_1.fallback)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.fallback)((0, combinator_1.fmap)((0, combinator_1.convert)(source => source.slice(source.match(/^~+(?:figure[^\S\n]+)?/)[0].length, source.trimEnd().lastIndexOf('\n')), (0, combinator_1.sequence)([
3816
+ exports.figure = (0, combinator_1.block)((0, combinator_1.fallback)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.fmap)((0, combinator_1.convert)(source => source.slice(source.match(/^~+(?:figure[^\S\n]+)?/)[0].length, source.trimEnd().lastIndexOf('\n')), (0, combinator_1.sequence)([
3786
3817
  (0, combinator_1.line)((0, combinator_1.sequence)([
3787
3818
  label_1.label,
3788
3819
  (0, source_1.str)(/^(?=\s).*\n/)
@@ -3808,27 +3839,7 @@ require = function () {
3808
3839
  ])), ([label, param, content, ...caption]) => [(0, dom_1.html)('figure', attributes(label.getAttribute('data-label'), param, content, caption), [
3809
3840
  (0, dom_1.html)('figcaption', (0, array_1.unshift)([(0, dom_1.html)('span', { class: 'figindex' })], (0, dom_1.defrag)(caption))),
3810
3841
  (0, dom_1.html)('div', [content])
3811
- ])]), (source, context) => {
3812
- var _a, _b;
3813
- return [
3814
- [(0, dom_1.html)('pre', {
3815
- class: 'invalid',
3816
- translate: 'no',
3817
- 'data-invalid-syntax': 'figure',
3818
- ...!(0, label_1.segment)((_b = (_a = source.match(/^~+(?:figure[^\S\n]+)?(\[?\$\S+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '', context) && {
3819
- 'data-invalid-type': 'label',
3820
- 'data-invalid-message': 'Invalid label'
3821
- } || /^~+(?:figure[^\S\n]+)?(\[?\$\S+)[^\S\n]+\S/.test(source) && {
3822
- 'data-invalid-type': 'argument',
3823
- 'data-invalid-message': 'Invalid argument'
3824
- } || {
3825
- 'data-invalid-type': 'content',
3826
- 'data-invalid-message': 'Invalid content'
3827
- }
3828
- }, source)],
3829
- ''
3830
- ];
3831
- })), (0, combinator_1.fmap)((0, combinator_1.fence)(/^(~{3,})(?:figure|\[?\$\S*)(?!\S)[^\n]*(?:$|\n)/, 300), ([body, closer, opener, delim], _, context) => {
3842
+ ])])), (0, combinator_1.fmap)((0, combinator_1.fence)(/^(~{3,})(?:figure|\[?\$\S*)(?!\S)[^\n]*(?:$|\n)/, 300), ([body, overflow, closer, opener, delim], _, context) => {
3832
3843
  var _a, _b;
3833
3844
  return [(0, dom_1.html)('pre', {
3834
3845
  class: 'invalid',
@@ -3837,6 +3848,9 @@ require = function () {
3837
3848
  ...!closer && {
3838
3849
  'data-invalid-type': 'fence',
3839
3850
  'data-invalid-message': `Missing the closing delimiter "${ delim }"`
3851
+ } || overflow && {
3852
+ 'data-invalid-type': 'fence',
3853
+ 'data-invalid-message': `Invalid trailing line after the closing delimiter "${ delim }"`
3840
3854
  } || !(0, label_1.segment)((_b = (_a = opener.match(/^~+(?:figure[^\S\n]+)?(\[?\$\S+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '', context) && {
3841
3855
  'data-invalid-type': 'label',
3842
3856
  'data-invalid-message': 'Invalid label'
@@ -3847,7 +3861,7 @@ require = function () {
3847
3861
  'data-invalid-type': 'content',
3848
3862
  'data-invalid-message': 'Invalid content'
3849
3863
  }
3850
- }, `${ opener }${ body }${ closer }`)];
3864
+ }, `${ opener }${ body }${ overflow || closer }`)];
3851
3865
  })));
3852
3866
  function attributes(label, param, content, caption) {
3853
3867
  const group = label.split('-', 1)[0];
@@ -3965,15 +3979,15 @@ require = function () {
3965
3979
  const paragraph_1 = _dereq_('../paragraph');
3966
3980
  const dom_1 = _dereq_('typed-dom/dom');
3967
3981
  const array_1 = _dereq_('spica/array');
3968
- exports.message = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.fmap)((0, combinator_1.fence)(/^(~{3,})message\/(\S+)([^\n]*)(?:$|\n)/, 300), ([body, closer, opener, delim, type, param], _, context) => {
3969
- if (!closer || param.trimStart())
3982
+ exports.message = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.fmap)((0, combinator_1.fence)(/^(~{3,})message\/(\S+)([^\n]*)(?:$|\n)/, 300), ([body, overflow, closer, opener, delim, type, param], _, context) => {
3983
+ if (!closer || overflow || param.trimStart())
3970
3984
  return [(0, dom_1.html)('pre', {
3971
3985
  class: 'invalid',
3972
3986
  translate: 'no',
3973
3987
  'data-invalid-syntax': 'message',
3974
- 'data-invalid-type': !closer ? 'fence' : 'argument',
3975
- 'data-invalid-message': !closer ? `Missing the closing delimiter "${ delim }"` : 'Invalid argument'
3976
- }, `${ opener }${ body }${ closer }`)];
3988
+ 'data-invalid-type': !closer || overflow ? 'fence' : 'argument',
3989
+ 'data-invalid-message': !closer ? `Missing the closing delimiter "${ delim }"` : overflow ? `Invalid trailing line after the closing delimiter "${ delim }"` : 'Invalid argument'
3990
+ }, `${ opener }${ body }${ overflow || closer }`)];
3977
3991
  switch (type) {
3978
3992
  case 'note':
3979
3993
  case 'caution':
@@ -3984,6 +3998,7 @@ require = function () {
3984
3998
  class: 'invalid',
3985
3999
  translate: 'no',
3986
4000
  'data-invalid-syntax': 'message',
4001
+ 'data-invalid-type': 'type',
3987
4002
  'data-invalid-message': 'Invalid message type'
3988
4003
  }, `${ opener }${ body }${ closer }`)];
3989
4004
  }
@@ -4045,13 +4060,11 @@ require = function () {
4045
4060
  const opener = /^(~{3,})(?!~)[^\n]*(?:$|\n)/;
4046
4061
  exports.segment = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 300))));
4047
4062
  exports.segment_ = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 300, false))), false);
4048
- exports.placeholder = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.fmap)((0, combinator_1.fence)(opener, Infinity), ([body, closer, opener, delim]) => [(0, dom_1.html)('pre', {
4063
+ exports.placeholder = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.fmap)((0, combinator_1.fence)(opener, Infinity), ([body, overflow, closer, opener, delim]) => [(0, dom_1.html)('pre', {
4049
4064
  class: 'invalid',
4050
4065
  translate: 'no',
4051
- 'data-invalid-syntax': 'extension',
4052
- 'data-invalid-type': !closer ? 'fence' : 'syntax',
4053
- 'data-invalid-message': !closer ? `Missing the closing delimiter "${ delim }"` : 'Invalid extension name'
4054
- }, `${ opener }${ body }${ closer }`)])));
4066
+ 'data-invalid-message': !closer ? `Missing the closing delimiter "${ delim }"` : overflow ? `Invalid trailing line after the closing delimiter "${ delim }"` : 'Invalid argument'
4067
+ }, `${ opener }${ body }${ overflow || closer }`)])));
4055
4068
  },
4056
4069
  {
4057
4070
  '../../../combinator': 25,
@@ -4076,16 +4089,16 @@ require = function () {
4076
4089
  const opener = /^(~{3,})table(?!\S)([^\n]*)(?:$|\n)/;
4077
4090
  exports.segment = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 10000))));
4078
4091
  exports.segment_ = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 10000, false))), false);
4079
- exports.table = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.recover)((0, combinator_1.fmap)((0, combinator_1.fence)(opener, 10000), ([body, closer, opener, delim, param], _, context) => {
4092
+ exports.table = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.recover)((0, combinator_1.fmap)((0, combinator_1.fence)(opener, 10000), ([body, overflow, closer, opener, delim, param], _, context) => {
4080
4093
  var _a;
4081
- if (!closer || param.trimStart())
4094
+ if (!closer || overflow || param.trimStart())
4082
4095
  return [(0, dom_1.html)('pre', {
4083
4096
  class: 'invalid',
4084
4097
  translate: 'no',
4085
4098
  'data-invalid-syntax': 'table',
4086
- 'data-invalid-type': !closer ? 'fence' : 'argument',
4087
- 'data-invalid-message': !closer ? `Missing the closing delimiter "${ delim }"` : 'Invalid argument'
4088
- }, `${ opener }${ body }${ closer }`)];
4099
+ 'data-invalid-type': !closer || overflow ? 'fence' : 'argument',
4100
+ 'data-invalid-message': !closer ? `Missing the closing delimiter "${ delim }"` : overflow ? `Invalid trailing line after the closing delimiter "${ delim }"` : 'Invalid argument'
4101
+ }, `${ opener }${ body }${ overflow || closer }`)];
4089
4102
  return (_a = (0, parser_1.eval)(parser(body, context))) !== null && _a !== void 0 ? _a : [(0, dom_1.html)('table')];
4090
4103
  }), (source, _, reason) => reason instanceof Error && reason.message === 'Number of columns must be 32 or less' ? [
4091
4104
  [(0, dom_1.html)('pre', {
@@ -4457,24 +4470,24 @@ require = function () {
4457
4470
  const combinator_1 = _dereq_('../../combinator');
4458
4471
  const dom_1 = _dereq_('typed-dom/dom');
4459
4472
  const opener = /^(\${2,})(?!\$)([^\n]*)(?:$|\n)/;
4460
- exports.segment = (0, combinator_1.block)((0, combinator_1.validate)('$$', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 100))));
4461
- exports.segment_ = (0, combinator_1.block)((0, combinator_1.validate)('$$', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 100, false))), false);
4462
- exports.mathblock = (0, combinator_1.block)((0, combinator_1.validate)('$$', (0, combinator_1.fmap)((0, combinator_1.fence)(opener, 100), ([body, closer, opener, delim, param], _, {
4473
+ exports.segment = (0, combinator_1.block)((0, combinator_1.validate)('$$', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 300))));
4474
+ exports.segment_ = (0, combinator_1.block)((0, combinator_1.validate)('$$', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 300, false))), false);
4475
+ exports.mathblock = (0, combinator_1.block)((0, combinator_1.validate)('$$', (0, combinator_1.fmap)((0, combinator_1.fence)(opener, 300), ([body, overflow, closer, opener, delim, param], _, {
4463
4476
  caches: {
4464
4477
  math: cache = global_1.undefined
4465
4478
  } = {}
4466
4479
  }) => {
4467
4480
  var _a;
4468
- return [delim.length === 2 && closer && param.trimStart() === '' ? ((_a = cache === null || cache === void 0 ? void 0 : cache.get(`${ delim }\n${ body }${ delim }`)) === null || _a === void 0 ? void 0 : _a.cloneNode(true)) || (0, dom_1.html)('div', {
4481
+ return [delim.length === 2 && closer && !overflow && param.trimStart() === '' ? ((_a = cache === null || cache === void 0 ? void 0 : cache.get(`${ delim }\n${ body }${ delim }`)) === null || _a === void 0 ? void 0 : _a.cloneNode(true)) || (0, dom_1.html)('div', {
4469
4482
  class: 'math',
4470
4483
  translate: 'no'
4471
4484
  }, `${ delim }\n${ body }${ delim }`) : (0, dom_1.html)('pre', {
4472
4485
  class: 'invalid',
4473
4486
  translate: 'no',
4474
4487
  'data-invalid-syntax': 'mathblock',
4475
- 'data-invalid-type': delim.length > 2 ? 'syntax' : !closer ? 'fence' : 'argument',
4476
- 'data-invalid-message': delim.length > 2 ? 'Invalid syntax' : !closer ? `Missing the closing delimiter "${ delim }"` : 'Invalid argument'
4477
- }, `${ opener }${ body }${ closer }`)];
4488
+ 'data-invalid-type': delim.length > 2 ? 'syntax' : !closer || overflow ? 'fence' : 'argument',
4489
+ 'data-invalid-message': delim.length > 2 ? 'Invalid syntax' : !closer ? `Missing the closing delimiter "${ delim }"` : overflow ? `Invalid trailing line after the closing delimiter "${ delim }"` : 'Invalid argument'
4490
+ }, `${ opener }${ body }${ overflow || closer }`)];
4478
4491
  })));
4479
4492
  },
4480
4493
  {
@@ -5429,7 +5442,7 @@ require = function () {
5429
5442
  const source_1 = _dereq_('../source');
5430
5443
  const dom_1 = _dereq_('typed-dom/dom');
5431
5444
  const array_1 = _dereq_('spica/array');
5432
- const index = /^(?:[0-9]+(?:(?:[.-]|, )[0-9]+)*|[A-Za-z])/;
5445
+ const index = /^[0-9A-Za-z]+(?:(?:[.-]|, )[0-9A-Za-z]+)*/;
5433
5446
  exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.union)([
5434
5447
  (0, combinator_1.surround)((0, source_1.str)('('), (0, source_1.str)(index), (0, source_1.str)(')')),
5435
5448
  (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)(inline_1.inline, ')'), (0, source_1.str)(')'), true, ([as, bs = [], cs], rest) => [
@@ -5991,7 +6004,8 @@ require = function () {
5991
6004
  const memoize_1 = _dereq_('spica/memoize');
5992
6005
  const cache_1 = _dereq_('spica/cache');
5993
6006
  const array_1 = _dereq_('spica/array');
5994
- const tags = (0, alias_1.ObjectFreeze)([
6007
+ const tags = Object.freeze([
6008
+ 'wbr',
5995
6009
  'sup',
5996
6010
  'sub',
5997
6011
  'small',
@@ -6000,19 +6014,19 @@ require = function () {
6000
6014
  ]);
6001
6015
  const attrspec = {
6002
6016
  bdo: {
6003
- dir: (0, alias_1.ObjectFreeze)([
6017
+ dir: Object.freeze([
6004
6018
  'ltr',
6005
6019
  'rtl'
6006
6020
  ])
6007
6021
  }
6008
6022
  };
6009
- (0, alias_1.ObjectSetPrototypeOf)(attrspec, null);
6010
- (0, alias_1.ObjectValues)(attrspec).forEach(o => (0, alias_1.ObjectSetPrototypeOf)(o, null));
6023
+ Object.setPrototypeOf(attrspec, null);
6024
+ Object.values(attrspec).forEach(o => Object.setPrototypeOf(o, null));
6011
6025
  exports.html = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.validate)('<', (0, combinator_1.validate)(/^<[a-z]+(?=[^\S\n]|>)/, (0, combinator_1.union)([
6012
6026
  (0, combinator_1.match)(/^(?=<(wbr)(?=[^\S\n]|>))/, (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.surround)(`<${ tag }`, (0, combinator_1.some)((0, combinator_1.union)([exports.attribute])), /^\s*>/, true, ([, bs = []], rest) => [
6013
6027
  [(0, dom_1.html)(tag, attributes('html', [], attrspec[tag], bs))],
6014
6028
  rest
6015
- ]), ([, tag]) => tag)),
6029
+ ]), ([, tag]) => tags.indexOf(tag), [])),
6016
6030
  (0, combinator_1.match)(/^(?=<(sup|sub|small)(?=[^\S\n]|>))/, (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.validate)(`<${ tag }`, `</${ tag }>`, (0, combinator_1.surround)((0, combinator_1.surround)((0, source_1.str)(`<${ tag }`), (0, combinator_1.some)(exports.attribute), (0, source_1.str)(/^\s*>/), true), (0, util_1.startLoose)((0, combinator_1.context)((() => {
6017
6031
  switch (tag) {
6018
6032
  case 'sup':
@@ -6041,27 +6055,27 @@ require = function () {
6041
6055
  ]), `</${ tag }>`)), `</${ tag }>`), (0, source_1.str)(`</${ tag }>`), false, ([as, bs, cs], rest, context) => [
6042
6056
  [elem(tag, as, (0, dom_1.defrag)(bs), cs, context)],
6043
6057
  rest
6044
- ])), ([, tag]) => tag)),
6058
+ ])), ([, tag]) => tags.indexOf(tag), [])),
6045
6059
  (0, combinator_1.match)(/^(?=<(bdo|bdi)(?=[^\S\n]|>))/, (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.validate)(`<${ tag }`, `</${ tag }>`, (0, combinator_1.surround)((0, combinator_1.surround)((0, source_1.str)(`<${ tag }`), (0, combinator_1.some)(exports.attribute), (0, source_1.str)(/^\s*>/), true), (0, util_1.startLoose)((0, combinator_1.some)((0, combinator_1.union)([
6046
6060
  (0, combinator_1.some)(inline_1.inline, (0, util_1.blank)(/\n?/, `</${ tag }>`)),
6047
6061
  (0, combinator_1.open)(/^\n?/, (0, combinator_1.some)(inline_1.inline, '</'), true)
6048
- ]), `</${ tag }>`), `</${ tag }>`), (0, source_1.str)(`</${ tag }>`), false, ([as, bs, cs], rest) => [
6049
- [elem(tag, as, (0, dom_1.defrag)(bs), cs, {})],
6062
+ ]), `</${ tag }>`), `</${ tag }>`), (0, source_1.str)(`</${ tag }>`), false, ([as, bs, cs], rest, context) => [
6063
+ [elem(tag, as, (0, dom_1.defrag)(bs), cs, context)],
6050
6064
  rest
6051
6065
  ], ([as, bs], rest) => as.length === 1 ? [
6052
6066
  (0, array_1.unshift)(as, bs),
6053
6067
  rest
6054
- ] : global_1.undefined)), ([, tag]) => tag)),
6068
+ ] : global_1.undefined)), ([, tag]) => tags.indexOf(tag), [])),
6055
6069
  (0, combinator_1.match)(/^(?=<([a-z]+)(?=[^\S\n]|>))/, (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.validate)(`<${ tag }`, `</${ tag }>`, (0, combinator_1.surround)((0, combinator_1.surround)((0, source_1.str)(`<${ tag }`), (0, combinator_1.some)(exports.attribute), (0, source_1.str)(/^\s*>/), true), (0, util_1.startLoose)((0, combinator_1.some)((0, combinator_1.union)([
6056
6070
  (0, combinator_1.some)(inline_1.inline, (0, util_1.blank)(/\n?/, `</${ tag }>`)),
6057
6071
  (0, combinator_1.open)(/^\n?/, (0, combinator_1.some)(inline_1.inline, '</'), true)
6058
- ]), `</${ tag }>`), `</${ tag }>`), (0, source_1.str)(`</${ tag }>`), false, ([as, bs, cs], rest) => [
6059
- [elem(tag, as, (0, dom_1.defrag)(bs), cs, {})],
6072
+ ]), `</${ tag }>`), `</${ tag }>`), (0, source_1.str)(`</${ tag }>`), false, ([as, bs, cs], rest, context) => [
6073
+ [elem(tag, as, (0, dom_1.defrag)(bs), cs, context)],
6060
6074
  rest
6061
6075
  ], ([as, bs], rest) => as.length === 1 ? [
6062
6076
  (0, array_1.unshift)(as, bs),
6063
6077
  rest
6064
- ] : global_1.undefined)), ([, tag]) => tag, new cache_1.Cache(1000)))
6078
+ ] : global_1.undefined)), ([, tag]) => tag, new cache_1.Cache(10000)))
6065
6079
  ])))));
6066
6080
  exports.attribute = (0, combinator_1.union)([(0, source_1.str)(/^[^\S\n]+[a-z]+(?:-[a-z]+)*(?:="(?:\\[^\n]|[^\\\n"])*")?(?=[^\S\n]|>)/)]);
6067
6081
  function elem(tag, as, bs, cs, context) {
@@ -6084,9 +6098,9 @@ require = function () {
6084
6098
  }
6085
6099
  break;
6086
6100
  }
6087
- let attrs;
6101
+ const attrs = attributes('html', [], attrspec[tag], as.slice(1, -1));
6088
6102
  switch (true) {
6089
- case 'data-invalid-syntax' in (attrs = attributes('html', [], attrspec[tag], as.slice(1, -1))):
6103
+ case 'data-invalid-syntax' in attrs:
6090
6104
  return invalid('attribute', 'Invalid HTML attribute', as, bs, cs);
6091
6105
  default:
6092
6106
  return (0, dom_1.html)(tag, attrs, bs);
@@ -6117,8 +6131,7 @@ require = function () {
6117
6131
  }
6118
6132
  invalid || (invalid = !!spec && !requiredAttributes(spec).every(name => name in attrs));
6119
6133
  if (invalid) {
6120
- !classes.includes('invalid') && classes.push('invalid');
6121
- attrs['class'] = (0, array_1.join)(classes, ' ');
6134
+ attrs['class'] = (0, array_1.join)(classes.includes('invalid') ? classes : (0, array_1.unshift)(classes, ['invalid']), ' ');
6122
6135
  attrs['data-invalid-syntax'] = syntax;
6123
6136
  attrs['data-invalid-type'] = 'argument';
6124
6137
  attrs['data-invalid-message'] = 'Invalid argument';
@@ -6214,7 +6227,6 @@ require = function () {
6214
6227
  Object.defineProperty(exports, '__esModule', { value: true });
6215
6228
  exports.resolve = exports.option = exports.uri = exports.link = void 0;
6216
6229
  const global_1 = _dereq_('spica/global');
6217
- const alias_1 = _dereq_('spica/alias');
6218
6230
  const parser_1 = _dereq_('../../combinator/data/parser');
6219
6231
  const combinator_1 = _dereq_('../../combinator');
6220
6232
  const inline_1 = _dereq_('../inline');
@@ -6225,7 +6237,7 @@ require = function () {
6225
6237
  const dom_1 = _dereq_('typed-dom/dom');
6226
6238
  const url_1 = _dereq_('spica/url');
6227
6239
  const optspec = { rel: ['nofollow'] };
6228
- (0, alias_1.ObjectSetPrototypeOf)(optspec, null);
6240
+ Object.setPrototypeOf(optspec, null);
6229
6241
  exports.link = (0, combinator_1.lazy)(() => (0, combinator_1.creator)(10, (0, combinator_1.validate)([
6230
6242
  '[',
6231
6243
  '{'
@@ -6305,7 +6317,7 @@ require = function () {
6305
6317
  }
6306
6318
  return (0, dom_1.html)('a', {
6307
6319
  href: uri.source,
6308
- target: undefined || uri.origin !== origin || typeof content[0] === 'object' && content[0].classList.contains('media') ? '_blank' : undefined
6320
+ target: global_1.undefined || uri.origin !== origin || typeof content[0] === 'object' && content[0].classList.contains('media') ? '_blank' : global_1.undefined
6309
6321
  }, content.length === 0 ? decode(INSECURE_URI) : content);
6310
6322
  case 'tel:':
6311
6323
  if (content.length === 0) {
@@ -6345,7 +6357,6 @@ require = function () {
6345
6357
  '../source': 128,
6346
6358
  '../util': 134,
6347
6359
  './html': 111,
6348
- 'spica/alias': 5,
6349
6360
  'spica/global': 13,
6350
6361
  'spica/url': 21,
6351
6362
  'typed-dom/dom': 23
@@ -6430,7 +6441,6 @@ require = function () {
6430
6441
  Object.defineProperty(exports, '__esModule', { value: true });
6431
6442
  exports.media = void 0;
6432
6443
  const global_1 = _dereq_('spica/global');
6433
- const alias_1 = _dereq_('spica/alias');
6434
6444
  const combinator_1 = _dereq_('../../combinator');
6435
6445
  const link_1 = _dereq_('./link');
6436
6446
  const html_1 = _dereq_('./html');
@@ -6445,7 +6455,7 @@ require = function () {
6445
6455
  'aspect-ratio': [],
6446
6456
  rel: global_1.undefined
6447
6457
  };
6448
- (0, alias_1.ObjectSetPrototypeOf)(optspec, null);
6458
+ Object.setPrototypeOf(optspec, null);
6449
6459
  exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.creator)(10, (0, combinator_1.validate)([
6450
6460
  '![',
6451
6461
  '!{'
@@ -6573,7 +6583,6 @@ require = function () {
6573
6583
  './html': 111,
6574
6584
  './htmlentity': 112,
6575
6585
  './link': 114,
6576
- 'spica/alias': 5,
6577
6586
  'spica/array': 6,
6578
6587
  'spica/global': 13,
6579
6588
  'spica/url': 21,
@@ -8060,8 +8069,8 @@ require = function () {
8060
8069
  'use strict';
8061
8070
  Object.defineProperty(exports, '__esModule', { value: true });
8062
8071
  exports.image = void 0;
8063
- const dom_1 = _dereq_('typed-dom/dom');
8064
8072
  const alias_1 = _dereq_('spica/alias');
8073
+ const dom_1 = _dereq_('typed-dom/dom');
8065
8074
  function image(source, url, cache) {
8066
8075
  if (cache === null || cache === void 0 ? void 0 : cache.has(url.href))
8067
8076
  return (0, dom_1.define)(cache.get(url.href).cloneNode(true), (0, alias_1.ObjectFromEntries)([...source.attributes].map(attr => [
@@ -8181,8 +8190,8 @@ require = function () {
8181
8190
  'use strict';
8182
8191
  Object.defineProperty(exports, '__esModule', { value: true });
8183
8192
  exports.video = void 0;
8184
- const dom_1 = _dereq_('typed-dom/dom');
8185
8193
  const alias_1 = _dereq_('spica/alias');
8194
+ const dom_1 = _dereq_('typed-dom/dom');
8186
8195
  const extensions = [
8187
8196
  '.webm',
8188
8197
  '.ogv'
@@ -8213,6 +8222,7 @@ require = function () {
8213
8222
  'use strict';
8214
8223
  Object.defineProperty(exports, '__esModule', { value: true });
8215
8224
  exports.youtube = void 0;
8225
+ const global_1 = _dereq_('spica/global');
8216
8226
  const dom_1 = _dereq_('typed-dom/dom');
8217
8227
  function youtube(source, url) {
8218
8228
  const id = resolve(url);
@@ -8232,15 +8242,18 @@ require = function () {
8232
8242
  var _a;
8233
8243
  switch (url.origin) {
8234
8244
  case 'https://www.youtube.com':
8235
- return url.pathname.match(/^\/watch\/?$/) ? (_a = url.searchParams.get('v')) === null || _a === void 0 ? void 0 : _a.concat(url.search.replace(/([?&])v=[^&#]*&?/g, '$1'), url.hash) : undefined;
8245
+ return url.pathname.match(/^\/watch\/?$/) ? (_a = url.searchParams.get('v')) === null || _a === void 0 ? void 0 : _a.concat(url.search.replace(/([?&])v=[^&#]*&?/g, '$1'), url.hash) : global_1.undefined;
8236
8246
  case 'https://youtu.be':
8237
- return url.pathname.match(/^\/[\w-]+\/?$/) ? url.href.slice(url.origin.length) : undefined;
8247
+ return url.pathname.match(/^\/[\w-]+\/?$/) ? url.href.slice(url.origin.length) : global_1.undefined;
8238
8248
  default:
8239
8249
  return;
8240
8250
  }
8241
8251
  }
8242
8252
  },
8243
- { 'typed-dom/dom': 23 }
8253
+ {
8254
+ 'spica/global': 13,
8255
+ 'typed-dom/dom': 23
8256
+ }
8244
8257
  ],
8245
8258
  146: [
8246
8259
  function (_dereq_, module, exports) {