@ncukondo/reference-manager 0.30.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{SearchableMultiSelect-CpCrb-G1.js → SearchableMultiSelect-BFgiGVkF.js} +2 -2
- package/dist/chunks/{SearchableMultiSelect-CpCrb-G1.js.map → SearchableMultiSelect-BFgiGVkF.js.map} +1 -1
- package/dist/chunks/{action-menu-DwHspdjM.js → action-menu-D5s90TfM.js} +3 -3
- package/dist/chunks/{action-menu-DwHspdjM.js.map → action-menu-D5s90TfM.js.map} +1 -1
- package/dist/chunks/{checker-DhHnmgq0.js → checker-DMyZFCaP.js} +4 -4
- package/dist/chunks/{checker-DhHnmgq0.js.map → checker-DMyZFCaP.js.map} +1 -1
- package/dist/chunks/{crossref-client-DG4AA_Ax.js → crossref-client-CaFCAASM.js} +2 -2
- package/dist/chunks/{crossref-client-DG4AA_Ax.js.map → crossref-client-CaFCAASM.js.map} +1 -1
- package/dist/chunks/{fix-interaction-CIstlQZN.js → fix-interaction-h15RI_Ae.js} +5 -5
- package/dist/chunks/{fix-interaction-CIstlQZN.js.map → fix-interaction-h15RI_Ae.js.map} +1 -1
- package/dist/chunks/{index-AvQ2XqcY.js → index-BG3Ef4Pd.js} +4 -4
- package/dist/chunks/{index-AvQ2XqcY.js.map → index-BG3Ef4Pd.js.map} +1 -1
- package/dist/chunks/{index-DoOmAYKd.js → index-CS8S6gE4.js} +459 -363
- package/dist/chunks/{index-DoOmAYKd.js.map → index-CS8S6gE4.js.map} +1 -1
- package/dist/chunks/{index-4KRTx7Fg.js → index-Cqss7VR_.js} +3 -3
- package/dist/chunks/index-Cqss7VR_.js.map +1 -0
- package/dist/chunks/{index-C7BVI2qL.js → index-DCBYzNj-.js} +644 -263
- package/dist/chunks/index-DCBYzNj-.js.map +1 -0
- package/dist/chunks/{loader-6TuXzBbw.js → loader-BG2eomDC.js} +52 -3
- package/dist/chunks/loader-BG2eomDC.js.map +1 -0
- package/dist/chunks/{pubmed-client-CyaNS4Y1.js → pubmed-client-vbreWUxK.js} +2 -2
- package/dist/chunks/{pubmed-client-CyaNS4Y1.js.map → pubmed-client-vbreWUxK.js.map} +1 -1
- package/dist/chunks/{reference-select-CES2SpzK.js → reference-select-CNWexQGu.js} +3 -3
- package/dist/chunks/{reference-select-CES2SpzK.js.map → reference-select-CNWexQGu.js.map} +1 -1
- package/dist/chunks/{style-select-DrECo2bW.js → style-select-D8beMum_.js} +3 -3
- package/dist/chunks/{style-select-DrECo2bW.js.map → style-select-D8beMum_.js.map} +1 -1
- package/dist/cli/commands/show.d.ts +16 -0
- package/dist/cli/commands/show.d.ts.map +1 -0
- package/dist/cli/help/convert-help.d.ts +6 -0
- package/dist/cli/help/convert-help.d.ts.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/config/key-parser.d.ts +2 -0
- package/dist/config/key-parser.d.ts.map +1 -1
- package/dist/config/schema.d.ts +10 -3
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/features/format/show-normalizer.d.ts +43 -0
- package/dist/features/format/show-normalizer.d.ts.map +1 -0
- package/dist/features/format/show-pretty.d.ts +8 -0
- package/dist/features/format/show-pretty.d.ts.map +1 -0
- package/dist/features/import/fetcher.d.ts +2 -1
- package/dist/features/import/fetcher.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/tools/index.d.ts.map +1 -1
- package/dist/mcp/tools/show.d.ts +23 -0
- package/dist/mcp/tools/show.d.ts.map +1 -0
- package/dist/server.js +3 -3
- package/package.json +1 -1
- package/dist/chunks/index-4KRTx7Fg.js.map +0 -1
- package/dist/chunks/index-C7BVI2qL.js.map +0 -1
- package/dist/chunks/loader-6TuXzBbw.js.map +0 -1
|
@@ -2,7 +2,7 @@ import { Hono } from "hono";
|
|
|
2
2
|
import { h as CslItemSchema, g as detectDuplicate, m as generateId, a as sortOrderSchema, b as sortFieldSchema, p as pickDefined, t as tokenize, s as search$1, f as sortResults, y as searchSortFieldSchema, L as Library, F as FileWatcher } from "./file-watcher-CWHg1yol.js";
|
|
3
3
|
import * as fs from "node:fs";
|
|
4
4
|
import { mkdtempSync, writeFileSync, existsSync, readFileSync } from "node:fs";
|
|
5
|
-
import { Cite, plugins } from "@citation-js/core";
|
|
5
|
+
import { Cite, plugins, util } from "@citation-js/core";
|
|
6
6
|
import "@citation-js/plugin-doi";
|
|
7
7
|
import "@citation-js/plugin-isbn";
|
|
8
8
|
import "@citation-js/plugin-bibtex";
|
|
@@ -15,6 +15,45 @@ import fs__default, { stat, rename, copyFile, unlink, rm, readFile, mkdir, write
|
|
|
15
15
|
import { tmpdir } from "node:os";
|
|
16
16
|
import { exec, execFile } from "node:child_process";
|
|
17
17
|
import "node:crypto";
|
|
18
|
+
const name = "@ncukondo/reference-manager";
|
|
19
|
+
const version = "0.31.0";
|
|
20
|
+
const description = "A local reference management tool using CSL-JSON as the single source of truth";
|
|
21
|
+
const publishConfig = { "access": "public" };
|
|
22
|
+
const type$1 = "module";
|
|
23
|
+
const engines = { "node": ">=22" };
|
|
24
|
+
const bin = { "ref": "./bin/cli.js", "reference-manager": "./bin/cli.js" };
|
|
25
|
+
const main = "./dist/index.js";
|
|
26
|
+
const types = "./dist/index.d.ts";
|
|
27
|
+
const exports$1 = { ".": { "import": "./dist/index.js", "types": "./dist/index.d.ts" } };
|
|
28
|
+
const files = ["dist", "bin"];
|
|
29
|
+
const scripts = { "dev": "vite", "build": "vite build && tsc --emitDeclarationOnly", "preview": "vite preview", "test": "vitest --project unit", "test:unit": "vitest --project unit", "test:e2e": "vitest run --project e2e", "test:remote": "vitest --project remote", "test:all": "vitest --project unit && vitest --project e2e && vitest --project remote", "test:watch": "vitest --watch --project unit", "test:coverage": "vitest run --coverage --project unit", "lint": "biome check .", "lint:fix": "biome check --write .", "format": "biome format --write .", "typecheck": "tsc --noEmit", "check:paths": "! grep -rn --include='*.ts' --exclude='*.test.ts' --exclude='*.d.ts' --exclude='path.ts' '\\.replace(/\\\\\\\\' src/ 2>/dev/null", "check:no-process-exit": "! grep -rn --include='*.ts' --exclude='*.test.ts' 'process\\.exit(' src/cli/ 2>/dev/null | grep -v 'helpers.ts' | grep -v '// '", "prepublishOnly": "npm run build", "prepare": "husky || true" };
|
|
30
|
+
const dependencies = { "@citation-js/core": "^0.7.16", "@citation-js/plugin-bibtex": "^0.7.21", "@citation-js/plugin-csl": "^0.7.16", "@citation-js/plugin-doi": "^0.7.21", "@citation-js/plugin-isbn": "^0.4.0", "@citation-js/plugin-ris": "^0.7.21", "@iarna/toml": "^2.2.5", "@modelcontextprotocol/sdk": "^1.25.1", "@ncukondo/academic-fulltext": "^0.2.6", "chokidar": "^5.0.0", "commander": "^12.1.0", "env-paths": "^3.0.0", "hono": "^4.11.1", "ink": "^6.6.0", "ink-ui": "^0.4.0", "js-yaml": "^4.1.1", "react": "^19.2.3", "tabtab": "^3.0.2", "write-file-atomic": "^7.0.0", "yaml": "^2.8.2", "zod": "^4.1.13" };
|
|
31
|
+
const devDependencies = { "@biomejs/biome": "^1.9.0", "@hono/node-server": "^1.19.7", "@types/chokidar": "^1.7.5", "@types/js-yaml": "^4.0.9", "@types/node": "^22.19.2", "@types/react": "^19.2.9", "@types/tabtab": "^3.0.4", "@types/write-file-atomic": "^4.0.3", "@vitest/coverage-v8": "^2.1.9", "husky": "^9.1.7", "lint-staged": "^16.2.7", "react-devtools-core": "^6.1.5", "typescript": "^5.6.0", "vite": "^6.0.0", "vite-node": "^2.1.0", "vitest": "^2.1.0" };
|
|
32
|
+
const keywords = ["reference-manager", "csl-json", "bibliography", "pandoc", "citation"];
|
|
33
|
+
const author = "";
|
|
34
|
+
const license = "MIT";
|
|
35
|
+
const repository = { "type": "git", "url": "https://github.com/ncukondo/reference-manager.git" };
|
|
36
|
+
const packageJson = {
|
|
37
|
+
name,
|
|
38
|
+
version,
|
|
39
|
+
description,
|
|
40
|
+
publishConfig,
|
|
41
|
+
type: type$1,
|
|
42
|
+
engines,
|
|
43
|
+
bin,
|
|
44
|
+
main,
|
|
45
|
+
types,
|
|
46
|
+
exports: exports$1,
|
|
47
|
+
files,
|
|
48
|
+
scripts,
|
|
49
|
+
dependencies,
|
|
50
|
+
devDependencies,
|
|
51
|
+
keywords,
|
|
52
|
+
author,
|
|
53
|
+
license,
|
|
54
|
+
repository,
|
|
55
|
+
"lint-staged": { "*.{ts,tsx,js,jsx}": ["biome check --write"] }
|
|
56
|
+
};
|
|
18
57
|
function slugifyLabel(label) {
|
|
19
58
|
return label.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
20
59
|
}
|
|
@@ -61,8 +100,8 @@ function getExtension(filename) {
|
|
|
61
100
|
const ext = path__default.extname(filename);
|
|
62
101
|
return ext.startsWith(".") ? ext.slice(1).toLowerCase() : ext.toLowerCase();
|
|
63
102
|
}
|
|
64
|
-
function isValidFulltextFiles(
|
|
65
|
-
const fulltextFiles =
|
|
103
|
+
function isValidFulltextFiles(files2) {
|
|
104
|
+
const fulltextFiles = files2.filter((f) => f.role === "fulltext");
|
|
66
105
|
if (fulltextFiles.length > 2) {
|
|
67
106
|
return false;
|
|
68
107
|
}
|
|
@@ -114,8 +153,8 @@ async function ensureDirectory(ref, baseDir) {
|
|
|
114
153
|
}
|
|
115
154
|
async function deleteDirectoryIfEmpty(dirPath) {
|
|
116
155
|
try {
|
|
117
|
-
const
|
|
118
|
-
if (
|
|
156
|
+
const files2 = await fs__default.readdir(dirPath);
|
|
157
|
+
if (files2.length === 0) {
|
|
119
158
|
await fs__default.rmdir(dirPath);
|
|
120
159
|
}
|
|
121
160
|
} catch (error) {
|
|
@@ -150,8 +189,8 @@ function validateFulltextConstraint(existingFiles, newFile) {
|
|
|
150
189
|
}
|
|
151
190
|
return null;
|
|
152
191
|
}
|
|
153
|
-
function findExistingFile(
|
|
154
|
-
return
|
|
192
|
+
function findExistingFile(files2, filename) {
|
|
193
|
+
return files2.find((f) => f.filename === filename);
|
|
155
194
|
}
|
|
156
195
|
async function copyOrMoveFile(sourcePath, destPath, move) {
|
|
157
196
|
try {
|
|
@@ -705,8 +744,8 @@ async function checkPmc(ids, options) {
|
|
|
705
744
|
}
|
|
706
745
|
const UNPAYWALL_BASE_URL = "https://api.unpaywall.org/v2";
|
|
707
746
|
const PMC_URL_PATTERN = /\/pmc\/articles\/(PMC\d+)/i;
|
|
708
|
-
function mapVersion(
|
|
709
|
-
switch (
|
|
747
|
+
function mapVersion(version2) {
|
|
748
|
+
switch (version2) {
|
|
710
749
|
case "publishedVersion":
|
|
711
750
|
return "published";
|
|
712
751
|
case "acceptedVersion":
|
|
@@ -1114,9 +1153,9 @@ var hasRequiredHe;
|
|
|
1114
1153
|
function requireHe() {
|
|
1115
1154
|
if (hasRequiredHe) return he$1.exports;
|
|
1116
1155
|
hasRequiredHe = 1;
|
|
1117
|
-
(function(module, exports$
|
|
1156
|
+
(function(module, exports$12) {
|
|
1118
1157
|
(function(root) {
|
|
1119
|
-
var freeExports = exports$
|
|
1158
|
+
var freeExports = exports$12;
|
|
1120
1159
|
var freeModule = module && module.exports == freeExports && module;
|
|
1121
1160
|
var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal;
|
|
1122
1161
|
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
|
|
@@ -1460,9 +1499,9 @@ var hasRequiredLib$6;
|
|
|
1460
1499
|
function requireLib$6() {
|
|
1461
1500
|
if (hasRequiredLib$6) return lib$3;
|
|
1462
1501
|
hasRequiredLib$6 = 1;
|
|
1463
|
-
(function(exports$
|
|
1464
|
-
Object.defineProperty(exports$
|
|
1465
|
-
exports$
|
|
1502
|
+
(function(exports$12) {
|
|
1503
|
+
Object.defineProperty(exports$12, "__esModule", { value: true });
|
|
1504
|
+
exports$12.Doctype = exports$12.CDATA = exports$12.Tag = exports$12.Style = exports$12.Script = exports$12.Comment = exports$12.Directive = exports$12.Text = exports$12.Root = exports$12.isTag = exports$12.ElementType = void 0;
|
|
1466
1505
|
var ElementType;
|
|
1467
1506
|
(function(ElementType2) {
|
|
1468
1507
|
ElementType2["Root"] = "root";
|
|
@@ -1474,20 +1513,20 @@ function requireLib$6() {
|
|
|
1474
1513
|
ElementType2["Tag"] = "tag";
|
|
1475
1514
|
ElementType2["CDATA"] = "cdata";
|
|
1476
1515
|
ElementType2["Doctype"] = "doctype";
|
|
1477
|
-
})(ElementType = exports$
|
|
1516
|
+
})(ElementType = exports$12.ElementType || (exports$12.ElementType = {}));
|
|
1478
1517
|
function isTag(elem) {
|
|
1479
1518
|
return elem.type === ElementType.Tag || elem.type === ElementType.Script || elem.type === ElementType.Style;
|
|
1480
1519
|
}
|
|
1481
|
-
exports$
|
|
1482
|
-
exports$
|
|
1483
|
-
exports$
|
|
1484
|
-
exports$
|
|
1485
|
-
exports$
|
|
1486
|
-
exports$
|
|
1487
|
-
exports$
|
|
1488
|
-
exports$
|
|
1489
|
-
exports$
|
|
1490
|
-
exports$
|
|
1520
|
+
exports$12.isTag = isTag;
|
|
1521
|
+
exports$12.Root = ElementType.Root;
|
|
1522
|
+
exports$12.Text = ElementType.Text;
|
|
1523
|
+
exports$12.Directive = ElementType.Directive;
|
|
1524
|
+
exports$12.Comment = ElementType.Comment;
|
|
1525
|
+
exports$12.Script = ElementType.Script;
|
|
1526
|
+
exports$12.Style = ElementType.Style;
|
|
1527
|
+
exports$12.Tag = ElementType.Tag;
|
|
1528
|
+
exports$12.CDATA = ElementType.CDATA;
|
|
1529
|
+
exports$12.Doctype = ElementType.Doctype;
|
|
1491
1530
|
})(lib$3);
|
|
1492
1531
|
return lib$3;
|
|
1493
1532
|
}
|
|
@@ -1663,9 +1702,9 @@ function requireNode() {
|
|
|
1663
1702
|
/** @class */
|
|
1664
1703
|
(function(_super) {
|
|
1665
1704
|
__extends(ProcessingInstruction2, _super);
|
|
1666
|
-
function ProcessingInstruction2(
|
|
1705
|
+
function ProcessingInstruction2(name2, data) {
|
|
1667
1706
|
var _this = _super.call(this, data) || this;
|
|
1668
|
-
_this.name =
|
|
1707
|
+
_this.name = name2;
|
|
1669
1708
|
_this.type = domelementtype_1.ElementType.Directive;
|
|
1670
1709
|
return _this;
|
|
1671
1710
|
}
|
|
@@ -1769,15 +1808,15 @@ function requireNode() {
|
|
|
1769
1808
|
/** @class */
|
|
1770
1809
|
(function(_super) {
|
|
1771
1810
|
__extends(Element2, _super);
|
|
1772
|
-
function Element2(
|
|
1811
|
+
function Element2(name2, attribs, children, type2) {
|
|
1773
1812
|
if (children === void 0) {
|
|
1774
1813
|
children = [];
|
|
1775
1814
|
}
|
|
1776
1815
|
if (type2 === void 0) {
|
|
1777
|
-
type2 =
|
|
1816
|
+
type2 = name2 === "script" ? domelementtype_1.ElementType.Script : name2 === "style" ? domelementtype_1.ElementType.Style : domelementtype_1.ElementType.Tag;
|
|
1778
1817
|
}
|
|
1779
1818
|
var _this = _super.call(this, children) || this;
|
|
1780
|
-
_this.name =
|
|
1819
|
+
_this.name = name2;
|
|
1781
1820
|
_this.attribs = attribs;
|
|
1782
1821
|
_this.type = type2;
|
|
1783
1822
|
return _this;
|
|
@@ -1798,8 +1837,8 @@ function requireNode() {
|
|
|
1798
1837
|
get: function() {
|
|
1799
1838
|
return this.name;
|
|
1800
1839
|
},
|
|
1801
|
-
set: function(
|
|
1802
|
-
this.name =
|
|
1840
|
+
set: function(name2) {
|
|
1841
|
+
this.name = name2;
|
|
1803
1842
|
},
|
|
1804
1843
|
enumerable: false,
|
|
1805
1844
|
configurable: true
|
|
@@ -1807,13 +1846,13 @@ function requireNode() {
|
|
|
1807
1846
|
Object.defineProperty(Element2.prototype, "attributes", {
|
|
1808
1847
|
get: function() {
|
|
1809
1848
|
var _this = this;
|
|
1810
|
-
return Object.keys(this.attribs).map(function(
|
|
1849
|
+
return Object.keys(this.attribs).map(function(name2) {
|
|
1811
1850
|
var _a, _b;
|
|
1812
1851
|
return {
|
|
1813
|
-
name,
|
|
1814
|
-
value: _this.attribs[
|
|
1815
|
-
namespace: (_a = _this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[
|
|
1816
|
-
prefix: (_b = _this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[
|
|
1852
|
+
name: name2,
|
|
1853
|
+
value: _this.attribs[name2],
|
|
1854
|
+
namespace: (_a = _this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[name2],
|
|
1855
|
+
prefix: (_b = _this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name2]
|
|
1817
1856
|
};
|
|
1818
1857
|
});
|
|
1819
1858
|
},
|
|
@@ -1929,7 +1968,7 @@ var hasRequiredLib$5;
|
|
|
1929
1968
|
function requireLib$5() {
|
|
1930
1969
|
if (hasRequiredLib$5) return lib$4;
|
|
1931
1970
|
hasRequiredLib$5 = 1;
|
|
1932
|
-
(function(exports$
|
|
1971
|
+
(function(exports$12) {
|
|
1933
1972
|
var __createBinding = lib$4 && lib$4.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
1934
1973
|
if (k2 === void 0) k2 = k;
|
|
1935
1974
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -1943,14 +1982,14 @@ function requireLib$5() {
|
|
|
1943
1982
|
if (k2 === void 0) k2 = k;
|
|
1944
1983
|
o[k2] = m[k];
|
|
1945
1984
|
}));
|
|
1946
|
-
var __exportStar = lib$4 && lib$4.__exportStar || function(m, exports$
|
|
1947
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$
|
|
1985
|
+
var __exportStar = lib$4 && lib$4.__exportStar || function(m, exports$13) {
|
|
1986
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$13, p)) __createBinding(exports$13, m, p);
|
|
1948
1987
|
};
|
|
1949
|
-
Object.defineProperty(exports$
|
|
1950
|
-
exports$
|
|
1988
|
+
Object.defineProperty(exports$12, "__esModule", { value: true });
|
|
1989
|
+
exports$12.DomHandler = void 0;
|
|
1951
1990
|
var domelementtype_1 = /* @__PURE__ */ requireLib$6();
|
|
1952
1991
|
var node_js_1 = /* @__PURE__ */ requireNode();
|
|
1953
|
-
__exportStar(/* @__PURE__ */ requireNode(), exports$
|
|
1992
|
+
__exportStar(/* @__PURE__ */ requireNode(), exports$12);
|
|
1954
1993
|
var defaultOpts = {
|
|
1955
1994
|
withStartIndices: false,
|
|
1956
1995
|
withEndIndices: false,
|
|
@@ -2008,9 +2047,9 @@ function requireLib$5() {
|
|
|
2008
2047
|
if (this.elementCB)
|
|
2009
2048
|
this.elementCB(elem);
|
|
2010
2049
|
};
|
|
2011
|
-
DomHandler2.prototype.onopentag = function(
|
|
2050
|
+
DomHandler2.prototype.onopentag = function(name2, attribs) {
|
|
2012
2051
|
var type2 = this.options.xmlMode ? domelementtype_1.ElementType.Tag : void 0;
|
|
2013
|
-
var element = new node_js_1.Element(
|
|
2052
|
+
var element = new node_js_1.Element(name2, attribs, void 0, type2);
|
|
2014
2053
|
this.addNode(element);
|
|
2015
2054
|
this.tagStack.push(element);
|
|
2016
2055
|
};
|
|
@@ -2049,8 +2088,8 @@ function requireLib$5() {
|
|
|
2049
2088
|
DomHandler2.prototype.oncdataend = function() {
|
|
2050
2089
|
this.lastNode = null;
|
|
2051
2090
|
};
|
|
2052
|
-
DomHandler2.prototype.onprocessinginstruction = function(
|
|
2053
|
-
var node2 = new node_js_1.ProcessingInstruction(
|
|
2091
|
+
DomHandler2.prototype.onprocessinginstruction = function(name2, data) {
|
|
2092
|
+
var node2 = new node_js_1.ProcessingInstruction(name2, data);
|
|
2054
2093
|
this.addNode(node2);
|
|
2055
2094
|
};
|
|
2056
2095
|
DomHandler2.prototype.handleCallback = function(error) {
|
|
@@ -2080,8 +2119,8 @@ function requireLib$5() {
|
|
|
2080
2119
|
return DomHandler2;
|
|
2081
2120
|
})()
|
|
2082
2121
|
);
|
|
2083
|
-
exports$
|
|
2084
|
-
exports$
|
|
2122
|
+
exports$12.DomHandler = DomHandler;
|
|
2123
|
+
exports$12.default = DomHandler;
|
|
2085
2124
|
})(lib$4);
|
|
2086
2125
|
return lib$4;
|
|
2087
2126
|
}
|
|
@@ -2121,10 +2160,10 @@ var hasRequiredDecode_codepoint;
|
|
|
2121
2160
|
function requireDecode_codepoint() {
|
|
2122
2161
|
if (hasRequiredDecode_codepoint) return decode_codepoint;
|
|
2123
2162
|
hasRequiredDecode_codepoint = 1;
|
|
2124
|
-
(function(exports$
|
|
2163
|
+
(function(exports$12) {
|
|
2125
2164
|
var _a;
|
|
2126
|
-
Object.defineProperty(exports$
|
|
2127
|
-
exports$
|
|
2165
|
+
Object.defineProperty(exports$12, "__esModule", { value: true });
|
|
2166
|
+
exports$12.replaceCodePoint = exports$12.fromCodePoint = void 0;
|
|
2128
2167
|
var decodeMap = /* @__PURE__ */ new Map([
|
|
2129
2168
|
[0, 65533],
|
|
2130
2169
|
// C1 Unicode control character reference replacements
|
|
@@ -2156,7 +2195,7 @@ function requireDecode_codepoint() {
|
|
|
2156
2195
|
[158, 382],
|
|
2157
2196
|
[159, 376]
|
|
2158
2197
|
]);
|
|
2159
|
-
exports$
|
|
2198
|
+
exports$12.fromCodePoint = // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
|
|
2160
2199
|
(_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function(codePoint) {
|
|
2161
2200
|
var output = "";
|
|
2162
2201
|
if (codePoint > 65535) {
|
|
@@ -2174,11 +2213,11 @@ function requireDecode_codepoint() {
|
|
|
2174
2213
|
}
|
|
2175
2214
|
return (_a2 = decodeMap.get(codePoint)) !== null && _a2 !== void 0 ? _a2 : codePoint;
|
|
2176
2215
|
}
|
|
2177
|
-
exports$
|
|
2216
|
+
exports$12.replaceCodePoint = replaceCodePoint;
|
|
2178
2217
|
function decodeCodePoint(codePoint) {
|
|
2179
|
-
return (0, exports$
|
|
2218
|
+
return (0, exports$12.fromCodePoint)(replaceCodePoint(codePoint));
|
|
2180
2219
|
}
|
|
2181
|
-
exports$
|
|
2220
|
+
exports$12.default = decodeCodePoint;
|
|
2182
2221
|
})(decode_codepoint);
|
|
2183
2222
|
return decode_codepoint;
|
|
2184
2223
|
}
|
|
@@ -2186,7 +2225,7 @@ var hasRequiredDecode;
|
|
|
2186
2225
|
function requireDecode() {
|
|
2187
2226
|
if (hasRequiredDecode) return decode;
|
|
2188
2227
|
hasRequiredDecode = 1;
|
|
2189
|
-
(function(exports$
|
|
2228
|
+
(function(exports$12) {
|
|
2190
2229
|
var __createBinding = decode && decode.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
2191
2230
|
if (k2 === void 0) k2 = k;
|
|
2192
2231
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -2217,19 +2256,19 @@ function requireDecode() {
|
|
|
2217
2256
|
var __importDefault = decode && decode.__importDefault || function(mod) {
|
|
2218
2257
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
2219
2258
|
};
|
|
2220
|
-
Object.defineProperty(exports$
|
|
2221
|
-
exports$
|
|
2259
|
+
Object.defineProperty(exports$12, "__esModule", { value: true });
|
|
2260
|
+
exports$12.decodeXML = exports$12.decodeHTMLStrict = exports$12.decodeHTMLAttribute = exports$12.decodeHTML = exports$12.determineBranch = exports$12.EntityDecoder = exports$12.DecodingMode = exports$12.BinTrieFlags = exports$12.fromCodePoint = exports$12.replaceCodePoint = exports$12.decodeCodePoint = exports$12.xmlDecodeTree = exports$12.htmlDecodeTree = void 0;
|
|
2222
2261
|
var decode_data_html_js_1 = __importDefault(/* @__PURE__ */ requireDecodeDataHtml());
|
|
2223
|
-
exports$
|
|
2262
|
+
exports$12.htmlDecodeTree = decode_data_html_js_1.default;
|
|
2224
2263
|
var decode_data_xml_js_1 = __importDefault(/* @__PURE__ */ requireDecodeDataXml());
|
|
2225
|
-
exports$
|
|
2264
|
+
exports$12.xmlDecodeTree = decode_data_xml_js_1.default;
|
|
2226
2265
|
var decode_codepoint_js_1 = __importStar(/* @__PURE__ */ requireDecode_codepoint());
|
|
2227
|
-
exports$
|
|
2266
|
+
exports$12.decodeCodePoint = decode_codepoint_js_1.default;
|
|
2228
2267
|
var decode_codepoint_js_2 = /* @__PURE__ */ requireDecode_codepoint();
|
|
2229
|
-
Object.defineProperty(exports$
|
|
2268
|
+
Object.defineProperty(exports$12, "replaceCodePoint", { enumerable: true, get: function() {
|
|
2230
2269
|
return decode_codepoint_js_2.replaceCodePoint;
|
|
2231
2270
|
} });
|
|
2232
|
-
Object.defineProperty(exports$
|
|
2271
|
+
Object.defineProperty(exports$12, "fromCodePoint", { enumerable: true, get: function() {
|
|
2233
2272
|
return decode_codepoint_js_2.fromCodePoint;
|
|
2234
2273
|
} });
|
|
2235
2274
|
var CharCodes;
|
|
@@ -2253,7 +2292,7 @@ function requireDecode() {
|
|
|
2253
2292
|
BinTrieFlags2[BinTrieFlags2["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH";
|
|
2254
2293
|
BinTrieFlags2[BinTrieFlags2["BRANCH_LENGTH"] = 16256] = "BRANCH_LENGTH";
|
|
2255
2294
|
BinTrieFlags2[BinTrieFlags2["JUMP_TABLE"] = 127] = "JUMP_TABLE";
|
|
2256
|
-
})(BinTrieFlags = exports$
|
|
2295
|
+
})(BinTrieFlags = exports$12.BinTrieFlags || (exports$12.BinTrieFlags = {}));
|
|
2257
2296
|
function isNumber(code) {
|
|
2258
2297
|
return code >= CharCodes.ZERO && code <= CharCodes.NINE;
|
|
2259
2298
|
}
|
|
@@ -2279,7 +2318,7 @@ function requireDecode() {
|
|
|
2279
2318
|
DecodingMode2[DecodingMode2["Legacy"] = 0] = "Legacy";
|
|
2280
2319
|
DecodingMode2[DecodingMode2["Strict"] = 1] = "Strict";
|
|
2281
2320
|
DecodingMode2[DecodingMode2["Attribute"] = 2] = "Attribute";
|
|
2282
|
-
})(DecodingMode = exports$
|
|
2321
|
+
})(DecodingMode = exports$12.DecodingMode || (exports$12.DecodingMode = {}));
|
|
2283
2322
|
var EntityDecoder = (
|
|
2284
2323
|
/** @class */
|
|
2285
2324
|
(function() {
|
|
@@ -2463,7 +2502,7 @@ function requireDecode() {
|
|
|
2463
2502
|
return EntityDecoder2;
|
|
2464
2503
|
})()
|
|
2465
2504
|
);
|
|
2466
|
-
exports$
|
|
2505
|
+
exports$12.EntityDecoder = EntityDecoder;
|
|
2467
2506
|
function getDecoder(decodeTree) {
|
|
2468
2507
|
var ret = "";
|
|
2469
2508
|
var decoder = new EntityDecoder(decodeTree, function(str) {
|
|
@@ -2517,7 +2556,7 @@ function requireDecode() {
|
|
|
2517
2556
|
}
|
|
2518
2557
|
return -1;
|
|
2519
2558
|
}
|
|
2520
|
-
exports$
|
|
2559
|
+
exports$12.determineBranch = determineBranch;
|
|
2521
2560
|
var htmlDecoder = getDecoder(decode_data_html_js_1.default);
|
|
2522
2561
|
var xmlDecoder = getDecoder(decode_data_xml_js_1.default);
|
|
2523
2562
|
function decodeHTML(str, mode) {
|
|
@@ -2526,19 +2565,19 @@ function requireDecode() {
|
|
|
2526
2565
|
}
|
|
2527
2566
|
return htmlDecoder(str, mode);
|
|
2528
2567
|
}
|
|
2529
|
-
exports$
|
|
2568
|
+
exports$12.decodeHTML = decodeHTML;
|
|
2530
2569
|
function decodeHTMLAttribute(str) {
|
|
2531
2570
|
return htmlDecoder(str, DecodingMode.Attribute);
|
|
2532
2571
|
}
|
|
2533
|
-
exports$
|
|
2572
|
+
exports$12.decodeHTMLAttribute = decodeHTMLAttribute;
|
|
2534
2573
|
function decodeHTMLStrict(str) {
|
|
2535
2574
|
return htmlDecoder(str, DecodingMode.Strict);
|
|
2536
2575
|
}
|
|
2537
|
-
exports$
|
|
2576
|
+
exports$12.decodeHTMLStrict = decodeHTMLStrict;
|
|
2538
2577
|
function decodeXML(str) {
|
|
2539
2578
|
return xmlDecoder(str, DecodingMode.Strict);
|
|
2540
2579
|
}
|
|
2541
|
-
exports$
|
|
2580
|
+
exports$12.decodeXML = decodeXML;
|
|
2542
2581
|
})(decode);
|
|
2543
2582
|
return decode;
|
|
2544
2583
|
}
|
|
@@ -2563,10 +2602,10 @@ var hasRequired_escape;
|
|
|
2563
2602
|
function require_escape() {
|
|
2564
2603
|
if (hasRequired_escape) return _escape;
|
|
2565
2604
|
hasRequired_escape = 1;
|
|
2566
|
-
(function(exports$
|
|
2567
|
-
Object.defineProperty(exports$
|
|
2568
|
-
exports$
|
|
2569
|
-
exports$
|
|
2605
|
+
(function(exports$12) {
|
|
2606
|
+
Object.defineProperty(exports$12, "__esModule", { value: true });
|
|
2607
|
+
exports$12.escapeText = exports$12.escapeAttribute = exports$12.escapeUTF8 = exports$12.escape = exports$12.encodeXML = exports$12.getCodePoint = exports$12.xmlReplacer = void 0;
|
|
2608
|
+
exports$12.xmlReplacer = /["&'<>$\x80-\uFFFF]/g;
|
|
2570
2609
|
var xmlCodeMap = /* @__PURE__ */ new Map([
|
|
2571
2610
|
[34, """],
|
|
2572
2611
|
[38, "&"],
|
|
@@ -2574,7 +2613,7 @@ function require_escape() {
|
|
|
2574
2613
|
[60, "<"],
|
|
2575
2614
|
[62, ">"]
|
|
2576
2615
|
]);
|
|
2577
|
-
exports$
|
|
2616
|
+
exports$12.getCodePoint = // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
2578
2617
|
String.prototype.codePointAt != null ? function(str, index) {
|
|
2579
2618
|
return str.codePointAt(index);
|
|
2580
2619
|
} : (
|
|
@@ -2587,7 +2626,7 @@ function require_escape() {
|
|
|
2587
2626
|
var ret = "";
|
|
2588
2627
|
var lastIdx = 0;
|
|
2589
2628
|
var match;
|
|
2590
|
-
while ((match = exports$
|
|
2629
|
+
while ((match = exports$12.xmlReplacer.exec(str)) !== null) {
|
|
2591
2630
|
var i = match.index;
|
|
2592
2631
|
var char = str.charCodeAt(i);
|
|
2593
2632
|
var next = xmlCodeMap.get(char);
|
|
@@ -2595,14 +2634,14 @@ function require_escape() {
|
|
|
2595
2634
|
ret += str.substring(lastIdx, i) + next;
|
|
2596
2635
|
lastIdx = i + 1;
|
|
2597
2636
|
} else {
|
|
2598
|
-
ret += "".concat(str.substring(lastIdx, i), "&#x").concat((0, exports$
|
|
2599
|
-
lastIdx = exports$
|
|
2637
|
+
ret += "".concat(str.substring(lastIdx, i), "&#x").concat((0, exports$12.getCodePoint)(str, i).toString(16), ";");
|
|
2638
|
+
lastIdx = exports$12.xmlReplacer.lastIndex += Number((char & 64512) === 55296);
|
|
2600
2639
|
}
|
|
2601
2640
|
}
|
|
2602
2641
|
return ret + str.substr(lastIdx);
|
|
2603
2642
|
}
|
|
2604
|
-
exports$
|
|
2605
|
-
exports$
|
|
2643
|
+
exports$12.encodeXML = encodeXML;
|
|
2644
|
+
exports$12.escape = encodeXML;
|
|
2606
2645
|
function getEscaper(regex, map) {
|
|
2607
2646
|
return function escape(data) {
|
|
2608
2647
|
var match;
|
|
@@ -2618,13 +2657,13 @@ function require_escape() {
|
|
|
2618
2657
|
return result + data.substring(lastIdx);
|
|
2619
2658
|
};
|
|
2620
2659
|
}
|
|
2621
|
-
exports$
|
|
2622
|
-
exports$
|
|
2660
|
+
exports$12.escapeUTF8 = getEscaper(/[&<>'"]/g, xmlCodeMap);
|
|
2661
|
+
exports$12.escapeAttribute = getEscaper(/["&\u00A0]/g, /* @__PURE__ */ new Map([
|
|
2623
2662
|
[34, """],
|
|
2624
2663
|
[38, "&"],
|
|
2625
2664
|
[160, " "]
|
|
2626
2665
|
]));
|
|
2627
|
-
exports$
|
|
2666
|
+
exports$12.escapeText = getEscaper(/[&<>\u00A0]/g, /* @__PURE__ */ new Map([
|
|
2628
2667
|
[38, "&"],
|
|
2629
2668
|
[60, "<"],
|
|
2630
2669
|
[62, ">"],
|
|
@@ -2691,9 +2730,9 @@ var hasRequiredLib$4;
|
|
|
2691
2730
|
function requireLib$4() {
|
|
2692
2731
|
if (hasRequiredLib$4) return lib$1;
|
|
2693
2732
|
hasRequiredLib$4 = 1;
|
|
2694
|
-
(function(exports$
|
|
2695
|
-
Object.defineProperty(exports$
|
|
2696
|
-
exports$
|
|
2733
|
+
(function(exports$12) {
|
|
2734
|
+
Object.defineProperty(exports$12, "__esModule", { value: true });
|
|
2735
|
+
exports$12.decodeXMLStrict = exports$12.decodeHTML5Strict = exports$12.decodeHTML4Strict = exports$12.decodeHTML5 = exports$12.decodeHTML4 = exports$12.decodeHTMLAttribute = exports$12.decodeHTMLStrict = exports$12.decodeHTML = exports$12.decodeXML = exports$12.DecodingMode = exports$12.EntityDecoder = exports$12.encodeHTML5 = exports$12.encodeHTML4 = exports$12.encodeNonAsciiHTML = exports$12.encodeHTML = exports$12.escapeText = exports$12.escapeAttribute = exports$12.escapeUTF8 = exports$12.escape = exports$12.encodeXML = exports$12.encode = exports$12.decodeStrict = exports$12.decode = exports$12.EncodingMode = exports$12.EntityLevel = void 0;
|
|
2697
2736
|
var decode_js_1 = /* @__PURE__ */ requireDecode();
|
|
2698
2737
|
var encode_js_1 = /* @__PURE__ */ requireEncode();
|
|
2699
2738
|
var escape_js_1 = /* @__PURE__ */ require_escape();
|
|
@@ -2701,7 +2740,7 @@ function requireLib$4() {
|
|
|
2701
2740
|
(function(EntityLevel2) {
|
|
2702
2741
|
EntityLevel2[EntityLevel2["XML"] = 0] = "XML";
|
|
2703
2742
|
EntityLevel2[EntityLevel2["HTML"] = 1] = "HTML";
|
|
2704
|
-
})(EntityLevel = exports$
|
|
2743
|
+
})(EntityLevel = exports$12.EntityLevel || (exports$12.EntityLevel = {}));
|
|
2705
2744
|
var EncodingMode;
|
|
2706
2745
|
(function(EncodingMode2) {
|
|
2707
2746
|
EncodingMode2[EncodingMode2["UTF8"] = 0] = "UTF8";
|
|
@@ -2709,7 +2748,7 @@ function requireLib$4() {
|
|
|
2709
2748
|
EncodingMode2[EncodingMode2["Extensive"] = 2] = "Extensive";
|
|
2710
2749
|
EncodingMode2[EncodingMode2["Attribute"] = 3] = "Attribute";
|
|
2711
2750
|
EncodingMode2[EncodingMode2["Text"] = 4] = "Text";
|
|
2712
|
-
})(EncodingMode = exports$
|
|
2751
|
+
})(EncodingMode = exports$12.EncodingMode || (exports$12.EncodingMode = {}));
|
|
2713
2752
|
function decode2(data, options) {
|
|
2714
2753
|
if (options === void 0) {
|
|
2715
2754
|
options = EntityLevel.XML;
|
|
@@ -2721,7 +2760,7 @@ function requireLib$4() {
|
|
|
2721
2760
|
}
|
|
2722
2761
|
return (0, decode_js_1.decodeXML)(data);
|
|
2723
2762
|
}
|
|
2724
|
-
exports$
|
|
2763
|
+
exports$12.decode = decode2;
|
|
2725
2764
|
function decodeStrict(data, options) {
|
|
2726
2765
|
var _a;
|
|
2727
2766
|
if (options === void 0) {
|
|
@@ -2731,7 +2770,7 @@ function requireLib$4() {
|
|
|
2731
2770
|
(_a = opts.mode) !== null && _a !== void 0 ? _a : opts.mode = decode_js_1.DecodingMode.Strict;
|
|
2732
2771
|
return decode2(data, opts);
|
|
2733
2772
|
}
|
|
2734
|
-
exports$
|
|
2773
|
+
exports$12.decodeStrict = decodeStrict;
|
|
2735
2774
|
function encode2(data, options) {
|
|
2736
2775
|
if (options === void 0) {
|
|
2737
2776
|
options = EntityLevel.XML;
|
|
@@ -2751,68 +2790,68 @@ function requireLib$4() {
|
|
|
2751
2790
|
}
|
|
2752
2791
|
return (0, escape_js_1.encodeXML)(data);
|
|
2753
2792
|
}
|
|
2754
|
-
exports$
|
|
2793
|
+
exports$12.encode = encode2;
|
|
2755
2794
|
var escape_js_2 = /* @__PURE__ */ require_escape();
|
|
2756
|
-
Object.defineProperty(exports$
|
|
2795
|
+
Object.defineProperty(exports$12, "encodeXML", { enumerable: true, get: function() {
|
|
2757
2796
|
return escape_js_2.encodeXML;
|
|
2758
2797
|
} });
|
|
2759
|
-
Object.defineProperty(exports$
|
|
2798
|
+
Object.defineProperty(exports$12, "escape", { enumerable: true, get: function() {
|
|
2760
2799
|
return escape_js_2.escape;
|
|
2761
2800
|
} });
|
|
2762
|
-
Object.defineProperty(exports$
|
|
2801
|
+
Object.defineProperty(exports$12, "escapeUTF8", { enumerable: true, get: function() {
|
|
2763
2802
|
return escape_js_2.escapeUTF8;
|
|
2764
2803
|
} });
|
|
2765
|
-
Object.defineProperty(exports$
|
|
2804
|
+
Object.defineProperty(exports$12, "escapeAttribute", { enumerable: true, get: function() {
|
|
2766
2805
|
return escape_js_2.escapeAttribute;
|
|
2767
2806
|
} });
|
|
2768
|
-
Object.defineProperty(exports$
|
|
2807
|
+
Object.defineProperty(exports$12, "escapeText", { enumerable: true, get: function() {
|
|
2769
2808
|
return escape_js_2.escapeText;
|
|
2770
2809
|
} });
|
|
2771
2810
|
var encode_js_2 = /* @__PURE__ */ requireEncode();
|
|
2772
|
-
Object.defineProperty(exports$
|
|
2811
|
+
Object.defineProperty(exports$12, "encodeHTML", { enumerable: true, get: function() {
|
|
2773
2812
|
return encode_js_2.encodeHTML;
|
|
2774
2813
|
} });
|
|
2775
|
-
Object.defineProperty(exports$
|
|
2814
|
+
Object.defineProperty(exports$12, "encodeNonAsciiHTML", { enumerable: true, get: function() {
|
|
2776
2815
|
return encode_js_2.encodeNonAsciiHTML;
|
|
2777
2816
|
} });
|
|
2778
|
-
Object.defineProperty(exports$
|
|
2817
|
+
Object.defineProperty(exports$12, "encodeHTML4", { enumerable: true, get: function() {
|
|
2779
2818
|
return encode_js_2.encodeHTML;
|
|
2780
2819
|
} });
|
|
2781
|
-
Object.defineProperty(exports$
|
|
2820
|
+
Object.defineProperty(exports$12, "encodeHTML5", { enumerable: true, get: function() {
|
|
2782
2821
|
return encode_js_2.encodeHTML;
|
|
2783
2822
|
} });
|
|
2784
2823
|
var decode_js_2 = /* @__PURE__ */ requireDecode();
|
|
2785
|
-
Object.defineProperty(exports$
|
|
2824
|
+
Object.defineProperty(exports$12, "EntityDecoder", { enumerable: true, get: function() {
|
|
2786
2825
|
return decode_js_2.EntityDecoder;
|
|
2787
2826
|
} });
|
|
2788
|
-
Object.defineProperty(exports$
|
|
2827
|
+
Object.defineProperty(exports$12, "DecodingMode", { enumerable: true, get: function() {
|
|
2789
2828
|
return decode_js_2.DecodingMode;
|
|
2790
2829
|
} });
|
|
2791
|
-
Object.defineProperty(exports$
|
|
2830
|
+
Object.defineProperty(exports$12, "decodeXML", { enumerable: true, get: function() {
|
|
2792
2831
|
return decode_js_2.decodeXML;
|
|
2793
2832
|
} });
|
|
2794
|
-
Object.defineProperty(exports$
|
|
2833
|
+
Object.defineProperty(exports$12, "decodeHTML", { enumerable: true, get: function() {
|
|
2795
2834
|
return decode_js_2.decodeHTML;
|
|
2796
2835
|
} });
|
|
2797
|
-
Object.defineProperty(exports$
|
|
2836
|
+
Object.defineProperty(exports$12, "decodeHTMLStrict", { enumerable: true, get: function() {
|
|
2798
2837
|
return decode_js_2.decodeHTMLStrict;
|
|
2799
2838
|
} });
|
|
2800
|
-
Object.defineProperty(exports$
|
|
2839
|
+
Object.defineProperty(exports$12, "decodeHTMLAttribute", { enumerable: true, get: function() {
|
|
2801
2840
|
return decode_js_2.decodeHTMLAttribute;
|
|
2802
2841
|
} });
|
|
2803
|
-
Object.defineProperty(exports$
|
|
2842
|
+
Object.defineProperty(exports$12, "decodeHTML4", { enumerable: true, get: function() {
|
|
2804
2843
|
return decode_js_2.decodeHTML;
|
|
2805
2844
|
} });
|
|
2806
|
-
Object.defineProperty(exports$
|
|
2845
|
+
Object.defineProperty(exports$12, "decodeHTML5", { enumerable: true, get: function() {
|
|
2807
2846
|
return decode_js_2.decodeHTML;
|
|
2808
2847
|
} });
|
|
2809
|
-
Object.defineProperty(exports$
|
|
2848
|
+
Object.defineProperty(exports$12, "decodeHTML4Strict", { enumerable: true, get: function() {
|
|
2810
2849
|
return decode_js_2.decodeHTMLStrict;
|
|
2811
2850
|
} });
|
|
2812
|
-
Object.defineProperty(exports$
|
|
2851
|
+
Object.defineProperty(exports$12, "decodeHTML5Strict", { enumerable: true, get: function() {
|
|
2813
2852
|
return decode_js_2.decodeHTMLStrict;
|
|
2814
2853
|
} });
|
|
2815
|
-
Object.defineProperty(exports$
|
|
2854
|
+
Object.defineProperty(exports$12, "decodeXMLStrict", { enumerable: true, get: function() {
|
|
2816
2855
|
return decode_js_2.decodeXML;
|
|
2817
2856
|
} });
|
|
2818
2857
|
})(lib$1);
|
|
@@ -3225,12 +3264,12 @@ function requireTraversal() {
|
|
|
3225
3264
|
}
|
|
3226
3265
|
return siblings;
|
|
3227
3266
|
}
|
|
3228
|
-
function getAttributeValue(elem,
|
|
3267
|
+
function getAttributeValue(elem, name2) {
|
|
3229
3268
|
var _a;
|
|
3230
|
-
return (_a = elem.attribs) === null || _a === void 0 ? void 0 : _a[
|
|
3269
|
+
return (_a = elem.attribs) === null || _a === void 0 ? void 0 : _a[name2];
|
|
3231
3270
|
}
|
|
3232
|
-
function hasAttrib(elem,
|
|
3233
|
-
return elem.attribs != null && Object.prototype.hasOwnProperty.call(elem.attribs,
|
|
3271
|
+
function hasAttrib(elem, name2) {
|
|
3272
|
+
return elem.attribs != null && Object.prototype.hasOwnProperty.call(elem.attribs, name2) && elem.attribs[name2] != null;
|
|
3234
3273
|
}
|
|
3235
3274
|
function getName(elem) {
|
|
3236
3275
|
return elem.name;
|
|
@@ -3466,16 +3505,16 @@ function requireLegacy() {
|
|
|
3466
3505
|
var domhandler_1 = /* @__PURE__ */ requireLib$5();
|
|
3467
3506
|
var querying_js_1 = /* @__PURE__ */ requireQuerying();
|
|
3468
3507
|
var Checks = {
|
|
3469
|
-
tag_name: function(
|
|
3470
|
-
if (typeof
|
|
3508
|
+
tag_name: function(name2) {
|
|
3509
|
+
if (typeof name2 === "function") {
|
|
3471
3510
|
return function(elem) {
|
|
3472
|
-
return (0, domhandler_1.isTag)(elem) &&
|
|
3511
|
+
return (0, domhandler_1.isTag)(elem) && name2(elem.name);
|
|
3473
3512
|
};
|
|
3474
|
-
} else if (
|
|
3513
|
+
} else if (name2 === "*") {
|
|
3475
3514
|
return domhandler_1.isTag;
|
|
3476
3515
|
}
|
|
3477
3516
|
return function(elem) {
|
|
3478
|
-
return (0, domhandler_1.isTag)(elem) && elem.name ===
|
|
3517
|
+
return (0, domhandler_1.isTag)(elem) && elem.name === name2;
|
|
3479
3518
|
};
|
|
3480
3519
|
},
|
|
3481
3520
|
tag_type: function(type2) {
|
|
@@ -3689,9 +3728,9 @@ function requireFeeds() {
|
|
|
3689
3728
|
if (href2) {
|
|
3690
3729
|
entry.link = href2;
|
|
3691
3730
|
}
|
|
3692
|
-
var
|
|
3693
|
-
if (
|
|
3694
|
-
entry.description =
|
|
3731
|
+
var description2 = fetch2("summary", children) || fetch2("content", children);
|
|
3732
|
+
if (description2) {
|
|
3733
|
+
entry.description = description2;
|
|
3695
3734
|
}
|
|
3696
3735
|
var pubDate = fetch2("updated", children);
|
|
3697
3736
|
if (pubDate) {
|
|
@@ -3805,7 +3844,7 @@ var hasRequiredLib$2;
|
|
|
3805
3844
|
function requireLib$2() {
|
|
3806
3845
|
if (hasRequiredLib$2) return lib$5;
|
|
3807
3846
|
hasRequiredLib$2 = 1;
|
|
3808
|
-
(function(exports$
|
|
3847
|
+
(function(exports$12) {
|
|
3809
3848
|
var __createBinding = lib$5 && lib$5.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
3810
3849
|
if (k2 === void 0) k2 = k;
|
|
3811
3850
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -3819,35 +3858,35 @@ function requireLib$2() {
|
|
|
3819
3858
|
if (k2 === void 0) k2 = k;
|
|
3820
3859
|
o[k2] = m[k];
|
|
3821
3860
|
}));
|
|
3822
|
-
var __exportStar = lib$5 && lib$5.__exportStar || function(m, exports$
|
|
3823
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$
|
|
3861
|
+
var __exportStar = lib$5 && lib$5.__exportStar || function(m, exports$13) {
|
|
3862
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$13, p)) __createBinding(exports$13, m, p);
|
|
3824
3863
|
};
|
|
3825
|
-
Object.defineProperty(exports$
|
|
3826
|
-
exports$
|
|
3827
|
-
__exportStar(/* @__PURE__ */ requireStringify(), exports$
|
|
3828
|
-
__exportStar(/* @__PURE__ */ requireTraversal(), exports$
|
|
3829
|
-
__exportStar(/* @__PURE__ */ requireManipulation(), exports$
|
|
3830
|
-
__exportStar(/* @__PURE__ */ requireQuerying(), exports$
|
|
3831
|
-
__exportStar(/* @__PURE__ */ requireLegacy(), exports$
|
|
3832
|
-
__exportStar(/* @__PURE__ */ requireHelpers(), exports$
|
|
3833
|
-
__exportStar(/* @__PURE__ */ requireFeeds(), exports$
|
|
3864
|
+
Object.defineProperty(exports$12, "__esModule", { value: true });
|
|
3865
|
+
exports$12.hasChildren = exports$12.isDocument = exports$12.isComment = exports$12.isText = exports$12.isCDATA = exports$12.isTag = void 0;
|
|
3866
|
+
__exportStar(/* @__PURE__ */ requireStringify(), exports$12);
|
|
3867
|
+
__exportStar(/* @__PURE__ */ requireTraversal(), exports$12);
|
|
3868
|
+
__exportStar(/* @__PURE__ */ requireManipulation(), exports$12);
|
|
3869
|
+
__exportStar(/* @__PURE__ */ requireQuerying(), exports$12);
|
|
3870
|
+
__exportStar(/* @__PURE__ */ requireLegacy(), exports$12);
|
|
3871
|
+
__exportStar(/* @__PURE__ */ requireHelpers(), exports$12);
|
|
3872
|
+
__exportStar(/* @__PURE__ */ requireFeeds(), exports$12);
|
|
3834
3873
|
var domhandler_1 = /* @__PURE__ */ requireLib$5();
|
|
3835
|
-
Object.defineProperty(exports$
|
|
3874
|
+
Object.defineProperty(exports$12, "isTag", { enumerable: true, get: function() {
|
|
3836
3875
|
return domhandler_1.isTag;
|
|
3837
3876
|
} });
|
|
3838
|
-
Object.defineProperty(exports$
|
|
3877
|
+
Object.defineProperty(exports$12, "isCDATA", { enumerable: true, get: function() {
|
|
3839
3878
|
return domhandler_1.isCDATA;
|
|
3840
3879
|
} });
|
|
3841
|
-
Object.defineProperty(exports$
|
|
3880
|
+
Object.defineProperty(exports$12, "isText", { enumerable: true, get: function() {
|
|
3842
3881
|
return domhandler_1.isText;
|
|
3843
3882
|
} });
|
|
3844
|
-
Object.defineProperty(exports$
|
|
3883
|
+
Object.defineProperty(exports$12, "isComment", { enumerable: true, get: function() {
|
|
3845
3884
|
return domhandler_1.isComment;
|
|
3846
3885
|
} });
|
|
3847
|
-
Object.defineProperty(exports$
|
|
3886
|
+
Object.defineProperty(exports$12, "isDocument", { enumerable: true, get: function() {
|
|
3848
3887
|
return domhandler_1.isDocument;
|
|
3849
3888
|
} });
|
|
3850
|
-
Object.defineProperty(exports$
|
|
3889
|
+
Object.defineProperty(exports$12, "hasChildren", { enumerable: true, get: function() {
|
|
3851
3890
|
return domhandler_1.hasChildren;
|
|
3852
3891
|
} });
|
|
3853
3892
|
})(lib$5);
|
|
@@ -3967,9 +4006,9 @@ function parseSelector(subselects2, selector, selectorIndex) {
|
|
|
3967
4006
|
if (!match) {
|
|
3968
4007
|
throw new Error(`Expected name, found ${selector.slice(selectorIndex)}`);
|
|
3969
4008
|
}
|
|
3970
|
-
const [
|
|
3971
|
-
selectorIndex += offset +
|
|
3972
|
-
return unescapeCSS(
|
|
4009
|
+
const [name2] = match;
|
|
4010
|
+
selectorIndex += offset + name2.length;
|
|
4011
|
+
return unescapeCSS(name2);
|
|
3973
4012
|
}
|
|
3974
4013
|
function stripWhitespace(offset) {
|
|
3975
4014
|
selectorIndex += offset;
|
|
@@ -4012,10 +4051,10 @@ function parseSelector(subselects2, selector, selectorIndex) {
|
|
|
4012
4051
|
ensureNotTraversal();
|
|
4013
4052
|
tokens.push({ type: type2 });
|
|
4014
4053
|
}
|
|
4015
|
-
function addSpecialAttribute(
|
|
4054
|
+
function addSpecialAttribute(name2, action) {
|
|
4016
4055
|
tokens.push({
|
|
4017
4056
|
type: SelectorType.Attribute,
|
|
4018
|
-
name,
|
|
4057
|
+
name: name2,
|
|
4019
4058
|
action,
|
|
4020
4059
|
value: getName(1),
|
|
4021
4060
|
namespace: null,
|
|
@@ -4083,18 +4122,18 @@ function parseSelector(subselects2, selector, selectorIndex) {
|
|
|
4083
4122
|
}
|
|
4084
4123
|
case 91: {
|
|
4085
4124
|
stripWhitespace(1);
|
|
4086
|
-
let
|
|
4125
|
+
let name2;
|
|
4087
4126
|
let namespace = null;
|
|
4088
4127
|
if (selector.charCodeAt(selectorIndex) === 124) {
|
|
4089
|
-
|
|
4128
|
+
name2 = getName(1);
|
|
4090
4129
|
} else if (selector.startsWith("*|", selectorIndex)) {
|
|
4091
4130
|
namespace = "*";
|
|
4092
|
-
|
|
4131
|
+
name2 = getName(2);
|
|
4093
4132
|
} else {
|
|
4094
|
-
|
|
4133
|
+
name2 = getName(0);
|
|
4095
4134
|
if (selector.charCodeAt(selectorIndex) === 124 && selector.charCodeAt(selectorIndex + 1) !== 61) {
|
|
4096
|
-
namespace =
|
|
4097
|
-
|
|
4135
|
+
namespace = name2;
|
|
4136
|
+
name2 = getName(1);
|
|
4098
4137
|
}
|
|
4099
4138
|
}
|
|
4100
4139
|
stripWhitespace(0);
|
|
@@ -4147,7 +4186,7 @@ function parseSelector(subselects2, selector, selectorIndex) {
|
|
|
4147
4186
|
selectorIndex += 1;
|
|
4148
4187
|
const attributeSelector = {
|
|
4149
4188
|
type: SelectorType.Attribute,
|
|
4150
|
-
name,
|
|
4189
|
+
name: name2,
|
|
4151
4190
|
action,
|
|
4152
4191
|
value,
|
|
4153
4192
|
namespace,
|
|
@@ -4165,22 +4204,22 @@ function parseSelector(subselects2, selector, selectorIndex) {
|
|
|
4165
4204
|
});
|
|
4166
4205
|
continue;
|
|
4167
4206
|
}
|
|
4168
|
-
const
|
|
4207
|
+
const name2 = getName(1).toLowerCase();
|
|
4169
4208
|
let data = null;
|
|
4170
4209
|
if (selector.charCodeAt(selectorIndex) === 40) {
|
|
4171
|
-
if (unpackPseudos.has(
|
|
4210
|
+
if (unpackPseudos.has(name2)) {
|
|
4172
4211
|
if (isQuote(selector.charCodeAt(selectorIndex + 1))) {
|
|
4173
|
-
throw new Error(`Pseudo-selector ${
|
|
4212
|
+
throw new Error(`Pseudo-selector ${name2} cannot be quoted`);
|
|
4174
4213
|
}
|
|
4175
4214
|
data = [];
|
|
4176
4215
|
selectorIndex = parseSelector(data, selector, selectorIndex + 1);
|
|
4177
4216
|
if (selector.charCodeAt(selectorIndex) !== 41) {
|
|
4178
|
-
throw new Error(`Missing closing parenthesis in :${
|
|
4217
|
+
throw new Error(`Missing closing parenthesis in :${name2} (${selector})`);
|
|
4179
4218
|
}
|
|
4180
4219
|
selectorIndex += 1;
|
|
4181
4220
|
} else {
|
|
4182
4221
|
data = readValueWithParenthesis();
|
|
4183
|
-
if (stripQuotesFromPseudos.has(
|
|
4222
|
+
if (stripQuotesFromPseudos.has(name2)) {
|
|
4184
4223
|
const quot = data.charCodeAt(0);
|
|
4185
4224
|
if (quot === data.charCodeAt(data.length - 1) && isQuote(quot)) {
|
|
4186
4225
|
data = data.slice(1, -1);
|
|
@@ -4189,7 +4228,7 @@ function parseSelector(subselects2, selector, selectorIndex) {
|
|
|
4189
4228
|
data = unescapeCSS(data);
|
|
4190
4229
|
}
|
|
4191
4230
|
}
|
|
4192
|
-
tokens.push({ type: SelectorType.Pseudo, name, data });
|
|
4231
|
+
tokens.push({ type: SelectorType.Pseudo, name: name2, data });
|
|
4193
4232
|
break;
|
|
4194
4233
|
}
|
|
4195
4234
|
case 44: {
|
|
@@ -4211,32 +4250,32 @@ function parseSelector(subselects2, selector, selectorIndex) {
|
|
|
4211
4250
|
break;
|
|
4212
4251
|
}
|
|
4213
4252
|
let namespace = null;
|
|
4214
|
-
let
|
|
4253
|
+
let name2;
|
|
4215
4254
|
if (firstChar === 42) {
|
|
4216
4255
|
selectorIndex += 1;
|
|
4217
|
-
|
|
4256
|
+
name2 = "*";
|
|
4218
4257
|
} else if (firstChar === 124) {
|
|
4219
|
-
|
|
4258
|
+
name2 = "";
|
|
4220
4259
|
if (selector.charCodeAt(selectorIndex + 1) === 124) {
|
|
4221
4260
|
addTraversal(SelectorType.ColumnCombinator);
|
|
4222
4261
|
stripWhitespace(2);
|
|
4223
4262
|
break;
|
|
4224
4263
|
}
|
|
4225
4264
|
} else if (reName.test(selector.slice(selectorIndex))) {
|
|
4226
|
-
|
|
4265
|
+
name2 = getName(0);
|
|
4227
4266
|
} else {
|
|
4228
4267
|
break loop;
|
|
4229
4268
|
}
|
|
4230
4269
|
if (selector.charCodeAt(selectorIndex) === 124 && selector.charCodeAt(selectorIndex + 1) !== 124) {
|
|
4231
|
-
namespace =
|
|
4270
|
+
namespace = name2;
|
|
4232
4271
|
if (selector.charCodeAt(selectorIndex + 1) === 42) {
|
|
4233
|
-
|
|
4272
|
+
name2 = "*";
|
|
4234
4273
|
selectorIndex += 2;
|
|
4235
4274
|
} else {
|
|
4236
|
-
|
|
4275
|
+
name2 = getName(1);
|
|
4237
4276
|
}
|
|
4238
4277
|
}
|
|
4239
|
-
tokens.push(
|
|
4278
|
+
tokens.push(name2 === "*" ? { type: SelectorType.Universal, namespace } : { type: SelectorType.Tag, name: name2, namespace });
|
|
4240
4279
|
}
|
|
4241
4280
|
}
|
|
4242
4281
|
}
|
|
@@ -4295,11 +4334,11 @@ function stringifyToken(token, index, arr) {
|
|
|
4295
4334
|
if (token.name === "class" && token.action === AttributeAction.Element && token.ignoreCase === "quirks" && !token.namespace) {
|
|
4296
4335
|
return `.${escapeName(token.value, charsToEscapeInName)}`;
|
|
4297
4336
|
}
|
|
4298
|
-
const
|
|
4337
|
+
const name2 = getNamespacedName(token);
|
|
4299
4338
|
if (token.action === AttributeAction.Exists) {
|
|
4300
|
-
return `[${
|
|
4339
|
+
return `[${name2}]`;
|
|
4301
4340
|
}
|
|
4302
|
-
return `[${
|
|
4341
|
+
return `[${name2}${getActionValue(token.action)}="${escapeName(token.value, charsToEscapeInAttributeValue)}"${token.ignoreCase === null ? "" : token.ignoreCase ? " i" : " s"}]`;
|
|
4303
4342
|
}
|
|
4304
4343
|
}
|
|
4305
4344
|
}
|
|
@@ -4497,58 +4536,58 @@ function requireAttributes() {
|
|
|
4497
4536
|
attributes.attributeRules = {
|
|
4498
4537
|
equals: function(next, data, options) {
|
|
4499
4538
|
var adapter = options.adapter;
|
|
4500
|
-
var
|
|
4539
|
+
var name2 = data.name;
|
|
4501
4540
|
var value = data.value;
|
|
4502
4541
|
if (shouldIgnoreCase(data, options)) {
|
|
4503
4542
|
value = value.toLowerCase();
|
|
4504
4543
|
return function(elem) {
|
|
4505
|
-
var attr = adapter.getAttributeValue(elem,
|
|
4544
|
+
var attr = adapter.getAttributeValue(elem, name2);
|
|
4506
4545
|
return attr != null && attr.length === value.length && attr.toLowerCase() === value && next(elem);
|
|
4507
4546
|
};
|
|
4508
4547
|
}
|
|
4509
4548
|
return function(elem) {
|
|
4510
|
-
return adapter.getAttributeValue(elem,
|
|
4549
|
+
return adapter.getAttributeValue(elem, name2) === value && next(elem);
|
|
4511
4550
|
};
|
|
4512
4551
|
},
|
|
4513
4552
|
hyphen: function(next, data, options) {
|
|
4514
4553
|
var adapter = options.adapter;
|
|
4515
|
-
var
|
|
4554
|
+
var name2 = data.name;
|
|
4516
4555
|
var value = data.value;
|
|
4517
4556
|
var len = value.length;
|
|
4518
4557
|
if (shouldIgnoreCase(data, options)) {
|
|
4519
4558
|
value = value.toLowerCase();
|
|
4520
4559
|
return function hyphenIC(elem) {
|
|
4521
|
-
var attr = adapter.getAttributeValue(elem,
|
|
4560
|
+
var attr = adapter.getAttributeValue(elem, name2);
|
|
4522
4561
|
return attr != null && (attr.length === len || attr.charAt(len) === "-") && attr.substr(0, len).toLowerCase() === value && next(elem);
|
|
4523
4562
|
};
|
|
4524
4563
|
}
|
|
4525
4564
|
return function hyphen(elem) {
|
|
4526
|
-
var attr = adapter.getAttributeValue(elem,
|
|
4565
|
+
var attr = adapter.getAttributeValue(elem, name2);
|
|
4527
4566
|
return attr != null && (attr.length === len || attr.charAt(len) === "-") && attr.substr(0, len) === value && next(elem);
|
|
4528
4567
|
};
|
|
4529
4568
|
},
|
|
4530
4569
|
element: function(next, data, options) {
|
|
4531
4570
|
var adapter = options.adapter;
|
|
4532
|
-
var
|
|
4571
|
+
var name2 = data.name, value = data.value;
|
|
4533
4572
|
if (/\s/.test(value)) {
|
|
4534
4573
|
return boolbase_1.default.falseFunc;
|
|
4535
4574
|
}
|
|
4536
4575
|
var regex = new RegExp("(?:^|\\s)".concat(escapeRegex2(value), "(?:$|\\s)"), shouldIgnoreCase(data, options) ? "i" : "");
|
|
4537
4576
|
return function element(elem) {
|
|
4538
|
-
var attr = adapter.getAttributeValue(elem,
|
|
4577
|
+
var attr = adapter.getAttributeValue(elem, name2);
|
|
4539
4578
|
return attr != null && attr.length >= value.length && regex.test(attr) && next(elem);
|
|
4540
4579
|
};
|
|
4541
4580
|
},
|
|
4542
4581
|
exists: function(next, _a, _b) {
|
|
4543
|
-
var
|
|
4582
|
+
var name2 = _a.name;
|
|
4544
4583
|
var adapter = _b.adapter;
|
|
4545
4584
|
return function(elem) {
|
|
4546
|
-
return adapter.hasAttrib(elem,
|
|
4585
|
+
return adapter.hasAttrib(elem, name2) && next(elem);
|
|
4547
4586
|
};
|
|
4548
4587
|
},
|
|
4549
4588
|
start: function(next, data, options) {
|
|
4550
4589
|
var adapter = options.adapter;
|
|
4551
|
-
var
|
|
4590
|
+
var name2 = data.name;
|
|
4552
4591
|
var value = data.value;
|
|
4553
4592
|
var len = value.length;
|
|
4554
4593
|
if (len === 0) {
|
|
@@ -4557,18 +4596,18 @@ function requireAttributes() {
|
|
|
4557
4596
|
if (shouldIgnoreCase(data, options)) {
|
|
4558
4597
|
value = value.toLowerCase();
|
|
4559
4598
|
return function(elem) {
|
|
4560
|
-
var attr = adapter.getAttributeValue(elem,
|
|
4599
|
+
var attr = adapter.getAttributeValue(elem, name2);
|
|
4561
4600
|
return attr != null && attr.length >= len && attr.substr(0, len).toLowerCase() === value && next(elem);
|
|
4562
4601
|
};
|
|
4563
4602
|
}
|
|
4564
4603
|
return function(elem) {
|
|
4565
4604
|
var _a;
|
|
4566
|
-
return !!((_a = adapter.getAttributeValue(elem,
|
|
4605
|
+
return !!((_a = adapter.getAttributeValue(elem, name2)) === null || _a === void 0 ? void 0 : _a.startsWith(value)) && next(elem);
|
|
4567
4606
|
};
|
|
4568
4607
|
},
|
|
4569
4608
|
end: function(next, data, options) {
|
|
4570
4609
|
var adapter = options.adapter;
|
|
4571
|
-
var
|
|
4610
|
+
var name2 = data.name;
|
|
4572
4611
|
var value = data.value;
|
|
4573
4612
|
var len = -value.length;
|
|
4574
4613
|
if (len === 0) {
|
|
@@ -4578,49 +4617,49 @@ function requireAttributes() {
|
|
|
4578
4617
|
value = value.toLowerCase();
|
|
4579
4618
|
return function(elem) {
|
|
4580
4619
|
var _a;
|
|
4581
|
-
return ((_a = adapter.getAttributeValue(elem,
|
|
4620
|
+
return ((_a = adapter.getAttributeValue(elem, name2)) === null || _a === void 0 ? void 0 : _a.substr(len).toLowerCase()) === value && next(elem);
|
|
4582
4621
|
};
|
|
4583
4622
|
}
|
|
4584
4623
|
return function(elem) {
|
|
4585
4624
|
var _a;
|
|
4586
|
-
return !!((_a = adapter.getAttributeValue(elem,
|
|
4625
|
+
return !!((_a = adapter.getAttributeValue(elem, name2)) === null || _a === void 0 ? void 0 : _a.endsWith(value)) && next(elem);
|
|
4587
4626
|
};
|
|
4588
4627
|
},
|
|
4589
4628
|
any: function(next, data, options) {
|
|
4590
4629
|
var adapter = options.adapter;
|
|
4591
|
-
var
|
|
4630
|
+
var name2 = data.name, value = data.value;
|
|
4592
4631
|
if (value === "") {
|
|
4593
4632
|
return boolbase_1.default.falseFunc;
|
|
4594
4633
|
}
|
|
4595
4634
|
if (shouldIgnoreCase(data, options)) {
|
|
4596
4635
|
var regex_1 = new RegExp(escapeRegex2(value), "i");
|
|
4597
4636
|
return function anyIC(elem) {
|
|
4598
|
-
var attr = adapter.getAttributeValue(elem,
|
|
4637
|
+
var attr = adapter.getAttributeValue(elem, name2);
|
|
4599
4638
|
return attr != null && attr.length >= value.length && regex_1.test(attr) && next(elem);
|
|
4600
4639
|
};
|
|
4601
4640
|
}
|
|
4602
4641
|
return function(elem) {
|
|
4603
4642
|
var _a;
|
|
4604
|
-
return !!((_a = adapter.getAttributeValue(elem,
|
|
4643
|
+
return !!((_a = adapter.getAttributeValue(elem, name2)) === null || _a === void 0 ? void 0 : _a.includes(value)) && next(elem);
|
|
4605
4644
|
};
|
|
4606
4645
|
},
|
|
4607
4646
|
not: function(next, data, options) {
|
|
4608
4647
|
var adapter = options.adapter;
|
|
4609
|
-
var
|
|
4648
|
+
var name2 = data.name;
|
|
4610
4649
|
var value = data.value;
|
|
4611
4650
|
if (value === "") {
|
|
4612
4651
|
return function(elem) {
|
|
4613
|
-
return !!adapter.getAttributeValue(elem,
|
|
4652
|
+
return !!adapter.getAttributeValue(elem, name2) && next(elem);
|
|
4614
4653
|
};
|
|
4615
4654
|
} else if (shouldIgnoreCase(data, options)) {
|
|
4616
4655
|
value = value.toLowerCase();
|
|
4617
4656
|
return function(elem) {
|
|
4618
|
-
var attr = adapter.getAttributeValue(elem,
|
|
4657
|
+
var attr = adapter.getAttributeValue(elem, name2);
|
|
4619
4658
|
return (attr == null || attr.length !== value.length || attr.toLowerCase() !== value) && next(elem);
|
|
4620
4659
|
};
|
|
4621
4660
|
}
|
|
4622
4661
|
return function(elem) {
|
|
4623
|
-
return adapter.getAttributeValue(elem,
|
|
4662
|
+
return adapter.getAttributeValue(elem, name2) !== value && next(elem);
|
|
4624
4663
|
};
|
|
4625
4664
|
}
|
|
4626
4665
|
};
|
|
@@ -4769,28 +4808,28 @@ var hasRequiredLib$1;
|
|
|
4769
4808
|
function requireLib$1() {
|
|
4770
4809
|
if (hasRequiredLib$1) return lib;
|
|
4771
4810
|
hasRequiredLib$1 = 1;
|
|
4772
|
-
(function(exports$
|
|
4773
|
-
Object.defineProperty(exports$
|
|
4774
|
-
exports$
|
|
4811
|
+
(function(exports$12) {
|
|
4812
|
+
Object.defineProperty(exports$12, "__esModule", { value: true });
|
|
4813
|
+
exports$12.sequence = exports$12.generate = exports$12.compile = exports$12.parse = void 0;
|
|
4775
4814
|
var parse_js_1 = /* @__PURE__ */ requireParse$1();
|
|
4776
|
-
Object.defineProperty(exports$
|
|
4815
|
+
Object.defineProperty(exports$12, "parse", { enumerable: true, get: function() {
|
|
4777
4816
|
return parse_js_1.parse;
|
|
4778
4817
|
} });
|
|
4779
4818
|
var compile_js_1 = /* @__PURE__ */ requireCompile$1();
|
|
4780
|
-
Object.defineProperty(exports$
|
|
4819
|
+
Object.defineProperty(exports$12, "compile", { enumerable: true, get: function() {
|
|
4781
4820
|
return compile_js_1.compile;
|
|
4782
4821
|
} });
|
|
4783
|
-
Object.defineProperty(exports$
|
|
4822
|
+
Object.defineProperty(exports$12, "generate", { enumerable: true, get: function() {
|
|
4784
4823
|
return compile_js_1.generate;
|
|
4785
4824
|
} });
|
|
4786
4825
|
function nthCheck(formula) {
|
|
4787
4826
|
return (0, compile_js_1.compile)((0, parse_js_1.parse)(formula));
|
|
4788
4827
|
}
|
|
4789
|
-
exports$
|
|
4828
|
+
exports$12.default = nthCheck;
|
|
4790
4829
|
function sequence(formula) {
|
|
4791
4830
|
return (0, compile_js_1.generate)((0, parse_js_1.parse)(formula));
|
|
4792
4831
|
}
|
|
4793
|
-
exports$
|
|
4832
|
+
exports$12.sequence = sequence;
|
|
4794
4833
|
})(lib);
|
|
4795
4834
|
return lib;
|
|
4796
4835
|
}
|
|
@@ -4798,12 +4837,12 @@ var hasRequiredFilters;
|
|
|
4798
4837
|
function requireFilters() {
|
|
4799
4838
|
if (hasRequiredFilters) return filters;
|
|
4800
4839
|
hasRequiredFilters = 1;
|
|
4801
|
-
(function(exports$
|
|
4840
|
+
(function(exports$12) {
|
|
4802
4841
|
var __importDefault = filters && filters.__importDefault || function(mod) {
|
|
4803
4842
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
4804
4843
|
};
|
|
4805
|
-
Object.defineProperty(exports$
|
|
4806
|
-
exports$
|
|
4844
|
+
Object.defineProperty(exports$12, "__esModule", { value: true });
|
|
4845
|
+
exports$12.filters = void 0;
|
|
4807
4846
|
var nth_check_1 = __importDefault(/* @__PURE__ */ requireLib$1());
|
|
4808
4847
|
var boolbase_1 = __importDefault(requireBoolbase());
|
|
4809
4848
|
function getChildFunc(next, adapter) {
|
|
@@ -4812,7 +4851,7 @@ function requireFilters() {
|
|
|
4812
4851
|
return parent != null && adapter.isTag(parent) && next(elem);
|
|
4813
4852
|
};
|
|
4814
4853
|
}
|
|
4815
|
-
exports$
|
|
4854
|
+
exports$12.filters = {
|
|
4816
4855
|
contains: function(next, text2, _a) {
|
|
4817
4856
|
var adapter = _a.adapter;
|
|
4818
4857
|
return function contains(elem) {
|
|
@@ -4920,7 +4959,7 @@ function requireFilters() {
|
|
|
4920
4959
|
scope: function(next, rule, options, context) {
|
|
4921
4960
|
var equals = options.equals;
|
|
4922
4961
|
if (!context || context.length === 0) {
|
|
4923
|
-
return exports$
|
|
4962
|
+
return exports$12.filters["root"](next, rule, options);
|
|
4924
4963
|
}
|
|
4925
4964
|
if (context.length === 1) {
|
|
4926
4965
|
return function(elem) {
|
|
@@ -4935,10 +4974,10 @@ function requireFilters() {
|
|
|
4935
4974
|
visited: dynamicStatePseudo("isVisited"),
|
|
4936
4975
|
active: dynamicStatePseudo("isActive")
|
|
4937
4976
|
};
|
|
4938
|
-
function dynamicStatePseudo(
|
|
4977
|
+
function dynamicStatePseudo(name2) {
|
|
4939
4978
|
return function dynamicPseudo(next, _rule, _a) {
|
|
4940
4979
|
var adapter = _a.adapter;
|
|
4941
|
-
var func = adapter[
|
|
4980
|
+
var func = adapter[name2];
|
|
4942
4981
|
if (typeof func !== "function") {
|
|
4943
4982
|
return boolbase_1.default.falseFunc;
|
|
4944
4983
|
}
|
|
@@ -5027,13 +5066,13 @@ function requirePseudos() {
|
|
|
5027
5066
|
});
|
|
5028
5067
|
}
|
|
5029
5068
|
};
|
|
5030
|
-
function verifyPseudoArgs(func,
|
|
5069
|
+
function verifyPseudoArgs(func, name2, subselect, argIndex) {
|
|
5031
5070
|
if (subselect === null) {
|
|
5032
5071
|
if (func.length > argIndex) {
|
|
5033
|
-
throw new Error("Pseudo-class :".concat(
|
|
5072
|
+
throw new Error("Pseudo-class :".concat(name2, " requires an argument"));
|
|
5034
5073
|
}
|
|
5035
5074
|
} else if (func.length === argIndex) {
|
|
5036
|
-
throw new Error("Pseudo-class :".concat(
|
|
5075
|
+
throw new Error("Pseudo-class :".concat(name2, " doesn't have any arguments"));
|
|
5037
5076
|
}
|
|
5038
5077
|
}
|
|
5039
5078
|
pseudos.verifyPseudoArgs = verifyPseudoArgs;
|
|
@@ -5080,7 +5119,7 @@ var hasRequiredSubselects;
|
|
|
5080
5119
|
function requireSubselects() {
|
|
5081
5120
|
if (hasRequiredSubselects) return subselects;
|
|
5082
5121
|
hasRequiredSubselects = 1;
|
|
5083
|
-
(function(exports$
|
|
5122
|
+
(function(exports$12) {
|
|
5084
5123
|
var __spreadArray = subselects && subselects.__spreadArray || function(to, from, pack) {
|
|
5085
5124
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
5086
5125
|
if (ar || !(i in from)) {
|
|
@@ -5093,11 +5132,11 @@ function requireSubselects() {
|
|
|
5093
5132
|
var __importDefault = subselects && subselects.__importDefault || function(mod) {
|
|
5094
5133
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
5095
5134
|
};
|
|
5096
|
-
Object.defineProperty(exports$
|
|
5097
|
-
exports$
|
|
5135
|
+
Object.defineProperty(exports$12, "__esModule", { value: true });
|
|
5136
|
+
exports$12.subselects = exports$12.getNextSiblings = exports$12.ensureIsTag = exports$12.PLACEHOLDER_ELEMENT = void 0;
|
|
5098
5137
|
var boolbase_1 = __importDefault(requireBoolbase());
|
|
5099
5138
|
var sort_js_1 = requireSort();
|
|
5100
|
-
exports$
|
|
5139
|
+
exports$12.PLACEHOLDER_ELEMENT = {};
|
|
5101
5140
|
function ensureIsTag(next, adapter) {
|
|
5102
5141
|
if (next === boolbase_1.default.falseFunc)
|
|
5103
5142
|
return boolbase_1.default.falseFunc;
|
|
@@ -5105,7 +5144,7 @@ function requireSubselects() {
|
|
|
5105
5144
|
return adapter.isTag(elem) && next(elem);
|
|
5106
5145
|
};
|
|
5107
5146
|
}
|
|
5108
|
-
exports$
|
|
5147
|
+
exports$12.ensureIsTag = ensureIsTag;
|
|
5109
5148
|
function getNextSiblings(elem, adapter) {
|
|
5110
5149
|
var siblings = adapter.getSiblings(elem);
|
|
5111
5150
|
if (siblings.length <= 1)
|
|
@@ -5115,7 +5154,7 @@ function requireSubselects() {
|
|
|
5115
5154
|
return [];
|
|
5116
5155
|
return siblings.slice(elemIndex + 1).filter(adapter.isTag);
|
|
5117
5156
|
}
|
|
5118
|
-
exports$
|
|
5157
|
+
exports$12.getNextSiblings = getNextSiblings;
|
|
5119
5158
|
function copyOptions(options) {
|
|
5120
5159
|
return {
|
|
5121
5160
|
xmlMode: !!options.xmlMode,
|
|
@@ -5134,7 +5173,7 @@ function requireSubselects() {
|
|
|
5134
5173
|
return func(elem) && next(elem);
|
|
5135
5174
|
};
|
|
5136
5175
|
};
|
|
5137
|
-
exports$
|
|
5176
|
+
exports$12.subselects = {
|
|
5138
5177
|
is,
|
|
5139
5178
|
/**
|
|
5140
5179
|
* `:matches` and `:where` are aliases for `:is`.
|
|
@@ -5155,7 +5194,7 @@ function requireSubselects() {
|
|
|
5155
5194
|
return s.some(sort_js_1.isTraversal);
|
|
5156
5195
|
}) ? (
|
|
5157
5196
|
// Used as a placeholder. Will be replaced with the actual element.
|
|
5158
|
-
[exports$
|
|
5197
|
+
[exports$12.PLACEHOLDER_ELEMENT]
|
|
5159
5198
|
) : void 0;
|
|
5160
5199
|
var compiled = compileToken(subselect, opts, context);
|
|
5161
5200
|
if (compiled === boolbase_1.default.falseFunc)
|
|
@@ -5184,60 +5223,60 @@ var hasRequiredPseudoSelectors;
|
|
|
5184
5223
|
function requirePseudoSelectors() {
|
|
5185
5224
|
if (hasRequiredPseudoSelectors) return pseudoSelectors;
|
|
5186
5225
|
hasRequiredPseudoSelectors = 1;
|
|
5187
|
-
(function(exports$
|
|
5188
|
-
Object.defineProperty(exports$
|
|
5189
|
-
exports$
|
|
5226
|
+
(function(exports$12) {
|
|
5227
|
+
Object.defineProperty(exports$12, "__esModule", { value: true });
|
|
5228
|
+
exports$12.compilePseudoSelector = exports$12.aliases = exports$12.pseudos = exports$12.filters = void 0;
|
|
5190
5229
|
var css_what_1 = require$$0;
|
|
5191
5230
|
var filters_js_1 = requireFilters();
|
|
5192
|
-
Object.defineProperty(exports$
|
|
5231
|
+
Object.defineProperty(exports$12, "filters", { enumerable: true, get: function() {
|
|
5193
5232
|
return filters_js_1.filters;
|
|
5194
5233
|
} });
|
|
5195
5234
|
var pseudos_js_1 = requirePseudos();
|
|
5196
|
-
Object.defineProperty(exports$
|
|
5235
|
+
Object.defineProperty(exports$12, "pseudos", { enumerable: true, get: function() {
|
|
5197
5236
|
return pseudos_js_1.pseudos;
|
|
5198
5237
|
} });
|
|
5199
5238
|
var aliases_js_1 = requireAliases();
|
|
5200
|
-
Object.defineProperty(exports$
|
|
5239
|
+
Object.defineProperty(exports$12, "aliases", { enumerable: true, get: function() {
|
|
5201
5240
|
return aliases_js_1.aliases;
|
|
5202
5241
|
} });
|
|
5203
5242
|
var subselects_js_1 = requireSubselects();
|
|
5204
5243
|
function compilePseudoSelector(next, selector, options, context, compileToken) {
|
|
5205
5244
|
var _a;
|
|
5206
|
-
var
|
|
5245
|
+
var name2 = selector.name, data = selector.data;
|
|
5207
5246
|
if (Array.isArray(data)) {
|
|
5208
|
-
if (!(
|
|
5209
|
-
throw new Error("Unknown pseudo-class :".concat(
|
|
5247
|
+
if (!(name2 in subselects_js_1.subselects)) {
|
|
5248
|
+
throw new Error("Unknown pseudo-class :".concat(name2, "(").concat(data, ")"));
|
|
5210
5249
|
}
|
|
5211
|
-
return subselects_js_1.subselects[
|
|
5250
|
+
return subselects_js_1.subselects[name2](next, data, options, context, compileToken);
|
|
5212
5251
|
}
|
|
5213
|
-
var userPseudo = (_a = options.pseudos) === null || _a === void 0 ? void 0 : _a[
|
|
5214
|
-
var stringPseudo = typeof userPseudo === "string" ? userPseudo : aliases_js_1.aliases[
|
|
5252
|
+
var userPseudo = (_a = options.pseudos) === null || _a === void 0 ? void 0 : _a[name2];
|
|
5253
|
+
var stringPseudo = typeof userPseudo === "string" ? userPseudo : aliases_js_1.aliases[name2];
|
|
5215
5254
|
if (typeof stringPseudo === "string") {
|
|
5216
5255
|
if (data != null) {
|
|
5217
|
-
throw new Error("Pseudo ".concat(
|
|
5256
|
+
throw new Error("Pseudo ".concat(name2, " doesn't have any arguments"));
|
|
5218
5257
|
}
|
|
5219
5258
|
var alias = (0, css_what_1.parse)(stringPseudo);
|
|
5220
5259
|
return subselects_js_1.subselects["is"](next, alias, options, context, compileToken);
|
|
5221
5260
|
}
|
|
5222
5261
|
if (typeof userPseudo === "function") {
|
|
5223
|
-
(0, pseudos_js_1.verifyPseudoArgs)(userPseudo,
|
|
5262
|
+
(0, pseudos_js_1.verifyPseudoArgs)(userPseudo, name2, data, 1);
|
|
5224
5263
|
return function(elem) {
|
|
5225
5264
|
return userPseudo(elem, data) && next(elem);
|
|
5226
5265
|
};
|
|
5227
5266
|
}
|
|
5228
|
-
if (
|
|
5229
|
-
return filters_js_1.filters[
|
|
5267
|
+
if (name2 in filters_js_1.filters) {
|
|
5268
|
+
return filters_js_1.filters[name2](next, data, options, context);
|
|
5230
5269
|
}
|
|
5231
|
-
if (
|
|
5232
|
-
var pseudo_1 = pseudos_js_1.pseudos[
|
|
5233
|
-
(0, pseudos_js_1.verifyPseudoArgs)(pseudo_1,
|
|
5270
|
+
if (name2 in pseudos_js_1.pseudos) {
|
|
5271
|
+
var pseudo_1 = pseudos_js_1.pseudos[name2];
|
|
5272
|
+
(0, pseudos_js_1.verifyPseudoArgs)(pseudo_1, name2, data, 2);
|
|
5234
5273
|
return function(elem) {
|
|
5235
5274
|
return pseudo_1(elem, options, data) && next(elem);
|
|
5236
5275
|
};
|
|
5237
5276
|
}
|
|
5238
|
-
throw new Error("Unknown pseudo-class :".concat(
|
|
5277
|
+
throw new Error("Unknown pseudo-class :".concat(name2));
|
|
5239
5278
|
}
|
|
5240
|
-
exports$
|
|
5279
|
+
exports$12.compilePseudoSelector = compilePseudoSelector;
|
|
5241
5280
|
})(pseudoSelectors);
|
|
5242
5281
|
return pseudoSelectors;
|
|
5243
5282
|
}
|
|
@@ -5522,7 +5561,7 @@ var hasRequiredLib;
|
|
|
5522
5561
|
function requireLib() {
|
|
5523
5562
|
if (hasRequiredLib) return lib$6;
|
|
5524
5563
|
hasRequiredLib = 1;
|
|
5525
|
-
(function(exports$
|
|
5564
|
+
(function(exports$12) {
|
|
5526
5565
|
var __createBinding = lib$6 && lib$6.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
5527
5566
|
if (k2 === void 0) k2 = k;
|
|
5528
5567
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -5553,8 +5592,8 @@ function requireLib() {
|
|
|
5553
5592
|
var __importDefault = lib$6 && lib$6.__importDefault || function(mod) {
|
|
5554
5593
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
5555
5594
|
};
|
|
5556
|
-
Object.defineProperty(exports$
|
|
5557
|
-
exports$
|
|
5595
|
+
Object.defineProperty(exports$12, "__esModule", { value: true });
|
|
5596
|
+
exports$12.aliases = exports$12.pseudos = exports$12.filters = exports$12.is = exports$12.selectOne = exports$12.selectAll = exports$12.prepareContext = exports$12._compileToken = exports$12._compileUnsafe = exports$12.compile = void 0;
|
|
5558
5597
|
var DomUtils = __importStar(/* @__PURE__ */ requireLib$2());
|
|
5559
5598
|
var boolbase_1 = __importDefault(requireBoolbase());
|
|
5560
5599
|
var compile_js_1 = requireCompile();
|
|
@@ -5579,9 +5618,9 @@ function requireLib() {
|
|
|
5579
5618
|
return func(selector, opts, context);
|
|
5580
5619
|
};
|
|
5581
5620
|
}
|
|
5582
|
-
exports$
|
|
5583
|
-
exports$
|
|
5584
|
-
exports$
|
|
5621
|
+
exports$12.compile = wrapCompile(compile_js_1.compile);
|
|
5622
|
+
exports$12._compileUnsafe = wrapCompile(compile_js_1.compileUnsafe);
|
|
5623
|
+
exports$12._compileToken = wrapCompile(compile_js_1.compileToken);
|
|
5585
5624
|
function getSelectorFunc(searchFunc) {
|
|
5586
5625
|
return function select(query, elements, options) {
|
|
5587
5626
|
var opts = convertOptionFormats(options);
|
|
@@ -5601,7 +5640,7 @@ function requireLib() {
|
|
|
5601
5640
|
}
|
|
5602
5641
|
return Array.isArray(elems) ? adapter.removeSubsets(elems) : adapter.getChildren(elems);
|
|
5603
5642
|
}
|
|
5604
|
-
exports$
|
|
5643
|
+
exports$12.prepareContext = prepareContext;
|
|
5605
5644
|
function appendNextSiblings(elem, adapter) {
|
|
5606
5645
|
var elems = Array.isArray(elem) ? elem.slice(0) : [elem];
|
|
5607
5646
|
var elemsLength = elems.length;
|
|
@@ -5611,26 +5650,26 @@ function requireLib() {
|
|
|
5611
5650
|
}
|
|
5612
5651
|
return elems;
|
|
5613
5652
|
}
|
|
5614
|
-
exports$
|
|
5653
|
+
exports$12.selectAll = getSelectorFunc(function(query, elems, options) {
|
|
5615
5654
|
return query === boolbase_1.default.falseFunc || !elems || elems.length === 0 ? [] : options.adapter.findAll(query, elems);
|
|
5616
5655
|
});
|
|
5617
|
-
exports$
|
|
5656
|
+
exports$12.selectOne = getSelectorFunc(function(query, elems, options) {
|
|
5618
5657
|
return query === boolbase_1.default.falseFunc || !elems || elems.length === 0 ? null : options.adapter.findOne(query, elems);
|
|
5619
5658
|
});
|
|
5620
5659
|
function is(elem, query, options) {
|
|
5621
5660
|
var opts = convertOptionFormats(options);
|
|
5622
5661
|
return (typeof query === "function" ? query : (0, compile_js_1.compile)(query, opts))(elem);
|
|
5623
5662
|
}
|
|
5624
|
-
exports$
|
|
5625
|
-
exports$
|
|
5663
|
+
exports$12.is = is;
|
|
5664
|
+
exports$12.default = exports$12.selectAll;
|
|
5626
5665
|
var index_js_1 = requirePseudoSelectors();
|
|
5627
|
-
Object.defineProperty(exports$
|
|
5666
|
+
Object.defineProperty(exports$12, "filters", { enumerable: true, get: function() {
|
|
5628
5667
|
return index_js_1.filters;
|
|
5629
5668
|
} });
|
|
5630
|
-
Object.defineProperty(exports$
|
|
5669
|
+
Object.defineProperty(exports$12, "pseudos", { enumerable: true, get: function() {
|
|
5631
5670
|
return index_js_1.pseudos;
|
|
5632
5671
|
} });
|
|
5633
|
-
Object.defineProperty(exports$
|
|
5672
|
+
Object.defineProperty(exports$12, "aliases", { enumerable: true, get: function() {
|
|
5634
5673
|
return index_js_1.aliases;
|
|
5635
5674
|
} });
|
|
5636
5675
|
})(lib$6);
|
|
@@ -5661,8 +5700,8 @@ function requireMatcher() {
|
|
|
5661
5700
|
function isTag(node2) {
|
|
5662
5701
|
return node2 && node2.nodeType === type_1.default.ELEMENT_NODE;
|
|
5663
5702
|
}
|
|
5664
|
-
function getAttributeValue(elem,
|
|
5665
|
-
return isTag(elem) ? elem.getAttribute(
|
|
5703
|
+
function getAttributeValue(elem, name2) {
|
|
5704
|
+
return isTag(elem) ? elem.getAttribute(name2) : void 0;
|
|
5666
5705
|
}
|
|
5667
5706
|
function getName(elem) {
|
|
5668
5707
|
return (elem && elem.rawTagName || "").toLowerCase();
|
|
@@ -5708,8 +5747,8 @@ function requireMatcher() {
|
|
|
5708
5747
|
const parent = getParent(node2);
|
|
5709
5748
|
return parent ? getChildren2(parent) : [];
|
|
5710
5749
|
}
|
|
5711
|
-
function hasAttrib(elem,
|
|
5712
|
-
return getAttributeValue(elem,
|
|
5750
|
+
function hasAttrib(elem, name2) {
|
|
5751
|
+
return getAttributeValue(elem, name2) !== void 0;
|
|
5713
5752
|
}
|
|
5714
5753
|
function findOne(test, elems) {
|
|
5715
5754
|
let elem = null;
|
|
@@ -6463,11 +6502,11 @@ function requireHtml() {
|
|
|
6463
6502
|
if (this._attrs) {
|
|
6464
6503
|
delete this._attrs[key];
|
|
6465
6504
|
}
|
|
6466
|
-
this.rawAttrs = Object.keys(attrs).map((
|
|
6467
|
-
const val = this.quoteAttribute(attrs[
|
|
6505
|
+
this.rawAttrs = Object.keys(attrs).map((name2) => {
|
|
6506
|
+
const val = this.quoteAttribute(attrs[name2]);
|
|
6468
6507
|
if (val === "null" || val === '""')
|
|
6469
|
-
return
|
|
6470
|
-
return `${
|
|
6508
|
+
return name2;
|
|
6509
|
+
return `${name2}=${val}`;
|
|
6471
6510
|
}).join(" ");
|
|
6472
6511
|
if (key === "id") {
|
|
6473
6512
|
this._id = "";
|
|
@@ -6505,11 +6544,11 @@ function requireHtml() {
|
|
|
6505
6544
|
if (this._attrs) {
|
|
6506
6545
|
this._attrs[k2] = decode2(attrs[key]);
|
|
6507
6546
|
}
|
|
6508
|
-
this.rawAttrs = Object.keys(attrs).map((
|
|
6509
|
-
const val = this.quoteAttribute(attrs[
|
|
6547
|
+
this.rawAttrs = Object.keys(attrs).map((name2) => {
|
|
6548
|
+
const val = this.quoteAttribute(attrs[name2]);
|
|
6510
6549
|
if (val === "null" || val === '""')
|
|
6511
|
-
return
|
|
6512
|
-
return `${
|
|
6550
|
+
return name2;
|
|
6551
|
+
return `${name2}=${val}`;
|
|
6513
6552
|
}).join(" ");
|
|
6514
6553
|
if (key === "id") {
|
|
6515
6554
|
this._id = value;
|
|
@@ -6527,11 +6566,11 @@ function requireHtml() {
|
|
|
6527
6566
|
if (this._rawAttrs) {
|
|
6528
6567
|
delete this._rawAttrs;
|
|
6529
6568
|
}
|
|
6530
|
-
this.rawAttrs = Object.keys(attributes2).map((
|
|
6531
|
-
const val = attributes2[
|
|
6569
|
+
this.rawAttrs = Object.keys(attributes2).map((name2) => {
|
|
6570
|
+
const val = attributes2[name2];
|
|
6532
6571
|
if (val === "null" || val === '""')
|
|
6533
|
-
return
|
|
6534
|
-
return `${
|
|
6572
|
+
return name2;
|
|
6573
|
+
return `${name2}=${this.quoteAttribute(String(val))}`;
|
|
6535
6574
|
}).join(" ");
|
|
6536
6575
|
if ("id" in attributes2) {
|
|
6537
6576
|
this._id = attributes2["id"];
|
|
@@ -6925,11 +6964,11 @@ var hasRequiredParse;
|
|
|
6925
6964
|
function requireParse() {
|
|
6926
6965
|
if (hasRequiredParse) return parse;
|
|
6927
6966
|
hasRequiredParse = 1;
|
|
6928
|
-
(function(exports$
|
|
6929
|
-
Object.defineProperty(exports$
|
|
6930
|
-
exports$
|
|
6967
|
+
(function(exports$12) {
|
|
6968
|
+
Object.defineProperty(exports$12, "__esModule", { value: true });
|
|
6969
|
+
exports$12.default = void 0;
|
|
6931
6970
|
var html_1 = /* @__PURE__ */ requireHtml();
|
|
6932
|
-
Object.defineProperty(exports$
|
|
6971
|
+
Object.defineProperty(exports$12, "default", { enumerable: true, get: function() {
|
|
6933
6972
|
return html_1.parse;
|
|
6934
6973
|
} });
|
|
6935
6974
|
})(parse);
|
|
@@ -7290,15 +7329,15 @@ function parseAuthorName(commaPart) {
|
|
|
7290
7329
|
return null;
|
|
7291
7330
|
if (/^\d/.test(firstLine))
|
|
7292
7331
|
return null;
|
|
7293
|
-
const
|
|
7294
|
-
if (!
|
|
7332
|
+
const name2 = firstLine.replace(/\d+$/, "").trim();
|
|
7333
|
+
if (!name2)
|
|
7295
7334
|
return null;
|
|
7296
|
-
const words =
|
|
7297
|
-
const surname = words.pop() ??
|
|
7298
|
-
const
|
|
7335
|
+
const words = name2.split(/\s+/);
|
|
7336
|
+
const surname = words.pop() ?? name2;
|
|
7337
|
+
const author2 = { surname };
|
|
7299
7338
|
if (words.length > 0)
|
|
7300
|
-
|
|
7301
|
-
return
|
|
7339
|
+
author2.givenNames = words.join(" ");
|
|
7340
|
+
return author2;
|
|
7302
7341
|
}
|
|
7303
7342
|
function parseAuthors$1(root) {
|
|
7304
7343
|
const authors = [];
|
|
@@ -7307,9 +7346,9 @@ function parseAuthors$1(root) {
|
|
|
7307
7346
|
if (!fullText)
|
|
7308
7347
|
continue;
|
|
7309
7348
|
for (const part of fullText.split(",")) {
|
|
7310
|
-
const
|
|
7311
|
-
if (
|
|
7312
|
-
authors.push(
|
|
7349
|
+
const author2 = parseAuthorName(part);
|
|
7350
|
+
if (author2)
|
|
7351
|
+
authors.push(author2);
|
|
7313
7352
|
}
|
|
7314
7353
|
}
|
|
7315
7354
|
return authors;
|
|
@@ -7333,12 +7372,12 @@ function parseMetadata(root) {
|
|
|
7333
7372
|
const authors = parseAuthors$1(root);
|
|
7334
7373
|
const abstract = parseAbstract$1(root);
|
|
7335
7374
|
const keywordEls = qa(root, ".ltx_keywords .ltx_text");
|
|
7336
|
-
const
|
|
7375
|
+
const keywords2 = keywordEls.map((kw) => kw.textContent.trim()).filter(Boolean);
|
|
7337
7376
|
const metadata = { title, authors };
|
|
7338
7377
|
if (abstract)
|
|
7339
7378
|
metadata.abstract = abstract;
|
|
7340
|
-
if (
|
|
7341
|
-
metadata.keywords =
|
|
7379
|
+
if (keywords2.length > 0)
|
|
7380
|
+
metadata.keywords = keywords2;
|
|
7342
7381
|
return metadata;
|
|
7343
7382
|
}
|
|
7344
7383
|
function extractRefText(item) {
|
|
@@ -8081,11 +8120,11 @@ function hasSeq(data, seq, i) {
|
|
|
8081
8120
|
}
|
|
8082
8121
|
return true;
|
|
8083
8122
|
}
|
|
8084
|
-
function validateEntityName(
|
|
8085
|
-
if (isName(
|
|
8086
|
-
return
|
|
8123
|
+
function validateEntityName(name2) {
|
|
8124
|
+
if (isName(name2))
|
|
8125
|
+
return name2;
|
|
8087
8126
|
else
|
|
8088
|
-
throw new Error(`Invalid entity name ${
|
|
8127
|
+
throw new Error(`Invalid entity name ${name2}`);
|
|
8089
8128
|
}
|
|
8090
8129
|
const hexRegex = /^[-+]?0x[a-fA-F0-9]+$/;
|
|
8091
8130
|
const numRegex = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/;
|
|
@@ -9016,14 +9055,14 @@ function parseAuthors(metaChildren) {
|
|
|
9016
9055
|
continue;
|
|
9017
9056
|
const surnameNode = findChild(nameNode.children, "surname");
|
|
9018
9057
|
const givenNamesNode = findChild(nameNode.children, "given-names");
|
|
9019
|
-
const
|
|
9058
|
+
const author2 = {
|
|
9020
9059
|
surname: surnameNode ? extractAllText(surnameNode.children) : ""
|
|
9021
9060
|
};
|
|
9022
9061
|
const givenNames = givenNamesNode ? extractAllText(givenNamesNode.children) : "";
|
|
9023
9062
|
if (givenNames) {
|
|
9024
|
-
|
|
9063
|
+
author2.givenNames = givenNames;
|
|
9025
9064
|
}
|
|
9026
|
-
authors.push(
|
|
9065
|
+
authors.push(author2);
|
|
9027
9066
|
}
|
|
9028
9067
|
return authors;
|
|
9029
9068
|
}
|
|
@@ -9105,16 +9144,16 @@ function parseLicense(metaChildren) {
|
|
|
9105
9144
|
}
|
|
9106
9145
|
function parseKeywords(metaChildren) {
|
|
9107
9146
|
const kwdGroups = findChildren(metaChildren, "kwd-group");
|
|
9108
|
-
const
|
|
9147
|
+
const keywords2 = [];
|
|
9109
9148
|
for (const kwdGroup of kwdGroups) {
|
|
9110
9149
|
const kwds = findChildren(kwdGroup.children, "kwd");
|
|
9111
9150
|
for (const kwd of kwds) {
|
|
9112
9151
|
const text2 = extractAllText(kwd.children).trim();
|
|
9113
9152
|
if (text2)
|
|
9114
|
-
|
|
9153
|
+
keywords2.push(text2);
|
|
9115
9154
|
}
|
|
9116
9155
|
}
|
|
9117
|
-
return
|
|
9156
|
+
return keywords2;
|
|
9118
9157
|
}
|
|
9119
9158
|
function parseVolumeAndPages(metaChildren) {
|
|
9120
9159
|
const volumeNode = findChild(metaChildren, "volume");
|
|
@@ -9205,7 +9244,7 @@ function parseJatsMetadata(xml) {
|
|
|
9205
9244
|
const journal = parseJournalName(front.children);
|
|
9206
9245
|
const publicationDate = parsePublicationDate(metaChildren);
|
|
9207
9246
|
const articleType = article.attrs["article-type"] || void 0;
|
|
9208
|
-
const
|
|
9247
|
+
const license2 = parseLicense(metaChildren);
|
|
9209
9248
|
const abstract = parseAbstract(metaChildren);
|
|
9210
9249
|
return assembleMetadata({ title: parseArticleTitle(metaChildren), authors: parseAuthors(metaChildren) }, {
|
|
9211
9250
|
...parseArticleIds(metaChildren),
|
|
@@ -9214,7 +9253,7 @@ function parseJatsMetadata(xml) {
|
|
|
9214
9253
|
...parseVolumeAndPages(metaChildren),
|
|
9215
9254
|
keywords: parseKeywords(metaChildren),
|
|
9216
9255
|
...articleType !== void 0 ? { articleType } : {},
|
|
9217
|
-
...
|
|
9256
|
+
...license2 !== void 0 ? { license: license2 } : {},
|
|
9218
9257
|
...abstract !== void 0 ? { abstract } : {}
|
|
9219
9258
|
});
|
|
9220
9259
|
}
|
|
@@ -9629,9 +9668,9 @@ function extractCitationAuthors(children) {
|
|
|
9629
9668
|
return void 0;
|
|
9630
9669
|
const names = findChildren(personGroup.children, "name");
|
|
9631
9670
|
const authorParts = [];
|
|
9632
|
-
for (const
|
|
9633
|
-
const surname = findChild(
|
|
9634
|
-
const givenNames = findChild(
|
|
9671
|
+
for (const name2 of names) {
|
|
9672
|
+
const surname = findChild(name2.children, "surname");
|
|
9673
|
+
const givenNames = findChild(name2.children, "given-names");
|
|
9635
9674
|
const surnameText = surname ? extractAllText(surname.children) : "";
|
|
9636
9675
|
const givenText = givenNames ? extractAllText(givenNames.children) : "";
|
|
9637
9676
|
if (surnameText && givenText) {
|
|
@@ -9928,11 +9967,11 @@ function parseJatsBackMatter(xml) {
|
|
|
9928
9967
|
result.floats = floats;
|
|
9929
9968
|
return result;
|
|
9930
9969
|
}
|
|
9931
|
-
function formatAuthor(
|
|
9932
|
-
if (!
|
|
9933
|
-
return
|
|
9934
|
-
const initials =
|
|
9935
|
-
return `${
|
|
9970
|
+
function formatAuthor(author2) {
|
|
9971
|
+
if (!author2.givenNames)
|
|
9972
|
+
return author2.surname;
|
|
9973
|
+
const initials = author2.givenNames.split(/[\s.]+/).filter(Boolean).map((n) => n[0]).join("");
|
|
9974
|
+
return `${author2.surname} ${initials}`;
|
|
9936
9975
|
}
|
|
9937
9976
|
function renderInline(content) {
|
|
9938
9977
|
return content.map((node2) => {
|
|
@@ -10337,8 +10376,8 @@ async function runCheckCommand(checkCommand) {
|
|
|
10337
10376
|
class CustomPdfConverter {
|
|
10338
10377
|
name;
|
|
10339
10378
|
config;
|
|
10340
|
-
constructor(
|
|
10341
|
-
this.name =
|
|
10379
|
+
constructor(name2, config) {
|
|
10380
|
+
this.name = name2;
|
|
10342
10381
|
this.config = config;
|
|
10343
10382
|
}
|
|
10344
10383
|
async isAvailable() {
|
|
@@ -10452,18 +10491,18 @@ const BUILTIN_CONFIGS = {
|
|
|
10452
10491
|
checkCommand: 'python3 -c "import pymupdf4llm"'
|
|
10453
10492
|
}
|
|
10454
10493
|
};
|
|
10455
|
-
function getBuiltinConverter(
|
|
10456
|
-
if (!isBuiltinName(
|
|
10457
|
-
return new CustomPdfConverter(
|
|
10494
|
+
function getBuiltinConverter(name2) {
|
|
10495
|
+
if (!isBuiltinName(name2)) return void 0;
|
|
10496
|
+
return new CustomPdfConverter(name2, BUILTIN_CONFIGS[name2]);
|
|
10458
10497
|
}
|
|
10459
|
-
function isBuiltinName(
|
|
10460
|
-
return BUILTIN_CONVERTER_NAMES.includes(
|
|
10498
|
+
function isBuiltinName(name2) {
|
|
10499
|
+
return BUILTIN_CONVERTER_NAMES.includes(name2);
|
|
10461
10500
|
}
|
|
10462
|
-
async function resolveConverter(
|
|
10463
|
-
if (
|
|
10501
|
+
async function resolveConverter(name2, options) {
|
|
10502
|
+
if (name2 === "auto") {
|
|
10464
10503
|
return resolveAuto(options);
|
|
10465
10504
|
}
|
|
10466
|
-
return resolveExplicit(
|
|
10505
|
+
return resolveExplicit(name2, options);
|
|
10467
10506
|
}
|
|
10468
10507
|
async function resolveAuto(options) {
|
|
10469
10508
|
const { priority, customConverters } = options;
|
|
@@ -10481,22 +10520,22 @@ async function resolveAuto(options) {
|
|
|
10481
10520
|
hints: buildNoConverterHints(priority)
|
|
10482
10521
|
};
|
|
10483
10522
|
}
|
|
10484
|
-
async function resolveExplicit(
|
|
10485
|
-
const converter = getConverterByName(
|
|
10523
|
+
async function resolveExplicit(name2, options) {
|
|
10524
|
+
const converter = getConverterByName(name2, options.customConverters);
|
|
10486
10525
|
if (!converter) {
|
|
10487
10526
|
return {
|
|
10488
10527
|
success: false,
|
|
10489
10528
|
code: "not-installed",
|
|
10490
|
-
error: `PDF converter '${
|
|
10529
|
+
error: `PDF converter '${name2}' not found`
|
|
10491
10530
|
};
|
|
10492
10531
|
}
|
|
10493
10532
|
if (!await converter.isAvailable()) {
|
|
10494
|
-
const isBuiltin = BUILTIN_CONVERTER_NAMES.includes(
|
|
10495
|
-
const installHint = isBuiltin ? BUILTIN_CONVERTER_INFO[
|
|
10533
|
+
const isBuiltin = BUILTIN_CONVERTER_NAMES.includes(name2);
|
|
10534
|
+
const installHint = isBuiltin ? BUILTIN_CONVERTER_INFO[name2].install : void 0;
|
|
10496
10535
|
const result = {
|
|
10497
10536
|
success: false,
|
|
10498
10537
|
code: "not-installed",
|
|
10499
|
-
error: `PDF converter '${
|
|
10538
|
+
error: `PDF converter '${name2}' is not installed`
|
|
10500
10539
|
};
|
|
10501
10540
|
if (installHint) {
|
|
10502
10541
|
result.hints = `Install with: ${installHint}`;
|
|
@@ -10505,12 +10544,12 @@ async function resolveExplicit(name, options) {
|
|
|
10505
10544
|
}
|
|
10506
10545
|
return { success: true, converter };
|
|
10507
10546
|
}
|
|
10508
|
-
function getConverterByName(
|
|
10509
|
-
const customConfig = customConverters[
|
|
10547
|
+
function getConverterByName(name2, customConverters) {
|
|
10548
|
+
const customConfig = customConverters[name2];
|
|
10510
10549
|
if (customConfig) {
|
|
10511
|
-
return new CustomPdfConverter(
|
|
10550
|
+
return new CustomPdfConverter(name2, customConfig);
|
|
10512
10551
|
}
|
|
10513
|
-
return getBuiltinConverter(
|
|
10552
|
+
return getBuiltinConverter(name2);
|
|
10514
10553
|
}
|
|
10515
10554
|
function buildNoConverterHints(checked) {
|
|
10516
10555
|
const lines = [
|
|
@@ -10519,9 +10558,9 @@ function buildNoConverterHints(checked) {
|
|
|
10519
10558
|
"Install one of the following:",
|
|
10520
10559
|
""
|
|
10521
10560
|
];
|
|
10522
|
-
for (const
|
|
10523
|
-
const info = BUILTIN_CONVERTER_INFO[
|
|
10524
|
-
lines.push(` ${
|
|
10561
|
+
for (const name2 of BUILTIN_CONVERTER_NAMES) {
|
|
10562
|
+
const info = BUILTIN_CONVERTER_INFO[name2];
|
|
10563
|
+
lines.push(` ${name2.padEnd(9)} ${info.install.padEnd(28)} (${info.description})`);
|
|
10525
10564
|
}
|
|
10526
10565
|
lines.push("", "Or configure a custom converter in your config file.");
|
|
10527
10566
|
return lines.join("\n");
|
|
@@ -11088,9 +11127,9 @@ function getIdentifier(item) {
|
|
|
11088
11127
|
}
|
|
11089
11128
|
function formatBibliographyEntry(item) {
|
|
11090
11129
|
const parts = [];
|
|
11091
|
-
const
|
|
11130
|
+
const author2 = formatFirstAuthor(item);
|
|
11092
11131
|
const etAl = hasMultipleAuthors(item) ? " et al" : "";
|
|
11093
|
-
parts.push(`${
|
|
11132
|
+
parts.push(`${author2}${etAl}.`);
|
|
11094
11133
|
const journal = getJournalAbbrev(item);
|
|
11095
11134
|
if (journal) {
|
|
11096
11135
|
parts.push(`${journal}.`);
|
|
@@ -11123,10 +11162,10 @@ function getFirstAuthorFamilyName(item) {
|
|
|
11123
11162
|
return firstAuthor.family || "Unknown";
|
|
11124
11163
|
}
|
|
11125
11164
|
function formatInTextEntry(item) {
|
|
11126
|
-
const
|
|
11165
|
+
const author2 = getFirstAuthorFamilyName(item);
|
|
11127
11166
|
const etAl = hasMultipleAuthors(item) ? " et al" : "";
|
|
11128
11167
|
const year = extractYear(item);
|
|
11129
|
-
return `${
|
|
11168
|
+
return `${author2}${etAl}, ${year}`;
|
|
11130
11169
|
}
|
|
11131
11170
|
function formatBibliography(items) {
|
|
11132
11171
|
if (items.length === 0) {
|
|
@@ -11365,17 +11404,17 @@ function resolveStyle(options) {
|
|
|
11365
11404
|
};
|
|
11366
11405
|
}
|
|
11367
11406
|
function getFulltextAttachmentTypes(item) {
|
|
11368
|
-
const
|
|
11407
|
+
const types2 = [];
|
|
11369
11408
|
const attachments = item.custom?.attachments;
|
|
11370
11409
|
const fulltextFiles = findFulltextFiles(attachments);
|
|
11371
11410
|
for (const file of fulltextFiles) {
|
|
11372
11411
|
const ext = file.filename.split(".").pop()?.toLowerCase();
|
|
11373
11412
|
const format = ext ? extensionToFormat(ext) : void 0;
|
|
11374
|
-
if (format && !
|
|
11375
|
-
|
|
11413
|
+
if (format && !types2.includes(format)) {
|
|
11414
|
+
types2.push(format);
|
|
11376
11415
|
}
|
|
11377
11416
|
}
|
|
11378
|
-
return
|
|
11417
|
+
return types2;
|
|
11379
11418
|
}
|
|
11380
11419
|
async function deleteFulltextFiles(item, fulltextDirectory) {
|
|
11381
11420
|
const filesToDelete = [];
|
|
@@ -11744,6 +11783,9 @@ function getRequestsPerSecond(api, config) {
|
|
|
11744
11783
|
return RATE_LIMITS.arxiv;
|
|
11745
11784
|
}
|
|
11746
11785
|
}
|
|
11786
|
+
util.setUserAgent(
|
|
11787
|
+
`reference-manager/${packageJson.version} (https://github.com/ncukondo/reference-manager; mailto:ncukondo@gmail.com)`
|
|
11788
|
+
);
|
|
11747
11789
|
const PMC_API_BASE = "https://pmc.ncbi.nlm.nih.gov/api/ctxp/v1/pubmed/";
|
|
11748
11790
|
const DEFAULT_TIMEOUT_MS = 1e4;
|
|
11749
11791
|
const DOI_PATTERN = /^10\.\d{4,}(?:\.\d+)*\/\S+$/;
|
|
@@ -11843,6 +11885,62 @@ async function fetchPmids(pmids, config) {
|
|
|
11843
11885
|
}));
|
|
11844
11886
|
}
|
|
11845
11887
|
}
|
|
11888
|
+
const CROSSREF_API_BASE = "https://api.crossref.org/works/";
|
|
11889
|
+
function normalizeCrossrefToCsl(message) {
|
|
11890
|
+
const result = { ...message };
|
|
11891
|
+
for (const key of ["title", "container-title", "container-title-short", "ISSN"]) {
|
|
11892
|
+
if (Array.isArray(result[key])) {
|
|
11893
|
+
result[key] = result[key][0] ?? void 0;
|
|
11894
|
+
}
|
|
11895
|
+
}
|
|
11896
|
+
if (!result.id && result.DOI) {
|
|
11897
|
+
result.id = result.DOI;
|
|
11898
|
+
}
|
|
11899
|
+
return result;
|
|
11900
|
+
}
|
|
11901
|
+
async function fetchDoiViaCrossrefApi(doi) {
|
|
11902
|
+
try {
|
|
11903
|
+
const url = `${CROSSREF_API_BASE}${encodeURIComponent(doi)}`;
|
|
11904
|
+
const response = await fetch(url, {
|
|
11905
|
+
headers: {
|
|
11906
|
+
"User-Agent": `reference-manager/${packageJson.version} (https://github.com/ncukondo/reference-manager; mailto:ncukondo@gmail.com)`
|
|
11907
|
+
},
|
|
11908
|
+
signal: AbortSignal.timeout(DEFAULT_TIMEOUT_MS)
|
|
11909
|
+
});
|
|
11910
|
+
if (!response.ok) {
|
|
11911
|
+
return {
|
|
11912
|
+
success: false,
|
|
11913
|
+
error: `Crossref API responded with status ${response.status} for DOI ${doi}`,
|
|
11914
|
+
reason: response.status === 404 ? "not_found" : "fetch_error"
|
|
11915
|
+
};
|
|
11916
|
+
}
|
|
11917
|
+
const data = await response.json();
|
|
11918
|
+
if (!data.message) {
|
|
11919
|
+
return {
|
|
11920
|
+
success: false,
|
|
11921
|
+
error: `No data returned from Crossref API for DOI ${doi}`,
|
|
11922
|
+
reason: "not_found"
|
|
11923
|
+
};
|
|
11924
|
+
}
|
|
11925
|
+
const normalized = normalizeCrossrefToCsl(data.message);
|
|
11926
|
+
const parseResult = CslItemSchema.safeParse(normalized);
|
|
11927
|
+
if (!parseResult.success) {
|
|
11928
|
+
return {
|
|
11929
|
+
success: false,
|
|
11930
|
+
error: `Invalid CSL-JSON data for DOI ${doi}: ${parseResult.error.message}`,
|
|
11931
|
+
reason: "validation_error"
|
|
11932
|
+
};
|
|
11933
|
+
}
|
|
11934
|
+
return { success: true, item: parseResult.data };
|
|
11935
|
+
} catch (error) {
|
|
11936
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
11937
|
+
return {
|
|
11938
|
+
success: false,
|
|
11939
|
+
error: errorMsg,
|
|
11940
|
+
reason: "fetch_error"
|
|
11941
|
+
};
|
|
11942
|
+
}
|
|
11943
|
+
}
|
|
11846
11944
|
async function fetchDoi(doi) {
|
|
11847
11945
|
if (!DOI_PATTERN.test(doi)) {
|
|
11848
11946
|
return {
|
|
@@ -11872,13 +11970,8 @@ async function fetchDoi(doi) {
|
|
|
11872
11970
|
};
|
|
11873
11971
|
}
|
|
11874
11972
|
return { success: true, item: parseResult.data };
|
|
11875
|
-
} catch
|
|
11876
|
-
|
|
11877
|
-
return {
|
|
11878
|
-
success: false,
|
|
11879
|
-
error: errorMsg,
|
|
11880
|
-
reason: "fetch_error"
|
|
11881
|
-
};
|
|
11973
|
+
} catch {
|
|
11974
|
+
return fetchDoiViaCrossrefApi(doi);
|
|
11882
11975
|
}
|
|
11883
11976
|
}
|
|
11884
11977
|
const ISBN10_PATTERN = /^\d{9}[\dX]$/;
|
|
@@ -11931,9 +12024,9 @@ function extractAuthors(entryXml) {
|
|
|
11931
12024
|
const authors = [];
|
|
11932
12025
|
const matches = entryXml.matchAll(/<author>[\s\S]*?<name>([^<]+)<\/name>[\s\S]*?<\/author>/g);
|
|
11933
12026
|
for (const match of matches) {
|
|
11934
|
-
const
|
|
11935
|
-
if (
|
|
11936
|
-
authors.push({ literal:
|
|
12027
|
+
const name2 = match[1]?.trim();
|
|
12028
|
+
if (name2) {
|
|
12029
|
+
authors.push({ literal: name2 });
|
|
11937
12030
|
}
|
|
11938
12031
|
}
|
|
11939
12032
|
return authors;
|
|
@@ -12780,7 +12873,7 @@ function createAddRoute(library, config) {
|
|
|
12780
12873
|
}
|
|
12781
12874
|
const CHECK_CONCURRENCY = 5;
|
|
12782
12875
|
async function checkReferences(library, options) {
|
|
12783
|
-
const { checkReference } = await import("./checker-
|
|
12876
|
+
const { checkReference } = await import("./checker-DMyZFCaP.js");
|
|
12784
12877
|
const save = options.save !== false;
|
|
12785
12878
|
const skipDays = options.skipDays ?? 7;
|
|
12786
12879
|
const items = await resolveItems(library, options);
|
|
@@ -13437,11 +13530,14 @@ async function startServerWithFileWatcher(libraryPath, config) {
|
|
|
13437
13530
|
};
|
|
13438
13531
|
}
|
|
13439
13532
|
export {
|
|
13440
|
-
|
|
13533
|
+
remove as A,
|
|
13441
13534
|
BUILTIN_STYLES as B,
|
|
13442
|
-
|
|
13443
|
-
|
|
13444
|
-
|
|
13535
|
+
fetcher as C,
|
|
13536
|
+
add as D,
|
|
13537
|
+
check as E,
|
|
13538
|
+
cite as F,
|
|
13539
|
+
list as G,
|
|
13540
|
+
search as H,
|
|
13445
13541
|
RESERVED_ROLES as R,
|
|
13446
13542
|
addAttachment as a,
|
|
13447
13543
|
generateFilename as b,
|
|
@@ -13462,12 +13558,12 @@ export {
|
|
|
13462
13558
|
fulltextGet as q,
|
|
13463
13559
|
getExtension as r,
|
|
13464
13560
|
getDefaultExportFromCjs as s,
|
|
13465
|
-
|
|
13466
|
-
|
|
13467
|
-
|
|
13468
|
-
|
|
13469
|
-
|
|
13470
|
-
|
|
13471
|
-
|
|
13561
|
+
packageJson as t,
|
|
13562
|
+
getFulltextAttachmentTypes as u,
|
|
13563
|
+
startServerWithFileWatcher as v,
|
|
13564
|
+
BUILTIN_CONVERTER_NAMES as w,
|
|
13565
|
+
BUILTIN_CONVERTER_INFO as x,
|
|
13566
|
+
createServer as y,
|
|
13567
|
+
fetch$1 as z
|
|
13472
13568
|
};
|
|
13473
|
-
//# sourceMappingURL=index-
|
|
13569
|
+
//# sourceMappingURL=index-CS8S6gE4.js.map
|