@carbonenginejs/runtime 0.1.0-alpha.4 → 0.1.0-alpha.5

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 (384) hide show
  1. package/dist/global/blue/BlueClasses.js +200 -0
  2. package/dist/global/blue/BlueClasses.js.map +1 -0
  3. package/dist/global/blue/IBlueClasses.js +79 -0
  4. package/dist/global/blue/IBlueClasses.js.map +1 -0
  5. package/dist/global/blue/IBlueDynamicResourceConstructor.js +16 -0
  6. package/dist/global/blue/IBlueDynamicResourceConstructor.js.map +1 -1
  7. package/dist/global/blue/blue.js +8 -2
  8. package/dist/global/blue/blue.js.map +1 -1
  9. package/dist/global/blue/index.js +2 -0
  10. package/dist/global/blue/index.js.map +1 -1
  11. package/dist/global/consts/index.js +0 -1
  12. package/dist/global/consts/index.js.map +1 -1
  13. package/dist/global/consts/renderContext/formats.js +26 -25
  14. package/dist/global/consts/renderContext/formats.js.map +1 -1
  15. package/dist/{trinityal/Tr2BitmapDimensions.js → global/imageio/BitmapDimensions.js} +19 -15
  16. package/dist/global/imageio/BitmapDimensions.js.map +1 -0
  17. package/dist/global/imageio/Cutout.js +28 -0
  18. package/dist/global/imageio/Cutout.js.map +1 -0
  19. package/dist/global/imageio/HostBitmap.js +1106 -0
  20. package/dist/global/imageio/HostBitmap.js.map +1 -0
  21. package/dist/global/imageio/ImageIOResult.js +99 -0
  22. package/dist/global/imageio/ImageIOResult.js.map +1 -0
  23. package/dist/global/imageio/ImageUtility.js +205 -0
  24. package/dist/global/imageio/ImageUtility.js.map +1 -0
  25. package/dist/global/imageio/LoadParameters.js +86 -0
  26. package/dist/global/imageio/LoadParameters.js.map +1 -0
  27. package/dist/global/imageio/Metadata.js +22 -0
  28. package/dist/global/imageio/Metadata.js.map +1 -0
  29. package/dist/global/imageio/index.js +8 -0
  30. package/dist/global/{consts/webgpu → imageio}/index.js.map +1 -1
  31. package/dist/global/index.js +2 -1
  32. package/dist/global/index.js.map +1 -1
  33. package/dist/global/math/color.js +1 -1
  34. package/dist/global/math/color.js.map +1 -1
  35. package/dist/global/schema/CjsSchema.js +8 -0
  36. package/dist/global/schema/CjsSchema.js.map +1 -1
  37. package/dist/index.js +12 -4
  38. package/dist/index.js.map +1 -1
  39. package/dist/resource/CjsResMan.js +47 -7
  40. package/dist/resource/CjsResMan.js.map +1 -1
  41. package/dist/resource/Tr2LightProfileRes.js +37 -0
  42. package/dist/resource/Tr2LightProfileRes.js.map +1 -1
  43. package/dist/resource/format/CjsByteWriter.js +46 -46
  44. package/dist/resource/format/CjsByteWriter.js.map +1 -1
  45. package/dist/resource/format/CjsFormat.js +7 -8
  46. package/dist/resource/format/CjsFormat.js.map +1 -1
  47. package/dist/resource/format/CjsFormatStore.js +8 -8
  48. package/dist/resource/format/CjsFormatStore.js.map +1 -1
  49. package/dist/resource/format/CjsGeometryFormat.js +114 -0
  50. package/dist/resource/format/CjsGeometryFormat.js.map +1 -0
  51. package/dist/resource/format/CjsImageFormat.js +282 -0
  52. package/dist/resource/format/CjsImageFormat.js.map +1 -0
  53. package/dist/resource/format/CjsResourceProbe.js +12 -48
  54. package/dist/resource/format/CjsResourceProbe.js.map +1 -1
  55. package/dist/resource/format/CjsStringTable.js +37 -37
  56. package/dist/resource/format/CjsStringTable.js.map +1 -1
  57. package/dist/resource/format/carbonEffect/CjsCarbonEffectReader.js +10 -10
  58. package/dist/resource/format/carbonEffect/CjsCarbonEffectReader.js.map +1 -1
  59. package/dist/resource/format/carbonEffect/CjsCarbonEffectWriter.js +37 -37
  60. package/dist/resource/format/carbonEffect/CjsCarbonEffectWriter.js.map +1 -1
  61. package/dist/resource/format/carbonEffect/carbonEffectBackendBlock.js +35 -7
  62. package/dist/resource/format/carbonEffect/carbonEffectBackendBlock.js.map +1 -1
  63. package/dist/resource/format/index.js +3 -1
  64. package/dist/resource/format/index.js.map +1 -1
  65. package/dist/resource/formats/black/CjsBlackFormat.js +130 -137
  66. package/dist/resource/formats/black/CjsBlackFormat.js.map +1 -1
  67. package/dist/resource/formats/bnk/CjsBnkFormat.js +12 -19
  68. package/dist/resource/formats/bnk/CjsBnkFormat.js.map +1 -1
  69. package/dist/resource/formats/bnk/core/helpers.js +1 -3
  70. package/dist/resource/formats/bnk/core/helpers.js.map +1 -1
  71. package/dist/resource/formats/cmf/CjsCmfFormat.js +19 -82
  72. package/dist/resource/formats/cmf/CjsCmfFormat.js.map +1 -1
  73. package/dist/resource/formats/cmf/core/constants.js +1 -2
  74. package/dist/resource/formats/cmf/core/constants.js.map +1 -1
  75. package/dist/resource/formats/{stl/core/targets.js → cmf/core/flatShared.js} +9 -8
  76. package/dist/resource/formats/cmf/core/flatShared.js.map +1 -0
  77. package/dist/resource/formats/cmf/core/helpers.js +13 -13
  78. package/dist/resource/formats/cmf/core/helpers.js.map +1 -1
  79. package/dist/resource/formats/cmf/core/writer.js +24 -24
  80. package/dist/resource/formats/cmf/core/writer.js.map +1 -1
  81. package/dist/resource/formats/dds/CjsDdsFormat.js +134 -17
  82. package/dist/resource/formats/dds/CjsDdsFormat.js.map +1 -1
  83. package/dist/resource/formats/dds/core/helpers.js +125 -40
  84. package/dist/resource/formats/dds/core/helpers.js.map +1 -1
  85. package/dist/resource/formats/dxbc/CjsDxbcFormat.js +14 -16
  86. package/dist/resource/formats/dxbc/CjsDxbcFormat.js.map +1 -1
  87. package/dist/resource/formats/dxbc/core/{container.js → DxbcContainer.js} +2 -2
  88. package/dist/resource/formats/dxbc/core/DxbcContainer.js.map +1 -0
  89. package/dist/resource/formats/dxbc/core/{errors.js → DxbcReadError.js} +1 -1
  90. package/dist/resource/formats/dxbc/core/DxbcReadError.js.map +1 -0
  91. package/dist/resource/formats/dxbc/core/DxbcReader.js +1 -1
  92. package/dist/resource/formats/dxbc/core/DxbcReader.js.map +1 -1
  93. package/dist/resource/formats/dxbc/core/{program.js → DxbcShaderProgram.js} +2 -2
  94. package/dist/resource/formats/dxbc/core/DxbcShaderProgram.js.map +1 -0
  95. package/dist/resource/formats/dxbc/core/{signature.js → DxbcSignatureChunk.js} +2 -2
  96. package/dist/resource/formats/dxbc/core/DxbcSignatureChunk.js.map +1 -0
  97. package/dist/resource/formats/dxbc/core/decoder.js +2 -2
  98. package/dist/resource/formats/dxbc/core/decoder.js.map +1 -1
  99. package/dist/resource/formats/dxbc/core/helpers.js +3 -3
  100. package/dist/resource/formats/dxbc/core/helpers.js.map +1 -1
  101. package/dist/resource/formats/fbx/CjsFbxFormat.js +18 -20
  102. package/dist/resource/formats/fbx/CjsFbxFormat.js.map +1 -1
  103. package/dist/resource/formats/flac/CjsFlacFormat.js +7 -13
  104. package/dist/resource/formats/flac/CjsFlacFormat.js.map +1 -1
  105. package/dist/resource/formats/fsd/32/CjsFsd32Format.js +29 -29
  106. package/dist/resource/formats/fsd/32/CjsFsd32Format.js.map +1 -1
  107. package/dist/resource/formats/fsd/64/CjsFsd64Format.js +3 -3
  108. package/dist/resource/formats/fsd/64/CjsFsd64Format.js.map +1 -1
  109. package/dist/resource/formats/fsd/64/core/CjsFsd64Binary.js +23 -23
  110. package/dist/resource/formats/fsd/64/core/CjsFsd64Binary.js.map +1 -1
  111. package/dist/resource/formats/fsd/64/core/CjsFsd64Reader.js +8 -8
  112. package/dist/resource/formats/fsd/64/core/CjsFsd64Reader.js.map +1 -1
  113. package/dist/resource/formats/fsd/CjsFsdFormat.js +23 -23
  114. package/dist/resource/formats/fsd/CjsFsdFormat.js.map +1 -1
  115. package/dist/resource/formats/gif/CjsGifFormat.js +24 -15
  116. package/dist/resource/formats/gif/CjsGifFormat.js.map +1 -1
  117. package/dist/resource/formats/gltf/CjsGltfFormat.js +33 -98
  118. package/dist/resource/formats/gltf/CjsGltfFormat.js.map +1 -1
  119. package/dist/resource/formats/gltf/core/helpers.js +3 -12
  120. package/dist/resource/formats/gltf/core/helpers.js.map +1 -1
  121. package/dist/resource/formats/gr2/CjsGr2Format.js +27 -91
  122. package/dist/resource/formats/gr2/CjsGr2Format.js.map +1 -1
  123. package/dist/resource/formats/hlsl/CjsHlslFormat.js +22 -25
  124. package/dist/resource/formats/hlsl/CjsHlslFormat.js.map +1 -1
  125. package/dist/resource/formats/hlsl/core/carbonDescriptionToRuntime.js +1 -1
  126. package/dist/resource/formats/hlsl/core/carbonDescriptionToRuntime.js.map +1 -1
  127. package/dist/resource/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js +3 -3
  128. package/dist/resource/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js.map +1 -1
  129. package/dist/resource/formats/ies/CjsIESFormat.js +29 -29
  130. package/dist/resource/formats/ies/CjsIESFormat.js.map +1 -1
  131. package/dist/resource/formats/jpeg/CjsJpegFormat.js +24 -15
  132. package/dist/resource/formats/jpeg/CjsJpegFormat.js.map +1 -1
  133. package/dist/resource/formats/jpeg/core/helpers.js +3 -5
  134. package/dist/resource/formats/jpeg/core/helpers.js.map +1 -1
  135. package/dist/resource/formats/jpeg/core/jpeg.js +58 -58
  136. package/dist/resource/formats/jpeg/core/jpeg.js.map +1 -1
  137. package/dist/resource/formats/jsonl/CjsJsonlFormat.js +3 -3
  138. package/dist/resource/formats/jsonl/CjsJsonlFormat.js.map +1 -1
  139. package/dist/resource/formats/mp3/CjsMp3Format.js +7 -14
  140. package/dist/resource/formats/mp3/CjsMp3Format.js.map +1 -1
  141. package/dist/resource/formats/mp3/core/helpers.js +3 -5
  142. package/dist/resource/formats/mp3/core/helpers.js.map +1 -1
  143. package/dist/resource/formats/mp4/CjsMp4Format.js +7 -13
  144. package/dist/resource/formats/mp4/CjsMp4Format.js.map +1 -1
  145. package/dist/resource/formats/mp4/core/helpers.js +3 -5
  146. package/dist/resource/formats/mp4/core/helpers.js.map +1 -1
  147. package/dist/resource/formats/obj/CjsObjFormat.js +92 -157
  148. package/dist/resource/formats/obj/CjsObjFormat.js.map +1 -1
  149. package/dist/resource/formats/obj/core/helpers.js +5 -113
  150. package/dist/resource/formats/obj/core/helpers.js.map +1 -1
  151. package/dist/resource/formats/ogg/CjsOggFormat.js +7 -14
  152. package/dist/resource/formats/ogg/CjsOggFormat.js.map +1 -1
  153. package/dist/resource/formats/pickle/CjsPickleFormat.js +7 -12
  154. package/dist/resource/formats/pickle/CjsPickleFormat.js.map +1 -1
  155. package/dist/resource/formats/pickle/core/CjsPickleProtocol0Reader.js +7 -7
  156. package/dist/resource/formats/pickle/core/CjsPickleProtocol0Reader.js.map +1 -1
  157. package/dist/resource/formats/pickle/core/CjsPickleProtocol4Reader.js +7 -7
  158. package/dist/resource/formats/pickle/core/CjsPickleProtocol4Reader.js.map +1 -1
  159. package/dist/resource/formats/png/CjsPngFormat.js +40 -15
  160. package/dist/resource/formats/png/CjsPngFormat.js.map +1 -1
  161. package/dist/resource/formats/png/core/helpers.js +4 -6
  162. package/dist/resource/formats/png/core/helpers.js.map +1 -1
  163. package/dist/resource/formats/red/CjsRedFormat.js +22 -28
  164. package/dist/resource/formats/red/CjsRedFormat.js.map +1 -1
  165. package/dist/resource/formats/schemabound/CjsSchemaBoundFormat.js +3 -7
  166. package/dist/resource/formats/schemabound/CjsSchemaBoundFormat.js.map +1 -1
  167. package/dist/resource/formats/schemabound/core/schemaBoundValues.js +5 -0
  168. package/dist/resource/formats/schemabound/core/schemaBoundValues.js.map +1 -1
  169. package/dist/resource/formats/sqlite/CjsSqliteFormat.js +4 -9
  170. package/dist/resource/formats/sqlite/CjsSqliteFormat.js.map +1 -1
  171. package/dist/resource/formats/static/CjsStaticFormat.js +4 -4
  172. package/dist/resource/formats/static/CjsStaticFormat.js.map +1 -1
  173. package/dist/resource/formats/stl/CjsStlFormat.js +39 -104
  174. package/dist/resource/formats/stl/CjsStlFormat.js.map +1 -1
  175. package/dist/resource/formats/stl/core/helpers.js +5 -19
  176. package/dist/resource/formats/stl/core/helpers.js.map +1 -1
  177. package/dist/resource/formats/tga/CjsTgaFormat.js +26 -15
  178. package/dist/resource/formats/tga/CjsTgaFormat.js.map +1 -1
  179. package/dist/resource/formats/tga/core/helpers.js +3 -5
  180. package/dist/resource/formats/tga/core/helpers.js.map +1 -1
  181. package/dist/resource/formats/vta/CjsVtaFormat.js +8 -15
  182. package/dist/resource/formats/vta/CjsVtaFormat.js.map +1 -1
  183. package/dist/resource/formats/wav/CjsWavFormat.js +7 -14
  184. package/dist/resource/formats/wav/CjsWavFormat.js.map +1 -1
  185. package/dist/resource/formats/wav/core/helpers.js +3 -5
  186. package/dist/resource/formats/wav/core/helpers.js.map +1 -1
  187. package/dist/resource/formats/webgl/CjsWebglFormat.js +103 -105
  188. package/dist/resource/formats/webgl/CjsWebglFormat.js.map +1 -1
  189. package/dist/resource/formats/webgl/core/{errors.js → WebglReadError.js} +1 -1
  190. package/dist/resource/formats/webgl/core/WebglReadError.js.map +1 -0
  191. package/dist/resource/formats/webgl/core/effectPackage.js +1 -1
  192. package/dist/resource/formats/webgl/core/effectPackage.js.map +1 -1
  193. package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js +3 -3
  194. package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
  195. package/dist/resource/formats/webgl/core/glsl/{DxbcGlslHelpers.js → DxbcGlslHelperRegistry.js} +2 -2
  196. package/dist/resource/formats/webgl/core/glsl/DxbcGlslHelperRegistry.js.map +1 -0
  197. package/dist/resource/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js +1 -1
  198. package/dist/resource/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js.map +1 -1
  199. package/dist/resource/formats/webgl/core/glslBackendBlock.js +1 -1
  200. package/dist/resource/formats/webgl/core/glslBackendBlock.js.map +1 -1
  201. package/dist/resource/formats/webgl/core/helpers.js.map +1 -1
  202. package/dist/resource/formats/webgpu/CjsWebgpuFormat.js +28 -29
  203. package/dist/resource/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
  204. package/dist/resource/formats/webgpu/core/{errors.js → WebgpuReadError.js} +1 -1
  205. package/dist/resource/formats/webgpu/core/WebgpuReadError.js.map +1 -0
  206. package/dist/resource/formats/webgpu/core/carbonWebgpu/validateContainer.js +1 -1
  207. package/dist/resource/formats/webgpu/core/carbonWebgpu/validateContainer.js.map +1 -1
  208. package/dist/resource/formats/webgpu/core/helpers.js +1 -1
  209. package/dist/resource/formats/webgpu/core/helpers.js.map +1 -1
  210. package/dist/resource/formats/webgpu/core/ir/lowerDxbcToIr.js +1 -1
  211. package/dist/resource/formats/webgpu/core/ir/lowerDxbcToIr.js.map +1 -1
  212. package/dist/resource/formats/webgpu/core/wgsl/buildWgslSet.js +18 -6
  213. package/dist/resource/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -1
  214. package/dist/resource/formats/webgpu/core/wgsl/lowerBindingLayout.js +39 -13
  215. package/dist/resource/formats/webgpu/core/wgsl/lowerBindingLayout.js.map +1 -1
  216. package/dist/resource/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js +16 -14
  217. package/dist/resource/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js.map +1 -1
  218. package/dist/resource/formats/webm/CjsWebmFormat.js +8 -13
  219. package/dist/resource/formats/webm/CjsWebmFormat.js.map +1 -1
  220. package/dist/resource/formats/webm/core/helpers.js +3 -5
  221. package/dist/resource/formats/webm/core/helpers.js.map +1 -1
  222. package/dist/resource/formats/webp/CjsWebpFormat.js +8 -12
  223. package/dist/resource/formats/webp/CjsWebpFormat.js.map +1 -1
  224. package/dist/resource/formats/wem/CjsWemFormat.js +9 -17
  225. package/dist/resource/formats/wem/CjsWemFormat.js.map +1 -1
  226. package/dist/resource/formats/wem/core/bitStream.js +35 -35
  227. package/dist/resource/formats/wem/core/bitStream.js.map +1 -1
  228. package/dist/resource/formats/wem/core/helpers.js +1 -3
  229. package/dist/resource/formats/wem/core/helpers.js.map +1 -1
  230. package/dist/resource/formats/yaml/CjsYamlFormat.js +28 -37
  231. package/dist/resource/formats/yaml/CjsYamlFormat.js.map +1 -1
  232. package/dist/resource/imageio/ImageIO.js +142 -0
  233. package/dist/resource/imageio/ImageIO.js.map +1 -0
  234. package/dist/resource/imageio/index.js +17 -0
  235. package/dist/resource/imageio/index.js.map +1 -0
  236. package/dist/resource/index.js +7 -0
  237. package/dist/resource/index.js.map +1 -1
  238. package/dist/resource/shader/reflection/Tr2EffectResource.js +24 -2
  239. package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
  240. package/dist/resource/shader/reflection/Tr2Pass.js +76 -5
  241. package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
  242. package/dist/resource/texture/CjsTextureArrayConstructor.js +97 -0
  243. package/dist/resource/texture/CjsTextureArrayConstructor.js.map +1 -0
  244. package/dist/resource/texture/CjsTexturePackConstructor.js +160 -0
  245. package/dist/resource/texture/CjsTexturePackConstructor.js.map +1 -0
  246. package/dist/resource/texture/CjsTexturePipelineStepArray.js +72 -0
  247. package/dist/resource/texture/CjsTexturePipelineStepArray.js.map +1 -0
  248. package/dist/resource/texture/CjsTexturePipelineStepConvert.js +73 -0
  249. package/dist/resource/texture/CjsTexturePipelineStepConvert.js.map +1 -0
  250. package/dist/resource/texture/CjsTexturePipelineStepPack.js +71 -0
  251. package/dist/resource/texture/CjsTexturePipelineStepPack.js.map +1 -0
  252. package/dist/resource/texture/CjsTexturePipelineStepResize.js +123 -0
  253. package/dist/resource/texture/CjsTexturePipelineStepResize.js.map +1 -0
  254. package/dist/resource/texture/SolidColorTextureConstructor.js +11 -1
  255. package/dist/resource/texture/SolidColorTextureConstructor.js.map +1 -1
  256. package/dist/resource/texture/Tr2ImageRes.js +100 -68
  257. package/dist/resource/texture/Tr2ImageRes.js.map +1 -1
  258. package/dist/resource/texture/Tr2TexturePipeline.js +45 -25
  259. package/dist/resource/texture/Tr2TexturePipeline.js.map +1 -1
  260. package/dist/resource/texture/Tr2TexturePipelineStepCompress.js +34 -1
  261. package/dist/resource/texture/Tr2TexturePipelineStepCompress.js.map +1 -1
  262. package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js +30 -3
  263. package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js.map +1 -1
  264. package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js +81 -1
  265. package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js.map +1 -1
  266. package/dist/resource/texture/Tr2TexturePipelineStepLoad.js +36 -1
  267. package/dist/resource/texture/Tr2TexturePipelineStepLoad.js.map +1 -1
  268. package/dist/resource/texture/Tr2TexturePipelineStepPack.js +146 -24
  269. package/dist/resource/texture/Tr2TexturePipelineStepPack.js.map +1 -1
  270. package/dist/resource/texture/TriTextureRes.js +151 -29
  271. package/dist/resource/texture/TriTextureRes.js.map +1 -1
  272. package/dist/resource/texture/index.js +7 -0
  273. package/dist/resource/texture/index.js.map +1 -1
  274. package/dist/resource/texture/registerTextureResources.js +83 -0
  275. package/dist/resource/texture/registerTextureResources.js.map +1 -0
  276. package/dist/resource/texture/solidColorTexture.js +10 -19
  277. package/dist/resource/texture/solidColorTexture.js.map +1 -1
  278. package/dist/sof/EveSOF.js +39 -7
  279. package/dist/sof/EveSOF.js.map +1 -1
  280. package/dist/trinity/core/Tr2GpuResourcePool/Tr2GpuResourcePool.js +2 -2
  281. package/dist/trinity/core/Tr2GpuResourcePool/Tr2GpuResourcePool.js.map +1 -1
  282. package/dist/trinity/core/Tr2ImageIOHelpers.js +80 -17
  283. package/dist/trinity/core/Tr2ImageIOHelpers.js.map +1 -1
  284. package/dist/trinity/core/Tr2RenderUtils.js +1 -1
  285. package/dist/trinity/core/Tr2TextureArray/Tr2TextureArray.js +49 -62
  286. package/dist/trinity/core/Tr2TextureArray/Tr2TextureArray.js.map +1 -1
  287. package/dist/trinity/core/Tr2TextureReference.js +114 -0
  288. package/dist/trinity/core/Tr2TextureReference.js.map +1 -0
  289. package/dist/trinity/core/device/Tr2DepthStencil.js +2 -2
  290. package/dist/trinity/core/device/Tr2DepthStencil.js.map +1 -1
  291. package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBuffer.js +1 -1
  292. package/dist/trinity/core/index.js +1 -0
  293. package/dist/trinity/core/index.js.map +1 -1
  294. package/dist/trinity/core/lighting/Tr2LightManager.js +5 -4
  295. package/dist/trinity/core/lighting/Tr2LightManager.js.map +1 -1
  296. package/dist/trinity/core/procedural/GradientTextureConstructor.js +5 -4
  297. package/dist/trinity/core/procedural/GradientTextureConstructor.js.map +1 -1
  298. package/dist/trinity/core/procedural/gradientTexture.js +10 -13
  299. package/dist/trinity/core/procedural/gradientTexture.js.map +1 -1
  300. package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js +1 -1
  301. package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js.map +1 -1
  302. package/dist/trinity/eve/EveImpactOverlay.js +102 -50
  303. package/dist/trinity/eve/EveImpactOverlay.js.map +1 -1
  304. package/dist/trinity/eve/EveModularObjectModifier.js +9 -18
  305. package/dist/trinity/eve/EveModularObjectModifier.js.map +1 -1
  306. package/dist/trinity/eve/attachment/turrets/EveTurretSet.js +175 -157
  307. package/dist/trinity/eve/attachment/turrets/EveTurretSet.js.map +1 -1
  308. package/dist/trinity/eve/attachment/turrets/EveTurretTarget.js +100 -83
  309. package/dist/trinity/eve/attachment/turrets/EveTurretTarget.js.map +1 -1
  310. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js +26 -20
  311. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js.map +1 -1
  312. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshes.js +368 -179
  313. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshes.js.map +1 -1
  314. package/dist/trinity/eve/child/EveChildMesh.js +242 -234
  315. package/dist/trinity/eve/child/EveChildMesh.js.map +1 -1
  316. package/dist/trinity/eve/child/EveChildTurret.js +57 -16
  317. package/dist/trinity/eve/child/EveChildTurret.js.map +1 -1
  318. package/dist/trinity/eve/child/EveSpaceObjectChild.js +28 -1
  319. package/dist/trinity/eve/child/EveSpaceObjectChild.js.map +1 -1
  320. package/dist/trinity/eve/index.js +2 -2
  321. package/dist/trinity/eve/overlays/EveDamageOverlay.js +5 -1
  322. package/dist/trinity/eve/overlays/EveDamageOverlay.js.map +1 -1
  323. package/dist/trinity/eve/scene/EveSpaceScene.js +234 -233
  324. package/dist/trinity/eve/scene/EveSpaceScene.js.map +1 -1
  325. package/dist/trinity/eve/scene/EveSpaceSceneRenderDriver.js +2 -0
  326. package/dist/trinity/eve/scene/EveSpaceSceneRenderDriver.js.map +1 -1
  327. package/dist/trinity/eve/spaceObject/EveSpaceObject2.js +492 -437
  328. package/dist/trinity/eve/spaceObject/EveSpaceObject2.js.map +1 -1
  329. package/dist/trinity/generated/index.js +0 -1
  330. package/dist/trinity/generated/index.js.map +1 -1
  331. package/dist/trinity/generated/trinityCore/index.js +0 -1
  332. package/dist/trinity/generated/trinityCore/index.js.map +1 -1
  333. package/dist/trinity/index.js +3 -3
  334. package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js +10 -1
  335. package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js.map +1 -1
  336. package/dist/trinity/shader/Tr2DataTextureManager.js +152 -66
  337. package/dist/trinity/shader/Tr2DataTextureManager.js.map +1 -1
  338. package/dist/trinity/shader/Tr2Material.js +1 -1
  339. package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureSubresource.js +5 -5
  340. package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureSubresource.js.map +1 -1
  341. package/dist/trinityal/index.js +1 -1
  342. package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2RenderContextALStub.js +2 -2
  343. package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2RenderContextALStub.js.map +1 -1
  344. package/dist/trinityal/stub/Tr2SwapChainALStub.js +45 -45
  345. package/dist/trinityal/stub/Tr2SwapChainALStub.js.map +1 -1
  346. package/dist/trinityal/stub/Tr2TextureALStub.js +170 -170
  347. package/dist/trinityal/stub/Tr2TextureALStub.js.map +1 -1
  348. package/dist/trinityal/webgpu/CjsWebgpuDevice.js +234 -164
  349. package/dist/trinityal/webgpu/CjsWebgpuDevice.js.map +1 -1
  350. package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js +7 -0
  351. package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js.map +1 -1
  352. package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js +78 -14
  353. package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js.map +1 -1
  354. package/dist/trinityal/webgpu/core/CjsWebgpuUtils.js +94 -0
  355. package/dist/trinityal/webgpu/core/CjsWebgpuUtils.js.map +1 -0
  356. package/dist/trinityal/webgpu/internal.js +1 -0
  357. package/dist/trinityal/webgpu/internal.js.map +1 -1
  358. package/docs/global/reference/classes/README.md +90 -0
  359. package/docs/resource/concepts/format-capabilities.md +3 -3
  360. package/docs/resource/formats/README.md +1 -1
  361. package/docs/resource/reference/classes/core.md +31 -1
  362. package/docs/resource/reference/classes/formats.md +7 -7
  363. package/docs/resource/reference/classes/resources.md +76 -16
  364. package/docs/trinity/reference/classes/generated.md +0 -10
  365. package/docs/trinity/reference/classes/trinity-core.md +1692 -1682
  366. package/docs/trinityal/reference/classes/README.md +0 -10
  367. package/docs/trinityal/webgpu/reference/classes/README.md +276 -266
  368. package/package.json +4 -3
  369. package/dist/global/consts/webgpu/index.js +0 -2
  370. package/dist/global/consts/webgpu/textureFormats.js +0 -180
  371. package/dist/global/consts/webgpu/textureFormats.js.map +0 -1
  372. package/dist/resource/formats/dxbc/core/container.js.map +0 -1
  373. package/dist/resource/formats/dxbc/core/errors.js.map +0 -1
  374. package/dist/resource/formats/dxbc/core/program.js.map +0 -1
  375. package/dist/resource/formats/dxbc/core/signature.js.map +0 -1
  376. package/dist/resource/formats/stl/core/targets.js.map +0 -1
  377. package/dist/resource/formats/webgl/core/errors.js.map +0 -1
  378. package/dist/resource/formats/webgl/core/glsl/DxbcGlslHelpers.js.map +0 -1
  379. package/dist/resource/formats/webgpu/core/errors.js.map +0 -1
  380. package/dist/resource/texture/texturePipelineBehavior.js +0 -332
  381. package/dist/resource/texture/texturePipelineBehavior.js.map +0 -1
  382. package/dist/trinity/generated/trinityCore/Tr2TextureReference.js +0 -40
  383. package/dist/trinity/generated/trinityCore/Tr2TextureReference.js.map +0 -1
  384. package/dist/trinityal/Tr2BitmapDimensions.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sources":["../../../../../../src/resource/formats/dxbc/core/helpers.js"],"sourcesContent":["import { toJsonWithCollections as toJsonValue } from \"../../../format/jsonPolicies.js\";\nimport { asUint8Array } from \"#utils/bytes\";\n\n/**\n * Internal read-pipeline glue for CjsDxbcFormat.\n *\n * Keeps the public class file small: input normalization, option\n * normalization, the shared read path used by both the instance and the\n * static one-shots, and JSON conversion live here.\n */\n\nimport { DxbcContainer } from \"./container.js\";\nimport { DxbcSignatureChunk } from \"./signature.js\";\nimport { DxbcShaderProgram } from \"./program.js\";\nimport { DxbcInstructionDecoder } from \"./decoder.js\";\nimport { DxbcReadError } from \"./errors.js\";\n\nexport const OUTPUT_JSON = \"json\";\nexport const OUTPUT_RAW = \"raw\";\n\nexport const DEFAULT_VALUES = Object.freeze({\n emit: OUTPUT_JSON,\n source: \"memory\",\n decodeInstructions: true\n});\n\nconst VALID_EMITS = new Set([ OUTPUT_JSON, OUTPUT_RAW ]);\n\nconst INPUT_SIGNATURE_TAGS = [ \"ISGN\", \"ISG1\" ];\nconst OUTPUT_SIGNATURE_TAGS = [ \"OSGN\", \"OSG1\", \"OSG5\" ];\nconst PATCH_SIGNATURE_TAGS = [ \"PCSG\", \"PSG1\" ];\n\n/**\n * Merge format values over a base set and validate them.\n *\n * @param {object} base Current values.\n * @param {object} [options] Values to merge in.\n * @param {string} [readerName] Reader name used in error messages.\n * @returns {object} A validated copy of the merged values.\n */\nexport function normalizeValues(base, options = {}, readerName = \"CjsDxbcFormat\")\n{\n const values = { ...base, ...options };\n\n if (!VALID_EMITS.has(values.emit))\n {\n throw new TypeError(`${readerName}: emit must be \"${OUTPUT_JSON}\" or \"${OUTPUT_RAW}\", got ${JSON.stringify(values.emit)}`);\n }\n if (typeof values.source !== \"string\" || !values.source)\n {\n values.source = DEFAULT_VALUES.source;\n }\n values.decodeInstructions = !!values.decodeInstructions;\n\n return {\n emit: values.emit,\n source: values.source,\n decodeInstructions: values.decodeInstructions\n };\n}\n\n/**\n * Normalize caller input into a Uint8Array of DXBC bytes.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate payload.\n * @returns {Uint8Array} The payload bytes.\n */\n/**\n * Read a signature chunk group from a container if present.\n *\n * @param {DxbcContainer} container Parsed container.\n * @param {string[]} tags Chunk fourCC candidates in priority order.\n * @param {string} source Source name for errors.\n * @returns {?DxbcSignatureChunk} Parsed signature or null.\n */\nfunction readSignature(container, tags, source)\n{\n for (const tag of tags)\n {\n const chunk = container.getChunk(tag);\n if (chunk) return new DxbcSignatureChunk().Read(chunk, { source });\n }\n return null;\n}\n\n/**\n * The shared read path used by the instance Read and the static read.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input DXBC payload.\n * @param {object} values Normalized format values.\n * @returns {object} Raw read result (class instances).\n */\nexport function readRaw(input, values)\n{\n const bytes = asUint8Array(input, \"CjsDxbcFormat input\");\n const source = values.source;\n const container = new DxbcContainer().Read(bytes, { source });\n const shex = container.getChunk(\"SHEX\") || container.getChunk(\"SHDR\");\n\n const result = {\n source,\n container,\n program: null,\n decoder: null,\n inputSignature: readSignature(container, INPUT_SIGNATURE_TAGS, source),\n outputSignature: readSignature(container, OUTPUT_SIGNATURE_TAGS, source),\n patchSignature: readSignature(container, PATCH_SIGNATURE_TAGS, source)\n };\n\n if (shex)\n {\n result.program = new DxbcShaderProgram().Read(shex, { source });\n if (values.decodeInstructions)\n {\n result.decoder = new DxbcInstructionDecoder().Decode(result.program, { source });\n }\n }\n\n return result;\n}\n\n/**\n * Convert a raw read result to plain JSON-compatible data.\n *\n * @param {object} raw Raw read result from readRaw.\n * @returns {object} Plain data.\n */\nexport function rawToJson(raw)\n{\n return toJsonValue({\n source: raw.source,\n container: raw.container.toJSON(),\n program: raw.program\n ? {\n fourCC: raw.program.fourCC,\n programType: raw.program.programType,\n programTypeName: raw.program.programTypeName,\n majorVersion: raw.program.majorVersion,\n minorVersion: raw.program.minorVersion,\n lengthDwords: raw.program.lengthDwords\n }\n : null,\n inputSignature: raw.inputSignature ? raw.inputSignature.elements : null,\n outputSignature: raw.outputSignature ? raw.outputSignature.elements : null,\n patchSignature: raw.patchSignature ? raw.patchSignature.elements : null,\n instructions: raw.decoder ? raw.decoder.instructions : null\n });\n}\n\n/**\n * Shared read entry honouring the emit mode.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input DXBC payload.\n * @param {object} values Normalized format values.\n * @returns {object} Raw result or plain JSON data per values.emit.\n */\nexport function readWithValues(input, values)\n{\n const raw = readRaw(input, values);\n return values.emit === OUTPUT_RAW ? raw : rawToJson(raw);\n}\n\n/**\n * Cheap inspection: container/program facts without instruction decode.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input DXBC payload.\n * @param {object} values Normalized format values.\n * @returns {object} Plain summary data.\n */\nexport function inspectWithValues(input, values)\n{\n const raw = readRaw(input, { ...values, decodeInstructions: false });\n return toJsonValue({\n source: raw.source,\n isDxbc: true,\n version: raw.container.version,\n totalSize: raw.container.totalSize,\n chunks: raw.container.chunks.map(({ fourCC, offset, size }) => ({ fourCC, offset, size })),\n programTypeName: raw.program ? raw.program.programTypeName : null,\n shaderModel: raw.program ? `${raw.program.majorVersion}.${raw.program.minorVersion}` : null,\n inputElementCount: raw.inputSignature ? raw.inputSignature.elements.length : 0,\n outputElementCount: raw.outputSignature ? raw.outputSignature.elements.length : 0\n });\n}\n\n/**\n * Deep-convert a value to plain JSON-compatible data. Typed arrays become\n * plain number arrays; Maps/Sets become objects/arrays; class instances\n * with toJSON are honoured.\n *\n * @param {any} value Value to convert.\n * @returns {any} Plain data.\n */\n/** The shared JSON policy for this reader, under the name its callers use. */\nexport { toJsonValue };\n\nexport { DxbcReadError };\n\n"],"names":["OUTPUT_JSON","OUTPUT_RAW","DEFAULT_VALUES","Object","freeze","emit","source","decodeInstructions","VALID_EMITS","Set","INPUT_SIGNATURE_TAGS","OUTPUT_SIGNATURE_TAGS","PATCH_SIGNATURE_TAGS","normalizeValues","base","options","readerName","values","has","TypeError","JSON","stringify","readSignature","container","tags","tag","chunk","getChunk","DxbcSignatureChunk","Read","readRaw","input","bytes","asUint8Array","DxbcContainer","shex","result","program","decoder","inputSignature","outputSignature","patchSignature","DxbcShaderProgram","DxbcInstructionDecoder","Decode","rawToJson","raw","toJsonValue","toJSON","fourCC","programType","programTypeName","majorVersion","minorVersion","lengthDwords","elements","instructions","readWithValues","inspectWithValues","isDxbc","version","totalSize","chunks","map","offset","size","shaderModel","inputElementCount","length","outputElementCount"],"mappings":";;;;;;;AAiBO,MAAMA,WAAW,GAAG;AACpB,MAAMC,UAAU,GAAG;MAEbC,cAAc,GAAGC,MAAM,CAACC,MAAM,CAAC;AACxCC,EAAAA,IAAI,EAAEL,WAAW;AACjBM,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,kBAAkB,EAAE;AACxB,CAAC;AAED,MAAMC,WAAW,GAAG,IAAIC,GAAG,CAAC,CAAET,WAAW,EAAEC,UAAU,CAAE,CAAC;AAExD,MAAMS,oBAAoB,GAAG,CAAE,MAAM,EAAE,MAAM,CAAE;AAC/C,MAAMC,qBAAqB,GAAG,CAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAE;AACxD,MAAMC,oBAAoB,GAAG,CAAE,MAAM,EAAE,MAAM,CAAE;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,eAAeA,CAACC,IAAI,EAAEC,OAAO,GAAG,EAAE,EAAEC,UAAU,GAAG,eAAe,EAChF;AACI,EAAA,MAAMC,MAAM,GAAG;AAAE,IAAA,GAAGH,IAAI;IAAE,GAAGC;GAAS;EAEtC,IAAI,CAACP,WAAW,CAACU,GAAG,CAAC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AAEwC,GAAG,CAACxC,MAAM;AAClBqD,IAAAA,MAAM,EAAE,IAAI;AACZC,IAAAA,OAAO,EAAEd,GAAG,CAACvB,SAAS,CAACqC,OAAO;AAC9BC,IAAAA,SAAS,EAAEf,GAAG,CAACvB,SAAS,CAACsC,SAAS;IAClCC,MAAM,EAAEhB,GAAG,CAACvB,SAAS,CAACuC,MAAM,CAACC,GAAG,CAAC,CAAC;MAAEd,MAAM;MAAEe,MAAM;AAAEC,MAAAA;AAAK,KAAC,MAAM;MAAEhB,MAAM;MAAEe,MAAM;AAAEC,MAAAA;AAAK,KAAC,CAAC,CAAC;IAC1Fd,eAAe,EAAEL,GAAG,CAACT,OAAO,GAAGS,GAAG,CAACT,OAAO,CAACc,eAAe,GAAG,IAAI;AACjEe,IAAAA,WAAW,EAAEpB,GAAG,CAACT,OAAO,GAAG,CAAA,EAAGS,GAAG,CAACT,OAAO,CAACe,YAAY,CAAA,CAAA,EAAIN,GAAG,CAACT,OAAO,CAACgB,YAAY,CAAA,CAAE,GAAG,IAAI;AAC3Fc,IAAAA,iBAAiB,EAAErB,GAAG,CAACP,cAAc,GAAGO,GAAG,CAACP,cAAc,CAACgB,QAAQ,CAACa,MAAM,GAAG,CAAC;AAC9EC,IAAAA,kBAAkB,EAAEvB,GAAG,CAACN,eAAe,GAAGM,GAAG,CAACN,eAAe,CAACe,QAAQ,CAACa,MAAM,GAAG;AACpF,GAAC,CAAC;AACN;;;;"}
1
+ {"version":3,"file":"helpers.js","sources":["../../../../../../src/resource/formats/dxbc/core/helpers.js"],"sourcesContent":["import { toJsonWithCollections as toJsonValue } from \"../../../format/jsonPolicies.js\";\nimport { asUint8Array } from \"#utils/bytes\";\n\n/**\n * Internal read-pipeline glue for CjsDxbcFormat.\n *\n * Keeps the public class file small: input normalization, option\n * normalization, the shared read path used by both the instance and the\n * static one-shots, and JSON conversion live here.\n */\n\nimport { DxbcContainer } from \"./DxbcContainer.js\";\nimport { DxbcSignatureChunk } from \"./DxbcSignatureChunk.js\";\nimport { DxbcShaderProgram } from \"./DxbcShaderProgram.js\";\nimport { DxbcInstructionDecoder } from \"./decoder.js\";\nimport { DxbcReadError } from \"./DxbcReadError.js\";\n\nexport const OUTPUT_JSON = \"json\";\nexport const OUTPUT_RAW = \"raw\";\n\nexport const DEFAULT_VALUES = Object.freeze({\n emit: OUTPUT_JSON,\n source: \"memory\",\n decodeInstructions: true\n});\n\nconst VALID_EMITS = new Set([ OUTPUT_JSON, OUTPUT_RAW ]);\n\nconst INPUT_SIGNATURE_TAGS = [ \"ISGN\", \"ISG1\" ];\nconst OUTPUT_SIGNATURE_TAGS = [ \"OSGN\", \"OSG1\", \"OSG5\" ];\nconst PATCH_SIGNATURE_TAGS = [ \"PCSG\", \"PSG1\" ];\n\n/**\n * Merge format values over a base set and validate them.\n *\n * @param {object} base Current values.\n * @param {object} [options] Values to merge in.\n * @param {string} [readerName] Reader name used in error messages.\n * @returns {object} A validated copy of the merged values.\n */\nexport function normalizeValues(base, options = {}, readerName = \"CjsDxbcFormat\")\n{\n const values = { ...base, ...options };\n\n if (!VALID_EMITS.has(values.emit))\n {\n throw new TypeError(`${readerName}: emit must be \"${OUTPUT_JSON}\" or \"${OUTPUT_RAW}\", got ${JSON.stringify(values.emit)}`);\n }\n if (typeof values.source !== \"string\" || !values.source)\n {\n values.source = DEFAULT_VALUES.source;\n }\n values.decodeInstructions = !!values.decodeInstructions;\n\n return {\n emit: values.emit,\n source: values.source,\n decodeInstructions: values.decodeInstructions\n };\n}\n\n/**\n * Normalize caller input into a Uint8Array of DXBC bytes.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate payload.\n * @returns {Uint8Array} The payload bytes.\n */\n/**\n * Read a signature chunk group from a container if present.\n *\n * @param {DxbcContainer} container Parsed container.\n * @param {string[]} tags Chunk fourCC candidates in priority order.\n * @param {string} source Source name for errors.\n * @returns {?DxbcSignatureChunk} Parsed signature or null.\n */\nfunction readSignature(container, tags, source)\n{\n for (const tag of tags)\n {\n const chunk = container.getChunk(tag);\n if (chunk) return new DxbcSignatureChunk().Read(chunk, { source });\n }\n return null;\n}\n\n/**\n * The shared read path used by the instance Read and the static read.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input DXBC payload.\n * @param {object} values Normalized format values.\n * @returns {object} Raw read result (class instances).\n */\nexport function readRaw(input, values)\n{\n const bytes = asUint8Array(input, \"CjsDxbcFormat input\");\n const source = values.source;\n const container = new DxbcContainer().Read(bytes, { source });\n const shex = container.getChunk(\"SHEX\") || container.getChunk(\"SHDR\");\n\n const result = {\n source,\n container,\n program: null,\n decoder: null,\n inputSignature: readSignature(container, INPUT_SIGNATURE_TAGS, source),\n outputSignature: readSignature(container, OUTPUT_SIGNATURE_TAGS, source),\n patchSignature: readSignature(container, PATCH_SIGNATURE_TAGS, source)\n };\n\n if (shex)\n {\n result.program = new DxbcShaderProgram().Read(shex, { source });\n if (values.decodeInstructions)\n {\n result.decoder = new DxbcInstructionDecoder().Decode(result.program, { source });\n }\n }\n\n return result;\n}\n\n/**\n * Convert a raw read result to plain JSON-compatible data.\n *\n * @param {object} raw Raw read result from readRaw.\n * @returns {object} Plain data.\n */\nexport function rawToJson(raw)\n{\n return toJsonValue({\n source: raw.source,\n container: raw.container.toJSON(),\n program: raw.program\n ? {\n fourCC: raw.program.fourCC,\n programType: raw.program.programType,\n programTypeName: raw.program.programTypeName,\n majorVersion: raw.program.majorVersion,\n minorVersion: raw.program.minorVersion,\n lengthDwords: raw.program.lengthDwords\n }\n : null,\n inputSignature: raw.inputSignature ? raw.inputSignature.elements : null,\n outputSignature: raw.outputSignature ? raw.outputSignature.elements : null,\n patchSignature: raw.patchSignature ? raw.patchSignature.elements : null,\n instructions: raw.decoder ? raw.decoder.instructions : null\n });\n}\n\n/**\n * Shared read entry honouring the emit mode.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input DXBC payload.\n * @param {object} values Normalized format values.\n * @returns {object} Raw result or plain JSON data per values.emit.\n */\nexport function readWithValues(input, values)\n{\n const raw = readRaw(input, values);\n return values.emit === OUTPUT_RAW ? raw : rawToJson(raw);\n}\n\n/**\n * Cheap inspection: container/program facts without instruction decode.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input DXBC payload.\n * @param {object} values Normalized format values.\n * @returns {object} Plain summary data.\n */\nexport function inspectWithValues(input, values)\n{\n const raw = readRaw(input, { ...values, decodeInstructions: false });\n return toJsonValue({\n source: raw.source,\n isDxbc: true,\n version: raw.container.version,\n totalSize: raw.container.totalSize,\n chunks: raw.container.chunks.map(({ fourCC, offset, size }) => ({ fourCC, offset, size })),\n programTypeName: raw.program ? raw.program.programTypeName : null,\n shaderModel: raw.program ? `${raw.program.majorVersion}.${raw.program.minorVersion}` : null,\n inputElementCount: raw.inputSignature ? raw.inputSignature.elements.length : 0,\n outputElementCount: raw.outputSignature ? raw.outputSignature.elements.length : 0\n });\n}\n\n/**\n * Deep-convert a value to plain JSON-compatible data. Typed arrays become\n * plain number arrays; Maps/Sets become objects/arrays; class instances\n * with toJSON are honoured.\n *\n * @param {any} value Value to convert.\n * @returns {any} Plain data.\n */\n/** The shared JSON policy for this reader, under the name its callers use. */\nexport { toJsonValue };\n\nexport { DxbcReadError };\n\n"],"names":["OUTPUT_JSON","OUTPUT_RAW","DEFAULT_VALUES","Object","freeze","emit","source","decodeInstructions","VALID_EMITS","Set","INPUT_SIGNATURE_TAGS","OUTPUT_SIGNATURE_TAGS","PATCH_SIGNATURE_TAGS","normalizeValues","base","options","readerName","values","has","TypeError","JSON","stringify","readSignature","container","tags","tag","chunk","getChunk","DxbcSignatureChunk","Read","readRaw","input","bytes","asUint8Array","DxbcContainer","shex","result","program","decoder","inputSignature","outputSignature","patchSignature","DxbcShaderProgram","DxbcInstructionDecoder","Decode","rawToJson","raw","toJsonValue","toJSON","fourCC","programType","programTypeName","majorVersion","minorVersion","lengthDwords","elements","instructions","readWithValues","inspectWithValues","isDxbc","version","totalSize","chunks","map","offset","size","shaderModel","inputEl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AA,WAAW,EAAEpB,GAAG,CAACT,OAAO,GAAG,CAAA,EAAGS,GAAG,CAACT,OAAO,CAACe,YAAY,CAAA,CAAA,EAAIN,GAAG,CAACT,OAAO,CAACgB,YAAY,CAAA,CAAE,GAAG,IAAI;AAC3Fc,IAAAA,iBAAiB,EAAErB,GAAG,CAACP,cAAc,GAAGO,GAAG,CAACP,cAAc,CAACgB,QAAQ,CAACa,MAAM,GAAG,CAAC;AAC9EC,IAAAA,kBAAkB,EAAEvB,GAAG,CAACN,eAAe,GAAGM,GAAG,CAACN,eAAe,CAACe,QAAQ,CAACa,MAAM,GAAG;AACpF,GAAC,CAAC;AACN;;;;"}
@@ -1,6 +1,7 @@
1
1
  import { asUint8Array } from '#utils/bytes';
2
2
  import { CjsFormat } from '../../format/CjsFormat.js';
3
- import { DEFAULT_VALUES, normalizeValues, validateClassKey, validateClass, readWithValues, inspectWithValues, toJsonValue, probeSupportWithValues, isFBX, OUTPUT_FBX_JSON, OUTPUT_JSON, OUTPUT_RAW, OUTPUT_GR2, OUTPUT_CMF, CLASS_KEYS } from './core/helpers.js';
3
+ import { CjsGeometryFormat } from '../../format/CjsGeometryFormat.js';
4
+ import { DEFAULT_VALUES, normalizeValues, validateClassKey, validateClass, readWithValues, inspectWithValues, toJsonValue, probeSupportWithValues, isFBX, CLASS_KEYS } from './core/helpers.js';
4
5
  import { writeFbx, writeSharedFbx } from './core/writer.js';
5
6
 
6
7
  const FORMAT_NAME = "CjsFbxFormat";
@@ -12,8 +13,8 @@ const FORMAT_NAME = "CjsFbxFormat";
12
13
  * and exported from native CMF in pure JavaScript. Geometry, skeletons, skin,
13
14
  * morph targets, and their animations are in scope; cameras and lights are not.
14
15
  */
15
- class CjsFbxFormat extends CjsFormat {
16
- #values = DEFAULT_VALUES;
16
+ class CjsFbxFormat extends CjsGeometryFormat {
17
+ _values = DEFAULT_VALUES;
17
18
 
18
19
  /**
19
20
  * Create a reusable FBX format profile.
@@ -32,7 +33,7 @@ class CjsFbxFormat extends CjsFormat {
32
33
  * @returns {CjsFbxFormat} This format profile.
33
34
  */
34
35
  SetValues(options = {}) {
35
- this.#values = normalizeValues(this.#values, {
36
+ this._values = normalizeValues(this._values, {
36
37
  inputType: "fbx",
37
38
  ...options
38
39
  }, FORMAT_NAME);
@@ -46,7 +47,7 @@ class CjsFbxFormat extends CjsFormat {
46
47
  * @returns {object} Normalized read values.
47
48
  */
48
49
  GetValues(options = {}) {
49
- return normalizeValues(this.#values, {
50
+ return normalizeValues(this._values, {
50
51
  inputType: "fbx",
51
52
  ...options
52
53
  }, FORMAT_NAME);
@@ -79,11 +80,11 @@ class CjsFbxFormat extends CjsFormat {
79
80
  validateClassKey(type, FORMAT_NAME);
80
81
  if (Class === null || Class === undefined) {
81
82
  const classes = {
82
- ...this.#values.classes
83
+ ...this._values.classes
83
84
  };
84
85
  delete classes[type];
85
- this.#values = {
86
- ...this.#values,
86
+ this._values = {
87
+ ...this._values,
87
88
  classes
88
89
  };
89
90
  return this;
@@ -104,7 +105,7 @@ class CjsFbxFormat extends CjsFormat {
104
105
  */
105
106
  GetClass(type) {
106
107
  validateClassKey(type, FORMAT_NAME);
107
- return this.#values.classes[type];
108
+ return this._values.classes[type];
108
109
  }
109
110
 
110
111
  /**
@@ -260,16 +261,8 @@ class CjsFbxFormat extends CjsFormat {
260
261
  /**
261
262
  * Emit targets for this format (canonical frozen enum).
262
263
  */
263
- static Output = Object.freeze({
264
- CMF: OUTPUT_CMF,
265
- GR2: OUTPUT_GR2,
266
- RAW: OUTPUT_RAW,
267
- JSON: OUTPUT_JSON,
268
- FBX_JSON: OUTPUT_FBX_JSON
269
- });
270
- static CLASS_KEYS = CLASS_KEYS;
271
- static id = "fbx";
272
- static mediaTypes = Object.freeze(["geometry"]);
264
+ static classKeys = CLASS_KEYS;
265
+ static id = "CjsFbxFormat";
273
266
  // FBX is written THROUGH CMF: `write` takes a native CMF graph and
274
267
  // `writeShared` converts shared or GR2-shaped geometry into one first.
275
268
  static inputs = CjsFormat.defineInputs({
@@ -288,6 +281,11 @@ class CjsFbxFormat extends CjsFormat {
288
281
  cmf: {
289
282
  decoded: true
290
283
  },
284
+ json: {
285
+ role: "debug",
286
+ decoded: true,
287
+ probes: ["fbxJson", "document"]
288
+ },
291
289
  fbxJson: {
292
290
  role: "debug",
293
291
  decoded: true,
@@ -300,7 +298,7 @@ class CjsFbxFormat extends CjsFormat {
300
298
  probes: ["raw", "document"]
301
299
  }
302
300
  });
303
- static extensions = Object.freeze([".fbx"]);
301
+ static extensions = [".fbx"];
304
302
  }
305
303
 
306
304
  export { CjsFbxFormat, CjsFbxFormat as default };
@@ -1 +1 @@
1
- {"version":3,"file":"CjsFbxFormat.js","sources":["../../../../../src/resource/formats/fbx/CjsFbxFormat.js"],"sourcesContent":["import { asUint8Array } from \"#utils/bytes\";\nimport { CjsFormat } from \"../../format/CjsFormat.js\";\nimport {\n CLASS_KEYS,\n DEFAULT_VALUES,\n OUTPUT_CMF,\n OUTPUT_FBX_JSON,\n OUTPUT_GR2,\n OUTPUT_JSON,\n OUTPUT_RAW,\n inspectWithValues,\n isFBX,\n probeSupportWithValues,\n normalizeValues,\n readWithValues,\n toJsonValue,\n validateClass,\n validateClassKey\n} from \"./core/helpers.js\";\nimport { writeFbx, writeSharedFbx } from \"./core/writer.js\";\n\nconst FORMAT_NAME = \"CjsFbxFormat\";\n\n/**\n * CarbonEngineJS-facing FBX format surface.\n *\n * FBX is recognized, inspected, imported into CMF/GR2 compatibility graphs,\n * and exported from native CMF in pure JavaScript. Geometry, skeletons, skin,\n * morph targets, and their animations are in scope; cameras and lights are not.\n */\nexport class CjsFbxFormat extends CjsFormat\n{\n #values = DEFAULT_VALUES;\n\n /**\n * Create a reusable FBX format profile.\n *\n * @param {object} [options] Default read/inspect options.\n */\n constructor(options = {})\n {\n super();\n this.SetValues(options);\n }\n\n /**\n * Merge options into this profile.\n *\n * @param {object} [options] Values to merge.\n * @returns {CjsFbxFormat} This format profile.\n */\n SetValues(options = {})\n {\n this.#values = normalizeValues(this.#values, { inputType: \"fbx\", ...options }, FORMAT_NAME);\n return this;\n }\n\n /**\n * Get normalized profile values with optional per-call overrides.\n *\n * @param {object} [options] Per-call values.\n * @returns {object} Normalized read values.\n */\n GetValues(options = {})\n {\n return normalizeValues(this.#values, { inputType: \"fbx\", ...options }, FORMAT_NAME);\n }\n\n /**\n * Set multiple output node constructors for this profile.\n *\n * These constructors are used only for explicit runtime output targets such\n * as `emit: \"gr2\"` and `emit: \"cmf\"` paths. Debug `fbxJson` output\n * remains plain data.\n *\n * @param {object} [classes] Map of output node class keys to constructors.\n * @returns {CjsFbxFormat} This format profile.\n */\n SetClasses(classes = {})\n {\n return this.SetValues({ classes });\n }\n\n /**\n * Set one output node constructor for this profile.\n *\n * @param {string} type Output node class key.\n * @param {Function|null|undefined} Class Constructor to use, or nullish to delete.\n * @returns {CjsFbxFormat} This format profile.\n */\n SetClass(type, Class)\n {\n validateClassKey(type, FORMAT_NAME);\n\n if (Class === null || Class === undefined)\n {\n const classes = { ...this.#values.classes };\n delete classes[type];\n this.#values = { ...this.#values, classes };\n return this;\n }\n\n validateClass(type, Class, FORMAT_NAME);\n return this.SetValues({ classes: { [type]: Class } });\n }\n\n /**\n * Get a configured output node constructor.\n *\n * @param {string} type Output node class key.\n * @returns {Function|undefined} The registered constructor, if any.\n */\n GetClass(type)\n {\n validateClassKey(type, FORMAT_NAME);\n return this.#values.classes[type];\n }\n\n /**\n * Whether this profile has a constructor registered for an output node key.\n *\n * @param {string} type Output node class key.\n * @returns {boolean} True when a constructor is registered.\n */\n HasClass(type)\n {\n return !!this.GetClass(type);\n }\n\n /**\n * Read FBX bytes with this profile.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input FBX bytes.\n * @param {object} [options] Per-call values.\n * @returns {object} Raw or debug payload for the selected emit target.\n */\n Read(input, options = {})\n {\n return readWithValues(input, this.GetValues(options));\n }\n\n /** Write a native CMF graph as deterministic binary FBX 7400 bytes. */\n Write(input, options = {})\n {\n return writeFbx(input, options);\n }\n\n /** Convert shared or GR2-shaped geometry through CMF and write FBX. */\n WriteShared(input, options = {})\n {\n return writeSharedFbx(input, options);\n }\n\n /**\n * Read FBX bytes asynchronously with this profile.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input FBX bytes.\n * @param {object} [options] Per-call values.\n * @returns {Promise<object>} Raw or debug payload for the selected emit target.\n */\n async ReadAsync(input, options = {})\n {\n return this.Read(input, options);\n }\n\n /**\n * Inspect FBX bytes without converting geometry.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input FBX bytes.\n * @param {object} [options] Per-call values.\n * @returns {object} Lightweight FBX metadata.\n */\n Inspect(input, options = {})\n {\n return inspectWithValues(input, this.GetValues(options));\n }\n\n /**\n * Convert format output into JSON-compatible debug data.\n *\n * @param {any} value Format output.\n * @returns {any} JSON-compatible value.\n */\n ToJSON(value)\n {\n return toJsonValue(value);\n }\n\n /**\n * One-shot FBX read.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input FBX bytes.\n * @param {object} [options] Read options.\n * @returns {object} Raw or debug payload for the selected emit target.\n */\n static read(input, options = {})\n {\n return readWithValues(input, normalizeValues(DEFAULT_VALUES, { inputType: \"fbx\", ...options }, FORMAT_NAME));\n }\n\n /** Write a native CMF graph as deterministic binary FBX 7400 bytes. */\n static write(input, options = {})\n {\n return writeFbx(input, options);\n }\n\n /** Convert shared or GR2-shaped geometry through CMF and write FBX. */\n static writeShared(input, options = {})\n {\n return writeSharedFbx(input, options);\n }\n\n /**\n * One-shot asynchronous FBX read.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input FBX bytes.\n * @param {object} [options] Read options.\n * @returns {Promise<object>} Raw or debug payload for the selected emit target.\n */\n static async readAsync(input, options = {})\n {\n return CjsFbxFormat.read(input, options);\n }\n\n /**\n * One-shot FBX inspection.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input FBX bytes.\n * @param {object} [options] Inspect options.\n * @returns {object} Lightweight FBX metadata.\n */\n static inspect(input, options = {})\n {\n return inspectWithValues(input, normalizeValues(DEFAULT_VALUES, { inputType: \"fbx\", ...options }, FORMAT_NAME));\n }\n\n /**\n * One-shot FBX support probe.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input FBX bytes.\n * @param {object} [options] Probe options.\n * @returns {object} Support/probe report.\n */\n static probeSupport(input, options = {})\n {\n return probeSupportWithValues(input, normalizeValues(DEFAULT_VALUES, { inputType: \"fbx\", ...options }, FORMAT_NAME));\n }\n\n /**\n * Convert format output into JSON-compatible debug data.\n *\n * @param {any} value Format output.\n * @returns {any} JSON-compatible value.\n */\n static toJSON(value)\n {\n return toJsonValue(value);\n }\n\n /**\n * Test whether bytes look like an FBX file.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Candidate FBX bytes.\n * @returns {boolean} True when the input appears to be FBX.\n */\n static isFBX(input)\n {\n try\n {\n return isFBX(asUint8Array(input, \"Fbx input\"));\n }\n catch\n {\n return false;\n }\n }\n\n /**\n * Emit targets for this format (canonical frozen enum).\n */\n static Output = Object.freeze({\n CMF: OUTPUT_CMF,\n GR2: OUTPUT_GR2,\n RAW: OUTPUT_RAW,\n JSON: OUTPUT_JSON,\n FBX_JSON: OUTPUT_FBX_JSON\n });\n static CLASS_KEYS = CLASS_KEYS;\n static id = \"fbx\";\n static mediaTypes = Object.freeze([ \"geometry\" ]);\n // FBX is written THROUGH CMF: `write` takes a native CMF graph and\n // `writeShared` converts shared or GR2-shaped geometry into one first.\n static inputs = CjsFormat.defineInputs({\n cmf: { default: true, payloadType: \"geometry\" },\n shared: { payloadType: \"geometry\" }\n });\n\n static outputs = CjsFormat.defineOutputs({\n gr2: { decoded: true },\n cmf: { decoded: true },\n fbxJson: { role: \"debug\", decoded: true, probes: [ \"fbxJson\", \"document\" ] },\n raw: { role: \"debug\", default: true, passthrough: true, probes: [ \"raw\", \"document\" ] }\n });\n static extensions = Object.freeze([ \".fbx\" ]);\n}\n\nexport default CjsFbxFormat;\n"],"names":["FORMAT_NAME","CjsFbxFormat","CjsFormat","DEFAULT_VALUES","constructor","options","SetValues","normalizeValues","inputType","GetValues","SetClasses","classes","SetClass","type","Class","validateClassKey","undefined","validateClass","GetClass","HasClass","Read","input","readWithValues","Write","writeFbx","WriteShared","writeSharedFbx","ReadAsync","Inspect","inspectWithValues","ToJSON","value","toJsonValue","read","write","writeShared","readAsync","inspect","probeSupport","probeSupportWithValues","toJSON","isFBX","asUint8Array","Output","Object","freeze","CMF","OUTPUT_CMF","GR2","OUTPUT_GR2","RAW","OUTPUT_RAW","JSON","OUTPUT_JSON","FBX_JSON","OUTPUT_FBX_JSON","CLASS_KEYS","id","mediaTypes","inputs","defineInputs","cmf","default","payloadType","shared","outputs","defineOutputs","gr2","decoded","fbxJson","role","probes","raw","passthrough","extensions"],"mappings":";;;;;AAqBA,MAAMA,WAAW,GAAG,cAAc;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,YAAY,SAASC,SAAS,CAC3C;EACI,OAAO,GAAGC,cAAc;;AAExB;AACJ;AACA;AACA;AACA;AACIC,EAAAA,WAAWA,CAACC,OAAO,GAAG,EAAE,EACxB;AACI,IAAA,KAAK,EAAE;AACP,IAAA,IAAI,CAACC,SAAS,CAACD,OAAO,CAAC;AAC3B,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACIC,EAAAA,SAASA,CAACD,OAAO,GAAG,EAAE,EACtB;IACI,IAAI,CAAC,OAAO,GAAGE,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE;AAAEC,MAAAA,SAAS,EAAE,KAAK;MAAE,GAAGH;KAAS,EAAEL,WAAW,CAAC;AAC3F,IAAA,OAAO,IAAI;AACf,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACIS,EAAAA,SAASA,CAACJ,OAAO,GAAG,EAAE,EACtB;AACI,IAAA,OAAOE,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE;AAAEC,MAAAA,SAAS,EAAE,KAAK;MAAE,GAAGH;KAAS,EAAEL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OAAOG,UAAU,GAAG9B,MAAM,CAACC,MAAM,CAAC,CAAE,MAAM,CAAE,CAAC;AACjD;;;;"}
1
+ {"version":3,"file":"CjsFbxFormat.js","sources":["../../../../../src/resource/formats/fbx/CjsFbxFormat.js"],"sourcesContent":["import { asUint8Array } from \"#utils/bytes\";\nimport { CjsFormat } from \"../../format/CjsFormat.js\";\nimport { CjsGeometryFormat } from \"../../format/CjsGeometryFormat.js\";\nimport {\n CLASS_KEYS,\n DEFAULT_VALUES,\n OUTPUT_CMF,\n OUTPUT_FBX_JSON,\n OUTPUT_GR2,\n OUTPUT_JSON,\n OUTPUT_RAW,\n inspectWithValues,\n isFBX,\n probeSupportWithValues,\n normalizeValues,\n readWithValues,\n toJsonValue,\n validateClass,\n validateClassKey\n} from \"./core/helpers.js\";\nimport { writeFbx, writeSharedFbx } from \"./core/writer.js\";\n\nconst FORMAT_NAME = \"CjsFbxFormat\";\n\n/**\n * CarbonEngineJS-facing FBX format surface.\n *\n * FBX is recognized, inspected, imported into CMF/GR2 compatibility graphs,\n * and exported from native CMF in pure JavaScript. Geometry, skeletons, skin,\n * morph targets, and their animations are in scope; cameras and lights are not.\n */\nexport class CjsFbxFormat extends CjsGeometryFormat\n{\n _values = DEFAULT_VALUES;\n\n /**\n * Create a reusable FBX format profile.\n *\n * @param {object} [options] Default read/inspect options.\n */\n constructor(options = {})\n {\n super();\n this.SetValues(options);\n }\n\n /**\n * Merge options into this profile.\n *\n * @param {object} [options] Values to merge.\n * @returns {CjsFbxFormat} This format profile.\n */\n SetValues(options = {})\n {\n this._values = normalizeValues(this._values, { inputType: \"fbx\", ...options }, FORMAT_NAME);\n return this;\n }\n\n /**\n * Get normalized profile values with optional per-call overrides.\n *\n * @param {object} [options] Per-call values.\n * @returns {object} Normalized read values.\n */\n GetValues(options = {})\n {\n return normalizeValues(this._values, { inputType: \"fbx\", ...options }, FORMAT_NAME);\n }\n\n /**\n * Set multiple output node constructors for this profile.\n *\n * These constructors are used only for explicit runtime output targets such\n * as `emit: \"gr2\"` and `emit: \"cmf\"` paths. Debug `fbxJson` output\n * remains plain data.\n *\n * @param {object} [classes] Map of output node class keys to constructors.\n * @returns {CjsFbxFormat} This format profile.\n */\n SetClasses(classes = {})\n {\n return this.SetValues({ classes });\n }\n\n /**\n * Set one output node constructor for this profile.\n *\n * @param {string} type Output node class key.\n * @param {Function|null|undefined} Class Constructor to use, or nullish to delete.\n * @returns {CjsFbxFormat} This format profile.\n */\n SetClass(type, Class)\n {\n validateClassKey(type, FORMAT_NAME);\n\n if (Class === null || Class === undefined)\n {\n const classes = { ...this._values.classes };\n delete classes[type];\n this._values = { ...this._values, classes };\n return this;\n }\n\n validateClass(type, Class, FORMAT_NAME);\n return this.SetValues({ classes: { [type]: Class } });\n }\n\n /**\n * Get a configured output node constructor.\n *\n * @param {string} type Output node class key.\n * @returns {Function|undefined} The registered constructor, if any.\n */\n GetClass(type)\n {\n validateClassKey(type, FORMAT_NAME);\n return this._values.classes[type];\n }\n\n /**\n * Whether this profile has a constructor registered for an output node key.\n *\n * @param {string} type Output node class key.\n * @returns {boolean} True when a constructor is registered.\n */\n HasClass(type)\n {\n return !!this.GetClass(type);\n }\n\n /**\n * Read FBX bytes with this profile.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input FBX bytes.\n * @param {object} [options] Per-call values.\n * @returns {object} Raw or debug payload for the selected emit target.\n */\n Read(input, options = {})\n {\n return readWithValues(input, this.GetValues(options));\n }\n\n /** Write a native CMF graph as deterministic binary FBX 7400 bytes. */\n Write(input, options = {})\n {\n return writeFbx(input, options);\n }\n\n /** Convert shared or GR2-shaped geometry through CMF and write FBX. */\n WriteShared(input, options = {})\n {\n return writeSharedFbx(input, options);\n }\n\n /**\n * Read FBX bytes asynchronously with this profile.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input FBX bytes.\n * @param {object} [options] Per-call values.\n * @returns {Promise<object>} Raw or debug payload for the selected emit target.\n */\n async ReadAsync(input, options = {})\n {\n return this.Read(input, options);\n }\n\n /**\n * Inspect FBX bytes without converting geometry.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input FBX bytes.\n * @param {object} [options] Per-call values.\n * @returns {object} Lightweight FBX metadata.\n */\n Inspect(input, options = {})\n {\n return inspectWithValues(input, this.GetValues(options));\n }\n\n /**\n * Convert format output into JSON-compatible debug data.\n *\n * @param {any} value Format output.\n * @returns {any} JSON-compatible value.\n */\n ToJSON(value)\n {\n return toJsonValue(value);\n }\n\n /**\n * One-shot FBX read.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input FBX bytes.\n * @param {object} [options] Read options.\n * @returns {object} Raw or debug payload for the selected emit target.\n */\n static read(input, options = {})\n {\n return readWithValues(input, normalizeValues(DEFAULT_VALUES, { inputType: \"fbx\", ...options }, FORMAT_NAME));\n }\n\n /** Write a native CMF graph as deterministic binary FBX 7400 bytes. */\n static write(input, options = {})\n {\n return writeFbx(input, options);\n }\n\n /** Convert shared or GR2-shaped geometry through CMF and write FBX. */\n static writeShared(input, options = {})\n {\n return writeSharedFbx(input, options);\n }\n\n /**\n * One-shot asynchronous FBX read.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input FBX bytes.\n * @param {object} [options] Read options.\n * @returns {Promise<object>} Raw or debug payload for the selected emit target.\n */\n static async readAsync(input, options = {})\n {\n return CjsFbxFormat.read(input, options);\n }\n\n /**\n * One-shot FBX inspection.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input FBX bytes.\n * @param {object} [options] Inspect options.\n * @returns {object} Lightweight FBX metadata.\n */\n static inspect(input, options = {})\n {\n return inspectWithValues(input, normalizeValues(DEFAULT_VALUES, { inputType: \"fbx\", ...options }, FORMAT_NAME));\n }\n\n /**\n * One-shot FBX support probe.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input FBX bytes.\n * @param {object} [options] Probe options.\n * @returns {object} Support/probe report.\n */\n static probeSupport(input, options = {})\n {\n return probeSupportWithValues(input, normalizeValues(DEFAULT_VALUES, { inputType: \"fbx\", ...options }, FORMAT_NAME));\n }\n\n /**\n * Convert format output into JSON-compatible debug data.\n *\n * @param {any} value Format output.\n * @returns {any} JSON-compatible value.\n */\n static toJSON(value)\n {\n return toJsonValue(value);\n }\n\n /**\n * Test whether bytes look like an FBX file.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Candidate FBX bytes.\n * @returns {boolean} True when the input appears to be FBX.\n */\n static isFBX(input)\n {\n try\n {\n return isFBX(asUint8Array(input, \"Fbx input\"));\n }\n catch\n {\n return false;\n }\n }\n\n /**\n * Emit targets for this format (canonical frozen enum).\n */\n static classKeys = CLASS_KEYS;\n static id = \"CjsFbxFormat\";\n // FBX is written THROUGH CMF: `write` takes a native CMF graph and\n // `writeShared` converts shared or GR2-shaped geometry into one first.\n static inputs = CjsFormat.defineInputs({\n cmf: { default: true, payloadType: \"geometry\" },\n shared: { payloadType: \"geometry\" }\n });\n\n static outputs = CjsFormat.defineOutputs({\n gr2: { decoded: true },\n cmf: { decoded: true },\n json: { role: \"debug\", decoded: true, probes: [ \"fbxJson\", \"document\" ] },\n fbxJson: { role: \"debug\", decoded: true, probes: [ \"fbxJson\", \"document\" ] },\n raw: { role: \"debug\", default: true, passthrough: true, probes: [ \"raw\", \"document\" ] }\n });\n static extensions = [ \".fbx\" ];\n}\n\nexport default CjsFbxFormat;\n"],"names":["FORMAT_NAME","CjsFbxFormat","CjsGeometryFormat","_values","DEFAULT_VALUES","constructor","options","SetValues","normalizeValues","inputType","GetValues","SetClasses","classes","SetClass","type","Class","validateClassKey","undefined","validateClass","GetClass","HasClass","Read","input","readWithValues","Write","writeFbx","WriteShared","writeSharedFbx","ReadAsync","Inspect","inspectWithValues","ToJSON","value","toJsonValue","read","write","writeShared","readAsync","inspect","probeSupport","probeSupportWithValues","toJSON","isFBX","asUint8Array","classKeys","CLASS_KEYS","id","inputs","CjsFormat","defineInputs","cmf","default","payloadType","shared","outputs","defineOutputs","gr2","decoded","json","role","probes","fbxJson","raw","passthrough","extensions"],"mappings":";;;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C,MAAAA,OAAO,EAAE;KAAM;AACtBP,IAAAA,GAAG,EAAE;AAAEO,MAAAA,OAAO,EAAE;KAAM;AACtBC,IAAAA,IAAI,EAAE;AAAEC,MAAAA,IAAI,EAAE,OAAO;AAAEF,MAAAA,OAAO,EAAE,IAAI;AAAEG,MAAAA,MAAM,EAAE,CAAE,SAAS,EAAE,UAAU;KAAI;AACzEC,IAAAA,OAAO,EAAE;AAAEF,MAAAA,IAAI,EAAE,OAAO;AAAEF,MAAAA,OAAO,EAAE,IAAI;AAAEG,MAAAA,MAAM,EAAE,CAAE,SAAS,EAAE,UAAU;KAAI;AAC5EE,IAAAA,GAAG,EAAE;AAAEH,MAAAA,IAAI,EAAE,OAAO;AAAER,MAAAA,OAAO,EAAE,IAAI;AAAEY,MAAAA,WAAW,EAAE,IAAI;AAAEH,MAAAA,MAAM,EAAE,CAAE,KAAK,EAAE,UAAU;AAAG;AAC1F,GAAC,CAAC;AACF,EAAA,OAAOI,UAAU,GAAG,CAAE,MAAM,CAAE;AAClC;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { asUint8Array } from '#utils/bytes';
2
2
  import { CjsFormat } from '../../format/CjsFormat.js';
3
- import { DEFAULT_VALUES, normalizeValues, readWithValues, inspectWithValues, isFLAC, OUTPUT_JSON, OUTPUT_PCM, OUTPUT_RAW } from './core/helpers.js';
3
+ import { DEFAULT_VALUES, normalizeValues, readWithValues, inspectWithValues, isFLAC } from './core/helpers.js';
4
4
  import { toJsonWithByteSummary } from '../../format/jsonPolicies.js';
5
5
 
6
6
  const FORMAT_NAME = "CjsFlacFormat";
@@ -11,7 +11,7 @@ const FORMAT_NAME = "CjsFlacFormat";
11
11
  * without decoding PCM.
12
12
  */
13
13
  class CjsFlacFormat extends CjsFormat {
14
- #values = DEFAULT_VALUES;
14
+ _values = DEFAULT_VALUES;
15
15
 
16
16
  /** Creates a CjsFlacFormat with caller-provided reader configuration. */
17
17
  constructor(options = {}) {
@@ -24,7 +24,7 @@ class CjsFlacFormat extends CjsFormat {
24
24
  * FLAC format configuration.
25
25
  */
26
26
  SetValues(options = {}) {
27
- this.#values = normalizeValues(this.#values, {
27
+ this._values = normalizeValues(this._values, {
28
28
  inputType: "flac",
29
29
  ...options
30
30
  }, FORMAT_NAME);
@@ -36,7 +36,7 @@ class CjsFlacFormat extends CjsFormat {
36
36
  * configuration.
37
37
  */
38
38
  GetValues(options = {}) {
39
- return normalizeValues(this.#values, {
39
+ return normalizeValues(this._values, {
40
40
  inputType: "flac",
41
41
  ...options
42
42
  }, FORMAT_NAME);
@@ -114,14 +114,8 @@ class CjsFlacFormat extends CjsFormat {
114
114
  /**
115
115
  * Emit targets for this format (canonical frozen enum).
116
116
  */
117
- static Output = Object.freeze({
118
- RAW: OUTPUT_RAW,
119
- PCM: OUTPUT_PCM,
120
- JSON: OUTPUT_JSON
121
- });
122
- static OUTPUT_FLAC_JSON = "flacJson";
123
- static id = "flac";
124
- static mediaTypes = Object.freeze(["audio"]);
117
+ static id = "CjsFlacFormat";
118
+ static mediaTypes = ["audio"];
125
119
  static outputs = CjsFormat.defineOutputs({
126
120
  flacJson: {
127
121
  role: "debug",
@@ -133,7 +127,7 @@ class CjsFlacFormat extends CjsFormat {
133
127
  passthrough: true
134
128
  }
135
129
  });
136
- static extensions = Object.freeze([".flac"]);
130
+ static extensions = [".flac"];
137
131
  }
138
132
 
139
133
  export { CjsFlacFormat };
@@ -1 +1 @@
1
- {"version":3,"file":"CjsFlacFormat.js","sources":["../../../../../src/resource/formats/flac/CjsFlacFormat.js"],"sourcesContent":["import { asUint8Array } from \"#utils/bytes\";\nimport { CjsFormat } from \"../../format/CjsFormat.js\";\nimport {\n DEFAULT_VALUES,\n OUTPUT_JSON,\n OUTPUT_PCM,\n OUTPUT_RAW,\n inspectWithValues,\n isFLAC,\n probeSupportWithValues,\n normalizeValues,\n readWithValues,\n toJsonValue\n} from \"./core/helpers.js\";\n\nconst FORMAT_NAME = \"CjsFlacFormat\";\n\n/**\n * Metadata-only FLAC format profile that validates the stream signature,\n * inspects stream metadata, and emits raw container bytes or debug JSON\n * without decoding PCM.\n */\nexport class CjsFlacFormat extends CjsFormat\n{\n #values = DEFAULT_VALUES;\n\n /** Creates a CjsFlacFormat with caller-provided reader configuration. */\n constructor(options = {})\n {\n super();\n this.SetValues(options);\n }\n\n /**\n * Applies caller-provided options after normalizing supported fields for the\n * FLAC format configuration.\n */\n SetValues(options = {})\n {\n this.#values = normalizeValues(this.#values, { inputType: \"flac\", ...options }, FORMAT_NAME);\n return this;\n }\n\n /**\n * Returns a snapshot of the normalized reader options for the FLAC format\n * configuration.\n */\n GetValues(options = {})\n {\n return normalizeValues(this.#values, { inputType: \"flac\", ...options }, FORMAT_NAME);\n }\n\n /**\n * Reads the primary public payload representation from the supplied input\n * for the FLAC format configuration.\n */\n Read(input, options = {}) { return readWithValues(input, this.GetValues(options)); }\n\n /**\n * Reads the primary public payload representation asynchronously for the\n * FLAC format configuration.\n */\n async ReadAsync(input, options = {}) { return this.Read(input, options); }\n\n /**\n * Returns structural metadata without materializing the decoded payload for\n * the FLAC format configuration.\n */\n Inspect(input, options = {}) { return inspectWithValues(input, this.GetValues(options)); }\n\n /**\n * Converts the current decoded payload into a JSON-safe representation for\n * the FLAC format configuration.\n */\n ToJSON(value) { return toJsonValue(value); }\n\n /** Provides the one-shot FLAC payload reader entry point. */\n static read(input, options = {})\n {\n return readWithValues(input, normalizeValues(DEFAULT_VALUES, { inputType: \"flac\", ...options }, FORMAT_NAME));\n }\n\n /** Provides the asynchronous one-shot FLAC payload reader entry point. */\n static async readAsync(input, options = {}) { return CjsFlacFormat.read(input, options); }\n\n /** Provides the one-shot FLAC metadata inspection entry point. */\n static inspect(input, options = {})\n {\n return inspectWithValues(input, normalizeValues(DEFAULT_VALUES, { inputType: \"flac\", ...options }, FORMAT_NAME));\n }\n\n /** Checks one input against the FLAC decoder capability contract. */\n\n /** Provides the one-shot FLAC JSON conversion entry point. */\n static toJSON(value) { return toJsonValue(value); }\n\n /** Checks whether caller-provided bytes carry the expected FLAC signature. */\n static isFLAC(input)\n {\n try { return isFLAC(asUint8Array(input, \"FLAC input\")); }\n catch { return false; }\n }\n\n /**\n * Emit targets for this format (canonical frozen enum).\n */\n static Output = Object.freeze({\n RAW: OUTPUT_RAW,\n PCM: OUTPUT_PCM,\n JSON: OUTPUT_JSON\n });\n static OUTPUT_FLAC_JSON = \"flacJson\";\n static id = \"flac\";\n static mediaTypes = Object.freeze([ \"audio\" ]);\n static outputs = CjsFormat.defineOutputs({\n flacJson: { role: \"debug\", probes: [ \"flacJson\", \"raw\" ] },\n raw: { role: \"debug\", default: true, passthrough: true }\n });\n static extensions = Object.freeze([ \".flac\" ]);\n}\n\nexport default CjsFlacFormat;\n"],"names":["FORMAT_NAME","CjsFlacFormat","CjsFormat","DEFAULT_VALUES","constructor","options","SetValues","normalizeValues","inputType","GetValues","Read","input","readWithValues","ReadAsync","Inspect","inspectWithValues","ToJSON","value","toJsonValue","read","readAsync","inspect","toJSON","isFLAC","asUint8Array","Output","Object","freeze","RAW","OUTPUT_RAW","PCM","OUTPUT_PCM","JSON","OUTPUT_JSON","OUTPUT_FLAC_JSON","id","mediaTypes","outputs","defineOutputs","flacJson","role","probes","raw","default","passthrough","extensions"],"mappings":";;;;;AAeA,MAAMA,WAAW,GAAG,eAAe;;AAEnC;AACA;AACA;AACA;AACA;AACO,MAAMC,aAAa,SAASC,SAAS,CAC5C;EACI,OAAO,GAAGC,cAAc;;AAExB;AACAC,EAAAA,WAAWA,CAACC,OAAO,GAAG,EAAE,EACxB;AACI,IAAA,KAAK,EAAE;AACP,IAAA,IAAI,CAACC,SAAS,CAACD,OAAO,CAAC;AAC3B,EAAA;;AAEA;AACJ;AACA;AACA;AACIC,EAAAA,SAASA,CAACD,OAAO,GAAG,EAAE,EACtB;IACI,IAAI,CAAC,OAAO,GAAGE,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE;AAAEC,MAAAA,SAAS,EAAE,MAAM;MAAE,GAAGH;KAAS,EA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AC;EACF,OAAOC,UAAU,GAAGnB,MAAM,CAACC,MAAM,CAAC,CAAE,OAAO,CAAE,CAAC;AAClD;;;;"}
1
+ {"version":3,"file":"CjsFlacFormat.js","sources":["../../../../../src/resource/formats/flac/CjsFlacFormat.js"],"sourcesContent":["import { asUint8Array } from \"#utils/bytes\";\nimport { CjsFormat } from \"../../format/CjsFormat.js\";\nimport {\n DEFAULT_VALUES,\n OUTPUT_JSON,\n OUTPUT_PCM,\n OUTPUT_RAW,\n inspectWithValues,\n isFLAC,\n probeSupportWithValues,\n normalizeValues,\n readWithValues,\n toJsonValue\n} from \"./core/helpers.js\";\n\nconst FORMAT_NAME = \"CjsFlacFormat\";\n\n/**\n * Metadata-only FLAC format profile that validates the stream signature,\n * inspects stream metadata, and emits raw container bytes or debug JSON\n * without decoding PCM.\n */\nexport class CjsFlacFormat extends CjsFormat\n{\n _values = DEFAULT_VALUES;\n\n /** Creates a CjsFlacFormat with caller-provided reader configuration. */\n constructor(options = {})\n {\n super();\n this.SetValues(options);\n }\n\n /**\n * Applies caller-provided options after normalizing supported fields for the\n * FLAC format configuration.\n */\n SetValues(options = {})\n {\n this._values = normalizeValues(this._values, { inputType: \"flac\", ...options }, FORMAT_NAME);\n return this;\n }\n\n /**\n * Returns a snapshot of the normalized reader options for the FLAC format\n * configuration.\n */\n GetValues(options = {})\n {\n return normalizeValues(this._values, { inputType: \"flac\", ...options }, FORMAT_NAME);\n }\n\n /**\n * Reads the primary public payload representation from the supplied input\n * for the FLAC format configuration.\n */\n Read(input, options = {}) { return readWithValues(input, this.GetValues(options)); }\n\n /**\n * Reads the primary public payload representation asynchronously for the\n * FLAC format configuration.\n */\n async ReadAsync(input, options = {}) { return this.Read(input, options); }\n\n /**\n * Returns structural metadata without materializing the decoded payload for\n * the FLAC format configuration.\n */\n Inspect(input, options = {}) { return inspectWithValues(input, this.GetValues(options)); }\n\n /**\n * Converts the current decoded payload into a JSON-safe representation for\n * the FLAC format configuration.\n */\n ToJSON(value) { return toJsonValue(value); }\n\n /** Provides the one-shot FLAC payload reader entry point. */\n static read(input, options = {})\n {\n return readWithValues(input, normalizeValues(DEFAULT_VALUES, { inputType: \"flac\", ...options }, FORMAT_NAME));\n }\n\n /** Provides the asynchronous one-shot FLAC payload reader entry point. */\n static async readAsync(input, options = {}) { return CjsFlacFormat.read(input, options); }\n\n /** Provides the one-shot FLAC metadata inspection entry point. */\n static inspect(input, options = {})\n {\n return inspectWithValues(input, normalizeValues(DEFAULT_VALUES, { inputType: \"flac\", ...options }, FORMAT_NAME));\n }\n\n /** Checks one input against the FLAC decoder capability contract. */\n\n /** Provides the one-shot FLAC JSON conversion entry point. */\n static toJSON(value) { return toJsonValue(value); }\n\n /** Checks whether caller-provided bytes carry the expected FLAC signature. */\n static isFLAC(input)\n {\n try { return isFLAC(asUint8Array(input, \"FLAC input\")); }\n catch { return false; }\n }\n\n /**\n * Emit targets for this format (canonical frozen enum).\n */\n static id = \"CjsFlacFormat\";\n static mediaTypes = [ \"audio\" ];\n static outputs = CjsFormat.defineOutputs({\n flacJson: { role: \"debug\", probes: [ \"flacJson\", \"raw\" ] },\n raw: { role: \"debug\", default: true, passthrough: true }\n });\n static extensions = [ \".flac\" ];\n}\n\nexport default CjsFlacFormat;\n"],"names":["FORMAT_NAME","CjsFlacFormat","CjsFormat","_values","DEFAULT_VALUES","constructor","options","SetValues","normalizeValues","inputType","GetValues","Read","input","readWithValues","ReadAsync","Inspect","inspectWithValues","ToJSON","value","toJsonValue","read","readAsync","inspect","toJSON","isFLAC","asUint8Array","id","mediaTypes","outputs","defineOutputs","flacJson","role","probes","raw","default","passthrough","extensions"],"mappings":";;;;;AAeA,MAAMA,WAAW,GAAG,eAAe;;AAEnC;AACA;AACA;AACA;AACA;AACO,MAAMC,aAAa,SAASC,SAAS,CAC5C;AACIC,EAAAA,OAAO,GAAGC,cAAc;;AAExB;AACAC,EAAAA,WAAWA,CAACC,OAAO,GAAG,EAAE,EACxB;AACI,IAAA,KAAK,EAAE;AACP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AE;AAAK;AAC3D,GAAC,CAAC;AACF,EAAA,OAAOC,UAAU,GAAG,CAAE,OAAO,CAAE;AACnC;;;;"}
@@ -11,21 +11,21 @@ const VARIANT = "fsd32";
11
11
  * implementation lands in this directory.
12
12
  */
13
13
  class CjsFsd32Format extends CjsFormat {
14
- /**
15
- * Test whether the caller explicitly selected the legacy FSD layout.
16
- * @param {*} _input Unused candidate input.
17
- * @param {object} [options] Caller format profile.
18
- * @returns {boolean} True when legacy FSD was explicitly selected.
14
+ /**
15
+ * Test whether the caller explicitly selected the legacy FSD layout.
16
+ * @param {*} _input Unused candidate input.
17
+ * @param {object} [options] Caller format profile.
18
+ * @returns {boolean} True when legacy FSD was explicitly selected.
19
19
  */
20
20
  static is(_input, options = {}) {
21
21
  return options.bitWidth === 32 || options.variant === VARIANT || options.variant === "32";
22
22
  }
23
23
 
24
- /**
25
- * Report the legacy layout's explicit unsupported status.
26
- * @param {*|string} input Candidate input.
27
- * @param {object} [options] Caller format profile.
28
- * @returns {object} Plain support report.
24
+ /**
25
+ * Report the legacy layout's explicit unsupported status.
26
+ * @param {*|string} input Candidate input.
27
+ * @param {object} [options] Caller format profile.
28
+ * @returns {object} Plain support report.
29
29
  */
30
30
  static probeSupport(input, options = {}) {
31
31
  const identified = this.is(input, options);
@@ -45,21 +45,21 @@ class CjsFsd32Format extends CjsFormat {
45
45
  };
46
46
  }
47
47
 
48
- /**
49
- * Inspect caller-supplied legacy layout metadata.
50
- * @param {*} input Candidate input.
51
- * @param {object} [options] Caller format profile.
52
- * @returns {object} Legacy layout metadata.
48
+ /**
49
+ * Inspect caller-supplied legacy layout metadata.
50
+ * @param {*} input Candidate input.
51
+ * @param {object} [options] Caller format profile.
52
+ * @returns {object} Legacy layout metadata.
53
53
  */
54
54
  static inspect(input, options = {}) {
55
55
  return this.probeSupport(input, options).metadata;
56
56
  }
57
57
 
58
- /**
59
- * Reject legacy FSD decoding until its schema-driven reader exists.
60
- * @param {*} _input Unused candidate input.
61
- * @param {object} [options] Caller format profile.
62
- * @returns {never} Always throws the unsupported-layout error.
58
+ /**
59
+ * Reject legacy FSD decoding until its schema-driven reader exists.
60
+ * @param {*} _input Unused candidate input.
61
+ * @param {object} [options] Caller format profile.
62
+ * @returns {never} Always throws the unsupported-layout error.
63
63
  */
64
64
  static read(_input, options = {}) {
65
65
  const error = new Error("Legacy 32-bit FSD is identified but not readable. " + "Its future schema-driven reader belongs in formats/fsd/32.");
@@ -70,19 +70,19 @@ class CjsFsd32Format extends CjsFormat {
70
70
  throw error;
71
71
  }
72
72
 
73
- /**
74
- * Reject legacy FSD JSON decoding.
75
- * @param {*} input Candidate input.
76
- * @param {object} [options] Caller format profile.
77
- * @returns {never} Always throws the unsupported-layout error.
73
+ /**
74
+ * Reject legacy FSD JSON decoding.
75
+ * @param {*} input Candidate input.
76
+ * @param {object} [options] Caller format profile.
77
+ * @returns {never} Always throws the unsupported-layout error.
78
78
  */
79
79
  static readJSON(input, options = {}) {
80
80
  return this.read(input, options);
81
81
  }
82
- static id = VARIANT;
83
- static extensions = Object.freeze([".fsdbinary"]);
84
- static mediaTypes = Object.freeze(["data"]);
85
- static outputs = Object.freeze({});
82
+ static id = "CjsFsd32Format";
83
+ static extensions = [".fsdbinary"];
84
+ static mediaTypes = ["data"];
85
+ static outputs = {};
86
86
  }
87
87
 
88
88
  export { CjsFsd32Format, CjsFsd32Format as default };
@@ -1 +1 @@
1
- {"version":3,"file":"CjsFsd32Format.js","sources":["../../../../../../src/resource/formats/fsd/32/CjsFsd32Format.js"],"sourcesContent":["import { CjsFormat } from \"../../../format/CjsFormat.js\";\r\nconst VARIANT = \"fsd32\";\r\n\r\n/**\r\n * Reserved legacy FSD reader boundary.\r\n *\r\n * Legacy FSD has no self-describing outer header, so callers identify it with\r\n * `bitWidth: 32` (or `variant: \"fsd32\"`) after the normal extension route has\r\n * selected FSD. Reading is deliberately unsupported until a schema-driven\r\n * implementation lands in this directory.\r\n */\r\nexport class CjsFsd32Format extends CjsFormat\n{\n /**\n * Test whether the caller explicitly selected the legacy FSD layout.\n * @param {*} _input Unused candidate input.\n * @param {object} [options] Caller format profile.\n * @returns {boolean} True when legacy FSD was explicitly selected.\n */\n static is(_input, options = {})\n {\r\n return options.bitWidth === 32\r\n || options.variant === VARIANT\r\n || options.variant === \"32\";\r\n }\r\n\r\n /**\n * Report the legacy layout's explicit unsupported status.\n * @param {*|string} input Candidate input.\n * @param {object} [options] Caller format profile.\n * @returns {object} Plain support report.\n */\n static probeSupport(input, options = {})\n {\r\n const identified = this.is(input, options);\r\n\r\n return {\r\n format: VARIANT,\r\n source: typeof input === \"string\" ? \"path\" : \"buffer\",\r\n recognized: identified,\r\n supported: false,\r\n reason: identified\r\n ? \"Legacy 32-bit FSD was identified by the caller, but its reader is not implemented.\"\r\n : \"Legacy FSD has no outer header and was not identified by the caller.\",\r\n metadata: {\r\n family: \"fsd\",\r\n variant: identified ? VARIANT : null,\r\n bitWidth: identified ? 32 : null,\r\n decodable: false,\r\n identifiedBy: identified ? \"caller\" : null,\r\n },\r\n };\r\n }\r\n\r\n /**\n * Inspect caller-supplied legacy layout metadata.\n * @param {*} input Candidate input.\n * @param {object} [options] Caller format profile.\n * @returns {object} Legacy layout metadata.\n */\n static inspect(input, options = {})\n {\r\n return this.probeSupport(input, options).metadata;\r\n }\r\n\r\n /**\n * Reject legacy FSD decoding until its schema-driven reader exists.\n * @param {*} _input Unused candidate input.\n * @param {object} [options] Caller format profile.\n * @returns {never} Always throws the unsupported-layout error.\n */\n static read(_input, options = {})\n {\r\n const error = new Error(\r\n \"Legacy 32-bit FSD is identified but not readable. \"\r\n + \"Its future schema-driven reader belongs in formats/fsd/32.\"\r\n );\r\n\r\n error.code = \"CJS_FSD_32_UNSUPPORTED\";\r\n error.variant = VARIANT;\r\n error.bitWidth = 32;\r\n error.path = options.path ?? null;\r\n throw error;\r\n }\r\n\r\n /**\n * Reject legacy FSD JSON decoding.\n * @param {*} input Candidate input.\n * @param {object} [options] Caller format profile.\n * @returns {never} Always throws the unsupported-layout error.\n */\n static readJSON(input, options = {})\n {\r\n return this.read(input, options);\r\n }\r\n\r\n static id = VARIANT;\r\n static extensions = Object.freeze([ \".fsdbinary\" ]);\r\n static mediaTypes = Object.freeze([ \"data\" ]);\r\n static outputs = Object.freeze({});\r\n}\r\n\r\nexport default CjsFsd32Format;\r\n"],"names":["VARIANT","CjsFsd32Format","CjsFormat","is","_input","options","bitWidth","variant","probeSupport","input","identified","format","source","recognized","supported","reason","metadata","family","decodable","identifiedBy","inspect","read","error","Error","code","path","readJSON","id","extensions","Object","freeze","mediaTypes","outputs"],"mappings":";;AACA,MAAMA,OAAO,GAAG,OAAO;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,cAAc,SAASC,SAAS,CAC7C;AACI;AACJ;AACA;AACA;AACA;AACA;EACI,OAAOC,EAAEA,CAACC,MAAM,EAAEC,OAAO,GAAG,EAAE,EAC9B;AACI,IAAA,OAAOA,OAAO,CAACC,QAAQ,KAAK,EAAE,IACvBD,OAAO,CAACE,OAAO,KAAKP,OAAO,IAC3BK,OAAO,CAACE,OAAO,KAAK,IAAI;AACnC,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;EACI,OAAOC,YAAYA,CAACC,KAAK,EAAEJ,OAAO,GAAG,EAAE,EACvC;IACI,MAAMK,UAAU,GAAG,IAAI,CAACP,EAAE,CAACM,KAAK,EAAEJ,OAAO,CAAC;IAE1C,OAAO;AACHM,MAAAA,MAAM,EAAEX,OAAO;MACfY,MAAM,EAAE,OAAOH,KAAK,KAAK,QAAQ,GAAG,MAAM,GAAG,QAAQ;AACrDI,MAAAA,UAAU,EAAEH,UAAU;AACtBI,MAAAA,SAAS,EAAE,KAAK;AAChBC,MAAAA,MAAM,EAAEL,UAAU,GACZ,oFAAoF,GACpF,sEAAsE;AAC5EM,MAAAA,QAAQ,EAAE;AACNC,QAAAA,MAAM,EAAE,KAAK;AACbV,QAAAA,OAAO,EAAEG,UAAU,GAAGV,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format.js","sources":["../../../../../../src/resource/formats/fsd/32/CjsFsd32Format.js"],"sourcesContent":["import { CjsFormat } from \"../../../format/CjsFormat.js\";\r\nconst VARIANT = \"fsd32\";\r\n\r\n/**\r\n * Reserved legacy FSD reader boundary.\r\n *\r\n * Legacy FSD has no self-describing outer header, so callers identify it with\r\n * `bitWidth: 32` (or `variant: \"fsd32\"`) after the normal extension route has\r\n * selected FSD. Reading is deliberately unsupported until a schema-driven\r\n * implementation lands in this directory.\r\n */\r\nexport class CjsFsd32Format extends CjsFormat\r\n{\r\n /**\r\n * Test whether the caller explicitly selected the legacy FSD layout.\r\n * @param {*} _input Unused candidate input.\r\n * @param {object} [options] Caller format profile.\r\n * @returns {boolean} True when legacy FSD was explicitly selected.\r\n */\r\n static is(_input, options = {})\r\n {\r\n return options.bitWidth === 32\r\n || options.variant === VARIANT\r\n || options.variant === \"32\";\r\n }\r\n\r\n /**\r\n * Report the legacy layout's explicit unsupported status.\r\n * @param {*|string} input Candidate input.\r\n * @param {object} [options] Caller format profile.\r\n * @returns {object} Plain support report.\r\n */\r\n static probeSupport(input, options = {})\r\n {\r\n const identified = this.is(input, options);\r\n\r\n return {\r\n format: VARIANT,\r\n source: typeof input === \"string\" ? \"path\" : \"buffer\",\r\n recognized: identified,\r\n supported: false,\r\n reason: identified\r\n ? \"Legacy 32-bit FSD was identified by the caller, but its reader is not implemented.\"\r\n : \"Legacy FSD has no outer header and was not identified by the caller.\",\r\n metadata: {\r\n family: \"fsd\",\r\n variant: identified ? VARIANT : null,\r\n bitWidth: identified ? 32 : null,\r\n decodable: false,\r\n identifiedBy: identified ? \"caller\" : null,\r\n },\r\n };\r\n }\r\n\r\n /**\r\n * Inspect caller-supplied legacy layout metadata.\r\n * @param {*} input Candidate input.\r\n * @param {object} [options] Caller format profile.\r\n * @returns {object} Legacy layout metadata.\r\n */\r\n static inspect(input, options = {})\r\n {\r\n return this.probeSupport(input, options).metadata;\r\n }\r\n\r\n /**\r\n * Reject legacy FSD decoding until its schema-driven reader exists.\r\n * @param {*} _input Unused candidate input.\r\n * @param {object} [options] Caller format profile.\r\n * @returns {never} Always throws the unsupported-layout error.\r\n */\r\n static read(_input, options = {})\r\n {\r\n const error = new Error(\r\n \"Legacy 32-bit FSD is identified but not readable. \"\r\n + \"Its future schema-driven reader belongs in formats/fsd/32.\"\r\n );\r\n\r\n error.code = \"CJS_FSD_32_UNSUPPORTED\";\r\n error.variant = VARIANT;\r\n error.bitWidth = 32;\r\n error.path = options.path ?? null;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Reject legacy FSD JSON decoding.\r\n * @param {*} input Candidate input.\r\n * @param {object} [options] Caller format profile.\r\n * @returns {never} Always throws the unsupported-layout error.\r\n */\r\n static readJSON(input, options = {})\r\n {\r\n return this.read(input, options);\r\n }\r\n\r\n static id = \"CjsFsd32Format\";\r\n static extensions = [ \".fsdbinary\" ];\r\n static mediaTypes = [ \"data\" ];\r\n static outputs = {};\r\n}\r\n\r\nexport default CjsFsd32Format;\r\n"],"names":["VARIANT","CjsFsd32Format","CjsFormat","is","_input","options","bitWidth","variant","probeSupport","input","identified","format","source","recognized","supported","reason","metadata","family","decodable","identifiedBy","inspect","read","error","Error","code","path","readJSON","id","extensions","mediaTypes","outputs"],"mappings":";;AACA,MAAMA,OAAO,GAAG,OAAO;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,cAAc,SAASC,SAAS,CAC7C;AACI;AACJ;AACA;AACA;AACA;AACA;EACI,OAAOC,EAAEA,CAACC,MAAM,EAAEC,OAAO,GAAG,EAAE,EAC9B;AACI,IAAA,OAAOA,OAAO,CAACC,QAAQ,KAAK,EAAE,IACvBD,OAAO,CAACE,OAAO,KAAKP,OAAO,IAC3BK,OAAO,CAACE,OAAO,KAAK,IAAI;AACnC,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;EACI,OAAOC,YAAYA,CAACC,KAAK,EAAEJ,OAAO,GAAG,EAAE,EACvC;IACI,MAAMK,UAA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EAAEJ,OAAO,GAAG,EAAE,EACnC;AACI,IAAA,OAAO,IAAI,CAACgB,IAAI,CAACZ,KAAK,EAAEJ,OAAO,CAAC;AACpC,EAAA;EAEA,OAAOsB,EAAE,GAAG,gBAAgB;AAC5B,EAAA,OAAOC,UAAU,GAAG,CAAE,YAAY,CAAE;AACpC,EAAA,OAAOC,UAAU,GAAG,CAAE,MAAM,CAAE;EAC9B,OAAOC,OAAO,GAAG,EAAE;AACvB;;;;"}
@@ -141,9 +141,9 @@ class CjsFsd64Format extends CjsFormat {
141
141
  emit: OUTPUT_JSON
142
142
  });
143
143
  }
144
- static id = VARIANT;
145
- static extensions = Object.freeze([".fsdbinary"]);
146
- static mediaTypes = Object.freeze(["data"]);
144
+ static id = "CjsFsd64Format";
145
+ static extensions = [".fsdbinary"];
146
+ static mediaTypes = ["data"];
147
147
  static outputs = CjsFormat.defineOutputs({
148
148
  payload: {
149
149
  default: true,
@@ -1 +1 @@
1
- {"version":3,"file":"CjsFsd64Format.js","sources":["../../../../../../src/resource/formats/fsd/64/CjsFsd64Format.js"],"sourcesContent":["import { CjsFormat } from \"../../../format/CjsFormat.js\";\nimport { CjsFsd64Binary } from \"./core/CjsFsd64Binary.js\";\n\nconst VARIANT = \"cfsd64\";\nconst OUTPUT_JSON = \"json\";\nconst OUTPUT_PAYLOAD = \"payload\";\n\n/** Identifies and dispatches modern 64-bit cFSD containers. */\nexport class CjsFsd64Format extends CjsFormat\n{\n /**\n * Describe a validated modern cFSD envelope.\n * @param {ArrayBuffer|ArrayBufferView} input Container bytes.\n * @param {object} [options] Inspection options.\n * @returns {object} Frozen container metadata.\n */\n static describe(input, options = {})\n {\n const binary = new CjsFsd64Binary(input, { path: options.path });\n\n return {\n family: \"fsd\",\n variant: VARIANT,\n bitWidth: 64,\n headerSize: binary.RootOffset,\n byteLength: binary.ByteLength,\n payloadLength: binary.PayloadLength,\n layoutID: binary.LayoutID,\n schemaID: binary.SchemaID,\n decodable: true,\n };\n }\n\n /**\n * Test whether bytes contain a valid modern cFSD envelope.\n * @param {ArrayBuffer|ArrayBufferView} input Candidate bytes.\n * @returns {boolean} True when the envelope is valid.\n */\n static is(input)\n {\n try\n {\n this.describe(input);\n return true;\n }\n catch\n {\n return false;\n }\n }\n\n /**\n * Report recognition and available dataset-reader outputs.\n * @param {ArrayBuffer|ArrayBufferView|string} input Candidate input.\n * @param {object} [options] Probe and reader options.\n * @returns {object} Plain support report.\n */\n static probeSupport(input, options = {})\n {\n try\n {\n const metadata = this.describe(input, options);\n const reader = options.reader ?? options.registry;\n const canReadPayload = typeof reader?.Read === \"function\";\n const canReadJson = typeof reader?.ReadJSON === \"function\";\n\n return {\n format: VARIANT,\n source: typeof input === \"string\" ? \"path\" : \"buffer\",\n recognized: true,\n supported: canReadPayload || canReadJson,\n preferredOutput: canReadPayload ? OUTPUT_PAYLOAD : canReadJson ? OUTPUT_JSON : \"\",\n reason: canReadPayload || canReadJson\n ? \"Recognized modern 64-bit cFSD and found a reader for the dataset layout.\"\n : \"Recognized modern 64-bit cFSD; decoding requires options.reader or options.registry.\",\n variants: [\n { kind: OUTPUT_PAYLOAD, supported: canReadPayload, requires: canReadPayload ? [] : [ \"reader.Read\" ] },\n { kind: OUTPUT_JSON, supported: canReadJson, requires: canReadJson ? [] : [ \"reader.ReadJSON\" ] }\n ],\n metadata,\n };\n }\n catch (error)\n {\n return {\n format: VARIANT,\n source: typeof input === \"string\" ? \"path\" : \"buffer\",\n recognized: false,\n supported: false,\n reason: error?.message ?? \"The input is not a modern cFSD container.\",\n variants: [\n { kind: OUTPUT_PAYLOAD, supported: false },\n { kind: OUTPUT_JSON, supported: false }\n ],\n metadata: {\n family: \"fsd\",\n variant: null,\n bitWidth: null,\n decodable: false,\n },\n };\n }\n }\n\n /**\n * Inspect a modern cFSD container.\n * @param {ArrayBuffer|ArrayBufferView} input Container bytes.\n * @param {object} [options] Inspection options.\n * @returns {object} Container metadata.\n */\n static inspect(input, options = {})\n {\n return this.describe(input, options);\n }\n\n /**\n * Decode a modern cFSD container with the supplied dataset reader.\n * @param {ArrayBuffer|ArrayBufferView} input Container bytes.\n * @param {object} [options] Reader and output options.\n * @returns {*} Decoded payload or JSON value.\n */\n static read(input, options = {})\n {\n // Validate the format before selecting a dataset layout so malformed\n // modern bytes never surface as a misleading missing-reader failure.\n this.describe(input, options);\n\n const reader = options.reader ?? options.registry;\n const method = options.emit === OUTPUT_JSON ? \"ReadJSON\" : \"Read\";\n\n if (!reader || typeof reader[method] !== \"function\")\n {\n const error = new TypeError(\n `Modern cFSD ${method} requires options.reader or options.registry exposing ${method}().`\n );\n\n error.code = \"CJS_FSD_READER_REQUIRED\";\n error.method = method;\n throw error;\n }\n\n return reader[method](input, options);\n }\n\n /**\n * Decode a modern cFSD container to JSON-compatible values.\n * @param {ArrayBuffer|ArrayBufferView} input Container bytes.\n * @param {object} [options] Reader options.\n * @returns {*} Decoded JSON-compatible value.\n */\n static readJSON(input, options = {})\n {\n return this.read(input, { ...options, emit: OUTPUT_JSON });\n }\n\n static id = VARIANT;\n static extensions = Object.freeze([ \".fsdbinary\" ]);\n static mediaTypes = Object.freeze([ \"data\" ]);\n static outputs = CjsFormat.defineOutputs({\n payload: { default: true, decoded: true },\n json: { decoded: true }\n });\n}\n\nexport default CjsFsd64Format;\n"],"names":["VARIANT","OUTPUT_JSON","OUTPUT_PAYLOAD","CjsFsd64Format","CjsFormat","describe","input","options","binary","CjsFsd64Binary","path","family","variant","bitWidth","headerSize","RootOffset","byteLength","ByteLength","payloadLength","PayloadLength","layoutID","LayoutID","schemaID","SchemaID","decodable","is","probeSupport","metadata","reader","registry","canReadPayload","Read","canReadJson","ReadJSON","format","source","recognized","supported","preferredOutput","reason","variants","kind","requires","error","message","inspect","read","method","emit","TypeError","code","readJSON","id","extensions","Object","freeze","mediaTypes","outputs","defineOutputs","payload","default","decoded","json"],"mappings":";;;AAGA,MAAMA,OAAO,GAAG,QAAQ;AACxB,MAAMC,WAAW,GAAG,MAAM;AAC1B,MAAMC,c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AAAEyC,MAAAA,IAAI,EAAE/C;AAAY,KAAC,CAAC;AAC9D,EAAA;EAEA,OAAOmD,EAAE,GAAGpD,OAAO;EACnB,OAAOqD,UAAU,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAE,YAAY,CAAE,CAAC;EACnD,OAAOC,UAAU,GAAGF,MAAM,CAACC,MAAM,CAAC,CAAE,MAAM,CAAE,CAAC;AAC7C,EAAA,OAAOE,OAAO,GAAGrD,SAAS,CAACsD,aAAa,CAAC;AACrCC,IAAAA,OAAO,EAAE;AAAEC,MAAAA,OAAO,EAAE,IAAI;AAAEC,MAAAA,OAAO,EAAE;KAAM;AACzCC,IAAAA,IAAI,EAAE;AAAED,MAAAA,OAAO,EAAE;AAAK;AAC1B,GAAC,CAAC;AACN;;;;"}
1
+ {"version":3,"file":"CjsFsd64Format.js","sources":["../../../../../../src/resource/formats/fsd/64/CjsFsd64Format.js"],"sourcesContent":["import { CjsFormat } from \"../../../format/CjsFormat.js\";\nimport { CjsFsd64Binary } from \"./core/CjsFsd64Binary.js\";\n\nconst VARIANT = \"cfsd64\";\nconst OUTPUT_JSON = \"json\";\nconst OUTPUT_PAYLOAD = \"payload\";\n\n/** Identifies and dispatches modern 64-bit cFSD containers. */\nexport class CjsFsd64Format extends CjsFormat\n{\n /**\n * Describe a validated modern cFSD envelope.\n * @param {ArrayBuffer|ArrayBufferView} input Container bytes.\n * @param {object} [options] Inspection options.\n * @returns {object} Frozen container metadata.\n */\n static describe(input, options = {})\n {\n const binary = new CjsFsd64Binary(input, { path: options.path });\n\n return {\n family: \"fsd\",\n variant: VARIANT,\n bitWidth: 64,\n headerSize: binary.RootOffset,\n byteLength: binary.ByteLength,\n payloadLength: binary.PayloadLength,\n layoutID: binary.LayoutID,\n schemaID: binary.SchemaID,\n decodable: true,\n };\n }\n\n /**\n * Test whether bytes contain a valid modern cFSD envelope.\n * @param {ArrayBuffer|ArrayBufferView} input Candidate bytes.\n * @returns {boolean} True when the envelope is valid.\n */\n static is(input)\n {\n try\n {\n this.describe(input);\n return true;\n }\n catch\n {\n return false;\n }\n }\n\n /**\n * Report recognition and available dataset-reader outputs.\n * @param {ArrayBuffer|ArrayBufferView|string} input Candidate input.\n * @param {object} [options] Probe and reader options.\n * @returns {object} Plain support report.\n */\n static probeSupport(input, options = {})\n {\n try\n {\n const metadata = this.describe(input, options);\n const reader = options.reader ?? options.registry;\n const canReadPayload = typeof reader?.Read === \"function\";\n const canReadJson = typeof reader?.ReadJSON === \"function\";\n\n return {\n format: VARIANT,\n source: typeof input === \"string\" ? \"path\" : \"buffer\",\n recognized: true,\n supported: canReadPayload || canReadJson,\n preferredOutput: canReadPayload ? OUTPUT_PAYLOAD : canReadJson ? OUTPUT_JSON : \"\",\n reason: canReadPayload || canReadJson\n ? \"Recognized modern 64-bit cFSD and found a reader for the dataset layout.\"\n : \"Recognized modern 64-bit cFSD; decoding requires options.reader or options.registry.\",\n variants: [\n { kind: OUTPUT_PAYLOAD, supported: canReadPayload, requires: canReadPayload ? [] : [ \"reader.Read\" ] },\n { kind: OUTPUT_JSON, supported: canReadJson, requires: canReadJson ? [] : [ \"reader.ReadJSON\" ] }\n ],\n metadata,\n };\n }\n catch (error)\n {\n return {\n format: VARIANT,\n source: typeof input === \"string\" ? \"path\" : \"buffer\",\n recognized: false,\n supported: false,\n reason: error?.message ?? \"The input is not a modern cFSD container.\",\n variants: [\n { kind: OUTPUT_PAYLOAD, supported: false },\n { kind: OUTPUT_JSON, supported: false }\n ],\n metadata: {\n family: \"fsd\",\n variant: null,\n bitWidth: null,\n decodable: false,\n },\n };\n }\n }\n\n /**\n * Inspect a modern cFSD container.\n * @param {ArrayBuffer|ArrayBufferView} input Container bytes.\n * @param {object} [options] Inspection options.\n * @returns {object} Container metadata.\n */\n static inspect(input, options = {})\n {\n return this.describe(input, options);\n }\n\n /**\n * Decode a modern cFSD container with the supplied dataset reader.\n * @param {ArrayBuffer|ArrayBufferView} input Container bytes.\n * @param {object} [options] Reader and output options.\n * @returns {*} Decoded payload or JSON value.\n */\n static read(input, options = {})\n {\n // Validate the format before selecting a dataset layout so malformed\n // modern bytes never surface as a misleading missing-reader failure.\n this.describe(input, options);\n\n const reader = options.reader ?? options.registry;\n const method = options.emit === OUTPUT_JSON ? \"ReadJSON\" : \"Read\";\n\n if (!reader || typeof reader[method] !== \"function\")\n {\n const error = new TypeError(\n `Modern cFSD ${method} requires options.reader or options.registry exposing ${method}().`\n );\n\n error.code = \"CJS_FSD_READER_REQUIRED\";\n error.method = method;\n throw error;\n }\n\n return reader[method](input, options);\n }\n\n /**\n * Decode a modern cFSD container to JSON-compatible values.\n * @param {ArrayBuffer|ArrayBufferView} input Container bytes.\n * @param {object} [options] Reader options.\n * @returns {*} Decoded JSON-compatible value.\n */\n static readJSON(input, options = {})\n {\n return this.read(input, { ...options, emit: OUTPUT_JSON });\n }\n\n static id = \"CjsFsd64Format\";\n static extensions = [ \".fsdbinary\" ];\n static mediaTypes = [ \"data\" ];\n static outputs = CjsFormat.defineOutputs({\n payload: { default: true, decoded: true },\n json: { decoded: true }\n });\n}\n\nexport default CjsFsd64Format;\n"],"names":["VARIANT","OUTPUT_JSON","OUTPUT_PAYLOAD","CjsFsd64Format","CjsFormat","describe","input","options","binary","CjsFsd64Binary","path","family","variant","bitWidth","headerSize","RootOffset","byteLength","ByteLength","payloadLength","PayloadLength","layoutID","LayoutID","schemaID","SchemaID","decodable","is","probeSupport","metadata","reader","registry","canReadPayload","Read","canReadJson","ReadJSON","format","source","recognized","supported","preferredOutput","reason","variants","kind","requires","error","message","inspect","read","method","emit","TypeError","code","readJSON","id","extensions","mediaTypes","outputs","defineOutputs","payload","default","decoded","json"],"mappings":";;;AAGA,MAAMA,OAAO,GAAG,QAAQ;AACxB,MAAMC,WAAW,GAAG,MAAM;AAC1B,MAAMC,cAAc,GAAG,SAAS;;AAEhC;AACO,MAAMC,cAAc,SAASC,SAAS,CAC7C;AACI;AACJ;AACA;AACA;AACA;AACA;EACI,OAAOC,QAAQA,CAACC,K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