pdfmake 0.3.8 → 0.3.10
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/CHANGELOG.md +8 -0
- package/build/pdfmake.js +616 -368
- package/build/pdfmake.js.map +1 -1
- package/build/pdfmake.min.js +2 -2
- package/build/pdfmake.min.js.map +1 -1
- package/js/DocumentContext.js +12 -10
- package/package.json +11 -11
- package/src/DocumentContext.js +17 -13
package/build/pdfmake.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! pdfmake v0.3.
|
|
1
|
+
/*! pdfmake v0.3.10, @license MIT, @link http://pdfmake.org */
|
|
2
2
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
3
3
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
4
4
|
module.exports = factory();
|
|
@@ -25,7 +25,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
25
25
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.includes.js
|
|
26
26
|
var es_array_includes = __webpack_require__(187);
|
|
27
27
|
// EXTERNAL MODULE: ./node_modules/pdfkit/js/pdfkit.es.js
|
|
28
|
-
var pdfkit_es = __webpack_require__(
|
|
28
|
+
var pdfkit_es = __webpack_require__(7101);
|
|
29
29
|
;// ./src/helpers/variableType.js
|
|
30
30
|
/**
|
|
31
31
|
* @param {any} variable
|
|
@@ -4435,6 +4435,7 @@ class DocumentContext extends events.EventEmitter {
|
|
|
4435
4435
|
let maxBottomY = this.y;
|
|
4436
4436
|
let maxBottomPage = this.page;
|
|
4437
4437
|
let maxBottomAvailableHeight = this.availableHeight;
|
|
4438
|
+
let overflowed = saved.overflowed;
|
|
4438
4439
|
|
|
4439
4440
|
// Pop overflowed snapshots created by moveToNextColumn (snaking columns).
|
|
4440
4441
|
// Merge their bottomMost values to find the true maximum.
|
|
@@ -4452,16 +4453,17 @@ class DocumentContext extends events.EventEmitter {
|
|
|
4452
4453
|
if (!saved) {
|
|
4453
4454
|
return {};
|
|
4454
4455
|
}
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4456
|
+
if (overflowed) {
|
|
4457
|
+
// Apply the max bottom from all overflowed columns to this base snapshot
|
|
4458
|
+
if (maxBottomPage > saved.bottomMost.page || maxBottomPage === saved.bottomMost.page && maxBottomY > saved.bottomMost.y) {
|
|
4459
|
+
saved.bottomMost = {
|
|
4460
|
+
x: saved.x,
|
|
4461
|
+
y: maxBottomY,
|
|
4462
|
+
page: maxBottomPage,
|
|
4463
|
+
availableHeight: maxBottomAvailableHeight,
|
|
4464
|
+
availableWidth: saved.availableWidth
|
|
4465
|
+
};
|
|
4466
|
+
}
|
|
4465
4467
|
}
|
|
4466
4468
|
this.calculateBottomMost(saved, endingCell);
|
|
4467
4469
|
this.x = saved.x;
|
|
@@ -8755,7 +8757,7 @@ class OutputDocument {
|
|
|
8755
8757
|
}
|
|
8756
8758
|
/* harmony default export */ const src_OutputDocument = (OutputDocument);
|
|
8757
8759
|
// EXTERNAL MODULE: ./node_modules/file-saver/dist/FileSaver.min.js
|
|
8758
|
-
var FileSaver_min = __webpack_require__(
|
|
8760
|
+
var FileSaver_min = __webpack_require__(1438);
|
|
8759
8761
|
;// ./src/browser-extensions/OutputDocumentBrowser.js
|
|
8760
8762
|
|
|
8761
8763
|
|
|
@@ -15284,7 +15286,7 @@ module.exports = {
|
|
|
15284
15286
|
|
|
15285
15287
|
/***/ },
|
|
15286
15288
|
|
|
15287
|
-
/***/
|
|
15289
|
+
/***/ 7101
|
|
15288
15290
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
15289
15291
|
|
|
15290
15292
|
"use strict";
|
|
@@ -15305,13 +15307,11 @@ var _stream = _interopRequireDefault(__webpack_require__(9760));
|
|
|
15305
15307
|
var _zlib = _interopRequireDefault(__webpack_require__(6729));
|
|
15306
15308
|
var _utils = __webpack_require__(3973);
|
|
15307
15309
|
var _jsMd = _interopRequireDefault(__webpack_require__(1632));
|
|
15308
|
-
var _sha = __webpack_require__(
|
|
15310
|
+
var _sha = __webpack_require__(2650);
|
|
15309
15311
|
var _aes = __webpack_require__(2651);
|
|
15310
|
-
var
|
|
15311
|
-
var _events = __webpack_require__(4785);
|
|
15312
|
+
var _fontkit = __webpack_require__(1715);
|
|
15312
15313
|
var _linebreak = _interopRequireDefault(__webpack_require__(2532));
|
|
15313
15314
|
var _pngJs = _interopRequireDefault(__webpack_require__(381));
|
|
15314
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15315
15315
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15316
15316
|
var fs = __webpack_require__(2416);
|
|
15317
15317
|
class PDFAbstractReference {
|
|
@@ -15320,8 +15320,10 @@ class PDFAbstractReference {
|
|
|
15320
15320
|
}
|
|
15321
15321
|
}
|
|
15322
15322
|
class PDFTree {
|
|
15323
|
-
constructor() {
|
|
15324
|
-
|
|
15323
|
+
constructor(options) {
|
|
15324
|
+
if (options === void 0) {
|
|
15325
|
+
options = {};
|
|
15326
|
+
}
|
|
15325
15327
|
this._items = {};
|
|
15326
15328
|
this.limits = typeof options.limits === 'boolean' ? options.limits : true;
|
|
15327
15329
|
}
|
|
@@ -15362,7 +15364,7 @@ class SpotColor {
|
|
|
15362
15364
|
this.id = 'CS' + Object.keys(doc.spotColors).length;
|
|
15363
15365
|
this.name = name;
|
|
15364
15366
|
this.values = [C, M, Y, K];
|
|
15365
|
-
this.ref = doc.ref(['Separation', this.name, 'DeviceCMYK', {
|
|
15367
|
+
this.ref = doc.ref(['Separation', escapeName(this.name), 'DeviceCMYK', {
|
|
15366
15368
|
Range: [0, 1, 0, 1, 0, 1, 0, 1],
|
|
15367
15369
|
C0: [0, 0, 0, 0],
|
|
15368
15370
|
C1: this.values.map(value => value / 100),
|
|
@@ -15377,6 +15379,10 @@ class SpotColor {
|
|
|
15377
15379
|
}
|
|
15378
15380
|
}
|
|
15379
15381
|
const pad = (str, length) => (Array(length + 1).join('0') + str).slice(-length);
|
|
15382
|
+
const isSafeCharCode = code => {
|
|
15383
|
+
if (code > 0x7f) return true;
|
|
15384
|
+
return code > 0x20 && code !== 0x7f && code !== 0x23 && code !== 0x25 && code !== 0x28 && code !== 0x29 && code !== 0x2f && code !== 0x3c && code !== 0x3e && code !== 0x5b && code !== 0x5d && code !== 0x7b && code !== 0x7d;
|
|
15385
|
+
};
|
|
15380
15386
|
const escapableRe = /[\n\r\t\b\f()\\]/g;
|
|
15381
15387
|
const escapable = {
|
|
15382
15388
|
'\n': '\\n',
|
|
@@ -15388,6 +15394,18 @@ const escapable = {
|
|
|
15388
15394
|
'(': '\\(',
|
|
15389
15395
|
')': '\\)'
|
|
15390
15396
|
};
|
|
15397
|
+
const escapeName = function (name) {
|
|
15398
|
+
let escapedName = '';
|
|
15399
|
+
for (const char of name) {
|
|
15400
|
+
const code = char.charCodeAt(0);
|
|
15401
|
+
if (isSafeCharCode(code)) {
|
|
15402
|
+
escapedName += char;
|
|
15403
|
+
} else {
|
|
15404
|
+
escapedName += `#${code.toString(16).toUpperCase().padStart(2, '0')}`;
|
|
15405
|
+
}
|
|
15406
|
+
}
|
|
15407
|
+
return escapedName;
|
|
15408
|
+
};
|
|
15391
15409
|
const swapBytes = function (buff) {
|
|
15392
15410
|
const l = buff.length;
|
|
15393
15411
|
if (l & 0x01) {
|
|
@@ -15402,8 +15420,10 @@ const swapBytes = function (buff) {
|
|
|
15402
15420
|
return buff;
|
|
15403
15421
|
};
|
|
15404
15422
|
class PDFObject {
|
|
15405
|
-
static convert(object) {
|
|
15406
|
-
|
|
15423
|
+
static convert(object, encryptFn) {
|
|
15424
|
+
if (encryptFn === void 0) {
|
|
15425
|
+
encryptFn = null;
|
|
15426
|
+
}
|
|
15407
15427
|
if (typeof object === 'string') {
|
|
15408
15428
|
return `/${object}`;
|
|
15409
15429
|
} else if (object instanceof String) {
|
|
@@ -15464,8 +15484,10 @@ class PDFObject {
|
|
|
15464
15484
|
}
|
|
15465
15485
|
}
|
|
15466
15486
|
class PDFReference extends PDFAbstractReference {
|
|
15467
|
-
constructor(document, id) {
|
|
15468
|
-
|
|
15487
|
+
constructor(document, id, data) {
|
|
15488
|
+
if (data === void 0) {
|
|
15489
|
+
data = {};
|
|
15490
|
+
}
|
|
15469
15491
|
super();
|
|
15470
15492
|
this.document = document;
|
|
15471
15493
|
this.id = id;
|
|
@@ -15536,9 +15558,13 @@ function PDFNumber(n) {
|
|
|
15536
15558
|
}
|
|
15537
15559
|
return fArray[0];
|
|
15538
15560
|
}
|
|
15539
|
-
function normalizeSides(sides) {
|
|
15540
|
-
|
|
15541
|
-
|
|
15561
|
+
function normalizeSides(sides, defaultDefinition, transformer) {
|
|
15562
|
+
if (defaultDefinition === void 0) {
|
|
15563
|
+
defaultDefinition = undefined;
|
|
15564
|
+
}
|
|
15565
|
+
if (transformer === void 0) {
|
|
15566
|
+
transformer = v => v;
|
|
15567
|
+
}
|
|
15542
15568
|
if (sides == null || typeof sides === 'object' && Object.keys(sides).length === 0) {
|
|
15543
15569
|
sides = defaultDefinition;
|
|
15544
15570
|
}
|
|
@@ -15657,8 +15683,10 @@ const SIZES = {
|
|
|
15657
15683
|
TABLOID: [792.0, 1224.0]
|
|
15658
15684
|
};
|
|
15659
15685
|
class PDFPage {
|
|
15660
|
-
constructor(document) {
|
|
15661
|
-
|
|
15686
|
+
constructor(document, options) {
|
|
15687
|
+
if (options === void 0) {
|
|
15688
|
+
options = {};
|
|
15689
|
+
}
|
|
15662
15690
|
this.document = document;
|
|
15663
15691
|
this._options = options;
|
|
15664
15692
|
this.size = options.size || 'letter';
|
|
@@ -15760,8 +15788,10 @@ function md5Hex(data) {
|
|
|
15760
15788
|
function sha256Hash(data) {
|
|
15761
15789
|
return (0, _sha.sha256)(data);
|
|
15762
15790
|
}
|
|
15763
|
-
function aesCbcEncrypt(data, key, iv) {
|
|
15764
|
-
|
|
15791
|
+
function aesCbcEncrypt(data, key, iv, padding) {
|
|
15792
|
+
if (padding === void 0) {
|
|
15793
|
+
padding = true;
|
|
15794
|
+
}
|
|
15765
15795
|
return (0, _aes.cbc)(key, iv, {
|
|
15766
15796
|
disablePadding: !padding
|
|
15767
15797
|
}).encrypt(data);
|
|
@@ -15779,28 +15809,24 @@ function rc4(data, key) {
|
|
|
15779
15809
|
let j = 0;
|
|
15780
15810
|
for (let i = 0; i < 256; i++) {
|
|
15781
15811
|
j = j + s[i] + key[i % key.length] & 0xff;
|
|
15782
|
-
var
|
|
15783
|
-
s[i] =
|
|
15784
|
-
s[j] =
|
|
15812
|
+
var _ref = [s[j], s[i]];
|
|
15813
|
+
s[i] = _ref[0];
|
|
15814
|
+
s[j] = _ref[1];
|
|
15785
15815
|
}
|
|
15786
15816
|
const output = new Uint8Array(data.length);
|
|
15787
15817
|
for (let i = 0, j = 0, k = 0; k < data.length; k++) {
|
|
15788
15818
|
i = i + 1 & 0xff;
|
|
15789
15819
|
j = j + s[i] & 0xff;
|
|
15790
|
-
var
|
|
15791
|
-
s[i] =
|
|
15792
|
-
s[j] =
|
|
15820
|
+
var _ref2 = [s[j], s[i]];
|
|
15821
|
+
s[i] = _ref2[0];
|
|
15822
|
+
s[j] = _ref2[1];
|
|
15793
15823
|
output[k] = data[k] ^ s[s[i] + s[j] & 0xff];
|
|
15794
15824
|
}
|
|
15795
15825
|
return output;
|
|
15796
15826
|
}
|
|
15797
15827
|
function randomBytes(length) {
|
|
15798
15828
|
const bytes = new Uint8Array(length);
|
|
15799
|
-
|
|
15800
|
-
globalThis.crypto.getRandomValues(bytes);
|
|
15801
|
-
} else {
|
|
15802
|
-
(__webpack_require__(5470).randomFillSync)(bytes);
|
|
15803
|
-
}
|
|
15829
|
+
globalThis.crypto.getRandomValues(bytes);
|
|
15804
15830
|
return bytes;
|
|
15805
15831
|
}
|
|
15806
15832
|
function inRange(value, rangeGroup) {
|
|
@@ -15857,8 +15883,10 @@ function toCodePoints(input) {
|
|
|
15857
15883
|
}
|
|
15858
15884
|
return codepoints;
|
|
15859
15885
|
}
|
|
15860
|
-
function saslprep(input) {
|
|
15861
|
-
|
|
15886
|
+
function saslprep(input, opts) {
|
|
15887
|
+
if (opts === void 0) {
|
|
15888
|
+
opts = {};
|
|
15889
|
+
}
|
|
15862
15890
|
if (typeof input !== 'string') {
|
|
15863
15891
|
throw new TypeError('Expected string.');
|
|
15864
15892
|
}
|
|
@@ -15891,8 +15919,10 @@ function saslprep(input) {
|
|
|
15891
15919
|
return normalized_input;
|
|
15892
15920
|
}
|
|
15893
15921
|
class PDFSecurity {
|
|
15894
|
-
static generateFileID() {
|
|
15895
|
-
|
|
15922
|
+
static generateFileID(info) {
|
|
15923
|
+
if (info === void 0) {
|
|
15924
|
+
info = {};
|
|
15925
|
+
}
|
|
15896
15926
|
let infoStr = `${info.CreationDate.getTime()}\n`;
|
|
15897
15927
|
for (let key in info) {
|
|
15898
15928
|
if (!info.hasOwnProperty(key)) {
|
|
@@ -15905,15 +15935,19 @@ class PDFSecurity {
|
|
|
15905
15935
|
static generateRandomWordArray(bytes) {
|
|
15906
15936
|
return randomBytes(bytes);
|
|
15907
15937
|
}
|
|
15908
|
-
static create(document) {
|
|
15909
|
-
|
|
15938
|
+
static create(document, options) {
|
|
15939
|
+
if (options === void 0) {
|
|
15940
|
+
options = {};
|
|
15941
|
+
}
|
|
15910
15942
|
if (!options.ownerPassword && !options.userPassword) {
|
|
15911
15943
|
return null;
|
|
15912
15944
|
}
|
|
15913
15945
|
return new PDFSecurity(document, options);
|
|
15914
15946
|
}
|
|
15915
|
-
constructor(document) {
|
|
15916
|
-
|
|
15947
|
+
constructor(document, options) {
|
|
15948
|
+
if (options === void 0) {
|
|
15949
|
+
options = {};
|
|
15950
|
+
}
|
|
15917
15951
|
if (!options.ownerPassword && !options.userPassword) {
|
|
15918
15952
|
throw new Error('None of owner password and user password is defined.');
|
|
15919
15953
|
}
|
|
@@ -16062,8 +16096,10 @@ class PDFSecurity {
|
|
|
16062
16096
|
this.dictionary.end();
|
|
16063
16097
|
}
|
|
16064
16098
|
}
|
|
16065
|
-
function getPermissionsR2() {
|
|
16066
|
-
|
|
16099
|
+
function getPermissionsR2(permissionObject) {
|
|
16100
|
+
if (permissionObject === void 0) {
|
|
16101
|
+
permissionObject = {};
|
|
16102
|
+
}
|
|
16067
16103
|
let permissions = 0xffffffc0 >> 0;
|
|
16068
16104
|
if (permissionObject.printing) {
|
|
16069
16105
|
permissions |= 0b000000000100;
|
|
@@ -16079,8 +16115,10 @@ function getPermissionsR2() {
|
|
|
16079
16115
|
}
|
|
16080
16116
|
return permissions;
|
|
16081
16117
|
}
|
|
16082
|
-
function getPermissionsR3() {
|
|
16083
|
-
|
|
16118
|
+
function getPermissionsR3(permissionObject) {
|
|
16119
|
+
if (permissionObject === void 0) {
|
|
16120
|
+
permissionObject = {};
|
|
16121
|
+
}
|
|
16084
16122
|
let permissions = 0xfffff0c0 >> 0;
|
|
16085
16123
|
if (permissionObject.printing === 'lowResolution') {
|
|
16086
16124
|
permissions |= 0b000000000100;
|
|
@@ -16198,8 +16236,10 @@ function getEncryptedPermissionsR5(permissions, encryptionKey, generateRandomWor
|
|
|
16198
16236
|
data.set(randomPart, 12);
|
|
16199
16237
|
return aesEcbEncrypt(data, encryptionKey);
|
|
16200
16238
|
}
|
|
16201
|
-
function processPasswordR2R3R4() {
|
|
16202
|
-
|
|
16239
|
+
function processPasswordR2R3R4(password) {
|
|
16240
|
+
if (password === void 0) {
|
|
16241
|
+
password = '';
|
|
16242
|
+
}
|
|
16203
16243
|
const out = new Uint8Array(32);
|
|
16204
16244
|
const length = password.length;
|
|
16205
16245
|
let index = 0;
|
|
@@ -16217,8 +16257,10 @@ function processPasswordR2R3R4() {
|
|
|
16217
16257
|
}
|
|
16218
16258
|
return out;
|
|
16219
16259
|
}
|
|
16220
|
-
function processPasswordR5() {
|
|
16221
|
-
|
|
16260
|
+
function processPasswordR5(password) {
|
|
16261
|
+
if (password === void 0) {
|
|
16262
|
+
password = '';
|
|
16263
|
+
}
|
|
16222
16264
|
password = unescape(encodeURIComponent(saslprep(password)));
|
|
16223
16265
|
const length = Math.min(127, password.length);
|
|
16224
16266
|
const out = new Uint8Array(length);
|
|
@@ -16229,7 +16271,7 @@ function processPasswordR5() {
|
|
|
16229
16271
|
}
|
|
16230
16272
|
const PASSWORD_PADDING = [0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, 0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08, 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80, 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a];
|
|
16231
16273
|
const number$2 = PDFObject.number;
|
|
16232
|
-
|
|
16274
|
+
let PDFGradient$1 = class PDFGradient {
|
|
16233
16275
|
constructor(doc) {
|
|
16234
16276
|
this.doc = doc;
|
|
16235
16277
|
this.stops = [];
|
|
@@ -16399,8 +16441,8 @@ class PDFGradient$1 {
|
|
|
16399
16441
|
const op = stroke ? 'SCN' : 'scn';
|
|
16400
16442
|
return this.doc.addContent(`/${this.id} ${op}`);
|
|
16401
16443
|
}
|
|
16402
|
-
}
|
|
16403
|
-
|
|
16444
|
+
};
|
|
16445
|
+
let PDFLinearGradient$1 = class PDFLinearGradient extends PDFGradient$1 {
|
|
16404
16446
|
constructor(doc, x1, y1, x2, y2) {
|
|
16405
16447
|
super(doc);
|
|
16406
16448
|
this.x1 = x1;
|
|
@@ -16418,10 +16460,10 @@ class PDFLinearGradient$1 extends PDFGradient$1 {
|
|
|
16418
16460
|
});
|
|
16419
16461
|
}
|
|
16420
16462
|
opacityGradient() {
|
|
16421
|
-
return new PDFLinearGradient
|
|
16463
|
+
return new PDFLinearGradient(this.doc, this.x1, this.y1, this.x2, this.y2);
|
|
16422
16464
|
}
|
|
16423
|
-
}
|
|
16424
|
-
|
|
16465
|
+
};
|
|
16466
|
+
let PDFRadialGradient$1 = class PDFRadialGradient extends PDFGradient$1 {
|
|
16425
16467
|
constructor(doc, x1, y1, r1, x2, y2, r2) {
|
|
16426
16468
|
super(doc);
|
|
16427
16469
|
this.doc = doc;
|
|
@@ -16442,16 +16484,16 @@ class PDFRadialGradient$1 extends PDFGradient$1 {
|
|
|
16442
16484
|
});
|
|
16443
16485
|
}
|
|
16444
16486
|
opacityGradient() {
|
|
16445
|
-
return new PDFRadialGradient
|
|
16487
|
+
return new PDFRadialGradient(this.doc, this.x1, this.y1, this.r1, this.x2, this.y2, this.r2);
|
|
16446
16488
|
}
|
|
16447
|
-
}
|
|
16489
|
+
};
|
|
16448
16490
|
var Gradient = {
|
|
16449
16491
|
PDFGradient: PDFGradient$1,
|
|
16450
16492
|
PDFLinearGradient: PDFLinearGradient$1,
|
|
16451
16493
|
PDFRadialGradient: PDFRadialGradient$1
|
|
16452
16494
|
};
|
|
16453
16495
|
const underlyingColorSpaces = ['DeviceCMYK', 'DeviceRGB'];
|
|
16454
|
-
|
|
16496
|
+
let PDFTilingPattern$1 = class PDFTilingPattern {
|
|
16455
16497
|
constructor(doc, bBox, xStep, yStep, stream) {
|
|
16456
16498
|
this.doc = doc;
|
|
16457
16499
|
this.bBox = bBox;
|
|
@@ -16522,7 +16564,7 @@ class PDFTilingPattern$1 {
|
|
|
16522
16564
|
const op = stroke ? 'SCN' : 'scn';
|
|
16523
16565
|
return this.doc.addContent(`${normalizedColor.join(' ')} /${this.id} ${op}`);
|
|
16524
16566
|
}
|
|
16525
|
-
}
|
|
16567
|
+
};
|
|
16526
16568
|
var pattern = {
|
|
16527
16569
|
PDFTilingPattern: PDFTilingPattern$1
|
|
16528
16570
|
};
|
|
@@ -17306,8 +17348,10 @@ var VectorMixin = {
|
|
|
17306
17348
|
miterLimit(m) {
|
|
17307
17349
|
return this.addContent(`${number$1(m)} M`);
|
|
17308
17350
|
},
|
|
17309
|
-
dash(length) {
|
|
17310
|
-
|
|
17351
|
+
dash(length, options) {
|
|
17352
|
+
if (options === void 0) {
|
|
17353
|
+
options = {};
|
|
17354
|
+
}
|
|
17311
17355
|
const originalLength = length;
|
|
17312
17356
|
if (!Array.isArray(length)) {
|
|
17313
17357
|
length = [length, options.space || length];
|
|
@@ -17337,21 +17381,42 @@ var VectorMixin = {
|
|
|
17337
17381
|
rect(x, y, w, h) {
|
|
17338
17382
|
return this.addContent(`${number$1(x)} ${number$1(y)} ${number$1(w)} ${number$1(h)} re`);
|
|
17339
17383
|
},
|
|
17340
|
-
roundedRect(x, y, w, h,
|
|
17341
|
-
if (
|
|
17342
|
-
|
|
17343
|
-
}
|
|
17344
|
-
|
|
17345
|
-
|
|
17346
|
-
|
|
17347
|
-
|
|
17348
|
-
|
|
17349
|
-
|
|
17350
|
-
|
|
17351
|
-
|
|
17352
|
-
|
|
17353
|
-
|
|
17354
|
-
|
|
17384
|
+
roundedRect(x, y, w, h, borderRadius) {
|
|
17385
|
+
if (borderRadius == null) {
|
|
17386
|
+
borderRadius = 0;
|
|
17387
|
+
}
|
|
17388
|
+
let radii;
|
|
17389
|
+
if (Array.isArray(borderRadius)) {
|
|
17390
|
+
radii = borderRadius.slice(0, 4);
|
|
17391
|
+
} else {
|
|
17392
|
+
radii = [borderRadius, borderRadius, borderRadius, borderRadius];
|
|
17393
|
+
}
|
|
17394
|
+
const limit = Math.min(0.5 * w, 0.5 * h);
|
|
17395
|
+
const rTL = Math.max(0, Math.min(radii[0] || 0, limit));
|
|
17396
|
+
const rTR = Math.max(0, Math.min(radii[1] || 0, limit));
|
|
17397
|
+
const rBR = Math.max(0, Math.min(radii[2] || 0, limit));
|
|
17398
|
+
const rBL = Math.max(0, Math.min(radii[3] || 0, limit));
|
|
17399
|
+
const cpTR = rTR * (1.0 - KAPPA);
|
|
17400
|
+
const cpBR = rBR * (1.0 - KAPPA);
|
|
17401
|
+
const cpBL = rBL * (1.0 - KAPPA);
|
|
17402
|
+
const cpTL = rTL * (1.0 - KAPPA);
|
|
17403
|
+
this.moveTo(x + rTL, y);
|
|
17404
|
+
this.lineTo(x + w - rTR, y);
|
|
17405
|
+
if (rTR > 0) {
|
|
17406
|
+
this.bezierCurveTo(x + w - cpTR, y, x + w, y + cpTR, x + w, y + rTR);
|
|
17407
|
+
}
|
|
17408
|
+
this.lineTo(x + w, y + h - rBR);
|
|
17409
|
+
if (rBR > 0) {
|
|
17410
|
+
this.bezierCurveTo(x + w, y + h - cpBR, x + w - cpBR, y + h, x + w - rBR, y + h);
|
|
17411
|
+
}
|
|
17412
|
+
this.lineTo(x + rBL, y + h);
|
|
17413
|
+
if (rBL > 0) {
|
|
17414
|
+
this.bezierCurveTo(x + cpBL, y + h, x, y + h - cpBL, x, y + h - rBL);
|
|
17415
|
+
}
|
|
17416
|
+
this.lineTo(x, y + rTL);
|
|
17417
|
+
if (rTL > 0) {
|
|
17418
|
+
this.bezierCurveTo(x, y + cpTL, x + cpTL, y, x + rTL, y);
|
|
17419
|
+
}
|
|
17355
17420
|
return this.closePath();
|
|
17356
17421
|
},
|
|
17357
17422
|
ellipse(x, y, r1, r2) {
|
|
@@ -17493,8 +17558,10 @@ var VectorMixin = {
|
|
|
17493
17558
|
translate(x, y) {
|
|
17494
17559
|
return this.transform(1, 0, 0, 1, x, y);
|
|
17495
17560
|
},
|
|
17496
|
-
rotate(angle) {
|
|
17497
|
-
|
|
17561
|
+
rotate(angle, options) {
|
|
17562
|
+
if (options === void 0) {
|
|
17563
|
+
options = {};
|
|
17564
|
+
}
|
|
17498
17565
|
let y;
|
|
17499
17566
|
const rad = angle * Math.PI / 180;
|
|
17500
17567
|
const cos = Math.cos(rad);
|
|
@@ -17511,8 +17578,10 @@ var VectorMixin = {
|
|
|
17511
17578
|
}
|
|
17512
17579
|
return this.transform(cos, sin, -sin, cos, x, y);
|
|
17513
17580
|
},
|
|
17514
|
-
scale(xFactor, yFactor) {
|
|
17515
|
-
|
|
17581
|
+
scale(xFactor, yFactor, options) {
|
|
17582
|
+
if (options === void 0) {
|
|
17583
|
+
options = {};
|
|
17584
|
+
}
|
|
17516
17585
|
let y;
|
|
17517
17586
|
if (yFactor == null) {
|
|
17518
17587
|
yFactor = xFactor;
|
|
@@ -17656,7 +17725,7 @@ class AFMFont {
|
|
|
17656
17725
|
if (match = line.match(/^Start(\w+)/)) {
|
|
17657
17726
|
section = match[1];
|
|
17658
17727
|
continue;
|
|
17659
|
-
} else if (
|
|
17728
|
+
} else if (line.match(/^End(\w+)/)) {
|
|
17660
17729
|
section = '';
|
|
17661
17730
|
continue;
|
|
17662
17731
|
}
|
|
@@ -17747,8 +17816,10 @@ class PDFFont {
|
|
|
17747
17816
|
embed() {
|
|
17748
17817
|
throw new Error('Must be implemented by subclasses');
|
|
17749
17818
|
}
|
|
17750
|
-
lineHeight(size) {
|
|
17751
|
-
|
|
17819
|
+
lineHeight(size, includeGap) {
|
|
17820
|
+
if (includeGap === void 0) {
|
|
17821
|
+
includeGap = false;
|
|
17822
|
+
}
|
|
17752
17823
|
const gap = includeGap ? this.lineGap : 0;
|
|
17753
17824
|
return (this.ascender + gap - this.descender) / 1000 * size;
|
|
17754
17825
|
}
|
|
@@ -17994,9 +18065,15 @@ class EmbeddedFont extends PDFFont {
|
|
|
17994
18065
|
descriptor.data.FontFile2 = fontFile;
|
|
17995
18066
|
}
|
|
17996
18067
|
if (this.document.subset && this.document.subset === 1) {
|
|
17997
|
-
const
|
|
18068
|
+
const maxCID = this.widths.length - 1;
|
|
18069
|
+
const cidSetBuffer = Buffer.alloc(Math.ceil((maxCID + 1) / 8), 0);
|
|
18070
|
+
for (let cid = 0; cid <= maxCID; cid++) {
|
|
18071
|
+
if (this.widths[cid] != null) {
|
|
18072
|
+
cidSetBuffer[Math.floor(cid / 8)] |= 0x80 >> cid % 8;
|
|
18073
|
+
}
|
|
18074
|
+
}
|
|
17998
18075
|
const CIDSetRef = this.document.ref();
|
|
17999
|
-
CIDSetRef.write(
|
|
18076
|
+
CIDSetRef.write(cidSetBuffer);
|
|
18000
18077
|
CIDSetRef.end();
|
|
18001
18078
|
descriptor.data.CIDSet = CIDSetRef;
|
|
18002
18079
|
}
|
|
@@ -18087,9 +18164,9 @@ class PDFFontFactory {
|
|
|
18087
18164
|
src = fs.readFileSync(src);
|
|
18088
18165
|
}
|
|
18089
18166
|
if (src instanceof Uint8Array) {
|
|
18090
|
-
font =
|
|
18167
|
+
font = (0, _fontkit.create)(src, family);
|
|
18091
18168
|
} else if (src instanceof ArrayBuffer) {
|
|
18092
|
-
font =
|
|
18169
|
+
font = (0, _fontkit.create)(new Uint8Array(src), family);
|
|
18093
18170
|
}
|
|
18094
18171
|
if (font == null) {
|
|
18095
18172
|
throw new Error('Not a supported font format or standard PDF font.');
|
|
@@ -18107,10 +18184,16 @@ const isEqualFont = (font1, font2) => {
|
|
|
18107
18184
|
return true;
|
|
18108
18185
|
};
|
|
18109
18186
|
var FontsMixin = {
|
|
18110
|
-
initFonts() {
|
|
18111
|
-
|
|
18112
|
-
|
|
18113
|
-
|
|
18187
|
+
initFonts(defaultFont, defaultFontFamily, defaultFontSize) {
|
|
18188
|
+
if (defaultFont === void 0) {
|
|
18189
|
+
defaultFont = 'Helvetica';
|
|
18190
|
+
}
|
|
18191
|
+
if (defaultFontFamily === void 0) {
|
|
18192
|
+
defaultFontFamily = null;
|
|
18193
|
+
}
|
|
18194
|
+
if (defaultFontSize === void 0) {
|
|
18195
|
+
defaultFontSize = 12;
|
|
18196
|
+
}
|
|
18114
18197
|
this._fontFamilies = {};
|
|
18115
18198
|
this._fontCount = 0;
|
|
18116
18199
|
this._fontSource = defaultFont;
|
|
@@ -18158,9 +18241,12 @@ var FontsMixin = {
|
|
|
18158
18241
|
if (cacheKey) {
|
|
18159
18242
|
this._fontFamilies[cacheKey] = this._font;
|
|
18160
18243
|
}
|
|
18161
|
-
if (this._font.name) {
|
|
18244
|
+
if (this._font.name && !this._fontFamilies[this._font.name]) {
|
|
18162
18245
|
this._fontFamilies[this._font.name] = this._font;
|
|
18163
18246
|
}
|
|
18247
|
+
if (!cacheKey && (!this._font.name || this._fontFamilies[this._font.name] !== this._font)) {
|
|
18248
|
+
this._fontFamilies[this._font.id] = this._font;
|
|
18249
|
+
}
|
|
18164
18250
|
return this;
|
|
18165
18251
|
},
|
|
18166
18252
|
fontSize(_fontSize) {
|
|
@@ -18177,10 +18263,16 @@ var FontsMixin = {
|
|
|
18177
18263
|
};
|
|
18178
18264
|
return this;
|
|
18179
18265
|
},
|
|
18180
|
-
sizeToPoint(size) {
|
|
18181
|
-
|
|
18182
|
-
|
|
18183
|
-
|
|
18266
|
+
sizeToPoint(size, defaultValue, page, percentageWidth) {
|
|
18267
|
+
if (defaultValue === void 0) {
|
|
18268
|
+
defaultValue = 0;
|
|
18269
|
+
}
|
|
18270
|
+
if (page === void 0) {
|
|
18271
|
+
page = this.page;
|
|
18272
|
+
}
|
|
18273
|
+
if (percentageWidth === void 0) {
|
|
18274
|
+
percentageWidth = undefined;
|
|
18275
|
+
}
|
|
18184
18276
|
if (!percentageWidth) percentageWidth = this._fontSize;
|
|
18185
18277
|
if (typeof defaultValue !== 'number') defaultValue = this.sizeToPoint(defaultValue);
|
|
18186
18278
|
if (size === undefined) return defaultValue;
|
|
@@ -18241,9 +18333,9 @@ var FontsMixin = {
|
|
|
18241
18333
|
};
|
|
18242
18334
|
const SOFT_HYPHEN = '\u00AD';
|
|
18243
18335
|
const HYPHEN = '-';
|
|
18244
|
-
class LineWrapper
|
|
18336
|
+
class LineWrapper {
|
|
18245
18337
|
constructor(document, options) {
|
|
18246
|
-
|
|
18338
|
+
this._listeners = Object.create(null);
|
|
18247
18339
|
this.document = document;
|
|
18248
18340
|
this.horizontalScaling = options.horizontalScaling || 100;
|
|
18249
18341
|
this.indent = (options.indent || 0) * this.horizontalScaling / 100;
|
|
@@ -18297,6 +18389,26 @@ class LineWrapper extends _events.EventEmitter {
|
|
|
18297
18389
|
});
|
|
18298
18390
|
});
|
|
18299
18391
|
}
|
|
18392
|
+
on(event, listener) {
|
|
18393
|
+
(this._listeners[event] || (this._listeners[event] = [])).push(listener);
|
|
18394
|
+
}
|
|
18395
|
+
once(event, listener) {
|
|
18396
|
+
var _this = this;
|
|
18397
|
+
const wrapper = function () {
|
|
18398
|
+
const listeners = _this._listeners[event];
|
|
18399
|
+
listeners.splice(listeners.indexOf(wrapper), 1);
|
|
18400
|
+
listener(...arguments);
|
|
18401
|
+
};
|
|
18402
|
+
this.on(event, wrapper);
|
|
18403
|
+
}
|
|
18404
|
+
emit(event) {
|
|
18405
|
+
const listeners = this._listeners[event];
|
|
18406
|
+
if (!listeners) return;
|
|
18407
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
18408
|
+
args[_key2 - 1] = arguments[_key2];
|
|
18409
|
+
}
|
|
18410
|
+
for (const listener of listeners.slice()) listener(...args);
|
|
18411
|
+
}
|
|
18300
18412
|
wordWidth(word) {
|
|
18301
18413
|
return PDFNumber(this.document.widthOfString(word, this) + this.characterSpacing + this.wordSpacing);
|
|
18302
18414
|
}
|
|
@@ -18362,6 +18474,7 @@ class LineWrapper extends _events.EventEmitter {
|
|
|
18362
18474
|
}
|
|
18363
18475
|
}
|
|
18364
18476
|
wrap(text, options) {
|
|
18477
|
+
const document = this.document;
|
|
18365
18478
|
this.horizontalScaling = options.horizontalScaling || 100;
|
|
18366
18479
|
if (options.indent != null) {
|
|
18367
18480
|
this.indent = options.indent * this.horizontalScaling / 100;
|
|
@@ -18375,20 +18488,20 @@ class LineWrapper extends _events.EventEmitter {
|
|
|
18375
18488
|
if (options.ellipsis != null) {
|
|
18376
18489
|
this.ellipsis = options.ellipsis;
|
|
18377
18490
|
}
|
|
18378
|
-
const nextY =
|
|
18379
|
-
if (
|
|
18491
|
+
const nextY = document.y + document.currentLineHeight(true);
|
|
18492
|
+
if (document.y > this.maxY || nextY > this.maxY) {
|
|
18380
18493
|
this.nextSection();
|
|
18381
18494
|
}
|
|
18382
18495
|
let buffer = '';
|
|
18383
18496
|
let textWidth = 0;
|
|
18384
18497
|
let wc = 0;
|
|
18385
18498
|
let lc = 0;
|
|
18386
|
-
let
|
|
18499
|
+
let continueY = document.y;
|
|
18387
18500
|
const emitLine = () => {
|
|
18388
18501
|
options.textWidth = textWidth + this.wordSpacing * (wc - 1);
|
|
18389
18502
|
options.wordCount = wc;
|
|
18390
18503
|
options.lineWidth = this.lineWidth;
|
|
18391
|
-
|
|
18504
|
+
continueY = document.y;
|
|
18392
18505
|
this.emit('line', buffer, options, this);
|
|
18393
18506
|
return lc++;
|
|
18394
18507
|
};
|
|
@@ -18404,8 +18517,8 @@ class LineWrapper extends _events.EventEmitter {
|
|
|
18404
18517
|
wc++;
|
|
18405
18518
|
}
|
|
18406
18519
|
if (bk.required || !this.canFit(word, w)) {
|
|
18407
|
-
const lh =
|
|
18408
|
-
if (this.height != null && this.ellipsis && PDFNumber(
|
|
18520
|
+
const lh = document.currentLineHeight(true);
|
|
18521
|
+
if (this.height != null && this.ellipsis && PDFNumber(document.y + lh * 2) > this.maxY && this.column >= this.columns) {
|
|
18409
18522
|
if (this.ellipsis === true) {
|
|
18410
18523
|
this.ellipsis = '…';
|
|
18411
18524
|
}
|
|
@@ -18434,7 +18547,7 @@ class LineWrapper extends _events.EventEmitter {
|
|
|
18434
18547
|
this.spaceLeft -= this.wordWidth(HYPHEN);
|
|
18435
18548
|
}
|
|
18436
18549
|
emitLine();
|
|
18437
|
-
if (PDFNumber(
|
|
18550
|
+
if (PDFNumber(document.y + lh) > this.maxY) {
|
|
18438
18551
|
this.emit('sectionEnd', options, this);
|
|
18439
18552
|
const shouldContinue = this.nextSection();
|
|
18440
18553
|
if (!shouldContinue) {
|
|
@@ -18469,9 +18582,9 @@ class LineWrapper extends _events.EventEmitter {
|
|
|
18469
18582
|
this.continuedX = 0;
|
|
18470
18583
|
}
|
|
18471
18584
|
this.continuedX += options.textWidth || 0;
|
|
18472
|
-
|
|
18585
|
+
document.y = continueY;
|
|
18473
18586
|
} else {
|
|
18474
|
-
|
|
18587
|
+
document.x = this.startX;
|
|
18475
18588
|
}
|
|
18476
18589
|
}
|
|
18477
18590
|
nextSection(options) {
|
|
@@ -18576,8 +18689,10 @@ var TextMixin = {
|
|
|
18576
18689
|
text(text, x, y, options) {
|
|
18577
18690
|
return this._text(text, x, y, options, this._line);
|
|
18578
18691
|
},
|
|
18579
|
-
widthOfString(string) {
|
|
18580
|
-
|
|
18692
|
+
widthOfString(string, options) {
|
|
18693
|
+
if (options === void 0) {
|
|
18694
|
+
options = {};
|
|
18695
|
+
}
|
|
18581
18696
|
const horizontalScaling = options.horizontalScaling || 100;
|
|
18582
18697
|
return (this._font.widthOfString(string, this._fontSize, options.features) + (options.characterSpacing || 0) * (string.length - 1)) * horizontalScaling / 100;
|
|
18583
18698
|
},
|
|
@@ -18784,11 +18899,14 @@ var TextMixin = {
|
|
|
18784
18899
|
}
|
|
18785
18900
|
return this;
|
|
18786
18901
|
},
|
|
18787
|
-
_initOptions() {
|
|
18788
|
-
|
|
18789
|
-
|
|
18790
|
-
|
|
18791
|
-
if (
|
|
18902
|
+
_initOptions(x, y, options) {
|
|
18903
|
+
if (x === void 0) {
|
|
18904
|
+
x = {};
|
|
18905
|
+
}
|
|
18906
|
+
if (options === void 0) {
|
|
18907
|
+
options = {};
|
|
18908
|
+
}
|
|
18909
|
+
if (x && typeof x === 'object') {
|
|
18792
18910
|
options = x;
|
|
18793
18911
|
x = null;
|
|
18794
18912
|
}
|
|
@@ -18821,13 +18939,14 @@ var TextMixin = {
|
|
|
18821
18939
|
if (result.columnGap == null) {
|
|
18822
18940
|
result.columnGap = 18;
|
|
18823
18941
|
}
|
|
18824
|
-
result.rotation = Number(
|
|
18942
|
+
result.rotation = Number(result.rotation ?? 0) % 360;
|
|
18825
18943
|
if (result.rotation < 0) result.rotation += 360;
|
|
18826
18944
|
return result;
|
|
18827
18945
|
},
|
|
18828
|
-
_line(text) {
|
|
18829
|
-
|
|
18830
|
-
|
|
18946
|
+
_line(text, options, wrapper) {
|
|
18947
|
+
if (options === void 0) {
|
|
18948
|
+
options = {};
|
|
18949
|
+
}
|
|
18831
18950
|
this._fragment(text, this.x, this.y, options);
|
|
18832
18951
|
if (wrapper) {
|
|
18833
18952
|
const lineGap = options.lineGap || this._lineGap || 0;
|
|
@@ -19033,28 +19152,61 @@ var TextMixin = {
|
|
|
19033
19152
|
this.restore();
|
|
19034
19153
|
}
|
|
19035
19154
|
};
|
|
19155
|
+
const toBinaryString = bytes => {
|
|
19156
|
+
const chunkSize = 0x8000;
|
|
19157
|
+
let out = '';
|
|
19158
|
+
for (let i = 0; i < bytes.length; i += chunkSize) {
|
|
19159
|
+
const end = Math.min(i + chunkSize, bytes.length);
|
|
19160
|
+
out += String.fromCharCode.apply(null, bytes.subarray(i, end));
|
|
19161
|
+
}
|
|
19162
|
+
return out;
|
|
19163
|
+
};
|
|
19164
|
+
const readUInt16BE = function (bytes, offset) {
|
|
19165
|
+
if (offset === void 0) {
|
|
19166
|
+
offset = 0;
|
|
19167
|
+
}
|
|
19168
|
+
return (bytes[offset] << 8 | bytes[offset + 1]) >>> 0;
|
|
19169
|
+
};
|
|
19170
|
+
const readUInt16LE = function (bytes, offset) {
|
|
19171
|
+
if (offset === void 0) {
|
|
19172
|
+
offset = 0;
|
|
19173
|
+
}
|
|
19174
|
+
return (bytes[offset + 1] << 8 | bytes[offset]) >>> 0;
|
|
19175
|
+
};
|
|
19176
|
+
const readUInt32BE = function (bytes, offset) {
|
|
19177
|
+
if (offset === void 0) {
|
|
19178
|
+
offset = 0;
|
|
19179
|
+
}
|
|
19180
|
+
return bytes[offset] * 0x1000000 + (bytes[offset + 1] << 16 | bytes[offset + 2] << 8 | bytes[offset + 3]) >>> 0;
|
|
19181
|
+
};
|
|
19182
|
+
const readUInt32LE = function (bytes, offset) {
|
|
19183
|
+
if (offset === void 0) {
|
|
19184
|
+
offset = 0;
|
|
19185
|
+
}
|
|
19186
|
+
return (bytes[offset] | bytes[offset + 1] << 8 | bytes[offset + 2] << 16) + bytes[offset + 3] * 0x1000000 >>> 0;
|
|
19187
|
+
};
|
|
19036
19188
|
const parseExifOrientation = data => {
|
|
19037
19189
|
if (!data || data.length < 20) return null;
|
|
19038
19190
|
let pos = 2;
|
|
19039
19191
|
while (pos < data.length - 4) {
|
|
19040
19192
|
while (pos < data.length && data[pos] !== 0xff) pos++;
|
|
19041
19193
|
if (pos >= data.length - 4) return null;
|
|
19042
|
-
const marker =
|
|
19194
|
+
const marker = readUInt16BE(data, pos);
|
|
19043
19195
|
pos += 2;
|
|
19044
19196
|
if (marker === 0xffda) return null;
|
|
19045
19197
|
if (marker >= 0xffd0 && marker <= 0xffd9 || marker === 0xff01) continue;
|
|
19046
19198
|
if (pos + 2 > data.length) return null;
|
|
19047
|
-
const segmentLength =
|
|
19199
|
+
const segmentLength = readUInt16BE(data, pos);
|
|
19048
19200
|
if (marker === 0xffe1 && pos + 8 <= data.length) {
|
|
19049
|
-
const exifHeader = data.subarray(pos + 2, pos + 8)
|
|
19201
|
+
const exifHeader = toBinaryString(data.subarray(pos + 2, pos + 8));
|
|
19050
19202
|
if (exifHeader === 'Exif\x00\x00') {
|
|
19051
19203
|
const tiffStart = pos + 8;
|
|
19052
19204
|
if (tiffStart + 8 > data.length) return null;
|
|
19053
|
-
const byteOrder = data.subarray(tiffStart, tiffStart + 2)
|
|
19205
|
+
const byteOrder = toBinaryString(data.subarray(tiffStart, tiffStart + 2));
|
|
19054
19206
|
const isLittleEndian = byteOrder === 'II';
|
|
19055
19207
|
if (!isLittleEndian && byteOrder !== 'MM') return null;
|
|
19056
|
-
const read16 = isLittleEndian ? o =>
|
|
19057
|
-
const read32 = isLittleEndian ? o =>
|
|
19208
|
+
const read16 = isLittleEndian ? o => readUInt16LE(data, o) : o => readUInt16BE(data, o);
|
|
19209
|
+
const read32 = isLittleEndian ? o => readUInt32LE(data, o) : o => readUInt32BE(data, o);
|
|
19058
19210
|
if (read16(tiffStart + 2) !== 42) return null;
|
|
19059
19211
|
const ifdPos = tiffStart + read32(tiffStart + 4);
|
|
19060
19212
|
if (ifdPos + 2 > data.length) return null;
|
|
@@ -19109,7 +19261,7 @@ class JPEG {
|
|
|
19109
19261
|
pos += 2;
|
|
19110
19262
|
this.width = this.data.readUInt16BE(pos);
|
|
19111
19263
|
pos += 2;
|
|
19112
|
-
const channels = this.data[pos
|
|
19264
|
+
const channels = this.data[pos + 1];
|
|
19113
19265
|
this.colorSpace = COLOR_SPACE_MAP[channels];
|
|
19114
19266
|
this.obj = null;
|
|
19115
19267
|
}
|
|
@@ -19143,56 +19295,56 @@ class PNGImage {
|
|
|
19143
19295
|
this.obj = null;
|
|
19144
19296
|
}
|
|
19145
19297
|
embed(document) {
|
|
19146
|
-
let dataDecoded = false;
|
|
19147
19298
|
this.document = document;
|
|
19148
19299
|
if (this.obj) {
|
|
19149
19300
|
return;
|
|
19150
19301
|
}
|
|
19151
|
-
const
|
|
19152
|
-
|
|
19153
|
-
|
|
19302
|
+
const image = this.image,
|
|
19303
|
+
height = this.height,
|
|
19304
|
+
width = this.width;
|
|
19305
|
+
const hasAlphaChannel = image.hasAlphaChannel;
|
|
19306
|
+
const isInterlaced = image.interlaceMethod === 1;
|
|
19307
|
+
const obj = this.obj = document.ref({
|
|
19154
19308
|
Type: 'XObject',
|
|
19155
19309
|
Subtype: 'Image',
|
|
19156
|
-
BitsPerComponent: hasAlphaChannel ? 8 :
|
|
19157
|
-
Width:
|
|
19158
|
-
Height:
|
|
19310
|
+
BitsPerComponent: hasAlphaChannel ? 8 : image.bits,
|
|
19311
|
+
Width: width,
|
|
19312
|
+
Height: height,
|
|
19159
19313
|
Filter: 'FlateDecode'
|
|
19160
19314
|
});
|
|
19161
19315
|
if (!hasAlphaChannel) {
|
|
19162
|
-
const params =
|
|
19316
|
+
const params = document.ref({
|
|
19163
19317
|
Predictor: isInterlaced ? 1 : 15,
|
|
19164
|
-
Colors:
|
|
19165
|
-
BitsPerComponent:
|
|
19166
|
-
Columns:
|
|
19318
|
+
Colors: image.colors,
|
|
19319
|
+
BitsPerComponent: image.bits,
|
|
19320
|
+
Columns: width
|
|
19167
19321
|
});
|
|
19168
|
-
|
|
19322
|
+
obj.data['DecodeParms'] = params;
|
|
19169
19323
|
params.end();
|
|
19170
19324
|
}
|
|
19171
|
-
if (
|
|
19172
|
-
|
|
19325
|
+
if (image.palette.length === 0) {
|
|
19326
|
+
obj.data['ColorSpace'] = image.colorSpace;
|
|
19173
19327
|
} else {
|
|
19174
|
-
const palette =
|
|
19175
|
-
palette.end(Buffer.from(
|
|
19176
|
-
|
|
19177
|
-
}
|
|
19178
|
-
if (
|
|
19179
|
-
const val =
|
|
19180
|
-
|
|
19181
|
-
} else if (
|
|
19182
|
-
const rgb =
|
|
19328
|
+
const palette = document.ref();
|
|
19329
|
+
palette.end(Buffer.from(image.palette));
|
|
19330
|
+
obj.data['ColorSpace'] = ['Indexed', 'DeviceRGB', image.palette.length / 3 - 1, palette];
|
|
19331
|
+
}
|
|
19332
|
+
if (image.transparency.grayscale != null) {
|
|
19333
|
+
const val = image.transparency.grayscale;
|
|
19334
|
+
obj.data['Mask'] = [val, val];
|
|
19335
|
+
} else if (image.transparency.rgb) {
|
|
19336
|
+
const rgb = image.transparency.rgb;
|
|
19183
19337
|
const mask = [];
|
|
19184
19338
|
for (let x of rgb) {
|
|
19185
19339
|
mask.push(x, x);
|
|
19186
19340
|
}
|
|
19187
|
-
|
|
19188
|
-
} else if (
|
|
19189
|
-
dataDecoded = true;
|
|
19341
|
+
obj.data['Mask'] = mask;
|
|
19342
|
+
} else if (image.transparency.indexed) {
|
|
19190
19343
|
return this.loadIndexedAlphaChannel();
|
|
19191
19344
|
} else if (hasAlphaChannel) {
|
|
19192
|
-
dataDecoded = true;
|
|
19193
19345
|
return this.splitAlphaChannel();
|
|
19194
19346
|
}
|
|
19195
|
-
if (isInterlaced &&
|
|
19347
|
+
if (isInterlaced && true) {
|
|
19196
19348
|
return this.decodeData();
|
|
19197
19349
|
}
|
|
19198
19350
|
this.finalize();
|
|
@@ -19282,7 +19434,7 @@ class PDFImage {
|
|
|
19282
19434
|
}
|
|
19283
19435
|
if (data[0] === 0xff && data[1] === 0xd8) {
|
|
19284
19436
|
return new JPEG(data, label);
|
|
19285
|
-
} else if (data[0] === 0x89 && data
|
|
19437
|
+
} else if (data[0] === 0x89 && data[1] === 0x50 && data[2] === 0x4e && data[3] === 0x47) {
|
|
19286
19438
|
return new PNGImage(data, label);
|
|
19287
19439
|
} else {
|
|
19288
19440
|
throw new Error('Unknown image format.');
|
|
@@ -19294,8 +19446,10 @@ var ImagesMixin = {
|
|
|
19294
19446
|
this._imageRegistry = {};
|
|
19295
19447
|
this._imageCount = 0;
|
|
19296
19448
|
},
|
|
19297
|
-
image(src, x, y) {
|
|
19298
|
-
|
|
19449
|
+
image(src, x, y, options) {
|
|
19450
|
+
if (options === void 0) {
|
|
19451
|
+
options = {};
|
|
19452
|
+
}
|
|
19299
19453
|
let bh, bp, bw, image, ip, left, left1, originX, originY;
|
|
19300
19454
|
if (typeof x === 'object') {
|
|
19301
19455
|
options = x;
|
|
@@ -19325,9 +19479,9 @@ var ImagesMixin = {
|
|
|
19325
19479
|
width = _image.width,
|
|
19326
19480
|
height = _image.height;
|
|
19327
19481
|
if (!ignoreOrientation && image.orientation > 4) {
|
|
19328
|
-
var
|
|
19329
|
-
width =
|
|
19330
|
-
height =
|
|
19482
|
+
var _ref3 = [height, width];
|
|
19483
|
+
width = _ref3[0];
|
|
19484
|
+
height = _ref3[1];
|
|
19331
19485
|
}
|
|
19332
19486
|
let w = options.width || width;
|
|
19333
19487
|
let h = options.height || height;
|
|
@@ -19458,6 +19612,9 @@ var ImagesMixin = {
|
|
|
19458
19612
|
this.y += h;
|
|
19459
19613
|
}
|
|
19460
19614
|
this.save();
|
|
19615
|
+
if (options.opacity != null) {
|
|
19616
|
+
this._doOpacity(options.opacity, null);
|
|
19617
|
+
}
|
|
19461
19618
|
if (rotateAngle) {
|
|
19462
19619
|
this.rotate(rotateAngle, {
|
|
19463
19620
|
origin: [originX, originY]
|
|
@@ -19519,8 +19676,10 @@ var AnnotationsMixin = {
|
|
|
19519
19676
|
ref.end();
|
|
19520
19677
|
return this;
|
|
19521
19678
|
},
|
|
19522
|
-
note(x, y, w, h, contents) {
|
|
19523
|
-
|
|
19679
|
+
note(x, y, w, h, contents, options) {
|
|
19680
|
+
if (options === void 0) {
|
|
19681
|
+
options = {};
|
|
19682
|
+
}
|
|
19524
19683
|
options.Subtype = 'Text';
|
|
19525
19684
|
options.Contents = new String(contents);
|
|
19526
19685
|
if (options.Name == null) {
|
|
@@ -19531,8 +19690,10 @@ var AnnotationsMixin = {
|
|
|
19531
19690
|
}
|
|
19532
19691
|
return this.annotate(x, y, w, h, options);
|
|
19533
19692
|
},
|
|
19534
|
-
goTo(x, y, w, h, name) {
|
|
19535
|
-
|
|
19693
|
+
goTo(x, y, w, h, name, options) {
|
|
19694
|
+
if (options === void 0) {
|
|
19695
|
+
options = {};
|
|
19696
|
+
}
|
|
19536
19697
|
options.Subtype = 'Link';
|
|
19537
19698
|
options.A = this.ref({
|
|
19538
19699
|
S: 'GoTo',
|
|
@@ -19541,8 +19702,10 @@ var AnnotationsMixin = {
|
|
|
19541
19702
|
options.A.end();
|
|
19542
19703
|
return this.annotate(x, y, w, h, options);
|
|
19543
19704
|
},
|
|
19544
|
-
link(x, y, w, h, url) {
|
|
19545
|
-
|
|
19705
|
+
link(x, y, w, h, url, options) {
|
|
19706
|
+
if (options === void 0) {
|
|
19707
|
+
options = {};
|
|
19708
|
+
}
|
|
19546
19709
|
options.Subtype = 'Link';
|
|
19547
19710
|
if (typeof url === 'number') {
|
|
19548
19711
|
const pages = this._root.data.Pages.data;
|
|
@@ -19567,8 +19730,10 @@ var AnnotationsMixin = {
|
|
|
19567
19730
|
}
|
|
19568
19731
|
return this.annotate(x, y, w, h, options);
|
|
19569
19732
|
},
|
|
19570
|
-
_markup(x, y, w, h) {
|
|
19571
|
-
|
|
19733
|
+
_markup(x, y, w, h, options) {
|
|
19734
|
+
if (options === void 0) {
|
|
19735
|
+
options = {};
|
|
19736
|
+
}
|
|
19572
19737
|
const _this$_convertRect = this._convertRect(x, y, w, h),
|
|
19573
19738
|
x1 = _this$_convertRect[0],
|
|
19574
19739
|
y1 = _this$_convertRect[1],
|
|
@@ -19578,53 +19743,71 @@ var AnnotationsMixin = {
|
|
|
19578
19743
|
options.Contents = new String();
|
|
19579
19744
|
return this.annotate(x, y, w, h, options);
|
|
19580
19745
|
},
|
|
19581
|
-
highlight(x, y, w, h) {
|
|
19582
|
-
|
|
19746
|
+
highlight(x, y, w, h, options) {
|
|
19747
|
+
if (options === void 0) {
|
|
19748
|
+
options = {};
|
|
19749
|
+
}
|
|
19583
19750
|
options.Subtype = 'Highlight';
|
|
19584
19751
|
if (options.color == null) {
|
|
19585
19752
|
options.color = [241, 238, 148];
|
|
19586
19753
|
}
|
|
19587
19754
|
return this._markup(x, y, w, h, options);
|
|
19588
19755
|
},
|
|
19589
|
-
underline(x, y, w, h) {
|
|
19590
|
-
|
|
19756
|
+
underline(x, y, w, h, options) {
|
|
19757
|
+
if (options === void 0) {
|
|
19758
|
+
options = {};
|
|
19759
|
+
}
|
|
19591
19760
|
options.Subtype = 'Underline';
|
|
19592
19761
|
return this._markup(x, y, w, h, options);
|
|
19593
19762
|
},
|
|
19594
|
-
strike(x, y, w, h) {
|
|
19595
|
-
|
|
19763
|
+
strike(x, y, w, h, options) {
|
|
19764
|
+
if (options === void 0) {
|
|
19765
|
+
options = {};
|
|
19766
|
+
}
|
|
19596
19767
|
options.Subtype = 'StrikeOut';
|
|
19597
19768
|
return this._markup(x, y, w, h, options);
|
|
19598
19769
|
},
|
|
19599
|
-
lineAnnotation(x1, y1, x2, y2) {
|
|
19600
|
-
|
|
19770
|
+
lineAnnotation(x1, y1, x2, y2, options) {
|
|
19771
|
+
if (options === void 0) {
|
|
19772
|
+
options = {};
|
|
19773
|
+
}
|
|
19601
19774
|
options.Subtype = 'Line';
|
|
19602
19775
|
options.Contents = new String();
|
|
19603
19776
|
options.L = [x1, this.page.height - y1, x2, this.page.height - y2];
|
|
19604
19777
|
return this.annotate(x1, y1, x2, y2, options);
|
|
19605
19778
|
},
|
|
19606
|
-
rectAnnotation(x, y, w, h) {
|
|
19607
|
-
|
|
19779
|
+
rectAnnotation(x, y, w, h, options) {
|
|
19780
|
+
if (options === void 0) {
|
|
19781
|
+
options = {};
|
|
19782
|
+
}
|
|
19608
19783
|
options.Subtype = 'Square';
|
|
19609
19784
|
options.Contents = new String();
|
|
19610
19785
|
return this.annotate(x, y, w, h, options);
|
|
19611
19786
|
},
|
|
19612
|
-
ellipseAnnotation(x, y, w, h) {
|
|
19613
|
-
|
|
19787
|
+
ellipseAnnotation(x, y, w, h, options) {
|
|
19788
|
+
if (options === void 0) {
|
|
19789
|
+
options = {};
|
|
19790
|
+
}
|
|
19614
19791
|
options.Subtype = 'Circle';
|
|
19615
19792
|
options.Contents = new String();
|
|
19616
19793
|
return this.annotate(x, y, w, h, options);
|
|
19617
19794
|
},
|
|
19618
|
-
textAnnotation(x, y, w, h, text) {
|
|
19619
|
-
|
|
19795
|
+
textAnnotation(x, y, w, h, text, options) {
|
|
19796
|
+
if (options === void 0) {
|
|
19797
|
+
options = {};
|
|
19798
|
+
}
|
|
19620
19799
|
options.Subtype = 'FreeText';
|
|
19621
19800
|
options.Contents = new String(text);
|
|
19622
19801
|
options.DA = new String();
|
|
19623
19802
|
return this.annotate(x, y, w, h, options);
|
|
19624
19803
|
},
|
|
19625
|
-
fileAnnotation(x, y, w, h) {
|
|
19626
|
-
|
|
19627
|
-
|
|
19804
|
+
fileAnnotation(x, y, w, h, file, options) {
|
|
19805
|
+
if (file === void 0) {
|
|
19806
|
+
file = {};
|
|
19807
|
+
}
|
|
19808
|
+
if (options === void 0) {
|
|
19809
|
+
options = {};
|
|
19810
|
+
}
|
|
19628
19811
|
const filespec = this.file(file.src, Object.assign({
|
|
19629
19812
|
hidden: true
|
|
19630
19813
|
}, file));
|
|
@@ -19664,8 +19847,10 @@ const DEFAULT_OPTIONS = {
|
|
|
19664
19847
|
expanded: false
|
|
19665
19848
|
};
|
|
19666
19849
|
class PDFOutline {
|
|
19667
|
-
constructor(document, parent, title, dest) {
|
|
19668
|
-
|
|
19850
|
+
constructor(document, parent, title, dest, options) {
|
|
19851
|
+
if (options === void 0) {
|
|
19852
|
+
options = DEFAULT_OPTIONS;
|
|
19853
|
+
}
|
|
19669
19854
|
this.document = document;
|
|
19670
19855
|
this.options = options;
|
|
19671
19856
|
this.outlineData = {};
|
|
@@ -19686,8 +19871,10 @@ class PDFOutline {
|
|
|
19686
19871
|
this.dictionary = this.document.ref(this.outlineData);
|
|
19687
19872
|
this.children = [];
|
|
19688
19873
|
}
|
|
19689
|
-
addItem(title) {
|
|
19690
|
-
|
|
19874
|
+
addItem(title, options) {
|
|
19875
|
+
if (options === void 0) {
|
|
19876
|
+
options = DEFAULT_OPTIONS;
|
|
19877
|
+
}
|
|
19691
19878
|
const pages = this.document._root.data.Pages.data.Kids;
|
|
19692
19879
|
const dest = options.pageNumber != null ? pages[options.pageNumber] : this.document.page.dictionary;
|
|
19693
19880
|
const result = new PDFOutline(this.document, this.dictionary, title, dest, options);
|
|
@@ -19741,9 +19928,13 @@ class PDFStructureContent {
|
|
|
19741
19928
|
}
|
|
19742
19929
|
}
|
|
19743
19930
|
class PDFStructureElement {
|
|
19744
|
-
constructor(document, type) {
|
|
19745
|
-
|
|
19746
|
-
|
|
19931
|
+
constructor(document, type, options, children) {
|
|
19932
|
+
if (options === void 0) {
|
|
19933
|
+
options = {};
|
|
19934
|
+
}
|
|
19935
|
+
if (children === void 0) {
|
|
19936
|
+
children = null;
|
|
19937
|
+
}
|
|
19747
19938
|
this.document = document;
|
|
19748
19939
|
this._attached = false;
|
|
19749
19940
|
this._ended = false;
|
|
@@ -19756,21 +19947,41 @@ class PDFStructureElement {
|
|
|
19756
19947
|
children = options;
|
|
19757
19948
|
options = {};
|
|
19758
19949
|
}
|
|
19759
|
-
if (
|
|
19950
|
+
if (options.title) {
|
|
19760
19951
|
data.T = new String(options.title);
|
|
19761
19952
|
}
|
|
19762
|
-
if (
|
|
19953
|
+
if (options.lang) {
|
|
19763
19954
|
data.Lang = new String(options.lang);
|
|
19764
19955
|
}
|
|
19765
|
-
if (
|
|
19956
|
+
if (options.alt) {
|
|
19766
19957
|
data.Alt = new String(options.alt);
|
|
19767
19958
|
}
|
|
19768
|
-
if (
|
|
19959
|
+
if (options.expanded) {
|
|
19769
19960
|
data.E = new String(options.expanded);
|
|
19770
19961
|
}
|
|
19771
|
-
if (
|
|
19962
|
+
if (options.actual) {
|
|
19772
19963
|
data.ActualText = new String(options.actual);
|
|
19773
19964
|
}
|
|
19965
|
+
const hasBbox = Array.isArray(options.bbox) && options.bbox.length === 4;
|
|
19966
|
+
const hasPlacement = typeof options.placement === 'string';
|
|
19967
|
+
if (hasBbox || hasPlacement) {
|
|
19968
|
+
const attrs = {
|
|
19969
|
+
O: 'Layout'
|
|
19970
|
+
};
|
|
19971
|
+
attrs.Placement = hasPlacement ? options.placement : 'Block';
|
|
19972
|
+
if (hasBbox) {
|
|
19973
|
+
const height = document.page.height;
|
|
19974
|
+
attrs.BBox = [options.bbox[0], height - options.bbox[3], options.bbox[2], height - options.bbox[1]];
|
|
19975
|
+
}
|
|
19976
|
+
data.A = attrs;
|
|
19977
|
+
}
|
|
19978
|
+
if (options.scope) {
|
|
19979
|
+
data.A = {
|
|
19980
|
+
...(data.A || {}),
|
|
19981
|
+
O: 'Table',
|
|
19982
|
+
Scope: options.scope
|
|
19983
|
+
};
|
|
19984
|
+
}
|
|
19774
19985
|
this._children = [];
|
|
19775
19986
|
if (children) {
|
|
19776
19987
|
if (!Array.isArray(children)) {
|
|
@@ -19806,9 +20017,9 @@ class PDFStructureElement {
|
|
|
19806
20017
|
return this;
|
|
19807
20018
|
}
|
|
19808
20019
|
_addContentToParentTree(content) {
|
|
19809
|
-
content.refs.forEach(
|
|
19810
|
-
let pageRef =
|
|
19811
|
-
mcid =
|
|
20020
|
+
content.refs.forEach(_ref4 => {
|
|
20021
|
+
let pageRef = _ref4.pageRef,
|
|
20022
|
+
mcid = _ref4.mcid;
|
|
19812
20023
|
const pageStructParents = this.document.getStructParentTree().get(pageRef.data.StructParents);
|
|
19813
20024
|
pageStructParents[mcid] = this.dictionary;
|
|
19814
20025
|
});
|
|
@@ -19895,9 +20106,9 @@ class PDFStructureElement {
|
|
|
19895
20106
|
this.dictionary.data.K.push(child.dictionary);
|
|
19896
20107
|
}
|
|
19897
20108
|
if (child instanceof PDFStructureContent) {
|
|
19898
|
-
child.refs.forEach(
|
|
19899
|
-
let pageRef =
|
|
19900
|
-
mcid =
|
|
20109
|
+
child.refs.forEach(_ref5 => {
|
|
20110
|
+
let pageRef = _ref5.pageRef,
|
|
20111
|
+
mcid = _ref5.mcid;
|
|
19901
20112
|
if (!this.dictionary.data.Pg) {
|
|
19902
20113
|
this.dictionary.data.Pg = pageRef;
|
|
19903
20114
|
}
|
|
@@ -19942,8 +20153,10 @@ var MarkingsMixin = {
|
|
|
19942
20153
|
this.getStructTreeRoot();
|
|
19943
20154
|
}
|
|
19944
20155
|
},
|
|
19945
|
-
markContent(tag) {
|
|
19946
|
-
|
|
20156
|
+
markContent(tag, options) {
|
|
20157
|
+
if (options === void 0) {
|
|
20158
|
+
options = null;
|
|
20159
|
+
}
|
|
19947
20160
|
if (tag === 'Artifact' || options && options.mcid) {
|
|
19948
20161
|
let toClose = 0;
|
|
19949
20162
|
this.page.markings.forEach(marking => {
|
|
@@ -19998,8 +20211,10 @@ var MarkingsMixin = {
|
|
|
19998
20211
|
this.addContent(`/${tag} ${PDFObject.convert(dictionary)} BDC`);
|
|
19999
20212
|
return this;
|
|
20000
20213
|
},
|
|
20001
|
-
markStructureContent(tag) {
|
|
20002
|
-
|
|
20214
|
+
markStructureContent(tag, options) {
|
|
20215
|
+
if (options === void 0) {
|
|
20216
|
+
options = {};
|
|
20217
|
+
}
|
|
20003
20218
|
const pageStructParents = this.getStructParentTree().get(this.page.structParentTreeKey);
|
|
20004
20219
|
const mcid = pageStructParents.length;
|
|
20005
20220
|
pageStructParents.push(null);
|
|
@@ -20023,9 +20238,13 @@ var MarkingsMixin = {
|
|
|
20023
20238
|
}
|
|
20024
20239
|
return this;
|
|
20025
20240
|
},
|
|
20026
|
-
struct(type) {
|
|
20027
|
-
|
|
20028
|
-
|
|
20241
|
+
struct(type, options, children) {
|
|
20242
|
+
if (options === void 0) {
|
|
20243
|
+
options = {};
|
|
20244
|
+
}
|
|
20245
|
+
if (children === void 0) {
|
|
20246
|
+
children = null;
|
|
20247
|
+
}
|
|
20029
20248
|
return new PDFStructureElement(this, type, options, children);
|
|
20030
20249
|
},
|
|
20031
20250
|
addStructure(structElem) {
|
|
@@ -20189,15 +20408,19 @@ var AcroFormMixin = {
|
|
|
20189
20408
|
}
|
|
20190
20409
|
return this;
|
|
20191
20410
|
},
|
|
20192
|
-
formField(name) {
|
|
20193
|
-
|
|
20411
|
+
formField(name, options) {
|
|
20412
|
+
if (options === void 0) {
|
|
20413
|
+
options = {};
|
|
20414
|
+
}
|
|
20194
20415
|
let fieldDict = this._fieldDict(name, null, options);
|
|
20195
20416
|
let fieldRef = this.ref(fieldDict);
|
|
20196
20417
|
this._addToParent(fieldRef);
|
|
20197
20418
|
return fieldRef;
|
|
20198
20419
|
},
|
|
20199
|
-
formAnnotation(name, type, x, y, w, h) {
|
|
20200
|
-
|
|
20420
|
+
formAnnotation(name, type, x, y, w, h, options) {
|
|
20421
|
+
if (options === void 0) {
|
|
20422
|
+
options = {};
|
|
20423
|
+
}
|
|
20201
20424
|
let fieldDict = this._fieldDict(name, type, options);
|
|
20202
20425
|
fieldDict.Subtype = 'Widget';
|
|
20203
20426
|
if (fieldDict.F === undefined) {
|
|
@@ -20207,28 +20430,40 @@ var AcroFormMixin = {
|
|
|
20207
20430
|
let annotRef = this.page.annotations[this.page.annotations.length - 1];
|
|
20208
20431
|
return this._addToParent(annotRef);
|
|
20209
20432
|
},
|
|
20210
|
-
formText(name, x, y, w, h) {
|
|
20211
|
-
|
|
20433
|
+
formText(name, x, y, w, h, options) {
|
|
20434
|
+
if (options === void 0) {
|
|
20435
|
+
options = {};
|
|
20436
|
+
}
|
|
20212
20437
|
return this.formAnnotation(name, 'text', x, y, w, h, options);
|
|
20213
20438
|
},
|
|
20214
|
-
formPushButton(name, x, y, w, h) {
|
|
20215
|
-
|
|
20439
|
+
formPushButton(name, x, y, w, h, options) {
|
|
20440
|
+
if (options === void 0) {
|
|
20441
|
+
options = {};
|
|
20442
|
+
}
|
|
20216
20443
|
return this.formAnnotation(name, 'pushButton', x, y, w, h, options);
|
|
20217
20444
|
},
|
|
20218
|
-
formCombo(name, x, y, w, h) {
|
|
20219
|
-
|
|
20445
|
+
formCombo(name, x, y, w, h, options) {
|
|
20446
|
+
if (options === void 0) {
|
|
20447
|
+
options = {};
|
|
20448
|
+
}
|
|
20220
20449
|
return this.formAnnotation(name, 'combo', x, y, w, h, options);
|
|
20221
20450
|
},
|
|
20222
|
-
formList(name, x, y, w, h) {
|
|
20223
|
-
|
|
20451
|
+
formList(name, x, y, w, h, options) {
|
|
20452
|
+
if (options === void 0) {
|
|
20453
|
+
options = {};
|
|
20454
|
+
}
|
|
20224
20455
|
return this.formAnnotation(name, 'list', x, y, w, h, options);
|
|
20225
20456
|
},
|
|
20226
|
-
formRadioButton(name, x, y, w, h) {
|
|
20227
|
-
|
|
20457
|
+
formRadioButton(name, x, y, w, h, options) {
|
|
20458
|
+
if (options === void 0) {
|
|
20459
|
+
options = {};
|
|
20460
|
+
}
|
|
20228
20461
|
return this.formAnnotation(name, 'radioButton', x, y, w, h, options);
|
|
20229
20462
|
},
|
|
20230
|
-
formCheckbox(name, x, y, w, h) {
|
|
20231
|
-
|
|
20463
|
+
formCheckbox(name, x, y, w, h, options) {
|
|
20464
|
+
if (options === void 0) {
|
|
20465
|
+
options = {};
|
|
20466
|
+
}
|
|
20232
20467
|
return this.formAnnotation(name, 'checkbox', x, y, w, h, options);
|
|
20233
20468
|
},
|
|
20234
20469
|
_addToParent(fieldRef) {
|
|
@@ -20243,8 +20478,10 @@ var AcroFormMixin = {
|
|
|
20243
20478
|
}
|
|
20244
20479
|
return this;
|
|
20245
20480
|
},
|
|
20246
|
-
_fieldDict(name, type) {
|
|
20247
|
-
|
|
20481
|
+
_fieldDict(name, type, options) {
|
|
20482
|
+
if (options === void 0) {
|
|
20483
|
+
options = {};
|
|
20484
|
+
}
|
|
20248
20485
|
if (!this._acroform) {
|
|
20249
20486
|
throw new Error('Call document.initForm() method before adding form elements to document');
|
|
20250
20487
|
}
|
|
@@ -20432,8 +20669,10 @@ var AcroFormMixin = {
|
|
|
20432
20669
|
}
|
|
20433
20670
|
};
|
|
20434
20671
|
var AttachmentsMixin = {
|
|
20435
|
-
file(src) {
|
|
20436
|
-
|
|
20672
|
+
file(src, options) {
|
|
20673
|
+
if (options === void 0) {
|
|
20674
|
+
options = {};
|
|
20675
|
+
}
|
|
20437
20676
|
options.name = options.name || src;
|
|
20438
20677
|
options.relationship = options.relationship || 'Unspecified';
|
|
20439
20678
|
const refBody = {
|
|
@@ -20452,7 +20691,7 @@ var AttachmentsMixin = {
|
|
|
20452
20691
|
const match = /^data:(.*?);base64,(.*)$/.exec(src);
|
|
20453
20692
|
if (match) {
|
|
20454
20693
|
if (match[1]) {
|
|
20455
|
-
refBody.Subtype = match[1]
|
|
20694
|
+
refBody.Subtype = escapeName(match[1]);
|
|
20456
20695
|
}
|
|
20457
20696
|
data = Buffer.from(match[2], 'base64');
|
|
20458
20697
|
} else {
|
|
@@ -20474,7 +20713,7 @@ var AttachmentsMixin = {
|
|
|
20474
20713
|
refBody.Params.ModDate = options.modifiedDate;
|
|
20475
20714
|
}
|
|
20476
20715
|
if (options.type) {
|
|
20477
|
-
refBody.Subtype = options.type
|
|
20716
|
+
refBody.Subtype = escapeName(options.type);
|
|
20478
20717
|
}
|
|
20479
20718
|
const checksum = md5Hex(new Uint8Array(data));
|
|
20480
20719
|
refBody.Params.CheckSum = new String(checksum);
|
|
@@ -20627,8 +20866,8 @@ function isObject(item) {
|
|
|
20627
20866
|
function deepMerge(target) {
|
|
20628
20867
|
if (!isObject(target)) return target;
|
|
20629
20868
|
target = deepClone(target);
|
|
20630
|
-
for (var
|
|
20631
|
-
sources[
|
|
20869
|
+
for (var _len3 = arguments.length, sources = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
20870
|
+
sources[_key3 - 1] = arguments[_key3];
|
|
20632
20871
|
}
|
|
20633
20872
|
for (const source of sources) {
|
|
20634
20873
|
if (isObject(source)) {
|
|
@@ -20657,12 +20896,12 @@ function normalizedDefaultStyle(defaultStyleInternal) {
|
|
|
20657
20896
|
if (typeof defaultStyle !== 'object') defaultStyle = {
|
|
20658
20897
|
text: defaultStyle
|
|
20659
20898
|
};
|
|
20660
|
-
const defaultRowStyle = Object.fromEntries(Object.entries(defaultStyle).filter(
|
|
20661
|
-
let k =
|
|
20899
|
+
const defaultRowStyle = Object.fromEntries(Object.entries(defaultStyle).filter(_ref6 => {
|
|
20900
|
+
let k = _ref6[0];
|
|
20662
20901
|
return ROW_FIELDS.includes(k);
|
|
20663
20902
|
}));
|
|
20664
|
-
const defaultColStyle = Object.fromEntries(Object.entries(defaultStyle).filter(
|
|
20665
|
-
let k =
|
|
20903
|
+
const defaultColStyle = Object.fromEntries(Object.entries(defaultStyle).filter(_ref7 => {
|
|
20904
|
+
let k = _ref7[0];
|
|
20666
20905
|
return COLUMN_FIELDS.includes(k);
|
|
20667
20906
|
}));
|
|
20668
20907
|
defaultStyle.padding = normalizeSides(defaultStyle.padding);
|
|
@@ -21175,9 +21414,9 @@ function renderCellText(cell) {
|
|
|
21175
21414
|
if (cell.font) doc.font(rollbackFont, rollbackFontFamily, rollbackFontSize);
|
|
21176
21415
|
}
|
|
21177
21416
|
function renderBorder(border, borderColor, x, y, width, height, mask) {
|
|
21178
|
-
border = Object.fromEntries(Object.entries(border).map(
|
|
21179
|
-
let k =
|
|
21180
|
-
v =
|
|
21417
|
+
border = Object.fromEntries(Object.entries(border).map(_ref8 => {
|
|
21418
|
+
let k = _ref8[0],
|
|
21419
|
+
v = _ref8[1];
|
|
21181
21420
|
return [k, mask && !mask[k] ? 0 : v];
|
|
21182
21421
|
}));
|
|
21183
21422
|
const doc = this.document;
|
|
@@ -21201,8 +21440,10 @@ function renderBorder(border, borderColor, x, y, width, height, mask) {
|
|
|
21201
21440
|
}
|
|
21202
21441
|
}
|
|
21203
21442
|
class PDFTable {
|
|
21204
|
-
constructor(document) {
|
|
21205
|
-
|
|
21443
|
+
constructor(document, opts) {
|
|
21444
|
+
if (opts === void 0) {
|
|
21445
|
+
opts = {};
|
|
21446
|
+
}
|
|
21206
21447
|
this.document = document;
|
|
21207
21448
|
this.opts = Object.freeze(opts);
|
|
21208
21449
|
normalizeTable.call(this);
|
|
@@ -21214,8 +21455,10 @@ class PDFTable {
|
|
|
21214
21455
|
return this.end();
|
|
21215
21456
|
}
|
|
21216
21457
|
}
|
|
21217
|
-
row(row) {
|
|
21218
|
-
|
|
21458
|
+
row(row, lastRow) {
|
|
21459
|
+
if (lastRow === void 0) {
|
|
21460
|
+
lastRow = false;
|
|
21461
|
+
}
|
|
21219
21462
|
if (this._ended) {
|
|
21220
21463
|
throw new Error(`Table was marked as ended on row ${this._currRowIndex}`);
|
|
21221
21464
|
}
|
|
@@ -21263,8 +21506,10 @@ class PDFMetadata {
|
|
|
21263
21506
|
<?xpacket end="w"?>
|
|
21264
21507
|
`);
|
|
21265
21508
|
}
|
|
21266
|
-
append(xml) {
|
|
21267
|
-
|
|
21509
|
+
append(xml, newline) {
|
|
21510
|
+
if (newline === void 0) {
|
|
21511
|
+
newline = true;
|
|
21512
|
+
}
|
|
21268
21513
|
this._metadata = this._metadata.concat(xml);
|
|
21269
21514
|
if (newline) this._metadata = this._metadata.concat('\n');
|
|
21270
21515
|
}
|
|
@@ -21283,8 +21528,10 @@ var MetadataMixin = {
|
|
|
21283
21528
|
initMetadata() {
|
|
21284
21529
|
this.metadata = new PDFMetadata();
|
|
21285
21530
|
},
|
|
21286
|
-
appendXML(xml) {
|
|
21287
|
-
|
|
21531
|
+
appendXML(xml, newline) {
|
|
21532
|
+
if (newline === void 0) {
|
|
21533
|
+
newline = true;
|
|
21534
|
+
}
|
|
21288
21535
|
this.metadata.append(xml, newline);
|
|
21289
21536
|
},
|
|
21290
21537
|
_addInfo() {
|
|
@@ -21331,7 +21578,7 @@ var MetadataMixin = {
|
|
|
21331
21578
|
}
|
|
21332
21579
|
this.appendXML(`
|
|
21333
21580
|
<rdf:Description rdf:about="" xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
|
|
21334
|
-
<pdf:Producer>${this.info.
|
|
21581
|
+
<pdf:Producer>${this.info.Producer}</pdf:Producer>`, false);
|
|
21335
21582
|
if (this.info.Keywords) {
|
|
21336
21583
|
this.appendXML(`
|
|
21337
21584
|
<pdf:Keywords>${this.info.Keywords}</pdf:Keywords>`, false);
|
|
@@ -21357,8 +21604,10 @@ var MetadataMixin = {
|
|
|
21357
21604
|
}
|
|
21358
21605
|
};
|
|
21359
21606
|
class PDFDocument extends _stream.default.Readable {
|
|
21360
|
-
constructor() {
|
|
21361
|
-
|
|
21607
|
+
constructor(options) {
|
|
21608
|
+
if (options === void 0) {
|
|
21609
|
+
options = {};
|
|
21610
|
+
}
|
|
21362
21611
|
super(options);
|
|
21363
21612
|
this.options = options;
|
|
21364
21613
|
switch (options.pdfVersion) {
|
|
@@ -21489,8 +21738,8 @@ class PDFDocument extends _stream.default.Readable {
|
|
|
21489
21738
|
}
|
|
21490
21739
|
}
|
|
21491
21740
|
addNamedDestination(name) {
|
|
21492
|
-
for (var
|
|
21493
|
-
args[
|
|
21741
|
+
for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
|
21742
|
+
args[_key4 - 1] = arguments[_key4];
|
|
21494
21743
|
}
|
|
21495
21744
|
if (args.length === 0) {
|
|
21496
21745
|
args = ['XYZ', null, null, null];
|
|
@@ -21649,10 +21898,11 @@ module.exports = ___EXPOSE_LOADER_IMPORT___;
|
|
|
21649
21898
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
21650
21899
|
|
|
21651
21900
|
"use strict";
|
|
21901
|
+
var __webpack_unused_export__;
|
|
21652
21902
|
|
|
21653
|
-
|
|
21903
|
+
__webpack_unused_export__ = ({ value: true });
|
|
21654
21904
|
exports.polyval = exports.ghash = void 0;
|
|
21655
|
-
|
|
21905
|
+
__webpack_unused_export__ = _toGHASHKey;
|
|
21656
21906
|
/**
|
|
21657
21907
|
* GHash from AES-GCM and its little-endian "mirror image" Polyval from AES-SIV.
|
|
21658
21908
|
*
|
|
@@ -22802,37 +23052,38 @@ exports.unsafe = {
|
|
|
22802
23052
|
(__unused_webpack_module, exports) {
|
|
22803
23053
|
|
|
22804
23054
|
"use strict";
|
|
23055
|
+
var __webpack_unused_export__;
|
|
22805
23056
|
|
|
22806
23057
|
/**
|
|
22807
23058
|
* Utilities for hex, bytes, CSPRNG.
|
|
22808
23059
|
* @module
|
|
22809
23060
|
*/
|
|
22810
23061
|
/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */
|
|
22811
|
-
|
|
22812
|
-
exports.wrapCipher =
|
|
22813
|
-
|
|
22814
|
-
|
|
22815
|
-
|
|
23062
|
+
__webpack_unused_export__ = ({ value: true });
|
|
23063
|
+
exports.wrapCipher = __webpack_unused_export__ = __webpack_unused_export__ = exports.qv = void 0;
|
|
23064
|
+
__webpack_unused_export__ = isBytes;
|
|
23065
|
+
__webpack_unused_export__ = abool;
|
|
23066
|
+
__webpack_unused_export__ = anumber;
|
|
22816
23067
|
exports.abytes = abytes;
|
|
22817
|
-
|
|
23068
|
+
__webpack_unused_export__ = ahash;
|
|
22818
23069
|
exports.aexists = aexists;
|
|
22819
23070
|
exports.aoutput = aoutput;
|
|
22820
23071
|
exports.u8 = u8;
|
|
22821
23072
|
exports.u32 = u32;
|
|
22822
23073
|
exports.clean = clean;
|
|
22823
23074
|
exports.createView = createView;
|
|
22824
|
-
|
|
22825
|
-
|
|
22826
|
-
|
|
22827
|
-
|
|
22828
|
-
|
|
22829
|
-
|
|
22830
|
-
|
|
23075
|
+
__webpack_unused_export__ = bytesToHex;
|
|
23076
|
+
__webpack_unused_export__ = hexToBytes;
|
|
23077
|
+
__webpack_unused_export__ = hexToNumber;
|
|
23078
|
+
__webpack_unused_export__ = bytesToNumberBE;
|
|
23079
|
+
__webpack_unused_export__ = numberToBytesBE;
|
|
23080
|
+
__webpack_unused_export__ = utf8ToBytes;
|
|
23081
|
+
__webpack_unused_export__ = bytesToUtf8;
|
|
22831
23082
|
exports.toBytes = toBytes;
|
|
22832
23083
|
exports.overlapBytes = overlapBytes;
|
|
22833
23084
|
exports.complexOverlapBytes = complexOverlapBytes;
|
|
22834
23085
|
exports.concatBytes = concatBytes;
|
|
22835
|
-
|
|
23086
|
+
__webpack_unused_export__ = checkOpts;
|
|
22836
23087
|
exports.equalBytes = equalBytes;
|
|
22837
23088
|
exports.getOutput = getOutput;
|
|
22838
23089
|
exports.setBigUint64 = setBigUint64;
|
|
@@ -22905,7 +23156,7 @@ function createView(arr) {
|
|
|
22905
23156
|
return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
|
|
22906
23157
|
}
|
|
22907
23158
|
/** Is current platform little-endian? Most are. Big-Endian platform: IBM */
|
|
22908
|
-
exports.
|
|
23159
|
+
exports.qv = (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();
|
|
22909
23160
|
// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex
|
|
22910
23161
|
const hasHexBuiltin = /* @__PURE__ */ (() =>
|
|
22911
23162
|
// @ts-ignore
|
|
@@ -22985,7 +23236,7 @@ function numberToBytesBE(n, len) {
|
|
|
22985
23236
|
// call of async fn will return Promise, which will be fullfiled only on
|
|
22986
23237
|
// next scheduler queue processing step and this is exactly what we need.
|
|
22987
23238
|
const nextTick = async () => { };
|
|
22988
|
-
|
|
23239
|
+
__webpack_unused_export__ = nextTick;
|
|
22989
23240
|
/**
|
|
22990
23241
|
* Converts string to bytes using UTF8 encoding.
|
|
22991
23242
|
* @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])
|
|
@@ -23073,7 +23324,7 @@ function equalBytes(a, b) {
|
|
|
23073
23324
|
/** For runtime check if class implements interface. */
|
|
23074
23325
|
class Hash {
|
|
23075
23326
|
}
|
|
23076
|
-
|
|
23327
|
+
__webpack_unused_export__ = Hash;
|
|
23077
23328
|
/**
|
|
23078
23329
|
* Wraps a cipher: validates args, ensures encrypt() can only be called once.
|
|
23079
23330
|
* @__NO_SIDE_EFFECTS__
|
|
@@ -23083,7 +23334,7 @@ const wrapCipher = (params, constructor) => {
|
|
|
23083
23334
|
// Validate key
|
|
23084
23335
|
abytes(key);
|
|
23085
23336
|
// Big-Endian hardware is rare. Just in case someone still decides to run ciphers:
|
|
23086
|
-
if (!exports.
|
|
23337
|
+
if (!exports.qv)
|
|
23087
23338
|
throw new Error('Non little-endian hardware is not yet supported');
|
|
23088
23339
|
// Validate nonce if nonceLength is present
|
|
23089
23340
|
if (params.nonceLength !== undefined) {
|
|
@@ -23183,10 +23434,11 @@ function copyBytes(bytes) {
|
|
|
23183
23434
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
23184
23435
|
|
|
23185
23436
|
"use strict";
|
|
23437
|
+
var __webpack_unused_export__;
|
|
23186
23438
|
|
|
23187
|
-
|
|
23439
|
+
__webpack_unused_export__ = ({ value: true });
|
|
23188
23440
|
exports.SHA512_IV = exports.SHA384_IV = exports.SHA224_IV = exports.SHA256_IV = exports.HashMD = void 0;
|
|
23189
|
-
|
|
23441
|
+
__webpack_unused_export__ = setBigUint64;
|
|
23190
23442
|
exports.Chi = Chi;
|
|
23191
23443
|
exports.Maj = Maj;
|
|
23192
23444
|
/**
|
|
@@ -23352,11 +23604,12 @@ exports.SHA512_IV = Uint32Array.from([
|
|
|
23352
23604
|
(__unused_webpack_module, exports) {
|
|
23353
23605
|
|
|
23354
23606
|
"use strict";
|
|
23607
|
+
var __webpack_unused_export__;
|
|
23355
23608
|
|
|
23356
|
-
|
|
23357
|
-
|
|
23609
|
+
__webpack_unused_export__ = ({ value: true });
|
|
23610
|
+
__webpack_unused_export__ = exports.shrSL = exports.shrSH = exports.rotrSL = exports.rotrSH = exports.rotrBL = exports.rotrBH = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = exports.add5L = exports.add5H = exports.add4L = exports.add4H = exports.add3L = exports.add3H = void 0;
|
|
23358
23611
|
exports.add = add;
|
|
23359
|
-
|
|
23612
|
+
__webpack_unused_export__ = fromBig;
|
|
23360
23613
|
exports.split = split;
|
|
23361
23614
|
/**
|
|
23362
23615
|
* Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array.
|
|
@@ -23381,7 +23634,7 @@ function split(lst, le = false) {
|
|
|
23381
23634
|
return [Ah, Al];
|
|
23382
23635
|
}
|
|
23383
23636
|
const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);
|
|
23384
|
-
|
|
23637
|
+
__webpack_unused_export__ = toBig;
|
|
23385
23638
|
// for Shift in [0, 32)
|
|
23386
23639
|
const shrSH = (h, _l, s) => h >>> s;
|
|
23387
23640
|
exports.shrSH = shrSH;
|
|
@@ -23399,19 +23652,19 @@ const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));
|
|
|
23399
23652
|
exports.rotrBL = rotrBL;
|
|
23400
23653
|
// Right rotate for shift===32 (just swaps l&h)
|
|
23401
23654
|
const rotr32H = (_h, l) => l;
|
|
23402
|
-
|
|
23655
|
+
__webpack_unused_export__ = rotr32H;
|
|
23403
23656
|
const rotr32L = (h, _l) => h;
|
|
23404
|
-
|
|
23657
|
+
__webpack_unused_export__ = rotr32L;
|
|
23405
23658
|
// Left rotate for Shift in [1, 32)
|
|
23406
23659
|
const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));
|
|
23407
|
-
|
|
23660
|
+
__webpack_unused_export__ = rotlSH;
|
|
23408
23661
|
const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));
|
|
23409
|
-
|
|
23662
|
+
__webpack_unused_export__ = rotlSL;
|
|
23410
23663
|
// Left rotate for Shift in (32, 64), NOTE: 32 is special case.
|
|
23411
23664
|
const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));
|
|
23412
|
-
|
|
23665
|
+
__webpack_unused_export__ = rotlBH;
|
|
23413
23666
|
const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));
|
|
23414
|
-
|
|
23667
|
+
__webpack_unused_export__ = rotlBL;
|
|
23415
23668
|
// JS uses 32-bit signed integers for bitwise operations which means we cannot
|
|
23416
23669
|
// simple take carry out of low bit sum by shift, we need to use division.
|
|
23417
23670
|
function add(Ah, Al, Bh, Bl) {
|
|
@@ -23440,7 +23693,7 @@ const u64 = {
|
|
|
23440
23693
|
rotlSH, rotlSL, rotlBH, rotlBL,
|
|
23441
23694
|
add, add3L, add3H, add4L, add4H, add5H, add5L,
|
|
23442
23695
|
};
|
|
23443
|
-
|
|
23696
|
+
__webpack_unused_export__ = u64;
|
|
23444
23697
|
|
|
23445
23698
|
|
|
23446
23699
|
/***/ },
|
|
@@ -23449,8 +23702,9 @@ exports["default"] = u64;
|
|
|
23449
23702
|
(__unused_webpack_module, exports) {
|
|
23450
23703
|
|
|
23451
23704
|
"use strict";
|
|
23705
|
+
var __webpack_unused_export__;
|
|
23452
23706
|
|
|
23453
|
-
|
|
23707
|
+
__webpack_unused_export__ = ({ value: true });
|
|
23454
23708
|
exports.crypto = void 0;
|
|
23455
23709
|
exports.crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;
|
|
23456
23710
|
|
|
@@ -23846,36 +24100,6 @@ exports.sha512_256 = (0, utils_ts_1.createHasher)(() => new SHA512_256());
|
|
|
23846
24100
|
exports.sha512_224 = (0, utils_ts_1.createHasher)(() => new SHA512_224());
|
|
23847
24101
|
|
|
23848
24102
|
|
|
23849
|
-
/***/ },
|
|
23850
|
-
|
|
23851
|
-
/***/ 7785
|
|
23852
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
23853
|
-
|
|
23854
|
-
"use strict";
|
|
23855
|
-
|
|
23856
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
23857
|
-
exports.sha224 = exports.SHA224 = exports.sha256 = exports.SHA256 = void 0;
|
|
23858
|
-
/**
|
|
23859
|
-
* SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3.
|
|
23860
|
-
*
|
|
23861
|
-
* To break sha256 using birthday attack, attackers need to try 2^128 hashes.
|
|
23862
|
-
* BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.
|
|
23863
|
-
*
|
|
23864
|
-
* Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).
|
|
23865
|
-
* @module
|
|
23866
|
-
* @deprecated
|
|
23867
|
-
*/
|
|
23868
|
-
const sha2_ts_1 = __webpack_require__(2650);
|
|
23869
|
-
/** @deprecated Use import from `noble/hashes/sha2` module */
|
|
23870
|
-
exports.SHA256 = sha2_ts_1.SHA256;
|
|
23871
|
-
/** @deprecated Use import from `noble/hashes/sha2` module */
|
|
23872
|
-
exports.sha256 = sha2_ts_1.sha256;
|
|
23873
|
-
/** @deprecated Use import from `noble/hashes/sha2` module */
|
|
23874
|
-
exports.SHA224 = sha2_ts_1.SHA224;
|
|
23875
|
-
/** @deprecated Use import from `noble/hashes/sha2` module */
|
|
23876
|
-
exports.sha224 = sha2_ts_1.sha224;
|
|
23877
|
-
|
|
23878
|
-
|
|
23879
24103
|
/***/ },
|
|
23880
24104
|
|
|
23881
24105
|
/***/ 3973
|
|
@@ -29234,7 +29458,7 @@ module.exports = function callBoundIntrinsic(name, allowMissing) {
|
|
|
29234
29458
|
|
|
29235
29459
|
var setFunctionLength = __webpack_require__(6255);
|
|
29236
29460
|
|
|
29237
|
-
var $defineProperty = __webpack_require__(
|
|
29461
|
+
var $defineProperty = __webpack_require__(6649);
|
|
29238
29462
|
|
|
29239
29463
|
var callBindBasic = __webpack_require__(6688);
|
|
29240
29464
|
var applyBind = __webpack_require__(8619);
|
|
@@ -29556,7 +29780,7 @@ if ( true && module.exports) {
|
|
|
29556
29780
|
"use strict";
|
|
29557
29781
|
|
|
29558
29782
|
|
|
29559
|
-
var $defineProperty = __webpack_require__(
|
|
29783
|
+
var $defineProperty = __webpack_require__(6649);
|
|
29560
29784
|
|
|
29561
29785
|
var $SyntaxError = __webpack_require__(7770);
|
|
29562
29786
|
var $TypeError = __webpack_require__(6785);
|
|
@@ -29707,7 +29931,7 @@ module.exports = desc && typeof desc.get === 'function'
|
|
|
29707
29931
|
|
|
29708
29932
|
/***/ },
|
|
29709
29933
|
|
|
29710
|
-
/***/
|
|
29934
|
+
/***/ 6649
|
|
29711
29935
|
(module) {
|
|
29712
29936
|
|
|
29713
29937
|
"use strict";
|
|
@@ -30655,7 +30879,7 @@ var getEvalledConstructor = function (expressionSyntax) {
|
|
|
30655
30879
|
};
|
|
30656
30880
|
|
|
30657
30881
|
var $gOPD = __webpack_require__(8109);
|
|
30658
|
-
var $defineProperty = __webpack_require__(
|
|
30882
|
+
var $defineProperty = __webpack_require__(6649);
|
|
30659
30883
|
|
|
30660
30884
|
var throwTypeError = function () {
|
|
30661
30885
|
throw new $TypeError();
|
|
@@ -31107,7 +31331,7 @@ module.exports = $gOPD;
|
|
|
31107
31331
|
"use strict";
|
|
31108
31332
|
|
|
31109
31333
|
|
|
31110
|
-
var $defineProperty = __webpack_require__(
|
|
31334
|
+
var $defineProperty = __webpack_require__(6649);
|
|
31111
31335
|
|
|
31112
31336
|
var hasPropertyDescriptors = function hasPropertyDescriptors() {
|
|
31113
31337
|
return !!$defineProperty;
|
|
@@ -31540,7 +31764,7 @@ var getProto = __webpack_require__(7106);
|
|
|
31540
31764
|
var toStr = callBound('Object.prototype.toString');
|
|
31541
31765
|
var fnToStr = callBound('Function.prototype.toString');
|
|
31542
31766
|
|
|
31543
|
-
var getGeneratorFunction = __webpack_require__(
|
|
31767
|
+
var getGeneratorFunction = __webpack_require__(9294).c;
|
|
31544
31768
|
|
|
31545
31769
|
/** @type {import('.')} */
|
|
31546
31770
|
module.exports = function isGeneratorFunction(fn) {
|
|
@@ -45783,6 +46007,9 @@ var typedArrays = availableTypedArrays();
|
|
|
45783
46007
|
|
|
45784
46008
|
var $slice = callBound('String.prototype.slice');
|
|
45785
46009
|
|
|
46010
|
+
/** @import { BoundSet, BoundSlice, Cache, Getter } from './types' */
|
|
46011
|
+
/** @import { TypedArrayName } from '.' */
|
|
46012
|
+
|
|
45786
46013
|
/** @type {<T = unknown>(array: readonly T[], value: unknown) => number} */
|
|
45787
46014
|
var $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) {
|
|
45788
46015
|
for (var i = 0; i < array.length; i += 1) {
|
|
@@ -45793,8 +46020,7 @@ var $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(ar
|
|
|
45793
46020
|
return -1;
|
|
45794
46021
|
};
|
|
45795
46022
|
|
|
45796
|
-
/** @
|
|
45797
|
-
/** @type {import('./types').Cache} */
|
|
46023
|
+
/** @type {Cache} */
|
|
45798
46024
|
var cache = { __proto__: null };
|
|
45799
46025
|
if (hasToStringTag && gOPD && getProto) {
|
|
45800
46026
|
forEach(typedArrays, function (typedArray) {
|
|
@@ -45811,7 +46037,8 @@ if (hasToStringTag && gOPD && getProto) {
|
|
|
45811
46037
|
if (descriptor && descriptor.get) {
|
|
45812
46038
|
var bound = callBind(descriptor.get);
|
|
45813
46039
|
cache[
|
|
45814
|
-
/** @type {`$${
|
|
46040
|
+
/** @type {`$${TypedArrayName}`} */
|
|
46041
|
+
('$' + typedArray)
|
|
45815
46042
|
] = bound;
|
|
45816
46043
|
}
|
|
45817
46044
|
}
|
|
@@ -45821,62 +46048,72 @@ if (hasToStringTag && gOPD && getProto) {
|
|
|
45821
46048
|
var arr = new g[typedArray]();
|
|
45822
46049
|
var fn = arr.slice || arr.set;
|
|
45823
46050
|
if (fn) {
|
|
45824
|
-
var bound = /** @type {
|
|
46051
|
+
var bound = /** @type {BoundSlice | BoundSet} */ (
|
|
45825
46052
|
// @ts-expect-error TODO FIXME
|
|
45826
46053
|
callBind(fn)
|
|
45827
46054
|
);
|
|
45828
46055
|
cache[
|
|
45829
|
-
/** @type {`$${
|
|
46056
|
+
/** @type {`$${TypedArrayName}`} */
|
|
46057
|
+
('$' + typedArray)
|
|
45830
46058
|
] = bound;
|
|
45831
46059
|
}
|
|
45832
46060
|
});
|
|
45833
46061
|
}
|
|
45834
46062
|
|
|
45835
|
-
/** @type {(value: object) => false |
|
|
45836
|
-
|
|
45837
|
-
/** @type {ReturnType<typeof
|
|
46063
|
+
/** @type {(value: object) => false | TypedArrayName} */
|
|
46064
|
+
function tryTypedArrays(value) {
|
|
46065
|
+
/** @type {ReturnType<typeof tryTypedArrays>} */ var found = false;
|
|
45838
46066
|
forEach(
|
|
45839
|
-
/** @type {Record
|
|
45840
|
-
/** @
|
|
46067
|
+
/** @type {Record<`$${TypedArrayName}`, Getter>} */ (cache),
|
|
46068
|
+
/** @param {Getter} getter @param {`$${TypedArrayName}`} typedArray */
|
|
45841
46069
|
function (getter, typedArray) {
|
|
45842
46070
|
if (!found) {
|
|
45843
46071
|
try {
|
|
45844
46072
|
// @ts-expect-error a throw is fine here
|
|
45845
46073
|
if ('$' + getter(value) === typedArray) {
|
|
45846
|
-
found = /** @type {
|
|
46074
|
+
found = /** @type {TypedArrayName} */ ($slice(typedArray, 1));
|
|
45847
46075
|
}
|
|
45848
46076
|
} catch (e) { /**/ }
|
|
45849
46077
|
}
|
|
45850
46078
|
}
|
|
45851
46079
|
);
|
|
45852
46080
|
return found;
|
|
45853
|
-
}
|
|
46081
|
+
}
|
|
45854
46082
|
|
|
45855
|
-
/** @type {(value: object) => false |
|
|
45856
|
-
|
|
45857
|
-
/** @type {ReturnType<typeof
|
|
46083
|
+
/** @type {(value: object) => false | TypedArrayName} */
|
|
46084
|
+
function trySlices(value) {
|
|
46085
|
+
/** @type {ReturnType<typeof trySlices>} */ var found = false;
|
|
45858
46086
|
forEach(
|
|
45859
|
-
/** @type {Record
|
|
45860
|
-
/** @
|
|
46087
|
+
/** @type {Record<`$${TypedArrayName}`, Getter>} */(cache),
|
|
46088
|
+
/** @param {Getter} getter @param {`$${TypedArrayName}`} name */ function (getter, name) {
|
|
45861
46089
|
if (!found) {
|
|
45862
46090
|
try {
|
|
45863
46091
|
// @ts-expect-error a throw is fine here
|
|
45864
46092
|
getter(value);
|
|
45865
|
-
found = /** @type {
|
|
46093
|
+
found = /** @type {TypedArrayName} */ ($slice(name, 1));
|
|
45866
46094
|
} catch (e) { /**/ }
|
|
45867
46095
|
}
|
|
45868
46096
|
}
|
|
45869
46097
|
);
|
|
45870
46098
|
return found;
|
|
45871
|
-
}
|
|
46099
|
+
}
|
|
45872
46100
|
|
|
45873
|
-
/** @type {
|
|
46101
|
+
/** @type {(tag: unknown) => tag is typeof typedArrays[number]} */
|
|
46102
|
+
function isTATag(tag) {
|
|
46103
|
+
return $indexOf(typedArrays, tag) > -1;
|
|
46104
|
+
}
|
|
46105
|
+
|
|
46106
|
+
/**
|
|
46107
|
+
* @type {import('.')}
|
|
46108
|
+
* @param {unknown} value
|
|
46109
|
+
*/
|
|
45874
46110
|
module.exports = function whichTypedArray(value) {
|
|
45875
|
-
if (!value || typeof value !== 'object') {
|
|
46111
|
+
if (!value || typeof value !== 'object') {
|
|
46112
|
+
return false;
|
|
46113
|
+
}
|
|
45876
46114
|
if (!hasToStringTag) {
|
|
45877
|
-
/** @type {string} */
|
|
45878
46115
|
var tag = $slice($toString(value), 8, -1);
|
|
45879
|
-
if (
|
|
46116
|
+
if (isTATag(tag)) {
|
|
45880
46117
|
return tag;
|
|
45881
46118
|
}
|
|
45882
46119
|
if (tag !== 'Object') {
|
|
@@ -45892,7 +46129,7 @@ module.exports = function whichTypedArray(value) {
|
|
|
45892
46129
|
|
|
45893
46130
|
/***/ },
|
|
45894
46131
|
|
|
45895
|
-
/***/
|
|
46132
|
+
/***/ 1438
|
|
45896
46133
|
(module, exports, __webpack_require__) {
|
|
45897
46134
|
|
|
45898
46135
|
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(a,b){if(true)!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (b),
|
|
@@ -45919,13 +46156,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
45919
46156
|
|
|
45920
46157
|
/***/ },
|
|
45921
46158
|
|
|
45922
|
-
/***/ 5470
|
|
45923
|
-
() {
|
|
45924
|
-
|
|
45925
|
-
/* (ignored) */
|
|
45926
|
-
|
|
45927
|
-
/***/ },
|
|
45928
|
-
|
|
45929
46159
|
/***/ 3779
|
|
45930
46160
|
() {
|
|
45931
46161
|
|
|
@@ -65289,6 +65519,24 @@ function formatText(text, options) {
|
|
|
65289
65519
|
exports["default"] = XmlDocument;
|
|
65290
65520
|
|
|
65291
65521
|
|
|
65522
|
+
/***/ },
|
|
65523
|
+
|
|
65524
|
+
/***/ 9294
|
|
65525
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
65526
|
+
|
|
65527
|
+
"use strict";
|
|
65528
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
65529
|
+
/* harmony export */ c: () => (/* reexport default export from named module */ _index_js__WEBPACK_IMPORTED_MODULE_0__)
|
|
65530
|
+
/* harmony export */ });
|
|
65531
|
+
/* unused harmony import specifier */ var getGeneratorFunction;
|
|
65532
|
+
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3011);
|
|
65533
|
+
|
|
65534
|
+
|
|
65535
|
+
/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && (getGeneratorFunction)));
|
|
65536
|
+
|
|
65537
|
+
|
|
65538
|
+
|
|
65539
|
+
|
|
65292
65540
|
/***/ },
|
|
65293
65541
|
|
|
65294
65542
|
/***/ 1635
|
|
@@ -65626,10 +65874,10 @@ function __addDisposableResource(env, value, async) {
|
|
|
65626
65874
|
return value;
|
|
65627
65875
|
}
|
|
65628
65876
|
|
|
65629
|
-
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
65877
|
+
var _SuppressedError = (/* unused pure expression or super */ null && (typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
65630
65878
|
var e = new Error(message);
|
|
65631
65879
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
65632
|
-
};
|
|
65880
|
+
}));
|
|
65633
65881
|
|
|
65634
65882
|
function __disposeResources(env) {
|
|
65635
65883
|
function fail(e) {
|
|
@@ -65666,7 +65914,7 @@ function __rewriteRelativeImportExtension(path, preserveJsx) {
|
|
|
65666
65914
|
return path;
|
|
65667
65915
|
}
|
|
65668
65916
|
|
|
65669
|
-
/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ({
|
|
65917
|
+
/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && ({
|
|
65670
65918
|
__extends,
|
|
65671
65919
|
__assign,
|
|
65672
65920
|
__rest,
|
|
@@ -65699,7 +65947,7 @@ function __rewriteRelativeImportExtension(path, preserveJsx) {
|
|
|
65699
65947
|
__addDisposableResource,
|
|
65700
65948
|
__disposeResources,
|
|
65701
65949
|
__rewriteRelativeImportExtension,
|
|
65702
|
-
});
|
|
65950
|
+
})));
|
|
65703
65951
|
|
|
65704
65952
|
|
|
65705
65953
|
/***/ }
|