@agentdocumentformat/cli 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +45 -0
- package/dist/adf.mjs +162 -0
- package/dist/chunks/APEv2Parser-2CNNHMXV.mjs +22 -0
- package/dist/chunks/AiffParser-7BR4RL6G.mjs +162 -0
- package/dist/chunks/App-L5L37JI5.mjs +16747 -0
- package/dist/chunks/AsfParser-VVRSLFOM.mjs +538 -0
- package/dist/chunks/DsdiffParser-CMD4AX7A.mjs +156 -0
- package/dist/chunks/DsfParser-UOGZDS2M.mjs +94 -0
- package/dist/chunks/FlacParser-HB3T3CD4.mjs +23 -0
- package/dist/chunks/MP4Parser-66HBRUSX.mjs +973 -0
- package/dist/chunks/MatroskaParser-J3HUIMEW.mjs +579 -0
- package/dist/chunks/MpegParser-YW6LIUEW.mjs +442 -0
- package/dist/chunks/MusepackParser-PAUSXP7D.mjs +252 -0
- package/dist/chunks/OggParser-NUBV3GWC.mjs +359 -0
- package/dist/chunks/WavPackParser-WQAGT7TC.mjs +171 -0
- package/dist/chunks/WaveParser-EWLQVDX4.mjs +238 -0
- package/dist/chunks/adf-schema-JRU2BTOG.mjs +62 -0
- package/dist/chunks/build-QF5W473T.mjs +60 -0
- package/dist/chunks/chatgpt-subscription-BQGWYZXE.mjs +23 -0
- package/dist/chunks/chunk-2DIECGFL.mjs +6 -0
- package/dist/chunks/chunk-2NAP2ZF7.mjs +60 -0
- package/dist/chunks/chunk-3AT7IIP7.mjs +25696 -0
- package/dist/chunks/chunk-3GNIDM53.mjs +35 -0
- package/dist/chunks/chunk-3M4ZPOA3.mjs +1477 -0
- package/dist/chunks/chunk-4MQPTCXY.mjs +510 -0
- package/dist/chunks/chunk-5PO5PKRV.mjs +366 -0
- package/dist/chunks/chunk-5QU5VY7N.mjs +52 -0
- package/dist/chunks/chunk-5W7KES6P.mjs +436 -0
- package/dist/chunks/chunk-62NE4LG4.mjs +61 -0
- package/dist/chunks/chunk-64OKE4X3.mjs +45 -0
- package/dist/chunks/chunk-6GJ4QHRI.mjs +1278 -0
- package/dist/chunks/chunk-6VQEXLE2.mjs +144 -0
- package/dist/chunks/chunk-6XUV6EK6.mjs +41 -0
- package/dist/chunks/chunk-776TSXEP.mjs +43 -0
- package/dist/chunks/chunk-7CV2SA3H.mjs +285 -0
- package/dist/chunks/chunk-7MTRVW2U.mjs +3103 -0
- package/dist/chunks/chunk-7N2R2VCG.mjs +1434 -0
- package/dist/chunks/chunk-7T2YMTWL.mjs +374 -0
- package/dist/chunks/chunk-7XYNI52E.mjs +149 -0
- package/dist/chunks/chunk-APHX6HSV.mjs +7731 -0
- package/dist/chunks/chunk-APRU6PHC.mjs +40 -0
- package/dist/chunks/chunk-AUYKRQPJ.mjs +499 -0
- package/dist/chunks/chunk-DXWDD5XJ.mjs +136 -0
- package/dist/chunks/chunk-EWL5FG4I.mjs +39 -0
- package/dist/chunks/chunk-EYX2YLJW.mjs +117 -0
- package/dist/chunks/chunk-F5ELW46V.mjs +27 -0
- package/dist/chunks/chunk-G426FACA.mjs +49 -0
- package/dist/chunks/chunk-GEKSJHIV.mjs +2472 -0
- package/dist/chunks/chunk-HBUENVQL.mjs +570 -0
- package/dist/chunks/chunk-HPVFJYXR.mjs +112 -0
- package/dist/chunks/chunk-HWLWPXQ7.mjs +721 -0
- package/dist/chunks/chunk-I2HJYHFT.mjs +665 -0
- package/dist/chunks/chunk-I3UYSITV.mjs +68 -0
- package/dist/chunks/chunk-IC4JDZCI.mjs +3864 -0
- package/dist/chunks/chunk-IHDDCZBS.mjs +112 -0
- package/dist/chunks/chunk-IIGMZHQQ.mjs +10416 -0
- package/dist/chunks/chunk-KWFOS5WC.mjs +41 -0
- package/dist/chunks/chunk-LAZIXV2F.mjs +5290 -0
- package/dist/chunks/chunk-LFMB4PAA.mjs +10814 -0
- package/dist/chunks/chunk-M2RX3S2T.mjs +49 -0
- package/dist/chunks/chunk-M3WPIJYM.mjs +65 -0
- package/dist/chunks/chunk-NBTUWMGP.mjs +263 -0
- package/dist/chunks/chunk-NGK6PVSF.mjs +2676 -0
- package/dist/chunks/chunk-NZ7JTHEO.mjs +85 -0
- package/dist/chunks/chunk-OQN33RGQ.mjs +52 -0
- package/dist/chunks/chunk-RIX34QHC.mjs +2935 -0
- package/dist/chunks/chunk-SGUTYISF.mjs +16 -0
- package/dist/chunks/chunk-SLJ5L7PY.mjs +1473 -0
- package/dist/chunks/chunk-SLUKGXKH.mjs +68 -0
- package/dist/chunks/chunk-TMT32MXT.mjs +419 -0
- package/dist/chunks/chunk-UYY5M2PB.mjs +151 -0
- package/dist/chunks/chunk-VAUOM3IN.mjs +298 -0
- package/dist/chunks/chunk-VMHTYDH4.mjs +172 -0
- package/dist/chunks/chunk-VZS54AA5.mjs +200 -0
- package/dist/chunks/chunk-WFQUVXML.mjs +295 -0
- package/dist/chunks/chunk-X34PDRUH.mjs +809 -0
- package/dist/chunks/chunk-XNPZBLYL.mjs +33 -0
- package/dist/chunks/chunk-XX7OSWTO.mjs +157 -0
- package/dist/chunks/chunk-XYTWGHFS.mjs +600 -0
- package/dist/chunks/chunk-XYV3VCIX.mjs +336 -0
- package/dist/chunks/chunk-Y5ZLKFLE.mjs +1469 -0
- package/dist/chunks/chunk-ZJKXHM4Q.mjs +230 -0
- package/dist/chunks/cli-TCMBNZF6.mjs +1030 -0
- package/dist/chunks/commands-DTEKM4ZL.mjs +20 -0
- package/dist/chunks/daemon-ZC3FZ2P4.mjs +112449 -0
- package/dist/chunks/daemon-control-WDX7PMTC.mjs +300 -0
- package/dist/chunks/daemon-token-WRSULP7G.mjs +23 -0
- package/dist/chunks/devtools-H7CI2ZVG.mjs +85 -0
- package/dist/chunks/discord-IWDQJA7A.mjs +70588 -0
- package/dist/chunks/dist-C57KYFS2.mjs +4952 -0
- package/dist/chunks/dist-I3XBAGDL.mjs +11 -0
- package/dist/chunks/email-V4Q4VJON.mjs +58679 -0
- package/dist/chunks/environment-NX277MQG.mjs +15 -0
- package/dist/chunks/grok-subscription-4PYX7TBF.mjs +19 -0
- package/dist/chunks/layout-EPJQNFAI.mjs +22 -0
- package/dist/chunks/lib-N7FCZWKH.mjs +4038 -0
- package/dist/chunks/open-OTQDGDH5.mjs +36 -0
- package/dist/chunks/parser-JVY2PWSM.mjs +19 -0
- package/dist/chunks/pipeline-executor-BHBSJX2K.mjs +19 -0
- package/dist/chunks/react-IUIDQ5LX.mjs +11 -0
- package/dist/chunks/screen-54BUTYCW.mjs +27 -0
- package/dist/chunks/slack-3L5QTDZX.mjs +8113 -0
- package/dist/chunks/store-WR7TZJZS.mjs +32 -0
- package/dist/chunks/telegram-5ISVFBV3.mjs +14918 -0
- package/dist/chunks/terminal-O5WO7C5U.mjs +48 -0
- package/dist/chunks/theme-NORU4J74.mjs +20 -0
- package/dist/chunks/themes-F2FKU7CP.mjs +23 -0
- package/dist/chunks/token-6G3HCMNX.mjs +54 -0
- package/dist/chunks/token-util-UXYSDQIW.mjs +12 -0
- package/dist/chunks/tui-ODVYUIMT.mjs +197 -0
- package/dist/chunks/welcome-XHXFV7SH.mjs +32 -0
- package/dist/chunks/whatsapp-XSAMNGPJ.mjs +85412 -0
- package/dist/chunks/xterm-headless-YF53XWXE.mjs +3353 -0
- package/package.json +53 -0
- package/resources/wasm/coreutils.LICENSE +18 -0
- package/resources/wasm/coreutils.wasm +0 -0
|
@@ -0,0 +1,3864 @@
|
|
|
1
|
+
import { createRequire as __adfCreateRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __adfFileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __adfDirname } from 'node:path';
|
|
4
|
+
const require = __adfCreateRequire(import.meta.url);
|
|
5
|
+
const __filename = __adfFileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __adfDirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
FORM_CONTENT_TYPE,
|
|
9
|
+
parseFormHint
|
|
10
|
+
} from "./chunk-M3WPIJYM.mjs";
|
|
11
|
+
import {
|
|
12
|
+
findAdapterRegistryEntry
|
|
13
|
+
} from "./chunk-UYY5M2PB.mjs";
|
|
14
|
+
import {
|
|
15
|
+
__commonJS,
|
|
16
|
+
__toESM
|
|
17
|
+
} from "./chunk-M2RX3S2T.mjs";
|
|
18
|
+
|
|
19
|
+
// node_modules/deepmerge/dist/cjs.js
|
|
20
|
+
var require_cjs = __commonJS({
|
|
21
|
+
"node_modules/deepmerge/dist/cjs.js"(exports, module) {
|
|
22
|
+
"use strict";
|
|
23
|
+
var isMergeableObject = function(value) {
|
|
24
|
+
return isNonNullObject(value) && !isSpecial(value);
|
|
25
|
+
};
|
|
26
|
+
function isNonNullObject(value) {
|
|
27
|
+
return !!value && typeof value == "object";
|
|
28
|
+
}
|
|
29
|
+
function isSpecial(value) {
|
|
30
|
+
var stringValue = Object.prototype.toString.call(value);
|
|
31
|
+
return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
|
|
32
|
+
}
|
|
33
|
+
var canUseSymbol = typeof Symbol == "function" && Symbol.for, REACT_ELEMENT_TYPE = canUseSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103;
|
|
34
|
+
function isReactElement(value) {
|
|
35
|
+
return value.$$typeof === REACT_ELEMENT_TYPE;
|
|
36
|
+
}
|
|
37
|
+
function emptyTarget(val) {
|
|
38
|
+
return Array.isArray(val) ? [] : {};
|
|
39
|
+
}
|
|
40
|
+
function cloneUnlessOtherwiseSpecified(value, options) {
|
|
41
|
+
return options.clone !== !1 && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
|
|
42
|
+
}
|
|
43
|
+
function defaultArrayMerge(target, source, options) {
|
|
44
|
+
return target.concat(source).map(function(element) {
|
|
45
|
+
return cloneUnlessOtherwiseSpecified(element, options);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function getMergeFunction(key, options) {
|
|
49
|
+
if (!options.customMerge)
|
|
50
|
+
return deepmerge;
|
|
51
|
+
var customMerge = options.customMerge(key);
|
|
52
|
+
return typeof customMerge == "function" ? customMerge : deepmerge;
|
|
53
|
+
}
|
|
54
|
+
function getEnumerableOwnPropertySymbols(target) {
|
|
55
|
+
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
|
|
56
|
+
return Object.propertyIsEnumerable.call(target, symbol);
|
|
57
|
+
}) : [];
|
|
58
|
+
}
|
|
59
|
+
function getKeys(target) {
|
|
60
|
+
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
|
|
61
|
+
}
|
|
62
|
+
function propertyIsOnObject(object, property) {
|
|
63
|
+
try {
|
|
64
|
+
return property in object;
|
|
65
|
+
} catch {
|
|
66
|
+
return !1;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function propertyIsUnsafe(target, key) {
|
|
70
|
+
return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
|
|
71
|
+
}
|
|
72
|
+
function mergeObject(target, source, options) {
|
|
73
|
+
var destination = {};
|
|
74
|
+
return options.isMergeableObject(target) && getKeys(target).forEach(function(key) {
|
|
75
|
+
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
|
76
|
+
}), getKeys(source).forEach(function(key) {
|
|
77
|
+
propertyIsUnsafe(target, key) || (propertyIsOnObject(target, key) && options.isMergeableObject(source[key]) ? destination[key] = getMergeFunction(key, options)(target[key], source[key], options) : destination[key] = cloneUnlessOtherwiseSpecified(source[key], options));
|
|
78
|
+
}), destination;
|
|
79
|
+
}
|
|
80
|
+
function deepmerge(target, source, options) {
|
|
81
|
+
options = options || {}, options.arrayMerge = options.arrayMerge || defaultArrayMerge, options.isMergeableObject = options.isMergeableObject || isMergeableObject, options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
|
82
|
+
var sourceIsArray = Array.isArray(source), targetIsArray = Array.isArray(target), sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
|
83
|
+
return sourceAndTargetTypesMatch ? sourceIsArray ? options.arrayMerge(target, source, options) : mergeObject(target, source, options) : cloneUnlessOtherwiseSpecified(source, options);
|
|
84
|
+
}
|
|
85
|
+
deepmerge.all = function(array, options) {
|
|
86
|
+
if (!Array.isArray(array))
|
|
87
|
+
throw new Error("first argument should be an array");
|
|
88
|
+
return array.reduce(function(prev, next) {
|
|
89
|
+
return deepmerge(prev, next, options);
|
|
90
|
+
}, {});
|
|
91
|
+
};
|
|
92
|
+
var deepmerge_1 = deepmerge;
|
|
93
|
+
module.exports = deepmerge_1;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// src/main/adapters/group-meta.ts
|
|
98
|
+
function buildGroupMeta(input) {
|
|
99
|
+
let all2 = input.participants ?? [], capped = all2.slice(0, 20), totalKnown = input.participantCount ?? all2.length;
|
|
100
|
+
return {
|
|
101
|
+
platform: input.platform,
|
|
102
|
+
chat_id: input.chatId,
|
|
103
|
+
chat_type: input.chatType,
|
|
104
|
+
title: input.title,
|
|
105
|
+
description: input.description,
|
|
106
|
+
participants: capped,
|
|
107
|
+
participant_count: totalKnown,
|
|
108
|
+
participants_truncated: capped.length < totalKnown,
|
|
109
|
+
participants_scope: input.participantsScope
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
var DEFAULT_TTL_MS = 600 * 1e3, DEFAULT_FAILURE_TTL_MS = 60 * 1e3, GroupMetaCache = class _GroupMetaCache {
|
|
113
|
+
constructor(ttlMs = DEFAULT_TTL_MS, failureTtlMs = DEFAULT_FAILURE_TTL_MS) {
|
|
114
|
+
this.ttlMs = ttlMs;
|
|
115
|
+
this.failureTtlMs = failureTtlMs;
|
|
116
|
+
}
|
|
117
|
+
ttlMs;
|
|
118
|
+
failureTtlMs;
|
|
119
|
+
entries = /* @__PURE__ */ new Map();
|
|
120
|
+
/** Entry count past which an insert of a NEW key sweeps expired entries first. */
|
|
121
|
+
static SWEEP_THRESHOLD = 64;
|
|
122
|
+
expired(entry, now) {
|
|
123
|
+
return now - entry.fetchedAt > (entry.value ? this.ttlMs : this.failureTtlMs);
|
|
124
|
+
}
|
|
125
|
+
lookup(chatId) {
|
|
126
|
+
let entry = this.entries.get(chatId);
|
|
127
|
+
return entry ? this.expired(entry, Date.now()) ? (this.entries.delete(chatId), null) : entry : null;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Store an entry, opportunistically dropping expired ones first. Without
|
|
131
|
+
* this a chat that is never looked up again keeps its entry forever — a
|
|
132
|
+
* long-lived adapter would accumulate one per chat it ever saw. Sweeping
|
|
133
|
+
* only when a NEW key pushes the map past the threshold keeps the common
|
|
134
|
+
* refresh-in-place path O(1) and needs no timer.
|
|
135
|
+
*/
|
|
136
|
+
store(chatId, value) {
|
|
137
|
+
let now = Date.now();
|
|
138
|
+
if (this.entries.size >= _GroupMetaCache.SWEEP_THRESHOLD && !this.entries.has(chatId))
|
|
139
|
+
for (let [key, entry] of this.entries)
|
|
140
|
+
this.expired(entry, now) && this.entries.delete(key);
|
|
141
|
+
this.entries.set(chatId, { value, fetchedAt: now });
|
|
142
|
+
}
|
|
143
|
+
get(chatId) {
|
|
144
|
+
return this.lookup(chatId)?.value ?? null;
|
|
145
|
+
}
|
|
146
|
+
set(chatId, value) {
|
|
147
|
+
this.store(chatId, value);
|
|
148
|
+
}
|
|
149
|
+
clear() {
|
|
150
|
+
this.entries.clear();
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Fetch-through helper: cached value if fresh, otherwise call fetch and
|
|
154
|
+
* cache the result. A fetch failure (throw or null) returns null and is
|
|
155
|
+
* negative-cached with the shorter failure TTL, so repeated failures back
|
|
156
|
+
* off instead of retrying per message — enrichment must never drop the
|
|
157
|
+
* message.
|
|
158
|
+
*/
|
|
159
|
+
async getOrFetch(chatId, fetch) {
|
|
160
|
+
let cached = this.lookup(chatId);
|
|
161
|
+
if (cached) return cached.value;
|
|
162
|
+
try {
|
|
163
|
+
let fresh = await fetch();
|
|
164
|
+
return this.store(chatId, fresh), fresh;
|
|
165
|
+
} catch {
|
|
166
|
+
return this.store(chatId, null), null;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
// node_modules/domelementtype/lib/esm/index.js
|
|
172
|
+
var ElementType;
|
|
173
|
+
(function(ElementType2) {
|
|
174
|
+
ElementType2.Root = "root", ElementType2.Text = "text", ElementType2.Directive = "directive", ElementType2.Comment = "comment", ElementType2.Script = "script", ElementType2.Style = "style", ElementType2.Tag = "tag", ElementType2.CDATA = "cdata", ElementType2.Doctype = "doctype";
|
|
175
|
+
})(ElementType || (ElementType = {}));
|
|
176
|
+
function isTag(elem) {
|
|
177
|
+
return elem.type === ElementType.Tag || elem.type === ElementType.Script || elem.type === ElementType.Style;
|
|
178
|
+
}
|
|
179
|
+
var Root = ElementType.Root, Text = ElementType.Text, Directive = ElementType.Directive, Comment = ElementType.Comment, Script = ElementType.Script, Style = ElementType.Style, Tag = ElementType.Tag, CDATA = ElementType.CDATA, Doctype = ElementType.Doctype;
|
|
180
|
+
|
|
181
|
+
// node_modules/domhandler/lib/esm/node.js
|
|
182
|
+
var Node = class {
|
|
183
|
+
constructor() {
|
|
184
|
+
this.parent = null, this.prev = null, this.next = null, this.startIndex = null, this.endIndex = null;
|
|
185
|
+
}
|
|
186
|
+
// Read-write aliases for properties
|
|
187
|
+
/**
|
|
188
|
+
* Same as {@link parent}.
|
|
189
|
+
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
190
|
+
*/
|
|
191
|
+
get parentNode() {
|
|
192
|
+
return this.parent;
|
|
193
|
+
}
|
|
194
|
+
set parentNode(parent) {
|
|
195
|
+
this.parent = parent;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Same as {@link prev}.
|
|
199
|
+
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
200
|
+
*/
|
|
201
|
+
get previousSibling() {
|
|
202
|
+
return this.prev;
|
|
203
|
+
}
|
|
204
|
+
set previousSibling(prev) {
|
|
205
|
+
this.prev = prev;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Same as {@link next}.
|
|
209
|
+
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
210
|
+
*/
|
|
211
|
+
get nextSibling() {
|
|
212
|
+
return this.next;
|
|
213
|
+
}
|
|
214
|
+
set nextSibling(next) {
|
|
215
|
+
this.next = next;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Clone this node, and optionally its children.
|
|
219
|
+
*
|
|
220
|
+
* @param recursive Clone child nodes as well.
|
|
221
|
+
* @returns A clone of the node.
|
|
222
|
+
*/
|
|
223
|
+
cloneNode(recursive = !1) {
|
|
224
|
+
return cloneNode(this, recursive);
|
|
225
|
+
}
|
|
226
|
+
}, DataNode = class extends Node {
|
|
227
|
+
/**
|
|
228
|
+
* @param data The content of the data node
|
|
229
|
+
*/
|
|
230
|
+
constructor(data) {
|
|
231
|
+
super(), this.data = data;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Same as {@link data}.
|
|
235
|
+
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
236
|
+
*/
|
|
237
|
+
get nodeValue() {
|
|
238
|
+
return this.data;
|
|
239
|
+
}
|
|
240
|
+
set nodeValue(data) {
|
|
241
|
+
this.data = data;
|
|
242
|
+
}
|
|
243
|
+
}, Text2 = class extends DataNode {
|
|
244
|
+
constructor() {
|
|
245
|
+
super(...arguments), this.type = ElementType.Text;
|
|
246
|
+
}
|
|
247
|
+
get nodeType() {
|
|
248
|
+
return 3;
|
|
249
|
+
}
|
|
250
|
+
}, Comment2 = class extends DataNode {
|
|
251
|
+
constructor() {
|
|
252
|
+
super(...arguments), this.type = ElementType.Comment;
|
|
253
|
+
}
|
|
254
|
+
get nodeType() {
|
|
255
|
+
return 8;
|
|
256
|
+
}
|
|
257
|
+
}, ProcessingInstruction = class extends DataNode {
|
|
258
|
+
constructor(name2, data) {
|
|
259
|
+
super(data), this.name = name2, this.type = ElementType.Directive;
|
|
260
|
+
}
|
|
261
|
+
get nodeType() {
|
|
262
|
+
return 1;
|
|
263
|
+
}
|
|
264
|
+
}, NodeWithChildren = class extends Node {
|
|
265
|
+
/**
|
|
266
|
+
* @param children Children of the node. Only certain node types can have children.
|
|
267
|
+
*/
|
|
268
|
+
constructor(children) {
|
|
269
|
+
super(), this.children = children;
|
|
270
|
+
}
|
|
271
|
+
// Aliases
|
|
272
|
+
/** First child of the node. */
|
|
273
|
+
get firstChild() {
|
|
274
|
+
var _a2;
|
|
275
|
+
return (_a2 = this.children[0]) !== null && _a2 !== void 0 ? _a2 : null;
|
|
276
|
+
}
|
|
277
|
+
/** Last child of the node. */
|
|
278
|
+
get lastChild() {
|
|
279
|
+
return this.children.length > 0 ? this.children[this.children.length - 1] : null;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Same as {@link children}.
|
|
283
|
+
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
284
|
+
*/
|
|
285
|
+
get childNodes() {
|
|
286
|
+
return this.children;
|
|
287
|
+
}
|
|
288
|
+
set childNodes(children) {
|
|
289
|
+
this.children = children;
|
|
290
|
+
}
|
|
291
|
+
}, CDATA2 = class extends NodeWithChildren {
|
|
292
|
+
constructor() {
|
|
293
|
+
super(...arguments), this.type = ElementType.CDATA;
|
|
294
|
+
}
|
|
295
|
+
get nodeType() {
|
|
296
|
+
return 4;
|
|
297
|
+
}
|
|
298
|
+
}, Document = class extends NodeWithChildren {
|
|
299
|
+
constructor() {
|
|
300
|
+
super(...arguments), this.type = ElementType.Root;
|
|
301
|
+
}
|
|
302
|
+
get nodeType() {
|
|
303
|
+
return 9;
|
|
304
|
+
}
|
|
305
|
+
}, Element = class extends NodeWithChildren {
|
|
306
|
+
/**
|
|
307
|
+
* @param name Name of the tag, eg. `div`, `span`.
|
|
308
|
+
* @param attribs Object mapping attribute names to attribute values.
|
|
309
|
+
* @param children Children of the node.
|
|
310
|
+
*/
|
|
311
|
+
constructor(name2, attribs, children = [], type = name2 === "script" ? ElementType.Script : name2 === "style" ? ElementType.Style : ElementType.Tag) {
|
|
312
|
+
super(children), this.name = name2, this.attribs = attribs, this.type = type;
|
|
313
|
+
}
|
|
314
|
+
get nodeType() {
|
|
315
|
+
return 1;
|
|
316
|
+
}
|
|
317
|
+
// DOM Level 1 aliases
|
|
318
|
+
/**
|
|
319
|
+
* Same as {@link name}.
|
|
320
|
+
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
321
|
+
*/
|
|
322
|
+
get tagName() {
|
|
323
|
+
return this.name;
|
|
324
|
+
}
|
|
325
|
+
set tagName(name2) {
|
|
326
|
+
this.name = name2;
|
|
327
|
+
}
|
|
328
|
+
get attributes() {
|
|
329
|
+
return Object.keys(this.attribs).map((name2) => {
|
|
330
|
+
var _a2, _b;
|
|
331
|
+
return {
|
|
332
|
+
name: name2,
|
|
333
|
+
value: this.attribs[name2],
|
|
334
|
+
namespace: (_a2 = this["x-attribsNamespace"]) === null || _a2 === void 0 ? void 0 : _a2[name2],
|
|
335
|
+
prefix: (_b = this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name2]
|
|
336
|
+
};
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
function isTag2(node) {
|
|
341
|
+
return isTag(node);
|
|
342
|
+
}
|
|
343
|
+
function isCDATA(node) {
|
|
344
|
+
return node.type === ElementType.CDATA;
|
|
345
|
+
}
|
|
346
|
+
function isText(node) {
|
|
347
|
+
return node.type === ElementType.Text;
|
|
348
|
+
}
|
|
349
|
+
function isComment(node) {
|
|
350
|
+
return node.type === ElementType.Comment;
|
|
351
|
+
}
|
|
352
|
+
function isDirective(node) {
|
|
353
|
+
return node.type === ElementType.Directive;
|
|
354
|
+
}
|
|
355
|
+
function isDocument(node) {
|
|
356
|
+
return node.type === ElementType.Root;
|
|
357
|
+
}
|
|
358
|
+
function cloneNode(node, recursive = !1) {
|
|
359
|
+
let result;
|
|
360
|
+
if (isText(node))
|
|
361
|
+
result = new Text2(node.data);
|
|
362
|
+
else if (isComment(node))
|
|
363
|
+
result = new Comment2(node.data);
|
|
364
|
+
else if (isTag2(node)) {
|
|
365
|
+
let children = recursive ? cloneChildren(node.children) : [], clone = new Element(node.name, { ...node.attribs }, children);
|
|
366
|
+
children.forEach((child) => child.parent = clone), node.namespace != null && (clone.namespace = node.namespace), node["x-attribsNamespace"] && (clone["x-attribsNamespace"] = { ...node["x-attribsNamespace"] }), node["x-attribsPrefix"] && (clone["x-attribsPrefix"] = { ...node["x-attribsPrefix"] }), result = clone;
|
|
367
|
+
} else if (isCDATA(node)) {
|
|
368
|
+
let children = recursive ? cloneChildren(node.children) : [], clone = new CDATA2(children);
|
|
369
|
+
children.forEach((child) => child.parent = clone), result = clone;
|
|
370
|
+
} else if (isDocument(node)) {
|
|
371
|
+
let children = recursive ? cloneChildren(node.children) : [], clone = new Document(children);
|
|
372
|
+
children.forEach((child) => child.parent = clone), node["x-mode"] && (clone["x-mode"] = node["x-mode"]), result = clone;
|
|
373
|
+
} else if (isDirective(node)) {
|
|
374
|
+
let instruction = new ProcessingInstruction(node.name, node.data);
|
|
375
|
+
node["x-name"] != null && (instruction["x-name"] = node["x-name"], instruction["x-publicId"] = node["x-publicId"], instruction["x-systemId"] = node["x-systemId"]), result = instruction;
|
|
376
|
+
} else
|
|
377
|
+
throw new Error(`Not implemented yet: ${node.type}`);
|
|
378
|
+
return result.startIndex = node.startIndex, result.endIndex = node.endIndex, node.sourceCodeLocation != null && (result.sourceCodeLocation = node.sourceCodeLocation), result;
|
|
379
|
+
}
|
|
380
|
+
function cloneChildren(childs) {
|
|
381
|
+
let children = childs.map((child) => cloneNode(child, !0));
|
|
382
|
+
for (let i = 1; i < children.length; i++)
|
|
383
|
+
children[i].prev = children[i - 1], children[i - 1].next = children[i];
|
|
384
|
+
return children;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// node_modules/domhandler/lib/esm/index.js
|
|
388
|
+
var defaultOpts = {
|
|
389
|
+
withStartIndices: !1,
|
|
390
|
+
withEndIndices: !1,
|
|
391
|
+
xmlMode: !1
|
|
392
|
+
}, DomHandler = class {
|
|
393
|
+
/**
|
|
394
|
+
* @param callback Called once parsing has completed.
|
|
395
|
+
* @param options Settings for the handler.
|
|
396
|
+
* @param elementCB Callback whenever a tag is closed.
|
|
397
|
+
*/
|
|
398
|
+
constructor(callback, options, elementCB) {
|
|
399
|
+
this.dom = [], this.root = new Document(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null, typeof options == "function" && (elementCB = options, options = defaultOpts), typeof callback == "object" && (options = callback, callback = void 0), this.callback = callback ?? null, this.options = options ?? defaultOpts, this.elementCB = elementCB ?? null;
|
|
400
|
+
}
|
|
401
|
+
onparserinit(parser) {
|
|
402
|
+
this.parser = parser;
|
|
403
|
+
}
|
|
404
|
+
// Resets the handler back to starting state
|
|
405
|
+
onreset() {
|
|
406
|
+
this.dom = [], this.root = new Document(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null;
|
|
407
|
+
}
|
|
408
|
+
// Signals the handler that parsing is done
|
|
409
|
+
onend() {
|
|
410
|
+
this.done || (this.done = !0, this.parser = null, this.handleCallback(null));
|
|
411
|
+
}
|
|
412
|
+
onerror(error) {
|
|
413
|
+
this.handleCallback(error);
|
|
414
|
+
}
|
|
415
|
+
onclosetag() {
|
|
416
|
+
this.lastNode = null;
|
|
417
|
+
let elem = this.tagStack.pop();
|
|
418
|
+
this.options.withEndIndices && (elem.endIndex = this.parser.endIndex), this.elementCB && this.elementCB(elem);
|
|
419
|
+
}
|
|
420
|
+
onopentag(name2, attribs) {
|
|
421
|
+
let type = this.options.xmlMode ? ElementType.Tag : void 0, element = new Element(name2, attribs, void 0, type);
|
|
422
|
+
this.addNode(element), this.tagStack.push(element);
|
|
423
|
+
}
|
|
424
|
+
ontext(data) {
|
|
425
|
+
let { lastNode } = this;
|
|
426
|
+
if (lastNode && lastNode.type === ElementType.Text)
|
|
427
|
+
lastNode.data += data, this.options.withEndIndices && (lastNode.endIndex = this.parser.endIndex);
|
|
428
|
+
else {
|
|
429
|
+
let node = new Text2(data);
|
|
430
|
+
this.addNode(node), this.lastNode = node;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
oncomment(data) {
|
|
434
|
+
if (this.lastNode && this.lastNode.type === ElementType.Comment) {
|
|
435
|
+
this.lastNode.data += data;
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
let node = new Comment2(data);
|
|
439
|
+
this.addNode(node), this.lastNode = node;
|
|
440
|
+
}
|
|
441
|
+
oncommentend() {
|
|
442
|
+
this.lastNode = null;
|
|
443
|
+
}
|
|
444
|
+
oncdatastart() {
|
|
445
|
+
let text = new Text2(""), node = new CDATA2([text]);
|
|
446
|
+
this.addNode(node), text.parent = node, this.lastNode = text;
|
|
447
|
+
}
|
|
448
|
+
oncdataend() {
|
|
449
|
+
this.lastNode = null;
|
|
450
|
+
}
|
|
451
|
+
onprocessinginstruction(name2, data) {
|
|
452
|
+
let node = new ProcessingInstruction(name2, data);
|
|
453
|
+
this.addNode(node);
|
|
454
|
+
}
|
|
455
|
+
handleCallback(error) {
|
|
456
|
+
if (typeof this.callback == "function")
|
|
457
|
+
this.callback(error, this.dom);
|
|
458
|
+
else if (error)
|
|
459
|
+
throw error;
|
|
460
|
+
}
|
|
461
|
+
addNode(node) {
|
|
462
|
+
let parent = this.tagStack[this.tagStack.length - 1], previousSibling = parent.children[parent.children.length - 1];
|
|
463
|
+
this.options.withStartIndices && (node.startIndex = this.parser.startIndex), this.options.withEndIndices && (node.endIndex = this.parser.endIndex), parent.children.push(node), previousSibling && (node.prev = previousSibling, previousSibling.next = node), node.parent = parent, this.lastNode = null;
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
// node_modules/leac/lib/leac.mjs
|
|
468
|
+
var e = /\n/g;
|
|
469
|
+
function n(n2) {
|
|
470
|
+
let o2 = [...n2.matchAll(e)].map(((e2) => e2.index || 0));
|
|
471
|
+
o2.unshift(-1);
|
|
472
|
+
let s2 = t(o2, 0, o2.length);
|
|
473
|
+
return (e2) => r(s2, e2);
|
|
474
|
+
}
|
|
475
|
+
function t(e2, n2, r2) {
|
|
476
|
+
if (r2 - n2 == 1) return { offset: e2[n2], index: n2 + 1 };
|
|
477
|
+
let o2 = Math.ceil((n2 + r2) / 2), s2 = t(e2, n2, o2), l2 = t(e2, o2, r2);
|
|
478
|
+
return { offset: s2.offset, low: s2, high: l2 };
|
|
479
|
+
}
|
|
480
|
+
function r(e2, n2) {
|
|
481
|
+
return (function(e3) {
|
|
482
|
+
return Object.prototype.hasOwnProperty.call(e3, "index");
|
|
483
|
+
})(e2) ? { line: e2.index, column: n2 - e2.offset } : r(e2.high.offset < n2 ? e2.high : e2.low, n2);
|
|
484
|
+
}
|
|
485
|
+
function o(e2, t2 = "", r2 = {}) {
|
|
486
|
+
let o2 = typeof t2 != "string" ? t2 : r2, l2 = typeof t2 == "string" ? t2 : "", c2 = e2.map(s), f = !!o2.lineNumbers;
|
|
487
|
+
return function(e3, t3 = 0) {
|
|
488
|
+
let r3 = f ? n(e3) : () => ({ line: 0, column: 0 }), o3 = t3, s2 = [];
|
|
489
|
+
e: for (; o3 < e3.length; ) {
|
|
490
|
+
let n2 = !1;
|
|
491
|
+
for (let t4 of c2) {
|
|
492
|
+
t4.regex.lastIndex = o3;
|
|
493
|
+
let c3 = t4.regex.exec(e3);
|
|
494
|
+
if (c3 && c3[0].length > 0) {
|
|
495
|
+
if (!t4.discard) {
|
|
496
|
+
let e4 = r3(o3), n3 = typeof t4.replace == "string" ? c3[0].replace(new RegExp(t4.regex.source, t4.regex.flags), t4.replace) : c3[0];
|
|
497
|
+
s2.push({ state: l2, name: t4.name, text: n3, offset: o3, len: c3[0].length, line: e4.line, column: e4.column });
|
|
498
|
+
}
|
|
499
|
+
if (o3 = t4.regex.lastIndex, n2 = !0, t4.push) {
|
|
500
|
+
let n3 = t4.push(e3, o3);
|
|
501
|
+
s2.push(...n3.tokens), o3 = n3.offset;
|
|
502
|
+
}
|
|
503
|
+
if (t4.pop) break e;
|
|
504
|
+
break;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
if (!n2) break;
|
|
508
|
+
}
|
|
509
|
+
return { tokens: s2, offset: o3, complete: e3.length <= o3 };
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
function s(e2, n2) {
|
|
513
|
+
return { ...e2, regex: l(e2, n2) };
|
|
514
|
+
}
|
|
515
|
+
function l(e2, n2) {
|
|
516
|
+
if (e2.name.length === 0) throw new Error(`Rule #${n2} has empty name, which is not allowed.`);
|
|
517
|
+
if ((function(e3) {
|
|
518
|
+
return Object.prototype.hasOwnProperty.call(e3, "regex");
|
|
519
|
+
})(e2)) return (function(e3) {
|
|
520
|
+
if (e3.global) throw new Error(`Regular expression /${e3.source}/${e3.flags} contains the global flag, which is not allowed.`);
|
|
521
|
+
return e3.sticky ? e3 : new RegExp(e3.source, e3.flags + "y");
|
|
522
|
+
})(e2.regex);
|
|
523
|
+
if ((function(e3) {
|
|
524
|
+
return Object.prototype.hasOwnProperty.call(e3, "str");
|
|
525
|
+
})(e2)) {
|
|
526
|
+
if (e2.str.length === 0) throw new Error(`Rule #${n2} ("${e2.name}") has empty "str" property, which is not allowed.`);
|
|
527
|
+
return new RegExp(c(e2.str), "y");
|
|
528
|
+
}
|
|
529
|
+
return new RegExp(c(e2.name), "y");
|
|
530
|
+
}
|
|
531
|
+
function c(e2) {
|
|
532
|
+
return e2.replace(/[-[\]{}()*+!<=:?./\\^$|#\s,]/g, "\\$&");
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// node_modules/peberminta/lib/core.mjs
|
|
536
|
+
function token(onToken, onEnd) {
|
|
537
|
+
return (data, i) => {
|
|
538
|
+
let position = i, value;
|
|
539
|
+
return i < data.tokens.length ? (value = onToken(data.tokens[i], data, i), value !== void 0 && position++) : onEnd?.(data, i), value === void 0 ? { matched: !1 } : {
|
|
540
|
+
matched: !0,
|
|
541
|
+
position,
|
|
542
|
+
value
|
|
543
|
+
};
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
function mapInner(r2, f) {
|
|
547
|
+
return r2.matched ? {
|
|
548
|
+
matched: !0,
|
|
549
|
+
position: r2.position,
|
|
550
|
+
value: f(r2.value, r2.position)
|
|
551
|
+
} : r2;
|
|
552
|
+
}
|
|
553
|
+
function mapOuter(r2, f) {
|
|
554
|
+
return r2.matched ? f(r2) : r2;
|
|
555
|
+
}
|
|
556
|
+
function map(p, mapper) {
|
|
557
|
+
return (data, i) => mapInner(p(data, i), (v, j) => mapper(v, data, i, j));
|
|
558
|
+
}
|
|
559
|
+
function option(p, def) {
|
|
560
|
+
return (data, i) => {
|
|
561
|
+
let r2 = p(data, i);
|
|
562
|
+
return r2.matched ? r2 : {
|
|
563
|
+
matched: !0,
|
|
564
|
+
position: i,
|
|
565
|
+
value: def
|
|
566
|
+
};
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
function choice(...ps) {
|
|
570
|
+
return (data, i) => {
|
|
571
|
+
for (let p of ps) {
|
|
572
|
+
let result = p(data, i);
|
|
573
|
+
if (result.matched)
|
|
574
|
+
return result;
|
|
575
|
+
}
|
|
576
|
+
return { matched: !1 };
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
function otherwise(pa, pb) {
|
|
580
|
+
return (data, i) => {
|
|
581
|
+
let r1 = pa(data, i);
|
|
582
|
+
return r1.matched ? r1 : pb(data, i);
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
function takeWhile(p, test) {
|
|
586
|
+
return (data, i) => {
|
|
587
|
+
let values = [], success = !0;
|
|
588
|
+
do {
|
|
589
|
+
let r2 = p(data, i);
|
|
590
|
+
r2.matched && test(r2.value, values.length + 1, data, i, r2.position) ? (values.push(r2.value), i = r2.position) : success = !1;
|
|
591
|
+
} while (success);
|
|
592
|
+
return {
|
|
593
|
+
matched: !0,
|
|
594
|
+
position: i,
|
|
595
|
+
value: values
|
|
596
|
+
};
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
function many(p) {
|
|
600
|
+
return takeWhile(p, () => !0);
|
|
601
|
+
}
|
|
602
|
+
function many1(p) {
|
|
603
|
+
return ab(p, many(p), (head, tail) => [head, ...tail]);
|
|
604
|
+
}
|
|
605
|
+
function ab(pa, pb, join) {
|
|
606
|
+
return (data, i) => mapOuter(pa(data, i), (ma) => mapInner(pb(data, ma.position), (vb, j) => join(ma.value, vb, data, i, j)));
|
|
607
|
+
}
|
|
608
|
+
function left(pa, pb) {
|
|
609
|
+
return ab(pa, pb, (va) => va);
|
|
610
|
+
}
|
|
611
|
+
function right(pa, pb) {
|
|
612
|
+
return ab(pa, pb, (va, vb) => vb);
|
|
613
|
+
}
|
|
614
|
+
function abc(pa, pb, pc, join) {
|
|
615
|
+
return (data, i) => mapOuter(pa(data, i), (ma) => mapOuter(pb(data, ma.position), (mb) => mapInner(pc(data, mb.position), (vc, j) => join(ma.value, mb.value, vc, data, i, j))));
|
|
616
|
+
}
|
|
617
|
+
function middle(pa, pb, pc) {
|
|
618
|
+
return abc(pa, pb, pc, (ra, rb) => rb);
|
|
619
|
+
}
|
|
620
|
+
function all(...ps) {
|
|
621
|
+
return (data, i) => {
|
|
622
|
+
let result = [], position = i;
|
|
623
|
+
for (let p of ps) {
|
|
624
|
+
let r1 = p(data, position);
|
|
625
|
+
if (r1.matched)
|
|
626
|
+
result.push(r1.value), position = r1.position;
|
|
627
|
+
else
|
|
628
|
+
return { matched: !1 };
|
|
629
|
+
}
|
|
630
|
+
return {
|
|
631
|
+
matched: !0,
|
|
632
|
+
position,
|
|
633
|
+
value: result
|
|
634
|
+
};
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
function flatten(...ps) {
|
|
638
|
+
return flatten1(all(...ps));
|
|
639
|
+
}
|
|
640
|
+
function flatten1(p) {
|
|
641
|
+
return map(p, (vs) => vs.flatMap((v) => v));
|
|
642
|
+
}
|
|
643
|
+
function chainReduce(acc, f) {
|
|
644
|
+
return (data, i) => {
|
|
645
|
+
let loop = !0, acc1 = acc, pos = i;
|
|
646
|
+
do {
|
|
647
|
+
let r2 = f(acc1, data, pos)(data, pos);
|
|
648
|
+
r2.matched ? (acc1 = r2.value, pos = r2.position) : loop = !1;
|
|
649
|
+
} while (loop);
|
|
650
|
+
return {
|
|
651
|
+
matched: !0,
|
|
652
|
+
position: pos,
|
|
653
|
+
value: acc1
|
|
654
|
+
};
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
function reduceLeft(acc, p, reducer) {
|
|
658
|
+
return chainReduce(acc, (acc2) => map(p, (v, data, i, j) => reducer(acc2, v, data, i, j)));
|
|
659
|
+
}
|
|
660
|
+
function leftAssoc2(pLeft, pOper, pRight) {
|
|
661
|
+
return chain(pLeft, (v0) => reduceLeft(v0, ab(pOper, pRight, (f, y) => [f, y]), (acc, [f, y]) => f(acc, y)));
|
|
662
|
+
}
|
|
663
|
+
function chain(p, f) {
|
|
664
|
+
return (data, i) => mapOuter(p(data, i), (m1) => f(m1.value, data, i, m1.position)(data, m1.position));
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
// node_modules/parseley/lib/parseley.mjs
|
|
668
|
+
var ws = "(?:[ \\t\\r\\n\\f]*)", nl = "(?:\\n|\\r\\n|\\r|\\f)", nonascii = "[^\\x00-\\x7F]", unicode = "(?:\\\\[0-9a-f]{1,6}(?:\\r\\n|[ \\n\\r\\t\\f])?)", escape = "(?:\\\\[^\\n\\r\\f0-9a-f])", nmstart = `(?:[_a-z]|${nonascii}|${unicode}|${escape})`, nmchar = `(?:[_a-z0-9-]|${nonascii}|${unicode}|${escape})`, name = `(?:${nmchar}+)`, ident = `(?:[-]?${nmstart}${nmchar}*)`, string1 = `'([^\\n\\r\\f\\\\']|\\\\${nl}|${nonascii}|${unicode}|${escape})*'`, string2 = `"([^\\n\\r\\f\\\\"]|\\\\${nl}|${nonascii}|${unicode}|${escape})*"`, lexSelector = o([
|
|
669
|
+
{ name: "ws", regex: new RegExp(ws) },
|
|
670
|
+
{ name: "hash", regex: new RegExp(`#${name}`, "i") },
|
|
671
|
+
{ name: "ident", regex: new RegExp(ident, "i") },
|
|
672
|
+
{ name: "str1", regex: new RegExp(string1, "i") },
|
|
673
|
+
{ name: "str2", regex: new RegExp(string2, "i") },
|
|
674
|
+
{ name: "*" },
|
|
675
|
+
{ name: "." },
|
|
676
|
+
{ name: "," },
|
|
677
|
+
{ name: "[" },
|
|
678
|
+
{ name: "]" },
|
|
679
|
+
{ name: "=" },
|
|
680
|
+
{ name: ">" },
|
|
681
|
+
{ name: "|" },
|
|
682
|
+
{ name: "+" },
|
|
683
|
+
{ name: "~" },
|
|
684
|
+
{ name: "^" },
|
|
685
|
+
{ name: "$" }
|
|
686
|
+
]), lexEscapedString = o([
|
|
687
|
+
{ name: "unicode", regex: new RegExp(unicode, "i") },
|
|
688
|
+
{ name: "escape", regex: new RegExp(escape, "i") },
|
|
689
|
+
{ name: "any", regex: new RegExp("[\\s\\S]", "i") }
|
|
690
|
+
]);
|
|
691
|
+
function sumSpec([a0, a1, a2], [b0, b1, b2]) {
|
|
692
|
+
return [a0 + b0, a1 + b1, a2 + b2];
|
|
693
|
+
}
|
|
694
|
+
function sumAllSpec(ss) {
|
|
695
|
+
return ss.reduce(sumSpec, [0, 0, 0]);
|
|
696
|
+
}
|
|
697
|
+
var unicodeEscapedSequence_ = token((t2) => t2.name === "unicode" ? String.fromCodePoint(parseInt(t2.text.slice(1), 16)) : void 0), escapedSequence_ = token((t2) => t2.name === "escape" ? t2.text.slice(1) : void 0), anyChar_ = token((t2) => t2.name === "any" ? t2.text : void 0), escapedString_ = map(many(choice(unicodeEscapedSequence_, escapedSequence_, anyChar_)), (cs) => cs.join(""));
|
|
698
|
+
function unescape(escapedString) {
|
|
699
|
+
let lexerResult = lexEscapedString(escapedString);
|
|
700
|
+
return escapedString_({ tokens: lexerResult.tokens, options: void 0 }, 0).value;
|
|
701
|
+
}
|
|
702
|
+
function literal(name2) {
|
|
703
|
+
return token((t2) => t2.name === name2 ? !0 : void 0);
|
|
704
|
+
}
|
|
705
|
+
var whitespace_ = token((t2) => t2.name === "ws" ? null : void 0), optionalWhitespace_ = option(whitespace_, null);
|
|
706
|
+
function optionallySpaced(parser) {
|
|
707
|
+
return middle(optionalWhitespace_, parser, optionalWhitespace_);
|
|
708
|
+
}
|
|
709
|
+
var identifier_ = token((t2) => t2.name === "ident" ? unescape(t2.text) : void 0), hashId_ = token((t2) => t2.name === "hash" ? unescape(t2.text.slice(1)) : void 0), string_ = token((t2) => t2.name.startsWith("str") ? unescape(t2.text.slice(1, -1)) : void 0), namespace_ = left(option(identifier_, ""), literal("|")), qualifiedName_ = otherwise(ab(namespace_, identifier_, (ns, name2) => ({ name: name2, namespace: ns })), map(identifier_, (name2) => ({ name: name2, namespace: null }))), uniSelector_ = otherwise(ab(namespace_, literal("*"), (ns) => ({ type: "universal", namespace: ns, specificity: [0, 0, 0] })), map(literal("*"), () => ({ type: "universal", namespace: null, specificity: [0, 0, 0] }))), tagSelector_ = map(qualifiedName_, ({ name: name2, namespace }) => ({
|
|
710
|
+
type: "tag",
|
|
711
|
+
name: name2,
|
|
712
|
+
namespace,
|
|
713
|
+
specificity: [0, 0, 1]
|
|
714
|
+
})), classSelector_ = ab(literal("."), identifier_, (fullstop, name2) => ({
|
|
715
|
+
type: "class",
|
|
716
|
+
name: name2,
|
|
717
|
+
specificity: [0, 1, 0]
|
|
718
|
+
})), idSelector_ = map(hashId_, (name2) => ({
|
|
719
|
+
type: "id",
|
|
720
|
+
name: name2,
|
|
721
|
+
specificity: [1, 0, 0]
|
|
722
|
+
})), attrModifier_ = token((t2) => {
|
|
723
|
+
if (t2.name === "ident") {
|
|
724
|
+
if (t2.text === "i" || t2.text === "I")
|
|
725
|
+
return "i";
|
|
726
|
+
if (t2.text === "s" || t2.text === "S")
|
|
727
|
+
return "s";
|
|
728
|
+
}
|
|
729
|
+
}), attrValue_ = otherwise(ab(string_, option(right(optionalWhitespace_, attrModifier_), null), (v, mod) => ({ value: v, modifier: mod })), ab(identifier_, option(right(whitespace_, attrModifier_), null), (v, mod) => ({ value: v, modifier: mod }))), attrMatcher_ = choice(map(literal("="), () => "="), ab(literal("~"), literal("="), () => "~="), ab(literal("|"), literal("="), () => "|="), ab(literal("^"), literal("="), () => "^="), ab(literal("$"), literal("="), () => "$="), ab(literal("*"), literal("="), () => "*=")), attrPresenceSelector_ = abc(literal("["), optionallySpaced(qualifiedName_), literal("]"), (lbr, { name: name2, namespace }) => ({
|
|
730
|
+
type: "attrPresence",
|
|
731
|
+
name: name2,
|
|
732
|
+
namespace,
|
|
733
|
+
specificity: [0, 1, 0]
|
|
734
|
+
})), attrValueSelector_ = middle(literal("["), abc(optionallySpaced(qualifiedName_), attrMatcher_, optionallySpaced(attrValue_), ({ name: name2, namespace }, matcher, { value, modifier }) => ({
|
|
735
|
+
type: "attrValue",
|
|
736
|
+
name: name2,
|
|
737
|
+
namespace,
|
|
738
|
+
matcher,
|
|
739
|
+
value,
|
|
740
|
+
modifier,
|
|
741
|
+
specificity: [0, 1, 0]
|
|
742
|
+
})), literal("]")), attrSelector_ = otherwise(attrPresenceSelector_, attrValueSelector_), typeSelector_ = otherwise(uniSelector_, tagSelector_), subclassSelector_ = choice(idSelector_, classSelector_, attrSelector_), compoundSelector_ = map(otherwise(flatten(typeSelector_, many(subclassSelector_)), many1(subclassSelector_)), (ss) => ({
|
|
743
|
+
type: "compound",
|
|
744
|
+
list: ss,
|
|
745
|
+
specificity: sumAllSpec(ss.map((s2) => s2.specificity))
|
|
746
|
+
})), combinator_ = choice(map(literal(">"), () => ">"), map(literal("+"), () => "+"), map(literal("~"), () => "~"), ab(literal("|"), literal("|"), () => "||")), combinatorSeparator_ = otherwise(optionallySpaced(combinator_), map(whitespace_, () => " ")), complexSelector_ = leftAssoc2(compoundSelector_, map(combinatorSeparator_, (c2) => (left2, right2) => ({
|
|
747
|
+
type: "compound",
|
|
748
|
+
list: [...right2.list, { type: "combinator", combinator: c2, left: left2, specificity: left2.specificity }],
|
|
749
|
+
specificity: sumSpec(left2.specificity, right2.specificity)
|
|
750
|
+
})), compoundSelector_), listSelector_ = leftAssoc2(map(complexSelector_, (s2) => ({ type: "list", list: [s2] })), map(optionallySpaced(literal(",")), () => (acc, next) => ({ type: "list", list: [...acc.list, next] })), complexSelector_);
|
|
751
|
+
function parse_(parser, str) {
|
|
752
|
+
if (!(typeof str == "string" || str instanceof String))
|
|
753
|
+
throw new Error("Expected a selector string. Actual input is not a string!");
|
|
754
|
+
let lexerResult = lexSelector(str);
|
|
755
|
+
if (!lexerResult.complete)
|
|
756
|
+
throw new Error(`The input "${str}" was only partially tokenized, stopped at offset ${lexerResult.offset}!
|
|
757
|
+
` + prettyPrintPosition(str, lexerResult.offset));
|
|
758
|
+
let result = optionallySpaced(parser)({ tokens: lexerResult.tokens, options: void 0 }, 0);
|
|
759
|
+
if (!result.matched)
|
|
760
|
+
throw new Error(`No match for "${str}" input!`);
|
|
761
|
+
if (result.position < lexerResult.tokens.length) {
|
|
762
|
+
let token2 = lexerResult.tokens[result.position];
|
|
763
|
+
throw new Error(`The input "${str}" was only partially parsed, stopped at offset ${token2.offset}!
|
|
764
|
+
` + prettyPrintPosition(str, token2.offset, token2.len));
|
|
765
|
+
}
|
|
766
|
+
return result.value;
|
|
767
|
+
}
|
|
768
|
+
function prettyPrintPosition(str, offset, len = 1) {
|
|
769
|
+
return `${str.replace(/(\t)|(\r)|(\n)/g, (m, t2, r2) => t2 ? "\u2409" : r2 ? "\u240D" : "\u240A")}
|
|
770
|
+
${"".padEnd(offset)}${"^".repeat(len)}`;
|
|
771
|
+
}
|
|
772
|
+
function parse1(str) {
|
|
773
|
+
return parse_(complexSelector_, str);
|
|
774
|
+
}
|
|
775
|
+
function serialize(selector) {
|
|
776
|
+
if (!selector.type)
|
|
777
|
+
throw new Error("This is not an AST node.");
|
|
778
|
+
switch (selector.type) {
|
|
779
|
+
case "universal":
|
|
780
|
+
return _serNs(selector.namespace) + "*";
|
|
781
|
+
case "tag":
|
|
782
|
+
return _serNs(selector.namespace) + _serIdent(selector.name);
|
|
783
|
+
case "class":
|
|
784
|
+
return "." + _serIdent(selector.name);
|
|
785
|
+
case "id":
|
|
786
|
+
return "#" + _serIdent(selector.name);
|
|
787
|
+
case "attrPresence":
|
|
788
|
+
return `[${_serNs(selector.namespace)}${_serIdent(selector.name)}]`;
|
|
789
|
+
case "attrValue":
|
|
790
|
+
return `[${_serNs(selector.namespace)}${_serIdent(selector.name)}${selector.matcher}"${_serStr(selector.value)}"${selector.modifier ? selector.modifier : ""}]`;
|
|
791
|
+
case "combinator":
|
|
792
|
+
return serialize(selector.left) + selector.combinator;
|
|
793
|
+
case "compound":
|
|
794
|
+
return selector.list.reduce((acc, node) => node.type === "combinator" ? serialize(node) + acc : acc + serialize(node), "");
|
|
795
|
+
case "list":
|
|
796
|
+
return selector.list.map(serialize).join(",");
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
function _serNs(ns) {
|
|
800
|
+
return ns || ns === "" ? _serIdent(ns) + "|" : "";
|
|
801
|
+
}
|
|
802
|
+
function _codePoint(char) {
|
|
803
|
+
return `\\${char.codePointAt(0).toString(16)} `;
|
|
804
|
+
}
|
|
805
|
+
function _serIdent(str) {
|
|
806
|
+
return str.replace(
|
|
807
|
+
/(^[0-9])|(^-[0-9])|(^-$)|([-0-9a-zA-Z_]|[^\x00-\x7F])|(\x00)|([\x01-\x1f]|\x7f)|([\s\S])/g,
|
|
808
|
+
(m, d1, d2, hy, safe, nl2, ctrl, other) => d1 ? _codePoint(d1) : d2 ? "-" + _codePoint(d2.slice(1)) : hy ? "\\-" : safe || (nl2 ? "\uFFFD" : ctrl ? _codePoint(ctrl) : "\\" + other)
|
|
809
|
+
);
|
|
810
|
+
}
|
|
811
|
+
function _serStr(str) {
|
|
812
|
+
return str.replace(
|
|
813
|
+
/(")|(\\)|(\x00)|([\x01-\x1f]|\x7f)/g,
|
|
814
|
+
(m, dq, bs, nl2, ctrl) => dq ? '\\"' : bs ? "\\\\" : nl2 ? "\uFFFD" : _codePoint(ctrl)
|
|
815
|
+
);
|
|
816
|
+
}
|
|
817
|
+
function normalize(selector) {
|
|
818
|
+
if (!selector.type)
|
|
819
|
+
throw new Error("This is not an AST node.");
|
|
820
|
+
switch (selector.type) {
|
|
821
|
+
case "compound": {
|
|
822
|
+
selector.list.forEach(normalize), selector.list.sort((a, b) => _compareArrays(_getSelectorPriority(a), _getSelectorPriority(b)));
|
|
823
|
+
break;
|
|
824
|
+
}
|
|
825
|
+
case "combinator": {
|
|
826
|
+
normalize(selector.left);
|
|
827
|
+
break;
|
|
828
|
+
}
|
|
829
|
+
case "list": {
|
|
830
|
+
selector.list.forEach(normalize), selector.list.sort((a, b) => serialize(a) < serialize(b) ? -1 : 1);
|
|
831
|
+
break;
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
return selector;
|
|
835
|
+
}
|
|
836
|
+
function _getSelectorPriority(selector) {
|
|
837
|
+
switch (selector.type) {
|
|
838
|
+
case "universal":
|
|
839
|
+
return [1];
|
|
840
|
+
case "tag":
|
|
841
|
+
return [1];
|
|
842
|
+
case "id":
|
|
843
|
+
return [2];
|
|
844
|
+
case "class":
|
|
845
|
+
return [3, selector.name];
|
|
846
|
+
case "attrPresence":
|
|
847
|
+
return [4, serialize(selector)];
|
|
848
|
+
case "attrValue":
|
|
849
|
+
return [5, serialize(selector)];
|
|
850
|
+
case "combinator":
|
|
851
|
+
return [15, serialize(selector)];
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
function compareSpecificity(a, b) {
|
|
855
|
+
return _compareArrays(a, b);
|
|
856
|
+
}
|
|
857
|
+
function _compareArrays(a, b) {
|
|
858
|
+
if (!Array.isArray(a) || !Array.isArray(b))
|
|
859
|
+
throw new Error("Arguments must be arrays.");
|
|
860
|
+
let shorter = a.length < b.length ? a.length : b.length;
|
|
861
|
+
for (let i = 0; i < shorter; i++)
|
|
862
|
+
if (a[i] !== b[i])
|
|
863
|
+
return a[i] < b[i] ? -1 : 1;
|
|
864
|
+
return a.length - b.length;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
// node_modules/selderee/lib/selderee.mjs
|
|
868
|
+
var DecisionTree = class {
|
|
869
|
+
constructor(input) {
|
|
870
|
+
this.branches = weave(toAstTerminalPairs(input));
|
|
871
|
+
}
|
|
872
|
+
build(builder) {
|
|
873
|
+
return builder(this.branches);
|
|
874
|
+
}
|
|
875
|
+
};
|
|
876
|
+
function toAstTerminalPairs(array) {
|
|
877
|
+
let len = array.length, results = new Array(len);
|
|
878
|
+
for (let i = 0; i < len; i++) {
|
|
879
|
+
let [selectorString, val] = array[i], ast = preprocess(parse1(selectorString));
|
|
880
|
+
results[i] = {
|
|
881
|
+
ast,
|
|
882
|
+
terminal: {
|
|
883
|
+
type: "terminal",
|
|
884
|
+
valueContainer: { index: i, value: val, specificity: ast.specificity }
|
|
885
|
+
}
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
return results;
|
|
889
|
+
}
|
|
890
|
+
function preprocess(ast) {
|
|
891
|
+
return reduceSelectorVariants(ast), normalize(ast), ast;
|
|
892
|
+
}
|
|
893
|
+
function reduceSelectorVariants(ast) {
|
|
894
|
+
let newList = [];
|
|
895
|
+
ast.list.forEach((sel) => {
|
|
896
|
+
switch (sel.type) {
|
|
897
|
+
case "class":
|
|
898
|
+
newList.push({
|
|
899
|
+
matcher: "~=",
|
|
900
|
+
modifier: null,
|
|
901
|
+
name: "class",
|
|
902
|
+
namespace: null,
|
|
903
|
+
specificity: sel.specificity,
|
|
904
|
+
type: "attrValue",
|
|
905
|
+
value: sel.name
|
|
906
|
+
});
|
|
907
|
+
break;
|
|
908
|
+
case "id":
|
|
909
|
+
newList.push({
|
|
910
|
+
matcher: "=",
|
|
911
|
+
modifier: null,
|
|
912
|
+
name: "id",
|
|
913
|
+
namespace: null,
|
|
914
|
+
specificity: sel.specificity,
|
|
915
|
+
type: "attrValue",
|
|
916
|
+
value: sel.name
|
|
917
|
+
});
|
|
918
|
+
break;
|
|
919
|
+
case "combinator":
|
|
920
|
+
reduceSelectorVariants(sel.left), newList.push(sel);
|
|
921
|
+
break;
|
|
922
|
+
case "universal":
|
|
923
|
+
break;
|
|
924
|
+
default:
|
|
925
|
+
newList.push(sel);
|
|
926
|
+
break;
|
|
927
|
+
}
|
|
928
|
+
}), ast.list = newList;
|
|
929
|
+
}
|
|
930
|
+
function weave(items) {
|
|
931
|
+
let branches = [];
|
|
932
|
+
for (; items.length; ) {
|
|
933
|
+
let topKind = findTopKey(items, (sel) => !0, getSelectorKind), { matches, nonmatches, empty } = breakByKind(items, topKind);
|
|
934
|
+
items = nonmatches, matches.length && branches.push(branchOfKind(topKind, matches)), empty.length && branches.push(...terminate(empty));
|
|
935
|
+
}
|
|
936
|
+
return branches;
|
|
937
|
+
}
|
|
938
|
+
function terminate(items) {
|
|
939
|
+
let results = [];
|
|
940
|
+
for (let item of items) {
|
|
941
|
+
let terminal = item.terminal;
|
|
942
|
+
if (terminal.type === "terminal")
|
|
943
|
+
results.push(terminal);
|
|
944
|
+
else {
|
|
945
|
+
let { matches, rest } = partition(terminal.cont, (node) => node.type === "terminal");
|
|
946
|
+
matches.forEach((node) => results.push(node)), rest.length && (terminal.cont = rest, results.push(terminal));
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
return results;
|
|
950
|
+
}
|
|
951
|
+
function breakByKind(items, selectedKind) {
|
|
952
|
+
let matches = [], nonmatches = [], empty = [];
|
|
953
|
+
for (let item of items) {
|
|
954
|
+
let simpsels = item.ast.list;
|
|
955
|
+
simpsels.length ? (simpsels.some((node) => getSelectorKind(node) === selectedKind) ? matches : nonmatches).push(item) : empty.push(item);
|
|
956
|
+
}
|
|
957
|
+
return { matches, nonmatches, empty };
|
|
958
|
+
}
|
|
959
|
+
function getSelectorKind(sel) {
|
|
960
|
+
switch (sel.type) {
|
|
961
|
+
case "attrPresence":
|
|
962
|
+
return `attrPresence ${sel.name}`;
|
|
963
|
+
case "attrValue":
|
|
964
|
+
return `attrValue ${sel.name}`;
|
|
965
|
+
case "combinator":
|
|
966
|
+
return `combinator ${sel.combinator}`;
|
|
967
|
+
default:
|
|
968
|
+
return sel.type;
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
function branchOfKind(kind, items) {
|
|
972
|
+
if (kind === "tag")
|
|
973
|
+
return tagNameBranch(items);
|
|
974
|
+
if (kind.startsWith("attrValue "))
|
|
975
|
+
return attrValueBranch(kind.substring(10), items);
|
|
976
|
+
if (kind.startsWith("attrPresence "))
|
|
977
|
+
return attrPresenceBranch(kind.substring(13), items);
|
|
978
|
+
if (kind === "combinator >")
|
|
979
|
+
return combinatorBranch(">", items);
|
|
980
|
+
if (kind === "combinator +")
|
|
981
|
+
return combinatorBranch("+", items);
|
|
982
|
+
throw new Error(`Unsupported selector kind: ${kind}`);
|
|
983
|
+
}
|
|
984
|
+
function tagNameBranch(items) {
|
|
985
|
+
let groups = spliceAndGroup(items, (x) => x.type === "tag", (x) => x.name);
|
|
986
|
+
return {
|
|
987
|
+
type: "tagName",
|
|
988
|
+
variants: Object.entries(groups).map(([name2, group]) => ({
|
|
989
|
+
type: "variant",
|
|
990
|
+
value: name2,
|
|
991
|
+
cont: weave(group.items)
|
|
992
|
+
}))
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
function attrPresenceBranch(name2, items) {
|
|
996
|
+
for (let item of items)
|
|
997
|
+
spliceSimpleSelector(item, (x) => x.type === "attrPresence" && x.name === name2);
|
|
998
|
+
return {
|
|
999
|
+
type: "attrPresence",
|
|
1000
|
+
name: name2,
|
|
1001
|
+
cont: weave(items)
|
|
1002
|
+
};
|
|
1003
|
+
}
|
|
1004
|
+
function attrValueBranch(name2, items) {
|
|
1005
|
+
let groups = spliceAndGroup(items, (x) => x.type === "attrValue" && x.name === name2, (x) => `${x.matcher} ${x.modifier || ""} ${x.value}`), matchers = [];
|
|
1006
|
+
for (let group of Object.values(groups)) {
|
|
1007
|
+
let sel = group.oneSimpleSelector, predicate = getAttrPredicate(sel), continuation = weave(group.items);
|
|
1008
|
+
matchers.push({
|
|
1009
|
+
type: "matcher",
|
|
1010
|
+
matcher: sel.matcher,
|
|
1011
|
+
modifier: sel.modifier,
|
|
1012
|
+
value: sel.value,
|
|
1013
|
+
predicate,
|
|
1014
|
+
cont: continuation
|
|
1015
|
+
});
|
|
1016
|
+
}
|
|
1017
|
+
return {
|
|
1018
|
+
type: "attrValue",
|
|
1019
|
+
name: name2,
|
|
1020
|
+
matchers
|
|
1021
|
+
};
|
|
1022
|
+
}
|
|
1023
|
+
function getAttrPredicate(sel) {
|
|
1024
|
+
if (sel.modifier === "i") {
|
|
1025
|
+
let expected = sel.value.toLowerCase();
|
|
1026
|
+
switch (sel.matcher) {
|
|
1027
|
+
case "=":
|
|
1028
|
+
return (actual) => expected === actual.toLowerCase();
|
|
1029
|
+
case "~=":
|
|
1030
|
+
return (actual) => actual.toLowerCase().split(/[ \t]+/).includes(expected);
|
|
1031
|
+
case "^=":
|
|
1032
|
+
return (actual) => actual.toLowerCase().startsWith(expected);
|
|
1033
|
+
case "$=":
|
|
1034
|
+
return (actual) => actual.toLowerCase().endsWith(expected);
|
|
1035
|
+
case "*=":
|
|
1036
|
+
return (actual) => actual.toLowerCase().includes(expected);
|
|
1037
|
+
case "|=":
|
|
1038
|
+
return (actual) => {
|
|
1039
|
+
let lower = actual.toLowerCase();
|
|
1040
|
+
return expected === lower || lower.startsWith(expected) && lower[expected.length] === "-";
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
} else {
|
|
1044
|
+
let expected = sel.value;
|
|
1045
|
+
switch (sel.matcher) {
|
|
1046
|
+
case "=":
|
|
1047
|
+
return (actual) => expected === actual;
|
|
1048
|
+
case "~=":
|
|
1049
|
+
return (actual) => actual.split(/[ \t]+/).includes(expected);
|
|
1050
|
+
case "^=":
|
|
1051
|
+
return (actual) => actual.startsWith(expected);
|
|
1052
|
+
case "$=":
|
|
1053
|
+
return (actual) => actual.endsWith(expected);
|
|
1054
|
+
case "*=":
|
|
1055
|
+
return (actual) => actual.includes(expected);
|
|
1056
|
+
case "|=":
|
|
1057
|
+
return (actual) => expected === actual || actual.startsWith(expected) && actual[expected.length] === "-";
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
function combinatorBranch(combinator, items) {
|
|
1062
|
+
let groups = spliceAndGroup(items, (x) => x.type === "combinator" && x.combinator === combinator, (x) => serialize(x.left)), leftItems = [];
|
|
1063
|
+
for (let group of Object.values(groups)) {
|
|
1064
|
+
let rightCont = weave(group.items), leftAst = group.oneSimpleSelector.left;
|
|
1065
|
+
leftItems.push({
|
|
1066
|
+
ast: leftAst,
|
|
1067
|
+
terminal: { type: "popElement", cont: rightCont }
|
|
1068
|
+
});
|
|
1069
|
+
}
|
|
1070
|
+
return {
|
|
1071
|
+
type: "pushElement",
|
|
1072
|
+
combinator,
|
|
1073
|
+
cont: weave(leftItems)
|
|
1074
|
+
};
|
|
1075
|
+
}
|
|
1076
|
+
function spliceAndGroup(items, predicate, keyCallback) {
|
|
1077
|
+
let groups = {};
|
|
1078
|
+
for (; items.length; ) {
|
|
1079
|
+
let bestKey = findTopKey(items, predicate, keyCallback), bestKeyPredicate = (sel) => predicate(sel) && keyCallback(sel) === bestKey, hasBestKeyPredicate = (item) => item.ast.list.some(bestKeyPredicate), { matches, rest } = partition1(items, hasBestKeyPredicate), oneSimpleSelector = null;
|
|
1080
|
+
for (let item of matches) {
|
|
1081
|
+
let splicedNode = spliceSimpleSelector(item, bestKeyPredicate);
|
|
1082
|
+
oneSimpleSelector || (oneSimpleSelector = splicedNode);
|
|
1083
|
+
}
|
|
1084
|
+
if (oneSimpleSelector == null)
|
|
1085
|
+
throw new Error("No simple selector is found.");
|
|
1086
|
+
groups[bestKey] = { oneSimpleSelector, items: matches }, items = rest;
|
|
1087
|
+
}
|
|
1088
|
+
return groups;
|
|
1089
|
+
}
|
|
1090
|
+
function spliceSimpleSelector(item, predicate) {
|
|
1091
|
+
let simpsels = item.ast.list, matches = new Array(simpsels.length), firstIndex = -1;
|
|
1092
|
+
for (let i = simpsels.length; i-- > 0; )
|
|
1093
|
+
predicate(simpsels[i]) && (matches[i] = !0, firstIndex = i);
|
|
1094
|
+
if (firstIndex == -1)
|
|
1095
|
+
throw new Error("Couldn't find the required simple selector.");
|
|
1096
|
+
let result = simpsels[firstIndex];
|
|
1097
|
+
return item.ast.list = simpsels.filter((sel, i) => !matches[i]), result;
|
|
1098
|
+
}
|
|
1099
|
+
function findTopKey(items, predicate, keyCallback) {
|
|
1100
|
+
let candidates = {};
|
|
1101
|
+
for (let item of items) {
|
|
1102
|
+
let candidates1 = {};
|
|
1103
|
+
for (let node of item.ast.list.filter(predicate))
|
|
1104
|
+
candidates1[keyCallback(node)] = !0;
|
|
1105
|
+
for (let key of Object.keys(candidates1))
|
|
1106
|
+
candidates[key] ? candidates[key]++ : candidates[key] = 1;
|
|
1107
|
+
}
|
|
1108
|
+
let topKind = "", topCounter = 0;
|
|
1109
|
+
for (let entry of Object.entries(candidates))
|
|
1110
|
+
entry[1] > topCounter && (topKind = entry[0], topCounter = entry[1]);
|
|
1111
|
+
return topKind;
|
|
1112
|
+
}
|
|
1113
|
+
function partition(src, predicate) {
|
|
1114
|
+
let matches = [], rest = [];
|
|
1115
|
+
for (let x of src)
|
|
1116
|
+
predicate(x) ? matches.push(x) : rest.push(x);
|
|
1117
|
+
return { matches, rest };
|
|
1118
|
+
}
|
|
1119
|
+
function partition1(src, predicate) {
|
|
1120
|
+
let matches = [], rest = [];
|
|
1121
|
+
for (let x of src)
|
|
1122
|
+
predicate(x) ? matches.push(x) : rest.push(x);
|
|
1123
|
+
return { matches, rest };
|
|
1124
|
+
}
|
|
1125
|
+
var Picker = class {
|
|
1126
|
+
constructor(f) {
|
|
1127
|
+
this.f = f;
|
|
1128
|
+
}
|
|
1129
|
+
pickAll(el) {
|
|
1130
|
+
return this.f(el);
|
|
1131
|
+
}
|
|
1132
|
+
pick1(el, preferFirst = !1) {
|
|
1133
|
+
let results = this.f(el), len = results.length;
|
|
1134
|
+
if (len === 0)
|
|
1135
|
+
return null;
|
|
1136
|
+
if (len === 1)
|
|
1137
|
+
return results[0].value;
|
|
1138
|
+
let comparator = preferFirst ? comparatorPreferFirst : comparatorPreferLast, result = results[0];
|
|
1139
|
+
for (let i = 1; i < len; i++) {
|
|
1140
|
+
let next = results[i];
|
|
1141
|
+
comparator(result, next) && (result = next);
|
|
1142
|
+
}
|
|
1143
|
+
return result.value;
|
|
1144
|
+
}
|
|
1145
|
+
};
|
|
1146
|
+
function comparatorPreferFirst(acc, next) {
|
|
1147
|
+
let diff = compareSpecificity(next.specificity, acc.specificity);
|
|
1148
|
+
return diff > 0 || diff === 0 && next.index < acc.index;
|
|
1149
|
+
}
|
|
1150
|
+
function comparatorPreferLast(acc, next) {
|
|
1151
|
+
let diff = compareSpecificity(next.specificity, acc.specificity);
|
|
1152
|
+
return diff > 0 || diff === 0 && next.index > acc.index;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
// node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.mjs
|
|
1156
|
+
function hp2Builder(nodes) {
|
|
1157
|
+
return new Picker(handleArray(nodes));
|
|
1158
|
+
}
|
|
1159
|
+
function handleArray(nodes) {
|
|
1160
|
+
let matchers = nodes.map(handleNode);
|
|
1161
|
+
return (el, ...tail) => matchers.flatMap((m) => m(el, ...tail));
|
|
1162
|
+
}
|
|
1163
|
+
function handleNode(node) {
|
|
1164
|
+
switch (node.type) {
|
|
1165
|
+
case "terminal": {
|
|
1166
|
+
let result = [node.valueContainer];
|
|
1167
|
+
return (el, ...tail) => result;
|
|
1168
|
+
}
|
|
1169
|
+
case "tagName":
|
|
1170
|
+
return handleTagName(node);
|
|
1171
|
+
case "attrValue":
|
|
1172
|
+
return handleAttrValueName(node);
|
|
1173
|
+
case "attrPresence":
|
|
1174
|
+
return handleAttrPresenceName(node);
|
|
1175
|
+
case "pushElement":
|
|
1176
|
+
return handlePushElementNode(node);
|
|
1177
|
+
case "popElement":
|
|
1178
|
+
return handlePopElementNode(node);
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
function handleTagName(node) {
|
|
1182
|
+
let variants = {};
|
|
1183
|
+
for (let variant of node.variants)
|
|
1184
|
+
variants[variant.value] = handleArray(variant.cont);
|
|
1185
|
+
return (el, ...tail) => {
|
|
1186
|
+
let continuation = variants[el.name];
|
|
1187
|
+
return continuation ? continuation(el, ...tail) : [];
|
|
1188
|
+
};
|
|
1189
|
+
}
|
|
1190
|
+
function handleAttrPresenceName(node) {
|
|
1191
|
+
let attrName = node.name, continuation = handleArray(node.cont);
|
|
1192
|
+
return (el, ...tail) => Object.prototype.hasOwnProperty.call(el.attribs, attrName) ? continuation(el, ...tail) : [];
|
|
1193
|
+
}
|
|
1194
|
+
function handleAttrValueName(node) {
|
|
1195
|
+
let callbacks = [];
|
|
1196
|
+
for (let matcher of node.matchers) {
|
|
1197
|
+
let predicate = matcher.predicate, continuation = handleArray(matcher.cont);
|
|
1198
|
+
callbacks.push((attr, el, ...tail) => predicate(attr) ? continuation(el, ...tail) : []);
|
|
1199
|
+
}
|
|
1200
|
+
let attrName = node.name;
|
|
1201
|
+
return (el, ...tail) => {
|
|
1202
|
+
let attr = el.attribs[attrName];
|
|
1203
|
+
return attr || attr === "" ? callbacks.flatMap((cb) => cb(attr, el, ...tail)) : [];
|
|
1204
|
+
};
|
|
1205
|
+
}
|
|
1206
|
+
function handlePushElementNode(node) {
|
|
1207
|
+
let continuation = handleArray(node.cont), leftElementGetter = node.combinator === "+" ? getPrecedingElement : getParentElement;
|
|
1208
|
+
return (el, ...tail) => {
|
|
1209
|
+
let next = leftElementGetter(el);
|
|
1210
|
+
return next === null ? [] : continuation(next, el, ...tail);
|
|
1211
|
+
};
|
|
1212
|
+
}
|
|
1213
|
+
var getPrecedingElement = (el) => {
|
|
1214
|
+
let prev = el.prev;
|
|
1215
|
+
return prev === null ? null : isTag2(prev) ? prev : getPrecedingElement(prev);
|
|
1216
|
+
}, getParentElement = (el) => {
|
|
1217
|
+
let parent = el.parent;
|
|
1218
|
+
return parent && isTag2(parent) ? parent : null;
|
|
1219
|
+
};
|
|
1220
|
+
function handlePopElementNode(node) {
|
|
1221
|
+
let continuation = handleArray(node.cont);
|
|
1222
|
+
return (el, next, ...tail) => continuation(next, ...tail);
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
// node_modules/entities/lib/esm/generated/decode-data-html.js
|
|
1226
|
+
var decode_data_html_default = new Uint16Array(
|
|
1227
|
+
// prettier-ignore
|
|
1228
|
+
'\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map((c2) => c2.charCodeAt(0))
|
|
1229
|
+
);
|
|
1230
|
+
|
|
1231
|
+
// node_modules/entities/lib/esm/generated/decode-data-xml.js
|
|
1232
|
+
var decode_data_xml_default = new Uint16Array(
|
|
1233
|
+
// prettier-ignore
|
|
1234
|
+
"\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map((c2) => c2.charCodeAt(0))
|
|
1235
|
+
);
|
|
1236
|
+
|
|
1237
|
+
// node_modules/entities/lib/esm/decode_codepoint.js
|
|
1238
|
+
var _a, decodeMap = /* @__PURE__ */ new Map([
|
|
1239
|
+
[0, 65533],
|
|
1240
|
+
// C1 Unicode control character reference replacements
|
|
1241
|
+
[128, 8364],
|
|
1242
|
+
[130, 8218],
|
|
1243
|
+
[131, 402],
|
|
1244
|
+
[132, 8222],
|
|
1245
|
+
[133, 8230],
|
|
1246
|
+
[134, 8224],
|
|
1247
|
+
[135, 8225],
|
|
1248
|
+
[136, 710],
|
|
1249
|
+
[137, 8240],
|
|
1250
|
+
[138, 352],
|
|
1251
|
+
[139, 8249],
|
|
1252
|
+
[140, 338],
|
|
1253
|
+
[142, 381],
|
|
1254
|
+
[145, 8216],
|
|
1255
|
+
[146, 8217],
|
|
1256
|
+
[147, 8220],
|
|
1257
|
+
[148, 8221],
|
|
1258
|
+
[149, 8226],
|
|
1259
|
+
[150, 8211],
|
|
1260
|
+
[151, 8212],
|
|
1261
|
+
[152, 732],
|
|
1262
|
+
[153, 8482],
|
|
1263
|
+
[154, 353],
|
|
1264
|
+
[155, 8250],
|
|
1265
|
+
[156, 339],
|
|
1266
|
+
[158, 382],
|
|
1267
|
+
[159, 376]
|
|
1268
|
+
]), fromCodePoint = (
|
|
1269
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
|
|
1270
|
+
(_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function(codePoint) {
|
|
1271
|
+
let output = "";
|
|
1272
|
+
return codePoint > 65535 && (codePoint -= 65536, output += String.fromCharCode(codePoint >>> 10 & 1023 | 55296), codePoint = 56320 | codePoint & 1023), output += String.fromCharCode(codePoint), output;
|
|
1273
|
+
}
|
|
1274
|
+
);
|
|
1275
|
+
function replaceCodePoint(codePoint) {
|
|
1276
|
+
var _a2;
|
|
1277
|
+
return codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111 ? 65533 : (_a2 = decodeMap.get(codePoint)) !== null && _a2 !== void 0 ? _a2 : codePoint;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
// node_modules/entities/lib/esm/decode.js
|
|
1281
|
+
var CharCodes;
|
|
1282
|
+
(function(CharCodes3) {
|
|
1283
|
+
CharCodes3[CharCodes3.NUM = 35] = "NUM", CharCodes3[CharCodes3.SEMI = 59] = "SEMI", CharCodes3[CharCodes3.EQUALS = 61] = "EQUALS", CharCodes3[CharCodes3.ZERO = 48] = "ZERO", CharCodes3[CharCodes3.NINE = 57] = "NINE", CharCodes3[CharCodes3.LOWER_A = 97] = "LOWER_A", CharCodes3[CharCodes3.LOWER_F = 102] = "LOWER_F", CharCodes3[CharCodes3.LOWER_X = 120] = "LOWER_X", CharCodes3[CharCodes3.LOWER_Z = 122] = "LOWER_Z", CharCodes3[CharCodes3.UPPER_A = 65] = "UPPER_A", CharCodes3[CharCodes3.UPPER_F = 70] = "UPPER_F", CharCodes3[CharCodes3.UPPER_Z = 90] = "UPPER_Z";
|
|
1284
|
+
})(CharCodes || (CharCodes = {}));
|
|
1285
|
+
var TO_LOWER_BIT = 32, BinTrieFlags;
|
|
1286
|
+
(function(BinTrieFlags2) {
|
|
1287
|
+
BinTrieFlags2[BinTrieFlags2.VALUE_LENGTH = 49152] = "VALUE_LENGTH", BinTrieFlags2[BinTrieFlags2.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", BinTrieFlags2[BinTrieFlags2.JUMP_TABLE = 127] = "JUMP_TABLE";
|
|
1288
|
+
})(BinTrieFlags || (BinTrieFlags = {}));
|
|
1289
|
+
function isNumber(code) {
|
|
1290
|
+
return code >= CharCodes.ZERO && code <= CharCodes.NINE;
|
|
1291
|
+
}
|
|
1292
|
+
function isHexadecimalCharacter(code) {
|
|
1293
|
+
return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F;
|
|
1294
|
+
}
|
|
1295
|
+
function isAsciiAlphaNumeric(code) {
|
|
1296
|
+
return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z || isNumber(code);
|
|
1297
|
+
}
|
|
1298
|
+
function isEntityInAttributeInvalidEnd(code) {
|
|
1299
|
+
return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code);
|
|
1300
|
+
}
|
|
1301
|
+
var EntityDecoderState;
|
|
1302
|
+
(function(EntityDecoderState2) {
|
|
1303
|
+
EntityDecoderState2[EntityDecoderState2.EntityStart = 0] = "EntityStart", EntityDecoderState2[EntityDecoderState2.NumericStart = 1] = "NumericStart", EntityDecoderState2[EntityDecoderState2.NumericDecimal = 2] = "NumericDecimal", EntityDecoderState2[EntityDecoderState2.NumericHex = 3] = "NumericHex", EntityDecoderState2[EntityDecoderState2.NamedEntity = 4] = "NamedEntity";
|
|
1304
|
+
})(EntityDecoderState || (EntityDecoderState = {}));
|
|
1305
|
+
var DecodingMode;
|
|
1306
|
+
(function(DecodingMode2) {
|
|
1307
|
+
DecodingMode2[DecodingMode2.Legacy = 0] = "Legacy", DecodingMode2[DecodingMode2.Strict = 1] = "Strict", DecodingMode2[DecodingMode2.Attribute = 2] = "Attribute";
|
|
1308
|
+
})(DecodingMode || (DecodingMode = {}));
|
|
1309
|
+
var EntityDecoder = class {
|
|
1310
|
+
constructor(decodeTree, emitCodePoint, errors) {
|
|
1311
|
+
this.decodeTree = decodeTree, this.emitCodePoint = emitCodePoint, this.errors = errors, this.state = EntityDecoderState.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = DecodingMode.Strict;
|
|
1312
|
+
}
|
|
1313
|
+
/** Resets the instance to make it reusable. */
|
|
1314
|
+
startEntity(decodeMode) {
|
|
1315
|
+
this.decodeMode = decodeMode, this.state = EntityDecoderState.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
|
|
1316
|
+
}
|
|
1317
|
+
/**
|
|
1318
|
+
* Write an entity to the decoder. This can be called multiple times with partial entities.
|
|
1319
|
+
* If the entity is incomplete, the decoder will return -1.
|
|
1320
|
+
*
|
|
1321
|
+
* Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the
|
|
1322
|
+
* entity is incomplete, and resume when the next string is written.
|
|
1323
|
+
*
|
|
1324
|
+
* @param string The string containing the entity (or a continuation of the entity).
|
|
1325
|
+
* @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
|
|
1326
|
+
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
|
1327
|
+
*/
|
|
1328
|
+
write(str, offset) {
|
|
1329
|
+
switch (this.state) {
|
|
1330
|
+
case EntityDecoderState.EntityStart:
|
|
1331
|
+
return str.charCodeAt(offset) === CharCodes.NUM ? (this.state = EntityDecoderState.NumericStart, this.consumed += 1, this.stateNumericStart(str, offset + 1)) : (this.state = EntityDecoderState.NamedEntity, this.stateNamedEntity(str, offset));
|
|
1332
|
+
case EntityDecoderState.NumericStart:
|
|
1333
|
+
return this.stateNumericStart(str, offset);
|
|
1334
|
+
case EntityDecoderState.NumericDecimal:
|
|
1335
|
+
return this.stateNumericDecimal(str, offset);
|
|
1336
|
+
case EntityDecoderState.NumericHex:
|
|
1337
|
+
return this.stateNumericHex(str, offset);
|
|
1338
|
+
case EntityDecoderState.NamedEntity:
|
|
1339
|
+
return this.stateNamedEntity(str, offset);
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
/**
|
|
1343
|
+
* Switches between the numeric decimal and hexadecimal states.
|
|
1344
|
+
*
|
|
1345
|
+
* Equivalent to the `Numeric character reference state` in the HTML spec.
|
|
1346
|
+
*
|
|
1347
|
+
* @param str The string containing the entity (or a continuation of the entity).
|
|
1348
|
+
* @param offset The current offset.
|
|
1349
|
+
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
|
1350
|
+
*/
|
|
1351
|
+
stateNumericStart(str, offset) {
|
|
1352
|
+
return offset >= str.length ? -1 : (str.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X ? (this.state = EntityDecoderState.NumericHex, this.consumed += 1, this.stateNumericHex(str, offset + 1)) : (this.state = EntityDecoderState.NumericDecimal, this.stateNumericDecimal(str, offset));
|
|
1353
|
+
}
|
|
1354
|
+
addToNumericResult(str, start, end, base) {
|
|
1355
|
+
if (start !== end) {
|
|
1356
|
+
let digitCount = end - start;
|
|
1357
|
+
this.result = this.result * Math.pow(base, digitCount) + parseInt(str.substr(start, digitCount), base), this.consumed += digitCount;
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
/**
|
|
1361
|
+
* Parses a hexadecimal numeric entity.
|
|
1362
|
+
*
|
|
1363
|
+
* Equivalent to the `Hexademical character reference state` in the HTML spec.
|
|
1364
|
+
*
|
|
1365
|
+
* @param str The string containing the entity (or a continuation of the entity).
|
|
1366
|
+
* @param offset The current offset.
|
|
1367
|
+
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
|
1368
|
+
*/
|
|
1369
|
+
stateNumericHex(str, offset) {
|
|
1370
|
+
let startIdx = offset;
|
|
1371
|
+
for (; offset < str.length; ) {
|
|
1372
|
+
let char = str.charCodeAt(offset);
|
|
1373
|
+
if (isNumber(char) || isHexadecimalCharacter(char))
|
|
1374
|
+
offset += 1;
|
|
1375
|
+
else
|
|
1376
|
+
return this.addToNumericResult(str, startIdx, offset, 16), this.emitNumericEntity(char, 3);
|
|
1377
|
+
}
|
|
1378
|
+
return this.addToNumericResult(str, startIdx, offset, 16), -1;
|
|
1379
|
+
}
|
|
1380
|
+
/**
|
|
1381
|
+
* Parses a decimal numeric entity.
|
|
1382
|
+
*
|
|
1383
|
+
* Equivalent to the `Decimal character reference state` in the HTML spec.
|
|
1384
|
+
*
|
|
1385
|
+
* @param str The string containing the entity (or a continuation of the entity).
|
|
1386
|
+
* @param offset The current offset.
|
|
1387
|
+
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
|
1388
|
+
*/
|
|
1389
|
+
stateNumericDecimal(str, offset) {
|
|
1390
|
+
let startIdx = offset;
|
|
1391
|
+
for (; offset < str.length; ) {
|
|
1392
|
+
let char = str.charCodeAt(offset);
|
|
1393
|
+
if (isNumber(char))
|
|
1394
|
+
offset += 1;
|
|
1395
|
+
else
|
|
1396
|
+
return this.addToNumericResult(str, startIdx, offset, 10), this.emitNumericEntity(char, 2);
|
|
1397
|
+
}
|
|
1398
|
+
return this.addToNumericResult(str, startIdx, offset, 10), -1;
|
|
1399
|
+
}
|
|
1400
|
+
/**
|
|
1401
|
+
* Validate and emit a numeric entity.
|
|
1402
|
+
*
|
|
1403
|
+
* Implements the logic from the `Hexademical character reference start
|
|
1404
|
+
* state` and `Numeric character reference end state` in the HTML spec.
|
|
1405
|
+
*
|
|
1406
|
+
* @param lastCp The last code point of the entity. Used to see if the
|
|
1407
|
+
* entity was terminated with a semicolon.
|
|
1408
|
+
* @param expectedLength The minimum number of characters that should be
|
|
1409
|
+
* consumed. Used to validate that at least one digit
|
|
1410
|
+
* was consumed.
|
|
1411
|
+
* @returns The number of characters that were consumed.
|
|
1412
|
+
*/
|
|
1413
|
+
emitNumericEntity(lastCp, expectedLength) {
|
|
1414
|
+
var _a2;
|
|
1415
|
+
if (this.consumed <= expectedLength)
|
|
1416
|
+
return (_a2 = this.errors) === null || _a2 === void 0 || _a2.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
|
|
1417
|
+
if (lastCp === CharCodes.SEMI)
|
|
1418
|
+
this.consumed += 1;
|
|
1419
|
+
else if (this.decodeMode === DecodingMode.Strict)
|
|
1420
|
+
return 0;
|
|
1421
|
+
return this.emitCodePoint(replaceCodePoint(this.result), this.consumed), this.errors && (lastCp !== CharCodes.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
|
|
1422
|
+
}
|
|
1423
|
+
/**
|
|
1424
|
+
* Parses a named entity.
|
|
1425
|
+
*
|
|
1426
|
+
* Equivalent to the `Named character reference state` in the HTML spec.
|
|
1427
|
+
*
|
|
1428
|
+
* @param str The string containing the entity (or a continuation of the entity).
|
|
1429
|
+
* @param offset The current offset.
|
|
1430
|
+
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
|
1431
|
+
*/
|
|
1432
|
+
stateNamedEntity(str, offset) {
|
|
1433
|
+
let { decodeTree } = this, current = decodeTree[this.treeIndex], valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
|
|
1434
|
+
for (; offset < str.length; offset++, this.excess++) {
|
|
1435
|
+
let char = str.charCodeAt(offset);
|
|
1436
|
+
if (this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char), this.treeIndex < 0)
|
|
1437
|
+
return this.result === 0 || // If we are parsing an attribute
|
|
1438
|
+
this.decodeMode === DecodingMode.Attribute && // We shouldn't have consumed any characters after the entity,
|
|
1439
|
+
(valueLength === 0 || // And there should be no invalid characters.
|
|
1440
|
+
isEntityInAttributeInvalidEnd(char)) ? 0 : this.emitNotTerminatedNamedEntity();
|
|
1441
|
+
if (current = decodeTree[this.treeIndex], valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14, valueLength !== 0) {
|
|
1442
|
+
if (char === CharCodes.SEMI)
|
|
1443
|
+
return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
|
|
1444
|
+
this.decodeMode !== DecodingMode.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0);
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
return -1;
|
|
1448
|
+
}
|
|
1449
|
+
/**
|
|
1450
|
+
* Emit a named entity that was not terminated with a semicolon.
|
|
1451
|
+
*
|
|
1452
|
+
* @returns The number of characters consumed.
|
|
1453
|
+
*/
|
|
1454
|
+
emitNotTerminatedNamedEntity() {
|
|
1455
|
+
var _a2;
|
|
1456
|
+
let { result, decodeTree } = this, valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
|
|
1457
|
+
return this.emitNamedEntityData(result, valueLength, this.consumed), (_a2 = this.errors) === null || _a2 === void 0 || _a2.missingSemicolonAfterCharacterReference(), this.consumed;
|
|
1458
|
+
}
|
|
1459
|
+
/**
|
|
1460
|
+
* Emit a named entity.
|
|
1461
|
+
*
|
|
1462
|
+
* @param result The index of the entity in the decode tree.
|
|
1463
|
+
* @param valueLength The number of bytes in the entity.
|
|
1464
|
+
* @param consumed The number of characters consumed.
|
|
1465
|
+
*
|
|
1466
|
+
* @returns The number of characters consumed.
|
|
1467
|
+
*/
|
|
1468
|
+
emitNamedEntityData(result, valueLength, consumed) {
|
|
1469
|
+
let { decodeTree } = this;
|
|
1470
|
+
return this.emitCodePoint(valueLength === 1 ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH : decodeTree[result + 1], consumed), valueLength === 3 && this.emitCodePoint(decodeTree[result + 2], consumed), consumed;
|
|
1471
|
+
}
|
|
1472
|
+
/**
|
|
1473
|
+
* Signal to the parser that the end of the input was reached.
|
|
1474
|
+
*
|
|
1475
|
+
* Remaining data will be emitted and relevant errors will be produced.
|
|
1476
|
+
*
|
|
1477
|
+
* @returns The number of characters consumed.
|
|
1478
|
+
*/
|
|
1479
|
+
end() {
|
|
1480
|
+
var _a2;
|
|
1481
|
+
switch (this.state) {
|
|
1482
|
+
case EntityDecoderState.NamedEntity:
|
|
1483
|
+
return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
|
|
1484
|
+
// Otherwise, emit a numeric entity if we have one.
|
|
1485
|
+
case EntityDecoderState.NumericDecimal:
|
|
1486
|
+
return this.emitNumericEntity(0, 2);
|
|
1487
|
+
case EntityDecoderState.NumericHex:
|
|
1488
|
+
return this.emitNumericEntity(0, 3);
|
|
1489
|
+
case EntityDecoderState.NumericStart:
|
|
1490
|
+
return (_a2 = this.errors) === null || _a2 === void 0 || _a2.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
|
|
1491
|
+
case EntityDecoderState.EntityStart:
|
|
1492
|
+
return 0;
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
};
|
|
1496
|
+
function getDecoder(decodeTree) {
|
|
1497
|
+
let ret = "", decoder = new EntityDecoder(decodeTree, (str) => ret += fromCodePoint(str));
|
|
1498
|
+
return function(str, decodeMode) {
|
|
1499
|
+
let lastIndex = 0, offset = 0;
|
|
1500
|
+
for (; (offset = str.indexOf("&", offset)) >= 0; ) {
|
|
1501
|
+
ret += str.slice(lastIndex, offset), decoder.startEntity(decodeMode);
|
|
1502
|
+
let len = decoder.write(
|
|
1503
|
+
str,
|
|
1504
|
+
// Skip the "&"
|
|
1505
|
+
offset + 1
|
|
1506
|
+
);
|
|
1507
|
+
if (len < 0) {
|
|
1508
|
+
lastIndex = offset + decoder.end();
|
|
1509
|
+
break;
|
|
1510
|
+
}
|
|
1511
|
+
lastIndex = offset + len, offset = len === 0 ? lastIndex + 1 : lastIndex;
|
|
1512
|
+
}
|
|
1513
|
+
let result = ret + str.slice(lastIndex);
|
|
1514
|
+
return ret = "", result;
|
|
1515
|
+
};
|
|
1516
|
+
}
|
|
1517
|
+
function determineBranch(decodeTree, current, nodeIdx, char) {
|
|
1518
|
+
let branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7, jumpOffset = current & BinTrieFlags.JUMP_TABLE;
|
|
1519
|
+
if (branchCount === 0)
|
|
1520
|
+
return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1;
|
|
1521
|
+
if (jumpOffset) {
|
|
1522
|
+
let value = char - jumpOffset;
|
|
1523
|
+
return value < 0 || value >= branchCount ? -1 : decodeTree[nodeIdx + value] - 1;
|
|
1524
|
+
}
|
|
1525
|
+
let lo = nodeIdx, hi = lo + branchCount - 1;
|
|
1526
|
+
for (; lo <= hi; ) {
|
|
1527
|
+
let mid = lo + hi >>> 1, midVal = decodeTree[mid];
|
|
1528
|
+
if (midVal < char)
|
|
1529
|
+
lo = mid + 1;
|
|
1530
|
+
else if (midVal > char)
|
|
1531
|
+
hi = mid - 1;
|
|
1532
|
+
else
|
|
1533
|
+
return decodeTree[mid + branchCount];
|
|
1534
|
+
}
|
|
1535
|
+
return -1;
|
|
1536
|
+
}
|
|
1537
|
+
var htmlDecoder = getDecoder(decode_data_html_default), xmlDecoder = getDecoder(decode_data_xml_default);
|
|
1538
|
+
|
|
1539
|
+
// node_modules/htmlparser2/lib/esm/Tokenizer.js
|
|
1540
|
+
var CharCodes2;
|
|
1541
|
+
(function(CharCodes3) {
|
|
1542
|
+
CharCodes3[CharCodes3.Tab = 9] = "Tab", CharCodes3[CharCodes3.NewLine = 10] = "NewLine", CharCodes3[CharCodes3.FormFeed = 12] = "FormFeed", CharCodes3[CharCodes3.CarriageReturn = 13] = "CarriageReturn", CharCodes3[CharCodes3.Space = 32] = "Space", CharCodes3[CharCodes3.ExclamationMark = 33] = "ExclamationMark", CharCodes3[CharCodes3.Number = 35] = "Number", CharCodes3[CharCodes3.Amp = 38] = "Amp", CharCodes3[CharCodes3.SingleQuote = 39] = "SingleQuote", CharCodes3[CharCodes3.DoubleQuote = 34] = "DoubleQuote", CharCodes3[CharCodes3.Dash = 45] = "Dash", CharCodes3[CharCodes3.Slash = 47] = "Slash", CharCodes3[CharCodes3.Zero = 48] = "Zero", CharCodes3[CharCodes3.Nine = 57] = "Nine", CharCodes3[CharCodes3.Semi = 59] = "Semi", CharCodes3[CharCodes3.Lt = 60] = "Lt", CharCodes3[CharCodes3.Eq = 61] = "Eq", CharCodes3[CharCodes3.Gt = 62] = "Gt", CharCodes3[CharCodes3.Questionmark = 63] = "Questionmark", CharCodes3[CharCodes3.UpperA = 65] = "UpperA", CharCodes3[CharCodes3.LowerA = 97] = "LowerA", CharCodes3[CharCodes3.UpperF = 70] = "UpperF", CharCodes3[CharCodes3.LowerF = 102] = "LowerF", CharCodes3[CharCodes3.UpperZ = 90] = "UpperZ", CharCodes3[CharCodes3.LowerZ = 122] = "LowerZ", CharCodes3[CharCodes3.LowerX = 120] = "LowerX", CharCodes3[CharCodes3.OpeningSquareBracket = 91] = "OpeningSquareBracket";
|
|
1543
|
+
})(CharCodes2 || (CharCodes2 = {}));
|
|
1544
|
+
var State;
|
|
1545
|
+
(function(State2) {
|
|
1546
|
+
State2[State2.Text = 1] = "Text", State2[State2.BeforeTagName = 2] = "BeforeTagName", State2[State2.InTagName = 3] = "InTagName", State2[State2.InSelfClosingTag = 4] = "InSelfClosingTag", State2[State2.BeforeClosingTagName = 5] = "BeforeClosingTagName", State2[State2.InClosingTagName = 6] = "InClosingTagName", State2[State2.AfterClosingTagName = 7] = "AfterClosingTagName", State2[State2.BeforeAttributeName = 8] = "BeforeAttributeName", State2[State2.InAttributeName = 9] = "InAttributeName", State2[State2.AfterAttributeName = 10] = "AfterAttributeName", State2[State2.BeforeAttributeValue = 11] = "BeforeAttributeValue", State2[State2.InAttributeValueDq = 12] = "InAttributeValueDq", State2[State2.InAttributeValueSq = 13] = "InAttributeValueSq", State2[State2.InAttributeValueNq = 14] = "InAttributeValueNq", State2[State2.BeforeDeclaration = 15] = "BeforeDeclaration", State2[State2.InDeclaration = 16] = "InDeclaration", State2[State2.InProcessingInstruction = 17] = "InProcessingInstruction", State2[State2.BeforeComment = 18] = "BeforeComment", State2[State2.CDATASequence = 19] = "CDATASequence", State2[State2.InSpecialComment = 20] = "InSpecialComment", State2[State2.InCommentLike = 21] = "InCommentLike", State2[State2.BeforeSpecialS = 22] = "BeforeSpecialS", State2[State2.SpecialStartSequence = 23] = "SpecialStartSequence", State2[State2.InSpecialTag = 24] = "InSpecialTag", State2[State2.BeforeEntity = 25] = "BeforeEntity", State2[State2.BeforeNumericEntity = 26] = "BeforeNumericEntity", State2[State2.InNamedEntity = 27] = "InNamedEntity", State2[State2.InNumericEntity = 28] = "InNumericEntity", State2[State2.InHexEntity = 29] = "InHexEntity";
|
|
1547
|
+
})(State || (State = {}));
|
|
1548
|
+
function isWhitespace(c2) {
|
|
1549
|
+
return c2 === CharCodes2.Space || c2 === CharCodes2.NewLine || c2 === CharCodes2.Tab || c2 === CharCodes2.FormFeed || c2 === CharCodes2.CarriageReturn;
|
|
1550
|
+
}
|
|
1551
|
+
function isEndOfTagSection(c2) {
|
|
1552
|
+
return c2 === CharCodes2.Slash || c2 === CharCodes2.Gt || isWhitespace(c2);
|
|
1553
|
+
}
|
|
1554
|
+
function isNumber2(c2) {
|
|
1555
|
+
return c2 >= CharCodes2.Zero && c2 <= CharCodes2.Nine;
|
|
1556
|
+
}
|
|
1557
|
+
function isASCIIAlpha(c2) {
|
|
1558
|
+
return c2 >= CharCodes2.LowerA && c2 <= CharCodes2.LowerZ || c2 >= CharCodes2.UpperA && c2 <= CharCodes2.UpperZ;
|
|
1559
|
+
}
|
|
1560
|
+
function isHexDigit(c2) {
|
|
1561
|
+
return c2 >= CharCodes2.UpperA && c2 <= CharCodes2.UpperF || c2 >= CharCodes2.LowerA && c2 <= CharCodes2.LowerF;
|
|
1562
|
+
}
|
|
1563
|
+
var QuoteType;
|
|
1564
|
+
(function(QuoteType2) {
|
|
1565
|
+
QuoteType2[QuoteType2.NoValue = 0] = "NoValue", QuoteType2[QuoteType2.Unquoted = 1] = "Unquoted", QuoteType2[QuoteType2.Single = 2] = "Single", QuoteType2[QuoteType2.Double = 3] = "Double";
|
|
1566
|
+
})(QuoteType || (QuoteType = {}));
|
|
1567
|
+
var Sequences = {
|
|
1568
|
+
Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]),
|
|
1569
|
+
CdataEnd: new Uint8Array([93, 93, 62]),
|
|
1570
|
+
CommentEnd: new Uint8Array([45, 45, 62]),
|
|
1571
|
+
ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]),
|
|
1572
|
+
StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]),
|
|
1573
|
+
TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101])
|
|
1574
|
+
// `</title`
|
|
1575
|
+
}, Tokenizer = class {
|
|
1576
|
+
constructor({ xmlMode = !1, decodeEntities = !0 }, cbs) {
|
|
1577
|
+
this.cbs = cbs, this.state = State.Text, this.buffer = "", this.sectionStart = 0, this.index = 0, this.baseState = State.Text, this.isSpecial = !1, this.running = !0, this.offset = 0, this.currentSequence = void 0, this.sequenceIndex = 0, this.trieIndex = 0, this.trieCurrent = 0, this.entityResult = 0, this.entityExcess = 0, this.xmlMode = xmlMode, this.decodeEntities = decodeEntities, this.entityTrie = xmlMode ? decode_data_xml_default : decode_data_html_default;
|
|
1578
|
+
}
|
|
1579
|
+
reset() {
|
|
1580
|
+
this.state = State.Text, this.buffer = "", this.sectionStart = 0, this.index = 0, this.baseState = State.Text, this.currentSequence = void 0, this.running = !0, this.offset = 0;
|
|
1581
|
+
}
|
|
1582
|
+
write(chunk) {
|
|
1583
|
+
this.offset += this.buffer.length, this.buffer = chunk, this.parse();
|
|
1584
|
+
}
|
|
1585
|
+
end() {
|
|
1586
|
+
this.running && this.finish();
|
|
1587
|
+
}
|
|
1588
|
+
pause() {
|
|
1589
|
+
this.running = !1;
|
|
1590
|
+
}
|
|
1591
|
+
resume() {
|
|
1592
|
+
this.running = !0, this.index < this.buffer.length + this.offset && this.parse();
|
|
1593
|
+
}
|
|
1594
|
+
/**
|
|
1595
|
+
* The current index within all of the written data.
|
|
1596
|
+
*/
|
|
1597
|
+
getIndex() {
|
|
1598
|
+
return this.index;
|
|
1599
|
+
}
|
|
1600
|
+
/**
|
|
1601
|
+
* The start of the current section.
|
|
1602
|
+
*/
|
|
1603
|
+
getSectionStart() {
|
|
1604
|
+
return this.sectionStart;
|
|
1605
|
+
}
|
|
1606
|
+
stateText(c2) {
|
|
1607
|
+
c2 === CharCodes2.Lt || !this.decodeEntities && this.fastForwardTo(CharCodes2.Lt) ? (this.index > this.sectionStart && this.cbs.ontext(this.sectionStart, this.index), this.state = State.BeforeTagName, this.sectionStart = this.index) : this.decodeEntities && c2 === CharCodes2.Amp && (this.state = State.BeforeEntity);
|
|
1608
|
+
}
|
|
1609
|
+
stateSpecialStartSequence(c2) {
|
|
1610
|
+
let isEnd = this.sequenceIndex === this.currentSequence.length;
|
|
1611
|
+
if (!(isEnd ? (
|
|
1612
|
+
// If we are at the end of the sequence, make sure the tag name has ended
|
|
1613
|
+
isEndOfTagSection(c2)
|
|
1614
|
+
) : (
|
|
1615
|
+
// Otherwise, do a case-insensitive comparison
|
|
1616
|
+
(c2 | 32) === this.currentSequence[this.sequenceIndex]
|
|
1617
|
+
)))
|
|
1618
|
+
this.isSpecial = !1;
|
|
1619
|
+
else if (!isEnd) {
|
|
1620
|
+
this.sequenceIndex++;
|
|
1621
|
+
return;
|
|
1622
|
+
}
|
|
1623
|
+
this.sequenceIndex = 0, this.state = State.InTagName, this.stateInTagName(c2);
|
|
1624
|
+
}
|
|
1625
|
+
/** Look for an end tag. For <title> tags, also decode entities. */
|
|
1626
|
+
stateInSpecialTag(c2) {
|
|
1627
|
+
if (this.sequenceIndex === this.currentSequence.length) {
|
|
1628
|
+
if (c2 === CharCodes2.Gt || isWhitespace(c2)) {
|
|
1629
|
+
let endOfText = this.index - this.currentSequence.length;
|
|
1630
|
+
if (this.sectionStart < endOfText) {
|
|
1631
|
+
let actualIndex = this.index;
|
|
1632
|
+
this.index = endOfText, this.cbs.ontext(this.sectionStart, endOfText), this.index = actualIndex;
|
|
1633
|
+
}
|
|
1634
|
+
this.isSpecial = !1, this.sectionStart = endOfText + 2, this.stateInClosingTagName(c2);
|
|
1635
|
+
return;
|
|
1636
|
+
}
|
|
1637
|
+
this.sequenceIndex = 0;
|
|
1638
|
+
}
|
|
1639
|
+
(c2 | 32) === this.currentSequence[this.sequenceIndex] ? this.sequenceIndex += 1 : this.sequenceIndex === 0 ? this.currentSequence === Sequences.TitleEnd ? this.decodeEntities && c2 === CharCodes2.Amp && (this.state = State.BeforeEntity) : this.fastForwardTo(CharCodes2.Lt) && (this.sequenceIndex = 1) : this.sequenceIndex = +(c2 === CharCodes2.Lt);
|
|
1640
|
+
}
|
|
1641
|
+
stateCDATASequence(c2) {
|
|
1642
|
+
c2 === Sequences.Cdata[this.sequenceIndex] ? ++this.sequenceIndex === Sequences.Cdata.length && (this.state = State.InCommentLike, this.currentSequence = Sequences.CdataEnd, this.sequenceIndex = 0, this.sectionStart = this.index + 1) : (this.sequenceIndex = 0, this.state = State.InDeclaration, this.stateInDeclaration(c2));
|
|
1643
|
+
}
|
|
1644
|
+
/**
|
|
1645
|
+
* When we wait for one specific character, we can speed things up
|
|
1646
|
+
* by skipping through the buffer until we find it.
|
|
1647
|
+
*
|
|
1648
|
+
* @returns Whether the character was found.
|
|
1649
|
+
*/
|
|
1650
|
+
fastForwardTo(c2) {
|
|
1651
|
+
for (; ++this.index < this.buffer.length + this.offset; )
|
|
1652
|
+
if (this.buffer.charCodeAt(this.index - this.offset) === c2)
|
|
1653
|
+
return !0;
|
|
1654
|
+
return this.index = this.buffer.length + this.offset - 1, !1;
|
|
1655
|
+
}
|
|
1656
|
+
/**
|
|
1657
|
+
* Comments and CDATA end with `-->` and `]]>`.
|
|
1658
|
+
*
|
|
1659
|
+
* Their common qualities are:
|
|
1660
|
+
* - Their end sequences have a distinct character they start with.
|
|
1661
|
+
* - That character is then repeated, so we have to check multiple repeats.
|
|
1662
|
+
* - All characters but the start character of the sequence can be skipped.
|
|
1663
|
+
*/
|
|
1664
|
+
stateInCommentLike(c2) {
|
|
1665
|
+
c2 === this.currentSequence[this.sequenceIndex] ? ++this.sequenceIndex === this.currentSequence.length && (this.currentSequence === Sequences.CdataEnd ? this.cbs.oncdata(this.sectionStart, this.index, 2) : this.cbs.oncomment(this.sectionStart, this.index, 2), this.sequenceIndex = 0, this.sectionStart = this.index + 1, this.state = State.Text) : this.sequenceIndex === 0 ? this.fastForwardTo(this.currentSequence[0]) && (this.sequenceIndex = 1) : c2 !== this.currentSequence[this.sequenceIndex - 1] && (this.sequenceIndex = 0);
|
|
1666
|
+
}
|
|
1667
|
+
/**
|
|
1668
|
+
* HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.
|
|
1669
|
+
*
|
|
1670
|
+
* XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar).
|
|
1671
|
+
* We allow anything that wouldn't end the tag.
|
|
1672
|
+
*/
|
|
1673
|
+
isTagStartChar(c2) {
|
|
1674
|
+
return this.xmlMode ? !isEndOfTagSection(c2) : isASCIIAlpha(c2);
|
|
1675
|
+
}
|
|
1676
|
+
startSpecial(sequence, offset) {
|
|
1677
|
+
this.isSpecial = !0, this.currentSequence = sequence, this.sequenceIndex = offset, this.state = State.SpecialStartSequence;
|
|
1678
|
+
}
|
|
1679
|
+
stateBeforeTagName(c2) {
|
|
1680
|
+
if (c2 === CharCodes2.ExclamationMark)
|
|
1681
|
+
this.state = State.BeforeDeclaration, this.sectionStart = this.index + 1;
|
|
1682
|
+
else if (c2 === CharCodes2.Questionmark)
|
|
1683
|
+
this.state = State.InProcessingInstruction, this.sectionStart = this.index + 1;
|
|
1684
|
+
else if (this.isTagStartChar(c2)) {
|
|
1685
|
+
let lower = c2 | 32;
|
|
1686
|
+
this.sectionStart = this.index, !this.xmlMode && lower === Sequences.TitleEnd[2] ? this.startSpecial(Sequences.TitleEnd, 3) : this.state = !this.xmlMode && lower === Sequences.ScriptEnd[2] ? State.BeforeSpecialS : State.InTagName;
|
|
1687
|
+
} else c2 === CharCodes2.Slash ? this.state = State.BeforeClosingTagName : (this.state = State.Text, this.stateText(c2));
|
|
1688
|
+
}
|
|
1689
|
+
stateInTagName(c2) {
|
|
1690
|
+
isEndOfTagSection(c2) && (this.cbs.onopentagname(this.sectionStart, this.index), this.sectionStart = -1, this.state = State.BeforeAttributeName, this.stateBeforeAttributeName(c2));
|
|
1691
|
+
}
|
|
1692
|
+
stateBeforeClosingTagName(c2) {
|
|
1693
|
+
isWhitespace(c2) || (c2 === CharCodes2.Gt ? this.state = State.Text : (this.state = this.isTagStartChar(c2) ? State.InClosingTagName : State.InSpecialComment, this.sectionStart = this.index));
|
|
1694
|
+
}
|
|
1695
|
+
stateInClosingTagName(c2) {
|
|
1696
|
+
(c2 === CharCodes2.Gt || isWhitespace(c2)) && (this.cbs.onclosetag(this.sectionStart, this.index), this.sectionStart = -1, this.state = State.AfterClosingTagName, this.stateAfterClosingTagName(c2));
|
|
1697
|
+
}
|
|
1698
|
+
stateAfterClosingTagName(c2) {
|
|
1699
|
+
(c2 === CharCodes2.Gt || this.fastForwardTo(CharCodes2.Gt)) && (this.state = State.Text, this.baseState = State.Text, this.sectionStart = this.index + 1);
|
|
1700
|
+
}
|
|
1701
|
+
stateBeforeAttributeName(c2) {
|
|
1702
|
+
c2 === CharCodes2.Gt ? (this.cbs.onopentagend(this.index), this.isSpecial ? (this.state = State.InSpecialTag, this.sequenceIndex = 0) : this.state = State.Text, this.baseState = this.state, this.sectionStart = this.index + 1) : c2 === CharCodes2.Slash ? this.state = State.InSelfClosingTag : isWhitespace(c2) || (this.state = State.InAttributeName, this.sectionStart = this.index);
|
|
1703
|
+
}
|
|
1704
|
+
stateInSelfClosingTag(c2) {
|
|
1705
|
+
c2 === CharCodes2.Gt ? (this.cbs.onselfclosingtag(this.index), this.state = State.Text, this.baseState = State.Text, this.sectionStart = this.index + 1, this.isSpecial = !1) : isWhitespace(c2) || (this.state = State.BeforeAttributeName, this.stateBeforeAttributeName(c2));
|
|
1706
|
+
}
|
|
1707
|
+
stateInAttributeName(c2) {
|
|
1708
|
+
(c2 === CharCodes2.Eq || isEndOfTagSection(c2)) && (this.cbs.onattribname(this.sectionStart, this.index), this.sectionStart = -1, this.state = State.AfterAttributeName, this.stateAfterAttributeName(c2));
|
|
1709
|
+
}
|
|
1710
|
+
stateAfterAttributeName(c2) {
|
|
1711
|
+
c2 === CharCodes2.Eq ? this.state = State.BeforeAttributeValue : c2 === CharCodes2.Slash || c2 === CharCodes2.Gt ? (this.cbs.onattribend(QuoteType.NoValue, this.index), this.state = State.BeforeAttributeName, this.stateBeforeAttributeName(c2)) : isWhitespace(c2) || (this.cbs.onattribend(QuoteType.NoValue, this.index), this.state = State.InAttributeName, this.sectionStart = this.index);
|
|
1712
|
+
}
|
|
1713
|
+
stateBeforeAttributeValue(c2) {
|
|
1714
|
+
c2 === CharCodes2.DoubleQuote ? (this.state = State.InAttributeValueDq, this.sectionStart = this.index + 1) : c2 === CharCodes2.SingleQuote ? (this.state = State.InAttributeValueSq, this.sectionStart = this.index + 1) : isWhitespace(c2) || (this.sectionStart = this.index, this.state = State.InAttributeValueNq, this.stateInAttributeValueNoQuotes(c2));
|
|
1715
|
+
}
|
|
1716
|
+
handleInAttributeValue(c2, quote) {
|
|
1717
|
+
c2 === quote || !this.decodeEntities && this.fastForwardTo(quote) ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(quote === CharCodes2.DoubleQuote ? QuoteType.Double : QuoteType.Single, this.index), this.state = State.BeforeAttributeName) : this.decodeEntities && c2 === CharCodes2.Amp && (this.baseState = this.state, this.state = State.BeforeEntity);
|
|
1718
|
+
}
|
|
1719
|
+
stateInAttributeValueDoubleQuotes(c2) {
|
|
1720
|
+
this.handleInAttributeValue(c2, CharCodes2.DoubleQuote);
|
|
1721
|
+
}
|
|
1722
|
+
stateInAttributeValueSingleQuotes(c2) {
|
|
1723
|
+
this.handleInAttributeValue(c2, CharCodes2.SingleQuote);
|
|
1724
|
+
}
|
|
1725
|
+
stateInAttributeValueNoQuotes(c2) {
|
|
1726
|
+
isWhitespace(c2) || c2 === CharCodes2.Gt ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(QuoteType.Unquoted, this.index), this.state = State.BeforeAttributeName, this.stateBeforeAttributeName(c2)) : this.decodeEntities && c2 === CharCodes2.Amp && (this.baseState = this.state, this.state = State.BeforeEntity);
|
|
1727
|
+
}
|
|
1728
|
+
stateBeforeDeclaration(c2) {
|
|
1729
|
+
c2 === CharCodes2.OpeningSquareBracket ? (this.state = State.CDATASequence, this.sequenceIndex = 0) : this.state = c2 === CharCodes2.Dash ? State.BeforeComment : State.InDeclaration;
|
|
1730
|
+
}
|
|
1731
|
+
stateInDeclaration(c2) {
|
|
1732
|
+
(c2 === CharCodes2.Gt || this.fastForwardTo(CharCodes2.Gt)) && (this.cbs.ondeclaration(this.sectionStart, this.index), this.state = State.Text, this.sectionStart = this.index + 1);
|
|
1733
|
+
}
|
|
1734
|
+
stateInProcessingInstruction(c2) {
|
|
1735
|
+
(c2 === CharCodes2.Gt || this.fastForwardTo(CharCodes2.Gt)) && (this.cbs.onprocessinginstruction(this.sectionStart, this.index), this.state = State.Text, this.sectionStart = this.index + 1);
|
|
1736
|
+
}
|
|
1737
|
+
stateBeforeComment(c2) {
|
|
1738
|
+
c2 === CharCodes2.Dash ? (this.state = State.InCommentLike, this.currentSequence = Sequences.CommentEnd, this.sequenceIndex = 2, this.sectionStart = this.index + 1) : this.state = State.InDeclaration;
|
|
1739
|
+
}
|
|
1740
|
+
stateInSpecialComment(c2) {
|
|
1741
|
+
(c2 === CharCodes2.Gt || this.fastForwardTo(CharCodes2.Gt)) && (this.cbs.oncomment(this.sectionStart, this.index, 0), this.state = State.Text, this.sectionStart = this.index + 1);
|
|
1742
|
+
}
|
|
1743
|
+
stateBeforeSpecialS(c2) {
|
|
1744
|
+
let lower = c2 | 32;
|
|
1745
|
+
lower === Sequences.ScriptEnd[3] ? this.startSpecial(Sequences.ScriptEnd, 4) : lower === Sequences.StyleEnd[3] ? this.startSpecial(Sequences.StyleEnd, 4) : (this.state = State.InTagName, this.stateInTagName(c2));
|
|
1746
|
+
}
|
|
1747
|
+
stateBeforeEntity(c2) {
|
|
1748
|
+
this.entityExcess = 1, this.entityResult = 0, c2 === CharCodes2.Number ? this.state = State.BeforeNumericEntity : c2 === CharCodes2.Amp || (this.trieIndex = 0, this.trieCurrent = this.entityTrie[0], this.state = State.InNamedEntity, this.stateInNamedEntity(c2));
|
|
1749
|
+
}
|
|
1750
|
+
stateInNamedEntity(c2) {
|
|
1751
|
+
if (this.entityExcess += 1, this.trieIndex = determineBranch(this.entityTrie, this.trieCurrent, this.trieIndex + 1, c2), this.trieIndex < 0) {
|
|
1752
|
+
this.emitNamedEntity(), this.index--;
|
|
1753
|
+
return;
|
|
1754
|
+
}
|
|
1755
|
+
this.trieCurrent = this.entityTrie[this.trieIndex];
|
|
1756
|
+
let masked = this.trieCurrent & BinTrieFlags.VALUE_LENGTH;
|
|
1757
|
+
if (masked) {
|
|
1758
|
+
let valueLength = (masked >> 14) - 1;
|
|
1759
|
+
if (!this.allowLegacyEntity() && c2 !== CharCodes2.Semi)
|
|
1760
|
+
this.trieIndex += valueLength;
|
|
1761
|
+
else {
|
|
1762
|
+
let entityStart = this.index - this.entityExcess + 1;
|
|
1763
|
+
entityStart > this.sectionStart && this.emitPartial(this.sectionStart, entityStart), this.entityResult = this.trieIndex, this.trieIndex += valueLength, this.entityExcess = 0, this.sectionStart = this.index + 1, valueLength === 0 && this.emitNamedEntity();
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
emitNamedEntity() {
|
|
1768
|
+
if (this.state = this.baseState, this.entityResult === 0)
|
|
1769
|
+
return;
|
|
1770
|
+
switch ((this.entityTrie[this.entityResult] & BinTrieFlags.VALUE_LENGTH) >> 14) {
|
|
1771
|
+
case 1: {
|
|
1772
|
+
this.emitCodePoint(this.entityTrie[this.entityResult] & ~BinTrieFlags.VALUE_LENGTH);
|
|
1773
|
+
break;
|
|
1774
|
+
}
|
|
1775
|
+
case 2: {
|
|
1776
|
+
this.emitCodePoint(this.entityTrie[this.entityResult + 1]);
|
|
1777
|
+
break;
|
|
1778
|
+
}
|
|
1779
|
+
case 3:
|
|
1780
|
+
this.emitCodePoint(this.entityTrie[this.entityResult + 1]), this.emitCodePoint(this.entityTrie[this.entityResult + 2]);
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
stateBeforeNumericEntity(c2) {
|
|
1784
|
+
(c2 | 32) === CharCodes2.LowerX ? (this.entityExcess++, this.state = State.InHexEntity) : (this.state = State.InNumericEntity, this.stateInNumericEntity(c2));
|
|
1785
|
+
}
|
|
1786
|
+
emitNumericEntity(strict) {
|
|
1787
|
+
let entityStart = this.index - this.entityExcess - 1;
|
|
1788
|
+
entityStart + 2 + +(this.state === State.InHexEntity) !== this.index && (entityStart > this.sectionStart && this.emitPartial(this.sectionStart, entityStart), this.sectionStart = this.index + Number(strict), this.emitCodePoint(replaceCodePoint(this.entityResult))), this.state = this.baseState;
|
|
1789
|
+
}
|
|
1790
|
+
stateInNumericEntity(c2) {
|
|
1791
|
+
c2 === CharCodes2.Semi ? this.emitNumericEntity(!0) : isNumber2(c2) ? (this.entityResult = this.entityResult * 10 + (c2 - CharCodes2.Zero), this.entityExcess++) : (this.allowLegacyEntity() ? this.emitNumericEntity(!1) : this.state = this.baseState, this.index--);
|
|
1792
|
+
}
|
|
1793
|
+
stateInHexEntity(c2) {
|
|
1794
|
+
c2 === CharCodes2.Semi ? this.emitNumericEntity(!0) : isNumber2(c2) ? (this.entityResult = this.entityResult * 16 + (c2 - CharCodes2.Zero), this.entityExcess++) : isHexDigit(c2) ? (this.entityResult = this.entityResult * 16 + ((c2 | 32) - CharCodes2.LowerA + 10), this.entityExcess++) : (this.allowLegacyEntity() ? this.emitNumericEntity(!1) : this.state = this.baseState, this.index--);
|
|
1795
|
+
}
|
|
1796
|
+
allowLegacyEntity() {
|
|
1797
|
+
return !this.xmlMode && (this.baseState === State.Text || this.baseState === State.InSpecialTag);
|
|
1798
|
+
}
|
|
1799
|
+
/**
|
|
1800
|
+
* Remove data that has already been consumed from the buffer.
|
|
1801
|
+
*/
|
|
1802
|
+
cleanup() {
|
|
1803
|
+
this.running && this.sectionStart !== this.index && (this.state === State.Text || this.state === State.InSpecialTag && this.sequenceIndex === 0 ? (this.cbs.ontext(this.sectionStart, this.index), this.sectionStart = this.index) : (this.state === State.InAttributeValueDq || this.state === State.InAttributeValueSq || this.state === State.InAttributeValueNq) && (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = this.index));
|
|
1804
|
+
}
|
|
1805
|
+
shouldContinue() {
|
|
1806
|
+
return this.index < this.buffer.length + this.offset && this.running;
|
|
1807
|
+
}
|
|
1808
|
+
/**
|
|
1809
|
+
* Iterates through the buffer, calling the function corresponding to the current state.
|
|
1810
|
+
*
|
|
1811
|
+
* States that are more likely to be hit are higher up, as a performance improvement.
|
|
1812
|
+
*/
|
|
1813
|
+
parse() {
|
|
1814
|
+
for (; this.shouldContinue(); ) {
|
|
1815
|
+
let c2 = this.buffer.charCodeAt(this.index - this.offset);
|
|
1816
|
+
switch (this.state) {
|
|
1817
|
+
case State.Text: {
|
|
1818
|
+
this.stateText(c2);
|
|
1819
|
+
break;
|
|
1820
|
+
}
|
|
1821
|
+
case State.SpecialStartSequence: {
|
|
1822
|
+
this.stateSpecialStartSequence(c2);
|
|
1823
|
+
break;
|
|
1824
|
+
}
|
|
1825
|
+
case State.InSpecialTag: {
|
|
1826
|
+
this.stateInSpecialTag(c2);
|
|
1827
|
+
break;
|
|
1828
|
+
}
|
|
1829
|
+
case State.CDATASequence: {
|
|
1830
|
+
this.stateCDATASequence(c2);
|
|
1831
|
+
break;
|
|
1832
|
+
}
|
|
1833
|
+
case State.InAttributeValueDq: {
|
|
1834
|
+
this.stateInAttributeValueDoubleQuotes(c2);
|
|
1835
|
+
break;
|
|
1836
|
+
}
|
|
1837
|
+
case State.InAttributeName: {
|
|
1838
|
+
this.stateInAttributeName(c2);
|
|
1839
|
+
break;
|
|
1840
|
+
}
|
|
1841
|
+
case State.InCommentLike: {
|
|
1842
|
+
this.stateInCommentLike(c2);
|
|
1843
|
+
break;
|
|
1844
|
+
}
|
|
1845
|
+
case State.InSpecialComment: {
|
|
1846
|
+
this.stateInSpecialComment(c2);
|
|
1847
|
+
break;
|
|
1848
|
+
}
|
|
1849
|
+
case State.BeforeAttributeName: {
|
|
1850
|
+
this.stateBeforeAttributeName(c2);
|
|
1851
|
+
break;
|
|
1852
|
+
}
|
|
1853
|
+
case State.InTagName: {
|
|
1854
|
+
this.stateInTagName(c2);
|
|
1855
|
+
break;
|
|
1856
|
+
}
|
|
1857
|
+
case State.InClosingTagName: {
|
|
1858
|
+
this.stateInClosingTagName(c2);
|
|
1859
|
+
break;
|
|
1860
|
+
}
|
|
1861
|
+
case State.BeforeTagName: {
|
|
1862
|
+
this.stateBeforeTagName(c2);
|
|
1863
|
+
break;
|
|
1864
|
+
}
|
|
1865
|
+
case State.AfterAttributeName: {
|
|
1866
|
+
this.stateAfterAttributeName(c2);
|
|
1867
|
+
break;
|
|
1868
|
+
}
|
|
1869
|
+
case State.InAttributeValueSq: {
|
|
1870
|
+
this.stateInAttributeValueSingleQuotes(c2);
|
|
1871
|
+
break;
|
|
1872
|
+
}
|
|
1873
|
+
case State.BeforeAttributeValue: {
|
|
1874
|
+
this.stateBeforeAttributeValue(c2);
|
|
1875
|
+
break;
|
|
1876
|
+
}
|
|
1877
|
+
case State.BeforeClosingTagName: {
|
|
1878
|
+
this.stateBeforeClosingTagName(c2);
|
|
1879
|
+
break;
|
|
1880
|
+
}
|
|
1881
|
+
case State.AfterClosingTagName: {
|
|
1882
|
+
this.stateAfterClosingTagName(c2);
|
|
1883
|
+
break;
|
|
1884
|
+
}
|
|
1885
|
+
case State.BeforeSpecialS: {
|
|
1886
|
+
this.stateBeforeSpecialS(c2);
|
|
1887
|
+
break;
|
|
1888
|
+
}
|
|
1889
|
+
case State.InAttributeValueNq: {
|
|
1890
|
+
this.stateInAttributeValueNoQuotes(c2);
|
|
1891
|
+
break;
|
|
1892
|
+
}
|
|
1893
|
+
case State.InSelfClosingTag: {
|
|
1894
|
+
this.stateInSelfClosingTag(c2);
|
|
1895
|
+
break;
|
|
1896
|
+
}
|
|
1897
|
+
case State.InDeclaration: {
|
|
1898
|
+
this.stateInDeclaration(c2);
|
|
1899
|
+
break;
|
|
1900
|
+
}
|
|
1901
|
+
case State.BeforeDeclaration: {
|
|
1902
|
+
this.stateBeforeDeclaration(c2);
|
|
1903
|
+
break;
|
|
1904
|
+
}
|
|
1905
|
+
case State.BeforeComment: {
|
|
1906
|
+
this.stateBeforeComment(c2);
|
|
1907
|
+
break;
|
|
1908
|
+
}
|
|
1909
|
+
case State.InProcessingInstruction: {
|
|
1910
|
+
this.stateInProcessingInstruction(c2);
|
|
1911
|
+
break;
|
|
1912
|
+
}
|
|
1913
|
+
case State.InNamedEntity: {
|
|
1914
|
+
this.stateInNamedEntity(c2);
|
|
1915
|
+
break;
|
|
1916
|
+
}
|
|
1917
|
+
case State.BeforeEntity: {
|
|
1918
|
+
this.stateBeforeEntity(c2);
|
|
1919
|
+
break;
|
|
1920
|
+
}
|
|
1921
|
+
case State.InHexEntity: {
|
|
1922
|
+
this.stateInHexEntity(c2);
|
|
1923
|
+
break;
|
|
1924
|
+
}
|
|
1925
|
+
case State.InNumericEntity: {
|
|
1926
|
+
this.stateInNumericEntity(c2);
|
|
1927
|
+
break;
|
|
1928
|
+
}
|
|
1929
|
+
default:
|
|
1930
|
+
this.stateBeforeNumericEntity(c2);
|
|
1931
|
+
}
|
|
1932
|
+
this.index++;
|
|
1933
|
+
}
|
|
1934
|
+
this.cleanup();
|
|
1935
|
+
}
|
|
1936
|
+
finish() {
|
|
1937
|
+
this.state === State.InNamedEntity && this.emitNamedEntity(), this.sectionStart < this.index && this.handleTrailingData(), this.cbs.onend();
|
|
1938
|
+
}
|
|
1939
|
+
/** Handle any trailing data. */
|
|
1940
|
+
handleTrailingData() {
|
|
1941
|
+
let endIndex = this.buffer.length + this.offset;
|
|
1942
|
+
this.state === State.InCommentLike ? this.currentSequence === Sequences.CdataEnd ? this.cbs.oncdata(this.sectionStart, endIndex, 0) : this.cbs.oncomment(this.sectionStart, endIndex, 0) : this.state === State.InNumericEntity && this.allowLegacyEntity() ? this.emitNumericEntity(!1) : this.state === State.InHexEntity && this.allowLegacyEntity() ? this.emitNumericEntity(!1) : this.state === State.InTagName || this.state === State.BeforeAttributeName || this.state === State.BeforeAttributeValue || this.state === State.AfterAttributeName || this.state === State.InAttributeName || this.state === State.InAttributeValueSq || this.state === State.InAttributeValueDq || this.state === State.InAttributeValueNq || this.state === State.InClosingTagName || this.cbs.ontext(this.sectionStart, endIndex);
|
|
1943
|
+
}
|
|
1944
|
+
emitPartial(start, endIndex) {
|
|
1945
|
+
this.baseState !== State.Text && this.baseState !== State.InSpecialTag ? this.cbs.onattribdata(start, endIndex) : this.cbs.ontext(start, endIndex);
|
|
1946
|
+
}
|
|
1947
|
+
emitCodePoint(cp) {
|
|
1948
|
+
this.baseState !== State.Text && this.baseState !== State.InSpecialTag ? this.cbs.onattribentity(cp) : this.cbs.ontextentity(cp);
|
|
1949
|
+
}
|
|
1950
|
+
};
|
|
1951
|
+
|
|
1952
|
+
// node_modules/htmlparser2/lib/esm/Parser.js
|
|
1953
|
+
var formTags = /* @__PURE__ */ new Set([
|
|
1954
|
+
"input",
|
|
1955
|
+
"option",
|
|
1956
|
+
"optgroup",
|
|
1957
|
+
"select",
|
|
1958
|
+
"button",
|
|
1959
|
+
"datalist",
|
|
1960
|
+
"textarea"
|
|
1961
|
+
]), pTag = /* @__PURE__ */ new Set(["p"]), tableSectionTags = /* @__PURE__ */ new Set(["thead", "tbody"]), ddtTags = /* @__PURE__ */ new Set(["dd", "dt"]), rtpTags = /* @__PURE__ */ new Set(["rt", "rp"]), openImpliesClose = /* @__PURE__ */ new Map([
|
|
1962
|
+
["tr", /* @__PURE__ */ new Set(["tr", "th", "td"])],
|
|
1963
|
+
["th", /* @__PURE__ */ new Set(["th"])],
|
|
1964
|
+
["td", /* @__PURE__ */ new Set(["thead", "th", "td"])],
|
|
1965
|
+
["body", /* @__PURE__ */ new Set(["head", "link", "script"])],
|
|
1966
|
+
["li", /* @__PURE__ */ new Set(["li"])],
|
|
1967
|
+
["p", pTag],
|
|
1968
|
+
["h1", pTag],
|
|
1969
|
+
["h2", pTag],
|
|
1970
|
+
["h3", pTag],
|
|
1971
|
+
["h4", pTag],
|
|
1972
|
+
["h5", pTag],
|
|
1973
|
+
["h6", pTag],
|
|
1974
|
+
["select", formTags],
|
|
1975
|
+
["input", formTags],
|
|
1976
|
+
["output", formTags],
|
|
1977
|
+
["button", formTags],
|
|
1978
|
+
["datalist", formTags],
|
|
1979
|
+
["textarea", formTags],
|
|
1980
|
+
["option", /* @__PURE__ */ new Set(["option"])],
|
|
1981
|
+
["optgroup", /* @__PURE__ */ new Set(["optgroup", "option"])],
|
|
1982
|
+
["dd", ddtTags],
|
|
1983
|
+
["dt", ddtTags],
|
|
1984
|
+
["address", pTag],
|
|
1985
|
+
["article", pTag],
|
|
1986
|
+
["aside", pTag],
|
|
1987
|
+
["blockquote", pTag],
|
|
1988
|
+
["details", pTag],
|
|
1989
|
+
["div", pTag],
|
|
1990
|
+
["dl", pTag],
|
|
1991
|
+
["fieldset", pTag],
|
|
1992
|
+
["figcaption", pTag],
|
|
1993
|
+
["figure", pTag],
|
|
1994
|
+
["footer", pTag],
|
|
1995
|
+
["form", pTag],
|
|
1996
|
+
["header", pTag],
|
|
1997
|
+
["hr", pTag],
|
|
1998
|
+
["main", pTag],
|
|
1999
|
+
["nav", pTag],
|
|
2000
|
+
["ol", pTag],
|
|
2001
|
+
["pre", pTag],
|
|
2002
|
+
["section", pTag],
|
|
2003
|
+
["table", pTag],
|
|
2004
|
+
["ul", pTag],
|
|
2005
|
+
["rt", rtpTags],
|
|
2006
|
+
["rp", rtpTags],
|
|
2007
|
+
["tbody", tableSectionTags],
|
|
2008
|
+
["tfoot", tableSectionTags]
|
|
2009
|
+
]), voidElements = /* @__PURE__ */ new Set([
|
|
2010
|
+
"area",
|
|
2011
|
+
"base",
|
|
2012
|
+
"basefont",
|
|
2013
|
+
"br",
|
|
2014
|
+
"col",
|
|
2015
|
+
"command",
|
|
2016
|
+
"embed",
|
|
2017
|
+
"frame",
|
|
2018
|
+
"hr",
|
|
2019
|
+
"img",
|
|
2020
|
+
"input",
|
|
2021
|
+
"isindex",
|
|
2022
|
+
"keygen",
|
|
2023
|
+
"link",
|
|
2024
|
+
"meta",
|
|
2025
|
+
"param",
|
|
2026
|
+
"source",
|
|
2027
|
+
"track",
|
|
2028
|
+
"wbr"
|
|
2029
|
+
]), foreignContextElements = /* @__PURE__ */ new Set(["math", "svg"]), htmlIntegrationElements = /* @__PURE__ */ new Set([
|
|
2030
|
+
"mi",
|
|
2031
|
+
"mo",
|
|
2032
|
+
"mn",
|
|
2033
|
+
"ms",
|
|
2034
|
+
"mtext",
|
|
2035
|
+
"annotation-xml",
|
|
2036
|
+
"foreignobject",
|
|
2037
|
+
"desc",
|
|
2038
|
+
"title"
|
|
2039
|
+
]), reNameEnd = /\s|\//, Parser = class {
|
|
2040
|
+
constructor(cbs, options = {}) {
|
|
2041
|
+
var _a2, _b, _c, _d, _e;
|
|
2042
|
+
this.options = options, this.startIndex = 0, this.endIndex = 0, this.openTagStart = 0, this.tagname = "", this.attribname = "", this.attribvalue = "", this.attribs = null, this.stack = [], this.foreignContext = [], this.buffers = [], this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1, this.cbs = cbs ?? {}, this.lowerCaseTagNames = (_a2 = options.lowerCaseTags) !== null && _a2 !== void 0 ? _a2 : !options.xmlMode, this.lowerCaseAttributeNames = (_b = options.lowerCaseAttributeNames) !== null && _b !== void 0 ? _b : !options.xmlMode, this.tokenizer = new ((_c = options.Tokenizer) !== null && _c !== void 0 ? _c : Tokenizer)(this.options, this), (_e = (_d = this.cbs).onparserinit) === null || _e === void 0 || _e.call(_d, this);
|
|
2043
|
+
}
|
|
2044
|
+
// Tokenizer event handlers
|
|
2045
|
+
/** @internal */
|
|
2046
|
+
ontext(start, endIndex) {
|
|
2047
|
+
var _a2, _b;
|
|
2048
|
+
let data = this.getSlice(start, endIndex);
|
|
2049
|
+
this.endIndex = endIndex - 1, (_b = (_a2 = this.cbs).ontext) === null || _b === void 0 || _b.call(_a2, data), this.startIndex = endIndex;
|
|
2050
|
+
}
|
|
2051
|
+
/** @internal */
|
|
2052
|
+
ontextentity(cp) {
|
|
2053
|
+
var _a2, _b;
|
|
2054
|
+
let index = this.tokenizer.getSectionStart();
|
|
2055
|
+
this.endIndex = index - 1, (_b = (_a2 = this.cbs).ontext) === null || _b === void 0 || _b.call(_a2, fromCodePoint(cp)), this.startIndex = index;
|
|
2056
|
+
}
|
|
2057
|
+
isVoidElement(name2) {
|
|
2058
|
+
return !this.options.xmlMode && voidElements.has(name2);
|
|
2059
|
+
}
|
|
2060
|
+
/** @internal */
|
|
2061
|
+
onopentagname(start, endIndex) {
|
|
2062
|
+
this.endIndex = endIndex;
|
|
2063
|
+
let name2 = this.getSlice(start, endIndex);
|
|
2064
|
+
this.lowerCaseTagNames && (name2 = name2.toLowerCase()), this.emitOpenTag(name2);
|
|
2065
|
+
}
|
|
2066
|
+
emitOpenTag(name2) {
|
|
2067
|
+
var _a2, _b, _c, _d;
|
|
2068
|
+
this.openTagStart = this.startIndex, this.tagname = name2;
|
|
2069
|
+
let impliesClose = !this.options.xmlMode && openImpliesClose.get(name2);
|
|
2070
|
+
if (impliesClose)
|
|
2071
|
+
for (; this.stack.length > 0 && impliesClose.has(this.stack[this.stack.length - 1]); ) {
|
|
2072
|
+
let element = this.stack.pop();
|
|
2073
|
+
(_b = (_a2 = this.cbs).onclosetag) === null || _b === void 0 || _b.call(_a2, element, !0);
|
|
2074
|
+
}
|
|
2075
|
+
this.isVoidElement(name2) || (this.stack.push(name2), foreignContextElements.has(name2) ? this.foreignContext.push(!0) : htmlIntegrationElements.has(name2) && this.foreignContext.push(!1)), (_d = (_c = this.cbs).onopentagname) === null || _d === void 0 || _d.call(_c, name2), this.cbs.onopentag && (this.attribs = {});
|
|
2076
|
+
}
|
|
2077
|
+
endOpenTag(isImplied) {
|
|
2078
|
+
var _a2, _b;
|
|
2079
|
+
this.startIndex = this.openTagStart, this.attribs && ((_b = (_a2 = this.cbs).onopentag) === null || _b === void 0 || _b.call(_a2, this.tagname, this.attribs, isImplied), this.attribs = null), this.cbs.onclosetag && this.isVoidElement(this.tagname) && this.cbs.onclosetag(this.tagname, !0), this.tagname = "";
|
|
2080
|
+
}
|
|
2081
|
+
/** @internal */
|
|
2082
|
+
onopentagend(endIndex) {
|
|
2083
|
+
this.endIndex = endIndex, this.endOpenTag(!1), this.startIndex = endIndex + 1;
|
|
2084
|
+
}
|
|
2085
|
+
/** @internal */
|
|
2086
|
+
onclosetag(start, endIndex) {
|
|
2087
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
2088
|
+
this.endIndex = endIndex;
|
|
2089
|
+
let name2 = this.getSlice(start, endIndex);
|
|
2090
|
+
if (this.lowerCaseTagNames && (name2 = name2.toLowerCase()), (foreignContextElements.has(name2) || htmlIntegrationElements.has(name2)) && this.foreignContext.pop(), this.isVoidElement(name2))
|
|
2091
|
+
!this.options.xmlMode && name2 === "br" && ((_b = (_a2 = this.cbs).onopentagname) === null || _b === void 0 || _b.call(_a2, "br"), (_d = (_c = this.cbs).onopentag) === null || _d === void 0 || _d.call(_c, "br", {}, !0), (_f = (_e = this.cbs).onclosetag) === null || _f === void 0 || _f.call(_e, "br", !1));
|
|
2092
|
+
else {
|
|
2093
|
+
let pos = this.stack.lastIndexOf(name2);
|
|
2094
|
+
if (pos !== -1)
|
|
2095
|
+
if (this.cbs.onclosetag) {
|
|
2096
|
+
let count = this.stack.length - pos;
|
|
2097
|
+
for (; count--; )
|
|
2098
|
+
this.cbs.onclosetag(this.stack.pop(), count !== 0);
|
|
2099
|
+
} else
|
|
2100
|
+
this.stack.length = pos;
|
|
2101
|
+
else !this.options.xmlMode && name2 === "p" && (this.emitOpenTag("p"), this.closeCurrentTag(!0));
|
|
2102
|
+
}
|
|
2103
|
+
this.startIndex = endIndex + 1;
|
|
2104
|
+
}
|
|
2105
|
+
/** @internal */
|
|
2106
|
+
onselfclosingtag(endIndex) {
|
|
2107
|
+
this.endIndex = endIndex, this.options.xmlMode || this.options.recognizeSelfClosing || this.foreignContext[this.foreignContext.length - 1] ? (this.closeCurrentTag(!1), this.startIndex = endIndex + 1) : this.onopentagend(endIndex);
|
|
2108
|
+
}
|
|
2109
|
+
closeCurrentTag(isOpenImplied) {
|
|
2110
|
+
var _a2, _b;
|
|
2111
|
+
let name2 = this.tagname;
|
|
2112
|
+
this.endOpenTag(isOpenImplied), this.stack[this.stack.length - 1] === name2 && ((_b = (_a2 = this.cbs).onclosetag) === null || _b === void 0 || _b.call(_a2, name2, !isOpenImplied), this.stack.pop());
|
|
2113
|
+
}
|
|
2114
|
+
/** @internal */
|
|
2115
|
+
onattribname(start, endIndex) {
|
|
2116
|
+
this.startIndex = start;
|
|
2117
|
+
let name2 = this.getSlice(start, endIndex);
|
|
2118
|
+
this.attribname = this.lowerCaseAttributeNames ? name2.toLowerCase() : name2;
|
|
2119
|
+
}
|
|
2120
|
+
/** @internal */
|
|
2121
|
+
onattribdata(start, endIndex) {
|
|
2122
|
+
this.attribvalue += this.getSlice(start, endIndex);
|
|
2123
|
+
}
|
|
2124
|
+
/** @internal */
|
|
2125
|
+
onattribentity(cp) {
|
|
2126
|
+
this.attribvalue += fromCodePoint(cp);
|
|
2127
|
+
}
|
|
2128
|
+
/** @internal */
|
|
2129
|
+
onattribend(quote, endIndex) {
|
|
2130
|
+
var _a2, _b;
|
|
2131
|
+
this.endIndex = endIndex, (_b = (_a2 = this.cbs).onattribute) === null || _b === void 0 || _b.call(_a2, this.attribname, this.attribvalue, quote === QuoteType.Double ? '"' : quote === QuoteType.Single ? "'" : quote === QuoteType.NoValue ? void 0 : null), this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname) && (this.attribs[this.attribname] = this.attribvalue), this.attribvalue = "";
|
|
2132
|
+
}
|
|
2133
|
+
getInstructionName(value) {
|
|
2134
|
+
let index = value.search(reNameEnd), name2 = index < 0 ? value : value.substr(0, index);
|
|
2135
|
+
return this.lowerCaseTagNames && (name2 = name2.toLowerCase()), name2;
|
|
2136
|
+
}
|
|
2137
|
+
/** @internal */
|
|
2138
|
+
ondeclaration(start, endIndex) {
|
|
2139
|
+
this.endIndex = endIndex;
|
|
2140
|
+
let value = this.getSlice(start, endIndex);
|
|
2141
|
+
if (this.cbs.onprocessinginstruction) {
|
|
2142
|
+
let name2 = this.getInstructionName(value);
|
|
2143
|
+
this.cbs.onprocessinginstruction(`!${name2}`, `!${value}`);
|
|
2144
|
+
}
|
|
2145
|
+
this.startIndex = endIndex + 1;
|
|
2146
|
+
}
|
|
2147
|
+
/** @internal */
|
|
2148
|
+
onprocessinginstruction(start, endIndex) {
|
|
2149
|
+
this.endIndex = endIndex;
|
|
2150
|
+
let value = this.getSlice(start, endIndex);
|
|
2151
|
+
if (this.cbs.onprocessinginstruction) {
|
|
2152
|
+
let name2 = this.getInstructionName(value);
|
|
2153
|
+
this.cbs.onprocessinginstruction(`?${name2}`, `?${value}`);
|
|
2154
|
+
}
|
|
2155
|
+
this.startIndex = endIndex + 1;
|
|
2156
|
+
}
|
|
2157
|
+
/** @internal */
|
|
2158
|
+
oncomment(start, endIndex, offset) {
|
|
2159
|
+
var _a2, _b, _c, _d;
|
|
2160
|
+
this.endIndex = endIndex, (_b = (_a2 = this.cbs).oncomment) === null || _b === void 0 || _b.call(_a2, this.getSlice(start, endIndex - offset)), (_d = (_c = this.cbs).oncommentend) === null || _d === void 0 || _d.call(_c), this.startIndex = endIndex + 1;
|
|
2161
|
+
}
|
|
2162
|
+
/** @internal */
|
|
2163
|
+
oncdata(start, endIndex, offset) {
|
|
2164
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2165
|
+
this.endIndex = endIndex;
|
|
2166
|
+
let value = this.getSlice(start, endIndex - offset);
|
|
2167
|
+
this.options.xmlMode || this.options.recognizeCDATA ? ((_b = (_a2 = this.cbs).oncdatastart) === null || _b === void 0 || _b.call(_a2), (_d = (_c = this.cbs).ontext) === null || _d === void 0 || _d.call(_c, value), (_f = (_e = this.cbs).oncdataend) === null || _f === void 0 || _f.call(_e)) : ((_h = (_g = this.cbs).oncomment) === null || _h === void 0 || _h.call(_g, `[CDATA[${value}]]`), (_k = (_j = this.cbs).oncommentend) === null || _k === void 0 || _k.call(_j)), this.startIndex = endIndex + 1;
|
|
2168
|
+
}
|
|
2169
|
+
/** @internal */
|
|
2170
|
+
onend() {
|
|
2171
|
+
var _a2, _b;
|
|
2172
|
+
if (this.cbs.onclosetag) {
|
|
2173
|
+
this.endIndex = this.startIndex;
|
|
2174
|
+
for (let index = this.stack.length; index > 0; this.cbs.onclosetag(this.stack[--index], !0))
|
|
2175
|
+
;
|
|
2176
|
+
}
|
|
2177
|
+
(_b = (_a2 = this.cbs).onend) === null || _b === void 0 || _b.call(_a2);
|
|
2178
|
+
}
|
|
2179
|
+
/**
|
|
2180
|
+
* Resets the parser to a blank state, ready to parse a new HTML document
|
|
2181
|
+
*/
|
|
2182
|
+
reset() {
|
|
2183
|
+
var _a2, _b, _c, _d;
|
|
2184
|
+
(_b = (_a2 = this.cbs).onreset) === null || _b === void 0 || _b.call(_a2), this.tokenizer.reset(), this.tagname = "", this.attribname = "", this.attribs = null, this.stack.length = 0, this.startIndex = 0, this.endIndex = 0, (_d = (_c = this.cbs).onparserinit) === null || _d === void 0 || _d.call(_c, this), this.buffers.length = 0, this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1;
|
|
2185
|
+
}
|
|
2186
|
+
/**
|
|
2187
|
+
* Resets the parser, then parses a complete document and
|
|
2188
|
+
* pushes it to the handler.
|
|
2189
|
+
*
|
|
2190
|
+
* @param data Document to parse.
|
|
2191
|
+
*/
|
|
2192
|
+
parseComplete(data) {
|
|
2193
|
+
this.reset(), this.end(data);
|
|
2194
|
+
}
|
|
2195
|
+
getSlice(start, end) {
|
|
2196
|
+
for (; start - this.bufferOffset >= this.buffers[0].length; )
|
|
2197
|
+
this.shiftBuffer();
|
|
2198
|
+
let slice = this.buffers[0].slice(start - this.bufferOffset, end - this.bufferOffset);
|
|
2199
|
+
for (; end - this.bufferOffset > this.buffers[0].length; )
|
|
2200
|
+
this.shiftBuffer(), slice += this.buffers[0].slice(0, end - this.bufferOffset);
|
|
2201
|
+
return slice;
|
|
2202
|
+
}
|
|
2203
|
+
shiftBuffer() {
|
|
2204
|
+
this.bufferOffset += this.buffers[0].length, this.writeIndex--, this.buffers.shift();
|
|
2205
|
+
}
|
|
2206
|
+
/**
|
|
2207
|
+
* Parses a chunk of data and calls the corresponding callbacks.
|
|
2208
|
+
*
|
|
2209
|
+
* @param chunk Chunk to parse.
|
|
2210
|
+
*/
|
|
2211
|
+
write(chunk) {
|
|
2212
|
+
var _a2, _b;
|
|
2213
|
+
if (this.ended) {
|
|
2214
|
+
(_b = (_a2 = this.cbs).onerror) === null || _b === void 0 || _b.call(_a2, new Error(".write() after done!"));
|
|
2215
|
+
return;
|
|
2216
|
+
}
|
|
2217
|
+
this.buffers.push(chunk), this.tokenizer.running && (this.tokenizer.write(chunk), this.writeIndex++);
|
|
2218
|
+
}
|
|
2219
|
+
/**
|
|
2220
|
+
* Parses the end of the buffer and clears the stack, calls onend.
|
|
2221
|
+
*
|
|
2222
|
+
* @param chunk Optional final chunk to parse.
|
|
2223
|
+
*/
|
|
2224
|
+
end(chunk) {
|
|
2225
|
+
var _a2, _b;
|
|
2226
|
+
if (this.ended) {
|
|
2227
|
+
(_b = (_a2 = this.cbs).onerror) === null || _b === void 0 || _b.call(_a2, new Error(".end() after done!"));
|
|
2228
|
+
return;
|
|
2229
|
+
}
|
|
2230
|
+
chunk && this.write(chunk), this.ended = !0, this.tokenizer.end();
|
|
2231
|
+
}
|
|
2232
|
+
/**
|
|
2233
|
+
* Pauses parsing. The parser won't emit events until `resume` is called.
|
|
2234
|
+
*/
|
|
2235
|
+
pause() {
|
|
2236
|
+
this.tokenizer.pause();
|
|
2237
|
+
}
|
|
2238
|
+
/**
|
|
2239
|
+
* Resumes parsing after `pause` was called.
|
|
2240
|
+
*/
|
|
2241
|
+
resume() {
|
|
2242
|
+
for (this.tokenizer.resume(); this.tokenizer.running && this.writeIndex < this.buffers.length; )
|
|
2243
|
+
this.tokenizer.write(this.buffers[this.writeIndex++]);
|
|
2244
|
+
this.ended && this.tokenizer.end();
|
|
2245
|
+
}
|
|
2246
|
+
/**
|
|
2247
|
+
* Alias of `write`, for backwards compatibility.
|
|
2248
|
+
*
|
|
2249
|
+
* @param chunk Chunk to parse.
|
|
2250
|
+
* @deprecated
|
|
2251
|
+
*/
|
|
2252
|
+
parseChunk(chunk) {
|
|
2253
|
+
this.write(chunk);
|
|
2254
|
+
}
|
|
2255
|
+
/**
|
|
2256
|
+
* Alias of `end`, for backwards compatibility.
|
|
2257
|
+
*
|
|
2258
|
+
* @param chunk Optional final chunk to parse.
|
|
2259
|
+
* @deprecated
|
|
2260
|
+
*/
|
|
2261
|
+
done(chunk) {
|
|
2262
|
+
this.end(chunk);
|
|
2263
|
+
}
|
|
2264
|
+
};
|
|
2265
|
+
|
|
2266
|
+
// node_modules/entities/lib/esm/generated/encode-html.js
|
|
2267
|
+
function restoreDiff(arr) {
|
|
2268
|
+
for (let i = 1; i < arr.length; i++)
|
|
2269
|
+
arr[i][0] += arr[i - 1][0] + 1;
|
|
2270
|
+
return arr;
|
|
2271
|
+
}
|
|
2272
|
+
var encode_html_default = new Map(/* @__PURE__ */ restoreDiff([[9, "	"], [0, "
"], [22, "!"], [0, """], [0, "#"], [0, "$"], [0, "%"], [0, "&"], [0, "'"], [0, "("], [0, ")"], [0, "*"], [0, "+"], [0, ","], [1, "."], [0, "/"], [10, ":"], [0, ";"], [0, { v: "<", n: 8402, o: "<⃒" }], [0, { v: "=", n: 8421, o: "=⃥" }], [0, { v: ">", n: 8402, o: ">⃒" }], [0, "?"], [0, "@"], [26, "["], [0, "\"], [0, "]"], [0, "^"], [0, "_"], [0, "`"], [5, { n: 106, o: "fj" }], [20, "{"], [0, "|"], [0, "}"], [34, " "], [0, "¡"], [0, "¢"], [0, "£"], [0, "¤"], [0, "¥"], [0, "¦"], [0, "§"], [0, "¨"], [0, "©"], [0, "ª"], [0, "«"], [0, "¬"], [0, "­"], [0, "®"], [0, "¯"], [0, "°"], [0, "±"], [0, "²"], [0, "³"], [0, "´"], [0, "µ"], [0, "¶"], [0, "·"], [0, "¸"], [0, "¹"], [0, "º"], [0, "»"], [0, "¼"], [0, "½"], [0, "¾"], [0, "¿"], [0, "À"], [0, "Á"], [0, "Â"], [0, "Ã"], [0, "Ä"], [0, "Å"], [0, "Æ"], [0, "Ç"], [0, "È"], [0, "É"], [0, "Ê"], [0, "Ë"], [0, "Ì"], [0, "Í"], [0, "Î"], [0, "Ï"], [0, "Ð"], [0, "Ñ"], [0, "Ò"], [0, "Ó"], [0, "Ô"], [0, "Õ"], [0, "Ö"], [0, "×"], [0, "Ø"], [0, "Ù"], [0, "Ú"], [0, "Û"], [0, "Ü"], [0, "Ý"], [0, "Þ"], [0, "ß"], [0, "à"], [0, "á"], [0, "â"], [0, "ã"], [0, "ä"], [0, "å"], [0, "æ"], [0, "ç"], [0, "è"], [0, "é"], [0, "ê"], [0, "ë"], [0, "ì"], [0, "í"], [0, "î"], [0, "ï"], [0, "ð"], [0, "ñ"], [0, "ò"], [0, "ó"], [0, "ô"], [0, "õ"], [0, "ö"], [0, "÷"], [0, "ø"], [0, "ù"], [0, "ú"], [0, "û"], [0, "ü"], [0, "ý"], [0, "þ"], [0, "ÿ"], [0, "Ā"], [0, "ā"], [0, "Ă"], [0, "ă"], [0, "Ą"], [0, "ą"], [0, "Ć"], [0, "ć"], [0, "Ĉ"], [0, "ĉ"], [0, "Ċ"], [0, "ċ"], [0, "Č"], [0, "č"], [0, "Ď"], [0, "ď"], [0, "Đ"], [0, "đ"], [0, "Ē"], [0, "ē"], [2, "Ė"], [0, "ė"], [0, "Ę"], [0, "ę"], [0, "Ě"], [0, "ě"], [0, "Ĝ"], [0, "ĝ"], [0, "Ğ"], [0, "ğ"], [0, "Ġ"], [0, "ġ"], [0, "Ģ"], [1, "Ĥ"], [0, "ĥ"], [0, "Ħ"], [0, "ħ"], [0, "Ĩ"], [0, "ĩ"], [0, "Ī"], [0, "ī"], [2, "Į"], [0, "į"], [0, "İ"], [0, "ı"], [0, "IJ"], [0, "ij"], [0, "Ĵ"], [0, "ĵ"], [0, "Ķ"], [0, "ķ"], [0, "ĸ"], [0, "Ĺ"], [0, "ĺ"], [0, "Ļ"], [0, "ļ"], [0, "Ľ"], [0, "ľ"], [0, "Ŀ"], [0, "ŀ"], [0, "Ł"], [0, "ł"], [0, "Ń"], [0, "ń"], [0, "Ņ"], [0, "ņ"], [0, "Ň"], [0, "ň"], [0, "ʼn"], [0, "Ŋ"], [0, "ŋ"], [0, "Ō"], [0, "ō"], [2, "Ő"], [0, "ő"], [0, "Œ"], [0, "œ"], [0, "Ŕ"], [0, "ŕ"], [0, "Ŗ"], [0, "ŗ"], [0, "Ř"], [0, "ř"], [0, "Ś"], [0, "ś"], [0, "Ŝ"], [0, "ŝ"], [0, "Ş"], [0, "ş"], [0, "Š"], [0, "š"], [0, "Ţ"], [0, "ţ"], [0, "Ť"], [0, "ť"], [0, "Ŧ"], [0, "ŧ"], [0, "Ũ"], [0, "ũ"], [0, "Ū"], [0, "ū"], [0, "Ŭ"], [0, "ŭ"], [0, "Ů"], [0, "ů"], [0, "Ű"], [0, "ű"], [0, "Ų"], [0, "ų"], [0, "Ŵ"], [0, "ŵ"], [0, "Ŷ"], [0, "ŷ"], [0, "Ÿ"], [0, "Ź"], [0, "ź"], [0, "Ż"], [0, "ż"], [0, "Ž"], [0, "ž"], [19, "ƒ"], [34, "Ƶ"], [63, "ǵ"], [65, "ȷ"], [142, "ˆ"], [0, "ˇ"], [16, "˘"], [0, "˙"], [0, "˚"], [0, "˛"], [0, "˜"], [0, "˝"], [51, "̑"], [127, "Α"], [0, "Β"], [0, "Γ"], [0, "Δ"], [0, "Ε"], [0, "Ζ"], [0, "Η"], [0, "Θ"], [0, "Ι"], [0, "Κ"], [0, "Λ"], [0, "Μ"], [0, "Ν"], [0, "Ξ"], [0, "Ο"], [0, "Π"], [0, "Ρ"], [1, "Σ"], [0, "Τ"], [0, "Υ"], [0, "Φ"], [0, "Χ"], [0, "Ψ"], [0, "Ω"], [7, "α"], [0, "β"], [0, "γ"], [0, "δ"], [0, "ε"], [0, "ζ"], [0, "η"], [0, "θ"], [0, "ι"], [0, "κ"], [0, "λ"], [0, "μ"], [0, "ν"], [0, "ξ"], [0, "ο"], [0, "π"], [0, "ρ"], [0, "ς"], [0, "σ"], [0, "τ"], [0, "υ"], [0, "φ"], [0, "χ"], [0, "ψ"], [0, "ω"], [7, "ϑ"], [0, "ϒ"], [2, "ϕ"], [0, "ϖ"], [5, "Ϝ"], [0, "ϝ"], [18, "ϰ"], [0, "ϱ"], [3, "ϵ"], [0, "϶"], [10, "Ё"], [0, "Ђ"], [0, "Ѓ"], [0, "Є"], [0, "Ѕ"], [0, "І"], [0, "Ї"], [0, "Ј"], [0, "Љ"], [0, "Њ"], [0, "Ћ"], [0, "Ќ"], [1, "Ў"], [0, "Џ"], [0, "А"], [0, "Б"], [0, "В"], [0, "Г"], [0, "Д"], [0, "Е"], [0, "Ж"], [0, "З"], [0, "И"], [0, "Й"], [0, "К"], [0, "Л"], [0, "М"], [0, "Н"], [0, "О"], [0, "П"], [0, "Р"], [0, "С"], [0, "Т"], [0, "У"], [0, "Ф"], [0, "Х"], [0, "Ц"], [0, "Ч"], [0, "Ш"], [0, "Щ"], [0, "Ъ"], [0, "Ы"], [0, "Ь"], [0, "Э"], [0, "Ю"], [0, "Я"], [0, "а"], [0, "б"], [0, "в"], [0, "г"], [0, "д"], [0, "е"], [0, "ж"], [0, "з"], [0, "и"], [0, "й"], [0, "к"], [0, "л"], [0, "м"], [0, "н"], [0, "о"], [0, "п"], [0, "р"], [0, "с"], [0, "т"], [0, "у"], [0, "ф"], [0, "х"], [0, "ц"], [0, "ч"], [0, "ш"], [0, "щ"], [0, "ъ"], [0, "ы"], [0, "ь"], [0, "э"], [0, "ю"], [0, "я"], [1, "ё"], [0, "ђ"], [0, "ѓ"], [0, "є"], [0, "ѕ"], [0, "і"], [0, "ї"], [0, "ј"], [0, "љ"], [0, "њ"], [0, "ћ"], [0, "ќ"], [1, "ў"], [0, "џ"], [7074, " "], [0, " "], [0, " "], [0, " "], [1, " "], [0, " "], [0, " "], [0, " "], [0, "​"], [0, "‌"], [0, "‍"], [0, "‎"], [0, "‏"], [0, "‐"], [2, "–"], [0, "—"], [0, "―"], [0, "‖"], [1, "‘"], [0, "’"], [0, "‚"], [1, "“"], [0, "”"], [0, "„"], [1, "†"], [0, "‡"], [0, "•"], [2, "‥"], [0, "…"], [9, "‰"], [0, "‱"], [0, "′"], [0, "″"], [0, "‴"], [0, "‵"], [3, "‹"], [0, "›"], [3, "‾"], [2, "⁁"], [1, "⁃"], [0, "⁄"], [10, "⁏"], [7, "⁗"], [7, { v: " ", n: 8202, o: "  " }], [0, "⁠"], [0, "⁡"], [0, "⁢"], [0, "⁣"], [72, "€"], [46, "⃛"], [0, "⃜"], [37, "ℂ"], [2, "℅"], [4, "ℊ"], [0, "ℋ"], [0, "ℌ"], [0, "ℍ"], [0, "ℎ"], [0, "ℏ"], [0, "ℐ"], [0, "ℑ"], [0, "ℒ"], [0, "ℓ"], [1, "ℕ"], [0, "№"], [0, "℗"], [0, "℘"], [0, "ℙ"], [0, "ℚ"], [0, "ℛ"], [0, "ℜ"], [0, "ℝ"], [0, "℞"], [3, "™"], [1, "ℤ"], [2, "℧"], [0, "ℨ"], [0, "℩"], [2, "ℬ"], [0, "ℭ"], [1, "ℯ"], [0, "ℰ"], [0, "ℱ"], [1, "ℳ"], [0, "ℴ"], [0, "ℵ"], [0, "ℶ"], [0, "ℷ"], [0, "ℸ"], [12, "ⅅ"], [0, "ⅆ"], [0, "ⅇ"], [0, "ⅈ"], [10, "⅓"], [0, "⅔"], [0, "⅕"], [0, "⅖"], [0, "⅗"], [0, "⅘"], [0, "⅙"], [0, "⅚"], [0, "⅛"], [0, "⅜"], [0, "⅝"], [0, "⅞"], [49, "←"], [0, "↑"], [0, "→"], [0, "↓"], [0, "↔"], [0, "↕"], [0, "↖"], [0, "↗"], [0, "↘"], [0, "↙"], [0, "↚"], [0, "↛"], [1, { v: "↝", n: 824, o: "↝̸" }], [0, "↞"], [0, "↟"], [0, "↠"], [0, "↡"], [0, "↢"], [0, "↣"], [0, "↤"], [0, "↥"], [0, "↦"], [0, "↧"], [1, "↩"], [0, "↪"], [0, "↫"], [0, "↬"], [0, "↭"], [0, "↮"], [1, "↰"], [0, "↱"], [0, "↲"], [0, "↳"], [1, "↵"], [0, "↶"], [0, "↷"], [2, "↺"], [0, "↻"], [0, "↼"], [0, "↽"], [0, "↾"], [0, "↿"], [0, "⇀"], [0, "⇁"], [0, "⇂"], [0, "⇃"], [0, "⇄"], [0, "⇅"], [0, "⇆"], [0, "⇇"], [0, "⇈"], [0, "⇉"], [0, "⇊"], [0, "⇋"], [0, "⇌"], [0, "⇍"], [0, "⇎"], [0, "⇏"], [0, "⇐"], [0, "⇑"], [0, "⇒"], [0, "⇓"], [0, "⇔"], [0, "⇕"], [0, "⇖"], [0, "⇗"], [0, "⇘"], [0, "⇙"], [0, "⇚"], [0, "⇛"], [1, "⇝"], [6, "⇤"], [0, "⇥"], [15, "⇵"], [7, "⇽"], [0, "⇾"], [0, "⇿"], [0, "∀"], [0, "∁"], [0, { v: "∂", n: 824, o: "∂̸" }], [0, "∃"], [0, "∄"], [0, "∅"], [1, "∇"], [0, "∈"], [0, "∉"], [1, "∋"], [0, "∌"], [2, "∏"], [0, "∐"], [0, "∑"], [0, "−"], [0, "∓"], [0, "∔"], [1, "∖"], [0, "∗"], [0, "∘"], [1, "√"], [2, "∝"], [0, "∞"], [0, "∟"], [0, { v: "∠", n: 8402, o: "∠⃒" }], [0, "∡"], [0, "∢"], [0, "∣"], [0, "∤"], [0, "∥"], [0, "∦"], [0, "∧"], [0, "∨"], [0, { v: "∩", n: 65024, o: "∩︀" }], [0, { v: "∪", n: 65024, o: "∪︀" }], [0, "∫"], [0, "∬"], [0, "∭"], [0, "∮"], [0, "∯"], [0, "∰"], [0, "∱"], [0, "∲"], [0, "∳"], [0, "∴"], [0, "∵"], [0, "∶"], [0, "∷"], [0, "∸"], [1, "∺"], [0, "∻"], [0, { v: "∼", n: 8402, o: "∼⃒" }], [0, { v: "∽", n: 817, o: "∽̱" }], [0, { v: "∾", n: 819, o: "∾̳" }], [0, "∿"], [0, "≀"], [0, "≁"], [0, { v: "≂", n: 824, o: "≂̸" }], [0, "≃"], [0, "≄"], [0, "≅"], [0, "≆"], [0, "≇"], [0, "≈"], [0, "≉"], [0, "≊"], [0, { v: "≋", n: 824, o: "≋̸" }], [0, "≌"], [0, { v: "≍", n: 8402, o: "≍⃒" }], [0, { v: "≎", n: 824, o: "≎̸" }], [0, { v: "≏", n: 824, o: "≏̸" }], [0, { v: "≐", n: 824, o: "≐̸" }], [0, "≑"], [0, "≒"], [0, "≓"], [0, "≔"], [0, "≕"], [0, "≖"], [0, "≗"], [1, "≙"], [0, "≚"], [1, "≜"], [2, "≟"], [0, "≠"], [0, { v: "≡", n: 8421, o: "≡⃥" }], [0, "≢"], [1, { v: "≤", n: 8402, o: "≤⃒" }], [0, { v: "≥", n: 8402, o: "≥⃒" }], [0, { v: "≦", n: 824, o: "≦̸" }], [0, { v: "≧", n: 824, o: "≧̸" }], [0, { v: "≨", n: 65024, o: "≨︀" }], [0, { v: "≩", n: 65024, o: "≩︀" }], [0, { v: "≪", n: new Map(/* @__PURE__ */ restoreDiff([[824, "≪̸"], [7577, "≪⃒"]])) }], [0, { v: "≫", n: new Map(/* @__PURE__ */ restoreDiff([[824, "≫̸"], [7577, "≫⃒"]])) }], [0, "≬"], [0, "≭"], [0, "≮"], [0, "≯"], [0, "≰"], [0, "≱"], [0, "≲"], [0, "≳"], [0, "≴"], [0, "≵"], [0, "≶"], [0, "≷"], [0, "≸"], [0, "≹"], [0, "≺"], [0, "≻"], [0, "≼"], [0, "≽"], [0, "≾"], [0, { v: "≿", n: 824, o: "≿̸" }], [0, "⊀"], [0, "⊁"], [0, { v: "⊂", n: 8402, o: "⊂⃒" }], [0, { v: "⊃", n: 8402, o: "⊃⃒" }], [0, "⊄"], [0, "⊅"], [0, "⊆"], [0, "⊇"], [0, "⊈"], [0, "⊉"], [0, { v: "⊊", n: 65024, o: "⊊︀" }], [0, { v: "⊋", n: 65024, o: "⊋︀" }], [1, "⊍"], [0, "⊎"], [0, { v: "⊏", n: 824, o: "⊏̸" }], [0, { v: "⊐", n: 824, o: "⊐̸" }], [0, "⊑"], [0, "⊒"], [0, { v: "⊓", n: 65024, o: "⊓︀" }], [0, { v: "⊔", n: 65024, o: "⊔︀" }], [0, "⊕"], [0, "⊖"], [0, "⊗"], [0, "⊘"], [0, "⊙"], [0, "⊚"], [0, "⊛"], [1, "⊝"], [0, "⊞"], [0, "⊟"], [0, "⊠"], [0, "⊡"], [0, "⊢"], [0, "⊣"], [0, "⊤"], [0, "⊥"], [1, "⊧"], [0, "⊨"], [0, "⊩"], [0, "⊪"], [0, "⊫"], [0, "⊬"], [0, "⊭"], [0, "⊮"], [0, "⊯"], [0, "⊰"], [1, "⊲"], [0, "⊳"], [0, { v: "⊴", n: 8402, o: "⊴⃒" }], [0, { v: "⊵", n: 8402, o: "⊵⃒" }], [0, "⊶"], [0, "⊷"], [0, "⊸"], [0, "⊹"], [0, "⊺"], [0, "⊻"], [1, "⊽"], [0, "⊾"], [0, "⊿"], [0, "⋀"], [0, "⋁"], [0, "⋂"], [0, "⋃"], [0, "⋄"], [0, "⋅"], [0, "⋆"], [0, "⋇"], [0, "⋈"], [0, "⋉"], [0, "⋊"], [0, "⋋"], [0, "⋌"], [0, "⋍"], [0, "⋎"], [0, "⋏"], [0, "⋐"], [0, "⋑"], [0, "⋒"], [0, "⋓"], [0, "⋔"], [0, "⋕"], [0, "⋖"], [0, "⋗"], [0, { v: "⋘", n: 824, o: "⋘̸" }], [0, { v: "⋙", n: 824, o: "⋙̸" }], [0, { v: "⋚", n: 65024, o: "⋚︀" }], [0, { v: "⋛", n: 65024, o: "⋛︀" }], [2, "⋞"], [0, "⋟"], [0, "⋠"], [0, "⋡"], [0, "⋢"], [0, "⋣"], [2, "⋦"], [0, "⋧"], [0, "⋨"], [0, "⋩"], [0, "⋪"], [0, "⋫"], [0, "⋬"], [0, "⋭"], [0, "⋮"], [0, "⋯"], [0, "⋰"], [0, "⋱"], [0, "⋲"], [0, "⋳"], [0, "⋴"], [0, { v: "⋵", n: 824, o: "⋵̸" }], [0, "⋶"], [0, "⋷"], [1, { v: "⋹", n: 824, o: "⋹̸" }], [0, "⋺"], [0, "⋻"], [0, "⋼"], [0, "⋽"], [0, "⋾"], [6, "⌅"], [0, "⌆"], [1, "⌈"], [0, "⌉"], [0, "⌊"], [0, "⌋"], [0, "⌌"], [0, "⌍"], [0, "⌎"], [0, "⌏"], [0, "⌐"], [1, "⌒"], [0, "⌓"], [1, "⌕"], [0, "⌖"], [5, "⌜"], [0, "⌝"], [0, "⌞"], [0, "⌟"], [2, "⌢"], [0, "⌣"], [9, "⌭"], [0, "⌮"], [7, "⌶"], [6, "⌽"], [1, "⌿"], [60, "⍼"], [51, "⎰"], [0, "⎱"], [2, "⎴"], [0, "⎵"], [0, "⎶"], [37, "⏜"], [0, "⏝"], [0, "⏞"], [0, "⏟"], [2, "⏢"], [4, "⏧"], [59, "␣"], [164, "Ⓢ"], [55, "─"], [1, "│"], [9, "┌"], [3, "┐"], [3, "└"], [3, "┘"], [3, "├"], [7, "┤"], [7, "┬"], [7, "┴"], [7, "┼"], [19, "═"], [0, "║"], [0, "╒"], [0, "╓"], [0, "╔"], [0, "╕"], [0, "╖"], [0, "╗"], [0, "╘"], [0, "╙"], [0, "╚"], [0, "╛"], [0, "╜"], [0, "╝"], [0, "╞"], [0, "╟"], [0, "╠"], [0, "╡"], [0, "╢"], [0, "╣"], [0, "╤"], [0, "╥"], [0, "╦"], [0, "╧"], [0, "╨"], [0, "╩"], [0, "╪"], [0, "╫"], [0, "╬"], [19, "▀"], [3, "▄"], [3, "█"], [8, "░"], [0, "▒"], [0, "▓"], [13, "□"], [8, "▪"], [0, "▫"], [1, "▭"], [0, "▮"], [2, "▱"], [1, "△"], [0, "▴"], [0, "▵"], [2, "▸"], [0, "▹"], [3, "▽"], [0, "▾"], [0, "▿"], [2, "◂"], [0, "◃"], [6, "◊"], [0, "○"], [32, "◬"], [2, "◯"], [8, "◸"], [0, "◹"], [0, "◺"], [0, "◻"], [0, "◼"], [8, "★"], [0, "☆"], [7, "☎"], [49, "♀"], [1, "♂"], [29, "♠"], [2, "♣"], [1, "♥"], [0, "♦"], [3, "♪"], [2, "♭"], [0, "♮"], [0, "♯"], [163, "✓"], [3, "✗"], [8, "✠"], [21, "✶"], [33, "❘"], [25, "❲"], [0, "❳"], [84, "⟈"], [0, "⟉"], [28, "⟦"], [0, "⟧"], [0, "⟨"], [0, "⟩"], [0, "⟪"], [0, "⟫"], [0, "⟬"], [0, "⟭"], [7, "⟵"], [0, "⟶"], [0, "⟷"], [0, "⟸"], [0, "⟹"], [0, "⟺"], [1, "⟼"], [2, "⟿"], [258, "⤂"], [0, "⤃"], [0, "⤄"], [0, "⤅"], [6, "⤌"], [0, "⤍"], [0, "⤎"], [0, "⤏"], [0, "⤐"], [0, "⤑"], [0, "⤒"], [0, "⤓"], [2, "⤖"], [2, "⤙"], [0, "⤚"], [0, "⤛"], [0, "⤜"], [0, "⤝"], [0, "⤞"], [0, "⤟"], [0, "⤠"], [2, "⤣"], [0, "⤤"], [0, "⤥"], [0, "⤦"], [0, "⤧"], [0, "⤨"], [0, "⤩"], [0, "⤪"], [8, { v: "⤳", n: 824, o: "⤳̸" }], [1, "⤵"], [0, "⤶"], [0, "⤷"], [0, "⤸"], [0, "⤹"], [2, "⤼"], [0, "⤽"], [7, "⥅"], [2, "⥈"], [0, "⥉"], [0, "⥊"], [0, "⥋"], [2, "⥎"], [0, "⥏"], [0, "⥐"], [0, "⥑"], [0, "⥒"], [0, "⥓"], [0, "⥔"], [0, "⥕"], [0, "⥖"], [0, "⥗"], [0, "⥘"], [0, "⥙"], [0, "⥚"], [0, "⥛"], [0, "⥜"], [0, "⥝"], [0, "⥞"], [0, "⥟"], [0, "⥠"], [0, "⥡"], [0, "⥢"], [0, "⥣"], [0, "⥤"], [0, "⥥"], [0, "⥦"], [0, "⥧"], [0, "⥨"], [0, "⥩"], [0, "⥪"], [0, "⥫"], [0, "⥬"], [0, "⥭"], [0, "⥮"], [0, "⥯"], [0, "⥰"], [0, "⥱"], [0, "⥲"], [0, "⥳"], [0, "⥴"], [0, "⥵"], [0, "⥶"], [1, "⥸"], [0, "⥹"], [1, "⥻"], [0, "⥼"], [0, "⥽"], [0, "⥾"], [0, "⥿"], [5, "⦅"], [0, "⦆"], [4, "⦋"], [0, "⦌"], [0, "⦍"], [0, "⦎"], [0, "⦏"], [0, "⦐"], [0, "⦑"], [0, "⦒"], [0, "⦓"], [0, "⦔"], [0, "⦕"], [0, "⦖"], [3, "⦚"], [1, "⦜"], [0, "⦝"], [6, "⦤"], [0, "⦥"], [0, "⦦"], [0, "⦧"], [0, "⦨"], [0, "⦩"], [0, "⦪"], [0, "⦫"], [0, "⦬"], [0, "⦭"], [0, "⦮"], [0, "⦯"], [0, "⦰"], [0, "⦱"], [0, "⦲"], [0, "⦳"], [0, "⦴"], [0, "⦵"], [0, "⦶"], [0, "⦷"], [1, "⦹"], [1, "⦻"], [0, "⦼"], [1, "⦾"], [0, "⦿"], [0, "⧀"], [0, "⧁"], [0, "⧂"], [0, "⧃"], [0, "⧄"], [0, "⧅"], [3, "⧉"], [3, "⧍"], [0, "⧎"], [0, { v: "⧏", n: 824, o: "⧏̸" }], [0, { v: "⧐", n: 824, o: "⧐̸" }], [11, "⧜"], [0, "⧝"], [0, "⧞"], [4, "⧣"], [0, "⧤"], [0, "⧥"], [5, "⧫"], [8, "⧴"], [1, "⧶"], [9, "⨀"], [0, "⨁"], [0, "⨂"], [1, "⨄"], [1, "⨆"], [5, "⨌"], [0, "⨍"], [2, "⨐"], [0, "⨑"], [0, "⨒"], [0, "⨓"], [0, "⨔"], [0, "⨕"], [0, "⨖"], [0, "⨗"], [10, "⨢"], [0, "⨣"], [0, "⨤"], [0, "⨥"], [0, "⨦"], [0, "⨧"], [1, "⨩"], [0, "⨪"], [2, "⨭"], [0, "⨮"], [0, "⨯"], [0, "⨰"], [0, "⨱"], [1, "⨳"], [0, "⨴"], [0, "⨵"], [0, "⨶"], [0, "⨷"], [0, "⨸"], [0, "⨹"], [0, "⨺"], [0, "⨻"], [0, "⨼"], [2, "⨿"], [0, "⩀"], [1, "⩂"], [0, "⩃"], [0, "⩄"], [0, "⩅"], [0, "⩆"], [0, "⩇"], [0, "⩈"], [0, "⩉"], [0, "⩊"], [0, "⩋"], [0, "⩌"], [0, "⩍"], [2, "⩐"], [2, "⩓"], [0, "⩔"], [0, "⩕"], [0, "⩖"], [0, "⩗"], [0, "⩘"], [1, "⩚"], [0, "⩛"], [0, "⩜"], [0, "⩝"], [1, "⩟"], [6, "⩦"], [3, "⩪"], [2, { v: "⩭", n: 824, o: "⩭̸" }], [0, "⩮"], [0, "⩯"], [0, { v: "⩰", n: 824, o: "⩰̸" }], [0, "⩱"], [0, "⩲"], [0, "⩳"], [0, "⩴"], [0, "⩵"], [1, "⩷"], [0, "⩸"], [0, "⩹"], [0, "⩺"], [0, "⩻"], [0, "⩼"], [0, { v: "⩽", n: 824, o: "⩽̸" }], [0, { v: "⩾", n: 824, o: "⩾̸" }], [0, "⩿"], [0, "⪀"], [0, "⪁"], [0, "⪂"], [0, "⪃"], [0, "⪄"], [0, "⪅"], [0, "⪆"], [0, "⪇"], [0, "⪈"], [0, "⪉"], [0, "⪊"], [0, "⪋"], [0, "⪌"], [0, "⪍"], [0, "⪎"], [0, "⪏"], [0, "⪐"], [0, "⪑"], [0, "⪒"], [0, "⪓"], [0, "⪔"], [0, "⪕"], [0, "⪖"], [0, "⪗"], [0, "⪘"], [0, "⪙"], [0, "⪚"], [2, "⪝"], [0, "⪞"], [0, "⪟"], [0, "⪠"], [0, { v: "⪡", n: 824, o: "⪡̸" }], [0, { v: "⪢", n: 824, o: "⪢̸" }], [1, "⪤"], [0, "⪥"], [0, "⪦"], [0, "⪧"], [0, "⪨"], [0, "⪩"], [0, "⪪"], [0, "⪫"], [0, { v: "⪬", n: 65024, o: "⪬︀" }], [0, { v: "⪭", n: 65024, o: "⪭︀" }], [0, "⪮"], [0, { v: "⪯", n: 824, o: "⪯̸" }], [0, { v: "⪰", n: 824, o: "⪰̸" }], [2, "⪳"], [0, "⪴"], [0, "⪵"], [0, "⪶"], [0, "⪷"], [0, "⪸"], [0, "⪹"], [0, "⪺"], [0, "⪻"], [0, "⪼"], [0, "⪽"], [0, "⪾"], [0, "⪿"], [0, "⫀"], [0, "⫁"], [0, "⫂"], [0, "⫃"], [0, "⫄"], [0, { v: "⫅", n: 824, o: "⫅̸" }], [0, { v: "⫆", n: 824, o: "⫆̸" }], [0, "⫇"], [0, "⫈"], [2, { v: "⫋", n: 65024, o: "⫋︀" }], [0, { v: "⫌", n: 65024, o: "⫌︀" }], [2, "⫏"], [0, "⫐"], [0, "⫑"], [0, "⫒"], [0, "⫓"], [0, "⫔"], [0, "⫕"], [0, "⫖"], [0, "⫗"], [0, "⫘"], [0, "⫙"], [0, "⫚"], [0, "⫛"], [8, "⫤"], [1, "⫦"], [0, "⫧"], [0, "⫨"], [0, "⫩"], [1, "⫫"], [0, "⫬"], [0, "⫭"], [0, "⫮"], [0, "⫯"], [0, "⫰"], [0, "⫱"], [0, "⫲"], [0, "⫳"], [9, { v: "⫽", n: 8421, o: "⫽⃥" }], [44343, { n: new Map(/* @__PURE__ */ restoreDiff([[56476, "𝒜"], [1, "𝒞"], [0, "𝒟"], [2, "𝒢"], [2, "𝒥"], [0, "𝒦"], [2, "𝒩"], [0, "𝒪"], [0, "𝒫"], [0, "𝒬"], [1, "𝒮"], [0, "𝒯"], [0, "𝒰"], [0, "𝒱"], [0, "𝒲"], [0, "𝒳"], [0, "𝒴"], [0, "𝒵"], [0, "𝒶"], [0, "𝒷"], [0, "𝒸"], [0, "𝒹"], [1, "𝒻"], [1, "𝒽"], [0, "𝒾"], [0, "𝒿"], [0, "𝓀"], [0, "𝓁"], [0, "𝓂"], [0, "𝓃"], [1, "𝓅"], [0, "𝓆"], [0, "𝓇"], [0, "𝓈"], [0, "𝓉"], [0, "𝓊"], [0, "𝓋"], [0, "𝓌"], [0, "𝓍"], [0, "𝓎"], [0, "𝓏"], [52, "𝔄"], [0, "𝔅"], [1, "𝔇"], [0, "𝔈"], [0, "𝔉"], [0, "𝔊"], [2, "𝔍"], [0, "𝔎"], [0, "𝔏"], [0, "𝔐"], [0, "𝔑"], [0, "𝔒"], [0, "𝔓"], [0, "𝔔"], [1, "𝔖"], [0, "𝔗"], [0, "𝔘"], [0, "𝔙"], [0, "𝔚"], [0, "𝔛"], [0, "𝔜"], [1, "𝔞"], [0, "𝔟"], [0, "𝔠"], [0, "𝔡"], [0, "𝔢"], [0, "𝔣"], [0, "𝔤"], [0, "𝔥"], [0, "𝔦"], [0, "𝔧"], [0, "𝔨"], [0, "𝔩"], [0, "𝔪"], [0, "𝔫"], [0, "𝔬"], [0, "𝔭"], [0, "𝔮"], [0, "𝔯"], [0, "𝔰"], [0, "𝔱"], [0, "𝔲"], [0, "𝔳"], [0, "𝔴"], [0, "𝔵"], [0, "𝔶"], [0, "𝔷"], [0, "𝔸"], [0, "𝔹"], [1, "𝔻"], [0, "𝔼"], [0, "𝔽"], [0, "𝔾"], [1, "𝕀"], [0, "𝕁"], [0, "𝕂"], [0, "𝕃"], [0, "𝕄"], [1, "𝕆"], [3, "𝕊"], [0, "𝕋"], [0, "𝕌"], [0, "𝕍"], [0, "𝕎"], [0, "𝕏"], [0, "𝕐"], [1, "𝕒"], [0, "𝕓"], [0, "𝕔"], [0, "𝕕"], [0, "𝕖"], [0, "𝕗"], [0, "𝕘"], [0, "𝕙"], [0, "𝕚"], [0, "𝕛"], [0, "𝕜"], [0, "𝕝"], [0, "𝕞"], [0, "𝕟"], [0, "𝕠"], [0, "𝕡"], [0, "𝕢"], [0, "𝕣"], [0, "𝕤"], [0, "𝕥"], [0, "𝕦"], [0, "𝕧"], [0, "𝕨"], [0, "𝕩"], [0, "𝕪"], [0, "𝕫"]])) }], [8906, "ff"], [0, "fi"], [0, "fl"], [0, "ffi"], [0, "ffl"]]));
|
|
2273
|
+
|
|
2274
|
+
// node_modules/entities/lib/esm/escape.js
|
|
2275
|
+
var xmlReplacer = /["&'<>$\x80-\uFFFF]/g, xmlCodeMap = /* @__PURE__ */ new Map([
|
|
2276
|
+
[34, """],
|
|
2277
|
+
[38, "&"],
|
|
2278
|
+
[39, "'"],
|
|
2279
|
+
[60, "<"],
|
|
2280
|
+
[62, ">"]
|
|
2281
|
+
]), getCodePoint = (
|
|
2282
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
2283
|
+
String.prototype.codePointAt != null ? (str, index) => str.codePointAt(index) : (
|
|
2284
|
+
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
|
2285
|
+
(c2, index) => (c2.charCodeAt(index) & 64512) === 55296 ? (c2.charCodeAt(index) - 55296) * 1024 + c2.charCodeAt(index + 1) - 56320 + 65536 : c2.charCodeAt(index)
|
|
2286
|
+
)
|
|
2287
|
+
);
|
|
2288
|
+
function encodeXML(str) {
|
|
2289
|
+
let ret = "", lastIdx = 0, match;
|
|
2290
|
+
for (; (match = xmlReplacer.exec(str)) !== null; ) {
|
|
2291
|
+
let i = match.index, char = str.charCodeAt(i), next = xmlCodeMap.get(char);
|
|
2292
|
+
next !== void 0 ? (ret += str.substring(lastIdx, i) + next, lastIdx = i + 1) : (ret += `${str.substring(lastIdx, i)}&#x${getCodePoint(str, i).toString(16)};`, lastIdx = xmlReplacer.lastIndex += +((char & 64512) === 55296));
|
|
2293
|
+
}
|
|
2294
|
+
return ret + str.substr(lastIdx);
|
|
2295
|
+
}
|
|
2296
|
+
function getEscaper(regex, map2) {
|
|
2297
|
+
return function(data) {
|
|
2298
|
+
let match, lastIdx = 0, result = "";
|
|
2299
|
+
for (; match = regex.exec(data); )
|
|
2300
|
+
lastIdx !== match.index && (result += data.substring(lastIdx, match.index)), result += map2.get(match[0].charCodeAt(0)), lastIdx = match.index + 1;
|
|
2301
|
+
return result + data.substring(lastIdx);
|
|
2302
|
+
};
|
|
2303
|
+
}
|
|
2304
|
+
var escapeUTF8 = getEscaper(/[&<>'"]/g, xmlCodeMap), escapeAttribute = getEscaper(/["&\u00A0]/g, /* @__PURE__ */ new Map([
|
|
2305
|
+
[34, """],
|
|
2306
|
+
[38, "&"],
|
|
2307
|
+
[160, " "]
|
|
2308
|
+
])), escapeText = getEscaper(/[&<>\u00A0]/g, /* @__PURE__ */ new Map([
|
|
2309
|
+
[38, "&"],
|
|
2310
|
+
[60, "<"],
|
|
2311
|
+
[62, ">"],
|
|
2312
|
+
[160, " "]
|
|
2313
|
+
]));
|
|
2314
|
+
|
|
2315
|
+
// node_modules/entities/lib/esm/index.js
|
|
2316
|
+
var EntityLevel;
|
|
2317
|
+
(function(EntityLevel2) {
|
|
2318
|
+
EntityLevel2[EntityLevel2.XML = 0] = "XML", EntityLevel2[EntityLevel2.HTML = 1] = "HTML";
|
|
2319
|
+
})(EntityLevel || (EntityLevel = {}));
|
|
2320
|
+
var EncodingMode;
|
|
2321
|
+
(function(EncodingMode2) {
|
|
2322
|
+
EncodingMode2[EncodingMode2.UTF8 = 0] = "UTF8", EncodingMode2[EncodingMode2.ASCII = 1] = "ASCII", EncodingMode2[EncodingMode2.Extensive = 2] = "Extensive", EncodingMode2[EncodingMode2.Attribute = 3] = "Attribute", EncodingMode2[EncodingMode2.Text = 4] = "Text";
|
|
2323
|
+
})(EncodingMode || (EncodingMode = {}));
|
|
2324
|
+
|
|
2325
|
+
// node_modules/dom-serializer/lib/esm/foreignNames.js
|
|
2326
|
+
var elementNames = new Map([
|
|
2327
|
+
"altGlyph",
|
|
2328
|
+
"altGlyphDef",
|
|
2329
|
+
"altGlyphItem",
|
|
2330
|
+
"animateColor",
|
|
2331
|
+
"animateMotion",
|
|
2332
|
+
"animateTransform",
|
|
2333
|
+
"clipPath",
|
|
2334
|
+
"feBlend",
|
|
2335
|
+
"feColorMatrix",
|
|
2336
|
+
"feComponentTransfer",
|
|
2337
|
+
"feComposite",
|
|
2338
|
+
"feConvolveMatrix",
|
|
2339
|
+
"feDiffuseLighting",
|
|
2340
|
+
"feDisplacementMap",
|
|
2341
|
+
"feDistantLight",
|
|
2342
|
+
"feDropShadow",
|
|
2343
|
+
"feFlood",
|
|
2344
|
+
"feFuncA",
|
|
2345
|
+
"feFuncB",
|
|
2346
|
+
"feFuncG",
|
|
2347
|
+
"feFuncR",
|
|
2348
|
+
"feGaussianBlur",
|
|
2349
|
+
"feImage",
|
|
2350
|
+
"feMerge",
|
|
2351
|
+
"feMergeNode",
|
|
2352
|
+
"feMorphology",
|
|
2353
|
+
"feOffset",
|
|
2354
|
+
"fePointLight",
|
|
2355
|
+
"feSpecularLighting",
|
|
2356
|
+
"feSpotLight",
|
|
2357
|
+
"feTile",
|
|
2358
|
+
"feTurbulence",
|
|
2359
|
+
"foreignObject",
|
|
2360
|
+
"glyphRef",
|
|
2361
|
+
"linearGradient",
|
|
2362
|
+
"radialGradient",
|
|
2363
|
+
"textPath"
|
|
2364
|
+
].map((val) => [val.toLowerCase(), val])), attributeNames = new Map([
|
|
2365
|
+
"definitionURL",
|
|
2366
|
+
"attributeName",
|
|
2367
|
+
"attributeType",
|
|
2368
|
+
"baseFrequency",
|
|
2369
|
+
"baseProfile",
|
|
2370
|
+
"calcMode",
|
|
2371
|
+
"clipPathUnits",
|
|
2372
|
+
"diffuseConstant",
|
|
2373
|
+
"edgeMode",
|
|
2374
|
+
"filterUnits",
|
|
2375
|
+
"glyphRef",
|
|
2376
|
+
"gradientTransform",
|
|
2377
|
+
"gradientUnits",
|
|
2378
|
+
"kernelMatrix",
|
|
2379
|
+
"kernelUnitLength",
|
|
2380
|
+
"keyPoints",
|
|
2381
|
+
"keySplines",
|
|
2382
|
+
"keyTimes",
|
|
2383
|
+
"lengthAdjust",
|
|
2384
|
+
"limitingConeAngle",
|
|
2385
|
+
"markerHeight",
|
|
2386
|
+
"markerUnits",
|
|
2387
|
+
"markerWidth",
|
|
2388
|
+
"maskContentUnits",
|
|
2389
|
+
"maskUnits",
|
|
2390
|
+
"numOctaves",
|
|
2391
|
+
"pathLength",
|
|
2392
|
+
"patternContentUnits",
|
|
2393
|
+
"patternTransform",
|
|
2394
|
+
"patternUnits",
|
|
2395
|
+
"pointsAtX",
|
|
2396
|
+
"pointsAtY",
|
|
2397
|
+
"pointsAtZ",
|
|
2398
|
+
"preserveAlpha",
|
|
2399
|
+
"preserveAspectRatio",
|
|
2400
|
+
"primitiveUnits",
|
|
2401
|
+
"refX",
|
|
2402
|
+
"refY",
|
|
2403
|
+
"repeatCount",
|
|
2404
|
+
"repeatDur",
|
|
2405
|
+
"requiredExtensions",
|
|
2406
|
+
"requiredFeatures",
|
|
2407
|
+
"specularConstant",
|
|
2408
|
+
"specularExponent",
|
|
2409
|
+
"spreadMethod",
|
|
2410
|
+
"startOffset",
|
|
2411
|
+
"stdDeviation",
|
|
2412
|
+
"stitchTiles",
|
|
2413
|
+
"surfaceScale",
|
|
2414
|
+
"systemLanguage",
|
|
2415
|
+
"tableValues",
|
|
2416
|
+
"targetX",
|
|
2417
|
+
"targetY",
|
|
2418
|
+
"textLength",
|
|
2419
|
+
"viewBox",
|
|
2420
|
+
"viewTarget",
|
|
2421
|
+
"xChannelSelector",
|
|
2422
|
+
"yChannelSelector",
|
|
2423
|
+
"zoomAndPan"
|
|
2424
|
+
].map((val) => [val.toLowerCase(), val]));
|
|
2425
|
+
|
|
2426
|
+
// node_modules/dom-serializer/lib/esm/index.js
|
|
2427
|
+
var unencodedElements = /* @__PURE__ */ new Set([
|
|
2428
|
+
"style",
|
|
2429
|
+
"script",
|
|
2430
|
+
"xmp",
|
|
2431
|
+
"iframe",
|
|
2432
|
+
"noembed",
|
|
2433
|
+
"noframes",
|
|
2434
|
+
"plaintext",
|
|
2435
|
+
"noscript"
|
|
2436
|
+
]);
|
|
2437
|
+
function replaceQuotes(value) {
|
|
2438
|
+
return value.replace(/"/g, """);
|
|
2439
|
+
}
|
|
2440
|
+
function formatAttributes(attributes, opts) {
|
|
2441
|
+
var _a2;
|
|
2442
|
+
if (!attributes)
|
|
2443
|
+
return;
|
|
2444
|
+
let encode = ((_a2 = opts.encodeEntities) !== null && _a2 !== void 0 ? _a2 : opts.decodeEntities) === !1 ? replaceQuotes : opts.xmlMode || opts.encodeEntities !== "utf8" ? encodeXML : escapeAttribute;
|
|
2445
|
+
return Object.keys(attributes).map((key) => {
|
|
2446
|
+
var _a3, _b;
|
|
2447
|
+
let value = (_a3 = attributes[key]) !== null && _a3 !== void 0 ? _a3 : "";
|
|
2448
|
+
return opts.xmlMode === "foreign" && (key = (_b = attributeNames.get(key)) !== null && _b !== void 0 ? _b : key), !opts.emptyAttrs && !opts.xmlMode && value === "" ? key : `${key}="${encode(value)}"`;
|
|
2449
|
+
}).join(" ");
|
|
2450
|
+
}
|
|
2451
|
+
var singleTag = /* @__PURE__ */ new Set([
|
|
2452
|
+
"area",
|
|
2453
|
+
"base",
|
|
2454
|
+
"basefont",
|
|
2455
|
+
"br",
|
|
2456
|
+
"col",
|
|
2457
|
+
"command",
|
|
2458
|
+
"embed",
|
|
2459
|
+
"frame",
|
|
2460
|
+
"hr",
|
|
2461
|
+
"img",
|
|
2462
|
+
"input",
|
|
2463
|
+
"isindex",
|
|
2464
|
+
"keygen",
|
|
2465
|
+
"link",
|
|
2466
|
+
"meta",
|
|
2467
|
+
"param",
|
|
2468
|
+
"source",
|
|
2469
|
+
"track",
|
|
2470
|
+
"wbr"
|
|
2471
|
+
]);
|
|
2472
|
+
function render(node, options = {}) {
|
|
2473
|
+
let nodes = "length" in node ? node : [node], output = "";
|
|
2474
|
+
for (let i = 0; i < nodes.length; i++)
|
|
2475
|
+
output += renderNode(nodes[i], options);
|
|
2476
|
+
return output;
|
|
2477
|
+
}
|
|
2478
|
+
function renderNode(node, options) {
|
|
2479
|
+
switch (node.type) {
|
|
2480
|
+
case Root:
|
|
2481
|
+
return render(node.children, options);
|
|
2482
|
+
// @ts-expect-error We don't use `Doctype` yet
|
|
2483
|
+
case Doctype:
|
|
2484
|
+
case Directive:
|
|
2485
|
+
return renderDirective(node);
|
|
2486
|
+
case Comment:
|
|
2487
|
+
return renderComment(node);
|
|
2488
|
+
case CDATA:
|
|
2489
|
+
return renderCdata(node);
|
|
2490
|
+
case Script:
|
|
2491
|
+
case Style:
|
|
2492
|
+
case Tag:
|
|
2493
|
+
return renderTag(node, options);
|
|
2494
|
+
case Text:
|
|
2495
|
+
return renderText(node, options);
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2498
|
+
var foreignModeIntegrationPoints = /* @__PURE__ */ new Set([
|
|
2499
|
+
"mi",
|
|
2500
|
+
"mo",
|
|
2501
|
+
"mn",
|
|
2502
|
+
"ms",
|
|
2503
|
+
"mtext",
|
|
2504
|
+
"annotation-xml",
|
|
2505
|
+
"foreignObject",
|
|
2506
|
+
"desc",
|
|
2507
|
+
"title"
|
|
2508
|
+
]), foreignElements = /* @__PURE__ */ new Set(["svg", "math"]);
|
|
2509
|
+
function renderTag(elem, opts) {
|
|
2510
|
+
var _a2;
|
|
2511
|
+
opts.xmlMode === "foreign" && (elem.name = (_a2 = elementNames.get(elem.name)) !== null && _a2 !== void 0 ? _a2 : elem.name, elem.parent && foreignModeIntegrationPoints.has(elem.parent.name) && (opts = { ...opts, xmlMode: !1 })), !opts.xmlMode && foreignElements.has(elem.name) && (opts = { ...opts, xmlMode: "foreign" });
|
|
2512
|
+
let tag = `<${elem.name}`, attribs = formatAttributes(elem.attribs, opts);
|
|
2513
|
+
return attribs && (tag += ` ${attribs}`), elem.children.length === 0 && (opts.xmlMode ? (
|
|
2514
|
+
// In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags
|
|
2515
|
+
opts.selfClosingTags !== !1
|
|
2516
|
+
) : (
|
|
2517
|
+
// User explicitly asked for self-closing tags, even in HTML mode
|
|
2518
|
+
opts.selfClosingTags && singleTag.has(elem.name)
|
|
2519
|
+
)) ? (opts.xmlMode || (tag += " "), tag += "/>") : (tag += ">", elem.children.length > 0 && (tag += render(elem.children, opts)), (opts.xmlMode || !singleTag.has(elem.name)) && (tag += `</${elem.name}>`)), tag;
|
|
2520
|
+
}
|
|
2521
|
+
function renderDirective(elem) {
|
|
2522
|
+
return `<${elem.data}>`;
|
|
2523
|
+
}
|
|
2524
|
+
function renderText(elem, opts) {
|
|
2525
|
+
var _a2;
|
|
2526
|
+
let data = elem.data || "";
|
|
2527
|
+
return ((_a2 = opts.encodeEntities) !== null && _a2 !== void 0 ? _a2 : opts.decodeEntities) !== !1 && !(!opts.xmlMode && elem.parent && unencodedElements.has(elem.parent.name)) && (data = opts.xmlMode || opts.encodeEntities !== "utf8" ? encodeXML(data) : escapeText(data)), data;
|
|
2528
|
+
}
|
|
2529
|
+
function renderCdata(elem) {
|
|
2530
|
+
return `<![CDATA[${elem.children[0].data}]]>`;
|
|
2531
|
+
}
|
|
2532
|
+
function renderComment(elem) {
|
|
2533
|
+
return `<!--${elem.data}-->`;
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2536
|
+
// node_modules/domutils/lib/esm/helpers.js
|
|
2537
|
+
var DocumentPosition;
|
|
2538
|
+
(function(DocumentPosition2) {
|
|
2539
|
+
DocumentPosition2[DocumentPosition2.DISCONNECTED = 1] = "DISCONNECTED", DocumentPosition2[DocumentPosition2.PRECEDING = 2] = "PRECEDING", DocumentPosition2[DocumentPosition2.FOLLOWING = 4] = "FOLLOWING", DocumentPosition2[DocumentPosition2.CONTAINS = 8] = "CONTAINS", DocumentPosition2[DocumentPosition2.CONTAINED_BY = 16] = "CONTAINED_BY";
|
|
2540
|
+
})(DocumentPosition || (DocumentPosition = {}));
|
|
2541
|
+
|
|
2542
|
+
// node_modules/htmlparser2/lib/esm/index.js
|
|
2543
|
+
function parseDocument(data, options) {
|
|
2544
|
+
let handler = new DomHandler(void 0, options);
|
|
2545
|
+
return new Parser(handler, options).end(data), handler.root;
|
|
2546
|
+
}
|
|
2547
|
+
|
|
2548
|
+
// node_modules/html-to-text/lib/html-to-text.mjs
|
|
2549
|
+
var import_deepmerge = __toESM(require_cjs(), 1);
|
|
2550
|
+
function limitedDepthRecursive(n2, f, g = () => {
|
|
2551
|
+
}) {
|
|
2552
|
+
if (n2 === void 0) {
|
|
2553
|
+
let f1 = function(...args) {
|
|
2554
|
+
return f(f1, ...args);
|
|
2555
|
+
};
|
|
2556
|
+
return f1;
|
|
2557
|
+
}
|
|
2558
|
+
return n2 >= 0 ? function(...args) {
|
|
2559
|
+
return f(limitedDepthRecursive(n2 - 1, f, g), ...args);
|
|
2560
|
+
} : g;
|
|
2561
|
+
}
|
|
2562
|
+
function trimCharacter(str, char) {
|
|
2563
|
+
let start = 0, end = str.length;
|
|
2564
|
+
for (; start < end && str[start] === char; )
|
|
2565
|
+
++start;
|
|
2566
|
+
for (; end > start && str[end - 1] === char; )
|
|
2567
|
+
--end;
|
|
2568
|
+
return start > 0 || end < str.length ? str.substring(start, end) : str;
|
|
2569
|
+
}
|
|
2570
|
+
function trimCharacterEnd(str, char) {
|
|
2571
|
+
let end = str.length;
|
|
2572
|
+
for (; end > 0 && str[end - 1] === char; )
|
|
2573
|
+
--end;
|
|
2574
|
+
return end < str.length ? str.substring(0, end) : str;
|
|
2575
|
+
}
|
|
2576
|
+
function unicodeEscape(str) {
|
|
2577
|
+
return str.replace(/[\s\S]/g, (c2) => "\\u" + c2.charCodeAt().toString(16).padStart(4, "0"));
|
|
2578
|
+
}
|
|
2579
|
+
function mergeDuplicatesPreferLast(items, getKey) {
|
|
2580
|
+
let map2 = /* @__PURE__ */ new Map();
|
|
2581
|
+
for (let i = items.length; i-- > 0; ) {
|
|
2582
|
+
let item = items[i], key = getKey(item);
|
|
2583
|
+
map2.set(
|
|
2584
|
+
key,
|
|
2585
|
+
map2.has(key) ? (0, import_deepmerge.default)(item, map2.get(key), { arrayMerge: overwriteMerge$1 }) : item
|
|
2586
|
+
);
|
|
2587
|
+
}
|
|
2588
|
+
return [...map2.values()].reverse();
|
|
2589
|
+
}
|
|
2590
|
+
var overwriteMerge$1 = (acc, src, options) => [...src];
|
|
2591
|
+
function get(obj, path) {
|
|
2592
|
+
for (let key of path) {
|
|
2593
|
+
if (!obj)
|
|
2594
|
+
return;
|
|
2595
|
+
obj = obj[key];
|
|
2596
|
+
}
|
|
2597
|
+
return obj;
|
|
2598
|
+
}
|
|
2599
|
+
function numberToLetterSequence(num, baseChar = "a", base = 26) {
|
|
2600
|
+
let digits = [];
|
|
2601
|
+
do
|
|
2602
|
+
num -= 1, digits.push(num % base), num = num / base >> 0;
|
|
2603
|
+
while (num > 0);
|
|
2604
|
+
let baseCode = baseChar.charCodeAt(0);
|
|
2605
|
+
return digits.reverse().map((n2) => String.fromCharCode(baseCode + n2)).join("");
|
|
2606
|
+
}
|
|
2607
|
+
var I = ["I", "X", "C", "M"], V = ["V", "L", "D"];
|
|
2608
|
+
function numberToRoman(num) {
|
|
2609
|
+
return [...num + ""].map((n2) => +n2).reverse().map((v, i) => v % 5 < 4 ? (v < 5 ? "" : V[i]) + I[i].repeat(v % 5) : I[i] + (v < 5 ? V[i] : I[i + 1])).reverse().join("");
|
|
2610
|
+
}
|
|
2611
|
+
var InlineTextBuilder = class {
|
|
2612
|
+
/**
|
|
2613
|
+
* Creates an instance of InlineTextBuilder.
|
|
2614
|
+
*
|
|
2615
|
+
* If `maxLineLength` is not provided then it is either `options.wordwrap` or unlimited.
|
|
2616
|
+
*
|
|
2617
|
+
* @param { Options } options HtmlToText options.
|
|
2618
|
+
* @param { number } [ maxLineLength ] This builder will try to wrap text to fit this line length.
|
|
2619
|
+
*/
|
|
2620
|
+
constructor(options, maxLineLength = void 0) {
|
|
2621
|
+
this.lines = [], this.nextLineWords = [], this.maxLineLength = maxLineLength || options.wordwrap || Number.MAX_VALUE, this.nextLineAvailableChars = this.maxLineLength, this.wrapCharacters = get(options, ["longWordSplit", "wrapCharacters"]) || [], this.forceWrapOnLimit = get(options, ["longWordSplit", "forceWrapOnLimit"]) || !1, this.stashedSpace = !1, this.wordBreakOpportunity = !1;
|
|
2622
|
+
}
|
|
2623
|
+
/**
|
|
2624
|
+
* Add a new word.
|
|
2625
|
+
*
|
|
2626
|
+
* @param { string } word A word to add.
|
|
2627
|
+
* @param { boolean } [noWrap] Don't wrap text even if the line is too long.
|
|
2628
|
+
*/
|
|
2629
|
+
pushWord(word, noWrap = !1) {
|
|
2630
|
+
this.nextLineAvailableChars <= 0 && !noWrap && this.startNewLine();
|
|
2631
|
+
let isLineStart = this.nextLineWords.length === 0, cost = word.length + (isLineStart ? 0 : 1);
|
|
2632
|
+
if (cost <= this.nextLineAvailableChars || noWrap)
|
|
2633
|
+
this.nextLineWords.push(word), this.nextLineAvailableChars -= cost;
|
|
2634
|
+
else {
|
|
2635
|
+
let [first, ...rest] = this.splitLongWord(word);
|
|
2636
|
+
isLineStart || this.startNewLine(), this.nextLineWords.push(first), this.nextLineAvailableChars -= first.length;
|
|
2637
|
+
for (let part of rest)
|
|
2638
|
+
this.startNewLine(), this.nextLineWords.push(part), this.nextLineAvailableChars -= part.length;
|
|
2639
|
+
}
|
|
2640
|
+
}
|
|
2641
|
+
/**
|
|
2642
|
+
* Pop a word from the currently built line.
|
|
2643
|
+
* This doesn't affect completed lines.
|
|
2644
|
+
*
|
|
2645
|
+
* @returns { string }
|
|
2646
|
+
*/
|
|
2647
|
+
popWord() {
|
|
2648
|
+
let lastWord = this.nextLineWords.pop();
|
|
2649
|
+
if (lastWord !== void 0) {
|
|
2650
|
+
let isLineStart = this.nextLineWords.length === 0, cost = lastWord.length + (isLineStart ? 0 : 1);
|
|
2651
|
+
this.nextLineAvailableChars += cost;
|
|
2652
|
+
}
|
|
2653
|
+
return lastWord;
|
|
2654
|
+
}
|
|
2655
|
+
/**
|
|
2656
|
+
* Concat a word to the last word already in the builder.
|
|
2657
|
+
* Adds a new word in case there are no words yet in the last line.
|
|
2658
|
+
*
|
|
2659
|
+
* @param { string } word A word to be concatenated.
|
|
2660
|
+
* @param { boolean } [noWrap] Don't wrap text even if the line is too long.
|
|
2661
|
+
*/
|
|
2662
|
+
concatWord(word, noWrap = !1) {
|
|
2663
|
+
if (this.wordBreakOpportunity && word.length > this.nextLineAvailableChars)
|
|
2664
|
+
this.pushWord(word, noWrap), this.wordBreakOpportunity = !1;
|
|
2665
|
+
else {
|
|
2666
|
+
let lastWord = this.popWord();
|
|
2667
|
+
this.pushWord(lastWord ? lastWord.concat(word) : word, noWrap);
|
|
2668
|
+
}
|
|
2669
|
+
}
|
|
2670
|
+
/**
|
|
2671
|
+
* Add current line (and more empty lines if provided argument > 1) to the list of complete lines and start a new one.
|
|
2672
|
+
*
|
|
2673
|
+
* @param { number } n Number of line breaks that will be added to the resulting string.
|
|
2674
|
+
*/
|
|
2675
|
+
startNewLine(n2 = 1) {
|
|
2676
|
+
this.lines.push(this.nextLineWords), n2 > 1 && this.lines.push(...Array.from({ length: n2 - 1 }, () => [])), this.nextLineWords = [], this.nextLineAvailableChars = this.maxLineLength;
|
|
2677
|
+
}
|
|
2678
|
+
/**
|
|
2679
|
+
* No words in this builder.
|
|
2680
|
+
*
|
|
2681
|
+
* @returns { boolean }
|
|
2682
|
+
*/
|
|
2683
|
+
isEmpty() {
|
|
2684
|
+
return this.lines.length === 0 && this.nextLineWords.length === 0;
|
|
2685
|
+
}
|
|
2686
|
+
clear() {
|
|
2687
|
+
this.lines.length = 0, this.nextLineWords.length = 0, this.nextLineAvailableChars = this.maxLineLength;
|
|
2688
|
+
}
|
|
2689
|
+
/**
|
|
2690
|
+
* Join all lines of words inside the InlineTextBuilder into a complete string.
|
|
2691
|
+
*
|
|
2692
|
+
* @returns { string }
|
|
2693
|
+
*/
|
|
2694
|
+
toString() {
|
|
2695
|
+
return [...this.lines, this.nextLineWords].map((words) => words.join(" ")).join(`
|
|
2696
|
+
`);
|
|
2697
|
+
}
|
|
2698
|
+
/**
|
|
2699
|
+
* Split a long word up to fit within the word wrap limit.
|
|
2700
|
+
* Use either a character to split looking back from the word wrap limit,
|
|
2701
|
+
* or truncate to the word wrap limit.
|
|
2702
|
+
*
|
|
2703
|
+
* @param { string } word Input word.
|
|
2704
|
+
* @returns { string[] } Parts of the word.
|
|
2705
|
+
*/
|
|
2706
|
+
splitLongWord(word) {
|
|
2707
|
+
let parts = [], idx = 0;
|
|
2708
|
+
for (; word.length > this.maxLineLength; ) {
|
|
2709
|
+
let firstLine = word.substring(0, this.maxLineLength), remainingChars = word.substring(this.maxLineLength), splitIndex = firstLine.lastIndexOf(this.wrapCharacters[idx]);
|
|
2710
|
+
if (splitIndex > -1)
|
|
2711
|
+
word = firstLine.substring(splitIndex + 1) + remainingChars, parts.push(firstLine.substring(0, splitIndex + 1));
|
|
2712
|
+
else if (idx++, idx < this.wrapCharacters.length)
|
|
2713
|
+
word = firstLine + remainingChars;
|
|
2714
|
+
else {
|
|
2715
|
+
if (this.forceWrapOnLimit) {
|
|
2716
|
+
if (parts.push(firstLine), word = remainingChars, word.length > this.maxLineLength)
|
|
2717
|
+
continue;
|
|
2718
|
+
} else
|
|
2719
|
+
word = firstLine + remainingChars;
|
|
2720
|
+
break;
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
return parts.push(word), parts;
|
|
2724
|
+
}
|
|
2725
|
+
}, StackItem = class {
|
|
2726
|
+
constructor(next = null) {
|
|
2727
|
+
this.next = next;
|
|
2728
|
+
}
|
|
2729
|
+
getRoot() {
|
|
2730
|
+
return this.next ? this.next : this;
|
|
2731
|
+
}
|
|
2732
|
+
}, BlockStackItem = class extends StackItem {
|
|
2733
|
+
constructor(options, next = null, leadingLineBreaks = 1, maxLineLength = void 0) {
|
|
2734
|
+
super(next), this.leadingLineBreaks = leadingLineBreaks, this.inlineTextBuilder = new InlineTextBuilder(options, maxLineLength), this.rawText = "", this.stashedLineBreaks = 0, this.isPre = next && next.isPre, this.isNoWrap = next && next.isNoWrap;
|
|
2735
|
+
}
|
|
2736
|
+
}, ListStackItem = class extends BlockStackItem {
|
|
2737
|
+
constructor(options, next = null, {
|
|
2738
|
+
interRowLineBreaks = 1,
|
|
2739
|
+
leadingLineBreaks = 2,
|
|
2740
|
+
maxLineLength = void 0,
|
|
2741
|
+
maxPrefixLength = 0,
|
|
2742
|
+
prefixAlign = "left"
|
|
2743
|
+
} = {}) {
|
|
2744
|
+
super(options, next, leadingLineBreaks, maxLineLength), this.maxPrefixLength = maxPrefixLength, this.prefixAlign = prefixAlign, this.interRowLineBreaks = interRowLineBreaks;
|
|
2745
|
+
}
|
|
2746
|
+
}, ListItemStackItem = class extends BlockStackItem {
|
|
2747
|
+
constructor(options, next = null, {
|
|
2748
|
+
leadingLineBreaks = 1,
|
|
2749
|
+
maxLineLength = void 0,
|
|
2750
|
+
prefix = ""
|
|
2751
|
+
} = {}) {
|
|
2752
|
+
super(options, next, leadingLineBreaks, maxLineLength), this.prefix = prefix;
|
|
2753
|
+
}
|
|
2754
|
+
}, TableStackItem = class extends StackItem {
|
|
2755
|
+
constructor(next = null) {
|
|
2756
|
+
super(next), this.rows = [], this.isPre = next && next.isPre, this.isNoWrap = next && next.isNoWrap;
|
|
2757
|
+
}
|
|
2758
|
+
}, TableRowStackItem = class extends StackItem {
|
|
2759
|
+
constructor(next = null) {
|
|
2760
|
+
super(next), this.cells = [], this.isPre = next && next.isPre, this.isNoWrap = next && next.isNoWrap;
|
|
2761
|
+
}
|
|
2762
|
+
}, TableCellStackItem = class extends StackItem {
|
|
2763
|
+
constructor(options, next = null, maxColumnWidth = void 0) {
|
|
2764
|
+
super(next), this.inlineTextBuilder = new InlineTextBuilder(options, maxColumnWidth), this.rawText = "", this.stashedLineBreaks = 0, this.isPre = next && next.isPre, this.isNoWrap = next && next.isNoWrap;
|
|
2765
|
+
}
|
|
2766
|
+
}, TransformerStackItem = class extends StackItem {
|
|
2767
|
+
constructor(next = null, transform) {
|
|
2768
|
+
super(next), this.transform = transform;
|
|
2769
|
+
}
|
|
2770
|
+
};
|
|
2771
|
+
function charactersToCodes(str) {
|
|
2772
|
+
return [...str].map((c2) => "\\u" + c2.charCodeAt(0).toString(16).padStart(4, "0")).join("");
|
|
2773
|
+
}
|
|
2774
|
+
var WhitespaceProcessor = class {
|
|
2775
|
+
/**
|
|
2776
|
+
* Creates an instance of WhitespaceProcessor.
|
|
2777
|
+
*
|
|
2778
|
+
* @param { Options } options HtmlToText options.
|
|
2779
|
+
* @memberof WhitespaceProcessor
|
|
2780
|
+
*/
|
|
2781
|
+
constructor(options) {
|
|
2782
|
+
this.whitespaceChars = options.preserveNewlines ? options.whitespaceCharacters.replace(/\n/g, "") : options.whitespaceCharacters;
|
|
2783
|
+
let whitespaceCodes = charactersToCodes(this.whitespaceChars);
|
|
2784
|
+
if (this.leadingWhitespaceRe = new RegExp(`^[${whitespaceCodes}]`), this.trailingWhitespaceRe = new RegExp(`[${whitespaceCodes}]$`), this.allWhitespaceOrEmptyRe = new RegExp(`^[${whitespaceCodes}]*$`), this.newlineOrNonWhitespaceRe = new RegExp(`(\\n|[^\\n${whitespaceCodes}])`, "g"), this.newlineOrNonNewlineStringRe = new RegExp("(\\n|[^\\n]+)", "g"), options.preserveNewlines) {
|
|
2785
|
+
let wordOrNewlineRe = new RegExp(`\\n|[^\\n${whitespaceCodes}]+`, "gm");
|
|
2786
|
+
this.shrinkWrapAdd = function(text, inlineTextBuilder, transform = ((str) => str), noWrap = !1) {
|
|
2787
|
+
if (!text)
|
|
2788
|
+
return;
|
|
2789
|
+
let previouslyStashedSpace = inlineTextBuilder.stashedSpace, anyMatch = !1, m = wordOrNewlineRe.exec(text);
|
|
2790
|
+
if (m)
|
|
2791
|
+
for (anyMatch = !0, m[0] === `
|
|
2792
|
+
` ? inlineTextBuilder.startNewLine() : previouslyStashedSpace || this.testLeadingWhitespace(text) ? inlineTextBuilder.pushWord(transform(m[0]), noWrap) : inlineTextBuilder.concatWord(transform(m[0]), noWrap); (m = wordOrNewlineRe.exec(text)) !== null; )
|
|
2793
|
+
m[0] === `
|
|
2794
|
+
` ? inlineTextBuilder.startNewLine() : inlineTextBuilder.pushWord(transform(m[0]), noWrap);
|
|
2795
|
+
inlineTextBuilder.stashedSpace = previouslyStashedSpace && !anyMatch || this.testTrailingWhitespace(text);
|
|
2796
|
+
};
|
|
2797
|
+
} else {
|
|
2798
|
+
let wordRe = new RegExp(`[^${whitespaceCodes}]+`, "g");
|
|
2799
|
+
this.shrinkWrapAdd = function(text, inlineTextBuilder, transform = ((str) => str), noWrap = !1) {
|
|
2800
|
+
if (!text)
|
|
2801
|
+
return;
|
|
2802
|
+
let previouslyStashedSpace = inlineTextBuilder.stashedSpace, anyMatch = !1, m = wordRe.exec(text);
|
|
2803
|
+
if (m)
|
|
2804
|
+
for (anyMatch = !0, previouslyStashedSpace || this.testLeadingWhitespace(text) ? inlineTextBuilder.pushWord(transform(m[0]), noWrap) : inlineTextBuilder.concatWord(transform(m[0]), noWrap); (m = wordRe.exec(text)) !== null; )
|
|
2805
|
+
inlineTextBuilder.pushWord(transform(m[0]), noWrap);
|
|
2806
|
+
inlineTextBuilder.stashedSpace = previouslyStashedSpace && !anyMatch || this.testTrailingWhitespace(text);
|
|
2807
|
+
};
|
|
2808
|
+
}
|
|
2809
|
+
}
|
|
2810
|
+
/**
|
|
2811
|
+
* Add text with only minimal processing.
|
|
2812
|
+
* Everything between newlines considered a single word.
|
|
2813
|
+
* No whitespace is trimmed.
|
|
2814
|
+
* Not affected by preserveNewlines option - `\n` always starts a new line.
|
|
2815
|
+
*
|
|
2816
|
+
* `noWrap` argument is `true` by default - this won't start a new line
|
|
2817
|
+
* even if there is not enough space left in the current line.
|
|
2818
|
+
*
|
|
2819
|
+
* @param { string } text Input text.
|
|
2820
|
+
* @param { InlineTextBuilder } inlineTextBuilder A builder to receive processed text.
|
|
2821
|
+
* @param { boolean } [noWrap] Don't wrap text even if the line is too long.
|
|
2822
|
+
*/
|
|
2823
|
+
addLiteral(text, inlineTextBuilder, noWrap = !0) {
|
|
2824
|
+
if (!text)
|
|
2825
|
+
return;
|
|
2826
|
+
let previouslyStashedSpace = inlineTextBuilder.stashedSpace, anyMatch = !1, m = this.newlineOrNonNewlineStringRe.exec(text);
|
|
2827
|
+
if (m)
|
|
2828
|
+
for (anyMatch = !0, m[0] === `
|
|
2829
|
+
` ? inlineTextBuilder.startNewLine() : previouslyStashedSpace ? inlineTextBuilder.pushWord(m[0], noWrap) : inlineTextBuilder.concatWord(m[0], noWrap); (m = this.newlineOrNonNewlineStringRe.exec(text)) !== null; )
|
|
2830
|
+
m[0] === `
|
|
2831
|
+
` ? inlineTextBuilder.startNewLine() : inlineTextBuilder.pushWord(m[0], noWrap);
|
|
2832
|
+
inlineTextBuilder.stashedSpace = previouslyStashedSpace && !anyMatch;
|
|
2833
|
+
}
|
|
2834
|
+
/**
|
|
2835
|
+
* Test whether the given text starts with HTML whitespace character.
|
|
2836
|
+
*
|
|
2837
|
+
* @param { string } text The string to test.
|
|
2838
|
+
* @returns { boolean }
|
|
2839
|
+
*/
|
|
2840
|
+
testLeadingWhitespace(text) {
|
|
2841
|
+
return this.leadingWhitespaceRe.test(text);
|
|
2842
|
+
}
|
|
2843
|
+
/**
|
|
2844
|
+
* Test whether the given text ends with HTML whitespace character.
|
|
2845
|
+
*
|
|
2846
|
+
* @param { string } text The string to test.
|
|
2847
|
+
* @returns { boolean }
|
|
2848
|
+
*/
|
|
2849
|
+
testTrailingWhitespace(text) {
|
|
2850
|
+
return this.trailingWhitespaceRe.test(text);
|
|
2851
|
+
}
|
|
2852
|
+
/**
|
|
2853
|
+
* Test whether the given text contains any non-whitespace characters.
|
|
2854
|
+
*
|
|
2855
|
+
* @param { string } text The string to test.
|
|
2856
|
+
* @returns { boolean }
|
|
2857
|
+
*/
|
|
2858
|
+
testContainsWords(text) {
|
|
2859
|
+
return !this.allWhitespaceOrEmptyRe.test(text);
|
|
2860
|
+
}
|
|
2861
|
+
/**
|
|
2862
|
+
* Return the number of newlines if there are no words.
|
|
2863
|
+
*
|
|
2864
|
+
* If any word is found then return zero regardless of the actual number of newlines.
|
|
2865
|
+
*
|
|
2866
|
+
* @param { string } text Input string.
|
|
2867
|
+
* @returns { number }
|
|
2868
|
+
*/
|
|
2869
|
+
countNewlinesNoWords(text) {
|
|
2870
|
+
this.newlineOrNonWhitespaceRe.lastIndex = 0;
|
|
2871
|
+
let counter = 0, match;
|
|
2872
|
+
for (; (match = this.newlineOrNonWhitespaceRe.exec(text)) !== null; )
|
|
2873
|
+
if (match[0] === `
|
|
2874
|
+
`)
|
|
2875
|
+
counter++;
|
|
2876
|
+
else
|
|
2877
|
+
return 0;
|
|
2878
|
+
return counter;
|
|
2879
|
+
}
|
|
2880
|
+
}, BlockTextBuilder = class {
|
|
2881
|
+
/**
|
|
2882
|
+
* Creates an instance of BlockTextBuilder.
|
|
2883
|
+
*
|
|
2884
|
+
* @param { Options } options HtmlToText options.
|
|
2885
|
+
* @param { import('selderee').Picker<DomNode, TagDefinition> } picker Selectors decision tree picker.
|
|
2886
|
+
* @param { any} [metadata] Optional metadata for HTML document, for use in formatters.
|
|
2887
|
+
*/
|
|
2888
|
+
constructor(options, picker, metadata = void 0) {
|
|
2889
|
+
this.options = options, this.picker = picker, this.metadata = metadata, this.whitespaceProcessor = new WhitespaceProcessor(options), this._stackItem = new BlockStackItem(options), this._wordTransformer = void 0;
|
|
2890
|
+
}
|
|
2891
|
+
/**
|
|
2892
|
+
* Put a word-by-word transform function onto the transformations stack.
|
|
2893
|
+
*
|
|
2894
|
+
* Mainly used for uppercasing. Can be bypassed to add unformatted text such as URLs.
|
|
2895
|
+
*
|
|
2896
|
+
* Word transformations applied before wrapping.
|
|
2897
|
+
*
|
|
2898
|
+
* @param { (str: string) => string } wordTransform Word transformation function.
|
|
2899
|
+
*/
|
|
2900
|
+
pushWordTransform(wordTransform) {
|
|
2901
|
+
this._wordTransformer = new TransformerStackItem(this._wordTransformer, wordTransform);
|
|
2902
|
+
}
|
|
2903
|
+
/**
|
|
2904
|
+
* Remove a function from the word transformations stack.
|
|
2905
|
+
*
|
|
2906
|
+
* @returns { (str: string) => string } A function that was removed.
|
|
2907
|
+
*/
|
|
2908
|
+
popWordTransform() {
|
|
2909
|
+
if (!this._wordTransformer)
|
|
2910
|
+
return;
|
|
2911
|
+
let transform = this._wordTransformer.transform;
|
|
2912
|
+
return this._wordTransformer = this._wordTransformer.next, transform;
|
|
2913
|
+
}
|
|
2914
|
+
/**
|
|
2915
|
+
* Ignore wordwrap option in followup inline additions and disable automatic wrapping.
|
|
2916
|
+
*/
|
|
2917
|
+
startNoWrap() {
|
|
2918
|
+
this._stackItem.isNoWrap = !0;
|
|
2919
|
+
}
|
|
2920
|
+
/**
|
|
2921
|
+
* Return automatic wrapping to behavior defined by options.
|
|
2922
|
+
*/
|
|
2923
|
+
stopNoWrap() {
|
|
2924
|
+
this._stackItem.isNoWrap = !1;
|
|
2925
|
+
}
|
|
2926
|
+
/** @returns { (str: string) => string } */
|
|
2927
|
+
_getCombinedWordTransformer() {
|
|
2928
|
+
let wt = this._wordTransformer ? ((str) => applyTransformer(str, this._wordTransformer)) : void 0, ce = this.options.encodeCharacters;
|
|
2929
|
+
return wt ? ce ? (str) => ce(wt(str)) : wt : ce;
|
|
2930
|
+
}
|
|
2931
|
+
_popStackItem() {
|
|
2932
|
+
let item = this._stackItem;
|
|
2933
|
+
return this._stackItem = item.next, item;
|
|
2934
|
+
}
|
|
2935
|
+
/**
|
|
2936
|
+
* Add a line break into currently built block.
|
|
2937
|
+
*/
|
|
2938
|
+
addLineBreak() {
|
|
2939
|
+
(this._stackItem instanceof BlockStackItem || this._stackItem instanceof ListItemStackItem || this._stackItem instanceof TableCellStackItem) && (this._stackItem.isPre ? this._stackItem.rawText += `
|
|
2940
|
+
` : this._stackItem.inlineTextBuilder.startNewLine());
|
|
2941
|
+
}
|
|
2942
|
+
/**
|
|
2943
|
+
* Allow to break line in case directly following text will not fit.
|
|
2944
|
+
*/
|
|
2945
|
+
addWordBreakOpportunity() {
|
|
2946
|
+
(this._stackItem instanceof BlockStackItem || this._stackItem instanceof ListItemStackItem || this._stackItem instanceof TableCellStackItem) && (this._stackItem.inlineTextBuilder.wordBreakOpportunity = !0);
|
|
2947
|
+
}
|
|
2948
|
+
/**
|
|
2949
|
+
* Add a node inline into the currently built block.
|
|
2950
|
+
*
|
|
2951
|
+
* @param { string } str
|
|
2952
|
+
* Text content of a node to add.
|
|
2953
|
+
*
|
|
2954
|
+
* @param { object } [param1]
|
|
2955
|
+
* Object holding the parameters of the operation.
|
|
2956
|
+
*
|
|
2957
|
+
* @param { boolean } [param1.noWordTransform]
|
|
2958
|
+
* Ignore word transformers if there are any.
|
|
2959
|
+
* Don't encode characters as well.
|
|
2960
|
+
* (Use this for things like URL addresses).
|
|
2961
|
+
*/
|
|
2962
|
+
addInline(str, { noWordTransform = !1 } = {}) {
|
|
2963
|
+
if (this._stackItem instanceof BlockStackItem || this._stackItem instanceof ListItemStackItem || this._stackItem instanceof TableCellStackItem) {
|
|
2964
|
+
if (this._stackItem.isPre) {
|
|
2965
|
+
this._stackItem.rawText += str;
|
|
2966
|
+
return;
|
|
2967
|
+
}
|
|
2968
|
+
if (!(str.length === 0 || // empty string
|
|
2969
|
+
this._stackItem.stashedLineBreaks && // stashed linebreaks make whitespace irrelevant
|
|
2970
|
+
!this.whitespaceProcessor.testContainsWords(str))) {
|
|
2971
|
+
if (this.options.preserveNewlines) {
|
|
2972
|
+
let newlinesNumber = this.whitespaceProcessor.countNewlinesNoWords(str);
|
|
2973
|
+
if (newlinesNumber > 0) {
|
|
2974
|
+
this._stackItem.inlineTextBuilder.startNewLine(newlinesNumber);
|
|
2975
|
+
return;
|
|
2976
|
+
}
|
|
2977
|
+
}
|
|
2978
|
+
this._stackItem.stashedLineBreaks && this._stackItem.inlineTextBuilder.startNewLine(this._stackItem.stashedLineBreaks), this.whitespaceProcessor.shrinkWrapAdd(
|
|
2979
|
+
str,
|
|
2980
|
+
this._stackItem.inlineTextBuilder,
|
|
2981
|
+
noWordTransform ? void 0 : this._getCombinedWordTransformer(),
|
|
2982
|
+
this._stackItem.isNoWrap
|
|
2983
|
+
), this._stackItem.stashedLineBreaks = 0;
|
|
2984
|
+
}
|
|
2985
|
+
}
|
|
2986
|
+
}
|
|
2987
|
+
/**
|
|
2988
|
+
* Add a string inline into the currently built block.
|
|
2989
|
+
*
|
|
2990
|
+
* Use this for markup elements that don't have to adhere
|
|
2991
|
+
* to text layout rules.
|
|
2992
|
+
*
|
|
2993
|
+
* @param { string } str Text to add.
|
|
2994
|
+
*/
|
|
2995
|
+
addLiteral(str) {
|
|
2996
|
+
if ((this._stackItem instanceof BlockStackItem || this._stackItem instanceof ListItemStackItem || this._stackItem instanceof TableCellStackItem) && str.length !== 0) {
|
|
2997
|
+
if (this._stackItem.isPre) {
|
|
2998
|
+
this._stackItem.rawText += str;
|
|
2999
|
+
return;
|
|
3000
|
+
}
|
|
3001
|
+
this._stackItem.stashedLineBreaks && this._stackItem.inlineTextBuilder.startNewLine(this._stackItem.stashedLineBreaks), this.whitespaceProcessor.addLiteral(
|
|
3002
|
+
str,
|
|
3003
|
+
this._stackItem.inlineTextBuilder,
|
|
3004
|
+
this._stackItem.isNoWrap
|
|
3005
|
+
), this._stackItem.stashedLineBreaks = 0;
|
|
3006
|
+
}
|
|
3007
|
+
}
|
|
3008
|
+
/**
|
|
3009
|
+
* Start building a new block.
|
|
3010
|
+
*
|
|
3011
|
+
* @param { object } [param0]
|
|
3012
|
+
* Object holding the parameters of the block.
|
|
3013
|
+
*
|
|
3014
|
+
* @param { number } [param0.leadingLineBreaks]
|
|
3015
|
+
* This block should have at least this number of line breaks to separate it from any preceding block.
|
|
3016
|
+
*
|
|
3017
|
+
* @param { number } [param0.reservedLineLength]
|
|
3018
|
+
* Reserve this number of characters on each line for block markup.
|
|
3019
|
+
*
|
|
3020
|
+
* @param { boolean } [param0.isPre]
|
|
3021
|
+
* Should HTML whitespace be preserved inside this block.
|
|
3022
|
+
*/
|
|
3023
|
+
openBlock({ leadingLineBreaks = 1, reservedLineLength = 0, isPre = !1 } = {}) {
|
|
3024
|
+
let maxLineLength = Math.max(20, this._stackItem.inlineTextBuilder.maxLineLength - reservedLineLength);
|
|
3025
|
+
this._stackItem = new BlockStackItem(
|
|
3026
|
+
this.options,
|
|
3027
|
+
this._stackItem,
|
|
3028
|
+
leadingLineBreaks,
|
|
3029
|
+
maxLineLength
|
|
3030
|
+
), isPre && (this._stackItem.isPre = !0);
|
|
3031
|
+
}
|
|
3032
|
+
/**
|
|
3033
|
+
* Finalize currently built block, add it's content to the parent block.
|
|
3034
|
+
*
|
|
3035
|
+
* @param { object } [param0]
|
|
3036
|
+
* Object holding the parameters of the block.
|
|
3037
|
+
*
|
|
3038
|
+
* @param { number } [param0.trailingLineBreaks]
|
|
3039
|
+
* This block should have at least this number of line breaks to separate it from any following block.
|
|
3040
|
+
*
|
|
3041
|
+
* @param { (str: string) => string } [param0.blockTransform]
|
|
3042
|
+
* A function to transform the block text before adding to the parent block.
|
|
3043
|
+
* This happens after word wrap and should be used in combination with reserved line length
|
|
3044
|
+
* in order to keep line lengths correct.
|
|
3045
|
+
* Used for whole block markup.
|
|
3046
|
+
*/
|
|
3047
|
+
closeBlock({ trailingLineBreaks = 1, blockTransform = void 0 } = {}) {
|
|
3048
|
+
let block = this._popStackItem(), blockText = blockTransform ? blockTransform(getText(block)) : getText(block);
|
|
3049
|
+
addText(this._stackItem, blockText, block.leadingLineBreaks, Math.max(block.stashedLineBreaks, trailingLineBreaks));
|
|
3050
|
+
}
|
|
3051
|
+
/**
|
|
3052
|
+
* Start building a new list.
|
|
3053
|
+
*
|
|
3054
|
+
* @param { object } [param0]
|
|
3055
|
+
* Object holding the parameters of the list.
|
|
3056
|
+
*
|
|
3057
|
+
* @param { number } [param0.maxPrefixLength]
|
|
3058
|
+
* Length of the longest list item prefix.
|
|
3059
|
+
* If not supplied or too small then list items won't be aligned properly.
|
|
3060
|
+
*
|
|
3061
|
+
* @param { 'left' | 'right' } [param0.prefixAlign]
|
|
3062
|
+
* Specify how prefixes of different lengths have to be aligned
|
|
3063
|
+
* within a column.
|
|
3064
|
+
*
|
|
3065
|
+
* @param { number } [param0.interRowLineBreaks]
|
|
3066
|
+
* Minimum number of line breaks between list items.
|
|
3067
|
+
*
|
|
3068
|
+
* @param { number } [param0.leadingLineBreaks]
|
|
3069
|
+
* This list should have at least this number of line breaks to separate it from any preceding block.
|
|
3070
|
+
*/
|
|
3071
|
+
openList({ maxPrefixLength = 0, prefixAlign = "left", interRowLineBreaks = 1, leadingLineBreaks = 2 } = {}) {
|
|
3072
|
+
this._stackItem = new ListStackItem(this.options, this._stackItem, {
|
|
3073
|
+
interRowLineBreaks,
|
|
3074
|
+
leadingLineBreaks,
|
|
3075
|
+
maxLineLength: this._stackItem.inlineTextBuilder.maxLineLength,
|
|
3076
|
+
maxPrefixLength,
|
|
3077
|
+
prefixAlign
|
|
3078
|
+
});
|
|
3079
|
+
}
|
|
3080
|
+
/**
|
|
3081
|
+
* Start building a new list item.
|
|
3082
|
+
*
|
|
3083
|
+
* @param {object} param0
|
|
3084
|
+
* Object holding the parameters of the list item.
|
|
3085
|
+
*
|
|
3086
|
+
* @param { string } [param0.prefix]
|
|
3087
|
+
* Prefix for this list item (item number, bullet point, etc).
|
|
3088
|
+
*/
|
|
3089
|
+
openListItem({ prefix = "" } = {}) {
|
|
3090
|
+
if (!(this._stackItem instanceof ListStackItem))
|
|
3091
|
+
throw new Error("Can't add a list item to something that is not a list! Check the formatter.");
|
|
3092
|
+
let list = this._stackItem, prefixLength = Math.max(prefix.length, list.maxPrefixLength), maxLineLength = Math.max(20, list.inlineTextBuilder.maxLineLength - prefixLength);
|
|
3093
|
+
this._stackItem = new ListItemStackItem(this.options, list, {
|
|
3094
|
+
prefix,
|
|
3095
|
+
maxLineLength,
|
|
3096
|
+
leadingLineBreaks: list.interRowLineBreaks
|
|
3097
|
+
});
|
|
3098
|
+
}
|
|
3099
|
+
/**
|
|
3100
|
+
* Finalize currently built list item, add it's content to the parent list.
|
|
3101
|
+
*/
|
|
3102
|
+
closeListItem() {
|
|
3103
|
+
let listItem = this._popStackItem(), list = listItem.next, prefixLength = Math.max(listItem.prefix.length, list.maxPrefixLength), spacing = `
|
|
3104
|
+
` + " ".repeat(prefixLength), text = (list.prefixAlign === "right" ? listItem.prefix.padStart(prefixLength) : listItem.prefix.padEnd(prefixLength)) + getText(listItem).replace(/\n/g, spacing);
|
|
3105
|
+
addText(
|
|
3106
|
+
list,
|
|
3107
|
+
text,
|
|
3108
|
+
listItem.leadingLineBreaks,
|
|
3109
|
+
Math.max(listItem.stashedLineBreaks, list.interRowLineBreaks)
|
|
3110
|
+
);
|
|
3111
|
+
}
|
|
3112
|
+
/**
|
|
3113
|
+
* Finalize currently built list, add it's content to the parent block.
|
|
3114
|
+
*
|
|
3115
|
+
* @param { object } param0
|
|
3116
|
+
* Object holding the parameters of the list.
|
|
3117
|
+
*
|
|
3118
|
+
* @param { number } [param0.trailingLineBreaks]
|
|
3119
|
+
* This list should have at least this number of line breaks to separate it from any following block.
|
|
3120
|
+
*/
|
|
3121
|
+
closeList({ trailingLineBreaks = 2 } = {}) {
|
|
3122
|
+
let list = this._popStackItem(), text = getText(list);
|
|
3123
|
+
text && addText(this._stackItem, text, list.leadingLineBreaks, trailingLineBreaks);
|
|
3124
|
+
}
|
|
3125
|
+
/**
|
|
3126
|
+
* Start building a table.
|
|
3127
|
+
*/
|
|
3128
|
+
openTable() {
|
|
3129
|
+
this._stackItem = new TableStackItem(this._stackItem);
|
|
3130
|
+
}
|
|
3131
|
+
/**
|
|
3132
|
+
* Start building a table row.
|
|
3133
|
+
*/
|
|
3134
|
+
openTableRow() {
|
|
3135
|
+
if (!(this._stackItem instanceof TableStackItem))
|
|
3136
|
+
throw new Error("Can't add a table row to something that is not a table! Check the formatter.");
|
|
3137
|
+
this._stackItem = new TableRowStackItem(this._stackItem);
|
|
3138
|
+
}
|
|
3139
|
+
/**
|
|
3140
|
+
* Start building a table cell.
|
|
3141
|
+
*
|
|
3142
|
+
* @param { object } [param0]
|
|
3143
|
+
* Object holding the parameters of the cell.
|
|
3144
|
+
*
|
|
3145
|
+
* @param { number } [param0.maxColumnWidth]
|
|
3146
|
+
* Wrap cell content to this width. Fall back to global wordwrap value if undefined.
|
|
3147
|
+
*/
|
|
3148
|
+
openTableCell({ maxColumnWidth = void 0 } = {}) {
|
|
3149
|
+
if (!(this._stackItem instanceof TableRowStackItem))
|
|
3150
|
+
throw new Error("Can't add a table cell to something that is not a table row! Check the formatter.");
|
|
3151
|
+
this._stackItem = new TableCellStackItem(this.options, this._stackItem, maxColumnWidth);
|
|
3152
|
+
}
|
|
3153
|
+
/**
|
|
3154
|
+
* Finalize currently built table cell and add it to parent table row's cells.
|
|
3155
|
+
*
|
|
3156
|
+
* @param { object } [param0]
|
|
3157
|
+
* Object holding the parameters of the cell.
|
|
3158
|
+
*
|
|
3159
|
+
* @param { number } [param0.colspan] How many columns this cell should occupy.
|
|
3160
|
+
* @param { number } [param0.rowspan] How many rows this cell should occupy.
|
|
3161
|
+
*/
|
|
3162
|
+
closeTableCell({ colspan = 1, rowspan = 1 } = {}) {
|
|
3163
|
+
let cell = this._popStackItem(), text = trimCharacter(getText(cell), `
|
|
3164
|
+
`);
|
|
3165
|
+
cell.next.cells.push({ colspan, rowspan, text });
|
|
3166
|
+
}
|
|
3167
|
+
/**
|
|
3168
|
+
* Finalize currently built table row and add it to parent table's rows.
|
|
3169
|
+
*/
|
|
3170
|
+
closeTableRow() {
|
|
3171
|
+
let row = this._popStackItem();
|
|
3172
|
+
row.next.rows.push(row.cells);
|
|
3173
|
+
}
|
|
3174
|
+
/**
|
|
3175
|
+
* Finalize currently built table and add the rendered text to the parent block.
|
|
3176
|
+
*
|
|
3177
|
+
* @param { object } param0
|
|
3178
|
+
* Object holding the parameters of the table.
|
|
3179
|
+
*
|
|
3180
|
+
* @param { TablePrinter } param0.tableToString
|
|
3181
|
+
* A function to convert a table of stringified cells into a complete table.
|
|
3182
|
+
*
|
|
3183
|
+
* @param { number } [param0.leadingLineBreaks]
|
|
3184
|
+
* This table should have at least this number of line breaks to separate if from any preceding block.
|
|
3185
|
+
*
|
|
3186
|
+
* @param { number } [param0.trailingLineBreaks]
|
|
3187
|
+
* This table should have at least this number of line breaks to separate it from any following block.
|
|
3188
|
+
*/
|
|
3189
|
+
closeTable({ tableToString: tableToString2, leadingLineBreaks = 2, trailingLineBreaks = 2 }) {
|
|
3190
|
+
let table = this._popStackItem(), output = tableToString2(table.rows);
|
|
3191
|
+
output && addText(this._stackItem, output, leadingLineBreaks, trailingLineBreaks);
|
|
3192
|
+
}
|
|
3193
|
+
/**
|
|
3194
|
+
* Return the rendered text content of this builder.
|
|
3195
|
+
*
|
|
3196
|
+
* @returns { string }
|
|
3197
|
+
*/
|
|
3198
|
+
toString() {
|
|
3199
|
+
return getText(this._stackItem.getRoot());
|
|
3200
|
+
}
|
|
3201
|
+
};
|
|
3202
|
+
function getText(stackItem) {
|
|
3203
|
+
if (!(stackItem instanceof BlockStackItem || stackItem instanceof ListItemStackItem || stackItem instanceof TableCellStackItem))
|
|
3204
|
+
throw new Error("Only blocks, list items and table cells can be requested for text contents.");
|
|
3205
|
+
return stackItem.inlineTextBuilder.isEmpty() ? stackItem.rawText : stackItem.rawText + stackItem.inlineTextBuilder.toString();
|
|
3206
|
+
}
|
|
3207
|
+
function addText(stackItem, text, leadingLineBreaks, trailingLineBreaks) {
|
|
3208
|
+
if (!(stackItem instanceof BlockStackItem || stackItem instanceof ListItemStackItem || stackItem instanceof TableCellStackItem))
|
|
3209
|
+
throw new Error("Only blocks, list items and table cells can contain text.");
|
|
3210
|
+
let parentText = getText(stackItem), lineBreaks = Math.max(stackItem.stashedLineBreaks, leadingLineBreaks);
|
|
3211
|
+
stackItem.inlineTextBuilder.clear(), parentText ? stackItem.rawText = parentText + `
|
|
3212
|
+
`.repeat(lineBreaks) + text : (stackItem.rawText = text, stackItem.leadingLineBreaks = lineBreaks), stackItem.stashedLineBreaks = trailingLineBreaks;
|
|
3213
|
+
}
|
|
3214
|
+
function applyTransformer(str, transformer) {
|
|
3215
|
+
return transformer ? applyTransformer(transformer.transform(str), transformer.next) : str;
|
|
3216
|
+
}
|
|
3217
|
+
function compile$1(options = {}) {
|
|
3218
|
+
let selectorsWithoutFormat = options.selectors.filter((s2) => !s2.format);
|
|
3219
|
+
if (selectorsWithoutFormat.length)
|
|
3220
|
+
throw new Error(
|
|
3221
|
+
"Following selectors have no specified format: " + selectorsWithoutFormat.map((s2) => `\`${s2.selector}\``).join(", ")
|
|
3222
|
+
);
|
|
3223
|
+
let picker = new DecisionTree(
|
|
3224
|
+
options.selectors.map((s2) => [s2.selector, s2])
|
|
3225
|
+
).build(hp2Builder);
|
|
3226
|
+
typeof options.encodeCharacters != "function" && (options.encodeCharacters = makeReplacerFromDict(options.encodeCharacters));
|
|
3227
|
+
let baseSelectorsPicker = new DecisionTree(
|
|
3228
|
+
options.baseElements.selectors.map((s2, i) => [s2, i + 1])
|
|
3229
|
+
).build(hp2Builder);
|
|
3230
|
+
function findBaseElements(dom) {
|
|
3231
|
+
return findBases(dom, options, baseSelectorsPicker);
|
|
3232
|
+
}
|
|
3233
|
+
let limitedWalk = limitedDepthRecursive(
|
|
3234
|
+
options.limits.maxDepth,
|
|
3235
|
+
recursiveWalk,
|
|
3236
|
+
function(dom, builder) {
|
|
3237
|
+
builder.addInline(options.limits.ellipsis || "");
|
|
3238
|
+
}
|
|
3239
|
+
);
|
|
3240
|
+
return function(html, metadata = void 0) {
|
|
3241
|
+
return process(html, metadata, options, picker, findBaseElements, limitedWalk);
|
|
3242
|
+
};
|
|
3243
|
+
}
|
|
3244
|
+
function process(html, metadata, options, picker, findBaseElements, walk) {
|
|
3245
|
+
let maxInputLength = options.limits.maxInputLength;
|
|
3246
|
+
maxInputLength && html && html.length > maxInputLength && (console.warn(
|
|
3247
|
+
`Input length ${html.length} is above allowed limit of ${maxInputLength}. Truncating without ellipsis.`
|
|
3248
|
+
), html = html.substring(0, maxInputLength));
|
|
3249
|
+
let document = parseDocument(html, { decodeEntities: options.decodeEntities }), bases = findBaseElements(document.children), builder = new BlockTextBuilder(options, picker, metadata);
|
|
3250
|
+
return walk(bases, builder), builder.toString();
|
|
3251
|
+
}
|
|
3252
|
+
function findBases(dom, options, baseSelectorsPicker) {
|
|
3253
|
+
let results = [];
|
|
3254
|
+
function recursiveWalk2(walk, dom2) {
|
|
3255
|
+
dom2 = dom2.slice(0, options.limits.maxChildNodes);
|
|
3256
|
+
for (let elem of dom2) {
|
|
3257
|
+
if (elem.type !== "tag")
|
|
3258
|
+
continue;
|
|
3259
|
+
let pickedSelectorIndex = baseSelectorsPicker.pick1(elem);
|
|
3260
|
+
if (pickedSelectorIndex > 0 ? results.push({ selectorIndex: pickedSelectorIndex, element: elem }) : elem.children && walk(elem.children), results.length >= options.limits.maxBaseElements)
|
|
3261
|
+
return;
|
|
3262
|
+
}
|
|
3263
|
+
}
|
|
3264
|
+
return limitedDepthRecursive(
|
|
3265
|
+
options.limits.maxDepth,
|
|
3266
|
+
recursiveWalk2
|
|
3267
|
+
)(dom), options.baseElements.orderBy !== "occurrence" && results.sort((a, b) => a.selectorIndex - b.selectorIndex), options.baseElements.returnDomByDefault && results.length === 0 ? dom : results.map((x) => x.element);
|
|
3268
|
+
}
|
|
3269
|
+
function recursiveWalk(walk, dom, builder) {
|
|
3270
|
+
if (!dom)
|
|
3271
|
+
return;
|
|
3272
|
+
let options = builder.options;
|
|
3273
|
+
dom.length > options.limits.maxChildNodes && (dom = dom.slice(0, options.limits.maxChildNodes), dom.push({
|
|
3274
|
+
data: options.limits.ellipsis,
|
|
3275
|
+
type: "text"
|
|
3276
|
+
}));
|
|
3277
|
+
for (let elem of dom)
|
|
3278
|
+
switch (elem.type) {
|
|
3279
|
+
case "text": {
|
|
3280
|
+
builder.addInline(elem.data);
|
|
3281
|
+
break;
|
|
3282
|
+
}
|
|
3283
|
+
case "tag": {
|
|
3284
|
+
let tagDefinition = builder.picker.pick1(elem), format = options.formatters[tagDefinition.format];
|
|
3285
|
+
format(elem, walk, builder, tagDefinition.options || {});
|
|
3286
|
+
break;
|
|
3287
|
+
}
|
|
3288
|
+
}
|
|
3289
|
+
}
|
|
3290
|
+
function makeReplacerFromDict(dict) {
|
|
3291
|
+
if (!dict || Object.keys(dict).length === 0)
|
|
3292
|
+
return;
|
|
3293
|
+
let entries = Object.entries(dict).filter(([, v]) => v !== !1), regex = new RegExp(
|
|
3294
|
+
entries.map(([c2]) => `(${unicodeEscape([...c2][0])})`).join("|"),
|
|
3295
|
+
"g"
|
|
3296
|
+
), values = entries.map(([, v]) => v), replacer = (m, ...cgs) => values[cgs.findIndex((cg) => cg)];
|
|
3297
|
+
return (str) => str.replace(regex, replacer);
|
|
3298
|
+
}
|
|
3299
|
+
function formatSkip(elem, walk, builder, formatOptions) {
|
|
3300
|
+
}
|
|
3301
|
+
function formatInlineString(elem, walk, builder, formatOptions) {
|
|
3302
|
+
builder.addLiteral(formatOptions.string || "");
|
|
3303
|
+
}
|
|
3304
|
+
function formatBlockString(elem, walk, builder, formatOptions) {
|
|
3305
|
+
builder.openBlock({ leadingLineBreaks: formatOptions.leadingLineBreaks || 2 }), builder.addLiteral(formatOptions.string || ""), builder.closeBlock({ trailingLineBreaks: formatOptions.trailingLineBreaks || 2 });
|
|
3306
|
+
}
|
|
3307
|
+
function formatInline(elem, walk, builder, formatOptions) {
|
|
3308
|
+
walk(elem.children, builder);
|
|
3309
|
+
}
|
|
3310
|
+
function formatBlock$1(elem, walk, builder, formatOptions) {
|
|
3311
|
+
builder.openBlock({ leadingLineBreaks: formatOptions.leadingLineBreaks || 2 }), walk(elem.children, builder), builder.closeBlock({ trailingLineBreaks: formatOptions.trailingLineBreaks || 2 });
|
|
3312
|
+
}
|
|
3313
|
+
function renderOpenTag(elem) {
|
|
3314
|
+
let attrs = elem.attribs && elem.attribs.length ? " " + Object.entries(elem.attribs).map(([k, v]) => v === "" ? k : `${k}=${v.replace(/"/g, """)}`).join(" ") : "";
|
|
3315
|
+
return `<${elem.name}${attrs}>`;
|
|
3316
|
+
}
|
|
3317
|
+
function renderCloseTag(elem) {
|
|
3318
|
+
return `</${elem.name}>`;
|
|
3319
|
+
}
|
|
3320
|
+
function formatInlineTag(elem, walk, builder, formatOptions) {
|
|
3321
|
+
builder.startNoWrap(), builder.addLiteral(renderOpenTag(elem)), builder.stopNoWrap(), walk(elem.children, builder), builder.startNoWrap(), builder.addLiteral(renderCloseTag(elem)), builder.stopNoWrap();
|
|
3322
|
+
}
|
|
3323
|
+
function formatBlockTag(elem, walk, builder, formatOptions) {
|
|
3324
|
+
builder.openBlock({ leadingLineBreaks: formatOptions.leadingLineBreaks || 2 }), builder.startNoWrap(), builder.addLiteral(renderOpenTag(elem)), builder.stopNoWrap(), walk(elem.children, builder), builder.startNoWrap(), builder.addLiteral(renderCloseTag(elem)), builder.stopNoWrap(), builder.closeBlock({ trailingLineBreaks: formatOptions.trailingLineBreaks || 2 });
|
|
3325
|
+
}
|
|
3326
|
+
function formatInlineHtml(elem, walk, builder, formatOptions) {
|
|
3327
|
+
builder.startNoWrap(), builder.addLiteral(
|
|
3328
|
+
render(elem, { decodeEntities: builder.options.decodeEntities })
|
|
3329
|
+
), builder.stopNoWrap();
|
|
3330
|
+
}
|
|
3331
|
+
function formatBlockHtml(elem, walk, builder, formatOptions) {
|
|
3332
|
+
builder.openBlock({ leadingLineBreaks: formatOptions.leadingLineBreaks || 2 }), builder.startNoWrap(), builder.addLiteral(
|
|
3333
|
+
render(elem, { decodeEntities: builder.options.decodeEntities })
|
|
3334
|
+
), builder.stopNoWrap(), builder.closeBlock({ trailingLineBreaks: formatOptions.trailingLineBreaks || 2 });
|
|
3335
|
+
}
|
|
3336
|
+
function formatInlineSurround(elem, walk, builder, formatOptions) {
|
|
3337
|
+
builder.addLiteral(formatOptions.prefix || ""), walk(elem.children, builder), builder.addLiteral(formatOptions.suffix || "");
|
|
3338
|
+
}
|
|
3339
|
+
var genericFormatters = /* @__PURE__ */ Object.freeze({
|
|
3340
|
+
__proto__: null,
|
|
3341
|
+
block: formatBlock$1,
|
|
3342
|
+
blockHtml: formatBlockHtml,
|
|
3343
|
+
blockString: formatBlockString,
|
|
3344
|
+
blockTag: formatBlockTag,
|
|
3345
|
+
inline: formatInline,
|
|
3346
|
+
inlineHtml: formatInlineHtml,
|
|
3347
|
+
inlineString: formatInlineString,
|
|
3348
|
+
inlineSurround: formatInlineSurround,
|
|
3349
|
+
inlineTag: formatInlineTag,
|
|
3350
|
+
skip: formatSkip
|
|
3351
|
+
});
|
|
3352
|
+
function getRow(matrix, j) {
|
|
3353
|
+
return matrix[j] || (matrix[j] = []), matrix[j];
|
|
3354
|
+
}
|
|
3355
|
+
function findFirstVacantIndex(row, x = 0) {
|
|
3356
|
+
for (; row[x]; )
|
|
3357
|
+
x++;
|
|
3358
|
+
return x;
|
|
3359
|
+
}
|
|
3360
|
+
function transposeInPlace(matrix, maxSize) {
|
|
3361
|
+
for (let i = 0; i < maxSize; i++) {
|
|
3362
|
+
let rowI = getRow(matrix, i);
|
|
3363
|
+
for (let j = 0; j < i; j++) {
|
|
3364
|
+
let rowJ = getRow(matrix, j);
|
|
3365
|
+
if (rowI[j] || rowJ[i]) {
|
|
3366
|
+
let temp = rowI[j];
|
|
3367
|
+
rowI[j] = rowJ[i], rowJ[i] = temp;
|
|
3368
|
+
}
|
|
3369
|
+
}
|
|
3370
|
+
}
|
|
3371
|
+
}
|
|
3372
|
+
function putCellIntoLayout(cell, layout, baseRow, baseCol) {
|
|
3373
|
+
for (let r2 = 0; r2 < cell.rowspan; r2++) {
|
|
3374
|
+
let layoutRow = getRow(layout, baseRow + r2);
|
|
3375
|
+
for (let c2 = 0; c2 < cell.colspan; c2++)
|
|
3376
|
+
layoutRow[baseCol + c2] = cell;
|
|
3377
|
+
}
|
|
3378
|
+
}
|
|
3379
|
+
function getOrInitOffset(offsets, index) {
|
|
3380
|
+
return offsets[index] === void 0 && (offsets[index] = index === 0 ? 0 : 1 + getOrInitOffset(offsets, index - 1)), offsets[index];
|
|
3381
|
+
}
|
|
3382
|
+
function updateOffset(offsets, base, span, value) {
|
|
3383
|
+
offsets[base + span] = Math.max(
|
|
3384
|
+
getOrInitOffset(offsets, base + span),
|
|
3385
|
+
getOrInitOffset(offsets, base) + value
|
|
3386
|
+
);
|
|
3387
|
+
}
|
|
3388
|
+
function tableToString(tableRows, rowSpacing, colSpacing) {
|
|
3389
|
+
let layout = [], colNumber = 0, rowNumber = tableRows.length, rowOffsets = [0];
|
|
3390
|
+
for (let j = 0; j < rowNumber; j++) {
|
|
3391
|
+
let layoutRow = getRow(layout, j), cells = tableRows[j], x = 0;
|
|
3392
|
+
for (let i = 0; i < cells.length; i++) {
|
|
3393
|
+
let cell = cells[i];
|
|
3394
|
+
x = findFirstVacantIndex(layoutRow, x), putCellIntoLayout(cell, layout, j, x), x += cell.colspan, cell.lines = cell.text.split(`
|
|
3395
|
+
`);
|
|
3396
|
+
let cellHeight = cell.lines.length;
|
|
3397
|
+
updateOffset(rowOffsets, j, cell.rowspan, cellHeight + rowSpacing);
|
|
3398
|
+
}
|
|
3399
|
+
colNumber = layoutRow.length > colNumber ? layoutRow.length : colNumber;
|
|
3400
|
+
}
|
|
3401
|
+
transposeInPlace(layout, rowNumber > colNumber ? rowNumber : colNumber);
|
|
3402
|
+
let outputLines = [], colOffsets = [0];
|
|
3403
|
+
for (let x = 0; x < colNumber; x++) {
|
|
3404
|
+
let y = 0, cell, rowsInThisColumn = Math.min(rowNumber, layout[x].length);
|
|
3405
|
+
for (; y < rowsInThisColumn; )
|
|
3406
|
+
if (cell = layout[x][y], cell) {
|
|
3407
|
+
if (!cell.rendered) {
|
|
3408
|
+
let cellWidth = 0;
|
|
3409
|
+
for (let j = 0; j < cell.lines.length; j++) {
|
|
3410
|
+
let line = cell.lines[j], lineOffset = rowOffsets[y] + j;
|
|
3411
|
+
outputLines[lineOffset] = (outputLines[lineOffset] || "").padEnd(colOffsets[x]) + line, cellWidth = line.length > cellWidth ? line.length : cellWidth;
|
|
3412
|
+
}
|
|
3413
|
+
updateOffset(colOffsets, x, cell.colspan, cellWidth + colSpacing), cell.rendered = !0;
|
|
3414
|
+
}
|
|
3415
|
+
y += cell.rowspan;
|
|
3416
|
+
} else {
|
|
3417
|
+
let lineOffset = rowOffsets[y];
|
|
3418
|
+
outputLines[lineOffset] = outputLines[lineOffset] || "", y++;
|
|
3419
|
+
}
|
|
3420
|
+
}
|
|
3421
|
+
return outputLines.join(`
|
|
3422
|
+
`);
|
|
3423
|
+
}
|
|
3424
|
+
function formatLineBreak(elem, walk, builder, formatOptions) {
|
|
3425
|
+
builder.addLineBreak();
|
|
3426
|
+
}
|
|
3427
|
+
function formatWbr(elem, walk, builder, formatOptions) {
|
|
3428
|
+
builder.addWordBreakOpportunity();
|
|
3429
|
+
}
|
|
3430
|
+
function formatHorizontalLine(elem, walk, builder, formatOptions) {
|
|
3431
|
+
builder.openBlock({ leadingLineBreaks: formatOptions.leadingLineBreaks || 2 }), builder.addInline("-".repeat(formatOptions.length || builder.options.wordwrap || 40)), builder.closeBlock({ trailingLineBreaks: formatOptions.trailingLineBreaks || 2 });
|
|
3432
|
+
}
|
|
3433
|
+
function formatParagraph(elem, walk, builder, formatOptions) {
|
|
3434
|
+
builder.openBlock({ leadingLineBreaks: formatOptions.leadingLineBreaks || 2 }), walk(elem.children, builder), builder.closeBlock({ trailingLineBreaks: formatOptions.trailingLineBreaks || 2 });
|
|
3435
|
+
}
|
|
3436
|
+
function formatPre(elem, walk, builder, formatOptions) {
|
|
3437
|
+
builder.openBlock({
|
|
3438
|
+
isPre: !0,
|
|
3439
|
+
leadingLineBreaks: formatOptions.leadingLineBreaks || 2
|
|
3440
|
+
}), walk(elem.children, builder), builder.closeBlock({ trailingLineBreaks: formatOptions.trailingLineBreaks || 2 });
|
|
3441
|
+
}
|
|
3442
|
+
function formatHeading(elem, walk, builder, formatOptions) {
|
|
3443
|
+
builder.openBlock({ leadingLineBreaks: formatOptions.leadingLineBreaks || 2 }), formatOptions.uppercase !== !1 ? (builder.pushWordTransform((str) => str.toUpperCase()), walk(elem.children, builder), builder.popWordTransform()) : walk(elem.children, builder), builder.closeBlock({ trailingLineBreaks: formatOptions.trailingLineBreaks || 2 });
|
|
3444
|
+
}
|
|
3445
|
+
function formatBlockquote(elem, walk, builder, formatOptions) {
|
|
3446
|
+
builder.openBlock({
|
|
3447
|
+
leadingLineBreaks: formatOptions.leadingLineBreaks || 2,
|
|
3448
|
+
reservedLineLength: 2
|
|
3449
|
+
}), walk(elem.children, builder), builder.closeBlock({
|
|
3450
|
+
trailingLineBreaks: formatOptions.trailingLineBreaks || 2,
|
|
3451
|
+
blockTransform: (str) => (formatOptions.trimEmptyLines !== !1 ? trimCharacter(str, `
|
|
3452
|
+
`) : str).split(`
|
|
3453
|
+
`).map((line) => "> " + line).join(`
|
|
3454
|
+
`)
|
|
3455
|
+
});
|
|
3456
|
+
}
|
|
3457
|
+
function withBrackets(str, brackets) {
|
|
3458
|
+
if (!brackets)
|
|
3459
|
+
return str;
|
|
3460
|
+
let lbr = typeof brackets[0] == "string" ? brackets[0] : "[", rbr = typeof brackets[1] == "string" ? brackets[1] : "]";
|
|
3461
|
+
return lbr + str + rbr;
|
|
3462
|
+
}
|
|
3463
|
+
function pathRewrite(path, rewriter, baseUrl, metadata, elem) {
|
|
3464
|
+
let modifiedPath = typeof rewriter == "function" ? rewriter(path, metadata, elem) : path;
|
|
3465
|
+
return modifiedPath[0] === "/" && baseUrl ? trimCharacterEnd(baseUrl, "/") + modifiedPath : modifiedPath;
|
|
3466
|
+
}
|
|
3467
|
+
function formatImage(elem, walk, builder, formatOptions) {
|
|
3468
|
+
let attribs = elem.attribs || {}, alt = attribs.alt ? attribs.alt : "", src = attribs.src ? pathRewrite(attribs.src, formatOptions.pathRewrite, formatOptions.baseUrl, builder.metadata, elem) : "", text = src ? alt ? alt + " " + withBrackets(src, formatOptions.linkBrackets) : withBrackets(src, formatOptions.linkBrackets) : alt;
|
|
3469
|
+
builder.addInline(text, { noWordTransform: !0 });
|
|
3470
|
+
}
|
|
3471
|
+
function formatAnchor(elem, walk, builder, formatOptions) {
|
|
3472
|
+
function getHref() {
|
|
3473
|
+
if (formatOptions.ignoreHref || !elem.attribs || !elem.attribs.href)
|
|
3474
|
+
return "";
|
|
3475
|
+
let href2 = elem.attribs.href.replace(/^mailto:/, "");
|
|
3476
|
+
return formatOptions.noAnchorUrl && href2[0] === "#" ? "" : (href2 = pathRewrite(href2, formatOptions.pathRewrite, formatOptions.baseUrl, builder.metadata, elem), href2);
|
|
3477
|
+
}
|
|
3478
|
+
let href = getHref();
|
|
3479
|
+
if (!href)
|
|
3480
|
+
walk(elem.children, builder);
|
|
3481
|
+
else {
|
|
3482
|
+
let text = "";
|
|
3483
|
+
builder.pushWordTransform(
|
|
3484
|
+
(str) => (str && (text += str), str)
|
|
3485
|
+
), walk(elem.children, builder), builder.popWordTransform(), formatOptions.hideLinkHrefIfSameAsText && href === text || builder.addInline(
|
|
3486
|
+
text ? " " + withBrackets(href, formatOptions.linkBrackets) : href,
|
|
3487
|
+
{ noWordTransform: !0 }
|
|
3488
|
+
);
|
|
3489
|
+
}
|
|
3490
|
+
}
|
|
3491
|
+
function formatList(elem, walk, builder, formatOptions, nextPrefixCallback) {
|
|
3492
|
+
let isNestedList = get(elem, ["parent", "name"]) === "li", maxPrefixLength = 0, listItems = (elem.children || []).filter((child) => child.type !== "text" || !/^\s*$/.test(child.data)).map(function(child) {
|
|
3493
|
+
if (child.name !== "li")
|
|
3494
|
+
return { node: child, prefix: "" };
|
|
3495
|
+
let prefix = isNestedList ? nextPrefixCallback().trimStart() : nextPrefixCallback();
|
|
3496
|
+
return prefix.length > maxPrefixLength && (maxPrefixLength = prefix.length), { node: child, prefix };
|
|
3497
|
+
});
|
|
3498
|
+
if (listItems.length) {
|
|
3499
|
+
builder.openList({
|
|
3500
|
+
interRowLineBreaks: 1,
|
|
3501
|
+
leadingLineBreaks: isNestedList ? 1 : formatOptions.leadingLineBreaks || 2,
|
|
3502
|
+
maxPrefixLength,
|
|
3503
|
+
prefixAlign: "left"
|
|
3504
|
+
});
|
|
3505
|
+
for (let { node, prefix } of listItems)
|
|
3506
|
+
builder.openListItem({ prefix }), walk([node], builder), builder.closeListItem();
|
|
3507
|
+
builder.closeList({ trailingLineBreaks: isNestedList ? 1 : formatOptions.trailingLineBreaks || 2 });
|
|
3508
|
+
}
|
|
3509
|
+
}
|
|
3510
|
+
function formatUnorderedList(elem, walk, builder, formatOptions) {
|
|
3511
|
+
let prefix = formatOptions.itemPrefix || " * ";
|
|
3512
|
+
return formatList(elem, walk, builder, formatOptions, () => prefix);
|
|
3513
|
+
}
|
|
3514
|
+
function formatOrderedList(elem, walk, builder, formatOptions) {
|
|
3515
|
+
let nextIndex = Number(elem.attribs.start || "1"), indexFunction = getOrderedListIndexFunction(elem.attribs.type);
|
|
3516
|
+
return formatList(elem, walk, builder, formatOptions, () => " " + indexFunction(nextIndex++) + ". ");
|
|
3517
|
+
}
|
|
3518
|
+
function getOrderedListIndexFunction(olType = "1") {
|
|
3519
|
+
switch (olType) {
|
|
3520
|
+
case "a":
|
|
3521
|
+
return (i) => numberToLetterSequence(i, "a");
|
|
3522
|
+
case "A":
|
|
3523
|
+
return (i) => numberToLetterSequence(i, "A");
|
|
3524
|
+
case "i":
|
|
3525
|
+
return (i) => numberToRoman(i).toLowerCase();
|
|
3526
|
+
case "I":
|
|
3527
|
+
return (i) => numberToRoman(i);
|
|
3528
|
+
default:
|
|
3529
|
+
return (i) => i.toString();
|
|
3530
|
+
}
|
|
3531
|
+
}
|
|
3532
|
+
function splitClassesAndIds(selectors) {
|
|
3533
|
+
let classes = [], ids = [];
|
|
3534
|
+
for (let selector of selectors)
|
|
3535
|
+
selector.startsWith(".") ? classes.push(selector.substring(1)) : selector.startsWith("#") && ids.push(selector.substring(1));
|
|
3536
|
+
return { classes, ids };
|
|
3537
|
+
}
|
|
3538
|
+
function isDataTable(attr, tables) {
|
|
3539
|
+
if (tables === !0)
|
|
3540
|
+
return !0;
|
|
3541
|
+
if (!attr)
|
|
3542
|
+
return !1;
|
|
3543
|
+
let { classes, ids } = splitClassesAndIds(tables), attrClasses = (attr.class || "").split(" "), attrIds = (attr.id || "").split(" ");
|
|
3544
|
+
return attrClasses.some((x) => classes.includes(x)) || attrIds.some((x) => ids.includes(x));
|
|
3545
|
+
}
|
|
3546
|
+
function formatTable(elem, walk, builder, formatOptions) {
|
|
3547
|
+
return isDataTable(elem.attribs, builder.options.tables) ? formatDataTable(elem, walk, builder, formatOptions) : formatBlock(elem, walk, builder, formatOptions);
|
|
3548
|
+
}
|
|
3549
|
+
function formatBlock(elem, walk, builder, formatOptions) {
|
|
3550
|
+
builder.openBlock({ leadingLineBreaks: formatOptions.leadingLineBreaks }), walk(elem.children, builder), builder.closeBlock({ trailingLineBreaks: formatOptions.trailingLineBreaks });
|
|
3551
|
+
}
|
|
3552
|
+
function formatDataTable(elem, walk, builder, formatOptions) {
|
|
3553
|
+
builder.openTable(), elem.children.forEach(walkTable), builder.closeTable({
|
|
3554
|
+
tableToString: (rows) => tableToString(rows, formatOptions.rowSpacing ?? 0, formatOptions.colSpacing ?? 3),
|
|
3555
|
+
leadingLineBreaks: formatOptions.leadingLineBreaks,
|
|
3556
|
+
trailingLineBreaks: formatOptions.trailingLineBreaks
|
|
3557
|
+
});
|
|
3558
|
+
function formatCell(cellNode) {
|
|
3559
|
+
let colspan = +get(cellNode, ["attribs", "colspan"]) || 1, rowspan = +get(cellNode, ["attribs", "rowspan"]) || 1;
|
|
3560
|
+
builder.openTableCell({ maxColumnWidth: formatOptions.maxColumnWidth }), walk(cellNode.children, builder), builder.closeTableCell({ colspan, rowspan });
|
|
3561
|
+
}
|
|
3562
|
+
function walkTable(elem2) {
|
|
3563
|
+
if (elem2.type !== "tag")
|
|
3564
|
+
return;
|
|
3565
|
+
let formatHeaderCell = formatOptions.uppercaseHeaderCells !== !1 ? (cellNode) => {
|
|
3566
|
+
builder.pushWordTransform((str) => str.toUpperCase()), formatCell(cellNode), builder.popWordTransform();
|
|
3567
|
+
} : formatCell;
|
|
3568
|
+
switch (elem2.name) {
|
|
3569
|
+
case "thead":
|
|
3570
|
+
case "tbody":
|
|
3571
|
+
case "tfoot":
|
|
3572
|
+
case "center":
|
|
3573
|
+
elem2.children.forEach(walkTable);
|
|
3574
|
+
return;
|
|
3575
|
+
case "tr": {
|
|
3576
|
+
builder.openTableRow();
|
|
3577
|
+
for (let childOfTr of elem2.children)
|
|
3578
|
+
if (childOfTr.type === "tag")
|
|
3579
|
+
switch (childOfTr.name) {
|
|
3580
|
+
case "th": {
|
|
3581
|
+
formatHeaderCell(childOfTr);
|
|
3582
|
+
break;
|
|
3583
|
+
}
|
|
3584
|
+
case "td": {
|
|
3585
|
+
formatCell(childOfTr);
|
|
3586
|
+
break;
|
|
3587
|
+
}
|
|
3588
|
+
}
|
|
3589
|
+
builder.closeTableRow();
|
|
3590
|
+
break;
|
|
3591
|
+
}
|
|
3592
|
+
}
|
|
3593
|
+
}
|
|
3594
|
+
}
|
|
3595
|
+
var textFormatters = /* @__PURE__ */ Object.freeze({
|
|
3596
|
+
__proto__: null,
|
|
3597
|
+
anchor: formatAnchor,
|
|
3598
|
+
blockquote: formatBlockquote,
|
|
3599
|
+
dataTable: formatDataTable,
|
|
3600
|
+
heading: formatHeading,
|
|
3601
|
+
horizontalLine: formatHorizontalLine,
|
|
3602
|
+
image: formatImage,
|
|
3603
|
+
lineBreak: formatLineBreak,
|
|
3604
|
+
orderedList: formatOrderedList,
|
|
3605
|
+
paragraph: formatParagraph,
|
|
3606
|
+
pre: formatPre,
|
|
3607
|
+
table: formatTable,
|
|
3608
|
+
unorderedList: formatUnorderedList,
|
|
3609
|
+
wbr: formatWbr
|
|
3610
|
+
}), DEFAULT_OPTIONS = {
|
|
3611
|
+
baseElements: {
|
|
3612
|
+
selectors: ["body"],
|
|
3613
|
+
orderBy: "selectors",
|
|
3614
|
+
// 'selectors' | 'occurrence'
|
|
3615
|
+
returnDomByDefault: !0
|
|
3616
|
+
},
|
|
3617
|
+
decodeEntities: !0,
|
|
3618
|
+
encodeCharacters: {},
|
|
3619
|
+
formatters: {},
|
|
3620
|
+
limits: {
|
|
3621
|
+
ellipsis: "...",
|
|
3622
|
+
maxBaseElements: void 0,
|
|
3623
|
+
maxChildNodes: void 0,
|
|
3624
|
+
maxDepth: void 0,
|
|
3625
|
+
maxInputLength: 1 << 24
|
|
3626
|
+
// 16_777_216
|
|
3627
|
+
},
|
|
3628
|
+
longWordSplit: {
|
|
3629
|
+
forceWrapOnLimit: !1,
|
|
3630
|
+
wrapCharacters: []
|
|
3631
|
+
},
|
|
3632
|
+
preserveNewlines: !1,
|
|
3633
|
+
selectors: [
|
|
3634
|
+
{ selector: "*", format: "inline" },
|
|
3635
|
+
{
|
|
3636
|
+
selector: "a",
|
|
3637
|
+
format: "anchor",
|
|
3638
|
+
options: {
|
|
3639
|
+
baseUrl: null,
|
|
3640
|
+
hideLinkHrefIfSameAsText: !1,
|
|
3641
|
+
ignoreHref: !1,
|
|
3642
|
+
linkBrackets: ["[", "]"],
|
|
3643
|
+
noAnchorUrl: !0
|
|
3644
|
+
}
|
|
3645
|
+
},
|
|
3646
|
+
{ selector: "article", format: "block", options: { leadingLineBreaks: 1, trailingLineBreaks: 1 } },
|
|
3647
|
+
{ selector: "aside", format: "block", options: { leadingLineBreaks: 1, trailingLineBreaks: 1 } },
|
|
3648
|
+
{
|
|
3649
|
+
selector: "blockquote",
|
|
3650
|
+
format: "blockquote",
|
|
3651
|
+
options: { leadingLineBreaks: 2, trailingLineBreaks: 2, trimEmptyLines: !0 }
|
|
3652
|
+
},
|
|
3653
|
+
{ selector: "br", format: "lineBreak" },
|
|
3654
|
+
{ selector: "div", format: "block", options: { leadingLineBreaks: 1, trailingLineBreaks: 1 } },
|
|
3655
|
+
{ selector: "footer", format: "block", options: { leadingLineBreaks: 1, trailingLineBreaks: 1 } },
|
|
3656
|
+
{ selector: "form", format: "block", options: { leadingLineBreaks: 1, trailingLineBreaks: 1 } },
|
|
3657
|
+
{ selector: "h1", format: "heading", options: { leadingLineBreaks: 3, trailingLineBreaks: 2, uppercase: !0 } },
|
|
3658
|
+
{ selector: "h2", format: "heading", options: { leadingLineBreaks: 3, trailingLineBreaks: 2, uppercase: !0 } },
|
|
3659
|
+
{ selector: "h3", format: "heading", options: { leadingLineBreaks: 3, trailingLineBreaks: 2, uppercase: !0 } },
|
|
3660
|
+
{ selector: "h4", format: "heading", options: { leadingLineBreaks: 2, trailingLineBreaks: 2, uppercase: !0 } },
|
|
3661
|
+
{ selector: "h5", format: "heading", options: { leadingLineBreaks: 2, trailingLineBreaks: 2, uppercase: !0 } },
|
|
3662
|
+
{ selector: "h6", format: "heading", options: { leadingLineBreaks: 2, trailingLineBreaks: 2, uppercase: !0 } },
|
|
3663
|
+
{ selector: "header", format: "block", options: { leadingLineBreaks: 1, trailingLineBreaks: 1 } },
|
|
3664
|
+
{
|
|
3665
|
+
selector: "hr",
|
|
3666
|
+
format: "horizontalLine",
|
|
3667
|
+
options: { leadingLineBreaks: 2, length: void 0, trailingLineBreaks: 2 }
|
|
3668
|
+
},
|
|
3669
|
+
{
|
|
3670
|
+
selector: "img",
|
|
3671
|
+
format: "image",
|
|
3672
|
+
options: { baseUrl: null, linkBrackets: ["[", "]"] }
|
|
3673
|
+
},
|
|
3674
|
+
{ selector: "main", format: "block", options: { leadingLineBreaks: 1, trailingLineBreaks: 1 } },
|
|
3675
|
+
{ selector: "nav", format: "block", options: { leadingLineBreaks: 1, trailingLineBreaks: 1 } },
|
|
3676
|
+
{
|
|
3677
|
+
selector: "ol",
|
|
3678
|
+
format: "orderedList",
|
|
3679
|
+
options: { leadingLineBreaks: 2, trailingLineBreaks: 2 }
|
|
3680
|
+
},
|
|
3681
|
+
{ selector: "p", format: "paragraph", options: { leadingLineBreaks: 2, trailingLineBreaks: 2 } },
|
|
3682
|
+
{ selector: "pre", format: "pre", options: { leadingLineBreaks: 2, trailingLineBreaks: 2 } },
|
|
3683
|
+
{ selector: "section", format: "block", options: { leadingLineBreaks: 1, trailingLineBreaks: 1 } },
|
|
3684
|
+
{
|
|
3685
|
+
selector: "table",
|
|
3686
|
+
format: "table",
|
|
3687
|
+
options: {
|
|
3688
|
+
colSpacing: 3,
|
|
3689
|
+
leadingLineBreaks: 2,
|
|
3690
|
+
maxColumnWidth: 60,
|
|
3691
|
+
rowSpacing: 0,
|
|
3692
|
+
trailingLineBreaks: 2,
|
|
3693
|
+
uppercaseHeaderCells: !0
|
|
3694
|
+
}
|
|
3695
|
+
},
|
|
3696
|
+
{
|
|
3697
|
+
selector: "ul",
|
|
3698
|
+
format: "unorderedList",
|
|
3699
|
+
options: { itemPrefix: " * ", leadingLineBreaks: 2, trailingLineBreaks: 2 }
|
|
3700
|
+
},
|
|
3701
|
+
{ selector: "wbr", format: "wbr" }
|
|
3702
|
+
],
|
|
3703
|
+
tables: [],
|
|
3704
|
+
// deprecated
|
|
3705
|
+
whitespaceCharacters: ` \r
|
|
3706
|
+
\f\u200B`,
|
|
3707
|
+
wordwrap: 80
|
|
3708
|
+
}, concatMerge = (acc, src, options) => [...acc, ...src], overwriteMerge = (acc, src, options) => [...src], selectorsMerge = (acc, src, options) => acc.some((s2) => typeof s2 == "object") ? concatMerge(acc, src) : overwriteMerge(acc, src);
|
|
3709
|
+
function compile(options = {}) {
|
|
3710
|
+
return options = (0, import_deepmerge.default)(
|
|
3711
|
+
DEFAULT_OPTIONS,
|
|
3712
|
+
options,
|
|
3713
|
+
{
|
|
3714
|
+
arrayMerge: overwriteMerge,
|
|
3715
|
+
customMerge: (key) => key === "selectors" ? selectorsMerge : void 0
|
|
3716
|
+
}
|
|
3717
|
+
), options.formatters = Object.assign({}, genericFormatters, textFormatters, options.formatters), options.selectors = mergeDuplicatesPreferLast(options.selectors, ((s2) => s2.selector)), handleDeprecatedOptions(options), compile$1(options);
|
|
3718
|
+
}
|
|
3719
|
+
function convert(html, options = {}, metadata = void 0) {
|
|
3720
|
+
return compile(options)(html, metadata);
|
|
3721
|
+
}
|
|
3722
|
+
function handleDeprecatedOptions(options) {
|
|
3723
|
+
if (options.tags) {
|
|
3724
|
+
let tagDefinitions = Object.entries(options.tags).map(
|
|
3725
|
+
([selector, definition]) => ({ ...definition, selector: selector || "*" })
|
|
3726
|
+
);
|
|
3727
|
+
options.selectors.push(...tagDefinitions), options.selectors = mergeDuplicatesPreferLast(options.selectors, ((s2) => s2.selector));
|
|
3728
|
+
}
|
|
3729
|
+
function set(obj, path, value) {
|
|
3730
|
+
let valueKey = path.pop();
|
|
3731
|
+
for (let key of path) {
|
|
3732
|
+
let nested = obj[key];
|
|
3733
|
+
nested || (nested = {}, obj[key] = nested), obj = nested;
|
|
3734
|
+
}
|
|
3735
|
+
obj[valueKey] = value;
|
|
3736
|
+
}
|
|
3737
|
+
if (options.baseElement) {
|
|
3738
|
+
let baseElement = options.baseElement;
|
|
3739
|
+
set(
|
|
3740
|
+
options,
|
|
3741
|
+
["baseElements", "selectors"],
|
|
3742
|
+
Array.isArray(baseElement) ? baseElement : [baseElement]
|
|
3743
|
+
);
|
|
3744
|
+
}
|
|
3745
|
+
options.returnDomByDefault !== void 0 && set(options, ["baseElements", "returnDomByDefault"], options.returnDomByDefault);
|
|
3746
|
+
for (let definition of options.selectors)
|
|
3747
|
+
definition.format === "anchor" && get(definition, ["options", "noLinkBrackets"]) && set(definition, ["options", "linkBrackets"], !1);
|
|
3748
|
+
}
|
|
3749
|
+
|
|
3750
|
+
// src/main/adapters/shared/html-content.ts
|
|
3751
|
+
var HTML_CONTENT_TYPE = "text/html";
|
|
3752
|
+
function htmlToPlainText(html) {
|
|
3753
|
+
return convert(html, {
|
|
3754
|
+
wordwrap: !1,
|
|
3755
|
+
selectors: [
|
|
3756
|
+
{ selector: "a", options: { hideLinkHrefIfSameAsText: !0 } },
|
|
3757
|
+
{ selector: "img", format: "skip" },
|
|
3758
|
+
// Chat output — headings shouldn't SHOUT
|
|
3759
|
+
...["h1", "h2", "h3", "h4", "h5", "h6"].map((selector) => ({ selector, options: { uppercase: !1 } }))
|
|
3760
|
+
]
|
|
3761
|
+
}).trim();
|
|
3762
|
+
}
|
|
3763
|
+
var TELEGRAM_ALLOWED_TAGS = /* @__PURE__ */ new Set([
|
|
3764
|
+
"b",
|
|
3765
|
+
"strong",
|
|
3766
|
+
"i",
|
|
3767
|
+
"em",
|
|
3768
|
+
"u",
|
|
3769
|
+
"ins",
|
|
3770
|
+
"s",
|
|
3771
|
+
"strike",
|
|
3772
|
+
"del",
|
|
3773
|
+
"code",
|
|
3774
|
+
"pre",
|
|
3775
|
+
"blockquote",
|
|
3776
|
+
"a",
|
|
3777
|
+
"tg-spoiler"
|
|
3778
|
+
]);
|
|
3779
|
+
function sanitizeTelegramHtml(html) {
|
|
3780
|
+
let out = html;
|
|
3781
|
+
return out = out.replace(/<(script|style|head)[^>]*>[\s\S]*?<\/\1\s*>/gi, ""), out = out.replace(/<\s*br\s*\/?\s*>/gi, `
|
|
3782
|
+
`), out = out.replace(/<\/\s*(p|div|section|article|tr|table|ul|ol)\s*>/gi, `
|
|
3783
|
+
`), out = out.replace(/<\s*h[1-6][^>]*>/gi, "<b>"), out = out.replace(/<\/\s*h[1-6]\s*>/gi, `</b>
|
|
3784
|
+
`), out = out.replace(/<\s*li[^>]*>/gi, "\u2022 "), out = out.replace(/<\/\s*li\s*>/gi, `
|
|
3785
|
+
`), out = out.replace(/<\/?\s*([a-zA-Z][a-zA-Z0-9-]*)((?:\s[^<>]*)?)\s*\/?>/g, (match, tag, attrs) => {
|
|
3786
|
+
let t2 = tag.toLowerCase();
|
|
3787
|
+
if (!TELEGRAM_ALLOWED_TAGS.has(t2)) return "";
|
|
3788
|
+
let closing = /^<\s*\//.test(match);
|
|
3789
|
+
if (t2 === "a") {
|
|
3790
|
+
if (closing) return "</a>";
|
|
3791
|
+
let href = /href\s*=\s*("([^"]*)"|'([^']*)')/i.exec(attrs), url = href?.[2] ?? href?.[3];
|
|
3792
|
+
return url ? `<a href="${url}">` : "";
|
|
3793
|
+
}
|
|
3794
|
+
return closing ? `</${t2}>` : `<${t2}>`;
|
|
3795
|
+
}), out = out.replace(/\n{3,}/g, `
|
|
3796
|
+
|
|
3797
|
+
`), out.trim();
|
|
3798
|
+
}
|
|
3799
|
+
|
|
3800
|
+
// src/main/adapters/form-render.ts
|
|
3801
|
+
var TypedContentError = class extends Error {
|
|
3802
|
+
};
|
|
3803
|
+
function parseFormJson(payload) {
|
|
3804
|
+
let json;
|
|
3805
|
+
try {
|
|
3806
|
+
json = JSON.parse(payload);
|
|
3807
|
+
} catch {
|
|
3808
|
+
throw new TypedContentError(`content_type is ${FORM_CONTENT_TYPE} but content is not valid JSON`);
|
|
3809
|
+
}
|
|
3810
|
+
let form = parseFormHint(json);
|
|
3811
|
+
if (!form)
|
|
3812
|
+
throw new TypedContentError(`content_type is ${FORM_CONTENT_TYPE} but content does not match the form schema (see msg_send's content_type parameter for the expected shape)`);
|
|
3813
|
+
return form;
|
|
3814
|
+
}
|
|
3815
|
+
function renderFormAsText(form) {
|
|
3816
|
+
if (form.fallback_text) return form.fallback_text;
|
|
3817
|
+
let lines = [];
|
|
3818
|
+
return form.title && lines.push(form.title, ""), form.questions.forEach((q, qi) => {
|
|
3819
|
+
lines.push(`${qi + 1}. ${q.text}`), q.options && q.options.forEach((opt, oi) => {
|
|
3820
|
+
lines.push(` ${String.fromCharCode(97 + oi)}) ${opt.label}`);
|
|
3821
|
+
});
|
|
3822
|
+
}), lines.push("", "Reply with your answer" + (form.questions.length > 1 ? 's (e.g. "1a, 2c")' : "")), lines.join(`
|
|
3823
|
+
`);
|
|
3824
|
+
}
|
|
3825
|
+
function resolveOutboundText(msg) {
|
|
3826
|
+
let form = msg.contentType === FORM_CONTENT_TYPE ? parseFormJson(msg.payload) : null, isHtml = msg.contentType === HTML_CONTENT_TYPE;
|
|
3827
|
+
return { text: form ? renderFormAsText(form) : isHtml ? htmlToPlainText(msg.payload) : msg.payload || "", isHtml };
|
|
3828
|
+
}
|
|
3829
|
+
|
|
3830
|
+
// src/main/adapters/shared/error-hints.ts
|
|
3831
|
+
function withSetupGuide(adapterType, message) {
|
|
3832
|
+
let url = findAdapterRegistryEntry(adapterType)?.docsUrl;
|
|
3833
|
+
return url ? `${message} Setup guide: ${url}` : message;
|
|
3834
|
+
}
|
|
3835
|
+
|
|
3836
|
+
// src/shared/types/channel-adapter.types.ts
|
|
3837
|
+
var CATCH_UP_DEFAULTS = {
|
|
3838
|
+
enabled: !0,
|
|
3839
|
+
max_age_hours: 24,
|
|
3840
|
+
max_messages: 200
|
|
3841
|
+
};
|
|
3842
|
+
function resolveCatchUpConfig(config) {
|
|
3843
|
+
let raw = config?.catch_up ?? {};
|
|
3844
|
+
return {
|
|
3845
|
+
enabled: typeof raw.enabled == "boolean" ? raw.enabled : CATCH_UP_DEFAULTS.enabled,
|
|
3846
|
+
max_age_hours: typeof raw.max_age_hours == "number" && raw.max_age_hours > 0 ? raw.max_age_hours : CATCH_UP_DEFAULTS.max_age_hours,
|
|
3847
|
+
max_messages: typeof raw.max_messages == "number" && raw.max_messages > 0 ? raw.max_messages : CATCH_UP_DEFAULTS.max_messages
|
|
3848
|
+
};
|
|
3849
|
+
}
|
|
3850
|
+
|
|
3851
|
+
export {
|
|
3852
|
+
buildGroupMeta,
|
|
3853
|
+
GroupMetaCache,
|
|
3854
|
+
convert,
|
|
3855
|
+
HTML_CONTENT_TYPE,
|
|
3856
|
+
htmlToPlainText,
|
|
3857
|
+
sanitizeTelegramHtml,
|
|
3858
|
+
TypedContentError,
|
|
3859
|
+
parseFormJson,
|
|
3860
|
+
renderFormAsText,
|
|
3861
|
+
resolveOutboundText,
|
|
3862
|
+
withSetupGuide,
|
|
3863
|
+
resolveCatchUpConfig
|
|
3864
|
+
};
|