docx-plus 0.0.2 → 0.0.4

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/index.cjs CHANGED
@@ -23,14 +23,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
  //#endregion
24
24
  let xml_js = require("xml-js");
25
25
  let hash_js = require("hash.js");
26
- hash_js = __toESM(hash_js);
26
+ hash_js = __toESM(hash_js, 1);
27
27
  let nanoid_non_secure = require("nanoid/non-secure");
28
- let stream = require("stream");
29
- let fflate = require("fflate");
30
28
  let undio = require("undio");
29
+ let fflate = require("fflate");
31
30
  let xml = require("xml");
32
- xml = __toESM(xml);
33
- //#region \0@oxc-project+runtime@0.123.0/helpers/typeof.js
31
+ xml = __toESM(xml, 1);
32
+ //#region \0@oxc-project+runtime@0.124.0/helpers/typeof.js
34
33
  function _typeof(o) {
35
34
  "@babel/helpers - typeof";
36
35
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -40,7 +39,7 @@ function _typeof(o) {
40
39
  }, _typeof(o);
41
40
  }
42
41
  //#endregion
43
- //#region \0@oxc-project+runtime@0.123.0/helpers/toPrimitive.js
42
+ //#region \0@oxc-project+runtime@0.124.0/helpers/toPrimitive.js
44
43
  function toPrimitive(t, r) {
45
44
  if ("object" != _typeof(t) || !t) return t;
46
45
  var e = t[Symbol.toPrimitive];
@@ -52,13 +51,13 @@ function toPrimitive(t, r) {
52
51
  return ("string" === r ? String : Number)(t);
53
52
  }
54
53
  //#endregion
55
- //#region \0@oxc-project+runtime@0.123.0/helpers/toPropertyKey.js
54
+ //#region \0@oxc-project+runtime@0.124.0/helpers/toPropertyKey.js
56
55
  function toPropertyKey(t) {
57
56
  var i = toPrimitive(t, "string");
58
57
  return "symbol" == _typeof(i) ? i : i + "";
59
58
  }
60
59
  //#endregion
61
- //#region \0@oxc-project+runtime@0.123.0/helpers/defineProperty.js
60
+ //#region \0@oxc-project+runtime@0.124.0/helpers/defineProperty.js
62
61
  function _defineProperty(e, r, t) {
63
62
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
64
63
  value: t,
@@ -243,29 +242,6 @@ var IgnoreIfEmptyXmlComponent = class extends XmlComponent {
243
242
  }
244
243
  };
245
244
  //#endregion
246
- //#region \0@oxc-project+runtime@0.123.0/helpers/objectSpread2.js
247
- function ownKeys(e, r) {
248
- var t = Object.keys(e);
249
- if (Object.getOwnPropertySymbols) {
250
- var o = Object.getOwnPropertySymbols(e);
251
- r && (o = o.filter(function(r) {
252
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
253
- })), t.push.apply(t, o);
254
- }
255
- return t;
256
- }
257
- function _objectSpread2(e) {
258
- for (var r = 1; r < arguments.length; r++) {
259
- var t = null != arguments[r] ? arguments[r] : {};
260
- r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
261
- _defineProperty(e, r, t[r]);
262
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
263
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
264
- });
265
- }
266
- return e;
267
- }
268
- //#endregion
269
245
  //#region src/file/xml-components/default-attributes.ts
270
246
  /**
271
247
  * XML attribute components for the docx library.
@@ -359,7 +335,10 @@ var NextAttributeComponent = class extends BaseXmlComponent {
359
335
  * @returns Object with _attr key containing the attributes
360
336
  */
361
337
  prepForXml(_) {
362
- return { _attr: Object.values(this.root).filter(({ value }) => value !== void 0).reduce((acc, { key, value }) => _objectSpread2(_objectSpread2({}, acc), {}, { [key]: value }), {}) };
338
+ return { _attr: Object.values(this.root).filter(({ value }) => value !== void 0).reduce((acc, { key, value }) => ({
339
+ ...acc,
340
+ [key]: value
341
+ }), {}) };
363
342
  }
364
343
  };
365
344
  //#endregion
@@ -4733,13 +4712,16 @@ var ChildNonVisualProperties = class extends XmlComponent {
4733
4712
  * @returns An XML component representing the click hyperlink
4734
4713
  */
4735
4714
  const createHyperlinkClick = (linkId, hasXmlNs) => new BuilderElement({
4736
- attributes: _objectSpread2(_objectSpread2({}, hasXmlNs ? { xmlns: {
4737
- key: "xmlns:a",
4738
- value: "http://schemas.openxmlformats.org/drawingml/2006/main"
4739
- } } : {}), {}, { id: {
4740
- key: "r:id",
4741
- value: `rId${linkId}`
4742
- } }),
4715
+ attributes: {
4716
+ ...hasXmlNs ? { xmlns: {
4717
+ key: "xmlns:a",
4718
+ value: "http://schemas.openxmlformats.org/drawingml/2006/main"
4719
+ } } : {},
4720
+ id: {
4721
+ key: "r:id",
4722
+ value: `rId${linkId}`
4723
+ }
4724
+ },
4743
4725
  name: "a:hlinkClick"
4744
4726
  });
4745
4727
  //#endregion
@@ -4987,21 +4969,23 @@ var GraphicData = class extends XmlComponent {
4987
4969
  super("a:graphicData");
4988
4970
  if (mediaData.type === "wps") {
4989
4971
  this.root.push(new GraphicDataAttributes({ uri: "http://schemas.microsoft.com/office/word/2010/wordprocessingShape" }));
4990
- const wps = createWpsShape(_objectSpread2(_objectSpread2({}, mediaData.data), {}, {
4972
+ const wps = createWpsShape({
4973
+ ...mediaData.data,
4991
4974
  outline,
4992
4975
  solidFill,
4993
4976
  transformation: transform
4994
- }));
4977
+ });
4995
4978
  this.root.push(wps);
4996
4979
  } else if (mediaData.type === "wpg") {
4997
4980
  this.root.push(new GraphicDataAttributes({ uri: "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" }));
4998
4981
  const wpg = createWpgGroup({
4999
4982
  children: mediaData.children.map((child) => {
5000
- if (child.type === "wps") return createWpsShape(_objectSpread2(_objectSpread2({}, child.data), {}, {
4983
+ if (child.type === "wps") return createWpsShape({
4984
+ ...child.data,
5001
4985
  outline: child.outline,
5002
4986
  solidFill: child.solidFill,
5003
4987
  transformation: child.transformation
5004
- }));
4988
+ });
5005
4989
  else return new Pic({
5006
4990
  mediaData: child,
5007
4991
  outline: child.outline,
@@ -5630,14 +5614,15 @@ var AnchorAttributes = class extends XmlAttributeComponent {
5630
5614
  var Anchor = class extends XmlComponent {
5631
5615
  constructor({ mediaData, transform, drawingOptions }) {
5632
5616
  super("wp:anchor");
5633
- const floating = _objectSpread2({
5617
+ const floating = {
5634
5618
  allowOverlap: true,
5635
5619
  behindDocument: false,
5636
5620
  horizontalPosition: {},
5637
5621
  layoutInCell: true,
5638
5622
  lockAnchor: false,
5639
- verticalPosition: {}
5640
- }, drawingOptions.floating);
5623
+ verticalPosition: {},
5624
+ ...drawingOptions.floating
5625
+ };
5641
5626
  this.root.push(new AnchorAttributes({
5642
5627
  distT: floating.margins ? floating.margins.top || 0 : 0,
5643
5628
  distB: floating.margins ? floating.margins.bottom || 0 : 0,
@@ -5777,29 +5762,20 @@ var Drawing = class extends XmlComponent {
5777
5762
  };
5778
5763
  //#endregion
5779
5764
  //#region src/file/paragraph/run/image-run.ts
5780
- const convertDataURIToBinary = (dataURI) => {
5781
- const base64Index = dataURI.indexOf(";base64,");
5782
- const base64IndexWithOffset = base64Index === -1 ? 0 : base64Index + 8;
5783
- const binaryString = atob(dataURI.substring(base64IndexWithOffset));
5784
- const bytes = new Uint8Array(binaryString.length);
5785
- for (let i = 0; i < binaryString.length; i++) bytes[i] = binaryString.charCodeAt(i);
5786
- return bytes;
5787
- };
5788
- const standardizeData = (data) => typeof data === "string" ? convertDataURIToBinary(data) : data;
5789
- const createImageData = (options, key) => ({
5790
- data: standardizeData(options.data),
5765
+ const createImageData = (data, transformation, key) => ({
5766
+ data,
5791
5767
  fileName: key,
5792
5768
  transformation: {
5793
5769
  emus: {
5794
- x: Math.round(options.transformation.width * 9525),
5795
- y: Math.round(options.transformation.height * 9525)
5770
+ x: Math.round(transformation.width * 9525),
5771
+ y: Math.round(transformation.height * 9525)
5796
5772
  },
5797
- flip: options.transformation.flip,
5773
+ flip: transformation.flip,
5798
5774
  pixels: {
5799
- x: Math.round(options.transformation.width),
5800
- y: Math.round(options.transformation.height)
5775
+ x: Math.round(transformation.width),
5776
+ y: Math.round(transformation.height)
5801
5777
  },
5802
- rotation: options.transformation.rotation ? options.transformation.rotation * 6e4 : void 0
5778
+ rotation: transformation.rotation ? transformation.rotation * 6e4 : void 0
5803
5779
  }
5804
5780
  });
5805
5781
  /**
@@ -5828,8 +5804,22 @@ var ImageRun = class extends Run {
5828
5804
  constructor(options) {
5829
5805
  super({});
5830
5806
  _defineProperty(this, "imageData", void 0);
5831
- const key = `${hashedId(options.data)}.${options.type}`;
5832
- this.imageData = options.type === "svg" ? _objectSpread2(_objectSpread2({ type: options.type }, createImageData(options, key)), {}, { fallback: _objectSpread2({ type: options.fallback.type }, createImageData(_objectSpread2(_objectSpread2({}, options.fallback), {}, { transformation: options.transformation }), `${hashedId(options.fallback.data)}.${options.fallback.type}`)) }) : _objectSpread2({ type: options.type }, createImageData(options, key));
5807
+ const rawData = (0, undio.toUint8Array)(options.data);
5808
+ const key = `${hashedId(rawData)}.${options.type}`;
5809
+ if (options.type === "svg") {
5810
+ const fallbackData = (0, undio.toUint8Array)(options.fallback.data);
5811
+ this.imageData = {
5812
+ type: options.type,
5813
+ ...createImageData(rawData, options.transformation, key),
5814
+ fallback: {
5815
+ type: options.fallback.type,
5816
+ ...createImageData(fallbackData, options.transformation, `${hashedId(fallbackData)}.${options.fallback.type}`)
5817
+ }
5818
+ };
5819
+ } else this.imageData = {
5820
+ type: options.type,
5821
+ ...createImageData(rawData, options.transformation, key)
5822
+ };
5833
5823
  const drawing = new Drawing(this.imageData, {
5834
5824
  docProperties: options.altText,
5835
5825
  floating: options.floating,
@@ -5878,7 +5868,7 @@ var WpsShapeRun = class extends Run {
5878
5868
  super({});
5879
5869
  _defineProperty(this, "wpsShapeData", void 0);
5880
5870
  this.wpsShapeData = {
5881
- data: _objectSpread2({}, options),
5871
+ data: { ...options },
5882
5872
  transformation: createTransformation(options.transformation),
5883
5873
  type: options.type
5884
5874
  };
@@ -7905,13 +7895,16 @@ const CharacterSet = {
7905
7895
  * Creates a font relationship element for embedding fonts.
7906
7896
  */
7907
7897
  const createFontRelationship = ({ id, fontKey, subsetted }, name) => new BuilderElement({
7908
- attributes: _objectSpread2({ id: {
7909
- key: "r:id",
7910
- value: id
7911
- } }, fontKey ? { fontKey: {
7912
- key: "w:fontKey",
7913
- value: `{${fontKey}}`
7914
- } } : {}),
7898
+ attributes: {
7899
+ id: {
7900
+ key: "r:id",
7901
+ value: id
7902
+ },
7903
+ ...fontKey ? { fontKey: {
7904
+ key: "w:fontKey",
7905
+ value: `{${fontKey}}`
7906
+ } } : {}
7907
+ },
7915
7908
  children: subsetted ? [new OnOffElement("w:subsetted", subsetted)] : [],
7916
7909
  name
7917
7910
  });
@@ -8149,7 +8142,10 @@ var FontWrapper = class {
8149
8142
  _defineProperty(this, "fontTable", void 0);
8150
8143
  _defineProperty(this, "relationships", void 0);
8151
8144
  _defineProperty(this, "fontOptionsWithKey", []);
8152
- this.fontOptionsWithKey = options.map((o) => _objectSpread2(_objectSpread2({}, o), {}, { fontKey: uniqueUuid() }));
8145
+ this.fontOptionsWithKey = options.map((o) => ({
8146
+ ...o,
8147
+ fontKey: uniqueUuid()
8148
+ }));
8153
8149
  this.fontTable = createFontTable(this.fontOptionsWithKey);
8154
8150
  this.relationships = new Relationships();
8155
8151
  for (let i = 0; i < options.length; i++) this.relationships.addRelationship(i + 1, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/font", `fonts/${options[i].name}.odttf`);
@@ -8567,7 +8563,10 @@ var ParagraphPropertiesChange = class extends XmlComponent {
8567
8563
  date: options.date,
8568
8564
  id: options.id
8569
8565
  }));
8570
- this.root.push(new ParagraphProperties(_objectSpread2(_objectSpread2({}, options), {}, { includeIfEmpty: true })));
8566
+ this.root.push(new ParagraphProperties({
8567
+ ...options,
8568
+ includeIfEmpty: true
8569
+ }));
8571
8570
  }
8572
8571
  };
8573
8572
  //#endregion
@@ -10782,7 +10781,10 @@ const VerticalAlignTable = {
10782
10781
  *
10783
10782
  * @publicApi
10784
10783
  */
10785
- const VerticalAlignSection = _objectSpread2(_objectSpread2({}, VerticalAlignTable), {}, { BOTH: "both" });
10784
+ const VerticalAlignSection = {
10785
+ ...VerticalAlignTable,
10786
+ BOTH: "both"
10787
+ };
10786
10788
  /**
10787
10789
  * @deprecated Use {@link VerticalAlignTable} for table cells or
10788
10790
  * {@link VerticalAlignSection} for section properties. This alias remains for
@@ -11299,7 +11301,10 @@ var TableCellPropertiesChange = class extends XmlComponent {
11299
11301
  date: options.date,
11300
11302
  id: options.id
11301
11303
  }));
11302
- this.root.push(new TableCellProperties(_objectSpread2(_objectSpread2({}, options), {}, { includeIfEmpty: true })));
11304
+ this.root.push(new TableCellProperties({
11305
+ ...options,
11306
+ includeIfEmpty: true
11307
+ }));
11303
11308
  }
11304
11309
  };
11305
11310
  //#endregion
@@ -11843,7 +11848,10 @@ var TablePropertiesChange = class extends XmlComponent {
11843
11848
  date: options.date,
11844
11849
  id: options.id
11845
11850
  }));
11846
- this.root.push(new TableProperties(_objectSpread2(_objectSpread2({}, options), {}, { includeIfEmpty: true })));
11851
+ this.root.push(new TableProperties({
11852
+ ...options,
11853
+ includeIfEmpty: true
11854
+ }));
11847
11855
  }
11848
11856
  };
11849
11857
  //#endregion
@@ -12088,7 +12096,10 @@ var TableRowPropertiesChange = class extends XmlComponent {
12088
12096
  date: options.date,
12089
12097
  id: options.id
12090
12098
  }));
12091
- this.root.push(new TableRowProperties(_objectSpread2(_objectSpread2({}, options), {}, { includeIfEmpty: true })));
12099
+ this.root.push(new TableRowProperties({
12100
+ ...options,
12101
+ includeIfEmpty: true
12102
+ }));
12092
12103
  }
12093
12104
  };
12094
12105
  //#endregion
@@ -12487,8 +12498,14 @@ const DocumentAttributeNamespaces = {
12487
12498
  */
12488
12499
  var DocumentAttributes = class extends XmlAttributeComponent {
12489
12500
  constructor(ns, Ignorable) {
12490
- super(_objectSpread2({ Ignorable }, Object.fromEntries(ns.map((n) => [n, DocumentAttributeNamespaces[n]]))));
12491
- _defineProperty(this, "xmlKeys", _objectSpread2({ Ignorable: "mc:Ignorable" }, Object.fromEntries(Object.keys(DocumentAttributeNamespaces).map((key) => [key, `xmlns:${key}`]))));
12501
+ super({
12502
+ Ignorable,
12503
+ ...Object.fromEntries(ns.map((n) => [n, DocumentAttributeNamespaces[n]]))
12504
+ });
12505
+ _defineProperty(this, "xmlKeys", {
12506
+ Ignorable: "mc:Ignorable",
12507
+ ...Object.fromEntries(Object.keys(DocumentAttributeNamespaces).map((key) => [key, `xmlns:${key}`]))
12508
+ });
12492
12509
  }
12493
12510
  };
12494
12511
  //#endregion
@@ -16168,7 +16185,10 @@ var Settings = class extends XmlComponent {
16168
16185
  if (((_options$hyphenation2 = options.hyphenation) === null || _options$hyphenation2 === void 0 ? void 0 : _options$hyphenation2.hyphenationZone) !== void 0) this.root.push(new NumberValueElement("w:hyphenationZone", options.hyphenation.hyphenationZone));
16169
16186
  if (((_options$hyphenation3 = options.hyphenation) === null || _options$hyphenation3 === void 0 ? void 0 : _options$hyphenation3.consecutiveHyphenLimit) !== void 0) this.root.push(new NumberValueElement("w:consecutiveHyphenLimit", options.hyphenation.consecutiveHyphenLimit));
16170
16187
  if (((_options$hyphenation4 = options.hyphenation) === null || _options$hyphenation4 === void 0 ? void 0 : _options$hyphenation4.doNotHyphenateCaps) !== void 0) this.root.push(new OnOffElement("w:doNotHyphenateCaps", options.hyphenation.doNotHyphenateCaps));
16171
- this.root.push(new Compatibility(_objectSpread2(_objectSpread2({}, options.compatibility), {}, { version: (_ref = (_options$compatibilit = (_options$compatibilit2 = options.compatibility) === null || _options$compatibilit2 === void 0 ? void 0 : _options$compatibilit2.version) !== null && _options$compatibilit !== void 0 ? _options$compatibilit : options.compatibilityModeVersion) !== null && _ref !== void 0 ? _ref : 15 })));
16188
+ this.root.push(new Compatibility({
16189
+ ...options.compatibility,
16190
+ version: (_ref = (_options$compatibilit = (_options$compatibilit2 = options.compatibility) === null || _options$compatibilit2 === void 0 ? void 0 : _options$compatibilit2.version) !== null && _options$compatibilit !== void 0 ? _options$compatibilit : options.compatibilityModeVersion) !== null && _ref !== void 0 ? _ref : 15
16191
+ }));
16172
16192
  }
16173
16193
  };
16174
16194
  //#endregion
@@ -16437,10 +16457,11 @@ var StyleForCharacter = class extends Style {
16437
16457
  super({
16438
16458
  styleId: options.id,
16439
16459
  type: "character"
16440
- }, _objectSpread2({
16460
+ }, {
16441
16461
  uiPriority: 99,
16442
- unhideWhenUsed: true
16443
- }, options));
16462
+ unhideWhenUsed: true,
16463
+ ...options
16464
+ });
16444
16465
  _defineProperty(this, "runProperties", void 0);
16445
16466
  this.runProperties = new RunProperties(options.run);
16446
16467
  this.root.push(this.runProperties);
@@ -16476,11 +16497,12 @@ var StyleForCharacter = class extends Style {
16476
16497
  */
16477
16498
  var HeadingStyle = class extends StyleForParagraph {
16478
16499
  constructor(options) {
16479
- super(_objectSpread2({
16500
+ super({
16480
16501
  basedOn: "Normal",
16481
16502
  next: "Normal",
16482
- quickFormat: true
16483
- }, options));
16503
+ quickFormat: true,
16504
+ ...options
16505
+ });
16484
16506
  }
16485
16507
  };
16486
16508
  /**
@@ -16497,10 +16519,11 @@ var HeadingStyle = class extends StyleForParagraph {
16497
16519
  */
16498
16520
  var TitleStyle = class extends HeadingStyle {
16499
16521
  constructor(options) {
16500
- super(_objectSpread2({
16522
+ super({
16501
16523
  id: "Title",
16502
- name: "Title"
16503
- }, options));
16524
+ name: "Title",
16525
+ ...options
16526
+ });
16504
16527
  }
16505
16528
  };
16506
16529
  /**
@@ -16517,10 +16540,11 @@ var TitleStyle = class extends HeadingStyle {
16517
16540
  */
16518
16541
  var Heading1Style = class extends HeadingStyle {
16519
16542
  constructor(options) {
16520
- super(_objectSpread2({
16543
+ super({
16521
16544
  id: "Heading1",
16522
- name: "Heading 1"
16523
- }, options));
16545
+ name: "Heading 1",
16546
+ ...options
16547
+ });
16524
16548
  }
16525
16549
  };
16526
16550
  /**
@@ -16530,10 +16554,11 @@ var Heading1Style = class extends HeadingStyle {
16530
16554
  */
16531
16555
  var Heading2Style = class extends HeadingStyle {
16532
16556
  constructor(options) {
16533
- super(_objectSpread2({
16557
+ super({
16534
16558
  id: "Heading2",
16535
- name: "Heading 2"
16536
- }, options));
16559
+ name: "Heading 2",
16560
+ ...options
16561
+ });
16537
16562
  }
16538
16563
  };
16539
16564
  /**
@@ -16543,10 +16568,11 @@ var Heading2Style = class extends HeadingStyle {
16543
16568
  */
16544
16569
  var Heading3Style = class extends HeadingStyle {
16545
16570
  constructor(options) {
16546
- super(_objectSpread2({
16571
+ super({
16547
16572
  id: "Heading3",
16548
- name: "Heading 3"
16549
- }, options));
16573
+ name: "Heading 3",
16574
+ ...options
16575
+ });
16550
16576
  }
16551
16577
  };
16552
16578
  /**
@@ -16556,10 +16582,11 @@ var Heading3Style = class extends HeadingStyle {
16556
16582
  */
16557
16583
  var Heading4Style = class extends HeadingStyle {
16558
16584
  constructor(options) {
16559
- super(_objectSpread2({
16585
+ super({
16560
16586
  id: "Heading4",
16561
- name: "Heading 4"
16562
- }, options));
16587
+ name: "Heading 4",
16588
+ ...options
16589
+ });
16563
16590
  }
16564
16591
  };
16565
16592
  /**
@@ -16569,10 +16596,11 @@ var Heading4Style = class extends HeadingStyle {
16569
16596
  */
16570
16597
  var Heading5Style = class extends HeadingStyle {
16571
16598
  constructor(options) {
16572
- super(_objectSpread2({
16599
+ super({
16573
16600
  id: "Heading5",
16574
- name: "Heading 5"
16575
- }, options));
16601
+ name: "Heading 5",
16602
+ ...options
16603
+ });
16576
16604
  }
16577
16605
  };
16578
16606
  /**
@@ -16582,10 +16610,11 @@ var Heading5Style = class extends HeadingStyle {
16582
16610
  */
16583
16611
  var Heading6Style = class extends HeadingStyle {
16584
16612
  constructor(options) {
16585
- super(_objectSpread2({
16613
+ super({
16586
16614
  id: "Heading6",
16587
- name: "Heading 6"
16588
- }, options));
16615
+ name: "Heading 6",
16616
+ ...options
16617
+ });
16589
16618
  }
16590
16619
  };
16591
16620
  /**
@@ -16595,10 +16624,11 @@ var Heading6Style = class extends HeadingStyle {
16595
16624
  */
16596
16625
  var StrongStyle = class extends HeadingStyle {
16597
16626
  constructor(options) {
16598
- super(_objectSpread2({
16627
+ super({
16599
16628
  id: "Strong",
16600
- name: "Strong"
16601
- }, options));
16629
+ name: "Strong",
16630
+ ...options
16631
+ });
16602
16632
  }
16603
16633
  };
16604
16634
  /**
@@ -16608,12 +16638,13 @@ var StrongStyle = class extends HeadingStyle {
16608
16638
  */
16609
16639
  var ListParagraph = class extends StyleForParagraph {
16610
16640
  constructor(options) {
16611
- super(_objectSpread2({
16641
+ super({
16612
16642
  basedOn: "Normal",
16613
16643
  id: "ListParagraph",
16614
16644
  name: "List Paragraph",
16615
- quickFormat: true
16616
- }, options));
16645
+ quickFormat: true,
16646
+ ...options
16647
+ });
16617
16648
  }
16618
16649
  };
16619
16650
  /**
@@ -16623,7 +16654,7 @@ var ListParagraph = class extends StyleForParagraph {
16623
16654
  */
16624
16655
  var FootnoteText = class extends StyleForParagraph {
16625
16656
  constructor(options) {
16626
- super(_objectSpread2({
16657
+ super({
16627
16658
  basedOn: "Normal",
16628
16659
  id: "FootnoteText",
16629
16660
  link: "FootnoteTextChar",
@@ -16636,8 +16667,9 @@ var FootnoteText = class extends StyleForParagraph {
16636
16667
  run: { size: 20 },
16637
16668
  semiHidden: true,
16638
16669
  uiPriority: 99,
16639
- unhideWhenUsed: true
16640
- }, options));
16670
+ unhideWhenUsed: true,
16671
+ ...options
16672
+ });
16641
16673
  }
16642
16674
  };
16643
16675
  /**
@@ -16647,13 +16679,14 @@ var FootnoteText = class extends StyleForParagraph {
16647
16679
  */
16648
16680
  var FootnoteReferenceStyle = class extends StyleForCharacter {
16649
16681
  constructor(options) {
16650
- super(_objectSpread2({
16682
+ super({
16651
16683
  basedOn: "DefaultParagraphFont",
16652
16684
  id: "FootnoteReference",
16653
16685
  name: "footnote reference",
16654
16686
  run: { superScript: true },
16655
- semiHidden: true
16656
- }, options));
16687
+ semiHidden: true,
16688
+ ...options
16689
+ });
16657
16690
  }
16658
16691
  };
16659
16692
  /**
@@ -16663,14 +16696,15 @@ var FootnoteReferenceStyle = class extends StyleForCharacter {
16663
16696
  */
16664
16697
  var FootnoteTextChar = class extends StyleForCharacter {
16665
16698
  constructor(options) {
16666
- super(_objectSpread2({
16699
+ super({
16667
16700
  basedOn: "DefaultParagraphFont",
16668
16701
  id: "FootnoteTextChar",
16669
16702
  link: "FootnoteText",
16670
16703
  name: "Footnote Text Char",
16671
16704
  run: { size: 20 },
16672
- semiHidden: true
16673
- }, options));
16705
+ semiHidden: true,
16706
+ ...options
16707
+ });
16674
16708
  }
16675
16709
  };
16676
16710
  /**
@@ -16680,7 +16714,7 @@ var FootnoteTextChar = class extends StyleForCharacter {
16680
16714
  */
16681
16715
  var EndnoteText = class extends StyleForParagraph {
16682
16716
  constructor(options) {
16683
- super(_objectSpread2({
16717
+ super({
16684
16718
  basedOn: "Normal",
16685
16719
  id: "EndnoteText",
16686
16720
  link: "EndnoteTextChar",
@@ -16693,8 +16727,9 @@ var EndnoteText = class extends StyleForParagraph {
16693
16727
  run: { size: 20 },
16694
16728
  semiHidden: true,
16695
16729
  uiPriority: 99,
16696
- unhideWhenUsed: true
16697
- }, options));
16730
+ unhideWhenUsed: true,
16731
+ ...options
16732
+ });
16698
16733
  }
16699
16734
  };
16700
16735
  /**
@@ -16704,13 +16739,14 @@ var EndnoteText = class extends StyleForParagraph {
16704
16739
  */
16705
16740
  var EndnoteReferenceStyle = class extends StyleForCharacter {
16706
16741
  constructor(options) {
16707
- super(_objectSpread2({
16742
+ super({
16708
16743
  basedOn: "DefaultParagraphFont",
16709
16744
  id: "EndnoteReference",
16710
16745
  name: "endnote reference",
16711
16746
  run: { superScript: true },
16712
- semiHidden: true
16713
- }, options));
16747
+ semiHidden: true,
16748
+ ...options
16749
+ });
16714
16750
  }
16715
16751
  };
16716
16752
  /**
@@ -16720,14 +16756,15 @@ var EndnoteReferenceStyle = class extends StyleForCharacter {
16720
16756
  */
16721
16757
  var EndnoteTextChar = class extends StyleForCharacter {
16722
16758
  constructor(options) {
16723
- super(_objectSpread2({
16759
+ super({
16724
16760
  basedOn: "DefaultParagraphFont",
16725
16761
  id: "EndnoteTextChar",
16726
16762
  link: "EndnoteText",
16727
16763
  name: "Endnote Text Char",
16728
16764
  run: { size: 20 },
16729
- semiHidden: true
16730
- }, options));
16765
+ semiHidden: true,
16766
+ ...options
16767
+ });
16731
16768
  }
16732
16769
  };
16733
16770
  /**
@@ -16737,15 +16774,16 @@ var EndnoteTextChar = class extends StyleForCharacter {
16737
16774
  */
16738
16775
  var HyperlinkStyle = class extends StyleForCharacter {
16739
16776
  constructor(options) {
16740
- super(_objectSpread2({
16777
+ super({
16741
16778
  basedOn: "DefaultParagraphFont",
16742
16779
  id: "Hyperlink",
16743
16780
  name: "Hyperlink",
16744
16781
  run: {
16745
16782
  color: "0563C1",
16746
16783
  underline: { type: UnderlineType.SINGLE }
16747
- }
16748
- }, options));
16784
+ },
16785
+ ...options
16786
+ });
16749
16787
  }
16750
16788
  };
16751
16789
  //#endregion
@@ -17015,26 +17053,50 @@ var DefaultStylesFactory = class {
17015
17053
  return {
17016
17054
  importedStyles: [
17017
17055
  new DocumentDefaults((_options$document = options.document) !== null && _options$document !== void 0 ? _options$document : {}),
17018
- new TitleStyle(_objectSpread2({ run: { size: 56 } }, options.title)),
17019
- new Heading1Style(_objectSpread2({ run: {
17020
- color: "2E74B5",
17021
- size: 32
17022
- } }, options.heading1)),
17023
- new Heading2Style(_objectSpread2({ run: {
17024
- color: "2E74B5",
17025
- size: 26
17026
- } }, options.heading2)),
17027
- new Heading3Style(_objectSpread2({ run: {
17028
- color: "1F4D78",
17029
- size: 24
17030
- } }, options.heading3)),
17031
- new Heading4Style(_objectSpread2({ run: {
17032
- color: "2E74B5",
17033
- italics: true
17034
- } }, options.heading4)),
17035
- new Heading5Style(_objectSpread2({ run: { color: "2E74B5" } }, options.heading5)),
17036
- new Heading6Style(_objectSpread2({ run: { color: "1F4D78" } }, options.heading6)),
17037
- new StrongStyle(_objectSpread2({ run: { bold: true } }, options.strong)),
17056
+ new TitleStyle({
17057
+ run: { size: 56 },
17058
+ ...options.title
17059
+ }),
17060
+ new Heading1Style({
17061
+ run: {
17062
+ color: "2E74B5",
17063
+ size: 32
17064
+ },
17065
+ ...options.heading1
17066
+ }),
17067
+ new Heading2Style({
17068
+ run: {
17069
+ color: "2E74B5",
17070
+ size: 26
17071
+ },
17072
+ ...options.heading2
17073
+ }),
17074
+ new Heading3Style({
17075
+ run: {
17076
+ color: "1F4D78",
17077
+ size: 24
17078
+ },
17079
+ ...options.heading3
17080
+ }),
17081
+ new Heading4Style({
17082
+ run: {
17083
+ color: "2E74B5",
17084
+ italics: true
17085
+ },
17086
+ ...options.heading4
17087
+ }),
17088
+ new Heading5Style({
17089
+ run: { color: "2E74B5" },
17090
+ ...options.heading5
17091
+ }),
17092
+ new Heading6Style({
17093
+ run: { color: "1F4D78" },
17094
+ ...options.heading6
17095
+ }),
17096
+ new StrongStyle({
17097
+ run: { bold: true },
17098
+ ...options.strong
17099
+ }),
17038
17100
  new ListParagraph(options.listParagraph || {}),
17039
17101
  new HyperlinkStyle(options.hyperlink || {}),
17040
17102
  new FootnoteReferenceStyle(options.footnoteReference || {}),
@@ -17152,11 +17214,12 @@ var File = class {
17152
17214
  _defineProperty(this, "styles", void 0);
17153
17215
  _defineProperty(this, "comments", void 0);
17154
17216
  _defineProperty(this, "fontWrapper", void 0);
17155
- this.coreProperties = new CoreProperties(_objectSpread2(_objectSpread2({}, options), {}, {
17217
+ this.coreProperties = new CoreProperties({
17218
+ ...options,
17156
17219
  creator: (_options$creator = options.creator) !== null && _options$creator !== void 0 ? _options$creator : "Un-named",
17157
17220
  lastModifiedBy: (_options$lastModified = options.lastModifiedBy) !== null && _options$lastModified !== void 0 ? _options$lastModified : "Un-named",
17158
17221
  revision: (_options$revision = options.revision) !== null && _options$revision !== void 0 ? _options$revision : 1
17159
- }));
17222
+ });
17160
17223
  this.numbering = new Numbering(options.numbering ? options.numbering : { config: [] });
17161
17224
  this.comments = new Comments((_options$comments = options.comments) !== null && _options$comments !== void 0 ? _options$comments : { children: [] });
17162
17225
  this.fileRelationships = new Relationships();
@@ -17185,8 +17248,14 @@ var File = class {
17185
17248
  var _options$styles;
17186
17249
  const defaultStyles = new DefaultStylesFactory().newInstance((_options$styles = options.styles) === null || _options$styles === void 0 ? void 0 : _options$styles.default);
17187
17250
  const externalStyles = new ExternalStylesFactory().newInstance(options.externalStyles);
17188
- this.styles = new Styles(_objectSpread2(_objectSpread2({}, externalStyles), {}, { importedStyles: [...defaultStyles.importedStyles, ...externalStyles.importedStyles] }));
17189
- } else if (options.styles) this.styles = new Styles(_objectSpread2(_objectSpread2({}, new DefaultStylesFactory().newInstance(options.styles.default)), options.styles));
17251
+ this.styles = new Styles({
17252
+ ...externalStyles,
17253
+ importedStyles: [...defaultStyles.importedStyles, ...externalStyles.importedStyles]
17254
+ });
17255
+ } else if (options.styles) this.styles = new Styles({
17256
+ ...new DefaultStylesFactory().newInstance(options.styles.default),
17257
+ ...options.styles
17258
+ });
17190
17259
  else this.styles = new Styles(new DefaultStylesFactory().newInstance());
17191
17260
  this.addDefaultRelationships();
17192
17261
  for (const section of options.sections) this.addSection(section);
@@ -17195,7 +17264,8 @@ var File = class {
17195
17264
  this.fontWrapper = new FontWrapper((_options$fonts = options.fonts) !== null && _options$fonts !== void 0 ? _options$fonts : []);
17196
17265
  }
17197
17266
  addSection({ headers = {}, footers = {}, children, properties }) {
17198
- this.documentWrapper.View.Body.addSection(_objectSpread2(_objectSpread2({}, properties), {}, {
17267
+ this.documentWrapper.View.Body.addSection({
17268
+ ...properties,
17199
17269
  footerWrapperGroup: {
17200
17270
  default: footers.default ? this.createFooter(footers.default) : void 0,
17201
17271
  even: footers.even ? this.createFooter(footers.even) : void 0,
@@ -17206,7 +17276,7 @@ var File = class {
17206
17276
  even: headers.even ? this.createHeader(headers.even) : void 0,
17207
17277
  first: headers.first ? this.createHeader(headers.first) : void 0
17208
17278
  }
17209
- }));
17279
+ });
17210
17280
  for (const child of children) this.documentWrapper.View.add(child);
17211
17281
  }
17212
17282
  createHeader(header) {
@@ -17463,28 +17533,6 @@ var StructuredDocumentTagProperties = class extends XmlComponent {
17463
17533
  }
17464
17534
  };
17465
17535
  //#endregion
17466
- //#region \0@oxc-project+runtime@0.123.0/helpers/objectWithoutPropertiesLoose.js
17467
- function _objectWithoutPropertiesLoose(r, e) {
17468
- if (null == r) return {};
17469
- var t = {};
17470
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
17471
- if (e.includes(n)) continue;
17472
- t[n] = r[n];
17473
- }
17474
- return t;
17475
- }
17476
- //#endregion
17477
- //#region \0@oxc-project+runtime@0.123.0/helpers/objectWithoutProperties.js
17478
- function _objectWithoutProperties(e, t) {
17479
- if (null == e) return {};
17480
- var o, r, i = _objectWithoutPropertiesLoose(e, t);
17481
- if (Object.getOwnPropertySymbols) {
17482
- var s = Object.getOwnPropertySymbols(e);
17483
- for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
17484
- }
17485
- return i;
17486
- }
17487
- //#endregion
17488
17536
  //#region src/file/table-of-contents/table-of-contents.ts
17489
17537
  /**
17490
17538
  * Table of Contents module for WordprocessingML documents.
@@ -17496,11 +17544,6 @@ function _objectWithoutProperties(e, t) {
17496
17544
  *
17497
17545
  * @module
17498
17546
  */
17499
- const _excluded$1 = [
17500
- "contentChildren",
17501
- "cachedEntries",
17502
- "beginDirty"
17503
- ];
17504
17547
  /**
17505
17548
  * Represents a Table of Contents in a WordprocessingML document.
17506
17549
  *
@@ -17531,8 +17574,7 @@ const _excluded$1 = [
17531
17574
  * ```
17532
17575
  */
17533
17576
  var TableOfContents = class extends FileChild {
17534
- constructor(alias = "Table of Contents", _ref = {}) {
17535
- let { contentChildren = [], cachedEntries = [], beginDirty = true } = _ref, properties = _objectWithoutProperties(_ref, _excluded$1);
17577
+ constructor(alias = "Table of Contents", { contentChildren = [], cachedEntries = [], beginDirty = true, ...properties } = {}) {
17536
17578
  super("w:sdt");
17537
17579
  this.root.push(new StructuredDocumentTagProperties(alias));
17538
17580
  const content = new StructuredDocumentTagContent();
@@ -18228,7 +18270,6 @@ const createShape = ({ id, children, type = SHAPE_TYPE, style }) => new BuilderE
18228
18270
  *
18229
18271
  * @module
18230
18272
  */
18231
- const _excluded = ["style", "children"];
18232
18273
  /**
18233
18274
  * Represents a textbox in a WordprocessingML document.
18234
18275
  *
@@ -18278,8 +18319,7 @@ const _excluded = ["style", "children"];
18278
18319
  * ```
18279
18320
  */
18280
18321
  var Textbox = class extends FileChild {
18281
- constructor(_ref) {
18282
- let { style, children } = _ref, rest = _objectWithoutProperties(_ref, _excluded);
18322
+ constructor({ style, children, ...rest }) {
18283
18323
  super("w:p");
18284
18324
  this.root.push(new ParagraphProperties(rest));
18285
18325
  this.root.push(createPictElement({ shape: createShape({
@@ -18290,116 +18330,3260 @@ var Textbox = class extends FileChild {
18290
18330
  }
18291
18331
  };
18292
18332
  //#endregion
18293
- //#region src/util/output-type.ts
18294
- /**
18295
- * Converts a Uint8Array to the specified output type.
18296
- *
18297
- * This is used by both the Packer and patchDocument to convert fflate's
18298
- * raw Uint8Array output into the user's requested format.
18299
- */
18300
- const convertOutput = (data, type) => {
18301
- switch (type) {
18302
- case "nodebuffer": return Buffer.from(data);
18303
- case "blob": return new Blob([data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength)], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" });
18304
- case "arraybuffer": return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
18305
- case "uint8array": return data;
18306
- case "base64": return Buffer.from(data).toString("base64");
18307
- case "string":
18308
- case "text": return Buffer.from(data).toString("binary");
18309
- case "binarystring": return Buffer.from(data).toString("binary");
18310
- case "array": return [...data];
18311
- default: return data;
18333
+ //#region \0polyfill-node.events.js
18334
+ var domain;
18335
+ function EventHandlers() {}
18336
+ EventHandlers.prototype = Object.create(null);
18337
+ function EventEmitter() {
18338
+ EventEmitter.init.call(this);
18339
+ }
18340
+ EventEmitter.EventEmitter = EventEmitter;
18341
+ EventEmitter.usingDomains = false;
18342
+ EventEmitter.prototype.domain = void 0;
18343
+ EventEmitter.prototype._events = void 0;
18344
+ EventEmitter.prototype._maxListeners = void 0;
18345
+ EventEmitter.defaultMaxListeners = 10;
18346
+ EventEmitter.init = function() {
18347
+ this.domain = null;
18348
+ if (EventEmitter.usingDomains) {
18349
+ if (domain.active && !(this instanceof domain.Domain)) this.domain = domain.active;
18350
+ }
18351
+ if (!this._events || this._events === Object.getPrototypeOf(this)._events) {
18352
+ this._events = new EventHandlers();
18353
+ this._eventsCount = 0;
18354
+ }
18355
+ this._maxListeners = this._maxListeners || void 0;
18356
+ };
18357
+ EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
18358
+ if (typeof n !== "number" || n < 0 || isNaN(n)) throw new TypeError("\"n\" argument must be a positive number");
18359
+ this._maxListeners = n;
18360
+ return this;
18361
+ };
18362
+ function $getMaxListeners(that) {
18363
+ if (that._maxListeners === void 0) return EventEmitter.defaultMaxListeners;
18364
+ return that._maxListeners;
18365
+ }
18366
+ EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
18367
+ return $getMaxListeners(this);
18368
+ };
18369
+ function emitNone(handler, isFn, self) {
18370
+ if (isFn) handler.call(self);
18371
+ else {
18372
+ var len = handler.length;
18373
+ var listeners = arrayClone(handler, len);
18374
+ for (var i = 0; i < len; ++i) listeners[i].call(self);
18375
+ }
18376
+ }
18377
+ function emitOne(handler, isFn, self, arg1) {
18378
+ if (isFn) handler.call(self, arg1);
18379
+ else {
18380
+ var len = handler.length;
18381
+ var listeners = arrayClone(handler, len);
18382
+ for (var i = 0; i < len; ++i) listeners[i].call(self, arg1);
18383
+ }
18384
+ }
18385
+ function emitTwo(handler, isFn, self, arg1, arg2) {
18386
+ if (isFn) handler.call(self, arg1, arg2);
18387
+ else {
18388
+ var len = handler.length;
18389
+ var listeners = arrayClone(handler, len);
18390
+ for (var i = 0; i < len; ++i) listeners[i].call(self, arg1, arg2);
18391
+ }
18392
+ }
18393
+ function emitThree(handler, isFn, self, arg1, arg2, arg3) {
18394
+ if (isFn) handler.call(self, arg1, arg2, arg3);
18395
+ else {
18396
+ var len = handler.length;
18397
+ var listeners = arrayClone(handler, len);
18398
+ for (var i = 0; i < len; ++i) listeners[i].call(self, arg1, arg2, arg3);
18399
+ }
18400
+ }
18401
+ function emitMany(handler, isFn, self, args) {
18402
+ if (isFn) handler.apply(self, args);
18403
+ else {
18404
+ var len = handler.length;
18405
+ var listeners = arrayClone(handler, len);
18406
+ for (var i = 0; i < len; ++i) listeners[i].apply(self, args);
18407
+ }
18408
+ }
18409
+ EventEmitter.prototype.emit = function emit(type) {
18410
+ var er, handler, len, args, i, events, domain;
18411
+ var needDomainExit = false;
18412
+ var doError = type === "error";
18413
+ events = this._events;
18414
+ if (events) doError = doError && events.error == null;
18415
+ else if (!doError) return false;
18416
+ domain = this.domain;
18417
+ if (doError) {
18418
+ er = arguments[1];
18419
+ if (domain) {
18420
+ if (!er) er = /* @__PURE__ */ new Error("Uncaught, unspecified \"error\" event");
18421
+ er.domainEmitter = this;
18422
+ er.domain = domain;
18423
+ er.domainThrown = false;
18424
+ domain.emit("error", er);
18425
+ } else if (er instanceof Error) throw er;
18426
+ else {
18427
+ var err = /* @__PURE__ */ new Error("Uncaught, unspecified \"error\" event. (" + er + ")");
18428
+ err.context = er;
18429
+ throw err;
18430
+ }
18431
+ return false;
18432
+ }
18433
+ handler = events[type];
18434
+ if (!handler) return false;
18435
+ var isFn = typeof handler === "function";
18436
+ len = arguments.length;
18437
+ switch (len) {
18438
+ case 1:
18439
+ emitNone(handler, isFn, this);
18440
+ break;
18441
+ case 2:
18442
+ emitOne(handler, isFn, this, arguments[1]);
18443
+ break;
18444
+ case 3:
18445
+ emitTwo(handler, isFn, this, arguments[1], arguments[2]);
18446
+ break;
18447
+ case 4:
18448
+ emitThree(handler, isFn, this, arguments[1], arguments[2], arguments[3]);
18449
+ break;
18450
+ default:
18451
+ args = new Array(len - 1);
18452
+ for (i = 1; i < len; i++) args[i - 1] = arguments[i];
18453
+ emitMany(handler, isFn, this, args);
18454
+ }
18455
+ if (needDomainExit) domain.exit();
18456
+ return true;
18457
+ };
18458
+ function _addListener(target, type, listener, prepend) {
18459
+ var m;
18460
+ var events;
18461
+ var existing;
18462
+ if (typeof listener !== "function") throw new TypeError("\"listener\" argument must be a function");
18463
+ events = target._events;
18464
+ if (!events) {
18465
+ events = target._events = new EventHandlers();
18466
+ target._eventsCount = 0;
18467
+ } else {
18468
+ if (events.newListener) {
18469
+ target.emit("newListener", type, listener.listener ? listener.listener : listener);
18470
+ events = target._events;
18471
+ }
18472
+ existing = events[type];
18473
+ }
18474
+ if (!existing) {
18475
+ existing = events[type] = listener;
18476
+ ++target._eventsCount;
18477
+ } else {
18478
+ if (typeof existing === "function") existing = events[type] = prepend ? [listener, existing] : [existing, listener];
18479
+ else if (prepend) existing.unshift(listener);
18480
+ else existing.push(listener);
18481
+ if (!existing.warned) {
18482
+ m = $getMaxListeners(target);
18483
+ if (m && m > 0 && existing.length > m) {
18484
+ existing.warned = true;
18485
+ var w = /* @__PURE__ */ new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + type + " listeners added. Use emitter.setMaxListeners() to increase limit");
18486
+ w.name = "MaxListenersExceededWarning";
18487
+ w.emitter = target;
18488
+ w.type = type;
18489
+ w.count = existing.length;
18490
+ emitWarning(w);
18491
+ }
18492
+ }
18493
+ }
18494
+ return target;
18495
+ }
18496
+ function emitWarning(e) {
18497
+ typeof console.warn === "function" ? console.warn(e) : console.log(e);
18498
+ }
18499
+ EventEmitter.prototype.addListener = function addListener(type, listener) {
18500
+ return _addListener(this, type, listener, false);
18501
+ };
18502
+ EventEmitter.prototype.on = EventEmitter.prototype.addListener;
18503
+ EventEmitter.prototype.prependListener = function prependListener(type, listener) {
18504
+ return _addListener(this, type, listener, true);
18505
+ };
18506
+ function _onceWrap(target, type, listener) {
18507
+ var fired = false;
18508
+ function g() {
18509
+ target.removeListener(type, g);
18510
+ if (!fired) {
18511
+ fired = true;
18512
+ listener.apply(target, arguments);
18513
+ }
18514
+ }
18515
+ g.listener = listener;
18516
+ return g;
18517
+ }
18518
+ EventEmitter.prototype.once = function once(type, listener) {
18519
+ if (typeof listener !== "function") throw new TypeError("\"listener\" argument must be a function");
18520
+ this.on(type, _onceWrap(this, type, listener));
18521
+ return this;
18522
+ };
18523
+ EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) {
18524
+ if (typeof listener !== "function") throw new TypeError("\"listener\" argument must be a function");
18525
+ this.prependListener(type, _onceWrap(this, type, listener));
18526
+ return this;
18527
+ };
18528
+ EventEmitter.prototype.removeListener = function removeListener(type, listener) {
18529
+ var list, events, position, i, originalListener;
18530
+ if (typeof listener !== "function") throw new TypeError("\"listener\" argument must be a function");
18531
+ events = this._events;
18532
+ if (!events) return this;
18533
+ list = events[type];
18534
+ if (!list) return this;
18535
+ if (list === listener || list.listener && list.listener === listener) if (--this._eventsCount === 0) this._events = new EventHandlers();
18536
+ else {
18537
+ delete events[type];
18538
+ if (events.removeListener) this.emit("removeListener", type, list.listener || listener);
18539
+ }
18540
+ else if (typeof list !== "function") {
18541
+ position = -1;
18542
+ for (i = list.length; i-- > 0;) if (list[i] === listener || list[i].listener && list[i].listener === listener) {
18543
+ originalListener = list[i].listener;
18544
+ position = i;
18545
+ break;
18546
+ }
18547
+ if (position < 0) return this;
18548
+ if (list.length === 1) {
18549
+ list[0] = void 0;
18550
+ if (--this._eventsCount === 0) {
18551
+ this._events = new EventHandlers();
18552
+ return this;
18553
+ } else delete events[type];
18554
+ } else spliceOne(list, position);
18555
+ if (events.removeListener) this.emit("removeListener", type, originalListener || listener);
18556
+ }
18557
+ return this;
18558
+ };
18559
+ EventEmitter.prototype.off = function(type, listener) {
18560
+ return this.removeListener(type, listener);
18561
+ };
18562
+ EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) {
18563
+ var listeners, events = this._events;
18564
+ if (!events) return this;
18565
+ if (!events.removeListener) {
18566
+ if (arguments.length === 0) {
18567
+ this._events = new EventHandlers();
18568
+ this._eventsCount = 0;
18569
+ } else if (events[type]) if (--this._eventsCount === 0) this._events = new EventHandlers();
18570
+ else delete events[type];
18571
+ return this;
18572
+ }
18573
+ if (arguments.length === 0) {
18574
+ var keys = Object.keys(events);
18575
+ for (var i = 0, key; i < keys.length; ++i) {
18576
+ key = keys[i];
18577
+ if (key === "removeListener") continue;
18578
+ this.removeAllListeners(key);
18579
+ }
18580
+ this.removeAllListeners("removeListener");
18581
+ this._events = new EventHandlers();
18582
+ this._eventsCount = 0;
18583
+ return this;
18312
18584
  }
18585
+ listeners = events[type];
18586
+ if (typeof listeners === "function") this.removeListener(type, listeners);
18587
+ else if (listeners) do
18588
+ this.removeListener(type, listeners[listeners.length - 1]);
18589
+ while (listeners[0]);
18590
+ return this;
18591
+ };
18592
+ EventEmitter.prototype.listeners = function listeners(type) {
18593
+ var evlistener;
18594
+ var ret;
18595
+ var events = this._events;
18596
+ if (!events) ret = [];
18597
+ else {
18598
+ evlistener = events[type];
18599
+ if (!evlistener) ret = [];
18600
+ else if (typeof evlistener === "function") ret = [evlistener.listener || evlistener];
18601
+ else ret = unwrapListeners(evlistener);
18602
+ }
18603
+ return ret;
18604
+ };
18605
+ EventEmitter.listenerCount = function(emitter, type) {
18606
+ if (typeof emitter.listenerCount === "function") return emitter.listenerCount(type);
18607
+ else return listenerCount$1.call(emitter, type);
18608
+ };
18609
+ EventEmitter.prototype.listenerCount = listenerCount$1;
18610
+ function listenerCount$1(type) {
18611
+ var events = this._events;
18612
+ if (events) {
18613
+ var evlistener = events[type];
18614
+ if (typeof evlistener === "function") return 1;
18615
+ else if (evlistener) return evlistener.length;
18616
+ }
18617
+ return 0;
18618
+ }
18619
+ EventEmitter.prototype.eventNames = function eventNames() {
18620
+ return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
18313
18621
  };
18622
+ function spliceOne(list, index) {
18623
+ for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) list[i] = list[k];
18624
+ list.pop();
18625
+ }
18626
+ function arrayClone(arr, i) {
18627
+ var copy = new Array(i);
18628
+ while (i--) copy[i] = arr[i];
18629
+ return copy;
18630
+ }
18631
+ function unwrapListeners(arr) {
18632
+ var ret = new Array(arr.length);
18633
+ for (var i = 0; i < ret.length; ++i) ret[i] = arr[i].listener || arr[i];
18634
+ return ret;
18635
+ }
18314
18636
  //#endregion
18315
- //#region src/file/fonts/obfuscate-ttf-to-odttf.ts
18637
+ //#region \0polyfill-node.global.js
18638
+ var _polyfill_node_global_default = typeof _polyfill_node_global_default !== "undefined" ? _polyfill_node_global_default : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
18639
+ //#endregion
18640
+ //#region \0polyfill-node.buffer.js
18641
+ var lookup = [];
18642
+ var revLookup = [];
18643
+ var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
18644
+ var inited = false;
18645
+ function init() {
18646
+ inited = true;
18647
+ var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
18648
+ for (var i = 0, len = code.length; i < len; ++i) {
18649
+ lookup[i] = code[i];
18650
+ revLookup[code.charCodeAt(i)] = i;
18651
+ }
18652
+ revLookup["-".charCodeAt(0)] = 62;
18653
+ revLookup["_".charCodeAt(0)] = 63;
18654
+ }
18655
+ function toByteArray(b64) {
18656
+ if (!inited) init();
18657
+ var i, j, l, tmp, placeHolders, arr;
18658
+ var len = b64.length;
18659
+ if (len % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
18660
+ placeHolders = b64[len - 2] === "=" ? 2 : b64[len - 1] === "=" ? 1 : 0;
18661
+ arr = new Arr(len * 3 / 4 - placeHolders);
18662
+ l = placeHolders > 0 ? len - 4 : len;
18663
+ var L = 0;
18664
+ for (i = 0, j = 0; i < l; i += 4, j += 3) {
18665
+ tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
18666
+ arr[L++] = tmp >> 16 & 255;
18667
+ arr[L++] = tmp >> 8 & 255;
18668
+ arr[L++] = tmp & 255;
18669
+ }
18670
+ if (placeHolders === 2) {
18671
+ tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
18672
+ arr[L++] = tmp & 255;
18673
+ } else if (placeHolders === 1) {
18674
+ tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
18675
+ arr[L++] = tmp >> 8 & 255;
18676
+ arr[L++] = tmp & 255;
18677
+ }
18678
+ return arr;
18679
+ }
18680
+ function tripletToBase64(num) {
18681
+ return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];
18682
+ }
18683
+ function encodeChunk(uint8, start, end) {
18684
+ var tmp;
18685
+ var output = [];
18686
+ for (var i = start; i < end; i += 3) {
18687
+ tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + uint8[i + 2];
18688
+ output.push(tripletToBase64(tmp));
18689
+ }
18690
+ return output.join("");
18691
+ }
18692
+ function fromByteArray(uint8) {
18693
+ if (!inited) init();
18694
+ var tmp;
18695
+ var len = uint8.length;
18696
+ var extraBytes = len % 3;
18697
+ var output = "";
18698
+ var parts = [];
18699
+ var maxChunkLength = 16383;
18700
+ for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
18701
+ if (extraBytes === 1) {
18702
+ tmp = uint8[len - 1];
18703
+ output += lookup[tmp >> 2];
18704
+ output += lookup[tmp << 4 & 63];
18705
+ output += "==";
18706
+ } else if (extraBytes === 2) {
18707
+ tmp = (uint8[len - 2] << 8) + uint8[len - 1];
18708
+ output += lookup[tmp >> 10];
18709
+ output += lookup[tmp >> 4 & 63];
18710
+ output += lookup[tmp << 2 & 63];
18711
+ output += "=";
18712
+ }
18713
+ parts.push(output);
18714
+ return parts.join("");
18715
+ }
18716
+ function read(buffer, offset, isLE, mLen, nBytes) {
18717
+ var e, m;
18718
+ var eLen = nBytes * 8 - mLen - 1;
18719
+ var eMax = (1 << eLen) - 1;
18720
+ var eBias = eMax >> 1;
18721
+ var nBits = -7;
18722
+ var i = isLE ? nBytes - 1 : 0;
18723
+ var d = isLE ? -1 : 1;
18724
+ var s = buffer[offset + i];
18725
+ i += d;
18726
+ e = s & (1 << -nBits) - 1;
18727
+ s >>= -nBits;
18728
+ nBits += eLen;
18729
+ for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);
18730
+ m = e & (1 << -nBits) - 1;
18731
+ e >>= -nBits;
18732
+ nBits += mLen;
18733
+ for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);
18734
+ if (e === 0) e = 1 - eBias;
18735
+ else if (e === eMax) return m ? NaN : (s ? -1 : 1) * Infinity;
18736
+ else {
18737
+ m = m + Math.pow(2, mLen);
18738
+ e = e - eBias;
18739
+ }
18740
+ return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
18741
+ }
18742
+ function write(buffer, value, offset, isLE, mLen, nBytes) {
18743
+ var e, m, c;
18744
+ var eLen = nBytes * 8 - mLen - 1;
18745
+ var eMax = (1 << eLen) - 1;
18746
+ var eBias = eMax >> 1;
18747
+ var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
18748
+ var i = isLE ? 0 : nBytes - 1;
18749
+ var d = isLE ? 1 : -1;
18750
+ var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
18751
+ value = Math.abs(value);
18752
+ if (isNaN(value) || value === Infinity) {
18753
+ m = isNaN(value) ? 1 : 0;
18754
+ e = eMax;
18755
+ } else {
18756
+ e = Math.floor(Math.log(value) / Math.LN2);
18757
+ if (value * (c = Math.pow(2, -e)) < 1) {
18758
+ e--;
18759
+ c *= 2;
18760
+ }
18761
+ if (e + eBias >= 1) value += rt / c;
18762
+ else value += rt * Math.pow(2, 1 - eBias);
18763
+ if (value * c >= 2) {
18764
+ e++;
18765
+ c /= 2;
18766
+ }
18767
+ if (e + eBias >= eMax) {
18768
+ m = 0;
18769
+ e = eMax;
18770
+ } else if (e + eBias >= 1) {
18771
+ m = (value * c - 1) * Math.pow(2, mLen);
18772
+ e = e + eBias;
18773
+ } else {
18774
+ m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
18775
+ e = 0;
18776
+ }
18777
+ }
18778
+ for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8);
18779
+ e = e << mLen | m;
18780
+ eLen += mLen;
18781
+ for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8);
18782
+ buffer[offset + i - d] |= s * 128;
18783
+ }
18784
+ var toString = {}.toString;
18785
+ var isArray$1 = Array.isArray || function(arr) {
18786
+ return toString.call(arr) == "[object Array]";
18787
+ };
18316
18788
  /**
18317
- * Font obfuscation module for embedding fonts in WordprocessingML documents.
18318
- *
18319
- * This module implements the OOXML font obfuscation algorithm used to embed
18320
- * fonts in DOCX documents. Obfuscation is required by the OOXML specification
18321
- * to prevent simple extraction of embedded font files.
18789
+ * If `Buffer.TYPED_ARRAY_SUPPORT`:
18790
+ * === true Use Uint8Array implementation (fastest)
18791
+ * === false Use Object implementation (most compatible, even IE6)
18322
18792
  *
18323
- * Reference: ECMA-376 Part 2, Section 11.1 (Font Embedding)
18793
+ * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
18794
+ * Opera 11.6+, iOS 4.2+.
18324
18795
  *
18325
- * @module
18326
- */
18327
- /** Start offset for obfuscation in the font file */
18328
- const obfuscatedStartOffset = 0;
18329
- /** End offset for obfuscation (first 32 bytes are obfuscated) */
18330
- const obfuscatedEndOffset = 32;
18331
- /** Expected GUID size (32 hex characters without dashes) */
18332
- const guidSize = 32;
18333
- /**
18334
- * Obfuscates a TrueType font file for embedding in OOXML documents.
18796
+ * Due to various browser bugs, sometimes the Object implementation will be used even
18797
+ * when the browser supports typed arrays.
18335
18798
  *
18336
- * The obfuscation algorithm XORs the first 32 bytes of the font file
18337
- * with a reversed byte sequence derived from the font's GUID key.
18338
- * This prevents simple extraction while maintaining font functionality.
18799
+ * Note:
18339
18800
  *
18340
- * @param buf - The original font file as a byte array
18341
- * @param fontKey - The GUID key for the font (with or without dashes)
18342
- * @returns The obfuscated font data
18343
- * @throws Error if the fontKey is not a valid 32-character GUID
18801
+ * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
18802
+ * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
18344
18803
  *
18345
- * @example
18346
- * ```typescript
18347
- * const fontData = readFileSync("font.ttf");
18348
- * const fontKey = "00000000-0000-0000-0000-000000000000";
18349
- * const obfuscatedData = obfuscate(fontData, fontKey);
18350
- * ```
18804
+ * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
18351
18805
  *
18352
- * @internal
18806
+ * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
18807
+ * incorrect length in some situations.
18808
+
18809
+ * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
18810
+ * get the Object implementation, which is slower but behaves correctly.
18353
18811
  */
18354
- const obfuscate = (buf, fontKey) => {
18355
- const guid = fontKey.replace(/-/g, "");
18356
- if (guid.length !== guidSize) throw new Error(`Error: Cannot extract GUID from font filename: ${fontKey}`);
18357
- const hexNumbers = guid.replace(/(..)/g, "$1 ").trim().split(" ").map((hexString) => parseInt(hexString, 16));
18358
- hexNumbers.reverse();
18359
- const obfuscatedBytes = buf.slice(obfuscatedStartOffset, obfuscatedEndOffset).map((byte, i) => byte ^ hexNumbers[i % hexNumbers.length]);
18360
- const out = new Uint8Array(obfuscatedStartOffset + obfuscatedBytes.length + Math.max(0, buf.length - obfuscatedEndOffset));
18361
- out.set(buf.slice(0, obfuscatedStartOffset));
18362
- out.set(obfuscatedBytes, obfuscatedStartOffset);
18363
- out.set(buf.slice(obfuscatedEndOffset), obfuscatedStartOffset + obfuscatedBytes.length);
18364
- return out;
18365
- };
18366
- //#endregion
18367
- //#region src/export/formatter.ts
18812
+ Buffer$1.TYPED_ARRAY_SUPPORT = _polyfill_node_global_default.TYPED_ARRAY_SUPPORT !== void 0 ? _polyfill_node_global_default.TYPED_ARRAY_SUPPORT : true;
18813
+ kMaxLength();
18814
+ function kMaxLength() {
18815
+ return Buffer$1.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
18816
+ }
18817
+ function createBuffer(that, length) {
18818
+ if (kMaxLength() < length) throw new RangeError("Invalid typed array length");
18819
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
18820
+ that = new Uint8Array(length);
18821
+ that.__proto__ = Buffer$1.prototype;
18822
+ } else {
18823
+ if (that === null) that = new Buffer$1(length);
18824
+ that.length = length;
18825
+ }
18826
+ return that;
18827
+ }
18368
18828
  /**
18369
- * Converts XML components into serializable objects ready for XML generation.
18370
- *
18371
- * The Formatter is responsible for preparing XML components for serialization by calling
18372
- * their prepForXml method with the appropriate context. This is a critical step in the
18373
- * export pipeline that transforms the declarative API objects into XML-compatible structures.
18829
+ * The Buffer constructor returns instances of `Uint8Array` that have their
18830
+ * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
18831
+ * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
18832
+ * and the `Uint8Array` methods. Square bracket notation works as expected -- it
18833
+ * returns a single octet.
18374
18834
  *
18375
- * @example
18376
- * ```typescript
18377
- * const formatter = new Formatter();
18378
- * const paragraph = new Paragraph("Hello World");
18379
- * const xmlObject = formatter.format(paragraph, context);
18380
- * ```
18835
+ * The `Uint8Array` prototype remains unmodified.
18381
18836
  */
18382
- var Formatter = class {
18383
- /**
18384
- * Formats an XML component into a serializable object.
18385
- *
18386
- * @param input - The XML component to format
18387
- * @param context - The context containing file state and relationships
18388
- * @returns A serializable XML object structure
18389
- * @throws Error if the component cannot be formatted correctly
18390
- */
18391
- format(input, context = { stack: [] }) {
18392
- const output = input.prepForXml(context);
18393
- if (output) return output;
18394
- else throw new Error("XMLComponent did not format correctly");
18837
+ function Buffer$1(arg, encodingOrOffset, length) {
18838
+ if (!Buffer$1.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer$1)) return new Buffer$1(arg, encodingOrOffset, length);
18839
+ if (typeof arg === "number") {
18840
+ if (typeof encodingOrOffset === "string") throw new Error("If encoding is specified then the first argument must be a string");
18841
+ return allocUnsafe(this, arg);
18395
18842
  }
18396
- };
18397
- //#endregion
18398
- //#region src/export/packer/image-replacer.ts
18843
+ return from(this, arg, encodingOrOffset, length);
18844
+ }
18845
+ Buffer$1.poolSize = 8192;
18846
+ Buffer$1._augment = function(arr) {
18847
+ arr.__proto__ = Buffer$1.prototype;
18848
+ return arr;
18849
+ };
18850
+ function from(that, value, encodingOrOffset, length) {
18851
+ if (typeof value === "number") throw new TypeError("\"value\" argument must not be a number");
18852
+ if (typeof ArrayBuffer !== "undefined" && value instanceof ArrayBuffer) return fromArrayBuffer(that, value, encodingOrOffset, length);
18853
+ if (typeof value === "string") return fromString(that, value, encodingOrOffset);
18854
+ return fromObject(that, value);
18855
+ }
18399
18856
  /**
18400
- * Replaces image placeholders with relationship IDs in XML content.
18401
- *
18402
- * During document compilation, images are referenced using placeholder tokens
18857
+ * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
18858
+ * if value is a number.
18859
+ * Buffer.from(str[, encoding])
18860
+ * Buffer.from(array)
18861
+ * Buffer.from(buffer)
18862
+ * Buffer.from(arrayBuffer[, byteOffset[, length]])
18863
+ **/
18864
+ Buffer$1.from = function(value, encodingOrOffset, length) {
18865
+ return from(null, value, encodingOrOffset, length);
18866
+ };
18867
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
18868
+ Buffer$1.prototype.__proto__ = Uint8Array.prototype;
18869
+ Buffer$1.__proto__ = Uint8Array;
18870
+ if (typeof Symbol !== "undefined" && Symbol.species && Buffer$1[Symbol.species] === Buffer$1);
18871
+ }
18872
+ function assertSize(size) {
18873
+ if (typeof size !== "number") throw new TypeError("\"size\" argument must be a number");
18874
+ else if (size < 0) throw new RangeError("\"size\" argument must not be negative");
18875
+ }
18876
+ function alloc(that, size, fill, encoding) {
18877
+ assertSize(size);
18878
+ if (size <= 0) return createBuffer(that, size);
18879
+ if (fill !== void 0) return typeof encoding === "string" ? createBuffer(that, size).fill(fill, encoding) : createBuffer(that, size).fill(fill);
18880
+ return createBuffer(that, size);
18881
+ }
18882
+ /**
18883
+ * Creates a new filled Buffer instance.
18884
+ * alloc(size[, fill[, encoding]])
18885
+ **/
18886
+ Buffer$1.alloc = function(size, fill, encoding) {
18887
+ return alloc(null, size, fill, encoding);
18888
+ };
18889
+ function allocUnsafe(that, size) {
18890
+ assertSize(size);
18891
+ that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);
18892
+ if (!Buffer$1.TYPED_ARRAY_SUPPORT) for (var i = 0; i < size; ++i) that[i] = 0;
18893
+ return that;
18894
+ }
18895
+ /**
18896
+ * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
18897
+ * */
18898
+ Buffer$1.allocUnsafe = function(size) {
18899
+ return allocUnsafe(null, size);
18900
+ };
18901
+ /**
18902
+ * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
18903
+ */
18904
+ Buffer$1.allocUnsafeSlow = function(size) {
18905
+ return allocUnsafe(null, size);
18906
+ };
18907
+ function fromString(that, string, encoding) {
18908
+ if (typeof encoding !== "string" || encoding === "") encoding = "utf8";
18909
+ if (!Buffer$1.isEncoding(encoding)) throw new TypeError("\"encoding\" must be a valid string encoding");
18910
+ var length = byteLength(string, encoding) | 0;
18911
+ that = createBuffer(that, length);
18912
+ var actual = that.write(string, encoding);
18913
+ if (actual !== length) that = that.slice(0, actual);
18914
+ return that;
18915
+ }
18916
+ function fromArrayLike(that, array) {
18917
+ var length = array.length < 0 ? 0 : checked(array.length) | 0;
18918
+ that = createBuffer(that, length);
18919
+ for (var i = 0; i < length; i += 1) that[i] = array[i] & 255;
18920
+ return that;
18921
+ }
18922
+ function fromArrayBuffer(that, array, byteOffset, length) {
18923
+ array.byteLength;
18924
+ if (byteOffset < 0 || array.byteLength < byteOffset) throw new RangeError("'offset' is out of bounds");
18925
+ if (array.byteLength < byteOffset + (length || 0)) throw new RangeError("'length' is out of bounds");
18926
+ if (byteOffset === void 0 && length === void 0) array = new Uint8Array(array);
18927
+ else if (length === void 0) array = new Uint8Array(array, byteOffset);
18928
+ else array = new Uint8Array(array, byteOffset, length);
18929
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
18930
+ that = array;
18931
+ that.__proto__ = Buffer$1.prototype;
18932
+ } else that = fromArrayLike(that, array);
18933
+ return that;
18934
+ }
18935
+ function fromObject(that, obj) {
18936
+ if (internalIsBuffer(obj)) {
18937
+ var len = checked(obj.length) | 0;
18938
+ that = createBuffer(that, len);
18939
+ if (that.length === 0) return that;
18940
+ obj.copy(that, 0, 0, len);
18941
+ return that;
18942
+ }
18943
+ if (obj) {
18944
+ if (typeof ArrayBuffer !== "undefined" && obj.buffer instanceof ArrayBuffer || "length" in obj) {
18945
+ if (typeof obj.length !== "number" || isnan(obj.length)) return createBuffer(that, 0);
18946
+ return fromArrayLike(that, obj);
18947
+ }
18948
+ if (obj.type === "Buffer" && isArray$1(obj.data)) return fromArrayLike(that, obj.data);
18949
+ }
18950
+ throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");
18951
+ }
18952
+ function checked(length) {
18953
+ if (length >= kMaxLength()) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + kMaxLength().toString(16) + " bytes");
18954
+ return length | 0;
18955
+ }
18956
+ Buffer$1.isBuffer = isBuffer;
18957
+ function internalIsBuffer(b) {
18958
+ return !!(b != null && b._isBuffer);
18959
+ }
18960
+ Buffer$1.compare = function compare(a, b) {
18961
+ if (!internalIsBuffer(a) || !internalIsBuffer(b)) throw new TypeError("Arguments must be Buffers");
18962
+ if (a === b) return 0;
18963
+ var x = a.length;
18964
+ var y = b.length;
18965
+ for (var i = 0, len = Math.min(x, y); i < len; ++i) if (a[i] !== b[i]) {
18966
+ x = a[i];
18967
+ y = b[i];
18968
+ break;
18969
+ }
18970
+ if (x < y) return -1;
18971
+ if (y < x) return 1;
18972
+ return 0;
18973
+ };
18974
+ Buffer$1.isEncoding = function isEncoding(encoding) {
18975
+ switch (String(encoding).toLowerCase()) {
18976
+ case "hex":
18977
+ case "utf8":
18978
+ case "utf-8":
18979
+ case "ascii":
18980
+ case "latin1":
18981
+ case "binary":
18982
+ case "base64":
18983
+ case "ucs2":
18984
+ case "ucs-2":
18985
+ case "utf16le":
18986
+ case "utf-16le": return true;
18987
+ default: return false;
18988
+ }
18989
+ };
18990
+ Buffer$1.concat = function concat(list, length) {
18991
+ if (!isArray$1(list)) throw new TypeError("\"list\" argument must be an Array of Buffers");
18992
+ if (list.length === 0) return Buffer$1.alloc(0);
18993
+ var i;
18994
+ if (length === void 0) {
18995
+ length = 0;
18996
+ for (i = 0; i < list.length; ++i) length += list[i].length;
18997
+ }
18998
+ var buffer = Buffer$1.allocUnsafe(length);
18999
+ var pos = 0;
19000
+ for (i = 0; i < list.length; ++i) {
19001
+ var buf = list[i];
19002
+ if (!internalIsBuffer(buf)) throw new TypeError("\"list\" argument must be an Array of Buffers");
19003
+ buf.copy(buffer, pos);
19004
+ pos += buf.length;
19005
+ }
19006
+ return buffer;
19007
+ };
19008
+ function byteLength(string, encoding) {
19009
+ if (internalIsBuffer(string)) return string.length;
19010
+ if (typeof ArrayBuffer !== "undefined" && typeof ArrayBuffer.isView === "function" && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) return string.byteLength;
19011
+ if (typeof string !== "string") string = "" + string;
19012
+ var len = string.length;
19013
+ if (len === 0) return 0;
19014
+ var loweredCase = false;
19015
+ for (;;) switch (encoding) {
19016
+ case "ascii":
19017
+ case "latin1":
19018
+ case "binary": return len;
19019
+ case "utf8":
19020
+ case "utf-8":
19021
+ case void 0: return utf8ToBytes(string).length;
19022
+ case "ucs2":
19023
+ case "ucs-2":
19024
+ case "utf16le":
19025
+ case "utf-16le": return len * 2;
19026
+ case "hex": return len >>> 1;
19027
+ case "base64": return base64ToBytes(string).length;
19028
+ default:
19029
+ if (loweredCase) return utf8ToBytes(string).length;
19030
+ encoding = ("" + encoding).toLowerCase();
19031
+ loweredCase = true;
19032
+ }
19033
+ }
19034
+ Buffer$1.byteLength = byteLength;
19035
+ function slowToString(encoding, start, end) {
19036
+ var loweredCase = false;
19037
+ if (start === void 0 || start < 0) start = 0;
19038
+ if (start > this.length) return "";
19039
+ if (end === void 0 || end > this.length) end = this.length;
19040
+ if (end <= 0) return "";
19041
+ end >>>= 0;
19042
+ start >>>= 0;
19043
+ if (end <= start) return "";
19044
+ if (!encoding) encoding = "utf8";
19045
+ while (true) switch (encoding) {
19046
+ case "hex": return hexSlice(this, start, end);
19047
+ case "utf8":
19048
+ case "utf-8": return utf8Slice(this, start, end);
19049
+ case "ascii": return asciiSlice(this, start, end);
19050
+ case "latin1":
19051
+ case "binary": return latin1Slice(this, start, end);
19052
+ case "base64": return base64Slice(this, start, end);
19053
+ case "ucs2":
19054
+ case "ucs-2":
19055
+ case "utf16le":
19056
+ case "utf-16le": return utf16leSlice(this, start, end);
19057
+ default:
19058
+ if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
19059
+ encoding = (encoding + "").toLowerCase();
19060
+ loweredCase = true;
19061
+ }
19062
+ }
19063
+ Buffer$1.prototype._isBuffer = true;
19064
+ function swap(b, n, m) {
19065
+ var i = b[n];
19066
+ b[n] = b[m];
19067
+ b[m] = i;
19068
+ }
19069
+ Buffer$1.prototype.swap16 = function swap16() {
19070
+ var len = this.length;
19071
+ if (len % 2 !== 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
19072
+ for (var i = 0; i < len; i += 2) swap(this, i, i + 1);
19073
+ return this;
19074
+ };
19075
+ Buffer$1.prototype.swap32 = function swap32() {
19076
+ var len = this.length;
19077
+ if (len % 4 !== 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
19078
+ for (var i = 0; i < len; i += 4) {
19079
+ swap(this, i, i + 3);
19080
+ swap(this, i + 1, i + 2);
19081
+ }
19082
+ return this;
19083
+ };
19084
+ Buffer$1.prototype.swap64 = function swap64() {
19085
+ var len = this.length;
19086
+ if (len % 8 !== 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
19087
+ for (var i = 0; i < len; i += 8) {
19088
+ swap(this, i, i + 7);
19089
+ swap(this, i + 1, i + 6);
19090
+ swap(this, i + 2, i + 5);
19091
+ swap(this, i + 3, i + 4);
19092
+ }
19093
+ return this;
19094
+ };
19095
+ Buffer$1.prototype.toString = function toString() {
19096
+ var length = this.length | 0;
19097
+ if (length === 0) return "";
19098
+ if (arguments.length === 0) return utf8Slice(this, 0, length);
19099
+ return slowToString.apply(this, arguments);
19100
+ };
19101
+ Buffer$1.prototype.equals = function equals(b) {
19102
+ if (!internalIsBuffer(b)) throw new TypeError("Argument must be a Buffer");
19103
+ if (this === b) return true;
19104
+ return Buffer$1.compare(this, b) === 0;
19105
+ };
19106
+ Buffer$1.prototype.inspect = function inspect() {
19107
+ var str = "";
19108
+ var max = 50;
19109
+ if (this.length > 0) {
19110
+ str = this.toString("hex", 0, max).match(/.{2}/g).join(" ");
19111
+ if (this.length > max) str += " ... ";
19112
+ }
19113
+ return "<Buffer " + str + ">";
19114
+ };
19115
+ Buffer$1.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
19116
+ if (!internalIsBuffer(target)) throw new TypeError("Argument must be a Buffer");
19117
+ if (start === void 0) start = 0;
19118
+ if (end === void 0) end = target ? target.length : 0;
19119
+ if (thisStart === void 0) thisStart = 0;
19120
+ if (thisEnd === void 0) thisEnd = this.length;
19121
+ if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) throw new RangeError("out of range index");
19122
+ if (thisStart >= thisEnd && start >= end) return 0;
19123
+ if (thisStart >= thisEnd) return -1;
19124
+ if (start >= end) return 1;
19125
+ start >>>= 0;
19126
+ end >>>= 0;
19127
+ thisStart >>>= 0;
19128
+ thisEnd >>>= 0;
19129
+ if (this === target) return 0;
19130
+ var x = thisEnd - thisStart;
19131
+ var y = end - start;
19132
+ var len = Math.min(x, y);
19133
+ var thisCopy = this.slice(thisStart, thisEnd);
19134
+ var targetCopy = target.slice(start, end);
19135
+ for (var i = 0; i < len; ++i) if (thisCopy[i] !== targetCopy[i]) {
19136
+ x = thisCopy[i];
19137
+ y = targetCopy[i];
19138
+ break;
19139
+ }
19140
+ if (x < y) return -1;
19141
+ if (y < x) return 1;
19142
+ return 0;
19143
+ };
19144
+ function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
19145
+ if (buffer.length === 0) return -1;
19146
+ if (typeof byteOffset === "string") {
19147
+ encoding = byteOffset;
19148
+ byteOffset = 0;
19149
+ } else if (byteOffset > 2147483647) byteOffset = 2147483647;
19150
+ else if (byteOffset < -2147483648) byteOffset = -2147483648;
19151
+ byteOffset = +byteOffset;
19152
+ if (isNaN(byteOffset)) byteOffset = dir ? 0 : buffer.length - 1;
19153
+ if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
19154
+ if (byteOffset >= buffer.length) if (dir) return -1;
19155
+ else byteOffset = buffer.length - 1;
19156
+ else if (byteOffset < 0) if (dir) byteOffset = 0;
19157
+ else return -1;
19158
+ if (typeof val === "string") val = Buffer$1.from(val, encoding);
19159
+ if (internalIsBuffer(val)) {
19160
+ if (val.length === 0) return -1;
19161
+ return arrayIndexOf(buffer, val, byteOffset, encoding, dir);
19162
+ } else if (typeof val === "number") {
19163
+ val = val & 255;
19164
+ if (Buffer$1.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === "function") if (dir) return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);
19165
+ else return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);
19166
+ return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);
19167
+ }
19168
+ throw new TypeError("val must be string, number or Buffer");
19169
+ }
19170
+ function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
19171
+ var indexSize = 1;
19172
+ var arrLength = arr.length;
19173
+ var valLength = val.length;
19174
+ if (encoding !== void 0) {
19175
+ encoding = String(encoding).toLowerCase();
19176
+ if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") {
19177
+ if (arr.length < 2 || val.length < 2) return -1;
19178
+ indexSize = 2;
19179
+ arrLength /= 2;
19180
+ valLength /= 2;
19181
+ byteOffset /= 2;
19182
+ }
19183
+ }
19184
+ function read(buf, i) {
19185
+ if (indexSize === 1) return buf[i];
19186
+ else return buf.readUInt16BE(i * indexSize);
19187
+ }
19188
+ var i;
19189
+ if (dir) {
19190
+ var foundIndex = -1;
19191
+ for (i = byteOffset; i < arrLength; i++) if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
19192
+ if (foundIndex === -1) foundIndex = i;
19193
+ if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;
19194
+ } else {
19195
+ if (foundIndex !== -1) i -= i - foundIndex;
19196
+ foundIndex = -1;
19197
+ }
19198
+ } else {
19199
+ if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
19200
+ for (i = byteOffset; i >= 0; i--) {
19201
+ var found = true;
19202
+ for (var j = 0; j < valLength; j++) if (read(arr, i + j) !== read(val, j)) {
19203
+ found = false;
19204
+ break;
19205
+ }
19206
+ if (found) return i;
19207
+ }
19208
+ }
19209
+ return -1;
19210
+ }
19211
+ Buffer$1.prototype.includes = function includes(val, byteOffset, encoding) {
19212
+ return this.indexOf(val, byteOffset, encoding) !== -1;
19213
+ };
19214
+ Buffer$1.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
19215
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
19216
+ };
19217
+ Buffer$1.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
19218
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
19219
+ };
19220
+ function hexWrite(buf, string, offset, length) {
19221
+ offset = Number(offset) || 0;
19222
+ var remaining = buf.length - offset;
19223
+ if (!length) length = remaining;
19224
+ else {
19225
+ length = Number(length);
19226
+ if (length > remaining) length = remaining;
19227
+ }
19228
+ var strLen = string.length;
19229
+ if (strLen % 2 !== 0) throw new TypeError("Invalid hex string");
19230
+ if (length > strLen / 2) length = strLen / 2;
19231
+ for (var i = 0; i < length; ++i) {
19232
+ var parsed = parseInt(string.substr(i * 2, 2), 16);
19233
+ if (isNaN(parsed)) return i;
19234
+ buf[offset + i] = parsed;
19235
+ }
19236
+ return i;
19237
+ }
19238
+ function utf8Write(buf, string, offset, length) {
19239
+ return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
19240
+ }
19241
+ function asciiWrite(buf, string, offset, length) {
19242
+ return blitBuffer(asciiToBytes(string), buf, offset, length);
19243
+ }
19244
+ function latin1Write(buf, string, offset, length) {
19245
+ return asciiWrite(buf, string, offset, length);
19246
+ }
19247
+ function base64Write(buf, string, offset, length) {
19248
+ return blitBuffer(base64ToBytes(string), buf, offset, length);
19249
+ }
19250
+ function ucs2Write(buf, string, offset, length) {
19251
+ return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
19252
+ }
19253
+ Buffer$1.prototype.write = function write(string, offset, length, encoding) {
19254
+ if (offset === void 0) {
19255
+ encoding = "utf8";
19256
+ length = this.length;
19257
+ offset = 0;
19258
+ } else if (length === void 0 && typeof offset === "string") {
19259
+ encoding = offset;
19260
+ length = this.length;
19261
+ offset = 0;
19262
+ } else if (isFinite(offset)) {
19263
+ offset = offset | 0;
19264
+ if (isFinite(length)) {
19265
+ length = length | 0;
19266
+ if (encoding === void 0) encoding = "utf8";
19267
+ } else {
19268
+ encoding = length;
19269
+ length = void 0;
19270
+ }
19271
+ } else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
19272
+ var remaining = this.length - offset;
19273
+ if (length === void 0 || length > remaining) length = remaining;
19274
+ if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) throw new RangeError("Attempt to write outside buffer bounds");
19275
+ if (!encoding) encoding = "utf8";
19276
+ var loweredCase = false;
19277
+ for (;;) switch (encoding) {
19278
+ case "hex": return hexWrite(this, string, offset, length);
19279
+ case "utf8":
19280
+ case "utf-8": return utf8Write(this, string, offset, length);
19281
+ case "ascii": return asciiWrite(this, string, offset, length);
19282
+ case "latin1":
19283
+ case "binary": return latin1Write(this, string, offset, length);
19284
+ case "base64": return base64Write(this, string, offset, length);
19285
+ case "ucs2":
19286
+ case "ucs-2":
19287
+ case "utf16le":
19288
+ case "utf-16le": return ucs2Write(this, string, offset, length);
19289
+ default:
19290
+ if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
19291
+ encoding = ("" + encoding).toLowerCase();
19292
+ loweredCase = true;
19293
+ }
19294
+ };
19295
+ Buffer$1.prototype.toJSON = function toJSON() {
19296
+ return {
19297
+ type: "Buffer",
19298
+ data: Array.prototype.slice.call(this._arr || this, 0)
19299
+ };
19300
+ };
19301
+ function base64Slice(buf, start, end) {
19302
+ if (start === 0 && end === buf.length) return fromByteArray(buf);
19303
+ else return fromByteArray(buf.slice(start, end));
19304
+ }
19305
+ function utf8Slice(buf, start, end) {
19306
+ end = Math.min(buf.length, end);
19307
+ var res = [];
19308
+ var i = start;
19309
+ while (i < end) {
19310
+ var firstByte = buf[i];
19311
+ var codePoint = null;
19312
+ var bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;
19313
+ if (i + bytesPerSequence <= end) {
19314
+ var secondByte, thirdByte, fourthByte, tempCodePoint;
19315
+ switch (bytesPerSequence) {
19316
+ case 1:
19317
+ if (firstByte < 128) codePoint = firstByte;
19318
+ break;
19319
+ case 2:
19320
+ secondByte = buf[i + 1];
19321
+ if ((secondByte & 192) === 128) {
19322
+ tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;
19323
+ if (tempCodePoint > 127) codePoint = tempCodePoint;
19324
+ }
19325
+ break;
19326
+ case 3:
19327
+ secondByte = buf[i + 1];
19328
+ thirdByte = buf[i + 2];
19329
+ if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {
19330
+ tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;
19331
+ if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) codePoint = tempCodePoint;
19332
+ }
19333
+ break;
19334
+ case 4:
19335
+ secondByte = buf[i + 1];
19336
+ thirdByte = buf[i + 2];
19337
+ fourthByte = buf[i + 3];
19338
+ if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {
19339
+ tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;
19340
+ if (tempCodePoint > 65535 && tempCodePoint < 1114112) codePoint = tempCodePoint;
19341
+ }
19342
+ }
19343
+ }
19344
+ if (codePoint === null) {
19345
+ codePoint = 65533;
19346
+ bytesPerSequence = 1;
19347
+ } else if (codePoint > 65535) {
19348
+ codePoint -= 65536;
19349
+ res.push(codePoint >>> 10 & 1023 | 55296);
19350
+ codePoint = 56320 | codePoint & 1023;
19351
+ }
19352
+ res.push(codePoint);
19353
+ i += bytesPerSequence;
19354
+ }
19355
+ return decodeCodePointsArray(res);
19356
+ }
19357
+ var MAX_ARGUMENTS_LENGTH = 4096;
19358
+ function decodeCodePointsArray(codePoints) {
19359
+ var len = codePoints.length;
19360
+ if (len <= MAX_ARGUMENTS_LENGTH) return String.fromCharCode.apply(String, codePoints);
19361
+ var res = "";
19362
+ var i = 0;
19363
+ while (i < len) res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));
19364
+ return res;
19365
+ }
19366
+ function asciiSlice(buf, start, end) {
19367
+ var ret = "";
19368
+ end = Math.min(buf.length, end);
19369
+ for (var i = start; i < end; ++i) ret += String.fromCharCode(buf[i] & 127);
19370
+ return ret;
19371
+ }
19372
+ function latin1Slice(buf, start, end) {
19373
+ var ret = "";
19374
+ end = Math.min(buf.length, end);
19375
+ for (var i = start; i < end; ++i) ret += String.fromCharCode(buf[i]);
19376
+ return ret;
19377
+ }
19378
+ function hexSlice(buf, start, end) {
19379
+ var len = buf.length;
19380
+ if (!start || start < 0) start = 0;
19381
+ if (!end || end < 0 || end > len) end = len;
19382
+ var out = "";
19383
+ for (var i = start; i < end; ++i) out += toHex(buf[i]);
19384
+ return out;
19385
+ }
19386
+ function utf16leSlice(buf, start, end) {
19387
+ var bytes = buf.slice(start, end);
19388
+ var res = "";
19389
+ for (var i = 0; i < bytes.length; i += 2) res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
19390
+ return res;
19391
+ }
19392
+ Buffer$1.prototype.slice = function slice(start, end) {
19393
+ var len = this.length;
19394
+ start = ~~start;
19395
+ end = end === void 0 ? len : ~~end;
19396
+ if (start < 0) {
19397
+ start += len;
19398
+ if (start < 0) start = 0;
19399
+ } else if (start > len) start = len;
19400
+ if (end < 0) {
19401
+ end += len;
19402
+ if (end < 0) end = 0;
19403
+ } else if (end > len) end = len;
19404
+ if (end < start) end = start;
19405
+ var newBuf;
19406
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
19407
+ newBuf = this.subarray(start, end);
19408
+ newBuf.__proto__ = Buffer$1.prototype;
19409
+ } else {
19410
+ var sliceLen = end - start;
19411
+ newBuf = new Buffer$1(sliceLen, void 0);
19412
+ for (var i = 0; i < sliceLen; ++i) newBuf[i] = this[i + start];
19413
+ }
19414
+ return newBuf;
19415
+ };
19416
+ function checkOffset(offset, ext, length) {
19417
+ if (offset % 1 !== 0 || offset < 0) throw new RangeError("offset is not uint");
19418
+ if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length");
19419
+ }
19420
+ Buffer$1.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {
19421
+ offset = offset | 0;
19422
+ byteLength = byteLength | 0;
19423
+ if (!noAssert) checkOffset(offset, byteLength, this.length);
19424
+ var val = this[offset];
19425
+ var mul = 1;
19426
+ var i = 0;
19427
+ while (++i < byteLength && (mul *= 256)) val += this[offset + i] * mul;
19428
+ return val;
19429
+ };
19430
+ Buffer$1.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {
19431
+ offset = offset | 0;
19432
+ byteLength = byteLength | 0;
19433
+ if (!noAssert) checkOffset(offset, byteLength, this.length);
19434
+ var val = this[offset + --byteLength];
19435
+ var mul = 1;
19436
+ while (byteLength > 0 && (mul *= 256)) val += this[offset + --byteLength] * mul;
19437
+ return val;
19438
+ };
19439
+ Buffer$1.prototype.readUInt8 = function readUInt8(offset, noAssert) {
19440
+ if (!noAssert) checkOffset(offset, 1, this.length);
19441
+ return this[offset];
19442
+ };
19443
+ Buffer$1.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
19444
+ if (!noAssert) checkOffset(offset, 2, this.length);
19445
+ return this[offset] | this[offset + 1] << 8;
19446
+ };
19447
+ Buffer$1.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
19448
+ if (!noAssert) checkOffset(offset, 2, this.length);
19449
+ return this[offset] << 8 | this[offset + 1];
19450
+ };
19451
+ Buffer$1.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
19452
+ if (!noAssert) checkOffset(offset, 4, this.length);
19453
+ return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;
19454
+ };
19455
+ Buffer$1.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
19456
+ if (!noAssert) checkOffset(offset, 4, this.length);
19457
+ return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
19458
+ };
19459
+ Buffer$1.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {
19460
+ offset = offset | 0;
19461
+ byteLength = byteLength | 0;
19462
+ if (!noAssert) checkOffset(offset, byteLength, this.length);
19463
+ var val = this[offset];
19464
+ var mul = 1;
19465
+ var i = 0;
19466
+ while (++i < byteLength && (mul *= 256)) val += this[offset + i] * mul;
19467
+ mul *= 128;
19468
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength);
19469
+ return val;
19470
+ };
19471
+ Buffer$1.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {
19472
+ offset = offset | 0;
19473
+ byteLength = byteLength | 0;
19474
+ if (!noAssert) checkOffset(offset, byteLength, this.length);
19475
+ var i = byteLength;
19476
+ var mul = 1;
19477
+ var val = this[offset + --i];
19478
+ while (i > 0 && (mul *= 256)) val += this[offset + --i] * mul;
19479
+ mul *= 128;
19480
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength);
19481
+ return val;
19482
+ };
19483
+ Buffer$1.prototype.readInt8 = function readInt8(offset, noAssert) {
19484
+ if (!noAssert) checkOffset(offset, 1, this.length);
19485
+ if (!(this[offset] & 128)) return this[offset];
19486
+ return (255 - this[offset] + 1) * -1;
19487
+ };
19488
+ Buffer$1.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
19489
+ if (!noAssert) checkOffset(offset, 2, this.length);
19490
+ var val = this[offset] | this[offset + 1] << 8;
19491
+ return val & 32768 ? val | 4294901760 : val;
19492
+ };
19493
+ Buffer$1.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
19494
+ if (!noAssert) checkOffset(offset, 2, this.length);
19495
+ var val = this[offset + 1] | this[offset] << 8;
19496
+ return val & 32768 ? val | 4294901760 : val;
19497
+ };
19498
+ Buffer$1.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
19499
+ if (!noAssert) checkOffset(offset, 4, this.length);
19500
+ return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
19501
+ };
19502
+ Buffer$1.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
19503
+ if (!noAssert) checkOffset(offset, 4, this.length);
19504
+ return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
19505
+ };
19506
+ Buffer$1.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
19507
+ if (!noAssert) checkOffset(offset, 4, this.length);
19508
+ return read(this, offset, true, 23, 4);
19509
+ };
19510
+ Buffer$1.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
19511
+ if (!noAssert) checkOffset(offset, 4, this.length);
19512
+ return read(this, offset, false, 23, 4);
19513
+ };
19514
+ Buffer$1.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
19515
+ if (!noAssert) checkOffset(offset, 8, this.length);
19516
+ return read(this, offset, true, 52, 8);
19517
+ };
19518
+ Buffer$1.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
19519
+ if (!noAssert) checkOffset(offset, 8, this.length);
19520
+ return read(this, offset, false, 52, 8);
19521
+ };
19522
+ function checkInt(buf, value, offset, ext, max, min) {
19523
+ if (!internalIsBuffer(buf)) throw new TypeError("\"buffer\" argument must be a Buffer instance");
19524
+ if (value > max || value < min) throw new RangeError("\"value\" argument is out of bounds");
19525
+ if (offset + ext > buf.length) throw new RangeError("Index out of range");
19526
+ }
19527
+ Buffer$1.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {
19528
+ value = +value;
19529
+ offset = offset | 0;
19530
+ byteLength = byteLength | 0;
19531
+ if (!noAssert) {
19532
+ var maxBytes = Math.pow(2, 8 * byteLength) - 1;
19533
+ checkInt(this, value, offset, byteLength, maxBytes, 0);
19534
+ }
19535
+ var mul = 1;
19536
+ var i = 0;
19537
+ this[offset] = value & 255;
19538
+ while (++i < byteLength && (mul *= 256)) this[offset + i] = value / mul & 255;
19539
+ return offset + byteLength;
19540
+ };
19541
+ Buffer$1.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {
19542
+ value = +value;
19543
+ offset = offset | 0;
19544
+ byteLength = byteLength | 0;
19545
+ if (!noAssert) {
19546
+ var maxBytes = Math.pow(2, 8 * byteLength) - 1;
19547
+ checkInt(this, value, offset, byteLength, maxBytes, 0);
19548
+ }
19549
+ var i = byteLength - 1;
19550
+ var mul = 1;
19551
+ this[offset + i] = value & 255;
19552
+ while (--i >= 0 && (mul *= 256)) this[offset + i] = value / mul & 255;
19553
+ return offset + byteLength;
19554
+ };
19555
+ Buffer$1.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
19556
+ value = +value;
19557
+ offset = offset | 0;
19558
+ if (!noAssert) checkInt(this, value, offset, 1, 255, 0);
19559
+ if (!Buffer$1.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
19560
+ this[offset] = value & 255;
19561
+ return offset + 1;
19562
+ };
19563
+ function objectWriteUInt16(buf, value, offset, littleEndian) {
19564
+ if (value < 0) value = 65535 + value + 1;
19565
+ 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;
19566
+ }
19567
+ Buffer$1.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
19568
+ value = +value;
19569
+ offset = offset | 0;
19570
+ if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
19571
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
19572
+ this[offset] = value & 255;
19573
+ this[offset + 1] = value >>> 8;
19574
+ } else objectWriteUInt16(this, value, offset, true);
19575
+ return offset + 2;
19576
+ };
19577
+ Buffer$1.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
19578
+ value = +value;
19579
+ offset = offset | 0;
19580
+ if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
19581
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
19582
+ this[offset] = value >>> 8;
19583
+ this[offset + 1] = value & 255;
19584
+ } else objectWriteUInt16(this, value, offset, false);
19585
+ return offset + 2;
19586
+ };
19587
+ function objectWriteUInt32(buf, value, offset, littleEndian) {
19588
+ if (value < 0) value = 4294967295 + value + 1;
19589
+ for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) buf[offset + i] = value >>> (littleEndian ? i : 3 - i) * 8 & 255;
19590
+ }
19591
+ Buffer$1.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
19592
+ value = +value;
19593
+ offset = offset | 0;
19594
+ if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
19595
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
19596
+ this[offset + 3] = value >>> 24;
19597
+ this[offset + 2] = value >>> 16;
19598
+ this[offset + 1] = value >>> 8;
19599
+ this[offset] = value & 255;
19600
+ } else objectWriteUInt32(this, value, offset, true);
19601
+ return offset + 4;
19602
+ };
19603
+ Buffer$1.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
19604
+ value = +value;
19605
+ offset = offset | 0;
19606
+ if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
19607
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
19608
+ this[offset] = value >>> 24;
19609
+ this[offset + 1] = value >>> 16;
19610
+ this[offset + 2] = value >>> 8;
19611
+ this[offset + 3] = value & 255;
19612
+ } else objectWriteUInt32(this, value, offset, false);
19613
+ return offset + 4;
19614
+ };
19615
+ Buffer$1.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {
19616
+ value = +value;
19617
+ offset = offset | 0;
19618
+ if (!noAssert) {
19619
+ var limit = Math.pow(2, 8 * byteLength - 1);
19620
+ checkInt(this, value, offset, byteLength, limit - 1, -limit);
19621
+ }
19622
+ var i = 0;
19623
+ var mul = 1;
19624
+ var sub = 0;
19625
+ this[offset] = value & 255;
19626
+ while (++i < byteLength && (mul *= 256)) {
19627
+ if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) sub = 1;
19628
+ this[offset + i] = (value / mul >> 0) - sub & 255;
19629
+ }
19630
+ return offset + byteLength;
19631
+ };
19632
+ Buffer$1.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {
19633
+ value = +value;
19634
+ offset = offset | 0;
19635
+ if (!noAssert) {
19636
+ var limit = Math.pow(2, 8 * byteLength - 1);
19637
+ checkInt(this, value, offset, byteLength, limit - 1, -limit);
19638
+ }
19639
+ var i = byteLength - 1;
19640
+ var mul = 1;
19641
+ var sub = 0;
19642
+ this[offset + i] = value & 255;
19643
+ while (--i >= 0 && (mul *= 256)) {
19644
+ if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) sub = 1;
19645
+ this[offset + i] = (value / mul >> 0) - sub & 255;
19646
+ }
19647
+ return offset + byteLength;
19648
+ };
19649
+ Buffer$1.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
19650
+ value = +value;
19651
+ offset = offset | 0;
19652
+ if (!noAssert) checkInt(this, value, offset, 1, 127, -128);
19653
+ if (!Buffer$1.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
19654
+ if (value < 0) value = 255 + value + 1;
19655
+ this[offset] = value & 255;
19656
+ return offset + 1;
19657
+ };
19658
+ Buffer$1.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
19659
+ value = +value;
19660
+ offset = offset | 0;
19661
+ if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
19662
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
19663
+ this[offset] = value & 255;
19664
+ this[offset + 1] = value >>> 8;
19665
+ } else objectWriteUInt16(this, value, offset, true);
19666
+ return offset + 2;
19667
+ };
19668
+ Buffer$1.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
19669
+ value = +value;
19670
+ offset = offset | 0;
19671
+ if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
19672
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
19673
+ this[offset] = value >>> 8;
19674
+ this[offset + 1] = value & 255;
19675
+ } else objectWriteUInt16(this, value, offset, false);
19676
+ return offset + 2;
19677
+ };
19678
+ Buffer$1.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
19679
+ value = +value;
19680
+ offset = offset | 0;
19681
+ if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
19682
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
19683
+ this[offset] = value & 255;
19684
+ this[offset + 1] = value >>> 8;
19685
+ this[offset + 2] = value >>> 16;
19686
+ this[offset + 3] = value >>> 24;
19687
+ } else objectWriteUInt32(this, value, offset, true);
19688
+ return offset + 4;
19689
+ };
19690
+ Buffer$1.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
19691
+ value = +value;
19692
+ offset = offset | 0;
19693
+ if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
19694
+ if (value < 0) value = 4294967295 + value + 1;
19695
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
19696
+ this[offset] = value >>> 24;
19697
+ this[offset + 1] = value >>> 16;
19698
+ this[offset + 2] = value >>> 8;
19699
+ this[offset + 3] = value & 255;
19700
+ } else objectWriteUInt32(this, value, offset, false);
19701
+ return offset + 4;
19702
+ };
19703
+ function checkIEEE754(buf, value, offset, ext, max, min) {
19704
+ if (offset + ext > buf.length) throw new RangeError("Index out of range");
19705
+ if (offset < 0) throw new RangeError("Index out of range");
19706
+ }
19707
+ function writeFloat(buf, value, offset, littleEndian, noAssert) {
19708
+ if (!noAssert) checkIEEE754(buf, value, offset, 4);
19709
+ write(buf, value, offset, littleEndian, 23, 4);
19710
+ return offset + 4;
19711
+ }
19712
+ Buffer$1.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
19713
+ return writeFloat(this, value, offset, true, noAssert);
19714
+ };
19715
+ Buffer$1.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
19716
+ return writeFloat(this, value, offset, false, noAssert);
19717
+ };
19718
+ function writeDouble(buf, value, offset, littleEndian, noAssert) {
19719
+ if (!noAssert) checkIEEE754(buf, value, offset, 8);
19720
+ write(buf, value, offset, littleEndian, 52, 8);
19721
+ return offset + 8;
19722
+ }
19723
+ Buffer$1.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
19724
+ return writeDouble(this, value, offset, true, noAssert);
19725
+ };
19726
+ Buffer$1.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
19727
+ return writeDouble(this, value, offset, false, noAssert);
19728
+ };
19729
+ Buffer$1.prototype.copy = function copy(target, targetStart, start, end) {
19730
+ if (!start) start = 0;
19731
+ if (!end && end !== 0) end = this.length;
19732
+ if (targetStart >= target.length) targetStart = target.length;
19733
+ if (!targetStart) targetStart = 0;
19734
+ if (end > 0 && end < start) end = start;
19735
+ if (end === start) return 0;
19736
+ if (target.length === 0 || this.length === 0) return 0;
19737
+ if (targetStart < 0) throw new RangeError("targetStart out of bounds");
19738
+ if (start < 0 || start >= this.length) throw new RangeError("sourceStart out of bounds");
19739
+ if (end < 0) throw new RangeError("sourceEnd out of bounds");
19740
+ if (end > this.length) end = this.length;
19741
+ if (target.length - targetStart < end - start) end = target.length - targetStart + start;
19742
+ var len = end - start;
19743
+ var i;
19744
+ if (this === target && start < targetStart && targetStart < end) for (i = len - 1; i >= 0; --i) target[i + targetStart] = this[i + start];
19745
+ else if (len < 1e3 || !Buffer$1.TYPED_ARRAY_SUPPORT) for (i = 0; i < len; ++i) target[i + targetStart] = this[i + start];
19746
+ else Uint8Array.prototype.set.call(target, this.subarray(start, start + len), targetStart);
19747
+ return len;
19748
+ };
19749
+ Buffer$1.prototype.fill = function fill(val, start, end, encoding) {
19750
+ if (typeof val === "string") {
19751
+ if (typeof start === "string") {
19752
+ encoding = start;
19753
+ start = 0;
19754
+ end = this.length;
19755
+ } else if (typeof end === "string") {
19756
+ encoding = end;
19757
+ end = this.length;
19758
+ }
19759
+ if (val.length === 1) {
19760
+ var code = val.charCodeAt(0);
19761
+ if (code < 256) val = code;
19762
+ }
19763
+ if (encoding !== void 0 && typeof encoding !== "string") throw new TypeError("encoding must be a string");
19764
+ if (typeof encoding === "string" && !Buffer$1.isEncoding(encoding)) throw new TypeError("Unknown encoding: " + encoding);
19765
+ } else if (typeof val === "number") val = val & 255;
19766
+ if (start < 0 || this.length < start || this.length < end) throw new RangeError("Out of range index");
19767
+ if (end <= start) return this;
19768
+ start = start >>> 0;
19769
+ end = end === void 0 ? this.length : end >>> 0;
19770
+ if (!val) val = 0;
19771
+ var i;
19772
+ if (typeof val === "number") for (i = start; i < end; ++i) this[i] = val;
19773
+ else {
19774
+ var bytes = internalIsBuffer(val) ? val : utf8ToBytes(new Buffer$1(val, encoding).toString());
19775
+ var len = bytes.length;
19776
+ for (i = 0; i < end - start; ++i) this[i + start] = bytes[i % len];
19777
+ }
19778
+ return this;
19779
+ };
19780
+ var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g;
19781
+ function base64clean(str) {
19782
+ str = stringtrim(str).replace(INVALID_BASE64_RE, "");
19783
+ if (str.length < 2) return "";
19784
+ while (str.length % 4 !== 0) str = str + "=";
19785
+ return str;
19786
+ }
19787
+ function stringtrim(str) {
19788
+ if (str.trim) return str.trim();
19789
+ return str.replace(/^\s+|\s+$/g, "");
19790
+ }
19791
+ function toHex(n) {
19792
+ if (n < 16) return "0" + n.toString(16);
19793
+ return n.toString(16);
19794
+ }
19795
+ function utf8ToBytes(string, units) {
19796
+ units = units || Infinity;
19797
+ var codePoint;
19798
+ var length = string.length;
19799
+ var leadSurrogate = null;
19800
+ var bytes = [];
19801
+ for (var i = 0; i < length; ++i) {
19802
+ codePoint = string.charCodeAt(i);
19803
+ if (codePoint > 55295 && codePoint < 57344) {
19804
+ if (!leadSurrogate) {
19805
+ if (codePoint > 56319) {
19806
+ if ((units -= 3) > -1) bytes.push(239, 191, 189);
19807
+ continue;
19808
+ } else if (i + 1 === length) {
19809
+ if ((units -= 3) > -1) bytes.push(239, 191, 189);
19810
+ continue;
19811
+ }
19812
+ leadSurrogate = codePoint;
19813
+ continue;
19814
+ }
19815
+ if (codePoint < 56320) {
19816
+ if ((units -= 3) > -1) bytes.push(239, 191, 189);
19817
+ leadSurrogate = codePoint;
19818
+ continue;
19819
+ }
19820
+ codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;
19821
+ } else if (leadSurrogate) {
19822
+ if ((units -= 3) > -1) bytes.push(239, 191, 189);
19823
+ }
19824
+ leadSurrogate = null;
19825
+ if (codePoint < 128) {
19826
+ if ((units -= 1) < 0) break;
19827
+ bytes.push(codePoint);
19828
+ } else if (codePoint < 2048) {
19829
+ if ((units -= 2) < 0) break;
19830
+ bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128);
19831
+ } else if (codePoint < 65536) {
19832
+ if ((units -= 3) < 0) break;
19833
+ bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);
19834
+ } else if (codePoint < 1114112) {
19835
+ if ((units -= 4) < 0) break;
19836
+ bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);
19837
+ } else throw new Error("Invalid code point");
19838
+ }
19839
+ return bytes;
19840
+ }
19841
+ function asciiToBytes(str) {
19842
+ var byteArray = [];
19843
+ for (var i = 0; i < str.length; ++i) byteArray.push(str.charCodeAt(i) & 255);
19844
+ return byteArray;
19845
+ }
19846
+ function utf16leToBytes(str, units) {
19847
+ var c, hi, lo;
19848
+ var byteArray = [];
19849
+ for (var i = 0; i < str.length; ++i) {
19850
+ if ((units -= 2) < 0) break;
19851
+ c = str.charCodeAt(i);
19852
+ hi = c >> 8;
19853
+ lo = c % 256;
19854
+ byteArray.push(lo);
19855
+ byteArray.push(hi);
19856
+ }
19857
+ return byteArray;
19858
+ }
19859
+ function base64ToBytes(str) {
19860
+ return toByteArray(base64clean(str));
19861
+ }
19862
+ function blitBuffer(src, dst, offset, length) {
19863
+ for (var i = 0; i < length; ++i) {
19864
+ if (i + offset >= dst.length || i >= src.length) break;
19865
+ dst[i + offset] = src[i];
19866
+ }
19867
+ return i;
19868
+ }
19869
+ function isnan(val) {
19870
+ return val !== val;
19871
+ }
19872
+ function isBuffer(obj) {
19873
+ return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj));
19874
+ }
19875
+ function isFastBuffer(obj) {
19876
+ return !!obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj);
19877
+ }
19878
+ function isSlowBuffer(obj) {
19879
+ return typeof obj.readFloatLE === "function" && typeof obj.slice === "function" && isFastBuffer(obj.slice(0, 0));
19880
+ }
19881
+ //#endregion
19882
+ //#region \0polyfill-node.process.js
19883
+ function defaultSetTimout() {
19884
+ throw new Error("setTimeout has not been defined");
19885
+ }
19886
+ function defaultClearTimeout() {
19887
+ throw new Error("clearTimeout has not been defined");
19888
+ }
19889
+ var cachedSetTimeout = defaultSetTimout;
19890
+ var cachedClearTimeout = defaultClearTimeout;
19891
+ if (typeof _polyfill_node_global_default.setTimeout === "function") cachedSetTimeout = setTimeout;
19892
+ if (typeof _polyfill_node_global_default.clearTimeout === "function") cachedClearTimeout = clearTimeout;
19893
+ function runTimeout(fun) {
19894
+ if (cachedSetTimeout === setTimeout) return setTimeout(fun, 0);
19895
+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
19896
+ cachedSetTimeout = setTimeout;
19897
+ return setTimeout(fun, 0);
19898
+ }
19899
+ try {
19900
+ return cachedSetTimeout(fun, 0);
19901
+ } catch (e) {
19902
+ try {
19903
+ return cachedSetTimeout.call(null, fun, 0);
19904
+ } catch (e) {
19905
+ return cachedSetTimeout.call(this, fun, 0);
19906
+ }
19907
+ }
19908
+ }
19909
+ function runClearTimeout(marker) {
19910
+ if (cachedClearTimeout === clearTimeout) return clearTimeout(marker);
19911
+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
19912
+ cachedClearTimeout = clearTimeout;
19913
+ return clearTimeout(marker);
19914
+ }
19915
+ try {
19916
+ return cachedClearTimeout(marker);
19917
+ } catch (e) {
19918
+ try {
19919
+ return cachedClearTimeout.call(null, marker);
19920
+ } catch (e) {
19921
+ return cachedClearTimeout.call(this, marker);
19922
+ }
19923
+ }
19924
+ }
19925
+ var queue = [];
19926
+ var draining = false;
19927
+ var currentQueue;
19928
+ var queueIndex = -1;
19929
+ function cleanUpNextTick() {
19930
+ if (!draining || !currentQueue) return;
19931
+ draining = false;
19932
+ if (currentQueue.length) queue = currentQueue.concat(queue);
19933
+ else queueIndex = -1;
19934
+ if (queue.length) drainQueue();
19935
+ }
19936
+ function drainQueue() {
19937
+ if (draining) return;
19938
+ var timeout = runTimeout(cleanUpNextTick);
19939
+ draining = true;
19940
+ var len = queue.length;
19941
+ while (len) {
19942
+ currentQueue = queue;
19943
+ queue = [];
19944
+ while (++queueIndex < len) if (currentQueue) currentQueue[queueIndex].run();
19945
+ queueIndex = -1;
19946
+ len = queue.length;
19947
+ }
19948
+ currentQueue = null;
19949
+ draining = false;
19950
+ runClearTimeout(timeout);
19951
+ }
19952
+ function nextTick(fun) {
19953
+ var args = new Array(arguments.length - 1);
19954
+ if (arguments.length > 1) for (var i = 1; i < arguments.length; i++) args[i - 1] = arguments[i];
19955
+ queue.push(new Item(fun, args));
19956
+ if (queue.length === 1 && !draining) runTimeout(drainQueue);
19957
+ }
19958
+ function Item(fun, array) {
19959
+ this.fun = fun;
19960
+ this.array = array;
19961
+ }
19962
+ Item.prototype.run = function() {
19963
+ this.fun.apply(null, this.array);
19964
+ };
19965
+ var title = "browser";
19966
+ var platform = "browser";
19967
+ var env = {};
19968
+ var argv = [];
19969
+ var versions = {};
19970
+ var release = {};
19971
+ var config = {};
19972
+ function noop() {}
19973
+ var on = noop;
19974
+ var addListener = noop;
19975
+ var once = noop;
19976
+ var off = noop;
19977
+ var removeListener = noop;
19978
+ var removeAllListeners = noop;
19979
+ var emit = noop;
19980
+ function binding(name) {
19981
+ throw new Error("process.binding is not supported");
19982
+ }
19983
+ function cwd() {
19984
+ return "/";
19985
+ }
19986
+ function chdir(dir) {
19987
+ throw new Error("process.chdir is not supported");
19988
+ }
19989
+ function umask() {
19990
+ return 0;
19991
+ }
19992
+ var performance = _polyfill_node_global_default.performance || {};
19993
+ var performanceNow = performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow || function() {
19994
+ return (/* @__PURE__ */ new Date()).getTime();
19995
+ };
19996
+ function hrtime(previousTimestamp) {
19997
+ var clocktime = performanceNow.call(performance) * .001;
19998
+ var seconds = Math.floor(clocktime);
19999
+ var nanoseconds = Math.floor(clocktime % 1 * 1e9);
20000
+ if (previousTimestamp) {
20001
+ seconds = seconds - previousTimestamp[0];
20002
+ nanoseconds = nanoseconds - previousTimestamp[1];
20003
+ if (nanoseconds < 0) {
20004
+ seconds--;
20005
+ nanoseconds += 1e9;
20006
+ }
20007
+ }
20008
+ return [seconds, nanoseconds];
20009
+ }
20010
+ var startTime = /* @__PURE__ */ new Date();
20011
+ function uptime() {
20012
+ return (/* @__PURE__ */ new Date() - startTime) / 1e3;
20013
+ }
20014
+ var browser$1 = {
20015
+ nextTick,
20016
+ title,
20017
+ browser: true,
20018
+ env,
20019
+ argv,
20020
+ version: "",
20021
+ versions,
20022
+ on,
20023
+ addListener,
20024
+ once,
20025
+ off,
20026
+ removeListener,
20027
+ removeAllListeners,
20028
+ emit,
20029
+ binding,
20030
+ cwd,
20031
+ chdir,
20032
+ umask,
20033
+ hrtime,
20034
+ platform,
20035
+ release,
20036
+ config,
20037
+ uptime
20038
+ };
20039
+ //#endregion
20040
+ //#region \0polyfill-node._inherits.js
20041
+ var inherits;
20042
+ if (typeof Object.create === "function") inherits = function inherits(ctor, superCtor) {
20043
+ ctor.super_ = superCtor;
20044
+ ctor.prototype = Object.create(superCtor.prototype, { constructor: {
20045
+ value: ctor,
20046
+ enumerable: false,
20047
+ writable: true,
20048
+ configurable: true
20049
+ } });
20050
+ };
20051
+ else inherits = function inherits(ctor, superCtor) {
20052
+ ctor.super_ = superCtor;
20053
+ var TempCtor = function() {};
20054
+ TempCtor.prototype = superCtor.prototype;
20055
+ ctor.prototype = new TempCtor();
20056
+ ctor.prototype.constructor = ctor;
20057
+ };
20058
+ var _polyfill_node__inherits_default = inherits;
20059
+ //#endregion
20060
+ //#region \0polyfill-node.util.js
20061
+ /**
20062
+ * Inherit the prototype methods from one constructor into another.
20063
+ *
20064
+ * The Function.prototype.inherits from lang.js rewritten as a standalone
20065
+ * function (not on Function.prototype). NOTE: If this file is to be loaded
20066
+ * during bootstrapping this function needs to be rewritten using some native
20067
+ * functions as prototype setup using normal JavaScript does not work as
20068
+ * expected during bootstrapping (see mirror.js in r114903).
20069
+ *
20070
+ * @param {function} ctor Constructor function which needs to inherit the
20071
+ * prototype.
20072
+ * @param {function} superCtor Constructor function to inherit prototype from.
20073
+ */
20074
+ var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(obj) {
20075
+ var keys = Object.keys(obj);
20076
+ var descriptors = {};
20077
+ for (var i = 0; i < keys.length; i++) descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);
20078
+ return descriptors;
20079
+ };
20080
+ var formatRegExp = /%[sdj%]/g;
20081
+ function format(f) {
20082
+ if (!isString(f)) {
20083
+ var objects = [];
20084
+ for (var i = 0; i < arguments.length; i++) objects.push(inspect(arguments[i]));
20085
+ return objects.join(" ");
20086
+ }
20087
+ var i = 1;
20088
+ var args = arguments;
20089
+ var len = args.length;
20090
+ var str = String(f).replace(formatRegExp, function(x) {
20091
+ if (x === "%%") return "%";
20092
+ if (i >= len) return x;
20093
+ switch (x) {
20094
+ case "%s": return String(args[i++]);
20095
+ case "%d": return Number(args[i++]);
20096
+ case "%j": try {
20097
+ return JSON.stringify(args[i++]);
20098
+ } catch (_) {
20099
+ return "[Circular]";
20100
+ }
20101
+ default: return x;
20102
+ }
20103
+ });
20104
+ for (var x = args[i]; i < len; x = args[++i]) if (isNull(x) || !isObject(x)) str += " " + x;
20105
+ else str += " " + inspect(x);
20106
+ return str;
20107
+ }
20108
+ function deprecate(fn, msg) {
20109
+ if (isUndefined(_polyfill_node_global_default.process)) return function() {
20110
+ return deprecate(fn, msg).apply(this, arguments);
20111
+ };
20112
+ if (browser$1.noDeprecation === true) return fn;
20113
+ var warned = false;
20114
+ function deprecated() {
20115
+ if (!warned) {
20116
+ if (browser$1.throwDeprecation) throw new Error(msg);
20117
+ else if (browser$1.traceDeprecation) console.trace(msg);
20118
+ else console.error(msg);
20119
+ warned = true;
20120
+ }
20121
+ return fn.apply(this, arguments);
20122
+ }
20123
+ return deprecated;
20124
+ }
20125
+ var debugs = {};
20126
+ var debugEnviron;
20127
+ function debuglog(set) {
20128
+ if (isUndefined(debugEnviron)) debugEnviron = browser$1.env.NODE_DEBUG || "";
20129
+ set = set.toUpperCase();
20130
+ if (!debugs[set]) if (new RegExp("\\b" + set + "\\b", "i").test(debugEnviron)) {
20131
+ var pid = 0;
20132
+ debugs[set] = function() {
20133
+ var msg = format.apply(null, arguments);
20134
+ console.error("%s %d: %s", set, pid, msg);
20135
+ };
20136
+ } else debugs[set] = function() {};
20137
+ return debugs[set];
20138
+ }
20139
+ /**
20140
+ * Echos the value of a value. Trys to print the value out
20141
+ * in the best way possible given the different types.
20142
+ *
20143
+ * @param {Object} obj The object to print out.
20144
+ * @param {Object} opts Optional options object that alters the output.
20145
+ */
20146
+ function inspect(obj, opts) {
20147
+ var ctx = {
20148
+ seen: [],
20149
+ stylize: stylizeNoColor
20150
+ };
20151
+ if (arguments.length >= 3) ctx.depth = arguments[2];
20152
+ if (arguments.length >= 4) ctx.colors = arguments[3];
20153
+ if (isBoolean(opts)) ctx.showHidden = opts;
20154
+ else if (opts) _extend(ctx, opts);
20155
+ if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
20156
+ if (isUndefined(ctx.depth)) ctx.depth = 2;
20157
+ if (isUndefined(ctx.colors)) ctx.colors = false;
20158
+ if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
20159
+ if (ctx.colors) ctx.stylize = stylizeWithColor;
20160
+ return formatValue(ctx, obj, ctx.depth);
20161
+ }
20162
+ inspect.colors = {
20163
+ "bold": [1, 22],
20164
+ "italic": [3, 23],
20165
+ "underline": [4, 24],
20166
+ "inverse": [7, 27],
20167
+ "white": [37, 39],
20168
+ "grey": [90, 39],
20169
+ "black": [30, 39],
20170
+ "blue": [34, 39],
20171
+ "cyan": [36, 39],
20172
+ "green": [32, 39],
20173
+ "magenta": [35, 39],
20174
+ "red": [31, 39],
20175
+ "yellow": [33, 39]
20176
+ };
20177
+ inspect.styles = {
20178
+ "special": "cyan",
20179
+ "number": "yellow",
20180
+ "boolean": "yellow",
20181
+ "undefined": "grey",
20182
+ "null": "bold",
20183
+ "string": "green",
20184
+ "date": "magenta",
20185
+ "regexp": "red"
20186
+ };
20187
+ function stylizeWithColor(str, styleType) {
20188
+ var style = inspect.styles[styleType];
20189
+ if (style) return "\x1B[" + inspect.colors[style][0] + "m" + str + "\x1B[" + inspect.colors[style][1] + "m";
20190
+ else return str;
20191
+ }
20192
+ function stylizeNoColor(str, styleType) {
20193
+ return str;
20194
+ }
20195
+ function arrayToHash(array) {
20196
+ var hash = {};
20197
+ array.forEach(function(val, idx) {
20198
+ hash[val] = true;
20199
+ });
20200
+ return hash;
20201
+ }
20202
+ function formatValue(ctx, value, recurseTimes) {
20203
+ if (ctx.customInspect && value && isFunction(value.inspect) && value.inspect !== inspect && !(value.constructor && value.constructor.prototype === value)) {
20204
+ var ret = value.inspect(recurseTimes, ctx);
20205
+ if (!isString(ret)) ret = formatValue(ctx, ret, recurseTimes);
20206
+ return ret;
20207
+ }
20208
+ var primitive = formatPrimitive(ctx, value);
20209
+ if (primitive) return primitive;
20210
+ var keys = Object.keys(value);
20211
+ var visibleKeys = arrayToHash(keys);
20212
+ if (ctx.showHidden) keys = Object.getOwnPropertyNames(value);
20213
+ if (isError(value) && (keys.indexOf("message") >= 0 || keys.indexOf("description") >= 0)) return formatError(value);
20214
+ if (keys.length === 0) {
20215
+ if (isFunction(value)) {
20216
+ var name = value.name ? ": " + value.name : "";
20217
+ return ctx.stylize("[Function" + name + "]", "special");
20218
+ }
20219
+ if (isRegExp(value)) return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
20220
+ if (isDate(value)) return ctx.stylize(Date.prototype.toString.call(value), "date");
20221
+ if (isError(value)) return formatError(value);
20222
+ }
20223
+ var base = "", array = false, braces = ["{", "}"];
20224
+ if (isArray(value)) {
20225
+ array = true;
20226
+ braces = ["[", "]"];
20227
+ }
20228
+ if (isFunction(value)) base = " [Function" + (value.name ? ": " + value.name : "") + "]";
20229
+ if (isRegExp(value)) base = " " + RegExp.prototype.toString.call(value);
20230
+ if (isDate(value)) base = " " + Date.prototype.toUTCString.call(value);
20231
+ if (isError(value)) base = " " + formatError(value);
20232
+ if (keys.length === 0 && (!array || value.length == 0)) return braces[0] + base + braces[1];
20233
+ if (recurseTimes < 0) if (isRegExp(value)) return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
20234
+ else return ctx.stylize("[Object]", "special");
20235
+ ctx.seen.push(value);
20236
+ var output;
20237
+ if (array) output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
20238
+ else output = keys.map(function(key) {
20239
+ return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
20240
+ });
20241
+ ctx.seen.pop();
20242
+ return reduceToSingleString(output, base, braces);
20243
+ }
20244
+ function formatPrimitive(ctx, value) {
20245
+ if (isUndefined(value)) return ctx.stylize("undefined", "undefined");
20246
+ if (isString(value)) {
20247
+ var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, "\"") + "'";
20248
+ return ctx.stylize(simple, "string");
20249
+ }
20250
+ if (isNumber(value)) return ctx.stylize("" + value, "number");
20251
+ if (isBoolean(value)) return ctx.stylize("" + value, "boolean");
20252
+ if (isNull(value)) return ctx.stylize("null", "null");
20253
+ }
20254
+ function formatError(value) {
20255
+ return "[" + Error.prototype.toString.call(value) + "]";
20256
+ }
20257
+ function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
20258
+ var output = [];
20259
+ for (var i = 0, l = value.length; i < l; ++i) if (hasOwnProperty(value, String(i))) output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true));
20260
+ else output.push("");
20261
+ keys.forEach(function(key) {
20262
+ if (!key.match(/^\d+$/)) output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));
20263
+ });
20264
+ return output;
20265
+ }
20266
+ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
20267
+ var name, str, desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
20268
+ if (desc.get) if (desc.set) str = ctx.stylize("[Getter/Setter]", "special");
20269
+ else str = ctx.stylize("[Getter]", "special");
20270
+ else if (desc.set) str = ctx.stylize("[Setter]", "special");
20271
+ if (!hasOwnProperty(visibleKeys, key)) name = "[" + key + "]";
20272
+ if (!str) if (ctx.seen.indexOf(desc.value) < 0) {
20273
+ if (isNull(recurseTimes)) str = formatValue(ctx, desc.value, null);
20274
+ else str = formatValue(ctx, desc.value, recurseTimes - 1);
20275
+ if (str.indexOf("\n") > -1) if (array) str = str.split("\n").map(function(line) {
20276
+ return " " + line;
20277
+ }).join("\n").substr(2);
20278
+ else str = "\n" + str.split("\n").map(function(line) {
20279
+ return " " + line;
20280
+ }).join("\n");
20281
+ } else str = ctx.stylize("[Circular]", "special");
20282
+ if (isUndefined(name)) {
20283
+ if (array && key.match(/^\d+$/)) return str;
20284
+ name = JSON.stringify("" + key);
20285
+ if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
20286
+ name = name.substr(1, name.length - 2);
20287
+ name = ctx.stylize(name, "name");
20288
+ } else {
20289
+ name = name.replace(/'/g, "\\'").replace(/\\"/g, "\"").replace(/(^"|"$)/g, "'");
20290
+ name = ctx.stylize(name, "string");
20291
+ }
20292
+ }
20293
+ return name + ": " + str;
20294
+ }
20295
+ function reduceToSingleString(output, base, braces) {
20296
+ var numLinesEst = 0;
20297
+ if (output.reduce(function(prev, cur) {
20298
+ numLinesEst++;
20299
+ if (cur.indexOf("\n") >= 0) numLinesEst++;
20300
+ return prev + cur.replace(/\u001b\[\d\d?m/g, "").length + 1;
20301
+ }, 0) > 60) return braces[0] + (base === "" ? "" : base + "\n ") + " " + output.join(",\n ") + " " + braces[1];
20302
+ return braces[0] + base + " " + output.join(", ") + " " + braces[1];
20303
+ }
20304
+ function isArray(ar) {
20305
+ return Array.isArray(ar);
20306
+ }
20307
+ function isBoolean(arg) {
20308
+ return typeof arg === "boolean";
20309
+ }
20310
+ function isNull(arg) {
20311
+ return arg === null;
20312
+ }
20313
+ function isNumber(arg) {
20314
+ return typeof arg === "number";
20315
+ }
20316
+ function isString(arg) {
20317
+ return typeof arg === "string";
20318
+ }
20319
+ function isUndefined(arg) {
20320
+ return arg === void 0;
20321
+ }
20322
+ function isRegExp(re) {
20323
+ return isObject(re) && objectToString(re) === "[object RegExp]";
20324
+ }
20325
+ function isObject(arg) {
20326
+ return typeof arg === "object" && arg !== null;
20327
+ }
20328
+ function isDate(d) {
20329
+ return isObject(d) && objectToString(d) === "[object Date]";
20330
+ }
20331
+ function isError(e) {
20332
+ return isObject(e) && (objectToString(e) === "[object Error]" || e instanceof Error);
20333
+ }
20334
+ function isFunction(arg) {
20335
+ return typeof arg === "function";
20336
+ }
20337
+ function objectToString(o) {
20338
+ return Object.prototype.toString.call(o);
20339
+ }
20340
+ function _extend(origin, add) {
20341
+ if (!add || !isObject(add)) return origin;
20342
+ var keys = Object.keys(add);
20343
+ var i = keys.length;
20344
+ while (i--) origin[keys[i]] = add[keys[i]];
20345
+ return origin;
20346
+ }
20347
+ function hasOwnProperty(obj, prop) {
20348
+ return Object.prototype.hasOwnProperty.call(obj, prop);
20349
+ }
20350
+ var kCustomPromisifiedSymbol = typeof Symbol !== "undefined" ? Symbol("util.promisify.custom") : void 0;
20351
+ function promisify(original) {
20352
+ if (typeof original !== "function") throw new TypeError("The \"original\" argument must be of type Function");
20353
+ if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {
20354
+ var fn = original[kCustomPromisifiedSymbol];
20355
+ if (typeof fn !== "function") throw new TypeError("The \"util.promisify.custom\" argument must be of type Function");
20356
+ Object.defineProperty(fn, kCustomPromisifiedSymbol, {
20357
+ value: fn,
20358
+ enumerable: false,
20359
+ writable: false,
20360
+ configurable: true
20361
+ });
20362
+ return fn;
20363
+ }
20364
+ function fn() {
20365
+ var promiseResolve, promiseReject;
20366
+ var promise = new Promise(function(resolve, reject) {
20367
+ promiseResolve = resolve;
20368
+ promiseReject = reject;
20369
+ });
20370
+ var args = [];
20371
+ for (var i = 0; i < arguments.length; i++) args.push(arguments[i]);
20372
+ args.push(function(err, value) {
20373
+ if (err) promiseReject(err);
20374
+ else promiseResolve(value);
20375
+ });
20376
+ try {
20377
+ original.apply(this, args);
20378
+ } catch (err) {
20379
+ promiseReject(err);
20380
+ }
20381
+ return promise;
20382
+ }
20383
+ Object.setPrototypeOf(fn, Object.getPrototypeOf(original));
20384
+ if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {
20385
+ value: fn,
20386
+ enumerable: false,
20387
+ writable: false,
20388
+ configurable: true
20389
+ });
20390
+ return Object.defineProperties(fn, getOwnPropertyDescriptors(original));
20391
+ }
20392
+ promisify.custom = kCustomPromisifiedSymbol;
20393
+ //#endregion
20394
+ //#region \0polyfill-node._buffer_list.js
20395
+ var _polyfill_node__buffer_list_default = BufferList;
20396
+ function BufferList() {
20397
+ this.head = null;
20398
+ this.tail = null;
20399
+ this.length = 0;
20400
+ }
20401
+ BufferList.prototype.push = function(v) {
20402
+ var entry = {
20403
+ data: v,
20404
+ next: null
20405
+ };
20406
+ if (this.length > 0) this.tail.next = entry;
20407
+ else this.head = entry;
20408
+ this.tail = entry;
20409
+ ++this.length;
20410
+ };
20411
+ BufferList.prototype.unshift = function(v) {
20412
+ var entry = {
20413
+ data: v,
20414
+ next: this.head
20415
+ };
20416
+ if (this.length === 0) this.tail = entry;
20417
+ this.head = entry;
20418
+ ++this.length;
20419
+ };
20420
+ BufferList.prototype.shift = function() {
20421
+ if (this.length === 0) return;
20422
+ var ret = this.head.data;
20423
+ if (this.length === 1) this.head = this.tail = null;
20424
+ else this.head = this.head.next;
20425
+ --this.length;
20426
+ return ret;
20427
+ };
20428
+ BufferList.prototype.clear = function() {
20429
+ this.head = this.tail = null;
20430
+ this.length = 0;
20431
+ };
20432
+ BufferList.prototype.join = function(s) {
20433
+ if (this.length === 0) return "";
20434
+ var p = this.head;
20435
+ var ret = "" + p.data;
20436
+ while (p = p.next) ret += s + p.data;
20437
+ return ret;
20438
+ };
20439
+ BufferList.prototype.concat = function(n) {
20440
+ if (this.length === 0) return Buffer$1.alloc(0);
20441
+ if (this.length === 1) return this.head.data;
20442
+ var ret = Buffer$1.allocUnsafe(n >>> 0);
20443
+ var p = this.head;
20444
+ var i = 0;
20445
+ while (p) {
20446
+ p.data.copy(ret, i);
20447
+ i += p.data.length;
20448
+ p = p.next;
20449
+ }
20450
+ return ret;
20451
+ };
20452
+ //#endregion
20453
+ //#region \0polyfill-node.string_decoder.js
20454
+ var isBufferEncoding = Buffer$1.isEncoding || function(encoding) {
20455
+ switch (encoding && encoding.toLowerCase()) {
20456
+ case "hex":
20457
+ case "utf8":
20458
+ case "utf-8":
20459
+ case "ascii":
20460
+ case "binary":
20461
+ case "base64":
20462
+ case "ucs2":
20463
+ case "ucs-2":
20464
+ case "utf16le":
20465
+ case "utf-16le":
20466
+ case "raw": return true;
20467
+ default: return false;
20468
+ }
20469
+ };
20470
+ function assertEncoding(encoding) {
20471
+ if (encoding && !isBufferEncoding(encoding)) throw new Error("Unknown encoding: " + encoding);
20472
+ }
20473
+ function StringDecoder(encoding) {
20474
+ this.encoding = (encoding || "utf8").toLowerCase().replace(/[-_]/, "");
20475
+ assertEncoding(encoding);
20476
+ switch (this.encoding) {
20477
+ case "utf8":
20478
+ this.surrogateSize = 3;
20479
+ break;
20480
+ case "ucs2":
20481
+ case "utf16le":
20482
+ this.surrogateSize = 2;
20483
+ this.detectIncompleteChar = utf16DetectIncompleteChar;
20484
+ break;
20485
+ case "base64":
20486
+ this.surrogateSize = 3;
20487
+ this.detectIncompleteChar = base64DetectIncompleteChar;
20488
+ break;
20489
+ default:
20490
+ this.write = passThroughWrite;
20491
+ return;
20492
+ }
20493
+ this.charBuffer = new Buffer$1(6);
20494
+ this.charReceived = 0;
20495
+ this.charLength = 0;
20496
+ }
20497
+ StringDecoder.prototype.write = function(buffer) {
20498
+ var charStr = "";
20499
+ while (this.charLength) {
20500
+ var available = buffer.length >= this.charLength - this.charReceived ? this.charLength - this.charReceived : buffer.length;
20501
+ buffer.copy(this.charBuffer, this.charReceived, 0, available);
20502
+ this.charReceived += available;
20503
+ if (this.charReceived < this.charLength) return "";
20504
+ buffer = buffer.slice(available, buffer.length);
20505
+ charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
20506
+ var charCode = charStr.charCodeAt(charStr.length - 1);
20507
+ if (charCode >= 55296 && charCode <= 56319) {
20508
+ this.charLength += this.surrogateSize;
20509
+ charStr = "";
20510
+ continue;
20511
+ }
20512
+ this.charReceived = this.charLength = 0;
20513
+ if (buffer.length === 0) return charStr;
20514
+ break;
20515
+ }
20516
+ this.detectIncompleteChar(buffer);
20517
+ var end = buffer.length;
20518
+ if (this.charLength) {
20519
+ buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
20520
+ end -= this.charReceived;
20521
+ }
20522
+ charStr += buffer.toString(this.encoding, 0, end);
20523
+ var end = charStr.length - 1;
20524
+ var charCode = charStr.charCodeAt(end);
20525
+ if (charCode >= 55296 && charCode <= 56319) {
20526
+ var size = this.surrogateSize;
20527
+ this.charLength += size;
20528
+ this.charReceived += size;
20529
+ this.charBuffer.copy(this.charBuffer, size, 0, size);
20530
+ buffer.copy(this.charBuffer, 0, 0, size);
20531
+ return charStr.substring(0, end);
20532
+ }
20533
+ return charStr;
20534
+ };
20535
+ StringDecoder.prototype.detectIncompleteChar = function(buffer) {
20536
+ var i = buffer.length >= 3 ? 3 : buffer.length;
20537
+ for (; i > 0; i--) {
20538
+ var c = buffer[buffer.length - i];
20539
+ if (i == 1 && c >> 5 == 6) {
20540
+ this.charLength = 2;
20541
+ break;
20542
+ }
20543
+ if (i <= 2 && c >> 4 == 14) {
20544
+ this.charLength = 3;
20545
+ break;
20546
+ }
20547
+ if (i <= 3 && c >> 3 == 30) {
20548
+ this.charLength = 4;
20549
+ break;
20550
+ }
20551
+ }
20552
+ this.charReceived = i;
20553
+ };
20554
+ StringDecoder.prototype.end = function(buffer) {
20555
+ var res = "";
20556
+ if (buffer && buffer.length) res = this.write(buffer);
20557
+ if (this.charReceived) {
20558
+ var cr = this.charReceived;
20559
+ var buf = this.charBuffer;
20560
+ var enc = this.encoding;
20561
+ res += buf.slice(0, cr).toString(enc);
20562
+ }
20563
+ return res;
20564
+ };
20565
+ function passThroughWrite(buffer) {
20566
+ return buffer.toString(this.encoding);
20567
+ }
20568
+ function utf16DetectIncompleteChar(buffer) {
20569
+ this.charReceived = buffer.length % 2;
20570
+ this.charLength = this.charReceived ? 2 : 0;
20571
+ }
20572
+ function base64DetectIncompleteChar(buffer) {
20573
+ this.charReceived = buffer.length % 3;
20574
+ this.charLength = this.charReceived ? 3 : 0;
20575
+ }
20576
+ //#endregion
20577
+ //#region \0polyfill-node._stream_readable.js
20578
+ Readable.ReadableState = ReadableState;
20579
+ var debug = debuglog("stream");
20580
+ _polyfill_node__inherits_default(Readable, EventEmitter);
20581
+ function prependListener(emitter, event, fn) {
20582
+ if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn);
20583
+ else if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);
20584
+ else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);
20585
+ else emitter._events[event] = [fn, emitter._events[event]];
20586
+ }
20587
+ function listenerCount(emitter, type) {
20588
+ return emitter.listeners(type).length;
20589
+ }
20590
+ function ReadableState(options, stream) {
20591
+ options = options || {};
20592
+ this.objectMode = !!options.objectMode;
20593
+ if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
20594
+ var hwm = options.highWaterMark;
20595
+ var defaultHwm = this.objectMode ? 16 : 16 * 1024;
20596
+ this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
20597
+ this.highWaterMark = ~~this.highWaterMark;
20598
+ this.buffer = new _polyfill_node__buffer_list_default();
20599
+ this.length = 0;
20600
+ this.pipes = null;
20601
+ this.pipesCount = 0;
20602
+ this.flowing = null;
20603
+ this.ended = false;
20604
+ this.endEmitted = false;
20605
+ this.reading = false;
20606
+ this.sync = true;
20607
+ this.needReadable = false;
20608
+ this.emittedReadable = false;
20609
+ this.readableListening = false;
20610
+ this.resumeScheduled = false;
20611
+ this.defaultEncoding = options.defaultEncoding || "utf8";
20612
+ this.ranOut = false;
20613
+ this.awaitDrain = 0;
20614
+ this.readingMore = false;
20615
+ this.decoder = null;
20616
+ this.encoding = null;
20617
+ if (options.encoding) {
20618
+ this.decoder = new StringDecoder(options.encoding);
20619
+ this.encoding = options.encoding;
20620
+ }
20621
+ }
20622
+ function Readable(options) {
20623
+ if (!(this instanceof Readable)) return new Readable(options);
20624
+ this._readableState = new ReadableState(options, this);
20625
+ this.readable = true;
20626
+ if (options && typeof options.read === "function") this._read = options.read;
20627
+ EventEmitter.call(this);
20628
+ }
20629
+ Readable.prototype.push = function(chunk, encoding) {
20630
+ var state = this._readableState;
20631
+ if (!state.objectMode && typeof chunk === "string") {
20632
+ encoding = encoding || state.defaultEncoding;
20633
+ if (encoding !== state.encoding) {
20634
+ chunk = Buffer$1.from(chunk, encoding);
20635
+ encoding = "";
20636
+ }
20637
+ }
20638
+ return readableAddChunk(this, state, chunk, encoding, false);
20639
+ };
20640
+ Readable.prototype.unshift = function(chunk) {
20641
+ var state = this._readableState;
20642
+ return readableAddChunk(this, state, chunk, "", true);
20643
+ };
20644
+ Readable.prototype.isPaused = function() {
20645
+ return this._readableState.flowing === false;
20646
+ };
20647
+ function readableAddChunk(stream, state, chunk, encoding, addToFront) {
20648
+ var er = chunkInvalid(state, chunk);
20649
+ if (er) stream.emit("error", er);
20650
+ else if (chunk === null) {
20651
+ state.reading = false;
20652
+ onEofChunk(stream, state);
20653
+ } else if (state.objectMode || chunk && chunk.length > 0) if (state.ended && !addToFront) {
20654
+ var e = /* @__PURE__ */ new Error("stream.push() after EOF");
20655
+ stream.emit("error", e);
20656
+ } else if (state.endEmitted && addToFront) {
20657
+ var _e = /* @__PURE__ */ new Error("stream.unshift() after end event");
20658
+ stream.emit("error", _e);
20659
+ } else {
20660
+ var skipAdd;
20661
+ if (state.decoder && !addToFront && !encoding) {
20662
+ chunk = state.decoder.write(chunk);
20663
+ skipAdd = !state.objectMode && chunk.length === 0;
20664
+ }
20665
+ if (!addToFront) state.reading = false;
20666
+ if (!skipAdd) if (state.flowing && state.length === 0 && !state.sync) {
20667
+ stream.emit("data", chunk);
20668
+ stream.read(0);
20669
+ } else {
20670
+ state.length += state.objectMode ? 1 : chunk.length;
20671
+ if (addToFront) state.buffer.unshift(chunk);
20672
+ else state.buffer.push(chunk);
20673
+ if (state.needReadable) emitReadable(stream);
20674
+ }
20675
+ maybeReadMore(stream, state);
20676
+ }
20677
+ else if (!addToFront) state.reading = false;
20678
+ return needMoreData(state);
20679
+ }
20680
+ function needMoreData(state) {
20681
+ return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
20682
+ }
20683
+ Readable.prototype.setEncoding = function(enc) {
20684
+ this._readableState.decoder = new StringDecoder(enc);
20685
+ this._readableState.encoding = enc;
20686
+ return this;
20687
+ };
20688
+ var MAX_HWM = 8388608;
20689
+ function computeNewHighWaterMark(n) {
20690
+ if (n >= MAX_HWM) n = MAX_HWM;
20691
+ else {
20692
+ n--;
20693
+ n |= n >>> 1;
20694
+ n |= n >>> 2;
20695
+ n |= n >>> 4;
20696
+ n |= n >>> 8;
20697
+ n |= n >>> 16;
20698
+ n++;
20699
+ }
20700
+ return n;
20701
+ }
20702
+ function howMuchToRead(n, state) {
20703
+ if (n <= 0 || state.length === 0 && state.ended) return 0;
20704
+ if (state.objectMode) return 1;
20705
+ if (n !== n) if (state.flowing && state.length) return state.buffer.head.data.length;
20706
+ else return state.length;
20707
+ if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
20708
+ if (n <= state.length) return n;
20709
+ if (!state.ended) {
20710
+ state.needReadable = true;
20711
+ return 0;
20712
+ }
20713
+ return state.length;
20714
+ }
20715
+ Readable.prototype.read = function(n) {
20716
+ debug("read", n);
20717
+ n = parseInt(n, 10);
20718
+ var state = this._readableState;
20719
+ var nOrig = n;
20720
+ if (n !== 0) state.emittedReadable = false;
20721
+ if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
20722
+ debug("read: emitReadable", state.length, state.ended);
20723
+ if (state.length === 0 && state.ended) endReadable(this);
20724
+ else emitReadable(this);
20725
+ return null;
20726
+ }
20727
+ n = howMuchToRead(n, state);
20728
+ if (n === 0 && state.ended) {
20729
+ if (state.length === 0) endReadable(this);
20730
+ return null;
20731
+ }
20732
+ var doRead = state.needReadable;
20733
+ debug("need readable", doRead);
20734
+ if (state.length === 0 || state.length - n < state.highWaterMark) {
20735
+ doRead = true;
20736
+ debug("length less than watermark", doRead);
20737
+ }
20738
+ if (state.ended || state.reading) {
20739
+ doRead = false;
20740
+ debug("reading or ended", doRead);
20741
+ } else if (doRead) {
20742
+ debug("do read");
20743
+ state.reading = true;
20744
+ state.sync = true;
20745
+ if (state.length === 0) state.needReadable = true;
20746
+ this._read(state.highWaterMark);
20747
+ state.sync = false;
20748
+ if (!state.reading) n = howMuchToRead(nOrig, state);
20749
+ }
20750
+ var ret;
20751
+ if (n > 0) ret = fromList(n, state);
20752
+ else ret = null;
20753
+ if (ret === null) {
20754
+ state.needReadable = true;
20755
+ n = 0;
20756
+ } else state.length -= n;
20757
+ if (state.length === 0) {
20758
+ if (!state.ended) state.needReadable = true;
20759
+ if (nOrig !== n && state.ended) endReadable(this);
20760
+ }
20761
+ if (ret !== null) this.emit("data", ret);
20762
+ return ret;
20763
+ };
20764
+ function chunkInvalid(state, chunk) {
20765
+ var er = null;
20766
+ if (!Buffer$1.isBuffer(chunk) && typeof chunk !== "string" && chunk !== null && chunk !== void 0 && !state.objectMode) er = /* @__PURE__ */ new TypeError("Invalid non-string/buffer chunk");
20767
+ return er;
20768
+ }
20769
+ function onEofChunk(stream, state) {
20770
+ if (state.ended) return;
20771
+ if (state.decoder) {
20772
+ var chunk = state.decoder.end();
20773
+ if (chunk && chunk.length) {
20774
+ state.buffer.push(chunk);
20775
+ state.length += state.objectMode ? 1 : chunk.length;
20776
+ }
20777
+ }
20778
+ state.ended = true;
20779
+ emitReadable(stream);
20780
+ }
20781
+ function emitReadable(stream) {
20782
+ var state = stream._readableState;
20783
+ state.needReadable = false;
20784
+ if (!state.emittedReadable) {
20785
+ debug("emitReadable", state.flowing);
20786
+ state.emittedReadable = true;
20787
+ if (state.sync) nextTick(emitReadable_, stream);
20788
+ else emitReadable_(stream);
20789
+ }
20790
+ }
20791
+ function emitReadable_(stream) {
20792
+ debug("emit readable");
20793
+ stream.emit("readable");
20794
+ flow(stream);
20795
+ }
20796
+ function maybeReadMore(stream, state) {
20797
+ if (!state.readingMore) {
20798
+ state.readingMore = true;
20799
+ nextTick(maybeReadMore_, stream, state);
20800
+ }
20801
+ }
20802
+ function maybeReadMore_(stream, state) {
20803
+ var len = state.length;
20804
+ while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
20805
+ debug("maybeReadMore read 0");
20806
+ stream.read(0);
20807
+ if (len === state.length) break;
20808
+ else len = state.length;
20809
+ }
20810
+ state.readingMore = false;
20811
+ }
20812
+ Readable.prototype._read = function(n) {
20813
+ this.emit("error", /* @__PURE__ */ new Error("not implemented"));
20814
+ };
20815
+ Readable.prototype.pipe = function(dest, pipeOpts) {
20816
+ var src = this;
20817
+ var state = this._readableState;
20818
+ switch (state.pipesCount) {
20819
+ case 0:
20820
+ state.pipes = dest;
20821
+ break;
20822
+ case 1:
20823
+ state.pipes = [state.pipes, dest];
20824
+ break;
20825
+ default:
20826
+ state.pipes.push(dest);
20827
+ break;
20828
+ }
20829
+ state.pipesCount += 1;
20830
+ debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
20831
+ var endFn = !pipeOpts || pipeOpts.end !== false ? onend : cleanup;
20832
+ if (state.endEmitted) nextTick(endFn);
20833
+ else src.once("end", endFn);
20834
+ dest.on("unpipe", onunpipe);
20835
+ function onunpipe(readable) {
20836
+ debug("onunpipe");
20837
+ if (readable === src) cleanup();
20838
+ }
20839
+ function onend() {
20840
+ debug("onend");
20841
+ dest.end();
20842
+ }
20843
+ var ondrain = pipeOnDrain(src);
20844
+ dest.on("drain", ondrain);
20845
+ var cleanedUp = false;
20846
+ function cleanup() {
20847
+ debug("cleanup");
20848
+ dest.removeListener("close", onclose);
20849
+ dest.removeListener("finish", onfinish);
20850
+ dest.removeListener("drain", ondrain);
20851
+ dest.removeListener("error", onerror);
20852
+ dest.removeListener("unpipe", onunpipe);
20853
+ src.removeListener("end", onend);
20854
+ src.removeListener("end", cleanup);
20855
+ src.removeListener("data", ondata);
20856
+ cleanedUp = true;
20857
+ if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
20858
+ }
20859
+ var increasedAwaitDrain = false;
20860
+ src.on("data", ondata);
20861
+ function ondata(chunk) {
20862
+ debug("ondata");
20863
+ increasedAwaitDrain = false;
20864
+ if (false === dest.write(chunk) && !increasedAwaitDrain) {
20865
+ if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
20866
+ debug("false write response, pause", src._readableState.awaitDrain);
20867
+ src._readableState.awaitDrain++;
20868
+ increasedAwaitDrain = true;
20869
+ }
20870
+ src.pause();
20871
+ }
20872
+ }
20873
+ function onerror(er) {
20874
+ debug("onerror", er);
20875
+ unpipe();
20876
+ dest.removeListener("error", onerror);
20877
+ if (listenerCount(dest, "error") === 0) dest.emit("error", er);
20878
+ }
20879
+ prependListener(dest, "error", onerror);
20880
+ function onclose() {
20881
+ dest.removeListener("finish", onfinish);
20882
+ unpipe();
20883
+ }
20884
+ dest.once("close", onclose);
20885
+ function onfinish() {
20886
+ debug("onfinish");
20887
+ dest.removeListener("close", onclose);
20888
+ unpipe();
20889
+ }
20890
+ dest.once("finish", onfinish);
20891
+ function unpipe() {
20892
+ debug("unpipe");
20893
+ src.unpipe(dest);
20894
+ }
20895
+ dest.emit("pipe", src);
20896
+ if (!state.flowing) {
20897
+ debug("pipe resume");
20898
+ src.resume();
20899
+ }
20900
+ return dest;
20901
+ };
20902
+ function pipeOnDrain(src) {
20903
+ return function() {
20904
+ var state = src._readableState;
20905
+ debug("pipeOnDrain", state.awaitDrain);
20906
+ if (state.awaitDrain) state.awaitDrain--;
20907
+ if (state.awaitDrain === 0 && src.listeners("data").length) {
20908
+ state.flowing = true;
20909
+ flow(src);
20910
+ }
20911
+ };
20912
+ }
20913
+ Readable.prototype.unpipe = function(dest) {
20914
+ var state = this._readableState;
20915
+ if (state.pipesCount === 0) return this;
20916
+ if (state.pipesCount === 1) {
20917
+ if (dest && dest !== state.pipes) return this;
20918
+ if (!dest) dest = state.pipes;
20919
+ state.pipes = null;
20920
+ state.pipesCount = 0;
20921
+ state.flowing = false;
20922
+ if (dest) dest.emit("unpipe", this);
20923
+ return this;
20924
+ }
20925
+ if (!dest) {
20926
+ var dests = state.pipes;
20927
+ var len = state.pipesCount;
20928
+ state.pipes = null;
20929
+ state.pipesCount = 0;
20930
+ state.flowing = false;
20931
+ for (var _i = 0; _i < len; _i++) dests[_i].emit("unpipe", this);
20932
+ return this;
20933
+ }
20934
+ var i = indexOf(state.pipes, dest);
20935
+ if (i === -1) return this;
20936
+ state.pipes.splice(i, 1);
20937
+ state.pipesCount -= 1;
20938
+ if (state.pipesCount === 1) state.pipes = state.pipes[0];
20939
+ dest.emit("unpipe", this);
20940
+ return this;
20941
+ };
20942
+ Readable.prototype.on = function(ev, fn) {
20943
+ var res = EventEmitter.prototype.on.call(this, ev, fn);
20944
+ if (ev === "data") {
20945
+ if (this._readableState.flowing !== false) this.resume();
20946
+ } else if (ev === "readable") {
20947
+ var state = this._readableState;
20948
+ if (!state.endEmitted && !state.readableListening) {
20949
+ state.readableListening = state.needReadable = true;
20950
+ state.emittedReadable = false;
20951
+ if (!state.reading) nextTick(nReadingNextTick, this);
20952
+ else if (state.length) emitReadable(this, state);
20953
+ }
20954
+ }
20955
+ return res;
20956
+ };
20957
+ Readable.prototype.addListener = Readable.prototype.on;
20958
+ function nReadingNextTick(self) {
20959
+ debug("readable nexttick read 0");
20960
+ self.read(0);
20961
+ }
20962
+ Readable.prototype.resume = function() {
20963
+ var state = this._readableState;
20964
+ if (!state.flowing) {
20965
+ debug("resume");
20966
+ state.flowing = true;
20967
+ resume(this, state);
20968
+ }
20969
+ return this;
20970
+ };
20971
+ function resume(stream, state) {
20972
+ if (!state.resumeScheduled) {
20973
+ state.resumeScheduled = true;
20974
+ nextTick(resume_, stream, state);
20975
+ }
20976
+ }
20977
+ function resume_(stream, state) {
20978
+ if (!state.reading) {
20979
+ debug("resume read 0");
20980
+ stream.read(0);
20981
+ }
20982
+ state.resumeScheduled = false;
20983
+ state.awaitDrain = 0;
20984
+ stream.emit("resume");
20985
+ flow(stream);
20986
+ if (state.flowing && !state.reading) stream.read(0);
20987
+ }
20988
+ Readable.prototype.pause = function() {
20989
+ debug("call pause flowing=%j", this._readableState.flowing);
20990
+ if (false !== this._readableState.flowing) {
20991
+ debug("pause");
20992
+ this._readableState.flowing = false;
20993
+ this.emit("pause");
20994
+ }
20995
+ return this;
20996
+ };
20997
+ function flow(stream) {
20998
+ var state = stream._readableState;
20999
+ debug("flow", state.flowing);
21000
+ while (state.flowing && stream.read() !== null);
21001
+ }
21002
+ Readable.prototype.wrap = function(stream) {
21003
+ var state = this._readableState;
21004
+ var paused = false;
21005
+ var self = this;
21006
+ stream.on("end", function() {
21007
+ debug("wrapped end");
21008
+ if (state.decoder && !state.ended) {
21009
+ var chunk = state.decoder.end();
21010
+ if (chunk && chunk.length) self.push(chunk);
21011
+ }
21012
+ self.push(null);
21013
+ });
21014
+ stream.on("data", function(chunk) {
21015
+ debug("wrapped data");
21016
+ if (state.decoder) chunk = state.decoder.write(chunk);
21017
+ if (state.objectMode && (chunk === null || chunk === void 0)) return;
21018
+ else if (!state.objectMode && (!chunk || !chunk.length)) return;
21019
+ if (!self.push(chunk)) {
21020
+ paused = true;
21021
+ stream.pause();
21022
+ }
21023
+ });
21024
+ for (var i in stream) if (this[i] === void 0 && typeof stream[i] === "function") this[i] = function(method) {
21025
+ return function() {
21026
+ return stream[method].apply(stream, arguments);
21027
+ };
21028
+ }(i);
21029
+ forEach([
21030
+ "error",
21031
+ "close",
21032
+ "destroy",
21033
+ "pause",
21034
+ "resume"
21035
+ ], function(ev) {
21036
+ stream.on(ev, self.emit.bind(self, ev));
21037
+ });
21038
+ self._read = function(n) {
21039
+ debug("wrapped _read", n);
21040
+ if (paused) {
21041
+ paused = false;
21042
+ stream.resume();
21043
+ }
21044
+ };
21045
+ return self;
21046
+ };
21047
+ Readable._fromList = fromList;
21048
+ function fromList(n, state) {
21049
+ if (state.length === 0) return null;
21050
+ var ret;
21051
+ if (state.objectMode) ret = state.buffer.shift();
21052
+ else if (!n || n >= state.length) {
21053
+ if (state.decoder) ret = state.buffer.join("");
21054
+ else if (state.buffer.length === 1) ret = state.buffer.head.data;
21055
+ else ret = state.buffer.concat(state.length);
21056
+ state.buffer.clear();
21057
+ } else ret = fromListPartial(n, state.buffer, state.decoder);
21058
+ return ret;
21059
+ }
21060
+ function fromListPartial(n, list, hasStrings) {
21061
+ var ret;
21062
+ if (n < list.head.data.length) {
21063
+ ret = list.head.data.slice(0, n);
21064
+ list.head.data = list.head.data.slice(n);
21065
+ } else if (n === list.head.data.length) ret = list.shift();
21066
+ else ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
21067
+ return ret;
21068
+ }
21069
+ function copyFromBufferString(n, list) {
21070
+ var p = list.head;
21071
+ var c = 1;
21072
+ var ret = p.data;
21073
+ n -= ret.length;
21074
+ while (p = p.next) {
21075
+ var str = p.data;
21076
+ var nb = n > str.length ? str.length : n;
21077
+ if (nb === str.length) ret += str;
21078
+ else ret += str.slice(0, n);
21079
+ n -= nb;
21080
+ if (n === 0) {
21081
+ if (nb === str.length) {
21082
+ ++c;
21083
+ if (p.next) list.head = p.next;
21084
+ else list.head = list.tail = null;
21085
+ } else {
21086
+ list.head = p;
21087
+ p.data = str.slice(nb);
21088
+ }
21089
+ break;
21090
+ }
21091
+ ++c;
21092
+ }
21093
+ list.length -= c;
21094
+ return ret;
21095
+ }
21096
+ function copyFromBuffer(n, list) {
21097
+ var ret = Buffer$1.allocUnsafe(n);
21098
+ var p = list.head;
21099
+ var c = 1;
21100
+ p.data.copy(ret);
21101
+ n -= p.data.length;
21102
+ while (p = p.next) {
21103
+ var buf = p.data;
21104
+ var nb = n > buf.length ? buf.length : n;
21105
+ buf.copy(ret, ret.length - n, 0, nb);
21106
+ n -= nb;
21107
+ if (n === 0) {
21108
+ if (nb === buf.length) {
21109
+ ++c;
21110
+ if (p.next) list.head = p.next;
21111
+ else list.head = list.tail = null;
21112
+ } else {
21113
+ list.head = p;
21114
+ p.data = buf.slice(nb);
21115
+ }
21116
+ break;
21117
+ }
21118
+ ++c;
21119
+ }
21120
+ list.length -= c;
21121
+ return ret;
21122
+ }
21123
+ function endReadable(stream) {
21124
+ var state = stream._readableState;
21125
+ if (state.length > 0) throw new Error("\"endReadable()\" called on non-empty stream");
21126
+ if (!state.endEmitted) {
21127
+ state.ended = true;
21128
+ nextTick(endReadableNT, state, stream);
21129
+ }
21130
+ }
21131
+ function endReadableNT(state, stream) {
21132
+ if (!state.endEmitted && state.length === 0) {
21133
+ state.endEmitted = true;
21134
+ stream.readable = false;
21135
+ stream.emit("end");
21136
+ }
21137
+ }
21138
+ function forEach(xs, f) {
21139
+ for (var i = 0, l = xs.length; i < l; i++) f(xs[i], i);
21140
+ }
21141
+ function indexOf(xs, x) {
21142
+ for (var i = 0, l = xs.length; i < l; i++) if (xs[i] === x) return i;
21143
+ return -1;
21144
+ }
21145
+ //#endregion
21146
+ //#region \0polyfill-node._stream_writable.js
21147
+ Writable.WritableState = WritableState;
21148
+ _polyfill_node__inherits_default(Writable, EventEmitter);
21149
+ function nop() {}
21150
+ function WriteReq(chunk, encoding, cb) {
21151
+ this.chunk = chunk;
21152
+ this.encoding = encoding;
21153
+ this.callback = cb;
21154
+ this.next = null;
21155
+ }
21156
+ function WritableState(options, stream) {
21157
+ Object.defineProperty(this, "buffer", { get: deprecate(function() {
21158
+ return this.getBuffer();
21159
+ }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.") });
21160
+ options = options || {};
21161
+ this.objectMode = !!options.objectMode;
21162
+ if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
21163
+ var hwm = options.highWaterMark;
21164
+ var defaultHwm = this.objectMode ? 16 : 16 * 1024;
21165
+ this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
21166
+ this.highWaterMark = ~~this.highWaterMark;
21167
+ this.needDrain = false;
21168
+ this.ending = false;
21169
+ this.ended = false;
21170
+ this.finished = false;
21171
+ this.decodeStrings = !(options.decodeStrings === false);
21172
+ this.defaultEncoding = options.defaultEncoding || "utf8";
21173
+ this.length = 0;
21174
+ this.writing = false;
21175
+ this.corked = 0;
21176
+ this.sync = true;
21177
+ this.bufferProcessing = false;
21178
+ this.onwrite = function(er) {
21179
+ onwrite(stream, er);
21180
+ };
21181
+ this.writecb = null;
21182
+ this.writelen = 0;
21183
+ this.bufferedRequest = null;
21184
+ this.lastBufferedRequest = null;
21185
+ this.pendingcb = 0;
21186
+ this.prefinished = false;
21187
+ this.errorEmitted = false;
21188
+ this.bufferedRequestCount = 0;
21189
+ this.corkedRequestsFree = new CorkedRequest(this);
21190
+ }
21191
+ WritableState.prototype.getBuffer = function writableStateGetBuffer() {
21192
+ var current = this.bufferedRequest;
21193
+ var out = [];
21194
+ while (current) {
21195
+ out.push(current);
21196
+ current = current.next;
21197
+ }
21198
+ return out;
21199
+ };
21200
+ function Writable(options) {
21201
+ if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options);
21202
+ this._writableState = new WritableState(options, this);
21203
+ this.writable = true;
21204
+ if (options) {
21205
+ if (typeof options.write === "function") this._write = options.write;
21206
+ if (typeof options.writev === "function") this._writev = options.writev;
21207
+ }
21208
+ EventEmitter.call(this);
21209
+ }
21210
+ Writable.prototype.pipe = function() {
21211
+ this.emit("error", /* @__PURE__ */ new Error("Cannot pipe, not readable"));
21212
+ };
21213
+ function writeAfterEnd(stream, cb) {
21214
+ var er = /* @__PURE__ */ new Error("write after end");
21215
+ stream.emit("error", er);
21216
+ nextTick(cb, er);
21217
+ }
21218
+ function validChunk(stream, state, chunk, cb) {
21219
+ var valid = true;
21220
+ var er = false;
21221
+ if (chunk === null) er = /* @__PURE__ */ new TypeError("May not write null values to stream");
21222
+ else if (!Buffer$1.isBuffer(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) er = /* @__PURE__ */ new TypeError("Invalid non-string/buffer chunk");
21223
+ if (er) {
21224
+ stream.emit("error", er);
21225
+ nextTick(cb, er);
21226
+ valid = false;
21227
+ }
21228
+ return valid;
21229
+ }
21230
+ Writable.prototype.write = function(chunk, encoding, cb) {
21231
+ var state = this._writableState;
21232
+ var ret = false;
21233
+ if (typeof encoding === "function") {
21234
+ cb = encoding;
21235
+ encoding = null;
21236
+ }
21237
+ if (Buffer$1.isBuffer(chunk)) encoding = "buffer";
21238
+ else if (!encoding) encoding = state.defaultEncoding;
21239
+ if (typeof cb !== "function") cb = nop;
21240
+ if (state.ended) writeAfterEnd(this, cb);
21241
+ else if (validChunk(this, state, chunk, cb)) {
21242
+ state.pendingcb++;
21243
+ ret = writeOrBuffer(this, state, chunk, encoding, cb);
21244
+ }
21245
+ return ret;
21246
+ };
21247
+ Writable.prototype.cork = function() {
21248
+ var state = this._writableState;
21249
+ state.corked++;
21250
+ };
21251
+ Writable.prototype.uncork = function() {
21252
+ var state = this._writableState;
21253
+ if (state.corked) {
21254
+ state.corked--;
21255
+ if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
21256
+ }
21257
+ };
21258
+ Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
21259
+ if (typeof encoding === "string") encoding = encoding.toLowerCase();
21260
+ if (!([
21261
+ "hex",
21262
+ "utf8",
21263
+ "utf-8",
21264
+ "ascii",
21265
+ "binary",
21266
+ "base64",
21267
+ "ucs2",
21268
+ "ucs-2",
21269
+ "utf16le",
21270
+ "utf-16le",
21271
+ "raw"
21272
+ ].indexOf((encoding + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + encoding);
21273
+ this._writableState.defaultEncoding = encoding;
21274
+ return this;
21275
+ };
21276
+ function decodeChunk(state, chunk, encoding) {
21277
+ if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") chunk = Buffer$1.from(chunk, encoding);
21278
+ return chunk;
21279
+ }
21280
+ function writeOrBuffer(stream, state, chunk, encoding, cb) {
21281
+ chunk = decodeChunk(state, chunk, encoding);
21282
+ if (Buffer$1.isBuffer(chunk)) encoding = "buffer";
21283
+ var len = state.objectMode ? 1 : chunk.length;
21284
+ state.length += len;
21285
+ var ret = state.length < state.highWaterMark;
21286
+ if (!ret) state.needDrain = true;
21287
+ if (state.writing || state.corked) {
21288
+ var last = state.lastBufferedRequest;
21289
+ state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);
21290
+ if (last) last.next = state.lastBufferedRequest;
21291
+ else state.bufferedRequest = state.lastBufferedRequest;
21292
+ state.bufferedRequestCount += 1;
21293
+ } else doWrite(stream, state, false, len, chunk, encoding, cb);
21294
+ return ret;
21295
+ }
21296
+ function doWrite(stream, state, writev, len, chunk, encoding, cb) {
21297
+ state.writelen = len;
21298
+ state.writecb = cb;
21299
+ state.writing = true;
21300
+ state.sync = true;
21301
+ if (writev) stream._writev(chunk, state.onwrite);
21302
+ else stream._write(chunk, encoding, state.onwrite);
21303
+ state.sync = false;
21304
+ }
21305
+ function onwriteError(stream, state, sync, er, cb) {
21306
+ --state.pendingcb;
21307
+ if (sync) nextTick(cb, er);
21308
+ else cb(er);
21309
+ stream._writableState.errorEmitted = true;
21310
+ stream.emit("error", er);
21311
+ }
21312
+ function onwriteStateUpdate(state) {
21313
+ state.writing = false;
21314
+ state.writecb = null;
21315
+ state.length -= state.writelen;
21316
+ state.writelen = 0;
21317
+ }
21318
+ function onwrite(stream, er) {
21319
+ var state = stream._writableState;
21320
+ var sync = state.sync;
21321
+ var cb = state.writecb;
21322
+ onwriteStateUpdate(state);
21323
+ if (er) onwriteError(stream, state, sync, er, cb);
21324
+ else {
21325
+ var finished = needFinish(state);
21326
+ if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(stream, state);
21327
+ if (sync) nextTick(afterWrite, stream, state, finished, cb);
21328
+ else afterWrite(stream, state, finished, cb);
21329
+ }
21330
+ }
21331
+ function afterWrite(stream, state, finished, cb) {
21332
+ if (!finished) onwriteDrain(stream, state);
21333
+ state.pendingcb--;
21334
+ cb();
21335
+ finishMaybe(stream, state);
21336
+ }
21337
+ function onwriteDrain(stream, state) {
21338
+ if (state.length === 0 && state.needDrain) {
21339
+ state.needDrain = false;
21340
+ stream.emit("drain");
21341
+ }
21342
+ }
21343
+ function clearBuffer(stream, state) {
21344
+ state.bufferProcessing = true;
21345
+ var entry = state.bufferedRequest;
21346
+ if (stream._writev && entry && entry.next) {
21347
+ var l = state.bufferedRequestCount;
21348
+ var buffer = new Array(l);
21349
+ var holder = state.corkedRequestsFree;
21350
+ holder.entry = entry;
21351
+ var count = 0;
21352
+ while (entry) {
21353
+ buffer[count] = entry;
21354
+ entry = entry.next;
21355
+ count += 1;
21356
+ }
21357
+ doWrite(stream, state, true, state.length, buffer, "", holder.finish);
21358
+ state.pendingcb++;
21359
+ state.lastBufferedRequest = null;
21360
+ if (holder.next) {
21361
+ state.corkedRequestsFree = holder.next;
21362
+ holder.next = null;
21363
+ } else state.corkedRequestsFree = new CorkedRequest(state);
21364
+ } else {
21365
+ while (entry) {
21366
+ var chunk = entry.chunk;
21367
+ var encoding = entry.encoding;
21368
+ var cb = entry.callback;
21369
+ doWrite(stream, state, false, state.objectMode ? 1 : chunk.length, chunk, encoding, cb);
21370
+ entry = entry.next;
21371
+ if (state.writing) break;
21372
+ }
21373
+ if (entry === null) state.lastBufferedRequest = null;
21374
+ }
21375
+ state.bufferedRequestCount = 0;
21376
+ state.bufferedRequest = entry;
21377
+ state.bufferProcessing = false;
21378
+ }
21379
+ Writable.prototype._write = function(chunk, encoding, cb) {
21380
+ cb(/* @__PURE__ */ new Error("not implemented"));
21381
+ };
21382
+ Writable.prototype._writev = null;
21383
+ Writable.prototype.end = function(chunk, encoding, cb) {
21384
+ var state = this._writableState;
21385
+ if (typeof chunk === "function") {
21386
+ cb = chunk;
21387
+ chunk = null;
21388
+ encoding = null;
21389
+ } else if (typeof encoding === "function") {
21390
+ cb = encoding;
21391
+ encoding = null;
21392
+ }
21393
+ if (chunk !== null && chunk !== void 0) this.write(chunk, encoding);
21394
+ if (state.corked) {
21395
+ state.corked = 1;
21396
+ this.uncork();
21397
+ }
21398
+ if (!state.ending && !state.finished) endWritable(this, state, cb);
21399
+ };
21400
+ function needFinish(state) {
21401
+ return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
21402
+ }
21403
+ function prefinish(stream, state) {
21404
+ if (!state.prefinished) {
21405
+ state.prefinished = true;
21406
+ stream.emit("prefinish");
21407
+ }
21408
+ }
21409
+ function finishMaybe(stream, state) {
21410
+ var need = needFinish(state);
21411
+ if (need) if (state.pendingcb === 0) {
21412
+ prefinish(stream, state);
21413
+ state.finished = true;
21414
+ stream.emit("finish");
21415
+ } else prefinish(stream, state);
21416
+ return need;
21417
+ }
21418
+ function endWritable(stream, state, cb) {
21419
+ state.ending = true;
21420
+ finishMaybe(stream, state);
21421
+ if (cb) if (state.finished) nextTick(cb);
21422
+ else stream.once("finish", cb);
21423
+ state.ended = true;
21424
+ stream.writable = false;
21425
+ }
21426
+ function CorkedRequest(state) {
21427
+ var _this = this;
21428
+ this.next = null;
21429
+ this.entry = null;
21430
+ this.finish = function(err) {
21431
+ var entry = _this.entry;
21432
+ _this.entry = null;
21433
+ while (entry) {
21434
+ var cb = entry.callback;
21435
+ state.pendingcb--;
21436
+ cb(err);
21437
+ entry = entry.next;
21438
+ }
21439
+ if (state.corkedRequestsFree) state.corkedRequestsFree.next = _this;
21440
+ else state.corkedRequestsFree = _this;
21441
+ };
21442
+ }
21443
+ //#endregion
21444
+ //#region \0polyfill-node._stream_duplex.js
21445
+ _polyfill_node__inherits_default(Duplex, Readable);
21446
+ var keys = Object.keys(Writable.prototype);
21447
+ for (var v = 0; v < keys.length; v++) {
21448
+ var method = keys[v];
21449
+ if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
21450
+ }
21451
+ function Duplex(options) {
21452
+ if (!(this instanceof Duplex)) return new Duplex(options);
21453
+ Readable.call(this, options);
21454
+ Writable.call(this, options);
21455
+ if (options && options.readable === false) this.readable = false;
21456
+ if (options && options.writable === false) this.writable = false;
21457
+ this.allowHalfOpen = true;
21458
+ if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
21459
+ this.once("end", onend);
21460
+ }
21461
+ function onend() {
21462
+ if (this.allowHalfOpen || this._writableState.ended) return;
21463
+ nextTick(onEndNT, this);
21464
+ }
21465
+ function onEndNT(self) {
21466
+ self.end();
21467
+ }
21468
+ //#endregion
21469
+ //#region src/util/output-type.ts
21470
+ /**
21471
+ * Output type definitions for document generation.
21472
+ *
21473
+ * This module defines the various output formats supported when generating
21474
+ * .docx files. These types correspond to fflate's output formats.
21475
+ *
21476
+ * @module
21477
+ */
21478
+ /**
21479
+ * Converts a Uint8Array to the specified output type.
21480
+ *
21481
+ * This is used by both the Packer and patchDocument to convert fflate's
21482
+ * raw Uint8Array output into the user's requested format.
21483
+ */
21484
+ const convertOutput = (data, type) => {
21485
+ switch (type) {
21486
+ case "nodebuffer": return Buffer$1.from(data);
21487
+ case "blob": return new Blob([data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength)], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" });
21488
+ case "arraybuffer": return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
21489
+ case "uint8array": return data;
21490
+ case "base64": return btoa((0, fflate.strFromU8)(data, true));
21491
+ case "string":
21492
+ case "text":
21493
+ case "binarystring": return (0, fflate.strFromU8)(data, true);
21494
+ case "array": return [...data];
21495
+ default: return data;
21496
+ }
21497
+ };
21498
+ //#endregion
21499
+ //#region src/file/fonts/obfuscate-ttf-to-odttf.ts
21500
+ /**
21501
+ * Font obfuscation module for embedding fonts in WordprocessingML documents.
21502
+ *
21503
+ * This module implements the OOXML font obfuscation algorithm used to embed
21504
+ * fonts in DOCX documents. Obfuscation is required by the OOXML specification
21505
+ * to prevent simple extraction of embedded font files.
21506
+ *
21507
+ * Reference: ECMA-376 Part 2, Section 11.1 (Font Embedding)
21508
+ *
21509
+ * @module
21510
+ */
21511
+ /** Start offset for obfuscation in the font file */
21512
+ const obfuscatedStartOffset = 0;
21513
+ /** End offset for obfuscation (first 32 bytes are obfuscated) */
21514
+ const obfuscatedEndOffset = 32;
21515
+ /** Expected GUID size (32 hex characters without dashes) */
21516
+ const guidSize = 32;
21517
+ /**
21518
+ * Obfuscates a TrueType font file for embedding in OOXML documents.
21519
+ *
21520
+ * The obfuscation algorithm XORs the first 32 bytes of the font file
21521
+ * with a reversed byte sequence derived from the font's GUID key.
21522
+ * This prevents simple extraction while maintaining font functionality.
21523
+ *
21524
+ * @param buf - The original font file as a byte array
21525
+ * @param fontKey - The GUID key for the font (with or without dashes)
21526
+ * @returns The obfuscated font data
21527
+ * @throws Error if the fontKey is not a valid 32-character GUID
21528
+ *
21529
+ * @example
21530
+ * ```typescript
21531
+ * const fontData = readFileSync("font.ttf");
21532
+ * const fontKey = "00000000-0000-0000-0000-000000000000";
21533
+ * const obfuscatedData = obfuscate(fontData, fontKey);
21534
+ * ```
21535
+ *
21536
+ * @internal
21537
+ */
21538
+ const obfuscate = (buf, fontKey) => {
21539
+ const guid = fontKey.replace(/-/g, "");
21540
+ if (guid.length !== guidSize) throw new Error(`Error: Cannot extract GUID from font filename: ${fontKey}`);
21541
+ const hexNumbers = guid.replace(/(..)/g, "$1 ").trim().split(" ").map((hexString) => parseInt(hexString, 16));
21542
+ hexNumbers.reverse();
21543
+ const obfuscatedBytes = buf.slice(obfuscatedStartOffset, obfuscatedEndOffset).map((byte, i) => byte ^ hexNumbers[i % hexNumbers.length]);
21544
+ const out = new Uint8Array(obfuscatedStartOffset + obfuscatedBytes.length + Math.max(0, buf.length - obfuscatedEndOffset));
21545
+ out.set(buf.slice(0, obfuscatedStartOffset));
21546
+ out.set(obfuscatedBytes, obfuscatedStartOffset);
21547
+ out.set(buf.slice(obfuscatedEndOffset), obfuscatedStartOffset + obfuscatedBytes.length);
21548
+ return out;
21549
+ };
21550
+ //#endregion
21551
+ //#region src/export/formatter.ts
21552
+ /**
21553
+ * Converts XML components into serializable objects ready for XML generation.
21554
+ *
21555
+ * The Formatter is responsible for preparing XML components for serialization by calling
21556
+ * their prepForXml method with the appropriate context. This is a critical step in the
21557
+ * export pipeline that transforms the declarative API objects into XML-compatible structures.
21558
+ *
21559
+ * @example
21560
+ * ```typescript
21561
+ * const formatter = new Formatter();
21562
+ * const paragraph = new Paragraph("Hello World");
21563
+ * const xmlObject = formatter.format(paragraph, context);
21564
+ * ```
21565
+ */
21566
+ var Formatter = class {
21567
+ /**
21568
+ * Formats an XML component into a serializable object.
21569
+ *
21570
+ * @param input - The XML component to format
21571
+ * @param context - The context containing file state and relationships
21572
+ * @returns A serializable XML object structure
21573
+ * @throws Error if the component cannot be formatted correctly
21574
+ */
21575
+ format(input, context = { stack: [] }) {
21576
+ const output = input.prepForXml(context);
21577
+ if (output) return output;
21578
+ else throw new Error("XMLComponent did not format correctly");
21579
+ }
21580
+ };
21581
+ //#endregion
21582
+ //#region src/export/packer/image-replacer.ts
21583
+ /**
21584
+ * Replaces image placeholders with relationship IDs in XML content.
21585
+ *
21586
+ * During document compilation, images are referenced using placeholder tokens
18403
21587
  * like {image1.png}. This class replaces those placeholders with the actual
18404
21588
  * relationship IDs used in the OOXML structure.
18405
21589
  *
@@ -18881,32 +22065,6 @@ var Compiler = class {
18881
22065
  }
18882
22066
  };
18883
22067
  //#endregion
18884
- //#region \0@oxc-project+runtime@0.123.0/helpers/asyncToGenerator.js
18885
- function asyncGeneratorStep(n, t, e, r, o, a, c) {
18886
- try {
18887
- var i = n[a](c), u = i.value;
18888
- } catch (n) {
18889
- e(n);
18890
- return;
18891
- }
18892
- i.done ? t(u) : Promise.resolve(u).then(r, o);
18893
- }
18894
- function _asyncToGenerator(n) {
18895
- return function() {
18896
- var t = this, e = arguments;
18897
- return new Promise(function(r, o) {
18898
- var a = n.apply(t, e);
18899
- function _next(n) {
18900
- asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
18901
- }
18902
- function _throw(n) {
18903
- asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
18904
- }
18905
- _next(void 0);
18906
- });
18907
- };
18908
- }
18909
- //#endregion
18910
22068
  //#region src/export/packer/packer.ts
18911
22069
  /**
18912
22070
  * Packer module for exporting documents to various output formats.
@@ -18959,11 +22117,8 @@ var Packer = class Packer {
18959
22117
  * @param overrides - Optional array of file overrides for custom XML content
18960
22118
  * @returns A promise resolving to the exported document in the specified format
18961
22119
  */
18962
- static pack(_x, _x2, _x3) {
18963
- var _this = this;
18964
- return _asyncToGenerator(function* (file, type, prettify, overrides = []) {
18965
- return convertOutput((0, fflate.zipSync)(_this.compiler.compile(file, convertPrettifyType(prettify), overrides), { level: 6 }), type);
18966
- }).apply(this, arguments);
22120
+ static async pack(file, type, prettify, overrides = []) {
22121
+ return convertOutput((0, fflate.zipSync)(this.compiler.compile(file, convertPrettifyType(prettify), overrides), { level: 6 }), type);
18967
22122
  }
18968
22123
  /**
18969
22124
  * Exports a document to a string representation.
@@ -19039,16 +22194,20 @@ var Packer = class Packer {
19039
22194
  * ```
19040
22195
  */
19041
22196
  static toStream(file, prettify, overrides = []) {
19042
- const stream$1 = new stream.Readable({ read() {} });
22197
+ /* v8 ignore start */
22198
+ const stream = new Readable({ read() {} });
22199
+ /* v8 ignore stop */
19043
22200
  try {
19044
22201
  const files = this.compiler.compile(file, convertPrettifyType(prettify), overrides);
19045
22202
  const zip = new fflate.Zip((err, chunk, final) => {
22203
+ /* v8 ignore start */
19046
22204
  if (err) {
19047
- stream$1.destroy(err);
22205
+ stream.destroy(err);
19048
22206
  return;
19049
22207
  }
19050
- if (!stream$1.destroyed) stream$1.push(chunk);
19051
- if (final) stream$1.push(null);
22208
+ /* v8 ignore stop */
22209
+ if (!stream.destroyed) stream.push(chunk);
22210
+ if (final) stream.push(null);
19052
22211
  });
19053
22212
  for (const [name, data] of Object.entries(files)) {
19054
22213
  var _level;
@@ -19060,9 +22219,9 @@ var Packer = class Packer {
19060
22219
  }
19061
22220
  zip.end();
19062
22221
  } catch (err) {
19063
- stream$1.destroy(err instanceof Error ? err : new Error(String(err)));
22222
+ stream.destroy(err instanceof Error ? err : new Error(String(err)));
19064
22223
  }
19065
- return stream$1;
22224
+ return stream;
19066
22225
  }
19067
22226
  };
19068
22227
  _defineProperty(Packer, "compiler", new Compiler());
@@ -19131,7 +22290,10 @@ const createTextElementContents = (text) => {
19131
22290
  * // Adds xml:space="preserve" to maintain whitespace
19132
22291
  * ```
19133
22292
  */
19134
- const patchSpaceAttribute = (element) => _objectSpread2(_objectSpread2({}, element), {}, { attributes: { "xml:space": "preserve" } });
22293
+ const patchSpaceAttribute = (element) => ({
22294
+ ...element,
22295
+ attributes: { "xml:space": "preserve" }
22296
+ });
19135
22297
  /**
19136
22298
  * Retrieves first-level child elements by parent element name.
19137
22299
  *
@@ -19323,14 +22485,24 @@ const splitRunElement = (runElement, token) => {
19323
22485
  if (e.type === "element" && e.name === "w:t") {
19324
22486
  var _ref, _e$elements;
19325
22487
  const splitText = ((_ref = (_e$elements = e.elements) === null || _e$elements === void 0 || (_e$elements = _e$elements[0]) === null || _e$elements === void 0 ? void 0 : _e$elements.text) !== null && _ref !== void 0 ? _ref : "").split(token);
19326
- const newElements = splitText.map((t) => _objectSpread2(_objectSpread2(_objectSpread2({}, e), patchSpaceAttribute(e)), {}, { elements: createTextElementContents(t) }));
22488
+ const newElements = splitText.map((t) => ({
22489
+ ...e,
22490
+ ...patchSpaceAttribute(e),
22491
+ elements: createTextElementContents(t)
22492
+ }));
19327
22493
  if (splitText.length > 1) splitIndex = i;
19328
22494
  return newElements;
19329
22495
  } else return e;
19330
22496
  }).flat()) !== null && _runElement$elements$ !== void 0 ? _runElement$elements$ : [];
19331
22497
  return {
19332
- left: _objectSpread2(_objectSpread2({}, JSON.parse(JSON.stringify(runElement))), {}, { elements: splitElements.slice(0, splitIndex + 1) }),
19333
- right: _objectSpread2(_objectSpread2({}, JSON.parse(JSON.stringify(runElement))), {}, { elements: splitElements.slice(splitIndex + 1) })
22498
+ left: {
22499
+ ...JSON.parse(JSON.stringify(runElement)),
22500
+ elements: splitElements.slice(0, splitIndex + 1)
22501
+ },
22502
+ right: {
22503
+ ...JSON.parse(JSON.stringify(runElement)),
22504
+ elements: splitElements.slice(splitIndex + 1)
22505
+ }
19334
22506
  };
19335
22507
  };
19336
22508
  //#endregion
@@ -19590,9 +22762,15 @@ const replacer = ({ json, patch, patchText, context, keepOriginalStyles = true }
19590
22762
  const runElementNonTextualElements = runElementToBeReplaced.elements.filter((e) => e.type === "element" && e.name === "w:rPr");
19591
22763
  newRunElements = textJson.map((e) => {
19592
22764
  var _e$elements;
19593
- return _objectSpread2(_objectSpread2({}, e), {}, { elements: [...runElementNonTextualElements, ...(_e$elements = e.elements) !== null && _e$elements !== void 0 ? _e$elements : []] });
22765
+ return {
22766
+ ...e,
22767
+ elements: [...runElementNonTextualElements, ...(_e$elements = e.elements) !== null && _e$elements !== void 0 ? _e$elements : []]
22768
+ };
19594
22769
  });
19595
- patchedRightElement = _objectSpread2(_objectSpread2({}, right), {}, { elements: [...runElementNonTextualElements, ...right.elements] });
22770
+ patchedRightElement = {
22771
+ ...right,
22772
+ elements: [...runElementNonTextualElements, ...right.elements]
22773
+ };
19596
22774
  }
19597
22775
  paragraphElement.elements.splice(index, 1, left, ...newRunElements, patchedRightElement);
19598
22776
  break;
@@ -19678,69 +22856,70 @@ const compareByteArrays = (a, b) => {
19678
22856
  *
19679
22857
  * @publicApi
19680
22858
  */
19681
- const patchDocument = function() {
19682
- var _ref = _asyncToGenerator(function* ({ outputType, data, patches, keepOriginalStyles, placeholderDelimiters = {
19683
- end: "}}",
19684
- start: "{{"
19685
- }, recursive = true }) {
19686
- const zipContent = (0, fflate.unzipSync)((0, undio.toUint8Array)(data));
19687
- const contexts = /* @__PURE__ */ new Map();
19688
- const file = { Media: new Media() };
19689
- const map = /* @__PURE__ */ new Map();
19690
- const imageRelationshipAdditions = [];
19691
- const hyperlinkRelationshipAdditions = [];
19692
- let hasMedia = false;
19693
- const binaryContentMap = /* @__PURE__ */ new Map();
19694
- for (const [key, value] of Object.entries(zipContent)) {
19695
- const startBytes = value.slice(0, 2);
19696
- if (compareByteArrays(startBytes, UTF16LE) || compareByteArrays(startBytes, UTF16BE)) {
19697
- binaryContentMap.set(key, value);
19698
- continue;
19699
- }
19700
- if (!key.endsWith(".xml") && !key.endsWith(".rels")) {
19701
- binaryContentMap.set(key, value);
19702
- continue;
19703
- }
19704
- const json = toJson((0, fflate.strFromU8)(value));
19705
- if (key === "word/document.xml") {
19706
- var _json$elements;
19707
- const document = (_json$elements = json.elements) === null || _json$elements === void 0 ? void 0 : _json$elements.find((i) => i.name === "w:document");
19708
- if (document && document.attributes) {
19709
- for (const ns of [
19710
- "mc",
19711
- "wp",
19712
- "r",
19713
- "w15",
19714
- "m"
19715
- ]) document.attributes[`xmlns:${ns}`] = DocumentAttributeNamespaces[ns];
19716
- document.attributes["mc:Ignorable"] = `${document.attributes["mc:Ignorable"] || ""} w15`.trim();
19717
- }
22859
+ const patchDocument = async ({ outputType, data, patches, keepOriginalStyles, placeholderDelimiters = {
22860
+ end: "}}",
22861
+ start: "{{"
22862
+ }, recursive = true }) => {
22863
+ const zipContent = (0, fflate.unzipSync)((0, undio.toUint8Array)(data));
22864
+ const contexts = /* @__PURE__ */ new Map();
22865
+ const file = { Media: new Media() };
22866
+ const map = /* @__PURE__ */ new Map();
22867
+ const imageRelationshipAdditions = [];
22868
+ const hyperlinkRelationshipAdditions = [];
22869
+ let hasMedia = false;
22870
+ const binaryContentMap = /* @__PURE__ */ new Map();
22871
+ for (const [key, value] of Object.entries(zipContent)) {
22872
+ const startBytes = value.slice(0, 2);
22873
+ if (compareByteArrays(startBytes, UTF16LE) || compareByteArrays(startBytes, UTF16BE)) {
22874
+ binaryContentMap.set(key, value);
22875
+ continue;
22876
+ }
22877
+ if (!key.endsWith(".xml") && !key.endsWith(".rels")) {
22878
+ binaryContentMap.set(key, value);
22879
+ continue;
22880
+ }
22881
+ const json = toJson((0, fflate.strFromU8)(value));
22882
+ if (key === "word/document.xml") {
22883
+ var _json$elements;
22884
+ const document = (_json$elements = json.elements) === null || _json$elements === void 0 ? void 0 : _json$elements.find((i) => i.name === "w:document");
22885
+ if (document && document.attributes) {
22886
+ for (const ns of [
22887
+ "mc",
22888
+ "wp",
22889
+ "r",
22890
+ "w15",
22891
+ "m"
22892
+ ]) document.attributes[`xmlns:${ns}`] = DocumentAttributeNamespaces[ns];
22893
+ document.attributes["mc:Ignorable"] = `${document.attributes["mc:Ignorable"] || ""} w15`.trim();
19718
22894
  }
19719
- if (key.startsWith("word/") && !key.endsWith(".xml.rels")) {
19720
- const context = {
19721
- file,
19722
- stack: [],
19723
- viewWrapper: { Relationships: { addRelationship: (linkId, _, target, __) => {
19724
- hyperlinkRelationshipAdditions.push({
19725
- hyperlink: {
19726
- id: linkId,
19727
- link: target
19728
- },
19729
- key
19730
- });
19731
- } } }
19732
- };
19733
- contexts.set(key, context);
19734
- if (!(placeholderDelimiters === null || placeholderDelimiters === void 0 ? void 0 : placeholderDelimiters.start.trim()) || !(placeholderDelimiters === null || placeholderDelimiters === void 0 ? void 0 : placeholderDelimiters.end.trim())) throw new Error("Both start and end delimiters must be non-empty strings.");
19735
- const { start, end } = placeholderDelimiters;
19736
- for (const [patchKey, patchValue] of Object.entries(patches)) {
19737
- const patchText = `${start}${patchKey}${end}`;
19738
- while (true) {
19739
- const { didFindOccurrence } = replacer({
19740
- context,
19741
- json,
19742
- keepOriginalStyles,
19743
- patch: _objectSpread2(_objectSpread2({}, patchValue), {}, { children: patchValue.children.map((element) => {
22895
+ }
22896
+ if (key.startsWith("word/") && !key.endsWith(".xml.rels")) {
22897
+ const context = {
22898
+ file,
22899
+ stack: [],
22900
+ viewWrapper: { Relationships: { addRelationship: (linkId, _, target, __) => {
22901
+ hyperlinkRelationshipAdditions.push({
22902
+ hyperlink: {
22903
+ id: linkId,
22904
+ link: target
22905
+ },
22906
+ key
22907
+ });
22908
+ } } }
22909
+ };
22910
+ contexts.set(key, context);
22911
+ if (!(placeholderDelimiters === null || placeholderDelimiters === void 0 ? void 0 : placeholderDelimiters.start.trim()) || !(placeholderDelimiters === null || placeholderDelimiters === void 0 ? void 0 : placeholderDelimiters.end.trim())) throw new Error("Both start and end delimiters must be non-empty strings.");
22912
+ const { start, end } = placeholderDelimiters;
22913
+ for (const [patchKey, patchValue] of Object.entries(patches)) {
22914
+ const patchText = `${start}${patchKey}${end}`;
22915
+ while (true) {
22916
+ const { didFindOccurrence } = replacer({
22917
+ context,
22918
+ json,
22919
+ keepOriginalStyles,
22920
+ patch: {
22921
+ ...patchValue,
22922
+ children: patchValue.children.map((element) => {
19744
22923
  if (element instanceof ExternalHyperlink) {
19745
22924
  const concreteHyperlink = new ConcreteHyperlink(element.options.children, uniqueId());
19746
22925
  hyperlinkRelationshipAdditions.push({
@@ -19752,63 +22931,60 @@ const patchDocument = function() {
19752
22931
  });
19753
22932
  return concreteHyperlink;
19754
22933
  } else return element;
19755
- }) }),
19756
- patchText
19757
- });
19758
- if (!recursive || !didFindOccurrence) break;
19759
- }
19760
- }
19761
- const mediaDatas = imageReplacer.getMediaData(JSON.stringify(json), context.file.Media);
19762
- if (mediaDatas.length > 0) {
19763
- hasMedia = true;
19764
- imageRelationshipAdditions.push({
19765
- key,
19766
- mediaDatas
22934
+ })
22935
+ },
22936
+ patchText
19767
22937
  });
22938
+ if (!recursive || !didFindOccurrence) break;
19768
22939
  }
19769
22940
  }
19770
- map.set(key, json);
19771
- }
19772
- for (const { key, mediaDatas } of imageRelationshipAdditions) {
19773
- var _map$get;
19774
- const relationshipKey = `word/_rels/${key.split("/").pop()}.rels`;
19775
- const relationshipsJson = (_map$get = map.get(relationshipKey)) !== null && _map$get !== void 0 ? _map$get : createRelationshipFile();
19776
- map.set(relationshipKey, relationshipsJson);
19777
- const index = getNextRelationshipIndex(relationshipsJson);
19778
- const newJson = imageReplacer.replace(JSON.stringify(map.get(key)), mediaDatas, index);
19779
- map.set(key, JSON.parse(newJson));
19780
- for (let i = 0; i < mediaDatas.length; i++) {
19781
- const { fileName } = mediaDatas[i];
19782
- appendRelationship(relationshipsJson, index + i, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", `media/${fileName}`);
22941
+ const mediaDatas = imageReplacer.getMediaData(JSON.stringify(json), context.file.Media);
22942
+ if (mediaDatas.length > 0) {
22943
+ hasMedia = true;
22944
+ imageRelationshipAdditions.push({
22945
+ key,
22946
+ mediaDatas
22947
+ });
19783
22948
  }
19784
22949
  }
19785
- for (const { key, hyperlink } of hyperlinkRelationshipAdditions) {
19786
- var _map$get2;
19787
- const relationshipKey = `word/_rels/${key.split("/").pop()}.rels`;
19788
- const relationshipsJson = (_map$get2 = map.get(relationshipKey)) !== null && _map$get2 !== void 0 ? _map$get2 : createRelationshipFile();
19789
- map.set(relationshipKey, relationshipsJson);
19790
- appendRelationship(relationshipsJson, hyperlink.id, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", hyperlink.link, TargetModeType.EXTERNAL);
22950
+ map.set(key, json);
22951
+ }
22952
+ for (const { key, mediaDatas } of imageRelationshipAdditions) {
22953
+ var _map$get;
22954
+ const relationshipKey = `word/_rels/${key.split("/").pop()}.rels`;
22955
+ const relationshipsJson = (_map$get = map.get(relationshipKey)) !== null && _map$get !== void 0 ? _map$get : createRelationshipFile();
22956
+ map.set(relationshipKey, relationshipsJson);
22957
+ const index = getNextRelationshipIndex(relationshipsJson);
22958
+ const newJson = imageReplacer.replace(JSON.stringify(map.get(key)), mediaDatas, index);
22959
+ map.set(key, JSON.parse(newJson));
22960
+ for (let i = 0; i < mediaDatas.length; i++) {
22961
+ const { fileName } = mediaDatas[i];
22962
+ appendRelationship(relationshipsJson, index + i, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", `media/${fileName}`);
19791
22963
  }
19792
- if (hasMedia) {
19793
- const contentTypesJson = map.get("[Content_Types].xml");
19794
- if (!contentTypesJson) throw new Error("Could not find content types file");
19795
- appendContentType(contentTypesJson, "image/png", "png");
19796
- appendContentType(contentTypesJson, "image/jpeg", "jpeg");
19797
- appendContentType(contentTypesJson, "image/jpeg", "jpg");
19798
- appendContentType(contentTypesJson, "image/bmp", "bmp");
19799
- appendContentType(contentTypesJson, "image/gif", "gif");
19800
- appendContentType(contentTypesJson, "image/svg+xml", "svg");
19801
- }
19802
- const files = {};
19803
- for (const [key, value] of map) files[key] = (0, undio.textToUint8Array)(toXml(value));
19804
- for (const [key, value] of binaryContentMap) files[key] = value;
19805
- for (const { data: mediaData, fileName } of file.Media.Array) files[`word/media/${fileName}`] = mediaData instanceof Uint8Array ? mediaData : new Uint8Array(mediaData);
19806
- return convertOutput((0, fflate.zipSync)(files, { level: 6 }), outputType);
19807
- });
19808
- return function patchDocument(_x) {
19809
- return _ref.apply(this, arguments);
19810
- };
19811
- }();
22964
+ }
22965
+ for (const { key, hyperlink } of hyperlinkRelationshipAdditions) {
22966
+ var _map$get2;
22967
+ const relationshipKey = `word/_rels/${key.split("/").pop()}.rels`;
22968
+ const relationshipsJson = (_map$get2 = map.get(relationshipKey)) !== null && _map$get2 !== void 0 ? _map$get2 : createRelationshipFile();
22969
+ map.set(relationshipKey, relationshipsJson);
22970
+ appendRelationship(relationshipsJson, hyperlink.id, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", hyperlink.link, TargetModeType.EXTERNAL);
22971
+ }
22972
+ if (hasMedia) {
22973
+ const contentTypesJson = map.get("[Content_Types].xml");
22974
+ if (!contentTypesJson) throw new Error("Could not find content types file");
22975
+ appendContentType(contentTypesJson, "image/png", "png");
22976
+ appendContentType(contentTypesJson, "image/jpeg", "jpeg");
22977
+ appendContentType(contentTypesJson, "image/jpeg", "jpg");
22978
+ appendContentType(contentTypesJson, "image/bmp", "bmp");
22979
+ appendContentType(contentTypesJson, "image/gif", "gif");
22980
+ appendContentType(contentTypesJson, "image/svg+xml", "svg");
22981
+ }
22982
+ const files = {};
22983
+ for (const [key, value] of map) files[key] = (0, undio.textToUint8Array)(toXml(value));
22984
+ for (const [key, value] of binaryContentMap) files[key] = value;
22985
+ for (const { data: mediaData, fileName } of file.Media.Array) files[`word/media/${fileName}`] = mediaData instanceof Uint8Array ? mediaData : new Uint8Array(mediaData);
22986
+ return convertOutput((0, fflate.zipSync)(files, { level: 6 }), outputType);
22987
+ };
19812
22988
  const toXml = (jsonObj) => {
19813
22989
  return (0, xml_js.js2xml)(jsonObj, { attributeValueFn: (str) => String(str).replace(/&(?!amp;|lt;|gt;|quot;|apos;)/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;") });
19814
22990
  };
@@ -19857,20 +23033,15 @@ const createRelationshipFile = () => ({
19857
23033
  * });
19858
23034
  * ```
19859
23035
  */
19860
- const patchDetector = function() {
19861
- var _ref = _asyncToGenerator(function* ({ data }) {
19862
- const zipContent = (0, fflate.unzipSync)((0, undio.toUint8Array)(data));
19863
- const patches = /* @__PURE__ */ new Set();
19864
- for (const [key, value] of Object.entries(zipContent)) {
19865
- if (!key.endsWith(".xml") && !key.endsWith(".rels")) continue;
19866
- if (key.startsWith("word/") && !key.endsWith(".xml.rels")) traverse(toJson((0, fflate.strFromU8)(value))).forEach((p) => findPatchKeys(p.text).forEach((patch) => patches.add(patch)));
19867
- }
19868
- return [...patches];
19869
- });
19870
- return function patchDetector(_x) {
19871
- return _ref.apply(this, arguments);
19872
- };
19873
- }();
23036
+ const patchDetector = async ({ data }) => {
23037
+ const zipContent = (0, fflate.unzipSync)((0, undio.toUint8Array)(data));
23038
+ const patches = /* @__PURE__ */ new Set();
23039
+ for (const [key, value] of Object.entries(zipContent)) {
23040
+ if (!key.endsWith(".xml") && !key.endsWith(".rels")) continue;
23041
+ if (key.startsWith("word/") && !key.endsWith(".xml.rels")) traverse(toJson((0, fflate.strFromU8)(value))).forEach((p) => findPatchKeys(p.text).forEach((patch) => patches.add(patch)));
23042
+ }
23043
+ return [...patches];
23044
+ };
19874
23045
  /**
19875
23046
  * Extracts placeholder keys from text using regex pattern.
19876
23047
  *
@@ -19879,8 +23050,7 @@ const patchDetector = function() {
19879
23050
  */
19880
23051
  const findPatchKeys = (text) => {
19881
23052
  var _text$match;
19882
- const pattern = /* @__PURE__ */ new RegExp("(?<=\\{\\{).+?(?=\\}\\})", "gs");
19883
- return (_text$match = text.match(pattern)) !== null && _text$match !== void 0 ? _text$match : [];
23053
+ return (_text$match = text.match(/(?<=\{\{).+?(?=\}\})/gs)) !== null && _text$match !== void 0 ? _text$match : [];
19884
23054
  };
19885
23055
  //#endregion
19886
23056
  exports.AbstractNumbering = AbstractNumbering;
@@ -20179,7 +23349,6 @@ exports.sectionPageSizeDefaults = sectionPageSizeDefaults;
20179
23349
  exports.shortHexNumber = shortHexNumber;
20180
23350
  exports.signedHpsMeasureValue = signedHpsMeasureValue;
20181
23351
  exports.signedTwipsMeasureValue = signedTwipsMeasureValue;
20182
- exports.standardizeData = standardizeData;
20183
23352
  exports.twipsMeasureValue = twipsMeasureValue;
20184
23353
  exports.uCharHexNumber = uCharHexNumber;
20185
23354
  exports.uniqueId = uniqueId;