@abi-software/map-side-bar 1.3.30 → 1.3.31

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.
@@ -166,13 +166,6 @@ module.exports = require("core-js/modules/web.dom-collections.iterator");
166
166
 
167
167
  /***/ }),
168
168
 
169
- /***/ "1d61":
170
- /***/ (function(module, exports) {
171
-
172
- module.exports = require("marked");
173
-
174
- /***/ }),
175
-
176
169
  /***/ "2175":
177
170
  /***/ (function(module, exports) {
178
171
 
@@ -431,6 +424,3082 @@ module.exports = require("core-js/modules/es.number.constructor");
431
424
 
432
425
  module.exports = require("regenerator-runtime/runtime");
433
426
 
427
+ /***/ }),
428
+
429
+ /***/ "7c5c":
430
+ /***/ (function(module, exports, __webpack_require__) {
431
+
432
+ /**
433
+ * marked - a markdown parser
434
+ * Copyright (c) 2011-2022, Christopher Jeffrey. (MIT Licensed)
435
+ * https://github.com/markedjs/marked
436
+ */
437
+
438
+ /**
439
+ * DO NOT EDIT THIS FILE
440
+ * The code in this file is generated from files in ./src/
441
+ */
442
+
443
+ (function (global, factory) {
444
+ true ? factory(exports) :
445
+ undefined;
446
+ })(this, (function (exports) { 'use strict';
447
+
448
+ function _defineProperties(target, props) {
449
+ for (var i = 0; i < props.length; i++) {
450
+ var descriptor = props[i];
451
+ descriptor.enumerable = descriptor.enumerable || false;
452
+ descriptor.configurable = true;
453
+ if ("value" in descriptor) descriptor.writable = true;
454
+ Object.defineProperty(target, descriptor.key, descriptor);
455
+ }
456
+ }
457
+
458
+ function _createClass(Constructor, protoProps, staticProps) {
459
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
460
+ if (staticProps) _defineProperties(Constructor, staticProps);
461
+ Object.defineProperty(Constructor, "prototype", {
462
+ writable: false
463
+ });
464
+ return Constructor;
465
+ }
466
+
467
+ function _unsupportedIterableToArray(o, minLen) {
468
+ if (!o) return;
469
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
470
+ var n = Object.prototype.toString.call(o).slice(8, -1);
471
+ if (n === "Object" && o.constructor) n = o.constructor.name;
472
+ if (n === "Map" || n === "Set") return Array.from(o);
473
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
474
+ }
475
+
476
+ function _arrayLikeToArray(arr, len) {
477
+ if (len == null || len > arr.length) len = arr.length;
478
+
479
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
480
+
481
+ return arr2;
482
+ }
483
+
484
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
485
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
486
+ if (it) return (it = it.call(o)).next.bind(it);
487
+
488
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
489
+ if (it) o = it;
490
+ var i = 0;
491
+ return function () {
492
+ if (i >= o.length) return {
493
+ done: true
494
+ };
495
+ return {
496
+ done: false,
497
+ value: o[i++]
498
+ };
499
+ };
500
+ }
501
+
502
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
503
+ }
504
+
505
+ function getDefaults() {
506
+ return {
507
+ async: false,
508
+ baseUrl: null,
509
+ breaks: false,
510
+ extensions: null,
511
+ gfm: true,
512
+ headerIds: true,
513
+ headerPrefix: '',
514
+ highlight: null,
515
+ langPrefix: 'language-',
516
+ mangle: true,
517
+ pedantic: false,
518
+ renderer: null,
519
+ sanitize: false,
520
+ sanitizer: null,
521
+ silent: false,
522
+ smartypants: false,
523
+ tokenizer: null,
524
+ walkTokens: null,
525
+ xhtml: false
526
+ };
527
+ }
528
+ exports.defaults = getDefaults();
529
+ function changeDefaults(newDefaults) {
530
+ exports.defaults = newDefaults;
531
+ }
532
+
533
+ /**
534
+ * Helpers
535
+ */
536
+ var escapeTest = /[&<>"']/;
537
+ var escapeReplace = /[&<>"']/g;
538
+ var escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/;
539
+ var escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g;
540
+ var escapeReplacements = {
541
+ '&': '&amp;',
542
+ '<': '&lt;',
543
+ '>': '&gt;',
544
+ '"': '&quot;',
545
+ "'": '&#39;'
546
+ };
547
+
548
+ var getEscapeReplacement = function getEscapeReplacement(ch) {
549
+ return escapeReplacements[ch];
550
+ };
551
+
552
+ function escape(html, encode) {
553
+ if (encode) {
554
+ if (escapeTest.test(html)) {
555
+ return html.replace(escapeReplace, getEscapeReplacement);
556
+ }
557
+ } else {
558
+ if (escapeTestNoEncode.test(html)) {
559
+ return html.replace(escapeReplaceNoEncode, getEscapeReplacement);
560
+ }
561
+ }
562
+
563
+ return html;
564
+ }
565
+ var unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
566
+ /**
567
+ * @param {string} html
568
+ */
569
+
570
+ function unescape(html) {
571
+ // explicitly match decimal, hex, and named HTML entities
572
+ return html.replace(unescapeTest, function (_, n) {
573
+ n = n.toLowerCase();
574
+ if (n === 'colon') return ':';
575
+
576
+ if (n.charAt(0) === '#') {
577
+ return n.charAt(1) === 'x' ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1));
578
+ }
579
+
580
+ return '';
581
+ });
582
+ }
583
+ var caret = /(^|[^\[])\^/g;
584
+ /**
585
+ * @param {string | RegExp} regex
586
+ * @param {string} opt
587
+ */
588
+
589
+ function edit(regex, opt) {
590
+ regex = typeof regex === 'string' ? regex : regex.source;
591
+ opt = opt || '';
592
+ var obj = {
593
+ replace: function replace(name, val) {
594
+ val = val.source || val;
595
+ val = val.replace(caret, '$1');
596
+ regex = regex.replace(name, val);
597
+ return obj;
598
+ },
599
+ getRegex: function getRegex() {
600
+ return new RegExp(regex, opt);
601
+ }
602
+ };
603
+ return obj;
604
+ }
605
+ var nonWordAndColonTest = /[^\w:]/g;
606
+ var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
607
+ /**
608
+ * @param {boolean} sanitize
609
+ * @param {string} base
610
+ * @param {string} href
611
+ */
612
+
613
+ function cleanUrl(sanitize, base, href) {
614
+ if (sanitize) {
615
+ var prot;
616
+
617
+ try {
618
+ prot = decodeURIComponent(unescape(href)).replace(nonWordAndColonTest, '').toLowerCase();
619
+ } catch (e) {
620
+ return null;
621
+ }
622
+
623
+ if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {
624
+ return null;
625
+ }
626
+ }
627
+
628
+ if (base && !originIndependentUrl.test(href)) {
629
+ href = resolveUrl(base, href);
630
+ }
631
+
632
+ try {
633
+ href = encodeURI(href).replace(/%25/g, '%');
634
+ } catch (e) {
635
+ return null;
636
+ }
637
+
638
+ return href;
639
+ }
640
+ var baseUrls = {};
641
+ var justDomain = /^[^:]+:\/*[^/]*$/;
642
+ var protocol = /^([^:]+:)[\s\S]*$/;
643
+ var domain = /^([^:]+:\/*[^/]*)[\s\S]*$/;
644
+ /**
645
+ * @param {string} base
646
+ * @param {string} href
647
+ */
648
+
649
+ function resolveUrl(base, href) {
650
+ if (!baseUrls[' ' + base]) {
651
+ // we can ignore everything in base after the last slash of its path component,
652
+ // but we might need to add _that_
653
+ // https://tools.ietf.org/html/rfc3986#section-3
654
+ if (justDomain.test(base)) {
655
+ baseUrls[' ' + base] = base + '/';
656
+ } else {
657
+ baseUrls[' ' + base] = rtrim(base, '/', true);
658
+ }
659
+ }
660
+
661
+ base = baseUrls[' ' + base];
662
+ var relativeBase = base.indexOf(':') === -1;
663
+
664
+ if (href.substring(0, 2) === '//') {
665
+ if (relativeBase) {
666
+ return href;
667
+ }
668
+
669
+ return base.replace(protocol, '$1') + href;
670
+ } else if (href.charAt(0) === '/') {
671
+ if (relativeBase) {
672
+ return href;
673
+ }
674
+
675
+ return base.replace(domain, '$1') + href;
676
+ } else {
677
+ return base + href;
678
+ }
679
+ }
680
+ var noopTest = {
681
+ exec: function noopTest() {}
682
+ };
683
+ function merge(obj) {
684
+ var i = 1,
685
+ target,
686
+ key;
687
+
688
+ for (; i < arguments.length; i++) {
689
+ target = arguments[i];
690
+
691
+ for (key in target) {
692
+ if (Object.prototype.hasOwnProperty.call(target, key)) {
693
+ obj[key] = target[key];
694
+ }
695
+ }
696
+ }
697
+
698
+ return obj;
699
+ }
700
+ function splitCells(tableRow, count) {
701
+ // ensure that every cell-delimiting pipe has a space
702
+ // before it to distinguish it from an escaped pipe
703
+ var row = tableRow.replace(/\|/g, function (match, offset, str) {
704
+ var escaped = false,
705
+ curr = offset;
706
+
707
+ while (--curr >= 0 && str[curr] === '\\') {
708
+ escaped = !escaped;
709
+ }
710
+
711
+ if (escaped) {
712
+ // odd number of slashes means | is escaped
713
+ // so we leave it alone
714
+ return '|';
715
+ } else {
716
+ // add space before unescaped |
717
+ return ' |';
718
+ }
719
+ }),
720
+ cells = row.split(/ \|/);
721
+ var i = 0; // First/last cell in a row cannot be empty if it has no leading/trailing pipe
722
+
723
+ if (!cells[0].trim()) {
724
+ cells.shift();
725
+ }
726
+
727
+ if (cells.length > 0 && !cells[cells.length - 1].trim()) {
728
+ cells.pop();
729
+ }
730
+
731
+ if (cells.length > count) {
732
+ cells.splice(count);
733
+ } else {
734
+ while (cells.length < count) {
735
+ cells.push('');
736
+ }
737
+ }
738
+
739
+ for (; i < cells.length; i++) {
740
+ // leading or trailing whitespace is ignored per the gfm spec
741
+ cells[i] = cells[i].trim().replace(/\\\|/g, '|');
742
+ }
743
+
744
+ return cells;
745
+ }
746
+ /**
747
+ * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').
748
+ * /c*$/ is vulnerable to REDOS.
749
+ *
750
+ * @param {string} str
751
+ * @param {string} c
752
+ * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.
753
+ */
754
+
755
+ function rtrim(str, c, invert) {
756
+ var l = str.length;
757
+
758
+ if (l === 0) {
759
+ return '';
760
+ } // Length of suffix matching the invert condition.
761
+
762
+
763
+ var suffLen = 0; // Step left until we fail to match the invert condition.
764
+
765
+ while (suffLen < l) {
766
+ var currChar = str.charAt(l - suffLen - 1);
767
+
768
+ if (currChar === c && !invert) {
769
+ suffLen++;
770
+ } else if (currChar !== c && invert) {
771
+ suffLen++;
772
+ } else {
773
+ break;
774
+ }
775
+ }
776
+
777
+ return str.slice(0, l - suffLen);
778
+ }
779
+ function findClosingBracket(str, b) {
780
+ if (str.indexOf(b[1]) === -1) {
781
+ return -1;
782
+ }
783
+
784
+ var l = str.length;
785
+ var level = 0,
786
+ i = 0;
787
+
788
+ for (; i < l; i++) {
789
+ if (str[i] === '\\') {
790
+ i++;
791
+ } else if (str[i] === b[0]) {
792
+ level++;
793
+ } else if (str[i] === b[1]) {
794
+ level--;
795
+
796
+ if (level < 0) {
797
+ return i;
798
+ }
799
+ }
800
+ }
801
+
802
+ return -1;
803
+ }
804
+ function checkSanitizeDeprecation(opt) {
805
+ if (opt && opt.sanitize && !opt.silent) {
806
+ console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');
807
+ }
808
+ } // copied from https://stackoverflow.com/a/5450113/806777
809
+
810
+ /**
811
+ * @param {string} pattern
812
+ * @param {number} count
813
+ */
814
+
815
+ function repeatString(pattern, count) {
816
+ if (count < 1) {
817
+ return '';
818
+ }
819
+
820
+ var result = '';
821
+
822
+ while (count > 1) {
823
+ if (count & 1) {
824
+ result += pattern;
825
+ }
826
+
827
+ count >>= 1;
828
+ pattern += pattern;
829
+ }
830
+
831
+ return result + pattern;
832
+ }
833
+
834
+ function outputLink(cap, link, raw, lexer) {
835
+ var href = link.href;
836
+ var title = link.title ? escape(link.title) : null;
837
+ var text = cap[1].replace(/\\([\[\]])/g, '$1');
838
+
839
+ if (cap[0].charAt(0) !== '!') {
840
+ lexer.state.inLink = true;
841
+ var token = {
842
+ type: 'link',
843
+ raw: raw,
844
+ href: href,
845
+ title: title,
846
+ text: text,
847
+ tokens: lexer.inlineTokens(text)
848
+ };
849
+ lexer.state.inLink = false;
850
+ return token;
851
+ }
852
+
853
+ return {
854
+ type: 'image',
855
+ raw: raw,
856
+ href: href,
857
+ title: title,
858
+ text: escape(text)
859
+ };
860
+ }
861
+
862
+ function indentCodeCompensation(raw, text) {
863
+ var matchIndentToCode = raw.match(/^(\s+)(?:```)/);
864
+
865
+ if (matchIndentToCode === null) {
866
+ return text;
867
+ }
868
+
869
+ var indentToCode = matchIndentToCode[1];
870
+ return text.split('\n').map(function (node) {
871
+ var matchIndentInNode = node.match(/^\s+/);
872
+
873
+ if (matchIndentInNode === null) {
874
+ return node;
875
+ }
876
+
877
+ var indentInNode = matchIndentInNode[0];
878
+
879
+ if (indentInNode.length >= indentToCode.length) {
880
+ return node.slice(indentToCode.length);
881
+ }
882
+
883
+ return node;
884
+ }).join('\n');
885
+ }
886
+ /**
887
+ * Tokenizer
888
+ */
889
+
890
+
891
+ var Tokenizer = /*#__PURE__*/function () {
892
+ function Tokenizer(options) {
893
+ this.options = options || exports.defaults;
894
+ }
895
+
896
+ var _proto = Tokenizer.prototype;
897
+
898
+ _proto.space = function space(src) {
899
+ var cap = this.rules.block.newline.exec(src);
900
+
901
+ if (cap && cap[0].length > 0) {
902
+ return {
903
+ type: 'space',
904
+ raw: cap[0]
905
+ };
906
+ }
907
+ };
908
+
909
+ _proto.code = function code(src) {
910
+ var cap = this.rules.block.code.exec(src);
911
+
912
+ if (cap) {
913
+ var text = cap[0].replace(/^ {1,4}/gm, '');
914
+ return {
915
+ type: 'code',
916
+ raw: cap[0],
917
+ codeBlockStyle: 'indented',
918
+ text: !this.options.pedantic ? rtrim(text, '\n') : text
919
+ };
920
+ }
921
+ };
922
+
923
+ _proto.fences = function fences(src) {
924
+ var cap = this.rules.block.fences.exec(src);
925
+
926
+ if (cap) {
927
+ var raw = cap[0];
928
+ var text = indentCodeCompensation(raw, cap[3] || '');
929
+ return {
930
+ type: 'code',
931
+ raw: raw,
932
+ lang: cap[2] ? cap[2].trim() : cap[2],
933
+ text: text
934
+ };
935
+ }
936
+ };
937
+
938
+ _proto.heading = function heading(src) {
939
+ var cap = this.rules.block.heading.exec(src);
940
+
941
+ if (cap) {
942
+ var text = cap[2].trim(); // remove trailing #s
943
+
944
+ if (/#$/.test(text)) {
945
+ var trimmed = rtrim(text, '#');
946
+
947
+ if (this.options.pedantic) {
948
+ text = trimmed.trim();
949
+ } else if (!trimmed || / $/.test(trimmed)) {
950
+ // CommonMark requires space before trailing #s
951
+ text = trimmed.trim();
952
+ }
953
+ }
954
+
955
+ return {
956
+ type: 'heading',
957
+ raw: cap[0],
958
+ depth: cap[1].length,
959
+ text: text,
960
+ tokens: this.lexer.inline(text)
961
+ };
962
+ }
963
+ };
964
+
965
+ _proto.hr = function hr(src) {
966
+ var cap = this.rules.block.hr.exec(src);
967
+
968
+ if (cap) {
969
+ return {
970
+ type: 'hr',
971
+ raw: cap[0]
972
+ };
973
+ }
974
+ };
975
+
976
+ _proto.blockquote = function blockquote(src) {
977
+ var cap = this.rules.block.blockquote.exec(src);
978
+
979
+ if (cap) {
980
+ var text = cap[0].replace(/^ *>[ \t]?/gm, '');
981
+ return {
982
+ type: 'blockquote',
983
+ raw: cap[0],
984
+ tokens: this.lexer.blockTokens(text, []),
985
+ text: text
986
+ };
987
+ }
988
+ };
989
+
990
+ _proto.list = function list(src) {
991
+ var cap = this.rules.block.list.exec(src);
992
+
993
+ if (cap) {
994
+ var raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine, line, nextLine, rawLine, itemContents, endEarly;
995
+ var bull = cap[1].trim();
996
+ var isordered = bull.length > 1;
997
+ var list = {
998
+ type: 'list',
999
+ raw: '',
1000
+ ordered: isordered,
1001
+ start: isordered ? +bull.slice(0, -1) : '',
1002
+ loose: false,
1003
+ items: []
1004
+ };
1005
+ bull = isordered ? "\\d{1,9}\\" + bull.slice(-1) : "\\" + bull;
1006
+
1007
+ if (this.options.pedantic) {
1008
+ bull = isordered ? bull : '[*+-]';
1009
+ } // Get next list item
1010
+
1011
+
1012
+ var itemRegex = new RegExp("^( {0,3}" + bull + ")((?:[\t ][^\\n]*)?(?:\\n|$))"); // Check if current bullet point can start a new List Item
1013
+
1014
+ while (src) {
1015
+ endEarly = false;
1016
+
1017
+ if (!(cap = itemRegex.exec(src))) {
1018
+ break;
1019
+ }
1020
+
1021
+ if (this.rules.block.hr.test(src)) {
1022
+ // End list if bullet was actually HR (possibly move into itemRegex?)
1023
+ break;
1024
+ }
1025
+
1026
+ raw = cap[0];
1027
+ src = src.substring(raw.length);
1028
+ line = cap[2].split('\n', 1)[0];
1029
+ nextLine = src.split('\n', 1)[0];
1030
+
1031
+ if (this.options.pedantic) {
1032
+ indent = 2;
1033
+ itemContents = line.trimLeft();
1034
+ } else {
1035
+ indent = cap[2].search(/[^ ]/); // Find first non-space char
1036
+
1037
+ indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent
1038
+
1039
+ itemContents = line.slice(indent);
1040
+ indent += cap[1].length;
1041
+ }
1042
+
1043
+ blankLine = false;
1044
+
1045
+ if (!line && /^ *$/.test(nextLine)) {
1046
+ // Items begin with at most one blank line
1047
+ raw += nextLine + '\n';
1048
+ src = src.substring(nextLine.length + 1);
1049
+ endEarly = true;
1050
+ }
1051
+
1052
+ if (!endEarly) {
1053
+ var nextBulletRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))");
1054
+ var hrRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)");
1055
+ var fencesBeginRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:```|~~~)");
1056
+ var headingBeginRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}#"); // Check if following lines should be included in List Item
1057
+
1058
+ while (src) {
1059
+ rawLine = src.split('\n', 1)[0];
1060
+ line = rawLine; // Re-align to follow commonmark nesting rules
1061
+
1062
+ if (this.options.pedantic) {
1063
+ line = line.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');
1064
+ } // End list item if found code fences
1065
+
1066
+
1067
+ if (fencesBeginRegex.test(line)) {
1068
+ break;
1069
+ } // End list item if found start of new heading
1070
+
1071
+
1072
+ if (headingBeginRegex.test(line)) {
1073
+ break;
1074
+ } // End list item if found start of new bullet
1075
+
1076
+
1077
+ if (nextBulletRegex.test(line)) {
1078
+ break;
1079
+ } // Horizontal rule found
1080
+
1081
+
1082
+ if (hrRegex.test(src)) {
1083
+ break;
1084
+ }
1085
+
1086
+ if (line.search(/[^ ]/) >= indent || !line.trim()) {
1087
+ // Dedent if possible
1088
+ itemContents += '\n' + line.slice(indent);
1089
+ } else if (!blankLine) {
1090
+ // Until blank line, item doesn't need indentation
1091
+ itemContents += '\n' + line;
1092
+ } else {
1093
+ // Otherwise, improper indentation ends this item
1094
+ break;
1095
+ }
1096
+
1097
+ if (!blankLine && !line.trim()) {
1098
+ // Check if current line is blank
1099
+ blankLine = true;
1100
+ }
1101
+
1102
+ raw += rawLine + '\n';
1103
+ src = src.substring(rawLine.length + 1);
1104
+ }
1105
+ }
1106
+
1107
+ if (!list.loose) {
1108
+ // If the previous item ended with a blank line, the list is loose
1109
+ if (endsWithBlankLine) {
1110
+ list.loose = true;
1111
+ } else if (/\n *\n *$/.test(raw)) {
1112
+ endsWithBlankLine = true;
1113
+ }
1114
+ } // Check for task list items
1115
+
1116
+
1117
+ if (this.options.gfm) {
1118
+ istask = /^\[[ xX]\] /.exec(itemContents);
1119
+
1120
+ if (istask) {
1121
+ ischecked = istask[0] !== '[ ] ';
1122
+ itemContents = itemContents.replace(/^\[[ xX]\] +/, '');
1123
+ }
1124
+ }
1125
+
1126
+ list.items.push({
1127
+ type: 'list_item',
1128
+ raw: raw,
1129
+ task: !!istask,
1130
+ checked: ischecked,
1131
+ loose: false,
1132
+ text: itemContents
1133
+ });
1134
+ list.raw += raw;
1135
+ } // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic
1136
+
1137
+
1138
+ list.items[list.items.length - 1].raw = raw.trimRight();
1139
+ list.items[list.items.length - 1].text = itemContents.trimRight();
1140
+ list.raw = list.raw.trimRight();
1141
+ var l = list.items.length; // Item child tokens handled here at end because we needed to have the final item to trim it first
1142
+
1143
+ for (i = 0; i < l; i++) {
1144
+ this.lexer.state.top = false;
1145
+ list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);
1146
+ var spacers = list.items[i].tokens.filter(function (t) {
1147
+ return t.type === 'space';
1148
+ });
1149
+ var hasMultipleLineBreaks = spacers.every(function (t) {
1150
+ var chars = t.raw.split('');
1151
+ var lineBreaks = 0;
1152
+
1153
+ for (var _iterator = _createForOfIteratorHelperLoose(chars), _step; !(_step = _iterator()).done;) {
1154
+ var _char = _step.value;
1155
+
1156
+ if (_char === '\n') {
1157
+ lineBreaks += 1;
1158
+ }
1159
+
1160
+ if (lineBreaks > 1) {
1161
+ return true;
1162
+ }
1163
+ }
1164
+
1165
+ return false;
1166
+ });
1167
+
1168
+ if (!list.loose && spacers.length && hasMultipleLineBreaks) {
1169
+ // Having a single line break doesn't mean a list is loose. A single line break is terminating the last list item
1170
+ list.loose = true;
1171
+ list.items[i].loose = true;
1172
+ }
1173
+ }
1174
+
1175
+ return list;
1176
+ }
1177
+ };
1178
+
1179
+ _proto.html = function html(src) {
1180
+ var cap = this.rules.block.html.exec(src);
1181
+
1182
+ if (cap) {
1183
+ var token = {
1184
+ type: 'html',
1185
+ raw: cap[0],
1186
+ pre: !this.options.sanitizer && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),
1187
+ text: cap[0]
1188
+ };
1189
+
1190
+ if (this.options.sanitize) {
1191
+ var text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);
1192
+ token.type = 'paragraph';
1193
+ token.text = text;
1194
+ token.tokens = this.lexer.inline(text);
1195
+ }
1196
+
1197
+ return token;
1198
+ }
1199
+ };
1200
+
1201
+ _proto.def = function def(src) {
1202
+ var cap = this.rules.block.def.exec(src);
1203
+
1204
+ if (cap) {
1205
+ if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1);
1206
+ var tag = cap[1].toLowerCase().replace(/\s+/g, ' ');
1207
+ return {
1208
+ type: 'def',
1209
+ tag: tag,
1210
+ raw: cap[0],
1211
+ href: cap[2],
1212
+ title: cap[3]
1213
+ };
1214
+ }
1215
+ };
1216
+
1217
+ _proto.table = function table(src) {
1218
+ var cap = this.rules.block.table.exec(src);
1219
+
1220
+ if (cap) {
1221
+ var item = {
1222
+ type: 'table',
1223
+ header: splitCells(cap[1]).map(function (c) {
1224
+ return {
1225
+ text: c
1226
+ };
1227
+ }),
1228
+ align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
1229
+ rows: cap[3] && cap[3].trim() ? cap[3].replace(/\n[ \t]*$/, '').split('\n') : []
1230
+ };
1231
+
1232
+ if (item.header.length === item.align.length) {
1233
+ item.raw = cap[0];
1234
+ var l = item.align.length;
1235
+ var i, j, k, row;
1236
+
1237
+ for (i = 0; i < l; i++) {
1238
+ if (/^ *-+: *$/.test(item.align[i])) {
1239
+ item.align[i] = 'right';
1240
+ } else if (/^ *:-+: *$/.test(item.align[i])) {
1241
+ item.align[i] = 'center';
1242
+ } else if (/^ *:-+ *$/.test(item.align[i])) {
1243
+ item.align[i] = 'left';
1244
+ } else {
1245
+ item.align[i] = null;
1246
+ }
1247
+ }
1248
+
1249
+ l = item.rows.length;
1250
+
1251
+ for (i = 0; i < l; i++) {
1252
+ item.rows[i] = splitCells(item.rows[i], item.header.length).map(function (c) {
1253
+ return {
1254
+ text: c
1255
+ };
1256
+ });
1257
+ } // parse child tokens inside headers and cells
1258
+ // header child tokens
1259
+
1260
+
1261
+ l = item.header.length;
1262
+
1263
+ for (j = 0; j < l; j++) {
1264
+ item.header[j].tokens = this.lexer.inline(item.header[j].text);
1265
+ } // cell child tokens
1266
+
1267
+
1268
+ l = item.rows.length;
1269
+
1270
+ for (j = 0; j < l; j++) {
1271
+ row = item.rows[j];
1272
+
1273
+ for (k = 0; k < row.length; k++) {
1274
+ row[k].tokens = this.lexer.inline(row[k].text);
1275
+ }
1276
+ }
1277
+
1278
+ return item;
1279
+ }
1280
+ }
1281
+ };
1282
+
1283
+ _proto.lheading = function lheading(src) {
1284
+ var cap = this.rules.block.lheading.exec(src);
1285
+
1286
+ if (cap) {
1287
+ return {
1288
+ type: 'heading',
1289
+ raw: cap[0],
1290
+ depth: cap[2].charAt(0) === '=' ? 1 : 2,
1291
+ text: cap[1],
1292
+ tokens: this.lexer.inline(cap[1])
1293
+ };
1294
+ }
1295
+ };
1296
+
1297
+ _proto.paragraph = function paragraph(src) {
1298
+ var cap = this.rules.block.paragraph.exec(src);
1299
+
1300
+ if (cap) {
1301
+ var text = cap[1].charAt(cap[1].length - 1) === '\n' ? cap[1].slice(0, -1) : cap[1];
1302
+ return {
1303
+ type: 'paragraph',
1304
+ raw: cap[0],
1305
+ text: text,
1306
+ tokens: this.lexer.inline(text)
1307
+ };
1308
+ }
1309
+ };
1310
+
1311
+ _proto.text = function text(src) {
1312
+ var cap = this.rules.block.text.exec(src);
1313
+
1314
+ if (cap) {
1315
+ return {
1316
+ type: 'text',
1317
+ raw: cap[0],
1318
+ text: cap[0],
1319
+ tokens: this.lexer.inline(cap[0])
1320
+ };
1321
+ }
1322
+ };
1323
+
1324
+ _proto.escape = function escape$1(src) {
1325
+ var cap = this.rules.inline.escape.exec(src);
1326
+
1327
+ if (cap) {
1328
+ return {
1329
+ type: 'escape',
1330
+ raw: cap[0],
1331
+ text: escape(cap[1])
1332
+ };
1333
+ }
1334
+ };
1335
+
1336
+ _proto.tag = function tag(src) {
1337
+ var cap = this.rules.inline.tag.exec(src);
1338
+
1339
+ if (cap) {
1340
+ if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {
1341
+ this.lexer.state.inLink = true;
1342
+ } else if (this.lexer.state.inLink && /^<\/a>/i.test(cap[0])) {
1343
+ this.lexer.state.inLink = false;
1344
+ }
1345
+
1346
+ if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
1347
+ this.lexer.state.inRawBlock = true;
1348
+ } else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
1349
+ this.lexer.state.inRawBlock = false;
1350
+ }
1351
+
1352
+ return {
1353
+ type: this.options.sanitize ? 'text' : 'html',
1354
+ raw: cap[0],
1355
+ inLink: this.lexer.state.inLink,
1356
+ inRawBlock: this.lexer.state.inRawBlock,
1357
+ text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0]
1358
+ };
1359
+ }
1360
+ };
1361
+
1362
+ _proto.link = function link(src) {
1363
+ var cap = this.rules.inline.link.exec(src);
1364
+
1365
+ if (cap) {
1366
+ var trimmedUrl = cap[2].trim();
1367
+
1368
+ if (!this.options.pedantic && /^</.test(trimmedUrl)) {
1369
+ // commonmark requires matching angle brackets
1370
+ if (!/>$/.test(trimmedUrl)) {
1371
+ return;
1372
+ } // ending angle bracket cannot be escaped
1373
+
1374
+
1375
+ var rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\');
1376
+
1377
+ if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
1378
+ return;
1379
+ }
1380
+ } else {
1381
+ // find closing parenthesis
1382
+ var lastParenIndex = findClosingBracket(cap[2], '()');
1383
+
1384
+ if (lastParenIndex > -1) {
1385
+ var start = cap[0].indexOf('!') === 0 ? 5 : 4;
1386
+ var linkLen = start + cap[1].length + lastParenIndex;
1387
+ cap[2] = cap[2].substring(0, lastParenIndex);
1388
+ cap[0] = cap[0].substring(0, linkLen).trim();
1389
+ cap[3] = '';
1390
+ }
1391
+ }
1392
+
1393
+ var href = cap[2];
1394
+ var title = '';
1395
+
1396
+ if (this.options.pedantic) {
1397
+ // split pedantic href and title
1398
+ var link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href);
1399
+
1400
+ if (link) {
1401
+ href = link[1];
1402
+ title = link[3];
1403
+ }
1404
+ } else {
1405
+ title = cap[3] ? cap[3].slice(1, -1) : '';
1406
+ }
1407
+
1408
+ href = href.trim();
1409
+
1410
+ if (/^</.test(href)) {
1411
+ if (this.options.pedantic && !/>$/.test(trimmedUrl)) {
1412
+ // pedantic allows starting angle bracket without ending angle bracket
1413
+ href = href.slice(1);
1414
+ } else {
1415
+ href = href.slice(1, -1);
1416
+ }
1417
+ }
1418
+
1419
+ return outputLink(cap, {
1420
+ href: href ? href.replace(this.rules.inline._escapes, '$1') : href,
1421
+ title: title ? title.replace(this.rules.inline._escapes, '$1') : title
1422
+ }, cap[0], this.lexer);
1423
+ }
1424
+ };
1425
+
1426
+ _proto.reflink = function reflink(src, links) {
1427
+ var cap;
1428
+
1429
+ if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {
1430
+ var link = (cap[2] || cap[1]).replace(/\s+/g, ' ');
1431
+ link = links[link.toLowerCase()];
1432
+
1433
+ if (!link || !link.href) {
1434
+ var text = cap[0].charAt(0);
1435
+ return {
1436
+ type: 'text',
1437
+ raw: text,
1438
+ text: text
1439
+ };
1440
+ }
1441
+
1442
+ return outputLink(cap, link, cap[0], this.lexer);
1443
+ }
1444
+ };
1445
+
1446
+ _proto.emStrong = function emStrong(src, maskedSrc, prevChar) {
1447
+ if (prevChar === void 0) {
1448
+ prevChar = '';
1449
+ }
1450
+
1451
+ var match = this.rules.inline.emStrong.lDelim.exec(src);
1452
+ if (!match) return; // _ can't be between two alphanumerics. \p{L}\p{N} includes non-english alphabet/numbers as well
1453
+
1454
+ if (match[3] && prevChar.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/)) return;
1455
+ var nextChar = match[1] || match[2] || '';
1456
+
1457
+ if (!nextChar || nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))) {
1458
+ var lLength = match[0].length - 1;
1459
+ var rDelim,
1460
+ rLength,
1461
+ delimTotal = lLength,
1462
+ midDelimTotal = 0;
1463
+ var endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;
1464
+ endReg.lastIndex = 0; // Clip maskedSrc to same section of string as src (move to lexer?)
1465
+
1466
+ maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
1467
+
1468
+ while ((match = endReg.exec(maskedSrc)) != null) {
1469
+ rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];
1470
+ if (!rDelim) continue; // skip single * in __abc*abc__
1471
+
1472
+ rLength = rDelim.length;
1473
+
1474
+ if (match[3] || match[4]) {
1475
+ // found another Left Delim
1476
+ delimTotal += rLength;
1477
+ continue;
1478
+ } else if (match[5] || match[6]) {
1479
+ // either Left or Right Delim
1480
+ if (lLength % 3 && !((lLength + rLength) % 3)) {
1481
+ midDelimTotal += rLength;
1482
+ continue; // CommonMark Emphasis Rules 9-10
1483
+ }
1484
+ }
1485
+
1486
+ delimTotal -= rLength;
1487
+ if (delimTotal > 0) continue; // Haven't found enough closing delimiters
1488
+ // Remove extra characters. *a*** -> *a*
1489
+
1490
+ rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal); // Create `em` if smallest delimiter has odd char count. *a***
1491
+
1492
+ if (Math.min(lLength, rLength) % 2) {
1493
+ var _text = src.slice(1, lLength + match.index + rLength);
1494
+
1495
+ return {
1496
+ type: 'em',
1497
+ raw: src.slice(0, lLength + match.index + rLength + 1),
1498
+ text: _text,
1499
+ tokens: this.lexer.inlineTokens(_text)
1500
+ };
1501
+ } // Create 'strong' if smallest delimiter has even char count. **a***
1502
+
1503
+
1504
+ var text = src.slice(2, lLength + match.index + rLength - 1);
1505
+ return {
1506
+ type: 'strong',
1507
+ raw: src.slice(0, lLength + match.index + rLength + 1),
1508
+ text: text,
1509
+ tokens: this.lexer.inlineTokens(text)
1510
+ };
1511
+ }
1512
+ }
1513
+ };
1514
+
1515
+ _proto.codespan = function codespan(src) {
1516
+ var cap = this.rules.inline.code.exec(src);
1517
+
1518
+ if (cap) {
1519
+ var text = cap[2].replace(/\n/g, ' ');
1520
+ var hasNonSpaceChars = /[^ ]/.test(text);
1521
+ var hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);
1522
+
1523
+ if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
1524
+ text = text.substring(1, text.length - 1);
1525
+ }
1526
+
1527
+ text = escape(text, true);
1528
+ return {
1529
+ type: 'codespan',
1530
+ raw: cap[0],
1531
+ text: text
1532
+ };
1533
+ }
1534
+ };
1535
+
1536
+ _proto.br = function br(src) {
1537
+ var cap = this.rules.inline.br.exec(src);
1538
+
1539
+ if (cap) {
1540
+ return {
1541
+ type: 'br',
1542
+ raw: cap[0]
1543
+ };
1544
+ }
1545
+ };
1546
+
1547
+ _proto.del = function del(src) {
1548
+ var cap = this.rules.inline.del.exec(src);
1549
+
1550
+ if (cap) {
1551
+ return {
1552
+ type: 'del',
1553
+ raw: cap[0],
1554
+ text: cap[2],
1555
+ tokens: this.lexer.inlineTokens(cap[2])
1556
+ };
1557
+ }
1558
+ };
1559
+
1560
+ _proto.autolink = function autolink(src, mangle) {
1561
+ var cap = this.rules.inline.autolink.exec(src);
1562
+
1563
+ if (cap) {
1564
+ var text, href;
1565
+
1566
+ if (cap[2] === '@') {
1567
+ text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]);
1568
+ href = 'mailto:' + text;
1569
+ } else {
1570
+ text = escape(cap[1]);
1571
+ href = text;
1572
+ }
1573
+
1574
+ return {
1575
+ type: 'link',
1576
+ raw: cap[0],
1577
+ text: text,
1578
+ href: href,
1579
+ tokens: [{
1580
+ type: 'text',
1581
+ raw: text,
1582
+ text: text
1583
+ }]
1584
+ };
1585
+ }
1586
+ };
1587
+
1588
+ _proto.url = function url(src, mangle) {
1589
+ var cap;
1590
+
1591
+ if (cap = this.rules.inline.url.exec(src)) {
1592
+ var text, href;
1593
+
1594
+ if (cap[2] === '@') {
1595
+ text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]);
1596
+ href = 'mailto:' + text;
1597
+ } else {
1598
+ // do extended autolink path validation
1599
+ var prevCapZero;
1600
+
1601
+ do {
1602
+ prevCapZero = cap[0];
1603
+ cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];
1604
+ } while (prevCapZero !== cap[0]);
1605
+
1606
+ text = escape(cap[0]);
1607
+
1608
+ if (cap[1] === 'www.') {
1609
+ href = 'http://' + text;
1610
+ } else {
1611
+ href = text;
1612
+ }
1613
+ }
1614
+
1615
+ return {
1616
+ type: 'link',
1617
+ raw: cap[0],
1618
+ text: text,
1619
+ href: href,
1620
+ tokens: [{
1621
+ type: 'text',
1622
+ raw: text,
1623
+ text: text
1624
+ }]
1625
+ };
1626
+ }
1627
+ };
1628
+
1629
+ _proto.inlineText = function inlineText(src, smartypants) {
1630
+ var cap = this.rules.inline.text.exec(src);
1631
+
1632
+ if (cap) {
1633
+ var text;
1634
+
1635
+ if (this.lexer.state.inRawBlock) {
1636
+ text = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0];
1637
+ } else {
1638
+ text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]);
1639
+ }
1640
+
1641
+ return {
1642
+ type: 'text',
1643
+ raw: cap[0],
1644
+ text: text
1645
+ };
1646
+ }
1647
+ };
1648
+
1649
+ return Tokenizer;
1650
+ }();
1651
+
1652
+ /**
1653
+ * Block-Level Grammar
1654
+ */
1655
+
1656
+ var block = {
1657
+ newline: /^(?: *(?:\n|$))+/,
1658
+ code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
1659
+ fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
1660
+ hr: /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,
1661
+ heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
1662
+ blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
1663
+ list: /^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,
1664
+ html: '^ {0,3}(?:' // optional indentation
1665
+ + '<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)' // (1)
1666
+ + '|comment[^\\n]*(\\n+|$)' // (2)
1667
+ + '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3)
1668
+ + '|<![A-Z][\\s\\S]*?(?:>\\n*|$)' // (4)
1669
+ + '|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)' // (5)
1670
+ + '|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (6)
1671
+ + '|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) open tag
1672
+ + '|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) closing tag
1673
+ + ')',
1674
+ def: /^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,
1675
+ table: noopTest,
1676
+ lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,
1677
+ // regex template, placeholders will be replaced according to different paragraph
1678
+ // interruption rules of commonmark and the original markdown spec:
1679
+ _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
1680
+ text: /^[^\n]+/
1681
+ };
1682
+ block._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
1683
+ block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
1684
+ block.def = edit(block.def).replace('label', block._label).replace('title', block._title).getRegex();
1685
+ block.bullet = /(?:[*+-]|\d{1,9}[.)])/;
1686
+ block.listItemStart = edit(/^( *)(bull) */).replace('bull', block.bullet).getRegex();
1687
+ block.list = edit(block.list).replace(/bull/g, block.bullet).replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))').replace('def', '\\n+(?=' + block.def.source + ')').getRegex();
1688
+ block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + '|track|ul';
1689
+ block._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
1690
+ block.html = edit(block.html, 'i').replace('comment', block._comment).replace('tag', block._tag).replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
1691
+ block.paragraph = edit(block._paragraph).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
1692
+ .replace('|table', '').replace('blockquote', ' {0,3}>').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
1693
+ .replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
1694
+ .getRegex();
1695
+ block.blockquote = edit(block.blockquote).replace('paragraph', block.paragraph).getRegex();
1696
+ /**
1697
+ * Normal Block Grammar
1698
+ */
1699
+
1700
+ block.normal = merge({}, block);
1701
+ /**
1702
+ * GFM Block Grammar
1703
+ */
1704
+
1705
+ block.gfm = merge({}, block.normal, {
1706
+ table: '^ *([^\\n ].*\\|.*)\\n' // Header
1707
+ + ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?' // Align
1708
+ + '(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
1709
+
1710
+ });
1711
+ block.gfm.table = edit(block.gfm.table).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
1712
+ .replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // tables can be interrupted by type (6) html blocks
1713
+ .getRegex();
1714
+ block.gfm.paragraph = edit(block._paragraph).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
1715
+ .replace('table', block.gfm.table) // interrupt paragraphs with table
1716
+ .replace('blockquote', ' {0,3}>').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
1717
+ .replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
1718
+ .getRegex();
1719
+ /**
1720
+ * Pedantic grammar (original John Gruber's loose markdown specification)
1721
+ */
1722
+
1723
+ block.pedantic = merge({}, block.normal, {
1724
+ html: edit('^ *(?:comment *(?:\\n|\\s*$)' + '|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)' // closed tag
1725
+ + '|<tag(?:"[^"]*"|\'[^\']*\'|\\s[^\'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))').replace('comment', block._comment).replace(/tag/g, '(?!(?:' + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub' + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)' + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b').getRegex(),
1726
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
1727
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
1728
+ fences: noopTest,
1729
+ // fences not supported
1730
+ paragraph: edit(block.normal._paragraph).replace('hr', block.hr).replace('heading', ' *#{1,6} *[^\n]').replace('lheading', block.lheading).replace('blockquote', ' {0,3}>').replace('|fences', '').replace('|list', '').replace('|html', '').getRegex()
1731
+ });
1732
+ /**
1733
+ * Inline-Level Grammar
1734
+ */
1735
+
1736
+ var inline = {
1737
+ escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
1738
+ autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
1739
+ url: noopTest,
1740
+ tag: '^comment' + '|^</[a-zA-Z][\\w:-]*\\s*>' // self-closing tag
1741
+ + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag
1742
+ + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. <?php ?>
1743
+ + '|^<![a-zA-Z]+\\s[\\s\\S]*?>' // declaration, e.g. <!DOCTYPE html>
1744
+ + '|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>',
1745
+ // CDATA section
1746
+ link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
1747
+ reflink: /^!?\[(label)\]\[(ref)\]/,
1748
+ nolink: /^!?\[(ref)\](?:\[\])?/,
1749
+ reflinkSearch: 'reflink|nolink(?!\\()',
1750
+ emStrong: {
1751
+ lDelim: /^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,
1752
+ // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.
1753
+ // () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a
1754
+ rDelimAst: /^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,
1755
+ rDelimUnd: /^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/ // ^- Not allowed for _
1756
+
1757
+ },
1758
+ code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
1759
+ br: /^( {2,}|\\)\n(?!\s*$)/,
1760
+ del: noopTest,
1761
+ text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
1762
+ punctuation: /^([\spunctuation])/
1763
+ }; // list of punctuation marks from CommonMark spec
1764
+ // without * and _ to handle the different emphasis markers * and _
1765
+
1766
+ inline._punctuation = '!"#$%&\'()+\\-.,/:;<=>?@\\[\\]`^{|}~';
1767
+ inline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex(); // sequences em should skip over [title](link), `code`, <html>
1768
+
1769
+ inline.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;
1770
+ inline.escapedEmSt = /\\\*|\\_/g;
1771
+ inline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();
1772
+ inline.emStrong.lDelim = edit(inline.emStrong.lDelim).replace(/punct/g, inline._punctuation).getRegex();
1773
+ inline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g').replace(/punct/g, inline._punctuation).getRegex();
1774
+ inline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g').replace(/punct/g, inline._punctuation).getRegex();
1775
+ inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
1776
+ inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
1777
+ inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;
1778
+ inline.autolink = edit(inline.autolink).replace('scheme', inline._scheme).replace('email', inline._email).getRegex();
1779
+ inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
1780
+ inline.tag = edit(inline.tag).replace('comment', inline._comment).replace('attribute', inline._attribute).getRegex();
1781
+ inline._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
1782
+ inline._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
1783
+ inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
1784
+ inline.link = edit(inline.link).replace('label', inline._label).replace('href', inline._href).replace('title', inline._title).getRegex();
1785
+ inline.reflink = edit(inline.reflink).replace('label', inline._label).replace('ref', block._label).getRegex();
1786
+ inline.nolink = edit(inline.nolink).replace('ref', block._label).getRegex();
1787
+ inline.reflinkSearch = edit(inline.reflinkSearch, 'g').replace('reflink', inline.reflink).replace('nolink', inline.nolink).getRegex();
1788
+ /**
1789
+ * Normal Inline Grammar
1790
+ */
1791
+
1792
+ inline.normal = merge({}, inline);
1793
+ /**
1794
+ * Pedantic Inline Grammar
1795
+ */
1796
+
1797
+ inline.pedantic = merge({}, inline.normal, {
1798
+ strong: {
1799
+ start: /^__|\*\*/,
1800
+ middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
1801
+ endAst: /\*\*(?!\*)/g,
1802
+ endUnd: /__(?!_)/g
1803
+ },
1804
+ em: {
1805
+ start: /^_|\*/,
1806
+ middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,
1807
+ endAst: /\*(?!\*)/g,
1808
+ endUnd: /_(?!_)/g
1809
+ },
1810
+ link: edit(/^!?\[(label)\]\((.*?)\)/).replace('label', inline._label).getRegex(),
1811
+ reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace('label', inline._label).getRegex()
1812
+ });
1813
+ /**
1814
+ * GFM Inline Grammar
1815
+ */
1816
+
1817
+ inline.gfm = merge({}, inline.normal, {
1818
+ escape: edit(inline.escape).replace('])', '~|])').getRegex(),
1819
+ _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
1820
+ url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
1821
+ _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,
1822
+ del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
1823
+ text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
1824
+ });
1825
+ inline.gfm.url = edit(inline.gfm.url, 'i').replace('email', inline.gfm._extended_email).getRegex();
1826
+ /**
1827
+ * GFM + Line Breaks Inline Grammar
1828
+ */
1829
+
1830
+ inline.breaks = merge({}, inline.gfm, {
1831
+ br: edit(inline.br).replace('{2,}', '*').getRegex(),
1832
+ text: edit(inline.gfm.text).replace('\\b_', '\\b_| {2,}\\n').replace(/\{2,\}/g, '*').getRegex()
1833
+ });
1834
+
1835
+ /**
1836
+ * smartypants text replacement
1837
+ * @param {string} text
1838
+ */
1839
+
1840
+ function smartypants(text) {
1841
+ return text // em-dashes
1842
+ .replace(/---/g, "\u2014") // en-dashes
1843
+ .replace(/--/g, "\u2013") // opening singles
1844
+ .replace(/(^|[-\u2014/(\[{"\s])'/g, "$1\u2018") // closing singles & apostrophes
1845
+ .replace(/'/g, "\u2019") // opening doubles
1846
+ .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1\u201C") // closing doubles
1847
+ .replace(/"/g, "\u201D") // ellipses
1848
+ .replace(/\.{3}/g, "\u2026");
1849
+ }
1850
+ /**
1851
+ * mangle email addresses
1852
+ * @param {string} text
1853
+ */
1854
+
1855
+
1856
+ function mangle(text) {
1857
+ var out = '',
1858
+ i,
1859
+ ch;
1860
+ var l = text.length;
1861
+
1862
+ for (i = 0; i < l; i++) {
1863
+ ch = text.charCodeAt(i);
1864
+
1865
+ if (Math.random() > 0.5) {
1866
+ ch = 'x' + ch.toString(16);
1867
+ }
1868
+
1869
+ out += '&#' + ch + ';';
1870
+ }
1871
+
1872
+ return out;
1873
+ }
1874
+ /**
1875
+ * Block Lexer
1876
+ */
1877
+
1878
+
1879
+ var Lexer = /*#__PURE__*/function () {
1880
+ function Lexer(options) {
1881
+ this.tokens = [];
1882
+ this.tokens.links = Object.create(null);
1883
+ this.options = options || exports.defaults;
1884
+ this.options.tokenizer = this.options.tokenizer || new Tokenizer();
1885
+ this.tokenizer = this.options.tokenizer;
1886
+ this.tokenizer.options = this.options;
1887
+ this.tokenizer.lexer = this;
1888
+ this.inlineQueue = [];
1889
+ this.state = {
1890
+ inLink: false,
1891
+ inRawBlock: false,
1892
+ top: true
1893
+ };
1894
+ var rules = {
1895
+ block: block.normal,
1896
+ inline: inline.normal
1897
+ };
1898
+
1899
+ if (this.options.pedantic) {
1900
+ rules.block = block.pedantic;
1901
+ rules.inline = inline.pedantic;
1902
+ } else if (this.options.gfm) {
1903
+ rules.block = block.gfm;
1904
+
1905
+ if (this.options.breaks) {
1906
+ rules.inline = inline.breaks;
1907
+ } else {
1908
+ rules.inline = inline.gfm;
1909
+ }
1910
+ }
1911
+
1912
+ this.tokenizer.rules = rules;
1913
+ }
1914
+ /**
1915
+ * Expose Rules
1916
+ */
1917
+
1918
+
1919
+ /**
1920
+ * Static Lex Method
1921
+ */
1922
+ Lexer.lex = function lex(src, options) {
1923
+ var lexer = new Lexer(options);
1924
+ return lexer.lex(src);
1925
+ }
1926
+ /**
1927
+ * Static Lex Inline Method
1928
+ */
1929
+ ;
1930
+
1931
+ Lexer.lexInline = function lexInline(src, options) {
1932
+ var lexer = new Lexer(options);
1933
+ return lexer.inlineTokens(src);
1934
+ }
1935
+ /**
1936
+ * Preprocessing
1937
+ */
1938
+ ;
1939
+
1940
+ var _proto = Lexer.prototype;
1941
+
1942
+ _proto.lex = function lex(src) {
1943
+ src = src.replace(/\r\n|\r/g, '\n');
1944
+ this.blockTokens(src, this.tokens);
1945
+ var next;
1946
+
1947
+ while (next = this.inlineQueue.shift()) {
1948
+ this.inlineTokens(next.src, next.tokens);
1949
+ }
1950
+
1951
+ return this.tokens;
1952
+ }
1953
+ /**
1954
+ * Lexing
1955
+ */
1956
+ ;
1957
+
1958
+ _proto.blockTokens = function blockTokens(src, tokens) {
1959
+ var _this = this;
1960
+
1961
+ if (tokens === void 0) {
1962
+ tokens = [];
1963
+ }
1964
+
1965
+ if (this.options.pedantic) {
1966
+ src = src.replace(/\t/g, ' ').replace(/^ +$/gm, '');
1967
+ } else {
1968
+ src = src.replace(/^( *)(\t+)/gm, function (_, leading, tabs) {
1969
+ return leading + ' '.repeat(tabs.length);
1970
+ });
1971
+ }
1972
+
1973
+ var token, lastToken, cutSrc, lastParagraphClipped;
1974
+
1975
+ while (src) {
1976
+ if (this.options.extensions && this.options.extensions.block && this.options.extensions.block.some(function (extTokenizer) {
1977
+ if (token = extTokenizer.call({
1978
+ lexer: _this
1979
+ }, src, tokens)) {
1980
+ src = src.substring(token.raw.length);
1981
+ tokens.push(token);
1982
+ return true;
1983
+ }
1984
+
1985
+ return false;
1986
+ })) {
1987
+ continue;
1988
+ } // newline
1989
+
1990
+
1991
+ if (token = this.tokenizer.space(src)) {
1992
+ src = src.substring(token.raw.length);
1993
+
1994
+ if (token.raw.length === 1 && tokens.length > 0) {
1995
+ // if there's a single \n as a spacer, it's terminating the last line,
1996
+ // so move it there so that we don't get unecessary paragraph tags
1997
+ tokens[tokens.length - 1].raw += '\n';
1998
+ } else {
1999
+ tokens.push(token);
2000
+ }
2001
+
2002
+ continue;
2003
+ } // code
2004
+
2005
+
2006
+ if (token = this.tokenizer.code(src)) {
2007
+ src = src.substring(token.raw.length);
2008
+ lastToken = tokens[tokens.length - 1]; // An indented code block cannot interrupt a paragraph.
2009
+
2010
+ if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {
2011
+ lastToken.raw += '\n' + token.raw;
2012
+ lastToken.text += '\n' + token.text;
2013
+ this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
2014
+ } else {
2015
+ tokens.push(token);
2016
+ }
2017
+
2018
+ continue;
2019
+ } // fences
2020
+
2021
+
2022
+ if (token = this.tokenizer.fences(src)) {
2023
+ src = src.substring(token.raw.length);
2024
+ tokens.push(token);
2025
+ continue;
2026
+ } // heading
2027
+
2028
+
2029
+ if (token = this.tokenizer.heading(src)) {
2030
+ src = src.substring(token.raw.length);
2031
+ tokens.push(token);
2032
+ continue;
2033
+ } // hr
2034
+
2035
+
2036
+ if (token = this.tokenizer.hr(src)) {
2037
+ src = src.substring(token.raw.length);
2038
+ tokens.push(token);
2039
+ continue;
2040
+ } // blockquote
2041
+
2042
+
2043
+ if (token = this.tokenizer.blockquote(src)) {
2044
+ src = src.substring(token.raw.length);
2045
+ tokens.push(token);
2046
+ continue;
2047
+ } // list
2048
+
2049
+
2050
+ if (token = this.tokenizer.list(src)) {
2051
+ src = src.substring(token.raw.length);
2052
+ tokens.push(token);
2053
+ continue;
2054
+ } // html
2055
+
2056
+
2057
+ if (token = this.tokenizer.html(src)) {
2058
+ src = src.substring(token.raw.length);
2059
+ tokens.push(token);
2060
+ continue;
2061
+ } // def
2062
+
2063
+
2064
+ if (token = this.tokenizer.def(src)) {
2065
+ src = src.substring(token.raw.length);
2066
+ lastToken = tokens[tokens.length - 1];
2067
+
2068
+ if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {
2069
+ lastToken.raw += '\n' + token.raw;
2070
+ lastToken.text += '\n' + token.raw;
2071
+ this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
2072
+ } else if (!this.tokens.links[token.tag]) {
2073
+ this.tokens.links[token.tag] = {
2074
+ href: token.href,
2075
+ title: token.title
2076
+ };
2077
+ }
2078
+
2079
+ continue;
2080
+ } // table (gfm)
2081
+
2082
+
2083
+ if (token = this.tokenizer.table(src)) {
2084
+ src = src.substring(token.raw.length);
2085
+ tokens.push(token);
2086
+ continue;
2087
+ } // lheading
2088
+
2089
+
2090
+ if (token = this.tokenizer.lheading(src)) {
2091
+ src = src.substring(token.raw.length);
2092
+ tokens.push(token);
2093
+ continue;
2094
+ } // top-level paragraph
2095
+ // prevent paragraph consuming extensions by clipping 'src' to extension start
2096
+
2097
+
2098
+ cutSrc = src;
2099
+
2100
+ if (this.options.extensions && this.options.extensions.startBlock) {
2101
+ (function () {
2102
+ var startIndex = Infinity;
2103
+ var tempSrc = src.slice(1);
2104
+ var tempStart = void 0;
2105
+
2106
+ _this.options.extensions.startBlock.forEach(function (getStartIndex) {
2107
+ tempStart = getStartIndex.call({
2108
+ lexer: this
2109
+ }, tempSrc);
2110
+
2111
+ if (typeof tempStart === 'number' && tempStart >= 0) {
2112
+ startIndex = Math.min(startIndex, tempStart);
2113
+ }
2114
+ });
2115
+
2116
+ if (startIndex < Infinity && startIndex >= 0) {
2117
+ cutSrc = src.substring(0, startIndex + 1);
2118
+ }
2119
+ })();
2120
+ }
2121
+
2122
+ if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {
2123
+ lastToken = tokens[tokens.length - 1];
2124
+
2125
+ if (lastParagraphClipped && lastToken.type === 'paragraph') {
2126
+ lastToken.raw += '\n' + token.raw;
2127
+ lastToken.text += '\n' + token.text;
2128
+ this.inlineQueue.pop();
2129
+ this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
2130
+ } else {
2131
+ tokens.push(token);
2132
+ }
2133
+
2134
+ lastParagraphClipped = cutSrc.length !== src.length;
2135
+ src = src.substring(token.raw.length);
2136
+ continue;
2137
+ } // text
2138
+
2139
+
2140
+ if (token = this.tokenizer.text(src)) {
2141
+ src = src.substring(token.raw.length);
2142
+ lastToken = tokens[tokens.length - 1];
2143
+
2144
+ if (lastToken && lastToken.type === 'text') {
2145
+ lastToken.raw += '\n' + token.raw;
2146
+ lastToken.text += '\n' + token.text;
2147
+ this.inlineQueue.pop();
2148
+ this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
2149
+ } else {
2150
+ tokens.push(token);
2151
+ }
2152
+
2153
+ continue;
2154
+ }
2155
+
2156
+ if (src) {
2157
+ var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);
2158
+
2159
+ if (this.options.silent) {
2160
+ console.error(errMsg);
2161
+ break;
2162
+ } else {
2163
+ throw new Error(errMsg);
2164
+ }
2165
+ }
2166
+ }
2167
+
2168
+ this.state.top = true;
2169
+ return tokens;
2170
+ };
2171
+
2172
+ _proto.inline = function inline(src, tokens) {
2173
+ if (tokens === void 0) {
2174
+ tokens = [];
2175
+ }
2176
+
2177
+ this.inlineQueue.push({
2178
+ src: src,
2179
+ tokens: tokens
2180
+ });
2181
+ return tokens;
2182
+ }
2183
+ /**
2184
+ * Lexing/Compiling
2185
+ */
2186
+ ;
2187
+
2188
+ _proto.inlineTokens = function inlineTokens(src, tokens) {
2189
+ var _this2 = this;
2190
+
2191
+ if (tokens === void 0) {
2192
+ tokens = [];
2193
+ }
2194
+
2195
+ var token, lastToken, cutSrc; // String with links masked to avoid interference with em and strong
2196
+
2197
+ var maskedSrc = src;
2198
+ var match;
2199
+ var keepPrevChar, prevChar; // Mask out reflinks
2200
+
2201
+ if (this.tokens.links) {
2202
+ var links = Object.keys(this.tokens.links);
2203
+
2204
+ if (links.length > 0) {
2205
+ while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
2206
+ if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {
2207
+ maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
2208
+ }
2209
+ }
2210
+ }
2211
+ } // Mask out other blocks
2212
+
2213
+
2214
+ while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
2215
+ maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
2216
+ } // Mask out escaped em & strong delimiters
2217
+
2218
+
2219
+ while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) {
2220
+ maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);
2221
+ }
2222
+
2223
+ while (src) {
2224
+ if (!keepPrevChar) {
2225
+ prevChar = '';
2226
+ }
2227
+
2228
+ keepPrevChar = false; // extensions
2229
+
2230
+ if (this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some(function (extTokenizer) {
2231
+ if (token = extTokenizer.call({
2232
+ lexer: _this2
2233
+ }, src, tokens)) {
2234
+ src = src.substring(token.raw.length);
2235
+ tokens.push(token);
2236
+ return true;
2237
+ }
2238
+
2239
+ return false;
2240
+ })) {
2241
+ continue;
2242
+ } // escape
2243
+
2244
+
2245
+ if (token = this.tokenizer.escape(src)) {
2246
+ src = src.substring(token.raw.length);
2247
+ tokens.push(token);
2248
+ continue;
2249
+ } // tag
2250
+
2251
+
2252
+ if (token = this.tokenizer.tag(src)) {
2253
+ src = src.substring(token.raw.length);
2254
+ lastToken = tokens[tokens.length - 1];
2255
+
2256
+ if (lastToken && token.type === 'text' && lastToken.type === 'text') {
2257
+ lastToken.raw += token.raw;
2258
+ lastToken.text += token.text;
2259
+ } else {
2260
+ tokens.push(token);
2261
+ }
2262
+
2263
+ continue;
2264
+ } // link
2265
+
2266
+
2267
+ if (token = this.tokenizer.link(src)) {
2268
+ src = src.substring(token.raw.length);
2269
+ tokens.push(token);
2270
+ continue;
2271
+ } // reflink, nolink
2272
+
2273
+
2274
+ if (token = this.tokenizer.reflink(src, this.tokens.links)) {
2275
+ src = src.substring(token.raw.length);
2276
+ lastToken = tokens[tokens.length - 1];
2277
+
2278
+ if (lastToken && token.type === 'text' && lastToken.type === 'text') {
2279
+ lastToken.raw += token.raw;
2280
+ lastToken.text += token.text;
2281
+ } else {
2282
+ tokens.push(token);
2283
+ }
2284
+
2285
+ continue;
2286
+ } // em & strong
2287
+
2288
+
2289
+ if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {
2290
+ src = src.substring(token.raw.length);
2291
+ tokens.push(token);
2292
+ continue;
2293
+ } // code
2294
+
2295
+
2296
+ if (token = this.tokenizer.codespan(src)) {
2297
+ src = src.substring(token.raw.length);
2298
+ tokens.push(token);
2299
+ continue;
2300
+ } // br
2301
+
2302
+
2303
+ if (token = this.tokenizer.br(src)) {
2304
+ src = src.substring(token.raw.length);
2305
+ tokens.push(token);
2306
+ continue;
2307
+ } // del (gfm)
2308
+
2309
+
2310
+ if (token = this.tokenizer.del(src)) {
2311
+ src = src.substring(token.raw.length);
2312
+ tokens.push(token);
2313
+ continue;
2314
+ } // autolink
2315
+
2316
+
2317
+ if (token = this.tokenizer.autolink(src, mangle)) {
2318
+ src = src.substring(token.raw.length);
2319
+ tokens.push(token);
2320
+ continue;
2321
+ } // url (gfm)
2322
+
2323
+
2324
+ if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) {
2325
+ src = src.substring(token.raw.length);
2326
+ tokens.push(token);
2327
+ continue;
2328
+ } // text
2329
+ // prevent inlineText consuming extensions by clipping 'src' to extension start
2330
+
2331
+
2332
+ cutSrc = src;
2333
+
2334
+ if (this.options.extensions && this.options.extensions.startInline) {
2335
+ (function () {
2336
+ var startIndex = Infinity;
2337
+ var tempSrc = src.slice(1);
2338
+ var tempStart = void 0;
2339
+
2340
+ _this2.options.extensions.startInline.forEach(function (getStartIndex) {
2341
+ tempStart = getStartIndex.call({
2342
+ lexer: this
2343
+ }, tempSrc);
2344
+
2345
+ if (typeof tempStart === 'number' && tempStart >= 0) {
2346
+ startIndex = Math.min(startIndex, tempStart);
2347
+ }
2348
+ });
2349
+
2350
+ if (startIndex < Infinity && startIndex >= 0) {
2351
+ cutSrc = src.substring(0, startIndex + 1);
2352
+ }
2353
+ })();
2354
+ }
2355
+
2356
+ if (token = this.tokenizer.inlineText(cutSrc, smartypants)) {
2357
+ src = src.substring(token.raw.length);
2358
+
2359
+ if (token.raw.slice(-1) !== '_') {
2360
+ // Track prevChar before string of ____ started
2361
+ prevChar = token.raw.slice(-1);
2362
+ }
2363
+
2364
+ keepPrevChar = true;
2365
+ lastToken = tokens[tokens.length - 1];
2366
+
2367
+ if (lastToken && lastToken.type === 'text') {
2368
+ lastToken.raw += token.raw;
2369
+ lastToken.text += token.text;
2370
+ } else {
2371
+ tokens.push(token);
2372
+ }
2373
+
2374
+ continue;
2375
+ }
2376
+
2377
+ if (src) {
2378
+ var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);
2379
+
2380
+ if (this.options.silent) {
2381
+ console.error(errMsg);
2382
+ break;
2383
+ } else {
2384
+ throw new Error(errMsg);
2385
+ }
2386
+ }
2387
+ }
2388
+
2389
+ return tokens;
2390
+ };
2391
+
2392
+ _createClass(Lexer, null, [{
2393
+ key: "rules",
2394
+ get: function get() {
2395
+ return {
2396
+ block: block,
2397
+ inline: inline
2398
+ };
2399
+ }
2400
+ }]);
2401
+
2402
+ return Lexer;
2403
+ }();
2404
+
2405
+ /**
2406
+ * Renderer
2407
+ */
2408
+
2409
+ var Renderer = /*#__PURE__*/function () {
2410
+ function Renderer(options) {
2411
+ this.options = options || exports.defaults;
2412
+ }
2413
+
2414
+ var _proto = Renderer.prototype;
2415
+
2416
+ _proto.code = function code(_code, infostring, escaped) {
2417
+ var lang = (infostring || '').match(/\S*/)[0];
2418
+
2419
+ if (this.options.highlight) {
2420
+ var out = this.options.highlight(_code, lang);
2421
+
2422
+ if (out != null && out !== _code) {
2423
+ escaped = true;
2424
+ _code = out;
2425
+ }
2426
+ }
2427
+
2428
+ _code = _code.replace(/\n$/, '') + '\n';
2429
+
2430
+ if (!lang) {
2431
+ return '<pre><code>' + (escaped ? _code : escape(_code, true)) + '</code></pre>\n';
2432
+ }
2433
+
2434
+ return '<pre><code class="' + this.options.langPrefix + escape(lang, true) + '">' + (escaped ? _code : escape(_code, true)) + '</code></pre>\n';
2435
+ }
2436
+ /**
2437
+ * @param {string} quote
2438
+ */
2439
+ ;
2440
+
2441
+ _proto.blockquote = function blockquote(quote) {
2442
+ return "<blockquote>\n" + quote + "</blockquote>\n";
2443
+ };
2444
+
2445
+ _proto.html = function html(_html) {
2446
+ return _html;
2447
+ }
2448
+ /**
2449
+ * @param {string} text
2450
+ * @param {string} level
2451
+ * @param {string} raw
2452
+ * @param {any} slugger
2453
+ */
2454
+ ;
2455
+
2456
+ _proto.heading = function heading(text, level, raw, slugger) {
2457
+ if (this.options.headerIds) {
2458
+ var id = this.options.headerPrefix + slugger.slug(raw);
2459
+ return "<h" + level + " id=\"" + id + "\">" + text + "</h" + level + ">\n";
2460
+ } // ignore IDs
2461
+
2462
+
2463
+ return "<h" + level + ">" + text + "</h" + level + ">\n";
2464
+ };
2465
+
2466
+ _proto.hr = function hr() {
2467
+ return this.options.xhtml ? '<hr/>\n' : '<hr>\n';
2468
+ };
2469
+
2470
+ _proto.list = function list(body, ordered, start) {
2471
+ var type = ordered ? 'ol' : 'ul',
2472
+ startatt = ordered && start !== 1 ? ' start="' + start + '"' : '';
2473
+ return '<' + type + startatt + '>\n' + body + '</' + type + '>\n';
2474
+ }
2475
+ /**
2476
+ * @param {string} text
2477
+ */
2478
+ ;
2479
+
2480
+ _proto.listitem = function listitem(text) {
2481
+ return "<li>" + text + "</li>\n";
2482
+ };
2483
+
2484
+ _proto.checkbox = function checkbox(checked) {
2485
+ return '<input ' + (checked ? 'checked="" ' : '') + 'disabled="" type="checkbox"' + (this.options.xhtml ? ' /' : '') + '> ';
2486
+ }
2487
+ /**
2488
+ * @param {string} text
2489
+ */
2490
+ ;
2491
+
2492
+ _proto.paragraph = function paragraph(text) {
2493
+ return "<p>" + text + "</p>\n";
2494
+ }
2495
+ /**
2496
+ * @param {string} header
2497
+ * @param {string} body
2498
+ */
2499
+ ;
2500
+
2501
+ _proto.table = function table(header, body) {
2502
+ if (body) body = "<tbody>" + body + "</tbody>";
2503
+ return '<table>\n' + '<thead>\n' + header + '</thead>\n' + body + '</table>\n';
2504
+ }
2505
+ /**
2506
+ * @param {string} content
2507
+ */
2508
+ ;
2509
+
2510
+ _proto.tablerow = function tablerow(content) {
2511
+ return "<tr>\n" + content + "</tr>\n";
2512
+ };
2513
+
2514
+ _proto.tablecell = function tablecell(content, flags) {
2515
+ var type = flags.header ? 'th' : 'td';
2516
+ var tag = flags.align ? "<" + type + " align=\"" + flags.align + "\">" : "<" + type + ">";
2517
+ return tag + content + ("</" + type + ">\n");
2518
+ }
2519
+ /**
2520
+ * span level renderer
2521
+ * @param {string} text
2522
+ */
2523
+ ;
2524
+
2525
+ _proto.strong = function strong(text) {
2526
+ return "<strong>" + text + "</strong>";
2527
+ }
2528
+ /**
2529
+ * @param {string} text
2530
+ */
2531
+ ;
2532
+
2533
+ _proto.em = function em(text) {
2534
+ return "<em>" + text + "</em>";
2535
+ }
2536
+ /**
2537
+ * @param {string} text
2538
+ */
2539
+ ;
2540
+
2541
+ _proto.codespan = function codespan(text) {
2542
+ return "<code>" + text + "</code>";
2543
+ };
2544
+
2545
+ _proto.br = function br() {
2546
+ return this.options.xhtml ? '<br/>' : '<br>';
2547
+ }
2548
+ /**
2549
+ * @param {string} text
2550
+ */
2551
+ ;
2552
+
2553
+ _proto.del = function del(text) {
2554
+ return "<del>" + text + "</del>";
2555
+ }
2556
+ /**
2557
+ * @param {string} href
2558
+ * @param {string} title
2559
+ * @param {string} text
2560
+ */
2561
+ ;
2562
+
2563
+ _proto.link = function link(href, title, text) {
2564
+ href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
2565
+
2566
+ if (href === null) {
2567
+ return text;
2568
+ }
2569
+
2570
+ var out = '<a href="' + escape(href) + '"';
2571
+
2572
+ if (title) {
2573
+ out += ' title="' + title + '"';
2574
+ }
2575
+
2576
+ out += '>' + text + '</a>';
2577
+ return out;
2578
+ }
2579
+ /**
2580
+ * @param {string} href
2581
+ * @param {string} title
2582
+ * @param {string} text
2583
+ */
2584
+ ;
2585
+
2586
+ _proto.image = function image(href, title, text) {
2587
+ href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
2588
+
2589
+ if (href === null) {
2590
+ return text;
2591
+ }
2592
+
2593
+ var out = "<img src=\"" + href + "\" alt=\"" + text + "\"";
2594
+
2595
+ if (title) {
2596
+ out += " title=\"" + title + "\"";
2597
+ }
2598
+
2599
+ out += this.options.xhtml ? '/>' : '>';
2600
+ return out;
2601
+ };
2602
+
2603
+ _proto.text = function text(_text) {
2604
+ return _text;
2605
+ };
2606
+
2607
+ return Renderer;
2608
+ }();
2609
+
2610
+ /**
2611
+ * TextRenderer
2612
+ * returns only the textual part of the token
2613
+ */
2614
+ var TextRenderer = /*#__PURE__*/function () {
2615
+ function TextRenderer() {}
2616
+
2617
+ var _proto = TextRenderer.prototype;
2618
+
2619
+ // no need for block level renderers
2620
+ _proto.strong = function strong(text) {
2621
+ return text;
2622
+ };
2623
+
2624
+ _proto.em = function em(text) {
2625
+ return text;
2626
+ };
2627
+
2628
+ _proto.codespan = function codespan(text) {
2629
+ return text;
2630
+ };
2631
+
2632
+ _proto.del = function del(text) {
2633
+ return text;
2634
+ };
2635
+
2636
+ _proto.html = function html(text) {
2637
+ return text;
2638
+ };
2639
+
2640
+ _proto.text = function text(_text) {
2641
+ return _text;
2642
+ };
2643
+
2644
+ _proto.link = function link(href, title, text) {
2645
+ return '' + text;
2646
+ };
2647
+
2648
+ _proto.image = function image(href, title, text) {
2649
+ return '' + text;
2650
+ };
2651
+
2652
+ _proto.br = function br() {
2653
+ return '';
2654
+ };
2655
+
2656
+ return TextRenderer;
2657
+ }();
2658
+
2659
+ /**
2660
+ * Slugger generates header id
2661
+ */
2662
+ var Slugger = /*#__PURE__*/function () {
2663
+ function Slugger() {
2664
+ this.seen = {};
2665
+ }
2666
+ /**
2667
+ * @param {string} value
2668
+ */
2669
+
2670
+
2671
+ var _proto = Slugger.prototype;
2672
+
2673
+ _proto.serialize = function serialize(value) {
2674
+ return value.toLowerCase().trim() // remove html tags
2675
+ .replace(/<[!\/a-z].*?>/ig, '') // remove unwanted chars
2676
+ .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '').replace(/\s/g, '-');
2677
+ }
2678
+ /**
2679
+ * Finds the next safe (unique) slug to use
2680
+ * @param {string} originalSlug
2681
+ * @param {boolean} isDryRun
2682
+ */
2683
+ ;
2684
+
2685
+ _proto.getNextSafeSlug = function getNextSafeSlug(originalSlug, isDryRun) {
2686
+ var slug = originalSlug;
2687
+ var occurenceAccumulator = 0;
2688
+
2689
+ if (this.seen.hasOwnProperty(slug)) {
2690
+ occurenceAccumulator = this.seen[originalSlug];
2691
+
2692
+ do {
2693
+ occurenceAccumulator++;
2694
+ slug = originalSlug + '-' + occurenceAccumulator;
2695
+ } while (this.seen.hasOwnProperty(slug));
2696
+ }
2697
+
2698
+ if (!isDryRun) {
2699
+ this.seen[originalSlug] = occurenceAccumulator;
2700
+ this.seen[slug] = 0;
2701
+ }
2702
+
2703
+ return slug;
2704
+ }
2705
+ /**
2706
+ * Convert string to unique id
2707
+ * @param {object} [options]
2708
+ * @param {boolean} [options.dryrun] Generates the next unique slug without
2709
+ * updating the internal accumulator.
2710
+ */
2711
+ ;
2712
+
2713
+ _proto.slug = function slug(value, options) {
2714
+ if (options === void 0) {
2715
+ options = {};
2716
+ }
2717
+
2718
+ var slug = this.serialize(value);
2719
+ return this.getNextSafeSlug(slug, options.dryrun);
2720
+ };
2721
+
2722
+ return Slugger;
2723
+ }();
2724
+
2725
+ /**
2726
+ * Parsing & Compiling
2727
+ */
2728
+
2729
+ var Parser = /*#__PURE__*/function () {
2730
+ function Parser(options) {
2731
+ this.options = options || exports.defaults;
2732
+ this.options.renderer = this.options.renderer || new Renderer();
2733
+ this.renderer = this.options.renderer;
2734
+ this.renderer.options = this.options;
2735
+ this.textRenderer = new TextRenderer();
2736
+ this.slugger = new Slugger();
2737
+ }
2738
+ /**
2739
+ * Static Parse Method
2740
+ */
2741
+
2742
+
2743
+ Parser.parse = function parse(tokens, options) {
2744
+ var parser = new Parser(options);
2745
+ return parser.parse(tokens);
2746
+ }
2747
+ /**
2748
+ * Static Parse Inline Method
2749
+ */
2750
+ ;
2751
+
2752
+ Parser.parseInline = function parseInline(tokens, options) {
2753
+ var parser = new Parser(options);
2754
+ return parser.parseInline(tokens);
2755
+ }
2756
+ /**
2757
+ * Parse Loop
2758
+ */
2759
+ ;
2760
+
2761
+ var _proto = Parser.prototype;
2762
+
2763
+ _proto.parse = function parse(tokens, top) {
2764
+ if (top === void 0) {
2765
+ top = true;
2766
+ }
2767
+
2768
+ var out = '',
2769
+ i,
2770
+ j,
2771
+ k,
2772
+ l2,
2773
+ l3,
2774
+ row,
2775
+ cell,
2776
+ header,
2777
+ body,
2778
+ token,
2779
+ ordered,
2780
+ start,
2781
+ loose,
2782
+ itemBody,
2783
+ item,
2784
+ checked,
2785
+ task,
2786
+ checkbox,
2787
+ ret;
2788
+ var l = tokens.length;
2789
+
2790
+ for (i = 0; i < l; i++) {
2791
+ token = tokens[i]; // Run any renderer extensions
2792
+
2793
+ if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {
2794
+ ret = this.options.extensions.renderers[token.type].call({
2795
+ parser: this
2796
+ }, token);
2797
+
2798
+ if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) {
2799
+ out += ret || '';
2800
+ continue;
2801
+ }
2802
+ }
2803
+
2804
+ switch (token.type) {
2805
+ case 'space':
2806
+ {
2807
+ continue;
2808
+ }
2809
+
2810
+ case 'hr':
2811
+ {
2812
+ out += this.renderer.hr();
2813
+ continue;
2814
+ }
2815
+
2816
+ case 'heading':
2817
+ {
2818
+ out += this.renderer.heading(this.parseInline(token.tokens), token.depth, unescape(this.parseInline(token.tokens, this.textRenderer)), this.slugger);
2819
+ continue;
2820
+ }
2821
+
2822
+ case 'code':
2823
+ {
2824
+ out += this.renderer.code(token.text, token.lang, token.escaped);
2825
+ continue;
2826
+ }
2827
+
2828
+ case 'table':
2829
+ {
2830
+ header = ''; // header
2831
+
2832
+ cell = '';
2833
+ l2 = token.header.length;
2834
+
2835
+ for (j = 0; j < l2; j++) {
2836
+ cell += this.renderer.tablecell(this.parseInline(token.header[j].tokens), {
2837
+ header: true,
2838
+ align: token.align[j]
2839
+ });
2840
+ }
2841
+
2842
+ header += this.renderer.tablerow(cell);
2843
+ body = '';
2844
+ l2 = token.rows.length;
2845
+
2846
+ for (j = 0; j < l2; j++) {
2847
+ row = token.rows[j];
2848
+ cell = '';
2849
+ l3 = row.length;
2850
+
2851
+ for (k = 0; k < l3; k++) {
2852
+ cell += this.renderer.tablecell(this.parseInline(row[k].tokens), {
2853
+ header: false,
2854
+ align: token.align[k]
2855
+ });
2856
+ }
2857
+
2858
+ body += this.renderer.tablerow(cell);
2859
+ }
2860
+
2861
+ out += this.renderer.table(header, body);
2862
+ continue;
2863
+ }
2864
+
2865
+ case 'blockquote':
2866
+ {
2867
+ body = this.parse(token.tokens);
2868
+ out += this.renderer.blockquote(body);
2869
+ continue;
2870
+ }
2871
+
2872
+ case 'list':
2873
+ {
2874
+ ordered = token.ordered;
2875
+ start = token.start;
2876
+ loose = token.loose;
2877
+ l2 = token.items.length;
2878
+ body = '';
2879
+
2880
+ for (j = 0; j < l2; j++) {
2881
+ item = token.items[j];
2882
+ checked = item.checked;
2883
+ task = item.task;
2884
+ itemBody = '';
2885
+
2886
+ if (item.task) {
2887
+ checkbox = this.renderer.checkbox(checked);
2888
+
2889
+ if (loose) {
2890
+ if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {
2891
+ item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;
2892
+
2893
+ if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {
2894
+ item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;
2895
+ }
2896
+ } else {
2897
+ item.tokens.unshift({
2898
+ type: 'text',
2899
+ text: checkbox
2900
+ });
2901
+ }
2902
+ } else {
2903
+ itemBody += checkbox;
2904
+ }
2905
+ }
2906
+
2907
+ itemBody += this.parse(item.tokens, loose);
2908
+ body += this.renderer.listitem(itemBody, task, checked);
2909
+ }
2910
+
2911
+ out += this.renderer.list(body, ordered, start);
2912
+ continue;
2913
+ }
2914
+
2915
+ case 'html':
2916
+ {
2917
+ // TODO parse inline content if parameter markdown=1
2918
+ out += this.renderer.html(token.text);
2919
+ continue;
2920
+ }
2921
+
2922
+ case 'paragraph':
2923
+ {
2924
+ out += this.renderer.paragraph(this.parseInline(token.tokens));
2925
+ continue;
2926
+ }
2927
+
2928
+ case 'text':
2929
+ {
2930
+ body = token.tokens ? this.parseInline(token.tokens) : token.text;
2931
+
2932
+ while (i + 1 < l && tokens[i + 1].type === 'text') {
2933
+ token = tokens[++i];
2934
+ body += '\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);
2935
+ }
2936
+
2937
+ out += top ? this.renderer.paragraph(body) : body;
2938
+ continue;
2939
+ }
2940
+
2941
+ default:
2942
+ {
2943
+ var errMsg = 'Token with "' + token.type + '" type was not found.';
2944
+
2945
+ if (this.options.silent) {
2946
+ console.error(errMsg);
2947
+ return;
2948
+ } else {
2949
+ throw new Error(errMsg);
2950
+ }
2951
+ }
2952
+ }
2953
+ }
2954
+
2955
+ return out;
2956
+ }
2957
+ /**
2958
+ * Parse Inline Tokens
2959
+ */
2960
+ ;
2961
+
2962
+ _proto.parseInline = function parseInline(tokens, renderer) {
2963
+ renderer = renderer || this.renderer;
2964
+ var out = '',
2965
+ i,
2966
+ token,
2967
+ ret;
2968
+ var l = tokens.length;
2969
+
2970
+ for (i = 0; i < l; i++) {
2971
+ token = tokens[i]; // Run any renderer extensions
2972
+
2973
+ if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {
2974
+ ret = this.options.extensions.renderers[token.type].call({
2975
+ parser: this
2976
+ }, token);
2977
+
2978
+ if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {
2979
+ out += ret || '';
2980
+ continue;
2981
+ }
2982
+ }
2983
+
2984
+ switch (token.type) {
2985
+ case 'escape':
2986
+ {
2987
+ out += renderer.text(token.text);
2988
+ break;
2989
+ }
2990
+
2991
+ case 'html':
2992
+ {
2993
+ out += renderer.html(token.text);
2994
+ break;
2995
+ }
2996
+
2997
+ case 'link':
2998
+ {
2999
+ out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));
3000
+ break;
3001
+ }
3002
+
3003
+ case 'image':
3004
+ {
3005
+ out += renderer.image(token.href, token.title, token.text);
3006
+ break;
3007
+ }
3008
+
3009
+ case 'strong':
3010
+ {
3011
+ out += renderer.strong(this.parseInline(token.tokens, renderer));
3012
+ break;
3013
+ }
3014
+
3015
+ case 'em':
3016
+ {
3017
+ out += renderer.em(this.parseInline(token.tokens, renderer));
3018
+ break;
3019
+ }
3020
+
3021
+ case 'codespan':
3022
+ {
3023
+ out += renderer.codespan(token.text);
3024
+ break;
3025
+ }
3026
+
3027
+ case 'br':
3028
+ {
3029
+ out += renderer.br();
3030
+ break;
3031
+ }
3032
+
3033
+ case 'del':
3034
+ {
3035
+ out += renderer.del(this.parseInline(token.tokens, renderer));
3036
+ break;
3037
+ }
3038
+
3039
+ case 'text':
3040
+ {
3041
+ out += renderer.text(token.text);
3042
+ break;
3043
+ }
3044
+
3045
+ default:
3046
+ {
3047
+ var errMsg = 'Token with "' + token.type + '" type was not found.';
3048
+
3049
+ if (this.options.silent) {
3050
+ console.error(errMsg);
3051
+ return;
3052
+ } else {
3053
+ throw new Error(errMsg);
3054
+ }
3055
+ }
3056
+ }
3057
+ }
3058
+
3059
+ return out;
3060
+ };
3061
+
3062
+ return Parser;
3063
+ }();
3064
+
3065
+ /**
3066
+ * Marked
3067
+ */
3068
+
3069
+ function marked(src, opt, callback) {
3070
+ // throw error in case of non string input
3071
+ if (typeof src === 'undefined' || src === null) {
3072
+ throw new Error('marked(): input parameter is undefined or null');
3073
+ }
3074
+
3075
+ if (typeof src !== 'string') {
3076
+ throw new Error('marked(): input parameter is of type ' + Object.prototype.toString.call(src) + ', string expected');
3077
+ }
3078
+
3079
+ if (typeof opt === 'function') {
3080
+ callback = opt;
3081
+ opt = null;
3082
+ }
3083
+
3084
+ opt = merge({}, marked.defaults, opt || {});
3085
+ checkSanitizeDeprecation(opt);
3086
+
3087
+ if (callback) {
3088
+ var highlight = opt.highlight;
3089
+ var tokens;
3090
+
3091
+ try {
3092
+ tokens = Lexer.lex(src, opt);
3093
+ } catch (e) {
3094
+ return callback(e);
3095
+ }
3096
+
3097
+ var done = function done(err) {
3098
+ var out;
3099
+
3100
+ if (!err) {
3101
+ try {
3102
+ if (opt.walkTokens) {
3103
+ marked.walkTokens(tokens, opt.walkTokens);
3104
+ }
3105
+
3106
+ out = Parser.parse(tokens, opt);
3107
+ } catch (e) {
3108
+ err = e;
3109
+ }
3110
+ }
3111
+
3112
+ opt.highlight = highlight;
3113
+ return err ? callback(err) : callback(null, out);
3114
+ };
3115
+
3116
+ if (!highlight || highlight.length < 3) {
3117
+ return done();
3118
+ }
3119
+
3120
+ delete opt.highlight;
3121
+ if (!tokens.length) return done();
3122
+ var pending = 0;
3123
+ marked.walkTokens(tokens, function (token) {
3124
+ if (token.type === 'code') {
3125
+ pending++;
3126
+ setTimeout(function () {
3127
+ highlight(token.text, token.lang, function (err, code) {
3128
+ if (err) {
3129
+ return done(err);
3130
+ }
3131
+
3132
+ if (code != null && code !== token.text) {
3133
+ token.text = code;
3134
+ token.escaped = true;
3135
+ }
3136
+
3137
+ pending--;
3138
+
3139
+ if (pending === 0) {
3140
+ done();
3141
+ }
3142
+ });
3143
+ }, 0);
3144
+ }
3145
+ });
3146
+
3147
+ if (pending === 0) {
3148
+ done();
3149
+ }
3150
+
3151
+ return;
3152
+ }
3153
+
3154
+ function onError(e) {
3155
+ e.message += '\nPlease report this to https://github.com/markedjs/marked.';
3156
+
3157
+ if (opt.silent) {
3158
+ return '<p>An error occurred:</p><pre>' + escape(e.message + '', true) + '</pre>';
3159
+ }
3160
+
3161
+ throw e;
3162
+ }
3163
+
3164
+ try {
3165
+ var _tokens = Lexer.lex(src, opt);
3166
+
3167
+ if (opt.walkTokens) {
3168
+ if (opt.async) {
3169
+ return Promise.all(marked.walkTokens(_tokens, opt.walkTokens)).then(function () {
3170
+ return Parser.parse(_tokens, opt);
3171
+ })["catch"](onError);
3172
+ }
3173
+
3174
+ marked.walkTokens(_tokens, opt.walkTokens);
3175
+ }
3176
+
3177
+ return Parser.parse(_tokens, opt);
3178
+ } catch (e) {
3179
+ onError(e);
3180
+ }
3181
+ }
3182
+ /**
3183
+ * Options
3184
+ */
3185
+
3186
+ marked.options = marked.setOptions = function (opt) {
3187
+ merge(marked.defaults, opt);
3188
+ changeDefaults(marked.defaults);
3189
+ return marked;
3190
+ };
3191
+
3192
+ marked.getDefaults = getDefaults;
3193
+ marked.defaults = exports.defaults;
3194
+ /**
3195
+ * Use Extension
3196
+ */
3197
+
3198
+ marked.use = function () {
3199
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3200
+ args[_key] = arguments[_key];
3201
+ }
3202
+
3203
+ var opts = merge.apply(void 0, [{}].concat(args));
3204
+ var extensions = marked.defaults.extensions || {
3205
+ renderers: {},
3206
+ childTokens: {}
3207
+ };
3208
+ var hasExtensions;
3209
+ args.forEach(function (pack) {
3210
+ // ==-- Parse "addon" extensions --== //
3211
+ if (pack.extensions) {
3212
+ hasExtensions = true;
3213
+ pack.extensions.forEach(function (ext) {
3214
+ if (!ext.name) {
3215
+ throw new Error('extension name required');
3216
+ }
3217
+
3218
+ if (ext.renderer) {
3219
+ // Renderer extensions
3220
+ var prevRenderer = extensions.renderers ? extensions.renderers[ext.name] : null;
3221
+
3222
+ if (prevRenderer) {
3223
+ // Replace extension with func to run new extension but fall back if false
3224
+ extensions.renderers[ext.name] = function () {
3225
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
3226
+ args[_key2] = arguments[_key2];
3227
+ }
3228
+
3229
+ var ret = ext.renderer.apply(this, args);
3230
+
3231
+ if (ret === false) {
3232
+ ret = prevRenderer.apply(this, args);
3233
+ }
3234
+
3235
+ return ret;
3236
+ };
3237
+ } else {
3238
+ extensions.renderers[ext.name] = ext.renderer;
3239
+ }
3240
+ }
3241
+
3242
+ if (ext.tokenizer) {
3243
+ // Tokenizer Extensions
3244
+ if (!ext.level || ext.level !== 'block' && ext.level !== 'inline') {
3245
+ throw new Error("extension level must be 'block' or 'inline'");
3246
+ }
3247
+
3248
+ if (extensions[ext.level]) {
3249
+ extensions[ext.level].unshift(ext.tokenizer);
3250
+ } else {
3251
+ extensions[ext.level] = [ext.tokenizer];
3252
+ }
3253
+
3254
+ if (ext.start) {
3255
+ // Function to check for start of token
3256
+ if (ext.level === 'block') {
3257
+ if (extensions.startBlock) {
3258
+ extensions.startBlock.push(ext.start);
3259
+ } else {
3260
+ extensions.startBlock = [ext.start];
3261
+ }
3262
+ } else if (ext.level === 'inline') {
3263
+ if (extensions.startInline) {
3264
+ extensions.startInline.push(ext.start);
3265
+ } else {
3266
+ extensions.startInline = [ext.start];
3267
+ }
3268
+ }
3269
+ }
3270
+ }
3271
+
3272
+ if (ext.childTokens) {
3273
+ // Child tokens to be visited by walkTokens
3274
+ extensions.childTokens[ext.name] = ext.childTokens;
3275
+ }
3276
+ });
3277
+ } // ==-- Parse "overwrite" extensions --== //
3278
+
3279
+
3280
+ if (pack.renderer) {
3281
+ (function () {
3282
+ var renderer = marked.defaults.renderer || new Renderer();
3283
+
3284
+ var _loop = function _loop(prop) {
3285
+ var prevRenderer = renderer[prop]; // Replace renderer with func to run extension, but fall back if false
3286
+
3287
+ renderer[prop] = function () {
3288
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
3289
+ args[_key3] = arguments[_key3];
3290
+ }
3291
+
3292
+ var ret = pack.renderer[prop].apply(renderer, args);
3293
+
3294
+ if (ret === false) {
3295
+ ret = prevRenderer.apply(renderer, args);
3296
+ }
3297
+
3298
+ return ret;
3299
+ };
3300
+ };
3301
+
3302
+ for (var prop in pack.renderer) {
3303
+ _loop(prop);
3304
+ }
3305
+
3306
+ opts.renderer = renderer;
3307
+ })();
3308
+ }
3309
+
3310
+ if (pack.tokenizer) {
3311
+ (function () {
3312
+ var tokenizer = marked.defaults.tokenizer || new Tokenizer();
3313
+
3314
+ var _loop2 = function _loop2(prop) {
3315
+ var prevTokenizer = tokenizer[prop]; // Replace tokenizer with func to run extension, but fall back if false
3316
+
3317
+ tokenizer[prop] = function () {
3318
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
3319
+ args[_key4] = arguments[_key4];
3320
+ }
3321
+
3322
+ var ret = pack.tokenizer[prop].apply(tokenizer, args);
3323
+
3324
+ if (ret === false) {
3325
+ ret = prevTokenizer.apply(tokenizer, args);
3326
+ }
3327
+
3328
+ return ret;
3329
+ };
3330
+ };
3331
+
3332
+ for (var prop in pack.tokenizer) {
3333
+ _loop2(prop);
3334
+ }
3335
+
3336
+ opts.tokenizer = tokenizer;
3337
+ })();
3338
+ } // ==-- Parse WalkTokens extensions --== //
3339
+
3340
+
3341
+ if (pack.walkTokens) {
3342
+ var _walkTokens = marked.defaults.walkTokens;
3343
+
3344
+ opts.walkTokens = function (token) {
3345
+ var values = [];
3346
+ values.push(pack.walkTokens.call(this, token));
3347
+
3348
+ if (_walkTokens) {
3349
+ values = values.concat(_walkTokens.call(this, token));
3350
+ }
3351
+
3352
+ return values;
3353
+ };
3354
+ }
3355
+
3356
+ if (hasExtensions) {
3357
+ opts.extensions = extensions;
3358
+ }
3359
+
3360
+ marked.setOptions(opts);
3361
+ });
3362
+ };
3363
+ /**
3364
+ * Run callback for every token
3365
+ */
3366
+
3367
+
3368
+ marked.walkTokens = function (tokens, callback) {
3369
+ var values = [];
3370
+
3371
+ var _loop3 = function _loop3() {
3372
+ var token = _step.value;
3373
+ values = values.concat(callback.call(marked, token));
3374
+
3375
+ switch (token.type) {
3376
+ case 'table':
3377
+ {
3378
+ for (var _iterator2 = _createForOfIteratorHelperLoose(token.header), _step2; !(_step2 = _iterator2()).done;) {
3379
+ var cell = _step2.value;
3380
+ values = values.concat(marked.walkTokens(cell.tokens, callback));
3381
+ }
3382
+
3383
+ for (var _iterator3 = _createForOfIteratorHelperLoose(token.rows), _step3; !(_step3 = _iterator3()).done;) {
3384
+ var row = _step3.value;
3385
+
3386
+ for (var _iterator4 = _createForOfIteratorHelperLoose(row), _step4; !(_step4 = _iterator4()).done;) {
3387
+ var _cell = _step4.value;
3388
+ values = values.concat(marked.walkTokens(_cell.tokens, callback));
3389
+ }
3390
+ }
3391
+
3392
+ break;
3393
+ }
3394
+
3395
+ case 'list':
3396
+ {
3397
+ values = values.concat(marked.walkTokens(token.items, callback));
3398
+ break;
3399
+ }
3400
+
3401
+ default:
3402
+ {
3403
+ if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) {
3404
+ // Walk any extensions
3405
+ marked.defaults.extensions.childTokens[token.type].forEach(function (childTokens) {
3406
+ values = values.concat(marked.walkTokens(token[childTokens], callback));
3407
+ });
3408
+ } else if (token.tokens) {
3409
+ values = values.concat(marked.walkTokens(token.tokens, callback));
3410
+ }
3411
+ }
3412
+ }
3413
+ };
3414
+
3415
+ for (var _iterator = _createForOfIteratorHelperLoose(tokens), _step; !(_step = _iterator()).done;) {
3416
+ _loop3();
3417
+ }
3418
+
3419
+ return values;
3420
+ };
3421
+ /**
3422
+ * Parse Inline
3423
+ * @param {string} src
3424
+ */
3425
+
3426
+
3427
+ marked.parseInline = function (src, opt) {
3428
+ // throw error in case of non string input
3429
+ if (typeof src === 'undefined' || src === null) {
3430
+ throw new Error('marked.parseInline(): input parameter is undefined or null');
3431
+ }
3432
+
3433
+ if (typeof src !== 'string') {
3434
+ throw new Error('marked.parseInline(): input parameter is of type ' + Object.prototype.toString.call(src) + ', string expected');
3435
+ }
3436
+
3437
+ opt = merge({}, marked.defaults, opt || {});
3438
+ checkSanitizeDeprecation(opt);
3439
+
3440
+ try {
3441
+ var tokens = Lexer.lexInline(src, opt);
3442
+
3443
+ if (opt.walkTokens) {
3444
+ marked.walkTokens(tokens, opt.walkTokens);
3445
+ }
3446
+
3447
+ return Parser.parseInline(tokens, opt);
3448
+ } catch (e) {
3449
+ e.message += '\nPlease report this to https://github.com/markedjs/marked.';
3450
+
3451
+ if (opt.silent) {
3452
+ return '<p>An error occurred:</p><pre>' + escape(e.message + '', true) + '</pre>';
3453
+ }
3454
+
3455
+ throw e;
3456
+ }
3457
+ };
3458
+ /**
3459
+ * Expose
3460
+ */
3461
+
3462
+
3463
+ marked.Parser = Parser;
3464
+ marked.parser = Parser.parse;
3465
+ marked.Renderer = Renderer;
3466
+ marked.TextRenderer = TextRenderer;
3467
+ marked.Lexer = Lexer;
3468
+ marked.lexer = Lexer.lex;
3469
+ marked.Tokenizer = Tokenizer;
3470
+ marked.Slugger = Slugger;
3471
+ marked.parse = marked;
3472
+ var options = marked.options;
3473
+ var setOptions = marked.setOptions;
3474
+ var use = marked.use;
3475
+ var walkTokens = marked.walkTokens;
3476
+ var parseInline = marked.parseInline;
3477
+ var parse = marked;
3478
+ var parser = Parser.parse;
3479
+ var lexer = Lexer.lex;
3480
+
3481
+ exports.Lexer = Lexer;
3482
+ exports.Parser = Parser;
3483
+ exports.Renderer = Renderer;
3484
+ exports.Slugger = Slugger;
3485
+ exports.TextRenderer = TextRenderer;
3486
+ exports.Tokenizer = Tokenizer;
3487
+ exports.getDefaults = getDefaults;
3488
+ exports.lexer = lexer;
3489
+ exports.marked = marked;
3490
+ exports.options = options;
3491
+ exports.parse = parse;
3492
+ exports.parseInline = parseInline;
3493
+ exports.parser = parser;
3494
+ exports.setOptions = setOptions;
3495
+ exports.use = use;
3496
+ exports.walkTokens = walkTokens;
3497
+
3498
+ Object.defineProperty(exports, '__esModule', { value: true });
3499
+
3500
+ }));
3501
+
3502
+
434
3503
  /***/ }),
435
3504
 
436
3505
  /***/ "7c81":
@@ -813,7 +3882,7 @@ if (typeof window !== 'undefined') {
813
3882
  // Indicate to webpack that this file can be concatenated
814
3883
  /* harmony default export */ var setPublicPath = (null);
815
3884
 
816
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0d18a846-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SideBar.vue?vue&type=template&id=313390a9&scoped=true&
3885
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"590ce1ae-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SideBar.vue?vue&type=template&id=313390a9&scoped=true&
817
3886
  var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:"container"},[(!_vm.drawerOpen)?_c('div',{staticClass:"open-tab",on:{"click":_vm.toggleDrawer}},[_c('i',{staticClass:"el-icon-arrow-left"})]):_vm._e(),_c('el-drawer',{staticClass:"side-bar",attrs:{"custom-class":"my-drawer","visible":_vm.drawerOpen,"appendToBody":false,"modal-append-to-body":false,"size":"550","with-header":false,"wrapperClosable":false,"modal":false},on:{"update:visible":function($event){_vm.drawerOpen=$event}}},[_c('div',{staticClass:"box-card"},[(_vm.drawerOpen)?_c('div',{staticClass:"close-tab",on:{"click":_vm.close}},[_c('i',{staticClass:"el-icon-arrow-right"})]):_vm._e(),_c('div',{staticClass:"sidebar-container"},[(_vm.tabs.length > 1)?_c('tabs',{attrs:{"tabTitles":_vm.tabs,"activeId":_vm.activeId},on:{"titleClicked":_vm.tabClicked}}):_vm._e(),_vm._l((_vm.tabs),function(tab){return [_c('sidebar-content',{directives:[{name:"show",rawName:"v-show",value:(tab.id===_vm.activeId),expression:"tab.id===activeId"}],key:tab.id,ref:tab.id,refInFor:true,staticClass:"sidebar-content-container",attrs:{"contextCardEntry":tab.contextCard,"envVars":_vm.envVars},on:{"search-changed":function($event){return _vm.searchChanged(tab.id, $event)}}})]})],2)])])],1)}
818
3887
  var staticRenderFns = []
819
3888
 
@@ -888,7 +3957,7 @@ var en_default = /*#__PURE__*/__webpack_require__.n(en_);
888
3957
  var locale_ = __webpack_require__("7f9f");
889
3958
  var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
890
3959
 
891
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0d18a846-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SidebarContent.vue?vue&type=template&id=13cf0a2e&scoped=true&
3960
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"590ce1ae-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SidebarContent.vue?vue&type=template&id=13cf0a2e&scoped=true&
892
3961
  var SidebarContentvue_type_template_id_13cf0a2e_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-card',{staticClass:"content-card",attrs:{"body-style":_vm.bodyStyle}},[_c('div',{staticClass:"header",attrs:{"slot":"header"},slot:"header"},[(_vm.contextCardEntry && _vm.contextCardEnabled)?_c('context-card',{attrs:{"entry":_vm.contextCardEntry,"envVars":_vm.envVars}}):_vm._e(),_c('el-input',{staticClass:"search-input",attrs:{"placeholder":"Search","clearable":""},on:{"clear":_vm.clearSearchClicked},nativeOn:{"keyup":function($event){return _vm.searchEvent($event)}},model:{value:(_vm.searchInput),callback:function ($$v) {_vm.searchInput=$$v},expression:"searchInput"}}),_c('el-button',{staticClass:"button",on:{"click":_vm.searchEvent}},[_vm._v("Search")])],1),_c('SearchFilters',{ref:"filtersRef",staticClass:"filters",attrs:{"entry":_vm.filterEntry,"envVars":_vm.envVars},on:{"filterResults":_vm.filterUpdate,"numberPerPage":_vm.numberPerPageUpdate,"loading":_vm.filtersLoading,"cascaderReady":_vm.cascaderReady}}),_c('div',{directives:[{name:"loading",rawName:"v-loading",value:(_vm.loadingCards),expression:"loadingCards"}],ref:"content",staticClass:"content scrollbar"},[(_vm.results.length === 0 && !_vm.loadingCards)?_c('div',{staticClass:"error-feedback"},[_vm._v("No results found - Please change your search / filter criteria.")]):_vm._e(),_vm._l((_vm.results),function(result){return _c('div',{key:result.doi,staticClass:"step-item"},[_c('DatasetCard',{attrs:{"entry":result,"envVars":_vm.envVars},on:{"contextUpdate":_vm.contextCardUpdate}})],1)}),_c('el-pagination',{staticClass:"pagination",attrs:{"current-page":_vm.page,"hide-on-single-page":"","large":"","layout":"prev, pager, next","page-size":_vm.numberPerPage,"total":_vm.numberOfHits},on:{"update:currentPage":function($event){_vm.page=$event},"update:current-page":function($event){_vm.page=$event},"current-change":_vm.pageChange}})],2)],1)}
893
3962
  var SidebarContentvue_type_template_id_13cf0a2e_scoped_true_staticRenderFns = []
894
3963
 
@@ -1069,7 +4138,7 @@ var button_css_ = __webpack_require__("26bc");
1069
4138
  var button_ = __webpack_require__("5d8c");
1070
4139
  var button_default = /*#__PURE__*/__webpack_require__.n(button_);
1071
4140
 
1072
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0d18a846-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SearchFilters.vue?vue&type=template&id=7f7ea160&scoped=true&
4141
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"590ce1ae-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SearchFilters.vue?vue&type=template&id=7f7ea160&scoped=true&
1073
4142
  var SearchFiltersvue_type_template_id_7f7ea160_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"filters"},[_c('map-svg-sprite-color'),_c('transition',{attrs:{"name":"el-zoom-in-top"}},[_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.showFilters),expression:"showFilters"}],staticClass:"search-filters transition-box"},[_c('custom-cascader',{ref:"cascader",staticClass:"cascader",attrs:{"placeholder":"","collapse-tags":true,"options":_vm.options,"props":_vm.props,"show-all-levels":false,"append-to-body":false},on:{"change":function($event){return _vm.cascadeEvent($event)},"expand-change":_vm.cascadeExpandChange,"tags-changed":_vm.tagsChangedCallback},model:{value:(_vm.cascadeSelected),callback:function ($$v) {_vm.cascadeSelected=$$v},expression:"cascadeSelected"}}),(_vm.showFiltersText)?_c('div',{staticClass:"filter-default-value"},[_vm._v(" Filters ")]):_vm._e(),_c('el-popover',{attrs:{"title":"How do filters work?","width":"250","trigger":"hover","append-to-body":false,"popper-class":"popover"}},[_c('map-svg-icon',{staticClass:"help",attrs:{"slot":"reference","icon":"help"},slot:"reference"}),_c('div',[_c('strong',[_vm._v("Within categories:")]),_vm._v(" OR "),_c('br'),_vm._v(" example: 'heart' OR 'colon' "),_c('br'),_c('br'),_c('strong',[_vm._v("Between categories:")]),_vm._v(" AND "),_c('br'),_vm._v(" example: 'rat' AND 'lung' ")])],1)],1)]),_c('el-select',{staticClass:"number-shown-select",attrs:{"placeholder":"10"},on:{"change":function($event){return _vm.numberShownChanged($event)}},model:{value:(_vm.numberShown),callback:function ($$v) {_vm.numberShown=$$v},expression:"numberShown"}},_vm._l((_vm.numberDatasetsShown),function(item){return _c('el-option',{key:item,attrs:{"label":item,"value":item}})}),1),_c('span',{staticClass:"dataset-results-feedback"},[_vm._v(_vm._s(this.numberOfResultsText))])],1)}
1074
4143
  var SearchFiltersvue_type_template_id_7f7ea160_scoped_true_staticRenderFns = []
1075
4144
 
@@ -2274,14 +5343,14 @@ var SearchFilters_component = normalizeComponent(
2274
5343
  )
2275
5344
 
2276
5345
  /* harmony default export */ var SearchFilters = (SearchFilters_component.exports);
2277
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0d18a846-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/DatasetCard.vue?vue&type=template&id=bf193158&scoped=true&
5346
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"590ce1ae-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/DatasetCard.vue?vue&type=template&id=bf193158&scoped=true&
2278
5347
  var DatasetCardvue_type_template_id_bf193158_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:"container",staticClass:"dataset-card-container"},[_c('div',{ref:"card",staticClass:"dataset-card"},[_c('div',{staticClass:"seperator-path"}),_c('div',{directives:[{name:"loading",rawName:"v-loading",value:(_vm.loading),expression:"loading"}],staticClass:"card"},[_c('span',{staticClass:"card-left"},[(!_vm.loading && _vm.discoverId)?_c('image-gallery',{attrs:{"datasetId":_vm.discoverId,"datasetVersion":_vm.version,"entry":_vm.entry,"envVars":_vm.envVars,"label":_vm.label,"datasetThumbnail":_vm.thumbnail,"dataset-biolucida":_vm.biolucidaData,"category":_vm.currentCategory},on:{"card-clicked":_vm.galleryClicked}}):_vm._e()],1),_c('div',{staticClass:"card-right"},[_c('div',{staticClass:"title",on:{"click":_vm.cardClicked}},[_vm._v(_vm._s(_vm.entry.name))]),_c('div',{staticClass:"details"},[_vm._v(_vm._s(_vm.contributors)+" "+_vm._s(_vm.entry.publishDate ? ("(" + _vm.publishYear + ")") : ''))]),_c('div',{staticClass:"details"},[_vm._v(_vm._s(_vm.samples))]),(!_vm.entry.detailsReady)?_c('div',{directives:[{name:"loading",rawName:"v-loading",value:(!_vm.entry.detailsReady),expression:"!entry.detailsReady"}],staticClass:"details loading-icon"}):_vm._e(),_c('div',[(_vm.entry.simulation)?_c('el-button',{staticClass:"button",attrs:{"size":"mini","icon":"el-icon-view"},on:{"click":_vm.openRepository}},[_vm._v("View repository")]):_vm._e()],1),_c('div',{staticClass:"badges-container"},[_c('badges-group',{attrs:{"entry":_vm.entry,"dataset-biolucida":_vm.biolucidaData},on:{"categoryChanged":_vm.categoryChanged}})],1)])])])])}
2279
5348
  var DatasetCardvue_type_template_id_bf193158_scoped_true_staticRenderFns = []
2280
5349
 
2281
5350
 
2282
5351
  // CONCATENATED MODULE: ./src/components/DatasetCard.vue?vue&type=template&id=bf193158&scoped=true&
2283
5352
 
2284
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0d18a846-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/BadgesGroup.vue?vue&type=template&id=712c1be9&scoped=true&
5353
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"590ce1ae-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/BadgesGroup.vue?vue&type=template&id=712c1be9&scoped=true&
2285
5354
  var BadgesGroupvue_type_template_id_712c1be9_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.categories['All'].size > 1)?_c('div',{ref:"container",staticClass:"container"},[_c('div',[_vm._v(" View data types: ")]),_vm._l((_vm.categories),function(item,key){return [(item.size > 0)?_c('el-button',{key:key,class:[{ 'active': key == _vm.active},'tag-button'],attrs:{"size":"small"},on:{"click":function($event){return _vm.categoryClicked(key)}}},[_vm._v(_vm._s(key + " (" + item.size + ")")+" ")]):_vm._e()]})],2):_vm._e()}
2286
5355
  var BadgesGroupvue_type_template_id_712c1be9_scoped_true_staticRenderFns = []
2287
5356
 
@@ -2431,7 +5500,7 @@ var BadgesGroup_component = normalizeComponent(
2431
5500
 
2432
5501
  var EventBus = new external_vue_default.a();
2433
5502
  /* harmony default export */ var components_EventBus = (EventBus);
2434
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0d18a846-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/ImageGallery.vue?vue&type=template&id=c336c3ca&scoped=true&
5503
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"590ce1ae-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/ImageGallery.vue?vue&type=template&id=c336c3ca&scoped=true&
2435
5504
  var ImageGalleryvue_type_template_id_c336c3ca_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"full-size"},[_c('gallery',{ref:"gallery",attrs:{"bottomSpacer":_vm.bottomSpacer,"cardWidth":10,"items":_vm.galleryItems,"max-width":_vm.maxWidth,"show-indicator-bar":false,"show-card-details":true,"highlight-active":false,"image-style":_vm.imageStyle,"image-container-style":_vm.imageContainerStyle,"body-style":_vm.bodyStyle,"shadow":_vm.shadow},on:{"card-clicked":_vm.cardClicked}})],1)}
2436
5505
  var ImageGalleryvue_type_template_id_c336c3ca_scoped_true_staticRenderFns = []
2437
5506
 
@@ -3287,7 +6356,7 @@ var DatasetCard_component = normalizeComponent(
3287
6356
  )
3288
6357
 
3289
6358
  /* harmony default export */ var DatasetCard = (DatasetCard_component.exports);
3290
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0d18a846-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/ContextCard.vue?vue&type=template&id=2d699d90&scoped=true&
6359
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"590ce1ae-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/ContextCard.vue?vue&type=template&id=2d699d90&scoped=true&
3291
6360
  var ContextCardvue_type_template_id_2d699d90_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:"container",staticClass:"context-card-container"},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.showContextCard),expression:"showContextCard"}]},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.showDetails),expression:"showDetails"}],staticClass:"hide",on:{"click":function($event){_vm.showDetails = !_vm.showDetails}}},[_vm._v("Hide information"),_c('i',{staticClass:"el-icon-arrow-up"})]),_c('div',{directives:[{name:"show",rawName:"v-show",value:(!_vm.showDetails),expression:"!showDetails"}],staticClass:"hide",on:{"click":function($event){_vm.showDetails = !_vm.showDetails}}},[_vm._v("Show information"),_c('i',{staticClass:"el-icon-arrow-down"})]),(_vm.showDetails && Object.keys(_vm.contextData).length !== 0)?_c('el-card',{directives:[{name:"loading",rawName:"v-loading",value:(_vm.loading),expression:"loading"}],staticClass:"context-card"},[_c('div',{staticClass:"card-left"},[_c('img',{staticClass:"context-image",attrs:{"src":_vm.banner}})]),_c('div',{staticClass:"card-right scrollbar"},[_c('div',{staticClass:"title"},[_vm._v(_vm._s(_vm.contextData.heading))]),_c('div',{domProps:{"innerHTML":_vm._s(_vm.parseMarkdown(_vm.contextData.description))}}),_c('br'),(!_vm.samplesUnderViews)?[(_vm.contextData.views && _vm.contextData.views.length > 0)?_c('div',{staticClass:"subtitle"},[_vm._v("Scaffold Views")]):_vm._e(),_vm._l((_vm.contextData.views),function(view,i){return [_c('div',{key:i+'_1',staticClass:"context-card-view",on:{"click":function($event){return _vm.openViewFile(view)}}},[_c('img',{staticClass:"view-image",attrs:{"src":_vm.getFileFromPath(view.thumbnail)}}),_c('div',{staticClass:"view-description"},[_vm._v(_vm._s(view.description))])]),_c('div',{key:i,staticClass:"padding"})]}),_c('div',{staticStyle:{"margin-bottom":"16px"}}),(_vm.contextData.samples && _vm.contextData.samples.length > 0)?_c('div',{staticClass:"subtitle"},[_vm._v("Samples on Scaffold")]):_vm._e(),_vm._l((_vm.contextData.samples),function(sample,i){return [_c('span',{key:i+'_3',staticClass:"context-card-item cursor-pointer",on:{"click":function($event){return _vm.toggleSampleDetails(i)}}},[_c('div',{key:i+'_6',staticStyle:{"display":"flex"}},[(sample.color)?_c('div',{staticClass:"color-box",style:('background-color:'+ sample.color)}):(sample.thumbnail)?_c('img',{staticClass:"key-image",attrs:{"src":_vm.getFileFromPath(sample.thumbnail)}}):_vm._e(),_vm._v(" "+_vm._s(sample.heading)+" "),_c('i',{staticClass:"el-icon-warning-outline info"})])]),(_vm.sampleDetails[i])?_c('div',{key:i+'_4',domProps:{"innerHTML":_vm._s(sample.description)}}):_vm._e(),(_vm.sampleDetails[i] && sample.path)?_c('a',{key:i+'_5',attrs:{"href":_vm.generateFileLink(sample),"target":"_blank"}},[_vm._v("View Source")]):_vm._e(),_c('div',{key:i+'_2',staticClass:"padding"})]})]:[(_vm.contextData.views && _vm.contextData.views.length > 0)?_c('div',{staticClass:"subtitle"},[_vm._v("Scaffold Views")]):_vm._e(),_vm._l((_vm.contextData.views),function(view,i){return [_c('span',{key:i+'_1',staticClass:"context-card-view",on:{"click":function($event){return _vm.viewClicked(view, i)}}},[_c('img',{staticClass:"view-image",attrs:{"src":_vm.getFileFromPath(view.thumbnail)}}),_c('div',{staticClass:"view-description"},[_vm._v(_vm._s(view.description)),_c('i',{staticClass:"el-icon-warning-outline info"})])]),(_vm.sampleDetails[i])?_c('div',{key:i+'_2',domProps:{"innerHTML":_vm._s(_vm.samplesMatching(view.id).description)}}):_vm._e(),(_vm.sampleDetails[i] && _vm.samplesMatching(view.id).path)?_c('a',{key:i+'_5',attrs:{"href":_vm.generateFileLink(_vm.samplesMatching(view.id)),"target":"_blank"}},[_vm._v("View Source")]):_vm._e(),_c('div',{key:i,staticClass:"padding"}),(_vm.sampleDetails[i])?_c('div',{key:i+'_6',staticClass:"padding"}):_vm._e()]})]],2)]):_vm._e()],1)])}
3292
6361
  var ContextCardvue_type_template_id_2d699d90_scoped_true_staticRenderFns = []
3293
6362
 
@@ -3379,8 +6448,8 @@ var link_default = /*#__PURE__*/__webpack_require__.n(link_);
3379
6448
  // ]
3380
6449
  // }
3381
6450
  // }
3382
- // EXTERNAL MODULE: external "marked"
3383
- var external_marked_ = __webpack_require__("1d61");
6451
+ // EXTERNAL MODULE: ./node_modules/marked/lib/marked.umd.js
6452
+ var marked_umd = __webpack_require__("7c5c");
3384
6453
 
3385
6454
  // EXTERNAL MODULE: external "xss"
3386
6455
  var external_xss_ = __webpack_require__("efde");
@@ -3681,7 +6750,7 @@ var convertBackslashToForwardSlash = function convertBackslashToForwardSlash(pat
3681
6750
  return "".concat(this.envVars.ROOT_URL, "/file/").concat(sample.discoverId, "/").concat(sample.version, "?path=").concat(this.processPathForUrl(sample.path));
3682
6751
  },
3683
6752
  parseMarkdown: function parseMarkdown(markdown) {
3684
- return external_xss_default()(external_marked_["marked"].parse(markdown));
6753
+ return external_xss_default()(marked_umd["marked"].parse(markdown));
3685
6754
  },
3686
6755
  openViewFile: function openViewFile(view) {
3687
6756
  // note that we assume that the view file is in the same directory as the scaffold (viewUrls take relative paths)
@@ -4250,7 +7319,7 @@ var SidebarContent_component = normalizeComponent(
4250
7319
  )
4251
7320
 
4252
7321
  /* harmony default export */ var SidebarContent = (SidebarContent_component.exports);
4253
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0d18a846-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Tabs.vue?vue&type=template&id=d68260c4&scoped=true&
7322
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"590ce1ae-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Tabs.vue?vue&type=template&id=d68260c4&scoped=true&
4254
7323
  var Tabsvue_type_template_id_d68260c4_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"tab-container"},_vm._l((_vm.tabTitles),function(title){return _c('div',{key:title.id,staticClass:"title"},[_c('div',{staticClass:"title-text-table",class:{ highlightText : (title.id==_vm.activeId) },on:{"click":function($event){return _vm.titleClicked(title.id)}}},[_c('div',{staticClass:"title-text"},[_vm._v(" "+_vm._s(title.title)+" ")])])])}),0)}
4255
7324
  var Tabsvue_type_template_id_d68260c4_scoped_true_staticRenderFns = []
4256
7325