@arcgis/core 5.1.0-next.73 → 5.1.0-next.74

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 (152) hide show
  1. package/Viewpoint.js +1 -1
  2. package/applications/Urban/editingSessionUtils.d.ts +95 -0
  3. package/applications/Urban/editingSessionUtils.js +2 -0
  4. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/{d17fcfc502f0e0fa6523.js → 003476e950bd27a2f884.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{8a664451845a47048859.js → 0539b5d015157c1d34a0.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{5a4d7ba6dc1d4b41d80d.js → 07eff82916681fcff069.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{8a14e3db28c403b046cf.js → 0d2bc1be5802681666a4.js} +1 -1
  10. package/assets/esri/core/workers/chunks/0eed2b1b06355ab89013.js +1 -0
  11. package/assets/esri/core/workers/chunks/18f77ee3552d92962f15.js +1 -0
  12. package/assets/esri/core/workers/chunks/1a87e9bbd85ba29b1514.js +1 -0
  13. package/assets/esri/core/workers/chunks/{e1bc9ad767e08dc18bbc.js → 1db1656a033f3992f0d6.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{b54b7cc6b23a70fed700.js → 1f8ccf96069ac3a40c3d.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{cdf6ad970dc1893dac58.js → 24646a1176ce34039155.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{93ceb74ac88ef460fe5f.js → 359d3acb3953e64e5a78.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{80ace1c7203c5059525d.js → 37091cf498a16ccad7ff.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{0839da55707f7c4cf780.js → 3b9100c59a8050f4834e.js} +1 -1
  19. package/assets/esri/core/workers/chunks/452c01cecbbd1e370098.js +1 -0
  20. package/assets/esri/core/workers/chunks/47656ec12401e53f4bd3.js +1 -0
  21. package/assets/esri/core/workers/chunks/{260d4571722cb1ff1366.js → 484d6c1b0fe1633515b7.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{f207b3be0714cc50030a.js → 4bbe684050b3b04681d0.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{29e76256e3e867e80520.js → 4c13869d260a902d3014.js} +1 -1
  24. package/assets/esri/core/workers/chunks/4c97cc922eece3a91b6b.js +1 -0
  25. package/assets/esri/core/workers/chunks/{656d6963e8f837fbf28f.js → 54023458195549f66215.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{a78bc340a794fd332667.js → 5476c2f7b83f4ccd0335.js} +1 -1
  27. package/assets/esri/core/workers/chunks/5511e640e171c294f52a.js +2 -0
  28. package/assets/esri/core/workers/chunks/{faad127dc07e54e7f6d1.js → 5abe34bb0110694f7b42.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{f5c57ff48ca505ed701d.js → 5b324e572737a308500d.js} +1 -1
  30. package/assets/esri/core/workers/chunks/6124141ac642e4ce1454.js +1 -0
  31. package/assets/esri/core/workers/chunks/{b6cadb8a579241adcb86.js → 6b66fc32451433129a88.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{6ea8b0d68881d16a2432.js → 6d25230dd85a4ba54c4f.js} +1 -1
  33. package/assets/esri/core/workers/chunks/6f7aaba26773fe416ac2.js +1 -0
  34. package/assets/esri/core/workers/chunks/{9f4b97204def91567e3c.js → 7595ceba529ed01c7590.js} +1 -1
  35. package/assets/esri/core/workers/chunks/75d5ea0da181f9e7425f.js +1312 -0
  36. package/assets/esri/core/workers/chunks/{af75e91b88e747aa76ac.js → 7601278ebced0c0c31cf.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{1661684357912726a72a.js → 77dd719516138afb1a2a.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{ce2aa75e084ee56f5e29.js → 7f55eef696e9ed717bfc.js} +1 -1
  39. package/assets/esri/core/workers/chunks/85aac8539996372f1ee8.js +1 -0
  40. package/assets/esri/core/workers/chunks/{50d5d6654ada9f28345d.js → 85e65ced3312bf9cf162.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{b9848bdbaf3d9ac93d54.js → 8f4cd30ce23e41c1a42c.js} +1 -1
  42. package/assets/esri/core/workers/chunks/983f6c8727fd9484718e.js +1 -0
  43. package/assets/esri/core/workers/chunks/{5a83ea967ecde01d5622.js → 9be9ccce6369f67202bc.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{422824e407b550170c8c.js → a270960d80d8344dd75f.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{bef27a25fbc4a6e19ec0.js → a36761e3122f70fbb3c9.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{47f2113357b2aa4f4f37.js → a9d2c83bb10b5ade0ca0.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{e25a684eb9f025bdcc01.js → ad064583f8a836005098.js} +1 -1
  48. package/assets/esri/core/workers/chunks/b858adff7043683fe41c.js +1 -0
  49. package/assets/esri/core/workers/chunks/{5c663d5f98bdfa29151b.js → b905e637a67fbb7af4ae.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{03894992558d063d0d5e.js → bab23b905678e42815e5.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{6ef3b8d67b498d655a99.js → bcb021a167580bb1619f.js} +1 -1
  52. package/assets/esri/core/workers/chunks/be0341567bb19e101a4f.js +1 -0
  53. package/assets/esri/core/workers/chunks/bec3ee5ea945e1e07a35.js +1 -0
  54. package/assets/esri/core/workers/chunks/c5f155fe114a2a05aaf2.js +2 -0
  55. package/assets/esri/core/workers/chunks/{84772b023d04e415f17f.js → c61002a117dc2218d6af.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{0dad0bca8d58b2c63d22.js → c804a66ef7615aa8de89.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{cfe246adb5e6cb6f0cfc.js → d00dafad202450e6ee2e.js} +1 -1
  58. package/assets/esri/core/workers/chunks/d1a7d13e1d48abcd7bf1.js +1 -0
  59. package/assets/esri/core/workers/chunks/{06df187a116709f69952.js → d35c475f004367e333eb.js} +1 -1
  60. package/assets/esri/core/workers/chunks/d82da31dc702b8fd6a07.js +1 -0
  61. package/assets/esri/core/workers/chunks/dd4f431511edd975a53b.js +1 -0
  62. package/assets/esri/core/workers/chunks/{99101789035f1787c630.js → e785f76c1a75cb1d1e1f.js} +1 -1
  63. package/assets/esri/core/workers/chunks/f590b60fca607d66001a.js +1 -0
  64. package/assets/esri/core/workers/chunks/{f6d047358d14328f3622.js → f60292d97bcdbf19165b.js} +1 -1
  65. package/assets/esri/core/workers/chunks/fb5a2205f05afc396119.js +1 -0
  66. package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
  67. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
  68. package/chunks/geometryEngineBase.js +1 -1
  69. package/config.js +1 -1
  70. package/core/has.js +1 -1
  71. package/form/elements/FieldElement.js +1 -1
  72. package/geometry/geometryEngine.js +1 -1
  73. package/geometry/geometryEngineJSON.js +1 -1
  74. package/geometry/operators/projectOperator.d.ts +5 -4
  75. package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
  76. package/geometry/support/normalizeUtils.js +1 -1
  77. package/geometry/support/normalizeUtilsCommon.js +1 -1
  78. package/identity/IdentityManagerBase.js +1 -1
  79. package/kernel.js +1 -1
  80. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  81. package/layers/IntegratedMeshLayer.js +1 -1
  82. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  83. package/layers/support/SymbolLayerDrawing.d.ts +18 -4
  84. package/package.json +2 -2
  85. package/popup/Features.d.ts +9 -9
  86. package/popup/Features.js +1 -1
  87. package/popup/actionUtils.js +1 -1
  88. package/popup/actions.js +1 -1
  89. package/portal/Portal.js +1 -1
  90. package/portal/PortalQueryParams.js +1 -1
  91. package/rest/print.js +1 -1
  92. package/support/revision.js +1 -1
  93. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  94. package/views/3d/camera/intersectionUtils.js +1 -1
  95. package/views/3d/input/SceneInputManager.js +1 -1
  96. package/views/3d/input/handlers/PinchAndPanNavigation.js +1 -1
  97. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  98. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  99. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  100. package/views/3d/state/GoToOperation.js +1 -1
  101. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  102. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  103. package/views/3d/support/cameraScaleUtils.js +2 -0
  104. package/views/3d/support/cameraUtils.js +1 -1
  105. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  106. package/views/3d/support/renderInfoUtils/line.js +1 -1
  107. package/views/3d/support/viewpointUtils.js +1 -1
  108. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  109. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +13 -12
  110. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  111. package/views/3d/webgl.js +1 -1
  112. package/views/SceneView.d.ts +1 -0
  113. package/views/draw/support/editingSessionUtils.js +2 -0
  114. package/views/interactive/sketch/SketchTooltipOptions.d.ts +9 -1
  115. package/views/support/Scheduler.js +1 -1
  116. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  117. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  118. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  119. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  120. package/widgets/Editor/EditorViewModel.js +1 -1
  121. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  122. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  123. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  124. package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
  125. package/widgets/Editor/support/SketchController.js +1 -1
  126. package/widgets/Editor/workflowUtils.js +1 -1
  127. package/assets/esri/core/workers/chunks/027c3ea756db68e51f0a.js +0 -1
  128. package/assets/esri/core/workers/chunks/0c00e5e4bd18467bcecd.js +0 -1
  129. package/assets/esri/core/workers/chunks/0ef93722524620023f69.js +0 -1
  130. package/assets/esri/core/workers/chunks/266ba61b72a278d93a26.js +0 -1
  131. package/assets/esri/core/workers/chunks/2abf124e2956e4f76688.js +0 -1
  132. package/assets/esri/core/workers/chunks/30f04dc001eaf838d64c.js +0 -1
  133. package/assets/esri/core/workers/chunks/43678e08a3d9d51c2a6d.js +0 -1
  134. package/assets/esri/core/workers/chunks/5b278b9980752ef495a2.js +0 -1
  135. package/assets/esri/core/workers/chunks/5e59ff96aecdf2adcb3b.js +0 -1
  136. package/assets/esri/core/workers/chunks/74be994d789c57031631.js +0 -1
  137. package/assets/esri/core/workers/chunks/770880ad43f252962017.js +0 -1
  138. package/assets/esri/core/workers/chunks/81750c5177d8d52a3e05.js +0 -1
  139. package/assets/esri/core/workers/chunks/9eb4ae556950e1d0124d.js +0 -2
  140. package/assets/esri/core/workers/chunks/a11f05ddd8314b648f76.js +0 -1
  141. package/assets/esri/core/workers/chunks/af5db0372d526e592fcc.js +0 -1
  142. package/assets/esri/core/workers/chunks/bc53ce9a643f82d516c2.js +0 -1
  143. package/assets/esri/core/workers/chunks/c3381b9a36299210ee47.js +0 -1
  144. package/assets/esri/core/workers/chunks/d65b1234867f7d773d50.js +0 -2
  145. package/assets/esri/core/workers/chunks/d8d7331600d93bbca2b4.js +0 -1
  146. package/assets/esri/core/workers/chunks/e272411e2c9378aa8496.js +0 -1312
  147. package/assets/esri/core/workers/chunks/fa160a2a5dc9f5a7c34b.js +0 -1
  148. package/geometry/support/triangulationUtilsDeprecated.js +0 -2
  149. package/views/3d/layers/graphics/extrudeUtilsDeprecated.js +0 -2
  150. package/views/3d/support/renderInfoUtils/polygonDeprecated.js +0 -2
  151. /package/assets/esri/core/workers/chunks/{9eb4ae556950e1d0124d.js.LICENSE.txt → 5511e640e171c294f52a.js.LICENSE.txt} +0 -0
  152. /package/assets/esri/core/workers/chunks/{d65b1234867f7d773d50.js.LICENSE.txt → c5f155fe114a2a05aaf2.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{destroyMaybe as e}from"../../../../../core/maybe.js";import{set as t,transformMat3 as a,add as r}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as i}from"../../../../../geometry/support/aaBoundingBox.js";import{encodeSymbolColor as s}from"../../../layers/support/symbolColorUtils.js";import{computeOffsetObb as n}from"../../../support/orientedBoundingBox.js";import{ComponentParametersUniform as l,ComponentParametersVarying as m}from"./ComponentDrawParameters.js";import{UniformComponentParameters as h}from"./UniformComponentParameters.js";import{olidEnabled as c}from"../../effects/geometry/olidUtils.js";import{defaultHighlightName as d}from"../../../../support/HighlightDefaults.js";class p{constructor(e,t,a,r,o,i){this._collection=e,this.transform=t,this.obb=a,this._componentData=r,this._renderable=o,this._intersectionGeometry=i,this.visible=!1,this.offsetObb=null,this._aabbInWorldCoordinates=null}destroy(){this._collection.materials.release(this._renderable.material),this._intersectionGeometry=e(this._intersectionGeometry),this._renderable=e(this._renderable),this._componentData=e(this._componentData)}get componentData(){return this._componentData}get renderable(){return this._renderable}get intersectionGeometry(){return this._intersectionGeometry}updateMaterial(e,t){const{_renderable:a}=this,r=a.material,o=this._collection.materials.acquire({...r.parameters,opacity:a.opacity,...e},a.geometry.parameters,t??a.drawParameters.componentParameters);this._collection.materials.release(r),o!==r&&a.updateMaterial(o)}get opacity(){return this.renderable.opacity}updateOpacity(e){this.opacity!==e&&(this._renderable.updateOpacity(e),this.updateMaterial({opacity:e}))}updateCameraDerivedParameters(e){const{eye:t}=e,{centerX:a,centerY:r,centerZ:o}=this.obb;this._renderable.meta.cameraDepthSquared=(t[0]-a)**2+(t[1]-r)**2+(t[2]-o)**2}setComponentData(e,t){const a=this._componentData,{materialDataBuffer:r,materialDataIndices:o}=a,i=new h,d=r.textureBuffer,p=d.getVec4Field("colorAndCastShadows"),f=d.getScalarField("elevationOffset"),b=d.getScalarField("emissiveStrength"),g=d.getScalarField("emissiveSourceMode"),y=d.getVec4Field("olidColor"),_=new Uint8Array(4),v=new Uint32Array(_.buffer);let M,w=0,C=0,S=0,x=0,D=0,O=a.verticalOffsets,P=1/0,j=-1/0,A=!1,I=!1,k=!1,G=0;for(let n=0;n<a.count;n++){e(n,i),w+=+(i.externalColor[3]<1),C+=+(3===i.externalColorMixMode&&1===i.externalColor[3]),x+=+(i.emissiveStrength>0),D+=+(1===i.emissiveSource),I||=1!==i.emissiveStrength,S+=+i.castShadows,s(i.externalColor,i.externalColorMixMode,_),_[2]=254&_[2]|+i.castShadows,p.setArray(o[n],_),A||=n>0&&G!==v[0],G=v[0],k||=0!==i.elevationOffset,k&&null==O&&(O=new Array(n).fill(0)),null!=O&&(O[n]=i.elevationOffset),P=Math.min(P,i.elevationOffset),j=Math.max(j,i.elevationOffset),f.set(o[n],i.elevationOffset),b.set(o[n],i.emissiveStrength),g.set(o[n],0===i.emissiveSource?0:255);const t=i.olidColor;null!=t&&y.setArray(o[n],t),i.pickable!==a.isPickable(n)&&a.updatePickabilityWithCount(n,i.pickable)}if(a.verticalOffsets=k?O:null,this.offsetObb=k?n(this.obb,P,j,t,this.offsetObb??this.obb.clone()):null,A||k||c()||(I||D>0)&&x>0){const{count:e}=a;M=new m(u(w,e),u(C,e),u(x,e),u(D,e),u(S,e)),d.updateTexture(),this._renderable.updateComponentParametersVarying(M,d)}else M=new l(i.externalColor,i.externalColorMixMode,i.emissiveStrength,i.emissiveSource,i.castShadows?0:2),this._renderable.updateComponentParametersUniform(M);this.updateMaterial({},M)}addHighlight(e,t){return this._componentData.addComponentHighlight(e,t)}removeHighlight(e,t){return this._componentData.removeComponentHighlight(e,t)}clearHighlights(){this._componentData.clearHighlights()}get aabbInWorldCoordinates(){let e=this._aabbInWorldCoordinates;return e||(e=this._computeAabbInWorldCoordinates(),this._aabbInWorldCoordinates=e),e}_computeAabbInWorldCoordinates(){const e=i(),{positions:s}=this._intersectionGeometry;if(Math.floor(s.length/3)>0){const{rotationScale:i,position:n}=this.transform;let l=1/0,m=1/0,h=1/0,c=-1/0,d=-1/0,p=-1/0;const u=o();for(let e=0;e<s.length;e+=3)t(u,s[e+0],s[e+1],s[e+2]),a(u,u,i),r(u,u,n),l=Math.min(l,u[0]),m=Math.min(m,u[1]),h=Math.min(h,u[2]),c=Math.max(c,u[0]),d=Math.max(d,u[1]),p=Math.max(p,u[2]);e[0]=l,e[1]=m,e[2]=h,e[3]=c,e[4]=d,e[5]=p}return e}submit(e,t){const{componentData:a,renderable:r}=this;if(r.drawParameters.opacity<=0)return;const{geometry:o,drawParameters:i,material:s}=r,n=r.meta.cameraDepthSquared,{geometryRanges:l,highlightRangesMap:m,shadowmapRanges:h}=a,c=e=>e.submitDraw(s,i,o,l,n);switch(s.materialPass){case 0:c(e.opaque);break;case 1:c(e.transparent);break;case 2:c(e.opaque),c(e.transparent);break;case 3:c(e.integratedMesh),f(t)&&c(e.occludedGround),b(t)&&c(e.highlightIntegratedMesh);break;case 4:c(e.transparentIntegratedMesh)}if(i.castAnyShadows){if(null!=m)for(const t of m)t[0]===d&&e.highlightShadowMap.submitDraw(s,i,o,t[1],n,t[0]);null!=h&&e.defaultShadowMap.submitDraw(s,i,o,h,n),c(e.shadowMap)}if(null!=m)for(const d of m)e.highlight.submitDraw(s,i,o,d[1],n,d[0]);t.viewshedEnabled&&c(e.viewshedShadowMap)}}function u(e,t){return e===t?0:0===e?2:1}function f(e){return null!=e.overlay?.getTexture(e.overlay?.allSourcesOccluders?1:4)}function b(e){return null!=e.overlay?.getTexture(2)}export{p as ComponentObject};
2
+ import{destroyMaybe as e}from"../../../../../core/maybe.js";import{set as t,transformMat3 as a,add as r}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as i}from"../../../../../geometry/support/aaBoundingBox.js";import{encodeSymbolColor as s}from"../../../layers/support/symbolColorUtils.js";import{computeOffsetObb as n}from"../../../support/orientedBoundingBox.js";import{ComponentParametersUniform as l,ComponentParametersVarying as m}from"./ComponentDrawParameters.js";import{UniformComponentParameters as h}from"./UniformComponentParameters.js";import{olidEnabled as c}from"../../effects/geometry/olidUtils.js";import{defaultHighlightName as d}from"../../../../support/HighlightDefaults.js";class p{constructor(e,t,a,r,o,i){this._collection=e,this.transform=t,this.obb=a,this._componentData=r,this._renderable=o,this._intersectionGeometry=i,this.visible=!1,this.offsetObb=null,this._aabbInWorldCoordinates=null}destroy(){this._collection.materials.release(this._renderable.material),this._intersectionGeometry=e(this._intersectionGeometry),this._renderable=e(this._renderable),this._componentData=e(this._componentData)}get componentData(){return this._componentData}get renderable(){return this._renderable}get intersectionGeometry(){return this._intersectionGeometry}updateMaterial(e,t){const{_renderable:a}=this,r=a.material,o=this._collection.materials.acquire({...r.parameters,opacity:a.opacity,...e},a.geometry.parameters,t??a.drawParameters.componentParameters);this._collection.materials.release(r),o!==r&&a.updateMaterial(o)}get opacity(){return this.renderable.opacity}updateOpacity(e){this.opacity!==e&&(this._renderable.updateOpacity(e),this.updateMaterial({opacity:e}))}updateCameraDerivedParameters(e){const{eye:t}=e,{centerX:a,centerY:r,centerZ:o}=this.obb;this._renderable.meta.cameraDepthSquared=(t[0]-a)**2+(t[1]-r)**2+(t[2]-o)**2}setComponentData(e,t){const a=this._componentData,{materialDataBuffer:r,materialDataIndices:o}=a,i=new h,d=r.textureBuffer,p=d.getVec4Field("colorAndCastShadows"),f=d.getScalarField("elevationOffset"),b=d.getScalarField("emissiveStrength"),g=d.getScalarField("emissiveSourceMode"),y=d.getVec4Field("olidColor"),_=new Uint8Array(4),v=new Uint32Array(_.buffer);let M,w=0,C=0,S=0,x=0,D=0,O=a.verticalOffsets,P=1/0,j=-1/0,A=!1,I=!1,k=!1,G=0;for(let n=0;n<a.count;n++){e(n,i),w+=+(i.externalColor[3]<1),C+=+(3===i.externalColorMixMode&&1===i.externalColor[3]),x+=+(i.emissiveStrength>0),D+=+(1===i.emissiveSource),I||=1!==i.emissiveStrength,S+=+i.castShadows,s(i.externalColor,i.externalColorMixMode,_),_[2]=254&_[2]|+i.castShadows,p.setArray(o[n],_),A||=n>0&&G!==v[0],G=v[0],k||=0!==i.elevationOffset,k&&null==O&&(O=new Array(n).fill(0)),null!=O&&(O[n]=i.elevationOffset),P=Math.min(P,i.elevationOffset),j=Math.max(j,i.elevationOffset),f.set(o[n],i.elevationOffset),b.set(o[n],i.emissiveStrength),g.set(o[n],0===i.emissiveSource?0:255);const t=i.olidColor;null!=t&&y.setArray(o[n],t),i.pickable!==a.isPickable(n)&&a.updatePickabilityWithCount(n,i.pickable)}if(a.verticalOffsets=k?O:null,this.offsetObb=k?n(this.obb,P,j,t,this.offsetObb??this.obb.clone()):null,A||k||c()||(I||D>0)&&x>0){const{count:e}=a;M=new m(u(w,e),u(C,e),u(x,e),u(D,e),u(S,e)),d.updateTexture(),this._renderable.updateComponentParametersVarying(M,d)}else M=new l(i.externalColor,i.externalColorMixMode,i.emissiveStrength,i.emissiveSource,i.castShadows?0:2),this._renderable.updateComponentParametersUniform(M);this.updateMaterial({},M)}addHighlight(e,t){return this._componentData.addComponentHighlight(e,t)}removeHighlight(e,t){return this._componentData.removeComponentHighlight(e,t)}clearHighlights(){this._componentData.clearHighlights()}get aabbInWorldCoordinates(){let e=this._aabbInWorldCoordinates;return e||(e=this._computeAabbInWorldCoordinates(),this._aabbInWorldCoordinates=e),e}_computeAabbInWorldCoordinates(){const e=i(),{positions:o}=this._intersectionGeometry;if(Math.floor(o.length/3)>0){const{rotationScale:i,position:s}=this.transform;let n=1/0,l=1/0,m=1/0,h=-1/0,c=-1/0,d=-1/0;const p=g;for(let e=0;e<o.length;e+=3)t(p,o[e+0],o[e+1],o[e+2]),a(p,p,i),r(p,p,s),n=Math.min(n,p[0]),l=Math.min(l,p[1]),m=Math.min(m,p[2]),h=Math.max(h,p[0]),c=Math.max(c,p[1]),d=Math.max(d,p[2]);e[0]=n,e[1]=l,e[2]=m,e[3]=h,e[4]=c,e[5]=d}return e}submit(e,t){const{componentData:a,renderable:r}=this;if(r.drawParameters.opacity<=0)return;const{geometry:o,drawParameters:i,material:s}=r,n=r.meta.cameraDepthSquared,{geometryRanges:l,highlightRangesMap:m,shadowmapRanges:h}=a,c=e=>e.submitDraw(s,i,o,l,n);switch(s.materialPass){case 0:c(e.opaque);break;case 1:c(e.transparent);break;case 2:c(e.opaque),c(e.transparent);break;case 3:c(e.integratedMesh),f(t)&&c(e.occludedGround),b(t)&&c(e.highlightIntegratedMesh);break;case 4:c(e.transparentIntegratedMesh)}if(i.castAnyShadows){if(null!=m)for(const t of m)t[0]===d&&e.highlightShadowMap.submitDraw(s,i,o,t[1],n,t[0]);null!=h&&e.defaultShadowMap.submitDraw(s,i,o,h,n),c(e.shadowMap)}if(null!=m)for(const d of m)e.highlight.submitDraw(s,i,o,d[1],n,d[0]);t.viewshedEnabled&&c(e.viewshedShadowMap)}}function u(e,t){return e===t?0:0===e?2:1}function f(e){return null!=e.overlay?.getTexture(e.overlay?.allSourcesOccluders?1:4)}function b(e){return null!=e.overlay?.getTexture(2)}const g=o();export{p as ComponentObject};
@@ -1,16 +1,17 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{DecodeSymbolColor as o}from"./DecodeSymbolColor.glsl.js";import{TextureBackedBufferModule as e}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{Float4DrawUniform as r}from"../../../core/shaderModules/Float4DrawUniform.js";import{FloatDrawUniform as t}from"../../../core/shaderModules/FloatDrawUniform.js";import{glsl as d,If as n}from"../../../core/shaderModules/glsl.js";import{IntegerDrawUniform as a}from"../../../core/shaderModules/IntegerDrawUniform.js";import{Texture2DUintDrawUniform as l}from"../../../core/shaderModules/Texture2DUintDrawUniform.js";import{olidEnabled as i}from"../../../effects/geometry/olidUtils.js";import{componentDataLayout as s,componentDataOlidLayout as c}from"../../../materials/DefaultLayouts.js";function u(o,e){switch(e.componentDataType){case 1:return p(o,e);case 0:return M(o,e);case 2:return;default:e.componentDataType}}const m=(o,e)=>"emissiveSourceMode"===o||"emissiveStrength"===o?e.hasEmission:"olidColor"!==o||11===e.output,f=new l("componentTextureBuffer",o=>o.textureBackedBuffer?.texture),v=new e({layout:s,itemIndexAttribute:"componentIndex",bufferUniform:f,fieldFilter:m}),C=new e({layout:c,itemIndexAttribute:"componentIndex",bufferUniform:f,fieldFilter:m});function x(){return i()?C:v}function p(e,r){const{vertex:t,fragment:a}=e,{output:l,hasEmission:i}=r,s=11===l,{getTextureAttribute:c,TextureBackedBufferModule:u}=x();e.include(u,r),e.attributes.add("componentIndex","uint"),e.varyings.add("vExternalColorMixMode","mediump float"),e.varyings.add("vExternalColor","vec4"),s&&e.varyings.add("vObjectAndLayerIdColor","vec4"),i&&(e.varyings.add("emissiveStrength","float"),e.varyings.add("emissiveSource","int")),e.include(o),t.code.add(d`
2
+ import{DecodeSymbolColor as o}from"./DecodeSymbolColor.glsl.js";import{TextureBackedBufferModule as e}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{Float4DrawUniform as r}from"../../../core/shaderModules/Float4DrawUniform.js";import{FloatDrawUniform as t}from"../../../core/shaderModules/FloatDrawUniform.js";import{glsl as n,If as d}from"../../../core/shaderModules/glsl.js";import{IntegerDrawUniform as a}from"../../../core/shaderModules/IntegerDrawUniform.js";import{Texture2DUintDrawUniform as l}from"../../../core/shaderModules/Texture2DUintDrawUniform.js";import{olidEnabled as i}from"../../../effects/geometry/olidUtils.js";import{componentDataLayout as s,componentDataOlidLayout as c}from"../../../materials/DefaultLayouts.js";import{oitResolution as u}from"../../../shaders/oitResolution.glsl.js";function m(o,e){switch(e.componentDataType){case 1:return M(o,e);case 0:return h(o,e);case 2:return;default:e.componentDataType}}const f=(o,e)=>"emissiveSourceMode"===o||"emissiveStrength"===o?e.hasEmission:"olidColor"!==o||11===e.output,v=new l("componentTextureBuffer",o=>o.textureBackedBuffer?.texture),C=new e({layout:s,itemIndexAttribute:"componentIndex",bufferUniform:v,fieldFilter:f}),x=new e({layout:c,itemIndexAttribute:"componentIndex",bufferUniform:v,fieldFilter:f});function p(){return i()?x:C}function M(e,r){const{vertex:t,fragment:a}=e,{output:l,hasEmission:i,useFloatBlend:s}=r,c=11===l,{getTextureAttribute:m,TextureBackedBufferModule:f}=p();e.include(f,r),e.attributes.add("componentIndex","uint"),e.varyings.add("vExternalColorMixMode","mediump float"),e.varyings.add("vExternalColor","vec4"),c&&e.varyings.add("vObjectAndLayerIdColor","vec4"),i&&(e.varyings.add("emissiveStrength","float"),e.varyings.add("emissiveSource","int")),e.include(o),t.include(u,r),t.code.add(n`
3
3
  float readElevationOffset() {
4
- return ${c("elevationOffset")};
4
+ return ${m("elevationOffset")};
5
5
  }
6
6
 
7
7
  void forwardEmissiveStrength() {
8
- ${n(i,d`emissiveStrength = ${c("emissiveStrength")};
9
- emissiveSource = ${c("emissiveSourceMode")} == 0u ? 0 : 1;`)}
8
+ ${d(i,n`emissiveStrength = ${m("emissiveStrength")};
9
+ ${d(!s,"emissiveStrength = clamp(emissiveStrength, 0.0, floatBlendInputScale);")}
10
+ emissiveSource = ${m("emissiveSourceMode")} == 0u ? 0 : 1;`)}
10
11
  }
11
12
 
12
13
  void forwardObjectAndLayerIdColor() {
13
- ${n(s,d`vObjectAndLayerIdColor = vec4(${c("olidColor")})/255.0;`)}
14
+ ${d(c,n`vObjectAndLayerIdColor = vec4(${m("olidColor")})/255.0;`)}
14
15
  }
15
16
 
16
17
  void decodeColorAndCastShadow(uvec4 colorAndCastShadowEncoded, out vec4 color, out bool castShadow) {
@@ -22,7 +23,7 @@ import{DecodeSymbolColor as o}from"./DecodeSymbolColor.glsl.js";import{TextureBa
22
23
 
23
24
  vec4 forwardExternalColor(out bool castShadows) {
24
25
  vec4 componentColor;
25
- decodeColorAndCastShadow(${c("colorAndCastShadows")}, componentColor, castShadows);
26
+ decodeColorAndCastShadow(${m("colorAndCastShadows")}, componentColor, castShadows);
26
27
 
27
28
  int decodedColorMixMode;
28
29
  vExternalColor = decodeSymbolColor(componentColor, decodedColorMixMode) * 0.003921568627451; // = 1/255;
@@ -30,16 +31,16 @@ import{DecodeSymbolColor as o}from"./DecodeSymbolColor.glsl.js";import{TextureBa
30
31
 
31
32
  return vExternalColor;
32
33
  }
33
- `),a.code.add(d`
34
+ `),a.code.add(n`
34
35
  void readExternalColor(out vec4 externalColor, out int externalColorMixMode) {
35
36
  externalColor = vExternalColor;
36
37
  externalColorMixMode = int(vExternalColorMixMode);
37
38
  }
38
39
 
39
40
  void outputObjectAndLayerIdColor() {
40
- ${s?d`fragColor = vObjectAndLayerIdColor;`:""}
41
+ ${c?n`fragColor = vObjectAndLayerIdColor;`:""}
41
42
  }
42
- `)}function M(o,e){const{vertex:l,fragment:i}=o;o.varyings.add("vExternalColor","vec4"),i.uniforms.add(new t("emissiveStrength",o=>o.componentParameters.emissiveStrength)),l.uniforms.add(new r("externalColor",o=>o.componentParameters.externalColor)).code.add(d`float readElevationOffset() {
43
+ `)}function h(o,e){const{vertex:l,fragment:i}=o;o.varyings.add("vExternalColor","vec4"),i.uniforms.add(new t("emissiveStrength",o=>o.componentParameters.emissiveStrength)),l.uniforms.add(new r("externalColor",o=>o.componentParameters.externalColor)).code.add(n`float readElevationOffset() {
43
44
  return 0.0;
44
45
  }
45
46
  void forwardObjectAndLayerIdColor() {}
@@ -48,13 +49,13 @@ vec4 forwardExternalColor(out bool castShadows) {
48
49
  vExternalColor = externalColor;
49
50
  castShadows = true;
50
51
  return externalColor;
51
- }`);const s=11===e.output;i.uniforms.add(new a("externalColorMixMode",o=>o.componentParameters.externalColorMixMode)).code.add(d`
52
+ }`);const s=11===e.output;i.uniforms.add(new a("externalColorMixMode",o=>o.componentParameters.externalColorMixMode)).code.add(n`
52
53
  void readExternalColor(out vec4 color, out int colorMixMode) {
53
54
  color = vExternalColor;
54
55
  colorMixMode = externalColorMixMode;
55
56
  }
56
57
 
57
58
  void outputObjectAndLayerIdColor() {
58
- ${n(s,"fragColor = vec4(0, 0, 0, 0);")}
59
+ ${d(s,"fragColor = vec4(0, 0, 0, 0);")}
59
60
  }
60
- `)}export{u as ComponentData};
61
+ `)}export{m as ComponentData};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{abortMaybe as r,disposeMaybe as s}from"../../../../../core/maybe.js";import{throwIfAborted as a,isAbortError as i}from"../../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as n}from"../../../../../core/reactiveUtils.js";import{property as l,subclass as m}from"../../../../../core/accessorSupport/decorators.js";import{set as u}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{requestImage as h}from"../../../../../request/image.js";import{InternalRenderCategory as c}from"../../../webgl.js";import p from"../../../webgl/RenderNode.js";import{G as d}from"../../../../../chunks/GlobalIllumination.glsl.js";import{G as f}from"../../../../../chunks/GlobalIlluminationBlur.glsl.js";import{GlobalIlluminationBlurTechnique as b}from"./GlobalIlluminationBlurTechnique.js";import{GlobalIlluminationTechnique as _}from"./GlobalIlluminationTechnique.js";import{GlobalIlluminationTechniqueConfiguration as g}from"./GlobalIlluminationTechniqueConfiguration.js";import{G as w}from"../../../../../chunks/GlobalIlluminationUpscale.glsl.js";import{GlobalIlluminationUpscaleTechnique as P}from"./GlobalIlluminationUpscaleTechnique.js";import{DepthStencilAttachment as x,ColorAttachment1 as T,SizedPixelFormat as I}from"../../../../webgl/enums.js";import q from"../../../../webgl/Texture.js";import{TextureDescriptor as C}from"../../../../webgl/TextureDescriptor.js";const j=1,M=.25;let B=class extends p{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=c.AMBIENT_ILLUMINATION,this._passParameters=new d,this._drawParameters=new f,this._drawParametersUpscale=new w,this._maxFrames=255,this._configuration=new g,this._resetBuffer=!1}async initialize(){this._abortController=new AbortController;const e=this._abortController.signal;try{const t=(await import("./BlueNoise.js")).data;a(e),await this._loadBlueNoiseTexture(t,e),a(e)}catch(r){i(r)||t.getLogger(this).errorOnce("Failed to load blue noise texture:",r)}this.addHandles(o(()=>this.view.stage.renderer.hasGlobalIllumination,()=>{this.resetAccumulation(),this.requestRender(1)},n))}precompile(){this._canRender&&(this._configuration.hasEmission=this.bindParameters.hasEmission,this.techniques.precompile(_,this._configuration),this.techniques.precompile(b),this.techniques.precompile(P))}destroy(){this._abortController=r(this._abortController),this._passParameters.noiseTexture=s(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),s=t?.getTexture(x),a=this._mode;if(!r||!s)return this._emptyOutput;if(2!==a&&this.resetAccumulation(),0===a)return this._resetBuffer=!1,this._emptyOutput;if(!this._canRender)return this._resetBuffer=!1,this.requestRender(1),this._emptyOutput;const i=this.bindParameters;this._configuration.hasEmission=i.hasEmission;const o=this.techniques.getCompiled(_,this._configuration),n=this.techniques.getCompiled(b),l=1===a?M:1,m=l<1,h=m?this.techniques.getCompiled(P):null;if(!o||!n||m&&!h)return this.requestRender(1),this._emptyOutput;const p=this.renderingContext,{camera:d}=i;this._passParameters.normalTexture=r,this._passParameters.depthTexture=s,this._passParameters.projScale=1/d.computeScreenPixelSizeAtDist(1),this._passParameters.scaleGlobalIllumination=l;const{fullWidth:f,fullHeight:g}=d,w=Math.max(1,Math.floor(f*l)),I=Math.max(1,Math.floor(g*l)),q=this.fboCache.acquire(w,I,"global illumination input").acquireColor(T,0);p.bindFramebuffer(q.fbo),p.setViewport(0,0,w,I),p.bindTechnique(o,i,this._passParameters,this._drawParameters),p.screen.draw();const C=q.obtainAttachment(T),B=Math.max(1,Math.round(w/j)),G=Math.max(1,Math.round(I/j)),N=this.fboCache.acquire(B,G,"global illumination blur horizontal");p.bindFramebuffer(N.fbo),this._drawParameters.texture=q.getTexture(),this._drawParameters.weightTexture=C.attachment,u(this._drawParameters.blurSize,0,j/I),p.bindTechnique(n,i,this._passParameters,this._drawParameters),p.setViewport(0,0,B,G),p.screen.draw(),q.release();const A=m?"global illumination blur vertical":c.AMBIENT_ILLUMINATION,y=this.fboCache.acquire(B,G,A);p.bindFramebuffer(y.fbo),p.setViewport(0,0,B,G),p.setClearColor(1,1,1,0),p.clear(16384),this._drawParameters.texture=N.getTexture(),this._drawParameters.weightTexture=C.attachment,u(this._drawParameters.blurSize,j/B,0),p.bindTechnique(n,i,this._passParameters,this._drawParameters),p.setViewport(0,0,B,G),p.screen.draw(),N.release(),y.attachColor(C,T),C.release();let F=y;return h&&(F=this.fboCache.acquire(f,g,c.AMBIENT_ILLUMINATION).acquireColor(T,0),p.bindFramebuffer(F.fbo),p.setViewport(0,0,f,g),p.setClearColor(1,1,1,0),p.clear(16384),this._drawParametersUpscale.colorTexture=y.getTexture(),this._drawParametersUpscale.weightTexture=y.getTexture(T),p.bindTechnique(h,i,this._passParameters,this._drawParametersUpscale),p.screen.draw(),y.release()),p.setViewport4fv(d.fullViewport),this._passParameters.frameCount=(this._passParameters.frameCount+1)%64,++this._passParameters.accumulatedFrames,this._passParameters.accumulatedFrames<this._maxFrames&&this.requestRender(1),F}get _emptyOutput(){const e=this.renderingContext,{fullWidth:t,fullHeight:r}=this.bindParameters.camera,s=this.fboCache.acquire(t,r,c.AMBIENT_ILLUMINATION).acquireColor(T,0);return e.bindFramebuffer(s.fbo),e.setViewport(0,0,t,r),e.clearBuffer(0,[0,0,0,1]),e.clearBuffer(1,[0,0,0,0]),s}async _loadBlueNoiseTexture(e,t){a(t);const r=await h(e,{signal:t});if(a(t),!r)return;const s=new C;s.internalFormat=I.RGBA8,s.wrapMode=10497,s.isImmutable=!0,this._passParameters.noiseTexture=new q(this.renderingContext,s,r)}get _canRender(){const e=this.bindParameters;return!(!this._passParameters.noiseTexture||e.hasEmission&&!e.reprojection.lastFrameEmission||!e.reprojection.lastFrameDepth||!e.globalIllumination||this._resetBuffer)}get _mode(){const{hasGlobalIlluminationHighQuality:e,hasGlobalIllumination:t}=this.view.stage.renderer;return e?2:t?1:0}resetAccumulation(){this._passParameters.accumulatedFrames=0}get test(){}};e([l()],B.prototype,"consumes",void 0),e([l()],B.prototype,"produces",void 0),e([l()],B.prototype,"_abortController",void 0),B=e([m("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIllumination")],B);export{B as GlobalIllumination,j as blurSizePixels};
2
+ import{__decorate as e}from"tslib";import"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{abortMaybe as r,disposeMaybe as s}from"../../../../../core/maybe.js";import{throwIfAborted as a,isAbortError as i}from"../../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as n}from"../../../../../core/reactiveUtils.js";import{property as l,subclass as m}from"../../../../../core/accessorSupport/decorators.js";import{set as u}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{requestImage as h}from"../../../../../request/image.js";import{InternalRenderCategory as c}from"../../../webgl.js";import p from"../../../webgl/RenderNode.js";import{G as d}from"../../../../../chunks/GlobalIllumination.glsl.js";import{G as f}from"../../../../../chunks/GlobalIlluminationBlur.glsl.js";import{GlobalIlluminationBlurTechnique as _}from"./GlobalIlluminationBlurTechnique.js";import{GlobalIlluminationTechnique as b}from"./GlobalIlluminationTechnique.js";import{GlobalIlluminationTechniqueConfiguration as g}from"./GlobalIlluminationTechniqueConfiguration.js";import{G as w}from"../../../../../chunks/GlobalIlluminationUpscale.glsl.js";import{GlobalIlluminationUpscaleTechnique as P}from"./GlobalIlluminationUpscaleTechnique.js";import{DepthStencilAttachment as x,ColorAttachment1 as T,SizedPixelFormat as I}from"../../../../webgl/enums.js";import q from"../../../../webgl/Texture.js";import{TextureDescriptor as C}from"../../../../webgl/TextureDescriptor.js";const j=1,M=.25;let B=class extends p{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=c.AMBIENT_ILLUMINATION,this._passParameters=new d,this._drawParameters=new f,this._drawParametersUpscale=new w,this._maxFrames=255,this._configuration=new g,this._resetBuffer=!1}async initialize(){this._abortController=new AbortController;const e=this._abortController.signal;try{const t=(await import("./BlueNoise.js")).data;a(e),await this._loadBlueNoiseTexture(t,e),a(e)}catch(r){i(r)||t.getLogger(this).errorOnce("Failed to load blue noise texture:",r)}this.addHandles(o(()=>this.view.stage.renderer.hasGlobalIllumination,()=>{this.resetAccumulation(),this.requestRender(1)},n))}precompile(){this._canRender&&(this._configuration.hasEmission=this.bindParameters.hasEmission,this.techniques.precompile(b,this._configuration),this.techniques.precompile(_),this._needsUpscalePass(this._mode)&&this.techniques.precompile(P))}destroy(){this._abortController=r(this._abortController),this._passParameters.noiseTexture=s(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),s=t?.getTexture(x),a=this._mode;if(!r||!s)return this._emptyOutput;if(2!==a&&this.resetAccumulation(),0===a)return this._resetBuffer=!1,this._emptyOutput;if(!this._canRender)return this._resetBuffer=!1,this.requestRender(1),this._emptyOutput;const i=this.bindParameters;this._configuration.hasEmission=i.hasEmission;const o=this.techniques.getCompiled(b,this._configuration),n=this.techniques.getCompiled(_),l=this._needsUpscalePass(a),m=l?M:1,h=l?this.techniques.getCompiled(P):null;if(!o||!n||l&&!h)return this.requestRender(1),this._emptyOutput;const p=this.renderingContext,{camera:d}=i;this._passParameters.normalTexture=r,this._passParameters.depthTexture=s,this._passParameters.projScale=1/d.computeScreenPixelSizeAtDist(1),this._passParameters.scaleGlobalIllumination=m;const{fullWidth:f,fullHeight:g}=d,w=Math.max(1,Math.floor(f*m)),I=Math.max(1,Math.floor(g*m)),q=this.fboCache.acquire(w,I,"global illumination input").acquireColor(T,0);p.bindFramebuffer(q.fbo),p.setViewport(0,0,w,I),p.bindTechnique(o,i,this._passParameters,this._drawParameters),p.screen.draw();const C=q.obtainAttachment(T),B=Math.max(1,Math.round(w/j)),G=Math.max(1,Math.round(I/j)),N=this.fboCache.acquire(B,G,"global illumination blur horizontal");p.bindFramebuffer(N.fbo),this._drawParameters.texture=q.getTexture(),this._drawParameters.weightTexture=C.attachment,u(this._drawParameters.blurSize,0,j/I),p.bindTechnique(n,i,this._passParameters,this._drawParameters),p.setViewport(0,0,B,G),p.screen.draw(),q.release();const A=l?"global illumination blur vertical":c.AMBIENT_ILLUMINATION,U=this.fboCache.acquire(B,G,A);p.bindFramebuffer(U.fbo),p.setViewport(0,0,B,G),p.setClearColor(1,1,1,0),p.clear(16384),this._drawParameters.texture=N.getTexture(),this._drawParameters.weightTexture=C.attachment,u(this._drawParameters.blurSize,j/B,0),p.bindTechnique(n,i,this._passParameters,this._drawParameters),p.setViewport(0,0,B,G),p.screen.draw(),N.release(),U.attachColor(C,T),C.release();let y=U;return h&&(y=this.fboCache.acquire(f,g,c.AMBIENT_ILLUMINATION).acquireColor(T,0),p.bindFramebuffer(y.fbo),p.setViewport(0,0,f,g),p.setClearColor(1,1,1,0),p.clear(16384),this._drawParametersUpscale.colorTexture=U.getTexture(),this._drawParametersUpscale.weightTexture=U.getTexture(T),p.bindTechnique(h,i,this._passParameters,this._drawParametersUpscale),p.screen.draw(),U.release()),p.setViewport4fv(d.fullViewport),this._passParameters.frameCount=(this._passParameters.frameCount+1)%64,++this._passParameters.accumulatedFrames,this._passParameters.accumulatedFrames<this._maxFrames&&this.requestRender(1),y}get _emptyOutput(){const e=this.renderingContext,{fullWidth:t,fullHeight:r}=this.bindParameters.camera,s=this.fboCache.acquire(t,r,c.AMBIENT_ILLUMINATION).acquireColor(T,0);return e.bindFramebuffer(s.fbo),e.setViewport(0,0,t,r),e.clearBuffer(0,[0,0,0,1]),e.clearBuffer(1,[0,0,0,0]),s}async _loadBlueNoiseTexture(e,t){a(t);const r=await h(e,{signal:t});if(a(t),!r)return;const s=new C;s.internalFormat=I.RGBA8,s.wrapMode=10497,s.isImmutable=!0,this._passParameters.noiseTexture=new q(this.renderingContext,s,r)}get _canRender(){const e=this.bindParameters;return!(!this._passParameters.noiseTexture||e.hasEmission&&!e.reprojection.lastFrameEmission||!e.reprojection.lastFrameDepth||!e.globalIllumination||this._resetBuffer)}get _mode(){const{hasGlobalIlluminationHighQuality:e,hasGlobalIllumination:t}=this.view.stage.renderer;return e?2:t?1:0}resetAccumulation(){this._passParameters.accumulatedFrames=0}_needsUpscalePass(e){return 1===e}get test(){}};e([l()],B.prototype,"consumes",void 0),e([l()],B.prototype,"produces",void 0),e([l()],B.prototype,"_abortController",void 0),B=e([m("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIllumination")],B);export{B as GlobalIllumination,j as blurSizePixels};
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 a}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import l from"../../geometry/Point.js";import c 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 u}from"../../geometry/projection/projectVectorToVector.js";import{cameraOnContentAlongViewDirection as f}from"./camera/intersectionUtils.js";import{directionToHeadingTilt as A,viewModeDependentUtil as d}from"./support/viewingModeUtils.js";const O={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},R=[O.FINAL,O.COMPOSITE,O.OPAQUE,O.TRANSPARENT],T={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GAUSSIAN_SPLAT:"gaussian",GROUND_DEPTH:"ground-depth",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOW_HIGHLIGHT:"shadow-highlight",TRANSPARENT_ENVIRONMENT:"transparent-environment",VOXEL:"voxel",VIEWSHED:"viewshed"},I=Array.from(Object.values(T)).concat(R);function E(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 N(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 g(o,e,r,i){return i||(i=t()),r=r||o.spatialReference,s(r,e,i,o.renderCoordsHelper.spatialReference)?i:null}function j(r,t,i){const n=r.renderSpatialReference,a=A(r,t.eye,t.viewForward,t.up,S);let s=r.spatialReference;return u(t.eye,n,L,s)||(s=c.WGS84,u(t.eye,n,L,s)),null==i?i=new o(new l(L,s),a.heading,a.tilt,e(t.fov)):(i.position.x=L[0],i.position.y=L[1],i.position.z=L[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,l=d(o).headingTiltToDirectionUp,c=a();if(!p(e.position,c,t))return null;const s=l(c,e.heading,e.tilt);i(s.direction,s.direction,o.state.camera.distance),n(s.direction,s.direction,c);const m=f(o,c,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 L=a(),S={heading:0,tilt:0};export{I as AllInternalRenderNodeOutputs,R as AllRenderNodeOutputs,T as InternalRenderCategory,O as RenderNodeOutput,j as fromRenderCamera,N as fromRenderCoordinates,g as renderCoordinateTransformAt,y as toRenderCamera,E 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 u}from"../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as p}from"../../geometry/projection/projectVectorToVector.js";import{cameraOnContentAlongViewDirection as f}from"./camera/intersectionUtils.js";import{directionToHeadingTilt as d,viewModeDependentUtil as A}from"./support/viewingModeUtils.js";const O={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},R=[O.FINAL,O.COMPOSITE,O.OPAQUE,O.TRANSPARENT],T={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GAUSSIAN_SPLAT:"gaussian",GROUND_DEPTH:"ground-depth",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOW_HIGHLIGHT:"shadow-highlight",TRANSPARENT_ENVIRONMENT:"transparent-environment",VOXEL:"voxel",VIEWSHED:"viewshed"},I=Array.from(Object.values(T)).concat(R);function E(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 N(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 g(o,e,r,i){return i||(i=t()),r=r||o.spatialReference,s(r,e,i,o.renderCoordsHelper.spatialReference)?i:null}function j(r,t,i){const n=r.renderSpatialReference,a=d(r,t.eye,t.viewForward,t.up,U);let s=r.spatialReference;return p(t.eye,n,S,s)||(s=l.WGS84,p(t.eye,n,S,s)),null==i?i=new o(new c(S,s),a.heading,a.tilt,e(t.fov)):(i.position.x=S[0],i.position.y=S[1],i.position.z=S[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){return L(o,e,void 0)}function L(o,e,t){if(!e)return null;const c=o.renderSpatialReference,l=A(o).headingTiltToDirectionUp,s=a();if(!u(e.position,s,c))return null;const m=l(s,e.heading,e.tilt);i(m.direction,m.direction,o.state.camera.distance),n(m.direction,m.direction,s);const p=f(o,s,m.direction,m.up,t);return p.fov=r(e.fov),p.row=e.layout.row,p.rows=e.layout.rows,p.column=e.layout.column,p.columns=e.layout.columns,p}const S=a(),U={heading:0,tilt:0};export{I as AllInternalRenderNodeOutputs,R as AllRenderNodeOutputs,T as InternalRenderCategory,O as RenderNodeOutput,j as fromRenderCamera,N as fromRenderCoordinates,g as renderCoordinateTransformAt,y as toRenderCamera,L as toRenderCameraWithScale,E as toRenderCoordinates};
@@ -473,6 +473,7 @@ export interface SceneViewProperties extends ViewProperties, DOMContainerPropert
473
473
  * Right-click+Drag | 3D-rotate around the center of the view
474
474
  * Arrow Keys | Nudge the view left, right, up, or down (only supported in global scene)
475
475
  * B + Left-click+Drag | 3D-rotate around the camera's position
476
+ * B + Right-click+Drag | Forced horizontal pan
476
477
  * P | Move the camera to look perpendicular to the data displayed in the view
477
478
  * N | Adjust the SceneView to point north
478
479
  * W | Tilt camera up
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{createTask as t}from"../../../core/asyncUtils.js";import{throwIfAborted as e,isAborted as r}from"../../../core/promiseUtils.js";import{whenOnce as s}from"../../../core/reactiveUtils.js";import{diff as i}from"../../../core/accessorSupport/diffUtils.js";import{isGraphicsLayer as a,isSceneLayer as o}from"../../../layers/support/layerUtils.js";import{getDisplayedSymbol as n}from"../../../symbols/support/symbolUtils.js";import{GraphicState as c}from"../../3d/layers/graphics/GraphicState.js";async function l(t,r,s,i){const a=r.createQuery();a.objectIds=t,a.outFields=["*"],a.returnM=r.capabilities.data.supportsM,a.returnZ=r.capabilities.data.supportsZ,a.returnGeometry=!0,o(r)&&null!=r.infoFor3D||(a.outSpatialReference=s),!o(r)&&r.capabilities?.data.supportsTrueCurve&&(a.returnTrueCurves=!0);const n=await r.queryFeatures(a,{signal:i});return e(i),n.features}async function y(t,r,s,a){const o=await n(t,{useSourceLayer:!0,ignoreGraphicSymbol:!0,webStyleCache:r,scale:s});e(a);null!=i(t.symbol,o)&&(t.symbol=o)}async function u(i,o,n,c,l){e(l);const y=n.sourceLayer,u=n.layer??y,m=n.getObjectId();let f=null,b=null;function w(s){f?.abort(),a(u)?n.visible=s:f=t(async t=>{const i=await p(o,u);if(e(t),i&&!o.destroyed&&!i.destroyed)try{null!=m&&"number"==typeof m&&"setVisibility"in i&&i.setVisibility?.(m,s)}catch(a){if(r(t)||o.destroyed||i.destroyed)return;throw a}})}async function h(){return b||(b=(async()=>{w(!0);try{const t=o.destroyed?null:await p(o,u).catch(()=>{});t&&!t.destroyed&&await s(()=>!t.updating)}finally{i.remove(c)}})(),b)}i.add(c);try{await d(o,c,l),e(l),w(!1)}catch(v){throw await h(),v}const j=async()=>h();return{remove:j,[Symbol.asyncDispose]:()=>j()}}async function p(t,e){if(!e||"building-component"===e.type)return;const r="subtype-sublayer"===e.type?e.parent:e;return r?t.whenLayerView(r):void 0}async function d(t,e,r){if("3d"===t.type){const i=new c({graphic:e}),a=t.trackGraphicState(i);try{await s(()=>i.displaying||i.error,r)}finally{a.remove()}}else await s(()=>e.visible,r)}export{l as fetchFullFeaturesByObjectId,u as swapForEditingSession,y as updateGraphicSymbolWhenRequired};
@@ -3,7 +3,7 @@ import type SketchTooltipVisibleElements from "./SketchTooltipVisibleElements.js
3
3
  import type { Icon } from "@esri/calcite-components/components/calcite-icon";
4
4
  import type { SketchTooltipVisibleElementsProperties } from "./SketchTooltipVisibleElements.js";
5
5
 
6
- export interface SketchTooltipOptionsProperties extends Partial<Pick<SketchTooltipOptions, "enabled" | "helpMessage" | "helpMessageIcon" | "inputEnabled">> {
6
+ export interface SketchTooltipOptionsProperties extends Partial<Pick<SketchTooltipOptions, "enabled" | "forceEnabled" | "helpMessage" | "helpMessageIcon" | "inputEnabled">> {
7
7
  /** The elements that are displayed within the tooltip while sketching. */
8
8
  visibleElements?: SketchTooltipVisibleElementsProperties;
9
9
  }
@@ -94,6 +94,14 @@ export default class SketchTooltipOptions extends Accessor {
94
94
  * @default false
95
95
  */
96
96
  accessor enabled: boolean;
97
+ /**
98
+ * Temporary override option for `enabled`. Can for example be used to allow a keybinding to
99
+ * temporarily show the tooltips.
100
+ *
101
+ * @default false
102
+ * @internal
103
+ */
104
+ accessor forceEnabled: boolean;
97
105
  /**
98
106
  * A custom help message that is displayed at the bottom of the tooltip. If not set, the default
99
107
  * help message based on the current state of the tool is shown.
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{removeUnordered as e,filterInPlace as t}from"../../core/arrayUtils.js";import s from"../../core/Handles.js";import"../../core/has.js";import r from"../../core/Logger.js";import{removeMaybe as i}from"../../core/maybe.js";import{recordPerformance as a}from"../../core/performance.js";import n from"../../core/PerformanceSampler.js";import{isAborted as u,createAbortError as _,when as h,isPromiseLike as o,ignoreAbortErrors as E}from"../../core/promiseUtils.js";import{watch as d,initial as T,when as c}from"../../core/reactiveUtils.js";import{signal as m}from"../../core/signal.js";import{Milliseconds as l}from"../../core/time.js";import R from"./debugFlags.js";import{PromiseQueue as g}from"./PromiseQueue.js";import{Yield as I}from"./Yield.js";function A(){return new C}const p={RESOURCE_CONTROLLER_IMMEDIATE:"immediate",RESOURCE_CONTROLLER:"schedule",SLIDE:"slide",STREAM_DATA_LOADER:"stream loader",ELEVATION_QUERY:"elevation query",TERRAIN_SURFACE:"terrain",SURFACE_GEOMETRY_UPDATES:"surface geometry updates",LOD_RENDERER:"LoD renderer",GRAPHICS_CORE:"Graphics3D",I3S:"I3S",LYR3D:"Lyr3D",TILES3D:"3DTiles",POINT_CLOUD_LAYER:"point cloud",FEATURE_TILE_FETCHER:"feature fetcher",STREAM_CONTROLLER:"stream controller",OCCLUSION_QUERY:"occlusion query",OVERLAY:"overlay",OVERLAY_RENDERER:"overlay renderer",STAGE:"stage",GRAPHICS_DECONFLICTOR:"graphics deconflictor",FILTER_VISIBILITY:"graphics filter visibility",SCALE_VISIBILITY:"graphics scale visibility",FRUSTUM_VISIBILITY:"graphics frustum visibility",POINT_OF_INTEREST_FREQUENT:"POI frequent",POINT_OF_INTEREST_INFREQUENT:"POI infrequent",LABELER:"labeler",FEATURE_QUERY_ENGINE:"feature query",FEATURE_TILE_TREE:"feature tile tree",FEATURE_TILE_TREE_ACTIVE:"fast feature tile tree",ELEVATION_ALIGNMENT:"elevation alignment",ELEVATION_ALIGNMENT_SCENE:"elevation alignment scene",TEXT_TEXTURE_ATLAS:"text texture atlas",TEXTURE_UNLOAD:"texture unload",LINE_OF_SIGHT_TOOL:"line of sight tool",LINE_OF_SIGHT_TOOL_INTERACTIVE:"interactive line of sight tool",VOLUME_MEASUREMENT:"volume measurement",ELEVATION_PROFILE:"elevation profile",SNAPPING:"snapping",SHADOW_ACCUMULATOR:"shadow accumulator",CLOUDS_GENERATOR:"clouds generator",FLOW_GENERATOR:"flow generator",GAUSSIAN_SPLAT_SORTING:"gaussian splat sorting",GAUSSIAN_SPLAT_TEXTURE_ATLAS:"gaussian splat texture atlas",MAPVIEW_FETCH_QUEUE:"mapview fetch queue",MAPVIEW_LAYERVIEW_UPDATE:"mapview layerview update",MAPVIEW_VECTOR_TILE_PARSING_QUEUE:"mapview vector tile parsing queue",NONE:0,TEST_PRIO:1},L=0,f=new Map([[p.RESOURCE_CONTROLLER_IMMEDIATE,L],[p.RESOURCE_CONTROLLER,4],[p.SLIDE,L],[p.STREAM_DATA_LOADER,L],[p.ELEVATION_QUERY,L],[p.TERRAIN_SURFACE,1],[p.SURFACE_GEOMETRY_UPDATES,1],[p.LOD_RENDERER,2],[p.GRAPHICS_CORE,2],[p.I3S,2],[p.LYR3D,2],[p.TILES3D,2],[p.POINT_CLOUD_LAYER,2],[p.FEATURE_TILE_FETCHER,2],[p.STREAM_CONTROLLER,2],[p.CLOUDS_GENERATOR,2],[p.OCCLUSION_QUERY,2],[p.OVERLAY,4],[p.OVERLAY_RENDERER,4],[p.STAGE,4],[p.GRAPHICS_DECONFLICTOR,4],[p.FILTER_VISIBILITY,4],[p.SCALE_VISIBILITY,4],[p.FRUSTUM_VISIBILITY,4],[p.POINT_OF_INTEREST_FREQUENT,6],[p.POINT_OF_INTEREST_INFREQUENT,30],[p.LABELER,8],[p.FEATURE_QUERY_ENGINE,8],[p.FEATURE_TILE_TREE,16],[p.FEATURE_TILE_TREE_ACTIVE,L],[p.ELEVATION_ALIGNMENT,12],[p.ELEVATION_ALIGNMENT_SCENE,14],[p.TEXT_TEXTURE_ATLAS,12],[p.TEXTURE_UNLOAD,12],[p.LINE_OF_SIGHT_TOOL,16],[p.LINE_OF_SIGHT_TOOL_INTERACTIVE,L],[p.VOLUME_MEASUREMENT,4],[p.SNAPPING,L],[p.SHADOW_ACCUMULATOR,30],[p.FLOW_GENERATOR,12],[p.GAUSSIAN_SPLAT_SORTING,2],[p.GAUSSIAN_SPLAT_TEXTURE_ATLAS,12],[p.MAPVIEW_FETCH_QUEUE,L],[p.MAPVIEW_LAYERVIEW_UPDATE,2],[p.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,L]]);function O(e){return f.has(e)?f.get(e):"number"==typeof e?e:1}const S=l(6.5),N=l(1),U=l(30),b=l(1e3/30),P=l(100),k=.9;class C{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(e=>e.needsUpdate)}constructor(){this._updating=m(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new n("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new F,this.state=1,this._tasks=new Array,this._runQueue=new Array,this._load=0,this._forceTask=!1,this._debug=!1,this._debugHandle=d(()=>R.SCHEDULER_LOG_SLOW_TASKS,e=>this._debug=e,T);for(const e of Object.keys(p))this.performanceInfo.tasks.set(p[e],new n(String(p[e])))}destroy(){this._tasks.forEach(e=>e.remove()),this._tasks.length=0,this._runQueue.length=0,i(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this._runFrame())}))}registerTask(e,t){const s=new y(this,e,t);return this._tasks.push(s),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new n(e)),s}get load(){return this._load}frame(e){if(this._startFrameTaskTimes(),this._updateBudget(e)){const e=this._budget.now();this._runFrame();const t=this._budget.now();this._recordFrameTaskTimes(t-e);const s=2===this.state?"Idle":1===this.state?"Interacting":"Animating";return a(`${s} Frame Tasks`,e,t,"Maps SDK","Scheduling"),!0}return this._recordFrameTaskTimes(0),!1}_updateBudget(e){this._test&&(this._test.usedBudget=0),++this._frameNumber;let t=S,s=e.frameDuration,r=N;switch(this.state){case 2:t=l(0),s=l(Math.max(P,e.frameDuration)),r=U;break;case 1:s=l(Math.max(b,e.frameDuration))}return s=l(s-e.elapsedFrameTime-t),2!==this.state&&s<N&&!this._forceTask?(this._forceTask=!0,!1):(s=l(Math.max(s,r)),this._budget.reset(s),this._updateLoad(),this._schedule())}_runFrame(){this._forceTask=!1,this._microTaskQueued=!1,this._run(),this._test&&(this._test.usedBudget=this._budget.elapsed)}stopFrame(){this._budget.reset(l(0)),this._budget.madeProgress()}removeTask(t){e(this._tasks,t),e(this._runQueue,t),this._updatingChanged()}_updateTask(e){this._tasks.forEach(t=>{t.name===e&&t.setPriority(e)})}_getState(e){if(this._runQueue.some(t=>t.name===e))return"s";let t="i";return this._tasks.forEach(s=>{s.name===e&&s.needsUpdate&&(s.schedulePriority<=1?t="r":"r"!==t&&(t="w"))}),t}_getRuntime(e){let t=0;return this._tasks.forEach(s=>{s.name===e&&(t+=s.runtime)}),t}_resetRuntimes(){this._tasks.forEach(e=>e.runtime=0)}_getRunning(){const e=new Map;if(this._tasks.forEach(t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)}),0===e.size)return null;let t="";return e.forEach((e,s)=>{t+=e>1?` ${e}x ${s}`:` ${s}`}),t}_updateLoad(){const e=this._tasks.reduce((e,t)=>t.needsUpdate?++e:e,0);this._load=this._load*k+e*(1-k)}_schedule(){for(t(this._runQueue,e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1)),this._tasks.forEach(e=>{e.basePriority===L&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)});0===this._runQueue.length;){let e=!1,t=0;if(this._tasks.forEach(s=>{if(s.needsUpdate&&0!==s.schedulePriority&&s.basePriority!==L&&s.blockFrame!==this._frameNumber)if(e=!0,t=Math.max(t,s.basePriority),1===s.schedulePriority)s.schedulePriority=0,this._runQueue.push(s);else--s.schedulePriority}),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){do{for(;this._runQueue.length>0;){const t=this._budget.now(),s=this._runQueue.pop();this._budget.resetProgress();try{s.task.runTask(this._budget)===I&&(s.blockFrame=this._frameNumber)}catch(e){r.getLogger("esri.views.support.Scheduler").error(`Exception in task "${s.name}"`,e),s.blockFrame=this._frameNumber}!this._budget.hasProgressed&&s.blockFrame!==this._frameNumber&&s.needsUpdate&&(s.name,p.I3S,s.blockFrame=this._frameNumber),s.schedulePriority=s.basePriority;const i=this._budget.now(),n=i-t;if(a(`${s.name}`,t,i,"Maps SDK","Scheduling"),s.runtime+=n,this._frameTaskTimes.set(s.priority,this._frameTaskTimes.get(s.priority)+n),this._budget.remaining<=0)return void this._updatingChanged()}}while(this._schedule());this._updatingChanged()}_startFrameTaskTimes(){for(const e of Object.keys(p))this._frameTaskTimes.set(p[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach((e,t)=>this.performanceInfo.tasks.get(t).push(e)),this.performanceInfo.total.push(e)}get test(){return this._test}}class y{get task(){return this._task.value}get readyToRun(){return this._queue.readyToRun}get updating(){return this._queue.updating}constructor(e,t,r){this._scheduler=e,this.name=t,this.blockFrame=0,this.runtime=0,this._queue=new g,this._handles=new s,this._basePriority=O(t),this.schedulePriority=this._basePriority,this._task=m(null!=r?r:this._queue),this._handles.add(c(()=>this.task.readyToRun,t=>e.taskRunningChanged(t)))}remove(){this.processQueue(w),this._scheduler.removeTask(this),this.schedule=G.schedule,this.reschedule=G.reschedule,this.scheduleGenerator=G.scheduleGenerator,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){if(this.name===e)return;this.name=e;const t=O(e);this._basePriority!==L&&0===this.schedulePriority||(this.schedulePriority=t),this._basePriority=t}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.readyToRun||!this.task.destroyed&&this.task.readyToRun}schedule(e,t,s){return this._queue.push(e,t,s)}reschedule(e,t,s){return this._queue.unshift(e,t,s)}scheduleGenerator(e,t,s){return this._queue.pushGenerator(e,t,s)}processQueue(e){return this._queue.runTask(e)}}class F{constructor(){this._begin=performance?.now()??0,this._budget=0,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e){this._begin=this.now(),this._budget=e,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}const w=new F;function D(e){const t=new F;return t.reset(e),t}w.enabled=!1;class M{remove(){}processQueue(){}schedule(e,t,s){try{if(u(t)){const e=_();return s?Promise.resolve(s(e)):Promise.reject(e)}return h(e(w))}catch(r){return Promise.reject(r)}}reschedule(e,t,s){return this.schedule(e,t,s)}async scheduleGenerator(e,t,s){if(u(t)){const e=_();if(s)return s(e);throw e}const r=e(w);for(;;){const e=r.next(w),i=o(e)?await e:e;if(u(t)){const e=_();if(s){const t=s(e),i=r.return(null);return o(i)&&await E(i),t}const t=r.throw(e);throw o(t)&&await E(t),e}if(i.done)return i.value}}}const G=new M;export{G as ImmediateTask,p as TaskPriority,O as getTaskPriority,D as makeBudget,A as newScheduler,w as noBudget,f as taskPriorities};
2
+ import{removeUnordered as e,filterInPlace as t}from"../../core/arrayUtils.js";import s from"../../core/Handles.js";import"../../core/has.js";import r from"../../core/Logger.js";import{removeMaybe as i}from"../../core/maybe.js";import{recordPerformance as a}from"../../core/performance.js";import n from"../../core/PerformanceSampler.js";import{isAborted as u,createAbortError as _,when as h,isPromiseLike as o,ignoreAbortErrors as E}from"../../core/promiseUtils.js";import{watch as d,initial as T,when as c}from"../../core/reactiveUtils.js";import{signal as m}from"../../core/signal.js";import{Milliseconds as l}from"../../core/time.js";import R from"./debugFlags.js";import{PromiseQueue as g}from"./PromiseQueue.js";import{Yield as I}from"./Yield.js";function A(){return new C}const p={RESOURCE_CONTROLLER_IMMEDIATE:"immediate",RESOURCE_CONTROLLER:"schedule",SLIDE:"slide",STREAM_DATA_LOADER:"stream loader",ELEVATION_QUERY:"elevation query",TERRAIN_SURFACE:"terrain",SURFACE_GEOMETRY_UPDATES:"surface geometry updates",LOD_RENDERER:"LoD renderer",GRAPHICS_CORE:"Graphics3D",I3S:"I3S",LYR3D:"Lyr3D",TILES3D:"3DTiles",POINT_CLOUD_LAYER:"point cloud",FEATURE_TILE_FETCHER:"feature fetcher",STREAM_CONTROLLER:"stream controller",OCCLUSION_QUERY:"occlusion query",OVERLAY:"overlay",OVERLAY_RENDERER:"overlay renderer",STAGE:"stage",GRAPHICS_DECONFLICTOR:"graphics deconflictor",FILTER_VISIBILITY:"graphics filter visibility",SCALE_VISIBILITY:"graphics scale visibility",FRUSTUM_VISIBILITY:"graphics frustum visibility",POINT_OF_INTEREST_FREQUENT:"POI frequent",POINT_OF_INTEREST_INFREQUENT:"POI infrequent",LABELER:"labeler",FEATURE_QUERY_ENGINE:"feature query",FEATURE_TILE_TREE:"feature tile tree",FEATURE_TILE_TREE_ACTIVE:"fast feature tile tree",ELEVATION_ALIGNMENT:"elevation alignment",ELEVATION_ALIGNMENT_SCENE:"elevation alignment scene",TEXT_TEXTURE_ATLAS:"text texture atlas",TEXTURE_UNLOAD:"texture unload",LINE_OF_SIGHT_TOOL:"line of sight tool",LINE_OF_SIGHT_TOOL_INTERACTIVE:"interactive line of sight tool",VOLUME_MEASUREMENT:"volume measurement",ELEVATION_PROFILE:"elevation profile",SNAPPING:"snapping",SHADOW_ACCUMULATOR:"shadow accumulator",CLOUDS_GENERATOR:"clouds generator",FLOW_GENERATOR:"flow generator",GAUSSIAN_SPLAT_SORTING:"gaussian splat sorting",GAUSSIAN_SPLAT_TEXTURE_ATLAS:"gaussian splat texture atlas",MAPVIEW_FETCH_QUEUE:"mapview fetch queue",MAPVIEW_LAYERVIEW_UPDATE:"mapview layerview update",MAPVIEW_VECTOR_TILE_PARSING_QUEUE:"mapview vector tile parsing queue",NONE:0,TEST_PRIO:1},L=0,f=new Map([[p.RESOURCE_CONTROLLER_IMMEDIATE,L],[p.RESOURCE_CONTROLLER,4],[p.SLIDE,L],[p.STREAM_DATA_LOADER,L],[p.ELEVATION_QUERY,L],[p.TERRAIN_SURFACE,1],[p.SURFACE_GEOMETRY_UPDATES,1],[p.LOD_RENDERER,2],[p.GRAPHICS_CORE,2],[p.I3S,2],[p.LYR3D,2],[p.TILES3D,3],[p.POINT_CLOUD_LAYER,2],[p.FEATURE_TILE_FETCHER,2],[p.STREAM_CONTROLLER,2],[p.CLOUDS_GENERATOR,2],[p.OCCLUSION_QUERY,2],[p.OVERLAY,4],[p.OVERLAY_RENDERER,4],[p.STAGE,4],[p.GRAPHICS_DECONFLICTOR,4],[p.FILTER_VISIBILITY,4],[p.SCALE_VISIBILITY,4],[p.FRUSTUM_VISIBILITY,4],[p.POINT_OF_INTEREST_FREQUENT,6],[p.POINT_OF_INTEREST_INFREQUENT,30],[p.LABELER,8],[p.FEATURE_QUERY_ENGINE,8],[p.FEATURE_TILE_TREE,16],[p.FEATURE_TILE_TREE_ACTIVE,L],[p.ELEVATION_ALIGNMENT,12],[p.ELEVATION_ALIGNMENT_SCENE,14],[p.TEXT_TEXTURE_ATLAS,12],[p.TEXTURE_UNLOAD,12],[p.LINE_OF_SIGHT_TOOL,16],[p.LINE_OF_SIGHT_TOOL_INTERACTIVE,L],[p.VOLUME_MEASUREMENT,4],[p.SNAPPING,L],[p.SHADOW_ACCUMULATOR,30],[p.FLOW_GENERATOR,12],[p.GAUSSIAN_SPLAT_SORTING,2],[p.GAUSSIAN_SPLAT_TEXTURE_ATLAS,12],[p.MAPVIEW_FETCH_QUEUE,L],[p.MAPVIEW_LAYERVIEW_UPDATE,2],[p.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,L]]);function O(e){return f.has(e)?f.get(e):"number"==typeof e?e:1}const S=l(6.5),N=l(1),U=l(30),b=l(1e3/30),P=l(100),k=.9;class C{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(e=>e.needsUpdate)}constructor(){this._updating=m(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new n("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new F,this.state=1,this._tasks=new Array,this._runQueue=new Array,this._load=0,this._forceTask=!1,this._debug=!1,this._debugHandle=d(()=>R.SCHEDULER_LOG_SLOW_TASKS,e=>this._debug=e,T);for(const e of Object.keys(p))this.performanceInfo.tasks.set(p[e],new n(String(p[e])))}destroy(){this._tasks.forEach(e=>e.remove()),this._tasks.length=0,this._runQueue.length=0,i(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this._runFrame())}))}registerTask(e,t){const s=new y(this,e,t);return this._tasks.push(s),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new n(e)),s}get load(){return this._load}frame(e){if(this._startFrameTaskTimes(),this._updateBudget(e)){const e=this._budget.now();this._runFrame();const t=this._budget.now();this._recordFrameTaskTimes(t-e);const s=2===this.state?"Idle":1===this.state?"Interacting":"Animating";return a(`${s} Frame Tasks`,e,t,"Maps SDK","Scheduling"),!0}return this._recordFrameTaskTimes(0),!1}_updateBudget(e){this._test&&(this._test.usedBudget=0),++this._frameNumber;let t=S,s=e.frameDuration,r=N;switch(this.state){case 2:t=l(0),s=l(Math.max(P,e.frameDuration)),r=U;break;case 1:s=l(Math.max(b,e.frameDuration))}return s=l(s-e.elapsedFrameTime-t),2!==this.state&&s<N&&!this._forceTask?(this._forceTask=!0,!1):(s=l(Math.max(s,r)),this._budget.reset(s),this._updateLoad(),this._schedule())}_runFrame(){this._forceTask=!1,this._microTaskQueued=!1,this._run(),this._test&&(this._test.usedBudget=this._budget.elapsed)}stopFrame(){this._budget.reset(l(0)),this._budget.madeProgress()}removeTask(t){e(this._tasks,t),e(this._runQueue,t),this._updatingChanged()}_updateTask(e){this._tasks.forEach(t=>{t.name===e&&t.setPriority(e)})}_getState(e){if(this._runQueue.some(t=>t.name===e))return"s";let t="i";return this._tasks.forEach(s=>{s.name===e&&s.needsUpdate&&(s.schedulePriority<=1?t="r":"r"!==t&&(t="w"))}),t}_getRuntime(e){let t=0;return this._tasks.forEach(s=>{s.name===e&&(t+=s.runtime)}),t}_resetRuntimes(){this._tasks.forEach(e=>e.runtime=0)}_getRunning(){const e=new Map;if(this._tasks.forEach(t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)}),0===e.size)return null;let t="";return e.forEach((e,s)=>{t+=e>1?` ${e}x ${s}`:` ${s}`}),t}_updateLoad(){const e=this._tasks.reduce((e,t)=>t.needsUpdate?++e:e,0);this._load=this._load*k+e*(1-k)}_schedule(){for(t(this._runQueue,e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1)),this._tasks.forEach(e=>{e.basePriority===L&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)});0===this._runQueue.length;){let e=!1,t=0;if(this._tasks.forEach(s=>{if(s.needsUpdate&&0!==s.schedulePriority&&s.basePriority!==L&&s.blockFrame!==this._frameNumber)if(e=!0,t=Math.max(t,s.basePriority),1===s.schedulePriority)s.schedulePriority=0,this._runQueue.push(s);else--s.schedulePriority}),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){do{for(;this._runQueue.length>0;){const t=this._budget.now(),s=this._runQueue.pop();this._budget.resetProgress();try{s.task.runTask(this._budget)===I&&(s.blockFrame=this._frameNumber)}catch(e){r.getLogger("esri.views.support.Scheduler").error(`Exception in task "${s.name}"`,e),s.blockFrame=this._frameNumber}!this._budget.hasProgressed&&s.blockFrame!==this._frameNumber&&s.needsUpdate&&(s.name,p.I3S,s.blockFrame=this._frameNumber),s.schedulePriority=s.basePriority;const i=this._budget.now(),n=i-t;if(a(`${s.name}`,t,i,"Maps SDK","Scheduling"),s.runtime+=n,this._frameTaskTimes.set(s.priority,this._frameTaskTimes.get(s.priority)+n),this._budget.remaining<=0)return void this._updatingChanged()}}while(this._schedule());this._updatingChanged()}_startFrameTaskTimes(){for(const e of Object.keys(p))this._frameTaskTimes.set(p[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach((e,t)=>this.performanceInfo.tasks.get(t).push(e)),this.performanceInfo.total.push(e)}get test(){return this._test}}class y{get task(){return this._task.value}get readyToRun(){return this._queue.readyToRun}get updating(){return this._queue.updating}constructor(e,t,r){this._scheduler=e,this.name=t,this.blockFrame=0,this.runtime=0,this._queue=new g,this._handles=new s,this._basePriority=O(t),this.schedulePriority=this._basePriority,this._task=m(null!=r?r:this._queue),this._handles.add(c(()=>this.task.readyToRun,t=>e.taskRunningChanged(t)))}remove(){this.processQueue(w),this._scheduler.removeTask(this),this.schedule=G.schedule,this.reschedule=G.reschedule,this.scheduleGenerator=G.scheduleGenerator,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){if(this.name===e)return;this.name=e;const t=O(e);this._basePriority!==L&&0===this.schedulePriority||(this.schedulePriority=t),this._basePriority=t}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.readyToRun||!this.task.destroyed&&this.task.readyToRun}schedule(e,t,s){return this._queue.push(e,t,s)}reschedule(e,t,s){return this._queue.unshift(e,t,s)}scheduleGenerator(e,t,s){return this._queue.pushGenerator(e,t,s)}processQueue(e){return this._queue.runTask(e)}}class F{constructor(){this._begin=performance?.now()??0,this._budget=0,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e){this._begin=this.now(),this._budget=e,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}const w=new F;function D(e){const t=new F;return t.reset(e),t}w.enabled=!1;class M{remove(){}processQueue(){}schedule(e,t,s){try{if(u(t)){const e=_();return s?Promise.resolve(s(e)):Promise.reject(e)}return h(e(w))}catch(r){return Promise.reject(r)}}reschedule(e,t,s){return this.schedule(e,t,s)}async scheduleGenerator(e,t,s){if(u(t)){const e=_();if(s)return s(e);throw e}const r=e(w);for(;;){const e=r.next(w),i=o(e)?await e:e;if(u(t)){const e=_();if(s){const t=s(e),i=r.return(null);return o(i)&&await E(i),t}const t=r.throw(e);throw o(t)&&await E(t),e}if(i.done)return i.value}}}const G=new M;export{G as ImmediateTask,p as TaskPriority,O as getTaskPriority,D as makeBudget,A as newScheduler,w as noBudget,f as taskPriorities};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{createTask as t}from"../../core/asyncUtils.js";import s from"../../core/Collection.js";import i from"../../core/Error.js";import{EventedAccessor as r}from"../../core/Evented.js";import a from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{abortMaybe as n,destroyMaybe as p}from"../../core/maybe.js";import{throwIfAborted as l,isAbortError as u}from"../../core/promiseUtils.js";import h from"../../core/ReactiveMap.js";import{on as m,sync as c,watch as d,whenOnce as f}from"../../core/reactiveUtils.js";import{property as y,subclass as v}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as g}from"../../core/support/UpdatingHandles.js";import F from"../../geometry/SpatialReference.js";import{getGraphicLayer as _}from"../../graphic/graphicOriginUtils.js";import{system as x}from"../../time/constants.js";import{createReactiveGraphic as w,isAttributeFormSupportedLayerWithAttachments as I,layerSupportsQueryAttachments as b,queryAttachmentsForElements as A}from"./batchAttributeFormUtils.js";import{ArcadeExecutorProvider as M}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as E}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as k}from"./expressions/ExpressionsModel.js";import C from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as T}from"./inputs/support/createBatchFormInputs.js";import{isGroupInput as V,isFieldInput as j}from"./inputs/support/inputUtils.js";import H from"./templates/BatchFormTemplate.js";import{getLayerContingentValuesMetaData as L}from"./templates/support/contingentValuesUtils.js";import{createBatchFormTemplate as B}from"./templates/support/createBatchFormTemplate.js";import{isExcludedFromSharedForm as G,isGroupElementTemplate as R}from"./templates/support/templateUtils.js";function U(e,t){return e?.find(e=>e.layer===t)}let Z=class extends r{constructor(e){super(e),this._attachmentCache=new h,this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new s,this._hasAsyncArcadeExpressions=!1,this.maximumFeatureCount=2e3,this.maximumFeatureCountWithComplexForms=50,this.map=null,this.readOnly=!1,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this.layerInfos=null,this._arcadeExecutorProvider=new M,this._activeFormInputsByElementId=new Map,this._emptyForm=new C({inputs:[]}),this._emptyFormTemplate=new H({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new h,this._updatingHandles=new g,this._layerTemplateMap=new h,this._layerContingentValuesMap=new h,this._workingFeatures=new s,this._expressionsManager=new E({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:x}}),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.addHandles([m(()=>this.features,"after-changes",()=>{this.notifyChange("layers"),this._prepare()},c),d(()=>[this.features,this.map,this.timeZone,this.editType],()=>this._prepare(),c),d(()=>this.activeForm,()=>this._activeFormInputsByElementId.clear(),c),d(()=>[this.activeFeature,this.activeLayer,this.activeForm],()=>{this._syncAttachments()},c)]),this._prepare()}destroy(){this._prepareTask=n(this._prepareTask),this._workingFeatures.destroyAll(),p(this._expressionsManager),this._updatingHandles.destroy(),this._reactiveGraphicLookup=new h,this._emptyForm.destroy(),this._emptyFormTemplate.destroy()}get _effectiveTimeZone(){return this.timeZone??"system"}get activeFeature(){const e=this.activeFeatureIndex;return e<0?null:this.features.at(e)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const e=this._workingFeatures.at(this.activeFeatureIndex);if(!e)return this._emptyForm;const t=this._featureFormMap.get(e);if(t)return t;const s=this._makeBatchFormInputsForFeature(e);return s!==this._emptyForm&&this._featureFormMap.set(e,s),s}get activeLayer(){const{activeFeature:e}=this;if(!e)return null;return _(e)??null}get calculating(){return this._expressionsManager.calculating}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:e}=this;return this.invalidFeatures.some(t=>t!==e)}get hasAsyncArcadeExpressions(){return this._hasAsyncArcadeExpressions}get hasTooManyFeatures(){return this._workingFeatures.length>this.maximumFeatureCount}get hasTooManyComplexFeatures(){return this._workingFeatures.length>this.maximumFeatureCountWithComplexForms&&this.hasAsyncArcadeExpressions}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.visibleInputs.length>0}get hasLayersWithContingentValues(){for(const e of this.layers){const t=this._layerContingentValuesMap.get(e);if(t&&t.size>0)return!0}return!1}get visibleInputs(){return this.activeForm.inputs.filter(e=>e.visible)}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return"noElements";const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case"hidden:not-in-all-layers":case"hidden:no-domain-in-common":e.add("noElementsInCommon");break;case"hidden:field-definition":case"hidden:group-visibility-expression:all-features":case"hidden:visibility-expression:all-features":e.add("allElementsHidden");break;case"hidden:group-visibility-expression:some-features":case"hidden:visibility-expression:some-features":return"elementsHiddenInSome"}return e.has("allElementsHidden")?"allElementsHidden":"noElementsInCommon"}get status(){const e=this._prepareTask;return null==e?"not-loaded":e.finished?null!=e.error?"failed":"loaded":"loading"}get submittable(){return this.valid,!0}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid}get layers(){const e=new Set;return this.features.forEach(t=>{const s=_(t);s&&e.add(s)}),Array.from(e)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){this.submitHasBeenAttempted=!0,this.emit("submit",{name:"submit",results:this._makeSubmitResults(),valid:this.valid})}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const s=this.activeForm.allFieldInputs.find(t=>t.template.elementId===e);return void 0!==s?(t.set(e,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const e of this.visibleInputs){if(V(e)){const t=e.inputs.find(e=>j(e)&&!e.valid);if(t)return{input:t,groupInput:e}}if(j(e)&&!e.valid)return{input:e}}}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._reactiveGraphicLookup.get(e);if(!t)throw new i("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}notifyGeometriesChanged(e){const t=[];for(const s of e){const e=this._reactiveGraphicLookup.get(s);e&&(t.push(e),e.geometry=s.geometry)}this._expressionsManager.runGeometryDependentExpressions(t)}async setFieldInputValue(e,t){const s=new Set(this.invalidFeatures);await e.setValueFromUser(t),this.userHasChangedValues=!0,this._trackValidityChange(s),this.emit("value-change",{features:e.features.toArray().map(e=>e.source),fieldName:e.fieldName,name:"value-change",value:t})}async setValue(e,t){const s=this.findFieldInput(e);if(null==s)throw new i("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);await this.setFieldInputValue(s,t)}userChangesHaveMadeFeatureInvalid(e){return!!this._reactiveGraphicLookup.get(e)?.userChangesHaveMadeInvalid}async _trackValidityChange(e){await f(()=>!1===this.calculating);const t=this.invalidFeatures;for(const s of t)!1===e.has(s)&&this._reactiveGraphicLookup.has(s)&&(this._reactiveGraphicLookup.get(s).userChangesHaveMadeInvalid=!0)}validate(){return!1}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?T(t,new s([e]),this._expressionsManager):this._emptyForm}_makeSubmitResults(){const e=new Map;for(const[t,s]of this._reactiveGraphicLookup)e.set(t,{feature:t,values:{...s.attributes},invalidFields:[]});for(const t of this.sharedForm.allFieldInputs)for(const s of t.invalidFeatures)e.get(s)?.invalidFields.push(t.fieldName);return Array.from(e.values())}_prepare(){this._hasAsyncArcadeExpressions=!1,this._prepareTask=n(this._prepareTask),this._updateWorkingFeatures(),p(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new E({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??F.WebMercator,map:this.map,timeZone:this._effectiveTimeZone}});const{layers:e}=this;if(0===e.length)return;const s=t(async t=>{try{l(t);const s=new Map;for(const i of e){const e=await L(i);if(l(t),e){const t=e.fieldGroups.flatMap(e=>e.fields);this._layerContingentValuesMap.set(i,new Set(t))}else this._layerContingentValuesMap.set(i,new Set);const r=U(this.layerInfos,i),a=await B(i,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this._effectiveTimeZone},r?.formTemplate);l(t),this._layerTemplateMap.set(i,a);const o=a.getExpressionExecutorsForLayer(i);if(this._expressionsManager.layerExpressionsModelMap.set(i,new k({preserveFieldValuesWhenHidden:a.preserveFieldValuesWhenHidden,executorMap:o})),!this._hasAsyncArcadeExpressions)for(const t of o.keys()){const e=o.get(t);if(this._hasAsyncArcadeExpressions=!0===(e.editableExpression?.isAsync||e.requiredExpression?.isAsync||e.valueExpression?.isAsync||e.visibilityExpression?.isAsync),this._hasAsyncArcadeExpressions)break}for(const t of a.elements){if(G(t))continue;const e=t.clone();R(e)&&(e.elements=e.elements.filter(e=>!G(e)));const{elementId:i}=e;s.has(i)?s.get(i).foldIn(e):s.set(i,e)}}if(this.hasTooManyComplexFeatures)throw new i("too-many-features-with-complex-forms","There are too many features to load into the form with the configured complexity");if(this.hasTooManyFeatures)throw new i("too-many-features","There are too many features to load into the form.");const r=new H({elements:Array.from(s.values())});this.sharedFormTemplate=r,this.sharedForm=T(r,this._workingFeatures,this._expressionsManager),await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray())}catch(s){throw u(s)||a.getLogger(this).error("Failed preparing form",s),s}});this._updatingHandles.consumePromise(s.promise),this._prepareTask=s}_updateWorkingFeatures(){this._workingFeatures.destroyAll();const{features:e}=this;if(this._reactiveGraphicLookup=new h,0!==e.length){this._workingFeatures.addMany(e.map(w));for(const e of this._workingFeatures)this._reactiveGraphicLookup.set(e.source,e)}}async _syncAttachments(){const{activeFeature:e,activeLayer:t,activeForm:s}=this;if(!(e&&s&&I(t)&&b(t)))return;const i=e.getObjectId();if(null==i)return;const r=this._attachmentCache.get(t);if(r){if(r.get(i))return}const a=[];if(!a.length)return;const n=await A(t,i,a);o(this._attachmentCache,t,()=>new h).set(i,n)}};e([y()],Z.prototype,"_effectiveTimeZone",null),e([y()],Z.prototype,"_attachmentCache",void 0),e([y({readOnly:!0})],Z.prototype,"activeFeature",null),e([y()],Z.prototype,"activeFeatureIndex",void 0),e([y({readOnly:!0})],Z.prototype,"activeForm",null),e([y({readOnly:!0})],Z.prototype,"activeLayer",null),e([y()],Z.prototype,"disabled",void 0),e([y()],Z.prototype,"calculating",null),e([y()],Z.prototype,"editType",void 0),e([y()],Z.prototype,"features",void 0),e([y()],Z.prototype,"expressionEvaluationFailed",null),e([y()],Z.prototype,"hasNonActiveInvalidFeatures",null),e([y()],Z.prototype,"hasAsyncArcadeExpressions",null),e([y()],Z.prototype,"_hasAsyncArcadeExpressions",void 0),e([y()],Z.prototype,"invalidFeatures",null),e([y()],Z.prototype,"hasVisibleInputs",null),e([y()],Z.prototype,"hasLayersWithContingentValues",null),e([y()],Z.prototype,"maximumFeatureCount",void 0),e([y()],Z.prototype,"maximumFeatureCountWithComplexForms",void 0),e([y()],Z.prototype,"visibleInputs",null),e([y()],Z.prototype,"map",void 0),e([y()],Z.prototype,"noVisibleElementsReason",null),e([y()],Z.prototype,"readOnly",void 0),e([y()],Z.prototype,"spatialReference",void 0),e([y()],Z.prototype,"submitHasBeenAttempted",void 0),e([y()],Z.prototype,"timeZone",void 0),e([y()],Z.prototype,"updating",null),e([y()],Z.prototype,"valid",null),e([y()],Z.prototype,"layers",null),e([y()],Z.prototype,"mode",null),e([y()],Z.prototype,"sharedForm",void 0),e([y()],Z.prototype,"sharedFormTemplate",void 0),e([y()],Z.prototype,"userHasChangedValues",void 0),e([y()],Z.prototype,"layerInfos",void 0),e([y()],Z.prototype,"_arcadeExecutorProvider",void 0),e([y()],Z.prototype,"_prepareTask",void 0),e([y()],Z.prototype,"_reactiveGraphicLookup",void 0),e([y()],Z.prototype,"_layerTemplateMap",void 0),e([y()],Z.prototype,"_layerContingentValuesMap",void 0),e([y()],Z.prototype,"_workingFeatures",void 0),e([y()],Z.prototype,"_expressionsManager",void 0),Z=e([v("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],Z);const S=Z;export{S as default};
2
+ import{__decorate as e}from"tslib";import{createTask as t}from"../../core/asyncUtils.js";import s from"../../core/Collection.js";import i from"../../core/Error.js";import{EventedAccessor as r}from"../../core/Evented.js";import a from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{abortMaybe as n,destroyMaybe as p}from"../../core/maybe.js";import{throwIfAborted as l,isAbortError as u}from"../../core/promiseUtils.js";import h from"../../core/ReactiveMap.js";import{on as m,sync as c,watch as d,whenOnce as f}from"../../core/reactiveUtils.js";import{property as y,subclass as v}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as g}from"../../core/support/UpdatingHandles.js";import F from"../../geometry/SpatialReference.js";import{getGraphicLayer as _}from"../../graphic/graphicOriginUtils.js";import{system as x}from"../../time/constants.js";import{createReactiveGraphic as w,isAttributeFormSupportedLayerWithAttachments as I,layerSupportsQueryAttachments as b,queryAttachmentsForElements as A}from"./batchAttributeFormUtils.js";import{ArcadeExecutorProvider as M}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as E}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as k}from"./expressions/ExpressionsModel.js";import C from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as T}from"./inputs/support/createBatchFormInputs.js";import{isGroupInput as V,isFieldInput as j}from"./inputs/support/inputUtils.js";import H from"./templates/BatchFormTemplate.js";import{getLayerContingentValuesMetaData as L}from"./templates/support/contingentValuesUtils.js";import{createBatchFormTemplate as B}from"./templates/support/createBatchFormTemplate.js";import{isExcludedFromSharedForm as G,isGroupElementTemplate as R,isAttachmentElementTemplate as U}from"./templates/support/templateUtils.js";function Z(e,t){return e?.find(e=>e.layer===t)}let S=class extends r{constructor(e){super(e),this._attachmentCache=new h,this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new s,this._hasAsyncArcadeExpressions=!1,this.maximumFeatureCount=2e3,this.maximumFeatureCountWithComplexForms=50,this.map=null,this.readOnly=!1,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this.layerInfos=null,this._arcadeExecutorProvider=new M,this._activeFormInputsByElementId=new Map,this._emptyForm=new C({inputs:[]}),this._emptyFormTemplate=new H({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new h,this._updatingHandles=new g,this._layerTemplateMap=new h,this._layerContingentValuesMap=new h,this._workingFeatures=new s,this._expressionsManager=new E({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:x}}),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.addHandles([m(()=>this.features,"after-changes",()=>{this.notifyChange("layers"),this._prepare()},c),d(()=>[this.features,this.map,this.timeZone,this.editType],()=>this._prepare(),c),d(()=>this.activeForm,()=>this._activeFormInputsByElementId.clear(),c),d(()=>[this.activeFeature,this.activeLayer,this.activeForm],()=>{this._syncAttachments()},c)]),this._prepare()}destroy(){this._prepareTask=n(this._prepareTask),this._workingFeatures.destroyAll(),p(this._expressionsManager),this._updatingHandles.destroy(),this._reactiveGraphicLookup=new h,this._emptyForm.destroy(),this._emptyFormTemplate.destroy()}get _effectiveTimeZone(){return this.timeZone??"system"}get activeFeature(){const e=this.activeFeatureIndex;return e<0?null:this.features.at(e)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const e=this._workingFeatures.at(this.activeFeatureIndex);if(!e)return this._emptyForm;const t=this._featureFormMap.get(e);if(t)return t;const s=this._makeBatchFormInputsForFeature(e);return s!==this._emptyForm&&this._featureFormMap.set(e,s),s}get activeLayer(){const{activeFeature:e}=this;if(!e)return null;return _(e)??null}get calculating(){return this._expressionsManager.calculating}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:e}=this;return this.invalidFeatures.some(t=>t!==e)}get hasAsyncArcadeExpressions(){return this._hasAsyncArcadeExpressions}get hasTooManyFeatures(){return this._workingFeatures.length>this.maximumFeatureCount}get hasTooManyComplexFeatures(){return this._workingFeatures.length>this.maximumFeatureCountWithComplexForms&&this.hasAsyncArcadeExpressions}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.visibleInputs.length>0}get hasLayersWithContingentValues(){for(const e of this.layers){const t=this._layerContingentValuesMap.get(e);if(t&&t.size>0)return!0}return!1}get visibleInputs(){return this.activeForm.inputs.filter(e=>e.visible)}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return"noElements";const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case"hidden:not-in-all-layers":case"hidden:no-domain-in-common":e.add("noElementsInCommon");break;case"hidden:field-definition":case"hidden:group-visibility-expression:all-features":case"hidden:visibility-expression:all-features":e.add("allElementsHidden");break;case"hidden:group-visibility-expression:some-features":case"hidden:visibility-expression:some-features":return"elementsHiddenInSome"}return e.has("allElementsHidden")?"allElementsHidden":"noElementsInCommon"}get status(){const e=this._prepareTask;return null==e?"not-loaded":e.finished?null!=e.error?"failed":"loaded":"loading"}get submittable(){return this.valid,!0}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid}get layers(){const e=new Set;return this.features.forEach(t=>{const s=_(t);s&&e.add(s)}),Array.from(e)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){this.submitHasBeenAttempted=!0,this.emit("submit",{name:"submit",results:this._makeSubmitResults(),valid:this.valid})}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const s=this.activeForm.allFieldInputs.find(t=>t.template.elementId===e);return void 0!==s?(t.set(e,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const e of this.visibleInputs){if(V(e)){const t=e.inputs.find(e=>j(e)&&!e.valid);if(t)return{input:t,groupInput:e}}if(j(e)&&!e.valid)return{input:e}}}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._reactiveGraphicLookup.get(e);if(!t)throw new i("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}notifyGeometriesChanged(e){const t=[];for(const s of e){const e=this._reactiveGraphicLookup.get(s);e&&(t.push(e),e.geometry=s.geometry)}this._expressionsManager.runGeometryDependentExpressions(t)}async setFieldInputValue(e,t){const s=new Set(this.invalidFeatures);await e.setValueFromUser(t),this.userHasChangedValues=!0,this._trackValidityChange(s),this.emit("value-change",{features:e.features.toArray().map(e=>e.source),fieldName:e.fieldName,name:"value-change",value:t})}async setValue(e,t){const s=this.findFieldInput(e);if(null==s)throw new i("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);await this.setFieldInputValue(s,t)}userChangesHaveMadeFeatureInvalid(e){return!!this._reactiveGraphicLookup.get(e)?.userChangesHaveMadeInvalid}async _trackValidityChange(e){await f(()=>!1===this.calculating);const t=this.invalidFeatures;for(const s of t)!1===e.has(s)&&this._reactiveGraphicLookup.has(s)&&(this._reactiveGraphicLookup.get(s).userChangesHaveMadeInvalid=!0)}validate(){return!1}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?T(t,new s([e]),this._expressionsManager):this._emptyForm}_makeSubmitResults(){const e=new Map;for(const[t,s]of this._reactiveGraphicLookup)e.set(t,{feature:t,values:{...s.attributes},invalidFields:[]});for(const t of this.sharedForm.allFieldInputs)for(const s of t.invalidFeatures)e.get(s)?.invalidFields.push(t.fieldName);return Array.from(e.values())}_prepare(){this._hasAsyncArcadeExpressions=!1,this._prepareTask=n(this._prepareTask),this._updateWorkingFeatures(),p(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new E({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??F.WebMercator,map:this.map,timeZone:this._effectiveTimeZone}});const{layers:e}=this;if(0===e.length)return;const s=t(async t=>{try{l(t);const s=new Map;for(const i of e){const e=await L(i);if(l(t),e){const t=e.fieldGroups.flatMap(e=>e.fields);this._layerContingentValuesMap.set(i,new Set(t))}else this._layerContingentValuesMap.set(i,new Set);const r=Z(this.layerInfos,i),a=await B(i,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this._effectiveTimeZone},r?.formTemplate);l(t),this._layerTemplateMap.set(i,a);const o=a.getExpressionExecutorsForLayer(i);if(this._expressionsManager.layerExpressionsModelMap.set(i,new k({preserveFieldValuesWhenHidden:a.preserveFieldValuesWhenHidden,executorMap:o})),!this._hasAsyncArcadeExpressions)for(const t of o.keys()){const e=o.get(t);if(this._hasAsyncArcadeExpressions=!0===(e.editableExpression?.isAsync||e.requiredExpression?.isAsync||e.valueExpression?.isAsync||e.visibilityExpression?.isAsync),this._hasAsyncArcadeExpressions)break}for(const t of a.elements){if(G(t))continue;const e=t.clone();R(e)&&(e.elements=e.elements.filter(e=>!G(e)));const{elementId:i}=e;s.has(i)?s.get(i).foldIn(e):s.set(i,e)}}if(this.hasTooManyComplexFeatures)throw new i("too-many-features-with-complex-forms","There are too many features to load into the form with the configured complexity");if(this.hasTooManyFeatures)throw new i("too-many-features","There are too many features to load into the form.");const r=new H({elements:Array.from(s.values())});this.sharedFormTemplate=r,this.sharedForm=T(r,this._workingFeatures,this._expressionsManager),await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray())}catch(s){throw u(s)||a.getLogger(this).error("Failed preparing form",s),s}});this._updatingHandles.consumePromise(s.promise),this._prepareTask=s}_updateWorkingFeatures(){this._workingFeatures.destroyAll();const{features:e}=this;if(this._reactiveGraphicLookup=new h,0!==e.length){this._workingFeatures.addMany(e.map(w));for(const e of this._workingFeatures)this._reactiveGraphicLookup.set(e.source,e)}}async _syncAttachments(){const{activeFeature:e,activeLayer:t,activeForm:s}=this;if(!(e&&s&&I(t)&&b(t)))return;const i=e.getObjectId();if(null==i)return;const r=this._attachmentCache.get(t);if(r){if(r.get(i))return}const a=s.template?.elements.filter(U)??[];if(!a.length)return;const n=await A(t,i,a);o(this._attachmentCache,t,()=>new h).set(i,n)}};e([y()],S.prototype,"_effectiveTimeZone",null),e([y()],S.prototype,"_attachmentCache",void 0),e([y({readOnly:!0})],S.prototype,"activeFeature",null),e([y()],S.prototype,"activeFeatureIndex",void 0),e([y({readOnly:!0})],S.prototype,"activeForm",null),e([y({readOnly:!0})],S.prototype,"activeLayer",null),e([y()],S.prototype,"disabled",void 0),e([y()],S.prototype,"calculating",null),e([y()],S.prototype,"editType",void 0),e([y()],S.prototype,"features",void 0),e([y()],S.prototype,"expressionEvaluationFailed",null),e([y()],S.prototype,"hasNonActiveInvalidFeatures",null),e([y()],S.prototype,"hasAsyncArcadeExpressions",null),e([y()],S.prototype,"_hasAsyncArcadeExpressions",void 0),e([y()],S.prototype,"invalidFeatures",null),e([y()],S.prototype,"hasVisibleInputs",null),e([y()],S.prototype,"hasLayersWithContingentValues",null),e([y()],S.prototype,"maximumFeatureCount",void 0),e([y()],S.prototype,"maximumFeatureCountWithComplexForms",void 0),e([y()],S.prototype,"visibleInputs",null),e([y()],S.prototype,"map",void 0),e([y()],S.prototype,"noVisibleElementsReason",null),e([y()],S.prototype,"readOnly",void 0),e([y()],S.prototype,"spatialReference",void 0),e([y()],S.prototype,"submitHasBeenAttempted",void 0),e([y()],S.prototype,"timeZone",void 0),e([y()],S.prototype,"updating",null),e([y()],S.prototype,"valid",null),e([y()],S.prototype,"layers",null),e([y()],S.prototype,"mode",null),e([y()],S.prototype,"sharedForm",void 0),e([y()],S.prototype,"sharedFormTemplate",void 0),e([y()],S.prototype,"userHasChangedValues",void 0),e([y()],S.prototype,"layerInfos",void 0),e([y()],S.prototype,"_arcadeExecutorProvider",void 0),e([y()],S.prototype,"_prepareTask",void 0),e([y()],S.prototype,"_reactiveGraphicLookup",void 0),e([y()],S.prototype,"_layerTemplateMap",void 0),e([y()],S.prototype,"_layerContingentValuesMap",void 0),e([y()],S.prototype,"_workingFeatures",void 0),e([y()],S.prototype,"_expressionsManager",void 0),S=e([v("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],S);const W=S;export{W as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../core/Error.js";import t from"../BatchFormInputs.js";import r from"../FieldInput.js";import s from"../GroupInput.js";import n from"../TextElementInput.js";import{isFieldElementTemplate as p,isGroupElementTemplate as o,isTextElementTemplate as m}from"../../templates/support/templateUtils.js";function a(e,r,s){const n=e.elements.map(e=>l(e,r,s));return new t({inputs:n,template:e})}function l(t,a,i){const u=new Set(t.layers),f=a.filter(e=>u.has(e.layer)),c=f.length===a.length;if(p(t))return new r({existsInAllLayers:c,features:f,template:t,expressionsManager:i});if(o(t)){const e=t.elements.map(e=>l(e,a,i));return new s({existsInAllLayers:c,features:f,inputs:e,template:t,expressionsManager:i})}if(m(t))return new n({existsInAllLayers:c,features:f,template:t,expressionsManager:i});throw new e("batch-attribute-form:unsupported-element-template","The type of form element template provided is not supported")}export{a as createBatchFormInputsFromBatchFormTemplate};
2
+ import e from"../../../../core/Error.js";import t from"../BatchFormInputs.js";import r from"../FieldInput.js";import s from"../GroupInput.js";import n from"../TextElementInput.js";import{isAttachmentElementTemplate as p,isFieldElementTemplate as o,isGroupElementTemplate as m,isTextElementTemplate as a}from"../../templates/support/templateUtils.js";function l(e,r,s){const n=e.elements.filter(e=>!p(e)).map(e=>i(e,r,s));return new t({inputs:n,template:e})}function i(t,p,l){const u=new Set(t.layers),f=p.filter(e=>u.has(e.layer)),c=f.length===p.length;if(o(t))return new r({existsInAllLayers:c,features:f,template:t,expressionsManager:l});if(m(t)){const e=t.elements.map(e=>i(e,p,l));return new s({existsInAllLayers:c,features:f,inputs:e,template:t,expressionsManager:l})}if(a(t))return new n({existsInAllLayers:c,features:f,template:t,expressionsManager:l});throw new e("batch-attribute-form:unsupported-element-template","The type of form element template provided is not supported")}export{l as createBatchFormInputsFromBatchFormTemplate};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../core/Error.js";import t from"../../../../core/Logger.js";import{getEffectiveFieldAlias as r}from"../../../../editing/fieldUtils.js";import n from"../../../../form/ExpressionInfo.js";import{isFieldElement as o,isGroupElement as i,isTextElement as s}from"../../../../form/support/formUtils.js";import{getLowerCaseEditTrackingFields as a,isFieldVisibleByDefault as l}from"../../../../layers/support/fieldUtils.js";import{isSubtypeSublayer as m,isSubtypeGroupLayer as d}from"../../../../layers/support/layerUtils.js";import{unknown as p}from"../../../../time/constants.js";import{makeExpressionInfosMap as f,makeExecutorSetForFormElement as c}from"../../expressions/expressionUtils.js";import u from"../BatchFormTemplate.js";import{FieldElementTemplate as x}from"../FieldElementTemplate.js";import{GroupElementTemplate as w}from"../GroupElementTemplate.js";import{TextElementTemplate as y}from"../TextElementTemplate.js";import{compileTextElementMarkdownToHTML as b}from"./textElementTemplateUtils.js";const E="expression/dea57012-47ca4b55a000-8df62742ed0c",T=()=>t.getLogger("esri.widgets.BatchAttributeForm.templates.templateUtils");async function h(e,t,r=e.formTemplate){return r?.elements&&r.elements.length>0?I(r,e,t):v(e,t)}async function v(e,{arcadeExecutorProvider:t,formTimeZone:r}){const n=new Set(a(e)),o={arcadeExecutorProvider:t,formTimeZone:r,layer:e},i=[];for(const a of e.fields)U(a,e,n)&&i.push(P(a,o));const s=await Promise.all(i);return new u({elements:s,preserveFieldValuesWhenHidden:!0})}function g(e,t){for(const r of e??[])if("group"!==r.type){if("field"===r.type){if(!1===r.editable&&!r.editableExpression)return!0;if(t.subtypeField&&(m(t)||d(t))&&r.fieldName?.toLowerCase()===t.subtypeField.toLowerCase())return!0}}else if(g(r.elements??[],t))return!0;return!1}async function I(e,t,r){let o=null;g(e.elements??[],t)&&(o=new n({title:"",name:E,expression:"false"}));const i=f(o?[...e.expressionInfos??[],o]:e.expressionInfos),s={description:e.description,elements:new Array,title:e.title,preserveFieldValuesWhenHidden:e.preserveFieldValuesWhenHidden,supportsAttachmentElements:e.supportsAttachmentElements},{elements:a}=e;if(!a)return new u(s);const{arcadeExecutorProvider:l,formTimeZone:m}=r;for(const n of a){const e=await F(n,{arcadeExecutorProvider:l,expressionInfos:i,layer:t,formTimeZone:m});e&&s.elements.push(e)}return e.supportsAttachmentElements,new u(s)}async function F(t,r){return o(t)?j(t,r):i(t)?L(t,r):s(t)?Z(t,r):(T().warn(new e("batch-attribute-form:unsupported-element-type",`Form elements of type ${t.type} are not supported`)),null)}async function j(t,{arcadeExecutorProvider:r,expressionInfos:n,layer:o,formTimeZone:i}){const{fieldsIndex:s}=o,{description:a,domain:l,fieldName:p,hint:f,input:u,label:w}=t;if(null==p||!s.has(p))return T().warn(new e("batch-attribute-form:invalid-form-element-field",`Field element with label '${w}' does not refer to a valid field`)),null;!1!==t.editable||t.editableExpression||((t=t.clone()).editableExpression=E),o.subtypeField&&(m(o)||d(o))&&t.fieldName?.toLowerCase()===o.subtypeField.toLowerCase()&&((t=t.clone()).editableExpression=E);const y=new x({description:a,domain:l,field:s.get(p),hint:f,input:u,formTimeZone:i,layerTimeZone:A(o),label:w}),b=await c({element:t,expressionInfos:n,provider:r});return y.addLayer(o,b),y}async function L(e,t){const{arcadeExecutorProvider:r,expressionInfos:n,layer:o}=t,{description:i,label:s,initialState:a}=e,l=[];for(const p of e.elements){const e=await F(p,t);e&&l.push(e)}const m=new w({description:i,elements:l,label:s,initialState:a??"expanded"}),d=await c({element:e,expressionInfos:n,provider:r});return m.addLayer(o,d),m}async function Z(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:n}){const{description:o,label:i,text:s,textFormat:a}=e,{fieldsIndex:l}=n,m=s&&"markdown"===a?await b(s):s,d=new y({compiledText:m,description:o,fieldsIndex:l,label:i}),p=await c({element:e,expressionInfos:r,provider:t}),{expressionParts:f}=d;if(f.length){const e=await Promise.all(f.map(e=>{const n=r.get(e)?.expression??e;return t.getArcadeExecutor(n)}));p.textExpressions=e}return d.addLayer(n,p),d}async function P(e,{arcadeExecutorProvider:t,layer:n,formTimeZone:o}){const i=r(e,n)||e.name,s=new x({field:e,label:i,formTimeZone:o,layerTimeZone:A(n)}),a={},l=(d(n)||m(n))&&n.subtypeField&&n.subtypeField.toLowerCase()===e.name.toLowerCase();return!l&&e.editable&&n.userHasUpdateItemPrivileges&&(a.editableExpression=await t.getArcadeExecutor("true")),l&&(a.editableExpression=await t.getArcadeExecutor("false")),s.addLayer(n,a),s}function U(e,t,r){return!r.has(e.name.toLowerCase())&&l(e,t)}function A(e){return m(e)&&e.parent&&(e=e.parent),e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone?p:e&&"preferredTimeZone"in e&&e.preferredTimeZone?e.preferredTimeZone:null}export{h as createBatchFormTemplate,v as createBatchFormTemplateFromFields};
2
+ import e from"../../../../core/Error.js";import t from"../../../../core/Logger.js";import{getEffectiveFieldAlias as r}from"../../../../editing/fieldUtils.js";import n from"../../../../form/ExpressionInfo.js";import{isAttachmentElement as o,isFieldElement as i,isGroupElement as s,isTextElement as a}from"../../../../form/support/formUtils.js";import{getLowerCaseEditTrackingFields as l,isFieldVisibleByDefault as m}from"../../../../layers/support/fieldUtils.js";import{isSubtypeSublayer as d,isSubtypeGroupLayer as p}from"../../../../layers/support/layerUtils.js";import{unknown as c}from"../../../../time/constants.js";import{makeExpressionInfosMap as f,makeExecutorSetForFormElement as u}from"../../expressions/expressionUtils.js";import{AttachmentElementTemplate as x}from"../AttachmentElementTemplate.js";import y from"../BatchFormTemplate.js";import{FieldElementTemplate as w}from"../FieldElementTemplate.js";import{GroupElementTemplate as b}from"../GroupElementTemplate.js";import{TextElementTemplate as E}from"../TextElementTemplate.js";import{compileTextElementMarkdownToHTML as h}from"./textElementTemplateUtils.js";const T="expression/dea57012-47ca4b55a000-8df62742ed0c",v=()=>t.getLogger("esri.widgets.BatchAttributeForm.templates.templateUtils");async function I(e,t,r=e.formTemplate){return r?.elements&&r.elements.length>0?j(r,e,t):F(e,t)}async function F(e,{arcadeExecutorProvider:t,formTimeZone:r}){const n=new Set(l(e)),o={arcadeExecutorProvider:t,formTimeZone:r,layer:e},i=[];for(const a of e.fields)H(a,e,n)&&i.push(C(a,o));const s=await Promise.all(i);return new y({elements:s,preserveFieldValuesWhenHidden:!0})}function g(e,t){for(const r of e??[])if("group"!==r.type){if("field"===r.type){if(!1===r.editable&&!r.editableExpression)return!0;if(t.subtypeField&&(d(t)||p(t))&&r.fieldName?.toLowerCase()===t.subtypeField.toLowerCase())return!0}}else if(g(r.elements??[],t))return!0;return!1}async function j(e,t,r){let o=null;g(e.elements??[],t)&&(o=new n({title:"",name:T,expression:"false"}));const i=f(o?[...e.expressionInfos??[],o]:e.expressionInfos),s={description:e.description,elements:new Array,title:e.title,preserveFieldValuesWhenHidden:e.preserveFieldValuesWhenHidden,supportsAttachmentElements:e.supportsAttachmentElements},{elements:a}=e;if(!a)return new y(s);const{arcadeExecutorProvider:l,formTimeZone:m}=r;for(const n of a){const e=await L(n,{arcadeExecutorProvider:l,expressionInfos:i,layer:t,formTimeZone:m});e&&s.elements.push(e)}return e.supportsAttachmentElements,new y(s)}async function P(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:n}){const o=new x({allowUserRename:e.allowUserRename,attachmentKeyword:e.attachmentKeyword,description:e.description,displayFilename:e.displayFilename,input:e.input,label:e.label,maxAttachmentCount:e.maxAttachmentCount,minAttachmentCount:e.minAttachmentCount,useOriginalFilename:e.useOriginalFilename}),i=await u({element:e,expressionInfos:r,provider:t});return o.addLayer(n,i),o}async function L(t,r){return o(t)?P(t,{arcadeExecutorProvider:r.arcadeExecutorProvider,expressionInfos:r.expressionInfos,layer:r.layer}):i(t)?A(t,r):s(t)?Z(t,r):a(t)?U(t,r):(v().warn(new e("batch-attribute-form:unsupported-element-type",`Form elements of type ${t.type} are not supported`)),null)}async function A(t,{arcadeExecutorProvider:r,expressionInfos:n,layer:o,formTimeZone:i}){const{fieldsIndex:s}=o,{description:a,domain:l,fieldName:m,hint:c,input:f,label:x}=t;if(null==m||!s.has(m))return v().warn(new e("batch-attribute-form:invalid-form-element-field",`Field element with label '${x}' does not refer to a valid field`)),null;!1!==t.editable||t.editableExpression||((t=t.clone()).editableExpression=T),o.subtypeField&&(d(o)||p(o))&&t.fieldName?.toLowerCase()===o.subtypeField.toLowerCase()&&((t=t.clone()).editableExpression=T);const y=new w({description:a,domain:l,field:s.get(m),hint:c,input:f,formTimeZone:i,layerTimeZone:k(o),label:x}),b=await u({element:t,expressionInfos:n,provider:r});return y.addLayer(o,b),y}async function Z(e,t){const{arcadeExecutorProvider:r,expressionInfos:n,layer:o}=t,{description:i,label:s,initialState:a}=e,l=[];for(const p of e.elements){const e=await L(p,t);e&&l.push(e)}const m=new b({description:i,elements:l,label:s,initialState:a??"expanded"}),d=await u({element:e,expressionInfos:n,provider:r});return m.addLayer(o,d),m}async function U(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:n}){const{description:o,label:i,text:s,textFormat:a}=e,{fieldsIndex:l}=n,m=s&&"markdown"===a?await h(s):s,d=new E({compiledText:m,description:o,fieldsIndex:l,label:i}),p=await u({element:e,expressionInfos:r,provider:t}),{expressionParts:c}=d;if(c.length){const e=await Promise.all(c.map(e=>{const n=r.get(e)?.expression??e;return t.getArcadeExecutor(n)}));p.textExpressions=e}return d.addLayer(n,p),d}async function C(e,{arcadeExecutorProvider:t,layer:n,formTimeZone:o}){const i=r(e,n)||e.name,s=new w({field:e,label:i,formTimeZone:o,layerTimeZone:k(n)}),a={},l=(p(n)||d(n))&&n.subtypeField&&n.subtypeField.toLowerCase()===e.name.toLowerCase();return!l&&e.editable&&n.userHasUpdateItemPrivileges&&(a.editableExpression=await t.getArcadeExecutor("true")),l&&(a.editableExpression=await t.getArcadeExecutor("false")),s.addLayer(n,a),s}function H(e,t,r){return!r.has(e.name.toLowerCase())&&m(e,t)}function k(e){return d(e)&&e.parent&&(e=e.parent),e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone?c:e&&"preferredTimeZone"in e&&e.preferredTimeZone?e.preferredTimeZone:null}export{I as createBatchFormTemplate,F as createBatchFormTemplateFromFields};
@@ -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)}getUpdating(){return!!this._sketchViewModel?.updating}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};
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{updateGraphicSymbolWhenRequired as A}from"../../views/draw/support/editingSessionUtils.js";import{getDrawHelpMessage as P}from"../../views/draw/support/helpMessageUtils.js";import E from"../../views/draw/support/HighlightHelper.js";import U from"../../views/interactive/sketch/SketchOptions.js";import H from"../../views/interactive/snapping/FeatureSnappingLayerSource.js";import{temporaryHighlightName as L}from"../../views/support/HighlightDefaults.js";import O from"./CreateFeaturesWorkflowData.js";import{isModelUpload as j,handleModelUpload as x}from"./modelUploadUtils.js";import D from"./Workflow.js";import{activeSketchToolDrawsUnsupportedCurve as z,createToolFromGeometryType as R,containsUnsupportedCurve as W,findEditorItemForLayer as G,getServiceEditsFromWorkflowData as N,getServiceInfoForLayer as K,orderEditsByRelationshipDependencies as Z,getServiceLayersById as q,startCreatingNewFeature as B,syncUpdateOptions as J,findLayerInfo 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 D{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&&!j(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 P("rectangle"===l||"circle"===l?l:s,o?.geometry,n)}get noticeMessage(){if(z(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}=R(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)}getUpdating(){return!!this._sketchViewModel?.updating}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&&W(r.toArray(),s)){if(!await e("curveEditingDensifyPrompt"))return this.reset()}return super.save()}back(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||j(this.data.creationInfo)||this._attachmentsActive||this.parent?super.back(e):this._clearSelectedFeature()}previous(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||j(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 U,u=s?.layer,p=u?G(d.editorItems,u):void 0,h=new ce({data:new O({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=N(h.data),p=F(c)&&u;if(n){if(_e(s),p){let t=be(u,l);const a=await(K(o,d.view)?.load());a&&(t=Z({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:q(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 B(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;J(l,d),n(this._featureFormHandle);const g=e.sourceLayer,w=Q(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 A(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 A(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&&(j(t)?e.addHandles(await x({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=>A(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 A(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)}),!j(t.creationInfo))return e._startCreating()},v=async()=>{if(j(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,J(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=Q(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??=Q(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=G(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?(j(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(()=>{j(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 H({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 E({view:t});a.push(u(()=>e.selectedPendingFeature,(e,t)=>{r.remove(e),r.add(t)}),i(()=>r.destroy()))}const r=new E({view:t,highlightName:L});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};