toto10 commited on
Commit
d00d19e
·
1 Parent(s): 4769705

Delete sd-3dmodel-loader

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. sd-3dmodel-loader/.gitignore +0 -30
  2. sd-3dmodel-loader/LICENSE +0 -661
  3. sd-3dmodel-loader/README.md +0 -75
  4. sd-3dmodel-loader/doc/images/1.png +0 -0
  5. sd-3dmodel-loader/doc/images/animationPanel.png +0 -0
  6. sd-3dmodel-loader/doc/images/buttons.png +0 -0
  7. sd-3dmodel-loader/doc/images/canvasPanel.png +0 -0
  8. sd-3dmodel-loader/doc/images/configureFromPage.png +0 -0
  9. sd-3dmodel-loader/doc/images/configureFromSettings.png +0 -0
  10. sd-3dmodel-loader/doc/images/controlnet.png +0 -0
  11. sd-3dmodel-loader/doc/images/installFromOfficialLink.png +0 -0
  12. sd-3dmodel-loader/doc/images/modelPanel.png +0 -0
  13. sd-3dmodel-loader/doc/images/pose.png +0 -0
  14. sd-3dmodel-loader/doc/images/sceneCamera.png +0 -0
  15. sd-3dmodel-loader/doc/images/sceneColor.png +0 -0
  16. sd-3dmodel-loader/doc/images/sceneOperate.png +0 -0
  17. sd-3dmodel-loader/doc/images/sceneVisible.png +0 -0
  18. sd-3dmodel-loader/doc/images/sendToControlNet.png +0 -0
  19. sd-3dmodel-loader/doc/images/uploadSettingsPanel.png +0 -0
  20. sd-3dmodel-loader/index.html +0 -25
  21. sd-3dmodel-loader/javascript/3d-model-loader-import.js +0 -40
  22. sd-3dmodel-loader/javascript/lazyload/3d-model-loader-webui.js +0 -116
  23. sd-3dmodel-loader/js/3d-model-loader.bundle.js +0 -0
  24. sd-3dmodel-loader/js/draco_decoder.js +0 -0
  25. sd-3dmodel-loader/js/draco_decoder.wasm +0 -3
  26. sd-3dmodel-loader/js/draco_encoder.js +0 -0
  27. sd-3dmodel-loader/js/draco_wasm_wrapper.js +0 -104
  28. sd-3dmodel-loader/js/es-module-shims.js +0 -789
  29. sd-3dmodel-loader/models/Samba Dancing.fbx +0 -3
  30. sd-3dmodel-loader/models/male02.obj +0 -0
  31. sd-3dmodel-loader/models/pose.vrm +0 -3
  32. sd-3dmodel-loader/package.json +0 -59
  33. sd-3dmodel-loader/poses/kneel.json +0 -1
  34. sd-3dmodel-loader/public/favicon.ico +0 -0
  35. sd-3dmodel-loader/public/index.html +0 -15
  36. sd-3dmodel-loader/public/logo192.png +0 -0
  37. sd-3dmodel-loader/public/logo512.png +0 -0
  38. sd-3dmodel-loader/public/manifest.json +0 -25
  39. sd-3dmodel-loader/public/robots.txt +0 -3
  40. sd-3dmodel-loader/scripts/__pycache__/main.cpython-310.pyc +0 -0
  41. sd-3dmodel-loader/scripts/main.py +0 -84
  42. sd-3dmodel-loader/src/AnimationPanel.js +0 -50
  43. sd-3dmodel-loader/src/CameraPanel.js +0 -58
  44. sd-3dmodel-loader/src/CanvasSettingsPanel.js +0 -95
  45. sd-3dmodel-loader/src/ModelPanel.js +0 -40
  46. sd-3dmodel-loader/src/NumberInput.js +0 -40
  47. sd-3dmodel-loader/src/PosePanel.js +0 -434
  48. sd-3dmodel-loader/src/ScenePanel.js +0 -262
  49. sd-3dmodel-loader/src/SendToControlNetPanel.js +0 -87
  50. sd-3dmodel-loader/src/ThreeJsScene.js +0 -761
sd-3dmodel-loader/.gitignore DELETED
@@ -1,30 +0,0 @@
1
- .idea/
2
- venv/
3
- dist/
4
-
5
- **/__pycache__/**
6
- package-lock.json
7
-
8
- # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
9
-
10
- # dependencies
11
- /node_modules
12
- /.pnp
13
- .pnp.js
14
-
15
- # testing
16
- /coverage
17
-
18
- # production
19
- /build
20
-
21
- # misc
22
- .DS_Store
23
- .env.local
24
- .env.development.local
25
- .env.test.local
26
- .env.production.local
27
-
28
- npm-debug.log*
29
- yarn-debug.log*
30
- yarn-error.log*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/LICENSE DELETED
@@ -1,661 +0,0 @@
1
- GNU AFFERO GENERAL PUBLIC LICENSE
2
- Version 3, 19 November 2007
3
-
4
- Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
- Everyone is permitted to copy and distribute verbatim copies
6
- of this license document, but changing it is not allowed.
7
-
8
- Preamble
9
-
10
- The GNU Affero General Public License is a free, copyleft license for
11
- software and other kinds of works, specifically designed to ensure
12
- cooperation with the community in the case of network server software.
13
-
14
- The licenses for most software and other practical works are designed
15
- to take away your freedom to share and change the works. By contrast,
16
- our General Public Licenses are intended to guarantee your freedom to
17
- share and change all versions of a program--to make sure it remains free
18
- software for all its users.
19
-
20
- When we speak of free software, we are referring to freedom, not
21
- price. Our General Public Licenses are designed to make sure that you
22
- have the freedom to distribute copies of free software (and charge for
23
- them if you wish), that you receive source code or can get it if you
24
- want it, that you can change the software or use pieces of it in new
25
- free programs, and that you know you can do these things.
26
-
27
- Developers that use our General Public Licenses protect your rights
28
- with two steps: (1) assert copyright on the software, and (2) offer
29
- you this License which gives you legal permission to copy, distribute
30
- and/or modify the software.
31
-
32
- A secondary benefit of defending all users' freedom is that
33
- improvements made in alternate versions of the program, if they
34
- receive widespread use, become available for other developers to
35
- incorporate. Many developers of free software are heartened and
36
- encouraged by the resulting cooperation. However, in the case of
37
- software used on network servers, this result may fail to come about.
38
- The GNU General Public License permits making a modified version and
39
- letting the public access it on a server without ever releasing its
40
- source code to the public.
41
-
42
- The GNU Affero General Public License is designed specifically to
43
- ensure that, in such cases, the modified source code becomes available
44
- to the community. It requires the operator of a network server to
45
- provide the source code of the modified version running there to the
46
- users of that server. Therefore, public use of a modified version, on
47
- a publicly accessible server, gives the public access to the source
48
- code of the modified version.
49
-
50
- An older license, called the Affero General Public License and
51
- published by Affero, was designed to accomplish similar goals. This is
52
- a different license, not a version of the Affero GPL, but Affero has
53
- released a new version of the Affero GPL which permits relicensing under
54
- this license.
55
-
56
- The precise terms and conditions for copying, distribution and
57
- modification follow.
58
-
59
- TERMS AND CONDITIONS
60
-
61
- 0. Definitions.
62
-
63
- "This License" refers to version 3 of the GNU Affero General Public License.
64
-
65
- "Copyright" also means copyright-like laws that apply to other kinds of
66
- works, such as semiconductor masks.
67
-
68
- "The Program" refers to any copyrightable work licensed under this
69
- License. Each licensee is addressed as "you". "Licensees" and
70
- "recipients" may be individuals or organizations.
71
-
72
- To "modify" a work means to copy from or adapt all or part of the work
73
- in a fashion requiring copyright permission, other than the making of an
74
- exact copy. The resulting work is called a "modified version" of the
75
- earlier work or a work "based on" the earlier work.
76
-
77
- A "covered work" means either the unmodified Program or a work based
78
- on the Program.
79
-
80
- To "propagate" a work means to do anything with it that, without
81
- permission, would make you directly or secondarily liable for
82
- infringement under applicable copyright law, except executing it on a
83
- computer or modifying a private copy. Propagation includes copying,
84
- distribution (with or without modification), making available to the
85
- public, and in some countries other activities as well.
86
-
87
- To "convey" a work means any kind of propagation that enables other
88
- parties to make or receive copies. Mere interaction with a user through
89
- a computer network, with no transfer of a copy, is not conveying.
90
-
91
- An interactive user interface displays "Appropriate Legal Notices"
92
- to the extent that it includes a convenient and prominently visible
93
- feature that (1) displays an appropriate copyright notice, and (2)
94
- tells the user that there is no warranty for the work (except to the
95
- extent that warranties are provided), that licensees may convey the
96
- work under this License, and how to view a copy of this License. If
97
- the interface presents a list of user commands or options, such as a
98
- menu, a prominent item in the list meets this criterion.
99
-
100
- 1. Source Code.
101
-
102
- The "source code" for a work means the preferred form of the work
103
- for making modifications to it. "Object code" means any non-source
104
- form of a work.
105
-
106
- A "Standard Interface" means an interface that either is an official
107
- standard defined by a recognized standards body, or, in the case of
108
- interfaces specified for a particular programming language, one that
109
- is widely used among developers working in that language.
110
-
111
- The "System Libraries" of an executable work include anything, other
112
- than the work as a whole, that (a) is included in the normal form of
113
- packaging a Major Component, but which is not part of that Major
114
- Component, and (b) serves only to enable use of the work with that
115
- Major Component, or to implement a Standard Interface for which an
116
- implementation is available to the public in source code form. A
117
- "Major Component", in this context, means a major essential component
118
- (kernel, window system, and so on) of the specific operating system
119
- (if any) on which the executable work runs, or a compiler used to
120
- produce the work, or an object code interpreter used to run it.
121
-
122
- The "Corresponding Source" for a work in object code form means all
123
- the source code needed to generate, install, and (for an executable
124
- work) run the object code and to modify the work, including scripts to
125
- control those activities. However, it does not include the work's
126
- System Libraries, or general-purpose tools or generally available free
127
- programs which are used unmodified in performing those activities but
128
- which are not part of the work. For example, Corresponding Source
129
- includes interface definition files associated with source files for
130
- the work, and the source code for shared libraries and dynamically
131
- linked subprograms that the work is specifically designed to require,
132
- such as by intimate data communication or control flow between those
133
- subprograms and other parts of the work.
134
-
135
- The Corresponding Source need not include anything that users
136
- can regenerate automatically from other parts of the Corresponding
137
- Source.
138
-
139
- The Corresponding Source for a work in source code form is that
140
- same work.
141
-
142
- 2. Basic Permissions.
143
-
144
- All rights granted under this License are granted for the term of
145
- copyright on the Program, and are irrevocable provided the stated
146
- conditions are met. This License explicitly affirms your unlimited
147
- permission to run the unmodified Program. The output from running a
148
- covered work is covered by this License only if the output, given its
149
- content, constitutes a covered work. This License acknowledges your
150
- rights of fair use or other equivalent, as provided by copyright law.
151
-
152
- You may make, run and propagate covered works that you do not
153
- convey, without conditions so long as your license otherwise remains
154
- in force. You may convey covered works to others for the sole purpose
155
- of having them make modifications exclusively for you, or provide you
156
- with facilities for running those works, provided that you comply with
157
- the terms of this License in conveying all material for which you do
158
- not control copyright. Those thus making or running the covered works
159
- for you must do so exclusively on your behalf, under your direction
160
- and control, on terms that prohibit them from making any copies of
161
- your copyrighted material outside their relationship with you.
162
-
163
- Conveying under any other circumstances is permitted solely under
164
- the conditions stated below. Sublicensing is not allowed; section 10
165
- makes it unnecessary.
166
-
167
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168
-
169
- No covered work shall be deemed part of an effective technological
170
- measure under any applicable law fulfilling obligations under article
171
- 11 of the WIPO copyright treaty adopted on 20 December 1996, or
172
- similar laws prohibiting or restricting circumvention of such
173
- measures.
174
-
175
- When you convey a covered work, you waive any legal power to forbid
176
- circumvention of technological measures to the extent such circumvention
177
- is effected by exercising rights under this License with respect to
178
- the covered work, and you disclaim any intention to limit operation or
179
- modification of the work as a means of enforcing, against the work's
180
- users, your or third parties' legal rights to forbid circumvention of
181
- technological measures.
182
-
183
- 4. Conveying Verbatim Copies.
184
-
185
- You may convey verbatim copies of the Program's source code as you
186
- receive it, in any medium, provided that you conspicuously and
187
- appropriately publish on each copy an appropriate copyright notice;
188
- keep intact all notices stating that this License and any
189
- non-permissive terms added in accord with section 7 apply to the code;
190
- keep intact all notices of the absence of any warranty; and give all
191
- recipients a copy of this License along with the Program.
192
-
193
- You may charge any price or no price for each copy that you convey,
194
- and you may offer support or warranty protection for a fee.
195
-
196
- 5. Conveying Modified Source Versions.
197
-
198
- You may convey a work based on the Program, or the modifications to
199
- produce it from the Program, in the form of source code under the
200
- terms of section 4, provided that you also meet all of these conditions:
201
-
202
- a) The work must carry prominent notices stating that you modified
203
- it, and giving a relevant date.
204
-
205
- b) The work must carry prominent notices stating that it is
206
- released under this License and any conditions added under section
207
- 7. This requirement modifies the requirement in section 4 to
208
- "keep intact all notices".
209
-
210
- c) You must license the entire work, as a whole, under this
211
- License to anyone who comes into possession of a copy. This
212
- License will therefore apply, along with any applicable section 7
213
- additional terms, to the whole of the work, and all its parts,
214
- regardless of how they are packaged. This License gives no
215
- permission to license the work in any other way, but it does not
216
- invalidate such permission if you have separately received it.
217
-
218
- d) If the work has interactive user interfaces, each must display
219
- Appropriate Legal Notices; however, if the Program has interactive
220
- interfaces that do not display Appropriate Legal Notices, your
221
- work need not make them do so.
222
-
223
- A compilation of a covered work with other separate and independent
224
- works, which are not by their nature extensions of the covered work,
225
- and which are not combined with it such as to form a larger program,
226
- in or on a volume of a storage or distribution medium, is called an
227
- "aggregate" if the compilation and its resulting copyright are not
228
- used to limit the access or legal rights of the compilation's users
229
- beyond what the individual works permit. Inclusion of a covered work
230
- in an aggregate does not cause this License to apply to the other
231
- parts of the aggregate.
232
-
233
- 6. Conveying Non-Source Forms.
234
-
235
- You may convey a covered work in object code form under the terms
236
- of sections 4 and 5, provided that you also convey the
237
- machine-readable Corresponding Source under the terms of this License,
238
- in one of these ways:
239
-
240
- a) Convey the object code in, or embodied in, a physical product
241
- (including a physical distribution medium), accompanied by the
242
- Corresponding Source fixed on a durable physical medium
243
- customarily used for software interchange.
244
-
245
- b) Convey the object code in, or embodied in, a physical product
246
- (including a physical distribution medium), accompanied by a
247
- written offer, valid for at least three years and valid for as
248
- long as you offer spare parts or customer support for that product
249
- model, to give anyone who possesses the object code either (1) a
250
- copy of the Corresponding Source for all the software in the
251
- product that is covered by this License, on a durable physical
252
- medium customarily used for software interchange, for a price no
253
- more than your reasonable cost of physically performing this
254
- conveying of source, or (2) access to copy the
255
- Corresponding Source from a network server at no charge.
256
-
257
- c) Convey individual copies of the object code with a copy of the
258
- written offer to provide the Corresponding Source. This
259
- alternative is allowed only occasionally and noncommercially, and
260
- only if you received the object code with such an offer, in accord
261
- with subsection 6b.
262
-
263
- d) Convey the object code by offering access from a designated
264
- place (gratis or for a charge), and offer equivalent access to the
265
- Corresponding Source in the same way through the same place at no
266
- further charge. You need not require recipients to copy the
267
- Corresponding Source along with the object code. If the place to
268
- copy the object code is a network server, the Corresponding Source
269
- may be on a different server (operated by you or a third party)
270
- that supports equivalent copying facilities, provided you maintain
271
- clear directions next to the object code saying where to find the
272
- Corresponding Source. Regardless of what server hosts the
273
- Corresponding Source, you remain obligated to ensure that it is
274
- available for as long as needed to satisfy these requirements.
275
-
276
- e) Convey the object code using peer-to-peer transmission, provided
277
- you inform other peers where the object code and Corresponding
278
- Source of the work are being offered to the general public at no
279
- charge under subsection 6d.
280
-
281
- A separable portion of the object code, whose source code is excluded
282
- from the Corresponding Source as a System Library, need not be
283
- included in conveying the object code work.
284
-
285
- A "User Product" is either (1) a "consumer product", which means any
286
- tangible personal property which is normally used for personal, family,
287
- or household purposes, or (2) anything designed or sold for incorporation
288
- into a dwelling. In determining whether a product is a consumer product,
289
- doubtful cases shall be resolved in favor of coverage. For a particular
290
- product received by a particular user, "normally used" refers to a
291
- typical or common use of that class of product, regardless of the status
292
- of the particular user or of the way in which the particular user
293
- actually uses, or expects or is expected to use, the product. A product
294
- is a consumer product regardless of whether the product has substantial
295
- commercial, industrial or non-consumer uses, unless such uses represent
296
- the only significant mode of use of the product.
297
-
298
- "Installation Information" for a User Product means any methods,
299
- procedures, authorization keys, or other information required to install
300
- and execute modified versions of a covered work in that User Product from
301
- a modified version of its Corresponding Source. The information must
302
- suffice to ensure that the continued functioning of the modified object
303
- code is in no case prevented or interfered with solely because
304
- modification has been made.
305
-
306
- If you convey an object code work under this section in, or with, or
307
- specifically for use in, a User Product, and the conveying occurs as
308
- part of a transaction in which the right of possession and use of the
309
- User Product is transferred to the recipient in perpetuity or for a
310
- fixed term (regardless of how the transaction is characterized), the
311
- Corresponding Source conveyed under this section must be accompanied
312
- by the Installation Information. But this requirement does not apply
313
- if neither you nor any third party retains the ability to install
314
- modified object code on the User Product (for example, the work has
315
- been installed in ROM).
316
-
317
- The requirement to provide Installation Information does not include a
318
- requirement to continue to provide support service, warranty, or updates
319
- for a work that has been modified or installed by the recipient, or for
320
- the User Product in which it has been modified or installed. Access to a
321
- network may be denied when the modification itself materially and
322
- adversely affects the operation of the network or violates the rules and
323
- protocols for communication across the network.
324
-
325
- Corresponding Source conveyed, and Installation Information provided,
326
- in accord with this section must be in a format that is publicly
327
- documented (and with an implementation available to the public in
328
- source code form), and must require no special password or key for
329
- unpacking, reading or copying.
330
-
331
- 7. Additional Terms.
332
-
333
- "Additional permissions" are terms that supplement the terms of this
334
- License by making exceptions from one or more of its conditions.
335
- Additional permissions that are applicable to the entire Program shall
336
- be treated as though they were included in this License, to the extent
337
- that they are valid under applicable law. If additional permissions
338
- apply only to part of the Program, that part may be used separately
339
- under those permissions, but the entire Program remains governed by
340
- this License without regard to the additional permissions.
341
-
342
- When you convey a copy of a covered work, you may at your option
343
- remove any additional permissions from that copy, or from any part of
344
- it. (Additional permissions may be written to require their own
345
- removal in certain cases when you modify the work.) You may place
346
- additional permissions on material, added by you to a covered work,
347
- for which you have or can give appropriate copyright permission.
348
-
349
- Notwithstanding any other provision of this License, for material you
350
- add to a covered work, you may (if authorized by the copyright holders of
351
- that material) supplement the terms of this License with terms:
352
-
353
- a) Disclaiming warranty or limiting liability differently from the
354
- terms of sections 15 and 16 of this License; or
355
-
356
- b) Requiring preservation of specified reasonable legal notices or
357
- author attributions in that material or in the Appropriate Legal
358
- Notices displayed by works containing it; or
359
-
360
- c) Prohibiting misrepresentation of the origin of that material, or
361
- requiring that modified versions of such material be marked in
362
- reasonable ways as different from the original version; or
363
-
364
- d) Limiting the use for publicity purposes of names of licensors or
365
- authors of the material; or
366
-
367
- e) Declining to grant rights under trademark law for use of some
368
- trade names, trademarks, or service marks; or
369
-
370
- f) Requiring indemnification of licensors and authors of that
371
- material by anyone who conveys the material (or modified versions of
372
- it) with contractual assumptions of liability to the recipient, for
373
- any liability that these contractual assumptions directly impose on
374
- those licensors and authors.
375
-
376
- All other non-permissive additional terms are considered "further
377
- restrictions" within the meaning of section 10. If the Program as you
378
- received it, or any part of it, contains a notice stating that it is
379
- governed by this License along with a term that is a further
380
- restriction, you may remove that term. If a license document contains
381
- a further restriction but permits relicensing or conveying under this
382
- License, you may add to a covered work material governed by the terms
383
- of that license document, provided that the further restriction does
384
- not survive such relicensing or conveying.
385
-
386
- If you add terms to a covered work in accord with this section, you
387
- must place, in the relevant source files, a statement of the
388
- additional terms that apply to those files, or a notice indicating
389
- where to find the applicable terms.
390
-
391
- Additional terms, permissive or non-permissive, may be stated in the
392
- form of a separately written license, or stated as exceptions;
393
- the above requirements apply either way.
394
-
395
- 8. Termination.
396
-
397
- You may not propagate or modify a covered work except as expressly
398
- provided under this License. Any attempt otherwise to propagate or
399
- modify it is void, and will automatically terminate your rights under
400
- this License (including any patent licenses granted under the third
401
- paragraph of section 11).
402
-
403
- However, if you cease all violation of this License, then your
404
- license from a particular copyright holder is reinstated (a)
405
- provisionally, unless and until the copyright holder explicitly and
406
- finally terminates your license, and (b) permanently, if the copyright
407
- holder fails to notify you of the violation by some reasonable means
408
- prior to 60 days after the cessation.
409
-
410
- Moreover, your license from a particular copyright holder is
411
- reinstated permanently if the copyright holder notifies you of the
412
- violation by some reasonable means, this is the first time you have
413
- received notice of violation of this License (for any work) from that
414
- copyright holder, and you cure the violation prior to 30 days after
415
- your receipt of the notice.
416
-
417
- Termination of your rights under this section does not terminate the
418
- licenses of parties who have received copies or rights from you under
419
- this License. If your rights have been terminated and not permanently
420
- reinstated, you do not qualify to receive new licenses for the same
421
- material under section 10.
422
-
423
- 9. Acceptance Not Required for Having Copies.
424
-
425
- You are not required to accept this License in order to receive or
426
- run a copy of the Program. Ancillary propagation of a covered work
427
- occurring solely as a consequence of using peer-to-peer transmission
428
- to receive a copy likewise does not require acceptance. However,
429
- nothing other than this License grants you permission to propagate or
430
- modify any covered work. These actions infringe copyright if you do
431
- not accept this License. Therefore, by modifying or propagating a
432
- covered work, you indicate your acceptance of this License to do so.
433
-
434
- 10. Automatic Licensing of Downstream Recipients.
435
-
436
- Each time you convey a covered work, the recipient automatically
437
- receives a license from the original licensors, to run, modify and
438
- propagate that work, subject to this License. You are not responsible
439
- for enforcing compliance by third parties with this License.
440
-
441
- An "entity transaction" is a transaction transferring control of an
442
- organization, or substantially all assets of one, or subdividing an
443
- organization, or merging organizations. If propagation of a covered
444
- work results from an entity transaction, each party to that
445
- transaction who receives a copy of the work also receives whatever
446
- licenses to the work the party's predecessor in interest had or could
447
- give under the previous paragraph, plus a right to possession of the
448
- Corresponding Source of the work from the predecessor in interest, if
449
- the predecessor has it or can get it with reasonable efforts.
450
-
451
- You may not impose any further restrictions on the exercise of the
452
- rights granted or affirmed under this License. For example, you may
453
- not impose a license fee, royalty, or other charge for exercise of
454
- rights granted under this License, and you may not initiate litigation
455
- (including a cross-claim or counterclaim in a lawsuit) alleging that
456
- any patent claim is infringed by making, using, selling, offering for
457
- sale, or importing the Program or any portion of it.
458
-
459
- 11. Patents.
460
-
461
- A "contributor" is a copyright holder who authorizes use under this
462
- License of the Program or a work on which the Program is based. The
463
- work thus licensed is called the contributor's "contributor version".
464
-
465
- A contributor's "essential patent claims" are all patent claims
466
- owned or controlled by the contributor, whether already acquired or
467
- hereafter acquired, that would be infringed by some manner, permitted
468
- by this License, of making, using, or selling its contributor version,
469
- but do not include claims that would be infringed only as a
470
- consequence of further modification of the contributor version. For
471
- purposes of this definition, "control" includes the right to grant
472
- patent sublicenses in a manner consistent with the requirements of
473
- this License.
474
-
475
- Each contributor grants you a non-exclusive, worldwide, royalty-free
476
- patent license under the contributor's essential patent claims, to
477
- make, use, sell, offer for sale, import and otherwise run, modify and
478
- propagate the contents of its contributor version.
479
-
480
- In the following three paragraphs, a "patent license" is any express
481
- agreement or commitment, however denominated, not to enforce a patent
482
- (such as an express permission to practice a patent or covenant not to
483
- sue for patent infringement). To "grant" such a patent license to a
484
- party means to make such an agreement or commitment not to enforce a
485
- patent against the party.
486
-
487
- If you convey a covered work, knowingly relying on a patent license,
488
- and the Corresponding Source of the work is not available for anyone
489
- to copy, free of charge and under the terms of this License, through a
490
- publicly available network server or other readily accessible means,
491
- then you must either (1) cause the Corresponding Source to be so
492
- available, or (2) arrange to deprive yourself of the benefit of the
493
- patent license for this particular work, or (3) arrange, in a manner
494
- consistent with the requirements of this License, to extend the patent
495
- license to downstream recipients. "Knowingly relying" means you have
496
- actual knowledge that, but for the patent license, your conveying the
497
- covered work in a country, or your recipient's use of the covered work
498
- in a country, would infringe one or more identifiable patents in that
499
- country that you have reason to believe are valid.
500
-
501
- If, pursuant to or in connection with a single transaction or
502
- arrangement, you convey, or propagate by procuring conveyance of, a
503
- covered work, and grant a patent license to some of the parties
504
- receiving the covered work authorizing them to use, propagate, modify
505
- or convey a specific copy of the covered work, then the patent license
506
- you grant is automatically extended to all recipients of the covered
507
- work and works based on it.
508
-
509
- A patent license is "discriminatory" if it does not include within
510
- the scope of its coverage, prohibits the exercise of, or is
511
- conditioned on the non-exercise of one or more of the rights that are
512
- specifically granted under this License. You may not convey a covered
513
- work if you are a party to an arrangement with a third party that is
514
- in the business of distributing software, under which you make payment
515
- to the third party based on the extent of your activity of conveying
516
- the work, and under which the third party grants, to any of the
517
- parties who would receive the covered work from you, a discriminatory
518
- patent license (a) in connection with copies of the covered work
519
- conveyed by you (or copies made from those copies), or (b) primarily
520
- for and in connection with specific products or compilations that
521
- contain the covered work, unless you entered into that arrangement,
522
- or that patent license was granted, prior to 28 March 2007.
523
-
524
- Nothing in this License shall be construed as excluding or limiting
525
- any implied license or other defenses to infringement that may
526
- otherwise be available to you under applicable patent law.
527
-
528
- 12. No Surrender of Others' Freedom.
529
-
530
- If conditions are imposed on you (whether by court order, agreement or
531
- otherwise) that contradict the conditions of this License, they do not
532
- excuse you from the conditions of this License. If you cannot convey a
533
- covered work so as to satisfy simultaneously your obligations under this
534
- License and any other pertinent obligations, then as a consequence you may
535
- not convey it at all. For example, if you agree to terms that obligate you
536
- to collect a royalty for further conveying from those to whom you convey
537
- the Program, the only way you could satisfy both those terms and this
538
- License would be to refrain entirely from conveying the Program.
539
-
540
- 13. Remote Network Interaction; Use with the GNU General Public License.
541
-
542
- Notwithstanding any other provision of this License, if you modify the
543
- Program, your modified version must prominently offer all users
544
- interacting with it remotely through a computer network (if your version
545
- supports such interaction) an opportunity to receive the Corresponding
546
- Source of your version by providing access to the Corresponding Source
547
- from a network server at no charge, through some standard or customary
548
- means of facilitating copying of software. This Corresponding Source
549
- shall include the Corresponding Source for any work covered by version 3
550
- of the GNU General Public License that is incorporated pursuant to the
551
- following paragraph.
552
-
553
- Notwithstanding any other provision of this License, you have
554
- permission to link or combine any covered work with a work licensed
555
- under version 3 of the GNU General Public License into a single
556
- combined work, and to convey the resulting work. The terms of this
557
- License will continue to apply to the part which is the covered work,
558
- but the work with which it is combined will remain governed by version
559
- 3 of the GNU General Public License.
560
-
561
- 14. Revised Versions of this License.
562
-
563
- The Free Software Foundation may publish revised and/or new versions of
564
- the GNU Affero General Public License from time to time. Such new versions
565
- will be similar in spirit to the present version, but may differ in detail to
566
- address new problems or concerns.
567
-
568
- Each version is given a distinguishing version number. If the
569
- Program specifies that a certain numbered version of the GNU Affero General
570
- Public License "or any later version" applies to it, you have the
571
- option of following the terms and conditions either of that numbered
572
- version or of any later version published by the Free Software
573
- Foundation. If the Program does not specify a version number of the
574
- GNU Affero General Public License, you may choose any version ever published
575
- by the Free Software Foundation.
576
-
577
- If the Program specifies that a proxy can decide which future
578
- versions of the GNU Affero General Public License can be used, that proxy's
579
- public statement of acceptance of a version permanently authorizes you
580
- to choose that version for the Program.
581
-
582
- Later license versions may give you additional or different
583
- permissions. However, no additional obligations are imposed on any
584
- author or copyright holder as a result of your choosing to follow a
585
- later version.
586
-
587
- 15. Disclaimer of Warranty.
588
-
589
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
590
- APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
591
- HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
592
- OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
593
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
594
- PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
595
- IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
596
- ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
597
-
598
- 16. Limitation of Liability.
599
-
600
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
601
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
602
- THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
603
- GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
604
- USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
605
- DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
606
- PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
607
- EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
608
- SUCH DAMAGES.
609
-
610
- 17. Interpretation of Sections 15 and 16.
611
-
612
- If the disclaimer of warranty and limitation of liability provided
613
- above cannot be given local legal effect according to their terms,
614
- reviewing courts shall apply local law that most closely approximates
615
- an absolute waiver of all civil liability in connection with the
616
- Program, unless a warranty or assumption of liability accompanies a
617
- copy of the Program in return for a fee.
618
-
619
- END OF TERMS AND CONDITIONS
620
-
621
- How to Apply These Terms to Your New Programs
622
-
623
- If you develop a new program, and you want it to be of the greatest
624
- possible use to the public, the best way to achieve this is to make it
625
- free software which everyone can redistribute and change under these terms.
626
-
627
- To do so, attach the following notices to the program. It is safest
628
- to attach them to the start of each source file to most effectively
629
- state the exclusion of warranty; and each file should have at least
630
- the "copyright" line and a pointer to where the full notice is found.
631
-
632
- <one line to give the program's name and a brief idea of what it does.>
633
- Copyright (C) <year> <name of author>
634
-
635
- This program is free software: you can redistribute it and/or modify
636
- it under the terms of the GNU Affero General Public License as published
637
- by the Free Software Foundation, either version 3 of the License, or
638
- (at your option) any later version.
639
-
640
- This program is distributed in the hope that it will be useful,
641
- but WITHOUT ANY WARRANTY; without even the implied warranty of
642
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643
- GNU Affero General Public License for more details.
644
-
645
- You should have received a copy of the GNU Affero General Public License
646
- along with this program. If not, see <https://www.gnu.org/licenses/>.
647
-
648
- Also add information on how to contact you by electronic and paper mail.
649
-
650
- If your software can interact with users remotely through a computer
651
- network, you should also make sure that it provides a way for users to
652
- get its source. For example, if your program is a web application, its
653
- interface could display a "Source" link that leads users to an archive
654
- of the code. There are many ways you could offer source, and different
655
- solutions will be better for different programs; see section 13 for the
656
- specific requirements.
657
-
658
- You should also get your employer (if you work as a programmer) or school,
659
- if any, to sign a "copyright disclaimer" for the program, if necessary.
660
- For more information on this, and how to apply and follow the GNU AGPL, see
661
- <https://www.gnu.org/licenses/>.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/README.md DELETED
@@ -1,75 +0,0 @@
1
- # Stable Diffusion WebUI 3D Model&Pose Loader
2
- A custom extension for [AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) that allows you to load your local 3D model/animation inside webui, or edit pose as well, then send screenshot to txt2img or img2img as your ControlNet's reference image.
3
- ![1.png](doc/images/1.png)
4
- ![controlnet.png](doc/images/controlnet.png)
5
-
6
- ## Support formats
7
- Currently, it supports to load several types with two modes.
8
- **Single File mode**
9
- By the default, you can upload single file directly, support formats:
10
- 1. obj
11
- 2. stl
12
- 3. dae
13
- 4. fbx
14
- 5. vrm
15
- 6. glb - partly support, it fails on the model needs KTX2 textures (like [coffeemat.glb](https://github.com/mrdoob/three.js/blob/dev/examples/models/gltf/coffeemat.glb)), need to figure out how to fix later
16
- 7. gltf - partly support, it fails on the model has other resources (like [DamagedHelmet.gltf](https://github.com/mrdoob/three.js/tree/dev/examples/models/gltf/DamagedHelmet/glTF)), will fix later in Multi Files mode
17
-
18
- But it has potential to support more, since threejs does.
19
- So if you want other formats such as cmt, just feel free to open an issue, I will add it later.
20
- (I upload two models, **male02.obj** and **Sanba Dancing.fbx**, as your test, you can find them under **/models** folder)
21
-
22
- ## Pose support
23
- you can use Pose Panel to edit pose on VRM format.
24
- ![pose.png](doc/images/pose.png)
25
-
26
- ## Installation
27
- Just like you install other extension of webui:
28
- 1. go to Extensions -> Install from URL
29
- 2. paste this repo link
30
- 3. install
31
- 4. go to Installed, apply and restart UI
32
-
33
- Or you can install from Extensions -> Available, and load the official extension link, then you can find this extension on the list.
34
- ![installFromOfficialLink.png](doc/images/installFromOfficialLink.png)
35
-
36
- ## Settings
37
- Do not use configurations under Settings -> 3D Model, it would not work.
38
- I will remove them later.
39
-
40
- ## Settings from page
41
- There are 4 panels and several buttons on the page:
42
- 1. Model - allow you to load your local 3d model file.
43
- 2. Scene - control the canvas properties, list the objects in the scene
44
- 1. click **Refresh Scene Tree** if there is nothing
45
- 2. click **Scene** - to show up background color picker
46
- ![sceneColor.png](doc/images/sceneColor.png)
47
- 3. **visible checkbox** is available on _Directional Light_, _Ground_, _Grid_, _Axis_ and _mainObject_, you use it to show objects up or not
48
- ![sceneVisible.png](doc/images/sceneVisible.png)
49
- 4. **Operate radio button** is available on _Directional Light_, _Hemisphere Light_, and _mainObject_, you use it to translate or rotate object from scene (in fact, I will use this to rebuild pose editor later)
50
- ![sceneOperate.png](doc/images/sceneOperate.png)
51
- 5. click **Preview Camera** - show up Near, Far and FOV for camera
52
- ![sceneCamera.png](doc/images/sceneCamera.png)
53
- 3. Animation - control the FBX animation playing with progress bar here.
54
- ![animationPanel.png](doc/images/animationPanel.png)
55
- 4. Send To ControlNet - Send the current preview view of the 3D model on ControlNet in txt2img or img2img
56
- ![sendToControlNet.png](doc/images/sendToControlNet.png)
57
-
58
- ## Operation
59
- On the main tab of 3D Model Loader, you can use:
60
- 1. **Mouse left button** -> rotate the camera
61
- 2. **Mouse wheel** -> zoom in or out
62
- 3. **Mouse right button** -> move the camera
63
-
64
- ## Gradio.Model3D?
65
- I know gradio has its own 3D model component called **Gradio.Model3D**, but it only supports three formats: obj, glb and gltf, I think it is not enough, at least it should support FBX animation, so I build my own extension.
66
-
67
- ## Credits
68
- Created by [jtydhr88](https://github.com/jtydhr88) and special thanks to other contributors:
69
- - [missionfloyd](https://github.com/missionfloyd)
70
- - [chucktobbes](https://github.com/chucktobbes)
71
- - Everyone who gives feedback
72
-
73
- ## My other extension for Stable diffusion webui
74
- - [Canvas Editor](https://github.com/jtydhr88/sd-canvas-editor) A custom extension for AUTOMATIC1111/stable-diffusion-webui that integrated a full capability canvas editor which you can use layer, text, image, elements and so on, then send to ControlNet, basing on Polotno.
75
- - [StableStudio Adapter](https://github.com/jtydhr88/sd-webui-StableStudio) A custom extension for AUTOMATIC1111/stable-diffusion-webui to extend rest APIs to do some local operations, using in StableStudio.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/doc/images/1.png DELETED
Binary file (646 kB)
 
sd-3dmodel-loader/doc/images/animationPanel.png DELETED
Binary file (8.76 kB)
 
sd-3dmodel-loader/doc/images/buttons.png DELETED
Binary file (202 kB)
 
sd-3dmodel-loader/doc/images/canvasPanel.png DELETED
Binary file (35.8 kB)
 
sd-3dmodel-loader/doc/images/configureFromPage.png DELETED
Binary file (56.6 kB)
 
sd-3dmodel-loader/doc/images/configureFromSettings.png DELETED
Binary file (46.5 kB)
 
sd-3dmodel-loader/doc/images/controlnet.png DELETED
Binary file (157 kB)
 
sd-3dmodel-loader/doc/images/installFromOfficialLink.png DELETED
Binary file (231 kB)
 
sd-3dmodel-loader/doc/images/modelPanel.png DELETED
Binary file (15.1 kB)
 
sd-3dmodel-loader/doc/images/pose.png DELETED
Binary file (243 kB)
 
sd-3dmodel-loader/doc/images/sceneCamera.png DELETED
Binary file (29.2 kB)
 
sd-3dmodel-loader/doc/images/sceneColor.png DELETED
Binary file (100 kB)
 
sd-3dmodel-loader/doc/images/sceneOperate.png DELETED
Binary file (159 kB)
 
sd-3dmodel-loader/doc/images/sceneVisible.png DELETED
Binary file (23.6 kB)
 
sd-3dmodel-loader/doc/images/sendToControlNet.png DELETED
Binary file (13.1 kB)
 
sd-3dmodel-loader/doc/images/uploadSettingsPanel.png DELETED
Binary file (27.8 kB)
 
sd-3dmodel-loader/index.html DELETED
@@ -1,25 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <script async src="js/es-module-shims.js"></script>
6
- <script type="importmap">
7
- {
8
- "imports": {
9
- "threeDModelLoader": "./js/3d-model-loader.bundle.js"
10
- }
11
- }
12
-
13
- </script>
14
- <script type="esms-options">
15
- {
16
- "noLoadEventRetriggers": true
17
- }
18
-
19
-
20
- </script>
21
- </head>
22
- <body>
23
-
24
- </body>
25
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/javascript/3d-model-loader-import.js DELETED
@@ -1,40 +0,0 @@
1
- (function () {
2
- if (!globalThis.threeDModelLoader) globalThis.threeDModelLoader = {};
3
- const threeDModelLoader = globalThis.threeDModelLoader;
4
-
5
- function load(cont) {
6
- const scripts = cont.textContent.trim().split('\n');
7
- const base_path = `/file=${scripts.shift()}/js`;
8
- cont.textContent = '';
9
-
10
- const df = document.createDocumentFragment();
11
- for (let src of scripts) {
12
- const script = document.createElement('script');
13
- script.async = true;
14
- script.type = 'module';
15
- script.src = `file=${src}`;
16
- df.appendChild(script);
17
- }
18
-
19
- globalThis.threeDModelLoader.import = async () => {
20
- const threeDModelLoader = await import(`${base_path}/3d-model-loader.bundle.js`);
21
-
22
- return {threeDModelLoader};
23
- };
24
-
25
- if (!globalThis.threeDModelLoader.imports) {
26
- globalThis.threeDModelLoader.imports = {};
27
- }
28
-
29
- if (!globalThis.threeDModelLoader.imports.threeDModelLoader) {
30
- globalThis.threeDModelLoader.imports.threeDModelLoader = async () => await import(`${base_path}/3d-model-loader.bundle.js`);
31
- }
32
-
33
- cont.appendChild(df);
34
- }
35
-
36
- onUiLoaded(function () {
37
- webGLOutputDiv3DModel = gradioApp().querySelector('#WebGL-output-3dmodel-import');
38
- load(webGLOutputDiv3DModel);
39
- })
40
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/javascript/lazyload/3d-model-loader-webui.js DELETED
@@ -1,116 +0,0 @@
1
- console.log('[3D Model Loader] loading...');
2
-
3
- async function _import() {
4
- if (!globalThis.threeDModelLoader || !globalThis.threeDModelLoader.import) {
5
- return await import('threeDModelLoader');
6
- } else {
7
- return await globalThis.threeDModelLoader.imports.threeDModelLoader();
8
- }
9
- }
10
-
11
- await _import();
12
-
13
- (async function () {
14
- const container = gradioApp().querySelector('#threeDModelLoader-container');
15
-
16
- const parent = container.parentNode;
17
- parent.classList.remove("prose");
18
-
19
- const controlNetNumInput = gradioApp().querySelector('#threeDModelLoader-control-net-num');
20
- const controlNetNum = controlNetNumInput.value;
21
-
22
- async function init_canvas() {
23
- create3dmodelLoaderApp({container: container, controlNetNum: controlNetNum});
24
-
25
- setSendImageFunc3dmodel(sendImage);
26
- }
27
-
28
- await init_canvas();
29
-
30
- function sendImage(type, index, dt) {
31
- const selector = type === "txt2img" ? "#txt2img_script_container" : "#img2img_script_container";
32
-
33
- if (type === "txt2img") {
34
- switch_to_txt2img();
35
- } else if (type === "img2img") {
36
- switch_to_img2img();
37
- }
38
-
39
- let container = gradioApp().querySelector(selector);
40
-
41
- let element = container.querySelector('#controlnet');
42
-
43
- if (!element) {
44
- for (const spans of container.querySelectorAll < HTMLSpanElement > (
45
- '.cursor-pointer > span'
46
- )) {
47
- if (!spans.textContent?.includes('ControlNet')) {
48
- continue
49
- }
50
- if (spans.textContent?.includes('M2M')) {
51
- continue
52
- }
53
- element = spans.parentElement?.parentElement
54
- }
55
- if (!element) {
56
- console.error('ControlNet element not found')
57
- return
58
- }
59
- }
60
-
61
- const imageElems = element.querySelectorAll('div[data-testid="image"]')
62
-
63
- if (!imageElems[Number(index)]) {
64
- let accordion = element.querySelector('.icon');
65
-
66
- if (accordion) {
67
- accordion.click();
68
-
69
- let controlNetAppeared = false;
70
-
71
- let observer = new MutationObserver(function (mutations) {
72
- mutations.forEach(function (mutation) {
73
- if (mutation.type === "childList" && mutation.addedNodes.length > 0) {
74
- for (let i = 0; i < mutation.addedNodes.length; i++) {
75
- if (mutation.addedNodes[i].tagName === "INPUT") {
76
-
77
- controlNetAppeared = true;
78
-
79
- const imageElems2 = element.querySelectorAll('div[data-testid="image"]');
80
-
81
- updateGradioImage(imageElems2[Number(index)], dt);
82
-
83
- observer.disconnect();
84
-
85
- return;
86
- }
87
- }
88
- }
89
- });
90
- });
91
-
92
- observer.observe(element, {childList: true, subtree: true});
93
- }
94
- } else {
95
- updateGradioImage(imageElems[Number(index)], dt);
96
- }
97
- }
98
-
99
- function updateGradioImage(element, dt) {
100
- let clearButton = element.querySelector("button[aria-label='Clear']");
101
-
102
- if (clearButton) {
103
- clearButton.click();
104
- }
105
-
106
- const input = element.querySelector("input[type='file']");
107
- input.value = ''
108
- input.files = dt.files
109
- input.dispatchEvent(
110
- new Event('change', {
111
- bubbles: true,
112
- composed: true,
113
- })
114
- )
115
- }
116
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/js/3d-model-loader.bundle.js DELETED
The diff for this file is too large to render. See raw diff
 
sd-3dmodel-loader/js/draco_decoder.js DELETED
The diff for this file is too large to render. See raw diff
 
sd-3dmodel-loader/js/draco_decoder.wasm DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:92322d1cabaa55c8e216c983e58670043b063af59d86a7b6ae8201452ff7987f
3
- size 281481
 
 
 
 
sd-3dmodel-loader/js/draco_encoder.js DELETED
The diff for this file is too large to render. See raw diff
 
sd-3dmodel-loader/js/draco_wasm_wrapper.js DELETED
@@ -1,104 +0,0 @@
1
- var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(f){var m=0;return function(){return m<f.length?{done:!1,value:f[m++]}:{done:!0}}};$jscomp.arrayIterator=function(f){return{next:$jscomp.arrayIteratorImpl(f)}};$jscomp.makeIterator=function(f){var m="undefined"!=typeof Symbol&&Symbol.iterator&&f[Symbol.iterator];return m?m.call(f):$jscomp.arrayIterator(f)};
2
- $jscomp.getGlobal=function(f){return"undefined"!=typeof window&&window===f?f:"undefined"!=typeof global&&null!=global?global:f};$jscomp.global=$jscomp.getGlobal(this);$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(f,m,v){f!=Array.prototype&&f!=Object.prototype&&(f[m]=v.value)};
3
- $jscomp.polyfill=function(f,m,v,t){if(m){v=$jscomp.global;f=f.split(".");for(t=0;t<f.length-1;t++){var h=f[t];h in v||(v[h]={});v=v[h]}f=f[f.length-1];t=v[f];m=m(t);m!=t&&null!=m&&$jscomp.defineProperty(v,f,{configurable:!0,writable:!0,value:m})}};$jscomp.FORCE_POLYFILL_PROMISE=!1;
4
- $jscomp.polyfill("Promise",function(f){function m(){this.batch_=null}function v(e){return e instanceof h?e:new h(function(l,f){l(e)})}if(f&&!$jscomp.FORCE_POLYFILL_PROMISE)return f;m.prototype.asyncExecute=function(e){if(null==this.batch_){this.batch_=[];var l=this;this.asyncExecuteFunction(function(){l.executeBatch_()})}this.batch_.push(e)};var t=$jscomp.global.setTimeout;m.prototype.asyncExecuteFunction=function(e){t(e,0)};m.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var e=
5
- this.batch_;this.batch_=[];for(var l=0;l<e.length;++l){var f=e[l];e[l]=null;try{f()}catch(z){this.asyncThrow_(z)}}}this.batch_=null};m.prototype.asyncThrow_=function(e){this.asyncExecuteFunction(function(){throw e;})};var h=function(e){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var l=this.createResolveAndReject_();try{e(l.resolve,l.reject)}catch(S){l.reject(S)}};h.prototype.createResolveAndReject_=function(){function e(e){return function(h){f||(f=!0,e.call(l,h))}}var l=this,f=!1;
6
- return{resolve:e(this.resolveTo_),reject:e(this.reject_)}};h.prototype.resolveTo_=function(e){if(e===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof h)this.settleSameAsPromise_(e);else{a:switch(typeof e){case "object":var l=null!=e;break a;case "function":l=!0;break a;default:l=!1}l?this.resolveToNonPromiseObj_(e):this.fulfill_(e)}};h.prototype.resolveToNonPromiseObj_=function(e){var l=void 0;try{l=e.then}catch(S){this.reject_(S);return}"function"==typeof l?
7
- this.settleSameAsThenable_(l,e):this.fulfill_(e)};h.prototype.reject_=function(e){this.settle_(2,e)};h.prototype.fulfill_=function(e){this.settle_(1,e)};h.prototype.settle_=function(e,l){if(0!=this.state_)throw Error("Cannot settle("+e+", "+l+"): Promise already settled in state"+this.state_);this.state_=e;this.result_=l;this.executeOnSettledCallbacks_()};h.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var e=0;e<this.onSettledCallbacks_.length;++e)X.asyncExecute(this.onSettledCallbacks_[e]);
8
- this.onSettledCallbacks_=null}};var X=new m;h.prototype.settleSameAsPromise_=function(e){var l=this.createResolveAndReject_();e.callWhenSettled_(l.resolve,l.reject)};h.prototype.settleSameAsThenable_=function(e,l){var f=this.createResolveAndReject_();try{e.call(l,f.resolve,f.reject)}catch(z){f.reject(z)}};h.prototype.then=function(e,f){function l(e,f){return"function"==typeof e?function(f){try{m(e(f))}catch(p){v(p)}}:f}var m,v,t=new h(function(e,f){m=e;v=f});this.callWhenSettled_(l(e,m),l(f,v));return t};
9
- h.prototype.catch=function(e){return this.then(void 0,e)};h.prototype.callWhenSettled_=function(e,f){function l(){switch(h.state_){case 1:e(h.result_);break;case 2:f(h.result_);break;default:throw Error("Unexpected state: "+h.state_);}}var h=this;null==this.onSettledCallbacks_?X.asyncExecute(l):this.onSettledCallbacks_.push(l)};h.resolve=v;h.reject=function(e){return new h(function(f,h){h(e)})};h.race=function(e){return new h(function(f,h){for(var l=$jscomp.makeIterator(e),m=l.next();!m.done;m=l.next())v(m.value).callWhenSettled_(f,
10
- h)})};h.all=function(e){var f=$jscomp.makeIterator(e),m=f.next();return m.done?v([]):new h(function(e,h){function l(f){return function(h){t[f]=h;z--;0==z&&e(t)}}var t=[],z=0;do t.push(void 0),z++,v(m.value).callWhenSettled_(l(t.length-1),h),m=f.next();while(!m.done)})};return h},"es6","es3");
11
- var DracoDecoderModule=function(){var f="undefined"!==typeof document&&document.currentScript?document.currentScript.src:void 0;"undefined"!==typeof __filename&&(f=f||__filename);return function(m){function v(k){return a.locateFile?a.locateFile(k,M):M+k}function t(a,c){a||z("Assertion failed: "+c)}function h(a,c,b){var d=c+b;for(b=c;a[b]&&!(b>=d);)++b;if(16<b-c&&a.subarray&&xa)return xa.decode(a.subarray(c,b));for(d="";c<b;){var k=a[c++];if(k&128){var e=a[c++]&63;if(192==(k&224))d+=String.fromCharCode((k&
12
- 31)<<6|e);else{var f=a[c++]&63;k=224==(k&240)?(k&15)<<12|e<<6|f:(k&7)<<18|e<<12|f<<6|a[c++]&63;65536>k?d+=String.fromCharCode(k):(k-=65536,d+=String.fromCharCode(55296|k>>10,56320|k&1023))}}else d+=String.fromCharCode(k)}return d}function X(a,c){return a?h(ca,a,c):""}function e(a,c){0<a%c&&(a+=c-a%c);return a}function l(k){ka=k;a.HEAP8=T=new Int8Array(k);a.HEAP16=new Int16Array(k);a.HEAP32=P=new Int32Array(k);a.HEAPU8=ca=new Uint8Array(k);a.HEAPU16=new Uint16Array(k);a.HEAPU32=new Uint32Array(k);
13
- a.HEAPF32=new Float32Array(k);a.HEAPF64=new Float64Array(k)}function S(k){for(;0<k.length;){var c=k.shift();if("function"==typeof c)c();else{var b=c.func;"number"===typeof b?void 0===c.arg?a.dynCall_v(b):a.dynCall_vi(b,c.arg):b(void 0===c.arg?null:c.arg)}}}function z(k){if(a.onAbort)a.onAbort(k);k+="";ya(k);Y(k);za=!0;throw new WebAssembly.RuntimeError("abort("+k+"). Build with -s ASSERTIONS=1 for more info.");}function va(a){return String.prototype.startsWith?a.startsWith("data:application/octet-stream;base64,"):
14
- 0===a.indexOf("data:application/octet-stream;base64,")}function wa(){try{if(da)return new Uint8Array(da);if(la)return la(U);throw"both async and sync fetching of the wasm failed";}catch(k){z(k)}}function Ma(){return da||!ea&&!Z||"function"!==typeof fetch?new Promise(function(a,c){a(wa())}):fetch(U,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+U+"'";return a.arrayBuffer()}).catch(function(){return wa()})}function ba(){if(!ba.strings){var a={USER:"web_user",
15
- LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"===typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:na},c;for(c in Aa)a[c]=Aa[c];var b=[];for(c in a)b.push(c+"="+a[c]);ba.strings=b}return ba.strings}function ma(k){function c(){if(!fa&&(fa=!0,!za)){Ba=!0;S(Ca);S(Da);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)Ea.unshift(a.postRun.shift());
16
- S(Ea)}}if(!(0<aa)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)Fa.unshift(a.preRun.shift());S(Fa);0<aa||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);c()},1)):c())}}function p(){}function u(a){return(a||p).__cache__}function N(a,c){var b=u(c),d=b[a];if(d)return d;d=Object.create((c||p).prototype);d.ptr=a;return b[a]=d}function V(a){if("string"===typeof a){for(var c=0,b=0;b<a.length;++b){var d=a.charCodeAt(b);
17
- 55296<=d&&57343>=d&&(d=65536+((d&1023)<<10)|a.charCodeAt(++b)&1023);127>=d?++c:c=2047>=d?c+2:65535>=d?c+3:c+4}c=Array(c+1);b=0;d=c.length;if(0<d){d=b+d-1;for(var k=0;k<a.length;++k){var e=a.charCodeAt(k);if(55296<=e&&57343>=e){var f=a.charCodeAt(++k);e=65536+((e&1023)<<10)|f&1023}if(127>=e){if(b>=d)break;c[b++]=e}else{if(2047>=e){if(b+1>=d)break;c[b++]=192|e>>6}else{if(65535>=e){if(b+2>=d)break;c[b++]=224|e>>12}else{if(b+3>=d)break;c[b++]=240|e>>18;c[b++]=128|e>>12&63}c[b++]=128|e>>6&63}c[b++]=128|
18
- e&63}}c[b]=0}a=n.alloc(c,T);n.copy(c,T,a)}return a}function x(){throw"cannot construct a Status, no constructor in IDL";}function A(){this.ptr=Oa();u(A)[this.ptr]=this}function B(){this.ptr=Pa();u(B)[this.ptr]=this}function C(){this.ptr=Qa();u(C)[this.ptr]=this}function D(){this.ptr=Ra();u(D)[this.ptr]=this}function E(){this.ptr=Sa();u(E)[this.ptr]=this}function q(){this.ptr=Ta();u(q)[this.ptr]=this}function J(){this.ptr=Ua();u(J)[this.ptr]=this}function w(){this.ptr=Va();u(w)[this.ptr]=this}function F(){this.ptr=
19
- Wa();u(F)[this.ptr]=this}function r(){this.ptr=Xa();u(r)[this.ptr]=this}function G(){this.ptr=Ya();u(G)[this.ptr]=this}function H(){this.ptr=Za();u(H)[this.ptr]=this}function O(){this.ptr=$a();u(O)[this.ptr]=this}function K(){this.ptr=ab();u(K)[this.ptr]=this}function g(){this.ptr=bb();u(g)[this.ptr]=this}function y(){this.ptr=cb();u(y)[this.ptr]=this}function Q(){throw"cannot construct a VoidPtr, no constructor in IDL";}function I(){this.ptr=db();u(I)[this.ptr]=this}function L(){this.ptr=eb();u(L)[this.ptr]=
20
- this}m=m||{};var a="undefined"!==typeof m?m:{},Ga=!1,Ha=!1;a.onRuntimeInitialized=function(){Ga=!0;if(Ha&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.onModuleParsed=function(){Ha=!0;if(Ga&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.isVersionSupported=function(a){if("string"!==typeof a)return!1;a=a.split(".");return 2>a.length||3<a.length?!1:1==a[0]&&0<=a[1]&&3>=a[1]?!0:0!=a[0]||10<a[1]?!1:!0};var ha={},W;for(W in a)a.hasOwnProperty(W)&&(ha[W]=a[W]);var na="./this.program",
21
- ea=!1,Z=!1,oa=!1,fb=!1,Ia=!1;ea="object"===typeof window;Z="function"===typeof importScripts;oa=(fb="object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)&&!ea&&!Z;Ia=!ea&&!oa&&!Z;var M="",pa,qa;if(oa){M=__dirname+"/";var ra=function(a,c){pa||(pa=require("fs"));qa||(qa=require("path"));a=qa.normalize(a);return pa.readFileSync(a,c?null:"utf8")};var la=function(a){a=ra(a,!0);a.buffer||(a=new Uint8Array(a));t(a.buffer);return a};1<process.argv.length&&
22
- (na=process.argv[1].replace(/\\/g,"/"));process.argv.slice(2);process.on("uncaughtException",function(a){throw a;});process.on("unhandledRejection",z);a.inspect=function(){return"[Emscripten Module object]"}}else if(Ia)"undefined"!=typeof read&&(ra=function(a){return read(a)}),la=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));a=read(a,"binary");t("object"===typeof a);return a},"undefined"!==typeof print&&("undefined"===typeof console&&(console={}),console.log=print,
23
- console.warn=console.error="undefined"!==typeof printErr?printErr:print);else if(ea||Z)Z?M=self.location.href:document.currentScript&&(M=document.currentScript.src),f&&(M=f),M=0!==M.indexOf("blob:")?M.substr(0,M.lastIndexOf("/")+1):"",ra=function(a){var c=new XMLHttpRequest;c.open("GET",a,!1);c.send(null);return c.responseText},Z&&(la=function(a){var c=new XMLHttpRequest;c.open("GET",a,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)});var ya=a.print||console.log.bind(console),
24
- Y=a.printErr||console.warn.bind(console);for(W in ha)ha.hasOwnProperty(W)&&(a[W]=ha[W]);ha=null;a.thisProgram&&(na=a.thisProgram);var da;a.wasmBinary&&(da=a.wasmBinary);"object"!==typeof WebAssembly&&Y("no native wasm support detected");var ia,gb=new WebAssembly.Table({initial:381,maximum:381,element:"anyfunc"}),za=!1,xa="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;"undefined"!==typeof TextDecoder&&new TextDecoder("utf-16le");var T,ca,P,Ja=a.TOTAL_MEMORY||16777216;if(ia=a.wasmMemory?
25
- a.wasmMemory:new WebAssembly.Memory({initial:Ja/65536}))var ka=ia.buffer;Ja=ka.byteLength;l(ka);P[4604]=5261456;var Fa=[],Ca=[],Da=[],Ea=[],Ba=!1,aa=0,sa=null,ja=null;a.preloadedImages={};a.preloadedAudios={};var U="draco_decoder.wasm";va(U)||(U=v(U));Ca.push({func:function(){hb()}});var Aa={},R={buffers:[null,[],[]],printChar:function(a,c){var b=R.buffers[a];0===c||10===c?((1===a?ya:Y)(h(b,0)),b.length=0):b.push(c)},varargs:0,get:function(a){R.varargs+=4;return P[R.varargs-4>>2]},getStr:function(){return X(R.get())},
26
- get64:function(){var a=R.get();R.get();return a},getZero:function(){R.get()}},Ka={__cxa_allocate_exception:function(a){return ib(a)},__cxa_throw:function(a,c,b){"uncaught_exception"in ta?ta.uncaught_exceptions++:ta.uncaught_exceptions=1;throw a;},abort:function(){z()},emscripten_get_sbrk_ptr:function(){return 18416},emscripten_memcpy_big:function(a,c,b){ca.set(ca.subarray(c,c+b),a)},emscripten_resize_heap:function(a){if(2147418112<a)return!1;for(var c=Math.max(T.length,16777216);c<a;)c=536870912>=
27
- c?e(2*c,65536):Math.min(e((3*c+2147483648)/4,65536),2147418112);a:{try{ia.grow(c-ka.byteLength+65535>>16);l(ia.buffer);var b=1;break a}catch(d){}b=void 0}return b?!0:!1},environ_get:function(a,c){var b=0;ba().forEach(function(d,e){var f=c+b;e=P[a+4*e>>2]=f;for(f=0;f<d.length;++f)T[e++>>0]=d.charCodeAt(f);T[e>>0]=0;b+=d.length+1});return 0},environ_sizes_get:function(a,c){var b=ba();P[a>>2]=b.length;var d=0;b.forEach(function(a){d+=a.length+1});P[c>>2]=d;return 0},fd_close:function(a){return 0},fd_seek:function(a,
28
- c,b,d,e){return 0},fd_write:function(a,c,b,d){try{for(var e=0,f=0;f<b;f++){for(var g=P[c+8*f>>2],k=P[c+(8*f+4)>>2],h=0;h<k;h++)R.printChar(a,ca[g+h]);e+=k}P[d>>2]=e;return 0}catch(ua){return"undefined"!==typeof FS&&ua instanceof FS.ErrnoError||z(ua),ua.errno}},memory:ia,setTempRet0:function(a){},table:gb},La=function(){function e(c,b){a.asm=c.exports;aa--;a.monitorRunDependencies&&a.monitorRunDependencies(aa);0==aa&&(null!==sa&&(clearInterval(sa),sa=null),ja&&(c=ja,ja=null,c()))}function c(a){e(a.instance)}
29
- function b(a){return Ma().then(function(a){return WebAssembly.instantiate(a,d)}).then(a,function(a){Y("failed to asynchronously prepare wasm: "+a);z(a)})}var d={env:Ka,wasi_unstable:Ka};aa++;a.monitorRunDependencies&&a.monitorRunDependencies(aa);if(a.instantiateWasm)try{return a.instantiateWasm(d,e)}catch(Na){return Y("Module.instantiateWasm callback failed with error: "+Na),!1}(function(){if(da||"function"!==typeof WebAssembly.instantiateStreaming||va(U)||"function"!==typeof fetch)return b(c);fetch(U,
30
- {credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,d).then(c,function(a){Y("wasm streaming compile failed: "+a);Y("falling back to ArrayBuffer instantiation");b(c)})})})();return{}}();a.asm=La;var hb=a.___wasm_call_ctors=function(){return a.asm.__wasm_call_ctors.apply(null,arguments)},jb=a._emscripten_bind_Status_code_0=function(){return a.asm.emscripten_bind_Status_code_0.apply(null,arguments)},kb=a._emscripten_bind_Status_ok_0=function(){return a.asm.emscripten_bind_Status_ok_0.apply(null,
31
- arguments)},lb=a._emscripten_bind_Status_error_msg_0=function(){return a.asm.emscripten_bind_Status_error_msg_0.apply(null,arguments)},mb=a._emscripten_bind_Status___destroy___0=function(){return a.asm.emscripten_bind_Status___destroy___0.apply(null,arguments)},Oa=a._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=function(){return a.asm.emscripten_bind_DracoUInt16Array_DracoUInt16Array_0.apply(null,arguments)},nb=a._emscripten_bind_DracoUInt16Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt16Array_GetValue_1.apply(null,
32
- arguments)},ob=a._emscripten_bind_DracoUInt16Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt16Array_size_0.apply(null,arguments)},pb=a._emscripten_bind_DracoUInt16Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt16Array___destroy___0.apply(null,arguments)},Pa=a._emscripten_bind_PointCloud_PointCloud_0=function(){return a.asm.emscripten_bind_PointCloud_PointCloud_0.apply(null,arguments)},qb=a._emscripten_bind_PointCloud_num_attributes_0=function(){return a.asm.emscripten_bind_PointCloud_num_attributes_0.apply(null,
33
- arguments)},rb=a._emscripten_bind_PointCloud_num_points_0=function(){return a.asm.emscripten_bind_PointCloud_num_points_0.apply(null,arguments)},sb=a._emscripten_bind_PointCloud___destroy___0=function(){return a.asm.emscripten_bind_PointCloud___destroy___0.apply(null,arguments)},Qa=a._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=function(){return a.asm.emscripten_bind_DracoUInt8Array_DracoUInt8Array_0.apply(null,arguments)},tb=a._emscripten_bind_DracoUInt8Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt8Array_GetValue_1.apply(null,
34
- arguments)},ub=a._emscripten_bind_DracoUInt8Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt8Array_size_0.apply(null,arguments)},vb=a._emscripten_bind_DracoUInt8Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt8Array___destroy___0.apply(null,arguments)},Ra=a._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=function(){return a.asm.emscripten_bind_DracoUInt32Array_DracoUInt32Array_0.apply(null,arguments)},wb=a._emscripten_bind_DracoUInt32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt32Array_GetValue_1.apply(null,
35
- arguments)},xb=a._emscripten_bind_DracoUInt32Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt32Array_size_0.apply(null,arguments)},yb=a._emscripten_bind_DracoUInt32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt32Array___destroy___0.apply(null,arguments)},Sa=a._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0.apply(null,arguments)},zb=a._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=
36
- function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1.apply(null,arguments)},Ab=a._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_quantization_bits_0.apply(null,arguments)},Bb=a._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform___destroy___0.apply(null,arguments)},Ta=a._emscripten_bind_PointAttribute_PointAttribute_0=
37
- function(){return a.asm.emscripten_bind_PointAttribute_PointAttribute_0.apply(null,arguments)},Cb=a._emscripten_bind_PointAttribute_size_0=function(){return a.asm.emscripten_bind_PointAttribute_size_0.apply(null,arguments)},Db=a._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return a.asm.emscripten_bind_PointAttribute_GetAttributeTransformData_0.apply(null,arguments)},Eb=a._emscripten_bind_PointAttribute_attribute_type_0=function(){return a.asm.emscripten_bind_PointAttribute_attribute_type_0.apply(null,
38
- arguments)},Fb=a._emscripten_bind_PointAttribute_data_type_0=function(){return a.asm.emscripten_bind_PointAttribute_data_type_0.apply(null,arguments)},Gb=a._emscripten_bind_PointAttribute_num_components_0=function(){return a.asm.emscripten_bind_PointAttribute_num_components_0.apply(null,arguments)},Hb=a._emscripten_bind_PointAttribute_normalized_0=function(){return a.asm.emscripten_bind_PointAttribute_normalized_0.apply(null,arguments)},Ib=a._emscripten_bind_PointAttribute_byte_stride_0=function(){return a.asm.emscripten_bind_PointAttribute_byte_stride_0.apply(null,
39
- arguments)},Jb=a._emscripten_bind_PointAttribute_byte_offset_0=function(){return a.asm.emscripten_bind_PointAttribute_byte_offset_0.apply(null,arguments)},Kb=a._emscripten_bind_PointAttribute_unique_id_0=function(){return a.asm.emscripten_bind_PointAttribute_unique_id_0.apply(null,arguments)},Lb=a._emscripten_bind_PointAttribute___destroy___0=function(){return a.asm.emscripten_bind_PointAttribute___destroy___0.apply(null,arguments)},Ua=a._emscripten_bind_AttributeTransformData_AttributeTransformData_0=
40
- function(){return a.asm.emscripten_bind_AttributeTransformData_AttributeTransformData_0.apply(null,arguments)},Mb=a._emscripten_bind_AttributeTransformData_transform_type_0=function(){return a.asm.emscripten_bind_AttributeTransformData_transform_type_0.apply(null,arguments)},Nb=a._emscripten_bind_AttributeTransformData___destroy___0=function(){return a.asm.emscripten_bind_AttributeTransformData___destroy___0.apply(null,arguments)},Va=a._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=
41
- function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0.apply(null,arguments)},Ob=a._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1.apply(null,arguments)},Pb=a._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_quantization_bits_0.apply(null,arguments)},
42
- Qb=a._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_min_value_1.apply(null,arguments)},Rb=a._emscripten_bind_AttributeQuantizationTransform_range_0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_range_0.apply(null,arguments)},Sb=a._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform___destroy___0.apply(null,arguments)},
43
- Wa=a._emscripten_bind_DracoInt8Array_DracoInt8Array_0=function(){return a.asm.emscripten_bind_DracoInt8Array_DracoInt8Array_0.apply(null,arguments)},Tb=a._emscripten_bind_DracoInt8Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoInt8Array_GetValue_1.apply(null,arguments)},Ub=a._emscripten_bind_DracoInt8Array_size_0=function(){return a.asm.emscripten_bind_DracoInt8Array_size_0.apply(null,arguments)},Vb=a._emscripten_bind_DracoInt8Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt8Array___destroy___0.apply(null,
44
- arguments)},Xa=a._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return a.asm.emscripten_bind_MetadataQuerier_MetadataQuerier_0.apply(null,arguments)},Wb=a._emscripten_bind_MetadataQuerier_HasEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_HasEntry_2.apply(null,arguments)},Xb=a._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetIntEntry_2.apply(null,arguments)},Yb=a._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=
45
- function(){return a.asm.emscripten_bind_MetadataQuerier_GetIntEntryArray_3.apply(null,arguments)},Zb=a._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetDoubleEntry_2.apply(null,arguments)},$b=a._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetStringEntry_2.apply(null,arguments)},ac=a._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return a.asm.emscripten_bind_MetadataQuerier_NumEntries_1.apply(null,
46
- arguments)},bc=a._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetEntryName_2.apply(null,arguments)},cc=a._emscripten_bind_MetadataQuerier___destroy___0=function(){return a.asm.emscripten_bind_MetadataQuerier___destroy___0.apply(null,arguments)},Ya=a._emscripten_bind_DracoInt16Array_DracoInt16Array_0=function(){return a.asm.emscripten_bind_DracoInt16Array_DracoInt16Array_0.apply(null,arguments)},dc=a._emscripten_bind_DracoInt16Array_GetValue_1=
47
- function(){return a.asm.emscripten_bind_DracoInt16Array_GetValue_1.apply(null,arguments)},ec=a._emscripten_bind_DracoInt16Array_size_0=function(){return a.asm.emscripten_bind_DracoInt16Array_size_0.apply(null,arguments)},fc=a._emscripten_bind_DracoInt16Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt16Array___destroy___0.apply(null,arguments)},Za=a._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return a.asm.emscripten_bind_DracoFloat32Array_DracoFloat32Array_0.apply(null,
48
- arguments)},gc=a._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoFloat32Array_GetValue_1.apply(null,arguments)},hc=a._emscripten_bind_DracoFloat32Array_size_0=function(){return a.asm.emscripten_bind_DracoFloat32Array_size_0.apply(null,arguments)},ic=a._emscripten_bind_DracoFloat32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoFloat32Array___destroy___0.apply(null,arguments)},$a=a._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return a.asm.emscripten_bind_GeometryAttribute_GeometryAttribute_0.apply(null,
49
- arguments)},jc=a._emscripten_bind_GeometryAttribute___destroy___0=function(){return a.asm.emscripten_bind_GeometryAttribute___destroy___0.apply(null,arguments)},ab=a._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return a.asm.emscripten_bind_DecoderBuffer_DecoderBuffer_0.apply(null,arguments)},kc=a._emscripten_bind_DecoderBuffer_Init_2=function(){return a.asm.emscripten_bind_DecoderBuffer_Init_2.apply(null,arguments)},lc=a._emscripten_bind_DecoderBuffer___destroy___0=function(){return a.asm.emscripten_bind_DecoderBuffer___destroy___0.apply(null,
50
- arguments)},bb=a._emscripten_bind_Decoder_Decoder_0=function(){return a.asm.emscripten_bind_Decoder_Decoder_0.apply(null,arguments)},mc=a._emscripten_bind_Decoder_GetEncodedGeometryType_1=function(){return a.asm.emscripten_bind_Decoder_GetEncodedGeometryType_1.apply(null,arguments)},nc=a._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=function(){return a.asm.emscripten_bind_Decoder_DecodeBufferToPointCloud_2.apply(null,arguments)},oc=a._emscripten_bind_Decoder_DecodeBufferToMesh_2=function(){return a.asm.emscripten_bind_Decoder_DecodeBufferToMesh_2.apply(null,
51
- arguments)},pc=a._emscripten_bind_Decoder_GetAttributeId_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeId_2.apply(null,arguments)},qc=a._emscripten_bind_Decoder_GetAttributeIdByName_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIdByName_2.apply(null,arguments)},rc=a._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3.apply(null,arguments)},sc=a._emscripten_bind_Decoder_GetAttribute_2=
52
- function(){return a.asm.emscripten_bind_Decoder_GetAttribute_2.apply(null,arguments)},tc=a._emscripten_bind_Decoder_GetAttributeByUniqueId_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeByUniqueId_2.apply(null,arguments)},uc=a._emscripten_bind_Decoder_GetMetadata_1=function(){return a.asm.emscripten_bind_Decoder_GetMetadata_1.apply(null,arguments)},vc=a._emscripten_bind_Decoder_GetAttributeMetadata_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeMetadata_2.apply(null,
53
- arguments)},wc=a._emscripten_bind_Decoder_GetFaceFromMesh_3=function(){return a.asm.emscripten_bind_Decoder_GetFaceFromMesh_3.apply(null,arguments)},xc=a._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return a.asm.emscripten_bind_Decoder_GetTriangleStripsFromMesh_2.apply(null,arguments)},yc=a._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=function(){return a.asm.emscripten_bind_Decoder_GetTrianglesUInt16Array_3.apply(null,arguments)},zc=a._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=
54
- function(){return a.asm.emscripten_bind_Decoder_GetTrianglesUInt32Array_3.apply(null,arguments)},Ac=a._emscripten_bind_Decoder_GetAttributeFloat_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeFloat_3.apply(null,arguments)},Bc=a._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3.apply(null,arguments)},Cc=a._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIntForAllPoints_3.apply(null,
55
- arguments)},Dc=a._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3.apply(null,arguments)},Ec=a._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3.apply(null,arguments)},Fc=a._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3.apply(null,arguments)},
56
- Gc=a._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3.apply(null,arguments)},Hc=a._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3.apply(null,arguments)},Ic=a._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3.apply(null,arguments)},Jc=
57
- a._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=function(){return a.asm.emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5.apply(null,arguments)},Kc=a._emscripten_bind_Decoder_SkipAttributeTransform_1=function(){return a.asm.emscripten_bind_Decoder_SkipAttributeTransform_1.apply(null,arguments)},Lc=a._emscripten_bind_Decoder___destroy___0=function(){return a.asm.emscripten_bind_Decoder___destroy___0.apply(null,arguments)},cb=a._emscripten_bind_Mesh_Mesh_0=function(){return a.asm.emscripten_bind_Mesh_Mesh_0.apply(null,
58
- arguments)},Mc=a._emscripten_bind_Mesh_num_faces_0=function(){return a.asm.emscripten_bind_Mesh_num_faces_0.apply(null,arguments)},Nc=a._emscripten_bind_Mesh_num_attributes_0=function(){return a.asm.emscripten_bind_Mesh_num_attributes_0.apply(null,arguments)},Oc=a._emscripten_bind_Mesh_num_points_0=function(){return a.asm.emscripten_bind_Mesh_num_points_0.apply(null,arguments)},Pc=a._emscripten_bind_Mesh___destroy___0=function(){return a.asm.emscripten_bind_Mesh___destroy___0.apply(null,arguments)},
59
- Qc=a._emscripten_bind_VoidPtr___destroy___0=function(){return a.asm.emscripten_bind_VoidPtr___destroy___0.apply(null,arguments)},db=a._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return a.asm.emscripten_bind_DracoInt32Array_DracoInt32Array_0.apply(null,arguments)},Rc=a._emscripten_bind_DracoInt32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoInt32Array_GetValue_1.apply(null,arguments)},Sc=a._emscripten_bind_DracoInt32Array_size_0=function(){return a.asm.emscripten_bind_DracoInt32Array_size_0.apply(null,
60
- arguments)},Tc=a._emscripten_bind_DracoInt32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt32Array___destroy___0.apply(null,arguments)},eb=a._emscripten_bind_Metadata_Metadata_0=function(){return a.asm.emscripten_bind_Metadata_Metadata_0.apply(null,arguments)},Uc=a._emscripten_bind_Metadata___destroy___0=function(){return a.asm.emscripten_bind_Metadata___destroy___0.apply(null,arguments)},Vc=a._emscripten_enum_draco_StatusCode_OK=function(){return a.asm.emscripten_enum_draco_StatusCode_OK.apply(null,
61
- arguments)},Wc=a._emscripten_enum_draco_StatusCode_DRACO_ERROR=function(){return a.asm.emscripten_enum_draco_StatusCode_DRACO_ERROR.apply(null,arguments)},Xc=a._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return a.asm.emscripten_enum_draco_StatusCode_IO_ERROR.apply(null,arguments)},Yc=a._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return a.asm.emscripten_enum_draco_StatusCode_INVALID_PARAMETER.apply(null,arguments)},Zc=a._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=
62
- function(){return a.asm.emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION.apply(null,arguments)},$c=a._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return a.asm.emscripten_enum_draco_StatusCode_UNKNOWN_VERSION.apply(null,arguments)},ad=a._emscripten_enum_draco_DataType_DT_INVALID=function(){return a.asm.emscripten_enum_draco_DataType_DT_INVALID.apply(null,arguments)},bd=a._emscripten_enum_draco_DataType_DT_INT8=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT8.apply(null,
63
- arguments)},cd=a._emscripten_enum_draco_DataType_DT_UINT8=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT8.apply(null,arguments)},dd=a._emscripten_enum_draco_DataType_DT_INT16=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT16.apply(null,arguments)},ed=a._emscripten_enum_draco_DataType_DT_UINT16=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT16.apply(null,arguments)},fd=a._emscripten_enum_draco_DataType_DT_INT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT32.apply(null,
64
- arguments)},gd=a._emscripten_enum_draco_DataType_DT_UINT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT32.apply(null,arguments)},hd=a._emscripten_enum_draco_DataType_DT_INT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT64.apply(null,arguments)},id=a._emscripten_enum_draco_DataType_DT_UINT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT64.apply(null,arguments)},jd=a._emscripten_enum_draco_DataType_DT_FLOAT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_FLOAT32.apply(null,
65
- arguments)},kd=a._emscripten_enum_draco_DataType_DT_FLOAT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_FLOAT64.apply(null,arguments)},ld=a._emscripten_enum_draco_DataType_DT_BOOL=function(){return a.asm.emscripten_enum_draco_DataType_DT_BOOL.apply(null,arguments)},md=a._emscripten_enum_draco_DataType_DT_TYPES_COUNT=function(){return a.asm.emscripten_enum_draco_DataType_DT_TYPES_COUNT.apply(null,arguments)},nd=a._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE.apply(null,
66
- arguments)},od=a._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD.apply(null,arguments)},pd=a._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH.apply(null,arguments)},qd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM.apply(null,
67
- arguments)},rd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM.apply(null,arguments)},sd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM.apply(null,arguments)},td=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM.apply(null,
68
- arguments)},ud=a._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_INVALID.apply(null,arguments)},vd=a._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_POSITION.apply(null,arguments)},wd=a._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_NORMAL.apply(null,arguments)},xd=a._emscripten_enum_draco_GeometryAttribute_Type_COLOR=
69
- function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_COLOR.apply(null,arguments)},yd=a._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD.apply(null,arguments)},zd=a._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_GENERIC.apply(null,arguments)};a._setThrew=function(){return a.asm.setThrew.apply(null,arguments)};var ta=a.__ZSt18uncaught_exceptionv=
70
- function(){return a.asm._ZSt18uncaught_exceptionv.apply(null,arguments)};a._free=function(){return a.asm.free.apply(null,arguments)};var ib=a._malloc=function(){return a.asm.malloc.apply(null,arguments)};a.stackSave=function(){return a.asm.stackSave.apply(null,arguments)};a.stackAlloc=function(){return a.asm.stackAlloc.apply(null,arguments)};a.stackRestore=function(){return a.asm.stackRestore.apply(null,arguments)};a.__growWasmMemory=function(){return a.asm.__growWasmMemory.apply(null,arguments)};
71
- a.dynCall_ii=function(){return a.asm.dynCall_ii.apply(null,arguments)};a.dynCall_vi=function(){return a.asm.dynCall_vi.apply(null,arguments)};a.dynCall_iii=function(){return a.asm.dynCall_iii.apply(null,arguments)};a.dynCall_vii=function(){return a.asm.dynCall_vii.apply(null,arguments)};a.dynCall_iiii=function(){return a.asm.dynCall_iiii.apply(null,arguments)};a.dynCall_v=function(){return a.asm.dynCall_v.apply(null,arguments)};a.dynCall_viii=function(){return a.asm.dynCall_viii.apply(null,arguments)};
72
- a.dynCall_viiii=function(){return a.asm.dynCall_viiii.apply(null,arguments)};a.dynCall_iiiiiii=function(){return a.asm.dynCall_iiiiiii.apply(null,arguments)};a.dynCall_iidiiii=function(){return a.asm.dynCall_iidiiii.apply(null,arguments)};a.dynCall_jiji=function(){return a.asm.dynCall_jiji.apply(null,arguments)};a.dynCall_viiiiii=function(){return a.asm.dynCall_viiiiii.apply(null,arguments)};a.dynCall_viiiii=function(){return a.asm.dynCall_viiiii.apply(null,arguments)};a.asm=La;var fa;a.then=function(e){if(fa)e(a);
73
- else{var c=a.onRuntimeInitialized;a.onRuntimeInitialized=function(){c&&c();e(a)}}return a};ja=function c(){fa||ma();fa||(ja=c)};a.run=ma;if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();ma();p.prototype=Object.create(p.prototype);p.prototype.constructor=p;p.prototype.__class__=p;p.__cache__={};a.WrapperObject=p;a.getCache=u;a.wrapPointer=N;a.castObject=function(a,b){return N(a.ptr,b)};a.NULL=N(0);a.destroy=function(a){if(!a.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";
74
- a.__destroy__();delete u(a.__class__)[a.ptr]};a.compare=function(a,b){return a.ptr===b.ptr};a.getPointer=function(a){return a.ptr};a.getClass=function(a){return a.__class__};var n={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(n.needed){for(var c=0;c<n.temps.length;c++)a._free(n.temps[c]);n.temps.length=0;a._free(n.buffer);n.buffer=0;n.size+=n.needed;n.needed=0}n.buffer||(n.size+=128,n.buffer=a._malloc(n.size),t(n.buffer));n.pos=0},alloc:function(c,b){t(n.buffer);c=c.length*b.BYTES_PER_ELEMENT;
75
- c=c+7&-8;n.pos+c>=n.size?(t(0<c),n.needed+=c,b=a._malloc(c),n.temps.push(b)):(b=n.buffer+n.pos,n.pos+=c);return b},copy:function(a,b,d){switch(b.BYTES_PER_ELEMENT){case 2:d>>=1;break;case 4:d>>=2;break;case 8:d>>=3}for(var c=0;c<a.length;c++)b[d+c]=a[c]}};x.prototype=Object.create(p.prototype);x.prototype.constructor=x;x.prototype.__class__=x;x.__cache__={};a.Status=x;x.prototype.code=x.prototype.code=function(){return jb(this.ptr)};x.prototype.ok=x.prototype.ok=function(){return!!kb(this.ptr)};x.prototype.error_msg=
76
- x.prototype.error_msg=function(){return X(lb(this.ptr))};x.prototype.__destroy__=x.prototype.__destroy__=function(){mb(this.ptr)};A.prototype=Object.create(p.prototype);A.prototype.constructor=A;A.prototype.__class__=A;A.__cache__={};a.DracoUInt16Array=A;A.prototype.GetValue=A.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return nb(c,a)};A.prototype.size=A.prototype.size=function(){return ob(this.ptr)};A.prototype.__destroy__=A.prototype.__destroy__=function(){pb(this.ptr)};
77
- B.prototype=Object.create(p.prototype);B.prototype.constructor=B;B.prototype.__class__=B;B.__cache__={};a.PointCloud=B;B.prototype.num_attributes=B.prototype.num_attributes=function(){return qb(this.ptr)};B.prototype.num_points=B.prototype.num_points=function(){return rb(this.ptr)};B.prototype.__destroy__=B.prototype.__destroy__=function(){sb(this.ptr)};C.prototype=Object.create(p.prototype);C.prototype.constructor=C;C.prototype.__class__=C;C.__cache__={};a.DracoUInt8Array=C;C.prototype.GetValue=
78
- C.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return tb(c,a)};C.prototype.size=C.prototype.size=function(){return ub(this.ptr)};C.prototype.__destroy__=C.prototype.__destroy__=function(){vb(this.ptr)};D.prototype=Object.create(p.prototype);D.prototype.constructor=D;D.prototype.__class__=D;D.__cache__={};a.DracoUInt32Array=D;D.prototype.GetValue=D.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return wb(c,a)};D.prototype.size=D.prototype.size=
79
- function(){return xb(this.ptr)};D.prototype.__destroy__=D.prototype.__destroy__=function(){yb(this.ptr)};E.prototype=Object.create(p.prototype);E.prototype.constructor=E;E.prototype.__class__=E;E.__cache__={};a.AttributeOctahedronTransform=E;E.prototype.InitFromAttribute=E.prototype.InitFromAttribute=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return!!zb(c,a)};E.prototype.quantization_bits=E.prototype.quantization_bits=function(){return Ab(this.ptr)};E.prototype.__destroy__=E.prototype.__destroy__=
80
- function(){Bb(this.ptr)};q.prototype=Object.create(p.prototype);q.prototype.constructor=q;q.prototype.__class__=q;q.__cache__={};a.PointAttribute=q;q.prototype.size=q.prototype.size=function(){return Cb(this.ptr)};q.prototype.GetAttributeTransformData=q.prototype.GetAttributeTransformData=function(){return N(Db(this.ptr),J)};q.prototype.attribute_type=q.prototype.attribute_type=function(){return Eb(this.ptr)};q.prototype.data_type=q.prototype.data_type=function(){return Fb(this.ptr)};q.prototype.num_components=
81
- q.prototype.num_components=function(){return Gb(this.ptr)};q.prototype.normalized=q.prototype.normalized=function(){return!!Hb(this.ptr)};q.prototype.byte_stride=q.prototype.byte_stride=function(){return Ib(this.ptr)};q.prototype.byte_offset=q.prototype.byte_offset=function(){return Jb(this.ptr)};q.prototype.unique_id=q.prototype.unique_id=function(){return Kb(this.ptr)};q.prototype.__destroy__=q.prototype.__destroy__=function(){Lb(this.ptr)};J.prototype=Object.create(p.prototype);J.prototype.constructor=
82
- J;J.prototype.__class__=J;J.__cache__={};a.AttributeTransformData=J;J.prototype.transform_type=J.prototype.transform_type=function(){return Mb(this.ptr)};J.prototype.__destroy__=J.prototype.__destroy__=function(){Nb(this.ptr)};w.prototype=Object.create(p.prototype);w.prototype.constructor=w;w.prototype.__class__=w;w.__cache__={};a.AttributeQuantizationTransform=w;w.prototype.InitFromAttribute=w.prototype.InitFromAttribute=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return!!Ob(c,a)};
83
- w.prototype.quantization_bits=w.prototype.quantization_bits=function(){return Pb(this.ptr)};w.prototype.min_value=w.prototype.min_value=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Qb(c,a)};w.prototype.range=w.prototype.range=function(){return Rb(this.ptr)};w.prototype.__destroy__=w.prototype.__destroy__=function(){Sb(this.ptr)};F.prototype=Object.create(p.prototype);F.prototype.constructor=F;F.prototype.__class__=F;F.__cache__={};a.DracoInt8Array=F;F.prototype.GetValue=F.prototype.GetValue=
84
- function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Tb(c,a)};F.prototype.size=F.prototype.size=function(){return Ub(this.ptr)};F.prototype.__destroy__=F.prototype.__destroy__=function(){Vb(this.ptr)};r.prototype=Object.create(p.prototype);r.prototype.constructor=r;r.prototype.__class__=r;r.__cache__={};a.MetadataQuerier=r;r.prototype.HasEntry=r.prototype.HasEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return!!Wb(c,
85
- a,b)};r.prototype.GetIntEntry=r.prototype.GetIntEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return Xb(c,a,b)};r.prototype.GetIntEntryArray=r.prototype.GetIntEntryArray=function(a,b,d){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);d&&"object"===typeof d&&(d=d.ptr);Yb(c,a,b,d)};r.prototype.GetDoubleEntry=r.prototype.GetDoubleEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===
86
- typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return Zb(c,a,b)};r.prototype.GetStringEntry=r.prototype.GetStringEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return X($b(c,a,b))};r.prototype.NumEntries=r.prototype.NumEntries=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return ac(c,a)};r.prototype.GetEntryName=r.prototype.GetEntryName=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===
87
- typeof b&&(b=b.ptr);return X(bc(c,a,b))};r.prototype.__destroy__=r.prototype.__destroy__=function(){cc(this.ptr)};G.prototype=Object.create(p.prototype);G.prototype.constructor=G;G.prototype.__class__=G;G.__cache__={};a.DracoInt16Array=G;G.prototype.GetValue=G.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return dc(c,a)};G.prototype.size=G.prototype.size=function(){return ec(this.ptr)};G.prototype.__destroy__=G.prototype.__destroy__=function(){fc(this.ptr)};H.prototype=
88
- Object.create(p.prototype);H.prototype.constructor=H;H.prototype.__class__=H;H.__cache__={};a.DracoFloat32Array=H;H.prototype.GetValue=H.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return gc(c,a)};H.prototype.size=H.prototype.size=function(){return hc(this.ptr)};H.prototype.__destroy__=H.prototype.__destroy__=function(){ic(this.ptr)};O.prototype=Object.create(p.prototype);O.prototype.constructor=O;O.prototype.__class__=O;O.__cache__={};a.GeometryAttribute=O;O.prototype.__destroy__=
89
- O.prototype.__destroy__=function(){jc(this.ptr)};K.prototype=Object.create(p.prototype);K.prototype.constructor=K;K.prototype.__class__=K;K.__cache__={};a.DecoderBuffer=K;K.prototype.Init=K.prototype.Init=function(a,b){var c=this.ptr;n.prepare();if("object"==typeof a&&"object"===typeof a){var e=n.alloc(a,T);n.copy(a,T,e);a=e}b&&"object"===typeof b&&(b=b.ptr);kc(c,a,b)};K.prototype.__destroy__=K.prototype.__destroy__=function(){lc(this.ptr)};g.prototype=Object.create(p.prototype);g.prototype.constructor=
90
- g;g.prototype.__class__=g;g.__cache__={};a.Decoder=g;g.prototype.GetEncodedGeometryType=g.prototype.GetEncodedGeometryType=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return mc(c,a)};g.prototype.DecodeBufferToPointCloud=g.prototype.DecodeBufferToPointCloud=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(nc(c,a,b),x)};g.prototype.DecodeBufferToMesh=g.prototype.DecodeBufferToMesh=function(a,b){var c=this.ptr;a&&"object"===typeof a&&
91
- (a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(oc(c,a,b),x)};g.prototype.GetAttributeId=g.prototype.GetAttributeId=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return pc(c,a,b)};g.prototype.GetAttributeIdByName=g.prototype.GetAttributeIdByName=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return qc(c,a,b)};g.prototype.GetAttributeIdByMetadataEntry=g.prototype.GetAttributeIdByMetadataEntry=
92
- function(a,b,d){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);d=d&&"object"===typeof d?d.ptr:V(d);return rc(c,a,b,d)};g.prototype.GetAttribute=g.prototype.GetAttribute=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(sc(c,a,b),q)};g.prototype.GetAttributeByUniqueId=g.prototype.GetAttributeByUniqueId=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);
93
- return N(tc(c,a,b),q)};g.prototype.GetMetadata=g.prototype.GetMetadata=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return N(uc(c,a),L)};g.prototype.GetAttributeMetadata=g.prototype.GetAttributeMetadata=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(vc(c,a,b),L)};g.prototype.GetFaceFromMesh=g.prototype.GetFaceFromMesh=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===
94
- typeof d&&(d=d.ptr);return!!wc(c,a,b,d)};g.prototype.GetTriangleStripsFromMesh=g.prototype.GetTriangleStripsFromMesh=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return xc(c,a,b)};g.prototype.GetTrianglesUInt16Array=g.prototype.GetTrianglesUInt16Array=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!yc(c,a,b,d)};g.prototype.GetTrianglesUInt32Array=g.prototype.GetTrianglesUInt32Array=
95
- function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!zc(c,a,b,d)};g.prototype.GetAttributeFloat=g.prototype.GetAttributeFloat=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Ac(c,a,b,d)};g.prototype.GetAttributeFloatForAllPoints=g.prototype.GetAttributeFloatForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&
96
- (a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Bc(c,a,b,d)};g.prototype.GetAttributeIntForAllPoints=g.prototype.GetAttributeIntForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Cc(c,a,b,d)};g.prototype.GetAttributeInt8ForAllPoints=g.prototype.GetAttributeInt8ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&
97
- (b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Dc(c,a,b,d)};g.prototype.GetAttributeUInt8ForAllPoints=g.prototype.GetAttributeUInt8ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Ec(c,a,b,d)};g.prototype.GetAttributeInt16ForAllPoints=g.prototype.GetAttributeInt16ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&
98
- (d=d.ptr);return!!Fc(c,a,b,d)};g.prototype.GetAttributeUInt16ForAllPoints=g.prototype.GetAttributeUInt16ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Gc(c,a,b,d)};g.prototype.GetAttributeInt32ForAllPoints=g.prototype.GetAttributeInt32ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Hc(c,
99
- a,b,d)};g.prototype.GetAttributeUInt32ForAllPoints=g.prototype.GetAttributeUInt32ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Ic(c,a,b,d)};g.prototype.GetAttributeDataArrayForAllPoints=g.prototype.GetAttributeDataArrayForAllPoints=function(a,b,d,e,f){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);e&&"object"===typeof e&&
100
- (e=e.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Jc(c,a,b,d,e,f)};g.prototype.SkipAttributeTransform=g.prototype.SkipAttributeTransform=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);Kc(b,a)};g.prototype.__destroy__=g.prototype.__destroy__=function(){Lc(this.ptr)};y.prototype=Object.create(p.prototype);y.prototype.constructor=y;y.prototype.__class__=y;y.__cache__={};a.Mesh=y;y.prototype.num_faces=y.prototype.num_faces=function(){return Mc(this.ptr)};y.prototype.num_attributes=y.prototype.num_attributes=
101
- function(){return Nc(this.ptr)};y.prototype.num_points=y.prototype.num_points=function(){return Oc(this.ptr)};y.prototype.__destroy__=y.prototype.__destroy__=function(){Pc(this.ptr)};Q.prototype=Object.create(p.prototype);Q.prototype.constructor=Q;Q.prototype.__class__=Q;Q.__cache__={};a.VoidPtr=Q;Q.prototype.__destroy__=Q.prototype.__destroy__=function(){Qc(this.ptr)};I.prototype=Object.create(p.prototype);I.prototype.constructor=I;I.prototype.__class__=I;I.__cache__={};a.DracoInt32Array=I;I.prototype.GetValue=
102
- I.prototype.GetValue=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Rc(b,a)};I.prototype.size=I.prototype.size=function(){return Sc(this.ptr)};I.prototype.__destroy__=I.prototype.__destroy__=function(){Tc(this.ptr)};L.prototype=Object.create(p.prototype);L.prototype.constructor=L;L.prototype.__class__=L;L.__cache__={};a.Metadata=L;L.prototype.__destroy__=L.prototype.__destroy__=function(){Uc(this.ptr)};(function(){function c(){a.OK=Vc();a.DRACO_ERROR=Wc();a.IO_ERROR=Xc();a.INVALID_PARAMETER=
103
- Yc();a.UNSUPPORTED_VERSION=Zc();a.UNKNOWN_VERSION=$c();a.DT_INVALID=ad();a.DT_INT8=bd();a.DT_UINT8=cd();a.DT_INT16=dd();a.DT_UINT16=ed();a.DT_INT32=fd();a.DT_UINT32=gd();a.DT_INT64=hd();a.DT_UINT64=id();a.DT_FLOAT32=jd();a.DT_FLOAT64=kd();a.DT_BOOL=ld();a.DT_TYPES_COUNT=md();a.INVALID_GEOMETRY_TYPE=nd();a.POINT_CLOUD=od();a.TRIANGULAR_MESH=pd();a.ATTRIBUTE_INVALID_TRANSFORM=qd();a.ATTRIBUTE_NO_TRANSFORM=rd();a.ATTRIBUTE_QUANTIZATION_TRANSFORM=sd();a.ATTRIBUTE_OCTAHEDRON_TRANSFORM=td();a.INVALID=ud();
104
- a.POSITION=vd();a.NORMAL=wd();a.COLOR=xd();a.TEX_COORD=yd();a.GENERIC=zd()}Ba?c():Da.unshift(c)})();if("function"===typeof a.onModuleParsed)a.onModuleParsed();return m}}();"object"===typeof exports&&"object"===typeof module?module.exports=DracoDecoderModule:"function"===typeof define&&define.amd?define([],function(){return DracoDecoderModule}):"object"===typeof exports&&(exports.DracoDecoderModule=DracoDecoderModule);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/js/es-module-shims.js DELETED
@@ -1,789 +0,0 @@
1
- /* ES Module Shims 1.3.6 */
2
- (function () {
3
-
4
- const edge = navigator.userAgent.match(/Edge\/\d\d\.\d+$/);
5
-
6
- let baseUrl;
7
-
8
- function createBlob (source, type = 'text/javascript') {
9
- return URL.createObjectURL(new Blob([source], { type }));
10
- }
11
-
12
- const noop = () => {};
13
-
14
- const baseEl = document.querySelector('base[href]');
15
- if (baseEl)
16
- baseUrl = baseEl.href;
17
-
18
- if (!baseUrl && typeof location !== 'undefined') {
19
- baseUrl = location.href.split('#')[0].split('?')[0];
20
- const lastSepIndex = baseUrl.lastIndexOf('/');
21
- if (lastSepIndex !== -1)
22
- baseUrl = baseUrl.slice(0, lastSepIndex + 1);
23
- }
24
-
25
- function isURL (url) {
26
- try {
27
- new URL(url);
28
- return true;
29
- }
30
- catch {
31
- return false;
32
- }
33
- }
34
-
35
- const backslashRegEx = /\\/g;
36
- function resolveIfNotPlainOrUrl (relUrl, parentUrl) {
37
- // strip off any trailing query params or hashes
38
- parentUrl = parentUrl && parentUrl.split('#')[0].split('?')[0];
39
- if (relUrl.indexOf('\\') !== -1)
40
- relUrl = relUrl.replace(backslashRegEx, '/');
41
- // protocol-relative
42
- if (relUrl[0] === '/' && relUrl[1] === '/') {
43
- return parentUrl.slice(0, parentUrl.indexOf(':') + 1) + relUrl;
44
- }
45
- // relative-url
46
- else if (relUrl[0] === '.' && (relUrl[1] === '/' || relUrl[1] === '.' && (relUrl[2] === '/' || relUrl.length === 2 && (relUrl += '/')) ||
47
- relUrl.length === 1 && (relUrl += '/')) ||
48
- relUrl[0] === '/') {
49
- const parentProtocol = parentUrl.slice(0, parentUrl.indexOf(':') + 1);
50
- // Disabled, but these cases will give inconsistent results for deep backtracking
51
- //if (parentUrl[parentProtocol.length] !== '/')
52
- // throw new Error('Cannot resolve');
53
- // read pathname from parent URL
54
- // pathname taken to be part after leading "/"
55
- let pathname;
56
- if (parentUrl[parentProtocol.length + 1] === '/') {
57
- // resolving to a :// so we need to read out the auth and host
58
- if (parentProtocol !== 'file:') {
59
- pathname = parentUrl.slice(parentProtocol.length + 2);
60
- pathname = pathname.slice(pathname.indexOf('/') + 1);
61
- }
62
- else {
63
- pathname = parentUrl.slice(8);
64
- }
65
- }
66
- else {
67
- // resolving to :/ so pathname is the /... part
68
- pathname = parentUrl.slice(parentProtocol.length + (parentUrl[parentProtocol.length] === '/'));
69
- }
70
-
71
- if (relUrl[0] === '/')
72
- return parentUrl.slice(0, parentUrl.length - pathname.length - 1) + relUrl;
73
-
74
- // join together and split for removal of .. and . segments
75
- // looping the string instead of anything fancy for perf reasons
76
- // '../../../../../z' resolved to 'x/y' is just 'z'
77
- const segmented = pathname.slice(0, pathname.lastIndexOf('/') + 1) + relUrl;
78
-
79
- const output = [];
80
- let segmentIndex = -1;
81
- for (let i = 0; i < segmented.length; i++) {
82
- // busy reading a segment - only terminate on '/'
83
- if (segmentIndex !== -1) {
84
- if (segmented[i] === '/') {
85
- output.push(segmented.slice(segmentIndex, i + 1));
86
- segmentIndex = -1;
87
- }
88
- }
89
-
90
- // new segment - check if it is relative
91
- else if (segmented[i] === '.') {
92
- // ../ segment
93
- if (segmented[i + 1] === '.' && (segmented[i + 2] === '/' || i + 2 === segmented.length)) {
94
- output.pop();
95
- i += 2;
96
- }
97
- // ./ segment
98
- else if (segmented[i + 1] === '/' || i + 1 === segmented.length) {
99
- i += 1;
100
- }
101
- else {
102
- // the start of a new segment as below
103
- segmentIndex = i;
104
- }
105
- }
106
- // it is the start of a new segment
107
- else {
108
- segmentIndex = i;
109
- }
110
- }
111
- // finish reading out the last segment
112
- if (segmentIndex !== -1)
113
- output.push(segmented.slice(segmentIndex));
114
- return parentUrl.slice(0, parentUrl.length - pathname.length) + output.join('');
115
- }
116
- }
117
-
118
- /*
119
- * Import maps implementation
120
- *
121
- * To make lookups fast we pre-resolve the entire import map
122
- * and then match based on backtracked hash lookups
123
- *
124
- */
125
- function resolveUrl (relUrl, parentUrl) {
126
- return resolveIfNotPlainOrUrl(relUrl, parentUrl) || (relUrl.indexOf(':') !== -1 ? relUrl : resolveIfNotPlainOrUrl('./' + relUrl, parentUrl));
127
- }
128
-
129
- function resolveAndComposePackages (packages, outPackages, baseUrl, parentMap) {
130
- for (let p in packages) {
131
- const resolvedLhs = resolveIfNotPlainOrUrl(p, baseUrl) || p;
132
- if (outPackages[resolvedLhs]) {
133
- throw new Error(`Dynamic import map rejected: Overrides entry "${resolvedLhs}" from ${outPackages[resolvedLhs]} to ${packages[resolvedLhs]}.`);
134
- }
135
- let target = packages[p];
136
- if (typeof target !== 'string')
137
- continue;
138
- const mapped = resolveImportMap(parentMap, resolveIfNotPlainOrUrl(target, baseUrl) || target, baseUrl);
139
- if (mapped) {
140
- outPackages[resolvedLhs] = mapped;
141
- continue;
142
- }
143
- targetWarning(p, packages[p], 'bare specifier did not resolve');
144
- }
145
- }
146
-
147
- function resolveAndComposeImportMap (json, baseUrl, parentMap) {
148
- const outMap = { imports: Object.assign({}, parentMap.imports), scopes: Object.assign({}, parentMap.scopes) };
149
-
150
- if (json.imports)
151
- resolveAndComposePackages(json.imports, outMap.imports, baseUrl, parentMap);
152
-
153
- if (json.scopes)
154
- for (let s in json.scopes) {
155
- const resolvedScope = resolveUrl(s, baseUrl);
156
- resolveAndComposePackages(json.scopes[s], outMap.scopes[resolvedScope] || (outMap.scopes[resolvedScope] = {}), baseUrl, parentMap);
157
- }
158
-
159
- return outMap;
160
- }
161
-
162
- function getMatch (path, matchObj) {
163
- if (matchObj[path])
164
- return path;
165
- let sepIndex = path.length;
166
- do {
167
- const segment = path.slice(0, sepIndex + 1);
168
- if (segment in matchObj)
169
- return segment;
170
- } while ((sepIndex = path.lastIndexOf('/', sepIndex - 1)) !== -1)
171
- }
172
-
173
- function applyPackages (id, packages) {
174
- const pkgName = getMatch(id, packages);
175
- if (pkgName) {
176
- const pkg = packages[pkgName];
177
- if (pkg === null) return;
178
- if (id.length > pkgName.length && pkg[pkg.length - 1] !== '/')
179
- targetWarning(pkgName, pkg, "should have a trailing '/'");
180
- else
181
- return pkg + id.slice(pkgName.length);
182
- }
183
- }
184
-
185
- function targetWarning (match, target, msg) {
186
- console.warn("Package target " + msg + ", resolving target '" + target + "' for " + match);
187
- }
188
-
189
- function resolveImportMap (importMap, resolvedOrPlain, parentUrl) {
190
- let scopeUrl = parentUrl && getMatch(parentUrl, importMap.scopes);
191
- while (scopeUrl) {
192
- const packageResolution = applyPackages(resolvedOrPlain, importMap.scopes[scopeUrl]);
193
- if (packageResolution)
194
- return packageResolution;
195
- scopeUrl = getMatch(scopeUrl.slice(0, scopeUrl.lastIndexOf('/')), importMap.scopes);
196
- }
197
- return applyPackages(resolvedOrPlain, importMap.imports) || resolvedOrPlain.indexOf(':') !== -1 && resolvedOrPlain;
198
- }
199
-
200
- const optionsScript = document.querySelector('script[type=esms-options]');
201
-
202
- const esmsInitOptions = optionsScript ? JSON.parse(optionsScript.innerHTML) : self.esmsInitOptions ? self.esmsInitOptions : {};
203
-
204
- let shimMode = !!esmsInitOptions.shimMode;
205
- const resolveHook = globalHook(shimMode && esmsInitOptions.resolve);
206
-
207
- const skip = esmsInitOptions.skip ? new RegExp(esmsInitOptions.skip) : null;
208
-
209
- let nonce = esmsInitOptions.nonce;
210
-
211
- if (!nonce) {
212
- const nonceElement = document.querySelector('script[nonce]');
213
- if (nonceElement)
214
- nonce = nonceElement.nonce || nonceElement.getAttribute('nonce');
215
- }
216
-
217
- const onerror = globalHook(esmsInitOptions.onerror || noop);
218
- const onpolyfill = globalHook(esmsInitOptions.onpolyfill || noop);
219
-
220
- const { revokeBlobURLs, noLoadEventRetriggers } = esmsInitOptions;
221
-
222
- const fetchHook = esmsInitOptions.fetch ? globalHook(esmsInitOptions.fetch) : fetch;
223
-
224
- function globalHook (name) {
225
- return typeof name === 'string' ? self[name] : name;
226
- }
227
-
228
- const enable = Array.isArray(esmsInitOptions.polyfillEnable) ? esmsInitOptions.polyfillEnable : [];
229
- const cssModulesEnabled = enable.includes('css-modules');
230
- const jsonModulesEnabled = enable.includes('json-modules');
231
-
232
- function setShimMode () {
233
- shimMode = true;
234
- }
235
-
236
- let err;
237
- window.addEventListener('error', _err => err = _err);
238
- function dynamicImportScript (url, { errUrl = url } = {}) {
239
- err = undefined;
240
- const src = createBlob(`import*as m from'${url}';self._esmsi=m`);
241
- const s = Object.assign(document.createElement('script'), { type: 'module', src });
242
- s.setAttribute('nonce', nonce);
243
- s.setAttribute('noshim', '');
244
- const p = new Promise((resolve, reject) => {
245
- // Safari is unique in supporting module script error events
246
- s.addEventListener('error', cb);
247
- s.addEventListener('load', cb);
248
-
249
- function cb (_err) {
250
- document.head.removeChild(s);
251
- if (self._esmsi) {
252
- resolve(self._esmsi, baseUrl);
253
- self._esmsi = undefined;
254
- }
255
- else {
256
- reject(!(_err instanceof Event) && _err || err && err.error || new Error(`Error loading or executing the graph of ${errUrl} (check the console for ${src}).`));
257
- err = undefined;
258
- }
259
- }
260
- });
261
- document.head.appendChild(s);
262
- return p;
263
- }
264
-
265
- let dynamicImport = dynamicImportScript;
266
-
267
- const supportsDynamicImportCheck = dynamicImportScript(createBlob('export default u=>import(u)')).then(_dynamicImport => {
268
- if (_dynamicImport)
269
- dynamicImport = _dynamicImport.default;
270
- return !!_dynamicImport;
271
- }, noop);
272
-
273
- // support browsers without dynamic import support (eg Firefox 6x)
274
- let supportsJsonAssertions = false;
275
- let supportsCssAssertions = false;
276
-
277
- let supportsImportMeta = false;
278
- let supportsImportMaps = false;
279
-
280
- let supportsDynamicImport = false;
281
-
282
- const featureDetectionPromise = Promise.resolve(supportsDynamicImportCheck).then(_supportsDynamicImport => {
283
- if (!_supportsDynamicImport)
284
- return;
285
- supportsDynamicImport = true;
286
-
287
- return Promise.all([
288
- dynamicImport(createBlob('import.meta')).then(() => supportsImportMeta = true, noop),
289
- cssModulesEnabled && dynamicImport(createBlob('import"data:text/css,{}"assert{type:"css"}')).then(() => supportsCssAssertions = true, noop),
290
- jsonModulesEnabled && dynamicImport(createBlob('import"data:text/json,{}"assert{type:"json"}')).then(() => supportsJsonAssertions = true, noop),
291
- new Promise(resolve => {
292
- self._$s = v => {
293
- document.head.removeChild(iframe);
294
- if (v) supportsImportMaps = true;
295
- delete self._$s;
296
- resolve();
297
- };
298
- const iframe = document.createElement('iframe');
299
- iframe.style.display = 'none';
300
- document.head.appendChild(iframe);
301
- iframe.src = createBlob(`<script type=importmap nonce="${nonce}">{"imports":{"x":"data:text/javascript,"}}<${''}/script><script nonce="${nonce}">import('x').then(()=>1,()=>0).then(v=>parent._$s(v))<${''}/script>`, 'text/html');
302
- })
303
- ]);
304
- });
305
-
306
- let e,r,a,i=4194304;const s=1===new Uint8Array(new Uint16Array([1]).buffer)[0];let t,f,c$1;function parse(k,l="@"){if(t=k,f=l,t.length>i||!e){for(;t.length>i;)i*=2;r=new ArrayBuffer(4*i),e=function(e,r,a){"use asm";var i=new e.Int8Array(a),s=new e.Int16Array(a),t=new e.Int32Array(a),f=new e.Uint8Array(a),c=new e.Uint16Array(a),n=816;function b(e){e=e|0;var r=0,a=0,f=0,b=0,l=0;l=n;n=n+14336|0;b=l;i[589]=1;s[291]=0;s[292]=0;s[293]=-1;t[15]=t[2];i[590]=0;t[14]=0;i[588]=0;t[16]=l+10240;t[17]=l+2048;i[591]=0;e=(t[3]|0)+-2|0;t[18]=e;r=e+(t[12]<<1)|0;t[19]=r;e:while(1){a=e+2|0;t[18]=a;if(e>>>0>=r>>>0){f=18;break}r:do{switch(s[a>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if((((s[292]|0)==0?R(a)|0:0)?B(e+4|0,120,112,111,114,116)|0:0)?(u(),(i[589]|0)==0):0){f=9;break e}else f=17;break}case 105:{if(R(a)|0?B(e+4|0,109,112,111,114,116)|0:0){k();f=17;}else f=17;break}case 59:{f=17;break}case 47:switch(s[e+4>>1]|0){case 47:{G();break r}case 42:{p(1);break r}default:{f=16;break e}}default:{f=16;break e}}}while(0);if((f|0)==17){f=0;t[15]=t[18];}e=t[18]|0;r=t[19]|0;}if((f|0)==9){e=t[18]|0;t[15]=e;f=19;}else if((f|0)==16){i[589]=0;t[18]=e;f=19;}else if((f|0)==18)if(!(i[588]|0)){e=a;f=19;}else e=0;do{if((f|0)==19){e:while(1){r=e+2|0;t[18]=r;a=r;if(e>>>0>=(t[19]|0)>>>0){f=75;break}r:do{switch(s[r>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if(((s[292]|0)==0?R(r)|0:0)?B(e+4|0,120,112,111,114,116)|0:0){u();f=74;}else f=74;break}case 105:{if(R(r)|0?B(e+4|0,109,112,111,114,116)|0:0){k();f=74;}else f=74;break}case 99:{if((R(r)|0?z(e+4|0,108,97,115,115)|0:0)?Z(s[e+12>>1]|0)|0:0){i[591]=1;f=74;}else f=74;break}case 40:{r=t[15]|0;a=t[17]|0;f=s[292]|0;s[292]=f+1<<16>>16;t[a+((f&65535)<<2)>>2]=r;f=74;break}case 41:{e=s[292]|0;if(!(e<<16>>16)){f=36;break e}f=e+-1<<16>>16;s[292]=f;e=t[11]|0;if((e|0)!=0?(t[e+20>>2]|0)==(t[(t[17]|0)+((f&65535)<<2)>>2]|0):0){r=e+4|0;if(!(t[r>>2]|0))t[r>>2]=a;t[e+12>>2]=a;t[11]=0;f=74;}else f=74;break}case 123:{f=t[15]|0;a=t[8]|0;e=f;do{if((s[f>>1]|0)==41&(a|0)!=0?(t[a+4>>2]|0)==(f|0):0){r=t[9]|0;t[8]=r;if(!r){t[4]=0;break}else {t[r+28>>2]=0;break}}}while(0);r=s[292]|0;f=r&65535;i[b+f>>0]=i[591]|0;i[591]=0;a=t[17]|0;s[292]=r+1<<16>>16;t[a+(f<<2)>>2]=e;f=74;break}case 125:{e=s[292]|0;if(!(e<<16>>16)){f=49;break e}a=e+-1<<16>>16;s[292]=a;r=s[293]|0;if(e<<16>>16!=r<<16>>16)if(r<<16>>16!=-1&(a&65535)<(r&65535)){f=53;break e}else {f=74;break r}else {a=t[16]|0;f=(s[291]|0)+-1<<16>>16;s[291]=f;s[293]=s[a+((f&65535)<<1)>>1]|0;h();f=74;break r}}case 39:{d(39);f=74;break}case 34:{d(34);f=74;break}case 47:switch(s[e+4>>1]|0){case 47:{G();break r}case 42:{p(1);break r}default:{r=t[15]|0;a=s[r>>1]|0;a:do{if(!(x(a)|0)){switch(a<<16>>16){case 41:if(L(t[(t[17]|0)+(c[292]<<2)>>2]|0)|0){f=71;break a}else {f=68;break a}case 125:break;default:{f=68;break a}}e=c[292]|0;if(!(y(t[(t[17]|0)+(e<<2)>>2]|0)|0)?(i[b+e>>0]|0)==0:0)f=68;else f=71;}else switch(a<<16>>16){case 46:if(((s[r+-2>>1]|0)+-48&65535)<10){f=68;break a}else {f=71;break a}case 43:if((s[r+-2>>1]|0)==43){f=68;break a}else {f=71;break a}case 45:if((s[r+-2>>1]|0)==45){f=68;break a}else {f=71;break a}default:{f=71;break a}}}while(0);a:do{if((f|0)==68){f=0;if(!(o(r)|0)){switch(a<<16>>16){case 0:{f=71;break a}case 47:break;default:{e=1;break a}}if(!(i[590]|0))e=1;else f=71;}else f=71;}}while(0);if((f|0)==71){I();e=0;}i[590]=e;f=74;break r}}case 96:{h();f=74;break}default:f=74;}}while(0);if((f|0)==74){f=0;t[15]=t[18];}e=t[18]|0;}if((f|0)==36){Y();e=0;break}else if((f|0)==49){Y();e=0;break}else if((f|0)==53){Y();e=0;break}else if((f|0)==75){e=(s[293]|0)==-1&(s[292]|0)==0&(i[588]|0)==0;break}}}while(0);n=l;return e|0}function u(){var e=0,r=0,a=0,f=0,c=0,n=0;c=t[18]|0;n=c+12|0;t[18]=n;r=w(1)|0;e=t[18]|0;if(!((e|0)==(n|0)?!(S(r)|0):0))f=3;e:do{if((f|0)==3){r:do{switch(r<<16>>16){case 100:{J(e,e+14|0);break e}case 97:{t[18]=e+10;w(1)|0;e=t[18]|0;f=6;break}case 102:{f=6;break}case 99:{if(z(e+2|0,108,97,115,115)|0?(a=e+10|0,F(s[a>>1]|0)|0):0){t[18]=a;c=w(1)|0;n=t[18]|0;H(c)|0;J(n,t[18]|0);t[18]=(t[18]|0)+-2;break e}e=e+4|0;t[18]=e;f=13;break}case 108:case 118:{f=13;break}case 123:{t[18]=e+2;e=w(1)|0;a=t[18]|0;while(1){if(_(e)|0){d(e);e=(t[18]|0)+2|0;t[18]=e;}else {H(e)|0;e=t[18]|0;}w(1)|0;e=g(a,e)|0;if(e<<16>>16==44){t[18]=(t[18]|0)+2;e=w(1)|0;}r=a;a=t[18]|0;if(e<<16>>16==125){f=32;break}if((a|0)==(r|0)){f=29;break}if(a>>>0>(t[19]|0)>>>0){f=31;break}}if((f|0)==29){Y();break e}else if((f|0)==31){Y();break e}else if((f|0)==32){t[18]=a+2;f=34;break r}break}case 42:{t[18]=e+2;w(1)|0;f=t[18]|0;g(f,f)|0;f=34;break}default:{}}}while(0);if((f|0)==6){t[18]=e+16;e=w(1)|0;if(e<<16>>16==42){t[18]=(t[18]|0)+2;e=w(1)|0;}n=t[18]|0;H(e)|0;J(n,t[18]|0);t[18]=(t[18]|0)+-2;break}else if((f|0)==13){e=e+4|0;t[18]=e;i[589]=0;r:while(1){t[18]=e+2;n=w(1)|0;e=t[18]|0;switch((H(n)|0)<<16>>16){case 91:case 123:{f=15;break r}default:{}}r=t[18]|0;if((r|0)==(e|0))break e;J(e,r);switch((w(1)|0)<<16>>16){case 61:{f=19;break r}case 44:break;default:{f=20;break r}}e=t[18]|0;}if((f|0)==15){t[18]=(t[18]|0)+-2;break}else if((f|0)==19){t[18]=(t[18]|0)+-2;break}else if((f|0)==20){t[18]=(t[18]|0)+-2;break}}else if((f|0)==34)r=w(1)|0;e=t[18]|0;if(r<<16>>16==102?K(e+2|0,114,111,109)|0:0){t[18]=e+8;l(c,w(1)|0);break}t[18]=e+-2;}}while(0);return}function k(){var e=0,r=0,a=0,f=0,c=0;c=t[18]|0;r=c+12|0;t[18]=r;e:do{switch((w(1)|0)<<16>>16){case 40:{r=t[17]|0;a=s[292]|0;s[292]=a+1<<16>>16;t[r+((a&65535)<<2)>>2]=c;if((s[t[15]>>1]|0)!=46){v(c,(t[18]|0)+2|0,0,c);t[11]=t[8];t[18]=(t[18]|0)+2;switch((w(1)|0)<<16>>16){case 39:{d(39);break}case 34:{d(34);break}default:{t[18]=(t[18]|0)+-2;break e}}t[18]=(t[18]|0)+2;switch((w(1)|0)<<16>>16){case 44:{c=t[18]|0;t[(t[8]|0)+4>>2]=c;t[18]=c+2;w(1)|0;c=t[18]|0;a=t[8]|0;t[a+16>>2]=c;i[a+24>>0]=1;t[18]=c+-2;break e}case 41:{s[292]=(s[292]|0)+-1<<16>>16;a=t[18]|0;c=t[8]|0;t[c+4>>2]=a;t[c+12>>2]=a;i[c+24>>0]=1;break e}default:{t[18]=(t[18]|0)+-2;break e}}}break}case 46:{t[18]=(t[18]|0)+2;if(((w(1)|0)<<16>>16==109?(e=t[18]|0,K(e+2|0,101,116,97)|0):0)?(s[t[15]>>1]|0)!=46:0)v(c,c,e+8|0,2);break}case 42:case 39:case 34:{f=16;break}case 123:{e=t[18]|0;if(s[292]|0){t[18]=e+-2;break e}while(1){if(e>>>0>=(t[19]|0)>>>0)break;e=w(1)|0;if(!(_(e)|0)){if(e<<16>>16==125){f=31;break}}else d(e);e=(t[18]|0)+2|0;t[18]=e;}if((f|0)==31)t[18]=(t[18]|0)+2;w(1)|0;e=t[18]|0;if(!(z(e,102,114,111,109)|0)){Y();break e}t[18]=e+8;e=w(1)|0;if(_(e)|0){l(c,e);break e}else {Y();break e}}default:if((t[18]|0)!=(r|0))f=16;}}while(0);do{if((f|0)==16){if(s[292]|0){t[18]=(t[18]|0)+-2;break}e=t[19]|0;r=t[18]|0;while(1){if(r>>>0>=e>>>0){f=23;break}a=s[r>>1]|0;if(_(a)|0){f=21;break}f=r+2|0;t[18]=f;r=f;}if((f|0)==21){l(c,a);break}else if((f|0)==23){Y();break}}}while(0);return}function l(e,r){e=e|0;r=r|0;var a=0,i=0;a=(t[18]|0)+2|0;switch(r<<16>>16){case 39:{d(39);i=5;break}case 34:{d(34);i=5;break}default:Y();}do{if((i|0)==5){v(e,a,t[18]|0,1);t[18]=(t[18]|0)+2;i=(w(0)|0)<<16>>16==97;r=t[18]|0;if(i?B(r+2|0,115,115,101,114,116)|0:0){t[18]=r+12;if((w(1)|0)<<16>>16!=123){t[18]=r;break}e=t[18]|0;a=e;e:while(1){t[18]=a+2;a=w(1)|0;switch(a<<16>>16){case 39:{d(39);t[18]=(t[18]|0)+2;a=w(1)|0;break}case 34:{d(34);t[18]=(t[18]|0)+2;a=w(1)|0;break}default:a=H(a)|0;}if(a<<16>>16!=58){i=16;break}t[18]=(t[18]|0)+2;switch((w(1)|0)<<16>>16){case 39:{d(39);break}case 34:{d(34);break}default:{i=20;break e}}t[18]=(t[18]|0)+2;switch((w(1)|0)<<16>>16){case 125:{i=25;break e}case 44:break;default:{i=24;break e}}t[18]=(t[18]|0)+2;if((w(1)|0)<<16>>16==125){i=25;break}a=t[18]|0;}if((i|0)==16){t[18]=r;break}else if((i|0)==20){t[18]=r;break}else if((i|0)==24){t[18]=r;break}else if((i|0)==25){i=t[8]|0;t[i+16>>2]=e;t[i+12>>2]=(t[18]|0)+2;break}}t[18]=r+-2;}}while(0);return}function o(e){e=e|0;e:do{switch(s[e>>1]|0){case 100:switch(s[e+-2>>1]|0){case 105:{e=q(e+-4|0,118,111)|0;break e}case 108:{e=P(e+-4|0,121,105,101)|0;break e}default:{e=0;break e}}case 101:{switch(s[e+-2>>1]|0){case 115:break;case 116:{e=E(e+-4|0,100,101,108,101)|0;break e}default:{e=0;break e}}switch(s[e+-4>>1]|0){case 108:{e=D(e+-6|0,101)|0;break e}case 97:{e=D(e+-6|0,99)|0;break e}default:{e=0;break e}}}case 102:{if((s[e+-2>>1]|0)==111?(s[e+-4>>1]|0)==101:0)switch(s[e+-6>>1]|0){case 99:{e=O(e+-8|0,105,110,115,116,97,110)|0;break e}case 112:{e=q(e+-8|0,116,121)|0;break e}default:{e=0;break e}}else e=0;break}case 110:{e=e+-2|0;if(D(e,105)|0)e=1;else e=$(e,114,101,116,117,114)|0;break}case 111:{e=D(e+-2|0,100)|0;break}case 114:{e=m(e+-2|0,100,101,98,117,103,103,101)|0;break}case 116:{e=E(e+-2|0,97,119,97,105)|0;break}case 119:switch(s[e+-2>>1]|0){case 101:{e=D(e+-4|0,110)|0;break e}case 111:{e=P(e+-4|0,116,104,114)|0;break e}default:{e=0;break e}}default:e=0;}}while(0);return e|0}function h(){var e=0,r=0,a=0;r=t[19]|0;a=t[18]|0;e:while(1){e=a+2|0;if(a>>>0>=r>>>0){r=8;break}switch(s[e>>1]|0){case 96:{r=9;break e}case 36:{if((s[a+4>>1]|0)==123){r=6;break e}break}case 92:{e=a+4|0;break}default:{}}a=e;}if((r|0)==6){t[18]=a+4;e=s[293]|0;r=t[16]|0;a=s[291]|0;s[291]=a+1<<16>>16;s[r+((a&65535)<<1)>>1]=e;a=(s[292]|0)+1<<16>>16;s[292]=a;s[293]=a;}else if((r|0)==8){t[18]=e;Y();}else if((r|0)==9)t[18]=e;return}function w(e){e=e|0;var r=0,a=0,i=0;a=t[18]|0;e:do{r=s[a>>1]|0;r:do{if(r<<16>>16!=47)if(e)if(Z(r)|0)break;else break e;else if(Q(r)|0)break;else break e;else switch(s[a+2>>1]|0){case 47:{G();break r}case 42:{p(e);break r}default:{r=47;break e}}}while(0);i=t[18]|0;a=i+2|0;t[18]=a;}while(i>>>0<(t[19]|0)>>>0);return r|0}function d(e){e=e|0;var r=0,a=0,i=0,f=0;f=t[19]|0;r=t[18]|0;while(1){i=r+2|0;if(r>>>0>=f>>>0){r=9;break}a=s[i>>1]|0;if(a<<16>>16==e<<16>>16){r=10;break}if(a<<16>>16==92){a=r+4|0;if((s[a>>1]|0)==13){r=r+6|0;r=(s[r>>1]|0)==10?r:a;}else r=a;}else if(ae(a)|0){r=9;break}else r=i;}if((r|0)==9){t[18]=i;Y();}else if((r|0)==10)t[18]=i;return}function v(e,r,a,s){e=e|0;r=r|0;a=a|0;s=s|0;var f=0,c=0;f=t[13]|0;t[13]=f+32;c=t[8]|0;t[((c|0)==0?16:c+28|0)>>2]=f;t[9]=c;t[8]=f;t[f+8>>2]=e;do{if(2!=(s|0))if(1==(s|0)){t[f+12>>2]=a+2;break}else {t[f+12>>2]=t[3];break}else t[f+12>>2]=a;}while(0);t[f>>2]=r;t[f+4>>2]=a;t[f+16>>2]=0;t[f+20>>2]=s;i[f+24>>0]=1==(s|0)&1;t[f+28>>2]=0;return}function A(){var e=0,r=0,a=0;a=t[19]|0;r=t[18]|0;e:while(1){e=r+2|0;if(r>>>0>=a>>>0){r=6;break}switch(s[e>>1]|0){case 13:case 10:{r=6;break e}case 93:{r=7;break e}case 92:{e=r+4|0;break}default:{}}r=e;}if((r|0)==6){t[18]=e;Y();e=0;}else if((r|0)==7){t[18]=e;e=93;}return e|0}function C(e,r,a,i,t,f,c,n){e=e|0;r=r|0;a=a|0;i=i|0;t=t|0;f=f|0;c=c|0;n=n|0;if((((((s[e+12>>1]|0)==n<<16>>16?(s[e+10>>1]|0)==c<<16>>16:0)?(s[e+8>>1]|0)==f<<16>>16:0)?(s[e+6>>1]|0)==t<<16>>16:0)?(s[e+4>>1]|0)==i<<16>>16:0)?(s[e+2>>1]|0)==a<<16>>16:0)r=(s[e>>1]|0)==r<<16>>16;else r=0;return r|0}function y(e){e=e|0;switch(s[e>>1]|0){case 62:{e=(s[e+-2>>1]|0)==61;break}case 41:case 59:{e=1;break}case 104:{e=E(e+-2|0,99,97,116,99)|0;break}case 121:{e=O(e+-2|0,102,105,110,97,108,108)|0;break}case 101:{e=P(e+-2|0,101,108,115)|0;break}default:e=0;}return e|0}function g(e,r){e=e|0;r=r|0;var a=0,i=0;a=t[18]|0;i=s[a>>1]|0;if(i<<16>>16==97){t[18]=a+4;a=w(1)|0;e=t[18]|0;if(_(a)|0){d(a);r=(t[18]|0)+2|0;t[18]=r;}else {H(a)|0;r=t[18]|0;}i=w(1)|0;a=t[18]|0;}if((a|0)!=(e|0))J(e,r);return i|0}function I(){var e=0,r=0,a=0;e:while(1){e=t[18]|0;r=e+2|0;t[18]=r;if(e>>>0>=(t[19]|0)>>>0){a=7;break}switch(s[r>>1]|0){case 13:case 10:{a=7;break e}case 47:break e;case 91:{A()|0;break}case 92:{t[18]=e+4;break}default:{}}}if((a|0)==7)Y();return}function p(e){e=e|0;var r=0,a=0,i=0,f=0,c=0;f=(t[18]|0)+2|0;t[18]=f;a=t[19]|0;while(1){r=f+2|0;if(f>>>0>=a>>>0)break;i=s[r>>1]|0;if(!e?ae(i)|0:0)break;if(i<<16>>16==42?(s[f+4>>1]|0)==47:0){c=8;break}f=r;}if((c|0)==8){t[18]=r;r=f+4|0;}t[18]=r;return}function U(e,r,a,i,t,f,c){e=e|0;r=r|0;a=a|0;i=i|0;t=t|0;f=f|0;c=c|0;if(((((s[e+10>>1]|0)==c<<16>>16?(s[e+8>>1]|0)==f<<16>>16:0)?(s[e+6>>1]|0)==t<<16>>16:0)?(s[e+4>>1]|0)==i<<16>>16:0)?(s[e+2>>1]|0)==a<<16>>16:0)r=(s[e>>1]|0)==r<<16>>16;else r=0;return r|0}function m(e,r,a,i,f,c,n,b){e=e|0;r=r|0;a=a|0;i=i|0;f=f|0;c=c|0;n=n|0;b=b|0;var u=0,k=0;k=e+-12|0;u=t[3]|0;if(k>>>0>=u>>>0?C(k,r,a,i,f,c,n,b)|0:0)if((k|0)==(u|0))u=1;else u=F(s[e+-14>>1]|0)|0;else u=0;return u|0}function S(e){e=e|0;e:do{switch(e<<16>>16){case 38:case 37:case 33:{e=1;break}default:if((e&-8)<<16>>16==40|(e+-58&65535)<6)e=1;else {switch(e<<16>>16){case 91:case 93:case 94:{e=1;break e}default:{}}e=(e+-123&65535)<4;}}}while(0);return e|0}function x(e){e=e|0;e:do{switch(e<<16>>16){case 38:case 37:case 33:break;default:if(!((e+-58&65535)<6|(e+-40&65535)<7&e<<16>>16!=41)){switch(e<<16>>16){case 91:case 94:break e;default:{}}return e<<16>>16!=125&(e+-123&65535)<4|0}}}while(0);return 1}function O(e,r,a,i,f,c,n){e=e|0;r=r|0;a=a|0;i=i|0;f=f|0;c=c|0;n=n|0;var b=0,u=0;u=e+-10|0;b=t[3]|0;if(u>>>0>=b>>>0?U(u,r,a,i,f,c,n)|0:0)if((u|0)==(b|0))b=1;else b=F(s[e+-12>>1]|0)|0;else b=0;return b|0}function $(e,r,a,i,f,c){e=e|0;r=r|0;a=a|0;i=i|0;f=f|0;c=c|0;var n=0,b=0;b=e+-8|0;n=t[3]|0;if(b>>>0>=n>>>0?B(b,r,a,i,f,c)|0:0)if((b|0)==(n|0))n=1;else n=F(s[e+-10>>1]|0)|0;else n=0;return n|0}function j(e){e=e|0;var r=0,a=0,i=0,f=0;a=n;n=n+16|0;i=a;t[i>>2]=0;t[12]=e;r=t[3]|0;f=r+(e<<1)|0;e=f+2|0;s[f>>1]=0;t[i>>2]=e;t[13]=e;t[4]=0;t[8]=0;t[6]=0;t[5]=0;t[10]=0;t[7]=0;n=a;return r|0}function B(e,r,a,i,t,f){e=e|0;r=r|0;a=a|0;i=i|0;t=t|0;f=f|0;if((((s[e+8>>1]|0)==f<<16>>16?(s[e+6>>1]|0)==t<<16>>16:0)?(s[e+4>>1]|0)==i<<16>>16:0)?(s[e+2>>1]|0)==a<<16>>16:0)r=(s[e>>1]|0)==r<<16>>16;else r=0;return r|0}function E(e,r,a,i,f){e=e|0;r=r|0;a=a|0;i=i|0;f=f|0;var c=0,n=0;n=e+-6|0;c=t[3]|0;if(n>>>0>=c>>>0?z(n,r,a,i,f)|0:0)if((n|0)==(c|0))c=1;else c=F(s[e+-8>>1]|0)|0;else c=0;return c|0}function P(e,r,a,i){e=e|0;r=r|0;a=a|0;i=i|0;var f=0,c=0;c=e+-4|0;f=t[3]|0;if(c>>>0>=f>>>0?K(c,r,a,i)|0:0)if((c|0)==(f|0))f=1;else f=F(s[e+-6>>1]|0)|0;else f=0;return f|0}function q(e,r,a){e=e|0;r=r|0;a=a|0;var i=0,f=0;f=e+-2|0;i=t[3]|0;if(f>>>0>=i>>>0?N(f,r,a)|0:0)if((f|0)==(i|0))i=1;else i=F(s[e+-4>>1]|0)|0;else i=0;return i|0}function z(e,r,a,i,t){e=e|0;r=r|0;a=a|0;i=i|0;t=t|0;if(((s[e+6>>1]|0)==t<<16>>16?(s[e+4>>1]|0)==i<<16>>16:0)?(s[e+2>>1]|0)==a<<16>>16:0)r=(s[e>>1]|0)==r<<16>>16;else r=0;return r|0}function D(e,r){e=e|0;r=r|0;var a=0;a=t[3]|0;if(a>>>0<=e>>>0?(s[e>>1]|0)==r<<16>>16:0)if((a|0)==(e|0))a=1;else a=F(s[e+-2>>1]|0)|0;else a=0;return a|0}function F(e){e=e|0;e:do{if((e+-9&65535)<5)e=1;else {switch(e<<16>>16){case 32:case 160:{e=1;break e}default:{}}e=e<<16>>16!=46&(S(e)|0);}}while(0);return e|0}function G(){var e=0,r=0,a=0;e=t[19]|0;a=t[18]|0;e:while(1){r=a+2|0;if(a>>>0>=e>>>0)break;switch(s[r>>1]|0){case 13:case 10:break e;default:a=r;}}t[18]=r;return}function H(e){e=e|0;while(1){if(Z(e)|0)break;if(S(e)|0)break;e=(t[18]|0)+2|0;t[18]=e;e=s[e>>1]|0;if(!(e<<16>>16)){e=0;break}}return e|0}function J(e,r){e=e|0;r=r|0;var a=0,i=0;a=t[13]|0;t[13]=a+12;i=t[10]|0;t[((i|0)==0?20:i+8|0)>>2]=a;t[10]=a;t[a>>2]=e;t[a+4>>2]=r;t[a+8>>2]=0;return}function K(e,r,a,i){e=e|0;r=r|0;a=a|0;i=i|0;if((s[e+4>>1]|0)==i<<16>>16?(s[e+2>>1]|0)==a<<16>>16:0)r=(s[e>>1]|0)==r<<16>>16;else r=0;return r|0}function L(e){e=e|0;if(!($(e,119,104,105,108,101)|0)?!(P(e,102,111,114)|0):0)e=q(e,105,102)|0;else e=1;return e|0}function M(){var e=0;e=t[(t[6]|0)+20>>2]|0;switch(e|0){case 1:{e=-1;break}case 2:{e=-2;break}default:e=e-(t[3]|0)>>1;}return e|0}function N(e,r,a){e=e|0;r=r|0;a=a|0;if((s[e+2>>1]|0)==a<<16>>16)r=(s[e>>1]|0)==r<<16>>16;else r=0;return r|0}function Q(e){e=e|0;switch(e<<16>>16){case 160:case 32:case 12:case 11:case 9:{e=1;break}default:e=0;}return e|0}function R(e){e=e|0;if((t[3]|0)==(e|0))e=1;else e=F(s[e+-2>>1]|0)|0;return e|0}function T(){var e=0;e=t[(t[6]|0)+16>>2]|0;if(!e)e=-1;else e=e-(t[3]|0)>>1;return e|0}function V(){var e=0;e=t[6]|0;e=t[((e|0)==0?16:e+28|0)>>2]|0;t[6]=e;return (e|0)!=0|0}function W(){var e=0;e=t[7]|0;e=t[((e|0)==0?20:e+8|0)>>2]|0;t[7]=e;return (e|0)!=0|0}function X(e){e=e|0;var r=0;r=n;n=n+e|0;n=n+15&-16;return r|0}function Y(){i[588]=1;t[14]=(t[18]|0)-(t[3]|0)>>1;t[18]=(t[19]|0)+2;return}function Z(e){e=e|0;return (e|128)<<16>>16==160|(e+-9&65535)<5|0}function _(e){e=e|0;return e<<16>>16==39|e<<16>>16==34|0}function ee(){return (t[(t[6]|0)+12>>2]|0)-(t[3]|0)>>1|0}function re(){return (t[(t[6]|0)+8>>2]|0)-(t[3]|0)>>1|0}function ae(e){e=e|0;return e<<16>>16==13|e<<16>>16==10|0}function ie(){return (t[(t[6]|0)+4>>2]|0)-(t[3]|0)>>1|0}function se(){return (t[(t[7]|0)+4>>2]|0)-(t[3]|0)>>1|0}function te(){return (t[t[6]>>2]|0)-(t[3]|0)>>1|0}function fe(){return (t[t[7]>>2]|0)-(t[3]|0)>>1|0}function ce(){return f[(t[6]|0)+24>>0]|0|0}function ne(e){e=e|0;t[3]=e;return}function be(){return (i[589]|0)!=0|0}function ue(){return t[14]|0}return {ai:T,e:ue,ee:se,es:fe,f:be,id:M,ie:ie,ip:ce,is:te,p:b,re:W,ri:V,sa:j,se:ee,ses:ne,ss:re,sta:X}}({Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},{},r),a=e.sta(2*i);}const o=t.length+1;e.ses(a),e.sa(o-1),(s?b:n)(t,new Uint16Array(r,a,o)),e.p()||(c$1=e.e(),h());const w=[],d=[];for(;e.ri();){const r=e.is(),a=e.ie(),i=e.ai(),s=e.id(),f=e.ss(),c=e.se();let n;e.ip()&&(n=u(-1===s?r:r+1,t.charCodeAt(-1===s?r-1:r))),w.push({n:n,s:r,e:a,ss:f,se:c,d:s,a:i});}for(;e.re();){const r=e.es(),a=t.charCodeAt(r);d.push(34===a||39===a?u(r+1,a):t.slice(e.es(),e.ee()));}return [w,d,!!e.f()]}function n(e,r){const a=e.length;let i=0;for(;i<a;){const a=e.charCodeAt(i);r[i++]=(255&a)<<8|a>>>8;}}function b(e,r){const a=e.length;let i=0;for(;i<a;)r[i]=e.charCodeAt(i++);}function u(e,r){c$1=e;let a="",i=c$1;for(;;){c$1>=t.length&&h();const e=t.charCodeAt(c$1);if(e===r)break;92===e?(a+=t.slice(i,c$1),a+=k(),i=c$1):(8232===e||8233===e||o(e)&&h(),++c$1);}return a+=t.slice(i,c$1++),a}function k(){let e=t.charCodeAt(++c$1);switch(++c$1,e){case 110:return "\n";case 114:return "\r";case 120:return String.fromCharCode(l(2));case 117:return function(){let e;123===t.charCodeAt(c$1)?(++c$1,e=l(t.indexOf("}",c$1)-c$1),++c$1,e>1114111&&h()):e=l(4);return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}();case 116:return "\t";case 98:return "\b";case 118:return "\v";case 102:return "\f";case 13:10===t.charCodeAt(c$1)&&++c$1;case 10:return "";case 56:case 57:h();default:if(e>=48&&e<=55){let r=t.substr(c$1-1,3).match(/^[0-7]+/)[0],a=parseInt(r,8);return a>255&&(r=r.slice(0,-1),a=parseInt(r,8)),c$1+=r.length-1,e=t.charCodeAt(c$1),"0"===r&&56!==e&&57!==e||h(),String.fromCharCode(a)}return o(e)?"":String.fromCharCode(e)}}function l(e){const r=c$1;let a=0,i=0;for(let r=0;r<e;++r,++c$1){let e,s=t.charCodeAt(c$1);if(95!==s){if(s>=97)e=s-97+10;else if(s>=65)e=s-65+10;else {if(!(s>=48&&s<=57))break;e=s-48;}if(e>=16)break;i=s,a=16*a+e;}else 95!==i&&0!==r||h(),i=s;}return 95!==i&&c$1-r===e||h(),a}function o(e){return 13===e||10===e}function h(){throw Object.assign(new Error(`Parse error ${f}:${t.slice(0,c$1).split("\n").length}:${c$1-t.lastIndexOf("\n",c$1-1)}`),{idx:c$1})}
307
-
308
- async function defaultResolve (id, parentUrl) {
309
- return resolveImportMap(importMap, resolveIfNotPlainOrUrl(id, parentUrl) || id, parentUrl);
310
- }
311
-
312
- async function _resolve (id, parentUrl) {
313
- const urlResolved = resolveIfNotPlainOrUrl(id, parentUrl);
314
- return {
315
- r: resolveImportMap(importMap, urlResolved || id, parentUrl),
316
- // b = bare specifier
317
- b: !urlResolved && !isURL(id)
318
- };
319
- }
320
-
321
- const resolve = resolveHook ? async (id, parentUrl) => ({ r: await resolveHook(id, parentUrl, defaultResolve), b: false }) : _resolve;
322
-
323
- let id = 0;
324
- const registry = {};
325
-
326
- async function loadAll (load, seen) {
327
- if (load.b || seen[load.u])
328
- return;
329
- seen[load.u] = 1;
330
- await load.L;
331
- await Promise.all(load.d.map(dep => loadAll(dep, seen)));
332
- if (!load.n)
333
- load.n = load.d.some(dep => dep.n);
334
- }
335
-
336
- let importMap = { imports: {}, scopes: {} };
337
- let importMapSrcOrLazy = false;
338
- let baselinePassthrough;
339
-
340
- const initPromise = featureDetectionPromise.then(() => {
341
- // shim mode is determined on initialization, no late shim mode
342
- if (!shimMode) {
343
- let seenScript = false;
344
- for (const script of document.querySelectorAll('script[type="module-shim"],script[type="importmap-shim"],script[type="module"],script[type="importmap"]')) {
345
- if (!seenScript && script.type === 'module')
346
- seenScript = true;
347
- if (script.type.endsWith('-shim')) {
348
- setShimMode();
349
- break;
350
- }
351
- if (seenScript && script.type === 'importmap') {
352
- importMapSrcOrLazy = true;
353
- break;
354
- }
355
- }
356
- }
357
- baselinePassthrough = supportsDynamicImport && supportsImportMeta && supportsImportMaps && (!jsonModulesEnabled || supportsJsonAssertions) && (!cssModulesEnabled || supportsCssAssertions) && !importMapSrcOrLazy && !false;
358
- if (!baselinePassthrough) onpolyfill();
359
- if (shimMode || !baselinePassthrough) {
360
- new MutationObserver(mutations => {
361
- for (const mutation of mutations) {
362
- if (mutation.type !== 'childList') continue;
363
- for (const node of mutation.addedNodes) {
364
- if (node.tagName === 'SCRIPT') {
365
- if (!shimMode && node.type === 'module' || shimMode && node.type === 'module-shim')
366
- processScript(node);
367
- if (!shimMode && node.type === 'importmap' || shimMode && node.type === 'importmap-shim')
368
- processImportMap(node);
369
- }
370
- else if (node.tagName === 'LINK' && node.rel === 'modulepreload')
371
- processPreload(node);
372
- }
373
- }
374
- }).observe(document, { childList: true, subtree: true });
375
- processImportMaps();
376
- processScriptsAndPreloads();
377
- return undefined;
378
- }
379
- });
380
- let importMapPromise = initPromise;
381
-
382
- let acceptingImportMaps = true;
383
- async function topLevelLoad (url, fetchOpts, source, nativelyLoaded, lastStaticLoadPromise) {
384
- if (!shimMode)
385
- acceptingImportMaps = false;
386
- await importMapPromise;
387
- // early analysis opt-out - no need to even fetch if we have feature support
388
- if (!shimMode && baselinePassthrough) {
389
- // for polyfill case, only dynamic import needs a return value here, and dynamic import will never pass nativelyLoaded
390
- if (nativelyLoaded)
391
- return null;
392
- await lastStaticLoadPromise;
393
- return dynamicImport(source ? createBlob(source) : url, { errUrl: url || source });
394
- }
395
- const load = getOrCreateLoad(url, fetchOpts, source);
396
- const seen = {};
397
- await loadAll(load, seen);
398
- lastLoad = undefined;
399
- resolveDeps(load, seen);
400
- await lastStaticLoadPromise;
401
- if (source && !shimMode && !load.n && !false) {
402
- const module = await dynamicImport(createBlob(source), { errUrl: source });
403
- if (revokeBlobURLs) revokeObjectURLs(Object.keys(seen));
404
- return module;
405
- }
406
- const module = await dynamicImport(!shimMode && !load.n && nativelyLoaded ? load.u : load.b, { errUrl: load.u });
407
- // if the top-level load is a shell, run its update function
408
- if (load.s)
409
- (await dynamicImport(load.s)).u$_(module);
410
- if (revokeBlobURLs) revokeObjectURLs(Object.keys(seen));
411
- // when tla is supported, this should return the tla promise as an actual handle
412
- // so readystate can still correspond to the sync subgraph exec completions
413
- return module;
414
- }
415
-
416
- function revokeObjectURLs(registryKeys) {
417
- let batch = 0;
418
- const keysLength = registryKeys.length;
419
- const schedule = self.requestIdleCallback ? self.requestIdleCallback : self.requestAnimationFrame;
420
- schedule(cleanup);
421
- function cleanup() {
422
- const batchStartIndex = batch * 100;
423
- if (batchStartIndex > keysLength) return
424
- for (const key of registryKeys.slice(batchStartIndex, batchStartIndex + 100)) {
425
- const load = registry[key];
426
- if (load) URL.revokeObjectURL(load.b);
427
- }
428
- batch++;
429
- schedule(cleanup);
430
- }
431
- }
432
-
433
- async function importShim (id, parentUrl = baseUrl, _assertion) {
434
- // needed for shim check
435
- await initPromise;
436
- if (acceptingImportMaps || shimMode || !baselinePassthrough) {
437
- processImportMaps();
438
- if (!shimMode)
439
- acceptingImportMaps = false;
440
- }
441
- await importMapPromise;
442
- return topLevelLoad((await resolve(id, parentUrl)).r || throwUnresolved(id, parentUrl), { credentials: 'same-origin' });
443
- }
444
-
445
- self.importShim = importShim;
446
-
447
- if (shimMode) {
448
- importShim.getImportMap = () => JSON.parse(JSON.stringify(importMap));
449
- }
450
-
451
- const meta = {};
452
-
453
- async function importMetaResolve (id, parentUrl = this.url) {
454
- return (await resolve(id, `${parentUrl}`)).r || throwUnresolved(id, parentUrl);
455
- }
456
-
457
- self._esmsm = meta;
458
-
459
- function urlJsString (url) {
460
- return `'${url.replace(/'/g, "\\'")}'`;
461
- }
462
-
463
- let lastLoad;
464
- function resolveDeps (load, seen) {
465
- if (load.b || !seen[load.u])
466
- return;
467
- seen[load.u] = 0;
468
-
469
- for (const dep of load.d)
470
- resolveDeps(dep, seen);
471
-
472
- const [imports] = load.a;
473
-
474
- // "execution"
475
- const source = load.S;
476
-
477
- // edge doesnt execute sibling in order, so we fix this up by ensuring all previous executions are explicit dependencies
478
- let resolvedSource = edge && lastLoad ? `import '${lastLoad}';` : '';
479
-
480
- if (!imports.length) {
481
- resolvedSource += source;
482
- }
483
- else {
484
- // once all deps have loaded we can inline the dependency resolution blobs
485
- // and define this blob
486
- let lastIndex = 0, depIndex = 0;
487
- for (const { s: start, se: end, d: dynamicImportIndex } of imports) {
488
- // dependency source replacements
489
- if (dynamicImportIndex === -1) {
490
- const depLoad = load.d[depIndex++];
491
- let blobUrl = depLoad.b;
492
- if (!blobUrl) {
493
- // circular shell creation
494
- if (!(blobUrl = depLoad.s)) {
495
- blobUrl = depLoad.s = createBlob(`export function u$_(m){${
496
- depLoad.a[1].map(
497
- name => name === 'default' ? `$_default=m.default` : `${name}=m.${name}`
498
- ).join(',')
499
- }}${
500
- depLoad.a[1].map(name =>
501
- name === 'default' ? `let $_default;export{$_default as default}` : `export let ${name}`
502
- ).join(';')
503
- }\n//# sourceURL=${depLoad.r}?cycle`);
504
- }
505
- }
506
- // circular shell execution
507
- else if (depLoad.s) {
508
- resolvedSource += `${source.slice(lastIndex, start - 1)}/*${source.slice(start - 1, end)}*/${urlJsString(blobUrl)};import*as m$_${depIndex} from'${depLoad.b}';import{u$_ as u$_${depIndex}}from'${depLoad.s}';u$_${depIndex}(m$_${depIndex})`;
509
- lastIndex = end;
510
- depLoad.s = undefined;
511
- continue;
512
- }
513
- resolvedSource += `${source.slice(lastIndex, start - 1)}/*${source.slice(start - 1, end)}*/${urlJsString(blobUrl)}`;
514
- lastIndex = end;
515
- }
516
- // import.meta
517
- else if (dynamicImportIndex === -2) {
518
- meta[load.r] = { url: load.r, resolve: importMetaResolve };
519
- resolvedSource += `${source.slice(lastIndex, start)}self._esmsm[${urlJsString(load.r)}]`;
520
- lastIndex = end;
521
- }
522
- // dynamic import
523
- else {
524
- resolvedSource += `${source.slice(lastIndex, dynamicImportIndex + 6)}Shim(${source.slice(start, end)}, ${load.r && urlJsString(load.r)}`;
525
- lastIndex = end;
526
- }
527
- }
528
-
529
- resolvedSource += source.slice(lastIndex);
530
- }
531
-
532
- // ; and // trailer support added for Ruby 7 source maps compatibility
533
- let hasSourceURL = false;
534
- resolvedSource = resolvedSource.replace(sourceMapURLRegEx, (match, isMapping, url) => (hasSourceURL = !isMapping, match.replace(url, () => new URL(url, load.r))));
535
- if (!hasSourceURL)
536
- resolvedSource += '\n//# sourceURL=' + load.r;
537
-
538
- load.b = lastLoad = createBlob(resolvedSource);
539
- load.S = undefined;
540
- }
541
-
542
- const sourceMapURLRegEx = /\n\/\/# source(Mapping)?URL=([^\n]+)\s*((;|\/\/[^#][^\n]*)\s*)*$/;
543
-
544
- const jsContentType = /^(text|application)\/(x-)?javascript(;|$)/;
545
- const jsonContentType = /^(text|application)\/json(;|$)/;
546
- const cssContentType = /^(text|application)\/css(;|$)/;
547
- const wasmContentType = /^application\/wasm(;|$)/;
548
-
549
- const cssUrlRegEx = /url\(\s*(?:(["'])((?:\\.|[^\n\\"'])+)\1|((?:\\.|[^\s,"'()\\])+))\s*\)/g;
550
-
551
- // restrict in-flight fetches to a pool of 100
552
- let p = [];
553
- let c = 0;
554
- function pushFetchPool () {
555
- if (++c > 100)
556
- return new Promise(r => p.push(r));
557
- }
558
- function popFetchPool () {
559
- c--;
560
- if (p.length)
561
- p.shift()();
562
- }
563
-
564
- async function doFetch (url, fetchOpts) {
565
- const poolQueue = pushFetchPool();
566
- if (poolQueue) await poolQueue;
567
- try {
568
- var res = await fetchHook(url, fetchOpts);
569
- }
570
- finally {
571
- popFetchPool();
572
- }
573
- if (!res.ok)
574
- throw new Error(`${res.status} ${res.statusText} ${res.url}`);
575
- const contentType = res.headers.get('content-type');
576
- if (jsContentType.test(contentType))
577
- return { r: res.url, s: await res.text(), t: 'js' };
578
- else if (jsonContentType.test(contentType))
579
- return { r: res.url, s: `export default ${await res.text()}`, t: 'json' };
580
- else if (cssContentType.test(contentType))
581
- return { r: res.url, s: `var s=new CSSStyleSheet();s.replaceSync(${
582
- JSON.stringify((await res.text()).replace(cssUrlRegEx, (_match, quotes, relUrl1, relUrl2) => `url(${quotes}${resolveUrl(relUrl1 || relUrl2, url)}${quotes})`))
583
- });export default s;`, t: 'css' };
584
- else if (wasmContentType.test(contentType))
585
- throw new Error('WASM modules not supported');
586
- else
587
- throw new Error(`Unknown Content-Type "${contentType}"`);
588
- }
589
-
590
- function getOrCreateLoad (url, fetchOpts, source) {
591
- let load = registry[url];
592
- if (load)
593
- return load;
594
-
595
- load = registry[url] = {
596
- // url
597
- u: url,
598
- // response url
599
- r: undefined,
600
- // fetchPromise
601
- f: undefined,
602
- // source
603
- S: undefined,
604
- // linkPromise
605
- L: undefined,
606
- // analysis
607
- a: undefined,
608
- // deps
609
- d: undefined,
610
- // blobUrl
611
- b: undefined,
612
- // shellUrl
613
- s: undefined,
614
- // needsShim
615
- n: false,
616
- // type
617
- t: null
618
- };
619
-
620
- load.f = (async () => {
621
- if (!source) {
622
- // preload fetch options override fetch options (race)
623
- let t;
624
- ({ r: load.r, s: source, t } = await (fetchCache[url] || doFetch(url, fetchOpts)));
625
- if (t && !shimMode) {
626
- if (t === 'css' && !cssModulesEnabled || t === 'json' && !jsonModulesEnabled)
627
- throw new Error(`${t}-modules require <script type="esms-options">{ "polyfillEnable": ["${t}-modules"] }<${''}/script>`);
628
- if (t === 'css' && !supportsCssAssertions || t === 'json' && !supportsJsonAssertions)
629
- load.n = true;
630
- }
631
- }
632
- try {
633
- load.a = parse(source, load.u);
634
- }
635
- catch (e) {
636
- console.warn(e);
637
- load.a = [[], []];
638
- }
639
- load.S = source;
640
- return load;
641
- })();
642
-
643
- load.L = load.f.then(async () => {
644
- let childFetchOpts = fetchOpts;
645
- load.d = (await Promise.all(load.a[0].map(async ({ n, d }) => {
646
- if (d >= 0 && !supportsDynamicImport || d === 2 && !supportsImportMeta)
647
- load.n = true;
648
- if (!n) return;
649
- const { r, b } = await resolve(n, load.r || load.u);
650
- if (b && (!supportsImportMaps || importMapSrcOrLazy))
651
- load.n = true;
652
- if (d !== -1) return;
653
- if (!r)
654
- throwUnresolved(n, load.r || load.u);
655
- if (skip && skip.test(r)) return { b: r };
656
- if (childFetchOpts.integrity)
657
- childFetchOpts = Object.assign({}, childFetchOpts, { integrity: undefined });
658
- return getOrCreateLoad(r, childFetchOpts).f;
659
- }))).filter(l => l);
660
- });
661
-
662
- return load;
663
- }
664
-
665
- function processScriptsAndPreloads () {
666
- for (const script of document.querySelectorAll(shimMode ? 'script[type="module-shim"]' : 'script[type="module"]'))
667
- processScript(script);
668
- for (const link of document.querySelectorAll('link[rel="modulepreload"]'))
669
- processPreload(link);
670
- }
671
-
672
- function processImportMaps () {
673
- for (const script of document.querySelectorAll(shimMode ? 'script[type="importmap-shim"]' : 'script[type="importmap"]'))
674
- processImportMap(script);
675
- }
676
-
677
- function getFetchOpts (script) {
678
- const fetchOpts = {};
679
- if (script.integrity)
680
- fetchOpts.integrity = script.integrity;
681
- if (script.referrerpolicy)
682
- fetchOpts.referrerPolicy = script.referrerpolicy;
683
- if (script.crossorigin === 'use-credentials')
684
- fetchOpts.credentials = 'include';
685
- else if (script.crossorigin === 'anonymous')
686
- fetchOpts.credentials = 'omit';
687
- else
688
- fetchOpts.credentials = 'same-origin';
689
- return fetchOpts;
690
- }
691
-
692
- let lastStaticLoadPromise = Promise.resolve();
693
-
694
- let domContentLoadedCnt = 1;
695
- function domContentLoadedCheck () {
696
- if (--domContentLoadedCnt === 0 && !noLoadEventRetriggers)
697
- document.dispatchEvent(new Event('DOMContentLoaded'));
698
- }
699
- // this should always trigger because we assume es-module-shims is itself a domcontentloaded requirement
700
- document.addEventListener('DOMContentLoaded', async () => {
701
- await initPromise;
702
- domContentLoadedCheck();
703
- if (shimMode || !baselinePassthrough) {
704
- processImportMaps();
705
- processScriptsAndPreloads();
706
- }
707
- });
708
-
709
- let readyStateCompleteCnt = 1;
710
- if (document.readyState === 'complete') {
711
- readyStateCompleteCheck();
712
- }
713
- else {
714
- document.addEventListener('readystatechange', async () => {
715
- processImportMaps();
716
- await initPromise;
717
- readyStateCompleteCheck();
718
- });
719
- }
720
- function readyStateCompleteCheck () {
721
- if (--readyStateCompleteCnt === 0 && !noLoadEventRetriggers)
722
- document.dispatchEvent(new Event('readystatechange'));
723
- }
724
-
725
- function processImportMap (script) {
726
- if (script.ep) // ep marker = script processed
727
- return;
728
- // empty inline scripts sometimes show before domready
729
- if (!script.src && !script.innerHTML)
730
- return;
731
- script.ep = true;
732
- // we dont currently support multiple, external or dynamic imports maps in polyfill mode to match native
733
- if (script.src) {
734
- if (!shimMode)
735
- return;
736
- importMapSrcOrLazy = true;
737
- }
738
- if (acceptingImportMaps) {
739
- importMapPromise = importMapPromise
740
- .then(async () => {
741
- importMap = resolveAndComposeImportMap(script.src ? await (await fetchHook(script.src)).json() : JSON.parse(script.innerHTML), script.src || baseUrl, importMap);
742
- })
743
- .catch(error => setTimeout(() => { throw error }));
744
- if (!shimMode)
745
- acceptingImportMaps = false;
746
- }
747
- }
748
-
749
- function processScript (script) {
750
- if (script.ep) // ep marker = script processed
751
- return;
752
- if (script.getAttribute('noshim') !== null)
753
- return;
754
- // empty inline scripts sometimes show before domready
755
- if (!script.src && !script.innerHTML)
756
- return;
757
- script.ep = true;
758
- // does this load block readystate complete
759
- const isReadyScript = readyStateCompleteCnt > 0;
760
- // does this load block DOMContentLoaded
761
- const isDomContentLoadedScript = domContentLoadedCnt > 0;
762
- if (isReadyScript) readyStateCompleteCnt++;
763
- if (isDomContentLoadedScript) domContentLoadedCnt++;
764
- const blocks = script.getAttribute('async') === null && isReadyScript;
765
- const loadPromise = topLevelLoad(script.src || `${baseUrl}?${id++}`, getFetchOpts(script), !script.src && script.innerHTML, !shimMode, blocks && lastStaticLoadPromise).catch(e => {
766
- setTimeout(() => { throw e });
767
- onerror(e);
768
- });
769
- if (blocks)
770
- lastStaticLoadPromise = loadPromise.then(readyStateCompleteCheck);
771
- if (isDomContentLoadedScript)
772
- loadPromise.then(domContentLoadedCheck);
773
- }
774
-
775
- const fetchCache = {};
776
- function processPreload (link) {
777
- if (link.ep) // ep marker = processed
778
- return;
779
- link.ep = true;
780
- if (fetchCache[link.href])
781
- return;
782
- fetchCache[link.href] = doFetch(link.href, getFetchOpts(link));
783
- }
784
-
785
- function throwUnresolved (id, parentUrl) {
786
- throw Error("Unable to resolve specifier '" + id + (parentUrl ? "' from " + parentUrl : "'"));
787
- }
788
-
789
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/models/Samba Dancing.fbx DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:b9003ee562c87bf03051c3a502411b0808d3513f1d74a2011f7530d9f067069f
3
- size 3681360
 
 
 
 
sd-3dmodel-loader/models/male02.obj DELETED
The diff for this file is too large to render. See raw diff
 
sd-3dmodel-loader/models/pose.vrm DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:12c2b97e95e700783a6a550dc0eee2d7880aeedccef9ae67bc4c5a2f0f2631a2
3
- size 10776032
 
 
 
 
sd-3dmodel-loader/package.json DELETED
@@ -1,59 +0,0 @@
1
- {
2
- "name": "react-threejs",
3
- "version": "0.1.0",
4
- "private": true,
5
- "dependencies": {
6
- "@emotion/react": "^11.10.6",
7
- "@emotion/styled": "^11.10.6",
8
- "@mui/icons-material": "^5.11.16",
9
- "@mui/lab": "^5.0.0-alpha.127",
10
- "@mui/material": "^5.12.1",
11
- "@mui/system": "^5.12.1",
12
- "@pixiv/three-vrm": "^1.0.9",
13
- "@testing-library/jest-dom": "^5.16.5",
14
- "@testing-library/react": "^13.4.0",
15
- "@testing-library/user-event": "^13.5.0",
16
- "dat.gui": "^0.7.9",
17
- "drei": "^2.2.21",
18
- "react": "^18.2.0",
19
- "react-color": "^2.19.3",
20
- "react-dom": "^18.2.0",
21
- "react-scripts": "5.0.1",
22
- "react-three-fiber": "^6.0.13",
23
- "web-vitals": "^2.1.4"
24
- },
25
- "scripts": {
26
- "start": "react-scripts start",
27
- "build": "react-scripts build",
28
- "test": "react-scripts test",
29
- "eject": "react-scripts eject"
30
- },
31
- "eslintConfig": {
32
- "extends": [
33
- "react-app",
34
- "react-app/jest"
35
- ]
36
- },
37
- "browserslist": {
38
- "production": [
39
- ">0.2%",
40
- "not dead",
41
- "not op_mini all"
42
- ],
43
- "development": [
44
- "last 1 chrome version",
45
- "last 1 firefox version",
46
- "last 1 safari version"
47
- ]
48
- },
49
- "devDependencies": {
50
- "@babel/core": "^7.21.4",
51
- "@babel/preset-env": "^7.21.4",
52
- "@babel/preset-react": "^7.18.6",
53
- "babel-loader": "^9.1.2",
54
- "three": "0.149.0",
55
- "webpack": "^5.79.0",
56
- "webpack-cli": "^5.0.1",
57
- "webpack-dev-server": "^4.13.3"
58
- }
59
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/poses/kneel.json DELETED
@@ -1 +0,0 @@
1
- {"poses":[{"name":"pose1","poseData":[{"boneName":"hips","x":0,"y":0,"z":0},{"boneName":"spine","x":0.2827433388230814,"y":0,"z":0},{"boneName":"chest","x":0,"y":0,"z":0},{"boneName":"upperChest","x":0,"y":0,"z":0},{"boneName":"neck","x":-0.3141592653589793,"y":-0.06283185307179587,"z":-0.2827433388230814},{"boneName":"head","x":0,"y":0,"z":0},{"boneName":"leftShoulder","x":0,"y":0,"z":0},{"boneName":"leftUpperArm","x":0.18849555921538758,"y":-1.5707963267948966,"z":-0.8796459430051422},{"boneName":"leftLowerArm","x":0,"y":-0.37699111843077515,"z":-0.031415926535897934},{"boneName":"leftHand","x":-0.12566370614359174,"y":-0.031415926535897934,"z":0},{"boneName":"leftThumbMetacarpal","x":0,"y":0,"z":0},{"boneName":"leftThumbProximal","x":0,"y":0,"z":0},{"boneName":"leftThumbDistal","x":0,"y":0,"z":0},{"boneName":"leftIndexProximal","x":0,"y":0,"z":0},{"boneName":"leftIndexIntermediate","x":0,"y":0,"z":0},{"boneName":"leftIndexDistal","x":0,"y":0,"z":0},{"boneName":"leftMiddleProximal","x":0,"y":0,"z":0},{"boneName":"leftMiddleIntermediate","x":0,"y":0,"z":0},{"boneName":"leftMiddleDistal","x":0,"y":0,"z":0},{"boneName":"leftRingProximal","x":0,"y":0,"z":0},{"boneName":"leftRingIntermediate","x":0,"y":0,"z":0},{"boneName":"leftRingDistal","x":0,"y":0,"z":0},{"boneName":"leftLittleProximal","x":0,"y":0,"z":0},{"boneName":"leftLittleIntermediate","x":0,"y":0,"z":0},{"boneName":"leftLittleDistal","x":0,"y":0,"z":0},{"boneName":"rightShoulder","x":0,"y":0,"z":0},{"boneName":"rightUpperArm","x":-0.09424777960769379,"y":1.5707963267948966,"z":1.0367255756846319},{"boneName":"rightLowerArm","x":0,"y":0.4084070449666731,"z":0},{"boneName":"rightHand","x":0,"y":0,"z":0},{"boneName":"rightLittleProximal","x":0,"y":0,"z":0},{"boneName":"rightLittleIntermediate","x":0,"y":0,"z":0},{"boneName":"rightLittleDistal","x":0,"y":0,"z":0},{"boneName":"rightRingProximal","x":0,"y":0,"z":0},{"boneName":"rightRingIntermediate","x":0,"y":0,"z":0},{"boneName":"rightRingDistal","x":0,"y":0,"z":0},{"boneName":"rightMiddleProximal","x":0,"y":0,"z":0},{"boneName":"rightMiddleIntermediate","x":0,"y":0,"z":0},{"boneName":"rightMiddleDistal","x":0,"y":0,"z":0},{"boneName":"rightIndexProximal","x":0,"y":0,"z":0},{"boneName":"rightIndexIntermediate","x":0,"y":0,"z":0},{"boneName":"rightIndexDistal","x":0,"y":0,"z":0},{"boneName":"rightThumbMetacarpal","x":0,"y":0,"z":0},{"boneName":"rightThumbProximal","x":0,"y":0,"z":0},{"boneName":"rightThumbDistal","x":0,"y":0,"z":0},{"boneName":"leftUpperLeg","x":-0.7853981633974483,"y":-0.37699111843077515,"z":-0.18849555921538758},{"boneName":"leftLowerLeg","x":2.199114857512855,"y":0.031415926535897934,"z":-0.031415926535897934},{"boneName":"leftFoot","x":0.6283185307179586,"y":0.15707963267948966,"z":0.031415926535897934},{"boneName":"leftToes","x":0,"y":0,"z":0},{"boneName":"rightUpperLeg","x":-0.8482300164692442,"y":0.3141592653589793,"z":0},{"boneName":"rightLowerLeg","x":2.199114857512855,"y":-0.5340707511102649,"z":-0.15707963267948966},{"boneName":"rightFoot","x":0.6283185307179586,"y":-0.031415926535897934,"z":0.12566370614359174},{"boneName":"rightToes","x":0,"y":0,"z":0}]},{"name":"pose2","poseData":[{"boneName":"hips","x":0,"y":0,"z":0},{"boneName":"spine","x":0.3141592653589793,"y":-0.12566370614359174,"z":-0.15707963267948966},{"boneName":"chest","x":0,"y":0,"z":0},{"boneName":"upperChest","x":0,"y":0,"z":0},{"boneName":"neck","x":-0.5340707511102649,"y":0,"z":0},{"boneName":"head","x":0,"y":0,"z":0},{"boneName":"leftShoulder","x":0,"y":0,"z":0},{"boneName":"leftUpperArm","x":-0.25132741228718347,"y":0.4084070449666731,"z":-0.9424777960769379},{"boneName":"leftLowerArm","x":-0.4084070449666731,"y":0,"z":-1.2566370614359172},{"boneName":"leftHand","x":-0.47123889803846897,"y":0,"z":-0.3141592653589793},{"boneName":"leftThumbMetacarpal","x":0,"y":0,"z":0},{"boneName":"leftThumbProximal","x":0,"y":0,"z":0},{"boneName":"leftThumbDistal","x":0,"y":0,"z":0},{"boneName":"leftIndexProximal","x":0,"y":0,"z":0},{"boneName":"leftIndexIntermediate","x":0,"y":0,"z":0},{"boneName":"leftIndexDistal","x":0,"y":0,"z":0},{"boneName":"leftMiddleProximal","x":0,"y":0,"z":0},{"boneName":"leftMiddleIntermediate","x":0,"y":0,"z":0},{"boneName":"leftMiddleDistal","x":0,"y":0,"z":0},{"boneName":"leftRingProximal","x":0,"y":0,"z":0},{"boneName":"leftRingIntermediate","x":0,"y":0,"z":0},{"boneName":"leftRingDistal","x":0,"y":0,"z":0},{"boneName":"leftLittleProximal","x":0,"y":0,"z":0},{"boneName":"leftLittleIntermediate","x":0,"y":0,"z":0},{"boneName":"leftLittleDistal","x":0,"y":0,"z":0},{"boneName":"rightShoulder","x":0,"y":0,"z":0},{"boneName":"rightUpperArm","x":-0.21991148575128555,"y":0.25132741228718347,"z":1.2566370614359172},{"boneName":"rightLowerArm","x":0.031415926535897934,"y":-0.031415926535897934,"z":0.34557519189487723},{"boneName":"rightHand","x":0,"y":0,"z":0},{"boneName":"rightLittleProximal","x":0,"y":0,"z":0},{"boneName":"rightLittleIntermediate","x":0,"y":0,"z":0},{"boneName":"rightLittleDistal","x":0,"y":0,"z":0},{"boneName":"rightRingProximal","x":0,"y":0,"z":0},{"boneName":"rightRingIntermediate","x":0,"y":0,"z":0},{"boneName":"rightRingDistal","x":0,"y":0,"z":0},{"boneName":"rightMiddleProximal","x":0,"y":0,"z":0},{"boneName":"rightMiddleIntermediate","x":0,"y":0,"z":0},{"boneName":"rightMiddleDistal","x":0,"y":0,"z":0},{"boneName":"rightIndexProximal","x":0,"y":0,"z":0},{"boneName":"rightIndexIntermediate","x":0,"y":0,"z":0},{"boneName":"rightIndexDistal","x":0,"y":0,"z":0},{"boneName":"rightThumbMetacarpal","x":0,"y":0,"z":0},{"boneName":"rightThumbProximal","x":0,"y":0,"z":0},{"boneName":"rightThumbDistal","x":0,"y":0,"z":0},{"boneName":"leftUpperLeg","x":-0.25132741228718347,"y":-0.06283185307179587,"z":0.47123889803846897},{"boneName":"leftLowerLeg","x":1.7278759594743864,"y":0.5654866776461628,"z":0},{"boneName":"leftFoot","x":0.6283185307179586,"y":-0.09424777960769379,"z":0},{"boneName":"leftToes","x":0,"y":0,"z":0},{"boneName":"rightUpperLeg","x":-0.34557519189487723,"y":-0.06283185307179587,"z":-0.34557519189487723},{"boneName":"rightLowerLeg","x":2.1362830044410597,"y":0,"z":0.031415926535897934},{"boneName":"rightFoot","x":-0.47123889803846897,"y":0,"z":0},{"boneName":"rightToes","x":0,"y":0,"z":0}]}]}
 
 
sd-3dmodel-loader/public/favicon.ico DELETED
Binary file (3.87 kB)
 
sd-3dmodel-loader/public/index.html DELETED
@@ -1,15 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <title>React Three.js App</title>
7
- </head>
8
- <body>
9
- <div id="sd-3d-model-loader-container"></div>
10
- <script src="../js/3d-model-loader.bundle.js"></script>
11
- <script>
12
- create3dmodelLoaderApp(document.getElementById('sd-3d-model-loader-container'), 0);
13
- </script>
14
- </body>
15
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/public/logo192.png DELETED
Binary file (5.35 kB)
 
sd-3dmodel-loader/public/logo512.png DELETED
Binary file (9.66 kB)
 
sd-3dmodel-loader/public/manifest.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "short_name": "React App",
3
- "name": "Create React App Sample",
4
- "icons": [
5
- {
6
- "src": "favicon.ico",
7
- "sizes": "64x64 32x32 24x24 16x16",
8
- "type": "image/x-icon"
9
- },
10
- {
11
- "src": "logo192.png",
12
- "type": "image/png",
13
- "sizes": "192x192"
14
- },
15
- {
16
- "src": "logo512.png",
17
- "type": "image/png",
18
- "sizes": "512x512"
19
- }
20
- ],
21
- "start_url": ".",
22
- "display": "standalone",
23
- "theme_color": "#000000",
24
- "background_color": "#ffffff"
25
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/public/robots.txt DELETED
@@ -1,3 +0,0 @@
1
- # https://www.robotstxt.org/robotstxt.html
2
- User-agent: *
3
- Disallow:
 
 
 
 
sd-3dmodel-loader/scripts/__pycache__/main.cpython-310.pyc DELETED
Binary file (3.38 kB)
 
sd-3dmodel-loader/scripts/main.py DELETED
@@ -1,84 +0,0 @@
1
- import gradio as gr
2
-
3
- import modules.scripts as scripts
4
- from modules import script_callbacks
5
- from modules import shared
6
- from modules.shared import opts
7
- from modules import extensions
8
-
9
- import os
10
-
11
-
12
- class Script(scripts.Script):
13
- def __init__(self) -> None:
14
- super().__init__()
15
-
16
- def title(self):
17
- return "3D Model&Pose Loader"
18
-
19
- def show(self, is_img2img):
20
- return scripts.AlwaysVisible
21
-
22
- def ui(self, is_img2img):
23
- return ()
24
-
25
-
26
- def on_ui_tabs():
27
- with gr.Blocks(analytics_enabled=False) as threeDModel_loader:
28
- with gr.Row():
29
- gr.HTML('<div id="threeDModelLoader-container"></div>')
30
-
31
- import_id = 'WebGL-output-3dmodel-import'
32
-
33
- ext = get_self_extension()
34
-
35
- try:
36
- control_net_num = opts.control_net_max_models_num
37
- except:
38
- control_net_num = 0
39
-
40
- gr.HTML(f'<input type="hidden" id="threeDModelLoader-control-net-num" value="{control_net_num}" />', visible=False)
41
-
42
- if ext is None:
43
- return []
44
- js_ = [f'{x.path}?{os.path.getmtime(x.path)}' for x in ext.list_files('javascript/lazyload', '.js')]
45
- js_.insert(0, ext.path)
46
-
47
- gr.HTML(value='\n'.join(js_), elem_id=import_id, visible=False)
48
-
49
- return [(threeDModel_loader, "3D Model&Pose Loader", "3dmodel_loador")]
50
-
51
-
52
- def get_self_extension():
53
- if '__file__' in globals():
54
- filepath = __file__
55
- else:
56
- import inspect
57
- filepath = inspect.getfile(lambda: None)
58
- for ext in extensions.active():
59
- if ext.path in filepath:
60
- return ext
61
-
62
-
63
- def on_ui_settings():
64
- section = ('3dmodel', "3D Model&Pose")
65
- shared.opts.add_option("threeDmodel_bg_color", shared.OptionInfo(
66
- "#ffffff", "Canvas Background Color", gr.ColorPicker, {"interactive": True}, section=section))
67
- shared.opts.add_option("threeDmodel_ground_color", shared.OptionInfo(
68
- "#ffffff", "Canvas Ground Color", gr.ColorPicker, {"interactive": True}, section=section))
69
- shared.opts.add_option("threeDmodel_canvas_width", shared.OptionInfo(
70
- 512, "Canvas Width", gr.Slider, {"minimum": 64, "maximum": 2048, "step": 64, "interactive": True},
71
- section=section))
72
- shared.opts.add_option("threeDmodel_canvas_height", shared.OptionInfo(
73
- 512, "Canvas Height", gr.Slider, {"minimum": 64, "maximum": 2048, "step": 64, "interactive": True},
74
- section=section))
75
- shared.opts.add_option("threeDmodel_has_ground", shared.OptionInfo(
76
- True, "Show Ground", gr.Checkbox, {"interactive": True}, section=section))
77
- shared.opts.add_option("threeDmodel_has_ground_grid", shared.OptionInfo(
78
- True, "Show Grid", gr.Checkbox, {"interactive": True}, section=section))
79
- shared.opts.add_option("threeDmodel_has_axis", shared.OptionInfo(
80
- True, "Show Axis", gr.Checkbox, {"interactive": True}, section=section))
81
-
82
-
83
- script_callbacks.on_ui_tabs(on_ui_tabs)
84
- script_callbacks.on_ui_settings(on_ui_settings)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/src/AnimationPanel.js DELETED
@@ -1,50 +0,0 @@
1
- import React, {useState} from 'react';
2
- import Slider from '@mui/material/Slider';
3
- import Box from '@mui/material/Box';
4
- import {Accordion, AccordionSummary, AccordionDetails, Button} from '@mui/material';
5
- import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
6
-
7
- let _animationProgress;
8
-
9
- export function setAnimationProgress(animationProgress) {
10
- _animationProgress = animationProgress;
11
-
12
- //TODO need update progress bar here
13
- }
14
-
15
- function AnimationPanel({setAnimationPlaying, setAnimationStopPlaying, controlAnimation}) {
16
- const [value, setValue] = useState(0);
17
-
18
- return (
19
- <div>
20
- <Box mb={1} mt={1}>
21
- <Accordion>
22
- <AccordionSummary expandIcon={<ExpandMoreIcon/>}>
23
- Animation
24
- </AccordionSummary>
25
- <AccordionDetails>
26
- <Button variant="contained" color="primary" fullWidth sx={{margin: '2px'}} onClick={() => {
27
- if (setAnimationPlaying) {
28
- setAnimationPlaying();
29
- }
30
- }}>Play/Pause</Button>
31
- <Button variant="contained" color="primary" fullWidth sx={{margin: '2px'}}
32
- onClick={setAnimationStopPlaying}>Stop</Button>
33
- <Box width="100%">
34
- <Slider min={0} max={100}
35
- value={value}
36
- onChange={(event, newValue) => {
37
- setValue(newValue);
38
- controlAnimation(newValue);
39
- }}
40
- aria-labelledby="continuous-slider"
41
- />
42
- </Box>
43
- </AccordionDetails>
44
- </Accordion>
45
- </Box>
46
- </div>
47
- );
48
- }
49
-
50
- export default AnimationPanel;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/src/CameraPanel.js DELETED
@@ -1,58 +0,0 @@
1
- import React, {useState} from 'react';
2
- import Slider from '@mui/material/Slider';
3
- import Box from '@mui/material/Box';
4
- import {Accordion, AccordionSummary, AccordionDetails, Typography} from '@mui/material';
5
- import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
6
-
7
- function CameraPanel({setCameraNear, setCameraFar, setCameraFOV}) {
8
- const [far, setFar] = useState(1000);
9
- const [near, setNear] = useState(0.1);
10
- const [fov, setFOV] = useState(45);
11
-
12
- return (<div>
13
- <Box mb={1} mt={1}>
14
- <Accordion>
15
- <AccordionSummary expandIcon={<ExpandMoreIcon/>}>
16
- Camera
17
- </AccordionSummary>
18
- <AccordionDetails>
19
- <Box width="100%">
20
- <Typography gutterBottom>Near</Typography>
21
- <Slider min={0.1} max={100}
22
- valueLabelDisplay="auto"
23
- step={0.1}
24
- value={near}
25
- onChange={(event, newValue) => {
26
- setNear(newValue);
27
- setCameraNear(newValue);
28
- }}
29
- aria-labelledby="continuous-slider"
30
- />
31
- <Typography gutterBottom>Far</Typography>
32
- <Slider min={0.1} max={20000}
33
- valueLabelDisplay="auto"
34
- value={far}
35
- onChange={(event, newValue) => {
36
- setFar(newValue);
37
- setCameraFar(newValue)
38
- }}
39
- aria-labelledby="continuous-slider"
40
- />
41
- <Typography gutterBottom>FOV</Typography>
42
- <Slider min={1} max={100}
43
- valueLabelDisplay="auto"
44
- value={fov}
45
- onChange={(event, newValue) => {
46
- setFOV(newValue);
47
- setCameraFOV(newValue);
48
- }}
49
- aria-labelledby="continuous-slider"
50
- />
51
- </Box>
52
- </AccordionDetails>
53
- </Accordion>
54
- </Box>
55
- </div>);
56
- }
57
-
58
- export default CameraPanel;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/src/CanvasSettingsPanel.js DELETED
@@ -1,95 +0,0 @@
1
- import React, {useState} from 'react';
2
- import FormControlLabel from '@mui/material/FormControlLabel';
3
- import Checkbox from '@mui/material/Checkbox';
4
- import {SketchPicker} from 'react-color';
5
- import {Accordion, AccordionSummary, AccordionDetails} from '@mui/material';
6
- import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
7
- import Box from '@mui/material/Box';
8
-
9
- function CanvasSettingsPanel({setCanvasBgColor, setCanvasGround, setCanvasGrid, setCanvasAxis}) {
10
- const [bgColorChecked, setBgColorChecked] = useState(false);
11
- const [bgColor, setBgColor] = useState();
12
- const [groundChecked, setGroundChecked] = useState(true);
13
- const [axisChecked, setAxisChecked] = useState(true);
14
- const [gridChecked, setGridChecked] = useState(true);
15
-
16
- return (
17
- <div>
18
- <Box mb={1} mt={1}>
19
- <Accordion>
20
- <AccordionSummary expandIcon={<ExpandMoreIcon/>}>
21
- Canvas
22
- </AccordionSummary>
23
- <AccordionDetails>
24
- <FormControlLabel
25
- control={
26
- <Checkbox
27
- checked={bgColorChecked}
28
- onChange={(event) => {
29
- setBgColorChecked(event.target.checked);
30
- }}
31
- color="primary"
32
- />
33
- }
34
- label={'Background Color'}
35
- />
36
- {bgColorChecked && (
37
- <SketchPicker
38
- color={bgColor}
39
- onChangeComplete={(color) => {
40
- setBgColor(color);
41
- setCanvasBgColor(color);
42
- }}
43
- disableAlpha={true}
44
- />
45
- )}
46
- <FormControlLabel
47
- control={
48
- <Checkbox
49
- checked={groundChecked}
50
- onChange={(event) => {
51
- setGroundChecked(event.target.checked);
52
-
53
- if (setCanvasGround) {
54
- setCanvasGround(event.target.checked);
55
- }
56
- }}
57
- color="primary"
58
- />
59
- }
60
- label='Ground'
61
- />
62
- <FormControlLabel
63
- control={
64
- <Checkbox
65
- checked={gridChecked}
66
- onChange={(event) => {
67
- setGridChecked(event.target.checked);
68
- setCanvasGrid(event.target.checked)
69
- }}
70
- color="primary"
71
- />
72
- }
73
- label='Grid'
74
- />
75
- <FormControlLabel
76
- control={
77
- <Checkbox
78
- checked={axisChecked}
79
- onChange={(event) => {
80
- setAxisChecked(event.target.checked);
81
- setCanvasAxis(event.target.checked)
82
- }}
83
- color="primary"
84
- />
85
- }
86
- label='Axis'
87
- />
88
- </AccordionDetails>
89
- </Accordion>
90
- </Box>
91
- </div>
92
- );
93
- }
94
-
95
- export default CanvasSettingsPanel;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/src/ModelPanel.js DELETED
@@ -1,40 +0,0 @@
1
- import React from 'react';
2
- import {Accordion, AccordionSummary, AccordionDetails} from '@mui/material';
3
- import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
4
- import Box from '@mui/material/Box';
5
- import {Button} from "@mui/material";
6
-
7
- export default function ModelPanel({setUploadedModelFile}) {
8
- const loadSingleModel = () => {
9
- const input = document.createElement("input");
10
-
11
- input.type = "file";
12
- input.accept = ".obj, .stl, .fbx, .gltf, .glb, .dae, .vrm";
13
-
14
- input.addEventListener("change", function (e) {
15
- const file = e.target.files[0];
16
-
17
- if (setUploadedModelFile) {
18
- setUploadedModelFile(file);
19
- }
20
- });
21
-
22
- input.click();
23
- };
24
-
25
- return (
26
- <div>
27
- <Box mb={1} mt={1}>
28
- <Accordion>
29
- <AccordionSummary expandIcon={<ExpandMoreIcon/>}>
30
- Model
31
- </AccordionSummary>
32
- <AccordionDetails>
33
- <Button variant="contained" color="primary" fullWidth sx={{margin: '2px'}}
34
- onClick={loadSingleModel}>Load Model</Button>
35
- </AccordionDetails>
36
- </Accordion>
37
- </Box>
38
- </div>
39
- );
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/src/NumberInput.js DELETED
@@ -1,40 +0,0 @@
1
- import React, {useState} from "react";
2
- import {
3
- Button,
4
- TextField
5
- } from '@mui/material';
6
-
7
- const NumberInput = () => {
8
- const [value, setValue] = useState(0);
9
-
10
- const handleDecrease = () => {
11
- setValue(value - 1);
12
- };
13
-
14
- const handleIncrease = () => {
15
- setValue(value + 1);
16
- };
17
-
18
- const handleChange = (event) => {
19
- const newValue = parseInt(event.target.value);
20
- if (!isNaN(newValue)) {
21
- setValue(newValue);
22
- }
23
- };
24
-
25
- const containerStyle = {
26
- display: "flex",
27
- justifyContent: "space-between",
28
- alignItems: "center"
29
- };
30
-
31
- return (
32
- <div style={containerStyle}>
33
- <Button onClick={handleDecrease}>-</Button>
34
- <TextField value={value} onChange={handleChange}/>
35
- <Button onClick={handleIncrease}>+</Button>
36
- </div>
37
- );
38
- };
39
-
40
- export default NumberInput;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/src/PosePanel.js DELETED
@@ -1,434 +0,0 @@
1
- import React, {createContext, useContext, useEffect, useRef, useState} from 'react';
2
- import {
3
- Accordion,
4
- AccordionSummary,
5
- AccordionDetails, FormControl, FormLabel, RadioGroup, FormControlLabel, Radio,
6
- } from '@mui/material';
7
- import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
8
- import Box from '@mui/material/Box';
9
- import {Button} from "@mui/material";
10
- import {TreeItem, TreeView} from "@mui/lab";
11
- import ChevronRightIcon from "@mui/icons-material/ChevronRight";
12
-
13
-
14
- const ObjectContext = createContext([]);
15
-
16
- function useObjectUpdate() {
17
- const context = useContext(ObjectContext);
18
-
19
- if (!context) {
20
- throw new Error('useObjectUpdate must be used within ObjectProvider');
21
- }
22
-
23
- return context;
24
- }
25
-
26
- function ObjectProvider({children}) {
27
- const [objects, setObjects] = useState([]);
28
-
29
- const updateObjects = (newObjects) => {
30
- setObjects(newObjects);
31
- };
32
-
33
- return (<ObjectContext.Provider value={{objects, updateObjects}}>
34
- {children}
35
- </ObjectContext.Provider>);
36
- }
37
-
38
- function processNode(node, handlePoseSelectedObject, setSelectedObj, transformControlMap) {
39
- if (!node) {
40
- return null;
41
- }
42
-
43
- return (<TreeItem key={node.name} nodeId={node.name} label={node.name} onClick={(objEvent) => {
44
- const objName = objEvent.target.innerHTML;
45
-
46
- setSelectedObj(objName);
47
-
48
- handlePoseSelectedObject(objName, transformControlMap[objName]);
49
- }}>
50
- {node.children && node.children.map((child) => processNode(child, handlePoseSelectedObject, setSelectedObj, transformControlMap))}
51
-
52
- </TreeItem>);
53
- }
54
-
55
- const boneNameTransformMap = {
56
- 'hips': "none",
57
- 'spine': "none",
58
- 'chest': "none",
59
- 'upperChest': "none",
60
- 'neck': "none",
61
- 'head': "none",
62
- 'leftShoulder': "none",
63
- 'leftUpperArm': "none",
64
- 'leftLowerArm': "none",
65
- 'leftHand': "none",
66
- 'leftThumbMetacarpal': "none",
67
- 'leftThumbProximal': "none",
68
- 'leftThumbDistal': "none",
69
- 'leftIndexProximal': "none",
70
- 'leftIndexIntermediate': "none",
71
- 'leftIndexDistal': "none",
72
- 'leftMiddleProximal': "none",
73
- 'leftMiddleIntermediate': "none",
74
- 'leftMiddleDistal': "none",
75
- 'leftRingProximal': "none",
76
- 'leftRingIntermediate': "none",
77
- 'leftRingDistal': "none",
78
- 'leftLittleProximal': "none",
79
- 'leftLittleIntermediate': "none",
80
- 'leftLittleDistal': "none",
81
- 'rightShoulder': "none",
82
- 'rightUpperArm': "none",
83
- 'rightLowerArm': "none",
84
- 'rightHand': "none",
85
- 'rightLittleProximal': "none",
86
- 'rightLittleIntermediate': "none",
87
- 'rightLittleDistal': "none",
88
- 'rightRingProximal': "none",
89
- 'rightRingIntermediate': "none",
90
- 'rightRingDistal': "none",
91
- 'rightMiddleProximal': "none",
92
- 'rightMiddleIntermediate': "none",
93
- 'rightMiddleDistal': "none",
94
- 'rightIndexProximal': "none",
95
- 'rightIndexIntermediate': "none",
96
- 'rightIndexDistal': "none",
97
- 'rightThumbMetacarpal': "none",
98
- 'rightThumbProximal': "none",
99
- 'rightThumbDistal': "none",
100
- 'leftUpperLeg': "none",
101
- 'leftLowerLeg': "none",
102
- 'leftFoot': "none",
103
- 'leftToes': "none",
104
- 'rightUpperLeg': "none",
105
- 'rightLowerLeg': "none",
106
- 'rightFoot': "none",
107
- 'rightToes': "none"
108
- };
109
-
110
- const boneNameList = {
111
- "name": "body",
112
- "children": [
113
- {
114
- "name": "mainBody",
115
- "children": [
116
- {
117
- "name": "hips",
118
- },
119
- {
120
- "name": "spine",
121
- },
122
- {
123
- "name": "chest",
124
- },
125
- {
126
- "name": "upperChest",
127
- },
128
- {
129
- "name": "head",
130
- }
131
- ]
132
- },
133
- {
134
- "name": "leftArm",
135
- "children": [
136
- {
137
- "name": "leftShoulder",
138
- },
139
- {
140
- "name": "leftUpperArm",
141
- },
142
- {
143
- "name": "leftLowerArm",
144
- },
145
- {
146
- "name": "leftHand",
147
- "children": [
148
- {
149
- "name": "leftThumb",
150
- "children": [
151
- {
152
- "name": "leftThumbMetacarpal",
153
- },
154
- {
155
- "name": "leftThumbProximal",
156
- },
157
- {
158
- "name": "leftThumbDistal",
159
- },
160
- ]
161
- },
162
- {
163
- "name": "leftIndex",
164
- "children": [
165
- {
166
- "name": "leftIndexProximal",
167
- },
168
- {
169
- "name": "leftIndexIntermediate",
170
- },
171
- {
172
- "name": "leftIndexDistal",
173
- },
174
- ]
175
- },
176
- {
177
- "name": "leftMiddle",
178
- "children": [
179
- {
180
- "name": "leftMiddleProximal",
181
- },
182
- {
183
- "name": "leftMiddleIntermediate",
184
- },
185
- {
186
- "name": "leftMiddleDistal",
187
- },
188
- ]
189
- },
190
- {
191
- "name": "leftRing",
192
- "children": [
193
- {
194
- "name": "leftRingProximal",
195
- },
196
- {
197
- "name": "leftRingIntermediate",
198
- },
199
- {
200
- "name": "leftRingDistal",
201
- },
202
- ]
203
- },
204
- {
205
- "name": "leftLittle",
206
- "children": [
207
- {
208
- "name": "leftLittleProximal",
209
- },
210
- {
211
- "name": "leftLittleIntermediate",
212
- },
213
- {
214
- "name": "leftLittleDistal",
215
- }
216
- ]
217
- },
218
- ]
219
- },
220
- ]
221
- },
222
- {
223
- "name": "rightArm",
224
- "children": [
225
- {
226
- "name": "rightShoulder",
227
- },
228
- {
229
- "name": "rightUpperArm",
230
- },
231
- {
232
- "name": "rightLowerArm",
233
- },
234
- {
235
- "name": "rightHand",
236
- "children": [
237
- {
238
- "name": "rightThumb",
239
- "children": [
240
- {
241
- "name": "rightThumbMetacarpal",
242
- },
243
- {
244
- "name": "rightThumbProximal",
245
- },
246
- {
247
- "name": "rightThumbDistal",
248
- },
249
- ]
250
- },
251
- {
252
- "name": "rightIndex",
253
- "children": [
254
- {
255
- "name": "rightIndexProximal",
256
- },
257
- {
258
- "name": "rightIndexIntermediate",
259
- },
260
- {
261
- "name": "rightIndexDistal",
262
- },
263
- ]
264
- },
265
- {
266
- "name": "rightMiddle",
267
- "children": [
268
- {
269
- "name": "rightMiddleProximal",
270
- },
271
- {
272
- "name": "rightMiddleIntermediate",
273
- },
274
- {
275
- "name": "rightMiddleDistal",
276
- },
277
- ]
278
- },
279
- {
280
- "name": "rightRing",
281
- "children": [
282
- {
283
- "name": "rightRingProximal",
284
- },
285
- {
286
- "name": "rightRingIntermediate",
287
- },
288
- {
289
- "name": "rightRingDistal",
290
- },
291
- ]
292
- },
293
- {
294
- "name": "rightLittle",
295
- "children": [
296
- {
297
- "name": "rightLittleProximal",
298
- },
299
- {
300
- "name": "rightLittleIntermediate",
301
- },
302
- {
303
- "name": "rightLittleDistal",
304
- },
305
- ]
306
- }
307
- ]
308
- },
309
- ]
310
- },
311
- {
312
- "name": "leftLeg",
313
- "children": [
314
- {
315
- "name": "leftUpperLeg",
316
- },
317
- {
318
- "name": "leftLowerLeg",
319
- },
320
- {
321
- "name": "leftFoot",
322
- },
323
- {
324
- "name": "leftToes",
325
- }
326
- ]
327
- },
328
- {
329
- "name": "rightLeg",
330
- "children": [
331
- {
332
- "name": "rightUpperLeg",
333
- },
334
- {
335
- "name": "rightLowerLeg",
336
- },
337
- {
338
- "name": "rightFoot",
339
- },
340
- {
341
- "name": "rightToes",
342
- }
343
- ]
344
- }
345
- ]
346
- }
347
-
348
- function BodyTree({handlePoseSelectedObject, setSelectedObj, transformControlMap}) {
349
- return (<TreeView
350
- defaultCollapseIcon={<ExpandMoreIcon/>}
351
- defaultExpandIcon={<ChevronRightIcon/>}
352
- defaultEndIcon={<div/>}
353
- >
354
- {processNode(boneNameList, handlePoseSelectedObject, setSelectedObj, transformControlMap)}
355
- </TreeView>);
356
- }
357
-
358
- export default function PosePanel({
359
- setPoseModelFileName,
360
- handlePoseSelectedObject,
361
- }) {
362
- return (<ObjectProvider>
363
- <BodyTreeWrapper setPoseModelFileName={setPoseModelFileName}
364
- handlePoseSelectedObject={handlePoseSelectedObject}/>
365
- </ObjectProvider>)
366
- }
367
-
368
- function BodyTreeWrapper({
369
- setPoseModelFileName,
370
- handlePoseSelectedObject
371
- }) {
372
- const [selectedObj, setSelectedObj] = useState(null);
373
-
374
- const loadPoseModel = () => {
375
- setPoseModelFileName("pose.vrm");
376
- };
377
-
378
- const {updateObjects} = useObjectUpdate();
379
- const [transformControlMap, setTransformControlMap] = useState(boneNameTransformMap);
380
-
381
- const updateObjectsRef = useRef();
382
-
383
- updateObjectsRef.current = updateObjects;
384
-
385
- useEffect(() => {
386
- window.updateObjects = (newObjects) => {
387
- if (updateObjectsRef.current) {
388
- updateObjectsRef.current(newObjects);
389
- }
390
- };
391
- return () => {
392
- window.updateObjects = null;
393
- };
394
- }, []);
395
-
396
- return (<div>
397
- <Box mb={1} mt={1}>
398
- <Accordion>
399
- <AccordionSummary expandIcon={<ExpandMoreIcon/>}>
400
- Pose
401
- </AccordionSummary>
402
- <AccordionDetails>
403
- <Button variant="contained" color="primary" fullWidth sx={{margin: '2px'}}
404
- onClick={loadPoseModel}>Load Pose Model (VRM)</Button>
405
- <div><h6>Pose edit only supports VRM file currently.</h6></div>
406
- <BodyTree handlePoseSelectedObject={handlePoseSelectedObject} setSelectedObj={setSelectedObj} transformControlMap={transformControlMap}/>
407
- { (selectedObj in boneNameTransformMap) && <FormControl>
408
- <FormLabel>Operate</FormLabel>
409
- <RadioGroup
410
- aria-labelledby="operate-radio-buttons-group-label"
411
- defaultValue="none"
412
- name="operate-radio-buttons-group"
413
- row={true}
414
- onChange={(event) => {
415
- handlePoseSelectedObject(selectedObj, event.target.value);
416
-
417
- const updatedMap = {...transformControlMap};
418
-
419
- updatedMap[selectedObj] = event.target.value;
420
-
421
- setTransformControlMap(updatedMap);
422
- }}
423
- >
424
- <FormControlLabel value="none" control={<Radio/>} label="None"
425
- checked={transformControlMap[selectedObj] === "none"}/>
426
- <FormControlLabel value="rotate" control={<Radio/>} label="Rotate"
427
- checked={transformControlMap[selectedObj] === "rotate"}/>
428
- </RadioGroup>
429
- </FormControl>}
430
- </AccordionDetails>
431
- </Accordion>
432
- </Box>
433
- </div>);
434
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/src/ScenePanel.js DELETED
@@ -1,262 +0,0 @@
1
- import React, {createContext, useContext, useState, useEffect, useRef} from 'react';
2
- import {TreeView, TreeItem} from '@mui/lab';
3
- import {styled} from '@mui/system';
4
- import Box from '@mui/material/Box';
5
- import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
6
- import ChevronRightIcon from '@mui/icons-material/ChevronRight';
7
- import {
8
- Accordion,
9
- AccordionSummary,
10
- AccordionDetails,
11
- Button,
12
- FormControl,
13
- Radio,
14
- RadioGroup,
15
- FormLabel,
16
- FormControlLabel,
17
- Typography
18
- } from '@mui/material';
19
- import Checkbox from "@mui/material/Checkbox";
20
- import Slider from "@mui/material/Slider";
21
- import {SketchPicker} from "react-color";
22
- import NumberInput from "./NumberInput.js";
23
-
24
- const CustomTreeView = styled(TreeView)`
25
- height: 240px;
26
- overflow-y: auto;
27
- `;
28
-
29
- const transformControlObjNames = ["Hemisphere Light", "Directional Light"];
30
- let transformControlValues = {"Hemisphere Light": "none", "Directional Light": "none"};
31
-
32
- const treeItemObjNames = ["Scene", "mainObject", "Hemisphere Light", "Directional Light", "Ground", "Grid", "Axis", "Preview Camera"];
33
-
34
- const visibleControlObjNames = ["Directional Light", "Ground", "Grid", "Axis"];
35
-
36
- let visibleValues = {"Directional Light": true, "Ground": true, "Grid": true, "Axis": true};
37
-
38
- const ObjectContext = createContext([]);
39
-
40
- function useObjectUpdate() {
41
- const context = useContext(ObjectContext);
42
-
43
- if (!context) {
44
- throw new Error('useObjectUpdate must be used within ObjectProvider');
45
- }
46
-
47
- return context;
48
- }
49
-
50
- function ObjectProvider({children}) {
51
- const [objects, setObjects] = useState([]);
52
-
53
- const updateObjects = (newObjects) => {
54
- setObjects(newObjects);
55
- };
56
-
57
- return (<ObjectContext.Provider value={{objects, updateObjects}}>
58
- {children}
59
- </ObjectContext.Provider>);
60
- }
61
-
62
- function processNode(node, handleSelectedObject, setSelectedObj, transformControlMap) {
63
- if (!node) {
64
- return null;
65
- }
66
-
67
- if (!(treeItemObjNames.includes(node.name) || node.name.startsWith("mainObject"))) {
68
- return null;
69
- }
70
-
71
- return (<TreeItem key={node.uuid} nodeId={node.uuid} label={node.name || node.type} onClick={(objEvent) => {
72
- const objName = objEvent.target.innerHTML;
73
-
74
- handleSelectedObject(objName, transformControlMap[objName]);
75
- setSelectedObj(objName);
76
- }}>
77
- {node.children && node.children.map((child) => processNode(child, handleSelectedObject, setSelectedObj, transformControlMap))}
78
- </TreeItem>);
79
- }
80
-
81
- function ScenePanel({
82
- refreshSceneTree,
83
- handleSelectedObject,
84
- setVisible,
85
- setCameraNear,
86
- setCameraFar,
87
- setCameraFOV,
88
- setCanvasBgColor,
89
- removeObject
90
- }) {
91
- return (<ObjectProvider>
92
- <SceneTreeWrapper refreshSceneTree={refreshSceneTree} handleSelectedObject={handleSelectedObject}
93
- setVisible={setVisible}
94
- setCameraNear={setCameraNear} setCameraFar={setCameraFar} setCameraFOV={setCameraFOV}
95
- setCanvasBgColor={setCanvasBgColor} removeObject={removeObject}/>
96
- </ObjectProvider>)
97
- }
98
-
99
- function SceneTree({handleSelectedObject, setSelectedObj, transformControlMap}) {
100
- const {objects} = useObjectUpdate();
101
-
102
- return (<TreeView
103
- defaultCollapseIcon={<ExpandMoreIcon/>}
104
- defaultExpandIcon={<ChevronRightIcon/>}
105
- defaultEndIcon={<div/>}
106
- >
107
- {processNode(objects.object, handleSelectedObject, setSelectedObj, transformControlMap)}
108
- </TreeView>);
109
- }
110
-
111
- function SceneTreeWrapper({
112
- refreshSceneTree,
113
- handleSelectedObject,
114
- setVisible,
115
- setCameraNear,
116
- setCameraFar,
117
- setCameraFOV,
118
- setCanvasBgColor,
119
- removeObject
120
- }) {
121
- const [selectedObj, setSelectedObj] = useState(null);
122
- const [far, setFar] = useState(1000);
123
- const [near, setNear] = useState(0.1);
124
- const [fov, setFOV] = useState(45);
125
- const [visibleMap, setVisibleMap] = useState(visibleValues);
126
- const [transformControlMap, setTransformControlMap] = useState(transformControlValues);
127
- const [bgColor, setBgColor] = useState();
128
-
129
- const {updateObjects} = useObjectUpdate();
130
-
131
- const updateObjectsRef = useRef();
132
-
133
- updateObjectsRef.current = updateObjects;
134
-
135
- useEffect(() => {
136
- window.updateObjects = (newObjects) => {
137
- if (updateObjectsRef.current) {
138
- updateObjectsRef.current(newObjects);
139
- }
140
- };
141
- return () => {
142
- window.updateObjects = null;
143
- };
144
- }, []);
145
-
146
- return (<div>
147
- <Box mb={1} mt={1}>
148
- <Accordion>
149
- <AccordionSummary expandIcon={<ExpandMoreIcon/>}>
150
- Scene
151
- </AccordionSummary>
152
- <AccordionDetails>
153
- <SceneTree handleSelectedObject={handleSelectedObject} setSelectedObj={setSelectedObj}
154
- transformControlMap={transformControlMap}/>
155
- <Button variant="contained" color="primary" fullWidth sx={{margin: '2px'}}
156
- onClick={refreshSceneTree}>Refresh Scene Tree</Button>
157
-
158
- {(transformControlObjNames.includes(selectedObj) || (selectedObj && selectedObj.startsWith("mainObject"))) &&
159
- <FormControl>
160
- <FormLabel>Operate</FormLabel>
161
- <RadioGroup
162
- aria-labelledby="operate-radio-buttons-group-label"
163
- defaultValue="none"
164
- name="operate-radio-buttons-group"
165
- row={true}
166
- onChange={(event) => {
167
- handleSelectedObject(selectedObj, event.target.value);
168
-
169
- const updatedMap = {...transformControlMap};
170
-
171
- updatedMap[selectedObj] = event.target.value;
172
-
173
- setTransformControlMap(updatedMap);
174
- }}
175
- >
176
- <FormControlLabel value="none" control={<Radio/>} label="None"
177
- checked={transformControlMap[selectedObj] === "none" || !transformControlMap[selectedObj]}/>
178
- <FormControlLabel value="translate" control={<Radio/>} label="Translate"
179
- checked={transformControlMap[selectedObj] === "translate"}/>
180
- <FormControlLabel value="rotate" control={<Radio/>} label="Rotate"
181
- checked={transformControlMap[selectedObj] === "rotate"}/>
182
- </RadioGroup>
183
- </FormControl>}
184
- {(visibleControlObjNames.includes(selectedObj) || (selectedObj && selectedObj.startsWith("mainObject"))) &&
185
- <FormControlLabel
186
- control={
187
- <Checkbox
188
- checked={visibleMap[selectedObj] || !(selectedObj in visibleMap)}
189
- onChange={(event) => {
190
- setVisible(selectedObj, event.target.checked);
191
-
192
- const updatedMap = {...visibleMap};
193
- updatedMap[selectedObj] = event.target.checked;
194
- setVisibleMap(updatedMap);
195
- }}
196
- color="primary"
197
- />
198
- }
199
- label='Visible'
200
- />
201
- }
202
- {
203
- selectedObj === "Preview Camera" && <Box width="100%">
204
- <Typography gutterBottom>Near</Typography>
205
- <Slider min={0.1} max={100}
206
- valueLabelDisplay="auto"
207
- step={0.1}
208
- value={near}
209
- onChange={(event, newValue) => {
210
- setNear(newValue);
211
- setCameraNear(newValue);
212
- }}
213
- aria-labelledby="continuous-slider"
214
- />
215
- <Typography gutterBottom>Far</Typography>
216
- <Slider min={0.1} max={20000}
217
- valueLabelDisplay="auto"
218
- value={far}
219
- onChange={(event, newValue) => {
220
- setFar(newValue);
221
- setCameraFar(newValue)
222
- }}
223
- aria-labelledby="continuous-slider"
224
- />
225
- <Typography gutterBottom>FOV</Typography>
226
- <Slider min={1} max={100}
227
- valueLabelDisplay="auto"
228
- value={fov}
229
- onChange={(event, newValue) => {
230
- setFOV(newValue);
231
- setCameraFOV(newValue);
232
- }}
233
- aria-labelledby="continuous-slider"
234
- />
235
- </Box>
236
- }
237
- {
238
- selectedObj && selectedObj.startsWith("mainObject") &&
239
- <Button variant="contained" color="primary" fullWidth sx={{margin: '2px'}}
240
- onClick={() => {
241
- removeObject(selectedObj);
242
- refreshSceneTree();
243
- setSelectedObj(null);
244
- }}>Remove</Button>
245
- }
246
- {
247
- selectedObj === "Scene" && <SketchPicker
248
- color={bgColor}
249
- onChangeComplete={(color) => {
250
- setBgColor(color);
251
- setCanvasBgColor(color);
252
- }}
253
- disableAlpha={true}
254
- />
255
- }
256
- </AccordionDetails>
257
- </Accordion>
258
- </Box>
259
- </div>);
260
- }
261
-
262
- export default ScenePanel;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/src/SendToControlNetPanel.js DELETED
@@ -1,87 +0,0 @@
1
- import React, {useState} from 'react';
2
- import Select from '@mui/material/Select';
3
- import MenuItem from '@mui/material/MenuItem';
4
- import FormControl from '@mui/material/FormControl';
5
- import InputLabel from '@mui/material/InputLabel';
6
- import {Accordion, AccordionSummary, AccordionDetails} from '@mui/material';
7
- import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
8
- import Box from '@mui/material/Box';
9
- import {Button} from "@mui/material";
10
- import Checkbox from "@mui/material/Checkbox";
11
- import FormControlLabel from "@mui/material/FormControlLabel";
12
-
13
- export default function SendToControlNetPanel({options, onValueChange, setRendererImage, sendImage, setPreviewSize}) {
14
- const [selectedValue, setSelectedValue] = useState('');
15
- const [sizeValue, setSizeValue] = useState('1:1');
16
- const sizes = [
17
- {label:"1:1", value:"1:1"},
18
- {label:"2:3", value:"2:3"},
19
- {label:"3:2", value:"3:2"}
20
- ];
21
-
22
- return (
23
- <div>
24
- <Box mb={1} mt={1}>
25
- <Accordion>
26
- <AccordionSummary expandIcon={<ExpandMoreIcon/>}>
27
- Send To ControlNet
28
- </AccordionSummary>
29
- <AccordionDetails>
30
- <FormControl variant="outlined" fullWidth sx={{margin: '2px'}}>
31
- <InputLabel htmlFor="dropdown-list">Select an option</InputLabel>
32
- <Select
33
- value={selectedValue}
34
- onChange={(event) => {
35
- setSelectedValue(event.target.value);
36
- if (onValueChange) {
37
- onValueChange(event.target.value);
38
- }
39
- }}
40
- label="ControlNet Index"
41
- inputProps={{
42
- name: 'dropdown-list',
43
- id: 'dropdown-list',
44
- }}
45
- >
46
- {options.map((option, index) => (
47
- <MenuItem key={index} value={option.value}>
48
- {option.label}
49
- </MenuItem>
50
- ))}
51
- </Select>
52
- </FormControl>
53
- <FormControl variant="outlined" fullWidth sx={{margin: '2px'}}>
54
- <InputLabel htmlFor="dropdown-list">Size</InputLabel>
55
- <Select
56
- value={sizeValue}
57
- onChange={(event) => {
58
- setSizeValue(event.target.value);
59
- if (setPreviewSize) {
60
- setPreviewSize(event.target.value);
61
- }
62
- }}
63
- label="Size"
64
- inputProps={{
65
- name: 'dropdown-list',
66
- id: 'dropdown-list',
67
- }}
68
- >
69
- {sizes.map((option, index) => (
70
- <MenuItem key={index} value={option.value}>
71
- {option.label}
72
- </MenuItem>
73
- ))}
74
- </Select>
75
- </FormControl>
76
- <Button variant="contained" color="primary" fullWidth sx={{margin: '2px'}} onClick={() => {
77
- setRendererImage(sendImage, selectedValue, 'txt2img');
78
- }}>Send to txt2img</Button>
79
- <Button variant="contained" color="primary" fullWidth sx={{margin: '2px'}} onClick={() => {
80
- setRendererImage(sendImage, selectedValue, 'img2img');
81
- }}>Send to img2img</Button>
82
- </AccordionDetails>
83
- </Accordion>
84
- </Box>
85
- </div>
86
- );
87
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sd-3dmodel-loader/src/ThreeJsScene.js DELETED
@@ -1,761 +0,0 @@
1
- import React, {useRef, useEffect} from 'react';
2
- import {OrbitControls} from 'three/addons/controls/OrbitControls.js';
3
- import * as THREE from 'three';
4
- import {TransformControls} from 'three/examples/jsm/controls/TransformControls';
5
- import {OBJLoader} from 'three/addons/loaders/OBJLoader.js';
6
- import {STLLoader} from 'three/addons/loaders/STLLoader.js';
7
- import {FBXLoader} from 'three/addons/loaders/FBXLoader.js';
8
- import {DRACOLoader} from 'three/addons/loaders/DRACOLoader.js';
9
- import {GLTFLoader} from 'three/addons/loaders/GLTFLoader.js';
10
- import {ColladaLoader} from 'three/addons/loaders/ColladaLoader.js';
11
- import {VRMLoaderPlugin, VRMUtils} from "@pixiv/three-vrm";
12
- import {setAnimationProgress} from './AnimationPanel'
13
-
14
- let _playing = true;
15
- let _renderer;
16
- let _container;
17
- let _camera;
18
- let _groundMesh;
19
- let _groundGrid;
20
- let _axis;
21
- let _action;
22
- let _mixer;
23
- let _totalTime;
24
- let _currentTime;
25
- let _progress;
26
- let _controlByProgressBar;
27
- let _secondCamera;
28
- let _scene;
29
-
30
- let previewWidth = 300;
31
- let previewHeight = 300;
32
-
33
- let _width;
34
- let _height;
35
- let _transformControls;
36
- let _orbitController;
37
- let _selectedObject;
38
- let _currentVRM;
39
-
40
- let _mainObjectCounter = 1;
41
-
42
- export function setPreviewSize(previewSize) {
43
- if (previewSize === "1:1") {
44
- previewWidth = 300;
45
- previewHeight = 300;
46
- } else if (previewSize === "2:3") {
47
- previewWidth = 300;
48
- previewHeight = 450;
49
- } else if (previewSize === "3:2") {
50
- previewWidth = 450;
51
- previewHeight = 300;
52
- }
53
- }
54
-
55
- export function removeObject(objName) {
56
- const object = _scene.getObjectByName(objName);
57
-
58
- if (object) {
59
- _scene.remove(object);
60
-
61
- _transformControls.detach();
62
- }
63
-
64
- if (_currentVRM && _currentVRM.scene.name === objName) {
65
- _currentVRM = undefined;
66
- }
67
- }
68
-
69
- export function handlePoseSelectedObject(objName, transformControlsMode) {
70
- if (transformControlsMode && transformControlsMode !== "none") {
71
- if (_currentVRM) {
72
- const boneNode = _currentVRM.humanoid.getNormalizedBoneNode(objName);
73
-
74
- if (boneNode) {
75
- _transformControls.setMode(transformControlsMode);
76
- _transformControls.attach(boneNode);
77
- }
78
- }
79
- } else {
80
- _transformControls.detach();
81
- }
82
- }
83
-
84
- export function handleSelectedObject(objName, transformControlsMode) {
85
- if (objName !== "Scene" && transformControlsMode && transformControlsMode !== "none") {
86
- _selectedObject = _scene.getObjectByName(objName);
87
-
88
- _transformControls.setMode(transformControlsMode);
89
-
90
- _transformControls.attach(_selectedObject);
91
- } else {
92
- _transformControls.detach();
93
- }
94
- }
95
-
96
- export function refreshSceneTree() {
97
- window.updateObjects(convertThreeJsObjects());
98
- }
99
-
100
- export function setFar(far) {
101
- _camera.far = far;
102
- _camera.updateProjectionMatrix();
103
- _secondCamera.far = far;
104
- _secondCamera.updateProjectionMatrix();
105
- }
106
-
107
- export function setNear(near) {
108
- _camera.near = near;
109
- _camera.updateProjectionMatrix();
110
- _secondCamera.near = near;
111
- _secondCamera.updateProjectionMatrix();
112
- }
113
-
114
- export function setFOV(fov) {
115
- _camera.fov = fov;
116
- _camera.updateProjectionMatrix();
117
- _secondCamera.fov = fov;
118
- _secondCamera.updateProjectionMatrix();
119
- }
120
-
121
- const observer = new IntersectionObserver((entries, observer) => {
122
- entries.forEach(entry => {
123
- if (entry.isIntersecting) {
124
- onWindowResize();
125
- }
126
- });
127
- });
128
-
129
- const onWindowResize = () => {
130
- _width = _container.clientWidth;
131
- _height = _container.clientHeight;
132
-
133
- _camera.aspect = _width / _height;
134
- _camera.updateProjectionMatrix();
135
-
136
- _renderer.setSize(_width, _height);
137
- };
138
-
139
- function checkDivVisible(div) {
140
- if ((div.offsetWidth > 0) && (div.offsetHeight > 0)) {
141
- return true;
142
- }
143
-
144
- return false;
145
- }
146
-
147
- function ThreeJsScene({uploadedModelFile}) {
148
- const containerRef = useRef();
149
- const managerRef = useRef();
150
- const sceneRef = useRef();
151
-
152
- useEffect(() => {
153
- _container = containerRef.current;
154
-
155
- _renderer = new THREE.WebGLRenderer({antialias: true, preserveDrawingBuffer: true,});
156
-
157
- _renderer.domElement.style.width = '100%';
158
- _renderer.domElement.style.height = '100%';
159
-
160
- _container.appendChild(_renderer.domElement);
161
-
162
- observer.observe(_container);
163
-
164
- _scene = new THREE.Scene();
165
- _scene.name = "Scene";
166
-
167
- sceneRef.current = _scene;
168
-
169
- _width = _container.clientWidth;
170
- _height = _container.clientHeight;
171
-
172
- managerRef.current = new THREE.LoadingManager();
173
-
174
- const hemisphereLight = new THREE.HemisphereLight(0xffffff, 0x444444);
175
-
176
- hemisphereLight.name = "Hemisphere Light";
177
- hemisphereLight.position.set(0, 200, 0);
178
-
179
- _scene.add(hemisphereLight);
180
-
181
- const directionalLight = new THREE.DirectionalLight(0xffffff);
182
-
183
- directionalLight.name = "Directional Light";
184
- directionalLight.position.set(0, 200, 100);
185
- directionalLight.castShadow = true;
186
- directionalLight.shadow.camera.top = 180;
187
- directionalLight.shadow.camera.bottom = -100;
188
- directionalLight.shadow.camera.left = -120;
189
- directionalLight.shadow.camera.right = 120;
190
-
191
- _scene.add(directionalLight);
192
-
193
- _camera = new THREE.PerspectiveCamera(45, _width / _height, 0.1, 1000);
194
-
195
- _camera.position.x = -30;
196
- _camera.position.y = 40;
197
- _camera.position.z = 30;
198
-
199
- _camera.lookAt(_scene.position);
200
-
201
- _renderer.setSize(_width, _height);
202
-
203
- const groundMaterial = new THREE.MeshBasicMaterial({color: 0xbebebe});
204
-
205
- _groundMesh = new THREE.Mesh(new THREE.PlaneBufferGeometry(2000, 2000), groundMaterial);
206
-
207
- _groundMesh.name = "Ground";
208
- _groundMesh.rotation.x = -Math.PI / 2;
209
- _groundMesh.receiveShadow = true;
210
-
211
- _scene.add(_groundMesh);
212
-
213
- _groundGrid = new THREE.GridHelper(2000, 20, 0x000000, 0x000000);
214
-
215
- _groundGrid.name = "Grid";
216
- _groundGrid.material.opacity = 0.2;
217
- _groundGrid.material.transparent = true;
218
-
219
- _scene.add(_groundGrid);
220
-
221
- _axis = new THREE.AxesHelper(2000);
222
-
223
- _axis.name = "Axis";
224
-
225
- _scene.add(_axis);
226
-
227
- _orbitController = new OrbitControls(_camera, _renderer.domElement);
228
-
229
- _orbitController.mouseButtons = {LEFT: THREE.MOUSE.ROTATE, MIDDLE: THREE.MOUSE.PAN, RIGHT: THREE.MOUSE.PAN};
230
-
231
- const clock = new THREE.Clock();
232
-
233
- _secondCamera = new THREE.PerspectiveCamera(45, previewWidth / previewHeight, 0.1, 1000);
234
-
235
- _secondCamera.name = "Preview Camera";
236
-
237
- _secondCamera.position.copy(_camera.position);
238
-
239
- _secondCamera.quaternion.copy(_camera.quaternion);
240
-
241
- const orbitController2 = new OrbitControls(_secondCamera, _renderer.domElement);
242
- orbitController2.mouseButtons = {LEFT: THREE.MOUSE.ROTATE, MIDDLE: THREE.MOUSE.PAN, RIGHT: THREE.MOUSE.PAN};
243
- _scene.add(_secondCamera);
244
-
245
- _transformControls = new TransformControls(_camera, _renderer.domElement);
246
-
247
- _transformControls.name = "Transform Controls";
248
-
249
- _transformControls.addEventListener('dragging-changed', (event) => {
250
- _orbitController.enabled = !event.value;
251
- orbitController2.enabled = !event.value;
252
- });
253
-
254
- _scene.add(_transformControls);
255
- const animate = () => {
256
- requestAnimationFrame(animate);
257
-
258
- if (checkDivVisible(_container)) {
259
- _orbitController.update();
260
-
261
- let delta = clock.getDelta();
262
-
263
- if (_mixer && _playing) {
264
- _currentTime = _mixer.time % _totalTime;
265
-
266
- _progress = ((_currentTime / _totalTime) * 100).toFixed(1);
267
-
268
- setAnimationProgress(_progress);
269
- }
270
-
271
- if (_mixer && (_playing || _controlByProgressBar)) {
272
- _mixer.update(delta);
273
-
274
- if (!_currentVRM) {
275
- _controlByProgressBar = false;
276
- }
277
- }
278
-
279
- if ((_currentVRM && _playing) || (_currentVRM && _controlByProgressBar)) {
280
- _currentVRM.update(delta);
281
-
282
- _controlByProgressBar = false;
283
- }
284
-
285
- _renderer.setViewport(0, 0, _container.clientWidth, _container.clientHeight);
286
- _renderer.setScissor(0, 0, _container.clientWidth, _container.clientHeight);
287
- _renderer.setScissorTest(true);
288
- _camera.updateProjectionMatrix();
289
-
290
- _renderer.render(_scene, _camera);
291
-
292
- orbitController2.update()
293
-
294
- _renderer.setViewport(0, 0, previewWidth, previewHeight);
295
- _renderer.setScissor(0, 0, previewWidth, previewHeight);
296
- _renderer.setScissorTest(true);
297
-
298
- _secondCamera.aspect = previewWidth / previewHeight;
299
- _secondCamera.updateProjectionMatrix();
300
-
301
- _renderer.render(_scene, _secondCamera);
302
- }
303
- };
304
-
305
- if (window.updateObjects) {
306
- window.updateObjects(convertThreeJsObjects());
307
- }
308
-
309
- window.addEventListener('resize', onWindowResize);
310
-
311
- animate();
312
-
313
- return () => {
314
- // 组件卸载时的清理操作
315
- window.removeEventListener('resize', onWindowResize);
316
- };
317
- }, []);
318
-
319
- function isGLTF1(contents) {
320
- let resultContent;
321
-
322
- if (typeof contents === 'string') {
323
- resultContent = contents;
324
- } else {
325
- const magic = THREE.LoaderUtils.decodeText(new Uint8Array(contents, 0, 4));
326
-
327
- if (magic === 'glTF') {
328
- const version = new DataView(contents).getUint32(4, true);
329
-
330
- return version < 2;
331
-
332
- } else {
333
- resultContent = THREE.LoaderUtils.decodeText(new Uint8Array(contents));
334
- }
335
- }
336
-
337
- const json = JSON.parse(resultContent);
338
-
339
- return (json.asset !== undefined && json.asset.version[0] < 2);
340
- }
341
-
342
- function loadOBJ(event) {
343
- const contents = event.target.result;
344
-
345
- const mainObject = new OBJLoader().parse(contents);
346
-
347
- mainObject.name = "mainObject" + _mainObjectCounter.toString();
348
-
349
- _mainObjectCounter++;
350
-
351
- scaleObjectToProper(mainObject);
352
-
353
- _scene.add(mainObject);
354
-
355
- window.updateObjects(convertThreeJsObjects());
356
- }
357
-
358
- function loadSTL(event) {
359
- const contents = event.target.result;
360
- const geometry = new STLLoader().parse(contents);
361
- const material = new THREE.MeshStandardMaterial();
362
-
363
- geometry.sourceType = "stl";
364
- //geometry.sourceFile = file.name;
365
-
366
- const mainObject = new THREE.Mesh(geometry, material);
367
-
368
- mainObject.name = "mainObject" + _mainObjectCounter.toString();
369
-
370
- _mainObjectCounter++;
371
-
372
- scaleObjectToProper(mainObject);
373
-
374
- _scene.add(mainObject);
375
-
376
- window.updateObjects(convertThreeJsObjects());
377
- }
378
-
379
- // eslint-disable-next-line react-hooks/exhaustive-deps
380
- function loadFBX(event) {
381
- const contents = event.target.result;
382
- const loader = new FBXLoader(managerRef.current);
383
- const mainObject = loader.parse(contents);
384
- _mixer = new THREE.AnimationMixer(mainObject);
385
-
386
- if (mainObject.animations[0]) {
387
- _action = _mixer.clipAction(mainObject.animations[0]);
388
-
389
- if (_playing) {
390
- _action.play();
391
- }
392
-
393
- const clip = _action.getClip();
394
-
395
- _totalTime = clip.duration;
396
- }
397
-
398
- mainObject.traverse(function (child) {
399
- if (child.isMesh) {
400
- child.castShadow = true;
401
- child.receiveShadow = true;
402
- }
403
- });
404
-
405
- mainObject.name = "mainObject" + _mainObjectCounter.toString();
406
-
407
- _mainObjectCounter++;
408
-
409
- scaleObjectToProper(mainObject);
410
-
411
- _scene.add(mainObject);
412
-
413
- window.updateObjects(convertThreeJsObjects());
414
- }
415
-
416
- // eslint-disable-next-line react-hooks/exhaustive-deps
417
- function loadGLTF(event) {
418
- const contents = event.target.result;
419
-
420
- let loader;
421
-
422
- if (isGLTF1(contents)) {
423
- alert('Import of glTF asset not possible. Only versions >= 2.0 are supported. Please try to upgrade the file to glTF 2.0 using glTF-Pipeline.');
424
- } else {
425
- const dracoLoader = new DRACOLoader();
426
- dracoLoader.setDecoderPath('/file=extensions/sd-3dmodel-loader/js/');
427
-
428
- loader = new GLTFLoader(managerRef.current);
429
- loader.setDRACOLoader(dracoLoader);
430
- }
431
-
432
- loader.parse(contents, '', function (result) {
433
- const resultScene = result.scene;
434
- resultScene.name = "mainObject" + _mainObjectCounter.toString();
435
-
436
- _mainObjectCounter++;
437
-
438
- resultScene.animations.push(...result.animations);
439
-
440
- _scene.add(resultScene);
441
-
442
- window.updateObjects(convertThreeJsObjects());
443
- });
444
- }
445
-
446
- function loadGLB(event) {
447
- const contents = event.target.result;
448
-
449
- const dracoLoader = new DRACOLoader();
450
- dracoLoader.setDecoderPath('/file=extensions/sd-3dmodel-loader/js/');
451
-
452
- const loader = new GLTFLoader();
453
-
454
- loader.setDRACOLoader(dracoLoader);
455
-
456
- loader.parse(contents, '', function (result) {
457
- const resultScene = result.scene;
458
- resultScene.name = "mainObject" + _mainObjectCounter.toString();
459
-
460
- _mainObjectCounter++;
461
-
462
- resultScene.animations.push(...result.animations);
463
-
464
- _scene.add(resultScene);
465
-
466
- window.updateObjects(convertThreeJsObjects());
467
- });
468
- }
469
-
470
- // eslint-disable-next-line react-hooks/exhaustive-deps
471
- function loadDAE(event) {
472
- const contents = event.target.result;
473
-
474
- const loader = new ColladaLoader(managerRef.current);
475
-
476
- const collada = loader.parse(contents);
477
-
478
- collada.scene.name = "mainObject" + _mainObjectCounter.toString();
479
-
480
- _mainObjectCounter++;
481
-
482
- _scene.add(collada.scene);
483
-
484
- window.updateObjects(convertThreeJsObjects());
485
- }
486
-
487
- // eslint-disable-next-line react-hooks/exhaustive-deps
488
- function loadVRM(event) {
489
- const contents = event.target.result;
490
-
491
- const loader = new GLTFLoader(managerRef.current);
492
-
493
- loader.register((parser) => {
494
- return new VRMLoaderPlugin(parser);
495
- });
496
-
497
- loader.parse(contents, '', function (result) {
498
- const vrm = result.userData.vrm;
499
-
500
- if (!_currentVRM) {
501
- _currentVRM = vrm;
502
- }
503
-
504
- const resultScene = vrm.scene;
505
-
506
- resultScene.name = "mainObject" + _mainObjectCounter.toString();
507
-
508
- _mainObjectCounter++;
509
-
510
- scaleObjectToProper(resultScene);
511
-
512
- _scene.add(resultScene);
513
-
514
- window.updateObjects(convertThreeJsObjects());
515
- });
516
- }
517
-
518
-
519
- useEffect(() => {
520
- if (uploadedModelFile) {
521
- const filename = uploadedModelFile.name;
522
- const extension = filename.split('.').pop().toLowerCase();
523
- const reader = new FileReader();
524
-
525
- //removeMainObject();
526
-
527
- switch (extension) {
528
- case 'obj':
529
- reader.addEventListener('load', loadOBJ, false);
530
-
531
- reader.readAsText(uploadedModelFile);
532
-
533
- break;
534
- case 'stl':
535
- reader.addEventListener('load', loadSTL, false);
536
-
537
- if (reader.readAsBinaryString !== undefined) {
538
- reader.readAsBinaryString(uploadedModelFile);
539
- } else {
540
- reader.readAsArrayBuffer(uploadedModelFile);
541
- }
542
-
543
- break;
544
- case 'fbx':
545
- reader.addEventListener('load', loadFBX, false);
546
- reader.readAsArrayBuffer(uploadedModelFile);
547
- break;
548
- case 'gltf':
549
- reader.addEventListener('load', loadGLTF, false);
550
- reader.readAsArrayBuffer(uploadedModelFile);
551
- break;
552
- case 'glb':
553
- reader.addEventListener('load', loadGLB, false);
554
-
555
- reader.readAsArrayBuffer(uploadedModelFile);
556
-
557
- break;
558
- case 'dae':
559
- reader.addEventListener('load', loadDAE, false);
560
-
561
- reader.readAsText(uploadedModelFile);
562
-
563
- break;
564
- case 'vrm':
565
- reader.addEventListener('load', loadVRM, false);
566
-
567
- reader.readAsArrayBuffer(uploadedModelFile);
568
-
569
- break;
570
- }
571
-
572
-
573
- }
574
-
575
- }, [uploadedModelFile, loadOBJ, loadSTL, loadFBX, loadGLTF, loadDAE, loadVRM]);
576
-
577
- return (
578
- <div ref={containerRef} style={{width: '100%', height: '100%'}}></div>
579
- );
580
- }
581
-
582
- function scaleObjectToProper(object) {
583
- const boundingBox = new THREE.Box3();
584
-
585
- boundingBox.setFromObject(object);
586
-
587
- if (object.geometry) {
588
- const center = new THREE.Vector3();
589
-
590
- boundingBox.getCenter(center);
591
-
592
- object.geometry.translate(-center.x, -center.y, -center.z);
593
- }
594
-
595
- const expectRadius = 20;
596
-
597
- const radius = boundingBox.getBoundingSphere(new THREE.Sphere()).radius;
598
-
599
- const modelScale = expectRadius / radius;
600
-
601
- object.scale.set(modelScale, modelScale, modelScale);
602
- }
603
-
604
- export function loadPoseModel(poseModelFileName) {
605
- if (poseModelFileName && !_currentVRM) {
606
- let manager = new THREE.LoadingManager();
607
-
608
- let path = "/file=extensions/sd-3dmodel-loader/models/" + poseModelFileName;
609
- //let path = "/file=/modelss/" + poseModelFileName;
610
-
611
- const ext = poseModelFileName.split('.').pop().toLowerCase()
612
-
613
- switch (ext) {
614
- case "vrm": {
615
- const loader = new GLTFLoader(manager);
616
- loader.crossOrigin = 'anonymous';
617
-
618
- loader.register((parser) => {
619
- return new VRMLoaderPlugin(parser);
620
- });
621
-
622
- loader.load(
623
- path,
624
- (gltf) => {
625
- const vrm = gltf.userData.vrm;
626
-
627
- const resultScene = vrm.scene;
628
-
629
- resultScene.name = "mainObject" + _mainObjectCounter.toString();
630
-
631
- _mainObjectCounter++;
632
-
633
- scaleObjectToProper(resultScene);
634
-
635
- _scene.add(resultScene);
636
-
637
- _currentVRM = vrm;
638
-
639
- vrm.scene.traverse((obj) => {
640
- obj.frustumCulled = false;
641
- });
642
-
643
- VRMUtils.rotateVRM0(vrm);
644
- }
645
- )
646
- break;
647
- }
648
- case "fbx": {
649
- const loader = new FBXLoader(manager);
650
- loader.load(path, (object) => {
651
- object.traverse(function (child) {
652
- if (child.isMesh) {
653
- child.castShadow = true;
654
- child.receiveShadow = true;
655
- }
656
- });
657
-
658
- object.name = "mainObject";
659
-
660
- scaleObjectToProper(object);
661
-
662
- _scene.add(object);
663
- });
664
-
665
- break;
666
- }
667
- }
668
- }
669
- }
670
-
671
- export function convertThreeJsObjects() {
672
- return _scene.toJSON();
673
- }
674
-
675
- export default ThreeJsScene;
676
-
677
- export function setBgColor(bgColor) {
678
- const backgroundColor = new THREE.Color(bgColor.hex);
679
-
680
- _renderer.setClearColor(backgroundColor);
681
- }
682
-
683
- export function setPlaying() {
684
- _playing = !_playing;
685
-
686
- if (_action && _playing) {
687
- _action.play();
688
- }
689
- }
690
-
691
- export function setStopPlaying() {
692
- if (_action) {
693
- _action.stop();
694
- }
695
-
696
- _playing = false;
697
- }
698
-
699
- export function setVisible(objName, visible) {
700
- if (_scene) {
701
- const selectedObject = _scene.getObjectByName(objName);
702
-
703
- selectedObject.visible = visible;
704
- }
705
- }
706
-
707
- export function controlAnimationProgress(e) {
708
- if (_action && !_playing) {
709
- _currentTime = e / 100 * _totalTime;
710
-
711
- _action.time = _currentTime;
712
- _mixer.time = _currentTime;
713
-
714
- _controlByProgressBar = true;
715
- }
716
- }
717
-
718
- export function setRendererImage(sendImage, controlNetIndex, type) {
719
- if (controlNetIndex !== '') {
720
- _renderer.domElement.toBlob((blob) => {
721
- const image = new Image();
722
-
723
- image.onload = function () {
724
- const canvas = document.createElement('canvas');
725
-
726
- const canvas2 = document.createElement('canvas');
727
-
728
- canvas.width = _width;
729
- canvas.height = _height;
730
-
731
- const ctx = canvas.getContext('2d');
732
-
733
- ctx.drawImage(image, 0, 0);
734
-
735
- const imageData = ctx.getImageData(0, image.height - previewHeight, previewWidth, previewHeight);
736
-
737
- canvas2.width = previewWidth;
738
- canvas2.height = previewHeight;
739
-
740
- const ctx2 = canvas2.getContext('2d');
741
-
742
- canvas2.width = previewWidth;
743
- canvas2.height = previewHeight;
744
-
745
- ctx2.putImageData(imageData, 0, 0);
746
-
747
- canvas2.toBlob((blob2) => {
748
- const file = new File([blob2], "pose.png")
749
- const dt = new DataTransfer();
750
- dt.items.add(file);
751
-
752
- sendImage(type, controlNetIndex, dt);
753
- });
754
- };
755
-
756
- image.src = URL.createObjectURL(blob);
757
- });
758
- } else {
759
- alert('No ControlNet Selected');
760
- }
761
- }