/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import t from"../DisplayEntity.js";import{LabelMetric as e}from"../collisions/LabelMetric.js";import{unpackDataView as i}from"../shaderGraph/techniques/mesh/dataViewUtils.js";import r from"../util/Reader.js";import{deserializeList as o}from"../util/serializationUtils.js";function s(e){if(!e)return null;return{entities:o(new r(e.entities),t),vertexData:e.data.map(a)}}function a(t){const s=t.layout.stride,a=new DataView(t.vertices),n=[],c=t.vertices.byteLength/s;let l=0;for(let e=0;e<c;e++){const e={};for(const r of t.layout.attributes){let t=`${r.offset} ${r.name}`,o=i(a,r,l);if(r.packPrecisionFactor)if(t+=` (precision: ${r.packPrecisionFactor})`,"number"==typeof o)o/=r.packPrecisionFactor;else for(let e=0;e<o.length;e++)o[e]/=r.packPrecisionFactor;e[t]=o}l+=s,n.push(e)}const f=t.metrics?o(new r(t.metrics),e)??[]:[];return{vertices:n,layout:t.layout,metrics:f}}export{s as debugMeshDataInfo};
