// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("exports ../../Graphic ../../core/Logger ../../core/MapUtils ../../geometry/Extent ../../geometry/Mesh ../../geometry/Point ../../geometry/SpatialReference ../../geometry/support/MeshTransform ../../geometry/support/meshUtils/External ../../layers/support/infoFor3D ./FeatureSet".split(" "),function(l,v,w,n,x,p,y,z,A,q,B,C){function D(a){return({attributes:b})=>{if(!b)return{};if(!a)return b;for(const c in b)a.has(c)||delete b[c];return b}}function r(a,b,c,f,d){var g=d.get(a.attributes[b]); if(null==g||!a.geometry)return null;b=E(a,c,f);d=x.fromJSON(a.geometry);d.spatialReference=c;a=F(a.attributes,f);c=c.isGeographic?"local":"georeferenced";a:{g=Array.from(g.files.values());f=[];for(e of g){if(e.status!==k.COMPLETED){var e=null;break a}g=[];for(const h of e.parts){if(!h){e=null;break a}g.push(new q.ServiceAssetPart(h.url,h.hash))}f.push(new q.ServiceAsset(e.name,e.mimeType,g))}e=f}return e?p.createWithExternalSource(b,e,{extent:d,transform:a,vertexSpace:c}):p.createIncomplete(b,{extent:d, transform:a,vertexSpace:c})}function E({attributes:a},b,{transformFieldRoles:c}){return new y({x:a[c.originX],y:a[c.originY],z:a[c.originZ],spatialReference:b})}function F(a,{transformFieldRoles:b}){return new A({translation:[a[b.translationX],-a[b.translationZ],a[b.translationY]],rotationAxis:[a[b.rotationX],-a[b.rotationZ],a[b.rotationY]],rotationAngle:a[b.rotationDeg],scale:[a[b.scaleX],a[b.scaleZ],a[b.scaleY]]})}function t(a,b){const c=new Map;for(const d of b){var f=d.parentGlobalId;if(null== f)continue;const g=d.assetName,e=d.assetType;b=d.assetHash;const h=d.assetURL,G=d.conversionStatus,H=d.seqNo,u=B.getFormatIdMimeType(e,a.supportedFormats);u?(f=n.getOrCreateMapValue(c,f,()=>({files:new Map})),n.getOrCreateMapValue(f.files,g,()=>{a:switch(G){case "COMPLETED":case "SUBMITTED":var m=k.COMPLETED;break a;case "INPROGRESS":m=k.PENDING;break a;default:m=k.FAILED}return{name:g,type:e,mimeType:u,status:m,parts:[]}}).parts[H]={hash:b,url:h}):w.getLogger("esri.rest.support.meshFeatureSet").error("mesh-feature-set:unknown-format", `Service returned an asset of type ${e}, but it does not list it as a supported type`)}return c}var k;(function(a){a[a.FAILED=0]="FAILED";a[a.PENDING=1]="PENDING";a[a.COMPLETED=2]="COMPLETED"})(k||={});l.assetMapFromAssetMapsJSON=t;l.extractMesh=r;l.meshFeatureSetFromJSON=function(a,b,c){var f=c.features;c.features=[];delete c.geometryType;const d=C.fromJSON(c);d.geometryType="mesh";if(!c.assetMaps)return d;const g=t(b,c.assetMaps),e=a.sourceSpatialReference??z.WGS84;c=c.globalIdFieldName;({outFields:a}= a);a=null!=a&&0({});for(const h of f)f=r(h,c,e,b,g),d.features.push(new v({geometry:f,attributes:a(h)}));return d};Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});