@docen/docx 0.3.1 → 0.3.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/dist/converters/docx.d.mts +199 -1
- package/dist/converters/docx.mjs +1273 -1
- package/dist/converters/html.d.mts +28 -1
- package/dist/converters/html.mjs +103 -1
- package/dist/converters/markdown.d.mts +12 -1
- package/dist/converters/markdown.mjs +17 -1
- package/dist/converters/patch.d.mts +52 -1
- package/dist/converters/patch.mjs +35 -1
- package/dist/converters/prepare.d.mts +62 -1
- package/dist/converters/prepare.mjs +121 -1
- package/dist/converters/styles.d.mts +84 -1
- package/dist/converters/styles.mjs +284 -1
- package/dist/core-C9VunJ8o.d.mts +174 -0
- package/dist/core-DT9IrTzN.mjs +670 -0
- package/dist/core.d.mts +1 -1
- package/dist/core.mjs +1 -1
- package/dist/editor.d.mts +20 -1
- package/dist/editor.mjs +20 -1
- package/dist/extensions/blockquote.d.mts +1 -1
- package/dist/extensions/blockquote.mjs +30 -2
- package/dist/extensions/code-block.d.mts +1 -1
- package/dist/extensions/code-block.mjs +22 -1
- package/dist/extensions/column-break.d.mts +1 -1
- package/dist/extensions/column-break.mjs +1 -1
- package/dist/extensions/details.d.mts +1 -1
- package/dist/extensions/details.mjs +17 -2
- package/dist/extensions/document.mjs +49 -1
- package/dist/extensions/extensions.d.mts +3 -4
- package/dist/extensions/extensions.mjs +13 -14
- package/dist/extensions/formatting-marks.d.mts +7 -1
- package/dist/extensions/formatting-marks.mjs +1 -1
- package/dist/extensions/heading.mjs +165 -1
- package/dist/extensions/image.d.mts +1 -1
- package/dist/extensions/image.mjs +395 -1
- package/dist/extensions/index.d.mts +3 -2
- package/dist/extensions/index.mjs +4 -3
- package/dist/extensions/mention.d.mts +1 -1
- package/dist/extensions/mention.mjs +43 -2
- package/dist/extensions/ordered-list.d.mts +1 -1
- package/dist/extensions/ordered-list.mjs +40 -2
- package/dist/extensions/page-break.d.mts +1 -33
- package/dist/extensions/page-break.mjs +1 -1
- package/dist/extensions/paragraph.mjs +150 -1
- package/dist/extensions/passthrough.d.mts +1 -1
- package/dist/extensions/passthrough.mjs +1 -1
- package/dist/extensions/section-break.d.mts +19 -2
- package/dist/extensions/section-break.mjs +1 -1
- package/dist/extensions/strike.mjs +49 -1
- package/dist/extensions/table-cell.mjs +111 -1
- package/dist/extensions/table-header.mjs +111 -1
- package/dist/extensions/table-row.mjs +83 -1
- package/dist/extensions/table.mjs +159 -1
- package/dist/extensions/task-item.d.mts +1 -1
- package/dist/extensions/task-item.mjs +36 -2
- package/dist/extensions/text-style.mjs +150 -1
- package/dist/extensions/tiptap.d.mts +2 -2
- package/dist/extensions/tiptap.mjs +31 -2
- package/dist/extensions/utils.d.mts +2 -62
- package/dist/extensions/utils.mjs +499 -2
- package/dist/extensions/wpg-group.d.mts +2 -0
- package/dist/extensions/wpg-group.mjs +2 -0
- package/dist/extensions/wps-shape.d.mts +2 -0
- package/dist/extensions/wps-shape.mjs +2 -0
- package/dist/index.d.mts +86 -27
- package/dist/index.mjs +13 -10
- package/dist/{tiptap-TErPjuNJ.d.mts → tiptap-pZsNPsvV.d.mts} +1 -3
- package/dist/utils-D87vukzp.d.mts +128 -0
- package/package.json +39 -40
- package/dist/blockquote-Ky9xD_Q-.mjs +0 -31
- package/dist/code-block-BgNjhADy.mjs +0 -23
- package/dist/core-DEqBHRzE.mjs +0 -406
- package/dist/core-fBMCCj4D.d.mts +0 -97
- package/dist/details-Dh8luWb2.mjs +0 -18
- package/dist/dist-B6B3HnVZ.mjs +0 -1838
- package/dist/document-CvTym-FM.mjs +0 -50
- package/dist/docx-C5wyjI-0.d.mts +0 -200
- package/dist/docx-CONyAedl.mjs +0 -1231
- package/dist/editor-Bf3CxQnY.mjs +0 -21
- package/dist/editor-DReY3Rb9.d.mts +0 -21
- package/dist/emoji-BZ1dJD7d.d.mts +0 -17
- package/dist/emoji-C2OsTWR7.mjs +0 -27
- package/dist/extensions/emoji.d.mts +0 -2
- package/dist/extensions/emoji.mjs +0 -2
- package/dist/extensions/image-group.d.mts +0 -6
- package/dist/extensions/image-group.mjs +0 -2
- package/dist/heading-DAubgJJN.mjs +0 -166
- package/dist/html-DCC_DSHv.d.mts +0 -18
- package/dist/html-DedDWPoO.mjs +0 -66
- package/dist/image-CuEIXoZl.mjs +0 -334
- package/dist/markdown-BzJmRsBs.mjs +0 -18
- package/dist/markdown-D0k0sRYS.d.mts +0 -13
- package/dist/mention-C-dTR6MK.mjs +0 -44
- package/dist/ordered-list-V-3xFQmV.mjs +0 -41
- package/dist/paragraph-BrWH-BOV.mjs +0 -147
- package/dist/patch-Cdp5WKJz.d.mts +0 -53
- package/dist/patch-IZ13tXTu.mjs +0 -36
- package/dist/prepare-Bdk8Cjkf.mjs +0 -122
- package/dist/prepare-CPAvcv6q.d.mts +0 -63
- package/dist/strike-hWxShOgb.mjs +0 -50
- package/dist/styles-QSX3RhxK.mjs +0 -285
- package/dist/styles-ugspkrxz.d.mts +0 -85
- package/dist/table-DrA12lxX.mjs +0 -159
- package/dist/table-cell-DmkfYwDc.mjs +0 -112
- package/dist/table-header-Bwr5GKWg.mjs +0 -112
- package/dist/table-row-vew1y7WH.mjs +0 -84
- package/dist/task-item-BnlXGrIG.mjs +0 -37
- package/dist/text-style-tMeBq5XQ.mjs +0 -151
- package/dist/tiptap-D7pl4I5U.mjs +0 -33
- package/dist/utils-BPT4tjcn.mjs +0 -333
package/dist/dist-B6B3HnVZ.mjs
DELETED
|
@@ -1,1838 +0,0 @@
|
|
|
1
|
-
Object.freeze({ _attr: Object.freeze({
|
|
2
|
-
"xmlns:cp": "http://schemas.openxmlformats.org/package/2006/metadata/core-properties",
|
|
3
|
-
"xmlns:dc": "http://purl.org/dc/elements/1.1/",
|
|
4
|
-
"xmlns:dcmitype": "http://purl.org/dcmitype/",
|
|
5
|
-
"xmlns:dcterms": "http://purl.org/dc/terms/",
|
|
6
|
-
"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance"
|
|
7
|
-
}) });
|
|
8
|
-
Object.freeze({ _attr: Object.freeze({ "xsi:type": "dcterms:W3CDTF" }) });
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region ../../node_modules/.pnpm/@office-open+core@0.10.0/node_modules/@office-open/core/dist/theme-CiNzdl-9.mjs
|
|
11
|
-
/** Office 2016+ default theme colors (hex without #). */
|
|
12
|
-
const DEFAULT_COLORS = {
|
|
13
|
-
dark1: "000000",
|
|
14
|
-
light1: "FFFFFF",
|
|
15
|
-
dark2: "44546A",
|
|
16
|
-
light2: "E7E6E6",
|
|
17
|
-
accent1: "4472C4",
|
|
18
|
-
accent2: "ED7D31",
|
|
19
|
-
accent3: "A5A5A5",
|
|
20
|
-
accent4: "FFC000",
|
|
21
|
-
accent5: "5B9BD5",
|
|
22
|
-
accent6: "70AD47",
|
|
23
|
-
hyperlink: "0563C1",
|
|
24
|
-
followedHyperlink: "954F72"
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Build theme XML string — pure function, no side effects.
|
|
28
|
-
*
|
|
29
|
-
* fmtScheme uses the complete Office version (gradFill, outerShdw, bgFillStyleLst)
|
|
30
|
-
* matching what Excel generates.
|
|
31
|
-
*
|
|
32
|
-
* @module
|
|
33
|
-
*/
|
|
34
|
-
function buildThemeXml(options) {
|
|
35
|
-
const name = options?.name ?? "Office Theme";
|
|
36
|
-
const c = {
|
|
37
|
-
...DEFAULT_COLORS,
|
|
38
|
-
...options?.colors
|
|
39
|
-
};
|
|
40
|
-
const f = options?.fonts;
|
|
41
|
-
const majorFont = f?.majorFont ?? "Calibri Light";
|
|
42
|
-
const minorFont = f?.minorFont ?? "Calibri";
|
|
43
|
-
const majorFontAsian = f?.majorFontAsian ?? "";
|
|
44
|
-
const minorFontAsian = f?.minorFontAsian ?? "";
|
|
45
|
-
return `<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="${name}"><a:themeElements><a:clrScheme name="${name}"><a:dk1>${options?.colors?.dark1 !== void 0 ? `<a:srgbClr val="${c.dark1}"/>` : `<a:sysClr val="windowText" lastClr="000000"/>`}</a:dk1><a:lt1>${options?.colors?.light1 !== void 0 ? `<a:srgbClr val="${c.light1}"/>` : `<a:sysClr val="window" lastClr="FFFFFF"/>`}</a:lt1><a:dk2><a:srgbClr val="${c.dark2}"/></a:dk2><a:lt2><a:srgbClr val="${c.light2}"/></a:lt2><a:accent1><a:srgbClr val="${c.accent1}"/></a:accent1><a:accent2><a:srgbClr val="${c.accent2}"/></a:accent2><a:accent3><a:srgbClr val="${c.accent3}"/></a:accent3><a:accent4><a:srgbClr val="${c.accent4}"/></a:accent4><a:accent5><a:srgbClr val="${c.accent5}"/></a:accent5><a:accent6><a:srgbClr val="${c.accent6}"/></a:accent6><a:hlink><a:srgbClr val="${c.hyperlink}"/></a:hlink><a:folHlink><a:srgbClr val="${c.followedHyperlink}"/></a:folHlink></a:clrScheme><a:fontScheme name="${name}"><a:majorFont><a:latin typeface="${majorFont}" panose="020F0302020204030204"/><a:ea typeface="${majorFontAsian}"/><a:cs typeface=""/></a:majorFont><a:minorFont><a:latin typeface="${minorFont}" panose="020F0502020204030204"/><a:ea typeface="${minorFontAsian}"/><a:cs typeface=""/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:lumMod val="110000"/><a:satMod val="105000"/><a:tint val="67000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="103000"/><a:tint val="73000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="109000"/><a:tint val="81000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:lumMod val="102000"/><a:satMod val="103000"/><a:tint val="94000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:lumMod val="100000"/><a:satMod val="110000"/><a:shade val="100000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="99000"/><a:satMod val="120000"/><a:shade val="78000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w="6350" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="12700" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="19050" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="57150" dist="19050" dir="5400000" algn="ctr" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="63000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"><a:tint val="95000"/><a:satMod val="170000"/></a:schemeClr></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:lumMod val="102000"/><a:satMod val="150000"/><a:tint val="93000"/><a:shade val="98000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:lumMod val="103000"/><a:satMod val="130000"/><a:tint val="98000"/><a:shade val="90000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:satMod val="120000"/><a:shade val="63000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults/><a:extraClrSchemeLst/></a:theme>`;
|
|
46
|
-
}
|
|
47
|
-
buildThemeXml();
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region ../../node_modules/.pnpm/@office-open+core@0.10.0/node_modules/@office-open/core/dist/src-CXdJt0WZ.mjs
|
|
50
|
-
var _polyfill_node_global_default = typeof _polyfill_node_global_default !== "undefined" ? _polyfill_node_global_default : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
|
|
51
|
-
var lookup = [];
|
|
52
|
-
var revLookup = [];
|
|
53
|
-
var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
|
|
54
|
-
var inited = false;
|
|
55
|
-
function init() {
|
|
56
|
-
inited = true;
|
|
57
|
-
var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
58
|
-
for (var i = 0, len = code.length; i < len; ++i) {
|
|
59
|
-
lookup[i] = code[i];
|
|
60
|
-
revLookup[code.charCodeAt(i)] = i;
|
|
61
|
-
}
|
|
62
|
-
revLookup["-".charCodeAt(0)] = 62;
|
|
63
|
-
revLookup["_".charCodeAt(0)] = 63;
|
|
64
|
-
}
|
|
65
|
-
function toByteArray(b64) {
|
|
66
|
-
if (!inited) init();
|
|
67
|
-
var i, j, l, tmp, placeHolders, arr;
|
|
68
|
-
var len = b64.length;
|
|
69
|
-
if (len % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
|
|
70
|
-
placeHolders = b64[len - 2] === "=" ? 2 : b64[len - 1] === "=" ? 1 : 0;
|
|
71
|
-
arr = new Arr(len * 3 / 4 - placeHolders);
|
|
72
|
-
l = placeHolders > 0 ? len - 4 : len;
|
|
73
|
-
var L = 0;
|
|
74
|
-
for (i = 0, j = 0; i < l; i += 4, j += 3) {
|
|
75
|
-
tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
|
|
76
|
-
arr[L++] = tmp >> 16 & 255;
|
|
77
|
-
arr[L++] = tmp >> 8 & 255;
|
|
78
|
-
arr[L++] = tmp & 255;
|
|
79
|
-
}
|
|
80
|
-
if (placeHolders === 2) {
|
|
81
|
-
tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
|
|
82
|
-
arr[L++] = tmp & 255;
|
|
83
|
-
} else if (placeHolders === 1) {
|
|
84
|
-
tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
|
|
85
|
-
arr[L++] = tmp >> 8 & 255;
|
|
86
|
-
arr[L++] = tmp & 255;
|
|
87
|
-
}
|
|
88
|
-
return arr;
|
|
89
|
-
}
|
|
90
|
-
function tripletToBase64(num) {
|
|
91
|
-
return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];
|
|
92
|
-
}
|
|
93
|
-
function encodeChunk(uint8, start, end) {
|
|
94
|
-
var tmp;
|
|
95
|
-
var output = [];
|
|
96
|
-
for (var i = start; i < end; i += 3) {
|
|
97
|
-
tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + uint8[i + 2];
|
|
98
|
-
output.push(tripletToBase64(tmp));
|
|
99
|
-
}
|
|
100
|
-
return output.join("");
|
|
101
|
-
}
|
|
102
|
-
function fromByteArray(uint8) {
|
|
103
|
-
if (!inited) init();
|
|
104
|
-
var tmp;
|
|
105
|
-
var len = uint8.length;
|
|
106
|
-
var extraBytes = len % 3;
|
|
107
|
-
var output = "";
|
|
108
|
-
var parts = [];
|
|
109
|
-
var maxChunkLength = 16383;
|
|
110
|
-
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
|
|
111
|
-
if (extraBytes === 1) {
|
|
112
|
-
tmp = uint8[len - 1];
|
|
113
|
-
output += lookup[tmp >> 2];
|
|
114
|
-
output += lookup[tmp << 4 & 63];
|
|
115
|
-
output += "==";
|
|
116
|
-
} else if (extraBytes === 2) {
|
|
117
|
-
tmp = (uint8[len - 2] << 8) + uint8[len - 1];
|
|
118
|
-
output += lookup[tmp >> 10];
|
|
119
|
-
output += lookup[tmp >> 4 & 63];
|
|
120
|
-
output += lookup[tmp << 2 & 63];
|
|
121
|
-
output += "=";
|
|
122
|
-
}
|
|
123
|
-
parts.push(output);
|
|
124
|
-
return parts.join("");
|
|
125
|
-
}
|
|
126
|
-
function read(buffer, offset, isLE, mLen, nBytes) {
|
|
127
|
-
var e, m;
|
|
128
|
-
var eLen = nBytes * 8 - mLen - 1;
|
|
129
|
-
var eMax = (1 << eLen) - 1;
|
|
130
|
-
var eBias = eMax >> 1;
|
|
131
|
-
var nBits = -7;
|
|
132
|
-
var i = isLE ? nBytes - 1 : 0;
|
|
133
|
-
var d = isLE ? -1 : 1;
|
|
134
|
-
var s = buffer[offset + i];
|
|
135
|
-
i += d;
|
|
136
|
-
e = s & (1 << -nBits) - 1;
|
|
137
|
-
s >>= -nBits;
|
|
138
|
-
nBits += eLen;
|
|
139
|
-
for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);
|
|
140
|
-
m = e & (1 << -nBits) - 1;
|
|
141
|
-
e >>= -nBits;
|
|
142
|
-
nBits += mLen;
|
|
143
|
-
for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);
|
|
144
|
-
if (e === 0) e = 1 - eBias;
|
|
145
|
-
else if (e === eMax) return m ? NaN : (s ? -1 : 1) * Infinity;
|
|
146
|
-
else {
|
|
147
|
-
m = m + Math.pow(2, mLen);
|
|
148
|
-
e = e - eBias;
|
|
149
|
-
}
|
|
150
|
-
return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
|
|
151
|
-
}
|
|
152
|
-
function write(buffer, value, offset, isLE, mLen, nBytes) {
|
|
153
|
-
var e, m, c;
|
|
154
|
-
var eLen = nBytes * 8 - mLen - 1;
|
|
155
|
-
var eMax = (1 << eLen) - 1;
|
|
156
|
-
var eBias = eMax >> 1;
|
|
157
|
-
var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
|
|
158
|
-
var i = isLE ? 0 : nBytes - 1;
|
|
159
|
-
var d = isLE ? 1 : -1;
|
|
160
|
-
var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
|
|
161
|
-
value = Math.abs(value);
|
|
162
|
-
if (isNaN(value) || value === Infinity) {
|
|
163
|
-
m = isNaN(value) ? 1 : 0;
|
|
164
|
-
e = eMax;
|
|
165
|
-
} else {
|
|
166
|
-
e = Math.floor(Math.log(value) / Math.LN2);
|
|
167
|
-
if (value * (c = Math.pow(2, -e)) < 1) {
|
|
168
|
-
e--;
|
|
169
|
-
c *= 2;
|
|
170
|
-
}
|
|
171
|
-
if (e + eBias >= 1) value += rt / c;
|
|
172
|
-
else value += rt * Math.pow(2, 1 - eBias);
|
|
173
|
-
if (value * c >= 2) {
|
|
174
|
-
e++;
|
|
175
|
-
c /= 2;
|
|
176
|
-
}
|
|
177
|
-
if (e + eBias >= eMax) {
|
|
178
|
-
m = 0;
|
|
179
|
-
e = eMax;
|
|
180
|
-
} else if (e + eBias >= 1) {
|
|
181
|
-
m = (value * c - 1) * Math.pow(2, mLen);
|
|
182
|
-
e = e + eBias;
|
|
183
|
-
} else {
|
|
184
|
-
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
|
|
185
|
-
e = 0;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8);
|
|
189
|
-
e = e << mLen | m;
|
|
190
|
-
eLen += mLen;
|
|
191
|
-
for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8);
|
|
192
|
-
buffer[offset + i - d] |= s * 128;
|
|
193
|
-
}
|
|
194
|
-
var toString = {}.toString;
|
|
195
|
-
var isArray = Array.isArray || function(arr) {
|
|
196
|
-
return toString.call(arr) == "[object Array]";
|
|
197
|
-
};
|
|
198
|
-
/*!
|
|
199
|
-
* The buffer module from node.js, for the browser.
|
|
200
|
-
*
|
|
201
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
202
|
-
* @license MIT
|
|
203
|
-
*/
|
|
204
|
-
/**
|
|
205
|
-
* If `Buffer.TYPED_ARRAY_SUPPORT`:
|
|
206
|
-
* === true Use Uint8Array implementation (fastest)
|
|
207
|
-
* === false Use Object implementation (most compatible, even IE6)
|
|
208
|
-
*
|
|
209
|
-
* Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
|
|
210
|
-
* Opera 11.6+, iOS 4.2+.
|
|
211
|
-
*
|
|
212
|
-
* Due to various browser bugs, sometimes the Object implementation will be used even
|
|
213
|
-
* when the browser supports typed arrays.
|
|
214
|
-
*
|
|
215
|
-
* Note:
|
|
216
|
-
*
|
|
217
|
-
* - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
|
|
218
|
-
* See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
|
|
219
|
-
*
|
|
220
|
-
* - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
|
|
221
|
-
*
|
|
222
|
-
* - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
|
|
223
|
-
* incorrect length in some situations.
|
|
224
|
-
|
|
225
|
-
* We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
|
|
226
|
-
* get the Object implementation, which is slower but behaves correctly.
|
|
227
|
-
*/
|
|
228
|
-
Buffer.TYPED_ARRAY_SUPPORT = _polyfill_node_global_default.TYPED_ARRAY_SUPPORT !== void 0 ? _polyfill_node_global_default.TYPED_ARRAY_SUPPORT : true;
|
|
229
|
-
kMaxLength();
|
|
230
|
-
function kMaxLength() {
|
|
231
|
-
return Buffer.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
|
|
232
|
-
}
|
|
233
|
-
function createBuffer(that, length) {
|
|
234
|
-
if (kMaxLength() < length) throw new RangeError("Invalid typed array length");
|
|
235
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
236
|
-
that = new Uint8Array(length);
|
|
237
|
-
that.__proto__ = Buffer.prototype;
|
|
238
|
-
} else {
|
|
239
|
-
if (that === null) that = new Buffer(length);
|
|
240
|
-
that.length = length;
|
|
241
|
-
}
|
|
242
|
-
return that;
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* The Buffer constructor returns instances of `Uint8Array` that have their
|
|
246
|
-
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
|
|
247
|
-
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
|
|
248
|
-
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
|
|
249
|
-
* returns a single octet.
|
|
250
|
-
*
|
|
251
|
-
* The `Uint8Array` prototype remains unmodified.
|
|
252
|
-
*/
|
|
253
|
-
function Buffer(arg, encodingOrOffset, length) {
|
|
254
|
-
if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) return new Buffer(arg, encodingOrOffset, length);
|
|
255
|
-
if (typeof arg === "number") {
|
|
256
|
-
if (typeof encodingOrOffset === "string") throw new Error("If encoding is specified then the first argument must be a string");
|
|
257
|
-
return allocUnsafe(this, arg);
|
|
258
|
-
}
|
|
259
|
-
return from(this, arg, encodingOrOffset, length);
|
|
260
|
-
}
|
|
261
|
-
Buffer.poolSize = 8192;
|
|
262
|
-
Buffer._augment = function(arr) {
|
|
263
|
-
arr.__proto__ = Buffer.prototype;
|
|
264
|
-
return arr;
|
|
265
|
-
};
|
|
266
|
-
function from(that, value, encodingOrOffset, length) {
|
|
267
|
-
if (typeof value === "number") throw new TypeError("\"value\" argument must not be a number");
|
|
268
|
-
if (typeof ArrayBuffer !== "undefined" && value instanceof ArrayBuffer) return fromArrayBuffer(that, value, encodingOrOffset, length);
|
|
269
|
-
if (typeof value === "string") return fromString(that, value, encodingOrOffset);
|
|
270
|
-
return fromObject(that, value);
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
|
|
274
|
-
* if value is a number.
|
|
275
|
-
* Buffer.from(str[, encoding])
|
|
276
|
-
* Buffer.from(array)
|
|
277
|
-
* Buffer.from(buffer)
|
|
278
|
-
* Buffer.from(arrayBuffer[, byteOffset[, length]])
|
|
279
|
-
**/
|
|
280
|
-
Buffer.from = function(value, encodingOrOffset, length) {
|
|
281
|
-
return from(null, value, encodingOrOffset, length);
|
|
282
|
-
};
|
|
283
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
284
|
-
Buffer.prototype.__proto__ = Uint8Array.prototype;
|
|
285
|
-
Buffer.__proto__ = Uint8Array;
|
|
286
|
-
if (typeof Symbol !== "undefined" && Symbol.species && Buffer[Symbol.species] === Buffer);
|
|
287
|
-
}
|
|
288
|
-
function assertSize(size) {
|
|
289
|
-
if (typeof size !== "number") throw new TypeError("\"size\" argument must be a number");
|
|
290
|
-
else if (size < 0) throw new RangeError("\"size\" argument must not be negative");
|
|
291
|
-
}
|
|
292
|
-
function alloc(that, size, fill, encoding) {
|
|
293
|
-
assertSize(size);
|
|
294
|
-
if (size <= 0) return createBuffer(that, size);
|
|
295
|
-
if (fill !== void 0) return typeof encoding === "string" ? createBuffer(that, size).fill(fill, encoding) : createBuffer(that, size).fill(fill);
|
|
296
|
-
return createBuffer(that, size);
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* Creates a new filled Buffer instance.
|
|
300
|
-
* alloc(size[, fill[, encoding]])
|
|
301
|
-
**/
|
|
302
|
-
Buffer.alloc = function(size, fill, encoding) {
|
|
303
|
-
return alloc(null, size, fill, encoding);
|
|
304
|
-
};
|
|
305
|
-
function allocUnsafe(that, size) {
|
|
306
|
-
assertSize(size);
|
|
307
|
-
that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);
|
|
308
|
-
if (!Buffer.TYPED_ARRAY_SUPPORT) for (var i = 0; i < size; ++i) that[i] = 0;
|
|
309
|
-
return that;
|
|
310
|
-
}
|
|
311
|
-
/**
|
|
312
|
-
* Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
|
|
313
|
-
* */
|
|
314
|
-
Buffer.allocUnsafe = function(size) {
|
|
315
|
-
return allocUnsafe(null, size);
|
|
316
|
-
};
|
|
317
|
-
/**
|
|
318
|
-
* Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
|
|
319
|
-
*/
|
|
320
|
-
Buffer.allocUnsafeSlow = function(size) {
|
|
321
|
-
return allocUnsafe(null, size);
|
|
322
|
-
};
|
|
323
|
-
function fromString(that, string, encoding) {
|
|
324
|
-
if (typeof encoding !== "string" || encoding === "") encoding = "utf8";
|
|
325
|
-
if (!Buffer.isEncoding(encoding)) throw new TypeError("\"encoding\" must be a valid string encoding");
|
|
326
|
-
var length = byteLength(string, encoding) | 0;
|
|
327
|
-
that = createBuffer(that, length);
|
|
328
|
-
var actual = that.write(string, encoding);
|
|
329
|
-
if (actual !== length) that = that.slice(0, actual);
|
|
330
|
-
return that;
|
|
331
|
-
}
|
|
332
|
-
function fromArrayLike(that, array) {
|
|
333
|
-
var length = array.length < 0 ? 0 : checked(array.length) | 0;
|
|
334
|
-
that = createBuffer(that, length);
|
|
335
|
-
for (var i = 0; i < length; i += 1) that[i] = array[i] & 255;
|
|
336
|
-
return that;
|
|
337
|
-
}
|
|
338
|
-
function fromArrayBuffer(that, array, byteOffset, length) {
|
|
339
|
-
array.byteLength;
|
|
340
|
-
if (byteOffset < 0 || array.byteLength < byteOffset) throw new RangeError("'offset' is out of bounds");
|
|
341
|
-
if (array.byteLength < byteOffset + (length || 0)) throw new RangeError("'length' is out of bounds");
|
|
342
|
-
if (byteOffset === void 0 && length === void 0) array = new Uint8Array(array);
|
|
343
|
-
else if (length === void 0) array = new Uint8Array(array, byteOffset);
|
|
344
|
-
else array = new Uint8Array(array, byteOffset, length);
|
|
345
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
346
|
-
that = array;
|
|
347
|
-
that.__proto__ = Buffer.prototype;
|
|
348
|
-
} else that = fromArrayLike(that, array);
|
|
349
|
-
return that;
|
|
350
|
-
}
|
|
351
|
-
function fromObject(that, obj) {
|
|
352
|
-
if (internalIsBuffer(obj)) {
|
|
353
|
-
var len = checked(obj.length) | 0;
|
|
354
|
-
that = createBuffer(that, len);
|
|
355
|
-
if (that.length === 0) return that;
|
|
356
|
-
obj.copy(that, 0, 0, len);
|
|
357
|
-
return that;
|
|
358
|
-
}
|
|
359
|
-
if (obj) {
|
|
360
|
-
if (typeof ArrayBuffer !== "undefined" && obj.buffer instanceof ArrayBuffer || "length" in obj) {
|
|
361
|
-
if (typeof obj.length !== "number" || isnan(obj.length)) return createBuffer(that, 0);
|
|
362
|
-
return fromArrayLike(that, obj);
|
|
363
|
-
}
|
|
364
|
-
if (obj.type === "Buffer" && isArray(obj.data)) return fromArrayLike(that, obj.data);
|
|
365
|
-
}
|
|
366
|
-
throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");
|
|
367
|
-
}
|
|
368
|
-
function checked(length) {
|
|
369
|
-
if (length >= kMaxLength()) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + kMaxLength().toString(16) + " bytes");
|
|
370
|
-
return length | 0;
|
|
371
|
-
}
|
|
372
|
-
Buffer.isBuffer = isBuffer;
|
|
373
|
-
function internalIsBuffer(b) {
|
|
374
|
-
return !!(b != null && b._isBuffer);
|
|
375
|
-
}
|
|
376
|
-
Buffer.compare = function compare(a, b) {
|
|
377
|
-
if (!internalIsBuffer(a) || !internalIsBuffer(b)) throw new TypeError("Arguments must be Buffers");
|
|
378
|
-
if (a === b) return 0;
|
|
379
|
-
var x = a.length;
|
|
380
|
-
var y = b.length;
|
|
381
|
-
for (var i = 0, len = Math.min(x, y); i < len; ++i) if (a[i] !== b[i]) {
|
|
382
|
-
x = a[i];
|
|
383
|
-
y = b[i];
|
|
384
|
-
break;
|
|
385
|
-
}
|
|
386
|
-
if (x < y) return -1;
|
|
387
|
-
if (y < x) return 1;
|
|
388
|
-
return 0;
|
|
389
|
-
};
|
|
390
|
-
Buffer.isEncoding = function isEncoding(encoding) {
|
|
391
|
-
switch (String(encoding).toLowerCase()) {
|
|
392
|
-
case "hex":
|
|
393
|
-
case "utf8":
|
|
394
|
-
case "utf-8":
|
|
395
|
-
case "ascii":
|
|
396
|
-
case "latin1":
|
|
397
|
-
case "binary":
|
|
398
|
-
case "base64":
|
|
399
|
-
case "ucs2":
|
|
400
|
-
case "ucs-2":
|
|
401
|
-
case "utf16le":
|
|
402
|
-
case "utf-16le": return true;
|
|
403
|
-
default: return false;
|
|
404
|
-
}
|
|
405
|
-
};
|
|
406
|
-
Buffer.concat = function concat(list, length) {
|
|
407
|
-
if (!isArray(list)) throw new TypeError("\"list\" argument must be an Array of Buffers");
|
|
408
|
-
if (list.length === 0) return Buffer.alloc(0);
|
|
409
|
-
var i;
|
|
410
|
-
if (length === void 0) {
|
|
411
|
-
length = 0;
|
|
412
|
-
for (i = 0; i < list.length; ++i) length += list[i].length;
|
|
413
|
-
}
|
|
414
|
-
var buffer = Buffer.allocUnsafe(length);
|
|
415
|
-
var pos = 0;
|
|
416
|
-
for (i = 0; i < list.length; ++i) {
|
|
417
|
-
var buf = list[i];
|
|
418
|
-
if (!internalIsBuffer(buf)) throw new TypeError("\"list\" argument must be an Array of Buffers");
|
|
419
|
-
buf.copy(buffer, pos);
|
|
420
|
-
pos += buf.length;
|
|
421
|
-
}
|
|
422
|
-
return buffer;
|
|
423
|
-
};
|
|
424
|
-
function byteLength(string, encoding) {
|
|
425
|
-
if (internalIsBuffer(string)) return string.length;
|
|
426
|
-
if (typeof ArrayBuffer !== "undefined" && typeof ArrayBuffer.isView === "function" && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) return string.byteLength;
|
|
427
|
-
if (typeof string !== "string") string = "" + string;
|
|
428
|
-
var len = string.length;
|
|
429
|
-
if (len === 0) return 0;
|
|
430
|
-
var loweredCase = false;
|
|
431
|
-
for (;;) switch (encoding) {
|
|
432
|
-
case "ascii":
|
|
433
|
-
case "latin1":
|
|
434
|
-
case "binary": return len;
|
|
435
|
-
case "utf8":
|
|
436
|
-
case "utf-8":
|
|
437
|
-
case void 0: return utf8ToBytes(string).length;
|
|
438
|
-
case "ucs2":
|
|
439
|
-
case "ucs-2":
|
|
440
|
-
case "utf16le":
|
|
441
|
-
case "utf-16le": return len * 2;
|
|
442
|
-
case "hex": return len >>> 1;
|
|
443
|
-
case "base64": return base64ToBytes(string).length;
|
|
444
|
-
default:
|
|
445
|
-
if (loweredCase) return utf8ToBytes(string).length;
|
|
446
|
-
encoding = ("" + encoding).toLowerCase();
|
|
447
|
-
loweredCase = true;
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
Buffer.byteLength = byteLength;
|
|
451
|
-
function slowToString(encoding, start, end) {
|
|
452
|
-
var loweredCase = false;
|
|
453
|
-
if (start === void 0 || start < 0) start = 0;
|
|
454
|
-
if (start > this.length) return "";
|
|
455
|
-
if (end === void 0 || end > this.length) end = this.length;
|
|
456
|
-
if (end <= 0) return "";
|
|
457
|
-
end >>>= 0;
|
|
458
|
-
start >>>= 0;
|
|
459
|
-
if (end <= start) return "";
|
|
460
|
-
if (!encoding) encoding = "utf8";
|
|
461
|
-
while (true) switch (encoding) {
|
|
462
|
-
case "hex": return hexSlice(this, start, end);
|
|
463
|
-
case "utf8":
|
|
464
|
-
case "utf-8": return utf8Slice(this, start, end);
|
|
465
|
-
case "ascii": return asciiSlice(this, start, end);
|
|
466
|
-
case "latin1":
|
|
467
|
-
case "binary": return latin1Slice(this, start, end);
|
|
468
|
-
case "base64": return base64Slice(this, start, end);
|
|
469
|
-
case "ucs2":
|
|
470
|
-
case "ucs-2":
|
|
471
|
-
case "utf16le":
|
|
472
|
-
case "utf-16le": return utf16leSlice(this, start, end);
|
|
473
|
-
default:
|
|
474
|
-
if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
|
|
475
|
-
encoding = (encoding + "").toLowerCase();
|
|
476
|
-
loweredCase = true;
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
Buffer.prototype._isBuffer = true;
|
|
480
|
-
function swap(b, n, m) {
|
|
481
|
-
var i = b[n];
|
|
482
|
-
b[n] = b[m];
|
|
483
|
-
b[m] = i;
|
|
484
|
-
}
|
|
485
|
-
Buffer.prototype.swap16 = function swap16() {
|
|
486
|
-
var len = this.length;
|
|
487
|
-
if (len % 2 !== 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
488
|
-
for (var i = 0; i < len; i += 2) swap(this, i, i + 1);
|
|
489
|
-
return this;
|
|
490
|
-
};
|
|
491
|
-
Buffer.prototype.swap32 = function swap32() {
|
|
492
|
-
var len = this.length;
|
|
493
|
-
if (len % 4 !== 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
494
|
-
for (var i = 0; i < len; i += 4) {
|
|
495
|
-
swap(this, i, i + 3);
|
|
496
|
-
swap(this, i + 1, i + 2);
|
|
497
|
-
}
|
|
498
|
-
return this;
|
|
499
|
-
};
|
|
500
|
-
Buffer.prototype.swap64 = function swap64() {
|
|
501
|
-
var len = this.length;
|
|
502
|
-
if (len % 8 !== 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
503
|
-
for (var i = 0; i < len; i += 8) {
|
|
504
|
-
swap(this, i, i + 7);
|
|
505
|
-
swap(this, i + 1, i + 6);
|
|
506
|
-
swap(this, i + 2, i + 5);
|
|
507
|
-
swap(this, i + 3, i + 4);
|
|
508
|
-
}
|
|
509
|
-
return this;
|
|
510
|
-
};
|
|
511
|
-
Buffer.prototype.toString = function toString() {
|
|
512
|
-
var length = this.length | 0;
|
|
513
|
-
if (length === 0) return "";
|
|
514
|
-
if (arguments.length === 0) return utf8Slice(this, 0, length);
|
|
515
|
-
return slowToString.apply(this, arguments);
|
|
516
|
-
};
|
|
517
|
-
Buffer.prototype.equals = function equals(b) {
|
|
518
|
-
if (!internalIsBuffer(b)) throw new TypeError("Argument must be a Buffer");
|
|
519
|
-
if (this === b) return true;
|
|
520
|
-
return Buffer.compare(this, b) === 0;
|
|
521
|
-
};
|
|
522
|
-
Buffer.prototype.inspect = function inspect() {
|
|
523
|
-
var str = "";
|
|
524
|
-
var max = 50;
|
|
525
|
-
if (this.length > 0) {
|
|
526
|
-
str = this.toString("hex", 0, max).match(/.{2}/g).join(" ");
|
|
527
|
-
if (this.length > max) str += " ... ";
|
|
528
|
-
}
|
|
529
|
-
return "<Buffer " + str + ">";
|
|
530
|
-
};
|
|
531
|
-
Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
|
|
532
|
-
if (!internalIsBuffer(target)) throw new TypeError("Argument must be a Buffer");
|
|
533
|
-
if (start === void 0) start = 0;
|
|
534
|
-
if (end === void 0) end = target ? target.length : 0;
|
|
535
|
-
if (thisStart === void 0) thisStart = 0;
|
|
536
|
-
if (thisEnd === void 0) thisEnd = this.length;
|
|
537
|
-
if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) throw new RangeError("out of range index");
|
|
538
|
-
if (thisStart >= thisEnd && start >= end) return 0;
|
|
539
|
-
if (thisStart >= thisEnd) return -1;
|
|
540
|
-
if (start >= end) return 1;
|
|
541
|
-
start >>>= 0;
|
|
542
|
-
end >>>= 0;
|
|
543
|
-
thisStart >>>= 0;
|
|
544
|
-
thisEnd >>>= 0;
|
|
545
|
-
if (this === target) return 0;
|
|
546
|
-
var x = thisEnd - thisStart;
|
|
547
|
-
var y = end - start;
|
|
548
|
-
var len = Math.min(x, y);
|
|
549
|
-
var thisCopy = this.slice(thisStart, thisEnd);
|
|
550
|
-
var targetCopy = target.slice(start, end);
|
|
551
|
-
for (var i = 0; i < len; ++i) if (thisCopy[i] !== targetCopy[i]) {
|
|
552
|
-
x = thisCopy[i];
|
|
553
|
-
y = targetCopy[i];
|
|
554
|
-
break;
|
|
555
|
-
}
|
|
556
|
-
if (x < y) return -1;
|
|
557
|
-
if (y < x) return 1;
|
|
558
|
-
return 0;
|
|
559
|
-
};
|
|
560
|
-
function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
|
|
561
|
-
if (buffer.length === 0) return -1;
|
|
562
|
-
if (typeof byteOffset === "string") {
|
|
563
|
-
encoding = byteOffset;
|
|
564
|
-
byteOffset = 0;
|
|
565
|
-
} else if (byteOffset > 2147483647) byteOffset = 2147483647;
|
|
566
|
-
else if (byteOffset < -2147483648) byteOffset = -2147483648;
|
|
567
|
-
byteOffset = +byteOffset;
|
|
568
|
-
if (isNaN(byteOffset)) byteOffset = dir ? 0 : buffer.length - 1;
|
|
569
|
-
if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
|
|
570
|
-
if (byteOffset >= buffer.length) if (dir) return -1;
|
|
571
|
-
else byteOffset = buffer.length - 1;
|
|
572
|
-
else if (byteOffset < 0) if (dir) byteOffset = 0;
|
|
573
|
-
else return -1;
|
|
574
|
-
if (typeof val === "string") val = Buffer.from(val, encoding);
|
|
575
|
-
if (internalIsBuffer(val)) {
|
|
576
|
-
if (val.length === 0) return -1;
|
|
577
|
-
return arrayIndexOf(buffer, val, byteOffset, encoding, dir);
|
|
578
|
-
} else if (typeof val === "number") {
|
|
579
|
-
val = val & 255;
|
|
580
|
-
if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === "function") if (dir) return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);
|
|
581
|
-
else return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);
|
|
582
|
-
return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);
|
|
583
|
-
}
|
|
584
|
-
throw new TypeError("val must be string, number or Buffer");
|
|
585
|
-
}
|
|
586
|
-
function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
|
|
587
|
-
var indexSize = 1;
|
|
588
|
-
var arrLength = arr.length;
|
|
589
|
-
var valLength = val.length;
|
|
590
|
-
if (encoding !== void 0) {
|
|
591
|
-
encoding = String(encoding).toLowerCase();
|
|
592
|
-
if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") {
|
|
593
|
-
if (arr.length < 2 || val.length < 2) return -1;
|
|
594
|
-
indexSize = 2;
|
|
595
|
-
arrLength /= 2;
|
|
596
|
-
valLength /= 2;
|
|
597
|
-
byteOffset /= 2;
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
function read(buf, i) {
|
|
601
|
-
if (indexSize === 1) return buf[i];
|
|
602
|
-
else return buf.readUInt16BE(i * indexSize);
|
|
603
|
-
}
|
|
604
|
-
var i;
|
|
605
|
-
if (dir) {
|
|
606
|
-
var foundIndex = -1;
|
|
607
|
-
for (i = byteOffset; i < arrLength; i++) if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
|
|
608
|
-
if (foundIndex === -1) foundIndex = i;
|
|
609
|
-
if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;
|
|
610
|
-
} else {
|
|
611
|
-
if (foundIndex !== -1) i -= i - foundIndex;
|
|
612
|
-
foundIndex = -1;
|
|
613
|
-
}
|
|
614
|
-
} else {
|
|
615
|
-
if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
|
|
616
|
-
for (i = byteOffset; i >= 0; i--) {
|
|
617
|
-
var found = true;
|
|
618
|
-
for (var j = 0; j < valLength; j++) if (read(arr, i + j) !== read(val, j)) {
|
|
619
|
-
found = false;
|
|
620
|
-
break;
|
|
621
|
-
}
|
|
622
|
-
if (found) return i;
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
return -1;
|
|
626
|
-
}
|
|
627
|
-
Buffer.prototype.includes = function includes(val, byteOffset, encoding) {
|
|
628
|
-
return this.indexOf(val, byteOffset, encoding) !== -1;
|
|
629
|
-
};
|
|
630
|
-
Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
|
|
631
|
-
return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
|
|
632
|
-
};
|
|
633
|
-
Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
|
|
634
|
-
return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
|
|
635
|
-
};
|
|
636
|
-
function hexWrite(buf, string, offset, length) {
|
|
637
|
-
offset = Number(offset) || 0;
|
|
638
|
-
var remaining = buf.length - offset;
|
|
639
|
-
if (!length) length = remaining;
|
|
640
|
-
else {
|
|
641
|
-
length = Number(length);
|
|
642
|
-
if (length > remaining) length = remaining;
|
|
643
|
-
}
|
|
644
|
-
var strLen = string.length;
|
|
645
|
-
if (strLen % 2 !== 0) throw new TypeError("Invalid hex string");
|
|
646
|
-
if (length > strLen / 2) length = strLen / 2;
|
|
647
|
-
for (var i = 0; i < length; ++i) {
|
|
648
|
-
var parsed = parseInt(string.substr(i * 2, 2), 16);
|
|
649
|
-
if (isNaN(parsed)) return i;
|
|
650
|
-
buf[offset + i] = parsed;
|
|
651
|
-
}
|
|
652
|
-
return i;
|
|
653
|
-
}
|
|
654
|
-
function utf8Write(buf, string, offset, length) {
|
|
655
|
-
return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
|
|
656
|
-
}
|
|
657
|
-
function asciiWrite(buf, string, offset, length) {
|
|
658
|
-
return blitBuffer(asciiToBytes(string), buf, offset, length);
|
|
659
|
-
}
|
|
660
|
-
function latin1Write(buf, string, offset, length) {
|
|
661
|
-
return asciiWrite(buf, string, offset, length);
|
|
662
|
-
}
|
|
663
|
-
function base64Write(buf, string, offset, length) {
|
|
664
|
-
return blitBuffer(base64ToBytes(string), buf, offset, length);
|
|
665
|
-
}
|
|
666
|
-
function ucs2Write(buf, string, offset, length) {
|
|
667
|
-
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
|
|
668
|
-
}
|
|
669
|
-
Buffer.prototype.write = function write(string, offset, length, encoding) {
|
|
670
|
-
if (offset === void 0) {
|
|
671
|
-
encoding = "utf8";
|
|
672
|
-
length = this.length;
|
|
673
|
-
offset = 0;
|
|
674
|
-
} else if (length === void 0 && typeof offset === "string") {
|
|
675
|
-
encoding = offset;
|
|
676
|
-
length = this.length;
|
|
677
|
-
offset = 0;
|
|
678
|
-
} else if (isFinite(offset)) {
|
|
679
|
-
offset = offset | 0;
|
|
680
|
-
if (isFinite(length)) {
|
|
681
|
-
length = length | 0;
|
|
682
|
-
if (encoding === void 0) encoding = "utf8";
|
|
683
|
-
} else {
|
|
684
|
-
encoding = length;
|
|
685
|
-
length = void 0;
|
|
686
|
-
}
|
|
687
|
-
} else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
|
|
688
|
-
var remaining = this.length - offset;
|
|
689
|
-
if (length === void 0 || length > remaining) length = remaining;
|
|
690
|
-
if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) throw new RangeError("Attempt to write outside buffer bounds");
|
|
691
|
-
if (!encoding) encoding = "utf8";
|
|
692
|
-
var loweredCase = false;
|
|
693
|
-
for (;;) switch (encoding) {
|
|
694
|
-
case "hex": return hexWrite(this, string, offset, length);
|
|
695
|
-
case "utf8":
|
|
696
|
-
case "utf-8": return utf8Write(this, string, offset, length);
|
|
697
|
-
case "ascii": return asciiWrite(this, string, offset, length);
|
|
698
|
-
case "latin1":
|
|
699
|
-
case "binary": return latin1Write(this, string, offset, length);
|
|
700
|
-
case "base64": return base64Write(this, string, offset, length);
|
|
701
|
-
case "ucs2":
|
|
702
|
-
case "ucs-2":
|
|
703
|
-
case "utf16le":
|
|
704
|
-
case "utf-16le": return ucs2Write(this, string, offset, length);
|
|
705
|
-
default:
|
|
706
|
-
if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
|
|
707
|
-
encoding = ("" + encoding).toLowerCase();
|
|
708
|
-
loweredCase = true;
|
|
709
|
-
}
|
|
710
|
-
};
|
|
711
|
-
Buffer.prototype.toJSON = function toJSON() {
|
|
712
|
-
return {
|
|
713
|
-
type: "Buffer",
|
|
714
|
-
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
715
|
-
};
|
|
716
|
-
};
|
|
717
|
-
function base64Slice(buf, start, end) {
|
|
718
|
-
if (start === 0 && end === buf.length) return fromByteArray(buf);
|
|
719
|
-
else return fromByteArray(buf.slice(start, end));
|
|
720
|
-
}
|
|
721
|
-
function utf8Slice(buf, start, end) {
|
|
722
|
-
end = Math.min(buf.length, end);
|
|
723
|
-
var res = [];
|
|
724
|
-
var i = start;
|
|
725
|
-
while (i < end) {
|
|
726
|
-
var firstByte = buf[i];
|
|
727
|
-
var codePoint = null;
|
|
728
|
-
var bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;
|
|
729
|
-
if (i + bytesPerSequence <= end) {
|
|
730
|
-
var secondByte, thirdByte, fourthByte, tempCodePoint;
|
|
731
|
-
switch (bytesPerSequence) {
|
|
732
|
-
case 1:
|
|
733
|
-
if (firstByte < 128) codePoint = firstByte;
|
|
734
|
-
break;
|
|
735
|
-
case 2:
|
|
736
|
-
secondByte = buf[i + 1];
|
|
737
|
-
if ((secondByte & 192) === 128) {
|
|
738
|
-
tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;
|
|
739
|
-
if (tempCodePoint > 127) codePoint = tempCodePoint;
|
|
740
|
-
}
|
|
741
|
-
break;
|
|
742
|
-
case 3:
|
|
743
|
-
secondByte = buf[i + 1];
|
|
744
|
-
thirdByte = buf[i + 2];
|
|
745
|
-
if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {
|
|
746
|
-
tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;
|
|
747
|
-
if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) codePoint = tempCodePoint;
|
|
748
|
-
}
|
|
749
|
-
break;
|
|
750
|
-
case 4:
|
|
751
|
-
secondByte = buf[i + 1];
|
|
752
|
-
thirdByte = buf[i + 2];
|
|
753
|
-
fourthByte = buf[i + 3];
|
|
754
|
-
if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {
|
|
755
|
-
tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;
|
|
756
|
-
if (tempCodePoint > 65535 && tempCodePoint < 1114112) codePoint = tempCodePoint;
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
if (codePoint === null) {
|
|
761
|
-
codePoint = 65533;
|
|
762
|
-
bytesPerSequence = 1;
|
|
763
|
-
} else if (codePoint > 65535) {
|
|
764
|
-
codePoint -= 65536;
|
|
765
|
-
res.push(codePoint >>> 10 & 1023 | 55296);
|
|
766
|
-
codePoint = 56320 | codePoint & 1023;
|
|
767
|
-
}
|
|
768
|
-
res.push(codePoint);
|
|
769
|
-
i += bytesPerSequence;
|
|
770
|
-
}
|
|
771
|
-
return decodeCodePointsArray(res);
|
|
772
|
-
}
|
|
773
|
-
var MAX_ARGUMENTS_LENGTH = 4096;
|
|
774
|
-
function decodeCodePointsArray(codePoints) {
|
|
775
|
-
var len = codePoints.length;
|
|
776
|
-
if (len <= MAX_ARGUMENTS_LENGTH) return String.fromCharCode.apply(String, codePoints);
|
|
777
|
-
var res = "";
|
|
778
|
-
var i = 0;
|
|
779
|
-
while (i < len) res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));
|
|
780
|
-
return res;
|
|
781
|
-
}
|
|
782
|
-
function asciiSlice(buf, start, end) {
|
|
783
|
-
var ret = "";
|
|
784
|
-
end = Math.min(buf.length, end);
|
|
785
|
-
for (var i = start; i < end; ++i) ret += String.fromCharCode(buf[i] & 127);
|
|
786
|
-
return ret;
|
|
787
|
-
}
|
|
788
|
-
function latin1Slice(buf, start, end) {
|
|
789
|
-
var ret = "";
|
|
790
|
-
end = Math.min(buf.length, end);
|
|
791
|
-
for (var i = start; i < end; ++i) ret += String.fromCharCode(buf[i]);
|
|
792
|
-
return ret;
|
|
793
|
-
}
|
|
794
|
-
function hexSlice(buf, start, end) {
|
|
795
|
-
var len = buf.length;
|
|
796
|
-
if (!start || start < 0) start = 0;
|
|
797
|
-
if (!end || end < 0 || end > len) end = len;
|
|
798
|
-
var out = "";
|
|
799
|
-
for (var i = start; i < end; ++i) out += toHex(buf[i]);
|
|
800
|
-
return out;
|
|
801
|
-
}
|
|
802
|
-
function utf16leSlice(buf, start, end) {
|
|
803
|
-
var bytes = buf.slice(start, end);
|
|
804
|
-
var res = "";
|
|
805
|
-
for (var i = 0; i < bytes.length; i += 2) res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
|
|
806
|
-
return res;
|
|
807
|
-
}
|
|
808
|
-
Buffer.prototype.slice = function slice(start, end) {
|
|
809
|
-
var len = this.length;
|
|
810
|
-
start = ~~start;
|
|
811
|
-
end = end === void 0 ? len : ~~end;
|
|
812
|
-
if (start < 0) {
|
|
813
|
-
start += len;
|
|
814
|
-
if (start < 0) start = 0;
|
|
815
|
-
} else if (start > len) start = len;
|
|
816
|
-
if (end < 0) {
|
|
817
|
-
end += len;
|
|
818
|
-
if (end < 0) end = 0;
|
|
819
|
-
} else if (end > len) end = len;
|
|
820
|
-
if (end < start) end = start;
|
|
821
|
-
var newBuf;
|
|
822
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
823
|
-
newBuf = this.subarray(start, end);
|
|
824
|
-
newBuf.__proto__ = Buffer.prototype;
|
|
825
|
-
} else {
|
|
826
|
-
var sliceLen = end - start;
|
|
827
|
-
newBuf = new Buffer(sliceLen, void 0);
|
|
828
|
-
for (var i = 0; i < sliceLen; ++i) newBuf[i] = this[i + start];
|
|
829
|
-
}
|
|
830
|
-
return newBuf;
|
|
831
|
-
};
|
|
832
|
-
function checkOffset(offset, ext, length) {
|
|
833
|
-
if (offset % 1 !== 0 || offset < 0) throw new RangeError("offset is not uint");
|
|
834
|
-
if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length");
|
|
835
|
-
}
|
|
836
|
-
Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {
|
|
837
|
-
offset = offset | 0;
|
|
838
|
-
byteLength = byteLength | 0;
|
|
839
|
-
if (!noAssert) checkOffset(offset, byteLength, this.length);
|
|
840
|
-
var val = this[offset];
|
|
841
|
-
var mul = 1;
|
|
842
|
-
var i = 0;
|
|
843
|
-
while (++i < byteLength && (mul *= 256)) val += this[offset + i] * mul;
|
|
844
|
-
return val;
|
|
845
|
-
};
|
|
846
|
-
Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {
|
|
847
|
-
offset = offset | 0;
|
|
848
|
-
byteLength = byteLength | 0;
|
|
849
|
-
if (!noAssert) checkOffset(offset, byteLength, this.length);
|
|
850
|
-
var val = this[offset + --byteLength];
|
|
851
|
-
var mul = 1;
|
|
852
|
-
while (byteLength > 0 && (mul *= 256)) val += this[offset + --byteLength] * mul;
|
|
853
|
-
return val;
|
|
854
|
-
};
|
|
855
|
-
Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {
|
|
856
|
-
if (!noAssert) checkOffset(offset, 1, this.length);
|
|
857
|
-
return this[offset];
|
|
858
|
-
};
|
|
859
|
-
Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
|
|
860
|
-
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
861
|
-
return this[offset] | this[offset + 1] << 8;
|
|
862
|
-
};
|
|
863
|
-
Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
|
|
864
|
-
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
865
|
-
return this[offset] << 8 | this[offset + 1];
|
|
866
|
-
};
|
|
867
|
-
Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
|
|
868
|
-
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
869
|
-
return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;
|
|
870
|
-
};
|
|
871
|
-
Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
|
|
872
|
-
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
873
|
-
return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
|
|
874
|
-
};
|
|
875
|
-
Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {
|
|
876
|
-
offset = offset | 0;
|
|
877
|
-
byteLength = byteLength | 0;
|
|
878
|
-
if (!noAssert) checkOffset(offset, byteLength, this.length);
|
|
879
|
-
var val = this[offset];
|
|
880
|
-
var mul = 1;
|
|
881
|
-
var i = 0;
|
|
882
|
-
while (++i < byteLength && (mul *= 256)) val += this[offset + i] * mul;
|
|
883
|
-
mul *= 128;
|
|
884
|
-
if (val >= mul) val -= Math.pow(2, 8 * byteLength);
|
|
885
|
-
return val;
|
|
886
|
-
};
|
|
887
|
-
Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {
|
|
888
|
-
offset = offset | 0;
|
|
889
|
-
byteLength = byteLength | 0;
|
|
890
|
-
if (!noAssert) checkOffset(offset, byteLength, this.length);
|
|
891
|
-
var i = byteLength;
|
|
892
|
-
var mul = 1;
|
|
893
|
-
var val = this[offset + --i];
|
|
894
|
-
while (i > 0 && (mul *= 256)) val += this[offset + --i] * mul;
|
|
895
|
-
mul *= 128;
|
|
896
|
-
if (val >= mul) val -= Math.pow(2, 8 * byteLength);
|
|
897
|
-
return val;
|
|
898
|
-
};
|
|
899
|
-
Buffer.prototype.readInt8 = function readInt8(offset, noAssert) {
|
|
900
|
-
if (!noAssert) checkOffset(offset, 1, this.length);
|
|
901
|
-
if (!(this[offset] & 128)) return this[offset];
|
|
902
|
-
return (255 - this[offset] + 1) * -1;
|
|
903
|
-
};
|
|
904
|
-
Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
|
|
905
|
-
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
906
|
-
var val = this[offset] | this[offset + 1] << 8;
|
|
907
|
-
return val & 32768 ? val | 4294901760 : val;
|
|
908
|
-
};
|
|
909
|
-
Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
|
|
910
|
-
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
911
|
-
var val = this[offset + 1] | this[offset] << 8;
|
|
912
|
-
return val & 32768 ? val | 4294901760 : val;
|
|
913
|
-
};
|
|
914
|
-
Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
|
|
915
|
-
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
916
|
-
return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
|
|
917
|
-
};
|
|
918
|
-
Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
|
|
919
|
-
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
920
|
-
return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
|
|
921
|
-
};
|
|
922
|
-
Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
|
|
923
|
-
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
924
|
-
return read(this, offset, true, 23, 4);
|
|
925
|
-
};
|
|
926
|
-
Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
|
|
927
|
-
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
928
|
-
return read(this, offset, false, 23, 4);
|
|
929
|
-
};
|
|
930
|
-
Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
|
|
931
|
-
if (!noAssert) checkOffset(offset, 8, this.length);
|
|
932
|
-
return read(this, offset, true, 52, 8);
|
|
933
|
-
};
|
|
934
|
-
Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
|
|
935
|
-
if (!noAssert) checkOffset(offset, 8, this.length);
|
|
936
|
-
return read(this, offset, false, 52, 8);
|
|
937
|
-
};
|
|
938
|
-
function checkInt(buf, value, offset, ext, max, min) {
|
|
939
|
-
if (!internalIsBuffer(buf)) throw new TypeError("\"buffer\" argument must be a Buffer instance");
|
|
940
|
-
if (value > max || value < min) throw new RangeError("\"value\" argument is out of bounds");
|
|
941
|
-
if (offset + ext > buf.length) throw new RangeError("Index out of range");
|
|
942
|
-
}
|
|
943
|
-
Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {
|
|
944
|
-
value = +value;
|
|
945
|
-
offset = offset | 0;
|
|
946
|
-
byteLength = byteLength | 0;
|
|
947
|
-
if (!noAssert) {
|
|
948
|
-
var maxBytes = Math.pow(2, 8 * byteLength) - 1;
|
|
949
|
-
checkInt(this, value, offset, byteLength, maxBytes, 0);
|
|
950
|
-
}
|
|
951
|
-
var mul = 1;
|
|
952
|
-
var i = 0;
|
|
953
|
-
this[offset] = value & 255;
|
|
954
|
-
while (++i < byteLength && (mul *= 256)) this[offset + i] = value / mul & 255;
|
|
955
|
-
return offset + byteLength;
|
|
956
|
-
};
|
|
957
|
-
Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {
|
|
958
|
-
value = +value;
|
|
959
|
-
offset = offset | 0;
|
|
960
|
-
byteLength = byteLength | 0;
|
|
961
|
-
if (!noAssert) {
|
|
962
|
-
var maxBytes = Math.pow(2, 8 * byteLength) - 1;
|
|
963
|
-
checkInt(this, value, offset, byteLength, maxBytes, 0);
|
|
964
|
-
}
|
|
965
|
-
var i = byteLength - 1;
|
|
966
|
-
var mul = 1;
|
|
967
|
-
this[offset + i] = value & 255;
|
|
968
|
-
while (--i >= 0 && (mul *= 256)) this[offset + i] = value / mul & 255;
|
|
969
|
-
return offset + byteLength;
|
|
970
|
-
};
|
|
971
|
-
Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
|
|
972
|
-
value = +value;
|
|
973
|
-
offset = offset | 0;
|
|
974
|
-
if (!noAssert) checkInt(this, value, offset, 1, 255, 0);
|
|
975
|
-
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
|
|
976
|
-
this[offset] = value & 255;
|
|
977
|
-
return offset + 1;
|
|
978
|
-
};
|
|
979
|
-
function objectWriteUInt16(buf, value, offset, littleEndian) {
|
|
980
|
-
if (value < 0) value = 65535 + value + 1;
|
|
981
|
-
for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) buf[offset + i] = (value & 255 << 8 * (littleEndian ? i : 1 - i)) >>> (littleEndian ? i : 1 - i) * 8;
|
|
982
|
-
}
|
|
983
|
-
Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
|
|
984
|
-
value = +value;
|
|
985
|
-
offset = offset | 0;
|
|
986
|
-
if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
|
|
987
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
988
|
-
this[offset] = value & 255;
|
|
989
|
-
this[offset + 1] = value >>> 8;
|
|
990
|
-
} else objectWriteUInt16(this, value, offset, true);
|
|
991
|
-
return offset + 2;
|
|
992
|
-
};
|
|
993
|
-
Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
|
|
994
|
-
value = +value;
|
|
995
|
-
offset = offset | 0;
|
|
996
|
-
if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
|
|
997
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
998
|
-
this[offset] = value >>> 8;
|
|
999
|
-
this[offset + 1] = value & 255;
|
|
1000
|
-
} else objectWriteUInt16(this, value, offset, false);
|
|
1001
|
-
return offset + 2;
|
|
1002
|
-
};
|
|
1003
|
-
function objectWriteUInt32(buf, value, offset, littleEndian) {
|
|
1004
|
-
if (value < 0) value = 4294967295 + value + 1;
|
|
1005
|
-
for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) buf[offset + i] = value >>> (littleEndian ? i : 3 - i) * 8 & 255;
|
|
1006
|
-
}
|
|
1007
|
-
Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
|
|
1008
|
-
value = +value;
|
|
1009
|
-
offset = offset | 0;
|
|
1010
|
-
if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
|
|
1011
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
1012
|
-
this[offset + 3] = value >>> 24;
|
|
1013
|
-
this[offset + 2] = value >>> 16;
|
|
1014
|
-
this[offset + 1] = value >>> 8;
|
|
1015
|
-
this[offset] = value & 255;
|
|
1016
|
-
} else objectWriteUInt32(this, value, offset, true);
|
|
1017
|
-
return offset + 4;
|
|
1018
|
-
};
|
|
1019
|
-
Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
|
|
1020
|
-
value = +value;
|
|
1021
|
-
offset = offset | 0;
|
|
1022
|
-
if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
|
|
1023
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
1024
|
-
this[offset] = value >>> 24;
|
|
1025
|
-
this[offset + 1] = value >>> 16;
|
|
1026
|
-
this[offset + 2] = value >>> 8;
|
|
1027
|
-
this[offset + 3] = value & 255;
|
|
1028
|
-
} else objectWriteUInt32(this, value, offset, false);
|
|
1029
|
-
return offset + 4;
|
|
1030
|
-
};
|
|
1031
|
-
Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {
|
|
1032
|
-
value = +value;
|
|
1033
|
-
offset = offset | 0;
|
|
1034
|
-
if (!noAssert) {
|
|
1035
|
-
var limit = Math.pow(2, 8 * byteLength - 1);
|
|
1036
|
-
checkInt(this, value, offset, byteLength, limit - 1, -limit);
|
|
1037
|
-
}
|
|
1038
|
-
var i = 0;
|
|
1039
|
-
var mul = 1;
|
|
1040
|
-
var sub = 0;
|
|
1041
|
-
this[offset] = value & 255;
|
|
1042
|
-
while (++i < byteLength && (mul *= 256)) {
|
|
1043
|
-
if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) sub = 1;
|
|
1044
|
-
this[offset + i] = (value / mul >> 0) - sub & 255;
|
|
1045
|
-
}
|
|
1046
|
-
return offset + byteLength;
|
|
1047
|
-
};
|
|
1048
|
-
Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {
|
|
1049
|
-
value = +value;
|
|
1050
|
-
offset = offset | 0;
|
|
1051
|
-
if (!noAssert) {
|
|
1052
|
-
var limit = Math.pow(2, 8 * byteLength - 1);
|
|
1053
|
-
checkInt(this, value, offset, byteLength, limit - 1, -limit);
|
|
1054
|
-
}
|
|
1055
|
-
var i = byteLength - 1;
|
|
1056
|
-
var mul = 1;
|
|
1057
|
-
var sub = 0;
|
|
1058
|
-
this[offset + i] = value & 255;
|
|
1059
|
-
while (--i >= 0 && (mul *= 256)) {
|
|
1060
|
-
if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) sub = 1;
|
|
1061
|
-
this[offset + i] = (value / mul >> 0) - sub & 255;
|
|
1062
|
-
}
|
|
1063
|
-
return offset + byteLength;
|
|
1064
|
-
};
|
|
1065
|
-
Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
|
|
1066
|
-
value = +value;
|
|
1067
|
-
offset = offset | 0;
|
|
1068
|
-
if (!noAssert) checkInt(this, value, offset, 1, 127, -128);
|
|
1069
|
-
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
|
|
1070
|
-
if (value < 0) value = 255 + value + 1;
|
|
1071
|
-
this[offset] = value & 255;
|
|
1072
|
-
return offset + 1;
|
|
1073
|
-
};
|
|
1074
|
-
Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
|
|
1075
|
-
value = +value;
|
|
1076
|
-
offset = offset | 0;
|
|
1077
|
-
if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
|
|
1078
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
1079
|
-
this[offset] = value & 255;
|
|
1080
|
-
this[offset + 1] = value >>> 8;
|
|
1081
|
-
} else objectWriteUInt16(this, value, offset, true);
|
|
1082
|
-
return offset + 2;
|
|
1083
|
-
};
|
|
1084
|
-
Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
|
|
1085
|
-
value = +value;
|
|
1086
|
-
offset = offset | 0;
|
|
1087
|
-
if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
|
|
1088
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
1089
|
-
this[offset] = value >>> 8;
|
|
1090
|
-
this[offset + 1] = value & 255;
|
|
1091
|
-
} else objectWriteUInt16(this, value, offset, false);
|
|
1092
|
-
return offset + 2;
|
|
1093
|
-
};
|
|
1094
|
-
Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
|
|
1095
|
-
value = +value;
|
|
1096
|
-
offset = offset | 0;
|
|
1097
|
-
if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
|
|
1098
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
1099
|
-
this[offset] = value & 255;
|
|
1100
|
-
this[offset + 1] = value >>> 8;
|
|
1101
|
-
this[offset + 2] = value >>> 16;
|
|
1102
|
-
this[offset + 3] = value >>> 24;
|
|
1103
|
-
} else objectWriteUInt32(this, value, offset, true);
|
|
1104
|
-
return offset + 4;
|
|
1105
|
-
};
|
|
1106
|
-
Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
|
|
1107
|
-
value = +value;
|
|
1108
|
-
offset = offset | 0;
|
|
1109
|
-
if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
|
|
1110
|
-
if (value < 0) value = 4294967295 + value + 1;
|
|
1111
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
1112
|
-
this[offset] = value >>> 24;
|
|
1113
|
-
this[offset + 1] = value >>> 16;
|
|
1114
|
-
this[offset + 2] = value >>> 8;
|
|
1115
|
-
this[offset + 3] = value & 255;
|
|
1116
|
-
} else objectWriteUInt32(this, value, offset, false);
|
|
1117
|
-
return offset + 4;
|
|
1118
|
-
};
|
|
1119
|
-
function checkIEEE754(buf, value, offset, ext, max, min) {
|
|
1120
|
-
if (offset + ext > buf.length) throw new RangeError("Index out of range");
|
|
1121
|
-
if (offset < 0) throw new RangeError("Index out of range");
|
|
1122
|
-
}
|
|
1123
|
-
function writeFloat(buf, value, offset, littleEndian, noAssert) {
|
|
1124
|
-
if (!noAssert) checkIEEE754(buf, value, offset, 4);
|
|
1125
|
-
write(buf, value, offset, littleEndian, 23, 4);
|
|
1126
|
-
return offset + 4;
|
|
1127
|
-
}
|
|
1128
|
-
Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
|
|
1129
|
-
return writeFloat(this, value, offset, true, noAssert);
|
|
1130
|
-
};
|
|
1131
|
-
Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
|
|
1132
|
-
return writeFloat(this, value, offset, false, noAssert);
|
|
1133
|
-
};
|
|
1134
|
-
function writeDouble(buf, value, offset, littleEndian, noAssert) {
|
|
1135
|
-
if (!noAssert) checkIEEE754(buf, value, offset, 8);
|
|
1136
|
-
write(buf, value, offset, littleEndian, 52, 8);
|
|
1137
|
-
return offset + 8;
|
|
1138
|
-
}
|
|
1139
|
-
Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
|
|
1140
|
-
return writeDouble(this, value, offset, true, noAssert);
|
|
1141
|
-
};
|
|
1142
|
-
Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
|
|
1143
|
-
return writeDouble(this, value, offset, false, noAssert);
|
|
1144
|
-
};
|
|
1145
|
-
Buffer.prototype.copy = function copy(target, targetStart, start, end) {
|
|
1146
|
-
if (!start) start = 0;
|
|
1147
|
-
if (!end && end !== 0) end = this.length;
|
|
1148
|
-
if (targetStart >= target.length) targetStart = target.length;
|
|
1149
|
-
if (!targetStart) targetStart = 0;
|
|
1150
|
-
if (end > 0 && end < start) end = start;
|
|
1151
|
-
if (end === start) return 0;
|
|
1152
|
-
if (target.length === 0 || this.length === 0) return 0;
|
|
1153
|
-
if (targetStart < 0) throw new RangeError("targetStart out of bounds");
|
|
1154
|
-
if (start < 0 || start >= this.length) throw new RangeError("sourceStart out of bounds");
|
|
1155
|
-
if (end < 0) throw new RangeError("sourceEnd out of bounds");
|
|
1156
|
-
if (end > this.length) end = this.length;
|
|
1157
|
-
if (target.length - targetStart < end - start) end = target.length - targetStart + start;
|
|
1158
|
-
var len = end - start;
|
|
1159
|
-
var i;
|
|
1160
|
-
if (this === target && start < targetStart && targetStart < end) for (i = len - 1; i >= 0; --i) target[i + targetStart] = this[i + start];
|
|
1161
|
-
else if (len < 1e3 || !Buffer.TYPED_ARRAY_SUPPORT) for (i = 0; i < len; ++i) target[i + targetStart] = this[i + start];
|
|
1162
|
-
else Uint8Array.prototype.set.call(target, this.subarray(start, start + len), targetStart);
|
|
1163
|
-
return len;
|
|
1164
|
-
};
|
|
1165
|
-
Buffer.prototype.fill = function fill(val, start, end, encoding) {
|
|
1166
|
-
if (typeof val === "string") {
|
|
1167
|
-
if (typeof start === "string") {
|
|
1168
|
-
encoding = start;
|
|
1169
|
-
start = 0;
|
|
1170
|
-
end = this.length;
|
|
1171
|
-
} else if (typeof end === "string") {
|
|
1172
|
-
encoding = end;
|
|
1173
|
-
end = this.length;
|
|
1174
|
-
}
|
|
1175
|
-
if (val.length === 1) {
|
|
1176
|
-
var code = val.charCodeAt(0);
|
|
1177
|
-
if (code < 256) val = code;
|
|
1178
|
-
}
|
|
1179
|
-
if (encoding !== void 0 && typeof encoding !== "string") throw new TypeError("encoding must be a string");
|
|
1180
|
-
if (typeof encoding === "string" && !Buffer.isEncoding(encoding)) throw new TypeError("Unknown encoding: " + encoding);
|
|
1181
|
-
} else if (typeof val === "number") val = val & 255;
|
|
1182
|
-
if (start < 0 || this.length < start || this.length < end) throw new RangeError("Out of range index");
|
|
1183
|
-
if (end <= start) return this;
|
|
1184
|
-
start = start >>> 0;
|
|
1185
|
-
end = end === void 0 ? this.length : end >>> 0;
|
|
1186
|
-
if (!val) val = 0;
|
|
1187
|
-
var i;
|
|
1188
|
-
if (typeof val === "number") for (i = start; i < end; ++i) this[i] = val;
|
|
1189
|
-
else {
|
|
1190
|
-
var bytes = internalIsBuffer(val) ? val : utf8ToBytes(new Buffer(val, encoding).toString());
|
|
1191
|
-
var len = bytes.length;
|
|
1192
|
-
for (i = 0; i < end - start; ++i) this[i + start] = bytes[i % len];
|
|
1193
|
-
}
|
|
1194
|
-
return this;
|
|
1195
|
-
};
|
|
1196
|
-
var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g;
|
|
1197
|
-
function base64clean(str) {
|
|
1198
|
-
str = stringtrim(str).replace(INVALID_BASE64_RE, "");
|
|
1199
|
-
if (str.length < 2) return "";
|
|
1200
|
-
while (str.length % 4 !== 0) str = str + "=";
|
|
1201
|
-
return str;
|
|
1202
|
-
}
|
|
1203
|
-
function stringtrim(str) {
|
|
1204
|
-
if (str.trim) return str.trim();
|
|
1205
|
-
return str.replace(/^\s+|\s+$/g, "");
|
|
1206
|
-
}
|
|
1207
|
-
function toHex(n) {
|
|
1208
|
-
if (n < 16) return "0" + n.toString(16);
|
|
1209
|
-
return n.toString(16);
|
|
1210
|
-
}
|
|
1211
|
-
function utf8ToBytes(string, units) {
|
|
1212
|
-
units = units || Infinity;
|
|
1213
|
-
var codePoint;
|
|
1214
|
-
var length = string.length;
|
|
1215
|
-
var leadSurrogate = null;
|
|
1216
|
-
var bytes = [];
|
|
1217
|
-
for (var i = 0; i < length; ++i) {
|
|
1218
|
-
codePoint = string.charCodeAt(i);
|
|
1219
|
-
if (codePoint > 55295 && codePoint < 57344) {
|
|
1220
|
-
if (!leadSurrogate) {
|
|
1221
|
-
if (codePoint > 56319) {
|
|
1222
|
-
if ((units -= 3) > -1) bytes.push(239, 191, 189);
|
|
1223
|
-
continue;
|
|
1224
|
-
} else if (i + 1 === length) {
|
|
1225
|
-
if ((units -= 3) > -1) bytes.push(239, 191, 189);
|
|
1226
|
-
continue;
|
|
1227
|
-
}
|
|
1228
|
-
leadSurrogate = codePoint;
|
|
1229
|
-
continue;
|
|
1230
|
-
}
|
|
1231
|
-
if (codePoint < 56320) {
|
|
1232
|
-
if ((units -= 3) > -1) bytes.push(239, 191, 189);
|
|
1233
|
-
leadSurrogate = codePoint;
|
|
1234
|
-
continue;
|
|
1235
|
-
}
|
|
1236
|
-
codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;
|
|
1237
|
-
} else if (leadSurrogate) {
|
|
1238
|
-
if ((units -= 3) > -1) bytes.push(239, 191, 189);
|
|
1239
|
-
}
|
|
1240
|
-
leadSurrogate = null;
|
|
1241
|
-
if (codePoint < 128) {
|
|
1242
|
-
if ((units -= 1) < 0) break;
|
|
1243
|
-
bytes.push(codePoint);
|
|
1244
|
-
} else if (codePoint < 2048) {
|
|
1245
|
-
if ((units -= 2) < 0) break;
|
|
1246
|
-
bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128);
|
|
1247
|
-
} else if (codePoint < 65536) {
|
|
1248
|
-
if ((units -= 3) < 0) break;
|
|
1249
|
-
bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);
|
|
1250
|
-
} else if (codePoint < 1114112) {
|
|
1251
|
-
if ((units -= 4) < 0) break;
|
|
1252
|
-
bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);
|
|
1253
|
-
} else throw new Error("Invalid code point");
|
|
1254
|
-
}
|
|
1255
|
-
return bytes;
|
|
1256
|
-
}
|
|
1257
|
-
function asciiToBytes(str) {
|
|
1258
|
-
var byteArray = [];
|
|
1259
|
-
for (var i = 0; i < str.length; ++i) byteArray.push(str.charCodeAt(i) & 255);
|
|
1260
|
-
return byteArray;
|
|
1261
|
-
}
|
|
1262
|
-
function utf16leToBytes(str, units) {
|
|
1263
|
-
var c, hi, lo;
|
|
1264
|
-
var byteArray = [];
|
|
1265
|
-
for (var i = 0; i < str.length; ++i) {
|
|
1266
|
-
if ((units -= 2) < 0) break;
|
|
1267
|
-
c = str.charCodeAt(i);
|
|
1268
|
-
hi = c >> 8;
|
|
1269
|
-
lo = c % 256;
|
|
1270
|
-
byteArray.push(lo);
|
|
1271
|
-
byteArray.push(hi);
|
|
1272
|
-
}
|
|
1273
|
-
return byteArray;
|
|
1274
|
-
}
|
|
1275
|
-
function base64ToBytes(str) {
|
|
1276
|
-
return toByteArray(base64clean(str));
|
|
1277
|
-
}
|
|
1278
|
-
function blitBuffer(src, dst, offset, length) {
|
|
1279
|
-
for (var i = 0; i < length; ++i) {
|
|
1280
|
-
if (i + offset >= dst.length || i >= src.length) break;
|
|
1281
|
-
dst[i + offset] = src[i];
|
|
1282
|
-
}
|
|
1283
|
-
return i;
|
|
1284
|
-
}
|
|
1285
|
-
function isnan(val) {
|
|
1286
|
-
return val !== val;
|
|
1287
|
-
}
|
|
1288
|
-
function isBuffer(obj) {
|
|
1289
|
-
return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj));
|
|
1290
|
-
}
|
|
1291
|
-
function isFastBuffer(obj) {
|
|
1292
|
-
return !!obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj);
|
|
1293
|
-
}
|
|
1294
|
-
function isSlowBuffer(obj) {
|
|
1295
|
-
return typeof obj.readFloatLE === "function" && typeof obj.slice === "function" && isFastBuffer(obj.slice(0, 0));
|
|
1296
|
-
}
|
|
1297
|
-
/**
|
|
1298
|
-
* Encode a `Uint8Array` into a base64 string.
|
|
1299
|
-
*
|
|
1300
|
-
* Prefers native `Uint8Array.prototype.toBase64` (no intermediate binary
|
|
1301
|
-
* string), then Node `Buffer` (zero-copy), then a `btoa` fallback.
|
|
1302
|
-
*
|
|
1303
|
-
* The fallback builds the binary string in a loop rather than
|
|
1304
|
-
* `String.fromCharCode(...bytes)` — the spread form places every byte on the
|
|
1305
|
-
* call stack and overflows for large buffers (V8 caps function arguments near
|
|
1306
|
-
* ~65k).
|
|
1307
|
-
*/
|
|
1308
|
-
function encodeBase64(bytes) {
|
|
1309
|
-
const toBase64 = Uint8Array.prototype.toBase64;
|
|
1310
|
-
if (typeof toBase64 === "function") return toBase64.call(bytes);
|
|
1311
|
-
if (typeof Buffer !== "undefined") return Buffer.from(bytes).toString("base64");
|
|
1312
|
-
let binary = "";
|
|
1313
|
-
for (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]);
|
|
1314
|
-
return btoa(binary);
|
|
1315
|
-
}
|
|
1316
|
-
const CRC_TABLE = new Int32Array(256);
|
|
1317
|
-
for (let i = 0; i < 256; i++) {
|
|
1318
|
-
let c = i;
|
|
1319
|
-
for (let k = 0; k < 8; k++) c = c & 1 ? c >>> 1 ^ -306674912 : c >>> 1;
|
|
1320
|
-
CRC_TABLE[i] = c;
|
|
1321
|
-
}
|
|
1322
|
-
try {
|
|
1323
|
-
const zlib = await import("node:zlib");
|
|
1324
|
-
if (typeof zlib.deflateRawSync !== "function") throw new Error("no native deflate");
|
|
1325
|
-
zlib.crc32;
|
|
1326
|
-
} catch {}
|
|
1327
|
-
new TextEncoder();
|
|
1328
|
-
/**
|
|
1329
|
-
* Preset color element for DrawingML.
|
|
1330
|
-
*
|
|
1331
|
-
* This module provides named preset colors (CSS named colors).
|
|
1332
|
-
*
|
|
1333
|
-
* Reference: ISO/IEC 29500-4, dml-main.xsd, CT_PresetColor / ST_PresetColorVal
|
|
1334
|
-
*
|
|
1335
|
-
* @module
|
|
1336
|
-
*/
|
|
1337
|
-
/**
|
|
1338
|
-
* Preset color values (CSS named colors).
|
|
1339
|
-
*
|
|
1340
|
-
* ## XSD Schema
|
|
1341
|
-
* ```xml
|
|
1342
|
-
* <xsd:simpleType name="ST_PresetColorVal">
|
|
1343
|
-
* <xsd:restriction base="xsd:token">
|
|
1344
|
-
* <xsd:enumeration value="aliceBlue"/>
|
|
1345
|
-
* ...
|
|
1346
|
-
* <xsd:enumeration value="yellowGreen"/>
|
|
1347
|
-
* </xsd:restriction>
|
|
1348
|
-
* </xsd:simpleType>
|
|
1349
|
-
* ```
|
|
1350
|
-
*/
|
|
1351
|
-
const PresetColor = {
|
|
1352
|
-
ALICE_BLUE: "aliceBlue",
|
|
1353
|
-
ANTIQUE_WHITE: "antiqueWhite",
|
|
1354
|
-
AQUA: "aqua",
|
|
1355
|
-
AQUAMARINE: "aquamarine",
|
|
1356
|
-
AZURE: "azure",
|
|
1357
|
-
BEIGE: "beige",
|
|
1358
|
-
BISQUE: "bisque",
|
|
1359
|
-
BLACK: "black",
|
|
1360
|
-
BLANCHED_ALMOND: "blanchedAlmond",
|
|
1361
|
-
BLUE: "blue",
|
|
1362
|
-
BLUE_VIOLET: "blueViolet",
|
|
1363
|
-
BROWN: "brown",
|
|
1364
|
-
BURLY_WOOD: "burlyWood",
|
|
1365
|
-
CADET_BLUE: "cadetBlue",
|
|
1366
|
-
CHARTREUSE: "chartreuse",
|
|
1367
|
-
CHOCOLATE: "chocolate",
|
|
1368
|
-
CORAL: "coral",
|
|
1369
|
-
CORNFLOWER_BLUE: "cornflowerBlue",
|
|
1370
|
-
CORNSILK: "cornsilk",
|
|
1371
|
-
CRIMSON: "crimson",
|
|
1372
|
-
CYAN: "cyan",
|
|
1373
|
-
DARK_BLUE: "darkBlue",
|
|
1374
|
-
DARK_CYAN: "darkCyan",
|
|
1375
|
-
DARK_GOLDENROD: "darkGoldenrod",
|
|
1376
|
-
DARK_GRAY: "darkGray",
|
|
1377
|
-
DARK_GREY: "darkGrey",
|
|
1378
|
-
DARK_GREEN: "darkGreen",
|
|
1379
|
-
DARK_KHAKI: "darkKhaki",
|
|
1380
|
-
DARK_MAGENTA: "darkMagenta",
|
|
1381
|
-
DARK_OLIVE_GREEN: "darkOliveGreen",
|
|
1382
|
-
DARK_ORANGE: "darkOrange",
|
|
1383
|
-
DARK_ORCHID: "darkOrchid",
|
|
1384
|
-
DARK_RED: "darkRed",
|
|
1385
|
-
DARK_SALMON: "darkSalmon",
|
|
1386
|
-
DARK_SEA_GREEN: "darkSeaGreen",
|
|
1387
|
-
DARK_SLATE_BLUE: "darkSlateBlue",
|
|
1388
|
-
DARK_SLATE_GRAY: "darkSlateGray",
|
|
1389
|
-
DARK_SLATE_GREY: "darkSlateGrey",
|
|
1390
|
-
DARK_TURQUOISE: "darkTurquoise",
|
|
1391
|
-
DARK_VIOLET: "darkViolet",
|
|
1392
|
-
DEEP_PINK: "deepPink",
|
|
1393
|
-
DEEP_SKY_BLUE: "deepSkyBlue",
|
|
1394
|
-
DIM_GRAY: "dimGray",
|
|
1395
|
-
DIM_GREY: "dimGrey",
|
|
1396
|
-
DODGER_BLUE: "dodgerBlue",
|
|
1397
|
-
FIREBRICK: "firebrick",
|
|
1398
|
-
FLORAL_WHITE: "floralWhite",
|
|
1399
|
-
FOREST_GREEN: "forestGreen",
|
|
1400
|
-
FUCHSIA: "fuchsia",
|
|
1401
|
-
GAINSBORO: "gainsboro",
|
|
1402
|
-
GHOST_WHITE: "ghostWhite",
|
|
1403
|
-
GOLD: "gold",
|
|
1404
|
-
GOLDENROD: "goldenrod",
|
|
1405
|
-
GRAY: "gray",
|
|
1406
|
-
GREY: "grey",
|
|
1407
|
-
GREEN: "green",
|
|
1408
|
-
GREEN_YELLOW: "greenYellow",
|
|
1409
|
-
HONEYDEW: "honeydew",
|
|
1410
|
-
HOT_PINK: "hotPink",
|
|
1411
|
-
INDIAN_RED: "indianRed",
|
|
1412
|
-
INDIGO: "indigo",
|
|
1413
|
-
IVORY: "ivory",
|
|
1414
|
-
KHAKI: "khaki",
|
|
1415
|
-
LAVENDER: "lavender",
|
|
1416
|
-
LAVENDER_BLUSH: "lavenderBlush",
|
|
1417
|
-
LAWN_GREEN: "lawnGreen",
|
|
1418
|
-
LEMON_CHIFFON: "lemonChiffon",
|
|
1419
|
-
LIGHT_BLUE: "lightBlue",
|
|
1420
|
-
LIGHT_CORAL: "lightCoral",
|
|
1421
|
-
LIGHT_CYAN: "lightCyan",
|
|
1422
|
-
LIGHT_GOLDENROD_YELLOW: "lightGoldenrodYellow",
|
|
1423
|
-
LIGHT_GRAY: "lightGray",
|
|
1424
|
-
LIGHT_GREY: "lightGrey",
|
|
1425
|
-
LIGHT_GREEN: "lightGreen",
|
|
1426
|
-
LIGHT_PINK: "lightPink",
|
|
1427
|
-
LIGHT_SALMON: "lightSalmon",
|
|
1428
|
-
LIGHT_SEA_GREEN: "lightSeaGreen",
|
|
1429
|
-
LIGHT_SKY_BLUE: "lightSkyBlue",
|
|
1430
|
-
LIGHT_SLATE_GRAY: "lightSlateGray",
|
|
1431
|
-
LIGHT_SLATE_GREY: "lightSlateGrey",
|
|
1432
|
-
LIGHT_STEEL_BLUE: "lightSteelBlue",
|
|
1433
|
-
LIGHT_YELLOW: "lightYellow",
|
|
1434
|
-
LIME: "lime",
|
|
1435
|
-
LIME_GREEN: "limeGreen",
|
|
1436
|
-
LINEN: "linen",
|
|
1437
|
-
MAGENTA: "magenta",
|
|
1438
|
-
MAROON: "maroon",
|
|
1439
|
-
MEDIUM_AQUAMARINE: "mediumAquamarine",
|
|
1440
|
-
MEDIUM_BLUE: "mediumBlue",
|
|
1441
|
-
MEDIUM_ORCHID: "mediumOrchid",
|
|
1442
|
-
MEDIUM_PURPLE: "mediumPurple",
|
|
1443
|
-
MEDIUM_SEA_GREEN: "mediumSeaGreen",
|
|
1444
|
-
MEDIUM_SLATE_BLUE: "mediumSlateBlue",
|
|
1445
|
-
MEDIUM_SPRING_GREEN: "mediumSpringGreen",
|
|
1446
|
-
MEDIUM_TURQUOISE: "mediumTurquoise",
|
|
1447
|
-
MEDIUM_VIOLET_RED: "mediumVioletRed",
|
|
1448
|
-
MIDNIGHT_BLUE: "midnightBlue",
|
|
1449
|
-
MINT_CREAM: "mintCream",
|
|
1450
|
-
MISTY_ROSE: "mistyRose",
|
|
1451
|
-
MOCCASIN: "moccasin",
|
|
1452
|
-
NAVAJO_WHITE: "navajoWhite",
|
|
1453
|
-
NAVY: "navy",
|
|
1454
|
-
OLD_LACE: "oldLace",
|
|
1455
|
-
OLIVE: "olive",
|
|
1456
|
-
OLIVE_DRAB: "oliveDrab",
|
|
1457
|
-
ORANGE: "orange",
|
|
1458
|
-
ORANGE_RED: "orangeRed",
|
|
1459
|
-
ORCHID: "orchid",
|
|
1460
|
-
PALE_GOLDENROD: "paleGoldenrod",
|
|
1461
|
-
PALE_GREEN: "paleGreen",
|
|
1462
|
-
PALE_TURQUOISE: "paleTurquoise",
|
|
1463
|
-
PALE_VIOLET_RED: "paleVioletRed",
|
|
1464
|
-
PAPAYA_WHIP: "papayaWhip",
|
|
1465
|
-
PEACH_PUFF: "peachPuff",
|
|
1466
|
-
PERU: "peru",
|
|
1467
|
-
PINK: "pink",
|
|
1468
|
-
PLUM: "plum",
|
|
1469
|
-
POWDER_BLUE: "powderBlue",
|
|
1470
|
-
PURPLE: "purple",
|
|
1471
|
-
RED: "red",
|
|
1472
|
-
ROSY_BROWN: "rosyBrown",
|
|
1473
|
-
ROYAL_BLUE: "royalBlue",
|
|
1474
|
-
SADDLE_BROWN: "saddleBrown",
|
|
1475
|
-
SALMON: "salmon",
|
|
1476
|
-
SANDY_BROWN: "sandyBrown",
|
|
1477
|
-
SEA_GREEN: "seaGreen",
|
|
1478
|
-
SEA_SHELL: "seaShell",
|
|
1479
|
-
SIENNA: "sienna",
|
|
1480
|
-
SILVER: "silver",
|
|
1481
|
-
SKY_BLUE: "skyBlue",
|
|
1482
|
-
SLATE_BLUE: "slateBlue",
|
|
1483
|
-
SLATE_GRAY: "slateGray",
|
|
1484
|
-
SLATE_GREY: "slateGrey",
|
|
1485
|
-
SNOW: "snow",
|
|
1486
|
-
SPRING_GREEN: "springGreen",
|
|
1487
|
-
STEEL_BLUE: "steelBlue",
|
|
1488
|
-
TAN: "tan",
|
|
1489
|
-
TEAL: "teal",
|
|
1490
|
-
THISTLE: "thistle",
|
|
1491
|
-
TOMATO: "tomato",
|
|
1492
|
-
TURQUOISE: "turquoise",
|
|
1493
|
-
VIOLET: "violet",
|
|
1494
|
-
WHEAT: "wheat",
|
|
1495
|
-
WHITE: "white",
|
|
1496
|
-
WHITE_SMOKE: "whiteSmoke",
|
|
1497
|
-
YELLOW: "yellow",
|
|
1498
|
-
YELLOW_GREEN: "yellowGreen"
|
|
1499
|
-
};
|
|
1500
|
-
/**
|
|
1501
|
-
* Scheme color element for DrawingML shapes.
|
|
1502
|
-
*
|
|
1503
|
-
* This module provides scheme-based color support for solid fills,
|
|
1504
|
-
* allowing colors to be defined using theme color schemes.
|
|
1505
|
-
*
|
|
1506
|
-
* Reference: ISO/IEC 29500-4, dml-main.xsd, CT_SchemeColor / ST_SchemeColorVal
|
|
1507
|
-
*
|
|
1508
|
-
* @module
|
|
1509
|
-
*/
|
|
1510
|
-
/**
|
|
1511
|
-
* Scheme color values for theme-based colors.
|
|
1512
|
-
*
|
|
1513
|
-
* These values reference colors defined in the document's color scheme/theme.
|
|
1514
|
-
*/
|
|
1515
|
-
const SchemeColor = {
|
|
1516
|
-
/** Background color 1 */
|
|
1517
|
-
BG1: "bg1",
|
|
1518
|
-
/** Text color 1 */
|
|
1519
|
-
TX1: "tx1",
|
|
1520
|
-
/** Background color 2 */
|
|
1521
|
-
BG2: "bg2",
|
|
1522
|
-
/** Text color 2 */
|
|
1523
|
-
TX2: "tx2",
|
|
1524
|
-
/** Accent color 1 */
|
|
1525
|
-
ACCENT1: "accent1",
|
|
1526
|
-
/** Accent color 2 */
|
|
1527
|
-
ACCENT2: "accent2",
|
|
1528
|
-
/** Accent color 3 */
|
|
1529
|
-
ACCENT3: "accent3",
|
|
1530
|
-
/** Accent color 4 */
|
|
1531
|
-
ACCENT4: "accent4",
|
|
1532
|
-
/** Accent color 5 */
|
|
1533
|
-
ACCENT5: "accent5",
|
|
1534
|
-
/** Accent color 6 */
|
|
1535
|
-
ACCENT6: "accent6",
|
|
1536
|
-
/** Hyperlink color */
|
|
1537
|
-
HLINK: "hlink",
|
|
1538
|
-
/** Followed hyperlink color */
|
|
1539
|
-
FOLHLINK: "folHlink",
|
|
1540
|
-
/** Dark color 1 */
|
|
1541
|
-
DK1: "dk1",
|
|
1542
|
-
/** Light color 1 */
|
|
1543
|
-
LT1: "lt1",
|
|
1544
|
-
/** Dark color 2 */
|
|
1545
|
-
DK2: "dk2",
|
|
1546
|
-
/** Light color 2 */
|
|
1547
|
-
LT2: "lt2",
|
|
1548
|
-
/** Placeholder color */
|
|
1549
|
-
PHCLR: "phClr"
|
|
1550
|
-
};
|
|
1551
|
-
/**
|
|
1552
|
-
* System color element for DrawingML.
|
|
1553
|
-
*
|
|
1554
|
-
* This module provides system color support, referencing OS-level UI colors.
|
|
1555
|
-
*
|
|
1556
|
-
* Reference: ISO/IEC 29500-4, dml-main.xsd, CT_SystemColor / ST_SystemColorVal
|
|
1557
|
-
*
|
|
1558
|
-
* @module
|
|
1559
|
-
*/
|
|
1560
|
-
/**
|
|
1561
|
-
* System color values referencing OS UI colors.
|
|
1562
|
-
*
|
|
1563
|
-
* ## XSD Schema
|
|
1564
|
-
* ```xml
|
|
1565
|
-
* <xsd:simpleType name="ST_SystemColorVal">
|
|
1566
|
-
* <xsd:restriction base="xsd:token">
|
|
1567
|
-
* <xsd:enumeration value="scrollBar"/>
|
|
1568
|
-
* <xsd:enumeration value="background"/>
|
|
1569
|
-
* ...
|
|
1570
|
-
* <xsd:enumeration value="menuBar"/>
|
|
1571
|
-
* </xsd:restriction>
|
|
1572
|
-
* </xsd:simpleType>
|
|
1573
|
-
* ```
|
|
1574
|
-
*/
|
|
1575
|
-
const SystemColor = {
|
|
1576
|
-
SCROLL_BAR: "scrollBar",
|
|
1577
|
-
BACKGROUND: "background",
|
|
1578
|
-
ACTIVE_CAPTION: "activeCaption",
|
|
1579
|
-
INACTIVE_CAPTION: "inactiveCaption",
|
|
1580
|
-
MENU: "menu",
|
|
1581
|
-
WINDOW: "window",
|
|
1582
|
-
WINDOW_FRAME: "windowFrame",
|
|
1583
|
-
MENU_TEXT: "menuText",
|
|
1584
|
-
WINDOW_TEXT: "windowText",
|
|
1585
|
-
CAPTION_TEXT: "captionText",
|
|
1586
|
-
ACTIVE_BORDER: "activeBorder",
|
|
1587
|
-
INACTIVE_BORDER: "inactiveBorder",
|
|
1588
|
-
APP_WORKSPACE: "appWorkspace",
|
|
1589
|
-
HIGHLIGHT: "highlight",
|
|
1590
|
-
HIGHLIGHT_TEXT: "highlightText",
|
|
1591
|
-
BTN_FACE: "btnFace",
|
|
1592
|
-
BTN_SHADOW: "btnShadow",
|
|
1593
|
-
GRAY_TEXT: "grayText",
|
|
1594
|
-
BTN_TEXT: "btnText",
|
|
1595
|
-
INACTIVE_CAPTION_TEXT: "inactiveCaptionText",
|
|
1596
|
-
BTN_HIGHLIGHT: "btnHighlight",
|
|
1597
|
-
THREE_D_DK_SHADOW: "3dDkShadow",
|
|
1598
|
-
THREE_D_LIGHT: "3dLight",
|
|
1599
|
-
INFO_TEXT: "infoText",
|
|
1600
|
-
INFO_BK: "infoBk",
|
|
1601
|
-
HOT_LIGHT: "hotLight",
|
|
1602
|
-
GRADIENT_ACTIVE_CAPTION: "gradientActiveCaption",
|
|
1603
|
-
GRADIENT_INACTIVE_CAPTION: "gradientInactiveCaption",
|
|
1604
|
-
MENU_HIGHLIGHT: "menuHighlight",
|
|
1605
|
-
MENU_BAR: "menuBar"
|
|
1606
|
-
};
|
|
1607
|
-
new Set(Object.values(SystemColor));
|
|
1608
|
-
new Set(Object.values(PresetColor));
|
|
1609
|
-
new Set(Object.values(SchemeColor));
|
|
1610
|
-
/**
|
|
1611
|
-
* Bidirectional mappings between user-friendly values and XSD abbreviated values.
|
|
1612
|
-
*
|
|
1613
|
-
* When XSD uses full English words (e.g. "center", "start"), values are used directly — no mapping needed.
|
|
1614
|
-
* When XSD uses abbreviations (e.g. "ctr", "l", "rnd"), this module maps them to full words.
|
|
1615
|
-
*
|
|
1616
|
-
* Usage in generation (Options → XML): xsdAlign.to("center") → "ctr"
|
|
1617
|
-
* Usage in parsing (XML → Options): xsdAlign.from("ctr") → "center"
|
|
1618
|
-
*/
|
|
1619
|
-
/** Invert a Record<K, V> into Record<V, K>. */
|
|
1620
|
-
function invertMap(map) {
|
|
1621
|
-
const result = {};
|
|
1622
|
-
for (const key of Object.keys(map)) result[map[key]] = key;
|
|
1623
|
-
return result;
|
|
1624
|
-
}
|
|
1625
|
-
/** Create a bidirectional mapping helper from a single forward map. */
|
|
1626
|
-
function bidi(forward) {
|
|
1627
|
-
const reverse = invertMap(forward);
|
|
1628
|
-
return {
|
|
1629
|
-
/** User-friendly value → XSD value */
|
|
1630
|
-
to: (key) => forward[key] ?? key,
|
|
1631
|
-
/** XSD value → user-friendly value */
|
|
1632
|
-
from: (xsd) => reverse[xsd] ?? xsd,
|
|
1633
|
-
/** The forward map (user → XSD) */
|
|
1634
|
-
forward,
|
|
1635
|
-
/** The reverse map (XSD → user) */
|
|
1636
|
-
reverse
|
|
1637
|
-
};
|
|
1638
|
-
}
|
|
1639
|
-
bidi({
|
|
1640
|
-
topLeft: "tl",
|
|
1641
|
-
top: "t",
|
|
1642
|
-
topRight: "tr",
|
|
1643
|
-
left: "l",
|
|
1644
|
-
center: "ctr",
|
|
1645
|
-
right: "r",
|
|
1646
|
-
bottomLeft: "bl",
|
|
1647
|
-
bottom: "b",
|
|
1648
|
-
bottomRight: "br"
|
|
1649
|
-
});
|
|
1650
|
-
bidi({
|
|
1651
|
-
left: "l",
|
|
1652
|
-
center: "ctr",
|
|
1653
|
-
right: "r",
|
|
1654
|
-
justify: "just"
|
|
1655
|
-
});
|
|
1656
|
-
bidi({
|
|
1657
|
-
top: "t",
|
|
1658
|
-
center: "ctr",
|
|
1659
|
-
bottom: "b",
|
|
1660
|
-
justify: "just",
|
|
1661
|
-
distribute: "dist"
|
|
1662
|
-
});
|
|
1663
|
-
bidi({
|
|
1664
|
-
round: "rnd",
|
|
1665
|
-
square: "sq",
|
|
1666
|
-
flat: "flat"
|
|
1667
|
-
});
|
|
1668
|
-
bidi({
|
|
1669
|
-
single: "sng",
|
|
1670
|
-
double: "dbl",
|
|
1671
|
-
thickThin: "thickThin",
|
|
1672
|
-
thinThick: "thinThick",
|
|
1673
|
-
triple: "tri"
|
|
1674
|
-
});
|
|
1675
|
-
bidi({
|
|
1676
|
-
center: "ctr",
|
|
1677
|
-
inside: "in"
|
|
1678
|
-
});
|
|
1679
|
-
bidi({
|
|
1680
|
-
small: "sm",
|
|
1681
|
-
medium: "med",
|
|
1682
|
-
large: "lg"
|
|
1683
|
-
});
|
|
1684
|
-
bidi({
|
|
1685
|
-
over: "over",
|
|
1686
|
-
multiply: "mult",
|
|
1687
|
-
screen: "screen",
|
|
1688
|
-
darken: "darken",
|
|
1689
|
-
lighten: "lighten"
|
|
1690
|
-
});
|
|
1691
|
-
bidi({
|
|
1692
|
-
none: "none",
|
|
1693
|
-
normal: "norm",
|
|
1694
|
-
lighten: "lighten",
|
|
1695
|
-
lightenLess: "lightenLess",
|
|
1696
|
-
darken: "darken",
|
|
1697
|
-
darkenLess: "darkenLess"
|
|
1698
|
-
});
|
|
1699
|
-
bidi({
|
|
1700
|
-
sibling: "sib",
|
|
1701
|
-
tree: "tree"
|
|
1702
|
-
});
|
|
1703
|
-
bidi({
|
|
1704
|
-
shadow1: "shdw1",
|
|
1705
|
-
shadow2: "shdw2",
|
|
1706
|
-
shadow3: "shdw3",
|
|
1707
|
-
shadow4: "shdw4",
|
|
1708
|
-
shadow5: "shdw5",
|
|
1709
|
-
shadow6: "shdw6",
|
|
1710
|
-
shadow7: "shdw7",
|
|
1711
|
-
shadow8: "shdw8",
|
|
1712
|
-
shadow9: "shdw9",
|
|
1713
|
-
shadow10: "shdw10",
|
|
1714
|
-
shadow11: "shdw11",
|
|
1715
|
-
shadow12: "shdw12",
|
|
1716
|
-
shadow13: "shdw13",
|
|
1717
|
-
shadow14: "shdw14",
|
|
1718
|
-
shadow15: "shdw15",
|
|
1719
|
-
shadow16: "shdw16",
|
|
1720
|
-
shadow17: "shdw17",
|
|
1721
|
-
shadow18: "shdw18",
|
|
1722
|
-
shadow19: "shdw19",
|
|
1723
|
-
shadow20: "shdw20"
|
|
1724
|
-
});
|
|
1725
|
-
bidi({
|
|
1726
|
-
legacyMatte: "legacyMatte",
|
|
1727
|
-
legacyPlastic: "legacyPlastic",
|
|
1728
|
-
legacyMetal: "legacyMetal",
|
|
1729
|
-
legacyWireframe: "legacyWireframe",
|
|
1730
|
-
matte: "matte",
|
|
1731
|
-
plastic: "plastic",
|
|
1732
|
-
metal: "metal",
|
|
1733
|
-
warmMatte: "warmMatte",
|
|
1734
|
-
translucentPowder: "translucentPowder",
|
|
1735
|
-
powder: "powder",
|
|
1736
|
-
darkEdge: "dkEdge",
|
|
1737
|
-
softEdge: "softEdge",
|
|
1738
|
-
clear: "clear",
|
|
1739
|
-
flat: "flat",
|
|
1740
|
-
softMetal: "softmetal"
|
|
1741
|
-
});
|
|
1742
|
-
bidi({
|
|
1743
|
-
percent5: "pct5",
|
|
1744
|
-
percent10: "pct10",
|
|
1745
|
-
percent20: "pct20",
|
|
1746
|
-
percent25: "pct25",
|
|
1747
|
-
percent30: "pct30",
|
|
1748
|
-
percent40: "pct40",
|
|
1749
|
-
percent50: "pct50",
|
|
1750
|
-
percent60: "pct60",
|
|
1751
|
-
percent70: "pct70",
|
|
1752
|
-
percent75: "pct75",
|
|
1753
|
-
percent80: "pct80",
|
|
1754
|
-
percent90: "pct90",
|
|
1755
|
-
horizontal: "horz",
|
|
1756
|
-
vertical: "vert",
|
|
1757
|
-
lightHorizontal: "ltHorz",
|
|
1758
|
-
lightVertical: "ltVert",
|
|
1759
|
-
darkHorizontal: "dkHorz",
|
|
1760
|
-
darkVertical: "dkVert",
|
|
1761
|
-
narrowHorizontal: "narHorz",
|
|
1762
|
-
narrowVertical: "narVert",
|
|
1763
|
-
dashedHorizontal: "dashHorz",
|
|
1764
|
-
dashedVertical: "dashVert",
|
|
1765
|
-
cross: "cross",
|
|
1766
|
-
downDiagonal: "dnDiag",
|
|
1767
|
-
upDiagonal: "upDiag",
|
|
1768
|
-
lightDownDiagonal: "ltDnDiag",
|
|
1769
|
-
lightUpDiagonal: "ltUpDiag",
|
|
1770
|
-
darkDownDiagonal: "dkDnDiag",
|
|
1771
|
-
darkUpDiagonal: "dkUpDiag",
|
|
1772
|
-
wideDownDiagonal: "wdDnDiag",
|
|
1773
|
-
wideUpDiagonal: "wdUpDiag",
|
|
1774
|
-
dashedDownDiagonal: "dashDnDiag",
|
|
1775
|
-
dashedUpDiagonal: "dashUpDiag",
|
|
1776
|
-
diagonalCross: "diagCross",
|
|
1777
|
-
smallChecker: "smCheck",
|
|
1778
|
-
largeChecker: "lgCheck",
|
|
1779
|
-
smallGrid: "smGrid",
|
|
1780
|
-
largeGrid: "lgGrid",
|
|
1781
|
-
dotGrid: "dotGrid",
|
|
1782
|
-
smallConfetti: "smConfetti",
|
|
1783
|
-
largeConfetti: "lgConfetti",
|
|
1784
|
-
horizontalBrick: "horzBrick",
|
|
1785
|
-
diagonalBrick: "diagBrick",
|
|
1786
|
-
solidDiamond: "solidDmnd",
|
|
1787
|
-
openDiamond: "openDmnd",
|
|
1788
|
-
dottedDiamond: "dotDmnd",
|
|
1789
|
-
plaid: "plaid",
|
|
1790
|
-
sphere: "sphere",
|
|
1791
|
-
weave: "weave",
|
|
1792
|
-
divot: "divot",
|
|
1793
|
-
shingle: "shingle",
|
|
1794
|
-
wave: "wave",
|
|
1795
|
-
trellis: "trellis",
|
|
1796
|
-
zigZag: "zigZag"
|
|
1797
|
-
});
|
|
1798
|
-
bidi({
|
|
1799
|
-
continue: "cont",
|
|
1800
|
-
restart: "rest"
|
|
1801
|
-
});
|
|
1802
|
-
bidi({
|
|
1803
|
-
single: "sng",
|
|
1804
|
-
double: "dbl",
|
|
1805
|
-
none: "none"
|
|
1806
|
-
});
|
|
1807
|
-
bidi({
|
|
1808
|
-
singleStrike: "sngStrike",
|
|
1809
|
-
doubleStrike: "dblStrike",
|
|
1810
|
-
noStrike: "noStrike"
|
|
1811
|
-
});
|
|
1812
|
-
bidi({
|
|
1813
|
-
none: "none",
|
|
1814
|
-
all: "all",
|
|
1815
|
-
small: "small"
|
|
1816
|
-
});
|
|
1817
|
-
Object.fromEntries(Object.entries({
|
|
1818
|
-
tblBg: "a:tblBg",
|
|
1819
|
-
wholeTbl: "a:wholeTbl",
|
|
1820
|
-
band1H: "a:band1H",
|
|
1821
|
-
band2H: "a:band2H",
|
|
1822
|
-
band1V: "a:band1V",
|
|
1823
|
-
band2V: "a:band2V",
|
|
1824
|
-
lastCol: "a:lastCol",
|
|
1825
|
-
firstCol: "a:firstCol",
|
|
1826
|
-
lastRow: "a:lastRow",
|
|
1827
|
-
seCell: "a:seCell",
|
|
1828
|
-
swCell: "a:swCell",
|
|
1829
|
-
firstRow: "a:firstRow",
|
|
1830
|
-
neCell: "a:neCell",
|
|
1831
|
-
nwCell: "a:nwCell"
|
|
1832
|
-
}).map(([region, name]) => [name, region]));
|
|
1833
|
-
new Set(Object.values(SystemColor));
|
|
1834
|
-
new Set(Object.values(PresetColor));
|
|
1835
|
-
new Set(Object.values(SchemeColor));
|
|
1836
|
-
new TextEncoder();
|
|
1837
|
-
//#endregion
|
|
1838
|
-
export { encodeBase64 as t };
|