ce795b864d49e941dc8a80001cf2950942c8ee55b7d5f70e3cb86022a0bb3341.json 31 KB

1
  1. {"ast":null,"code":"import { Vector2 } from \"@babylonjs/core/Maths/math.vector.js\";\nimport { Tools } from \"@babylonjs/core/Misc/tools.js\";\nimport { SceneLoader } from \"@babylonjs/core/Loading/sceneLoader.js\";\nimport { AssetContainer } from \"@babylonjs/core/assetContainer.js\";\nimport { MTLFileLoader } from \"./mtlFileLoader.js\";\nimport { SolidParser } from \"./solidParser.js\";\n/**\n * OBJ file type loader.\n * This is a babylon scene loader plugin.\n */\nexport class OBJFileLoader {\n /**\n * Invert Y-Axis of referenced textures on load\n */\n static get INVERT_TEXTURE_Y() {\n return MTLFileLoader.INVERT_TEXTURE_Y;\n }\n static set INVERT_TEXTURE_Y(value) {\n MTLFileLoader.INVERT_TEXTURE_Y = value;\n }\n /**\n * Creates loader for .OBJ files\n *\n * @param loadingOptions options for loading and parsing OBJ/MTL files.\n */\n constructor(loadingOptions) {\n /**\n * Defines the name of the plugin.\n */\n this.name = \"obj\";\n /**\n * Defines the extension the plugin is able to load.\n */\n this.extensions = \".obj\";\n this._assetContainer = null;\n this._loadingOptions = loadingOptions || OBJFileLoader._DefaultLoadingOptions;\n }\n static get _DefaultLoadingOptions() {\n return {\n computeNormals: OBJFileLoader.COMPUTE_NORMALS,\n optimizeNormals: OBJFileLoader.OPTIMIZE_NORMALS,\n importVertexColors: OBJFileLoader.IMPORT_VERTEX_COLORS,\n invertY: OBJFileLoader.INVERT_Y,\n invertTextureY: OBJFileLoader.INVERT_TEXTURE_Y,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n UVScaling: OBJFileLoader.UV_SCALING,\n materialLoadingFailsSilently: OBJFileLoader.MATERIAL_LOADING_FAILS_SILENTLY,\n optimizeWithUV: OBJFileLoader.OPTIMIZE_WITH_UV,\n skipMaterials: OBJFileLoader.SKIP_MATERIALS,\n useLegacyBehavior: OBJFileLoader.USE_LEGACY_BEHAVIOR\n };\n }\n /**\n * Calls synchronously the MTL file attached to this obj.\n * Load function or importMesh function don't enable to load 2 files in the same time asynchronously.\n * Without this function materials are not displayed in the first frame (but displayed after).\n * In consequence it is impossible to get material information in your HTML file\n *\n * @param url The URL of the MTL file\n * @param rootUrl defines where to load data from\n * @param onSuccess Callback function to be called when the MTL file is loaded\n * @param onFailure\n */\n _loadMTL(url, rootUrl, onSuccess, onFailure) {\n //The complete path to the mtl file\n const pathOfFile = rootUrl + url;\n // Loads through the babylon tools to allow fileInput search.\n Tools.LoadFile(pathOfFile, onSuccess, undefined, undefined, false, (request, exception) => {\n onFailure(pathOfFile, exception);\n });\n }\n /**\n * Instantiates a OBJ file loader plugin.\n * @returns the created plugin\n */\n createPlugin() {\n return new OBJFileLoader(OBJFileLoader._DefaultLoadingOptions);\n }\n /**\n * If the data string can be loaded directly.\n * @returns if the data can be loaded directly\n */\n canDirectLoad() {\n return false;\n }\n /**\n * Imports one or more meshes from the loaded OBJ data and adds them to the scene\n * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file\n * @param scene the scene the meshes should be added to\n * @param data the OBJ data to load\n * @param rootUrl root url to load from\n * @returns a promise containing the loaded meshes, particles, skeletons and animations\n */\n importMeshAsync(meshesNames, scene, data, rootUrl) {\n //get the meshes from OBJ file\n return this._parseSolid(meshesNames, scene, data, rootUrl).then(meshes => {\n return {\n meshes: meshes,\n particleSystems: [],\n skeletons: [],\n animationGroups: [],\n transformNodes: [],\n geometries: [],\n lights: [],\n spriteManagers: []\n };\n });\n }\n /**\n * Imports all objects from the loaded OBJ data and adds them to the scene\n * @param scene the scene the objects should be added to\n * @param data the OBJ data to load\n * @param rootUrl root url to load from\n * @returns a promise which completes when objects have been loaded to the scene\n */\n loadAsync(scene, data, rootUrl) {\n //Get the 3D model\n return this.importMeshAsync(null, scene, data, rootUrl).then(() => {\n // return void\n });\n }\n /**\n * Load into an asset container.\n * @param scene The scene to load into\n * @param data The data to import\n * @param rootUrl The root url for scene and resources\n * @returns The loaded asset container\n */\n loadAssetContainerAsync(scene, data, rootUrl) {\n const container = new AssetContainer(scene);\n this._assetContainer = container;\n return this.importMeshAsync(null, scene, data, rootUrl).then(result => {\n result.meshes.forEach(mesh => container.meshes.push(mesh));\n result.meshes.forEach(mesh => {\n const material = mesh.material;\n if (material) {\n // Materials\n if (container.materials.indexOf(material) == -1) {\n container.materials.push(material);\n // Textures\n const textures = material.getActiveTextures();\n textures.forEach(t => {\n if (container.textures.indexOf(t) == -1) {\n container.textures.push(t);\n }\n });\n }\n }\n });\n this._assetContainer = null;\n return container;\n }).catch(ex => {\n this._assetContainer = null;\n throw ex;\n });\n }\n /**\n * Read the OBJ file and create an Array of meshes.\n * Each mesh contains all information given by the OBJ and the MTL file.\n * i.e. vertices positions and indices, optional normals values, optional UV values, optional material\n * @param meshesNames defines a string or array of strings of the mesh names that should be loaded from the file\n * @param scene defines the scene where are displayed the data\n * @param data defines the content of the obj file\n * @param rootUrl defines the path to the folder\n * @returns the list of loaded meshes\n */\n _parseSolid(meshesNames, scene, data, rootUrl) {\n let fileToLoad = \"\"; //The name of the mtlFile to load\n const materialsFromMTLFile = new MTLFileLoader();\n const materialToUse = [];\n const babylonMeshesArray = []; //The mesh for babylon\n // Main function\n const solidParser = new SolidParser(materialToUse, babylonMeshesArray, this._loadingOptions);\n solidParser.parse(meshesNames, data, scene, this._assetContainer, fileName => {\n fileToLoad = fileName;\n });\n // load the materials\n const mtlPromises = [];\n // Check if we have a file to load\n if (fileToLoad !== \"\" && !this._loadingOptions.skipMaterials) {\n //Load the file synchronously\n mtlPromises.push(new Promise((resolve, reject) => {\n this._loadMTL(fileToLoad, rootUrl, dataLoaded => {\n try {\n //Create materials thanks MTLLoader function\n materialsFromMTLFile.parseMTL(scene, dataLoaded, rootUrl, this._assetContainer);\n //Look at each material loaded in the mtl file\n for (let n = 0; n < materialsFromMTLFile.materials.length; n++) {\n //Three variables to get all meshes with the same material\n let startIndex = 0;\n const _indices = [];\n let _index;\n //The material from MTL file is used in the meshes loaded\n //Push the indice in an array\n //Check if the material is not used for another mesh\n while ((_index = materialToUse.indexOf(materialsFromMTLFile.materials[n].name, startIndex)) > -1) {\n _indices.push(_index);\n startIndex = _index + 1;\n }\n //If the material is not used dispose it\n if (_index === -1 && _indices.length === 0) {\n //If the material is not needed, remove it\n materialsFromMTLFile.materials[n].dispose();\n } else {\n for (let o = 0; o < _indices.length; o++) {\n //Apply the material to the Mesh for each mesh with the material\n const mesh = babylonMeshesArray[_indices[o]];\n const material = materialsFromMTLFile.materials[n];\n mesh.material = material;\n if (!mesh.getTotalIndices()) {\n // No indices, we need to turn on point cloud\n material.pointsCloud = true;\n }\n }\n }\n }\n resolve();\n } catch (e) {\n Tools.Warn(`Error processing MTL file: '${fileToLoad}'`);\n if (this._loadingOptions.materialLoadingFailsSilently) {\n resolve();\n } else {\n reject(e);\n }\n }\n }, (pathOfFile, exception) => {\n Tools.Warn(`Error downloading MTL file: '${fileToLoad}'`);\n if (this._loadingOptions.materialLoadingFailsSilently) {\n resolve();\n } else {\n reject(exception);\n }\n });\n }));\n }\n //Return an array with all Mesh\n return Promise.all(mtlPromises).then(() => {\n return babylonMeshesArray;\n });\n }\n}\n/**\n * Defines if UVs are optimized by default during load.\n */\nOBJFileLoader.OPTIMIZE_WITH_UV = true;\n/**\n * Invert model on y-axis (does a model scaling inversion)\n */\nOBJFileLoader.INVERT_Y = false;\n/**\n * Include in meshes the vertex colors available in some OBJ files. This is not part of OBJ standard.\n */\nOBJFileLoader.IMPORT_VERTEX_COLORS = false;\n/**\n * Compute the normals for the model, even if normals are present in the file.\n */\nOBJFileLoader.COMPUTE_NORMALS = false;\n/**\n * Optimize the normals for the model. Lighting can be uneven if you use OptimizeWithUV = true because new vertices can be created for the same location if they pertain to different faces.\n * Using OptimizehNormals = true will help smoothing the lighting by averaging the normals of those vertices.\n */\nOBJFileLoader.OPTIMIZE_NORMALS = false;\n/**\n * Defines custom scaling of UV coordinates of loaded meshes.\n */\nOBJFileLoader.UV_SCALING = new Vector2(1, 1);\n/**\n * Skip loading the materials even if defined in the OBJ file (materials are ignored).\n */\nOBJFileLoader.SKIP_MATERIALS = false;\n/**\n * When a material fails to load OBJ loader will silently fail and onSuccess() callback will be triggered.\n *\n * Defaults to true for backwards compatibility.\n */\nOBJFileLoader.MATERIAL_LOADING_FAILS_SILENTLY = true;\n/**\n * Loads assets without handedness conversions. This flag is for compatibility. Use it only if absolutely required. Defaults to false.\n */\nOBJFileLoader.USE_LEGACY_BEHAVIOR = false;\nif (SceneLoader) {\n //Add this loader into the register plugin\n SceneLoader.RegisterPlugin(new OBJFileLoader());\n}","map":{"version":3,"names":["Vector2","Tools","SceneLoader","AssetContainer","MTLFileLoader","SolidParser","OBJFileLoader","INVERT_TEXTURE_Y","value","constructor","loadingOptions","name","extensions","_assetContainer","_loadingOptions","_DefaultLoadingOptions","computeNormals","COMPUTE_NORMALS","optimizeNormals","OPTIMIZE_NORMALS","importVertexColors","IMPORT_VERTEX_COLORS","invertY","INVERT_Y","invertTextureY","UVScaling","UV_SCALING","materialLoadingFailsSilently","MATERIAL_LOADING_FAILS_SILENTLY","optimizeWithUV","OPTIMIZE_WITH_UV","skipMaterials","SKIP_MATERIALS","useLegacyBehavior","USE_LEGACY_BEHAVIOR","_loadMTL","url","rootUrl","onSuccess","onFailure","pathOfFile","LoadFile","undefined","request","exception","createPlugin","canDirectLoad","importMeshAsync","meshesNames","scene","data","_parseSolid","then","meshes","particleSystems","skeletons","animationGroups","transformNodes","geometries","lights","spriteManagers","loadAsync","loadAssetContainerAsync","container","result","forEach","mesh","push","material","materials","indexOf","textures","getActiveTextures","t","catch","ex","fileToLoad","materialsFromMTLFile","materialToUse","babylonMeshesArray","solidParser","parse","fileName","mtlPromises","Promise","resolve","reject","dataLoaded","parseMTL","n","length","startIndex","_indices","_index","dispose","o","getTotalIndices","pointsCloud","e","Warn","all","RegisterPlugin"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/loaders/OBJ/objFileLoader.js"],"sourcesContent":["import { Vector2 } from \"@babylonjs/core/Maths/math.vector.js\";\nimport { Tools } from \"@babylonjs/core/Misc/tools.js\";\nimport { SceneLoader } from \"@babylonjs/core/Loading/sceneLoader.js\";\nimport { AssetContainer } from \"@babylonjs/core/assetContainer.js\";\nimport { MTLFileLoader } from \"./mtlFileLoader.js\";\nimport { SolidParser } from \"./solidParser.js\";\n/**\n * OBJ file type loader.\n * This is a babylon scene loader plugin.\n */\nexport class OBJFileLoader {\n /**\n * Invert Y-Axis of referenced textures on load\n */\n static get INVERT_TEXTURE_Y() {\n return MTLFileLoader.INVERT_TEXTURE_Y;\n }\n static set INVERT_TEXTURE_Y(value) {\n MTLFileLoader.INVERT_TEXTURE_Y = value;\n }\n /**\n * Creates loader for .OBJ files\n *\n * @param loadingOptions options for loading and parsing OBJ/MTL files.\n */\n constructor(loadingOptions) {\n /**\n * Defines the name of the plugin.\n */\n this.name = \"obj\";\n /**\n * Defines the extension the plugin is able to load.\n */\n this.extensions = \".obj\";\n this._assetContainer = null;\n this._loadingOptions = loadingOptions || OBJFileLoader._DefaultLoadingOptions;\n }\n static get _DefaultLoadingOptions() {\n return {\n computeNormals: OBJFileLoader.COMPUTE_NORMALS,\n optimizeNormals: OBJFileLoader.OPTIMIZE_NORMALS,\n importVertexColors: OBJFileLoader.IMPORT_VERTEX_COLORS,\n invertY: OBJFileLoader.INVERT_Y,\n invertTextureY: OBJFileLoader.INVERT_TEXTURE_Y,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n UVScaling: OBJFileLoader.UV_SCALING,\n materialLoadingFailsSilently: OBJFileLoader.MATERIAL_LOADING_FAILS_SILENTLY,\n optimizeWithUV: OBJFileLoader.OPTIMIZE_WITH_UV,\n skipMaterials: OBJFileLoader.SKIP_MATERIALS,\n useLegacyBehavior: OBJFileLoader.USE_LEGACY_BEHAVIOR,\n };\n }\n /**\n * Calls synchronously the MTL file attached to this obj.\n * Load function or importMesh function don't enable to load 2 files in the same time asynchronously.\n * Without this function materials are not displayed in the first frame (but displayed after).\n * In consequence it is impossible to get material information in your HTML file\n *\n * @param url The URL of the MTL file\n * @param rootUrl defines where to load data from\n * @param onSuccess Callback function to be called when the MTL file is loaded\n * @param onFailure\n */\n _loadMTL(url, rootUrl, onSuccess, onFailure) {\n //The complete path to the mtl file\n const pathOfFile = rootUrl + url;\n // Loads through the babylon tools to allow fileInput search.\n Tools.LoadFile(pathOfFile, onSuccess, undefined, undefined, false, (request, exception) => {\n onFailure(pathOfFile, exception);\n });\n }\n /**\n * Instantiates a OBJ file loader plugin.\n * @returns the created plugin\n */\n createPlugin() {\n return new OBJFileLoader(OBJFileLoader._DefaultLoadingOptions);\n }\n /**\n * If the data string can be loaded directly.\n * @returns if the data can be loaded directly\n */\n canDirectLoad() {\n return false;\n }\n /**\n * Imports one or more meshes from the loaded OBJ data and adds them to the scene\n * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file\n * @param scene the scene the meshes should be added to\n * @param data the OBJ data to load\n * @param rootUrl root url to load from\n * @returns a promise containing the loaded meshes, particles, skeletons and animations\n */\n importMeshAsync(meshesNames, scene, data, rootUrl) {\n //get the meshes from OBJ file\n return this._parseSolid(meshesNames, scene, data, rootUrl).then((meshes) => {\n return {\n meshes: meshes,\n particleSystems: [],\n skeletons: [],\n animationGroups: [],\n transformNodes: [],\n geometries: [],\n lights: [],\n spriteManagers: [],\n };\n });\n }\n /**\n * Imports all objects from the loaded OBJ data and adds them to the scene\n * @param scene the scene the objects should be added to\n * @param data the OBJ data to load\n * @param rootUrl root url to load from\n * @returns a promise which completes when objects have been loaded to the scene\n */\n loadAsync(scene, data, rootUrl) {\n //Get the 3D model\n return this.importMeshAsync(null, scene, data, rootUrl).then(() => {\n // return void\n });\n }\n /**\n * Load into an asset container.\n * @param scene The scene to load into\n * @param data The data to import\n * @param rootUrl The root url for scene and resources\n * @returns The loaded asset container\n */\n loadAssetContainerAsync(scene, data, rootUrl) {\n const container = new AssetContainer(scene);\n this._assetContainer = container;\n return this.importMeshAsync(null, scene, data, rootUrl)\n .then((result) => {\n result.meshes.forEach((mesh) => container.meshes.push(mesh));\n result.meshes.forEach((mesh) => {\n const material = mesh.material;\n if (material) {\n // Materials\n if (container.materials.indexOf(material) == -1) {\n container.materials.push(material);\n // Textures\n const textures = material.getActiveTextures();\n textures.forEach((t) => {\n if (container.textures.indexOf(t) == -1) {\n container.textures.push(t);\n }\n });\n }\n }\n });\n this._assetContainer = null;\n return container;\n })\n .catch((ex) => {\n this._assetContainer = null;\n throw ex;\n });\n }\n /**\n * Read the OBJ file and create an Array of meshes.\n * Each mesh contains all information given by the OBJ and the MTL file.\n * i.e. vertices positions and indices, optional normals values, optional UV values, optional material\n * @param meshesNames defines a string or array of strings of the mesh names that should be loaded from the file\n * @param scene defines the scene where are displayed the data\n * @param data defines the content of the obj file\n * @param rootUrl defines the path to the folder\n * @returns the list of loaded meshes\n */\n _parseSolid(meshesNames, scene, data, rootUrl) {\n let fileToLoad = \"\"; //The name of the mtlFile to load\n const materialsFromMTLFile = new MTLFileLoader();\n const materialToUse = [];\n const babylonMeshesArray = []; //The mesh for babylon\n // Main function\n const solidParser = new SolidParser(materialToUse, babylonMeshesArray, this._loadingOptions);\n solidParser.parse(meshesNames, data, scene, this._assetContainer, (fileName) => {\n fileToLoad = fileName;\n });\n // load the materials\n const mtlPromises = [];\n // Check if we have a file to load\n if (fileToLoad !== \"\" && !this._loadingOptions.skipMaterials) {\n //Load the file synchronously\n mtlPromises.push(new Promise((resolve, reject) => {\n this._loadMTL(fileToLoad, rootUrl, (dataLoaded) => {\n try {\n //Create materials thanks MTLLoader function\n materialsFromMTLFile.parseMTL(scene, dataLoaded, rootUrl, this._assetContainer);\n //Look at each material loaded in the mtl file\n for (let n = 0; n < materialsFromMTLFile.materials.length; n++) {\n //Three variables to get all meshes with the same material\n let startIndex = 0;\n const _indices = [];\n let _index;\n //The material from MTL file is used in the meshes loaded\n //Push the indice in an array\n //Check if the material is not used for another mesh\n while ((_index = materialToUse.indexOf(materialsFromMTLFile.materials[n].name, startIndex)) > -1) {\n _indices.push(_index);\n startIndex = _index + 1;\n }\n //If the material is not used dispose it\n if (_index === -1 && _indices.length === 0) {\n //If the material is not needed, remove it\n materialsFromMTLFile.materials[n].dispose();\n }\n else {\n for (let o = 0; o < _indices.length; o++) {\n //Apply the material to the Mesh for each mesh with the material\n const mesh = babylonMeshesArray[_indices[o]];\n const material = materialsFromMTLFile.materials[n];\n mesh.material = material;\n if (!mesh.getTotalIndices()) {\n // No indices, we need to turn on point cloud\n material.pointsCloud = true;\n }\n }\n }\n }\n resolve();\n }\n catch (e) {\n Tools.Warn(`Error processing MTL file: '${fileToLoad}'`);\n if (this._loadingOptions.materialLoadingFailsSilently) {\n resolve();\n }\n else {\n reject(e);\n }\n }\n }, (pathOfFile, exception) => {\n Tools.Warn(`Error downloading MTL file: '${fileToLoad}'`);\n if (this._loadingOptions.materialLoadingFailsSilently) {\n resolve();\n }\n else {\n reject(exception);\n }\n });\n }));\n }\n //Return an array with all Mesh\n return Promise.all(mtlPromises).then(() => {\n return babylonMeshesArray;\n });\n }\n}\n/**\n * Defines if UVs are optimized by default during load.\n */\nOBJFileLoader.OPTIMIZE_WITH_UV = true;\n/**\n * Invert model on y-axis (does a model scaling inversion)\n */\nOBJFileLoader.INVERT_Y = false;\n/**\n * Include in meshes the vertex colors available in some OBJ files. This is not part of OBJ standard.\n */\nOBJFileLoader.IMPORT_VERTEX_COLORS = false;\n/**\n * Compute the normals for the model, even if normals are present in the file.\n */\nOBJFileLoader.COMPUTE_NORMALS = false;\n/**\n * Optimize the normals for the model. Lighting can be uneven if you use OptimizeWithUV = true because new vertices can be created for the same location if they pertain to different faces.\n * Using OptimizehNormals = true will help smoothing the lighting by averaging the normals of those vertices.\n */\nOBJFileLoader.OPTIMIZE_NORMALS = false;\n/**\n * Defines custom scaling of UV coordinates of loaded meshes.\n */\nOBJFileLoader.UV_SCALING = new Vector2(1, 1);\n/**\n * Skip loading the materials even if defined in the OBJ file (materials are ignored).\n */\nOBJFileLoader.SKIP_MATERIALS = false;\n/**\n * When a material fails to load OBJ loader will silently fail and onSuccess() callback will be triggered.\n *\n * Defaults to true for backwards compatibility.\n */\nOBJFileLoader.MATERIAL_LOADING_FAILS_SILENTLY = true;\n/**\n * Loads assets without handedness conversions. This flag is for compatibility. Use it only if absolutely required. Defaults to false.\n */\nOBJFileLoader.USE_LEGACY_BEHAVIOR = false;\nif (SceneLoader) {\n //Add this loader into the register plugin\n SceneLoader.RegisterPlugin(new OBJFileLoader());\n}\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,sCAAsC;AAC9D,SAASC,KAAK,QAAQ,+BAA+B;AACrD,SAASC,WAAW,QAAQ,wCAAwC;AACpE,SAASC,cAAc,QAAQ,mCAAmC;AAClE,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,WAAW,QAAQ,kBAAkB;AAC9C;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,CAAC;EACvB;AACJ;AACA;EACI,WAAWC,gBAAgBA,CAAA,EAAG;IAC1B,OAAOH,aAAa,CAACG,gBAAgB;EACzC;EACA,WAAWA,gBAAgBA,CAACC,KAAK,EAAE;IAC/BJ,aAAa,CAACG,gBAAgB,GAAGC,KAAK;EAC1C;EACA;AACJ;AACA;AACA;AACA;EACIC,WAAWA,CAACC,cAAc,EAAE;IACxB;AACR;AACA;IACQ,IAAI,CAACC,IAAI,GAAG,KAAK;IACjB;AACR;AACA;IACQ,IAAI,CAACC,UAAU,GAAG,MAAM;IACxB,IAAI,CAACC,eAAe,GAAG,IAAI;IAC3B,IAAI,CAACC,eAAe,GAAGJ,cAAc,IAAIJ,aAAa,CAACS,sBAAsB;EACjF;EACA,WAAWA,sBAAsBA,CAAA,EAAG;IAChC,OAAO;MACHC,cAAc,EAAEV,aAAa,CAACW,eAAe;MAC7CC,eAAe,EAAEZ,aAAa,CAACa,gBAAgB;MAC/CC,kBAAkB,EAAEd,aAAa,CAACe,oBAAoB;MACtDC,OAAO,EAAEhB,aAAa,CAACi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C,CAAC,CAAC;AACnD","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}