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