mystmd 1.1.54__py3-none-any.whl → 1.1.55__py3-none-any.whl
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.
- {mystmd-1.1.54.dist-info → mystmd-1.1.55.dist-info}/METADATA +1 -1
- mystmd-1.1.55.dist-info/RECORD +8 -0
- {mystmd-1.1.54.dist-info → mystmd-1.1.55.dist-info}/WHEEL +1 -1
- mystmd_py/myst.cjs +1922 -314
- mystmd-1.1.54.dist-info/RECORD +0 -8
- {mystmd-1.1.54.dist-info → mystmd-1.1.55.dist-info}/entry_points.txt +0 -0
- {mystmd-1.1.54.dist-info → mystmd-1.1.55.dist-info}/licenses/LICENSE +0 -0
mystmd_py/myst.cjs
CHANGED
@@ -2150,7 +2150,7 @@ var require_es_json_stringify = __commonJS({
|
|
2150
2150
|
if ($stringify) {
|
2151
2151
|
$2({ target: "JSON", stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
|
2152
2152
|
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
2153
|
-
stringify: function stringify4(it, replacer,
|
2153
|
+
stringify: function stringify4(it, replacer, space3) {
|
2154
2154
|
var args = arraySlice(arguments);
|
2155
2155
|
var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
|
2156
2156
|
return ILL_FORMED_UNICODE && typeof result == "string" ? replace(result, tester, fixIllFormed) : result;
|
@@ -17922,7 +17922,7 @@ var require_esnext_json_parse = __commonJS({
|
|
17922
17922
|
return 1 / nativeParse("-0 ") !== -Infinity;
|
17923
17923
|
});
|
17924
17924
|
$2({ target: "JSON", stat: true, forced: NO_SOURCE_SUPPORT }, {
|
17925
|
-
parse: function
|
17925
|
+
parse: function parse13(text7, reviver) {
|
17926
17926
|
return PROPER_BASE_PARSE && !isCallable(reviver) ? nativeParse(text7) : $parse(text7, reviver);
|
17927
17927
|
}
|
17928
17928
|
});
|
@@ -17949,7 +17949,7 @@ var require_esnext_json_raw_json = __commonJS({
|
|
17949
17949
|
var setInternalState = require_internal_state().set;
|
17950
17950
|
var $String = String;
|
17951
17951
|
var $SyntaxError = SyntaxError;
|
17952
|
-
var
|
17952
|
+
var parse13 = getBuiltIn("JSON", "parse");
|
17953
17953
|
var $stringify = getBuiltIn("JSON", "stringify");
|
17954
17954
|
var create3 = getBuiltIn("Object", "create");
|
17955
17955
|
var freeze2 = getBuiltIn("Object", "freeze");
|
@@ -17967,7 +17967,7 @@ var require_esnext_json_raw_json = __commonJS({
|
|
17967
17967
|
if (jsonString == "" || exec3(IS_WHITESPACE, at(jsonString, 0)) || exec3(IS_WHITESPACE, at(jsonString, jsonString.length - 1))) {
|
17968
17968
|
throw $SyntaxError(ERROR_MESSAGE);
|
17969
17969
|
}
|
17970
|
-
var parsed =
|
17970
|
+
var parsed = parse13(jsonString);
|
17971
17971
|
if (typeof parsed == "object" && parsed !== null)
|
17972
17972
|
throw $SyntaxError(ERROR_MESSAGE);
|
17973
17973
|
var obj = create3(null);
|
@@ -17978,13 +17978,13 @@ var require_esnext_json_raw_json = __commonJS({
|
|
17978
17978
|
});
|
17979
17979
|
if ($stringify)
|
17980
17980
|
$2({ target: "JSON", stat: true, arity: 3, forced: !NATIVE_RAW_JSON }, {
|
17981
|
-
stringify: function stringify4(text7, replacer,
|
17981
|
+
stringify: function stringify4(text7, replacer, space3) {
|
17982
17982
|
var replacerFunction = getReplacerFunction(replacer);
|
17983
17983
|
var rawStrings = [];
|
17984
17984
|
var json2 = $stringify(text7, function(key2, value) {
|
17985
17985
|
var v = isCallable(replacerFunction) ? call(replacerFunction, this, $String(key2), value) : value;
|
17986
17986
|
return isRawJSON(v) ? MARK + (push(rawStrings, v.rawJSON) - 1) : v;
|
17987
|
-
},
|
17987
|
+
}, space3);
|
17988
17988
|
if (typeof json2 != "string")
|
17989
17989
|
return json2;
|
17990
17990
|
var result = "";
|
@@ -23034,9 +23034,9 @@ var require_spdx_expression_parse = __commonJS({
|
|
23034
23034
|
"../../node_modules/spdx-expression-parse/index.js"(exports2, module2) {
|
23035
23035
|
"use strict";
|
23036
23036
|
var scan2 = require_scan();
|
23037
|
-
var
|
23037
|
+
var parse13 = require_parse();
|
23038
23038
|
module2.exports = function(source2) {
|
23039
|
-
return
|
23039
|
+
return parse13(scan2(source2));
|
23040
23040
|
};
|
23041
23041
|
}
|
23042
23042
|
});
|
@@ -23044,11 +23044,11 @@ var require_spdx_expression_parse = __commonJS({
|
|
23044
23044
|
// ../../node_modules/spdx-correct/index.js
|
23045
23045
|
var require_spdx_correct = __commonJS({
|
23046
23046
|
"../../node_modules/spdx-correct/index.js"(exports2, module2) {
|
23047
|
-
var
|
23047
|
+
var parse13 = require_spdx_expression_parse();
|
23048
23048
|
var spdxLicenseIds = require_spdx_license_ids();
|
23049
23049
|
function valid2(string2) {
|
23050
23050
|
try {
|
23051
|
-
|
23051
|
+
parse13(string2);
|
23052
23052
|
return true;
|
23053
23053
|
} catch (error) {
|
23054
23054
|
return false;
|
@@ -23684,7 +23684,7 @@ var require_parser_context = __commonJS({
|
|
23684
23684
|
}
|
23685
23685
|
return result;
|
23686
23686
|
}
|
23687
|
-
function
|
23687
|
+
function parse13() {
|
23688
23688
|
var res = parseSelector3();
|
23689
23689
|
if (pos < l) {
|
23690
23690
|
throw Error('Rule expected but "' + str2.charAt(pos) + '" found.');
|
@@ -23879,7 +23879,7 @@ var require_parser_context = __commonJS({
|
|
23879
23879
|
}
|
23880
23880
|
return rule;
|
23881
23881
|
}
|
23882
|
-
return
|
23882
|
+
return parse13();
|
23883
23883
|
}
|
23884
23884
|
exports2.parseCssSelector = parseCssSelector;
|
23885
23885
|
}
|
@@ -38543,8 +38543,8 @@ var require_empty = __commonJS({
|
|
38543
38543
|
Object.defineProperty(exports2, "__esModule", {
|
38544
38544
|
value: true
|
38545
38545
|
});
|
38546
|
-
exports2.parse =
|
38547
|
-
function
|
38546
|
+
exports2.parse = parse13;
|
38547
|
+
function parse13() {
|
38548
38548
|
return [];
|
38549
38549
|
}
|
38550
38550
|
}
|
@@ -38587,8 +38587,8 @@ var require_jquery = __commonJS({
|
|
38587
38587
|
Object.defineProperty(exports2, "__esModule", {
|
38588
38588
|
value: true
|
38589
38589
|
});
|
38590
|
-
exports2.parse =
|
38591
|
-
function
|
38590
|
+
exports2.parse = parse13;
|
38591
|
+
function parse13(input3) {
|
38592
38592
|
return input3.val() || input3.text() || input3.html();
|
38593
38593
|
}
|
38594
38594
|
}
|
@@ -38601,8 +38601,8 @@ var require_html3 = __commonJS({
|
|
38601
38601
|
Object.defineProperty(exports2, "__esModule", {
|
38602
38602
|
value: true
|
38603
38603
|
});
|
38604
|
-
exports2.parse =
|
38605
|
-
function
|
38604
|
+
exports2.parse = parse13;
|
38605
|
+
function parse13(input3) {
|
38606
38606
|
return input3.value || input3.textContent;
|
38607
38607
|
}
|
38608
38608
|
}
|
@@ -46655,7 +46655,7 @@ var require_container = __commonJS({
|
|
46655
46655
|
var Declaration = require_declaration();
|
46656
46656
|
var Comment = require_comment();
|
46657
46657
|
var Node = require_node2();
|
46658
|
-
var
|
46658
|
+
var parse13;
|
46659
46659
|
var Rule;
|
46660
46660
|
var AtRule;
|
46661
46661
|
var Root;
|
@@ -46808,7 +46808,7 @@ var require_container = __commonJS({
|
|
46808
46808
|
}
|
46809
46809
|
normalize(nodes, sample2) {
|
46810
46810
|
if (typeof nodes === "string") {
|
46811
|
-
nodes = cleanSource(
|
46811
|
+
nodes = cleanSource(parse13(nodes).nodes);
|
46812
46812
|
} else if (Array.isArray(nodes)) {
|
46813
46813
|
nodes = nodes.slice(0);
|
46814
46814
|
for (let i2 of nodes) {
|
@@ -47013,7 +47013,7 @@ var require_container = __commonJS({
|
|
47013
47013
|
}
|
47014
47014
|
};
|
47015
47015
|
Container.registerParse = (dependant) => {
|
47016
|
-
|
47016
|
+
parse13 = dependant;
|
47017
47017
|
};
|
47018
47018
|
Container.registerRule = (dependant) => {
|
47019
47019
|
Rule = dependant;
|
@@ -47897,7 +47897,7 @@ var require_parse3 = __commonJS({
|
|
47897
47897
|
var Container = require_container();
|
47898
47898
|
var Parser3 = require_parser3();
|
47899
47899
|
var Input = require_input4();
|
47900
|
-
function
|
47900
|
+
function parse13(css, opts) {
|
47901
47901
|
let input3 = new Input(css, opts);
|
47902
47902
|
let parser3 = new Parser3(input3);
|
47903
47903
|
try {
|
@@ -47918,9 +47918,9 @@ var require_parse3 = __commonJS({
|
|
47918
47918
|
}
|
47919
47919
|
return parser3.root;
|
47920
47920
|
}
|
47921
|
-
module2.exports =
|
47922
|
-
|
47923
|
-
Container.registerParse(
|
47921
|
+
module2.exports = parse13;
|
47922
|
+
parse13.default = parse13;
|
47923
|
+
Container.registerParse(parse13);
|
47924
47924
|
}
|
47925
47925
|
});
|
47926
47926
|
|
@@ -47935,7 +47935,7 @@ var require_lazy_result = __commonJS({
|
|
47935
47935
|
var Document2 = require_document();
|
47936
47936
|
var warnOnce = require_warn_once();
|
47937
47937
|
var Result = require_result();
|
47938
|
-
var
|
47938
|
+
var parse13 = require_parse3();
|
47939
47939
|
var Root = require_root();
|
47940
47940
|
var TYPE_TO_CLASS_NAME = {
|
47941
47941
|
atrule: "AtRule",
|
@@ -48038,7 +48038,7 @@ var require_lazy_result = __commonJS({
|
|
48038
48038
|
opts.map.prev = css.map;
|
48039
48039
|
}
|
48040
48040
|
} else {
|
48041
|
-
let parser3 =
|
48041
|
+
let parser3 = parse13;
|
48042
48042
|
if (opts.syntax)
|
48043
48043
|
parser3 = opts.syntax.parse;
|
48044
48044
|
if (opts.parser)
|
@@ -48425,7 +48425,7 @@ var require_no_work_result = __commonJS({
|
|
48425
48425
|
var MapGenerator = require_map_generator();
|
48426
48426
|
var stringify4 = require_stringify2();
|
48427
48427
|
var warnOnce = require_warn_once();
|
48428
|
-
var
|
48428
|
+
var parse13 = require_parse3();
|
48429
48429
|
var Result = require_result();
|
48430
48430
|
var NoWorkResult = class {
|
48431
48431
|
constructor(processor2, css, opts) {
|
@@ -48514,7 +48514,7 @@ var require_no_work_result = __commonJS({
|
|
48514
48514
|
return this._root;
|
48515
48515
|
}
|
48516
48516
|
let root6;
|
48517
|
-
let parser3 =
|
48517
|
+
let parser3 = parse13;
|
48518
48518
|
try {
|
48519
48519
|
root6 = parser3(this._css, this._opts);
|
48520
48520
|
} catch (error) {
|
@@ -48668,7 +48668,7 @@ var require_postcss = __commonJS({
|
|
48668
48668
|
var AtRule = require_at_rule();
|
48669
48669
|
var Result = require_result();
|
48670
48670
|
var Input = require_input4();
|
48671
|
-
var
|
48671
|
+
var parse13 = require_parse3();
|
48672
48672
|
var list6 = require_list();
|
48673
48673
|
var Rule = require_rule();
|
48674
48674
|
var Root = require_root();
|
@@ -48712,7 +48712,7 @@ var require_postcss = __commonJS({
|
|
48712
48712
|
return creator;
|
48713
48713
|
};
|
48714
48714
|
postcss.stringify = stringify4;
|
48715
|
-
postcss.parse =
|
48715
|
+
postcss.parse = parse13;
|
48716
48716
|
postcss.fromJSON = fromJSON;
|
48717
48717
|
postcss.list = list6;
|
48718
48718
|
postcss.comment = (defaults4) => new Comment(defaults4);
|
@@ -48901,12 +48901,12 @@ and ensure you are accounting for this risk.
|
|
48901
48901
|
});
|
48902
48902
|
const transformTagsMap = {};
|
48903
48903
|
let transformTagsAll;
|
48904
|
-
each2(options.transformTags, function(
|
48904
|
+
each2(options.transformTags, function(transform3, tag) {
|
48905
48905
|
let transFun;
|
48906
|
-
if (typeof
|
48907
|
-
transFun =
|
48908
|
-
} else if (typeof
|
48909
|
-
transFun = sanitizeHtml2.simpleTransform(
|
48906
|
+
if (typeof transform3 === "function") {
|
48907
|
+
transFun = transform3;
|
48908
|
+
} else if (typeof transform3 === "string") {
|
48909
|
+
transFun = sanitizeHtml2.simpleTransform(transform3);
|
48910
48910
|
}
|
48911
48911
|
if (tag === "*") {
|
48912
48912
|
transformTagsAll = transFun;
|
@@ -50123,13 +50123,13 @@ var require_moo = __commonJS({
|
|
50123
50123
|
var lineBreaks = 0;
|
50124
50124
|
if (group3.lineBreaks) {
|
50125
50125
|
var matchNL = /\n/g;
|
50126
|
-
var
|
50126
|
+
var nl3 = 1;
|
50127
50127
|
if (text7 === "\n") {
|
50128
50128
|
lineBreaks = 1;
|
50129
50129
|
} else {
|
50130
50130
|
while (matchNL.exec(text7)) {
|
50131
50131
|
lineBreaks++;
|
50132
|
-
|
50132
|
+
nl3 = matchNL.lastIndex;
|
50133
50133
|
}
|
50134
50134
|
}
|
50135
50135
|
}
|
@@ -50147,7 +50147,7 @@ var require_moo = __commonJS({
|
|
50147
50147
|
this.index += size;
|
50148
50148
|
this.line += lineBreaks;
|
50149
50149
|
if (lineBreaks !== 0) {
|
50150
|
-
this.col = size -
|
50150
|
+
this.col = size - nl3 + 1;
|
50151
50151
|
} else {
|
50152
50152
|
this.col += size;
|
50153
50153
|
}
|
@@ -50583,7 +50583,7 @@ var require_file = __commonJS({
|
|
50583
50583
|
value: true
|
50584
50584
|
});
|
50585
50585
|
exports2.bibtexGrammar = void 0;
|
50586
|
-
exports2.parse =
|
50586
|
+
exports2.parse = parse13;
|
50587
50587
|
var _core3 = require_lib6();
|
50588
50588
|
var _moo = _interopRequireDefault3(require_moo());
|
50589
50589
|
var _constants = require_constants();
|
@@ -50860,7 +50860,7 @@ var require_file = __commonJS({
|
|
50860
50860
|
}, {
|
50861
50861
|
strings: _constants.defaultStrings
|
50862
50862
|
});
|
50863
|
-
function
|
50863
|
+
function parse13(text7) {
|
50864
50864
|
return bibtexGrammar.parse(lexer.reset(text7));
|
50865
50865
|
}
|
50866
50866
|
}
|
@@ -52698,7 +52698,7 @@ var require_mapping = __commonJS({
|
|
52698
52698
|
});
|
52699
52699
|
exports2.format = format;
|
52700
52700
|
exports2.formatBibtex = formatBibtex;
|
52701
|
-
exports2.parse =
|
52701
|
+
exports2.parse = parse13;
|
52702
52702
|
exports2.parseBibtex = parseBibtex;
|
52703
52703
|
var _shared = require_shared3();
|
52704
52704
|
var _biblatex = _interopRequireDefault3(require_biblatex());
|
@@ -52818,7 +52818,7 @@ var require_mapping = __commonJS({
|
|
52818
52818
|
function formatBibtex(input3) {
|
52819
52819
|
return _format(input3, _bibtex.default);
|
52820
52820
|
}
|
52821
|
-
function
|
52821
|
+
function parse13(input3) {
|
52822
52822
|
return _parse(input3, _biblatex.default);
|
52823
52823
|
}
|
52824
52824
|
function format(input3) {
|
@@ -52937,7 +52937,7 @@ var require_value = __commonJS({
|
|
52937
52937
|
Object.defineProperty(exports2, "__esModule", {
|
52938
52938
|
value: true
|
52939
52939
|
});
|
52940
|
-
exports2.parse =
|
52940
|
+
exports2.parse = parse13;
|
52941
52941
|
exports2.valueGrammar = void 0;
|
52942
52942
|
var _core3 = require_lib6();
|
52943
52943
|
var _moo = _interopRequireDefault3(require_moo());
|
@@ -53416,7 +53416,7 @@ var require_value = __commonJS({
|
|
53416
53416
|
return "stringLiteral";
|
53417
53417
|
}
|
53418
53418
|
}
|
53419
|
-
function
|
53419
|
+
function parse13(text8, field, languages = []) {
|
53420
53420
|
const fieldType = constants2.fieldTypes[field] || [];
|
53421
53421
|
return valueGrammar.parse(lexer.reset(text8, {
|
53422
53422
|
state: getLexerState(fieldType),
|
@@ -53434,7 +53434,7 @@ var require_entries = __commonJS({
|
|
53434
53434
|
Object.defineProperty(exports2, "__esModule", {
|
53435
53435
|
value: true
|
53436
53436
|
});
|
53437
|
-
exports2.parse =
|
53437
|
+
exports2.parse = parse13;
|
53438
53438
|
exports2.parseBibtex = parseBibtex;
|
53439
53439
|
var _config2 = _interopRequireDefault3(require_config2());
|
53440
53440
|
var _index4 = require_mapping();
|
@@ -53532,7 +53532,7 @@ var require_entries = __commonJS({
|
|
53532
53532
|
properties: output2
|
53533
53533
|
});
|
53534
53534
|
}
|
53535
|
-
function
|
53535
|
+
function parse13(entries2) {
|
53536
53536
|
if (_config2.default.parse.strict) {
|
53537
53537
|
validate5(entries2, _constants.required.biblatex);
|
53538
53538
|
}
|
@@ -57645,18 +57645,18 @@ var require_citeproc_commonjs = __commonJS({
|
|
57645
57645
|
item.locator = Item.section;
|
57646
57646
|
} else {
|
57647
57647
|
var m2 = item.locator.match(/^([^ ]*)\s*(.*)/);
|
57648
|
-
var
|
57648
|
+
var space3 = " ";
|
57649
57649
|
if (m2) {
|
57650
57650
|
if (m2[1] === "p." && sectionMasterLabel !== "p.") {
|
57651
57651
|
item.locator = m2[2];
|
57652
57652
|
}
|
57653
57653
|
if (["[", "(", ".", ",", ";", ":", "?"].indexOf(item.locator.slice(0, 1)) > -1) {
|
57654
|
-
|
57654
|
+
space3 = "";
|
57655
57655
|
}
|
57656
57656
|
} else {
|
57657
|
-
|
57657
|
+
space3 = "";
|
57658
57658
|
}
|
57659
|
-
item.locator = Item.section +
|
57659
|
+
item.locator = Item.section + space3 + item.locator;
|
57660
57660
|
}
|
57661
57661
|
}
|
57662
57662
|
item.label = "";
|
@@ -64581,13 +64581,13 @@ var require_citeproc_commonjs = __commonJS({
|
|
64581
64581
|
if (second.strings.prefix) {
|
64582
64582
|
name3["comma-dropping-particle"] = "";
|
64583
64583
|
}
|
64584
|
-
var
|
64584
|
+
var space3;
|
64585
64585
|
if (this.state.inheritOpt(this.name, "initialize-with") && this.state.inheritOpt(this.name, "initialize-with").match(/[\u00a0\ufeff]/) && givenInfo.initializationLevel === 1) {
|
64586
|
-
|
64586
|
+
space3 = nbspace;
|
64587
64587
|
} else {
|
64588
|
-
|
64588
|
+
space3 = " ";
|
64589
64589
|
}
|
64590
|
-
blob = this._join([given, second], name3["comma-dropping-particle"] +
|
64590
|
+
blob = this._join([given, second], name3["comma-dropping-particle"] + space3);
|
64591
64591
|
}
|
64592
64592
|
this.state.tmp.group_context.tip.variable_success = true;
|
64593
64593
|
this.state.tmp.can_substitute.replace(false, CSL.LITERAL);
|
@@ -90006,8 +90006,8 @@ var require_semver = __commonJS({
|
|
90006
90006
|
}
|
90007
90007
|
}
|
90008
90008
|
var i2;
|
90009
|
-
exports2.parse =
|
90010
|
-
function
|
90009
|
+
exports2.parse = parse13;
|
90010
|
+
function parse13(version4, options) {
|
90011
90011
|
if (!options || typeof options !== "object") {
|
90012
90012
|
options = {
|
90013
90013
|
loose: !!options,
|
@@ -90035,12 +90035,12 @@ var require_semver = __commonJS({
|
|
90035
90035
|
}
|
90036
90036
|
exports2.valid = valid2;
|
90037
90037
|
function valid2(version4, options) {
|
90038
|
-
var v =
|
90038
|
+
var v = parse13(version4, options);
|
90039
90039
|
return v ? v.version : null;
|
90040
90040
|
}
|
90041
90041
|
exports2.clean = clean3;
|
90042
90042
|
function clean3(version4, options) {
|
90043
|
-
var s5 =
|
90043
|
+
var s5 = parse13(version4.trim().replace(/^[=v]+/, ""), options);
|
90044
90044
|
return s5 ? s5.version : null;
|
90045
90045
|
}
|
90046
90046
|
exports2.SemVer = SemVer;
|
@@ -90272,8 +90272,8 @@ var require_semver = __commonJS({
|
|
90272
90272
|
if (eq(version1, version22)) {
|
90273
90273
|
return null;
|
90274
90274
|
} else {
|
90275
|
-
var v1 =
|
90276
|
-
var v2 =
|
90275
|
+
var v1 = parse13(version1);
|
90276
|
+
var v2 = parse13(version22);
|
90277
90277
|
var prefix2 = "";
|
90278
90278
|
if (v1.prerelease.length || v2.prerelease.length) {
|
90279
90279
|
prefix2 = "pre";
|
@@ -90977,7 +90977,7 @@ var require_semver = __commonJS({
|
|
90977
90977
|
}
|
90978
90978
|
exports2.prerelease = prerelease;
|
90979
90979
|
function prerelease(version4, options) {
|
90980
|
-
var parsed =
|
90980
|
+
var parsed = parse13(version4, options);
|
90981
90981
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
90982
90982
|
}
|
90983
90983
|
exports2.intersects = intersects;
|
@@ -91014,7 +91014,7 @@ var require_semver = __commonJS({
|
|
91014
91014
|
if (match3 === null) {
|
91015
91015
|
return null;
|
91016
91016
|
}
|
91017
|
-
return
|
91017
|
+
return parse13(match3[2] + "." + (match3[3] || "0") + "." + (match3[4] || "0"), options);
|
91018
91018
|
}
|
91019
91019
|
}
|
91020
91020
|
});
|
@@ -99619,17 +99619,17 @@ var require_ponyfill_es2018 = __commonJS({
|
|
99619
99619
|
throw streamBrandCheckException$1("pipeThrough");
|
99620
99620
|
}
|
99621
99621
|
assertRequiredArgument(rawTransform, 1, "pipeThrough");
|
99622
|
-
const
|
99622
|
+
const transform3 = convertReadableWritablePair(rawTransform, "First parameter");
|
99623
99623
|
const options = convertPipeOptions(rawOptions, "Second parameter");
|
99624
99624
|
if (IsReadableStreamLocked(this)) {
|
99625
99625
|
throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");
|
99626
99626
|
}
|
99627
|
-
if (IsWritableStreamLocked(
|
99627
|
+
if (IsWritableStreamLocked(transform3.writable)) {
|
99628
99628
|
throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");
|
99629
99629
|
}
|
99630
|
-
const promise = ReadableStreamPipeTo(this,
|
99630
|
+
const promise = ReadableStreamPipeTo(this, transform3.writable, options.preventClose, options.preventAbort, options.preventCancel, options.signal);
|
99631
99631
|
setPromiseIsHandledToTrue(promise);
|
99632
|
-
return
|
99632
|
+
return transform3.readable;
|
99633
99633
|
}
|
99634
99634
|
pipeTo(destination, rawOptions = {}) {
|
99635
99635
|
if (!IsReadableStream(this)) {
|
@@ -99922,13 +99922,13 @@ var require_ponyfill_es2018 = __commonJS({
|
|
99922
99922
|
const flush = original === null || original === void 0 ? void 0 : original.flush;
|
99923
99923
|
const readableType = original === null || original === void 0 ? void 0 : original.readableType;
|
99924
99924
|
const start = original === null || original === void 0 ? void 0 : original.start;
|
99925
|
-
const
|
99925
|
+
const transform3 = original === null || original === void 0 ? void 0 : original.transform;
|
99926
99926
|
const writableType = original === null || original === void 0 ? void 0 : original.writableType;
|
99927
99927
|
return {
|
99928
99928
|
flush: flush === void 0 ? void 0 : convertTransformerFlushCallback(flush, original, `${context} has member 'flush' that`),
|
99929
99929
|
readableType,
|
99930
99930
|
start: start === void 0 ? void 0 : convertTransformerStartCallback(start, original, `${context} has member 'start' that`),
|
99931
|
-
transform:
|
99931
|
+
transform: transform3 === void 0 ? void 0 : convertTransformerTransformCallback(transform3, original, `${context} has member 'transform' that`),
|
99932
99932
|
writableType
|
99933
99933
|
};
|
99934
99934
|
}
|
@@ -101154,7 +101154,7 @@ var require_vary = __commonJS({
|
|
101154
101154
|
if (!field) {
|
101155
101155
|
throw new TypeError("field argument is required");
|
101156
101156
|
}
|
101157
|
-
var fields = !Array.isArray(field) ?
|
101157
|
+
var fields = !Array.isArray(field) ? parse13(String(field)) : field;
|
101158
101158
|
for (var j = 0; j < fields.length; j++) {
|
101159
101159
|
if (!FIELD_NAME_REGEXP.test(fields[j])) {
|
101160
101160
|
throw new TypeError("field argument contains an invalid header name");
|
@@ -101164,7 +101164,7 @@ var require_vary = __commonJS({
|
|
101164
101164
|
return header;
|
101165
101165
|
}
|
101166
101166
|
var val = header;
|
101167
|
-
var vals =
|
101167
|
+
var vals = parse13(header.toLowerCase());
|
101168
101168
|
if (fields.indexOf("*") !== -1 || vals.indexOf("*") !== -1) {
|
101169
101169
|
return "*";
|
101170
101170
|
}
|
@@ -101177,7 +101177,7 @@ var require_vary = __commonJS({
|
|
101177
101177
|
}
|
101178
101178
|
return val;
|
101179
101179
|
}
|
101180
|
-
function
|
101180
|
+
function parse13(header) {
|
101181
101181
|
var end = 0;
|
101182
101182
|
var list6 = [];
|
101183
101183
|
var start = 0;
|
@@ -101733,7 +101733,7 @@ var require_bytes = __commonJS({
|
|
101733
101733
|
"use strict";
|
101734
101734
|
module2.exports = bytes;
|
101735
101735
|
module2.exports.format = format;
|
101736
|
-
module2.exports.parse =
|
101736
|
+
module2.exports.parse = parse13;
|
101737
101737
|
var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g;
|
101738
101738
|
var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/;
|
101739
101739
|
var map14 = {
|
@@ -101747,7 +101747,7 @@ var require_bytes = __commonJS({
|
|
101747
101747
|
var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;
|
101748
101748
|
function bytes(value, options) {
|
101749
101749
|
if (typeof value === "string") {
|
101750
|
-
return
|
101750
|
+
return parse13(value);
|
101751
101751
|
}
|
101752
101752
|
if (typeof value === "number") {
|
101753
101753
|
return format(value, options);
|
@@ -101791,7 +101791,7 @@ var require_bytes = __commonJS({
|
|
101791
101791
|
}
|
101792
101792
|
return str2 + unitSeparator + unit;
|
101793
101793
|
}
|
101794
|
-
function
|
101794
|
+
function parse13(val) {
|
101795
101795
|
if (typeof val === "number" && !isNaN(val)) {
|
101796
101796
|
return val;
|
101797
101797
|
}
|
@@ -101827,7 +101827,7 @@ var require_content_type = __commonJS({
|
|
101827
101827
|
var QUOTE_REGEXP = /([\\"])/g;
|
101828
101828
|
var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
101829
101829
|
exports2.format = format;
|
101830
|
-
exports2.parse =
|
101830
|
+
exports2.parse = parse13;
|
101831
101831
|
function format(obj) {
|
101832
101832
|
if (!obj || typeof obj !== "object") {
|
101833
101833
|
throw new TypeError("argument obj is required");
|
@@ -101851,7 +101851,7 @@ var require_content_type = __commonJS({
|
|
101851
101851
|
}
|
101852
101852
|
return string2;
|
101853
101853
|
}
|
101854
|
-
function
|
101854
|
+
function parse13(string2) {
|
101855
101855
|
if (!string2) {
|
101856
101856
|
throw new TypeError("argument string is required");
|
101857
101857
|
}
|
@@ -102318,7 +102318,7 @@ var require_ms = __commonJS({
|
|
102318
102318
|
options = options || {};
|
102319
102319
|
var type2 = typeof val;
|
102320
102320
|
if (type2 === "string" && val.length > 0) {
|
102321
|
-
return
|
102321
|
+
return parse13(val);
|
102322
102322
|
} else if (type2 === "number" && isNaN(val) === false) {
|
102323
102323
|
return options.long ? fmtLong(val) : fmtShort(val);
|
102324
102324
|
}
|
@@ -102326,7 +102326,7 @@ var require_ms = __commonJS({
|
|
102326
102326
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
102327
102327
|
);
|
102328
102328
|
};
|
102329
|
-
function
|
102329
|
+
function parse13(str2) {
|
102330
102330
|
str2 = String(str2);
|
102331
102331
|
if (str2.length > 100) {
|
102332
102332
|
return;
|
@@ -106682,7 +106682,7 @@ var require_read = __commonJS({
|
|
106682
106682
|
var unpipe = require_unpipe();
|
106683
106683
|
var zlib3 = require("zlib");
|
106684
106684
|
module2.exports = read;
|
106685
|
-
function read(req, res, next,
|
106685
|
+
function read(req, res, next, parse13, debug, options) {
|
106686
106686
|
var length;
|
106687
106687
|
var opts = options;
|
106688
106688
|
var stream3;
|
@@ -106741,7 +106741,7 @@ var require_read = __commonJS({
|
|
106741
106741
|
try {
|
106742
106742
|
debug("parse body");
|
106743
106743
|
str2 = typeof body3 !== "string" && encoding !== null ? iconv.decode(body3, encoding) : body3;
|
106744
|
-
req.body =
|
106744
|
+
req.body = parse13(str2);
|
106745
106745
|
} catch (err) {
|
106746
106746
|
next(createError(400, err, {
|
106747
106747
|
body: str2,
|
@@ -106809,7 +106809,7 @@ var require_media_typer = __commonJS({
|
|
106809
106809
|
var typeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/;
|
106810
106810
|
var typeRegExp = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/;
|
106811
106811
|
exports2.format = format;
|
106812
|
-
exports2.parse =
|
106812
|
+
exports2.parse = parse13;
|
106813
106813
|
function format(obj) {
|
106814
106814
|
if (!obj || typeof obj !== "object") {
|
106815
106815
|
throw new TypeError("argument obj is required");
|
@@ -106844,7 +106844,7 @@ var require_media_typer = __commonJS({
|
|
106844
106844
|
}
|
106845
106845
|
return string2;
|
106846
106846
|
}
|
106847
|
-
function
|
106847
|
+
function parse13(string2) {
|
106848
106848
|
if (!string2) {
|
106849
106849
|
throw new TypeError("argument string is required");
|
106850
106850
|
}
|
@@ -107050,7 +107050,7 @@ var require_json4 = __commonJS({
|
|
107050
107050
|
throw new TypeError("option verify must be function");
|
107051
107051
|
}
|
107052
107052
|
var shouldParse = typeof type2 !== "function" ? typeChecker(type2) : type2;
|
107053
|
-
function
|
107053
|
+
function parse13(body3) {
|
107054
107054
|
if (body3.length === 0) {
|
107055
107055
|
return {};
|
107056
107056
|
}
|
@@ -107098,7 +107098,7 @@ var require_json4 = __commonJS({
|
|
107098
107098
|
}));
|
107099
107099
|
return;
|
107100
107100
|
}
|
107101
|
-
read(req, res, next,
|
107101
|
+
read(req, res, next, parse13, debug, {
|
107102
107102
|
encoding: charset,
|
107103
107103
|
inflate,
|
107104
107104
|
limit,
|
@@ -107169,7 +107169,7 @@ var require_raw = __commonJS({
|
|
107169
107169
|
throw new TypeError("option verify must be function");
|
107170
107170
|
}
|
107171
107171
|
var shouldParse = typeof type2 !== "function" ? typeChecker(type2) : type2;
|
107172
|
-
function
|
107172
|
+
function parse13(buf) {
|
107173
107173
|
return buf;
|
107174
107174
|
}
|
107175
107175
|
return function rawParser(req, res, next) {
|
@@ -107190,7 +107190,7 @@ var require_raw = __commonJS({
|
|
107190
107190
|
next();
|
107191
107191
|
return;
|
107192
107192
|
}
|
107193
|
-
read(req, res, next,
|
107193
|
+
read(req, res, next, parse13, debug, {
|
107194
107194
|
encoding: null,
|
107195
107195
|
inflate,
|
107196
107196
|
limit,
|
@@ -107227,7 +107227,7 @@ var require_text3 = __commonJS({
|
|
107227
107227
|
throw new TypeError("option verify must be function");
|
107228
107228
|
}
|
107229
107229
|
var shouldParse = typeof type2 !== "function" ? typeChecker(type2) : type2;
|
107230
|
-
function
|
107230
|
+
function parse13(buf) {
|
107231
107231
|
return buf;
|
107232
107232
|
}
|
107233
107233
|
return function textParser(req, res, next) {
|
@@ -107249,7 +107249,7 @@ var require_text3 = __commonJS({
|
|
107249
107249
|
return;
|
107250
107250
|
}
|
107251
107251
|
var charset = getCharset(req) || defaultCharset;
|
107252
|
-
read(req, res, next,
|
107252
|
+
read(req, res, next, parse13, debug, {
|
107253
107253
|
encoding: charset,
|
107254
107254
|
inflate,
|
107255
107255
|
limit,
|
@@ -109359,11 +109359,11 @@ var require_lib19 = __commonJS({
|
|
109359
109359
|
"../../node_modules/qs/lib/index.js"(exports2, module2) {
|
109360
109360
|
"use strict";
|
109361
109361
|
var stringify4 = require_stringify3();
|
109362
|
-
var
|
109362
|
+
var parse13 = require_parse4();
|
109363
109363
|
var formats = require_formats();
|
109364
109364
|
module2.exports = {
|
109365
109365
|
formats,
|
109366
|
-
parse:
|
109366
|
+
parse: parse13,
|
109367
109367
|
stringify: stringify4
|
109368
109368
|
};
|
109369
109369
|
}
|
@@ -109397,7 +109397,7 @@ var require_urlencoded = __commonJS({
|
|
109397
109397
|
}
|
109398
109398
|
var queryparse = extended ? extendedparser(opts) : simpleparser(opts);
|
109399
109399
|
var shouldParse = typeof type2 !== "function" ? typeChecker(type2) : type2;
|
109400
|
-
function
|
109400
|
+
function parse13(body3) {
|
109401
109401
|
return body3.length ? queryparse(body3) : {};
|
109402
109402
|
}
|
109403
109403
|
return function urlencodedParser(req, res, next) {
|
@@ -109427,7 +109427,7 @@ var require_urlencoded = __commonJS({
|
|
109427
109427
|
}));
|
109428
109428
|
return;
|
109429
109429
|
}
|
109430
|
-
read(req, res, next,
|
109430
|
+
read(req, res, next, parse13, debug, {
|
109431
109431
|
debug,
|
109432
109432
|
encoding: charset,
|
109433
109433
|
inflate,
|
@@ -109438,7 +109438,7 @@ var require_urlencoded = __commonJS({
|
|
109438
109438
|
}
|
109439
109439
|
function extendedparser(options) {
|
109440
109440
|
var parameterLimit = options.parameterLimit !== void 0 ? options.parameterLimit : 1e3;
|
109441
|
-
var
|
109441
|
+
var parse13 = parser3("qs");
|
109442
109442
|
if (isNaN(parameterLimit) || parameterLimit < 1) {
|
109443
109443
|
throw new TypeError("option parameterLimit must be a positive number");
|
109444
109444
|
}
|
@@ -109455,7 +109455,7 @@ var require_urlencoded = __commonJS({
|
|
109455
109455
|
}
|
109456
109456
|
var arrayLimit = Math.max(100, paramCount);
|
109457
109457
|
debug("parse extended urlencoding");
|
109458
|
-
return
|
109458
|
+
return parse13(body3, {
|
109459
109459
|
allowPrototypes: true,
|
109460
109460
|
arrayLimit,
|
109461
109461
|
depth: Infinity,
|
@@ -109500,7 +109500,7 @@ var require_urlencoded = __commonJS({
|
|
109500
109500
|
}
|
109501
109501
|
function simpleparser(options) {
|
109502
109502
|
var parameterLimit = options.parameterLimit !== void 0 ? options.parameterLimit : 1e3;
|
109503
|
-
var
|
109503
|
+
var parse13 = parser3("querystring");
|
109504
109504
|
if (isNaN(parameterLimit) || parameterLimit < 1) {
|
109505
109505
|
throw new TypeError("option parameterLimit must be a positive number");
|
109506
109506
|
}
|
@@ -109516,7 +109516,7 @@ var require_urlencoded = __commonJS({
|
|
109516
109516
|
});
|
109517
109517
|
}
|
109518
109518
|
debug("parse urlencoding");
|
109519
|
-
return
|
109519
|
+
return parse13(body3, void 0, void 0, { maxKeys: parameterLimit });
|
109520
109520
|
};
|
109521
109521
|
}
|
109522
109522
|
function typeChecker(type2) {
|
@@ -109645,7 +109645,7 @@ var require_ms2 = __commonJS({
|
|
109645
109645
|
options = options || {};
|
109646
109646
|
var type2 = typeof val;
|
109647
109647
|
if (type2 === "string" && val.length > 0) {
|
109648
|
-
return
|
109648
|
+
return parse13(val);
|
109649
109649
|
} else if (type2 === "number" && isNaN(val) === false) {
|
109650
109650
|
return options.long ? fmtLong(val) : fmtShort(val);
|
109651
109651
|
}
|
@@ -109653,7 +109653,7 @@ var require_ms2 = __commonJS({
|
|
109653
109653
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
109654
109654
|
);
|
109655
109655
|
};
|
109656
|
-
function
|
109656
|
+
function parse13(str2) {
|
109657
109657
|
str2 = String(str2);
|
109658
109658
|
if (str2.length > 100) {
|
109659
109659
|
return;
|
@@ -110133,7 +110133,7 @@ var require_parseurl = __commonJS({
|
|
110133
110133
|
"../../node_modules/parseurl/index.js"(exports2, module2) {
|
110134
110134
|
"use strict";
|
110135
110135
|
var url = require("url");
|
110136
|
-
var
|
110136
|
+
var parse13 = url.parse;
|
110137
110137
|
var Url = url.Url;
|
110138
110138
|
module2.exports = parseurl;
|
110139
110139
|
module2.exports.original = originalurl;
|
@@ -110165,7 +110165,7 @@ var require_parseurl = __commonJS({
|
|
110165
110165
|
}
|
110166
110166
|
function fastparse(str2) {
|
110167
110167
|
if (typeof str2 !== "string" || str2.charCodeAt(0) !== 47) {
|
110168
|
-
return
|
110168
|
+
return parse13(str2);
|
110169
110169
|
}
|
110170
110170
|
var pathname = str2;
|
110171
110171
|
var query = null;
|
@@ -110187,7 +110187,7 @@ var require_parseurl = __commonJS({
|
|
110187
110187
|
case 35:
|
110188
110188
|
case 160:
|
110189
110189
|
case 65279:
|
110190
|
-
return
|
110190
|
+
return parse13(str2);
|
110191
110191
|
}
|
110192
110192
|
}
|
110193
110193
|
var url2 = Url !== void 0 ? new Url() : {};
|
@@ -110364,7 +110364,7 @@ var require_ms3 = __commonJS({
|
|
110364
110364
|
options = options || {};
|
110365
110365
|
var type2 = typeof val;
|
110366
110366
|
if (type2 === "string" && val.length > 0) {
|
110367
|
-
return
|
110367
|
+
return parse13(val);
|
110368
110368
|
} else if (type2 === "number" && isNaN(val) === false) {
|
110369
110369
|
return options.long ? fmtLong(val) : fmtShort(val);
|
110370
110370
|
}
|
@@ -110372,7 +110372,7 @@ var require_ms3 = __commonJS({
|
|
110372
110372
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
110373
110373
|
);
|
110374
110374
|
};
|
110375
|
-
function
|
110375
|
+
function parse13(str2) {
|
110376
110376
|
str2 = String(str2);
|
110377
110377
|
if (str2.length > 100) {
|
110378
110378
|
return;
|
@@ -111742,7 +111742,7 @@ var require_content_disposition = __commonJS({
|
|
111742
111742
|
"../../node_modules/content-disposition/index.js"(exports2, module2) {
|
111743
111743
|
"use strict";
|
111744
111744
|
module2.exports = contentDisposition;
|
111745
|
-
module2.exports.parse =
|
111745
|
+
module2.exports.parse = parse13;
|
111746
111746
|
var basename3 = require("path").basename;
|
111747
111747
|
var Buffer6 = require_safe_buffer().Buffer;
|
111748
111748
|
var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;
|
@@ -111833,7 +111833,7 @@ var require_content_disposition = __commonJS({
|
|
111833
111833
|
function getlatin1(val) {
|
111834
111834
|
return String(val).replace(NON_LATIN1_REGEXP, "?");
|
111835
111835
|
}
|
111836
|
-
function
|
111836
|
+
function parse13(string2) {
|
111837
111837
|
if (!string2 || typeof string2 !== "string") {
|
111838
111838
|
throw new TypeError("argument string is required");
|
111839
111839
|
}
|
@@ -111912,7 +111912,7 @@ var require_ms4 = __commonJS({
|
|
111912
111912
|
options = options || {};
|
111913
111913
|
var type2 = typeof val;
|
111914
111914
|
if (type2 === "string" && val.length > 0) {
|
111915
|
-
return
|
111915
|
+
return parse13(val);
|
111916
111916
|
} else if (type2 === "number" && isNaN(val) === false) {
|
111917
111917
|
return options.long ? fmtLong(val) : fmtShort(val);
|
111918
111918
|
}
|
@@ -111920,7 +111920,7 @@ var require_ms4 = __commonJS({
|
|
111920
111920
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
111921
111921
|
);
|
111922
111922
|
};
|
111923
|
-
function
|
111923
|
+
function parse13(str2) {
|
111924
111924
|
str2 = String(str2);
|
111925
111925
|
if (str2.length > 100) {
|
111926
111926
|
return;
|
@@ -112523,7 +112523,7 @@ var require_ms5 = __commonJS({
|
|
112523
112523
|
options = options || {};
|
112524
112524
|
var type2 = typeof val;
|
112525
112525
|
if (type2 === "string" && val.length > 0) {
|
112526
|
-
return
|
112526
|
+
return parse13(val);
|
112527
112527
|
} else if (type2 === "number" && isFinite(val)) {
|
112528
112528
|
return options.long ? fmtLong(val) : fmtShort(val);
|
112529
112529
|
}
|
@@ -112531,7 +112531,7 @@ var require_ms5 = __commonJS({
|
|
112531
112531
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
112532
112532
|
);
|
112533
112533
|
};
|
112534
|
-
function
|
112534
|
+
function parse13(str2) {
|
112535
112535
|
str2 = String(str2);
|
112536
112536
|
if (str2.length > 100) {
|
112537
112537
|
return;
|
@@ -113270,7 +113270,7 @@ var require_forwarded = __commonJS({
|
|
113270
113270
|
if (!req) {
|
113271
113271
|
throw new TypeError("argument req is required");
|
113272
113272
|
}
|
113273
|
-
var proxyAddrs =
|
113273
|
+
var proxyAddrs = parse13(req.headers["x-forwarded-for"] || "");
|
113274
113274
|
var socketAddr = getSocketAddr(req);
|
113275
113275
|
var addrs = [socketAddr].concat(proxyAddrs);
|
113276
113276
|
return addrs;
|
@@ -113278,7 +113278,7 @@ var require_forwarded = __commonJS({
|
|
113278
113278
|
function getSocketAddr(req) {
|
113279
113279
|
return req.socket ? req.socket.remoteAddress : req.connection.remoteAddress;
|
113280
113280
|
}
|
113281
|
-
function
|
113281
|
+
function parse13(header) {
|
113282
113282
|
var end = header.length;
|
113283
113283
|
var list6 = [];
|
113284
113284
|
var start = header.length;
|
@@ -115106,7 +115106,7 @@ var require_request = __commonJS({
|
|
115106
115106
|
var http5 = require("http");
|
115107
115107
|
var fresh = require_fresh();
|
115108
115108
|
var parseRange = require_range_parser();
|
115109
|
-
var
|
115109
|
+
var parse13 = require_parseurl();
|
115110
115110
|
var proxyaddr = require_proxy_addr();
|
115111
115111
|
var req = Object.create(http5.IncomingMessage.prototype);
|
115112
115112
|
module2.exports = req;
|
@@ -115216,7 +115216,7 @@ var require_request = __commonJS({
|
|
115216
115216
|
return subdomains2.slice(offset);
|
115217
115217
|
});
|
115218
115218
|
defineGetter(req, "path", function path42() {
|
115219
|
-
return
|
115219
|
+
return parse13(this).pathname;
|
115220
115220
|
});
|
115221
115221
|
defineGetter(req, "hostname", function hostname() {
|
115222
115222
|
var trust = this.app.get("trust proxy fn");
|
@@ -115295,11 +115295,11 @@ var require_cookie_signature = __commonJS({
|
|
115295
115295
|
var require_cookie = __commonJS({
|
115296
115296
|
"../../node_modules/cookie/index.js"(exports2) {
|
115297
115297
|
"use strict";
|
115298
|
-
exports2.parse =
|
115298
|
+
exports2.parse = parse13;
|
115299
115299
|
exports2.serialize = serialize3;
|
115300
115300
|
var __toString = Object.prototype.toString;
|
115301
115301
|
var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
115302
|
-
function
|
115302
|
+
function parse13(str2, options) {
|
115303
115303
|
if (typeof str2 !== "string") {
|
115304
115304
|
throw new TypeError("argument str must be a string");
|
115305
115305
|
}
|
@@ -118176,7 +118176,7 @@ var require_extension = __commonJS({
|
|
118176
118176
|
else
|
118177
118177
|
dest[name3].push(elem);
|
118178
118178
|
}
|
118179
|
-
function
|
118179
|
+
function parse13(header) {
|
118180
118180
|
const offers = /* @__PURE__ */ Object.create(null);
|
118181
118181
|
let params = /* @__PURE__ */ Object.create(null);
|
118182
118182
|
let mustUnescape = false;
|
@@ -118331,7 +118331,7 @@ var require_extension = __commonJS({
|
|
118331
118331
|
}).join(", ");
|
118332
118332
|
}).join(", ");
|
118333
118333
|
}
|
118334
|
-
module2.exports = { format, parse:
|
118334
|
+
module2.exports = { format, parse: parse13 };
|
118335
118335
|
}
|
118336
118336
|
});
|
118337
118337
|
|
@@ -118363,7 +118363,7 @@ var require_websocket = __commonJS({
|
|
118363
118363
|
var {
|
118364
118364
|
EventTarget: { addEventListener, removeEventListener }
|
118365
118365
|
} = require_event_target();
|
118366
|
-
var { format, parse:
|
118366
|
+
var { format, parse: parse13 } = require_extension();
|
118367
118367
|
var { toBuffer } = require_buffer_util();
|
118368
118368
|
var closeTimeout = 30 * 1e3;
|
118369
118369
|
var kAborted = Symbol("kAborted");
|
@@ -119038,7 +119038,7 @@ var require_websocket = __commonJS({
|
|
119038
119038
|
}
|
119039
119039
|
let extensions;
|
119040
119040
|
try {
|
119041
|
-
extensions =
|
119041
|
+
extensions = parse13(secWebSocketExtensions);
|
119042
119042
|
} catch (err) {
|
119043
119043
|
const message = "Invalid Sec-WebSocket-Extensions header";
|
119044
119044
|
abortHandshake(websocket, socket, message);
|
@@ -119212,7 +119212,7 @@ var require_subprotocol = __commonJS({
|
|
119212
119212
|
"../../node_modules/ws/lib/subprotocol.js"(exports2, module2) {
|
119213
119213
|
"use strict";
|
119214
119214
|
var { tokenChars } = require_validation();
|
119215
|
-
function
|
119215
|
+
function parse13(header) {
|
119216
119216
|
const protocols = /* @__PURE__ */ new Set();
|
119217
119217
|
let start = -1;
|
119218
119218
|
let end = -1;
|
@@ -119251,7 +119251,7 @@ var require_subprotocol = __commonJS({
|
|
119251
119251
|
protocols.add(protocol);
|
119252
119252
|
return protocols;
|
119253
119253
|
}
|
119254
|
-
module2.exports = { parse:
|
119254
|
+
module2.exports = { parse: parse13 };
|
119255
119255
|
}
|
119256
119256
|
});
|
119257
119257
|
|
@@ -120641,7 +120641,7 @@ var require_parse5 = __commonJS({
|
|
120641
120641
|
var syntaxError = (type2, char) => {
|
120642
120642
|
return `Missing ${type2}: "${char}" - use "\\\\${char}" to match literal characters`;
|
120643
120643
|
};
|
120644
|
-
var
|
120644
|
+
var parse13 = (input3, options) => {
|
120645
120645
|
if (typeof input3 !== "string") {
|
120646
120646
|
throw new TypeError("Expected a string");
|
120647
120647
|
}
|
@@ -120791,7 +120791,7 @@ var require_parse5 = __commonJS({
|
|
120791
120791
|
output2 = token.close = `)$))${extglobStar}`;
|
120792
120792
|
}
|
120793
120793
|
if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
120794
|
-
const expression =
|
120794
|
+
const expression = parse13(rest, { ...options, fastpaths: false }).output;
|
120795
120795
|
output2 = token.close = `)${expression})${extglobStar})`;
|
120796
120796
|
}
|
120797
120797
|
if (token.prev.type === "bos") {
|
@@ -121320,7 +121320,7 @@ var require_parse5 = __commonJS({
|
|
121320
121320
|
}
|
121321
121321
|
return state;
|
121322
121322
|
};
|
121323
|
-
|
121323
|
+
parse13.fastpaths = (input3, options) => {
|
121324
121324
|
const opts = { ...options };
|
121325
121325
|
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
121326
121326
|
const len = input3.length;
|
@@ -121389,7 +121389,7 @@ var require_parse5 = __commonJS({
|
|
121389
121389
|
}
|
121390
121390
|
return source2;
|
121391
121391
|
};
|
121392
|
-
module2.exports =
|
121392
|
+
module2.exports = parse13;
|
121393
121393
|
}
|
121394
121394
|
});
|
121395
121395
|
|
@@ -121399,7 +121399,7 @@ var require_picomatch = __commonJS({
|
|
121399
121399
|
"use strict";
|
121400
121400
|
var path42 = require("path");
|
121401
121401
|
var scan2 = require_scan2();
|
121402
|
-
var
|
121402
|
+
var parse13 = require_parse5();
|
121403
121403
|
var utils2 = require_utils13();
|
121404
121404
|
var constants2 = require_constants4();
|
121405
121405
|
var isObject2 = (val) => val && typeof val === "object" && !Array.isArray(val);
|
@@ -121489,7 +121489,7 @@ var require_picomatch = __commonJS({
|
|
121489
121489
|
picomatch.parse = (pattern, options) => {
|
121490
121490
|
if (Array.isArray(pattern))
|
121491
121491
|
return pattern.map((p5) => picomatch.parse(p5, options));
|
121492
|
-
return
|
121492
|
+
return parse13(pattern, { ...options, fastpaths: false });
|
121493
121493
|
};
|
121494
121494
|
picomatch.scan = (input3, options) => scan2(input3, options);
|
121495
121495
|
picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
@@ -121515,10 +121515,10 @@ var require_picomatch = __commonJS({
|
|
121515
121515
|
}
|
121516
121516
|
let parsed = { negated: false, fastpaths: true };
|
121517
121517
|
if (options.fastpaths !== false && (input3[0] === "." || input3[0] === "*")) {
|
121518
|
-
parsed.output =
|
121518
|
+
parsed.output = parse13.fastpaths(input3, options);
|
121519
121519
|
}
|
121520
121520
|
if (!parsed.output) {
|
121521
|
-
parsed =
|
121521
|
+
parsed = parse13(input3, options);
|
121522
121522
|
}
|
121523
121523
|
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
121524
121524
|
};
|
@@ -122406,7 +122406,7 @@ var require_fill_range = __commonJS({
|
|
122406
122406
|
var util3 = require("util");
|
122407
122407
|
var toRegexRange = require_to_regex_range();
|
122408
122408
|
var isObject2 = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
122409
|
-
var
|
122409
|
+
var transform3 = (toNumber) => {
|
122410
122410
|
return (value) => toNumber === true ? Number(value) : String(value);
|
122411
122411
|
};
|
122412
122412
|
var isValidValue = (value) => {
|
@@ -122527,7 +122527,7 @@ var require_fill_range = __commonJS({
|
|
122527
122527
|
let padded = zeros(startString) || zeros(endString) || zeros(stepString);
|
122528
122528
|
let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
|
122529
122529
|
let toNumber = padded === false && stringify4(start, end, options) === false;
|
122530
|
-
let format = options.transform ||
|
122530
|
+
let format = options.transform || transform3(toNumber);
|
122531
122531
|
if (options.toRegex && step === 1) {
|
122532
122532
|
return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
|
122533
122533
|
}
|
@@ -122888,7 +122888,7 @@ var require_parse6 = __commonJS({
|
|
122888
122888
|
CHAR_NO_BREAK_SPACE,
|
122889
122889
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE
|
122890
122890
|
} = require_constants5();
|
122891
|
-
var
|
122891
|
+
var parse13 = (input3, options = {}) => {
|
122892
122892
|
if (typeof input3 !== "string") {
|
122893
122893
|
throw new TypeError("Expected a string");
|
122894
122894
|
}
|
@@ -123094,7 +123094,7 @@ var require_parse6 = __commonJS({
|
|
123094
123094
|
push({ type: "eos" });
|
123095
123095
|
return ast;
|
123096
123096
|
};
|
123097
|
-
module2.exports =
|
123097
|
+
module2.exports = parse13;
|
123098
123098
|
}
|
123099
123099
|
});
|
123100
123100
|
|
@@ -123105,7 +123105,7 @@ var require_braces = __commonJS({
|
|
123105
123105
|
var stringify4 = require_stringify4();
|
123106
123106
|
var compile2 = require_compile();
|
123107
123107
|
var expand2 = require_expand();
|
123108
|
-
var
|
123108
|
+
var parse13 = require_parse6();
|
123109
123109
|
var braces = (input3, options = {}) => {
|
123110
123110
|
let output2 = [];
|
123111
123111
|
if (Array.isArray(input3)) {
|
@@ -123125,7 +123125,7 @@ var require_braces = __commonJS({
|
|
123125
123125
|
}
|
123126
123126
|
return output2;
|
123127
123127
|
};
|
123128
|
-
braces.parse = (input3, options = {}) =>
|
123128
|
+
braces.parse = (input3, options = {}) => parse13(input3, options);
|
123129
123129
|
braces.stringify = (input3, options = {}) => {
|
123130
123130
|
if (typeof input3 === "string") {
|
123131
123131
|
return stringify4(braces.parse(input3, options), options);
|
@@ -124234,7 +124234,7 @@ var require_fsevents_handler = __commonJS({
|
|
124234
124234
|
* @param {Function} globFilter - path filter in case a glob pattern was provided
|
124235
124235
|
* @returns {Function} closer for the watcher instance
|
124236
124236
|
*/
|
124237
|
-
_watchWithFsEvents(watchPath, realPath,
|
124237
|
+
_watchWithFsEvents(watchPath, realPath, transform3, globFilter) {
|
124238
124238
|
if (this.fsw.closed || this.fsw._isIgnored(watchPath))
|
124239
124239
|
return;
|
124240
124240
|
const opts = this.fsw.options;
|
@@ -124243,7 +124243,7 @@ var require_fsevents_handler = __commonJS({
|
|
124243
124243
|
return;
|
124244
124244
|
if (opts.depth !== void 0 && calcDepth(fullPath2, realPath) > opts.depth)
|
124245
124245
|
return;
|
124246
|
-
const path42 =
|
124246
|
+
const path42 = transform3(sysPath.join(
|
124247
124247
|
watchPath,
|
124248
124248
|
sysPath.relative(watchPath, fullPath2)
|
124249
124249
|
));
|
@@ -124301,7 +124301,7 @@ var require_fsevents_handler = __commonJS({
|
|
124301
124301
|
* @param {Number} curDepth level of subdirectories traversed to where symlink is
|
124302
124302
|
* @returns {Promise<void>}
|
124303
124303
|
*/
|
124304
|
-
async _handleFsEventsSymlink(linkPath, fullPath2,
|
124304
|
+
async _handleFsEventsSymlink(linkPath, fullPath2, transform3, curDepth) {
|
124305
124305
|
if (this.fsw.closed || this.fsw._symlinkPaths.has(fullPath2))
|
124306
124306
|
return;
|
124307
124307
|
this.fsw._symlinkPaths.set(fullPath2, true);
|
@@ -124321,7 +124321,7 @@ var require_fsevents_handler = __commonJS({
|
|
124321
124321
|
} else if (path42 !== DOT_SLASH) {
|
124322
124322
|
aliasedPath = sysPath.join(linkPath, path42);
|
124323
124323
|
}
|
124324
|
-
return
|
124324
|
+
return transform3(aliasedPath);
|
124325
124325
|
}, false, curDepth);
|
124326
124326
|
} catch (error) {
|
124327
124327
|
if (this.fsw._handleError(error)) {
|
@@ -124367,12 +124367,12 @@ var require_fsevents_handler = __commonJS({
|
|
124367
124367
|
* @param {Number=} priorDepth Level of subdirectories already traversed.
|
124368
124368
|
* @returns {Promise<void>}
|
124369
124369
|
*/
|
124370
|
-
async _addToFsEvents(path42,
|
124370
|
+
async _addToFsEvents(path42, transform3, forceAdd, priorDepth) {
|
124371
124371
|
if (this.fsw.closed) {
|
124372
124372
|
return;
|
124373
124373
|
}
|
124374
124374
|
const opts = this.fsw.options;
|
124375
|
-
const processPath = typeof
|
124375
|
+
const processPath = typeof transform3 === FUNCTION_TYPE ? transform3 : IDENTITY_FN;
|
124376
124376
|
const wh = this.fsw._getWatchHelpers(path42);
|
124377
124377
|
try {
|
124378
124378
|
const stats = await statMethods[wh.statMethod](wh.watchPath);
|
@@ -124418,7 +124418,7 @@ var require_fsevents_handler = __commonJS({
|
|
124418
124418
|
}
|
124419
124419
|
}
|
124420
124420
|
if (opts.persistent && forceAdd !== true) {
|
124421
|
-
if (typeof
|
124421
|
+
if (typeof transform3 === FUNCTION_TYPE) {
|
124422
124422
|
this.initWatch(void 0, path42, wh, processPath);
|
124423
124423
|
} else {
|
124424
124424
|
let realPath;
|
@@ -126565,8 +126565,8 @@ var require_nodes = __commonJS({
|
|
126565
126565
|
if (line2 && (inline && i2 > 0 || !inline)) {
|
126566
126566
|
process.stdout.write(" ".repeat(indent2));
|
126567
126567
|
}
|
126568
|
-
var
|
126569
|
-
process.stdout.write("" + line2 +
|
126568
|
+
var nl3 = i2 === lines.length - 1 ? "" : "\n";
|
126569
|
+
process.stdout.write("" + line2 + nl3);
|
126570
126570
|
});
|
126571
126571
|
}
|
126572
126572
|
function printNodes(node3, indent2) {
|
@@ -127588,7 +127588,7 @@ var require_parser4 = __commonJS({
|
|
127588
127588
|
}
|
127589
127589
|
return buf;
|
127590
127590
|
};
|
127591
|
-
_proto.parse = function
|
127591
|
+
_proto.parse = function parse13() {
|
127592
127592
|
return new nodes.NodeList(0, 0, this.parseNodes());
|
127593
127593
|
};
|
127594
127594
|
_proto.parseAsRoot = function parseAsRoot() {
|
@@ -127597,7 +127597,7 @@ var require_parser4 = __commonJS({
|
|
127597
127597
|
return Parser4;
|
127598
127598
|
}(Obj);
|
127599
127599
|
module2.exports = {
|
127600
|
-
parse: function
|
127600
|
+
parse: function parse13(src, extensions, opts) {
|
127601
127601
|
var p5 = new Parser3(lexer.lex(src, opts));
|
127602
127602
|
if (extensions !== void 0) {
|
127603
127603
|
p5.extensions = extensions;
|
@@ -127761,11 +127761,11 @@ var require_transformer = __commonJS({
|
|
127761
127761
|
function cps(ast, asyncFilters) {
|
127762
127762
|
return convertStatements(liftSuper(liftFilters(ast, asyncFilters)));
|
127763
127763
|
}
|
127764
|
-
function
|
127764
|
+
function transform3(ast, asyncFilters) {
|
127765
127765
|
return cps(ast, asyncFilters || []);
|
127766
127766
|
}
|
127767
127767
|
module2.exports = {
|
127768
|
-
transform:
|
127768
|
+
transform: transform3
|
127769
127769
|
};
|
127770
127770
|
}
|
127771
127771
|
});
|
@@ -136903,7 +136903,7 @@ var require_build = __commonJS({
|
|
136903
136903
|
var n = {};
|
136904
136904
|
return (() => {
|
136905
136905
|
"use strict";
|
136906
|
-
r2.r(n), r2.d(n, { AbstractNumbering: () => Ji, Alignment: () => D2, AlignmentAttributes: () => L, AlignmentType: () => m2, Attributes: () => a2, BaseEmphasisMark: () => Q, BaseXmlComponent: () => e3, Body: () => un, Bookmark: () => Or, BookmarkEnd: () => Lr, BookmarkStart: () => kr, Border: () => B, BorderElement: () => P, BorderStyle: () => w, Column: () => hn, ColumnAttributes: () => ln, ColumnBreak: () => pr, Columns: () => jr, ColumnsAttributes: () => zr, Comment: () =>
|
136906
|
+
r2.r(n), r2.d(n, { AbstractNumbering: () => Ji, Alignment: () => D2, AlignmentAttributes: () => L, AlignmentType: () => m2, Attributes: () => a2, BaseEmphasisMark: () => Q, BaseXmlComponent: () => e3, Body: () => un, Bookmark: () => Or, BookmarkEnd: () => Lr, BookmarkStart: () => kr, Border: () => B, BorderElement: () => P, BorderStyle: () => w, Column: () => hn, ColumnAttributes: () => ln, ColumnBreak: () => pr, Columns: () => jr, ColumnsAttributes: () => zr, Comment: () => cr3, CommentRangeEnd: () => or, CommentRangeStart: () => ir, CommentReference: () => ar, Comments: () => ur, ConcreteHyperlink: () => Sr, ConcreteNumbering: () => to, DeletedTextRun: () => na, DocGridAttributes: () => Wr, Document: () => Ho, DocumentAttributes: () => pn, DocumentBackground: () => fn, DocumentBackgroundAttributes: () => dn, DocumentDefaults: () => Bo, DocumentGrid: () => Kr, DocumentGridType: () => Pe, DotEmphasisMark: () => te, Drawing: () => Xt, DropCapType: () => vn, EMPTY_OBJECT: () => t3, EmphasisMark: () => ee, EmphasisMarkType: () => E, ExternalHyperlink: () => Rr, File: () => Ho, FootNoteReferenceRunAttributes: () => qo, FootNotes: () => ki, Footer: () => Xo, FooterWrapper: () => _i, FootnoteReference: () => Zo, FootnoteReferenceRun: () => Yo, FrameAnchorType: () => _n, FrameProperties: () => An, FramePropertiesAttributes: () => Tn, FrameWrap: () => En, GridSpan: () => ks, Header: () => $o, HeaderFooterReference: () => Hr, HeaderFooterReferenceType: () => Le, HeaderFooterType: () => De, HeaderWrapper: () => Fi, HeadingLevel: () => Se, HeightRule: () => $s, HorizontalPosition: () => Ze, HorizontalPositionAlign: () => y, HorizontalPositionRelativeFrom: () => xe, HpsMeasureElement: () => R, HyperlinkType: () => Oe, IgnoreIfEmptyXmlComponent: () => i2, ImageRun: () => qt, ImportDotx: () => wa, ImportedRootElementAttributes: () => p5, ImportedXmlComponent: () => h4, Indent: () => H, InitializableXmlComponent: () => f3, InsertedTextRun: () => Jo, InternalHyperlink: () => Ir, LeaderType: () => Re, Level: () => Xi, LevelBase: () => $i, LevelForOverride: () => qi, LevelFormat: () => Ui, LevelOverride: () => no, LevelSuffix: () => Hi, LineNumberAttributes: () => Gr, LineNumberRestartFormat: () => Fe, LineNumberType: () => Vr, LineRuleType: () => Ae, Math: () => Rn, MathAccentCharacter: () => Pn, MathAngledBrackets: () => bs, MathBase: () => Fn, MathCurlyBrackets: () => ys, MathDegree: () => ns, MathDenominator: () => On, MathFraction: () => Ln, MathFunction: () => ls, MathFunctionName: () => cs, MathFunctionProperties: () => us, MathIntegral: () => $n, MathLimitLocation: () => Mn, MathNAryProperties: () => Wn, MathNumerator: () => kn, MathPreSubSuperScript: () => ts, MathPreSubSuperScriptProperties: () => es, MathRadical: () => as, MathRadicalProperties: () => os10, MathRoundBrackets: () => ws, MathRun: () => Cn, MathSquareBrackets: () => gs, MathSubScript: () => Yn, MathSubScriptElement: () => Kn, MathSubScriptProperties: () => Zn, MathSubSuperScript: () => Qn, MathSubSuperScriptProperties: () => Jn, MathSum: () => Vn, MathSuperScript: () => qn, MathSuperScriptElement: () => Gn, MathSuperScriptProperties: () => Xn, Media: () => Bi, NumberFormat: () => x2, NumberProperties: () => xr, NumberValueElement: () => C, Numbering: () => oo, OnOffElement: () => I, OutlineLevel: () => Dr, OverlapType: () => Gs, Packer: () => pa, PageBorderDisplay: () => Be, PageBorderOffsetFrom: () => Me, PageBorderZOrder: () => Ue, PageBorders: () => Xr, PageBreak: () => hr2, PageBreakBefore: () => dr, PageMargin: () => Zr, PageMarginAttributes: () => qr, PageNumber: () => A2, PageNumberSeparator: () => He, PageNumberType: () => Jr, PageNumberTypeAttributes: () => Yr, PageOrientation: () => ze, PageReference: () => Fr, PageSize: () => en, PageSizeAttributes: () => Qr, PageTextDirection: () => rn, PageTextDirectionType: () => je, Paragraph: () => In, ParagraphProperties: () => Sn, ParagraphPropertiesDefaults: () => Po, PrettifyType: () => la, RelativeHorizontalPosition: () => Ws, RelativeVerticalPosition: () => Ks, Run: () => me, RunFonts: () => ae, RunProperties: () => pe, RunPropertiesChange: () => de, RunPropertiesDefaults: () => Fo, SectionProperties: () => cn, SectionType: () => We, SectionTypeAttributes: () => nn, SequentialIdentifier: () => Yt, Shading: () => Y, ShadingType: () => _3, SimpleField: () => er, SimpleMailMergeField: () => tr3, SimplePos: () => Ve, SpaceType: () => v, Spacing: () => mr, StringContainer: () => k, StringEnumValueElement: () => O, StringValueElement: () => N, Style: () => wr, StyleForCharacter: () => bo, StyleForParagraph: () => yo, StyleLevel: () => Vo, Styles: () => Do, SymbolRun: () => be, TDirection: () => Fs, Tab: () => Jt, TabAttributes: () => yr, TabStop: () => gr, TabStopItem: () => br3, TabStopPosition: () => Ne, TabStopType: () => Ie, Table: () => ei, TableAnchorType: () => js, TableBorders: () => zs, TableCell: () => Ms, TableCellBorders: () => Cs, TableFloatOptionsAttributes: () => qs, TableFloatProperties: () => Zs, TableLayout: () => Js, TableLayoutType: () => Vs, TableOfContents: () => Go, TableProperties: () => Qs, TableRow: () => si, TableRowHeight: () => ri, TableRowHeightAttributes: () => ti, TableRowProperties: () => ni, TableWidthElement: () => Rs, TextDirection: () => Ss, TextRun: () => we, TextWrappingSide: () => Ee, TextWrappingType: () => _e, ThematicBreak: () => M, Type: () => sn, Underline: () => he2, UnderlineType: () => T2, VerticalAlign: () => ke, VerticalAlignAttributes: () => Br, VerticalAlignElement: () => Mr, VerticalMerge: () => Ds, VerticalMergeType: () => As, VerticalPosition: () => Je, VerticalPositionAlign: () => b, VerticalPositionRelativeFrom: () => ve, WORKAROUND: () => zo, WORKAROUND2: () => Mi, WORKAROUND3: () => d, WORKAROUND4: () => rs, WidthType: () => Es, WrapNone: () => Rt, WrapSquare: () => Ct, WrapTight: () => kt, WrapTopAndBottom: () => Dt, XmlAttributeComponent: () => o, XmlComponent: () => s5, convertInchesToTwip: () => ga.convertInchesToTwip, convertMillimetersToTwip: () => ga.convertMillimetersToTwip, convertToXmlComponent: () => u3, dateTimeValue: () => ga.dateTimeValue, decimalNumber: () => ga.decimalNumber, eighthPointMeasureValue: () => ga.eighthPointMeasureValue, hexColorValue: () => ga.hexColorValue, hpsMeasureValue: () => ga.hpsMeasureValue, longHexNumber: () => ga.longHexNumber, measurementOrPercentValue: () => ga.measurementOrPercentValue, percentageValue: () => ga.percentageValue, pointMeasureValue: () => ga.pointMeasureValue, positiveUniversalMeasureValue: () => ga.positiveUniversalMeasureValue, sectionMarginDefaults: () => on, sectionPageSizeDefaults: () => an, shortHexNumber: () => ga.shortHexNumber, signedHpsMeasureValue: () => ga.signedHpsMeasureValue, signedTwipsMeasureValue: () => ga.signedTwipsMeasureValue, twipsMeasureValue: () => ga.twipsMeasureValue, uCharHexNumber: () => ga.uCharHexNumber, uniqueId: () => ga.uniqueId, uniqueNumericId: () => ga.uniqueNumericId, universalMeasureValue: () => ga.universalMeasureValue, unsignedDecimalNumber: () => ga.unsignedDecimalNumber });
|
136907
136907
|
class e3 {
|
136908
136908
|
constructor(e4) {
|
136909
136909
|
this.rootKey = e4;
|
@@ -137718,7 +137718,7 @@ var require_build = __commonJS({
|
|
137718
137718
|
super("w:commentReference"), this.root.push(new nr({ id: e4 }));
|
137719
137719
|
}
|
137720
137720
|
}
|
137721
|
-
class
|
137721
|
+
class cr3 extends s5 {
|
137722
137722
|
constructor({ id: e4, initials: t4, author: r3, date: n2 = /* @__PURE__ */ new Date(), text: s6 }) {
|
137723
137723
|
super("w:comment"), this.root.push(new rr({ id: e4, initials: t4, author: r3, date: n2.toISOString() })), this.root.push(new In({ children: [new we(s6)] }));
|
137724
137724
|
}
|
@@ -137727,7 +137727,7 @@ var require_build = __commonJS({
|
|
137727
137727
|
constructor({ children: e4 }) {
|
137728
137728
|
super("w:comments"), this.root.push(new sr({ "xmlns:cx": "http://schemas.microsoft.com/office/drawing/2014/chartex", "xmlns:cx1": "http://schemas.microsoft.com/office/drawing/2015/9/8/chartex", "xmlns:cx2": "http://schemas.microsoft.com/office/drawing/2015/10/21/chartex", "xmlns:cx3": "http://schemas.microsoft.com/office/drawing/2016/5/9/chartex", "xmlns:cx4": "http://schemas.microsoft.com/office/drawing/2016/5/10/chartex", "xmlns:cx5": "http://schemas.microsoft.com/office/drawing/2016/5/11/chartex", "xmlns:cx6": "http://schemas.microsoft.com/office/drawing/2016/5/12/chartex", "xmlns:cx7": "http://schemas.microsoft.com/office/drawing/2016/5/13/chartex", "xmlns:cx8": "http://schemas.microsoft.com/office/drawing/2016/5/14/chartex", "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006", "xmlns:aink": "http://schemas.microsoft.com/office/drawing/2016/ink", "xmlns:am3d": "http://schemas.microsoft.com/office/drawing/2017/model3d", "xmlns:o": "urn:schemas-microsoft-com:office:office", "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships", "xmlns:m": "http://schemas.openxmlformats.org/officeDocument/2006/math", "xmlns:v": "urn:schemas-microsoft-com:vml", "xmlns:wp14": "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing", "xmlns:wp": "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "xmlns:w10": "urn:schemas-microsoft-com:office:word", "xmlns:w": "http://schemas.openxmlformats.org/wordprocessingml/2006/main", "xmlns:w14": "http://schemas.microsoft.com/office/word/2010/wordml", "xmlns:w15": "http://schemas.microsoft.com/office/word/2012/wordml", "xmlns:w16cex": "http://schemas.microsoft.com/office/word/2018/wordml/cex", "xmlns:w16cid": "http://schemas.microsoft.com/office/word/2016/wordml/cid", "xmlns:w16": "http://schemas.microsoft.com/office/word/2018/wordml", "xmlns:w16sdtdh": "http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash", "xmlns:w16se": "http://schemas.microsoft.com/office/word/2015/wordml/symex", "xmlns:wpg": "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup", "xmlns:wpi": "http://schemas.microsoft.com/office/word/2010/wordprocessingInk", "xmlns:wne": "http://schemas.microsoft.com/office/word/2006/wordml", "xmlns:wps": "http://schemas.microsoft.com/office/word/2010/wordprocessingShape" }));
|
137729
137729
|
for (const t4 of e4)
|
137730
|
-
this.root.push(new
|
137730
|
+
this.root.push(new cr3(t4));
|
137731
137731
|
}
|
137732
137732
|
}
|
137733
137733
|
!function(e4) {
|
@@ -152585,7 +152585,7 @@ var require_overRest = __commonJS({
|
|
152585
152585
|
"../../node_modules/lodash/_overRest.js"(exports2, module2) {
|
152586
152586
|
var apply = require_apply();
|
152587
152587
|
var nativeMax = Math.max;
|
152588
|
-
function overRest(func, start,
|
152588
|
+
function overRest(func, start, transform3) {
|
152589
152589
|
start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
|
152590
152590
|
return function() {
|
152591
152591
|
var args = arguments, index4 = -1, length = nativeMax(args.length - start, 0), array = Array(length);
|
@@ -152597,7 +152597,7 @@ var require_overRest = __commonJS({
|
|
152597
152597
|
while (++index4 < start) {
|
152598
152598
|
otherArgs[index4] = args[index4];
|
152599
152599
|
}
|
152600
|
-
otherArgs[start] =
|
152600
|
+
otherArgs[start] = transform3(array);
|
152601
152601
|
return apply(func, this, otherArgs);
|
152602
152602
|
};
|
152603
152603
|
}
|
@@ -153807,9 +153807,9 @@ var require_copyObject = __commonJS({
|
|
153807
153807
|
// ../../node_modules/lodash/_overArg.js
|
153808
153808
|
var require_overArg = __commonJS({
|
153809
153809
|
"../../node_modules/lodash/_overArg.js"(exports2, module2) {
|
153810
|
-
function overArg(func,
|
153810
|
+
function overArg(func, transform3) {
|
153811
153811
|
return function(arg2) {
|
153812
|
-
return func(
|
153812
|
+
return func(transform3(arg2));
|
153813
153813
|
};
|
153814
153814
|
}
|
153815
153815
|
module2.exports = overArg;
|
@@ -175178,7 +175178,7 @@ var require_ini = __commonJS({
|
|
175178
175178
|
var parts = dotSplit(k);
|
175179
175179
|
var p6 = out;
|
175180
175180
|
var l = parts.pop();
|
175181
|
-
var
|
175181
|
+
var nl3 = l.replace(/\\\./g, ".");
|
175182
175182
|
parts.forEach(function(part, _4, __2) {
|
175183
175183
|
if (part === "__proto__")
|
175184
175184
|
return;
|
@@ -175186,9 +175186,9 @@ var require_ini = __commonJS({
|
|
175186
175186
|
p6[part] = {};
|
175187
175187
|
p6 = p6[part];
|
175188
175188
|
});
|
175189
|
-
if (p6 === out &&
|
175189
|
+
if (p6 === out && nl3 === l)
|
175190
175190
|
return false;
|
175191
|
-
p6[
|
175191
|
+
p6[nl3] = out[k];
|
175192
175192
|
return true;
|
175193
175193
|
}).forEach(function(del2, _3, __) {
|
175194
175194
|
delete out[del2];
|
@@ -175312,7 +175312,7 @@ var require_utils15 = __commonJS({
|
|
175312
175312
|
var ini = require_ini();
|
175313
175313
|
var path42 = require("path");
|
175314
175314
|
var stripJsonComments = require_strip_json_comments();
|
175315
|
-
var
|
175315
|
+
var parse13 = exports2.parse = function(content3) {
|
175316
175316
|
if (/^\s*{/.test(content3))
|
175317
175317
|
return JSON.parse(stripJsonComments(content3));
|
175318
175318
|
return ini.parse(content3);
|
@@ -175334,7 +175334,7 @@ var require_utils15 = __commonJS({
|
|
175334
175334
|
};
|
175335
175335
|
var json2 = exports2.json = function() {
|
175336
175336
|
var content3 = file.apply(null, arguments);
|
175337
|
-
return content3 ?
|
175337
|
+
return content3 ? parse13(content3) : null;
|
175338
175338
|
};
|
175339
175339
|
var env7 = exports2.env = function(prefix2, env8) {
|
175340
175340
|
env8 = env8 || process.env;
|
@@ -175691,13 +175691,13 @@ var require_rc = __commonJS({
|
|
175691
175691
|
var etc = "/etc";
|
175692
175692
|
var win = process.platform === "win32";
|
175693
175693
|
var home = win ? process.env.USERPROFILE : process.env.HOME;
|
175694
|
-
module2.exports = function(name3, defaults4, argv,
|
175694
|
+
module2.exports = function(name3, defaults4, argv, parse13) {
|
175695
175695
|
if ("string" !== typeof name3)
|
175696
175696
|
throw new Error("rc(name): name *must* be string");
|
175697
175697
|
if (!argv)
|
175698
175698
|
argv = require_minimist()(process.argv.slice(2));
|
175699
175699
|
defaults4 = ("string" === typeof defaults4 ? cc.json(defaults4) : defaults4) || {};
|
175700
|
-
|
175700
|
+
parse13 = parse13 || cc.parse;
|
175701
175701
|
var env7 = cc.env(name3 + "_");
|
175702
175702
|
var configs = [defaults4];
|
175703
175703
|
var configFiles = [];
|
@@ -175706,7 +175706,7 @@ var require_rc = __commonJS({
|
|
175706
175706
|
return;
|
175707
175707
|
var fileConfig = cc.file(file);
|
175708
175708
|
if (fileConfig) {
|
175709
|
-
configs.push(
|
175709
|
+
configs.push(parse13(fileConfig));
|
175710
175710
|
configFiles.push(file);
|
175711
175711
|
}
|
175712
175712
|
}
|
@@ -176732,7 +176732,7 @@ var require_config_chain = __commonJS({
|
|
176732
176732
|
}
|
176733
176733
|
return find3(__dirname, rel2);
|
176734
176734
|
};
|
176735
|
-
var
|
176735
|
+
var parse13 = exports2.parse = function(content3, file, type2) {
|
176736
176736
|
content3 = "" + content3;
|
176737
176737
|
if (!type2) {
|
176738
176738
|
try {
|
@@ -176765,7 +176765,7 @@ var require_config_chain = __commonJS({
|
|
176765
176765
|
} catch (err) {
|
176766
176766
|
return;
|
176767
176767
|
}
|
176768
|
-
return
|
176768
|
+
return parse13(content3, file, "json");
|
176769
176769
|
};
|
176770
176770
|
var env7 = exports2.env = function(prefix2, env8) {
|
176771
176771
|
env8 = env8 || process.env;
|
@@ -178148,7 +178148,7 @@ var require_semver2 = __commonJS({
|
|
178148
178148
|
var require_parse7 = __commonJS({
|
178149
178149
|
"../../node_modules/semver/functions/parse.js"(exports2, module2) {
|
178150
178150
|
var SemVer = require_semver2();
|
178151
|
-
var
|
178151
|
+
var parse13 = (version4, options, throwErrors = false) => {
|
178152
178152
|
if (version4 instanceof SemVer) {
|
178153
178153
|
return version4;
|
178154
178154
|
}
|
@@ -178161,16 +178161,16 @@ var require_parse7 = __commonJS({
|
|
178161
178161
|
throw er;
|
178162
178162
|
}
|
178163
178163
|
};
|
178164
|
-
module2.exports =
|
178164
|
+
module2.exports = parse13;
|
178165
178165
|
}
|
178166
178166
|
});
|
178167
178167
|
|
178168
178168
|
// ../../node_modules/semver/functions/valid.js
|
178169
178169
|
var require_valid = __commonJS({
|
178170
178170
|
"../../node_modules/semver/functions/valid.js"(exports2, module2) {
|
178171
|
-
var
|
178171
|
+
var parse13 = require_parse7();
|
178172
178172
|
var valid2 = (version4, options) => {
|
178173
|
-
const v =
|
178173
|
+
const v = parse13(version4, options);
|
178174
178174
|
return v ? v.version : null;
|
178175
178175
|
};
|
178176
178176
|
module2.exports = valid2;
|
@@ -178180,9 +178180,9 @@ var require_valid = __commonJS({
|
|
178180
178180
|
// ../../node_modules/semver/functions/clean.js
|
178181
178181
|
var require_clean = __commonJS({
|
178182
178182
|
"../../node_modules/semver/functions/clean.js"(exports2, module2) {
|
178183
|
-
var
|
178183
|
+
var parse13 = require_parse7();
|
178184
178184
|
var clean3 = (version4, options) => {
|
178185
|
-
const s5 =
|
178185
|
+
const s5 = parse13(version4.trim().replace(/^[=v]+/, ""), options);
|
178186
178186
|
return s5 ? s5.version : null;
|
178187
178187
|
};
|
178188
178188
|
module2.exports = clean3;
|
@@ -178215,10 +178215,10 @@ var require_inc = __commonJS({
|
|
178215
178215
|
// ../../node_modules/semver/functions/diff.js
|
178216
178216
|
var require_diff = __commonJS({
|
178217
178217
|
"../../node_modules/semver/functions/diff.js"(exports2, module2) {
|
178218
|
-
var
|
178218
|
+
var parse13 = require_parse7();
|
178219
178219
|
var diff = (version1, version22) => {
|
178220
|
-
const v1 =
|
178221
|
-
const v2 =
|
178220
|
+
const v1 = parse13(version1, null, true);
|
178221
|
+
const v2 = parse13(version22, null, true);
|
178222
178222
|
const comparison = v1.compare(v2);
|
178223
178223
|
if (comparison === 0) {
|
178224
178224
|
return null;
|
@@ -178286,9 +178286,9 @@ var require_patch = __commonJS({
|
|
178286
178286
|
// ../../node_modules/semver/functions/prerelease.js
|
178287
178287
|
var require_prerelease = __commonJS({
|
178288
178288
|
"../../node_modules/semver/functions/prerelease.js"(exports2, module2) {
|
178289
|
-
var
|
178289
|
+
var parse13 = require_parse7();
|
178290
178290
|
var prerelease = (version4, options) => {
|
178291
|
-
const parsed =
|
178291
|
+
const parsed = parse13(version4, options);
|
178292
178292
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
178293
178293
|
};
|
178294
178294
|
module2.exports = prerelease;
|
@@ -178460,7 +178460,7 @@ var require_cmp = __commonJS({
|
|
178460
178460
|
var require_coerce = __commonJS({
|
178461
178461
|
"../../node_modules/semver/functions/coerce.js"(exports2, module2) {
|
178462
178462
|
var SemVer = require_semver2();
|
178463
|
-
var
|
178463
|
+
var parse13 = require_parse7();
|
178464
178464
|
var { safeRe: re, t: t2 } = require_re2();
|
178465
178465
|
var coerce = (version4, options) => {
|
178466
178466
|
if (version4 instanceof SemVer) {
|
@@ -178489,7 +178489,7 @@ var require_coerce = __commonJS({
|
|
178489
178489
|
if (match3 === null) {
|
178490
178490
|
return null;
|
178491
178491
|
}
|
178492
|
-
return
|
178492
|
+
return parse13(`${match3[2]}.${match3[3] || "0"}.${match3[4] || "0"}`, options);
|
178493
178493
|
};
|
178494
178494
|
module2.exports = coerce;
|
178495
178495
|
}
|
@@ -180086,7 +180086,7 @@ var require_semver3 = __commonJS({
|
|
180086
180086
|
var constants2 = require_constants7();
|
180087
180087
|
var SemVer = require_semver2();
|
180088
180088
|
var identifiers = require_identifiers();
|
180089
|
-
var
|
180089
|
+
var parse13 = require_parse7();
|
180090
180090
|
var valid2 = require_valid();
|
180091
180091
|
var clean3 = require_clean();
|
180092
180092
|
var inc = require_inc();
|
@@ -180124,7 +180124,7 @@ var require_semver3 = __commonJS({
|
|
180124
180124
|
var simplifyRange = require_simplify();
|
180125
180125
|
var subset = require_subset();
|
180126
180126
|
module2.exports = {
|
180127
|
-
parse:
|
180127
|
+
parse: parse13,
|
180128
180128
|
valid: valid2,
|
180129
180129
|
clean: clean3,
|
180130
180130
|
inc,
|
@@ -180503,7 +180503,7 @@ var require_ms6 = __commonJS({
|
|
180503
180503
|
options = options || {};
|
180504
180504
|
var type2 = typeof val;
|
180505
180505
|
if (type2 === "string" && val.length > 0) {
|
180506
|
-
return
|
180506
|
+
return parse13(val);
|
180507
180507
|
} else if (type2 === "number" && isFinite(val)) {
|
180508
180508
|
return options.long ? fmtLong(val) : fmtShort(val);
|
180509
180509
|
}
|
@@ -180511,7 +180511,7 @@ var require_ms6 = __commonJS({
|
|
180511
180511
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
180512
180512
|
);
|
180513
180513
|
};
|
180514
|
-
function
|
180514
|
+
function parse13(str2) {
|
180515
180515
|
str2 = String(str2);
|
180516
180516
|
if (str2.length > 100) {
|
180517
180517
|
return;
|
@@ -183790,7 +183790,7 @@ var require_url_parse = __commonJS({
|
|
183790
183790
|
if (!(this instanceof Url)) {
|
183791
183791
|
return new Url(address, location4, parser3);
|
183792
183792
|
}
|
183793
|
-
var relative4, extracted,
|
183793
|
+
var relative4, extracted, parse13, instruction, index4, key2, instructions = rules.slice(), type2 = typeof location4, url = this, i2 = 0;
|
183794
183794
|
if ("object" !== type2 && "string" !== type2) {
|
183795
183795
|
parser3 = location4;
|
183796
183796
|
location4 = null;
|
@@ -183812,12 +183812,12 @@ var require_url_parse = __commonJS({
|
|
183812
183812
|
address = instruction(address, url);
|
183813
183813
|
continue;
|
183814
183814
|
}
|
183815
|
-
|
183815
|
+
parse13 = instruction[0];
|
183816
183816
|
key2 = instruction[1];
|
183817
|
-
if (
|
183817
|
+
if (parse13 !== parse13) {
|
183818
183818
|
url[key2] = address;
|
183819
|
-
} else if ("string" === typeof
|
183820
|
-
index4 =
|
183819
|
+
} else if ("string" === typeof parse13) {
|
183820
|
+
index4 = parse13 === "@" ? address.lastIndexOf(parse13) : address.indexOf(parse13);
|
183821
183821
|
if (~index4) {
|
183822
183822
|
if ("number" === typeof instruction[2]) {
|
183823
183823
|
url[key2] = address.slice(0, index4);
|
@@ -183827,7 +183827,7 @@ var require_url_parse = __commonJS({
|
|
183827
183827
|
address = address.slice(0, index4);
|
183828
183828
|
}
|
183829
183829
|
}
|
183830
|
-
} else if (index4 =
|
183830
|
+
} else if (index4 = parse13.exec(address)) {
|
183831
183831
|
url[key2] = index4[1];
|
183832
183832
|
address = address.slice(0, index4.index);
|
183833
183833
|
}
|
@@ -183987,7 +183987,7 @@ var require_url = __commonJS({
|
|
183987
183987
|
var url_parse_1 = __importDefault2(require_url_parse());
|
183988
183988
|
var URLExt;
|
183989
183989
|
(function(URLExt2) {
|
183990
|
-
function
|
183990
|
+
function parse13(url) {
|
183991
183991
|
if (typeof document !== "undefined" && document) {
|
183992
183992
|
const a2 = document.createElement("a");
|
183993
183993
|
a2.href = url;
|
@@ -183995,13 +183995,13 @@ var require_url = __commonJS({
|
|
183995
183995
|
}
|
183996
183996
|
return (0, url_parse_1.default)(url);
|
183997
183997
|
}
|
183998
|
-
URLExt2.parse =
|
183998
|
+
URLExt2.parse = parse13;
|
183999
183999
|
function getHostName(url) {
|
184000
184000
|
return (0, url_parse_1.default)(url).hostname;
|
184001
184001
|
}
|
184002
184002
|
URLExt2.getHostName = getHostName;
|
184003
184003
|
function normalize6(url) {
|
184004
|
-
return url &&
|
184004
|
+
return url && parse13(url).toString();
|
184005
184005
|
}
|
184006
184006
|
URLExt2.normalize = normalize6;
|
184007
184007
|
function join21(...parts) {
|
@@ -184041,7 +184041,7 @@ var require_url = __commonJS({
|
|
184041
184041
|
}
|
184042
184042
|
URLExt2.queryStringToObject = queryStringToObject;
|
184043
184043
|
function isLocal(url, allowRoot = false) {
|
184044
|
-
const { protocol } =
|
184044
|
+
const { protocol } = parse13(url);
|
184045
184045
|
return (!protocol || url.toLowerCase().indexOf(protocol) !== 0) && (allowRoot ? url.indexOf("//") !== 0 : url.indexOf("/") !== 0);
|
184046
184046
|
}
|
184047
184047
|
URLExt2.isLocal = isLocal;
|
@@ -191769,12 +191769,12 @@ var require_statedb = __commonJS({
|
|
191769
191769
|
*/
|
191770
191770
|
constructor(options = {}) {
|
191771
191771
|
this._changed = new signaling_1.Signal(this);
|
191772
|
-
const { connector, transform:
|
191772
|
+
const { connector, transform: transform3 } = options;
|
191773
191773
|
this._connector = connector || new StateDB.Connector();
|
191774
|
-
if (!
|
191774
|
+
if (!transform3) {
|
191775
191775
|
this._ready = Promise.resolve(void 0);
|
191776
191776
|
} else {
|
191777
|
-
this._ready =
|
191777
|
+
this._ready = transform3.then((transformation) => {
|
191778
191778
|
const { contents, type: type2 } = transformation;
|
191779
191779
|
switch (type2) {
|
191780
191780
|
case "cancel":
|
@@ -193279,7 +193279,7 @@ var {
|
|
193279
193279
|
} = import_index.default;
|
193280
193280
|
|
193281
193281
|
// src/version.ts
|
193282
|
-
var version = "1.1.
|
193282
|
+
var version = "1.1.55";
|
193283
193283
|
var version_default = version;
|
193284
193284
|
|
193285
193285
|
// ../myst-cli/dist/build/build.js
|
@@ -199297,7 +199297,7 @@ function mergeTextNodes(node3) {
|
|
199297
199297
|
return node3;
|
199298
199298
|
}
|
199299
199299
|
function admonitionKindToTitle(kind) {
|
199300
|
-
const
|
199300
|
+
const transform3 = {
|
199301
199301
|
attention: "Attention",
|
199302
199302
|
caution: "Caution",
|
199303
199303
|
danger: "Danger",
|
@@ -199309,7 +199309,7 @@ function admonitionKindToTitle(kind) {
|
|
199309
199309
|
tip: "Tip",
|
199310
199310
|
warning: "Warning"
|
199311
199311
|
};
|
199312
|
-
return
|
199312
|
+
return transform3[kind] || `Unknown Admonition "${kind}"`;
|
199313
199313
|
}
|
199314
199314
|
function writeTexLabelledComment(title, commands, commentLength2) {
|
199315
199315
|
if (!commands || (commands === null || commands === void 0 ? void 0 : commands.length) === 0)
|
@@ -199322,6 +199322,18 @@ function writeTexLabelledComment(title, commands, commentLength2) {
|
|
199322
199322
|
return `${titleBlock}${commands.join("\n")}
|
199323
199323
|
`;
|
199324
199324
|
}
|
199325
|
+
function getMetadataTags(node3) {
|
199326
|
+
var _a6;
|
199327
|
+
if (!node3.data)
|
199328
|
+
return [];
|
199329
|
+
const tags = (_a6 = node3.data.tags) !== null && _a6 !== void 0 ? _a6 : [];
|
199330
|
+
Object.entries(node3.data).forEach(([key2, val]) => {
|
199331
|
+
if (val === true || typeof val === "string" && val.toLowerCase() === "true") {
|
199332
|
+
tags.push(key2);
|
199333
|
+
}
|
199334
|
+
});
|
199335
|
+
return tags.map((tag) => tag.toLowerCase());
|
199336
|
+
}
|
199325
199337
|
|
199326
199338
|
// ../myst-common/dist/plural.js
|
199327
199339
|
function plural(f3, count2) {
|
@@ -203942,7 +203954,7 @@ function base() {
|
|
203942
203954
|
processor2.freeze = freeze2;
|
203943
203955
|
processor2.attachers = attachers;
|
203944
203956
|
processor2.use = use;
|
203945
|
-
processor2.parse =
|
203957
|
+
processor2.parse = parse13;
|
203946
203958
|
processor2.stringify = stringify4;
|
203947
203959
|
processor2.run = run;
|
203948
203960
|
processor2.runSync = runSync;
|
@@ -204065,7 +204077,7 @@ function base() {
|
|
204065
204077
|
}
|
204066
204078
|
}
|
204067
204079
|
}
|
204068
|
-
function
|
204080
|
+
function parse13(doc) {
|
204069
204081
|
processor2.freeze();
|
204070
204082
|
const file = vfile(doc);
|
204071
204083
|
const Parser3 = processor2.Parser;
|
@@ -206330,11 +206342,11 @@ var Schema2 = class {
|
|
206330
206342
|
* @param {Normal} normal
|
206331
206343
|
* @param {string} [space]
|
206332
206344
|
*/
|
206333
|
-
constructor(property, normal,
|
206345
|
+
constructor(property, normal, space3) {
|
206334
206346
|
this.property = property;
|
206335
206347
|
this.normal = normal;
|
206336
|
-
if (
|
206337
|
-
this.space =
|
206348
|
+
if (space3) {
|
206349
|
+
this.space = space3;
|
206338
206350
|
}
|
206339
206351
|
}
|
206340
206352
|
};
|
@@ -206343,7 +206355,7 @@ Schema2.prototype.normal = {};
|
|
206343
206355
|
Schema2.prototype.space = null;
|
206344
206356
|
|
206345
206357
|
// ../../node_modules/property-information/lib/util/merge.js
|
206346
|
-
function merge2(definitions2,
|
206358
|
+
function merge2(definitions2, space3) {
|
206347
206359
|
const property = {};
|
206348
206360
|
const normal = {};
|
206349
206361
|
let index4 = -1;
|
@@ -206351,7 +206363,7 @@ function merge2(definitions2, space2) {
|
|
206351
206363
|
Object.assign(property, definitions2[index4].property);
|
206352
206364
|
Object.assign(normal, definitions2[index4].normal);
|
206353
206365
|
}
|
206354
|
-
return new Schema2(property, normal,
|
206366
|
+
return new Schema2(property, normal, space3);
|
206355
206367
|
}
|
206356
206368
|
|
206357
206369
|
// ../../node_modules/property-information/lib/normalize.js
|
@@ -206415,10 +206427,10 @@ var DefinedInfo = class extends Info {
|
|
206415
206427
|
* @param {number|null} [mask]
|
206416
206428
|
* @param {string} [space]
|
206417
206429
|
*/
|
206418
|
-
constructor(property, attribute2, mask2,
|
206430
|
+
constructor(property, attribute2, mask2, space3) {
|
206419
206431
|
let index4 = -1;
|
206420
206432
|
super(property, attribute2);
|
206421
|
-
mark(this, "space",
|
206433
|
+
mark(this, "space", space3);
|
206422
206434
|
if (typeof mask2 === "number") {
|
206423
206435
|
while (++index4 < checks.length) {
|
206424
206436
|
const check2 = checks[index4];
|
@@ -220522,6 +220534,14 @@ var defaultHtmlToMdastOptions = {
|
|
220522
220534
|
_brKeep(h4, node3) {
|
220523
220535
|
return h4(node3, "_break");
|
220524
220536
|
},
|
220537
|
+
span(h4, node3) {
|
220538
|
+
const attrs = addClassAndIdentifier(node3);
|
220539
|
+
return h4(node3, "span", attrs, all5(h4, node3));
|
220540
|
+
},
|
220541
|
+
div(h4, node3) {
|
220542
|
+
const attrs = addClassAndIdentifier(node3);
|
220543
|
+
return h4(node3, "div", attrs, all5(h4, node3));
|
220544
|
+
},
|
220525
220545
|
a(h4, node3) {
|
220526
220546
|
const attrs = addClassAndIdentifier(node3);
|
220527
220547
|
attrs.url = String(node3.properties.href || "");
|
@@ -225894,9 +225914,9 @@ var buildExpression$1 = function buildExpression(expression, options, isRealGrou
|
|
225894
225914
|
traverseNonSpaceNodes(groups, (node4, prev) => {
|
225895
225915
|
var prevType = getTypeOfDomTree(prev);
|
225896
225916
|
var type2 = getTypeOfDomTree(node4);
|
225897
|
-
var
|
225898
|
-
if (
|
225899
|
-
return buildCommon.makeGlue(
|
225917
|
+
var space3 = prevType && type2 ? node4.hasClass("mtight") ? tightSpacings[prevType][type2] : spacings[prevType][type2] : null;
|
225918
|
+
if (space3) {
|
225919
|
+
return buildCommon.makeGlue(space3, glueOptions);
|
225900
225920
|
}
|
225901
225921
|
}, {
|
225902
225922
|
node: dummyPrev
|
@@ -234151,12 +234171,12 @@ var Parser2 = class {
|
|
234151
234171
|
this.gullet.macros.set("\\color", "\\textcolor");
|
234152
234172
|
}
|
234153
234173
|
try {
|
234154
|
-
var
|
234174
|
+
var parse13 = this.parseExpression(false);
|
234155
234175
|
this.expect("EOF");
|
234156
234176
|
if (!this.settings.globalGroup) {
|
234157
234177
|
this.gullet.endGroup();
|
234158
234178
|
}
|
234159
|
-
return
|
234179
|
+
return parse13;
|
234160
234180
|
} finally {
|
234161
234181
|
this.gullet.endGroups();
|
234162
234182
|
}
|
@@ -234170,10 +234190,10 @@ var Parser2 = class {
|
|
234170
234190
|
this.consume();
|
234171
234191
|
this.gullet.pushToken(new Token("}"));
|
234172
234192
|
this.gullet.pushTokens(tokens);
|
234173
|
-
var
|
234193
|
+
var parse13 = this.parseExpression(false);
|
234174
234194
|
this.expect("}");
|
234175
234195
|
this.nextToken = oldToken;
|
234176
|
-
return
|
234196
|
+
return parse13;
|
234177
234197
|
}
|
234178
234198
|
/**
|
234179
234199
|
* Parses an "expression", which is a list of atoms.
|
@@ -235596,7 +235616,7 @@ function blockToFigureTransform(mdast2, opts) {
|
|
235596
235616
|
const blocks2 = selectAll("block", mdast2);
|
235597
235617
|
const parser3 = (_a6 = opts === null || opts === void 0 ? void 0 : opts.parser) !== null && _a6 !== void 0 ? _a6 : defaultParser;
|
235598
235618
|
blocks2.forEach((block5) => {
|
235599
|
-
var _a7, _b, _c, _d2, _e, _f, _g, _h, _j
|
235619
|
+
var _a7, _b, _c, _d2, _e, _f, _g, _h, _j;
|
235600
235620
|
const caption3 = (_d2 = (_b = (_a7 = block5.data) === null || _a7 === void 0 ? void 0 : _a7.caption) !== null && _b !== void 0 ? _b : (_c = block5.data) === null || _c === void 0 ? void 0 : _c["fig-cap"]) !== null && _d2 !== void 0 ? _d2 : (_e = block5.data) === null || _e === void 0 ? void 0 : _e["tbl-cap"];
|
235601
235621
|
if (caption3) {
|
235602
235622
|
const kind = (_g = (_f = block5.data) === null || _f === void 0 ? void 0 : _f.kind) !== null && _g !== void 0 ? _g : ((_h = block5.data) === null || _h === void 0 ? void 0 : _h["tbl-cap"]) ? "table" : "figure";
|
@@ -235609,7 +235629,7 @@ function blockToFigureTransform(mdast2, opts) {
|
|
235609
235629
|
identifier: block5.identifier,
|
235610
235630
|
children
|
235611
235631
|
};
|
235612
|
-
if (
|
235632
|
+
if (block5.kind === NotebookCell.code) {
|
235613
235633
|
container4.noSubcontainers = true;
|
235614
235634
|
}
|
235615
235635
|
block5.children = [container4];
|
@@ -235811,14 +235831,14 @@ function linksTransform(mdast2, file, opts) {
|
|
235811
235831
|
formatLinkText(link4);
|
235812
235832
|
if (!link4.urlSource)
|
235813
235833
|
link4.urlSource = link4.url;
|
235814
|
-
const
|
235815
|
-
if (!
|
235834
|
+
const transform3 = opts.transformers.find((t2) => t2.test(link4.urlSource));
|
235835
|
+
if (!transform3)
|
235816
235836
|
return;
|
235817
|
-
const result =
|
235837
|
+
const result = transform3.transform(link4, file);
|
235818
235838
|
if (result) {
|
235819
235839
|
delete link4.error;
|
235820
|
-
if (
|
235821
|
-
link4.protocol =
|
235840
|
+
if (transform3.protocol) {
|
235841
|
+
link4.protocol = transform3.protocol;
|
235822
235842
|
}
|
235823
235843
|
} else {
|
235824
235844
|
link4.error = true;
|
@@ -238930,7 +238950,7 @@ function createReducer(initialState, mapOrBuilderCallback) {
|
|
238930
238950
|
}) => matcher(action)).map(({
|
238931
238951
|
reducer: reducer2
|
238932
238952
|
}) => reducer2)];
|
238933
|
-
if (caseReducers.filter((
|
238953
|
+
if (caseReducers.filter((cr3) => !!cr3).length === 0) {
|
238934
238954
|
caseReducers = [finalDefaultCaseReducer];
|
238935
238955
|
}
|
238936
238956
|
return caseReducers.reduce((previousState, caseReducer) => {
|
@@ -248489,10 +248509,10 @@ var pgfkeys_default = (
|
|
248489
248509
|
var peg$f8 = function(x2) {
|
248490
248510
|
return x2;
|
248491
248511
|
};
|
248492
|
-
var peg$f9 = function(
|
248512
|
+
var peg$f9 = function(space3, x2) {
|
248493
248513
|
return {
|
248494
248514
|
trailingComment: x2,
|
248495
|
-
leadingParbreak:
|
248515
|
+
leadingParbreak: space3.parbreak > 0
|
248496
248516
|
};
|
248497
248517
|
};
|
248498
248518
|
var peg$f10 = function(list6) {
|
@@ -264597,13 +264617,13 @@ var require_standalone = __commonJS3({
|
|
264597
264617
|
return zo(e2) == "String" ? Xo(e2, "") : Hr(e2);
|
264598
264618
|
} : Hr;
|
264599
264619
|
});
|
264600
|
-
var
|
264620
|
+
var cr3 = xe((p0, Bu) => {
|
264601
264621
|
Bu.exports = function(e2) {
|
264602
264622
|
return e2 == null;
|
264603
264623
|
};
|
264604
264624
|
});
|
264605
264625
|
var Gr = xe((f0, Nu) => {
|
264606
|
-
var Ko =
|
264626
|
+
var Ko = cr3(), Yo = TypeError;
|
264607
264627
|
Nu.exports = function(e2) {
|
264608
264628
|
if (Ko(e2))
|
264609
264629
|
throw Yo("Can't call method on " + e2);
|
@@ -264637,8 +264657,8 @@ var require_standalone = __commonJS3({
|
|
264637
264657
|
};
|
264638
264658
|
});
|
264639
264659
|
var Wt = xe((y0, ju) => {
|
264640
|
-
var zr = pt(),
|
264641
|
-
return
|
264660
|
+
var zr = pt(), nl3 = ot(), ul = function(e2) {
|
264661
|
+
return nl3(e2) ? e2 : void 0;
|
264642
264662
|
};
|
264643
264663
|
ju.exports = function(e2, r2) {
|
264644
264664
|
return arguments.length < 2 ? ul(zr[e2]) : zr[e2] && zr[e2][r2];
|
@@ -264697,7 +264717,7 @@ var require_standalone = __commonJS3({
|
|
264697
264717
|
};
|
264698
264718
|
});
|
264699
264719
|
var mr = xe((b0, es) => {
|
264700
|
-
var hl = Ht(), vl =
|
264720
|
+
var hl = Ht(), vl = cr3();
|
264701
264721
|
es.exports = function(e2, r2) {
|
264702
264722
|
var t2 = e2[r2];
|
264703
264723
|
return vl(t2) ? void 0 : hl(t2);
|
@@ -264965,9 +264985,9 @@ var require_standalone = __commonJS3({
|
|
264965
264985
|
};
|
264966
264986
|
});
|
264967
264987
|
var ai = xe((ry, ii) => {
|
264968
|
-
var
|
264988
|
+
var np2 = Sr(), up2 = Math.min;
|
264969
264989
|
ii.exports = function(e2) {
|
264970
|
-
return e2 > 0 ? up2(
|
264990
|
+
return e2 > 0 ? up2(np2(e2), 9007199254740991) : 0;
|
264971
264991
|
};
|
264972
264992
|
});
|
264973
264993
|
var kt = xe((ny, oi) => {
|
@@ -265177,7 +265197,7 @@ var require_standalone = __commonJS3({
|
|
265177
265197
|
};
|
265178
265198
|
});
|
265179
265199
|
var In = xe((Ty, ua) => {
|
265180
|
-
var Nf = Nn(), na = mr(), wf =
|
265200
|
+
var Nf = Nn(), na = mr(), wf = cr3(), _f = Pn(), Pf = bt(), If = Pf("iterator");
|
265181
265201
|
ua.exports = function(e2) {
|
265182
265202
|
if (!wf(e2))
|
265183
265203
|
return na(e2, If) || na(e2, "@@iterator") || _f[Nf(e2)];
|
@@ -277990,8 +278010,8 @@ var SIUNITX_HANDLERS = {
|
|
277990
278010
|
const { units, alt, organized } = createSiUnitNode(state.file, node3, 1);
|
277991
278011
|
const number2 = texToText(getArguments(node3, "group")[0]);
|
277992
278012
|
const translated = organized.map(unitToString).join(NARROW_NO_BREAK_SPACE);
|
277993
|
-
const
|
277994
|
-
const value = `${number2}${
|
278013
|
+
const space3 = translated.startsWith("\xB0") ? "" : NARROW_NO_BREAK_SPACE;
|
278014
|
+
const value = `${number2}${space3}${translated}`;
|
277995
278015
|
state.addLeaf("si", {
|
277996
278016
|
number: number2,
|
277997
278017
|
unit: translated,
|
@@ -278018,8 +278038,8 @@ var SIUNITX_HANDLERS = {
|
|
278018
278038
|
const { units, alt, organized } = createSiUnitNode(state.file, node3, 1);
|
278019
278039
|
const number2 = texToText(getArguments(node3, "group")[0]);
|
278020
278040
|
const translated = organized.map(unitToString).join(NARROW_NO_BREAK_SPACE);
|
278021
|
-
const
|
278022
|
-
const value = `${number2}${
|
278041
|
+
const space3 = translated.startsWith("\xB0") ? "" : NARROW_NO_BREAK_SPACE;
|
278042
|
+
const value = `${number2}${space3}${translated}`;
|
278023
278043
|
state.addLeaf("si", {
|
278024
278044
|
number: number2,
|
278025
278045
|
unit: translated,
|
@@ -279503,6 +279523,42 @@ var CODE_DIRECTIVE_OPTIONS = {
|
|
279503
279523
|
// doc: 'Ignore minor errors on highlighting',
|
279504
279524
|
// },
|
279505
279525
|
};
|
279526
|
+
function parseTags(input3, vfile2, node3) {
|
279527
|
+
var _a6, _b;
|
279528
|
+
if (!input3)
|
279529
|
+
return void 0;
|
279530
|
+
if (typeof input3 === "string" && input3.startsWith("[") && input3.endsWith("]")) {
|
279531
|
+
try {
|
279532
|
+
return parseTags(js_yaml_default.load(input3), vfile2, node3);
|
279533
|
+
} catch (error) {
|
279534
|
+
fileError(vfile2, "Could not load tags for code-cell directive", {
|
279535
|
+
node: (_a6 = select('mystDirectiveOption[name="tags"]', node3)) !== null && _a6 !== void 0 ? _a6 : node3,
|
279536
|
+
source: "code-cell:tags",
|
279537
|
+
ruleId: RuleId.directiveOptionsCorrect
|
279538
|
+
});
|
279539
|
+
return void 0;
|
279540
|
+
}
|
279541
|
+
}
|
279542
|
+
if (typeof input3 === "string") {
|
279543
|
+
const tags2 = input3.split(/[,\s]/).map((t2) => t2.trim()).filter((t2) => !!t2);
|
279544
|
+
return tags2.length > 0 ? tags2 : void 0;
|
279545
|
+
}
|
279546
|
+
if (!Array.isArray(input3))
|
279547
|
+
return void 0;
|
279548
|
+
const tags = input3;
|
279549
|
+
if (tags && Array.isArray(tags) && tags.every((t2) => typeof t2 === "string")) {
|
279550
|
+
if (tags.length > 0) {
|
279551
|
+
return tags.map((t2) => t2.trim()).filter((t2) => !!t2);
|
279552
|
+
}
|
279553
|
+
} else if (tags) {
|
279554
|
+
fileWarn(vfile2, "tags in code-cell directive must be a list of strings", {
|
279555
|
+
node: (_b = select('mystDirectiveOption[name="tags"]', node3)) !== null && _b !== void 0 ? _b : node3,
|
279556
|
+
source: "code-cell:tags",
|
279557
|
+
ruleId: RuleId.directiveOptionsCorrect
|
279558
|
+
});
|
279559
|
+
return void 0;
|
279560
|
+
}
|
279561
|
+
}
|
279506
279562
|
var codeDirective = {
|
279507
279563
|
name: "code",
|
279508
279564
|
doc: "A code-block environment with a language as the argument, and options for highlighting, showing line numbers, and an optional filename.",
|
@@ -279563,50 +279619,35 @@ var codeDirective = {
|
|
279563
279619
|
};
|
279564
279620
|
var codeCellDirective = {
|
279565
279621
|
name: "code-cell",
|
279622
|
+
doc: "An executable code cell",
|
279566
279623
|
arg: {
|
279567
|
-
type: String
|
279624
|
+
type: String,
|
279625
|
+
doc: "Language for execution and display, for example `python`. It will default to the language of the notebook or containing markdown file."
|
279568
279626
|
},
|
279569
279627
|
options: {
|
279628
|
+
label: {
|
279629
|
+
type: String,
|
279630
|
+
alias: ["name"]
|
279631
|
+
},
|
279570
279632
|
tags: {
|
279571
|
-
type: String
|
279633
|
+
type: String,
|
279634
|
+
alias: ["tag"],
|
279635
|
+
doc: "A comma-separated list of tags to add to the cell, for example, `remove-input` or `hide-cell`."
|
279572
279636
|
}
|
279573
279637
|
},
|
279574
279638
|
body: {
|
279575
|
-
type: String
|
279639
|
+
type: String,
|
279640
|
+
doc: "The code to be executed and displayed."
|
279576
279641
|
},
|
279577
279642
|
run(data, vfile2) {
|
279578
|
-
var _a6, _b, _c
|
279643
|
+
var _a6, _b, _c;
|
279644
|
+
const { label, identifier } = normalizeLabel((_a6 = data.options) === null || _a6 === void 0 ? void 0 : _a6.label) || {};
|
279579
279645
|
const code7 = {
|
279580
279646
|
type: "code",
|
279581
279647
|
lang: data.arg,
|
279582
279648
|
executable: true,
|
279583
|
-
value: (
|
279649
|
+
value: (_b = data.body) !== null && _b !== void 0 ? _b : ""
|
279584
279650
|
};
|
279585
|
-
let tags;
|
279586
|
-
if (typeof ((_b = data.options) === null || _b === void 0 ? void 0 : _b.tags) === "string") {
|
279587
|
-
try {
|
279588
|
-
tags = js_yaml_default.load(data.options.tags);
|
279589
|
-
} catch (error) {
|
279590
|
-
fileError(vfile2, "Could not load tags for code-cell directive", {
|
279591
|
-
node: (_c = select('mystDirectiveOption[name="tags"]', data.node)) !== null && _c !== void 0 ? _c : data.node,
|
279592
|
-
source: "code-cell:tags",
|
279593
|
-
ruleId: RuleId.directiveOptionsCorrect
|
279594
|
-
});
|
279595
|
-
}
|
279596
|
-
} else if (((_d2 = data.options) === null || _d2 === void 0 ? void 0 : _d2.tags) && Array.isArray(data.options.tags)) {
|
279597
|
-
tags = data.options.tags;
|
279598
|
-
}
|
279599
|
-
if (tags && Array.isArray(tags) && tags.every((t2) => typeof t2 === "string")) {
|
279600
|
-
if (tags && tags.length > 0) {
|
279601
|
-
code7.data = { tags: tags.map((t2) => t2.trim()) };
|
279602
|
-
}
|
279603
|
-
} else if (tags) {
|
279604
|
-
fileWarn(vfile2, "tags in code-cell directive must be a list of strings", {
|
279605
|
-
node: (_e = select('mystDirectiveOption[name="tags"]', data.node)) !== null && _e !== void 0 ? _e : data.node,
|
279606
|
-
source: "code-cell:tags",
|
279607
|
-
ruleId: RuleId.directiveOptionsCorrect
|
279608
|
-
});
|
279609
|
-
}
|
279610
279651
|
const output2 = {
|
279611
279652
|
type: "output",
|
279612
279653
|
id: nanoid(),
|
@@ -279614,12 +279655,15 @@ var codeCellDirective = {
|
|
279614
279655
|
};
|
279615
279656
|
const block5 = {
|
279616
279657
|
type: "block",
|
279617
|
-
|
279658
|
+
kind: NotebookCell.code,
|
279659
|
+
label,
|
279660
|
+
identifier,
|
279618
279661
|
children: [code7, output2],
|
279619
|
-
data: {
|
279620
|
-
type: "notebook-code"
|
279621
|
-
}
|
279662
|
+
data: {}
|
279622
279663
|
};
|
279664
|
+
const tags = parseTags((_c = data.options) === null || _c === void 0 ? void 0 : _c.tags, vfile2, data.node);
|
279665
|
+
if (tags)
|
279666
|
+
block5.data.tags = tags;
|
279623
279667
|
return [block5];
|
279624
279668
|
}
|
279625
279669
|
};
|
@@ -280113,11 +280157,1303 @@ function extToLanguage(ext2) {
|
|
280113
280157
|
}[ext2 !== null && ext2 !== void 0 ? ext2 : ""]) !== null && _a6 !== void 0 ? _a6 : ext2;
|
280114
280158
|
}
|
280115
280159
|
|
280160
|
+
// ../myst-directives/node_modules/csv-parse/lib/api/CsvError.js
|
280161
|
+
var CsvError = class extends Error {
|
280162
|
+
constructor(code7, message, options, ...contexts) {
|
280163
|
+
if (Array.isArray(message))
|
280164
|
+
message = message.join(" ").trim();
|
280165
|
+
super(message);
|
280166
|
+
if (Error.captureStackTrace !== void 0) {
|
280167
|
+
Error.captureStackTrace(this, CsvError);
|
280168
|
+
}
|
280169
|
+
this.code = code7;
|
280170
|
+
for (const context of contexts) {
|
280171
|
+
for (const key2 in context) {
|
280172
|
+
const value = context[key2];
|
280173
|
+
this[key2] = Buffer.isBuffer(value) ? value.toString(options.encoding) : value == null ? value : JSON.parse(JSON.stringify(value));
|
280174
|
+
}
|
280175
|
+
}
|
280176
|
+
}
|
280177
|
+
};
|
280178
|
+
|
280179
|
+
// ../myst-directives/node_modules/csv-parse/lib/utils/is_object.js
|
280180
|
+
var is_object = function(obj) {
|
280181
|
+
return typeof obj === "object" && obj !== null && !Array.isArray(obj);
|
280182
|
+
};
|
280183
|
+
|
280184
|
+
// ../myst-directives/node_modules/csv-parse/lib/api/normalize_columns_array.js
|
280185
|
+
var normalize_columns_array = function(columns) {
|
280186
|
+
const normalizedColumns = [];
|
280187
|
+
for (let i2 = 0, l = columns.length; i2 < l; i2++) {
|
280188
|
+
const column = columns[i2];
|
280189
|
+
if (column === void 0 || column === null || column === false) {
|
280190
|
+
normalizedColumns[i2] = { disabled: true };
|
280191
|
+
} else if (typeof column === "string") {
|
280192
|
+
normalizedColumns[i2] = { name: column };
|
280193
|
+
} else if (is_object(column)) {
|
280194
|
+
if (typeof column.name !== "string") {
|
280195
|
+
throw new CsvError("CSV_OPTION_COLUMNS_MISSING_NAME", [
|
280196
|
+
"Option columns missing name:",
|
280197
|
+
`property "name" is required at position ${i2}`,
|
280198
|
+
"when column is an object literal"
|
280199
|
+
]);
|
280200
|
+
}
|
280201
|
+
normalizedColumns[i2] = column;
|
280202
|
+
} else {
|
280203
|
+
throw new CsvError("CSV_INVALID_COLUMN_DEFINITION", [
|
280204
|
+
"Invalid column definition:",
|
280205
|
+
"expect a string or a literal object,",
|
280206
|
+
`got ${JSON.stringify(column)} at position ${i2}`
|
280207
|
+
]);
|
280208
|
+
}
|
280209
|
+
}
|
280210
|
+
return normalizedColumns;
|
280211
|
+
};
|
280212
|
+
|
280213
|
+
// ../myst-directives/node_modules/csv-parse/lib/utils/ResizeableBuffer.js
|
280214
|
+
var ResizeableBuffer = class {
|
280215
|
+
constructor(size = 100) {
|
280216
|
+
this.size = size;
|
280217
|
+
this.length = 0;
|
280218
|
+
this.buf = Buffer.allocUnsafe(size);
|
280219
|
+
}
|
280220
|
+
prepend(val) {
|
280221
|
+
if (Buffer.isBuffer(val)) {
|
280222
|
+
const length = this.length + val.length;
|
280223
|
+
if (length >= this.size) {
|
280224
|
+
this.resize();
|
280225
|
+
if (length >= this.size) {
|
280226
|
+
throw Error("INVALID_BUFFER_STATE");
|
280227
|
+
}
|
280228
|
+
}
|
280229
|
+
const buf = this.buf;
|
280230
|
+
this.buf = Buffer.allocUnsafe(this.size);
|
280231
|
+
val.copy(this.buf, 0);
|
280232
|
+
buf.copy(this.buf, val.length);
|
280233
|
+
this.length += val.length;
|
280234
|
+
} else {
|
280235
|
+
const length = this.length++;
|
280236
|
+
if (length === this.size) {
|
280237
|
+
this.resize();
|
280238
|
+
}
|
280239
|
+
const buf = this.clone();
|
280240
|
+
this.buf[0] = val;
|
280241
|
+
buf.copy(this.buf, 1, 0, length);
|
280242
|
+
}
|
280243
|
+
}
|
280244
|
+
append(val) {
|
280245
|
+
const length = this.length++;
|
280246
|
+
if (length === this.size) {
|
280247
|
+
this.resize();
|
280248
|
+
}
|
280249
|
+
this.buf[length] = val;
|
280250
|
+
}
|
280251
|
+
clone() {
|
280252
|
+
return Buffer.from(this.buf.slice(0, this.length));
|
280253
|
+
}
|
280254
|
+
resize() {
|
280255
|
+
const length = this.length;
|
280256
|
+
this.size = this.size * 2;
|
280257
|
+
const buf = Buffer.allocUnsafe(this.size);
|
280258
|
+
this.buf.copy(buf, 0, 0, length);
|
280259
|
+
this.buf = buf;
|
280260
|
+
}
|
280261
|
+
toString(encoding) {
|
280262
|
+
if (encoding) {
|
280263
|
+
return this.buf.slice(0, this.length).toString(encoding);
|
280264
|
+
} else {
|
280265
|
+
return Uint8Array.prototype.slice.call(this.buf.slice(0, this.length));
|
280266
|
+
}
|
280267
|
+
}
|
280268
|
+
toJSON() {
|
280269
|
+
return this.toString("utf8");
|
280270
|
+
}
|
280271
|
+
reset() {
|
280272
|
+
this.length = 0;
|
280273
|
+
}
|
280274
|
+
};
|
280275
|
+
var ResizeableBuffer_default = ResizeableBuffer;
|
280276
|
+
|
280277
|
+
// ../myst-directives/node_modules/csv-parse/lib/api/init_state.js
|
280278
|
+
var np = 12;
|
280279
|
+
var cr = 13;
|
280280
|
+
var nl = 10;
|
280281
|
+
var space2 = 32;
|
280282
|
+
var tab2 = 9;
|
280283
|
+
var init_state = function(options) {
|
280284
|
+
return {
|
280285
|
+
bomSkipped: false,
|
280286
|
+
bufBytesStart: 0,
|
280287
|
+
castField: options.cast_function,
|
280288
|
+
commenting: false,
|
280289
|
+
// Current error encountered by a record
|
280290
|
+
error: void 0,
|
280291
|
+
enabled: options.from_line === 1,
|
280292
|
+
escaping: false,
|
280293
|
+
escapeIsQuote: Buffer.isBuffer(options.escape) && Buffer.isBuffer(options.quote) && Buffer.compare(options.escape, options.quote) === 0,
|
280294
|
+
// columns can be `false`, `true`, `Array`
|
280295
|
+
expectedRecordLength: Array.isArray(options.columns) ? options.columns.length : void 0,
|
280296
|
+
field: new ResizeableBuffer_default(20),
|
280297
|
+
firstLineToHeaders: options.cast_first_line_to_header,
|
280298
|
+
needMoreDataSize: Math.max(
|
280299
|
+
// Skip if the remaining buffer smaller than comment
|
280300
|
+
options.comment !== null ? options.comment.length : 0,
|
280301
|
+
...options.delimiter.map((delimiter2) => delimiter2.length),
|
280302
|
+
// Skip if the remaining buffer can be escape sequence
|
280303
|
+
options.quote !== null ? options.quote.length : 0
|
280304
|
+
),
|
280305
|
+
previousBuf: void 0,
|
280306
|
+
quoting: false,
|
280307
|
+
stop: false,
|
280308
|
+
rawBuffer: new ResizeableBuffer_default(100),
|
280309
|
+
record: [],
|
280310
|
+
recordHasError: false,
|
280311
|
+
record_length: 0,
|
280312
|
+
recordDelimiterMaxLength: options.record_delimiter.length === 0 ? 0 : Math.max(...options.record_delimiter.map((v) => v.length)),
|
280313
|
+
trimChars: [Buffer.from(" ", options.encoding)[0], Buffer.from(" ", options.encoding)[0]],
|
280314
|
+
wasQuoting: false,
|
280315
|
+
wasRowDelimiter: false,
|
280316
|
+
timchars: [
|
280317
|
+
Buffer.from(Buffer.from([cr], "utf8").toString(), options.encoding),
|
280318
|
+
Buffer.from(Buffer.from([nl], "utf8").toString(), options.encoding),
|
280319
|
+
Buffer.from(Buffer.from([np], "utf8").toString(), options.encoding),
|
280320
|
+
Buffer.from(Buffer.from([space2], "utf8").toString(), options.encoding),
|
280321
|
+
Buffer.from(Buffer.from([tab2], "utf8").toString(), options.encoding)
|
280322
|
+
]
|
280323
|
+
};
|
280324
|
+
};
|
280325
|
+
|
280326
|
+
// ../myst-directives/node_modules/csv-parse/lib/utils/underscore.js
|
280327
|
+
var underscore = function(str2) {
|
280328
|
+
return str2.replace(/([A-Z])/g, function(_3, match3) {
|
280329
|
+
return "_" + match3.toLowerCase();
|
280330
|
+
});
|
280331
|
+
};
|
280332
|
+
|
280333
|
+
// ../myst-directives/node_modules/csv-parse/lib/api/normalize_options.js
|
280334
|
+
var normalize_options = function(opts) {
|
280335
|
+
const options = {};
|
280336
|
+
for (const opt in opts) {
|
280337
|
+
options[underscore(opt)] = opts[opt];
|
280338
|
+
}
|
280339
|
+
if (options.encoding === void 0 || options.encoding === true) {
|
280340
|
+
options.encoding = "utf8";
|
280341
|
+
} else if (options.encoding === null || options.encoding === false) {
|
280342
|
+
options.encoding = null;
|
280343
|
+
} else if (typeof options.encoding !== "string" && options.encoding !== null) {
|
280344
|
+
throw new CsvError("CSV_INVALID_OPTION_ENCODING", [
|
280345
|
+
"Invalid option encoding:",
|
280346
|
+
"encoding must be a string or null to return a buffer,",
|
280347
|
+
`got ${JSON.stringify(options.encoding)}`
|
280348
|
+
], options);
|
280349
|
+
}
|
280350
|
+
if (options.bom === void 0 || options.bom === null || options.bom === false) {
|
280351
|
+
options.bom = false;
|
280352
|
+
} else if (options.bom !== true) {
|
280353
|
+
throw new CsvError("CSV_INVALID_OPTION_BOM", [
|
280354
|
+
"Invalid option bom:",
|
280355
|
+
"bom must be true,",
|
280356
|
+
`got ${JSON.stringify(options.bom)}`
|
280357
|
+
], options);
|
280358
|
+
}
|
280359
|
+
options.cast_function = null;
|
280360
|
+
if (options.cast === void 0 || options.cast === null || options.cast === false || options.cast === "") {
|
280361
|
+
options.cast = void 0;
|
280362
|
+
} else if (typeof options.cast === "function") {
|
280363
|
+
options.cast_function = options.cast;
|
280364
|
+
options.cast = true;
|
280365
|
+
} else if (options.cast !== true) {
|
280366
|
+
throw new CsvError("CSV_INVALID_OPTION_CAST", [
|
280367
|
+
"Invalid option cast:",
|
280368
|
+
"cast must be true or a function,",
|
280369
|
+
`got ${JSON.stringify(options.cast)}`
|
280370
|
+
], options);
|
280371
|
+
}
|
280372
|
+
if (options.cast_date === void 0 || options.cast_date === null || options.cast_date === false || options.cast_date === "") {
|
280373
|
+
options.cast_date = false;
|
280374
|
+
} else if (options.cast_date === true) {
|
280375
|
+
options.cast_date = function(value) {
|
280376
|
+
const date = Date.parse(value);
|
280377
|
+
return !isNaN(date) ? new Date(date) : value;
|
280378
|
+
};
|
280379
|
+
} else if (typeof options.cast_date !== "function") {
|
280380
|
+
throw new CsvError("CSV_INVALID_OPTION_CAST_DATE", [
|
280381
|
+
"Invalid option cast_date:",
|
280382
|
+
"cast_date must be true or a function,",
|
280383
|
+
`got ${JSON.stringify(options.cast_date)}`
|
280384
|
+
], options);
|
280385
|
+
}
|
280386
|
+
options.cast_first_line_to_header = null;
|
280387
|
+
if (options.columns === true) {
|
280388
|
+
options.cast_first_line_to_header = void 0;
|
280389
|
+
} else if (typeof options.columns === "function") {
|
280390
|
+
options.cast_first_line_to_header = options.columns;
|
280391
|
+
options.columns = true;
|
280392
|
+
} else if (Array.isArray(options.columns)) {
|
280393
|
+
options.columns = normalize_columns_array(options.columns);
|
280394
|
+
} else if (options.columns === void 0 || options.columns === null || options.columns === false) {
|
280395
|
+
options.columns = false;
|
280396
|
+
} else {
|
280397
|
+
throw new CsvError("CSV_INVALID_OPTION_COLUMNS", [
|
280398
|
+
"Invalid option columns:",
|
280399
|
+
"expect an array, a function or true,",
|
280400
|
+
`got ${JSON.stringify(options.columns)}`
|
280401
|
+
], options);
|
280402
|
+
}
|
280403
|
+
if (options.group_columns_by_name === void 0 || options.group_columns_by_name === null || options.group_columns_by_name === false) {
|
280404
|
+
options.group_columns_by_name = false;
|
280405
|
+
} else if (options.group_columns_by_name !== true) {
|
280406
|
+
throw new CsvError("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME", [
|
280407
|
+
"Invalid option group_columns_by_name:",
|
280408
|
+
"expect an boolean,",
|
280409
|
+
`got ${JSON.stringify(options.group_columns_by_name)}`
|
280410
|
+
], options);
|
280411
|
+
} else if (options.columns === false) {
|
280412
|
+
throw new CsvError("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME", [
|
280413
|
+
"Invalid option group_columns_by_name:",
|
280414
|
+
"the `columns` mode must be activated."
|
280415
|
+
], options);
|
280416
|
+
}
|
280417
|
+
if (options.comment === void 0 || options.comment === null || options.comment === false || options.comment === "") {
|
280418
|
+
options.comment = null;
|
280419
|
+
} else {
|
280420
|
+
if (typeof options.comment === "string") {
|
280421
|
+
options.comment = Buffer.from(options.comment, options.encoding);
|
280422
|
+
}
|
280423
|
+
if (!Buffer.isBuffer(options.comment)) {
|
280424
|
+
throw new CsvError("CSV_INVALID_OPTION_COMMENT", [
|
280425
|
+
"Invalid option comment:",
|
280426
|
+
"comment must be a buffer or a string,",
|
280427
|
+
`got ${JSON.stringify(options.comment)}`
|
280428
|
+
], options);
|
280429
|
+
}
|
280430
|
+
}
|
280431
|
+
if (options.comment_no_infix === void 0 || options.comment_no_infix === null || options.comment_no_infix === false) {
|
280432
|
+
options.comment_no_infix = false;
|
280433
|
+
} else if (options.comment_no_infix !== true) {
|
280434
|
+
throw new CsvError("CSV_INVALID_OPTION_COMMENT", [
|
280435
|
+
"Invalid option comment_no_infix:",
|
280436
|
+
"value must be a boolean,",
|
280437
|
+
`got ${JSON.stringify(options.comment_no_infix)}`
|
280438
|
+
], options);
|
280439
|
+
}
|
280440
|
+
const delimiter_json = JSON.stringify(options.delimiter);
|
280441
|
+
if (!Array.isArray(options.delimiter))
|
280442
|
+
options.delimiter = [options.delimiter];
|
280443
|
+
if (options.delimiter.length === 0) {
|
280444
|
+
throw new CsvError("CSV_INVALID_OPTION_DELIMITER", [
|
280445
|
+
"Invalid option delimiter:",
|
280446
|
+
"delimiter must be a non empty string or buffer or array of string|buffer,",
|
280447
|
+
`got ${delimiter_json}`
|
280448
|
+
], options);
|
280449
|
+
}
|
280450
|
+
options.delimiter = options.delimiter.map(function(delimiter2) {
|
280451
|
+
if (delimiter2 === void 0 || delimiter2 === null || delimiter2 === false) {
|
280452
|
+
return Buffer.from(",", options.encoding);
|
280453
|
+
}
|
280454
|
+
if (typeof delimiter2 === "string") {
|
280455
|
+
delimiter2 = Buffer.from(delimiter2, options.encoding);
|
280456
|
+
}
|
280457
|
+
if (!Buffer.isBuffer(delimiter2) || delimiter2.length === 0) {
|
280458
|
+
throw new CsvError("CSV_INVALID_OPTION_DELIMITER", [
|
280459
|
+
"Invalid option delimiter:",
|
280460
|
+
"delimiter must be a non empty string or buffer or array of string|buffer,",
|
280461
|
+
`got ${delimiter_json}`
|
280462
|
+
], options);
|
280463
|
+
}
|
280464
|
+
return delimiter2;
|
280465
|
+
});
|
280466
|
+
if (options.escape === void 0 || options.escape === true) {
|
280467
|
+
options.escape = Buffer.from('"', options.encoding);
|
280468
|
+
} else if (typeof options.escape === "string") {
|
280469
|
+
options.escape = Buffer.from(options.escape, options.encoding);
|
280470
|
+
} else if (options.escape === null || options.escape === false) {
|
280471
|
+
options.escape = null;
|
280472
|
+
}
|
280473
|
+
if (options.escape !== null) {
|
280474
|
+
if (!Buffer.isBuffer(options.escape)) {
|
280475
|
+
throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(options.escape)}`);
|
280476
|
+
}
|
280477
|
+
}
|
280478
|
+
if (options.from === void 0 || options.from === null) {
|
280479
|
+
options.from = 1;
|
280480
|
+
} else {
|
280481
|
+
if (typeof options.from === "string" && /\d+/.test(options.from)) {
|
280482
|
+
options.from = parseInt(options.from);
|
280483
|
+
}
|
280484
|
+
if (Number.isInteger(options.from)) {
|
280485
|
+
if (options.from < 0) {
|
280486
|
+
throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(opts.from)}`);
|
280487
|
+
}
|
280488
|
+
} else {
|
280489
|
+
throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(options.from)}`);
|
280490
|
+
}
|
280491
|
+
}
|
280492
|
+
if (options.from_line === void 0 || options.from_line === null) {
|
280493
|
+
options.from_line = 1;
|
280494
|
+
} else {
|
280495
|
+
if (typeof options.from_line === "string" && /\d+/.test(options.from_line)) {
|
280496
|
+
options.from_line = parseInt(options.from_line);
|
280497
|
+
}
|
280498
|
+
if (Number.isInteger(options.from_line)) {
|
280499
|
+
if (options.from_line <= 0) {
|
280500
|
+
throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(opts.from_line)}`);
|
280501
|
+
}
|
280502
|
+
} else {
|
280503
|
+
throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(opts.from_line)}`);
|
280504
|
+
}
|
280505
|
+
}
|
280506
|
+
if (options.ignore_last_delimiters === void 0 || options.ignore_last_delimiters === null) {
|
280507
|
+
options.ignore_last_delimiters = false;
|
280508
|
+
} else if (typeof options.ignore_last_delimiters === "number") {
|
280509
|
+
options.ignore_last_delimiters = Math.floor(options.ignore_last_delimiters);
|
280510
|
+
if (options.ignore_last_delimiters === 0) {
|
280511
|
+
options.ignore_last_delimiters = false;
|
280512
|
+
}
|
280513
|
+
} else if (typeof options.ignore_last_delimiters !== "boolean") {
|
280514
|
+
throw new CsvError("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS", [
|
280515
|
+
"Invalid option `ignore_last_delimiters`:",
|
280516
|
+
"the value must be a boolean value or an integer,",
|
280517
|
+
`got ${JSON.stringify(options.ignore_last_delimiters)}`
|
280518
|
+
], options);
|
280519
|
+
}
|
280520
|
+
if (options.ignore_last_delimiters === true && options.columns === false) {
|
280521
|
+
throw new CsvError("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS", [
|
280522
|
+
"The option `ignore_last_delimiters`",
|
280523
|
+
"requires the activation of the `columns` option"
|
280524
|
+
], options);
|
280525
|
+
}
|
280526
|
+
if (options.info === void 0 || options.info === null || options.info === false) {
|
280527
|
+
options.info = false;
|
280528
|
+
} else if (options.info !== true) {
|
280529
|
+
throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(options.info)}`);
|
280530
|
+
}
|
280531
|
+
if (options.max_record_size === void 0 || options.max_record_size === null || options.max_record_size === false) {
|
280532
|
+
options.max_record_size = 0;
|
280533
|
+
} else if (Number.isInteger(options.max_record_size) && options.max_record_size >= 0) {
|
280534
|
+
} else if (typeof options.max_record_size === "string" && /\d+/.test(options.max_record_size)) {
|
280535
|
+
options.max_record_size = parseInt(options.max_record_size);
|
280536
|
+
} else {
|
280537
|
+
throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(options.max_record_size)}`);
|
280538
|
+
}
|
280539
|
+
if (options.objname === void 0 || options.objname === null || options.objname === false) {
|
280540
|
+
options.objname = void 0;
|
280541
|
+
} else if (Buffer.isBuffer(options.objname)) {
|
280542
|
+
if (options.objname.length === 0) {
|
280543
|
+
throw new Error(`Invalid Option: objname must be a non empty buffer`);
|
280544
|
+
}
|
280545
|
+
if (options.encoding === null) {
|
280546
|
+
} else {
|
280547
|
+
options.objname = options.objname.toString(options.encoding);
|
280548
|
+
}
|
280549
|
+
} else if (typeof options.objname === "string") {
|
280550
|
+
if (options.objname.length === 0) {
|
280551
|
+
throw new Error(`Invalid Option: objname must be a non empty string`);
|
280552
|
+
}
|
280553
|
+
} else if (typeof options.objname === "number") {
|
280554
|
+
} else {
|
280555
|
+
throw new Error(`Invalid Option: objname must be a string or a buffer, got ${options.objname}`);
|
280556
|
+
}
|
280557
|
+
if (options.objname !== void 0) {
|
280558
|
+
if (typeof options.objname === "number") {
|
280559
|
+
if (options.columns !== false) {
|
280560
|
+
throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field");
|
280561
|
+
}
|
280562
|
+
} else {
|
280563
|
+
if (options.columns === false) {
|
280564
|
+
throw Error("Invalid Option: objname field must be combined with columns or be defined as an index");
|
280565
|
+
}
|
280566
|
+
}
|
280567
|
+
}
|
280568
|
+
if (options.on_record === void 0 || options.on_record === null) {
|
280569
|
+
options.on_record = void 0;
|
280570
|
+
} else if (typeof options.on_record !== "function") {
|
280571
|
+
throw new CsvError("CSV_INVALID_OPTION_ON_RECORD", [
|
280572
|
+
"Invalid option `on_record`:",
|
280573
|
+
"expect a function,",
|
280574
|
+
`got ${JSON.stringify(options.on_record)}`
|
280575
|
+
], options);
|
280576
|
+
}
|
280577
|
+
if (options.quote === null || options.quote === false || options.quote === "") {
|
280578
|
+
options.quote = null;
|
280579
|
+
} else {
|
280580
|
+
if (options.quote === void 0 || options.quote === true) {
|
280581
|
+
options.quote = Buffer.from('"', options.encoding);
|
280582
|
+
} else if (typeof options.quote === "string") {
|
280583
|
+
options.quote = Buffer.from(options.quote, options.encoding);
|
280584
|
+
}
|
280585
|
+
if (!Buffer.isBuffer(options.quote)) {
|
280586
|
+
throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(options.quote)}`);
|
280587
|
+
}
|
280588
|
+
}
|
280589
|
+
if (options.raw === void 0 || options.raw === null || options.raw === false) {
|
280590
|
+
options.raw = false;
|
280591
|
+
} else if (options.raw !== true) {
|
280592
|
+
throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(options.raw)}`);
|
280593
|
+
}
|
280594
|
+
if (options.record_delimiter === void 0) {
|
280595
|
+
options.record_delimiter = [];
|
280596
|
+
} else if (typeof options.record_delimiter === "string" || Buffer.isBuffer(options.record_delimiter)) {
|
280597
|
+
if (options.record_delimiter.length === 0) {
|
280598
|
+
throw new CsvError("CSV_INVALID_OPTION_RECORD_DELIMITER", [
|
280599
|
+
"Invalid option `record_delimiter`:",
|
280600
|
+
"value must be a non empty string or buffer,",
|
280601
|
+
`got ${JSON.stringify(options.record_delimiter)}`
|
280602
|
+
], options);
|
280603
|
+
}
|
280604
|
+
options.record_delimiter = [options.record_delimiter];
|
280605
|
+
} else if (!Array.isArray(options.record_delimiter)) {
|
280606
|
+
throw new CsvError("CSV_INVALID_OPTION_RECORD_DELIMITER", [
|
280607
|
+
"Invalid option `record_delimiter`:",
|
280608
|
+
"value must be a string, a buffer or array of string|buffer,",
|
280609
|
+
`got ${JSON.stringify(options.record_delimiter)}`
|
280610
|
+
], options);
|
280611
|
+
}
|
280612
|
+
options.record_delimiter = options.record_delimiter.map(function(rd, i2) {
|
280613
|
+
if (typeof rd !== "string" && !Buffer.isBuffer(rd)) {
|
280614
|
+
throw new CsvError("CSV_INVALID_OPTION_RECORD_DELIMITER", [
|
280615
|
+
"Invalid option `record_delimiter`:",
|
280616
|
+
"value must be a string, a buffer or array of string|buffer",
|
280617
|
+
`at index ${i2},`,
|
280618
|
+
`got ${JSON.stringify(rd)}`
|
280619
|
+
], options);
|
280620
|
+
} else if (rd.length === 0) {
|
280621
|
+
throw new CsvError("CSV_INVALID_OPTION_RECORD_DELIMITER", [
|
280622
|
+
"Invalid option `record_delimiter`:",
|
280623
|
+
"value must be a non empty string or buffer",
|
280624
|
+
`at index ${i2},`,
|
280625
|
+
`got ${JSON.stringify(rd)}`
|
280626
|
+
], options);
|
280627
|
+
}
|
280628
|
+
if (typeof rd === "string") {
|
280629
|
+
rd = Buffer.from(rd, options.encoding);
|
280630
|
+
}
|
280631
|
+
return rd;
|
280632
|
+
});
|
280633
|
+
if (typeof options.relax_column_count === "boolean") {
|
280634
|
+
} else if (options.relax_column_count === void 0 || options.relax_column_count === null) {
|
280635
|
+
options.relax_column_count = false;
|
280636
|
+
} else {
|
280637
|
+
throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(options.relax_column_count)}`);
|
280638
|
+
}
|
280639
|
+
if (typeof options.relax_column_count_less === "boolean") {
|
280640
|
+
} else if (options.relax_column_count_less === void 0 || options.relax_column_count_less === null) {
|
280641
|
+
options.relax_column_count_less = false;
|
280642
|
+
} else {
|
280643
|
+
throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(options.relax_column_count_less)}`);
|
280644
|
+
}
|
280645
|
+
if (typeof options.relax_column_count_more === "boolean") {
|
280646
|
+
} else if (options.relax_column_count_more === void 0 || options.relax_column_count_more === null) {
|
280647
|
+
options.relax_column_count_more = false;
|
280648
|
+
} else {
|
280649
|
+
throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(options.relax_column_count_more)}`);
|
280650
|
+
}
|
280651
|
+
if (typeof options.relax_quotes === "boolean") {
|
280652
|
+
} else if (options.relax_quotes === void 0 || options.relax_quotes === null) {
|
280653
|
+
options.relax_quotes = false;
|
280654
|
+
} else {
|
280655
|
+
throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(options.relax_quotes)}`);
|
280656
|
+
}
|
280657
|
+
if (typeof options.skip_empty_lines === "boolean") {
|
280658
|
+
} else if (options.skip_empty_lines === void 0 || options.skip_empty_lines === null) {
|
280659
|
+
options.skip_empty_lines = false;
|
280660
|
+
} else {
|
280661
|
+
throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(options.skip_empty_lines)}`);
|
280662
|
+
}
|
280663
|
+
if (typeof options.skip_records_with_empty_values === "boolean") {
|
280664
|
+
} else if (options.skip_records_with_empty_values === void 0 || options.skip_records_with_empty_values === null) {
|
280665
|
+
options.skip_records_with_empty_values = false;
|
280666
|
+
} else {
|
280667
|
+
throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(options.skip_records_with_empty_values)}`);
|
280668
|
+
}
|
280669
|
+
if (typeof options.skip_records_with_error === "boolean") {
|
280670
|
+
} else if (options.skip_records_with_error === void 0 || options.skip_records_with_error === null) {
|
280671
|
+
options.skip_records_with_error = false;
|
280672
|
+
} else {
|
280673
|
+
throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(options.skip_records_with_error)}`);
|
280674
|
+
}
|
280675
|
+
if (options.rtrim === void 0 || options.rtrim === null || options.rtrim === false) {
|
280676
|
+
options.rtrim = false;
|
280677
|
+
} else if (options.rtrim !== true) {
|
280678
|
+
throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(options.rtrim)}`);
|
280679
|
+
}
|
280680
|
+
if (options.ltrim === void 0 || options.ltrim === null || options.ltrim === false) {
|
280681
|
+
options.ltrim = false;
|
280682
|
+
} else if (options.ltrim !== true) {
|
280683
|
+
throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(options.ltrim)}`);
|
280684
|
+
}
|
280685
|
+
if (options.trim === void 0 || options.trim === null || options.trim === false) {
|
280686
|
+
options.trim = false;
|
280687
|
+
} else if (options.trim !== true) {
|
280688
|
+
throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(options.trim)}`);
|
280689
|
+
}
|
280690
|
+
if (options.trim === true && opts.ltrim !== false) {
|
280691
|
+
options.ltrim = true;
|
280692
|
+
} else if (options.ltrim !== true) {
|
280693
|
+
options.ltrim = false;
|
280694
|
+
}
|
280695
|
+
if (options.trim === true && opts.rtrim !== false) {
|
280696
|
+
options.rtrim = true;
|
280697
|
+
} else if (options.rtrim !== true) {
|
280698
|
+
options.rtrim = false;
|
280699
|
+
}
|
280700
|
+
if (options.to === void 0 || options.to === null) {
|
280701
|
+
options.to = -1;
|
280702
|
+
} else {
|
280703
|
+
if (typeof options.to === "string" && /\d+/.test(options.to)) {
|
280704
|
+
options.to = parseInt(options.to);
|
280705
|
+
}
|
280706
|
+
if (Number.isInteger(options.to)) {
|
280707
|
+
if (options.to <= 0) {
|
280708
|
+
throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(opts.to)}`);
|
280709
|
+
}
|
280710
|
+
} else {
|
280711
|
+
throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(opts.to)}`);
|
280712
|
+
}
|
280713
|
+
}
|
280714
|
+
if (options.to_line === void 0 || options.to_line === null) {
|
280715
|
+
options.to_line = -1;
|
280716
|
+
} else {
|
280717
|
+
if (typeof options.to_line === "string" && /\d+/.test(options.to_line)) {
|
280718
|
+
options.to_line = parseInt(options.to_line);
|
280719
|
+
}
|
280720
|
+
if (Number.isInteger(options.to_line)) {
|
280721
|
+
if (options.to_line <= 0) {
|
280722
|
+
throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(opts.to_line)}`);
|
280723
|
+
}
|
280724
|
+
} else {
|
280725
|
+
throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(opts.to_line)}`);
|
280726
|
+
}
|
280727
|
+
}
|
280728
|
+
return options;
|
280729
|
+
};
|
280730
|
+
|
280731
|
+
// ../myst-directives/node_modules/csv-parse/lib/api/index.js
|
280732
|
+
var isRecordEmpty = function(record) {
|
280733
|
+
return record.every((field) => field == null || field.toString && field.toString().trim() === "");
|
280734
|
+
};
|
280735
|
+
var cr2 = 13;
|
280736
|
+
var nl2 = 10;
|
280737
|
+
var boms = {
|
280738
|
+
// Note, the following are equals:
|
280739
|
+
// Buffer.from("\ufeff")
|
280740
|
+
// Buffer.from([239, 187, 191])
|
280741
|
+
// Buffer.from('EFBBBF', 'hex')
|
280742
|
+
"utf8": Buffer.from([239, 187, 191]),
|
280743
|
+
// Note, the following are equals:
|
280744
|
+
// Buffer.from "\ufeff", 'utf16le
|
280745
|
+
// Buffer.from([255, 254])
|
280746
|
+
"utf16le": Buffer.from([255, 254])
|
280747
|
+
};
|
280748
|
+
var transform2 = function(original_options = {}) {
|
280749
|
+
const info = {
|
280750
|
+
bytes: 0,
|
280751
|
+
comment_lines: 0,
|
280752
|
+
empty_lines: 0,
|
280753
|
+
invalid_field_length: 0,
|
280754
|
+
lines: 1,
|
280755
|
+
records: 0
|
280756
|
+
};
|
280757
|
+
const options = normalize_options(original_options);
|
280758
|
+
return {
|
280759
|
+
info,
|
280760
|
+
original_options,
|
280761
|
+
options,
|
280762
|
+
state: init_state(options),
|
280763
|
+
__needMoreData: function(i2, bufLen, end) {
|
280764
|
+
if (end)
|
280765
|
+
return false;
|
280766
|
+
const { encoding, escape: escape5, quote } = this.options;
|
280767
|
+
const { quoting, needMoreDataSize, recordDelimiterMaxLength } = this.state;
|
280768
|
+
const numOfCharLeft = bufLen - i2 - 1;
|
280769
|
+
const requiredLength = Math.max(
|
280770
|
+
needMoreDataSize,
|
280771
|
+
// Skip if the remaining buffer smaller than record delimiter
|
280772
|
+
// If "record_delimiter" is yet to be discovered:
|
280773
|
+
// 1. It is equals to `[]` and "recordDelimiterMaxLength" equals `0`
|
280774
|
+
// 2. We set the length to windows line ending in the current encoding
|
280775
|
+
// Note, that encoding is known from user or bom discovery at that point
|
280776
|
+
// recordDelimiterMaxLength,
|
280777
|
+
recordDelimiterMaxLength === 0 ? Buffer.from("\r\n", encoding).length : recordDelimiterMaxLength,
|
280778
|
+
// Skip if remaining buffer can be an escaped quote
|
280779
|
+
quoting ? (escape5 === null ? 0 : escape5.length) + quote.length : 0,
|
280780
|
+
// Skip if remaining buffer can be record delimiter following the closing quote
|
280781
|
+
quoting ? quote.length + recordDelimiterMaxLength : 0
|
280782
|
+
);
|
280783
|
+
return numOfCharLeft < requiredLength;
|
280784
|
+
},
|
280785
|
+
// Central parser implementation
|
280786
|
+
parse: function(nextBuf, end, push, close2) {
|
280787
|
+
const { bom, comment_no_infix, encoding, from_line, ltrim, max_record_size, raw: raw2, relax_quotes, rtrim, skip_empty_lines, to, to_line } = this.options;
|
280788
|
+
let { comment: comment7, escape: escape5, quote, record_delimiter } = this.options;
|
280789
|
+
const { bomSkipped, previousBuf, rawBuffer, escapeIsQuote } = this.state;
|
280790
|
+
let buf;
|
280791
|
+
if (previousBuf === void 0) {
|
280792
|
+
if (nextBuf === void 0) {
|
280793
|
+
close2();
|
280794
|
+
return;
|
280795
|
+
} else {
|
280796
|
+
buf = nextBuf;
|
280797
|
+
}
|
280798
|
+
} else if (previousBuf !== void 0 && nextBuf === void 0) {
|
280799
|
+
buf = previousBuf;
|
280800
|
+
} else {
|
280801
|
+
buf = Buffer.concat([previousBuf, nextBuf]);
|
280802
|
+
}
|
280803
|
+
if (bomSkipped === false) {
|
280804
|
+
if (bom === false) {
|
280805
|
+
this.state.bomSkipped = true;
|
280806
|
+
} else if (buf.length < 3) {
|
280807
|
+
if (end === false) {
|
280808
|
+
this.state.previousBuf = buf;
|
280809
|
+
return;
|
280810
|
+
}
|
280811
|
+
} else {
|
280812
|
+
for (const encoding2 in boms) {
|
280813
|
+
if (boms[encoding2].compare(buf, 0, boms[encoding2].length) === 0) {
|
280814
|
+
const bomLength = boms[encoding2].length;
|
280815
|
+
this.state.bufBytesStart += bomLength;
|
280816
|
+
buf = buf.slice(bomLength);
|
280817
|
+
this.options = normalize_options({ ...this.original_options, encoding: encoding2 });
|
280818
|
+
({ comment: comment7, escape: escape5, quote } = this.options);
|
280819
|
+
break;
|
280820
|
+
}
|
280821
|
+
}
|
280822
|
+
this.state.bomSkipped = true;
|
280823
|
+
}
|
280824
|
+
}
|
280825
|
+
const bufLen = buf.length;
|
280826
|
+
let pos;
|
280827
|
+
for (pos = 0; pos < bufLen; pos++) {
|
280828
|
+
if (this.__needMoreData(pos, bufLen, end)) {
|
280829
|
+
break;
|
280830
|
+
}
|
280831
|
+
if (this.state.wasRowDelimiter === true) {
|
280832
|
+
this.info.lines++;
|
280833
|
+
this.state.wasRowDelimiter = false;
|
280834
|
+
}
|
280835
|
+
if (to_line !== -1 && this.info.lines > to_line) {
|
280836
|
+
this.state.stop = true;
|
280837
|
+
close2();
|
280838
|
+
return;
|
280839
|
+
}
|
280840
|
+
if (this.state.quoting === false && record_delimiter.length === 0) {
|
280841
|
+
const record_delimiterCount = this.__autoDiscoverRecordDelimiter(buf, pos);
|
280842
|
+
if (record_delimiterCount) {
|
280843
|
+
record_delimiter = this.options.record_delimiter;
|
280844
|
+
}
|
280845
|
+
}
|
280846
|
+
const chr = buf[pos];
|
280847
|
+
if (raw2 === true) {
|
280848
|
+
rawBuffer.append(chr);
|
280849
|
+
}
|
280850
|
+
if ((chr === cr2 || chr === nl2) && this.state.wasRowDelimiter === false) {
|
280851
|
+
this.state.wasRowDelimiter = true;
|
280852
|
+
}
|
280853
|
+
if (this.state.escaping === true) {
|
280854
|
+
this.state.escaping = false;
|
280855
|
+
} else {
|
280856
|
+
if (escape5 !== null && this.state.quoting === true && this.__isEscape(buf, pos, chr) && pos + escape5.length < bufLen) {
|
280857
|
+
if (escapeIsQuote) {
|
280858
|
+
if (this.__isQuote(buf, pos + escape5.length)) {
|
280859
|
+
this.state.escaping = true;
|
280860
|
+
pos += escape5.length - 1;
|
280861
|
+
continue;
|
280862
|
+
}
|
280863
|
+
} else {
|
280864
|
+
this.state.escaping = true;
|
280865
|
+
pos += escape5.length - 1;
|
280866
|
+
continue;
|
280867
|
+
}
|
280868
|
+
}
|
280869
|
+
if (this.state.commenting === false && this.__isQuote(buf, pos)) {
|
280870
|
+
if (this.state.quoting === true) {
|
280871
|
+
const nextChr = buf[pos + quote.length];
|
280872
|
+
const isNextChrTrimable = rtrim && this.__isCharTrimable(buf, pos + quote.length);
|
280873
|
+
const isNextChrComment = comment7 !== null && this.__compareBytes(comment7, buf, pos + quote.length, nextChr);
|
280874
|
+
const isNextChrDelimiter = this.__isDelimiter(buf, pos + quote.length, nextChr);
|
280875
|
+
const isNextChrRecordDelimiter = record_delimiter.length === 0 ? this.__autoDiscoverRecordDelimiter(buf, pos + quote.length) : this.__isRecordDelimiter(nextChr, buf, pos + quote.length);
|
280876
|
+
if (escape5 !== null && this.__isEscape(buf, pos, chr) && this.__isQuote(buf, pos + escape5.length)) {
|
280877
|
+
pos += escape5.length - 1;
|
280878
|
+
} else if (!nextChr || isNextChrDelimiter || isNextChrRecordDelimiter || isNextChrComment || isNextChrTrimable) {
|
280879
|
+
this.state.quoting = false;
|
280880
|
+
this.state.wasQuoting = true;
|
280881
|
+
pos += quote.length - 1;
|
280882
|
+
continue;
|
280883
|
+
} else if (relax_quotes === false) {
|
280884
|
+
const err = this.__error(
|
280885
|
+
new CsvError("CSV_INVALID_CLOSING_QUOTE", [
|
280886
|
+
"Invalid Closing Quote:",
|
280887
|
+
`got "${String.fromCharCode(nextChr)}"`,
|
280888
|
+
`at line ${this.info.lines}`,
|
280889
|
+
"instead of delimiter, record delimiter, trimable character",
|
280890
|
+
"(if activated) or comment"
|
280891
|
+
], this.options, this.__infoField())
|
280892
|
+
);
|
280893
|
+
if (err !== void 0)
|
280894
|
+
return err;
|
280895
|
+
} else {
|
280896
|
+
this.state.quoting = false;
|
280897
|
+
this.state.wasQuoting = true;
|
280898
|
+
this.state.field.prepend(quote);
|
280899
|
+
pos += quote.length - 1;
|
280900
|
+
}
|
280901
|
+
} else {
|
280902
|
+
if (this.state.field.length !== 0) {
|
280903
|
+
if (relax_quotes === false) {
|
280904
|
+
const info2 = this.__infoField();
|
280905
|
+
const bom2 = Object.keys(boms).map((b) => boms[b].equals(this.state.field.toString()) ? b : false).filter(Boolean)[0];
|
280906
|
+
const err = this.__error(
|
280907
|
+
new CsvError("INVALID_OPENING_QUOTE", [
|
280908
|
+
"Invalid Opening Quote:",
|
280909
|
+
`a quote is found on field ${JSON.stringify(info2.column)} at line ${info2.lines}, value is ${JSON.stringify(this.state.field.toString(encoding))}`,
|
280910
|
+
bom2 ? `(${bom2} bom)` : void 0
|
280911
|
+
], this.options, info2, {
|
280912
|
+
field: this.state.field
|
280913
|
+
})
|
280914
|
+
);
|
280915
|
+
if (err !== void 0)
|
280916
|
+
return err;
|
280917
|
+
}
|
280918
|
+
} else {
|
280919
|
+
this.state.quoting = true;
|
280920
|
+
pos += quote.length - 1;
|
280921
|
+
continue;
|
280922
|
+
}
|
280923
|
+
}
|
280924
|
+
}
|
280925
|
+
if (this.state.quoting === false) {
|
280926
|
+
const recordDelimiterLength = this.__isRecordDelimiter(chr, buf, pos);
|
280927
|
+
if (recordDelimiterLength !== 0) {
|
280928
|
+
const skipCommentLine = this.state.commenting && (this.state.wasQuoting === false && this.state.record.length === 0 && this.state.field.length === 0);
|
280929
|
+
if (skipCommentLine) {
|
280930
|
+
this.info.comment_lines++;
|
280931
|
+
} else {
|
280932
|
+
if (this.state.enabled === false && this.info.lines + (this.state.wasRowDelimiter === true ? 1 : 0) >= from_line) {
|
280933
|
+
this.state.enabled = true;
|
280934
|
+
this.__resetField();
|
280935
|
+
this.__resetRecord();
|
280936
|
+
pos += recordDelimiterLength - 1;
|
280937
|
+
continue;
|
280938
|
+
}
|
280939
|
+
if (skip_empty_lines === true && this.state.wasQuoting === false && this.state.record.length === 0 && this.state.field.length === 0) {
|
280940
|
+
this.info.empty_lines++;
|
280941
|
+
pos += recordDelimiterLength - 1;
|
280942
|
+
continue;
|
280943
|
+
}
|
280944
|
+
this.info.bytes = this.state.bufBytesStart + pos;
|
280945
|
+
const errField = this.__onField();
|
280946
|
+
if (errField !== void 0)
|
280947
|
+
return errField;
|
280948
|
+
this.info.bytes = this.state.bufBytesStart + pos + recordDelimiterLength;
|
280949
|
+
const errRecord = this.__onRecord(push);
|
280950
|
+
if (errRecord !== void 0)
|
280951
|
+
return errRecord;
|
280952
|
+
if (to !== -1 && this.info.records >= to) {
|
280953
|
+
this.state.stop = true;
|
280954
|
+
close2();
|
280955
|
+
return;
|
280956
|
+
}
|
280957
|
+
}
|
280958
|
+
this.state.commenting = false;
|
280959
|
+
pos += recordDelimiterLength - 1;
|
280960
|
+
continue;
|
280961
|
+
}
|
280962
|
+
if (this.state.commenting) {
|
280963
|
+
continue;
|
280964
|
+
}
|
280965
|
+
if (comment7 !== null && (comment_no_infix === false || this.state.record.length === 0 && this.state.field.length === 0)) {
|
280966
|
+
const commentCount = this.__compareBytes(comment7, buf, pos, chr);
|
280967
|
+
if (commentCount !== 0) {
|
280968
|
+
this.state.commenting = true;
|
280969
|
+
continue;
|
280970
|
+
}
|
280971
|
+
}
|
280972
|
+
const delimiterLength = this.__isDelimiter(buf, pos, chr);
|
280973
|
+
if (delimiterLength !== 0) {
|
280974
|
+
this.info.bytes = this.state.bufBytesStart + pos;
|
280975
|
+
const errField = this.__onField();
|
280976
|
+
if (errField !== void 0)
|
280977
|
+
return errField;
|
280978
|
+
pos += delimiterLength - 1;
|
280979
|
+
continue;
|
280980
|
+
}
|
280981
|
+
}
|
280982
|
+
}
|
280983
|
+
if (this.state.commenting === false) {
|
280984
|
+
if (max_record_size !== 0 && this.state.record_length + this.state.field.length > max_record_size) {
|
280985
|
+
return this.__error(
|
280986
|
+
new CsvError("CSV_MAX_RECORD_SIZE", [
|
280987
|
+
"Max Record Size:",
|
280988
|
+
"record exceed the maximum number of tolerated bytes",
|
280989
|
+
`of ${max_record_size}`,
|
280990
|
+
`at line ${this.info.lines}`
|
280991
|
+
], this.options, this.__infoField())
|
280992
|
+
);
|
280993
|
+
}
|
280994
|
+
}
|
280995
|
+
const lappend = ltrim === false || this.state.quoting === true || this.state.field.length !== 0 || !this.__isCharTrimable(buf, pos);
|
280996
|
+
const rappend = rtrim === false || this.state.wasQuoting === false;
|
280997
|
+
if (lappend === true && rappend === true) {
|
280998
|
+
this.state.field.append(chr);
|
280999
|
+
} else if (rtrim === true && !this.__isCharTrimable(buf, pos)) {
|
281000
|
+
return this.__error(
|
281001
|
+
new CsvError("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE", [
|
281002
|
+
"Invalid Closing Quote:",
|
281003
|
+
"found non trimable byte after quote",
|
281004
|
+
`at line ${this.info.lines}`
|
281005
|
+
], this.options, this.__infoField())
|
281006
|
+
);
|
281007
|
+
} else {
|
281008
|
+
if (lappend === false) {
|
281009
|
+
pos += this.__isCharTrimable(buf, pos) - 1;
|
281010
|
+
}
|
281011
|
+
continue;
|
281012
|
+
}
|
281013
|
+
}
|
281014
|
+
if (end === true) {
|
281015
|
+
if (this.state.quoting === true) {
|
281016
|
+
const err = this.__error(
|
281017
|
+
new CsvError("CSV_QUOTE_NOT_CLOSED", [
|
281018
|
+
"Quote Not Closed:",
|
281019
|
+
`the parsing is finished with an opening quote at line ${this.info.lines}`
|
281020
|
+
], this.options, this.__infoField())
|
281021
|
+
);
|
281022
|
+
if (err !== void 0)
|
281023
|
+
return err;
|
281024
|
+
} else {
|
281025
|
+
if (this.state.wasQuoting === true || this.state.record.length !== 0 || this.state.field.length !== 0) {
|
281026
|
+
this.info.bytes = this.state.bufBytesStart + pos;
|
281027
|
+
const errField = this.__onField();
|
281028
|
+
if (errField !== void 0)
|
281029
|
+
return errField;
|
281030
|
+
const errRecord = this.__onRecord(push);
|
281031
|
+
if (errRecord !== void 0)
|
281032
|
+
return errRecord;
|
281033
|
+
} else if (this.state.wasRowDelimiter === true) {
|
281034
|
+
this.info.empty_lines++;
|
281035
|
+
} else if (this.state.commenting === true) {
|
281036
|
+
this.info.comment_lines++;
|
281037
|
+
}
|
281038
|
+
}
|
281039
|
+
} else {
|
281040
|
+
this.state.bufBytesStart += pos;
|
281041
|
+
this.state.previousBuf = buf.slice(pos);
|
281042
|
+
}
|
281043
|
+
if (this.state.wasRowDelimiter === true) {
|
281044
|
+
this.info.lines++;
|
281045
|
+
this.state.wasRowDelimiter = false;
|
281046
|
+
}
|
281047
|
+
},
|
281048
|
+
__onRecord: function(push) {
|
281049
|
+
const { columns, group_columns_by_name, encoding, info: info2, from: from3, relax_column_count, relax_column_count_less, relax_column_count_more, raw: raw2, skip_records_with_empty_values } = this.options;
|
281050
|
+
const { enabled, record } = this.state;
|
281051
|
+
if (enabled === false) {
|
281052
|
+
return this.__resetRecord();
|
281053
|
+
}
|
281054
|
+
const recordLength = record.length;
|
281055
|
+
if (columns === true) {
|
281056
|
+
if (skip_records_with_empty_values === true && isRecordEmpty(record)) {
|
281057
|
+
this.__resetRecord();
|
281058
|
+
return;
|
281059
|
+
}
|
281060
|
+
return this.__firstLineToColumns(record);
|
281061
|
+
}
|
281062
|
+
if (columns === false && this.info.records === 0) {
|
281063
|
+
this.state.expectedRecordLength = recordLength;
|
281064
|
+
}
|
281065
|
+
if (recordLength !== this.state.expectedRecordLength) {
|
281066
|
+
const err = columns === false ? new CsvError("CSV_RECORD_INCONSISTENT_FIELDS_LENGTH", [
|
281067
|
+
"Invalid Record Length:",
|
281068
|
+
`expect ${this.state.expectedRecordLength},`,
|
281069
|
+
`got ${recordLength} on line ${this.info.lines}`
|
281070
|
+
], this.options, this.__infoField(), {
|
281071
|
+
record
|
281072
|
+
}) : new CsvError("CSV_RECORD_INCONSISTENT_COLUMNS", [
|
281073
|
+
"Invalid Record Length:",
|
281074
|
+
`columns length is ${columns.length},`,
|
281075
|
+
// rename columns
|
281076
|
+
`got ${recordLength} on line ${this.info.lines}`
|
281077
|
+
], this.options, this.__infoField(), {
|
281078
|
+
record
|
281079
|
+
});
|
281080
|
+
if (relax_column_count === true || relax_column_count_less === true && recordLength < this.state.expectedRecordLength || relax_column_count_more === true && recordLength > this.state.expectedRecordLength) {
|
281081
|
+
this.info.invalid_field_length++;
|
281082
|
+
this.state.error = err;
|
281083
|
+
} else {
|
281084
|
+
const finalErr = this.__error(err);
|
281085
|
+
if (finalErr)
|
281086
|
+
return finalErr;
|
281087
|
+
}
|
281088
|
+
}
|
281089
|
+
if (skip_records_with_empty_values === true && isRecordEmpty(record)) {
|
281090
|
+
this.__resetRecord();
|
281091
|
+
return;
|
281092
|
+
}
|
281093
|
+
if (this.state.recordHasError === true) {
|
281094
|
+
this.__resetRecord();
|
281095
|
+
this.state.recordHasError = false;
|
281096
|
+
return;
|
281097
|
+
}
|
281098
|
+
this.info.records++;
|
281099
|
+
if (from3 === 1 || this.info.records >= from3) {
|
281100
|
+
const { objname } = this.options;
|
281101
|
+
if (columns !== false) {
|
281102
|
+
const obj = {};
|
281103
|
+
for (let i2 = 0, l = record.length; i2 < l; i2++) {
|
281104
|
+
if (columns[i2] === void 0 || columns[i2].disabled)
|
281105
|
+
continue;
|
281106
|
+
if (group_columns_by_name === true && obj[columns[i2].name] !== void 0) {
|
281107
|
+
if (Array.isArray(obj[columns[i2].name])) {
|
281108
|
+
obj[columns[i2].name] = obj[columns[i2].name].concat(record[i2]);
|
281109
|
+
} else {
|
281110
|
+
obj[columns[i2].name] = [obj[columns[i2].name], record[i2]];
|
281111
|
+
}
|
281112
|
+
} else {
|
281113
|
+
obj[columns[i2].name] = record[i2];
|
281114
|
+
}
|
281115
|
+
}
|
281116
|
+
if (raw2 === true || info2 === true) {
|
281117
|
+
const extRecord = Object.assign(
|
281118
|
+
{ record: obj },
|
281119
|
+
raw2 === true ? { raw: this.state.rawBuffer.toString(encoding) } : {},
|
281120
|
+
info2 === true ? { info: this.__infoRecord() } : {}
|
281121
|
+
);
|
281122
|
+
const err = this.__push(
|
281123
|
+
objname === void 0 ? extRecord : [obj[objname], extRecord],
|
281124
|
+
push
|
281125
|
+
);
|
281126
|
+
if (err) {
|
281127
|
+
return err;
|
281128
|
+
}
|
281129
|
+
} else {
|
281130
|
+
const err = this.__push(
|
281131
|
+
objname === void 0 ? obj : [obj[objname], obj],
|
281132
|
+
push
|
281133
|
+
);
|
281134
|
+
if (err) {
|
281135
|
+
return err;
|
281136
|
+
}
|
281137
|
+
}
|
281138
|
+
} else {
|
281139
|
+
if (raw2 === true || info2 === true) {
|
281140
|
+
const extRecord = Object.assign(
|
281141
|
+
{ record },
|
281142
|
+
raw2 === true ? { raw: this.state.rawBuffer.toString(encoding) } : {},
|
281143
|
+
info2 === true ? { info: this.__infoRecord() } : {}
|
281144
|
+
);
|
281145
|
+
const err = this.__push(
|
281146
|
+
objname === void 0 ? extRecord : [record[objname], extRecord],
|
281147
|
+
push
|
281148
|
+
);
|
281149
|
+
if (err) {
|
281150
|
+
return err;
|
281151
|
+
}
|
281152
|
+
} else {
|
281153
|
+
const err = this.__push(
|
281154
|
+
objname === void 0 ? record : [record[objname], record],
|
281155
|
+
push
|
281156
|
+
);
|
281157
|
+
if (err) {
|
281158
|
+
return err;
|
281159
|
+
}
|
281160
|
+
}
|
281161
|
+
}
|
281162
|
+
}
|
281163
|
+
this.__resetRecord();
|
281164
|
+
},
|
281165
|
+
__firstLineToColumns: function(record) {
|
281166
|
+
const { firstLineToHeaders } = this.state;
|
281167
|
+
try {
|
281168
|
+
const headers = firstLineToHeaders === void 0 ? record : firstLineToHeaders.call(null, record);
|
281169
|
+
if (!Array.isArray(headers)) {
|
281170
|
+
return this.__error(
|
281171
|
+
new CsvError("CSV_INVALID_COLUMN_MAPPING", [
|
281172
|
+
"Invalid Column Mapping:",
|
281173
|
+
"expect an array from column function,",
|
281174
|
+
`got ${JSON.stringify(headers)}`
|
281175
|
+
], this.options, this.__infoField(), {
|
281176
|
+
headers
|
281177
|
+
})
|
281178
|
+
);
|
281179
|
+
}
|
281180
|
+
const normalizedHeaders = normalize_columns_array(headers);
|
281181
|
+
this.state.expectedRecordLength = normalizedHeaders.length;
|
281182
|
+
this.options.columns = normalizedHeaders;
|
281183
|
+
this.__resetRecord();
|
281184
|
+
return;
|
281185
|
+
} catch (err) {
|
281186
|
+
return err;
|
281187
|
+
}
|
281188
|
+
},
|
281189
|
+
__resetRecord: function() {
|
281190
|
+
if (this.options.raw === true) {
|
281191
|
+
this.state.rawBuffer.reset();
|
281192
|
+
}
|
281193
|
+
this.state.error = void 0;
|
281194
|
+
this.state.record = [];
|
281195
|
+
this.state.record_length = 0;
|
281196
|
+
},
|
281197
|
+
__onField: function() {
|
281198
|
+
const { cast, encoding, rtrim, max_record_size } = this.options;
|
281199
|
+
const { enabled, wasQuoting } = this.state;
|
281200
|
+
if (enabled === false) {
|
281201
|
+
return this.__resetField();
|
281202
|
+
}
|
281203
|
+
let field = this.state.field.toString(encoding);
|
281204
|
+
if (rtrim === true && wasQuoting === false) {
|
281205
|
+
field = field.trimRight();
|
281206
|
+
}
|
281207
|
+
if (cast === true) {
|
281208
|
+
const [err, f3] = this.__cast(field);
|
281209
|
+
if (err !== void 0)
|
281210
|
+
return err;
|
281211
|
+
field = f3;
|
281212
|
+
}
|
281213
|
+
this.state.record.push(field);
|
281214
|
+
if (max_record_size !== 0 && typeof field === "string") {
|
281215
|
+
this.state.record_length += field.length;
|
281216
|
+
}
|
281217
|
+
this.__resetField();
|
281218
|
+
},
|
281219
|
+
__resetField: function() {
|
281220
|
+
this.state.field.reset();
|
281221
|
+
this.state.wasQuoting = false;
|
281222
|
+
},
|
281223
|
+
__push: function(record, push) {
|
281224
|
+
const { on_record } = this.options;
|
281225
|
+
if (on_record !== void 0) {
|
281226
|
+
const info2 = this.__infoRecord();
|
281227
|
+
try {
|
281228
|
+
record = on_record.call(null, record, info2);
|
281229
|
+
} catch (err) {
|
281230
|
+
return err;
|
281231
|
+
}
|
281232
|
+
if (record === void 0 || record === null) {
|
281233
|
+
return;
|
281234
|
+
}
|
281235
|
+
}
|
281236
|
+
push(record);
|
281237
|
+
},
|
281238
|
+
// Return a tuple with the error and the casted value
|
281239
|
+
__cast: function(field) {
|
281240
|
+
const { columns, relax_column_count } = this.options;
|
281241
|
+
const isColumns = Array.isArray(columns);
|
281242
|
+
if (isColumns === true && relax_column_count && this.options.columns.length <= this.state.record.length) {
|
281243
|
+
return [void 0, void 0];
|
281244
|
+
}
|
281245
|
+
if (this.state.castField !== null) {
|
281246
|
+
try {
|
281247
|
+
const info2 = this.__infoField();
|
281248
|
+
return [void 0, this.state.castField.call(null, field, info2)];
|
281249
|
+
} catch (err) {
|
281250
|
+
return [err];
|
281251
|
+
}
|
281252
|
+
}
|
281253
|
+
if (this.__isFloat(field)) {
|
281254
|
+
return [void 0, parseFloat(field)];
|
281255
|
+
} else if (this.options.cast_date !== false) {
|
281256
|
+
const info2 = this.__infoField();
|
281257
|
+
return [void 0, this.options.cast_date.call(null, field, info2)];
|
281258
|
+
}
|
281259
|
+
return [void 0, field];
|
281260
|
+
},
|
281261
|
+
// Helper to test if a character is a space or a line delimiter
|
281262
|
+
__isCharTrimable: function(buf, pos) {
|
281263
|
+
const isTrim = (buf2, pos2) => {
|
281264
|
+
const { timchars } = this.state;
|
281265
|
+
loop1:
|
281266
|
+
for (let i2 = 0; i2 < timchars.length; i2++) {
|
281267
|
+
const timchar = timchars[i2];
|
281268
|
+
for (let j = 0; j < timchar.length; j++) {
|
281269
|
+
if (timchar[j] !== buf2[pos2 + j])
|
281270
|
+
continue loop1;
|
281271
|
+
}
|
281272
|
+
return timchar.length;
|
281273
|
+
}
|
281274
|
+
return 0;
|
281275
|
+
};
|
281276
|
+
return isTrim(buf, pos);
|
281277
|
+
},
|
281278
|
+
// Keep it in case we implement the `cast_int` option
|
281279
|
+
// __isInt(value){
|
281280
|
+
// // return Number.isInteger(parseInt(value))
|
281281
|
+
// // return !isNaN( parseInt( obj ) );
|
281282
|
+
// return /^(\-|\+)?[1-9][0-9]*$/.test(value)
|
281283
|
+
// }
|
281284
|
+
__isFloat: function(value) {
|
281285
|
+
return value - parseFloat(value) + 1 >= 0;
|
281286
|
+
},
|
281287
|
+
__compareBytes: function(sourceBuf, targetBuf, targetPos, firstByte) {
|
281288
|
+
if (sourceBuf[0] !== firstByte)
|
281289
|
+
return 0;
|
281290
|
+
const sourceLength = sourceBuf.length;
|
281291
|
+
for (let i2 = 1; i2 < sourceLength; i2++) {
|
281292
|
+
if (sourceBuf[i2] !== targetBuf[targetPos + i2])
|
281293
|
+
return 0;
|
281294
|
+
}
|
281295
|
+
return sourceLength;
|
281296
|
+
},
|
281297
|
+
__isDelimiter: function(buf, pos, chr) {
|
281298
|
+
const { delimiter: delimiter2, ignore_last_delimiters } = this.options;
|
281299
|
+
if (ignore_last_delimiters === true && this.state.record.length === this.options.columns.length - 1) {
|
281300
|
+
return 0;
|
281301
|
+
} else if (ignore_last_delimiters !== false && typeof ignore_last_delimiters === "number" && this.state.record.length === ignore_last_delimiters - 1) {
|
281302
|
+
return 0;
|
281303
|
+
}
|
281304
|
+
loop1:
|
281305
|
+
for (let i2 = 0; i2 < delimiter2.length; i2++) {
|
281306
|
+
const del2 = delimiter2[i2];
|
281307
|
+
if (del2[0] === chr) {
|
281308
|
+
for (let j = 1; j < del2.length; j++) {
|
281309
|
+
if (del2[j] !== buf[pos + j])
|
281310
|
+
continue loop1;
|
281311
|
+
}
|
281312
|
+
return del2.length;
|
281313
|
+
}
|
281314
|
+
}
|
281315
|
+
return 0;
|
281316
|
+
},
|
281317
|
+
__isRecordDelimiter: function(chr, buf, pos) {
|
281318
|
+
const { record_delimiter } = this.options;
|
281319
|
+
const recordDelimiterLength = record_delimiter.length;
|
281320
|
+
loop1:
|
281321
|
+
for (let i2 = 0; i2 < recordDelimiterLength; i2++) {
|
281322
|
+
const rd = record_delimiter[i2];
|
281323
|
+
const rdLength = rd.length;
|
281324
|
+
if (rd[0] !== chr) {
|
281325
|
+
continue;
|
281326
|
+
}
|
281327
|
+
for (let j = 1; j < rdLength; j++) {
|
281328
|
+
if (rd[j] !== buf[pos + j]) {
|
281329
|
+
continue loop1;
|
281330
|
+
}
|
281331
|
+
}
|
281332
|
+
return rd.length;
|
281333
|
+
}
|
281334
|
+
return 0;
|
281335
|
+
},
|
281336
|
+
__isEscape: function(buf, pos, chr) {
|
281337
|
+
const { escape: escape5 } = this.options;
|
281338
|
+
if (escape5 === null)
|
281339
|
+
return false;
|
281340
|
+
const l = escape5.length;
|
281341
|
+
if (escape5[0] === chr) {
|
281342
|
+
for (let i2 = 0; i2 < l; i2++) {
|
281343
|
+
if (escape5[i2] !== buf[pos + i2]) {
|
281344
|
+
return false;
|
281345
|
+
}
|
281346
|
+
}
|
281347
|
+
return true;
|
281348
|
+
}
|
281349
|
+
return false;
|
281350
|
+
},
|
281351
|
+
__isQuote: function(buf, pos) {
|
281352
|
+
const { quote } = this.options;
|
281353
|
+
if (quote === null)
|
281354
|
+
return false;
|
281355
|
+
const l = quote.length;
|
281356
|
+
for (let i2 = 0; i2 < l; i2++) {
|
281357
|
+
if (quote[i2] !== buf[pos + i2]) {
|
281358
|
+
return false;
|
281359
|
+
}
|
281360
|
+
}
|
281361
|
+
return true;
|
281362
|
+
},
|
281363
|
+
__autoDiscoverRecordDelimiter: function(buf, pos) {
|
281364
|
+
const { encoding } = this.options;
|
281365
|
+
const rds = [
|
281366
|
+
// Important, the windows line ending must be before mac os 9
|
281367
|
+
Buffer.from("\r\n", encoding),
|
281368
|
+
Buffer.from("\n", encoding),
|
281369
|
+
Buffer.from("\r", encoding)
|
281370
|
+
];
|
281371
|
+
loop:
|
281372
|
+
for (let i2 = 0; i2 < rds.length; i2++) {
|
281373
|
+
const l = rds[i2].length;
|
281374
|
+
for (let j = 0; j < l; j++) {
|
281375
|
+
if (rds[i2][j] !== buf[pos + j]) {
|
281376
|
+
continue loop;
|
281377
|
+
}
|
281378
|
+
}
|
281379
|
+
this.options.record_delimiter.push(rds[i2]);
|
281380
|
+
this.state.recordDelimiterMaxLength = rds[i2].length;
|
281381
|
+
return rds[i2].length;
|
281382
|
+
}
|
281383
|
+
return 0;
|
281384
|
+
},
|
281385
|
+
__error: function(msg) {
|
281386
|
+
const { encoding, raw: raw2, skip_records_with_error } = this.options;
|
281387
|
+
const err = typeof msg === "string" ? new Error(msg) : msg;
|
281388
|
+
if (skip_records_with_error) {
|
281389
|
+
this.state.recordHasError = true;
|
281390
|
+
if (this.options.on_skip !== void 0) {
|
281391
|
+
this.options.on_skip(err, raw2 ? this.state.rawBuffer.toString(encoding) : void 0);
|
281392
|
+
}
|
281393
|
+
return void 0;
|
281394
|
+
} else {
|
281395
|
+
return err;
|
281396
|
+
}
|
281397
|
+
},
|
281398
|
+
__infoDataSet: function() {
|
281399
|
+
return {
|
281400
|
+
...this.info,
|
281401
|
+
columns: this.options.columns
|
281402
|
+
};
|
281403
|
+
},
|
281404
|
+
__infoRecord: function() {
|
281405
|
+
const { columns, raw: raw2, encoding } = this.options;
|
281406
|
+
return {
|
281407
|
+
...this.__infoDataSet(),
|
281408
|
+
error: this.state.error,
|
281409
|
+
header: columns === true,
|
281410
|
+
index: this.state.record.length,
|
281411
|
+
raw: raw2 ? this.state.rawBuffer.toString(encoding) : void 0
|
281412
|
+
};
|
281413
|
+
},
|
281414
|
+
__infoField: function() {
|
281415
|
+
const { columns } = this.options;
|
281416
|
+
const isColumns = Array.isArray(columns);
|
281417
|
+
return {
|
281418
|
+
...this.__infoRecord(),
|
281419
|
+
column: isColumns === true ? columns.length > this.state.record.length ? columns[this.state.record.length].name : null : this.state.record.length,
|
281420
|
+
quoting: this.state.wasQuoting
|
281421
|
+
};
|
281422
|
+
}
|
281423
|
+
};
|
281424
|
+
};
|
281425
|
+
|
281426
|
+
// ../myst-directives/node_modules/csv-parse/lib/sync.js
|
281427
|
+
var parse9 = function(data, opts = {}) {
|
281428
|
+
if (typeof data === "string") {
|
281429
|
+
data = Buffer.from(data);
|
281430
|
+
}
|
281431
|
+
const records = opts && opts.objname ? {} : [];
|
281432
|
+
const parser3 = transform2(opts);
|
281433
|
+
const push = (record) => {
|
281434
|
+
if (parser3.options.objname === void 0)
|
281435
|
+
records.push(record);
|
281436
|
+
else {
|
281437
|
+
records[record[0]] = record[1];
|
281438
|
+
}
|
281439
|
+
};
|
281440
|
+
const close2 = () => {
|
281441
|
+
};
|
281442
|
+
const err1 = parser3.parse(data, false, push, close2);
|
281443
|
+
if (err1 !== void 0)
|
281444
|
+
throw err1;
|
281445
|
+
const err2 = parser3.parse(void 0, true, push, close2);
|
281446
|
+
if (err2 !== void 0)
|
281447
|
+
throw err2;
|
281448
|
+
return records;
|
281449
|
+
};
|
281450
|
+
|
280116
281451
|
// ../myst-directives/dist/table.js
|
280117
281452
|
var tableDirective = {
|
280118
281453
|
name: "table",
|
280119
281454
|
arg: {
|
280120
|
-
type: "myst"
|
281455
|
+
type: "myst",
|
281456
|
+
doc: "An optional table caption"
|
280121
281457
|
},
|
280122
281458
|
options: {
|
280123
281459
|
label: {
|
@@ -280165,7 +281501,8 @@ var tableDirective = {
|
|
280165
281501
|
var listTableDirective = {
|
280166
281502
|
name: "list-table",
|
280167
281503
|
arg: {
|
280168
|
-
type: "myst"
|
281504
|
+
type: "myst",
|
281505
|
+
doc: "An optional table caption"
|
280169
281506
|
},
|
280170
281507
|
options: {
|
280171
281508
|
label: {
|
@@ -280275,20 +281612,188 @@ var listTableDirective = {
|
|
280275
281612
|
return [container4];
|
280276
281613
|
}
|
280277
281614
|
};
|
281615
|
+
function parseCSV(data, ctx, opts) {
|
281616
|
+
var _a6, _b, _c;
|
281617
|
+
const delimiter2 = (_a6 = opts === null || opts === void 0 ? void 0 : opts.delim) !== null && _a6 !== void 0 ? _a6 : ",";
|
281618
|
+
const records = parse9(data, {
|
281619
|
+
delimiter: delimiter2 === "tab" ? " " : delimiter2 === "space" ? " " : delimiter2,
|
281620
|
+
ltrim: !(opts === null || opts === void 0 ? void 0 : opts.keepspace),
|
281621
|
+
escape: (_b = opts === null || opts === void 0 ? void 0 : opts.escape) !== null && _b !== void 0 ? _b : '"',
|
281622
|
+
quote: (_c = opts === null || opts === void 0 ? void 0 : opts.quote) !== null && _c !== void 0 ? _c : '"'
|
281623
|
+
});
|
281624
|
+
return records.map((record, recordIndex) => {
|
281625
|
+
return record.map((cell3) => {
|
281626
|
+
const mdast2 = ctx.parseMyst(cell3, recordIndex);
|
281627
|
+
const paragraph4 = select("*:root > paragraph:only-child", mdast2);
|
281628
|
+
if (paragraph4 === void 0) {
|
281629
|
+
throw new Error(`Expected a root element containing a paragraph, found: ${cell3}`);
|
281630
|
+
}
|
281631
|
+
return paragraph4;
|
281632
|
+
});
|
281633
|
+
});
|
281634
|
+
}
|
281635
|
+
var csvTableDirective = {
|
281636
|
+
name: "csv-table",
|
281637
|
+
doc: 'The "csv-table" directive is used to create a table from CSV (comma-separated values) data.',
|
281638
|
+
arg: {
|
281639
|
+
type: "myst",
|
281640
|
+
doc: "An optional table caption"
|
281641
|
+
},
|
281642
|
+
options: {
|
281643
|
+
label: {
|
281644
|
+
type: String,
|
281645
|
+
alias: ["name"]
|
281646
|
+
},
|
281647
|
+
// file: {
|
281648
|
+
// type: String,
|
281649
|
+
// doc: 'The local filesystem path to a CSV data file.',
|
281650
|
+
// alias: ['url'],
|
281651
|
+
// Add this to the description for the directive:
|
281652
|
+
// The data may be internal (an integral part of the document) or external (a separate file).
|
281653
|
+
// },
|
281654
|
+
header: {
|
281655
|
+
type: String,
|
281656
|
+
// nonnegative int
|
281657
|
+
doc: "Supplemental data for the table header, added independently of and before any header-rows from the main CSV data. Must use the same CSV format as the main CSV data."
|
281658
|
+
},
|
281659
|
+
"header-rows": {
|
281660
|
+
type: Number,
|
281661
|
+
// nonnegative int
|
281662
|
+
doc: "The number of rows of CSV data to use in the table header. Defaults to 0."
|
281663
|
+
},
|
281664
|
+
class: {
|
281665
|
+
type: String,
|
281666
|
+
// class_option: list of strings?
|
281667
|
+
doc: `CSS classes to add to your table. Special classes include:
|
281668
|
+
|
281669
|
+
- \`full-width\`: changes the table environment to cover two columns in LaTeX`
|
281670
|
+
},
|
281671
|
+
align: {
|
281672
|
+
type: String
|
281673
|
+
// choice(['left', 'center', 'right'])
|
281674
|
+
},
|
281675
|
+
delim: {
|
281676
|
+
type: String,
|
281677
|
+
doc: 'The character used to separate data fields. The special values "tab" and "space" are converted to the respective whitespace characters. Defaults to "," (comma)'
|
281678
|
+
},
|
281679
|
+
keepspace: {
|
281680
|
+
type: Boolean,
|
281681
|
+
doc: "Treat whitespace immediately following the delimiter as significant. The default is to ignore such whitespace."
|
281682
|
+
},
|
281683
|
+
quote: {
|
281684
|
+
type: String,
|
281685
|
+
doc: 'The character used to quote fields containing special characters, such as the delimiter, quotes, or new-line characters. Must be a single character, defaults to `"` (a double quote)\\\nFor example, `First cell, "These commas, for example, are escaped", Next cell`'
|
281686
|
+
},
|
281687
|
+
escape: {
|
281688
|
+
type: String,
|
281689
|
+
doc: 'A character used to escape the delimiter or quote characters from the CSV parser. Must be a single character, defaults to `"` (a double quote) default is a double quote\\\nFor example, `First cell, "These quotes"", for example, are escaped", Next cell`'
|
281690
|
+
}
|
281691
|
+
},
|
281692
|
+
body: {
|
281693
|
+
type: String,
|
281694
|
+
doc: "The CSV content",
|
281695
|
+
required: true
|
281696
|
+
},
|
281697
|
+
run(data, vfile2, ctx) {
|
281698
|
+
var _a6, _b, _c, _d2, _e, _f, _g, _h;
|
281699
|
+
const { label, identifier } = normalizeLabel((_a6 = data.options) === null || _a6 === void 0 ? void 0 : _a6.label) || {};
|
281700
|
+
const rows = [];
|
281701
|
+
if (((_b = data.options) === null || _b === void 0 ? void 0 : _b.header) !== void 0) {
|
281702
|
+
let headerCells = [];
|
281703
|
+
try {
|
281704
|
+
headerCells = parseCSV(data.options.header, ctx, data.options);
|
281705
|
+
} catch (error) {
|
281706
|
+
fileError(vfile2, "csv-table directive header must be valid CSV-formatted MyST", {
|
281707
|
+
node: (_c = select('mystDirectiveOption[name="header"]', data.node)) !== null && _c !== void 0 ? _c : data.node,
|
281708
|
+
ruleId: RuleId.directiveOptionsCorrect
|
281709
|
+
});
|
281710
|
+
}
|
281711
|
+
rows.push(...headerCells.map((parsedRow) => ({
|
281712
|
+
type: "tableRow",
|
281713
|
+
children: parsedRow.map((parsedCell) => ({
|
281714
|
+
type: "tableCell",
|
281715
|
+
header: true,
|
281716
|
+
children: parsedCell.children
|
281717
|
+
}))
|
281718
|
+
})));
|
281719
|
+
}
|
281720
|
+
let bodyCells = [];
|
281721
|
+
try {
|
281722
|
+
bodyCells = parseCSV(data.body, ctx, data.options);
|
281723
|
+
} catch (error) {
|
281724
|
+
fileError(vfile2, "csv-table directive body must be valid CSV-formatted MyST", {
|
281725
|
+
node: (_d2 = select("mystDirectiveBody", data.node)) !== null && _d2 !== void 0 ? _d2 : data.node,
|
281726
|
+
ruleId: RuleId.directiveBodyCorrect
|
281727
|
+
});
|
281728
|
+
}
|
281729
|
+
let headerCount = ((_e = data.options) === null || _e === void 0 ? void 0 : _e["header-rows"]) || 0;
|
281730
|
+
rows.push(...bodyCells.map((parsedRow) => {
|
281731
|
+
const row2 = {
|
281732
|
+
type: "tableRow",
|
281733
|
+
children: parsedRow.map((parsedCell) => ({
|
281734
|
+
type: "tableCell",
|
281735
|
+
header: headerCount > 0 ? true : void 0,
|
281736
|
+
children: parsedCell.children
|
281737
|
+
}))
|
281738
|
+
};
|
281739
|
+
headerCount -= 1;
|
281740
|
+
return row2;
|
281741
|
+
}));
|
281742
|
+
const table5 = {
|
281743
|
+
type: "table",
|
281744
|
+
align: (_f = data.options) === null || _f === void 0 ? void 0 : _f.align,
|
281745
|
+
children: rows
|
281746
|
+
};
|
281747
|
+
const container4 = {
|
281748
|
+
type: "container",
|
281749
|
+
kind: "table",
|
281750
|
+
identifier,
|
281751
|
+
label,
|
281752
|
+
class: (_g = data.options) === null || _g === void 0 ? void 0 : _g.class,
|
281753
|
+
children: [...(_h = data.arg) !== null && _h !== void 0 ? _h : [], table5]
|
281754
|
+
};
|
281755
|
+
return [container4];
|
281756
|
+
}
|
281757
|
+
};
|
280278
281758
|
|
280279
281759
|
// ../myst-directives/dist/aside.js
|
280280
281760
|
var asideDirective = {
|
280281
281761
|
name: "aside",
|
280282
|
-
alias: ["margin", "sidebar"],
|
281762
|
+
alias: ["margin", "sidebar", "topic"],
|
281763
|
+
arg: {
|
281764
|
+
type: "myst",
|
281765
|
+
doc: "An optional title"
|
281766
|
+
},
|
281767
|
+
options: {
|
281768
|
+
label: {
|
281769
|
+
type: String,
|
281770
|
+
alias: ["name"]
|
281771
|
+
},
|
281772
|
+
class: {
|
281773
|
+
type: String
|
281774
|
+
}
|
281775
|
+
},
|
280283
281776
|
body: {
|
280284
281777
|
type: "myst",
|
280285
281778
|
required: true
|
280286
281779
|
},
|
280287
281780
|
run(data) {
|
281781
|
+
var _a6, _b;
|
281782
|
+
const { label, identifier } = normalizeLabel((_a6 = data.options) === null || _a6 === void 0 ? void 0 : _a6.label) || {};
|
281783
|
+
const children = [...data.body];
|
281784
|
+
if (data.arg) {
|
281785
|
+
children.unshift({
|
281786
|
+
type: "admonitionTitle",
|
281787
|
+
children: data.arg
|
281788
|
+
});
|
281789
|
+
}
|
280288
281790
|
const aside = {
|
280289
281791
|
type: "aside",
|
280290
281792
|
kind: data.name == "aside" || data.name == "margin" ? void 0 : data.name,
|
280291
|
-
children
|
281793
|
+
children,
|
281794
|
+
class: (_b = data.options) === null || _b === void 0 ? void 0 : _b.class,
|
281795
|
+
label,
|
281796
|
+
identifier
|
280292
281797
|
};
|
280293
281798
|
return [aside];
|
280294
281799
|
}
|
@@ -280498,10 +282003,41 @@ var rawDirective = {
|
|
280498
282003
|
}
|
280499
282004
|
};
|
280500
282005
|
|
282006
|
+
// ../myst-directives/dist/div.js
|
282007
|
+
var divDirective = {
|
282008
|
+
name: "div",
|
282009
|
+
options: {
|
282010
|
+
label: {
|
282011
|
+
type: String,
|
282012
|
+
alias: ["name"]
|
282013
|
+
},
|
282014
|
+
class: {
|
282015
|
+
type: String
|
282016
|
+
}
|
282017
|
+
},
|
282018
|
+
body: {
|
282019
|
+
type: "myst",
|
282020
|
+
required: true
|
282021
|
+
},
|
282022
|
+
run(data) {
|
282023
|
+
var _a6, _b;
|
282024
|
+
const { label, identifier } = normalizeLabel((_a6 = data.options) === null || _a6 === void 0 ? void 0 : _a6.label) || {};
|
282025
|
+
const div2 = {
|
282026
|
+
type: "div",
|
282027
|
+
children: data.body,
|
282028
|
+
class: (_b = data.options) === null || _b === void 0 ? void 0 : _b.class,
|
282029
|
+
label,
|
282030
|
+
identifier
|
282031
|
+
};
|
282032
|
+
return [div2];
|
282033
|
+
}
|
282034
|
+
};
|
282035
|
+
|
280501
282036
|
// ../myst-directives/dist/index.js
|
280502
282037
|
var defaultDirectives = [
|
280503
282038
|
admonitionDirective,
|
280504
282039
|
bibliographyDirective,
|
282040
|
+
csvTableDirective,
|
280505
282041
|
codeDirective,
|
280506
282042
|
codeCellDirective,
|
280507
282043
|
dropdownDirective,
|
@@ -280520,7 +282056,8 @@ var defaultDirectives = [
|
|
280520
282056
|
mermaidDirective,
|
280521
282057
|
mystdemoDirective,
|
280522
282058
|
outputDirective,
|
280523
|
-
rawDirective
|
282059
|
+
rawDirective,
|
282060
|
+
divDirective
|
280524
282061
|
];
|
280525
282062
|
|
280526
282063
|
// ../myst-roles/dist/abbreviation.js
|
@@ -283400,6 +284937,12 @@ function splitChildrenOnBlockBreak(children) {
|
|
283400
284937
|
}
|
283401
284938
|
|
283402
284939
|
// ../myst-ext-grid/dist/index.js
|
284940
|
+
function getColumns(columnString) {
|
284941
|
+
const columns = (columnString !== null && columnString !== void 0 ? columnString : "1 2 2 3").split(/\s/).map((s5) => Number(s5.trim())).filter((n) => !Number.isNaN(n)).map((n) => Math.min(Math.max(Math.floor(n), 1), 12));
|
284942
|
+
if (columns.length === 0 || columns.length > 4)
|
284943
|
+
return [1, 2, 2, 3];
|
284944
|
+
return columns;
|
284945
|
+
}
|
283403
284946
|
var gridDirective = {
|
283404
284947
|
name: "grid",
|
283405
284948
|
arg: {
|
@@ -283428,12 +284971,35 @@ var gridDirective = {
|
|
283428
284971
|
];
|
283429
284972
|
}
|
283430
284973
|
};
|
283431
|
-
|
283432
|
-
|
283433
|
-
|
283434
|
-
|
283435
|
-
|
283436
|
-
|
284974
|
+
var gridItemDirective = {
|
284975
|
+
name: "grid-item",
|
284976
|
+
options: {
|
284977
|
+
label: {
|
284978
|
+
type: String,
|
284979
|
+
alias: ["name"]
|
284980
|
+
},
|
284981
|
+
class: {
|
284982
|
+
type: String
|
284983
|
+
}
|
284984
|
+
},
|
284985
|
+
body: {
|
284986
|
+
type: "myst",
|
284987
|
+
required: true
|
284988
|
+
},
|
284989
|
+
run(data) {
|
284990
|
+
var _a6, _b;
|
284991
|
+
const { label, identifier } = normalizeLabel((_a6 = data.options) === null || _a6 === void 0 ? void 0 : _a6.label) || {};
|
284992
|
+
const div2 = {
|
284993
|
+
type: "div",
|
284994
|
+
children: data.body,
|
284995
|
+
class: (_b = data.options) === null || _b === void 0 ? void 0 : _b.class,
|
284996
|
+
label,
|
284997
|
+
identifier
|
284998
|
+
};
|
284999
|
+
return [div2];
|
285000
|
+
}
|
285001
|
+
};
|
285002
|
+
var gridDirectives = [gridDirective, gridItemDirective];
|
283437
285003
|
|
283438
285004
|
// ../myst-ext-proof/dist/proof.js
|
283439
285005
|
var proofDirective = {
|
@@ -283746,7 +285312,7 @@ function parseMyst(session, content3, file, opts) {
|
|
283746
285312
|
markdownit: { linkify: true },
|
283747
285313
|
directives: [
|
283748
285314
|
cardDirective,
|
283749
|
-
|
285315
|
+
...gridDirectives,
|
283750
285316
|
reactiveDirective,
|
283751
285317
|
proofDirective,
|
283752
285318
|
...exerciseDirectives,
|
@@ -283773,7 +285339,7 @@ var import_node_path17 = __toESM(require("path"), 1);
|
|
283773
285339
|
var import_nbtx = __toESM(require_cjs2(), 1);
|
283774
285340
|
|
283775
285341
|
// ../myst-cli/dist/version.js
|
283776
|
-
var version2 = "1.1.
|
285342
|
+
var version2 = "1.1.55";
|
283777
285343
|
var version_default2 = version2;
|
283778
285344
|
|
283779
285345
|
// ../myst-cli/dist/utils/headers.js
|
@@ -284048,10 +285614,10 @@ function validateTOC(session, path42) {
|
|
284048
285614
|
}
|
284049
285615
|
|
284050
285616
|
// ../myst-cli/dist/utils/uniqueArray.js
|
284051
|
-
function uniqueArray(array,
|
284052
|
-
if (
|
284053
|
-
const transformedArray = array.map(
|
284054
|
-
return array.filter((v, i2) => transformedArray.indexOf(
|
285617
|
+
function uniqueArray(array, transform3) {
|
285618
|
+
if (transform3) {
|
285619
|
+
const transformedArray = array.map(transform3);
|
285620
|
+
return array.filter((v, i2) => transformedArray.indexOf(transform3(v)) === i2);
|
284055
285621
|
}
|
284056
285622
|
return array.filter((v, i2) => array.indexOf(v) === i2);
|
284057
285623
|
}
|
@@ -284819,8 +286385,8 @@ function transformRenderInlineExpressions(mdast2, file) {
|
|
284819
286385
|
|
284820
286386
|
// ../myst-cli/dist/process/notebook.js
|
284821
286387
|
function blockParent(cell3, children) {
|
284822
|
-
const
|
284823
|
-
return { type: "block", data:
|
286388
|
+
const kind = cell3.cell_type === import_nbtx2.CELL_TYPES.code ? NotebookCell.code : NotebookCell.content;
|
286389
|
+
return { type: "block", kind, data: JSON.parse(JSON.stringify(cell3.metadata)), children };
|
284824
286390
|
}
|
284825
286391
|
function replaceAttachmentsTransform(session, mdast2, attachments, file) {
|
284826
286392
|
const vfile2 = new VFile();
|
@@ -296337,7 +297903,7 @@ function applyComputedOutputsToNodes(nodes, computedResult) {
|
|
296337
297903
|
async function kernelExecutionTransform(tree, vfile2, opts) {
|
296338
297904
|
var _a6, _b, _c, _d2;
|
296339
297905
|
const log = (_a6 = opts.log) !== null && _a6 !== void 0 ? _a6 : console;
|
296340
|
-
const executableNodes = selectAll(
|
297906
|
+
const executableNodes = selectAll(`block[kind=${NotebookCell.code}],inlineExpression`, tree);
|
296341
297907
|
if (executableNodes.length === 0) {
|
296342
297908
|
return;
|
296343
297909
|
}
|
@@ -297123,8 +298689,8 @@ async function transformMdast(session, opts) {
|
|
297123
298689
|
if (cachedMdast)
|
297124
298690
|
cachedMdast.post = data;
|
297125
298691
|
if (extraTransforms) {
|
297126
|
-
await Promise.all(extraTransforms.map(async (
|
297127
|
-
await
|
298692
|
+
await Promise.all(extraTransforms.map(async (transform3) => {
|
298693
|
+
await transform3(session, opts);
|
297128
298694
|
}));
|
297129
298695
|
}
|
297130
298696
|
logMessagesFromVFile(session, vfile2);
|
@@ -297857,14 +299423,24 @@ function rewriteAssetsFolder(directory, baseurl) {
|
|
297857
299423
|
import_fs_extra.default.writeFileSync(file, modified);
|
297858
299424
|
});
|
297859
299425
|
}
|
297860
|
-
|
297861
|
-
|
297862
|
-
|
299426
|
+
function get_baseurl(session) {
|
299427
|
+
let baseurl;
|
299428
|
+
if (baseurl = process.env.BASE_URL) {
|
299429
|
+
session.log.info("BASE_URL environment overwrite is set");
|
299430
|
+
} else if (baseurl = process.env.READTHEDOCS_CANONICAL_URL) {
|
299431
|
+
baseurl = new URL(baseurl).pathname.replace(/\/$/, "");
|
299432
|
+
session.log.info(`Building inside a ReadTheDocs environment for ${process.env.READTHEDOCS_CANONICAL_URL}`);
|
299433
|
+
}
|
297863
299434
|
if (baseurl) {
|
297864
299435
|
session.log.info(`Building the site with a baseurl of "${baseurl}"`);
|
297865
299436
|
} else {
|
297866
299437
|
session.log.info('Building the base site.\nTo set a baseurl (e.g. GitHub pages) use "BASE_URL" environment variable.');
|
297867
299438
|
}
|
299439
|
+
return baseurl;
|
299440
|
+
}
|
299441
|
+
async function buildHtml(session, opts) {
|
299442
|
+
const template = await getMystTemplate(session, opts);
|
299443
|
+
const baseurl = get_baseurl(session);
|
297868
299444
|
const htmlDir = import_node_path42.default.join(session.buildPath(), "html");
|
297869
299445
|
import_fs_extra.default.rmSync(htmlDir, { recursive: true, force: true });
|
297870
299446
|
import_fs_extra.default.mkdirSync(htmlDir, { recursive: true });
|
@@ -298026,7 +299602,7 @@ function renderImports(kind, output2, imports, packages, preamble) {
|
|
298026
299602
|
}
|
298027
299603
|
|
298028
299604
|
// ../jtex/dist/version.js
|
298029
|
-
var version3 = "1.0.
|
299605
|
+
var version3 = "1.0.17";
|
298030
299606
|
var version_default3 = version3;
|
298031
299607
|
|
298032
299608
|
// ../jtex/dist/jtex.js
|
@@ -298619,8 +300195,8 @@ function stringToLatexText(text7) {
|
|
298619
300195
|
function stringToLatexMath(text7) {
|
298620
300196
|
const replaced = Array.from(text7 !== null && text7 !== void 0 ? text7 : "").reduce((s5, char) => {
|
298621
300197
|
if (mathReplacements[char]) {
|
298622
|
-
const
|
298623
|
-
return `${s5}${
|
300198
|
+
const space3 = s5.slice(-1) === " " ? "" : " ";
|
300199
|
+
return `${s5}${space3}${mathReplacements[char]}`;
|
298624
300200
|
}
|
298625
300201
|
return s5 + char;
|
298626
300202
|
}, "");
|
@@ -299067,14 +300643,15 @@ var handlers3 = {
|
|
299067
300643
|
state.closeBlock(node3);
|
299068
300644
|
},
|
299069
300645
|
block(node3, state) {
|
299070
|
-
var _a6, _b
|
300646
|
+
var _a6, _b;
|
300647
|
+
const metadataTags = getMetadataTags(node3);
|
299071
300648
|
if (state.options.beamer) {
|
299072
|
-
if ((
|
300649
|
+
if (metadataTags.includes("outline")) {
|
299073
300650
|
state.data.nextHeadingIsFrameTitle = false;
|
299074
300651
|
state.renderChildren(node3, false);
|
299075
300652
|
return;
|
299076
300653
|
}
|
299077
|
-
if (((
|
300654
|
+
if (((_b = (_a6 = node3.children) === null || _a6 === void 0 ? void 0 : _a6[0]) === null || _b === void 0 ? void 0 : _b.type) === "heading") {
|
299078
300655
|
state.data.nextHeadingIsFrameTitle = true;
|
299079
300656
|
}
|
299080
300657
|
state.write("\n\n\\begin{frame}\n");
|
@@ -299084,8 +300661,15 @@ var handlers3 = {
|
|
299084
300661
|
}
|
299085
300662
|
if (node3.visibility === "remove")
|
299086
300663
|
return;
|
299087
|
-
if (
|
300664
|
+
if (metadataTags.includes("no-tex"))
|
300665
|
+
return;
|
300666
|
+
if (metadataTags.includes("no-pdf"))
|
299088
300667
|
return;
|
300668
|
+
if (metadataTags.includes("new-page")) {
|
300669
|
+
state.write("\\newpage\n");
|
300670
|
+
} else if (metadataTags.includes("page-break")) {
|
300671
|
+
state.write("\\pagebreak\n");
|
300672
|
+
}
|
299089
300673
|
state.renderChildren(node3, false);
|
299090
300674
|
},
|
299091
300675
|
blockquote(node3, state) {
|
@@ -300108,8 +301692,8 @@ function stringToTypstText(text7) {
|
|
300108
301692
|
function stringToTypstMath(text7) {
|
300109
301693
|
const replaced = Array.from(text7 !== null && text7 !== void 0 ? text7 : "").reduce((s5, char) => {
|
300110
301694
|
if (mathReplacements2[char]) {
|
300111
|
-
const
|
300112
|
-
return `${s5}${
|
301695
|
+
const space3 = s5.slice(-1) === " " ? "" : " ";
|
301696
|
+
return `${s5}${space3}${mathReplacements2[char]}`;
|
300113
301697
|
}
|
300114
301698
|
return s5 + char;
|
300115
301699
|
}, "");
|
@@ -300637,8 +302221,16 @@ var handlers4 = {
|
|
300637
302221
|
state.write("\n\n");
|
300638
302222
|
},
|
300639
302223
|
block(node3, state) {
|
302224
|
+
const metadataTags = getMetadataTags(node3);
|
302225
|
+
if (metadataTags.includes("no-typst"))
|
302226
|
+
return;
|
302227
|
+
if (metadataTags.includes("no-pdf"))
|
302228
|
+
return;
|
300640
302229
|
if (node3.visibility === "remove")
|
300641
302230
|
return;
|
302231
|
+
if (metadataTags.includes("page-break") || metadataTags.includes("new-page")) {
|
302232
|
+
state.write("#pagebreak(weak: true)\n");
|
302233
|
+
}
|
300642
302234
|
state.renderChildren(node3, 2);
|
300643
302235
|
},
|
300644
302236
|
blockquote(node3, state) {
|
@@ -301404,6 +302996,10 @@ var paragraph2 = (state, node3) => {
|
|
301404
302996
|
var block3 = (state, node3) => {
|
301405
302997
|
if (node3.visibility === "remove")
|
301406
302998
|
return;
|
302999
|
+
const metadataTags = getMetadataTags(node3);
|
303000
|
+
if (metadataTags.includes("page-break") || metadataTags.includes("new-page")) {
|
303001
|
+
state.current.push(new import_docx3.PageBreak());
|
303002
|
+
}
|
301407
303003
|
state.renderChildren(node3);
|
301408
303004
|
};
|
301409
303005
|
var heading4 = (state, node3) => {
|
@@ -303343,8 +304939,8 @@ function tableTransform(mdast2) {
|
|
303343
304939
|
// ../myst-to-jats/dist/transforms/sections.js
|
303344
304940
|
function sectionAttrsFromBlock(node3) {
|
303345
304941
|
const output2 = {};
|
303346
|
-
if (node3.
|
303347
|
-
const blockType = node3.
|
304942
|
+
if (node3.kind) {
|
304943
|
+
const blockType = node3.kind;
|
303348
304944
|
if (Object.values(NotebookCell).includes(blockType)) {
|
303349
304945
|
output2["sec-type"] = blockType;
|
303350
304946
|
}
|
@@ -312635,18 +314231,30 @@ async function init(session, opts) {
|
|
312635
314231
|
// ../myst-cli/dist/plugins.js
|
312636
314232
|
var import_node_fs42 = __toESM(require("fs"), 1);
|
312637
314233
|
async function loadPlugins(session) {
|
312638
|
-
|
312639
|
-
const
|
314234
|
+
let configPlugins = [];
|
314235
|
+
const state = session.store.getState();
|
314236
|
+
const projConfig = selectors_exports.selectCurrentProjectConfig(state);
|
314237
|
+
if (projConfig === null || projConfig === void 0 ? void 0 : projConfig.plugins)
|
314238
|
+
configPlugins.push(...projConfig.plugins);
|
314239
|
+
const siteConfig = selectors_exports.selectCurrentSiteConfig(state);
|
314240
|
+
if (siteConfig === null || siteConfig === void 0 ? void 0 : siteConfig.projects) {
|
314241
|
+
siteConfig.projects.filter((project) => !!project.path).forEach((project) => {
|
314242
|
+
const siteProjConfig = selectors_exports.selectLocalProjectConfig(state, project.path);
|
314243
|
+
if (siteProjConfig === null || siteProjConfig === void 0 ? void 0 : siteProjConfig.plugins)
|
314244
|
+
configPlugins.push(...siteProjConfig.plugins);
|
314245
|
+
});
|
314246
|
+
}
|
314247
|
+
configPlugins = [...new Set(configPlugins)];
|
312640
314248
|
const plugins2 = {
|
312641
314249
|
directives: [],
|
312642
314250
|
roles: [],
|
312643
314251
|
transforms: []
|
312644
314252
|
};
|
312645
|
-
if (
|
314253
|
+
if (configPlugins.length === 0) {
|
312646
314254
|
return plugins2;
|
312647
314255
|
}
|
312648
|
-
session.log.debug(`Loading plugins: "${
|
312649
|
-
const modules = await Promise.all(
|
314256
|
+
session.log.debug(`Loading plugins: "${configPlugins.join('", "')}"`);
|
314257
|
+
const modules = await Promise.all(configPlugins.map(async (filename) => {
|
312650
314258
|
if (!import_node_fs42.default.statSync(filename).isFile || !filename.endsWith(".mjs")) {
|
312651
314259
|
addWarningForFile(session, filename, `Unknown plugin "${filename}", it must be an mjs file`, "error", {
|
312652
314260
|
ruleId: RuleId.pluginLoads
|
@@ -312670,14 +314278,14 @@ ${error === null || error === void 0 ? void 0 : error.stack}
|
|
312670
314278
|
return { filename, module: module2 };
|
312671
314279
|
}));
|
312672
314280
|
modules.forEach((pluginLoader) => {
|
312673
|
-
var
|
314281
|
+
var _a6;
|
312674
314282
|
if (!pluginLoader)
|
312675
314283
|
return;
|
312676
314284
|
const plugin5 = pluginLoader.module.default || pluginLoader.module.plugin;
|
312677
314285
|
const directives = plugin5.directives || pluginLoader.module.directives;
|
312678
314286
|
const roles = plugin5.roles || pluginLoader.module.roles;
|
312679
314287
|
const transforms = plugin5.transforms || pluginLoader.module.transforms;
|
312680
|
-
session.log.info(`\u{1F50C} ${(
|
314288
|
+
session.log.info(`\u{1F50C} ${(_a6 = plugin5 === null || plugin5 === void 0 ? void 0 : plugin5.name) !== null && _a6 !== void 0 ? _a6 : "Unnamed Plugin"} (${pluginLoader.filename}) loaded: ${plural("%s directive(s)", directives)}, ${plural("%s role(s)", roles)}, ${plural("%s transform(s)", transforms)}`);
|
312681
314289
|
if (directives) {
|
312682
314290
|
plugins2.directives.push(...directives);
|
312683
314291
|
}
|