docx 9.5.1 → 9.5.3
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 +1229 -503
- package/dist/index.d.cts +36 -16
- package/dist/index.d.ts +36 -16
- package/dist/index.iife.js +1231 -505
- package/dist/index.mjs +1229 -503
- package/dist/index.umd.cjs +1231 -505
- package/package.json +12 -12
package/dist/index.mjs
CHANGED
|
@@ -51,24 +51,59 @@ var __async = (__this, __arguments, generator) => {
|
|
|
51
51
|
});
|
|
52
52
|
};
|
|
53
53
|
class BaseXmlComponent {
|
|
54
|
+
/**
|
|
55
|
+
* Creates a new BaseXmlComponent with the specified XML element name.
|
|
56
|
+
*
|
|
57
|
+
* @param rootKey - The XML element name (e.g., "w:p", "w:r", "w:t")
|
|
58
|
+
*/
|
|
54
59
|
constructor(rootKey) {
|
|
60
|
+
/** The XML element name for this component (e.g., "w:p" for paragraph). */
|
|
55
61
|
__publicField(this, "rootKey");
|
|
56
62
|
this.rootKey = rootKey;
|
|
57
63
|
}
|
|
58
64
|
}
|
|
59
65
|
const EMPTY_OBJECT = Object.seal({});
|
|
60
66
|
class XmlComponent extends BaseXmlComponent {
|
|
67
|
+
/**
|
|
68
|
+
* Creates a new XmlComponent.
|
|
69
|
+
*
|
|
70
|
+
* @param rootKey - The XML element name (e.g., "w:p", "w:r", "w:t")
|
|
71
|
+
*/
|
|
61
72
|
constructor(rootKey) {
|
|
62
73
|
super(rootKey);
|
|
74
|
+
/**
|
|
75
|
+
* Array of child components, text nodes, and attributes.
|
|
76
|
+
*
|
|
77
|
+
* This array forms the content of the XML element. It can contain other
|
|
78
|
+
* XmlComponents, string values (text nodes), or attribute components.
|
|
79
|
+
*/
|
|
63
80
|
// eslint-disable-next-line functional/prefer-readonly-type, @typescript-eslint/no-explicit-any
|
|
64
81
|
__publicField(this, "root");
|
|
65
82
|
this.root = new Array();
|
|
66
83
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
84
|
+
/**
|
|
85
|
+
* Prepares this component and its children for XML serialization.
|
|
86
|
+
*
|
|
87
|
+
* This method is called by the Formatter to convert the component tree into
|
|
88
|
+
* an object structure compatible with the xml library (https://www.npmjs.com/package/xml).
|
|
89
|
+
* It recursively processes all children and handles special cases like
|
|
90
|
+
* attribute-only elements and empty elements.
|
|
91
|
+
*
|
|
92
|
+
* The method can be overridden by subclasses to customize XML representation
|
|
93
|
+
* or execute side effects during serialization (e.g., creating relationships).
|
|
94
|
+
*
|
|
95
|
+
* @param context - The serialization context containing document state
|
|
96
|
+
* @returns The XML-serializable object, or undefined to exclude from output
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* // Override to add custom serialization logic
|
|
101
|
+
* prepForXml(context: IContext): IXmlableObject | undefined {
|
|
102
|
+
* // Custom logic here
|
|
103
|
+
* return super.prepForXml(context);
|
|
104
|
+
* }
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
72
107
|
prepForXml(context) {
|
|
73
108
|
var _a;
|
|
74
109
|
context.stack.push(this);
|
|
@@ -84,7 +119,11 @@ class XmlComponent extends BaseXmlComponent {
|
|
|
84
119
|
};
|
|
85
120
|
}
|
|
86
121
|
/**
|
|
122
|
+
* Adds a child element to this component.
|
|
123
|
+
*
|
|
87
124
|
* @deprecated Do not use this method. It is only used internally by the library. It will be removed in a future version.
|
|
125
|
+
* @param child - The child component or text string to add
|
|
126
|
+
* @returns This component (for chaining)
|
|
88
127
|
*/
|
|
89
128
|
addChildElement(child) {
|
|
90
129
|
this.root.push(child);
|
|
@@ -92,6 +131,12 @@ class XmlComponent extends BaseXmlComponent {
|
|
|
92
131
|
}
|
|
93
132
|
}
|
|
94
133
|
class IgnoreIfEmptyXmlComponent extends XmlComponent {
|
|
134
|
+
/**
|
|
135
|
+
* Prepares the component for XML serialization, excluding it if empty.
|
|
136
|
+
*
|
|
137
|
+
* @param context - The serialization context
|
|
138
|
+
* @returns The XML-serializable object, or undefined if empty
|
|
139
|
+
*/
|
|
95
140
|
prepForXml(context) {
|
|
96
141
|
const result = super.prepForXml(context);
|
|
97
142
|
if (result && (typeof result[this.rootKey] !== "object" || Object.keys(result[this.rootKey]).length)) {
|
|
@@ -101,11 +146,26 @@ class IgnoreIfEmptyXmlComponent extends XmlComponent {
|
|
|
101
146
|
}
|
|
102
147
|
}
|
|
103
148
|
class XmlAttributeComponent extends BaseXmlComponent {
|
|
149
|
+
/**
|
|
150
|
+
* Creates a new attribute component.
|
|
151
|
+
*
|
|
152
|
+
* @param root - The attribute data object
|
|
153
|
+
*/
|
|
104
154
|
constructor(root) {
|
|
105
155
|
super("_attr");
|
|
156
|
+
/** Optional mapping from property names to XML attribute names. */
|
|
106
157
|
__publicField(this, "xmlKeys");
|
|
107
158
|
this.root = root;
|
|
108
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Converts the attribute data to an XML-serializable object.
|
|
162
|
+
*
|
|
163
|
+
* This method transforms the property names using xmlKeys (if defined)
|
|
164
|
+
* and filters out undefined values.
|
|
165
|
+
*
|
|
166
|
+
* @param _ - Context (unused for attributes)
|
|
167
|
+
* @returns Object with _attr key containing the mapped attributes
|
|
168
|
+
*/
|
|
109
169
|
prepForXml(_) {
|
|
110
170
|
const attrs = {};
|
|
111
171
|
Object.entries(this.root).forEach(([key, value]) => {
|
|
@@ -118,10 +178,24 @@ class XmlAttributeComponent extends BaseXmlComponent {
|
|
|
118
178
|
}
|
|
119
179
|
}
|
|
120
180
|
class NextAttributeComponent extends BaseXmlComponent {
|
|
181
|
+
/**
|
|
182
|
+
* Creates a new NextAttributeComponent.
|
|
183
|
+
*
|
|
184
|
+
* @param root - Attribute payload with explicit key-value mappings
|
|
185
|
+
*/
|
|
121
186
|
constructor(root) {
|
|
122
187
|
super("_attr");
|
|
123
188
|
this.root = root;
|
|
124
189
|
}
|
|
190
|
+
/**
|
|
191
|
+
* Converts the attribute payload to an XML-serializable object.
|
|
192
|
+
*
|
|
193
|
+
* Extracts the key and value from each property and filters out
|
|
194
|
+
* undefined values.
|
|
195
|
+
*
|
|
196
|
+
* @param _ - Context (unused for attributes)
|
|
197
|
+
* @returns Object with _attr key containing the attributes
|
|
198
|
+
*/
|
|
125
199
|
prepForXml(_) {
|
|
126
200
|
const attrs = Object.values(this.root).filter(({ value }) => value !== void 0).reduce((acc, { key, value }) => __spreadProps(__spreadValues({}, acc), { [key]: value }), {});
|
|
127
201
|
return { _attr: attrs };
|
|
@@ -831,7 +905,6 @@ function requireBase64Js() {
|
|
|
831
905
|
return base64Js;
|
|
832
906
|
}
|
|
833
907
|
var ieee754 = {};
|
|
834
|
-
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
835
908
|
var hasRequiredIeee754;
|
|
836
909
|
function requireIeee754() {
|
|
837
910
|
if (hasRequiredIeee754) return ieee754;
|
|
@@ -915,25 +988,19 @@ function requireIeee754() {
|
|
|
915
988
|
};
|
|
916
989
|
return ieee754;
|
|
917
990
|
}
|
|
918
|
-
/*!
|
|
919
|
-
* The buffer module from node.js, for the browser.
|
|
920
|
-
*
|
|
921
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
922
|
-
* @license MIT
|
|
923
|
-
*/
|
|
924
991
|
var hasRequiredBuffer;
|
|
925
992
|
function requireBuffer() {
|
|
926
993
|
if (hasRequiredBuffer) return buffer;
|
|
927
994
|
hasRequiredBuffer = 1;
|
|
928
|
-
(function(exports) {
|
|
995
|
+
(function(exports$1) {
|
|
929
996
|
var base64 = requireBase64Js();
|
|
930
997
|
var ieee7542 = requireIeee754();
|
|
931
998
|
var customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null;
|
|
932
|
-
exports.Buffer = Buffer2;
|
|
933
|
-
exports.SlowBuffer = SlowBuffer;
|
|
934
|
-
exports.INSPECT_MAX_BYTES = 50;
|
|
999
|
+
exports$1.Buffer = Buffer2;
|
|
1000
|
+
exports$1.SlowBuffer = SlowBuffer;
|
|
1001
|
+
exports$1.INSPECT_MAX_BYTES = 50;
|
|
935
1002
|
var K_MAX_LENGTH = 2147483647;
|
|
936
|
-
exports.kMaxLength = K_MAX_LENGTH;
|
|
1003
|
+
exports$1.kMaxLength = K_MAX_LENGTH;
|
|
937
1004
|
Buffer2.TYPED_ARRAY_SUPPORT = typedArraySupport();
|
|
938
1005
|
if (!Buffer2.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") {
|
|
939
1006
|
console.error(
|
|
@@ -1366,7 +1433,7 @@ function requireBuffer() {
|
|
|
1366
1433
|
};
|
|
1367
1434
|
Buffer2.prototype.inspect = function inspect() {
|
|
1368
1435
|
var str = "";
|
|
1369
|
-
var max2 = exports.INSPECT_MAX_BYTES;
|
|
1436
|
+
var max2 = exports$1.INSPECT_MAX_BYTES;
|
|
1370
1437
|
str = this.toString("hex", 0, max2).replace(/(.{2})/g, "$1 ").trim();
|
|
1371
1438
|
if (this.length > max2) str += " ... ";
|
|
1372
1439
|
return "<Buffer " + str + ">";
|
|
@@ -2279,7 +2346,7 @@ function requireBuffer() {
|
|
|
2279
2346
|
function numberIsNaN(obj) {
|
|
2280
2347
|
return obj !== obj;
|
|
2281
2348
|
}
|
|
2282
|
-
var hexSliceLookupTable = function() {
|
|
2349
|
+
var hexSliceLookupTable = (function() {
|
|
2283
2350
|
var alphabet = "0123456789abcdef";
|
|
2284
2351
|
var table = new Array(256);
|
|
2285
2352
|
for (var i = 0; i < 16; ++i) {
|
|
@@ -2289,7 +2356,7 @@ function requireBuffer() {
|
|
|
2289
2356
|
}
|
|
2290
2357
|
}
|
|
2291
2358
|
return table;
|
|
2292
|
-
}();
|
|
2359
|
+
})();
|
|
2293
2360
|
})(buffer);
|
|
2294
2361
|
return buffer;
|
|
2295
2362
|
}
|
|
@@ -2308,7 +2375,7 @@ function requireShams$1() {
|
|
|
2308
2375
|
return true;
|
|
2309
2376
|
}
|
|
2310
2377
|
var obj = {};
|
|
2311
|
-
var sym = Symbol("test");
|
|
2378
|
+
var sym = /* @__PURE__ */ Symbol("test");
|
|
2312
2379
|
var symObj = Object(sym);
|
|
2313
2380
|
if (typeof sym === "string") {
|
|
2314
2381
|
return false;
|
|
@@ -2554,7 +2621,7 @@ function requireHasSymbols() {
|
|
|
2554
2621
|
if (typeof origSymbol("foo") !== "symbol") {
|
|
2555
2622
|
return false;
|
|
2556
2623
|
}
|
|
2557
|
-
if (typeof Symbol("bar") !== "symbol") {
|
|
2624
|
+
if (typeof /* @__PURE__ */ Symbol("bar") !== "symbol") {
|
|
2558
2625
|
return false;
|
|
2559
2626
|
}
|
|
2560
2627
|
return hasSymbolSham();
|
|
@@ -2811,7 +2878,7 @@ function requireGetIntrinsic() {
|
|
|
2811
2878
|
var throwTypeError = function() {
|
|
2812
2879
|
throw new $TypeError();
|
|
2813
2880
|
};
|
|
2814
|
-
var ThrowTypeError = $gOPD ? function() {
|
|
2881
|
+
var ThrowTypeError = $gOPD ? (function() {
|
|
2815
2882
|
try {
|
|
2816
2883
|
arguments.callee;
|
|
2817
2884
|
return throwTypeError;
|
|
@@ -2822,7 +2889,7 @@ function requireGetIntrinsic() {
|
|
|
2822
2889
|
return throwTypeError;
|
|
2823
2890
|
}
|
|
2824
2891
|
}
|
|
2825
|
-
}() : throwTypeError;
|
|
2892
|
+
})() : throwTypeError;
|
|
2826
2893
|
var hasSymbols2 = requireHasSymbols()();
|
|
2827
2894
|
var getProto2 = requireGetProto();
|
|
2828
2895
|
var $ObjectGPO = requireObject_getPrototypeOf();
|
|
@@ -3085,7 +3152,7 @@ function requireGetIntrinsic() {
|
|
|
3085
3152
|
if (!allowMissing) {
|
|
3086
3153
|
throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available.");
|
|
3087
3154
|
}
|
|
3088
|
-
return void
|
|
3155
|
+
return void undefined$1;
|
|
3089
3156
|
}
|
|
3090
3157
|
if ($gOPD && i + 1 >= parts.length) {
|
|
3091
3158
|
var desc = $gOPD(value, part);
|
|
@@ -3108,178 +3175,24 @@ function requireGetIntrinsic() {
|
|
|
3108
3175
|
};
|
|
3109
3176
|
return getIntrinsic;
|
|
3110
3177
|
}
|
|
3111
|
-
var callBind = { exports: {} };
|
|
3112
|
-
var defineDataProperty;
|
|
3113
|
-
var hasRequiredDefineDataProperty;
|
|
3114
|
-
function requireDefineDataProperty() {
|
|
3115
|
-
if (hasRequiredDefineDataProperty) return defineDataProperty;
|
|
3116
|
-
hasRequiredDefineDataProperty = 1;
|
|
3117
|
-
var $defineProperty = /* @__PURE__ */ requireEsDefineProperty();
|
|
3118
|
-
var $SyntaxError = /* @__PURE__ */ requireSyntax();
|
|
3119
|
-
var $TypeError = /* @__PURE__ */ requireType();
|
|
3120
|
-
var gopd2 = /* @__PURE__ */ requireGopd();
|
|
3121
|
-
defineDataProperty = function defineDataProperty2(obj, property, value) {
|
|
3122
|
-
if (!obj || typeof obj !== "object" && typeof obj !== "function") {
|
|
3123
|
-
throw new $TypeError("`obj` must be an object or a function`");
|
|
3124
|
-
}
|
|
3125
|
-
if (typeof property !== "string" && typeof property !== "symbol") {
|
|
3126
|
-
throw new $TypeError("`property` must be a string or a symbol`");
|
|
3127
|
-
}
|
|
3128
|
-
if (arguments.length > 3 && typeof arguments[3] !== "boolean" && arguments[3] !== null) {
|
|
3129
|
-
throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null");
|
|
3130
|
-
}
|
|
3131
|
-
if (arguments.length > 4 && typeof arguments[4] !== "boolean" && arguments[4] !== null) {
|
|
3132
|
-
throw new $TypeError("`nonWritable`, if provided, must be a boolean or null");
|
|
3133
|
-
}
|
|
3134
|
-
if (arguments.length > 5 && typeof arguments[5] !== "boolean" && arguments[5] !== null) {
|
|
3135
|
-
throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null");
|
|
3136
|
-
}
|
|
3137
|
-
if (arguments.length > 6 && typeof arguments[6] !== "boolean") {
|
|
3138
|
-
throw new $TypeError("`loose`, if provided, must be a boolean");
|
|
3139
|
-
}
|
|
3140
|
-
var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
|
|
3141
|
-
var nonWritable = arguments.length > 4 ? arguments[4] : null;
|
|
3142
|
-
var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
|
|
3143
|
-
var loose = arguments.length > 6 ? arguments[6] : false;
|
|
3144
|
-
var desc = !!gopd2 && gopd2(obj, property);
|
|
3145
|
-
if ($defineProperty) {
|
|
3146
|
-
$defineProperty(obj, property, {
|
|
3147
|
-
configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
|
|
3148
|
-
enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
|
|
3149
|
-
value,
|
|
3150
|
-
writable: nonWritable === null && desc ? desc.writable : !nonWritable
|
|
3151
|
-
});
|
|
3152
|
-
} else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) {
|
|
3153
|
-
obj[property] = value;
|
|
3154
|
-
} else {
|
|
3155
|
-
throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
|
|
3156
|
-
}
|
|
3157
|
-
};
|
|
3158
|
-
return defineDataProperty;
|
|
3159
|
-
}
|
|
3160
|
-
var hasPropertyDescriptors_1;
|
|
3161
|
-
var hasRequiredHasPropertyDescriptors;
|
|
3162
|
-
function requireHasPropertyDescriptors() {
|
|
3163
|
-
if (hasRequiredHasPropertyDescriptors) return hasPropertyDescriptors_1;
|
|
3164
|
-
hasRequiredHasPropertyDescriptors = 1;
|
|
3165
|
-
var $defineProperty = /* @__PURE__ */ requireEsDefineProperty();
|
|
3166
|
-
var hasPropertyDescriptors = function hasPropertyDescriptors2() {
|
|
3167
|
-
return !!$defineProperty;
|
|
3168
|
-
};
|
|
3169
|
-
hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
|
|
3170
|
-
if (!$defineProperty) {
|
|
3171
|
-
return null;
|
|
3172
|
-
}
|
|
3173
|
-
try {
|
|
3174
|
-
return $defineProperty([], "length", { value: 1 }).length !== 1;
|
|
3175
|
-
} catch (e) {
|
|
3176
|
-
return true;
|
|
3177
|
-
}
|
|
3178
|
-
};
|
|
3179
|
-
hasPropertyDescriptors_1 = hasPropertyDescriptors;
|
|
3180
|
-
return hasPropertyDescriptors_1;
|
|
3181
|
-
}
|
|
3182
|
-
var setFunctionLength;
|
|
3183
|
-
var hasRequiredSetFunctionLength;
|
|
3184
|
-
function requireSetFunctionLength() {
|
|
3185
|
-
if (hasRequiredSetFunctionLength) return setFunctionLength;
|
|
3186
|
-
hasRequiredSetFunctionLength = 1;
|
|
3187
|
-
var GetIntrinsic = /* @__PURE__ */ requireGetIntrinsic();
|
|
3188
|
-
var define = /* @__PURE__ */ requireDefineDataProperty();
|
|
3189
|
-
var hasDescriptors = /* @__PURE__ */ requireHasPropertyDescriptors()();
|
|
3190
|
-
var gOPD2 = /* @__PURE__ */ requireGopd();
|
|
3191
|
-
var $TypeError = /* @__PURE__ */ requireType();
|
|
3192
|
-
var $floor = GetIntrinsic("%Math.floor%");
|
|
3193
|
-
setFunctionLength = function setFunctionLength2(fn, length) {
|
|
3194
|
-
if (typeof fn !== "function") {
|
|
3195
|
-
throw new $TypeError("`fn` is not a function");
|
|
3196
|
-
}
|
|
3197
|
-
if (typeof length !== "number" || length < 0 || length > 4294967295 || $floor(length) !== length) {
|
|
3198
|
-
throw new $TypeError("`length` must be a positive 32-bit integer");
|
|
3199
|
-
}
|
|
3200
|
-
var loose = arguments.length > 2 && !!arguments[2];
|
|
3201
|
-
var functionLengthIsConfigurable = true;
|
|
3202
|
-
var functionLengthIsWritable = true;
|
|
3203
|
-
if ("length" in fn && gOPD2) {
|
|
3204
|
-
var desc = gOPD2(fn, "length");
|
|
3205
|
-
if (desc && !desc.configurable) {
|
|
3206
|
-
functionLengthIsConfigurable = false;
|
|
3207
|
-
}
|
|
3208
|
-
if (desc && !desc.writable) {
|
|
3209
|
-
functionLengthIsWritable = false;
|
|
3210
|
-
}
|
|
3211
|
-
}
|
|
3212
|
-
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
|
|
3213
|
-
if (hasDescriptors) {
|
|
3214
|
-
define(
|
|
3215
|
-
/** @type {Parameters<define>[0]} */
|
|
3216
|
-
fn,
|
|
3217
|
-
"length",
|
|
3218
|
-
length,
|
|
3219
|
-
true,
|
|
3220
|
-
true
|
|
3221
|
-
);
|
|
3222
|
-
} else {
|
|
3223
|
-
define(
|
|
3224
|
-
/** @type {Parameters<define>[0]} */
|
|
3225
|
-
fn,
|
|
3226
|
-
"length",
|
|
3227
|
-
length
|
|
3228
|
-
);
|
|
3229
|
-
}
|
|
3230
|
-
}
|
|
3231
|
-
return fn;
|
|
3232
|
-
};
|
|
3233
|
-
return setFunctionLength;
|
|
3234
|
-
}
|
|
3235
|
-
var hasRequiredCallBind;
|
|
3236
|
-
function requireCallBind() {
|
|
3237
|
-
if (hasRequiredCallBind) return callBind.exports;
|
|
3238
|
-
hasRequiredCallBind = 1;
|
|
3239
|
-
(function(module) {
|
|
3240
|
-
var bind = requireFunctionBind();
|
|
3241
|
-
var GetIntrinsic = /* @__PURE__ */ requireGetIntrinsic();
|
|
3242
|
-
var setFunctionLength2 = /* @__PURE__ */ requireSetFunctionLength();
|
|
3243
|
-
var $TypeError = /* @__PURE__ */ requireType();
|
|
3244
|
-
var $apply = GetIntrinsic("%Function.prototype.apply%");
|
|
3245
|
-
var $call = GetIntrinsic("%Function.prototype.call%");
|
|
3246
|
-
var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind.call($call, $apply);
|
|
3247
|
-
var $defineProperty = /* @__PURE__ */ requireEsDefineProperty();
|
|
3248
|
-
var $max = GetIntrinsic("%Math.max%");
|
|
3249
|
-
module.exports = function callBind2(originalFunction) {
|
|
3250
|
-
if (typeof originalFunction !== "function") {
|
|
3251
|
-
throw new $TypeError("a function is required");
|
|
3252
|
-
}
|
|
3253
|
-
var func = $reflectApply(bind, $call, arguments);
|
|
3254
|
-
return setFunctionLength2(
|
|
3255
|
-
func,
|
|
3256
|
-
1 + $max(0, originalFunction.length - (arguments.length - 1)),
|
|
3257
|
-
true
|
|
3258
|
-
);
|
|
3259
|
-
};
|
|
3260
|
-
var applyBind = function applyBind2() {
|
|
3261
|
-
return $reflectApply(bind, $apply, arguments);
|
|
3262
|
-
};
|
|
3263
|
-
if ($defineProperty) {
|
|
3264
|
-
$defineProperty(module.exports, "apply", { value: applyBind });
|
|
3265
|
-
} else {
|
|
3266
|
-
module.exports.apply = applyBind;
|
|
3267
|
-
}
|
|
3268
|
-
})(callBind);
|
|
3269
|
-
return callBind.exports;
|
|
3270
|
-
}
|
|
3271
3178
|
var callBound;
|
|
3272
3179
|
var hasRequiredCallBound;
|
|
3273
3180
|
function requireCallBound() {
|
|
3274
3181
|
if (hasRequiredCallBound) return callBound;
|
|
3275
3182
|
hasRequiredCallBound = 1;
|
|
3276
3183
|
var GetIntrinsic = /* @__PURE__ */ requireGetIntrinsic();
|
|
3277
|
-
var
|
|
3278
|
-
var $indexOf =
|
|
3184
|
+
var callBindBasic = requireCallBindApplyHelpers();
|
|
3185
|
+
var $indexOf = callBindBasic([GetIntrinsic("%String.prototype.indexOf%")]);
|
|
3279
3186
|
callBound = function callBoundIntrinsic(name, allowMissing) {
|
|
3280
|
-
var intrinsic =
|
|
3187
|
+
var intrinsic = (
|
|
3188
|
+
/** @type {(this: unknown, ...args: unknown[]) => unknown} */
|
|
3189
|
+
GetIntrinsic(name, !!allowMissing)
|
|
3190
|
+
);
|
|
3281
3191
|
if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) {
|
|
3282
|
-
return
|
|
3192
|
+
return callBindBasic(
|
|
3193
|
+
/** @type {const} */
|
|
3194
|
+
[intrinsic]
|
|
3195
|
+
);
|
|
3283
3196
|
}
|
|
3284
3197
|
return intrinsic;
|
|
3285
3198
|
};
|
|
@@ -3291,7 +3204,7 @@ function requireIsArguments() {
|
|
|
3291
3204
|
if (hasRequiredIsArguments) return isArguments;
|
|
3292
3205
|
hasRequiredIsArguments = 1;
|
|
3293
3206
|
var hasToStringTag = requireShams()();
|
|
3294
|
-
var callBound2 = requireCallBound();
|
|
3207
|
+
var callBound2 = /* @__PURE__ */ requireCallBound();
|
|
3295
3208
|
var $toString = callBound2("Object.prototype.toString");
|
|
3296
3209
|
var isStandardArguments = function isArguments2(value) {
|
|
3297
3210
|
if (hasToStringTag && value && typeof value === "object" && Symbol.toStringTag in value) {
|
|
@@ -3303,11 +3216,11 @@ function requireIsArguments() {
|
|
|
3303
3216
|
if (isStandardArguments(value)) {
|
|
3304
3217
|
return true;
|
|
3305
3218
|
}
|
|
3306
|
-
return value !== null && typeof value === "object" && typeof value.length === "number" && value.length >= 0 && $toString(value) !== "[object Array]" && $toString(value.callee) === "[object Function]";
|
|
3219
|
+
return value !== null && typeof value === "object" && "length" in value && typeof value.length === "number" && value.length >= 0 && $toString(value) !== "[object Array]" && "callee" in value && $toString(value.callee) === "[object Function]";
|
|
3307
3220
|
};
|
|
3308
|
-
var supportsStandardArguments = function() {
|
|
3221
|
+
var supportsStandardArguments = (function() {
|
|
3309
3222
|
return isStandardArguments(arguments);
|
|
3310
|
-
}();
|
|
3223
|
+
})();
|
|
3311
3224
|
isStandardArguments.isLegacyArguments = isLegacyArguments;
|
|
3312
3225
|
isArguments = supportsStandardArguments ? isStandardArguments : isLegacyArguments;
|
|
3313
3226
|
return isArguments;
|
|
@@ -3471,10 +3384,10 @@ function requireIsCallable() {
|
|
|
3471
3384
|
};
|
|
3472
3385
|
return isCallable;
|
|
3473
3386
|
}
|
|
3474
|
-
var
|
|
3387
|
+
var forEach;
|
|
3475
3388
|
var hasRequiredForEach;
|
|
3476
3389
|
function requireForEach() {
|
|
3477
|
-
if (hasRequiredForEach) return
|
|
3390
|
+
if (hasRequiredForEach) return forEach;
|
|
3478
3391
|
hasRequiredForEach = 1;
|
|
3479
3392
|
var isCallable2 = requireIsCallable();
|
|
3480
3393
|
var toStr = Object.prototype.toString;
|
|
@@ -3510,7 +3423,10 @@ function requireForEach() {
|
|
|
3510
3423
|
}
|
|
3511
3424
|
}
|
|
3512
3425
|
};
|
|
3513
|
-
|
|
3426
|
+
function isArray(x) {
|
|
3427
|
+
return toStr.call(x) === "[object Array]";
|
|
3428
|
+
}
|
|
3429
|
+
forEach = function forEach2(list, iterator, thisArg) {
|
|
3514
3430
|
if (!isCallable2(iterator)) {
|
|
3515
3431
|
throw new TypeError("iterator must be a function");
|
|
3516
3432
|
}
|
|
@@ -3518,7 +3434,7 @@ function requireForEach() {
|
|
|
3518
3434
|
if (arguments.length >= 3) {
|
|
3519
3435
|
receiver = thisArg;
|
|
3520
3436
|
}
|
|
3521
|
-
if (
|
|
3437
|
+
if (isArray(list)) {
|
|
3522
3438
|
forEachArray(list, iterator, receiver);
|
|
3523
3439
|
} else if (typeof list === "string") {
|
|
3524
3440
|
forEachString(list, iterator, receiver);
|
|
@@ -3526,8 +3442,7 @@ function requireForEach() {
|
|
|
3526
3442
|
forEachObject(list, iterator, receiver);
|
|
3527
3443
|
}
|
|
3528
3444
|
};
|
|
3529
|
-
|
|
3530
|
-
return forEach_1;
|
|
3445
|
+
return forEach;
|
|
3531
3446
|
}
|
|
3532
3447
|
var possibleTypedArrayNames;
|
|
3533
3448
|
var hasRequiredPossibleTypedArrayNames;
|
|
@@ -3563,26 +3478,189 @@ function requireAvailableTypedArrays() {
|
|
|
3563
3478
|
out[out.length] = possibleNames[i];
|
|
3564
3479
|
}
|
|
3565
3480
|
}
|
|
3566
|
-
return out;
|
|
3481
|
+
return out;
|
|
3482
|
+
};
|
|
3483
|
+
return availableTypedArrays;
|
|
3484
|
+
}
|
|
3485
|
+
var callBind = { exports: {} };
|
|
3486
|
+
var defineDataProperty;
|
|
3487
|
+
var hasRequiredDefineDataProperty;
|
|
3488
|
+
function requireDefineDataProperty() {
|
|
3489
|
+
if (hasRequiredDefineDataProperty) return defineDataProperty;
|
|
3490
|
+
hasRequiredDefineDataProperty = 1;
|
|
3491
|
+
var $defineProperty = /* @__PURE__ */ requireEsDefineProperty();
|
|
3492
|
+
var $SyntaxError = /* @__PURE__ */ requireSyntax();
|
|
3493
|
+
var $TypeError = /* @__PURE__ */ requireType();
|
|
3494
|
+
var gopd2 = /* @__PURE__ */ requireGopd();
|
|
3495
|
+
defineDataProperty = function defineDataProperty2(obj, property, value) {
|
|
3496
|
+
if (!obj || typeof obj !== "object" && typeof obj !== "function") {
|
|
3497
|
+
throw new $TypeError("`obj` must be an object or a function`");
|
|
3498
|
+
}
|
|
3499
|
+
if (typeof property !== "string" && typeof property !== "symbol") {
|
|
3500
|
+
throw new $TypeError("`property` must be a string or a symbol`");
|
|
3501
|
+
}
|
|
3502
|
+
if (arguments.length > 3 && typeof arguments[3] !== "boolean" && arguments[3] !== null) {
|
|
3503
|
+
throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null");
|
|
3504
|
+
}
|
|
3505
|
+
if (arguments.length > 4 && typeof arguments[4] !== "boolean" && arguments[4] !== null) {
|
|
3506
|
+
throw new $TypeError("`nonWritable`, if provided, must be a boolean or null");
|
|
3507
|
+
}
|
|
3508
|
+
if (arguments.length > 5 && typeof arguments[5] !== "boolean" && arguments[5] !== null) {
|
|
3509
|
+
throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null");
|
|
3510
|
+
}
|
|
3511
|
+
if (arguments.length > 6 && typeof arguments[6] !== "boolean") {
|
|
3512
|
+
throw new $TypeError("`loose`, if provided, must be a boolean");
|
|
3513
|
+
}
|
|
3514
|
+
var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
|
|
3515
|
+
var nonWritable = arguments.length > 4 ? arguments[4] : null;
|
|
3516
|
+
var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
|
|
3517
|
+
var loose = arguments.length > 6 ? arguments[6] : false;
|
|
3518
|
+
var desc = !!gopd2 && gopd2(obj, property);
|
|
3519
|
+
if ($defineProperty) {
|
|
3520
|
+
$defineProperty(obj, property, {
|
|
3521
|
+
configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
|
|
3522
|
+
enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
|
|
3523
|
+
value,
|
|
3524
|
+
writable: nonWritable === null && desc ? desc.writable : !nonWritable
|
|
3525
|
+
});
|
|
3526
|
+
} else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) {
|
|
3527
|
+
obj[property] = value;
|
|
3528
|
+
} else {
|
|
3529
|
+
throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
|
|
3530
|
+
}
|
|
3531
|
+
};
|
|
3532
|
+
return defineDataProperty;
|
|
3533
|
+
}
|
|
3534
|
+
var hasPropertyDescriptors_1;
|
|
3535
|
+
var hasRequiredHasPropertyDescriptors;
|
|
3536
|
+
function requireHasPropertyDescriptors() {
|
|
3537
|
+
if (hasRequiredHasPropertyDescriptors) return hasPropertyDescriptors_1;
|
|
3538
|
+
hasRequiredHasPropertyDescriptors = 1;
|
|
3539
|
+
var $defineProperty = /* @__PURE__ */ requireEsDefineProperty();
|
|
3540
|
+
var hasPropertyDescriptors = function hasPropertyDescriptors2() {
|
|
3541
|
+
return !!$defineProperty;
|
|
3542
|
+
};
|
|
3543
|
+
hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
|
|
3544
|
+
if (!$defineProperty) {
|
|
3545
|
+
return null;
|
|
3546
|
+
}
|
|
3547
|
+
try {
|
|
3548
|
+
return $defineProperty([], "length", { value: 1 }).length !== 1;
|
|
3549
|
+
} catch (e) {
|
|
3550
|
+
return true;
|
|
3551
|
+
}
|
|
3552
|
+
};
|
|
3553
|
+
hasPropertyDescriptors_1 = hasPropertyDescriptors;
|
|
3554
|
+
return hasPropertyDescriptors_1;
|
|
3555
|
+
}
|
|
3556
|
+
var setFunctionLength;
|
|
3557
|
+
var hasRequiredSetFunctionLength;
|
|
3558
|
+
function requireSetFunctionLength() {
|
|
3559
|
+
if (hasRequiredSetFunctionLength) return setFunctionLength;
|
|
3560
|
+
hasRequiredSetFunctionLength = 1;
|
|
3561
|
+
var GetIntrinsic = /* @__PURE__ */ requireGetIntrinsic();
|
|
3562
|
+
var define = /* @__PURE__ */ requireDefineDataProperty();
|
|
3563
|
+
var hasDescriptors = /* @__PURE__ */ requireHasPropertyDescriptors()();
|
|
3564
|
+
var gOPD2 = /* @__PURE__ */ requireGopd();
|
|
3565
|
+
var $TypeError = /* @__PURE__ */ requireType();
|
|
3566
|
+
var $floor = GetIntrinsic("%Math.floor%");
|
|
3567
|
+
setFunctionLength = function setFunctionLength2(fn, length) {
|
|
3568
|
+
if (typeof fn !== "function") {
|
|
3569
|
+
throw new $TypeError("`fn` is not a function");
|
|
3570
|
+
}
|
|
3571
|
+
if (typeof length !== "number" || length < 0 || length > 4294967295 || $floor(length) !== length) {
|
|
3572
|
+
throw new $TypeError("`length` must be a positive 32-bit integer");
|
|
3573
|
+
}
|
|
3574
|
+
var loose = arguments.length > 2 && !!arguments[2];
|
|
3575
|
+
var functionLengthIsConfigurable = true;
|
|
3576
|
+
var functionLengthIsWritable = true;
|
|
3577
|
+
if ("length" in fn && gOPD2) {
|
|
3578
|
+
var desc = gOPD2(fn, "length");
|
|
3579
|
+
if (desc && !desc.configurable) {
|
|
3580
|
+
functionLengthIsConfigurable = false;
|
|
3581
|
+
}
|
|
3582
|
+
if (desc && !desc.writable) {
|
|
3583
|
+
functionLengthIsWritable = false;
|
|
3584
|
+
}
|
|
3585
|
+
}
|
|
3586
|
+
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
|
|
3587
|
+
if (hasDescriptors) {
|
|
3588
|
+
define(
|
|
3589
|
+
/** @type {Parameters<define>[0]} */
|
|
3590
|
+
fn,
|
|
3591
|
+
"length",
|
|
3592
|
+
length,
|
|
3593
|
+
true,
|
|
3594
|
+
true
|
|
3595
|
+
);
|
|
3596
|
+
} else {
|
|
3597
|
+
define(
|
|
3598
|
+
/** @type {Parameters<define>[0]} */
|
|
3599
|
+
fn,
|
|
3600
|
+
"length",
|
|
3601
|
+
length
|
|
3602
|
+
);
|
|
3603
|
+
}
|
|
3604
|
+
}
|
|
3605
|
+
return fn;
|
|
3567
3606
|
};
|
|
3568
|
-
return
|
|
3607
|
+
return setFunctionLength;
|
|
3608
|
+
}
|
|
3609
|
+
var applyBind;
|
|
3610
|
+
var hasRequiredApplyBind;
|
|
3611
|
+
function requireApplyBind() {
|
|
3612
|
+
if (hasRequiredApplyBind) return applyBind;
|
|
3613
|
+
hasRequiredApplyBind = 1;
|
|
3614
|
+
var bind = requireFunctionBind();
|
|
3615
|
+
var $apply = requireFunctionApply();
|
|
3616
|
+
var actualApply2 = requireActualApply();
|
|
3617
|
+
applyBind = function applyBind2() {
|
|
3618
|
+
return actualApply2(bind, $apply, arguments);
|
|
3619
|
+
};
|
|
3620
|
+
return applyBind;
|
|
3621
|
+
}
|
|
3622
|
+
var hasRequiredCallBind;
|
|
3623
|
+
function requireCallBind() {
|
|
3624
|
+
if (hasRequiredCallBind) return callBind.exports;
|
|
3625
|
+
hasRequiredCallBind = 1;
|
|
3626
|
+
(function(module) {
|
|
3627
|
+
var setFunctionLength2 = /* @__PURE__ */ requireSetFunctionLength();
|
|
3628
|
+
var $defineProperty = /* @__PURE__ */ requireEsDefineProperty();
|
|
3629
|
+
var callBindBasic = requireCallBindApplyHelpers();
|
|
3630
|
+
var applyBind2 = requireApplyBind();
|
|
3631
|
+
module.exports = function callBind2(originalFunction) {
|
|
3632
|
+
var func = callBindBasic(arguments);
|
|
3633
|
+
var adjustedLength = originalFunction.length - (arguments.length - 1);
|
|
3634
|
+
return setFunctionLength2(
|
|
3635
|
+
func,
|
|
3636
|
+
1 + (adjustedLength > 0 ? adjustedLength : 0),
|
|
3637
|
+
true
|
|
3638
|
+
);
|
|
3639
|
+
};
|
|
3640
|
+
if ($defineProperty) {
|
|
3641
|
+
$defineProperty(module.exports, "apply", { value: applyBind2 });
|
|
3642
|
+
} else {
|
|
3643
|
+
module.exports.apply = applyBind2;
|
|
3644
|
+
}
|
|
3645
|
+
})(callBind);
|
|
3646
|
+
return callBind.exports;
|
|
3569
3647
|
}
|
|
3570
3648
|
var whichTypedArray;
|
|
3571
3649
|
var hasRequiredWhichTypedArray;
|
|
3572
3650
|
function requireWhichTypedArray() {
|
|
3573
3651
|
if (hasRequiredWhichTypedArray) return whichTypedArray;
|
|
3574
3652
|
hasRequiredWhichTypedArray = 1;
|
|
3575
|
-
var
|
|
3653
|
+
var forEach2 = requireForEach();
|
|
3576
3654
|
var availableTypedArrays2 = /* @__PURE__ */ requireAvailableTypedArrays();
|
|
3577
3655
|
var callBind2 = requireCallBind();
|
|
3578
|
-
var callBound2 = requireCallBound();
|
|
3656
|
+
var callBound2 = /* @__PURE__ */ requireCallBound();
|
|
3579
3657
|
var gOPD2 = /* @__PURE__ */ requireGopd();
|
|
3658
|
+
var getProto2 = requireGetProto();
|
|
3580
3659
|
var $toString = callBound2("Object.prototype.toString");
|
|
3581
3660
|
var hasToStringTag = requireShams()();
|
|
3582
3661
|
var g = typeof globalThis === "undefined" ? commonjsGlobal : globalThis;
|
|
3583
3662
|
var typedArrays = availableTypedArrays2();
|
|
3584
3663
|
var $slice = callBound2("String.prototype.slice");
|
|
3585
|
-
var getPrototypeOf = Object.getPrototypeOf;
|
|
3586
3664
|
var $indexOf = callBound2("Array.prototype.indexOf", true) || function indexOf(array, value) {
|
|
3587
3665
|
for (var i = 0; i < array.length; i += 1) {
|
|
3588
3666
|
if (array[i] === value) {
|
|
@@ -3592,41 +3670,45 @@ function requireWhichTypedArray() {
|
|
|
3592
3670
|
return -1;
|
|
3593
3671
|
};
|
|
3594
3672
|
var cache = { __proto__: null };
|
|
3595
|
-
if (hasToStringTag && gOPD2 &&
|
|
3596
|
-
|
|
3673
|
+
if (hasToStringTag && gOPD2 && getProto2) {
|
|
3674
|
+
forEach2(typedArrays, function(typedArray) {
|
|
3597
3675
|
var arr = new g[typedArray]();
|
|
3598
|
-
if (Symbol.toStringTag in arr) {
|
|
3599
|
-
var proto =
|
|
3676
|
+
if (Symbol.toStringTag in arr && getProto2) {
|
|
3677
|
+
var proto = getProto2(arr);
|
|
3600
3678
|
var descriptor = gOPD2(proto, Symbol.toStringTag);
|
|
3601
|
-
if (!descriptor) {
|
|
3602
|
-
var superProto =
|
|
3679
|
+
if (!descriptor && proto) {
|
|
3680
|
+
var superProto = getProto2(proto);
|
|
3603
3681
|
descriptor = gOPD2(superProto, Symbol.toStringTag);
|
|
3604
3682
|
}
|
|
3605
3683
|
cache["$" + typedArray] = callBind2(descriptor.get);
|
|
3606
3684
|
}
|
|
3607
3685
|
});
|
|
3608
3686
|
} else {
|
|
3609
|
-
|
|
3687
|
+
forEach2(typedArrays, function(typedArray) {
|
|
3610
3688
|
var arr = new g[typedArray]();
|
|
3611
3689
|
var fn = arr.slice || arr.set;
|
|
3612
3690
|
if (fn) {
|
|
3613
|
-
cache[
|
|
3691
|
+
cache[
|
|
3692
|
+
/** @type {`$${import('.').TypedArrayName}`} */
|
|
3693
|
+
"$" + typedArray
|
|
3694
|
+
] = /** @type {import('./types').BoundSlice | import('./types').BoundSet} */
|
|
3695
|
+
// @ts-expect-error TODO FIXME
|
|
3696
|
+
callBind2(fn);
|
|
3614
3697
|
}
|
|
3615
3698
|
});
|
|
3616
3699
|
}
|
|
3617
3700
|
var tryTypedArrays = function tryAllTypedArrays(value) {
|
|
3618
3701
|
var found = false;
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
/** @type {Record<`\$${TypedArrayName}`, Getter>} */
|
|
3622
|
-
/** @type {any} */
|
|
3702
|
+
forEach2(
|
|
3703
|
+
/** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */
|
|
3623
3704
|
cache,
|
|
3624
3705
|
/** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */
|
|
3625
3706
|
function(getter, typedArray) {
|
|
3626
3707
|
if (!found) {
|
|
3627
3708
|
try {
|
|
3628
3709
|
if ("$" + getter(value) === typedArray) {
|
|
3629
|
-
found =
|
|
3710
|
+
found = /** @type {import('.').TypedArrayName} */
|
|
3711
|
+
$slice(typedArray, 1);
|
|
3630
3712
|
}
|
|
3631
3713
|
} catch (e) {
|
|
3632
3714
|
}
|
|
@@ -3637,17 +3719,16 @@ function requireWhichTypedArray() {
|
|
|
3637
3719
|
};
|
|
3638
3720
|
var trySlices = function tryAllSlices(value) {
|
|
3639
3721
|
var found = false;
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
/** @type {Record<`\$${TypedArrayName}`, Getter>} */
|
|
3643
|
-
/** @type {any} */
|
|
3722
|
+
forEach2(
|
|
3723
|
+
/** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */
|
|
3644
3724
|
cache,
|
|
3645
|
-
/** @type {(getter:
|
|
3725
|
+
/** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */
|
|
3646
3726
|
function(getter, name) {
|
|
3647
3727
|
if (!found) {
|
|
3648
3728
|
try {
|
|
3649
3729
|
getter(value);
|
|
3650
|
-
found =
|
|
3730
|
+
found = /** @type {import('.').TypedArrayName} */
|
|
3731
|
+
$slice(name, 1);
|
|
3651
3732
|
} catch (e) {
|
|
3652
3733
|
}
|
|
3653
3734
|
}
|
|
@@ -3691,8 +3772,8 @@ var hasRequiredTypes;
|
|
|
3691
3772
|
function requireTypes() {
|
|
3692
3773
|
if (hasRequiredTypes) return types;
|
|
3693
3774
|
hasRequiredTypes = 1;
|
|
3694
|
-
(function(exports) {
|
|
3695
|
-
var isArgumentsObject = requireIsArguments();
|
|
3775
|
+
(function(exports$1) {
|
|
3776
|
+
var isArgumentsObject = /* @__PURE__ */ requireIsArguments();
|
|
3696
3777
|
var isGeneratorFunction2 = requireIsGeneratorFunction();
|
|
3697
3778
|
var whichTypedArray2 = /* @__PURE__ */ requireWhichTypedArray();
|
|
3698
3779
|
var isTypedArray2 = /* @__PURE__ */ requireIsTypedArray();
|
|
@@ -3722,64 +3803,64 @@ function requireTypes() {
|
|
|
3722
3803
|
return false;
|
|
3723
3804
|
}
|
|
3724
3805
|
}
|
|
3725
|
-
exports.isArgumentsObject = isArgumentsObject;
|
|
3726
|
-
exports.isGeneratorFunction = isGeneratorFunction2;
|
|
3727
|
-
exports.isTypedArray = isTypedArray2;
|
|
3806
|
+
exports$1.isArgumentsObject = isArgumentsObject;
|
|
3807
|
+
exports$1.isGeneratorFunction = isGeneratorFunction2;
|
|
3808
|
+
exports$1.isTypedArray = isTypedArray2;
|
|
3728
3809
|
function isPromise(input) {
|
|
3729
3810
|
return typeof Promise !== "undefined" && input instanceof Promise || input !== null && typeof input === "object" && typeof input.then === "function" && typeof input.catch === "function";
|
|
3730
3811
|
}
|
|
3731
|
-
exports.isPromise = isPromise;
|
|
3812
|
+
exports$1.isPromise = isPromise;
|
|
3732
3813
|
function isArrayBufferView(value) {
|
|
3733
3814
|
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
3734
3815
|
return ArrayBuffer.isView(value);
|
|
3735
3816
|
}
|
|
3736
3817
|
return isTypedArray2(value) || isDataView(value);
|
|
3737
3818
|
}
|
|
3738
|
-
exports.isArrayBufferView = isArrayBufferView;
|
|
3819
|
+
exports$1.isArrayBufferView = isArrayBufferView;
|
|
3739
3820
|
function isUint8Array(value) {
|
|
3740
3821
|
return whichTypedArray2(value) === "Uint8Array";
|
|
3741
3822
|
}
|
|
3742
|
-
exports.isUint8Array = isUint8Array;
|
|
3823
|
+
exports$1.isUint8Array = isUint8Array;
|
|
3743
3824
|
function isUint8ClampedArray(value) {
|
|
3744
3825
|
return whichTypedArray2(value) === "Uint8ClampedArray";
|
|
3745
3826
|
}
|
|
3746
|
-
exports.isUint8ClampedArray = isUint8ClampedArray;
|
|
3827
|
+
exports$1.isUint8ClampedArray = isUint8ClampedArray;
|
|
3747
3828
|
function isUint16Array(value) {
|
|
3748
3829
|
return whichTypedArray2(value) === "Uint16Array";
|
|
3749
3830
|
}
|
|
3750
|
-
exports.isUint16Array = isUint16Array;
|
|
3831
|
+
exports$1.isUint16Array = isUint16Array;
|
|
3751
3832
|
function isUint32Array(value) {
|
|
3752
3833
|
return whichTypedArray2(value) === "Uint32Array";
|
|
3753
3834
|
}
|
|
3754
|
-
exports.isUint32Array = isUint32Array;
|
|
3835
|
+
exports$1.isUint32Array = isUint32Array;
|
|
3755
3836
|
function isInt8Array(value) {
|
|
3756
3837
|
return whichTypedArray2(value) === "Int8Array";
|
|
3757
3838
|
}
|
|
3758
|
-
exports.isInt8Array = isInt8Array;
|
|
3839
|
+
exports$1.isInt8Array = isInt8Array;
|
|
3759
3840
|
function isInt16Array(value) {
|
|
3760
3841
|
return whichTypedArray2(value) === "Int16Array";
|
|
3761
3842
|
}
|
|
3762
|
-
exports.isInt16Array = isInt16Array;
|
|
3843
|
+
exports$1.isInt16Array = isInt16Array;
|
|
3763
3844
|
function isInt32Array(value) {
|
|
3764
3845
|
return whichTypedArray2(value) === "Int32Array";
|
|
3765
3846
|
}
|
|
3766
|
-
exports.isInt32Array = isInt32Array;
|
|
3847
|
+
exports$1.isInt32Array = isInt32Array;
|
|
3767
3848
|
function isFloat32Array(value) {
|
|
3768
3849
|
return whichTypedArray2(value) === "Float32Array";
|
|
3769
3850
|
}
|
|
3770
|
-
exports.isFloat32Array = isFloat32Array;
|
|
3851
|
+
exports$1.isFloat32Array = isFloat32Array;
|
|
3771
3852
|
function isFloat64Array(value) {
|
|
3772
3853
|
return whichTypedArray2(value) === "Float64Array";
|
|
3773
3854
|
}
|
|
3774
|
-
exports.isFloat64Array = isFloat64Array;
|
|
3855
|
+
exports$1.isFloat64Array = isFloat64Array;
|
|
3775
3856
|
function isBigInt64Array(value) {
|
|
3776
3857
|
return whichTypedArray2(value) === "BigInt64Array";
|
|
3777
3858
|
}
|
|
3778
|
-
exports.isBigInt64Array = isBigInt64Array;
|
|
3859
|
+
exports$1.isBigInt64Array = isBigInt64Array;
|
|
3779
3860
|
function isBigUint64Array(value) {
|
|
3780
3861
|
return whichTypedArray2(value) === "BigUint64Array";
|
|
3781
3862
|
}
|
|
3782
|
-
exports.isBigUint64Array = isBigUint64Array;
|
|
3863
|
+
exports$1.isBigUint64Array = isBigUint64Array;
|
|
3783
3864
|
function isMapToString(value) {
|
|
3784
3865
|
return ObjectToString(value) === "[object Map]";
|
|
3785
3866
|
}
|
|
@@ -3790,7 +3871,7 @@ function requireTypes() {
|
|
|
3790
3871
|
}
|
|
3791
3872
|
return isMapToString.working ? isMapToString(value) : value instanceof Map;
|
|
3792
3873
|
}
|
|
3793
|
-
exports.isMap = isMap;
|
|
3874
|
+
exports$1.isMap = isMap;
|
|
3794
3875
|
function isSetToString(value) {
|
|
3795
3876
|
return ObjectToString(value) === "[object Set]";
|
|
3796
3877
|
}
|
|
@@ -3801,7 +3882,7 @@ function requireTypes() {
|
|
|
3801
3882
|
}
|
|
3802
3883
|
return isSetToString.working ? isSetToString(value) : value instanceof Set;
|
|
3803
3884
|
}
|
|
3804
|
-
exports.isSet = isSet;
|
|
3885
|
+
exports$1.isSet = isSet;
|
|
3805
3886
|
function isWeakMapToString(value) {
|
|
3806
3887
|
return ObjectToString(value) === "[object WeakMap]";
|
|
3807
3888
|
}
|
|
@@ -3812,7 +3893,7 @@ function requireTypes() {
|
|
|
3812
3893
|
}
|
|
3813
3894
|
return isWeakMapToString.working ? isWeakMapToString(value) : value instanceof WeakMap;
|
|
3814
3895
|
}
|
|
3815
|
-
exports.isWeakMap = isWeakMap;
|
|
3896
|
+
exports$1.isWeakMap = isWeakMap;
|
|
3816
3897
|
function isWeakSetToString(value) {
|
|
3817
3898
|
return ObjectToString(value) === "[object WeakSet]";
|
|
3818
3899
|
}
|
|
@@ -3820,7 +3901,7 @@ function requireTypes() {
|
|
|
3820
3901
|
function isWeakSet(value) {
|
|
3821
3902
|
return isWeakSetToString(value);
|
|
3822
3903
|
}
|
|
3823
|
-
exports.isWeakSet = isWeakSet;
|
|
3904
|
+
exports$1.isWeakSet = isWeakSet;
|
|
3824
3905
|
function isArrayBufferToString(value) {
|
|
3825
3906
|
return ObjectToString(value) === "[object ArrayBuffer]";
|
|
3826
3907
|
}
|
|
@@ -3831,7 +3912,7 @@ function requireTypes() {
|
|
|
3831
3912
|
}
|
|
3832
3913
|
return isArrayBufferToString.working ? isArrayBufferToString(value) : value instanceof ArrayBuffer;
|
|
3833
3914
|
}
|
|
3834
|
-
exports.isArrayBuffer = isArrayBuffer;
|
|
3915
|
+
exports$1.isArrayBuffer = isArrayBuffer;
|
|
3835
3916
|
function isDataViewToString(value) {
|
|
3836
3917
|
return ObjectToString(value) === "[object DataView]";
|
|
3837
3918
|
}
|
|
@@ -3842,7 +3923,7 @@ function requireTypes() {
|
|
|
3842
3923
|
}
|
|
3843
3924
|
return isDataViewToString.working ? isDataViewToString(value) : value instanceof DataView;
|
|
3844
3925
|
}
|
|
3845
|
-
exports.isDataView = isDataView;
|
|
3926
|
+
exports$1.isDataView = isDataView;
|
|
3846
3927
|
var SharedArrayBufferCopy = typeof SharedArrayBuffer !== "undefined" ? SharedArrayBuffer : void 0;
|
|
3847
3928
|
function isSharedArrayBufferToString(value) {
|
|
3848
3929
|
return ObjectToString(value) === "[object SharedArrayBuffer]";
|
|
@@ -3856,57 +3937,57 @@ function requireTypes() {
|
|
|
3856
3937
|
}
|
|
3857
3938
|
return isSharedArrayBufferToString.working ? isSharedArrayBufferToString(value) : value instanceof SharedArrayBufferCopy;
|
|
3858
3939
|
}
|
|
3859
|
-
exports.isSharedArrayBuffer = isSharedArrayBuffer;
|
|
3940
|
+
exports$1.isSharedArrayBuffer = isSharedArrayBuffer;
|
|
3860
3941
|
function isAsyncFunction(value) {
|
|
3861
3942
|
return ObjectToString(value) === "[object AsyncFunction]";
|
|
3862
3943
|
}
|
|
3863
|
-
exports.isAsyncFunction = isAsyncFunction;
|
|
3944
|
+
exports$1.isAsyncFunction = isAsyncFunction;
|
|
3864
3945
|
function isMapIterator(value) {
|
|
3865
3946
|
return ObjectToString(value) === "[object Map Iterator]";
|
|
3866
3947
|
}
|
|
3867
|
-
exports.isMapIterator = isMapIterator;
|
|
3948
|
+
exports$1.isMapIterator = isMapIterator;
|
|
3868
3949
|
function isSetIterator(value) {
|
|
3869
3950
|
return ObjectToString(value) === "[object Set Iterator]";
|
|
3870
3951
|
}
|
|
3871
|
-
exports.isSetIterator = isSetIterator;
|
|
3952
|
+
exports$1.isSetIterator = isSetIterator;
|
|
3872
3953
|
function isGeneratorObject(value) {
|
|
3873
3954
|
return ObjectToString(value) === "[object Generator]";
|
|
3874
3955
|
}
|
|
3875
|
-
exports.isGeneratorObject = isGeneratorObject;
|
|
3956
|
+
exports$1.isGeneratorObject = isGeneratorObject;
|
|
3876
3957
|
function isWebAssemblyCompiledModule(value) {
|
|
3877
3958
|
return ObjectToString(value) === "[object WebAssembly.Module]";
|
|
3878
3959
|
}
|
|
3879
|
-
exports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule;
|
|
3960
|
+
exports$1.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule;
|
|
3880
3961
|
function isNumberObject(value) {
|
|
3881
3962
|
return checkBoxedPrimitive(value, numberValue);
|
|
3882
3963
|
}
|
|
3883
|
-
exports.isNumberObject = isNumberObject;
|
|
3964
|
+
exports$1.isNumberObject = isNumberObject;
|
|
3884
3965
|
function isStringObject(value) {
|
|
3885
3966
|
return checkBoxedPrimitive(value, stringValue);
|
|
3886
3967
|
}
|
|
3887
|
-
exports.isStringObject = isStringObject;
|
|
3968
|
+
exports$1.isStringObject = isStringObject;
|
|
3888
3969
|
function isBooleanObject(value) {
|
|
3889
3970
|
return checkBoxedPrimitive(value, booleanValue);
|
|
3890
3971
|
}
|
|
3891
|
-
exports.isBooleanObject = isBooleanObject;
|
|
3972
|
+
exports$1.isBooleanObject = isBooleanObject;
|
|
3892
3973
|
function isBigIntObject(value) {
|
|
3893
3974
|
return BigIntSupported && checkBoxedPrimitive(value, bigIntValue);
|
|
3894
3975
|
}
|
|
3895
|
-
exports.isBigIntObject = isBigIntObject;
|
|
3976
|
+
exports$1.isBigIntObject = isBigIntObject;
|
|
3896
3977
|
function isSymbolObject(value) {
|
|
3897
3978
|
return SymbolSupported && checkBoxedPrimitive(value, symbolValue);
|
|
3898
3979
|
}
|
|
3899
|
-
exports.isSymbolObject = isSymbolObject;
|
|
3980
|
+
exports$1.isSymbolObject = isSymbolObject;
|
|
3900
3981
|
function isBoxedPrimitive(value) {
|
|
3901
3982
|
return isNumberObject(value) || isStringObject(value) || isBooleanObject(value) || isBigIntObject(value) || isSymbolObject(value);
|
|
3902
3983
|
}
|
|
3903
|
-
exports.isBoxedPrimitive = isBoxedPrimitive;
|
|
3984
|
+
exports$1.isBoxedPrimitive = isBoxedPrimitive;
|
|
3904
3985
|
function isAnyArrayBuffer(value) {
|
|
3905
3986
|
return typeof Uint8Array !== "undefined" && (isArrayBuffer(value) || isSharedArrayBuffer(value));
|
|
3906
3987
|
}
|
|
3907
|
-
exports.isAnyArrayBuffer = isAnyArrayBuffer;
|
|
3988
|
+
exports$1.isAnyArrayBuffer = isAnyArrayBuffer;
|
|
3908
3989
|
["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(method) {
|
|
3909
|
-
Object.defineProperty(exports, method, {
|
|
3990
|
+
Object.defineProperty(exports$1, method, {
|
|
3910
3991
|
enumerable: false,
|
|
3911
3992
|
value: function() {
|
|
3912
3993
|
throw new Error(method + " is not supported in userland");
|
|
@@ -3930,7 +4011,7 @@ var hasRequiredUtil;
|
|
|
3930
4011
|
function requireUtil() {
|
|
3931
4012
|
if (hasRequiredUtil) return util;
|
|
3932
4013
|
hasRequiredUtil = 1;
|
|
3933
|
-
(function(exports) {
|
|
4014
|
+
(function(exports$1) {
|
|
3934
4015
|
var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors2(obj) {
|
|
3935
4016
|
var keys = Object.keys(obj);
|
|
3936
4017
|
var descriptors = {};
|
|
@@ -3940,7 +4021,7 @@ function requireUtil() {
|
|
|
3940
4021
|
return descriptors;
|
|
3941
4022
|
};
|
|
3942
4023
|
var formatRegExp = /%[sdj%]/g;
|
|
3943
|
-
exports.format = function(f) {
|
|
4024
|
+
exports$1.format = function(f) {
|
|
3944
4025
|
if (!isString(f)) {
|
|
3945
4026
|
var objects = [];
|
|
3946
4027
|
for (var i = 0; i < arguments.length; i++) {
|
|
@@ -3978,13 +4059,13 @@ function requireUtil() {
|
|
|
3978
4059
|
}
|
|
3979
4060
|
return str;
|
|
3980
4061
|
};
|
|
3981
|
-
exports.deprecate = function(fn, msg) {
|
|
4062
|
+
exports$1.deprecate = function(fn, msg) {
|
|
3982
4063
|
if (typeof process$1 !== "undefined" && process$1.noDeprecation === true) {
|
|
3983
4064
|
return fn;
|
|
3984
4065
|
}
|
|
3985
4066
|
if (typeof process$1 === "undefined") {
|
|
3986
4067
|
return function() {
|
|
3987
|
-
return exports.deprecate(fn, msg).apply(this, arguments);
|
|
4068
|
+
return exports$1.deprecate(fn, msg).apply(this, arguments);
|
|
3988
4069
|
};
|
|
3989
4070
|
}
|
|
3990
4071
|
var warned = false;
|
|
@@ -4010,13 +4091,13 @@ function requireUtil() {
|
|
|
4010
4091
|
debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase();
|
|
4011
4092
|
debugEnvRegex = new RegExp("^" + debugEnv + "$", "i");
|
|
4012
4093
|
}
|
|
4013
|
-
exports.debuglog = function(set) {
|
|
4094
|
+
exports$1.debuglog = function(set) {
|
|
4014
4095
|
set = set.toUpperCase();
|
|
4015
4096
|
if (!debugs[set]) {
|
|
4016
4097
|
if (debugEnvRegex.test(set)) {
|
|
4017
4098
|
var pid = process$1.pid;
|
|
4018
4099
|
debugs[set] = function() {
|
|
4019
|
-
var msg = exports.format.apply(exports, arguments);
|
|
4100
|
+
var msg = exports$1.format.apply(exports$1, arguments);
|
|
4020
4101
|
console.error("%s %d: %s", set, pid, msg);
|
|
4021
4102
|
};
|
|
4022
4103
|
} else {
|
|
@@ -4036,7 +4117,7 @@ function requireUtil() {
|
|
|
4036
4117
|
if (isBoolean(opts)) {
|
|
4037
4118
|
ctx.showHidden = opts;
|
|
4038
4119
|
} else if (opts) {
|
|
4039
|
-
exports._extend(ctx, opts);
|
|
4120
|
+
exports$1._extend(ctx, opts);
|
|
4040
4121
|
}
|
|
4041
4122
|
if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
|
|
4042
4123
|
if (isUndefined(ctx.depth)) ctx.depth = 2;
|
|
@@ -4045,7 +4126,7 @@ function requireUtil() {
|
|
|
4045
4126
|
if (ctx.colors) ctx.stylize = stylizeWithColor;
|
|
4046
4127
|
return formatValue(ctx, obj, ctx.depth);
|
|
4047
4128
|
}
|
|
4048
|
-
exports.inspect = inspect;
|
|
4129
|
+
exports$1.inspect = inspect;
|
|
4049
4130
|
inspect.colors = {
|
|
4050
4131
|
"bold": [1, 22],
|
|
4051
4132
|
"italic": [3, 23],
|
|
@@ -4092,7 +4173,7 @@ function requireUtil() {
|
|
|
4092
4173
|
}
|
|
4093
4174
|
function formatValue(ctx, value, recurseTimes) {
|
|
4094
4175
|
if (ctx.customInspect && value && isFunction(value.inspect) && // Filter out the util module, it's inspect function is special
|
|
4095
|
-
value.inspect !== exports.inspect && // Also filter out any prototype objects using the circular check.
|
|
4176
|
+
value.inspect !== exports$1.inspect && // Also filter out any prototype objects using the circular check.
|
|
4096
4177
|
!(value.constructor && value.constructor.prototype === value)) {
|
|
4097
4178
|
var ret = value.inspect(recurseTimes, ctx);
|
|
4098
4179
|
if (!isString(ret)) {
|
|
@@ -4278,68 +4359,68 @@ function requireUtil() {
|
|
|
4278
4359
|
}
|
|
4279
4360
|
return braces[0] + base + " " + output.join(", ") + " " + braces[1];
|
|
4280
4361
|
}
|
|
4281
|
-
exports.types = requireTypes();
|
|
4362
|
+
exports$1.types = requireTypes();
|
|
4282
4363
|
function isArray(ar) {
|
|
4283
4364
|
return Array.isArray(ar);
|
|
4284
4365
|
}
|
|
4285
|
-
exports.isArray = isArray;
|
|
4366
|
+
exports$1.isArray = isArray;
|
|
4286
4367
|
function isBoolean(arg) {
|
|
4287
4368
|
return typeof arg === "boolean";
|
|
4288
4369
|
}
|
|
4289
|
-
exports.isBoolean = isBoolean;
|
|
4370
|
+
exports$1.isBoolean = isBoolean;
|
|
4290
4371
|
function isNull(arg) {
|
|
4291
4372
|
return arg === null;
|
|
4292
4373
|
}
|
|
4293
|
-
exports.isNull = isNull;
|
|
4374
|
+
exports$1.isNull = isNull;
|
|
4294
4375
|
function isNullOrUndefined(arg) {
|
|
4295
4376
|
return arg == null;
|
|
4296
4377
|
}
|
|
4297
|
-
exports.isNullOrUndefined = isNullOrUndefined;
|
|
4378
|
+
exports$1.isNullOrUndefined = isNullOrUndefined;
|
|
4298
4379
|
function isNumber(arg) {
|
|
4299
4380
|
return typeof arg === "number";
|
|
4300
4381
|
}
|
|
4301
|
-
exports.isNumber = isNumber;
|
|
4382
|
+
exports$1.isNumber = isNumber;
|
|
4302
4383
|
function isString(arg) {
|
|
4303
4384
|
return typeof arg === "string";
|
|
4304
4385
|
}
|
|
4305
|
-
exports.isString = isString;
|
|
4386
|
+
exports$1.isString = isString;
|
|
4306
4387
|
function isSymbol(arg) {
|
|
4307
4388
|
return typeof arg === "symbol";
|
|
4308
4389
|
}
|
|
4309
|
-
exports.isSymbol = isSymbol;
|
|
4390
|
+
exports$1.isSymbol = isSymbol;
|
|
4310
4391
|
function isUndefined(arg) {
|
|
4311
4392
|
return arg === void 0;
|
|
4312
4393
|
}
|
|
4313
|
-
exports.isUndefined = isUndefined;
|
|
4394
|
+
exports$1.isUndefined = isUndefined;
|
|
4314
4395
|
function isRegExp(re) {
|
|
4315
4396
|
return isObject(re) && objectToString(re) === "[object RegExp]";
|
|
4316
4397
|
}
|
|
4317
|
-
exports.isRegExp = isRegExp;
|
|
4318
|
-
exports.types.isRegExp = isRegExp;
|
|
4398
|
+
exports$1.isRegExp = isRegExp;
|
|
4399
|
+
exports$1.types.isRegExp = isRegExp;
|
|
4319
4400
|
function isObject(arg) {
|
|
4320
4401
|
return typeof arg === "object" && arg !== null;
|
|
4321
4402
|
}
|
|
4322
|
-
exports.isObject = isObject;
|
|
4403
|
+
exports$1.isObject = isObject;
|
|
4323
4404
|
function isDate(d) {
|
|
4324
4405
|
return isObject(d) && objectToString(d) === "[object Date]";
|
|
4325
4406
|
}
|
|
4326
|
-
exports.isDate = isDate;
|
|
4327
|
-
exports.types.isDate = isDate;
|
|
4407
|
+
exports$1.isDate = isDate;
|
|
4408
|
+
exports$1.types.isDate = isDate;
|
|
4328
4409
|
function isError(e) {
|
|
4329
4410
|
return isObject(e) && (objectToString(e) === "[object Error]" || e instanceof Error);
|
|
4330
4411
|
}
|
|
4331
|
-
exports.isError = isError;
|
|
4332
|
-
exports.types.isNativeError = isError;
|
|
4412
|
+
exports$1.isError = isError;
|
|
4413
|
+
exports$1.types.isNativeError = isError;
|
|
4333
4414
|
function isFunction(arg) {
|
|
4334
4415
|
return typeof arg === "function";
|
|
4335
4416
|
}
|
|
4336
|
-
exports.isFunction = isFunction;
|
|
4417
|
+
exports$1.isFunction = isFunction;
|
|
4337
4418
|
function isPrimitive(arg) {
|
|
4338
4419
|
return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || // ES6 symbol
|
|
4339
4420
|
typeof arg === "undefined";
|
|
4340
4421
|
}
|
|
4341
|
-
exports.isPrimitive = isPrimitive;
|
|
4342
|
-
exports.isBuffer = requireIsBufferBrowser();
|
|
4422
|
+
exports$1.isPrimitive = isPrimitive;
|
|
4423
|
+
exports$1.isBuffer = requireIsBufferBrowser();
|
|
4343
4424
|
function objectToString(o) {
|
|
4344
4425
|
return Object.prototype.toString.call(o);
|
|
4345
4426
|
}
|
|
@@ -4369,11 +4450,11 @@ function requireUtil() {
|
|
|
4369
4450
|
].join(":");
|
|
4370
4451
|
return [d.getDate(), months[d.getMonth()], time].join(" ");
|
|
4371
4452
|
}
|
|
4372
|
-
exports.log = function() {
|
|
4373
|
-
console.log("%s - %s", timestamp(), exports.format.apply(exports, arguments));
|
|
4453
|
+
exports$1.log = function() {
|
|
4454
|
+
console.log("%s - %s", timestamp(), exports$1.format.apply(exports$1, arguments));
|
|
4374
4455
|
};
|
|
4375
|
-
exports.inherits = requireInherits_browser();
|
|
4376
|
-
exports._extend = function(origin, add) {
|
|
4456
|
+
exports$1.inherits = requireInherits_browser();
|
|
4457
|
+
exports$1._extend = function(origin, add) {
|
|
4377
4458
|
if (!add || !isObject(add)) return origin;
|
|
4378
4459
|
var keys = Object.keys(add);
|
|
4379
4460
|
var i = keys.length;
|
|
@@ -4385,8 +4466,8 @@ function requireUtil() {
|
|
|
4385
4466
|
function hasOwnProperty(obj, prop) {
|
|
4386
4467
|
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
4387
4468
|
}
|
|
4388
|
-
var kCustomPromisifiedSymbol = typeof Symbol !== "undefined" ? Symbol("util.promisify.custom") : void 0;
|
|
4389
|
-
exports.promisify = function promisify(original) {
|
|
4469
|
+
var kCustomPromisifiedSymbol = typeof Symbol !== "undefined" ? /* @__PURE__ */ Symbol("util.promisify.custom") : void 0;
|
|
4470
|
+
exports$1.promisify = function promisify(original) {
|
|
4390
4471
|
if (typeof original !== "function")
|
|
4391
4472
|
throw new TypeError('The "original" argument must be of type Function');
|
|
4392
4473
|
if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {
|
|
@@ -4438,7 +4519,7 @@ function requireUtil() {
|
|
|
4438
4519
|
getOwnPropertyDescriptors(original)
|
|
4439
4520
|
);
|
|
4440
4521
|
};
|
|
4441
|
-
exports.promisify.custom = kCustomPromisifiedSymbol;
|
|
4522
|
+
exports$1.promisify.custom = kCustomPromisifiedSymbol;
|
|
4442
4523
|
function callbackifyOnRejected(reason, cb) {
|
|
4443
4524
|
if (!reason) {
|
|
4444
4525
|
var newReason = new Error("Promise was rejected with a falsy value");
|
|
@@ -4480,7 +4561,7 @@ function requireUtil() {
|
|
|
4480
4561
|
);
|
|
4481
4562
|
return callbackified;
|
|
4482
4563
|
}
|
|
4483
|
-
exports.callbackify = callbackify;
|
|
4564
|
+
exports$1.callbackify = callbackify;
|
|
4484
4565
|
})(util);
|
|
4485
4566
|
return util;
|
|
4486
4567
|
}
|
|
@@ -4493,31 +4574,25 @@ function requireBuffer_list() {
|
|
|
4493
4574
|
var keys = Object.keys(object);
|
|
4494
4575
|
if (Object.getOwnPropertySymbols) {
|
|
4495
4576
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
4496
|
-
|
|
4577
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
4497
4578
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
4498
|
-
});
|
|
4499
|
-
keys.push.apply(keys, symbols);
|
|
4579
|
+
})), keys.push.apply(keys, symbols);
|
|
4500
4580
|
}
|
|
4501
4581
|
return keys;
|
|
4502
4582
|
}
|
|
4503
4583
|
function _objectSpread(target) {
|
|
4504
4584
|
for (var i = 1; i < arguments.length; i++) {
|
|
4505
|
-
var source = arguments[i]
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
}
|
|
4511
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
4512
|
-
} else {
|
|
4513
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
4514
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
4515
|
-
});
|
|
4516
|
-
}
|
|
4585
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
4586
|
+
i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
4587
|
+
_defineProperty(target, key, source[key]);
|
|
4588
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
4589
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
4590
|
+
});
|
|
4517
4591
|
}
|
|
4518
4592
|
return target;
|
|
4519
4593
|
}
|
|
4520
4594
|
function _defineProperty(obj, key, value) {
|
|
4595
|
+
key = _toPropertyKey(key);
|
|
4521
4596
|
if (key in obj) {
|
|
4522
4597
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
4523
4598
|
} else {
|
|
@@ -4536,20 +4611,35 @@ function requireBuffer_list() {
|
|
|
4536
4611
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
4537
4612
|
descriptor.configurable = true;
|
|
4538
4613
|
if ("value" in descriptor) descriptor.writable = true;
|
|
4539
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
4614
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
4540
4615
|
}
|
|
4541
4616
|
}
|
|
4542
4617
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
4543
4618
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
4619
|
+
Object.defineProperty(Constructor, "prototype", { writable: false });
|
|
4544
4620
|
return Constructor;
|
|
4545
4621
|
}
|
|
4622
|
+
function _toPropertyKey(arg) {
|
|
4623
|
+
var key = _toPrimitive(arg, "string");
|
|
4624
|
+
return typeof key === "symbol" ? key : String(key);
|
|
4625
|
+
}
|
|
4626
|
+
function _toPrimitive(input, hint) {
|
|
4627
|
+
if (typeof input !== "object" || input === null) return input;
|
|
4628
|
+
var prim = input[Symbol.toPrimitive];
|
|
4629
|
+
if (prim !== void 0) {
|
|
4630
|
+
var res = prim.call(input, hint);
|
|
4631
|
+
if (typeof res !== "object") return res;
|
|
4632
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
4633
|
+
}
|
|
4634
|
+
return String(input);
|
|
4635
|
+
}
|
|
4546
4636
|
var _require = requireBuffer(), Buffer2 = _require.Buffer;
|
|
4547
4637
|
var _require2 = requireUtil(), inspect = _require2.inspect;
|
|
4548
4638
|
var custom = inspect && inspect.custom || "inspect";
|
|
4549
4639
|
function copyBuffer(src, target, offset) {
|
|
4550
4640
|
Buffer2.prototype.copy.call(src, target, offset);
|
|
4551
4641
|
}
|
|
4552
|
-
buffer_list = /* @__PURE__ */ function() {
|
|
4642
|
+
buffer_list = /* @__PURE__ */ (function() {
|
|
4553
4643
|
function BufferList() {
|
|
4554
4644
|
_classCallCheck(this, BufferList);
|
|
4555
4645
|
this.head = null;
|
|
@@ -4601,9 +4691,7 @@ function requireBuffer_list() {
|
|
|
4601
4691
|
if (this.length === 0) return "";
|
|
4602
4692
|
var p = this.head;
|
|
4603
4693
|
var ret = "" + p.data;
|
|
4604
|
-
while (p = p.next)
|
|
4605
|
-
ret += s + p.data;
|
|
4606
|
-
}
|
|
4694
|
+
while (p = p.next) ret += s + p.data;
|
|
4607
4695
|
return ret;
|
|
4608
4696
|
}
|
|
4609
4697
|
}, {
|
|
@@ -4704,7 +4792,7 @@ function requireBuffer_list() {
|
|
|
4704
4792
|
}, {
|
|
4705
4793
|
key: custom,
|
|
4706
4794
|
value: function value(_, options) {
|
|
4707
|
-
return inspect(this, _objectSpread({}, options, {
|
|
4795
|
+
return inspect(this, _objectSpread(_objectSpread({}, options), {}, {
|
|
4708
4796
|
// Only inspect one level.
|
|
4709
4797
|
depth: 0,
|
|
4710
4798
|
// It should not recurse.
|
|
@@ -4713,7 +4801,7 @@ function requireBuffer_list() {
|
|
|
4713
4801
|
}
|
|
4714
4802
|
}]);
|
|
4715
4803
|
return BufferList;
|
|
4716
|
-
}();
|
|
4804
|
+
})();
|
|
4717
4805
|
return buffer_list;
|
|
4718
4806
|
}
|
|
4719
4807
|
var destroy_1;
|
|
@@ -4827,13 +4915,13 @@ function requireErrorsBrowser() {
|
|
|
4827
4915
|
return message(arg1, arg2, arg3);
|
|
4828
4916
|
}
|
|
4829
4917
|
}
|
|
4830
|
-
var NodeError = /* @__PURE__ */ function(_Base) {
|
|
4918
|
+
var NodeError = /* @__PURE__ */ (function(_Base) {
|
|
4831
4919
|
_inheritsLoose(NodeError2, _Base);
|
|
4832
4920
|
function NodeError2(arg1, arg2, arg3) {
|
|
4833
4921
|
return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
|
|
4834
4922
|
}
|
|
4835
4923
|
return NodeError2;
|
|
4836
|
-
}(Base);
|
|
4924
|
+
})(Base);
|
|
4837
4925
|
NodeError.prototype.name = Base.name;
|
|
4838
4926
|
NodeError.prototype.code = code;
|
|
4839
4927
|
codes[code] = NodeError;
|
|
@@ -4998,7 +5086,7 @@ function require_stream_writable() {
|
|
|
4998
5086
|
};
|
|
4999
5087
|
var Stream = requireStreamBrowser();
|
|
5000
5088
|
var Buffer2 = requireBuffer().Buffer;
|
|
5001
|
-
var OurUint8Array = commonjsGlobal.Uint8Array || function() {
|
|
5089
|
+
var OurUint8Array = (typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
5002
5090
|
};
|
|
5003
5091
|
function _uint8ArrayToBuffer(chunk) {
|
|
5004
5092
|
return Buffer2.from(chunk);
|
|
@@ -5446,9 +5534,7 @@ function require_stream_duplex() {
|
|
|
5446
5534
|
hasRequired_stream_duplex = 1;
|
|
5447
5535
|
var objectKeys = Object.keys || function(obj) {
|
|
5448
5536
|
var keys2 = [];
|
|
5449
|
-
for (var key in obj)
|
|
5450
|
-
keys2.push(key);
|
|
5451
|
-
}
|
|
5537
|
+
for (var key in obj) keys2.push(key);
|
|
5452
5538
|
return keys2;
|
|
5453
5539
|
};
|
|
5454
5540
|
_stream_duplex = Duplex;
|
|
@@ -5537,7 +5623,7 @@ var hasRequiredSafeBuffer;
|
|
|
5537
5623
|
function requireSafeBuffer() {
|
|
5538
5624
|
if (hasRequiredSafeBuffer) return safeBuffer.exports;
|
|
5539
5625
|
hasRequiredSafeBuffer = 1;
|
|
5540
|
-
(function(module, exports) {
|
|
5626
|
+
(function(module, exports$1) {
|
|
5541
5627
|
var buffer2 = requireBuffer();
|
|
5542
5628
|
var Buffer2 = buffer2.Buffer;
|
|
5543
5629
|
function copyProps(src, dst) {
|
|
@@ -5548,8 +5634,8 @@ function requireSafeBuffer() {
|
|
|
5548
5634
|
if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) {
|
|
5549
5635
|
module.exports = buffer2;
|
|
5550
5636
|
} else {
|
|
5551
|
-
copyProps(buffer2, exports);
|
|
5552
|
-
exports.Buffer = SafeBuffer;
|
|
5637
|
+
copyProps(buffer2, exports$1);
|
|
5638
|
+
exports$1.Buffer = SafeBuffer;
|
|
5553
5639
|
}
|
|
5554
5640
|
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
5555
5641
|
return Buffer2(arg, encodingOrOffset, length);
|
|
@@ -5925,6 +6011,7 @@ function requireAsync_iterator() {
|
|
|
5925
6011
|
hasRequiredAsync_iterator = 1;
|
|
5926
6012
|
var _Object$setPrototypeO;
|
|
5927
6013
|
function _defineProperty(obj, key, value) {
|
|
6014
|
+
key = _toPropertyKey(key);
|
|
5928
6015
|
if (key in obj) {
|
|
5929
6016
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
5930
6017
|
} else {
|
|
@@ -5932,14 +6019,28 @@ function requireAsync_iterator() {
|
|
|
5932
6019
|
}
|
|
5933
6020
|
return obj;
|
|
5934
6021
|
}
|
|
6022
|
+
function _toPropertyKey(arg) {
|
|
6023
|
+
var key = _toPrimitive(arg, "string");
|
|
6024
|
+
return typeof key === "symbol" ? key : String(key);
|
|
6025
|
+
}
|
|
6026
|
+
function _toPrimitive(input, hint) {
|
|
6027
|
+
if (typeof input !== "object" || input === null) return input;
|
|
6028
|
+
var prim = input[Symbol.toPrimitive];
|
|
6029
|
+
if (prim !== void 0) {
|
|
6030
|
+
var res = prim.call(input, hint);
|
|
6031
|
+
if (typeof res !== "object") return res;
|
|
6032
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
6033
|
+
}
|
|
6034
|
+
return (hint === "string" ? String : Number)(input);
|
|
6035
|
+
}
|
|
5935
6036
|
var finished = requireEndOfStream();
|
|
5936
|
-
var kLastResolve = Symbol("lastResolve");
|
|
5937
|
-
var kLastReject = Symbol("lastReject");
|
|
5938
|
-
var kError = Symbol("error");
|
|
5939
|
-
var kEnded = Symbol("ended");
|
|
5940
|
-
var kLastPromise = Symbol("lastPromise");
|
|
5941
|
-
var kHandlePromise = Symbol("handlePromise");
|
|
5942
|
-
var kStream = Symbol("stream");
|
|
6037
|
+
var kLastResolve = /* @__PURE__ */ Symbol("lastResolve");
|
|
6038
|
+
var kLastReject = /* @__PURE__ */ Symbol("lastReject");
|
|
6039
|
+
var kError = /* @__PURE__ */ Symbol("error");
|
|
6040
|
+
var kEnded = /* @__PURE__ */ Symbol("ended");
|
|
6041
|
+
var kLastPromise = /* @__PURE__ */ Symbol("lastPromise");
|
|
6042
|
+
var kHandlePromise = /* @__PURE__ */ Symbol("handlePromise");
|
|
6043
|
+
var kStream = /* @__PURE__ */ Symbol("stream");
|
|
5943
6044
|
function createIterResult(value, done) {
|
|
5944
6045
|
return {
|
|
5945
6046
|
value,
|
|
@@ -6110,7 +6211,7 @@ function require_stream_readable() {
|
|
|
6110
6211
|
};
|
|
6111
6212
|
var Stream = requireStreamBrowser();
|
|
6112
6213
|
var Buffer2 = requireBuffer().Buffer;
|
|
6113
|
-
var OurUint8Array = commonjsGlobal.Uint8Array || function() {
|
|
6214
|
+
var OurUint8Array = (typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
6114
6215
|
};
|
|
6115
6216
|
function _uint8ArrayToBuffer(chunk) {
|
|
6116
6217
|
return Buffer2.from(chunk);
|
|
@@ -6575,11 +6676,9 @@ function require_stream_readable() {
|
|
|
6575
6676
|
state2.pipes = null;
|
|
6576
6677
|
state2.pipesCount = 0;
|
|
6577
6678
|
state2.flowing = false;
|
|
6578
|
-
for (var i = 0; i < len; i++) {
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
});
|
|
6582
|
-
}
|
|
6679
|
+
for (var i = 0; i < len; i++) dests[i].emit("unpipe", this, {
|
|
6680
|
+
hasUnpiped: false
|
|
6681
|
+
});
|
|
6583
6682
|
return this;
|
|
6584
6683
|
}
|
|
6585
6684
|
var index = indexOf(state2.pipes, dest);
|
|
@@ -6678,8 +6777,7 @@ function require_stream_readable() {
|
|
|
6678
6777
|
function flow(stream) {
|
|
6679
6778
|
var state2 = stream._readableState;
|
|
6680
6779
|
debug("flow", state2.flowing);
|
|
6681
|
-
while (state2.flowing && stream.read() !== null)
|
|
6682
|
-
}
|
|
6780
|
+
while (state2.flowing && stream.read() !== null) ;
|
|
6683
6781
|
}
|
|
6684
6782
|
Readable.prototype.wrap = function(stream) {
|
|
6685
6783
|
var _this = this;
|
|
@@ -6706,11 +6804,11 @@ function require_stream_readable() {
|
|
|
6706
6804
|
});
|
|
6707
6805
|
for (var i in stream) {
|
|
6708
6806
|
if (this[i] === void 0 && typeof stream[i] === "function") {
|
|
6709
|
-
this[i] = /* @__PURE__ */ function methodWrap(method) {
|
|
6807
|
+
this[i] = /* @__PURE__ */ (function methodWrap(method) {
|
|
6710
6808
|
return function methodWrapReturnFunction() {
|
|
6711
6809
|
return stream[method].apply(stream, arguments);
|
|
6712
6810
|
};
|
|
6713
|
-
}(i);
|
|
6811
|
+
})(i);
|
|
6714
6812
|
}
|
|
6715
6813
|
}
|
|
6716
6814
|
for (var n = 0; n < kProxyEvents.length; n++) {
|
|
@@ -7106,7 +7204,7 @@ var hasRequiredSax;
|
|
|
7106
7204
|
function requireSax() {
|
|
7107
7205
|
if (hasRequiredSax) return sax;
|
|
7108
7206
|
hasRequiredSax = 1;
|
|
7109
|
-
(function(exports) {
|
|
7207
|
+
(function(exports$1) {
|
|
7110
7208
|
(function(sax2) {
|
|
7111
7209
|
sax2.parser = function(strict, opt) {
|
|
7112
7210
|
return new SAXParser(strict, opt);
|
|
@@ -8483,7 +8581,6 @@ function requireSax() {
|
|
|
8483
8581
|
}
|
|
8484
8582
|
return parser;
|
|
8485
8583
|
}
|
|
8486
|
-
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
|
|
8487
8584
|
if (!String.fromCodePoint) {
|
|
8488
8585
|
(function() {
|
|
8489
8586
|
var stringFromCharCode = String.fromCharCode;
|
|
@@ -8533,7 +8630,7 @@ function requireSax() {
|
|
|
8533
8630
|
}
|
|
8534
8631
|
})();
|
|
8535
8632
|
}
|
|
8536
|
-
})(exports);
|
|
8633
|
+
})(exports$1);
|
|
8537
8634
|
})(sax);
|
|
8538
8635
|
return sax;
|
|
8539
8636
|
}
|
|
@@ -9353,18 +9450,30 @@ class ImportedXmlComponentAttributes extends XmlAttributeComponent {
|
|
|
9353
9450
|
}
|
|
9354
9451
|
class ImportedXmlComponent extends XmlComponent {
|
|
9355
9452
|
/**
|
|
9356
|
-
*
|
|
9453
|
+
* Parses an XML string and converts it to an ImportedXmlComponent tree.
|
|
9454
|
+
*
|
|
9455
|
+
* This static method is the primary way to import external XML content.
|
|
9456
|
+
* It uses xml-js to parse the XML string into a JSON representation,
|
|
9457
|
+
* then converts that into a tree of XmlComponent objects.
|
|
9357
9458
|
*
|
|
9358
|
-
* @param importedContent
|
|
9459
|
+
* @param importedContent - The XML content as a string
|
|
9460
|
+
* @returns An ImportedXmlComponent representing the parsed XML
|
|
9461
|
+
*
|
|
9462
|
+
* @example
|
|
9463
|
+
* ```typescript
|
|
9464
|
+
* const xml = '<w:p><w:r><w:t>Hello</w:t></w:r></w:p>';
|
|
9465
|
+
* const component = ImportedXmlComponent.fromXmlString(xml);
|
|
9466
|
+
* ```
|
|
9359
9467
|
*/
|
|
9360
9468
|
static fromXmlString(importedContent) {
|
|
9361
9469
|
const xmlObj = libExports.xml2js(importedContent, { compact: false });
|
|
9362
9470
|
return convertToXmlComponent(xmlObj);
|
|
9363
9471
|
}
|
|
9364
9472
|
/**
|
|
9365
|
-
*
|
|
9473
|
+
* Creates an ImportedXmlComponent.
|
|
9366
9474
|
*
|
|
9367
|
-
* @param
|
|
9475
|
+
* @param rootKey - The XML element name
|
|
9476
|
+
* @param _attr - Optional attributes for the root element
|
|
9368
9477
|
*/
|
|
9369
9478
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9370
9479
|
constructor(rootKey, _attr) {
|
|
@@ -9373,16 +9482,32 @@ class ImportedXmlComponent extends XmlComponent {
|
|
|
9373
9482
|
this.root.push(new ImportedXmlComponentAttributes(_attr));
|
|
9374
9483
|
}
|
|
9375
9484
|
}
|
|
9485
|
+
/**
|
|
9486
|
+
* Adds a child component or text to this element.
|
|
9487
|
+
*
|
|
9488
|
+
* @param xmlComponent - The child component or text string to add
|
|
9489
|
+
*/
|
|
9376
9490
|
push(xmlComponent) {
|
|
9377
9491
|
this.root.push(xmlComponent);
|
|
9378
9492
|
}
|
|
9379
9493
|
}
|
|
9380
9494
|
class ImportedRootElementAttributes extends XmlComponent {
|
|
9495
|
+
/**
|
|
9496
|
+
* Creates an ImportedRootElementAttributes component.
|
|
9497
|
+
*
|
|
9498
|
+
* @param _attr - The attributes object to pass through
|
|
9499
|
+
*/
|
|
9381
9500
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9382
9501
|
constructor(_attr) {
|
|
9383
9502
|
super("");
|
|
9384
9503
|
this._attr = _attr;
|
|
9385
9504
|
}
|
|
9505
|
+
/**
|
|
9506
|
+
* Prepares the attributes for XML serialization.
|
|
9507
|
+
*
|
|
9508
|
+
* @param _ - Context (unused)
|
|
9509
|
+
* @returns Object with _attr key containing the raw attributes
|
|
9510
|
+
*/
|
|
9386
9511
|
prepForXml(_) {
|
|
9387
9512
|
return {
|
|
9388
9513
|
_attr: this._attr
|
|
@@ -9391,6 +9516,12 @@ class ImportedRootElementAttributes extends XmlComponent {
|
|
|
9391
9516
|
}
|
|
9392
9517
|
const WORKAROUND3 = "";
|
|
9393
9518
|
class InitializableXmlComponent extends XmlComponent {
|
|
9519
|
+
/**
|
|
9520
|
+
* Creates a new InitializableXmlComponent.
|
|
9521
|
+
*
|
|
9522
|
+
* @param rootKey - The XML element name
|
|
9523
|
+
* @param initComponent - Optional component to copy children from
|
|
9524
|
+
*/
|
|
9394
9525
|
constructor(rootKey, initComponent) {
|
|
9395
9526
|
super(rootKey);
|
|
9396
9527
|
if (initComponent) {
|
|
@@ -9461,6 +9592,12 @@ const eighthPointMeasureValue = unsignedDecimalNumber;
|
|
|
9461
9592
|
const pointMeasureValue = unsignedDecimalNumber;
|
|
9462
9593
|
const dateTimeValue = (val) => val.toISOString();
|
|
9463
9594
|
class OnOffElement extends XmlComponent {
|
|
9595
|
+
/**
|
|
9596
|
+
* Creates an OnOffElement.
|
|
9597
|
+
*
|
|
9598
|
+
* @param name - The XML element name (e.g., "w:b", "w:i")
|
|
9599
|
+
* @param val - The boolean value (defaults to true)
|
|
9600
|
+
*/
|
|
9464
9601
|
constructor(name, val = true) {
|
|
9465
9602
|
super(name);
|
|
9466
9603
|
if (val !== true) {
|
|
@@ -9469,6 +9606,12 @@ class OnOffElement extends XmlComponent {
|
|
|
9469
9606
|
}
|
|
9470
9607
|
}
|
|
9471
9608
|
class HpsMeasureElement extends XmlComponent {
|
|
9609
|
+
/**
|
|
9610
|
+
* Creates an HpsMeasureElement.
|
|
9611
|
+
*
|
|
9612
|
+
* @param name - The XML element name
|
|
9613
|
+
* @param val - The measurement value (number in half-points or string with units)
|
|
9614
|
+
*/
|
|
9472
9615
|
constructor(name, val) {
|
|
9473
9616
|
super(name);
|
|
9474
9617
|
this.root.push(new Attributes({ val: hpsMeasureValue(val) }));
|
|
@@ -9477,6 +9620,12 @@ class HpsMeasureElement extends XmlComponent {
|
|
|
9477
9620
|
class EmptyElement extends XmlComponent {
|
|
9478
9621
|
}
|
|
9479
9622
|
class StringValueElement extends XmlComponent {
|
|
9623
|
+
/**
|
|
9624
|
+
* Creates a StringValueElement.
|
|
9625
|
+
*
|
|
9626
|
+
* @param name - The XML element name
|
|
9627
|
+
* @param val - The string value
|
|
9628
|
+
*/
|
|
9480
9629
|
constructor(name, val) {
|
|
9481
9630
|
super(name);
|
|
9482
9631
|
this.root.push(new Attributes({ val }));
|
|
@@ -9489,24 +9638,50 @@ const createStringElement = (name, value) => new BuilderElement({
|
|
|
9489
9638
|
}
|
|
9490
9639
|
});
|
|
9491
9640
|
class NumberValueElement extends XmlComponent {
|
|
9641
|
+
/**
|
|
9642
|
+
* Creates a NumberValueElement.
|
|
9643
|
+
*
|
|
9644
|
+
* @param name - The XML element name
|
|
9645
|
+
* @param val - The numeric value
|
|
9646
|
+
*/
|
|
9492
9647
|
constructor(name, val) {
|
|
9493
9648
|
super(name);
|
|
9494
9649
|
this.root.push(new Attributes({ val }));
|
|
9495
9650
|
}
|
|
9496
9651
|
}
|
|
9497
9652
|
class StringEnumValueElement extends XmlComponent {
|
|
9653
|
+
/**
|
|
9654
|
+
* Creates a StringEnumValueElement.
|
|
9655
|
+
*
|
|
9656
|
+
* @param name - The XML element name
|
|
9657
|
+
* @param val - The enum value
|
|
9658
|
+
*/
|
|
9498
9659
|
constructor(name, val) {
|
|
9499
9660
|
super(name);
|
|
9500
9661
|
this.root.push(new Attributes({ val }));
|
|
9501
9662
|
}
|
|
9502
9663
|
}
|
|
9503
9664
|
class StringContainer extends XmlComponent {
|
|
9665
|
+
/**
|
|
9666
|
+
* Creates a StringContainer.
|
|
9667
|
+
*
|
|
9668
|
+
* @param name - The XML element name
|
|
9669
|
+
* @param val - The text content
|
|
9670
|
+
*/
|
|
9504
9671
|
constructor(name, val) {
|
|
9505
9672
|
super(name);
|
|
9506
9673
|
this.root.push(val);
|
|
9507
9674
|
}
|
|
9508
9675
|
}
|
|
9509
9676
|
class BuilderElement extends XmlComponent {
|
|
9677
|
+
/**
|
|
9678
|
+
* Creates a BuilderElement with the specified configuration.
|
|
9679
|
+
*
|
|
9680
|
+
* @param config - Element configuration
|
|
9681
|
+
* @param config.name - The XML element name
|
|
9682
|
+
* @param config.attributes - Optional attributes with explicit key-value pairs
|
|
9683
|
+
* @param config.children - Optional child elements
|
|
9684
|
+
*/
|
|
9510
9685
|
constructor({
|
|
9511
9686
|
name,
|
|
9512
9687
|
attributes,
|
|
@@ -9656,6 +9831,9 @@ class Border extends IgnoreIfEmptyXmlComponent {
|
|
|
9656
9831
|
if (options.right) {
|
|
9657
9832
|
this.root.push(new BorderElement("w:right", options.right));
|
|
9658
9833
|
}
|
|
9834
|
+
if (options.between) {
|
|
9835
|
+
this.root.push(new BorderElement("w:between", options.between));
|
|
9836
|
+
}
|
|
9659
9837
|
}
|
|
9660
9838
|
}
|
|
9661
9839
|
class ThematicBreak extends XmlComponent {
|
|
@@ -9738,17 +9916,27 @@ class End extends XmlComponent {
|
|
|
9738
9916
|
}
|
|
9739
9917
|
}
|
|
9740
9918
|
const HorizontalPositionAlign = {
|
|
9919
|
+
/** Center horizontally */
|
|
9741
9920
|
CENTER: "center",
|
|
9921
|
+
/** Align to inside margin (left on odd, right on even pages) */
|
|
9742
9922
|
INSIDE: "inside",
|
|
9923
|
+
/** Align to left */
|
|
9743
9924
|
LEFT: "left",
|
|
9925
|
+
/** Align to outside margin (right on odd, left on even pages) */
|
|
9744
9926
|
OUTSIDE: "outside",
|
|
9927
|
+
/** Align to right */
|
|
9745
9928
|
RIGHT: "right"
|
|
9746
9929
|
};
|
|
9747
9930
|
const VerticalPositionAlign = {
|
|
9931
|
+
/** Align to bottom */
|
|
9748
9932
|
BOTTOM: "bottom",
|
|
9933
|
+
/** Center vertically */
|
|
9749
9934
|
CENTER: "center",
|
|
9935
|
+
/** Align to inside margin */
|
|
9750
9936
|
INSIDE: "inside",
|
|
9937
|
+
/** Align to outside margin */
|
|
9751
9938
|
OUTSIDE: "outside",
|
|
9939
|
+
/** Align to top */
|
|
9752
9940
|
TOP: "top"
|
|
9753
9941
|
};
|
|
9754
9942
|
const NumberFormat$1 = {
|
|
@@ -9877,6 +10065,7 @@ class Shading extends XmlComponent {
|
|
|
9877
10065
|
}
|
|
9878
10066
|
}
|
|
9879
10067
|
const ShadingType = {
|
|
10068
|
+
/** Clear shading - no pattern, fill color only */
|
|
9880
10069
|
CLEAR: "clear",
|
|
9881
10070
|
DIAGONAL_CROSS: "diagCross",
|
|
9882
10071
|
DIAGONAL_STRIPE: "diagStripe",
|
|
@@ -9926,6 +10115,7 @@ class ChangeAttributes extends XmlAttributeComponent {
|
|
|
9926
10115
|
}
|
|
9927
10116
|
}
|
|
9928
10117
|
const EmphasisMarkType = {
|
|
10118
|
+
/** Dot emphasis mark */
|
|
9929
10119
|
DOT: "dot"
|
|
9930
10120
|
};
|
|
9931
10121
|
class BaseEmphasisMark extends XmlComponent {
|
|
@@ -10058,23 +10248,41 @@ class SubScript extends VerticalAlign$1 {
|
|
|
10058
10248
|
}
|
|
10059
10249
|
}
|
|
10060
10250
|
const UnderlineType = {
|
|
10251
|
+
/** Single underline */
|
|
10061
10252
|
SINGLE: "single",
|
|
10253
|
+
/** Underline words only (not spaces) */
|
|
10062
10254
|
WORDS: "words",
|
|
10255
|
+
/** Double underline */
|
|
10063
10256
|
DOUBLE: "double",
|
|
10257
|
+
/** Thick single underline */
|
|
10064
10258
|
THICK: "thick",
|
|
10259
|
+
/** Dotted underline */
|
|
10065
10260
|
DOTTED: "dotted",
|
|
10261
|
+
/** Heavy dotted underline */
|
|
10066
10262
|
DOTTEDHEAVY: "dottedHeavy",
|
|
10263
|
+
/** Dashed underline */
|
|
10067
10264
|
DASH: "dash",
|
|
10265
|
+
/** Heavy dashed underline */
|
|
10068
10266
|
DASHEDHEAVY: "dashedHeavy",
|
|
10267
|
+
/** Long dashed underline */
|
|
10069
10268
|
DASHLONG: "dashLong",
|
|
10269
|
+
/** Heavy long dashed underline */
|
|
10070
10270
|
DASHLONGHEAVY: "dashLongHeavy",
|
|
10271
|
+
/** Dot-dash underline */
|
|
10071
10272
|
DOTDASH: "dotDash",
|
|
10273
|
+
/** Heavy dot-dash underline */
|
|
10072
10274
|
DASHDOTHEAVY: "dashDotHeavy",
|
|
10275
|
+
/** Dot-dot-dash underline */
|
|
10073
10276
|
DOTDOTDASH: "dotDotDash",
|
|
10277
|
+
/** Heavy dot-dot-dash underline */
|
|
10074
10278
|
DASHDOTDOTHEAVY: "dashDotDotHeavy",
|
|
10279
|
+
/** Wave underline */
|
|
10075
10280
|
WAVE: "wave",
|
|
10281
|
+
/** Heavy wave underline */
|
|
10076
10282
|
WAVYHEAVY: "wavyHeavy",
|
|
10283
|
+
/** Double wave underline */
|
|
10077
10284
|
WAVYDOUBLE: "wavyDouble",
|
|
10285
|
+
/** No underline */
|
|
10078
10286
|
NONE: "none"
|
|
10079
10287
|
};
|
|
10080
10288
|
class Underline extends XmlComponent {
|
|
@@ -10089,31 +10297,55 @@ class Underline extends XmlComponent {
|
|
|
10089
10297
|
}
|
|
10090
10298
|
}
|
|
10091
10299
|
const TextEffect = {
|
|
10300
|
+
/** Blinking background animation */
|
|
10092
10301
|
BLINK_BACKGROUND: "blinkBackground",
|
|
10302
|
+
/** Lights animation effect */
|
|
10093
10303
|
LIGHTS: "lights",
|
|
10304
|
+
/** Black marching ants animation */
|
|
10094
10305
|
ANTS_BLACK: "antsBlack",
|
|
10306
|
+
/** Red marching ants animation */
|
|
10095
10307
|
ANTS_RED: "antsRed",
|
|
10308
|
+
/** Shimmer animation effect */
|
|
10096
10309
|
SHIMMER: "shimmer",
|
|
10310
|
+
/** Sparkle animation effect */
|
|
10097
10311
|
SPARKLE: "sparkle",
|
|
10312
|
+
/** No text effect */
|
|
10098
10313
|
NONE: "none"
|
|
10099
10314
|
};
|
|
10100
10315
|
const HighlightColor = {
|
|
10316
|
+
/** Black highlight */
|
|
10101
10317
|
BLACK: "black",
|
|
10318
|
+
/** Blue highlight */
|
|
10102
10319
|
BLUE: "blue",
|
|
10320
|
+
/** Cyan highlight */
|
|
10103
10321
|
CYAN: "cyan",
|
|
10322
|
+
/** Dark blue highlight */
|
|
10104
10323
|
DARK_BLUE: "darkBlue",
|
|
10324
|
+
/** Dark cyan highlight */
|
|
10105
10325
|
DARK_CYAN: "darkCyan",
|
|
10326
|
+
/** Dark gray highlight */
|
|
10106
10327
|
DARK_GRAY: "darkGray",
|
|
10328
|
+
/** Dark green highlight */
|
|
10107
10329
|
DARK_GREEN: "darkGreen",
|
|
10330
|
+
/** Dark magenta highlight */
|
|
10108
10331
|
DARK_MAGENTA: "darkMagenta",
|
|
10332
|
+
/** Dark red highlight */
|
|
10109
10333
|
DARK_RED: "darkRed",
|
|
10334
|
+
/** Dark yellow highlight */
|
|
10110
10335
|
DARK_YELLOW: "darkYellow",
|
|
10336
|
+
/** Green highlight */
|
|
10111
10337
|
GREEN: "green",
|
|
10338
|
+
/** Light gray highlight */
|
|
10112
10339
|
LIGHT_GRAY: "lightGray",
|
|
10340
|
+
/** Magenta highlight */
|
|
10113
10341
|
MAGENTA: "magenta",
|
|
10342
|
+
/** No highlight */
|
|
10114
10343
|
NONE: "none",
|
|
10344
|
+
/** Red highlight */
|
|
10115
10345
|
RED: "red",
|
|
10346
|
+
/** White highlight */
|
|
10116
10347
|
WHITE: "white",
|
|
10348
|
+
/** Yellow highlight */
|
|
10117
10349
|
YELLOW: "yellow"
|
|
10118
10350
|
};
|
|
10119
10351
|
class RunProperties extends IgnoreIfEmptyXmlComponent {
|
|
@@ -10270,9 +10502,13 @@ class Text extends XmlComponent {
|
|
|
10270
10502
|
}
|
|
10271
10503
|
}
|
|
10272
10504
|
const PageNumber = {
|
|
10505
|
+
/** Inserts the current page number */
|
|
10273
10506
|
CURRENT: "CURRENT",
|
|
10507
|
+
/** Inserts the total number of pages in the document */
|
|
10274
10508
|
TOTAL_PAGES: "TOTAL_PAGES",
|
|
10509
|
+
/** Inserts the total number of pages in the current section */
|
|
10275
10510
|
TOTAL_PAGES_IN_SECTION: "TOTAL_PAGES_IN_SECTION",
|
|
10511
|
+
/** Inserts the current section number */
|
|
10276
10512
|
CURRENT_SECTION: "SECTION"
|
|
10277
10513
|
};
|
|
10278
10514
|
class Run extends XmlComponent {
|
|
@@ -11986,8 +12222,8 @@ var hasRequiredHash;
|
|
|
11986
12222
|
function requireHash() {
|
|
11987
12223
|
if (hasRequiredHash) return hash$1;
|
|
11988
12224
|
hasRequiredHash = 1;
|
|
11989
|
-
(function(exports) {
|
|
11990
|
-
var hash2 = exports;
|
|
12225
|
+
(function(exports$1) {
|
|
12226
|
+
var hash2 = exports$1;
|
|
11991
12227
|
hash2.utils = requireUtils();
|
|
11992
12228
|
hash2.common = requireCommon$1();
|
|
11993
12229
|
hash2.sha = requireSha();
|
|
@@ -12586,9 +12822,13 @@ const TextWrappingType = {
|
|
|
12586
12822
|
TOP_AND_BOTTOM: 3
|
|
12587
12823
|
};
|
|
12588
12824
|
const TextWrappingSide = {
|
|
12825
|
+
/** Text wraps on both sides of the drawing */
|
|
12589
12826
|
BOTH_SIDES: "bothSides",
|
|
12827
|
+
/** Text wraps only on the left side */
|
|
12590
12828
|
LEFT: "left",
|
|
12829
|
+
/** Text wraps only on the right side */
|
|
12591
12830
|
RIGHT: "right",
|
|
12831
|
+
/** Text wraps on the side with more space */
|
|
12592
12832
|
LARGEST: "largest"
|
|
12593
12833
|
};
|
|
12594
12834
|
class WrapNone extends XmlComponent {
|
|
@@ -12896,17 +13136,12 @@ class Drawing extends XmlComponent {
|
|
|
12896
13136
|
}
|
|
12897
13137
|
}
|
|
12898
13138
|
const convertDataURIToBinary = (dataURI) => {
|
|
12899
|
-
|
|
12900
|
-
|
|
12901
|
-
|
|
12902
|
-
|
|
12903
|
-
|
|
12904
|
-
|
|
12905
|
-
);
|
|
12906
|
-
} else {
|
|
12907
|
-
const b = require("buffer");
|
|
12908
|
-
return new b.Buffer(dataURI, "base64");
|
|
12909
|
-
}
|
|
13139
|
+
const BASE64_MARKER = ";base64,";
|
|
13140
|
+
const base64Index = dataURI.indexOf(BASE64_MARKER);
|
|
13141
|
+
const base64IndexWithOffset = base64Index === -1 ? 0 : base64Index + BASE64_MARKER.length;
|
|
13142
|
+
return new Uint8Array(
|
|
13143
|
+
atob(dataURI.substring(base64IndexWithOffset)).split("").map((c) => c.charCodeAt(0))
|
|
13144
|
+
);
|
|
12910
13145
|
};
|
|
12911
13146
|
const standardizeData = (data) => typeof data === "string" ? convertDataURIToBinary(data) : data;
|
|
12912
13147
|
const createImageData = (options, key) => ({
|
|
@@ -13016,6 +13251,7 @@ class RelationshipAttributes extends XmlAttributeComponent {
|
|
|
13016
13251
|
}
|
|
13017
13252
|
}
|
|
13018
13253
|
const TargetModeType = {
|
|
13254
|
+
/** Target is external to the package (e.g., hyperlink to a URL) */
|
|
13019
13255
|
EXTERNAL: "External"
|
|
13020
13256
|
};
|
|
13021
13257
|
class Relationship extends XmlComponent {
|
|
@@ -13040,11 +13276,24 @@ class Relationships extends XmlComponent {
|
|
|
13040
13276
|
})
|
|
13041
13277
|
);
|
|
13042
13278
|
}
|
|
13279
|
+
/**
|
|
13280
|
+
* Creates a new relationship to another part in the package.
|
|
13281
|
+
*
|
|
13282
|
+
* @param id - Unique identifier for this relationship (will be prefixed with "rId")
|
|
13283
|
+
* @param type - Relationship type URI (e.g., image, header, hyperlink)
|
|
13284
|
+
* @param target - Path to the target part
|
|
13285
|
+
* @param targetMode - Optional mode indicating if target is external
|
|
13286
|
+
* @returns The created Relationship instance
|
|
13287
|
+
*/
|
|
13043
13288
|
createRelationship(id, type2, target, targetMode) {
|
|
13044
13289
|
const relationship = new Relationship(`rId${id}`, type2, target, targetMode);
|
|
13045
13290
|
this.root.push(relationship);
|
|
13046
13291
|
return relationship;
|
|
13047
13292
|
}
|
|
13293
|
+
/**
|
|
13294
|
+
* Gets the count of relationships in this collection.
|
|
13295
|
+
* Excludes the attributes element from the count.
|
|
13296
|
+
*/
|
|
13048
13297
|
get RelationshipCount() {
|
|
13049
13298
|
return this.root.length - 1;
|
|
13050
13299
|
}
|
|
@@ -13267,19 +13516,29 @@ class LastRenderedPageBreak extends EmptyElement {
|
|
|
13267
13516
|
}
|
|
13268
13517
|
}
|
|
13269
13518
|
const PositionalTabAlignment = {
|
|
13519
|
+
/** Left-aligned tab */
|
|
13270
13520
|
LEFT: "left",
|
|
13521
|
+
/** Center-aligned tab */
|
|
13271
13522
|
CENTER: "center",
|
|
13523
|
+
/** Right-aligned tab */
|
|
13272
13524
|
RIGHT: "right"
|
|
13273
13525
|
};
|
|
13274
13526
|
const PositionalTabRelativeTo = {
|
|
13527
|
+
/** Position relative to margin */
|
|
13275
13528
|
MARGIN: "margin",
|
|
13529
|
+
/** Position relative to indent */
|
|
13276
13530
|
INDENT: "indent"
|
|
13277
13531
|
};
|
|
13278
13532
|
const PositionalTabLeader = {
|
|
13533
|
+
/** No leader character */
|
|
13279
13534
|
NONE: "none",
|
|
13535
|
+
/** Dot leader (...) */
|
|
13280
13536
|
DOT: "dot",
|
|
13537
|
+
/** Hyphen leader (---) */
|
|
13281
13538
|
HYPHEN: "hyphen",
|
|
13539
|
+
/** Underscore leader (___) */
|
|
13282
13540
|
UNDERSCORE: "underscore",
|
|
13541
|
+
/** Middle dot leader (···) */
|
|
13283
13542
|
MIDDLE_DOT: "middleDot"
|
|
13284
13543
|
};
|
|
13285
13544
|
class PositionalTab extends XmlComponent {
|
|
@@ -13304,7 +13563,9 @@ class PositionalTab extends XmlComponent {
|
|
|
13304
13563
|
}
|
|
13305
13564
|
}
|
|
13306
13565
|
const BreakType = {
|
|
13566
|
+
/** Column break - text continues at the beginning of the next column */
|
|
13307
13567
|
COLUMN: "column",
|
|
13568
|
+
/** Page break - text continues at the beginning of the next page */
|
|
13308
13569
|
PAGE: "page"
|
|
13309
13570
|
// textWrapping breaks are the default and already exposed via the "Run" class
|
|
13310
13571
|
};
|
|
@@ -13336,9 +13597,13 @@ class PageBreakBefore extends XmlComponent {
|
|
|
13336
13597
|
}
|
|
13337
13598
|
}
|
|
13338
13599
|
const LineRuleType = {
|
|
13600
|
+
/** Line spacing is at least the specified value */
|
|
13339
13601
|
AT_LEAST: "atLeast",
|
|
13602
|
+
/** Line spacing is exactly the specified value */
|
|
13340
13603
|
EXACTLY: "exactly",
|
|
13604
|
+
/** Line spacing is exactly the specified value (alias for EXACTLY) */
|
|
13341
13605
|
EXACT: "exact",
|
|
13606
|
+
/** Line spacing is automatically determined based on content */
|
|
13342
13607
|
AUTO: "auto"
|
|
13343
13608
|
};
|
|
13344
13609
|
class SpacingAttributes extends XmlAttributeComponent {
|
|
@@ -13361,12 +13626,19 @@ class Spacing extends XmlComponent {
|
|
|
13361
13626
|
}
|
|
13362
13627
|
}
|
|
13363
13628
|
const HeadingLevel = {
|
|
13629
|
+
/** Heading 1 style */
|
|
13364
13630
|
HEADING_1: "Heading1",
|
|
13631
|
+
/** Heading 2 style */
|
|
13365
13632
|
HEADING_2: "Heading2",
|
|
13633
|
+
/** Heading 3 style */
|
|
13366
13634
|
HEADING_3: "Heading3",
|
|
13635
|
+
/** Heading 4 style */
|
|
13367
13636
|
HEADING_4: "Heading4",
|
|
13637
|
+
/** Heading 5 style */
|
|
13368
13638
|
HEADING_5: "Heading5",
|
|
13639
|
+
/** Heading 6 style */
|
|
13369
13640
|
HEADING_6: "Heading6",
|
|
13641
|
+
/** Title style */
|
|
13370
13642
|
TITLE: "Title"
|
|
13371
13643
|
};
|
|
13372
13644
|
let Style$1 = class Style extends XmlComponent {
|
|
@@ -13388,24 +13660,39 @@ class TabStop extends XmlComponent {
|
|
|
13388
13660
|
}
|
|
13389
13661
|
}
|
|
13390
13662
|
const TabStopType = {
|
|
13663
|
+
/** Left-aligned tab stop */
|
|
13391
13664
|
LEFT: "left",
|
|
13665
|
+
/** Right-aligned tab stop */
|
|
13392
13666
|
RIGHT: "right",
|
|
13667
|
+
/** Center-aligned tab stop */
|
|
13393
13668
|
CENTER: "center",
|
|
13669
|
+
/** Bar tab stop - inserts a vertical bar at the position */
|
|
13394
13670
|
BAR: "bar",
|
|
13671
|
+
/** Clears a tab stop at the specified position */
|
|
13395
13672
|
CLEAR: "clear",
|
|
13673
|
+
/** Decimal-aligned tab stop - aligns on decimal point */
|
|
13396
13674
|
DECIMAL: "decimal",
|
|
13675
|
+
/** End-aligned tab stop (right-to-left equivalent) */
|
|
13397
13676
|
END: "end",
|
|
13677
|
+
/** List tab stop for numbered lists */
|
|
13398
13678
|
NUM: "num",
|
|
13679
|
+
/** Start-aligned tab stop (left-to-right equivalent) */
|
|
13399
13680
|
START: "start"
|
|
13400
13681
|
};
|
|
13401
13682
|
const LeaderType = {
|
|
13683
|
+
/** Dot leader (....) */
|
|
13402
13684
|
DOT: "dot",
|
|
13685
|
+
/** Hyphen leader (----) */
|
|
13403
13686
|
HYPHEN: "hyphen",
|
|
13687
|
+
/** Middle dot leader (····) */
|
|
13404
13688
|
MIDDLE_DOT: "middleDot",
|
|
13689
|
+
/** No leader */
|
|
13405
13690
|
NONE: "none",
|
|
13691
|
+
/** Underscore leader (____) */
|
|
13406
13692
|
UNDERSCORE: "underscore"
|
|
13407
13693
|
};
|
|
13408
13694
|
const TabStopPosition = {
|
|
13695
|
+
/** Maximum tab stop position (right margin) */
|
|
13409
13696
|
MAX: 9026
|
|
13410
13697
|
};
|
|
13411
13698
|
class TabAttributes extends XmlAttributeComponent {
|
|
@@ -13461,7 +13748,8 @@ class NumberId extends XmlComponent {
|
|
|
13461
13748
|
class FileChild extends XmlComponent {
|
|
13462
13749
|
constructor() {
|
|
13463
13750
|
super(...arguments);
|
|
13464
|
-
|
|
13751
|
+
/** Marker property identifying this as a FileChild */
|
|
13752
|
+
__publicField(this, "fileChild", /* @__PURE__ */ Symbol());
|
|
13465
13753
|
}
|
|
13466
13754
|
}
|
|
13467
13755
|
class HyperlinkAttributes extends XmlAttributeComponent {
|
|
@@ -13475,7 +13763,9 @@ class HyperlinkAttributes extends XmlAttributeComponent {
|
|
|
13475
13763
|
}
|
|
13476
13764
|
}
|
|
13477
13765
|
const HyperlinkType = {
|
|
13766
|
+
/** Internal hyperlink to a bookmark within the document */
|
|
13478
13767
|
INTERNAL: "INTERNAL",
|
|
13768
|
+
/** External hyperlink to a URL outside the document */
|
|
13479
13769
|
EXTERNAL: "EXTERNAL"
|
|
13480
13770
|
};
|
|
13481
13771
|
class ConcreteHyperlink extends XmlComponent {
|
|
@@ -13554,6 +13844,44 @@ class BookmarkEnd extends XmlComponent {
|
|
|
13554
13844
|
this.root.push(attributes);
|
|
13555
13845
|
}
|
|
13556
13846
|
}
|
|
13847
|
+
var NumberedItemReferenceFormat = /* @__PURE__ */ ((NumberedItemReferenceFormat2) => {
|
|
13848
|
+
NumberedItemReferenceFormat2["NONE"] = "none";
|
|
13849
|
+
NumberedItemReferenceFormat2["RELATIVE"] = "relative";
|
|
13850
|
+
NumberedItemReferenceFormat2["NO_CONTEXT"] = "no_context";
|
|
13851
|
+
NumberedItemReferenceFormat2["FULL_CONTEXT"] = "full_context";
|
|
13852
|
+
return NumberedItemReferenceFormat2;
|
|
13853
|
+
})(NumberedItemReferenceFormat || {});
|
|
13854
|
+
const SWITCH_MAP = {
|
|
13855
|
+
[
|
|
13856
|
+
"relative"
|
|
13857
|
+
/* RELATIVE */
|
|
13858
|
+
]: "\\r",
|
|
13859
|
+
[
|
|
13860
|
+
"no_context"
|
|
13861
|
+
/* NO_CONTEXT */
|
|
13862
|
+
]: "\\n",
|
|
13863
|
+
[
|
|
13864
|
+
"full_context"
|
|
13865
|
+
/* FULL_CONTEXT */
|
|
13866
|
+
]: "\\w",
|
|
13867
|
+
[
|
|
13868
|
+
"none"
|
|
13869
|
+
/* NONE */
|
|
13870
|
+
]: void 0
|
|
13871
|
+
};
|
|
13872
|
+
class NumberedItemReference extends SimpleField {
|
|
13873
|
+
constructor(bookmarkId, cachedValue, options = {}) {
|
|
13874
|
+
const {
|
|
13875
|
+
hyperlink = true,
|
|
13876
|
+
referenceFormat = "full_context"
|
|
13877
|
+
/* FULL_CONTEXT */
|
|
13878
|
+
} = options;
|
|
13879
|
+
const baseInstruction = `REF ${bookmarkId}`;
|
|
13880
|
+
const switches = [...hyperlink ? ["\\h"] : [], ...[SWITCH_MAP[referenceFormat]].filter((a) => !!a)];
|
|
13881
|
+
const instruction = `${baseInstruction} ${switches.join(" ")}`;
|
|
13882
|
+
super(instruction, cachedValue);
|
|
13883
|
+
}
|
|
13884
|
+
}
|
|
13557
13885
|
class OutlineLevel extends XmlComponent {
|
|
13558
13886
|
constructor(level) {
|
|
13559
13887
|
super("w:outlineLvl");
|
|
@@ -13719,16 +14047,23 @@ const createLineNumberType = ({ countBy, start, restart, distance }) => new Buil
|
|
|
13719
14047
|
}
|
|
13720
14048
|
});
|
|
13721
14049
|
const PageBorderDisplay = {
|
|
14050
|
+
/** Display border on all pages */
|
|
13722
14051
|
ALL_PAGES: "allPages",
|
|
14052
|
+
/** Display border only on first page */
|
|
13723
14053
|
FIRST_PAGE: "firstPage",
|
|
14054
|
+
/** Display border on all pages except first page */
|
|
13724
14055
|
NOT_FIRST_PAGE: "notFirstPage"
|
|
13725
14056
|
};
|
|
13726
14057
|
const PageBorderOffsetFrom = {
|
|
14058
|
+
/** Position border relative to page edge */
|
|
13727
14059
|
PAGE: "page",
|
|
14060
|
+
/** Position border relative to text (default) */
|
|
13728
14061
|
TEXT: "text"
|
|
13729
14062
|
};
|
|
13730
14063
|
const PageBorderZOrder = {
|
|
14064
|
+
/** Display border behind page contents */
|
|
13731
14065
|
BACK: "back",
|
|
14066
|
+
/** Display border in front of page contents (default) */
|
|
13732
14067
|
FRONT: "front"
|
|
13733
14068
|
};
|
|
13734
14069
|
class PageBordersAttributes extends XmlAttributeComponent {
|
|
@@ -13789,10 +14124,15 @@ class PageMargin extends XmlComponent {
|
|
|
13789
14124
|
}
|
|
13790
14125
|
}
|
|
13791
14126
|
const PageNumberSeparator = {
|
|
14127
|
+
/** Hyphen separator (-) */
|
|
13792
14128
|
HYPHEN: "hyphen",
|
|
14129
|
+
/** Period separator (.) */
|
|
13793
14130
|
PERIOD: "period",
|
|
14131
|
+
/** Colon separator (:) */
|
|
13794
14132
|
COLON: "colon",
|
|
14133
|
+
/** Em dash separator (—) */
|
|
13795
14134
|
EM_DASH: "emDash",
|
|
14135
|
+
/** En dash separator (–) */
|
|
13796
14136
|
EN_DASH: "endash"
|
|
13797
14137
|
};
|
|
13798
14138
|
class PageNumberTypeAttributes extends XmlAttributeComponent {
|
|
@@ -13845,7 +14185,9 @@ const createPageSize = ({ width, height, orientation, code }) => {
|
|
|
13845
14185
|
});
|
|
13846
14186
|
};
|
|
13847
14187
|
const PageTextDirectionType = {
|
|
14188
|
+
/** Left-to-right, top-to-bottom (standard Western text flow) */
|
|
13848
14189
|
LEFT_TO_RIGHT_TOP_TO_BOTTOM: "lrTb",
|
|
14190
|
+
/** Top-to-bottom, right-to-left (vertical East Asian text flow) */
|
|
13849
14191
|
TOP_TO_BOTTOM_RIGHT_TO_LEFT: "tbRl"
|
|
13850
14192
|
};
|
|
13851
14193
|
class PageTextDirectionAttributes extends XmlAttributeComponent {
|
|
@@ -13865,10 +14207,15 @@ class PageTextDirection extends XmlComponent {
|
|
|
13865
14207
|
}
|
|
13866
14208
|
}
|
|
13867
14209
|
const SectionType = {
|
|
14210
|
+
/** Section begins on the next page */
|
|
13868
14211
|
NEXT_PAGE: "nextPage",
|
|
14212
|
+
/** Section begins on the next column */
|
|
13869
14213
|
NEXT_COLUMN: "nextColumn",
|
|
14214
|
+
/** Section begins immediately following the previous section */
|
|
13870
14215
|
CONTINUOUS: "continuous",
|
|
14216
|
+
/** Section begins on the next even-numbered page */
|
|
13871
14217
|
EVEN_PAGE: "evenPage",
|
|
14218
|
+
/** Section begins on the next odd-numbered page */
|
|
13872
14219
|
ODD_PAGE: "oddPage"
|
|
13873
14220
|
};
|
|
13874
14221
|
class SectionTypeAttributes extends XmlAttributeComponent {
|
|
@@ -13886,17 +14233,27 @@ class Type extends XmlComponent {
|
|
|
13886
14233
|
}
|
|
13887
14234
|
}
|
|
13888
14235
|
const sectionMarginDefaults = {
|
|
14236
|
+
/** Top margin: 1440 twips (1 inch) */
|
|
13889
14237
|
TOP: 1440,
|
|
14238
|
+
/** Right margin: 1440 twips (1 inch) */
|
|
13890
14239
|
RIGHT: 1440,
|
|
14240
|
+
/** Bottom margin: 1440 twips (1 inch) */
|
|
13891
14241
|
BOTTOM: 1440,
|
|
14242
|
+
/** Left margin: 1440 twips (1 inch) */
|
|
13892
14243
|
LEFT: 1440,
|
|
14244
|
+
/** Header margin from top: 708 twips (0.5 inches) */
|
|
13893
14245
|
HEADER: 708,
|
|
14246
|
+
/** Footer margin from bottom: 708 twips (0.5 inches) */
|
|
13894
14247
|
FOOTER: 708,
|
|
14248
|
+
/** Gutter margin for binding: 0 twips */
|
|
13895
14249
|
GUTTER: 0
|
|
13896
14250
|
};
|
|
13897
14251
|
const sectionPageSizeDefaults = {
|
|
14252
|
+
/** Page width: 11906 twips (8.27 inches, 210mm) */
|
|
13898
14253
|
WIDTH: 11906,
|
|
14254
|
+
/** Page height: 16838 twips (11.69 inches, 297mm) */
|
|
13899
14255
|
HEIGHT: 16838,
|
|
14256
|
+
/** Page orientation: portrait */
|
|
13900
14257
|
ORIENTATION: PageOrientation.PORTRAIT
|
|
13901
14258
|
};
|
|
13902
14259
|
class SectionProperties extends XmlComponent {
|
|
@@ -13992,19 +14349,32 @@ class Body extends XmlComponent {
|
|
|
13992
14349
|
__publicField(this, "sections", []);
|
|
13993
14350
|
}
|
|
13994
14351
|
/**
|
|
13995
|
-
* Adds new section properties.
|
|
13996
|
-
*
|
|
13997
|
-
*
|
|
13998
|
-
*
|
|
13999
|
-
* - last section should be direct child of body
|
|
14352
|
+
* Adds new section properties to the document body.
|
|
14353
|
+
*
|
|
14354
|
+
* Creates a new section by moving the previous section's properties into a paragraph
|
|
14355
|
+
* at the end of that section, and then adding the new section as the current section.
|
|
14000
14356
|
*
|
|
14001
|
-
*
|
|
14357
|
+
* According to the OOXML specification:
|
|
14358
|
+
* - Section properties for all sections except the last must be stored in a paragraph's
|
|
14359
|
+
* properties (pPr/sectPr) at the end of each section
|
|
14360
|
+
* - The last section's properties are stored as a direct child of the body element (w:body/w:sectPr)
|
|
14361
|
+
*
|
|
14362
|
+
* @param options - Section properties configuration (page size, margins, headers, footers, etc.)
|
|
14002
14363
|
*/
|
|
14003
14364
|
addSection(options) {
|
|
14004
14365
|
const currentSection = this.sections.pop();
|
|
14005
14366
|
this.root.push(this.createSectionParagraph(currentSection));
|
|
14006
14367
|
this.sections.push(new SectionProperties(options));
|
|
14007
14368
|
}
|
|
14369
|
+
/**
|
|
14370
|
+
* Prepares the body element for XML serialization.
|
|
14371
|
+
*
|
|
14372
|
+
* Ensures that the last section's properties are placed as a direct child of the body
|
|
14373
|
+
* element, as required by the OOXML specification.
|
|
14374
|
+
*
|
|
14375
|
+
* @param context - The XML serialization context
|
|
14376
|
+
* @returns The prepared XML object or undefined
|
|
14377
|
+
*/
|
|
14008
14378
|
prepForXml(context) {
|
|
14009
14379
|
if (this.sections.length === 1) {
|
|
14010
14380
|
this.root.splice(0, 1);
|
|
@@ -14012,6 +14382,14 @@ class Body extends XmlComponent {
|
|
|
14012
14382
|
}
|
|
14013
14383
|
return super.prepForXml(context);
|
|
14014
14384
|
}
|
|
14385
|
+
/**
|
|
14386
|
+
* Adds a block-level component to the body.
|
|
14387
|
+
*
|
|
14388
|
+
* This method is used internally by the Document class to add paragraphs,
|
|
14389
|
+
* tables, and other block-level elements to the document body.
|
|
14390
|
+
*
|
|
14391
|
+
* @param component - The XML component to add (paragraph, table, etc.)
|
|
14392
|
+
*/
|
|
14015
14393
|
push(component) {
|
|
14016
14394
|
this.root.push(component);
|
|
14017
14395
|
}
|
|
@@ -14154,10 +14532,21 @@ class Document extends XmlComponent {
|
|
|
14154
14532
|
}
|
|
14155
14533
|
this.root.push(this.body);
|
|
14156
14534
|
}
|
|
14535
|
+
/**
|
|
14536
|
+
* Adds a block-level element to the document body.
|
|
14537
|
+
*
|
|
14538
|
+
* @param item - The element to add (paragraph, table, table of contents, or hyperlink)
|
|
14539
|
+
* @returns The Document instance for method chaining
|
|
14540
|
+
*/
|
|
14157
14541
|
add(item) {
|
|
14158
14542
|
this.body.push(item);
|
|
14159
14543
|
return this;
|
|
14160
14544
|
}
|
|
14545
|
+
/**
|
|
14546
|
+
* Gets the document body element.
|
|
14547
|
+
*
|
|
14548
|
+
* @returns The Body instance containing all document content
|
|
14549
|
+
*/
|
|
14161
14550
|
get Body() {
|
|
14162
14551
|
return this.body;
|
|
14163
14552
|
}
|
|
@@ -14189,21 +14578,33 @@ class WordWrap extends XmlComponent {
|
|
|
14189
14578
|
}
|
|
14190
14579
|
}
|
|
14191
14580
|
const DropCapType = {
|
|
14581
|
+
/** No drop cap effect */
|
|
14192
14582
|
NONE: "none",
|
|
14583
|
+
/** Drop cap that drops down into the paragraph text */
|
|
14193
14584
|
DROP: "drop",
|
|
14585
|
+
/** Drop cap that extends into the margin */
|
|
14194
14586
|
MARGIN: "margin"
|
|
14195
14587
|
};
|
|
14196
14588
|
const FrameAnchorType = {
|
|
14589
|
+
/** Anchor relative to the page margin */
|
|
14197
14590
|
MARGIN: "margin",
|
|
14591
|
+
/** Anchor relative to the page edge */
|
|
14198
14592
|
PAGE: "page",
|
|
14593
|
+
/** Anchor relative to the text column */
|
|
14199
14594
|
TEXT: "text"
|
|
14200
14595
|
};
|
|
14201
14596
|
const FrameWrap = {
|
|
14597
|
+
/** Wrap text around the frame on all sides */
|
|
14202
14598
|
AROUND: "around",
|
|
14599
|
+
/** Automatic wrapping based on available space */
|
|
14203
14600
|
AUTO: "auto",
|
|
14601
|
+
/** No text wrapping */
|
|
14204
14602
|
NONE: "none",
|
|
14603
|
+
/** Do not allow text beside the frame */
|
|
14205
14604
|
NOT_BESIDE: "notBeside",
|
|
14605
|
+
/** Allow text to flow through the frame */
|
|
14206
14606
|
THROUGH: "through",
|
|
14607
|
+
/** Wrap text tightly around the frame */
|
|
14207
14608
|
TIGHT: "tight"
|
|
14208
14609
|
};
|
|
14209
14610
|
const createFrameProperties = (options) => {
|
|
@@ -14377,9 +14778,23 @@ class ParagraphProperties extends IgnoreIfEmptyXmlComponent {
|
|
|
14377
14778
|
this.push(new RunProperties(options.run));
|
|
14378
14779
|
}
|
|
14379
14780
|
}
|
|
14781
|
+
/**
|
|
14782
|
+
* Adds a property element to the paragraph properties.
|
|
14783
|
+
*
|
|
14784
|
+
* @param item - The XML component to add to the paragraph properties
|
|
14785
|
+
*/
|
|
14380
14786
|
push(item) {
|
|
14381
14787
|
this.root.push(item);
|
|
14382
14788
|
}
|
|
14789
|
+
/**
|
|
14790
|
+
* Prepares the paragraph properties for XML serialization.
|
|
14791
|
+
*
|
|
14792
|
+
* This method creates concrete numbering instances for any numbering references
|
|
14793
|
+
* before the properties are converted to XML.
|
|
14794
|
+
*
|
|
14795
|
+
* @param context - The XML context containing document and file information
|
|
14796
|
+
* @returns The prepared XML object, or undefined if the component should be ignored
|
|
14797
|
+
*/
|
|
14383
14798
|
prepForXml(context) {
|
|
14384
14799
|
if (context.viewWrapper instanceof DocumentWrapper) {
|
|
14385
14800
|
for (const reference of this.numberingReferences) {
|
|
@@ -14879,10 +15294,12 @@ class GridSpan extends XmlComponent {
|
|
|
14879
15294
|
const VerticalMergeType = {
|
|
14880
15295
|
/**
|
|
14881
15296
|
* Cell that is merged with upper one.
|
|
15297
|
+
* This cell continues a vertical merge started by a cell above it.
|
|
14882
15298
|
*/
|
|
14883
15299
|
CONTINUE: "continue",
|
|
14884
15300
|
/**
|
|
14885
15301
|
* Cell that is starting the vertical merge.
|
|
15302
|
+
* This cell begins a new vertical merge region.
|
|
14886
15303
|
*/
|
|
14887
15304
|
RESTART: "restart"
|
|
14888
15305
|
};
|
|
@@ -14903,8 +15320,11 @@ class VerticalMerge extends XmlComponent {
|
|
|
14903
15320
|
}
|
|
14904
15321
|
}
|
|
14905
15322
|
const TextDirection = {
|
|
15323
|
+
/** Text flows from bottom to top, left to right */
|
|
14906
15324
|
BOTTOM_TO_TOP_LEFT_TO_RIGHT: "btLr",
|
|
15325
|
+
/** Text flows from left to right, top to bottom (default) */
|
|
14907
15326
|
LEFT_TO_RIGHT_TOP_TO_BOTTOM: "lrTb",
|
|
15327
|
+
/** Text flows from top to bottom, right to left */
|
|
14908
15328
|
TOP_TO_BOTTOM_RIGHT_TO_LEFT: "tbRl"
|
|
14909
15329
|
};
|
|
14910
15330
|
class TDirectionAttributes extends XmlAttributeComponent {
|
|
@@ -15112,7 +15532,9 @@ class TableFloatProperties extends XmlComponent {
|
|
|
15112
15532
|
}
|
|
15113
15533
|
}
|
|
15114
15534
|
const TableLayoutType = {
|
|
15535
|
+
/** Auto-fit layout - column widths are adjusted based on content */
|
|
15115
15536
|
AUTOFIT: "autofit",
|
|
15537
|
+
/** Fixed layout - column widths are fixed as specified */
|
|
15116
15538
|
FIXED: "fixed"
|
|
15117
15539
|
};
|
|
15118
15540
|
class TableLayoutAttributes extends XmlAttributeComponent {
|
|
@@ -15431,11 +15853,21 @@ class ContentTypes extends XmlComponent {
|
|
|
15431
15853
|
this.root.push(new Override("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml", "/word/comments.xml"));
|
|
15432
15854
|
this.root.push(new Override("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml", "/word/fontTable.xml"));
|
|
15433
15855
|
}
|
|
15856
|
+
/**
|
|
15857
|
+
* Registers a footer part in the content types.
|
|
15858
|
+
*
|
|
15859
|
+
* @param index - Footer index number (e.g., 1 for footer1.xml)
|
|
15860
|
+
*/
|
|
15434
15861
|
addFooter(index) {
|
|
15435
15862
|
this.root.push(
|
|
15436
15863
|
new Override("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml", `/word/footer${index}.xml`)
|
|
15437
15864
|
);
|
|
15438
15865
|
}
|
|
15866
|
+
/**
|
|
15867
|
+
* Registers a header part in the content types.
|
|
15868
|
+
*
|
|
15869
|
+
* @param index - Header index number (e.g., 1 for header1.xml)
|
|
15870
|
+
*/
|
|
15439
15871
|
addHeader(index) {
|
|
15440
15872
|
this.root.push(
|
|
15441
15873
|
new Override("application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml", `/word/header${index}.xml`)
|
|
@@ -15501,7 +15933,7 @@ class CustomPropertyAttributes extends XmlAttributeComponent {
|
|
|
15501
15933
|
constructor() {
|
|
15502
15934
|
super(...arguments);
|
|
15503
15935
|
__publicField(this, "xmlKeys", {
|
|
15504
|
-
|
|
15936
|
+
formatId: "fmtid",
|
|
15505
15937
|
pid: "pid",
|
|
15506
15938
|
name: "name"
|
|
15507
15939
|
});
|
|
@@ -15512,7 +15944,7 @@ class CustomProperty extends XmlComponent {
|
|
|
15512
15944
|
super("property");
|
|
15513
15945
|
this.root.push(
|
|
15514
15946
|
new CustomPropertyAttributes({
|
|
15515
|
-
|
|
15947
|
+
formatId: "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",
|
|
15516
15948
|
pid: id.toString(),
|
|
15517
15949
|
name: properties.name
|
|
15518
15950
|
})
|
|
@@ -15593,50 +16025,47 @@ const createFont = ({
|
|
|
15593
16025
|
embedBold,
|
|
15594
16026
|
embedItalic,
|
|
15595
16027
|
embedBoldItalic
|
|
15596
|
-
}) => (
|
|
15597
|
-
|
|
15598
|
-
|
|
15599
|
-
name: "w:
|
|
15600
|
-
|
|
15601
|
-
|
|
15602
|
-
|
|
15603
|
-
|
|
15604
|
-
|
|
15605
|
-
|
|
15606
|
-
|
|
15607
|
-
|
|
15608
|
-
|
|
15609
|
-
|
|
15610
|
-
|
|
15611
|
-
|
|
15612
|
-
|
|
15613
|
-
|
|
15614
|
-
|
|
15615
|
-
|
|
15616
|
-
|
|
15617
|
-
|
|
15618
|
-
|
|
15619
|
-
|
|
15620
|
-
|
|
15621
|
-
|
|
15622
|
-
|
|
15623
|
-
|
|
15624
|
-
|
|
15625
|
-
|
|
15626
|
-
|
|
15627
|
-
|
|
15628
|
-
|
|
15629
|
-
|
|
15630
|
-
|
|
15631
|
-
|
|
15632
|
-
|
|
15633
|
-
|
|
15634
|
-
|
|
15635
|
-
|
|
15636
|
-
|
|
15637
|
-
]
|
|
15638
|
-
})
|
|
15639
|
-
);
|
|
16028
|
+
}) => new BuilderElement({
|
|
16029
|
+
name: "w:font",
|
|
16030
|
+
attributes: {
|
|
16031
|
+
name: { key: "w:name", value: name }
|
|
16032
|
+
},
|
|
16033
|
+
children: [
|
|
16034
|
+
// http://www.datypic.com/sc/ooxml/e-w_altName-1.html
|
|
16035
|
+
...altName ? [createStringElement("w:altName", altName)] : [],
|
|
16036
|
+
// http://www.datypic.com/sc/ooxml/e-w_panose1-1.html
|
|
16037
|
+
...panose1 ? [createStringElement("w:panose1", panose1)] : [],
|
|
16038
|
+
// http://www.datypic.com/sc/ooxml/e-w_charset-1.html
|
|
16039
|
+
...charset ? [createStringElement("w:charset", charset)] : [],
|
|
16040
|
+
// http://www.datypic.com/sc/ooxml/e-w_family-1.html
|
|
16041
|
+
...[createStringElement("w:family", family)],
|
|
16042
|
+
// http://www.datypic.com/sc/ooxml/e-w_notTrueType-1.html
|
|
16043
|
+
...notTrueType ? [new OnOffElement("w:notTrueType", notTrueType)] : [],
|
|
16044
|
+
...[createStringElement("w:pitch", pitch)],
|
|
16045
|
+
// http://www.datypic.com/sc/ooxml/e-w_sig-1.html
|
|
16046
|
+
...sig ? [
|
|
16047
|
+
new BuilderElement({
|
|
16048
|
+
name: "w:sig",
|
|
16049
|
+
attributes: {
|
|
16050
|
+
usb0: { key: "w:usb0", value: sig.usb0 },
|
|
16051
|
+
usb1: { key: "w:usb1", value: sig.usb1 },
|
|
16052
|
+
usb2: { key: "w:usb2", value: sig.usb2 },
|
|
16053
|
+
usb3: { key: "w:usb3", value: sig.usb3 },
|
|
16054
|
+
csb0: { key: "w:csb0", value: sig.csb0 },
|
|
16055
|
+
csb1: { key: "w:csb1", value: sig.csb1 }
|
|
16056
|
+
}
|
|
16057
|
+
})
|
|
16058
|
+
] : [],
|
|
16059
|
+
// http://www.datypic.com/sc/ooxml/e-w_embedRegular-1.html
|
|
16060
|
+
...embedRegular ? [createFontRelationship(embedRegular, "w:embedRegular")] : [],
|
|
16061
|
+
// http://www.datypic.com/sc/ooxml/e-w_embedBold-1.html
|
|
16062
|
+
...embedBold ? [createFontRelationship(embedBold, "w:embedBold")] : [],
|
|
16063
|
+
// http://www.datypic.com/sc/ooxml/e-w_embedItalic-1.html
|
|
16064
|
+
...embedItalic ? [createFontRelationship(embedItalic, "w:embedItalic")] : [],
|
|
16065
|
+
// http://www.datypic.com/sc/ooxml/e-w_embedBoldItalic-1.html
|
|
16066
|
+
...embedBoldItalic ? [createFontRelationship(embedBoldItalic, "w:embedBoldItalic")] : []
|
|
16067
|
+
]
|
|
16068
|
+
});
|
|
15640
16069
|
const createRegularFont = ({
|
|
15641
16070
|
name,
|
|
15642
16071
|
index,
|
|
@@ -15822,7 +16251,9 @@ class FootnoteRefRun extends Run {
|
|
|
15822
16251
|
}
|
|
15823
16252
|
}
|
|
15824
16253
|
const FootnoteType = {
|
|
16254
|
+
/** Separator line between body text and footnotes */
|
|
15825
16255
|
SEPERATOR: "separator",
|
|
16256
|
+
/** Continuation separator for footnotes spanning pages */
|
|
15826
16257
|
CONTINUATION_SEPERATOR: "continuationSeparator"
|
|
15827
16258
|
};
|
|
15828
16259
|
class Footnote extends XmlComponent {
|
|
@@ -15944,6 +16375,12 @@ class FootNotes extends XmlComponent {
|
|
|
15944
16375
|
});
|
|
15945
16376
|
this.root.push(spacing);
|
|
15946
16377
|
}
|
|
16378
|
+
/**
|
|
16379
|
+
* Creates and adds a new footnote to the collection.
|
|
16380
|
+
*
|
|
16381
|
+
* @param id - Unique numeric identifier for the footnote
|
|
16382
|
+
* @param paragraph - Array of paragraphs that make up the footnote content
|
|
16383
|
+
*/
|
|
15947
16384
|
createFootNote(id, paragraph) {
|
|
15948
16385
|
const footnote = new Footnote({
|
|
15949
16386
|
id,
|
|
@@ -16083,77 +16520,151 @@ class Media {
|
|
|
16083
16520
|
__publicField(this, "map");
|
|
16084
16521
|
this.map = /* @__PURE__ */ new Map();
|
|
16085
16522
|
}
|
|
16523
|
+
/**
|
|
16524
|
+
* Adds an image to the media collection.
|
|
16525
|
+
*
|
|
16526
|
+
* @param key - Unique identifier for this image
|
|
16527
|
+
* @param mediaData - Complete image data including file name, transformation, and raw data
|
|
16528
|
+
*/
|
|
16086
16529
|
addImage(key, mediaData) {
|
|
16087
16530
|
this.map.set(key, mediaData);
|
|
16088
16531
|
}
|
|
16532
|
+
/**
|
|
16533
|
+
* Gets all images as an array.
|
|
16534
|
+
*
|
|
16535
|
+
* @returns Read-only array of all media data in the collection
|
|
16536
|
+
*/
|
|
16089
16537
|
get Array() {
|
|
16090
16538
|
return Array.from(this.map.values());
|
|
16091
16539
|
}
|
|
16092
16540
|
}
|
|
16093
16541
|
const WORKAROUND2 = "";
|
|
16094
16542
|
const LevelFormat = {
|
|
16543
|
+
/** Decimal numbering (1, 2, 3...). */
|
|
16095
16544
|
DECIMAL: "decimal",
|
|
16545
|
+
/** Uppercase roman numerals (I, II, III...). */
|
|
16096
16546
|
UPPER_ROMAN: "upperRoman",
|
|
16547
|
+
/** Lowercase roman numerals (i, ii, iii...). */
|
|
16097
16548
|
LOWER_ROMAN: "lowerRoman",
|
|
16549
|
+
/** Uppercase letters (A, B, C...). */
|
|
16098
16550
|
UPPER_LETTER: "upperLetter",
|
|
16551
|
+
/** Lowercase letters (a, b, c...). */
|
|
16099
16552
|
LOWER_LETTER: "lowerLetter",
|
|
16553
|
+
/** Ordinal numbers (1st, 2nd, 3rd...). */
|
|
16100
16554
|
ORDINAL: "ordinal",
|
|
16555
|
+
/** Cardinal text (one, two, three...). */
|
|
16101
16556
|
CARDINAL_TEXT: "cardinalText",
|
|
16557
|
+
/** Ordinal text (first, second, third...). */
|
|
16102
16558
|
ORDINAL_TEXT: "ordinalText",
|
|
16559
|
+
/** Hexadecimal numbering. */
|
|
16103
16560
|
HEX: "hex",
|
|
16561
|
+
/** Chicago Manual of Style numbering. */
|
|
16104
16562
|
CHICAGO: "chicago",
|
|
16563
|
+
/** Ideograph digital numbering. */
|
|
16105
16564
|
IDEOGRAPH__DIGITAL: "ideographDigital",
|
|
16565
|
+
/** Japanese counting system. */
|
|
16106
16566
|
JAPANESE_COUNTING: "japaneseCounting",
|
|
16567
|
+
/** Japanese aiueo ordering. */
|
|
16107
16568
|
AIUEO: "aiueo",
|
|
16569
|
+
/** Japanese iroha ordering. */
|
|
16108
16570
|
IROHA: "iroha",
|
|
16571
|
+
/** Full-width decimal numbering. */
|
|
16109
16572
|
DECIMAL_FULL_WIDTH: "decimalFullWidth",
|
|
16573
|
+
/** Half-width decimal numbering. */
|
|
16110
16574
|
DECIMAL_HALF_WIDTH: "decimalHalfWidth",
|
|
16575
|
+
/** Japanese legal numbering. */
|
|
16111
16576
|
JAPANESE_LEGAL: "japaneseLegal",
|
|
16577
|
+
/** Japanese digital ten thousand numbering. */
|
|
16112
16578
|
JAPANESE_DIGITAL_TEN_THOUSAND: "japaneseDigitalTenThousand",
|
|
16579
|
+
/** Decimal numbers enclosed in circles. */
|
|
16113
16580
|
DECIMAL_ENCLOSED_CIRCLE: "decimalEnclosedCircle",
|
|
16581
|
+
/** Full-width decimal numbering variant 2. */
|
|
16114
16582
|
DECIMAL_FULL_WIDTH2: "decimalFullWidth2",
|
|
16583
|
+
/** Full-width aiueo ordering. */
|
|
16115
16584
|
AIUEO_FULL_WIDTH: "aiueoFullWidth",
|
|
16585
|
+
/** Full-width iroha ordering. */
|
|
16116
16586
|
IROHA_FULL_WIDTH: "irohaFullWidth",
|
|
16587
|
+
/** Decimal with leading zeros. */
|
|
16117
16588
|
DECIMAL_ZERO: "decimalZero",
|
|
16589
|
+
/** Bullet points. */
|
|
16118
16590
|
BULLET: "bullet",
|
|
16591
|
+
/** Korean ganada ordering. */
|
|
16119
16592
|
GANADA: "ganada",
|
|
16593
|
+
/** Korean chosung ordering. */
|
|
16120
16594
|
CHOSUNG: "chosung",
|
|
16595
|
+
/** Decimal enclosed with fullstop. */
|
|
16121
16596
|
DECIMAL_ENCLOSED_FULLSTOP: "decimalEnclosedFullstop",
|
|
16597
|
+
/** Decimal enclosed in parentheses. */
|
|
16122
16598
|
DECIMAL_ENCLOSED_PARENTHESES: "decimalEnclosedParen",
|
|
16599
|
+
/** Decimal enclosed in circles (Chinese). */
|
|
16123
16600
|
DECIMAL_ENCLOSED_CIRCLE_CHINESE: "decimalEnclosedCircleChinese",
|
|
16601
|
+
/** Ideograph enclosed in circles. */
|
|
16124
16602
|
IDEOGRAPH_ENCLOSED_CIRCLE: "ideographEnclosedCircle",
|
|
16603
|
+
/** Traditional ideograph numbering. */
|
|
16125
16604
|
IDEOGRAPH_TRADITIONAL: "ideographTraditional",
|
|
16605
|
+
/** Ideograph zodiac numbering. */
|
|
16126
16606
|
IDEOGRAPH_ZODIAC: "ideographZodiac",
|
|
16607
|
+
/** Traditional ideograph zodiac numbering. */
|
|
16127
16608
|
IDEOGRAPH_ZODIAC_TRADITIONAL: "ideographZodiacTraditional",
|
|
16609
|
+
/** Taiwanese counting system. */
|
|
16128
16610
|
TAIWANESE_COUNTING: "taiwaneseCounting",
|
|
16611
|
+
/** Traditional ideograph legal numbering. */
|
|
16129
16612
|
IDEOGRAPH_LEGAL_TRADITIONAL: "ideographLegalTraditional",
|
|
16613
|
+
/** Taiwanese counting thousand system. */
|
|
16130
16614
|
TAIWANESE_COUNTING_THOUSAND: "taiwaneseCountingThousand",
|
|
16615
|
+
/** Taiwanese digital numbering. */
|
|
16131
16616
|
TAIWANESE_DIGITAL: "taiwaneseDigital",
|
|
16617
|
+
/** Chinese counting system. */
|
|
16132
16618
|
CHINESE_COUNTING: "chineseCounting",
|
|
16619
|
+
/** Simplified Chinese legal numbering. */
|
|
16133
16620
|
CHINESE_LEGAL_SIMPLIFIED: "chineseLegalSimplified",
|
|
16621
|
+
/** Chinese counting thousand system. */
|
|
16134
16622
|
CHINESE_COUNTING_THOUSAND: "chineseCountingThousand",
|
|
16623
|
+
/** Korean digital numbering. */
|
|
16135
16624
|
KOREAN_DIGITAL: "koreanDigital",
|
|
16625
|
+
/** Korean counting system. */
|
|
16136
16626
|
KOREAN_COUNTING: "koreanCounting",
|
|
16627
|
+
/** Korean legal numbering. */
|
|
16137
16628
|
KOREAN_LEGAL: "koreanLegal",
|
|
16629
|
+
/** Korean digital numbering variant 2. */
|
|
16138
16630
|
KOREAN_DIGITAL2: "koreanDigital2",
|
|
16631
|
+
/** Vietnamese counting system. */
|
|
16139
16632
|
VIETNAMESE_COUNTING: "vietnameseCounting",
|
|
16633
|
+
/** Russian lowercase numbering. */
|
|
16140
16634
|
RUSSIAN_LOWER: "russianLower",
|
|
16635
|
+
/** Russian uppercase numbering. */
|
|
16141
16636
|
RUSSIAN_UPPER: "russianUpper",
|
|
16637
|
+
/** No numbering. */
|
|
16142
16638
|
NONE: "none",
|
|
16639
|
+
/** Number enclosed in dashes. */
|
|
16143
16640
|
NUMBER_IN_DASH: "numberInDash",
|
|
16641
|
+
/** Hebrew numbering variant 1. */
|
|
16144
16642
|
HEBREW1: "hebrew1",
|
|
16643
|
+
/** Hebrew numbering variant 2. */
|
|
16145
16644
|
HEBREW2: "hebrew2",
|
|
16645
|
+
/** Arabic alpha numbering. */
|
|
16146
16646
|
ARABIC_ALPHA: "arabicAlpha",
|
|
16647
|
+
/** Arabic abjad numbering. */
|
|
16147
16648
|
ARABIC_ABJAD: "arabicAbjad",
|
|
16649
|
+
/** Hindi vowels. */
|
|
16148
16650
|
HINDI_VOWELS: "hindiVowels",
|
|
16651
|
+
/** Hindi consonants. */
|
|
16149
16652
|
HINDI_CONSONANTS: "hindiConsonants",
|
|
16653
|
+
/** Hindi numbers. */
|
|
16150
16654
|
HINDI_NUMBERS: "hindiNumbers",
|
|
16655
|
+
/** Hindi counting system. */
|
|
16151
16656
|
HINDI_COUNTING: "hindiCounting",
|
|
16657
|
+
/** Thai letters. */
|
|
16152
16658
|
THAI_LETTERS: "thaiLetters",
|
|
16659
|
+
/** Thai numbers. */
|
|
16153
16660
|
THAI_NUMBERS: "thaiNumbers",
|
|
16661
|
+
/** Thai counting system. */
|
|
16154
16662
|
THAI_COUNTING: "thaiCounting",
|
|
16663
|
+
/** Thai Baht text. */
|
|
16155
16664
|
BAHT_TEXT: "bahtText",
|
|
16665
|
+
/** Dollar text. */
|
|
16156
16666
|
DOLLAR_TEXT: "dollarText",
|
|
16667
|
+
/** Custom numbering format. */
|
|
16157
16668
|
CUSTOM: "custom"
|
|
16158
16669
|
};
|
|
16159
16670
|
class LevelAttributes extends XmlAttributeComponent {
|
|
@@ -16196,8 +16707,11 @@ class LevelJc extends XmlComponent {
|
|
|
16196
16707
|
}
|
|
16197
16708
|
}
|
|
16198
16709
|
const LevelSuffix = {
|
|
16710
|
+
/** No separator after the numbering. */
|
|
16199
16711
|
NOTHING: "nothing",
|
|
16712
|
+
/** Space character after the numbering. */
|
|
16200
16713
|
SPACE: "space",
|
|
16714
|
+
/** Tab character after the numbering. */
|
|
16201
16715
|
TAB: "tab"
|
|
16202
16716
|
};
|
|
16203
16717
|
class Suffix extends XmlComponent {
|
|
@@ -16216,6 +16730,12 @@ class IsLegalNumberingStyle extends XmlComponent {
|
|
|
16216
16730
|
}
|
|
16217
16731
|
}
|
|
16218
16732
|
class LevelBase extends XmlComponent {
|
|
16733
|
+
/**
|
|
16734
|
+
* Creates a new numbering level.
|
|
16735
|
+
*
|
|
16736
|
+
* @param options - Level configuration options
|
|
16737
|
+
* @throws Error if level is greater than 9 (Word limitation)
|
|
16738
|
+
*/
|
|
16219
16739
|
constructor({
|
|
16220
16740
|
level,
|
|
16221
16741
|
format,
|
|
@@ -16261,12 +16781,16 @@ class LevelBase extends XmlComponent {
|
|
|
16261
16781
|
}
|
|
16262
16782
|
}
|
|
16263
16783
|
class Level extends LevelBase {
|
|
16264
|
-
// This is the level that sits under abstractNum
|
|
16265
|
-
// handful of properties required
|
|
16784
|
+
// This is the level that sits under abstractNum
|
|
16266
16785
|
}
|
|
16267
16786
|
class LevelForOverride extends LevelBase {
|
|
16268
16787
|
}
|
|
16269
16788
|
class MultiLevelType extends XmlComponent {
|
|
16789
|
+
/**
|
|
16790
|
+
* Creates a new multi-level type specification.
|
|
16791
|
+
*
|
|
16792
|
+
* @param value - The multi-level type: "singleLevel", "multilevel", or "hybridMultilevel"
|
|
16793
|
+
*/
|
|
16270
16794
|
constructor(value) {
|
|
16271
16795
|
super("w:multiLevelType");
|
|
16272
16796
|
this.root.push(
|
|
@@ -16286,8 +16810,15 @@ class AbstractNumberingAttributes extends XmlAttributeComponent {
|
|
|
16286
16810
|
}
|
|
16287
16811
|
}
|
|
16288
16812
|
class AbstractNumbering extends XmlComponent {
|
|
16813
|
+
/**
|
|
16814
|
+
* Creates a new abstract numbering definition.
|
|
16815
|
+
*
|
|
16816
|
+
* @param id - Unique identifier for this abstract numbering definition
|
|
16817
|
+
* @param levelOptions - Array of level definitions (up to 9 levels)
|
|
16818
|
+
*/
|
|
16289
16819
|
constructor(id, levelOptions) {
|
|
16290
16820
|
super("w:abstractNum");
|
|
16821
|
+
/** The unique identifier for this abstract numbering definition. */
|
|
16291
16822
|
__publicField(this, "id");
|
|
16292
16823
|
this.root.push(
|
|
16293
16824
|
new AbstractNumberingAttributes({
|
|
@@ -16319,10 +16850,18 @@ class NumAttributes extends XmlAttributeComponent {
|
|
|
16319
16850
|
}
|
|
16320
16851
|
}
|
|
16321
16852
|
class ConcreteNumbering extends XmlComponent {
|
|
16853
|
+
/**
|
|
16854
|
+
* Creates a new concrete numbering instance.
|
|
16855
|
+
*
|
|
16856
|
+
* @param options - Configuration options for the numbering instance
|
|
16857
|
+
*/
|
|
16322
16858
|
constructor(options) {
|
|
16323
16859
|
super("w:num");
|
|
16860
|
+
/** The unique identifier for this numbering instance. */
|
|
16324
16861
|
__publicField(this, "numId");
|
|
16862
|
+
/** The reference name for this numbering instance. */
|
|
16325
16863
|
__publicField(this, "reference");
|
|
16864
|
+
/** The instance number for tracking multiple uses. */
|
|
16326
16865
|
__publicField(this, "instance");
|
|
16327
16866
|
this.numId = options.numId;
|
|
16328
16867
|
this.reference = options.reference;
|
|
@@ -16347,6 +16886,12 @@ class LevelOverrideAttributes extends XmlAttributeComponent {
|
|
|
16347
16886
|
}
|
|
16348
16887
|
}
|
|
16349
16888
|
class LevelOverride extends XmlComponent {
|
|
16889
|
+
/**
|
|
16890
|
+
* Creates a new level override.
|
|
16891
|
+
*
|
|
16892
|
+
* @param levelNum - The level number to override (0-8)
|
|
16893
|
+
* @param start - Optional starting number for the level
|
|
16894
|
+
*/
|
|
16350
16895
|
constructor(levelNum, start) {
|
|
16351
16896
|
super("w:lvlOverride");
|
|
16352
16897
|
this.root.push(new LevelOverrideAttributes({ ilvl: levelNum }));
|
|
@@ -16362,12 +16907,25 @@ class StartOverrideAttributes extends XmlAttributeComponent {
|
|
|
16362
16907
|
}
|
|
16363
16908
|
}
|
|
16364
16909
|
class StartOverride extends XmlComponent {
|
|
16910
|
+
/**
|
|
16911
|
+
* Creates a new start override.
|
|
16912
|
+
*
|
|
16913
|
+
* @param start - The starting number
|
|
16914
|
+
*/
|
|
16365
16915
|
constructor(start) {
|
|
16366
16916
|
super("w:startOverride");
|
|
16367
16917
|
this.root.push(new StartOverrideAttributes({ val: start }));
|
|
16368
16918
|
}
|
|
16369
16919
|
}
|
|
16370
16920
|
class Numbering extends XmlComponent {
|
|
16921
|
+
/**
|
|
16922
|
+
* Creates a new numbering definition collection.
|
|
16923
|
+
*
|
|
16924
|
+
* Initializes the numbering with a default bullet list configuration and
|
|
16925
|
+
* any custom numbering configurations provided in the options.
|
|
16926
|
+
*
|
|
16927
|
+
* @param options - Configuration options for numbering definitions
|
|
16928
|
+
*/
|
|
16371
16929
|
constructor(options) {
|
|
16372
16930
|
super("w:numbering");
|
|
16373
16931
|
__publicField(this, "abstractNumberingMap", /* @__PURE__ */ new Map());
|
|
@@ -16504,6 +17062,14 @@ class Numbering extends XmlComponent {
|
|
|
16504
17062
|
this.referenceConfigMap.set(con.reference, con.levels);
|
|
16505
17063
|
}
|
|
16506
17064
|
}
|
|
17065
|
+
/**
|
|
17066
|
+
* Prepares the numbering definitions for XML serialization.
|
|
17067
|
+
*
|
|
17068
|
+
* Adds all abstract and concrete numbering definitions to the XML tree.
|
|
17069
|
+
*
|
|
17070
|
+
* @param context - The XML context
|
|
17071
|
+
* @returns The prepared XML object
|
|
17072
|
+
*/
|
|
16507
17073
|
prepForXml(context) {
|
|
16508
17074
|
for (const numbering of this.abstractNumberingMap.values()) {
|
|
16509
17075
|
this.root.push(numbering);
|
|
@@ -16513,6 +17079,16 @@ class Numbering extends XmlComponent {
|
|
|
16513
17079
|
}
|
|
16514
17080
|
return super.prepForXml(context);
|
|
16515
17081
|
}
|
|
17082
|
+
/**
|
|
17083
|
+
* Creates a concrete numbering instance from an abstract numbering definition.
|
|
17084
|
+
*
|
|
17085
|
+
* This method creates a new concrete numbering instance that references an
|
|
17086
|
+
* abstract numbering definition. It's used internally when paragraphs reference
|
|
17087
|
+
* numbering configurations.
|
|
17088
|
+
*
|
|
17089
|
+
* @param reference - The reference name of the abstract numbering definition
|
|
17090
|
+
* @param instance - The instance number for this concrete numbering
|
|
17091
|
+
*/
|
|
16516
17092
|
createConcreteNumberingInstance(reference, instance) {
|
|
16517
17093
|
const abstractNumbering = this.abstractNumberingMap.get(reference);
|
|
16518
17094
|
if (!abstractNumbering) {
|
|
@@ -16541,9 +17117,19 @@ class Numbering extends XmlComponent {
|
|
|
16541
17117
|
};
|
|
16542
17118
|
this.concreteNumberingMap.set(fullReference, new ConcreteNumbering(concreteNumberingSettings));
|
|
16543
17119
|
}
|
|
17120
|
+
/**
|
|
17121
|
+
* Gets all concrete numbering instances.
|
|
17122
|
+
*
|
|
17123
|
+
* @returns An array of all concrete numbering instances
|
|
17124
|
+
*/
|
|
16544
17125
|
get ConcreteNumbering() {
|
|
16545
17126
|
return Array.from(this.concreteNumberingMap.values());
|
|
16546
17127
|
}
|
|
17128
|
+
/**
|
|
17129
|
+
* Gets all reference configurations.
|
|
17130
|
+
*
|
|
17131
|
+
* @returns An array of all numbering reference configurations
|
|
17132
|
+
*/
|
|
16547
17133
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16548
17134
|
get ReferenceConfig() {
|
|
16549
17135
|
return Array.from(this.referenceConfigMap.values());
|
|
@@ -17135,27 +17721,29 @@ class DocumentDefaults extends XmlComponent {
|
|
|
17135
17721
|
}
|
|
17136
17722
|
class ExternalStylesFactory {
|
|
17137
17723
|
/**
|
|
17138
|
-
* Creates new
|
|
17139
|
-
*
|
|
17724
|
+
* Creates new Styles based on the given XML data.
|
|
17725
|
+
*
|
|
17726
|
+
* Parses the styles XML and converts them to XmlComponent instances.
|
|
17727
|
+
*
|
|
17140
17728
|
* Example content from styles.xml:
|
|
17141
|
-
*
|
|
17729
|
+
* ```xml
|
|
17730
|
+
* <?xml version="1.0"?>
|
|
17142
17731
|
* <w:styles xmlns:mc="some schema" ...>
|
|
17143
|
-
*
|
|
17144
17732
|
* <w:style w:type="paragraph" w:styleId="Heading1">
|
|
17145
|
-
*
|
|
17146
|
-
*
|
|
17733
|
+
* <w:name w:val="heading 1"/>
|
|
17734
|
+
* ...
|
|
17147
17735
|
* </w:style>
|
|
17148
|
-
*
|
|
17149
17736
|
* <w:style w:type="paragraph" w:styleId="Heading2">
|
|
17150
|
-
*
|
|
17151
|
-
*
|
|
17737
|
+
* <w:name w:val="heading 2"/>
|
|
17738
|
+
* ...
|
|
17152
17739
|
* </w:style>
|
|
17153
|
-
*
|
|
17154
|
-
* <w:docDefaults>Or any other element will be parsed to</w:docDefaults>
|
|
17155
|
-
*
|
|
17740
|
+
* <w:docDefaults>...</w:docDefaults>
|
|
17156
17741
|
* </w:styles>
|
|
17742
|
+
* ```
|
|
17157
17743
|
*
|
|
17158
|
-
* @param
|
|
17744
|
+
* @param xmlData - XML string containing styles data from styles.xml
|
|
17745
|
+
* @returns Styles object containing all parsed styles
|
|
17746
|
+
* @throws Error if styles element cannot be found in the XML
|
|
17159
17747
|
*/
|
|
17160
17748
|
newInstance(xmlData) {
|
|
17161
17749
|
const xmlObj = libExports.xml2js(xmlData, { compact: false });
|
|
@@ -17169,11 +17757,10 @@ class ExternalStylesFactory {
|
|
|
17169
17757
|
throw new Error("can not find styles element");
|
|
17170
17758
|
}
|
|
17171
17759
|
const stylesElements = stylesXmlElement.elements || [];
|
|
17172
|
-
|
|
17760
|
+
return {
|
|
17173
17761
|
initialStyles: new ImportedRootElementAttributes(stylesXmlElement.attributes),
|
|
17174
17762
|
importedStyles: stylesElements.map((childElm) => convertToXmlComponent(childElm))
|
|
17175
|
-
}
|
|
17176
|
-
return importedStyle;
|
|
17763
|
+
};
|
|
17177
17764
|
}
|
|
17178
17765
|
}
|
|
17179
17766
|
class DefaultStylesFactory {
|
|
@@ -17258,7 +17845,7 @@ class File {
|
|
|
17258
17845
|
__publicField(this, "styles");
|
|
17259
17846
|
__publicField(this, "comments");
|
|
17260
17847
|
__publicField(this, "fontWrapper");
|
|
17261
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
17848
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
17262
17849
|
this.coreProperties = new CoreProperties(__spreadProps(__spreadValues({}, options), {
|
|
17263
17850
|
creator: (_a = options.creator) != null ? _a : "Un-named",
|
|
17264
17851
|
revision: (_b = options.revision) != null ? _b : 1,
|
|
@@ -17288,8 +17875,13 @@ class File {
|
|
|
17288
17875
|
});
|
|
17289
17876
|
this.media = new Media();
|
|
17290
17877
|
if (options.externalStyles !== void 0) {
|
|
17291
|
-
const
|
|
17292
|
-
|
|
17878
|
+
const defaultFactory = new DefaultStylesFactory();
|
|
17879
|
+
const defaultStyles = defaultFactory.newInstance((_l = options.styles) == null ? void 0 : _l.default);
|
|
17880
|
+
const externalFactory = new ExternalStylesFactory();
|
|
17881
|
+
const externalStyles = externalFactory.newInstance(options.externalStyles);
|
|
17882
|
+
this.styles = new Styles(__spreadProps(__spreadValues({}, externalStyles), {
|
|
17883
|
+
importedStyles: [...defaultStyles.importedStyles, ...externalStyles.importedStyles]
|
|
17884
|
+
}));
|
|
17293
17885
|
} else if (options.styles) {
|
|
17294
17886
|
const stylesFactory = new DefaultStylesFactory();
|
|
17295
17887
|
const defaultStyles = stylesFactory.newInstance(options.styles.default);
|
|
@@ -17307,7 +17899,7 @@ class File {
|
|
|
17307
17899
|
this.footnotesWrapper.View.createFootNote(parseFloat(key), options.footnotes[key].children);
|
|
17308
17900
|
}
|
|
17309
17901
|
}
|
|
17310
|
-
this.fontWrapper = new FontWrapper((
|
|
17902
|
+
this.fontWrapper = new FontWrapper((_m = options.fonts) != null ? _m : []);
|
|
17311
17903
|
}
|
|
17312
17904
|
addSection({ headers = {}, footers = {}, children, properties }) {
|
|
17313
17905
|
this.documentWrapper.View.Body.addSection(__spreadProps(__spreadValues({}, properties), {
|
|
@@ -17556,7 +18148,9 @@ class TableOfContents extends FileChild {
|
|
|
17556
18148
|
}
|
|
17557
18149
|
class StyleLevel {
|
|
17558
18150
|
constructor(styleName, level) {
|
|
18151
|
+
/** The name of the paragraph style. */
|
|
17559
18152
|
__publicField(this, "styleName");
|
|
18153
|
+
/** The TOC level (1-9) to assign to this style. */
|
|
17560
18154
|
__publicField(this, "level");
|
|
17561
18155
|
this.styleName = styleName;
|
|
17562
18156
|
this.level = level;
|
|
@@ -17593,6 +18187,11 @@ class FootnoteReference extends XmlComponent {
|
|
|
17593
18187
|
}
|
|
17594
18188
|
}
|
|
17595
18189
|
class FootnoteReferenceRun extends Run {
|
|
18190
|
+
/**
|
|
18191
|
+
* Creates a new footnote reference run.
|
|
18192
|
+
*
|
|
18193
|
+
* @param id - Unique identifier linking to the footnote content
|
|
18194
|
+
*/
|
|
17596
18195
|
constructor(id) {
|
|
17597
18196
|
super({ style: "FootnoteReference" });
|
|
17598
18197
|
this.root.push(new FootnoteReference(id));
|
|
@@ -17865,11 +18464,11 @@ var hasRequiredJszip_min;
|
|
|
17865
18464
|
function requireJszip_min() {
|
|
17866
18465
|
if (hasRequiredJszip_min) return jszip_min.exports;
|
|
17867
18466
|
hasRequiredJszip_min = 1;
|
|
17868
|
-
(function(module, exports) {
|
|
17869
|
-
!function(e) {
|
|
18467
|
+
(function(module, exports$1) {
|
|
18468
|
+
!(function(e) {
|
|
17870
18469
|
module.exports = e();
|
|
17871
|
-
}(function() {
|
|
17872
|
-
return function s(a, o, h) {
|
|
18470
|
+
})(function() {
|
|
18471
|
+
return (function s(a, o, h) {
|
|
17873
18472
|
function u(r, e2) {
|
|
17874
18473
|
if (!o[r]) {
|
|
17875
18474
|
if (!a[r]) {
|
|
@@ -17889,7 +18488,7 @@ function requireJszip_min() {
|
|
|
17889
18488
|
}
|
|
17890
18489
|
for (var l = "function" == typeof commonjsRequire && commonjsRequire, e = 0; e < h.length; e++) u(h[e]);
|
|
17891
18490
|
return u;
|
|
17892
|
-
}({ 1: [function(e, t, r) {
|
|
18491
|
+
})({ 1: [function(e, t, r) {
|
|
17893
18492
|
var d = e("./utils"), c = e("./support"), p = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
17894
18493
|
r.encode = function(e2) {
|
|
17895
18494
|
for (var t2, r2, n, i, s, a, o, h = [], u = 0, l = e2.length, f = l, c2 = "string" !== d.getTypeOf(e2); u < e2.length; ) f = l - u, n = c2 ? (t2 = e2[u++], r2 = u < l ? e2[u++] : 0, u < l ? e2[u++] : 0) : (t2 = e2.charCodeAt(u++), r2 = u < l ? e2.charCodeAt(u++) : 0, u < l ? e2.charCodeAt(u++) : 0), i = t2 >> 2, s = (3 & t2) << 4 | r2 >> 4, a = 1 < f ? (15 & r2) << 2 | n >> 6 : 64, o = 2 < f ? 63 & n : 64, h.push(p.charAt(i) + p.charAt(s) + p.charAt(a) + p.charAt(o));
|
|
@@ -17926,26 +18525,26 @@ function requireJszip_min() {
|
|
|
17926
18525
|
} }, r.DEFLATE = e("./flate");
|
|
17927
18526
|
}, { "./flate": 7, "./stream/GenericWorker": 28 }], 4: [function(e, t, r) {
|
|
17928
18527
|
var n = e("./utils");
|
|
17929
|
-
var o = function() {
|
|
18528
|
+
var o = (function() {
|
|
17930
18529
|
for (var e2, t2 = [], r2 = 0; r2 < 256; r2++) {
|
|
17931
18530
|
e2 = r2;
|
|
17932
18531
|
for (var n2 = 0; n2 < 8; n2++) e2 = 1 & e2 ? 3988292384 ^ e2 >>> 1 : e2 >>> 1;
|
|
17933
18532
|
t2[r2] = e2;
|
|
17934
18533
|
}
|
|
17935
18534
|
return t2;
|
|
17936
|
-
}();
|
|
18535
|
+
})();
|
|
17937
18536
|
t.exports = function(e2, t2) {
|
|
17938
|
-
return void 0 !== e2 && e2.length ? "string" !== n.getTypeOf(e2) ? function(e3, t3, r2, n2) {
|
|
18537
|
+
return void 0 !== e2 && e2.length ? "string" !== n.getTypeOf(e2) ? (function(e3, t3, r2, n2) {
|
|
17939
18538
|
var i = o, s = n2 + r2;
|
|
17940
18539
|
e3 ^= -1;
|
|
17941
18540
|
for (var a = n2; a < s; a++) e3 = e3 >>> 8 ^ i[255 & (e3 ^ t3[a])];
|
|
17942
18541
|
return -1 ^ e3;
|
|
17943
|
-
}(0 | t2, e2, e2.length, 0) : function(e3, t3, r2, n2) {
|
|
18542
|
+
})(0 | t2, e2, e2.length, 0) : (function(e3, t3, r2, n2) {
|
|
17944
18543
|
var i = o, s = n2 + r2;
|
|
17945
18544
|
e3 ^= -1;
|
|
17946
18545
|
for (var a = n2; a < s; a++) e3 = e3 >>> 8 ^ i[255 & (e3 ^ t3.charCodeAt(a))];
|
|
17947
18546
|
return -1 ^ e3;
|
|
17948
|
-
}(0 | t2, e2, e2.length, 0) : 0;
|
|
18547
|
+
})(0 | t2, e2, e2.length, 0) : 0;
|
|
17949
18548
|
};
|
|
17950
18549
|
}, { "./utils": 32 }], 5: [function(e, t, r) {
|
|
17951
18550
|
r.base64 = false, r.binary = false, r.dir = false, r.createFolders = true, r.date = null, r.compression = null, r.compressionOptions = null, r.comment = null, r.unixPermissions = null, r.dosPermissions = null;
|
|
@@ -17986,12 +18585,12 @@ function requireJszip_min() {
|
|
|
17986
18585
|
var S = 0;
|
|
17987
18586
|
t2 && (S |= 8), l || !_ && !g || (S |= 2048);
|
|
17988
18587
|
var z = 0, C = 0;
|
|
17989
|
-
w && (z |= 16), "UNIX" === i2 ? (C = 798, z |= function(e3, t3) {
|
|
18588
|
+
w && (z |= 16), "UNIX" === i2 ? (C = 798, z |= (function(e3, t3) {
|
|
17990
18589
|
var r3 = e3;
|
|
17991
18590
|
return e3 || (r3 = t3 ? 16893 : 33204), (65535 & r3) << 16;
|
|
17992
|
-
}(h.unixPermissions, w)) : (C = 20, z |= function(e3) {
|
|
18591
|
+
})(h.unixPermissions, w)) : (C = 20, z |= (function(e3) {
|
|
17993
18592
|
return 63 & (e3 || 0);
|
|
17994
|
-
}(h.dosPermissions)), a = k.getUTCHours(), a <<= 6, a |= k.getUTCMinutes(), a <<= 5, a |= k.getUTCSeconds() / 2, o = k.getUTCFullYear() - 1980, o <<= 4, o |= k.getUTCMonth() + 1, o <<= 5, o |= k.getUTCDate(), _ && (v = A(1, 1) + A(B(f), 4) + c, b += "up" + A(v.length, 2) + v), g && (y = A(1, 1) + A(B(p), 4) + m, b += "uc" + A(y.length, 2) + y);
|
|
18593
|
+
})(h.dosPermissions)), a = k.getUTCHours(), a <<= 6, a |= k.getUTCMinutes(), a <<= 5, a |= k.getUTCSeconds() / 2, o = k.getUTCFullYear() - 1980, o <<= 4, o |= k.getUTCMonth() + 1, o <<= 5, o |= k.getUTCDate(), _ && (v = A(1, 1) + A(B(f), 4) + c, b += "up" + A(v.length, 2) + v), g && (y = A(1, 1) + A(B(p), 4) + m, b += "uc" + A(y.length, 2) + y);
|
|
17995
18594
|
var E = "";
|
|
17996
18595
|
return E += "\n\0", E += A(S, 2), E += u.magic, E += A(a, 2), E += A(o, 2), E += A(x.crc32, 4), E += A(x.compressedSize, 4), E += A(x.uncompressedSize, 4), E += A(f.length, 2), E += A(b.length, 2), { fileRecord: R.LOCAL_FILE_HEADER + E + f + b, dirRecord: R.CENTRAL_FILE_HEADER + A(C, 2) + E + A(p.length, 2) + "\0\0\0\0" + A(z, 4) + A(n2, 4) + f + b + p };
|
|
17997
18596
|
}
|
|
@@ -18012,17 +18611,17 @@ function requireJszip_min() {
|
|
|
18012
18611
|
}, s.prototype.closedSource = function(e2) {
|
|
18013
18612
|
this.accumulate = false;
|
|
18014
18613
|
var t2 = this.streamFiles && !e2.file.dir, r2 = n(e2, t2, true, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
|
|
18015
|
-
if (this.dirRecords.push(r2.dirRecord), t2) this.push({ data: function(e3) {
|
|
18614
|
+
if (this.dirRecords.push(r2.dirRecord), t2) this.push({ data: (function(e3) {
|
|
18016
18615
|
return R.DATA_DESCRIPTOR + A(e3.crc32, 4) + A(e3.compressedSize, 4) + A(e3.uncompressedSize, 4);
|
|
18017
|
-
}(e2), meta: { percent: 100 } });
|
|
18616
|
+
})(e2), meta: { percent: 100 } });
|
|
18018
18617
|
else for (this.push({ data: r2.fileRecord, meta: { percent: 0 } }); this.contentBuffer.length; ) this.push(this.contentBuffer.shift());
|
|
18019
18618
|
this.currentFile = null;
|
|
18020
18619
|
}, s.prototype.flush = function() {
|
|
18021
18620
|
for (var e2 = this.bytesWritten, t2 = 0; t2 < this.dirRecords.length; t2++) this.push({ data: this.dirRecords[t2], meta: { percent: 100 } });
|
|
18022
|
-
var r2 = this.bytesWritten - e2, n2 = function(e3, t3, r3, n3, i2) {
|
|
18621
|
+
var r2 = this.bytesWritten - e2, n2 = (function(e3, t3, r3, n3, i2) {
|
|
18023
18622
|
var s2 = I.transformTo("string", i2(n3));
|
|
18024
18623
|
return R.CENTRAL_DIRECTORY_END + "\0\0\0\0" + A(e3, 2) + A(e3, 2) + A(t3, 4) + A(r3, 4) + A(s2.length, 2) + s2;
|
|
18025
|
-
}(this.dirRecords.length, r2, e2, this.zipComment, this.encodeFileName);
|
|
18624
|
+
})(this.dirRecords.length, r2, e2, this.zipComment, this.encodeFileName);
|
|
18026
18625
|
this.push({ data: n2, meta: { percent: 100 } });
|
|
18027
18626
|
}, s.prototype.prepareNextSource = function() {
|
|
18028
18627
|
this.previous = this._sources.shift(), this.openedSource(this.previous.streamInfo), this.isPaused ? this.previous.pause() : this.previous.resume();
|
|
@@ -18057,11 +18656,11 @@ function requireJszip_min() {
|
|
|
18057
18656
|
try {
|
|
18058
18657
|
e2.forEach(function(e3, t3) {
|
|
18059
18658
|
h++;
|
|
18060
|
-
var r2 = function(e4, t4) {
|
|
18659
|
+
var r2 = (function(e4, t4) {
|
|
18061
18660
|
var r3 = e4 || t4, n3 = u[r3];
|
|
18062
18661
|
if (!n3) throw new Error(r3 + " is not a valid compression method !");
|
|
18063
18662
|
return n3;
|
|
18064
|
-
}(t3.options.compression, a.compression), n2 = t3.options.compressionOptions || a.compressionOptions || {}, i = t3.dir, s = t3.date;
|
|
18663
|
+
})(t3.options.compression, a.compression), n2 = t3.options.compressionOptions || a.compressionOptions || {}, i = t3.dir, s = t3.date;
|
|
18065
18664
|
t3._compressWorker(r2, n2).withStreamInfo("file", { name: e3, dir: i, date: s, comment: t3.comment || "", unixPermissions: t3.unixPermissions, dosPermissions: t3.dosPermissions }).pipe(o);
|
|
18066
18665
|
}), o.entriesCount = h;
|
|
18067
18666
|
} catch (e3) {
|
|
@@ -18462,7 +19061,7 @@ function requireJszip_min() {
|
|
|
18462
19061
|
n2 = [], r2(e3);
|
|
18463
19062
|
}).on("end", function() {
|
|
18464
19063
|
try {
|
|
18465
|
-
var e3 = function(e4, t3, r3) {
|
|
19064
|
+
var e3 = (function(e4, t3, r3) {
|
|
18466
19065
|
switch (e4) {
|
|
18467
19066
|
case "blob":
|
|
18468
19067
|
return h.newBlob(h.transformTo("arraybuffer", t3), r3);
|
|
@@ -18471,7 +19070,7 @@ function requireJszip_min() {
|
|
|
18471
19070
|
default:
|
|
18472
19071
|
return h.transformTo(e4, t3);
|
|
18473
19072
|
}
|
|
18474
|
-
}(s2, function(e4, t3) {
|
|
19073
|
+
})(s2, (function(e4, t3) {
|
|
18475
19074
|
var r3, n3 = 0, i3 = null, s3 = 0;
|
|
18476
19075
|
for (r3 = 0; r3 < t3.length; r3++) s3 += t3[r3].length;
|
|
18477
19076
|
switch (e4) {
|
|
@@ -18487,7 +19086,7 @@ function requireJszip_min() {
|
|
|
18487
19086
|
default:
|
|
18488
19087
|
throw new Error("concat : unsupported type '" + e4 + "'");
|
|
18489
19088
|
}
|
|
18490
|
-
}(i2, n2), a2);
|
|
19089
|
+
})(i2, n2), a2);
|
|
18491
19090
|
t2(e3);
|
|
18492
19091
|
} catch (e4) {
|
|
18493
19092
|
r2(e4);
|
|
@@ -18559,14 +19158,14 @@ function requireJszip_min() {
|
|
|
18559
19158
|
n.call(this, "utf-8 encode");
|
|
18560
19159
|
}
|
|
18561
19160
|
s.utf8encode = function(e2) {
|
|
18562
|
-
return h.nodebuffer ? r.newBufferFrom(e2, "utf-8") : function(e3) {
|
|
19161
|
+
return h.nodebuffer ? r.newBufferFrom(e2, "utf-8") : (function(e3) {
|
|
18563
19162
|
var t2, r2, n2, i2, s2, a2 = e3.length, o2 = 0;
|
|
18564
19163
|
for (i2 = 0; i2 < a2; i2++) 55296 == (64512 & (r2 = e3.charCodeAt(i2))) && i2 + 1 < a2 && 56320 == (64512 & (n2 = e3.charCodeAt(i2 + 1))) && (r2 = 65536 + (r2 - 55296 << 10) + (n2 - 56320), i2++), o2 += r2 < 128 ? 1 : r2 < 2048 ? 2 : r2 < 65536 ? 3 : 4;
|
|
18565
19164
|
for (t2 = h.uint8array ? new Uint8Array(o2) : new Array(o2), i2 = s2 = 0; s2 < o2; i2++) 55296 == (64512 & (r2 = e3.charCodeAt(i2))) && i2 + 1 < a2 && 56320 == (64512 & (n2 = e3.charCodeAt(i2 + 1))) && (r2 = 65536 + (r2 - 55296 << 10) + (n2 - 56320), i2++), r2 < 128 ? t2[s2++] = r2 : (r2 < 2048 ? t2[s2++] = 192 | r2 >>> 6 : (r2 < 65536 ? t2[s2++] = 224 | r2 >>> 12 : (t2[s2++] = 240 | r2 >>> 18, t2[s2++] = 128 | r2 >>> 12 & 63), t2[s2++] = 128 | r2 >>> 6 & 63), t2[s2++] = 128 | 63 & r2);
|
|
18566
19165
|
return t2;
|
|
18567
|
-
}(e2);
|
|
19166
|
+
})(e2);
|
|
18568
19167
|
}, s.utf8decode = function(e2) {
|
|
18569
|
-
return h.nodebuffer ? o.transformTo("nodebuffer", e2).toString("utf-8") : function(e3) {
|
|
19168
|
+
return h.nodebuffer ? o.transformTo("nodebuffer", e2).toString("utf-8") : (function(e3) {
|
|
18570
19169
|
var t2, r2, n2, i2, s2 = e3.length, a2 = new Array(2 * s2);
|
|
18571
19170
|
for (t2 = r2 = 0; t2 < s2; ) if ((n2 = e3[t2++]) < 128) a2[r2++] = n2;
|
|
18572
19171
|
else if (4 < (i2 = u[n2])) a2[r2++] = 65533, t2 += i2 - 1;
|
|
@@ -18575,7 +19174,7 @@ function requireJszip_min() {
|
|
|
18575
19174
|
1 < i2 ? a2[r2++] = 65533 : n2 < 65536 ? a2[r2++] = n2 : (n2 -= 65536, a2[r2++] = 55296 | n2 >> 10 & 1023, a2[r2++] = 56320 | 1023 & n2);
|
|
18576
19175
|
}
|
|
18577
19176
|
return a2.length !== r2 && (a2.subarray ? a2 = a2.subarray(0, r2) : a2.length = r2), o.applyFromCharCode(a2);
|
|
18578
|
-
}(e2 = o.transformTo(h.uint8array ? "uint8array" : "array", e2));
|
|
19177
|
+
})(e2 = o.transformTo(h.uint8array ? "uint8array" : "array", e2));
|
|
18579
19178
|
}, o.inherits(a, n), a.prototype.processChunk = function(e2) {
|
|
18580
19179
|
var t2 = o.transformTo(h.uint8array ? "uint8array" : "array", e2.data);
|
|
18581
19180
|
if (this.leftOver && this.leftOver.length) {
|
|
@@ -18585,11 +19184,11 @@ function requireJszip_min() {
|
|
|
18585
19184
|
} else t2 = this.leftOver.concat(t2);
|
|
18586
19185
|
this.leftOver = null;
|
|
18587
19186
|
}
|
|
18588
|
-
var n2 = function(e3, t3) {
|
|
19187
|
+
var n2 = (function(e3, t3) {
|
|
18589
19188
|
var r3;
|
|
18590
19189
|
for ((t3 = t3 || e3.length) > e3.length && (t3 = e3.length), r3 = t3 - 1; 0 <= r3 && 128 == (192 & e3[r3]); ) r3--;
|
|
18591
19190
|
return r3 < 0 ? t3 : 0 === r3 ? t3 : r3 + u[e3[r3]] > t3 ? r3 : t3;
|
|
18592
|
-
}(t2), i2 = t2;
|
|
19191
|
+
})(t2), i2 = t2;
|
|
18593
19192
|
n2 !== t2.length && (h.uint8array ? (i2 = t2.subarray(0, n2), this.leftOver = t2.subarray(n2, t2.length)) : (i2 = t2.slice(0, n2), this.leftOver = t2.slice(n2, t2.length))), this.push({ data: s.utf8decode(i2), meta: e2.meta });
|
|
18594
19193
|
}, a.prototype.flush = function() {
|
|
18595
19194
|
this.leftOver && this.leftOver.length && (this.push({ data: s.utf8decode(this.leftOver), meta: {} }), this.leftOver = null);
|
|
@@ -18626,19 +19225,19 @@ function requireJszip_min() {
|
|
|
18626
19225
|
}, stringifyByChar: function(e2) {
|
|
18627
19226
|
for (var t2 = "", r2 = 0; r2 < e2.length; r2++) t2 += String.fromCharCode(e2[r2]);
|
|
18628
19227
|
return t2;
|
|
18629
|
-
}, applyCanBeUsed: { uint8array: function() {
|
|
19228
|
+
}, applyCanBeUsed: { uint8array: (function() {
|
|
18630
19229
|
try {
|
|
18631
19230
|
return o.uint8array && 1 === String.fromCharCode.apply(null, new Uint8Array(1)).length;
|
|
18632
19231
|
} catch (e2) {
|
|
18633
19232
|
return false;
|
|
18634
19233
|
}
|
|
18635
|
-
}(), nodebuffer: function() {
|
|
19234
|
+
})(), nodebuffer: (function() {
|
|
18636
19235
|
try {
|
|
18637
19236
|
return o.nodebuffer && 1 === String.fromCharCode.apply(null, r.allocBuffer(1)).length;
|
|
18638
19237
|
} catch (e2) {
|
|
18639
19238
|
return false;
|
|
18640
19239
|
}
|
|
18641
|
-
}() } };
|
|
19240
|
+
})() } };
|
|
18642
19241
|
function s(e2) {
|
|
18643
19242
|
var t2 = 65536, r2 = a.getTypeOf(e2), n2 = true;
|
|
18644
19243
|
if ("uint8array" === r2 ? n2 = i.applyCanBeUsed.uint8array : "nodebuffer" === r2 && (n2 = i.applyCanBeUsed.nodebuffer), n2) for (; 1 < t2; ) try {
|
|
@@ -18731,9 +19330,9 @@ function requireJszip_min() {
|
|
|
18731
19330
|
}) : n3;
|
|
18732
19331
|
}).then(function(e3) {
|
|
18733
19332
|
var t2 = a.getTypeOf(e3);
|
|
18734
|
-
return t2 ? ("arraybuffer" === t2 ? e3 = a.transformTo("uint8array", e3) : "string" === t2 && (s2 ? e3 = h.decode(e3) : n2 && true !== i2 && (e3 = function(e4) {
|
|
19333
|
+
return t2 ? ("arraybuffer" === t2 ? e3 = a.transformTo("uint8array", e3) : "string" === t2 && (s2 ? e3 = h.decode(e3) : n2 && true !== i2 && (e3 = (function(e4) {
|
|
18735
19334
|
return l(e4, o.uint8array ? new Uint8Array(e4.length) : new Array(e4.length));
|
|
18736
|
-
}(e3))), e3) : u.Promise.reject(new Error("Can't read the data of '" + r2 + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));
|
|
19335
|
+
})(e3))), e3) : u.Promise.reject(new Error("Can't read the data of '" + r2 + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));
|
|
18737
19336
|
});
|
|
18738
19337
|
};
|
|
18739
19338
|
}, { "./base64": 1, "./external": 6, "./nodejsUtils": 14, "./support": 30, setimmediate: 54 }], 33: [function(e, t, r) {
|
|
@@ -18800,10 +19399,10 @@ function requireJszip_min() {
|
|
|
18800
19399
|
}, readLocalPart: function(e2) {
|
|
18801
19400
|
var t2, r2;
|
|
18802
19401
|
if (e2.skip(22), this.fileNameLength = e2.readInt(2), r2 = e2.readInt(2), this.fileName = e2.readData(this.fileNameLength), e2.skip(r2), -1 === this.compressedSize || -1 === this.uncompressedSize) throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");
|
|
18803
|
-
if (null === (t2 = function(e3) {
|
|
19402
|
+
if (null === (t2 = (function(e3) {
|
|
18804
19403
|
for (var t3 in h) if (Object.prototype.hasOwnProperty.call(h, t3) && h[t3].magic === e3) return h[t3];
|
|
18805
19404
|
return null;
|
|
18806
|
-
}(this.compressionMethod))) throw new Error("Corrupted zip : compression " + s.pretty(this.compressionMethod) + " unknown (inner file : " + s.transformTo("string", this.fileName) + ")");
|
|
19405
|
+
})(this.compressionMethod))) throw new Error("Corrupted zip : compression " + s.pretty(this.compressionMethod) + " unknown (inner file : " + s.transformTo("string", this.fileName) + ")");
|
|
18807
19406
|
this.decompressed = new i(this.compressedSize, this.uncompressedSize, this.crc32, t2, e2.readData(this.compressedSize));
|
|
18808
19407
|
}, readCentralPart: function(e2) {
|
|
18809
19408
|
this.versionMadeBy = e2.readInt(2), e2.skip(2), this.bitFlag = e2.readInt(2), this.compressionMethod = e2.readString(2), this.date = e2.readDate(), this.crc32 = e2.readInt(4), this.compressedSize = e2.readInt(4), this.uncompressedSize = e2.readInt(4);
|
|
@@ -19206,14 +19805,14 @@ function requireJszip_min() {
|
|
|
19206
19805
|
}, {}], 44: [function(e, t, r) {
|
|
19207
19806
|
t.exports = { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_BUF_ERROR: -5, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, Z_BINARY: 0, Z_TEXT: 1, Z_UNKNOWN: 2, Z_DEFLATED: 8 };
|
|
19208
19807
|
}, {}], 45: [function(e, t, r) {
|
|
19209
|
-
var o = function() {
|
|
19808
|
+
var o = (function() {
|
|
19210
19809
|
for (var e2, t2 = [], r2 = 0; r2 < 256; r2++) {
|
|
19211
19810
|
e2 = r2;
|
|
19212
19811
|
for (var n = 0; n < 8; n++) e2 = 1 & e2 ? 3988292384 ^ e2 >>> 1 : e2 >>> 1;
|
|
19213
19812
|
t2[r2] = e2;
|
|
19214
19813
|
}
|
|
19215
19814
|
return t2;
|
|
19216
|
-
}();
|
|
19815
|
+
})();
|
|
19217
19816
|
t.exports = function(e2, t2, r2, n) {
|
|
19218
19817
|
var i = o, s = n + r2;
|
|
19219
19818
|
e2 ^= -1;
|
|
@@ -19314,9 +19913,9 @@ function requireJszip_min() {
|
|
|
19314
19913
|
}
|
|
19315
19914
|
function K(e2) {
|
|
19316
19915
|
var t2 = G(e2);
|
|
19317
|
-
return t2 === m && function(e3) {
|
|
19916
|
+
return t2 === m && (function(e3) {
|
|
19318
19917
|
e3.window_size = 2 * e3.w_size, D(e3.head), e3.max_lazy_match = h[e3.level].max_lazy, e3.good_match = h[e3.level].good_length, e3.nice_match = h[e3.level].nice_length, e3.max_chain_length = h[e3.level].max_chain, e3.strstart = 0, e3.block_start = 0, e3.lookahead = 0, e3.insert = 0, e3.match_length = e3.prev_length = x - 1, e3.match_available = 0, e3.ins_h = 0;
|
|
19319
|
-
}(e2.state), t2;
|
|
19918
|
+
})(e2.state), t2;
|
|
19320
19919
|
}
|
|
19321
19920
|
function Y(e2, t2, r2, n2, i2, s2) {
|
|
19322
19921
|
if (!e2) return _;
|
|
@@ -19383,7 +19982,7 @@ function requireJszip_min() {
|
|
|
19383
19982
|
} else if (0 === e2.avail_in && T(t2) <= T(r2) && t2 !== f) return R(e2, -5);
|
|
19384
19983
|
if (666 === n2.status && 0 !== e2.avail_in) return R(e2, -5);
|
|
19385
19984
|
if (0 !== e2.avail_in || 0 !== n2.lookahead || t2 !== l && 666 !== n2.status) {
|
|
19386
|
-
var o2 = 2 === n2.strategy ? function(e3, t3) {
|
|
19985
|
+
var o2 = 2 === n2.strategy ? (function(e3, t3) {
|
|
19387
19986
|
for (var r3; ; ) {
|
|
19388
19987
|
if (0 === e3.lookahead && (j(e3), 0 === e3.lookahead)) {
|
|
19389
19988
|
if (t3 === l) return A;
|
|
@@ -19392,7 +19991,7 @@ function requireJszip_min() {
|
|
|
19392
19991
|
if (e3.match_length = 0, r3 = u._tr_tally(e3, 0, e3.window[e3.strstart]), e3.lookahead--, e3.strstart++, r3 && (N(e3, false), 0 === e3.strm.avail_out)) return A;
|
|
19393
19992
|
}
|
|
19394
19993
|
return e3.insert = 0, t3 === f ? (N(e3, true), 0 === e3.strm.avail_out ? O : B) : e3.last_lit && (N(e3, false), 0 === e3.strm.avail_out) ? A : I;
|
|
19395
|
-
}(n2, t2) : 3 === n2.strategy ? function(e3, t3) {
|
|
19994
|
+
})(n2, t2) : 3 === n2.strategy ? (function(e3, t3) {
|
|
19396
19995
|
for (var r3, n3, i3, s3, a3 = e3.window; ; ) {
|
|
19397
19996
|
if (e3.lookahead <= S) {
|
|
19398
19997
|
if (j(e3), e3.lookahead <= S && t3 === l) return A;
|
|
@@ -19407,7 +20006,7 @@ function requireJszip_min() {
|
|
|
19407
20006
|
if (e3.match_length >= x ? (r3 = u._tr_tally(e3, 1, e3.match_length - x), e3.lookahead -= e3.match_length, e3.strstart += e3.match_length, e3.match_length = 0) : (r3 = u._tr_tally(e3, 0, e3.window[e3.strstart]), e3.lookahead--, e3.strstart++), r3 && (N(e3, false), 0 === e3.strm.avail_out)) return A;
|
|
19408
20007
|
}
|
|
19409
20008
|
return e3.insert = 0, t3 === f ? (N(e3, true), 0 === e3.strm.avail_out ? O : B) : e3.last_lit && (N(e3, false), 0 === e3.strm.avail_out) ? A : I;
|
|
19410
|
-
}(n2, t2) : h[n2.level].func(n2, t2);
|
|
20009
|
+
})(n2, t2) : h[n2.level].func(n2, t2);
|
|
19411
20010
|
if (o2 !== O && o2 !== B || (n2.status = 666), o2 === A || o2 === O) return 0 === e2.avail_out && (n2.last_flush = -1), m;
|
|
19412
20011
|
if (o2 === I && (1 === t2 ? u._tr_align(n2) : 5 !== t2 && (u._tr_stored_block(n2, 0, 0, false), 3 === t2 && (D(n2.head), 0 === n2.lookahead && (n2.strstart = 0, n2.block_start = 0, n2.insert = 0))), F(e2), 0 === e2.avail_out)) return n2.last_flush = -1, m;
|
|
19413
20012
|
}
|
|
@@ -20016,7 +20615,7 @@ function requireJszip_min() {
|
|
|
20016
20615
|
for (; e2.heap_len < 2; ) s2[2 * (i2 = e2.heap[++e2.heap_len] = u2 < 2 ? ++u2 : 0)] = 1, e2.depth[i2] = 0, e2.opt_len--, o2 && (e2.static_len -= a2[2 * i2 + 1]);
|
|
20017
20616
|
for (t2.max_code = u2, r2 = e2.heap_len >> 1; 1 <= r2; r2--) G(e2, s2, r2);
|
|
20018
20617
|
for (i2 = h2; r2 = e2.heap[1], e2.heap[1] = e2.heap[e2.heap_len--], G(e2, s2, 1), n2 = e2.heap[1], e2.heap[--e2.heap_max] = r2, e2.heap[--e2.heap_max] = n2, s2[2 * i2] = s2[2 * r2] + s2[2 * n2], e2.depth[i2] = (e2.depth[r2] >= e2.depth[n2] ? e2.depth[r2] : e2.depth[n2]) + 1, s2[2 * r2 + 1] = s2[2 * n2 + 1] = i2, e2.heap[1] = i2++, G(e2, s2, 1), 2 <= e2.heap_len; ) ;
|
|
20019
|
-
e2.heap[--e2.heap_max] = e2.heap[1], function(e3, t3) {
|
|
20618
|
+
e2.heap[--e2.heap_max] = e2.heap[1], (function(e3, t3) {
|
|
20020
20619
|
var r3, n3, i3, s3, a3, o3, h3 = t3.dyn_tree, u3 = t3.max_code, l2 = t3.stat_desc.static_tree, f2 = t3.stat_desc.has_stree, c2 = t3.stat_desc.extra_bits, d2 = t3.stat_desc.extra_base, p2 = t3.stat_desc.max_length, m2 = 0;
|
|
20021
20620
|
for (s3 = 0; s3 <= g; s3++) e3.bl_count[s3] = 0;
|
|
20022
20621
|
for (h3[2 * e3.heap[e3.heap_max] + 1] = 0, r3 = e3.heap_max + 1; r3 < _; r3++) p2 < (s3 = h3[2 * h3[2 * (n3 = e3.heap[r3]) + 1] + 1] + 1) && (s3 = p2, m2++), h3[2 * n3 + 1] = s3, u3 < n3 || (e3.bl_count[s3]++, a3 = 0, d2 <= n3 && (a3 = c2[n3 - d2]), o3 = h3[2 * n3], e3.opt_len += o3 * (s3 + a3), f2 && (e3.static_len += o3 * (l2[2 * n3 + 1] + a3)));
|
|
@@ -20027,7 +20626,7 @@ function requireJszip_min() {
|
|
|
20027
20626
|
} while (0 < m2);
|
|
20028
20627
|
for (s3 = p2; 0 !== s3; s3--) for (n3 = e3.bl_count[s3]; 0 !== n3; ) u3 < (i3 = e3.heap[--r3]) || (h3[2 * i3 + 1] !== s3 && (e3.opt_len += (s3 - h3[2 * i3 + 1]) * h3[2 * i3], h3[2 * i3 + 1] = s3), n3--);
|
|
20029
20628
|
}
|
|
20030
|
-
}(e2, t2), Z(s2, u2, e2.bl_count);
|
|
20629
|
+
})(e2, t2), Z(s2, u2, e2.bl_count);
|
|
20031
20630
|
}
|
|
20032
20631
|
function X(e2, t2, r2) {
|
|
20033
20632
|
var n2, i2, s2 = -1, a2 = t2[1], o2 = 0, h2 = 7, u2 = 4;
|
|
@@ -20044,12 +20643,12 @@ function requireJszip_min() {
|
|
|
20044
20643
|
n(T);
|
|
20045
20644
|
var q = false;
|
|
20046
20645
|
function J(e2, t2, r2, n2) {
|
|
20047
|
-
P(e2, (s << 1) + (n2 ? 1 : 0), 3), function(e3, t3, r3, n3) {
|
|
20646
|
+
P(e2, (s << 1) + (n2 ? 1 : 0), 3), (function(e3, t3, r3, n3) {
|
|
20048
20647
|
M(e3), U(e3, r3), U(e3, ~r3), i.arraySet(e3.pending_buf, e3.window, t3, r3, e3.pending), e3.pending += r3;
|
|
20049
|
-
}(e2, t2, r2);
|
|
20648
|
+
})(e2, t2, r2);
|
|
20050
20649
|
}
|
|
20051
20650
|
r._tr_init = function(e2) {
|
|
20052
|
-
q || (function() {
|
|
20651
|
+
q || ((function() {
|
|
20053
20652
|
var e3, t2, r2, n2, i2, s2 = new Array(g + 1);
|
|
20054
20653
|
for (n2 = r2 = 0; n2 < a - 1; n2++) for (I[n2] = r2, e3 = 0; e3 < 1 << w[n2]; e3++) A[r2++] = n2;
|
|
20055
20654
|
for (A[r2 - 1] = n2, n2 = i2 = 0; n2 < 16; n2++) for (T[n2] = i2, e3 = 0; e3 < 1 << k[n2]; e3++) E[i2++] = n2;
|
|
@@ -20061,30 +20660,30 @@ function requireJszip_min() {
|
|
|
20061
20660
|
for (; e3 <= 287; ) z[2 * e3 + 1] = 8, e3++, s2[8]++;
|
|
20062
20661
|
for (Z(z, l + 1, s2), e3 = 0; e3 < f; e3++) C[2 * e3 + 1] = 5, C[2 * e3] = j(e3, 5);
|
|
20063
20662
|
O = new D(z, w, u + 1, l, g), B = new D(C, k, 0, f, g), R = new D(new Array(0), x, 0, c, p);
|
|
20064
|
-
}(), q = true), e2.l_desc = new F(e2.dyn_ltree, O), e2.d_desc = new F(e2.dyn_dtree, B), e2.bl_desc = new F(e2.bl_tree, R), e2.bi_buf = 0, e2.bi_valid = 0, W(e2);
|
|
20663
|
+
})(), q = true), e2.l_desc = new F(e2.dyn_ltree, O), e2.d_desc = new F(e2.dyn_dtree, B), e2.bl_desc = new F(e2.bl_tree, R), e2.bi_buf = 0, e2.bi_valid = 0, W(e2);
|
|
20065
20664
|
}, r._tr_stored_block = J, r._tr_flush_block = function(e2, t2, r2, n2) {
|
|
20066
20665
|
var i2, s2, a2 = 0;
|
|
20067
|
-
0 < e2.level ? (2 === e2.strm.data_type && (e2.strm.data_type = function(e3) {
|
|
20666
|
+
0 < e2.level ? (2 === e2.strm.data_type && (e2.strm.data_type = (function(e3) {
|
|
20068
20667
|
var t3, r3 = 4093624447;
|
|
20069
20668
|
for (t3 = 0; t3 <= 31; t3++, r3 >>>= 1) if (1 & r3 && 0 !== e3.dyn_ltree[2 * t3]) return o;
|
|
20070
20669
|
if (0 !== e3.dyn_ltree[18] || 0 !== e3.dyn_ltree[20] || 0 !== e3.dyn_ltree[26]) return h;
|
|
20071
20670
|
for (t3 = 32; t3 < u; t3++) if (0 !== e3.dyn_ltree[2 * t3]) return h;
|
|
20072
20671
|
return o;
|
|
20073
|
-
}(e2)), Y(e2, e2.l_desc), Y(e2, e2.d_desc), a2 = function(e3) {
|
|
20672
|
+
})(e2)), Y(e2, e2.l_desc), Y(e2, e2.d_desc), a2 = (function(e3) {
|
|
20074
20673
|
var t3;
|
|
20075
20674
|
for (X(e3, e3.dyn_ltree, e3.l_desc.max_code), X(e3, e3.dyn_dtree, e3.d_desc.max_code), Y(e3, e3.bl_desc), t3 = c - 1; 3 <= t3 && 0 === e3.bl_tree[2 * S[t3] + 1]; t3--) ;
|
|
20076
20675
|
return e3.opt_len += 3 * (t3 + 1) + 5 + 5 + 4, t3;
|
|
20077
|
-
}(e2), i2 = e2.opt_len + 3 + 7 >>> 3, (s2 = e2.static_len + 3 + 7 >>> 3) <= i2 && (i2 = s2)) : i2 = s2 = r2 + 5, r2 + 4 <= i2 && -1 !== t2 ? J(e2, t2, r2, n2) : 4 === e2.strategy || s2 === i2 ? (P(e2, 2 + (n2 ? 1 : 0), 3), K(e2, z, C)) : (P(e2, 4 + (n2 ? 1 : 0), 3), function(e3, t3, r3, n3) {
|
|
20676
|
+
})(e2), i2 = e2.opt_len + 3 + 7 >>> 3, (s2 = e2.static_len + 3 + 7 >>> 3) <= i2 && (i2 = s2)) : i2 = s2 = r2 + 5, r2 + 4 <= i2 && -1 !== t2 ? J(e2, t2, r2, n2) : 4 === e2.strategy || s2 === i2 ? (P(e2, 2 + (n2 ? 1 : 0), 3), K(e2, z, C)) : (P(e2, 4 + (n2 ? 1 : 0), 3), (function(e3, t3, r3, n3) {
|
|
20078
20677
|
var i3;
|
|
20079
20678
|
for (P(e3, t3 - 257, 5), P(e3, r3 - 1, 5), P(e3, n3 - 4, 4), i3 = 0; i3 < n3; i3++) P(e3, e3.bl_tree[2 * S[i3] + 1], 3);
|
|
20080
20679
|
V(e3, e3.dyn_ltree, t3 - 1), V(e3, e3.dyn_dtree, r3 - 1);
|
|
20081
|
-
}(e2, e2.l_desc.max_code + 1, e2.d_desc.max_code + 1, a2 + 1), K(e2, e2.dyn_ltree, e2.dyn_dtree)), W(e2), n2 && M(e2);
|
|
20680
|
+
})(e2, e2.l_desc.max_code + 1, e2.d_desc.max_code + 1, a2 + 1), K(e2, e2.dyn_ltree, e2.dyn_dtree)), W(e2), n2 && M(e2);
|
|
20082
20681
|
}, r._tr_tally = function(e2, t2, r2) {
|
|
20083
20682
|
return e2.pending_buf[e2.d_buf + 2 * e2.last_lit] = t2 >>> 8 & 255, e2.pending_buf[e2.d_buf + 2 * e2.last_lit + 1] = 255 & t2, e2.pending_buf[e2.l_buf + e2.last_lit] = 255 & r2, e2.last_lit++, 0 === t2 ? e2.dyn_ltree[2 * r2]++ : (e2.matches++, t2--, e2.dyn_ltree[2 * (A[r2] + u + 1)]++, e2.dyn_dtree[2 * N(t2)]++), e2.last_lit === e2.lit_bufsize - 1;
|
|
20084
20683
|
}, r._tr_align = function(e2) {
|
|
20085
|
-
P(e2, 2, 3), L(e2, m, z), function(e3) {
|
|
20684
|
+
P(e2, 2, 3), L(e2, m, z), (function(e3) {
|
|
20086
20685
|
16 === e3.bi_valid ? (U(e3, e3.bi_buf), e3.bi_buf = 0, e3.bi_valid = 0) : 8 <= e3.bi_valid && (e3.pending_buf[e3.pending++] = 255 & e3.bi_buf, e3.bi_buf >>= 8, e3.bi_valid -= 8);
|
|
20087
|
-
}(e2);
|
|
20686
|
+
})(e2);
|
|
20088
20687
|
};
|
|
20089
20688
|
}, { "../utils/common": 41 }], 53: [function(e, t, r) {
|
|
20090
20689
|
t.exports = function() {
|
|
@@ -20092,21 +20691,21 @@ function requireJszip_min() {
|
|
|
20092
20691
|
};
|
|
20093
20692
|
}, {}], 54: [function(e, t, r) {
|
|
20094
20693
|
(function(e2) {
|
|
20095
|
-
!function(r2, n) {
|
|
20694
|
+
!(function(r2, n) {
|
|
20096
20695
|
if (!r2.setImmediate) {
|
|
20097
20696
|
var i, s, t2, a, o = 1, h = {}, u = false, l = r2.document, e3 = Object.getPrototypeOf && Object.getPrototypeOf(r2);
|
|
20098
20697
|
e3 = e3 && e3.setTimeout ? e3 : r2, i = "[object process]" === {}.toString.call(r2.process) ? function(e4) {
|
|
20099
20698
|
process$1.nextTick(function() {
|
|
20100
20699
|
c(e4);
|
|
20101
20700
|
});
|
|
20102
|
-
} : function() {
|
|
20701
|
+
} : (function() {
|
|
20103
20702
|
if (r2.postMessage && !r2.importScripts) {
|
|
20104
20703
|
var e4 = true, t3 = r2.onmessage;
|
|
20105
20704
|
return r2.onmessage = function() {
|
|
20106
20705
|
e4 = false;
|
|
20107
20706
|
}, r2.postMessage("", "*"), r2.onmessage = t3, e4;
|
|
20108
20707
|
}
|
|
20109
|
-
}() ? (a = "setImmediate$" + Math.random() + "$", r2.addEventListener ? r2.addEventListener("message", d, false) : r2.attachEvent("onmessage", d), function(e4) {
|
|
20708
|
+
})() ? (a = "setImmediate$" + Math.random() + "$", r2.addEventListener ? r2.addEventListener("message", d, false) : r2.attachEvent("onmessage", d), function(e4) {
|
|
20110
20709
|
r2.postMessage(a + e4, "*");
|
|
20111
20710
|
}) : r2.MessageChannel ? ((t2 = new MessageChannel()).port1.onmessage = function(e4) {
|
|
20112
20711
|
c(e4.data);
|
|
@@ -20136,7 +20735,7 @@ function requireJszip_min() {
|
|
|
20136
20735
|
if (t3) {
|
|
20137
20736
|
u = true;
|
|
20138
20737
|
try {
|
|
20139
|
-
!function(e5) {
|
|
20738
|
+
!(function(e5) {
|
|
20140
20739
|
var t4 = e5.callback, r3 = e5.args;
|
|
20141
20740
|
switch (r3.length) {
|
|
20142
20741
|
case 0:
|
|
@@ -20154,7 +20753,7 @@ function requireJszip_min() {
|
|
|
20154
20753
|
default:
|
|
20155
20754
|
t4.apply(n, r3);
|
|
20156
20755
|
}
|
|
20157
|
-
}(t3);
|
|
20756
|
+
})(t3);
|
|
20158
20757
|
} finally {
|
|
20159
20758
|
f(e4), u = false;
|
|
20160
20759
|
}
|
|
@@ -20164,7 +20763,7 @@ function requireJszip_min() {
|
|
|
20164
20763
|
function d(e4) {
|
|
20165
20764
|
e4.source === r2 && "string" == typeof e4.data && 0 === e4.data.indexOf(a) && c(+e4.data.slice(a.length));
|
|
20166
20765
|
}
|
|
20167
|
-
}("undefined" == typeof self ? void 0 === e2 ? this : e2 : self);
|
|
20766
|
+
})("undefined" == typeof self ? void 0 === e2 ? this : e2 : self);
|
|
20168
20767
|
}).call(this, "undefined" != typeof commonjsGlobal ? commonjsGlobal : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {});
|
|
20169
20768
|
}, {}] }, {}, [10])(10);
|
|
20170
20769
|
});
|
|
@@ -20451,6 +21050,14 @@ const obfuscate = (buf, fontKey) => {
|
|
|
20451
21050
|
return out;
|
|
20452
21051
|
};
|
|
20453
21052
|
class Formatter {
|
|
21053
|
+
/**
|
|
21054
|
+
* Formats an XML component into a serializable object.
|
|
21055
|
+
*
|
|
21056
|
+
* @param input - The XML component to format
|
|
21057
|
+
* @param context - The context containing file state and relationships
|
|
21058
|
+
* @returns A serializable XML object structure
|
|
21059
|
+
* @throws Error if the component cannot be formatted correctly
|
|
21060
|
+
*/
|
|
20454
21061
|
format(input, context = { stack: [] }) {
|
|
20455
21062
|
const output = input.prepForXml(context);
|
|
20456
21063
|
if (output) {
|
|
@@ -20461,6 +21068,14 @@ class Formatter {
|
|
|
20461
21068
|
}
|
|
20462
21069
|
}
|
|
20463
21070
|
class ImageReplacer {
|
|
21071
|
+
/**
|
|
21072
|
+
* Replaces image placeholder tokens with relationship IDs.
|
|
21073
|
+
*
|
|
21074
|
+
* @param xmlData - The XML string containing image placeholders
|
|
21075
|
+
* @param mediaData - Array of media data to replace
|
|
21076
|
+
* @param offset - Starting offset for relationship IDs
|
|
21077
|
+
* @returns XML string with placeholders replaced by relationship IDs
|
|
21078
|
+
*/
|
|
20464
21079
|
replace(xmlData, mediaData, offset) {
|
|
20465
21080
|
let currentXmlData = xmlData;
|
|
20466
21081
|
mediaData.forEach((image, i) => {
|
|
@@ -20468,11 +21083,28 @@ class ImageReplacer {
|
|
|
20468
21083
|
});
|
|
20469
21084
|
return currentXmlData;
|
|
20470
21085
|
}
|
|
21086
|
+
/**
|
|
21087
|
+
* Extracts media data referenced in the XML content.
|
|
21088
|
+
*
|
|
21089
|
+
* @param xmlData - The XML string to search for media references
|
|
21090
|
+
* @param media - The media collection to search within
|
|
21091
|
+
* @returns Array of media data found in the XML
|
|
21092
|
+
*/
|
|
20471
21093
|
getMediaData(xmlData, media) {
|
|
20472
21094
|
return media.Array.filter((image) => xmlData.search(`{${image.fileName}}`) > 0);
|
|
20473
21095
|
}
|
|
20474
21096
|
}
|
|
20475
21097
|
class NumberingReplacer {
|
|
21098
|
+
/**
|
|
21099
|
+
* Replaces numbering placeholder tokens with actual numbering IDs.
|
|
21100
|
+
*
|
|
21101
|
+
* Placeholder format: {reference-instance} where reference identifies the
|
|
21102
|
+
* numbering definition and instance is the specific usage.
|
|
21103
|
+
*
|
|
21104
|
+
* @param xmlData - The XML string containing numbering placeholders
|
|
21105
|
+
* @param concreteNumberings - Array of concrete numbering instances to replace
|
|
21106
|
+
* @returns XML string with placeholders replaced by numbering IDs
|
|
21107
|
+
*/
|
|
20476
21108
|
replace(xmlData, concreteNumberings) {
|
|
20477
21109
|
let currentXmlData = xmlData;
|
|
20478
21110
|
for (const concreteNumbering of concreteNumberings) {
|
|
@@ -20485,6 +21117,11 @@ class NumberingReplacer {
|
|
|
20485
21117
|
}
|
|
20486
21118
|
}
|
|
20487
21119
|
class Compiler {
|
|
21120
|
+
/**
|
|
21121
|
+
* Creates a new Compiler instance.
|
|
21122
|
+
*
|
|
21123
|
+
* Initializes the formatter and replacer utilities used during compilation.
|
|
21124
|
+
*/
|
|
20488
21125
|
constructor() {
|
|
20489
21126
|
__publicField(this, "formatter");
|
|
20490
21127
|
__publicField(this, "imageReplacer");
|
|
@@ -20493,6 +21130,21 @@ class Compiler {
|
|
|
20493
21130
|
this.imageReplacer = new ImageReplacer();
|
|
20494
21131
|
this.numberingReplacer = new NumberingReplacer();
|
|
20495
21132
|
}
|
|
21133
|
+
/**
|
|
21134
|
+
* Compiles a File object into a JSZip archive containing the complete OOXML package.
|
|
21135
|
+
*
|
|
21136
|
+
* This method orchestrates the entire compilation process:
|
|
21137
|
+
* - Converts all document components to XML
|
|
21138
|
+
* - Manages image and numbering placeholder replacements
|
|
21139
|
+
* - Creates relationship files
|
|
21140
|
+
* - Packages fonts and media files
|
|
21141
|
+
* - Assembles everything into a ZIP archive
|
|
21142
|
+
*
|
|
21143
|
+
* @param file - The document to compile
|
|
21144
|
+
* @param prettifyXml - Optional XML formatting style
|
|
21145
|
+
* @param overrides - Optional custom XML file overrides
|
|
21146
|
+
* @returns A JSZip instance containing the complete .docx package
|
|
21147
|
+
*/
|
|
20496
21148
|
compile(file, prettifyXml, overrides = []) {
|
|
20497
21149
|
const zip = new JSZip();
|
|
20498
21150
|
const xmlifiedFileMapping = this.xmlifyFile(file, prettifyXml);
|
|
@@ -20963,13 +21615,26 @@ class Compiler {
|
|
|
20963
21615
|
}
|
|
20964
21616
|
}
|
|
20965
21617
|
const PrettifyType = {
|
|
21618
|
+
/** No prettification (smallest file size) */
|
|
20966
21619
|
NONE: "",
|
|
21620
|
+
/** Indent with 2 spaces */
|
|
20967
21621
|
WITH_2_BLANKS: " ",
|
|
21622
|
+
/** Indent with 4 spaces */
|
|
20968
21623
|
WITH_4_BLANKS: " ",
|
|
21624
|
+
/** Indent with tab character */
|
|
20969
21625
|
WITH_TAB: " "
|
|
20970
21626
|
};
|
|
20971
21627
|
const convertPrettifyType = (prettify) => prettify === true ? PrettifyType.WITH_2_BLANKS : prettify === false ? void 0 : prettify;
|
|
20972
21628
|
const _Packer = class _Packer {
|
|
21629
|
+
/**
|
|
21630
|
+
* Exports a document to the specified output format.
|
|
21631
|
+
*
|
|
21632
|
+
* @param file - The document to export
|
|
21633
|
+
* @param type - The output format type (e.g., "nodebuffer", "blob", "string")
|
|
21634
|
+
* @param prettify - Whether to prettify the XML output (boolean or PrettifyType)
|
|
21635
|
+
* @param overrides - Optional array of file overrides for custom XML content
|
|
21636
|
+
* @returns A promise resolving to the exported document in the specified format
|
|
21637
|
+
*/
|
|
20973
21638
|
// eslint-disable-next-line require-await
|
|
20974
21639
|
static pack(_0, _12, _2) {
|
|
20975
21640
|
return __async(this, arguments, function* (file, type2, prettify, overrides = []) {
|
|
@@ -20981,21 +21646,69 @@ const _Packer = class _Packer {
|
|
|
20981
21646
|
});
|
|
20982
21647
|
});
|
|
20983
21648
|
}
|
|
21649
|
+
/**
|
|
21650
|
+
* Exports a document to a string representation.
|
|
21651
|
+
*
|
|
21652
|
+
* @param file - The document to export
|
|
21653
|
+
* @param prettify - Whether to prettify the XML output
|
|
21654
|
+
* @param overrides - Optional array of file overrides
|
|
21655
|
+
* @returns A promise resolving to the document as a string
|
|
21656
|
+
*/
|
|
20984
21657
|
static toString(file, prettify, overrides = []) {
|
|
20985
21658
|
return _Packer.pack(file, "string", prettify, overrides);
|
|
20986
21659
|
}
|
|
21660
|
+
/**
|
|
21661
|
+
* Exports a document to a Node.js Buffer.
|
|
21662
|
+
*
|
|
21663
|
+
* @param file - The document to export
|
|
21664
|
+
* @param prettify - Whether to prettify the XML output
|
|
21665
|
+
* @param overrides - Optional array of file overrides
|
|
21666
|
+
* @returns A promise resolving to the document as a Buffer
|
|
21667
|
+
*/
|
|
20987
21668
|
static toBuffer(file, prettify, overrides = []) {
|
|
20988
21669
|
return _Packer.pack(file, "nodebuffer", prettify, overrides);
|
|
20989
21670
|
}
|
|
21671
|
+
/**
|
|
21672
|
+
* Exports a document to a base64-encoded string.
|
|
21673
|
+
*
|
|
21674
|
+
* @param file - The document to export
|
|
21675
|
+
* @param prettify - Whether to prettify the XML output
|
|
21676
|
+
* @param overrides - Optional array of file overrides
|
|
21677
|
+
* @returns A promise resolving to the document as a base64 string
|
|
21678
|
+
*/
|
|
20990
21679
|
static toBase64String(file, prettify, overrides = []) {
|
|
20991
21680
|
return _Packer.pack(file, "base64", prettify, overrides);
|
|
20992
21681
|
}
|
|
21682
|
+
/**
|
|
21683
|
+
* Exports a document to a Blob (for browser environments).
|
|
21684
|
+
*
|
|
21685
|
+
* @param file - The document to export
|
|
21686
|
+
* @param prettify - Whether to prettify the XML output
|
|
21687
|
+
* @param overrides - Optional array of file overrides
|
|
21688
|
+
* @returns A promise resolving to the document as a Blob
|
|
21689
|
+
*/
|
|
20993
21690
|
static toBlob(file, prettify, overrides = []) {
|
|
20994
21691
|
return _Packer.pack(file, "blob", prettify, overrides);
|
|
20995
21692
|
}
|
|
21693
|
+
/**
|
|
21694
|
+
* Exports a document to an ArrayBuffer.
|
|
21695
|
+
*
|
|
21696
|
+
* @param file - The document to export
|
|
21697
|
+
* @param prettify - Whether to prettify the XML output
|
|
21698
|
+
* @param overrides - Optional array of file overrides
|
|
21699
|
+
* @returns A promise resolving to the document as an ArrayBuffer
|
|
21700
|
+
*/
|
|
20996
21701
|
static toArrayBuffer(file, prettify, overrides = []) {
|
|
20997
21702
|
return _Packer.pack(file, "arraybuffer", prettify, overrides);
|
|
20998
21703
|
}
|
|
21704
|
+
/**
|
|
21705
|
+
* Exports a document to a Node.js Stream.
|
|
21706
|
+
*
|
|
21707
|
+
* @param file - The document to export
|
|
21708
|
+
* @param prettify - Whether to prettify the XML output
|
|
21709
|
+
* @param overrides - Optional array of file overrides
|
|
21710
|
+
* @returns A readable stream containing the document data
|
|
21711
|
+
*/
|
|
20999
21712
|
static toStream(file, prettify, overrides = []) {
|
|
21000
21713
|
const stream = new streamBrowserifyExports.Stream();
|
|
21001
21714
|
const zip = this.compiler.compile(file, convertPrettifyType(prettify), overrides);
|
|
@@ -21076,6 +21789,12 @@ const appendRelationship = (relationships, id, type2, target, targetMode) => {
|
|
|
21076
21789
|
});
|
|
21077
21790
|
return relationshipElements;
|
|
21078
21791
|
};
|
|
21792
|
+
class TokenNotFoundError extends Error {
|
|
21793
|
+
constructor(token) {
|
|
21794
|
+
super(`Token ${token} not found`);
|
|
21795
|
+
this.name = "TokenNotFoundError";
|
|
21796
|
+
}
|
|
21797
|
+
}
|
|
21079
21798
|
const findRunElementIndexWithToken = (paragraphElement, token) => {
|
|
21080
21799
|
var _a, _b, _c, _d;
|
|
21081
21800
|
for (let i = 0; i < ((_a = paragraphElement.elements) != null ? _a : []).length; i++) {
|
|
@@ -21092,7 +21811,7 @@ const findRunElementIndexWithToken = (paragraphElement, token) => {
|
|
|
21092
21811
|
}
|
|
21093
21812
|
}
|
|
21094
21813
|
}
|
|
21095
|
-
throw new
|
|
21814
|
+
throw new TokenNotFoundError(token);
|
|
21096
21815
|
};
|
|
21097
21816
|
const splitRunElement = (runElement, token) => {
|
|
21098
21817
|
var _a, _b;
|
|
@@ -21120,8 +21839,11 @@ const splitRunElement = (runElement, token) => {
|
|
|
21120
21839
|
return { left: leftRunElement, right: rightRunElement };
|
|
21121
21840
|
};
|
|
21122
21841
|
const ReplaceMode = {
|
|
21842
|
+
/** Looking for the start of the replacement text */
|
|
21123
21843
|
START: 0,
|
|
21844
|
+
/** Processing runs in the middle of the replacement text */
|
|
21124
21845
|
MIDDLE: 1,
|
|
21846
|
+
/** Reached the end of the replacement text */
|
|
21125
21847
|
END: 2
|
|
21126
21848
|
};
|
|
21127
21849
|
const replaceTokenInParagraphElement = ({
|
|
@@ -21329,7 +22051,9 @@ const goToElementFromPath = (json, path) => {
|
|
|
21329
22051
|
const goToParentElementFromPath = (json, path) => goToElementFromPath(json, path.slice(0, path.length - 1));
|
|
21330
22052
|
const getLastElementIndexFromPath = (path) => path[path.length - 1];
|
|
21331
22053
|
const PatchType = {
|
|
22054
|
+
/** Replace entire file-level elements (e.g., whole paragraphs) */
|
|
21332
22055
|
DOCUMENT: "file",
|
|
22056
|
+
/** Replace content within paragraphs (inline replacement) */
|
|
21333
22057
|
PARAGRAPH: "paragraph"
|
|
21334
22058
|
};
|
|
21335
22059
|
const imageReplacer = new ImageReplacer();
|
|
@@ -21346,7 +22070,7 @@ const compareByteArrays = (a, b) => {
|
|
|
21346
22070
|
}
|
|
21347
22071
|
return true;
|
|
21348
22072
|
};
|
|
21349
|
-
const patchDocument = (_0) => __async(
|
|
22073
|
+
const patchDocument = (_0) => __async(null, [_0], function* ({
|
|
21350
22074
|
outputType,
|
|
21351
22075
|
data,
|
|
21352
22076
|
patches,
|
|
@@ -21539,7 +22263,7 @@ const createRelationshipFile = () => ({
|
|
|
21539
22263
|
}
|
|
21540
22264
|
]
|
|
21541
22265
|
});
|
|
21542
|
-
const patchDetector = (_0) => __async(
|
|
22266
|
+
const patchDetector = (_0) => __async(null, [_0], function* ({ data }) {
|
|
21543
22267
|
const zipContent = data instanceof JSZip ? data : yield JSZip.loadAsync(data);
|
|
21544
22268
|
const patches = /* @__PURE__ */ new Set();
|
|
21545
22269
|
for (const [key, value] of Object.entries(zipContent.files)) {
|
|
@@ -21684,6 +22408,8 @@ export {
|
|
|
21684
22408
|
NumberFormat$1 as NumberFormat,
|
|
21685
22409
|
NumberProperties,
|
|
21686
22410
|
NumberValueElement,
|
|
22411
|
+
NumberedItemReference,
|
|
22412
|
+
NumberedItemReferenceFormat,
|
|
21687
22413
|
Numbering,
|
|
21688
22414
|
OnOffElement,
|
|
21689
22415
|
OutlineLevel,
|