alpha2 0.5.2 → 0.6.0
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/README.md +71 -5
- package/THIRD_PARTY_NOTICES.md +191 -1
- package/dist/apply-edit.d.ts +124 -0
- package/dist/apply-edit.js +15 -0
- package/dist/assets.d.ts +12 -0
- package/dist/audio-layout.js +6 -3
- package/dist/audio-worklet-processor.js +27 -33
- package/dist/audio.d.ts +5 -4
- package/dist/audio.js +8 -6
- package/dist/compose.d.ts +105 -0
- package/dist/compose.js +63 -0
- package/dist/decoder-fallback.d.ts +3 -2
- package/dist/decoder-fallback.js +11 -3
- package/dist/decoder-stall.d.ts +15 -0
- package/dist/decoder-stall.js +52 -0
- package/dist/edit-data.d.ts +24 -0
- package/dist/edit-data.js +224 -0
- package/dist/edit-keys.d.ts +16 -0
- package/dist/edit-keys.js +233 -0
- package/dist/edit.d.ts +41 -8
- package/dist/edit.js +123 -30
- package/dist/export-failure.d.ts +10 -2
- package/dist/export-failure.js +55 -4
- package/dist/export-retry.d.ts +6 -1
- package/dist/export-retry.js +12 -1
- package/dist/exporter.d.ts +11 -7
- package/dist/exporter.js +10 -9
- package/dist/extensions.d.ts +86 -28
- package/dist/extensions.js +204 -61
- package/dist/extract.d.ts +65 -0
- package/dist/extract.js +291 -0
- package/dist/extractor.d.ts +151 -0
- package/dist/extractor.js +141 -0
- package/dist/float32.d.ts +2 -0
- package/dist/float32.js +10 -0
- package/dist/frame-intake.d.ts +5 -0
- package/dist/frame-intake.js +10 -3
- package/dist/generated/builtin-effects.d.ts +3 -0
- package/dist/generated/builtin-effects.js +1804 -0
- package/dist/generated/project-schema.d.ts +696 -41
- package/dist/generated/project-schema.js +67 -0
- package/dist/generated/project-shape.js +986 -383
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/json-text.js +14 -2
- package/dist/layout-values.js +7 -1
- package/dist/layout.d.ts +12 -4
- package/dist/media.d.ts +44 -11
- package/dist/media.js +256 -67
- package/dist/mediabunny.d.ts +32 -12
- package/dist/mediabunny.js +276 -90
- package/dist/player.d.ts +9 -3
- package/dist/player.js +114 -18
- package/dist/plugins.d.ts +62 -0
- package/dist/plugins.js +506 -0
- package/dist/project-data.d.ts +56 -0
- package/dist/project-data.js +765 -0
- package/dist/project.d.ts +36 -1
- package/dist/project.js +515 -42
- package/dist/robustness.d.ts +6 -33
- package/dist/robustness.js +2 -63
- package/dist/sha256.d.ts +3 -2
- package/dist/sha256.js +14 -6
- package/dist/wasm-module.d.ts +37 -0
- package/dist/wasm-module.js +47 -0
- package/dist/worker-error.d.ts +3 -2
- package/dist/worker-error.js +3 -1
- package/dist/worker.d.ts +13 -3
- package/dist/worker.js +36 -9
- package/package.json +36 -2
- package/wasm/alpha2_compose.d.ts +92 -0
- package/wasm/alpha2_compose.js +445 -0
- package/wasm/alpha2_compose_bg.wasm +0 -0
- package/wasm/alpha2_compose_bg.wasm.d.ts +17 -0
- package/wasm/alpha2_extensions.d.ts +4 -4
- package/wasm/alpha2_extensions.js +16 -4
- package/wasm/alpha2_extensions_bg.wasm +0 -0
- package/wasm/alpha2_extensions_pdf.d.ts +227 -0
- package/wasm/alpha2_extensions_pdf.js +841 -0
- package/wasm/alpha2_extensions_pdf_bg.wasm +0 -0
- package/wasm/alpha2_extensions_pdf_bg.wasm.d.ts +38 -0
- package/wasm/alpha2_wasm.d.ts +151 -18
- package/wasm/alpha2_wasm.js +403 -59
- package/wasm/alpha2_wasm_bg.wasm +0 -0
- package/wasm/alpha2_wasm_bg.wasm.d.ts +21 -6
- package/wasm/rust-crate-licenses.md +493 -54
- package/wasm/snippets/alpha2-wasm-1b02e9f302d283ba/inline3.js +7 -0
- /package/wasm/snippets/{alpha2-wasm-a21734ffde826659/inline1.js → alpha2-wasm-1b02e9f302d283ba/inline0.js} +0 -0
- /package/wasm/snippets/{alpha2-wasm-a21734ffde826659/inline2.js → alpha2-wasm-1b02e9f302d283ba/inline1.js} +0 -0
- /package/wasm/snippets/{alpha2-wasm-a21734ffde826659/inline3.js → alpha2-wasm-1b02e9f302d283ba/inline2.js} +0 -0
- /package/wasm/snippets/{alpha2-wasm-a21734ffde826659/inline0.js → alpha2-wasm-1b02e9f302d283ba/inline4.js} +0 -0
|
@@ -0,0 +1,841 @@
|
|
|
1
|
+
/* @ts-self-types="./alpha2_extensions_pdf.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The providers this module was built with, and the sources a page opened.
|
|
5
|
+
*
|
|
6
|
+
* Failures are thrown as plain string messages, not `Error` objects.
|
|
7
|
+
*/
|
|
8
|
+
export class ExtensionRegistry {
|
|
9
|
+
__destroy_into_raw() {
|
|
10
|
+
const ptr = this.__wbg_ptr;
|
|
11
|
+
this.__wbg_ptr = 0;
|
|
12
|
+
ExtensionRegistryFinalization.unregister(this);
|
|
13
|
+
return ptr;
|
|
14
|
+
}
|
|
15
|
+
free() {
|
|
16
|
+
const ptr = this.__destroy_into_raw();
|
|
17
|
+
__wbg_call_guard();
|
|
18
|
+
wasm.__wbg_extensionregistry_free(ptr, 0);
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Forgets every registered font; open sources keep theirs.
|
|
23
|
+
*/
|
|
24
|
+
clearFonts() {
|
|
25
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
26
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
27
|
+
}
|
|
28
|
+
__wbg_call_guard();
|
|
29
|
+
wasm.extensionregistry_clearFonts(this.__wbg_ptr);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Locators rendering at a source tick reads that the source does not hold, as a JSON array.
|
|
33
|
+
*
|
|
34
|
+
* # Errors
|
|
35
|
+
* When the handle is not open.
|
|
36
|
+
* @param {number} handle
|
|
37
|
+
* @param {bigint} time_ticks
|
|
38
|
+
* @returns {string}
|
|
39
|
+
*/
|
|
40
|
+
needs(handle, time_ticks) {
|
|
41
|
+
let deferred2_0;
|
|
42
|
+
let deferred2_1;
|
|
43
|
+
try {
|
|
44
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
45
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
46
|
+
}
|
|
47
|
+
let ret;
|
|
48
|
+
__wbg_call_guard();
|
|
49
|
+
ret = wasm.extensionregistry_needs(this.__wbg_ptr, handle, time_ticks);
|
|
50
|
+
var ptr1 = ret[0];
|
|
51
|
+
var len1 = ret[1];
|
|
52
|
+
if (ret[3]) {
|
|
53
|
+
ptr1 = 0; len1 = 0;
|
|
54
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
55
|
+
}
|
|
56
|
+
deferred2_0 = ptr1;
|
|
57
|
+
deferred2_1 = len1;
|
|
58
|
+
return getStringFromWasm0(ptr1, len1);
|
|
59
|
+
} finally {
|
|
60
|
+
__wbg_call_guard();
|
|
61
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Every provider this module was built with.
|
|
66
|
+
*/
|
|
67
|
+
constructor() {
|
|
68
|
+
let ret;
|
|
69
|
+
__wbg_call_guard();
|
|
70
|
+
ret = wasm.extensionregistry_new();
|
|
71
|
+
this.__wbg_ptr = ret;
|
|
72
|
+
Object.defineProperty(this, '__wbg_inst', { value: __wbg_instance_id, writable: true });
|
|
73
|
+
ExtensionRegistryFinalization.register(this, { ptr: ret, instance: __wbg_instance_id }, this);
|
|
74
|
+
return this;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Locators opening a provider source (JSON) reads, as a JSON array.
|
|
78
|
+
*
|
|
79
|
+
* # Errors
|
|
80
|
+
* When the provider source is not valid JSON.
|
|
81
|
+
* @param {string} provider
|
|
82
|
+
* @returns {string}
|
|
83
|
+
*/
|
|
84
|
+
openNeeds(provider) {
|
|
85
|
+
let deferred3_0;
|
|
86
|
+
let deferred3_1;
|
|
87
|
+
try {
|
|
88
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
89
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
90
|
+
}
|
|
91
|
+
const ptr0 = passStringToWasm0(provider, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
92
|
+
const len0 = WASM_VECTOR_LEN;
|
|
93
|
+
let ret;
|
|
94
|
+
__wbg_call_guard();
|
|
95
|
+
ret = wasm.extensionregistry_openNeeds(this.__wbg_ptr, ptr0, len0);
|
|
96
|
+
var ptr2 = ret[0];
|
|
97
|
+
var len2 = ret[1];
|
|
98
|
+
if (ret[3]) {
|
|
99
|
+
ptr2 = 0; len2 = 0;
|
|
100
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
101
|
+
}
|
|
102
|
+
deferred3_0 = ptr2;
|
|
103
|
+
deferred3_1 = len2;
|
|
104
|
+
return getStringFromWasm0(ptr2, len2);
|
|
105
|
+
} finally {
|
|
106
|
+
__wbg_call_guard();
|
|
107
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Opens a provider source (JSON) with its bytes (none for an image sequence or LaTeX) and
|
|
112
|
+
* returns a handle.
|
|
113
|
+
*
|
|
114
|
+
* # Errors
|
|
115
|
+
* If the source cannot be opened.
|
|
116
|
+
* @param {string} provider
|
|
117
|
+
* @param {Uint8Array | null} [bytes]
|
|
118
|
+
* @returns {number}
|
|
119
|
+
*/
|
|
120
|
+
open(provider, bytes) {
|
|
121
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
122
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
123
|
+
}
|
|
124
|
+
const ptr0 = passStringToWasm0(provider, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
125
|
+
const len0 = WASM_VECTOR_LEN;
|
|
126
|
+
var ptr1 = isLikeNone(bytes) ? 0 : passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
127
|
+
var len1 = WASM_VECTOR_LEN;
|
|
128
|
+
let ret;
|
|
129
|
+
__wbg_call_guard();
|
|
130
|
+
ret = wasm.extensionregistry_open(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
131
|
+
if (ret[2]) {
|
|
132
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
133
|
+
}
|
|
134
|
+
return ret[0] >>> 0;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* The first claiming provider's result as JSON `{ provider, report }`, or `undefined`.
|
|
138
|
+
*
|
|
139
|
+
* # Errors
|
|
140
|
+
* If a claiming provider cannot read the bytes.
|
|
141
|
+
* @param {Uint8Array} bytes
|
|
142
|
+
* @returns {string | undefined}
|
|
143
|
+
*/
|
|
144
|
+
probe(bytes) {
|
|
145
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
146
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
147
|
+
}
|
|
148
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
149
|
+
const len0 = WASM_VECTOR_LEN;
|
|
150
|
+
let ret;
|
|
151
|
+
__wbg_call_guard();
|
|
152
|
+
ret = wasm.extensionregistry_probe(this.__wbg_ptr, ptr0, len0);
|
|
153
|
+
if (ret[3]) {
|
|
154
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
155
|
+
}
|
|
156
|
+
let v2;
|
|
157
|
+
if (ret[0] !== 0) {
|
|
158
|
+
v2 = getStringFromWasm0(ret[0], ret[1]);
|
|
159
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
160
|
+
}
|
|
161
|
+
return v2;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* The providers' names, in priority order, as a JSON array.
|
|
165
|
+
* @returns {string}
|
|
166
|
+
*/
|
|
167
|
+
providers() {
|
|
168
|
+
let deferred1_0;
|
|
169
|
+
let deferred1_1;
|
|
170
|
+
try {
|
|
171
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
172
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
173
|
+
}
|
|
174
|
+
let ret;
|
|
175
|
+
__wbg_call_guard();
|
|
176
|
+
ret = wasm.extensionregistry_providers(this.__wbg_ptr);
|
|
177
|
+
deferred1_0 = ret[0];
|
|
178
|
+
deferred1_1 = ret[1];
|
|
179
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
180
|
+
} finally {
|
|
181
|
+
__wbg_call_guard();
|
|
182
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* A handle to another independently positioned reader that shares the source's decoded
|
|
187
|
+
* data. It stays valid after the original is closed. `undefined` when any time is equally
|
|
188
|
+
* cheap to draw, so the page should share the source.
|
|
189
|
+
*
|
|
190
|
+
* # Errors
|
|
191
|
+
* When the handle is not open.
|
|
192
|
+
* @param {number} handle
|
|
193
|
+
* @returns {number | undefined}
|
|
194
|
+
*/
|
|
195
|
+
reader(handle) {
|
|
196
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
197
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
198
|
+
}
|
|
199
|
+
let ret;
|
|
200
|
+
__wbg_call_guard();
|
|
201
|
+
ret = wasm.extensionregistry_reader(this.__wbg_ptr, handle);
|
|
202
|
+
if (ret[2]) {
|
|
203
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
204
|
+
}
|
|
205
|
+
return ret[0] === Number.MAX_SAFE_INTEGER ? undefined : ret[0];
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Registers a font for SVG text. Sources read fonts when they open.
|
|
209
|
+
* @param {Uint8Array} bytes
|
|
210
|
+
*/
|
|
211
|
+
registerFont(bytes) {
|
|
212
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
213
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
214
|
+
}
|
|
215
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
216
|
+
const len0 = WASM_VECTOR_LEN;
|
|
217
|
+
__wbg_call_guard();
|
|
218
|
+
wasm.extensionregistry_registerFont(this.__wbg_ptr, ptr0, len0);
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Registers bytes under a locator. Sources read them only during open or render, so a page
|
|
222
|
+
* may register them just for that call (see [`Self::needs`]).
|
|
223
|
+
* @param {string} locator
|
|
224
|
+
* @param {Uint8Array} bytes
|
|
225
|
+
*/
|
|
226
|
+
registerResource(locator, bytes) {
|
|
227
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
228
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
229
|
+
}
|
|
230
|
+
const ptr0 = passStringToWasm0(locator, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
231
|
+
const len0 = WASM_VECTOR_LEN;
|
|
232
|
+
const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
233
|
+
const len1 = WASM_VECTOR_LEN;
|
|
234
|
+
__wbg_call_guard();
|
|
235
|
+
wasm.extensionregistry_registerResource(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Forgets the bytes registered under a locator.
|
|
239
|
+
* @param {string} locator
|
|
240
|
+
*/
|
|
241
|
+
releaseResource(locator) {
|
|
242
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
243
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
244
|
+
}
|
|
245
|
+
const ptr0 = passStringToWasm0(locator, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
246
|
+
const len0 = WASM_VECTOR_LEN;
|
|
247
|
+
__wbg_call_guard();
|
|
248
|
+
wasm.extensionregistry_releaseResource(this.__wbg_ptr, ptr0, len0);
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Closes a source.
|
|
252
|
+
* @param {number} handle
|
|
253
|
+
*/
|
|
254
|
+
release(handle) {
|
|
255
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
256
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
257
|
+
}
|
|
258
|
+
__wbg_call_guard();
|
|
259
|
+
wasm.extensionregistry_release(this.__wbg_ptr, handle);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* The frame at a source tick. Vector sources rasterize to fit `fit_width` by `fit_height`
|
|
263
|
+
* (0 by 0 for their own size).
|
|
264
|
+
*
|
|
265
|
+
* # Errors
|
|
266
|
+
* When the handle is not open or the frame cannot be produced.
|
|
267
|
+
* @param {number} handle
|
|
268
|
+
* @param {bigint} time_ticks
|
|
269
|
+
* @param {number} fit_width
|
|
270
|
+
* @param {number} fit_height
|
|
271
|
+
* @returns {RenderedFrame}
|
|
272
|
+
*/
|
|
273
|
+
render(handle, time_ticks, fit_width, fit_height) {
|
|
274
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
275
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
276
|
+
}
|
|
277
|
+
let ret;
|
|
278
|
+
__wbg_call_guard();
|
|
279
|
+
ret = wasm.extensionregistry_render(this.__wbg_ptr, handle, time_ticks, fit_width, fit_height);
|
|
280
|
+
if (ret[2]) {
|
|
281
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
282
|
+
}
|
|
283
|
+
return RenderedFrame.__wrap(ret[0]);
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* What an opened source is, as JSON.
|
|
287
|
+
*
|
|
288
|
+
* # Errors
|
|
289
|
+
* When the handle is not open.
|
|
290
|
+
* @param {number} handle
|
|
291
|
+
* @returns {string}
|
|
292
|
+
*/
|
|
293
|
+
report(handle) {
|
|
294
|
+
let deferred2_0;
|
|
295
|
+
let deferred2_1;
|
|
296
|
+
try {
|
|
297
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
298
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
299
|
+
}
|
|
300
|
+
let ret;
|
|
301
|
+
__wbg_call_guard();
|
|
302
|
+
ret = wasm.extensionregistry_report(this.__wbg_ptr, handle);
|
|
303
|
+
var ptr1 = ret[0];
|
|
304
|
+
var len1 = ret[1];
|
|
305
|
+
if (ret[3]) {
|
|
306
|
+
ptr1 = 0; len1 = 0;
|
|
307
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
308
|
+
}
|
|
309
|
+
deferred2_0 = ptr1;
|
|
310
|
+
deferred2_1 = len1;
|
|
311
|
+
return getStringFromWasm0(ptr1, len1);
|
|
312
|
+
} finally {
|
|
313
|
+
__wbg_call_guard();
|
|
314
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Bytes an open source holds between renders (cached frames, images, and file bytes).
|
|
319
|
+
*
|
|
320
|
+
* # Errors
|
|
321
|
+
* When the handle is not open.
|
|
322
|
+
* @param {number} handle
|
|
323
|
+
* @returns {number}
|
|
324
|
+
*/
|
|
325
|
+
residentBytes(handle) {
|
|
326
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
327
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
328
|
+
}
|
|
329
|
+
let ret;
|
|
330
|
+
__wbg_call_guard();
|
|
331
|
+
ret = wasm.extensionregistry_residentBytes(this.__wbg_ptr, handle);
|
|
332
|
+
if (ret[2]) {
|
|
333
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
334
|
+
}
|
|
335
|
+
return ret[0] >>> 0;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Total bytes registered under locators.
|
|
339
|
+
* @returns {number}
|
|
340
|
+
*/
|
|
341
|
+
resourceBytes() {
|
|
342
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
343
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
344
|
+
}
|
|
345
|
+
let ret;
|
|
346
|
+
__wbg_call_guard();
|
|
347
|
+
ret = wasm.extensionregistry_resourceBytes(this.__wbg_ptr);
|
|
348
|
+
return ret >>> 0;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* The part of [`Self::resident_bytes`] shared with [`Self::reader`] readers, counted once.
|
|
352
|
+
*
|
|
353
|
+
* # Errors
|
|
354
|
+
* When the handle is not open.
|
|
355
|
+
* @param {number} handle
|
|
356
|
+
* @returns {number}
|
|
357
|
+
*/
|
|
358
|
+
sharedBytes(handle) {
|
|
359
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
360
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
361
|
+
}
|
|
362
|
+
let ret;
|
|
363
|
+
__wbg_call_guard();
|
|
364
|
+
ret = wasm.extensionregistry_sharedBytes(this.__wbg_ptr, handle);
|
|
365
|
+
if (ret[2]) {
|
|
366
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
367
|
+
}
|
|
368
|
+
return ret[0] >>> 0;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Whether this module opens a project's provider source (JSON).
|
|
372
|
+
* @param {string} provider
|
|
373
|
+
* @returns {boolean}
|
|
374
|
+
*/
|
|
375
|
+
supports(provider) {
|
|
376
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
377
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
378
|
+
}
|
|
379
|
+
const ptr0 = passStringToWasm0(provider, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
380
|
+
const len0 = WASM_VECTOR_LEN;
|
|
381
|
+
let ret;
|
|
382
|
+
__wbg_call_guard();
|
|
383
|
+
ret = wasm.extensionregistry_supports(this.__wbg_ptr, ptr0, len0);
|
|
384
|
+
return ret !== 0;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
if (Symbol.dispose) ExtensionRegistry.prototype[Symbol.dispose] = ExtensionRegistry.prototype.free;
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* One frame a source rendered.
|
|
391
|
+
*/
|
|
392
|
+
export class RenderedFrame {
|
|
393
|
+
static __wrap(ptr) {
|
|
394
|
+
const obj = Object.create(RenderedFrame.prototype);
|
|
395
|
+
obj.__wbg_ptr = ptr;
|
|
396
|
+
Object.defineProperty(obj, '__wbg_inst', { value: __wbg_instance_id, writable: true });
|
|
397
|
+
|
|
398
|
+
RenderedFrameFinalization.register(obj, { ptr, instance: __wbg_instance_id }, obj);
|
|
399
|
+
return obj;
|
|
400
|
+
}
|
|
401
|
+
__destroy_into_raw() {
|
|
402
|
+
const ptr = this.__wbg_ptr;
|
|
403
|
+
this.__wbg_ptr = 0;
|
|
404
|
+
RenderedFrameFinalization.unregister(this);
|
|
405
|
+
return ptr;
|
|
406
|
+
}
|
|
407
|
+
free() {
|
|
408
|
+
const ptr = this.__destroy_into_raw();
|
|
409
|
+
__wbg_call_guard();
|
|
410
|
+
wasm.__wbg_renderedframe_free(ptr, 0);
|
|
411
|
+
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Diagnostics, as a JSON array.
|
|
415
|
+
* @returns {string}
|
|
416
|
+
*/
|
|
417
|
+
get diagnostics() {
|
|
418
|
+
let deferred1_0;
|
|
419
|
+
let deferred1_1;
|
|
420
|
+
try {
|
|
421
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
422
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
423
|
+
}
|
|
424
|
+
let ret;
|
|
425
|
+
__wbg_call_guard();
|
|
426
|
+
ret = wasm.renderedframe_diagnostics(this.__wbg_ptr);
|
|
427
|
+
deferred1_0 = ret[0];
|
|
428
|
+
deferred1_1 = ret[1];
|
|
429
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
430
|
+
} finally {
|
|
431
|
+
__wbg_call_guard();
|
|
432
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* The first source tick it no longer shows at, or `undefined` for the last frame.
|
|
437
|
+
* @returns {bigint | undefined}
|
|
438
|
+
*/
|
|
439
|
+
get endTicks() {
|
|
440
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
441
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
442
|
+
}
|
|
443
|
+
let ret;
|
|
444
|
+
__wbg_call_guard();
|
|
445
|
+
ret = wasm.renderedframe_endTicks(this.__wbg_ptr);
|
|
446
|
+
return ret[0] === 0 ? undefined : ret[1];
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Premultiplied linear-light RGBA half-float bits (BT.709, rows packed), empty for RGBA8.
|
|
450
|
+
* @returns {Uint16Array}
|
|
451
|
+
*/
|
|
452
|
+
get halfPixels() {
|
|
453
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
454
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
455
|
+
}
|
|
456
|
+
let ret;
|
|
457
|
+
__wbg_call_guard();
|
|
458
|
+
ret = wasm.renderedframe_halfPixels(this.__wbg_ptr);
|
|
459
|
+
return ret;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Height in pixels.
|
|
463
|
+
* @returns {number}
|
|
464
|
+
*/
|
|
465
|
+
get height() {
|
|
466
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
467
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
468
|
+
}
|
|
469
|
+
let ret;
|
|
470
|
+
__wbg_call_guard();
|
|
471
|
+
ret = wasm.renderedframe_height(this.__wbg_ptr);
|
|
472
|
+
return ret >>> 0;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Which of the source's frames this is.
|
|
476
|
+
* @returns {number}
|
|
477
|
+
*/
|
|
478
|
+
get index() {
|
|
479
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
480
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
481
|
+
}
|
|
482
|
+
let ret;
|
|
483
|
+
__wbg_call_guard();
|
|
484
|
+
ret = wasm.renderedframe_index(this.__wbg_ptr);
|
|
485
|
+
return ret >>> 0;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Premultiplied, sRGB-encoded, packed RGBA8 rows; empty for another precision.
|
|
489
|
+
* @returns {Uint8Array}
|
|
490
|
+
*/
|
|
491
|
+
get pixels() {
|
|
492
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
493
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
494
|
+
}
|
|
495
|
+
let ret;
|
|
496
|
+
__wbg_call_guard();
|
|
497
|
+
ret = wasm.renderedframe_pixels(this.__wbg_ptr);
|
|
498
|
+
return ret;
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* `rgba8` for [`Self::pixels`], `linear_f16` for [`Self::half_pixels`].
|
|
502
|
+
* @returns {string}
|
|
503
|
+
*/
|
|
504
|
+
get precision() {
|
|
505
|
+
let deferred1_0;
|
|
506
|
+
let deferred1_1;
|
|
507
|
+
try {
|
|
508
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
509
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
510
|
+
}
|
|
511
|
+
let ret;
|
|
512
|
+
__wbg_call_guard();
|
|
513
|
+
ret = wasm.renderedframe_precision(this.__wbg_ptr);
|
|
514
|
+
deferred1_0 = ret[0];
|
|
515
|
+
deferred1_1 = ret[1];
|
|
516
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
517
|
+
} finally {
|
|
518
|
+
__wbg_call_guard();
|
|
519
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* The first source tick it shows at; 0 for the first frame.
|
|
524
|
+
* @returns {bigint}
|
|
525
|
+
*/
|
|
526
|
+
get startTicks() {
|
|
527
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
528
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
529
|
+
}
|
|
530
|
+
let ret;
|
|
531
|
+
__wbg_call_guard();
|
|
532
|
+
ret = wasm.renderedframe_startTicks(this.__wbg_ptr);
|
|
533
|
+
return ret;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Width in pixels.
|
|
537
|
+
* @returns {number}
|
|
538
|
+
*/
|
|
539
|
+
get width() {
|
|
540
|
+
if (this.__wbg_inst !== undefined && this.__wbg_inst !== __wbg_instance_id) {
|
|
541
|
+
throw new Error('Invalid stale object from previous Wasm instance');
|
|
542
|
+
}
|
|
543
|
+
let ret;
|
|
544
|
+
__wbg_call_guard();
|
|
545
|
+
ret = wasm.renderedframe_width(this.__wbg_ptr);
|
|
546
|
+
return ret >>> 0;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
if (Symbol.dispose) RenderedFrame.prototype[Symbol.dispose] = RenderedFrame.prototype.free;
|
|
550
|
+
|
|
551
|
+
export function __wbg_reset_state () {
|
|
552
|
+
__wbg_instance_id++;
|
|
553
|
+
cachedUint16ArrayMemory0 = null;
|
|
554
|
+
cachedUint8ArrayMemory0 = null;
|
|
555
|
+
if (typeof numBytesDecoded !== 'undefined') numBytesDecoded = 0;
|
|
556
|
+
if (typeof WASM_VECTOR_LEN !== 'undefined') WASM_VECTOR_LEN = 0;
|
|
557
|
+
__wbg_reinit_scheduled = false;
|
|
558
|
+
wasmInstance = new WebAssembly.Instance(wasmModule, __wbg_get_imports());
|
|
559
|
+
wasm = wasmInstance.exports;
|
|
560
|
+
wasm.__wbindgen_start();
|
|
561
|
+
}
|
|
562
|
+
function __wbg_get_imports() {
|
|
563
|
+
const import0 = {
|
|
564
|
+
__proto__: null,
|
|
565
|
+
__wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
|
|
566
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
567
|
+
},
|
|
568
|
+
__wbg_new_from_slice_4ee02165f9de919e: function(arg0, arg1) {
|
|
569
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
570
|
+
return ret;
|
|
571
|
+
},
|
|
572
|
+
__wbg_new_from_slice_99697c36232c8a60: function(arg0, arg1) {
|
|
573
|
+
const ret = new Uint16Array(getArrayU16FromWasm0(arg0, arg1));
|
|
574
|
+
return ret;
|
|
575
|
+
},
|
|
576
|
+
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
577
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
578
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
579
|
+
return ret;
|
|
580
|
+
},
|
|
581
|
+
__wbindgen_init_externref_table: function() {
|
|
582
|
+
const table = wasm.__wbindgen_externrefs;
|
|
583
|
+
const offset = table.grow(4);
|
|
584
|
+
table.set(0, undefined);
|
|
585
|
+
table.set(offset + 0, undefined);
|
|
586
|
+
table.set(offset + 1, null);
|
|
587
|
+
table.set(offset + 2, true);
|
|
588
|
+
table.set(offset + 3, false);
|
|
589
|
+
},
|
|
590
|
+
};
|
|
591
|
+
return {
|
|
592
|
+
__proto__: null,
|
|
593
|
+
"./alpha2_extensions_pdf_bg.js": import0,
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
function __wbg_call_guard() {
|
|
598
|
+
if (__wbg_reinit_scheduled) {
|
|
599
|
+
__wbg_reset_state();
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
let __wbg_instance_id = 0;
|
|
606
|
+
const ExtensionRegistryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
607
|
+
? { register: () => {}, unregister: () => {} }
|
|
608
|
+
: new FinalizationRegistry(({ ptr, instance }) => {
|
|
609
|
+
if (instance === __wbg_instance_id) wasm.__wbg_extensionregistry_free(ptr, 1);
|
|
610
|
+
});
|
|
611
|
+
const RenderedFrameFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
612
|
+
? { register: () => {}, unregister: () => {} }
|
|
613
|
+
: new FinalizationRegistry(({ ptr, instance }) => {
|
|
614
|
+
if (instance === __wbg_instance_id) wasm.__wbg_renderedframe_free(ptr, 1);
|
|
615
|
+
});
|
|
616
|
+
|
|
617
|
+
function getArrayU16FromWasm0(ptr, len) {
|
|
618
|
+
ptr = ptr >>> 0;
|
|
619
|
+
return getUint16ArrayMemory0().subarray(ptr / 2, ptr / 2 + len);
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
623
|
+
ptr = ptr >>> 0;
|
|
624
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
function getStringFromWasm0(ptr, len) {
|
|
628
|
+
return decodeText(ptr >>> 0, len);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
let cachedUint16ArrayMemory0 = null;
|
|
632
|
+
function getUint16ArrayMemory0() {
|
|
633
|
+
if (cachedUint16ArrayMemory0 === null || cachedUint16ArrayMemory0.byteLength === 0) {
|
|
634
|
+
cachedUint16ArrayMemory0 = new Uint16Array(wasm.memory.buffer);
|
|
635
|
+
}
|
|
636
|
+
return cachedUint16ArrayMemory0;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
let cachedUint8ArrayMemory0 = null;
|
|
640
|
+
function getUint8ArrayMemory0() {
|
|
641
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
642
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
643
|
+
}
|
|
644
|
+
return cachedUint8ArrayMemory0;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
function isLikeNone(x) {
|
|
648
|
+
return x === undefined || x === null;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
652
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
653
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
654
|
+
WASM_VECTOR_LEN = arg.length;
|
|
655
|
+
return ptr;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
659
|
+
if (realloc === undefined) {
|
|
660
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
661
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
662
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
663
|
+
WASM_VECTOR_LEN = buf.length;
|
|
664
|
+
return ptr;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
let len = arg.length;
|
|
668
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
669
|
+
|
|
670
|
+
const mem = getUint8ArrayMemory0();
|
|
671
|
+
|
|
672
|
+
let offset = 0;
|
|
673
|
+
|
|
674
|
+
for (; offset < len; offset++) {
|
|
675
|
+
const code = arg.charCodeAt(offset);
|
|
676
|
+
if (code > 0x7F) break;
|
|
677
|
+
mem[ptr + offset] = code;
|
|
678
|
+
}
|
|
679
|
+
if (offset !== len) {
|
|
680
|
+
if (offset !== 0) {
|
|
681
|
+
arg = arg.slice(offset);
|
|
682
|
+
}
|
|
683
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
684
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
685
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
686
|
+
|
|
687
|
+
offset += ret.written;
|
|
688
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
WASM_VECTOR_LEN = offset;
|
|
692
|
+
return ptr;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
let __wbg_reinit_scheduled = false;
|
|
696
|
+
|
|
697
|
+
function takeFromExternrefTable0(idx) {
|
|
698
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
699
|
+
wasm.__externref_table_dealloc(idx);
|
|
700
|
+
return value;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
704
|
+
cachedTextDecoder.decode();
|
|
705
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
706
|
+
let numBytesDecoded = 0;
|
|
707
|
+
function decodeText(ptr, len) {
|
|
708
|
+
numBytesDecoded += len;
|
|
709
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
710
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
711
|
+
cachedTextDecoder.decode();
|
|
712
|
+
numBytesDecoded = len;
|
|
713
|
+
}
|
|
714
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
const cachedTextEncoder = new TextEncoder();
|
|
718
|
+
|
|
719
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
720
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
721
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
722
|
+
view.set(buf);
|
|
723
|
+
return {
|
|
724
|
+
read: arg.length,
|
|
725
|
+
written: buf.length
|
|
726
|
+
};
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
let WASM_VECTOR_LEN = 0;
|
|
731
|
+
|
|
732
|
+
let wasmModule, wasmInstance, wasm;
|
|
733
|
+
function __wbg_finalize_init(instance, module) {
|
|
734
|
+
wasmInstance = instance;
|
|
735
|
+
wasm = instance.exports;
|
|
736
|
+
wasmModule = module;
|
|
737
|
+
cachedUint16ArrayMemory0 = null;
|
|
738
|
+
cachedUint8ArrayMemory0 = null;
|
|
739
|
+
wasm.__wbindgen_start();
|
|
740
|
+
return wasm;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
async function __wbg_load(module, imports) {
|
|
744
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
745
|
+
if (!module.ok) {
|
|
746
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
750
|
+
try {
|
|
751
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
752
|
+
} catch (e) {
|
|
753
|
+
const validResponse = expectedResponseType(module.type);
|
|
754
|
+
|
|
755
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
756
|
+
console.warn("`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", e);
|
|
757
|
+
|
|
758
|
+
} else { throw e; }
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
const bytes = await module.arrayBuffer();
|
|
763
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
764
|
+
} else {
|
|
765
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
766
|
+
|
|
767
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
768
|
+
return { instance, module };
|
|
769
|
+
} else {
|
|
770
|
+
return instance;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
function expectedResponseType(type) {
|
|
775
|
+
switch (type) {
|
|
776
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
777
|
+
}
|
|
778
|
+
return false;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
function initSync(module) {
|
|
783
|
+
if (wasm !== undefined) return wasm;
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
if (module !== undefined) {
|
|
787
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
788
|
+
({module} = module)
|
|
789
|
+
} else {
|
|
790
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
const imports = __wbg_get_imports();
|
|
795
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
796
|
+
module = new WebAssembly.Module(module);
|
|
797
|
+
}
|
|
798
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
799
|
+
return __wbg_finalize_init(instance, module);
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
async function __wbg_init(module_or_path) {
|
|
803
|
+
if (wasm !== undefined) return wasm;
|
|
804
|
+
|
|
805
|
+
|
|
806
|
+
if (module_or_path !== undefined) {
|
|
807
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
808
|
+
({module_or_path} = module_or_path)
|
|
809
|
+
} else {
|
|
810
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
if (module_or_path === undefined) {
|
|
815
|
+
module_or_path = new URL('alpha2_extensions_pdf_bg.wasm', import.meta.url);
|
|
816
|
+
}
|
|
817
|
+
const imports = __wbg_get_imports();
|
|
818
|
+
|
|
819
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
820
|
+
module_or_path = fetch(module_or_path);
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
824
|
+
|
|
825
|
+
return __wbg_finalize_init(instance, module);
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
export { initSync, __wbg_init as default };
|
|
829
|
+
|
|
830
|
+
export async function __wbg_reset_state_async () {
|
|
831
|
+
const instance = await WebAssembly.instantiate(wasmModule, __wbg_get_imports());
|
|
832
|
+
__wbg_instance_id++;
|
|
833
|
+
cachedUint16ArrayMemory0 = null;
|
|
834
|
+
cachedUint8ArrayMemory0 = null;
|
|
835
|
+
if (typeof numBytesDecoded !== 'undefined') numBytesDecoded = 0;
|
|
836
|
+
if (typeof WASM_VECTOR_LEN !== 'undefined') WASM_VECTOR_LEN = 0;
|
|
837
|
+
__wbg_reinit_scheduled = false;
|
|
838
|
+
wasmInstance = instance;
|
|
839
|
+
wasm = wasmInstance.exports;
|
|
840
|
+
wasm.__wbindgen_start();
|
|
841
|
+
}
|