@netlify/plugin-nextjs 5.9.0 → 5.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build/content/prerendered.js +2 -2
- package/dist/build/content/static.js +2 -2
- package/dist/build/functions/edge.js +1 -1
- package/dist/esm-chunks/{chunk-BFYMHE3E.js → chunk-HGXG447M.js} +13 -0
- package/dist/esm-chunks/chunk-LVXJQ2G2.js +147 -0
- package/dist/esm-chunks/{chunk-KBX7SJLC.js → chunk-NEZW7TGG.js} +1 -1
- package/dist/esm-chunks/{next-4L47PQSM.js → next-H2VMRX5P.js} +2 -4
- package/dist/esm-chunks/{package-LCNINN36.js → package-36IBNZ37.js} +2 -2
- package/dist/index.js +4 -4
- package/dist/run/handlers/cache.cjs +251 -139
- package/dist/run/handlers/request-context.cjs +88 -63
- package/dist/run/handlers/server.js +4 -4
- package/dist/run/handlers/tracer.cjs +88 -57
- package/dist/run/handlers/tracing.js +2 -2
- package/dist/run/handlers/wait-until.cjs +88 -57
- package/dist/run/next.cjs +88 -59
- package/edge-runtime/lib/middleware.ts +1 -1
- package/edge-runtime/lib/response.ts +5 -2
- package/edge-runtime/vendor/deno.land/x/htmlrewriter@v1.0.0/pkg/htmlrewriter.js +1218 -0
- package/edge-runtime/vendor/deno.land/x/htmlrewriter@v1.0.0/pkg/htmlrewriter_bg.wasm +0 -0
- package/edge-runtime/vendor/deno.land/x/htmlrewriter@v1.0.0/src/index.ts +80 -0
- package/edge-runtime/vendor/deno.land/x/{html_rewriter@v0.1.0-pre.17/vendor/html_rewriter.d.ts → htmlrewriter@v1.0.0/src/types.d.ts} +8 -25
- package/edge-runtime/vendor/import_map.json +0 -2
- package/edge-runtime/vendor.ts +1 -1
- package/package.json +1 -1
- package/dist/esm-chunks/chunk-NDSDIXRD.js +0 -122
- package/edge-runtime/vendor/deno.land/std@0.134.0/fmt/colors.ts +0 -536
- package/edge-runtime/vendor/deno.land/std@0.134.0/testing/_diff.ts +0 -360
- package/edge-runtime/vendor/deno.land/std@0.134.0/testing/asserts.ts +0 -866
- package/edge-runtime/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/index.ts +0 -133
- package/edge-runtime/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/vendor/asyncify.js +0 -112
- package/edge-runtime/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/vendor/html_rewriter.js +0 -974
- package/edge-runtime/vendor/raw.githubusercontent.com/worker-tools/resolvable-promise/master/index.ts +0 -50
- package/dist/esm-chunks/{chunk-BVYZSEV6.js → chunk-J4D25YDX.js} +3 -3
- package/dist/esm-chunks/{chunk-HWMLYAVP.js → chunk-NTLBFRPA.js} +3 -3
|
@@ -0,0 +1,1218 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
|
|
3
|
+
const cachedTextDecoder = typeof TextDecoder !== "undefined"
|
|
4
|
+
? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true })
|
|
5
|
+
: {
|
|
6
|
+
decode: () => {
|
|
7
|
+
throw Error("TextDecoder not available");
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
if (typeof TextDecoder !== "undefined") cachedTextDecoder.decode();
|
|
12
|
+
|
|
13
|
+
let cachedUint8ArrayMemory0 = null;
|
|
14
|
+
|
|
15
|
+
function getUint8ArrayMemory0() {
|
|
16
|
+
if (
|
|
17
|
+
cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0
|
|
18
|
+
) {
|
|
19
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
20
|
+
}
|
|
21
|
+
return cachedUint8ArrayMemory0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function getStringFromWasm0(ptr, len) {
|
|
25
|
+
ptr = ptr >>> 0;
|
|
26
|
+
return cachedTextDecoder.decode(
|
|
27
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + len),
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function debugString(val) {
|
|
32
|
+
// primitive types
|
|
33
|
+
const type = typeof val;
|
|
34
|
+
if (type == "number" || type == "boolean" || val == null) {
|
|
35
|
+
return `${val}`;
|
|
36
|
+
}
|
|
37
|
+
if (type == "string") {
|
|
38
|
+
return `"${val}"`;
|
|
39
|
+
}
|
|
40
|
+
if (type == "symbol") {
|
|
41
|
+
const description = val.description;
|
|
42
|
+
if (description == null) {
|
|
43
|
+
return "Symbol";
|
|
44
|
+
} else {
|
|
45
|
+
return `Symbol(${description})`;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (type == "function") {
|
|
49
|
+
const name = val.name;
|
|
50
|
+
if (typeof name == "string" && name.length > 0) {
|
|
51
|
+
return `Function(${name})`;
|
|
52
|
+
} else {
|
|
53
|
+
return "Function";
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// objects
|
|
57
|
+
if (Array.isArray(val)) {
|
|
58
|
+
const length = val.length;
|
|
59
|
+
let debug = "[";
|
|
60
|
+
if (length > 0) {
|
|
61
|
+
debug += debugString(val[0]);
|
|
62
|
+
}
|
|
63
|
+
for (let i = 1; i < length; i++) {
|
|
64
|
+
debug += ", " + debugString(val[i]);
|
|
65
|
+
}
|
|
66
|
+
debug += "]";
|
|
67
|
+
return debug;
|
|
68
|
+
}
|
|
69
|
+
// Test for built-in
|
|
70
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
71
|
+
let className;
|
|
72
|
+
if (builtInMatches.length > 1) {
|
|
73
|
+
className = builtInMatches[1];
|
|
74
|
+
} else {
|
|
75
|
+
// Failed to match the standard '[object ClassName]'
|
|
76
|
+
return toString.call(val);
|
|
77
|
+
}
|
|
78
|
+
if (className == "Object") {
|
|
79
|
+
// we're a user defined class or Object
|
|
80
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
81
|
+
// easier than looping through ownProperties of `val`.
|
|
82
|
+
try {
|
|
83
|
+
return "Object(" + JSON.stringify(val) + ")";
|
|
84
|
+
} catch (_) {
|
|
85
|
+
return "Object";
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// errors
|
|
89
|
+
if (val instanceof Error) {
|
|
90
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
91
|
+
}
|
|
92
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
93
|
+
return className;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
let WASM_VECTOR_LEN = 0;
|
|
97
|
+
|
|
98
|
+
const cachedTextEncoder = typeof TextEncoder !== "undefined"
|
|
99
|
+
? new TextEncoder("utf-8")
|
|
100
|
+
: {
|
|
101
|
+
encode: () => {
|
|
102
|
+
throw Error("TextEncoder not available");
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const encodeString = typeof cachedTextEncoder.encodeInto === "function"
|
|
107
|
+
? function (arg, view) {
|
|
108
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
109
|
+
}
|
|
110
|
+
: function (arg, view) {
|
|
111
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
112
|
+
view.set(buf);
|
|
113
|
+
return {
|
|
114
|
+
read: arg.length,
|
|
115
|
+
written: buf.length,
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
120
|
+
if (realloc === undefined) {
|
|
121
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
122
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
123
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
124
|
+
WASM_VECTOR_LEN = buf.length;
|
|
125
|
+
return ptr;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
let len = arg.length;
|
|
129
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
130
|
+
|
|
131
|
+
const mem = getUint8ArrayMemory0();
|
|
132
|
+
|
|
133
|
+
let offset = 0;
|
|
134
|
+
|
|
135
|
+
for (; offset < len; offset++) {
|
|
136
|
+
const code = arg.charCodeAt(offset);
|
|
137
|
+
if (code > 0x7F) break;
|
|
138
|
+
mem[ptr + offset] = code;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (offset !== len) {
|
|
142
|
+
if (offset !== 0) {
|
|
143
|
+
arg = arg.slice(offset);
|
|
144
|
+
}
|
|
145
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
146
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
147
|
+
const ret = encodeString(arg, view);
|
|
148
|
+
|
|
149
|
+
offset += ret.written;
|
|
150
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
WASM_VECTOR_LEN = offset;
|
|
154
|
+
return ptr;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
let cachedDataViewMemory0 = null;
|
|
158
|
+
|
|
159
|
+
function getDataViewMemory0() {
|
|
160
|
+
if (
|
|
161
|
+
cachedDataViewMemory0 === null ||
|
|
162
|
+
cachedDataViewMemory0.buffer.detached === true ||
|
|
163
|
+
(cachedDataViewMemory0.buffer.detached === undefined &&
|
|
164
|
+
cachedDataViewMemory0.buffer !== wasm.memory.buffer)
|
|
165
|
+
) {
|
|
166
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
167
|
+
}
|
|
168
|
+
return cachedDataViewMemory0;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function isLikeNone(x) {
|
|
172
|
+
return x === undefined || x === null;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function addToExternrefTable0(obj) {
|
|
176
|
+
const idx = wasm.__externref_table_alloc();
|
|
177
|
+
wasm.__wbindgen_export_2.set(idx, obj);
|
|
178
|
+
return idx;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function takeFromExternrefTable0(idx) {
|
|
182
|
+
const value = wasm.__wbindgen_export_2.get(idx);
|
|
183
|
+
wasm.__externref_table_dealloc(idx);
|
|
184
|
+
return value;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
188
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
189
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
190
|
+
WASM_VECTOR_LEN = arg.length;
|
|
191
|
+
return ptr;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function handleError(f, args) {
|
|
195
|
+
try {
|
|
196
|
+
return f.apply(this, args);
|
|
197
|
+
} catch (e) {
|
|
198
|
+
const idx = addToExternrefTable0(e);
|
|
199
|
+
wasm.__wbindgen_exn_store(idx);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const CommentFinalization = (typeof FinalizationRegistry === "undefined")
|
|
204
|
+
? { register: () => {}, unregister: () => {} }
|
|
205
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_comment_free(ptr >>> 0, 1));
|
|
206
|
+
|
|
207
|
+
export class Comment {
|
|
208
|
+
static __wrap(ptr) {
|
|
209
|
+
ptr = ptr >>> 0;
|
|
210
|
+
const obj = Object.create(Comment.prototype);
|
|
211
|
+
obj.__wbg_ptr = ptr;
|
|
212
|
+
CommentFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
213
|
+
return obj;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
__destroy_into_raw() {
|
|
217
|
+
const ptr = this.__wbg_ptr;
|
|
218
|
+
this.__wbg_ptr = 0;
|
|
219
|
+
CommentFinalization.unregister(this);
|
|
220
|
+
return ptr;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
free() {
|
|
224
|
+
const ptr = this.__destroy_into_raw();
|
|
225
|
+
wasm.__wbg_comment_free(ptr, 0);
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* @param {string} content
|
|
229
|
+
* @param {any | undefined} [content_type]
|
|
230
|
+
*/
|
|
231
|
+
before(content, content_type) {
|
|
232
|
+
const ptr0 = passStringToWasm0(
|
|
233
|
+
content,
|
|
234
|
+
wasm.__wbindgen_malloc,
|
|
235
|
+
wasm.__wbindgen_realloc,
|
|
236
|
+
);
|
|
237
|
+
const len0 = WASM_VECTOR_LEN;
|
|
238
|
+
const ret = wasm.comment_before(
|
|
239
|
+
this.__wbg_ptr,
|
|
240
|
+
ptr0,
|
|
241
|
+
len0,
|
|
242
|
+
isLikeNone(content_type) ? 0 : addToExternrefTable0(content_type),
|
|
243
|
+
);
|
|
244
|
+
if (ret[1]) {
|
|
245
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* @param {string} content
|
|
250
|
+
* @param {any | undefined} [content_type]
|
|
251
|
+
*/
|
|
252
|
+
after(content, content_type) {
|
|
253
|
+
const ptr0 = passStringToWasm0(
|
|
254
|
+
content,
|
|
255
|
+
wasm.__wbindgen_malloc,
|
|
256
|
+
wasm.__wbindgen_realloc,
|
|
257
|
+
);
|
|
258
|
+
const len0 = WASM_VECTOR_LEN;
|
|
259
|
+
const ret = wasm.comment_after(
|
|
260
|
+
this.__wbg_ptr,
|
|
261
|
+
ptr0,
|
|
262
|
+
len0,
|
|
263
|
+
isLikeNone(content_type) ? 0 : addToExternrefTable0(content_type),
|
|
264
|
+
);
|
|
265
|
+
if (ret[1]) {
|
|
266
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* @param {string} content
|
|
271
|
+
* @param {any | undefined} [content_type]
|
|
272
|
+
*/
|
|
273
|
+
replace(content, content_type) {
|
|
274
|
+
const ptr0 = passStringToWasm0(
|
|
275
|
+
content,
|
|
276
|
+
wasm.__wbindgen_malloc,
|
|
277
|
+
wasm.__wbindgen_realloc,
|
|
278
|
+
);
|
|
279
|
+
const len0 = WASM_VECTOR_LEN;
|
|
280
|
+
const ret = wasm.comment_replace(
|
|
281
|
+
this.__wbg_ptr,
|
|
282
|
+
ptr0,
|
|
283
|
+
len0,
|
|
284
|
+
isLikeNone(content_type) ? 0 : addToExternrefTable0(content_type),
|
|
285
|
+
);
|
|
286
|
+
if (ret[1]) {
|
|
287
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
remove() {
|
|
291
|
+
const ret = wasm.comment_remove(this.__wbg_ptr);
|
|
292
|
+
if (ret[1]) {
|
|
293
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* @returns {boolean}
|
|
298
|
+
*/
|
|
299
|
+
get removed() {
|
|
300
|
+
const ret = wasm.comment_removed(this.__wbg_ptr);
|
|
301
|
+
if (ret[2]) {
|
|
302
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
303
|
+
}
|
|
304
|
+
return ret[0] !== 0;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* @returns {string}
|
|
308
|
+
*/
|
|
309
|
+
get text() {
|
|
310
|
+
let deferred2_0;
|
|
311
|
+
let deferred2_1;
|
|
312
|
+
try {
|
|
313
|
+
const ret = wasm.comment_text(this.__wbg_ptr);
|
|
314
|
+
var ptr1 = ret[0];
|
|
315
|
+
var len1 = ret[1];
|
|
316
|
+
if (ret[3]) {
|
|
317
|
+
ptr1 = 0;
|
|
318
|
+
len1 = 0;
|
|
319
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
320
|
+
}
|
|
321
|
+
deferred2_0 = ptr1;
|
|
322
|
+
deferred2_1 = len1;
|
|
323
|
+
return getStringFromWasm0(ptr1, len1);
|
|
324
|
+
} finally {
|
|
325
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* @param {string} text
|
|
330
|
+
*/
|
|
331
|
+
set text(text) {
|
|
332
|
+
const ptr0 = passStringToWasm0(
|
|
333
|
+
text,
|
|
334
|
+
wasm.__wbindgen_malloc,
|
|
335
|
+
wasm.__wbindgen_realloc,
|
|
336
|
+
);
|
|
337
|
+
const len0 = WASM_VECTOR_LEN;
|
|
338
|
+
const ret = wasm.comment_set_text(this.__wbg_ptr, ptr0, len0);
|
|
339
|
+
if (ret[1]) {
|
|
340
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
const DoctypeFinalization = (typeof FinalizationRegistry === "undefined")
|
|
346
|
+
? { register: () => {}, unregister: () => {} }
|
|
347
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_doctype_free(ptr >>> 0, 1));
|
|
348
|
+
|
|
349
|
+
export class Doctype {
|
|
350
|
+
static __wrap(ptr) {
|
|
351
|
+
ptr = ptr >>> 0;
|
|
352
|
+
const obj = Object.create(Doctype.prototype);
|
|
353
|
+
obj.__wbg_ptr = ptr;
|
|
354
|
+
DoctypeFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
355
|
+
return obj;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
__destroy_into_raw() {
|
|
359
|
+
const ptr = this.__wbg_ptr;
|
|
360
|
+
this.__wbg_ptr = 0;
|
|
361
|
+
DoctypeFinalization.unregister(this);
|
|
362
|
+
return ptr;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
free() {
|
|
366
|
+
const ptr = this.__destroy_into_raw();
|
|
367
|
+
wasm.__wbg_doctype_free(ptr, 0);
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* @returns {any}
|
|
371
|
+
*/
|
|
372
|
+
get name() {
|
|
373
|
+
const ret = wasm.doctype_name(this.__wbg_ptr);
|
|
374
|
+
if (ret[2]) {
|
|
375
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
376
|
+
}
|
|
377
|
+
return takeFromExternrefTable0(ret[0]);
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* @returns {any}
|
|
381
|
+
*/
|
|
382
|
+
get publicId() {
|
|
383
|
+
const ret = wasm.doctype_public_id(this.__wbg_ptr);
|
|
384
|
+
if (ret[2]) {
|
|
385
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
386
|
+
}
|
|
387
|
+
return takeFromExternrefTable0(ret[0]);
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* @returns {any}
|
|
391
|
+
*/
|
|
392
|
+
get systemId() {
|
|
393
|
+
const ret = wasm.doctype_system_id(this.__wbg_ptr);
|
|
394
|
+
if (ret[2]) {
|
|
395
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
396
|
+
}
|
|
397
|
+
return takeFromExternrefTable0(ret[0]);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
const DocumentEndFinalization = (typeof FinalizationRegistry === "undefined")
|
|
402
|
+
? { register: () => {}, unregister: () => {} }
|
|
403
|
+
: new FinalizationRegistry((ptr) =>
|
|
404
|
+
wasm.__wbg_documentend_free(ptr >>> 0, 1)
|
|
405
|
+
);
|
|
406
|
+
|
|
407
|
+
export class DocumentEnd {
|
|
408
|
+
static __wrap(ptr) {
|
|
409
|
+
ptr = ptr >>> 0;
|
|
410
|
+
const obj = Object.create(DocumentEnd.prototype);
|
|
411
|
+
obj.__wbg_ptr = ptr;
|
|
412
|
+
DocumentEndFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
413
|
+
return obj;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
__destroy_into_raw() {
|
|
417
|
+
const ptr = this.__wbg_ptr;
|
|
418
|
+
this.__wbg_ptr = 0;
|
|
419
|
+
DocumentEndFinalization.unregister(this);
|
|
420
|
+
return ptr;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
free() {
|
|
424
|
+
const ptr = this.__destroy_into_raw();
|
|
425
|
+
wasm.__wbg_documentend_free(ptr, 0);
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* @param {string} content
|
|
429
|
+
* @param {any | undefined} [content_type]
|
|
430
|
+
*/
|
|
431
|
+
append(content, content_type) {
|
|
432
|
+
const ptr0 = passStringToWasm0(
|
|
433
|
+
content,
|
|
434
|
+
wasm.__wbindgen_malloc,
|
|
435
|
+
wasm.__wbindgen_realloc,
|
|
436
|
+
);
|
|
437
|
+
const len0 = WASM_VECTOR_LEN;
|
|
438
|
+
const ret = wasm.documentend_append(
|
|
439
|
+
this.__wbg_ptr,
|
|
440
|
+
ptr0,
|
|
441
|
+
len0,
|
|
442
|
+
isLikeNone(content_type) ? 0 : addToExternrefTable0(content_type),
|
|
443
|
+
);
|
|
444
|
+
if (ret[1]) {
|
|
445
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
const ElementFinalization = (typeof FinalizationRegistry === "undefined")
|
|
451
|
+
? { register: () => {}, unregister: () => {} }
|
|
452
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_element_free(ptr >>> 0, 1));
|
|
453
|
+
|
|
454
|
+
export class Element {
|
|
455
|
+
static __wrap(ptr) {
|
|
456
|
+
ptr = ptr >>> 0;
|
|
457
|
+
const obj = Object.create(Element.prototype);
|
|
458
|
+
obj.__wbg_ptr = ptr;
|
|
459
|
+
ElementFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
460
|
+
return obj;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
__destroy_into_raw() {
|
|
464
|
+
const ptr = this.__wbg_ptr;
|
|
465
|
+
this.__wbg_ptr = 0;
|
|
466
|
+
ElementFinalization.unregister(this);
|
|
467
|
+
return ptr;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
free() {
|
|
471
|
+
const ptr = this.__destroy_into_raw();
|
|
472
|
+
wasm.__wbg_element_free(ptr, 0);
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* @param {string} content
|
|
476
|
+
* @param {any | undefined} [content_type]
|
|
477
|
+
*/
|
|
478
|
+
before(content, content_type) {
|
|
479
|
+
const ptr0 = passStringToWasm0(
|
|
480
|
+
content,
|
|
481
|
+
wasm.__wbindgen_malloc,
|
|
482
|
+
wasm.__wbindgen_realloc,
|
|
483
|
+
);
|
|
484
|
+
const len0 = WASM_VECTOR_LEN;
|
|
485
|
+
const ret = wasm.element_before(
|
|
486
|
+
this.__wbg_ptr,
|
|
487
|
+
ptr0,
|
|
488
|
+
len0,
|
|
489
|
+
isLikeNone(content_type) ? 0 : addToExternrefTable0(content_type),
|
|
490
|
+
);
|
|
491
|
+
if (ret[1]) {
|
|
492
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* @param {string} content
|
|
497
|
+
* @param {any | undefined} [content_type]
|
|
498
|
+
*/
|
|
499
|
+
after(content, content_type) {
|
|
500
|
+
const ptr0 = passStringToWasm0(
|
|
501
|
+
content,
|
|
502
|
+
wasm.__wbindgen_malloc,
|
|
503
|
+
wasm.__wbindgen_realloc,
|
|
504
|
+
);
|
|
505
|
+
const len0 = WASM_VECTOR_LEN;
|
|
506
|
+
const ret = wasm.element_after(
|
|
507
|
+
this.__wbg_ptr,
|
|
508
|
+
ptr0,
|
|
509
|
+
len0,
|
|
510
|
+
isLikeNone(content_type) ? 0 : addToExternrefTable0(content_type),
|
|
511
|
+
);
|
|
512
|
+
if (ret[1]) {
|
|
513
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* @param {string} content
|
|
518
|
+
* @param {any | undefined} [content_type]
|
|
519
|
+
*/
|
|
520
|
+
replace(content, content_type) {
|
|
521
|
+
const ptr0 = passStringToWasm0(
|
|
522
|
+
content,
|
|
523
|
+
wasm.__wbindgen_malloc,
|
|
524
|
+
wasm.__wbindgen_realloc,
|
|
525
|
+
);
|
|
526
|
+
const len0 = WASM_VECTOR_LEN;
|
|
527
|
+
const ret = wasm.element_replace(
|
|
528
|
+
this.__wbg_ptr,
|
|
529
|
+
ptr0,
|
|
530
|
+
len0,
|
|
531
|
+
isLikeNone(content_type) ? 0 : addToExternrefTable0(content_type),
|
|
532
|
+
);
|
|
533
|
+
if (ret[1]) {
|
|
534
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
remove() {
|
|
538
|
+
const ret = wasm.element_remove(this.__wbg_ptr);
|
|
539
|
+
if (ret[1]) {
|
|
540
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* @returns {boolean}
|
|
545
|
+
*/
|
|
546
|
+
get removed() {
|
|
547
|
+
const ret = wasm.element_removed(this.__wbg_ptr);
|
|
548
|
+
if (ret[2]) {
|
|
549
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
550
|
+
}
|
|
551
|
+
return ret[0] !== 0;
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* @returns {string}
|
|
555
|
+
*/
|
|
556
|
+
get tagName() {
|
|
557
|
+
let deferred2_0;
|
|
558
|
+
let deferred2_1;
|
|
559
|
+
try {
|
|
560
|
+
const ret = wasm.element_tag_name(this.__wbg_ptr);
|
|
561
|
+
var ptr1 = ret[0];
|
|
562
|
+
var len1 = ret[1];
|
|
563
|
+
if (ret[3]) {
|
|
564
|
+
ptr1 = 0;
|
|
565
|
+
len1 = 0;
|
|
566
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
567
|
+
}
|
|
568
|
+
deferred2_0 = ptr1;
|
|
569
|
+
deferred2_1 = len1;
|
|
570
|
+
return getStringFromWasm0(ptr1, len1);
|
|
571
|
+
} finally {
|
|
572
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* @param {string} name
|
|
577
|
+
*/
|
|
578
|
+
set tagName(name) {
|
|
579
|
+
const ptr0 = passStringToWasm0(
|
|
580
|
+
name,
|
|
581
|
+
wasm.__wbindgen_malloc,
|
|
582
|
+
wasm.__wbindgen_realloc,
|
|
583
|
+
);
|
|
584
|
+
const len0 = WASM_VECTOR_LEN;
|
|
585
|
+
const ret = wasm.element_set_tag_name(this.__wbg_ptr, ptr0, len0);
|
|
586
|
+
if (ret[1]) {
|
|
587
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* @returns {any}
|
|
592
|
+
*/
|
|
593
|
+
get namespaceURI() {
|
|
594
|
+
const ret = wasm.element_namespace_uri(this.__wbg_ptr);
|
|
595
|
+
if (ret[2]) {
|
|
596
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
597
|
+
}
|
|
598
|
+
return takeFromExternrefTable0(ret[0]);
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* @returns {any}
|
|
602
|
+
*/
|
|
603
|
+
get attributes() {
|
|
604
|
+
const ret = wasm.element_attributes(this.__wbg_ptr);
|
|
605
|
+
if (ret[2]) {
|
|
606
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
607
|
+
}
|
|
608
|
+
return takeFromExternrefTable0(ret[0]);
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* @param {string} name
|
|
612
|
+
* @returns {any}
|
|
613
|
+
*/
|
|
614
|
+
getAttribute(name) {
|
|
615
|
+
const ptr0 = passStringToWasm0(
|
|
616
|
+
name,
|
|
617
|
+
wasm.__wbindgen_malloc,
|
|
618
|
+
wasm.__wbindgen_realloc,
|
|
619
|
+
);
|
|
620
|
+
const len0 = WASM_VECTOR_LEN;
|
|
621
|
+
const ret = wasm.element_getAttribute(this.__wbg_ptr, ptr0, len0);
|
|
622
|
+
if (ret[2]) {
|
|
623
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
624
|
+
}
|
|
625
|
+
return takeFromExternrefTable0(ret[0]);
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* @param {string} name
|
|
629
|
+
* @returns {boolean}
|
|
630
|
+
*/
|
|
631
|
+
hasAttribute(name) {
|
|
632
|
+
const ptr0 = passStringToWasm0(
|
|
633
|
+
name,
|
|
634
|
+
wasm.__wbindgen_malloc,
|
|
635
|
+
wasm.__wbindgen_realloc,
|
|
636
|
+
);
|
|
637
|
+
const len0 = WASM_VECTOR_LEN;
|
|
638
|
+
const ret = wasm.element_hasAttribute(this.__wbg_ptr, ptr0, len0);
|
|
639
|
+
if (ret[2]) {
|
|
640
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
641
|
+
}
|
|
642
|
+
return ret[0] !== 0;
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* @param {string} name
|
|
646
|
+
* @param {string} value
|
|
647
|
+
*/
|
|
648
|
+
setAttribute(name, value) {
|
|
649
|
+
const ptr0 = passStringToWasm0(
|
|
650
|
+
name,
|
|
651
|
+
wasm.__wbindgen_malloc,
|
|
652
|
+
wasm.__wbindgen_realloc,
|
|
653
|
+
);
|
|
654
|
+
const len0 = WASM_VECTOR_LEN;
|
|
655
|
+
const ptr1 = passStringToWasm0(
|
|
656
|
+
value,
|
|
657
|
+
wasm.__wbindgen_malloc,
|
|
658
|
+
wasm.__wbindgen_realloc,
|
|
659
|
+
);
|
|
660
|
+
const len1 = WASM_VECTOR_LEN;
|
|
661
|
+
const ret = wasm.element_setAttribute(
|
|
662
|
+
this.__wbg_ptr,
|
|
663
|
+
ptr0,
|
|
664
|
+
len0,
|
|
665
|
+
ptr1,
|
|
666
|
+
len1,
|
|
667
|
+
);
|
|
668
|
+
if (ret[1]) {
|
|
669
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* @param {string} name
|
|
674
|
+
*/
|
|
675
|
+
removeAttribute(name) {
|
|
676
|
+
const ptr0 = passStringToWasm0(
|
|
677
|
+
name,
|
|
678
|
+
wasm.__wbindgen_malloc,
|
|
679
|
+
wasm.__wbindgen_realloc,
|
|
680
|
+
);
|
|
681
|
+
const len0 = WASM_VECTOR_LEN;
|
|
682
|
+
const ret = wasm.element_removeAttribute(this.__wbg_ptr, ptr0, len0);
|
|
683
|
+
if (ret[1]) {
|
|
684
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* @param {string} content
|
|
689
|
+
* @param {any | undefined} [content_type]
|
|
690
|
+
*/
|
|
691
|
+
prepend(content, content_type) {
|
|
692
|
+
const ptr0 = passStringToWasm0(
|
|
693
|
+
content,
|
|
694
|
+
wasm.__wbindgen_malloc,
|
|
695
|
+
wasm.__wbindgen_realloc,
|
|
696
|
+
);
|
|
697
|
+
const len0 = WASM_VECTOR_LEN;
|
|
698
|
+
const ret = wasm.element_prepend(
|
|
699
|
+
this.__wbg_ptr,
|
|
700
|
+
ptr0,
|
|
701
|
+
len0,
|
|
702
|
+
isLikeNone(content_type) ? 0 : addToExternrefTable0(content_type),
|
|
703
|
+
);
|
|
704
|
+
if (ret[1]) {
|
|
705
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
/**
|
|
709
|
+
* @param {string} content
|
|
710
|
+
* @param {any | undefined} [content_type]
|
|
711
|
+
*/
|
|
712
|
+
append(content, content_type) {
|
|
713
|
+
const ptr0 = passStringToWasm0(
|
|
714
|
+
content,
|
|
715
|
+
wasm.__wbindgen_malloc,
|
|
716
|
+
wasm.__wbindgen_realloc,
|
|
717
|
+
);
|
|
718
|
+
const len0 = WASM_VECTOR_LEN;
|
|
719
|
+
const ret = wasm.element_append(
|
|
720
|
+
this.__wbg_ptr,
|
|
721
|
+
ptr0,
|
|
722
|
+
len0,
|
|
723
|
+
isLikeNone(content_type) ? 0 : addToExternrefTable0(content_type),
|
|
724
|
+
);
|
|
725
|
+
if (ret[1]) {
|
|
726
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* @param {string} content
|
|
731
|
+
* @param {any | undefined} [content_type]
|
|
732
|
+
*/
|
|
733
|
+
setInnerContent(content, content_type) {
|
|
734
|
+
const ptr0 = passStringToWasm0(
|
|
735
|
+
content,
|
|
736
|
+
wasm.__wbindgen_malloc,
|
|
737
|
+
wasm.__wbindgen_realloc,
|
|
738
|
+
);
|
|
739
|
+
const len0 = WASM_VECTOR_LEN;
|
|
740
|
+
const ret = wasm.element_setInnerContent(
|
|
741
|
+
this.__wbg_ptr,
|
|
742
|
+
ptr0,
|
|
743
|
+
len0,
|
|
744
|
+
isLikeNone(content_type) ? 0 : addToExternrefTable0(content_type),
|
|
745
|
+
);
|
|
746
|
+
if (ret[1]) {
|
|
747
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
removeAndKeepContent() {
|
|
751
|
+
const ret = wasm.element_removeAndKeepContent(this.__wbg_ptr);
|
|
752
|
+
if (ret[1]) {
|
|
753
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
const HTMLRewriterFinalization = (typeof FinalizationRegistry === "undefined")
|
|
759
|
+
? { register: () => {}, unregister: () => {} }
|
|
760
|
+
: new FinalizationRegistry((ptr) =>
|
|
761
|
+
wasm.__wbg_htmlrewriter_free(ptr >>> 0, 1)
|
|
762
|
+
);
|
|
763
|
+
|
|
764
|
+
export class HTMLRewriter {
|
|
765
|
+
__destroy_into_raw() {
|
|
766
|
+
const ptr = this.__wbg_ptr;
|
|
767
|
+
this.__wbg_ptr = 0;
|
|
768
|
+
HTMLRewriterFinalization.unregister(this);
|
|
769
|
+
return ptr;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
free() {
|
|
773
|
+
const ptr = this.__destroy_into_raw();
|
|
774
|
+
wasm.__wbg_htmlrewriter_free(ptr, 0);
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* @param {Function} output_sink
|
|
778
|
+
* @param {any | undefined} [options]
|
|
779
|
+
*/
|
|
780
|
+
constructor(output_sink, options) {
|
|
781
|
+
const ret = wasm.htmlrewriter_new(
|
|
782
|
+
output_sink,
|
|
783
|
+
isLikeNone(options) ? 0 : addToExternrefTable0(options),
|
|
784
|
+
);
|
|
785
|
+
this.__wbg_ptr = ret >>> 0;
|
|
786
|
+
HTMLRewriterFinalization.register(this, this.__wbg_ptr, this);
|
|
787
|
+
return this;
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* @param {string} selector
|
|
791
|
+
* @param {any} handlers
|
|
792
|
+
*/
|
|
793
|
+
on(selector, handlers) {
|
|
794
|
+
const ptr0 = passStringToWasm0(
|
|
795
|
+
selector,
|
|
796
|
+
wasm.__wbindgen_malloc,
|
|
797
|
+
wasm.__wbindgen_realloc,
|
|
798
|
+
);
|
|
799
|
+
const len0 = WASM_VECTOR_LEN;
|
|
800
|
+
const ret = wasm.htmlrewriter_on(this.__wbg_ptr, ptr0, len0, handlers);
|
|
801
|
+
if (ret[1]) {
|
|
802
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
/**
|
|
806
|
+
* @param {any} handlers
|
|
807
|
+
*/
|
|
808
|
+
onDocument(handlers) {
|
|
809
|
+
const ret = wasm.htmlrewriter_onDocument(this.__wbg_ptr, handlers);
|
|
810
|
+
if (ret[1]) {
|
|
811
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* @param {Uint8Array} chunk
|
|
816
|
+
*/
|
|
817
|
+
write(chunk) {
|
|
818
|
+
const ptr0 = passArray8ToWasm0(chunk, wasm.__wbindgen_malloc);
|
|
819
|
+
const len0 = WASM_VECTOR_LEN;
|
|
820
|
+
const ret = wasm.htmlrewriter_write(this.__wbg_ptr, ptr0, len0);
|
|
821
|
+
if (ret[1]) {
|
|
822
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
end() {
|
|
826
|
+
const ret = wasm.htmlrewriter_end(this.__wbg_ptr);
|
|
827
|
+
if (ret[1]) {
|
|
828
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
/**
|
|
832
|
+
* @returns {number}
|
|
833
|
+
*/
|
|
834
|
+
get asyncifyStackPtr() {
|
|
835
|
+
const ret = wasm.htmlrewriter_asyncify_stack_ptr(this.__wbg_ptr);
|
|
836
|
+
return ret >>> 0;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
const TextChunkFinalization = (typeof FinalizationRegistry === "undefined")
|
|
841
|
+
? { register: () => {}, unregister: () => {} }
|
|
842
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_textchunk_free(ptr >>> 0, 1));
|
|
843
|
+
|
|
844
|
+
export class TextChunk {
|
|
845
|
+
static __wrap(ptr) {
|
|
846
|
+
ptr = ptr >>> 0;
|
|
847
|
+
const obj = Object.create(TextChunk.prototype);
|
|
848
|
+
obj.__wbg_ptr = ptr;
|
|
849
|
+
TextChunkFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
850
|
+
return obj;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
__destroy_into_raw() {
|
|
854
|
+
const ptr = this.__wbg_ptr;
|
|
855
|
+
this.__wbg_ptr = 0;
|
|
856
|
+
TextChunkFinalization.unregister(this);
|
|
857
|
+
return ptr;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
free() {
|
|
861
|
+
const ptr = this.__destroy_into_raw();
|
|
862
|
+
wasm.__wbg_textchunk_free(ptr, 0);
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* @param {string} content
|
|
866
|
+
* @param {any | undefined} [content_type]
|
|
867
|
+
*/
|
|
868
|
+
before(content, content_type) {
|
|
869
|
+
const ptr0 = passStringToWasm0(
|
|
870
|
+
content,
|
|
871
|
+
wasm.__wbindgen_malloc,
|
|
872
|
+
wasm.__wbindgen_realloc,
|
|
873
|
+
);
|
|
874
|
+
const len0 = WASM_VECTOR_LEN;
|
|
875
|
+
const ret = wasm.textchunk_before(
|
|
876
|
+
this.__wbg_ptr,
|
|
877
|
+
ptr0,
|
|
878
|
+
len0,
|
|
879
|
+
isLikeNone(content_type) ? 0 : addToExternrefTable0(content_type),
|
|
880
|
+
);
|
|
881
|
+
if (ret[1]) {
|
|
882
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
/**
|
|
886
|
+
* @param {string} content
|
|
887
|
+
* @param {any | undefined} [content_type]
|
|
888
|
+
*/
|
|
889
|
+
after(content, content_type) {
|
|
890
|
+
const ptr0 = passStringToWasm0(
|
|
891
|
+
content,
|
|
892
|
+
wasm.__wbindgen_malloc,
|
|
893
|
+
wasm.__wbindgen_realloc,
|
|
894
|
+
);
|
|
895
|
+
const len0 = WASM_VECTOR_LEN;
|
|
896
|
+
const ret = wasm.textchunk_after(
|
|
897
|
+
this.__wbg_ptr,
|
|
898
|
+
ptr0,
|
|
899
|
+
len0,
|
|
900
|
+
isLikeNone(content_type) ? 0 : addToExternrefTable0(content_type),
|
|
901
|
+
);
|
|
902
|
+
if (ret[1]) {
|
|
903
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* @param {string} content
|
|
908
|
+
* @param {any | undefined} [content_type]
|
|
909
|
+
*/
|
|
910
|
+
replace(content, content_type) {
|
|
911
|
+
const ptr0 = passStringToWasm0(
|
|
912
|
+
content,
|
|
913
|
+
wasm.__wbindgen_malloc,
|
|
914
|
+
wasm.__wbindgen_realloc,
|
|
915
|
+
);
|
|
916
|
+
const len0 = WASM_VECTOR_LEN;
|
|
917
|
+
const ret = wasm.textchunk_replace(
|
|
918
|
+
this.__wbg_ptr,
|
|
919
|
+
ptr0,
|
|
920
|
+
len0,
|
|
921
|
+
isLikeNone(content_type) ? 0 : addToExternrefTable0(content_type),
|
|
922
|
+
);
|
|
923
|
+
if (ret[1]) {
|
|
924
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
remove() {
|
|
928
|
+
const ret = wasm.textchunk_remove(this.__wbg_ptr);
|
|
929
|
+
if (ret[1]) {
|
|
930
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
/**
|
|
934
|
+
* @returns {boolean}
|
|
935
|
+
*/
|
|
936
|
+
get removed() {
|
|
937
|
+
const ret = wasm.textchunk_removed(this.__wbg_ptr);
|
|
938
|
+
if (ret[2]) {
|
|
939
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
940
|
+
}
|
|
941
|
+
return ret[0] !== 0;
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* @returns {string}
|
|
945
|
+
*/
|
|
946
|
+
get text() {
|
|
947
|
+
let deferred2_0;
|
|
948
|
+
let deferred2_1;
|
|
949
|
+
try {
|
|
950
|
+
const ret = wasm.textchunk_text(this.__wbg_ptr);
|
|
951
|
+
var ptr1 = ret[0];
|
|
952
|
+
var len1 = ret[1];
|
|
953
|
+
if (ret[3]) {
|
|
954
|
+
ptr1 = 0;
|
|
955
|
+
len1 = 0;
|
|
956
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
957
|
+
}
|
|
958
|
+
deferred2_0 = ptr1;
|
|
959
|
+
deferred2_1 = len1;
|
|
960
|
+
return getStringFromWasm0(ptr1, len1);
|
|
961
|
+
} finally {
|
|
962
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* @returns {boolean}
|
|
967
|
+
*/
|
|
968
|
+
get lastInTextNode() {
|
|
969
|
+
const ret = wasm.textchunk_last_in_text_node(this.__wbg_ptr);
|
|
970
|
+
if (ret[2]) {
|
|
971
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
972
|
+
}
|
|
973
|
+
return ret[0] !== 0;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
async function __wbg_load(module, imports) {
|
|
978
|
+
if (typeof Response === "function" && module instanceof Response) {
|
|
979
|
+
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
980
|
+
try {
|
|
981
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
982
|
+
} catch (e) {
|
|
983
|
+
if (module.headers.get("Content-Type") != "application/wasm") {
|
|
984
|
+
console.warn(
|
|
985
|
+
"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",
|
|
986
|
+
e,
|
|
987
|
+
);
|
|
988
|
+
} else {
|
|
989
|
+
throw e;
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
const bytes = await module.arrayBuffer();
|
|
995
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
996
|
+
} else {
|
|
997
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
998
|
+
|
|
999
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1000
|
+
return { instance, module };
|
|
1001
|
+
} else {
|
|
1002
|
+
return instance;
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
function __wbg_get_imports() {
|
|
1008
|
+
const imports = {};
|
|
1009
|
+
imports.wbg = {};
|
|
1010
|
+
imports.wbg.__wbg_documentend_new = function (arg0) {
|
|
1011
|
+
const ret = DocumentEnd.__wrap(arg0);
|
|
1012
|
+
return ret;
|
|
1013
|
+
};
|
|
1014
|
+
imports.wbg.__wbindgen_string_new = function (arg0, arg1) {
|
|
1015
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1016
|
+
return ret;
|
|
1017
|
+
};
|
|
1018
|
+
imports.wbg.__wbg_html_fbd00991d780a754 = function (arg0) {
|
|
1019
|
+
const ret = arg0.html;
|
|
1020
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
1021
|
+
};
|
|
1022
|
+
imports.wbg.__wbg_element_dc40d85e59f7e8db = function (arg0) {
|
|
1023
|
+
const ret = arg0.element;
|
|
1024
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1025
|
+
};
|
|
1026
|
+
imports.wbg.__wbg_comments_f4a32acf5bd7f6d3 = function (arg0) {
|
|
1027
|
+
const ret = arg0.comments;
|
|
1028
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1029
|
+
};
|
|
1030
|
+
imports.wbg.__wbg_text_52e38b02986f1e18 = function (arg0) {
|
|
1031
|
+
const ret = arg0.text;
|
|
1032
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1033
|
+
};
|
|
1034
|
+
imports.wbg.__wbg_element_new = function (arg0) {
|
|
1035
|
+
const ret = Element.__wrap(arg0);
|
|
1036
|
+
return ret;
|
|
1037
|
+
};
|
|
1038
|
+
imports.wbg.__wbg_comment_new = function (arg0) {
|
|
1039
|
+
const ret = Comment.__wrap(arg0);
|
|
1040
|
+
return ret;
|
|
1041
|
+
};
|
|
1042
|
+
imports.wbg.__wbg_textchunk_new = function (arg0) {
|
|
1043
|
+
const ret = TextChunk.__wrap(arg0);
|
|
1044
|
+
return ret;
|
|
1045
|
+
};
|
|
1046
|
+
imports.wbg.__wbg_doctype_95d10656b9e0c589 = function (arg0) {
|
|
1047
|
+
const ret = arg0.doctype;
|
|
1048
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1049
|
+
};
|
|
1050
|
+
imports.wbg.__wbg_comments_b4db58b38f105644 = function (arg0) {
|
|
1051
|
+
const ret = arg0.comments;
|
|
1052
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1053
|
+
};
|
|
1054
|
+
imports.wbg.__wbg_text_54a231591f2b4f44 = function (arg0) {
|
|
1055
|
+
const ret = arg0.text;
|
|
1056
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1057
|
+
};
|
|
1058
|
+
imports.wbg.__wbg_end_84bb4f497e4b2cf5 = function (arg0) {
|
|
1059
|
+
const ret = arg0.end;
|
|
1060
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1061
|
+
};
|
|
1062
|
+
imports.wbg.__wbg_doctype_new = function (arg0) {
|
|
1063
|
+
const ret = Doctype.__wrap(arg0);
|
|
1064
|
+
return ret;
|
|
1065
|
+
};
|
|
1066
|
+
imports.wbg.__wbg_enableEsiTags_d72598c2e278624d = function (arg0) {
|
|
1067
|
+
const ret = arg0.enableEsiTags;
|
|
1068
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
1069
|
+
};
|
|
1070
|
+
imports.wbg.__wbg_String_b9412f8799faab3e = function (arg0, arg1) {
|
|
1071
|
+
const ret = String(arg1);
|
|
1072
|
+
const ptr1 = passStringToWasm0(
|
|
1073
|
+
ret,
|
|
1074
|
+
wasm.__wbindgen_malloc,
|
|
1075
|
+
wasm.__wbindgen_realloc,
|
|
1076
|
+
);
|
|
1077
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1078
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1079
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1080
|
+
};
|
|
1081
|
+
imports.wbg.__wbg_new_034f913e7636e987 = function () {
|
|
1082
|
+
const ret = new Array();
|
|
1083
|
+
return ret;
|
|
1084
|
+
};
|
|
1085
|
+
imports.wbg.__wbg_set_425e70f7c64ac962 = function (arg0, arg1, arg2) {
|
|
1086
|
+
arg0[arg1 >>> 0] = arg2;
|
|
1087
|
+
};
|
|
1088
|
+
imports.wbg.__wbg_call_3bfa248576352471 = function () {
|
|
1089
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
1090
|
+
const ret = arg0.call(arg1, arg2);
|
|
1091
|
+
return ret;
|
|
1092
|
+
}, arguments);
|
|
1093
|
+
};
|
|
1094
|
+
imports.wbg.__wbg_new_9a7e38dd635a4e93 = function (arg0, arg1) {
|
|
1095
|
+
const ret = new TypeError(getStringFromWasm0(arg0, arg1));
|
|
1096
|
+
return ret;
|
|
1097
|
+
};
|
|
1098
|
+
imports.wbg.__wbg_buffer_ccaed51a635d8a2d = function (arg0) {
|
|
1099
|
+
const ret = arg0.buffer;
|
|
1100
|
+
return ret;
|
|
1101
|
+
};
|
|
1102
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_7e3eb787208af730 = function (
|
|
1103
|
+
arg0,
|
|
1104
|
+
arg1,
|
|
1105
|
+
arg2,
|
|
1106
|
+
) {
|
|
1107
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
1108
|
+
return ret;
|
|
1109
|
+
};
|
|
1110
|
+
imports.wbg.__wbg_new_fec2611eb9180f95 = function (arg0) {
|
|
1111
|
+
const ret = new Uint8Array(arg0);
|
|
1112
|
+
return ret;
|
|
1113
|
+
};
|
|
1114
|
+
imports.wbg.__wbindgen_debug_string = function (arg0, arg1) {
|
|
1115
|
+
const ret = debugString(arg1);
|
|
1116
|
+
const ptr1 = passStringToWasm0(
|
|
1117
|
+
ret,
|
|
1118
|
+
wasm.__wbindgen_malloc,
|
|
1119
|
+
wasm.__wbindgen_realloc,
|
|
1120
|
+
);
|
|
1121
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1122
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1123
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1124
|
+
};
|
|
1125
|
+
imports.wbg.__wbindgen_throw = function (arg0, arg1) {
|
|
1126
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1127
|
+
};
|
|
1128
|
+
imports.wbg.__wbindgen_memory = function () {
|
|
1129
|
+
const ret = wasm.memory;
|
|
1130
|
+
return ret;
|
|
1131
|
+
};
|
|
1132
|
+
imports.wbg.__wbindgen_init_externref_table = function () {
|
|
1133
|
+
const table = wasm.__wbindgen_export_2;
|
|
1134
|
+
const offset = table.grow(4);
|
|
1135
|
+
table.set(0, undefined);
|
|
1136
|
+
table.set(offset + 0, undefined);
|
|
1137
|
+
table.set(offset + 1, null);
|
|
1138
|
+
table.set(offset + 2, true);
|
|
1139
|
+
table.set(offset + 3, false);
|
|
1140
|
+
};
|
|
1141
|
+
|
|
1142
|
+
return imports;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
function __wbg_init_memory(imports, memory) {
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
function __wbg_finalize_init(instance, module) {
|
|
1149
|
+
wasm = instance.exports;
|
|
1150
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
1151
|
+
cachedDataViewMemory0 = null;
|
|
1152
|
+
cachedUint8ArrayMemory0 = null;
|
|
1153
|
+
|
|
1154
|
+
wasm.__wbindgen_start();
|
|
1155
|
+
return wasm;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
function initSync(module) {
|
|
1159
|
+
if (wasm !== undefined) return wasm;
|
|
1160
|
+
|
|
1161
|
+
if (typeof module !== "undefined") {
|
|
1162
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1163
|
+
({ module } = module);
|
|
1164
|
+
} else {
|
|
1165
|
+
console.warn(
|
|
1166
|
+
"using deprecated parameters for `initSync()`; pass a single object instead",
|
|
1167
|
+
);
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
const imports = __wbg_get_imports();
|
|
1172
|
+
|
|
1173
|
+
__wbg_init_memory(imports);
|
|
1174
|
+
|
|
1175
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
1176
|
+
module = new WebAssembly.Module(module);
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
1180
|
+
|
|
1181
|
+
return __wbg_finalize_init(instance, module);
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
async function __wbg_init(module_or_path) {
|
|
1185
|
+
if (wasm !== undefined) return wasm;
|
|
1186
|
+
|
|
1187
|
+
if (typeof module_or_path !== "undefined") {
|
|
1188
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1189
|
+
({ module_or_path } = module_or_path);
|
|
1190
|
+
} else {
|
|
1191
|
+
console.warn(
|
|
1192
|
+
"using deprecated parameters for the initialization function; pass a single object instead",
|
|
1193
|
+
);
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
if (typeof module_or_path === "undefined") {
|
|
1198
|
+
module_or_path = new URL("htmlrewriter_bg.wasm", import.meta.url);
|
|
1199
|
+
}
|
|
1200
|
+
const imports = __wbg_get_imports();
|
|
1201
|
+
|
|
1202
|
+
if (
|
|
1203
|
+
typeof module_or_path === "string" ||
|
|
1204
|
+
(typeof Request === "function" && module_or_path instanceof Request) ||
|
|
1205
|
+
(typeof URL === "function" && module_or_path instanceof URL)
|
|
1206
|
+
) {
|
|
1207
|
+
module_or_path = fetch(module_or_path);
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
__wbg_init_memory(imports);
|
|
1211
|
+
|
|
1212
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
1213
|
+
|
|
1214
|
+
return __wbg_finalize_init(instance, module);
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
export { initSync };
|
|
1218
|
+
export default __wbg_init;
|