open-l2encdec 0.0.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/LICENSE +637 -0
- package/README.md +173 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +53 -0
- package/dist/index.js.map +1 -0
- package/dist/interface.d.ts +66 -0
- package/dist/l2encdec.js +2 -0
- package/dist/l2encdec.wasm +0 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,637 @@
|
|
|
1
|
+
open-l2encdec
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2024 ritsuwastaken
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
|
24
|
+
|
|
25
|
+
===============================================
|
|
26
|
+
|
|
27
|
+
MbedTLS
|
|
28
|
+
|
|
29
|
+
Mbed TLS files are provided under a dual [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html)
|
|
30
|
+
OR [GPL-2.0-or-later](https://spdx.org/licenses/GPL-2.0-or-later.html) license.
|
|
31
|
+
This means that users may choose which of these licenses they take the code
|
|
32
|
+
under.
|
|
33
|
+
|
|
34
|
+
The full text of each of these licenses is given below.
|
|
35
|
+
|
|
36
|
+
Apache License
|
|
37
|
+
Version 2.0, January 2004
|
|
38
|
+
http://www.apache.org/licenses/
|
|
39
|
+
|
|
40
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
41
|
+
|
|
42
|
+
1. Definitions.
|
|
43
|
+
|
|
44
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
45
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
46
|
+
|
|
47
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
48
|
+
the copyright owner that is granting the License.
|
|
49
|
+
|
|
50
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
51
|
+
other entities that control, are controlled by, or are under common
|
|
52
|
+
control with that entity. For the purposes of this definition,
|
|
53
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
54
|
+
direction or management of such entity, whether by contract or
|
|
55
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
56
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
57
|
+
|
|
58
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
59
|
+
exercising permissions granted by this License.
|
|
60
|
+
|
|
61
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
62
|
+
including but not limited to software source code, documentation
|
|
63
|
+
source, and configuration files.
|
|
64
|
+
|
|
65
|
+
"Object" form shall mean any form resulting from mechanical
|
|
66
|
+
transformation or translation of a Source form, including but
|
|
67
|
+
not limited to compiled object code, generated documentation,
|
|
68
|
+
and conversions to other media types.
|
|
69
|
+
|
|
70
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
71
|
+
Object form, made available under the License, as indicated by a
|
|
72
|
+
copyright notice that is included in or attached to the work
|
|
73
|
+
(an example is provided in the Appendix below).
|
|
74
|
+
|
|
75
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
76
|
+
form, that is based on (or derived from) the Work and for which the
|
|
77
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
78
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
79
|
+
of this License, Derivative Works shall not include works that remain
|
|
80
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
81
|
+
the Work and Derivative Works thereof.
|
|
82
|
+
|
|
83
|
+
"Contribution" shall mean any work of authorship, including
|
|
84
|
+
the original version of the Work and any modifications or additions
|
|
85
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
86
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
87
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
88
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
89
|
+
means any form of electronic, verbal, or written communication sent
|
|
90
|
+
to the Licensor or its representatives, including but not limited to
|
|
91
|
+
communication on electronic mailing lists, source code control systems,
|
|
92
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
93
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
94
|
+
excluding communication that is conspicuously marked or otherwise
|
|
95
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
96
|
+
|
|
97
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
98
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
99
|
+
subsequently incorporated within the Work.
|
|
100
|
+
|
|
101
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
102
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
103
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
104
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
105
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
106
|
+
Work and such Derivative Works in Source or Object form.
|
|
107
|
+
|
|
108
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
109
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
110
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
111
|
+
(except as stated in this section) patent license to make, have made,
|
|
112
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
113
|
+
where such license applies only to those patent claims licensable
|
|
114
|
+
by such Contributor that are necessarily infringed by their
|
|
115
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
116
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
117
|
+
institute patent litigation against any entity (including a
|
|
118
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
119
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
120
|
+
or contributory patent infringement, then any patent licenses
|
|
121
|
+
granted to You under this License for that Work shall terminate
|
|
122
|
+
as of the date such litigation is filed.
|
|
123
|
+
|
|
124
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
125
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
126
|
+
modifications, and in Source or Object form, provided that You
|
|
127
|
+
meet the following conditions:
|
|
128
|
+
|
|
129
|
+
(a) You must give any other recipients of the Work or
|
|
130
|
+
Derivative Works a copy of this License; and
|
|
131
|
+
|
|
132
|
+
(b) You must cause any modified files to carry prominent notices
|
|
133
|
+
stating that You changed the files; and
|
|
134
|
+
|
|
135
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
136
|
+
that You distribute, all copyright, patent, trademark, and
|
|
137
|
+
attribution notices from the Source form of the Work,
|
|
138
|
+
excluding those notices that do not pertain to any part of
|
|
139
|
+
the Derivative Works; and
|
|
140
|
+
|
|
141
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
142
|
+
distribution, then any Derivative Works that You distribute must
|
|
143
|
+
include a readable copy of the attribution notices contained
|
|
144
|
+
within such NOTICE file, excluding those notices that do not
|
|
145
|
+
pertain to any part of the Derivative Works, in at least one
|
|
146
|
+
of the following places: within a NOTICE text file distributed
|
|
147
|
+
as part of the Derivative Works; within the Source form or
|
|
148
|
+
documentation, if provided along with the Derivative Works; or,
|
|
149
|
+
within a display generated by the Derivative Works, if and
|
|
150
|
+
wherever such third-party notices normally appear. The contents
|
|
151
|
+
of the NOTICE file are for informational purposes only and
|
|
152
|
+
do not modify the License. You may add Your own attribution
|
|
153
|
+
notices within Derivative Works that You distribute, alongside
|
|
154
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
155
|
+
that such additional attribution notices cannot be construed
|
|
156
|
+
as modifying the License.
|
|
157
|
+
|
|
158
|
+
You may add Your own copyright statement to Your modifications and
|
|
159
|
+
may provide additional or different license terms and conditions
|
|
160
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
161
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
162
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
163
|
+
the conditions stated in this License.
|
|
164
|
+
|
|
165
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
166
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
167
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
168
|
+
this License, without any additional terms or conditions.
|
|
169
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
170
|
+
the terms of any separate license agreement you may have executed
|
|
171
|
+
with Licensor regarding such Contributions.
|
|
172
|
+
|
|
173
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
174
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
175
|
+
except as required for reasonable and customary use in describing the
|
|
176
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
177
|
+
|
|
178
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
179
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
180
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
181
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
182
|
+
implied, including, without limitation, any warranties or conditions
|
|
183
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
184
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
185
|
+
appropriateness of using or redistributing the Work and assume any
|
|
186
|
+
risks associated with Your exercise of permissions under this License.
|
|
187
|
+
|
|
188
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
189
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
190
|
+
unless required by applicable law (such as deliberate and grossly
|
|
191
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
192
|
+
liable to You for damages, including any direct, indirect, special,
|
|
193
|
+
incidental, or consequential damages of any character arising as a
|
|
194
|
+
result of this License or out of the use or inability to use the
|
|
195
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
196
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
197
|
+
other commercial damages or losses), even if such Contributor
|
|
198
|
+
has been advised of the possibility of such damages.
|
|
199
|
+
|
|
200
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
201
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
202
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
203
|
+
or other liability obligations and/or rights consistent with this
|
|
204
|
+
License. However, in accepting such obligations, You may act only
|
|
205
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
206
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
207
|
+
defend, and hold each Contributor harmless for any liability
|
|
208
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
209
|
+
of your accepting any such warranty or additional liability.
|
|
210
|
+
|
|
211
|
+
END OF TERMS AND CONDITIONS
|
|
212
|
+
|
|
213
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
214
|
+
|
|
215
|
+
To apply the Apache License to your work, attach the following
|
|
216
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
217
|
+
replaced with your own identifying information. (Don't include
|
|
218
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
219
|
+
comment syntax for the file format. We also recommend that a
|
|
220
|
+
file or class name and description of purpose be included on the
|
|
221
|
+
same "printed page" as the copyright notice for easier
|
|
222
|
+
identification within third-party archives.
|
|
223
|
+
|
|
224
|
+
Copyright [yyyy] [name of copyright owner]
|
|
225
|
+
|
|
226
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
227
|
+
you may not use this file except in compliance with the License.
|
|
228
|
+
You may obtain a copy of the License at
|
|
229
|
+
|
|
230
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
231
|
+
|
|
232
|
+
Unless required by applicable law or agreed to in writing, software
|
|
233
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
234
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
235
|
+
See the License for the specific language governing permissions and
|
|
236
|
+
limitations under the License.
|
|
237
|
+
|
|
238
|
+
===============================================================================
|
|
239
|
+
|
|
240
|
+
GNU GENERAL PUBLIC LICENSE
|
|
241
|
+
Version 2, June 1991
|
|
242
|
+
|
|
243
|
+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
|
244
|
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
245
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
246
|
+
of this license document, but changing it is not allowed.
|
|
247
|
+
|
|
248
|
+
Preamble
|
|
249
|
+
|
|
250
|
+
The licenses for most software are designed to take away your
|
|
251
|
+
freedom to share and change it. By contrast, the GNU General Public
|
|
252
|
+
License is intended to guarantee your freedom to share and change free
|
|
253
|
+
software--to make sure the software is free for all its users. This
|
|
254
|
+
General Public License applies to most of the Free Software
|
|
255
|
+
Foundation's software and to any other program whose authors commit to
|
|
256
|
+
using it. (Some other Free Software Foundation software is covered by
|
|
257
|
+
the GNU Lesser General Public License instead.) You can apply it to
|
|
258
|
+
your programs, too.
|
|
259
|
+
|
|
260
|
+
When we speak of free software, we are referring to freedom, not
|
|
261
|
+
price. Our General Public Licenses are designed to make sure that you
|
|
262
|
+
have the freedom to distribute copies of free software (and charge for
|
|
263
|
+
this service if you wish), that you receive source code or can get it
|
|
264
|
+
if you want it, that you can change the software or use pieces of it
|
|
265
|
+
in new free programs; and that you know you can do these things.
|
|
266
|
+
|
|
267
|
+
To protect your rights, we need to make restrictions that forbid
|
|
268
|
+
anyone to deny you these rights or to ask you to surrender the rights.
|
|
269
|
+
These restrictions translate to certain responsibilities for you if you
|
|
270
|
+
distribute copies of the software, or if you modify it.
|
|
271
|
+
|
|
272
|
+
For example, if you distribute copies of such a program, whether
|
|
273
|
+
gratis or for a fee, you must give the recipients all the rights that
|
|
274
|
+
you have. You must make sure that they, too, receive or can get the
|
|
275
|
+
source code. And you must show them these terms so they know their
|
|
276
|
+
rights.
|
|
277
|
+
|
|
278
|
+
We protect your rights with two steps: (1) copyright the software, and
|
|
279
|
+
(2) offer you this license which gives you legal permission to copy,
|
|
280
|
+
distribute and/or modify the software.
|
|
281
|
+
|
|
282
|
+
Also, for each author's protection and ours, we want to make certain
|
|
283
|
+
that everyone understands that there is no warranty for this free
|
|
284
|
+
software. If the software is modified by someone else and passed on, we
|
|
285
|
+
want its recipients to know that what they have is not the original, so
|
|
286
|
+
that any problems introduced by others will not reflect on the original
|
|
287
|
+
authors' reputations.
|
|
288
|
+
|
|
289
|
+
Finally, any free program is threatened constantly by software
|
|
290
|
+
patents. We wish to avoid the danger that redistributors of a free
|
|
291
|
+
program will individually obtain patent licenses, in effect making the
|
|
292
|
+
program proprietary. To prevent this, we have made it clear that any
|
|
293
|
+
patent must be licensed for everyone's free use or not licensed at all.
|
|
294
|
+
|
|
295
|
+
The precise terms and conditions for copying, distribution and
|
|
296
|
+
modification follow.
|
|
297
|
+
|
|
298
|
+
GNU GENERAL PUBLIC LICENSE
|
|
299
|
+
|
|
300
|
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
301
|
+
|
|
302
|
+
0. This License applies to any program or other work which contains
|
|
303
|
+
a notice placed by the copyright holder saying it may be distributed
|
|
304
|
+
under the terms of this General Public License. The "Program", below,
|
|
305
|
+
refers to any such program or work, and a "work based on the Program"
|
|
306
|
+
means either the Program or any derivative work under copyright law:
|
|
307
|
+
that is to say, a work containing the Program or a portion of it,
|
|
308
|
+
either verbatim or with modifications and/or translated into another
|
|
309
|
+
language. (Hereinafter, translation is included without limitation in
|
|
310
|
+
the term "modification".) Each licensee is addressed as "you".
|
|
311
|
+
|
|
312
|
+
Activities other than copying, distribution and modification are not
|
|
313
|
+
covered by this License; they are outside its scope. The act of
|
|
314
|
+
running the Program is not restricted, and the output from the Program
|
|
315
|
+
is covered only if its contents constitute a work based on the
|
|
316
|
+
Program (independent of having been made by running the Program).
|
|
317
|
+
Whether that is true depends on what the Program does.
|
|
318
|
+
|
|
319
|
+
1. You may copy and distribute verbatim copies of the Program's
|
|
320
|
+
source code as you receive it, in any medium, provided that you
|
|
321
|
+
conspicuously and appropriately publish on each copy an appropriate
|
|
322
|
+
copyright notice and disclaimer of warranty; keep intact all the
|
|
323
|
+
notices that refer to this License and to the absence of any warranty;
|
|
324
|
+
and give any other recipients of the Program a copy of this License
|
|
325
|
+
along with the Program.
|
|
326
|
+
|
|
327
|
+
You may charge a fee for the physical act of transferring a copy, and
|
|
328
|
+
you may at your option offer warranty protection in exchange for a fee.
|
|
329
|
+
|
|
330
|
+
2. You may modify your copy or copies of the Program or any portion
|
|
331
|
+
of it, thus forming a work based on the Program, and copy and
|
|
332
|
+
distribute such modifications or work under the terms of Section 1
|
|
333
|
+
above, provided that you also meet all of these conditions:
|
|
334
|
+
|
|
335
|
+
a) You must cause the modified files to carry prominent notices
|
|
336
|
+
stating that you changed the files and the date of any change.
|
|
337
|
+
|
|
338
|
+
b) You must cause any work that you distribute or publish, that in
|
|
339
|
+
whole or in part contains or is derived from the Program or any
|
|
340
|
+
part thereof, to be licensed as a whole at no charge to all third
|
|
341
|
+
parties under the terms of this License.
|
|
342
|
+
|
|
343
|
+
c) If the modified program normally reads commands interactively
|
|
344
|
+
when run, you must cause it, when started running for such
|
|
345
|
+
interactive use in the most ordinary way, to print or display an
|
|
346
|
+
announcement including an appropriate copyright notice and a
|
|
347
|
+
notice that there is no warranty (or else, saying that you provide
|
|
348
|
+
a warranty) and that users may redistribute the program under
|
|
349
|
+
these conditions, and telling the user how to view a copy of this
|
|
350
|
+
License. (Exception: if the Program itself is interactive but
|
|
351
|
+
does not normally print such an announcement, your work based on
|
|
352
|
+
the Program is not required to print an announcement.)
|
|
353
|
+
|
|
354
|
+
These requirements apply to the modified work as a whole. If
|
|
355
|
+
identifiable sections of that work are not derived from the Program,
|
|
356
|
+
and can be reasonably considered independent and separate works in
|
|
357
|
+
themselves, then this License, and its terms, do not apply to those
|
|
358
|
+
sections when you distribute them as separate works. But when you
|
|
359
|
+
distribute the same sections as part of a whole which is a work based
|
|
360
|
+
on the Program, the distribution of the whole must be on the terms of
|
|
361
|
+
this License, whose permissions for other licensees extend to the
|
|
362
|
+
entire whole, and thus to each and every part regardless of who wrote it.
|
|
363
|
+
|
|
364
|
+
Thus, it is not the intent of this section to claim rights or contest
|
|
365
|
+
your rights to work written entirely by you; rather, the intent is to
|
|
366
|
+
exercise the right to control the distribution of derivative or
|
|
367
|
+
collective works based on the Program.
|
|
368
|
+
|
|
369
|
+
In addition, mere aggregation of another work not based on the Program
|
|
370
|
+
with the Program (or with a work based on the Program) on a volume of
|
|
371
|
+
a storage or distribution medium does not bring the other work under
|
|
372
|
+
the scope of this License.
|
|
373
|
+
|
|
374
|
+
3. You may copy and distribute the Program (or a work based on it,
|
|
375
|
+
under Section 2) in object code or executable form under the terms of
|
|
376
|
+
Sections 1 and 2 above provided that you also do one of the following:
|
|
377
|
+
|
|
378
|
+
a) Accompany it with the complete corresponding machine-readable
|
|
379
|
+
source code, which must be distributed under the terms of Sections
|
|
380
|
+
1 and 2 above on a medium customarily used for software interchange; or,
|
|
381
|
+
|
|
382
|
+
b) Accompany it with a written offer, valid for at least three
|
|
383
|
+
years, to give any third party, for a charge no more than your
|
|
384
|
+
cost of physically performing source distribution, a complete
|
|
385
|
+
machine-readable copy of the corresponding source code, to be
|
|
386
|
+
distributed under the terms of Sections 1 and 2 above on a medium
|
|
387
|
+
customarily used for software interchange; or,
|
|
388
|
+
|
|
389
|
+
c) Accompany it with the information you received as to the offer
|
|
390
|
+
to distribute corresponding source code. (This alternative is
|
|
391
|
+
allowed only for noncommercial distribution and only if you
|
|
392
|
+
received the program in object code or executable form with such
|
|
393
|
+
an offer, in accord with Subsection b above.)
|
|
394
|
+
|
|
395
|
+
The source code for a work means the preferred form of the work for
|
|
396
|
+
making modifications to it. For an executable work, complete source
|
|
397
|
+
code means all the source code for all modules it contains, plus any
|
|
398
|
+
associated interface definition files, plus the scripts used to
|
|
399
|
+
control compilation and installation of the executable. However, as a
|
|
400
|
+
special exception, the source code distributed need not include
|
|
401
|
+
anything that is normally distributed (in either source or binary
|
|
402
|
+
form) with the major components (compiler, kernel, and so on) of the
|
|
403
|
+
operating system on which the executable runs, unless that component
|
|
404
|
+
itself accompanies the executable.
|
|
405
|
+
|
|
406
|
+
If distribution of executable or object code is made by offering
|
|
407
|
+
access to copy from a designated place, then offering equivalent
|
|
408
|
+
access to copy the source code from the same place counts as
|
|
409
|
+
distribution of the source code, even though third parties are not
|
|
410
|
+
compelled to copy the source along with the object code.
|
|
411
|
+
|
|
412
|
+
4. You may not copy, modify, sublicense, or distribute the Program
|
|
413
|
+
except as expressly provided under this License. Any attempt
|
|
414
|
+
otherwise to copy, modify, sublicense or distribute the Program is
|
|
415
|
+
void, and will automatically terminate your rights under this License.
|
|
416
|
+
However, parties who have received copies, or rights, from you under
|
|
417
|
+
this License will not have their licenses terminated so long as such
|
|
418
|
+
parties remain in full compliance.
|
|
419
|
+
|
|
420
|
+
5. You are not required to accept this License, since you have not
|
|
421
|
+
signed it. However, nothing else grants you permission to modify or
|
|
422
|
+
distribute the Program or its derivative works. These actions are
|
|
423
|
+
prohibited by law if you do not accept this License. Therefore, by
|
|
424
|
+
modifying or distributing the Program (or any work based on the
|
|
425
|
+
Program), you indicate your acceptance of this License to do so, and
|
|
426
|
+
all its terms and conditions for copying, distributing or modifying
|
|
427
|
+
the Program or works based on it.
|
|
428
|
+
|
|
429
|
+
6. Each time you redistribute the Program (or any work based on the
|
|
430
|
+
Program), the recipient automatically receives a license from the
|
|
431
|
+
original licensor to copy, distribute or modify the Program subject to
|
|
432
|
+
these terms and conditions. You may not impose any further
|
|
433
|
+
restrictions on the recipients' exercise of the rights granted herein.
|
|
434
|
+
You are not responsible for enforcing compliance by third parties to
|
|
435
|
+
this License.
|
|
436
|
+
|
|
437
|
+
7. If, as a consequence of a court judgment or allegation of patent
|
|
438
|
+
infringement or for any other reason (not limited to patent issues),
|
|
439
|
+
conditions are imposed on you (whether by court order, agreement or
|
|
440
|
+
otherwise) that contradict the conditions of this License, they do not
|
|
441
|
+
excuse you from the conditions of this License. If you cannot
|
|
442
|
+
distribute so as to satisfy simultaneously your obligations under this
|
|
443
|
+
License and any other pertinent obligations, then as a consequence you
|
|
444
|
+
may not distribute the Program at all. For example, if a patent
|
|
445
|
+
license would not permit royalty-free redistribution of the Program by
|
|
446
|
+
all those who receive copies directly or indirectly through you, then
|
|
447
|
+
the only way you could satisfy both it and this License would be to
|
|
448
|
+
refrain entirely from distribution of the Program.
|
|
449
|
+
|
|
450
|
+
If any portion of this section is held invalid or unenforceable under
|
|
451
|
+
any particular circumstance, the balance of the section is intended to
|
|
452
|
+
apply and the section as a whole is intended to apply in other
|
|
453
|
+
circumstances.
|
|
454
|
+
|
|
455
|
+
It is not the purpose of this section to induce you to infringe any
|
|
456
|
+
patents or other property right claims or to contest validity of any
|
|
457
|
+
such claims; this section has the sole purpose of protecting the
|
|
458
|
+
integrity of the free software distribution system, which is
|
|
459
|
+
implemented by public license practices. Many people have made
|
|
460
|
+
generous contributions to the wide range of software distributed
|
|
461
|
+
through that system in reliance on consistent application of that
|
|
462
|
+
system; it is up to the author/donor to decide if he or she is willing
|
|
463
|
+
to distribute software through any other system and a licensee cannot
|
|
464
|
+
impose that choice.
|
|
465
|
+
|
|
466
|
+
This section is intended to make thoroughly clear what is believed to
|
|
467
|
+
be a consequence of the rest of this License.
|
|
468
|
+
|
|
469
|
+
8. If the distribution and/or use of the Program is restricted in
|
|
470
|
+
certain countries either by patents or by copyrighted interfaces, the
|
|
471
|
+
original copyright holder who places the Program under this License
|
|
472
|
+
may add an explicit geographical distribution limitation excluding
|
|
473
|
+
those countries, so that distribution is permitted only in or among
|
|
474
|
+
countries not thus excluded. In such case, this License incorporates
|
|
475
|
+
the limitation as if written in the body of this License.
|
|
476
|
+
|
|
477
|
+
9. The Free Software Foundation may publish revised and/or new versions
|
|
478
|
+
of the General Public License from time to time. Such new versions will
|
|
479
|
+
be similar in spirit to the present version, but may differ in detail to
|
|
480
|
+
address new problems or concerns.
|
|
481
|
+
|
|
482
|
+
Each version is given a distinguishing version number. If the Program
|
|
483
|
+
specifies a version number of this License which applies to it and "any
|
|
484
|
+
later version", you have the option of following the terms and conditions
|
|
485
|
+
either of that version or of any later version published by the Free
|
|
486
|
+
Software Foundation. If the Program does not specify a version number of
|
|
487
|
+
this License, you may choose any version ever published by the Free Software
|
|
488
|
+
Foundation.
|
|
489
|
+
|
|
490
|
+
10. If you wish to incorporate parts of the Program into other free
|
|
491
|
+
programs whose distribution conditions are different, write to the author
|
|
492
|
+
to ask for permission. For software which is copyrighted by the Free
|
|
493
|
+
Software Foundation, write to the Free Software Foundation; we sometimes
|
|
494
|
+
make exceptions for this. Our decision will be guided by the two goals
|
|
495
|
+
of preserving the free status of all derivatives of our free software and
|
|
496
|
+
of promoting the sharing and reuse of software generally.
|
|
497
|
+
|
|
498
|
+
NO WARRANTY
|
|
499
|
+
|
|
500
|
+
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
|
501
|
+
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
|
502
|
+
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
|
503
|
+
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
|
504
|
+
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
505
|
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
|
506
|
+
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
|
507
|
+
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
|
508
|
+
REPAIR OR CORRECTION.
|
|
509
|
+
|
|
510
|
+
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
511
|
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
|
512
|
+
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
|
513
|
+
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
|
514
|
+
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
|
515
|
+
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
|
516
|
+
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
|
517
|
+
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
|
518
|
+
POSSIBILITY OF SUCH DAMAGES.
|
|
519
|
+
|
|
520
|
+
END OF TERMS AND CONDITIONS
|
|
521
|
+
|
|
522
|
+
How to Apply These Terms to Your New Programs
|
|
523
|
+
|
|
524
|
+
If you develop a new program, and you want it to be of the greatest
|
|
525
|
+
possible use to the public, the best way to achieve this is to make it
|
|
526
|
+
free software which everyone can redistribute and change under these terms.
|
|
527
|
+
|
|
528
|
+
To do so, attach the following notices to the program. It is safest
|
|
529
|
+
to attach them to the start of each source file to most effectively
|
|
530
|
+
convey the exclusion of warranty; and each file should have at least
|
|
531
|
+
the "copyright" line and a pointer to where the full notice is found.
|
|
532
|
+
|
|
533
|
+
<one line to give the program's name and a brief idea of what it does.>
|
|
534
|
+
Copyright (C) <year> <name of author>
|
|
535
|
+
|
|
536
|
+
This program is free software; you can redistribute it and/or modify
|
|
537
|
+
it under the terms of the GNU General Public License as published by
|
|
538
|
+
the Free Software Foundation; either version 2 of the License, or
|
|
539
|
+
(at your option) any later version.
|
|
540
|
+
|
|
541
|
+
This program is distributed in the hope that it will be useful,
|
|
542
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
543
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
544
|
+
GNU General Public License for more details.
|
|
545
|
+
|
|
546
|
+
You should have received a copy of the GNU General Public License along
|
|
547
|
+
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
548
|
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
549
|
+
|
|
550
|
+
Also add information on how to contact you by electronic and paper mail.
|
|
551
|
+
|
|
552
|
+
If the program is interactive, make it output a short notice like this
|
|
553
|
+
when it starts in an interactive mode:
|
|
554
|
+
|
|
555
|
+
Gnomovision version 69, Copyright (C) year name of author
|
|
556
|
+
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
557
|
+
This is free software, and you are welcome to redistribute it
|
|
558
|
+
under certain conditions; type `show c' for details.
|
|
559
|
+
|
|
560
|
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
561
|
+
parts of the General Public License. Of course, the commands you use may
|
|
562
|
+
be called something other than `show w' and `show c'; they could even be
|
|
563
|
+
mouse-clicks or menu items--whatever suits your program.
|
|
564
|
+
|
|
565
|
+
You should also get your employer (if you work as a programmer) or your
|
|
566
|
+
school, if any, to sign a "copyright disclaimer" for the program, if
|
|
567
|
+
necessary. Here is a sample; alter the names:
|
|
568
|
+
|
|
569
|
+
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
|
570
|
+
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
|
571
|
+
|
|
572
|
+
<signature of Ty Coon>, 1 April 1989
|
|
573
|
+
Ty Coon, President of Vice
|
|
574
|
+
|
|
575
|
+
This General Public License does not permit incorporating your program into
|
|
576
|
+
proprietary programs. If your program is a subroutine library, you may
|
|
577
|
+
consider it more useful to permit linking proprietary applications with the
|
|
578
|
+
library. If this is what you want to do, use the GNU Lesser General
|
|
579
|
+
Public License instead of this License.
|
|
580
|
+
|
|
581
|
+
===============================================
|
|
582
|
+
|
|
583
|
+
miniz
|
|
584
|
+
|
|
585
|
+
Copyright 2013-2014 RAD Game Tools and Valve Software
|
|
586
|
+
Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC
|
|
587
|
+
|
|
588
|
+
All Rights Reserved.
|
|
589
|
+
|
|
590
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
591
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
592
|
+
in the Software without restriction, including without limitation the rights
|
|
593
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
594
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
595
|
+
furnished to do so, subject to the following conditions:
|
|
596
|
+
|
|
597
|
+
The above copyright notice and this permission notice shall be included in
|
|
598
|
+
all copies or substantial portions of the Software.
|
|
599
|
+
|
|
600
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
601
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
602
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
603
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
604
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
605
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
606
|
+
THE SOFTWARE.
|
|
607
|
+
|
|
608
|
+
===============================================
|
|
609
|
+
|
|
610
|
+
blowfish
|
|
611
|
+
|
|
612
|
+
MIT License
|
|
613
|
+
|
|
614
|
+
Copyright (c) 2021 Avinal Kumar
|
|
615
|
+
|
|
616
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
617
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
618
|
+
in the Software without restriction, including without limitation the rights
|
|
619
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
620
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
621
|
+
furnished to do so, subject to the following conditions:
|
|
622
|
+
|
|
623
|
+
The above copyright notice and this permission notice shall be included in all
|
|
624
|
+
copies or substantial portions of the Software.
|
|
625
|
+
|
|
626
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
627
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
628
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
629
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
630
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
631
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
632
|
+
SOFTWARE.
|
|
633
|
+
|
|
634
|
+
Original Algorithm Copyrights:
|
|
635
|
+
|
|
636
|
+
Blowfish 64-bit block 1997 by Paul Kocher
|
|
637
|
+
Blowfish 2 128-bit block 2005 by Alexander Pukall
|
package/README.md
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# open-l2encdec TypeScript/JavaScript Bindings
|
|
2
|
+
|
|
3
|
+
TypeScript and JavaScript bindings for the open-l2encdec WASM module. This package provides a type-safe wrapper around the WebAssembly implementation of the Lineage 2 encryption/decryption library.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @open-l2encdec/typescript
|
|
9
|
+
# or
|
|
10
|
+
yarn add @open-l2encdec/typescript
|
|
11
|
+
# or
|
|
12
|
+
pnpm add @open-l2encdec/typescript
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
### TypeScript / ES Modules
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { initL2EncDec, encode, decode, initParams } from '@open-l2encdec/typescript';
|
|
21
|
+
|
|
22
|
+
// Initialize the module
|
|
23
|
+
const module = await initL2EncDec();
|
|
24
|
+
|
|
25
|
+
// Encode data with protocol 111
|
|
26
|
+
const params = await initParams(111);
|
|
27
|
+
const input = new Uint8Array([1, 2, 3, 4, 5]);
|
|
28
|
+
const encoded = await encode(input, params, module);
|
|
29
|
+
|
|
30
|
+
// Decode data
|
|
31
|
+
const decoded = await decode(encoded, params, module);
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### JavaScript / CommonJS
|
|
35
|
+
|
|
36
|
+
```javascript
|
|
37
|
+
const { initL2EncDec, encode, decode, initParams } = require('@open-l2encdec/typescript');
|
|
38
|
+
|
|
39
|
+
(async () => {
|
|
40
|
+
const module = await initL2EncDec();
|
|
41
|
+
const params = await initParams(111);
|
|
42
|
+
const input = new Uint8Array([1, 2, 3, 4, 5]);
|
|
43
|
+
const encoded = await encode(input, params, module);
|
|
44
|
+
const decoded = await decode(encoded, params, module);
|
|
45
|
+
})();
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Direct WASM Module Access
|
|
49
|
+
|
|
50
|
+
You can also access the WASM module directly:
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
import createModule from '@open-l2encdec/typescript/wasm';
|
|
54
|
+
|
|
55
|
+
const module = await createModule();
|
|
56
|
+
const params = new module.Params();
|
|
57
|
+
module.init_params(params, 111);
|
|
58
|
+
// ... use module directly
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## API Reference
|
|
62
|
+
|
|
63
|
+
### Functions
|
|
64
|
+
|
|
65
|
+
#### `initL2EncDec(): Promise<MainModule>`
|
|
66
|
+
|
|
67
|
+
Initializes and returns the l2encdec WASM module. The module is cached, so subsequent calls return the same instance.
|
|
68
|
+
|
|
69
|
+
#### `encode(input: Uint8Array | number[], params: Params, module?: MainModule): Promise<Uint8Array>`
|
|
70
|
+
|
|
71
|
+
Encodes input data using the specified parameters.
|
|
72
|
+
|
|
73
|
+
- `input`: Input data as `Uint8Array` or array of numbers
|
|
74
|
+
- `params`: Encoding parameters (see `initParams` or `Params` type)
|
|
75
|
+
- `module`: Optional pre-initialized module (for performance)
|
|
76
|
+
|
|
77
|
+
Returns encoded data as `Uint8Array`.
|
|
78
|
+
|
|
79
|
+
#### `decode(input: Uint8Array | number[], params: Params, module?: MainModule): Promise<Uint8Array>`
|
|
80
|
+
|
|
81
|
+
Decodes input data using the specified parameters.
|
|
82
|
+
|
|
83
|
+
- `input`: Input data as `Uint8Array` or array of numbers
|
|
84
|
+
- `params`: Decoding parameters (see `initParams` or `Params` type)
|
|
85
|
+
- `module`: Optional pre-initialized module (for performance)
|
|
86
|
+
|
|
87
|
+
Returns decoded data as `Uint8Array`.
|
|
88
|
+
|
|
89
|
+
#### `initParams(protocol: number, filename?: string, use_legacy_decrypt_rsa?: boolean, module?: MainModule): Promise<Params>`
|
|
90
|
+
|
|
91
|
+
Initializes default parameters for the specified protocol.
|
|
92
|
+
|
|
93
|
+
- `protocol`: Protocol number (last three digits of file header)
|
|
94
|
+
- `filename`: Filename used for protocol 121 (XOR_FILENAME)
|
|
95
|
+
- `use_legacy_decrypt_rsa`: Use legacy RSA decryption for protocols 411-414
|
|
96
|
+
- `module`: Optional pre-initialized module (for performance)
|
|
97
|
+
|
|
98
|
+
### Types
|
|
99
|
+
|
|
100
|
+
All types are exported from the package:
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
import type {
|
|
104
|
+
L2EncDecModule, // MainModule alias
|
|
105
|
+
Params,
|
|
106
|
+
Type,
|
|
107
|
+
EncodeResult,
|
|
108
|
+
DecodeResult
|
|
109
|
+
} from '@open-l2encdec/typescript';
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The generated `interface.d.ts` from Emscripten is also available at `@open-l2encdec/typescript/wasm` for direct WASM module type access.
|
|
113
|
+
|
|
114
|
+
## Development
|
|
115
|
+
|
|
116
|
+
### Prerequisites
|
|
117
|
+
|
|
118
|
+
- [CMake](https://cmake.org/) >= 3.14
|
|
119
|
+
- [Emscripten](https://emscripten.org/) >= 4.0.21
|
|
120
|
+
- [Node.js](https://nodejs.org/) >= 18
|
|
121
|
+
- [npm](https://www.npmjs.com/), [yarn](https://yarnpkg.com/) or [pnpm](https://pnpm.io/)
|
|
122
|
+
|
|
123
|
+
### Building
|
|
124
|
+
|
|
125
|
+
1. Install dependencies:
|
|
126
|
+
```bash
|
|
127
|
+
yarn install
|
|
128
|
+
# or npm install
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
2. Build the WASM module:
|
|
132
|
+
```bash
|
|
133
|
+
yarn wasm:build
|
|
134
|
+
# or npm run wasm:build
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
3. Build the TypeScript package:
|
|
138
|
+
```bash
|
|
139
|
+
yarn build
|
|
140
|
+
# or npm run build
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
This will:
|
|
144
|
+
- Compile TypeScript to JavaScript
|
|
145
|
+
- Copy WASM artifacts (`l2encdec.js`, `l2encdec.wasm`, `interface.d.ts`) to `dist/`
|
|
146
|
+
- Generate type declarations
|
|
147
|
+
|
|
148
|
+
### Development Server
|
|
149
|
+
|
|
150
|
+
Run the Vite development server:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
yarn dev
|
|
154
|
+
# or npm run dev
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Publishing to npm
|
|
158
|
+
|
|
159
|
+
1. Build the package:
|
|
160
|
+
```bash
|
|
161
|
+
yarn build
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
2. Publish:
|
|
165
|
+
```bash
|
|
166
|
+
npm publish
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
The `prepublishOnly` script will automatically run the build before publishing.
|
|
170
|
+
|
|
171
|
+
## License
|
|
172
|
+
|
|
173
|
+
MIT License - see [LICENSE](../../LICENSE) file for details.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript wrapper for l2encdec WASM module
|
|
3
|
+
*/
|
|
4
|
+
import type { MainModule, Params, Type, EncodeResult, DecodeResult } from './interface.d.ts';
|
|
5
|
+
export type { MainModule as L2EncDecModule, Params, Type, EncodeResult, DecodeResult };
|
|
6
|
+
/**
|
|
7
|
+
* Initialize and return the l2encdec WASM module
|
|
8
|
+
*/
|
|
9
|
+
export declare function initL2EncDec(): Promise<MainModule>;
|
|
10
|
+
/**
|
|
11
|
+
* Type-safe wrapper for encoding data
|
|
12
|
+
* @param input - Input data as Uint8Array or number array
|
|
13
|
+
* @param params - Encoding parameters
|
|
14
|
+
* @param module - Optional pre-initialized module (for performance)
|
|
15
|
+
* @returns Encoded data as Uint8Array
|
|
16
|
+
*/
|
|
17
|
+
export declare function encode(input: Uint8Array | number[], params: Params, module?: MainModule): Promise<Uint8Array>;
|
|
18
|
+
/**
|
|
19
|
+
* Type-safe wrapper for decoding data
|
|
20
|
+
* @param input - Input data as Uint8Array or number array
|
|
21
|
+
* @param params - Decoding parameters
|
|
22
|
+
* @param module - Optional pre-initialized module (for performance)
|
|
23
|
+
* @returns Decoded data as Uint8Array
|
|
24
|
+
*/
|
|
25
|
+
export declare function decode(input: Uint8Array | number[], params: Params, module?: MainModule): Promise<Uint8Array>;
|
|
26
|
+
/**
|
|
27
|
+
* Helper function to initialize params with protocol
|
|
28
|
+
* @param protocol - Protocol number (last three digits of file header)
|
|
29
|
+
* @param filename - Filename used for protocol 121 (XOR_FILENAME)
|
|
30
|
+
* @param use_legacy_decrypt_rsa - Use legacy RSA decryption for protocols 411-414
|
|
31
|
+
* @param module - Optional pre-initialized module (for performance)
|
|
32
|
+
* @returns Initialized Params instance
|
|
33
|
+
*/
|
|
34
|
+
export declare function initParams(protocol: number, filename?: string, use_legacy_decrypt_rsa?: boolean, module?: MainModule): Promise<Params>;
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EACR,UAAU,EACV,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,YAAY,EACf,MAAM,kBAAkB,CAAC;AAS1B,YAAY,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;AAEvF;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,UAAU,CAAC,CAExD;AAED;;;;;;GAMG;AACH,wBAAsB,MAAM,CACxB,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,EAC5B,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,UAAU,GACpB,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED;;;;;;GAMG;AACH,wBAAsB,MAAM,CACxB,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,EAC5B,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,UAAU,GACpB,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAC5B,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,EACjB,sBAAsB,CAAC,EAAE,OAAO,EAChC,MAAM,CAAC,EAAE,UAAU,GACpB,OAAO,CAAC,MAAM,CAAC,CAKjB"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript wrapper for l2encdec WASM module
|
|
3
|
+
*/
|
|
4
|
+
// Import WASM module factory
|
|
5
|
+
// In development, Vite aliases this to build_wasm output
|
|
6
|
+
// In production, this resolves to ./l2encdec.js in dist/
|
|
7
|
+
// @ts-expect-error - Module resolution handled at runtime/build time
|
|
8
|
+
import createModule from './l2encdec.js';
|
|
9
|
+
/**
|
|
10
|
+
* Initialize and return the l2encdec WASM module
|
|
11
|
+
*/
|
|
12
|
+
export async function initL2EncDec() {
|
|
13
|
+
return await createModule();
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Type-safe wrapper for encoding data
|
|
17
|
+
* @param input - Input data as Uint8Array or number array
|
|
18
|
+
* @param params - Encoding parameters
|
|
19
|
+
* @param module - Optional pre-initialized module (for performance)
|
|
20
|
+
* @returns Encoded data as Uint8Array
|
|
21
|
+
*/
|
|
22
|
+
export async function encode(input, params, module) {
|
|
23
|
+
const m = module || await initL2EncDec();
|
|
24
|
+
const result = m.encode(input, params);
|
|
25
|
+
return result instanceof Uint8Array ? result : new Uint8Array(result);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Type-safe wrapper for decoding data
|
|
29
|
+
* @param input - Input data as Uint8Array or number array
|
|
30
|
+
* @param params - Decoding parameters
|
|
31
|
+
* @param module - Optional pre-initialized module (for performance)
|
|
32
|
+
* @returns Decoded data as Uint8Array
|
|
33
|
+
*/
|
|
34
|
+
export async function decode(input, params, module) {
|
|
35
|
+
const m = module || await initL2EncDec();
|
|
36
|
+
const result = m.decode(input, params);
|
|
37
|
+
return result instanceof Uint8Array ? result : new Uint8Array(result);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Helper function to initialize params with protocol
|
|
41
|
+
* @param protocol - Protocol number (last three digits of file header)
|
|
42
|
+
* @param filename - Filename used for protocol 121 (XOR_FILENAME)
|
|
43
|
+
* @param use_legacy_decrypt_rsa - Use legacy RSA decryption for protocols 411-414
|
|
44
|
+
* @param module - Optional pre-initialized module (for performance)
|
|
45
|
+
* @returns Initialized Params instance
|
|
46
|
+
*/
|
|
47
|
+
export async function initParams(protocol, filename, use_legacy_decrypt_rsa, module) {
|
|
48
|
+
const m = module || await initL2EncDec();
|
|
49
|
+
const params = new m.Params();
|
|
50
|
+
m.init_params(params, protocol, filename || '', use_legacy_decrypt_rsa || false);
|
|
51
|
+
return params;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH,6BAA6B;AAC7B,yDAAyD;AACzD,yDAAyD;AACzD,qEAAqE;AACrE,OAAO,YAAY,MAAM,eAAe,CAAC;AAKzC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY;IAC9B,OAAO,MAAM,YAAY,EAAE,CAAC;AAChC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CACxB,KAA4B,EAC5B,MAAc,EACd,MAAmB;IAEnB,MAAM,CAAC,GAAG,MAAM,IAAI,MAAM,YAAY,EAAE,CAAC;IACzC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvC,OAAO,MAAM,YAAY,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;AAC1E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CACxB,KAA4B,EAC5B,MAAc,EACd,MAAmB;IAEnB,MAAM,CAAC,GAAG,MAAM,IAAI,MAAM,YAAY,EAAE,CAAC;IACzC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvC,OAAO,MAAM,YAAY,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;AAC1E,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC5B,QAAgB,EAChB,QAAiB,EACjB,sBAAgC,EAChC,MAAmB;IAEnB,MAAM,CAAC,GAAG,MAAM,IAAI,MAAM,YAAY,EAAE,CAAC;IACzC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;IAC9B,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,IAAI,EAAE,EAAE,sBAAsB,IAAI,KAAK,CAAC,CAAC;IACjF,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// TypeScript bindings for emscripten-generated code. Automatically generated at compile time.
|
|
2
|
+
interface WasmModule {
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
type EmbindString = ArrayBuffer|Uint8Array|Uint8ClampedArray|Int8Array|string;
|
|
6
|
+
export interface ClassHandle {
|
|
7
|
+
isAliasOf(other: ClassHandle): boolean;
|
|
8
|
+
delete(): void;
|
|
9
|
+
deleteLater(): this;
|
|
10
|
+
isDeleted(): boolean;
|
|
11
|
+
// @ts-ignore - If targeting lower than ESNext, this symbol might not exist.
|
|
12
|
+
[Symbol.dispose](): void;
|
|
13
|
+
clone(): this;
|
|
14
|
+
}
|
|
15
|
+
export interface TypeValue<T extends number> {
|
|
16
|
+
value: T;
|
|
17
|
+
}
|
|
18
|
+
export type Type = TypeValue<0>|TypeValue<1>|TypeValue<2>|TypeValue<3>|TypeValue<4>|TypeValue<5>;
|
|
19
|
+
|
|
20
|
+
export interface EncodeResultValue<T extends number> {
|
|
21
|
+
value: T;
|
|
22
|
+
}
|
|
23
|
+
export type EncodeResult = EncodeResultValue<0>|EncodeResultValue<-1>|EncodeResultValue<-2>|EncodeResultValue<-3>;
|
|
24
|
+
|
|
25
|
+
export interface DecodeResultValue<T extends number> {
|
|
26
|
+
value: T;
|
|
27
|
+
}
|
|
28
|
+
export type DecodeResult = DecodeResultValue<0>|DecodeResultValue<-1>|DecodeResultValue<-2>|DecodeResultValue<-3>;
|
|
29
|
+
|
|
30
|
+
export interface Params extends ClassHandle {
|
|
31
|
+
type: Type;
|
|
32
|
+
protocol: number;
|
|
33
|
+
get header(): string;
|
|
34
|
+
set header(value: EmbindString);
|
|
35
|
+
get tail(): string;
|
|
36
|
+
set tail(value: EmbindString);
|
|
37
|
+
skip_tail: boolean;
|
|
38
|
+
skip_header: boolean;
|
|
39
|
+
get filename(): string;
|
|
40
|
+
set filename(value: EmbindString);
|
|
41
|
+
xor_key: number;
|
|
42
|
+
xor_start_position: number;
|
|
43
|
+
get blowfish_key(): string;
|
|
44
|
+
set blowfish_key(value: EmbindString);
|
|
45
|
+
get rsa_modulus(): string;
|
|
46
|
+
set rsa_modulus(value: EmbindString);
|
|
47
|
+
get rsa_public_exponent(): string;
|
|
48
|
+
set rsa_public_exponent(value: EmbindString);
|
|
49
|
+
get rsa_private_exponent(): string;
|
|
50
|
+
set rsa_private_exponent(value: EmbindString);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface EmbindModule {
|
|
54
|
+
Type: {NONE: TypeValue<0>, XOR: TypeValue<1>, XOR_FILENAME: TypeValue<2>, XOR_POSITION: TypeValue<3>, BLOWFISH: TypeValue<4>, RSA: TypeValue<5>};
|
|
55
|
+
EncodeResult: {SUCCESS: EncodeResultValue<0>, INVALID_TYPE: EncodeResultValue<-1>, COMPRESSION_FAILED: EncodeResultValue<-2>, ENCRYPTION_FAILED: EncodeResultValue<-3>};
|
|
56
|
+
DecodeResult: {SUCCESS: DecodeResultValue<0>, INVALID_TYPE: DecodeResultValue<-1>, DECOMPRESSION_FAILED: DecodeResultValue<-2>, DECRYPTION_FAILED: DecodeResultValue<-3>};
|
|
57
|
+
Params: {
|
|
58
|
+
new(): Params;
|
|
59
|
+
};
|
|
60
|
+
init_params(_0: Params, _1: number, _2: EmbindString, _3: boolean): boolean;
|
|
61
|
+
encode(_0: any, _1: Params): any;
|
|
62
|
+
decode(_0: any, _1: Params): any;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type MainModule = WasmModule & EmbindModule;
|
|
66
|
+
export default function MainModuleFactory (options?: unknown): Promise<MainModule>;
|
package/dist/l2encdec.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
async function Module(moduleArg={}){var moduleRtn;var Module=moduleArg;var ENVIRONMENT_IS_WEB=!!globalThis.window;var ENVIRONMENT_IS_WORKER=!!globalThis.WorkerGlobalScope;var ENVIRONMENT_IS_NODE=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";if(ENVIRONMENT_IS_NODE){const{createRequire}=await import("module");var require=createRequire(import.meta.url)}var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var _scriptName=import.meta.url;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");if(_scriptName.startsWith("file:")){scriptDirectory=require("path").dirname(require("url").fileURLToPath(_scriptName))+"/"}readBinary=filename=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename);return ret};readAsync=async(filename,binary=true)=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename,binary?undefined:"utf8");return ret};if(process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}{if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=async url=>{if(isFileURI(url)){return new Promise((resolve,reject)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){resolve(xhr.response);return}reject(xhr.status)};xhr.onerror=reject;xhr.send(null)})}var response=await fetch(url,{credentials:"same-origin"});if(response.ok){return response.arrayBuffer()}throw new Error(response.status+" : "+response.url)}}}else{}var out=console.log.bind(console);var err=console.error.bind(console);var wasmBinary;var ABORT=false;var isFileURI=filename=>filename.startsWith("file://");var readyPromiseResolve,readyPromiseReject;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;var HEAP64,HEAPU64;var runtimeInitialized=false;function updateMemoryViews(){var b=wasmMemory.buffer;HEAP8=new Int8Array(b);HEAP16=new Int16Array(b);HEAPU8=new Uint8Array(b);HEAPU16=new Uint16Array(b);HEAP32=new Int32Array(b);HEAPU32=new Uint32Array(b);HEAPF32=new Float32Array(b);HEAPF64=new Float64Array(b);HEAP64=new BigInt64Array(b);HEAPU64=new BigUint64Array(b)}function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(onPreRuns)}function initRuntime(){runtimeInitialized=true;wasmExports["E"]()}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(onPostRuns)}function abort(what){Module["onAbort"]?.(what);what="Aborted("+what+")";err(what);ABORT=true;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject?.(e);throw e}var wasmBinaryFile;function findWasmBinary(){if(Module["locateFile"]){return locateFile("./l2encdec.wasm")}return new URL("./l2encdec.wasm",import.meta.url).href}function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(binaryFile){if(!wasmBinary){try{var response=await readAsync(binaryFile);return new Uint8Array(response)}catch{}}return getBinarySync(binaryFile)}async function instantiateArrayBuffer(binaryFile,imports){try{var binary=await getWasmBinary(binaryFile);var instance=await WebAssembly.instantiate(binary,imports);return instance}catch(reason){err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)}}async function instantiateAsync(binary,binaryFile,imports){if(!binary&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE){try{var response=fetch(binaryFile,{credentials:"same-origin"});var instantiationResult=await WebAssembly.instantiateStreaming(response,imports);return instantiationResult}catch(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation")}}return instantiateArrayBuffer(binaryFile,imports)}function getWasmImports(){var imports={a:wasmImports};return imports}async function createWasm(){function receiveInstance(instance,module){wasmExports=instance.exports;assignWasmExports(wasmExports);updateMemoryViews();return wasmExports}function receiveInstantiationResult(result){return receiveInstance(result["instance"])}var info=getWasmImports();if(Module["instantiateWasm"]){return new Promise((resolve,reject)=>{Module["instantiateWasm"](info,(inst,mod)=>{resolve(receiveInstance(inst,mod))})})}wasmBinaryFile??=findWasmBinary();var result=await instantiateAsync(wasmBinary,wasmBinaryFile,info);var exports=receiveInstantiationResult(result);return exports}class ExitStatus{name="ExitStatus";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var onPostRuns=[];var addOnPostRun=cb=>onPostRuns.push(cb);var onPreRuns=[];var addOnPreRun=cb=>onPreRuns.push(cb);var noExitRuntime=true;class ExceptionInfo{constructor(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24}set_type(type){HEAPU32[this.ptr+4>>2]=type}get_type(){return HEAPU32[this.ptr+4>>2]}set_destructor(destructor){HEAPU32[this.ptr+8>>2]=destructor}get_destructor(){return HEAPU32[this.ptr+8>>2]}set_caught(caught){caught=caught?1:0;HEAP8[this.ptr+12]=caught}get_caught(){return HEAP8[this.ptr+12]!=0}set_rethrown(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13]=rethrown}get_rethrown(){return HEAP8[this.ptr+13]!=0}init(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor)}set_adjusted_ptr(adjustedPtr){HEAPU32[this.ptr+16>>2]=adjustedPtr}get_adjusted_ptr(){return HEAPU32[this.ptr+16>>2]}}var exceptionLast=0;var uncaughtExceptionCount=0;var ___cxa_throw=(ptr,type,destructor)=>{var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw exceptionLast};var __abort_js=()=>abort("");var AsciiToString=ptr=>{var str="";while(1){var ch=HEAPU8[ptr++];if(!ch)return str;str+=String.fromCharCode(ch)}};var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var BindingError=class BindingError extends Error{constructor(message){super(message);this.name="BindingError"}};var throwBindingError=message=>{throw new BindingError(message)};function sharedRegisterType(rawType,registeredInstance,options={}){var name=registeredInstance.name;if(!rawType){throwBindingError(`type "${name}" must have a positive integer typeid pointer`)}if(registeredTypes.hasOwnProperty(rawType)){if(options.ignoreDuplicateRegistrations){return}else{throwBindingError(`Cannot register type '${name}' twice`)}}registeredTypes[rawType]=registeredInstance;delete typeDependencies[rawType];if(awaitingDependencies.hasOwnProperty(rawType)){var callbacks=awaitingDependencies[rawType];delete awaitingDependencies[rawType];callbacks.forEach(cb=>cb())}}function registerType(rawType,registeredInstance,options={}){return sharedRegisterType(rawType,registeredInstance,options)}var integerReadValueFromPointer=(name,width,signed)=>{switch(width){case 1:return signed?pointer=>HEAP8[pointer]:pointer=>HEAPU8[pointer];case 2:return signed?pointer=>HEAP16[pointer>>1]:pointer=>HEAPU16[pointer>>1];case 4:return signed?pointer=>HEAP32[pointer>>2]:pointer=>HEAPU32[pointer>>2];case 8:return signed?pointer=>HEAP64[pointer>>3]:pointer=>HEAPU64[pointer>>3];default:throw new TypeError(`invalid integer width (${width}): ${name}`)}};var __embind_register_bigint=(primitiveType,name,size,minRange,maxRange)=>{name=AsciiToString(name);const isUnsignedType=minRange===0n;let fromWireType=value=>value;if(isUnsignedType){const bitSize=size*8;fromWireType=value=>BigInt.asUintN(bitSize,value);maxRange=fromWireType(maxRange)}registerType(primitiveType,{name,fromWireType,toWireType:(destructors,value)=>{if(typeof value=="number"){value=BigInt(value)}return value},readValueFromPointer:integerReadValueFromPointer(name,size,!isUnsignedType),destructorFunction:null})};var __embind_register_bool=(rawType,name,trueValue,falseValue)=>{name=AsciiToString(name);registerType(rawType,{name,fromWireType:function(wt){return!!wt},toWireType:function(destructors,o){return o?trueValue:falseValue},readValueFromPointer:function(pointer){return this.fromWireType(HEAPU8[pointer])},destructorFunction:null})};var shallowCopyInternalPointer=o=>({count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType});var throwInstanceAlreadyDeleted=obj=>{function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")};var finalizationRegistry=false;var detachFinalizer=handle=>{};var runDestructor=$$=>{if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}};var releaseClassHandle=$$=>{$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}};var attachFinalizer=handle=>{if(!globalThis.FinalizationRegistry){attachFinalizer=handle=>handle;return handle}finalizationRegistry=new FinalizationRegistry(info=>{releaseClassHandle(info.$$)});attachFinalizer=handle=>{var $$=handle.$$;var hasSmartPtr=!!$$.smartPtr;if(hasSmartPtr){var info={$$};finalizationRegistry.register(handle,info,handle)}return handle};detachFinalizer=handle=>finalizationRegistry.unregister(handle);return attachFinalizer(handle)};var deletionQueue=[];var flushPendingDeletes=()=>{while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}};var delayFunction;var init_ClassHandle=()=>{let proto=ClassHandle.prototype;Object.assign(proto,{isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;other.$$=other.$$;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right},clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}},delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}},isDeleted(){return!this.$$.ptr},deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}});const symbolDispose=Symbol.dispose;if(symbolDispose){proto[symbolDispose]=proto["delete"]}};function ClassHandle(){}var createNamedFunction=(name,func)=>Object.defineProperty(func,"name",{value:name});var registeredPointers={};var ensureOverloadTable=(proto,methodName,humanName)=>{if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(...args){if(!proto[methodName].overloadTable.hasOwnProperty(args.length)){throwBindingError(`Function '${humanName}' called with an invalid number of arguments (${args.length}) - expects one of (${proto[methodName].overloadTable})!`)}return proto[methodName].overloadTable[args.length].apply(this,args)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}};var exposePublicSymbol=(name,value,numArguments)=>{if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError(`Cannot register public name '${name}' twice`)}ensureOverloadTable(Module,name,name);if(Module[name].overloadTable.hasOwnProperty(numArguments)){throwBindingError(`Cannot register multiple overloads of a function with the same number of arguments (${numArguments})!`)}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}};var char_0=48;var char_9=57;var makeLegalFunctionName=name=>{name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return`_${name}`}return name};function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}var upcastPointer=(ptr,ptrClass,desiredClass)=>{while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError(`Expected null or instance of ${desiredClass.name}, got an instance of ${ptrClass.name}`)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr};var embindRepr=v=>{if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}};function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}return 0}if(!handle.$$){throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle||!handle.$$){throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError(`Cannot convert argument of type ${handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name} to parameter type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError(`Cannot convert argument of type ${handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name} to parameter type ${this.name}`)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,Emval.toHandle(()=>clonedHandle["delete"]()));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}return 0}if(!handle.$$){throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}if(handle.$$.ptrType.isConst){throwBindingError(`Cannot convert argument of type ${handle.$$.ptrType.name} to parameter type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function readPointer(pointer){return this.fromWireType(HEAPU32[pointer>>2])}var downcastPointer=(ptr,ptrClass,desiredClass)=>{if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)};var registeredInstances={};var getBasestPointer=(class_,ptr)=>{if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr};var getInheritedInstance=(class_,ptr)=>{ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]};var InternalError=class InternalError extends Error{constructor(message){super(message);this.name="InternalError"}};var throwInternalError=message=>{throw new InternalError(message)};var makeClassHandle=(prototype,record)=>{if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record,writable:true}}))};function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}var init_RegisteredPointer=()=>{Object.assign(RegisteredPointer.prototype,{getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr},destructor(ptr){this.rawDestructor?.(ptr)},readValueFromPointer:readPointer,fromWireType:RegisteredPointer_fromWireType})};function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this.toWireType=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this.toWireType=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this.toWireType=genericPointerToWireType}}var replacePublicSymbol=(name,value,numArguments)=>{if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistent public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}};var wasmTableMirror=[];var getWasmTableEntry=funcPtr=>{var func=wasmTableMirror[funcPtr];if(!func){wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func};var embind__requireFunction=(signature,rawFunction,isAsync=false)=>{signature=AsciiToString(signature);function makeDynCaller(){var rtn=getWasmTableEntry(rawFunction);return rtn}var fp=makeDynCaller();if(typeof fp!="function"){throwBindingError(`unknown function pointer with signature ${signature}: ${rawFunction}`)}return fp};class UnboundTypeError extends Error{}var getTypeName=type=>{var ptr=___getTypeName(type);var rv=AsciiToString(ptr);_free(ptr);return rv};var throwUnboundTypeError=(message,types)=>{var unboundTypes=[];var seen={};function visit(type){if(seen[type]){return}if(registeredTypes[type]){return}if(typeDependencies[type]){typeDependencies[type].forEach(visit);return}unboundTypes.push(type);seen[type]=true}types.forEach(visit);throw new UnboundTypeError(`${message}: `+unboundTypes.map(getTypeName).join([", "]))};var whenDependentTypesAreResolved=(myTypes,dependentTypes,getTypeConverters)=>{myTypes.forEach(type=>typeDependencies[type]=dependentTypes);function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i<myTypes.length;++i){registerType(myTypes[i],myTypeConverters[i])}}var typeConverters=new Array(dependentTypes.length);var unregisteredTypes=[];var registered=0;for(let[i,dt]of dependentTypes.entries()){if(registeredTypes.hasOwnProperty(dt)){typeConverters[i]=registeredTypes[dt]}else{unregisteredTypes.push(dt);if(!awaitingDependencies.hasOwnProperty(dt)){awaitingDependencies[dt]=[]}awaitingDependencies[dt].push(()=>{typeConverters[i]=registeredTypes[dt];++registered;if(registered===unregisteredTypes.length){onComplete(typeConverters)}})}}if(0===unregisteredTypes.length){onComplete(typeConverters)}};var __embind_register_class=(rawType,rawPointerType,rawConstPointerType,baseClassRawType,getActualTypeSignature,getActualType,upcastSignature,upcast,downcastSignature,downcast,name,destructorSignature,rawDestructor)=>{name=AsciiToString(name);getActualType=embind__requireFunction(getActualTypeSignature,getActualType);upcast&&=embind__requireFunction(upcastSignature,upcast);downcast&&=embind__requireFunction(downcastSignature,downcast);rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);var legalFunctionName=makeLegalFunctionName(name);exposePublicSymbol(legalFunctionName,function(){throwUnboundTypeError(`Cannot construct ${name} due to unbound types`,[baseClassRawType])});whenDependentTypesAreResolved([rawType,rawPointerType,rawConstPointerType],baseClassRawType?[baseClassRawType]:[],base=>{base=base[0];var baseClass;var basePrototype;if(baseClassRawType){baseClass=base.registeredClass;basePrototype=baseClass.instancePrototype}else{basePrototype=ClassHandle.prototype}var constructor=createNamedFunction(name,function(...args){if(Object.getPrototypeOf(this)!==instancePrototype){throw new BindingError(`Use 'new' to construct ${name}`)}if(undefined===registeredClass.constructor_body){throw new BindingError(`${name} has no accessible constructor`)}var body=registeredClass.constructor_body[args.length];if(undefined===body){throw new BindingError(`Tried to invoke ctor of ${name} with invalid number of parameters (${args.length}) - expected (${Object.keys(registeredClass.constructor_body).toString()}) parameters instead!`)}return body.apply(this,args)});var instancePrototype=Object.create(basePrototype,{constructor:{value:constructor}});constructor.prototype=instancePrototype;var registeredClass=new RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast);if(registeredClass.baseClass){registeredClass.baseClass.__derivedClasses??=[];registeredClass.baseClass.__derivedClasses.push(registeredClass)}var referenceConverter=new RegisteredPointer(name,registeredClass,true,false,false);var pointerConverter=new RegisteredPointer(name+"*",registeredClass,false,false,false);var constPointerConverter=new RegisteredPointer(name+" const*",registeredClass,false,true,false);registeredPointers[rawType]={pointerType:pointerConverter,constPointerType:constPointerConverter};replacePublicSymbol(legalFunctionName,constructor);return[referenceConverter,pointerConverter,constPointerConverter]})};var heap32VectorToArray=(count,firstElement)=>{var array=[];for(var i=0;i<count;i++){array.push(HEAPU32[firstElement+i*4>>2])}return array};var runDestructors=destructors=>{while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}};function usesDestructorStack(argTypes){for(var i=1;i<argTypes.length;++i){if(argTypes[i]!==null&&argTypes[i].destructorFunction===undefined){return true}}return false}function createJsInvoker(argTypes,isClassMethodFunc,returns,isAsync){var needsDestructorStack=usesDestructorStack(argTypes);var argCount=argTypes.length-2;var argsList=[];var argsListWired=["fn"];if(isClassMethodFunc){argsListWired.push("thisWired")}for(var i=0;i<argCount;++i){argsList.push(`arg${i}`);argsListWired.push(`arg${i}Wired`)}argsList=argsList.join(",");argsListWired=argsListWired.join(",");var invokerFnBody=`return function (${argsList}) {\n`;if(needsDestructorStack){invokerFnBody+="var destructors = [];\n"}var dtorStack=needsDestructorStack?"destructors":"null";var args1=["humanName","throwBindingError","invoker","fn","runDestructors","fromRetWire","toClassParamWire"];if(isClassMethodFunc){invokerFnBody+=`var thisWired = toClassParamWire(${dtorStack}, this);\n`}for(var i=0;i<argCount;++i){var argName=`toArg${i}Wire`;invokerFnBody+=`var arg${i}Wired = ${argName}(${dtorStack}, arg${i});\n`;args1.push(argName)}invokerFnBody+=(returns||isAsync?"var rv = ":"")+`invoker(${argsListWired});\n`;if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i<argTypes.length;++i){var paramName=i===1?"thisWired":"arg"+(i-2)+"Wired";if(argTypes[i].destructorFunction!==null){invokerFnBody+=`${paramName}_dtor(${paramName});\n`;args1.push(`${paramName}_dtor`)}}}if(returns){invokerFnBody+="var ret = fromRetWire(rv);\n"+"return ret;\n"}else{}invokerFnBody+="}\n";return new Function(args1,invokerFnBody)}function craftInvokerFunction(humanName,argTypes,classType,cppInvokerFunc,cppTargetFunc,isAsync){var argCount=argTypes.length;if(argCount<2){throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!")}var isClassMethodFunc=argTypes[1]!==null&&classType!==null;var needsDestructorStack=usesDestructorStack(argTypes);var returns=!argTypes[0].isVoid;var retType=argTypes[0];var instType=argTypes[1];var closureArgs=[humanName,throwBindingError,cppInvokerFunc,cppTargetFunc,runDestructors,retType.fromWireType.bind(retType),instType?.toWireType.bind(instType)];for(var i=2;i<argCount;++i){var argType=argTypes[i];closureArgs.push(argType.toWireType.bind(argType))}if(!needsDestructorStack){for(var i=isClassMethodFunc?1:2;i<argTypes.length;++i){if(argTypes[i].destructorFunction!==null){closureArgs.push(argTypes[i].destructorFunction)}}}let invokerFactory=createJsInvoker(argTypes,isClassMethodFunc,returns,isAsync);var invokerFn=invokerFactory(...closureArgs);return createNamedFunction(humanName,invokerFn)}var __embind_register_class_constructor=(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor)=>{var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);whenDependentTypesAreResolved([],[rawClassType],classType=>{classType=classType[0];var humanName=`constructor ${classType.name}`;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError(`Cannot register multiple constructors with identical number of parameters (${argCount-1}) for class '${classType.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`)}classType.registeredClass.constructor_body[argCount-1]=()=>{throwUnboundTypeError(`Cannot construct ${classType.name} due to unbound types`,rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,argTypes=>{argTypes.splice(1,0,null);classType.registeredClass.constructor_body[argCount-1]=craftInvokerFunction(humanName,argTypes,null,invoker,rawConstructor);return[]});return[]})};var validateThis=(this_,classType,humanName)=>{if(!(this_ instanceof Object)){throwBindingError(`${humanName} with invalid "this": ${this_}`)}if(!(this_ instanceof classType.registeredClass.constructor)){throwBindingError(`${humanName} incompatible with "this" of type ${this_.constructor.name}`)}if(!this_.$$.ptr){throwBindingError(`cannot call emscripten binding method ${humanName} on deleted object`)}return upcastPointer(this_.$$.ptr,this_.$$.ptrType.registeredClass,classType.registeredClass)};var __embind_register_class_property=(classType,fieldName,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext)=>{fieldName=AsciiToString(fieldName);getter=embind__requireFunction(getterSignature,getter);whenDependentTypesAreResolved([],[classType],classType=>{classType=classType[0];var humanName=`${classType.name}.${fieldName}`;var desc={get(){throwUnboundTypeError(`Cannot access ${humanName} due to unbound types`,[getterReturnType,setterArgumentType])},enumerable:true,configurable:true};if(setter){desc.set=()=>throwUnboundTypeError(`Cannot access ${humanName} due to unbound types`,[getterReturnType,setterArgumentType])}else{desc.set=v=>throwBindingError(humanName+" is a read-only property")}Object.defineProperty(classType.registeredClass.instancePrototype,fieldName,desc);whenDependentTypesAreResolved([],setter?[getterReturnType,setterArgumentType]:[getterReturnType],types=>{var getterReturnType=types[0];var desc={get(){var ptr=validateThis(this,classType,humanName+" getter");return getterReturnType.fromWireType(getter(getterContext,ptr))},enumerable:true};if(setter){setter=embind__requireFunction(setterSignature,setter);var setterArgumentType=types[1];desc.set=function(v){var ptr=validateThis(this,classType,humanName+" setter");var destructors=[];setter(setterContext,ptr,setterArgumentType.toWireType(destructors,v));runDestructors(destructors)}}Object.defineProperty(classType.registeredClass.instancePrototype,fieldName,desc);return[]});return[]})};var emval_freelist=[];var emval_handles=[0,1,,1,null,1,true,1,false,1];var __emval_decref=handle=>{if(handle>9&&0===--emval_handles[handle+1]){emval_handles[handle]=undefined;emval_freelist.push(handle)}};var Emval={toValue:handle=>{if(!handle){throwBindingError(`Cannot use deleted val. handle = ${handle}`)}return emval_handles[handle]},toHandle:value=>{switch(value){case undefined:return 2;case null:return 4;case true:return 6;case false:return 8;default:{const handle=emval_freelist.pop()||emval_handles.length;emval_handles[handle]=value;emval_handles[handle+1]=1;return handle}}}};var EmValType={name:"emscripten::val",fromWireType:handle=>{var rv=Emval.toValue(handle);__emval_decref(handle);return rv},toWireType:(destructors,value)=>Emval.toHandle(value),readValueFromPointer:readPointer,destructorFunction:null};var __embind_register_emval=rawType=>registerType(rawType,EmValType);var enumReadValueFromPointer=(name,width,signed)=>{switch(width){case 1:return signed?function(pointer){return this.fromWireType(HEAP8[pointer])}:function(pointer){return this.fromWireType(HEAPU8[pointer])};case 2:return signed?function(pointer){return this.fromWireType(HEAP16[pointer>>1])}:function(pointer){return this.fromWireType(HEAPU16[pointer>>1])};case 4:return signed?function(pointer){return this.fromWireType(HEAP32[pointer>>2])}:function(pointer){return this.fromWireType(HEAPU32[pointer>>2])};default:throw new TypeError(`invalid integer width (${width}): ${name}`)}};var __embind_register_enum=(rawType,name,size,isSigned)=>{name=AsciiToString(name);function ctor(){}ctor.values={};registerType(rawType,{name,constructor:ctor,fromWireType:function(c){return this.constructor.values[c]},toWireType:(destructors,c)=>c.value,readValueFromPointer:enumReadValueFromPointer(name,size,isSigned),destructorFunction:null});exposePublicSymbol(name,ctor)};var requireRegisteredType=(rawType,humanName)=>{var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(`${humanName} has unknown type ${getTypeName(rawType)}`)}return impl};var __embind_register_enum_value=(rawEnumType,name,enumValue)=>{var enumType=requireRegisteredType(rawEnumType,"enum");name=AsciiToString(name);var Enum=enumType.constructor;var Value=Object.create(enumType.constructor.prototype,{value:{value:enumValue},constructor:{value:createNamedFunction(`${enumType.name}_${name}`,function(){})}});Enum.values[enumValue]=Value;Enum[name]=Value};var floatReadValueFromPointer=(name,width)=>{switch(width){case 4:return function(pointer){return this.fromWireType(HEAPF32[pointer>>2])};case 8:return function(pointer){return this.fromWireType(HEAPF64[pointer>>3])};default:throw new TypeError(`invalid float width (${width}): ${name}`)}};var __embind_register_float=(rawType,name,size)=>{name=AsciiToString(name);registerType(rawType,{name,fromWireType:value=>value,toWireType:(destructors,value)=>value,readValueFromPointer:floatReadValueFromPointer(name,size),destructorFunction:null})};var getFunctionName=signature=>{signature=signature.trim();const argsIndex=signature.indexOf("(");if(argsIndex===-1)return signature;return signature.slice(0,argsIndex)};var __embind_register_function=(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn,isAsync,isNonnullReturn)=>{var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=AsciiToString(name);name=getFunctionName(name);rawInvoker=embind__requireFunction(signature,rawInvoker,isAsync);exposePublicSymbol(name,function(){throwUnboundTypeError(`Cannot call ${name} due to unbound types`,argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,argTypes=>{var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn,isAsync),argCount-1);return[]})};var __embind_register_integer=(primitiveType,name,size,minRange,maxRange)=>{name=AsciiToString(name);const isUnsignedType=minRange===0;let fromWireType=value=>value;if(isUnsignedType){var bitshift=32-8*size;fromWireType=value=>value<<bitshift>>>bitshift;maxRange=fromWireType(maxRange)}registerType(primitiveType,{name,fromWireType,toWireType:(destructors,value)=>value,readValueFromPointer:integerReadValueFromPointer(name,size,minRange!==0),destructorFunction:null})};var __embind_register_memory_view=(rawType,dataTypeIndex,name)=>{var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){var size=HEAPU32[handle>>2];var data=HEAPU32[handle+4>>2];return new TA(HEAP8.buffer,data,size)}name=AsciiToString(name);registerType(rawType,{name,fromWireType:decodeMemoryView,readValueFromPointer:decodeMemoryView},{ignoreDuplicateRegistrations:true})};var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.codePointAt(i);if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63;i++}}heap[outIdx]=0;return outIdx-startIdx};var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);var lengthBytesUTF8=str=>{var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++}else if(c<=2047){len+=2}else if(c>=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};var UTF8Decoder=globalThis.TextDecoder&&new TextDecoder;var findStringEnd=(heapOrArray,idx,maxBytesToRead,ignoreNul)=>{var maxIdx=idx+maxBytesToRead;if(ignoreNul)return maxIdx;while(heapOrArray[idx]&&!(idx>=maxIdx))++idx;return idx};var UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead,ignoreNul)=>{var endPtr=findStringEnd(heapOrArray,idx,maxBytesToRead,ignoreNul);if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str};var UTF8ToString=(ptr,maxBytesToRead,ignoreNul)=>ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead,ignoreNul):"";var __embind_register_std_string=(rawType,name)=>{name=AsciiToString(name);var stdStringIsUTF8=true;registerType(rawType,{name,fromWireType(value){var length=HEAPU32[value>>2];var payload=value+4;var str;if(stdStringIsUTF8){str=UTF8ToString(payload,length,true)}else{str="";for(var i=0;i<length;++i){str+=String.fromCharCode(HEAPU8[payload+i])}}_free(value);return str},toWireType(destructors,value){if(value instanceof ArrayBuffer){value=new Uint8Array(value)}var length;var valueIsOfTypeString=typeof value=="string";if(!(valueIsOfTypeString||ArrayBuffer.isView(value)&&value.BYTES_PER_ELEMENT==1)){throwBindingError("Cannot pass non-string to std::string")}if(stdStringIsUTF8&&valueIsOfTypeString){length=lengthBytesUTF8(value)}else{length=value.length}var base=_malloc(4+length+1);var ptr=base+4;HEAPU32[base>>2]=length;if(valueIsOfTypeString){if(stdStringIsUTF8){stringToUTF8(value,ptr,length+1)}else{for(var i=0;i<length;++i){var charCode=value.charCodeAt(i);if(charCode>255){_free(base);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+i]=charCode}}}else{HEAPU8.set(value,ptr)}if(destructors!==null){destructors.push(_free,base)}return base},readValueFromPointer:readPointer,destructorFunction(ptr){_free(ptr)}})};var UTF16Decoder=globalThis.TextDecoder?new TextDecoder("utf-16le"):undefined;var UTF16ToString=(ptr,maxBytesToRead,ignoreNul)=>{var idx=ptr>>1;var endIdx=findStringEnd(HEAPU16,idx,maxBytesToRead/2,ignoreNul);if(endIdx-idx>16&&UTF16Decoder)return UTF16Decoder.decode(HEAPU16.subarray(idx,endIdx));var str="";for(var i=idx;i<endIdx;++i){var codeUnit=HEAPU16[i];str+=String.fromCharCode(codeUnit)}return str};var stringToUTF16=(str,outPtr,maxBytesToWrite)=>{maxBytesToWrite??=2147483647;if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite<str.length*2?maxBytesToWrite/2:str.length;for(var i=0;i<numCharsToWrite;++i){var codeUnit=str.charCodeAt(i);HEAP16[outPtr>>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr};var lengthBytesUTF16=str=>str.length*2;var UTF32ToString=(ptr,maxBytesToRead,ignoreNul)=>{var str="";var startIdx=ptr>>2;for(var i=0;!(i>=maxBytesToRead/4);i++){var utf32=HEAPU32[startIdx+i];if(!utf32&&!ignoreNul)break;str+=String.fromCodePoint(utf32)}return str};var stringToUTF32=(str,outPtr,maxBytesToWrite)=>{maxBytesToWrite??=2147483647;if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i<str.length;++i){var codePoint=str.codePointAt(i);if(codePoint>65535){i++}HEAP32[outPtr>>2]=codePoint;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr};var lengthBytesUTF32=str=>{var len=0;for(var i=0;i<str.length;++i){var codePoint=str.codePointAt(i);if(codePoint>65535){i++}len+=4}return len};var __embind_register_std_wstring=(rawType,charSize,name)=>{name=AsciiToString(name);var decodeString,encodeString,lengthBytesUTF;if(charSize===2){decodeString=UTF16ToString;encodeString=stringToUTF16;lengthBytesUTF=lengthBytesUTF16}else{decodeString=UTF32ToString;encodeString=stringToUTF32;lengthBytesUTF=lengthBytesUTF32}registerType(rawType,{name,fromWireType:value=>{var length=HEAPU32[value>>2];var str=decodeString(value+4,length*charSize,true);_free(value);return str},toWireType:(destructors,value)=>{if(!(typeof value=="string")){throwBindingError(`Cannot pass non-string to C++ string type ${name}`)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length/charSize;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},readValueFromPointer:readPointer,destructorFunction(ptr){_free(ptr)}})};var __embind_register_void=(rawType,name)=>{name=AsciiToString(name);registerType(rawType,{isVoid:true,name,fromWireType:()=>undefined,toWireType:(destructors,o)=>undefined})};var emval_methodCallers=[];var emval_addMethodCaller=caller=>{var id=emval_methodCallers.length;emval_methodCallers.push(caller);return id};var emval_lookupTypes=(argCount,argTypes)=>{var a=new Array(argCount);for(var i=0;i<argCount;++i){a[i]=requireRegisteredType(HEAPU32[argTypes+i*4>>2],`parameter ${i}`)}return a};var emval_returnValue=(toReturnWire,destructorsRef,handle)=>{var destructors=[];var result=toReturnWire(destructors,handle);if(destructors.length){HEAPU32[destructorsRef>>2]=Emval.toHandle(destructors)}return result};var emval_symbols={};var getStringOrSymbol=address=>{var symbol=emval_symbols[address];if(symbol===undefined){return AsciiToString(address)}return symbol};var __emval_create_invoker=(argCount,argTypesPtr,kind)=>{var GenericWireTypeSize=8;var[retType,...argTypes]=emval_lookupTypes(argCount,argTypesPtr);var toReturnWire=retType.toWireType.bind(retType);var argFromPtr=argTypes.map(type=>type.readValueFromPointer.bind(type));argCount--;var captures={toValue:Emval.toValue};var args=argFromPtr.map((argFromPtr,i)=>{var captureName=`argFromPtr${i}`;captures[captureName]=argFromPtr;return`${captureName}(args${i?"+"+i*GenericWireTypeSize:""})`});var functionBody;switch(kind){case 0:functionBody="toValue(handle)";break;case 2:functionBody="new (toValue(handle))";break;case 3:functionBody="";break;case 1:captures["getStringOrSymbol"]=getStringOrSymbol;functionBody="toValue(handle)[getStringOrSymbol(methodName)]";break}functionBody+=`(${args})`;if(!retType.isVoid){captures["toReturnWire"]=toReturnWire;captures["emval_returnValue"]=emval_returnValue;functionBody=`return emval_returnValue(toReturnWire, destructorsRef, ${functionBody})`}functionBody=`return function (handle, methodName, destructorsRef, args) {\n ${functionBody}\n }`;var invokerFunction=new Function(Object.keys(captures),functionBody)(...Object.values(captures));var functionName=`methodCaller<(${argTypes.map(t=>t.name)}) => ${retType.name}>`;return emval_addMethodCaller(createNamedFunction(functionName,invokerFunction))};var __emval_get_property=(handle,key)=>{handle=Emval.toValue(handle);key=Emval.toValue(key);return Emval.toHandle(handle[key])};var __emval_incref=handle=>{if(handle>9){emval_handles[handle+1]+=1}};var __emval_invoke=(caller,handle,methodName,destructorsRef,args)=>emval_methodCallers[caller](handle,methodName,destructorsRef,args);var __emval_new_array_from_memory_view=view=>{view=Emval.toValue(view);var a=new Array(view.length);for(var i=0;i<view.length;i++)a[i]=view[i];return Emval.toHandle(a)};var __emval_new_cstring=v=>Emval.toHandle(getStringOrSymbol(v));var __emval_run_destructors=handle=>{var destructors=Emval.toValue(handle);runDestructors(destructors);__emval_decref(handle)};var __tzset_js=(timezone,daylight,std_name,dst_name)=>{var currentYear=(new Date).getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);var winterOffset=winter.getTimezoneOffset();var summerOffset=summer.getTimezoneOffset();var stdTimezoneOffset=Math.max(winterOffset,summerOffset);HEAPU32[timezone>>2]=stdTimezoneOffset*60;HEAP32[daylight>>2]=Number(winterOffset!=summerOffset);var extractZone=timezoneOffset=>{var sign=timezoneOffset>=0?"-":"+";var absOffset=Math.abs(timezoneOffset);var hours=String(Math.floor(absOffset/60)).padStart(2,"0");var minutes=String(absOffset%60).padStart(2,"0");return`UTC${sign}${hours}${minutes}`};var winterName=extractZone(winterOffset);var summerName=extractZone(summerOffset);if(summerOffset<winterOffset){stringToUTF8(winterName,std_name,17);stringToUTF8(summerName,dst_name,17)}else{stringToUTF8(winterName,dst_name,17);stringToUTF8(summerName,std_name,17)}};var getHeapMax=()=>2147483648;var alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment;var growMemory=size=>{var oldHeapSize=wasmMemory.buffer.byteLength;var pages=(size-oldHeapSize+65535)/65536|0;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var ENV={};var getExecutableName=()=>thisProgram||"./this.program";var getEnvStrings=()=>{if(!getEnvStrings.strings){var lang=(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8";var env={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:lang,_:getExecutableName()};for(var x in ENV){if(ENV[x]===undefined)delete env[x];else env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(`${x}=${env[x]}`)}getEnvStrings.strings=strings}return getEnvStrings.strings};var _environ_get=(__environ,environ_buf)=>{var bufSize=0;var envp=0;for(var string of getEnvStrings()){var ptr=environ_buf+bufSize;HEAPU32[__environ+envp>>2]=ptr;bufSize+=stringToUTF8(string,ptr,Infinity)+1;envp+=4}return 0};var _environ_sizes_get=(penviron_count,penviron_buf_size)=>{var strings=getEnvStrings();HEAPU32[penviron_count>>2]=strings.length;var bufSize=0;for(var string of strings){bufSize+=lengthBytesUTF8(string)+1}HEAPU32[penviron_buf_size>>2]=bufSize;return 0};init_ClassHandle();init_RegisteredPointer();{if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(Module["print"])out=Module["print"];if(Module["printErr"])err=Module["printErr"];if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].shift()()}}}var ___getTypeName,_malloc,_free,memory,__indirect_function_table,wasmMemory,wasmTable;function assignWasmExports(wasmExports){___getTypeName=wasmExports["F"];_malloc=wasmExports["H"];_free=wasmExports["I"];memory=wasmMemory=wasmExports["D"];__indirect_function_table=wasmTable=wasmExports["G"]}var wasmImports={f:___cxa_throw,v:__abort_js,o:__embind_register_bigint,A:__embind_register_bool,z:__embind_register_class,r:__embind_register_class_constructor,c:__embind_register_class_property,x:__embind_register_emval,l:__embind_register_enum,b:__embind_register_enum_value,n:__embind_register_float,j:__embind_register_function,d:__embind_register_integer,a:__embind_register_memory_view,y:__embind_register_std_string,k:__embind_register_std_wstring,B:__embind_register_void,i:__emval_create_invoker,e:__emval_decref,m:__emval_get_property,p:__emval_incref,h:__emval_invoke,C:__emval_new_array_from_memory_view,q:__emval_new_cstring,g:__emval_run_destructors,s:__tzset_js,w:_emscripten_resize_heap,t:_environ_get,u:_environ_sizes_get};function run(){preRun();function doRun(){Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve?.(Module);Module["onRuntimeInitialized"]?.();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(()=>{setTimeout(()=>Module["setStatus"](""),1);doRun()},1)}else{doRun()}}var wasmExports;wasmExports=await (createWasm());run();if(runtimeInitialized){moduleRtn=Module}else{moduleRtn=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject})}
|
|
2
|
+
;return moduleRtn}export default Module;
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "open-l2encdec",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "TypeScript/JavaScript bindings for open-l2encdec WASM module",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./wasm": {
|
|
16
|
+
"types": "./dist/interface.d.ts",
|
|
17
|
+
"import": "./dist/l2encdec.js",
|
|
18
|
+
"default": "./dist/l2encdec.js"
|
|
19
|
+
},
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"README.md",
|
|
25
|
+
"LICENSE"
|
|
26
|
+
],
|
|
27
|
+
"keywords": [
|
|
28
|
+
"l2encdec",
|
|
29
|
+
"lineage2",
|
|
30
|
+
"encryption",
|
|
31
|
+
"decryption",
|
|
32
|
+
"wasm",
|
|
33
|
+
"typescript",
|
|
34
|
+
"javascript"
|
|
35
|
+
],
|
|
36
|
+
"author": "ritsuwastaken",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/ritsuwastaken/open-l2encdec.git",
|
|
41
|
+
"directory": "modules/typescript"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"wasm:build": "cd ../.. && cmake --preset emscripten && cmake --build --preset emscripten-build",
|
|
45
|
+
"build": "npm run build:copy-wasm && npm run build:ts",
|
|
46
|
+
"build:ts": "tsc -p tsconfig.build.json",
|
|
47
|
+
"build:copy-wasm": "node scripts/copy-wasm.js",
|
|
48
|
+
"prepublishOnly": "npm run build",
|
|
49
|
+
"dev": "vite"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"typescript": "^5.3.0",
|
|
53
|
+
"vite": "^7.3.0"
|
|
54
|
+
}
|
|
55
|
+
}
|