@arcgis/core 5.1.0-next.52 → 5.1.0-next.53

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 (113) hide show
  1. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/009db7b459b18f6a668b.js +1 -0
  4. package/assets/esri/core/workers/chunks/{386435341e949f5573b4.js → 0fc60b4c44c4e865b699.js} +2 -2
  5. package/assets/esri/core/workers/chunks/199f70c0373f6008a545.js +1 -0
  6. package/assets/esri/core/workers/chunks/{d2af5342fbe80e2d8c60.js → 20f9f3470cad47d01803.js} +1 -1
  7. package/assets/esri/core/workers/chunks/2757cf54656b5d318b11.js +1 -0
  8. package/assets/esri/core/workers/chunks/2aaeaf022af8493281dc.js +1 -0
  9. package/assets/esri/core/workers/chunks/34fe4570eef9e73839b8.js +1 -0
  10. package/assets/esri/core/workers/chunks/{7480bd6f892abf444cac.js → 3c9e1ec94bbcbf494916.js} +3 -3
  11. package/assets/esri/core/workers/chunks/40bcfc4f8efe7de7ec9d.js +1 -0
  12. package/assets/esri/core/workers/chunks/{cc1f3a2f281a2f6e0f94.js → 4d54beab8ae5ff31e7b0.js} +1 -1
  13. package/assets/esri/core/workers/chunks/55bb5b7817c2963c8bfa.js +1 -0
  14. package/assets/esri/core/workers/chunks/{39f3bea123f20c816ab2.js → 662932d2effd2b384b9e.js} +1 -1
  15. package/assets/esri/core/workers/chunks/7d56b2ac5030dd8b748e.js +1 -0
  16. package/assets/esri/core/workers/chunks/{720a33a7f118d2769133.js → 851dd71d28681d4eccfd.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{88c6cc90606409b5c884.js → 87d2021e91d025a2a142.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{fe7dec83e40014c55a6b.js → 96e799ca97989a6ed448.js} +1 -1
  19. package/assets/esri/core/workers/chunks/9db2ff1d4cbb5d1b623e.js +1 -0
  20. package/assets/esri/core/workers/chunks/a462aa1c7b68efad6906.js +1 -0
  21. package/assets/esri/core/workers/chunks/{f5fd59291cb161fdc05b.js → a787fe09d3df9d4254ba.js} +1 -1
  22. package/assets/esri/core/workers/chunks/a971e61336f455b953d5.js +1 -0
  23. package/assets/esri/core/workers/chunks/b2b77598048818c957b7.js +1 -0
  24. package/assets/esri/core/workers/chunks/{3fa5f102b6f77c523a76.js → b3e5dcb530cef678c8f8.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{daf65bccc45dc5c400ae.js → c460ca93ed8e20d8b53a.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{3fcc8c455af56ae89030.js → ccf845ac0ac354507a25.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{c48d1ee37c207bfb0aac.js → dd319d5fe89b275e93cf.js} +1 -1
  28. package/assets/esri/core/workers/chunks/ec91d5081f423755cb07.js +1 -0
  29. package/assets/esri/core/workers/chunks/{eb36417edc11fa80e312.js → ee8cd91c27e9cdfc3b2e.js} +1 -1
  30. package/assets/esri/core/workers/chunks/f8eb14170f927aecfbc8.js +1 -0
  31. package/assets/esri/core/workers/chunks/{792219a079c28bcdc003.js → fcfaaced184f8da3e28d.js} +1 -1
  32. package/config.js +1 -1
  33. package/core/arrayUtils.js +1 -1
  34. package/core/maybe.js +1 -1
  35. package/kernel.js +1 -1
  36. package/layers/FeatureLayer.js +1 -1
  37. package/layers/OrientedImageryLayer.js +1 -1
  38. package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
  39. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  40. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  41. package/layers/knowledgeGraph/nodeMovementUtils.js +1 -1
  42. package/layers/mixins/ArcGISImageService.js +1 -1
  43. package/layers/mixins/FeatureLayerBase.js +1 -1
  44. package/layers/raster/datasets/FunctionRaster.js +1 -1
  45. package/layers/raster/functions/AspectFunction.js +1 -1
  46. package/layers/raster/functions/BaseRasterFunction.js +1 -1
  47. package/layers/raster/functions/ConvolutionFunction.js +1 -1
  48. package/layers/raster/functions/CurvatureFunction.js +1 -1
  49. package/layers/raster/functions/HillshadeFunction.js +1 -1
  50. package/layers/raster/functions/ShadedReliefFunction.js +1 -1
  51. package/layers/raster/functions/SlopeFunction.js +1 -1
  52. package/layers/raster/functions/StatisticsFunction.js +1 -1
  53. package/layers/raster/functions/pixelUtils.js +1 -1
  54. package/layers/support/capabilities.js +1 -1
  55. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  56. package/package.json +3 -3
  57. package/support/revision.js +1 -1
  58. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  59. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  60. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  61. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  62. package/views/3d/layers/I3SMeshView3D.js +1 -1
  63. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  64. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  65. package/views/3d/support/ResourceController.js +1 -1
  66. package/views/3d/terrain/OverlayRenderer.js +1 -1
  67. package/views/3d/webgl/ManagedFBO.d.ts +1 -0
  68. package/views/3d/webgl/ManagedFBOResource.d.ts +1 -0
  69. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  70. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
  71. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  72. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  73. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  74. package/views/3d/webgl-engine/core/FBOCacheUsage.js +1 -1
  75. package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
  76. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  77. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  78. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  79. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  80. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  81. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  82. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  83. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  84. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  85. package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
  86. package/views/3d/webgl-engine/materials/TriangleTechniqueConfiguration.js +1 -1
  87. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  88. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  89. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  90. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  91. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  92. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +1 -1
  93. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  94. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  95. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  96. package/views/3d/webgl.js +1 -1
  97. package/views/webgl/Program.js +1 -1
  98. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  99. package/assets/esri/core/workers/chunks/0b661b90f7ee3ae23425.js +0 -1
  100. package/assets/esri/core/workers/chunks/167e4ff7cbc88b42db71.js +0 -1
  101. package/assets/esri/core/workers/chunks/1a481f3ae3146682eb00.js +0 -1
  102. package/assets/esri/core/workers/chunks/30654845ca1334f1c206.js +0 -1
  103. package/assets/esri/core/workers/chunks/34207774bc371e95ba3c.js +0 -1
  104. package/assets/esri/core/workers/chunks/35dbe1eeb6932b03aea2.js +0 -1
  105. package/assets/esri/core/workers/chunks/380bb57bccc266d6442a.js +0 -1
  106. package/assets/esri/core/workers/chunks/5351e71ce7839636d06d.js +0 -1
  107. package/assets/esri/core/workers/chunks/55edd712c6d2d044e550.js +0 -1
  108. package/assets/esri/core/workers/chunks/64da1ad9df9094ef5c12.js +0 -1
  109. package/assets/esri/core/workers/chunks/666f201d222c50ab8428.js +0 -1
  110. package/assets/esri/core/workers/chunks/7380177f16d914fdbc63.js +0 -1
  111. package/assets/esri/core/workers/chunks/7dba4121cdd20dbc4b20.js +0 -1
  112. package/assets/esri/core/workers/chunks/bb659dcd297b895830df.js +0 -1
  113. /package/assets/esri/core/workers/chunks/{386435341e949f5573b4.js.LICENSE.txt → 0fc60b4c44c4e865b699.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as e}from"./DefaultTechniqueConfiguration.js";class r extends e{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}t([o({count:4})],r.prototype,"polygonOffset",void 0),t([o()],r.prototype,"transparent",void 0),t([o()],r.prototype,"enableOITOffset",void 0);export{r as TriangleTechniqueConfiguration};
2
+ import{__decorate as t}from"tslib";import{parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as e}from"./DefaultTechniqueConfiguration.js";class r extends e{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}t([o({count:5})],r.prototype,"polygonOffset",void 0),t([o()],r.prototype,"transparent",void 0),t([o()],r.prototype,"enableOITOffset",void 0);export{r as TriangleTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{WaterDistortionPassParameters as t}from"../core/shaderLibrary/shading/WaterDistortion.glsl.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as i}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as a,depthWrite as n,depthTest as l,blending as p}from"../lib/OrderIndependentTransparency.js";import{PositionUvf32OlidGLLayout as m,PositionUvf32GLLayout as d}from"./DefaultLayouts.js";import{W as c}from"../../../../chunks/Water.glsl.js";import{makePipelineState as f,defaultColorWrite as h}from"../../../webgl/renderState.js";class u extends t{}let g=class extends o{constructor(e,r){super(e,r,i()?m:d),this.shader=new s(c,()=>import("./Water.glsl.js"))}initializePipeline(e){const{output:r,transparent:t,draped:s}=e;return f({blending:t?p(r):null,depthTest:s?null:l(r),depthWrite:n(e),colorWrite:h,polygonOffset:a(e)})}};g=e([r("esri.views.3d.webgl-engine.materials.WaterTechnique")],g);export{u as WaterMaterialPassParameters,g as WaterTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{WaterDistortionPassParameters as t}from"../core/shaderLibrary/shading/WaterDistortion.glsl.js";import{ReloadableShader as o}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as i}from"../effects/geometry/olidUtils.js";import{depthWrite as n,depthTest as a,blending as l}from"../lib/OrderIndependentTransparency.js";import{PositionUvf32OlidGLLayout as m,PositionUvf32GLLayout as p}from"./DefaultLayouts.js";import{oitPolygonOffset as d}from"./PolygonOffset.js";import{W as c}from"../../../../chunks/Water.glsl.js";import{makePipelineState as f,defaultColorWrite as h}from"../../../webgl/renderState.js";class u extends t{}let g=class extends s{constructor(e,r){super(e,r,i()?m:p),this.shader=new o(c,()=>import("./Water.glsl.js"))}initializePipeline(e){const{output:r,transparent:t,draped:o}=e;return f({blending:t?l(r):null,depthTest:o?null:a(r),depthWrite:n(e),colorWrite:h,polygonOffset:d(e)})}};g=e([r("esri.views.3d.webgl-engine.materials.WaterTechnique")],g);export{u as WaterMaterialPassParameters,g as WaterTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{isOITColor as o}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as t}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as i,depthTest as n,blending as a}from"../lib/OrderIndependentTransparency.js";import{PositionUvGLLayout as c}from"../materials/DefaultLayouts.js";import{C as l}from"../../../../chunks/CheckerBoard.glsl.js";import{makePipelineState as p,defaultColorWrite as d}from"../../../webgl/renderState.js";let m=class extends s{constructor(e,r){super(e,r,c),this.shader=new t(l,()=>import("./CheckerBoard.glsl.js"))}initializePipeline(e){const{output:r,transparent:t,polygonOffset:s}=e,c=!o(r);return p({blending:t?a(r):null,depthTest:n(r),depthWrite:i(e),colorWrite:d,polygonOffset:c?s?h:null:{factor:-1,units:-25}})}};m=e([r("esri.views.3d.webgl-engine.shaders.CheckerBoardTechnique")],m);const h={factor:0,units:-25};export{m as CheckerBoardTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as o}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as t}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as s,depthTest as i,blending as a}from"../lib/OrderIndependentTransparency.js";import{PositionUvGLLayout as n}from"../materials/DefaultLayouts.js";import{oitPolygonOffset as l}from"../materials/PolygonOffset.js";import{C as p}from"../../../../chunks/CheckerBoard.glsl.js";import{makePipelineState as m,defaultColorWrite as c}from"../../../webgl/renderState.js";let d=class extends t{constructor(e,r){super(e,r,n),this.shader=new o(p,()=>import("./CheckerBoard.glsl.js"))}initializePipeline(e){const{output:r,transparent:o}=e;return m({blending:o?a(r):null,depthTest:i(r),depthWrite:s(e),colorWrite:c,polygonOffset:l(e)})}};d=e([r("esri.views.3d.webgl-engine.shaders.CheckerBoardTechnique")],d);export{d as CheckerBoardTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as o}from"../../support/buffer/glUtil.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as a,depthWrite as c,depthTest as p,blending as u}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as m,stencilBaseAllZerosParams as d,stencilWriteMaskOn as f}from"../lib/StencilUtils.js";import{VisualVariablePassParameters as h}from"../materials/VisualVariablePassParameters.js";import{C as g}from"../../../../chunks/ColorMaterial.glsl.js";import{makePipelineState as j,defaultColorWrite as b,cullingParams as P}from"../../../webgl/renderState.js";class C extends h{constructor(){super(...arguments),this.color=t}}let S=class extends l{constructor(e,r){super(e,r,o(T(r))),this.shader=new s(g,()=>import("./ColorMaterial.glsl.js")),this.ignoreUnused=!0}_createPipeline(e,r){const{output:t,transparent:o,cullFace:i,draped:s,hasOccludees:l}=e;return j({blending:o?u(t):null,culling:P(i),depthTest:s?null:p(t),depthWrite:c(e),colorWrite:b,stencilWrite:l?f:null,stencilTest:l?r?m:d:null,polygonOffset:a(e)})}initializePipeline(e){return this._occludeePipelineState=this._createPipeline(e,!0),this._createPipeline(e,!1)}getPipeline(e,r){return r?this._occludeePipelineState:super.getPipeline(e)}};function T(e){const r=i().vec3f("position");return n()&&r.vec4u8("olidColor"),e.hasVVColor?r.f32("colorFeatureAttribute"):e.hasVertexColors&&r.vec4u8("color",{glNormalized:!0}),r.freeze()}S=e([r("esri.views.3d.webgl-engine.shaders.ColorMaterialTechnique")],S);export{C as ColorMaterialPassParameters,S as ColorMaterialTechnique,T as getLayout};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as o}from"../../support/buffer/glUtil.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{depthWrite as a,depthTest as c,blending as p}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as u,stencilBaseAllZerosParams as m,stencilWriteMaskOn as f}from"../lib/StencilUtils.js";import{oitPolygonOffset as d}from"../materials/PolygonOffset.js";import{VisualVariablePassParameters as h}from"../materials/VisualVariablePassParameters.js";import{C as g}from"../../../../chunks/ColorMaterial.glsl.js";import{makePipelineState as j,defaultColorWrite as b,cullingParams as P}from"../../../webgl/renderState.js";class C extends h{constructor(){super(...arguments),this.color=t}}let S=class extends l{constructor(e,r){super(e,r,o(T(r))),this.shader=new s(g,()=>import("./ColorMaterial.glsl.js")),this.ignoreUnused=!0}_createPipeline(e,r){const{output:t,transparent:o,cullFace:i,draped:s,hasOccludees:l}=e;return j({blending:o?p(t):null,culling:P(i),depthTest:s?null:c(t),depthWrite:a(e),colorWrite:b,stencilWrite:l?f:null,stencilTest:l?r?u:m:null,polygonOffset:d(e)})}initializePipeline(e){return this._occludeePipelineState=this._createPipeline(e,!0),this._createPipeline(e,!1)}getPipeline(e,r){return r?this._occludeePipelineState:super.getPipeline(e)}};function T(e){const r=i().vec3f("position");return n()&&r.vec4u8("olidColor"),e.hasVVColor?r.f32("colorFeatureAttribute"):e.hasVertexColors&&r.vec4u8("color",{glNormalized:!0}),r.freeze()}S=e([r("esri.views.3d.webgl-engine.shaders.ColorMaterialTechnique")],S);export{C as ColorMaterialPassParameters,S as ColorMaterialTechnique,T as getLayout};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as i,freeze as s,create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as l}from"../../support/buffer/glUtil.js";import{newLayout as n}from"../../support/buffer/InterleavedLayout.js";import{VertexNormalPassParameters as a,VertexNormalDrawParameters as c}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{ReloadableShader as h}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as u}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as p}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as m,depthWrite as d,depthTest as f,blending as v}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as g,stencilBaseAllZerosParams as b,stencilWriteMaskOn as S}from"../lib/StencilUtils.js";import{getRenderInstanceDataLayout as y}from"../lib/lodRendering/RenderInstanceData.js";import{advancedMRRFactors as j}from"../materials/pbrUtils.js";import{D as T}from"../../../../chunks/DefaultMaterial.glsl.js";import{makePipelineState as x,cullingParams as C,defaultColorWrite as P}from"../../../webgl/renderState.js";import{alphaCutoff as O}from"../../../../webscene/support/AlphaCutoff.js";class D extends a{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=j,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=i,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=s(.2,.2,.2),this.diffuse=s(.8,.8,.8),this.externalColor=o(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=r(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=O,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class V extends c{constructor(){super(...arguments),this.origin=r(),this.slicePlaneLocalOrigin=this.origin}}let w=class extends u{constructor(e,t){let i=l(z(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat(l(y(t)))),super(e,t,i),this.shader=new h(T,()=>import("./DefaultMaterial.glsl.js")),this.ignoreUnused=!0}_makePipeline(e,t){const{output:i,transparent:s,cullFace:r,customDepthTest:o,hasOccludees:l}=e;return x({blending:s?v(i):null,culling:M(e)?C(r):null,depthTest:f(i,A(o)),depthWrite:d(e),colorWrite:P,stencilWrite:l?S:null,stencilTest:l?t?g:b:null,polygonOffset:m(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function A(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function M(e){return 0!==e.cullFace||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}function z(e){const t=n().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color",{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&p()&&t.vec4u8("olidColor"),t}w=e([t("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],w);export{V as DefaultMaterialDrawParameters,D as DefaultMaterialPassParameters,w as DefaultMaterialTechnique,z as getLayout};
2
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as i,freeze as s,create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as l}from"../../support/buffer/glUtil.js";import{newLayout as n}from"../../support/buffer/InterleavedLayout.js";import{VertexNormalPassParameters as a,VertexNormalDrawParameters as c}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{ReloadableShader as h}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as u}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as m}from"../effects/geometry/olidUtils.js";import{depthWrite as p,depthTest as d,blending as f}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as g,stencilBaseAllZerosParams as v,stencilWriteMaskOn as b}from"../lib/StencilUtils.js";import{getRenderInstanceDataLayout as S}from"../lib/lodRendering/RenderInstanceData.js";import{advancedMRRFactors as y}from"../materials/pbrUtils.js";import{oitPolygonOffset as j}from"../materials/PolygonOffset.js";import{D as T}from"../../../../chunks/DefaultMaterial.glsl.js";import{makePipelineState as x,cullingParams as C,defaultColorWrite as P}from"../../../webgl/renderState.js";import{alphaCutoff as O}from"../../../../webscene/support/AlphaCutoff.js";class D extends a{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=y,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=i,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=s(.2,.2,.2),this.diffuse=s(.8,.8,.8),this.externalColor=o(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=r(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=O,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class V extends c{constructor(){super(...arguments),this.origin=r(),this.slicePlaneLocalOrigin=this.origin}}let w=class extends u{constructor(e,t){let i=l(z(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat(l(S(t)))),super(e,t,i),this.shader=new h(T,()=>import("./DefaultMaterial.glsl.js")),this.ignoreUnused=!0}_makePipeline(e,t){const{output:i,transparent:s,cullFace:r,customDepthTest:o,hasOccludees:l}=e;return x({blending:s?f(i):null,culling:M(e)?C(r):null,depthTest:d(i,A(o)),depthWrite:p(e),colorWrite:P,stencilWrite:l?b:null,stencilTest:l?t?g:v:null,polygonOffset:j(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function A(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function M(e){return 0!==e.cullFace||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}function z(e){const t=n().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color",{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&m()&&t.vec4u8("olidColor"),t}w=e([t("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],w);export{V as DefaultMaterialDrawParameters,D as DefaultMaterialPassParameters,w as DefaultMaterialTechnique,z as getLayout};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{glLayout as i}from"../../support/buffer/glUtil.js";import{ReloadableShader as r}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{oitPolygonOffset as l,depthWrite as o,depthTest as n,blending as p}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as a,stencilBaseAllZerosParams as c,stencilWriteMaskOn as u}from"../lib/StencilUtils.js";import{PositionUvLayout as m}from"../materials/DefaultLayouts.js";import{I as d}from"../../../../chunks/ImageMaterial.glsl.js";import{makePipelineState as h,defaultColorWrite as g,cullingParams as f}from"../../../webgl/renderState.js";let j=class extends s{constructor(e,t){super(e,t,i(b(t))),this.shader=new r(d,()=>import("./ImageMaterial.glsl.js")),this.ignoreUnused=!0}_getPipelineState(e,t){const{output:i,hasOccludees:r,cullFace:s}=e;return h({blending:p(i,!0),culling:f(s),depthTest:n(i),depthWrite:o(e),colorWrite:g,stencilWrite:r?u:null,stencilTest:r?t?a:c:null,polygonOffset:l(e)})}initializePipeline(e){return this._occludeePipeline=this._getPipelineState(e,!0),this._getPipelineState(e,!1)}getPipeline(e,t){return t?this._occludeePipeline:super.getPipeline(e)}};function b(e){let t=m;return e.perspectiveInterpolation&&(t=t.clone().f32("perspectiveDivide")),t}j=e([t("esri.views.3d.webgl-engine.shaders.ImageMaterialTechnique")],j);export{j as ImageMaterialTechnique,b as getLayout};
2
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{glLayout as r}from"../../support/buffer/glUtil.js";import{ReloadableShader as i}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as l,depthTest as o,blending as n}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as p,stencilBaseAllZerosParams as a,stencilWriteMaskOn as c}from"../lib/StencilUtils.js";import{PositionUvLayout as m}from"../materials/DefaultLayouts.js";import{oitPolygonOffset as u}from"../materials/PolygonOffset.js";import{I as d}from"../../../../chunks/ImageMaterial.glsl.js";import{makePipelineState as f,defaultColorWrite as h,cullingParams as g}from"../../../webgl/renderState.js";let j=class extends s{constructor(e,t){super(e,t,r(P(t))),this.shader=new i(d,()=>import("./ImageMaterial.glsl.js")),this.ignoreUnused=!0}_getPipelineState(e,t){const{output:r,hasOccludees:i,cullFace:s}=e;return f({blending:n(r,!0),culling:g(s),depthTest:o(r),depthWrite:l(e),colorWrite:h,stencilWrite:i?c:null,stencilTest:i?t?p:a:null,polygonOffset:u(e)})}initializePipeline(e){return this._occludeePipeline=this._getPipelineState(e,!0),this._getPipelineState(e,!1)}getPipeline(e,t){return t?this._occludeePipeline:super.getPipeline(e)}};function P(e){let t=m;return e.perspectiveInterpolation&&(t=t.clone().f32("perspectiveDivide")),t}j=e([t("esri.views.3d.webgl-engine.shaders.ImageMaterialTechnique")],j);export{j as ImageMaterialTechnique,P as getLayout};
@@ -5,7 +5,7 @@ import{isColor as o,isOITColor as l,isOITFrontFace as r}from"../core/shaderLibra
5
5
  ${t(h,"if (finalColor.a < alphaCutoff) { discard; }")}
6
6
  ${t(j||C,"float noise = ditherNoise();")}
7
7
 
8
- ${t(j,`${t(v,"fragColor = finalColor;","fragColor = premultiplyAlpha(finalColor);")}\n fragColor = vec4(fragColor.rgb * floatBlendOutputScale + noise, fragColor.a);\n fragAlpha = finalColor.a * floatBlendOutputScale + noise;`)}
8
+ ${t(j,`fragColor = ${t(v,"finalColor","premultiplyAlpha(finalColor)")};\n fragColor = vec4(fragColor.rgb * floatBlendOutputScale + noise, fragColor.a);\n fragAlpha = finalColor.a * floatBlendOutputScale + noise;`)}
9
9
  ${t(y&&v&&h,"finalColor.rgb /= finalColor.a;")}
10
10
  ${t(E,"fragColor = finalColor;")}
11
11
  ${t(C,`fragEmission = ${t(b,"mix(finalColor.a * getEmissions(emissiveSymbolColor), vec4(0.0), snow);","finalColor.a * getEmissions(emissiveSymbolColor);")}\n fragEmission = vec4(fragEmission.rgb * floatBlendOutputScale + noise, fragEmission.a);`)}
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{glLayout as r}from"../../support/buffer/glUtil.js";import{ReloadableShader as i}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{oitPolygonOffset as n,depthWrite as l,depthTest as o,blending as p}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as a,stencilBaseAllZerosParams as c,stencilWriteMaskOn as u}from"../lib/StencilUtils.js";import{P as d}from"../../../../chunks/Pattern.glsl.js";import{getLayout as m}from"./PatternLayouts.js";import{makePipelineState as h,defaultColorWrite as f,cullingParams as P}from"../../../webgl/renderState.js";let g=class extends s{constructor(e,t){super(e,t,r(m(t))),this.shader=new i(d,()=>import("./Pattern.glsl.js")),this.ignoreUnused=!0}_setPipelineState(e,t){const{output:r,cullFace:i,draped:s,hasOccludees:d}=e;return h({blending:p(r),culling:P(i),depthTest:s?null:o(r),depthWrite:l(e),colorWrite:f,stencilWrite:d?u:null,stencilTest:d?t?a:c:null,polygonOffset:n(e)})}initializePipeline(e){return this._occludeePipelineState=this._setPipelineState(e,!0),this._setPipelineState(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};g=e([t("esri.views.3d.webgl-engine.shaders.PatternTechnique")],g);export{g as PatternTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{glLayout as r}from"../../support/buffer/glUtil.js";import{ReloadableShader as i}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as o,depthTest as l,blending as n}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as p,stencilBaseAllZerosParams as a,stencilWriteMaskOn as c}from"../lib/StencilUtils.js";import{oitPolygonOffset as u}from"../materials/PolygonOffset.js";import{P as m}from"../../../../chunks/Pattern.glsl.js";import{getLayout as d}from"./PatternLayouts.js";import{makePipelineState as h,defaultColorWrite as f,cullingParams as P}from"../../../webgl/renderState.js";let g=class extends s{constructor(e,t){super(e,t,r(d(t))),this.shader=new i(m,()=>import("./Pattern.glsl.js")),this.ignoreUnused=!0}_setPipelineState(e,t){const{output:r,cullFace:i,draped:s,hasOccludees:m}=e;return h({blending:n(r),culling:P(i),depthTest:s?null:l(r),depthWrite:o(e),colorWrite:f,stencilWrite:m?c:null,stencilTest:m?t?p:a:null,polygonOffset:u(e)})}initializePipeline(e){return this._occludeePipelineState=this._setPipelineState(e,!0),this._setPipelineState(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};g=e([t("esri.views.3d.webgl-engine.shaders.PatternTechnique")],g);export{g as PatternTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{glLayout as i}from"../../support/buffer/glUtil.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{ReloadableShader as l}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as o,depthWrite as c,depthTest as u,blending as p}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as a,stencilBaseAllZerosParams as d,stencilWriteMaskOn as f,stencilToolTransparentOccluderParams as h,depthCompareAlways as m,stencilToolMaskOccluderParams as b,stencilWriteMaskOff as g,depthCompareLess as P}from"../lib/StencilUtils.js";import{R as T}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as W}from"../../../webgl/enums.js";import{makePipelineState as j,defaultColorWrite as v,unpremultipliedAlphaToPremultipliedAlpha as S}from"../../../webgl/renderState.js";let _=class extends s{constructor(e,t){super(e,t,i(y(t))),this.shader=new l(T,()=>import("./RibbonLine.glsl.js")),this.ignoreUnused=!0,this.primitiveType=t.wireframe?W.LINES:W.TRIANGLE_STRIP}_makePipelineState(e,t){const{output:i,hasOccludees:r}=e;return j({blending:p(i),depthTest:u(i),depthWrite:c(e),colorWrite:v,stencilWrite:r?f:null,stencilTest:r?t?a:d:null,polygonOffset:o(e)})}initializePipeline(e){if(e.occluder){const{hasOccludees:t}=e;this._occluderPipelineTransparent=j({blending:S,polygonOffset:o(e),depthTest:m,depthWrite:null,colorWrite:v,stencilWrite:null,stencilTest:t?h:null}),this._occluderPipelineOpaque=j({blending:S,polygonOffset:o(e),depthTest:t?m:P,depthWrite:null,colorWrite:v,stencilWrite:t?g:null,stencilTest:t?b:null}),this._occluderPipelineMaskWrite=j({blending:null,polygonOffset:o(e),depthTest:P,depthWrite:null,colorWrite:null,stencilWrite:t?f:null,stencilTest:t?a:null})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(t)return this._occludeePipeline;switch(e.occluder){case 12:return this._occluderPipelineTransparent??super.getPipeline(e);case 11:return this._occluderPipelineOpaque??super.getPipeline(e);default:e.occluder;case void 0:case null:return this._occluderPipelineMaskWrite??super.getPipeline(e)}}};function y(e){const t=r().vec3f("position").vec4f16("previousDelta").vec4f16("nextDelta").f32("u0").vec2f16("lineParameters");return e.hasVVColor?t.f32("colorFeatureAttribute"):t.vec4u8("color",{glNormalized:!0}),e.hasVVSize?t.f32("sizeFeatureAttribute"):t.f32("size"),e.hasVVOpacity&&t.f32("opacityFeatureAttribute"),n()&&t.vec4u8("olidColor"),e.hasAnimation&&t.vec4f16("timeStamps"),t}_=e([t("esri.views.3d.webgl-engine.shaders.RibbonLineTechnique")],_);export{_ as RibbonLineTechnique,y as getLayout};
2
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{glLayout as i}from"../../support/buffer/glUtil.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{ReloadableShader as l}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{depthWrite as o,depthTest as c,blending as u}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as p,stencilBaseAllZerosParams as a,stencilWriteMaskOn as d,stencilToolTransparentOccluderParams as f,depthCompareAlways as m,stencilToolMaskOccluderParams as h,stencilWriteMaskOff as g,depthCompareLess as b}from"../lib/StencilUtils.js";import{oitPolygonOffset as P}from"../materials/PolygonOffset.js";import{R as T}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as W}from"../../../webgl/enums.js";import{makePipelineState as j,defaultColorWrite as v,unpremultipliedAlphaToPremultipliedAlpha as S}from"../../../webgl/renderState.js";let _=class extends s{constructor(e,t){super(e,t,i(y(t))),this.shader=new l(T,()=>import("./RibbonLine.glsl.js")),this.ignoreUnused=!0,this.primitiveType=t.wireframe?W.LINES:W.TRIANGLE_STRIP}_makePipelineState(e,t){const{output:i,hasOccludees:r}=e;return j({blending:u(i),depthTest:c(i),depthWrite:o(e),colorWrite:v,stencilWrite:r?d:null,stencilTest:r?t?p:a:null,polygonOffset:P(e)})}initializePipeline(e){if(e.occluder){const{hasOccludees:t}=e;this._occluderPipelineTransparent=j({blending:S,polygonOffset:P(e),depthTest:m,depthWrite:null,colorWrite:v,stencilWrite:null,stencilTest:t?f:null}),this._occluderPipelineOpaque=j({blending:S,polygonOffset:P(e),depthTest:t?m:b,depthWrite:null,colorWrite:v,stencilWrite:t?g:null,stencilTest:t?h:null}),this._occluderPipelineMaskWrite=j({blending:null,polygonOffset:P(e),depthTest:b,depthWrite:null,colorWrite:null,stencilWrite:t?d:null,stencilTest:t?p:null})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(t)return this._occludeePipeline;switch(e.occluder){case 12:return this._occluderPipelineTransparent??super.getPipeline(e);case 11:return this._occluderPipelineOpaque??super.getPipeline(e);default:e.occluder;case void 0:case null:return this._occluderPipelineMaskWrite??super.getPipeline(e)}}};function y(e){const t=r().vec3f("position").vec4f16("previousDelta").vec4f16("nextDelta").f32("u0").vec2f16("lineParameters");return e.hasVVColor?t.f32("colorFeatureAttribute"):t.vec4u8("color",{glNormalized:!0}),e.hasVVSize?t.f32("sizeFeatureAttribute"):t.f32("size"),e.hasVVOpacity&&t.f32("opacityFeatureAttribute"),n()&&t.vec4u8("olidColor"),e.hasAnimation&&t.vec4f16("timeStamps"),t}_=e([t("esri.views.3d.webgl-engine.shaders.RibbonLineTechnique")],_);export{_ as RibbonLineTechnique,y as getLayout};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{glLayout as o}from"../../support/buffer/glUtil.js";import{newLayout as t}from"../../support/buffer/InterleavedLayout.js";import{isOITFrontFace as s}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as i}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as n}from"../core/shaderTechnique/ShaderTechnique.js";import{oitPolygonOffset as a,depthWrite as l,blending as d}from"../lib/OrderIndependentTransparency.js";import{S as p}from"../../../../chunks/ShadedColorMaterial.glsl.js";import{makePipelineState as c,defaultColorWrite as u,cullingParams as f}from"../../../webgl/renderState.js";let m=class extends n{constructor(e,r){super(e,r,o(h(r))),this.shader=new i(p,()=>import("./ShadedColorMaterial.glsl.js"))}initializePipeline(e){const{output:r,transparent:o,cullFace:t,shadingEnabled:i}=e,n=s(r);return c({blending:o?d(r):null,culling:f(t),depthTest:{func:n?513:i?515:513},depthWrite:l(e),colorWrite:u,polygonOffset:a(e)})}};function h(e){const r=t().vec3f("position").vec3f("normal");return e.screenSizeEnabled&&r.vec3f("offset"),r}m=e([r("esri.views.3d.webgl-engine.shaders.ShadedColorMaterialTechnique")],m);export{m as ShadedColorMaterialTechnique,h as getLayout};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{glLayout as o}from"../../support/buffer/glUtil.js";import{newLayout as t}from"../../support/buffer/InterleavedLayout.js";import{isOITFrontFace as s}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as i}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as n}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as a,blending as l}from"../lib/OrderIndependentTransparency.js";import{oitPolygonOffset as p}from"../materials/PolygonOffset.js";import{S as d}from"../../../../chunks/ShadedColorMaterial.glsl.js";import{makePipelineState as c,defaultColorWrite as f,cullingParams as m}from"../../../webgl/renderState.js";let u=class extends n{constructor(e,r){super(e,r,o(h(r))),this.shader=new i(d,()=>import("./ShadedColorMaterial.glsl.js"))}initializePipeline(e){const{output:r,transparent:o,cullFace:t,shadingEnabled:i}=e,n=s(r);return c({blending:o?l(r):null,culling:m(t),depthTest:{func:n?513:i?515:513},depthWrite:a(e),colorWrite:f,polygonOffset:p(e)})}};function h(e){const r=t().vec3f("position").vec3f("normal");return e.screenSizeEnabled&&r.vec3f("offset"),r}u=e([r("esri.views.3d.webgl-engine.shaders.ShadedColorMaterialTechnique")],u);export{u as ShadedColorMaterialTechnique,h as getLayout};
package/views/3d/webgl.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import o from"../../Camera.js";import{rad2deg as e,deg2rad as r}from"../../core/mathUtils.js";import{create as t}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as i,add as n}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import l from"../../geometry/Point.js";import a from"../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as s}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as m}from"../../geometry/projection/projectBuffer.js";import{projectPointToVector as p}from"../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as f}from"../../geometry/projection/projectVectorToVector.js";import{cameraOnContentAlongViewDirection as u}from"./camera/intersectionUtils.js";import{directionToHeadingTilt as R,viewModeDependentUtil as A}from"./support/viewingModeUtils.js";const d={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},T=[d.FINAL,d.COMPOSITE,d.OPAQUE,d.TRANSPARENT],N={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",PRE_TRANSPARENT:"pre-transparent-color",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserline-color",MAGNIFIER:"magnifier-color",OCCLUDED:"occluded-color",OPAQUE_ENVIRONMENT:"opaque-environment-color",AMBIENT_ILLUMINATION:"ambient-illumination",TRANSPARENT_ENVIRONMENT:"transparent-environment-color",VIEWSHED:"viewshed-color"},E=Array.from(Object.values(N)).concat(T);function O(o,e,r,t,i,n,c){return t=t||o.spatialReference,m(e,t,r,i,o.renderCoordsHelper.spatialReference,n,c)?i:null}function I(o,e,r,t,i,n,c){return n=n||o.spatialReference,m(e,o.renderCoordsHelper.spatialReference,r,t,n,i,c)?t:null}function j(o,e,r,i){return i||(i=t()),r=r||o.spatialReference,s(r,e,i,o.renderCoordsHelper.spatialReference)?i:null}function g(r,t,i){const n=r.renderSpatialReference,c=R(r,t.eye,t.viewForward,t.up,L);let s=r.spatialReference;return f(t.eye,n,C,s)||(s=a.WGS84,f(t.eye,n,C,s)),null==i?i=new o(new l(C,s),c.heading,c.tilt,e(t.fov)):(i.position.x=C[0],i.position.y=C[1],i.position.z=C[2],i.position.spatialReference=s,i.heading=c.heading,i.tilt=c.tilt,i.fov=e(t.fov)),i.layout.row=t.row,i.layout.rows=t.rows,i.layout.column=t.column,i.layout.columns=t.columns,i}function y(o,e){if(!e)return null;const t=o.renderSpatialReference,l=A(o).headingTiltToDirectionUp,a=c();if(!p(e.position,a,t))return null;const s=l(a,e.heading,e.tilt);i(s.direction,s.direction,o.state.camera.distance),n(s.direction,s.direction,a);const m=u(o,a,s.direction,s.up);return m.fov=r(e.fov),m.row=e.layout.row,m.rows=e.layout.rows,m.column=e.layout.column,m.columns=e.layout.columns,m}const C=c(),L={heading:0,tilt:0};export{E as AllInternalRenderNodeOutputs,T as AllRenderNodeOutputs,N as InternalRenderCategory,d as RenderNodeOutput,g as fromRenderCamera,I as fromRenderCoordinates,j as renderCoordinateTransformAt,y as toRenderCamera,O as toRenderCoordinates};
2
+ import o from"../../Camera.js";import{rad2deg as e,deg2rad as r}from"../../core/mathUtils.js";import{create as t}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as i,add as n}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../geometry/Point.js";import l from"../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as s}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as m}from"../../geometry/projection/projectBuffer.js";import{projectPointToVector as p}from"../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as f}from"../../geometry/projection/projectVectorToVector.js";import{cameraOnContentAlongViewDirection as u}from"./camera/intersectionUtils.js";import{directionToHeadingTilt as R,viewModeDependentUtil as A}from"./support/viewingModeUtils.js";const d={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},T=[d.FINAL,d.COMPOSITE,d.OPAQUE,d.TRANSPARENT],N={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",PRE_TRANSPARENT:"pre-transparent",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_ENVIRONMENT:"opaque-environment",AMBIENT_ILLUMINATION:"ambient-illumination",TRANSPARENT_ENVIRONMENT:"transparent-environment",VIEWSHED:"viewshed"},E=Array.from(Object.values(N)).concat(T);function O(o,e,r,t,i,n,a){return t=t||o.spatialReference,m(e,t,r,i,o.renderCoordsHelper.spatialReference,n,a)?i:null}function I(o,e,r,t,i,n,a){return n=n||o.spatialReference,m(e,o.renderCoordsHelper.spatialReference,r,t,n,i,a)?t:null}function j(o,e,r,i){return i||(i=t()),r=r||o.spatialReference,s(r,e,i,o.renderCoordsHelper.spatialReference)?i:null}function g(r,t,i){const n=r.renderSpatialReference,a=R(r,t.eye,t.viewForward,t.up,L);let s=r.spatialReference;return f(t.eye,n,C,s)||(s=l.WGS84,f(t.eye,n,C,s)),null==i?i=new o(new c(C,s),a.heading,a.tilt,e(t.fov)):(i.position.x=C[0],i.position.y=C[1],i.position.z=C[2],i.position.spatialReference=s,i.heading=a.heading,i.tilt=a.tilt,i.fov=e(t.fov)),i.layout.row=t.row,i.layout.rows=t.rows,i.layout.column=t.column,i.layout.columns=t.columns,i}function y(o,e){if(!e)return null;const t=o.renderSpatialReference,c=A(o).headingTiltToDirectionUp,l=a();if(!p(e.position,l,t))return null;const s=c(l,e.heading,e.tilt);i(s.direction,s.direction,o.state.camera.distance),n(s.direction,s.direction,l);const m=u(o,l,s.direction,s.up);return m.fov=r(e.fov),m.row=e.layout.row,m.rows=e.layout.rows,m.column=e.layout.column,m.columns=e.layout.columns,m}const C=a(),L={heading:0,tilt:0};export{E as AllInternalRenderNodeOutputs,T as AllRenderNodeOutputs,N as InternalRenderCategory,d as RenderNodeOutput,g as fromRenderCamera,I as fromRenderCoordinates,j as renderCoordinateTransformAt,y as toRenderCamera,O as toRenderCoordinates};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import has from"../../core/has.js";import{webglValidateShadersEnabled as t,webglDebugEnabled as e}from"./checkWebGLError.js";import{ResourceType as o}from"./enums.js";import{transpileShader as i}from"./ShaderTranspiler.js";const n=4294967295,r=!!has("esri-tests-disable-gpu-memory-measurements");class s{constructor(e,s,m,h,f=new Map,l=[]){this._context=e,this._compiled=!1,this._linesOfCode=0,this._nameToUniformLocation=new Map,this._nameToUniform1=new Map,this._nameToUniform1v=new Map,this._nameToUniform2=new Map,this._nameToUniform3=new Map,this._nameToUniform4=new Map,this._nameToUniformMatrix3=new Map,this._nameToUniformMatrix4=new Map,e||console.error("RenderingContext isn't initialized!"),0===s.length&&console.error("Shaders source should not be empty!"),s=i(s,35633),m=i(m,35632),this._vShader=a(this._context,35633,s),this._fShader=a(this._context,35632,m),c.enabled&&(this._linesOfCode=s.match(/\n/g).length+m.match(/\n/g).length+2,e.instanceCounter.increment(o.LinesOfCode,this._vShader,this._linesOfCode)),this._vShader&&this._fShader||console.error("Error loading shaders!"),e.instanceCounter.increment(o.Shader,this),t()&&(this.vertexShader=s,this.fragmentShader=m),this.usedMemory=r?0:s.length+m.length;const _=this._context.gl,g=_.createProgram();_.attachShader(g,this._vShader),_.attachShader(g,this._fShader),h.forEach((t,e)=>_.bindAttribLocation(g,t,e)),this.hasTransformFeedbackVaryings=!!l?.length,this.hasTransformFeedbackVaryings&&_.transformFeedbackVaryings(g,l,_.SEPARATE_ATTRIBS),_.linkProgram(g),t()&&!_.getProgramParameter(g,_.LINK_STATUS)&&console.error(`Could not link shader\nvalidated: ${_.getProgramParameter(g,_.VALIDATE_STATUS)}, gl error ${_.getError()}, vertex: ${_.getShaderParameter(this._vShader,_.COMPILE_STATUS)}, fragment: ${_.getShaderParameter(this._fShader,_.COMPILE_STATUS)}, info log: ${_.getProgramInfoLog(g)}, vertex source: ${this.vertexShader}, fragment source: ${this.fragmentShader}`);for(const[t,o]of f){const e=_.getUniformBlockIndex(g,t);e<n&&_.uniformBlockBinding(g,e,o)}this._glName=g,e.instanceCounter.increment(o.Program,this)}get glName(){return this._glName}get hasGLName(){return null!=this._glName}get compiled(){return!!this._compiled||(this._context.capabilities.parallelShaderCompile&&null!=this.glName?(this._compiled=!!this._context.gl.getProgramParameter(this.glName,37297),this._compiled):(this._compiled=!0,!0))}dispose(){const t=this._context.gl,e=this._context.instanceCounter;this._nameToUniformLocation.forEach(t=>t&&e.decrement(o.Uniform,t)),this._nameToUniformLocation.clear(),this._vShader&&(this._linesOfCode>0&&(e.decrement(o.LinesOfCode,this._vShader,this._linesOfCode),this._linesOfCode=0),t.deleteShader(this._vShader),this._vShader=null,e.decrement(o.Shader,this)),this._fShader&&(t.deleteShader(this._fShader),this._fShader=null),this._glName&&(t.deleteProgram(this._glName),this._glName=null,e.decrement(o.Program,this))}_getUniformLocation(t){const e=this._nameToUniformLocation.get(t);if(void 0!==e)return e;if(this.glName){const e=this._context.gl.getUniformLocation(this.glName,t);return this._nameToUniformLocation.set(t,e),e&&this._context.instanceCounter.increment(o.Uniform,e),e}return null}hasUniform(t){return null!=this._getUniformLocation(t)}setUniform1i(t,e,o){l(o,e);const i=this._nameToUniform1.get(t);void 0!==i&&e===i||(this._context.gl.uniform1i(this._getUniformLocation(t),e),this._nameToUniform1.set(t,e))}setUniform1iv(t,e,o){_(o,e),f(this._nameToUniform1v,t,e)&&this._context.gl.uniform1iv(this._getUniformLocation(t),e)}setUniform2iv(t,e,o){_(o,e),f(this._nameToUniform2,t,e)&&this._context.gl.uniform2iv(this._getUniformLocation(t),e)}setUniform3iv(t,e,o){_(o,e),f(this._nameToUniform3,t,e)&&this._context.gl.uniform3iv(this._getUniformLocation(t),e)}setUniform4iv(t,e,o){_(o,e),f(this._nameToUniform4,t,e)&&this._context.gl.uniform4iv(this._getUniformLocation(t),e)}setUniform1f(t,e,o){l(o,e);const i=this._nameToUniform1.get(t);void 0!==i&&e===i||(this._context.gl.uniform1f(this._getUniformLocation(t),e),this._nameToUniform1.set(t,e))}setUniform1fv(t,e,o){_(o,e),f(this._nameToUniform1v,t,e)&&this._context.gl.uniform1fv(this._getUniformLocation(t),e)}setUniform2f(t,e,o,i){l(i,e,o);const n=this._nameToUniform2.get(t);void 0===n?(this._context.gl.uniform2f(this._getUniformLocation(t),e,o),this._nameToUniform2.set(t,[e,o])):e===n[0]&&o===n[1]||(this._context.gl.uniform2f(this._getUniformLocation(t),e,o),n[0]=e,n[1]=o)}setUniform2fv(t,e,o){_(o,e),f(this._nameToUniform2,t,e)&&this._context.gl.uniform2fv(this._getUniformLocation(t),e)}setUniform3f(t,e,o,i,n){l(n,e,o,i);const r=this._nameToUniform3.get(t);void 0===r?(this._context.gl.uniform3f(this._getUniformLocation(t),e,o,i),this._nameToUniform3.set(t,[e,o,i])):e===r[0]&&o===r[1]&&i===r[2]||(this._context.gl.uniform3f(this._getUniformLocation(t),e,o,i),r[0]=e,r[1]=o,r[2]=i)}setUniform3fv(t,e,o){_(o,e);const i=this._getUniformLocation(t);null!=i&&f(this._nameToUniform3,t,e)&&this._context.gl.uniform3fv(i,e)}setUniform4f(t,e,o,i,n,r){l(r,e,o,i,n);const s=this._nameToUniform4.get(t);void 0===s?(this._context.gl.uniform4f(this._getUniformLocation(t),e,o,i,n),this._nameToUniform4.set(t,[e,o,i,n])):void 0!==s&&e===s[0]&&o===s[1]&&i===s[2]&&n===s[3]||(this._context.gl.uniform4f(this._getUniformLocation(t),e,o,i,n),s[0]=e,s[1]=o,s[2]=i,s[3]=n)}setUniform4fv(t,e,o){_(o,e);const i=this._getUniformLocation(t);null!=i&&f(this._nameToUniform4,t,e)&&this._context.gl.uniform4fv(i,e)}setUniformMatrix3fv(t,e,o=!1,i){_(i,e);const n=this._getUniformLocation(t);null!=n&&f(this._nameToUniformMatrix3,t,e)&&this._context.gl.uniformMatrix3fv(n,o,e)}setUniformMatrix4fv(t,e,o=!1,i){_(i,e);const n=this._getUniformLocation(t);if(null!=n){const i=this._nameToUniformMatrix4,r=i.get(t);let s=!1;if(r){const o=e.length;if(r.length!==o)i.set(t,Array.from(e)),s=!0;else for(let t=0;t<o;++t){const i=e[t];if(r[t]!==i){for(r[t]=i;t<o;++t)r[t]=e[t];s=!0;break}}}else i.set(t,Array.from(e)),s=!0;s&&this._context.gl.uniformMatrix4fv(n,o,e)}}setUniformMatrices4fv(t,e,o=!1,i){_(i,e);const n=this._getUniformLocation(t);null!=n&&f(this._nameToUniformMatrix4,t,e)&&this._context.gl.uniformMatrix4fv(n,o,e)}stop(){}}function a(e,o,i){const n=e.gl,r=n.createShader(o);return n.shaderSource(r,i),n.compileShader(r),t()&&!n.getShaderParameter(r,n.COMPILE_STATUS)&&(console.error("Compile error in ".concat(35633===o?"vertex":"fragment"," shader")),console.error(n.getShaderInfoLog(r)),console.error(m(i))),r}function m(t){let e=2;return t.replaceAll("\n",()=>"\n"+h(e++)+":")}function h(t){return t>=1e3?t.toString():(" "+t).slice(-3)}function f(t,e,o){const i=t.get(e);if(!i)return t.set(e,Array.from(o)),!0;const n=o.length;if(i.length!==n)return t.set(e,Array.from(o)),!0;for(let r=0;r<n;++r){const t=o[r];if(i[r]!==t){for(i[r]=t;r<n;++r)i[r]=o[r];return!0}}return!1}const c={enabled:!1},l=e()?(t,...e)=>_(t,e):()=>{},_=e()?(t,e)=>{if(t?.supportsNaN)return;const o=e.length;for(let i=0;i<o;++i){const t=e[i];Number.isNaN(t)&&console.error(`Got ${t} as uniform value from ${(new Error).stack}`)}}:()=>{};export{s as DisposableProgram,c as test};
2
+ import{numbersEquals as t}from"../../core/arrayUtils.js";import has from"../../core/has.js";import{webglValidateShadersEnabled as e,webglDebugEnabled as o}from"./checkWebGLError.js";import{ResourceType as i}from"./enums.js";import{transpileShader as n}from"./ShaderTranspiler.js";const r=4294967295,s=!!has("esri-tests-disable-gpu-memory-measurements");class a{constructor(t,o,a,h,f=new Map,c=[]){this._context=t,this._compiled=!1,this._linesOfCode=0,this._nameToUniformLocation=new Map,this._nameToUniform1=new Map,this._nameToUniform1v=new Map,this._nameToUniform2=new Map,this._nameToUniform3=new Map,this._nameToUniform4=new Map,this._nameToUniformMatrix3=new Map,this._nameToUniformMatrix4=new Map,t||console.error("RenderingContext isn't initialized!"),0===o.length&&console.error("Shaders source should not be empty!"),o=n(o,35633),a=n(a,35632),this._vShader=m(this._context,35633,o),this._fShader=m(this._context,35632,a),l.enabled&&(this._linesOfCode=o.match(/\n/g).length+a.match(/\n/g).length+2,t.instanceCounter.increment(i.LinesOfCode,this._vShader,this._linesOfCode)),this._vShader&&this._fShader||console.error("Error loading shaders!"),t.instanceCounter.increment(i.Shader,this),e()&&(this.vertexShader=o,this.fragmentShader=a),this.usedMemory=s?0:o.length+a.length;const _=this._context.gl,g=_.createProgram();_.attachShader(g,this._vShader),_.attachShader(g,this._fShader),h.forEach((t,e)=>_.bindAttribLocation(g,t,e)),this.hasTransformFeedbackVaryings=!!c?.length,this.hasTransformFeedbackVaryings&&_.transformFeedbackVaryings(g,c,_.SEPARATE_ATTRIBS),_.linkProgram(g),e()&&!_.getProgramParameter(g,_.LINK_STATUS)&&console.error(`Could not link shader\nvalidated: ${_.getProgramParameter(g,_.VALIDATE_STATUS)}, gl error ${_.getError()}, vertex: ${_.getShaderParameter(this._vShader,_.COMPILE_STATUS)}, fragment: ${_.getShaderParameter(this._fShader,_.COMPILE_STATUS)}, info log: ${_.getProgramInfoLog(g)}, vertex source: ${this.vertexShader}, fragment source: ${this.fragmentShader}`);for(const[e,i]of f){const t=_.getUniformBlockIndex(g,e);t<r&&_.uniformBlockBinding(g,t,i)}this._glName=g,t.instanceCounter.increment(i.Program,this)}get glName(){return this._glName}get hasGLName(){return null!=this._glName}get compiled(){return!!this._compiled||(this._context.capabilities.parallelShaderCompile&&null!=this.glName?(this._compiled=!!this._context.gl.getProgramParameter(this.glName,37297),this._compiled):(this._compiled=!0,!0))}dispose(){const t=this._context.gl,e=this._context.instanceCounter;this._nameToUniformLocation.forEach(t=>t&&e.decrement(i.Uniform,t)),this._nameToUniformLocation.clear(),this._vShader&&(this._linesOfCode>0&&(e.decrement(i.LinesOfCode,this._vShader,this._linesOfCode),this._linesOfCode=0),t.deleteShader(this._vShader),this._vShader=null,e.decrement(i.Shader,this)),this._fShader&&(t.deleteShader(this._fShader),this._fShader=null),this._glName&&(t.deleteProgram(this._glName),this._glName=null,e.decrement(i.Program,this))}_getUniformLocation(t){const e=this._nameToUniformLocation.get(t);if(void 0!==e)return e;if(this.glName){const e=this._context.gl.getUniformLocation(this.glName,t);return this._nameToUniformLocation.set(t,e),e&&this._context.instanceCounter.increment(i.Uniform,e),e}return null}hasUniform(t){return null!=this._getUniformLocation(t)}setUniform1i(t,e,o){_(o,e);const i=this._nameToUniform1.get(t);void 0!==i&&e===i||(this._context.gl.uniform1i(this._getUniformLocation(t),e),this._nameToUniform1.set(t,e))}setUniform1iv(t,e,o){g(o,e),c(this._nameToUniform1v,t,e)&&this._context.gl.uniform1iv(this._getUniformLocation(t),e)}setUniform2iv(t,e,o){g(o,e),c(this._nameToUniform2,t,e)&&this._context.gl.uniform2iv(this._getUniformLocation(t),e)}setUniform3iv(t,e,o){g(o,e),c(this._nameToUniform3,t,e)&&this._context.gl.uniform3iv(this._getUniformLocation(t),e)}setUniform4iv(t,e,o){g(o,e),c(this._nameToUniform4,t,e)&&this._context.gl.uniform4iv(this._getUniformLocation(t),e)}setUniform1f(t,e,o){_(o,e);const i=this._nameToUniform1.get(t);void 0!==i&&e===i||(this._context.gl.uniform1f(this._getUniformLocation(t),e),this._nameToUniform1.set(t,e))}setUniform1fv(t,e,o){g(o,e),c(this._nameToUniform1v,t,e)&&this._context.gl.uniform1fv(this._getUniformLocation(t),e)}setUniform2f(t,e,o,i){_(i,e,o);const n=this._nameToUniform2.get(t);void 0===n?(this._context.gl.uniform2f(this._getUniformLocation(t),e,o),this._nameToUniform2.set(t,[e,o])):e===n[0]&&o===n[1]||(this._context.gl.uniform2f(this._getUniformLocation(t),e,o),n[0]=e,n[1]=o)}setUniform2fv(t,e,o){g(o,e),c(this._nameToUniform2,t,e)&&this._context.gl.uniform2fv(this._getUniformLocation(t),e)}setUniform3f(t,e,o,i,n){_(n,e,o,i);const r=this._nameToUniform3.get(t);void 0===r?(this._context.gl.uniform3f(this._getUniformLocation(t),e,o,i),this._nameToUniform3.set(t,[e,o,i])):e===r[0]&&o===r[1]&&i===r[2]||(this._context.gl.uniform3f(this._getUniformLocation(t),e,o,i),r[0]=e,r[1]=o,r[2]=i)}setUniform3fv(t,e,o){g(o,e);const i=this._getUniformLocation(t);null!=i&&c(this._nameToUniform3,t,e)&&this._context.gl.uniform3fv(i,e)}setUniform4f(t,e,o,i,n,r){_(r,e,o,i,n);const s=this._nameToUniform4.get(t);void 0===s?(this._context.gl.uniform4f(this._getUniformLocation(t),e,o,i,n),this._nameToUniform4.set(t,[e,o,i,n])):void 0!==s&&e===s[0]&&o===s[1]&&i===s[2]&&n===s[3]||(this._context.gl.uniform4f(this._getUniformLocation(t),e,o,i,n),s[0]=e,s[1]=o,s[2]=i,s[3]=n)}setUniform4fv(t,e,o){g(o,e);const i=this._getUniformLocation(t);null!=i&&c(this._nameToUniform4,t,e)&&this._context.gl.uniform4fv(i,e)}setUniformMatrix3fv(t,e,o=!1,i){g(i,e);const n=this._getUniformLocation(t);null!=n&&c(this._nameToUniformMatrix3,t,e)&&this._context.gl.uniformMatrix3fv(n,o,e)}setUniformMatrix4fv(t,e,o=!1,i){g(i,e);const n=this._getUniformLocation(t);if(null!=n){const i=this._nameToUniformMatrix4,r=i.get(t);let s=!1;if(r){const o=e.length;if(r.length!==o)i.set(t,Array.from(e)),s=!0;else for(let t=0;t<o;++t){const i=e[t];if(r[t]!==i){for(r[t]=i;t<o;++t)r[t]=e[t];s=!0;break}}}else i.set(t,Array.from(e)),s=!0;s&&this._context.gl.uniformMatrix4fv(n,o,e)}}setUniformMatrices4fv(t,e,o=!1,i){g(i,e);const n=this._getUniformLocation(t);null!=n&&c(this._nameToUniformMatrix4,t,e)&&this._context.gl.uniformMatrix4fv(n,o,e)}stop(){}}function m(t,o,i){const n=t.gl,r=n.createShader(o);return n.shaderSource(r,i),n.compileShader(r),e()&&!n.getShaderParameter(r,n.COMPILE_STATUS)&&(console.error("Compile error in ".concat(35633===o?"vertex":"fragment"," shader")),console.error(n.getShaderInfoLog(r)),console.error(h(i))),r}function h(t){let e=2;return t.replaceAll("\n",()=>"\n"+f(e++)+":")}function f(t){return t>=1e3?t.toString():(" "+t).slice(-3)}function c(e,o,i){const n=e.get(o);return!t(n,i)&&(e.set(o,Array.from(i)),!0)}const l={enabled:!1},_=o()?(t,...e)=>g(t,e):()=>{},g=o()?(t,e)=>{if(t?.supportsNaN)return;const o=e.length;for(let i=0;i<o;++i){const t=e[i];Number.isNaN(t)&&console.error(`Got ${t} as uniform value from ${(new Error).stack}`)}}:()=>{};export{a as DisposableProgram,l as test};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../Graphic.js";import a from"../../core/Error.js";import{makeHandle as i,handlesGroup as r,abortHandle as s}from"../../core/handleUtils.js";import"../../core/has.js";import o from"../../core/Logger.js";import{removeMaybe as n,destroyMaybe as l}from"../../core/maybe.js";import{isPromiseLike as d,debounce as c}from"../../core/promiseUtils.js";import{watch as u,when as p,initial as h,sync as m,whenOnce as f,syncAndInitial as g}from"../../core/reactiveUtils.js";import{generateBracedUUID as w}from"../../core/uuid.js";import{property as y,subclass as v}from"../../core/accessorSupport/decorators.js";import{isSharedTemplateOrMetadata as _,isSharedTemplate as F,getCreationAttributes as b,isStandardFeatureTemplate as M}from"../../editing/templateUtils.js";import{getFullTemplate as I}from"../../editing/sharedTemplates/templateLoader.js";import V from"../../layers/GraphicsLayer.js";import{isSceneLayer as k,isTable as S}from"../../layers/support/layerUtils.js";import{isNumber as C}from"../../support/guards.js";import{getDisplayedSymbol as T}from"../../symbols/support/symbolUtils.js";import{getDrawHelpMessage as A}from"../../views/draw/support/helpMessageUtils.js";import P from"../../views/draw/support/HighlightHelper.js";import E from"../../views/interactive/sketch/SketchOptions.js";import U from"../../views/interactive/snapping/FeatureSnappingLayerSource.js";import{temporaryHighlightName as H}from"../../views/support/HighlightDefaults.js";import L from"./CreateFeaturesWorkflowData.js";import{isModelUpload as O,handleModelUpload as j}from"./modelUploadUtils.js";import x from"./Workflow.js";import{activeSketchToolDrawsUnsupportedCurve as D,createToolFromGeometryType as z,containsUnsupportedCurve as R,findEditorItemForLayer as W,getServiceEditsFromWorkflowData as G,getServiceInfoForLayer as N,orderEditsByRelationshipDependencies as K,getServiceLayersById as Z,startCreatingNewFeature as q,syncUpdateOptions as B,findLayerInfo as J,updateGraphicSymbolWhenRequired as Q,isTerminalUpdateEventType as X,getVisualVariableAttributes as Y,startUpdatingFeatureGeometry as $,createWorkflowSteps as ee,avoidFeatureTemplateSelectionWithOnlyOneItem as te,setUpSketchCreateWatchers as ae,setRelationshipFields as ie,prepareAttachmentsForCreateFeaturesWorkflow as re,showProgressCursor as se,setVisualVariablesAndElevationInfoForUpdate as oe,visualVariableInteractiveUpdate as ne}from"./workflowUtils.js";import le from"../FeatureForm/FeatureFormViewModel.js";import de from"../Sketch/SketchViewModel.js";var ce;const ue=Symbol(),pe=Symbol(),he=Symbol(),me=Symbol(),fe={point:["point"],multipoint:["multipoint"],polygon:["polygon","freehandPolygon","rectangle","circle"],polyline:["polyline","freehandPolyline"],mesh:[],multipatch:[]};let ge=ce=class extends x{constructor(e){super(e),this.type="create-features",this.createFeatureState="create-new",this.data=void 0,this.isNested=!1,this._getDrawMeshHelpMessage=void 0,this._webStyleCache=new Map,this._featureFormHandle=null,this._visualVariableAttributes={rotation:null,size:null},this._formViewModel=new le,this._sketchLayer=null,this._sketchViewModel=null,this._attachmentFileInfos=new Map,this._isActive=!0}initialize(){this.isNested&&(this._isActive=!1),this._initializeSketchViewModel()}destroy(){this._sketchViewModel.destroy()}get allowSave(){return!this.updating}get curveResizeDisabled(){return this.data.curveResizeDisabled}get curveUpdatesDisabled(){return this.data.curveUpdatesDisabled}get formViewModel(){return this._formViewModel}get hasInvalidFormTemplate(){return!!this.data.editorItem?.hasInvalidFormTemplate}get hasPendingEdits(){if(this.pendingFeatures.some(e=>!!this.data.getEditsForPendingFeature(e)?.modified))return!0;const{creationInfo:e,upload:t}=this.data,{activeComponent:a,createGraphic:i}=this._sketchViewModel,r=i?.geometry?.type;return!("polyline"!==r&&"polygon"!==r&&"multipoint"!==r||"draw-2d"!==a?.type&&"draw-3d"!==a?.type)&&a.drawOperation.committedVertices.length>0||(!(!t||"pending"!==t.state&&"success"!==t.state)||!!e?.geometryToPlace)}get hasPreviousStep(){return this._stepIndex>0||"update-pending"===this.createFeatureState&&!!this.data.selectedPendingFeature&&!this.parent&&!O(this.data.creationInfo)}get helpMessage(){const{creationInfo:e,viewModel:t}=this.data;if("creating-features"!==this.stepId||!e)return;const{_sketchViewModel:a}=this,{drawTool:i,isUsingLegacyCreateTools:r}=a;if(!r)return i?.helpMessageKey??"noTool";const s=e.layer.geometryType,o=a.createGraphic;if("mesh"===s){this._getDrawMeshHelpMessage||import("../../views/draw/support/helpMessageUtils3d.js").then(e=>{this._getDrawMeshHelpMessage=e.getDrawMeshHelpMessage});const{view:e}=t;return"3d"===e?.type?this._getDrawMeshHelpMessage?.(o,e):void 0}const{activeCreateToolDrawMode:n,activeTool:l}=a;return A("rectangle"===l||"circle"===l?l:s,o?.geometry,n)}get noticeMessage(){if(D(this._sketchViewModel,this.data.editorItem))return"curveToolDensifyWarning"}get layer(){return this.data.creationInfo?.layer}get numPendingFeatures(){return this.pendingFeatures.length}get numPendingFeaturesExcludingHidden(){return this.pendingFeatures.filter(e=>this.data.isDisplayable(e)).length}get parent(){return this.data.parent}get pendingFeatures(){return this.data.pendingFeatures}get keyboardCancellationEnabled(){return 0===this.numPendingFeatures}get reliesOnOwnerAdminPrivileges(){return this.data.editorItem?.capabilities.create.reliesOnOwnerAdminPrivileges??!1}get saveActionLabel(){return"create"}get shouldShowAttachments(){return(this.data.selectedPendingFeature&&this.data.editorItem?.capabilities.create.attachments.enabled)??!1}get shouldAllowAttachmentEditing(){return this.shouldShowAttachments}get sketchUpdateOptions(){const{editorItem:e}=this.data;return{enableScaling:!this.curveResizeDisabled,multipleSelectionEnabled:!1,reshapeOptions:{enableCreateCurveFromStraightEdge:!k(e?.layer)&&!!e?.capabilities.supportsTrueCurve}}}get sketchViewModel(){return this._sketchViewModel}get test(){}get availableCreateTools(){const e=this.data.creationInfo?.layer.geometryType,t=this.data.viewModel.view;if(!e)return[];if(this.data.creationInfo?.maxFeatures&&this.data.creationInfo.maxFeatures<=this.numPendingFeatures)return[];if(_(this.data.fullTemplate)){const{tool:t}=z(e,this.data.fullTemplate);return[t]}return"2d"!==t?.type&&"multipoint"===e?[]:[...fe[e]]}get _attachmentsActive(){const e=this.data.viewModel.attachmentsViewModel.mode,t=this.stepId;return this.shouldShowAttachments&&("add"===e||"edit"===e||"adding-attachment"===t||"editing-attachment"===t)}async enter(){this._isActive=!0,"awaiting-feature-creation-info"!==this.stepId&&await this._updatingHandles.addPromise(this._setUpCreatingFeaturesStep())}exit(){this._isActive=!1,this.removeHandles([he])}async updatePendingFeature(e){if(e!==this.data.selectedPendingFeature)return this._sketchViewModel.cancel(),this._startUpdating({feature:e})}async start(){return await super.start(),S(this.data.creationInfo?.layer)?null:{enter:async()=>{},exit:async()=>{},viewModel:this._sketchViewModel}}async save(e){const{formViewModel:t}=this;if(t.pendingSubtypeChoice)return;t.submit(),this._stashValidationState();const a=this.data.selectedPendingFeature,i=this._hasValidationErrors(a)?a:this.data.pendingFeatures.find(e=>this._hasValidationErrors(e));if(i)return await this._startUpdating({feature:i}),void t?.submit();const{pendingFeatures:r,editorItem:s}=this.data;if(s&&e&&R(r.toArray(),s)){if(!await e("curveEditingDensifyPrompt"))return this.reset()}return super.save()}back(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||O(this.data.creationInfo)||this._attachmentsActive||this.parent?super.back(e):this._clearSelectedFeature()}previous(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||O(this.data.creationInfo)||this._attachmentsActive?super.previous(e):this._clearSelectedFeature()}cancelFeature(e){this.data.isSharedTemplateWorkflow?o.getLogger(this).warn("Cannot cancel individual features created by shared templates."):(this.data.removePendingFeature(e),this.sketchViewModel.removeGraphic(e))}static create(e){const{addAttachmentsCallback:t,applyEdits:a,applyEditsFeatureService:i,isNested:r,creationInfo:s,parent:o,snappingManager:n,startAt:l,viewModel:d}=e,c=e.sketchOptions??new E,u=s?.layer,p=u?W(d.editorItems,u):void 0,h=new ce({data:new L({creationInfo:s,editorItem:p,parent:o,sketchOptions:c,snappingManager:n,viewModel:d}),isNested:r,onCommit:async e=>{const{creationInfo:r}=e;if(!r)return;h._sketchViewModel.cancel();const s=e.pendingFeatures.toArray(),{layer:o}=r,n=o.capabilities?.editing.supportsGlobalId&&"globalIdField"in o,l=h._attachmentFileInfos,{fullTemplate:c}=e,u=G(h.data),p=F(c)&&u;if(n){if(_e(s),p){let t=be(u,l);const a=await(N(o,d.view)?.load());a&&(t=K({edits:t,serviceInfo:a,view:d.view,findOriginalFeature:t=>e.getEditsForPendingFeature(t)?.initialFeature??t})),await i(c.featureService,t,{globalIdUsed:!0,honorSequenceOfEdits:!0,gdbVersion:c.layer.gdbVersion??void 0})}else{const e=Fe(s,l);await a(o,e,{globalIdUsed:!0})}return}const m=p?await i(c.featureService,u,{gdbVersion:c.layer.gdbVersion??void 0}):[await a(o,{addFeatures:s})];m&&l.size>0&&await Promise.all(m.map(e=>{if(e?.addFeatureResults)return t(o,ve(s,e.addFeatureResults,o,l))}))}});return h._set("steps",this._createWorkflowSteps(h,l)),h}_fadeExistingFeatures(e){if("effect"in e){const t=e.effect;return e.effect="saturate(0.6) opacity(0.8)",i(()=>e.effect=t)}const t=e.opacity;return e.opacity=.7,i(()=>e.opacity=t)}async _initializeFullTemplateAndExecutorInfo(e){const{creationInfo:t}=e,{view:a}=e.viewModel;if(!t||!a)return null;const i=await I(a,t.template);if(e.fullTemplate=i,i&&F(i)){const{createTemplateExecutor:r}=await import("../../editing/sharedTemplates/executor/createTemplateExecutor.js"),s={completionResults:[],executor:await r(i),serviceLayersById:Z(t.layer,a)};e.templateExecutorInfo=s}return i}async _startCreating(){this.removeHandles(pe);const{data:e}=this;if(!e.creationInfo)return;const t=this.data.creationInfo?.maxFeatures;if(t&&this.numPendingFeatures>=t)return this.sketchViewModel.cancel(),void(this.numPendingFeatures&&await this._startUpdating({feature:this.pendingFeatures.at(-1)}));this.createFeatureState="create-new",await q(this._sketchViewModel,this._sketchLayer,e,this._webStyleCache)}async _clearSelectedFeature(){const e=this._formViewModel.pendingSubtypeChoice;e&&(e.resolve("undo"),await e.promise),this._stashValidationState(),this.sketchViewModel.cancel(),this.data.selectedPendingFeature=null,this._featureFormHandle=n(this._featureFormHandle),this._formViewModel.feature=null;const t=this.data.viewModel.attachmentsViewModel;"add"!==t.mode&&"edit"!==t.mode||await(this.data.viewModel.activeWorkflow?.previous())}_stashValidationState(){const e=this._formViewModel.feature,t=e&&this.data.getEditsForPendingFeature(e);t&&(t.submittable=this._formViewModel.submittable)}async _selectFeatureForUpdate({feature:e,initialFeature:t=e}){this._stashValidationState();const{data:a,pendingFeatures:i,_webStyleCache:s}=this;i.includes(e)||a.addPendingFeature(e,t),a.selectedPendingFeature=e;const{_formViewModel:o,_sketchViewModel:l,sketchUpdateOptions:d}=this,{creationInfo:c,viewModel:p}=a,{attachmentsViewModel:h,layerInfos:m,view:f}=p;if(!f||!c)return;B(l,d),n(this._featureFormHandle);const g=e.sourceLayer,w=J(m,g),y=w?.formTemplate,v=f.spatialReference;o.set({editType:"INSERT",feature:e,formTemplate:y,spatialReference:v,map:f.map}),"add"!==h.mode&&"edit"!==h.mode||await(p.activeWorkflow?.previous()),h.graphic=e,h.fileInfos.removeAll(),h.mode="view";(this._attachmentFileInfos.get(e)||[]).forEach(({file:e,form:t})=>h.addFile(e,t)),await Q(e,s,"2d"===f.type?f.scale:null);const _=a.getEditsForPendingFeature(e);this._featureFormHandle=r([o.on("value-change",async({fieldName:t,value:a})=>{if(_?.updateAttributes(o.getValues()),C(a)){const e=this._visualVariableAttributes;e.size&&!e.size.isUpdatingInteractively&&t===e.size.field&&e.size.setInitialValue(a),e.rotation&&!e.rotation.isUpdatingInteractively&&t===e.rotation.field&&e.rotation.setInitialValue(a)}await Q(e,s,"2d"===f.type?f.scale:null)}),l.on(["update","undo","redo"],e=>{("undo"===e.type||"redo"===e.type||"update"===e.type&&null!=e.toolEventInfo&&X(e.toolEventInfo.type))&&o.notifyFeatureGeometryChanged()}),u(()=>o.feature?.sourceLayer,t=>e.sourceLayer=t),u(()=>[o.feature,o.submittable],()=>this._stashValidationState())]),this.createFeatureState="update-pending"}async _startUpdating({feature:e,initialFeature:t=e}){await this._selectFeatureForUpdate({feature:e,initialFeature:t});const{_sketchLayer:a,_sketchViewModel:i,data:r}=this,{creationInfo:s,viewModel:o}=r,{view:n}=o;if(!n||!s)return;const l=e.sourceLayer??s.layer;return S(l)?void 0:(this._visualVariableAttributes=Y(e),$({graphic:e,sketchLayer:a,sketchViewModel:i,sourceLayer:l,updateOptions:this.sketchUpdateOptions,visualVariables:this._visualVariableAttributes,webStyleCache:this._webStyleCache}))}static _createWorkflowSteps(e,t="awaiting-feature-creation-info"){const{data:a}=e,i=ee(["awaiting-feature-creation-info","creating-features","adding-attachment","editing-attachment"],t,{"awaiting-feature-creation-info":()=>({id:"awaiting-feature-creation-info",async setUp(){const{creationInfo:t,viewModel:i}=a,{view:r}=i;r&&(O(t)?e.addHandles(await j({view:r,data:a,next:()=>e.next(),cancel:()=>i.cancelWorkflow({warnIfNoWorkflow:!1})}),this.id):(a.parent&&t&&e.addHandles(i.restrictFeatureTemplatesViewModelToLayer(t.layer),this.id),e.addHandles(i.featureTemplatesViewModel.on("select",({item:t})=>{t&&(a.creationInfo={...a.creationInfo,layer:t.layer,template:t.template},e.next())}),this.id)))},async tearDown(){e.removeHandles(this.id)}}),"creating-features":()=>({id:"creating-features",async setUp(){e._isActive&&await e._setUpCreatingFeaturesStep()},async tearDown(t){const{viewModel:i}=a;t.canceled&&(e.removeHandles([he,ue,pe,me]),i.attachmentsViewModel.fileInfos.removeAll(),e._attachmentFileInfos.clear())}}),"adding-attachment":()=>({id:"adding-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}})});return te(a,i)}static _configureSketchViewModel(e){const{data:t,_sketchLayer:a,_sketchViewModel:s,_webStyleCache:o}=e,{creationInfo:n,viewModel:l}=t,{view:d}=l,h=[];if(!d)return i();if("2d"===d.type){n&&h.push(e._fadeExistingFeatures(n.layer));const t=c((e,t)=>Promise.all(e.map(e=>Q(e,o,t))));h.push(u(()=>d.scale,e=>t(a.graphics,e)))}const m=b(t.fullTemplate,n?.attributeOverrides,n?.layer),f=u(()=>s.createGraphic&&s.activeComponent,()=>{s.createGraphic&&s.activeComponent&&!e.hasHandles(pe)&&e._updatingHandles.consumePromise(ae({creationAttributes:m,data:t,sketchViewModel:s,view:d,webStyleCache:o}).then(t=>e.addHandles(t,pe)))}),g=async t=>{if("cancel"!==t.state&&"complete"!==t.state||e.removeHandles(pe),"cancel"===t.state&&null!==d.activeTool&&d.activeTool!==e.sketchViewModel.activeComponent&&(await e._waitForActiveToolCleared(),await e._startCreating()),"complete"===t.state&&t.graphic){const a=await e._processEdits(t.graphic,{scale:"2d"===d.type?d.scale:null,useSourceLayer:!0,webStyleCache:e._webStyleCache});a&&(await e._waitForActiveToolCleared(),await e._startUpdating({feature:a}))}},w=async i=>{const{attachmentsViewModel:r}=l,{_formViewModel:o}=e;if(i.graphics.length>1)return void await e._clearSelectedFeature();const c=i.graphics[0];if("complete"===i.state){const{submittable:t}=o;if(e.numPendingFeatures!==n?.maxFeatures&&t||o.submit(),await e._clearSelectedFeature(),"add"!==r.mode&&"edit"!==r.mode||await(l.activeWorkflow?.previous()),!i.aborted&&d.activeTool===e.sketchViewModel.activeComponent&&(await e.sketchViewModel.wait(),"ready"===e.sketchViewModel.state&&"mesh"!==e.data.creationInfo?.layer.geometryType))return e._startCreating()}else{if("start"===i.state)return c.sourceLayer??=t.creationInfo?.layer,await oe({graphic:c,sketchLayer:a,sketchViewModel:s,visualVariables:e._visualVariableAttributes,webStyleCache:e._webStyleCache,sourceLayer:c.sourceLayer}),e._selectFeatureForUpdate({feature:c});if("active"===i.state){await e.updatePendingFeature(c);const t=e._visualVariableAttributes;ne(d,c,i,t)&&await Q(c,e._webStyleCache,"2d"===d.type?d.scale:null);const a=c.attributes,{rotation:r,size:s}=t;if(null!=r){const{field:e}=r;o.setValue(e,a[e])}if(null!=s){const{field:e}=s;o.setValue(e,a[e])}}}},y=async a=>{if(a.graphics.forEach(e=>{t.removePendingFeature(e)}),!O(t.creationInfo))return e._startCreating()},v=async()=>{if(O(t.creationInfo))try{await e.data.viewModel.back()}catch{}return e._startCreating()};h.push(f,s.on("create",t=>e._updatingHandles.addPromise(g(t))),s.on("update",t=>e._updatingHandles.addPromise(w(t))),s.on("delete",t=>e._updatingHandles.addPromise(y(t))),p(()=>!e.numPendingFeatures,()=>e._updatingHandles.addPromise(v())),i(()=>{s.cancel()}),we(s,a,t),...ye(t));const _=r(h);return s.addHandles(_),_}_initializeSketchViewModel(){const{data:e}=this,{view:t}=e.viewModel,a=new V({elevationInfo:e.creationInfo?.layer.elevationInfo,internal:!0,listMode:"hide",title:"createFeaturesWorkflow-internal"}),r=new de({layer:a,creationMode:"single",sketchOptions:e.sketchOptions,snappingManager:e.snappingManager,useLegacyCreateTools:e.viewModel.useLegacyCreateTools,updateOnGraphicClick:!1,defaultUpdateOptions:this.sketchUpdateOptions,view:t});this._sketchLayer=a,this._sketchViewModel=r,t?.map.add(a),this.addHandles([i(()=>{t?.destroyed||t?.map.remove(a),a.destroy()}),u(()=>this.numPendingFeatures>0,e=>this._sketchViewModel.updateOnGraphicClick=e,h),u(()=>this.sketchUpdateOptions,e=>{r.defaultUpdateOptions=e,B(r,e)},m)])}_hasValidationErrors(e){return!!e&&(!this.data.isSubmittable(e)||!!this._formViewModel.validateContingencyConstraints(e.attributes,{includeIncompleteViolations:!0})?.length)}async _processEdits(e,t){const{data:a,_formViewModel:i,_sketchLayer:r}=this,{layerInfos:s,view:o}=a.viewModel;i.editType="INSERT",i.map=o?.map,i.spatialReference=o?.spatialReference;const{templateExecutorInfo:n}=a;if(!n){const t=e.clone();return t.geometry=null,await this._addAndInitializeEdits(e,t),e}r.remove(e);const{executor:l}=n,c=l(e.geometry,"completion"),u=d(c)?await c:c;n.completionResults.push(u),ie(u.relationships),i.editType="INSERT",i.map=o?.map,i.spatialReference=o?.spatialReference,u.primary&&a.creationInfo?.attributeOverrides&&(u.primary.graphic.attributes={...u.primary.graphic.attributes,...a.creationInfo.attributeOverrides});for(const d of u.edits){let e=null;if(d.addFeatures)for(const a of d.addFeatures){const i=a.clone();i.geometry=null,null!=a.geometry&&(a.symbol=await T(a,t),r.add(a)),a.sourceLayer!==e?.layer&&(e=J(s,a.sourceLayer));const o=!!u.associationGraphics?.has(a);await this._addAndInitializeEdits(a,i,e,o)}}i.feature=null,await f(()=>!i.updating);return u.edits.reduce((e,t)=>e+(t.addFeatures?.length??0),0)>1?null:u.primary?.graphic}async _addAndInitializeEdits(e,t,a,i=!1){const{data:r,_formViewModel:s}=this,{layerInfos:o}=r.viewModel,n=r.addPendingFeature(e,t,{isAssociation:i});a??=J(o,e.sourceLayer),s.feature=e,s.formTemplate=a?.formTemplate,await f(()=>!s.updating),n.updateAttributes(s.getValues()),n.submittable=s.submittable}async _setUpCreatingFeaturesStep(){if(this.hasHandles(he))return;const{data:e,sketchViewModel:s}=this,{creationInfo:o,viewModel:l}=e,{attachmentsViewModel:d,view:c}=l;if(!c||!o?.layer)throw new a("missing-parameters","CreateFeaturesWorkflow requires a view and creationInfo.");const{initialFeature:p,layer:m}=o,f=[],g=[];this._featureFormHandle=n(this._featureFormHandle),this._visualVariableAttributes={rotation:null,size:null},e.editorItem=W(l.editorItems,o.layer),o.template&&(null==e.fullTemplate&&await this._initializeFullTemplateAndExecutorInfo(e),g.push(i(()=>{e.templateExecutorInfo&&(e.templateExecutorInfo.completionResults=[])}))),s.allowDeleteKey=!e.isSharedTemplateWorkflow,re(d),f.push(u(()=>d.mode,e=>{switch(e){case"add":this.go("adding-attachment");break;case"edit":this.go("editing-attachment")}}));const w=se(c);f.push(w);const y=S(o.layer),{template:v}=o,F=!v||M(v)||_(v)&&"feature"===v.type,I=y&&F;try{if(I){const a=p??new t({attributes:b(e.fullTemplate,o.attributeOverrides,m),sourceLayer:m}),i=await this._processEdits(a);i&&await this._startUpdating({feature:i})}else f.push(ce._configureSketchViewModel(this)),p?(O(o)&&o.geometryToPlace&&(p.attributes=b(e.fullTemplate,o.attributeOverrides,m)),s.addGraphic(p),await this._startUpdating({feature:p})):await this._startCreating()}finally{w.remove()}const V=i(()=>{for(const t of e.pendingFeatures)s.removeGraphic(t),e.removePendingFeature(t)}),k=u(()=>c?.timeZone,e=>{this._formViewModel.timeZone=e,this.data.timeZone=e},h),C=i(()=>{O(o)&&l.cancelWorkflow({warnIfNoWorkflow:!1})});this._featureFormHandle&&f.push(this._featureFormHandle),this.addHandles(f,this._handleKeys.beforeCommit),this.addHandles(g,this._handleKeys.afterCommit),this.addHandles([i(()=>d.fileInfos.removeAll()),r(f),r(g),C,V,k],he)}async _waitForActiveToolCleared(){const e=this.data.viewModel.view;if(null==e?.activeTool)return;const t=new AbortController;this.addHandles(s(t),me),await f(()=>null==e?.activeTool,t.signal),t.abort()}};function we(e,t,a){let s=null;const o=()=>e.snappingOptions.featureSources,n=()=>(s=new U({layer:t}),o().add(s),s),d=()=>{null!=s&&(o().remove(s),s=l(s))};return r([u(()=>{const e=a.creationInfo?.layer,t=o().find(t=>t.layer===e);return{hasFeatureLayerSource:!!t,enabled:t?.enabled??!1}},({hasFeatureLayerSource:e,enabled:t})=>{if(!e)return d();s??=n(),s.enabled=t},g),i(d)])}function ye(e){const t=e.viewModel.view;if(!t)return[];const a=[];if("3d"===t.type){const r=new P({view:t});a.push(u(()=>e.selectedPendingFeature,(e,t)=>{r.remove(e),r.add(t)}),i(()=>r.destroy()))}const r=new P({view:t,highlightName:H});return a.push(u(()=>e.temporaryHighlightFeature,e=>{r.removeAll(),r.add(e)}),i(()=>r.destroy())),a}function ve(e,t,a,i){const r=[];return t.forEach((t,s)=>{if(!t.error){const o=e[s],n=i.get(o)||[];o.attributes[a.objectIdField]=t.objectId,n.forEach(({form:e})=>r.push({feature:o,attachment:e}))}}),r}function _e(e){for(const t of e){const{sourceLayer:e}=t;e&&"globalIdField"in e&&null!=e.globalIdField&&(t.attributes[e.globalIdField]??=w())}}function Fe(e,t){const a=[];if(!t||0===t.size)return{addFeatures:e};for(const[i,r]of t)for(const{file:e}of r)a.push({feature:i,attachment:{globalId:w(),data:e}});return a.length?{addFeatures:e,addAttachments:a}:{addFeatures:e}}function be(e,t){return e.map(e=>{const{addFeatures:a}=e;if(!a||0===a.length)return e;const i=[];for(const r of a){const e=t.get(r);if(e)for(const{file:t}of e)i.push({feature:r,attachment:{globalId:w(),data:t}})}return i.length?{...e,addAttachments:i}:e})}e([y()],ge.prototype,"allowSave",null),e([y()],ge.prototype,"createFeatureState",void 0),e([y()],ge.prototype,"curveResizeDisabled",null),e([y()],ge.prototype,"curveUpdatesDisabled",null),e([y()],ge.prototype,"data",void 0),e([y({constructOnly:!0})],ge.prototype,"isNested",void 0),e([y()],ge.prototype,"formViewModel",null),e([y()],ge.prototype,"hasInvalidFormTemplate",null),e([y()],ge.prototype,"hasPendingEdits",null),e([y()],ge.prototype,"hasPreviousStep",null),e([y()],ge.prototype,"_getDrawMeshHelpMessage",void 0),e([y()],ge.prototype,"helpMessage",null),e([y()],ge.prototype,"noticeMessage",null),e([y()],ge.prototype,"layer",null),e([y()],ge.prototype,"parent",null),e([y()],ge.prototype,"keyboardCancellationEnabled",null),e([y()],ge.prototype,"reliesOnOwnerAdminPrivileges",null),e([y()],ge.prototype,"saveActionLabel",null),e([y()],ge.prototype,"shouldShowAttachments",null),e([y()],ge.prototype,"shouldAllowAttachmentEditing",null),e([y()],ge.prototype,"sketchUpdateOptions",null),e([y()],ge.prototype,"sketchViewModel",null),e([y()],ge.prototype,"availableCreateTools",null),e([y()],ge.prototype,"_attachmentsActive",null),ge=ce=e([v("esri.widgets.Editor.CreateFeaturesWorkflow")],ge);const Me=ge;export{Me as default};
2
+ import{__decorate as e}from"tslib";import t from"../../Graphic.js";import a from"../../core/Error.js";import{makeHandle as i,handlesGroup as r,abortHandle as s}from"../../core/handleUtils.js";import"../../core/has.js";import o from"../../core/Logger.js";import{removeMaybe as n,destroyMaybe as l}from"../../core/maybe.js";import{isPromiseLike as d,debounce as c}from"../../core/promiseUtils.js";import{watch as u,when as p,initial as h,sync as m,whenOnce as f,syncAndInitial as g}from"../../core/reactiveUtils.js";import{generateBracedUUID as w}from"../../core/uuid.js";import{property as y,subclass as v}from"../../core/accessorSupport/decorators.js";import{isSharedTemplateOrMetadata as _,isSharedTemplate as F,getCreationAttributes as b,isStandardFeatureTemplate as M}from"../../editing/templateUtils.js";import{getFullTemplate as I}from"../../editing/sharedTemplates/templateLoader.js";import V from"../../layers/GraphicsLayer.js";import{isSceneLayer as k,isTable as S}from"../../layers/support/layerUtils.js";import{isNumber as C}from"../../support/guards.js";import{getDisplayedSymbol as T}from"../../symbols/support/symbolUtils.js";import{getDrawHelpMessage as A}from"../../views/draw/support/helpMessageUtils.js";import P from"../../views/draw/support/HighlightHelper.js";import E from"../../views/interactive/sketch/SketchOptions.js";import U from"../../views/interactive/snapping/FeatureSnappingLayerSource.js";import{temporaryHighlightName as H}from"../../views/support/HighlightDefaults.js";import L from"./CreateFeaturesWorkflowData.js";import{isModelUpload as O,handleModelUpload as j}from"./modelUploadUtils.js";import x from"./Workflow.js";import{activeSketchToolDrawsUnsupportedCurve as D,createToolFromGeometryType as z,containsUnsupportedCurve as R,findEditorItemForLayer as W,getServiceEditsFromWorkflowData as G,getServiceInfoForLayer as N,orderEditsByRelationshipDependencies as K,getServiceLayersById as Z,startCreatingNewFeature as q,syncUpdateOptions as B,findLayerInfo as J,updateGraphicSymbolWhenRequired as Q,isTerminalUpdateEventType as X,getVisualVariableAttributes as Y,startUpdatingFeatureGeometry as $,createWorkflowSteps as ee,avoidFeatureTemplateSelectionWithOnlyOneItem as te,setUpSketchCreateWatchers as ae,setRelationshipFields as ie,prepareAttachmentsForCreateFeaturesWorkflow as re,showProgressCursor as se,setVisualVariablesAndElevationInfoForUpdate as oe,visualVariableInteractiveUpdate as ne}from"./workflowUtils.js";import le from"../FeatureForm/FeatureFormViewModel.js";import de from"../Sketch/SketchViewModel.js";var ce;const ue=Symbol(),pe=Symbol(),he=Symbol(),me=Symbol(),fe={point:["point"],multipoint:["multipoint"],polygon:["polygon","freehandPolygon","rectangle","circle"],polyline:["polyline","freehandPolyline"],mesh:[],multipatch:[]};let ge=ce=class extends x{constructor(e){super(e),this.type="create-features",this.createFeatureState="create-new",this.data=void 0,this.isNested=!1,this._getDrawMeshHelpMessage=void 0,this._webStyleCache=new Map,this._featureFormHandle=null,this._visualVariableAttributes={rotation:null,size:null},this._formViewModel=new le,this._sketchLayer=null,this._sketchViewModel=null,this._attachmentFileInfos=new Map,this._isActive=!0}initialize(){this.isNested&&(this._isActive=!1),this._initializeSketchViewModel()}destroy(){this._sketchViewModel.destroy()}get allowSave(){return!this.updating}get curveResizeDisabled(){return this.data.curveResizeDisabled}get curveUpdatesDisabled(){return this.data.curveUpdatesDisabled}get formViewModel(){return this._formViewModel}get hasInvalidFormTemplate(){return!!this.data.editorItem?.hasInvalidFormTemplate}get hasPendingEdits(){if(this.pendingFeatures.some(e=>!!this.data.getEditsForPendingFeature(e)?.modified))return!0;const{creationInfo:e,upload:t}=this.data,{activeComponent:a,createGraphic:i}=this._sketchViewModel,r=i?.geometry?.type;return!("polyline"!==r&&"polygon"!==r&&"multipoint"!==r||"draw-2d"!==a?.type&&"draw-3d"!==a?.type)&&a.drawOperation.committedVertices.length>0||(!(!t||"pending"!==t.state&&"success"!==t.state)||!!e?.geometryToPlace)}get hasPreviousStep(){return this._stepIndex>0||"update-pending"===this.createFeatureState&&!!this.data.selectedPendingFeature&&!this.parent&&!O(this.data.creationInfo)}get helpMessage(){const{creationInfo:e,viewModel:t}=this.data;if("creating-features"!==this.stepId||!e)return;const{_sketchViewModel:a}=this,{drawTool:i,isUsingLegacyCreateTools:r}=a;if(!r)return i?.helpMessageKey??"noTool";const s=e.layer.geometryType,o=a.createGraphic;if("mesh"===s){this._getDrawMeshHelpMessage||import("../../views/draw/support/helpMessageUtils3d.js").then(e=>{this._getDrawMeshHelpMessage=e.getDrawMeshHelpMessage});const{view:e}=t;return"3d"===e?.type?this._getDrawMeshHelpMessage?.(o,e):void 0}const{activeCreateToolDrawMode:n,activeTool:l}=a;return A("rectangle"===l||"circle"===l?l:s,o?.geometry,n)}get noticeMessage(){if(D(this._sketchViewModel,this.data.editorItem))return"curveToolDensifyWarning"}get layer(){return this.data.creationInfo?.layer}get numPendingFeatures(){return this.pendingFeatures.length}get numPendingFeaturesExcludingHidden(){return this.pendingFeatures.filter(e=>this.data.isDisplayable(e)).length}get parent(){return this.data.parent}get pendingFeatures(){return this.data.pendingFeatures}get keyboardCancellationEnabled(){return 0===this.numPendingFeatures}get reliesOnOwnerAdminPrivileges(){return this.data.editorItem?.capabilities.create.reliesOnOwnerAdminPrivileges??!1}get saveActionLabel(){return"create"}get shouldShowAttachments(){return(this.data.selectedPendingFeature&&this.data.editorItem?.capabilities.create.attachments.enabled)??!1}get shouldAllowAttachmentEditing(){return this.shouldShowAttachments}get sketchUpdateOptions(){const{editorItem:e}=this.data;return{enableScaling:!this.curveResizeDisabled,multipleSelectionEnabled:!1,reshapeOptions:{enableCreateCurveFromStraightEdge:!k(e?.layer)&&!!e?.capabilities.supportsTrueCurve}}}get sketchViewModel(){return this._sketchViewModel}get test(){}get availableCreateTools(){const e=this.data.creationInfo?.layer.geometryType,t=this.data.viewModel.view;if(!e)return[];if(this.data.creationInfo?.maxFeatures&&this.data.creationInfo.maxFeatures<=this.numPendingFeatures)return[];if(_(this.data.fullTemplate)){const{tool:t}=z(e,this.data.fullTemplate);return[t]}return"2d"!==t?.type&&"multipoint"===e?[]:[...fe[e]]}get _attachmentsActive(){const e=this.data.viewModel.attachmentsViewModel.mode,t=this.stepId;return this.shouldShowAttachments&&("add"===e||"edit"===e||"adding-attachment"===t||"editing-attachment"===t)}async enter(){this._isActive=!0,"awaiting-feature-creation-info"!==this.stepId&&await this._updatingHandles.addPromise(this._setUpCreatingFeaturesStep())}exit(){this._isActive=!1,this.removeHandles([he])}async updatePendingFeature(e){if(e!==this.data.selectedPendingFeature)return this._sketchViewModel.cancel(),this._startUpdating({feature:e})}async start(){return await super.start(),S(this.data.creationInfo?.layer)?null:{enter:async()=>{},exit:async()=>{},viewModel:this._sketchViewModel}}async save(e){const{formViewModel:t}=this;if(t.pendingSubtypeChoice)return;t.submit(),this._stashValidationState();const a=this.data.selectedPendingFeature,i=this._hasValidationErrors(a)?a:this.data.pendingFeatures.find(e=>this._hasValidationErrors(e));if(i)return await this._startUpdating({feature:i}),void t?.submit();const{pendingFeatures:r,editorItem:s}=this.data;if(s&&e&&R(r.toArray(),s)){if(!await e("curveEditingDensifyPrompt"))return this.reset()}return super.save()}back(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||O(this.data.creationInfo)||this._attachmentsActive||this.parent?super.back(e):this._clearSelectedFeature()}previous(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||O(this.data.creationInfo)||this._attachmentsActive?super.previous(e):this._clearSelectedFeature()}cancelFeature(e){this.data.isSharedTemplateWorkflow?o.getLogger(this).warn("Cannot cancel individual features created by shared templates."):(this.data.removePendingFeature(e),this.sketchViewModel.removeGraphic(e))}static create(e){const{addAttachmentsCallback:t,applyEdits:a,applyEditsFeatureService:i,isNested:r,creationInfo:s,parent:o,snappingManager:n,startAt:l,viewModel:d}=e,c=e.sketchOptions??new E,u=s?.layer,p=u?W(d.editorItems,u):void 0,h=new ce({data:new L({creationInfo:s,editorItem:p,parent:o,sketchOptions:c,snappingManager:n,viewModel:d}),isNested:r,onCommit:async e=>{const{creationInfo:r}=e;if(!r)return;h._sketchViewModel.cancel();const s=e.pendingFeatures.toArray(),{layer:o}=r,n=o.capabilities?.editing.supportsGlobalId&&"globalIdField"in o,l=h._attachmentFileInfos,{fullTemplate:c}=e,u=G(h.data),p=F(c)&&u;if(n){if(_e(s),p){let t=be(u,l);const a=await(N(o,d.view)?.load());a&&(t=K({edits:t,serviceInfo:a,view:d.view,findOriginalFeature:t=>e.getEditsForPendingFeature(t)?.initialFeature??t})),await i(c.featureService,t,{globalIdUsed:!0,honorSequenceOfEdits:!0,gdbVersion:c.layer.gdbVersion??void 0})}else{const e=Fe(s,l);await a(o,e,{globalIdUsed:!0})}return}const m=p?await i(c.featureService,u,{gdbVersion:c.layer.gdbVersion??void 0}):[await a(o,{addFeatures:s})];m&&l.size>0&&await Promise.all(m.map(e=>{if(e?.addFeatureResults)return t(o,ve(s,e.addFeatureResults,o,l))}))}});return h._set("steps",this._createWorkflowSteps(h,l)),h}_fadeExistingFeatures(e){if("effect"in e){const t=e.effect;return e.effect="saturate(0.6) opacity(0.8)",i(()=>e.effect=t)}const t=e.opacity;return e.opacity=.7,i(()=>e.opacity=t)}async _initializeFullTemplateAndExecutorInfo(e){const{creationInfo:t}=e,{view:a}=e.viewModel;if(!t||!a)return null;const i=await I(a,t.template);if(e.fullTemplate=i,i&&F(i)){const{createTemplateExecutor:r}=await import("../../editing/sharedTemplates/executor/createTemplateExecutor.js"),s={completionResults:[],executor:await r(i),serviceLayersById:Z(t.layer,a)};e.templateExecutorInfo=s}return i}async _startCreating(){this.removeHandles(pe);const{data:e}=this;if(!e.creationInfo)return;const t=this.data.creationInfo?.maxFeatures;if(t&&this.numPendingFeatures>=t)return this.sketchViewModel.cancel(),void(this.numPendingFeatures&&await this._startUpdating({feature:this.pendingFeatures.at(-1)}));this.createFeatureState="create-new",await q(this._sketchViewModel,this._sketchLayer,e,this._webStyleCache)}async _clearSelectedFeature(){const e=this._formViewModel.pendingSubtypeChoice;e&&(e.resolve("undo"),await e.promise),this._stashValidationState(),this.sketchViewModel.cancel(),this.data.selectedPendingFeature=null,this._featureFormHandle=n(this._featureFormHandle),this._formViewModel.feature=null;const t=this.data.viewModel.attachmentsViewModel;"add"!==t.mode&&"edit"!==t.mode||await(this.data.viewModel.activeWorkflow?.previous())}_stashValidationState(){const e=this._formViewModel.feature,t=e&&this.data.getEditsForPendingFeature(e);t&&(t.submittable=this._formViewModel.submittable)}async _selectFeatureForUpdate({feature:e,initialFeature:t=e}){this._stashValidationState();const{data:a,pendingFeatures:i,_webStyleCache:s}=this;i.includes(e)||a.addPendingFeature(e,t),a.selectedPendingFeature=e;const{_formViewModel:o,_sketchViewModel:l,sketchUpdateOptions:d}=this,{creationInfo:c,viewModel:p}=a,{attachmentsViewModel:h,layerInfos:m,view:f}=p;if(!f||!c)return;B(l,d),n(this._featureFormHandle);const g=e.sourceLayer,w=J(m,g),y=w?.formTemplate,v=f.spatialReference;o.set({editType:"INSERT",feature:e,formTemplate:y,spatialReference:v,map:f.map}),"add"!==h.mode&&"edit"!==h.mode||await(p.activeWorkflow?.previous()),h.graphic=e,h.fileInfos.removeAll(),h.mode="view";(this._attachmentFileInfos.get(e)||[]).forEach(({file:e,form:t})=>h.addFile(e,t)),await Q(e,s,"2d"===f.type?f.scale:null);const _=a.getEditsForPendingFeature(e);this._featureFormHandle=r([o.on("value-change",async({fieldName:t,value:a})=>{if(_?.updateAttributes(o.getValues()),C(a)){const e=this._visualVariableAttributes;e.size&&!e.size.isUpdatingInteractively&&t===e.size.field&&e.size.setInitialValue(a),e.rotation&&!e.rotation.isUpdatingInteractively&&t===e.rotation.field&&e.rotation.setInitialValue(a)}await Q(e,s,"2d"===f.type?f.scale:null)}),l.on(["update","undo","redo"],e=>{("undo"===e.type||"redo"===e.type||"update"===e.type&&null!=e.toolEventInfo&&X(e.toolEventInfo.type))&&o.notifyFeatureGeometryChanged()}),u(()=>o.feature?.sourceLayer,t=>e.sourceLayer=t),u(()=>[o.feature,o.submittable],()=>this._stashValidationState())]),this.createFeatureState="update-pending"}async _startUpdating({feature:e,initialFeature:t=e}){await this._selectFeatureForUpdate({feature:e,initialFeature:t});const{_sketchLayer:a,_sketchViewModel:i,data:r}=this,{creationInfo:s,viewModel:o}=r,{view:n}=o;if(!n||!s)return;const l=e.sourceLayer??s.layer;return S(l)?void 0:(this._visualVariableAttributes=Y(e),$({graphic:e,sketchLayer:a,sketchViewModel:i,sourceLayer:l,updateOptions:this.sketchUpdateOptions,visualVariables:this._visualVariableAttributes,webStyleCache:this._webStyleCache}))}static _createWorkflowSteps(e,t="awaiting-feature-creation-info"){const{data:a}=e,i=ee(["awaiting-feature-creation-info","creating-features","adding-attachment","editing-attachment"],t,{"awaiting-feature-creation-info":()=>({id:"awaiting-feature-creation-info",async setUp(){const{creationInfo:t,viewModel:i}=a,{view:r}=i;r&&(O(t)?e.addHandles(await j({view:r,data:a,next:()=>e.next(),cancel:()=>i.cancelWorkflow({warnIfNoWorkflow:!1})}),this.id):(a.parent&&t&&e.addHandles(i.restrictFeatureTemplatesViewModelToLayer(t.layer),this.id),e.addHandles(i.featureTemplatesViewModel.on("select",({item:t})=>{t&&(a.creationInfo={...a.creationInfo,layer:t.layer,template:t.template},e.next())}),this.id)))},async tearDown(){e.removeHandles(this.id)}}),"creating-features":()=>({id:"creating-features",async setUp(){e._isActive&&await e._setUpCreatingFeaturesStep()},async tearDown(t){const{viewModel:i}=a;t.canceled&&(e.removeHandles([he,ue,pe,me]),i.attachmentsViewModel.fileInfos.removeAll(),e._attachmentFileInfos.clear())}}),"adding-attachment":()=>({id:"adding-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}})});return te(a,i)}static _configureSketchViewModel(e){const{data:t,_sketchLayer:a,_sketchViewModel:s,_webStyleCache:o}=e,{creationInfo:n,viewModel:l}=t,{view:d}=l,h=[];if(!d)return i();if("2d"===d.type){n&&h.push(e._fadeExistingFeatures(n.layer));const t=c((e,t)=>Promise.all(e.map(e=>Q(e,o,t))));h.push(u(()=>d.scale,e=>t(a.graphics,e)))}const m=b(t.fullTemplate,n?.attributeOverrides,n?.layer),f=u(()=>s.createGraphic&&s.activeComponent,()=>{s.createGraphic&&s.activeComponent&&!e.hasHandles(pe)&&e._updatingHandles.consumePromise(ae({creationAttributes:m,data:t,sketchViewModel:s,view:d,webStyleCache:o}).then(t=>e.addHandles(t,pe)))}),g=async t=>{if("cancel"!==t.state&&"complete"!==t.state||e.removeHandles(pe),"cancel"===t.state&&null!==d.activeTool&&d.activeTool!==e.sketchViewModel.activeComponent&&(await e._waitForActiveToolCleared(),await e._startCreating()),"complete"===t.state&&t.graphic){const a=await e._processEdits(t.graphic,{scale:"2d"===d.type?d.scale:null,useSourceLayer:!0,webStyleCache:e._webStyleCache});a&&(await e._waitForActiveToolCleared(),await e._startUpdating({feature:a}))}},w=async i=>{const{attachmentsViewModel:r}=l,{_formViewModel:o}=e;if(i.graphics.length>1)return void await e._clearSelectedFeature();const c=i.graphics[0];if("complete"===i.state){const{submittable:t}=o;if(e.numPendingFeatures!==n?.maxFeatures&&t||o.submit(),await e._clearSelectedFeature(),"add"!==r.mode&&"edit"!==r.mode||await(l.activeWorkflow?.previous()),!i.aborted&&d.activeTool===e.sketchViewModel.activeComponent&&(await e.sketchViewModel.wait(),"ready"===e.sketchViewModel.state&&"mesh"!==e.data.creationInfo?.layer.geometryType))return e._startCreating()}else{if("start"===i.state)return c.sourceLayer??=t.creationInfo?.layer,await oe({graphic:c,sketchLayer:a,sketchViewModel:s,visualVariables:e._visualVariableAttributes,webStyleCache:e._webStyleCache,sourceLayer:c.sourceLayer}),e._selectFeatureForUpdate({feature:c});if("active"===i.state){await e.updatePendingFeature(c);const t=e._visualVariableAttributes;ne(d,c,i,t)&&await Q(c,e._webStyleCache,"2d"===d.type?d.scale:null);const a=c.attributes,{rotation:r,size:s}=t;if(null!=r){const{field:e}=r;o.setValue(e,a[e])}if(null!=s){const{field:e}=s;o.setValue(e,a[e])}}}},y=async a=>{if(a.graphics.forEach(e=>{t.removePendingFeature(e)}),!O(t.creationInfo))return e._startCreating()},v=async()=>{if(O(t.creationInfo))try{await e.data.viewModel.back()}catch{}return e._startCreating()};h.push(f,s.on("create",t=>e._updatingHandles.addPromise(g(t))),s.on("update",t=>e._updatingHandles.addPromise(w(t))),s.on("delete",t=>e._updatingHandles.addPromise(y(t))),p(()=>!e.numPendingFeatures,()=>e._updatingHandles.addPromise(v())),i(()=>{s.cancel()}),we(s,a,t),...ye(t));const _=r(h);return s.addHandles(_),_}_initializeSketchViewModel(){const{data:e}=this,{view:t}=e.viewModel,a=new V({elevationInfo:e.creationInfo?.layer.elevationInfo,internal:!0,listMode:"hide",title:"createFeaturesWorkflow-internal"}),r=new de({layer:a,creationMode:"single",sketchOptions:e.sketchOptions,snappingManager:e.snappingManager,useLegacyCreateTools:e.viewModel.useLegacyCreateTools,updateOnGraphicClick:!1,defaultUpdateOptions:this.sketchUpdateOptions,view:t});this._sketchLayer=a,this._sketchViewModel=r,t?.map.add(a),this.addHandles([i(()=>{t?.destroyed||t?.map.remove(a),l(a)}),u(()=>this.numPendingFeatures>0,e=>this._sketchViewModel.updateOnGraphicClick=e,h),u(()=>this.sketchUpdateOptions,e=>{r.defaultUpdateOptions=e,B(r,e)},m)])}_hasValidationErrors(e){return!!e&&(!this.data.isSubmittable(e)||!!this._formViewModel.validateContingencyConstraints(e.attributes,{includeIncompleteViolations:!0})?.length)}async _processEdits(e,t){const{data:a,_formViewModel:i,_sketchLayer:r}=this,{layerInfos:s,view:o}=a.viewModel;i.editType="INSERT",i.map=o?.map,i.spatialReference=o?.spatialReference;const{templateExecutorInfo:n}=a;if(!n){const t=e.clone();return t.geometry=null,await this._addAndInitializeEdits(e,t),e}r.remove(e);const{executor:l}=n,c=l(e.geometry,"completion"),u=d(c)?await c:c;n.completionResults.push(u),ie(u.relationships),i.editType="INSERT",i.map=o?.map,i.spatialReference=o?.spatialReference,u.primary&&a.creationInfo?.attributeOverrides&&(u.primary.graphic.attributes={...u.primary.graphic.attributes,...a.creationInfo.attributeOverrides});for(const d of u.edits){let e=null;if(d.addFeatures)for(const a of d.addFeatures){const i=a.clone();i.geometry=null,null!=a.geometry&&(a.symbol=await T(a,t),r.add(a)),a.sourceLayer!==e?.layer&&(e=J(s,a.sourceLayer));const o=!!u.associationGraphics?.has(a);await this._addAndInitializeEdits(a,i,e,o)}}i.feature=null,await f(()=>!i.updating);return u.edits.reduce((e,t)=>e+(t.addFeatures?.length??0),0)>1?null:u.primary?.graphic}async _addAndInitializeEdits(e,t,a,i=!1){const{data:r,_formViewModel:s}=this,{layerInfos:o}=r.viewModel,n=r.addPendingFeature(e,t,{isAssociation:i});a??=J(o,e.sourceLayer),s.feature=e,s.formTemplate=a?.formTemplate,await f(()=>!s.updating),n.updateAttributes(s.getValues()),n.submittable=s.submittable}async _setUpCreatingFeaturesStep(){if(this.hasHandles(he))return;const{data:e,sketchViewModel:s}=this,{creationInfo:o,viewModel:l}=e,{attachmentsViewModel:d,view:c}=l;if(!c||!o?.layer)throw new a("missing-parameters","CreateFeaturesWorkflow requires a view and creationInfo.");const{initialFeature:p,layer:m}=o,f=[],g=[];this._featureFormHandle=n(this._featureFormHandle),this._visualVariableAttributes={rotation:null,size:null},e.editorItem=W(l.editorItems,o.layer),o.template&&(null==e.fullTemplate&&await this._initializeFullTemplateAndExecutorInfo(e),g.push(i(()=>{e.templateExecutorInfo&&(e.templateExecutorInfo.completionResults=[])}))),s.allowDeleteKey=!e.isSharedTemplateWorkflow,re(d),f.push(u(()=>d.mode,e=>{switch(e){case"add":this.go("adding-attachment");break;case"edit":this.go("editing-attachment")}}));const w=se(c);f.push(w);const y=S(o.layer),{template:v}=o,F=!v||M(v)||_(v)&&"feature"===v.type,I=y&&F;try{if(I){const a=p??new t({attributes:b(e.fullTemplate,o.attributeOverrides,m),sourceLayer:m}),i=await this._processEdits(a);i&&await this._startUpdating({feature:i})}else f.push(ce._configureSketchViewModel(this)),p?(O(o)&&o.geometryToPlace&&(p.attributes=b(e.fullTemplate,o.attributeOverrides,m)),s.addGraphic(p),await this._startUpdating({feature:p})):await this._startCreating()}finally{w.remove()}const V=i(()=>{for(const t of e.pendingFeatures)s.removeGraphic(t),e.removePendingFeature(t)}),k=u(()=>c?.timeZone,e=>{this._formViewModel.timeZone=e,this.data.timeZone=e},h),C=i(()=>{O(o)&&l.cancelWorkflow({warnIfNoWorkflow:!1})});this._featureFormHandle&&f.push(this._featureFormHandle),this.addHandles(f,this._handleKeys.beforeCommit),this.addHandles(g,this._handleKeys.afterCommit),this.addHandles([i(()=>d.fileInfos.removeAll()),r(f),r(g),C,V,k],he)}async _waitForActiveToolCleared(){const e=this.data.viewModel.view;if(null==e?.activeTool)return;const t=new AbortController;this.addHandles(s(t),me),await f(()=>null==e?.activeTool,t.signal),t.abort()}};function we(e,t,a){let s=null;const o=()=>e.snappingOptions.featureSources,n=()=>(s=new U({layer:t}),o().add(s),s),d=()=>{null!=s&&(o().remove(s),s=l(s))};return r([u(()=>{const e=a.creationInfo?.layer,t=o().find(t=>t.layer===e);return{hasFeatureLayerSource:!!t,enabled:t?.enabled??!1}},({hasFeatureLayerSource:e,enabled:t})=>{if(!e)return d();s??=n(),s.enabled=t},g),i(d)])}function ye(e){const t=e.viewModel.view;if(!t)return[];const a=[];if("3d"===t.type){const r=new P({view:t});a.push(u(()=>e.selectedPendingFeature,(e,t)=>{r.remove(e),r.add(t)}),i(()=>r.destroy()))}const r=new P({view:t,highlightName:H});return a.push(u(()=>e.temporaryHighlightFeature,e=>{r.removeAll(),r.add(e)}),i(()=>r.destroy())),a}function ve(e,t,a,i){const r=[];return t.forEach((t,s)=>{if(!t.error){const o=e[s],n=i.get(o)||[];o.attributes[a.objectIdField]=t.objectId,n.forEach(({form:e})=>r.push({feature:o,attachment:e}))}}),r}function _e(e){for(const t of e){const{sourceLayer:e}=t;e&&"globalIdField"in e&&null!=e.globalIdField&&(t.attributes[e.globalIdField]??=w())}}function Fe(e,t){const a=[];if(!t||0===t.size)return{addFeatures:e};for(const[i,r]of t)for(const{file:e}of r)a.push({feature:i,attachment:{globalId:w(),data:e}});return a.length?{addFeatures:e,addAttachments:a}:{addFeatures:e}}function be(e,t){return e.map(e=>{const{addFeatures:a}=e;if(!a||0===a.length)return e;const i=[];for(const r of a){const e=t.get(r);if(e)for(const{file:t}of e)i.push({feature:r,attachment:{globalId:w(),data:t}})}return i.length?{...e,addAttachments:i}:e})}e([y()],ge.prototype,"allowSave",null),e([y()],ge.prototype,"createFeatureState",void 0),e([y()],ge.prototype,"curveResizeDisabled",null),e([y()],ge.prototype,"curveUpdatesDisabled",null),e([y()],ge.prototype,"data",void 0),e([y({constructOnly:!0})],ge.prototype,"isNested",void 0),e([y()],ge.prototype,"formViewModel",null),e([y()],ge.prototype,"hasInvalidFormTemplate",null),e([y()],ge.prototype,"hasPendingEdits",null),e([y()],ge.prototype,"hasPreviousStep",null),e([y()],ge.prototype,"_getDrawMeshHelpMessage",void 0),e([y()],ge.prototype,"helpMessage",null),e([y()],ge.prototype,"noticeMessage",null),e([y()],ge.prototype,"layer",null),e([y()],ge.prototype,"parent",null),e([y()],ge.prototype,"keyboardCancellationEnabled",null),e([y()],ge.prototype,"reliesOnOwnerAdminPrivileges",null),e([y()],ge.prototype,"saveActionLabel",null),e([y()],ge.prototype,"shouldShowAttachments",null),e([y()],ge.prototype,"shouldAllowAttachmentEditing",null),e([y()],ge.prototype,"sketchUpdateOptions",null),e([y()],ge.prototype,"sketchViewModel",null),e([y()],ge.prototype,"availableCreateTools",null),e([y()],ge.prototype,"_attachmentsActive",null),ge=ce=e([v("esri.widgets.Editor.CreateFeaturesWorkflow")],ge);const Me=ge;export{Me as default};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9784],{83027(e,t,i){i.d(t,{h:()=>r});const r=i(29953).ho},29784(e,t,i){i.r(t),i.d(t,{default:()=>ke});var r=i(5482),s=i(37838),o=i(11254),n=i(69540),a=i(7762),l=i(49186),u=i(4718),d=i(53966),p=i(97768),y=i(25728),c=i(93637),h=i(17676),g=i(39516),f=i(91429),m=i(89317),b=i(78247),w=i(16930),v=i(55156),C=i(60950),T=i(89808),F=i(99959);const M=Symbol("isFeatureGraphicOrigin");var _;class S extends F.A{get[(_=M,C.ym)](){return this.layer}get[v.e](){return this.layer}get[T.Q](){return this.layer}constructor(e){super(),this[_]=!0,this.type="feature",this.layer=e}get id(){return this.layer.id}}var I=i(4146),E=i(52106),O=i(44208),Z=i(92474),A=i(61893),j=i(83027),D=i(56507),q=i(5443),P=i(39829),L=i(50498),x=i(96520),R=i(58501),G=i(22671),k=i(7695);let J=0,N=class extends((0,Z.WV)((0,A.g)(a.A))){constructor(e){super(e),this._idToClientGeometry=null,this.type="memory"}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}get _workerGeometryType(){const e=this.layer?.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?"polygon":e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){await this.load(t);const i=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);(0,R.q)(e,this.layer.spatialReference,i);const r=G.A.fromJSON(i);if(!this._requiresClientGraphicMapping()||!this._idToClientGeometry)return r;const s=this.layer.objectIdField;for(const e of r.features){const t=e.attributes[s],i=this._idToClientGeometry.get(t);void 0!==i&&(e.geometry=i)}return r.geometryType=this.layer.geometryType,r}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new l.A("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const i=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return(0,R.q)(e,this.layer.spatialReference,i),i}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(e=>({count:e.count,extent:q.A.fromJSON(e.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}async queryAttributeBins(e,t={}){return await this.load(),this._connection.invoke("queryAttributeBins",e?.toJSON(),t)}async _applyEdits(e){if(!this._connection)throw new l.A("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField;let i=null;const r=[],s=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const o=e=>"objectId"in e&&null!=e.objectId?e.objectId:"attributes"in e&&null!=e.attributes[t]?e.attributes[t]:null;if(e.addFeatures&&(i=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const t of e.deleteFeatures){const e=o(t);null!=e&&r.push(e)}const n=e.updateFeatures&&this._idToClientGeometry?new Map:null;if(e.updateFeatures)for(const t of e.updateFeatures)if(s.push(this._serializeFeature(t)),n&&null!=t.geometry){const e=o(t);null!=e&&n.set(e,t)}(0,x.u)(i?i.features:null,s,this.layer.spatialReference);const{fullExtent:a,featureEditResults:u}=await this._connection.invoke("applyEdits",{adds:i?i.features:[],updates:s,deletes:r});return this.fullExtent=a,i&&i.finish(u.uidToObjectId),this._updateIdToClientGeometries(n,u),this._createEditsResult(u)}async _prepareClientMapping(e,t){if("mesh"!==this._layerOrSourceGeometryType||null==e)return;const i=[];for(const{geometry:r}of e)null==r||"mesh"!==r.type||r.hasExtent||r.loaded||i.push(r.load({signal:t}));i.length&&await Promise.all(i)}_updateIdToClientGeometries(e,t){if(this._idToClientGeometry){if(e)for(const i of t.updateResults){if(!i.success)continue;const t=e.get(i.objectId);null!=t&&this._addIdToClientGeometry(t)}for(const e of t.deleteResults)e.success&&this._idToClientGeometry.delete(e.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=!0===e.success?null:e.error||{code:void 0,description:""};return{objectId:e.objectId,globalId:e.globalId,error:t?new l.A("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,i=new Array(e.length);let r=null;for(let s=0;s<e.length;s++){const o=e[s],n=this._serializeFeature(o);r||null==o.geometry||(r=o.geometry.type),i[s]=n,t.set(`${n.uid}`,o)}const s=this;return{features:i,inferredGeometryType:r,finish(e){const i=s.sourceJSON.objectIdField;for(const r in e){const o=e[r],n=t.get(r);n&&(n.attributes||(n.attributes={}),-1===o?delete n.attributes[i]:n.attributes[i]=o,s._addIdToClientGeometry(n))}}}}_addIdToClientGeometry(e){if(!this._idToClientGeometry)return;const t=this.sourceJSON.objectIdField,i=e.attributes?.[t];null!=i&&this._idToClientGeometry.set(i,e.geometry??null)}get _layerOrSourceGeometryType(){return this.layer?.geometryType??this.sourceJSON?.geometryType}_requiresClientGraphicMapping(){return this._geometryTypeRequiresClientGraphicMapping(this._layerOrSourceGeometryType)}_geometryRequiresClientGraphicMapping(e){return this._geometryTypeRequiresClientGraphicMapping(e.type)}_geometryTypeRequiresClientGraphicMapping(e){return"mesh"===e||"multipatch"===e||"extent"===e}_serializeFeature(e){const{attributes:t}=e,i=this._geometryForSerialization(e),r=(J++).toString();return i?{uid:r,geometry:i.toJSON(),attributes:t}:{uid:r,attributes:t}}_geometryForSerialization(e){const{geometry:t}=e;return null==t?null:this._geometryRequiresClientGraphicMapping(t)?t.extent?P.A.fromExtent(t.extent):null:t}async _startWorker(e){this._connection=await(0,j.h)("MemorySourceWorker",{strategy:(0,O.A)("feature-layers-workers")?"dedicated":"local",signal:e,registryTarget:this});const{fields:t,spatialReference:i,objectIdField:r,hasM:s,hasZ:o,timeInfo:n,dateFieldsTimeZone:a}=this.layer,l="defaults"===this.layer.originOf("spatialReference");await this._prepareClientMapping(this.items,e);const u=this._prepareAddFeatures(this.items);this.addHandles(this.on("before-changes",e=>{d.A.getLogger(this).error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),e.preventDefault()}));const p={features:u.features,fields:t?.map(e=>e.toJSON()),geometryType:L.Ye.toJSON(this._workerGeometryType),hasM:"mesh"!==this._layerOrSourceGeometryType&&s,hasZ:"mesh"===this._layerOrSourceGeometryType||o,objectIdField:r,spatialReference:l?null:i&&i.toJSON(),timeInfo:n?.toJSON()??null,dateFieldsTimeZone:a},y=await this._connection.invoke("load",p,{signal:e});for(const e of y.warnings)d.A.getLogger(this.layer).warn("#load()",`${e.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:e});y.featureErrors.length&&d.A.getLogger(this.layer).error("#load()",`Failed to load ${y.featureErrors.length} features due to errors. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}').`,y.featureErrors.map(e=>"\n\n- "+e.error.description).join(""));const c=y.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(u.inferredGeometryType)&&(c.geometryType=L.Ye.toJSON(u.inferredGeometryType)),this.sourceJSON=c,this._requiresClientGraphicMapping()&&(this._idToClientGeometry=new Map),u.finish(y.assignedObjectIds)}};(0,r.Cg)([(0,k.u)({Type:E.A,ensureType:(0,D.dp)(E.A)})],N.prototype,"itemType",void 0),(0,r.Cg)([(0,f.MZ)()],N.prototype,"type",void 0),(0,r.Cg)([(0,f.MZ)({constructOnly:!0})],N.prototype,"layer",void 0),(0,r.Cg)([(0,f.MZ)({readOnly:!0})],N.prototype,"_workerGeometryType",null),(0,r.Cg)([(0,f.MZ)()],N.prototype,"sourceJSON",void 0),N=(0,r.Cg)([(0,f.$K)("esri.layers.graphics.sources.MemorySource")],N);var V=i(52136),K=i(18768),$=i(63074),Q=i(69208),W=i(6455),z=i(47685),B=i(87718),U=i(10086),H=i(56658),Y=i(16131),X=i(32756),ee=i(8303),te=i(69622);let ie=class extends te.A{constructor(e){super(e),this.updating=!1,this.status="unknown"}};(0,r.Cg)([(0,f.MZ)()],ie.prototype,"updating",void 0),(0,r.Cg)([(0,f.MZ)()],ie.prototype,"status",void 0),ie=(0,r.Cg)([(0,f.$K)("esri.layers.support.PublishingInfo")],ie);const re=Symbol(),se=e=>{var t;const i=e;let s=class extends i{constructor(){super(...arguments),this[t]=!0}static{t=re}get publishingInfo(){if(this.destroyed)return null;const e=this._get("publishingInfo");if(e)return e;const t=new ie;return this._checkPublishingStatus(t),t}_checkPublishingStatus(e){let t=0;const i=async s=>{let o;e.updating=!0;try{o=await this.fetchPublishingStatus()}catch(e){o="unavailable"}"published"!==o&&"unavailable"!==o||("publishing"===e.status&&this.refresh(),r.remove()),e.status=o,e.updating=!1,r.removed||(t=setTimeout(i,s,s+125))},r={removed:!1,remove(){this.removed=!0,clearTimeout(t)}};this.when().catch(()=>r.remove()),i(250),this.addHandles(r)}};return(0,r.Cg)([(0,f.MZ)({readOnly:!0,clonable:!1})],s.prototype,"publishingInfo",null),s=(0,r.Cg)([(0,f.$K)("esri.layers.mixins.PublishableLayer")],s),s};var oe=i(54310),ne=i(25036),ae=i(82935),le=i(63396),ue=i(60694),de=i(10873),pe=i(15426),ye=i(29005),ce=i(33143),he=i(30279),ge=i(16194),fe=i(17036),me=i(30524),be=i(46499),we=i(39383),ve=i(6666),Ce=i(96184),Te=i(17311),Fe=i(91908),Me=i(65494),_e=i(8947),Se=i(41214),Ie=i(65615),Ee=i(61956),Oe=i(54218),Ze=i(30291),Ae=i(33910),je=i(78553),De=i(59923),qe=i(36005),Pe=i(43937);const Le="FeatureLayer";function xe(e){return e&&e instanceof a.A}const Re=(0,fe.p)();function Ge(e,t,i){const r=!!i?.writeLayerSchema;return{enabled:r,ignoreOrigin:r}}let ke=class extends((0,U.j)((0,H.J)((0,B.F)(se((0,z.w6)((0,W.FJ)((0,$.dM)((0,X.fY)((0,ae.e)((0,le.d)((0,ne.j)((0,oe.J)((0,K.b)((0,Y.q)((0,ee.A)((0,y.M)((0,Q.d)((0,V.p)((0,n.OU)(I.A)))))))))))))))))))){constructor(...e){super(...e),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new S(this),this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=w.A.WGS84,this.subtypeCode=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=(0,h.sg)(async(e,t,r)=>{const{save:s,saveAs:o}=await i.e(3359).then(i.bind(i,33359));switch(e){case 0:return s(this,t);case 1:return o(this,r,t)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(e=>this.initLayerProperties(e))),Promise.resolve(this);const i=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(h.QP).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new l.A("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>(0,pe.VA)(this,"load",e));return this.addResolvingPromise(i),Promise.resolve(this)}get _titleCreator(){const e=this._get("_titleCreator");return(0,p.pR)(e),new Te.A({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,(0,ve.S$)(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,i){return this._readEditingEnabled(t,!0,i)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,i,r){this._writeEditingEnabled(e,t,!0,r)}get effectiveEditingEnabled(){return(0,pe.C$)(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}set fieldConfigurations(e){if(this._hasMemorySource())return;if(this._override("fieldConfigurations",e),!this.loaded)return;const t=(0,ge.sS)(this,e);t&&this._set("popupTemplate",t)}get fieldConfigurations(){if(!this._hasMemorySource())return this._isOverridden("fieldConfigurations")?this._get("fieldConfigurations"):(0,ge.QX)(this)||null}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,i,r){r?.writeLayerSchema&&(0,c.sM)(i,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return(0,pe.jD)(t.layerDefinition||t)}readObjectIdField(e,t){return(0,pe.Zm)(t.layerDefinition||t)}writePopupTemplate(e,t,i,r){e&&(t[i]=e.toJSON({...r,writeFieldFormat:!r?.writeLayerSchema}))}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){(0,me.yp)(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,i){t=t.layerDefinition||t;const r=t.drawingInfo?.renderer;if(r){const e=(0,Me.L)(r,t,i)??void 0;return e||d.A.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:i}),e}return(0,pe.PD)(t,i)}get source(){return this._get("source")}set source(e){e||(e=null);const t=this._get("source");t!==e&&((Array.isArray(e)||e instanceof a.A)&&(e=new N({layer:this,items:e})),xe(t)&&this._resetMemorySource(t),xe(e)&&this._initMemorySource(e),this._set("source",e))}readSource(e,t){const i=G.A.fromJSON(t.featureSet);return new N({layer:this,items:i?.features??[]})}readTemplates(e,t){const i=t.editFieldsInfo,r=i?.creatorField,s=i?.editorField;return e=e?.map(e=>ye.A.fromJSON(e)),this._fixTemplates(e,r),this._fixTemplates(e,s),e}readTitle(e,t){const i=t.layerDefinition?.name??t.name,r=t.title||t.layerDefinition?.title;if(i){if("item-title"===this.sublayerTitleMode)return this.url?(0,ue.yG)(this.url,i):i;let e=i;if(!e&&this.url){const t=(0,ue.qg)(this.url);null!=t&&(e=t.title)}if(!e)return;const t=this.portalItem?.title;return"item-title-and-service-name"===this.sublayerTitleMode&&t&&t!==e&&(e=t+" - "+e),(0,ue.cr)(e)}if("item-title"===this.sublayerTitleMode&&r)return r}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let i=(t=t.layerDefinition||t).typeIdField;if(i&&t.fields){i=i.toLowerCase();const e=t.fields.find(e=>e.name.toLowerCase()===i);e&&(i=e.name)}return i}readTypes(e,t){e=(t=t.layerDefinition||t).types;const i=t.editFieldsInfo,r=i?.creatorField,s=i?.editorField;return e?.map(e=>(e=ce.A.fromJSON(e),this._fixTemplates(e.templates,r),this._fixTemplates(e.templates,s),e))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t){const i=await(0,pe.Xl)(this,e,t,Le);return this.lastEditsEventDate=new Date,i}async updateAttachment(e,t,i){const r=await(0,pe.bt)(this,e,t,i,Le);return this.lastEditsEventDate=new Date,r}async applyEdits(e,t){return(0,pe.ct)(this,e,t)}async uploadAssets(e,t){return(0,pe.rn)(this,e,t)}createFieldConfigurations(){return(0,ge.xY)(this)}createPopupTemplate(e){return(0,Ze.tn)(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await(0,h.qr)(Promise.all([i.e(893),i.e(3636)]).then(i.bind(i,65515)),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=(0,pe.VZ)(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,i=(0,g.mA)(this.definitionExpression,t);return e.where=i||"1=1",e}async deleteAttachments(e,t){const i=await(0,pe.mm)(this,e,t,Le);return this.lastEditsEventDate=new Date,i}async fetchRecomputedExtents(e){return(0,pe.WP)(this,e,Le)}async getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}async getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getFeatureType(e){return(0,pe.xd)(this.types,this.typeIdField,e)}getFieldAlias(e){const t=this.getField(e);if(t)return this.getFieldConfiguration(t.name)?.alias||t.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(t=>t.name.toLowerCase()===e)}getFieldDomain(e,t){return(0,pe.Vq)(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return(0,pe.lV)(this,e,t,Le)}async queryFeatures(e,t){const i=await this.load(),r=await i.source.queryFeatures(Ee.A.from(e)??i.createQuery(),t),s=this.graphicOrigin;if(r?.features)for(const e of r.features)e.layer=e.sourceLayer=i,e.origin=s;return r}async queryObjectIds(e,t){return await(0,pe.sg)(this,e,t,Le)}async queryFeatureCount(e,t){return(0,pe.Ye)(this,e,t,Le)}async queryExtent(e,t){return(0,pe.B5)(this,e,t,Le)}async queryRelatedFeatures(e,t){return(0,pe.hM)(this,e,t,Le)}async queryRelatedFeaturesCount(e,t){return(0,pe.S2)(this,e,t,Le)}async queryPivot(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryPivot||!s?.operations?.supportsQueryPivot)throw new l.A(Le,"Layer source does not support queryPivot capability");const o=await i.e(9958).then(i.bind(i,29958)),n=await r.queryPivot(o.default.from(e),t),a=this.graphicOrigin;if(n?.features)for(const e of n.features)e.layer=e.sourceLayer=this,e.origin=a;return n}async queryTopFeatures(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryTopFeatures||!s?.query?.supportsTopFeaturesQuery)throw new l.A(Le,"Layer source does not support queryTopFeatures capability");const o=await i.e(7561).then(i.bind(i,57561)),n=await r.queryTopFeatures(o.default.from(e),t),a=this.graphicOrigin;if(n?.features)for(const e of n.features)e.layer=e.sourceLayer=this,e.origin=a;return n}async queryAttributeBins(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryAttributeBins)throw new l.A(Le,"Layer source does not support queryAttributeBins capability");(0,pe.ZJ)(e,s,Le);const o=await i.e(4575).then(i.bind(i,14575)),n=await r.queryAttributeBins(o.default.from(e),t),a=this.graphicOrigin;if(n.features)for(const e of n.features)e.layer=e.sourceLayer=this,e.origin=a;return n}async queryTopObjectIds(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryTopObjectIds||!s?.query.supportsTopFeaturesQuery)throw new l.A(Le,"Layer source does not support queryTopObjectIds capability");const o=await i.e(7561).then(i.bind(i,57561));return(await r.queryTopObjectIds(o.default.from(e),t)).filter(Oe.Et)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryTopExtents||!s?.query?.supportsTopFeaturesQuery)throw new l.A(Le,"Layer source does not support queryTopExtents capability");const o=await i.e(7561).then(i.bind(i,57561));return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryTopCount||!s?.query?.supportsTopFeaturesQuery)throw new l.A(Le,"Layer source does not support queryFeatureCount capability");const o=await i.e(7561).then(i.bind(i,57561));return r.queryTopCount(o.default.from(e),t)}read(e,t){const i=e.featureCollection;if((i||"Feature Collection"===e.type)&&(this.resourceInfo=e),i){const{layers:e,showLegend:r}=i;1===e?.length&&(super.read(e[0],t),null!=r&&super.read({showLegend:r},t))}super.read(e,t),"service"===t?.origin&&(["objectIdField","fields","timeInfo","dateFieldsTimeZone"].forEach(e=>this.revertToOrigin(e,"service")),this.spatialReference||this.revertToOrigin("spatialReference","service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:i,layerContainerType:r}=t;if(this.dynamicDataSource)return(0,De.U4)(t,this,"a dynamic data source cannot be written to web scenes, web maps and feature service items"),null;if(this.isTable){if(("web-map"===i||"web-scene"===i)&&"tables"!==r)return(0,De.U4)(t,this,"a table source can only be written to tables"),null;if(this._hasMemorySource())return(0,De.U4)(t,this,"an in-memory table source cannot be written to web scenes and web maps"),null}else if(this.loaded&&("web-map"===i||"web-scene"===i)&&"tables"===r)return(0,De.U4)(t,this,"a non-table source cannot be written to tables in web maps or web scenes"),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new l.A(Le,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||(0,Fe.D)(this,e))}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_readEditingEnabled(e,t,i){let r=e.layerDefinition?.capabilities;return r?this._hasEditingCapability(r):(r=e.capabilities,t&&"web-map"===i?.origin&&!this._hasMemorySource()&&r?this._hasEditingCapability(r):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(e=>e.trim()).includes("editing")}_writeEditingEnabled(e,t,i,r){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";(0,c.sM)("layerDefinition.capabilities",e,t),i&&!r?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return(0,o.A)(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),(0,me.yp)(this.renderer,this.fieldsIndex),(0,me.sv)(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),(0,_e.L)(this,{origin:"service"})}async hasDataChanged(){return(0,pe.jp)(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some(e=>"geometry"===e.type)||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(e=>{const i=e.prototype?.attributes;i&&t&&delete i[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new l.A("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new l.A("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(e=>{e.layer=this,e.sourceLayer=this}),this.addHandles([e.on("after-add",e=>{e.item.layer=this,e.item.sourceLayer=this}),e.on("after-remove",e=>{e.item.layer=null,e.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(e=>{e.layer=null,e.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){const t=[...e.layers||[],...e.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id}};(0,r.Cg)([(0,f.MZ)({clonable:!1,readOnly:!0})],ke.prototype,"_titleCreator",null),(0,r.Cg)([(0,f.MZ)(de.zQ)],ke.prototype,"attributeTableTemplate",void 0),(0,r.Cg)([(0,qe.w)("service","capabilities")],ke.prototype,"readCapabilities",null),(0,r.Cg)([(0,f.MZ)({json:{origins:{"web-scene":{write:!1}},write:!0}})],ke.prototype,"charts",void 0),(0,r.Cg)([(0,f.MZ)({readOnly:!0})],ke.prototype,"createQueryVersion",null),(0,r.Cg)([(0,f.MZ)({json:{read:{source:"layerDefinition.copyrightText"}}})],ke.prototype,"copyright",void 0),(0,r.Cg)([(0,f.MZ)({json:{read:{source:"layerDefinition.displayField"}}})],ke.prototype,"displayField",void 0),(0,r.Cg)([(0,f.MZ)({types:Ae.Es,readOnly:!0})],ke.prototype,"defaultSymbol",void 0),(0,r.Cg)([(0,f.MZ)({type:Ie.A})],ke.prototype,"dynamicDataSource",void 0),(0,r.Cg)([(0,f.MZ)({type:Boolean})],ke.prototype,"editingEnabled",null),(0,r.Cg)([(0,qe.w)(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],ke.prototype,"readEditingEnabled",null),(0,r.Cg)([(0,qe.w)("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],ke.prototype,"readEditingEnabledFromWebMap",null),(0,r.Cg)([(0,Pe.K)(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],ke.prototype,"writeEditingEnabled",null),(0,r.Cg)([(0,Pe.K)("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],ke.prototype,"writeEditingEnabledToWebMap",null),(0,r.Cg)([(0,f.MZ)({readOnly:!0})],ke.prototype,"effectiveEditingEnabled",null),(0,r.Cg)([(0,f.MZ)({clonable:!1,readOnly:!0})],ke.prototype,"featureTitleFields",null),(0,r.Cg)([(0,f.MZ)({type:[he.A],json:{name:"layerDefinition.fieldConfigurations",write:{overridePolicy(e,t,i){return{enabled:!i?.writeLayerSchema,ignoreOrigin:1===this.originIdOf(t)}}}}})],ke.prototype,"fieldConfigurations",null),(0,r.Cg)([(0,f.MZ)({...Re.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:Ge}}}}})],ke.prototype,"fields",void 0),(0,r.Cg)([(0,f.MZ)(Re.fieldsIndex)],ke.prototype,"fieldsIndex",void 0),(0,r.Cg)([(0,f.MZ)({type:b.A,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],ke.prototype,"formTemplate",void 0),(0,r.Cg)([(0,f.MZ)({json:{read:{source:"layerDefinition.extent"}}})],ke.prototype,"fullExtent",void 0),(0,r.Cg)([(0,f.MZ)({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:Ge,writer(e,t,i){const r=e?pe.iX.toJSON(e):null;r&&(0,c.sM)(i,r,t)}}}},read:{source:"layerDefinition.geometryType",reader:pe.iX.read}}})],ke.prototype,"geometryType",void 0),(0,r.Cg)([(0,f.MZ)({readOnly:!0,clonable:!1})],ke.prototype,"graphicOrigin",void 0),(0,r.Cg)([(0,f.MZ)({json:{read:{source:"layerDefinition.hasM"}}})],ke.prototype,"hasM",void 0),(0,r.Cg)([(0,f.MZ)({json:{read:{source:"layerDefinition.hasZ"}}})],ke.prototype,"hasZ",void 0),(0,r.Cg)([(0,f.MZ)(de.id)],ke.prototype,"id",void 0),(0,r.Cg)([(0,f.MZ)({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],ke.prototype,"infoFor3D",void 0),(0,r.Cg)([(0,f.MZ)({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],ke.prototype,"isTable",void 0),(0,r.Cg)([(0,qe.w)("service","isTable",["type","geometryType"]),(0,qe.w)("isTable",["layerDefinition.type","layerDefinition.geometryType"])],ke.prototype,"readIsTable",null),(0,r.Cg)([(0,Pe.K)("web-map","isTable")],ke.prototype,"writeIsTable",null),(0,r.Cg)([(0,f.MZ)(de.kF)],ke.prototype,"labelsVisible",void 0),(0,r.Cg)([(0,f.MZ)({type:[be.A],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:we.w,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:we.w,write:{layerContainerTypes:m.K}}})],ke.prototype,"labelingInfo",void 0),(0,r.Cg)([(0,f.MZ)((()=>{const e=(0,u.o8)(de.Ih);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,i){(0,c.sM)(i,(0,je.p)(e),t)}}},e})())],ke.prototype,"opacity",void 0),(0,r.Cg)([(0,f.MZ)(de.fV)],ke.prototype,"legendEnabled",void 0),(0,r.Cg)([(0,f.MZ)({type:["show","hide"],json:(()=>{const e=(0,u.o8)(de.C1.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],ke.prototype,"listMode",void 0),(0,r.Cg)([(0,qe.w)("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],ke.prototype,"readGlobalIdField",null),(0,r.Cg)([(0,f.MZ)({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:Ge}}}}})],ke.prototype,"objectIdField",void 0),(0,r.Cg)([(0,qe.w)("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],ke.prototype,"readObjectIdField",null),(0,r.Cg)([(0,f.MZ)({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:m.K}}})],ke.prototype,"operationalLayerType",void 0),(0,r.Cg)([(0,f.MZ)(Re.outFields)],ke.prototype,"outFields",void 0),(0,r.Cg)([(0,f.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],ke.prototype,"path",void 0),(0,r.Cg)([(0,f.MZ)(de.M6)],ke.prototype,"popupEnabled",void 0),(0,r.Cg)([(0,f.MZ)({type:s.A,json:{name:"popupInfo",write:!0}})],ke.prototype,"popupTemplate",void 0),(0,r.Cg)([(0,Pe.K)("popupTemplate")],ke.prototype,"writePopupTemplate",null),(0,r.Cg)([(0,f.MZ)({readOnly:!0})],ke.prototype,"defaultPopupTemplate",null),(0,r.Cg)([(0,f.MZ)({types:Se.Hg,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:Se.XJ,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:m.K,overridePolicy:(e,t,i)=>({ignoreOrigin:i?.writeLayerSchema,layerContainerTypes:m.K})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,i)=>({ignoreOrigin:i?.writeLayerSchema,layerContainerTypes:m.K})}}})],ke.prototype,"renderer",null),(0,r.Cg)([(0,qe.w)("service","renderer",["drawingInfo.renderer","defaultSymbol"]),(0,qe.w)("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],ke.prototype,"readRenderer",null),(0,r.Cg)([(0,f.MZ)()],ke.prototype,"resourceInfo",void 0),(0,r.Cg)([(0,f.MZ)((()=>{const e=(0,u.o8)(de.PY);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],ke.prototype,"screenSizePerspectiveEnabled",void 0),(0,r.Cg)([(0,f.MZ)({clonable:!1})],ke.prototype,"source",null),(0,r.Cg)([(0,qe.w)("portal-item","source",["featureSet"]),(0,qe.w)("web-map","source",["featureSet"])],ke.prototype,"readSource",null),(0,r.Cg)([(0,f.MZ)({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],ke.prototype,"spatialReference",void 0),(0,r.Cg)([(0,f.MZ)({type:Number})],ke.prototype,"subtypeCode",void 0),(0,r.Cg)([(0,f.MZ)({type:[ye.A]})],ke.prototype,"templates",void 0),(0,r.Cg)([(0,qe.w)("templates",["editFieldsInfo","creatorField","editorField","templates"])],ke.prototype,"readTemplates",null),(0,r.Cg)([(0,f.MZ)({type:Ce.A})],ke.prototype,"timeInfo",void 0),(0,r.Cg)([(0,f.MZ)()],ke.prototype,"title",void 0),(0,r.Cg)([(0,qe.w)("service","title",["name"]),(0,qe.w)("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],ke.prototype,"readTitle",null),(0,r.Cg)([(0,qe.w)("web-map","title",["layerDefinition.name","title"])],ke.prototype,"readTitleFromWebMap",null),(0,r.Cg)([(0,f.MZ)({type:String})],ke.prototype,"sublayerTitleMode",void 0),(0,r.Cg)([(0,f.MZ)({json:{read:!1}})],ke.prototype,"type",void 0),(0,r.Cg)([(0,f.MZ)({type:String})],ke.prototype,"typeIdField",void 0),(0,r.Cg)([(0,qe.w)("service","typeIdField"),(0,qe.w)("typeIdField",["layerDefinition.typeIdField"])],ke.prototype,"readTypeIdField",null),(0,r.Cg)([(0,f.MZ)({type:[ce.A]})],ke.prototype,"types",void 0),(0,r.Cg)([(0,qe.w)("service","types",["types"]),(0,qe.w)("types",["layerDefinition.types"])],ke.prototype,"readTypes",null),(0,r.Cg)([(0,f.MZ)({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:m.K}}}}})],ke.prototype,"visible",void 0),(0,r.Cg)([(0,qe.w)("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],ke.prototype,"readVisible",null),ke=(0,r.Cg)([(0,f.$K)("esri.layers.FeatureLayer")],ke)},63396(e,t,i){i.d(t,{d:()=>T});var r=i(5482),s=i(91429),o=i(60950),n=i(99959);class a extends n.A{constructor(e){super(),this.type="track",this.trackInfoProvider=e}get id(){return this.trackInfoProvider.id}get[o.ym](){return this.trackInfoProvider.trackInfo}}var l=i(37838),u=i(69540),d=i(25482),p=i(93637),y=i(50820),c=i(10873),h=i(46499),g=i(41214);let f=class extends((0,u.OU)(d.o)){constructor(e){super(e),this.labelingInfo=null,this.labelsVisible=!0,this.renderer=null,this.visible=!0}};(0,r.Cg)([(0,s.MZ)({type:[h.A],json:{write:!0}})],f.prototype,"labelingInfo",void 0),(0,r.Cg)([(0,s.MZ)(c.kF)],f.prototype,"labelsVisible",void 0),(0,r.Cg)([(0,s.MZ)({types:g.Hg,json:{write:!0}})],f.prototype,"renderer",void 0),(0,r.Cg)([(0,s.MZ)({type:Boolean,json:{write:!0}})],f.prototype,"visible",void 0),f=(0,r.Cg)([(0,s.$K)("esri.layers.support.TrackPartInfo")],f);var m=i(96576),b=i(59868),w=i(10184),v=i(43937);let C=class extends((0,u.OU)(d.o)){constructor(e){super(e),this.enabled=!0,this.fields=[],this.latestObservations=new f({renderer:new m.A({symbol:b.UK.clone()})}),this.maxDisplayDuration=null,this.maxDisplayObservationsPerTrack=0,this.popupEnabled=!0,this.popupTemplate=null,this.previousObservations=new f({renderer:new m.A({symbol:b.UK.clone()})}),this.trackLines=new f({renderer:new m.A({symbol:b.A7.clone()})}),this.timeField="startTimeField"}writeFields(e,t,i){const r=e.filter(e=>"avg_angle"!==e.statisticType).map(e=>e.toJSON());(0,p.sM)(i,r,t)}};(0,r.Cg)([(0,s.MZ)({type:Boolean,json:{write:!0}})],C.prototype,"enabled",void 0),(0,r.Cg)([(0,s.MZ)({type:[y.A],json:{write:!0}})],C.prototype,"fields",void 0),(0,r.Cg)([(0,v.K)("fields")],C.prototype,"writeFields",null),(0,r.Cg)([(0,s.MZ)({type:f,json:{write:!0}})],C.prototype,"latestObservations",void 0),(0,r.Cg)([(0,s.MZ)({type:w.A,json:{write:!0}})],C.prototype,"maxDisplayDuration",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,json:{write:!0}})],C.prototype,"maxDisplayObservationsPerTrack",void 0),(0,r.Cg)([(0,s.MZ)(c.M6)],C.prototype,"popupEnabled",void 0),(0,r.Cg)([(0,s.MZ)({type:l.A,json:{name:"popupInfo",write:!0}})],C.prototype,"popupTemplate",void 0),(0,r.Cg)([(0,s.MZ)({type:f,json:{write:!0}})],C.prototype,"previousObservations",void 0),(0,r.Cg)([(0,s.MZ)({type:f,json:{write:!0}})],C.prototype,"trackLines",void 0),(0,r.Cg)([(0,s.MZ)({type:["timeReceived","startTimeField","endTimeField"],json:{read:!0,write:!0}})],C.prototype,"timeField",void 0),C=(0,r.Cg)([(0,s.$K)("esri.layers.support.TrackInfo")],C);const T=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.trackGraphicOrigin=new a(this),this.trackInfo=null}};return(0,r.Cg)([(0,s.MZ)({readOnly:!0,clonable:!1})],i.prototype,"trackGraphicOrigin",void 0),(0,r.Cg)([(0,s.MZ)({type:C})],i.prototype,"trackInfo",void 0),i=(0,r.Cg)([(0,s.$K)("esri.layers.mixins.TrackableLayer")],i),i}},8947(e,t,i){i.d(t,{L:()=>n});var r=i(60999),s=i(17676),o=i(67076);async function n(e,t,i){const n=e&&e.getAtOrigin&&e.getAtOrigin("renderer",t.origin);if(n&&"unique-value"===n.type&&n.styleOrigin){const a=await(0,r.Ke)(n.populateFromStyle());if((0,s.Te)(i),!1===a.ok){const i=a.error;t?.messages&&t.messages.push(new o.A("renderer:style-reference",`Failed to create unique value renderer from style reference: ${i.message}`,{error:i,context:t})),e.clear("renderer",t?.origin)}}}},96520(e,t,i){i.d(t,{u:()=>l});var r=i(86211),s=i(21325),o=i(52006);function n(e,t,i){if(null==e.hasM||e.hasZ)for(const e of t)for(const t of e)t.length>2&&(t[2]*=i)}function a(e,t,i){if(null==e.hasM||e.hasZ)for(const e of t)for(const t of e){const e=(0,o.yP)(t);e.length>2&&(e[2]*=i)}}function l(e,t,i){if(!e&&!t||!i)return;const s=(0,r.G9)(i);u(e,i,s),u(t,i,s)}function u(e,t,i){if(e)for(const r of e)d(r.geometry,t,i)}function d(e,t,i){if(!e?.spatialReference||(0,s.aI)(e.spatialReference,t))return;const o=(0,r.G9)(e.spatialReference)/i;if(1!==o)if("x"in e)null!=e.z&&(e.z*=o);else if("curveRings"in e)a(e,e.curveRings,o);else if("curvePaths"in e)a(e,e.curvePaths,o);else if("rings"in e)n(e,e.rings,o);else if("paths"in e)n(e,e.paths,o);else if("points"in e&&(null==e.hasM||e.hasZ))for(const t of e.points)t.length>2&&(t[2]*=o)}}}]);