@arcgis/core 4.34.0-next.21 → 4.34.0-next.23

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 (143) hide show
  1. package/applications/Components/arcadeFeatureUtils.d.ts +5 -0
  2. package/applications/Components/arcadeFeatureUtils.js +5 -0
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{bcaf6edf887e4afbbdd2.js → 02dc6e31b1244e5bb785.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{871fae52d2fddc9e7794.js → 04c17957c15234ca0321.js} +1 -1
  6. package/assets/esri/core/workers/chunks/084236ca316aad980192.js +1 -0
  7. package/assets/esri/core/workers/chunks/0b484224a92b52c34330.js +1 -0
  8. package/assets/esri/core/workers/chunks/{822b32aaeec05a347c84.js → 0ba6177ba118a0f032e2.js} +1 -1
  9. package/assets/esri/core/workers/chunks/0f6203ae32663b2b52db.js +1 -0
  10. package/assets/esri/core/workers/chunks/12723e79b996969e304e.js +1 -0
  11. package/assets/esri/core/workers/chunks/{bd7b985f7962b1cc7b8a.js → 146520d263b910b5bdc7.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{445ddf57d2f503a0b98b.js → 15064c3b21b325d5c2f6.js} +1 -1
  13. package/assets/esri/core/workers/chunks/19ae76283a0cb0fe4dee.js +346 -0
  14. package/assets/esri/core/workers/chunks/{82a5000296134834d1ac.js → 1d75cb1747ffb7b8b050.js} +1 -1
  15. package/assets/esri/core/workers/chunks/20bcd2e6cf02e057ad7d.js +1 -0
  16. package/assets/esri/core/workers/chunks/{55ce214a10fb6fc2e901.js → 24fe862b607ec927e07f.js} +1 -1
  17. package/assets/esri/core/workers/chunks/30fae1f066dc3cd781f1.js +1 -0
  18. package/assets/esri/core/workers/chunks/{7ec73f63929b1623de72.js → 3793f282ddaccd3465f2.js} +1 -1
  19. package/assets/esri/core/workers/chunks/3fcd73ba832cb53d3a07.js +1 -0
  20. package/assets/esri/core/workers/chunks/{5e7f35bf1aab93cb1c52.js → 4cea5170939c8d363ef7.js} +1 -1
  21. package/assets/esri/core/workers/chunks/5253cca467fe9bc0a210.js +1 -0
  22. package/assets/esri/core/workers/chunks/{735d96d2b951cc1df3a3.js → 576e408fb0834f3948e8.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{27c9d3f6cebca087a123.js → 6136bf09950adc46bc33.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{dfd9ac2e28c96900c53e.js → 6c33ecffbc783cb8f944.js} +1 -1
  25. package/assets/esri/core/workers/chunks/6ca764b4baadef5c1515.js +1 -0
  26. package/assets/esri/core/workers/chunks/{fcdf714339060731fe1c.js → 7051bcc178eb512819f6.js} +1 -1
  27. package/assets/esri/core/workers/chunks/7cfba5cec425221962e8.js +1 -0
  28. package/assets/esri/core/workers/chunks/{3a753ce4de2e6ad40f7b.js → 86d6007c45f2aa643ac8.js} +1 -1
  29. package/assets/esri/core/workers/chunks/92ad9098006568358550.js +1 -0
  30. package/assets/esri/core/workers/chunks/{2ed698579befe73caafd.js → 94d75f3b215e3bd1b4d7.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{15d1ab71aaf6bcf3145b.js → a7a5b89c2bb69f3af59c.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{1d9e44bdd129cc682ae5.js → ac93b3f1ff15a95d926c.js} +1 -1
  33. package/assets/esri/core/workers/chunks/b4512d62b6cb26fc6b25.js +1 -0
  34. package/assets/esri/core/workers/chunks/{63e984a65ee670449a4a.js → b4bb461955a4c2bce072.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{abc75c945f3cfb1629b0.js → ba5b24beebeb703b5919.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{51afd0e71df1825d7593.js → c64fa94cba71ba2794e2.js} +1 -1
  37. package/assets/esri/core/workers/chunks/c94cc026c4ed330408fb.js +1 -0
  38. package/assets/esri/core/workers/chunks/cab1a1067f44ce374673.js +1 -0
  39. package/assets/esri/core/workers/chunks/{3f4a8c874c022dace9be.js → d1b363c418a67b087306.js} +1 -1
  40. package/assets/esri/core/workers/chunks/d45383d76ba99718b6d9.js +1 -0
  41. package/assets/esri/core/workers/chunks/{8b19fe829a9dc26fb3fe.js → d915d0a30d9beb24bd3a.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{bbca1b85656d9ba71e4c.js → def8a854a05f17d3538e.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{273ff53a68714e4daad5.js → e49a135a2933306a6105.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{d31fa648497b0af97dc1.js → e9a9174c4d1a0a9effb6.js} +1 -1
  45. package/assets/esri/core/workers/chunks/f3d5d92e0aefc2593208.js +1 -0
  46. package/assets/esri/core/workers/chunks/{fc8bbc571216edd9ef5a.js → f3e3c2340452c1d60c95.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{85b0e2a898251d048dda.js → f42155b7a4e6c5e80757.js} +1 -1
  48. package/assets/esri/core/workers/chunks/f43110391f124b8a179c.js +1009 -0
  49. package/assets/esri/core/workers/chunks/f90573c9dc36e51cd588.js +1 -0
  50. package/assets/esri/core/workers/chunks/{080a8a1c6fe2d215142d.js → fb5e2b1ced03eef28e96.js} +1 -1
  51. package/assets/esri/core/workers/chunks/fe73e74e3e4278aedcc3.js +1 -0
  52. package/config.js +1 -1
  53. package/core/Clonable.js +1 -1
  54. package/core/lang.js +1 -1
  55. package/geometry/Mesh.js +1 -1
  56. package/geometry/support/MeshComponent.js +1 -1
  57. package/geometry/support/MeshMaterial.js +1 -1
  58. package/geometry/support/MeshMaterialMetallicRoughness.js +1 -1
  59. package/geometry/support/MeshTexture.js +1 -1
  60. package/geometry/support/MeshTransform.js +1 -1
  61. package/geometry/support/MeshVertexAttributes.js +1 -1
  62. package/geometry/support/meshUtils/convertMeshVertexSpace.js +1 -1
  63. package/geometry/support/meshUtils/merge.js +1 -1
  64. package/geometry/support/meshUtils/meshCloneUtils.js +5 -0
  65. package/interfaces.d.ts +183 -41
  66. package/kernel.js +1 -1
  67. package/layers/VideoLayer.js +1 -1
  68. package/layers/support/SceneModification.js +1 -1
  69. package/layers/support/SceneModifications.js +1 -1
  70. package/layers/support/rasterDatasets/MRFRaster.js +1 -1
  71. package/layers/video/videoUtils.js +1 -1
  72. package/libs/basisu/BasisUEncoder.js +1 -1
  73. package/libs/dxtEncoder/DXTEncoder.js +1 -1
  74. package/libs/i3s/I3SModule.js +1 -1
  75. package/networks/support/utils.js +1 -1
  76. package/package.json +1 -1
  77. package/rest/knowledgeGraph/GraphAddFieldIndexResult.js +1 -1
  78. package/rest/knowledgeGraph/GraphAddNamedTypesResult.js +1 -1
  79. package/rest/knowledgeGraph/GraphAddPropertyResult.js +1 -1
  80. package/rest/knowledgeGraph/GraphDataModelOperationResult.d.ts +1 -1
  81. package/rest/knowledgeGraph/GraphDataModelOperationResult.js +1 -1
  82. package/rest/knowledgeGraph/GraphDeleteFieldIndexResult.js +1 -1
  83. package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.js +1 -1
  84. package/rest/knowledgeGraph/GraphDeletePropertyResult.js +1 -1
  85. package/rest/knowledgeGraph/GraphUpdateNamedTypesResult.js +1 -1
  86. package/rest/knowledgeGraph/GraphUpdatePropertyResult.js +1 -1
  87. package/rest/knowledgeGraph/GraphUpdateSearchIndexResult.js +1 -1
  88. package/support/revision.js +1 -1
  89. package/views/2d/layers/VideoLayerView2D.js +1 -1
  90. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  91. package/views/3d/layers/SceneLayerWorker.js +1 -1
  92. package/views/3d/state/GoToOperation.js +1 -1
  93. package/views/3d/state/ViewStateManager.js +1 -1
  94. package/views/3d/support/cameraUtils.js +1 -1
  95. package/views/3d/support/viewingModeUtils.js +5 -0
  96. package/views/3d/support/viewpointUtils.js +1 -1
  97. package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
  98. package/views/3d/terrain/OverlayManager.js +1 -1
  99. package/views/3d/terrain/OverlayRenderTargets.js +1 -1
  100. package/views/3d/terrain/OverlayRenderer.js +1 -1
  101. package/views/3d/webgl/ManagedFBOResource.js +1 -1
  102. package/views/3d/webgl.d.ts +2 -0
  103. package/views/3d/webgl.js +1 -1
  104. package/views/VideoView.js +1 -1
  105. package/views/draw/DrawScreenTool.js +1 -1
  106. package/views/support/TextureCompressionHelper.js +1 -1
  107. package/views/support/TextureCompressionWorker.js +1 -1
  108. package/views/support/TextureCompressionWorkerHandle.js +1 -1
  109. package/views/support/layerViewUtils.js +1 -1
  110. package/widgets/BatchAttributeForm/inputs/EditableInput.js +1 -1
  111. package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
  112. package/widgets/BatchAttributeForm/inputs/InputBase.d.ts +1 -1
  113. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  114. package/widgets/Editor/Edits.js +1 -1
  115. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  116. package/widgets/Feature/FeatureViewModel.js +1 -1
  117. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  118. package/widgets/OrientedImageryViewer.js +1 -1
  119. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  120. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
  121. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  122. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  123. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
  124. package/assets/esri/core/workers/chunks/06c3725d6cc21e7e4bcf.js +0 -1
  125. package/assets/esri/core/workers/chunks/0f5643d5437f48c63225.js +0 -1
  126. package/assets/esri/core/workers/chunks/1c7393bcd6e85ba25e1b.js +0 -1
  127. package/assets/esri/core/workers/chunks/2a784da5fa3f502d1803.js +0 -1
  128. package/assets/esri/core/workers/chunks/2e3f620c79ec04033a6e.js +0 -1
  129. package/assets/esri/core/workers/chunks/48953ddf0bbcf3d77e04.js +0 -1
  130. package/assets/esri/core/workers/chunks/5b7464137aacf1c5fd78.js +0 -1
  131. package/assets/esri/core/workers/chunks/7925e8ffa8027b59410e.js +0 -1
  132. package/assets/esri/core/workers/chunks/8235a997acb45ab43173.js +0 -1
  133. package/assets/esri/core/workers/chunks/8fa6c938e8dc7bbfaeb7.js +0 -1
  134. package/assets/esri/core/workers/chunks/9d2cb559dd9af4e1727c.js +0 -1
  135. package/assets/esri/core/workers/chunks/9eb1a171f5ef1fef42ed.js +0 -346
  136. package/assets/esri/core/workers/chunks/bac5e1d50b69f0d94694.js +0 -1
  137. package/assets/esri/core/workers/chunks/bcefb413d03d59506b5a.js +0 -1009
  138. package/assets/esri/core/workers/chunks/c317819ab0544c50c078.js +0 -1
  139. package/assets/esri/core/workers/chunks/c96fed4889712f5a9135.js +0 -1
  140. package/assets/esri/core/workers/chunks/cb4c49d5b70f9563bc46.js +0 -1
  141. package/assets/esri/core/workers/chunks/e9aa1d9ded8a52a40c57.js +0 -1
  142. package/assets/esri/core/workers/chunks/f65ad6a41c0c69bf1b21.js +0 -1
  143. package/assets/esri/core/workers/chunks/f806e9221dff7fcfc2f9.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../chunks/tslib.es6.js";import o from"../../request.js";import t from"../../core/Collection.js";import e from"../../core/JSONSupport.js";import{urlToObject as s}from"../../core/urlUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import p from"./SceneModification.js";var m;let n=m=class extends(e.JSONSupportMixin(t.ofType(p))){constructor(r){super(r),this.url=null}clone(){return new m({url:this.url,items:this.items.map(r=>r.clone())})}toJSON(r){return this.toArray().map(o=>o.toJSON(r)).filter(r=>!!r.geometry)}static fromJSON(r,o){const t=new m;for(const e of r)t.add(p.fromJSON(e,o));return t}static async fromUrl(r,t,e){const i={url:s(r),origin:"service"},c=await o(r,{responseType:"json",signal:e?.signal}),n=t.toJSON(),a=[];for(const o of c.data)a.push(p.fromJSON({...o,geometry:{...o.geometry,spatialReference:n}},i));return new m({url:r,items:a})}};r([i({type:String})],n.prototype,"url",void 0),n=m=r([c("esri.layers.support.SceneModifications")],n);export{n as default};
5
+ import{_ as r}from"../../chunks/tslib.es6.js";import o from"../../request.js";import t from"../../core/Collection.js";import e from"../../core/JSONSupport.js";import{urlToObject as s}from"../../core/urlUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import p from"./SceneModification.js";var m;let n=m=class extends(e.JSONSupportMixin(t.ofType(p))){constructor(r){super(r),this.url=null}clone(){return new m({url:this.url,items:this.items.map(r=>r.clone())})}toJSON(r){return this.toArray().map(o=>o.toJSON(r)).filter(r=>!!r.geometry)}static fromJSON(r,o){const t=new m;for(const e of r)t.add(p.fromJSON(e,o));return t}static async fromUrl(r,t,e){const i={url:s(r),origin:"service"},c=await o(r,{responseType:"json",signal:e?.signal}),n=t.toJSON(),a=[];for(const o of c.data)a.push(p.fromJSON({...o,geometry:{spatialReference:n,...o.geometry}},i));return new m({url:r,items:a})}};r([i({type:String})],n.prototype,"url",void 0),n=m=r([c("esri.layers.support.SceneModifications")],n);export{n as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Error.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../geometry/Extent.js";import a from"../../../geometry/Point.js";import i from"../../../geometry/SpatialReference.js";import n from"../PixelBlock.js";import l from"../RasterInfo.js";import f from"../RasterStorageInfo.js";import c from"./BaseRaster.js";import{parseSpatialReference as p,parsePAMInfo as m}from"./pamParser.js";import{getElement as h,getElementValue as u}from"./xmlUtilities.js";import{isPlatformLittleEndian as g}from"../rasterFormats/utils.js";import{estimateStatisticsFromHistograms as d}from"../rasterFunctions/stretchUtils.js";const y=new Map;y.set("Int8","s8"),y.set("UInt8","u8"),y.set("Int16","s16"),y.set("UInt16","u16"),y.set("Int32","s32"),y.set("UInt32","u32"),y.set("Float32","f32"),y.set("Float64","f32"),y.set("Double64","f32");const x=new Map;x.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),x.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),x.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),x.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let w=class extends c{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(t,e,r,s={}){const{blockWidth:o,blockHeight:a,blockBoundary:i}=this.rasterInfo.storageInfo,l=i[t];if(!l||l.maxRow<e||l.maxCol<r||l.minRow>e||l.minCol>r)return null;const{bandCount:f,pixelType:c}=this.rasterInfo,{ranges:p,actualTileWidth:m,actualTileHeight:h}=this._getTileLocation(t,e,r);if(!p||0===p.length)return null;if(0===p[0].from&&0===p[0].to){const t=new Uint8Array(o*a);return new n({width:o,height:a,pixels:void 0,mask:t,validPixelCount:0})}const{bandIds:u}=this.ioConfig,g=this._getBandSegmentCount(),d=[];let y=0;for(y=0;y<g;y++)u&&!u.includes(y)||d.push(this.request(this._files.data,{range:{from:p[y].from,to:p[y].to},responseType:"array-buffer",signal:s.signal}));const w=await Promise.all(d),I=w.map(t=>t.data.byteLength).reduce((t,e)=>t+e),b=new Uint8Array(I),R=[];let A=0;for(y=0;y<g;y++)R.push(A),b.set(new Uint8Array(w[y].data),A),A+=w[y].data.byteLength;const F=x.get(this.rasterInfo.storageInfo.compression).decoderFormat,_=await this.decodePixelBlock(b.buffer,{width:o,height:a,format:F,planes:u?.length||f,offsets:R,pixelType:c});if(null==_)return null;let{noDataValue:S}=this.rasterInfo;if(null!=S&&"lerc"!==F&&!_.mask&&(S=S[0],null!=S)){const t=_.width*_.height,e=new Uint8Array(t);if(Math.abs(S)>1e24)for(y=0;y<t;y++)Math.abs((_.pixels[0][y]-S)/S)>1e-6&&(e[y]=1);else for(y=0;y<t;y++)_.pixels[0][y]!==S&&(e[y]=1);_.mask=e}let k=0,M=0;if(m!==o||h!==a){let t=_.mask;if(t)for(y=0;y<a;y++)if(M=y*o,y<h)for(k=m;k<o;k++)t[M+k]=0;else for(k=0;k<o;k++)t[M+k]=0;else for(t=new Uint8Array(o*a),_.mask=t,y=0;y<h;y++)for(M=y*o,k=0;k<m;k++)t[M+k]=1}return _}async _open(t){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const e=t?t.signal:null,r=await this.request(this.url,{responseType:"xml",signal:e}),{rasterInfo:s,files:o}=this._parseHeader(r.data),{skipMapInfo:a,skipExtensions:i=[]}=this.ioConfig;if(!i.includes("aux.xml")&&!a){const e=await this._fetchAuxiliaryData(t);null!=e&&(s.statistics=e.statistics??s.statistics,s.histograms=e.histograms,e.histograms&&null==s.statistics&&(s.statistics=d(e.histograms)))}a&&this.updateImageSpaceRasterInfo(s),this._set("rasterInfo",s),this._files=o;const n=await this.request(o.index,{responseType:"array-buffer",signal:e});this._storageIndex=I(n.data);const{blockWidth:l,blockHeight:f}=this.rasterInfo.storageInfo,c=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:p,height:m}=this.rasterInfo,h=[],u=this._getBandSegmentCount();let g=0,y=-1;for(;g<this._storageIndex.length;){y++;const t=Math.ceil(p/l/c**y)-1,e=Math.ceil(m/f/c**y)-1;g+=(t+1)*(e+1)*u*4,h.push({maxRow:e,maxCol:t,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=h,y>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=y),this.updateTileInfo()}_getBandSegmentCount(){return x.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(t,e,r){const{blockWidth:s,blockHeight:o,pyramidScalingFactor:a}=this.rasterInfo.storageInfo,{width:i,height:n}=this.rasterInfo,l=this._getBandSegmentCount();let f,c,p,m=0,h=0;for(p=0;p<t;p++)h=a**p,f=Math.ceil(i/s/h),c=Math.ceil(n/o/h),m+=f*c;h=a**t,f=Math.ceil(i/s/h),c=Math.ceil(n/o/h),m+=e*f+r,m*=4*l;const u=this._storageIndex.subarray(m,m+4*l);let g=0,d=0;const y=[];for(let x=0;x<l;x++)g=u[4*x]*2**32+u[4*x+1],d=g+u[4*x+2]*2**32+u[4*x+3],y.push({from:g,to:d});return{ranges:y,actualTileWidth:r<f-1?s:Math.ceil(i/h)-s*(f-1),actualTileHeight:e<c-1?o:Math.ceil(n/h)-o*(c-1)}}_parseHeader(t){const r=h(t,"MRF_META/Raster");if(!r)throw new e("mrf:open","not a valid MRF format");const s=h(r,"Size"),n=parseInt(s.getAttribute("x"),10),c=parseInt(s.getAttribute("y"),10),m=parseInt(s.getAttribute("c"),10),g=(u(r,"Compression")||"none").toLowerCase();if(!x.has(g))throw new e("mrf:open","currently does not support compression "+g);const d=u(r,"DataType")||"UInt8",w=y.get(d);if(null==w)throw new e("mrf:open","currently does not support pixel type "+d);const I=h(r,"PageSize"),b=parseInt(I.getAttribute("x"),10),R=parseInt(I.getAttribute("y"),10),A=h(r,"DataValues");let F,_;A&&(_=A.getAttribute("NoData"),null!=_&&(F=_.trim().split(" ").map(t=>parseFloat(t))));if(h(t,"MRF_META/CachedSource"))throw new e("mrf:open","currently does not support MRF referencing other data files");const S=h(t,"MRF_META/GeoTags"),k=h(S,"BoundingBox");let M,j=!1;if(null!=k){const t=parseFloat(k.getAttribute("minx")),e=parseFloat(k.getAttribute("miny")),r=parseFloat(k.getAttribute("maxx")),s=parseFloat(k.getAttribute("maxy")),a=u(S,"Projection")||"";let n=i.WGS84;if("LOCAL_CS[]"!==a)if(a.toLowerCase().startsWith("epsg:")){const t=Number(a.slice(5));isNaN(t)||0===t||(n=new i({wkid:t}))}else n=p(a)??i.WGS84;else j=!0,n=new i({wkid:3857});M=new o(t,e,r,s),M.spatialReference=n}else j=!0,M=new o({xmin:-.5,ymin:.5-c,xmax:n-.5,ymax:.5,spatialReference:new i({wkid:3857})});const C=h(t,"MRF_META/Rsets"),T=parseInt(C?.getAttribute("scale")||"2",10),L=M.spatialReference,U=new f({origin:new a({x:M.xmin,y:M.ymax,spatialReference:L}),blockWidth:b,blockHeight:R,pyramidBlockWidth:b,pyramidBlockHeight:R,compression:g,pyramidScalingFactor:T}),B=new a({x:M.width/n,y:M.height/c,spatialReference:L}),E=new l({width:n,height:c,extent:M,isPseudoSpatialReference:j,spatialReference:L,bandCount:m,pixelType:w,pixelSize:B,noDataValue:F,storageInfo:U}),P=u(t,"datafile"),W=u(t,"IndexFile");return{rasterInfo:E,files:{mrf:this.url,index:W||this.url.replace(".mrf",".idx"),data:P||this.url.replace(".mrf",x.get(g).blobExtension)}}}async _fetchAuxiliaryData(t){try{const{data:e}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:t?.signal});return m(e)}catch{return null}}};function I(t){if(t.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let e,r,s,o,a,i;if(g){for(r=new Uint8Array(t),o=new ArrayBuffer(t.byteLength),s=new Uint8Array(o),a=0;a<t.byteLength/4;a++)for(i=0;i<4;i++)s[4*a+i]=r[4*a+3-i];e=new Uint32Array(o)}else e=new Uint32Array(t);return e}t([r()],w.prototype,"_files",void 0),t([r()],w.prototype,"_storageIndex",void 0),t([r({type:String,json:{write:!0}})],w.prototype,"datasetFormat",void 0),w=t([s("esri.layers.support.rasterDatasets.MRFRaster")],w);const b=w;export{b as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Error.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../geometry/Extent.js";import a from"../../../geometry/Point.js";import i from"../../../geometry/SpatialReference.js";import n from"../PixelBlock.js";import l from"../RasterInfo.js";import f from"../RasterStorageInfo.js";import c from"./BaseRaster.js";import{parseSpatialReference as p,parsePAMInfo as m}from"./pamParser.js";import{getElement as h,getElementValue as u}from"./xmlUtilities.js";import{isPlatformLittleEndian as g}from"../rasterFormats/utils.js";import{estimateStatisticsFromHistograms as d}from"../rasterFunctions/stretchUtils.js";const y=new Map;y.set("Int8","s8"),y.set("UInt8","u8"),y.set("Int16","s16"),y.set("UInt16","u16"),y.set("Int32","s32"),y.set("UInt32","u32"),y.set("Float32","f32"),y.set("Float64","f32"),y.set("Double64","f32");const x=new Map;x.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),x.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),x.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),x.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let w=class extends c{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(t,e,r,s={}){const{blockWidth:o,blockHeight:a,blockBoundary:i}=this.rasterInfo.storageInfo,l=i[t];if(!l||l.maxRow<e||l.maxCol<r||l.minRow>e||l.minCol>r)return null;const{bandCount:f,pixelType:c}=this.rasterInfo,{ranges:p,actualTileWidth:m,actualTileHeight:h}=this._getTileLocation(t,e,r);if(!p||0===p.length)return null;if(0===p[0].from&&0===p[0].to){const t=new Uint8Array(o*a);return new n({width:o,height:a,pixels:void 0,mask:t,validPixelCount:0})}const{bandIds:u}=this.ioConfig,g=this._getBandSegmentCount(),d=[];let y=0;for(y=0;y<g;y++)u&&!u.includes(y)||d.push(this.request(this._files.data,{range:{from:p[y].from,to:p[y].to},responseType:"array-buffer",signal:s.signal}));const w=await Promise.all(d),I=w.map(t=>t.data.byteLength).reduce((t,e)=>t+e),b=new Uint8Array(I),R=[];let A=0;for(y=0;y<g;y++)R.push(A),b.set(new Uint8Array(w[y].data),A),A+=w[y].data.byteLength;const F=x.get(this.rasterInfo.storageInfo.compression).decoderFormat,_=await this.decodePixelBlock(b.buffer,{width:o,height:a,format:F,planes:u?.length||f,offsets:R,pixelType:c});if(null==_)return null;let{noDataValue:S}=this.rasterInfo;if(null!=S&&"lerc"!==F&&!_.mask&&(S=S[0],null!=S)){const t=_.width*_.height,e=new Uint8Array(t);if(Math.abs(S)>1e24)for(y=0;y<t;y++)Math.abs((_.pixels[0][y]-S)/S)>1e-6&&(e[y]=1);else for(y=0;y<t;y++)_.pixels[0][y]!==S&&(e[y]=1);_.mask=e}let k=0,M=0;if(m!==o||h!==a){let t=_.mask;if(t)for(y=0;y<a;y++)if(M=y*o,y<h)for(k=m;k<o;k++)t[M+k]=0;else for(k=0;k<o;k++)t[M+k]=0;else for(t=new Uint8Array(o*a),_.mask=t,y=0;y<h;y++)for(M=y*o,k=0;k<m;k++)t[M+k]=1}return _}async _open(t){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const e=t?t.signal:null,r=await this.request(this.url,{responseType:"xml",signal:e}),{rasterInfo:s,files:o}=this._parseHeader(r.data),{skipMapInfo:a,skipExtensions:i=[]}=this.ioConfig;if(!i.includes("aux.xml")&&!a){const e=await this._fetchAuxiliaryData(t);null!=e&&(s.statistics=e.statistics??s.statistics,s.histograms=e.histograms,e.histograms&&null==s.statistics&&(s.statistics=d(e.histograms)))}a&&this.updateImageSpaceRasterInfo(s),this._set("rasterInfo",s),this._files=o;const n=await this.request(o.index,{responseType:"array-buffer",signal:e});this._storageIndex=I(n.data);const{blockWidth:l,blockHeight:f}=this.rasterInfo.storageInfo,c=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:p,height:m}=this.rasterInfo,h=[],u=this._getBandSegmentCount();let g=0,y=-1;for(;g<this._storageIndex.length;){y++;const t=Math.ceil(p/l/c**y)-1,e=Math.ceil(m/f/c**y)-1;g+=(t+1)*(e+1)*u*4,h.push({maxRow:e,maxCol:t,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=h,y>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=y),this.updateTileInfo()}_getBandSegmentCount(){return x.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(t,e,r){const{blockWidth:s,blockHeight:o,pyramidScalingFactor:a}=this.rasterInfo.storageInfo,{width:i,height:n}=this.rasterInfo,l=this._getBandSegmentCount();let f,c,p,m=0,h=0;for(p=0;p<t;p++)h=a**p,f=Math.ceil(i/s/h),c=Math.ceil(n/o/h),m+=f*c;h=a**t,f=Math.ceil(i/s/h),c=Math.ceil(n/o/h),m+=e*f+r,m*=4*l;const u=this._storageIndex.subarray(m,m+4*l);let g=0,d=0;const y=[];for(let x=0;x<l;x++)g=u[4*x]*2**32+u[4*x+1],d=g+u[4*x+2]*2**32+u[4*x+3]-1,y.push({from:g,to:d});return{ranges:y,actualTileWidth:r<f-1?s:Math.ceil(i/h)-s*(f-1),actualTileHeight:e<c-1?o:Math.ceil(n/h)-o*(c-1)}}_parseHeader(t){const r=h(t,"MRF_META/Raster");if(!r)throw new e("mrf:open","not a valid MRF format");const s=h(r,"Size"),n=parseInt(s.getAttribute("x"),10),c=parseInt(s.getAttribute("y"),10),m=parseInt(s.getAttribute("c"),10),g=(u(r,"Compression")||"none").toLowerCase();if(!x.has(g))throw new e("mrf:open","currently does not support compression "+g);const d=u(r,"DataType")||"UInt8",w=y.get(d);if(null==w)throw new e("mrf:open","currently does not support pixel type "+d);const I=h(r,"PageSize"),b=parseInt(I.getAttribute("x"),10),R=parseInt(I.getAttribute("y"),10),A=h(r,"DataValues");let F,_;A&&(_=A.getAttribute("NoData"),null!=_&&(F=_.trim().split(" ").map(t=>parseFloat(t))));if(h(t,"MRF_META/CachedSource"))throw new e("mrf:open","currently does not support MRF referencing other data files");const S=h(t,"MRF_META/GeoTags"),k=h(S,"BoundingBox");let M,j=!1;if(null!=k){const t=parseFloat(k.getAttribute("minx")),e=parseFloat(k.getAttribute("miny")),r=parseFloat(k.getAttribute("maxx")),s=parseFloat(k.getAttribute("maxy")),a=u(S,"Projection")||"";let n=i.WGS84;if("LOCAL_CS[]"!==a)if(a.toLowerCase().startsWith("epsg:")){const t=Number(a.slice(5));isNaN(t)||0===t||(n=new i({wkid:t}))}else n=p(a)??i.WGS84;else j=!0,n=new i({wkid:3857});M=new o(t,e,r,s),M.spatialReference=n}else j=!0,M=new o({xmin:-.5,ymin:.5-c,xmax:n-.5,ymax:.5,spatialReference:new i({wkid:3857})});const C=h(t,"MRF_META/Rsets"),T=parseInt(C?.getAttribute("scale")||"2",10),L=M.spatialReference,U=new f({origin:new a({x:M.xmin,y:M.ymax,spatialReference:L}),blockWidth:b,blockHeight:R,pyramidBlockWidth:b,pyramidBlockHeight:R,compression:g,pyramidScalingFactor:T}),B=new a({x:M.width/n,y:M.height/c,spatialReference:L}),E=new l({width:n,height:c,extent:M,isPseudoSpatialReference:j,spatialReference:L,bandCount:m,pixelType:w,pixelSize:B,noDataValue:F,storageInfo:U}),P=u(t,"datafile"),W=u(t,"IndexFile");return{rasterInfo:E,files:{mrf:this.url,index:W||this.url.replace(".mrf",".idx"),data:P||this.url.replace(".mrf",x.get(g).blobExtension)}}}async _fetchAuxiliaryData(t){try{const{data:e}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:t?.signal});return m(e)}catch{return null}}};function I(t){if(t.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let e,r,s,o,a,i;if(g){for(r=new Uint8Array(t),o=new ArrayBuffer(t.byteLength),s=new Uint8Array(o),a=0;a<t.byteLength/4;a++)for(i=0;i<4;i++)s[4*a+i]=r[4*a+3-i];e=new Uint32Array(o)}else e=new Uint32Array(t);return e}t([r()],w.prototype,"_files",void 0),t([r()],w.prototype,"_storageIndex",void 0),t([r({type:String,json:{write:!0}})],w.prototype,"datasetFormat",void 0),w=t([s("esri.layers.support.rasterDatasets.MRFRaster")],w);const b=w;export{b as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../geometry/Point.js";import t from"../../geometry/Polygon.js";import r from"../../geometry/Polyline.js";import n from"../support/TelemetryData.js";import i from"../support/VideoTimeExtent.js";import{applyCIMSymbolColor as o}from"../../symbols/support/cimSymbolUtils.js";import{applyColorToSymbol as a}from"../../symbols/support/utils.js";const u="application/x-mpegURL",s="video/mp4",l="video/webm",d={UASDatalinkLocalSet:1e4,PrecisionTimeStamp:10002,MissionId:10003,PlatformTailNumber:10004,PlatformHeadingAngle:10005,PlatformPitchAngle:10006,PlatformRollAngle:10007,PlatformTrueAirspeed:10008,PlatformIndicatedAirspeed:10009,PlatformDesignation:10010,ImageSourceSensor:10011,ImageCoordinateSystem:10012,SensorLatitude:10013,SensorLongitude:10014,SensorTrueAltitude:10015,SensorHorizontalFOV:10016,SensorVerticalFOV:10017,SensorAzimuthAngle:10018,SensorElevationAngle:10019,SensorRollAngle:10020,PlatformSlantRange:10021,TargetWidth:10022,FrameCenterLatitude:10023,FrameCenterLongitude:10024,FrameCenterElevation:10025,OffsetCorner1Latitude:10026,OffsetCorner1Longitude:10027,OffsetCorner2Latitude:10028,OffsetCorner2Longitude:10029,OffsetCorner3Latitude:10030,OffsetCorner3Longitude:10031,OffsetCorner4Latitude:10032,OffsetCorner4Longitude:10033,TargetLocationLatitude:10040,TargetLocationLongitude:10041,TargetLocationElevation:10042,TargetTrackGateWidth:10043,TargetTrackGateHeight:10044,TargetErrorEstimateHorizontal:10045,TargetErrorEstimateLateral:10046,GenericFlagData:10047,PlatformGroundSpeed:10056,PlatformGroundRange:10057,PlatformRemainingFuel:10058,PlatformCallSign:10059,SensorFOVName:10063,PlatformMagneticHeading:10064,LDSVersionNumber:10065,AlternatePlatformName:10070,EventStartTimeUTC:10072,VMTIDataSet:10074,SensorEllipsoidHeight:10075,OperationalMode:10077,CornerLatitudePoint1:10082,CornerLongitudePoint1:10083,CornerLatitudePoint2:10084,CornerLongitudePoint2:10085,CornerLatitudePoint3:10086,CornerLongitudePoint3:10087,CornerLatitudePoint4:10088,CornerLongitudePoint4:10089,SARMotionImageryMetadata:10095,SecurityClassification:20001,SecurityClassifyingAuthority:20002,SecurityClassifyingCountry:20003,SecuritySCI:20004,SecurityCaveats:20005,SecurityReleaseInstructions:20006,SecurityLDSVersion:20022,EsriVideoWidth:90001,EsriVideoHeight:90002,EsriFrameCenterLatitude:90050,EsriFrameCenterLongitude:90051,EsriCornerLatitudePt1:90052,EsriCornerLongitudePt1:90053,EsriCornerLatitudePt2:90054,EsriCornerLongitudePt2:90055,EsriCornerLatitudePt3:90056,EsriCornerLongitudePt3:90057,EsriCornerLatitudePt4:90058,EsriCornerLongitudePt4:90059,EsriFrameOutline:90060,EsriSensorPosition:90061,EsriHorizonPixelPack:90063,EsriGroundControlPoints:90064};function g(e,t=1e4){if(!e||!e.length)return[];let r=[],n=[];for(let o=0;o<e.length;o++){const t=e[o],n=t?.text?JSON.parse(t.text):null;"EsriVideoServer"===n?.source&&(r=[...n.data])}const i=r.find(e=>e.tagId===t);return Array.isArray(i?.value)&&(n=[...i.value]),n}function f(e){const{duration:t,end:r,start:n,timezone:o="UTC"}=e||{};return"number"!=typeof t?null:new i({duration:t||null,end:"number"==typeof r?new Date(r):null,start:"number"==typeof n?new Date(n):null,timezone:o})}function m(e,t){const r=[...t],n=r.findIndex(t=>t.equals(e));return n>-1&&r.splice(n),r.push(e),r}function L(e){if(!e?.size)return new n;const t=A(e),r=P(e),i=y(e),o=T(t,r);return new n({frameCenter:r,frameOutline:i,lineOfSight:o,sensorLocation:t})}function C(e){if(!e?.size)return null;return e.get(d.EsriGroundControlPoints)?.value??null??null}function c(e){return e?.size?e.get(d.EsriHorizonPixelPack)?.value??null:null}function P(e){return h(e)??v(e)}function E(e){if(!e)return u;const t=e.match(/\.(\w{3,4})(?:$|\?)/i);if(!t)return u;switch(t[1].toLowerCase()){case"mp4":return s;case"webm":return l;default:return u}}function S(e){const t=e?.layers;return t?.length?t.map(e=>({layerId:e.id,posterUrl:e.poster,sourceType:e.serviceType,title:e.name,type:e.type||"Video Layer"})):[]}function p(e,t,r){if(!e)return null;const n=e.clone();switch(n.type){case"simple-fill":a(n,r),n.outline.color=t;break;case"simple-line":a(n,t);break;case"simple-marker":a(n,t),n?.outline?.color&&(n.outline.color=t);break;case"cim":o(n,t)}return n}function h(t){return t&&t.has(d.EsriFrameCenterLatitude)&&t.has(d.EsriFrameCenterLongitude)?new e({x:t.get(d.EsriFrameCenterLongitude).value,y:t.get(d.EsriFrameCenterLatitude).value,z:t.get(d.FrameCenterElevation).value}):null}function v(t){return t&&t.has(d.FrameCenterLatitude)&&t.has(d.FrameCenterLongitude)?new e({x:t.get(d.FrameCenterLongitude)?.value,y:t.get(d.FrameCenterLatitude)?.value,z:t.get(d.FrameCenterElevation)?.value}):null}function y(e){if(!e)return null;const r=e.get(d.EsriFrameOutline)?.value;return r?t.fromJSON(r.geometry):O(e)??F(e)}function O(e){if(!(e.has(d.EsriCornerLatitudePt1)&&e.has(d.EsriCornerLongitudePt1)&&e.has(d.EsriCornerLatitudePt2)&&e.has(d.EsriCornerLongitudePt2)&&e.has(d.EsriCornerLatitudePt3)&&e.has(d.EsriCornerLongitudePt3)&&e.has(d.EsriCornerLatitudePt4)&&e.has(d.EsriCornerLongitudePt4)))return null;const r=[e.get(d.EsriCornerLongitudePt1)?.value,e.get(d.EsriCornerLatitudePt1)?.value],n=[e.get(d.EsriCornerLongitudePt2)?.value,e.get(d.EsriCornerLatitudePt2)?.value],i=[e.get(d.EsriCornerLongitudePt3)?.value,e.get(d.EsriCornerLatitudePt3)?.value],o=[e.get(d.EsriCornerLongitudePt4)?.value,e.get(d.EsriCornerLatitudePt4)?.value];return new t({rings:[[r,n,i,o]]})}function F(e){if(!(e.has(d.OffsetCorner1Latitude)&&e.has(d.OffsetCorner1Longitude)&&e.has(d.OffsetCorner2Latitude)&&e.has(d.OffsetCorner2Longitude)&&e.has(d.OffsetCorner3Latitude)&&e.has(d.OffsetCorner3Longitude)&&e.has(d.OffsetCorner4Latitude)&&e.has(d.OffsetCorner4Longitude)&&e.has(d.FrameCenterLatitude)&&e.has(d.FrameCenterLongitude)))return null;const r=e.get(d.FrameCenterLatitude)?.value,n=e.get(d.FrameCenterLongitude)?.value,i=r+e.get(d.OffsetCorner1Latitude)?.value,o=n+e.get(d.OffsetCorner1Longitude)?.value,a=r+e.get(d.OffsetCorner2Latitude)?.value,u=n+e.get(d.OffsetCorner2Longitude)?.value,s=r+e.get(d.OffsetCorner3Latitude)?.value,l=n+e.get(d.OffsetCorner3Longitude)?.value,g=r+e.get(d.OffsetCorner4Latitude)?.value,f=n+e.get(d.OffsetCorner4Longitude)?.value;return new t({rings:[[[o,i],[u,a],[l,s],[f,g]]]})}function T(e,t){if(!e||!t)return null;const n=[e.x,e.y,e.z??0],i=[t.x,t.y,t.z??0];return new r({paths:[[n,i]]})}function A(t){if(!t?.size)return null;if(t.has(d.EsriSensorPosition)){const r=t.get(d.EsriSensorPosition)?.value;if(r)return e.fromJSON(r.geometry)}return t.has(d.SensorLongitude)&&t.has(d.SensorLatitude)&&t.has(d.SensorTrueAltitude)?new e({x:t.get(d.SensorLongitude)?.value,y:t.get(d.SensorLatitude)?.value,z:t.get(d.SensorTrueAltitude)?.value}):null}export{P as getFrameCenter,c as getFrameHorizonPoints,C as getGroundControlPoints,m as getSensorTrailPoints,S as getServiceLayersInfo,p as getStyledTelemetrySymbol,L as getTelemetryData,g as getVideoMetadataFromCueList,E as getVideoMimeType,f as readVideoTimeExtent,d as videoMetadataEntryId};
5
+ import e from"../../geometry/Point.js";import t from"../../geometry/Polygon.js";import r from"../../geometry/Polyline.js";import n from"../support/TelemetryData.js";import o from"../support/VideoTimeExtent.js";import{applyCIMSymbolColor as i}from"../../symbols/support/cimSymbolUtils.js";import{applyColorToSymbol as a}from"../../symbols/support/utils.js";const u="application/x-mpegURL",s="video/mp4",l="video/webm",d={UASDatalinkLocalSet:1e4,PrecisionTimeStamp:10002,MissionId:10003,PlatformTailNumber:10004,PlatformHeadingAngle:10005,PlatformPitchAngle:10006,PlatformRollAngle:10007,PlatformTrueAirspeed:10008,PlatformIndicatedAirspeed:10009,PlatformDesignation:10010,ImageSourceSensor:10011,ImageCoordinateSystem:10012,SensorLatitude:10013,SensorLongitude:10014,SensorTrueAltitude:10015,SensorHorizontalFOV:10016,SensorVerticalFOV:10017,SensorAzimuthAngle:10018,SensorElevationAngle:10019,SensorRollAngle:10020,PlatformSlantRange:10021,TargetWidth:10022,FrameCenterLatitude:10023,FrameCenterLongitude:10024,FrameCenterElevation:10025,OffsetCorner1Latitude:10026,OffsetCorner1Longitude:10027,OffsetCorner2Latitude:10028,OffsetCorner2Longitude:10029,OffsetCorner3Latitude:10030,OffsetCorner3Longitude:10031,OffsetCorner4Latitude:10032,OffsetCorner4Longitude:10033,TargetLocationLatitude:10040,TargetLocationLongitude:10041,TargetLocationElevation:10042,TargetTrackGateWidth:10043,TargetTrackGateHeight:10044,TargetErrorEstimateHorizontal:10045,TargetErrorEstimateLateral:10046,GenericFlagData:10047,PlatformGroundSpeed:10056,PlatformGroundRange:10057,PlatformRemainingFuel:10058,PlatformCallSign:10059,SensorFOVName:10063,PlatformMagneticHeading:10064,LDSVersionNumber:10065,AlternatePlatformName:10070,EventStartTimeUTC:10072,VMTIDataSet:10074,SensorEllipsoidHeight:10075,OperationalMode:10077,FrameCenterAboveEllipsoid:10078,CornerLatitudePoint1:10082,CornerLongitudePoint1:10083,CornerLatitudePoint2:10084,CornerLongitudePoint2:10085,CornerLatitudePoint3:10086,CornerLongitudePoint3:10087,CornerLatitudePoint4:10088,CornerLongitudePoint4:10089,SARMotionImageryMetadata:10095,SecurityClassification:20001,SecurityClassifyingAuthority:20002,SecurityClassifyingCountry:20003,SecuritySCI:20004,SecurityCaveats:20005,SecurityReleaseInstructions:20006,SecurityLDSVersion:20022,EsriVideoWidth:90001,EsriVideoHeight:90002,EsriFrameCenterLatitude:90050,EsriFrameCenterLongitude:90051,EsriCornerLatitudePt1:90052,EsriCornerLongitudePt1:90053,EsriCornerLatitudePt2:90054,EsriCornerLongitudePt2:90055,EsriCornerLatitudePt3:90056,EsriCornerLongitudePt3:90057,EsriCornerLatitudePt4:90058,EsriCornerLongitudePt4:90059,EsriFrameOutline:90060,EsriSensorPosition:90061,EsriHorizonPixelPack:90063,EsriGroundControlPoints:90064};function f(e,t=1e4){if(!e||!e.length)return[];let r=[],n=[];for(let i=0;i<e.length;i++){const t=e[i],n=t?.text?JSON.parse(t.text):null;"EsriVideoServer"===n?.source&&(r=[...n.data])}const o=r.find(e=>e.tagId===t);return Array.isArray(o?.value)&&(n=[...o.value]),n}function g(e){const{duration:t,end:r,start:n,timezone:i="UTC"}=e||{};return"number"!=typeof t?null:new o({duration:t||null,end:"number"==typeof r?new Date(r):null,start:"number"==typeof n?new Date(n):null,timezone:i})}function m(e,t){const r=[...t],n=r.findIndex(t=>t.equals(e));return n>-1&&r.splice(n),r.push(e),r}function C(e){if(!e?.size)return new n;const t=b(e),r=P(e),o=O(e),i=A(t,r);return new n({frameCenter:r,frameOutline:o,lineOfSight:i,sensorLocation:t})}function L(e){if(!e?.size)return null;return e.get(d.EsriGroundControlPoints)?.value??null??null}function c(e){return e?.size?e.get(d.EsriHorizonPixelPack)?.value??null:null}function P(e){return S(e)??y(e)}function E(e){if(!e)return u;const t=e.match(/\.(\w{3,4})(?:$|\?)/i);if(!t)return u;switch(t[1].toLowerCase()){case"mp4":return s;case"webm":return l;default:return u}}function p(e){const t=e?.layers;return t?.length?t.map(e=>({layerId:e.id,posterUrl:e.poster,sourceType:e.serviceType,title:e.name,type:e.type||"Video Layer"})):[]}function v(e,t,r){if(!e)return null;const n=e.clone();switch(n.type){case"simple-fill":a(n,r),n.outline.color=t;break;case"simple-line":a(n,t);break;case"simple-marker":a(n,t),n?.outline?.color&&(n.outline.color=t);break;case"cim":i(n,t)}return n}function h(e){const{cameraAzimuth:t,platformHeading:r,source:n=null,symbolOffset:o=0}=e||{};let i=0;if(!n)return i;i="platformHeading"===n?r+o:r+t+o;const a=i>360?i-360:i;return Math.round(Math.abs(a))}function S(t){return t&&t.has(d.EsriFrameCenterLatitude)&&t.has(d.EsriFrameCenterLongitude)?new e({x:t.get(d.EsriFrameCenterLongitude).value,y:t.get(d.EsriFrameCenterLatitude).value,z:t.get(d.FrameCenterAboveEllipsoid)?.value??t.get(d.FrameCenterElevation)?.value}):null}function y(t){return t&&t.has(d.FrameCenterLatitude)&&t.has(d.FrameCenterLongitude)?new e({x:t.get(d.FrameCenterLongitude)?.value,y:t.get(d.FrameCenterLatitude)?.value,z:t.get(d.FrameCenterElevation)?.value}):null}function O(e){if(!e)return null;const r=e.get(d.EsriFrameOutline)?.value;return r?t.fromJSON(r.geometry):F(e)??T(e)}function F(e){if(!(e.has(d.EsriCornerLatitudePt1)&&e.has(d.EsriCornerLongitudePt1)&&e.has(d.EsriCornerLatitudePt2)&&e.has(d.EsriCornerLongitudePt2)&&e.has(d.EsriCornerLatitudePt3)&&e.has(d.EsriCornerLongitudePt3)&&e.has(d.EsriCornerLatitudePt4)&&e.has(d.EsriCornerLongitudePt4)))return null;const r=[e.get(d.EsriCornerLongitudePt1)?.value,e.get(d.EsriCornerLatitudePt1)?.value],n=[e.get(d.EsriCornerLongitudePt2)?.value,e.get(d.EsriCornerLatitudePt2)?.value],o=[e.get(d.EsriCornerLongitudePt3)?.value,e.get(d.EsriCornerLatitudePt3)?.value],i=[e.get(d.EsriCornerLongitudePt4)?.value,e.get(d.EsriCornerLatitudePt4)?.value];return new t({rings:[[r,n,o,i]]})}function T(e){if(!(e.has(d.OffsetCorner1Latitude)&&e.has(d.OffsetCorner1Longitude)&&e.has(d.OffsetCorner2Latitude)&&e.has(d.OffsetCorner2Longitude)&&e.has(d.OffsetCorner3Latitude)&&e.has(d.OffsetCorner3Longitude)&&e.has(d.OffsetCorner4Latitude)&&e.has(d.OffsetCorner4Longitude)&&e.has(d.FrameCenterLatitude)&&e.has(d.FrameCenterLongitude)))return null;const r=e.get(d.FrameCenterLatitude)?.value,n=e.get(d.FrameCenterLongitude)?.value,o=r+e.get(d.OffsetCorner1Latitude)?.value,i=n+e.get(d.OffsetCorner1Longitude)?.value,a=r+e.get(d.OffsetCorner2Latitude)?.value,u=n+e.get(d.OffsetCorner2Longitude)?.value,s=r+e.get(d.OffsetCorner3Latitude)?.value,l=n+e.get(d.OffsetCorner3Longitude)?.value,f=r+e.get(d.OffsetCorner4Latitude)?.value,g=n+e.get(d.OffsetCorner4Longitude)?.value;return new t({rings:[[[i,o],[u,a],[l,s],[g,f]]]})}function A(e,t){if(!e||!t)return null;const n=[e.x,e.y,e.z??0],o=[t.x,t.y,t.z??0];return new r({paths:[[n,o]]})}function b(t){if(!t?.size)return null;if(t.has(d.EsriSensorPosition)){const r=t.get(d.EsriSensorPosition)?.value;if(r)return e.fromJSON(r.geometry)}return t.has(d.SensorLongitude)&&t.has(d.SensorLatitude)?new e({x:t.get(d.SensorLongitude)?.value,y:t.get(d.SensorLatitude)?.value,z:t.get(d.SensorTrueAltitude)?.value}):null}export{P as getFrameCenter,c as getFrameHorizonPoints,L as getGroundControlPoints,m as getSensorTrailPoints,p as getServiceLayersInfo,v as getStyledTelemetrySymbol,h as getSymbolDisplayAngle,C as getTelemetryData,f as getVideoMetadataFromCueList,E as getVideoMimeType,g as readVideoTimeExtent,d as videoMetadataEntryId};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{getAssetUrl as s}from"../../assets.js";function i(){return t??=(async()=>{const i=await import("../../chunks/basis_encoder.js"),t=await i.default({locateFile:i=>s(`esri/libs/basisu/${i}`)});return t.initializeBasis(),t})(),t}let t;export{i as getBasisEncoder};
5
+ import{getAssetUrl as i}from"../../assets.js";function s(){return t??=(async()=>{const s=await import("../../chunks/basis_encoder.js"),t=await s.default({locateFile:s=>i(`esri/libs/basisu/${s}`)});return t.initializeBasis(),t})(),t}let t;function a(){t=null}export{a as destroyBasisEncoder,s as getBasisEncoder};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{getAssetUrl as t}from"../../assets.js";function e(){return r??=(async()=>{const e=await import("../../chunks/dxt_encoder.js");return await e.default({locateFile:e=>t(`esri/libs/dxtEncoder/${e}`)})})(),r}let r;export{e as getDXTEncoder};
5
+ import{getAssetUrl as t}from"../../assets.js";function e(){return n??=(async()=>{const e=await import("../../chunks/dxt_encoder.js");return await e.default({locateFile:e=>t(`esri/libs/dxtEncoder/${e}`)})})(),n}let n;function r(){n=null}export{r as destroyDXTEncoder,e as getDXTEncoder};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{getAssetUrl as t}from"../../assets.js";function e(){return n||(n=new Promise(t=>import("../../chunks/i3s.js").then(t=>t.i).then(({default:e})=>{const n=e({locateFile:i,onRuntimeInitialized:()=>t(n)});delete n.then})).catch(t=>{throw t})),n}function i(e){return t(`esri/libs/i3s/${e}`)}let n;export{e as get};
5
+ import{getAssetUrl as t}from"../../assets.js";function e(){return o||(o=new Promise(t=>import("../../chunks/i3s.js").then(t=>t.i).then(({default:e})=>{const i=e({locateFile:n,onRuntimeInitialized:()=>t(i)});delete i.then})).catch(t=>{throw t})),o}function n(e){return t(`esri/libs/i3s/${e}`)}function i(){o=null}let o;export{i as cleanup,e as get};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../request.js";import t from"../../core/Error.js";import{queryAllJSON as r}from"../../layers/support/featureQueryAll.js";import{isSubtypeSublayer as n,isFeatureLayer as o}from"../../layers/support/layerUtils.js";import{RuleType as a}from"./typeUtils.js";import s from"../../portal/PortalItem.js";import u from"../../rest/support/FeatureSet.js";import{isGraphic as l}from"../../support/guards.js";function i(e,t,r="from"){const{fromRuleElement:n,viaRuleElement:o,toRuleElement:s}=f(e),u=[];switch(e.ruleType){case a.RTContainment:case a.RTAttachment:"from"===r&&y(t,n,!1)?u.push(s):"to"===r&&y(t,s,!1)&&u.push(n);break;case a.RTJunctionEdgeConnectivity:case a.RTJunctionJunctionConnectivity:y(t,n,!0)?u.push(s):y(t,s,!0)&&u.push(n);break;case a.RTEdgeJunctionEdgeConnectivity:o&&(y(t,o,!0)?(u.push(n),u.push(s)):(y(t,n,!0)||y(t,s,!0))&&u.push(o));break;default:return[]}return u}function c(e,t,r){const{fromRuleElement:n,viaRuleElement:o,toRuleElement:s}=f(e);switch(e.ruleType){case a.RTContainment:case a.RTAttachment:return p(t,r,n,s,!1,!1);case a.RTJunctionEdgeConnectivity:case a.RTJunctionJunctionConnectivity:return p(t,r,n,s,!0,!0);case a.RTEdgeJunctionEdgeConnectivity:return p(t,r,n,o,!0,!0)||p(t,r,s,o,!0,!0);default:return!1}}function p(e,t,r,n,o,a){if(!r||!n)return!1;const s=y(e,r,a),u=y(t,n,a);if(o){const o=y(e,n,a),l=y(t,r,a);return s&&u||o&&l}return s&&u}function m(e,t){const r=e.terminal?.terminalId,n=t.terminalId;return null==r&&null==n||(1===r?null==n||1===n:r===n)}function y(e,t,r){const{assetGroupCode:n,assetTypeCode:o}=e;return("layerId"in e?e.layerId===t.networkSource?.layerId:e.networkSourceId===t.networkSource?.sourceId)&&(null==n||n===t.assetGroup?.assetGroupCode)&&(null==o||o===t.assetType?.assetTypeCode)&&(!r||!("terminalId"in e)||m(t,e))}function f(e){return{fromRuleElement:{networkSource:e.fromNetworkSource,assetGroup:e.fromAssetGroup,assetType:e.fromAssetType,terminal:e.fromTerminal},viaRuleElement:e.viaNetworkSource?{networkSource:e.viaNetworkSource,assetGroup:e.viaAssetGroup,assetType:e.viaAssetType,terminal:e.viaTerminal}:void 0,toRuleElement:{networkSource:e.toNetworkSource,assetGroup:e.toAssetGroup,assetType:e.toAssetType,terminal:e.toTerminal}}}function d(e){let t=null,r=null,o=null;if(l(e))t=w(e),[r,o]=I(e);else if(n(e)){t=e.parent?.layerId??null;const[n]=T(e);n===e.subtypeField&&(r=e.subtypeCode)}else t=e.layerId??null;return{layerId:t,assetGroupCode:r,assetTypeCode:o}}function w(e){const{sourceLayer:t}=e;let r;return o(t)?r=t.layerId:n(t)&&(r=t.parent?.layerId),r??null}function I(e){const[t,r]=T(e.sourceLayer);return[t?e.attributes[t]:null,r?e.attributes[r]:null]}function T(e){if(!e||!("fieldsIndex"in e))return[null,null];return[e.fieldsIndex.normalizeFieldName("assetGroup")??null,e.fieldsIndex.normalizeFieldName("assetType")??null]}async function R(e,t){const n=e.layers,o=e.layerInfos,a=e.returnGeometry||!1,s=e.outSpatialReference;await Promise.all(n.map(async e=>{await e.load()}));return(await Promise.all(n.map(async e=>{const n=o.find(t=>t.layerUrl===e.parsedUrl?.path);if(!n?.objectIds?.length)return{layer:e,featureSet:void 0};const l=e.createQuery();l.returnGeometry=a,l.outFields=n.outFields||["*"],l.outSpatialReference=s,l.gdbVersion=e.gdbVersion,l.objectIds=n.objectIds,t&&(l.where="1=1");const i=u.fromJSON(await r(e,l));return i.features.forEach(t=>{t.layer=e}),{layer:e,featureSet:i}}))).filter(e=>void 0!==e.featureSet)}async function k(e,t){if("Utility Network Layer"===e){const{default:e}=await import("../UtilityNetwork.js");return new e({layerUrl:t})}return null}async function v(r){let n="portalItem"in r?r:{portalItem:r};!n.portalItem||n.portalItem instanceof s||(n={...n,portalItem:new s(n.portalItem)});const o=n.portalItem;if(await o.load(),"Feature Service"!==o.type)throw new t("portal:unknown-item-type","Unknown item type '${type}'",{type:o.type});const a=o.url,u=await e(a,{responseType:"json",query:{f:"json"}}),l="Network Layer";if(u.data.type?.includes(l))return k(u.data.type,a);if(u.data.layers){const e=u.data.layers.find(e=>e.type.includes(l));if(e){const t=`${a}/${e.id}`;return k(e.type,t)}}return null}export{p as doElementsMatchRule,c as doesRuleAllowAssociation,T as getAssetFieldNames,i as getCompatibleRuleElements,f as getElementsFromRule,I as getFeatureAssetCodes,w as getFeatureSourceLayerId,R as getFeaturesFromLayers,d as getRuleValues,y as isRuleElementMatch,m as isTerminalMatch,v as networkFromPortalItem};
5
+ import e from"../../request.js";import t from"../../core/Error.js";import{queryAllJSON as r}from"../../layers/support/featureQueryAll.js";import{isSubtypeSublayer as n,isFeatureLayer as o}from"../../layers/support/layerUtils.js";import{RuleType as a}from"./typeUtils.js";import s from"../../portal/PortalItem.js";import u from"../../rest/support/FeatureSet.js";import{isGraphic as l}from"../../support/guards.js";function i(e,t,r="from"){const{fromRuleElement:n,viaRuleElement:o,toRuleElement:s}=f(e),u=[];switch(e.ruleType){case a.RTContainment:case a.RTAttachment:"from"===r&&y(t,n,!1)?u.push(s):"to"===r&&y(t,s,!1)&&u.push(n);break;case a.RTJunctionEdgeConnectivity:case a.RTJunctionJunctionConnectivity:y(t,n,!0)?u.push(s):y(t,s,!0)&&u.push(n);break;case a.RTEdgeJunctionEdgeConnectivity:o&&(y(t,o,!0)?(u.push(n),u.push(s)):(y(t,n,!0)||y(t,s,!0))&&u.push(o));break;default:return[]}return u}function c(e,t,r){const{fromRuleElement:n,viaRuleElement:o,toRuleElement:s}=f(e);switch(e.ruleType){case a.RTContainment:case a.RTAttachment:return p(t,r,n,s,!1,!1);case a.RTJunctionEdgeConnectivity:case a.RTJunctionJunctionConnectivity:return p(t,r,n,s,!0,!0);case a.RTEdgeJunctionEdgeConnectivity:return p(t,r,n,o,!0,!0)||p(t,r,s,o,!0,!0);default:return!1}}function p(e,t,r,n,o,a){if(!r||!n)return!1;const s=y(e,r,a),u=y(t,n,a);if(o){const o=y(e,n,a),l=y(t,r,a);return s&&u||o&&l}return s&&u}function m(e,t){const r=e.terminal?.terminalId,n=t.terminalId;return null==r&&null==n||(1===r?null==n||1===n:r===n)}function y(e,t,r){const{assetGroupCode:n,assetTypeCode:o}=e;return("layerId"in e?e.layerId===t.networkSource?.layerId:e.networkSourceId===t.networkSource?.sourceId)&&(null==n||n===t.assetGroup?.assetGroupCode)&&(null==o||o===t.assetType?.assetTypeCode)&&(!r||!("terminalId"in e)||m(t,e))}function f(e){return{fromRuleElement:{networkSource:e.fromNetworkSource,assetGroup:e.fromAssetGroup,assetType:e.fromAssetType,terminal:e.fromTerminal},viaRuleElement:e.viaNetworkSource?{networkSource:e.viaNetworkSource,assetGroup:e.viaAssetGroup,assetType:e.viaAssetType,terminal:e.viaTerminal}:void 0,toRuleElement:{networkSource:e.toNetworkSource,assetGroup:e.toAssetGroup,assetType:e.toAssetType,terminal:e.toTerminal}}}function d(e){let t=null,r=null,o=null;if(l(e))t=w(e),[r,o]=I(e);else if(n(e)){t=e.parent?.layerId??null;const[n]=T(e);n===e.subtypeField&&(r=e.subtypeCode)}else t=e.layerId??null;return{layerId:t,assetGroupCode:r,assetTypeCode:o}}function w(e){const{sourceLayer:t}=e;let r;return o(t)?r=t.layerId:n(t)&&(r=t.parent?.layerId),r??null}function I(e){const[t,r]=T(e.sourceLayer);return[t?e.attributes[t]:null,r?e.attributes[r]:null]}function T(e){if(!e||!("fieldsIndex"in e))return[null,null];return[e.fieldsIndex.normalizeFieldName("assetGroup")??null,e.fieldsIndex.normalizeFieldName("assetType")??null]}async function R(e,t){const n=e.layers,o=e.layerInfos,a=e.returnGeometry||!1,s=e.outSpatialReference;await Promise.all(n.map(async e=>{await e.load()}));return(await Promise.all(n.map(async e=>{const n=o.find(t=>t.layerUrl===e.parsedUrl?.path);if(!n?.objectIds?.length)return{layer:e,featureSet:void 0};const l=e.createQuery();l.returnGeometry=a,l.outFields=n.outFields||["*"],l.outSpatialReference=s,l.gdbVersion=e.gdbVersion,l.objectIds=n.objectIds,t&&(l.where="1=1");const i=u.fromJSON(await r(e,l));return i.features.forEach(t=>{t.layer=t.sourceLayer=e}),{layer:e,featureSet:i}}))).filter(e=>void 0!==e.featureSet)}async function k(e,t){if("Utility Network Layer"===e){const{default:e}=await import("../UtilityNetwork.js");return new e({layerUrl:t})}return null}async function v(r){let n="portalItem"in r?r:{portalItem:r};!n.portalItem||n.portalItem instanceof s||(n={...n,portalItem:new s(n.portalItem)});const o=n.portalItem;if(await o.load(),"Feature Service"!==o.type)throw new t("portal:unknown-item-type","Unknown item type '${type}'",{type:o.type});const a=o.url,u=await e(a,{responseType:"json",query:{f:"json"}}),l="Network Layer";if(u.data.type?.includes(l))return k(u.data.type,a);if(u.data.layers){const e=u.data.layers.find(e=>e.type.includes(l));if(e){const t=`${a}/${e.id}`;return k(e.type,t)}}return null}export{p as doElementsMatchRule,c as doesRuleAllowAssociation,T as getAssetFieldNames,i as getCompatibleRuleElements,f as getElementsFromRule,I as getFeatureAssetCodes,w as getFeatureSourceLayerId,R as getFeaturesFromLayers,d as getRuleValues,y as isRuleElementMatch,m as isTerminalMatch,v as networkFromPortalItem};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.34.0-next.21",
3
+ "version": "4.34.0-next.23",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{GraphDataModelOperationResult as s}from"./GraphDataModelOperationResult.js";let e=class extends s{constructor(r){super(r)}};e=r([o("esri.rest.knowledgeGraph.GraphAddFieldIndexResult")],e);const t=e;export{t as default};
5
+ import{_ as r}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import s from"./GraphDataModelOperationResult.js";let e=class extends s{constructor(r){super(r)}};e=r([o("esri.rest.knowledgeGraph.GraphAddFieldIndexResult")],e);const t=e;export{t as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{GraphDataModelOperationResult as e}from"./GraphDataModelOperationResult.js";let r=class extends e{constructor(t){super(t),this.entityAddResultsCount=0,this.relationshipAddResultsCount=0,this.entityAddResults=[],this.relationshipAddResults=[]}};t([s()],r.prototype,"entityAddResultsCount",void 0),t([s()],r.prototype,"relationshipAddResultsCount",void 0),t([s()],r.prototype,"entityAddResults",void 0),t([s()],r.prototype,"relationshipAddResults",void 0),r=t([o("esri.rest.knowledgeGraph.GraphAddNamedTypesResult")],r);const p=r;export{p as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import e from"./GraphDataModelOperationResult.js";let r=class extends e{constructor(t){super(t),this.entityAddResultsCount=0,this.relationshipAddResultsCount=0,this.entityAddResults=[],this.relationshipAddResults=[]}};t([s()],r.prototype,"entityAddResultsCount",void 0),t([s()],r.prototype,"relationshipAddResultsCount",void 0),t([s()],r.prototype,"entityAddResults",void 0),t([s()],r.prototype,"relationshipAddResults",void 0),r=t([o("esri.rest.knowledgeGraph.GraphAddNamedTypesResult")],r);const p=r;export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{GraphDataModelOperationResult as s}from"./GraphDataModelOperationResult.js";let e=class extends s{constructor(r){super(r)}};e=r([o("esri.rest.knowledgeGraph.GraphAddPropertyResult")],e);const t=e;export{t as default};
5
+ import{_ as r}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import s from"./GraphDataModelOperationResult.js";let e=class extends s{constructor(r){super(r)}};e=r([o("esri.rest.knowledgeGraph.GraphAddPropertyResult")],e);const t=e;export{t as default};
@@ -1,4 +1,4 @@
1
1
  import "../../interfaces";
2
2
 
3
3
  import GraphDataModelOperationResult = __esri.GraphDataModelOperationResult;
4
- export { GraphDataModelOperationResult };
4
+ export default GraphDataModelOperationResult;
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../chunks/tslib.es6.js";import o from"../../core/Accessor.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";let t=class extends o{constructor(r){super(r),this.decoderError=null,this.resultsCount=0,this.results=[],this.updatedKnowledgeGraph=null}};r([e()],t.prototype,"decoderError",void 0),r([e()],t.prototype,"resultsCount",void 0),r([e()],t.prototype,"results",void 0),r([e()],t.prototype,"updatedKnowledgeGraph",void 0),t=r([s("esri.rest.knowledgeGraph.GraphDataModelOperationResult")],t);export{t as GraphDataModelOperationResult};
5
+ import{_ as o}from"../../chunks/tslib.es6.js";import r from"../../core/Accessor.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";let t=class extends r{constructor(o){super(o),this.decoderError=null,this.resultsCount=0,this.results=[],this.updatedKnowledgeGraph=null}};o([e()],t.prototype,"decoderError",void 0),o([e()],t.prototype,"resultsCount",void 0),o([e()],t.prototype,"results",void 0),o([e()],t.prototype,"updatedKnowledgeGraph",void 0),t=o([s("esri.rest.knowledgeGraph.GraphDataModelOperationResult")],t);const p=t;export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{GraphDataModelOperationResult as s}from"./GraphDataModelOperationResult.js";let e=class extends s{constructor(r){super(r)}};e=r([o("esri.rest.knowledgeGraph.GraphDeleteFieldIndexResult")],e);const t=e;export{t as default};
5
+ import{_ as r}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import s from"./GraphDataModelOperationResult.js";let e=class extends s{constructor(r){super(r)}};e=r([o("esri.rest.knowledgeGraph.GraphDeleteFieldIndexResult")],e);const t=e;export{t as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{GraphDataModelOperationResult as s}from"./GraphDataModelOperationResult.js";let e=class extends s{constructor(r){super(r)}};e=r([o("esri.rest.knowledgeGraph.GraphDeleteNamedTypeResult")],e);const t=e;export{t as default};
5
+ import{_ as r}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import s from"./GraphDataModelOperationResult.js";let e=class extends s{constructor(r){super(r)}};e=r([o("esri.rest.knowledgeGraph.GraphDeleteNamedTypeResult")],e);const t=e;export{t as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{GraphDataModelOperationResult as s}from"./GraphDataModelOperationResult.js";let e=class extends s{constructor(r){super(r)}};e=r([o("esri.rest.knowledgeGraph.GraphDeletePropertyResult")],e);const t=e;export{t as default};
5
+ import{_ as r}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import s from"./GraphDataModelOperationResult.js";let e=class extends s{constructor(r){super(r)}};e=r([o("esri.rest.knowledgeGraph.GraphDeletePropertyResult")],e);const t=e;export{t as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{GraphDataModelOperationResult as o}from"./GraphDataModelOperationResult.js";let e=class extends o{constructor(r){super(r)}};e=r([s("esri.rest.knowledgeGraph.GraphUpdateNamedTypesResult")],e);const t=e;export{t as default};
5
+ import{_ as r}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import o from"./GraphDataModelOperationResult.js";let e=class extends o{constructor(r){super(r)}};e=r([s("esri.rest.knowledgeGraph.GraphUpdateNamedTypesResult")],e);const t=e;export{t as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{GraphDataModelOperationResult as s}from"./GraphDataModelOperationResult.js";let e=class extends s{constructor(r){super(r)}};e=r([o("esri.rest.knowledgeGraph.GraphUpdatePropertyResult")],e);const t=e;export{t as default};
5
+ import{_ as r}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import s from"./GraphDataModelOperationResult.js";let e=class extends s{constructor(r){super(r)}};e=r([o("esri.rest.knowledgeGraph.GraphUpdatePropertyResult")],e);const t=e;export{t as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{GraphDataModelOperationResult as s}from"./GraphDataModelOperationResult.js";let e=class extends s{constructor(r){super(r)}};e=r([o("esri.rest.knowledgeGraph.GraphUpdateSearchIndexResult")],e);const t=e;export{t as default};
5
+ import{_ as r}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import s from"./GraphDataModelOperationResult.js";let e=class extends s{constructor(r){super(r)}};e=r([o("esri.rest.knowledgeGraph.GraphUpdateSearchIndexResult")],e);const t=e;export{t as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- const e="20250619",f="6763ee1a8576228725c1d0fc1fe73f565f5ee598";export{e as buildDate,f as commitHash};
5
+ const a="20250621",c="ea00436b45a50c3f8afd9a8a4c601a1640a36508";export{a as buildDate,c as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import i from"../../../Graphic.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{watch as r,initial as l}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../../../layers/GraphicsLayer.js";import m from"../../../layers/support/TelemetryDisplay.js";import y from"../../../symbols/SimpleFillSymbol.js";import h from"../../../symbols/SimpleLineSymbol.js";import p from"../../../symbols/SimpleMarkerSymbol.js";import{applyCIMSymbolRotation as c}from"../../../symbols/support/cimSymbolUtils.js";import{symbolTypes as b}from"../../../symbols/support/typeUtils.js";import S from"../engine/webgl/OverlayContainer.js";import f from"../engine/webgl/OverlayMultipoint.js";import{LayerView2DMixin as u}from"./LayerView2D.js";import g from"./graphics/GraphicContainer.js";import d from"./graphics/GraphicsView2D.js";import _ from"../../layers/LayerView.js";const L=new t([255,127,0]),v=10005;let T=class extends(u(_)){constructor(){super(...arguments),this._graphicsLayer=new n,this._frameOutlineGraphic=new i({symbol:new y({outline:{type:"simple-line",color:L}})}),this._frameCenterGraphic=new i({symbol:new p({color:L,style:"cross"})}),this._sensorTrailGraphic=new i({symbol:new h({color:L})}),this._sensorSightlineGraphic=new i({symbol:new h({color:L})}),this._sensorLocationGraphic=new i({symbol:new p({color:L})}),this._overlayContainer=null,this._sensorLocationSymbolType=null,this.layer=null,this.sensorLocationSymbol=null,this.symbolAngle=0,this.visibleTelemetryElements=null}destroy(){this._graphicsLayer=s(this._graphicsLayer)}initialize(){this._sensorLocationSymbolType=this.layer?.sensorSymbol.type,this._graphicsLayer.graphics.addMany([this._frameCenterGraphic,this._frameOutlineGraphic,this._sensorLocationGraphic,this._sensorSightlineGraphic,this._sensorTrailGraphic]),this.visibleTelemetryElements=new m({frame:this.layer.telemetryDisplay?.frame??!1,frameCenter:this.layer.telemetryDisplay?.frameCenter??!0,frameOutline:this.layer.telemetryDisplay?.frameOutline??!0,lineOfSight:this.layer.telemetryDisplay?.lineOfSight??!0,sensorLocation:this.layer.telemetryDisplay?.sensorLocation??!0,sensorTrail:this.layer.telemetryDisplay?.sensorTrail??!0})}attach(){this._overlayContainer=new S,this.container.addChild(this._overlayContainer),this._addOverlayMultipoint(),this.graphicsView=new d({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new g(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([r(()=>[this.layer.telemetryDisplay?.frame,this.layer.telemetryDisplay?.frameCenter,this.layer.telemetryDisplay?.frameOutline,this.layer.telemetryDisplay?.sensorLocation,this.layer.telemetryDisplay?.sensorTrail,this.layer.telemetryDisplay?.lineOfSight],()=>this._updateVisibleTelemetryElements(),l),r(()=>[this.layer.telemetry,this.visibleTelemetryElements?.frameCenter,this.visibleTelemetryElements?.frameOutline,this.visibleTelemetryElements?.sensorLocation,this.visibleTelemetryElements?.sensorTrail,this.visibleTelemetryElements?.lineOfSight],()=>this._updateGraphicGeometries(),l),r(()=>this.layer.metadata,()=>this._updateSensorLocationSymbolAngle(),l),r(()=>this.layer?.frameCenterSymbol,()=>this._updateFrameCenterSymbol(),l),r(()=>this.layer?.frameOutlineSymbol,()=>this._updateFrameOutlineSymbol(),l),r(()=>this.layer?.sensorSightLineSymbol,()=>this._updateSensorSightlineSymbol(),l),r(()=>this.layer?.sensorSymbol,()=>this._updateSensorLocationSymbol(),l),r(()=>this.layer?.sensorTrailSymbol,()=>this._updateSensorTrailSymbol(),l),r(()=>this.symbolAngle,()=>this._updateSensorLocationSymbol(),l)])}detach(){this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this.graphicsView=s(this.graphicsView)}supportsSpatialReference(e){return!0}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(e){this.graphicsView.processUpdate(e)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frame=this.layer.telemetryDisplay.frame,this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){const{telemetry:e}=this.layer,{visibleTelemetryElements:t}=this;e&&t&&(t.frameOutline&&e.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,t.sensorTrail&&e.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,t.lineOfSight&&e.lineOfSight?this._sensorSightlineGraphic.geometry=this.layer.telemetry.lineOfSight:this._sensorSightlineGraphic.geometry=null,t.sensorLocation&&e.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,t.frameCenter&&e.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}_updateSensorLocationSymbolAngle(){if(!this.layer?.metadata?.size)return;const e=this.layer?.metadata?.get(v);e?.value&&"number"==typeof e?.value&&(this.symbolAngle=Math.round(e?.value))}_updateSensorLocationSymbol(){switch(this._sensorLocationSymbolType){case"simple-marker":this.sensorLocationSymbol=this.layer.sensorSymbol.clone(),this.sensorLocationSymbol.angle=this.symbolAngle,this._sensorLocationGraphic.symbol=this.sensorLocationSymbol.clone();break;case"picture-marker":this.sensorLocationSymbol=this.layer.sensorSymbol,this.sensorLocationSymbol.angle=this.symbolAngle,this._sensorLocationGraphic.symbol=this.sensorLocationSymbol;break;case"cim":this.sensorLocationSymbol=this.layer.sensorSymbol,c(this.sensorLocationSymbol,this.symbolAngle,!0),this._sensorLocationGraphic.symbol=this.sensorLocationSymbol}}_updateFrameCenterSymbol(){this.layer?.frameCenterSymbol&&(this._frameCenterGraphic.symbol=this.layer.frameCenterSymbol.clone())}_updateFrameOutlineSymbol(){this.layer?.frameOutlineSymbol&&(this._frameOutlineGraphic.symbol=this.layer.frameOutlineSymbol.clone())}_updateSensorSightlineSymbol(){this.layer?.sensorSightLineSymbol&&(this._sensorSightlineGraphic.symbol=this.layer.sensorSightLineSymbol.clone())}_updateSensorTrailSymbol(){this.layer?.sensorTrailSymbol&&(this._sensorTrailGraphic.symbol=this.layer.sensorTrailSymbol.clone())}async _addOverlayMultipoint(){if(!this.layer.videoElement)return;const e=new f(this.layer.videoElement);this.addAttachHandles([r(()=>[this.layer.frameHorizonPoints,this.layer.groundControlPoints,this.layer.frameOpacity,this.layer.telemetryDisplay?.frame],()=>{const{visibleTelemetryElements:t}=this;e.frameHorizonPoints=this.layer.frameHorizonPoints,e.groundControlPoints=this.layer.groundControlPoints,e.opacity=this.layer.frameOpacity,e.visible=t?.frame??!1},l)]),this._overlayContainer.addChild(e),this.view.stage.requestRender()}};e([o()],T.prototype,"graphicsView",void 0),e([o()],T.prototype,"layer",void 0),e([o({types:b})],T.prototype,"sensorLocationSymbol",void 0),e([o()],T.prototype,"symbolAngle",void 0),e([o({type:m})],T.prototype,"visibleTelemetryElements",void 0),T=e([a("esri.views.2d.layers.VideoLayerView2D")],T);const w=T;export{w as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import i from"../../../Graphic.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{watch as r,initial as l}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../../../layers/GraphicsLayer.js";import m from"../../../layers/support/TelemetryDisplay.js";import{getSymbolDisplayAngle as y}from"../../../layers/video/videoUtils.js";import h from"../../../symbols/SimpleFillSymbol.js";import p from"../../../symbols/SimpleLineSymbol.js";import c from"../../../symbols/SimpleMarkerSymbol.js";import{applyCIMSymbolRotation as b}from"../../../symbols/support/cimSymbolUtils.js";import{symbolTypes as f}from"../../../symbols/support/typeUtils.js";import S from"../engine/webgl/OverlayContainer.js";import u from"../engine/webgl/OverlayMultipoint.js";import{LayerView2DMixin as d}from"./LayerView2D.js";import g from"./graphics/GraphicContainer.js";import _ from"./graphics/GraphicsView2D.js";import L from"../../layers/LayerView.js";const v=new t([255,127,0]),T=10005,w=10018;let O=class extends(d(L)){constructor(){super(...arguments),this._graphicsLayer=new n,this._frameOutlineGraphic=new i({symbol:new h({outline:{type:"simple-line",color:v}})}),this._frameCenterGraphic=new i({symbol:new c({color:v,style:"cross"})}),this._sensorTrailGraphic=new i({symbol:new p({color:v})}),this._sensorSightlineGraphic=new i({symbol:new p({color:v})}),this._sensorLocationGraphic=new i({symbol:new c({color:v})}),this._overlayContainer=null,this._sensorLocationSymbolType=null,this.layer=null,this.sensorLocationSymbol=null,this.symbolAngle=0,this.visibleTelemetryElements=null}destroy(){this._graphicsLayer=s(this._graphicsLayer)}initialize(){this._sensorLocationSymbolType=this.layer?.sensorSymbol.type,this._graphicsLayer.graphics.addMany([this._frameCenterGraphic,this._frameOutlineGraphic,this._sensorLocationGraphic,this._sensorSightlineGraphic,this._sensorTrailGraphic]),this.visibleTelemetryElements=new m({frame:this.layer.telemetryDisplay?.frame??!1,frameCenter:this.layer.telemetryDisplay?.frameCenter??!0,frameOutline:this.layer.telemetryDisplay?.frameOutline??!0,lineOfSight:this.layer.telemetryDisplay?.lineOfSight??!0,sensorLocation:this.layer.telemetryDisplay?.sensorLocation??!0,sensorTrail:this.layer.telemetryDisplay?.sensorTrail??!0})}attach(){this._overlayContainer=new S,this.container.addChild(this._overlayContainer),this._addOverlayMultipoint(),this.graphicsView=new _({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new g(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([r(()=>[this.layer.telemetryDisplay?.frame,this.layer.telemetryDisplay?.frameCenter,this.layer.telemetryDisplay?.frameOutline,this.layer.telemetryDisplay?.sensorLocation,this.layer.telemetryDisplay?.sensorTrail,this.layer.telemetryDisplay?.lineOfSight],()=>this._updateVisibleTelemetryElements(),l),r(()=>[this.layer.telemetry,this.visibleTelemetryElements?.frameCenter,this.visibleTelemetryElements?.frameOutline,this.visibleTelemetryElements?.sensorLocation,this.visibleTelemetryElements?.sensorTrail,this.visibleTelemetryElements?.lineOfSight],()=>this._updateGraphicGeometries(),l),r(()=>this.layer.metadata,()=>this._updateSensorLocationSymbolAngle(),l),r(()=>this.layer?.frameCenterSymbol,()=>this._updateFrameCenterSymbol(),l),r(()=>this.layer?.frameOutlineSymbol,()=>this._updateFrameOutlineSymbol(),l),r(()=>this.layer?.sensorSightLineSymbol,()=>this._updateSensorSightlineSymbol(),l),r(()=>this.layer?.sensorSymbol,()=>this._updateSensorLocationSymbol(),l),r(()=>this.layer?.sensorTrailSymbol,()=>this._updateSensorTrailSymbol(),l),r(()=>this.symbolAngle,()=>this._updateSensorLocationSymbol(),l)])}detach(){this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this.graphicsView=s(this.graphicsView)}supportsSpatialReference(e){return!0}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(e){this.graphicsView.processUpdate(e)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frame=this.layer.telemetryDisplay.frame,this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){const{telemetry:e}=this.layer,{visibleTelemetryElements:t}=this;e&&t&&(t.frameOutline&&e.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,t.sensorTrail&&e.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,t.lineOfSight&&e.lineOfSight?this._sensorSightlineGraphic.geometry=this.layer.telemetry.lineOfSight:this._sensorSightlineGraphic.geometry=null,t.sensorLocation&&e.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,t.frameCenter&&e.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}_updateSensorLocationSymbolAngle(){if(!this.layer?.metadata?.size)return;const{source:e,symbolOffset:t=0}=this.layer.sensorSymbolOrientation||{};if(!e&&!t)return;const i=this.layer?.metadata?.get(T)?.value??0,s=this.layer?.metadata?.get(w)?.value??0,r=y({cameraAzimuth:s,platformHeading:i,source:this.layer.sensorSymbolOrientation?.source,symbolOffset:this.layer.sensorSymbolOrientation?.symbolOffset??0});this.symbolAngle=Math.round(Math.abs(r))}_updateSensorLocationSymbol(){switch(this._sensorLocationSymbolType){case"simple-marker":this.sensorLocationSymbol=this.layer.sensorSymbol.clone(),this.sensorLocationSymbol.angle=this.symbolAngle,this._sensorLocationGraphic.symbol=this.sensorLocationSymbol.clone();break;case"picture-marker":this.sensorLocationSymbol=this.layer.sensorSymbol,this.sensorLocationSymbol.angle=this.symbolAngle,this._sensorLocationGraphic.symbol=this.sensorLocationSymbol;break;case"cim":this.sensorLocationSymbol=this.layer.sensorSymbol,b(this.sensorLocationSymbol,this.symbolAngle,!0),this._sensorLocationGraphic.symbol=this.sensorLocationSymbol}}_updateFrameCenterSymbol(){this.layer?.frameCenterSymbol&&(this._frameCenterGraphic.symbol=this.layer.frameCenterSymbol.clone())}_updateFrameOutlineSymbol(){this.layer?.frameOutlineSymbol&&(this._frameOutlineGraphic.symbol=this.layer.frameOutlineSymbol.clone())}_updateSensorSightlineSymbol(){this.layer?.sensorSightLineSymbol&&(this._sensorSightlineGraphic.symbol=this.layer.sensorSightLineSymbol.clone())}_updateSensorTrailSymbol(){this.layer?.sensorTrailSymbol&&(this._sensorTrailGraphic.symbol=this.layer.sensorTrailSymbol.clone())}async _addOverlayMultipoint(){if(!this.layer.videoElement)return;const e=new u(this.layer.videoElement);this.addAttachHandles([r(()=>[this.layer.frameHorizonPoints,this.layer.groundControlPoints,this.layer.frameOpacity,this.layer.telemetryDisplay?.frame],()=>{const{visibleTelemetryElements:t}=this;e.frameHorizonPoints=this.layer.frameHorizonPoints,e.groundControlPoints=this.layer.groundControlPoints,e.opacity=this.layer.frameOpacity,e.visible=t?.frame??!1},l)]),this._overlayContainer.addChild(e),this.view.stage.requestRender()}};e([o()],O.prototype,"graphicsView",void 0),e([o()],O.prototype,"layer",void 0),e([o({types:f})],O.prototype,"sensorLocationSymbol",void 0),e([o()],O.prototype,"symbolAngle",void 0),e([o({type:m})],O.prototype,"visibleTelemetryElements",void 0),O=e([a("esri.views.2d.layers.VideoLayerView2D")],O);const C=O;export{C as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import has from"../../../core/has.js";import r from"../../../core/Logger.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{initial as s,watch as o}from"../../../core/reactiveUtils.js";import{schedule as n}from"../../../core/scheduling.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as c,invert as m}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as d,IDENTITY as h}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{translate as u,getTranslation as p}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as g}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{f as b,o as y}from"../../../chunks/vec32.js";import{fromArray as _,create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as v}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{SphericalECEFSpatialReferenceLike as x}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as C}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{localLinearScaleFactors as j}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectVectorToVector as M}from"../../../geometry/projection/projectVectorToVector.js";import{create as T}from"../../../geometry/support/aaBoundingRect.js";import{BufferViewVec2f as P,BufferViewVec4f as O,BufferViewVec4u8 as U,BufferViewVec4u16 as E,BufferViewVec3f as A,BufferViewVec3u8 as H,BufferViewVec3u16 as I,BufferViewInt16 as V,BufferViewUint32 as R,BufferViewUint16 as S}from"../../../geometry/support/buffer/BufferView.js";import{Lyr3DLightingModel as F,Lyr3DUvWrapMode as k,Lyr3DImageFormat as D,Lyr3DPixelFormat as B,Lyr3DVtxAtrbSemantic as L,Lyr3DType as N}from"../../../layers/ILyr3DWasmPerSceneView.js";import G from"../../../layers/support/SceneModification.js";import{getElevationOffsetInMeters as z}from"../../../support/elevationInfoUtils.js";import{ViewingMode as W}from"../../ViewingMode.js";import{toWasmModification as $}from"./I3SMeshWorkerHandle.js";import{IntegratedMesh3DTilesViewPerformanceInfo as J}from"./IntegratedMesh3DTilesViewPerformanceInfo.js";import{DrapeTargetType as q}from"./interfaces.js";import{LayerView3D as K}from"./LayerView3D.js";import{addLayerViewToWasm as X,removeLayerViewFromWasm as Q,getLyr3DWasm as Y}from"./Lyr3DWasm.js";import{LayerElevationProvider as Z}from"./i3s/LayerElevationProvider.js";import{primTypeConversion as ee,alphaModeConversion as te,faceCullingConversion as re,wrapModeConversion as ie,lyr3DTypeToByteSize as se}from"./support/lyr3dTypeConversions.js";import{Tiles3DIntersectionHandler as oe}from"./support/Tiles3DIntersectionHandler.js";import{ElevationRange as ne}from"../support/ElevationRange.js";import{toBoundingRect as ae}from"../support/extentUtils.js";import{Obb as le,compute as ce}from"../support/orientedBoundingBox.js";import{ObjectParameters as me}from"../webgl-engine/collections/Component/ObjectParameters.js";import{GeometryParameters as de,createVertexBufferLayout as he}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as ue}from"../webgl-engine/collections/Component/Transform.js";import{ComponentParameterSummary as pe}from"../webgl-engine/collections/Component/Material/ComponentMaterial.js";import{RenderTexture as fe}from"../webgl-engine/core/material/RenderTexture.js";import{TextureCoordinateType as ge}from"../webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{getEllipsoidMode as be}from"../webgl-engine/core/shaderLibrary/util/EllipsoidMode.js";import{Attribute as ye}from"../webgl-engine/lib/Attribute.js";import{CullFaceOptions as _e,AlphaDiscardMode as we,TextureEncodingMimeType as ve}from"../webgl-engine/lib/basicInterfaces.js";import{compressAndTransformNormals as xe}from"../webgl-engine/lib/Normals.js";import{Texture as Ce}from"../webgl-engine/lib/Texture.js";import{VertexAttribute as je}from"../webgl-engine/lib/VertexAttribute.js";import{writeDefaultAttribute as Me,writeBufferVec2 as Te}from"../webgl-engine/materials/internal/bufferWriterUtils.js";import Pe from"../../layers/LayerView.js";import{isInEffectiveScaleRange as Oe}from"../../support/layerViewUtils.js";import{TextureCompressionTracker as Ue}from"../../support/TextureCompressionTracker.js";import{alphaCutoff as Ee}from"../../../webscene/support/AlphaCutoff.js";var Ae;!function(e){e[e.API=1]="API",e[e.VerboseAPI=2]="VerboseAPI",e[e.Error=3]="Error"}(Ae||(Ae={}));class He{constructor(){this.handle=0,this.isVisible=!1,this.components=[],this.textureMemoryUsage=0,this.vboMemoryUsage=0,this.cpuMemoryUsage=0,this.textures=[]}get usedMemory(){return this.textureMemoryUsage+this.vboMemoryUsage+this.cpuMemoryUsage}get cachedMemory(){return this.usedMemory}}function Ie(e){return Math.round(e/1048.576)/1e3}let Ve=class extends(K(Pe)){constructor(){super(...arguments),this.type="integrated-mesh-3dtiles",this._compressionTracker=new Ue,this._modifications=new Array,this._visibleGeometryChangedSchedulerHandle=null,this._wasmLayerId=-1,this.ignoresMemoryFactor=!1,this.drapeTargetType=q.WithoutRasterImage,this._applySSAO=!has("disable-feature:im-ssao"),this._shadeNormals=!!has("enable-feature:im-shading"),this._lyrHandleToObjects=new Map,this._initialCullFace=new Map,this._suspendedHandle=null,this._dbgFlags=new Set}get hasModifications(){return this._modifications&&this._modifications.length>0}initialize(){if(this._dbgFlags.add(Ae.Error),this._dbg(Ae.VerboseAPI,"Tiles3DLayerView3D initialize() called"),this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),s),!this._canProjectWithoutEngine())throw new t("layerview:spatial-reference-incompatible","The spatial reference of this scene layer is incompatible with the spatial reference of the view",{});const e=X(this).then(e=>{this._wasmLayerId=e,this._intersectionHandler=new oe(this),this.view.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged(),s),this._updatingHandles.add(()=>this.view.clippingArea,()=>this._clippingAreaChanged(),s),this._elevationProvider=new Z({view:this.view,layerElevationSource:this,intersectionHandler:this._intersectionHandler}),this.view.elevationProvider.register("im",this._elevationProvider),this.view.basemapTerrain.overlayManager.registerDrapeTarget(this);const t=this.view.resourceController.memoryController.newCache(`t3d-${this.uid}`,e=>this._onRemoveFromCache(e));this._memCache=t,this.addHandles([o(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e))]),this._suspendedHandle=o(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),s)});this.addResolvingPromise(e)}destroy(){this._dbg(Ae.VerboseAPI,"Tiles3DLayerView3D destroy() called"),Q(this),this._suspendedHandle&&(this._suspendedHandle.remove(),this._suspendedHandle=null),this._intersectionHandler&&(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null),this._elevationProvider&&(this._elevationProvider.objectsChanged(this._obbs),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this.view.basemapTerrain.overlayManager.unregisterDrapeTarget(this),this._lyrHandleToObjects.forEach(e=>this.freeObject(e)),this._lyrHandleToObjects.clear(),this._initialCullFace.clear(),this._memCache=i(this._memCache),this._updatingHandles=i(this._updatingHandles),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null)}_modificationsChanged(){const e=this.layer.spatialReference,t=$(this._layerClippingArea,this._modifications,e);this._wasm?.setMeshModifications(this,t,e.wkid)}_clippingAreaChanged(){const e=this.layer.spatialReference,t=T();this._layerClippingArea=ae(this.view.clippingArea,t,e)?t:null,this._modificationsChanged()}_visibleGeometryChanged(){this._visibleGeometryChangedSchedulerHandle??=n(()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null})}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),this.objects.forEach(t=>{const r=this._collection.getMaterial(t);r.commonMaterialParameters.hasSlicePlane=e,r.commonMaterialParameters.cullFace=e?_e.None:this._initialCullFace.get(t)})}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,z(e))}get _obbs(){return this.objects.map(e=>this._collection.getComponentObb(e))}get _wasm(){return Y(this.view)}get wasmLayerId(){return this._wasmLayerId}get usedMemory(){let e=0;return this._lyrHandleToObjects.forEach(t=>{t.isVisible&&(e+=t.usedMemory)}),e}get unloadedMemory(){return 0}get cachedMemory(){let e=0;return this._lyrHandleToObjects.forEach(t=>{t.isVisible||(e+=t.usedMemory)}),e}get visibleAtCurrentScale(){return Oe(this.layer.effectiveScaleRange,this.view.scale)}get performanceInfo(){let e=0,t=0,r=0,i=0,s=0,o=0;return this._lyrHandleToObjects.forEach(n=>{n.isVisible?(e+=n.textureMemoryUsage,t+=n.vboMemoryUsage,s++):(r+=n.textureMemoryUsage,i+=n.vboMemoryUsage,o++)}),new J(this.usedMemory,s,o,Ie(t),Ie(e),Ie(i),Ie(r))}_canProjectWithoutEngine(){if(this.view.state.viewingMode===W.Local){const e=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1;if(3857!==e&&32662!==e)return!1}return!0}get _stage(){return this.view.stage}get _collection(){return this._stage.renderView.componentObjectCollection}get elevationOffset(){return z(this.layer.elevationInfo)}get elevationRange(){const e=this.fullExtent;return e?.zmin&&e?.zmax?new ne(e.zmin,e.zmax):null}getElevationRange(e){return null}get fullExtent(){return this.layer.fullExtent}get objects(){return Array.from(this._lyrHandleToObjects.values()).reduce((e,t)=>e.concat(t.components),new Array)}isUpdating(){const e=this._wasm;return!(this._wasmLayerId<0||null==e)&&(e.isUpdating(this._wasmLayerId)||this._compressionTracker.compressing)}updatingFlagChanged(){this.notifyChange("updating")}async createRenderable(e){const t=e.meshData;if(null==t.data)throw new Error("meshData.data undefined");if(t.desc=JSON.parse(t.desc),null==t.desc)throw new Error("meshData.desc undefined");const r=_(t.desc.origin),i=new Array,s=new Map,o=new He;o.handle=e.handle,this._lyrHandleToObjects.set(e.handle,o);const n=this.view.basemapTerrain.spatialReference;let a,l;if("global"===this.view.viewingMode){const e=f();C(x,r,e,n),a=c(d(),e),l=m(d(),a)}else a=h,l=h;const T=f();u(T,T,r);const O=p(w(),T);let U=null;const E=w();if(t.desc.obb){const e=t.desc.obb.quaternion;U=new le(t.desc.obb.center,t.desc.obb.halfSize,g(e[0],e[1],e[2],e[3]))}for(let c=0;c<t.desc.prims.length;c++){const e=t.desc.prims[c];this._dbg(Ae.VerboseAPI,JSON.stringify(e));if(null==ee[e.ptype]||null==t.data){this._dbg(Ae.VerboseAPI,"[Unsupported Feature] Unsupported primitive mode ("+e.ptype+"). Skipping primitive.");continue}const m=t.desc?.materials&&null!=e.materialId?t.desc.materials[e.materialId]:null,d=null!=m?m.lightingModel:F.Unlit,{positionView:u,positionAttr:p,normalsView:f,normalsAttr:g,colorAttr:_,texCoord0Attr:x,indicesView:C}=this.getBufferViews(e,t.data.buffer,a);if(null==p||null==u||null==C)continue;const T=new de(null!=_,x?ge.Default:ge.None,null!=f,this._shadeNormals,this._applySSAO),A=p.data.length/p.size,H=(e,t)=>!e||e.data.length/e.size===A||(this._dbg(Ae.Error,`${t} !== numPos. Skipping primitive.`),!1);if(!H(x,"numTexcoord")||!H(_,"numColors")||!H(g,"normals"))continue;const I=he(T);if(null!=U?U=U.clone():(U=ce(p),b(E,U.center,r),U.center=E),a!==h)for(let t=0;t<u.count;t++)u.getVec(t,E),y(E,E,a),u.setVec(t,E);const V=I.createBuffer(p.data.length);if(Me(je.POSITION,p,null,null,V,0),null!=x){const e=V.getField(je.UV0,P);Te(x,e,0)}null!=_&&Me(je.COLOR,p,null,null,V,0),null!=g&&Me(je.NORMALCOMPRESSED,g,null,null,V,0);const R=new Uint32Array([0,C.typedBuffer.length]),S={vertices:{data:V.buffer,count:V.byteLength/I.stride,layoutParameters:T},positionData:{positions:u.typedBuffer,indices:C.typedBuffer},indices:C.typedBuffer,componentOffsets:R};o.cpuMemoryUsage+=u.count,o.cpuMemoryUsage+=C.count;const k=this.view.renderSpatialReference,D=w(),B=[1,1,1];j(O,k,B,n)||this._dbg(Ae.Error,"Unsupported coordinate system for IM overlay"),M(O,k,D,n);const L=this._collection.createObject(new me(v(D[0],D[1],B[0],B[1]),new ue(O,l),U,S));m&&this._collection.updateMaterial(L,e=>{e.baseColor=m.baseColorFactor,e.usePBR=d===F.Pbr,e.hasParametersFromSource=!1,e.baseColorTexture=this._getTexture(m.baseColorTex,t,s,o),e.usePBR&&(e.mrrFactors=[m.metallicFactor,m.roughnessFactor,0],e.emissiveBaseColor=m.emissiveFactor??[0,0,0],e.metallicRoughnessTexture=this._getTexture(m.metalTex,t,s,o),e.emissionTexture=this._getTexture(m.emissiveTex,t,s,o),e.occlusionTexture=this._getTexture(m.occlusionTex,t,s,o),e.normalTexture=this._getTexture(m.normalTex,t,s,o)),e.objectOpacity=0,e.alphaDiscardMode=we.Mask;const r=[];e.baseColorTexture&&r.push(e.baseColorTexture.loadPromise),e.usePBR&&e.metallicRoughnessTexture&&r.push(e.metallicRoughnessTexture.loadPromise),e.usePBR&&e.emissionTexture&&r.push(e.emissionTexture.loadPromise),e.usePBR&&e.occlusionTexture&&r.push(e.occlusionTexture.loadPromise),e.usePBR&&e.normalTexture&&r.push(e.normalTexture.loadPromise);const n=Promise.all(r);i.push(n),n.then(()=>{e.alphaDiscardMode=te[m.alphaMode],e.objectOpacity=1,o.textureMemoryUsage+=e.baseColorTexture?.glTexture?.usedMemory||0,e.usePBR&&(o.textureMemoryUsage+=e.metallicRoughnessTexture?.glTexture?.usedMemory||0,o.textureMemoryUsage+=e.emissionTexture?.glTexture?.usedMemory||0,o.textureMemoryUsage+=e.occlusionTexture?.glTexture?.usedMemory||0,o.textureMemoryUsage+=e.normalTexture?.glTexture?.usedMemory||0)}),e.commonMaterialParameters.doubleSided=m.isDoubleSided,e.commonMaterialParameters.cullFace=m.faceCulling?re[m.faceCulling]:_e.Back,this._initialCullFace.set(L,e.commonMaterialParameters.cullFace),e.commonMaterialParameters.hasSlicePlane=this.slicePlaneEnabled,e.componentParameters.castShadows=pe.All,e.textureAlphaCutoff=m.alphaCutoff??Ee,e.alphaDiscardMode=te[m.alphaMode],e.isIntegratedMesh=!0,e.polygonOffsetEnabled=!1,e.hasOccludees=!1,e.ellipsoidMode=be(this.view.spatialReference)}),o.components.push(L),o.vboMemoryUsage+=this._collection.getObjectGPUMemoryUsage(L)}if(await Promise.all(i),s.forEach(e=>{o.textures.push(e)}),!this._memCache)throw new Error("no memCache");return this._memCache.put(`${o.handle}`,o),{memUsageBytes:o.usedMemory}}freeRenderable(e){const t=this._lyrHandleToObjects.get(e);t&&(this.freeObject(t),this._lyrHandleToObjects.delete(e))}freeObject(e){this._memCache&&this._memCache.pop(`${e.handle}`),e.components.forEach(t=>{e.textures.forEach(e=>{this._stage.removeTexture(e)}),this._collection.destroyObject(t),this._initialCullFace.delete(t)})}setRenderableVisibility(e,t,r){if(this._memCache){for(let i=0;i<r;++i){const r=e[i],s=t[i];if(!s)continue;const o=this._lyrHandleToObjects.get(r);o&&(this._visibleGeometryChanged(),o.isVisible=s,o.components.forEach(e=>{this._collection.setObjectVisibility(e,s),this._elevationProvider.objectChanged(this._collection.getComponentObb(e))}),this._memCache.pop(`${r}`))}for(let i=0;i<r;++i){const r=e[i],s=t[i];if(s)continue;const o=this._lyrHandleToObjects.get(r);o&&(this._visibleGeometryChanged(),o.isVisible=s,o.components.forEach(e=>{this._collection.setObjectVisibility(e,s),this._elevationProvider.objectChanged(this._collection.getComponentObb(e))}),this._memCache.put(`${r}`,o))}}}_getTexture(e,t,r,i){let s=null;if(e&&t.desc?.images&&t.data?.buffer){const o=t.desc.images[e?.imageId];if(s=r.get(o),!s&&o){const n=this._stage.renderView.renderingContext.parameters.maxMaxAnisotropy,a=!!o.mipCount||n>1,l=ie[e.wrapMode??k.None];let c=o.alpha?4:3;const m=new Uint8Array(t.data.buffer,o.data.byteOffset,o.data.byteCount);let d=null,h=null,u=null;switch(o.format){case D.Raw:o.pixelFormat===B.R8?(d=m,c=1,h=""):o.pixelFormat===B.Rgb8?(d=m,c=3,h=""):o.pixelFormat===B.Rgba8&&(d=m,c=4,h="");break;case D.Dxt1:d=m,c=3,h=ve.DDS_ENCODING;break;case D.Dxt5:d=m,c=4,h=ve.DDS_ENCODING;break;case D.Basis:d=m,c=3,h=ve.KTX2_ENCODING;break;case D.Png:h="image/png",u=document.createElement("img");break;case D.Jpeg:h="image/jpeg",u=document.createElement("img");break;case D.Etc2:h="image/ktx",u=document.createElement("img");break;case D.Astc:this._dbg(Ae.Error,"Astc texture not supported");break;case D.Pvrtc:this._dbg(Ae.Error,"Pvrtc texture not supported")}if(u&&h){const e=new Blob([m],{type:h});u.src=URL.createObjectURL(e),d=u}if(d&&null!=h){const e=has("enable-feature:esri-compress-IM-textures")?{compressionTracker:this._compressionTracker,compressionCallback:e=>{e&&e>0&&(i.textureMemoryUsage-=e)}}:void 0;s=new Ce(d,{mipmap:a,maxAnisotropy:n,encoding:h,wrap:l,components:c,compressionOptions:e,noUnpackFlip:!0,width:o.mip0Width,height:o.mip0Height}),this._stage.addTexture(s),r.set(o,s)}}}return s?new fe(this.view.stage.renderView.textures,s.id):null}getBufferViews(e,t,r){let i,s,o,n,a,l,c,m=null;for(let h=0;h<e.atrbs.length;h++){const c=e.atrbs[h],u=c.view,p=void 0,f=u.byteOffset+u.byteCount,g=u.byteCount/se[u.type],b=[...Array(g).keys()].map(e=>e);try{switch(c.sem){case L.Position:3!==u.ncomp||u.type!==N.F32?this._dbg(Ae.Error,"[Unsupported Feature] Unsupported view for Position ("+u+")"):(i=new A(t,u.byteOffset,p,f),s=new ye(i.typedBuffer,b,3));break;case L.Normal:if(3!==u.ncomp||u.type!==N.F32)this._dbg(Ae.Error,"[Unsupported Feature] Unsupported view for Normal ("+u+")");else{const e=new A(t,u.byteOffset,p,f),i=xe(e.typedBuffer,r);a=new V(i),l=new ye(a.typedBuffer,b,2)}break;case L.TexCoord:2!==u.ncomp||u.type!==N.F32?this._dbg(Ae.Error,"[Unsupported Feature] Unsupported view for Texcoord ("+u+")"):void 0===n&&(n=new ye(new P(t,u.byteOffset,p,f).typedBuffer,b,2));break;case L.Color:4===u.ncomp?(u.type===N.F32&&(m=new O(t,u.byteOffset,p,f)),u.type===N.U8&&(m=new U(t,u.byteOffset,p,f)),u.type===N.U16&&(m=new E(t,u.byteOffset,p,f))):3===u.ncomp&&(u.type===N.F32&&(m=new A(t,u.byteOffset,p,f)),u.type===N.U8&&(m=new H(t,u.byteOffset,p,f)),u.type===N.U16&&(m=new I(t,u.byteOffset,p,f))),null==m?this._dbg(Ae.VerboseAPI,"[Unsupported Feature] Unsupported view for Color ("+u+")"):o=new ye(m.typedBuffer,b,u.ncomp);break;case L.FeatureIndex:break;default:this._dbg(Ae.VerboseAPI,"[Unsupported Feature] Unsupported semantic ("+c.sem+"). Skipping vertex attribute.")}}catch(d){this._dbg(Ae.VerboseAPI,"Error Creating buffer ("+d+"). Skipping vertex attribute.")}}if(e.index){const r=e.index.view,i=void 0,s=r.byteOffset+r.byteCount;switch(e.index.view.type){case N.U16:c=new S(t,r.byteOffset,i,s);break;case N.U32:c=new R(t,r.byteOffset,i,s);break;case N.U8:default:this._dbg(Ae.Error,"[Unsupported Feature] index type not supported ("+r.type+").")}}if(null==c&&null!=i){const e=i.count;if(e<65535){const t=new Uint16Array(e);c=new S(t)}else{const t=new Uint32Array(e);c=new R(t)}for(let t=0;t<e;t++)c.set(t,t)}return{positionView:i,positionAttr:s,colorAttr:o,texCoord0Attr:n,indicesView:c,normalsView:a,normalsAttr:l}}_loadModifications(){if(this.removeHandles("modifications"),null==this.layer.modifications)return void(this._modifications=[]);const e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>this._modifications=e.toArray(),s),"modifications")}_onRemoveFromCache(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}_dbg(e,t){this._dbgFlags.has(e)&&(e===Ae.Error?r.getLogger(this).error(t):r.getLogger(this).warn(t))}};e([a({type:[G]})],Ve.prototype,"_modifications",void 0),e([a()],Ve.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([a()],Ve.prototype,"layer",void 0),e([a({readOnly:!0})],Ve.prototype,"visibleAtCurrentScale",null),e([a()],Ve.prototype,"elevationOffset",null),Ve=e([l("esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D")],Ve);const Re=Ve;export{Re as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import has from"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{initial as i,watch as s}from"../../../core/reactiveUtils.js";import{schedule as o}from"../../../core/scheduling.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as l,invert as c}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as m,IDENTITY as d}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{translate as h,getTranslation as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as p}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as f}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{f as g,o as b}from"../../../chunks/vec32.js";import{fromArray as y,create as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{SphericalECEFSpatialReferenceLike as v}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as x}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{localLinearScaleFactors as C}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectVectorToVector as j}from"../../../geometry/projection/projectVectorToVector.js";import{create as M}from"../../../geometry/support/aaBoundingRect.js";import{BufferViewVec2f as T,BufferViewVec4f as P,BufferViewVec4u8 as O,BufferViewVec4u16 as U,BufferViewVec3f as E,BufferViewVec3u8 as A,BufferViewVec3u16 as H,BufferViewInt16 as I,BufferViewUint32 as R,BufferViewUint16 as V}from"../../../geometry/support/buffer/BufferView.js";import{Lyr3DLightingModel as S,Lyr3DUvWrapMode as F,Lyr3DImageFormat as k,Lyr3DPixelFormat as D,Lyr3DVtxAtrbSemantic as B,Lyr3DType as L}from"../../../layers/ILyr3DWasmPerSceneView.js";import N from"../../../layers/support/SceneModification.js";import{getElevationOffsetInMeters as G}from"../../../support/elevationInfoUtils.js";import{ViewingMode as z}from"../../ViewingMode.js";import{toWasmModification as W}from"./I3SMeshWorkerHandle.js";import{IntegratedMesh3DTilesViewPerformanceInfo as $}from"./IntegratedMesh3DTilesViewPerformanceInfo.js";import{DrapeTargetType as J}from"./interfaces.js";import{LayerView3D as q}from"./LayerView3D.js";import{addLayerViewToWasm as K,removeLayerViewFromWasm as X,getLyr3DWasm as Q}from"./Lyr3DWasm.js";import{LayerElevationProvider as Y}from"./i3s/LayerElevationProvider.js";import{primTypeConversion as Z,alphaModeConversion as ee,faceCullingConversion as te,wrapModeConversion as re,lyr3DTypeToByteSize as ie}from"./support/lyr3dTypeConversions.js";import{Tiles3DIntersectionHandler as se}from"./support/Tiles3DIntersectionHandler.js";import{ElevationRange as oe}from"../support/ElevationRange.js";import{toBoundingRect as ne}from"../support/extentUtils.js";import{Obb as ae,compute as le}from"../support/orientedBoundingBox.js";import{ObjectParameters as ce}from"../webgl-engine/collections/Component/ObjectParameters.js";import{GeometryParameters as me,createVertexBufferLayout as de}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as he}from"../webgl-engine/collections/Component/Transform.js";import{ComponentParameterSummary as ue}from"../webgl-engine/collections/Component/Material/ComponentMaterial.js";import{RenderTexture as pe}from"../webgl-engine/core/material/RenderTexture.js";import{TextureCoordinateType as fe}from"../webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{getEllipsoidMode as ge}from"../webgl-engine/core/shaderLibrary/util/EllipsoidMode.js";import{Attribute as be}from"../webgl-engine/lib/Attribute.js";import{CullFaceOptions as ye,AlphaDiscardMode as _e,TextureEncodingMimeType as we}from"../webgl-engine/lib/basicInterfaces.js";import{compressAndTransformNormals as ve}from"../webgl-engine/lib/Normals.js";import{Texture as xe}from"../webgl-engine/lib/Texture.js";import{VertexAttribute as Ce}from"../webgl-engine/lib/VertexAttribute.js";import{writeDefaultAttribute as je,writeBufferVec2 as Me}from"../webgl-engine/materials/internal/bufferWriterUtils.js";import Te from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as Pe,isInEffectiveScaleRange as Oe}from"../../support/layerViewUtils.js";import{TextureCompressionTracker as Ue}from"../../support/TextureCompressionTracker.js";import{alphaCutoff as Ee}from"../../../webscene/support/AlphaCutoff.js";var Ae;!function(e){e[e.API=1]="API",e[e.VerboseAPI=2]="VerboseAPI",e[e.Error=3]="Error"}(Ae||(Ae={}));class He{constructor(){this.handle=0,this.isVisible=!1,this.components=[],this.textureMemoryUsage=0,this.vboMemoryUsage=0,this.cpuMemoryUsage=0,this.textures=[]}get usedMemory(){return this.textureMemoryUsage+this.vboMemoryUsage+this.cpuMemoryUsage}get cachedMemory(){return this.usedMemory}}function Ie(e){return Math.round(e/1048.576)/1e3}let Re=class extends(q(Te)){constructor(){super(...arguments),this.type="integrated-mesh-3dtiles",this._compressionTracker=new Ue,this._modifications=new Array,this._visibleGeometryChangedSchedulerHandle=null,this._wasmLayerId=-1,this.ignoresMemoryFactor=!1,this.drapeTargetType=J.WithoutRasterImage,this._applySSAO=!has("disable-feature:im-ssao"),this._shadeNormals=!!has("enable-feature:im-shading"),this._lyrHandleToObjects=new Map,this._initialCullFace=new Map,this._suspendedHandle=null,this._dbgFlags=new Set}get hasModifications(){return this._modifications&&this._modifications.length>0}initialize(){if(this._dbgFlags.add(Ae.Error),this._dbg(Ae.VerboseAPI,"Tiles3DLayerView3D initialize() called"),this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),i),!this._canProjectWithoutEngine())throw Pe("layer",this.layer.spatialReference.wkid,this.view.renderSpatialReference?.wkid);const e=K(this).then(e=>{this._wasmLayerId=e,this._intersectionHandler=new se(this),this.view.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged(),i),this._updatingHandles.add(()=>this.view.clippingArea,()=>this._clippingAreaChanged(),i),this._elevationProvider=new Y({view:this.view,layerElevationSource:this,intersectionHandler:this._intersectionHandler}),this.view.elevationProvider.register("im",this._elevationProvider),this.view.basemapTerrain.overlayManager.registerDrapeTarget(this);const t=this.view.resourceController.memoryController.newCache(`t3d-${this.uid}`,e=>this._onRemoveFromCache(e));this._memCache=t,this.addHandles([s(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e))]),this._suspendedHandle=s(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),i)});this.addResolvingPromise(e)}destroy(){this._dbg(Ae.VerboseAPI,"Tiles3DLayerView3D destroy() called"),X(this),this._suspendedHandle&&(this._suspendedHandle.remove(),this._suspendedHandle=null),this._intersectionHandler&&(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null),this._elevationProvider&&(this._elevationProvider.objectsChanged(this._obbs),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this.view.basemapTerrain.overlayManager.unregisterDrapeTarget(this),this._lyrHandleToObjects.forEach(e=>this.freeObject(e)),this._lyrHandleToObjects.clear(),this._initialCullFace.clear(),this._memCache=r(this._memCache),this._updatingHandles=r(this._updatingHandles),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null)}_modificationsChanged(){const e=this.layer.spatialReference,t=W(this._layerClippingArea,this._modifications,e);this._wasm?.setMeshModifications(this,t,e.wkid)}_clippingAreaChanged(){const e=this.layer.spatialReference,t=M();this._layerClippingArea=ne(this.view.clippingArea,t,e)?t:null,this._modificationsChanged()}_visibleGeometryChanged(){this._visibleGeometryChangedSchedulerHandle??=o(()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null})}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),this.objects.forEach(t=>{const r=this._collection.getMaterial(t);r.commonMaterialParameters.hasSlicePlane=e,r.commonMaterialParameters.cullFace=e?ye.None:this._initialCullFace.get(t)})}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,G(e))}get _obbs(){return this.objects.map(e=>this._collection.getComponentObb(e))}get _wasm(){return Q(this.view)}get wasmLayerId(){return this._wasmLayerId}get usedMemory(){let e=0;return this._lyrHandleToObjects.forEach(t=>{t.isVisible&&(e+=t.usedMemory)}),e}get unloadedMemory(){return 0}get cachedMemory(){let e=0;return this._lyrHandleToObjects.forEach(t=>{t.isVisible||(e+=t.usedMemory)}),e}get visibleAtCurrentScale(){return Oe(this.layer.effectiveScaleRange,this.view.scale)}get performanceInfo(){let e=0,t=0,r=0,i=0,s=0,o=0;return this._lyrHandleToObjects.forEach(n=>{n.isVisible?(e+=n.textureMemoryUsage,t+=n.vboMemoryUsage,s++):(r+=n.textureMemoryUsage,i+=n.vboMemoryUsage,o++)}),new $(this.usedMemory,s,o,Ie(t),Ie(e),Ie(i),Ie(r))}_canProjectWithoutEngine(){if(this.view.state.viewingMode===z.Local){const e=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1;if(3857!==e&&32662!==e)return!1}return!0}get _stage(){return this.view.stage}get _collection(){return this._stage.renderView.componentObjectCollection}get elevationOffset(){return G(this.layer.elevationInfo)}get elevationRange(){const e=this.fullExtent;return e?.zmin&&e?.zmax?new oe(e.zmin,e.zmax):null}getElevationRange(e){return null}get fullExtent(){return this.layer.fullExtent}get objects(){return Array.from(this._lyrHandleToObjects.values()).reduce((e,t)=>e.concat(t.components),new Array)}isUpdating(){const e=this._wasm;return!(this._wasmLayerId<0||null==e)&&(e.isUpdating(this._wasmLayerId)||this._compressionTracker.compressing)}updatingFlagChanged(){this.notifyChange("updating")}async createRenderable(e){const t=e.meshData;if(null==t.data)throw new Error("meshData.data undefined");if(t.desc=JSON.parse(t.desc),null==t.desc)throw new Error("meshData.desc undefined");const r=y(t.desc.origin),i=new Array,s=new Map,o=new He;o.handle=e.handle,this._lyrHandleToObjects.set(e.handle,o);const n=this.view.basemapTerrain.spatialReference;let a,M;if("global"===this.view.viewingMode){const e=p();x(v,r,e,n),a=l(m(),e),M=c(m(),a)}else a=d,M=d;const P=p();h(P,P,r);const O=u(_(),P);let U=null;const E=_();if(t.desc.obb){const e=t.desc.obb.quaternion;U=new ae(t.desc.obb.center,t.desc.obb.halfSize,f(e[0],e[1],e[2],e[3]))}for(let l=0;l<t.desc.prims.length;l++){const e=t.desc.prims[l];this._dbg(Ae.VerboseAPI,JSON.stringify(e));if(null==Z[e.ptype]||null==t.data){this._dbg(Ae.VerboseAPI,"[Unsupported Feature] Unsupported primitive mode ("+e.ptype+"). Skipping primitive.");continue}const c=t.desc?.materials&&null!=e.materialId?t.desc.materials[e.materialId]:null,m=null!=c?c.lightingModel:S.Unlit,{positionView:h,positionAttr:u,normalsView:p,normalsAttr:f,colorAttr:y,texCoord0Attr:v,indicesView:x}=this.getBufferViews(e,t.data.buffer,a);if(null==u||null==h||null==x)continue;const P=new me(null!=y,v?fe.Default:fe.None,null!=p,this._shadeNormals,this._applySSAO),A=u.data.length/u.size,H=(e,t)=>!e||e.data.length/e.size===A||(this._dbg(Ae.Error,`${t} !== numPos. Skipping primitive.`),!1);if(!H(v,"numTexcoord")||!H(y,"numColors")||!H(f,"normals"))continue;const I=de(P);if(null!=U?U=U.clone():(U=le(u),g(E,U.center,r),U.center=E),a!==d)for(let t=0;t<h.count;t++)h.getVec(t,E),b(E,E,a),h.setVec(t,E);const R=I.createBuffer(u.data.length);if(je(Ce.POSITION,u,null,null,R,0),null!=v){const e=R.getField(Ce.UV0,T);Me(v,e,0)}null!=y&&je(Ce.COLOR,u,null,null,R,0),null!=f&&je(Ce.NORMALCOMPRESSED,f,null,null,R,0);const V=new Uint32Array([0,x.typedBuffer.length]),F={vertices:{data:R.buffer,count:R.byteLength/I.stride,layoutParameters:P},positionData:{positions:h.typedBuffer,indices:x.typedBuffer},indices:x.typedBuffer,componentOffsets:V};o.cpuMemoryUsage+=h.count,o.cpuMemoryUsage+=x.count;const k=this.view.renderSpatialReference,D=_(),B=[1,1,1];C(O,k,B,n)||this._dbg(Ae.Error,"Unsupported coordinate system for IM overlay"),j(O,k,D,n);const L=this._collection.createObject(new ce(w(D[0],D[1],B[0],B[1]),new he(O,M),U,F));c&&this._collection.updateMaterial(L,e=>{e.baseColor=c.baseColorFactor,e.usePBR=m===S.Pbr,e.hasParametersFromSource=!1,e.baseColorTexture=this._getTexture(c.baseColorTex,t,s,o),e.usePBR&&(e.mrrFactors=[c.metallicFactor,c.roughnessFactor,0],e.emissiveBaseColor=c.emissiveFactor??[0,0,0],e.metallicRoughnessTexture=this._getTexture(c.metalTex,t,s,o),e.emissionTexture=this._getTexture(c.emissiveTex,t,s,o),e.occlusionTexture=this._getTexture(c.occlusionTex,t,s,o),e.normalTexture=this._getTexture(c.normalTex,t,s,o)),e.objectOpacity=0,e.alphaDiscardMode=_e.Mask;const r=[];e.baseColorTexture&&r.push(e.baseColorTexture.loadPromise),e.usePBR&&e.metallicRoughnessTexture&&r.push(e.metallicRoughnessTexture.loadPromise),e.usePBR&&e.emissionTexture&&r.push(e.emissionTexture.loadPromise),e.usePBR&&e.occlusionTexture&&r.push(e.occlusionTexture.loadPromise),e.usePBR&&e.normalTexture&&r.push(e.normalTexture.loadPromise);const n=Promise.all(r);i.push(n),n.then(()=>{e.alphaDiscardMode=ee[c.alphaMode],e.objectOpacity=1,o.textureMemoryUsage+=e.baseColorTexture?.glTexture?.usedMemory||0,e.usePBR&&(o.textureMemoryUsage+=e.metallicRoughnessTexture?.glTexture?.usedMemory||0,o.textureMemoryUsage+=e.emissionTexture?.glTexture?.usedMemory||0,o.textureMemoryUsage+=e.occlusionTexture?.glTexture?.usedMemory||0,o.textureMemoryUsage+=e.normalTexture?.glTexture?.usedMemory||0)}),e.commonMaterialParameters.doubleSided=c.isDoubleSided,e.commonMaterialParameters.cullFace=c.faceCulling?te[c.faceCulling]:ye.Back,this._initialCullFace.set(L,e.commonMaterialParameters.cullFace),e.commonMaterialParameters.hasSlicePlane=this.slicePlaneEnabled,e.componentParameters.castShadows=ue.All,e.textureAlphaCutoff=c.alphaCutoff??Ee,e.alphaDiscardMode=ee[c.alphaMode],e.isIntegratedMesh=!0,e.polygonOffsetEnabled=!1,e.hasOccludees=!1,e.ellipsoidMode=ge(this.view.spatialReference)}),o.components.push(L),o.vboMemoryUsage+=this._collection.getObjectGPUMemoryUsage(L)}if(await Promise.all(i),s.forEach(e=>{o.textures.push(e)}),!this._memCache)throw new Error("no memCache");return this._memCache.put(`${o.handle}`,o),{memUsageBytes:o.usedMemory}}freeRenderable(e){const t=this._lyrHandleToObjects.get(e);t&&(this.freeObject(t),this._lyrHandleToObjects.delete(e))}freeObject(e){this._memCache&&this._memCache.pop(`${e.handle}`),e.components.forEach(t=>{e.textures.forEach(e=>{this._stage.removeTexture(e)}),this._collection.destroyObject(t),this._initialCullFace.delete(t)})}setRenderableVisibility(e,t,r){if(this._memCache){for(let i=0;i<r;++i){const r=e[i],s=t[i];if(!s)continue;const o=this._lyrHandleToObjects.get(r);o&&(this._visibleGeometryChanged(),o.isVisible=s,o.components.forEach(e=>{this._collection.setObjectVisibility(e,s),this._elevationProvider.objectChanged(this._collection.getComponentObb(e))}),this._memCache.pop(`${r}`))}for(let i=0;i<r;++i){const r=e[i],s=t[i];if(s)continue;const o=this._lyrHandleToObjects.get(r);o&&(this._visibleGeometryChanged(),o.isVisible=s,o.components.forEach(e=>{this._collection.setObjectVisibility(e,s),this._elevationProvider.objectChanged(this._collection.getComponentObb(e))}),this._memCache.put(`${r}`,o))}}}_getTexture(e,t,r,i){let s=null;if(e&&t.desc?.images&&t.data?.buffer){const o=t.desc.images[e?.imageId];if(s=r.get(o),!s&&o){const n=this._stage.renderView.renderingContext.parameters.maxMaxAnisotropy,a=!!o.mipCount||n>1,l=re[e.wrapMode??F.None];let c=o.alpha?4:3;const m=new Uint8Array(t.data.buffer,o.data.byteOffset,o.data.byteCount);let d=null,h=null,u=null;switch(o.format){case k.Raw:o.pixelFormat===D.R8?(d=m,c=1,h=""):o.pixelFormat===D.Rgb8?(d=m,c=3,h=""):o.pixelFormat===D.Rgba8&&(d=m,c=4,h="");break;case k.Dxt1:d=m,c=3,h=we.DDS_ENCODING;break;case k.Dxt5:d=m,c=4,h=we.DDS_ENCODING;break;case k.Basis:d=m,c=3,h=we.KTX2_ENCODING;break;case k.Png:h="image/png",u=document.createElement("img");break;case k.Jpeg:h="image/jpeg",u=document.createElement("img");break;case k.Etc2:h="image/ktx",u=document.createElement("img");break;case k.Astc:this._dbg(Ae.Error,"Astc texture not supported");break;case k.Pvrtc:this._dbg(Ae.Error,"Pvrtc texture not supported")}if(u&&h){const e=new Blob([m],{type:h});u.src=URL.createObjectURL(e),d=u}if(d&&null!=h){const e=has("enable-feature:esri-compress-IM-textures")?{compressionTracker:this._compressionTracker,compressionCallback:e=>{e&&e>0&&(i.textureMemoryUsage-=e)}}:void 0;s=new xe(d,{mipmap:a,maxAnisotropy:n,encoding:h,wrap:l,components:c,compressionOptions:e,noUnpackFlip:!0,width:o.mip0Width,height:o.mip0Height}),this._stage.addTexture(s),r.set(o,s)}}}return s?new pe(this.view.stage.renderView.textures,s.id):null}getBufferViews(e,t,r){let i,s,o,n,a,l,c,m=null;for(let h=0;h<e.atrbs.length;h++){const c=e.atrbs[h],u=c.view,p=void 0,f=u.byteOffset+u.byteCount,g=u.byteCount/ie[u.type],b=[...Array(g).keys()].map(e=>e);try{switch(c.sem){case B.Position:3!==u.ncomp||u.type!==L.F32?this._dbg(Ae.Error,"[Unsupported Feature] Unsupported view for Position ("+u+")"):(i=new E(t,u.byteOffset,p,f),s=new be(i.typedBuffer,b,3));break;case B.Normal:if(3!==u.ncomp||u.type!==L.F32)this._dbg(Ae.Error,"[Unsupported Feature] Unsupported view for Normal ("+u+")");else{const e=new E(t,u.byteOffset,p,f),i=ve(e.typedBuffer,r);a=new I(i),l=new be(a.typedBuffer,b,2)}break;case B.TexCoord:2!==u.ncomp||u.type!==L.F32?this._dbg(Ae.Error,"[Unsupported Feature] Unsupported view for Texcoord ("+u+")"):void 0===n&&(n=new be(new T(t,u.byteOffset,p,f).typedBuffer,b,2));break;case B.Color:4===u.ncomp?(u.type===L.F32&&(m=new P(t,u.byteOffset,p,f)),u.type===L.U8&&(m=new O(t,u.byteOffset,p,f)),u.type===L.U16&&(m=new U(t,u.byteOffset,p,f))):3===u.ncomp&&(u.type===L.F32&&(m=new E(t,u.byteOffset,p,f)),u.type===L.U8&&(m=new A(t,u.byteOffset,p,f)),u.type===L.U16&&(m=new H(t,u.byteOffset,p,f))),null==m?this._dbg(Ae.VerboseAPI,"[Unsupported Feature] Unsupported view for Color ("+u+")"):o=new be(m.typedBuffer,b,u.ncomp);break;case B.FeatureIndex:break;default:this._dbg(Ae.VerboseAPI,"[Unsupported Feature] Unsupported semantic ("+c.sem+"). Skipping vertex attribute.")}}catch(d){this._dbg(Ae.VerboseAPI,"Error Creating buffer ("+d+"). Skipping vertex attribute.")}}if(e.index){const r=e.index.view,i=void 0,s=r.byteOffset+r.byteCount;switch(e.index.view.type){case L.U16:c=new V(t,r.byteOffset,i,s);break;case L.U32:c=new R(t,r.byteOffset,i,s);break;case L.U8:default:this._dbg(Ae.Error,"[Unsupported Feature] index type not supported ("+r.type+").")}}if(null==c&&null!=i){const e=i.count;if(e<65535){const t=new Uint16Array(e);c=new V(t)}else{const t=new Uint32Array(e);c=new R(t)}for(let t=0;t<e;t++)c.set(t,t)}return{positionView:i,positionAttr:s,colorAttr:o,texCoord0Attr:n,indicesView:c,normalsView:a,normalsAttr:l}}_loadModifications(){if(this.removeHandles("modifications"),null==this.layer.modifications)return void(this._modifications=[]);const e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>this._modifications=e.toArray(),i),"modifications")}_onRemoveFromCache(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}_dbg(e,r){this._dbgFlags.has(e)&&(e===Ae.Error?t.getLogger(this).error(r):t.getLogger(this).warn(r))}};e([n({type:[N]})],Re.prototype,"_modifications",void 0),e([n()],Re.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([n()],Re.prototype,"layer",void 0),e([n({readOnly:!0})],Re.prototype,"visibleAtCurrentScale",null),e([n()],Re.prototype,"elevationOffset",null),Re=e([a("esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D")],Re);const Ve=Re;export{Ve as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{hasScaling as e}from"../../../core/mathUtils.js";import r from"../../../geometry/SpatialReference.js";import t from"../../../geometry/support/MeshGeoreferencedVertexSpace.js";import o from"../../../geometry/support/MeshLocalVertexSpace.js";import{b as n,n as s}from"../../../chunks/vec3.js";import{IndexType as i}from"../../../libs/i3s/enums.js";import{get as a}from"../../../libs/i3s/I3SModule.js";import{TransformedGeometry as f,TransformedData as c}from"./I3SMeshWorkerHandle.js";import{NodeIMModificationImpact as l}from"./i3s/I3SNode.js";async function u(e){E=await U();const r=[e.geometryBuffer];return{result:A(E,e,r),transferList:r}}async function m(e){E=await U();const r=[e.geometryBuffer],{geometryBuffer:t}=e,o=t.byteLength,n=E._malloc(o),s=new Uint8Array(E.HEAPU8.buffer,n,o);s.set(new Uint8Array(t));const i=E.dracoDecompressPointCloudData(n,s.byteLength);if(E._free(n),i.error.length>0)throw new Error(`i3s.wasm: ${i.error}`);const a=i.featureIds?.length>0?i.featureIds.slice():null,f=i.positions.slice();return a&&r.push(a.buffer),r.push(f.buffer),{result:{positions:f,featureIds:a},transferList:r}}async function y(e){await U(),S(e);const r={buffer:e.buffer};return{result:r,transferList:[r.buffer]}}async function p(e){await U(),j(e)}async function d(e){E=await U(),E.setLegacySchema(e.context,e.jsonSchema)}async function h(e){const{localMatrix:n,origin:s,positions:i,vertexSpace:a}=e,f=r.fromJSON(e.inSpatialReference),c=r.fromJSON(e.outSpatialReference);let l;const[{projectBuffer:u},{initializeProjection:m}]=await Promise.all([import("../../../geometry/projection/projectBuffer.js"),import("../../../geometry/projectionUtils.js")]);await m(f,c);const y=[0,0,0];if(!u(s,f,0,y,c,0))throw new Error("Failed to project");if("georeferenced"===a.type&&null==a.origin){if(l=new Float64Array(i.length),!u(i,f,0,l,c,0,l.length/3))throw new Error("Failed to project")}else{const e="georeferenced"===a.type?t.fromJSON(a):o.fromJSON(a),{projectMeshVertexPositions:r}=await import("../../../geometry/support/meshUtils/projectMeshVertexPositions.js"),s=r({vertexAttributes:{position:i},transform:n?{localMatrix:n}:void 0,vertexSpace:e,spatialReference:f},c);if(!s)throw new Error("Failed to project");l=s}const p=l.length,[d,h,b]=y;for(let r=0;r<p;r+=3)l[r]-=d,l[r+1]-=h,l[r+2]-=b;return{result:{projected:l,original:i,projectedOrigin:y},transferList:[l.buffer,i.buffer]}}async function b({normalMatrix:r,normals:t}){const o=new Float32Array(t.length);return n(o,t,r),e(r)&&s(o,o),{result:{transformed:o,original:t},transferList:[o.buffer,t.buffer]}}function g(e){x(e)}let w,E;function j(e){if(!E)return;const r=e.modifications,t=E._malloc(8*r.length),o=new Float64Array(E.HEAPU8.buffer,t,r.length);for(let n=0;n<r.length;++n)o[n]=r[n];E.setModifications(e.context,t,r.length,e.isGeodetic),E._free(t)}function A(e,r,t){const{context:o,globalTrafo:n,mbs:s,obbData:a,elevationOffset:l,geometryBuffer:u,geometryDescriptor:m,indexToVertexProjector:y,vertexToRenderProjector:p}=r,d=e._malloc(u.byteLength),h=33,b=e._malloc(h*Float64Array.BYTES_PER_ELEMENT),g=new Uint8Array(e.HEAPU8.buffer,d,u.byteLength);g.set(new Uint8Array(u));const w=new Float64Array(e.HEAPU8.buffer,b,h);_(w,[NaN,NaN,NaN]);let E=w.byteOffset+3*w.BYTES_PER_ELEMENT,j=new Float64Array(w.buffer,E);_(j,n),E+=16*w.BYTES_PER_ELEMENT,j=new Float64Array(w.buffer,E),_(j,s),E+=4*w.BYTES_PER_ELEMENT,a&&(j=new Float64Array(w.buffer,E),_(j,a));const A=m,L={isDraco:!1,isLegacy:!1,color:r.layouts.some(e=>e.some(e=>"color"===e.name)),normal:r.needNormals&&r.layouts.some(e=>e.some(e=>"normalCompressed"===e.name)),uv0:r.layouts.some(e=>e.some(e=>"uv0"===e.name)),uvRegion:r.layouts.some(e=>e.some(e=>"uvRegion"===e.name)),featureIndex:A.featureIndex},S=e.process(o,!!r.obbData,d,g.byteLength,A,L,b,l,y,p,r.normalReferenceFrame);if(e._free(b),e._free(d),S.error.length>0)throw new Error(`i3s.wasm: ${S.error}`);if(S.discarded)return null;const x=S.componentOffsets.length>0?S.componentOffsets.slice():null,P=S.featureIds.length>0?S.featureIds.slice():null,U=S.anchorIds.length>0?Array.from(S.anchorIds):null,M=S.anchors.length>0?Array.from(S.anchors):null,N=S.interleavedVertedData.slice().buffer,I=S.indicesType===i.Int16?new Uint16Array(S.indices.buffer,S.indices.byteOffset,S.indices.byteLength/2).slice():new Uint32Array(S.indices.buffer,S.indices.byteOffset,S.indices.byteLength/4).slice(),F=S.positions.slice(),{buffer:T,byteOffset:B,byteLength:O}=S.positionIndices,R=S.positionIndicesType===i.Int16?new Uint16Array(T,B,O/2).slice():new Uint32Array(T,B,O/4).slice(),v=new f(r.layouts[0],N,I,S.hasColors,S.hasModifications,{data:F,indices:R});return P&&t.push(P.buffer),x&&t.push(x.buffer),t.push(N),t.push(I.buffer),t.push(F.buffer),t.push(R.buffer),new c(x,P,U,M,v,n,S.obb)}function L(e){return 0===e?l.Unmodified:1===e?l.PotentiallyModified:2===e?l.Culled:l.Unknown}function S(e){if(!E)return;const{context:r,buffer:t}=e,o=E._malloc(t.byteLength),n=t.byteLength/Float64Array.BYTES_PER_ELEMENT,s=new Float64Array(E.HEAPU8.buffer,o,n),i=new Float64Array(t);s.set(i),E.filterOBBs(r,o,n),i.set(s),E._free(o)}function x(e){E&&0===E.destroy(e)&&(E=null)}function _(e,r){for(let t=0;t<r.length;++t)e[t]=r[t]}async function P(){E||await U()}async function U(){return E||(E=await(w??=a())),E}const M={transform:(e,r)=>E&&A(E,e,r),destroy:x};export{g as destroyContext,m as dracoDecompressPointCloudData,y as filterObbsForModifications,S as filterObbsForModificationsSync,P as initialize,L as interpretObbModificationResults,u as process,h as project,d as setLegacySchema,p as setModifications,j as setModificationsSync,M as test,b as transformNormals};
5
+ import{hasScaling as e}from"../../../core/mathUtils.js";import r from"../../../geometry/SpatialReference.js";import t from"../../../geometry/support/MeshGeoreferencedVertexSpace.js";import o from"../../../geometry/support/MeshLocalVertexSpace.js";import{b as n,n as s}from"../../../chunks/vec3.js";import{IndexType as i}from"../../../libs/i3s/enums.js";import{get as a,cleanup as f}from"../../../libs/i3s/I3SModule.js";import{TransformedGeometry as c,TransformedData as l}from"./I3SMeshWorkerHandle.js";import{NodeIMModificationImpact as u}from"./i3s/I3SNode.js";async function m(e){j=await M();const r=[e.geometryBuffer];return{result:L(j,e,r),transferList:r}}async function y(e){j=await M();const r=[e.geometryBuffer],{geometryBuffer:t}=e,o=t.byteLength,n=j._malloc(o),s=new Uint8Array(j.HEAPU8.buffer,n,o);s.set(new Uint8Array(t));const i=j.dracoDecompressPointCloudData(n,s.byteLength);if(j._free(n),i.error.length>0)throw new Error(`i3s.wasm: ${i.error}`);const a=i.featureIds?.length>0?i.featureIds.slice():null,f=i.positions.slice();return a&&r.push(a.buffer),r.push(f.buffer),{result:{positions:f,featureIds:a},transferList:r}}async function p(e){await M(),x(e);const r={buffer:e.buffer};return{result:r,transferList:[r.buffer]}}async function d(e){await M(),A(e)}async function h(e){j=await M(),j.setLegacySchema(e.context,e.jsonSchema)}async function b(e){const{localMatrix:n,origin:s,positions:i,vertexSpace:a}=e,f=r.fromJSON(e.inSpatialReference),c=r.fromJSON(e.outSpatialReference);let l;const[{projectBuffer:u},{initializeProjection:m}]=await Promise.all([import("../../../geometry/projection/projectBuffer.js"),import("../../../geometry/projectionUtils.js")]);await m(f,c);const y=[0,0,0];if(!u(s,f,0,y,c,0))throw new Error("Failed to project");if("georeferenced"===a.type&&null==a.origin){if(l=new Float64Array(i.length),!u(i,f,0,l,c,0,l.length/3))throw new Error("Failed to project")}else{const e="georeferenced"===a.type?t.fromJSON(a):o.fromJSON(a),{projectMeshVertexPositions:r}=await import("../../../geometry/support/meshUtils/projectMeshVertexPositions.js"),s=r({vertexAttributes:{position:i},transform:n?{localMatrix:n}:void 0,vertexSpace:e,spatialReference:f},c);if(!s)throw new Error("Failed to project");l=s}const p=l.length,[d,h,b]=y;for(let r=0;r<p;r+=3)l[r]-=d,l[r+1]-=h,l[r+2]-=b;return{result:{projected:l,original:i,projectedOrigin:y},transferList:[l.buffer,i.buffer]}}async function g({normalMatrix:r,normals:t}){const o=new Float32Array(t.length);return n(o,t,r),e(r)&&s(o,o),{result:{transformed:o,original:t},transferList:[o.buffer,t.buffer]}}function w(e){_(e)}let E,j;function A(e){if(!j)return;const r=e.modifications,t=j._malloc(8*r.length),o=new Float64Array(j.HEAPU8.buffer,t,r.length);for(let n=0;n<r.length;++n)o[n]=r[n];j.setModifications(e.context,t,r.length,e.isGeodetic),j._free(t)}function L(e,r,t){const{context:o,globalTrafo:n,mbs:s,obbData:a,elevationOffset:f,geometryBuffer:u,geometryDescriptor:m,indexToVertexProjector:y,vertexToRenderProjector:p}=r,d=e._malloc(u.byteLength),h=33,b=e._malloc(h*Float64Array.BYTES_PER_ELEMENT),g=new Uint8Array(e.HEAPU8.buffer,d,u.byteLength);g.set(new Uint8Array(u));const w=new Float64Array(e.HEAPU8.buffer,b,h);P(w,[NaN,NaN,NaN]);let E=w.byteOffset+3*w.BYTES_PER_ELEMENT,j=new Float64Array(w.buffer,E);P(j,n),E+=16*w.BYTES_PER_ELEMENT,j=new Float64Array(w.buffer,E),P(j,s),E+=4*w.BYTES_PER_ELEMENT,a&&(j=new Float64Array(w.buffer,E),P(j,a));const A=m,L={isDraco:!1,isLegacy:!1,color:r.layouts.some(e=>e.some(e=>"color"===e.name)),normal:r.needNormals&&r.layouts.some(e=>e.some(e=>"normalCompressed"===e.name)),uv0:r.layouts.some(e=>e.some(e=>"uv0"===e.name)),uvRegion:r.layouts.some(e=>e.some(e=>"uvRegion"===e.name)),featureIndex:A.featureIndex},S=e.process(o,!!r.obbData,d,g.byteLength,A,L,b,f,y,p,r.normalReferenceFrame);if(e._free(b),e._free(d),S.error.length>0)throw new Error(`i3s.wasm: ${S.error}`);if(S.discarded)return null;const x=S.componentOffsets.length>0?S.componentOffsets.slice():null,_=S.featureIds.length>0?S.featureIds.slice():null,U=S.anchorIds.length>0?Array.from(S.anchorIds):null,M=S.anchors.length>0?Array.from(S.anchors):null,N=S.interleavedVertedData.slice().buffer,I=S.indicesType===i.Int16?new Uint16Array(S.indices.buffer,S.indices.byteOffset,S.indices.byteLength/2).slice():new Uint32Array(S.indices.buffer,S.indices.byteOffset,S.indices.byteLength/4).slice(),F=S.positions.slice(),{buffer:T,byteOffset:B,byteLength:O}=S.positionIndices,R=S.positionIndicesType===i.Int16?new Uint16Array(T,B,O/2).slice():new Uint32Array(T,B,O/4).slice(),v=new c(r.layouts[0],N,I,S.hasColors,S.hasModifications,{data:F,indices:R});return _&&t.push(_.buffer),x&&t.push(x.buffer),t.push(N),t.push(I.buffer),t.push(F.buffer),t.push(R.buffer),new l(x,_,U,M,v,n,S.obb)}function S(e){return 0===e?u.Unmodified:1===e?u.PotentiallyModified:2===e?u.Culled:u.Unknown}function x(e){if(!j)return;const{context:r,buffer:t}=e,o=j._malloc(t.byteLength),n=t.byteLength/Float64Array.BYTES_PER_ELEMENT,s=new Float64Array(j.HEAPU8.buffer,o,n),i=new Float64Array(t);s.set(i),j.filterOBBs(r,o,n),i.set(s),j._free(o)}function _(e){j&&0===j.destroy(e)&&(j=null,E=null,f())}function P(e,r){for(let t=0;t<r.length;++t)e[t]=r[t]}async function U(){j||await M()}async function M(){return j||(j=await(E??=a())),j}const N={transform:(e,r)=>j&&L(j,e,r),destroy:_};export{w as destroyContext,y as dracoDecompressPointCloudData,p as filterObbsForModifications,x as filterObbsForModificationsSync,U as initialize,S as interpretObbModificationResults,m as process,b as project,h as setLegacySchema,d as setModifications,A as setModificationsSync,N as test,g as transformNormals};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../Camera.js";import i from"../../../Viewpoint.js";import e from"../../../core/Error.js";import{onAbort as n,createAbortError as a}from"../../../core/promiseUtils.js";import{whenOnce as r}from"../../../core/reactiveUtils.js";import{applyAll as o}from"../camera/constraintUtils.js";import{applySurfaceCollisionConstraint as s,Mode as l}from"../camera/constraintUtils/surfaceCollision.js";import{State as c}from"./controllers/CameraController.js";import{isPointToPointAnimationController as h,PointToPointAnimationController as m}from"./controllers/PointToPointAnimationController.js";import{SurfaceCollisionCorrectionController as w}from"./controllers/SurfaceCollisionCorrectionController.js";import{externalToInternal as p}from"../support/cameraUtils.js";import{create as f}from"../support/viewpointUtils.js";class u{constructor(t,i,e){this._target=t,this._options=i,this.view=e,this.state="pending",this._animationController=null,this.promise=new Promise((t,i)=>{this._resolveCallback=t,this._rejectCallback=i;const e=new AbortController;null!=this._options.signal&&n(this._options.signal,()=>this.abort()),this._abortController=e,this._waitForReady()})}_resolve(t){if("finished"!==this.state)return this.state="finished",this._resolveCallback(t)}_reject(t){if("finished"!==this.state)return this.state="finished",this._rejectCallback(t)}abort(t=!1){if(this._abortController.abort(),"wait-for-animation-finish"===this.state)!t&&null!=this._animationController&&this.view.state.cameraController===this._animationController&&this._animationController.running&&this._animationController.stopController();this._reject(a())}async _waitForReady(){if(this.state="wait-for-ready",!this.view.ready)try{await r(()=>this.view.ready,this._abortController.signal)}catch(t){return this._reject(t)}this._createViewPoint()}async _createViewPoint(){if("finished"!==this.state){this.state="wait-for-viewpoint",this._animationController=this._options.animate?this._getAnimationController():null;try{const t=await f(this.view,this._target,this._abortController.signal);if("finished"===this.state)return;const i=t?this._getCameraFromViewpoint(t):null;if(null==i)return;if(this._options.animate){if(null==this._animationController)return;this._startAnimation(i,this._animationController)}else this.view.stateManager.setStateCamera(i.camera,{applyConstraints:!i.isFullySpecified,positionAndOrientationOnly:!0,doNotCancelGoToOperation:!0}),this._resolve()}catch(t){this._reject(t)}}}_getCameraFromViewpoint(n){const a=!!(this._target instanceof i&&this._target.camera||this._target instanceof t),r=n.camera;if(null==r)return null;if(!this.view.stateManager.isCompatible(r)){const t=r.position,i=t&&t.spatialReference,n=i?i.wkid:"none",a=this.view.spatialReference?.wkid;return this._reject(new e("GotoAnimation:incompatible-spatialreference",`Resulting camera has an incompatible spatial reference (camera: ${n}, view: ${a})`,{camera:r})),null}const o=p(this.view,r);return null==o?(this._reject(new e("GotoAnimation:invalid-camera","Resulting camera is invalid")),null):{viewpoint:n,camera:o,isFullySpecified:a}}_startAnimation(t,i){this.state="wait-for-animation-finish";const n=i.viewAnimation;if(null==n)return void this._reject(new e("GotoAnimation:missing-animation","Unreachable code in view.stateManager"));if(n.update(t.viewpoint,"running"),!i.running||null==i.viewAnimation||i.viewAnimation.target!==t.viewpoint||this.view.state.cameraController!==i)return this.abort();let a;t.isFullySpecified?(a=new w({view:this.view,desiredCamera:t.camera}),s(this.view,t.camera,l.EYE_AND_CENTER)):o(this.view,t.camera),i.begin(t.camera,this._options);const r=()=>{const e=this.view.state.cameraController;a&&(e&&e.running?h(e)&&null!=e.viewAnimation&&e.viewAnimation.target===t.viewpoint&&(this.view.state.cameraController=a):null!=i.viewAnimation&&i.viewAnimation.target===t.viewpoint&&i.state===c.Finished&&(this.view.state.cameraController=a))},m=t=>{if(null!=this.view.state)switch(i.state){case c.Finished:switch(this.state){case"pending":case"wait-for-ready":case"wait-for-viewpoint":case"wait-for-animation-finish":this._resolve()}break;case c.Ready:case c.Rejected:case c.Running:case c.Stopped:switch(this.state){case"pending":case"wait-for-ready":case"wait-for-viewpoint":case"wait-for-animation-finish":this._reject(t)}}};n.when(r,t=>m(t)),i.asyncResult={resolve:()=>m(),reject:t=>m(t)}}_getAnimationController(){let t=null,i=null;const n=this.view.state.cameraController;return h(n)&&(n.updateStateFromViewAnimation(),n.running&&(t=n,i=t.viewAnimation)),null==t&&(t=new m({view:this.view,mode:"animation"}),i=t.viewAnimation,this.view.state.switchCameraController(t),t.state===c.Rejected)?(i?.stop(),this._reject(new e("GotoAnimation:goto-cannot-interrupt","Cannot start an animation while interacting")),null):t}}export{u as GoToOperation};
5
+ import t from"../../../Camera.js";import i from"../../../Viewpoint.js";import e from"../../../core/Error.js";import{onAbort as n,createAbortError as a}from"../../../core/promiseUtils.js";import{whenOnce as o}from"../../../core/reactiveUtils.js";import{toRenderCamera as r}from"../webgl.js";import{applyAll as s}from"../camera/constraintUtils.js";import{applySurfaceCollisionConstraint as l,Mode as c}from"../camera/constraintUtils/surfaceCollision.js";import{State as h}from"./controllers/CameraController.js";import{isPointToPointAnimationController as m,PointToPointAnimationController as w}from"./controllers/PointToPointAnimationController.js";import{SurfaceCollisionCorrectionController as p}from"./controllers/SurfaceCollisionCorrectionController.js";import{create as f}from"../support/viewpointUtils.js";class u{constructor(t,i,e){this._target=t,this._options=i,this.view=e,this.state="pending",this._animationController=null,this.promise=new Promise((t,i)=>{this._resolveCallback=t,this._rejectCallback=i;const e=new AbortController;null!=this._options.signal&&n(this._options.signal,()=>this.abort()),this._abortController=e,this._waitForReady()})}_resolve(t){if("finished"!==this.state)return this.state="finished",this._resolveCallback(t)}_reject(t){if("finished"!==this.state)return this.state="finished",this._rejectCallback(t)}abort(t=!1){if(this._abortController.abort(),"wait-for-animation-finish"===this.state)!t&&null!=this._animationController&&this.view.state.cameraController===this._animationController&&this._animationController.running&&this._animationController.stopController();this._reject(a())}async _waitForReady(){if(this.state="wait-for-ready",!this.view.ready)try{await o(()=>this.view.ready,this._abortController.signal)}catch(t){return this._reject(t)}this._createViewPoint()}async _createViewPoint(){if("finished"!==this.state){this.state="wait-for-viewpoint",this._animationController=this._options.animate?this._getAnimationController():null;try{const t=await f(this.view,this._target,this._abortController.signal);if("finished"===this.state)return;const i=t?this._getCameraFromViewpoint(t):null;if(null==i)return;if(this._options.animate){if(null==this._animationController)return;this._startAnimation(i,this._animationController)}else this.view.stateManager.setStateCamera(i.camera,{applyConstraints:!i.isFullySpecified,positionAndOrientationOnly:!0,doNotCancelGoToOperation:!0}),this._resolve()}catch(t){this._reject(t)}}}_getCameraFromViewpoint(n){const a=!!(this._target instanceof i&&this._target.camera||this._target instanceof t),o=n.camera;if(null==o)return null;if(!this.view.stateManager.isCompatible(o)){const t=o.position,i=t&&t.spatialReference,n=i?i.wkid:"none",a=this.view.spatialReference?.wkid;return this._reject(new e("GotoAnimation:incompatible-spatialreference",`Resulting camera has an incompatible spatial reference (camera: ${n}, view: ${a})`,{camera:o})),null}const s=r(this.view,o);return null==s?(this._reject(new e("GotoAnimation:invalid-camera","Resulting camera is invalid")),null):{viewpoint:n,camera:s,isFullySpecified:a}}_startAnimation(t,i){this.state="wait-for-animation-finish";const n=i.viewAnimation;if(null==n)return void this._reject(new e("GotoAnimation:missing-animation","Unreachable code in view.stateManager"));if(n.update(t.viewpoint,"running"),!i.running||null==i.viewAnimation||i.viewAnimation.target!==t.viewpoint||this.view.state.cameraController!==i)return this.abort();let a;t.isFullySpecified?(a=new p({view:this.view,desiredCamera:t.camera}),l(this.view,t.camera,c.EYE_AND_CENTER)):s(this.view,t.camera),i.begin(t.camera,this._options);const o=()=>{const e=this.view.state.cameraController;a&&(e&&e.running?m(e)&&null!=e.viewAnimation&&e.viewAnimation.target===t.viewpoint&&(this.view.state.cameraController=a):null!=i.viewAnimation&&i.viewAnimation.target===t.viewpoint&&i.state===h.Finished&&(this.view.state.cameraController=a))},r=t=>{if(null!=this.view.state)switch(i.state){case h.Finished:switch(this.state){case"pending":case"wait-for-ready":case"wait-for-viewpoint":case"wait-for-animation-finish":this._resolve()}break;case h.Ready:case h.Rejected:case h.Running:case h.Stopped:switch(this.state){case"pending":case"wait-for-ready":case"wait-for-viewpoint":case"wait-for-animation-finish":this._reject(t)}}};n.when(o,t=>r(t)),i.asyncResult={resolve:()=>r(),reject:t=>r(t)}}_getAnimationController(){let t=null,i=null;const n=this.view.state.cameraController;return m(n)&&(n.updateStateFromViewAnimation(),n.running&&(t=n,i=t.viewAnimation)),null==t&&(t=new w({view:this.view,mode:"animation"}),i=t.viewAnimation,this.view.state.switchCameraController(t),t.state===h.Rejected)?(i?.stop(),this._reject(new e("GotoAnimation:goto-cannot-interrupt","Cannot start an animation while interacting")),null):t}}export{u as GoToOperation};