@flyfish-group/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 +3 -388
  2. package/README.md +3 -364
  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 +22 -126
  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,1574 +0,0 @@
1
- import { $ as e, Bt as t, C as n, Ct as r, Dt as i, E as a, Et as o, Ft as s, Ht as c, K as l, Mt as u, Ot as d, Pt as f, Q as p, R as m, Rt as h, S as g, Vt as _, Z as v, _ as y, bt as b, dt as x, et as S, f as C, ht as w, m as T, n as E, nt as D, o as O, p as k, pt as A, q as ee, r as j, rt as M, u as N, ut as te, vt as P, w as F, wt as I, x as ne, yt as L, z as re, zt as ie } from "./three.module.js";
2
- import { n as ae } from "./fflate.module.js";
3
- //#region node_modules/.pnpm/three@0.184.0/node_modules/three/examples/jsm/curves/NURBSUtils.js
4
- function R(e, t, n) {
5
- let r = n.length - e - 1;
6
- if (t >= n[r]) return r - 1;
7
- if (t <= n[e]) return e;
8
- let i = e, a = r, o = Math.floor((i + a) / 2);
9
- for (; t < n[o] || t >= n[o + 1];) t < n[o] ? a = o : i = o, o = Math.floor((i + a) / 2);
10
- return o;
11
- }
12
- function oe(e, t, n, r) {
13
- let i = [], a = [], o = [];
14
- i[0] = 1;
15
- for (let s = 1; s <= n; ++s) {
16
- a[s] = t - r[e + 1 - s], o[s] = r[e + s] - t;
17
- let n = 0;
18
- for (let e = 0; e < s; ++e) {
19
- let t = o[e + 1], r = a[s - e], c = i[e] / (t + r);
20
- i[e] = n + t * c, n = r * c;
21
- }
22
- i[s] = n;
23
- }
24
- return i;
25
- }
26
- function se(e, t, n, r) {
27
- let i = R(e, r, t), a = oe(i, r, e, t), o = new _(0, 0, 0, 0);
28
- for (let t = 0; t <= e; ++t) {
29
- let r = n[i - e + t], s = a[t], c = r.w * s;
30
- o.x += r.x * c, o.y += r.y * c, o.z += r.z * c, o.w += r.w * s;
31
- }
32
- return o;
33
- }
34
- function ce(e, t, n, r, i) {
35
- let a = [];
36
- for (let e = 0; e <= n; ++e) a[e] = 0;
37
- let o = [];
38
- for (let e = 0; e <= r; ++e) o[e] = a.slice(0);
39
- let s = [];
40
- for (let e = 0; e <= n; ++e) s[e] = a.slice(0);
41
- s[0][0] = 1;
42
- let c = a.slice(0), l = a.slice(0);
43
- for (let r = 1; r <= n; ++r) {
44
- c[r] = t - i[e + 1 - r], l[r] = i[e + r] - t;
45
- let n = 0;
46
- for (let e = 0; e < r; ++e) {
47
- let t = l[e + 1], i = c[r - e];
48
- s[r][e] = t + i;
49
- let a = s[e][r - 1] / s[r][e];
50
- s[e][r] = n + t * a, n = i * a;
51
- }
52
- s[r][r] = n;
53
- }
54
- for (let e = 0; e <= n; ++e) o[0][e] = s[e][n];
55
- for (let e = 0; e <= n; ++e) {
56
- let t = 0, i = 1, c = [];
57
- for (let e = 0; e <= n; ++e) c[e] = a.slice(0);
58
- c[0][0] = 1;
59
- for (let a = 1; a <= r; ++a) {
60
- let r = 0, l = e - a, u = n - a;
61
- e >= a && (c[i][0] = c[t][0] / s[u + 1][l], r = c[i][0] * s[l][u]);
62
- let d = l >= -1 ? 1 : -l, f = e - 1 <= u ? a - 1 : n - e;
63
- for (let e = d; e <= f; ++e) c[i][e] = (c[t][e] - c[t][e - 1]) / s[u + 1][l + e], r += c[i][e] * s[l + e][u];
64
- e <= u && (c[i][a] = -c[t][a - 1] / s[u + 1][e], r += c[i][a] * s[e][u]), o[a][e] = r;
65
- let p = t;
66
- t = i, i = p;
67
- }
68
- }
69
- let u = n;
70
- for (let e = 1; e <= r; ++e) {
71
- for (let t = 0; t <= n; ++t) o[e][t] *= u;
72
- u *= n - e;
73
- }
74
- return o;
75
- }
76
- function le(e, t, n, r, i) {
77
- let a = i < e ? i : e, o = [], s = R(e, r, t), c = ce(s, r, e, a, t), l = [];
78
- for (let e = 0; e < n.length; ++e) {
79
- let t = n[e].clone(), r = t.w;
80
- t.x *= r, t.y *= r, t.z *= r, l[e] = t;
81
- }
82
- for (let t = 0; t <= a; ++t) {
83
- let n = l[s - e].clone().multiplyScalar(c[t][0]);
84
- for (let r = 1; r <= e; ++r) n.add(l[s - e + r].clone().multiplyScalar(c[t][r]));
85
- o[t] = n;
86
- }
87
- for (let e = a + 1; e <= i + 1; ++e) o[e] = new _(0, 0, 0);
88
- return o;
89
- }
90
- function ue(e, t) {
91
- let n = 1;
92
- for (let t = 2; t <= e; ++t) n *= t;
93
- let r = 1;
94
- for (let e = 2; e <= t; ++e) r *= e;
95
- for (let n = 2; n <= e - t; ++n) r *= n;
96
- return n / r;
97
- }
98
- function de(e) {
99
- let n = e.length, r = [], i = [];
100
- for (let a = 0; a < n; ++a) {
101
- let n = e[a];
102
- r[a] = new t(n.x, n.y, n.z), i[a] = n.w;
103
- }
104
- let a = [];
105
- for (let e = 0; e < n; ++e) {
106
- let t = r[e].clone();
107
- for (let n = 1; n <= e; ++n) t.sub(a[e - n].clone().multiplyScalar(ue(e, n) * i[n]));
108
- a[e] = t.divideScalar(i[0]);
109
- }
110
- return a;
111
- }
112
- function z(e, t, n, r, i) {
113
- return de(le(e, t, n, r, i));
114
- }
115
- //#endregion
116
- //#region node_modules/.pnpm/three@0.184.0/node_modules/three/examples/jsm/curves/NURBSCurve.js
117
- var B = class extends y {
118
- constructor(e, t, n, r, i) {
119
- super();
120
- let a = t ? t.length - 1 : 0, o = n ? n.length : 0;
121
- this.degree = e, this.knots = t, this.controlPoints = [], this.startKnot = r || 0, this.endKnot = i || a;
122
- for (let e = 0; e < o; ++e) {
123
- let t = n[e];
124
- this.controlPoints[e] = new _(t.x, t.y, t.z, t.w);
125
- }
126
- }
127
- getPoint(e, n = new t()) {
128
- let r = n, i = this.knots[this.startKnot] + e * (this.knots[this.endKnot] - this.knots[this.startKnot]), a = se(this.degree, this.knots, this.controlPoints, i);
129
- return a.w !== 1 && a.divideScalar(a.w), r.set(a.x, a.y, a.z);
130
- }
131
- getTangent(e, n = new t()) {
132
- let r = n, i = this.knots[0] + e * (this.knots[this.knots.length - 1] - this.knots[0]), a = z(this.degree, this.knots, this.controlPoints, i, 1);
133
- return r.copy(a[1]).normalize(), r;
134
- }
135
- toJSON() {
136
- let e = super.toJSON();
137
- return e.degree = this.degree, e.knots = [...this.knots], e.controlPoints = this.controlPoints.map((e) => e.toArray()), e.startKnot = this.startKnot, e.endKnot = this.endKnot, e;
138
- }
139
- fromJSON(e) {
140
- return super.fromJSON(e), this.degree = e.degree, this.knots = [...e.knots], this.controlPoints = e.controlPoints.map((e) => new _(e[0], e[1], e[2], e[3])), this.startKnot = e.startKnot, this.endKnot = e.endKnot, this;
141
- }
142
- }, V, H, U, fe = class extends l {
143
- constructor(e) {
144
- super(e);
145
- }
146
- load(e, t, r, i) {
147
- let a = this, o = a.path === "" ? ee.extractUrlBase(e) : a.path, s = new n(this.manager);
148
- s.setPath(a.path), s.setResponseType("arraybuffer"), s.setRequestHeader(a.requestHeader), s.setWithCredentials(a.withCredentials), s.load(e, function(n) {
149
- try {
150
- t(a.parse(n, o));
151
- } catch (t) {
152
- i ? i(t) : console.error(t), a.manager.itemError(e);
153
- }
154
- }, r, i);
155
- }
156
- parse(e, t) {
157
- if (ve(e)) V = new _e().parse(e);
158
- else {
159
- let t = $(e);
160
- if (!ye(t)) throw Error("THREE.FBXLoader: Unknown format.");
161
- if (K(t) < 7e3) throw Error("THREE.FBXLoader: FBX version not supported, FileVersion: " + K(t));
162
- V = new ge().parse(t);
163
- }
164
- return new pe(new s(this.manager).setPath(this.resourcePath || t).setCrossOrigin(this.crossOrigin), this.manager).parse(V);
165
- }
166
- }, pe = class {
167
- constructor(e, t) {
168
- this.textureLoader = e, this.manager = t;
169
- }
170
- parse() {
171
- H = this.parseConnections();
172
- let e = this.parseImages(), t = this.parseTextures(e), n = this.parseMaterials(t), r = this.parseDeformers(), i = new me().parse(r);
173
- return this.parseScene(r, i, n), U;
174
- }
175
- parseConnections() {
176
- let e = /* @__PURE__ */ new Map();
177
- return "Connections" in V && V.Connections.connections.forEach(function(t) {
178
- let n = t[0], r = t[1], i = t[2];
179
- e.has(n) || e.set(n, {
180
- parents: [],
181
- children: []
182
- });
183
- let a = {
184
- ID: r,
185
- relationship: i
186
- };
187
- e.get(n).parents.push(a), e.has(r) || e.set(r, {
188
- parents: [],
189
- children: []
190
- });
191
- let o = {
192
- ID: n,
193
- relationship: i
194
- };
195
- e.get(r).children.push(o);
196
- }), e;
197
- }
198
- parseImages() {
199
- let e = {}, t = {};
200
- if ("Video" in V.Objects) {
201
- let n = V.Objects.Video;
202
- for (let r in n) {
203
- let i = n[r], a = parseInt(r);
204
- if (e[a] = i.RelativeFilename || i.Filename, "Content" in i) {
205
- let e = i.Content instanceof ArrayBuffer && i.Content.byteLength > 0, a = typeof i.Content == "string" && i.Content !== "";
206
- if (e || a) {
207
- let e = this.parseImage(n[r]);
208
- t[i.RelativeFilename || i.Filename] = e;
209
- }
210
- }
211
- }
212
- }
213
- for (let n in e) {
214
- let r = e[n];
215
- t[r] === void 0 ? e[n] = e[n].split("\\").pop() : e[n] = t[r];
216
- }
217
- return e;
218
- }
219
- parseImage(e) {
220
- let t = e.Content, n = e.RelativeFilename || e.Filename, r = n.slice(n.lastIndexOf(".") + 1).toLowerCase(), i;
221
- switch (r) {
222
- case "bmp":
223
- i = "image/bmp";
224
- break;
225
- case "jpg":
226
- case "jpeg":
227
- i = "image/jpeg";
228
- break;
229
- case "png":
230
- i = "image/png";
231
- break;
232
- case "tif":
233
- i = "image/tiff";
234
- break;
235
- case "tga":
236
- this.manager.getHandler(".tga") === null && console.warn("FBXLoader: TGA loader not found, skipping ", n), i = "image/tga";
237
- break;
238
- case "webp":
239
- i = "image/webp";
240
- break;
241
- default:
242
- console.warn("FBXLoader: Image type \"" + r + "\" is not supported.");
243
- return;
244
- }
245
- if (typeof t == "string") return "data:" + i + ";base64," + t;
246
- {
247
- let e = new Uint8Array(t);
248
- return window.URL.createObjectURL(new Blob([e], { type: i }));
249
- }
250
- }
251
- parseTextures(e) {
252
- let t = /* @__PURE__ */ new Map();
253
- if ("Texture" in V.Objects) {
254
- let n = V.Objects.Texture;
255
- for (let r in n) {
256
- let i = this.parseTexture(n[r], e);
257
- t.set(parseInt(r), i);
258
- }
259
- }
260
- return t;
261
- }
262
- parseTexture(e, t) {
263
- let n = this.loadTexture(e, t);
264
- n.ID = e.id, n.name = e.attrName;
265
- let i = e.WrapModeU, a = e.WrapModeV, o = i === void 0 ? 0 : i.value, s = a === void 0 ? 0 : a.value;
266
- if (n.wrapS = o === 0 ? r : C, n.wrapT = s === 0 ? r : C, "Scaling" in e) {
267
- let t = e.Scaling.value;
268
- n.repeat.x = t[0], n.repeat.y = t[1];
269
- }
270
- if ("Translation" in e) {
271
- let t = e.Translation.value;
272
- n.offset.x = t[0], n.offset.y = t[1];
273
- }
274
- return n;
275
- }
276
- loadTexture(e, t) {
277
- let n = e.FileName.split(".").pop().toLowerCase(), r = this.manager.getHandler(`.${n}`);
278
- r === null && (r = this.textureLoader);
279
- let i = r.path;
280
- i || r.setPath(this.textureLoader.path);
281
- let a = H.get(e.id).children, o;
282
- if (a !== void 0 && a.length > 0 && t[a[0].ID] !== void 0 && (o = t[a[0].ID], (o.indexOf("blob:") === 0 || o.indexOf("data:") === 0) && r.setPath(void 0)), o === void 0) return console.warn("FBXLoader: Undefined filename, creating placeholder texture."), new f();
283
- let s = r.load(o);
284
- return r.setPath(i), s;
285
- }
286
- parseMaterials(e) {
287
- let t = /* @__PURE__ */ new Map();
288
- if ("Material" in V.Objects) {
289
- let n = V.Objects.Material;
290
- for (let r in n) {
291
- let i = this.parseMaterial(n[r], e);
292
- i !== null && t.set(parseInt(r), i);
293
- }
294
- }
295
- return t;
296
- }
297
- parseMaterial(e, t) {
298
- let n = e.id, r = e.attrName, i = e.ShadingModel;
299
- if (typeof i == "object" && (i = i.value), !H.has(n)) return null;
300
- let a = this.parseParameters(e, t, n), o;
301
- switch (i.toLowerCase()) {
302
- case "phong":
303
- o = new M();
304
- break;
305
- case "lambert":
306
- o = new D();
307
- break;
308
- default:
309
- console.warn("THREE.FBXLoader: unknown material type \"%s\". Defaulting to MeshPhongMaterial.", i), o = new M();
310
- break;
311
- }
312
- return o.setValues(a), o.name = r, o;
313
- }
314
- parseParameters(e, t, n) {
315
- let r = {};
316
- e.BumpFactor && (r.bumpScale = e.BumpFactor.value), e.Diffuse ? r.color = T.colorSpaceToWorking(new k().fromArray(e.Diffuse.value), I) : e.DiffuseColor && (e.DiffuseColor.type === "Color" || e.DiffuseColor.type === "ColorRGB") && (r.color = T.colorSpaceToWorking(new k().fromArray(e.DiffuseColor.value), I)), e.DisplacementFactor && (r.displacementScale = e.DisplacementFactor.value), e.Emissive ? r.emissive = T.colorSpaceToWorking(new k().fromArray(e.Emissive.value), I) : e.EmissiveColor && (e.EmissiveColor.type === "Color" || e.EmissiveColor.type === "ColorRGB") && (r.emissive = T.colorSpaceToWorking(new k().fromArray(e.EmissiveColor.value), I)), e.EmissiveFactor && (r.emissiveIntensity = parseFloat(e.EmissiveFactor.value)), r.opacity = 1 - (e.TransparencyFactor ? parseFloat(e.TransparencyFactor.value) : 0), (r.opacity === 1 || r.opacity === 0) && (r.opacity = e.Opacity ? parseFloat(e.Opacity.value) : null, r.opacity === null && (r.opacity = 1)), r.opacity < 1 && (r.transparent = !0), e.ReflectionFactor && (r.reflectivity = e.ReflectionFactor.value), e.Shininess && (r.shininess = e.Shininess.value), e.Specular ? r.specular = T.colorSpaceToWorking(new k().fromArray(e.Specular.value), I) : e.SpecularColor && e.SpecularColor.type === "Color" && (r.specular = T.colorSpaceToWorking(new k().fromArray(e.SpecularColor.value), I));
317
- let i = this;
318
- return H.get(n).children.forEach(function(e) {
319
- let n = e.relationship;
320
- switch (n) {
321
- case "Bump":
322
- r.bumpMap = i.getTexture(t, e.ID);
323
- break;
324
- case "Maya|TEX_ao_map":
325
- r.aoMap = i.getTexture(t, e.ID);
326
- break;
327
- case "DiffuseColor":
328
- case "Maya|TEX_color_map":
329
- r.map = i.getTexture(t, e.ID), r.map !== void 0 && (r.map.colorSpace = I);
330
- break;
331
- case "DisplacementColor":
332
- r.displacementMap = i.getTexture(t, e.ID);
333
- break;
334
- case "EmissiveColor":
335
- r.emissiveMap = i.getTexture(t, e.ID), r.emissiveMap !== void 0 && (r.emissiveMap.colorSpace = I);
336
- break;
337
- case "NormalMap":
338
- case "Maya|TEX_normal_map":
339
- r.normalMap = i.getTexture(t, e.ID);
340
- break;
341
- case "ReflectionColor":
342
- r.envMap = i.getTexture(t, e.ID), r.envMap !== void 0 && (r.envMap.mapping = 303, r.envMap.colorSpace = I);
343
- break;
344
- case "SpecularColor":
345
- r.specularMap = i.getTexture(t, e.ID), r.specularMap !== void 0 && (r.specularMap.colorSpace = I);
346
- break;
347
- case "TransparentColor":
348
- case "TransparencyFactor":
349
- r.alphaMap = i.getTexture(t, e.ID), r.transparent = !0;
350
- break;
351
- default:
352
- console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.", n);
353
- break;
354
- }
355
- }), r;
356
- }
357
- getTexture(e, t) {
358
- return "LayeredTexture" in V.Objects && t in V.Objects.LayeredTexture && (console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."), t = H.get(t).children[0].ID), e.get(t);
359
- }
360
- parseDeformers() {
361
- let e = {}, t = {};
362
- if ("Deformer" in V.Objects) {
363
- let n = V.Objects.Deformer;
364
- for (let r in n) {
365
- let i = n[r], a = H.get(parseInt(r));
366
- if (i.attrType === "Skin") {
367
- let t = this.parseSkeleton(a, n);
368
- t.ID = r, a.parents.length > 1 && console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."), t.geometryID = a.parents[0].ID, e[r] = t;
369
- } else if (i.attrType === "BlendShape") {
370
- let e = { id: r };
371
- e.rawTargets = this.parseMorphTargets(a, n), e.id = r, a.parents.length > 1 && console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."), t[r] = e;
372
- }
373
- }
374
- }
375
- return {
376
- skeletons: e,
377
- morphTargets: t
378
- };
379
- }
380
- parseSkeleton(t, n) {
381
- let r = [];
382
- return t.children.forEach(function(t) {
383
- let i = n[t.ID];
384
- if (i.attrType !== "Cluster") return;
385
- let a = {
386
- ID: t.ID,
387
- indices: [],
388
- weights: [],
389
- transformLink: new e().fromArray(i.TransformLink.a)
390
- };
391
- "Indexes" in i && (a.indices = i.Indexes.a, a.weights = i.Weights.a), r.push(a);
392
- }), {
393
- rawBones: r,
394
- bones: []
395
- };
396
- }
397
- parseMorphTargets(e, t) {
398
- let n = [];
399
- for (let r = 0; r < e.children.length; r++) {
400
- let i = e.children[r], a = t[i.ID], o = {
401
- name: a.attrName,
402
- initialWeight: a.DeformPercent,
403
- id: a.id,
404
- fullWeights: a.FullWeights.a
405
- };
406
- if (a.attrType !== "BlendShapeChannel") return;
407
- o.geoID = H.get(parseInt(i.ID)).children.filter(function(e) {
408
- return e.relationship === void 0;
409
- })[0].ID, n.push(o);
410
- }
411
- return n;
412
- }
413
- parseScene(t, n, r) {
414
- U = new a();
415
- let i = this.parseModels(t.skeletons, n, r), o = V.Objects.Model, s = this;
416
- i.forEach(function(e) {
417
- let t = o[e.ID];
418
- s.setLookAtProperties(e, t), H.get(e.ID).parents.forEach(function(t) {
419
- let n = i.get(t.ID);
420
- n !== void 0 && n.add(e);
421
- }), e.parent === null && U.add(e);
422
- }), this.addGlobalSceneSettings(), U.traverse(function(e) {
423
- if (e.userData.transformData) {
424
- e.parent && (e.userData.transformData.parentMatrix = e.parent.matrix, e.userData.transformData.parentMatrixWorld = e.parent.matrixWorld);
425
- let t = X(e.userData.transformData);
426
- e.applyMatrix4(t), e.updateWorldMatrix();
427
- }
428
- });
429
- let c = this.parsePoseNodes(), l = /* @__PURE__ */ new Set();
430
- for (let e in t.skeletons) t.skeletons[e].rawBones.forEach(function(n, r) {
431
- let i = t.skeletons[e].bones[r];
432
- i && l.add(i.ID);
433
- });
434
- let u = new e();
435
- U.traverse(function(e) {
436
- if (e.isBone && e.ID !== void 0 && !l.has(e.ID)) {
437
- let t = c[e.ID];
438
- t !== void 0 && (e.parent ? (u.copy(e.parent.matrixWorld).invert(), u.multiply(t)) : u.copy(t), u.decompose(e.position, e.quaternion, e.scale), e.updateMatrix(), e.matrixWorld.copy(t));
439
- }
440
- }), this.bindSkeleton(t.skeletons, n, i);
441
- let d = new he().parse();
442
- U.children.length === 1 && U.children[0].isGroup && (U.children[0].animations = d, U = U.children[0]), U.animations = d, "GlobalSettings" in V && "UpAxis" in V.GlobalSettings && V.GlobalSettings.UpAxis.value === 2 && (console.warn("THREE.FBXLoader: You are loading an asset with a Z-UP coordinate system. The loader just rotates the asset to transform it into Y-UP. The vertex data are not converted."), U.rotation.set(-Math.PI / 2, 0, 0));
443
- }
444
- parseModels(e, t, n) {
445
- let r = /* @__PURE__ */ new Map(), i = V.Objects.Model;
446
- for (let o in i) {
447
- let s = parseInt(o), c = i[o], l = H.get(s), u = this.buildSkeleton(l, e, s, c.attrName);
448
- if (!u) {
449
- switch (c.attrType) {
450
- case "Camera":
451
- u = this.createCamera(l);
452
- break;
453
- case "Light":
454
- u = this.createLight(l);
455
- break;
456
- case "Mesh":
457
- u = this.createMesh(l, t, n);
458
- break;
459
- case "NurbsCurve":
460
- u = this.createCurve(l, t);
461
- break;
462
- case "LimbNode":
463
- case "Root":
464
- u = new O();
465
- break;
466
- default:
467
- u = new a();
468
- break;
469
- }
470
- u.name = c.attrName ? P.sanitizeNodeName(c.attrName) : "", u.userData.originalName = c.attrName, u.ID = s;
471
- }
472
- this.getTransformData(u, c), r.set(s, u);
473
- }
474
- return r;
475
- }
476
- buildSkeleton(e, t, n, r) {
477
- let i = null;
478
- return e.parents.forEach(function(e) {
479
- for (let a in t) {
480
- let o = t[a];
481
- o.rawBones.forEach(function(t, a) {
482
- if (t.ID === e.ID) {
483
- let e = i;
484
- i = new O(), i.matrixWorld.copy(t.transformLink), i.name = r ? P.sanitizeNodeName(r) : "", i.userData.originalName = r, i.ID = n, o.bones[a] = i, e !== null && i.add(e);
485
- }
486
- });
487
- }
488
- }), i;
489
- }
490
- createCamera(e) {
491
- let t, n;
492
- if (e.children.forEach(function(e) {
493
- let t = V.Objects.NodeAttribute[e.ID];
494
- t !== void 0 && (n = t);
495
- }), n === void 0) t = new x();
496
- else {
497
- let e = 0;
498
- n.CameraProjectionType !== void 0 && n.CameraProjectionType.value === 1 && (e = 1);
499
- let r = 1;
500
- n.NearPlane !== void 0 && (r = n.NearPlane.value / 1e3);
501
- let i = 1e3;
502
- n.FarPlane !== void 0 && (i = n.FarPlane.value / 1e3);
503
- let a = window.innerWidth, o = window.innerHeight;
504
- n.AspectWidth !== void 0 && n.AspectHeight !== void 0 && (a = n.AspectWidth.value, o = n.AspectHeight.value);
505
- let s = a / o, c = 45;
506
- n.FieldOfView !== void 0 && (c = n.FieldOfView.value);
507
- let l = n.FocalLength ? n.FocalLength.value : null;
508
- switch (e) {
509
- case 0:
510
- t = new A(c, s, r, i), l !== null && t.setFocalLength(l);
511
- break;
512
- case 1:
513
- console.warn("THREE.FBXLoader: Orthographic cameras not supported yet."), t = new x();
514
- break;
515
- default:
516
- console.warn("THREE.FBXLoader: Unknown camera type " + e + "."), t = new x();
517
- break;
518
- }
519
- }
520
- return t;
521
- }
522
- createLight(e) {
523
- let t, n;
524
- if (e.children.forEach(function(e) {
525
- let t = V.Objects.NodeAttribute[e.ID];
526
- t !== void 0 && (n = t);
527
- }), n === void 0) t = new x();
528
- else {
529
- let e;
530
- e = n.LightType === void 0 ? 0 : n.LightType.value;
531
- let r = 16777215;
532
- n.Color !== void 0 && (r = T.colorSpaceToWorking(new k().fromArray(n.Color.value), I));
533
- let i = n.Intensity === void 0 ? 1 : n.Intensity.value / 100;
534
- n.CastLightOnObject !== void 0 && n.CastLightOnObject.value === 0 && (i = 0);
535
- let a = 0;
536
- switch (n.FarAttenuationEnd !== void 0 && (a = n.EnableFarAttenuation !== void 0 && n.EnableFarAttenuation.value === 0 ? 0 : n.FarAttenuationEnd.value), e) {
537
- case 0:
538
- t = new w(r, i, a, 1);
539
- break;
540
- case 1:
541
- t = new ne(r, i);
542
- break;
543
- case 2:
544
- let e = Math.PI / 3, o = 0;
545
- n.OuterAngle === void 0 ? n.InnerAngle !== void 0 && (e = v.degToRad(n.InnerAngle.value)) : (e = v.degToRad(n.OuterAngle.value), n.InnerAngle !== void 0 && (o = 1 - n.InnerAngle.value / n.OuterAngle.value, o = Math.max(0, o))), t = new u(r, i, a, e, o, 1);
546
- break;
547
- default:
548
- console.warn("THREE.FBXLoader: Unknown light type " + n.LightType.value + ", defaulting to a PointLight."), t = new w(r, i);
549
- break;
550
- }
551
- n.CastShadows !== void 0 && n.CastShadows.value === 1 && (t.castShadow = !0);
552
- }
553
- return t;
554
- }
555
- createMesh(e, t, n) {
556
- let r, i = null, a = null, o = [];
557
- if (e.children.forEach(function(e) {
558
- t.has(e.ID) && (i = t.get(e.ID)), n.has(e.ID) && o.push(n.get(e.ID));
559
- }), o.length > 1 ? a = o : o.length > 0 ? a = o[0] : (a = new M({
560
- name: l.DEFAULT_MATERIAL_NAME,
561
- color: 13421772
562
- }), o.push(a)), "color" in i.attributes && o.forEach(function(e) {
563
- e.vertexColors = !0;
564
- }), i.groups.length > 0) {
565
- let e = !1;
566
- for (let t = 0, n = i.groups.length; t < n; t++) {
567
- let n = i.groups[t];
568
- (n.materialIndex < 0 || n.materialIndex >= o.length) && (n.materialIndex = o.length, e = !0);
569
- }
570
- if (e) {
571
- let e = new M();
572
- o.push(e);
573
- }
574
- }
575
- return i.FBX_Deformer ? (r = new d(i, a), r.normalizeSkinWeights()) : r = new S(i, a), r;
576
- }
577
- createCurve(e, t) {
578
- return new m(e.children.reduce(function(e, n) {
579
- return t.has(n.ID) && (e = t.get(n.ID)), e;
580
- }, null), new re({
581
- name: l.DEFAULT_MATERIAL_NAME,
582
- color: 3342591,
583
- linewidth: 1
584
- }));
585
- }
586
- getTransformData(e, t) {
587
- let n = {};
588
- "InheritType" in t && (n.inheritType = parseInt(t.InheritType.value)), "RotationOrder" in t ? n.eulerOrder = Z(t.RotationOrder.value) : n.eulerOrder = Z(0), "Lcl_Translation" in t && (n.translation = t.Lcl_Translation.value), "PreRotation" in t && (n.preRotation = t.PreRotation.value), "Lcl_Rotation" in t && (n.rotation = t.Lcl_Rotation.value), "PostRotation" in t && (n.postRotation = t.PostRotation.value), "Lcl_Scaling" in t && (n.scale = t.Lcl_Scaling.value), "ScalingOffset" in t && (n.scalingOffset = t.ScalingOffset.value), "ScalingPivot" in t && (n.scalingPivot = t.ScalingPivot.value), "RotationOffset" in t && (n.rotationOffset = t.RotationOffset.value), "RotationPivot" in t && (n.rotationPivot = t.RotationPivot.value), e.userData.transformData = n;
589
- }
590
- setLookAtProperties(e, n) {
591
- "LookAtProperty" in n && H.get(e.ID).children.forEach(function(n) {
592
- if (n.relationship === "LookAtProperty") {
593
- let r = V.Objects.Model[n.ID];
594
- if ("Lcl_Translation" in r) {
595
- let n = r.Lcl_Translation.value;
596
- e.target === void 0 ? e.lookAt(new t().fromArray(n)) : (e.target.position.fromArray(n), U.add(e.target));
597
- }
598
- }
599
- });
600
- }
601
- bindSkeleton(t, n, r) {
602
- for (let a in t) {
603
- let o = t[a], s = [];
604
- for (let t = 0, n = o.bones.length; t < n; t++) {
605
- let n = new e();
606
- o.bones[t] && o.rawBones[t] && n.copy(o.rawBones[t].transformLink).invert(), s.push(n);
607
- }
608
- H.get(parseInt(o.ID)).parents.forEach(function(e) {
609
- if (n.has(e.ID)) {
610
- let t = e.ID;
611
- H.get(t).parents.forEach(function(e) {
612
- if (r.has(e.ID)) {
613
- let t = r.get(e.ID);
614
- t.updateMatrixWorld(!0), t.bind(new i(o.bones, s), t.matrixWorld);
615
- }
616
- });
617
- }
618
- });
619
- }
620
- }
621
- parsePoseNodes() {
622
- let t = {};
623
- if ("Pose" in V.Objects) {
624
- let n = V.Objects.Pose;
625
- for (let r in n) if (n[r].attrType === "BindPose" && n[r].NbPoseNodes > 0) {
626
- let i = n[r].PoseNode;
627
- Array.isArray(i) ? i.forEach(function(n) {
628
- t[n.Node] = new e().fromArray(n.Matrix.a);
629
- }) : t[i.Node] = new e().fromArray(i.Matrix.a);
630
- }
631
- }
632
- return t;
633
- }
634
- addGlobalSceneSettings() {
635
- if ("GlobalSettings" in V) {
636
- if ("AmbientColor" in V.GlobalSettings) {
637
- let e = V.GlobalSettings.AmbientColor.value, t = e[0], n = e[1], r = e[2];
638
- if (t !== 0 || n !== 0 || r !== 0) {
639
- let e = new k().setRGB(t, n, r, I);
640
- U.add(new E(e, 1));
641
- }
642
- }
643
- "UnitScaleFactor" in V.GlobalSettings && (U.userData.unitScaleFactor = V.GlobalSettings.UnitScaleFactor.value);
644
- }
645
- }
646
- }, me = class {
647
- constructor() {
648
- this.negativeMaterialIndices = !1;
649
- }
650
- parse(e) {
651
- let t = /* @__PURE__ */ new Map();
652
- if ("Geometry" in V.Objects) {
653
- let n = V.Objects.Geometry;
654
- for (let r in n) {
655
- let i = H.get(parseInt(r)), a = this.parseGeometry(i, n[r], e);
656
- t.set(parseInt(r), a);
657
- }
658
- }
659
- return this.negativeMaterialIndices === !0 && console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."), t;
660
- }
661
- parseGeometry(e, t, n) {
662
- switch (t.attrType) {
663
- case "Mesh": return this.parseMeshGeometry(e, t, n);
664
- case "NurbsCurve": return this.parseNurbsGeometry(t);
665
- }
666
- }
667
- parseMeshGeometry(e, t, n) {
668
- let r = n.skeletons, i = [], a = e.parents.map(function(e) {
669
- return V.Objects.Model[e.ID];
670
- });
671
- if (a.length === 0) return;
672
- let o = e.children.reduce(function(e, t) {
673
- return r[t.ID] !== void 0 && (e = r[t.ID]), e;
674
- }, null);
675
- e.children.forEach(function(e) {
676
- n.morphTargets[e.ID] !== void 0 && i.push(n.morphTargets[e.ID]);
677
- });
678
- let s = a[0], c = {};
679
- "RotationOrder" in s && (c.eulerOrder = Z(s.RotationOrder.value)), "InheritType" in s && (c.inheritType = parseInt(s.InheritType.value)), "GeometricTranslation" in s && (c.translation = s.GeometricTranslation.value), "GeometricRotation" in s && (c.rotation = s.GeometricRotation.value), "GeometricScaling" in s && (c.scale = s.GeometricScaling.value);
680
- let l = X(c);
681
- return this.genGeometry(t, o, i, l);
682
- }
683
- genGeometry(e, t, n, r) {
684
- let i = new N();
685
- e.attrName && (i.name = e.attrName);
686
- let a = this.parseGeoNode(e, t), o = this.genBuffers(a), s = new F(o.vertex, 3);
687
- if (s.applyMatrix4(r), i.setAttribute("position", s), o.colors.length > 0 && i.setAttribute("color", new F(o.colors, 3)), t && (i.setAttribute("skinIndex", new h(o.weightsIndices, 4)), i.setAttribute("skinWeight", new F(o.vertexWeights, 4)), i.FBX_Deformer = t), o.normal.length > 0) {
688
- let e = new p().getNormalMatrix(r), t = new F(o.normal, 3);
689
- t.applyNormalMatrix(e), i.setAttribute("normal", t);
690
- }
691
- if (o.uvs.forEach(function(e, t) {
692
- let n = t === 0 ? "uv" : `uv${t}`;
693
- i.setAttribute(n, new F(o.uvs[t], 2));
694
- }), a.material && a.material.mappingType !== "AllSame") {
695
- let e = o.materialIndex[0], t = 0;
696
- if (o.materialIndex.forEach(function(n, r) {
697
- n !== e && (i.addGroup(t, r - t, e), e = n, t = r);
698
- }), i.groups.length > 0) {
699
- let t = i.groups[i.groups.length - 1], n = t.start + t.count;
700
- n !== o.materialIndex.length && i.addGroup(n, o.materialIndex.length - n, e);
701
- }
702
- i.groups.length === 0 && i.addGroup(0, o.materialIndex.length, o.materialIndex[0]);
703
- }
704
- return this.addMorphTargets(i, e, n, r), i;
705
- }
706
- parseGeoNode(e, t) {
707
- let n = {};
708
- if (n.vertexPositions = e.Vertices === void 0 ? [] : e.Vertices.a, n.vertexIndices = e.PolygonVertexIndex === void 0 ? [] : e.PolygonVertexIndex.a, e.LayerElementColor && e.LayerElementColor[0].Colors && (n.color = this.parseVertexColors(e.LayerElementColor[0])), e.LayerElementMaterial && (n.material = this.parseMaterialIndices(e.LayerElementMaterial[0])), e.LayerElementNormal && (n.normal = this.parseNormals(e.LayerElementNormal[0])), e.LayerElementUV) {
709
- n.uv = [];
710
- let t = 0;
711
- for (; e.LayerElementUV[t];) e.LayerElementUV[t].UV && n.uv.push(this.parseUVs(e.LayerElementUV[t])), t++;
712
- }
713
- return n.weightTable = {}, t !== null && (n.skeleton = t, t.rawBones.forEach(function(e, t) {
714
- e.indices.forEach(function(r, i) {
715
- n.weightTable[r] === void 0 && (n.weightTable[r] = []), n.weightTable[r].push({
716
- id: t,
717
- weight: e.weights[i]
718
- });
719
- });
720
- })), n;
721
- }
722
- genBuffers(e) {
723
- let t = {
724
- vertex: [],
725
- normal: [],
726
- colors: [],
727
- uvs: [],
728
- materialIndex: [],
729
- vertexWeights: [],
730
- weightsIndices: []
731
- }, n = 0, r = 0, i = !1, a = [], o = [], s = [], c = [], l = [], u = [], d = this;
732
- return e.vertexIndices.forEach(function(f, p) {
733
- let m, h = !1;
734
- f < 0 && (f ^= -1, h = !0);
735
- let g = [], _ = [];
736
- if (a.push(f * 3, f * 3 + 1, f * 3 + 2), e.color) {
737
- let t = q(p, n, f, e.color);
738
- s.push(t[0], t[1], t[2]);
739
- }
740
- if (e.skeleton) {
741
- if (e.weightTable[f] !== void 0 && e.weightTable[f].forEach(function(e) {
742
- _.push(e.weight), g.push(e.id);
743
- }), _.length > 4) {
744
- i || (console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."), i = !0);
745
- let e = [
746
- 0,
747
- 0,
748
- 0,
749
- 0
750
- ], t = [
751
- 0,
752
- 0,
753
- 0,
754
- 0
755
- ];
756
- _.forEach(function(n, r) {
757
- let i = n, a = g[r];
758
- t.forEach(function(t, n, r) {
759
- if (i > t) {
760
- r[n] = i, i = t;
761
- let o = e[n];
762
- e[n] = a, a = o;
763
- }
764
- });
765
- }), g = e, _ = t;
766
- }
767
- for (; _.length < 4;) _.push(0), g.push(0);
768
- for (let e = 0; e < 4; ++e) l.push(_[e]), u.push(g[e]);
769
- }
770
- if (e.normal) {
771
- let t = q(p, n, f, e.normal);
772
- o.push(t[0], t[1], t[2]);
773
- }
774
- e.material && e.material.mappingType !== "AllSame" && (m = q(p, n, f, e.material)[0], m < 0 && (d.negativeMaterialIndices = !0, m = 0)), e.uv && e.uv.forEach(function(e, t) {
775
- let r = q(p, n, f, e);
776
- c[t] === void 0 && (c[t] = []), c[t].push(r[0]), c[t].push(r[1]);
777
- }), r++, h && (d.genFace(t, e, a, m, o, s, c, l, u, r), n++, r = 0, a = [], o = [], s = [], c = [], l = [], u = []);
778
- }), t;
779
- }
780
- getNormalNewell(e) {
781
- let n = new t(0, 0, 0);
782
- for (let t = 0; t < e.length; t++) {
783
- let r = e[t], i = e[(t + 1) % e.length];
784
- n.x += (r.y - i.y) * (r.z + i.z), n.y += (r.z - i.z) * (r.x + i.x), n.z += (r.x - i.x) * (r.y + i.y);
785
- }
786
- return n.normalize(), n;
787
- }
788
- getNormalTangentAndBitangent(e) {
789
- let n = this.getNormalNewell(e), r = (Math.abs(n.z) > .5 ? new t(0, 1, 0) : new t(0, 0, 1)).cross(n).normalize();
790
- return {
791
- normal: n,
792
- tangent: r,
793
- bitangent: n.clone().cross(r).normalize()
794
- };
795
- }
796
- flattenVertex(e, t, n) {
797
- return new ie(e.dot(t), e.dot(n));
798
- }
799
- genFace(e, n, r, i, a, s, c, l, u, d) {
800
- let f;
801
- if (d > 3) {
802
- let e = [], i = n.baseVertexPositions || n.vertexPositions;
803
- for (let n = 0; n < r.length; n += 3) e.push(new t(i[r[n]], i[r[n + 1]], i[r[n + 2]]));
804
- let { tangent: a, bitangent: s } = this.getNormalTangentAndBitangent(e), c = [];
805
- for (let t of e) c.push(this.flattenVertex(t, a, s));
806
- f = o.triangulateShape(c, []);
807
- } else f = [[
808
- 0,
809
- 1,
810
- 2
811
- ]];
812
- for (let [t, o, d] of f) e.vertex.push(n.vertexPositions[r[t * 3]]), e.vertex.push(n.vertexPositions[r[t * 3 + 1]]), e.vertex.push(n.vertexPositions[r[t * 3 + 2]]), e.vertex.push(n.vertexPositions[r[o * 3]]), e.vertex.push(n.vertexPositions[r[o * 3 + 1]]), e.vertex.push(n.vertexPositions[r[o * 3 + 2]]), e.vertex.push(n.vertexPositions[r[d * 3]]), e.vertex.push(n.vertexPositions[r[d * 3 + 1]]), e.vertex.push(n.vertexPositions[r[d * 3 + 2]]), n.skeleton && (e.vertexWeights.push(l[t * 4]), e.vertexWeights.push(l[t * 4 + 1]), e.vertexWeights.push(l[t * 4 + 2]), e.vertexWeights.push(l[t * 4 + 3]), e.vertexWeights.push(l[o * 4]), e.vertexWeights.push(l[o * 4 + 1]), e.vertexWeights.push(l[o * 4 + 2]), e.vertexWeights.push(l[o * 4 + 3]), e.vertexWeights.push(l[d * 4]), e.vertexWeights.push(l[d * 4 + 1]), e.vertexWeights.push(l[d * 4 + 2]), e.vertexWeights.push(l[d * 4 + 3]), e.weightsIndices.push(u[t * 4]), e.weightsIndices.push(u[t * 4 + 1]), e.weightsIndices.push(u[t * 4 + 2]), e.weightsIndices.push(u[t * 4 + 3]), e.weightsIndices.push(u[o * 4]), e.weightsIndices.push(u[o * 4 + 1]), e.weightsIndices.push(u[o * 4 + 2]), e.weightsIndices.push(u[o * 4 + 3]), e.weightsIndices.push(u[d * 4]), e.weightsIndices.push(u[d * 4 + 1]), e.weightsIndices.push(u[d * 4 + 2]), e.weightsIndices.push(u[d * 4 + 3])), n.color && (e.colors.push(s[t * 3]), e.colors.push(s[t * 3 + 1]), e.colors.push(s[t * 3 + 2]), e.colors.push(s[o * 3]), e.colors.push(s[o * 3 + 1]), e.colors.push(s[o * 3 + 2]), e.colors.push(s[d * 3]), e.colors.push(s[d * 3 + 1]), e.colors.push(s[d * 3 + 2])), n.material && n.material.mappingType !== "AllSame" && (e.materialIndex.push(i), e.materialIndex.push(i), e.materialIndex.push(i)), n.normal && (e.normal.push(a[t * 3]), e.normal.push(a[t * 3 + 1]), e.normal.push(a[t * 3 + 2]), e.normal.push(a[o * 3]), e.normal.push(a[o * 3 + 1]), e.normal.push(a[o * 3 + 2]), e.normal.push(a[d * 3]), e.normal.push(a[d * 3 + 1]), e.normal.push(a[d * 3 + 2])), n.uv && n.uv.forEach(function(n, r) {
813
- e.uvs[r] === void 0 && (e.uvs[r] = []), e.uvs[r].push(c[r][t * 2]), e.uvs[r].push(c[r][t * 2 + 1]), e.uvs[r].push(c[r][o * 2]), e.uvs[r].push(c[r][o * 2 + 1]), e.uvs[r].push(c[r][d * 2]), e.uvs[r].push(c[r][d * 2 + 1]);
814
- });
815
- }
816
- addMorphTargets(e, t, n, r) {
817
- if (n.length === 0) return;
818
- e.morphTargetsRelative = !0, e.morphAttributes.position = [];
819
- let i = r.clone().setPosition(0, 0, 0), a = this;
820
- n.forEach(function(n) {
821
- n.rawTargets.forEach(function(n) {
822
- let r = V.Objects.Geometry[n.geoID];
823
- r !== void 0 && a.genMorphGeometry(e, t, r, i, n.name);
824
- });
825
- });
826
- }
827
- genMorphGeometry(e, t, n, r, i) {
828
- let a = t.Vertices === void 0 ? [] : t.Vertices.a, o = t.PolygonVertexIndex === void 0 ? [] : t.PolygonVertexIndex.a, s = n.Vertices === void 0 ? [] : n.Vertices.a, c = n.Indexes === void 0 ? [] : n.Indexes.a, l = e.attributes.position.count * 3, u = new Float32Array(l);
829
- for (let e = 0; e < c.length; e++) {
830
- let t = c[e] * 3;
831
- u[t] = s[e * 3], u[t + 1] = s[e * 3 + 1], u[t + 2] = s[e * 3 + 2];
832
- }
833
- let d = {
834
- vertexIndices: o,
835
- vertexPositions: u,
836
- baseVertexPositions: a
837
- }, f = new F(this.genBuffers(d).vertex, 3);
838
- f.name = i || n.attrName, f.applyMatrix4(r), e.morphAttributes.position.push(f);
839
- }
840
- parseNormals(e) {
841
- let t = e.MappingInformationType, n = e.ReferenceInformationType, r = e.Normals.a, i = [];
842
- return n === "IndexToDirect" && ("NormalIndex" in e ? i = e.NormalIndex.a : "NormalsIndex" in e && (i = e.NormalsIndex.a)), {
843
- dataSize: 3,
844
- buffer: r,
845
- indices: i,
846
- mappingType: t,
847
- referenceType: n
848
- };
849
- }
850
- parseUVs(e) {
851
- let t = e.MappingInformationType, n = e.ReferenceInformationType, r = e.UV.a, i = [];
852
- return n === "IndexToDirect" && (i = e.UVIndex.a), {
853
- dataSize: 2,
854
- buffer: r,
855
- indices: i,
856
- mappingType: t,
857
- referenceType: n
858
- };
859
- }
860
- parseVertexColors(e) {
861
- let t = e.MappingInformationType, n = e.ReferenceInformationType, r = e.Colors.a, i = [];
862
- n === "IndexToDirect" && (i = e.ColorIndex.a);
863
- for (let e = 0, t = new k(); e < r.length; e += 4) t.fromArray(r, e), T.colorSpaceToWorking(t, I), t.toArray(r, e);
864
- return {
865
- dataSize: 4,
866
- buffer: r,
867
- indices: i,
868
- mappingType: t,
869
- referenceType: n
870
- };
871
- }
872
- parseMaterialIndices(e) {
873
- let t = e.MappingInformationType, n = e.ReferenceInformationType;
874
- if (t === "NoMappingInformation") return {
875
- dataSize: 1,
876
- buffer: [0],
877
- indices: [0],
878
- mappingType: "AllSame",
879
- referenceType: n
880
- };
881
- let r = e.Materials.a, i = [];
882
- for (let e = 0; e < r.length; ++e) i.push(e);
883
- return {
884
- dataSize: 1,
885
- buffer: r,
886
- indices: i,
887
- mappingType: t,
888
- referenceType: n
889
- };
890
- }
891
- parseNurbsGeometry(e) {
892
- let t = parseInt(e.Order);
893
- if (isNaN(t)) return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s", e.Order, e.id), new N();
894
- let n = t - 1, r = e.KnotVector.a, i = [], a = e.Points.a;
895
- for (let e = 0, t = a.length; e < t; e += 4) i.push(new _().fromArray(a, e));
896
- let o, s;
897
- if (e.Form === "Closed") i.push(i[0]);
898
- else if (e.Form === "Periodic") {
899
- o = n, s = r.length - 1 - o;
900
- for (let e = 0; e < n; ++e) i.push(i[e]);
901
- }
902
- let c = new B(n, r, i, o, s).getPoints(i.length * 12);
903
- return new N().setFromPoints(c);
904
- }
905
- }, he = class {
906
- parse() {
907
- let e = [], t = this.parseClips();
908
- if (t !== void 0) for (let n in t) {
909
- let r = t[n], i = this.addClip(r);
910
- e.push(i);
911
- }
912
- return e;
913
- }
914
- parseClips() {
915
- if (V.Objects.AnimationCurve === void 0) return;
916
- let e = this.parseAnimationCurveNodes();
917
- this.parseAnimationCurves(e);
918
- let t = this.parseAnimationLayers(e);
919
- return this.parseAnimStacks(t);
920
- }
921
- parseAnimationCurveNodes() {
922
- let e = V.Objects.AnimationCurveNode, t = /* @__PURE__ */ new Map();
923
- for (let n in e) {
924
- let r = e[n];
925
- if (r.attrName.match(/S|R|T|DeformPercent/) !== null) {
926
- let e = {
927
- id: r.id,
928
- attr: r.attrName,
929
- curves: {}
930
- };
931
- t.set(e.id, e);
932
- }
933
- }
934
- return t;
935
- }
936
- parseAnimationCurves(e) {
937
- let t = V.Objects.AnimationCurve;
938
- for (let n in t) {
939
- let r = {
940
- id: t[n].id,
941
- times: t[n].KeyTime.a.map(be),
942
- values: t[n].KeyValueFloat.a
943
- }, i = H.get(r.id);
944
- if (i !== void 0) {
945
- let t = i.parents[0].ID, n = i.parents[0].relationship;
946
- n.match(/X/) ? e.get(t).curves.x = r : n.match(/Y/) ? e.get(t).curves.y = r : n.match(/Z/) ? e.get(t).curves.z = r : n.match(/DeformPercent/) && e.has(t) && (e.get(t).curves.morph = r);
947
- }
948
- }
949
- }
950
- parseAnimationLayers(t) {
951
- let n = V.Objects.AnimationLayer, r = /* @__PURE__ */ new Map();
952
- for (let i in n) {
953
- let n = [], a = H.get(parseInt(i));
954
- a !== void 0 && (a.children.forEach(function(r, i) {
955
- if (t.has(r.ID)) {
956
- let a = t.get(r.ID);
957
- if (a.curves.x !== void 0 || a.curves.y !== void 0 || a.curves.z !== void 0) {
958
- if (n[i] === void 0) {
959
- let t = H.get(r.ID).parents.filter(function(e) {
960
- return e.relationship !== void 0;
961
- });
962
- if (t.length === 0) return;
963
- let a = t[0].ID;
964
- if (a !== void 0) {
965
- let t = V.Objects.Model[a.toString()];
966
- if (t === void 0) {
967
- console.warn("THREE.FBXLoader: Encountered a unused curve.", r);
968
- return;
969
- }
970
- let o = {
971
- modelName: t.attrName ? P.sanitizeNodeName(t.attrName) : "",
972
- ID: t.id,
973
- initialPosition: [
974
- 0,
975
- 0,
976
- 0
977
- ],
978
- initialRotation: [
979
- 0,
980
- 0,
981
- 0
982
- ],
983
- initialScale: [
984
- 1,
985
- 1,
986
- 1
987
- ]
988
- };
989
- U.traverse(function(e) {
990
- e.ID === t.id && (o.transform = e.matrix, e.userData.transformData && (o.eulerOrder = e.userData.transformData.eulerOrder, e.userData.transformData.rotation && (o.initialRotation = e.userData.transformData.rotation)));
991
- }), o.transform || (o.transform = new e()), "PreRotation" in t && (o.preRotation = t.PreRotation.value), "PostRotation" in t && (o.postRotation = t.PostRotation.value), n[i] = o;
992
- }
993
- }
994
- n[i] && (n[i][a.attr] = a);
995
- } else if (a.curves.morph !== void 0) {
996
- if (n[i] === void 0) {
997
- let e = H.get(r.ID).parents.filter(function(e) {
998
- return e.relationship !== void 0;
999
- });
1000
- if (e.length === 0) return;
1001
- let t = e[0].ID, a = H.get(t).parents[0].ID, o = H.get(a).parents[0].ID, s = H.get(o).parents[0].ID, c = V.Objects.Model[s];
1002
- n[i] = {
1003
- modelName: c.attrName ? P.sanitizeNodeName(c.attrName) : "",
1004
- morphName: V.Objects.Deformer[t].attrName
1005
- };
1006
- }
1007
- n[i][a.attr] = a;
1008
- }
1009
- }
1010
- }), r.set(parseInt(i), n));
1011
- }
1012
- return r;
1013
- }
1014
- parseAnimStacks(e) {
1015
- let t = V.Objects.AnimationStack, n = {};
1016
- for (let r in t) {
1017
- let i = H.get(parseInt(r)).children;
1018
- i.length > 1 && console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");
1019
- let a = e.get(i[0].ID);
1020
- n[r] = {
1021
- name: t[r].attrName,
1022
- layer: a
1023
- };
1024
- }
1025
- return n;
1026
- }
1027
- addClip(e) {
1028
- let t = [], n = this;
1029
- return e.layer.forEach(function(e) {
1030
- t = t.concat(n.generateTracks(e));
1031
- }), new j(e.name, -1, t);
1032
- }
1033
- generateTracks(e) {
1034
- let n = [], r = new t(), i = new t();
1035
- if (e.transform && e.transform.decompose(r, new L(), i), r = r.toArray(), i = i.toArray(), e.T !== void 0 && Object.keys(e.T.curves).length > 0) {
1036
- let t = this.generateVectorTrack(e.modelName, e.T.curves, r, "position");
1037
- t !== void 0 && n.push(t);
1038
- }
1039
- if (e.R !== void 0 && Object.keys(e.R.curves).length > 0) {
1040
- let t = this.generateRotationTrack(e.modelName, e.R.curves, e.preRotation, e.postRotation, e.eulerOrder, e.initialRotation);
1041
- t !== void 0 && n.push(t);
1042
- }
1043
- if (e.S !== void 0 && Object.keys(e.S.curves).length > 0) {
1044
- let t = this.generateVectorTrack(e.modelName, e.S.curves, i, "scale");
1045
- t !== void 0 && n.push(t);
1046
- }
1047
- if (e.DeformPercent !== void 0) {
1048
- let t = this.generateMorphTrack(e);
1049
- t !== void 0 && n.push(t);
1050
- }
1051
- return n;
1052
- }
1053
- generateVectorTrack(e, t, n, r) {
1054
- let i = this.getTimesForAllAxes(t), a = this.getKeyframeTrackValues(i, t, n);
1055
- return new c(e + "." + r, i, a);
1056
- }
1057
- generateRotationTrack(e, t, n, r, i, a) {
1058
- let o, s;
1059
- if (t.x !== void 0 || t.y !== void 0 || t.z !== void 0) {
1060
- let e = this.getTimesForAllAxes(t);
1061
- if (e.length > 0) {
1062
- let n = a || [
1063
- 0,
1064
- 0,
1065
- 0
1066
- ], r = this.synchronizeCurve(t.x, e, n[0]), c = this.synchronizeCurve(t.y, e, n[1]), l = this.synchronizeCurve(t.z, e, n[2]), u = this.interpolateRotations(r, c, l, i);
1067
- o = u[0], s = u[1];
1068
- }
1069
- }
1070
- let c = Z(0);
1071
- n !== void 0 && (n = n.map(v.degToRad), n.push(c), n = new g().fromArray(n), n = new L().setFromEuler(n)), r !== void 0 && (r = r.map(v.degToRad), r.push(c), r = new g().fromArray(r), r = new L().setFromEuler(r).invert());
1072
- let l = new L(), u = new g(), d = [];
1073
- if (!(!s || !o)) {
1074
- for (let e = 0; e < s.length; e += 3) u.set(s[e], s[e + 1], s[e + 2], i), l.setFromEuler(u), n !== void 0 && l.premultiply(n), r !== void 0 && l.multiply(r), e > 2 && new L().fromArray(d, (e - 3) / 3 * 4).dot(l) < 0 && l.set(-l.x, -l.y, -l.z, -l.w), l.toArray(d, e / 3 * 4);
1075
- return new b(e + ".quaternion", o, d);
1076
- }
1077
- }
1078
- generateMorphTrack(e) {
1079
- let t = e.DeformPercent.curves.morph, n = t.values.map(function(e) {
1080
- return e / 100;
1081
- }), r = U.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];
1082
- return new te(e.modelName + ".morphTargetInfluences[" + r + "]", t.times, n);
1083
- }
1084
- getTimesForAllAxes(e) {
1085
- let t = [];
1086
- if (e.x !== void 0 && (t = t.concat(e.x.times)), e.y !== void 0 && (t = t.concat(e.y.times)), e.z !== void 0 && (t = t.concat(e.z.times)), t = t.sort(function(e, t) {
1087
- return e - t;
1088
- }), t.length > 1) {
1089
- let e = 1, n = t[0];
1090
- for (let r = 1; r < t.length; r++) {
1091
- let i = t[r];
1092
- i !== n && (t[e] = i, n = i, e++);
1093
- }
1094
- t = t.slice(0, e);
1095
- }
1096
- return t;
1097
- }
1098
- getKeyframeTrackValues(e, t, n) {
1099
- let r = n, i = [], a = -1, o = -1, s = -1;
1100
- return e.forEach(function(e) {
1101
- if (t.x && (a = t.x.times.indexOf(e)), t.y && (o = t.y.times.indexOf(e)), t.z && (s = t.z.times.indexOf(e)), a !== -1) {
1102
- let e = t.x.values[a];
1103
- i.push(e), r[0] = e;
1104
- } else i.push(r[0]);
1105
- if (o !== -1) {
1106
- let e = t.y.values[o];
1107
- i.push(e), r[1] = e;
1108
- } else i.push(r[1]);
1109
- if (s !== -1) {
1110
- let e = t.z.values[s];
1111
- i.push(e), r[2] = e;
1112
- } else i.push(r[2]);
1113
- }), i;
1114
- }
1115
- synchronizeCurve(e, t, n) {
1116
- if (e === void 0) return {
1117
- times: t,
1118
- values: t.map(() => n)
1119
- };
1120
- if (e.times.length === t.length) return e;
1121
- let r = [];
1122
- for (let i = 0; i < t.length; i++) r.push(this.sampleCurveValue(e, t[i], n));
1123
- return {
1124
- times: t,
1125
- values: r
1126
- };
1127
- }
1128
- sampleCurveValue(e, t, n) {
1129
- let r = e.times, i = e.values;
1130
- if (t <= r[0]) return i[0];
1131
- if (t >= r[r.length - 1]) return i[i.length - 1];
1132
- for (let e = 0; e < r.length - 1; e++) if (t >= r[e] && t <= r[e + 1]) {
1133
- if (r[e] === t) return i[e];
1134
- let n = (t - r[e]) / (r[e + 1] - r[e]);
1135
- return i[e] * (1 - n) + i[e + 1] * n;
1136
- }
1137
- return n;
1138
- }
1139
- interpolateRotations(e, t, n, r) {
1140
- let i = [], a = [];
1141
- i.push(e.times[0]), a.push(v.degToRad(e.values[0])), a.push(v.degToRad(t.values[0])), a.push(v.degToRad(n.values[0]));
1142
- for (let o = 1; o < e.values.length; o++) {
1143
- let s = [
1144
- e.values[o - 1],
1145
- t.values[o - 1],
1146
- n.values[o - 1]
1147
- ];
1148
- if (isNaN(s[0]) || isNaN(s[1]) || isNaN(s[2])) continue;
1149
- let c = s.map(v.degToRad), l = [
1150
- e.values[o],
1151
- t.values[o],
1152
- n.values[o]
1153
- ];
1154
- if (isNaN(l[0]) || isNaN(l[1]) || isNaN(l[2])) continue;
1155
- let u = l.map(v.degToRad), d = [
1156
- l[0] - s[0],
1157
- l[1] - s[1],
1158
- l[2] - s[2]
1159
- ], f = [
1160
- Math.abs(d[0]),
1161
- Math.abs(d[1]),
1162
- Math.abs(d[2])
1163
- ];
1164
- if (f[0] >= 180 || f[1] >= 180 || f[2] >= 180) {
1165
- let t = Math.max(...f) / 180, n = new g(...c, r), s = new g(...u, r), l = new L().setFromEuler(n), d = new L().setFromEuler(s);
1166
- l.dot(d) < 0 && d.set(-d.x, -d.y, -d.z, -d.w);
1167
- let p = e.times[o - 1], m = e.times[o] - p, h = new L(), _ = new g();
1168
- for (let e = 0; e < 1; e += 1 / t) h.copy(l.clone().slerp(d.clone(), e)), i.push(p + e * m), _.setFromQuaternion(h, r), a.push(_.x), a.push(_.y), a.push(_.z);
1169
- } else i.push(e.times[o]), a.push(v.degToRad(e.values[o])), a.push(v.degToRad(t.values[o])), a.push(v.degToRad(n.values[o]));
1170
- }
1171
- return [i, a];
1172
- }
1173
- }, ge = class {
1174
- getPrevNode() {
1175
- return this.nodeStack[this.currentIndent - 2];
1176
- }
1177
- getCurrentNode() {
1178
- return this.nodeStack[this.currentIndent - 1];
1179
- }
1180
- getCurrentProp() {
1181
- return this.currentProp;
1182
- }
1183
- pushStack(e) {
1184
- this.nodeStack.push(e), this.currentIndent += 1;
1185
- }
1186
- popStack() {
1187
- this.nodeStack.pop(), --this.currentIndent;
1188
- }
1189
- setCurrentProp(e, t) {
1190
- this.currentProp = e, this.currentPropName = t;
1191
- }
1192
- parse(e) {
1193
- this.currentIndent = 0, this.allNodes = new G(), this.nodeStack = [], this.currentProp = [], this.currentPropName = "";
1194
- let t = this, n = e.split(/[\r\n]+/);
1195
- return n.forEach(function(e, r) {
1196
- let i = e.match(/^[\s\t]*;/), a = e.match(/^[\s\t]*$/);
1197
- if (i || a) return;
1198
- let o = e.match("^\\t{" + t.currentIndent + "}(\\w+):(.*){", ""), s = e.match("^\\t{" + t.currentIndent + "}(\\w+):[\\s\\t\\r\\n](.*)"), c = e.match("^\\t{" + (t.currentIndent - 1) + "}}");
1199
- o ? t.parseNodeBegin(e, o) : s ? t.parseNodeProperty(e, s, n[++r]) : c ? t.popStack() : e.match(/^[^\s\t}]/) && t.parseNodePropertyContinued(e);
1200
- }), this.allNodes;
1201
- }
1202
- parseNodeBegin(e, t) {
1203
- let n = t[1].trim().replace(/^"/, "").replace(/"$/, ""), r = t[2].split(",").map(function(e) {
1204
- return e.trim().replace(/^"/, "").replace(/"$/, "");
1205
- }), i = { name: n }, a = this.parseNodeAttr(r), o = this.getCurrentNode();
1206
- this.currentIndent === 0 ? this.allNodes.add(n, i) : n in o ? (n === "PoseNode" ? o.PoseNode.push(i) : o[n].id !== void 0 && (o[n] = {}, o[n][o[n].id] = o[n]), a.id !== "" && (o[n][a.id] = i)) : typeof a.id == "number" ? (o[n] = {}, o[n][a.id] = i) : n !== "Properties70" && (n === "PoseNode" ? o[n] = [i] : o[n] = i), typeof a.id == "number" && (i.id = a.id), a.name !== "" && (i.attrName = a.name), a.type !== "" && (i.attrType = a.type), this.pushStack(i);
1207
- }
1208
- parseNodeAttr(e) {
1209
- let t = e[0];
1210
- e[0] !== "" && (t = parseInt(e[0]), isNaN(t) && (t = e[0]));
1211
- let n = "", r = "";
1212
- return e.length > 1 && (n = e[1].replace(/^(\w+)::/, ""), r = e[2]), {
1213
- id: t,
1214
- name: n,
1215
- type: r
1216
- };
1217
- }
1218
- parseNodeProperty(e, t, n) {
1219
- let r = t[1].replace(/^"/, "").replace(/"$/, "").trim(), i = t[2].replace(/^"/, "").replace(/"$/, "").trim();
1220
- r === "Content" && i === "," && (i = n.replace(/"/g, "").replace(/,$/, "").trim());
1221
- let a = this.getCurrentNode();
1222
- if (a.name === "Properties70") {
1223
- this.parseNodeSpecialProperty(e, r, i);
1224
- return;
1225
- }
1226
- if (r === "C") {
1227
- let e = i.split(",").slice(1), t = parseInt(e[0]), n = parseInt(e[1]), o = i.split(",").slice(3);
1228
- o = o.map(function(e) {
1229
- return e.trim().replace(/^"/, "");
1230
- }), r = "connections", i = [t, n], Se(i, o), a[r] === void 0 && (a[r] = []);
1231
- }
1232
- r === "Node" && (a.id = i), r in a && Array.isArray(a[r]) ? a[r].push(i) : r === "a" ? a.a = i : a[r] = i, this.setCurrentProp(a, r), r === "a" && i.slice(-1) !== "," && (a.a = Q(i));
1233
- }
1234
- parseNodePropertyContinued(e) {
1235
- let t = this.getCurrentNode();
1236
- t.a += e, e.slice(-1) !== "," && (t.a = Q(t.a));
1237
- }
1238
- parseNodeSpecialProperty(e, t, n) {
1239
- let r = n.split("\",").map(function(e) {
1240
- return e.trim().replace(/^\"/, "").replace(/\s/, "_");
1241
- }), i = r[0], a = r[1], o = r[2], s = r[3], c = r[4];
1242
- switch (a) {
1243
- case "int":
1244
- case "enum":
1245
- case "bool":
1246
- case "ULongLong":
1247
- case "double":
1248
- case "Number":
1249
- case "FieldOfView":
1250
- c = parseFloat(c);
1251
- break;
1252
- case "Color":
1253
- case "ColorRGB":
1254
- case "Vector3D":
1255
- case "Lcl_Translation":
1256
- case "Lcl_Rotation":
1257
- case "Lcl_Scaling":
1258
- c = Q(c);
1259
- break;
1260
- }
1261
- this.getPrevNode()[i] = {
1262
- type: a,
1263
- type2: o,
1264
- flag: s,
1265
- value: c
1266
- }, this.setCurrentProp(this.getPrevNode(), i);
1267
- }
1268
- }, _e = class {
1269
- parse(e) {
1270
- let t = new W(e);
1271
- t.skip(23);
1272
- let n = t.getUint32();
1273
- if (n < 6400) throw Error("THREE.FBXLoader: FBX version not supported, FileVersion: " + n);
1274
- let r = new G();
1275
- for (; !this.endOfContent(t);) {
1276
- let e = this.parseNode(t, n);
1277
- e !== null && r.add(e.name, e);
1278
- }
1279
- return r;
1280
- }
1281
- endOfContent(e) {
1282
- return e.size() % 16 == 0 ? (e.getOffset() + 160 + 16 & -16) >= e.size() : e.getOffset() + 160 + 16 >= e.size();
1283
- }
1284
- parseNode(e, t) {
1285
- let n = {}, r = t >= 7500 ? e.getUint64() : e.getUint32(), i = t >= 7500 ? e.getUint64() : e.getUint32();
1286
- t >= 7500 ? e.getUint64() : e.getUint32();
1287
- let a = e.getUint8(), o = e.getString(a);
1288
- if (r === 0) return null;
1289
- let s = [];
1290
- for (let t = 0; t < i; t++) s.push(this.parseProperty(e));
1291
- let c = s.length > 0 ? s[0] : "", l = s.length > 1 ? s[1] : "", u = s.length > 2 ? s[2] : "";
1292
- for (n.singleProperty = i === 1 && e.getOffset() === r; r > e.getOffset();) {
1293
- let r = this.parseNode(e, t);
1294
- r !== null && this.parseSubNode(o, n, r);
1295
- }
1296
- return n.propertyList = s, typeof c == "number" && (n.id = c), l !== "" && (n.attrName = l), u !== "" && (n.attrType = u), o !== "" && (n.name = o), n;
1297
- }
1298
- parseSubNode(e, t, n) {
1299
- if (n.singleProperty === !0) {
1300
- let e = n.propertyList[0];
1301
- Array.isArray(e) ? (t[n.name] = n, n.a = e) : t[n.name] = e;
1302
- } else if (e === "Connections" && n.name === "C") {
1303
- let e = [];
1304
- n.propertyList.forEach(function(t, n) {
1305
- n !== 0 && e.push(t);
1306
- }), t.connections === void 0 && (t.connections = []), t.connections.push(e);
1307
- } else if (n.name === "Properties70") Object.keys(n).forEach(function(e) {
1308
- t[e] = n[e];
1309
- });
1310
- else if (e === "Properties70" && n.name === "P") {
1311
- let e = n.propertyList[0], r = n.propertyList[1], i = n.propertyList[2], a = n.propertyList[3], o;
1312
- e.indexOf("Lcl ") === 0 && (e = e.replace("Lcl ", "Lcl_")), r.indexOf("Lcl ") === 0 && (r = r.replace("Lcl ", "Lcl_")), o = r === "Color" || r === "ColorRGB" || r === "Vector" || r === "Vector3D" || r.indexOf("Lcl_") === 0 ? [
1313
- n.propertyList[4],
1314
- n.propertyList[5],
1315
- n.propertyList[6]
1316
- ] : n.propertyList[4], t[e] = {
1317
- type: r,
1318
- type2: i,
1319
- flag: a,
1320
- value: o
1321
- };
1322
- } else t[n.name] === void 0 ? typeof n.id == "number" ? (t[n.name] = {}, t[n.name][n.id] = n) : t[n.name] = n : n.name === "PoseNode" ? (Array.isArray(t[n.name]) || (t[n.name] = [t[n.name]]), t[n.name].push(n)) : t[n.name][n.id] === void 0 && (t[n.name][n.id] = n);
1323
- }
1324
- parseProperty(e) {
1325
- let t = e.getString(1), n;
1326
- switch (t) {
1327
- case "C": return e.getBoolean();
1328
- case "D": return e.getFloat64();
1329
- case "F": return e.getFloat32();
1330
- case "I": return e.getInt32();
1331
- case "L": return e.getInt64();
1332
- case "R": return n = e.getUint32(), e.getArrayBuffer(n);
1333
- case "S": return n = e.getUint32(), e.getString(n);
1334
- case "Y": return e.getInt16();
1335
- case "b":
1336
- case "c":
1337
- case "d":
1338
- case "f":
1339
- case "i":
1340
- case "l":
1341
- let r = e.getUint32(), i = e.getUint32(), a = e.getUint32();
1342
- if (i === 0) switch (t) {
1343
- case "b":
1344
- case "c": return e.getBooleanArray(r);
1345
- case "d": return e.getFloat64Array(r);
1346
- case "f": return e.getFloat32Array(r);
1347
- case "i": return e.getInt32Array(r);
1348
- case "l": return e.getInt64Array(r);
1349
- }
1350
- let o = new W(ae(new Uint8Array(e.getArrayBuffer(a))).buffer);
1351
- switch (t) {
1352
- case "b":
1353
- case "c": return o.getBooleanArray(r);
1354
- case "d": return o.getFloat64Array(r);
1355
- case "f": return o.getFloat32Array(r);
1356
- case "i": return o.getInt32Array(r);
1357
- case "l": return o.getInt64Array(r);
1358
- }
1359
- break;
1360
- default: throw Error("THREE.FBXLoader: Unknown property type " + t);
1361
- }
1362
- }
1363
- }, W = class {
1364
- constructor(e, t) {
1365
- this.dv = new DataView(e), this.offset = 0, this.littleEndian = t === void 0 ? !0 : t, this._textDecoder = new TextDecoder();
1366
- }
1367
- getOffset() {
1368
- return this.offset;
1369
- }
1370
- size() {
1371
- return this.dv.buffer.byteLength;
1372
- }
1373
- skip(e) {
1374
- this.offset += e;
1375
- }
1376
- getBoolean() {
1377
- return (this.getUint8() & 1) == 1;
1378
- }
1379
- getBooleanArray(e) {
1380
- let t = [];
1381
- for (let n = 0; n < e; n++) t.push(this.getBoolean());
1382
- return t;
1383
- }
1384
- getUint8() {
1385
- let e = this.dv.getUint8(this.offset);
1386
- return this.offset += 1, e;
1387
- }
1388
- getInt16() {
1389
- let e = this.dv.getInt16(this.offset, this.littleEndian);
1390
- return this.offset += 2, e;
1391
- }
1392
- getInt32() {
1393
- let e = this.dv.getInt32(this.offset, this.littleEndian);
1394
- return this.offset += 4, e;
1395
- }
1396
- getInt32Array(e) {
1397
- let t = [];
1398
- for (let n = 0; n < e; n++) t.push(this.getInt32());
1399
- return t;
1400
- }
1401
- getUint32() {
1402
- let e = this.dv.getUint32(this.offset, this.littleEndian);
1403
- return this.offset += 4, e;
1404
- }
1405
- getInt64() {
1406
- let e, t;
1407
- return this.littleEndian ? (e = this.getUint32(), t = this.getUint32()) : (t = this.getUint32(), e = this.getUint32()), t & 2147483648 ? (t = ~t & 4294967295, e = ~e & 4294967295, e === 4294967295 && (t = t + 1 & 4294967295), e = e + 1 & 4294967295, -(t * 4294967296 + e)) : t * 4294967296 + e;
1408
- }
1409
- getInt64Array(e) {
1410
- let t = [];
1411
- for (let n = 0; n < e; n++) t.push(this.getInt64());
1412
- return t;
1413
- }
1414
- getUint64() {
1415
- let e, t;
1416
- return this.littleEndian ? (e = this.getUint32(), t = this.getUint32()) : (t = this.getUint32(), e = this.getUint32()), t * 4294967296 + e;
1417
- }
1418
- getFloat32() {
1419
- let e = this.dv.getFloat32(this.offset, this.littleEndian);
1420
- return this.offset += 4, e;
1421
- }
1422
- getFloat32Array(e) {
1423
- let t = [];
1424
- for (let n = 0; n < e; n++) t.push(this.getFloat32());
1425
- return t;
1426
- }
1427
- getFloat64() {
1428
- let e = this.dv.getFloat64(this.offset, this.littleEndian);
1429
- return this.offset += 8, e;
1430
- }
1431
- getFloat64Array(e) {
1432
- let t = [];
1433
- for (let n = 0; n < e; n++) t.push(this.getFloat64());
1434
- return t;
1435
- }
1436
- getArrayBuffer(e) {
1437
- let t = this.dv.buffer.slice(this.offset, this.offset + e);
1438
- return this.offset += e, t;
1439
- }
1440
- getString(e) {
1441
- let t = this.offset, n = new Uint8Array(this.dv.buffer, t, e);
1442
- this.skip(e);
1443
- let r = n.indexOf(0);
1444
- return r >= 0 && (n = new Uint8Array(this.dv.buffer, t, r)), this._textDecoder.decode(n);
1445
- }
1446
- }, G = class {
1447
- add(e, t) {
1448
- this[e] = t;
1449
- }
1450
- };
1451
- function ve(e) {
1452
- return e.byteLength >= 21 && $(e, 0, 21) === "Kaydara FBX Binary \0";
1453
- }
1454
- function ye(e) {
1455
- let t = [
1456
- "K",
1457
- "a",
1458
- "y",
1459
- "d",
1460
- "a",
1461
- "r",
1462
- "a",
1463
- "\\",
1464
- "F",
1465
- "B",
1466
- "X",
1467
- "\\",
1468
- "B",
1469
- "i",
1470
- "n",
1471
- "a",
1472
- "r",
1473
- "y",
1474
- "\\",
1475
- "\\"
1476
- ], n = 0;
1477
- function r(t) {
1478
- let r = e[t - 1];
1479
- return e = e.slice(n + t), n++, r;
1480
- }
1481
- for (let e = 0; e < t.length; ++e) if (r(1) === t[e]) return !1;
1482
- return !0;
1483
- }
1484
- function K(e) {
1485
- let t = e.match(/FBXVersion: (\d+)/);
1486
- if (t) return parseInt(t[1]);
1487
- throw Error("THREE.FBXLoader: Cannot find the version number for the file given.");
1488
- }
1489
- function be(e) {
1490
- return e / 46186158e3;
1491
- }
1492
- var xe = [];
1493
- function q(e, t, n, r) {
1494
- let i;
1495
- switch (r.mappingType) {
1496
- case "ByPolygonVertex":
1497
- i = e;
1498
- break;
1499
- case "ByPolygon":
1500
- i = t;
1501
- break;
1502
- case "ByVertice":
1503
- i = n;
1504
- break;
1505
- case "AllSame":
1506
- i = r.indices[0];
1507
- break;
1508
- default: console.warn("THREE.FBXLoader: unknown attribute mapping type " + r.mappingType);
1509
- }
1510
- r.referenceType === "IndexToDirect" && (i = r.indices[i]);
1511
- let a = i * r.dataSize, o = a + r.dataSize;
1512
- return Ce(xe, r.buffer, a, o);
1513
- }
1514
- var J = new g(), Y = new t();
1515
- function X(n) {
1516
- let r = new e(), i = new e(), a = new e(), o = new e(), s = new e(), c = new e(), l = new e(), u = new e(), d = new e(), f = new e(), p = new e(), m = new e(), h = n.inheritType ? n.inheritType : 0;
1517
- n.translation && r.setPosition(Y.fromArray(n.translation));
1518
- let g = Z(0);
1519
- if (n.preRotation) {
1520
- let e = n.preRotation.map(v.degToRad);
1521
- e.push(g), i.makeRotationFromEuler(J.fromArray(e));
1522
- }
1523
- if (n.rotation) {
1524
- let e = n.rotation.map(v.degToRad);
1525
- e.push(n.eulerOrder || g), a.makeRotationFromEuler(J.fromArray(e));
1526
- }
1527
- if (n.postRotation) {
1528
- let e = n.postRotation.map(v.degToRad);
1529
- e.push(g), o.makeRotationFromEuler(J.fromArray(e)), o.invert();
1530
- }
1531
- n.scale && s.scale(Y.fromArray(n.scale)), n.scalingOffset && l.setPosition(Y.fromArray(n.scalingOffset)), n.scalingPivot && c.setPosition(Y.fromArray(n.scalingPivot)), n.rotationOffset && u.setPosition(Y.fromArray(n.rotationOffset)), n.rotationPivot && d.setPosition(Y.fromArray(n.rotationPivot)), n.parentMatrixWorld && (p.copy(n.parentMatrix), f.copy(n.parentMatrixWorld));
1532
- let _ = i.clone().multiply(a).multiply(o), y = new e();
1533
- y.extractRotation(f);
1534
- let b = new e();
1535
- b.copyPosition(f);
1536
- let x = b.clone().invert().multiply(f), S = y.clone().invert().multiply(x), C = s, w = new e();
1537
- if (h === 0) w.copy(y).multiply(_).multiply(S).multiply(C);
1538
- else if (h === 1) w.copy(y).multiply(S).multiply(_).multiply(C);
1539
- else {
1540
- let n = new e().scale(new t().setFromMatrixScale(p)).clone().invert(), r = S.clone().multiply(n);
1541
- w.copy(y).multiply(_).multiply(r).multiply(C);
1542
- }
1543
- let T = d.clone().invert(), E = c.clone().invert(), D = r.clone().multiply(u).multiply(d).multiply(i).multiply(a).multiply(o).multiply(T).multiply(l).multiply(c).multiply(s).multiply(E), O = new e().copyPosition(D), k = f.clone().multiply(O);
1544
- return m.copyPosition(k), D = m.clone().multiply(w), D.premultiply(f.invert()), D;
1545
- }
1546
- function Z(e) {
1547
- e = e || 0;
1548
- let t = [
1549
- "ZYX",
1550
- "YZX",
1551
- "XZY",
1552
- "ZXY",
1553
- "YXZ",
1554
- "XYZ"
1555
- ];
1556
- return e === 6 ? (console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."), t[0]) : t[e];
1557
- }
1558
- function Q(e) {
1559
- return e.split(",").map(function(e) {
1560
- return parseFloat(e);
1561
- });
1562
- }
1563
- function $(e, t, n) {
1564
- return t === void 0 && (t = 0), n === void 0 && (n = e.byteLength), new TextDecoder().decode(new Uint8Array(e, t, n));
1565
- }
1566
- function Se(e, t) {
1567
- for (let n = 0, r = e.length, i = t.length; n < i; n++, r++) e[r] = t[n];
1568
- }
1569
- function Ce(e, t, n, r) {
1570
- for (let i = n, a = 0; i < r; i++, a++) e[a] = t[i];
1571
- return e;
1572
- }
1573
- //#endregion
1574
- export { fe as FBXLoader };