@arcgis/core 4.27.0-next.20230516 → 4.27.0-next.20230517

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 (148) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/06d5f5e37fd44dc7de06.js +1 -0
  3. package/assets/esri/core/workers/chunks/12714d64a0154688072e.js +1 -0
  4. package/assets/esri/core/workers/chunks/{a507135977d83aea4421.js → 1827a3da6b5b9272ffe1.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{395ef46b635f9e9a5643.js → 20e8e18e4bd2fd5da47c.js} +1 -1
  6. package/assets/esri/core/workers/chunks/23f73f81aea461c0c6e6.js +1 -0
  7. package/assets/esri/core/workers/chunks/{15dda462b979e90b58fe.js → 3cebdd77a8401495097f.js} +1 -1
  8. package/assets/esri/core/workers/chunks/48cb634255e39711a720.js +1 -0
  9. package/assets/esri/core/workers/chunks/4d5f71d84c85f45c97ea.js +1 -0
  10. package/assets/esri/core/workers/chunks/6312783626bacf52df7a.js +1 -0
  11. package/assets/esri/core/workers/chunks/6d80f81bf6ad97a7e69e.js +1 -0
  12. package/assets/esri/core/workers/chunks/{a3822a97701890c12d63.js → 7903beee895860c7e3af.js} +1 -1
  13. package/assets/esri/core/workers/chunks/887a630c5c980c5028e1.js +1 -0
  14. package/assets/esri/core/workers/chunks/{522660da4589739a70c3.js → c7fb48ea5d907883bcce.js} +1 -1
  15. package/assets/esri/core/workers/chunks/d0ff968e42116f592065.js +1 -0
  16. package/assets/esri/core/workers/chunks/{fdf64f23529a22c79fbd.js → d52c920acf08c95277c3.js} +19 -19
  17. package/assets/esri/core/workers/chunks/d64c271c173797d98286.js +1 -0
  18. package/assets/esri/core/workers/chunks/e1b2076d0040fcb7d864.js +1 -0
  19. package/assets/esri/core/workers/chunks/{b3013a5a39d038b2d748.js → e4f84c79fe3e7b54b76c.js} +1 -1
  20. package/assets/esri/core/workers/chunks/e6836c84470fb6bd25bf.js +1 -0
  21. package/assets/esri/core/workers/chunks/f3f6035a17f7dcd19675.js +1 -0
  22. package/assets/esri/core/workers/chunks/{bff317b08e91414f6edc.js → f720967ba8c5486a26a2.js} +1 -1
  23. package/assets/esri/themes/base/widgets/_ValuePicker.scss +27 -10
  24. package/assets/esri/themes/dark/main.css +1 -1
  25. package/assets/esri/themes/light/main.css +1 -1
  26. package/assets/esri/themes/light/view.css +1 -1
  27. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ar.json +1 -1
  28. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_bg.json +1 -1
  29. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_bs.json +1 -1
  30. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ca.json +1 -1
  31. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_cs.json +1 -1
  32. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_da.json +1 -1
  33. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_de.json +1 -1
  34. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_el.json +1 -1
  35. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_es.json +1 -1
  36. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_et.json +1 -1
  37. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_fi.json +1 -1
  38. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_fr.json +1 -1
  39. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_he.json +1 -1
  40. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_hr.json +1 -1
  41. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_hu.json +1 -1
  42. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_id.json +1 -1
  43. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_it.json +1 -1
  44. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ja.json +1 -1
  45. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ko.json +1 -1
  46. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_lt.json +1 -1
  47. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_lv.json +1 -1
  48. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_nb.json +1 -1
  49. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_nl.json +1 -1
  50. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_pl.json +1 -1
  51. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_pt-BR.json +1 -1
  52. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_pt-PT.json +1 -1
  53. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ro.json +1 -1
  54. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ru.json +1 -1
  55. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sk.json +1 -1
  56. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sl.json +1 -1
  57. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sr.json +1 -1
  58. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sv.json +1 -1
  59. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_th.json +1 -1
  60. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_tr.json +1 -1
  61. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_uk.json +1 -1
  62. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_vi.json +1 -1
  63. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_zh-CN.json +1 -1
  64. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_zh-HK.json +1 -1
  65. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_zh-TW.json +1 -1
  66. package/chunks/DefaultMaterial.glsl.js +4 -4
  67. package/chunks/HUDMaterial.glsl.js +22 -22
  68. package/chunks/HeatmapDensity.glsl.js +5 -5
  69. package/chunks/LineMarker.glsl.js +35 -35
  70. package/chunks/RibbonLine.glsl.js +47 -47
  71. package/chunks/ShadowCastVisualize.glsl.js +2 -2
  72. package/core/Queue.js +1 -1
  73. package/interfaces.d.ts +290 -6
  74. package/intl/date.js +1 -1
  75. package/layers/ImageryTileLayer.js +1 -1
  76. package/layers/WMSLayer.js +1 -1
  77. package/layers/graphics/data/QueryEngine.js +1 -1
  78. package/layers/graphics/data/attributeSupport.js +1 -1
  79. package/layers/mixins/ArcGISImageService.js +1 -1
  80. package/layers/support/rasterFunctions/rasterFunctionHelper.js +1 -1
  81. package/package.json +1 -1
  82. package/popup/FieldInfo.js +1 -1
  83. package/popup/support/FieldInfoFormat.js +1 -1
  84. package/portal/schemas/definitions.js +1 -1
  85. package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
  86. package/smartMapping/raster/support/adapters/ImageryTileLayerAdapter.js +1 -1
  87. package/support/revision.js +1 -1
  88. package/views/2d/layers/MediaLayerView2D.js +1 -1
  89. package/views/2d/layers/TileLayerView2D.js +1 -1
  90. package/views/2d/layers/support/cimSymbolUtils.js +1 -1
  91. package/views/3d/support/DisplayQualityProfile.js +1 -1
  92. package/views/3d/support/QualitySettings.js +1 -1
  93. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  94. package/views/3d/terrain/Overlay.js +1 -1
  95. package/views/3d/terrain/OverlayManager.js +1 -1
  96. package/views/3d/terrain/OverlayRenderer.js +1 -1
  97. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +13 -13
  98. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +18 -18
  99. package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +8 -8
  100. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  101. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  102. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  103. package/views/3d/webgl-engine/lib/RenderTargetHelper.js +1 -1
  104. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  105. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  106. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  107. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  108. package/views/3d/webgl-engine/lib/lodRendering/LodComponentData.js +1 -1
  109. package/views/3d/webgl-engine/materials/DefaultBufferWriter.js +1 -1
  110. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  111. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  112. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  113. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  114. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  115. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  116. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  117. package/views/3d/webgl-engine/materials/lineStippleUtils.js +1 -1
  118. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  119. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  120. package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
  121. package/views/3d/webgl-engine/shaders/HeatmapDensity.glsl.js +1 -1
  122. package/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration.js +1 -1
  123. package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
  124. package/views/PopupView.js +1 -1
  125. package/views/webgl/ValidatedTextureDescriptor.js +1 -1
  126. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  127. package/widgets/FeatureTable.js +1 -1
  128. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  129. package/widgets/ValuePicker/ValuePickerBaseComponent.js +1 -1
  130. package/widgets/ValuePicker/ValuePickerCollection.js +1 -1
  131. package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
  132. package/widgets/ValuePicker/ValuePickerLabel.js +1 -1
  133. package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
  134. package/widgets/ValuePicker/ValuePickerViewModel.js +1 -1
  135. package/widgets/ValuePicker.js +1 -1
  136. package/assets/esri/core/workers/chunks/009026614cae60e9505c.js +0 -1
  137. package/assets/esri/core/workers/chunks/415c326d268b1a8fd03f.js +0 -1
  138. package/assets/esri/core/workers/chunks/504e929b686570ee858d.js +0 -1
  139. package/assets/esri/core/workers/chunks/5c811527898eb1c04e67.js +0 -1
  140. package/assets/esri/core/workers/chunks/6164a9c654c38f9cb64e.js +0 -1
  141. package/assets/esri/core/workers/chunks/6dd99db0adce09ac9794.js +0 -1
  142. package/assets/esri/core/workers/chunks/7cec069db0598431829e.js +0 -1
  143. package/assets/esri/core/workers/chunks/8bb3b10a777ae19f57f9.js +0 -1
  144. package/assets/esri/core/workers/chunks/91971a76a4ae0474a878.js +0 -1
  145. package/assets/esri/core/workers/chunks/9ed9e2ad50816a4f937a.js +0 -1
  146. package/assets/esri/core/workers/chunks/b81bb096ccfcea182cc1.js +0 -1
  147. package/assets/esri/core/workers/chunks/d05d9ddf244bb3dcbcaa.js +0 -1
  148. package/assets/esri/core/workers/chunks/d3a6504fbaf555707c58.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.27/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{clamp as e}from"../../../../core/mathUtils.js";import{f as t}from"../../../../chunks/mat3.js";import{c as r}from"../../../../chunks/mat3f64.js";import{a as s}from"../../../../chunks/mat4.js";import{c as i}from"../../../../chunks/mat4f64.js";import{c as a}from"../../../../chunks/vec2.js";import{a as n,f as o}from"../../../../chunks/vec2f64.js";import{s as c,m as l,n as f,b as u,g as h,c as p,l as m,i as d,t as g,e as O,a as S}from"../../../../chunks/vec3.js";import{c as v,f as A}from"../../../../chunks/vec3f64.js";import{c as b,f as P}from"../../../../chunks/vec4f64.js";import{isMat4 as x}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as y}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as _}from"../../../../geometry/support/buffer/BufferView.js";import I from"../../support/debugFlags.js";import{newLayout as T}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as j}from"../core/shaderLibrary/ShaderOutput.js";import{HUDSpace as C}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterial as L,GLTextureMaterialBindParameters as z}from"../lib/GLTextureMaterial.js";import{Material as M,RenderOccludedFlag as R}from"../lib/Material.js";import{RenderSlot as U}from"../lib/RenderSlot.js";import{applyScaleFactor as D,applyPrecomputedScaleFactor as E,precomputeScaleFactor as w}from"../lib/screenSizePerspectiveUtils.js";import{assert as V}from"../lib/Util.js";import{VertexAttribute as N}from"../lib/VertexAttribute.js";import{ScaleInfo as B}from"./ScaleInfo.js";import{writePosition as X,writeNormal as H,writeColor as G,writeBufferVec4 as k,writeBufferVec4Zeros as F,writeObjectAndLayerIdColor as W}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as q}from"./internal/MaterialUtil.js";import{c as Z}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as J}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as Y}from"../shaders/HUDMaterialTechniqueConfiguration.js";class K extends M{constructor(e){super(e,new ve),this._configuration=new Y}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits?C.Screen:C.World,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.isDraped=this.parameters.isDraped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===U.OCCLUSION_PIXELS&&this.parameters.occlusionTest&&(e===j.Color||e===j.Alpha),e===j.Color&&(this._configuration.debugDrawLabelBorder=!!I.LABELS_SHOW_BORDER),e===j.Highlight&&(this._configuration.binaryHighlightOcclusionEnabled=this.parameters.binaryHighlightOcclusion),this._configuration.depthEnabled=this.parameters.depthEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassGeometry=t.multipassGeometry.enabled,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,r,i,a,n,o){if(!i.options.selectionMode||!i.options.hud||!e.visible)return;const g=this.parameters;let O=1,S=1;if(t(le,r),null!=e.shaderTransformer){const t=e.shaderTransformer(me);O=t[0],S=t[5],ee(le)}const A=e.vertexAttributes.get(N.POSITION),b=e.vertexAttributes.get(N.SIZE),P=e.vertexAttributes.get(N.NORMAL),x=e.vertexAttributes.get(N.AUXPOS1);V(A.size>=3);const y=i.point,_=i.camera,I=Z(g);O*=_.pixelRatio,S*=_.pixelRatio;const T="screen"===this.parameters.centerOffsetUnits;for(let t=0;t<A.data.length/A.size;t++){const e=t*A.size;c(ie,A.data[e],A.data[e+1],A.data[e+2]),l(ie,ie,r);const a=t*b.size;Oe[0]=b.data[a]*O,Oe[1]=b.data[a+1]*S,l(ie,ie,_.viewMatrix);const n=t*x.size;if(c(he,x.data[n],x.data[n+1],x.data[n+2]),!T&&(ie[0]+=he[0],ie[1]+=he[1],0!==he[2])){const e=he[2];f(he,ie),u(ie,ie,h(he,he,e))}const j=t*P.size;if(c(ae,P.data[j],P.data[j+1],P.data[j+2]),this._normalAndViewAngle(ae,le,_,pe),this._applyVerticalOffsetTransformationView(ie,pe,_,re),_.applyProjection(ie,ne),ne[0]>-1){ne[0]=Math.floor(ne[0]),ne[1]=Math.floor(ne[1]),T&&(he[0]||he[1])&&(ne[0]+=he[0],0!==he[1]&&(ne[1]+=D(he[1],re.factorAlignment)),_.unapplyProjection(ne,ie)),ne[0]+=this.parameters.screenOffset[0],ne[1]+=this.parameters.screenOffset[1],E(Oe,re.factor,Oe);const e=de*_.pixelRatio;let t=0;if(g.textureIsSignedDistanceField&&(t=g.outlineSize*_.pixelRatio/2),y&&te(y,ne[0],ne[1],Oe,e,t,g,I)){const e=i.ray;if(l(ce,ie,s(ue,_.viewMatrix)),ne[0]=y[0],ne[1]=y[1],_.unprojectFromRenderScreen(ne,ie)){const t=v();p(t,e.direction);const r=1/m(t);h(t,t,r);o(d(e.origin,ie)*r,t,-1,!0,1,ce)}}}}}intersectDraped(e,t,r,s,i,a){const n=e.vertexAttributes.get(N.POSITION),o=e.vertexAttributes.get(N.SIZE),c=this.parameters,l=Z(c);let f=1,u=1;if(null!=e.shaderTransformer){const t=e.shaderTransformer(me);f=t[0],u=t[5]}f*=e.screenToWorldRatio,u*=e.screenToWorldRatio;const h=ge*e.screenToWorldRatio;for(let p=0;p<n.data.length/n.size;p++){const t=p*n.size,r=n.data[t],m=n.data[t+1],d=p*o.size;Oe[0]=o.data[d]*f,Oe[1]=o.data[d+1]*u;let g=0;c.textureIsSignedDistanceField&&(g=c.outlineSize*e.screenToWorldRatio/2),te(s,r,m,Oe,h,g,c,l)&&i(a.dist,a.normal,-1,!1)}}createBufferWriter(){return new Pe(this)}_normalAndViewAngle(e,r,s,i){return x(r)&&(r=t(fe,r)),g(i.normal,e,r),l(i.normal,i.normal,s.viewInverseTransposeMatrix),i.cosAngle=O(oe,Se),i}_updateScaleInfo(e,t,r){const s=this.parameters;null!=s.screenSizePerspective?w(r,t,s.screenSizePerspective,e.factor):(e.factor.scale=1,e.factor.factor=0,e.factor.minPixelSize=0,e.factor.paddingPixels=0),null!=s.screenSizePerspectiveAlignment?w(r,t,s.screenSizePerspectiveAlignment,e.factorAlignment):(e.factorAlignment.factor=e.factor.factor,e.factorAlignment.scale=e.factor.scale,e.factorAlignment.minPixelSize=e.factor.minPixelSize,e.factorAlignment.paddingPixels=e.factor.paddingPixels)}applyShaderOffsetsView(e,t,r,s,i,a,n){const o=this._normalAndViewAngle(t,r,i,pe);return this._applyVerticalGroundOffsetView(e,o,i,n),this._applyVerticalOffsetTransformationView(n,o,i,a),this._applyPolygonOffsetView(n,o,s[3],i,n),this._applyCenterOffsetView(n,s,n),n}applyShaderOffsetsNDC(e,t,r,s,i){return this._applyCenterOffsetNDC(e,t,r,s),null!=i&&p(i,s),this._applyPolygonOffsetNDC(s,t,r,s),s}_applyPolygonOffsetView(t,r,s,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(s);0===o&&(o=n);const c=n*o;if(this.parameters.shaderPolygonOffset<=0)return p(a,t);const l=e(Math.abs(r.cosAngle),.01,1),f=1-Math.sqrt(1-l*l)/l/i.viewport[2];return h(a,t,c>0?f:1/f),a}_applyVerticalGroundOffsetView(e,t,r,s){const i=m(e),a=r.aboveGround?1:-1,n=.5*r.computeRenderPixelSizeAtDist(i),o=h(ie,t.normal,a*n);return S(s,e,o),s}_applyVerticalOffsetTransformationView(e,t,r,s){const i=this.parameters;if(!i.verticalOffset||!i.verticalOffset.screenLength){if(i.screenSizePerspective||i.screenSizePerspectiveAlignment){const r=m(e);this._updateScaleInfo(s,r,t.cosAngle)}else s.factor.scale=1,s.factorAlignment.scale=1;return e}const a=m(e),n=i.screenSizePerspectiveAlignment??i.screenSizePerspective,o=q(r,a,i.verticalOffset,t.cosAngle,n);return this._updateScaleInfo(s,a,t.cosAngle),h(t.normal,t.normal,o),S(e,e,t.normal)}_applyCenterOffsetView(e,t,r){const s="screen"!==this.parameters.centerOffsetUnits;return r!==e&&p(r,e),s&&(r[0]+=t[0],r[1]+=t[1],t[2]&&(f(ae,r),S(r,r,h(ae,ae,t[2])))),r}_applyCenterOffsetNDC(e,t,r,s){const i="screen"!==this.parameters.centerOffsetUnits;return s!==e&&p(s,e),i||(s[0]+=t[0]/r.fullWidth*2,s[1]+=t[1]/r.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,r,s){const i=this.parameters.shaderPolygonOffset;if(e!==s&&p(s,e),i){const e=r.aboveGround?1:-1,a=e*Math.sign(t[3]);s[2]-=(a||e)*i}return s}requiresSlot(e,t){if(t===j.Color||t===j.Alpha||t===j.Highlight||t===j.ObjectAndLayerIdColor){if(e===U.DRAPED_MATERIAL)return!0;const{drawInSecondSlot:t,occlusionTest:r}=this.parameters;return e===(t?U.LABEL_MATERIAL:U.HUD_MATERIAL)||r&&e===U.OCCLUSION_PIXELS}return!1}createGLMaterial(e){return new Q(e)}calculateRelativeScreenBounds(e,t,r=y()){return $(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}}class Q extends L{constructor(e){super({...e,...e.material.parameters})}selectProgram(e){return this.ensureTechnique(J,e)}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.selectProgram(e)}}function $(e,t,r,s=se){return a(s,e.anchorPosition),s[0]*=-t[0],s[1]*=-t[1],s[0]+=e.screenOffset[0]*r,s[1]+=e.screenOffset[1]*r,s}function ee(e){const t=e[0],r=e[1],s=e[2],i=e[3],a=e[4],n=e[5],o=e[6],c=e[7],l=e[8],f=1/Math.sqrt(t*t+r*r+s*s),u=1/Math.sqrt(i*i+a*a+n*n),h=1/Math.sqrt(o*o+c*c+l*l);return e[0]=t*f,e[1]=r*f,e[2]=s*f,e[3]=i*u,e[4]=a*u,e[5]=n*u,e[6]=o*h,e[7]=c*h,e[8]=l*h,e}function te(e,t,r,s,i,a,n,o){let c=t-i-(o[0]>0?s[0]*o[0]:0),l=c+s[0]+2*i,f=r-i-(o[1]>0?s[1]*o[1]:0),u=f+s[1]+2*i;const h=n.distanceFieldBoundingBox;return n.textureIsSignedDistanceField&&null!=h&&(c+=s[0]*h[0],f+=s[1]*h[1],l-=s[0]*(1-h[2]),u-=s[1]*(1-h[3]),c-=a,l+=a,f-=a,u+=a),e[0]>c&&e[0]<l&&e[1]>f&&e[1]<u}const re=new B,se=n(),ie=v(),ae=v(),ne=b(),oe=v(),ce=v(),le=r(),fe=r(),ue=i(),he=v(),pe={normal:oe,cosAngle:0},me=i(),de=1,ge=2,Oe=[0,0],Se=A(0,0,1);class ve extends z{constructor(){super(...arguments),this.renderOccluded=R.Occlude,this.color=P(1,1,1,1),this.texCoordScale=[1,1],this.polygonOffset=!1,this.anchorPosition=o(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.outlineColor=P(1,1,1,1),this.outlineSize=0,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.binaryHighlightOcclusion=!0,this.centerOffsetUnits="world",this.drawInSecondSlot=!1,this.depthEnabled=!0,this.isDraped=!1}}const Ae=T().vec3f(N.POSITION).vec3f(N.NORMAL).vec2f(N.UV0).vec4u8(N.COLOR).vec2f(N.SIZE).vec4f(N.AUXPOS1).vec4f(N.AUXPOS2),be=Ae.clone().vec4u8(N.OBJECTANDLAYERIDCOLOR);class Pe{constructor(e){this._material=e,this.vertexBufferLayout=has("enable-feature:objectAndLayerId-rendering")?be:Ae}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return 6*e.indices.get(N.POSITION).length}write(e,t,r,s,i){X(r.indices.get(N.POSITION),r.vertexAttributes.get(N.POSITION).data,e,s.position,i,6),H(r.indices.get(N.NORMAL),r.vertexAttributes.get(N.NORMAL).data,t,s.normal,i,6);const a=r.vertexAttributes.get(N.UV0).data;let n,o,c,l;if(null==a||a.length<4){const e=this._material.parameters;n=0,o=0,c=e.texCoordScale[0],l=e.texCoordScale[1]}else n=a[0],o=a[1],c=a[2],l=a[3];c=Math.min(1.99999,c+1),l=Math.min(1.99999,l+1);let f=r.indices.get(N.POSITION).length,u=i;const h=s.uv0;for(let g=0;g<f;++g)h.set(u,0,n),h.set(u,1,o),u+=1,h.set(u,0,c),h.set(u,1,o),u+=1,h.set(u,0,c),h.set(u,1,l),u+=1,h.set(u,0,c),h.set(u,1,l),u+=1,h.set(u,0,n),h.set(u,1,l),u+=1,h.set(u,0,n),h.set(u,1,o),u+=1;G(r.indices.get(N.COLOR),r.vertexAttributes.get(N.COLOR).data,4,s.color,i,6);const p=r.indices.get(N.SIZE),m=r.vertexAttributes.get(N.SIZE).data;f=p.length;const d=s.size;u=i;for(let g=0;g<f;++g){const e=m[2*p[g]],t=m[2*p[g]+1];for(let r=0;r<6;++r)d.set(u,0,e),d.set(u,1,t),u+=1}if(r.indices.get(N.AUXPOS1)&&r.vertexAttributes.get(N.AUXPOS1)?k(r.indices.get(N.AUXPOS1),r.vertexAttributes.get(N.AUXPOS1).data,s.auxpos1,i,6):F(s.auxpos1,i,6*f),r.indices.get(N.AUXPOS2)&&r.vertexAttributes.get(N.AUXPOS2)?k(r.indices.get(N.AUXPOS2),r.vertexAttributes.get(N.AUXPOS2).data,s.auxpos2,i,6):F(s.auxpos2,i,6*f),null!=r.objectAndLayerIdColor){if(r.indices.get(N.POSITION)){const e=r.indices.get(N.POSITION).length,t=s.getField(N.OBJECTANDLAYERIDCOLOR,_);W(r.objectAndLayerIdColor,t,e,i,6)}}}}export{K as HUDMaterial,ve as Parameters};
5
+ import has from"../../../../core/has.js";import{clamp as e}from"../../../../core/mathUtils.js";import{f as t}from"../../../../chunks/mat3.js";import{c as r}from"../../../../chunks/mat3f64.js";import{a as s}from"../../../../chunks/mat4.js";import{c as i}from"../../../../chunks/mat4f64.js";import{c as a}from"../../../../chunks/vec2.js";import{a as n,f as o}from"../../../../chunks/vec2f64.js";import{s as c,m as l,n as f,b as u,g as p,c as h,l as m,i as d,t as g,e as O,a as S}from"../../../../chunks/vec3.js";import{c as v,f as A}from"../../../../chunks/vec3f64.js";import{c as b,f as P}from"../../../../chunks/vec4f64.js";import{isMat4 as x}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as _}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as y}from"../../../../geometry/support/buffer/BufferView.js";import I from"../../support/debugFlags.js";import{newLayout as T}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as j}from"../core/shaderLibrary/ShaderOutput.js";import{HUDSpace as C}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterial as L,GLTextureMaterialBindParameters as z}from"../lib/GLTextureMaterial.js";import{Material as M,RenderOccludedFlag as R}from"../lib/Material.js";import{RenderSlot as U}from"../lib/RenderSlot.js";import{applyScaleFactor as E,applyPrecomputedScaleFactor as w,precomputeScaleFactor as D}from"../lib/screenSizePerspectiveUtils.js";import{assert as V}from"../lib/Util.js";import{VertexAttribute as N}from"../lib/VertexAttribute.js";import{ScaleInfo as B}from"./ScaleInfo.js";import{writePosition as X,writeNormal as H,writeColor as G,writeBufferVec4 as k,writeBufferVec4Zeros as F,writeObjectAndLayerIdColor as W}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as q}from"./internal/MaterialUtil.js";import{c as Z}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as J}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as Y}from"../shaders/HUDMaterialTechniqueConfiguration.js";class K extends M{constructor(e){super(e,new ve),this._configuration=new Y}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits?C.Screen:C.World,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=this.parameters.isDraped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===U.OCCLUSION_PIXELS&&this.parameters.occlusionTest&&(e===j.Color||e===j.Alpha),e===j.Color&&(this._configuration.debugDrawLabelBorder=!!I.LABELS_SHOW_BORDER),e===j.Highlight&&(this._configuration.binaryHighlightOcclusionEnabled=this.parameters.binaryHighlightOcclusion),this._configuration.depthEnabled=this.parameters.depthEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassGeometry=t.multipassGeometry.enabled,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,r,i,a,n,o){if(!i.options.selectionMode||!i.options.hud||!e.visible)return;const g=this.parameters;let O=1,S=1;if(t(le,r),null!=e.shaderTransformer){const t=e.shaderTransformer(me);O=t[0],S=t[5],ee(le)}const A=e.vertexAttributes.get(N.POSITION),b=e.vertexAttributes.get(N.SIZE),P=e.vertexAttributes.get(N.NORMAL),x=e.vertexAttributes.get(N.AUXPOS1);V(A.size>=3);const _=i.point,y=i.camera,I=Z(g);O*=y.pixelRatio,S*=y.pixelRatio;const T="screen"===this.parameters.centerOffsetUnits;for(let t=0;t<A.data.length/A.size;t++){const e=t*A.size;c(ie,A.data[e],A.data[e+1],A.data[e+2]),l(ie,ie,r);const a=t*b.size;Oe[0]=b.data[a]*O,Oe[1]=b.data[a+1]*S,l(ie,ie,y.viewMatrix);const n=t*x.size;if(c(pe,x.data[n],x.data[n+1],x.data[n+2]),!T&&(ie[0]+=pe[0],ie[1]+=pe[1],0!==pe[2])){const e=pe[2];f(pe,ie),u(ie,ie,p(pe,pe,e))}const j=t*P.size;if(c(ae,P.data[j],P.data[j+1],P.data[j+2]),this._normalAndViewAngle(ae,le,y,he),this._applyVerticalOffsetTransformationView(ie,he,y,re),y.applyProjection(ie,ne),ne[0]>-1){ne[0]=Math.floor(ne[0]),ne[1]=Math.floor(ne[1]),T&&(pe[0]||pe[1])&&(ne[0]+=pe[0],0!==pe[1]&&(ne[1]+=E(pe[1],re.factorAlignment)),y.unapplyProjection(ne,ie)),ne[0]+=this.parameters.screenOffset[0],ne[1]+=this.parameters.screenOffset[1],w(Oe,re.factor,Oe);const e=de*y.pixelRatio;let t=0;if(g.textureIsSignedDistanceField&&(t=g.outlineSize*y.pixelRatio/2),_&&te(_,ne[0],ne[1],Oe,e,t,g,I)){const e=i.ray;if(l(ce,ie,s(ue,y.viewMatrix)),ne[0]=_[0],ne[1]=_[1],y.unprojectFromRenderScreen(ne,ie)){const t=v();h(t,e.direction);const r=1/m(t);p(t,t,r);o(d(e.origin,ie)*r,t,-1,!0,1,ce)}}}}}intersectDraped(e,t,r,s,i,a){const n=e.vertexAttributes.get(N.POSITION),o=e.vertexAttributes.get(N.SIZE),c=this.parameters,l=Z(c);let f=1,u=1;if(null!=e.shaderTransformer){const t=e.shaderTransformer(me);f=t[0],u=t[5]}f*=e.screenToWorldRatio,u*=e.screenToWorldRatio;const p=ge*e.screenToWorldRatio;for(let h=0;h<n.data.length/n.size;h++){const t=h*n.size,r=n.data[t],m=n.data[t+1],d=h*o.size;Oe[0]=o.data[d]*f,Oe[1]=o.data[d+1]*u;let g=0;c.textureIsSignedDistanceField&&(g=c.outlineSize*e.screenToWorldRatio/2),te(s,r,m,Oe,p,g,c,l)&&i(a.dist,a.normal,-1,!1)}}createBufferWriter(){return new Pe(this)}_normalAndViewAngle(e,r,s,i){return x(r)&&(r=t(fe,r)),g(i.normal,e,r),l(i.normal,i.normal,s.viewInverseTransposeMatrix),i.cosAngle=O(oe,Se),i}_updateScaleInfo(e,t,r){const s=this.parameters;null!=s.screenSizePerspective?D(r,t,s.screenSizePerspective,e.factor):(e.factor.scale=1,e.factor.factor=0,e.factor.minPixelSize=0,e.factor.paddingPixels=0),null!=s.screenSizePerspectiveAlignment?D(r,t,s.screenSizePerspectiveAlignment,e.factorAlignment):(e.factorAlignment.factor=e.factor.factor,e.factorAlignment.scale=e.factor.scale,e.factorAlignment.minPixelSize=e.factor.minPixelSize,e.factorAlignment.paddingPixels=e.factor.paddingPixels)}applyShaderOffsetsView(e,t,r,s,i,a,n){const o=this._normalAndViewAngle(t,r,i,he);return this._applyVerticalGroundOffsetView(e,o,i,n),this._applyVerticalOffsetTransformationView(n,o,i,a),this._applyPolygonOffsetView(n,o,s[3],i,n),this._applyCenterOffsetView(n,s,n),n}applyShaderOffsetsNDC(e,t,r,s,i){return this._applyCenterOffsetNDC(e,t,r,s),null!=i&&h(i,s),this._applyPolygonOffsetNDC(s,t,r,s),s}_applyPolygonOffsetView(t,r,s,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(s);0===o&&(o=n);const c=n*o;if(this.parameters.shaderPolygonOffset<=0)return h(a,t);const l=e(Math.abs(r.cosAngle),.01,1),f=1-Math.sqrt(1-l*l)/l/i.viewport[2];return p(a,t,c>0?f:1/f),a}_applyVerticalGroundOffsetView(e,t,r,s){const i=m(e),a=r.aboveGround?1:-1,n=.5*r.computeRenderPixelSizeAtDist(i),o=p(ie,t.normal,a*n);return S(s,e,o),s}_applyVerticalOffsetTransformationView(e,t,r,s){const i=this.parameters;if(!i.verticalOffset||!i.verticalOffset.screenLength){if(i.screenSizePerspective||i.screenSizePerspectiveAlignment){const r=m(e);this._updateScaleInfo(s,r,t.cosAngle)}else s.factor.scale=1,s.factorAlignment.scale=1;return e}const a=m(e),n=i.screenSizePerspectiveAlignment??i.screenSizePerspective,o=q(r,a,i.verticalOffset,t.cosAngle,n);return this._updateScaleInfo(s,a,t.cosAngle),p(t.normal,t.normal,o),S(e,e,t.normal)}_applyCenterOffsetView(e,t,r){const s="screen"!==this.parameters.centerOffsetUnits;return r!==e&&h(r,e),s&&(r[0]+=t[0],r[1]+=t[1],t[2]&&(f(ae,r),S(r,r,p(ae,ae,t[2])))),r}_applyCenterOffsetNDC(e,t,r,s){const i="screen"!==this.parameters.centerOffsetUnits;return s!==e&&h(s,e),i||(s[0]+=t[0]/r.fullWidth*2,s[1]+=t[1]/r.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,r,s){const i=this.parameters.shaderPolygonOffset;if(e!==s&&h(s,e),i){const e=r.aboveGround?1:-1,a=e*Math.sign(t[3]);s[2]-=(a||e)*i}return s}requiresSlot(e,t){if(t===j.Color||t===j.Alpha||t===j.Highlight||t===j.ObjectAndLayerIdColor){if(e===U.DRAPED_MATERIAL)return!0;const{drawInSecondSlot:t,occlusionTest:r}=this.parameters;return e===(t?U.LABEL_MATERIAL:U.HUD_MATERIAL)||r&&e===U.OCCLUSION_PIXELS}return!1}createGLMaterial(e){return new Q(e)}calculateRelativeScreenBounds(e,t,r=_()){return $(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}}class Q extends L{constructor(e){super({...e,...e.material.parameters})}selectProgram(e){return this.ensureTechnique(J,e)}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.selectProgram(e)}}function $(e,t,r,s=se){return a(s,e.anchorPosition),s[0]*=-t[0],s[1]*=-t[1],s[0]+=e.screenOffset[0]*r,s[1]+=e.screenOffset[1]*r,s}function ee(e){const t=e[0],r=e[1],s=e[2],i=e[3],a=e[4],n=e[5],o=e[6],c=e[7],l=e[8],f=1/Math.sqrt(t*t+r*r+s*s),u=1/Math.sqrt(i*i+a*a+n*n),p=1/Math.sqrt(o*o+c*c+l*l);return e[0]=t*f,e[1]=r*f,e[2]=s*f,e[3]=i*u,e[4]=a*u,e[5]=n*u,e[6]=o*p,e[7]=c*p,e[8]=l*p,e}function te(e,t,r,s,i,a,n,o){let c=t-i-(o[0]>0?s[0]*o[0]:0),l=c+s[0]+2*i,f=r-i-(o[1]>0?s[1]*o[1]:0),u=f+s[1]+2*i;const p=n.distanceFieldBoundingBox;return n.textureIsSignedDistanceField&&null!=p&&(c+=s[0]*p[0],f+=s[1]*p[1],l-=s[0]*(1-p[2]),u-=s[1]*(1-p[3]),c-=a,l+=a,f-=a,u+=a),e[0]>c&&e[0]<l&&e[1]>f&&e[1]<u}const re=new B,se=n(),ie=v(),ae=v(),ne=b(),oe=v(),ce=v(),le=r(),fe=r(),ue=i(),pe=v(),he={normal:oe,cosAngle:0},me=i(),de=1,ge=2,Oe=[0,0],Se=A(0,0,1);class ve extends z{constructor(){super(...arguments),this.renderOccluded=R.Occlude,this.color=P(1,1,1,1),this.texCoordScale=[1,1],this.polygonOffset=!1,this.anchorPosition=o(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.outlineColor=P(1,1,1,1),this.outlineSize=0,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.binaryHighlightOcclusion=!0,this.centerOffsetUnits="world",this.drawInSecondSlot=!1,this.depthEnabled=!0,this.isDraped=!1}}const Ae=T().vec3f(N.POSITION).vec3f(N.NORMAL).vec2f(N.UV0).vec4u8(N.COLOR).vec2f(N.SIZE).vec4f(N.AUXPOS1).vec4f(N.AUXPOS2),be=Ae.clone().vec4u8(N.OBJECTANDLAYERIDCOLOR);class Pe{constructor(e){this._material=e,this.vertexBufferLayout=has("enable-feature:objectAndLayerId-rendering")?be:Ae}elementCount(e){return 6*e.indices.get(N.POSITION).length}write(e,t,r,s,i){X(r.indices.get(N.POSITION),r.vertexAttributes.get(N.POSITION).data,e,s.position,i,6),H(r.indices.get(N.NORMAL),r.vertexAttributes.get(N.NORMAL).data,t,s.normal,i,6);const a=r.vertexAttributes.get(N.UV0).data;let n,o,c,l;if(null==a||a.length<4){const e=this._material.parameters;n=0,o=0,c=e.texCoordScale[0],l=e.texCoordScale[1]}else n=a[0],o=a[1],c=a[2],l=a[3];c=Math.min(1.99999,c+1),l=Math.min(1.99999,l+1);let f=r.indices.get(N.POSITION).length,u=i;const p=s.uv0;for(let g=0;g<f;++g)p.set(u,0,n),p.set(u,1,o),u+=1,p.set(u,0,c),p.set(u,1,o),u+=1,p.set(u,0,c),p.set(u,1,l),u+=1,p.set(u,0,c),p.set(u,1,l),u+=1,p.set(u,0,n),p.set(u,1,l),u+=1,p.set(u,0,n),p.set(u,1,o),u+=1;G(r.indices.get(N.COLOR),r.vertexAttributes.get(N.COLOR).data,4,s.color,i,6);const h=r.indices.get(N.SIZE),m=r.vertexAttributes.get(N.SIZE).data;f=h.length;const d=s.size;u=i;for(let g=0;g<f;++g){const e=m[2*h[g]],t=m[2*h[g]+1];for(let r=0;r<6;++r)d.set(u,0,e),d.set(u,1,t),u+=1}if(r.indices.get(N.AUXPOS1)&&r.vertexAttributes.get(N.AUXPOS1)?k(r.indices.get(N.AUXPOS1),r.vertexAttributes.get(N.AUXPOS1).data,s.auxpos1,i,6):F(s.auxpos1,i,6*f),r.indices.get(N.AUXPOS2)&&r.vertexAttributes.get(N.AUXPOS2)?k(r.indices.get(N.AUXPOS2),r.vertexAttributes.get(N.AUXPOS2).data,s.auxpos2,i,6):F(s.auxpos2,i,6*f),null!=r.objectAndLayerIdColor){if(r.indices.get(N.POSITION)){const e=r.indices.get(N.POSITION).length,t=s.getField(N.OBJECTANDLAYERIDCOLOR,y);W(r.objectAndLayerIdColor,t,e,i,6)}}}}export{K as HUDMaterial,ve as Parameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{s as t,k as e}from"../../../../chunks/vec2.js";import{a as r}from"../../../../chunks/vec2f64.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import a from"../lib/GLMaterial.js";import{Material as o}from"../lib/Material.js";import{RenderSlot as n}from"../lib/RenderSlot.js";import{VertexAttribute as u}from"../lib/VertexAttribute.js";import{writePosition as l,writeBufferFloat as c}from"./internal/bufferWriterUtils.js";import{HeatmapDensityPassParameters as f,HeatmapDensityTechniqueConfiguration as m,HeatmapDensityTechnique as T}from"../shaders/HeatmapDensityTechnique.js";const h=2;class p extends f{constructor(){super(...arguments),this.isAttributeDriven=!1,this.usesHalfFloats=!1}}class d extends o{constructor(t){super(t,new p),this._configuration=new m}requiresSlot(t,e){return t===n.DRAPED_MATERIAL&&e===i.Color}getConfiguration(){return this._configuration.isAttributeDriven=this.parameters.isAttributeDriven,this._configuration.usesHalfFloat=this.parameters.usesHalfFloats,this._configuration}createGLMaterial(t){return new A(t)}intersect(){}intersectDraped(r,s,i,a,o,n){const l=r.vertexAttributes.get(u.POSITION),{parameters:c}=this,{searchRadius:f}=c,{screenToWorldRatio:m}=r,T=f*m+h*m,p=T*T,d=l.data.length/l.size;for(let u=0;u<d;u++){const r=u*l.size,s=t(E,l.data[r],l.data[r+1]);e(s,a)<p&&o(n.dist,n.normal,-1,!1)}}createBufferWriter(){return new I(this.parameters.isAttributeDriven?g:b)}}class A extends a{beginSlot(t){return this.ensureTechnique(T,t)}}class I{constructor(t){this.vertexBufferLayout=t}allocate(t){return this.vertexBufferLayout.createBuffer(t)}elementCount(t){return t.indices.get(u.POSITION).length*v}write(t,e,r,s,i){l(r.indices.get(u.POSITION),r.vertexAttributes.get(u.POSITION).data,t,s.position,i,v);const a=r.indices.get(u.POSITION).length,o=s.uv0;let n=i;for(let u=0;u<a;++u)o.setValues(n++,-1,-1),o.setValues(n++,1,-1),o.setValues(n++,1,1),o.setValues(n++,1,1),o.setValues(n++,-1,1),o.setValues(n++,-1,-1);const f=u.FEATUREATTRIBUTE in s?s.featureAttribute:null;f&&c(r.indices.get(u.FEATUREATTRIBUTE),r.vertexAttributes.get(u.FEATUREATTRIBUTE).data,f,i,v)}}const b=s().vec3f(u.POSITION).vec2f(u.UV0),g=b.clone().f32(u.FEATUREATTRIBUTE),v=6,E=r();export{d as HeatmapDensityMaterial,p as HeatmapDensityMaterialParameters};
5
+ import{s as t,k as e}from"../../../../chunks/vec2.js";import{a as r}from"../../../../chunks/vec2f64.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import a from"../lib/GLMaterial.js";import{Material as o}from"../lib/Material.js";import{RenderSlot as n}from"../lib/RenderSlot.js";import{VertexAttribute as u}from"../lib/VertexAttribute.js";import{writePosition as l,writeBufferFloat as c}from"./internal/bufferWriterUtils.js";import{HeatmapDensityPassParameters as f,HeatmapDensityTechniqueConfiguration as m,HeatmapDensityTechnique as T}from"../shaders/HeatmapDensityTechnique.js";const h=2;class p extends f{constructor(){super(...arguments),this.isAttributeDriven=!1,this.usesHalfFloats=!1}}class d extends o{constructor(t){super(t,new p),this._configuration=new m}requiresSlot(t,e){return t===n.DRAPED_MATERIAL&&e===i.Color}getConfiguration(){return this._configuration.isAttributeDriven=this.parameters.isAttributeDriven,this._configuration.usesHalfFloat=this.parameters.usesHalfFloats,this._configuration}createGLMaterial(t){return new A(t)}intersect(){}intersectDraped(r,s,i,a,o,n){const l=r.vertexAttributes.get(u.POSITION),{parameters:c}=this,{searchRadius:f}=c,{screenToWorldRatio:m}=r,T=f*m+h*m,p=T*T,d=l.data.length/l.size;for(let u=0;u<d;u++){const r=u*l.size,s=t(E,l.data[r],l.data[r+1]);e(s,a)<p&&o(n.dist,n.normal,-1,!1)}}createBufferWriter(){return new I(this.parameters.isAttributeDriven?g:b)}}class A extends a{beginSlot(t){return this.ensureTechnique(T,t)}}class I{constructor(t){this.vertexBufferLayout=t}elementCount(t){return t.indices.get(u.POSITION).length*v}write(t,e,r,s,i){l(r.indices.get(u.POSITION),r.vertexAttributes.get(u.POSITION).data,t,s.position,i,v);const a=r.indices.get(u.POSITION).length,o=s.uv0;let n=i;for(let u=0;u<a;++u)o.setValues(n++,-1,-1),o.setValues(n++,1,-1),o.setValues(n++,1,1),o.setValues(n++,1,1),o.setValues(n++,-1,1),o.setValues(n++,-1,-1);const f=u.FEATUREATTRIBUTE in s?s.featureAttribute:null;f&&c(r.indices.get(u.FEATUREATTRIBUTE),r.vertexAttributes.get(u.FEATUREATTRIBUTE).data,f,i,v)}}const b=s().vec3f(u.POSITION).vec2f(u.UV0),g=b.clone().f32(u.FEATUREATTRIBUTE),v=6,E=r();export{d as HeatmapDensityMaterial,p as HeatmapDensityMaterialParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{f as e}from"../../../../chunks/vec2f32.js";import{Z as t}from"../../../../chunks/vec2f64.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import{HUDSpace as s}from"../core/shaderLibrary/hud/HUD.glsl.js";import n from"../lib/GLMaterial.js";import{Material as a,MaterialParameters as o}from"../lib/Material.js";import{RenderSlot as u}from"../lib/RenderSlot.js";import{VertexAttribute as c}from"../lib/VertexAttribute.js";import{writePosition as f,writeNormal as l,writeBufferVec4 as h}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as d}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as m}from"../shaders/LineCalloutTechniqueConfiguration.js";class p extends a{get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}constructor(e){super(e,new O),this._configuration=new m,this._uniqueMaterialIdentifier=p.uniqueMaterialIdentifier(this.parameters)}getPassParameters(){return this.parameters}getConfiguration(e,t){const r=t?.slot!==u.LINE_CALLOUTS;return this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.depthHudEnabled=r,this._configuration.depthHudAlignStartEnabled=!!this.parameters.depthHUDAlignStart,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits?s.Screen:s.World,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasMultipassGeometry=t.multipassGeometry.enabled,this._configuration}intersect(){}requiresSlot(e,t){if(t===i.Color)switch(e){case u.LINE_CALLOUTS:case u.LINE_CALLOUTS_HUD_DEPTH:return!0}return!1}createGLMaterial(e){return new g(e)}createBufferWriter(){return new I}validateParameters(e){const t=p.uniqueMaterialIdentifier(e);t!==this._uniqueMaterialIdentifier&&(this._uniqueMaterialIdentifier=t)}static uniqueMaterialIdentifier(e){return JSON.stringify({screenOffset:e.screenOffset||[0,0],centerOffsetUnits:e.centerOffsetUnits||"world"})}}class g extends n{beginSlot(e){return this.ensureTechnique(d,e)}}class O extends o{constructor(){super(...arguments),this.screenOffset=t,this.color=[0,0,0,1],this.size=1,this.occlusionTest=!1,this.shaderPolygonOffset=1e-5,this.depthHUDAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}}const S=r().vec3f(c.POSITION).vec3f(c.NORMAL).vec2f(c.UV0).vec4f(c.AUXPOS1),L=[e(0,0),e(1,0),e(0,1),e(1,0),e(1,1),e(0,1)];class I{constructor(){this.vertexBufferLayout=S}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return 6*e.indices.get(c.POSITION).length}write(e,t,r,i,s){f(r.indices.get(c.POSITION),r.vertexAttributes.get(c.POSITION).data,e,i.position,s,6),l(r.indices.get(c.NORMAL),r.vertexAttributes.get(c.NORMAL).data,t,i.normal,s,6),h(r.indices.get(c.AUXPOS1),r.vertexAttributes.get(c.AUXPOS1).data,i.auxpos1,s,6);for(let n=0;n<L.length;++n)i.uv0.setVec(s+n,L[n])}}export{p as LineCalloutMaterial,O as Parameters};
5
+ import{f as e}from"../../../../chunks/vec2f32.js";import{Z as t}from"../../../../chunks/vec2f64.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import{HUDSpace as s}from"../core/shaderLibrary/hud/HUD.glsl.js";import n from"../lib/GLMaterial.js";import{Material as a,MaterialParameters as o}from"../lib/Material.js";import{RenderSlot as u}from"../lib/RenderSlot.js";import{VertexAttribute as c}from"../lib/VertexAttribute.js";import{writePosition as f,writeNormal as l,writeBufferVec4 as h}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as d}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as m}from"../shaders/LineCalloutTechniqueConfiguration.js";class p extends a{get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}constructor(e){super(e,new O),this._configuration=new m,this._uniqueMaterialIdentifier=p.uniqueMaterialIdentifier(this.parameters)}getPassParameters(){return this.parameters}getConfiguration(e,t){const r=t?.slot!==u.LINE_CALLOUTS;return this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.depthHudEnabled=r,this._configuration.depthHudAlignStartEnabled=!!this.parameters.depthHUDAlignStart,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits?s.Screen:s.World,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasMultipassGeometry=t.multipassGeometry.enabled,this._configuration}intersect(){}requiresSlot(e,t){if(t===i.Color)switch(e){case u.LINE_CALLOUTS:case u.LINE_CALLOUTS_HUD_DEPTH:return!0}return!1}createGLMaterial(e){return new g(e)}createBufferWriter(){return new L}validateParameters(e){const t=p.uniqueMaterialIdentifier(e);t!==this._uniqueMaterialIdentifier&&(this._uniqueMaterialIdentifier=t)}static uniqueMaterialIdentifier(e){return JSON.stringify({screenOffset:e.screenOffset||[0,0],centerOffsetUnits:e.centerOffsetUnits||"world"})}}class g extends n{beginSlot(e){return this.ensureTechnique(d,e)}}class O extends o{constructor(){super(...arguments),this.screenOffset=t,this.color=[0,0,0,1],this.size=1,this.occlusionTest=!1,this.shaderPolygonOffset=1e-5,this.depthHUDAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}}const S=r().vec3f(c.POSITION).vec3f(c.NORMAL).vec2f(c.UV0).vec4f(c.AUXPOS1),I=[e(0,0),e(1,0),e(0,1),e(1,0),e(1,1),e(0,1)];class L{constructor(){this.vertexBufferLayout=S}elementCount(e){return 6*e.indices.get(c.POSITION).length}write(e,t,r,i,s){f(r.indices.get(c.POSITION),r.vertexAttributes.get(c.POSITION).data,e,i.position,s,6),l(r.indices.get(c.NORMAL),r.vertexAttributes.get(c.NORMAL).data,t,i.normal,s,6),h(r.indices.get(c.AUXPOS1),r.vertexAttributes.get(c.AUXPOS1).data,i.auxpos1,s,6);for(let n=0;n<I.length;++n)i.uv0.setVec(s+n,I[n])}}export{p as LineCalloutMaterial,O as Parameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{s as e,F as t,m as r}from"../../../../chunks/vec3.js";import{c as i}from"../../../../chunks/vec3f64.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as a}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as o}from"../lib/GLTextureMaterial.js";import{Material as n,RenderOccludedFlag as h}from"../lib/Material.js";import{RenderSlot as u}from"../lib/RenderSlot.js";import{VertexAttribute as c}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as p}from"./VisualVariablePassParameters.js";import{vertexAttributeLocations as l,LineMarkerTechnique as m}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as d,LineMarkerSpace as T,LineMarkerAnchor as A}from"../shaders/LineMarkerTechniqueConfiguration.js";import{CapType as f}from"../shaders/RibbonLineTechniqueConfiguration.js";class v extends n{constructor(e){super(e,new E),this._vertexAttributeLocations=l,this._configuration=new d,this._layout=this.createLayout()}dispose(){}getConfiguration(e,t){return this._configuration.output=e,this._configuration.space=t.slot===u.DRAPED_MATERIAL?T.Draped:this.parameters.worldSpace?T.World:T.Screen,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=this.parameters.cap!==f.BUTT,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.occluder=this.parameters.renderOccluded===h.OccludeAndTransparentStencil,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(){}createLayout(){const e=s().vec3f(c.POSITION).vec2f(c.UV0).vec3f(c.AUXPOS1);return this.parameters.worldSpace&&e.vec3f(c.NORMAL),this.parameters.vvSize?e.f32(c.SIZEFEATUREATTRIBUTE):e.f32(c.SIZE),this.parameters.vvColor?e.f32(c.COLORFEATUREATTRIBUTE):e.vec4f(c.COLOR),this.parameters.vvOpacity&&e.f32(c.OPACITYFEATUREATTRIBUTE),e}createBufferWriter(){return new S(this._layout,this.parameters)}requiresSlot(e,t){if(t===a.Color||t===a.Alpha||t===a.Highlight||t===a.Depth){if(e===u.DRAPED_MATERIAL)return!0;if(this.parameters.renderOccluded===h.OccludeAndTransparentStencil)return e===u.OPAQUE_MATERIAL||e===u.OCCLUDER_MATERIAL||e===u.TRANSPARENT_OCCLUDER_MATERIAL;if(t===a.Color||t===a.Alpha){return e===(this.parameters.writeDepth?u.TRANSPARENT_MATERIAL:u.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return e===u.OPAQUE_MATERIAL}return!1}createGLMaterial(e){return new _(e)}}class _ extends o{constructor(){super(...arguments),this._markerPrimitive=null}dispose(){super.dispose(),this._markerTextureRepository.release(this._markerPrimitive),this._markerPrimitive=null}_updateParameters(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextureRepository.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(m,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output!==a.Color&&this._output!==a.Alpha||this._updateOccludeeState(e),this._updateParameters(e)}}class E extends p{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=f.BUTT,this.anchor=A.Center,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.hasOccludees=!1,this.markerTexture=null}}class S{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(i,s,a,o,n){const h=a.vertexAttributes.get(c.POSITION).data,u=h.length/3;let p=[1,0,0];const l=a.vertexAttributes.get(c.NORMAL);this._parameters.worldSpace&&null!=l&&(p=l.data);let m=1,d=0;this._parameters.vvSize?d=a.vertexAttributes.get(c.SIZEFEATUREATTRIBUTE).data[0]:a.vertexAttributes.has(c.SIZE)&&(m=a.vertexAttributes.get(c.SIZE).data[0]);let T=[1,1,1,1],A=0;this._parameters.vvColor?A=a.vertexAttributes.get(c.COLORFEATUREATTRIBUTE).data[0]:a.vertexAttributes.has(c.COLOR)&&(T=a.vertexAttributes.get(c.COLOR).data);let f=0;this._parameters.vvOpacity&&(f=a.vertexAttributes.get(c.OPACITYFEATUREATTRIBUTE).data[0]);const v=new Float32Array(o.buffer);let _=n*(this.vertexBufferLayout.stride/4);const E=(e,t,r,i)=>{if(v[_++]=e[0],v[_++]=e[1],v[_++]=e[2],v[_++]=r[0],v[_++]=r[1],v[_++]=t[0],v[_++]=t[1],v[_++]=t[2],this._parameters.worldSpace&&(v[_++]=p[0],v[_++]=p[1],v[_++]=p[2]),this._parameters.vvSize?v[_++]=d:v[_++]=m,this._parameters.vvColor)v[_++]=A;else{const e=Math.min(4*i,T.length-4);v[_++]=T[e],v[_++]=T[e+1],v[_++]=T[e+2],v[_++]=T[e+3]}this._parameters.vvOpacity&&(v[_++]=f)};let S;!function(e){e[e.ASCENDING=1]="ASCENDING",e[e.DESCENDING=-1]="DESCENDING"}(S||(S={}));const g=(s,a)=>{const o=e(O,h[3*s],h[3*s+1],h[3*s+2]),n=R;let c=s+a;do{e(n,h[3*c],h[3*c+1],h[3*c+2]),c+=a}while(t(o,n)&&c>=0&&c<u);i&&(r(o,o,i),r(n,n,i)),E(o,n,[-1,-1],s),E(o,n,[1,-1],s),E(o,n,[1,1],s),E(o,n,[-1,-1],s),E(o,n,[1,1],s),E(o,n,[-1,1],s)},I=this._parameters.placement;"begin"!==I&&"begin-end"!==I||g(0,S.ASCENDING),"end"!==I&&"begin-end"!==I||g(u-1,S.DESCENDING)}}const O=i(),R=i();export{v as LineMarkerMaterial,E as Parameters};
5
+ import{s as e,F as t,m as r}from"../../../../chunks/vec3.js";import{c as i}from"../../../../chunks/vec3f64.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as a}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as o}from"../lib/GLTextureMaterial.js";import{Material as n,RenderOccludedFlag as h}from"../lib/Material.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{VertexAttribute as u}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as p}from"./VisualVariablePassParameters.js";import{vertexAttributeLocations as l,LineMarkerTechnique as m}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as d,LineMarkerSpace as T,LineMarkerAnchor as A}from"../shaders/LineMarkerTechniqueConfiguration.js";import{CapType as _}from"../shaders/RibbonLineTechniqueConfiguration.js";class v extends n{constructor(e){super(e,new E),this._vertexAttributeLocations=l,this._configuration=new d,this._layout=this.createLayout()}dispose(){}getConfiguration(e,t){return this._configuration.output=e,this._configuration.space=t.slot===c.DRAPED_MATERIAL?T.Draped:this.parameters.worldSpace?T.World:T.Screen,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=this.parameters.cap!==_.BUTT,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.occluder=this.parameters.renderOccluded===h.OccludeAndTransparentStencil,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(){}createLayout(){const e=s().vec3f(u.POSITION).vec2f(u.UV0).vec3f(u.AUXPOS1);return this.parameters.worldSpace&&e.vec3f(u.NORMAL),this.parameters.vvSize?e.f32(u.SIZEFEATUREATTRIBUTE):e.f32(u.SIZE),this.parameters.vvColor?e.f32(u.COLORFEATUREATTRIBUTE):e.vec4f(u.COLOR),this.parameters.vvOpacity&&e.f32(u.OPACITYFEATUREATTRIBUTE),e}createBufferWriter(){return new S(this._layout,this.parameters)}requiresSlot(e,t){if(t===a.Color||t===a.Alpha||t===a.Highlight||t===a.Depth){if(e===c.DRAPED_MATERIAL)return!0;if(this.parameters.renderOccluded===h.OccludeAndTransparentStencil)return e===c.OPAQUE_MATERIAL||e===c.OCCLUDER_MATERIAL||e===c.TRANSPARENT_OCCLUDER_MATERIAL;if(t===a.Color||t===a.Alpha){return e===(this.parameters.writeDepth?c.TRANSPARENT_MATERIAL:c.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return e===c.OPAQUE_MATERIAL}return!1}createGLMaterial(e){return new f(e)}}class f extends o{constructor(){super(...arguments),this._markerPrimitive=null}dispose(){super.dispose(),this._markerTextureRepository.release(this._markerPrimitive),this._markerPrimitive=null}_updateParameters(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextureRepository.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(m,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output!==a.Color&&this._output!==a.Alpha||this._updateOccludeeState(e),this._updateParameters(e)}}class E extends p{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=_.BUTT,this.anchor=A.Center,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.hasOccludees=!1,this.markerTexture=null}}class S{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(i,s,a,o,n){const h=a.vertexAttributes.get(u.POSITION).data,c=h.length/3;let p=[1,0,0];const l=a.vertexAttributes.get(u.NORMAL);this._parameters.worldSpace&&null!=l&&(p=l.data);let m=1,d=0;this._parameters.vvSize?d=a.vertexAttributes.get(u.SIZEFEATUREATTRIBUTE).data[0]:a.vertexAttributes.has(u.SIZE)&&(m=a.vertexAttributes.get(u.SIZE).data[0]);let T=[1,1,1,1],A=0;this._parameters.vvColor?A=a.vertexAttributes.get(u.COLORFEATUREATTRIBUTE).data[0]:a.vertexAttributes.has(u.COLOR)&&(T=a.vertexAttributes.get(u.COLOR).data);let _=0;this._parameters.vvOpacity&&(_=a.vertexAttributes.get(u.OPACITYFEATUREATTRIBUTE).data[0]);const v=new Float32Array(o.buffer);let f=n*(this.vertexBufferLayout.stride/4);const E=(e,t,r,i)=>{if(v[f++]=e[0],v[f++]=e[1],v[f++]=e[2],v[f++]=r[0],v[f++]=r[1],v[f++]=t[0],v[f++]=t[1],v[f++]=t[2],this._parameters.worldSpace&&(v[f++]=p[0],v[f++]=p[1],v[f++]=p[2]),this._parameters.vvSize?v[f++]=d:v[f++]=m,this._parameters.vvColor)v[f++]=A;else{const e=Math.min(4*i,T.length-4);v[f++]=T[e],v[f++]=T[e+1],v[f++]=T[e+2],v[f++]=T[e+3]}this._parameters.vvOpacity&&(v[f++]=_)};let S;!function(e){e[e.ASCENDING=1]="ASCENDING",e[e.DESCENDING=-1]="DESCENDING"}(S||(S={}));const g=(s,a)=>{const o=e(O,h[3*s],h[3*s+1],h[3*s+2]),n=R;let u=s+a;do{e(n,h[3*u],h[3*u+1],h[3*u+2]),u+=a}while(t(o,n)&&u>=0&&u<c);i&&(r(o,o,i),r(n,n,i)),E(o,n,[-1,-1],s),E(o,n,[1,-1],s),E(o,n,[1,1],s),E(o,n,[-1,-1],s),E(o,n,[1,1],s),E(o,n,[-1,1],s)},I=this._parameters.placement;"begin"!==I&&"begin-end"!==I||g(0,S.ASCENDING),"end"!==I&&"begin-end"!==I||g(c-1,S.DESCENDING)}}const O=i(),R=i();export{v as LineMarkerMaterial,E as Parameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{s as t,n as e,b as r,f as s,i as o,m as n}from"../../../../chunks/vec3.js";import{c as i}from"../../../../chunks/vec3f64.js";import{f as a}from"../../../../chunks/vec4f64.js";import{newLayout as c}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as u}from"../core/shaderLibrary/ShaderOutput.js";import f from"../lib/GLMaterial.js";import{Material as l,MaterialParameters as p}from"../lib/Material.js";import{RenderSlot as h}from"../lib/RenderSlot.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{MeasurementArrowTechniqueConfiguration as d,MeasurementArrowTechnique as g}from"../shaders/MeasurementArrowTechnique.js";class O extends l{constructor(t){super(t,new v),this._configuration=new d}getConfiguration(t,e){return this._configuration.polygonOffsetEnabled=this.parameters.polygonOffset,this._configuration.transparent=this._transparent,this._configuration.transparencyPassType=e.transparencyPassType,this._configuration}dispose(){}intersect(){}requiresSlot(t,e){if(e===u.Color||e===u.Alpha){return t===(this._transparent?h.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:h.OPAQUE_MATERIAL)}return!1}createGLMaterial(t){return new A(t)}createBufferWriter(){return new y}get _transparent(){const{parameters:t}=this;return t.outlineColor[3]<1||t.stripeEvenColor[3]<1||t.stripeOddColor[3]<1}}class A extends f{beginSlot(t){return this.ensureTechnique(g,t)}}class v extends p{constructor(){super(...arguments),this.width=32,this.outlineSize=.2,this.outlineColor=a(1,.5,0,1),this.stripeEvenColor=a(1,1,1,1),this.stripeOddColor=a(1,.5,0,1),this.stripeLength=1,this.polygonOffset=!1}}const T=c().vec3f(m.POSITION).vec3f(m.NORMAL).vec2f(m.UV0).f32(m.AUXPOS1),I=i(),_=i(),b=i(),L=i(),S=i();class y{constructor(){this.vertexBufferLayout=T}allocate(t){return this.vertexBufferLayout.createBuffer(t)}elementCount(t){return 2*(t.indices.get(m.POSITION).length/2+1)}write(i,a,c,u,f){const l=c.vertexAttributes.get(m.POSITION).data,p=c.vertexAttributes.get(m.NORMAL).data,h=l.length/3,d=c&&c.indices&&c.indices.get(m.POSITION);d&&d.length!==2*(h-1)&&console.warn("MeasurementArrowMaterial does not support indices");const g=I,O=_,A=b,v=L,T=S,y=u.position,j=u.normal,x=u.uv0;let E=0;for(let m=0;m<h;++m){const c=3*m;if(t(g,l[c],l[c+1],l[c+2]),m<h-1){const o=3*(m+1);t(O,l[o],l[o+1],l[o+2]),t(T,p[o],p[o+1],p[o+2]),e(T,T),r(A,O,g),e(A,A),s(v,T,A),e(v,v)}const u=o(g,O);i&&a&&(n(g,g,i),n(O,O,i),n(v,v,a));const d=f+2*m,I=d+1;y.setVec(d,g),y.setVec(I,g),j.setVec(d,v),j.setVec(I,v),x.set(d,0,E),x.set(d,1,-1),x.set(I,0,E),x.set(I,1,1),m<h-1&&(E+=u)}const M=u.auxpos1;for(let t=0;t<2*h;++t)M.set(f+t,E)}}export{O as MeasurementArrowMaterial,v as Parameters};
5
+ import{s as t,n as e,b as r,f as s,i as o,m as n}from"../../../../chunks/vec3.js";import{c as i}from"../../../../chunks/vec3f64.js";import{f as a}from"../../../../chunks/vec4f64.js";import{newLayout as c}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as u}from"../core/shaderLibrary/ShaderOutput.js";import f from"../lib/GLMaterial.js";import{Material as l,MaterialParameters as p}from"../lib/Material.js";import{RenderSlot as h}from"../lib/RenderSlot.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{MeasurementArrowTechniqueConfiguration as d,MeasurementArrowTechnique as g}from"../shaders/MeasurementArrowTechnique.js";class O extends l{constructor(t){super(t,new T),this._configuration=new d}getConfiguration(t,e){return this._configuration.polygonOffsetEnabled=this.parameters.polygonOffset,this._configuration.transparent=this._transparent,this._configuration.transparencyPassType=e.transparencyPassType,this._configuration}dispose(){}intersect(){}requiresSlot(t,e){if(e===u.Color||e===u.Alpha){return t===(this._transparent?h.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:h.OPAQUE_MATERIAL)}return!1}createGLMaterial(t){return new A(t)}createBufferWriter(){return new j}get _transparent(){const{parameters:t}=this;return t.outlineColor[3]<1||t.stripeEvenColor[3]<1||t.stripeOddColor[3]<1}}class A extends f{beginSlot(t){return this.ensureTechnique(g,t)}}class T extends p{constructor(){super(...arguments),this.width=32,this.outlineSize=.2,this.outlineColor=a(1,.5,0,1),this.stripeEvenColor=a(1,1,1,1),this.stripeOddColor=a(1,.5,0,1),this.stripeLength=1,this.polygonOffset=!1}}const v=c().vec3f(m.POSITION).vec3f(m.NORMAL).vec2f(m.UV0).f32(m.AUXPOS1),I=i(),_=i(),b=i(),S=i(),L=i();class j{constructor(){this.vertexBufferLayout=v}elementCount(t){return 2*(t.indices.get(m.POSITION).length/2+1)}write(i,a,c,u,f){const l=c.vertexAttributes.get(m.POSITION).data,p=c.vertexAttributes.get(m.NORMAL).data,h=l.length/3,d=c&&c.indices&&c.indices.get(m.POSITION);d&&d.length!==2*(h-1)&&console.warn("MeasurementArrowMaterial does not support indices");const g=I,O=_,A=b,T=S,v=L,j=u.position,y=u.normal,E=u.uv0;let M=0;for(let m=0;m<h;++m){const c=3*m;if(t(g,l[c],l[c+1],l[c+2]),m<h-1){const o=3*(m+1);t(O,l[o],l[o+1],l[o+2]),t(v,p[o],p[o+1],p[o+2]),e(v,v),r(A,O,g),e(A,A),s(T,v,A),e(T,T)}const u=o(g,O);i&&a&&(n(g,g,i),n(O,O,i),n(T,T,a));const d=f+2*m,I=d+1;j.setVec(d,g),j.setVec(I,g),y.setVec(d,T),y.setVec(I,T),E.set(d,0,M),E.set(d,1,-1),E.set(I,0,M),E.set(I,1,1),m<h-1&&(M+=u)}const P=u.auxpos1;for(let t=0;t<2*h;++t)P.set(f+t,M)}}export{O as MeasurementArrowMaterial,T as Parameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{c as s}from"../../../../chunks/vec2.js";import{s as i,b as o,e as n,g as a,a as l,c as u,l as c,i as p,m as f}from"../../../../chunks/vec3.js";import{c as h}from"../../../../chunks/vec3f64.js";import{O as m}from"../../../../chunks/vec4f64.js";import{PlaneIndex as d}from"../../../../geometry/support/frustum.js";import{create as g,distance2 as A,fromPoints as _,closestLineSegmentPoint as O}from"../../../../geometry/support/lineSegment.js";import{create as S,fromPoints as T,signedDistance as P,normal as j}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as b,BufferViewVec2f as x}from"../../../../geometry/support/buffer/BufferView.js";import{ShaderOutput as y}from"../core/shaderLibrary/ShaderOutput.js";import v from"../lib/GLMaterial.js";import{Material as R,MaterialParameters as E}from"../lib/Material.js";import{RenderSlot as N}from"../lib/RenderSlot.js";import{isTranslationMatrix as I}from"../lib/Util.js";import{VertexAttribute as L}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as w}from"./DefaultBufferWriter.js";import{PositionColorLayout as C,PositionLayout as U}from"./DefaultLayouts.js";import{writeDefaultAttributes as V}from"./internal/bufferWriterUtils.js";import{NativeLineTechnique as B}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as M}from"../shaders/NativeLineTechniqueConfiguration.js";var D;!function(e){e[e.START=0]="START",e[e.END=1]="END"}(D||(D={}));class X extends R{constructor(e){super(e,new W),this._configuration=new M}getConfiguration(e,t){this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.draped=t.slot===N.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.stipplePreferContinuous=this.parameters.stipplePreferContinuous,this._configuration}intersect(t,r,f,h,m,g){if(!f.options.selectionMode||!t.visible)return;if(!I(r))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const S=t.vertexAttributes.get(L.POSITION).data,b=f.camera,x=ee;s(x,f.point);const y=2;i(te[0],x[0]-y,x[1]+y,0),i(te[1],x[0]+y,x[1]+y,0),i(te[2],x[0]+y,x[1]-y,0),i(te[3],x[0]-y,x[1]-y,0);for(let e=0;e<4;e++)if(!b.unprojectFromRenderScreen(te[e],re[e]))return;T(b.eye,re[0],re[1],se),T(b.eye,re[1],re[2],ie),T(b.eye,re[2],re[3],oe),T(b.eye,re[3],re[0],ne);let v=Number.MAX_VALUE,R=0;for(let e=0;e<S.length-5;e+=3){if(F[0]=S[e]+r[12],F[1]=S[e+1]+r[13],F[2]=S[e+2]+r[14],G[0]=S[e+3]+r[12],G[1]=S[e+4]+r[13],G[2]=S[e+5]+r[14],P(se,F)<0&&P(se,G)<0||P(ie,F)<0&&P(ie,G)<0||P(oe,F)<0&&P(oe,G)<0||P(ne,F)<0&&P(ne,G)<0)continue;if(b.projectToRenderScreen(F,Z),b.projectToRenderScreen(G,z),Z[2]<0&&z[2]>0){o(H,F,G);const e=b.frustum,t=-P(e[d.NEAR],F)/n(H,j(e[d.NEAR]));a(H,H,t),l(F,F,H),b.projectToRenderScreen(F,Z)}else if(Z[2]>0&&z[2]<0){o(H,G,F);const e=b.frustum,t=-P(e[d.NEAR],G)/n(H,j(e[d.NEAR]));a(H,H,t),l(G,G,H),b.projectToRenderScreen(G,z)}else if(Z[2]<0&&z[2]<0)continue;Z[2]=0,z[2]=0;const t=A(_(Z,z,Y),x);t<v&&(v=t,u(J,F),u(K,G),R=e/3)}const E=f.rayBegin,N=f.rayEnd;if(v<y*y){let e=Number.MAX_VALUE;if(O(_(J,K,Y),_(E,N,$),Q)){o(Q,Q,E);const t=c(Q);a(Q,Q,1/t),e=t/p(E,N)}g(e,Q,R,!1)}}intersectDraped(e,r,s,i,o,n){if(!s.options.selectionMode)return;const a=e.vertexAttributes.get(L.POSITION).data,l=e.vertexAttributes.get(L.SIZE),u=l?l.data[0]:0,c=i[0],p=i[1],f=((u+1)/2+4)*e.screenToWorldRatio;let h=Number.MAX_VALUE,m=0;for(let d=0;d<a.length-5;d+=3){const e=a[d],r=a[d+1],s=c-e,i=p-r,o=a[d+3]-e,n=a[d+4]-r,l=t((o*s+n*i)/(o*o+n*n),0,1),u=o*l-s,f=n*l-i,g=u*u+f*f;g<h&&(h=g,m=d/3)}h<f*f&&o(n.dist,n.normal,m,!1)}requiresSlot(e,t){return!(t!==y.Color&&t!==y.Highlight&&t!==y.ObjectAndLayerIdColor||e!==N.OPAQUE_MATERIAL&&e!==N.DRAPED_MATERIAL)}createGLMaterial(e){return new k(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?C:U;return null==this.parameters.stipplePattern?new w(e):new q(e.clone().vec3f(L.AUXPOS1).vec2f(L.UV0))}}class k extends v{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextureRepository.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output===y.Color&&this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextureRepository.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.ensureTechnique(B,e)}}class q{constructor(e){this.vertexBufferLayout=e}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(L.POSITION).length}write(e,t,r,s,i){V(r,this.vertexBufferLayout,e,t,s,i),this._writeAuxpos1(e,r,s,i),this._writeUV0(e,r,s,i)}_writeAuxpos1(e,t,r,s){const i=r.getField(L.AUXPOS1,b),o=t.indices.get(L.POSITION),n=t.vertexAttributes.get(L.POSITION).data,a=e,l=i.typedBufferStride,u=i.typedBuffer;s*=l;for(let c=0;c<o.length-1;c+=2)for(const e of[1,0]){const t=3*o[c+e],r=n[t],i=n[t+1],p=n[t+2],f=a[0]*r+a[4]*i+a[8]*p+a[12],h=a[1]*r+a[5]*i+a[9]*p+a[13],m=a[2]*r+a[6]*i+a[10]*p+a[14];u[s]=f,u[s+1]=h,u[s+2]=m,s+=l}}_writeUV0(e,t,r,s){const o=r.getField(L.UV0,x),n=t.indices.get(L.POSITION),a=t.vertexAttributes.get(L.POSITION).data,l=t.vertexAttributes.get(L.DISTANCETOSTART)?.data,c=o.typedBufferStride,h=o.typedBuffer;let m=0;h[s*=c]=D.START,h[s+1]=m,s+=c;const d=3*n[0],g=i(F,a[d],a[d+1],a[d+2]);e&&f(g,g,e);const A=G,_=n.length-1;let O=1;const S=l?(e,t,r)=>m=l[r]:(e,t,r)=>m+=p(e,t);for(let p=1;p<_;p+=2){const t=3*n[p];i(A,a[t],a[t+1],a[t+2]),e&&f(A,A,e),S(g,A,O++);for(let e=0;e<2;++e)h[s]=1-e,h[s+1]=m,s+=c;u(g,A)}const T=3*n[_];i(A,a[T],a[T+1],a[T+2]),e&&f(A,A,e),S(g,A,O),h[s]=D.END,h[s+1]=m}}class W extends E{constructor(){super(...arguments),this.color=m,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1,this.stipplePreferContinuous=!0,this.hasOccludees=!1,this.stippleTexture=null}}const F=h(),G=h(),H=h(),Q=h(),Z=r(),z=r(),J=h(),K=h(),Y=g(),$=g(),ee=h(),te=[r(),r(),r(),r()],re=[h(),h(),h(),h()],se=S(),ie=S(),oe=S(),ne=S();export{X as NativeLineMaterial,W as Parameters};
5
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{c as s}from"../../../../chunks/vec2.js";import{s as i,b as o,e as n,g as a,a as l,c,l as u,i as p,m as f}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import{O as h}from"../../../../chunks/vec4f64.js";import{PlaneIndex as d}from"../../../../geometry/support/frustum.js";import{create as g,distance2 as A,fromPoints as _,closestLineSegmentPoint as O}from"../../../../geometry/support/lineSegment.js";import{create as S,fromPoints as T,signedDistance as P,normal as j}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as b,BufferViewVec2f as x}from"../../../../geometry/support/buffer/BufferView.js";import{ShaderOutput as y}from"../core/shaderLibrary/ShaderOutput.js";import R from"../lib/GLMaterial.js";import{Material as v,MaterialParameters as E}from"../lib/Material.js";import{RenderSlot as N}from"../lib/RenderSlot.js";import{isTranslationMatrix as I}from"../lib/Util.js";import{VertexAttribute as L}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as w}from"./DefaultBufferWriter.js";import{PositionColorLayout as C,PositionLayout as U}from"./DefaultLayouts.js";import{writeDefaultAttributes as V}from"./internal/bufferWriterUtils.js";import{NativeLineTechnique as M}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as D}from"../shaders/NativeLineTechniqueConfiguration.js";var B;!function(e){e[e.START=0]="START",e[e.END=1]="END"}(B||(B={}));class X extends v{constructor(e){super(e,new W),this._configuration=new D}getConfiguration(e,t){this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.draped=t.slot===N.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.stipplePreferContinuous=this.parameters.stipplePreferContinuous,this._configuration}intersect(t,r,f,m,h,g){if(!f.options.selectionMode||!t.visible)return;if(!I(r))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const S=t.vertexAttributes.get(L.POSITION).data,b=f.camera,x=ee;s(x,f.point);const y=2;i(te[0],x[0]-y,x[1]+y,0),i(te[1],x[0]+y,x[1]+y,0),i(te[2],x[0]+y,x[1]-y,0),i(te[3],x[0]-y,x[1]-y,0);for(let e=0;e<4;e++)if(!b.unprojectFromRenderScreen(te[e],re[e]))return;T(b.eye,re[0],re[1],se),T(b.eye,re[1],re[2],ie),T(b.eye,re[2],re[3],oe),T(b.eye,re[3],re[0],ne);let R=Number.MAX_VALUE,v=0;for(let e=0;e<S.length-5;e+=3){if(F[0]=S[e]+r[12],F[1]=S[e+1]+r[13],F[2]=S[e+2]+r[14],G[0]=S[e+3]+r[12],G[1]=S[e+4]+r[13],G[2]=S[e+5]+r[14],P(se,F)<0&&P(se,G)<0||P(ie,F)<0&&P(ie,G)<0||P(oe,F)<0&&P(oe,G)<0||P(ne,F)<0&&P(ne,G)<0)continue;if(b.projectToRenderScreen(F,Z),b.projectToRenderScreen(G,z),Z[2]<0&&z[2]>0){o(H,F,G);const e=b.frustum,t=-P(e[d.NEAR],F)/n(H,j(e[d.NEAR]));a(H,H,t),l(F,F,H),b.projectToRenderScreen(F,Z)}else if(Z[2]>0&&z[2]<0){o(H,G,F);const e=b.frustum,t=-P(e[d.NEAR],G)/n(H,j(e[d.NEAR]));a(H,H,t),l(G,G,H),b.projectToRenderScreen(G,z)}else if(Z[2]<0&&z[2]<0)continue;Z[2]=0,z[2]=0;const t=A(_(Z,z,Y),x);t<R&&(R=t,c(J,F),c(K,G),v=e/3)}const E=f.rayBegin,N=f.rayEnd;if(R<y*y){let e=Number.MAX_VALUE;if(O(_(J,K,Y),_(E,N,$),Q)){o(Q,Q,E);const t=u(Q);a(Q,Q,1/t),e=t/p(E,N)}g(e,Q,v,!1)}}intersectDraped(e,r,s,i,o,n){if(!s.options.selectionMode)return;const a=e.vertexAttributes.get(L.POSITION).data,l=e.vertexAttributes.get(L.SIZE),c=l?l.data[0]:0,u=i[0],p=i[1],f=((c+1)/2+4)*e.screenToWorldRatio;let m=Number.MAX_VALUE,h=0;for(let d=0;d<a.length-5;d+=3){const e=a[d],r=a[d+1],s=u-e,i=p-r,o=a[d+3]-e,n=a[d+4]-r,l=t((o*s+n*i)/(o*o+n*n),0,1),c=o*l-s,f=n*l-i,g=c*c+f*f;g<m&&(m=g,h=d/3)}m<f*f&&o(n.dist,n.normal,h,!1)}requiresSlot(e,t){return!(t!==y.Color&&t!==y.Highlight&&t!==y.ObjectAndLayerIdColor||e!==N.OPAQUE_MATERIAL&&e!==N.DRAPED_MATERIAL)}createGLMaterial(e){return new k(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?C:U;return null==this.parameters.stipplePattern?new w(e):new q(e.clone().vec3f(L.AUXPOS1).vec2f(L.UV0))}}class k extends R{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextureRepository.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output===y.Color&&this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextureRepository.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.ensureTechnique(M,e)}}class q{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.indices.get(L.POSITION).length}write(e,t,r,s,i){V(r,this.vertexBufferLayout,e,t,s,i),this._writeAuxpos1(e,r,s,i),this._writeUV0(e,r,s,i)}_writeAuxpos1(e,t,r,s){const i=r.getField(L.AUXPOS1,b),o=t.indices.get(L.POSITION),n=t.vertexAttributes.get(L.POSITION).data,a=e,l=i.typedBufferStride,c=i.typedBuffer;s*=l;for(let u=0;u<o.length-1;u+=2)for(const e of[1,0]){const t=3*o[u+e],r=n[t],i=n[t+1],p=n[t+2],f=a[0]*r+a[4]*i+a[8]*p+a[12],m=a[1]*r+a[5]*i+a[9]*p+a[13],h=a[2]*r+a[6]*i+a[10]*p+a[14];c[s]=f,c[s+1]=m,c[s+2]=h,s+=l}}_writeUV0(e,t,r,s){const o=r.getField(L.UV0,x),n=t.indices.get(L.POSITION),a=t.vertexAttributes.get(L.POSITION).data,l=t.vertexAttributes.get(L.DISTANCETOSTART)?.data,u=o.typedBufferStride,m=o.typedBuffer;let h=0;m[s*=u]=B.START,m[s+1]=h,s+=u;const d=3*n[0],g=i(F,a[d],a[d+1],a[d+2]);e&&f(g,g,e);const A=G,_=n.length-1;let O=1;const S=l?(e,t,r)=>h=l[r]:(e,t,r)=>h+=p(e,t);for(let p=1;p<_;p+=2){const t=3*n[p];i(A,a[t],a[t+1],a[t+2]),e&&f(A,A,e),S(g,A,O++);for(let e=0;e<2;++e)m[s]=1-e,m[s+1]=h,s+=u;c(g,A)}const T=3*n[_];i(A,a[T],a[T+1],a[T+2]),e&&f(A,A,e),S(g,A,O),m[s]=B.END,m[s+1]=h}}class W extends E{constructor(){super(...arguments),this.color=h,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1,this.stipplePreferContinuous=!0,this.hasOccludees=!1,this.stippleTexture=null}}const F=m(),G=m(),H=m(),Q=m(),Z=r(),z=r(),J=m(),K=m(),Y=g(),$=g(),ee=m(),te=[r(),r(),r(),r()],re=[m(),m(),m(),m()],se=S(),ie=S(),oe=S(),ne=S();export{X as NativeLineMaterial,W as Parameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{n as e,s as t,g as r,a as i}from"../../../../chunks/vec3.js";import{c as s}from"../../../../chunks/vec3f64.js";import{f as a}from"../../../../chunks/vec4f64.js";import{center as n,scale as o}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as c}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as l}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as u}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as h}from"../lib/basicInterfaces.js";import p from"../lib/GLMaterial.js";import{Material as f,MaterialParameters as m}from"../lib/Material.js";import{RenderSlot as d}from"../lib/RenderSlot.js";import{assert as S}from"../lib/Util.js";import{VertexAttribute as b}from"../lib/VertexAttribute.js";import{writeDefaultAttributes as E,writePosition as g}from"./internal/bufferWriterUtils.js";import{intersectTriangleGeometry as A}from"./internal/MaterialUtil.js";import{ShadedColorMaterialTechniqueConfiguration as T,vertexAttributeLocations as _,ShadedColorMaterialTechnique as F}from"../shaders/ShadedColorMaterialTechnique.js";class v extends f{constructor(e){super(e,new x),this.supportsEdges=!0,this._configuration=new T,this._vertexAttributeLocations=_}getConfiguration(e,t){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.screenSizeEnabled=this.parameters.screenSizeEnabled,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,s,a,c,l,u){if(this.parameters.screenSizeEnabled){const s=e.vertexAttributes.get(b.OFFSET),h={applyToVertex:(e,n,o,c)=>{const l=t(L,s.data[3*c],s.data[3*c+1],s.data[3*c+2]),u=t(w,e,n,o);return r(l,l,this.parameters.screenSizeScale*a.camera.computeRenderPixelSizeAt(l)),i(u,u,l),[u[0],u[1],u[2]]},applyToAabb:e=>{const t=n(e,L);return o(e,this.parameters.screenSizeScale*a.camera.computeRenderPixelSizeAt(t))}};A(e,a,c,l,h,u)}else A(e,a,c,l,void 0,u)}requiresSlot(e,t){if(t===u.Highlight)return e===d.OPAQUE_MATERIAL;if(t===u.Color||t===u.Alpha||t===u.ObjectAndLayerIdColor){let t=d.OPAQUE_MATERIAL;return this.parameters.transparent&&(t=this.parameters.writeDepth?d.TRANSPARENT_MATERIAL:d.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),e===t||e===d.DRAPED_MATERIAL}return!1}createGLMaterial(e){return new j(e)}createBufferWriter(){return new O(this.parameters.screenSizeEnabled)}}class j extends p{beginSlot(e){return this.ensureTechnique(F,e)}}class x extends m{constructor(){super(...arguments),this.color=a(1,1,1,1),this.shadingTint=a(0,0,0,.25),this.shadingDirection=e(s(),[.5,-.5,-.5]),this.screenSizeScale=14,this.transparent=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=h.None,this.screenSizeEnabled=!1,this.shadingEnabled=!0}}class O{constructor(e){this.screenSizeEnabled=e;const t=l().vec3f(b.POSITION).vec3f(b.NORMAL);this.screenSizeEnabled&&t.vec3f(b.OFFSET),this.vertexBufferLayout=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(b.POSITION).length}write(e,t,r,i,s){if(E(r,this.vertexBufferLayout,e,t,i,s),this.screenSizeEnabled){if(!r.vertexAttributes.has(b.OFFSET))throw new Error(`${b.OFFSET} vertex attribute required for screenSizeEnabled ShadedColorMaterial`);{const e=r.vertexAttributes.get(b.OFFSET),a=r.indices.get(b.OFFSET);S(3===e.size);const n=i.getField(b.OFFSET,c);if(!n)throw new Error("unable to acquire view for "+b.OFFSET);g(a,e.data,t,n,s)}}}}const L=s(),w=s();export{v as ShadedColorMaterial,x as ShadedColorMaterialParameters};
5
+ import{n as e,s as t,g as r,a as i}from"../../../../chunks/vec3.js";import{c as s}from"../../../../chunks/vec3f64.js";import{f as a}from"../../../../chunks/vec4f64.js";import{center as n,scale as o}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as c}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as l}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as u}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as h}from"../lib/basicInterfaces.js";import p from"../lib/GLMaterial.js";import{Material as f,MaterialParameters as m}from"../lib/Material.js";import{RenderSlot as d}from"../lib/RenderSlot.js";import{assert as S}from"../lib/Util.js";import{VertexAttribute as b}from"../lib/VertexAttribute.js";import{writeDefaultAttributes as E,writePosition as g}from"./internal/bufferWriterUtils.js";import{intersectTriangleGeometry as A}from"./internal/MaterialUtil.js";import{ShadedColorMaterialTechniqueConfiguration as T,vertexAttributeLocations as _,ShadedColorMaterialTechnique as F}from"../shaders/ShadedColorMaterialTechnique.js";class v extends f{constructor(e){super(e,new O),this.supportsEdges=!0,this._configuration=new T,this._vertexAttributeLocations=_}getConfiguration(e,t){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.screenSizeEnabled=this.parameters.screenSizeEnabled,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,s,a,c,l,u){if(this.parameters.screenSizeEnabled){const s=e.vertexAttributes.get(b.OFFSET),h={applyToVertex:(e,n,o,c)=>{const l=t(w,s.data[3*c],s.data[3*c+1],s.data[3*c+2]),u=t(z,e,n,o);return r(l,l,this.parameters.screenSizeScale*a.camera.computeRenderPixelSizeAt(l)),i(u,u,l),[u[0],u[1],u[2]]},applyToAabb:e=>{const t=n(e,w);return o(e,this.parameters.screenSizeScale*a.camera.computeRenderPixelSizeAt(t))}};A(e,a,c,l,h,u)}else A(e,a,c,l,void 0,u)}requiresSlot(e,t){if(t===u.Highlight)return e===d.OPAQUE_MATERIAL;if(t===u.Color||t===u.Alpha||t===u.ObjectAndLayerIdColor){let t=d.OPAQUE_MATERIAL;return this.parameters.transparent&&(t=this.parameters.writeDepth?d.TRANSPARENT_MATERIAL:d.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),e===t||e===d.DRAPED_MATERIAL}return!1}createGLMaterial(e){return new j(e)}createBufferWriter(){return new x(this.parameters.screenSizeEnabled)}}class j extends p{beginSlot(e){return this.ensureTechnique(F,e)}}class O extends m{constructor(){super(...arguments),this.color=a(1,1,1,1),this.shadingTint=a(0,0,0,.25),this.shadingDirection=e(s(),[.5,-.5,-.5]),this.screenSizeScale=14,this.transparent=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=h.None,this.screenSizeEnabled=!1,this.shadingEnabled=!0}}class x{constructor(e){this.screenSizeEnabled=e;const t=l().vec3f(b.POSITION).vec3f(b.NORMAL);this.screenSizeEnabled&&t.vec3f(b.OFFSET),this.vertexBufferLayout=t}elementCount(e){return e.indices.get(b.POSITION).length}write(e,t,r,i,s){if(E(r,this.vertexBufferLayout,e,t,i,s),this.screenSizeEnabled){if(!r.vertexAttributes.has(b.OFFSET))throw new Error(`${b.OFFSET} vertex attribute required for screenSizeEnabled ShadedColorMaterial`);{const e=r.vertexAttributes.get(b.OFFSET),a=r.indices.get(b.OFFSET);S(3===e.size);const n=i.getField(b.OFFSET,c);if(!n)throw new Error("unable to acquire view for "+b.OFFSET);g(a,e.data,t,n,s)}}}}const w=s(),z=s();export{v as ShadedColorMaterial,O as ShadedColorMaterialParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- const t={dash:[4,3],dot:[1,3],"long-dash":[8,3],"short-dash":[4,1],"short-dot":[1,1]},o={dash:t.dash,"dash-dot":[...t.dash,...t.dot],dot:t.dot,"long-dash":t["long-dash"],"long-dash-dot":[...t["long-dash"],...t.dot],"long-dash-dot-dot":[...t["long-dash"],...t.dot,...t.dot],none:null,"short-dash":t["short-dash"],"short-dash-dot":[...t["short-dash"],...t["short-dot"]],"short-dash-dot-dot":[...t["short-dash"],...t["short-dot"],...t["short-dot"]],"short-dot":t["short-dot"],solid:null},d=8;function s(t,o=2){return null==t?t:{pattern:t.slice(),pixelRatio:o}}function h(t,o=2){return{pattern:[t,t],pixelRatio:o}}function n(t){return null!=t&&"style"===t.type?l(t.style):null}function l(t){return null!=t?s(o[t],d):null}export{s as createStipplePattern,h as createStipplePatternSimple,n as getStipplePatternForLinePattern,l as getStipplePatternForPatternStyle};
5
+ const t={dash:[4,3],dot:[1,3],"long-dash":[8,3],"short-dash":[4,1],"short-dot":[1,1]},o={dash:t.dash,"dash-dot":[...t.dash,...t.dot],dot:t.dot,"long-dash":t["long-dash"],"long-dash-dot":[...t["long-dash"],...t.dot],"long-dash-dot-dot":[...t["long-dash"],...t.dot,...t.dot],none:null,"short-dash":t["short-dash"],"short-dash-dot":[...t["short-dash"],...t["short-dot"]],"short-dash-dot-dot":[...t["short-dash"],...t["short-dot"],...t["short-dot"]],"short-dot":t["short-dot"],solid:null},d=8;function s(t,o){return null==t?t:{pattern:t.slice(),pixelRatio:o}}function h(t){return{pattern:[t,t],pixelRatio:2}}function n(t){return null!=t&&"style"===t.type?l(t.style):null}function l(t){return null!=t?s(o[t],d):null}export{h as createStipplePatternSimple,n as getStipplePatternForLinePattern,l as getStipplePatternForPatternStyle};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{removeUnordered as e,filterInPlace as t}from"../../../../../core/arrayUtils.js";import{someMap as r}from"../../../../../core/MapUtils.js";import{NestedMap as s}from"../../../../../core/NestedMap.js";import i from"../../../../../core/PooledArray.js";import{m as a,a as o,t as n}from"../../../../../chunks/mat4.js";import{c as l}from"../../../../../chunks/mat4f64.js";import{glLayout as h}from"../../../support/buffer/glUtil.js";import{ShaderOutput as u}from"../../core/shaderLibrary/ShaderOutput.js";import{AppleAmdDriverHelper as c}from"../../lib/AppleAmdDriverHelper.js";import{GLMaterials as f}from"../../lib/GLMaterials.js";import{RenderOccludedFlag as d}from"../../lib/Material.js";import{DirtyState as m}from"../../lib/ModelDirtyTypes.js";import{assert as g,setMatrixTranslation3 as p}from"../../lib/Util.js";import{DrawParameters as y}from"../DrawParameters.js";import{WaterMaterial as _}from"../WaterMaterial.js";import{BufferRange as v,mergeAdjacentRanges as w}from"./BufferRange.js";import{Instance as b}from"./Instance.js";import{PerBufferData as O,hasVao as A}from"./PerBufferData.js";import{PerOriginData as C}from"./PerOriginData.js";import{VaoCache as H}from"./VaoCache.js";class B{constructor(e,t,r){this._rctx=e,this._materialRepository=t,this.material=r,this._dataByOrigin=new Map,this._appleAmdDriverHelper=null,this._hasHighlights=!1,this._hasOccludees=!1,this._glMaterials=new f(this.material,this._materialRepository),this._bufferWriter=r.createBufferWriter(),this._vaoCache=new H(e,r.vertexAttributeLocations,h(this._bufferWriter.vertexBufferLayout)),this._rctx.driverTest.drawArraysRequiresIndicesTypeReset.result&&(this._appleAmdDriverHelper=new c(this._rctx))}dispose(){this._glMaterials.destroy(),this._dataByOrigin.forEach((e=>e.dispose())),this._dataByOrigin.clear(),this._vaoCache.dispose(),this._appleAmdDriverHelper?.dispose()}get isEmpty(){return 0===this._dataByOrigin.size}get hasHighlights(){return this._hasHighlights}get hasOccludees(){return this._hasOccludees}get hasWater(){return!this.isEmpty&&this.material instanceof _}get rendersOccluded(){return!this.isEmpty&&this.material.renderOccluded!==d.Occlude}get numGeometries(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.instances.size),0))),e}forEachGeometry(e){this._dataByOrigin.forEach((t=>t.buffers.forEach((t=>t.instances.forEach((t=>e(t.geometry)))))))}modify(e){this._updateGeometries(e.updates),this._addAndRemoveGeometries(e.adds,e.removes),this._updateDrawCommands()}_updateGeometries(e){const t=this._bufferWriter,r=t.vertexBufferLayout.stride/4;for(const s of e){const e=s.renderGeometry,i=this._dataByOrigin.get(e.localOrigin.id),a=i?.findBuffer(e.id);if(null==a)return;const o=a.instances.get(e.id);if(s.updateType&(m.GEOMETRY|m.TRANSFORMATION)){const s=W(t.elementCount(o.geometry.geometry)*r),i=t.vertexBufferLayout.createView(s.buffer);this._writeGeometry(e,i,0),a.vao.vertexBuffers.geometry.setSubData(s,o.from*r,0,o.numElements*r),P()}s.updateType&(m.HIGHLIGHT|m.OCCLUDEE|m.VISIBILITY)&&(a.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new s;for(const s of e){const e=s.localOrigin;if(null==e)continue;let t=r.get(e.id,null);null==t&&(t=new D(e.vec3),r.set(e.id,null,t)),t.changes.push(s)}for(const s of t){const e=s.localOrigin;if(null==e)continue;const t=this._dataByOrigin.get(e.id),i=t?.findBuffer(s.id);if(null==i)continue;let a=r.get(e.id,i);null==a&&(a=new D(e.vec3),r.set(e.id,i,a)),a.changes.push(s)}return r}_addAndRemoveGeometries(t,r){const{_bufferWriter:s,_dataByOrigin:i}=this,a=s.vertexBufferLayout.stride/4,o=this._computeDeltas(t,r);o.forEach(((t,r)=>{const n=t.get(null),l=null!=n?n.changes:[];o.delete(r,null);let h=i.get(r);if(t.forEach(((t,n)=>{if(o.delete(r,n),null==n)return void g(!1,"No VAO for removed geometries");if(n.instances.size===t.changes.length)return this._vaoCache.deleteVao(n.vao),e(h.buffers,n),void(0===h.buffers.length&&0===l.length&&i.delete(r));const u=n.numElements,c=n.vao.byteSize/4,f=l.reduce(((e,t)=>e+s.elementCount(t.geometry)),0),d=t.changes.reduce(((e,t)=>e+s.elementCount(t.geometry)),0),m=Math.min((u+f-d)*a,T),p=m>c;m>I&&m<c/2?(t.changes.forEach((({id:e})=>n.deleteInstance(e))),n.instances.forEach((({geometry:e})=>l.push(e))),this._vaoCache.deleteVao(n.vao),e(h.buffers,n)):p?this._applyAndRebuild(n,l,t):this._applyRemoves(n,t)})),l.length>0)for(null==h&&(h=new C(n.origin),i.set(r,h)),h.buffers.forEach((e=>this._applyAdds(e,l)));l.length>0;)h.buffers.push(this._applyAndRebuild(new O,l,null))}))}_updateDrawCommands(){this._hasHighlights=!1,this._hasOccludees=!1,this._dataByOrigin.forEach((e=>{e.buffers.forEach((e=>{e.drawCommandsDirty&&(e.hasHiddenInstances=!1,e.hasHighlights=!1,e.hasOccludees=!1,r(e.instances,(t=>(e.updateDrawState(t),e.hasHiddenInstances&&e.hasHighlights&&e.hasOccludees))),e.updateDrawCommands(this._bufferWriter.vertexBufferLayout.stride)),this._hasHighlights=this._hasHighlights||e.hasHighlights,this._hasOccludees=this._hasOccludees||e.hasOccludees}))}))}_applyAndRebuild(e,t,r){if(null!=r)for(const d of r.changes)e.deleteInstance(d.id);const s=this._bufferWriter,i=s.vertexBufferLayout.stride,a=i/4,o=Math.floor(T/a);let n=e.numElements;for(;t.length>0;){const r=t.pop(),i=s.elementCount(r.geometry);if(n+i>o&&n>0){t.push(r);break}n+=i;const a=new b(r,0,0);g(null==e.instances.get(r.id)),e.addInstance(r.id,a)}const l=n*a,h=W(l),u=s.vertexBufferLayout.createView(h.buffer);let c=0;e.hasHiddenInstances=!1,e.hasHighlights=!1,e.hasOccludees=!1,e.instances.forEach(((t,r)=>{this._writeGeometry(t.geometry,u,c);const i=c;c+=s.elementCount(t.geometry.geometry),e.updateInstance(r,i,c),e.updateDrawState(t)})),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(V(l)),e.vao.vertexBuffers.geometry.setSubData(h,0,0,c*a),P(),e.holes.clear();const f=e.holes.pushNew();return f.from=c,f.to=Math.floor(e.vao.byteSize/i),e.updateDrawCommands(i),e}_applyRemoves(e,t){if(0===t.changes.length)return;for(const o of t.changes){const t=o.id,r=e.instances.get(t);if(!r)continue;e.deleteInstance(t);const s=j.back();if(s){if(s.to===r.from){s.to=r.to;continue}if(s.from===r.to){s.from=r.from;continue}}const i=j.pushNew();i.from=r.from,i.to=r.to}w(j);const r=this._bufferWriter.vertexBufferLayout.stride/4,s=j.reduce(((e,t)=>Math.max(e,t.numElements)),0)*r,i=W(s);i.fill(0,0,s);const a=e.vao.vertexBuffers.geometry;j.forAll((e=>a.setSubData(i,e.from*r,0,e.numElements*r))),P(),e.holes.pushArray(j.data,j.length),j.forAll(((e,t)=>j.data[t]=null)),j.clear(),e.drawCommandsDirty=!0}_applyAdds(e,r){if(0===r.length)return;if(!A(e))return void this._applyAndRebuild(e,r,null);const s=this._bufferWriter,i=s.vertexBufferLayout.stride/4,a=e.numElements,o=r.reduce(((e,t)=>e+s.elementCount(t.geometry)),0),n=Math.min((a+o)*i,T),l=4*n;if(e.vao.byteSize<V(T-I)&&l>e.vao.byteSize)return void this._applyAndRebuild(e,r,null);w(e.holes);const h=new Array;for(const t of r){const r=s.elementCount(t.geometry),i=E(e.holes,r);h.push(i)}const u=e.vao.vertexBuffers.geometry;let c=0,f=0,d=0;const m=W(n),p=s.vertexBufferLayout.createView(m.buffer);r.forEach(((t,r)=>{const a=h[r];if(null==a)return;if(!(d===a)){const e=d-f;e>0&&u.setSubData(m,f*i,0,e*i),f=a,c=0}const o=s.elementCount(t.geometry);this._writeGeometry(t,p,c),c+=o,d=a+o;const n=new b(t,a,a+o);g(null==e.instances.get(t.id)),e.addInstance(t.id,n),e.drawCommandsDirty=!0}));const y=d-f;y>0&&u.setSubData(m,f*i,0,y*i),t(r,((e,t)=>null==h[t])),P()}_writeGeometry(e,t,r){const s=e.localOrigin.vec3;p(S,-s[0],-s[1],-s[2]);const i=a(x,S,e.transformation);o(M,i),n(M,M),this._bufferWriter.write(i,M,e.geometry,t,r)}updateAnimation(e){return this.material.update(e)}requiresSlot(e,t){return this.material.requiresSlot(e,t)}prepareTechnique(e){const{output:t,bindParameters:r}=e;if(!this.requiresSlot(r.slot,t))return null;const s=t===u.Highlight||t===u.ShadowHighlight;if(s&&!this._hasHighlights)return null;const i=t===u.ShadowExcludeHighlight,a=!(s||i);this._appleAmdDriverHelper?.resetIndicesType();for(const o of this._dataByOrigin.values())for(const n of o.buffers){if(s&&!n.hasHighlights)continue;const o=(s?n.drawCommandsHighlight:i&&n.needsMultipleCommands()?n.drawCommandsShadowHighlightRest:n.drawCommandsDefault)||null,l=a&&n.drawCommandsOccludees||null;if(o?.length||l?.length){const s=this._glMaterials.load(e.rctx,r.slot,t),i=null!=s?s.beginSlot(r):null;if(null!=i)return i}}return null}render(e,t){const{output:r,bindParameters:s}=e,i=r===u.Highlight||r===u.ShadowHighlight,a=r===u.ShadowExcludeHighlight,o=!(i||a),n=this._rctx;this._appleAmdDriverHelper?.resetIndicesType(),n.bindTechnique(t,this.material.parameters,s);for(const l of this._dataByOrigin.values())for(const e of l.buffers){if(i&&!e.hasHighlights)continue;const r=(i?e.drawCommandsHighlight:a&&e.needsMultipleCommands()?e.drawCommandsShadowHighlightRest:e.drawCommandsDefault)||null,h=o&&e.drawCommandsOccludees||null;if(r?.length||h?.length){t.program.bindDraw(new y(l.origin),s,this.material.parameters),t.ensureAttributeLocations(e.vao),n.bindVAO(e.vao),r?.length&&(t.bindPipelineState(n,s.slot,!1),r.forAll((e=>n.drawArrays(t.primitiveType,e.first,e.count)))),h?.length&&(t.bindPipelineState(n,s.slot,!0),h.forAll((e=>n.drawArrays(t.primitiveType,e.first,e.count))))}}}get test(){return{material:this.material,glMaterials:this._glMaterials,dataByOrigin:this._dataByOrigin}}}class D{constructor(e){this.origin=e,this.changes=new Array}}function E(e,t){let r;if(!e.some((e=>!(e.numElements<t)&&(r=e,!0))))return null;const s=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),s}const S=l(),x=l(),M=l(),j=new i({allocator:e=>e||new v,deallocator:null}),I=65536,R=4*I,L=16777216,T=L/4;let G=new Float32Array(I);function W(e){return G.length<e&&(G=new Float32Array(e)),G}function V(e){const t=4*e;return t<R?R:Math.max(Math.min(Math.ceil(1.5*t/R)*R,L),t)}function P(){G=new Float32Array(2)}export{B as MergedRenderer};
5
+ import{removeUnordered as e,filterInPlace as t}from"../../../../../core/arrayUtils.js";import{someMap as r}from"../../../../../core/MapUtils.js";import{NestedMap as s}from"../../../../../core/NestedMap.js";import i from"../../../../../core/PooledArray.js";import{m as a,a as o,t as n}from"../../../../../chunks/mat4.js";import{c as l}from"../../../../../chunks/mat4f64.js";import{glLayout as h}from"../../../support/buffer/glUtil.js";import{ShaderOutput as u}from"../../core/shaderLibrary/ShaderOutput.js";import{AppleAmdDriverHelper as c}from"../../lib/AppleAmdDriverHelper.js";import{GLMaterials as f}from"../../lib/GLMaterials.js";import{RenderOccludedFlag as d}from"../../lib/Material.js";import{DirtyState as m}from"../../lib/ModelDirtyTypes.js";import{assert as g,setMatrixTranslation3 as p}from"../../lib/Util.js";import{DrawParameters as y}from"../DrawParameters.js";import{WaterMaterial as _}from"../WaterMaterial.js";import{BufferRange as v,mergeAdjacentRanges as w}from"./BufferRange.js";import{Instance as b}from"./Instance.js";import{PerBufferData as O,hasVao as A}from"./PerBufferData.js";import{PerOriginData as C}from"./PerOriginData.js";import{VaoCache as H}from"./VaoCache.js";class B{constructor(e,t,r){this._rctx=e,this._materialRepository=t,this.material=r,this._dataByOrigin=new Map,this._appleAmdDriverHelper=null,this._hasHighlights=!1,this._hasOccludees=!1,this._glMaterials=new f(this.material,this._materialRepository),this._bufferWriter=r.createBufferWriter(),this._vaoCache=new H(e,r.vertexAttributeLocations,h(this._bufferWriter.vertexBufferLayout)),this._rctx.driverTest.drawArraysRequiresIndicesTypeReset.result&&(this._appleAmdDriverHelper=new c(this._rctx))}dispose(){this._glMaterials.destroy(),this._dataByOrigin.forEach((e=>e.dispose())),this._dataByOrigin.clear(),this._vaoCache.dispose(),this._appleAmdDriverHelper?.dispose()}get isEmpty(){return 0===this._dataByOrigin.size}get hasHighlights(){return this._hasHighlights}get hasOccludees(){return this._hasOccludees}get hasWater(){return!this.isEmpty&&this.material instanceof _}get rendersOccluded(){return!this.isEmpty&&this.material.renderOccluded!==d.Occlude}get numGeometries(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.instances.size),0))),e}forEachGeometry(e){this._dataByOrigin.forEach((t=>t.buffers.forEach((t=>t.instances.forEach((t=>e(t.geometry)))))))}modify(e){this._updateGeometries(e.updates),this._addAndRemoveGeometries(e.adds,e.removes),this._updateDrawCommands()}_updateGeometries(e){const t=this._bufferWriter,r=t.vertexBufferLayout.stride/4;for(const s of e){const e=s.renderGeometry,i=this._dataByOrigin.get(e.localOrigin.id),a=i?.findBuffer(e.id);if(null==a)return;const o=a.instances.get(e.id);if(s.updateType&(m.GEOMETRY|m.TRANSFORMATION)){const s=V(t.elementCount(o.geometry.geometry)*r),i=t.vertexBufferLayout.createView(s.buffer);this._writeGeometry(e,i,0),a.vao.vertexBuffers.geometry.setSubData(s,o.from*r,0,o.numElements*r),z()}s.updateType&(m.HIGHLIGHT|m.OCCLUDEE|m.VISIBILITY)&&(a.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new s;for(const s of e){const e=s.localOrigin;if(null==e)continue;let t=r.get(e.id,null);null==t&&(t=new D(e.vec3),r.set(e.id,null,t)),t.changes.push(s)}for(const s of t){const e=s.localOrigin;if(null==e)continue;const t=this._dataByOrigin.get(e.id),i=t?.findBuffer(s.id);if(null==i)continue;let a=r.get(e.id,i);null==a&&(a=new D(e.vec3),r.set(e.id,i,a)),a.changes.push(s)}return r}_addAndRemoveGeometries(t,r){const{_bufferWriter:s,_dataByOrigin:i}=this,a=s.vertexBufferLayout.stride/4,o=this._computeDeltas(t,r);o.forEach(((t,r)=>{const n=t.get(null),l=null!=n?n.changes:[];o.delete(r,null);let h=i.get(r);if(t.forEach(((t,n)=>{if(o.delete(r,n),null==n)return void g(!1,"No VAO for removed geometries");if(n.instances.size===t.changes.length)return this._vaoCache.deleteVao(n.vao),e(h.buffers,n),void(0===h.buffers.length&&0===l.length&&i.delete(r));const u=n.numElements,c=n.vao.byteSize/4,f=l.reduce(((e,t)=>e+s.elementCount(t.geometry)),0),d=t.changes.reduce(((e,t)=>e+s.elementCount(t.geometry)),0),m=Math.min((u+f-d)*a,G),p=m>c;m>I&&m<c/2?(t.changes.forEach((({id:e})=>n.deleteInstance(e))),n.instances.forEach((({geometry:e})=>l.push(e))),this._vaoCache.deleteVao(n.vao),e(h.buffers,n)):p?this._applyAndRebuild(n,l,t):this._applyRemoves(n,t)})),l.length>0)for(null==h&&(h=new C(n.origin),i.set(r,h)),h.buffers.forEach((e=>this._applyAdds(e,l)));l.length>0;)h.buffers.push(this._applyAndRebuild(new O,l,null))}))}_updateDrawCommands(){this._hasHighlights=!1,this._hasOccludees=!1,this._dataByOrigin.forEach((e=>{e.buffers.forEach((e=>{e.drawCommandsDirty&&(e.hasHiddenInstances=!1,e.hasHighlights=!1,e.hasOccludees=!1,r(e.instances,(t=>(e.updateDrawState(t),e.hasHiddenInstances&&e.hasHighlights&&e.hasOccludees))),e.updateDrawCommands(this._bufferWriter.vertexBufferLayout.stride)),this._hasHighlights=this._hasHighlights||e.hasHighlights,this._hasOccludees=this._hasOccludees||e.hasOccludees}))}))}_applyAndRebuild(e,t,r){if(null!=r)for(const d of r.changes)e.deleteInstance(d.id);const s=this._bufferWriter,i=s.vertexBufferLayout.stride,a=i/4,o=Math.floor(G/a);let n=e.numElements;for(;t.length>0;){const r=t.pop(),i=s.elementCount(r.geometry);if(n+i>o&&n>0){t.push(r);break}n+=i;const a=new b(r,0,0);g(null==e.instances.get(r.id)),e.addInstance(r.id,a)}const l=n*a,h=V(l),u=s.vertexBufferLayout.createView(h.buffer);let c=0;e.hasHiddenInstances=!1,e.hasHighlights=!1,e.hasOccludees=!1,e.instances.forEach(((t,r)=>{this._writeGeometry(t.geometry,u,c);const i=c;c+=s.elementCount(t.geometry.geometry),e.updateInstance(r,i,c),e.updateDrawState(t)})),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(P(l)),e.vao.vertexBuffers.geometry.setSubData(h,0,0,c*a),z(),e.holes.clear();const f=e.holes.pushNew();return f.from=c,f.to=Math.floor(e.vao.byteSize/i),e.updateDrawCommands(i),e}_applyRemoves(e,t){if(0===t.changes.length)return;for(const o of t.changes){const t=o.id,r=e.instances.get(t);if(!r)continue;e.deleteInstance(t);const s=j.back();if(s){if(s.to===r.from){s.to=r.to;continue}if(s.from===r.to){s.from=r.from;continue}}const i=j.pushNew();i.from=r.from,i.to=r.to}w(j);const r=this._bufferWriter.vertexBufferLayout.stride/4,s=j.reduce(((e,t)=>Math.max(e,t.numElements)),0)*r,i=V(s);i.fill(0,0,s);const a=e.vao.vertexBuffers.geometry;j.forAll((e=>a.setSubData(i,e.from*r,0,e.numElements*r))),z(),e.holes.pushArray(j.data,j.length),j.forAll(((e,t)=>j.data[t]=null)),j.clear(),e.drawCommandsDirty=!0}_applyAdds(e,r){if(0===r.length)return;if(!A(e))return void this._applyAndRebuild(e,r,null);const s=this._bufferWriter,i=s.vertexBufferLayout.stride/4,a=e.numElements,o=r.reduce(((e,t)=>e+s.elementCount(t.geometry)),0),n=Math.min((a+o)*i,G),l=4*n;if(e.vao.byteSize<P(G-I)&&l>e.vao.byteSize)return void this._applyAndRebuild(e,r,null);w(e.holes);const h=new Array;for(const t of r){const r=s.elementCount(t.geometry),i=E(e.holes,r);h.push(i)}const u=e.vao.vertexBuffers.geometry;let c=0,f=0,d=0;const m=V(n),p=s.vertexBufferLayout.createView(m.buffer);r.forEach(((t,r)=>{const a=h[r];if(null==a)return;if(!(d===a)){const e=d-f;e>0&&u.setSubData(m,f*i,0,e*i),f=a,c=0}const o=s.elementCount(t.geometry);this._writeGeometry(t,p,c),c+=o,d=a+o;const n=new b(t,a,a+o);g(null==e.instances.get(t.id)),e.addInstance(t.id,n),e.drawCommandsDirty=!0}));const y=d-f;y>0&&u.setSubData(m,f*i,0,y*i),t(r,((e,t)=>null==h[t])),z()}_writeGeometry(e,t,r){const s=e.localOrigin.vec3;p(S,-s[0],-s[1],-s[2]);const i=a(x,S,e.transformation);o(M,i),n(M,M),this._bufferWriter.write(i,M,e.geometry,t,r)}updateAnimation(e){return this.material.update(e)}requiresSlot(e,t){return this.material.requiresSlot(e,t)}prepareTechnique(e){const{output:t,bindParameters:r}=e;if(!this.requiresSlot(r.slot,t))return null;const s=t===u.Highlight||t===u.ShadowHighlight;if(s&&!this._hasHighlights)return null;const i=t===u.ShadowExcludeHighlight,a=!(s||i);this._appleAmdDriverHelper?.resetIndicesType();for(const o of this._dataByOrigin.values())for(const n of o.buffers){if(s&&!n.hasHighlights)continue;const o=(s?n.drawCommandsHighlight:i&&n.needsMultipleCommands()?n.drawCommandsShadowHighlightRest:n.drawCommandsDefault)||null,l=a&&n.drawCommandsOccludees||null;if(o?.length||l?.length){const s=this._glMaterials.load(e.rctx,r.slot,t),i=null!=s?s.beginSlot(r):null;if(null!=i)return i}}return null}render(e,t){const{output:r,bindParameters:s}=e,i=r===u.Highlight||r===u.ShadowHighlight,a=r===u.ShadowExcludeHighlight,o=!(i||a),n=this._rctx;this._appleAmdDriverHelper?.resetIndicesType(),n.bindTechnique(t,this.material.parameters,s);for(const l of this._dataByOrigin.values())for(const e of l.buffers){if(i&&!e.hasHighlights)continue;const r=(i?e.drawCommandsHighlight:a&&e.needsMultipleCommands()?e.drawCommandsShadowHighlightRest:e.drawCommandsDefault)||null,h=o&&e.drawCommandsOccludees||null;if(r?.length||h?.length){t.program.bindDraw(new y(l.origin),s,this.material.parameters),t.ensureAttributeLocations(e.vao),n.bindVAO(e.vao),r?.length&&(t.bindPipelineState(n,s.slot,!1),r.forAll((e=>n.drawArrays(t.primitiveType,e.first,e.count)))),h?.length&&(t.bindPipelineState(n,s.slot,!0),h.forAll((e=>n.drawArrays(t.primitiveType,e.first,e.count))))}}}get test(){return{material:this.material,glMaterials:this._glMaterials,dataByOrigin:this._dataByOrigin}}}class D{constructor(e){this.origin=e,this.changes=new Array}}function E(e,t){let r;if(!e.some((e=>!(e.numElements<t)&&(r=e,!0))))return null;const s=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),s}const S=l(),x=l(),M=l(),j=new i({allocator:e=>e||new v,deallocator:null}),I=65536,R=4*I,L=1024,T=16777216,G=T/4;let W=new Float32Array(I);function V(e){return W.length<e&&(W=new Float32Array(e)),W}function P(e){const t=4*e;return t<=L?L:t<R?R:Math.max(Math.min(Math.ceil(1.5*t/R)*R,T),t)}function z(){W=new Float32Array(2)}export{B as MergedRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../chunks/vec2.js";import"../../../../chunks/vec2f64.js";import"../../../../chunks/vec4f64.js";import"../../support/engineContent/sdfPrimitives.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/hud/AlignPixel.glsl.js";import"../core/shaderLibrary/hud/HUD.glsl.js";import"../core/shaderLibrary/hud/HUDOcclusionPass.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/AlphaCutoff.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import"../core/shaderLibrary/util/ScreenSizePerspective.glsl.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/ShaderBuilder.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../lib/TransparencyPassType.js";import"../lib/VertexAttribute.js";export{b as build,c as calculateAnchorPosForRendering}from"../../../../chunks/HUDMaterial.glsl.js";
5
+ import"../../../../chunks/vec2.js";import"../../../../chunks/vec2f64.js";import"../../../../chunks/vec4f64.js";import"../../support/engineContent/sdfPrimitives.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/hud/AlignPixel.glsl.js";import"../core/shaderLibrary/hud/HUD.glsl.js";import"../core/shaderLibrary/hud/HUDOcclusionPass.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/AlphaCutoff.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import"../core/shaderLibrary/util/ScreenSizePerspective.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/ShaderBuilder.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../lib/TransparencyPassType.js";import"../lib/VertexAttribute.js";export{b as build,c as calculateAnchorPosForRendering}from"../../../../chunks/HUDMaterial.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{HUDSpace as t}from"../core/shaderLibrary/hud/HUD.glsl.js";import{parameter as i}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TransparencyPassType as s}from"../lib/TransparencyPassType.js";import{DefaultTechniqueConfiguration as r}from"../materials/DefaultTechniqueConfiguration.js";class a extends r{constructor(){super(...arguments),this.output=o.Color,this.screenCenterOffsetUnitsEnabled=t.World,this.transparencyPassType=s.NONE,this.spherical=!1,this.occlusionTestEnabled=!0,this.signedDistanceFieldEnabled=!1,this.vvSize=!1,this.vvColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.debugDrawLabelBorder=!1,this.binaryHighlightOcclusionEnabled=!0,this.hasSlicePlane=!1,this.hasPolygonOffset=!1,this.depthEnabled=!0,this.pixelSnappingEnabled=!0,this.isDraped=!1,this.hasMultipassGeometry=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.occlusionPass=!1,this.objectAndLayerIdColorInstanced=!1}}e([i({count:o.COUNT})],a.prototype,"output",void 0),e([i({count:t.COUNT})],a.prototype,"screenCenterOffsetUnitsEnabled",void 0),e([i({count:s.COUNT})],a.prototype,"transparencyPassType",void 0),e([i()],a.prototype,"spherical",void 0),e([i()],a.prototype,"occlusionTestEnabled",void 0),e([i()],a.prototype,"signedDistanceFieldEnabled",void 0),e([i()],a.prototype,"vvSize",void 0),e([i()],a.prototype,"vvColor",void 0),e([i()],a.prototype,"hasVerticalOffset",void 0),e([i()],a.prototype,"hasScreenSizePerspective",void 0),e([i()],a.prototype,"debugDrawLabelBorder",void 0),e([i()],a.prototype,"binaryHighlightOcclusionEnabled",void 0),e([i()],a.prototype,"hasSlicePlane",void 0),e([i()],a.prototype,"hasPolygonOffset",void 0),e([i()],a.prototype,"depthEnabled",void 0),e([i()],a.prototype,"pixelSnappingEnabled",void 0),e([i()],a.prototype,"isDraped",void 0),e([i()],a.prototype,"hasMultipassGeometry",void 0),e([i()],a.prototype,"hasMultipassTerrain",void 0),e([i()],a.prototype,"cullAboveGround",void 0),e([i()],a.prototype,"occlusionPass",void 0),e([i()],a.prototype,"objectAndLayerIdColorInstanced",void 0),e([i({constValue:!0})],a.prototype,"hasSliceInVertexProgram",void 0),e([i({constValue:!1})],a.prototype,"hasVvInstancing",void 0);export{a as HUDMaterialTechniqueConfiguration};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{HUDSpace as t}from"../core/shaderLibrary/hud/HUD.glsl.js";import{parameter as i}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TransparencyPassType as s}from"../lib/TransparencyPassType.js";import{DefaultTechniqueConfiguration as r}from"../materials/DefaultTechniqueConfiguration.js";class a extends r{constructor(){super(...arguments),this.output=o.Color,this.screenCenterOffsetUnitsEnabled=t.World,this.transparencyPassType=s.NONE,this.spherical=!1,this.occlusionTestEnabled=!0,this.signedDistanceFieldEnabled=!1,this.vvSize=!1,this.vvColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.debugDrawLabelBorder=!1,this.binaryHighlightOcclusionEnabled=!0,this.hasSlicePlane=!1,this.hasPolygonOffset=!1,this.depthEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.hasMultipassGeometry=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.occlusionPass=!1,this.objectAndLayerIdColorInstanced=!1}}e([i({count:o.COUNT})],a.prototype,"output",void 0),e([i({count:t.COUNT})],a.prototype,"screenCenterOffsetUnitsEnabled",void 0),e([i({count:s.COUNT})],a.prototype,"transparencyPassType",void 0),e([i()],a.prototype,"spherical",void 0),e([i()],a.prototype,"occlusionTestEnabled",void 0),e([i()],a.prototype,"signedDistanceFieldEnabled",void 0),e([i()],a.prototype,"vvSize",void 0),e([i()],a.prototype,"vvColor",void 0),e([i()],a.prototype,"hasVerticalOffset",void 0),e([i()],a.prototype,"hasScreenSizePerspective",void 0),e([i()],a.prototype,"debugDrawLabelBorder",void 0),e([i()],a.prototype,"binaryHighlightOcclusionEnabled",void 0),e([i()],a.prototype,"hasSlicePlane",void 0),e([i()],a.prototype,"hasPolygonOffset",void 0),e([i()],a.prototype,"depthEnabled",void 0),e([i()],a.prototype,"pixelSnappingEnabled",void 0),e([i()],a.prototype,"draped",void 0),e([i()],a.prototype,"hasMultipassGeometry",void 0),e([i()],a.prototype,"hasMultipassTerrain",void 0),e([i()],a.prototype,"cullAboveGround",void 0),e([i()],a.prototype,"occlusionPass",void 0),e([i()],a.prototype,"objectAndLayerIdColorInstanced",void 0),e([i({constValue:!0})],a.prototype,"hasSliceInVertexProgram",void 0),e([i({constValue:!1})],a.prototype,"hasVvInstancing",void 0);export{a as HUDMaterialTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/ShaderBuilder.js";import"../lib/VertexAttribute.js";export{b as build}from"../../../../chunks/HeatmapDensity.glsl.js";
5
+ import"../../terrain/Overlay.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/ShaderBuilder.js";import"../lib/VertexAttribute.js";export{b as build}from"../../../../chunks/HeatmapDensity.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{HUDSpace as t}from"../core/shaderLibrary/hud/HUD.glsl.js";import{parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as s}from"../materials/DefaultTechniqueConfiguration.js";class i extends s{constructor(){super(...arguments),this.screenCenterOffsetUnitsEnabled=t.World,this.spherical=!1,this.occlusionTestEnabled=!0,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.depthHudEnabled=!1,this.depthHudAlignStartEnabled=!1,this.hasSlicePlane=!1,this.hasMultipassGeometry=!1}}e([o({count:t.COUNT})],i.prototype,"screenCenterOffsetUnitsEnabled",void 0),e([o()],i.prototype,"spherical",void 0),e([o()],i.prototype,"occlusionTestEnabled",void 0),e([o()],i.prototype,"hasVerticalOffset",void 0),e([o()],i.prototype,"hasScreenSizePerspective",void 0),e([o()],i.prototype,"depthHudEnabled",void 0),e([o()],i.prototype,"depthHudAlignStartEnabled",void 0),e([o()],i.prototype,"hasSlicePlane",void 0),e([o()],i.prototype,"hasMultipassGeometry",void 0),e([o({constValue:!0})],i.prototype,"hasSliceInVertexProgram",void 0),e([o({constValue:!1})],i.prototype,"isDraped",void 0);export{i as LineCalloutTechniqueConfiguration};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{HUDSpace as t}from"../core/shaderLibrary/hud/HUD.glsl.js";import{parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as s}from"../materials/DefaultTechniqueConfiguration.js";class r extends s{constructor(){super(...arguments),this.screenCenterOffsetUnitsEnabled=t.World,this.spherical=!1,this.occlusionTestEnabled=!0,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.depthHudEnabled=!1,this.depthHudAlignStartEnabled=!1,this.hasSlicePlane=!1,this.hasMultipassGeometry=!1}}e([o({count:t.COUNT})],r.prototype,"screenCenterOffsetUnitsEnabled",void 0),e([o()],r.prototype,"spherical",void 0),e([o()],r.prototype,"occlusionTestEnabled",void 0),e([o()],r.prototype,"hasVerticalOffset",void 0),e([o()],r.prototype,"hasScreenSizePerspective",void 0),e([o()],r.prototype,"depthHudEnabled",void 0),e([o()],r.prototype,"depthHudAlignStartEnabled",void 0),e([o()],r.prototype,"hasSlicePlane",void 0),e([o()],r.prototype,"hasMultipassGeometry",void 0),e([o({constValue:!0})],r.prototype,"hasSliceInVertexProgram",void 0),e([o({constValue:!1})],r.prototype,"draped",void 0);export{r as LineCalloutTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{parameter as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TransparencyPassType as r}from"../lib/TransparencyPassType.js";import{DefaultTechniqueConfiguration as i}from"../materials/DefaultTechniqueConfiguration.js";var p,s;!function(o){o[o.Draped=0]="Draped",o[o.Screen=1]="Screen",o[o.World=2]="World",o[o.COUNT=3]="COUNT"}(p||(p={})),function(o){o[o.Center=0]="Center",o[o.Tip=1]="Tip",o[o.COUNT=2]="COUNT"}(s||(s={}));class a extends i{constructor(){super(...arguments),this.output=t.Color,this.transparencyPassType=r.NONE,this.occluder=!1,this.hasSlicePlane=!1,this.writeDepth=!1,this.space=p.Screen,this.hideOnShortSegments=!1,this.hasCap=!1,this.anchor=s.Center,this.hasTip=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1}}o([e({count:t.COUNT})],a.prototype,"output",void 0),o([e({count:r.COUNT})],a.prototype,"transparencyPassType",void 0),o([e()],a.prototype,"occluder",void 0),o([e()],a.prototype,"hasSlicePlane",void 0),o([e()],a.prototype,"writeDepth",void 0),o([e({count:p.COUNT})],a.prototype,"space",void 0),o([e()],a.prototype,"hideOnShortSegments",void 0),o([e()],a.prototype,"hasCap",void 0),o([e({count:s.COUNT})],a.prototype,"anchor",void 0),o([e()],a.prototype,"hasTip",void 0),o([e()],a.prototype,"vvSize",void 0),o([e()],a.prototype,"vvColor",void 0),o([e()],a.prototype,"vvOpacity",void 0),o([e()],a.prototype,"hasOccludees",void 0),o([e()],a.prototype,"hasMultipassTerrain",void 0),o([e()],a.prototype,"cullAboveGround",void 0),o([e({constValue:!0})],a.prototype,"hasVvInstancing",void 0),o([e({constValue:!0})],a.prototype,"hasSliceTranslatedView",void 0);export{s as LineMarkerAnchor,p as LineMarkerSpace,a as LineMarkerTechniqueConfiguration};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{parameter as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TransparencyPassType as r}from"../lib/TransparencyPassType.js";import{DefaultTechniqueConfiguration as i}from"../materials/DefaultTechniqueConfiguration.js";var p,s;!function(t){t[t.Draped=0]="Draped",t[t.Screen=1]="Screen",t[t.World=2]="World",t[t.COUNT=3]="COUNT"}(p||(p={})),function(t){t[t.Center=0]="Center",t[t.Tip=1]="Tip",t[t.COUNT=2]="COUNT"}(s||(s={}));class a extends i{constructor(){super(...arguments),this.output=o.Color,this.transparencyPassType=r.NONE,this.occluder=!1,this.hasSlicePlane=!1,this.writeDepth=!1,this.space=p.Screen,this.hideOnShortSegments=!1,this.hasCap=!1,this.anchor=s.Center,this.hasTip=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1}get draped(){return this.space===p.Draped}}t([e({count:o.COUNT})],a.prototype,"output",void 0),t([e({count:r.COUNT})],a.prototype,"transparencyPassType",void 0),t([e()],a.prototype,"occluder",void 0),t([e()],a.prototype,"hasSlicePlane",void 0),t([e()],a.prototype,"writeDepth",void 0),t([e({count:p.COUNT})],a.prototype,"space",void 0),t([e()],a.prototype,"hideOnShortSegments",void 0),t([e()],a.prototype,"hasCap",void 0),t([e({count:s.COUNT})],a.prototype,"anchor",void 0),t([e()],a.prototype,"hasTip",void 0),t([e()],a.prototype,"vvSize",void 0),t([e()],a.prototype,"vvColor",void 0),t([e()],a.prototype,"vvOpacity",void 0),t([e()],a.prototype,"hasOccludees",void 0),t([e()],a.prototype,"hasMultipassTerrain",void 0),t([e()],a.prototype,"cullAboveGround",void 0),t([e({constValue:!0})],a.prototype,"hasVvInstancing",void 0),t([e({constValue:!0})],a.prototype,"hasSliceTranslatedView",void 0);export{s as LineMarkerAnchor,p as LineMarkerSpace,a as LineMarkerTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{createTask as p}from"../core/asyncUtils.js";import{deprecated as t}from"../core/deprecate.js";import i from"../core/Error.js";import s from"../core/Logger.js";import{eachAlwaysValues as o,throwIfAborted as r}from"../core/promiseUtils.js";import{watch as a,initial as n,whenOnce as u}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{ViewEventPriorities as h}from"./input/InputManager.js";function d(e){return null!=e&&"open"in e&&"declaredClass"in e}function y(e){return null!=e&&"declaredClass"in e&&"dockOptions"in e}const w=w=>{let m=class extends w{constructor(){super(...arguments),this._popupSetupTask=null,this.popup={},this.popupEnabled=!0}initialize(){this.addHandles([a((()=>[this.ui,this.popup]),(([e,p],t)=>{const i="popup",s="manual";if(t){const[e,p]=t;e&&d(p)&&(p.view=null,y(p)&&e.remove(p,i))}e&&d(p)&&(p.view=this,y(p)&&e.add(p,{key:i,position:s}))}),n),this.on("click",(e=>{if(!this.popup||!this.popupEnabled||"mouse"===e.pointerType&&0!==e.button)return;const p="autoOpenEnabled"in this.popup&&!1===this.popup.autoOpenEnabled;!d(this.popup)&&p||(d(this.popup)?this.popup.viewModel.handleViewClick(e):e.async((async()=>{await this.setupPopup(),d(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(e)})))}),h.WIDGET)]),u((()=>this.ready&&this.popupEnabled&&!this.updating)).then((()=>{import("../widgets/Popup.js")}))}destroy(){this.destroyed||this.closePopup()}async openPopup(e){d(this.popup)&&this.popup.open(e);try{if(await this.setupPopup(),!this.popup)return void s.getLogger(this).error(new i("view:null-popup","Popup is null and can't be opened"));this.popup.open(e)}catch{}}closePopup(){this._popupSetupTask?.abort(),d(this.popup)&&this.popup.close()}async fetchPopupFeatures(e,p){await this.when();const{location:t,queryArea:i,layerViewsAndGraphics:s,clientOnlyGraphics:r}=await this._prepareFetchPopupFeatures(e,p),a=Promise.resolve(r),n=this._queryLayerPopupFeatures(i,s,p),u=n.map((e=>e.promise));return{location:t,clientOnlyGraphics:r,allGraphicsPromise:o([a,...u]).then((e=>Array.from(new Set(e.flat())))),promisesPerLayerView:n}}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!d(this.popup))return this._popupSetupTask=p((async e=>{const{default:p}=await import("../widgets/Popup.js");if(r(e),!this.popup||d(this.popup))return;const t=this.popup;delete t.open,delete t.close,this.popup=new p(t)})),this._popupSetupTask.promise}_queryLayerPopupFeatures(e,p,t){return p.map((({layerView:p,graphics:i})=>{const s={clientGraphics:i,event:null!=t?t.event:void 0,signal:null!=t?t.signal:void 0,defaultPopupTemplateEnabled:null!=t&&!!t.defaultPopupTemplateEnabled},o=p.fetchPopupFeatures(e,s);return{layerView:p,promise:o}}))}_isValidPopupGraphic(e,p){return e&&!!e.getEffectivePopupTemplate(null!=p&&p.defaultPopupTemplateEnabled)}async _prepareFetchPopupFeatures(e,p){const{clientGraphics:t,queryArea:i,location:s}=await this._popupHitTestGraphics(e,p),o=this._getFetchPopupLayerViews(),{layerViewsAndGraphics:r,clientOnlyGraphics:a}=this._graphicsPerFetchPopupLayerView(t,o);return{clientOnlyGraphics:a,layerViewsAndGraphics:r,queryArea:i,location:s}}async _popupHitTestGraphics(e,p){const t=await this.popupHitTest(e),i=t.results,s=t.mapPoint,o=i.filter((e=>"graphic"===e.type&&this._isValidPopupGraphic(e.graphic,p))),r=o.length?o[0].mapPoint:null;return{clientGraphics:o.map((e=>e.graphic)),queryArea:s,location:s||r}}_getFetchPopupLayerViews(){const e=[];return this.allLayerViews.forEach((p=>{this._isValidPopupLayerView(p)&&e.push(p)})),null!=this.graphicsView&&this._isValidPopupLayerView(this.graphicsView)&&e.push(this.graphicsView),e.reverse()}_isValidPopupLayerView(e){return null!=e&&(!("layer"in e)||!e.suspended)&&"fetchPopupFeatures"in e}_graphicsPerFetchPopupLayerView(e,p){const t=[],i=new Map,s=p.map((e=>{const p=[];return"layer"in e?i.set(e.layer,p):i.set(e.graphics,p),{layerView:e,graphics:p}}));for(const o of e){const e=i.get(o.layer)||i.get(o.sourceLayer)||null;e?e.push(o):t.push(o)}return{layerViewsAndGraphics:s,clientOnlyGraphics:t}}};return e([l({cast(e){return!e||d(e)||"object"==typeof e&&(e.open=e=>(t(s.getLogger(this),"view.popup is no longer created by default. view.popup.open() will stop working when the popup isn't created",{replacement:"Use view.openPopup() instead.",version:"4.27"}),this.openPopup(e)),e.close=()=>(t(s.getLogger(this),"view.popup is no longer created by default. view.popup.close() will stop working when the popup isn't created",{replacement:"Use view.closePopup() instead.",version:"4.27"}),this.closePopup())),e}})],m.prototype,"popup",void 0),e([l()],m.prototype,"popupEnabled",void 0),m=e([c("esri.views.PopupView")],m),m};export{w as PopupView};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{createTask as p}from"../core/asyncUtils.js";import{deprecated as t}from"../core/deprecate.js";import i from"../core/Error.js";import s from"../core/Logger.js";import{eachAlwaysValues as o,throwIfAborted as r}from"../core/promiseUtils.js";import{watch as a,initial as u,whenOnce as n}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{ViewEventPriorities as h}from"./input/InputManager.js";function d(e){return null!=e&&"open"in e&&"declaredClass"in e}function y(e){return null!=e&&"declaredClass"in e&&"dockOptions"in e}const w=w=>{let m=class extends w{constructor(){super(...arguments),this._popupSetupTask=null,this.popup={},this.popupEnabled=!0}initialize(){this.addHandles([a((()=>[this.ui,this.popup]),(([e,p],t)=>{const i="popup",s="manual";if(t){const[e,p]=t;e&&d(p)&&(p.view=null,y(p)&&e.remove(p,i))}e&&d(p)&&(p.view=this,y(p)&&e.add(p,{key:i,position:s}))}),u),this.on("click",(e=>{this.popup&&this.popupEnabled&&("mouse"!==e.pointerType||0===e.button)&&(!d(this.popup)&&"autoOpenEnabled"in this.popup&&!1===this.popup.autoOpenEnabled||(d(this.popup)?this.popup.viewModel.handleViewClick(e):e.async((async()=>{await this.setupPopup(),d(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(e)}))))}),h.WIDGET)]),n((()=>this.ready&&this.popupEnabled&&!this.updating)).then((()=>{import("../widgets/Popup.js")}))}destroy(){this.destroyed||this.closePopup()}async openPopup(e){d(this.popup)&&this.popup.open(e);try{if(await this.setupPopup(),!this.popup)return void s.getLogger(this).error(new i("view:null-popup","Popup is null and can't be opened"));this.popup.open(e)}catch{}}closePopup(){this._popupSetupTask?.abort(),d(this.popup)&&this.popup.close()}async fetchPopupFeatures(e,p){await this.when();const{location:t,queryArea:i,layerViewsAndGraphics:s,clientOnlyGraphics:r}=await this._prepareFetchPopupFeatures(e,p),a=Promise.resolve(r),u=this._queryLayerPopupFeatures(i,s,p),n=u.map((e=>e.promise));return{location:t,clientOnlyGraphics:r,allGraphicsPromise:o([a,...n]).then((e=>Array.from(new Set(e.flat())))),promisesPerLayerView:u}}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!d(this.popup))return this._popupSetupTask=p((async e=>{const{default:p}=await import("../widgets/Popup.js");if(r(e),!this.popup||d(this.popup))return;const t=this.popup;delete t.open,delete t.close,this.popup=new p(t)})),this._popupSetupTask.promise}_queryLayerPopupFeatures(e,p,t){return p.map((({layerView:p,graphics:i})=>{const s={clientGraphics:i,event:null!=t?t.event:void 0,signal:null!=t?t.signal:void 0,defaultPopupTemplateEnabled:null!=t&&!!t.defaultPopupTemplateEnabled},o=p.fetchPopupFeatures(e,s);return{layerView:p,promise:o}}))}_isValidPopupGraphic(e,p){return e&&!!e.getEffectivePopupTemplate(null!=p&&p.defaultPopupTemplateEnabled)}async _prepareFetchPopupFeatures(e,p){const{clientGraphics:t,queryArea:i,location:s}=await this._popupHitTestGraphics(e,p),o=this._getFetchPopupLayerViews(),{layerViewsAndGraphics:r,clientOnlyGraphics:a}=this._graphicsPerFetchPopupLayerView(t,o);return{clientOnlyGraphics:a,layerViewsAndGraphics:r,queryArea:i,location:s}}async _popupHitTestGraphics(e,p){const t=await this.popupHitTest(e),i=t.results,s=t.mapPoint,o=i.filter((e=>"graphic"===e.type&&this._isValidPopupGraphic(e.graphic,p))),r=o.length?o[0].mapPoint:null;return{clientGraphics:o.map((e=>e.graphic)),queryArea:s,location:s||r}}_getFetchPopupLayerViews(){const e=[];return this.allLayerViews.forEach((p=>{this._isValidPopupLayerView(p)&&e.push(p)})),null!=this.graphicsView&&this._isValidPopupLayerView(this.graphicsView)&&e.push(this.graphicsView),e.reverse()}_isValidPopupLayerView(e){return null!=e&&(!("layer"in e)||!e.suspended)&&"fetchPopupFeatures"in e}_graphicsPerFetchPopupLayerView(e,p){const t=[],i=new Map,s=p.map((e=>{const p=[];return"layer"in e?i.set(e.layer,p):i.set(e.graphics,p),{layerView:e,graphics:p}}));for(const o of e){const e=i.get(o.layer)||i.get(o.sourceLayer)||null;e?e.push(o):t.push(o)}return{layerViewsAndGraphics:s,clientOnlyGraphics:t}}};return e([l({cast(e){return!e||d(e)||"object"==typeof e&&(e.open=e=>(t(s.getLogger(this),"view.popup is no longer created by default. view.popup.open() will stop working when the popup isn't created",{replacement:"Use view.openPopup() instead.",version:"4.27"}),this.openPopup(e)),e.close=()=>(t(s.getLogger(this),"view.popup is no longer created by default. view.popup.close() will stop working when the popup isn't created",{replacement:"Use view.closePopup() instead.",version:"4.27"}),this.closePopup())),e}})],m.prototype,"popup",void 0),e([l()],m.prototype,"popupEnabled",void 0),m=e([c("esri.views.PopupView")],m),m};export{w as PopupView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{TextureDescriptor as t}from"./TextureDescriptor.js";class e extends t{constructor(t,e){super(),this.context=t,Object.assign(this,e)}static validate(t,s){return new e(t,s)}}export{e as ValidatedTextureDescriptor};
5
+ import{SizedPixelFormat as s,PixelFormat as e}from"./enums.js";import{TextureDescriptor as t}from"./TextureDescriptor.js";class a extends t{constructor(t,a){switch(super(),this.context=t,Object.assign(this,a),this.internalFormat){case s.R16F:case s.R16I:case s.R16UI:case s.R32F:case s.R32I:case s.R32UI:case s.R8_SNORM:case s.R8:case s.R8I:case s.R8UI:this.pixelFormat=e.RED}}static validate(s,e){return new a(s,e)}}export{a as ValidatedTextureDescriptor};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import"../../intl.js";import s from"../../core/Collection.js";import{HandleOwnerMixin as i}from"../../core/HandleOwner.js";import r from"../../core/Handles.js";import{debounce as o,ignoreAbortErrors as l}from"../../core/promiseUtils.js";import{on as n,watch as a}from"../../core/reactiveUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{getLowerCaseDefaultHiddenFields as m}from"../../layers/support/fieldUtils.js";import{highlightsSupported as g}from"../../views/support/layerViewUtils.js";import c from"./AttachmentsColumn.js";import u from"./FieldColumn.js";import p from"./Grid/Column.js";import y from"./Grid/Grid.js";import f from"./Grid/GridViewModel.js";import b from"./Grid/GroupColumn.js";import _ from"./support/FeatureStore.js";import"../support/widgetUtils.js";import{messageBundle as w}from"../support/decorators/messageBundle.js";import{onLocaleChange as C}from"../../intl/locale.js";import{fetchMessageBundle as I}from"../../intl/messages.js";let v=class extends(i(f)){constructor(e){super(e),this._debounceRefresh=o((()=>this._refresh())),this._highlights=new r,this.activeFilters=new s,this.autoRefreshEnabled=!0,this.cellClassNameGenerator=(e,t)=>e.path||null,this.columns=new s,this.dataProvider=async(e,t)=>{const{store:s}=this,{page:i,pageSize:r,sortOrders:o}=e,l=this._sortOrdersToLayerOrderByFields(o);t&&(s?(await s.set({orderByFields:l}),"loaded"!==s.state&&"loading"!==s.state&&await s.load(),t&&t(await s.fetchItems({page:i,pageSize:r}))):t&&t([]))},this.editingEnabled=!1,this.fieldConfigs=null,this.grid=null,this.highlightEnabled=!0,this.itemIdPath="objectId",this.messagesCommon=null,this.messagesURIUtils=null,this.relatedRecordsEnabled=!1,this.store=null,this.tableTemplate=null,this.view=null,this._onLayerRefresh=this._onLayerRefresh.bind(this),this._set("store",new _),this._set("grid",new y({itemIdPath:this.itemIdPath,viewModel:this}))}initialize(){const e=async()=>{this.messages=await I("esri/widgets/FeatureTable/t9n/FeatureTable"),this.messagesCommon=await I("esri/t9n/common"),this.messagesURIUtils=await I("esri/widgets/support/t9n/uriUtils")};e(),this.handles.add([C((()=>{e(),this._generateColumns()})),n((()=>this.highlightIds),"change",(e=>this._onHighlightIdsChange(e)),{onListenerAdd:()=>{this.highlightIds.forEach((e=>this._highlight(e)))},onListenerRemove:()=>{this.highlightIds.forEach((e=>this._unhighlight(e)))}}),a((()=>this.layerView),(()=>{this._highlights.removeAll(),this.layerView&&this.highlightEnabled&&this.highlightIds?.forEach((e=>this._highlight(e)))})),a((()=>this.highlightEnabled),(()=>{this._highlights.removeAll(),this.highlightEnabled&&this.highlightIds?.forEach((e=>this._highlight(e)))})),a((()=>this.relatedRecordsEnabled),(e=>this.store.relatedRecordsEnabled=e)),a((()=>this.layer?.loaded),(e=>e&&this._onLayerLoad())),a((()=>this.store.state),(e=>{"loaded"===e&&this.grid?.scrollToTop()})),a((()=>[this.messages,this.tableTemplate,this.fieldConfigs]),(()=>this.layer?.loaded&&this._generateColumns())),a((()=>this.editingEnabled),(e=>{this.columns.forEach((t=>{"editingEnabled"in t&&(t.editingEnabled=e)})),this.grid?.onColumnChange()})),a((()=>this.layer?.definitionExpression),((e,t)=>(e||t)&&"loaded"===this.store.state&&this.reset())),a((()=>this.layer&&"timeExtent"in this.layer&&this.layer.timeExtent),((e,t)=>(e||t)&&!this.timeExtent&&"loaded"===this.store.state&&this.reset())),n((()=>this.layer),"refresh",(e=>this._onLayerRefresh(e)))])}destroy(){this._resetColumns(),this.handles.removeAll(),this._highlights.removeAll(),this._highlights.destroy(),this.grid?.destroy(),this.columns?.destroy(),this.layer=null,this.view=null}get _defaultHiddenFields(){return m(this.layer)}get activeSortOrders(){return this.grid?.sortOrders?this.grid.sortOrders.map((({path:e,direction:t})=>({fieldName:e,direction:t}))):[]}set attachmentsEnabled(e){this.attachmentsEnabled!==e&&(this._set("attachmentsEnabled",e),this._generateColumns(),this.store.attachmentsEnabled=e)}set filterGeometry(e){if(!this.filterGeometry&&!e)return;const t=this.activeFilters.find((e=>"geometry"===e.type));t&&this.activeFilters.remove(t),this._set("filterGeometry",e),this.store.filterGeometry=e,e&&this.activeFilters.add({type:"geometry",geometry:e})}get hiddenFields(){return this._get("hiddenFields")??new s}set hiddenFields(e){Array.isArray(e)?this._set("hiddenFields",new s(e)):this._set("hiddenFields",e)}get highlightOnRowSelectEnabled(){return this.highlightEnabled}set highlightOnRowSelectEnabled(e){this.highlightEnabled=e}set layer(e){this._set("layer",e),this.grid?.clearSort(),this._resetColumns(),this.store.layer=e,e&&(e.loaded?this._onLayerLoad():e.load()),this.notifyChange("state")}get layerView(){return this.view?.allLayerViews.find((e=>e.layer===this.layer))||null}set messages(e){this.grid?.set("messages",e),this._set("messages",e)}get state(){const{store:e}=this;return e&&"disabled"!==e.state?"loading"===e.state?"loading":"loaded"===e.state?"loaded":"ready":"disabled"}set timeExtent(e){this._set("timeExtent",e),this.store.timeExtent=e}clearHighlights(){this._highlights.removeAll()}clearSelection(){this.grid?.clearSelection()}async deleteSelection(){const e=this.highlightIds.toArray();if(!e?.length)return;const{deleteFeatureResults:t}=await this.store.deleteRowsByObjectId(e),s=t.filter((e=>!e.error)).map((e=>e.objectId));s.length&&(this.deselectRows(s),await this.refresh())}deselectRows(e){const t=this._getStoreItemsFromSelectionParams(e);this.grid?.deselectRows(t)}filterBySelection(){const e=this.highlightIds.toArray();e.length&&(this.clearSelectionFilter(),this.store.objectIds=e,this.activeFilters.add({type:"selection",objectIds:e}))}getObjectIdIndex(e){return this.store?.getObjectIdIndex(e)}getValue(e,t){const s=this.store.getItemByObjectId(e);return s?.feature?.attributes[t]}get highlightIds(){return this._get("highlightIds")||new s}set highlightIds(e){Array.isArray(e)?this._set("highlightIds",new s(e)):this._set("highlightIds",e)}async refresh(){return l(this._debounceRefresh())}reset(){this.grid?.reset()}selectRows(e){const t=this._getStoreItemsFromSelectionParams(e);return this.grid?.selectRows(t)}scrollToIndex(e){this.grid?.scrollToIndex(e)}clearSelectionFilter(){this.store.objectIds=null;const e=this.activeFilters.find((e=>"selection"===e.type));e&&this.activeFilters.remove(e)}zoomToSelection(){const{layer:e,view:t}=this,s=this.highlightIds.toArray();if(!e||!t||!s.length)return;const i=e.createQuery();i.objectIds=s,i.returnGeometry=!0,e.queryFeatures(i).then((e=>{t.goTo(e.features).catch((e=>{"AbortError"!==e.name&&console.error(e)}))}))}async _refresh(){await this.store.refreshLayerInfo();const e=this.highlightIds.toArray();if(e.length){(await this.store.verifyFeaturesByObjectId(e)).forEach(((t,s)=>{t||this.deselectRows(e[s])}))}this.grid?.refreshPageCache()}_onLayerLoad(){const e=this.layer.capabilities?.query.maxRecordCount;e&&e<this.pageSize&&this.grid&&(this.grid.pageSize=e),this._generateColumns()}_onLayerRefresh(e){this.autoRefreshEnabled&&e.dataChanged&&this.refresh()}_generateColumns(){this._resetColumns();const e=[],t=this.tableTemplate?.columnTemplates?this._generateColumnsFromTemplates(this.tableTemplate.columnTemplates):this.fieldConfigs?.length?this._generateColumnsFromConfigs():this._generateDefaultFieldColumns();e.push(...t),this.attachmentsEnabled&&e.push(this._generateDefaultAttachmentColumn()),this.columns.addMany([...e])}_generateColumnsFromTemplates(e){const{editingEnabled:t,grid:s,layer:i,messages:r,messagesCommon:o,messagesURIUtils:l,store:n,tableTemplate:a}=this,h=this.layer?.fields??[],d=e=>{const t="fieldName"in e&&e.fieldName?.toLowerCase();return h.find((e=>t===e.name?.toLowerCase()))};return e.filter((e=>null!=d(e)||"group"===e.type&&"columnTemplates"in e)).map((e=>{if("fieldName"in e){const h=d(e),m=!1===e.visible||!0!==e.visible&&this._isFieldHidden(h?.name),{direction:g,formatFunction:c,initialSortPriority:p,menuConfig:y,textAlign:f}=e;return new u({direction:g,editingEnabled:t,expressionInfos:a?.expressionInfos||null,field:h,formatFunction:c,grid:s,hidden:m,initialSortPriority:p,layer:i,messages:r,messagesCommon:o,messagesURIUtils:l,menuConfig:y,store:n,template:e,textAlign:f})}if("group"===e.type&&"columnTemplates"in e){const t=this._generateColumnsFromTemplates(e.columnTemplates),s=!1===e.visible||!0!==e.visible&&this._isFieldHidden(e.label),{label:i}=e;return new b({header:i,columns:t,hidden:s})}return new p({...e})}))}_generateColumnsFromConfigs(){const{editingEnabled:e,fieldConfigs:t,grid:s,layer:i,messages:r,messagesCommon:o,messagesURIUtils:l,store:n}=this;if(!t)return[];const a=this.layer?.fields??[],h=e=>{const t=e.name?.toLocaleLowerCase();return a.find((e=>t===e.name?.toLowerCase()))};return t.filter(h).map((t=>{const a=t.direction||null,d=t.formatFunction||null,m=t.textAlign||null,g=null!=t.initialSortPriority?t.initialSortPriority:null,c=h(t),p=!1===t.visible||!0!==t.visible&&this._isFieldHidden(c?.name),y=t.menuConfig||null;return new u({config:t,direction:a,editingEnabled:e,field:c,formatFunction:d,grid:s,hidden:p,layer:i,store:n,messages:r,messagesCommon:o,messagesURIUtils:l,menuConfig:y,textAlign:m,initialSortPriority:g})}))}_generateDefaultFieldColumns(){const{editingEnabled:e,grid:t,layer:s,messages:i,messagesCommon:r,messagesURIUtils:o,store:l}=this;return(this.layer?.fields??[]).map((n=>new u({editingEnabled:e,field:n,grid:t,hidden:this._isFieldHidden(n.name),layer:s,store:l,messages:i,messagesCommon:r,messagesURIUtils:o})))}_generateDefaultAttachmentColumn(){return new c({header:this.messages?.attachments})}_sortOrdersToLayerOrderByFields(e){return e&&e.length?e.filter(((e,t,s)=>s.map((e=>e.path)).indexOf(e.path)===t)).filter((({direction:e})=>!!e)).map((({direction:e,path:t})=>t+" "+e?.toUpperCase())):[]}_isFieldHidden(e){const t=e?.toLowerCase();return(this.hiddenFields??this._defaultHiddenFields).some((e=>e.toLowerCase()===t))}_highlight(e){this.layerView&&g(this.layerView)&&this._highlights.add(this.layerView.highlight(e),e)}_unhighlight(e){this._highlights.remove(e)}_getStoreItemsFromSelectionParams(e){const s=[];return(e=e instanceof Array?e:[e]).forEach((e=>{let i=e instanceof t?e:null;const r=i?i.getObjectId():e;if("number"==typeof r||"string"==typeof r){if(!i){const e=this.store.getItemByObjectId(r);e&&(i=e.feature)}s.push({objectId:r,feature:i})}})),s}_onHighlightIdsChange(e){const{highlightEnabled:t}=this,{added:s,removed:i}=e;t&&(s.forEach((e=>this._highlight(e))),i.forEach((e=>this._unhighlight(e))))}_resetColumns(){this.columns.items.forEach((e=>e.destroy())),this.columns.removeAll()}};e([h()],v.prototype,"_defaultHiddenFields",null),e([h({readOnly:!0})],v.prototype,"activeFilters",void 0),e([h({readOnly:!0})],v.prototype,"activeSortOrders",null),e([h()],v.prototype,"attachmentsEnabled",null),e([h()],v.prototype,"autoRefreshEnabled",void 0),e([h()],v.prototype,"cellClassNameGenerator",void 0),e([h({readOnly:!0})],v.prototype,"columns",void 0),e([h()],v.prototype,"dataProvider",void 0),e([h()],v.prototype,"editingEnabled",void 0),e([h()],v.prototype,"fieldConfigs",void 0),e([h()],v.prototype,"filterGeometry",null),e([h({readOnly:!0})],v.prototype,"grid",void 0),e([h()],v.prototype,"hiddenFields",null),e([h()],v.prototype,"highlightEnabled",void 0),e([h()],v.prototype,"highlightOnRowSelectEnabled",null),e([h({readOnly:!0})],v.prototype,"itemIdPath",void 0),e([h()],v.prototype,"layer",null),e([h()],v.prototype,"layerView",null),e([h()],v.prototype,"messages",null),e([h(),w("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([h(),w("esri/widgets/support/t9n/uriUtils")],v.prototype,"messagesURIUtils",void 0),e([h()],v.prototype,"relatedRecordsEnabled",void 0),e([h({readOnly:!0})],v.prototype,"state",null),e([h({readOnly:!0,type:_})],v.prototype,"store",void 0),e([h()],v.prototype,"tableTemplate",void 0),e([h()],v.prototype,"timeExtent",null),e([h()],v.prototype,"view",void 0),e([h()],v.prototype,"highlightIds",null),v=e([d("esri.widgets.FeatureTable.FeatureTableViewModel")],v);const E=v;export{E as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import"../../intl.js";import s from"../../core/Collection.js";import{HandleOwnerMixin as i}from"../../core/HandleOwner.js";import r from"../../core/Handles.js";import{debounce as o,ignoreAbortErrors as l}from"../../core/promiseUtils.js";import{on as n,watch as a}from"../../core/reactiveUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{getLowerCaseDefaultHiddenFields as m}from"../../layers/support/fieldUtils.js";import{highlightsSupported as g}from"../../views/support/layerViewUtils.js";import c from"./AttachmentsColumn.js";import u from"./FieldColumn.js";import p from"./Grid/Column.js";import y from"./Grid/Grid.js";import f from"./Grid/GridViewModel.js";import b from"./Grid/GroupColumn.js";import _ from"./support/FeatureStore.js";import"../support/widgetUtils.js";import{messageBundle as w}from"../support/decorators/messageBundle.js";import{onLocaleChange as C}from"../../intl/locale.js";import{fetchMessageBundle as E}from"../../intl/messages.js";let I=class extends(i(f)){constructor(e){super(e),this._debounceRefresh=o((()=>this._refresh())),this._highlights=new r,this.activeFilters=new s,this.autoRefreshEnabled=!0,this.cellClassNameGenerator=(e,t)=>e.path||null,this.columns=new s,this.dataProvider=async(e,t)=>{const{store:s}=this,{page:i,pageSize:r,sortOrders:o}=e,l=this._sortOrdersToLayerOrderByFields(o);t&&(s?(await s.set({orderByFields:l}),"loaded"!==s.state&&"loading"!==s.state&&await s.load(),t&&t(await s.fetchItems({page:i,pageSize:r}))):t&&t([]))},this.editingEnabled=!1,this.fieldConfigs=null,this.grid=null,this.highlightEnabled=!0,this.itemIdPath="objectId",this.messagesCommon=null,this.messagesURIUtils=null,this.relatedRecordsEnabled=!1,this.returnGeometryEnabled=!1,this.store=null,this.tableTemplate=null,this.view=null,this._onLayerRefresh=this._onLayerRefresh.bind(this),this._set("store",new _),this._set("grid",new y({itemIdPath:this.itemIdPath,viewModel:this}))}initialize(){const e=async()=>{this.messages=await E("esri/widgets/FeatureTable/t9n/FeatureTable"),this.messagesCommon=await E("esri/t9n/common"),this.messagesURIUtils=await E("esri/widgets/support/t9n/uriUtils")};e(),this.handles.add([C((()=>{e(),this._generateColumns()})),n((()=>this.highlightIds),"change",(e=>this._onHighlightIdsChange(e)),{onListenerAdd:()=>{this.highlightIds.forEach((e=>this._highlight(e)))},onListenerRemove:()=>{this.highlightIds.forEach((e=>this._unhighlight(e)))}}),a((()=>this.layerView),(()=>{this._highlights.removeAll(),this.layerView&&this.highlightEnabled&&this.highlightIds?.forEach((e=>this._highlight(e)))})),a((()=>this.highlightEnabled),(()=>{this._highlights.removeAll(),this.highlightEnabled&&this.highlightIds?.forEach((e=>this._highlight(e)))})),a((()=>this.relatedRecordsEnabled),(e=>this.store.relatedRecordsEnabled=e)),a((()=>this.returnGeometryEnabled),(e=>this.store.returnGeometry=e)),a((()=>this.layer?.loaded),(e=>e&&this._onLayerLoad())),a((()=>this.store.state),(e=>{"loaded"===e&&this.grid?.scrollToTop()})),a((()=>[this.messages,this.tableTemplate,this.fieldConfigs]),(()=>this.layer?.loaded&&this._generateColumns())),a((()=>this.editingEnabled),(e=>{this.columns.forEach((t=>{"editingEnabled"in t&&(t.editingEnabled=e)})),this.grid?.onColumnChange()})),a((()=>this.layer?.definitionExpression),((e,t)=>(e||t)&&"loaded"===this.store.state&&this.reset())),a((()=>this.layer&&"timeExtent"in this.layer&&this.layer.timeExtent),((e,t)=>(e||t)&&!this.timeExtent&&"loaded"===this.store.state&&this.reset())),n((()=>this.layer),"refresh",(e=>this._onLayerRefresh(e)))])}destroy(){this._resetColumns(),this.handles.removeAll(),this._highlights.removeAll(),this._highlights.destroy(),this.grid?.destroy(),this.columns?.destroy(),this.layer=null,this.view=null}get _defaultHiddenFields(){return m(this.layer)}get activeSortOrders(){return this.grid?.sortOrders?this.grid.sortOrders.map((({path:e,direction:t})=>({fieldName:e,direction:t}))):[]}set attachmentsEnabled(e){this.attachmentsEnabled!==e&&(this._set("attachmentsEnabled",e),this._generateColumns(),this.store.attachmentsEnabled=e)}set filterGeometry(e){if(!this.filterGeometry&&!e)return;const t=this.activeFilters.find((e=>"geometry"===e.type));t&&this.activeFilters.remove(t),this._set("filterGeometry",e),this.store.filterGeometry=e,e&&this.activeFilters.add({type:"geometry",geometry:e})}get hiddenFields(){return this._get("hiddenFields")??new s}set hiddenFields(e){Array.isArray(e)?this._set("hiddenFields",new s(e)):this._set("hiddenFields",e)}get highlightOnRowSelectEnabled(){return this.highlightEnabled}set highlightOnRowSelectEnabled(e){this.highlightEnabled=e}set layer(e){this._set("layer",e),this.grid?.clearSort(),this._resetColumns(),this.store.layer=e,e&&(e.loaded?this._onLayerLoad():e.load()),this.notifyChange("state")}get layerView(){return this.view?.allLayerViews.find((e=>e.layer===this.layer))||null}set messages(e){this.grid?.set("messages",e),this._set("messages",e)}get state(){const{store:e}=this;return e&&"disabled"!==e.state?"loading"===e.state?"loading":"loaded"===e.state?"loaded":"ready":"disabled"}set timeExtent(e){this._set("timeExtent",e),this.store.timeExtent=e}clearHighlights(){this._highlights.removeAll()}clearSelection(){this.grid?.clearSelection()}async deleteSelection(){const e=this.highlightIds.toArray();if(!e?.length)return;const{deleteFeatureResults:t}=await this.store.deleteRowsByObjectId(e),s=t.filter((e=>!e.error)).map((e=>e.objectId));s.length&&(this.deselectRows(s),await this.refresh())}deselectRows(e){const t=this._getStoreItemsFromSelectionParams(e);this.grid?.deselectRows(t)}filterBySelection(){const e=this.highlightIds.toArray();e.length&&(this.clearSelectionFilter(),this.store.objectIds=e,this.activeFilters.add({type:"selection",objectIds:e}))}getObjectIdIndex(e){return this.store?.getObjectIdIndex(e)}getValue(e,t){const s=this.store.getItemByObjectId(e);return s?.feature?.attributes[t]}get highlightIds(){return this._get("highlightIds")||new s}set highlightIds(e){Array.isArray(e)?this._set("highlightIds",new s(e)):this._set("highlightIds",e)}async refresh(){return l(this._debounceRefresh())}reset(){this.grid?.reset()}selectRows(e){const t=this._getStoreItemsFromSelectionParams(e);return this.grid?.selectRows(t)}scrollToIndex(e){this.grid?.scrollToIndex(e)}clearSelectionFilter(){this.store.objectIds=null;const e=this.activeFilters.find((e=>"selection"===e.type));e&&this.activeFilters.remove(e)}zoomToSelection(){const{layer:e,view:t}=this,s=this.highlightIds.toArray();if(!e||!t||!s.length)return;const i=e.createQuery();i.objectIds=s,i.returnGeometry=!0,e.queryFeatures(i).then((e=>{t.goTo(e.features).catch((e=>{"AbortError"!==e.name&&console.error(e)}))}))}async _refresh(){await this.store.refreshLayerInfo();const e=this.highlightIds.toArray();if(e.length){(await this.store.verifyFeaturesByObjectId(e)).forEach(((t,s)=>{t||this.deselectRows(e[s])}))}this.grid?.refreshPageCache()}_onLayerLoad(){const e=this.layer.capabilities?.query.maxRecordCount;e&&e<this.pageSize&&this.grid&&(this.grid.pageSize=e),this._generateColumns()}_onLayerRefresh(e){this.autoRefreshEnabled&&e.dataChanged&&this.refresh()}_generateColumns(){this._resetColumns();const e=[],t=this.tableTemplate?.columnTemplates?this._generateColumnsFromTemplates(this.tableTemplate.columnTemplates):this.fieldConfigs?.length?this._generateColumnsFromConfigs():this._generateDefaultFieldColumns();e.push(...t),e.length&&this.attachmentsEnabled&&e.push(this._generateDefaultAttachmentColumn()),this.columns.addMany([...e])}_generateColumnsFromTemplates(e){const{editingEnabled:t,grid:s,layer:i,messages:r,messagesCommon:o,messagesURIUtils:l,store:n,tableTemplate:a}=this,h=this.layer?.fields??[],d=e=>{const t="fieldName"in e&&e.fieldName?.toLowerCase();return h.find((e=>t===e.name?.toLowerCase()))};return e.filter((e=>null!=d(e)||"group"===e.type&&"columnTemplates"in e)).map((e=>{if("fieldName"in e){const h=d(e),m=!1===e.visible||!0!==e.visible&&this._isFieldHidden(h?.name),{direction:g,formatFunction:c,initialSortPriority:p,menuConfig:y,textAlign:f}=e;return new u({direction:g,editingEnabled:t,expressionInfos:a?.expressionInfos||null,field:h,formatFunction:c,grid:s,hidden:m,initialSortPriority:p,layer:i,messages:r,messagesCommon:o,messagesURIUtils:l,menuConfig:y,store:n,template:e,textAlign:f})}if("group"===e.type&&"columnTemplates"in e){const t=this._generateColumnsFromTemplates(e.columnTemplates),s=!1===e.visible||!0!==e.visible&&this._isFieldHidden(e.label),{label:i}=e;return new b({header:i,columns:t,hidden:s})}return new p({...e})}))}_generateColumnsFromConfigs(){const{editingEnabled:e,fieldConfigs:t,grid:s,layer:i,messages:r,messagesCommon:o,messagesURIUtils:l,store:n}=this;if(!t)return[];const a=this.layer?.fields??[],h=e=>{const t=e.name?.toLocaleLowerCase();return a.find((e=>t===e.name?.toLowerCase()))};return t.filter(h).map((t=>{const a=t.direction||null,d=t.formatFunction||null,m=t.textAlign||null,g=null!=t.initialSortPriority?t.initialSortPriority:null,c=h(t),p=!1===t.visible||!0!==t.visible&&this._isFieldHidden(c?.name),y=t.menuConfig||null;return new u({config:t,direction:a,editingEnabled:e,field:c,formatFunction:d,grid:s,hidden:p,layer:i,store:n,messages:r,messagesCommon:o,messagesURIUtils:l,menuConfig:y,textAlign:m,initialSortPriority:g})}))}_generateDefaultFieldColumns(){const{editingEnabled:e,grid:t,layer:s,messages:i,messagesCommon:r,messagesURIUtils:o,store:l}=this;return(this.layer?.fields??[]).map((n=>new u({editingEnabled:e,field:n,grid:t,hidden:this._isFieldHidden(n.name),layer:s,store:l,messages:i,messagesCommon:r,messagesURIUtils:o})))}_generateDefaultAttachmentColumn(){return new c({header:this.messages?.attachments})}_sortOrdersToLayerOrderByFields(e){return e&&e.length?e.filter(((e,t,s)=>s.map((e=>e.path)).indexOf(e.path)===t)).filter((({direction:e})=>!!e)).map((({direction:e,path:t})=>t+" "+e?.toUpperCase())):[]}_isFieldHidden(e){const t=e?.toLowerCase();return(this.hiddenFields??this._defaultHiddenFields).some((e=>e.toLowerCase()===t))}_highlight(e){this.layerView&&g(this.layerView)&&this._highlights.add(this.layerView.highlight(e),e)}_unhighlight(e){this._highlights.remove(e)}_getStoreItemsFromSelectionParams(e){const s=[];return(e=e instanceof Array?e:[e]).forEach((e=>{let i=e instanceof t?e:null;const r=i?i.getObjectId():e;if("number"==typeof r||"string"==typeof r){if(!i){const e=this.store.getItemByObjectId(r);e&&(i=e.feature)}s.push({objectId:r,feature:i})}})),s}_onHighlightIdsChange(e){const{highlightEnabled:t}=this,{added:s,removed:i}=e;t&&(s.forEach((e=>this._highlight(e))),i.forEach((e=>this._unhighlight(e))))}_resetColumns(){this.columns.items.forEach((e=>e.destroy())),this.columns.removeAll()}};e([h()],I.prototype,"_defaultHiddenFields",null),e([h({readOnly:!0})],I.prototype,"activeFilters",void 0),e([h({readOnly:!0})],I.prototype,"activeSortOrders",null),e([h()],I.prototype,"attachmentsEnabled",null),e([h()],I.prototype,"autoRefreshEnabled",void 0),e([h()],I.prototype,"cellClassNameGenerator",void 0),e([h({readOnly:!0})],I.prototype,"columns",void 0),e([h()],I.prototype,"dataProvider",void 0),e([h()],I.prototype,"editingEnabled",void 0),e([h()],I.prototype,"fieldConfigs",void 0),e([h()],I.prototype,"filterGeometry",null),e([h({readOnly:!0})],I.prototype,"grid",void 0),e([h()],I.prototype,"hiddenFields",null),e([h()],I.prototype,"highlightEnabled",void 0),e([h()],I.prototype,"highlightOnRowSelectEnabled",null),e([h({readOnly:!0})],I.prototype,"itemIdPath",void 0),e([h()],I.prototype,"layer",null),e([h()],I.prototype,"layerView",null),e([h()],I.prototype,"messages",null),e([h(),w("esri/t9n/common")],I.prototype,"messagesCommon",void 0),e([h(),w("esri/widgets/support/t9n/uriUtils")],I.prototype,"messagesURIUtils",void 0),e([h()],I.prototype,"relatedRecordsEnabled",void 0),e([h()],I.prototype,"returnGeometryEnabled",void 0),e([h({readOnly:!0})],I.prototype,"state",null),e([h({readOnly:!0,type:_})],I.prototype,"store",void 0),e([h()],I.prototype,"tableTemplate",void 0),e([h()],I.prototype,"timeExtent",null),e([h()],I.prototype,"view",void 0),e([h()],I.prototype,"highlightIds",null),I=e([d("esri.widgets.FeatureTable.FeatureTableViewModel")],I);const v=I;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.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{deprecatedFunction as t}from"../core/deprecate.js";import{HandleOwnerMixin as i}from"../core/HandleOwner.js";import l from"../core/Logger.js";import{on as s,watch as o}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import{cast as r}from"../core/accessorSupport/decorators/cast.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import a from"./Widget.js";import h from"./FeatureTable/FeatureTableViewModel.js";import c from"./FeatureTable/Grid/support/ButtonMenu.js";import m from"./FeatureTable/Grid/support/ButtonMenuItem.js";import{loadCalciteComponents as u}from"./support/componentsUtils.js";import{Heading as g}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as p}from"./support/decorators/messageBundle.js";import{tsx as v}from"./support/jsxFactory.js";import{substitute as w}from"../intl/substitute.js";const b={header:!0,menu:!0,menuItems:{clearSelection:!0,refreshData:!0,toggleColumns:!0,selectedRecordsShowAllToggle:!0,selectedRecordsShowSelectedToggle:!0,zoomToSelection:!0,deleteSelection:!0},selectionColumn:!0,columnMenus:!0},M="esri-feature-table",y=`${M}__prompt`,f={base:M,header:`${M}__header`,title:`${M}__title`,content:`${M}__content`,loader:`${M}__loader`,loaderContainer:`${M}__loader-container`,menuContainer:`${M}__menu`,menuIcon:"esri-icon-handle-horizontal",menuItemGroupOpenedIcon:"esri-icon-down",menuItemGroupClosedIcon:"esri-icon-right",checkmarkIcon:"esri-icon-check-mark",promptContainer:y,promptHeader:`${y}__header`,promptHeading:`${y}__header__heading`,promptMessage:`${y}__message`,promptDivider:`${y}__divider`,promptActions:`${y}__actions`,widget:"esri-widget"},_=l.getLogger("esri.widgets.FeatureTable");let E=class extends(i(a)){constructor(e,t){super(e,t),this._prompt=null,this.menu=null,this.menuConfig=null,this.viewModel=new h,this.visibleElements={...b},this._showDeletePrompt=this._showDeletePrompt.bind(this),this._onDeleteSelectionClick=this._onDeleteSelectionClick.bind(this)}initialize(){this.handles.add([s((()=>this.viewModel.columns),"change",(()=>this._syncMenuConfig())),s((()=>this.viewModel.activeFilters),"change",(()=>this._syncMenuConfig())),s((()=>this.highlightIds),"change",(e=>{this._syncMenuConfig(),this._onSelectionChange(e)})),o((()=>[this.viewModel.store.querying,this.viewModel.store.syncing,this.editingEnabled]),(()=>this.scheduleRender())),o((()=>[this.menuConfig,this.editingEnabled]),(()=>this._syncMenuConfig())),o((()=>this.messages),(()=>{this.menu&&(this.menu.label=this.messages?.options),this._syncMenuConfig()}))]),this._set("menu",new c({label:this.messages?.options,iconClass:f.menuIcon,...this.menuConfig}));const{attachmentsEnabled:e,relatedRecordsEnabled:t}=this;this.viewModel?.store?.set({attachmentsEnabled:e,relatedRecordsEnabled:t})}loadDependencies(){return u({button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim.js")})}destroy(){this._prompt=null,this.handles.removeAll(),this.menu?.destroy()}get activeFilters(){return this.viewModel.activeFilters}get activeSortOrders(){return this.viewModel.activeSortOrders}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get autoRefreshEnabled(){return this.viewModel.autoRefreshEnabled}set autoRefreshEnabled(e){this.viewModel.autoRefreshEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get columns(){return this.viewModel.columns}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get fieldConfigs(){return this.viewModel.fieldConfigs??[]}set fieldConfigs(e){this.viewModel.fieldConfigs=e}get filterGeometry(){return this.viewModel.filterGeometry}set filterGeometry(e){this.viewModel.filterGeometry=e}get grid(){return this.viewModel.grid}get hiddenFields(){return this.viewModel.hiddenFields}set hiddenFields(e){this.viewModel.hiddenFields=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get highlightOnRowSelectEnabled(){return this.viewModel.highlightEnabled}set highlightOnRowSelectEnabled(e){this.viewModel.highlightEnabled=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get messages(){return this.viewModel.messages}set messages(e){this.viewModel.messages=e}get messagesCommon(){return this.viewModel.messagesCommon}set messagesCommon(e){this.viewModel.messagesCommon=e}get messagesURIUtils(){return this.viewModel.messagesURIUtils}set messagesURIUtils(e){this.viewModel.messagesURIUtils=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get relatedRecordsEnabled(){return this.viewModel.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.viewModel.relatedRecordsEnabled=e}get state(){return this.viewModel.state}get tableTemplate(){return this.viewModel.tableTemplate}set tableTemplate(e){this.viewModel.tableTemplate=e}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(e){this.viewModel.timeExtent=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}castVisibleElements(e){const t={...b,...e};return this.grid?.set("visibleElements",{...this.grid.visibleElements,selectionColumn:t.selectionColumn,columnMenus:t.columnMenus}),t}clearHighlights(){return t(_,"`FeatureTable.clearHighlights` is deprecated in favor of FeatureTable.highlightIds'",{replacement:"FeatureTable.highlightIds",version:"4.25",see:"https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html#highlightIds"}),this.viewModel.clearHighlights()}clearSelection(){return t(_,"`FeatureTable.clearSelection` is deprecated in favor of FeatureTable.highlightIds'",{replacement:"FeatureTable.highlightIds",version:"4.25",see:"https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html#highlightIds"}),this.viewModel.clearSelection()}clearSelectionFilter(){return this.viewModel.clearSelectionFilter()}deleteSelection(e){return this.highlightIds.length?e?(this._showDeletePrompt(),this.scheduleRender(),Promise.resolve()):this.viewModel.deleteSelection():Promise.resolve()}deselectRows(e){return this.viewModel.deselectRows(e)}filterBySelection(){return this.viewModel.filterBySelection()}findColumn(e){return this.viewModel.findColumn(e)}hideColumn(e){this.grid?.hideColumn(e),this._syncMenuConfig()}refresh(){return this.viewModel.refresh()}showAllColumns(){return this.viewModel.showAllColumns()}showColumn(e){this.grid?.showColumn(e),this._syncMenuConfig()}sortColumn(e,t){return this.viewModel.sortColumn(e,t)}selectRows(e){return this.viewModel.selectRows(e)}scrollToIndex(e){return this.viewModel.scrollToIndex(e)}zoomToSelection(){return this.viewModel.zoomToSelection()}render(){const{_prompt:e}=this,t=null!=e?v("calcite-scrim",null,this.renderPrompt(e)):null;return v("div",{bind:this,class:this.classes(f.base,f.widget)},this.visibleElements.header?this._renderHeader():null,v("div",{class:f.content},"disabled"!==this.state&&this.grid?.render()),t)}renderPrompt({title:e,message:t,context:i,actions:l}){const s=v("calcite-button",{appearance:"solid",kind:"danger"===i?"danger":"brand",width:l.secondary?"half":"full",onclick:l.primary.action,key:"prompt-primary-button"},l.primary.label),o=l.secondary?v("calcite-button",{appearance:"outline",kind:"danger"===i?"danger":"brand",width:"half",onclick:l.secondary.action,key:"prompt-secondary-button"},l.secondary.label):null;return v("div",{class:`${f.promptContainer}--${i}`},v("div",{class:f.promptHeader},v("calcite-icon",{icon:"exclamation-mark-triangle"}),v(g,{class:f.promptHeading,level:2},e)),v("div",{class:f.promptMessage},t),v("div",{class:f.promptDivider}),v("div",{class:f.promptActions},o,s))}_renderHeader(){return v("div",{key:"header",class:f.header},this._renderLoader(),this._renderTitle(),this.visibleElements.menu?this._renderMenu():null)}_renderTitle(){return v("div",{class:f.title,key:"title"},this._getTitle())}_getTitle(){const{grid:e,highlightIds:t,layer:i,messages:l,viewModel:{size:s}}=this;return e&&i?w(l.header,{title:i.title,count:s,selected:t.length||0}):""}_renderLoader(){const{state:e,store:t}=this.viewModel,i="loading"===e||t.syncing||t.querying;return v("div",{class:f.loaderContainer},i?v("div",{class:f.loader,key:"loader"}):null)}_renderMenu(){return v("div",{class:f.menuContainer},this.menu?.render())}_onSelectionChange(e){const{added:t,removed:i}=e,l=t.map((e=>this.viewModel.store.getLocalItemByKey(e)||{objectId:e,feature:null,attachments:null,relatedRecords:null})),s=i.map((e=>this.viewModel.store.getLocalItemByKey(e)||{objectId:e,feature:null,attachments:null,relatedRecords:null}));this.emit("selection-change",{added:l,removed:s})}_syncMenuConfig(){this.menu?.set({...this.menuConfig,items:this._getMenuItems()})}_getMenuItems(){const e=this.menuConfig?.items,t=this._getDefaultMenuItems(),i=[];return t?.length&&i.push(...t),e?.length&&i.push(...e),i}_getDefaultMenuItems(){const{highlightIds:e,messages:t,viewModel:i,visibleElements:l}=this,{menuItems:s}=l,o=[];if(s?.refreshData&&o.push(new m({selectionEnabled:!1,label:t?.refreshData,clickFunction:()=>this.refresh()})),e.length){const i=this._getSelectionFilter();if(s?.clearSelection&&o.push(new m({selectionEnabled:!1,label:t?.clearSelection,clickFunction:()=>this.highlightIds?.removeAll()})),s?.zoomToSelection&&this.view&&o.push(new m({selectionEnabled:!1,label:t?.zoomToSelection,clickFunction:()=>this.viewModel.zoomToSelection()})),s?.selectedRecordsShowSelectedToggle&&(!i||e.length!==i.objectIds.length)){const e=t.showSelected,i=new m({selectionEnabled:!1,label:e,clickFunction:()=>{this.filterBySelection(),i.set("label",e)}});o.push(i)}s?.deleteSelection&&this.editingEnabled&&this.layer?.capabilities?.operations?.supportsDelete&&o.push(new m({selectionEnabled:!1,label:t.deleteSelection,clickFunction:this._showDeletePrompt}))}if(s?.selectedRecordsShowAllToggle&&this._hasSelectionFilter()){const e=t.showAllRecords,i=new m({selectionEnabled:!1,label:e,clickFunction:()=>{this.clearSelectionFilter(),i.set("label",e)}});o.push(i)}return s?.toggleColumns&&o.push(new m({iconClass:f.menuItemGroupClosedIcon,label:t?.toggleColumns,clickFunction:this._toggleMenuItemSelectedIcon,items:i?.columns?.items.map((({header:e,hidden:t,path:i})=>new m({label:e||i,selected:!t,selectionEnabled:!0,iconClass:f.checkmarkIcon,clickFunction:()=>this._toggleColumnFromMenuItem(i)})))})),o.length?o:null}_toggleMenuItemSelectedIcon({item:e}){e?.set("iconClass",e?.selected?f.menuItemGroupOpenedIcon:f.menuItemGroupClosedIcon)}_toggleColumnFromMenuItem(e){const{grid:t,viewModel:i}=this,l=i.findColumn(e);l?.hidden?t?.showColumn(e):t?.hideColumn(e)}_showDeletePrompt(){const{messages:e,messagesCommon:t}=this,i=this.highlightIds.length||0,l=w(e.deleteSelectionCount,{count:i});this.menu&&(this.menu.open=!1),this._prompt={title:l,message:e.deleteRecordsRemoved,context:"danger",actions:{primary:{label:t.delete,action:this._onDeleteSelectionClick},secondary:{label:e.keepRecords,action:()=>this._prompt=null}}}}async _onDeleteSelectionClick(){await this.viewModel.deleteSelection(),this._prompt=null}_getSelectionFilter(){return this.viewModel.activeFilters?.find((e=>"selection"===e.type))}_hasSelectionFilter(){return!!this._getSelectionFilter()}};e([n({readOnly:!0})],E.prototype,"activeFilters",null),e([n({readOnly:!0})],E.prototype,"activeSortOrders",null),e([n()],E.prototype,"attachmentsEnabled",null),e([n()],E.prototype,"autoRefreshEnabled",null),e([n()],E.prototype,"columnReorderingEnabled",null),e([n({readOnly:!0})],E.prototype,"columns",null),e([n()],E.prototype,"editingEnabled",null),e([n()],E.prototype,"fieldConfigs",null),e([n()],E.prototype,"filterGeometry",null),e([n({readOnly:!0})],E.prototype,"grid",null),e([n()],E.prototype,"hiddenFields",null),e([n()],E.prototype,"highlightEnabled",null),e([n()],E.prototype,"highlightIds",null),e([n()],E.prototype,"highlightOnRowSelectEnabled",null),e([n()],E.prototype,"label",null),e([n()],E.prototype,"layer",null),e([n(),p("esri/widgets/FeatureTable/t9n/FeatureTable")],E.prototype,"messages",null),e([n(),p("esri/t9n/common")],E.prototype,"messagesCommon",null),e([n(),p("esri/widgets/support/t9n/uriUtils")],E.prototype,"messagesURIUtils",null),e([n({readOnly:!0})],E.prototype,"menu",void 0),e([n()],E.prototype,"menuConfig",void 0),e([n()],E.prototype,"multiSortEnabled",null),e([n()],E.prototype,"pageSize",null),e([n()],E.prototype,"relatedRecordsEnabled",null),e([n({readOnly:!0})],E.prototype,"state",null),e([n()],E.prototype,"tableTemplate",null),e([n()],E.prototype,"timeExtent",null),e([n()],E.prototype,"view",null),e([n()],E.prototype,"viewModel",void 0),e([n()],E.prototype,"visibleElements",void 0),e([r("visibleElements")],E.prototype,"castVisibleElements",null),E=e([d("esri.widgets.FeatureTable")],E);const C=E;export{C as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{deprecatedFunction as t}from"../core/deprecate.js";import{HandleOwnerMixin as i}from"../core/HandleOwner.js";import l from"../core/Logger.js";import{on as s,watch as o}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import{cast as r}from"../core/accessorSupport/decorators/cast.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import a from"./Widget.js";import h from"./FeatureTable/FeatureTableViewModel.js";import c from"./FeatureTable/Grid/support/ButtonMenu.js";import m from"./FeatureTable/Grid/support/ButtonMenuItem.js";import{loadCalciteComponents as u}from"./support/componentsUtils.js";import{Heading as g}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as p}from"./support/decorators/messageBundle.js";import{tsx as v}from"./support/jsxFactory.js";import{substitute as b}from"../intl/substitute.js";const w={header:!0,menu:!0,menuItems:{clearSelection:!0,refreshData:!0,toggleColumns:!0,selectedRecordsShowAllToggle:!0,selectedRecordsShowSelectedToggle:!0,zoomToSelection:!0,deleteSelection:!0},selectionColumn:!0,columnMenus:!0},M="esri-feature-table",y=`${M}__prompt`,f={base:M,header:`${M}__header`,title:`${M}__title`,content:`${M}__content`,loader:`${M}__loader`,loaderContainer:`${M}__loader-container`,menuContainer:`${M}__menu`,menuIcon:"esri-icon-handle-horizontal",menuItemGroupOpenedIcon:"esri-icon-down",menuItemGroupClosedIcon:"esri-icon-right",checkmarkIcon:"esri-icon-check-mark",promptContainer:y,promptHeader:`${y}__header`,promptHeading:`${y}__header__heading`,promptMessage:`${y}__message`,promptDivider:`${y}__divider`,promptActions:`${y}__actions`,widget:"esri-widget"},_=l.getLogger("esri.widgets.FeatureTable");let E=class extends(i(a)){constructor(e,t){super(e,t),this._prompt=null,this.menu=null,this.menuConfig=null,this.viewModel=new h,this.visibleElements={...w},this._showDeletePrompt=this._showDeletePrompt.bind(this),this._onDeleteSelectionClick=this._onDeleteSelectionClick.bind(this)}initialize(){this.handles.add([s((()=>this.viewModel.columns),"change",(()=>this._syncMenuConfig())),s((()=>this.viewModel.activeFilters),"change",(()=>this._syncMenuConfig())),s((()=>this.highlightIds),"change",(e=>{this._syncMenuConfig(),this._onSelectionChange(e)})),o((()=>[this.viewModel.store.querying,this.viewModel.store.syncing,this.editingEnabled]),(()=>this.scheduleRender())),o((()=>[this.menuConfig,this.editingEnabled]),(()=>this._syncMenuConfig())),o((()=>this.messages),(()=>{this.menu&&(this.menu.label=this.messages?.options),this._syncMenuConfig()}))]),this._set("menu",new c({label:this.messages?.options,iconClass:f.menuIcon,...this.menuConfig}));const{attachmentsEnabled:e,relatedRecordsEnabled:t}=this;this.viewModel?.store?.set({attachmentsEnabled:e,relatedRecordsEnabled:t})}loadDependencies(){return u({button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim.js")})}destroy(){this._prompt=null,this.handles.removeAll(),this.menu?.destroy()}get activeFilters(){return this.viewModel.activeFilters}get activeSortOrders(){return this.viewModel.activeSortOrders}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get autoRefreshEnabled(){return this.viewModel.autoRefreshEnabled}set autoRefreshEnabled(e){this.viewModel.autoRefreshEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get columns(){return this.viewModel.columns}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get fieldConfigs(){return this.viewModel.fieldConfigs??[]}set fieldConfigs(e){this.viewModel.fieldConfigs=e}get filterGeometry(){return this.viewModel.filterGeometry}set filterGeometry(e){this.viewModel.filterGeometry=e}get grid(){return this.viewModel.grid}get hiddenFields(){return this.viewModel.hiddenFields}set hiddenFields(e){this.viewModel.hiddenFields=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get highlightOnRowSelectEnabled(){return this.viewModel.highlightEnabled}set highlightOnRowSelectEnabled(e){this.viewModel.highlightEnabled=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get messages(){return this.viewModel.messages}set messages(e){this.viewModel.messages=e}get messagesCommon(){return this.viewModel.messagesCommon}set messagesCommon(e){this.viewModel.messagesCommon=e}get messagesURIUtils(){return this.viewModel.messagesURIUtils}set messagesURIUtils(e){this.viewModel.messagesURIUtils=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get relatedRecordsEnabled(){return this.viewModel.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.viewModel.relatedRecordsEnabled=e}get state(){return this.viewModel.state}get tableTemplate(){return this.viewModel.tableTemplate}set tableTemplate(e){this.viewModel.tableTemplate=e}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(e){this.viewModel.timeExtent=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}castVisibleElements(e){const t={...w,...e};return this.grid?.set("visibleElements",{...this.grid.visibleElements,selectionColumn:t.selectionColumn,columnMenus:t.columnMenus}),t}clearHighlights(){return t(_,"`FeatureTable.clearHighlights` is deprecated in favor of FeatureTable.highlightIds'",{replacement:"FeatureTable.highlightIds",version:"4.25",see:"https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html#highlightIds"}),this.viewModel.clearHighlights()}clearSelection(){return t(_,"`FeatureTable.clearSelection` is deprecated in favor of FeatureTable.highlightIds'",{replacement:"FeatureTable.highlightIds",version:"4.25",see:"https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html#highlightIds"}),this.viewModel.clearSelection()}clearSelectionFilter(){return this.viewModel.clearSelectionFilter()}deleteSelection(e){return this.highlightIds.length?e?(this._showDeletePrompt(),this.scheduleRender(),Promise.resolve()):this.viewModel.deleteSelection():Promise.resolve()}deselectRows(e){return this.viewModel.deselectRows(e)}filterBySelection(){return this.viewModel.filterBySelection()}findColumn(e){return this.viewModel.findColumn(e)}hideColumn(e){this.grid?.hideColumn(e),this._syncMenuConfig()}refresh(){return this.viewModel.refresh()}get returnGeometryEnabled(){return this.viewModel.returnGeometryEnabled}set returnGeometryEnabled(e){this.viewModel.returnGeometryEnabled=e}showAllColumns(){return this.viewModel.showAllColumns()}showColumn(e){this.grid?.showColumn(e),this._syncMenuConfig()}sortColumn(e,t){return this.viewModel.sortColumn(e,t)}selectRows(e){return this.viewModel.selectRows(e)}scrollToIndex(e){return this.viewModel.scrollToIndex(e)}zoomToSelection(){return this.viewModel.zoomToSelection()}render(){const{_prompt:e}=this,t=null!=e?v("calcite-scrim",null,this.renderPrompt(e)):null;return v("div",{bind:this,class:this.classes(f.base,f.widget)},this.visibleElements.header?this._renderHeader():null,v("div",{class:f.content},"disabled"!==this.state&&this.grid?.render()),t)}renderPrompt({title:e,message:t,context:i,actions:l}){const s=v("calcite-button",{appearance:"solid",kind:"danger"===i?"danger":"brand",width:l.secondary?"half":"full",onclick:l.primary.action,key:"prompt-primary-button"},l.primary.label),o=l.secondary?v("calcite-button",{appearance:"outline",kind:"danger"===i?"danger":"brand",width:"half",onclick:l.secondary.action,key:"prompt-secondary-button"},l.secondary.label):null;return v("div",{class:`${f.promptContainer}--${i}`},v("div",{class:f.promptHeader},v("calcite-icon",{icon:"exclamation-mark-triangle"}),v(g,{class:f.promptHeading,level:2},e)),v("div",{class:f.promptMessage},t),v("div",{class:f.promptDivider}),v("div",{class:f.promptActions},o,s))}_renderHeader(){return v("div",{key:"header",class:f.header},this._renderLoader(),this._renderTitle(),this.visibleElements.menu?this._renderMenu():null)}_renderTitle(){return v("div",{class:f.title,key:"title"},this._getTitle())}_getTitle(){const{grid:e,highlightIds:t,layer:i,messages:l,viewModel:{size:s}}=this;return e&&i?b(l.header,{title:i.title,count:s,selected:t.length||0}):""}_renderLoader(){const{state:e,store:t}=this.viewModel,i="loading"===e||t.syncing||t.querying;return v("div",{class:f.loaderContainer},i?v("div",{class:f.loader,key:"loader"}):null)}_renderMenu(){return v("div",{class:f.menuContainer},this.menu?.render())}_onSelectionChange(e){const{added:t,removed:i}=e,l=t.map((e=>this.viewModel.store.getLocalItemByKey(e)||{objectId:e,feature:null,attachments:null,relatedRecords:null})),s=i.map((e=>this.viewModel.store.getLocalItemByKey(e)||{objectId:e,feature:null,attachments:null,relatedRecords:null}));this.emit("selection-change",{added:l,removed:s})}_syncMenuConfig(){this.menu?.set({...this.menuConfig,items:this._getMenuItems()})}_getMenuItems(){const e=this.menuConfig?.items,t=this._getDefaultMenuItems(),i=[];return t?.length&&i.push(...t),e?.length&&i.push(...e),i}_getDefaultMenuItems(){const{highlightIds:e,messages:t,viewModel:i,visibleElements:l}=this,{menuItems:s}=l,o=[];if(s?.refreshData&&o.push(new m({selectionEnabled:!1,label:t?.refreshData,clickFunction:()=>this.refresh()})),e.length){const i=this._getSelectionFilter();if(s?.clearSelection&&o.push(new m({selectionEnabled:!1,label:t?.clearSelection,clickFunction:()=>this.highlightIds?.removeAll()})),s?.zoomToSelection&&this.view&&o.push(new m({selectionEnabled:!1,label:t?.zoomToSelection,clickFunction:()=>this.viewModel.zoomToSelection()})),s?.selectedRecordsShowSelectedToggle&&(!i||e.length!==i.objectIds.length)){const e=t.showSelected,i=new m({selectionEnabled:!1,label:e,clickFunction:()=>{this.filterBySelection(),i.set("label",e)}});o.push(i)}s?.deleteSelection&&this.editingEnabled&&this.layer?.capabilities?.operations?.supportsDelete&&o.push(new m({selectionEnabled:!1,label:t.deleteSelection,clickFunction:this._showDeletePrompt}))}if(s?.selectedRecordsShowAllToggle&&this._hasSelectionFilter()){const e=t.showAllRecords,i=new m({selectionEnabled:!1,label:e,clickFunction:()=>{this.clearSelectionFilter(),i.set("label",e)}});o.push(i)}return s?.toggleColumns&&o.push(new m({iconClass:f.menuItemGroupClosedIcon,label:t?.toggleColumns,clickFunction:this._toggleMenuItemSelectedIcon,items:i?.columns?.items.map((({header:e,hidden:t,path:i})=>new m({label:e||i,selected:!t,selectionEnabled:!0,iconClass:f.checkmarkIcon,clickFunction:()=>this._toggleColumnFromMenuItem(i)})))})),o.length?o:null}_toggleMenuItemSelectedIcon({item:e}){e?.set("iconClass",e?.selected?f.menuItemGroupOpenedIcon:f.menuItemGroupClosedIcon)}_toggleColumnFromMenuItem(e){const{grid:t,viewModel:i}=this,l=i.findColumn(e);l?.hidden?t?.showColumn(e):t?.hideColumn(e)}_showDeletePrompt(){const{messages:e,messagesCommon:t}=this,i=this.highlightIds.length||0,l=b(e.deleteSelectionCount,{count:i});this.menu&&(this.menu.open=!1),this._prompt={title:l,message:e.deleteRecordsRemoved,context:"danger",actions:{primary:{label:t.delete,action:this._onDeleteSelectionClick},secondary:{label:e.keepRecords,action:()=>this._prompt=null}}}}async _onDeleteSelectionClick(){await this.viewModel.deleteSelection(),this._prompt=null}_getSelectionFilter(){return this.viewModel.activeFilters?.find((e=>"selection"===e.type))}_hasSelectionFilter(){return!!this._getSelectionFilter()}};e([n({readOnly:!0})],E.prototype,"activeFilters",null),e([n({readOnly:!0})],E.prototype,"activeSortOrders",null),e([n()],E.prototype,"attachmentsEnabled",null),e([n()],E.prototype,"autoRefreshEnabled",null),e([n()],E.prototype,"columnReorderingEnabled",null),e([n({readOnly:!0})],E.prototype,"columns",null),e([n()],E.prototype,"editingEnabled",null),e([n()],E.prototype,"fieldConfigs",null),e([n()],E.prototype,"filterGeometry",null),e([n({readOnly:!0})],E.prototype,"grid",null),e([n()],E.prototype,"hiddenFields",null),e([n()],E.prototype,"highlightEnabled",null),e([n()],E.prototype,"highlightIds",null),e([n()],E.prototype,"highlightOnRowSelectEnabled",null),e([n()],E.prototype,"label",null),e([n()],E.prototype,"layer",null),e([n(),p("esri/widgets/FeatureTable/t9n/FeatureTable")],E.prototype,"messages",null),e([n(),p("esri/t9n/common")],E.prototype,"messagesCommon",null),e([n(),p("esri/widgets/support/t9n/uriUtils")],E.prototype,"messagesURIUtils",null),e([n({readOnly:!0})],E.prototype,"menu",void 0),e([n()],E.prototype,"menuConfig",void 0),e([n()],E.prototype,"multiSortEnabled",null),e([n()],E.prototype,"pageSize",null),e([n()],E.prototype,"relatedRecordsEnabled",null),e([n({readOnly:!0})],E.prototype,"state",null),e([n()],E.prototype,"tableTemplate",null),e([n()],E.prototype,"timeExtent",null),e([n()],E.prototype,"view",null),e([n()],E.prototype,"viewModel",void 0),e([n()],E.prototype,"visibleElements",void 0),e([r("visibleElements")],E.prototype,"castVisibleElements",null),e([n()],E.prototype,"returnGeometryEnabled",null),E=e([d("esri.widgets.FeatureTable")],E);const C=E;export{C as default};