@arcgis/core 4.34.0-next.38 → 4.34.0-next.39

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 (130) hide show
  1. package/Color.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{00f3fe4a09bbdbc8f8b4.js → 00ae094cc21bc42faa54.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{7e04b4592128e884b58c.js → 0f51e51db83f303ce5a6.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{6e82c1d1e02e320ec5e7.js → 14d3039f92b0d96944f0.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{54658c87396223d85abd.js → 1cbd59918c60a1a21494.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{7c97c4c8c2cf73835517.js → 1cd15aa69f85ecfa32b0.js} +1 -1
  8. package/assets/esri/core/workers/chunks/21a9f9c0cc1cde2fee90.js +1 -0
  9. package/assets/esri/core/workers/chunks/{21aaf2dede61f28727a9.js → 2ae0bda04fd5386b462f.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{49eac96a01931b8c4ace.js → 364fb103cb139f26b455.js} +1 -1
  11. package/assets/esri/core/workers/chunks/3af4a410ff0bca7ba2e3.js +1 -0
  12. package/assets/esri/core/workers/chunks/{8ad95fe91ba0a9f284a2.js → 3f7d7dc05e63fc50325e.js} +1 -1
  13. package/assets/esri/core/workers/chunks/4970d439d9648e97fd5a.js +1 -0
  14. package/assets/esri/core/workers/chunks/{48369e4c340413c531ff.js → 4e6e5677b90b00622146.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{257428fff4bef42716e0.js → 4f3c187a7cb2b1444281.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{31c6716d9ca188d3b870.js → 554c789f4e875d7e6fd5.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{a939d2af7e4a359c7b4d.js → 560bb06cf1bf30df4af3.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{80a930881a99ceda240a.js → 5f11fff5bc16fdec42db.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{9155dbfce5ef2c25bbbf.js → 791b3130b34b52160c1f.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{5b2d40a2ce2594ce8eef.js → 95f0c15d83d1f38e01d0.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{3488e88882f40199ab33.js → a85acb948cc7d22be592.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{7159e7a3274e64b337ce.js → b481807b31e59cce9931.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{d29f894491618931d92a.js → bc27cdd7c415ab166536.js} +1 -1
  24. package/assets/esri/core/workers/chunks/c474800508e3ad5ce9d7.js +1 -0
  25. package/assets/esri/core/workers/chunks/{23a85252e4164354553e.js → c52314b987c63cd630f7.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{022091e5240b9d872dd2.js → d1635a7ab0c204852237.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{c8c85ba6451b5dfc2fc0.js → da228aed337f492456cc.js} +1 -1
  28. package/assets/esri/core/workers/chunks/ddeaf688d72b2873c4ac.js +1 -0
  29. package/assets/esri/core/workers/chunks/e08b2e9213d35f85916f.js +1 -0
  30. package/assets/esri/core/workers/chunks/e6d08230adb90b9a2a17.js +1 -0
  31. package/colorUtils.js +1 -1
  32. package/config.js +1 -1
  33. package/core/AsyncUpdate.js +1 -1
  34. package/core/Collection.js +1 -1
  35. package/core/Evented.js +1 -1
  36. package/core/MultiOriginJSONSupport.js +1 -1
  37. package/core/ReadOnlyMultiOriginJSONSupport.js +1 -1
  38. package/identity/IdentityManagerBase.js +1 -1
  39. package/kernel.js +1 -1
  40. package/package.json +1 -1
  41. package/support/revision.js +1 -1
  42. package/symbols/WaterSymbol3DLayer.js +1 -1
  43. package/views/2d/engine/AFeatureContainer.js +1 -1
  44. package/views/2d/engine/Bitmap.js +1 -1
  45. package/views/2d/engine/Stage.js +1 -1
  46. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  47. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  48. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  49. package/views/2d/engine/webgl/ClippingInfo.js +1 -1
  50. package/views/2d/engine/webgl/Overlay.js +1 -1
  51. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  52. package/views/2d/engine/webgl/TiledDisplayObject.js +1 -1
  53. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  54. package/views/2d/engine/webgl/shaderGraph/techniques/TestDisplayObject.js +1 -1
  55. package/views/2d/grid/GridView2D.js +1 -1
  56. package/views/2d/layers/BaseDynamicLayerView2D.js +1 -1
  57. package/views/2d/layers/BaseLayerView2D.js +1 -1
  58. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  59. package/views/2d/layers/CatalogDynamicGroupLayerView2D.js +1 -1
  60. package/views/2d/layers/CatalogFootprintLayerView2D.js +1 -1
  61. package/views/2d/layers/CatalogLayerView2D.js +1 -1
  62. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  63. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  64. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  65. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  66. package/views/2d/layers/MediaLayerView2D.js +1 -1
  67. package/views/2d/layers/OGCFeatureLayerView2D.js +1 -1
  68. package/views/2d/layers/StreamLayerView2D.js +1 -1
  69. package/views/2d/layers/TileLayerView2D.js +1 -1
  70. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  71. package/views/2d/layers/WMSLayerView2D.js +1 -1
  72. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  73. package/views/2d/layers/features/support/TileStore.js +1 -1
  74. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  75. package/views/2d/magnifier/MagnifierView2D.js +1 -1
  76. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  77. package/views/3d/layers/CatalogDynamicGroupLayerView3D.js +1 -1
  78. package/views/3d/layers/CatalogFootprintLayerView3D.js +1 -1
  79. package/views/3d/layers/CatalogLayerView3D.js +1 -1
  80. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  81. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  82. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  83. package/views/3d/layers/OGCFeatureLayerView3D.js +1 -1
  84. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  85. package/views/3d/layers/StreamLayerView3D.js +1 -1
  86. package/views/3d/layers/TileLayerView3D.js +1 -1
  87. package/views/3d/layers/WMSLayerView3D.js +1 -1
  88. package/views/3d/layers/WMTSLayerView3D.js +1 -1
  89. package/views/3d/layers/graphics/GraphicStateTracking.js +1 -1
  90. package/views/3d/support/LimitGraphicsMap.js +1 -1
  91. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  92. package/views/View.js +1 -1
  93. package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
  94. package/views/layers/CatalogDynamicGroupLayerView.d.ts +1 -1
  95. package/views/layers/CatalogDynamicGroupLayerView.js +1 -1
  96. package/views/layers/CatalogFootprintLayerView.d.ts +1 -1
  97. package/views/layers/CatalogFootprintLayerView.js +1 -1
  98. package/views/layers/CatalogLayerView.d.ts +1 -1
  99. package/views/layers/CatalogLayerView.js +1 -1
  100. package/views/layers/FeatureLayerView.d.ts +1 -1
  101. package/views/layers/FeatureLayerView.js +1 -1
  102. package/views/layers/LayerView.js +1 -1
  103. package/views/layers/OGCFeatureLayerView.d.ts +1 -1
  104. package/views/layers/OGCFeatureLayerView.js +1 -1
  105. package/views/layers/PointCloudLayerView.d.ts +1 -1
  106. package/views/layers/PointCloudLayerView.js +1 -1
  107. package/views/layers/RefreshableLayerView.js +1 -1
  108. package/views/layers/StreamLayerView.d.ts +1 -1
  109. package/views/layers/StreamLayerView.js +1 -1
  110. package/views/layers/WMSLayerView.js +1 -1
  111. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  112. package/widgets/Compass/CompassViewModel.js +1 -1
  113. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  114. package/widgets/DirectionalPad/DirectionalPadViewModel.js +1 -1
  115. package/widgets/Directions/DirectionsViewModel.js +1 -1
  116. package/widgets/Features/FeaturesViewModel.js +1 -1
  117. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  118. package/widgets/Home/HomeViewModel.js +1 -1
  119. package/widgets/Search/SearchViewModel.js +1 -1
  120. package/widgets/Widget.js +1 -1
  121. package/widgets/support/GeolocationPositioning.js +1 -1
  122. package/widgets/support/GoTo.d.ts +1 -1
  123. package/widgets/support/GoTo.js +1 -1
  124. package/assets/esri/core/workers/chunks/508c302fed242956d3b7.js +0 -1
  125. package/assets/esri/core/workers/chunks/60d889c58a542e59b07b.js +0 -1
  126. package/assets/esri/core/workers/chunks/7617fe2fbf223c108f1e.js +0 -1
  127. package/assets/esri/core/workers/chunks/9595b39e882f9a9ac839.js +0 -1
  128. package/assets/esri/core/workers/chunks/9ffbd5216aa0a45a4199.js +0 -1
  129. package/assets/esri/core/workers/chunks/a5c0b365b9f55e63ab52.js +0 -1
  130. package/assets/esri/core/workers/chunks/d5262c95116d3bdfd117.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 e from"../../../../core/Error.js";import{on as t}from"../../../../core/events.js";import r from"../../../../core/Handles.js";import s from"../../../../core/Logger.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{getProjectiveTransform as n}from"../../../../core/perspectiveUtils.js";import{watch as o,when as a,initial as d}from"../../../../core/reactiveUtils.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as h}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isVideoElement as p}from"../../../../support/mediaLayerUtils.js";import{DisplayObject as u}from"../DisplayObject.js";import{play as c}from"./animatedFormats/utils.js";import{Texture as f}from"../../../webgl/Texture.js";import{TextureDescriptor as w}from"../../../webgl/TextureDescriptor.js";const x=[1,1],y=l(),v={none:"None",loop:"Loop",oscillate:"Oscillate"};function R(e){return e?{type:"CIMAnimatedSymbolProperties",...e,playAnimation:e.playing,repeatType:e.repeatType?v[e.repeatType]:void 0}:{type:"CIMAnimatedSymbolProperties"}}class g extends u{constructor(n){super(),this.elementView=n,this.isWrapAround=!1,this.wrapAroundShift=0,this.perspectiveTransform=m(),this._handles=new r,this._vertices=new Float32Array(8),this._indices=new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]),this._handles.add([o(()=>this.elementView.element.opacity,e=>this.opacity=e,d),o(()=>[this.elementView.coords],()=>{this.requestRender()},d),o(()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions],()=>{this._handles.remove("play"),this.texture=i(this.texture),this.requestRender()},d),a(()=>this.elementView.element.loaded,()=>{const e=this.elementView.element;this.ready(),p(e)&&null!=e.content&&(this._handles.add([t(e.content,"play",()=>this.requestRender()),t(e.content,"loadeddata",()=>this.requestRender()),t(e.content,"loaded",()=>this.requestRender())]),"requestVideoFrameCallback"in e.content?e.content.requestVideoFrameCallback(()=>this.requestRender()):this._handles.add([t(e.content,"seeked",()=>this.requestRender())]),this.requestRender())},d)]),n.element.load().catch(t=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new e("element-load-error","Element cannot be displayed",{element:n,error:t}))})}getMesh(e){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=i(this.texture)}get textureSize(){return x}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,r=this.elementView.element.content;if(null!=r){const e=r instanceof HTMLImageElement,s=r instanceof HTMLVideoElement,i=e?r.naturalWidth:s?r.videoWidth:r.width,n=e?r.naturalHeight:s?r.videoHeight:r.height;if(this._updatePerspectiveTransform(i,n),this.texture){if(s)if(r.readyState>=r.HAVE_CURRENT_DATA)this._updateTextureAndRequestRender(r);else{const e=()=>{this._updateTextureAndRequestRender(r),r.removeEventListener("canplay",e),r.removeEventListener("seeked",e)};r.addEventListener("canplay",e),r.addEventListener("seeked",e)}}else{const e=new w(i,n);if(e.wrapMode=33071,e.preMultiplyAlpha=!0,"getFrame"in r){const s=r=>{this.texture?this.texture.setData(r):this.texture=new f(t,e,r),this.requestRender()};"animationOptions"in this.elementView.element&&this._handles.add(c(r,R(this.elementView.element.animationOptions),null,s),"play")}else this.texture=new f(t,e,r);this.texture.generateMipmap(),s&&("requestVideoFrameCallback"in r?r.requestVideoFrameCallback(()=>this.requestRender()):r.paused||this.requestRender())}}super.beforeRender(e)}_updateTextureAndRequestRender(e){this.texture.setData(e),this.texture.generateMipmap(),"requestVideoFrameCallback"in e?e.requestVideoFrameCallback(()=>this.requestRender()):e.paused||this.requestRender()}_createTransforms(){return null}draw(e,t){this.isReady&&null!=this.texture?t.render(e,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:x,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._indices}):this.requestRender()}updateDrawCoords(e,t,r,s){const{coords:i,bounds:n}=this.elementView;if(null==i||null==n)return;const[o,a,d,l]=i.rings[0],h=this._vertices,{x:m,y:p}=e;h.set([a[0]-m,a[1]-p,o[0]-m,o[1]-p,d[0]-m,d[1]-p,l[0]-m,l[1]-p]);let u=t;if(s){const[e,,t]=n,{worldWidth:r,xBounds:i}=s,[o,a]=i;e<o&&t>o?u=r:t>a&&e<a&&(u=-r)}this.wrapAroundShift=u,this.isWrapAround=0!==u}_updatePerspectiveTransform(e,t){const r=this._vertices;n(y,[0,0,e,0,0,t,e,t],[r[0],r[1],r[4],r[5],r[2],r[3],r[6],r[7]]),h(this.perspectiveTransform,y[6]/y[8]*e,y[7]/y[8]*t)}}export{g as default};
5
+ import e from"../../../../core/Error.js";import{on as t}from"../../../../core/events.js";import r from"../../../../core/Handles.js";import s from"../../../../core/Logger.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{getProjectiveTransform as n}from"../../../../core/perspectiveUtils.js";import{watch as o,when as a,initial as d}from"../../../../core/reactiveUtils.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as h}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isVideoElement as p}from"../../../../support/mediaLayerUtils.js";import{DisplayObject as u}from"../DisplayObject.js";import{play as c}from"./animatedFormats/utils.js";import{Texture as f}from"../../../webgl/Texture.js";import{TextureDescriptor as y}from"../../../webgl/TextureDescriptor.js";const w=[1,1],x=l(),v={none:"None",loop:"Loop",oscillate:"Oscillate"};function R(e){return e?{type:"CIMAnimatedSymbolProperties",...e,playAnimation:e.playing,repeatType:e.repeatType?v[e.repeatType]:void 0}:{type:"CIMAnimatedSymbolProperties"}}class g extends u{constructor(n){super(),this.elementView=n,this.isWrapAround=!1,this.wrapAroundShift=0,this.perspectiveTransform=m(),this._handles=new r,this._vertices=new Float32Array(8),this._indices=new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]),this._handles.add([o(()=>this.elementView.element.opacity,e=>this.opacity=e,d),o(()=>[this.elementView.coords],()=>{this.requestRender()},d),o(()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions],()=>{this._handles.remove("play"),this.texture=i(this.texture),this.requestRender()},d),a(()=>this.elementView.element.loaded,()=>{const e=this.elementView.element;this.ready(),p(e)&&null!=e.content&&(this._handles.add([t(e.content,"play",()=>this.requestRender()),t(e.content,"loadeddata",()=>this.requestRender()),t(e.content,"loaded",()=>this.requestRender())]),"requestVideoFrameCallback"in e.content?e.content.requestVideoFrameCallback(()=>this.requestRender()):this._handles.add([t(e.content,"seeked",()=>this.requestRender())]),this.requestRender())},d)]),n.element.load().catch(t=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new e("element-load-error","Element cannot be displayed",{element:n,error:t}))})}getMesh(e){throw new Error("Method not implemented.")}destroy(){super.destroy(),this._handles.destroy(),this.texture=i(this.texture)}get textureSize(){return w}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,r=this.elementView.element.content;if(null!=r){const e=r instanceof HTMLImageElement,s=r instanceof HTMLVideoElement,i=e?r.naturalWidth:s?r.videoWidth:r.width,n=e?r.naturalHeight:s?r.videoHeight:r.height;if(this._updatePerspectiveTransform(i,n),this.texture){if(s)if(r.readyState>=r.HAVE_CURRENT_DATA)this._updateTextureAndRequestRender(r);else{const e=()=>{this._updateTextureAndRequestRender(r),r.removeEventListener("canplay",e),r.removeEventListener("seeked",e)};r.addEventListener("canplay",e),r.addEventListener("seeked",e)}}else{const e=new y(i,n);if(e.wrapMode=33071,e.preMultiplyAlpha=!0,"getFrame"in r){const s=r=>{this.texture?this.texture.setData(r):this.texture=new f(t,e,r),this.requestRender()};"animationOptions"in this.elementView.element&&this._handles.add(c(r,R(this.elementView.element.animationOptions),null,s),"play")}else this.texture=new f(t,e,r);this.texture.generateMipmap(),s&&("requestVideoFrameCallback"in r?r.requestVideoFrameCallback(()=>this.requestRender()):r.paused||this.requestRender())}}super.beforeRender(e)}_updateTextureAndRequestRender(e){this.texture.setData(e),this.texture.generateMipmap(),"requestVideoFrameCallback"in e?e.requestVideoFrameCallback(()=>this.requestRender()):e.paused||this.requestRender()}_createTransforms(){return null}draw(e,t){this.isReady&&null!=this.texture?t.render(e,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:w,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._indices}):this.requestRender()}updateDrawCoords(e,t,r,s){const{coords:i,bounds:n}=this.elementView;if(null==i||null==n)return;const[o,a,d,l]=i.rings[0],h=this._vertices,{x:m,y:p}=e;h.set([a[0]-m,a[1]-p,o[0]-m,o[1]-p,d[0]-m,d[1]-p,l[0]-m,l[1]-p]);let u=t;if(s){const[e,,t]=n,{worldWidth:r,xBounds:i}=s,[o,a]=i;e<o&&t>o?u=r:t>a&&e<a&&(u=-r)}this.wrapAroundShift=u,this.isWrapAround=0!==u}_updatePerspectiveTransform(e,t){const r=this._vertices;n(x,[0,0,e,0,0,t,e,t],[r[0],r[1],r[4],r[5],r[2],r[3],r[6],r[7]]),h(this.perspectiveTransform,x[6]/x[8]*e,x[7]/x[8]*t)}}export{g 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{on as t}from"../../../../core/events.js";import e from"../../../../core/Handles.js";import{disposeMaybe as r}from"../../../../core/maybe.js";import{when as i,initial as s}from"../../../../core/reactiveUtils.js";import{createScreenPoint as o}from"../../../../core/screenUtils.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import a from"../../../../geometry/Point.js";import h from"../../../../geometry/Polygon.js";import{project as l}from"../../../../geometry/projectionUtils.js";import{DisplayObject as u}from"../DisplayObject.js";import c from"../../../layers/support/Geometry.js";import{Texture as d}from"../../../webgl/Texture.js";import{TextureDescriptor as m}from"../../../webgl/TextureDescriptor.js";const p=2;class f extends u{constructor(r){super(),this.element=r,this._handles=new e,this.isWrapAround=!1,this.perspectiveTransform=n(),this.wrapAroundShift=0,this.clipGeometry=null,this._handles.add(i(()=>this.element,()=>{const e=this.element;this.ready(),e&&this._handles.add(t(e,"play",()=>this.requestRender()))},s))}getMesh(t){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=r(this.texture)}get textureSize(){if(!this.texture)return[1,1];const t=this.texture.descriptor;return[t.width,t.height]}get dvsMat3(){return this.parent.dvsMat3}beforeRender(t){const e=this.element;if(null==e)return;const{context:r}=t,{videoWidth:i,videoHeight:s}=e;if(0!==i&&0!==s){if(this.texture)e.paused||this.texture.setData(e);else{const t=new m(i,s);t.wrapMode=33071,t.preMultiplyAlpha=!0,this.texture=new d(r,t,e)}e.paused||(this.texture.generateMipmap(),this.requestRender()),super.beforeRender(t)}}_createTransforms(){return null}updateDrawCoords(t,e,r,i){const s=this.element,o=this._getFrameInfo();if(!s||!o)return;const{spatialReference:n}=r;this._initializeData(t,o,n);const{controlPoints:a,horizon:u}=o,d=Math.sqrt(a.length),m=d,{x:f,y:x}=t,y=this._vertices,g=a[0],P=a[d-1],w=a[(m-1)*d],_=a[(m-1)*d+d-1],v=l(u?u[0].mapPoint:g.mapPoint,n),j=l(u?u[1].mapPoint:P.mapPoint,n),M=l(w.mapPoint,n),A=l(_.mapPoint,n);this.clipGeometry=u?new c({geometry:h.fromJSON({rings:[[[M.x,M.y],[A.x,A.y],[j.x,j.y],[v.x,v.y],[M.x,M.y]]],spatialReference:n})}):null;for(let h=0;h<a.length;h++){const t=a[h],{sourcePoint:e,mapPoint:r}=t;if(null==e||null==r)continue;const i=l(r,n);y[h*p+0]=i.x-f,y[h*p+1]=i.y-x}let b=e;if(i){const t=Math.min(v.x,j.x,M.x,A.x),e=Math.max(v.x,j.x,M.x,A.x),{worldWidth:r,xBounds:s}=i,[o,n]=s;t<o&&e>o?b=r:e>n&&t<n&&(b=-r)}this.wrapAroundShift=b,this.isWrapAround=0!==b}draw(t,e){if(!this.visible)return;if(!(this.isReady&&this._vertices&&this._indices&&this._texCoords))return void this.requestRender();this.stage||console.warn("OverlayMultipoint: stage is null"),e.render(t,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:this.textureSize,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._texCoords,index:this._indices})}_initializeData(t,e,r){if(null!=this._vertices&&null!=this._indices)return;const{controlPoints:i}=e,s=Math.sqrt(i.length),o=s,n=new Float32Array(p*i.length),a=new Uint16Array(2*i.length);for(let c=0;c<i.length;c++){const e=i[c],{sourcePoint:s,mapPoint:o}=e;if(null==s||null==o)continue;const h=l(o,r);n[c*p+0]=h.x-t.x,n[c*p+1]=h.y-t.y,a[2*c+0]=s.x,a[2*c+1]=s.y}const h=new Uint16Array(o*s+(o-2)*(s+2));let u=0;for(let l=0;l<o;l++){for(let t=0;t<s;t++)h[u++]=l*s+t,h[u++]=(l+1)*s+t;l<o-2&&(h[u++]=(l+1)*s+(s-1),h[u++]=(l+1)*s)}this._vertices=n,this._texCoords=a,this._indices=h}_getFrameInfo(){if(!this.groundControlPoints)return null;const t=this._getFrameControlPoints(),e=this.frameHorizonPoints;let r=null;if(e){const t=e.startX,i=e.startY,s=e.endX,n=e.endY;r=[{sourcePoint:o(t,i),mapPoint:new a(e.startLongitude,e.startLatitude)},{sourcePoint:o(s,n),mapPoint:new a(e.endLongitude,e.endLatitude)}]}return{controlPoints:t,horizon:r}}_getFrameControlPoints(){const t=this.groundControlPoints,e=t?.length;if(!e)return[];const r=new Array(e),i=Math.max(...t.map(({x:t})=>t)),s=this.element.videoWidth/i;for(let n=0;n<e;n++){const{x:e,y:i,lat:h,lon:l}=t[n];r[n]={sourcePoint:o(e*s,-i*s),mapPoint:new a(l,h)}}return r}}export{f as default};
5
+ import{on as t}from"../../../../core/events.js";import e from"../../../../core/Handles.js";import{disposeMaybe as r}from"../../../../core/maybe.js";import{when as i,initial as s}from"../../../../core/reactiveUtils.js";import{createScreenPoint as o}from"../../../../core/screenUtils.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import a from"../../../../geometry/Point.js";import h from"../../../../geometry/Polygon.js";import{project as l}from"../../../../geometry/projectionUtils.js";import{DisplayObject as u}from"../DisplayObject.js";import d from"../../../layers/support/Geometry.js";import{Texture as c}from"../../../webgl/Texture.js";import{TextureDescriptor as m}from"../../../webgl/TextureDescriptor.js";const p=2;class f extends u{constructor(r){super(),this.element=r,this._handles=new e,this.isWrapAround=!1,this.perspectiveTransform=n(),this.wrapAroundShift=0,this.clipGeometry=null,this._handles.add(i(()=>this.element,()=>{const e=this.element;this.ready(),e&&this._handles.add(t(e,"play",()=>this.requestRender()))},s))}getMesh(t){throw new Error("Method not implemented.")}destroy(){super.destroy(),this._handles.destroy(),this.texture=r(this.texture)}get textureSize(){if(!this.texture)return[1,1];const t=this.texture.descriptor;return[t.width,t.height]}get dvsMat3(){return this.parent.dvsMat3}beforeRender(t){const e=this.element;if(null==e)return;const{context:r}=t,{videoWidth:i,videoHeight:s}=e;if(0!==i&&0!==s){if(this.texture)e.paused||this.texture.setData(e);else{const t=new m(i,s);t.wrapMode=33071,t.preMultiplyAlpha=!0,this.texture=new c(r,t,e)}e.paused||(this.texture.generateMipmap(),this.requestRender()),super.beforeRender(t)}}_createTransforms(){return null}updateDrawCoords(t,e,r,i){const s=this.element,o=this._getFrameInfo();if(!s||!o)return;const{spatialReference:n}=r;this._initializeData(t,o,n);const{controlPoints:a,horizon:u}=o,c=Math.sqrt(a.length),m=c,{x:f,y:x}=t,y=this._vertices,g=a[0],P=a[c-1],w=a[(m-1)*c],_=a[(m-1)*c+c-1],v=l(u?u[0].mapPoint:g.mapPoint,n),j=l(u?u[1].mapPoint:P.mapPoint,n),M=l(w.mapPoint,n),A=l(_.mapPoint,n);this.clipGeometry=u?new d({geometry:h.fromJSON({rings:[[[M.x,M.y],[A.x,A.y],[j.x,j.y],[v.x,v.y],[M.x,M.y]]],spatialReference:n})}):null;for(let h=0;h<a.length;h++){const t=a[h],{sourcePoint:e,mapPoint:r}=t;if(null==e||null==r)continue;const i=l(r,n);y[h*p+0]=i.x-f,y[h*p+1]=i.y-x}let b=e;if(i){const t=Math.min(v.x,j.x,M.x,A.x),e=Math.max(v.x,j.x,M.x,A.x),{worldWidth:r,xBounds:s}=i,[o,n]=s;t<o&&e>o?b=r:e>n&&t<n&&(b=-r)}this.wrapAroundShift=b,this.isWrapAround=0!==b}draw(t,e){if(!this.visible)return;if(!(this.isReady&&this._vertices&&this._indices&&this._texCoords))return void this.requestRender();this.stage||console.warn("OverlayMultipoint: stage is null"),e.render(t,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:this.textureSize,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._texCoords,index:this._indices})}_initializeData(t,e,r){if(null!=this._vertices&&null!=this._indices)return;const{controlPoints:i}=e,s=Math.sqrt(i.length),o=s,n=new Float32Array(p*i.length),a=new Uint16Array(2*i.length);for(let d=0;d<i.length;d++){const e=i[d],{sourcePoint:s,mapPoint:o}=e;if(null==s||null==o)continue;const h=l(o,r);n[d*p+0]=h.x-t.x,n[d*p+1]=h.y-t.y,a[2*d+0]=s.x,a[2*d+1]=s.y}const h=new Uint16Array(o*s+(o-2)*(s+2));let u=0;for(let l=0;l<o;l++){for(let t=0;t<s;t++)h[u++]=l*s+t,h[u++]=(l+1)*s+t;l<o-2&&(h[u++]=(l+1)*s+(s-1),h[u++]=(l+1)*s)}this._vertices=n,this._texCoords=a,this._indices=h}_getFrameInfo(){if(!this.groundControlPoints)return null;const t=this._getFrameControlPoints(),e=this.frameHorizonPoints;let r=null;if(e){const t=e.startX,i=e.startY,s=e.endX,n=e.endY;r=[{sourcePoint:o(t,i),mapPoint:new a(e.startLongitude,e.startLatitude)},{sourcePoint:o(s,n),mapPoint:new a(e.endLongitude,e.endLatitude)}]}return{controlPoints:t,horizon:r}}_getFrameControlPoints(){const t=this.groundControlPoints,e=t?.length;if(!e)return[];const r=new Array(e),i=Math.max(...t.map(({x:t})=>t)),s=this.element.videoWidth/i;for(let n=0;n<e;n++){const{x:e,y:i,lat:h,lon:l}=t[n];r[n]={sourcePoint:o(e*s,-i*s),mapPoint:new a(l,h)}}return r}}export{f 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{set as t,multiply as e}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{DisplayObject as i}from"../DisplayObject.js";import s from"../../tiling/TileKey.js";class r extends i{constructor(t,e,i,r,n,o,h=n,l=o){super(),this.tileDebugInfoTexture=null,this.debugInfo={display:{length:0,minOrderedLength:0,minUnorderedLength:0,triangleCount:0},memory:{bytesUsed:0,bytesReserved:0}},this._destroyed=!1,this.key=new s(t),this.resolution=e,this.x=i,this.y=r,this.width=n,this.height=o,this.rangeX=h,this.rangeY=l}destroy(){this.tileDebugInfoTexture&&(this.tileDebugInfoTexture.dispose(),this.tileDebugInfoTexture=null),this._destroyed=!0}get debugSlot(){let t=this;for(;t.parent!==this._stage;){if(!t.parent)return 0;t=t.parent}return this._stage.children.indexOf(t)}setTransform(i){const s=this.resolution/(i.resolution*i.pixelRatio),r=this.transforms.tileMat3,[n,o]=i.toScreenNoRotation([0,0],[this.x,this.y]),h=this.width/this.rangeX*s,l=this.height/this.rangeY*s;t(r,h,0,0,0,l,0,n,o,1),e(this.transforms.displayViewScreenMat3,i.displayViewMat3,r)}get destroyed(){return this._destroyed}}export{r as TiledDisplayObject};
5
+ import{set as t,multiply as e}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{DisplayObject as s}from"../DisplayObject.js";import i from"../../tiling/TileKey.js";class r extends s{constructor(t,e,s,r,o,n,h=o,d=n){super(),this.tileDebugInfoTexture=null,this.debugInfo={display:{length:0,minOrderedLength:0,minUnorderedLength:0,triangleCount:0},memory:{bytesUsed:0,bytesReserved:0}},this._destroyed=!1,this.key=new i(t),this.resolution=e,this.x=s,this.y=r,this.width=o,this.height=n,this.rangeX=h,this.rangeY=d}destroy(){super.destroy(),this.tileDebugInfoTexture&&(this.tileDebugInfoTexture.dispose(),this.tileDebugInfoTexture=null),this._destroyed=!0}get debugSlot(){let t=this;for(;t.parent!==this._stage;){if(!t.parent)return 0;t=t.parent}return this._stage.children.indexOf(t)}setTransform(s){const i=this.resolution/(s.resolution*s.pixelRatio),r=this.transforms.tileMat3,[o,n]=s.toScreenNoRotation([0,0],[this.x,this.y]),h=this.width/this.rangeX*i,d=this.height/this.rangeY*i;t(r,h,0,0,0,d,0,o,n,1),e(this.transforms.displayViewScreenMat3,s.displayViewMat3,r)}get destroyed(){return this._destroyed}}export{r as TiledDisplayObject};
@@ -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{disposeMaybe as e}from"../../../../core/maybe.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import o from"../../../../geometry/Point.js";import{load as s,execute as i}from"../../../../geometry/operators/projectOperator.js";import{DisplayObject as a}from"../DisplayObject.js";import{VideoScreenTechnique as n}from"./shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js";import{ColorAttachment0 as c,SizedPixelFormat as h}from"../../../webgl/enums.js";import{FramebufferObject as d}from"../../../webgl/FramebufferObject.js";import{Texture as u}from"../../../webgl/Texture.js";import{TextureDescriptor as l}from"../../../webgl/TextureDescriptor.js";class m extends a{constructor(e,t){super(),this._controlPointsOwner=t,this.readbackScreenCoords=r(),this.videoTextureCoords=new Array(36),this.overlayTextureCoords=new Array(36),this._prevFBO=null,this._acquiredFBO=null,this._isBound=!1,this._hasCoordinates=!1,this._geIsLoaded=!1,this._ndcRect=[0,0,2,2],this._technique=new n,this.visible=!1,this.stage=e;for(let r=0;r<6;r++){const e=r/5;for(let t=0;t<6;t++){const o=t/5;this.videoTextureCoords[6*r+t]={u:o,v:e}}}}getMesh(e){throw new Error("Method not implemented.")}destroy(){e(this._readbackTexture)}bind(e){const{context:t,pixelRatio:r,state:o}=e;if(this._update(e),!this.ready||0===this.readbackScreenCoords[2]||0===this.readbackScreenCoords[3])return this.requestRender(),!1;const{size:s}=o,i=Math.round(r*s[0]),a=Math.round(r*s[1]),n=new l(i,a);return n.samplingMode=9729,n.wrapMode=33071,this._acquiredFBO||(this._acquiredFBO=new d(t,n)),this._acquiredFBO.resize(i,a),t.bindFramebuffer(this._acquiredFBO),this._isBound=!0,!0}unbind(e){if(!this._isBound)return;const{context:t,pixelRatio:r,state:o}=e,{size:s}=o,i=this._acquiredFBO;if(!i.getColorTexture(c))throw new Error("Failed to get color texture from FBO.");const a=this._getReadbackTexture(e),n=this.readbackScreenCoords,h=Math.round(r*n[0]),d=Math.round(r*(s[1]-n[1]))-a.descriptor.height,u=h+a.descriptor.width,l=d+a.descriptor.height,m=Math.max(h,0),_=Math.max(d,0),x=Math.min(u,i.width)-m,b=Math.min(l,i.height)-_;x>0&&b>0&&i.copyToTexture(m,_,x,b,m-h,_-d,a),t.bindFramebuffer(this._prevFBO)}_update(e){const{state:r}=e,a=this._controlPointsOwner,n=a.groundControlPoints(),c=a.getSize(),h=r.size,d=n?.length;if(!d)return;if(s().then(()=>{this._geIsLoaded=!0}),!this._geIsLoaded)return void this.requestRender();const u=c[0],l=c[1],m=h[0],_=l/h[1],x=u/m;if(_>x){const e=x/_*2,t=(2-e)/2;this._ndcRect[0]=-1+t,this._ndcRect[1]=1,this._ndcRect[2]=e,this._ndcRect[3]=2}else{const e=_/x*2,t=(2-e)/2;this._ndcRect[0]=-1,this._ndcRect[1]=1-t,this._ndcRect[2]=2,this._ndcRect[3]=e}const b=new Array(d),f=r.spatialReference;for(let t=0;t<d;t++){const{lat:e,lon:r}=n[t],s=new o(r,e);b[t]=i(s,f)}const p=[];let M=1/0,g=1/0,w=-1/0,C=-1/0;for(const o of b){const e=t();r.toScreen(e,o.x,o.y),p.push({x:e[0],y:e[1]}),M=Math.min(M,e[0]),g=Math.min(g,e[1]),w=Math.max(w,e[0]),C=Math.max(C,e[1])}const R=[M,C],T=[w,g];this.readbackScreenCoords[0]=Math.max(Math.floor(R[0]),0),this.readbackScreenCoords[1]=Math.max(Math.floor(T[1]),0),this.readbackScreenCoords[2]=Math.ceil(T[0]),this.readbackScreenCoords[3]=Math.ceil(R[1]);for(let t=0;t<p.length;t++){const e=p[t],r=(e.x-M)/(w-M),o=(C-e.y)/(C-g);this.overlayTextureCoords[t]={u:r,v:o}}this._hasCoordinates=!0}_createTransforms(){return null}doRender(e){this._readbackTexture&&this._hasCoordinates?this._technique.render(e,{texture:this._readbackTexture,textureCoords:this.overlayTextureCoords,opacity:1,ndcRect:this._ndcRect}):this.requestRender()}_getReadbackTexture(e){const{context:t,pixelRatio:r}=e,o=Math.round(r*Math.abs(this.readbackScreenCoords[2]-this.readbackScreenCoords[0])),s=Math.round(r*Math.abs(this.readbackScreenCoords[3]-this.readbackScreenCoords[1]));if(this._readbackTexture)this._readbackTexture.resize(o,s);else{const e=new l(o,s);e.wrapMode=33071,e.internalFormat=h.RGBA8,this._readbackTexture=new u(t,e)}return this._readbackTexture}}export{m as default};
5
+ import{disposeMaybe as e}from"../../../../core/maybe.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import o from"../../../../geometry/Point.js";import{load as s,execute as i}from"../../../../geometry/operators/projectOperator.js";import{DisplayObject as a}from"../DisplayObject.js";import{VideoScreenTechnique as n}from"./shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js";import{ColorAttachment0 as c,SizedPixelFormat as d}from"../../../webgl/enums.js";import{FramebufferObject as h}from"../../../webgl/FramebufferObject.js";import{Texture as u}from"../../../webgl/Texture.js";import{TextureDescriptor as l}from"../../../webgl/TextureDescriptor.js";class m extends a{constructor(e,t){super(),this._controlPointsOwner=t,this.readbackScreenCoords=r(),this.videoTextureCoords=new Array(36),this.overlayTextureCoords=new Array(36),this._prevFBO=null,this._acquiredFBO=null,this._isBound=!1,this._hasCoordinates=!1,this._geIsLoaded=!1,this._ndcRect=[0,0,2,2],this._technique=new n,this.visible=!1,this.stage=e;for(let r=0;r<6;r++){const e=r/5;for(let t=0;t<6;t++){const o=t/5;this.videoTextureCoords[6*r+t]={u:o,v:e}}}}getMesh(e){throw new Error("Method not implemented.")}destroy(){super.destroy(),e(this._readbackTexture)}bind(e){const{context:t,pixelRatio:r,state:o}=e;if(this._update(e),!this.ready||0===this.readbackScreenCoords[2]||0===this.readbackScreenCoords[3])return this.requestRender(),!1;const{size:s}=o,i=Math.round(r*s[0]),a=Math.round(r*s[1]),n=new l(i,a);return n.samplingMode=9729,n.wrapMode=33071,this._acquiredFBO||(this._acquiredFBO=new h(t,n)),this._acquiredFBO.resize(i,a),t.bindFramebuffer(this._acquiredFBO),this._isBound=!0,!0}unbind(e){if(!this._isBound)return;const{context:t,pixelRatio:r,state:o}=e,{size:s}=o,i=this._acquiredFBO;if(!i.getColorTexture(c))throw new Error("Failed to get color texture from FBO.");const a=this._getReadbackTexture(e),n=this.readbackScreenCoords,d=Math.round(r*n[0]),h=Math.round(r*(s[1]-n[1]))-a.descriptor.height,u=d+a.descriptor.width,l=h+a.descriptor.height,m=Math.max(d,0),_=Math.max(h,0),x=Math.min(u,i.width)-m,b=Math.min(l,i.height)-_;x>0&&b>0&&i.copyToTexture(m,_,x,b,m-d,_-h,a),t.bindFramebuffer(this._prevFBO)}_update(e){const{state:r}=e,a=this._controlPointsOwner,n=a.groundControlPoints(),c=a.getSize(),d=r.size,h=n?.length;if(!h)return;if(s().then(()=>{this._geIsLoaded=!0}),!this._geIsLoaded)return void this.requestRender();const u=c[0],l=c[1],m=d[0],_=l/d[1],x=u/m;if(_>x){const e=x/_*2,t=(2-e)/2;this._ndcRect[0]=-1+t,this._ndcRect[1]=1,this._ndcRect[2]=e,this._ndcRect[3]=2}else{const e=_/x*2,t=(2-e)/2;this._ndcRect[0]=-1,this._ndcRect[1]=1-t,this._ndcRect[2]=2,this._ndcRect[3]=e}const b=new Array(h),f=r.spatialReference;for(let t=0;t<h;t++){const{lat:e,lon:r}=n[t],s=new o(r,e);b[t]=i(s,f)}const p=[];let M=1/0,g=1/0,w=-1/0,C=-1/0;for(const o of b){const e=t();r.toScreen(e,o.x,o.y),p.push({x:e[0],y:e[1]}),M=Math.min(M,e[0]),g=Math.min(g,e[1]),w=Math.max(w,e[0]),C=Math.max(C,e[1])}const R=[M,C],T=[w,g];this.readbackScreenCoords[0]=Math.max(Math.floor(R[0]),0),this.readbackScreenCoords[1]=Math.max(Math.floor(T[1]),0),this.readbackScreenCoords[2]=Math.ceil(T[0]),this.readbackScreenCoords[3]=Math.ceil(R[1]);for(let t=0;t<p.length;t++){const e=p[t],r=(e.x-M)/(w-M),o=(C-e.y)/(C-g);this.overlayTextureCoords[t]={u:r,v:o}}this._hasCoordinates=!0}_createTransforms(){return null}doRender(e){this._readbackTexture&&this._hasCoordinates?this._technique.render(e,{texture:this._readbackTexture,textureCoords:this.overlayTextureCoords,opacity:1,ndcRect:this._ndcRect}):this.requestRender()}_getReadbackTexture(e){const{context:t,pixelRatio:r}=e,o=Math.round(r*Math.abs(this.readbackScreenCoords[2]-this.readbackScreenCoords[0])),s=Math.round(r*Math.abs(this.readbackScreenCoords[3]-this.readbackScreenCoords[1]));if(this._readbackTexture)this._readbackTexture.resize(o,s);else{const e=new l(o,s);e.wrapMode=33071,e.internalFormat=d.RGBA8,this._readbackTexture=new u(t,e)}return this._readbackTexture}}export{m 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{DisplayObject as t}from"../../../DisplayObject.js";import e from"../../DisplayEntity.js";import{MappedMesh as n}from"../../cpuMapped/MappedMesh.js";import s from"../../util/Reader.js";import{deserializeList as r}from"../../util/serializationUtils.js";import{PrimitiveType as i,DataType as o}from"../../../../../webgl/enums.js";class a extends t{static fromMeshData(t,i,o){const c=new Map;for(const e of t.data){const t=new n(i,e.layout);t.append(e),t.upload(),c.set(e.instanceId,t)}const d=new s(t.entities),I=r(d,e,{})??[];return new a(I,c,o)}constructor(t,e,n){super(),this.displayObjects=t,this._instanceIdToMesh=e,this._store=n}draw(t,e){if(null==this._activeInstanceId)throw new Error("InternalError: No active instanceId");for(const n of this.displayObjects)for(const s of n.records){if(s.instanceId!==this._activeInstanceId)continue;const n=t.context,r=this._instanceIdToMesh.get(this._activeInstanceId).getGeometryVAO(n,e),a=s.indexStart*Uint32Array.BYTES_PER_ELEMENT;n.bindVAO(r),n.drawElements(i.TRIANGLES,s.indexCount,o.UNSIGNED_INT,a),n.bindVAO(null)}}getStencilReference(){return 0}getAttributePrecisionPackFactors(){return{}}destroy(){for(const t of this._instanceIdToMesh.values())t.destroy();this._instanceIdToMesh.clear()}setActiveMesh(t){this._activeInstanceId=t}getInput(){if(null==this._activeInstanceId)throw new Error("InternalError: No active instanceId");return this._store.getInstance(this._activeInstanceId).getInput()}_createTransforms(){throw new Error("Method not implemented.")}}export{a as TestDisplayObject};
5
+ import{DisplayObject as t}from"../../../DisplayObject.js";import e from"../../DisplayEntity.js";import{MappedMesh as n}from"../../cpuMapped/MappedMesh.js";import s from"../../util/Reader.js";import{deserializeList as r}from"../../util/serializationUtils.js";import{PrimitiveType as i,DataType as o}from"../../../../../webgl/enums.js";class a extends t{static fromMeshData(t,i,o){const c=new Map;for(const e of t.data){const t=new n(i,e.layout);t.append(e),t.upload(),c.set(e.instanceId,t)}const d=new s(t.entities),I=r(d,e,{})??[];return new a(I,c,o)}constructor(t,e,n){super(),this.displayObjects=t,this._instanceIdToMesh=e,this._store=n}draw(t,e){if(null==this._activeInstanceId)throw new Error("InternalError: No active instanceId");for(const n of this.displayObjects)for(const s of n.records){if(s.instanceId!==this._activeInstanceId)continue;const n=t.context,r=this._instanceIdToMesh.get(this._activeInstanceId).getGeometryVAO(n,e),a=s.indexStart*Uint32Array.BYTES_PER_ELEMENT;n.bindVAO(r),n.drawElements(i.TRIANGLES,s.indexCount,o.UNSIGNED_INT,a),n.bindVAO(null)}}getStencilReference(){return 0}getAttributePrecisionPackFactors(){return{}}destroy(){super.destroy();for(const t of this._instanceIdToMesh.values())t.destroy();this._instanceIdToMesh.clear()}setActiveMesh(t){this._activeInstanceId=t}getInput(){if(null==this._activeInstanceId)throw new Error("InternalError: No active instanceId");return this._store.getInstance(this._activeInstanceId).getInput()}_createTransforms(){throw new Error("Method not implemented.")}}export{a as TestDisplayObject};
@@ -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"../../../core/Handles.js";import{deg2rad as t}from"../../../core/mathUtils.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{watch as i,initial as s}from"../../../core/reactiveUtils.js";import{convertUnit as n}from"../../../core/unitUtils.js";import{fromRotation as o,translate as a,rotate as l,scaleByVec2 as m}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{set as h,sub as p,scale as d,rotate as u}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{ZEROS as f}from"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as j}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isLoadedOrLoadFor as _,project as g}from"../../../geometry/projectionUtils.js";import{getClosestDenormalizedXToReference as C}from"../../../geometry/support/normalizeUtils.js";import{getResolutionForScale as R}from"../../../geometry/support/scaleUtils.js";import{equals as U}from"../../../geometry/support/spatialReferenceUtils.js";import{DisplayObject as v}from"../engine/DisplayObject.js";import{GridTechnique as y}from"../engine/webgl/shaderGraph/techniques/grid/GridTechnique.js";import{minimumPixelsPerStrideForDisplayWhenScalingOff as S}from"./constants.js";import{measureMetersPerUnitAtReferencePoint as b,getScaleFactor as L}from"./gridUtils.js";const x=j();class P extends v{constructor(){super(),this._handles=new e,this._projectedCenter=null,this._metersPerSRUnit=null,this._technique=new y,this._grid=null,this.visible=!0}destroy(){this._handles=r(this._handles),this._technique.shutdown()}get grid(){return this._grid}set grid(e){this._grid=e,this._handles.removeAll(),this._handles.add([i(()=>e?.center,()=>{this._projectedCenter=null},s),i(()=>[e?.center,e?.dynamicScaling,e?.majorLineColor,e?.majorLineInterval,e?.minorLineColor,e?.rotateWithMap,e?.rotation,e?.spacing,e?.units],()=>this.requestRender(),s)])}_createTransforms(){return{displayViewScreenMat3:c()}}doRender(e){if(1!==e.drawPhase||null==this.grid||!this.visible)return;const{spacing:t,units:r,majorLineInterval:i,dynamicScaling:s,majorLineColor:o,minorLineColor:a}=this.grid;if(0===t)return;if(this._updateDerivedValues(e),null==this._projectedCenter||null==this._metersPerSRUnit)return;const{scale:l,spatialReference:m}=e.state,c=n(t,r,"meters"),h=this._metersPerSRUnit*R(l,m),p=c/h;if(!s&&p<S)return;const d=c*L(i,p,s);this._updateTransform(e,h,d),this._technique.render(e,{transform:{dvs:this.transforms.displayViewScreenMat3},config:{pxPerCell:d/h,minorLineColor:M(a),majorLineColor:M(o),majorLineInterval:i,halfWidth:.25,aaWidth:.5}})}_updateDerivedValues(e){if(!this.grid)return;const{center:t}=this.grid,{spatialReference:r}=e.state;this._projectedCenter&&U(this._projectedCenter.spatialReference,r)||(this._metersPerSRUnit=null,U(t.spatialReference,r)?this._projectedCenter=t:_(t.spatialReference,r)?this._projectedCenter=g(t,r):this.requestRender()),null==this._metersPerSRUnit&&null!=this._projectedCenter&&(this._metersPerSRUnit=b(this._projectedCenter))}_updateTransform(e,r,i){const{grid:s}=this,{center:n,rotation:c,size:j,spatialReference:_}=e.state;if(null==s||null==this._projectedCenter||null==this._metersPerSRUnit)return;const g=r*(j[0]/2),R=r*(j[1]/2),U=this._metersPerSRUnit/i,v=this._projectedCenter,y=t(s.rotation),S=t(c),b=this.transforms.displayViewScreenMat3;o(b,-y);const L=_.isWrappable?C(v.x,n[0],_):v.x,P=h(x,L,v.y),M=p(x,n,P);d(M,M,U),s.rotateWithMap||u(M,M,f,-S),u(M,M,f,-y),d(M,M,1/s.majorLineInterval),w(M,M),d(M,M,s.majorLineInterval),u(M,M,f,y),a(b,b,M),s.rotateWithMap&&l(b,b,S);const q=h(x,g/i,R/i);m(b,b,q)}}function w(e,t){return e[0]=t[0]-Math.trunc(t[0]),e[1]=t[1]-Math.trunc(t[1]),e}function M(e){const[t,r,i,s]=e.toArray().map(e=>e/255);return[t*s,r*s,i*s,s]}export{P as default};
5
+ import e from"../../../core/Handles.js";import{deg2rad as t}from"../../../core/mathUtils.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{watch as i,initial as s}from"../../../core/reactiveUtils.js";import{convertUnit as n}from"../../../core/unitUtils.js";import{fromRotation as o,translate as a,rotate as l,scaleByVec2 as m}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{set as h,sub as p,scale as d,rotate as u}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{ZEROS as f}from"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as j}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isLoadedOrLoadFor as _,project as g}from"../../../geometry/projectionUtils.js";import{getClosestDenormalizedXToReference as C}from"../../../geometry/support/normalizeUtils.js";import{getResolutionForScale as R}from"../../../geometry/support/scaleUtils.js";import{equals as U}from"../../../geometry/support/spatialReferenceUtils.js";import{DisplayObject as v}from"../engine/DisplayObject.js";import{GridTechnique as y}from"../engine/webgl/shaderGraph/techniques/grid/GridTechnique.js";import{minimumPixelsPerStrideForDisplayWhenScalingOff as S}from"./constants.js";import{measureMetersPerUnitAtReferencePoint as b,getScaleFactor as L}from"./gridUtils.js";const x=j();class P extends v{constructor(){super(),this._handles=new e,this._projectedCenter=null,this._metersPerSRUnit=null,this._technique=new y,this._grid=null,this.visible=!0}destroy(){super.destroy(),this._handles=r(this._handles),this._technique.shutdown()}get grid(){return this._grid}set grid(e){this._grid=e,this._handles.removeAll(),this._handles.add([i(()=>e?.center,()=>{this._projectedCenter=null},s),i(()=>[e?.center,e?.dynamicScaling,e?.majorLineColor,e?.majorLineInterval,e?.minorLineColor,e?.rotateWithMap,e?.rotation,e?.spacing,e?.units],()=>this.requestRender(),s)])}_createTransforms(){return{displayViewScreenMat3:c()}}doRender(e){if(1!==e.drawPhase||null==this.grid||!this.visible)return;const{spacing:t,units:r,majorLineInterval:i,dynamicScaling:s,majorLineColor:o,minorLineColor:a}=this.grid;if(0===t)return;if(this._updateDerivedValues(e),null==this._projectedCenter||null==this._metersPerSRUnit)return;const{scale:l,spatialReference:m}=e.state,c=n(t,r,"meters"),h=this._metersPerSRUnit*R(l,m),p=c/h;if(!s&&p<S)return;const d=c*L(i,p,s);this._updateTransform(e,h,d),this._technique.render(e,{transform:{dvs:this.transforms.displayViewScreenMat3},config:{pxPerCell:d/h,minorLineColor:M(a),majorLineColor:M(o),majorLineInterval:i,halfWidth:.25,aaWidth:.5}})}_updateDerivedValues(e){if(!this.grid)return;const{center:t}=this.grid,{spatialReference:r}=e.state;this._projectedCenter&&U(this._projectedCenter.spatialReference,r)||(this._metersPerSRUnit=null,U(t.spatialReference,r)?this._projectedCenter=t:_(t.spatialReference,r)?this._projectedCenter=g(t,r):this.requestRender()),null==this._metersPerSRUnit&&null!=this._projectedCenter&&(this._metersPerSRUnit=b(this._projectedCenter))}_updateTransform(e,r,i){const{grid:s}=this,{center:n,rotation:c,size:j,spatialReference:_}=e.state;if(null==s||null==this._projectedCenter||null==this._metersPerSRUnit)return;const g=r*(j[0]/2),R=r*(j[1]/2),U=this._metersPerSRUnit/i,v=this._projectedCenter,y=t(s.rotation),S=t(c),b=this.transforms.displayViewScreenMat3;o(b,-y);const L=_.isWrappable?C(v.x,n[0],_):v.x,P=h(x,L,v.y),M=p(x,n,P);d(M,M,U),s.rotateWithMap||u(M,M,f,-S),u(M,M,f,-y),d(M,M,1/s.majorLineInterval),w(M,M),d(M,M,s.majorLineInterval),u(M,M,f,y),a(b,b,M),s.rotateWithMap&&l(b,b,S);const q=h(x,g/i,R/i);m(b,b,q)}}function w(e,t){return e[0]=t[0]-Math.trunc(t[0]),e[1]=t[1]-Math.trunc(t[1]),e}function M(e){const[t,r,i,s]=e.toArray().map(e=>e/255);return[t*s,r*s,i*s,s]}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{__decorate as t}from"tslib";import e from"../../../core/Logger.js";import{isAbortError as r}from"../../../core/promiseUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{BitmapContainer as a}from"../engine/BitmapContainer.js";import{LayerView2DMixin as o}from"./LayerView2D.js";import p from"./support/ExportStrategy.js";import n from"../../layers/LayerView.js";import m from"../../layers/RefreshableLayerView.js";let h=class extends(m(o(n))){update(t){this._strategy.update(t).catch(t=>{r(t)||e.getLogger(this).error(t)}),this.notifyChange("updating")}attach(){this._bitmapContainer=new a,this.container.addChild(this._bitmapContainer),this._strategy=new p({container:this._bitmapContainer,fetchSource:this.fetchBitmapData.bind(this),requestUpdate:this.requestUpdate.bind(this)})}detach(){this._strategy.destroy(),this._strategy=null,this.container.removeChild(this._bitmapContainer),this._bitmapContainer.removeAllChildren()}viewChange(){}moveEnd(){this.requestUpdate()}fetchBitmapData(t,e,r){return this.layer.fetchImageBitmap(t,e,r)}async doRefresh(){this.requestUpdate()}isUpdating(){return this._strategy.updating||this.updateRequested}};t([i()],h.prototype,"_strategy",void 0),t([i()],h.prototype,"updating",void 0),h=t([s("esri.views.2d.layers.BaseDynamicLayerView2D")],h);const d=h;export{d as default};
5
+ import{__decorate as t}from"tslib";import e from"../../../core/Logger.js";import{isAbortError as r}from"../../../core/promiseUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{BitmapContainer as a}from"../engine/BitmapContainer.js";import{LayerView2DMixin as o}from"./LayerView2D.js";import p from"./support/ExportStrategy.js";import n from"../../layers/LayerView.js";import{RefreshableLayerView as m}from"../../layers/RefreshableLayerView.js";let h=class extends(m(o(n))){update(t){this._strategy.update(t).catch(t=>{r(t)||e.getLogger(this).error(t)}),this.notifyChange("updating")}attach(){this._bitmapContainer=new a,this.container.addChild(this._bitmapContainer),this._strategy=new p({container:this._bitmapContainer,fetchSource:this.fetchBitmapData.bind(this),requestUpdate:this.requestUpdate.bind(this)})}detach(){this._strategy.destroy(),this._strategy=null,this.container.removeChild(this._bitmapContainer),this._bitmapContainer.removeAllChildren()}viewChange(){}moveEnd(){this.requestUpdate()}fetchBitmapData(t,e,r){return this.layer.fetchImageBitmap(t,e,r)}async doRefresh(){this.requestUpdate()}isUpdating(){return this._strategy.updating||this.updateRequested}};t([i()],h.prototype,"_strategy",void 0),t([i()],h.prototype,"updating",void 0),h=t([s("esri.views.2d.layers.BaseDynamicLayerView2D")],h);const d=h;export{d 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{__decorate as e}from"tslib";import{property as t}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{create as i}from"../../../geometry/support/aaBoundingRect.js";import{equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import r from"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import"../tiling/TileQueue.js";import"../tiling/TileStrategy.js";import{LayerView2DMixin as l}from"./LayerView2D.js";import{Display as n}from"./support/Display.js";import a from"../../layers/LayerView.js";import p from"../../layers/RefreshableLayerView.js";const h=new Set,c=[],d=[];class u{constructor(e,t,s,o,r,l,n,a=[0,0],p=i()){this.id=e,this.level=t,this.row=s,this.col=o,this.world=r,this.resolution=l,this.scale=n,this.coords=a,this.bounds=p}}let m=class extends(p(l(a))){constructor(e){super(e),this._tileMap=new Map,this.layer=null,this.tiles=[]}initialize(){this.display=new n(this),this.container.addChild(this.display)}get _tileInfoView(){const e=this.layer?.tileInfo;return e?new r(e):null}attach(){}detach(){}requestRender(){this.display.requestRender()}tilesChanged(e,t){}supportsSpatialReference(e){const t=this.layer?.tileInfo;return!t||o(t.spatialReference,e)}async doRefresh(){}isUpdating(){return!1}update(e){const t=this._tileInfoView,s=this.tiles;if(t){const i=t.getTileCoverage(e.state,0),{spans:o,lodInfo:r}=i??{};if(o?.length&&r)for(const{row:e,colFrom:t,colTo:l}of o)for(let i=t;i<=l;i++){const t=r.normalizeCol(i),o=r.getWorldForColumn(i),l=`${r.level}/${e}/${t}/${o}`;if(!this._tileMap.has(l)){const i=new u(l,r.level,e,t,o,r.resolution,r.scale);r.getTileCoords(i.coords,i,!1),r.getTileBounds(i.bounds,i,!0),this._tileMap.set(l,i),s.push(i),c.push(i)}h.add(l)}}for(let i=s.length-1;i>=0;i--){const e=s[i];h.has(e.id)||(s.splice(i,1),d.push(e),this._tileMap.delete(e.id))}(c.length||d.length)&&(this.tilesChanged(c,d),c.length=d.length=0),h.clear(),this.requestRender()}viewChange(){this.requestUpdate()}moveEnd(){}};e([t()],m.prototype,"_tileInfoView",null),e([t()],m.prototype,"layer",void 0),m=e([s("esri.views.2d.layers.BaseLayerView2D")],m);const f=m;export{f as default};
5
+ import{__decorate as e}from"tslib";import{property as t}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{create as i}from"../../../geometry/support/aaBoundingRect.js";import{equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import r from"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import"../tiling/TileQueue.js";import"../tiling/TileStrategy.js";import{LayerView2DMixin as l}from"./LayerView2D.js";import{Display as n}from"./support/Display.js";import a from"../../layers/LayerView.js";import{RefreshableLayerView as p}from"../../layers/RefreshableLayerView.js";const h=new Set,c=[],d=[];class u{constructor(e,t,s,o,r,l,n,a=[0,0],p=i()){this.id=e,this.level=t,this.row=s,this.col=o,this.world=r,this.resolution=l,this.scale=n,this.coords=a,this.bounds=p}}let m=class extends(p(l(a))){constructor(e){super(e),this._tileMap=new Map,this.layer=null,this.tiles=[]}initialize(){this.display=new n(this),this.container.addChild(this.display)}get _tileInfoView(){const e=this.layer?.tileInfo;return e?new r(e):null}attach(){}detach(){}requestRender(){this.display.requestRender()}tilesChanged(e,t){}supportsSpatialReference(e){const t=this.layer?.tileInfo;return!t||o(t.spatialReference,e)}async doRefresh(){}isUpdating(){return!1}update(e){const t=this._tileInfoView,s=this.tiles;if(t){const i=t.getTileCoverage(e.state,0),{spans:o,lodInfo:r}=i??{};if(o?.length&&r)for(const{row:e,colFrom:t,colTo:l}of o)for(let i=t;i<=l;i++){const t=r.normalizeCol(i),o=r.getWorldForColumn(i),l=`${r.level}/${e}/${t}/${o}`;if(!this._tileMap.has(l)){const i=new u(l,r.level,e,t,o,r.resolution,r.scale);r.getTileCoords(i.coords,i,!1),r.getTileBounds(i.bounds,i,!0),this._tileMap.set(l,i),s.push(i),c.push(i)}h.add(l)}}for(let i=s.length-1;i>=0;i--){const e=s[i];h.has(e.id)||(s.splice(i,1),d.push(e),this._tileMap.delete(e.id))}(c.length||d.length)&&(this.tilesChanged(c,d),c.length=d.length=0),h.clear(),this.requestRender()}viewChange(){this.requestUpdate()}moveEnd(){}};e([t()],m.prototype,"_tileInfoView",null),e([t()],m.prototype,"layer",void 0),m=e([s("esri.views.2d.layers.BaseLayerView2D")],m);const f=m;export{f 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{__decorate as e}from"tslib";import{property as t}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{e as r}from"../../../chunks/earcut.js";import{create as o}from"../../../geometry/support/aaBoundingRect.js";import{closeRings as i}from"../../../geometry/support/coordsUtils.js";import{normalizeCentralMeridianForDisplay as n}from"../../../geometry/support/normalizeUtilsSync.js";import{equals as a}from"../../../geometry/support/spatialReferenceUtils.js";import{checkProjectionSupport as c,project as l}from"../../../layers/graphics/data/projectionSupport.js";import p from"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import"../tiling/TileQueue.js";import"../tiling/TileStrategy.js";import{thinLineHalfWidthThreshold as f}from"../engine/webgl/definitions.js";import{LineTessellation as h}from"../engine/webgl/TurboLine.js";import{LayerView2DMixin as d}from"./LayerView2D.js";import u from"./support/DisplayGL.js";import{analyzeRings as m}from"./support/util.js";import y from"../../layers/LayerView.js";import x from"../../layers/RefreshableLayerView.js";const g=new Set,v=[],w=[];class T{constructor(e,t,s,r,i,n,a,c=[0,0],l=o()){this.id=e,this.level=t,this.row=s,this.col=r,this.world=i,this.resolution=n,this.scale=a,this.coords=c,this.bounds=l}}let j=class extends(x(d(y))){constructor(e){super(e),this._tileMap=new Map,this.container=new u(this),this.layer=null,this.tiles=[],this._renderTarget={framebuffer:null,viewport:[0,0,0,0]}}get _tileInfoView(){const e=this.layer?.tileInfo;return e?new p(e):null}get context(){return this.view.stage.context.gl}attach(){}detach(){}requestRender(){this.container.requestRender()}tilesChanged(e,t){}supportsSpatialReference(e){const t=this.layer?.tileInfo;return!t||a(t.spatialReference,e)}async doRefresh(){}isUpdating(){return!1}update(e){const t=this._tileInfoView,s=this.tiles;if(t){const r=t.getTileCoverage(e.state,0),o=r?.spans,i=r?.lodInfo;if(o?.length&&i){const e=i.level;for(const{row:t,colFrom:r,colTo:n}of o)for(let o=r;o<=n;o++){const r=i.normalizeCol(o),n=i.getWorldForColumn(o),a=`${e}/${t}/${r}/${n}`;if(!this._tileMap.has(a)){const o=new T(a,e,t,r,n,i.resolution,i.scale);i.getTileCoords(o.coords,o,!1),i.getTileBounds(o.bounds,o,!0),this._tileMap.set(a,o),s.push(o),v.push(o)}g.add(a)}}}for(let r=s.length-1;r>=0;r--){const e=s[r];g.has(e.id)||(s.splice(r,1),w.push(e),this._tileMap.delete(e.id))}(v.length||w.length)&&(this.tilesChanged(v,w),v.length=w.length=0),g.clear(),this.requestRender()}viewChange(){this.requestUpdate()}moveEnd(){}bindRenderTarget(){this.context.bindFramebuffer(this.context.FRAMEBUFFER,this._renderTarget.framebuffer),this.context.viewport(this._renderTarget.viewport[0],this._renderTarget.viewport[1],this._renderTarget.viewport[2],this._renderTarget.viewport[3])}getRenderTarget(){return this._renderTarget}async tessellateExtent(e){const t={vertices:[],indices:[]},s=await this._projectAndNormalizeGeometry(e),r=t.vertices.length;return t.vertices.push({x:s.xmin,y:s.ymin,xOffset:0,yOffset:0,uTexcoord:0,vTexcoord:0,distance:0}),t.vertices.push({x:s.xmax,y:s.ymin,xOffset:0,yOffset:0,uTexcoord:1,vTexcoord:0,distance:0}),t.vertices.push({x:s.xmin,y:s.ymax,xOffset:0,yOffset:0,uTexcoord:0,vTexcoord:1,distance:0}),t.vertices.push({x:s.xmax,y:s.ymax,xOffset:0,yOffset:0,uTexcoord:1,vTexcoord:1,distance:0}),t.indices.push(r,r+1,r+2,r+1,r+3,r+2),t}async tessellatePoint(e,t){const s=await this._projectAndNormalizeGeometry(e);return this._tessellatePoints([s],t)}async tessellateMultipoint(e,t){const s=await this._projectAndNormalizeGeometry(e),r=s.points.map(e=>({x:e[0],y:e[1],spatialReference:s.spatialReference}));return this._tessellatePoints(r,t)}async _tessellatePoints(e,t){const s={vertices:[],indices:[]};for(const r of e){const e=s.vertices.length;s.vertices.push({x:r.x,y:r.y,xOffset:t.x,yOffset:t.y+t.height,uTexcoord:0,vTexcoord:0,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x+t.width,yOffset:t.y+t.height,uTexcoord:1,vTexcoord:0,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x,yOffset:t.y,uTexcoord:0,vTexcoord:1,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x+t.width,yOffset:t.y,uTexcoord:1,vTexcoord:1,distance:0}),s.indices.push(e,e+1,e+2,e+1,e+3,e+2)}return s}async tessellatePolyline(e,t){const s={vertices:[],indices:[]},r=(await this._projectAndNormalizeGeometry(e)).paths;if(!r?.length)return s;let o;const i=new h((e,r,i,n,a,c,l,p,f,h,d)=>{const u=s.vertices.length;return s.vertices.push({x:e,y:-r,xOffset:l*t/2,yOffset:p*t/2,uTexcoord:d/o,vTexcoord:(h+1)/2,distance:d}),u},(e,t,r)=>{s.indices.push(e,t,r)},!0);for(const n of r){o=0;for(let t=1;t<n.length;++t){const e=n[t][0]-n[t-1][0],s=n[t][1]-n[t-1][1];o+=Math.sqrt(e*e+s*s)}const e=n.map(e=>({x:e[0],y:-e[1]}));i.tessellate(e,_)}return s}async tessellatePolygon(e){const t={vertices:[],indices:[]},s=await this._projectAndNormalizeGeometry(e),r=s.rings;if(!r?.length)return t;i(s);for(const i of s.rings)for(const e of i)e[1]=-e[1];let o=1/0,n=1/0,a=-1/0,c=-1/0;return m(s.rings,()=>{},(e,t,s)=>{for(let r=e;r<t;r+=2)o=Math.min(o,s[r]),n=Math.min(n,s[r+1]),a=Math.max(a,s[r]),c=Math.max(c,s[r+1])}),m(s.rings,()=>{},(e,s,r,i)=>{this._invokeEarcut(t,e,s,r,i,[o,n,a,c])}),t}_invokeEarcut(e,t,s,o,i,n){const a=o.slice(t,s),c=r(a,i,2),l=e.vertices.length;for(let r=0;r<a.length;r+=2){const t=a[r],s=a[r+1];e.vertices.push({x:t,y:-s,xOffset:0,yOffset:0,uTexcoord:(t-n[0])/(n[2]-n[0]),vTexcoord:1-(s-n[1])/(n[3]-n[1]),distance:0})}for(let r=0;r<c.length;++r)e.indices.push(l+c[r])}async _projectAndNormalizeGeometry(e){await c(e.spatialReference,this.view.spatialReference);const t=n(e);return l(t,e.spatialReference,this.view.spatialReference)}};e([t()],j.prototype,"_tileInfoView",null),e([t()],j.prototype,"layer",void 0),e([t()],j.prototype,"context",null),j=e([s("esri.views.2d.layers.BaseLayerViewGL2D")],j);const _={pixelCoordRatio:1,wrapDistance:1e11,halfWidth:f+1,initialDistance:0,textured:!0,offset:0},R=j;export{R as default};
5
+ import{__decorate as e}from"tslib";import{property as t}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{e as r}from"../../../chunks/earcut.js";import{create as o}from"../../../geometry/support/aaBoundingRect.js";import{closeRings as i}from"../../../geometry/support/coordsUtils.js";import{normalizeCentralMeridianForDisplay as n}from"../../../geometry/support/normalizeUtilsSync.js";import{equals as a}from"../../../geometry/support/spatialReferenceUtils.js";import{checkProjectionSupport as c,project as l}from"../../../layers/graphics/data/projectionSupport.js";import p from"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import"../tiling/TileQueue.js";import"../tiling/TileStrategy.js";import{thinLineHalfWidthThreshold as f}from"../engine/webgl/definitions.js";import{LineTessellation as h}from"../engine/webgl/TurboLine.js";import{LayerView2DMixin as d}from"./LayerView2D.js";import u from"./support/DisplayGL.js";import{analyzeRings as m}from"./support/util.js";import y from"../../layers/LayerView.js";import{RefreshableLayerView as x}from"../../layers/RefreshableLayerView.js";const g=new Set,v=[],w=[];class T{constructor(e,t,s,r,i,n,a,c=[0,0],l=o()){this.id=e,this.level=t,this.row=s,this.col=r,this.world=i,this.resolution=n,this.scale=a,this.coords=c,this.bounds=l}}let j=class extends(x(d(y))){constructor(e){super(e),this._tileMap=new Map,this.container=new u(this),this.layer=null,this.tiles=[],this._renderTarget={framebuffer:null,viewport:[0,0,0,0]}}get _tileInfoView(){const e=this.layer?.tileInfo;return e?new p(e):null}get context(){return this.view.stage.context.gl}attach(){}detach(){}requestRender(){this.container.requestRender()}tilesChanged(e,t){}supportsSpatialReference(e){const t=this.layer?.tileInfo;return!t||a(t.spatialReference,e)}async doRefresh(){}isUpdating(){return!1}update(e){const t=this._tileInfoView,s=this.tiles;if(t){const r=t.getTileCoverage(e.state,0),o=r?.spans,i=r?.lodInfo;if(o?.length&&i){const e=i.level;for(const{row:t,colFrom:r,colTo:n}of o)for(let o=r;o<=n;o++){const r=i.normalizeCol(o),n=i.getWorldForColumn(o),a=`${e}/${t}/${r}/${n}`;if(!this._tileMap.has(a)){const o=new T(a,e,t,r,n,i.resolution,i.scale);i.getTileCoords(o.coords,o,!1),i.getTileBounds(o.bounds,o,!0),this._tileMap.set(a,o),s.push(o),v.push(o)}g.add(a)}}}for(let r=s.length-1;r>=0;r--){const e=s[r];g.has(e.id)||(s.splice(r,1),w.push(e),this._tileMap.delete(e.id))}(v.length||w.length)&&(this.tilesChanged(v,w),v.length=w.length=0),g.clear(),this.requestRender()}viewChange(){this.requestUpdate()}moveEnd(){}bindRenderTarget(){this.context.bindFramebuffer(this.context.FRAMEBUFFER,this._renderTarget.framebuffer),this.context.viewport(this._renderTarget.viewport[0],this._renderTarget.viewport[1],this._renderTarget.viewport[2],this._renderTarget.viewport[3])}getRenderTarget(){return this._renderTarget}async tessellateExtent(e){const t={vertices:[],indices:[]},s=await this._projectAndNormalizeGeometry(e),r=t.vertices.length;return t.vertices.push({x:s.xmin,y:s.ymin,xOffset:0,yOffset:0,uTexcoord:0,vTexcoord:0,distance:0}),t.vertices.push({x:s.xmax,y:s.ymin,xOffset:0,yOffset:0,uTexcoord:1,vTexcoord:0,distance:0}),t.vertices.push({x:s.xmin,y:s.ymax,xOffset:0,yOffset:0,uTexcoord:0,vTexcoord:1,distance:0}),t.vertices.push({x:s.xmax,y:s.ymax,xOffset:0,yOffset:0,uTexcoord:1,vTexcoord:1,distance:0}),t.indices.push(r,r+1,r+2,r+1,r+3,r+2),t}async tessellatePoint(e,t){const s=await this._projectAndNormalizeGeometry(e);return this._tessellatePoints([s],t)}async tessellateMultipoint(e,t){const s=await this._projectAndNormalizeGeometry(e),r=s.points.map(e=>({x:e[0],y:e[1],spatialReference:s.spatialReference}));return this._tessellatePoints(r,t)}async _tessellatePoints(e,t){const s={vertices:[],indices:[]};for(const r of e){const e=s.vertices.length;s.vertices.push({x:r.x,y:r.y,xOffset:t.x,yOffset:t.y+t.height,uTexcoord:0,vTexcoord:0,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x+t.width,yOffset:t.y+t.height,uTexcoord:1,vTexcoord:0,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x,yOffset:t.y,uTexcoord:0,vTexcoord:1,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x+t.width,yOffset:t.y,uTexcoord:1,vTexcoord:1,distance:0}),s.indices.push(e,e+1,e+2,e+1,e+3,e+2)}return s}async tessellatePolyline(e,t){const s={vertices:[],indices:[]},r=(await this._projectAndNormalizeGeometry(e)).paths;if(!r?.length)return s;let o;const i=new h((e,r,i,n,a,c,l,p,f,h,d)=>{const u=s.vertices.length;return s.vertices.push({x:e,y:-r,xOffset:l*t/2,yOffset:p*t/2,uTexcoord:d/o,vTexcoord:(h+1)/2,distance:d}),u},(e,t,r)=>{s.indices.push(e,t,r)},!0);for(const n of r){o=0;for(let t=1;t<n.length;++t){const e=n[t][0]-n[t-1][0],s=n[t][1]-n[t-1][1];o+=Math.sqrt(e*e+s*s)}const e=n.map(e=>({x:e[0],y:-e[1]}));i.tessellate(e,_)}return s}async tessellatePolygon(e){const t={vertices:[],indices:[]},s=await this._projectAndNormalizeGeometry(e),r=s.rings;if(!r?.length)return t;i(s);for(const i of s.rings)for(const e of i)e[1]=-e[1];let o=1/0,n=1/0,a=-1/0,c=-1/0;return m(s.rings,()=>{},(e,t,s)=>{for(let r=e;r<t;r+=2)o=Math.min(o,s[r]),n=Math.min(n,s[r+1]),a=Math.max(a,s[r]),c=Math.max(c,s[r+1])}),m(s.rings,()=>{},(e,s,r,i)=>{this._invokeEarcut(t,e,s,r,i,[o,n,a,c])}),t}_invokeEarcut(e,t,s,o,i,n){const a=o.slice(t,s),c=r(a,i,2),l=e.vertices.length;for(let r=0;r<a.length;r+=2){const t=a[r],s=a[r+1];e.vertices.push({x:t,y:-s,xOffset:0,yOffset:0,uTexcoord:(t-n[0])/(n[2]-n[0]),vTexcoord:1-(s-n[1])/(n[3]-n[1]),distance:0})}for(let r=0;r<c.length;++r)e.indices.push(l+c[r])}async _projectAndNormalizeGeometry(e){await c(e.spatialReference,this.view.spatialReference);const t=n(e);return l(t,e.spatialReference,this.view.spatialReference)}};e([t()],j.prototype,"_tileInfoView",null),e([t()],j.prototype,"layer",void 0),e([t()],j.prototype,"context",null),j=e([s("esri.views.2d.layers.BaseLayerViewGL2D")],j);const _={pixelCoordRatio:1,wrapDistance:1e11,halfWidth:f+1,initialDistance:0,textured:!0,offset:0},R=j;export{R 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{__decorate as e}from"tslib";import r from"../../../core/Collection.js";import"../../../core/Logger.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView2DMixin as s}from"./LayerView2D.js";import a from"../../layers/CatalogDynamicGroupLayerView.js";import o from"../../layers/LayerView.js";let i=class extends(a(s(o))){constructor(){super(...arguments),this.unsupportedItemTypes=["Scene Service"],this.layerViews=new r}attach(){this.addAttachHandles([this.layerViews.on("after-changes",()=>this._updateStageChildren()),this.enableLayerUpdates()])}detach(){this.container.removeAllChildren()}update(e){this.updateLayers()}viewChange(){}moveEnd(){this.requestUpdate()}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,r)=>this.container.addChildAt(e.container,r))}};i=e([t("esri.views.2d.layers.CatalogDynamicGroupLayerView2D")],i);const c=i;export{c as default};
5
+ import{__decorate as e}from"tslib";import r from"../../../core/Collection.js";import"../../../core/Logger.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView2DMixin as s}from"./LayerView2D.js";import{CatalogDynamicGroupLayerView as a}from"../../layers/CatalogDynamicGroupLayerView.js";import o from"../../layers/LayerView.js";let i=class extends(a(s(o))){constructor(){super(...arguments),this.unsupportedItemTypes=["Scene Service"],this.layerViews=new r}attach(){this.addAttachHandles([this.layerViews.on("after-changes",()=>this._updateStageChildren()),this.enableLayerUpdates()])}detach(){this.container.removeAllChildren()}update(e){this.updateLayers()}viewChange(){}moveEnd(){this.requestUpdate()}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,r)=>this.container.addChildAt(e.container,r))}};i=e([t("esri.views.2d.layers.CatalogDynamicGroupLayerView2D")],i);const c=i;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{__decorate as r}from"tslib";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 e from"./FeatureLayerView2D.js";import s from"../../layers/CatalogFootprintLayerView.js";let t=class extends(s(e)){};t=r([o("esri.views.2d.layers.CatalogFootprintLayerView2D")],t);const a=t;export{a as default};
5
+ import{__decorate as r}from"tslib";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 e from"./FeatureLayerView2D.js";import{CatalogFootprintLayerView as s}from"../../layers/CatalogFootprintLayerView.js";let t=class extends(s(e)){};t=r([o("esri.views.2d.layers.CatalogFootprintLayerView2D")],t);const a=t;export{a 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{__decorate as e}from"tslib";import r from"../../../core/Collection.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 t}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView2DMixin as a}from"./LayerView2D.js";import i from"../../layers/CatalogLayerView.js";import s from"../../layers/LayerView.js";let l=class extends(i(a(s))){constructor(){super(...arguments),this.layerViews=new r}update(e){}viewChange(){}moveEnd(){}attach(){this.addAttachHandles([this._updatingHandles.addOnCollectionChange(()=>this.layerViews,()=>this._updateStageChildren(),{initial:!0})])}detach(){this.container.removeAllChildren()}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,r)=>this.container.addChildAt(e.container,r))}};e([o()],l.prototype,"layerViews",void 0),l=e([t("esri.views.2d.layers.CatalogLayerView2D")],l);const c=l;export{c as default};
5
+ import{__decorate as e}from"tslib";import r from"../../../core/Collection.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 t}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView2DMixin as a}from"./LayerView2D.js";import{CatalogLayerView as i}from"../../layers/CatalogLayerView.js";import s from"../../layers/LayerView.js";let l=class extends(i(a(s))){constructor(){super(...arguments),this.layerViews=new r}update(e){}viewChange(){}moveEnd(){}attach(){this.addAttachHandles([this._updatingHandles.addOnCollectionChange(()=>this.layerViews,()=>this._updateStageChildren(),{initial:!0})])}detach(){this.container.removeAllChildren()}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,r)=>this.container.addChildAt(e.container,r))}};e([o()],l.prototype,"layerViews",void 0),l=e([t("esri.views.2d.layers.CatalogLayerView2D")],l);const c=l;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{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import s from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import{neverReached as o}from"../../../core/compilerUtils.js";import n from"../../../core/Error.js";import{makeHandle as u,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import h from"../../../core/Logger.js";import{destroyMaybe as c}from"../../../core/maybe.js";import{notDeepEqual as p}from"../../../core/object.js";import{createAbortError as d,createResolver as y,ignoreAbortErrors as f,throwIfNotAbortError as g,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as w}from"../../../core/reactiveUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{property as _}from"../../../core/accessorSupport/decorators/property.js";import{subclass as b}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as S}from"../../../core/support/UpdatingHandles.js";import F from"../../../geometry/Extent.js";import A from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as j}from"../../../layers/graphics/featureConversionUtils.js";import U from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as x}from"../../../layers/support/featureLayerUtils.js";import{packFields as I}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as E}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as k}from"../../../layers/support/timeSupport.js";import C from"../../../rest/support/AggregateFeatureSet.js";import V from"../../../rest/support/AttributeBinsFeatureSet.js";import q from"../../../rest/support/AttributeBinsQuery.js";import R from"../../../rest/support/FeatureSet.js";import Q from"../../../rest/support/Query.js";import{LayerView2DMixin as O}from"./LayerView2D.js";import{FeatureContainer as L}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as T}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as W}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as P}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as M}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as D}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as H}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as N}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as J}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as G}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as $}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as B}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as z}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as Z}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as K}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as X}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as Y}from"./support/handleNoEngineError.js";import{toJSONGeometryType as ee}from"./support/util.js";import{FeatureTileSubscriptionManager as te}from"../tiling/FeatureTileSubscriptionManager.js";import re from"../../layers/FeatureLayerView.js";import se from"../../layers/LayerView.js";import ie from"../../layers/RefreshableLayerView.js";import{getHighlightName as ae}from"../../support/highlightOptionsUtils.js";function oe(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const ne=4294967294;function ue(e,t){return l(e.map(e=>w(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t)))}let le=class extends(re(ie(O(se)))){constructor(){super(...arguments),this._commandsQueue=new X({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new W,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new S,this._fields=null,this._sourceUpdating=!1,this.featureEffectView=new A,this._lastUpdate=0}destroy(){this._workerProxy?.destroy(),this._workerAttached.reject(d()),this._commandsQueue.destroy()}initialize(){this._workerAttached=y(),f(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new n("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===E(e)?.operations.supportsQuery)throw new n("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await T(t)}async _attachProxy(){const e={service:await this.layerAdapter.createServiceOptions(this.view),tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};let t=[];Array.isArray(e.service.source)&&(t=e.service.source);try{await this._workerProxy.pipeline.onAttach(e,{transferList:t}),this._workerAttached.resolve()}catch(r){this._workerAttached.reject(d()),g(r)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map(({vvEvaluators:e,deconflictionEnabled:s,labelingInfo:i})=>({labelingInfo:i,container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:s,geometryType:t,visible:r}))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new H(this.layer):new M(this.layer);case"geojson":case"csv":case"wfs":return new H(this.layer);case"parquet":return new $(this.layer);case"subtype-group":return new z(this.layer);case"ogc-feature":return new J(this.layer);case"stream":return new B(this.layer);case"oriented-imagery":return new G(this.layer);case"knowledge-graph-sublayer":return new N(this.layer);case"catalog-footprint":return new P(this.layer);default:o(this.layer)}return null}get timeExtent(){return k(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t){let s;e instanceof r?s=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?s=[e]:a.isCollection(e)&&e.length>0?s=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(s="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=s?.filter(i);if(!o?.length)return u();const n=ae(t);return this._addHighlights(o,n),u(()=>!this.destroyed&&this._removeHighlights(o,n))}async hitTest(e,i){const a=await this.featureContainer.hitTest(i);if(0===a.length)return null;const o=await this.getWorker(),{features:n,aggregates:u,tracks:l}=await o.pipeline.getDisplayFeatures(a),h=this.featureContainer.getSortKeys(a),c=({displayId:e},{displayId:t})=>h.has(e)&&h.has(t)?h.get(e)-h.get(t):e-t;return n.sort(c).reverse(),u.sort(c).reverse(),[...u.map(r=>this._createGraphicHit(e,t.fromJSON(r))),...l.map(t=>this._createGraphicHit(e,s.fromJSON(t))),...n.map(t=>this._createGraphicHit(e,r.fromJSON(t)))]}async queryStatistics(){const e=await this.getWorker();return Y(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,r);return Y(a,{})}async queryAggregateSummaryStatistics(e,t,r){const s={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),s,r);return Y(i,{})}async queryUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,r);return Y(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,r);return Y(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,r);return Y(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,r);return Y(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForHistogram(this._cleanUpQuery(e),i,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=R.fromJSON(e);return t.features.forEach(e=>this._setLayersForFeature(e)),t})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),s=await Y(r,{features:[]}),i=R.fromJSON(s);return i.features.forEach(e=>this._setLayersForFeature(e)),i}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),s=await Y(r,{features:[]}),i=C.fromJSON(s);return i.features.forEach(e=>this._setLayersForFeature(e)),i}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return Y(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return Y(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return Y(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return Y(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return Y(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return Y(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),s=await Y(r,{count:0,extent:null});return{count:s.count,extent:F.fromJSON(s.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),s=await Y(r,{features:[]});return V.fromJSON(s)}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){const t=performance.now();if(t-this._lastUpdate<200)return;if(this._lastUpdate=t,!this.subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const r=this.subscriptionManager.update(e.targetState,this._lastTargetState),s=new Set(this.subscriptionManager.coverage?.target.keys());for(const i of this.featureContainer.tiles||[])i.isCoverage=s.has(i.id);this.featureContainer.setVisibleTiles(r)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),f(this._updatingHandles.addPromise(this._workerAttached.promise)),f(this._attachProxy()),this.featureContainer=new L(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this.subscriptionManager=new te({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),f(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([ue([()=>this._displayRefreshVersion,()=>this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),w(()=>this.updateSuspended,e=>{e||(this.subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),w(()=>this.visible,e=>{this.view.labelManager.requestUpdate()})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this.subscriptionManager=c(this.subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=y(),f(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new n("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,s=this.featureContainer.updatingHandles.updating,i=this.updateRequested||e&&(t||r)||s||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${i}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${s}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return i}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const s of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(s));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e)))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const s={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const i=r.visualVariableUniforms,a=ee(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await Z({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:"renderer",schemaOptions:s})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=Q.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=q.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=Q.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const s of t.aggregateIds??[])r.push(s);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%ne+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ne+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?h.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const s="globalIdField"in this.layer&&this.layer.globalIdField,i=s&&this.availableFields.includes(s);if(r.length&&!i)return h.getLogger(this).error(new n("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${s} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,s=ee(this.layer.geometryType),i=D(this.layer),a=[];for(const o of e.added){const e=j(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.updated){const e=j(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.removed)if(null==o)throw new n("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:o});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,s="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(s&&this._canEditByFeature(s)){const{adds:e,deletes:t,updates:i}=s.editedFeatures,a=this.layer.objectIdField,o=i.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),u=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:u,historicMoment:r,isWeak:!0,release:[]})}const[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...i,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._handleChange(),x(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this.subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads();const t=this._lastSchema?.processor.mesh.factory.symbology?.type;let r=!0;"subtype-group"!==this.layer.type&&"dictionary"===this.layer.renderer?.type&&"dictionary"===t&&(r=!1),e.updateStart(r);const s=this.featureEffect,i={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},a=await this._createViewSchemaConfig(),o={source:this.layerAdapter.createSourceSchema(a,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(i,a,this._displayRefreshVersion)},n=o.processor.mesh.factory.labels;n&&this.view.labelManager.setLabelSchemaStyles(n,this.featureContainer);const u=p(this._lastSchema?.source.mutable,o.source.mutable)||p(this._lastSchema?.processor,o.processor);if(!u)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(r),void(this.featureEffectView.featureEffect=s);this._lastSchema=o,this._fields=null;const l=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${l}] FeatureLayerView2D._doUpdate`,{changes:u});const h=await this.getWorker();await h.pipeline.updateSchema(o,l),e.updateEnd(r),this.featureEffectView.featureEffect=s,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.trySwapRenderState(),this.featureContainer.requestRender();const c=o.processor.mesh.strategy,d="cluster"===c.type||"binning"===c.type,y="heatmap"===o.processor.mesh.factory.symbology.type,f=d||y?"target-defer":"eager";this.subscriptionManager.setVisibilityStrategy(f),has("esri-2d-update-debug")&&console.debug(`Version[${l}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doOverride(e){const t=await this.getWorker();try{for(const r of e.messages)switch(r.type){case"edit":{const e=new K;e.add(await this._resolveEdit(r.event)),await t.pipeline.onOverride(e.toMessage());break}case"override":{const e=new K;e.add(this._resolveOverrides(r.options)),await t.pipeline.onOverride(e.toMessage());break}}}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=oe(this._lastAvailableFields,e);return this._lastAvailableFields=t,I(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[he(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch(e=>{m(e)||h.getLogger(this).error(e)});this._updatingHandles.addPromise(r)}_setLayersForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createGraphicHit(e,t){return this._setLayersForFeature(t),null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function he(e,t,r,s,i,a){i&&(i=i.clone());const o=null!=i?i.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(i??=new U,i.timeExtent=n),i=t.addFilters?.(i,e)??i,a&&(i??=new U,i.where=v(i.where,a));let u=i?.toJSON()??null;return s.size&&(u??=(new U).toJSON(),u.hiddenIds=Array.from(s)),u}e([_()],le.prototype,"_commandsQueue",void 0),e([_()],le.prototype,"_sourceRefreshVersion",void 0),e([_()],le.prototype,"_displayRefreshVersion",void 0),e([_({readOnly:!0})],le.prototype,"_pipelineUpdating",void 0),e([_()],le.prototype,"_sourceUpdating",void 0),e([_({readOnly:!0})],le.prototype,"dataUpdating",null),e([_({readOnly:!0})],le.prototype,"hasAllFeatures",null),e([_({readOnly:!0})],le.prototype,"hasAllFeaturesInView",null),e([_({readOnly:!0})],le.prototype,"hasFullGeometries",null),e([_()],le.prototype,"featureEffectView",void 0),e([_()],le.prototype,"labelingCollisionInfos",null),e([_()],le.prototype,"layerAdapter",null),e([_({readOnly:!0})],le.prototype,"timeExtent",null),e([_()],le.prototype,"updating",void 0),le=e([b("esri.views.2d.layers.FeatureLayerView2D")],le);export{le as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import s from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import{neverReached as o}from"../../../core/compilerUtils.js";import n from"../../../core/Error.js";import{makeHandle as u,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import h from"../../../core/Logger.js";import{destroyMaybe as c}from"../../../core/maybe.js";import{notDeepEqual as p}from"../../../core/object.js";import{createAbortError as d,createResolver as y,ignoreAbortErrors as f,throwIfNotAbortError as g,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as w}from"../../../core/reactiveUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{property as _}from"../../../core/accessorSupport/decorators/property.js";import{subclass as b}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as S}from"../../../core/support/UpdatingHandles.js";import F from"../../../geometry/Extent.js";import A from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as j}from"../../../layers/graphics/featureConversionUtils.js";import U from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as x}from"../../../layers/support/featureLayerUtils.js";import{packFields as I}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as E}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as k}from"../../../layers/support/timeSupport.js";import C from"../../../rest/support/AggregateFeatureSet.js";import V from"../../../rest/support/AttributeBinsFeatureSet.js";import q from"../../../rest/support/AttributeBinsQuery.js";import R from"../../../rest/support/FeatureSet.js";import Q from"../../../rest/support/Query.js";import{LayerView2DMixin as O}from"./LayerView2D.js";import{FeatureContainer as L}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as T}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as W}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as P}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as M}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as D}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as H}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as N}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as J}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as G}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as $}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as B}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as z}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as Z}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as K}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as X}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as Y}from"./support/handleNoEngineError.js";import{toJSONGeometryType as ee}from"./support/util.js";import{FeatureTileSubscriptionManager as te}from"../tiling/FeatureTileSubscriptionManager.js";import{FeatureLayerView as re}from"../../layers/FeatureLayerView.js";import se from"../../layers/LayerView.js";import{RefreshableLayerView as ie}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ae}from"../../support/highlightOptionsUtils.js";function oe(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const ne=4294967294;function ue(e,t){return l(e.map(e=>w(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t)))}let le=class extends(re(ie(O(se)))){constructor(){super(...arguments),this._commandsQueue=new X({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new W,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new S,this._fields=null,this._sourceUpdating=!1,this.featureEffectView=new A,this._lastUpdate=0}destroy(){this._workerProxy?.destroy(),this._workerAttached.reject(d()),this._commandsQueue.destroy()}initialize(){this._workerAttached=y(),f(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new n("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===E(e)?.operations.supportsQuery)throw new n("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await T(t)}async _attachProxy(){const e={service:await this.layerAdapter.createServiceOptions(this.view),tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};let t=[];Array.isArray(e.service.source)&&(t=e.service.source);try{await this._workerProxy.pipeline.onAttach(e,{transferList:t}),this._workerAttached.resolve()}catch(r){this._workerAttached.reject(d()),g(r)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map(({vvEvaluators:e,deconflictionEnabled:s,labelingInfo:i})=>({labelingInfo:i,container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:s,geometryType:t,visible:r}))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new H(this.layer):new M(this.layer);case"geojson":case"csv":case"wfs":return new H(this.layer);case"parquet":return new $(this.layer);case"subtype-group":return new z(this.layer);case"ogc-feature":return new J(this.layer);case"stream":return new B(this.layer);case"oriented-imagery":return new G(this.layer);case"knowledge-graph-sublayer":return new N(this.layer);case"catalog-footprint":return new P(this.layer);default:o(this.layer)}return null}get timeExtent(){return k(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t){let s;e instanceof r?s=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?s=[e]:a.isCollection(e)&&e.length>0?s=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(s="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=s?.filter(i);if(!o?.length)return u();const n=ae(t);return this._addHighlights(o,n),u(()=>!this.destroyed&&this._removeHighlights(o,n))}async hitTest(e,i){const a=await this.featureContainer.hitTest(i);if(0===a.length)return null;const o=await this.getWorker(),{features:n,aggregates:u,tracks:l}=await o.pipeline.getDisplayFeatures(a),h=this.featureContainer.getSortKeys(a),c=({displayId:e},{displayId:t})=>h.has(e)&&h.has(t)?h.get(e)-h.get(t):e-t;return n.sort(c).reverse(),u.sort(c).reverse(),[...u.map(r=>this._createGraphicHit(e,t.fromJSON(r))),...l.map(t=>this._createGraphicHit(e,s.fromJSON(t))),...n.map(t=>this._createGraphicHit(e,r.fromJSON(t)))]}async queryStatistics(){const e=await this.getWorker();return Y(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,r);return Y(a,{})}async queryAggregateSummaryStatistics(e,t,r){const s={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),s,r);return Y(i,{})}async queryUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,r);return Y(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,r);return Y(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,r);return Y(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,r);return Y(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForHistogram(this._cleanUpQuery(e),i,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=R.fromJSON(e);return t.features.forEach(e=>this._setLayersForFeature(e)),t})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),s=await Y(r,{features:[]}),i=R.fromJSON(s);return i.features.forEach(e=>this._setLayersForFeature(e)),i}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),s=await Y(r,{features:[]}),i=C.fromJSON(s);return i.features.forEach(e=>this._setLayersForFeature(e)),i}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return Y(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return Y(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return Y(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return Y(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return Y(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return Y(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),s=await Y(r,{count:0,extent:null});return{count:s.count,extent:F.fromJSON(s.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),s=await Y(r,{features:[]});return V.fromJSON(s)}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){const t=performance.now();if(t-this._lastUpdate<200)return;if(this._lastUpdate=t,!this.subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const r=this.subscriptionManager.update(e.targetState,this._lastTargetState),s=new Set(this.subscriptionManager.coverage?.target.keys());for(const i of this.featureContainer.tiles||[])i.isCoverage=s.has(i.id);this.featureContainer.setVisibleTiles(r)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),f(this._updatingHandles.addPromise(this._workerAttached.promise)),f(this._attachProxy()),this.featureContainer=new L(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this.subscriptionManager=new te({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),f(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([ue([()=>this._displayRefreshVersion,()=>this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),w(()=>this.updateSuspended,e=>{e||(this.subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),w(()=>this.visible,e=>{this.view.labelManager.requestUpdate()})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this.subscriptionManager=c(this.subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=y(),f(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new n("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,s=this.featureContainer.updatingHandles.updating,i=this.updateRequested||e&&(t||r)||s||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${i}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${s}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return i}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const s of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(s));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e)))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const s={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const i=r.visualVariableUniforms,a=ee(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await Z({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:"renderer",schemaOptions:s})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=Q.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=q.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=Q.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const s of t.aggregateIds??[])r.push(s);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%ne+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ne+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?h.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const s="globalIdField"in this.layer&&this.layer.globalIdField,i=s&&this.availableFields.includes(s);if(r.length&&!i)return h.getLogger(this).error(new n("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${s} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,s=ee(this.layer.geometryType),i=D(this.layer),a=[];for(const o of e.added){const e=j(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.updated){const e=j(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.removed)if(null==o)throw new n("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:o});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,s="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(s&&this._canEditByFeature(s)){const{adds:e,deletes:t,updates:i}=s.editedFeatures,a=this.layer.objectIdField,o=i.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),u=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:u,historicMoment:r,isWeak:!0,release:[]})}const[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...i,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._handleChange(),x(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this.subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads();const t=this._lastSchema?.processor.mesh.factory.symbology?.type;let r=!0;"subtype-group"!==this.layer.type&&"dictionary"===this.layer.renderer?.type&&"dictionary"===t&&(r=!1),e.updateStart(r);const s=this.featureEffect,i={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},a=await this._createViewSchemaConfig(),o={source:this.layerAdapter.createSourceSchema(a,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(i,a,this._displayRefreshVersion)},n=o.processor.mesh.factory.labels;n&&this.view.labelManager.setLabelSchemaStyles(n,this.featureContainer);const u=p(this._lastSchema?.source.mutable,o.source.mutable)||p(this._lastSchema?.processor,o.processor);if(!u)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(r),void(this.featureEffectView.featureEffect=s);this._lastSchema=o,this._fields=null;const l=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${l}] FeatureLayerView2D._doUpdate`,{changes:u});const h=await this.getWorker();await h.pipeline.updateSchema(o,l),e.updateEnd(r),this.featureEffectView.featureEffect=s,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.trySwapRenderState(),this.featureContainer.requestRender();const c=o.processor.mesh.strategy,d="cluster"===c.type||"binning"===c.type,y="heatmap"===o.processor.mesh.factory.symbology.type,f=d||y?"target-defer":"eager";this.subscriptionManager.setVisibilityStrategy(f),has("esri-2d-update-debug")&&console.debug(`Version[${l}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doOverride(e){const t=await this.getWorker();try{for(const r of e.messages)switch(r.type){case"edit":{const e=new K;e.add(await this._resolveEdit(r.event)),await t.pipeline.onOverride(e.toMessage());break}case"override":{const e=new K;e.add(this._resolveOverrides(r.options)),await t.pipeline.onOverride(e.toMessage());break}}}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=oe(this._lastAvailableFields,e);return this._lastAvailableFields=t,I(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[he(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch(e=>{m(e)||h.getLogger(this).error(e)});this._updatingHandles.addPromise(r)}_setLayersForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createGraphicHit(e,t){return this._setLayersForFeature(t),null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function he(e,t,r,s,i,a){i&&(i=i.clone());const o=null!=i?i.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(i??=new U,i.timeExtent=n),i=t.addFilters?.(i,e)??i,a&&(i??=new U,i.where=v(i.where,a));let u=i?.toJSON()??null;return s.size&&(u??=(new U).toJSON(),u.hiddenIds=Array.from(s)),u}e([_()],le.prototype,"_commandsQueue",void 0),e([_()],le.prototype,"_sourceRefreshVersion",void 0),e([_()],le.prototype,"_displayRefreshVersion",void 0),e([_({readOnly:!0})],le.prototype,"_pipelineUpdating",void 0),e([_()],le.prototype,"_sourceUpdating",void 0),e([_({readOnly:!0})],le.prototype,"dataUpdating",null),e([_({readOnly:!0})],le.prototype,"hasAllFeatures",null),e([_({readOnly:!0})],le.prototype,"hasAllFeaturesInView",null),e([_({readOnly:!0})],le.prototype,"hasFullGeometries",null),e([_()],le.prototype,"featureEffectView",void 0),e([_()],le.prototype,"labelingCollisionInfos",null),e([_()],le.prototype,"layerAdapter",null),e([_({readOnly:!0})],le.prototype,"timeExtent",null),e([_()],le.prototype,"updating",void 0),le=e([b("esri.views.2d.layers.FeatureLayerView2D")],le);export{le 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{__decorate as i}from"tslib";import t from"../../../Graphic.js";import{isSome as e}from"../../../core/arrayUtils.js";import s from"../../../core/Collection.js";import{makeHandle as r}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import{watch as h,sync as a}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import{ensureClass as l}from"../../../core/accessorSupport/ensureType.js";import{subclass as g}from"../../../core/accessorSupport/decorators/subclass.js";import{GraphicsCollection as n}from"../../../support/GraphicsCollection.js";import p from"../engine/flow/FlowView2D.js";import{LayerView2DMixin as c}from"./LayerView2D.js";import d from"./graphics/GraphicsView2D.js";import w from"./graphics/HighlightGraphicContainer.js";import u from"./imagery/ImageryView2D.js";import m from"./imagery/VectorFieldView2D.js";import y from"../../layers/ImageryLayerView.js";import v from"../../layers/LayerView.js";import f from"../../layers/RefreshableLayerView.js";import{getHighlightName as b}from"../../support/highlightOptionsUtils.js";import _ from"../../support/PixelHighlightOptions.js";let x=class extends(y(f(c(v)))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new n,this._highlightView=void 0,this._pixelHighlightId=0,this.layer=null,this.subview=null}get pixelData(){const{subview:i}=this;return this.updating||!i?null:"getPixelData"in i?i.getPixelData():null}update(i){this.subview?.update(i)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new d({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new w(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([h(()=>this.layer.exportImageServiceParameters.version,i=>{i&&this._exportImageVersion!==i&&(this._exportImageVersion=i,this.requestUpdate())},a),h(()=>this.timeExtent,i=>{const{subview:t}=this;t&&(t.timeExtent=i,"redraw"in t?this.requestUpdate():t.redrawOrRefetch())},a),this.layer.on("redraw",()=>{const{subview:i}=this;i&&("redraw"in i?i.redraw():i.redrawOrRefetch())}),h(()=>this.layer.renderer,()=>this._setSubView())])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}highlight(i,h){if(!((Array.isArray(i)?i[0]:s.isCollection(i)?i.at(0):i)instanceof t))return r();let a=[];Array.isArray(i)||s.isCollection(i)?a=i.map(i=>i.clone()):i instanceof t&&(a=[i.clone()]);const o=a?.filter(e);if(!o?.length)return r();const l=b(h);return this._addHighlightGraphics(a,l),r(()=>!this.destroyed&&this._removeHighlightGraphics(a,l))}highlightPixels(i){this._pixelHighlightOptions=l(_,i);const{subview:t}=this;"imagery"===t?.type&&this._updateHighlightOptions(t),this._pixelHighlightId++;const e=this._pixelHighlightId;return r(()=>{e===this._pixelHighlightId&&(this._pixelHighlightOptions=void 0,"imagery"===this.subview?.type&&this._updateHighlightOptions(this.subview))})}_addHighlightGraphics(i,t){this._highlightGraphics.addMany(i),this._addHighlights(i.map(i=>i.uid),t)}_removeHighlightGraphics(i,t){this._highlightGraphics.removeMany(i),this._removeHighlights(i.map(i=>i.uid),t)}async doRefresh(){this.requestUpdate()}isUpdating(){const i=!this.subview||this.subview.updating||!!this._highlightView?.updating;return has("esri-2d-log-updating")&&console.log(`Updating ImageryLayerView2D (${this.layer.id}): ${i}\n-> subview ${!this.subview||this.subview.updating}\n-> higlightView ${this._highlightView?.updating}\n`),i}_processHighlight(){const i=this._getHighlights();this._highlightView?.setHighlight(i)}_setSubView(){if(!this.view)return;const i=this.layer.renderer?.type;let t="imagery";if("vector-field"===i?t="imageryVF":"flow"===i&&(t="flow"),this.subview){const{type:i}=this.subview;if(i===t)return this._attachSubview(this.subview),void("flow"===i?this.subview.redrawOrRefetch():"imagery"===i&&"lerc"===this.layer.format?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),this.subview?.destroy()}"imagery"===t?(this.subview=new u({layer:this.layer,view:this.view,timeExtent:this.timeExtent}),this.subview.pixelHighlightOptions=this._pixelHighlightOptions):this.subview="imageryVF"===t?new m({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new p({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(i){i&&!i.attached&&(i.attach(),i.attached=!0,this.container.addChildAt(i.container,0))}_detachSubview(i){i?.attached&&(this.container.removeChild(i.container),i.detach(),i.attached=!1)}_updateHighlightOptions(i){"imagery"===i?.type&&(i.pixelHighlightOptions=this._pixelHighlightOptions,i.attached&&("lerc"===this.layer.format?i.redraw():this.requestUpdate()))}};i([o()],x.prototype,"pixelData",null),i([o()],x.prototype,"subview",void 0),x=i([g("esri.views.2d.layers.ImageryLayerView2D")],x);const V=x;export{V as default};
5
+ import{__decorate as i}from"tslib";import t from"../../../Graphic.js";import{isSome as e}from"../../../core/arrayUtils.js";import s from"../../../core/Collection.js";import{makeHandle as r}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import{watch as h,sync as a}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import{ensureClass as l}from"../../../core/accessorSupport/ensureType.js";import{subclass as g}from"../../../core/accessorSupport/decorators/subclass.js";import{GraphicsCollection as n}from"../../../support/GraphicsCollection.js";import p from"../engine/flow/FlowView2D.js";import{LayerView2DMixin as c}from"./LayerView2D.js";import d from"./graphics/GraphicsView2D.js";import w from"./graphics/HighlightGraphicContainer.js";import u from"./imagery/ImageryView2D.js";import m from"./imagery/VectorFieldView2D.js";import y from"../../layers/ImageryLayerView.js";import v from"../../layers/LayerView.js";import{RefreshableLayerView as f}from"../../layers/RefreshableLayerView.js";import{getHighlightName as b}from"../../support/highlightOptionsUtils.js";import _ from"../../support/PixelHighlightOptions.js";let x=class extends(y(f(c(v)))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new n,this._highlightView=void 0,this._pixelHighlightId=0,this.layer=null,this.subview=null}get pixelData(){const{subview:i}=this;return this.updating||!i?null:"getPixelData"in i?i.getPixelData():null}update(i){this.subview?.update(i)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new d({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new w(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([h(()=>this.layer.exportImageServiceParameters.version,i=>{i&&this._exportImageVersion!==i&&(this._exportImageVersion=i,this.requestUpdate())},a),h(()=>this.timeExtent,i=>{const{subview:t}=this;t&&(t.timeExtent=i,"redraw"in t?this.requestUpdate():t.redrawOrRefetch())},a),this.layer.on("redraw",()=>{const{subview:i}=this;i&&("redraw"in i?i.redraw():i.redrawOrRefetch())}),h(()=>this.layer.renderer,()=>this._setSubView())])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}highlight(i,h){if(!((Array.isArray(i)?i[0]:s.isCollection(i)?i.at(0):i)instanceof t))return r();let a=[];Array.isArray(i)||s.isCollection(i)?a=i.map(i=>i.clone()):i instanceof t&&(a=[i.clone()]);const o=a?.filter(e);if(!o?.length)return r();const l=b(h);return this._addHighlightGraphics(a,l),r(()=>!this.destroyed&&this._removeHighlightGraphics(a,l))}highlightPixels(i){this._pixelHighlightOptions=l(_,i);const{subview:t}=this;"imagery"===t?.type&&this._updateHighlightOptions(t),this._pixelHighlightId++;const e=this._pixelHighlightId;return r(()=>{e===this._pixelHighlightId&&(this._pixelHighlightOptions=void 0,"imagery"===this.subview?.type&&this._updateHighlightOptions(this.subview))})}_addHighlightGraphics(i,t){this._highlightGraphics.addMany(i),this._addHighlights(i.map(i=>i.uid),t)}_removeHighlightGraphics(i,t){this._highlightGraphics.removeMany(i),this._removeHighlights(i.map(i=>i.uid),t)}async doRefresh(){this.requestUpdate()}isUpdating(){const i=!this.subview||this.subview.updating||!!this._highlightView?.updating;return has("esri-2d-log-updating")&&console.log(`Updating ImageryLayerView2D (${this.layer.id}): ${i}\n-> subview ${!this.subview||this.subview.updating}\n-> higlightView ${this._highlightView?.updating}\n`),i}_processHighlight(){const i=this._getHighlights();this._highlightView?.setHighlight(i)}_setSubView(){if(!this.view)return;const i=this.layer.renderer?.type;let t="imagery";if("vector-field"===i?t="imageryVF":"flow"===i&&(t="flow"),this.subview){const{type:i}=this.subview;if(i===t)return this._attachSubview(this.subview),void("flow"===i?this.subview.redrawOrRefetch():"imagery"===i&&"lerc"===this.layer.format?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),this.subview?.destroy()}"imagery"===t?(this.subview=new u({layer:this.layer,view:this.view,timeExtent:this.timeExtent}),this.subview.pixelHighlightOptions=this._pixelHighlightOptions):this.subview="imageryVF"===t?new m({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new p({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(i){i&&!i.attached&&(i.attach(),i.attached=!0,this.container.addChildAt(i.container,0))}_detachSubview(i){i?.attached&&(this.container.removeChild(i.container),i.detach(),i.attached=!1)}_updateHighlightOptions(i){"imagery"===i?.type&&(i.pixelHighlightOptions=this._pixelHighlightOptions,i.attached&&("lerc"===this.layer.format?i.redraw():this.requestUpdate()))}};i([o()],x.prototype,"pixelData",null),i([o()],x.prototype,"subview",void 0),x=i([g("esri.views.2d.layers.ImageryLayerView2D")],x);const V=x;export{V 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{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s}from"../../../core/promiseUtils.js";import{watch as r,sync as o,initial as h}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{hasExcludedVariableOrDimension as l}from"../../../layers/support/rasterDatasets/multidimensionalUtils.js";import u from"../engine/flow/FlowView2D.js";import{LayerView2DMixin as g}from"./LayerView2D.js";import p from"./imagery/ImageryTileView2D.js";import d from"./imagery/VectorFieldTileView2D.js";import{canUseMajorityInterpolationOnDataSource as c}from"./support/util.js";import m from"../../layers/ImageryTileLayerView.js";import v from"../../layers/LayerView.js";import w from"../../layers/RefreshableLayerView.js";import{defaultHighlightName as b}from"../../support/HighlightDefaults.js";let y=class extends(m(w(g(v)))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this._pixelHighlightId=-1,this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(e){this._useWebGLForProcessing=e,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=e)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(e){this._useProgressiveUpdate=e,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=e)}get displayParameters(){const{layer:e}=this,i=this._get("displayParameters");return e.renderer&&e.visible?{bandIds:e.bandIds,renderer:e.renderer,interpolation:e.interpolation,multidimensionalDefinition:e.multidimensionalDefinition,rasterFunction:"imagery-tile"===e.type?e.rasterFunction:null}:i}update(e){this.subview?.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([r(()=>this.displayParameters,(e,i)=>{const r=e.interpolation!==i?.interpolation&&("majority"===e.interpolation||"majority"===i?.interpolation)&&c(this.layer),o=!!this.layer.serviceRasterInfo?.storageInfo?.isBsqTile&&e.bandIds?.join()!==i?.bandIds?.join(),h=e.renderer!==i?.renderer&&this._getSubviewType(i?.renderer)!==this._getSubviewType(e.renderer);h&&this._updateSubview();const a=e.multidimensionalDefinition!==i?.multidimensionalDefinition,n=e.rasterFunction!==i?.rasterFunction,l=n&&!this._useWebGLForProcessing,u=a||r||h||l||o;this.subview.redrawOrRefetch({refetch:u,reprocess:n}).catch(e=>{s(e)||t.getLogger(this).error(e)}),this.notifyChange("updating")}),r(()=>this.layer.multidimensionalSubset??null,(e,i)=>{const{multidimensionalDefinition:r}=this.layer;null!=r&&l(r,e)!==l(r,i)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{s(e)||t.getLogger(this).error(e)}),this.notifyChange("updating"))},o),r(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{s(e)||t.getLogger(this).error(e)})},h),r(()=>this.view.highlights.items.map(({name:e,color:i})=>({name:e,color:i})),()=>{if("raster"===this.subview?.type&&this._pixelHighlightTarget){const e=this._getHighlightGroupColor();this.subview.updateHighlightOptions(this._pixelHighlightTarget,e)}},h)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}highlight(e,t){if(!e.ranges?.length)return i();this._pixelHighlightTarget=e,this._pixelHighlightOptions=t;const{subview:s}=this;if("raster"===s?.type){const i=this._getHighlightGroupColor();s.updateHighlightOptions(e,i)}this._pixelHighlightId++;const r=this._pixelHighlightId;return i(()=>{r===this._pixelHighlightId&&(this._pixelHighlightTarget=void 0,"raster"===this.subview?.type&&this.subview.updateHighlightOptions(null))})}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const{renderer:e}=this.layer;if(!e)return;const i=this._getSubviewType(e);if(this.subview){if(this.subview.type===i)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:t}=this;let s;if(s="rasterVF"===i?new d({layer:t,layerView:this,scheduler:this.scheduler}):"flow"===i?new u({layer:t,layerView:this,scheduler:this.scheduler}):new p({layer:t,layerView:this,scheduler:this.scheduler}),"useWebGLForProcessing"in s&&(s.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in s&&(s.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in s){const{subview:e}=this;s.previousLOD=e&&"previousLOD"in e?e.previousLOD:null}if(this._attachSubview(s),"raster"===s.type&&this._pixelHighlightTarget){const e=this._getHighlightGroupColor();s.updateHighlightOptions(this._pixelHighlightTarget,e)}this.subview=s,this.requestUpdate()}_getHighlightGroupColor(){const e=this._pixelHighlightOptions?.name??b;return this.view.highlights.find(i=>i.name===e)?.color}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}_getSubviewType(e){const i=e?.type;return"vector-field"===i?"rasterVF":"flow"===i?"flow":"raster"}};e([a()],y.prototype,"subview",void 0),e([a()],y.prototype,"useWebGLForProcessing",null),e([a()],y.prototype,"useProgressiveUpdate",null),e([a({readOnly:!0})],y.prototype,"displayParameters",null),y=e([n("esri.views.2d.layers.ImageryTileLayerView2D")],y);const f=y;export{f as default};
5
+ import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s}from"../../../core/promiseUtils.js";import{watch as r,sync as o,initial as h}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{hasExcludedVariableOrDimension as l}from"../../../layers/support/rasterDatasets/multidimensionalUtils.js";import u from"../engine/flow/FlowView2D.js";import{LayerView2DMixin as g}from"./LayerView2D.js";import p from"./imagery/ImageryTileView2D.js";import d from"./imagery/VectorFieldTileView2D.js";import{canUseMajorityInterpolationOnDataSource as c}from"./support/util.js";import m from"../../layers/ImageryTileLayerView.js";import v from"../../layers/LayerView.js";import{RefreshableLayerView as w}from"../../layers/RefreshableLayerView.js";import{defaultHighlightName as b}from"../../support/HighlightDefaults.js";let y=class extends(m(w(g(v)))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this._pixelHighlightId=-1,this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(e){this._useWebGLForProcessing=e,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=e)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(e){this._useProgressiveUpdate=e,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=e)}get displayParameters(){const{layer:e}=this,i=this._get("displayParameters");return e.renderer&&e.visible?{bandIds:e.bandIds,renderer:e.renderer,interpolation:e.interpolation,multidimensionalDefinition:e.multidimensionalDefinition,rasterFunction:"imagery-tile"===e.type?e.rasterFunction:null}:i}update(e){this.subview?.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([r(()=>this.displayParameters,(e,i)=>{const r=e.interpolation!==i?.interpolation&&("majority"===e.interpolation||"majority"===i?.interpolation)&&c(this.layer),o=!!this.layer.serviceRasterInfo?.storageInfo?.isBsqTile&&e.bandIds?.join()!==i?.bandIds?.join(),h=e.renderer!==i?.renderer&&this._getSubviewType(i?.renderer)!==this._getSubviewType(e.renderer);h&&this._updateSubview();const a=e.multidimensionalDefinition!==i?.multidimensionalDefinition,n=e.rasterFunction!==i?.rasterFunction,l=n&&!this._useWebGLForProcessing,u=a||r||h||l||o;this.subview.redrawOrRefetch({refetch:u,reprocess:n}).catch(e=>{s(e)||t.getLogger(this).error(e)}),this.notifyChange("updating")}),r(()=>this.layer.multidimensionalSubset??null,(e,i)=>{const{multidimensionalDefinition:r}=this.layer;null!=r&&l(r,e)!==l(r,i)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{s(e)||t.getLogger(this).error(e)}),this.notifyChange("updating"))},o),r(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{s(e)||t.getLogger(this).error(e)})},h),r(()=>this.view.highlights.items.map(({name:e,color:i})=>({name:e,color:i})),()=>{if("raster"===this.subview?.type&&this._pixelHighlightTarget){const e=this._getHighlightGroupColor();this.subview.updateHighlightOptions(this._pixelHighlightTarget,e)}},h)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}highlight(e,t){if(!e.ranges?.length)return i();this._pixelHighlightTarget=e,this._pixelHighlightOptions=t;const{subview:s}=this;if("raster"===s?.type){const i=this._getHighlightGroupColor();s.updateHighlightOptions(e,i)}this._pixelHighlightId++;const r=this._pixelHighlightId;return i(()=>{r===this._pixelHighlightId&&(this._pixelHighlightTarget=void 0,"raster"===this.subview?.type&&this.subview.updateHighlightOptions(null))})}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const{renderer:e}=this.layer;if(!e)return;const i=this._getSubviewType(e);if(this.subview){if(this.subview.type===i)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:t}=this;let s;if(s="rasterVF"===i?new d({layer:t,layerView:this,scheduler:this.scheduler}):"flow"===i?new u({layer:t,layerView:this,scheduler:this.scheduler}):new p({layer:t,layerView:this,scheduler:this.scheduler}),"useWebGLForProcessing"in s&&(s.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in s&&(s.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in s){const{subview:e}=this;s.previousLOD=e&&"previousLOD"in e?e.previousLOD:null}if(this._attachSubview(s),"raster"===s.type&&this._pixelHighlightTarget){const e=this._getHighlightGroupColor();s.updateHighlightOptions(this._pixelHighlightTarget,e)}this.subview=s,this.requestUpdate()}_getHighlightGroupColor(){const e=this._pixelHighlightOptions?.name??b;return this.view.highlights.find(i=>i.name===e)?.color}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}_getSubviewType(e){const i=e?.type;return"vector-field"===i?"rasterVF":"flow"===i?"flow":"raster"}};e([a()],y.prototype,"subview",void 0),e([a()],y.prototype,"useWebGLForProcessing",null),e([a()],y.prototype,"useProgressiveUpdate",null),e([a({readOnly:!0})],y.prototype,"displayParameters",null),y=e([n("esri.views.2d.layers.ImageryTileLayerView2D")],y);const f=y;export{f 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{__decorate as t}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import e from"../../../core/Logger.js";import{isAbortError as r}from"../../../core/promiseUtils.js";import{watch as s}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{GraphicsCollection as o}from"../../../support/GraphicsCollection.js";import{BitmapContainer as p}from"../engine/BitmapContainer.js";import{LayerView2DMixin as g}from"./LayerView2D.js";import l from"./graphics/GraphicsView2D.js";import n from"./graphics/HighlightGraphicContainer.js";import m from"./support/ExportStrategy.js";import d from"../../layers/LayerView.js";import c from"../../layers/MapImageLayerView.js";import u from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as f}from"../../layers/support/highlightUtils.js";import{MapServiceLayerViewHelper as y}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as _}from"../../support/drapedUtils.js";import{getHighlightName as H}from"../../support/highlightOptionsUtils.js";let w=class extends(c(u(g(d)))){constructor(){super(...arguments),this._highlightGraphics=new o,this._updateHash=""}fetchPopupFeaturesAtLocation(t,i){return this._popupHighlightHelper.fetchPopupFeaturesAtLocation(t,i)}update(t){const i=`${this.exportImageVersion}/${t.state.id}/${t.pixelRatio}/${t.stationary}`;this._updateHash!==i&&(this._updateHash=i,this.strategy.update(t).catch(t=>{r(t)||e.getLogger(this).error(t)}),t.stationary&&this._popupHighlightHelper.updateHighlightedFeatures(t.state.resolution)),this._highlightView.processUpdate(t)}attach(){const{imageMaxWidth:t,imageMaxHeight:i,version:e}=this.layer,r=e>=10.3,h=e>=10;this._bitmapContainer=new p,this.container.addChild(this._bitmapContainer),this._highlightView=new l({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new n(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1}),this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new y({createFetchPopupFeaturesQueryGeometry:(t,i)=>_(t,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:t,property:i})=>this._highlightView.graphicUpdateHandler({graphic:t,property:i}),layerView:this,updatingHandles:this._updatingHandles}),this.strategy=new m({container:this._bitmapContainer,fetchSource:this.fetchImageBitmap.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxWidth:t,imageMaxHeight:i,imageRotationSupported:r,imageNormalizationSupported:h,hidpi:!0}),this.addAttachHandles(s(()=>this.exportImageVersion,()=>this.requestUpdate())),this.requestUpdate()}detach(){this.strategy.destroy(),this.container.removeAllChildren(),this._bitmapContainer.removeAllChildren(),this._highlightView.destroy(),this._popupHighlightHelper.destroy()}viewChange(){}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return this.layer.serviceSupportsSpatialReference(t)}async doRefresh(){this._updateHash="",this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(t,i,e,r){return this.layer.fetchImage(t,i,e,{timeExtent:this.timeExtent,floors:this.floors,...r})}fetchImageBitmap(t,i,e,r){return this.layer.fetchImageBitmap(t,i,e,{timeExtent:this.timeExtent,floors:this.floors,...r})}highlight(t,e){const r=f(t);if(0===r.length)return i();const s=H(e);return this._addHighlightGraphics(r,s),i(()=>!this.destroyed&&this._removeHighlightGraphics(r,s))}_processHighlight(){const t=this._getHighlights();this._highlightView?.setHighlight(t)}_addHighlightGraphics(t,i){this._highlightGraphics.addMany(t),this._addHighlights(t.map(t=>t.uid),i)}_removeHighlightGraphics(t,i){this._highlightGraphics.removeMany(t),this._removeHighlights(t.map(t=>t.uid),i)}};t([h()],w.prototype,"strategy",void 0),t([h()],w.prototype,"updating",void 0),w=t([a("esri.views.2d.layers.MapImageLayerView2D")],w);const j=w;export{j as default};
5
+ import{__decorate as t}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import e from"../../../core/Logger.js";import{isAbortError as r}from"../../../core/promiseUtils.js";import{watch as s}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{GraphicsCollection as o}from"../../../support/GraphicsCollection.js";import{BitmapContainer as p}from"../engine/BitmapContainer.js";import{LayerView2DMixin as g}from"./LayerView2D.js";import l from"./graphics/GraphicsView2D.js";import n from"./graphics/HighlightGraphicContainer.js";import m from"./support/ExportStrategy.js";import d from"../../layers/LayerView.js";import c from"../../layers/MapImageLayerView.js";import{RefreshableLayerView as u}from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as f}from"../../layers/support/highlightUtils.js";import{MapServiceLayerViewHelper as y}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as _}from"../../support/drapedUtils.js";import{getHighlightName as H}from"../../support/highlightOptionsUtils.js";let w=class extends(c(u(g(d)))){constructor(){super(...arguments),this._highlightGraphics=new o,this._updateHash=""}fetchPopupFeaturesAtLocation(t,i){return this._popupHighlightHelper.fetchPopupFeaturesAtLocation(t,i)}update(t){const i=`${this.exportImageVersion}/${t.state.id}/${t.pixelRatio}/${t.stationary}`;this._updateHash!==i&&(this._updateHash=i,this.strategy.update(t).catch(t=>{r(t)||e.getLogger(this).error(t)}),t.stationary&&this._popupHighlightHelper.updateHighlightedFeatures(t.state.resolution)),this._highlightView.processUpdate(t)}attach(){const{imageMaxWidth:t,imageMaxHeight:i,version:e}=this.layer,r=e>=10.3,h=e>=10;this._bitmapContainer=new p,this.container.addChild(this._bitmapContainer),this._highlightView=new l({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new n(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1}),this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new y({createFetchPopupFeaturesQueryGeometry:(t,i)=>_(t,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:t,property:i})=>this._highlightView.graphicUpdateHandler({graphic:t,property:i}),layerView:this,updatingHandles:this._updatingHandles}),this.strategy=new m({container:this._bitmapContainer,fetchSource:this.fetchImageBitmap.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxWidth:t,imageMaxHeight:i,imageRotationSupported:r,imageNormalizationSupported:h,hidpi:!0}),this.addAttachHandles(s(()=>this.exportImageVersion,()=>this.requestUpdate())),this.requestUpdate()}detach(){this.strategy.destroy(),this.container.removeAllChildren(),this._bitmapContainer.removeAllChildren(),this._highlightView.destroy(),this._popupHighlightHelper.destroy()}viewChange(){}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return this.layer.serviceSupportsSpatialReference(t)}async doRefresh(){this._updateHash="",this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(t,i,e,r){return this.layer.fetchImage(t,i,e,{timeExtent:this.timeExtent,floors:this.floors,...r})}fetchImageBitmap(t,i,e,r){return this.layer.fetchImageBitmap(t,i,e,{timeExtent:this.timeExtent,floors:this.floors,...r})}highlight(t,e){const r=f(t);if(0===r.length)return i();const s=H(e);return this._addHighlightGraphics(r,s),i(()=>!this.destroyed&&this._removeHighlightGraphics(r,s))}_processHighlight(){const t=this._getHighlights();this._highlightView?.setHighlight(t)}_addHighlightGraphics(t,i){this._highlightGraphics.addMany(t),this._addHighlights(t.map(t=>t.uid),i)}_removeHighlightGraphics(t,i){this._highlightGraphics.removeMany(t),this._removeHighlights(t.map(t=>t.uid),i)}};t([h()],w.prototype,"strategy",void 0),t([h()],w.prototype,"updating",void 0),w=t([a("esri.views.2d.layers.MapImageLayerView2D")],w);const j=w;export{j 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{__decorate as e}from"tslib";import"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../core/MapUtils.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import{watch as n,syncAndInitial as l,on as m}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../geometry/Extent.js";import{create as h}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as d}from"../../../geometry/support/contains.js";import{extentIntersectsPolygon as f}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as g}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../../../core/scheduling.js";import"../../../Color.js";import"../../../core/mathUtils.js";import"../../../config.js";import"../../../core/floatRGBA.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../symbols/Font.js";import"../../../core/ObjectPool.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Evented.js";import"../engine/transitions/FadeTransition.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../webgl/enums.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/Program.js";import"../../webgl/BufferObject.js";import"../../webgl/checkWebGLError.js";import"../../webgl/VertexAttributeLayouts.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/number.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../../webgl/Texture.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../../webgl/Renderbuffer.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../engine/webgl/shaderGraph/techniques/animated/attributes.js";import"../engine/webgl/mesh/templates/templateUtils.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../core/sql/UnknownTimeZone.js";import"luxon";import"../../../intl/locale.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/animations/instructions.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/glsl.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../../../chunks/pe.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../chunks/earcut.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtilsCommon.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/Ellipsoid.js";import"../../../kernel.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../core/unitUtils.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import u from"../tiling/TileQueue.js";import j from"../tiling/TileStrategy.js";import y from"../engine/webgl/Overlay.js";import b from"../engine/webgl/OverlayContainer.js";import{LayerView2DMixin as w}from"./LayerView2D.js";import _ from"../../layers/LayerView.js";import v from"../../layers/MediaLayerView.js";import{TaskPriority as E}from"../../support/Scheduler.js";let G=class extends(w(v(_))){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this._interaction=null,this.layer=null,this.elements=new t}initialize(){this.addHandles([n(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await import("./support/MediaLayerInteraction.js");this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},l),n(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},l),n(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},l)])}attach(){this.addAttachHandles([m(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),m(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new b,this.container.addChild(this._overlayContainer),this._fetchQueue=new u({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:E.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new j({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],s=e.normalize(),r=[s.x,s.y];for(const{elementView:{normalizedCoords:o,element:n}}of this._elementReferences.values())null!=o&&d(o.rings,r)&&i.push({type:"media",element:n,layer:this.layer,mapPoint:e,sourcePoint:n.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new P(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>{const[i,s]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,s),this.requestUpdate()},e=>{o(e)||s.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(S,e,!0);const s=new p({xmin:S[0],ymin:S[1],xmax:S[2],ymax:S[3],spatialReference:this.view.spatialReference});return i.queryElements(s,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){r(this._elementReferences,t.uid,()=>{const e=new g({element:t,spatialReference:this.view.spatialReference}),r=new y(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.addPromise(t.load().catch(e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],r=[];for(const e of this._tileStrategy.tiles){const o=M(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?o||r.push(e):o&&s.push(e)}for(const t of s)this._referenceElement(t,e);for(const t of r)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new g({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const s of this._tileStrategy.tiles){M(this.view.featuresTilingScheme,s,i)&&this._referenceElement(s,e)}}};e([a()],G.prototype,"layer",void 0),e([a({readOnly:!0})],G.prototype,"elements",void 0),G=e([c("esri.views.2d.layers.MediaLayerView2D")],G);const S=h(),q={xmin:0,ymin:0,xmax:0,ymax:0};function M(e,t,i){return e.getTileBounds(S,t.key,!0),q.xmin=S[0],q.ymin=S[1],q.xmax=S[2],q.ymax=S[3],f(q,i)}class P{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const s of e)i.has(s)?i.delete(s):t.push(s);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const C=G;export{C as default};
5
+ import{__decorate as e}from"tslib";import"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../core/MapUtils.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import{watch as n,syncAndInitial as l,on as m}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../geometry/Extent.js";import{create as h}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as d}from"../../../geometry/support/contains.js";import{extentIntersectsPolygon as f}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as g}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../../../core/scheduling.js";import"../../../Color.js";import"../../../core/mathUtils.js";import"../../../config.js";import"../../../core/floatRGBA.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../symbols/Font.js";import"../../../core/ObjectPool.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../webgl/enums.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/Program.js";import"../../webgl/BufferObject.js";import"../../webgl/checkWebGLError.js";import"../../webgl/VertexAttributeLayouts.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/number.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../../webgl/Texture.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../../webgl/Renderbuffer.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../engine/webgl/shaderGraph/techniques/animated/attributes.js";import"../engine/webgl/mesh/templates/templateUtils.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../core/sql/UnknownTimeZone.js";import"luxon";import"../../../intl/locale.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/animations/instructions.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/glsl.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../../../chunks/pe.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../chunks/earcut.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtilsCommon.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/Ellipsoid.js";import"../../../kernel.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../core/unitUtils.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import u from"../tiling/TileQueue.js";import j from"../tiling/TileStrategy.js";import y from"../engine/webgl/Overlay.js";import b from"../engine/webgl/OverlayContainer.js";import{LayerView2DMixin as w}from"./LayerView2D.js";import _ from"../../layers/LayerView.js";import v from"../../layers/MediaLayerView.js";import{TaskPriority as E}from"../../support/Scheduler.js";let G=class extends(w(v(_))){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this._interaction=null,this.layer=null,this.elements=new t}initialize(){this.addHandles([n(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await import("./support/MediaLayerInteraction.js");this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},l),n(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},l),n(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},l)])}attach(){this.addAttachHandles([m(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),m(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new b,this.container.addChild(this._overlayContainer),this._fetchQueue=new u({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:E.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new j({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],s=e.normalize(),r=[s.x,s.y];for(const{elementView:{normalizedCoords:o,element:n}}of this._elementReferences.values())null!=o&&d(o.rings,r)&&i.push({type:"media",element:n,layer:this.layer,mapPoint:e,sourcePoint:n.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new P(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>{const[i,s]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,s),this.requestUpdate()},e=>{o(e)||s.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(S,e,!0);const s=new p({xmin:S[0],ymin:S[1],xmax:S[2],ymax:S[3],spatialReference:this.view.spatialReference});return i.queryElements(s,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){r(this._elementReferences,t.uid,()=>{const e=new g({element:t,spatialReference:this.view.spatialReference}),r=new y(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.addPromise(t.load().catch(e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],r=[];for(const e of this._tileStrategy.tiles){const o=M(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?o||r.push(e):o&&s.push(e)}for(const t of s)this._referenceElement(t,e);for(const t of r)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new g({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const s of this._tileStrategy.tiles){M(this.view.featuresTilingScheme,s,i)&&this._referenceElement(s,e)}}};e([a()],G.prototype,"layer",void 0),e([a({readOnly:!0})],G.prototype,"elements",void 0),G=e([c("esri.views.2d.layers.MediaLayerView2D")],G);const S=h(),q={xmin:0,ymin:0,xmax:0,ymax:0};function M(e,t,i){return e.getTileBounds(S,t.key,!0),q.xmin=S[0],q.ymin=S[1],q.xmax=S[2],q.ymax=S[3],f(q,i)}class P{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const s of e)i.has(s)?i.delete(s):t.push(s);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const C=G;export{C as default};