@contentauth/c2pa-wasm 0.2.0 → 0.2.1
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 +68 -0
- package/package.json +1 -1
- package/pkg/c2pa.d.ts +3 -3
- package/pkg/c2pa.js +134 -109
- package/pkg/c2pa_bg.wasm +0 -0
- package/pkg/c2pa_bg.wasm.d.ts +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# c2pa-wasm
|
|
2
|
+
|
|
3
|
+
The WebAssembly wrapper for [`c2pa-rs`](https://github.com/contentauth/c2pa-rs) that powers `c2pa-web`, built with [wasm-bindgen](https://github.com/wasm-bindgen/wasm-bindgen). While these bindings can be used directly, most users will prefer the convenience of `c2pa-web`.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @contentauth/c2pa-wasm
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Development
|
|
12
|
+
|
|
13
|
+
### Prerequsities
|
|
14
|
+
|
|
15
|
+
Ensure the repo-wide prerequisites [NX](https://nx.dev/getting-started/intro) and [pnpm](https://pnpm.io/) are installed.
|
|
16
|
+
|
|
17
|
+
Then, all of the following prerequisites must be installed before `c2pa-wasm` can be built:
|
|
18
|
+
|
|
19
|
+
#### Rust
|
|
20
|
+
|
|
21
|
+
[Installation instructions](https://www.rust-lang.org/tools/install)
|
|
22
|
+
|
|
23
|
+
Minimum supported Rust version: __1.86.0__.
|
|
24
|
+
|
|
25
|
+
Additionally, the `wasm32-unknown-unknown` target must be installed:
|
|
26
|
+
```sh
|
|
27
|
+
rustup target add wasm32-unknown-unknown
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
#### wasm-bindgen-cli
|
|
32
|
+
|
|
33
|
+
[Documentation](https://wasm-bindgen.github.io/wasm-bindgen/reference/cli)
|
|
34
|
+
```sh
|
|
35
|
+
cargo install wasm-bindgen-cli@0.2.101
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
#### wasm-opt
|
|
39
|
+
|
|
40
|
+
[Documentation](https://github.com/WebAssembly/binaryen)
|
|
41
|
+
```sh
|
|
42
|
+
cargo install wasm-opt@0.116.1
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### wasm-pack
|
|
46
|
+
|
|
47
|
+
[Documentation](https://rustwasm.github.io/docs/wasm-pack/)
|
|
48
|
+
```sh
|
|
49
|
+
cargo install wasm-pack@0.13.1
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Building
|
|
53
|
+
|
|
54
|
+
To build the library:
|
|
55
|
+
```sh
|
|
56
|
+
nx build c2pa-wasm
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
This will execute the commands defined in the [nx-wasm-bindgen executor](https://github.com/contentauth/c2pa-js-v2/blob/main/tools/nx-wasm-bindgen/src/executors/build/executor.ts) to produce the final output in the `pkg/` directory.
|
|
60
|
+
|
|
61
|
+
### Testing
|
|
62
|
+
|
|
63
|
+
The library relies on [`wasm-pack`]((https://rustwasm.github.io/docs/wasm-pack/)) to run its tests. As a general principle, the majority of test coverage will come from `c2pa-web`'s test suite.
|
|
64
|
+
|
|
65
|
+
To run the tests:
|
|
66
|
+
```
|
|
67
|
+
nx test c2pa-wasm
|
|
68
|
+
```
|
package/package.json
CHANGED
package/pkg/c2pa.d.ts
CHANGED
|
@@ -69,9 +69,9 @@ export interface InitOutput {
|
|
|
69
69
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
70
70
|
readonly __wbindgen_export_6: WebAssembly.Table;
|
|
71
71
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
72
|
-
readonly
|
|
73
|
-
readonly
|
|
74
|
-
readonly
|
|
72
|
+
readonly wasm_bindgen__convert__closures_____invoke__ha5b2289bd84e4451: (a: number, b: number) => void;
|
|
73
|
+
readonly closure1451_externref_shim: (a: number, b: number, c: any) => void;
|
|
74
|
+
readonly closure2451_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
75
75
|
readonly __wbindgen_start: () => void;
|
|
76
76
|
}
|
|
77
77
|
|
package/pkg/c2pa.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
let wasm;
|
|
2
2
|
|
|
3
|
-
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
4
|
-
|
|
5
|
-
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
6
|
-
|
|
7
3
|
let cachedUint8ArrayMemory0 = null;
|
|
8
4
|
|
|
9
5
|
function getUint8ArrayMemory0() {
|
|
@@ -13,9 +9,25 @@ function getUint8ArrayMemory0() {
|
|
|
13
9
|
return cachedUint8ArrayMemory0;
|
|
14
10
|
}
|
|
15
11
|
|
|
12
|
+
let cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
13
|
+
|
|
14
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
15
|
+
|
|
16
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
17
|
+
let numBytesDecoded = 0;
|
|
18
|
+
function decodeText(ptr, len) {
|
|
19
|
+
numBytesDecoded += len;
|
|
20
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
21
|
+
cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
22
|
+
cachedTextDecoder.decode();
|
|
23
|
+
numBytesDecoded = len;
|
|
24
|
+
}
|
|
25
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
26
|
+
}
|
|
27
|
+
|
|
16
28
|
function getStringFromWasm0(ptr, len) {
|
|
17
29
|
ptr = ptr >>> 0;
|
|
18
|
-
return
|
|
30
|
+
return decodeText(ptr, len);
|
|
19
31
|
}
|
|
20
32
|
|
|
21
33
|
function addToExternrefTable0(obj) {
|
|
@@ -33,6 +45,11 @@ function handleError(f, args) {
|
|
|
33
45
|
}
|
|
34
46
|
}
|
|
35
47
|
|
|
48
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
49
|
+
ptr = ptr >>> 0;
|
|
50
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
51
|
+
}
|
|
52
|
+
|
|
36
53
|
let WASM_VECTOR_LEN = 0;
|
|
37
54
|
|
|
38
55
|
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
@@ -223,16 +240,16 @@ export function run() {
|
|
|
223
240
|
wasm.run();
|
|
224
241
|
}
|
|
225
242
|
|
|
226
|
-
function
|
|
227
|
-
wasm.
|
|
243
|
+
function __wbg_adapter_36(arg0, arg1) {
|
|
244
|
+
wasm.wasm_bindgen__convert__closures_____invoke__ha5b2289bd84e4451(arg0, arg1);
|
|
228
245
|
}
|
|
229
246
|
|
|
230
|
-
function
|
|
231
|
-
wasm.
|
|
247
|
+
function __wbg_adapter_39(arg0, arg1, arg2) {
|
|
248
|
+
wasm.closure1451_externref_shim(arg0, arg1, arg2);
|
|
232
249
|
}
|
|
233
250
|
|
|
234
|
-
function
|
|
235
|
-
wasm.
|
|
251
|
+
function __wbg_adapter_151(arg0, arg1, arg2, arg3) {
|
|
252
|
+
wasm.closure2451_externref_shim(arg0, arg1, arg2, arg3);
|
|
236
253
|
}
|
|
237
254
|
|
|
238
255
|
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
@@ -360,6 +377,8 @@ export class WasmReader {
|
|
|
360
377
|
}
|
|
361
378
|
}
|
|
362
379
|
|
|
380
|
+
const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
|
|
381
|
+
|
|
363
382
|
async function __wbg_load(module, imports) {
|
|
364
383
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
365
384
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
@@ -367,7 +386,9 @@ async function __wbg_load(module, imports) {
|
|
|
367
386
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
368
387
|
|
|
369
388
|
} catch (e) {
|
|
370
|
-
|
|
389
|
+
const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
|
|
390
|
+
|
|
391
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
371
392
|
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);
|
|
372
393
|
|
|
373
394
|
} else {
|
|
@@ -394,44 +415,48 @@ async function __wbg_load(module, imports) {
|
|
|
394
415
|
function __wbg_get_imports() {
|
|
395
416
|
const imports = {};
|
|
396
417
|
imports.wbg = {};
|
|
397
|
-
imports.wbg.
|
|
398
|
-
arg0
|
|
418
|
+
imports.wbg.__wbg_Error_0497d5bdba9362e5 = function(arg0, arg1) {
|
|
419
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
420
|
+
return ret;
|
|
399
421
|
};
|
|
400
|
-
imports.wbg.
|
|
422
|
+
imports.wbg.__wbg_abort_18ba44d46e13d7fe = function(arg0) {
|
|
401
423
|
arg0.abort();
|
|
402
424
|
};
|
|
403
|
-
imports.wbg.
|
|
425
|
+
imports.wbg.__wbg_abort_4198a1129c47f21a = function(arg0, arg1) {
|
|
426
|
+
arg0.abort(arg1);
|
|
427
|
+
};
|
|
428
|
+
imports.wbg.__wbg_append_0342728346e47425 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
404
429
|
arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
405
430
|
}, arguments) };
|
|
406
|
-
imports.wbg.
|
|
431
|
+
imports.wbg.__wbg_arrayBuffer_d58b858456021d7f = function() { return handleError(function (arg0) {
|
|
407
432
|
const ret = arg0.arrayBuffer();
|
|
408
433
|
return ret;
|
|
409
434
|
}, arguments) };
|
|
410
|
-
imports.wbg.
|
|
435
|
+
imports.wbg.__wbg_buffer_a1a27a0dfa70165d = function(arg0) {
|
|
411
436
|
const ret = arg0.buffer;
|
|
412
437
|
return ret;
|
|
413
438
|
};
|
|
414
|
-
imports.wbg.
|
|
439
|
+
imports.wbg.__wbg_buffer_e495ba54cee589cc = function(arg0) {
|
|
415
440
|
const ret = arg0.buffer;
|
|
416
441
|
return ret;
|
|
417
442
|
};
|
|
418
|
-
imports.wbg.
|
|
443
|
+
imports.wbg.__wbg_byteLength_937f8a52f9697148 = function(arg0) {
|
|
419
444
|
const ret = arg0.byteLength;
|
|
420
445
|
return ret;
|
|
421
446
|
};
|
|
422
|
-
imports.wbg.
|
|
423
|
-
const ret = arg0.call(arg1);
|
|
447
|
+
imports.wbg.__wbg_call_f2db6205e5c51dc8 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
448
|
+
const ret = arg0.call(arg1, arg2);
|
|
424
449
|
return ret;
|
|
425
450
|
}, arguments) };
|
|
426
|
-
imports.wbg.
|
|
427
|
-
const ret = arg0.call(arg1
|
|
451
|
+
imports.wbg.__wbg_call_fbe8be8bf6436ce5 = function() { return handleError(function (arg0, arg1) {
|
|
452
|
+
const ret = arg0.call(arg1);
|
|
428
453
|
return ret;
|
|
429
454
|
}, arguments) };
|
|
430
455
|
imports.wbg.__wbg_clearTimeout_0b53d391c1b94dda = function(arg0) {
|
|
431
456
|
const ret = clearTimeout(arg0);
|
|
432
457
|
return ret;
|
|
433
458
|
};
|
|
434
|
-
imports.wbg.
|
|
459
|
+
imports.wbg.__wbg_done_4d01f352bade43b7 = function(arg0) {
|
|
435
460
|
const ret = arg0.done;
|
|
436
461
|
return ret;
|
|
437
462
|
};
|
|
@@ -450,31 +475,31 @@ function __wbg_get_imports() {
|
|
|
450
475
|
const ret = fetch(arg0);
|
|
451
476
|
return ret;
|
|
452
477
|
};
|
|
453
|
-
imports.wbg.
|
|
478
|
+
imports.wbg.__wbg_fetch_a8e43a4e138dfc93 = function(arg0, arg1) {
|
|
454
479
|
const ret = arg0.fetch(arg1);
|
|
455
480
|
return ret;
|
|
456
481
|
};
|
|
457
|
-
imports.wbg.
|
|
482
|
+
imports.wbg.__wbg_from_12ff8e47307bd4c7 = function(arg0) {
|
|
458
483
|
const ret = Array.from(arg0);
|
|
459
484
|
return ret;
|
|
460
485
|
};
|
|
461
|
-
imports.wbg.
|
|
486
|
+
imports.wbg.__wbg_getTime_2afe67905d873e92 = function(arg0) {
|
|
462
487
|
const ret = arg0.getTime();
|
|
463
488
|
return ret;
|
|
464
489
|
};
|
|
465
|
-
imports.wbg.
|
|
490
|
+
imports.wbg.__wbg_get_92470be87867c2e5 = function() { return handleError(function (arg0, arg1) {
|
|
466
491
|
const ret = Reflect.get(arg0, arg1);
|
|
467
492
|
return ret;
|
|
468
493
|
}, arguments) };
|
|
469
|
-
imports.wbg.
|
|
494
|
+
imports.wbg.__wbg_has_809e438ee9d787a7 = function() { return handleError(function (arg0, arg1) {
|
|
470
495
|
const ret = Reflect.has(arg0, arg1);
|
|
471
496
|
return ret;
|
|
472
497
|
}, arguments) };
|
|
473
|
-
imports.wbg.
|
|
498
|
+
imports.wbg.__wbg_headers_0f0cbdc6290b6780 = function(arg0) {
|
|
474
499
|
const ret = arg0.headers;
|
|
475
500
|
return ret;
|
|
476
501
|
};
|
|
477
|
-
imports.wbg.
|
|
502
|
+
imports.wbg.__wbg_instanceof_Response_e80ce8b7a2b968d2 = function(arg0) {
|
|
478
503
|
let result;
|
|
479
504
|
try {
|
|
480
505
|
result = arg0 instanceof Response;
|
|
@@ -484,34 +509,58 @@ function __wbg_get_imports() {
|
|
|
484
509
|
const ret = result;
|
|
485
510
|
return ret;
|
|
486
511
|
};
|
|
487
|
-
imports.wbg.
|
|
512
|
+
imports.wbg.__wbg_iterator_4068add5b2aef7a6 = function() {
|
|
488
513
|
const ret = Symbol.iterator;
|
|
489
514
|
return ret;
|
|
490
515
|
};
|
|
491
|
-
imports.wbg.
|
|
516
|
+
imports.wbg.__wbg_length_ab6d22b5ead75c72 = function(arg0) {
|
|
492
517
|
const ret = arg0.length;
|
|
493
518
|
return ret;
|
|
494
519
|
};
|
|
495
|
-
imports.wbg.
|
|
520
|
+
imports.wbg.__wbg_new0_97314565408dea38 = function() {
|
|
496
521
|
const ret = new Date();
|
|
497
522
|
return ret;
|
|
498
523
|
};
|
|
499
|
-
imports.wbg.
|
|
524
|
+
imports.wbg.__wbg_new_07b483f72211fd66 = function() {
|
|
525
|
+
const ret = new Object();
|
|
526
|
+
return ret;
|
|
527
|
+
};
|
|
528
|
+
imports.wbg.__wbg_new_186abcfdff244e42 = function() { return handleError(function () {
|
|
529
|
+
const ret = new AbortController();
|
|
530
|
+
return ret;
|
|
531
|
+
}, arguments) };
|
|
532
|
+
imports.wbg.__wbg_new_476169e6d59f23ae = function(arg0, arg1) {
|
|
533
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
534
|
+
return ret;
|
|
535
|
+
};
|
|
536
|
+
imports.wbg.__wbg_new_4796e1cd2eb9ea6d = function() { return handleError(function () {
|
|
500
537
|
const ret = new Headers();
|
|
501
538
|
return ret;
|
|
502
539
|
}, arguments) };
|
|
503
|
-
imports.wbg.
|
|
540
|
+
imports.wbg.__wbg_new_58353953ad2097cc = function() {
|
|
541
|
+
const ret = new Array();
|
|
542
|
+
return ret;
|
|
543
|
+
};
|
|
544
|
+
imports.wbg.__wbg_new_58fdb85a58696862 = function() { return handleError(function () {
|
|
504
545
|
const ret = new FileReaderSync();
|
|
505
546
|
return ret;
|
|
506
547
|
}, arguments) };
|
|
507
|
-
imports.wbg.
|
|
548
|
+
imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
|
|
549
|
+
const ret = new Error();
|
|
550
|
+
return ret;
|
|
551
|
+
};
|
|
552
|
+
imports.wbg.__wbg_new_a979b4b45bd55c7f = function() {
|
|
553
|
+
const ret = new Map();
|
|
554
|
+
return ret;
|
|
555
|
+
};
|
|
556
|
+
imports.wbg.__wbg_new_e30c39c06edaabf2 = function(arg0, arg1) {
|
|
508
557
|
try {
|
|
509
558
|
var state0 = {a: arg0, b: arg1};
|
|
510
559
|
var cb0 = (arg0, arg1) => {
|
|
511
560
|
const a = state0.a;
|
|
512
561
|
state0.a = 0;
|
|
513
562
|
try {
|
|
514
|
-
return
|
|
563
|
+
return __wbg_adapter_151(a, state0.b, arg0, arg1);
|
|
515
564
|
} finally {
|
|
516
565
|
state0.a = a;
|
|
517
566
|
}
|
|
@@ -522,74 +571,54 @@ function __wbg_get_imports() {
|
|
|
522
571
|
state0.a = state0.b = 0;
|
|
523
572
|
}
|
|
524
573
|
};
|
|
525
|
-
imports.wbg.
|
|
526
|
-
const ret = new Object();
|
|
527
|
-
return ret;
|
|
528
|
-
};
|
|
529
|
-
imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
|
|
530
|
-
const ret = new Map();
|
|
531
|
-
return ret;
|
|
532
|
-
};
|
|
533
|
-
imports.wbg.__wbg_new_78feb108b6472713 = function() {
|
|
534
|
-
const ret = new Array();
|
|
535
|
-
return ret;
|
|
536
|
-
};
|
|
537
|
-
imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
|
|
538
|
-
const ret = new Error();
|
|
539
|
-
return ret;
|
|
540
|
-
};
|
|
541
|
-
imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
|
|
574
|
+
imports.wbg.__wbg_new_e52b3efaaa774f96 = function(arg0) {
|
|
542
575
|
const ret = new Uint8Array(arg0);
|
|
543
576
|
return ret;
|
|
544
577
|
};
|
|
545
|
-
imports.wbg.
|
|
546
|
-
const ret = new
|
|
578
|
+
imports.wbg.__wbg_newfromslice_7c05ab1297cb2d88 = function(arg0, arg1) {
|
|
579
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
547
580
|
return ret;
|
|
548
581
|
};
|
|
549
|
-
imports.wbg.
|
|
550
|
-
const ret = new AbortController();
|
|
551
|
-
return ret;
|
|
552
|
-
}, arguments) };
|
|
553
|
-
imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
|
582
|
+
imports.wbg.__wbg_newnoargs_ff528e72d35de39a = function(arg0, arg1) {
|
|
554
583
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
555
584
|
return ret;
|
|
556
585
|
};
|
|
557
|
-
imports.wbg.
|
|
586
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_3b01ecda099177e8 = function(arg0, arg1, arg2) {
|
|
558
587
|
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
559
588
|
return ret;
|
|
560
589
|
};
|
|
561
|
-
imports.wbg.
|
|
590
|
+
imports.wbg.__wbg_newwithlength_08f872dc1e3ada2e = function(arg0) {
|
|
562
591
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
563
592
|
return ret;
|
|
564
593
|
};
|
|
565
|
-
imports.wbg.
|
|
594
|
+
imports.wbg.__wbg_newwithstrandinit_f8a9dbe009d6be37 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
566
595
|
const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
|
|
567
596
|
return ret;
|
|
568
597
|
}, arguments) };
|
|
569
|
-
imports.wbg.
|
|
598
|
+
imports.wbg.__wbg_next_8bb824d217961b5d = function(arg0) {
|
|
570
599
|
const ret = arg0.next;
|
|
571
600
|
return ret;
|
|
572
601
|
};
|
|
573
|
-
imports.wbg.
|
|
602
|
+
imports.wbg.__wbg_next_e2da48d8fff7439a = function() { return handleError(function (arg0) {
|
|
574
603
|
const ret = arg0.next();
|
|
575
604
|
return ret;
|
|
576
605
|
}, arguments) };
|
|
577
|
-
imports.wbg.
|
|
606
|
+
imports.wbg.__wbg_now_eb0821f3bd9f6529 = function() {
|
|
578
607
|
const ret = Date.now();
|
|
579
608
|
return ret;
|
|
580
609
|
};
|
|
581
|
-
imports.wbg.
|
|
610
|
+
imports.wbg.__wbg_queueMicrotask_46c1df247678729f = function(arg0) {
|
|
582
611
|
queueMicrotask(arg0);
|
|
583
612
|
};
|
|
584
|
-
imports.wbg.
|
|
613
|
+
imports.wbg.__wbg_queueMicrotask_8acf3ccb75ed8d11 = function(arg0) {
|
|
585
614
|
const ret = arg0.queueMicrotask;
|
|
586
615
|
return ret;
|
|
587
616
|
};
|
|
588
|
-
imports.wbg.
|
|
617
|
+
imports.wbg.__wbg_readAsArrayBuffer_5af53619afa1b299 = function() { return handleError(function (arg0, arg1) {
|
|
589
618
|
const ret = arg0.readAsArrayBuffer(arg1);
|
|
590
619
|
return ret;
|
|
591
620
|
}, arguments) };
|
|
592
|
-
imports.wbg.
|
|
621
|
+
imports.wbg.__wbg_resolve_0dac8c580ffd4678 = function(arg0) {
|
|
593
622
|
const ret = Promise.resolve(arg0);
|
|
594
623
|
return ret;
|
|
595
624
|
};
|
|
@@ -597,46 +626,46 @@ function __wbg_get_imports() {
|
|
|
597
626
|
const ret = setTimeout(arg0, arg1);
|
|
598
627
|
return ret;
|
|
599
628
|
};
|
|
600
|
-
imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
|
|
601
|
-
arg0[arg1 >>> 0] = arg2;
|
|
602
|
-
};
|
|
603
629
|
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
604
630
|
arg0[arg1] = arg2;
|
|
605
631
|
};
|
|
606
|
-
imports.wbg.
|
|
607
|
-
arg0
|
|
632
|
+
imports.wbg.__wbg_set_7422acbe992d64ab = function(arg0, arg1, arg2) {
|
|
633
|
+
arg0[arg1 >>> 0] = arg2;
|
|
608
634
|
};
|
|
609
|
-
imports.wbg.
|
|
635
|
+
imports.wbg.__wbg_set_d6bdfd275fb8a4ce = function(arg0, arg1, arg2) {
|
|
610
636
|
const ret = arg0.set(arg1, arg2);
|
|
611
637
|
return ret;
|
|
612
638
|
};
|
|
613
|
-
imports.wbg.
|
|
639
|
+
imports.wbg.__wbg_set_fe4e79d1ed3b0e9b = function(arg0, arg1, arg2) {
|
|
640
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
641
|
+
};
|
|
642
|
+
imports.wbg.__wbg_setbody_971ec015fc13d6b4 = function(arg0, arg1) {
|
|
614
643
|
arg0.body = arg1;
|
|
615
644
|
};
|
|
616
|
-
imports.wbg.
|
|
645
|
+
imports.wbg.__wbg_setcredentials_920d91fb5984c94a = function(arg0, arg1) {
|
|
617
646
|
arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
|
|
618
647
|
};
|
|
619
|
-
imports.wbg.
|
|
648
|
+
imports.wbg.__wbg_setheaders_65a4eb4c0443ae61 = function(arg0, arg1) {
|
|
620
649
|
arg0.headers = arg1;
|
|
621
650
|
};
|
|
622
|
-
imports.wbg.
|
|
651
|
+
imports.wbg.__wbg_setmethod_8ce1be0b4d701b7c = function(arg0, arg1, arg2) {
|
|
623
652
|
arg0.method = getStringFromWasm0(arg1, arg2);
|
|
624
653
|
};
|
|
625
|
-
imports.wbg.
|
|
654
|
+
imports.wbg.__wbg_setmode_bd35f026f55b6247 = function(arg0, arg1) {
|
|
626
655
|
arg0.mode = __wbindgen_enum_RequestMode[arg1];
|
|
627
656
|
};
|
|
628
|
-
imports.wbg.
|
|
657
|
+
imports.wbg.__wbg_setsignal_8e72abfe7ee03c97 = function(arg0, arg1) {
|
|
629
658
|
arg0.signal = arg1;
|
|
630
659
|
};
|
|
631
|
-
imports.wbg.
|
|
660
|
+
imports.wbg.__wbg_signal_b96223519a041faa = function(arg0) {
|
|
632
661
|
const ret = arg0.signal;
|
|
633
662
|
return ret;
|
|
634
663
|
};
|
|
635
|
-
imports.wbg.
|
|
664
|
+
imports.wbg.__wbg_size_e2929e11261f04db = function(arg0) {
|
|
636
665
|
const ret = arg0.size;
|
|
637
666
|
return ret;
|
|
638
667
|
};
|
|
639
|
-
imports.wbg.
|
|
668
|
+
imports.wbg.__wbg_slice_efdd8b335ee00bd0 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
640
669
|
const ret = arg0.slice(arg1, arg2);
|
|
641
670
|
return ret;
|
|
642
671
|
}, arguments) };
|
|
@@ -647,46 +676,46 @@ function __wbg_get_imports() {
|
|
|
647
676
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
648
677
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
649
678
|
};
|
|
650
|
-
imports.wbg.
|
|
679
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_487c52c58d65314d = function() {
|
|
651
680
|
const ret = typeof global === 'undefined' ? null : global;
|
|
652
681
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
653
682
|
};
|
|
654
|
-
imports.wbg.
|
|
683
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_THIS_ee9704f328b6b291 = function() {
|
|
655
684
|
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
656
685
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
657
686
|
};
|
|
658
|
-
imports.wbg.
|
|
687
|
+
imports.wbg.__wbg_static_accessor_SELF_78c9e3071b912620 = function() {
|
|
659
688
|
const ret = typeof self === 'undefined' ? null : self;
|
|
660
689
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
661
690
|
};
|
|
662
|
-
imports.wbg.
|
|
691
|
+
imports.wbg.__wbg_static_accessor_WINDOW_a093d21393777366 = function() {
|
|
663
692
|
const ret = typeof window === 'undefined' ? null : window;
|
|
664
693
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
665
694
|
};
|
|
666
|
-
imports.wbg.
|
|
695
|
+
imports.wbg.__wbg_status_a54682bbe52f9058 = function(arg0) {
|
|
667
696
|
const ret = arg0.status;
|
|
668
697
|
return ret;
|
|
669
698
|
};
|
|
670
|
-
imports.wbg.
|
|
699
|
+
imports.wbg.__wbg_stringify_c242842b97f054cc = function() { return handleError(function (arg0) {
|
|
671
700
|
const ret = JSON.stringify(arg0);
|
|
672
701
|
return ret;
|
|
673
702
|
}, arguments) };
|
|
674
|
-
imports.wbg.
|
|
675
|
-
const ret = arg0.then(arg1);
|
|
703
|
+
imports.wbg.__wbg_then_82ab9fb4080f1707 = function(arg0, arg1, arg2) {
|
|
704
|
+
const ret = arg0.then(arg1, arg2);
|
|
676
705
|
return ret;
|
|
677
706
|
};
|
|
678
|
-
imports.wbg.
|
|
679
|
-
const ret = arg0.then(arg1
|
|
707
|
+
imports.wbg.__wbg_then_db882932c0c714c6 = function(arg0, arg1) {
|
|
708
|
+
const ret = arg0.then(arg1);
|
|
680
709
|
return ret;
|
|
681
710
|
};
|
|
682
|
-
imports.wbg.
|
|
711
|
+
imports.wbg.__wbg_url_e6ed869ea05b7a71 = function(arg0, arg1) {
|
|
683
712
|
const ret = arg1.url;
|
|
684
713
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
685
714
|
const len1 = WASM_VECTOR_LEN;
|
|
686
715
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
687
716
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
688
717
|
};
|
|
689
|
-
imports.wbg.
|
|
718
|
+
imports.wbg.__wbg_value_17b896954e14f896 = function(arg0) {
|
|
690
719
|
const ret = arg0.value;
|
|
691
720
|
return ret;
|
|
692
721
|
};
|
|
@@ -715,12 +744,12 @@ function __wbg_get_imports() {
|
|
|
715
744
|
const ret = false;
|
|
716
745
|
return ret;
|
|
717
746
|
};
|
|
718
|
-
imports.wbg.
|
|
719
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
747
|
+
imports.wbg.__wbindgen_closure_wrapper10869 = function(arg0, arg1, arg2) {
|
|
748
|
+
const ret = makeMutClosure(arg0, arg1, 1447, __wbg_adapter_36);
|
|
720
749
|
return ret;
|
|
721
750
|
};
|
|
722
|
-
imports.wbg.
|
|
723
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
751
|
+
imports.wbg.__wbindgen_closure_wrapper10883 = function(arg0, arg1, arg2) {
|
|
752
|
+
const ret = makeMutClosure(arg0, arg1, 1450, __wbg_adapter_39);
|
|
724
753
|
return ret;
|
|
725
754
|
};
|
|
726
755
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
@@ -730,10 +759,6 @@ function __wbg_get_imports() {
|
|
|
730
759
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
731
760
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
732
761
|
};
|
|
733
|
-
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
734
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
735
|
-
return ret;
|
|
736
|
-
};
|
|
737
762
|
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
738
763
|
const table = wasm.__wbindgen_export_2;
|
|
739
764
|
const offset = table.grow(4);
|
|
@@ -856,4 +881,4 @@ async function __wbg_init(module_or_path) {
|
|
|
856
881
|
|
|
857
882
|
export { initSync };
|
|
858
883
|
export default __wbg_init;
|
|
859
|
-
export const WASM_SRI = "sha512-
|
|
884
|
+
export const WASM_SRI = "sha512-7w/e+kyxISej6Gt6cK/d939I2c82jl9nnydzcwjzuGtJbfA4Vvx3HQUf7dmmapRzvFXZxg5NrSU8tz4v7hBrhw==";
|
package/pkg/c2pa_bg.wasm
CHANGED
|
Binary file
|
package/pkg/c2pa_bg.wasm.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
|
20
20
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
21
21
|
export const __wbindgen_export_6: WebAssembly.Table;
|
|
22
22
|
export const __externref_table_dealloc: (a: number) => void;
|
|
23
|
-
export const
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
23
|
+
export const wasm_bindgen__convert__closures_____invoke__ha5b2289bd84e4451: (a: number, b: number) => void;
|
|
24
|
+
export const closure1451_externref_shim: (a: number, b: number, c: any) => void;
|
|
25
|
+
export const closure2451_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
26
26
|
export const __wbindgen_start: () => void;
|