@jumio/websdk 0.2.1 → 0.2.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/assets/fonts/jumio-sdk-icomoon.svg +3 -1
- package/assets/fonts/jumio-sdk-icomoon.ttf +0 -0
- package/assets/fonts/jumio-sdk-icomoon.woff +0 -0
- package/assets/style.css +11 -4
- package/assets_da_1_2_2.tar-DLMc-Zr7.js +5 -0
- package/dac-CX1lWyJ4.js +5 -0
- package/dac_simd-DrhDxU1t.js +5 -0
- package/index.js +41754 -42449
- package/package.json +1 -1
- package/third-party-licenses.txt +61 -62
- package/assets/da_object-Dmvt-Ksj.js +0 -2
- package/assets/da_system_worker-ZGTOZ8Bz.js +0 -2
- package/assets_da_1_2_1.tar-CezVOOjH.js +0 -5
- package/dac-CokYN9l5.js +0 -5
- package/dac-GA_h4b2-.js +0 -5
- package/dac_simd-6C-KoVW4.js +0 -5
- package/dac_simd-DMVKk3l2.js +0 -5
package/package.json
CHANGED
package/third-party-licenses.txt
CHANGED
|
@@ -3,7 +3,7 @@ https://www.npmjs.com/package/generate-license-file
|
|
|
3
3
|
|
|
4
4
|
The following npm package may be included in this product:
|
|
5
5
|
|
|
6
|
-
- wasm-feature-detect@1.6.
|
|
6
|
+
- wasm-feature-detect@1.6.2
|
|
7
7
|
|
|
8
8
|
This package contains the following license and notice below:
|
|
9
9
|
|
|
@@ -213,9 +213,9 @@ Apache License
|
|
|
213
213
|
|
|
214
214
|
The following npm packages may be included in this product:
|
|
215
215
|
|
|
216
|
-
- @datadog/browser-core@5.
|
|
217
|
-
- @datadog/browser-rum-core@5.
|
|
218
|
-
- @datadog/browser-rum@5.
|
|
216
|
+
- @datadog/browser-core@5.22.0
|
|
217
|
+
- @datadog/browser-rum-core@5.22.0
|
|
218
|
+
- @datadog/browser-rum@5.22.0
|
|
219
219
|
|
|
220
220
|
These packages each contain the following license and notice below:
|
|
221
221
|
|
|
@@ -699,7 +699,7 @@ SOFTWARE.
|
|
|
699
699
|
|
|
700
700
|
The following npm package may be included in this product:
|
|
701
701
|
|
|
702
|
-
- commander@12.
|
|
702
|
+
- commander@12.1.0
|
|
703
703
|
|
|
704
704
|
This package contains the following license and notice below:
|
|
705
705
|
|
|
@@ -947,7 +947,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
947
947
|
|
|
948
948
|
The following npm packages may be included in this product:
|
|
949
949
|
|
|
950
|
-
- unified@11.0.
|
|
950
|
+
- unified@11.0.5
|
|
951
951
|
- vfile@6.0.1
|
|
952
952
|
|
|
953
953
|
These packages each contain the following license and notice below:
|
|
@@ -1112,11 +1112,11 @@ The following npm packages may be included in this product:
|
|
|
1112
1112
|
- mdast-util-gfm-task-list-item@2.0.0
|
|
1113
1113
|
- mdast-util-gfm@3.0.0
|
|
1114
1114
|
- mdast-util-to-markdown@2.1.0
|
|
1115
|
-
- micromark-extension-gfm-autolink-literal@2.
|
|
1116
|
-
- micromark-extension-gfm-strikethrough@2.
|
|
1117
|
-
- micromark-extension-gfm-table@2.
|
|
1115
|
+
- micromark-extension-gfm-autolink-literal@2.1.0
|
|
1116
|
+
- micromark-extension-gfm-strikethrough@2.1.0
|
|
1117
|
+
- micromark-extension-gfm-table@2.1.0
|
|
1118
1118
|
- micromark-extension-gfm-tagfilter@2.0.0
|
|
1119
|
-
- micromark-extension-gfm-task-list-item@2.0
|
|
1119
|
+
- micromark-extension-gfm-task-list-item@2.1.0
|
|
1120
1120
|
- micromark-extension-gfm@3.0.0
|
|
1121
1121
|
- remark-gfm@4.0.0
|
|
1122
1122
|
|
|
@@ -1151,7 +1151,7 @@ The following npm packages may be included in this product:
|
|
|
1151
1151
|
|
|
1152
1152
|
- decode-named-character-reference@1.0.2
|
|
1153
1153
|
- mdast-util-gfm-footnote@2.0.0
|
|
1154
|
-
- micromark-extension-gfm-footnote@2.
|
|
1154
|
+
- micromark-extension-gfm-footnote@2.1.0
|
|
1155
1155
|
|
|
1156
1156
|
These packages each contain the following license and notice below:
|
|
1157
1157
|
|
|
@@ -1245,7 +1245,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
1245
1245
|
|
|
1246
1246
|
The following npm package may be included in this product:
|
|
1247
1247
|
|
|
1248
|
-
- ua-parser-js@2.0.0-beta.
|
|
1248
|
+
- ua-parser-js@2.0.0-beta.3
|
|
1249
1249
|
|
|
1250
1250
|
This package contains the following license and notice below:
|
|
1251
1251
|
|
|
@@ -2447,8 +2447,8 @@ END OF TERMS AND CONDITIONS
|
|
|
2447
2447
|
The following npm packages may be included in this product:
|
|
2448
2448
|
|
|
2449
2449
|
- @lit/reactive-element@2.0.4
|
|
2450
|
-
- lit-element@4.0.
|
|
2451
|
-
- lit@3.1.
|
|
2450
|
+
- lit-element@4.0.6
|
|
2451
|
+
- lit@3.1.4
|
|
2452
2452
|
|
|
2453
2453
|
These packages each contain the following license and notice below:
|
|
2454
2454
|
|
|
@@ -2485,7 +2485,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
2485
2485
|
|
|
2486
2486
|
The following npm package may be included in this product:
|
|
2487
2487
|
|
|
2488
|
-
- lit-html@3.1.
|
|
2488
|
+
- lit-html@3.1.4
|
|
2489
2489
|
|
|
2490
2490
|
This package contains the following license and notice below:
|
|
2491
2491
|
|
|
@@ -2559,7 +2559,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
2559
2559
|
|
|
2560
2560
|
The following npm package may be included in this product:
|
|
2561
2561
|
|
|
2562
|
-
- @lit/context@1.1.
|
|
2562
|
+
- @lit/context@1.1.2
|
|
2563
2563
|
|
|
2564
2564
|
This package contains the following license and notice below:
|
|
2565
2565
|
|
|
@@ -2851,12 +2851,11 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE
|
|
|
2851
2851
|
|
|
2852
2852
|
-----------
|
|
2853
2853
|
|
|
2854
|
-
The following npm
|
|
2854
|
+
The following npm package may be included in this product:
|
|
2855
2855
|
|
|
2856
|
-
- tslib@2.6.2
|
|
2857
2856
|
- tslib@2.6.3
|
|
2858
2857
|
|
|
2859
|
-
|
|
2858
|
+
This package contains the following license and notice below:
|
|
2860
2859
|
|
|
2861
2860
|
Copyright (c) Microsoft Corporation.
|
|
2862
2861
|
|
|
@@ -2927,7 +2926,7 @@ Maintainer: James C. (Jamie) Davis @davisjam
|
|
|
2927
2926
|
|
|
2928
2927
|
The following npm package may be included in this product:
|
|
2929
2928
|
|
|
2930
|
-
- enhanced-resolve@5.
|
|
2929
|
+
- enhanced-resolve@5.17.0
|
|
2931
2930
|
|
|
2932
2931
|
This package contains the following license and notice below:
|
|
2933
2932
|
|
|
@@ -3042,6 +3041,30 @@ terms above.
|
|
|
3042
3041
|
|
|
3043
3042
|
-----------
|
|
3044
3043
|
|
|
3044
|
+
The following npm package may be included in this product:
|
|
3045
|
+
|
|
3046
|
+
- picocolors@1.0.1
|
|
3047
|
+
|
|
3048
|
+
This package contains the following license and notice below:
|
|
3049
|
+
|
|
3050
|
+
ISC License
|
|
3051
|
+
|
|
3052
|
+
Copyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov
|
|
3053
|
+
|
|
3054
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
3055
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
3056
|
+
copyright notice and this permission notice appear in all copies.
|
|
3057
|
+
|
|
3058
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
3059
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
3060
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
3061
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
3062
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
3063
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
3064
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
3065
|
+
|
|
3066
|
+
-----------
|
|
3067
|
+
|
|
3045
3068
|
The following npm package may be included in this product:
|
|
3046
3069
|
|
|
3047
3070
|
- get-caller-file@2.0.5
|
|
@@ -3155,7 +3178,7 @@ SOFTWARE.
|
|
|
3155
3178
|
The following npm packages may be included in this product:
|
|
3156
3179
|
|
|
3157
3180
|
- acorn-loose@8.4.0
|
|
3158
|
-
- acorn-walk@8.3.
|
|
3181
|
+
- acorn-walk@8.3.3
|
|
3159
3182
|
|
|
3160
3183
|
These packages each contain the following license and notice below:
|
|
3161
3184
|
|
|
@@ -3185,7 +3208,7 @@ THE SOFTWARE.
|
|
|
3185
3208
|
|
|
3186
3209
|
The following npm package may be included in this product:
|
|
3187
3210
|
|
|
3188
|
-
- acorn@8.
|
|
3211
|
+
- acorn@8.12.1
|
|
3189
3212
|
|
|
3190
3213
|
This package contains the following license and notice below:
|
|
3191
3214
|
|
|
@@ -3431,19 +3454,15 @@ The following npm packages may be included in this product:
|
|
|
3431
3454
|
|
|
3432
3455
|
- ansi-regex@6.0.1
|
|
3433
3456
|
- ansi-styles@6.2.1
|
|
3434
|
-
- chalk@5.3.0
|
|
3435
3457
|
- escape-string-regexp@5.0.0
|
|
3436
|
-
- figures@6.1.0
|
|
3437
3458
|
- get-east-asian-width@1.2.0
|
|
3438
3459
|
- global-directory@4.0.1
|
|
3439
|
-
- indent-string@5.0.0
|
|
3440
3460
|
- is-installed-globally@1.0.0
|
|
3441
3461
|
- is-path-inside@4.0.0
|
|
3442
3462
|
- is-plain-obj@4.1.0
|
|
3443
|
-
- is-unicode-supported@2.0.0
|
|
3444
3463
|
- memoize@10.0.0
|
|
3445
3464
|
- mimic-function@5.0.1
|
|
3446
|
-
- string-width@7.
|
|
3465
|
+
- string-width@7.2.0
|
|
3447
3466
|
- strip-ansi@7.1.0
|
|
3448
3467
|
- wrap-ansi@9.0.0
|
|
3449
3468
|
|
|
@@ -3609,7 +3628,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
3609
3628
|
|
|
3610
3629
|
The following npm package may be included in this product:
|
|
3611
3630
|
|
|
3612
|
-
- minimatch@9.0.
|
|
3631
|
+
- minimatch@9.0.5
|
|
3613
3632
|
|
|
3614
3633
|
This package contains the following license and notice below:
|
|
3615
3634
|
|
|
@@ -3769,7 +3788,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
3769
3788
|
|
|
3770
3789
|
The following npm package may be included in this product:
|
|
3771
3790
|
|
|
3772
|
-
- is-core-module@2.
|
|
3791
|
+
- is-core-module@2.14.0
|
|
3773
3792
|
|
|
3774
3793
|
This package contains the following license and notice below:
|
|
3775
3794
|
|
|
@@ -3979,7 +3998,7 @@ SOFTWARE.
|
|
|
3979
3998
|
|
|
3980
3999
|
The following npm package may be included in this product:
|
|
3981
4000
|
|
|
3982
|
-
- ajv@8.
|
|
4001
|
+
- ajv@8.16.0
|
|
3983
4002
|
|
|
3984
4003
|
This package contains the following license and notice below:
|
|
3985
4004
|
|
|
@@ -4070,7 +4089,7 @@ SOFTWARE.
|
|
|
4070
4089
|
|
|
4071
4090
|
The following npm package may be included in this product:
|
|
4072
4091
|
|
|
4073
|
-
- dependency-cruiser@16.3.
|
|
4092
|
+
- dependency-cruiser@16.3.6
|
|
4074
4093
|
|
|
4075
4094
|
This package contains the following license and notice below:
|
|
4076
4095
|
|
|
@@ -4128,36 +4147,6 @@ THE SOFTWARE.
|
|
|
4128
4147
|
|
|
4129
4148
|
-----------
|
|
4130
4149
|
|
|
4131
|
-
The following npm package may be included in this product:
|
|
4132
|
-
|
|
4133
|
-
- semver-try-require@7.0.0
|
|
4134
|
-
|
|
4135
|
-
This package contains the following license and notice below:
|
|
4136
|
-
|
|
4137
|
-
The MIT License (MIT)
|
|
4138
|
-
|
|
4139
|
-
Copyright (c) 2018-2024 Sander Verweij
|
|
4140
|
-
|
|
4141
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4142
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
4143
|
-
in the Software without restriction, including without limitation the rights
|
|
4144
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
4145
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
4146
|
-
furnished to do so, subject to the following conditions:
|
|
4147
|
-
|
|
4148
|
-
The above copyright notice and this permission notice shall be included in all
|
|
4149
|
-
copies or substantial portions of the Software.
|
|
4150
|
-
|
|
4151
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
4152
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
4153
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
4154
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
4155
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
4156
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
4157
|
-
SOFTWARE.
|
|
4158
|
-
|
|
4159
|
-
-----------
|
|
4160
|
-
|
|
4161
4150
|
The following npm package may be included in this product:
|
|
4162
4151
|
|
|
4163
4152
|
- acorn-jsx-walk@2.0.0
|
|
@@ -4190,7 +4179,7 @@ SOFTWARE.
|
|
|
4190
4179
|
|
|
4191
4180
|
The following npm package may be included in this product:
|
|
4192
4181
|
|
|
4193
|
-
- watskeburt@4.0
|
|
4182
|
+
- watskeburt@4.1.0
|
|
4194
4183
|
|
|
4195
4184
|
This package contains the following license and notice below:
|
|
4196
4185
|
|
|
@@ -4384,5 +4373,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
4384
4373
|
|
|
4385
4374
|
-----------
|
|
4386
4375
|
|
|
4376
|
+
The following npm package may be included in this product:
|
|
4377
|
+
|
|
4378
|
+
- @jumio/da-system@1.0.0
|
|
4379
|
+
|
|
4380
|
+
This package contains the following license and notice below:
|
|
4381
|
+
|
|
4382
|
+
UNLICENSED
|
|
4383
|
+
|
|
4384
|
+
-----------
|
|
4385
|
+
|
|
4387
4386
|
This file was generated with the generate-license-file npm package!
|
|
4388
4387
|
https://www.npmjs.com/package/generate-license-file
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";const A=":BYTES,",y=",",I="get_config",U="initialize",k="terminate";function T(n){return n instanceof ArrayBuffer||n instanceof ImageData}function x(n){if(n instanceof ImageData)return n.data.buffer;if(n&&typeof n=="object"&&"buffer"in n&&n.buffer instanceof ArrayBuffer)return n.buffer}function M(n){return Object.values(n).filter(T).map(x)}let d,_;async function O(n,t){const{wasm_module:e,wasm_js_url:r}=t;if(!(e&&r))throw"Worker has not initialized WASM. Events should contain WASM module and its Emscripten bootstrap";return await(await import(r)).default({instantiateWasm:function(c,a){const o=new WebAssembly.Instance(e,c);return a(o),o.exports}})}onmessage=async function(n){const{wasm_module:t,wasm_js_url:e,...r}=n.data;let s=r;_||(_=await O(e,n.data));const c=s.event;if(c===U){const o=s.object_name;o&&(d=o)}if(!d&&c!==I)return;const a=B(s);for(let o=0;o<a;o++){const i=D(o),f={};f.OBJECT_NAME=d,f.EVENT=i,postMessage(f,M(i))}_._clear_return_packets(),d===k&&(d=void 0)};function S(n){let t=1;return Object.keys(n).forEach(e=>{const r=e.length,s=n[e];if(t+=4+r+1+4,h(s)){const c=s.length;t+=c}else(s instanceof Uint8Array||s instanceof ImageData)&&(t+=9)}),t}function g(n,t,e){return t[e++]=n>>24&255,t[e++]=n>>16&255,t[e++]=n>>8&255,t[e++]=n&255,e}function v(n,t){let e=0,r=Object.keys(n).length;t[e++]=r&255,Object.keys(n).forEach(s=>{const c=s.length,a=n[s];e=g(c,t,e);for(let i=0;i<c;i++){const f=s.charCodeAt(i);t[e++]=f&255}let o=0;if(h(a)?(t[e++]=1,o=a.length):a instanceof Uint8Array||a instanceof ImageData?(t[e++]=2,o=9):t[e++]=0,e=g(o,t,e),h(a))for(let i=0;i<o;i++){let f=a.charCodeAt(i);t[e++]=f&255}else a instanceof Uint8Array?(e=g(1,t,e),e=g(a.length,t,e),t[e++]=1):a instanceof ImageData&&(e=g(a.height,t,e),e=g(a.width,t,e),t[e++]=4)})}function C(n){const t=S(n),e=new Uint8Array(t);return v(n,e),e}function E(n,t){let e=0;for(let r=0;r<4;r++)e=e*256+n[t+r];return e}function j(n){let t=0;const e=n[t];t++;const r={};let s=0;for(let c=0;c<e;c++){const a=E(n,t);t+=4;const o=new Uint8Array(a);for(let l=0;l<a;l++)o[l]=n[t+l];t+=a;const i=String.fromCharCode(...o),f=n[t++],u=E(n,t);if(t+=4,f===1){const l=new Uint8Array(u);for(let m=0;m<u;m++)l[m]=n[t+m];t+=u,r[i]=String.fromCharCode(...l)}else if(f===2)if(u!==9)t+=u;else{const l=E(n,t);t+=4;const m=E(n,t);t+=4;let p=0;p+=n[t++],s++,r[i]=":BYTES,"+l+","+m+","+p+","+s}}return r}function N(n){const t=[];let e=0;return t[e++]=C(n),Object.keys(n).forEach(r=>{const s=n[r];s instanceof Uint8Array?t[e++]=s:s instanceof ImageData&&(t[e++]=s.data)}),t}function B(n){const t=N(n),e=t.length,r=[],s=1+e*4,c=new Uint8Array(s);let a=0;c[a++]=e;for(let f=0;f<e;f++){const u=t[f].length,l=_._new_memory(u);_.HEAPU8.set(t[f],l),c[a++]=u>>24&255,c[a++]=u>>16&255,c[a++]=u>>8&255,c[a++]=u&255,r[f]=l}const o=_._new_memory(s);_.HEAPU8.set(c,o);let i=0;e===1?i=_._process_event_data(s,o,r[0],0):e===2&&(i=_._process_event_data(s,o,r[0],r[1])),_._free_memory(o);for(let f=0;f<e;f++)_._free_memory(r[f]);return i}function D(n){const t=_._get_return_n_packets(n);let e=_._get_return_packet_len(n,0),r=_._get_return_packet(n,0),s=new Uint8Array(_.HEAPU8.buffer,r,e);const c=j(s);return t===2&&Object.keys(c).forEach(a=>{const o=c[a];if(o.startsWith(A)){const i=o.split(y),f=parseInt(i[1]),u=parseInt(i[2]),l=parseInt(i[3]);if(e=_._get_return_packet_len(n,1),r=_._get_return_packet(n,1),f===1&&l===1){const m=new Uint8Array(_.HEAPU8.buffer,r,e);c[a]=w(m)}else{const m=new Uint8ClampedArray(_.HEAPU8.buffer,r,e),p=w(m);c[a]=new ImageData(p,u,f)}}}),c}function w(n){const t=n.constructor,e=new t(n.length);return e.set(n),e}const W="string";function h(n){return typeof n===W||n instanceof String}})();
|
|
2
|
-
//# sourceMappingURL=da_object-Dmvt-Ksj.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";const a=",",v="get_config",m="get_config_result",u="initialize",o="initialize_error",l="initialize_success",d="ready",f="assets",E="config_name",p="da_object_js_url",g="wasm_js_url",j="wasm_module",w="already_initialized";function b(n){return n instanceof ArrayBuffer||n instanceof ImageData}function y(n){if(n instanceof ImageData)return n.data.buffer;if(n&&typeof n=="object"&&"buffer"in n&&n.buffer instanceof ArrayBuffer)return n.buffer}function h(n){return Object.values(n).filter(b).map(y)}class T{constructor(){this.max_n_objects=1,this.clear()}onmessage(e){throw new Error("Not implemented")}onerror(e){throw e}terminate(){if(this.da_objects)for(let e=0;e<this.max_n_objects;e++)this.da_objects[e].worker.terminate();this.clear()}clear(){this.n_objects=0,this.n_successes=0,this.n_errors=0,this.output_events=[],this.s_asset_data=void 0,this.s_config_name=void 0,this.s_wasm_module=void 0,this.s_da_object_js_url=void 0,this.s_wasm_js_url=void 0,this.da_system=void 0,this.da_objects=void 0}initializeSystemWorker(){if(this.da_system)throw"System worker already initialized";this.da_system=new Worker(this.s_da_object_js_url,{type:"module"}),this.da_system.onmessage=e=>{this.process_system_message(e.data.EVENT)}}initializeNodeWorkers(){if(this.da_objects)throw"Node workers already initialized";this.da_objects=[];for(let e=0;e<this.max_n_objects;e++)this.da_objects[e]={worker:new Worker(this.s_da_object_js_url,{type:"module"}),name:"",req_events:[],is_ready:!0,queue:new I}}requireProperty(e,t){if(!e[t])throw`Expected property "${t}" not present in the object`}postAppMessage(e){this.onmessage({data:e})}postMessage(e,t=[]){const s=e,{event:r}=s;if(r===u){if(this.n_objects!==0){this.postAppMessage({event:o,reason:w});return}this.validateInitializeEvent(s),this.s_config_name=s.config_name,this.s_asset_data=s.assets,this.s_wasm_module=s.wasm_module,this.s_wasm_js_url=s.wasm_js_url,this.s_da_object_js_url=s.da_object_js_url,this.initializeSystemWorker(),this.initializeNodeWorkers(),this.da_system.postMessage({event:v,timestamp:Date.now().toString(),assets:this.s_asset_data,config_name:this.s_config_name,wasm_module:this.s_wasm_module,wasm_js_url:this.s_wasm_js_url},t)}else this.send_event(s)}process_system_message(e){const{event:t}=e;if(t===m){let s={event:u,timestamp:Date.now().toString(),assets:this.s_asset_data,config_name:this.s_config_name,wasm_module:this.s_wasm_module,wasm_js_url:this.s_wasm_js_url};const r=e.names.split(a);for(const i in r){this.da_objects[i].name=r[i],s.object_name=r[i];const _=this.da_objects[i].worker;_.onmessage=x=>{this.process_worker_event(x)},_.postMessage(s,h(s)),this.n_objects++}this.output_events=e.output_events.split(a)}}service_queue(e){if(!e.is_ready||e.queue.isEmpty)return;const t=e.queue.getEvent();t&&(e.worker.postMessage(t,h(t)),e.is_ready=!1)}send_event(e){const{event:t}=e;for(const s in this.output_events)if(t===this.output_events[s]){this.postAppMessage(e);break}for(let s=0;s<this.n_objects;s++){const r=this.da_objects[s].req_events;let i=!1;for(const _ in r)if(r[_]===t){i=!0;break}i&&(this.da_objects[s].queue.addEvent(e),this.service_queue(this.da_objects[s]))}}process_worker_event(e){const{OBJECT_NAME:t,EVENT:s}=e.data,{event:r}=s;if(!r)return;let i=null;for(let _=0;_<this.n_objects;_++)if(this.da_objects[_].name===t){i=this.da_objects[_];break}i&&(r===l?(this.n_successes++,s.event_names&&(i.req_events=s.event_names.split(a)),s.throttled_events&&i.queue.setThrottledEvents(s.throttled_events.split(a)),s.max_events&&i.queue.setMaxOldestEvents(parseInt(s.max_events)),this.n_successes+this.n_errors===this.n_objects&&(this.postAppMessage({event:this.n_errors?o:l,timestamp:s.timestamp}),this.n_successes=0,this.n_errors=0)):r===o&&(this.n_errors++,this.n_successes+this.n_errors===this.n_objects&&(this.postAppMessage({event:o,timestamp:s.timestamp}),this.n_successes=0,this.n_errors=0)),r===d?(s.max_events&&i.queue.setMaxOldestEvents(parseInt(s.max_events)),i.is_ready=!0,this.service_queue(i)):this.send_event(s))}validateInitializeEvent(e){this.requireProperty(e,E),this.requireProperty(e,f),this.requireProperty(e,j),this.requireProperty(e,g),this.requireProperty(e,p)}}class I{constructor(){this.events={},this.n_events=0,this.throttled_events=[],this.use_newest_event=!0,this.max_oldest_events=-1,this.num_extra_events=2}setMaxOldestEvents(e){this.use_newest_event=!1,this.max_oldest_events=e}setThrottledEvents(e){this.throttled_events=e}addEvent(e){if(this.isThrottledEvent(e)){const t=this.getNumThrottledEventsInt();if(this.max_oldest_events>=0){const s=this.max_oldest_events+this.num_extra_events;if(t>=s)return}if(this.use_newest_event){const s=this.num_extra_events+1;t>=s&&this.removeFirstThrottledEvent()}}this.events[this.n_events]=e,this.n_events++}getEvent(){if(!this.n_events)return null;const e=this.events[0];for(let t=1;t<this.n_events;t++)this.events[t-1]=this.events[t];return this.n_events--,delete this.events[this.n_events],this.use_newest_event||!this.isThrottledEvent(e)?e:this.max_oldest_events?(this.max_oldest_events>0&&this.max_oldest_events--,e):null}get length(){return this.n_events}get isEmpty(){return this.n_events===0}isThrottledEvent(e){const{event:t}=e;for(let s in this.throttled_events)if(this.throttled_events[s]===t)return!0;return!1}getNumThrottledEventsInt(){let e=0;for(let t=0;t<this.n_events;t++)this.isThrottledEvent(this.events[t])&&e++;return e}removeFirstThrottledEvent(){if(this.length===0)return;let e=-1;for(let t=0;t<this.n_events;t++)if(this.isThrottledEvent(this.events[t])){e=t;break}if(!(e<0)){for(let t=e+1;t<this.n_events;t++)this.events[t-1]=this.events[t];this.n_events--,delete this.events[this.n_events]}}}let c=new T;c.onmessage=function(n){postMessage(n.data,h(n.data))},onmessage=function(n){c.postMessage(n.data)}})();
|
|
2
|
-
//# sourceMappingURL=da_system_worker-ZGTOZ8Bz.js.map
|