@arcgis/core 4.33.0-next.20250213 → 4.33.0-next.20250214

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 (241) hide show
  1. package/arcade/arcadeAsyncRuntime.js +1 -1
  2. package/arcade/arcadeCompiler.js +1 -1
  3. package/arcade/arcadeEnvironment.js +1 -1
  4. package/arcade/arcadeRuntime.js +1 -1
  5. package/arcade/featureSetUtils.js +1 -1
  6. package/arcade/featureset/actions/GroupBy.js +1 -1
  7. package/arcade/featureset/actions/OrderBy.js +1 -1
  8. package/arcade/functions/date.js +1 -1
  9. package/arcade/functions/feature.js +1 -1
  10. package/arcade/functions/featuresetbase.js +1 -1
  11. package/arcade/functions/featuresetgeom.js +1 -1
  12. package/arcade/functions/featuresetstats.js +1 -1
  13. package/arcade/functions/featuresetstring.js +1 -1
  14. package/arcade/functions/fieldStats.js +1 -1
  15. package/arcade/functions/geomasync.js +1 -1
  16. package/arcade/functions/geometry.js +1 -1
  17. package/arcade/functions/geomsync.js +1 -1
  18. package/arcade/functions/knowledgegraph.js +1 -1
  19. package/arcade/functions/maths.js +1 -1
  20. package/arcade/functions/string.js +1 -1
  21. package/arcade/geometry/functions.js +1 -1
  22. package/arcade/languageUtils.js +1 -1
  23. package/arcade.js +1 -1
  24. package/assets/esri/core/workers/RemoteClient.js +1 -1
  25. package/assets/esri/core/workers/chunks/{89960be0e525d42ccffe.js → 01f8f52a3f9e6fb72f64.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{8191dd3d7451b2e7b95e.js → 041eebac192855fbf919.js} +1 -1
  27. package/assets/esri/core/workers/chunks/09cbf45dc7b026957d3e.js +1 -0
  28. package/assets/esri/core/workers/chunks/{1a286d43daa3b811c30d.js → 1661ac4e1b6c6af6ee0f.js} +1 -1
  29. package/assets/esri/core/workers/chunks/197dc75a1c10c0fbf65a.js +1 -0
  30. package/assets/esri/core/workers/chunks/238bcf6514a1f214cc8a.js +1 -0
  31. package/assets/esri/core/workers/chunks/{efded84870064c3d8210.js → 23a045fccc005079bd58.js} +1 -1
  32. package/assets/esri/core/workers/chunks/32fee5446ee0b0a6c4bd.js +1 -0
  33. package/assets/esri/core/workers/chunks/{f429d95eb986f3d215f3.js → 391c200274bbeb92404c.js} +1 -1
  34. package/assets/esri/core/workers/chunks/3c44b4bf7fe407ec1d70.js +1 -0
  35. package/assets/esri/core/workers/chunks/3eacb4d1275f2d87825f.js +1 -0
  36. package/assets/esri/core/workers/chunks/{c0af54cc5938176ce764.js → 3fe7be535affae31de7e.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{c061cad8323f0469e7e4.js → 42f21349f488a14198e4.js} +1 -1
  38. package/assets/esri/core/workers/chunks/48eb5cbb4555acc56984.js +1 -0
  39. package/assets/esri/core/workers/chunks/4927b33f7e9daf059765.js +1 -0
  40. package/assets/esri/core/workers/chunks/50bab11c32bf4001edd7.js +1 -0
  41. package/assets/esri/core/workers/chunks/5c9a7b1dedd146cc65d2.js +1 -0
  42. package/assets/esri/core/workers/chunks/5d8120c84e5a164cb1bc.js +1 -0
  43. package/assets/esri/core/workers/chunks/{7a9e1696dc6120df15b0.js → 60ca6a2e9f1e2c969aab.js} +1 -1
  44. package/assets/esri/core/workers/chunks/679cc23be07ededb3992.js +1 -0
  45. package/assets/esri/core/workers/chunks/{9f122278e917c9ce5f95.js → 67c1e2c17ea3ca27248c.js} +1 -1
  46. package/assets/esri/core/workers/chunks/69b55259f90e8e4bc2aa.js +1 -0
  47. package/assets/esri/core/workers/chunks/69e0ff74e44962d97049.js +1 -0
  48. package/assets/esri/core/workers/chunks/6ca4b5d1a076c6079472.js +1 -0
  49. package/assets/esri/core/workers/chunks/{7058001bf66f9f3d5d45.js → 6d02d66234a7b74e5c14.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{77bfd4f819096cb754ae.js → 6e92569a4a82592b95dc.js} +1 -1
  51. package/assets/esri/core/workers/chunks/6f007703662e714b2f0a.js +1 -0
  52. package/assets/esri/core/workers/chunks/744bdf2bb0cc38e6a7b1.js +1 -0
  53. package/assets/esri/core/workers/chunks/7bf9ebff90bb02bec8e7.js +1 -0
  54. package/assets/esri/core/workers/chunks/{8b6580329e1e35ea4190.js → 7c03489438f51a5170f3.js} +1 -1
  55. package/assets/esri/core/workers/chunks/7e77e4288ed205128b87.js +1 -0
  56. package/assets/esri/core/workers/chunks/80c3e933b43ea79b30de.js +1 -0
  57. package/assets/esri/core/workers/chunks/830844f7fb7557d30f34.js +1 -0
  58. package/assets/esri/core/workers/chunks/8a66d06132c8803033c9.js +1 -0
  59. package/assets/esri/core/workers/chunks/{e9993d4f2bfdc434fbcc.js → 8f4bcca8b0525e19374f.js} +1 -1
  60. package/assets/esri/core/workers/chunks/95047f145ebda65c3d8e.js +1 -0
  61. package/assets/esri/core/workers/chunks/9968c6654d048c9add0c.js +1 -0
  62. package/assets/esri/core/workers/chunks/{b50176897ffadc53573e.js → 9bbfa8dc4124b5273d28.js} +1 -1
  63. package/assets/esri/core/workers/chunks/a2b548fbfa2eb5e6f2a7.js +1 -0
  64. package/assets/esri/core/workers/chunks/a37825705e49b60e5d4b.js +1 -0
  65. package/assets/esri/core/workers/chunks/{211c32244e05164dcd38.js → aebbaa7ab7a6b3b1579c.js} +2 -2
  66. package/assets/esri/core/workers/chunks/b90b7ffc1e9363ed18e0.js +1 -0
  67. package/assets/esri/core/workers/chunks/{a39977478a6c57d2e8fb.js → bd2dcc55ac3418421ee5.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{83fe9a8002a4fc96e534.js → bd38717780fffa49d36c.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{c77ade444aa2f3f2b599.js → bdc9dec6a359d2e3705c.js} +1 -1
  70. package/assets/esri/core/workers/chunks/bf127fe767174e2715b5.js +1 -0
  71. package/assets/esri/core/workers/chunks/c3806be4a760735e6082.js +1 -0
  72. package/assets/esri/core/workers/chunks/cb3148cf11a420d6e9ab.js +1 -0
  73. package/assets/esri/core/workers/chunks/{8d8f5f08d730270e1165.js → cb9a27176bd5de2c34ca.js} +1 -1
  74. package/assets/esri/core/workers/chunks/cdf942020b7054628dc9.js +1 -0
  75. package/assets/esri/core/workers/chunks/d6c3df07cfaa6bb639e9.js +1 -0
  76. package/assets/esri/core/workers/chunks/ed89a108b032b982b12f.js +1 -0
  77. package/assets/esri/core/workers/chunks/ee5b82873ff80cb4ba34.js +1 -0
  78. package/assets/esri/core/workers/chunks/{d0656e9d30eb3a66a8db.js → f976233ad5e5b718ba83.js} +1 -1
  79. package/assets/esri/themes/base/widgets/_Directions.scss +30 -9
  80. package/assets/esri/themes/base/widgets/_Editor.scss +1 -0
  81. package/assets/esri/themes/dark/main.css +1 -1
  82. package/assets/esri/themes/light/main.css +1 -1
  83. package/assets/esri/themes/light/view.css +1 -1
  84. package/chunks/arcade.js +1 -1
  85. package/chunks/array.js +1 -1
  86. package/chunks/languageUtils.js +1 -1
  87. package/copyright.txt +26 -19
  88. package/core/colorUtils.js +1 -1
  89. package/core/deprecate.js +1 -1
  90. package/editing/templateUtils.js +1 -1
  91. package/geohash/geohashUtils.js +1 -1
  92. package/interfaces.d.ts +634 -129
  93. package/intl/locale.js +1 -1
  94. package/layers/FeatureLayer.js +1 -1
  95. package/layers/GeoJSONLayer.js +1 -1
  96. package/layers/ImageryTileLayer.js +1 -1
  97. package/layers/OGCFeatureLayer.js +1 -1
  98. package/layers/RouteLayer.js +1 -1
  99. package/layers/SubtypeGroupLayer.js +1 -1
  100. package/layers/WFSLayer.js +1 -1
  101. package/layers/graphics/data/queryUtils.js +1 -1
  102. package/layers/mixins/ArcGISImageService.js +1 -1
  103. package/layers/mixins/ImageryTileMixin.js +1 -1
  104. package/layers/mixins/TrackableLayer.d.ts +4 -0
  105. package/layers/save/imageryUtils.js +1 -1
  106. package/layers/support/ExportImageServiceParameters.js +1 -1
  107. package/layers/support/SubtypeSublayer.js +1 -1
  108. package/layers/support/TitleCreator.js +5 -0
  109. package/layers/support/TrackInfo.d.ts +4 -0
  110. package/layers/support/TrackInfo.js +1 -1
  111. package/layers/support/TrackPartInfo.d.ts +4 -0
  112. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  113. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  114. package/layers/support/rasterDatasets/datasetUtils.js +5 -0
  115. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  116. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  117. package/layers/support/rasterFormats/pixelRangeUtils.js +1 -1
  118. package/layers/support/rasterFunctions/creators/createLocalFunctions.js +1 -1
  119. package/layers/support/rasterFunctions/creators/createStatisticsFunctions.js +1 -1
  120. package/networks/UtilityNetwork.js +1 -1
  121. package/networks/support/networkFieldUtils.js +5 -0
  122. package/package.json +1 -1
  123. package/renderers/support/rasterRendererHelper.js +1 -1
  124. package/rest/query/executeForIds.js +1 -1
  125. package/rest/support/BinParametersBase.js +1 -1
  126. package/support/arcadeUtils.js +1 -1
  127. package/support/revision.js +1 -1
  128. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  129. package/symbols/cim/rasterizingUtils.js +1 -1
  130. package/symbols/support/previewCIMSymbol.js +1 -1
  131. package/symbols/support/previewSymbol2D.js +1 -1
  132. package/symbols/support/symbolUtils.js +1 -1
  133. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  134. package/views/2d/layers/RouteLayerView2D.js +1 -1
  135. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  136. package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
  137. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  138. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  139. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  140. package/views/2d/layers/support/RouteLayerInteraction.js +1 -1
  141. package/views/3d/interactive/editingTools/transform/ScaleRotateMeshAdapter.js +1 -1
  142. package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
  143. package/views/3d/layers/I3SMeshView3D.js +1 -1
  144. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  145. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  146. package/views/3d/layers/i3s/BuildingFilterUtil.js +1 -1
  147. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  148. package/views/3d/layers/i3s/SymbologyInfo.js +5 -0
  149. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  150. package/views/3d/state/utils/navigationUtils.js +1 -1
  151. package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
  152. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  153. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  154. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +14 -14
  155. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  156. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  157. package/views/3d/webgl-engine/core/renderPasses/RenderPassIdentifier.js +5 -0
  158. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  159. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
  160. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  161. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  162. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  163. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  164. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  165. package/views/View.js +1 -1
  166. package/views/draw/DrawAction.js +1 -1
  167. package/views/layers/FeatureLayerView.js +1 -1
  168. package/views/layers/ImageryTileLayerView.js +1 -1
  169. package/views/support/RequiredFieldsOptions.js +5 -0
  170. package/views/webgl/Texture.js +1 -1
  171. package/widgets/BasemapGallery.js +1 -1
  172. package/widgets/BasemapToggle.js +1 -1
  173. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  174. package/widgets/BatchAttributeForm.js +1 -1
  175. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  176. package/widgets/Compass/CompassViewModel.js +1 -1
  177. package/widgets/DirectionalPad.js +1 -1
  178. package/widgets/Directions/DirectionsViewModel.js +1 -1
  179. package/widgets/Directions.js +1 -1
  180. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  181. package/widgets/Editor/EditorViewModel.js +1 -1
  182. package/widgets/Editor.js +1 -1
  183. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  184. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  185. package/widgets/Fullscreen.js +1 -1
  186. package/widgets/Home.js +1 -1
  187. package/widgets/LayerList/LayerListItem.js +1 -1
  188. package/widgets/LayerList/ListItem.js +1 -1
  189. package/widgets/LayerList/support/layerListUtils.js +1 -1
  190. package/widgets/Legend/LegendViewModel.js +1 -1
  191. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  192. package/widgets/Legend.js +1 -1
  193. package/widgets/Locate.js +1 -1
  194. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  195. package/widgets/OrientedImageryViewer/adapters/sketch/DigitizationAdapter.js +1 -1
  196. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  197. package/widgets/OrientedImageryViewer/constants.js +1 -1
  198. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  199. package/widgets/OrientedImageryViewer/symbols.js +1 -1
  200. package/widgets/OrientedImageryViewer.js +1 -1
  201. package/widgets/ScaleBar.js +1 -1
  202. package/widgets/Swipe.js +1 -1
  203. package/widgets/TableList/ListItem.js +1 -1
  204. package/widgets/TableList.js +1 -1
  205. package/widgets/Track.js +1 -1
  206. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  207. package/widgets/UtilityNetworkTrace.js +1 -1
  208. package/widgets/support/GoTo.js +1 -1
  209. package/widgets/support/goToUtils.js +5 -0
  210. package/assets/esri/core/workers/chunks/03f51ea011ffbcfb7c7d.js +0 -1
  211. package/assets/esri/core/workers/chunks/122ed10cac9f192e1eec.js +0 -1
  212. package/assets/esri/core/workers/chunks/1249fd2f83caeaefd8ce.js +0 -1
  213. package/assets/esri/core/workers/chunks/144e534d4ac1aafab60d.js +0 -1
  214. package/assets/esri/core/workers/chunks/15ad8036736a32652c9b.js +0 -1
  215. package/assets/esri/core/workers/chunks/177d4c2c10ef7369006f.js +0 -1
  216. package/assets/esri/core/workers/chunks/1d282700e76285a1684c.js +0 -1
  217. package/assets/esri/core/workers/chunks/282c2d52011b331d4704.js +0 -1
  218. package/assets/esri/core/workers/chunks/35392bf8f21005ad6170.js +0 -1
  219. package/assets/esri/core/workers/chunks/37cfd102b6ab5b959f9d.js +0 -1
  220. package/assets/esri/core/workers/chunks/6a9a1cd8134a903dd05a.js +0 -1
  221. package/assets/esri/core/workers/chunks/73d03c208242778e67bf.js +0 -1
  222. package/assets/esri/core/workers/chunks/7485588bd24217669578.js +0 -1
  223. package/assets/esri/core/workers/chunks/80d3aa3f27ad5b2b969b.js +0 -1
  224. package/assets/esri/core/workers/chunks/8939479cd433cc53f6c1.js +0 -1
  225. package/assets/esri/core/workers/chunks/8a2f3ce46eeac853b3a9.js +0 -1
  226. package/assets/esri/core/workers/chunks/8f31fbb1d549230ee3db.js +0 -1
  227. package/assets/esri/core/workers/chunks/91384398f01485631f70.js +0 -1
  228. package/assets/esri/core/workers/chunks/9421ae38fdf986b9b107.js +0 -1
  229. package/assets/esri/core/workers/chunks/94225d92afbdb10dfedb.js +0 -1
  230. package/assets/esri/core/workers/chunks/99c136b800e5fc7e04f4.js +0 -1
  231. package/assets/esri/core/workers/chunks/9b74635d80d029498da1.js +0 -1
  232. package/assets/esri/core/workers/chunks/a9274c9132e7a2691abb.js +0 -1
  233. package/assets/esri/core/workers/chunks/af917f69d9c6e9937263.js +0 -1
  234. package/assets/esri/core/workers/chunks/ca6180e572e69540c183.js +0 -1
  235. package/assets/esri/core/workers/chunks/cccd215b0a4890551957.js +0 -1
  236. package/assets/esri/core/workers/chunks/d074c916b414432a7b6a.js +0 -1
  237. package/assets/esri/core/workers/chunks/de638753a30c9aa41bad.js +0 -1
  238. package/assets/esri/core/workers/chunks/e6633f0326a44477f630.js +0 -1
  239. package/assets/esri/core/workers/chunks/eb0ce7937813d1be1284.js +0 -1
  240. package/assets/esri/core/workers/chunks/f2cf05fbbb51d657d300.js +0 -1
  241. package/assets/esri/core/workers/chunks/f4ba823c8acd60c7c82d.js +0 -1
package/views/View.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../Map.js";import i from"../core/Accessor.js";import{createTask as r}from"../core/asyncUtils.js";import a from"../core/Collection.js";import s from"../core/CollectionFlattener.js";import o from"../core/Error.js";import n from"../core/Evented.js";import l from"../core/Handles.js";import has from"../core/has.js";import p from"../core/Loadable.js";import d from"../core/Logger.js";import{destroyMaybe as h,abortMaybe as y}from"../core/maybe.js";import u from"../core/Promise.js";import{after as m}from"../core/promiseUtils.js";import{watch as c,whenOnce as g,when as f,sync as w,syncAndInitial as v}from"../core/reactiveUtils.js";import{property as M}from"../core/accessorSupport/decorators/property.js";import"../core/RandomLCG.js";import{subclass as _}from"../core/accessorSupport/decorators/subclass.js";import{owningCollectionProperty as V}from"../core/support/OwningCollection.js";import{UpdatingHandles as R}from"../core/support/UpdatingHandles.js";import S from"../geometry/Extent.js";import T from"../geometry/HeightModelInfo.js";import j from"../geometry/SpatialReference.js";import{equals as E}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as F}from"../support/AnalysesCollection.js";import{GraphicsCollection as k}from"../support/GraphicsCollection.js";import x from"../time/TimeExtent.js";import{system as b,isTimeZoneValid as L}from"../time/timeZoneUtils.js";import O from"./BasemapView.js";import C from"./LayerViewManager.js";import Z from"./Magnifier.js";import I from"./SelectionManager.js";import H from"./Theme.js";import{ToolViewManager as W}from"./ToolViewManager.js";import{makeDefaultHighlightOptions as D}from"./3d/support/DefaultHighlights.js";import P from"./input/Input.js";import{ViewEvents as q}from"./input/ViewEvents.js";import A from"./navigation/Navigation.js";import{DefaultsFromMap as U}from"./support/DefaultsFromMap.js";import z from"./support/HighlightOptions.js";var G;let N=class extends(n.EventedMixin(u.EsriPromiseMixin(i))){static{G=this}constructor(e){super(e),this._userSpatialReference=null,this._cursor=null,this.handles=new l,this.updatingHandles=new R,this.highlights=D(),this.allLayerViews=new s({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:J}),this.groundView=null,this.basemapView=null,this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new k,this.analyses=new F,this.typeSpecificPreconditionsReady=!0,this.layerViews=new a,this.magnifier=new Z,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.supportsGround=!0,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new P,this.navigation=new A,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new q(this),this.persistableViewModels=new a,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this.theme=null,this.handles.add(c((()=>this.preconditionsReady),(e=>{const t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,G.views.add(this)):(this._lockedSpatialReference=null,G.views.remove(this)),this.notifyChange("spatialReference"),!e&&t)this.toolViewManager?.detach(),null!=this.analysisViewManager&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!t){try{this._startup()}catch(i){return void queueMicrotask((()=>{this.fatalError=new o("startup-error",null,i)}))}null!=this.analysisViewManager&&this.analysisViewManager.attach(),this.toolViewManager.attach()}}),w))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then((()=>(this._isValid=!0,g((()=>this.ready)))))),this.basemapView=new O({view:this}),this.layerViewManager=new C({view:this,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.toolViewManager=new W({view:this}),this.selectionManager=new I({view:this}),this.addHandles([f((()=>"map-content-error"===this.readyState&&!this.spatialReference),(()=>{d.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")})),c((()=>this.initialExtentRequired),(e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e}),v),c((()=>this.ready),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)}),w),c((()=>this._userSpatialReference),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)}),v)])}destroy(){this.destroyed||(G.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=h(this.graphics),this.analyses=h(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),h(this.analysisViewManager),this.toolViewManager=h(this.toolViewManager),this.layerViewManager=h(this.layerViewManager),this.selectionManager=h(this.selectionManager),this.basemapView=h(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach((e=>e.destroy())),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.destroy(),this.map=h(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return d.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new U({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||p.isLoadable(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(d.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),p.isLoadable(e)&&e.load().catch((()=>{})),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}get readyState(){if(this.destroyed)return this._get("readyState");if(!this.map)return"missing-map";if("container"in this&&!this.container)return"missing-container";if(this.fatalError)return"rendering-error";if((this.defaultsFromMap?.ready??!1)&&!this.spatialReference){const e=!("loaded"in this.map)||this.map.loaded,t=this.map.ground.loaded,i=this.map.basemap?.loaded??!0;return e&&i&&t&&!this.map?.allLayers.length?"empty-map":(this._readyStateWaitingTask||(this._readyStateWaitingTask=r((e=>m(has("view-readyState-waiting-delay"),null,e))),this.addHandles(this._readyStateWaitingTask),this.addHandles(this._readyStateWaitingTask,"ready-state-task")),this._readyStateWaitingTask?.finished?"map-content-error":"loading")}return this._readyStateWaitingTask=y(this._readyStateWaitingTask),this.removeHandles("ready-state-task"),this.ready?"ready":"loading"}get spatialReference(){const e=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(e&&this.defaultsFromMap?.required?.heightModelInfo){const t=e.clone();return t.vcsWkid=this.defaultsFromMap.vcsWkid,t.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,t}return e}set spatialReference(e){const t=!E(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(e){this._userTimeExtent=e}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??b}set timeZone(e){this._userTimeZone=e,L(e)||d.getLogger(this).warn("#timeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._cursor??"default"}set cursor(e){this._cursor=e,this.notifyChange("cursor")}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new H}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}importLayerView(e){throw new o("importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport(e)}when(e,t){return this.isResolved()&&!this.ready&&d.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(f((()=>this.destroyed||!1===this.preconditionsReady),(()=>this._readyCycleForced=!1),{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}static{this.views=new a}};e([M()],N.prototype,"_userSpatialReference",void 0),e([M({type:a.ofType(z)})],N.prototype,"highlights",void 0),e([M()],N.prototype,"activeTool",null),e([M({readOnly:!0})],N.prototype,"allLayerViews",void 0),e([M()],N.prototype,"groundView",void 0),e([M()],N.prototype,"animation",null),e([M()],N.prototype,"basemapView",void 0),e([M()],N.prototype,"center",null),e([M()],N.prototype,"defaultsFromMapSettings",null),e([M()],N.prototype,"defaultsFromMap",null),e([M()],N.prototype,"displayFilterEnabled",void 0),e([M()],N.prototype,"fatalError",void 0),e([M({type:S})],N.prototype,"extent",null),e([M(V(k,"graphics"))],N.prototype,"graphics",void 0),e([M(V(F,"analyses"))],N.prototype,"analyses",void 0),e([M({readOnly:!0,type:T})],N.prototype,"heightModelInfo",null),e([M({readOnly:!0})],N.prototype,"interacting",null),e([M({readOnly:!0})],N.prototype,"navigating",null),e([M({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],N.prototype,"preconditionsReady",null),e([M({readOnly:!0})],N.prototype,"typeSpecificPreconditionsReady",void 0),e([M({type:a,readOnly:!0})],N.prototype,"layerViews",void 0),e([M()],N.prototype,"resolution",null),e([M({type:Z})],N.prototype,"magnifier",void 0),e([M({value:null,type:t})],N.prototype,"map",null),e([M()],N.prototype,"padding",void 0),e([M({readOnly:!0})],N.prototype,"ready",void 0),e([M()],N.prototype,"_readyStateWaitingTask",void 0),e([M({readOnly:!0})],N.prototype,"readyState",null),e([M({type:j})],N.prototype,"spatialReference",null),e([M()],N.prototype,"stationary",null),e([M({readOnly:!0})],N.prototype,"supportsGround",void 0),e([M({type:x})],N.prototype,"timeExtent",null),e([M({type:String,nonNullable:!0})],N.prototype,"timeZone",null),e([M()],N.prototype,"tools",null),e([M()],N.prototype,"toolViewManager",void 0),e([M({readOnly:!0})],N.prototype,"type",void 0),e([M({type:Number})],N.prototype,"scale",void 0),e([M({readOnly:!0})],N.prototype,"updating",void 0),e([M({readOnly:!0})],N.prototype,"initialExtentRequired",void 0),e([M({readOnly:!0})],N.prototype,"initialExtent",null),e([M()],N.prototype,"cursor",null),e([M({readOnly:!0})],N.prototype,"input",void 0),e([M({type:A,nonNullable:!0})],N.prototype,"navigation",void 0),e([M()],N.prototype,"layerViewManager",void 0),e([M()],N.prototype,"analysisViewManager",void 0),e([M()],N.prototype,"selectionManager",void 0),e([M()],N.prototype,"width",void 0),e([M()],N.prototype,"height",void 0),e([M({readOnly:!0})],N.prototype,"resizing",void 0),e([M({value:null,readOnly:!0})],N.prototype,"size",null),e([M({readOnly:!0})],N.prototype,"suspended",void 0),e([M({readOnly:!0})],N.prototype,"viewEvents",void 0),e([M({readOnly:!0})],N.prototype,"persistableViewModels",void 0),e([M()],N.prototype,"_isValid",void 0),e([M()],N.prototype,"_readyCycleForced",void 0),e([M()],N.prototype,"_lockedSpatialReference",void 0),e([M()],N.prototype,"_userTimeZone",void 0),e([M()],N.prototype,"_lockedTimeZone",void 0),e([M()],N.prototype,"_userTimeExtent",void 0),e([M()],N.prototype,"_lockedTimeExtent",void 0),e([M({type:H})],N.prototype,"theme",void 0),e([M({readOnly:!0,type:H})],N.prototype,"effectiveTheme",null),N=G=e([_("esri.views.View")],N);const $=globalThis.$arcgis;$&&!$.views&&Object.defineProperty($,"views",{configurable:!1,enumerable:!0,writable:!1,value:N.views});const B=N;function J(e){return e.layerViews}export{B as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Map.js";import i from"../core/Accessor.js";import{createTask as r}from"../core/asyncUtils.js";import a from"../core/Collection.js";import s from"../core/CollectionFlattener.js";import o from"../core/Error.js";import n from"../core/Evented.js";import l from"../core/Handles.js";import has from"../core/has.js";import p from"../core/Loadable.js";import d from"../core/Logger.js";import{destroyMaybe as h,abortMaybe as y}from"../core/maybe.js";import u from"../core/Promise.js";import{after as m}from"../core/promiseUtils.js";import{watch as c,whenOnce as g,when as f,sync as w,syncAndInitial as v}from"../core/reactiveUtils.js";import{property as M}from"../core/accessorSupport/decorators/property.js";import"../core/RandomLCG.js";import{subclass as _}from"../core/accessorSupport/decorators/subclass.js";import{owningCollectionProperty as V}from"../core/support/OwningCollection.js";import{UpdatingHandles as R}from"../core/support/UpdatingHandles.js";import S from"../geometry/Extent.js";import j from"../geometry/HeightModelInfo.js";import T from"../geometry/SpatialReference.js";import{equals as E}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as F}from"../support/AnalysesCollection.js";import{GraphicsCollection as k}from"../support/GraphicsCollection.js";import x from"../time/TimeExtent.js";import{system as b,isTimeZoneValid as O}from"../time/timeZoneUtils.js";import L from"./BasemapView.js";import C from"./LayerViewManager.js";import Z from"./Magnifier.js";import I from"./SelectionManager.js";import H from"./Theme.js";import{ToolViewManager as W}from"./ToolViewManager.js";import{makeDefaultHighlightOptions as D}from"./3d/support/DefaultHighlights.js";import q from"./input/Input.js";import{ViewEvents as P}from"./input/ViewEvents.js";import A from"./navigation/Navigation.js";import{DefaultsFromMap as U}from"./support/DefaultsFromMap.js";import z from"./support/HighlightOptions.js";import G from"./support/RequiredFieldsOptions.js";var N;let $=class extends(n.EventedMixin(u.EsriPromiseMixin(i))){static{N=this}constructor(e){super(e),this._userSpatialReference=null,this._cursor=null,this.handles=new l,this.updatingHandles=new R,this.highlights=D(),this.allLayerViews=new s({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:K}),this.groundView=null,this.basemapView=null,this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new k,this.analyses=new F,this.typeSpecificPreconditionsReady=!0,this.layerViews=new a,this.magnifier=new Z,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.supportsGround=!0,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new q,this.navigation=new A,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new P(this),this.persistableViewModels=new a,this.requiredFieldsOptions=new G,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this.theme=null,this.handles.add(c((()=>this.preconditionsReady),(e=>{const t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,N.views.add(this)):(this._lockedSpatialReference=null,N.views.remove(this)),this.notifyChange("spatialReference"),!e&&t)this.toolViewManager?.detach(),null!=this.analysisViewManager&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!t){try{this._startup()}catch(i){return void queueMicrotask((()=>{this.fatalError=new o("startup-error",null,i)}))}null!=this.analysisViewManager&&this.analysisViewManager.attach(),this.toolViewManager.attach()}}),w))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then((()=>(this._isValid=!0,g((()=>this.ready)))))),this.basemapView=new L({view:this}),this.layerViewManager=new C({view:this,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.toolViewManager=new W({view:this}),this.selectionManager=new I({view:this}),this.addHandles([f((()=>"map-content-error"===this.readyState&&!this.spatialReference),(()=>{d.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")})),c((()=>this.initialExtentRequired),(e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e}),v),c((()=>this.ready),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)}),w),c((()=>this._userSpatialReference),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)}),v)])}destroy(){this.destroyed||(N.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=h(this.graphics),this.analyses=h(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),h(this.analysisViewManager),this.toolViewManager=h(this.toolViewManager),this.layerViewManager=h(this.layerViewManager),this.selectionManager=h(this.selectionManager),this.basemapView=h(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach((e=>e.destroy())),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.destroy(),this.map=h(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return d.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new U({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||p.isLoadable(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(d.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),p.isLoadable(e)&&e.load().catch((()=>{})),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}get readyState(){if(this.destroyed)return this._get("readyState");if(!this.map)return"missing-map";if("container"in this&&!this.container)return"missing-container";if(this.fatalError)return"rendering-error";if((this.defaultsFromMap?.ready??!1)&&!this.spatialReference){const e=!("loaded"in this.map)||this.map.loaded,t=this.map.ground.loaded,i=this.map.basemap?.loaded??!0;return e&&i&&t&&!this.map?.allLayers.length?"empty-map":(this._readyStateWaitingTask||(this._readyStateWaitingTask=r((e=>m(has("view-readyState-waiting-delay"),null,e))),this.addHandles(this._readyStateWaitingTask),this.addHandles(this._readyStateWaitingTask,"ready-state-task")),this._readyStateWaitingTask?.finished?"map-content-error":"loading")}return this._readyStateWaitingTask=y(this._readyStateWaitingTask),this.removeHandles("ready-state-task"),this.ready?"ready":"loading"}get spatialReference(){const e=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(e&&this.defaultsFromMap?.required?.heightModelInfo){const t=e.clone();return t.vcsWkid=this.defaultsFromMap.vcsWkid,t.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,t}return e}set spatialReference(e){const t=!E(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(e){this._userTimeExtent=e}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??b}set timeZone(e){this._userTimeZone=e,O(e)||d.getLogger(this).warn("#timeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._cursor??"default"}set cursor(e){this._cursor=e,this.notifyChange("cursor")}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new H}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}importLayerView(e){throw new o("importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport(e)}when(e,t){return this.isResolved()&&!this.ready&&d.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(f((()=>this.destroyed||!1===this.preconditionsReady),(()=>this._readyCycleForced=!1),{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}static{this.views=new a}};e([M()],$.prototype,"_userSpatialReference",void 0),e([M({type:a.ofType(z)})],$.prototype,"highlights",void 0),e([M()],$.prototype,"activeTool",null),e([M({readOnly:!0})],$.prototype,"allLayerViews",void 0),e([M()],$.prototype,"groundView",void 0),e([M()],$.prototype,"animation",null),e([M()],$.prototype,"basemapView",void 0),e([M()],$.prototype,"center",null),e([M()],$.prototype,"defaultsFromMapSettings",null),e([M()],$.prototype,"defaultsFromMap",null),e([M()],$.prototype,"displayFilterEnabled",void 0),e([M()],$.prototype,"fatalError",void 0),e([M({type:S})],$.prototype,"extent",null),e([M(V(k,"graphics"))],$.prototype,"graphics",void 0),e([M(V(F,"analyses"))],$.prototype,"analyses",void 0),e([M({readOnly:!0,type:j})],$.prototype,"heightModelInfo",null),e([M({readOnly:!0})],$.prototype,"interacting",null),e([M({readOnly:!0})],$.prototype,"navigating",null),e([M({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],$.prototype,"preconditionsReady",null),e([M({readOnly:!0})],$.prototype,"typeSpecificPreconditionsReady",void 0),e([M({type:a,readOnly:!0})],$.prototype,"layerViews",void 0),e([M()],$.prototype,"resolution",null),e([M({type:Z})],$.prototype,"magnifier",void 0),e([M({value:null,type:t})],$.prototype,"map",null),e([M()],$.prototype,"padding",void 0),e([M({readOnly:!0})],$.prototype,"ready",void 0),e([M()],$.prototype,"_readyStateWaitingTask",void 0),e([M({readOnly:!0})],$.prototype,"readyState",null),e([M({type:T})],$.prototype,"spatialReference",null),e([M()],$.prototype,"stationary",null),e([M({readOnly:!0})],$.prototype,"supportsGround",void 0),e([M({type:x})],$.prototype,"timeExtent",null),e([M({type:String,nonNullable:!0})],$.prototype,"timeZone",null),e([M()],$.prototype,"tools",null),e([M()],$.prototype,"toolViewManager",void 0),e([M({readOnly:!0})],$.prototype,"type",void 0),e([M({type:Number})],$.prototype,"scale",void 0),e([M({readOnly:!0})],$.prototype,"updating",void 0),e([M({readOnly:!0})],$.prototype,"initialExtentRequired",void 0),e([M({readOnly:!0})],$.prototype,"initialExtent",null),e([M()],$.prototype,"cursor",null),e([M({readOnly:!0})],$.prototype,"input",void 0),e([M({type:A,nonNullable:!0})],$.prototype,"navigation",void 0),e([M()],$.prototype,"layerViewManager",void 0),e([M()],$.prototype,"analysisViewManager",void 0),e([M()],$.prototype,"selectionManager",void 0),e([M()],$.prototype,"width",void 0),e([M()],$.prototype,"height",void 0),e([M({readOnly:!0})],$.prototype,"resizing",void 0),e([M({value:null,readOnly:!0})],$.prototype,"size",null),e([M({readOnly:!0})],$.prototype,"suspended",void 0),e([M({readOnly:!0})],$.prototype,"viewEvents",void 0),e([M({readOnly:!0})],$.prototype,"persistableViewModels",void 0),e([M()],$.prototype,"_isValid",void 0),e([M()],$.prototype,"_readyCycleForced",void 0),e([M()],$.prototype,"_lockedSpatialReference",void 0),e([M()],$.prototype,"_userTimeZone",void 0),e([M()],$.prototype,"_lockedTimeZone",void 0),e([M()],$.prototype,"_userTimeExtent",void 0),e([M()],$.prototype,"_lockedTimeExtent",void 0),e([M({type:H})],$.prototype,"theme",void 0),e([M({readOnly:!0,type:H})],$.prototype,"effectiveTheme",null),$=N=e([_("esri.views.View")],$);const B=globalThis.$arcgis;B&&!B.views&&Object.defineProperty(B,"views",{configurable:!1,enumerable:!0,writable:!1,value:$.views});const J=$;function K(e){return e.layerViews}export{J as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Evented.js";import{clone as i}from"../../core/lang.js";import{destroyMaybe as r}from"../../core/maybe.js";import{ignoreAbortErrors as n}from"../../core/promiseUtils.js";import{createScreenPointArray as s}from"../../core/screenUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import p from"../../layers/GraphicsLayer.js";import{makeDehydratedPoint as d}from"../../layers/graphics/dehydratedPoint.js";import{ViewingMode as h}from"../ViewingMode.js";import{SnappingVisualizer2D as l}from"../2d/interactive/SnappingVisualizer2D.js";import{createCoordinateHelper as c}from"../interactive/coordinateHelper.js";import{EditGeometry as m,Component as _}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as u}from"../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as y}from"../interactive/snapping/SnappingContext.js";import{SnappingOperation as g}from"../interactive/snapping/SnappingOperation.js";var v;let f=class extends t.EventedAccessor{static{v=this}constructor(e){super(e),this._hasZ=null,this._cursorScreenPoint=null,this._activePointerId=null,this._stagedVertexUnsnapped=null,this._lastVertexUnsnapped=null,this.interactiveUndoDisabled=!1,this.history=[],this.redoHistory=[],this.snapToScene=!1,this.view=null,this.elevationInfo=null,this.defaultZ=0,this._coordinateHelper=c(!!e.hasZ,!1,e.view.spatialReference),this._snappingManager=e.snappingManager,this._editGeometryOperations=new u(new m(e.editGeometryType??"polygon",this._coordinateHelper),h.Local),this._snappingGraphicsLayer=new p({id:v.SNAPPING_GRAPHICS_LAYER_ID,listMode:"hide",internal:!0}),this._snappingContext=new y({editGeometryOperations:this._editGeometryOperations,elevationInfo:{mode:"on-the-ground",offset:0},pointer:"mouse",visualizer:new l(this._snappingGraphicsLayer)}),this._activeComponent=new _(e.view.spatialReference,h.Local),this._editGeometryOperations.data.components.push(this._activeComponent)}normalizeCtorArgs(e){const t={...e};return delete t.editGeometryType,delete t.snappingManager,t}initialize(){this._snappingOperation=new g({view:this.view}),"2d"===this.view.type&&this.view.map.layers.add(this._snappingGraphicsLayer)}destroy(){this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy(),null!=this._snappingManager&&this._snappingManager.doneSnapping(),this._snappingOperation=r(this._snappingOperation),this._editGeometryOperations.destroy()}get _committedVertices(){return this._editGeometryOperations.data.components[0].vertices.map((e=>e.pos))}get vertices(){return null!=this._stagedVertex?[...this._committedVertices,this._coordinateHelper.pointToArray(this._stagedVertex)]:this._committedVertices}get hasZ(){return null!=this._hasZ?this._hasZ:"3d"===this.view.type}set hasZ(e){this._hasZ=e,this.notifyChange("hasZ")}get _stagedVertex(){return this._snappingOperation.stagedPoint}set _stagedVertex(e){this._snappingOperation.stagedPoint=i(e)}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this.canUndo&&this._editGeometryOperations.undo()}redo(){this.canRedo&&this._editGeometryOperations.redo()}getCoordsFromScreenPoint(e){const t=e&&this.screenToMap(e);return null==t?null:t.hasZ?[t.x,t.y,t.z]:[t.x,t.y]}getCoordsAndPointFromScreenPoint(e){const t=this.screenToMap(e);return null==t?null:t.hasZ?{vertex:[t.x,t.y,t.z],mapPoint:t}:{vertex:[t.x,t.y],mapPoint:t}}screenToMap(e){let t=null;if("3d"===this.view.type)if(this.hasZ){const i=this.elevationInfo??x;t=this.view.sceneIntersectionHelper.intersectElevationFromScreen(s(e.x,e.y),i,this._getGeometryZValue())}else{const i=this.elevationInfo??G;t=this.view.sceneIntersectionHelper.intersectElevationFromScreen(s(e.x,e.y),i,0),null!=t&&(t.z=void 0)}else t=this.view.toMap(e),null!=t&&(t.z=this.hasZ?this._getGeometryZValue():void 0);return t}_pushCursorVertex(e,t){const i=d(e[0],e[1],void 0,this.view.spatialReference);this._stagedVertexUnsnapped=i;const r=this._snappingManager;if(null==r)return this._stagedVertex=i,void t();n(this._snappingOperation.snap({point:i},r,this._snappingContext)).then((()=>{t()}))}_popCursorVertex(){this._stagedVertexUnsnapped=null,this._stagedVertex=null}_getGeometryZValue(){return this.defaultZ}_abortSnapping(){this._snappingOperation.abort()}_isDuplicateOfLastVertex(e){const t=this._editGeometryOperations.data.components[0].getLastVertex()?.pos;if(t&&e[0]===t[0]&&e[1]===t[1])return!0;const{x:i,y:r}=this._coordinateHelper.vectorToDehydratedPoint(e);return null!=this._lastVertexUnsnapped&&i===this._lastVertexUnsnapped.x&&r===this._lastVertexUnsnapped.y}_shouldHandlePointerEvent(e){return w(e)&&(null==this._activePointerId||this._activePointerId===e.pointerId)}_vertexAddHandler(e){const t=null!=this._stagedVertex?this._coordinateHelper.pointToArray(this._stagedVertex):this.getCoordsFromScreenPoint(this._cursorScreenPoint);null!=t&&this._addVertex(t,e.native)}_drawCompleteHandler(e){this._completeDrawing(e.native)}static{this.SNAPPING_GRAPHICS_LAYER_ID="DrawAction-snapping-graphics-layer"}};e([o({readOnly:!0})],f.prototype,"vertices",null),e([o({type:Boolean,nonNullable:!0})],f.prototype,"interactiveUndoDisabled",void 0),e([o({readOnly:!0})],f.prototype,"history",void 0),e([o({readOnly:!0})],f.prototype,"redoHistory",void 0),e([o()],f.prototype,"snapToScene",void 0),e([o()],f.prototype,"view",void 0),e([o()],f.prototype,"elevationInfo",void 0),e([o({nonNullable:!0})],f.prototype,"defaultZ",void 0),e([o()],f.prototype,"hasZ",null),e([o()],f.prototype,"_snappingOperation",void 0),e([o()],f.prototype,"_stagedVertex",null),f=v=e([a("esri.views.draw.DrawAction")],f);const x={mode:"absolute-height",offset:0},G={mode:"on-the-ground",offset:0};function w(e){return"mouse"!==e.pointerType||0===e.button}const V=f;export{V as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Evented.js";import{clone as i}from"../../core/lang.js";import{destroyMaybe as n}from"../../core/maybe.js";import{ignoreAbortErrors as r}from"../../core/promiseUtils.js";import{createScreenPointArray as s}from"../../core/screenUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import p from"../../layers/GraphicsLayer.js";import{makeDehydratedPoint as d}from"../../layers/graphics/dehydratedPoint.js";import{ViewingMode as h}from"../ViewingMode.js";import{SnappingVisualizer2D as l}from"../2d/interactive/SnappingVisualizer2D.js";import{createCoordinateHelper as c}from"../interactive/coordinateHelper.js";import{EditGeometry as m,Component as _}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as u}from"../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as y}from"../interactive/snapping/SnappingContext.js";import{SnappingOperation as g}from"../interactive/snapping/SnappingOperation.js";var v;let f=class extends t.EventedAccessor{static{v=this}constructor(e){super(e),this._hasZ=null,this._cursorScreenPoint=null,this._activePointerId=null,this._stagedVertexUnsnapped=null,this._lastVertexUnsnapped=null,this.interactiveUndoDisabled=!1,this.history=[],this.redoHistory=[],this.snapToScene=!1,this.view=null,this.elevationInfo=null,this.defaultZ=0,this._coordinateHelper=c(!!e.hasZ,!1,e.view.spatialReference),this._snappingManager=e.snappingManager,this._editGeometryOperations=new u(new m(e.editGeometryType??"polygon",this._coordinateHelper),h.Local),this._snappingGraphicsLayer=new p({id:v.SNAPPING_GRAPHICS_LAYER_ID,listMode:"hide",internal:!0}),this._snappingContext=new y({editGeometryOperations:this._editGeometryOperations,elevationInfo:{mode:"on-the-ground",offset:0},pointer:"mouse",visualizer:new l(this._snappingGraphicsLayer)}),this._activeComponent=new _(e.view.spatialReference,h.Local),this._editGeometryOperations.data.components.push(this._activeComponent)}normalizeCtorArgs(e){const t={...e};return delete t.editGeometryType,delete t.snappingManager,t}initialize(){this._snappingOperation=new g({view:this.view}),"2d"===this.view.type&&this.view.map.layers.add(this._snappingGraphicsLayer)}destroy(){this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy(),null!=this._snappingManager&&this._snappingManager.doneSnapping(),this._snappingOperation=n(this._snappingOperation),this._editGeometryOperations.destroy()}get _committedVertices(){return this._editGeometryOperations.data.components[0].vertices.map((e=>e.pos))}get vertices(){return null!=this._stagedVertex?[...this._committedVertices,this._coordinateHelper.pointToArray(this._stagedVertex)]:this._committedVertices}get hasZ(){return null!=this._hasZ?this._hasZ:"3d"===this.view.type}set hasZ(e){this._hasZ=e,this.notifyChange("hasZ")}get _stagedVertex(){return this._snappingOperation?.stagedPoint}set _stagedVertex(e){this._snappingOperation&&(this._snappingOperation.stagedPoint=i(e))}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this.canUndo&&this._editGeometryOperations.undo()}redo(){this.canRedo&&this._editGeometryOperations.redo()}getCoordsFromScreenPoint(e){const t=e&&this.screenToMap(e);return null==t?null:t.hasZ?[t.x,t.y,t.z]:[t.x,t.y]}getCoordsAndPointFromScreenPoint(e){const t=this.screenToMap(e);return null==t?null:t.hasZ?{vertex:[t.x,t.y,t.z],mapPoint:t}:{vertex:[t.x,t.y],mapPoint:t}}screenToMap(e){let t=null;if("3d"===this.view.type)if(this.hasZ){const i=this.elevationInfo??x;t=this.view.sceneIntersectionHelper.intersectElevationFromScreen(s(e.x,e.y),i,this._getGeometryZValue())}else{const i=this.elevationInfo??G;t=this.view.sceneIntersectionHelper.intersectElevationFromScreen(s(e.x,e.y),i,0),null!=t&&(t.z=void 0)}else t=this.view.toMap(e),null!=t&&(t.z=this.hasZ?this._getGeometryZValue():void 0);return t}_pushCursorVertex(e,t){const i=d(e[0],e[1],void 0,this.view.spatialReference);this._stagedVertexUnsnapped=i;const n=this._snappingManager;if(null==n)return this._stagedVertex=i,void t();r(this._snappingOperation.snap({point:i},n,this._snappingContext)).then((()=>{t()}))}_popCursorVertex(){this._stagedVertexUnsnapped=null,this._stagedVertex=null}_getGeometryZValue(){return this.defaultZ}_abortSnapping(){this._snappingOperation.abort()}_isDuplicateOfLastVertex(e){const t=this._editGeometryOperations.data.components[0].getLastVertex()?.pos;if(t&&e[0]===t[0]&&e[1]===t[1])return!0;const{x:i,y:n}=this._coordinateHelper.vectorToDehydratedPoint(e);return null!=this._lastVertexUnsnapped&&i===this._lastVertexUnsnapped.x&&n===this._lastVertexUnsnapped.y}_shouldHandlePointerEvent(e){return w(e)&&(null==this._activePointerId||this._activePointerId===e.pointerId)}_vertexAddHandler(e){const t=null!=this._stagedVertex?this._coordinateHelper.pointToArray(this._stagedVertex):this.getCoordsFromScreenPoint(this._cursorScreenPoint);null!=t&&this._addVertex(t,e.native)}_drawCompleteHandler(e){this._completeDrawing(e.native)}static{this.SNAPPING_GRAPHICS_LAYER_ID="DrawAction-snapping-graphics-layer"}};e([o({readOnly:!0})],f.prototype,"vertices",null),e([o({type:Boolean,nonNullable:!0})],f.prototype,"interactiveUndoDisabled",void 0),e([o({readOnly:!0})],f.prototype,"history",void 0),e([o({readOnly:!0})],f.prototype,"redoHistory",void 0),e([o()],f.prototype,"snapToScene",void 0),e([o()],f.prototype,"view",void 0),e([o()],f.prototype,"elevationInfo",void 0),e([o({nonNullable:!0})],f.prototype,"defaultZ",void 0),e([o()],f.prototype,"hasZ",null),e([o()],f.prototype,"_snappingOperation",void 0),e([o()],f.prototype,"_stagedVertex",null),f=v=e([a("esri.views.draw.DrawAction")],f);const x={mode:"absolute-height",offset:0},G={mode:"on-the-ground",offset:0};function w(e){return"mouse"!==e.pointerType||0===e.button}const V=f;export{V as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../core/has.js";import t from"../../core/Logger.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{watch as i,syncAndInitial as s,on as l}from"../../core/reactiveUtils.js";import{sqlAnd as n}from"../../core/sql.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{systemIsSpatialFieldName as u}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as p}from"../../layers/support/displayFilterUtils.js";import d from"../../layers/support/FeatureEffect.js";import f from"../../layers/support/FeatureFilter.js";import{getSignedInUser as y}from"../../layers/support/featureLayerUtils.js";import{fixFields as h,unpackFieldNames as m,collectLabelingFields as c,collectElevationFields as F,collectFilterFields as g,collectFeatureReductionFields as I,collectOrderByInfos as b,collectFields as w,collectTrackInfoFields as E,collectDisplayFilterFields as v,collectField as x,featureHasFields as q}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as R}from"../../layers/support/floorFilterUtils.js";import _ from"../../rest/support/Query.js";import{loadArcade as j}from"../../support/arcadeOnDemand.js";import{getRequiredFields as C,getFetchPopupTemplate as O}from"./support/popupUtils.js";import{WhereClauseVisitor as P}from"./support/WhereClauseVisitor.js";const k=k=>{let U=class extends k{constructor(...e){super(...e),this._updatingRequiredPromise=null,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([i((()=>{const e=this.layer;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode,"parquet"===e?.type&&e.popupTemplate]}),(()=>this._handleChange()),s),l((()=>this.view?.floors),"change",(()=>this._handleChange())),l((()=>this.layer.displayFilterInfo?.filters),"change",(()=>this._handleChange())),l((()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null),"change",(()=>this._handleChange()))])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:r}=this;return"outFields"in e&&e.outFields?h(t,[...m(t,e.outFields),...r]):h(t,r)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return this.displayFilterEnabled&&e.displayFilterInfo?p(e.displayFilterInfo,this.view):null}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?y(this.layer.url):Promise.resolve(null)}highlight(e,t){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new _(e);return"floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=n(t.where,R(this))),this.displayFilterEnabled&&(t.where=n(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new _(e)}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(e,t){return this._fetchPopupFeatures(e,t)}_loadArcadeModules(e){return e.expressionInfos?.length||Array.isArray(e.content)&&e.content.some((e=>"expression"===e.type))?j():Promise.resolve()}_handleChange(){const e=Promise.all([this._updateRequiredFields(),this._updateClientWhereClauseRequirements()]).then((()=>{}));return this._set("_updatingRequiredPromise",e),e.then((()=>{this._updatingRequiredPromise===e&&this._set("_updatingRequiredPromise",null)})),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,r=new P(e.fieldsIndex);if(r.visitFilter(this.filter),"featureReduction"in e&&r.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&r.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&r.visitTrackInfo(e.trackInfo),"2d"===this.view.type&&(r.visitFilter(this.featureEffect?.filter),r.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo),"featureReduction"in e&&r.visitFeatureReduction(e.featureReduction)),"subtype-group"===e.type)for(const t of e.sublayers)r.visitLabelingInfo(t.labelsVisible,t.labelingInfo);try{const e=await r.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(i){t.getLogger(this).error(i)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:r,layer:{fieldsIndex:i,objectIdField:s}}=this,l="renderer"in r&&r.renderer,n="orderBy"in r&&r.orderBy,o="featureReduction"in r?r.featureReduction:null,a=new Set,p=[l?l.collectRequiredFields(a,i):null,c(a,r),e&&"elevationInfo"in r?F(a,r):null,null!=this.filter?g(a,r,this.filter):null,e||null==this.featureEffect?null:g(a,r,this.featureEffect.filter),!e&&o?I(a,r,o):null,!e&&n?b(a,r,n):null];if("timeInfo"in r&&r.timeInfo&&this.timeExtent&&w(a,r.fieldsIndex,[r.timeInfo.startField,r.timeInfo.endField]),"timeInfo"in r&&r.timeInfo&&"trackInfo"in r&&r.trackInfo){const{trackInfo:e}=r;w(a,r.fieldsIndex,[r.timeInfo.trackIdField]),"feature"!==r.type&&"startTimeField"!==e.timeField||w(a,r.fieldsIndex,[r.timeInfo.startField]),"endTimeField"===e.timeField&&w(a,r.fieldsIndex,[r.timeInfo.endField]),await E(a,r)}if("floorInfo"in r&&r.floorInfo&&w(a,r.fieldsIndex,[r.floorInfo.floorField]),this.displayFilterEnabled&&p.push(v(a,r,r.displayFilterInfo)),"feature"===r.type&&e&&null!=r.infoFor3D&&(null==r.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),w(a,r.fieldsIndex,[r.globalIdField])),"subtype-group"===r.type){x(a,i,r.subtypeField);const e=r.sublayers.map((e=>Promise.all([e.renderer?.collectRequiredFields(a,i),c(a,e)])));p.push(Promise.all(e))}if("catalog-footprint"===r.type&&r.parent){const e=r.parent;w(a,i,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===r.type&&"link-chart"===r.parentCompositeLayer.type&&x(a,i,u),"parquet"===r.type&&p.push(C(r,r.popupTemplate).then((e=>{for(const t of e)a.add(t)})));const d=await Promise.allSettled(p);x(a,i,s),e&&"displayField"in r&&r.displayField&&x(a,i,r.displayField);for(const u of d)"rejected"===u.status&&t.getLogger(this).error(u.reason);const f=Array.from(a).sort();this._set("requiredFields",f)}_popupFeatureHasRequiredFields(e,t){return q(t,e)}async _fetchPopupFeatures(e,t){const i=new Array(e.length),s=new Map,l=await this._createPopupQuery(e.map((e=>e.origin?.layer??e.layer)),t);for(let n=0;n<e.length;n++){const o=e[n];if(o.isAggregate){i[n]=o;continue}const a=o.origin?.layer??o.layer;if(!a||!("popupEnabled"in a)||!a.popupEnabled)continue;const u=m(this.layer.fieldsIndex,l.outFields),p=O(a,t);if(null==p)continue;const d=await this._loadArcadeModules(p);r(t);d&&d.arcadeUtils.hasGeometryOperations(p)||!this._popupFeatureHasRequiredFields(o,u)?s.set(o.getObjectId(),{graphic:o,index:n}):i[n]=o}if("stream"===this.layer.type||"parquet"===this.layer.type||0===s.size)return i.filter(Boolean);l.objectIds=Array.from(s.keys());try{const e=await this.layer.queryFeatures(l,t);for(const t of e.features){const{graphic:{geometry:e,origin:r},index:l}=s.get(t.getObjectId());t.geometry||=e,t.origin=r,i[l]=t}}catch{}return i.filter(Boolean)}async _createPopupQuery(e,t){const i=this.layer.createQuery(),s=new Set;let l=!1;const n=e??[this.layer];for(const o of n){if(!("popupEnabled"in o))continue;const e=O(o,t);if(null==e)continue;const i=await this._loadArcadeModules(e);r(t);const n=i&&i.arcadeUtils.hasGeometryOperations(e);l=!("point"!==this.layer.geometryType&&!n);const a=await C(this.layer,e);r(t);for(const t of a)s.add(t)}if(i.returnGeometry=l,i.returnZ=l,i.returnM=l,i.outFields=Array.from(s),i.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo){const e=R(this);null!=e&&(i.where=i.where?`(${i.where}) AND (${e})`:e)}return i}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};return e([o()],U.prototype,"_updatingRequiredPromise",void 0),e([o({readOnly:!0})],U.prototype,"availableFields",null),e([o({readOnly:!0})],U.prototype,"displayFilterEnabled",null),e([o({readOnly:!0})],U.prototype,"effectiveDisplayFilter",null),e([o({type:d})],U.prototype,"featureEffect",null),e([o({type:f})],U.prototype,"filter",void 0),e([o()],U.prototype,"layer",void 0),e([o({type:Number})],U.prototype,"maximumNumberOfFeatures",null),e([o({readOnly:!0,type:Boolean})],U.prototype,"maximumNumberOfFeaturesExceeded",null),e([o()],U.prototype,"requiresCurrentUser",void 0),e([o({readOnly:!0})],U.prototype,"requiredFields",void 0),e([o({readOnly:!0})],U.prototype,"signedInUser",null),e([o()],U.prototype,"suspended",void 0),e([o()],U.prototype,"view",void 0),U=e([a("esri.views.layers.FeatureLayerView")],U),U};export{k as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../core/has.js";import t from"../../core/Logger.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{watch as i,syncAndInitial as s,on as l}from"../../core/reactiveUtils.js";import{sqlAnd as n}from"../../core/sql.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{systemIsSpatialFieldName as u}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as d}from"../../layers/support/displayFilterUtils.js";import p from"../../layers/support/FeatureEffect.js";import f from"../../layers/support/FeatureFilter.js";import{getSignedInUser as y}from"../../layers/support/featureLayerUtils.js";import{fixFields as h,unpackFieldNames as m,collectLabelingFields as c,collectElevationFields as F,collectFilterFields as g,collectFeatureReductionFields as I,collectOrderByInfos as b,collectFields as w,collectTrackInfoFields as E,collectDisplayFilterFields as v,collectField as x,featureHasFields as q}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as R}from"../../layers/support/floorFilterUtils.js";import{getUtilityNetworkFields as _}from"../../networks/support/networkFieldUtils.js";import j from"../../rest/support/Query.js";import{loadArcade as O}from"../../support/arcadeOnDemand.js";import{getRequiredFields as C,getFetchPopupTemplate as k}from"./support/popupUtils.js";import{WhereClauseVisitor as P}from"./support/WhereClauseVisitor.js";const U=U=>{let T=class extends U{constructor(...e){super(...e),this._updatingRequiredPromise=null,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([i((()=>{const e=this.layer,t=this.view;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,t?.requiredFieldsOptions?.featureTitleFields&&e&&"featureTitleFields"in e&&e.featureTitleFields,t?.requiredFieldsOptions?.utilityNetworkFields&&_(t,e),e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode,"parquet"===e?.type&&e.popupTemplate]}),(()=>this._handleChange()),s),l((()=>this.view?.floors),"change",(()=>this._handleChange())),l((()=>this.layer.displayFilterInfo?.filters),"change",(()=>this._handleChange())),l((()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null),"change",(()=>this._handleChange()))])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:r}=this;return"outFields"in e&&e.outFields?h(t,[...m(t,e.outFields),...r]):h(t,r)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return this.displayFilterEnabled&&e.displayFilterInfo?d(e.displayFilterInfo,this.view):null}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?y(this.layer.url):Promise.resolve(null)}highlight(e,t){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new j(e);return"floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=n(t.where,R(this))),this.displayFilterEnabled&&(t.where=n(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new j(e)}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(e,t){return this._fetchPopupFeatures(e,t)}_loadArcadeModules(e){return e.expressionInfos?.length||Array.isArray(e.content)&&e.content.some((e=>"expression"===e.type))?O():Promise.resolve()}_handleChange(){const e=Promise.all([this._updateRequiredFields(),this._updateClientWhereClauseRequirements()]).then((()=>{}));return this._set("_updatingRequiredPromise",e),e.then((()=>{this._updatingRequiredPromise===e&&this._set("_updatingRequiredPromise",null)})),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,r=new P(e.fieldsIndex);if(r.visitFilter(this.filter),"featureReduction"in e&&r.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&r.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&r.visitTrackInfo(e.trackInfo),"2d"===this.view.type&&(r.visitFilter(this.featureEffect?.filter),r.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo),"featureReduction"in e&&r.visitFeatureReduction(e.featureReduction)),"subtype-group"===e.type)for(const t of e.sublayers)r.visitLabelingInfo(t.labelsVisible,t.labelingInfo);try{const e=await r.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(i){t.getLogger(this).error(i)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:r,layer:{fieldsIndex:i,objectIdField:s}}=this,l="renderer"in r&&r.renderer,n="orderBy"in r&&r.orderBy,o="featureReduction"in r?r.featureReduction:null,a=new Set,d=[l?l.collectRequiredFields(a,i):null,c(a,r),e&&"elevationInfo"in r?F(a,r):null,null!=this.filter?g(a,r,this.filter):null,e||null==this.featureEffect?null:g(a,r,this.featureEffect.filter),!e&&o?I(a,r,o):null,!e&&n?b(a,r,n):null];if("timeInfo"in r&&r.timeInfo&&this.timeExtent&&w(a,r.fieldsIndex,[r.timeInfo.startField,r.timeInfo.endField]),"timeInfo"in r&&r.timeInfo&&"trackInfo"in r&&r.trackInfo){const{trackInfo:e}=r;w(a,r.fieldsIndex,[r.timeInfo.trackIdField]),"feature"!==r.type&&"startTimeField"!==e.timeField||w(a,r.fieldsIndex,[r.timeInfo.startField]),"endTimeField"===e.timeField&&w(a,r.fieldsIndex,[r.timeInfo.endField]),await E(a,r)}if("floorInfo"in r&&r.floorInfo&&w(a,r.fieldsIndex,[r.floorInfo.floorField]),"featureTitleFields"in r&&this.view?.requiredFieldsOptions?.featureTitleFields&&r.featureTitleFields&&w(a,r.fieldsIndex,r.featureTitleFields),"feature"===r.type&&r.globalIdField&&this.view?.requiredFieldsOptions?.globalIdField&&w(a,r.fieldsIndex,[r.globalIdField]),this.displayFilterEnabled&&d.push(v(a,r,r.displayFilterInfo)),"feature"===r.type&&e&&null!=r.infoFor3D&&(null==r.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),w(a,r.fieldsIndex,[r.globalIdField])),"subtype-group"===r.type){x(a,i,r.subtypeField);const e=r.sublayers.map((e=>Promise.all([e.renderer?.collectRequiredFields(a,i),c(a,e)])));d.push(Promise.all(e))}if("catalog-footprint"===r.type&&r.parent){const e=r.parent;w(a,i,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===r.type&&"link-chart"===r.parentCompositeLayer.type&&x(a,i,u),"parquet"===r.type&&d.push(C(r,r.popupTemplate).then((e=>{for(const t of e)a.add(t)})));const p=await Promise.allSettled(d);x(a,i,s),e&&"displayField"in r&&r.displayField&&x(a,i,r.displayField);for(const u of p)"rejected"===u.status&&t.getLogger(this).error(u.reason);const f=Array.from(a).sort();this._set("requiredFields",f)}_popupFeatureHasRequiredFields(e,t){return q(t,e)}async _fetchPopupFeatures(e,t){const i=new Array(e.length),s=new Map,l=await this._createPopupQuery(e.map((e=>e.origin?.layer??e.layer)),t);for(let n=0;n<e.length;n++){const o=e[n];if(o.isAggregate){i[n]=o;continue}const a=o.origin?.layer??o.layer;if(!a||!("popupEnabled"in a)||!a.popupEnabled)continue;const u=m(this.layer.fieldsIndex,l.outFields),d=k(a,t);if(null==d)continue;const p=await this._loadArcadeModules(d);r(t);p&&p.arcadeUtils.hasGeometryOperations(d)||!this._popupFeatureHasRequiredFields(o,u)?s.set(o.getObjectId(),{graphic:o,index:n}):i[n]=o}if("stream"===this.layer.type||"parquet"===this.layer.type||0===s.size)return i.filter(Boolean);l.objectIds=Array.from(s.keys());try{const e=await this.layer.queryFeatures(l,t);for(const t of e.features){const{graphic:{geometry:e,origin:r},index:l}=s.get(t.getObjectId());t.geometry||=e,t.origin=r,i[l]=t}}catch{}return i.filter(Boolean)}async _createPopupQuery(e,t){const i=this.layer.createQuery(),s=new Set;let l=!1;const n=e??[this.layer];for(const o of n){if(!("popupEnabled"in o))continue;const e=k(o,t);if(null==e)continue;const i=await this._loadArcadeModules(e);r(t);const n=i&&i.arcadeUtils.hasGeometryOperations(e);l=!("point"!==this.layer.geometryType&&!n);const a=await C(this.layer,e);r(t);for(const t of a)s.add(t)}if(i.returnGeometry=l,i.returnZ=l,i.returnM=l,i.outFields=Array.from(s),i.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo){const e=R(this);null!=e&&(i.where=i.where?`(${i.where}) AND (${e})`:e)}return i}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};return e([o()],T.prototype,"_updatingRequiredPromise",void 0),e([o({readOnly:!0})],T.prototype,"availableFields",null),e([o({readOnly:!0})],T.prototype,"displayFilterEnabled",null),e([o({readOnly:!0})],T.prototype,"effectiveDisplayFilter",null),e([o({type:p})],T.prototype,"featureEffect",null),e([o({type:f})],T.prototype,"filter",void 0),e([o()],T.prototype,"layer",void 0),e([o({type:Number})],T.prototype,"maximumNumberOfFeatures",null),e([o({readOnly:!0,type:Boolean})],T.prototype,"maximumNumberOfFeaturesExceeded",null),e([o()],T.prototype,"requiresCurrentUser",void 0),e([o({readOnly:!0})],T.prototype,"requiredFields",void 0),e([o({readOnly:!0})],T.prototype,"signedInUser",null),e([o()],T.prototype,"suspended",void 0),e([o()],T.prototype,"view",void 0),T=e([a("esri.views.layers.FeatureLayerView")],T),T};export{U as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import r from"../../core/Error.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{commonRasterFieldNames as a,addMultidimensionalFieldValues as n,rasterFieldPrefix as o}from"../../layers/support/rasterFieldUtils.js";import{combineTimeExtent as l}from"../../layers/support/timeSupport.js";import{getDefaultDatumTransformationForDataset as u,projectDatasetExtent as c,getSourceScale as p}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{getFetchPopupTemplate as m}from"./support/popupUtils.js";const y=y=>{let f=class extends y{constructor(){super(...arguments),this.layer=null,this.tileInfo=null}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}get timeExtent(){return l(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){try{return this.layer.loaded?u(this.layer.fullExtent,this.view.spatialReference,!0):null}catch{return null}}supportsSpatialReference(e){try{return!this.layer.loaded||!!c(this.layer.serviceRasterInfo,e)}catch{return!1}}async fetchPopupFeaturesAtLocation(e,i){const{layer:s}=this;if(!e)throw new r("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const{popupEnabled:l}=s,u=m(s,i);if(!l||null==u)return[];const c=[],{value:p,magdirValue:y,processedValue:f}=await s.identify(e,{timeExtent:this.timeExtent,signal:i?.signal});let d="";if(p?.length){d="imagery-tile"===s.type&&s.hasStandardTime()&&null!=p[0]?p.map((e=>s.getStandardTimeValue(e))).join(", "):p.join(", ");const e={ObjectId:0};e[a.servicePixelValue]="imagery-tile"===s.type&&"Function"===s.raster.datasetFormat?f?.join(", "):d,e[a.rawServicePixelValue]=d;const r=s.raster?.rasterInfo??s.serviceRasterInfo,i=r?.attributeTable;if(null!=i){const{fields:t,features:r}=i,s=t.find((({name:e})=>"value"===e.toLowerCase())),n=e[a.servicePixelValue],l=s?r.find((e=>String(e.attributes[s.name])===n)):null;if(l)for(const i in l.attributes)if(l.attributes.hasOwnProperty(i)){e[o+i]=l.attributes[i]}}const l=r?.dataType;if("vector-magdir"!==l&&"vector-uv"!==l||(e[a.magnitude]=y?.[0],e[a.direction]=y?.[1]),"imagery-tile"===s.type){const{multidimensionalDefinition:t}=this.layer.normalizeRasterFetchOptions({timeExtent:this.timeExtent});n(s.rasterFields,e,t)}const u=new t({geometry:this.fullExtent?.clone(),attributes:e,layer:s,sourceLayer:s});c.push(u)}return c}async getSourceScale(){return await this.layer.load(),p(this.layer.serviceRasterInfo,this.view.spatialReference)}_getFullExtent(){return c(this.layer.serviceRasterInfo,this.view.spatialReference)}};return e([i()],f.prototype,"fullExtent",null),e([i()],f.prototype,"layer",void 0),e([i({readOnly:!0})],f.prototype,"timeExtent",null),e([i()],f.prototype,"tileInfo",void 0),e([i({readOnly:!0})],f.prototype,"hasTilingEffects",null),e([i()],f.prototype,"datumTransformation",null),f=e([s("esri.views.layers.ImageryTileLayerView")],f),f};export{y as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import r from"../../core/Error.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{commonRasterFieldNames as a,addMultidimensionalFieldValues as o,rasterFieldPrefix as n}from"../../layers/support/rasterFieldUtils.js";import{combineTimeExtent as l}from"../../layers/support/timeSupport.js";import{isFunctionRaster as u}from"../../layers/support/rasterDatasets/datasetUtils.js";import{getDefaultDatumTransformationForDataset as p,projectDatasetExtent as c,getSourceScale as m}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{getFetchPopupTemplate as y}from"./support/popupUtils.js";const f=f=>{let d=class extends f{constructor(){super(...arguments),this.layer=null,this.tileInfo=null}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}get timeExtent(){return l(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){try{return this.layer.loaded?p(this.layer.fullExtent,this.view.spatialReference,!0):null}catch{return null}}supportsSpatialReference(e){try{return!this.layer.loaded||!!c(this.layer.serviceRasterInfo,e)}catch{return!1}}async fetchPopupFeaturesAtLocation(e,i){const{layer:s}=this;if(!e)throw new r("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const{popupEnabled:l}=s,p=y(s,i);if(!l||null==p)return[];const c=[],{value:m,magdirValue:f,processedValue:d}=await s.identify(e,{timeExtent:this.timeExtent,signal:i?.signal});let h="";if(m?.length){h="imagery-tile"===s.type&&s.hasStandardTime()&&null!=m[0]?m.map((e=>s.getStandardTimeValue(e))).join(", "):m.join(", ");const e={ObjectId:0};e[a.servicePixelValue]="imagery-tile"===s.type&&u(s.raster)?d?.join(", "):h,e[a.rawServicePixelValue]=h;const r=s.raster?.rasterInfo??s.serviceRasterInfo,i=r?.attributeTable;if(null!=i){const{fields:t,features:r}=i,s=t.find((({name:e})=>"value"===e.toLowerCase())),o=e[a.servicePixelValue],l=s?r.find((e=>String(e.attributes[s.name])===o)):null;if(l)for(const i in l.attributes)if(l.attributes.hasOwnProperty(i)){e[n+i]=l.attributes[i]}}const l=r?.dataType;if("vector-magdir"!==l&&"vector-uv"!==l||(e[a.magnitude]=f?.[0],e[a.direction]=f?.[1]),"imagery-tile"===s.type){const{multidimensionalDefinition:t}=this.layer.normalizeRasterFetchOptions({timeExtent:this.timeExtent});o(s.rasterFields,e,t)}const p=new t({geometry:this.fullExtent?.clone(),attributes:e,layer:s,sourceLayer:s});c.push(p)}return c}async getSourceScale(){return await this.layer.load(),m(this.layer.serviceRasterInfo,this.view.spatialReference)}_getFullExtent(){return c(this.layer.serviceRasterInfo,this.view.spatialReference)}};return e([i()],d.prototype,"fullExtent",null),e([i()],d.prototype,"layer",void 0),e([i({readOnly:!0})],d.prototype,"timeExtent",null),e([i()],d.prototype,"tileInfo",void 0),e([i({readOnly:!0})],d.prototype,"hasTilingEffects",null),e([i()],d.prototype,"datumTransformation",null),d=e([s("esri.views.layers.ImageryTileLayerView")],d),d};export{f as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{_ as o}from"../../chunks/tslib.es6.js";import r from"../../core/Accessor.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";let t=class extends r{constructor(o){super(o),this.featureTitleFields=!1,this.utilityNetworkFields=!1,this.globalIdField=!1}};o([e()],t.prototype,"featureTitleFields",void 0),o([e()],t.prototype,"utilityNetworkFields",void 0),o([e()],t.prototype,"globalIdField",void 0),t=o([s("esri.views.support.RequiredFieldsOptions")],t);const i=t;export{i as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../core/Error.js";import"../../core/has.js";import e from"../../core/Logger.js";import{abortMaybe as i}from"../../core/maybe.js";import{isAbortError as r}from"../../core/promiseUtils.js";import{signal as s}from"../../core/signal.js";import{getTextureCompressionWorker as o,isCompressible as a}from"../support/TextureCompressionHelper.js";import{checkWebGLError as n}from"./checkWebGLError.js";import{TextureType as l,ResourceType as p,CompressedTextureFormat as m,TextureSamplingMode as h}from"./enums.js";import{GLObjectType as _}from"./GLObjectType.js";import{estimateMemory as d}from"./TextureDescriptor.js";import{isCompressedData as c,deriveInternalFormat as u,isTexImageSource as g,getDimensions as T,is3DTarget as x,validateTexture as E,isCompressedFormat as M,calcMipmapLevels as A,isSizedPixelFormat as f}from"./textureUtils.js";import{ValidatedTextureDescriptor as I}from"./ValidatedTextureDescriptor.js";const w=null,D=()=>e.getLogger("esri/views/webgl/Texture");let R=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}constructor(e,i=null,r=null){if(this.type=_.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,this._compressionAbortController=s(null),"context"in e)this._descriptor=e,r=i;else{const r=I.validate(e,i);if(!r)throw new t("Texture descriptor invalid");this._descriptor=r}this._descriptor.target===l.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return d(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}get isCompressing(){return null!==this._compressionAbortController.value}dispose(){this.abortCompression(),this._glName&&this._descriptor.context.instanceCounter.decrement(p.Texture,this),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,i){const r=this._descriptor;if(r.width!==e||r.height!==i){if(this._wasImmutablyAllocated)throw new t("Immutable textures can't be resized!");r.width=e,r.height=i,this._descriptor.target===l.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.shouldCompress=t}setData(t){return this.abortCompression(),!c(t)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in m&&(this._descriptor.internalFormat=void 0),this._setData(t),o()&&!c(t)&&a(t)&&this._descriptor.shouldCompress&&this.compressOnWorker(t),this.isCompressing}updateData(i,r,s,o,a,n,l=0){n||D().error("An attempt to use uninitialized data!"),this._glName||D().error("An attempt to update uninitialized texture!");const p=this._descriptor;p.internalFormat=u(p);const{context:m,pixelFormat:h,dataType:_,target:d,isImmutable:x}=p;if(x&&!this._wasImmutablyAllocated)throw new t("Cannot update immutable texture before allocation!");const E=m.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||s<0||r+o>p.width||s+a>p.height)&&D().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:M}=m;if(l&&(o&&a||D().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),M.pixelStorei(M.UNPACK_SKIP_ROWS,l)),g(n)){const{width:t,height:e}=T(n);t===o&&e===a||D().warn("The size of the data does not match the provided dimensions"),M.texSubImage2D(d,i,r,s,o,a,h,_,n)}else c(n)?M.compressedTexSubImage2D(d,i,r,s,o,a,p.internalFormat,n.levels[i]):M.texSubImage2D(d,i,r,s,o,a,h,_,n);l&&M.pixelStorei(M.UNPACK_SKIP_ROWS,0),m.bindTexture(E,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(i,r,s,o,a,n,l,p){p||D().error("An attempt to use uninitialized data!"),this._glName||D().error("An attempt to update an uninitialized texture!");const m=this._descriptor;m.internalFormat=u(m);const{context:h,pixelFormat:_,dataType:d,isImmutable:g,target:T}=m;if(g&&!this._wasImmutablyAllocated)throw new t("Cannot update immutable texture before allocation!");x(T)||D().warn("Attempting to set 3D texture data on a non-3D texture");const E=h.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);h.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||s<0||o<0||r+a>m.width||s+n>m.height||o+l>m.depth)&&D().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:M}=h;if(c(p))p=p.levels[i],M.compressedTexSubImage3D(T,i,r,s,o,a,n,l,m.internalFormat,p);else{const t=p;M.texSubImage3D(T,i,r,s,o,a,n,l,_,d,t)}h.bindTexture(E,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const i=this._descriptor;if(!i.hasMipmap){if(this._wasImmutablyAllocated)throw new t("Cannot add mipmaps to immutable texture after allocation");i.hasMipmap=!0,this._samplingModeDirty=!0,E(i)}i.samplingMode===h.LINEAR?(this._samplingModeDirty=!0,i.samplingMode=h.LINEAR_MIPMAP_NEAREST):i.samplingMode===h.NEAREST&&(this._samplingModeDirty=!0,i.samplingMode=h.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(i.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,E(e)}e.samplingMode===h.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=h.LINEAR):e.samplingMode===h.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=h.NEAREST)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,E(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1)}abortCompression(){this.isCompressing&&(this._compressionAbortController.value=i(this._compressionAbortController.value))}_setData(i,r){const s=this._descriptor,o=s.context?.gl;if(!o)return;n(o),this._glName||(this._glName=o.createTexture(),this._glName&&s.context.instanceCounter.increment(p.Texture,this)),E(s);const a=s.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);s.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),n(o);const l=r??s.target,m=x(l);if(g(i))this._setDataFromTexImageSource(i,l);else{const{width:e,height:r,depth:a}=s;if(null==e||null==r)throw new t("Width and height must be specified!");if(m&&null==a)throw new t("Depth must be specified!");if(s.internalFormat=u(s),s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,s.internalFormat,s.hasMipmap,e,r,a),c(i)){if(!M(s.internalFormat))throw new t("Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(i,s.internalFormat,l)}else this._texImage(l,0,s.internalFormat,e,r,a,i),n(o),s.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),n(o),s.context.bindTexture(a,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=l.TEXTURE_CUBE_MAP_POSITIVE_X;e<=l.TEXTURE_CUBE_MAP_NEGATIVE_Z;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=u(r);const s=x(e),{width:o,height:a,depth:l}=T(t);r.width&&r.height,r.width||(r.width=o),r.height||(r.height=a),s&&r.depth,s&&(r.depth=l),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,o,a,l),this._texImage(e,0,r.internalFormat,o,a,l,t),n(i),r.hasMipmap&&(this.generateMipmap(),n(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:s,height:o,depth:a}=r,n=t.levels,l=A(i,s,o,a),p=Math.min(l,n.length)-1;this._descriptor.context.gl.texParameteri(r.target,r.context.gl.TEXTURE_MAX_LEVEL,p),this._forEachMipmapLevel(((t,r,s,o)=>{const a=n[Math.min(t,n.length-1)];this._compressedTexImage(i,t,e,r,s,o,a)}),p)}_texStorage(e,i,r,s,o,a){const{gl:n}=this._descriptor.context;if(!f(i))throw new t("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?A(e,s,o,a):1;if(x(e)){if(null==a)throw new t("Missing depth dimension for 3D texture upload");n.texStorage3D(e,l,i,s,o,a)}else n.texStorage2D(e,l,i,s,o);this._wasImmutablyAllocated=!0}_texImage(e,i,r,s,o,a,n){const l=this._descriptor.context.gl,p=x(e),{isImmutable:m,pixelFormat:h,dataType:_}=this._descriptor;if(m){if(null!=n){const r=n;if(p){if(null==a)throw new t("Missing depth dimension for 3D texture upload");l.texSubImage3D(e,i,0,0,0,s,o,a,h,_,r)}else l.texSubImage2D(e,i,0,0,s,o,h,_,r)}}else{const m=n;if(p){if(null==a)throw new t("Missing depth dimension for 3D texture upload");l.texImage3D(e,i,r,s,o,a,0,h,_,m)}else l.texImage2D(e,i,r,s,o,0,h,_,m)}}_compressedTexImage(e,i,r,s,o,a,n){const l=this._descriptor.context.gl,p=x(e);if(this._descriptor.isImmutable){if(null!=n)if(p){if(null==a)throw new t("Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,i,0,0,0,s,o,a,r,n)}else l.compressedTexSubImage2D(e,i,0,0,s,o,r,n)}else if(p){if(null==a)throw new t("Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,i,r,s,o,a,0,n)}else l.compressedTexImage2D(e,i,r,s,o,0,n)}async compressOnWorker(t){const e=this._descriptor.context?.gl.getExtension("WEBGL_compressed_texture_etc"),i=this._descriptor.context?.gl.getExtension("WEBGL_compressed_texture_s3tc"),s=o();if(s&&(e||i)){const o=new AbortController;this._compressionAbortController.value=o;const a={data:await createImageBitmap(t),flipped:this.descriptor.flipped,width:t.width,height:t.height,hasMipmap:this._descriptor.hasMipmap,hasETC:!!e,hasS3TC:!!i};s.invoke(a,this._compressionAbortController.value.signal).then((t=>{t&&this.isCompressing&&this.glName&&(this._descriptor.internalFormat=t.internalFormat,this._setData(t.compressedTexture)),o===this._compressionAbortController.value&&(this._compressionAbortController.value=null)})).catch((t=>{r(t)||o!==this._compressionAbortController.value||(this._compressionAbortController.value=null)}))}}_forEachMipmapLevel(e,i=1/0){let{width:r,height:s,depth:o,hasMipmap:a,target:n}=this._descriptor;const p=n===l.TEXTURE_3D;if(null==r||null==s||p&&null==o)throw new t("Missing texture dimensions for mipmap calculation");for(let t=0;e(t,r,s,o),a&&(1!==r||1!==s||p&&1!==o)&&!(t>=i);++t)r=Math.max(1,r>>1),s=Math.max(1,s>>1),p&&(o=Math.max(1,o>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;i===h.LINEAR_MIPMAP_NEAREST||i===h.LINEAR_MIPMAP_LINEAR?(i=h.LINEAR,t.hasMipmap||(r=h.LINEAR)):i!==h.NEAREST_MIPMAP_NEAREST&&i!==h.NEAREST_MIPMAP_LINEAR||(i=h.NEAREST,t.hasMipmap||(r=h.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;if(!e)return;t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}};export{R as Texture,w as tracer};
5
+ import t from"../../core/Error.js";import"../../core/has.js";import e from"../../core/Logger.js";import{abortMaybe as i}from"../../core/maybe.js";import{isAbortError as r}from"../../core/promiseUtils.js";import{signal as s}from"../../core/signal.js";import{getTextureCompressionWorker as o,isCompressible as a}from"../support/TextureCompressionHelper.js";import{checkWebGLError as n}from"./checkWebGLError.js";import{TextureType as p,ResourceType as l,CompressedTextureFormat as m,TextureSamplingMode as h}from"./enums.js";import{GLObjectType as _}from"./GLObjectType.js";import{estimateMemory as d}from"./TextureDescriptor.js";import{isCompressedData as c,deriveInternalFormat as u,isTexImageSource as g,is3DTarget as T,validateTexture as x,isCompressedFormat as E,getDimensions as M,calcMipmapLevels as A,isSizedPixelFormat as I}from"./textureUtils.js";import{ValidatedTextureDescriptor as f}from"./ValidatedTextureDescriptor.js";const w=null,D=()=>e.getLogger("esri/views/webgl/Texture");let R=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}constructor(e,i=null,r=null){if(this.type=_.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,this._compressionAbortController=s(null),"context"in e)this._descriptor=e,r=i;else{const r=f.validate(e,i);if(!r)throw new t("Texture descriptor invalid");this._descriptor=r}this._descriptor.target===p.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return d(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}get isCompressing(){return null!==this._compressionAbortController.value}dispose(){this.abortCompression(),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.instanceCounter.decrement(l.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,i){const r=this._descriptor;if(r.width!==e||r.height!==i){if(this._wasImmutablyAllocated)throw new t("Immutable textures can't be resized!");r.width=e,r.height=i,this._descriptor.target===p.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.shouldCompress=t}setData(t){return this.abortCompression(),!c(t)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in m&&(this._descriptor.internalFormat=void 0),this._setData(t),o()&&!c(t)&&a(t)&&this._descriptor.shouldCompress&&this.compressOnWorker(t),this.isCompressing}updateData(i,r,s,o,a,n,p=0){n||D().error("An attempt to use uninitialized data!"),this._glName||D().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=u(l);const{context:m,pixelFormat:h,dataType:_,target:d,isImmutable:T}=l;if(T&&!this._wasImmutablyAllocated)throw new t("Cannot update immutable texture before allocation!");const x=m.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||s<0||r+o>l.width||s+a>l.height)&&D().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:E}=m;p&&(o&&a||D().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),E.pixelStorei(E.UNPACK_SKIP_ROWS,p)),g(n)?E.texSubImage2D(d,i,r,s,o,a,h,_,n):c(n)?E.compressedTexSubImage2D(d,i,r,s,o,a,l.internalFormat,n.levels[i]):E.texSubImage2D(d,i,r,s,o,a,h,_,n),p&&E.pixelStorei(E.UNPACK_SKIP_ROWS,0),m.bindTexture(x,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(i,r,s,o,a,n,p,l){l||D().error("An attempt to use uninitialized data!"),this._glName||D().error("An attempt to update an uninitialized texture!");const m=this._descriptor;m.internalFormat=u(m);const{context:h,pixelFormat:_,dataType:d,isImmutable:g,target:x}=m;if(g&&!this._wasImmutablyAllocated)throw new t("Cannot update immutable texture before allocation!");T(x)||D().warn("Attempting to set 3D texture data on a non-3D texture");const E=h.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);h.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||s<0||o<0||r+a>m.width||s+n>m.height||o+p>m.depth)&&D().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:M}=h;if(c(l))l=l.levels[i],M.compressedTexSubImage3D(x,i,r,s,o,a,n,p,m.internalFormat,l);else{const t=l;M.texSubImage3D(x,i,r,s,o,a,n,p,_,d,t)}h.bindTexture(E,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const i=this._descriptor;if(!i.hasMipmap){if(this._wasImmutablyAllocated)throw new t("Cannot add mipmaps to immutable texture after allocation");i.hasMipmap=!0,this._samplingModeDirty=!0,x(i)}i.samplingMode===h.LINEAR?(this._samplingModeDirty=!0,i.samplingMode=h.LINEAR_MIPMAP_NEAREST):i.samplingMode===h.NEAREST&&(this._samplingModeDirty=!0,i.samplingMode=h.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(i.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,x(e)}e.samplingMode===h.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=h.LINEAR):e.samplingMode===h.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=h.NEAREST)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,x(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1)}abortCompression(){this.isCompressing&&(this._compressionAbortController.value=i(this._compressionAbortController.value))}_setData(i,r){const s=this._descriptor,o=s.context?.gl;if(!o)return;n(o),this._glName||(this._glName=o.createTexture(),s.context.instanceCounter.increment(l.Texture,this)),x(s);const a=s.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);s.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),n(o);const p=r??s.target,m=T(p);if(g(i))this._setDataFromTexImageSource(i,p);else{const{width:e,height:r,depth:a}=s;if(null==e||null==r)throw new t("Width and height must be specified!");if(m&&null==a)throw new t("Depth must be specified!");if(s.internalFormat=u(s),s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(p,s.internalFormat,s.hasMipmap,e,r,a),c(i)){if(!E(s.internalFormat))throw new t("Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(i,s.internalFormat,p)}else this._texImage(p,0,s.internalFormat,e,r,a,i),n(o),s.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),n(o),s.context.bindTexture(a,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=p.TEXTURE_CUBE_MAP_POSITIVE_X;e<=p.TEXTURE_CUBE_MAP_NEGATIVE_Z;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=u(r);const s=T(e),{width:o,height:a,depth:p}=M(t);r.width&&r.height,r.width||(r.width=o),r.height||(r.height=a),s&&r.depth,s&&(r.depth=p),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,o,a,p),this._texImage(e,0,r.internalFormat,o,a,p,t),n(i),r.hasMipmap&&(this.generateMipmap(),n(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:s,height:o,depth:a}=r,n=t.levels,p=A(i,s,o,a),l=Math.min(p,n.length)-1;this._descriptor.context.gl.texParameteri(r.target,r.context.gl.TEXTURE_MAX_LEVEL,l),this._forEachMipmapLevel(((t,r,s,o)=>{const a=n[Math.min(t,n.length-1)];this._compressedTexImage(i,t,e,r,s,o,a)}),l)}_texStorage(e,i,r,s,o,a){const{gl:n}=this._descriptor.context;if(!I(i))throw new t("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const p=r?A(e,s,o,a):1;if(T(e)){if(null==a)throw new t("Missing depth dimension for 3D texture upload");n.texStorage3D(e,p,i,s,o,a)}else n.texStorage2D(e,p,i,s,o);this._wasImmutablyAllocated=!0}_texImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=T(e),{isImmutable:m,pixelFormat:h,dataType:_}=this._descriptor;if(m){if(null!=n){const r=n;if(l){if(null==a)throw new t("Missing depth dimension for 3D texture upload");p.texSubImage3D(e,i,0,0,0,s,o,a,h,_,r)}else p.texSubImage2D(e,i,0,0,s,o,h,_,r)}}else{const m=n;if(l){if(null==a)throw new t("Missing depth dimension for 3D texture upload");p.texImage3D(e,i,r,s,o,a,0,h,_,m)}else p.texImage2D(e,i,r,s,o,0,h,_,m)}}_compressedTexImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=T(e);if(this._descriptor.isImmutable){if(null!=n)if(l){if(null==a)throw new t("Missing depth dimension for 3D texture upload");p.compressedTexSubImage3D(e,i,0,0,0,s,o,a,r,n)}else p.compressedTexSubImage2D(e,i,0,0,s,o,r,n)}else if(l){if(null==a)throw new t("Missing depth dimension for 3D texture upload");p.compressedTexImage3D(e,i,r,s,o,a,0,n)}else p.compressedTexImage2D(e,i,r,s,o,0,n)}async compressOnWorker(t){const e=this._descriptor.context?.gl.getExtension("WEBGL_compressed_texture_etc"),i=this._descriptor.context?.gl.getExtension("WEBGL_compressed_texture_s3tc"),s=o();if(s&&(e||i)){const o=new AbortController;this._compressionAbortController.value=o;const a={data:await createImageBitmap(t),flipped:this.descriptor.flipped,width:t.width,height:t.height,hasMipmap:this._descriptor.hasMipmap,hasETC:!!e,hasS3TC:!!i};s.invoke(a,this._compressionAbortController.value.signal).then((t=>{t&&this.isCompressing&&this.glName&&(this._descriptor.internalFormat=t.internalFormat,this._setData(t.compressedTexture)),o===this._compressionAbortController.value&&(this._compressionAbortController.value=null)})).catch((t=>{r(t)||o!==this._compressionAbortController.value||(this._compressionAbortController.value=null)}))}}_forEachMipmapLevel(e,i=1/0){let{width:r,height:s,depth:o,hasMipmap:a,target:n}=this._descriptor;const l=n===p.TEXTURE_3D;if(null==r||null==s||l&&null==o)throw new t("Missing texture dimensions for mipmap calculation");for(let t=0;e(t,r,s,o),a&&(1!==r||1!==s||l&&1!==o)&&!(t>=i);++t)r=Math.max(1,r>>1),s=Math.max(1,s>>1),l&&(o=Math.max(1,o>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;i===h.LINEAR_MIPMAP_NEAREST||i===h.LINEAR_MIPMAP_LINEAR?(i=h.LINEAR,t.hasMipmap||(r=h.LINEAR)):i!==h.NEAREST_MIPMAP_NEAREST&&i!==h.NEAREST_MIPMAP_LINEAR||(i=h.NEAREST,t.hasMipmap||(r=h.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;if(!e)return;t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}};export{R as Texture,w as tracer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{getAssetUrl as t}from"../assets.js";import{when as s}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import{getBasemapThumbnailUrl as r,isBasemap3D as o,isBasemapInBeta as l}from"../support/basemapUtils.js";import n from"./Widget.js";import d from"./BasemapGallery/BasemapGalleryViewModel.js";import{css as p}from"./BasemapGallery/css.js";import{loadCalciteComponents as m}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import{Heading as h}from"./support/Heading.js";import{accessibleHandler as u}from"./support/decorators/accessibleHandler.js";import{messageBundle as g}from"./support/decorators/messageBundle.js";import{tsx as v}from"./support/jsxFactory.js";import"./support/widgetUtils.js";let b=class extends n{constructor(e,t){super(e,t),this.disabled=!1,this.headingLevel=2,this.messages=null,this.viewModel=new d,this._focusBasemapItemEnabled=!1}initialize(){this.addHandles(s((()=>this.source),(()=>this.viewModel.loadSource()),{sync:!0,initial:!0}))}loadDependencies(){return m({scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip")})}get activeBasemap(){return this.viewModel.activeBasemap}set activeBasemap(e){this.viewModel.activeBasemap=e}get icon(){return"basemap"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get source(){return this.viewModel.source}set source(e){this.viewModel.source=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e="loading"===this.source.state,t=this.disabled||"disabled"===this.viewModel.state,s={[p.sourceLoading]:e,[c.disabled]:t};return v("div",{class:this.classes(p.base,c.widget,c.panel,s),key:"container"},this._getContext())}_getContext(){if("unsupported"===this.viewModel.state)return v("div",{class:c.empty,key:"empty-message"},v(h,{level:this.headingLevel},this.messages.unsupported));if("loading"===this.source.state)return v("div",{class:p.loader,key:"loader"});const e=this.viewModel.items;return e.length>0?v("ul",{"aria-disabled":this.disabled,"aria-label":this.label,bind:this,class:p.itemContainer,key:"item-container",onkeydown:this._handleKeyDown,role:"radiogroup"},e.map(((e,t)=>this._renderBasemapGalleryItem(e,t))).toArray()):v("div",{class:c.empty,key:"empty-message"},v(h,{level:this.headingLevel},this.messages.noBasemaps))}_getRoundRobinIndex(e,t){return(e+t)%t}_handleKeyDown(e){const{key:t}=e;if(!["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(t))return;e.preventDefault();const{items:s,activeBasemapIndex:a}=this.viewModel,i="ArrowUp"===t||"ArrowLeft"===t?this._getRoundRobinIndex(Math.max(a-1,-1),s.length):this._getRoundRobinIndex(a+1,s.length),r=s.at(i);"ready"===r?.state&&(this.viewModel.activeBasemap=r.basemap),this._focusBasemapItemEnabled=!0}_focusBasemapItem(e){this._focusBasemapItemEnabled&&0===e.tabIndex&&(e.focus(),this._focusBasemapItemEnabled=!1)}_handleClick(e){const t=e.currentTarget["data-item"];"ready"===t.state&&(this.viewModel.activeBasemap=t.basemap)}_renderBasemapGalleryItem(e,s){const a=r(e.basemap)||t("esri/themes/base/images/basemap-toggle-64.svg"),i=e.basemap.title,l=e.basemap.portalItem?.snippet,n=e.error?.message||l||i,{viewModel:{state:d,activeBasemapIndex:m}}=this,h=this.disabled||"disabled"===d,u=m===s,g=u||-1===m&&0===s?0:-1,b="loading"===d,y={[p.selectedItem]:u,[p.itemError]:"error"===e.state},w=`basemapgallery-item-${e.uid}`;return v("li",{afterUpdate:this._focusBasemapItem,"aria-checked":u.toString(),"aria-disabled":h.toString(),"aria-labelledby":w,bind:this,class:this.classes(p.item,y),"data-item":e,key:e.uid,onclick:this._handleClick,onkeydown:this._handleClick,role:"radio",tabIndex:g,title:n},v("img",{alt:"",class:p.itemThumbnail,src:a}),v("div",{class:p.itemContent,key:"content"},v("div",{class:p.itemTitle,key:"title"},v("span",{id:w},i)),o(e.basemap)?this._renderTags(e.basemap):null),"loading"===e.state||u&&b?v("calcite-scrim",null,v("span",{"aria-hidden":"true",class:c.loaderAnimation,key:"loader",role:"presentation"})):null)}_renderTags(e){return v("div",{class:p.itemTagsContainer,key:"tag"},this._render3DTag(),l(e)?this._renderBetaTag():null)}_render3DTag(){const{messages:e}=this;return v("calcite-chip",{key:"tag-3d",label:e.tag3D,scale:"s"},this.messages.tag3D)}_renderBetaTag(){const{messages:e}=this;return v("calcite-chip",{appearance:"outline-fill",key:"tag-beta",label:e.tagBeta,scale:"s"},this.messages.tagBeta)}};e([a()],b.prototype,"activeBasemap",null),e([a()],b.prototype,"disabled",void 0),e([a()],b.prototype,"headingLevel",void 0),e([a()],b.prototype,"icon",null),e([a()],b.prototype,"label",null),e([a(),g("esri/widgets/BasemapGallery/t9n/BasemapGallery")],b.prototype,"messages",void 0),e([a()],b.prototype,"source",null),e([a()],b.prototype,"view",null),e([a()],b.prototype,"viewModel",void 0),e([a()],b.prototype,"_focusBasemapItemEnabled",void 0),e([u()],b.prototype,"_handleClick",null),b=e([i("esri.widgets.BasemapGallery")],b);const y=b;export{y as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{getAssetUrl as s}from"../assets.js";import{deprecateWidget as t}from"../core/deprecate.js";import a from"../core/Logger.js";import{when as i}from"../core/reactiveUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import{getBasemapThumbnailUrl as l,isBasemap3D as n,isBasemapInBeta as d}from"../support/basemapUtils.js";import p from"./Widget.js";import m from"./BasemapGallery/BasemapGalleryViewModel.js";import{css as c}from"./BasemapGallery/css.js";import{loadCalciteComponents as h}from"./support/componentsUtils.js";import{globalCss as u}from"./support/globalCss.js";import{Heading as g}from"./support/Heading.js";import{accessibleHandler as v}from"./support/decorators/accessibleHandler.js";import{messageBundle as b}from"./support/decorators/messageBundle.js";import{tsx as y}from"./support/jsxFactory.js";import"./support/widgetUtils.js";let w=class extends p{constructor(e,s){super(e,s),this.disabled=!1,this.headingLevel=2,this.messages=null,this.viewModel=new m,this._focusBasemapItemEnabled=!1,t(a.getLogger(this),"Basemap Gallery","arcgis-basemap-gallery",{version:"4.32"})}initialize(){this.addHandles(i((()=>this.source),(()=>this.viewModel.loadSource()),{sync:!0,initial:!0}))}loadDependencies(){return h({scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip")})}get activeBasemap(){return this.viewModel.activeBasemap}set activeBasemap(e){this.viewModel.activeBasemap=e}get icon(){return"basemap"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get source(){return this.viewModel.source}set source(e){this.viewModel.source=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e="loading"===this.source.state,s=this.disabled||"disabled"===this.viewModel.state,t={[c.sourceLoading]:e,[u.disabled]:s};return y("div",{class:this.classes(c.base,u.widget,u.panel,t),key:"container"},this._getContext())}_getContext(){if("unsupported"===this.viewModel.state)return y("div",{class:u.empty,key:"empty-message"},y(g,{level:this.headingLevel},this.messages.unsupported));if("loading"===this.source.state)return y("div",{class:c.loader,key:"loader"});const e=this.viewModel.items;return e.length>0?y("ul",{"aria-disabled":this.disabled,"aria-label":this.label,bind:this,class:c.itemContainer,key:"item-container",onkeydown:this._handleKeyDown,role:"radiogroup"},e.map(((e,s)=>this._renderBasemapGalleryItem(e,s))).toArray()):y("div",{class:u.empty,key:"empty-message"},y(g,{level:this.headingLevel},this.messages.noBasemaps))}_getRoundRobinIndex(e,s){return(e+s)%s}_handleKeyDown(e){const{key:s}=e;if(!["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(s))return;e.preventDefault();const{items:t,activeBasemapIndex:a}=this.viewModel,i="ArrowUp"===s||"ArrowLeft"===s?this._getRoundRobinIndex(Math.max(a-1,-1),t.length):this._getRoundRobinIndex(a+1,t.length),r=t.at(i);"ready"===r?.state&&(this.viewModel.activeBasemap=r.basemap),this._focusBasemapItemEnabled=!0}_focusBasemapItem(e){this._focusBasemapItemEnabled&&0===e.tabIndex&&(e.focus(),this._focusBasemapItemEnabled=!1)}_handleClick(e){const s=e.currentTarget["data-item"];"ready"===s.state&&(this.viewModel.activeBasemap=s.basemap)}_renderBasemapGalleryItem(e,t){const a=l(e.basemap)||s("esri/themes/base/images/basemap-toggle-64.svg"),i=e.basemap.title,r=e.basemap.portalItem?.snippet,o=e.error?.message||r||i,{viewModel:{state:d,activeBasemapIndex:p}}=this,m=this.disabled||"disabled"===d,h=p===t,g=h||-1===p&&0===t?0:-1,v="loading"===d,b={[c.selectedItem]:h,[c.itemError]:"error"===e.state},w=`basemapgallery-item-${e.uid}`;return y("li",{afterUpdate:this._focusBasemapItem,"aria-checked":h.toString(),"aria-disabled":m.toString(),"aria-labelledby":w,bind:this,class:this.classes(c.item,b),"data-item":e,key:e.uid,onclick:this._handleClick,onkeydown:this._handleClick,role:"radio",tabIndex:g,title:o},y("img",{alt:"",class:c.itemThumbnail,src:a}),y("div",{class:c.itemContent,key:"content"},y("div",{class:c.itemTitle,key:"title"},y("span",{id:w},i)),n(e.basemap)?this._renderTags(e.basemap):null),"loading"===e.state||h&&v?y("calcite-scrim",null,y("span",{"aria-hidden":"true",class:u.loaderAnimation,key:"loader",role:"presentation"})):null)}_renderTags(e){return y("div",{class:c.itemTagsContainer,key:"tag"},this._render3DTag(),d(e)?this._renderBetaTag():null)}_render3DTag(){const{messages:e}=this;return y("calcite-chip",{key:"tag-3d",label:e.tag3D,scale:"s"},this.messages.tag3D)}_renderBetaTag(){const{messages:e}=this;return y("calcite-chip",{appearance:"outline-fill",key:"tag-beta",label:e.tagBeta,scale:"s"},this.messages.tagBeta)}};e([r()],w.prototype,"activeBasemap",null),e([r()],w.prototype,"disabled",void 0),e([r()],w.prototype,"headingLevel",void 0),e([r()],w.prototype,"icon",null),e([r()],w.prototype,"label",null),e([r(),b("esri/widgets/BasemapGallery/t9n/BasemapGallery")],w.prototype,"messages",void 0),e([r()],w.prototype,"source",null),e([r()],w.prototype,"view",null),e([r()],w.prototype,"viewModel",void 0),e([r()],w.prototype,"_focusBasemapItemEnabled",void 0),e([v()],w.prototype,"_handleClick",null),w=e([o("esri.widgets.BasemapGallery")],w);const f=w;export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import{cast as s}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import{getBasemapThumbnailUrl as o}from"../support/basemapUtils.js";import a from"./Widget.js";import l from"./BasemapToggle/BasemapToggleViewModel.js";import{css as r}from"./BasemapToggle/css.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as p}from"./support/decorators/messageBundle.js";import{tsx as m}from"./support/jsxFactory.js";function d(e){const t=o(e);return t?{backgroundImage:"url("+t+")"}:{backgroundImage:""}}const u={title:!1};let g=class extends a{constructor(e,t){super(e,t),this.messages=null,this.viewModel=new l,this.visibleElements={...u},this.toggle=()=>this.viewModel.toggle()}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim")})}get activeBasemap(){return this.viewModel.activeBasemap}get icon(){return"layer-basemap"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get nextBasemap(){return this.viewModel.nextBasemap}set nextBasemap(e){this.viewModel.nextBasemap=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}castVisibleElements(e){return{...u,...e}}render(){const e=this.viewModel,t="disabled"===e.state?null:e.activeBasemap,s="disabled"===e.state?null:e.nextBasemap,i="loading"===e.state,o="incompatible-next-basemap"===e.state,a=s?.title??"",l=s&&"loaded"!==s.loadStatus;let n;const p=this.visibleElements.title&&a,u=o;return(p||u)&&(n=m("div",{class:r.overlay,key:"overlay"},p?m("span",{class:r.title,title:a},a):null,u?m("calcite-scrim",{class:r.overlayScrim,title:this.messages.incompatibleSpatialReference},m("calcite-icon",{icon:"exclamation-mark-triangle"})):null)),m("div",{class:this.classes(r.base,c.widget)},m("calcite-button",{appearance:"transparent","data-basemap-id":s?s.id:"",disabled:o,kind:"neutral",label:this.label,onclick:()=>{this.toggle()},title:this.label},m("div",{class:this.classes(r.container,r.secondaryBasemapImage)},m("div",{class:r.image,styles:d(t)})),m("div",{class:r.container},m("div",{class:this.classes(r.image,l?r.imageLoading:null),styles:d(s)},l||i?m("calcite-scrim",null,m("span",{"aria-hidden":"true",class:c.loaderAnimation,role:"presentation"})):null),n)))}};e([t({readOnly:!0})],g.prototype,"activeBasemap",null),e([t()],g.prototype,"icon",null),e([t()],g.prototype,"label",null),e([t(),p("esri/widgets/BasemapToggle/t9n/BasemapToggle")],g.prototype,"messages",void 0),e([t()],g.prototype,"nextBasemap",null),e([t()],g.prototype,"view",null),e([t({type:l})],g.prototype,"viewModel",void 0),e([t()],g.prototype,"visibleElements",void 0),e([s("visibleElements")],g.prototype,"castVisibleElements",null),g=e([i("esri.widgets.BasemapToggle")],g);const v=g;export{v as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{deprecateWidget as t}from"../core/deprecate.js";import s from"../core/Logger.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import{cast as i}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import{getBasemapThumbnailUrl as l}from"../support/basemapUtils.js";import r from"./Widget.js";import n from"./BasemapToggle/BasemapToggleViewModel.js";import{css as c}from"./BasemapToggle/css.js";import{loadCalciteComponents as p}from"./support/componentsUtils.js";import{globalCss as m}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as d}from"./support/decorators/messageBundle.js";import{tsx as g}from"./support/jsxFactory.js";function u(e){const t=l(e);return t?{backgroundImage:"url("+t+")"}:{backgroundImage:""}}const v={title:!1};let b=class extends r{constructor(e,o){super(e,o),this.messages=null,this.viewModel=new n,this.visibleElements={...v},this.toggle=()=>this.viewModel.toggle(),t(s.getLogger(this),"Basemap Toggle","arcgis-basemap-toggle",{version:"4.32"})}loadDependencies(){return p({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim")})}get activeBasemap(){return this.viewModel.activeBasemap}get icon(){return"layer-basemap"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get nextBasemap(){return this.viewModel.nextBasemap}set nextBasemap(e){this.viewModel.nextBasemap=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}castVisibleElements(e){return{...v,...e}}render(){const e=this.viewModel,t="disabled"===e.state?null:e.activeBasemap,s="disabled"===e.state?null:e.nextBasemap,o="loading"===e.state,i="incompatible-next-basemap"===e.state,a=s?.title??"",l=s&&"loaded"!==s.loadStatus;let r;const n=this.visibleElements.title&&a,p=i;return(n||p)&&(r=g("div",{class:c.overlay,key:"overlay"},n?g("span",{class:c.title,title:a},a):null,p?g("calcite-scrim",{class:c.overlayScrim,title:this.messages.incompatibleSpatialReference},g("calcite-icon",{icon:"exclamation-mark-triangle"})):null)),g("div",{class:this.classes(c.base,m.widget)},g("calcite-button",{appearance:"transparent","data-basemap-id":s?s.id:"",disabled:i,kind:"neutral",label:this.label,onclick:()=>{this.toggle()},title:this.label},g("div",{class:this.classes(c.container,c.secondaryBasemapImage)},g("div",{class:c.image,styles:u(t)})),g("div",{class:c.container},g("div",{class:this.classes(c.image,l?c.imageLoading:null),styles:u(s)},l||o?g("calcite-scrim",null,g("span",{"aria-hidden":"true",class:m.loaderAnimation,role:"presentation"})):null),r)))}};e([o({readOnly:!0})],b.prototype,"activeBasemap",null),e([o()],b.prototype,"icon",null),e([o()],b.prototype,"label",null),e([o(),d("esri/widgets/BasemapToggle/t9n/BasemapToggle")],b.prototype,"messages",void 0),e([o()],b.prototype,"nextBasemap",null),e([o()],b.prototype,"view",null),e([o({type:n})],b.prototype,"viewModel",void 0),e([o()],b.prototype,"visibleElements",void 0),e([i("visibleElements")],b.prototype,"castVisibleElements",null),b=e([a("esri.widgets.BasemapToggle")],b);const h=b;export{h as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{createTask as t}from"../../core/asyncUtils.js";import r from"../../core/Collection.js";import s from"../../core/Error.js";import i from"../../core/Evented.js";import a from"../../core/Logger.js";import{abortMaybe as o}from"../../core/maybe.js";import{throwIfAborted as n}from"../../core/promiseUtils.js";import p from"../../core/ReactiveMap.js";import{on as l,watch as u,whenOnce as m,sync as h}from"../../core/reactiveUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as _}from"../../core/support/UpdatingHandles.js";import f from"../../geometry/SpatialReference.js";import{system as v}from"../../time/timeZoneUtils.js";import{createReactiveGraphic as F}from"./batchAttributeFormUtils.js";import{ArcadeExecutorProvider as g}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as y}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as I}from"./expressions/ExpressionsModel.js";import{BatchFormInputs as E}from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as w}from"./inputs/support/createBatchFormInputs.js";import{NoVisibleElementCodes as x,InputVisibilityCode as M}from"./inputs/support/inputUtils.js";import T from"./templates/BatchFormTemplate.js";import{createBatchFormTemplate as k}from"./templates/support/createBatchFormTemplate.js";let b=class extends i.EventedAccessor{constructor(e){super(e),this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new r,this.map=null,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this._arcadeExecutorProvider=new g,this._activeFormInputsByElementId=new Map,this._emptyForm=new E({inputs:[]}),this._emptyFormTemplate=new T({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new p,this._updatingHandles=new _,this._layerTemplateMap=new p,this._workingFeatures=new r,this._expressionsManager=new y({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:v}}),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.addHandles([l((()=>this.features),"after-changes",(()=>this._prepare()),{sync:!0}),u((()=>[this.features,this.map,this.timeZone,this.editType]),(()=>{this._prepare()}),h),u((()=>this.activeForm),(()=>this._activeFormInputsByElementId.clear()),h)]),this._prepare()}destroy(){this._prepareTask=o(this._prepareTask),this._workingFeatures.destroyAll(),this._expressionsManager&&this._expressionsManager.abort(),this._reactiveGraphicLookup=new p,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 r=this._makeBatchFormInputsForFeature(e);return r!==this._emptyForm&&this._featureFormMap.set(e,r),r}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 invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.activeForm.inputs.filter((e=>e.visible)).length>0}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return x.noElements;const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case M.HIDDEN_NOT_IN_ALL_LAYERS:case M.HIDDEN_NO_DOMAIN_IN_COMMON:e.add(x.noElementsInCommon);break;case M.HIDDEN_FIELD_DEFINITION:case M.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL:case M.HIDDEN_VISIBILITY_EXPRESSION_ALL:e.add(x.allElementsHidden);break;case M.HIDDEN_GROUP_VISIBILITY_EXPRESSION_SOME:case M.HIDDEN_VISIBILITY_EXPRESSION_SOME:return x.elementsHiddenInSome}return e.has(x.allElementsHidden)?x.allElementsHidden:x.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 r=t.sourceLayer??t.layer;e.add(r)})),Array.from(e)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){this.submitHasBeenAttempted=!0,this.emit("submit",{})}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const r=this.activeForm.allFieldInputs.find((t=>t.template.elementId===e));return void 0!==r?(t.set(e,r),r):void 0}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._workingFeatures.find((({original:t})=>t===e));if(!t)throw new s("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}setFieldInputValue(e,t){const r=new Set(this.invalidFeatures);e.setValueFromUser(t),this.userHasChangedValues=!0,this._trackValidityChange(r),this.emit("value-change",{features:e.features.toArray().map((e=>e.original)),fieldName:e.fieldName,name:"value-change",value:t})}setValue(e,t){const r=this.findFieldInput(e);if(null==r)throw new s("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);this.setFieldInputValue(r,t)}userChangesHaveMadeFeatureInvalid(e){return!!this._reactiveGraphicLookup.get(e)?.userChangesHaveMadeInvalid}async _trackValidityChange(e){await m((()=>!1===this.calculating));const t=this.invalidFeatures;for(const r of t)!1===e.has(r)&&this._reactiveGraphicLookup.has(r)&&(this._reactiveGraphicLookup.get(r).userChangesHaveMadeInvalid=!0)}validate(){return!1}getCodedValueOptions(e){return e.codedValues.map((({name:e,code:t})=>({name:e,value:t})))}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?w(t,new r([e]),this._expressionsManager):this._emptyForm}async _prepare(){this._prepareTask=o(this._prepareTask),this._updateWorkingFeatures(),o(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new y({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 r=t((async t=>{try{n(t);const r=new Map;for(const t of e){const e=await k(t,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this._effectiveTimeZone});this._layerTemplateMap.set(t,e),this._expressionsManager.layerExpressionsModelMap.set(t,new I({preserveFieldValuesWhenHidden:e.preserveFieldValuesWhenHidden,executorMap:e.getExpressionExecutorsForLayer(t)}));for(const t of e.elements){const{elementId:e}=t;r.has(e)?r.get(e).foldIn(t):r.set(e,t.clone())}}const s=new T({elements:Array.from(r.values())});this.sharedFormTemplate=s,this.sharedForm=w(s,this._workingFeatures,this._expressionsManager),await this._expressionsManager.runAllExpressions(this._workingFeatures)}catch(r){throw a.getLogger(this).error("Failed preparing form",r),r}}));this._updatingHandles.addPromise(r.promise),this._prepareTask=r}_updateWorkingFeatures(){this._workingFeatures.destroyAll();const{features:e}=this;if(this._reactiveGraphicLookup=new p,0!==e.length){this._workingFeatures.addMany(e.map(F));for(const e of this._workingFeatures)this._reactiveGraphicLookup.set(e.original,e)}}};e([d()],b.prototype,"_effectiveTimeZone",null),e([d({readOnly:!0})],b.prototype,"activeFeature",null),e([d()],b.prototype,"activeFeatureIndex",void 0),e([d({readOnly:!0})],b.prototype,"activeForm",null),e([d()],b.prototype,"disabled",void 0),e([d()],b.prototype,"calculating",null),e([d()],b.prototype,"editType",void 0),e([d()],b.prototype,"features",void 0),e([d()],b.prototype,"expressionEvaluationFailed",null),e([d()],b.prototype,"hasNonActiveInvalidFeatures",null),e([d()],b.prototype,"invalidFeatures",null),e([d()],b.prototype,"hasVisibleInputs",null),e([d()],b.prototype,"map",void 0),e([d()],b.prototype,"noVisibleElementsReason",null),e([d()],b.prototype,"spatialReference",void 0),e([d()],b.prototype,"submitHasBeenAttempted",void 0),e([d()],b.prototype,"timeZone",void 0),e([d()],b.prototype,"updating",null),e([d()],b.prototype,"valid",null),e([d()],b.prototype,"layers",null),e([d()],b.prototype,"mode",null),e([d()],b.prototype,"sharedForm",void 0),e([d()],b.prototype,"sharedFormTemplate",void 0),e([d()],b.prototype,"userHasChangedValues",void 0),e([d()],b.prototype,"_arcadeExecutorProvider",void 0),e([d()],b.prototype,"_prepareTask",void 0),e([d()],b.prototype,"_reactiveGraphicLookup",void 0),e([d()],b.prototype,"_layerTemplateMap",void 0),e([d()],b.prototype,"_workingFeatures",void 0),e([d()],b.prototype,"_expressionsManager",void 0),b=e([c("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],b);const H=b;export{H as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{createTask as t}from"../../core/asyncUtils.js";import r from"../../core/Collection.js";import s from"../../core/Error.js";import i from"../../core/Evented.js";import a from"../../core/Logger.js";import{abortMaybe as o}from"../../core/maybe.js";import{throwIfAborted as n}from"../../core/promiseUtils.js";import p from"../../core/ReactiveMap.js";import{on as l,watch as u,whenOnce as h,sync as m}from"../../core/reactiveUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import v from"../../geometry/SpatialReference.js";import{system as _}from"../../time/timeZoneUtils.js";import{createReactiveGraphic as F}from"./batchAttributeFormUtils.js";import{ArcadeExecutorProvider as g}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as y}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as I}from"./expressions/ExpressionsModel.js";import{BatchFormInputs as E}from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as w}from"./inputs/support/createBatchFormInputs.js";import{NoVisibleElementCodes as b,InputVisibilityCode as x,isGroupInput as M,isFieldInput as T}from"./inputs/support/inputUtils.js";import k from"./templates/BatchFormTemplate.js";import{createBatchFormTemplate as H}from"./templates/support/createBatchFormTemplate.js";let V=class extends i.EventedAccessor{constructor(e){super(e),this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new r,this.map=null,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this._arcadeExecutorProvider=new g,this._activeFormInputsByElementId=new Map,this._emptyForm=new E({inputs:[]}),this._emptyFormTemplate=new k({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new p,this._updatingHandles=new f,this._layerTemplateMap=new p,this._workingFeatures=new r,this._expressionsManager=new y({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:_}}),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.addHandles([l((()=>this.features),"after-changes",(()=>this._prepare()),{sync:!0}),u((()=>[this.features,this.map,this.timeZone,this.editType]),(()=>{this._prepare()}),m),u((()=>this.activeForm),(()=>this._activeFormInputsByElementId.clear()),m)]),this._prepare()}destroy(){this._prepareTask=o(this._prepareTask),this._workingFeatures.destroyAll(),this._expressionsManager&&this._expressionsManager.abort(),this._reactiveGraphicLookup=new p,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 r=this._makeBatchFormInputsForFeature(e);return r!==this._emptyForm&&this._featureFormMap.set(e,r),r}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 invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.visibleInputs.length>0}get visibleInputs(){return this.activeForm.inputs.filter((e=>e.visible))}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return b.noElements;const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case x.HIDDEN_NOT_IN_ALL_LAYERS:case x.HIDDEN_NO_DOMAIN_IN_COMMON:e.add(b.noElementsInCommon);break;case x.HIDDEN_FIELD_DEFINITION:case x.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL:case x.HIDDEN_VISIBILITY_EXPRESSION_ALL:e.add(b.allElementsHidden);break;case x.HIDDEN_GROUP_VISIBILITY_EXPRESSION_SOME:case x.HIDDEN_VISIBILITY_EXPRESSION_SOME:return b.elementsHiddenInSome}return e.has(b.allElementsHidden)?b.allElementsHidden:b.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 r=t.sourceLayer??t.layer;e.add(r)})),Array.from(e)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){this.submitHasBeenAttempted=!0,this.emit("submit",{})}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const r=this.activeForm.allFieldInputs.find((t=>t.template.elementId===e));return void 0!==r?(t.set(e,r),r):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const e of this.visibleInputs){if(M(e)){const t=e.inputs.find((e=>!e.valid));if(t)return{input:t,groupInput:e}}if(T(e)&&!e.valid)return{input:e}}}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._workingFeatures.find((({original:t})=>t===e));if(!t)throw new s("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}setFieldInputValue(e,t){const r=new Set(this.invalidFeatures);e.setValueFromUser(t),this.userHasChangedValues=!0,this._trackValidityChange(r),this.emit("value-change",{features:e.features.toArray().map((e=>e.original)),fieldName:e.fieldName,name:"value-change",value:t})}setValue(e,t){const r=this.findFieldInput(e);if(null==r)throw new s("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);this.setFieldInputValue(r,t)}userChangesHaveMadeFeatureInvalid(e){return!!this._reactiveGraphicLookup.get(e)?.userChangesHaveMadeInvalid}async _trackValidityChange(e){await h((()=>!1===this.calculating));const t=this.invalidFeatures;for(const r of t)!1===e.has(r)&&this._reactiveGraphicLookup.has(r)&&(this._reactiveGraphicLookup.get(r).userChangesHaveMadeInvalid=!0)}validate(){return!1}getCodedValueOptions(e){return e.codedValues.map((({name:e,code:t})=>({name:e,value:t})))}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?w(t,new r([e]),this._expressionsManager):this._emptyForm}async _prepare(){this._prepareTask=o(this._prepareTask),this._updateWorkingFeatures(),o(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new y({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??v.WebMercator,map:this.map,timeZone:this._effectiveTimeZone}});const{layers:e}=this;if(0===e.length)return;const r=t((async t=>{try{n(t);const r=new Map;for(const t of e){const e=await H(t,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this._effectiveTimeZone});this._layerTemplateMap.set(t,e),this._expressionsManager.layerExpressionsModelMap.set(t,new I({preserveFieldValuesWhenHidden:e.preserveFieldValuesWhenHidden,executorMap:e.getExpressionExecutorsForLayer(t)}));for(const t of e.elements){const{elementId:e}=t;r.has(e)?r.get(e).foldIn(t):r.set(e,t.clone())}}const s=new k({elements:Array.from(r.values())});this.sharedFormTemplate=s,this.sharedForm=w(s,this._workingFeatures,this._expressionsManager),await this._expressionsManager.runAllExpressions(this._workingFeatures)}catch(r){throw a.getLogger(this).error("Failed preparing form",r),r}}));this._updatingHandles.addPromise(r.promise),this._prepareTask=r}_updateWorkingFeatures(){this._workingFeatures.destroyAll();const{features:e}=this;if(this._reactiveGraphicLookup=new p,0!==e.length){this._workingFeatures.addMany(e.map(F));for(const e of this._workingFeatures)this._reactiveGraphicLookup.set(e.original,e)}}};e([d()],V.prototype,"_effectiveTimeZone",null),e([d({readOnly:!0})],V.prototype,"activeFeature",null),e([d()],V.prototype,"activeFeatureIndex",void 0),e([d({readOnly:!0})],V.prototype,"activeForm",null),e([d()],V.prototype,"disabled",void 0),e([d()],V.prototype,"calculating",null),e([d()],V.prototype,"editType",void 0),e([d()],V.prototype,"features",void 0),e([d()],V.prototype,"expressionEvaluationFailed",null),e([d()],V.prototype,"hasNonActiveInvalidFeatures",null),e([d()],V.prototype,"invalidFeatures",null),e([d()],V.prototype,"hasVisibleInputs",null),e([d()],V.prototype,"visibleInputs",null),e([d()],V.prototype,"map",void 0),e([d()],V.prototype,"noVisibleElementsReason",null),e([d()],V.prototype,"spatialReference",void 0),e([d()],V.prototype,"submitHasBeenAttempted",void 0),e([d()],V.prototype,"timeZone",void 0),e([d()],V.prototype,"updating",null),e([d()],V.prototype,"valid",null),e([d()],V.prototype,"layers",null),e([d()],V.prototype,"mode",null),e([d()],V.prototype,"sharedForm",void 0),e([d()],V.prototype,"sharedFormTemplate",void 0),e([d()],V.prototype,"userHasChangedValues",void 0),e([d()],V.prototype,"_arcadeExecutorProvider",void 0),e([d()],V.prototype,"_prepareTask",void 0),e([d()],V.prototype,"_reactiveGraphicLookup",void 0),e([d()],V.prototype,"_layerTemplateMap",void 0),e([d()],V.prototype,"_workingFeatures",void 0),e([d()],V.prototype,"_expressionsManager",void 0),V=e([c("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],V);const j=V;export{j as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import"../core/has.js";import{abortHandle as t}from"../core/handleUtils.js";import{getOrCreateMapValue as i}from"../core/MapUtils.js";import{watch as n,whenOnce as o}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{isString as r}from"../support/guards.js";import l from"./Widget.js";import{getHiddenFieldsValidationErrorMessage as d,getVisibleFieldInputValidationErrorMessage as p,isElementTemplateWithInputType as u}from"./BatchAttributeForm/batchAttributeFormUtils.js";import c from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as m}from"./BatchAttributeForm/css.js";import{VisibleElements as h}from"./BatchAttributeForm/VisibleElements.js";import{InputVisibilityCode as v,isGroupInput as b,isFieldInput as f,differentValuesString as C}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{loadCalciteComponents as _}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as g,prepareISOFieldValueForDateComponents as I,prepareUnixFieldValueForDateComponents as y,normalizeTimeOnlyString as w,getISOFieldValueFromDateComponents as F,getUnixFieldValueFromDateComponents as x}from"./support/dateUtils.js";import{globalCss as k}from"./support/globalCss.js";import{setFocus as M}from"./support/widgetUtils.js";import{messageBundle as D}from"./support/decorators/messageBundle.js";import{vmEvent as O}from"./support/decorators/vmEvent.js";import{tsx as T}from"./support/jsxFactory.js";import{isEmptyValue as V}from"./support/forms/formUtils.js";import{substitute as E}from"../intl/substitute.js";const S="data-element-id";let U=class extends l{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.readOnly=!1,this.viewModel=new c,this.visibleElements=new h,this.groupDisplay="all",this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._batchSwitchInputInitialValues=new Map,this._saveInput=this._saveInput.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentUpdate=this._afterDateComponentUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([n((()=>this.features),(()=>{this._dateComponentMap.clear();const e=new AbortController;o((()=>!this.viewModel.updating),e.signal).then((()=>{this._attemptFocusOnNextRender=!0})),this.addHandles(t(e))})),n((()=>this.viewModel.activeForm),(()=>{this._batchSwitchInputInitialValues.clear()}))])}loadDependencies(){return _({input:()=>import("@esri/calcite-components/dist/components/calcite-input"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")})}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get _effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}gotoClosestError(){}render(){const{status:e}=this.viewModel;return"failed"===e?T("div",{class:this.classes(m.base,k.widget,k.panel)},T("calcite-notice",{class:m.noticeError,icon:!0,kind:"warning",open:!0},T("div",{slot:"message"},this.messages.formFailedToLoad))):this.viewModel.expressionEvaluationFailed?T("div",{class:this.classes(m.base,k.widget,k.panel)},T("calcite-notice",{class:m.noticeError,icon:!0,kind:"warning",open:!0},T("div",{slot:"message"},this.messages.expressionEvaluationFailed))):T("div",{class:this.classes(m.base,k.widget,k.panel)},"loaded"===e?this._renderForm():"loading"===e?T("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):null)}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:n}=e.dataset,o=this._getCalciteElementFromDateTimeTimeZonePicker(e,t);if(!o)return;const a=i(this._dateComponentMap,`${n}`,(()=>({placeholder:{date:"",time:"",timeZone:""}})));switch(a.placeholder[t]=o.placeholder??"",t){case"date":a.date=e;break;case"time":a.time=e;break;case"timeZone":a.timeZone=e,a.defaultComboboxItemElements=o.selectedItems}"timeZone"===t&&(a.defaultComboboxItemElements=o.selectedItems)}_getCalciteElementFromDateTimeTimeZonePicker(e,t){const i=e.shadowRoot;return i?"timeZone"===t?i.querySelector("calcite-combobox"):i.querySelector("calcite-input-text"):null}_updateDateTimeOrTimeZoneShadowDom(e,t){const{datePart:i,elementId:n}=e.dataset,o=this._dateComponentMap.get(`${n}`);if(!o)return;const a=this._getCalciteElementFromDateTimeTimeZonePicker(e,i);if(a)switch(i){case"date":case"time":a.placeholder=t?this.messages.differentValues:o.placeholder[i];break;case"timeZone":t?(a.value="",a.placeholder=this.messages.differentValues):(!a.selectedItems.length&&o.defaultComboboxItemElements?.length&&(a.selectedItems[0]=o.defaultComboboxItemElements[0]),a.placeholder=o.placeholder[i])}}_renderForm(){return T("form",{onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),this._renderContent())}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:i}=e;let n;if(!e.userHasChangedValues&&!e.submitHasBeenAttempted)return null;if(i.invalidHiddenInputs.length>0)if(n=d(i,e.mode,this.messages),"batch"===this.viewModel.mode){const e=i.invalidHiddenInputs.filter((e=>e.effectiveVisibilityCode===v.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL||e.visibilityCode===v.HIDDEN_VISIBILITY_EXPRESSION_ALL));e.length>0?n+=` (${e.map((e=>e.label)).join(", ")})`:n=this.messages.validationErrors.featuresInError}else n+=` (${i.invalidHiddenInputs.map((e=>e.label)).join(", ")})`;else if(t)if(this.viewModel.submitHasBeenAttempted)n=this.messages.validationErrors.featuresInError;else{this.viewModel.invalidFeatures.filter((e=>e!==this.viewModel.activeFeature&&!0===this.viewModel.userChangesHaveMadeFeatureInvalid(e))).length>0&&(n=this.messages.validationErrors.featuresInError)}return n?T("calcite-notice",{class:m.noticeError,icon:!0,kind:"warning",open:!0},T("div",{slot:"message"},n)):null}_renderContent(){if(!this.viewModel.hasVisibleInputs)return[T("calcite-notice",{class:m.noticeError,icon:!0,kind:"warning",open:!0},T("div",{slot:"message"},this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason]))];const{inputs:e}=this.viewModel.activeForm;return e.filter((e=>e.visible)).map((e=>this._renderInput(e)))}_renderInput(e){return b(e)?this._renderGroupInput(e):f(e)?this._renderLabeledField(e):void 0}_renderGroupInput(e){const{inputs:t,template:i,open:n}=e,o=t.filter((e=>e.visible)),a=i.label??"";return T("calcite-block",{class:this.classes(m.group,"sequential"===this.groupDisplay?m.groupSequential:null,this.disabled?m.inputDisabled:null),collapsible:!0,description:i.description??void 0,disabled:this._effectiveDisabled,heading:a,headingLevel:this.headingLevel,key:`{${i.elementId}-key}`,label:a,open:n,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0}},o.map((e=>this._renderInput(e))))}_renderLabeledField(e){const{label:t,elementId:i}=e.template,{required:n,dataType:o}=e,a=n?E(this.messages.requiredFieldLabel,{name:t}):t;return T("calcite-label",{"aria-label":a,class:m.label,key:`field--${i}`},T("div",{class:m.labelTextContent,key:"labelTextContainer"},t,n?T("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==o?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:i}=e;if("date"===i)return this._renderDateComponents(e,t);if("coded-value"===e.domain?.type){const i=e.domain;return this._renderCodedInputs({input:e,domain:i,props:t})}return"number"===i?this._renderNumberComponent(t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{compositeError:t,description:i,submittable:n}=e,o=!n&&t&&(this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId))?p(e,t,this.messages):null;return o?T("calcite-input-message",{icon:!0,status:"invalid"},o):i?T("calcite-input-message",{class:m.description,icon:!1,status:"idle"},i):null}_renderCodedInputs({input:e,domain:t,props:i}){const n=e.template.input?.type??null,o=this.viewModel.getCodedValueOptions(t);switch(n){case"switch":return this._renderSwitchField({input:e,props:i,options:o});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:o,props:i});default:return this._renderComboBoxComponent({options:o,props:i,input:e})}}_renderSwitchField({input:e,props:t,options:i}){if((this._batchSwitchInputInitialValues.get(e)===C||e.value===C)&&"batch"===this.viewModel.mode){i.unshift({name:this.messages.differentValues,value:C,disabled:!0,selected:!0});const n={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[S]:t[S]},trigger:{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral",slot:"trigger",label:t.label},group:{mode:"single"}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:n,options:i})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return T("calcite-switch",{...t,checked:!!u(e.template,"switch")&&e.value===e.template.input.onValue,class:m.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInput(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:i}){const{trigger:n,dropdown:o,group:a}=i;return T("calcite-dropdown",{...o,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e)},T("calcite-button",{...n},e===C?this.messages.differentValues:e),T("calcite-dropdown-group",{selectionMode:a.mode},t.map((t=>T("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name)))))}_renderComboBoxComponent({input:e,options:t,props:i}){const n=t.map((e=>this.renderComboboxItem({value:`${e.value}`,text:e.name,selected:i.value===e.value}))),o=i.placeholder===this.messages.differentValues;o&&n.push(T("calcite-combobox-item",{key:C,selected:!0,textLabel:this.messages.differentValues,value:C}));const a="INSERT"===this.viewModel.editType,s=this._touchedInputs.has(e?.template?.elementId),r=!o&&V(i.value);e.showNoValueOptionEnabled&&n.unshift(T("calcite-combobox-item",{key:"empty-option",selected:r,textLabel:e.showNoValueLabel||this.messages.empty,value:""}));const l=a&&e.showNoValueOptionEnabled&&!s?()=>{}:i.onblur,d={...i,onblur:l};return T("calcite-combobox",{...d,selectionMode:"single",value:o?C:String(i.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==C&&this._saveInput(e)}},n)}renderComboboxItem({text:e,value:t,selected:i}){return T("calcite-combobox-item",{key:t,selected:i,textLabel:e,value:t})}_renderRadioButtonGroupComponent({input:e,options:t,props:i}){const n=t.map((({name:t,value:n})=>this._renderRadioButtons({label:t,value:n,selected:n===e.value,props:i})));if(e.showNoValueOptionEnabled){const t="",o=e.showNoValueLabel||this.messages.empty,a=V(e.value);n.unshift(this._renderRadioButtons({label:o,value:t,selected:a,props:i}))}return T("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:m.inputRadioGroup,disabled:i.readOnly,key:`${i.key}-radio-group`,layout:"vertical",name:i.name,required:i.required},n,i.placeholder===this.messages.differentValues?T("calcite-label",{class:m.placeholderRadio,key:i.label,layout:"inline"},T("calcite-radio-button",{checked:!0,class:m.inputRadio,disabled:!0,name:i.placeholder,value:i.placeholder}),i.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:i,props:n}){return T("calcite-label",{class:m.inputRadioLabel,key:n.label,layout:"inline"},T("calcite-radio-button",{...n,checked:t,class:m.inputRadio,disabled:n.readOnly,name:n.label,onblur:()=>{this._focusedFieldInput=null},value:e,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),i)}_renderStringComponent(e,t){const{template:i}=e;return i.field.editable?i.input&&"text-area"===i.input.type?T("calcite-text-area",{...t,class:this.classes(m.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):T("calcite-input",{...t,class:this.classes(m.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)}):this._renderReadOnlyComponent(e)}_renderNumberComponent(e){return T("calcite-input-number",{...e,type:"number",value:null==e.value?"":String(e.value),onCalciteInputNumberInput:({currentTarget:e})=>this._saveInput(e)})}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return T("calcite-input",{...i,class:this.classes(m.fieldInput,m.inputDisabled,m.individualElement),readOnly:!0,type:"text",value:String(t??i.value??"")})}_renderDateComponents(e,t){const{type:i}=e.field;switch(i){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,g(e.field,t.value))}}_renderDateOnlyFieldComponent(e,t){const{class:i,key:n,readOnly:o}=t,{rawMax:a,rawMin:s}=e.range;return T("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:i,"data-date-part":"date","data-element-id":t[S],key:`${n}-date-input`,max:r(a)?a:void 0,min:r(s)?s:void 0,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:o,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{class:i,key:n,readOnly:o}=t;return T("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:i,"data-date-part":"time","data-element-id":t[S],key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:o,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{class:i,key:n,readOnly:o}=t,{rawMax:a,rawMin:s}=e.range,r=I(a),l=I(s),d=I(e.value===C?"":e.value),p=e.includeTimeOffset,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:o,[S]:t[S],onfocus:this._onComponentFocus};return T("div",{class:m.dateInputContainer,key:`${n}-date-time-container`},T("calcite-input-date-picker",{...u,class:i,"data-date-part":"date",key:`${n}-date-input`,max:r?.date??void 0,min:l?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:d.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),T("calcite-input-time-picker",{...u,class:i,"data-date-part":"time",key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},value:d.time??"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),p?T("calcite-input-time-zone",{...u,class:i,"data-date-part":"timeZone",key:`${n}-timezone-input`,onblur:()=>{this._focusedFieldInput=null},value:d.timeZoneOffset??"0",onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:i,key:n,readOnly:o,min:a,max:s}=t,r=y(e.value===C?"":e.value),l=y(s),d=y(a),p=e.includeTime,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:o,[S]:t[S],onfocus:this._onComponentFocus};return T("div",{class:m.dateInputContainer,key:`${n}-date-time-container`},T("calcite-input-date-picker",{...u,class:i,"data-date-part":"date",key:`${n}-date-input`,max:l?.date??void 0,min:d?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:r.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),p?T("calcite-input-time-picker",{...u,"data-date-part":"time",key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},step:1,value:r.time??"",onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}getCommonInputProps(e){const{_effectiveDisabled:t}=this,{template:i,valid:n,value:o,minLength:a,maxLength:s,required:r,fieldName:l,editable:d,userHasChangedValue:p,range:{max:u,min:c}}=e,h=!d||t;let v=i.hint??void 0,b=!1;return o===C&&(v=this.messages.differentValues,b=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":n?"false":"true",class:this.classes(m.fieldInput,h?m.inputDisabled:null),status:!p&&!this.viewModel.submitHasBeenAttempted||n?"idle":"invalid",maxLength:s&&s>-1?s:void 0,minLength:a&&a>-1?a:void 0,key:i.elementId,label:l,name:l,max:null!=u?u:void 0,min:null!=c?c:void 0,readOnly:h,onblur:this._onComponentBlur,required:r,placeholder:v,value:b?"":o??"",[S]:i.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(S))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),n=t||i;n&&this._afterComponentCreateOrUpdate(n)}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._touchedInputs.add(i.template.elementId),this._focusedFieldInput=i}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),i=this._focusedFieldInput;this._attemptFocusOnNextRender&&i===t&&(this._attemptFocusOnNextRender=!1,M(e))}_onComponentBlur(){this._focusedFieldInput=null}_parseValue(e,t){if(u(t.template,"switch"))return"calcite-dropdown"===e.localName?e.selectedItems[0].textContent:e.checked?t.template.input.onValue:t.template.input.offValue;const i=e.value;return null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:n}=t.template;if(!t)return;const o=t?.value;if(u(t.template,"switch")&&"single"!==this.viewModel.mode){const e=i(this._batchSwitchInputInitialValues,t,(()=>t.value));this._batchSwitchInputInitialValues.set(t,null===e?o:e)}const a=this._parseValue(e,t);a!==o&&this.viewModel.setValue(n,a)}async _afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._setDateTimeTimeZoneMap(e),this._updateDateTimeOrTimeZoneShadowDom(e,t.value===C),this._afterComponentCreateOrUpdate(e)}async _afterDateComponentUpdate(e){const{value:t}=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._updateDateTimeOrTimeZoneShadowDom(e,t===C),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:i}=e.template,n=e.field.type,o=this._dateComponentMap.get(`${i}`);if(!o)return;let a=e.value===C?void 0:e.value,s=null;"date-only"===n?s=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===n?(a=w(a),s=w(t.value)):s="timestamp-offset"===n?null!=t.value?F({dateComponent:o.date,timeComponent:o.time,oldValue:a,timeZoneComponent:o.timeZone}):null:null!=t.value?x({oldValue:a,dateComponent:o.date,timeComponent:o.time?.value===C?void 0:o.time}):null,a!==s&&(null!==s&&t.value?this.viewModel.setValue(`${i}`,s):this.viewModel.setValue(`${i}`,null))}};e([a()],U.prototype,"activeFeatureIndex",null),e([a()],U.prototype,"disabled",null),e([a()],U.prototype,"_effectiveDisabled",null),e([a()],U.prototype,"features",null),e([a()],U.prototype,"map",null),e([a()],U.prototype,"spatialReference",null),e([a()],U.prototype,"timeZone",null),e([a()],U.prototype,"headingLevel",void 0),e([a()],U.prototype,"icon",null),e([a(),D("esri/t9n/common")],U.prototype,"messagesCommon",void 0),e([a(),D("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],U.prototype,"messages",void 0),e([a()],U.prototype,"readOnly",void 0),e([a(),O(["value-change","submit"])],U.prototype,"viewModel",void 0),e([a({type:h,nonNullable:!0})],U.prototype,"visibleElements",void 0),e([a()],U.prototype,"groupDisplay",void 0),U=e([s("esri.widgets.BatchAttributeForm")],U);const R=U;export{R as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import"../core/has.js";import{abortHandle as t}from"../core/handleUtils.js";import{getOrCreateMapValue as i}from"../core/MapUtils.js";import{watch as n,whenOnce as o}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{isIntegerField as r}from"../layers/support/fieldUtils.js";import{isString as l}from"../support/guards.js";import d from"./Widget.js";import{getHiddenFieldsValidationErrorMessage as p,getVisibleFieldInputValidationErrorMessage as u,isElementTemplateWithInputType as c}from"./BatchAttributeForm/batchAttributeFormUtils.js";import m from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as h}from"./BatchAttributeForm/css.js";import{VisibleElements as v}from"./BatchAttributeForm/VisibleElements.js";import{InputVisibilityCode as b,isGroupInput as f,isFieldInput as _,differentValuesString as C}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as I,prepareISOFieldValueForDateComponents as y,prepareUnixFieldValueForDateComponents as w,normalizeTimeOnlyString as F,getISOFieldValueFromDateComponents as x,getUnixFieldValueFromDateComponents as k}from"./support/dateUtils.js";import{globalCss as D}from"./support/globalCss.js";import{setFocus as O}from"./support/widgetUtils.js";import{messageBundle as M}from"./support/decorators/messageBundle.js";import{vmEvent as T}from"./support/decorators/vmEvent.js";import{tsx as V}from"./support/jsxFactory.js";import{isEmptyValue as S}from"./support/forms/formUtils.js";import{substitute as E}from"../intl/substitute.js";const U="data-element-id";let R=class extends d{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.readOnly=!1,this.viewModel=new m,this.visibleElements=new v,this.groupDisplay="all",this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._batchSwitchInputInitialValues=new Map,this._saveInput=this._saveInput.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentUpdate=this._afterDateComponentUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([n((()=>this.features),(()=>{this._dateComponentMap.clear();const e=new AbortController;o((()=>!this.viewModel.updating),e.signal).then((()=>{this._attemptFocusOnNextRender=!0})),this.addHandles(t(e))})),n((()=>this.viewModel.activeForm),(()=>{this._batchSwitchInputInitialValues.clear()}))])}loadDependencies(){return g({input:()=>import("@esri/calcite-components/dist/components/calcite-input"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")})}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get _effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}goToClosestError(){const e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;const{groupInput:t}=e;t&&(t.open||(t.open=!0)),setTimeout((()=>{if(!this.domNode)return;const t=this.domNode.querySelector(`[data-element-id="${e.input.template.elementId}"]`);t&&O(t)}),10)}render(){const{status:e}=this.viewModel;return"failed"===e?V("div",{class:this.classes(h.base,D.widget,D.panel)},V("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},V("div",{slot:"message"},this.messages.formFailedToLoad))):this.viewModel.expressionEvaluationFailed?V("div",{class:this.classes(h.base,D.widget,D.panel)},V("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},V("div",{slot:"message"},this.messages.expressionEvaluationFailed))):V("div",{class:this.classes(h.base,D.widget,D.panel)},"loaded"===e?this._renderForm():"loading"===e?V("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):null)}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:n}=e.dataset,o=this._getCalciteElementFromDateTimeTimeZonePicker(e,t);if(!o)return;const a=i(this._dateComponentMap,`${n}`,(()=>({placeholder:{date:"",time:"",timeZone:""}})));switch(a.placeholder[t]=o.placeholder??"",t){case"date":a.date=e;break;case"time":a.time=e;break;case"timeZone":a.timeZone=e,a.defaultComboboxItemElements=o.selectedItems}"timeZone"===t&&(a.defaultComboboxItemElements=o.selectedItems)}_getCalciteElementFromDateTimeTimeZonePicker(e,t){const i=e.shadowRoot;return i?"timeZone"===t?i.querySelector("calcite-combobox"):i.querySelector("calcite-input-text"):null}_updateDateTimeOrTimeZoneShadowDom(e,t){const{datePart:i,elementId:n}=e.dataset,o=this._dateComponentMap.get(`${n}`);if(!o)return;const a=this._getCalciteElementFromDateTimeTimeZonePicker(e,i);if(a)switch(i){case"date":case"time":a.placeholder=t?this.messages.differentValues:o.placeholder[i];break;case"timeZone":t?(a.value="",a.placeholder=this.messages.differentValues):(!a.selectedItems.length&&o.defaultComboboxItemElements?.length&&(a.selectedItems[0]=o.defaultComboboxItemElements[0]),a.placeholder=o.placeholder[i])}}_renderForm(){return V("form",{onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),this._renderContent())}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:i}=e;let n;if(!e.userHasChangedValues&&!e.submitHasBeenAttempted)return null;if(i.invalidHiddenInputs.length>0)if(n=p(i,e.mode,this.messages),"batch"===this.viewModel.mode){const e=i.invalidHiddenInputs.filter((e=>e.effectiveVisibilityCode===b.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL||e.visibilityCode===b.HIDDEN_VISIBILITY_EXPRESSION_ALL));e.length>0?n+=` (${e.map((e=>e.label)).join(", ")})`:n=null}else n+=` (${i.invalidHiddenInputs.map((e=>e.label)).join(", ")})`;else if(t)return null;return n?V("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},V("div",{slot:"message"},n)):null}_renderContent(){if(!this.viewModel.hasVisibleInputs)return[V("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},V("div",{slot:"message"},this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason]))];const{inputs:e}=this.viewModel.activeForm;return e.filter((e=>e.visible)).map((e=>this._renderInput(e)))}_renderInput(e){return f(e)?this._renderGroupInput(e):_(e)?this._renderLabeledField(e):void 0}_renderGroupInput(e){const{inputs:t,template:i,open:n}=e,o=t.filter((e=>e.visible)),a=i.label??"";return V("calcite-block",{class:this.classes(h.group,"sequential"===this.groupDisplay?h.groupSequential:null,this.disabled?h.inputDisabled:null),collapsible:!0,description:i.description??void 0,disabled:this._effectiveDisabled,heading:a,headingLevel:this.headingLevel,key:`{${i.elementId}-key}`,label:a,open:n,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0}},o.map((e=>this._renderInput(e))))}_renderLabeledField(e){const{label:t,elementId:i}=e.template,{required:n,dataType:o}=e,a=n?E(this.messages.requiredFieldLabel,{name:t}):t;return V("calcite-label",{"aria-label":a,class:h.label,key:`field--${i}`},V("div",{class:h.labelTextContent,key:"labelTextContainer"},t,n?V("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==o?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:i}=e;if("date"===i)return this._renderDateComponents(e,t);if("coded-value"===e.domain?.type){const i=e.domain;return this._renderCodedInputs({input:e,domain:i,props:t})}return"number"===i?this._renderNumberComponent(e,t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{compositeError:t,description:i,submittable:n}=e,o=!n&&t&&(this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId))?u(e,t,this.messages):null;return o?V("calcite-input-message",{icon:!0,status:"invalid"},o):i?V("calcite-input-message",{class:h.description,icon:!1,status:"idle"},i):null}_renderCodedInputs({input:e,domain:t,props:i}){const n=e.template.input?.type??null,o=this.viewModel.getCodedValueOptions(t);switch(n){case"switch":return this._renderSwitchField({input:e,props:i,options:o});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:o,props:i});default:return this._renderComboBoxComponent({options:o,props:i,input:e})}}_renderSwitchField({input:e,props:t,options:i}){if((this._batchSwitchInputInitialValues.get(e)===C||e.value===C)&&"batch"===this.viewModel.mode){i.unshift({name:this.messages.differentValues,value:C,disabled:!0,selected:!0});const n={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[U]:t[U]},trigger:{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral",slot:"trigger",label:t.label},group:{mode:"single"}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:n,options:i})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return V("calcite-switch",{...t,checked:!!c(e.template,"switch")&&e.value===e.template.input.onValue,class:h.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInput(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:i}){const{trigger:n,dropdown:o,group:a}=i;return V("calcite-dropdown",{...o,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e)},V("calcite-button",{...n},e===C?this.messages.differentValues:e),V("calcite-dropdown-group",{selectionMode:a.mode},t.map((t=>V("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name)))))}_renderComboBoxComponent({input:e,options:t,props:i}){const n=t.map((e=>this.renderComboboxItem({value:`${e.value}`,text:e.name,selected:i.value===e.value}))),o=i.placeholder===this.messages.differentValues;o&&n.push(V("calcite-combobox-item",{key:C,selected:!0,textLabel:this.messages.differentValues,value:C}));const a="INSERT"===this.viewModel.editType,s=this._touchedInputs.has(e?.template?.elementId),r=!o&&S(i.value);e.showNoValueOptionEnabled&&n.unshift(V("calcite-combobox-item",{key:"empty-option",selected:r,textLabel:e.showNoValueLabel||this.messages.empty,value:""}));const l=a&&e.showNoValueOptionEnabled&&!s?()=>{}:i.onblur,d={...i,onblur:l};return V("calcite-combobox",{...d,selectionMode:"single",value:o?C:String(i.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==C&&this._saveInput(e)}},n)}renderComboboxItem({text:e,value:t,selected:i}){return V("calcite-combobox-item",{key:t,selected:i,textLabel:e,value:t})}_renderRadioButtonGroupComponent({input:e,options:t,props:i}){const n=t.map((({name:t,value:n})=>this._renderRadioButtons({label:t,value:n,selected:n===e.value,props:i})));if(e.showNoValueOptionEnabled){const t="",o=e.showNoValueLabel||this.messages.empty,a=S(e.value);n.unshift(this._renderRadioButtons({label:o,value:t,selected:a,props:i}))}return V("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:h.inputRadioGroup,disabled:i.readOnly,key:`${i.key}-radio-group`,layout:"vertical",name:i.name,required:i.required},n,i.placeholder===this.messages.differentValues?V("calcite-label",{class:h.placeholderRadio,key:i.label,layout:"inline"},V("calcite-radio-button",{checked:!0,class:h.inputRadio,disabled:!0,name:i.placeholder,value:i.placeholder}),i.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:i,props:n}){return V("calcite-label",{class:h.inputRadioLabel,key:n.label,layout:"inline"},V("calcite-radio-button",{...n,checked:t,class:h.inputRadio,disabled:n.readOnly,name:n.label,onblur:()=>{this._focusedFieldInput=null},value:e,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),i)}_renderStringComponent(e,t){const{template:i}=e;return i.field.editable?i.input&&"text-area"===i.input.type?V("calcite-text-area",{...t,class:this.classes(h.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):V("calcite-input",{...t,class:this.classes(h.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)}):this._renderReadOnlyComponent(e)}_renderNumberComponent(e,t){const i=r(e.field);return V("calcite-input-number",{...t,integer:i,type:"number",value:i&&""!==t.value?Math.round(parseFloat(String(t.value))).toString():String(t.value),onCalciteInputNumberInput:({currentTarget:e})=>this._saveInput(e)})}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return V("calcite-input",{...i,class:this.classes(h.fieldInput,h.inputDisabled,h.individualElement),readOnly:!0,type:"text",value:String(t??i.value??"")})}_renderDateComponents(e,t){const{type:i}=e.field;switch(i){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,I(e.field,t.value))}}_renderDateOnlyFieldComponent(e,t){const{class:i,key:n,readOnly:o}=t,{rawMax:a,rawMin:s}=e.range;return V("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:i,"data-date-part":"date","data-element-id":t[U],key:`${n}-date-input`,max:l(a)?a:void 0,min:l(s)?s:void 0,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:o,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{class:i,key:n,readOnly:o}=t;return V("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:i,"data-date-part":"time","data-element-id":t[U],key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:o,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{class:i,key:n,readOnly:o}=t,{rawMax:a,rawMin:s}=e.range,r=y(a),l=y(s),d=y(e.value===C?"":e.value),p=e.includeTimeOffset,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:o,[U]:t[U],onfocus:this._onComponentFocus};return V("div",{class:h.dateInputContainer,key:`${n}-date-time-container`},V("calcite-input-date-picker",{...u,class:i,"data-date-part":"date",key:`${n}-date-input`,max:r?.date??void 0,min:l?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:d.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),V("calcite-input-time-picker",{...u,class:i,"data-date-part":"time",key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},value:d.time??"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),p?V("calcite-input-time-zone",{...u,class:i,"data-date-part":"timeZone",key:`${n}-timezone-input`,onblur:()=>{this._focusedFieldInput=null},value:d.timeZoneOffset??"0",onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:i,key:n,readOnly:o,min:a,max:s}=t,r=w(e.value===C?"":e.value),l=w(s),d=w(a),p=e.includeTime,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:o,[U]:t[U],onfocus:this._onComponentFocus};return V("div",{class:h.dateInputContainer,key:`${n}-date-time-container`},V("calcite-input-date-picker",{...u,class:i,"data-date-part":"date",key:`${n}-date-input`,max:l?.date??void 0,min:d?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:r.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),p?V("calcite-input-time-picker",{...u,"data-date-part":"time",key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},step:1,value:r.time??"",onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}getCommonInputProps(e){const{_effectiveDisabled:t}=this,{template:i,valid:n,value:o,minLength:a,maxLength:s,required:r,fieldName:l,editable:d,userHasChangedValue:p,range:{max:u,min:c}}=e,m=!d||t;let v=i.hint??void 0,b=!1;return o===C&&(v=this.messages.differentValues,b=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":n?"false":"true",class:this.classes(h.fieldInput,m?h.inputDisabled:null),status:!p&&!this.viewModel.submitHasBeenAttempted||n?"idle":"invalid",maxLength:s&&s>-1?s:void 0,minLength:a&&a>-1?a:void 0,key:i.elementId,label:l,name:l,max:null!=u?u:void 0,min:null!=c?c:void 0,readOnly:m,onblur:this._onComponentBlur,required:r,placeholder:v,value:b?"":o??"",[U]:i.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(U))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),n=t||i;n&&this._afterComponentCreateOrUpdate(n)}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._touchedInputs.add(i.template.elementId),this._focusedFieldInput=i}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),i=this._focusedFieldInput;this._attemptFocusOnNextRender&&i===t&&(this._attemptFocusOnNextRender=!1,O(e))}_onComponentBlur(){this._focusedFieldInput=null}_parseValue(e,t){if(c(t.template,"switch"))return"calcite-dropdown"===e.localName?e.selectedItems[0].textContent:e.checked?t.template.input.onValue:t.template.input.offValue;const i=e.value;return null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:n}=t.template;if(!t)return;const o=t?.value;if(c(t.template,"switch")&&"single"!==this.viewModel.mode){const e=i(this._batchSwitchInputInitialValues,t,(()=>t.value));this._batchSwitchInputInitialValues.set(t,null===e?o:e)}const a=this._parseValue(e,t);a!==o&&this.viewModel.setValue(n,a)}async _afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._setDateTimeTimeZoneMap(e),this._updateDateTimeOrTimeZoneShadowDom(e,t.value===C),this._afterComponentCreateOrUpdate(e)}async _afterDateComponentUpdate(e){const{value:t}=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._updateDateTimeOrTimeZoneShadowDom(e,t===C),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:i}=e.template,n=e.field.type,o=this._dateComponentMap.get(`${i}`);if(!o)return;let a=e.value===C?void 0:e.value,s=null;"date-only"===n?s=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===n?(a=F(a),s=F(t.value)):s="timestamp-offset"===n?null!=t.value?x({dateComponent:o.date,timeComponent:o.time,oldValue:a,timeZoneComponent:o.timeZone}):null:null!=t.value?k({oldValue:a,dateComponent:o.date,timeComponent:o.time?.value===C?void 0:o.time}):null,a!==s&&(null!==s&&t.value?this.viewModel.setValue(`${i}`,s):this.viewModel.setValue(`${i}`,null))}};e([a()],R.prototype,"activeFeatureIndex",null),e([a()],R.prototype,"disabled",null),e([a()],R.prototype,"_effectiveDisabled",null),e([a()],R.prototype,"features",null),e([a()],R.prototype,"map",null),e([a()],R.prototype,"spatialReference",null),e([a()],R.prototype,"timeZone",null),e([a()],R.prototype,"headingLevel",void 0),e([a()],R.prototype,"icon",null),e([a(),M("esri/t9n/common")],R.prototype,"messagesCommon",void 0),e([a(),M("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],R.prototype,"messages",void 0),e([a()],R.prototype,"readOnly",void 0),e([a(),T(["value-change","submit"])],R.prototype,"viewModel",void 0),e([a({type:v,nonNullable:!0})],R.prototype,"visibleElements",void 0),e([a()],R.prototype,"groupDisplay",void 0),R=e([s("esri.widgets.BatchAttributeForm")],R);const L=R;export{L as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Viewpoint.js";import o from"../../core/Collection.js";import i from"../../core/Error.js";import a from"../../core/Evented.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{cast as n}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{SlideThumbnail as c}from"../../webdoc/support/SlideThumbnail.js";import p from"../../webmap/Bookmark.js";import l from"../support/GoTo.js";const m=o.ofType(p),u={width:128,height:128,format:"png"},k={takeScreenshot:!0,captureViewpoint:!0,captureRotation:!0,captureScale:!0,captureTimeExtent:!0},w={time:!0};let d=class extends(l(a.EventedAccessor)){constructor(t){super(t),this.capabilities={...w},this.activeBookmark=null,this.view=null}destroy(){this.view=null,this._set("activeBookmark",null)}castCapabilities(t){return{...w,...t}}get bookmarks(){return this.view?.map?.bookmarks??new m}set bookmarks(t){this._overrideIfSome("bookmarks",t)}set defaultCreateOptions(t){this._set("defaultCreateOptions",{...k,...t})}get defaultCreateOptions(){return k}set defaultEditOptions(t){this._set("defaultEditOptions",{...k,...t})}get defaultEditOptions(){return k}get state(){const{view:t}=this;return t&&!t.ready?"loading":"ready"}async createBookmark(t){const{view:e,defaultCreateOptions:o,capabilities:a}=this;if(!e)throw new i("create-bookmark:invalid-view","Cannot create a bookmark without a view.");const{takeScreenshot:r,screenshotSettings:n,captureViewpoint:s,captureRotation:c,captureScale:l,captureTimeExtent:m}={...o,...t},u=r?await this._createThumbnail(n):void 0,k=a.time&&m&&null!=e.timeExtent?e.timeExtent.clone():void 0;return new p({...u&&{thumbnail:u},...m&&{timeExtent:k},...s&&{viewpoint:this._createViewpoint({view:e,captureScale:l,captureRotation:c})}})}async editBookmark(t,e){if(!t)return t;const{view:o,defaultEditOptions:a}=this;if(!o)throw new i("edit-bookmark:invalid-view","Cannot edit a bookmark without a view.");const{takeScreenshot:r,screenshotSettings:n,captureViewpoint:s,captureRotation:c,captureScale:p,captureTimeExtent:l}={...a,...e},m=r?await this._createThumbnail(n):void 0;return m&&(t.thumbnail=m),s&&(t.viewpoint=this._createViewpoint({view:o,captureScale:p,captureRotation:c})),l&&null!=o.timeExtent&&(t.timeExtent=o.timeExtent.clone()),this.emit("bookmark-edit",{bookmark:t}),t}goTo(t){const{capabilities:e,view:o}=this;if(!o)throw new i("go-to:invalid-view","Cannot go to a bookmark without a view");const a=t?.viewpoint;if(!a)throw new i("go-to:invalid-bookmark","Cannot go to a bookmark that does not contain a 'viewpoint'.",{bookmark:t});this._set("activeBookmark",t);const r={target:a},n=this.callGoTo(r),s=t?.timeExtent;return e.time&&s&&(o.timeExtent=s),this.emit("bookmark-select",{bookmark:t}),n.catch((()=>{})).then((()=>this._set("activeBookmark",null))),n}async _createThumbnail(t){const{view:e}=this;if(!e)throw new i("bookmark:invalid-view","Cannot create slide thumbnail without a view");const o=await e.takeScreenshot({...u,...t});return new c({url:o.dataUrl})}_createViewpoint({view:t,captureRotation:o,captureScale:i}){const a=t.viewpoint?.clone();return new e({targetGeometry:t.extent?.clone(),rotation:(o?a?.rotation:null)??0,scale:(i?a?.scale:null)??0})}};t([r()],d.prototype,"capabilities",void 0),t([n("capabilities")],d.prototype,"castCapabilities",null),t([r({readOnly:!0})],d.prototype,"activeBookmark",void 0),t([r({type:m})],d.prototype,"bookmarks",null),t([r()],d.prototype,"defaultCreateOptions",null),t([r()],d.prototype,"defaultEditOptions",null),t([r({readOnly:!0})],d.prototype,"state",null),t([r()],d.prototype,"view",void 0),d=t([s("esri.widgets.Bookmarks.BookmarksViewModel")],d);const h=d;export{h as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Viewpoint.js";import o from"../../core/Collection.js";import i from"../../core/Error.js";import a from"../../core/Evented.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{cast as n}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{SlideThumbnail as c}from"../../webdoc/support/SlideThumbnail.js";import p from"../../webmap/Bookmark.js";import l from"../support/GoTo.js";const m=o.ofType(p),u={width:128,height:128,format:"png"},k={takeScreenshot:!0,captureViewpoint:!0,captureRotation:!0,captureScale:!0,captureTimeExtent:!0},w={time:!0};let d=class extends(l(a.EventedAccessor)){constructor(t){super(t),this.capabilities={...w},this.activeBookmark=null,this.view=null}destroy(){this.view=null,this._set("activeBookmark",null)}castCapabilities(t){return{...w,...t}}get bookmarks(){return this.view?.map?.bookmarks??new m}set bookmarks(t){this._overrideIfSome("bookmarks",t)}set defaultCreateOptions(t){this._set("defaultCreateOptions",{...k,...t})}get defaultCreateOptions(){return k}set defaultEditOptions(t){this._set("defaultEditOptions",{...k,...t})}get defaultEditOptions(){return k}get state(){const{view:t}=this;return t&&!t.ready?"loading":"ready"}async createBookmark(t){const{view:e,defaultCreateOptions:o,capabilities:a}=this;if(!e)throw new i("create-bookmark:invalid-view","Cannot create a bookmark without a view.");const{takeScreenshot:r,screenshotSettings:n,captureViewpoint:s,captureRotation:c,captureScale:l,captureTimeExtent:m}={...o,...t},u=r?await this._createThumbnail(n):void 0,k=a.time&&m&&null!=e.timeExtent?e.timeExtent.clone():void 0;return new p({...u&&{thumbnail:u},...m&&{timeExtent:k},...s&&{viewpoint:this._createViewpoint({view:e,captureScale:l,captureRotation:c})}})}async editBookmark(t,e){if(!t)return t;const{view:o,defaultEditOptions:a}=this;if(!o)throw new i("edit-bookmark:invalid-view","Cannot edit a bookmark without a view.");const{takeScreenshot:r,screenshotSettings:n,captureViewpoint:s,captureRotation:c,captureScale:p,captureTimeExtent:l}={...a,...e},m=r?await this._createThumbnail(n):void 0;return m&&(t.thumbnail=m),s&&(t.viewpoint=this._createViewpoint({view:o,captureScale:p,captureRotation:c})),l&&null!=o.timeExtent&&(t.timeExtent=o.timeExtent.clone()),this.emit("bookmark-edit",{bookmark:t}),t}goTo(t){const{capabilities:e,view:o}=this;if(!o)throw new i("go-to:invalid-view","Cannot go to a bookmark without a view");const a=t?.viewpoint;if(!a)throw new i("go-to:invalid-bookmark","Cannot go to a bookmark that does not contain a 'viewpoint'.",{bookmark:t});this._set("activeBookmark",t);const r=this.callGoTo({target:a}),n=t?.timeExtent;return e.time&&n&&(o.timeExtent=n),this.emit("bookmark-select",{bookmark:t}),r.catch((()=>{})).then((()=>this._set("activeBookmark",null))),r}async _createThumbnail(t){const{view:e}=this;if(!e)throw new i("bookmark:invalid-view","Cannot create slide thumbnail without a view");const o=await e.takeScreenshot({...u,...t});return new c({url:o.dataUrl})}_createViewpoint({view:t,captureRotation:o,captureScale:i}){const a=t.viewpoint?.clone();return new e({targetGeometry:t.extent?.clone(),rotation:(o?a?.rotation:null)??0,scale:(i?a?.scale:null)??0})}};t([r()],d.prototype,"capabilities",void 0),t([n("capabilities")],d.prototype,"castCapabilities",null),t([r({readOnly:!0})],d.prototype,"activeBookmark",void 0),t([r({type:m})],d.prototype,"bookmarks",null),t([r()],d.prototype,"defaultCreateOptions",null),t([r()],d.prototype,"defaultEditOptions",null),t([r({readOnly:!0})],d.prototype,"state",null),t([r()],d.prototype,"view",void 0),d=t([s("esri.widgets.Bookmarks.BookmarksViewModel")],d);const h=d;export{h as default};