file-viewer3 1.0.26 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (359) hide show
  1. package/README.en.md +7 -377
  2. package/README.md +8 -352
  3. package/dist/file-viewer3.css +1 -2
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.js +2 -0
  6. package/package.json +27 -129
  7. package/dist/components/3MFLoader.js +0 -527
  8. package/dist/components/AMFLoader.js +0 -188
  9. package/dist/components/ArchiveViewer.js +0 -526
  10. package/dist/components/AudioViewer.js +0 -66
  11. package/dist/components/CadViewer.js +0 -9040
  12. package/dist/components/CodeViewer.js +0 -151
  13. package/dist/components/ColladaLoader.js +0 -2282
  14. package/dist/components/DrawingViewer.js +0 -295
  15. package/dist/components/EdaViewer.js +0 -630
  16. package/dist/components/EmailViewer.js +0 -276
  17. package/dist/components/EpubViewer.js +0 -172
  18. package/dist/components/FBXLoader.js +0 -1574
  19. package/dist/components/GLTFLoader.js +0 -1383
  20. package/dist/components/ImageViewer.js +0 -1519
  21. package/dist/components/KMZLoader.js +0 -45
  22. package/dist/components/MarkdownViewer.js +0 -1476
  23. package/dist/components/ModelViewer.js +0 -797
  24. package/dist/components/OBJLoader.js +0 -287
  25. package/dist/components/OfdViewer.js +0 -133
  26. package/dist/components/PCDLoader.js +0 -141
  27. package/dist/components/PLYLoader.js +0 -305
  28. package/dist/components/PdfView.js +0 -27667
  29. package/dist/components/PptxRender.js +0 -11217
  30. package/dist/components/STLLoader.js +0 -83
  31. package/dist/components/TDSLoader.js +0 -228
  32. package/dist/components/TypstViewer.js +0 -1697
  33. package/dist/components/USDLoader.js +0 -2526
  34. package/dist/components/UmdViewer.js +0 -1873
  35. package/dist/components/VRMLLoader.js +0 -6422
  36. package/dist/components/VTKLoader.js +0 -337
  37. package/dist/components/XYZLoader.js +0 -30
  38. package/dist/components/XlsxTable.js +0 -7879
  39. package/dist/components/__vite-browser-external.js +0 -7
  40. package/dist/components/_plugin-vue_export-helper.js +0 -8
  41. package/dist/components/ar-SA-G6X2FPQ2.js +0 -523
  42. package/dist/components/arc.js +0 -79
  43. package/dist/components/architecture-7EHR7CIX.js +0 -3
  44. package/dist/components/architectureDiagram-3BPJPVTR.js +0 -4096
  45. package/dist/components/archive.js +0 -24
  46. package/dist/components/asyncToGenerator.js +0 -29
  47. package/dist/components/audio.js +0 -19
  48. package/dist/components/az-AZ-76LH7QW2.js +0 -523
  49. package/dist/components/bash.js +0 -169
  50. package/dist/components/bg-BG-XCXSNQG7.js +0 -523
  51. package/dist/components/blockDiagram-GPEHLZMM.js +0 -3357
  52. package/dist/components/bn-BD-2XOGV67Q.js +0 -523
  53. package/dist/components/c4Diagram-AAUBKEIU.js +0 -2957
  54. package/dist/components/ca-ES-6MX7JW3Y.js +0 -523
  55. package/dist/components/cad.js +0 -23
  56. package/dist/components/cfb.js +0 -1174
  57. package/dist/components/channel.js +0 -5
  58. package/dist/components/chunk-2J33WTMH.js +0 -26
  59. package/dist/components/chunk-3OPIFGDE.js +0 -4167
  60. package/dist/components/chunk-4BX2VUAB.js +0 -19
  61. package/dist/components/chunk-55IACEB6.js +0 -9
  62. package/dist/components/chunk-5ZQYHXKU.js +0 -669
  63. package/dist/components/chunk-6U3AYISY.js +0 -624
  64. package/dist/components/chunk-727SXJPM.js +0 -3356
  65. package/dist/components/chunk-AGHRB4JF.js +0 -324
  66. package/dist/components/chunk-AQP2D5EJ.js +0 -2055
  67. package/dist/components/chunk-BSJP7CBP.js +0 -83
  68. package/dist/components/chunk-CSCIHK7Q.js +0 -3500
  69. package/dist/components/chunk-EIO257PC.js +0 -1836
  70. package/dist/components/chunk-FMBD7UC4.js +0 -5
  71. package/dist/components/chunk-K2UTITRG.js +0 -17627
  72. package/dist/components/chunk-KSCS5N6A.js +0 -572
  73. package/dist/components/chunk-L5ZTLDWV.js +0 -40
  74. package/dist/components/chunk-LZXEDZCA.js +0 -60
  75. package/dist/components/chunk-ND2GUHAM.js +0 -61
  76. package/dist/components/chunk-NNHCCRGN.js +0 -20425
  77. package/dist/components/chunk-NZK2D7GU.js +0 -68
  78. package/dist/components/chunk-O5CBEL6O.js +0 -1894
  79. package/dist/components/chunk-QZHKN3VN.js +0 -12
  80. package/dist/components/chunk-SRAX5OIU.js +0 -22
  81. package/dist/components/chunk-WU5MYG2G.js +0 -14
  82. package/dist/components/chunk-XPW4576I.js +0 -1146
  83. package/dist/components/chunk-Z3N5DIM6.js +0 -59
  84. package/dist/components/chunk-ZUYEQ4TG.js +0 -22
  85. package/dist/components/chunk.js +0 -23
  86. package/dist/components/classDiagram-4FO5ZUOK.js +0 -29
  87. package/dist/components/classDiagram-v2-Q7XG4LA2.js +0 -29
  88. package/dist/components/compiler.js +0 -2
  89. package/dist/components/core.js +0 -845
  90. package/dist/components/cose-bilkent-S5V4N54A.js +0 -2268
  91. package/dist/components/cpp.js +0 -225
  92. package/dist/components/cs-CZ-2BRQDIVT.js +0 -523
  93. package/dist/components/csharp.js +0 -260
  94. package/dist/components/css.js +0 -140
  95. package/dist/components/cytoscape.esm.js +0 -18114
  96. package/dist/components/da-DK-5WZEPLOC.js +0 -523
  97. package/dist/components/dagre-BM42HDAG.js +0 -325
  98. package/dist/components/dagre.js +0 -1936
  99. package/dist/components/de-DE-XR44H4JA.js +0 -523
  100. package/dist/components/defaultLocale.js +0 -201
  101. package/dist/components/defineProperty.js +0 -50
  102. package/dist/components/diagram-2AECGRRQ.js +0 -229
  103. package/dist/components/diagram-5GNKFQAL.js +0 -108
  104. package/dist/components/diagram-KO2AKTUF.js +0 -443
  105. package/dist/components/diagram-LMA3HP47.js +0 -139
  106. package/dist/components/diagram-OG6HWLK6.js +0 -541
  107. package/dist/components/diff.js +0 -39
  108. package/dist/components/directory-open-01563666.js +0 -26
  109. package/dist/components/directory-open-4ed118d0.js +0 -83
  110. package/dist/components/dist.js +0 -50
  111. package/dist/components/dist2.js +0 -3291
  112. package/dist/components/dist3.js +0 -1593
  113. package/dist/components/documentSearch.js +0 -378
  114. package/dist/components/docx-preview.js +0 -3113
  115. package/dist/components/drawing.js +0 -19
  116. package/dist/components/ebook.js +0 -16
  117. package/dist/components/eda.js +0 -20
  118. package/dist/components/el-GR-BZB4AONW.js +0 -523
  119. package/dist/components/email.js +0 -21
  120. package/dist/components/en-B4ZKOASM.js +0 -3
  121. package/dist/components/erDiagram-TEJ5UH35.js +0 -1719
  122. package/dist/components/es-ES-U4NZUMDT.js +0 -523
  123. package/dist/components/eu-ES-A7QVB2H4.js +0 -523
  124. package/dist/components/eventmodeling-FCH6USID.js +0 -3
  125. package/dist/components/fa-IR-HGAKTJCU.js +0 -523
  126. package/dist/components/fflate.module.js +0 -323
  127. package/dist/components/fi-FI-Z5N7JZ37.js +0 -523
  128. package/dist/components/file-open-002ab408.js +0 -38
  129. package/dist/components/file-open-7c801643.js +0 -24
  130. package/dist/components/file-save-3189631c.js +0 -40
  131. package/dist/components/file-save-745eba88.js +0 -36
  132. package/dist/components/flowDiagram-I6XJVG4X.js +0 -4181
  133. package/dist/components/fr-FR-RHASNOE6.js +0 -523
  134. package/dist/components/ganttDiagram-6RSMTGT7.js +0 -2182
  135. package/dist/components/gitGraph-WXDBUCRP.js +0 -3
  136. package/dist/components/gitGraphDiagram-PVQCEYII.js +0 -788
  137. package/dist/components/gl-ES-HMX3MZ6V.js +0 -523
  138. package/dist/components/global-compiler.js +0 -23
  139. package/dist/components/global-renderer.js +0 -23
  140. package/dist/components/go.js +0 -140
  141. package/dist/components/graphlib.js +0 -1267
  142. package/dist/components/he-IL-6SHJWFNN.js +0 -523
  143. package/dist/components/hi-IN-IWLTKZ5I.js +0 -523
  144. package/dist/components/hu-HU-A5ZG7DT2.js +0 -523
  145. package/dist/components/id-ID-SAP4L64H.js +0 -523
  146. package/dist/components/image-GAAHSSAO.js +0 -3
  147. package/dist/components/image-blob-reduce.esm.js +0 -1429
  148. package/dist/components/image.js +0 -17
  149. package/dist/components/info-J43DQDTF.js +0 -3
  150. package/dist/components/infoDiagram-5YYISTIA.js +0 -26
  151. package/dist/components/ini.js +0 -88
  152. package/dist/components/init.js +0 -15
  153. package/dist/components/ishikawaDiagram-YF4QCWOH.js +0 -718
  154. package/dist/components/it-IT-JPQ66NNP.js +0 -523
  155. package/dist/components/ja-JP-DBVTYXUO.js +0 -523
  156. package/dist/components/java.js +0 -169
  157. package/dist/components/javascript.js +0 -436
  158. package/dist/components/journeyDiagram-JHISSGLW.js +0 -885
  159. package/dist/components/json.js +0 -36
  160. package/dist/components/jszip.min.js +0 -3033
  161. package/dist/components/kaa-6HZHGXH3.js +0 -523
  162. package/dist/components/kab-KAB-ZGHBKWFO.js +0 -523
  163. package/dist/components/kanban-definition-UN3LZRKU.js +0 -986
  164. package/dist/components/katex.js +0 -21979
  165. package/dist/components/kk-KZ-P5N5QNE5.js +0 -523
  166. package/dist/components/km-KH-HSX4SM5Z.js +0 -523
  167. package/dist/components/ko-KR-MTYHY66A.js +0 -523
  168. package/dist/components/ku-TR-6OUDTVRD.js +0 -523
  169. package/dist/components/lib.js +0 -4877
  170. package/dist/components/libarchive.js +0 -360
  171. package/dist/components/linear.js +0 -289
  172. package/dist/components/lt-LT-XHIRWOB4.js +0 -523
  173. package/dist/components/lv-LV-5QDEKY6T.js +0 -523
  174. package/dist/components/markdown.js +0 -181
  175. package/dist/components/md.js +0 -17
  176. package/dist/components/mermaid-parser.core.js +0 -328
  177. package/dist/components/mindmap-definition-RKZ34NQL.js +0 -1016
  178. package/dist/components/model.js +0 -21
  179. package/dist/components/mp4.js +0 -12
  180. package/dist/components/mr-IN-CRQNXWMA.js +0 -523
  181. package/dist/components/my-MM-5M5IBNSE.js +0 -523
  182. package/dist/components/nb-NO-T6EIAALU.js +0 -523
  183. package/dist/components/nestedRender.js +0 -158
  184. package/dist/components/nl-NL-IS3SIHDZ.js +0 -523
  185. package/dist/components/nn-NO-6E72VCQL.js +0 -523
  186. package/dist/components/objectSpread2.js +0 -29
  187. package/dist/components/objectWithoutProperties.js +0 -28
  188. package/dist/components/oc-FR-POXYY2M6.js +0 -523
  189. package/dist/components/ofd.js +0 -5261
  190. package/dist/components/ofd2.js +0 -16
  191. package/dist/components/ordinal.js +0 -65
  192. package/dist/components/pa-IN-N4M65BXN.js +0 -523
  193. package/dist/components/packet-YPE3B663.js +0 -3
  194. package/dist/components/pdf.js +0 -24
  195. package/dist/components/percentages-BXMCSKIN.js +0 -3
  196. package/dist/components/php.js +0 -294
  197. package/dist/components/pica.js +0 -1009
  198. package/dist/components/pie-LRSECV5Y.js +0 -3
  199. package/dist/components/pie.js +0 -47
  200. package/dist/components/pieDiagram-4H26LBE5.js +0 -130
  201. package/dist/components/pl-PL-T2D74RX3.js +0 -523
  202. package/dist/components/postal-mime.js +0 -3146
  203. package/dist/components/pptx.js +0 -15
  204. package/dist/components/printLayout.js +0 -42
  205. package/dist/components/prod.js +0 -21770
  206. package/dist/components/pt-BR-5N22H2LF.js +0 -523
  207. package/dist/components/pt-PT-UZXXM6DQ.js +0 -523
  208. package/dist/components/python.js +0 -238
  209. package/dist/components/quadrantDiagram-W4KKPZXB.js +0 -1988
  210. package/dist/components/radar-GUYGQ44K.js +0 -3
  211. package/dist/components/renderer.js +0 -2
  212. package/dist/components/requirementDiagram-4Y6WPE33.js +0 -2230
  213. package/dist/components/ro-RO-JPDTUUEW.js +0 -523
  214. package/dist/components/rough.esm.js +0 -1355
  215. package/dist/components/roundRect.js +0 -90
  216. package/dist/components/ru-RU-B4JR7IUQ.js +0 -523
  217. package/dist/components/rust.js +0 -169
  218. package/dist/components/sankeyDiagram-5OEKKPKP.js +0 -972
  219. package/dist/components/sequenceDiagram-3UESZ5HK.js +0 -4255
  220. package/dist/components/shared.js +0 -175
  221. package/dist/components/shared2.js +0 -4
  222. package/dist/components/si-LK-N5RQ5JYF.js +0 -523
  223. package/dist/components/sk-SK-C5VTKIMK.js +0 -523
  224. package/dist/components/sl-SI-NN7IZMDC.js +0 -523
  225. package/dist/components/sourceLoading.js +0 -134
  226. package/dist/components/sql.js +0 -118
  227. package/dist/components/src.js +0 -2664
  228. package/dist/components/src2.js +0 -10722
  229. package/dist/components/stateDiagram-AJRCARHV.js +0 -217
  230. package/dist/components/stateDiagram-v2-BHNVJYJU.js +0 -27
  231. package/dist/components/subset-shared.chunk.js +0 -3
  232. package/dist/components/subset-worker.chunk.js +0 -21
  233. package/dist/components/sv-SE-XGPEYMSR.js +0 -523
  234. package/dist/components/ta-IN-2NMHFXQM.js +0 -523
  235. package/dist/components/text.js +0 -20
  236. package/dist/components/th-TH-HPSO5L25.js +0 -523
  237. package/dist/components/three.module.js +0 -13134
  238. package/dist/components/time.js +0 -910
  239. package/dist/components/timeline-definition-PNZ67QCA.js +0 -1084
  240. package/dist/components/tr-TR-DEFEU3FU.js +0 -523
  241. package/dist/components/treeView-BLDUP644.js +0 -3
  242. package/dist/components/treemap-LRROVOQU.js +0 -3
  243. package/dist/components/typescript.js +0 -521
  244. package/dist/components/typst.js +0 -25
  245. package/dist/components/uk-UA-QMV73CPH.js +0 -523
  246. package/dist/components/umd.js +0 -16
  247. package/dist/components/use.js +0 -422
  248. package/dist/components/util.js +0 -49
  249. package/dist/components/vennDiagram-CIIHVFJN.js +0 -1880
  250. package/dist/components/vi-VN-M7AON7JQ.js +0 -523
  251. package/dist/components/viewerZoom.js +0 -92
  252. package/dist/components/wardley-L42UT6IY.js +0 -3
  253. package/dist/components/wardleyDiagram-YWT4CUSO.js +0 -656
  254. package/dist/components/wasm-pack-shim.js +0 -1711
  255. package/dist/components/wasm-pack-shim2.js +0 -934
  256. package/dist/components/wasm.js +0 -97
  257. package/dist/components/word.js +0 -3055
  258. package/dist/components/worker-ref.js +0 -16
  259. package/dist/components/xlsx.js +0 -21
  260. package/dist/components/xml.js +0 -166
  261. package/dist/components/xychartDiagram-2RQKCTM6.js +0 -2015
  262. package/dist/components/yaml.js +0 -144
  263. package/dist/components/zh-CN-LNUGB5OW.js +0 -523
  264. package/dist/components/zh-HK-E62DVLB3.js +0 -523
  265. package/dist/components/zh-TW-RAJ6MFWO.js +0 -523
  266. package/dist/index.mjs +0 -3293
  267. package/dist/src/App.vue.d.ts +0 -3
  268. package/dist/src/compare/CompareApp.vue.d.ts +0 -3
  269. package/dist/src/compare/main.d.ts +0 -0
  270. package/dist/src/compare/useSynchronizedScroll.d.ts +0 -7
  271. package/dist/src/components/HelloWorld.vue.d.ts +0 -3
  272. package/dist/src/components/utils.d.ts +0 -4
  273. package/dist/src/main.d.ts +0 -0
  274. package/dist/src/package/common/printCapability.d.ts +0 -27
  275. package/dist/src/package/common/printLayout.d.ts +0 -16
  276. package/dist/src/package/common/sourceLoading.d.ts +0 -10
  277. package/dist/src/package/common/type.d.ts +0 -544
  278. package/dist/src/package/common/util.d.ts +0 -5
  279. package/dist/src/package/common/worker-ref.d.ts +0 -12
  280. package/dist/src/package/components/FileViewer/FileViewer.vue.d.ts +0 -75
  281. package/dist/src/package/components/FileViewer/exportDocumentTemplate.d.ts +0 -9
  282. package/dist/src/package/components/FileViewer/hooks/useViewerDocumentFeatures.d.ts +0 -29
  283. package/dist/src/package/components/FileViewer/hooks/useViewerExport.d.ts +0 -21
  284. package/dist/src/package/components/FileViewer/hooks/useViewerWatermark.d.ts +0 -8
  285. package/dist/src/package/components/FileViewer/hooks/useViewerZoom.d.ts +0 -34
  286. package/dist/src/package/components/FileViewer/index.d.ts +0 -2
  287. package/dist/src/package/components/FileViewer/util.d.ts +0 -3
  288. package/dist/src/package/index.d.ts +0 -22
  289. package/dist/src/package/use/documentLocation.d.ts +0 -15
  290. package/dist/src/package/use/documentSearch.d.ts +0 -234
  291. package/dist/src/package/use/index.d.ts +0 -5
  292. package/dist/src/package/use/loading.d.ts +0 -33
  293. package/dist/src/package/use/viewerZoom.d.ts +0 -42
  294. package/dist/src/package/use/worker.d.ts +0 -24
  295. package/dist/src/package/vendors/archive/ArchiveViewer.vue.d.ts +0 -9
  296. package/dist/src/package/vendors/archive/cache.d.ts +0 -10
  297. package/dist/src/package/vendors/archive/fallback.d.ts +0 -9
  298. package/dist/src/package/vendors/archive/index.d.ts +0 -3
  299. package/dist/src/package/vendors/archive/shared.d.ts +0 -24
  300. package/dist/src/package/vendors/audio/AudioViewer.vue.d.ts +0 -7
  301. package/dist/src/package/vendors/audio/index.d.ts +0 -7
  302. package/dist/src/package/vendors/cad/CadViewer.vue.d.ts +0 -9
  303. package/dist/src/package/vendors/cad/index.d.ts +0 -8
  304. package/dist/src/package/vendors/drawing/DrawingViewer.vue.d.ts +0 -15
  305. package/dist/src/package/vendors/drawing/index.d.ts +0 -7
  306. package/dist/src/package/vendors/ebook/EpubViewer.vue.d.ts +0 -6
  307. package/dist/src/package/vendors/ebook/index.d.ts +0 -7
  308. package/dist/src/package/vendors/eda/EdaViewer.vue.d.ts +0 -8
  309. package/dist/src/package/vendors/eda/index.d.ts +0 -2
  310. package/dist/src/package/vendors/eda/parser.d.ts +0 -77
  311. package/dist/src/package/vendors/email/EmailViewer.vue.d.ts +0 -10
  312. package/dist/src/package/vendors/email/index.d.ts +0 -2
  313. package/dist/src/package/vendors/image/ImageViewer.vue.d.ts +0 -6
  314. package/dist/src/package/vendors/image/index.d.ts +0 -4
  315. package/dist/src/package/vendors/md/MarkdownViewer.vue.d.ts +0 -6
  316. package/dist/src/package/vendors/md/index.d.ts +0 -4
  317. package/dist/src/package/vendors/model/ModelViewer.vue.d.ts +0 -8
  318. package/dist/src/package/vendors/model/index.d.ts +0 -3
  319. package/dist/src/package/vendors/model/shared.d.ts +0 -1
  320. package/dist/src/package/vendors/mp4/index.d.ts +0 -4
  321. package/dist/src/package/vendors/nestedRender.d.ts +0 -10
  322. package/dist/src/package/vendors/ofd/OfdViewer.vue.d.ts +0 -6
  323. package/dist/src/package/vendors/ofd/index.d.ts +0 -7
  324. package/dist/src/package/vendors/pdf/PdfView.vue.d.ts +0 -10
  325. package/dist/src/package/vendors/pdf/index.d.ts +0 -2
  326. package/dist/src/package/vendors/pdf/worker/index.d.ts +0 -4
  327. package/dist/src/package/vendors/pdf/worker/pdf.worker.d.ts +0 -0
  328. package/dist/src/package/vendors/pptx/PptxRender.vue.d.ts +0 -9
  329. package/dist/src/package/vendors/pptx/index.d.ts +0 -6
  330. package/dist/src/package/vendors/pptx/options.d.ts +0 -39
  331. package/dist/src/package/vendors/pptx/support/chart.d.ts +0 -4
  332. package/dist/src/package/vendors/pptx/worker/index.d.ts +0 -4
  333. package/dist/src/package/vendors/renders.d.ts +0 -3
  334. package/dist/src/package/vendors/text/CodeViewer.vue.d.ts +0 -7
  335. package/dist/src/package/vendors/text/index.d.ts +0 -10
  336. package/dist/src/package/vendors/typst/TypstViewer.vue.d.ts +0 -15
  337. package/dist/src/package/vendors/typst/index.d.ts +0 -8
  338. package/dist/src/package/vendors/umd/UmdViewer.vue.d.ts +0 -6
  339. package/dist/src/package/vendors/umd/index.d.ts +0 -7
  340. package/dist/src/package/vendors/umd/parser.d.ts +0 -30
  341. package/dist/src/package/vendors/word/doc.d.ts +0 -5
  342. package/dist/src/package/vendors/word/docx.d.ts +0 -5
  343. package/dist/src/package/vendors/word/docx.worker.d.ts +0 -1
  344. package/dist/src/package/vendors/word/index.d.ts +0 -3
  345. package/dist/src/package/vendors/xlsx/XlsxTable.state.d.ts +0 -80
  346. package/dist/src/package/vendors/xlsx/XlsxTable.view.d.ts +0 -25
  347. package/dist/src/package/vendors/xlsx/XlsxTable.vue.d.ts +0 -6
  348. package/dist/src/package/vendors/xlsx/index.d.ts +0 -6
  349. package/dist/src/package/vendors/xlsx/util.d.ts +0 -3
  350. package/dist/src/package/vendors/xlsx/worker/index.d.ts +0 -4
  351. package/dist/src/package/vendors/xlsx/worker/sheetjs/SheetJsModel.d.ts +0 -73
  352. package/dist/src/package/vendors/xlsx/worker/sheetjs/color.d.ts +0 -2
  353. package/dist/src/package/vendors/xlsx/worker/sheetjs/index.d.ts +0 -4
  354. package/dist/src/package/vendors/xlsx/worker/sheetjs/sheet.worker.d.ts +0 -1
  355. package/dist/style.css +0 -1
  356. package/dist/wasm/cad/dwfv-render.wasm +0 -0
  357. package/dist/wasm/cad/dwg-worker.js +0 -24
  358. package/dist/wasm/cad/libredwg-web.js +0 -15
  359. package/dist/wasm/cad/libredwg-web.wasm +0 -0
@@ -1,1383 +0,0 @@
1
- import { n as e, t } from "./objectSpread2.js";
2
- import { $ as n, A as r, B as i, Bt as a, C as o, Ct as s, Dt as c, E as l, Ft as u, G as d, H as f, Ht as p, I as m, K as h, L as g, M as _, Mt as v, N as ee, O as te, Ot as ne, P as re, Pt as y, R as ie, U as ae, V as oe, W as se, X as b, Z as ce, _t as le, at as x, bt as S, ct as ue, dt as de, et as fe, f as pe, ft as me, gt as he, ht as ge, it as C, k as _e, kt as ve, l as w, lt as ye, m as T, o as be, ot as xe, p as E, pt as Se, q as D, r as Ce, s as we, st as Te, tt as O, u as Ee, ut as k, vt as De, wt as A, x as Oe, yt as j, z as ke, zt as M } from "./three.module.js";
3
- //#region node_modules/.pnpm/three@0.184.0/node_modules/three/examples/jsm/utils/BufferGeometryUtils.js
4
- function N(e, t) {
5
- if (t === 0) return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), e;
6
- if (t === 2 || t === 1) {
7
- let n = e.getIndex();
8
- if (n === null) {
9
- let t = [], r = e.getAttribute("position");
10
- if (r !== void 0) {
11
- for (let e = 0; e < r.count; e++) t.push(e);
12
- e.setIndex(t), n = e.getIndex();
13
- } else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), e;
14
- }
15
- let r = n.count - 2, i = [];
16
- if (t === 2) for (let e = 1; e <= r; e++) i.push(n.getX(0)), i.push(n.getX(e)), i.push(n.getX(e + 1));
17
- else for (let e = 0; e < r; e++) e % 2 == 0 ? (i.push(n.getX(e)), i.push(n.getX(e + 1)), i.push(n.getX(e + 2))) : (i.push(n.getX(e + 2)), i.push(n.getX(e + 1)), i.push(n.getX(e)));
18
- i.length / 3 !== r && console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");
19
- let a = e.clone();
20
- return a.setIndex(i), a.clearGroups(), a;
21
- } else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", t), e;
22
- }
23
- //#endregion
24
- //#region node_modules/.pnpm/three@0.184.0/node_modules/three/examples/jsm/utils/SkeletonUtils.js
25
- function Ae(e) {
26
- let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = e.clone();
27
- return P(e, r, function(e, r) {
28
- t.set(r, e), n.set(e, r);
29
- }), r.traverse(function(e) {
30
- if (!e.isSkinnedMesh) return;
31
- let r = e, i = t.get(e), a = i.skeleton.bones;
32
- r.skeleton = i.skeleton.clone(), r.bindMatrix.copy(i.bindMatrix), r.skeleton.bones = a.map(function(e) {
33
- return n.get(e);
34
- }), r.bind(r.skeleton, r.bindMatrix);
35
- }), r;
36
- }
37
- function P(e, t, n) {
38
- n(e, t);
39
- for (let r = 0; r < e.children.length; r++) P(e.children[r], t.children[r], n);
40
- }
41
- //#endregion
42
- //#region node_modules/.pnpm/three@0.184.0/node_modules/three/examples/jsm/loaders/GLTFLoader.js
43
- e();
44
- var je = class extends h {
45
- constructor(e) {
46
- super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(e) {
47
- return new Ie(e);
48
- }), this.register(function(e) {
49
- return new Le(e);
50
- }), this.register(function(e) {
51
- return new Ke(e);
52
- }), this.register(function(e) {
53
- return new qe(e);
54
- }), this.register(function(e) {
55
- return new Je(e);
56
- }), this.register(function(e) {
57
- return new ze(e);
58
- }), this.register(function(e) {
59
- return new Be(e);
60
- }), this.register(function(e) {
61
- return new Ve(e);
62
- }), this.register(function(e) {
63
- return new He(e);
64
- }), this.register(function(e) {
65
- return new Fe(e);
66
- }), this.register(function(e) {
67
- return new Ue(e);
68
- }), this.register(function(e) {
69
- return new Re(e);
70
- }), this.register(function(e) {
71
- return new Ge(e);
72
- }), this.register(function(e) {
73
- return new We(e);
74
- }), this.register(function(e) {
75
- return new Ne(e);
76
- }), this.register(function(e) {
77
- return new L(e, I.EXT_MESHOPT_COMPRESSION);
78
- }), this.register(function(e) {
79
- return new L(e, I.KHR_MESHOPT_COMPRESSION);
80
- }), this.register(function(e) {
81
- return new Ye(e);
82
- });
83
- }
84
- load(e, t, n, r) {
85
- let i = this, a;
86
- if (this.resourcePath !== "") a = this.resourcePath;
87
- else if (this.path !== "") {
88
- let t = D.extractUrlBase(e);
89
- a = D.resolveURL(t, this.path);
90
- } else a = D.extractUrlBase(e);
91
- this.manager.itemStart(e);
92
- let s = function(t) {
93
- r ? r(t) : console.error(t), i.manager.itemError(e), i.manager.itemEnd(e);
94
- }, c = new o(this.manager);
95
- c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(this.withCredentials), c.load(e, function(n) {
96
- try {
97
- i.parse(n, a, function(n) {
98
- t(n), i.manager.itemEnd(e);
99
- }, s);
100
- } catch (e) {
101
- s(e);
102
- }
103
- }, n, s);
104
- }
105
- setDRACOLoader(e) {
106
- return this.dracoLoader = e, this;
107
- }
108
- setKTX2Loader(e) {
109
- return this.ktx2Loader = e, this;
110
- }
111
- setMeshoptDecoder(e) {
112
- return this.meshoptDecoder = e, this;
113
- }
114
- register(e) {
115
- return this.pluginCallbacks.indexOf(e) === -1 && this.pluginCallbacks.push(e), this;
116
- }
117
- unregister(e) {
118
- return this.pluginCallbacks.indexOf(e) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e), 1), this;
119
- }
120
- parse(e, t, n, r) {
121
- let i, a = {}, o = {}, s = new TextDecoder();
122
- if (typeof e == "string") i = JSON.parse(e);
123
- else if (e instanceof ArrayBuffer) if (s.decode(new Uint8Array(e, 0, 4)) === R) {
124
- try {
125
- a[I.KHR_BINARY_GLTF] = new Xe(e);
126
- } catch (e) {
127
- r && r(e);
128
- return;
129
- }
130
- i = JSON.parse(a[I.KHR_BINARY_GLTF].content);
131
- } else i = JSON.parse(s.decode(e));
132
- else i = e;
133
- if (i.asset === void 0 || i.asset.version[0] < 2) {
134
- r && r(/* @__PURE__ */ Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
135
- return;
136
- }
137
- let c = new lt(i, {
138
- path: t || this.resourcePath || "",
139
- crossOrigin: this.crossOrigin,
140
- requestHeader: this.requestHeader,
141
- manager: this.manager,
142
- ktx2Loader: this.ktx2Loader,
143
- meshoptDecoder: this.meshoptDecoder
144
- });
145
- c.fileLoader.setRequestHeader(this.requestHeader);
146
- for (let e = 0; e < this.pluginCallbacks.length; e++) {
147
- let t = this.pluginCallbacks[e](c);
148
- t.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), o[t.name] = t, a[t.name] = !0;
149
- }
150
- if (i.extensionsUsed) for (let e = 0; e < i.extensionsUsed.length; ++e) {
151
- let t = i.extensionsUsed[e], n = i.extensionsRequired || [];
152
- switch (t) {
153
- case I.KHR_MATERIALS_UNLIT:
154
- a[t] = new Pe();
155
- break;
156
- case I.KHR_DRACO_MESH_COMPRESSION:
157
- a[t] = new Ze(i, this.dracoLoader);
158
- break;
159
- case I.KHR_TEXTURE_TRANSFORM:
160
- a[t] = new Qe();
161
- break;
162
- case I.KHR_MESH_QUANTIZATION:
163
- a[t] = new $e();
164
- break;
165
- default: n.indexOf(t) >= 0 && o[t] === void 0 && console.warn("THREE.GLTFLoader: Unknown extension \"" + t + "\".");
166
- }
167
- }
168
- c.setExtensions(a), c.setPlugins(o), c.parse(n, r);
169
- }
170
- parseAsync(e, t) {
171
- let n = this;
172
- return new Promise(function(r, i) {
173
- n.parse(e, t, r, i);
174
- });
175
- }
176
- };
177
- function Me() {
178
- let e = {};
179
- return {
180
- get: function(t) {
181
- return e[t];
182
- },
183
- add: function(t, n) {
184
- e[t] = n;
185
- },
186
- remove: function(t) {
187
- delete e[t];
188
- },
189
- removeAll: function() {
190
- e = {};
191
- }
192
- };
193
- }
194
- function F(e, t, n) {
195
- let r = e.json.materials[t];
196
- return r.extensions && r.extensions[n] ? r.extensions[n] : null;
197
- }
198
- var I = {
199
- KHR_BINARY_GLTF: "KHR_binary_glTF",
200
- KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression",
201
- KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual",
202
- KHR_MATERIALS_CLEARCOAT: "KHR_materials_clearcoat",
203
- KHR_MATERIALS_DISPERSION: "KHR_materials_dispersion",
204
- KHR_MATERIALS_IOR: "KHR_materials_ior",
205
- KHR_MATERIALS_SHEEN: "KHR_materials_sheen",
206
- KHR_MATERIALS_SPECULAR: "KHR_materials_specular",
207
- KHR_MATERIALS_TRANSMISSION: "KHR_materials_transmission",
208
- KHR_MATERIALS_IRIDESCENCE: "KHR_materials_iridescence",
209
- KHR_MATERIALS_ANISOTROPY: "KHR_materials_anisotropy",
210
- KHR_MATERIALS_UNLIT: "KHR_materials_unlit",
211
- KHR_MATERIALS_VOLUME: "KHR_materials_volume",
212
- KHR_TEXTURE_BASISU: "KHR_texture_basisu",
213
- KHR_TEXTURE_TRANSFORM: "KHR_texture_transform",
214
- KHR_MESH_QUANTIZATION: "KHR_mesh_quantization",
215
- KHR_MATERIALS_EMISSIVE_STRENGTH: "KHR_materials_emissive_strength",
216
- EXT_MATERIALS_BUMP: "EXT_materials_bump",
217
- EXT_TEXTURE_WEBP: "EXT_texture_webp",
218
- EXT_TEXTURE_AVIF: "EXT_texture_avif",
219
- EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
220
- KHR_MESHOPT_COMPRESSION: "KHR_meshopt_compression",
221
- EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
222
- }, Ne = class {
223
- constructor(e) {
224
- this.parser = e, this.name = I.KHR_LIGHTS_PUNCTUAL, this.cache = {
225
- refs: {},
226
- uses: {}
227
- };
228
- }
229
- _markDefs() {
230
- let e = this.parser, t = this.parser.json.nodes || [];
231
- for (let n = 0, r = t.length; n < r; n++) {
232
- let r = t[n];
233
- r.extensions && r.extensions[this.name] && r.extensions[this.name].light !== void 0 && e._addNodeRef(this.cache, r.extensions[this.name].light);
234
- }
235
- }
236
- _loadLight(e) {
237
- let t = this.parser, n = "light:" + e, r = t.cache.get(n);
238
- if (r) return r;
239
- let i = t.json, a = ((i.extensions && i.extensions[this.name] || {}).lights || [])[e], o, s = new E(16777215);
240
- a.color !== void 0 && s.setRGB(a.color[0], a.color[1], a.color[2], d);
241
- let c = a.range === void 0 ? 0 : a.range;
242
- switch (a.type) {
243
- case "directional":
244
- o = new Oe(s), o.target.position.set(0, 0, -1), o.add(o.target);
245
- break;
246
- case "point":
247
- o = new ge(s), o.distance = c;
248
- break;
249
- case "spot":
250
- o = new v(s), o.distance = c, a.spot = a.spot || {}, a.spot.innerConeAngle = a.spot.innerConeAngle === void 0 ? 0 : a.spot.innerConeAngle, a.spot.outerConeAngle = a.spot.outerConeAngle === void 0 ? Math.PI / 4 : a.spot.outerConeAngle, o.angle = a.spot.outerConeAngle, o.penumbra = 1 - a.spot.innerConeAngle / a.spot.outerConeAngle, o.target.position.set(0, 0, -1), o.add(o.target);
251
- break;
252
- default: throw Error("THREE.GLTFLoader: Unexpected light type: " + a.type);
253
- }
254
- return o.position.set(0, 0, 0), Z(o, a), a.intensity !== void 0 && (o.intensity = a.intensity), o.name = t.createUniqueName(a.name || "light_" + e), r = Promise.resolve(o), t.cache.add(n, r), r;
255
- }
256
- getDependency(e, t) {
257
- if (e === "light") return this._loadLight(t);
258
- }
259
- createNodeAttachment(e) {
260
- let t = this, n = this.parser, r = n.json.nodes[e], i = (r.extensions && r.extensions[this.name] || {}).light;
261
- return i === void 0 ? null : this._loadLight(i).then(function(e) {
262
- return n._getNodeRef(t.cache, i, e);
263
- });
264
- }
265
- }, Pe = class {
266
- constructor() {
267
- this.name = I.KHR_MATERIALS_UNLIT;
268
- }
269
- getMaterialType() {
270
- return O;
271
- }
272
- extendParams(e, t, n) {
273
- let r = [];
274
- e.color = new E(1, 1, 1), e.opacity = 1;
275
- let i = t.pbrMetallicRoughness;
276
- if (i) {
277
- if (Array.isArray(i.baseColorFactor)) {
278
- let t = i.baseColorFactor;
279
- e.color.setRGB(t[0], t[1], t[2], d), e.opacity = t[3];
280
- }
281
- i.baseColorTexture !== void 0 && r.push(n.assignTexture(e, "map", i.baseColorTexture, A));
282
- }
283
- return Promise.all(r);
284
- }
285
- }, Fe = class {
286
- constructor(e) {
287
- this.parser = e, this.name = I.KHR_MATERIALS_EMISSIVE_STRENGTH;
288
- }
289
- extendMaterialParams(e, t) {
290
- let n = F(this.parser, e, this.name);
291
- return n === null || n.emissiveStrength !== void 0 && (t.emissiveIntensity = n.emissiveStrength), Promise.resolve();
292
- }
293
- }, Ie = class {
294
- constructor(e) {
295
- this.parser = e, this.name = I.KHR_MATERIALS_CLEARCOAT;
296
- }
297
- getMaterialType(e) {
298
- return F(this.parser, e, this.name) === null ? null : C;
299
- }
300
- extendMaterialParams(e, t) {
301
- let n = F(this.parser, e, this.name);
302
- if (n === null) return Promise.resolve();
303
- let r = [];
304
- if (n.clearcoatFactor !== void 0 && (t.clearcoat = n.clearcoatFactor), n.clearcoatTexture !== void 0 && r.push(this.parser.assignTexture(t, "clearcoatMap", n.clearcoatTexture)), n.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = n.clearcoatRoughnessFactor), n.clearcoatRoughnessTexture !== void 0 && r.push(this.parser.assignTexture(t, "clearcoatRoughnessMap", n.clearcoatRoughnessTexture)), n.clearcoatNormalTexture !== void 0 && (r.push(this.parser.assignTexture(t, "clearcoatNormalMap", n.clearcoatNormalTexture)), n.clearcoatNormalTexture.scale !== void 0)) {
305
- let e = n.clearcoatNormalTexture.scale;
306
- t.clearcoatNormalScale = new M(e, e);
307
- }
308
- return Promise.all(r);
309
- }
310
- }, Le = class {
311
- constructor(e) {
312
- this.parser = e, this.name = I.KHR_MATERIALS_DISPERSION;
313
- }
314
- getMaterialType(e) {
315
- return F(this.parser, e, this.name) === null ? null : C;
316
- }
317
- extendMaterialParams(e, t) {
318
- let n = F(this.parser, e, this.name);
319
- return n === null || (t.dispersion = n.dispersion === void 0 ? 0 : n.dispersion), Promise.resolve();
320
- }
321
- }, Re = class {
322
- constructor(e) {
323
- this.parser = e, this.name = I.KHR_MATERIALS_IRIDESCENCE;
324
- }
325
- getMaterialType(e) {
326
- return F(this.parser, e, this.name) === null ? null : C;
327
- }
328
- extendMaterialParams(e, t) {
329
- let n = F(this.parser, e, this.name);
330
- if (n === null) return Promise.resolve();
331
- let r = [];
332
- return n.iridescenceFactor !== void 0 && (t.iridescence = n.iridescenceFactor), n.iridescenceTexture !== void 0 && r.push(this.parser.assignTexture(t, "iridescenceMap", n.iridescenceTexture)), n.iridescenceIor !== void 0 && (t.iridescenceIOR = n.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), n.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = n.iridescenceThicknessMinimum), n.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = n.iridescenceThicknessMaximum), n.iridescenceThicknessTexture !== void 0 && r.push(this.parser.assignTexture(t, "iridescenceThicknessMap", n.iridescenceThicknessTexture)), Promise.all(r);
333
- }
334
- }, ze = class {
335
- constructor(e) {
336
- this.parser = e, this.name = I.KHR_MATERIALS_SHEEN;
337
- }
338
- getMaterialType(e) {
339
- return F(this.parser, e, this.name) === null ? null : C;
340
- }
341
- extendMaterialParams(e, t) {
342
- let n = F(this.parser, e, this.name);
343
- if (n === null) return Promise.resolve();
344
- let r = [];
345
- if (t.sheenColor = new E(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1, n.sheenColorFactor !== void 0) {
346
- let e = n.sheenColorFactor;
347
- t.sheenColor.setRGB(e[0], e[1], e[2], d);
348
- }
349
- return n.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = n.sheenRoughnessFactor), n.sheenColorTexture !== void 0 && r.push(this.parser.assignTexture(t, "sheenColorMap", n.sheenColorTexture, A)), n.sheenRoughnessTexture !== void 0 && r.push(this.parser.assignTexture(t, "sheenRoughnessMap", n.sheenRoughnessTexture)), Promise.all(r);
350
- }
351
- }, Be = class {
352
- constructor(e) {
353
- this.parser = e, this.name = I.KHR_MATERIALS_TRANSMISSION;
354
- }
355
- getMaterialType(e) {
356
- return F(this.parser, e, this.name) === null ? null : C;
357
- }
358
- extendMaterialParams(e, t) {
359
- let n = F(this.parser, e, this.name);
360
- if (n === null) return Promise.resolve();
361
- let r = [];
362
- return n.transmissionFactor !== void 0 && (t.transmission = n.transmissionFactor), n.transmissionTexture !== void 0 && r.push(this.parser.assignTexture(t, "transmissionMap", n.transmissionTexture)), Promise.all(r);
363
- }
364
- }, Ve = class {
365
- constructor(e) {
366
- this.parser = e, this.name = I.KHR_MATERIALS_VOLUME;
367
- }
368
- getMaterialType(e) {
369
- return F(this.parser, e, this.name) === null ? null : C;
370
- }
371
- extendMaterialParams(e, t) {
372
- let n = F(this.parser, e, this.name);
373
- if (n === null) return Promise.resolve();
374
- let r = [];
375
- t.thickness = n.thicknessFactor === void 0 ? 0 : n.thicknessFactor, n.thicknessTexture !== void 0 && r.push(this.parser.assignTexture(t, "thicknessMap", n.thicknessTexture)), t.attenuationDistance = n.attenuationDistance || Infinity;
376
- let i = n.attenuationColor || [
377
- 1,
378
- 1,
379
- 1
380
- ];
381
- return t.attenuationColor = new E().setRGB(i[0], i[1], i[2], d), Promise.all(r);
382
- }
383
- }, He = class {
384
- constructor(e) {
385
- this.parser = e, this.name = I.KHR_MATERIALS_IOR;
386
- }
387
- getMaterialType(e) {
388
- return F(this.parser, e, this.name) === null ? null : C;
389
- }
390
- extendMaterialParams(e, t) {
391
- let n = F(this.parser, e, this.name);
392
- return n === null ? Promise.resolve() : (t.ior = n.ior === void 0 ? 1.5 : n.ior, t.ior === 0 && (t.ior = 1e3), Promise.resolve());
393
- }
394
- }, Ue = class {
395
- constructor(e) {
396
- this.parser = e, this.name = I.KHR_MATERIALS_SPECULAR;
397
- }
398
- getMaterialType(e) {
399
- return F(this.parser, e, this.name) === null ? null : C;
400
- }
401
- extendMaterialParams(e, t) {
402
- let n = F(this.parser, e, this.name);
403
- if (n === null) return Promise.resolve();
404
- let r = [];
405
- t.specularIntensity = n.specularFactor === void 0 ? 1 : n.specularFactor, n.specularTexture !== void 0 && r.push(this.parser.assignTexture(t, "specularIntensityMap", n.specularTexture));
406
- let i = n.specularColorFactor || [
407
- 1,
408
- 1,
409
- 1
410
- ];
411
- return t.specularColor = new E().setRGB(i[0], i[1], i[2], d), n.specularColorTexture !== void 0 && r.push(this.parser.assignTexture(t, "specularColorMap", n.specularColorTexture, A)), Promise.all(r);
412
- }
413
- }, We = class {
414
- constructor(e) {
415
- this.parser = e, this.name = I.EXT_MATERIALS_BUMP;
416
- }
417
- getMaterialType(e) {
418
- return F(this.parser, e, this.name) === null ? null : C;
419
- }
420
- extendMaterialParams(e, t) {
421
- let n = F(this.parser, e, this.name);
422
- if (n === null) return Promise.resolve();
423
- let r = [];
424
- return t.bumpScale = n.bumpFactor === void 0 ? 1 : n.bumpFactor, n.bumpTexture !== void 0 && r.push(this.parser.assignTexture(t, "bumpMap", n.bumpTexture)), Promise.all(r);
425
- }
426
- }, Ge = class {
427
- constructor(e) {
428
- this.parser = e, this.name = I.KHR_MATERIALS_ANISOTROPY;
429
- }
430
- getMaterialType(e) {
431
- return F(this.parser, e, this.name) === null ? null : C;
432
- }
433
- extendMaterialParams(e, t) {
434
- let n = F(this.parser, e, this.name);
435
- if (n === null) return Promise.resolve();
436
- let r = [];
437
- return n.anisotropyStrength !== void 0 && (t.anisotropy = n.anisotropyStrength), n.anisotropyRotation !== void 0 && (t.anisotropyRotation = n.anisotropyRotation), n.anisotropyTexture !== void 0 && r.push(this.parser.assignTexture(t, "anisotropyMap", n.anisotropyTexture)), Promise.all(r);
438
- }
439
- }, Ke = class {
440
- constructor(e) {
441
- this.parser = e, this.name = I.KHR_TEXTURE_BASISU;
442
- }
443
- loadTexture(e) {
444
- let t = this.parser, n = t.json, r = n.textures[e];
445
- if (!r.extensions || !r.extensions[this.name]) return null;
446
- let i = r.extensions[this.name], a = t.options.ktx2Loader;
447
- if (!a) {
448
- if (n.extensionsRequired && n.extensionsRequired.indexOf(this.name) >= 0) throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");
449
- return null;
450
- }
451
- return t.loadTextureImage(e, i.source, a);
452
- }
453
- }, qe = class {
454
- constructor(e) {
455
- this.parser = e, this.name = I.EXT_TEXTURE_WEBP;
456
- }
457
- loadTexture(e) {
458
- let t = this.name, n = this.parser, r = n.json, i = r.textures[e];
459
- if (!i.extensions || !i.extensions[t]) return null;
460
- let a = i.extensions[t], o = r.images[a.source], s = n.textureLoader;
461
- if (o.uri) {
462
- let e = n.options.manager.getHandler(o.uri);
463
- e !== null && (s = e);
464
- }
465
- return n.loadTextureImage(e, a.source, s);
466
- }
467
- }, Je = class {
468
- constructor(e) {
469
- this.parser = e, this.name = I.EXT_TEXTURE_AVIF;
470
- }
471
- loadTexture(e) {
472
- let t = this.name, n = this.parser, r = n.json, i = r.textures[e];
473
- if (!i.extensions || !i.extensions[t]) return null;
474
- let a = i.extensions[t], o = r.images[a.source], s = n.textureLoader;
475
- if (o.uri) {
476
- let e = n.options.manager.getHandler(o.uri);
477
- e !== null && (s = e);
478
- }
479
- return n.loadTextureImage(e, a.source, s);
480
- }
481
- }, L = class {
482
- constructor(e, t) {
483
- this.name = t, this.parser = e;
484
- }
485
- loadBufferView(e) {
486
- let t = this.parser.json, n = t.bufferViews[e];
487
- if (n.extensions && n.extensions[this.name]) {
488
- let e = n.extensions[this.name], r = this.parser.getDependency("buffer", e.buffer), i = this.parser.options.meshoptDecoder;
489
- if (!i || !i.supported) {
490
- if (t.extensionsRequired && t.extensionsRequired.indexOf(this.name) >= 0) throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");
491
- return null;
492
- }
493
- return r.then(function(t) {
494
- let n = e.byteOffset || 0, r = e.byteLength || 0, a = e.count, o = e.byteStride, s = new Uint8Array(t, n, r);
495
- return i.decodeGltfBufferAsync ? i.decodeGltfBufferAsync(a, o, s, e.mode, e.filter).then(function(e) {
496
- return e.buffer;
497
- }) : i.ready.then(function() {
498
- let t = new ArrayBuffer(a * o);
499
- return i.decodeGltfBuffer(new Uint8Array(t), a, o, s, e.mode, e.filter), t;
500
- });
501
- });
502
- } else return null;
503
- }
504
- }, Ye = class {
505
- constructor(e) {
506
- this.name = I.EXT_MESH_GPU_INSTANCING, this.parser = e;
507
- }
508
- createNodeMesh(e) {
509
- let t = this.parser.json, i = t.nodes[e];
510
- if (!i.extensions || !i.extensions[this.name] || i.mesh === void 0) return null;
511
- let o = t.meshes[i.mesh];
512
- for (let e of o.primitives) if (e.mode !== H.TRIANGLES && e.mode !== H.TRIANGLE_STRIP && e.mode !== H.TRIANGLE_FAN && e.mode !== void 0) return null;
513
- let s = i.extensions[this.name].attributes, c = [], l = {};
514
- for (let e in s) c.push(this.parser.getDependency("accessor", s[e]).then((t) => (l[e] = t, l[e])));
515
- return c.length < 1 ? null : (c.push(this.parser.createNodeMesh(e)), Promise.all(c).then((e) => {
516
- let t = e.pop(), i = t.isGroup ? t.children : [t], o = e[0].count, s = [];
517
- for (let e of i) {
518
- let t = new n(), i = new a(), c = new j(), u = new a(1, 1, 1), d = new r(e.geometry, e.material, o);
519
- for (let e = 0; e < o; e++) l.TRANSLATION && i.fromBufferAttribute(l.TRANSLATION, e), l.ROTATION && c.fromBufferAttribute(l.ROTATION, e), l.SCALE && u.fromBufferAttribute(l.SCALE, e), d.setMatrixAt(e, t.compose(i, c, u));
520
- for (let t in l) if (t === "_COLOR_0") {
521
- let e = l[t];
522
- d.instanceColor = new _e(e.array, e.itemSize, e.normalized);
523
- } else t !== "TRANSLATION" && t !== "ROTATION" && t !== "SCALE" && e.geometry.setAttribute(t, l[t]);
524
- de.prototype.copy.call(d, e), this.parser.assignFinalMaterial(d), s.push(d);
525
- }
526
- return t.isGroup ? (t.clear(), t.add(...s), t) : s[0];
527
- }));
528
- }
529
- }, R = "glTF", z = 12, B = {
530
- JSON: 1313821514,
531
- BIN: 5130562
532
- }, Xe = class {
533
- constructor(e) {
534
- this.name = I.KHR_BINARY_GLTF, this.content = null, this.body = null;
535
- let t = new DataView(e, 0, z), n = new TextDecoder();
536
- if (this.header = {
537
- magic: n.decode(new Uint8Array(e.slice(0, 4))),
538
- version: t.getUint32(4, !0),
539
- length: t.getUint32(8, !0)
540
- }, this.header.magic !== R) throw Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
541
- if (this.header.version < 2) throw Error("THREE.GLTFLoader: Legacy binary file detected.");
542
- let r = this.header.length - z, i = new DataView(e, z), a = 0;
543
- for (; a < r;) {
544
- let t = i.getUint32(a, !0);
545
- a += 4;
546
- let r = i.getUint32(a, !0);
547
- if (a += 4, r === B.JSON) {
548
- let r = new Uint8Array(e, z + a, t);
549
- this.content = n.decode(r);
550
- } else if (r === B.BIN) {
551
- let n = z + a;
552
- this.body = e.slice(n, n + t);
553
- }
554
- a += t;
555
- }
556
- if (this.content === null) throw Error("THREE.GLTFLoader: JSON content not found.");
557
- }
558
- }, Ze = class {
559
- constructor(e, t) {
560
- if (!t) throw Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
561
- this.name = I.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
562
- }
563
- decodePrimitive(e, t) {
564
- let n = this.json, r = this.dracoLoader, i = e.extensions[this.name].bufferView, a = e.extensions[this.name].attributes, o = {}, s = {}, c = {};
565
- for (let e in a) {
566
- let t = q[e] || e.toLowerCase();
567
- o[t] = a[e];
568
- }
569
- for (let t in e.attributes) {
570
- let r = q[t] || t.toLowerCase();
571
- if (a[t] !== void 0) {
572
- let i = n.accessors[e.attributes[t]];
573
- c[r] = U[i.componentType].name, s[r] = i.normalized === !0;
574
- }
575
- }
576
- return t.getDependency("bufferView", i).then(function(e) {
577
- return new Promise(function(t, n) {
578
- r.decodeDracoFile(e, function(e) {
579
- for (let t in e.attributes) {
580
- let n = e.attributes[t], r = s[t];
581
- r !== void 0 && (n.normalized = r);
582
- }
583
- t(e);
584
- }, o, c, d, n);
585
- });
586
- });
587
- }
588
- }, Qe = class {
589
- constructor() {
590
- this.name = I.KHR_TEXTURE_TRANSFORM;
591
- }
592
- extendTexture(e, t) {
593
- return (t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 ? e : (e = e.clone(), t.texCoord !== void 0 && (e.channel = t.texCoord), t.offset !== void 0 && e.offset.fromArray(t.offset), t.rotation !== void 0 && (e.rotation = t.rotation), t.scale !== void 0 && e.repeat.fromArray(t.scale), e.needsUpdate = !0, e);
594
- }
595
- }, $e = class {
596
- constructor() {
597
- this.name = I.KHR_MESH_QUANTIZATION;
598
- }
599
- }, V = class extends re {
600
- constructor(e, t, n, r) {
601
- super(e, t, n, r);
602
- }
603
- copySampleValue_(e) {
604
- let t = this.resultBuffer, n = this.sampleValues, r = this.valueSize, i = e * r * 3 + r;
605
- for (let e = 0; e !== r; e++) t[e] = n[i + e];
606
- return t;
607
- }
608
- interpolate_(e, t, n, r) {
609
- let i = this.resultBuffer, a = this.sampleValues, o = this.valueSize, s = o * 2, c = o * 3, l = r - t, u = (n - t) / l, d = u * u, f = d * u, p = e * c, m = p - c, h = -2 * f + 3 * d, g = f - d, _ = 1 - h, v = g - d + u;
610
- for (let e = 0; e !== o; e++) {
611
- let t = a[m + e + o], n = a[m + e + s] * l, r = a[p + e + o], c = a[p + e] * l;
612
- i[e] = _ * t + v * n + h * r + g * c;
613
- }
614
- return i;
615
- }
616
- }, et = new j(), tt = class extends V {
617
- interpolate_(e, t, n, r) {
618
- let i = super.interpolate_(e, t, n, r);
619
- return et.fromArray(i).normalize().toArray(i), i;
620
- }
621
- }, H = {
622
- FLOAT: 5126,
623
- FLOAT_MAT3: 35675,
624
- FLOAT_MAT4: 35676,
625
- FLOAT_VEC2: 35664,
626
- FLOAT_VEC3: 35665,
627
- FLOAT_VEC4: 35666,
628
- LINEAR: 9729,
629
- REPEAT: 10497,
630
- SAMPLER_2D: 35678,
631
- POINTS: 0,
632
- LINES: 1,
633
- LINE_LOOP: 2,
634
- LINE_STRIP: 3,
635
- TRIANGLES: 4,
636
- TRIANGLE_STRIP: 5,
637
- TRIANGLE_FAN: 6,
638
- UNSIGNED_BYTE: 5121,
639
- UNSIGNED_SHORT: 5123
640
- }, U = {
641
- 5120: Int8Array,
642
- 5121: Uint8Array,
643
- 5122: Int16Array,
644
- 5123: Uint16Array,
645
- 5125: Uint32Array,
646
- 5126: Float32Array
647
- }, W = {
648
- 9728: Te,
649
- 9729: f,
650
- 9984: ye,
651
- 9985: se,
652
- 9986: ue,
653
- 9987: ae
654
- }, G = {
655
- 33071: pe,
656
- 33648: xe,
657
- 10497: s
658
- }, K = {
659
- SCALAR: 1,
660
- VEC2: 2,
661
- VEC3: 3,
662
- VEC4: 4,
663
- MAT2: 4,
664
- MAT3: 9,
665
- MAT4: 16
666
- }, q = {
667
- POSITION: "position",
668
- NORMAL: "normal",
669
- TANGENT: "tangent",
670
- TEXCOORD_0: "uv",
671
- TEXCOORD_1: "uv1",
672
- TEXCOORD_2: "uv2",
673
- TEXCOORD_3: "uv3",
674
- COLOR_0: "color",
675
- WEIGHTS_0: "skinWeight",
676
- JOINTS_0: "skinIndex"
677
- }, J = {
678
- scale: "scale",
679
- translation: "position",
680
- rotation: "quaternion",
681
- weights: "morphTargetInfluences"
682
- }, nt = {
683
- CUBICSPLINE: void 0,
684
- LINEAR: g,
685
- STEP: m
686
- }, Y = {
687
- OPAQUE: "OPAQUE",
688
- MASK: "MASK",
689
- BLEND: "BLEND"
690
- };
691
- function rt(e) {
692
- return e.DefaultMaterial === void 0 && (e.DefaultMaterial = new x({
693
- color: 16777215,
694
- emissive: 0,
695
- metalness: 1,
696
- roughness: 1,
697
- transparent: !1,
698
- depthTest: !0,
699
- side: 0
700
- })), e.DefaultMaterial;
701
- }
702
- function X(e, t, n) {
703
- for (let r in n.extensions) e[r] === void 0 && (t.userData.gltfExtensions = t.userData.gltfExtensions || {}, t.userData.gltfExtensions[r] = n.extensions[r]);
704
- }
705
- function Z(e, t) {
706
- t.extras !== void 0 && (typeof t.extras == "object" ? Object.assign(e.userData, t.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + t.extras));
707
- }
708
- function it(e, t, n) {
709
- let r = !1, i = !1, a = !1;
710
- for (let e = 0, n = t.length; e < n; e++) {
711
- let n = t[e];
712
- if (n.POSITION !== void 0 && (r = !0), n.NORMAL !== void 0 && (i = !0), n.COLOR_0 !== void 0 && (a = !0), r && i && a) break;
713
- }
714
- if (!r && !i && !a) return Promise.resolve(e);
715
- let o = [], s = [], c = [];
716
- for (let l = 0, u = t.length; l < u; l++) {
717
- let u = t[l];
718
- if (r) {
719
- let t = u.POSITION === void 0 ? e.attributes.position : n.getDependency("accessor", u.POSITION);
720
- o.push(t);
721
- }
722
- if (i) {
723
- let t = u.NORMAL === void 0 ? e.attributes.normal : n.getDependency("accessor", u.NORMAL);
724
- s.push(t);
725
- }
726
- if (a) {
727
- let t = u.COLOR_0 === void 0 ? e.attributes.color : n.getDependency("accessor", u.COLOR_0);
728
- c.push(t);
729
- }
730
- }
731
- return Promise.all([
732
- Promise.all(o),
733
- Promise.all(s),
734
- Promise.all(c)
735
- ]).then(function(t) {
736
- let n = t[0], o = t[1], s = t[2];
737
- return r && (e.morphAttributes.position = n), i && (e.morphAttributes.normal = o), a && (e.morphAttributes.color = s), e.morphTargetsRelative = !0, e;
738
- });
739
- }
740
- function at(e, t) {
741
- if (e.updateMorphTargets(), t.weights !== void 0) for (let n = 0, r = t.weights.length; n < r; n++) e.morphTargetInfluences[n] = t.weights[n];
742
- if (t.extras && Array.isArray(t.extras.targetNames)) {
743
- let n = t.extras.targetNames;
744
- if (e.morphTargetInfluences.length === n.length) {
745
- e.morphTargetDictionary = {};
746
- for (let t = 0, r = n.length; t < r; t++) e.morphTargetDictionary[n[t]] = t;
747
- } else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
748
- }
749
- }
750
- function ot(e) {
751
- let t, n = e.extensions && e.extensions[I.KHR_DRACO_MESH_COMPRESSION];
752
- if (t = n ? "draco:" + n.bufferView + ":" + n.indices + ":" + Q(n.attributes) : e.indices + ":" + Q(e.attributes) + ":" + e.mode, e.targets !== void 0) for (let n = 0, r = e.targets.length; n < r; n++) t += ":" + Q(e.targets[n]);
753
- return t;
754
- }
755
- function Q(e) {
756
- let t = "", n = Object.keys(e).sort();
757
- for (let r = 0, i = n.length; r < i; r++) t += n[r] + ":" + e[n[r]] + ";";
758
- return t;
759
- }
760
- function $(e) {
761
- switch (e) {
762
- case Int8Array: return 1 / 127;
763
- case Uint8Array: return 1 / 255;
764
- case Int16Array: return 1 / 32767;
765
- case Uint16Array: return 1 / 65535;
766
- default: throw Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
767
- }
768
- }
769
- function st(e) {
770
- return e.search(/\.jpe?g($|\?)/i) > 0 || e.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : e.search(/\.webp($|\?)/i) > 0 || e.search(/^data\:image\/webp/) === 0 ? "image/webp" : e.search(/\.ktx2($|\?)/i) > 0 || e.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
771
- }
772
- var ct = new n(), lt = class {
773
- constructor(e = {}, t = {}) {
774
- this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new Me(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = {
775
- refs: {},
776
- uses: {}
777
- }, this.cameraCache = {
778
- refs: {},
779
- uses: {}
780
- }, this.lightCache = {
781
- refs: {},
782
- uses: {}
783
- }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
784
- let n = !1, r = -1, i = !1, a = -1;
785
- if (typeof navigator < "u" && navigator.userAgent !== void 0) {
786
- let e = navigator.userAgent;
787
- n = /^((?!chrome|android).)*safari/i.test(e) === !0;
788
- let t = e.match(/Version\/(\d+)/);
789
- r = n && t ? parseInt(t[1], 10) : -1, i = e.indexOf("Firefox") > -1, a = i ? e.match(/Firefox\/([0-9]+)\./)[1] : -1;
790
- }
791
- typeof createImageBitmap > "u" || n && r < 17 || i && a < 98 ? this.textureLoader = new u(this.options.manager) : this.textureLoader = new te(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new o(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
792
- }
793
- setExtensions(e) {
794
- this.extensions = e;
795
- }
796
- setPlugins(e) {
797
- this.plugins = e;
798
- }
799
- parse(e, t) {
800
- let n = this, r = this.json, i = this.extensions;
801
- this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(e) {
802
- return e._markDefs && e._markDefs();
803
- }), Promise.all(this._invokeAll(function(e) {
804
- return e.beforeRoot && e.beforeRoot();
805
- })).then(function() {
806
- return Promise.all([
807
- n.getDependencies("scene"),
808
- n.getDependencies("animation"),
809
- n.getDependencies("camera")
810
- ]);
811
- }).then(function(t) {
812
- let a = {
813
- scene: t[0][r.scene || 0],
814
- scenes: t[0],
815
- animations: t[1],
816
- cameras: t[2],
817
- asset: r.asset,
818
- parser: n,
819
- userData: {}
820
- };
821
- return X(i, a, r), Z(a, r), Promise.all(n._invokeAll(function(e) {
822
- return e.afterRoot && e.afterRoot(a);
823
- })).then(function() {
824
- for (let e of a.scenes) e.updateMatrixWorld();
825
- e(a);
826
- });
827
- }).catch(t);
828
- }
829
- _markDefs() {
830
- let e = this.json.nodes || [], t = this.json.skins || [], n = this.json.meshes || [];
831
- for (let n = 0, r = t.length; n < r; n++) {
832
- let r = t[n].joints;
833
- for (let t = 0, n = r.length; t < n; t++) e[r[t]].isBone = !0;
834
- }
835
- for (let t = 0, r = e.length; t < r; t++) {
836
- let r = e[t];
837
- r.mesh !== void 0 && (this._addNodeRef(this.meshCache, r.mesh), r.skin !== void 0 && (n[r.mesh].isSkinnedMesh = !0)), r.camera !== void 0 && this._addNodeRef(this.cameraCache, r.camera);
838
- }
839
- }
840
- _addNodeRef(e, t) {
841
- t !== void 0 && (e.refs[t] === void 0 && (e.refs[t] = e.uses[t] = 0), e.refs[t]++);
842
- }
843
- _getNodeRef(e, t, n) {
844
- if (e.refs[t] <= 1) return n;
845
- let r = n.clone(), i = (e, t) => {
846
- let n = this.associations.get(e);
847
- n != null && this.associations.set(t, n);
848
- for (let [n, r] of e.children.entries()) i(r, t.children[n]);
849
- };
850
- return i(n, r), r.name += "_instance_" + e.uses[t]++, r;
851
- }
852
- _invokeOne(e) {
853
- let t = Object.values(this.plugins);
854
- t.push(this);
855
- for (let n = 0; n < t.length; n++) {
856
- let r = e(t[n]);
857
- if (r) return r;
858
- }
859
- return null;
860
- }
861
- _invokeAll(e) {
862
- let t = Object.values(this.plugins);
863
- t.unshift(this);
864
- let n = [];
865
- for (let r = 0; r < t.length; r++) {
866
- let i = e(t[r]);
867
- i && n.push(i);
868
- }
869
- return n;
870
- }
871
- getDependency(e, t) {
872
- let n = e + ":" + t, r = this.cache.get(n);
873
- if (!r) {
874
- switch (e) {
875
- case "scene":
876
- r = this.loadScene(t);
877
- break;
878
- case "node":
879
- r = this._invokeOne(function(e) {
880
- return e.loadNode && e.loadNode(t);
881
- });
882
- break;
883
- case "mesh":
884
- r = this._invokeOne(function(e) {
885
- return e.loadMesh && e.loadMesh(t);
886
- });
887
- break;
888
- case "accessor":
889
- r = this.loadAccessor(t);
890
- break;
891
- case "bufferView":
892
- r = this._invokeOne(function(e) {
893
- return e.loadBufferView && e.loadBufferView(t);
894
- });
895
- break;
896
- case "buffer":
897
- r = this.loadBuffer(t);
898
- break;
899
- case "material":
900
- r = this._invokeOne(function(e) {
901
- return e.loadMaterial && e.loadMaterial(t);
902
- });
903
- break;
904
- case "texture":
905
- r = this._invokeOne(function(e) {
906
- return e.loadTexture && e.loadTexture(t);
907
- });
908
- break;
909
- case "skin":
910
- r = this.loadSkin(t);
911
- break;
912
- case "animation":
913
- r = this._invokeOne(function(e) {
914
- return e.loadAnimation && e.loadAnimation(t);
915
- });
916
- break;
917
- case "camera":
918
- r = this.loadCamera(t);
919
- break;
920
- default:
921
- if (r = this._invokeOne(function(n) {
922
- return n != this && n.getDependency && n.getDependency(e, t);
923
- }), !r) throw Error("Unknown type: " + e);
924
- break;
925
- }
926
- this.cache.add(n, r);
927
- }
928
- return r;
929
- }
930
- getDependencies(e) {
931
- let t = this.cache.get(e);
932
- if (!t) {
933
- let n = this, r = this.json[e + (e === "mesh" ? "es" : "s")] || [];
934
- t = Promise.all(r.map(function(t, r) {
935
- return n.getDependency(e, r);
936
- })), this.cache.add(e, t);
937
- }
938
- return t;
939
- }
940
- loadBuffer(e) {
941
- let t = this.json.buffers[e], n = this.fileLoader;
942
- if (t.type && t.type !== "arraybuffer") throw Error("THREE.GLTFLoader: " + t.type + " buffer type is not supported.");
943
- if (t.uri === void 0 && e === 0) return Promise.resolve(this.extensions[I.KHR_BINARY_GLTF].body);
944
- let r = this.options;
945
- return new Promise(function(e, i) {
946
- n.load(D.resolveURL(t.uri, r.path), e, void 0, function() {
947
- i(/* @__PURE__ */ Error("THREE.GLTFLoader: Failed to load buffer \"" + t.uri + "\"."));
948
- });
949
- });
950
- }
951
- loadBufferView(e) {
952
- let t = this.json.bufferViews[e];
953
- return this.getDependency("buffer", t.buffer).then(function(e) {
954
- let n = t.byteLength || 0, r = t.byteOffset || 0;
955
- return e.slice(r, r + n);
956
- });
957
- }
958
- loadAccessor(e) {
959
- let t = this, n = this.json, r = this.json.accessors[e];
960
- if (r.bufferView === void 0 && r.sparse === void 0) {
961
- let e = K[r.type], t = U[r.componentType], n = r.normalized === !0, i = new t(r.count * e);
962
- return Promise.resolve(new w(i, e, n));
963
- }
964
- let i = [];
965
- return r.bufferView === void 0 ? i.push(null) : i.push(this.getDependency("bufferView", r.bufferView)), r.sparse !== void 0 && (i.push(this.getDependency("bufferView", r.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", r.sparse.values.bufferView))), Promise.all(i).then(function(e) {
966
- let i = e[0], a = K[r.type], o = U[r.componentType], s = o.BYTES_PER_ELEMENT, c = s * a, l = r.byteOffset || 0, u = r.bufferView === void 0 ? void 0 : n.bufferViews[r.bufferView].byteStride, d = r.normalized === !0, f, p;
967
- if (u && u !== c) {
968
- let e = Math.floor(l / u), n = "InterleavedBuffer:" + r.bufferView + ":" + r.componentType + ":" + e + ":" + r.count, c = t.cache.get(n);
969
- c || (f = new o(i, e * u, r.count * u / s), c = new _(f, u / s), t.cache.add(n, c)), p = new ee(c, a, l % u / s, d);
970
- } else f = i === null ? new o(r.count * a) : new o(i, l, r.count * a), p = new w(f, a, d);
971
- if (r.sparse !== void 0) {
972
- let t = K.SCALAR, n = U[r.sparse.indices.componentType], s = r.sparse.indices.byteOffset || 0, c = r.sparse.values.byteOffset || 0, l = new n(e[1], s, r.sparse.count * t), u = new o(e[2], c, r.sparse.count * a);
973
- i !== null && (p = new w(p.array.slice(), p.itemSize, p.normalized)), p.normalized = !1;
974
- for (let e = 0, t = l.length; e < t; e++) {
975
- let t = l[e];
976
- if (p.setX(t, u[e * a]), a >= 2 && p.setY(t, u[e * a + 1]), a >= 3 && p.setZ(t, u[e * a + 2]), a >= 4 && p.setW(t, u[e * a + 3]), a >= 5) throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
977
- }
978
- p.normalized = d;
979
- }
980
- return p;
981
- });
982
- }
983
- loadTexture(e) {
984
- let t = this.json, n = this.options, r = t.textures[e].source, i = t.images[r], a = this.textureLoader;
985
- if (i.uri) {
986
- let e = n.manager.getHandler(i.uri);
987
- e !== null && (a = e);
988
- }
989
- return this.loadTextureImage(e, r, a);
990
- }
991
- loadTextureImage(e, t, n) {
992
- let r = this, i = this.json, a = i.textures[e], o = i.images[t], s = (o.uri || o.bufferView) + ":" + a.sampler;
993
- if (this.textureCache[s]) return this.textureCache[s];
994
- let c = this.loadImageSource(t, n).then(function(t) {
995
- t.flipY = !1, t.name = a.name || o.name || "", t.name === "" && typeof o.uri == "string" && o.uri.startsWith("data:image/") === !1 && (t.name = o.uri);
996
- let n = (i.samplers || {})[a.sampler] || {};
997
- return t.magFilter = W[n.magFilter] || 1006, t.minFilter = W[n.minFilter] || 1008, t.wrapS = G[n.wrapS] || 1e3, t.wrapT = G[n.wrapT] || 1e3, t.generateMipmaps = !t.isCompressedTexture && t.minFilter !== 1003 && t.minFilter !== 1006, r.associations.set(t, { textures: e }), t;
998
- }).catch(function() {
999
- return null;
1000
- });
1001
- return this.textureCache[s] = c, c;
1002
- }
1003
- loadImageSource(e, t) {
1004
- let n = this, r = this.json, i = this.options;
1005
- if (this.sourceCache[e] !== void 0) return this.sourceCache[e].then((e) => e.clone());
1006
- let a = r.images[e], o = self.URL || self.webkitURL, s = a.uri || "", c = !1;
1007
- if (a.bufferView !== void 0) s = n.getDependency("bufferView", a.bufferView).then(function(e) {
1008
- c = !0;
1009
- let t = new Blob([e], { type: a.mimeType });
1010
- return s = o.createObjectURL(t), s;
1011
- });
1012
- else if (a.uri === void 0) throw Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
1013
- let l = Promise.resolve(s).then(function(e) {
1014
- return new Promise(function(n, r) {
1015
- let a = n;
1016
- t.isImageBitmapLoader === !0 && (a = function(e) {
1017
- let t = new y(e);
1018
- t.needsUpdate = !0, n(t);
1019
- }), t.load(D.resolveURL(e, i.path), a, void 0, r);
1020
- });
1021
- }).then(function(e) {
1022
- return c === !0 && o.revokeObjectURL(s), Z(e, a), e.userData.mimeType = a.mimeType || st(a.uri), e;
1023
- }).catch(function(e) {
1024
- throw console.error("THREE.GLTFLoader: Couldn't load texture", s), e;
1025
- });
1026
- return this.sourceCache[e] = l, l;
1027
- }
1028
- assignTexture(e, t, n, r) {
1029
- let i = this;
1030
- return this.getDependency("texture", n.index).then(function(a) {
1031
- if (!a) return null;
1032
- if (n.texCoord !== void 0 && n.texCoord > 0 && (a = a.clone(), a.channel = n.texCoord), i.extensions[I.KHR_TEXTURE_TRANSFORM]) {
1033
- let e = n.extensions === void 0 ? void 0 : n.extensions[I.KHR_TEXTURE_TRANSFORM];
1034
- if (e) {
1035
- let t = i.associations.get(a);
1036
- a = i.extensions[I.KHR_TEXTURE_TRANSFORM].extendTexture(a, e), i.associations.set(a, t);
1037
- }
1038
- }
1039
- return r !== void 0 && (a.colorSpace = r), e[t] = a, a;
1040
- });
1041
- }
1042
- assignFinalMaterial(e) {
1043
- let t = e.geometry, n = e.material, r = t.attributes.tangent === void 0, i = t.attributes.color !== void 0, a = t.attributes.normal === void 0;
1044
- if (e.isPoints) {
1045
- let e = "PointsMaterial:" + n.uuid, t = this.cache.get(e);
1046
- t || (t = new le(), b.prototype.copy.call(t, n), t.color.copy(n.color), t.map = n.map, t.sizeAttenuation = !1, this.cache.add(e, t)), n = t;
1047
- } else if (e.isLine) {
1048
- let e = "LineBasicMaterial:" + n.uuid, t = this.cache.get(e);
1049
- t || (t = new ke(), b.prototype.copy.call(t, n), t.color.copy(n.color), t.map = n.map, this.cache.add(e, t)), n = t;
1050
- }
1051
- if (r || i || a) {
1052
- let e = "ClonedMaterial:" + n.uuid + ":";
1053
- r && (e += "derivative-tangents:"), i && (e += "vertex-colors:"), a && (e += "flat-shading:");
1054
- let t = this.cache.get(e);
1055
- t || (t = n.clone(), i && (t.vertexColors = !0), a && (t.flatShading = !0), r && (t.normalScale && (t.normalScale.y *= -1), t.clearcoatNormalScale && (t.clearcoatNormalScale.y *= -1)), this.cache.add(e, t), this.associations.set(t, this.associations.get(n))), n = t;
1056
- }
1057
- e.material = n;
1058
- }
1059
- getMaterialType() {
1060
- return x;
1061
- }
1062
- loadMaterial(e) {
1063
- let t = this, n = this.json, r = this.extensions, i = n.materials[e], a, o = {}, s = i.extensions || {}, c = [];
1064
- if (s[I.KHR_MATERIALS_UNLIT]) {
1065
- let e = r[I.KHR_MATERIALS_UNLIT];
1066
- a = e.getMaterialType(), c.push(e.extendParams(o, i, t));
1067
- } else {
1068
- let n = i.pbrMetallicRoughness || {};
1069
- if (o.color = new E(1, 1, 1), o.opacity = 1, Array.isArray(n.baseColorFactor)) {
1070
- let e = n.baseColorFactor;
1071
- o.color.setRGB(e[0], e[1], e[2], d), o.opacity = e[3];
1072
- }
1073
- n.baseColorTexture !== void 0 && c.push(t.assignTexture(o, "map", n.baseColorTexture, A)), o.metalness = n.metallicFactor === void 0 ? 1 : n.metallicFactor, o.roughness = n.roughnessFactor === void 0 ? 1 : n.roughnessFactor, n.metallicRoughnessTexture !== void 0 && (c.push(t.assignTexture(o, "metalnessMap", n.metallicRoughnessTexture)), c.push(t.assignTexture(o, "roughnessMap", n.metallicRoughnessTexture))), a = this._invokeOne(function(t) {
1074
- return t.getMaterialType && t.getMaterialType(e);
1075
- }), c.push(Promise.all(this._invokeAll(function(t) {
1076
- return t.extendMaterialParams && t.extendMaterialParams(e, o);
1077
- })));
1078
- }
1079
- i.doubleSided === !0 && (o.side = 2);
1080
- let l = i.alphaMode || Y.OPAQUE;
1081
- if (l === Y.BLEND ? (o.transparent = !0, o.depthWrite = !1) : (o.transparent = !1, l === Y.MASK && (o.alphaTest = i.alphaCutoff === void 0 ? .5 : i.alphaCutoff)), i.normalTexture !== void 0 && a !== O && (c.push(t.assignTexture(o, "normalMap", i.normalTexture)), o.normalScale = new M(1, 1), i.normalTexture.scale !== void 0)) {
1082
- let e = i.normalTexture.scale;
1083
- o.normalScale.set(e, e);
1084
- }
1085
- if (i.occlusionTexture !== void 0 && a !== O && (c.push(t.assignTexture(o, "aoMap", i.occlusionTexture)), i.occlusionTexture.strength !== void 0 && (o.aoMapIntensity = i.occlusionTexture.strength)), i.emissiveFactor !== void 0 && a !== O) {
1086
- let e = i.emissiveFactor;
1087
- o.emissive = new E().setRGB(e[0], e[1], e[2], d);
1088
- }
1089
- return i.emissiveTexture !== void 0 && a !== O && c.push(t.assignTexture(o, "emissiveMap", i.emissiveTexture, A)), Promise.all(c).then(function() {
1090
- let n = new a(o);
1091
- return i.name && (n.name = i.name), Z(n, i), t.associations.set(n, { materials: e }), i.extensions && X(r, n, i), n;
1092
- });
1093
- }
1094
- createUniqueName(e) {
1095
- let t = De.sanitizeNodeName(e || "");
1096
- return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
1097
- }
1098
- loadGeometries(e) {
1099
- let t = this, n = this.extensions, r = this.primitiveCache;
1100
- function i(e) {
1101
- return n[I.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e, t).then(function(n) {
1102
- return dt(n, e, t);
1103
- });
1104
- }
1105
- let a = [];
1106
- for (let n = 0, o = e.length; n < o; n++) {
1107
- let o = e[n], s = ot(o), c = r[s];
1108
- if (c) a.push(c.promise);
1109
- else {
1110
- let e;
1111
- e = o.extensions && o.extensions[I.KHR_DRACO_MESH_COMPRESSION] ? i(o) : dt(new Ee(), o, t), r[s] = {
1112
- primitive: o,
1113
- promise: e
1114
- }, a.push(e);
1115
- }
1116
- }
1117
- return Promise.all(a);
1118
- }
1119
- loadMesh(e) {
1120
- let t = this, n = this.json, r = this.extensions, a = n.meshes[e], o = a.primitives, s = [];
1121
- for (let e = 0, t = o.length; e < t; e++) {
1122
- let t = o[e].material === void 0 ? rt(this.cache) : this.getDependency("material", o[e].material);
1123
- s.push(t);
1124
- }
1125
- return s.push(t.loadGeometries(o)), Promise.all(s).then(function(n) {
1126
- let s = n.slice(0, n.length - 1), c = n[n.length - 1], u = [];
1127
- for (let n = 0, l = c.length; n < l; n++) {
1128
- let l = c[n], d = o[n], f, p = s[n];
1129
- if (d.mode === H.TRIANGLES || d.mode === H.TRIANGLE_STRIP || d.mode === H.TRIANGLE_FAN || d.mode === void 0) f = a.isSkinnedMesh === !0 ? new ne(l, p) : new fe(l, p), f.isSkinnedMesh === !0 && f.normalizeSkinWeights(), d.mode === H.TRIANGLE_STRIP ? f.geometry = N(f.geometry, 1) : d.mode === H.TRIANGLE_FAN && (f.geometry = N(f.geometry, 2));
1130
- else if (d.mode === H.LINES) f = new oe(l, p);
1131
- else if (d.mode === H.LINE_STRIP) f = new ie(l, p);
1132
- else if (d.mode === H.LINE_LOOP) f = new i(l, p);
1133
- else if (d.mode === H.POINTS) f = new he(l, p);
1134
- else throw Error("THREE.GLTFLoader: Primitive mode unsupported: " + d.mode);
1135
- Object.keys(f.geometry.morphAttributes).length > 0 && at(f, a), f.name = t.createUniqueName(a.name || "mesh_" + e), Z(f, a), d.extensions && X(r, f, d), t.assignFinalMaterial(f), u.push(f);
1136
- }
1137
- for (let n = 0, r = u.length; n < r; n++) t.associations.set(u[n], {
1138
- meshes: e,
1139
- primitives: n
1140
- });
1141
- if (u.length === 1) return a.extensions && X(r, u[0], a), u[0];
1142
- let d = new l();
1143
- a.extensions && X(r, d, a), t.associations.set(d, { meshes: e });
1144
- for (let e = 0, t = u.length; e < t; e++) d.add(u[e]);
1145
- return d;
1146
- });
1147
- }
1148
- loadCamera(e) {
1149
- let t, n = this.json.cameras[e], r = n[n.type];
1150
- if (!r) {
1151
- console.warn("THREE.GLTFLoader: Missing camera parameters.");
1152
- return;
1153
- }
1154
- return n.type === "perspective" ? t = new Se(ce.radToDeg(r.yfov), r.aspectRatio || 1, r.znear || 1, r.zfar || 2e6) : n.type === "orthographic" && (t = new me(-r.xmag, r.xmag, r.ymag, -r.ymag, r.znear, r.zfar)), n.name && (t.name = this.createUniqueName(n.name)), Z(t, n), Promise.resolve(t);
1155
- }
1156
- loadSkin(e) {
1157
- let t = this.json.skins[e], r = [];
1158
- for (let e = 0, n = t.joints.length; e < n; e++) r.push(this._loadNodeShallow(t.joints[e]));
1159
- return t.inverseBindMatrices === void 0 ? r.push(null) : r.push(this.getDependency("accessor", t.inverseBindMatrices)), Promise.all(r).then(function(e) {
1160
- let r = e.pop(), i = e, a = [], o = [];
1161
- for (let e = 0, s = i.length; e < s; e++) {
1162
- let s = i[e];
1163
- if (s) {
1164
- a.push(s);
1165
- let t = new n();
1166
- r !== null && t.fromArray(r.array, e * 16), o.push(t);
1167
- } else console.warn("THREE.GLTFLoader: Joint \"%s\" could not be found.", t.joints[e]);
1168
- }
1169
- return new c(a, o);
1170
- });
1171
- }
1172
- loadAnimation(e) {
1173
- let t = this.json, n = this, r = t.animations[e], i = r.name ? r.name : "animation_" + e, a = [], o = [], s = [], c = [], l = [];
1174
- for (let e = 0, t = r.channels.length; e < t; e++) {
1175
- let t = r.channels[e], n = r.samplers[t.sampler], i = t.target, u = i.node, d = r.parameters === void 0 ? n.input : r.parameters[n.input], f = r.parameters === void 0 ? n.output : r.parameters[n.output];
1176
- i.node !== void 0 && (a.push(this.getDependency("node", u)), o.push(this.getDependency("accessor", d)), s.push(this.getDependency("accessor", f)), c.push(n), l.push(i));
1177
- }
1178
- return Promise.all([
1179
- Promise.all(a),
1180
- Promise.all(o),
1181
- Promise.all(s),
1182
- Promise.all(c),
1183
- Promise.all(l)
1184
- ]).then(function(e) {
1185
- let t = e[0], a = e[1], o = e[2], s = e[3], c = e[4], l = [];
1186
- for (let e = 0, r = t.length; e < r; e++) {
1187
- let r = t[e], i = a[e], u = o[e], d = s[e], f = c[e];
1188
- if (r === void 0) continue;
1189
- r.updateMatrix && r.updateMatrix();
1190
- let p = n._createAnimationTracks(r, i, u, d, f);
1191
- if (p) for (let e = 0; e < p.length; e++) l.push(p[e]);
1192
- }
1193
- let u = new Ce(i, void 0, l);
1194
- return Z(u, r), u;
1195
- });
1196
- }
1197
- createNodeMesh(e) {
1198
- let t = this.json, n = this, r = t.nodes[e];
1199
- return r.mesh === void 0 ? null : n.getDependency("mesh", r.mesh).then(function(e) {
1200
- let t = n._getNodeRef(n.meshCache, r.mesh, e);
1201
- return r.weights !== void 0 && t.traverse(function(e) {
1202
- if (e.isMesh) for (let t = 0, n = r.weights.length; t < n; t++) e.morphTargetInfluences[t] = r.weights[t];
1203
- }), t;
1204
- });
1205
- }
1206
- loadNode(e) {
1207
- let t = this.json, n = this, r = t.nodes[e], i = n._loadNodeShallow(e), o = [], s = r.children || [];
1208
- for (let e = 0, t = s.length; e < t; e++) o.push(n.getDependency("node", s[e]));
1209
- let c = r.skin === void 0 ? Promise.resolve(null) : n.getDependency("skin", r.skin);
1210
- return Promise.all([
1211
- i,
1212
- Promise.all(o),
1213
- c
1214
- ]).then(function(e) {
1215
- let t = e[0], n = e[1], r = e[2];
1216
- r !== null && t.traverse(function(e) {
1217
- e.isSkinnedMesh && e.bind(r, ct);
1218
- });
1219
- for (let e = 0, r = n.length; e < r; e++) t.add(n[e]);
1220
- if (t.userData.pivot !== void 0 && n.length > 0) {
1221
- let e = t.userData.pivot, r = n[0];
1222
- t.pivot = new a().fromArray(e), t.position.x -= e[0], t.position.y -= e[1], t.position.z -= e[2], r.position.set(0, 0, 0), delete t.userData.pivot;
1223
- }
1224
- return t;
1225
- });
1226
- }
1227
- _loadNodeShallow(e) {
1228
- let r = this.json, i = this.extensions, a = this;
1229
- if (this.nodeCache[e] !== void 0) return this.nodeCache[e];
1230
- let o = r.nodes[e], s = o.name ? a.createUniqueName(o.name) : "", c = [], u = a._invokeOne(function(t) {
1231
- return t.createNodeMesh && t.createNodeMesh(e);
1232
- });
1233
- return u && c.push(u), o.camera !== void 0 && c.push(a.getDependency("camera", o.camera).then(function(e) {
1234
- return a._getNodeRef(a.cameraCache, o.camera, e);
1235
- })), a._invokeAll(function(t) {
1236
- return t.createNodeAttachment && t.createNodeAttachment(e);
1237
- }).forEach(function(e) {
1238
- c.push(e);
1239
- }), this.nodeCache[e] = Promise.all(c).then(function(r) {
1240
- let c;
1241
- if (c = o.isBone === !0 ? new be() : r.length > 1 ? new l() : r.length === 1 ? r[0] : new de(), c !== r[0]) for (let e = 0, t = r.length; e < t; e++) c.add(r[e]);
1242
- if (o.name && (c.userData.name = o.name, c.name = s), Z(c, o), o.extensions && X(i, c, o), o.matrix !== void 0) {
1243
- let e = new n();
1244
- e.fromArray(o.matrix), c.applyMatrix4(e);
1245
- } else o.translation !== void 0 && c.position.fromArray(o.translation), o.rotation !== void 0 && c.quaternion.fromArray(o.rotation), o.scale !== void 0 && c.scale.fromArray(o.scale);
1246
- if (!a.associations.has(c)) a.associations.set(c, {});
1247
- else if (o.mesh !== void 0 && a.meshCache.refs[o.mesh] > 1) {
1248
- let e = a.associations.get(c);
1249
- a.associations.set(c, t({}, e));
1250
- }
1251
- return a.associations.get(c).nodes = e, c;
1252
- }), this.nodeCache[e];
1253
- }
1254
- loadScene(e) {
1255
- let t = this.extensions, n = this.json.scenes[e], r = this, i = new l();
1256
- n.name && (i.name = r.createUniqueName(n.name)), Z(i, n), n.extensions && X(t, i, n);
1257
- let a = n.nodes || [], o = [];
1258
- for (let e = 0, t = a.length; e < t; e++) o.push(r.getDependency("node", a[e]));
1259
- return Promise.all(o).then(function(e) {
1260
- for (let t = 0, n = e.length; t < n; t++) {
1261
- let n = e[t];
1262
- n.parent === null ? i.add(n) : i.add(Ae(n));
1263
- }
1264
- return r.associations = ((e) => {
1265
- let t = /* @__PURE__ */ new Map();
1266
- for (let [e, n] of r.associations) (e instanceof b || e instanceof y) && t.set(e, n);
1267
- return e.traverse((e) => {
1268
- let n = r.associations.get(e);
1269
- n != null && t.set(e, n);
1270
- }), t;
1271
- })(i), i;
1272
- });
1273
- }
1274
- _createAnimationTracks(e, t, n, r, i) {
1275
- let a = [], o = e.name ? e.name : e.uuid, s = [];
1276
- function c(e) {
1277
- e.morphTargetInfluences && s.push(e.name ? e.name : e.uuid);
1278
- }
1279
- J[i.path] === J.weights ? (c(e), e.isGroup && e.children.forEach(c)) : s.push(o);
1280
- let l;
1281
- switch (J[i.path]) {
1282
- case J.weights:
1283
- l = k;
1284
- break;
1285
- case J.rotation:
1286
- l = S;
1287
- break;
1288
- case J.translation:
1289
- case J.scale:
1290
- l = p;
1291
- break;
1292
- default:
1293
- switch (n.itemSize) {
1294
- case 1:
1295
- l = k;
1296
- break;
1297
- default:
1298
- l = p;
1299
- break;
1300
- }
1301
- break;
1302
- }
1303
- let u = r.interpolation === void 0 ? g : nt[r.interpolation], d = this._getArrayFromAccessor(n);
1304
- for (let e = 0, n = s.length; e < n; e++) {
1305
- let n = new l(s[e] + "." + J[i.path], t.array, d, u);
1306
- r.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(n), a.push(n);
1307
- }
1308
- return a;
1309
- }
1310
- _getArrayFromAccessor(e) {
1311
- let t = e.array;
1312
- if (e.normalized) {
1313
- let e = $(t.constructor), n = new Float32Array(t.length);
1314
- for (let r = 0, i = t.length; r < i; r++) n[r] = t[r] * e;
1315
- t = n;
1316
- }
1317
- return t;
1318
- }
1319
- _createCubicSplineTrackInterpolant(e) {
1320
- e.createInterpolant = function(e) {
1321
- return new (this instanceof S ? tt : V)(this.times, this.values, this.getValueSize() / 3, e);
1322
- }, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
1323
- }
1324
- };
1325
- function ut(e, t, n) {
1326
- let r = t.attributes, i = new we();
1327
- if (r.POSITION !== void 0) {
1328
- let e = n.json.accessors[r.POSITION], t = e.min, o = e.max;
1329
- if (t !== void 0 && o !== void 0) {
1330
- if (i.set(new a(t[0], t[1], t[2]), new a(o[0], o[1], o[2])), e.normalized) {
1331
- let t = $(U[e.componentType]);
1332
- i.min.multiplyScalar(t), i.max.multiplyScalar(t);
1333
- }
1334
- } else {
1335
- console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
1336
- return;
1337
- }
1338
- } else return;
1339
- let o = t.targets;
1340
- if (o !== void 0) {
1341
- let e = new a(), t = new a();
1342
- for (let r = 0, i = o.length; r < i; r++) {
1343
- let i = o[r];
1344
- if (i.POSITION !== void 0) {
1345
- let r = n.json.accessors[i.POSITION], a = r.min, o = r.max;
1346
- if (a !== void 0 && o !== void 0) {
1347
- if (t.setX(Math.max(Math.abs(a[0]), Math.abs(o[0]))), t.setY(Math.max(Math.abs(a[1]), Math.abs(o[1]))), t.setZ(Math.max(Math.abs(a[2]), Math.abs(o[2]))), r.normalized) {
1348
- let e = $(U[r.componentType]);
1349
- t.multiplyScalar(e);
1350
- }
1351
- e.max(t);
1352
- } else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
1353
- }
1354
- }
1355
- i.expandByVector(e);
1356
- }
1357
- e.boundingBox = i;
1358
- let s = new ve();
1359
- i.getCenter(s.center), s.radius = i.min.distanceTo(i.max) / 2, e.boundingSphere = s;
1360
- }
1361
- function dt(e, t, n) {
1362
- let r = t.attributes, i = [];
1363
- function a(t, r) {
1364
- return n.getDependency("accessor", t).then(function(t) {
1365
- e.setAttribute(r, t);
1366
- });
1367
- }
1368
- for (let t in r) {
1369
- let n = q[t] || t.toLowerCase();
1370
- n in e.attributes || i.push(a(r[t], n));
1371
- }
1372
- if (t.indices !== void 0 && !e.index) {
1373
- let r = n.getDependency("accessor", t.indices).then(function(t) {
1374
- e.setIndex(t);
1375
- });
1376
- i.push(r);
1377
- }
1378
- return T.workingColorSpace !== "srgb-linear" && "COLOR_0" in r && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${T.workingColorSpace}" not supported.`), Z(e, t), ut(e, t, n), Promise.all(i).then(function() {
1379
- return t.targets === void 0 ? e : it(e, t.targets, n);
1380
- });
1381
- }
1382
- //#endregion
1383
- export { je as GLTFLoader };