@arcgis/core 4.30.0-next.20240213 → 4.30.0-next.20240215

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 (193) hide show
  1. package/TimeExtent.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/08ba549f9c4afc42a21c.js +1 -0
  4. package/assets/esri/core/workers/chunks/114afcee6a66415cd123.js +1 -0
  5. package/assets/esri/core/workers/chunks/1320562881294ce93806.js +1 -0
  6. package/assets/esri/core/workers/chunks/13451fa3e4b02ca2beb0.js +1 -0
  7. package/assets/esri/core/workers/chunks/{a384f29cb3256401962a.js → 1629a8c2085dce59cd1b.js} +1 -1
  8. package/assets/esri/core/workers/chunks/18512caeeb03b9759ab1.js +1 -0
  9. package/assets/esri/core/workers/chunks/{cc1c958aad790a44048b.js → 1ca28af7c516d8283bb0.js} +1 -1
  10. package/assets/esri/core/workers/chunks/1f8a0fb32b96e50f5909.js +1 -0
  11. package/assets/esri/core/workers/chunks/{abab3abb8ea7610d9fb8.js → 21e7a88478f5d15e0e71.js} +1 -1
  12. package/assets/esri/core/workers/chunks/24452a26b0c5322c7d2b.js +1 -0
  13. package/assets/esri/core/workers/chunks/25b88787ead0cc44cda4.js +1 -0
  14. package/assets/esri/core/workers/chunks/2649166d1a462c7f8338.js +1 -0
  15. package/assets/esri/core/workers/chunks/2c96771a365f8f70e996.js +1 -0
  16. package/assets/esri/core/workers/chunks/352e7f8d694f3f217a2d.js +1 -0
  17. package/assets/esri/core/workers/chunks/392214a3a1d712eda155.js +1 -0
  18. package/assets/esri/core/workers/chunks/397f15b5bce6838db084.js +1 -0
  19. package/assets/esri/core/workers/chunks/3bf281e979408b9363ed.js +1 -0
  20. package/assets/esri/core/workers/chunks/4edc667148d023b5b5af.js +1 -0
  21. package/assets/esri/core/workers/chunks/51e4f771bfe352967c97.js +1 -0
  22. package/assets/esri/core/workers/chunks/55cd747e06bb59d1a328.js +1 -0
  23. package/assets/esri/core/workers/chunks/5638d95e600ff271c5b1.js +1 -0
  24. package/assets/esri/core/workers/chunks/563d172caa15ea1b510d.js +1108 -0
  25. package/assets/esri/core/workers/chunks/58f088b08e12c5435dbc.js +1 -0
  26. package/assets/esri/core/workers/chunks/5aef1e898618f8dda2c9.js +1 -0
  27. package/assets/esri/core/workers/chunks/608be8ebf772aefc36a5.js +1 -0
  28. package/assets/esri/core/workers/chunks/64df2521b2814d2fb918.js +1 -0
  29. package/assets/esri/core/workers/chunks/65070fb591f6ef8313c3.js +1 -0
  30. package/assets/esri/core/workers/chunks/656ec8a14df0e4b68433.js +1 -0
  31. package/assets/esri/core/workers/chunks/6601fe99d587b9dff3c7.js +1 -0
  32. package/assets/esri/core/workers/chunks/{274e623323e24250ca46.js → 6ac424af4f2825fabceb.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{eb2d6f1ee63b40ae0736.js → 774b655498289b1b36bb.js} +1 -1
  34. package/assets/esri/core/workers/chunks/781bb63af571568358e3.js +1 -0
  35. package/assets/esri/core/workers/chunks/9e54d2cbe42f5552aaca.js +1 -0
  36. package/assets/esri/core/workers/chunks/{f03d62ab7806b68d0b62.js → 9fbf61675e2a5374f754.js} +1 -1
  37. package/assets/esri/core/workers/chunks/a5253543eae1708d11b9.js +1 -0
  38. package/assets/esri/core/workers/chunks/aa9b46bcb75c96731de3.js +1 -0
  39. package/assets/esri/core/workers/chunks/cfb8b6b5e9c21d582cf4.js +1 -0
  40. package/assets/esri/core/workers/chunks/d1b2372084c1e8c60f79.js +1 -0
  41. package/assets/esri/core/workers/chunks/{1c6914ded7db720f7bf7.js → daf6eab5dd198ca9a67b.js} +1 -1
  42. package/assets/esri/core/workers/chunks/e03edeaf3af46495449e.js +1 -0
  43. package/assets/esri/core/workers/chunks/e685214698fbc84276dd.js +1 -0
  44. package/assets/esri/core/workers/chunks/ebb294c82207f3ff9f04.js +1 -0
  45. package/assets/esri/core/workers/chunks/ec20e23aec9370df8a55.js +1 -0
  46. package/assets/esri/core/workers/chunks/{e4da908079417cc2f495.js → ee0c77889059815a31b2.js} +1 -1
  47. package/assets/esri/core/workers/chunks/f68b7bb88c444a7cbbd2.js +1 -0
  48. package/assets/esri/core/workers/chunks/f90bbebd2dc07a77ce09.js +1 -0
  49. package/assets/esri/core/workers/chunks/fa388680ff976a6b30f6.js +1 -0
  50. package/chunks/vec32.js +1 -1
  51. package/interfaces.d.ts +135 -68
  52. package/layers/WFSLayer.js +1 -1
  53. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  54. package/layers/graphics/applyEditsUtils.js +1 -1
  55. package/layers/graphics/editingSupport.js +1 -1
  56. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  57. package/layers/mixins/ArcGISImageService.js +1 -1
  58. package/layers/save/featureLayerUtils.js +1 -1
  59. package/layers/support/arcgisLayers.js +1 -1
  60. package/layers/support/fetchService.js +1 -1
  61. package/layers/support/fromPortalItem.js +1 -1
  62. package/networks/Network.js +1 -1
  63. package/package.json +1 -1
  64. package/portal/Portal.js +1 -1
  65. package/portal/PortalGroup.js +1 -1
  66. package/portal/PortalUser.js +1 -1
  67. package/portal/support/geometryServiceUtils.js +1 -1
  68. package/portal/support/layersLoader.js +1 -1
  69. package/portal/support/loadUtils.js +1 -1
  70. package/portal/support/portalLayers.js +1 -1
  71. package/renderers/visualVariables/SizeVariable.js +1 -1
  72. package/rest/knowledgeGraph/wasmInterface/wasmToUpdateResponseFactories.js +1 -1
  73. package/rest/networks/support/Association.js +1 -1
  74. package/rest/places.js +1 -1
  75. package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
  76. package/rest/support/ImageSampleParameters.js +1 -1
  77. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  78. package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
  79. package/support/elevationInfoUtils.js +1 -1
  80. package/support/revision.js +1 -1
  81. package/symbols/cim/cimAnalyzer.js +1 -1
  82. package/symbols/cim/defaultCIMValues.js +1 -1
  83. package/symbols/cim/utils.js +1 -1
  84. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  85. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  86. package/views/2d/engine/webgl/collisions/CollisionEngine.js +1 -1
  87. package/views/2d/engine/webgl/definitions.js +1 -1
  88. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  89. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  90. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  91. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  92. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  93. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  94. package/views/2d/layers/features/Processor.js +1 -1
  95. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  96. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  97. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  98. package/views/2d/layers/features/schema/processor/VisualVariablesSchema.js +1 -1
  99. package/views/2d/layers/features/sources/strategies/SnapshotLoadStrategy.js +1 -1
  100. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  101. package/views/2d/layers/features/support/DisplayIdGenerator.js +1 -1
  102. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  103. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  104. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  105. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  106. package/views/3d/layers/SceneLayerView3D.js +1 -1
  107. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  108. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  109. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  110. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  111. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  112. package/views/3d/support/orientedBoundingBox.js +1 -1
  113. package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
  114. package/views/3d/terrain/OverlayRenderer.js +1 -1
  115. package/views/3d/webgl/RenderNode.js +1 -1
  116. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  117. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  118. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +9 -7
  119. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceConstants.js +5 -0
  120. package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +8 -8
  121. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  122. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  123. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  124. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  125. package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
  126. package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +1 -1
  127. package/views/draw/DrawGraphicTool.js +1 -1
  128. package/views/draw/DrawOperation.js +1 -1
  129. package/views/draw/drawSurfaces.js +1 -1
  130. package/views/interactive/snapping/SnappingManager.js +1 -1
  131. package/views/interactive/snapping/SnappingOptions.js +1 -1
  132. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  133. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  134. package/views/layers/ImageryTileLayerView.js +1 -1
  135. package/webdoc/support/webdocLoadUtils.js +1 -1
  136. package/webdoc/support/webdocSaveUtils.js +1 -1
  137. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  138. package/widgets/Editor/EditorViewModel.js +1 -1
  139. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  140. package/widgets/Editor/UpdateWorkflow.js +1 -1
  141. package/widgets/Editor/components/FooterActions.js +1 -1
  142. package/widgets/Editor/support/EditorItem.js +1 -1
  143. package/widgets/Editor.js +1 -1
  144. package/widgets/FeatureForm.js +1 -1
  145. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  146. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  147. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  148. package/widgets/FeatureTable.js +1 -1
  149. package/widgets/Features/FeaturesViewModel.js +1 -1
  150. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  151. package/widgets/Print/PrintViewModel.js +1 -1
  152. package/widgets/Print.js +1 -1
  153. package/widgets/Search/support/locatorUtils.js +1 -1
  154. package/widgets/Sketch/SketchViewModel.js +1 -1
  155. package/assets/esri/core/workers/chunks/00b9e92f8df245a83921.js +0 -1
  156. package/assets/esri/core/workers/chunks/02a6c43ec17e7223fac5.js +0 -1
  157. package/assets/esri/core/workers/chunks/02ee044597c89c86b934.js +0 -1
  158. package/assets/esri/core/workers/chunks/05ebb9cec0e1826b283f.js +0 -1
  159. package/assets/esri/core/workers/chunks/143ccb14c9e915dd1412.js +0 -1
  160. package/assets/esri/core/workers/chunks/24649b410b757599a549.js +0 -1
  161. package/assets/esri/core/workers/chunks/24d19abc680b341d13bb.js +0 -1
  162. package/assets/esri/core/workers/chunks/2519b207894132d5ea91.js +0 -1
  163. package/assets/esri/core/workers/chunks/30f9b2a3417cbcfeecca.js +0 -1
  164. package/assets/esri/core/workers/chunks/42ab9c282bb267c3db03.js +0 -1
  165. package/assets/esri/core/workers/chunks/478815fc19b452d8317d.js +0 -1
  166. package/assets/esri/core/workers/chunks/49afeac45250b15b5f36.js +0 -1
  167. package/assets/esri/core/workers/chunks/50bb67f2eeace5d50673.js +0 -1
  168. package/assets/esri/core/workers/chunks/50cdc59426ba859027e2.js +0 -1
  169. package/assets/esri/core/workers/chunks/5401ec9c9fd62dcac6ec.js +0 -1
  170. package/assets/esri/core/workers/chunks/554d86df71821d671d2c.js +0 -1
  171. package/assets/esri/core/workers/chunks/58c5861d060c808813a1.js +0 -1
  172. package/assets/esri/core/workers/chunks/5dbb3ef6fdd25ac632ad.js +0 -1
  173. package/assets/esri/core/workers/chunks/61c4bb58ef9f2d99c75e.js +0 -1
  174. package/assets/esri/core/workers/chunks/6e50220f8e2d392e2855.js +0 -1
  175. package/assets/esri/core/workers/chunks/6fd8047741a0df006ddd.js +0 -1
  176. package/assets/esri/core/workers/chunks/7709248f59520aee6f51.js +0 -1
  177. package/assets/esri/core/workers/chunks/8852a64918caf80fc414.js +0 -1
  178. package/assets/esri/core/workers/chunks/8d119dc0a92ad3612daa.js +0 -1
  179. package/assets/esri/core/workers/chunks/94dfb80ab23dda92918b.js +0 -1
  180. package/assets/esri/core/workers/chunks/9ebbc75ba5c623a322aa.js +0 -1
  181. package/assets/esri/core/workers/chunks/a5babc10f47c24651d15.js +0 -1
  182. package/assets/esri/core/workers/chunks/a74c59cf5d1c4e63a4e1.js +0 -1
  183. package/assets/esri/core/workers/chunks/ada5d6fd70bd3e403442.js +0 -1
  184. package/assets/esri/core/workers/chunks/b95d69d84d60ac9828b9.js +0 -1
  185. package/assets/esri/core/workers/chunks/be562536212360943388.js +0 -1
  186. package/assets/esri/core/workers/chunks/ce823fc2d0e0095f398c.js +0 -1
  187. package/assets/esri/core/workers/chunks/d06d36815c2121484a13.js +0 -1
  188. package/assets/esri/core/workers/chunks/d5f06a7b0ea7951c8dd0.js +0 -1
  189. package/assets/esri/core/workers/chunks/ddc71fe66c7a49082920.js +0 -1
  190. package/assets/esri/core/workers/chunks/de6d54df7ae32694fd70.js +0 -1
  191. package/assets/esri/core/workers/chunks/f13c4b9692dad5802a32.js +0 -1106
  192. package/assets/esri/core/workers/chunks/f1e8f7d1a98b9e207b1b.js +0 -1
  193. package/assets/esri/core/workers/chunks/f9e9675f1c2287231653.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.30/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{symbolTypes as t}from"../../symbols.js";import o from"../../core/Collection.js";import i from"../../core/Error.js";import a from"../../core/Evented.js";import r from"../../core/Logger.js";import{destroyMaybe as s,abortMaybe as n}from"../../core/maybe.js";import{createAbortError as p,whenOrAbort as l}from"../../core/promiseUtils.js";import{on as h,watch as c,when as d,whenOnce as u,syncAndInitial as y}from"../../core/reactiveUtils.js";import{property as m}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as g}from"../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as v}from"../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as f,isLoaded as _,load as w,project as G}from"../../geometry/projection.js";import{geometryToCoordinates as b}from"../../geometry/support/coordsUtils.js";import{equals as O}from"../../geometry/support/spatialReferenceUtils.js";import T from"../../layers/GraphicsLayer.js";import{isIntegratedMeshLayer as E}from"../../layers/support/layerUtils.js";import{SupportedGraphicResult as S,isSupportedGraphicResultMessage as A}from"../../views/3d/interactive/editingTools/isSupportedGraphicUtils.js";import{isSupportedGraphic as k}from"../../views/3d/interactive/editingTools/moveGraphic/isSupportedGraphic.js";import{isSupportedGraphic as M}from"../../views/3d/interactive/editingTools/reshapeGraphic/isSupportedGraphic.js";import{isSupportedGraphic as C}from"../../views/3d/interactive/editingTools/transformGraphic/isSupportedGraphic.js";import{addUniqueLayer as H}from"../../views/draw/support/layerUtils.js";import{ViewEventPriorities as R}from"../../views/input/InputManager.js";import{sketchKeys as D}from"../../views/interactive/keybindings.js";import I from"../../views/interactive/sketch/SketchLabelOptions.js";import U from"../../views/interactive/sketch/SketchOptions.js";import x from"../../views/interactive/sketch/SketchTooltipOptions.js";import P from"../../views/interactive/sketch/SketchValueOptions.js";import{SnappingManager as j}from"../../views/interactive/snapping/SnappingManager.js";import L from"../../views/interactive/snapping/SnappingOptions.js";import{setupSnappingToggleHandles as F}from"../../views/interactive/snapping/snappingUtils.js";import{findFirstGraphicHit as V}from"../../views/support/hitTestSelectUtils.js";import{createScreenPointFromEvent as K}from"../../views/support/screenUtils.js";import{CreateOperationHandle as W,UpdateOperationHandle as Z}from"./support/OperationHandle.js";import q from"../../symbols/SimpleMarkerSymbol.js";import z from"../../symbols/SimpleFillSymbol.js";import N from"../../symbols/SimpleLineSymbol.js";import B from"../../symbols/MeshSymbol3D.js";import $ from"../../symbols/FillSymbol3DLayer.js";const Y={defaultZ:0},J={reshapeOptions:{edgeOperation:"split",shapeOperation:"move",vertexOperation:"move"},enableMoveAllGraphics:!0,enableRotation:!0,enableScaling:!0,multipleSelectionEnabled:!0,preserveAspectRatio:!1,toggleToolOnClick:!0,enableZ:!0,highlightOptions:{enabled:!0},tool:"transform"};let Q=class extends a.EventedAccessor{constructor(e){super(e),this._numUpdating=0,this._defaultSnappingManager=null,this._internalGraphicsLayer=new T({listMode:"hide",internal:!0,title:"SVM Internal"}),this._operationHandle=null,this._viewHandlesKey="viewHandles",this.activeFillSymbol=null,this.activeLineSymbol=null,this.activeVertexSymbol=null,this.allowDeleteKey=!0,this.layer=null,this.pointSymbol=new q({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}}),this.polygonSymbol=new z({color:[150,150,150,.2],outline:{color:[50,50,50],width:2}}),this.polylineSymbol=new N({color:[130,130,130,1],width:2}),this.meshSymbol=new B({symbolLayers:new o([new $])}),this.updateGraphics=new o,this.updateOnGraphicClick=!0,this.vertexSymbol=new q({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}}),this.sketchOptions=new U,this._moduleLoaderAbortController=null,this._viewReadyAbortController=null,this._originalPopupEnabled=null,this.defaultCreateOptions=Y,this.defaultUpdateOptions=J,this.snappingOptions=e?.snappingManager?.options??e?.snappingOptions??new L}initialize(){this.addHandles([h((()=>this.view?.map?.layers),"change",(e=>{e.removed.includes(this.layer)&&this.cancel()})),h((()=>this.layer?.graphics),"change",(e=>{if(null!=this._operationHandle)for(const t of e.removed)this.updateGraphics.includes(t)&&(this.updateGraphics.length>1?this._operationHandle.removeFromSelection(t):this._operationHandle.cancel())})),c((()=>this.layer?.elevationInfo??null),(e=>{e!==this._internalGraphicsLayer.elevationInfo&&(this.cancel(),this._internalGraphicsLayer.elevationInfo=e)}),y),c((()=>this.view),(e=>{this._defaultSnappingManager=s(this._defaultSnappingManager),e&&(this.snappingManager||(this._defaultSnappingManager=new j({view:e,options:this.snappingOptions})),"2d"===e.type?import("../../views/2d/interactive/editingTools.js"):"3d"===e.type&&(import("../../views/3d/interactive/editingTools.js"),import("../../views/3d/layers/GraphicsLayerView3D.js")))}),y),c((()=>this.view?.spatialReference),((e,t)=>{e&&t&&!e.equals(t)&&this.cancel()}))]),F(this)}destroy(){this.cancel(),this._removeDefaultLayer(),this.snappingManager=s(this.snappingManager),this._set("view",null),this.emit("destroy")}get _defaultUpdateTool(){return"3d"===this.view?.type?"move":"transform"}get updating(){return this._numUpdating>0||null!=this.snappingManager&&this.snappingManager.updating}get activeTool(){return this._operationHandle?.tool??null}get activeComponent(){return this._operationHandle?.activeComponent??null}get createGraphic(){return null==this.activeComponent||"draw-3d"!==this.activeComponent.type&&"draw-2d"!==this.activeComponent.type?this._get("createGraphic"):this.activeComponent.graphic}get defaultCreateOptions(){return this._get("defaultCreateOptions")}set defaultCreateOptions(e){this._set("defaultCreateOptions",{...Y,...e})}get defaultUpdateOptions(){return this._get("defaultUpdateOptions")}set defaultUpdateOptions(e){this._set("defaultUpdateOptions",{...J,...e,reshapeOptions:{...J.reshapeOptions,...e?.reshapeOptions},highlightOptions:{...J.highlightOptions,...e?.highlightOptions}})}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get snappingOptions(){return this.snappingManager?.options??this._get("snappingOptions")}set snappingOptions(e){null!=this._defaultSnappingManager&&(this._defaultSnappingManager.options=e),this._set("snappingOptions",e)}get snappingManager(){return this._isOverridden("snappingManager")&&this._get("snappingManager"),this._defaultSnappingManager}set snappingManager(e){if(e)this._isOverridden("snappingManager")||(this._defaultSnappingManager=s(this._defaultSnappingManager)),this._override("snappingManager",e);else{const{view:e}=this;!this._defaultSnappingManager&&e&&(this._defaultSnappingManager=new j({options:this.snappingOptions,view:e})),this._clearOverride("snappingManager")}}get state(){const e=!(!this.view?.ready||!this.layer),t=this._operationHandle;return e&&t?"active":e?"ready":"disabled"}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}get view(){return this._get("view")}set view(e){const t=this._get("view");if(t){const{container:e,map:o}=t;e&&(t.cursor=null),o?.remove(this._internalGraphicsLayer),this.removeHandles(this._viewHandlesKey),this.cancel()}const o="view-ready";this.removeHandles(o),e&&this.addHandles(d((()=>e.ready),(t=>{this.removeHandles(this._viewHandlesKey),t&&this.addHandles(this._generateViewHandles(e),this._viewHandlesKey)}),y),o),this._set("view",e)}cancel(){this._moduleLoaderAbortController=n(this._moduleLoaderAbortController),this._viewReadyAbortController=n(this._viewReadyAbortController),this._operationHandle&&this._operationHandle.cancel()}complete(){this._operationHandle&&this._operationHandle.complete()}delete(){const{state:e,updateGraphics:t}=this;if("active"===e&&t.length){const{activeTool:e,layer:o}=this,i=t.toArray();o.removeMany(i),this.cancel(),this._emitDeleteEvent({graphics:i,tool:e})}}duplicate(){if("active"===this.state&&this.updateGraphics.length){const e=this.updateGraphics.map((e=>e.clone())).toArray();return this.layer.addMany(e),this.emit("duplicate",{graphics:e,type:"duplicate"}),e}return[]}async create(e,t){this.cancel(),await this._waitViewReady();const{view:o,layer:i}=this;if(!o||"disabled"===this.state)throw i||this._logMissingLayer(),p();if(null!=o.activeTool&&(o.activeTool=null),!e)return void this._logError("sketch:missing-parameter","Missing parameter 'tool'.");H(o,this._internalGraphicsLayer);const a=await this._setupCreateOperation(e,t);if(null==a||this.destroyed)return void o.map.remove(this._internalGraphicsLayer);const r=()=>{if(a===this._operationHandle){const t=this.createGraphic,o=this._operationHandle.cancelled;this._operationHandle.destroy(),this._operationHandle=null,this._set("createGraphic",null),this.view?.map&&this.view.map.remove(this._internalGraphicsLayer),a.cancelled||null==t||i.add(t),this.emit("create",{graphic:t,state:o?"cancel":"complete",tool:e,toolEventInfo:null,type:"create"})}};a.on("complete",r),this._operationHandle=a,o.ready&&o.focus()}async place(e,t){return this.create("mesh",{mode:"click",hasZ:e.hasZ,geometryToPlace:e,...t})}async update(e,t){this.cancel(),await this._waitViewReady();const{layer:o,view:i,state:a}=this;if(!i||"disabled"===a)throw o||this._logMissingLayer(),p();null!=i.activeTool&&(i.activeTool=null);const r=Array.isArray(e)?e:[e];if(null==e||!r?.length)return void this._logError("sketch:missing-parameter","Missing parameter 'graphics'.");if(r.some((e=>e.layer!==o?(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics missing from the supplied GraphicsLayer."),!0):null==e.geometry&&(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics with an unsupported geometry."),!0))))return;const s=await this._setupUpdateOperation(r,t);this.destroyed||null==s||se(s)||(H(i,this._internalGraphicsLayer),this._setUpdateOperationHandle(s,t),this.emit("update",{graphics:r,state:"start",aborted:!1,tool:s.tool,toolEventInfo:null,type:"update"}))}async _updateSpatialReference(e){const t=this.view;if(t){this._beginAsyncOperation(),e=Array.isArray(e)?e:[e];for(const o of e)null==o.geometry||"mesh"===o.geometry.type||O(o.geometry.spatialReference,t.spatialReference)||(f(o.geometry.spatialReference,t.spatialReference)||_()||await w(),o.geometry=G(o.geometry,t.spatialReference));this._endAsyncOperation()}else this._logMissingView()}undo(){this.canUndo()&&this._operationHandle?.undo()}redo(){this.canRedo()&&this._operationHandle?.redo()}canUndo(){return!(!this._operationHandle||!this._operationHandle.canUndo())}canRedo(){return!(!this._operationHandle||!this._operationHandle.canRedo())}toggleUpdateTool(){this._operationHandle&&this._operationHandle.toggleTool&&this._operationHandle.toggleTool()}async _getFirstHit(e){const t=this.view;if(!t)return this._logMissingView(),null;if("2d"===t.type){const o=[];t.map.allLayers.forEach((e=>{"vector-tile"!==e.type&&"imagery"!==e.type||o.push(e)}));const i=await t.hitTest(e,{exclude:o});return V(i.results)}const o=[t.map.ground];t.map.allLayers.forEach((e=>{E(e.type)&&o.push(e)}));const i=await t.hitTest(e,{exclude:o});if(i.results.length>0){const e=i.results[0];if(null!=e&&"graphic"===e.type&&e.graphic&&(!i.ground.mapPoint||t.map.ground.opacity<1||i.ground.distance-(e.distance??0)>-Math.min(3*i.ground.distance,"global"===t.viewingMode?v(t.renderCoordsHelper.spatialReference).radius/t.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY)))return e}return null}_generateViewHandles(e){return[e.on("immediate-click",(async t=>{const o="active"===this.state&&"create"===this._operationHandle?.type;if("disabled"===this.state||o||!this.updateOnGraphicClick)return;this._beginAsyncOperation();const i=await t.async((()=>this._getFirstHit(K(t))));let a=null;if(null!=i){const o=i.graphic;this.updateGraphics.includes(o)||o.layer===this.layer?(t.stopPropagation(),a=o):"2d"!==e.type||this._isComponentGraphic(o)||"active"!==this.state||this.cancel()}else"active"===this.state&&this.cancel();null==a||this.updateGraphics.includes(a)||await this.update([a],{...this.defaultUpdateOptions,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions}}),this._endAsyncOperation()}),R.WIDGET)]}async _setupCreateOperation(e,t){const o=this.view;if(!o)return this._logMissingView(),null;const i={hasZ:"3d"===o.type,...this.defaultCreateOptions,...t},a=await this._setupDrawGraphicTool(e,o,i);return null==a?null:(o.tools.add(a),o.activeTool=a,this._setupCreateOperationHandle(a))}async _setupDrawGraphicTool(e,t,o){if("multipoint"===e&&"3d"===t.type)return this._logError("sketch:create","Multipoint geometries are not supported in SceneView."),null;if(!t)return this._logMissingView(),null;const{cursor:i,defaultZ:a,hasZ:r,geometryToPlace:s,graphicProperties:n,mode:p,preserveAspectRatio:l}=o,h="rectangle"===e||"circle"===e?"hybrid":"click",c=l??"rectangle"!==e,d={centered:"rectangle"!==e&&!("circle"===e&&!c),cursor:i,defaultZ:a,forceUniformSize:c,graphicProperties:n,geometryToPlace:s,geometryType:e,graphicSymbol:this._getGraphicSymbolFromTool(e),hasZ:r,mode:p??h,snappingManager:this.snappingManager,snapToScene:!1,view:t};return"2d"===t.type?this._makeDrawGraphicTool2D(d):this._makeDrawGraphicTool3D(d)}async _makeDrawGraphicTool2D(e){const t=await this._requireModule(import("../../views/2d/interactive/editingTools.js"));return se(t)||this.destroyed?null:new t.module.DrawGraphicTool2D({...e,activeVertexSymbol:this.activeVertexSymbol,regularVerticesSymbol:this.vertexSymbol,activeLineSymbol:this.activeLineSymbol,activeFillSymbol:te(e.geometryType)?this.activeFillSymbol:null,sketchOptions:this.sketchOptions})}async _makeDrawGraphicTool3D(e){const t=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(se(t)||this.destroyed)return null;const{elevationInfo:o}=this.layer;return new t.module.DrawGraphicTool3D({...e,elevationInfo:o,snapToScene:!0,sketchOptions:this.sketchOptions})}_setupCreateOperationHandle(e){const t=this.view;if(!t)return this._logMissingView(),null;let o=null;const i=e.forceUniformSize,a=e.centered,r=[t.on("key-down",(t=>{if(t.key===D.pan)t.stopPropagation(),t.repeat||(e.enabled=!1);else if(t.key===D.complete)t.stopPropagation(),e.completeCreateOperation();else if(t.key!==D.vertexAdd||t.repeat)t.key===D.undo?(t.stopPropagation(),s.undo()):t.key===D.redo?(t.stopPropagation(),s.redo()):t.key!==D.constraint||"rectangle"!==e.geometryType&&"circle"!==e.geometryType||t.repeat?t.key===D.center&&(t.repeat||(e.centered=!a,t.stopPropagation())):(e.forceUniformSize=!i,t.stopPropagation());else{const o=e.drawOperation.geometryType;"polyline"!==o&&"polygon"!==o&&"multipoint"!==o||(t.stopPropagation(),e.drawOperation.commitStagedVertex())}}),R.WIDGET),t.on("key-up",(t=>{t.key===D.pan?e.enabled=!0:t.key!==D.constraint||"rectangle"!==e.geometryType&&"circle"!==e.geometryType?t.key===D.center&&(e.centered=a,t.stopPropagation()):(e.forceUniformSize=i,t.stopPropagation())}),R.WIDGET),e.on("vertex-add",(t=>{switch(o=null==o?"start":"active",t.operation){case"apply":this.emit("create",{graphic:e.graphic,state:o,tool:this.activeTool,toolEventInfo:t,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[e.graphic],tool:e.geometryType});break;case"redo":this._emitRedoEvent({graphics:[e.graphic],tool:e.geometryType})}})),e.on("cursor-update",(t=>{e.drawOperation.numCommittedVertices>0&&this.emit("create",{graphic:e.graphic,state:"active",tool:this.activeTool,toolEventInfo:{coordinates:t.vertices[0].coordinates,type:"cursor-update"},type:"create"})})),e.on("vertex-remove",(t=>{switch(t.operation){case"apply":this.emit("create",{graphic:e.graphic,state:"active",tool:this.activeTool,toolEventInfo:t,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[e.graphic],tool:e.geometryType});break;case"redo":this._emitRedoEvent({graphics:[e.graphic],tool:e.geometryType})}})),e.on("complete",(e=>{this._set("createGraphic",e.graphic),o="complete",e.aborted?s&&s.cancel():s&&s.complete()})),c((()=>this._getGraphicSymbolFromTool(e.geometryType)),(t=>{e.graphicSymbol=t}))],s=new W({activeComponent:e,tool:e.geometryType,type:"create",onEnd:()=>{r.forEach((e=>e.remove())),r.length=0,t.tools?.remove(e)},undo:()=>{e.canUndo&&e.undo()},redo:()=>{e.canRedo&&e.redo()},canUndo:()=>e.canUndo,canRedo:()=>e.canRedo});return s}_getGraphicSymbolFromTool(e){switch(e){case"point":case"multipoint":return this.pointSymbol;case"polyline":return this.polylineSymbol;case"circle":case"rectangle":case"polygon":return this.polygonSymbol;case"mesh":return this.meshSymbol}}async _setupUpdateOperation(e,t){const{layer:o,view:i}=this;if(!i)return this._logMissingView(),null;const a={tool:this._defaultUpdateTool,...this.defaultUpdateOptions,...t,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions,...t?.reshapeOptions},highlightOptions:{...this.defaultUpdateOptions.highlightOptions,...t?.highlightOptions}};let r=a.tool;for(const s of e)o.remove(s),o.add(s);if("3d"===i.type){if(0===e.length)return null;switch(r){case"move":return this._setupMove3DOperation(e,a,i,r);case"reshape":{if(e.length>1)return this._logError("sketch:reshape-multiple","Reshape operation does not support multiple graphics."),null;const t=M(e[0]);return t===S.SUPPORTED?this._setupReshape3DOperation(e[0],a,i):(this._logError("sketch:reshape",`Reshape operation not supported for provided graphic(s) (${A(t)}).`),null)}case"transform":return this._setupGraphicTransform3DOperation(e,a,i)}}switch(r){case"move":return this._setupMove2DOperation(e,a,i);case"reshape":{if(e.length>1)return this._logError("sketch:reshape-multiple","Reshape operation does not support multiple graphics."),null;const t=M(e[0]);return t===S.SUPPORTED?this._setupTransformOrReshape2DOperation(e,r,a,i):(this._logError("sketch:reshape",`Reshape operation not supported for provided graphic(s) (${A(t)}).`),null)}case"transform":if(1===e.length){const t=e[0].geometry?.type;"point"!==t&&"multipoint"!==t||(r="reshape")}return this._setupTransformOrReshape2DOperation(e,r,a,i)}}async _setupMove3DOperation(e,t,o,i,a=!1){for(const l of e){const e=k(l);if(e!==S.SUPPORTED)return this._logError("sketch:move",`Move operation not supported for provided graphic(s) (${A(e)}).`),null}const r=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(se(r))return r;const s=new r.module.GraphicMoveTool({view:o,enableZ:t.enableZ,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions});o.tools.add(s),s.graphics.addMany(e),a||this.updateGraphics.addMany(e);const n=[],p=new Z({activeComponent:s,tool:i,type:"update",onEnd:()=>{n.forEach((e=>e.remove())),n.length=0,o.tools?.remove(s),s.destroyed||s.destroy()},undo:()=>{oe(p,this.updateGraphics.toArray()),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:i})},redo:()=>{ie(p,this.updateGraphics.toArray()),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:i})},addToSelection:e=>{this.updateGraphics.push(e),s.graphics.push(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:e=>{const t=this.updateGraphics.indexOf(e);p.history.undo.forEach((e=>e.updates.splice(t,1))),p.history.redo.forEach((e=>e.updates.splice(t,1))),this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),0!==this.updateGraphics.length?s.graphics.remove(e):p.complete()},toggleTool:async()=>{if(1!==this.updateGraphics.length||!1===t.toggleToolOnClick)return;if("transform"!==i)return;const e=this.updateGraphics.at(0);if(M(e)!==S.SUPPORTED)return;p.onEnd(),p.destroy();const a=await this._setupReshape3DOperation(e,t,o,!0);se(a)||this._setUpdateOperationHandle(a,t)}});return n.push(...this._getHandlesForComponent(p,t),o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(p,e,t)),R.WIDGET),o.on("key-down",(e=>{this._getCommonUpdateOperationKeyDownHandlers(p,e)}),R.WIDGET)),p}_setupGraphicTransform3DOperation(e,t,o,i=!1){if(1===e.length&&C(e[0])===S.SUPPORTED){const a=e[0],r=a.geometry;if(null!=r&&("point"===r.type||"mesh"===r.type))return this._setupPointTransform3DOperation(a,t,o);if(null!=r&&("polygon"===r.type||"polyline"===r.type))return this._setupPolyTransform3DOperation(a,t,o,i)}return this._setupMove3DOperation(e,t,o,"transform",i)}async _setupPointTransform3DOperation(e,t,o){const i="transform",{enableRotation:a,enableScaling:r,enableZ:s}=t,n=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(se(n))return n;const p=new n.module.GraphicTransformTool({graphic:e,view:o,enableRotation:a,enableScaling:r,enableZ:s,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions});o.tools.add(p),this.updateGraphics.add(e);const l=[],h=new Z({activeComponent:p,tool:i,type:"update",onEnd:()=>{l.forEach((e=>e.remove())),l.length=0,o.tools?.remove(p),p.destroyed||p.destroy()},undo:()=>{oe(h,this.updateGraphics.toArray()),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:i})},redo:()=>{ie(h,this.updateGraphics.toArray()),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:i})},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),h.onEnd(),h.destroy();const i=await this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0);se(i)||this._setUpdateOperationHandle(i,t)},removeFromSelection:e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),h.complete()},toggleTool:()=>{}});return l.push(...this._getHandlesForComponent(h,t),o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(h,e,t)),R.WIDGET),o.on("key-down",(e=>{this._getCommonUpdateOperationKeyDownHandlers(h,e)}),R.WIDGET)),h}async _setupPolyTransform3DOperation(e,t,o,i=!1){const a="transform",{enableRotation:r,enableScaling:s,enableZ:n,preserveAspectRatio:p}=t,l=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(se(l))return l;const h=this.view?.inputManager?.isModifierKeyDown(D.constraint),c=new l.module.ExtentTransformTool({graphic:e,view:o,enableRotation:r,enableScaling:s,enableZ:n,preserveAspectRatio:!!p!=!!h,sketchOptions:this.sketchOptions});o.tools.add(c),i||this.updateGraphics.add(e);const d=[],u=new Z({activeComponent:c,tool:a,type:"update",onEnd:()=>{d.forEach((e=>e.remove())),d.length=0,o.tools?.remove(c),c.destroyed||c.destroy()},canUndo:()=>c.canUndo,undo:()=>{c.undo(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:a})},canRedo:()=>c.canRedo,redo:()=>{c.redo(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:a})},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),u.onEnd(),u.destroy();const i=await this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0);se(i)||this._setUpdateOperationHandle(i,t)},removeFromSelection:e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),u.complete()},toggleTool:async()=>{if(1!==this.updateGraphics.length||!1===t.toggleToolOnClick)return;const e=this.updateGraphics.at(0);if(M(e)!==S.SUPPORTED)return;u.onEnd(),u.destroy();const i=await this._setupReshape3DOperation(e,t,o,!0);se(i)||this._setUpdateOperationHandle(i,t)}});return d.push(...this._getHandlesForComponent(u,t),o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(u,e,t)),R.WIDGET),o.on("key-down",(e=>this._getCommonUpdateOperationKeyDownHandlers(u,e)),R.WIDGET),o.on("key-down",(e=>{e.key!==D.constraint||e.repeat||(c.preserveAspectRatio=!c.preserveAspectRatio,e.stopPropagation())}),R.WIDGET),o.on("key-up",(e=>{e.key===D.constraint&&(c.preserveAspectRatio=!c.preserveAspectRatio,e.stopPropagation())}),R.WIDGET)),u}async _setupMove2DOperation(e,t,o){const i="move";this.updateGraphics.addMany(e),await this._updateSpatialReference(e);const a=await this._getGraphicMover(e,t,o);if(se(a))return a;const r=new Z({activeComponent:a,tool:i,type:"update",onEnd:()=>{this._displayDefaultCursor(),p.forEach((e=>e.remove())),n.forEach((e=>e.remove())),p=[],n=[],a.destroy(),this._internalGraphicsLayer?.removeMany([...this.updateGraphics.toArray()])},undo:()=>{const e=this.updateGraphics.toArray();oe(r,e),r.refreshComponent(),this._emitUndoEvent({graphics:e,tool:i})},redo:()=>{const e=this.updateGraphics.toArray();ie(r,e),r.refreshComponent(),this._emitRedoEvent({graphics:e,tool:i})},addToSelection:async e=>{await this._updateSpatialReference(e),this.updateGraphics.push(e),a.graphics=this.updateGraphics.toArray(),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:e=>{const t=this.updateGraphics.indexOf(e);r.history.undo.forEach((e=>e.updates.splice(t,1))),r.history.redo.forEach((e=>e.updates.splice(t,1))),this.updateGraphics.remove(e);const o=this.updateGraphics.toArray();this.emit("update",{graphics:o,state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),0!==this.updateGraphics.length?a.graphics=o:r.complete()}});let s=!1,n=[o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(r,e,t)),R.WIDGET),o.on("key-down",(e=>{this._getCommonUpdateOperationKeyDownHandlers(r,e),e.key!==D.constraint||e.repeat||(s=!0,a.enableMoveAllGraphics=!a.enableMoveAllGraphics)}),R.WIDGET),o.on("key-up",(e=>{e.key===D.constraint&&s&&(s=!1,a.enableMoveAllGraphics=!a.enableMoveAllGraphics)}),R.WIDGET)],p=this._getHandlesForComponent(r,t);return r}async _setupReshape3DOperation(e,t,o,i=!1){const a="reshape",r=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(se(r))return r;const s=t.reshapeOptions,n=new r.module.GraphicReshapeTool({view:o,graphic:e,enableZVertex:t.enableZ&&"move"===s?.vertexOperation,enableZShape:t.enableZ&&"move"===s?.shapeOperation,enableMoveGraphic:"move"===s?.shapeOperation||"move-xy"===s?.shapeOperation,enableMidpoints:"split"===s?.edgeOperation,enableEdgeOffset:"offset"===s?.edgeOperation,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions});o.tools.add(n),i||this.updateGraphics.add(e);const p=[],l=new Z({activeComponent:n,tool:a,type:"update",onEnd:()=>{p.forEach((e=>e.remove())),p.length=0,o.tools?.remove(n),n.destroyed||n.destroy()},canUndo:()=>n.canUndo,undo:()=>{n.undo(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:a})},canRedo:()=>n.canRedo,redo:()=>{n.redo(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:a})},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),l.onEnd(),l.destroy();const i=await this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0);se(i)||this._setUpdateOperationHandle(i,t)},removeFromSelection:e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),l.complete()},toggleTool:async()=>{if(!1===t.toggleToolOnClick)return;l.onEnd(),l.destroy();const e=await this._setupGraphicTransform3DOperation(this.updateGraphics.toArray(),t,o,!0);se(e)||this._setUpdateOperationHandle(e,t)}});return p.push(...this._getHandlesForComponent(l,t),o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(l,e,t)),R.WIDGET),o.on("key-down",(e=>{this._getCommonUpdateOperationKeyDownHandlers(l,e)}),R.WIDGET)),l}async _setupTransformOrReshape2DOperation(e,t,o,i){this.updateGraphics.addMany(e),await this._updateSpatialReference(e);const a="transform"===t?await this._getBox(e,o,i):await this._getReshape(e,o,i);if(se(a))return a;const r=new Z({activeComponent:a,type:"update",onEnd:()=>{n.forEach((e=>e.remove())),s.forEach((e=>e.remove())),n=[],s=[],r.activeComponent&&!r.activeComponent.destroyed&&r.activeComponent.destroy(),this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray())},undo:()=>{oe(r,this.updateGraphics.toArray()),r.refreshComponent(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:r.tool})},redo:()=>{ie(r,this.updateGraphics.toArray()),r.refreshComponent(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:r.tool})},addToSelection:async e=>{let t=r.activeComponent;if("reshape"===t?.type){const t=[...this.updateGraphics,e];this.updateGraphics.removeAll(),r.onEnd(),r.destroy();const a=await this._setupTransformOrReshape2DOperation(t,"transform",o,i);if(se(a))return;this._setUpdateOperationHandle(a,o)}else this.updateGraphics.add(e),t.graphics=this.updateGraphics.toArray(),t.refresh(),r.resetHistory();this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:async e=>{const t=this.updateGraphics.indexOf(e);r.history.undo.forEach((e=>e.updates.splice(t,1))),r.history.redo.forEach((e=>e.updates.splice(t,1))),this.updateGraphics.remove(e);const o=this.updateGraphics.toArray();if(0===o.length)r.complete();else{const e=o[0].geometry;1!==o.length||null==e||"point"!==e.type&&"multipoint"!==e.type?r.activeComponent.graphics=o:r.toggleTool()}this.emit("update",{graphics:o,state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"})},toggleTool:async()=>{if(this.updateGraphics.length>1)return;const e=this.updateGraphics.at(0),t=e.geometry;if(null!=t&&("reshape"===r.tool&&("point"===t.type||"multipoint"===t.type)||"transform"===r.tool&&"extent"===t.type))return;let a=null;"transform"===r.tool?a=await this._getReshape([e],o,i):"reshape"===r.tool&&(a=await this._getBox([e],o,i)),se(a)||(r.activeComponent?.destroy(),r.activeComponent=a,r.activeComponent&&(n.forEach((e=>e.remove())),n=this._getHandlesForComponent(r,o)))}});let s=[i.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(r,e,o)),R.WIDGET),i.on("key-down",(e=>{if(this._getCommonUpdateOperationKeyDownHandlers(r,e),e.key===D.constraint&&!e.repeat&&r){const e=r.activeComponent;e&&"box"===e.type&&(e.preserveAspectRatio=!e.preserveAspectRatio)}}),R.WIDGET),i.on("key-up",(e=>{if(e.key===D.constraint&&r){const e=r.activeComponent;e&&"box"===e.type&&(e.preserveAspectRatio=!e.preserveAspectRatio)}}),R.WIDGET)],n=this._getHandlesForComponent(r,o);return r}async _getGraphicMover(e,t,o){const{enableMoveAllGraphics:i,highlightOptions:a}=t,r=await this._requireModule(import("../../views/draw/support/GraphicMover.js"));return se(r)?r:new r.module.default({enableMoveAllGraphics:i,highlightsEnabled:!!a?.enabled,indicatorsEnabled:!1,graphics:e,view:o,callbacks:{onGraphicMoveStart:({dx:e,dy:t,graphic:o})=>{this._displayGrabbingCursor(),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move-start"},type:"update"})},onGraphicMove:({dx:e,dy:t,graphic:o})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move"},type:"update"}),onGraphicMoveStop:({dx:e,dy:t,graphic:o})=>{this._displayPointerCursor(),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move-stop"},type:"update"})},onGraphicPointerOver:()=>this._displayPointerCursor(),onGraphicPointerOut:()=>this._displayDefaultCursor()}})}async _getBox(e,t,o){const{enableRotation:i,enableScaling:a,highlightOptions:r,preserveAspectRatio:s}=t,n=await this._requireModule(import("../../views/draw/support/Box.js"));if(se(n))return n;const p=this.view?.inputManager?.isModifierKeyDown(D.constraint);return new n.module.default({graphics:e,enableRotation:i,enableScaling:a,highlightsEnabled:!!r?.enabled,preserveAspectRatio:!!s!=!!p,layer:this._internalGraphicsLayer,view:o,sketchOptions:this.sketchOptions,callbacks:{onMoveStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onMove:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onMoveStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScaleStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScale:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScaleStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotateStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotate:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotateStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"})}})}async _getReshape(e,t,o){const i="split"===t.reshapeOptions?.edgeOperation,a="move"===t.reshapeOptions?.shapeOperation,r=!!t.highlightOptions?.enabled,s=await this._requireModule(import("../../views/draw/support/Reshape.js"));return se(s)?s:new s.module.default({enableMidpoints:i,enableMovement:a,graphic:e[0],highlightsEnabled:r,layer:this._internalGraphicsLayer,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions,view:o,callbacks:{onReshapeStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onReshape:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onReshapeStop:({mover:e,type:t})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e,type:t},type:"update"}),onMoveStart:({dx:e,dy:t,mover:o,type:i})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:i},type:"update"}),onMove:({dx:e,dy:t,mover:o,type:i})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:i},type:"update"}),onMoveStop:({dx:e,dy:t,mover:o,type:i})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:i},type:"update"}),onVertexAdd:({added:e,type:t,vertices:o})=>{const i=e.map((e=>b(e.geometry)));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:i,vertices:o,type:t},type:"update"})},onVertexRemove:({removed:e,type:t,vertices:o})=>{const i=e.map((e=>b(e.geometry)));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{removed:i,vertices:o,type:t},type:"update"})}}})}_getHandlesForComponent(e,t){const o=e.activeComponent;if(!o)return[];switch(o.type){case"graphic-mover":return[o.on("graphic-click",(({graphic:t,viewEvent:o})=>{o.native?.shiftKey&&(o.stopPropagation(),e.removeFromSelection(t))})),o.on("graphic-move-start",(t=>e.addToHistory(re(t.allGraphics))))];case"box":return[o.on("graphic-click",(o=>this._onTransformOrReshape2DGraphicClick(e,t,o))),o.on("move-start",(t=>e.addToHistory(re(t.graphics)))),o.on("rotate-start",(t=>e.addToHistory(re(t.graphics)))),o.on("scale-start",(t=>e.addToHistory(re(t.graphics))))];case"reshape":return[o.on("graphic-click",(o=>this._onTransformOrReshape2DGraphicClick(e,t,o))),o.on("move-start",(t=>e.addToHistory(re([t.mover])))),o.on("reshape-start",(t=>e.addToHistory(re([t.graphic])))),o.on("vertex-add",(t=>e.addToHistory(re([t.oldGraphic])))),o.on("vertex-remove",(t=>e.addToHistory(re([t.oldGraphic]))))];case"move-3d":return[o.on("graphic-move-start",(t=>{e.addToHistory(re(t.allGraphics)),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:t.allGraphics.length>0?t.allGraphics[0]:null,type:"move-start"},type:"update"})})),o.on("graphic-move",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e.dx,dy:e.dy,mover:e.allGraphics.length>0?e.allGraphics[0]:null,type:"move"},type:"update"})})),o.on("graphic-move-stop",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:e.allGraphics.length>0?e.allGraphics[0]:null,type:"move-stop"},type:"update"})})),o.on("immediate-click",(o=>{o.shiftKey?this._toggleSelection([o.graphic],e,t):e.toggleTool()}))];case"transform-3d":return[o.on("record-undo",(({record:t})=>{e.addToHistory({updates:[t]})})),o.on("graphic-translate-start",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move-start"},type:"update"})})),o.on("graphic-translate-stop",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move-stop"},type:"update"})})),o.on("graphic-rotate-start",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.graphic,angle:e.angle,type:"rotate-start"},type:"update"})})),o.on("graphic-rotate-stop",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.graphic,angle:e.angle,type:"rotate-stop"},type:"update"})})),o.on("graphic-scale-start",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale-start"},type:"update"})})),o.on("graphic-scale-stop",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale-stop"},type:"update"})})),o.on("graphic-translate",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move"},type:"update"})})),o.on("graphic-rotate",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.graphic,angle:e.angle,type:"rotate"},type:"update"})})),o.on("graphic-scale",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale"},type:"update"})})),o.on("immediate-click",(o=>{o.shiftKey?this._toggleSelection([o.graphic],e,t):e.toggleTool()}))];case"reshape-3d":return[o.on("reshape",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})})),o.on("move",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})})),o.on("vertex-add",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})})),o.on("vertex-remove",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})})),o.on("immediate-click",(o=>{o.shiftKey?this._toggleSelection([o.graphic],e,t):e.toggleTool()}))]}}_onTransformOrReshape2DGraphicClick(e,t,o){const{graphic:i,viewEvent:a}=o;return a.native?.shiftKey&&i.layer===this.layer?(a.stopPropagation(),e.removeFromSelection(i)):t.toggleToolOnClick?(a.stopPropagation(),e.toggleTool()):void 0}_setUpdateOperationHandle(e,t){this._operationHandle=e;const o=this.view?.map;this._disablePopup(t);const i=()=>{if(e===this._operationHandle){const i=this.updateGraphics.toArray(),a=this._operationHandle.tool;this._operationHandle.destroy(),this._operationHandle=null,this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray()),this.updateGraphics.removeAll(),o&&o.remove(this._internalGraphicsLayer),this._restorePopup(t),this.emit("update",{graphics:i,state:"complete",aborted:e.cancelled,tool:a,toolEventInfo:null,type:"update"})}};e.on("complete",i)}async _getCommonUpdateOperationClickHandlers(e,t,o){const i=K(t),a=await t.async((()=>this._getFirstHit(i)));if(null==a)return void e.complete();if(t.native.shiftKey&&this._toggleSelection([a.graphic],e,o))return void t.stopPropagation();this.updateGraphics.includes(a.graphic)?t.stopPropagation():e.complete()}_toggleSelection(e,t,o){const i=!!o.multipleSelectionEnabled;return e.some((e=>null!=e&&(!(!i||e.layer!==this.layer)&&(this.updateGraphics.includes(e)?t.removeFromSelection(e):t.addToSelection(e),!0))))}_getCommonUpdateOperationKeyDownHandlers(e,t){if(!e)return;const o=t.key;o===D.undo&&e.canUndo()?(t.stopPropagation(),e.undo()):o===D.redo&&e.canRedo()?(t.stopPropagation(),e.redo()):o===D.cancel?(t.stopPropagation(),e.cancel()):this.allowDeleteKey&&D.delete.includes(o)&&this._onDeleteKey(t)}_onDeleteKey(e){if(!this._operationHandle||"update"!==this._operationHandle.type)return;const t=this.activeComponent,o=this.updateGraphics.toArray();null!=t&&"reshape-3d"!==t.type&&("reshape"!==t.type||1===o.length&&"point"===o[0].geometry?.type)&&(e.stopPropagation(),this.delete())}_removeDefaultLayer(){this._internalGraphicsLayer&&(this.view?.map?.remove(this._internalGraphicsLayer),this._internalGraphicsLayer=s(this._internalGraphicsLayer))}_isComponentGraphic(e){const{activeComponent:t}=this;return!(!e||null==t)&&(e.attributes?.esriSketchTool||"draw-2d"===t.type&&t.graphic===e||("box"===t.type||"reshape"===t.type)&&t.isUIGraphic(e))}_displayPointerCursor(){this.view?.container&&"pointer"!==this.view.cursor&&(this.view.cursor="pointer")}_displayGrabbingCursor(){this.view?.container&&"grabbing"!==this.view.cursor&&(this.view.cursor="grabbing")}_displayDefaultCursor(){this.view?.container&&null!==this.view.cursor&&(this.view.cursor=null)}_logError(e,t,o){r.getLogger(this).error(new i(e,t,o))}async _requireModule(e){const t=new AbortController;this._moduleLoaderAbortController=t;const o=await e;return this._moduleLoaderAbortController!==t||t.signal.aborted?{requireError:"aborted"}:{module:o}}_emitUndoEvent(e){this.emit("undo",{...e,type:"undo"})}_emitRedoEvent(e){this.emit("redo",{...e,type:"redo"})}_emitDeleteEvent(e){this.emit("delete",{...e,type:"delete"})}get test(){return{operationHandle:this._operationHandle,snappingManager:this.snappingManager,defaultUpdateOptions:J}}wait(){return u((()=>!this.updating))}_beginAsyncOperation(){this._numUpdating+=1,this.notifyChange("updating")}_endAsyncOperation(){this._numUpdating-=1,this.notifyChange("updating")}_disablePopupEnabled(e){return"3d"!==this.view?.type||this.updateOnGraphicClick||(e?.toggleToolOnClick??!1)}_disablePopup(e){this._disablePopupEnabled(e)&&this.view&&null==this._originalPopupEnabled&&(this._originalPopupEnabled=this.view.popupEnabled,this.view.popupEnabled=!1)}_restorePopup(e){this._disablePopupEnabled(e)&&this.view&&null!=this._originalPopupEnabled&&(this.view.popupEnabled=this._originalPopupEnabled,this._originalPopupEnabled=null)}async _waitViewReady(){const e=this.view;e?(n(this._viewReadyAbortController),this._viewReadyAbortController=new AbortController,await l(u((()=>e?.ready)),this._viewReadyAbortController.signal)):this._logMissingView()}_logMissingView(){this._logError("sketch:missing-property",ee("view"))}_logMissingLayer(){this._logError(X,ee("layer"))}};e([m()],Q.prototype,"_defaultSnappingManager",void 0),e([m()],Q.prototype,"updating",null),e([m()],Q.prototype,"_operationHandle",void 0),e([m({readOnly:!0})],Q.prototype,"activeTool",null),e([m()],Q.prototype,"activeFillSymbol",void 0),e([m()],Q.prototype,"activeLineSymbol",void 0),e([m()],Q.prototype,"activeVertexSymbol",void 0),e([m()],Q.prototype,"allowDeleteKey",void 0),e([m({readOnly:!0})],Q.prototype,"createGraphic",null),e([m()],Q.prototype,"defaultCreateOptions",null),e([m()],Q.prototype,"defaultUpdateOptions",null),e([m({type:I,nonNullable:!0})],Q.prototype,"labelOptions",null),e([m()],Q.prototype,"layer",void 0),e([m({types:t})],Q.prototype,"pointSymbol",void 0),e([m({types:t})],Q.prototype,"polygonSymbol",void 0),e([m({types:t})],Q.prototype,"polylineSymbol",void 0),e([m()],Q.prototype,"meshSymbol",void 0),e([m({type:L,nonNullable:!0})],Q.prototype,"snappingOptions",null),e([m()],Q.prototype,"snappingManager",null),e([m({readOnly:!0})],Q.prototype,"state",null),e([m({type:x,nonNullable:!0})],Q.prototype,"tooltipOptions",null),e([m({readOnly:!0})],Q.prototype,"updateGraphics",void 0),e([m()],Q.prototype,"updateOnGraphicClick",void 0),e([m({type:P,nonNullable:!0})],Q.prototype,"valueOptions",null),e([m({types:t})],Q.prototype,"vertexSymbol",void 0),e([m({value:null})],Q.prototype,"view",null),e([m({constructOnly:!0,type:U})],Q.prototype,"sketchOptions",void 0),Q=e([g("esri.widgets.Sketch.SketchViewModel")],Q);const X="sketch:missing-property",ee=e=>`Property '${e}' is missing on SketchViewModel.`;function te(e){return"polygon"===e||"rectangle"===e||"circle"===e}function oe(e,t){ae("undo",e.history.undo,e.history.redo,t)}function ie(e,t){ae("redo",e.history.redo,e.history.undo,t)}function ae(e,t,o,i){const a=t.pop();if(!a)return;const r=a.updates,s=[];i.forEach(((t,o)=>{const i=r[o];null!=i&&("geometry"in i&&null!=i.geometry&&(s.push({geometry:t.geometry}),t.geometry=i.geometry),"symbol"in i&&null!=i.symbol&&(s.push({symbol:t.symbol}),t.symbol=i.symbol),"undo"in i&&(s.push(i),i[e](t)))})),o.push({updates:s})}function re(e){return{updates:e.map((e=>({geometry:e.geometry})))}}function se(e){return"requireError"in e&&"aborted"===e.requireError}const ne=Q;export{ne as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{symbolTypes as t}from"../../symbols.js";import o from"../../core/Collection.js";import i from"../../core/Error.js";import a from"../../core/Evented.js";import r from"../../core/Logger.js";import{destroyMaybe as s,abortMaybe as n}from"../../core/maybe.js";import{createAbortError as p,whenOrAbort as l}from"../../core/promiseUtils.js";import{on as h,watch as c,when as d,whenOnce as u,syncAndInitial as y}from"../../core/reactiveUtils.js";import{property as m}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as g}from"../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as v}from"../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as f,isLoaded as _,load as w,project as G}from"../../geometry/projection.js";import{geometryToCoordinates as b}from"../../geometry/support/coordsUtils.js";import{equals as O}from"../../geometry/support/spatialReferenceUtils.js";import T from"../../layers/GraphicsLayer.js";import{isIntegratedMeshLayer as E}from"../../layers/support/layerUtils.js";import{SupportedGraphicResult as S,isSupportedGraphicResultMessage as A}from"../../views/3d/interactive/editingTools/isSupportedGraphicUtils.js";import{isSupportedGraphic as k}from"../../views/3d/interactive/editingTools/moveGraphic/isSupportedGraphic.js";import{isSupportedGraphic as M}from"../../views/3d/interactive/editingTools/reshapeGraphic/isSupportedGraphic.js";import{isSupportedGraphic as C}from"../../views/3d/interactive/editingTools/transformGraphic/isSupportedGraphic.js";import{addUniqueLayer as H}from"../../views/draw/support/layerUtils.js";import{ViewEventPriorities as R}from"../../views/input/InputManager.js";import{sketchKeys as D}from"../../views/interactive/keybindings.js";import I from"../../views/interactive/sketch/SketchLabelOptions.js";import U from"../../views/interactive/sketch/SketchOptions.js";import x from"../../views/interactive/sketch/SketchTooltipOptions.js";import P from"../../views/interactive/sketch/SketchValueOptions.js";import{SnappingManager as j}from"../../views/interactive/snapping/SnappingManager.js";import L from"../../views/interactive/snapping/SnappingOptions.js";import{setupSnappingToggleHandles as F}from"../../views/interactive/snapping/snappingUtils.js";import{findFirstGraphicHit as V}from"../../views/support/hitTestSelectUtils.js";import{createScreenPointFromEvent as K}from"../../views/support/screenUtils.js";import{CreateOperationHandle as W,UpdateOperationHandle as Z}from"./support/OperationHandle.js";import q from"../../symbols/SimpleMarkerSymbol.js";import z from"../../symbols/SimpleFillSymbol.js";import N from"../../symbols/SimpleLineSymbol.js";import B from"../../symbols/MeshSymbol3D.js";import $ from"../../symbols/FillSymbol3DLayer.js";const Y={defaultZ:0},J={reshapeOptions:{edgeOperation:"split",shapeOperation:"move",vertexOperation:"move"},enableMoveAllGraphics:!0,enableRotation:!0,enableScaling:!0,multipleSelectionEnabled:!0,preserveAspectRatio:!1,toggleToolOnClick:!0,enableZ:!0,highlightOptions:{enabled:!0},tool:"transform"};let Q=class extends a.EventedAccessor{constructor(e){super(e),this._numUpdating=0,this._defaultSnappingManager=null,this._internalGraphicsLayer=new T({listMode:"hide",internal:!0,title:"SVM Internal"}),this._operationHandle=null,this._viewHandlesKey="viewHandles",this.activeFillSymbol=null,this.activeLineSymbol=null,this.activeVertexSymbol=null,this.allowDeleteKey=!0,this.layer=null,this.pointSymbol=new q({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}}),this.polygonSymbol=new z({color:[150,150,150,.2],outline:{color:[50,50,50],width:2}}),this.polylineSymbol=new N({color:[130,130,130,1],width:2}),this.meshSymbol=new B({symbolLayers:new o([new $])}),this.updateGraphics=new o,this.updateOnGraphicClick=!0,this.vertexSymbol=new q({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}}),this.sketchOptions=new U,this._moduleLoaderAbortController=null,this._viewReadyAbortController=null,this._originalPopupEnabled=null,this.defaultCreateOptions=Y,this.defaultUpdateOptions=J,this.snappingOptions=e?.snappingManager?.options??e?.snappingOptions??new L}initialize(){this.addHandles([h((()=>this.view?.map?.layers),"change",(e=>{e.removed.includes(this.layer)&&this.cancel()})),h((()=>this.layer?.graphics),"change",(e=>{if(null!=this._operationHandle)for(const t of e.removed)this.updateGraphics.includes(t)&&(this.updateGraphics.length>1?this._operationHandle.removeFromSelection(t):this._operationHandle.cancel())})),c((()=>this.layer?.elevationInfo??null),(e=>{e!==this._internalGraphicsLayer.elevationInfo&&(this.cancel(),this._internalGraphicsLayer.elevationInfo=e)}),y),c((()=>this.view),(e=>{this._defaultSnappingManager=s(this._defaultSnappingManager),e&&(this.snappingManager||(this._defaultSnappingManager=new j({view:e,options:this.snappingOptions})),"2d"===e.type?import("../../views/2d/interactive/editingTools.js"):"3d"===e.type&&(import("../../views/3d/interactive/editingTools.js"),import("../../views/3d/layers/GraphicsLayerView3D.js")))}),y),c((()=>this.view?.spatialReference),((e,t)=>{e&&t&&!e.equals(t)&&this.cancel()}))]),F(this)}destroy(){this.cancel(),this._removeDefaultLayer(),this._defaultSnappingManager=s(this._defaultSnappingManager),this._set("snappingManager",null),this._set("view",null),this.emit("destroy")}get _defaultUpdateTool(){return"3d"===this.view?.type?"move":"transform"}get updating(){return this._numUpdating>0||null!=this.snappingManager&&this.snappingManager.updating}get activeTool(){return this._operationHandle?.tool??null}get activeComponent(){return this._operationHandle?.activeComponent??null}get createGraphic(){return null==this.activeComponent||"draw-3d"!==this.activeComponent.type&&"draw-2d"!==this.activeComponent.type?this._get("createGraphic"):this.activeComponent.graphic}get defaultCreateOptions(){return this._get("defaultCreateOptions")}set defaultCreateOptions(e){this._set("defaultCreateOptions",{...Y,...e})}get defaultUpdateOptions(){return this._get("defaultUpdateOptions")}set defaultUpdateOptions(e){this._set("defaultUpdateOptions",{...J,...e,reshapeOptions:{...J.reshapeOptions,...e?.reshapeOptions},highlightOptions:{...J.highlightOptions,...e?.highlightOptions}})}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get snappingOptions(){return this.snappingManager?.options??this._get("snappingOptions")}set snappingOptions(e){null!=this._defaultSnappingManager&&(this._defaultSnappingManager.options=e),this._set("snappingOptions",e)}get snappingManager(){return this._isOverridden("snappingManager")&&this._get("snappingManager"),this._defaultSnappingManager}set snappingManager(e){if(e)this._isOverridden("snappingManager")||(this._defaultSnappingManager=s(this._defaultSnappingManager)),this._override("snappingManager",e);else{const{view:e}=this;!this._defaultSnappingManager&&e&&(this._defaultSnappingManager=new j({options:this.snappingOptions,view:e})),this._clearOverride("snappingManager")}}get state(){const e=!(!this.view?.ready||!this.layer),t=this._operationHandle;return e&&t?"active":e?"ready":"disabled"}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}get view(){return this._get("view")}set view(e){const t=this._get("view");if(t){const{container:e,map:o}=t;e&&(t.cursor=null),o?.remove(this._internalGraphicsLayer),this.removeHandles(this._viewHandlesKey),this.cancel()}const o="view-ready";this.removeHandles(o),e&&this.addHandles(d((()=>e.ready),(t=>{this.removeHandles(this._viewHandlesKey),t&&this.addHandles(this._generateViewHandles(e),this._viewHandlesKey)}),y),o),this._set("view",e)}cancel(){this._moduleLoaderAbortController=n(this._moduleLoaderAbortController),this._viewReadyAbortController=n(this._viewReadyAbortController),this._operationHandle&&this._operationHandle.cancel()}complete(){this._operationHandle&&this._operationHandle.complete()}delete(){const{state:e,updateGraphics:t}=this;if("active"===e&&t.length){const{activeTool:e,layer:o}=this,i=t.toArray();o.removeMany(i),this.cancel(),this._emitDeleteEvent({graphics:i,tool:e})}}duplicate(){if("active"===this.state&&this.updateGraphics.length){const e=this.updateGraphics.map((e=>e.clone())).toArray();return this.layer.addMany(e),this.emit("duplicate",{graphics:e,type:"duplicate"}),e}return[]}async create(e,t){this.cancel(),await this._waitViewReady();const{view:o,layer:i}=this;if(!o||"disabled"===this.state)throw i||this._logMissingLayer(),p();if(null!=o.activeTool&&(o.activeTool=null),!e)return void this._logError("sketch:missing-parameter","Missing parameter 'tool'.");H(o,this._internalGraphicsLayer);const a=await this._setupCreateOperation(e,t);if(null==a||this.destroyed)return void o.map.remove(this._internalGraphicsLayer);const r=()=>{if(a===this._operationHandle){const t=this.createGraphic,o=this._operationHandle.cancelled;this._operationHandle.destroy(),this._operationHandle=null,this._set("createGraphic",null),this.view?.map&&this.view.map.remove(this._internalGraphicsLayer),a.cancelled||null==t||i.add(t),this.emit("create",{graphic:t,state:o?"cancel":"complete",tool:e,toolEventInfo:null,type:"create"})}};a.on("complete",r),this._operationHandle=a,o.ready&&o.focus()}async place(e,t){return this.create("mesh",{mode:"click",hasZ:e.hasZ,geometryToPlace:e,...t})}async update(e,t){this.cancel(),await this._waitViewReady();const{layer:o,view:i,state:a}=this;if(!i||"disabled"===a)throw o||this._logMissingLayer(),p();null!=i.activeTool&&(i.activeTool=null);const r=Array.isArray(e)?e:[e];if(null==e||!r?.length)return void this._logError("sketch:missing-parameter","Missing parameter 'graphics'.");if(r.some((e=>e.layer!==o?(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics missing from the supplied GraphicsLayer."),!0):null==e.geometry&&(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics with an unsupported geometry."),!0))))return;const s=await this._setupUpdateOperation(r,t);this.destroyed||null==s||se(s)||(H(i,this._internalGraphicsLayer),this._setUpdateOperationHandle(s,t),this.emit("update",{graphics:r,state:"start",aborted:!1,tool:s.tool,toolEventInfo:null,type:"update"}))}async _updateSpatialReference(e){const t=this.view;if(t){this._beginAsyncOperation(),e=Array.isArray(e)?e:[e];for(const o of e)null==o.geometry||"mesh"===o.geometry.type||O(o.geometry.spatialReference,t.spatialReference)||(f(o.geometry.spatialReference,t.spatialReference)||_()||await w(),o.geometry=G(o.geometry,t.spatialReference));this._endAsyncOperation()}else this._logMissingView()}undo(){this.canUndo()&&this._operationHandle?.undo()}redo(){this.canRedo()&&this._operationHandle?.redo()}canUndo(){return!(!this._operationHandle||!this._operationHandle.canUndo())}canRedo(){return!(!this._operationHandle||!this._operationHandle.canRedo())}toggleUpdateTool(){this._operationHandle&&this._operationHandle.toggleTool&&this._operationHandle.toggleTool()}async _getFirstHit(e){const t=this.view;if(!t)return this._logMissingView(),null;if("2d"===t.type){const o=[];t.map.allLayers.forEach((e=>{"vector-tile"!==e.type&&"imagery"!==e.type||o.push(e)}));const i=await t.hitTest(e,{exclude:o});return V(i.results)}const o=[t.map.ground];t.map.allLayers.forEach((e=>{E(e.type)&&o.push(e)}));const i=await t.hitTest(e,{exclude:o});if(i.results.length>0){const e=i.results[0];if(null!=e&&"graphic"===e.type&&e.graphic&&(!i.ground.mapPoint||t.map.ground.opacity<1||i.ground.distance-(e.distance??0)>-Math.min(3*i.ground.distance,"global"===t.viewingMode?v(t.renderCoordsHelper.spatialReference).radius/t.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY)))return e}return null}_generateViewHandles(e){return[e.on("immediate-click",(async t=>{const o="active"===this.state&&"create"===this._operationHandle?.type;if("disabled"===this.state||o||!this.updateOnGraphicClick)return;this._beginAsyncOperation();const i=await t.async((()=>this._getFirstHit(K(t))));let a=null;if(null!=i){const o=i.graphic;this.updateGraphics.includes(o)||o.layer===this.layer?(t.stopPropagation(),a=o):"2d"!==e.type||this._isComponentGraphic(o)||"active"!==this.state||this.cancel()}else"active"===this.state&&this.cancel();null==a||this.updateGraphics.includes(a)||await this.update([a],{...this.defaultUpdateOptions,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions}}),this._endAsyncOperation()}),R.WIDGET)]}async _setupCreateOperation(e,t){const o=this.view;if(!o)return this._logMissingView(),null;const i={hasZ:"3d"===o.type,...this.defaultCreateOptions,...t},a=await this._setupDrawGraphicTool(e,o,i);return null==a?null:(o.tools.add(a),o.activeTool=a,this._setupCreateOperationHandle(a))}async _setupDrawGraphicTool(e,t,o){if("multipoint"===e&&"3d"===t.type)return this._logError("sketch:create","Multipoint geometries are not supported in SceneView."),null;if(!t)return this._logMissingView(),null;const{cursor:i,defaultZ:a,hasZ:r,geometryToPlace:s,graphicProperties:n,mode:p,preserveAspectRatio:l}=o,h="rectangle"===e||"circle"===e?"hybrid":"click",c=l??"rectangle"!==e,d={centered:"rectangle"!==e&&!("circle"===e&&!c),cursor:i,defaultZ:a,forceUniformSize:c,graphicProperties:n,geometryToPlace:s,geometryType:e,graphicSymbol:this._getGraphicSymbolFromTool(e),hasZ:r,mode:p??h,snappingManager:this.snappingManager,snapToScene:!1,view:t};return"2d"===t.type?this._makeDrawGraphicTool2D(d):this._makeDrawGraphicTool3D(d)}async _makeDrawGraphicTool2D(e){const t=await this._requireModule(import("../../views/2d/interactive/editingTools.js"));return se(t)||this.destroyed?null:new t.module.DrawGraphicTool2D({...e,activeVertexSymbol:this.activeVertexSymbol,regularVerticesSymbol:this.vertexSymbol,activeLineSymbol:this.activeLineSymbol,activeFillSymbol:te(e.geometryType)?this.activeFillSymbol:null,sketchOptions:this.sketchOptions})}async _makeDrawGraphicTool3D(e){const t=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(se(t)||this.destroyed)return null;const{elevationInfo:o}=this.layer;return new t.module.DrawGraphicTool3D({...e,elevationInfo:o,snapToScene:!0,sketchOptions:this.sketchOptions})}_setupCreateOperationHandle(e){const t=this.view;if(!t)return this._logMissingView(),null;let o=null;const i=e.forceUniformSize,a=e.centered,r=[t.on("key-down",(t=>{if(t.key===D.pan)t.stopPropagation(),t.repeat||(e.enabled=!1);else if(t.key===D.complete)t.stopPropagation(),e.completeCreateOperation();else if(t.key!==D.vertexAdd||t.repeat)t.key===D.undo?(t.stopPropagation(),s.undo()):t.key===D.redo?(t.stopPropagation(),s.redo()):t.key!==D.constraint||"rectangle"!==e.geometryType&&"circle"!==e.geometryType||t.repeat?t.key===D.center&&(t.repeat||(e.centered=!a,t.stopPropagation())):(e.forceUniformSize=!i,t.stopPropagation());else{const o=e.drawOperation.geometryType;"polyline"!==o&&"polygon"!==o&&"multipoint"!==o||(t.stopPropagation(),e.drawOperation.commitStagedVertex())}}),R.WIDGET),t.on("key-up",(t=>{t.key===D.pan?e.enabled=!0:t.key!==D.constraint||"rectangle"!==e.geometryType&&"circle"!==e.geometryType?t.key===D.center&&(e.centered=a,t.stopPropagation()):(e.forceUniformSize=i,t.stopPropagation())}),R.WIDGET),e.on("vertex-add",(t=>{switch(o=null==o?"start":"active",t.operation){case"apply":this.emit("create",{graphic:e.graphic,state:o,tool:this.activeTool,toolEventInfo:t,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[e.graphic],tool:e.geometryType});break;case"redo":this._emitRedoEvent({graphics:[e.graphic],tool:e.geometryType})}})),e.on("cursor-update",(t=>{e.drawOperation.numCommittedVertices>0&&this.emit("create",{graphic:e.graphic,state:"active",tool:this.activeTool,toolEventInfo:{coordinates:t.vertices[0].coordinates,type:"cursor-update"},type:"create"})})),e.on("vertex-remove",(t=>{switch(t.operation){case"apply":this.emit("create",{graphic:e.graphic,state:"active",tool:this.activeTool,toolEventInfo:t,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[e.graphic],tool:e.geometryType});break;case"redo":this._emitRedoEvent({graphics:[e.graphic],tool:e.geometryType})}})),e.on("complete",(e=>{this._set("createGraphic",e.graphic),o="complete",e.aborted?s&&s.cancel():s&&s.complete()})),c((()=>this._getGraphicSymbolFromTool(e.geometryType)),(t=>{e.graphicSymbol=t}))],s=new W({activeComponent:e,tool:e.geometryType,type:"create",onEnd:()=>{r.forEach((e=>e.remove())),r.length=0,t.tools?.remove(e)},undo:()=>{e.canUndo&&e.undo()},redo:()=>{e.canRedo&&e.redo()},canUndo:()=>e.canUndo,canRedo:()=>e.canRedo});return s}_getGraphicSymbolFromTool(e){switch(e){case"point":case"multipoint":return this.pointSymbol;case"polyline":return this.polylineSymbol;case"circle":case"rectangle":case"polygon":return this.polygonSymbol;case"mesh":return this.meshSymbol}}async _setupUpdateOperation(e,t){const{layer:o,view:i}=this;if(!i)return this._logMissingView(),null;const a={tool:this._defaultUpdateTool,...this.defaultUpdateOptions,...t,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions,...t?.reshapeOptions},highlightOptions:{...this.defaultUpdateOptions.highlightOptions,...t?.highlightOptions}};let r=a.tool;for(const s of e)o.remove(s),o.add(s);if("3d"===i.type){if(0===e.length)return null;switch(r){case"move":return this._setupMove3DOperation(e,a,i,r);case"reshape":{if(e.length>1)return this._logError("sketch:reshape-multiple","Reshape operation does not support multiple graphics."),null;const t=M(e[0]);return t===S.SUPPORTED?this._setupReshape3DOperation(e[0],a,i):(this._logError("sketch:reshape",`Reshape operation not supported for provided graphic(s) (${A(t)}).`),null)}case"transform":return this._setupGraphicTransform3DOperation(e,a,i)}}switch(r){case"move":return this._setupMove2DOperation(e,a,i);case"reshape":{if(e.length>1)return this._logError("sketch:reshape-multiple","Reshape operation does not support multiple graphics."),null;const t=M(e[0]);return t===S.SUPPORTED?this._setupTransformOrReshape2DOperation(e,r,a,i):(this._logError("sketch:reshape",`Reshape operation not supported for provided graphic(s) (${A(t)}).`),null)}case"transform":if(1===e.length){const t=e[0].geometry?.type;"point"!==t&&"multipoint"!==t||(r="reshape")}return this._setupTransformOrReshape2DOperation(e,r,a,i)}}async _setupMove3DOperation(e,t,o,i,a=!1){for(const l of e){const e=k(l);if(e!==S.SUPPORTED)return this._logError("sketch:move",`Move operation not supported for provided graphic(s) (${A(e)}).`),null}const r=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(se(r))return r;const s=new r.module.GraphicMoveTool({view:o,enableZ:t.enableZ,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions});o.tools.add(s),s.graphics.addMany(e),a||this.updateGraphics.addMany(e);const n=[],p=new Z({activeComponent:s,tool:i,type:"update",onEnd:()=>{n.forEach((e=>e.remove())),n.length=0,o.tools?.remove(s),s.destroyed||s.destroy()},undo:()=>{oe(p,this.updateGraphics.toArray()),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:i})},redo:()=>{ie(p,this.updateGraphics.toArray()),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:i})},addToSelection:e=>{this.updateGraphics.push(e),s.graphics.push(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:e=>{const t=this.updateGraphics.indexOf(e);p.history.undo.forEach((e=>e.updates.splice(t,1))),p.history.redo.forEach((e=>e.updates.splice(t,1))),this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),0!==this.updateGraphics.length?s.graphics.remove(e):p.complete()},toggleTool:async()=>{if(1!==this.updateGraphics.length||!1===t.toggleToolOnClick)return;if("transform"!==i)return;const e=this.updateGraphics.at(0);if(M(e)!==S.SUPPORTED)return;p.onEnd(),p.destroy();const a=await this._setupReshape3DOperation(e,t,o,!0);se(a)||this._setUpdateOperationHandle(a,t)}});return n.push(...this._getHandlesForComponent(p,t),o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(p,e,t)),R.WIDGET),o.on("key-down",(e=>{this._getCommonUpdateOperationKeyDownHandlers(p,e)}),R.WIDGET)),p}_setupGraphicTransform3DOperation(e,t,o,i=!1){if(1===e.length&&C(e[0])===S.SUPPORTED){const a=e[0],r=a.geometry;if(null!=r&&("point"===r.type||"mesh"===r.type))return this._setupPointTransform3DOperation(a,t,o);if(null!=r&&("polygon"===r.type||"polyline"===r.type))return this._setupPolyTransform3DOperation(a,t,o,i)}return this._setupMove3DOperation(e,t,o,"transform",i)}async _setupPointTransform3DOperation(e,t,o){const i="transform",{enableRotation:a,enableScaling:r,enableZ:s}=t,n=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(se(n))return n;const p=new n.module.GraphicTransformTool({graphic:e,view:o,enableRotation:a,enableScaling:r,enableZ:s,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions});o.tools.add(p),this.updateGraphics.add(e);const l=[],h=new Z({activeComponent:p,tool:i,type:"update",onEnd:()=>{l.forEach((e=>e.remove())),l.length=0,o.tools?.remove(p),p.destroyed||p.destroy()},undo:()=>{oe(h,this.updateGraphics.toArray()),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:i})},redo:()=>{ie(h,this.updateGraphics.toArray()),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:i})},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),h.onEnd(),h.destroy();const i=await this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0);se(i)||this._setUpdateOperationHandle(i,t)},removeFromSelection:e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),h.complete()},toggleTool:()=>{}});return l.push(...this._getHandlesForComponent(h,t),o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(h,e,t)),R.WIDGET),o.on("key-down",(e=>{this._getCommonUpdateOperationKeyDownHandlers(h,e)}),R.WIDGET)),h}async _setupPolyTransform3DOperation(e,t,o,i=!1){const a="transform",{enableRotation:r,enableScaling:s,enableZ:n,preserveAspectRatio:p}=t,l=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(se(l))return l;const h=this.view?.inputManager?.isModifierKeyDown(D.constraint),c=new l.module.ExtentTransformTool({graphic:e,view:o,enableRotation:r,enableScaling:s,enableZ:n,preserveAspectRatio:!!p!=!!h,sketchOptions:this.sketchOptions});o.tools.add(c),i||this.updateGraphics.add(e);const d=[],u=new Z({activeComponent:c,tool:a,type:"update",onEnd:()=>{d.forEach((e=>e.remove())),d.length=0,o.tools?.remove(c),c.destroyed||c.destroy()},canUndo:()=>c.canUndo,undo:()=>{c.undo(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:a})},canRedo:()=>c.canRedo,redo:()=>{c.redo(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:a})},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),u.onEnd(),u.destroy();const i=await this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0);se(i)||this._setUpdateOperationHandle(i,t)},removeFromSelection:e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),u.complete()},toggleTool:async()=>{if(1!==this.updateGraphics.length||!1===t.toggleToolOnClick)return;const e=this.updateGraphics.at(0);if(M(e)!==S.SUPPORTED)return;u.onEnd(),u.destroy();const i=await this._setupReshape3DOperation(e,t,o,!0);se(i)||this._setUpdateOperationHandle(i,t)}});return d.push(...this._getHandlesForComponent(u,t),o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(u,e,t)),R.WIDGET),o.on("key-down",(e=>this._getCommonUpdateOperationKeyDownHandlers(u,e)),R.WIDGET),o.on("key-down",(e=>{e.key!==D.constraint||e.repeat||(c.preserveAspectRatio=!c.preserveAspectRatio,e.stopPropagation())}),R.WIDGET),o.on("key-up",(e=>{e.key===D.constraint&&(c.preserveAspectRatio=!c.preserveAspectRatio,e.stopPropagation())}),R.WIDGET)),u}async _setupMove2DOperation(e,t,o){const i="move";this.updateGraphics.addMany(e),await this._updateSpatialReference(e);const a=await this._getGraphicMover(e,t,o);if(se(a))return a;const r=new Z({activeComponent:a,tool:i,type:"update",onEnd:()=>{this._displayDefaultCursor(),p.forEach((e=>e.remove())),n.forEach((e=>e.remove())),p=[],n=[],a.destroy(),this._internalGraphicsLayer?.removeMany([...this.updateGraphics.toArray()])},undo:()=>{const e=this.updateGraphics.toArray();oe(r,e),r.refreshComponent(),this._emitUndoEvent({graphics:e,tool:i})},redo:()=>{const e=this.updateGraphics.toArray();ie(r,e),r.refreshComponent(),this._emitRedoEvent({graphics:e,tool:i})},addToSelection:async e=>{await this._updateSpatialReference(e),this.updateGraphics.push(e),a.graphics=this.updateGraphics.toArray(),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:e=>{const t=this.updateGraphics.indexOf(e);r.history.undo.forEach((e=>e.updates.splice(t,1))),r.history.redo.forEach((e=>e.updates.splice(t,1))),this.updateGraphics.remove(e);const o=this.updateGraphics.toArray();this.emit("update",{graphics:o,state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),0!==this.updateGraphics.length?a.graphics=o:r.complete()}});let s=!1,n=[o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(r,e,t)),R.WIDGET),o.on("key-down",(e=>{this._getCommonUpdateOperationKeyDownHandlers(r,e),e.key!==D.constraint||e.repeat||(s=!0,a.enableMoveAllGraphics=!a.enableMoveAllGraphics)}),R.WIDGET),o.on("key-up",(e=>{e.key===D.constraint&&s&&(s=!1,a.enableMoveAllGraphics=!a.enableMoveAllGraphics)}),R.WIDGET)],p=this._getHandlesForComponent(r,t);return r}async _setupReshape3DOperation(e,t,o,i=!1){const a="reshape",r=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(se(r))return r;const s=t.reshapeOptions,n=new r.module.GraphicReshapeTool({view:o,graphic:e,enableZVertex:t.enableZ&&"move"===s?.vertexOperation,enableZShape:t.enableZ&&"move"===s?.shapeOperation,enableMoveGraphic:"move"===s?.shapeOperation||"move-xy"===s?.shapeOperation,enableMidpoints:"split"===s?.edgeOperation,enableEdgeOffset:"offset"===s?.edgeOperation,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions});o.tools.add(n),i||this.updateGraphics.add(e);const p=[],l=new Z({activeComponent:n,tool:a,type:"update",onEnd:()=>{p.forEach((e=>e.remove())),p.length=0,o.tools?.remove(n),n.destroyed||n.destroy()},canUndo:()=>n.canUndo,undo:()=>{n.undo(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:a})},canRedo:()=>n.canRedo,redo:()=>{n.redo(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:a})},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),l.onEnd(),l.destroy();const i=await this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0);se(i)||this._setUpdateOperationHandle(i,t)},removeFromSelection:e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),l.complete()},toggleTool:async()=>{if(!1===t.toggleToolOnClick)return;l.onEnd(),l.destroy();const e=await this._setupGraphicTransform3DOperation(this.updateGraphics.toArray(),t,o,!0);se(e)||this._setUpdateOperationHandle(e,t)}});return p.push(...this._getHandlesForComponent(l,t),o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(l,e,t)),R.WIDGET),o.on("key-down",(e=>{this._getCommonUpdateOperationKeyDownHandlers(l,e)}),R.WIDGET)),l}async _setupTransformOrReshape2DOperation(e,t,o,i){this.updateGraphics.addMany(e),await this._updateSpatialReference(e);const a="transform"===t?await this._getBox(e,o,i):await this._getReshape(e,o,i);if(se(a))return a;const r=new Z({activeComponent:a,type:"update",onEnd:()=>{n.forEach((e=>e.remove())),s.forEach((e=>e.remove())),n=[],s=[],r.activeComponent&&!r.activeComponent.destroyed&&r.activeComponent.destroy(),this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray())},undo:()=>{oe(r,this.updateGraphics.toArray()),r.refreshComponent(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:r.tool})},redo:()=>{ie(r,this.updateGraphics.toArray()),r.refreshComponent(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:r.tool})},addToSelection:async e=>{let t=r.activeComponent;if("reshape"===t?.type){const t=[...this.updateGraphics,e];this.updateGraphics.removeAll(),r.onEnd(),r.destroy();const a=await this._setupTransformOrReshape2DOperation(t,"transform",o,i);if(se(a))return;this._setUpdateOperationHandle(a,o)}else this.updateGraphics.add(e),t.graphics=this.updateGraphics.toArray(),t.refresh(),r.resetHistory();this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:async e=>{const t=this.updateGraphics.indexOf(e);r.history.undo.forEach((e=>e.updates.splice(t,1))),r.history.redo.forEach((e=>e.updates.splice(t,1))),this.updateGraphics.remove(e);const o=this.updateGraphics.toArray();if(0===o.length)r.complete();else{const e=o[0].geometry;1!==o.length||null==e||"point"!==e.type&&"multipoint"!==e.type?r.activeComponent.graphics=o:r.toggleTool()}this.emit("update",{graphics:o,state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"})},toggleTool:async()=>{if(this.updateGraphics.length>1)return;const e=this.updateGraphics.at(0),t=e.geometry;if(null!=t&&("reshape"===r.tool&&("point"===t.type||"multipoint"===t.type)||"transform"===r.tool&&"extent"===t.type))return;let a=null;"transform"===r.tool?a=await this._getReshape([e],o,i):"reshape"===r.tool&&(a=await this._getBox([e],o,i)),se(a)||(r.activeComponent?.destroy(),r.activeComponent=a,r.activeComponent&&(n.forEach((e=>e.remove())),n=this._getHandlesForComponent(r,o)))}});let s=[i.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(r,e,o)),R.WIDGET),i.on("key-down",(e=>{if(this._getCommonUpdateOperationKeyDownHandlers(r,e),e.key===D.constraint&&!e.repeat&&r){const e=r.activeComponent;e&&"box"===e.type&&(e.preserveAspectRatio=!e.preserveAspectRatio)}}),R.WIDGET),i.on("key-up",(e=>{if(e.key===D.constraint&&r){const e=r.activeComponent;e&&"box"===e.type&&(e.preserveAspectRatio=!e.preserveAspectRatio)}}),R.WIDGET)],n=this._getHandlesForComponent(r,o);return r}async _getGraphicMover(e,t,o){const{enableMoveAllGraphics:i,highlightOptions:a}=t,r=await this._requireModule(import("../../views/draw/support/GraphicMover.js"));return se(r)?r:new r.module.default({enableMoveAllGraphics:i,highlightsEnabled:!!a?.enabled,indicatorsEnabled:!1,graphics:e,view:o,callbacks:{onGraphicMoveStart:({dx:e,dy:t,graphic:o})=>{this._displayGrabbingCursor(),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move-start"},type:"update"})},onGraphicMove:({dx:e,dy:t,graphic:o})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move"},type:"update"}),onGraphicMoveStop:({dx:e,dy:t,graphic:o})=>{this._displayPointerCursor(),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move-stop"},type:"update"})},onGraphicPointerOver:()=>this._displayPointerCursor(),onGraphicPointerOut:()=>this._displayDefaultCursor()}})}async _getBox(e,t,o){const{enableRotation:i,enableScaling:a,highlightOptions:r,preserveAspectRatio:s}=t,n=await this._requireModule(import("../../views/draw/support/Box.js"));if(se(n))return n;const p=this.view?.inputManager?.isModifierKeyDown(D.constraint);return new n.module.default({graphics:e,enableRotation:i,enableScaling:a,highlightsEnabled:!!r?.enabled,preserveAspectRatio:!!s!=!!p,layer:this._internalGraphicsLayer,view:o,sketchOptions:this.sketchOptions,callbacks:{onMoveStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onMove:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onMoveStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScaleStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScale:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScaleStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotateStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotate:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotateStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"})}})}async _getReshape(e,t,o){const i="split"===t.reshapeOptions?.edgeOperation,a="move"===t.reshapeOptions?.shapeOperation,r=!!t.highlightOptions?.enabled,s=await this._requireModule(import("../../views/draw/support/Reshape.js"));return se(s)?s:new s.module.default({enableMidpoints:i,enableMovement:a,graphic:e[0],highlightsEnabled:r,layer:this._internalGraphicsLayer,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions,view:o,callbacks:{onReshapeStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onReshape:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onReshapeStop:({mover:e,type:t})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e,type:t},type:"update"}),onMoveStart:({dx:e,dy:t,mover:o,type:i})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:i},type:"update"}),onMove:({dx:e,dy:t,mover:o,type:i})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:i},type:"update"}),onMoveStop:({dx:e,dy:t,mover:o,type:i})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:i},type:"update"}),onVertexAdd:({added:e,type:t,vertices:o})=>{const i=e.map((e=>b(e.geometry)));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:i,vertices:o,type:t},type:"update"})},onVertexRemove:({removed:e,type:t,vertices:o})=>{const i=e.map((e=>b(e.geometry)));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{removed:i,vertices:o,type:t},type:"update"})}}})}_getHandlesForComponent(e,t){const o=e.activeComponent;if(!o)return[];switch(o.type){case"graphic-mover":return[o.on("graphic-click",(({graphic:t,viewEvent:o})=>{o.native?.shiftKey&&(o.stopPropagation(),e.removeFromSelection(t))})),o.on("graphic-move-start",(t=>e.addToHistory(re(t.allGraphics))))];case"box":return[o.on("graphic-click",(o=>this._onTransformOrReshape2DGraphicClick(e,t,o))),o.on("move-start",(t=>e.addToHistory(re(t.graphics)))),o.on("rotate-start",(t=>e.addToHistory(re(t.graphics)))),o.on("scale-start",(t=>e.addToHistory(re(t.graphics))))];case"reshape":return[o.on("graphic-click",(o=>this._onTransformOrReshape2DGraphicClick(e,t,o))),o.on("move-start",(t=>e.addToHistory(re([t.mover])))),o.on("reshape-start",(t=>e.addToHistory(re([t.graphic])))),o.on("vertex-add",(t=>e.addToHistory(re([t.oldGraphic])))),o.on("vertex-remove",(t=>e.addToHistory(re([t.oldGraphic]))))];case"move-3d":return[o.on("graphic-move-start",(t=>{e.addToHistory(re(t.allGraphics)),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:t.allGraphics.length>0?t.allGraphics[0]:null,type:"move-start"},type:"update"})})),o.on("graphic-move",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e.dx,dy:e.dy,mover:e.allGraphics.length>0?e.allGraphics[0]:null,type:"move"},type:"update"})})),o.on("graphic-move-stop",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:e.allGraphics.length>0?e.allGraphics[0]:null,type:"move-stop"},type:"update"})})),o.on("immediate-click",(o=>{o.shiftKey?this._toggleSelection([o.graphic],e,t):e.toggleTool()}))];case"transform-3d":return[o.on("record-undo",(({record:t})=>{e.addToHistory({updates:[t]})})),o.on("graphic-translate-start",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move-start"},type:"update"})})),o.on("graphic-translate-stop",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move-stop"},type:"update"})})),o.on("graphic-rotate-start",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.graphic,angle:e.angle,type:"rotate-start"},type:"update"})})),o.on("graphic-rotate-stop",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.graphic,angle:e.angle,type:"rotate-stop"},type:"update"})})),o.on("graphic-scale-start",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale-start"},type:"update"})})),o.on("graphic-scale-stop",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale-stop"},type:"update"})})),o.on("graphic-translate",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move"},type:"update"})})),o.on("graphic-rotate",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.graphic,angle:e.angle,type:"rotate"},type:"update"})})),o.on("graphic-scale",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale"},type:"update"})})),o.on("immediate-click",(o=>{o.shiftKey?this._toggleSelection([o.graphic],e,t):e.toggleTool()}))];case"reshape-3d":return[o.on("reshape",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})})),o.on("move",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})})),o.on("vertex-add",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})})),o.on("vertex-remove",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})})),o.on("immediate-click",(o=>{o.shiftKey?this._toggleSelection([o.graphic],e,t):e.toggleTool()}))]}}_onTransformOrReshape2DGraphicClick(e,t,o){const{graphic:i,viewEvent:a}=o;return a.native?.shiftKey&&i.layer===this.layer?(a.stopPropagation(),e.removeFromSelection(i)):t.toggleToolOnClick?(a.stopPropagation(),e.toggleTool()):void 0}_setUpdateOperationHandle(e,t){this._operationHandle=e;const o=this.view?.map;this._disablePopup(t);const i=()=>{if(e===this._operationHandle){const i=this.updateGraphics.toArray(),a=this._operationHandle.tool;this._operationHandle.destroy(),this._operationHandle=null,this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray()),this.updateGraphics.removeAll(),o&&o.remove(this._internalGraphicsLayer),this._restorePopup(t),this.emit("update",{graphics:i,state:"complete",aborted:e.cancelled,tool:a,toolEventInfo:null,type:"update"})}};e.on("complete",i)}async _getCommonUpdateOperationClickHandlers(e,t,o){const i=K(t),a=await t.async((()=>this._getFirstHit(i)));if(null==a)return void e.complete();if(t.native.shiftKey&&this._toggleSelection([a.graphic],e,o))return void t.stopPropagation();this.updateGraphics.includes(a.graphic)?t.stopPropagation():e.complete()}_toggleSelection(e,t,o){const i=!!o.multipleSelectionEnabled;return e.some((e=>null!=e&&(!(!i||e.layer!==this.layer)&&(this.updateGraphics.includes(e)?t.removeFromSelection(e):t.addToSelection(e),!0))))}_getCommonUpdateOperationKeyDownHandlers(e,t){if(!e)return;const o=t.key;o===D.undo&&e.canUndo()?(t.stopPropagation(),e.undo()):o===D.redo&&e.canRedo()?(t.stopPropagation(),e.redo()):o===D.cancel?(t.stopPropagation(),e.cancel()):this.allowDeleteKey&&D.delete.includes(o)&&this._onDeleteKey(t)}_onDeleteKey(e){if(!this._operationHandle||"update"!==this._operationHandle.type)return;const t=this.activeComponent,o=this.updateGraphics.toArray();null!=t&&"reshape-3d"!==t.type&&("reshape"!==t.type||1===o.length&&"point"===o[0].geometry?.type)&&(e.stopPropagation(),this.delete())}_removeDefaultLayer(){this._internalGraphicsLayer&&(this.view?.map?.remove(this._internalGraphicsLayer),this._internalGraphicsLayer=s(this._internalGraphicsLayer))}_isComponentGraphic(e){const{activeComponent:t}=this;return!(!e||null==t)&&(e.attributes?.esriSketchTool||"draw-2d"===t.type&&t.graphic===e||("box"===t.type||"reshape"===t.type)&&t.isUIGraphic(e))}_displayPointerCursor(){this.view?.container&&"pointer"!==this.view.cursor&&(this.view.cursor="pointer")}_displayGrabbingCursor(){this.view?.container&&"grabbing"!==this.view.cursor&&(this.view.cursor="grabbing")}_displayDefaultCursor(){this.view?.container&&null!==this.view.cursor&&(this.view.cursor=null)}_logError(e,t,o){r.getLogger(this).error(new i(e,t,o))}async _requireModule(e){const t=new AbortController;this._moduleLoaderAbortController=t;const o=await e;return this._moduleLoaderAbortController!==t||t.signal.aborted?{requireError:"aborted"}:{module:o}}_emitUndoEvent(e){this.emit("undo",{...e,type:"undo"})}_emitRedoEvent(e){this.emit("redo",{...e,type:"redo"})}_emitDeleteEvent(e){this.emit("delete",{...e,type:"delete"})}get test(){return{operationHandle:this._operationHandle,snappingManager:this.snappingManager,defaultUpdateOptions:J}}wait(){return u((()=>!this.updating))}_beginAsyncOperation(){this._numUpdating+=1,this.notifyChange("updating")}_endAsyncOperation(){this._numUpdating-=1,this.notifyChange("updating")}_disablePopupEnabled(e){return"3d"!==this.view?.type||this.updateOnGraphicClick||(e?.toggleToolOnClick??!1)}_disablePopup(e){this._disablePopupEnabled(e)&&this.view&&null==this._originalPopupEnabled&&(this._originalPopupEnabled=this.view.popupEnabled,this.view.popupEnabled=!1)}_restorePopup(e){this._disablePopupEnabled(e)&&this.view&&null!=this._originalPopupEnabled&&(this.view.popupEnabled=this._originalPopupEnabled,this._originalPopupEnabled=null)}async _waitViewReady(){const e=this.view;e?(n(this._viewReadyAbortController),this._viewReadyAbortController=new AbortController,await l(u((()=>e?.ready)),this._viewReadyAbortController.signal)):this._logMissingView()}_logMissingView(){this._logError("sketch:missing-property",ee("view"))}_logMissingLayer(){this._logError(X,ee("layer"))}};e([m()],Q.prototype,"_defaultSnappingManager",void 0),e([m()],Q.prototype,"updating",null),e([m()],Q.prototype,"_operationHandle",void 0),e([m({readOnly:!0})],Q.prototype,"activeTool",null),e([m()],Q.prototype,"activeFillSymbol",void 0),e([m()],Q.prototype,"activeLineSymbol",void 0),e([m()],Q.prototype,"activeVertexSymbol",void 0),e([m()],Q.prototype,"allowDeleteKey",void 0),e([m({readOnly:!0})],Q.prototype,"createGraphic",null),e([m()],Q.prototype,"defaultCreateOptions",null),e([m()],Q.prototype,"defaultUpdateOptions",null),e([m({type:I,nonNullable:!0})],Q.prototype,"labelOptions",null),e([m()],Q.prototype,"layer",void 0),e([m({types:t})],Q.prototype,"pointSymbol",void 0),e([m({types:t})],Q.prototype,"polygonSymbol",void 0),e([m({types:t})],Q.prototype,"polylineSymbol",void 0),e([m()],Q.prototype,"meshSymbol",void 0),e([m({type:L,nonNullable:!0})],Q.prototype,"snappingOptions",null),e([m()],Q.prototype,"snappingManager",null),e([m({readOnly:!0})],Q.prototype,"state",null),e([m({type:x,nonNullable:!0})],Q.prototype,"tooltipOptions",null),e([m({readOnly:!0})],Q.prototype,"updateGraphics",void 0),e([m()],Q.prototype,"updateOnGraphicClick",void 0),e([m({type:P,nonNullable:!0})],Q.prototype,"valueOptions",null),e([m({types:t})],Q.prototype,"vertexSymbol",void 0),e([m({value:null})],Q.prototype,"view",null),e([m({constructOnly:!0,type:U})],Q.prototype,"sketchOptions",void 0),Q=e([g("esri.widgets.Sketch.SketchViewModel")],Q);const X="sketch:missing-property",ee=e=>`Property '${e}' is missing on SketchViewModel.`;function te(e){return"polygon"===e||"rectangle"===e||"circle"===e}function oe(e,t){ae("undo",e.history.undo,e.history.redo,t)}function ie(e,t){ae("redo",e.history.redo,e.history.undo,t)}function ae(e,t,o,i){const a=t.pop();if(!a)return;const r=a.updates,s=[];i.forEach(((t,o)=>{const i=r[o];null!=i&&("geometry"in i&&null!=i.geometry&&(s.push({geometry:t.geometry}),t.geometry=i.geometry),"symbol"in i&&null!=i.symbol&&(s.push({symbol:t.symbol}),t.symbol=i.symbol),"undo"in i&&(s.push(i),i[e](t)))})),o.push({updates:s})}function re(e){return{updates:e.map((e=>({geometry:e.geometry})))}}function se(e){return"requireError"in e&&"aborted"===e.requireError}const ne=Q;export{ne as default};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2364,6147],{25228:(t,e,n)=>{n.d(e,{c:()=>m});var r,i=n(41948),o=n(40504),s=n(94360),a=n(1580),l=(n(9456),n(66360),n(72052),n(33600)),c=n(12552),u=n(18996),h=n(28484);let p=r=class extends o.am{static get allTime(){return d}static get empty(){return f}constructor(t){super(t),this.end=null,this.start=null}readEnd(t,e){return null!=e.end?new Date(e.end):null}writeEnd(t,e){e.end=t?.getTime()??null}get isAllTime(){return this.equals(r.allTime)}get isEmpty(){return this.equals(r.empty)}readStart(t,e){return null!=e.start?new Date(e.start):null}writeStart(t,e){e.start=t?.getTime()??null}clone(){return new r({end:this.end,start:this.start})}equals(t){if(!t)return!1;const e=this.start?.getTime()??this.start,n=this.end?.getTime()??this.end,r=t.start?.getTime()??t.start,i=t.end?.getTime()??t.end;return e===r&&n===i}expandTo(t,e=h.OX){if(this.isEmpty||this.isAllTime)return this.clone();let n=this.start;n&&(n=(0,s.aU)(n,t,e));let i=this.end;if(i){const n=(0,s.aU)(i,t,e);i=i.getTime()===n.getTime()?n:(0,s.g1)(n,1,t,e)}return new r({start:n,end:i})}intersection(t){if(!t)return this.clone();if(this.isEmpty||t.isEmpty)return r.empty;if(this.isAllTime)return t.clone();if(t.isAllTime)return this.clone();const e=this.start?.getTime()??-1/0,n=this.end?.getTime()??1/0,i=t.start?.getTime()??-1/0,o=t.end?.getTime()??1/0;let s,a;if(i>=e&&i<=n?s=i:e>=i&&e<=o&&(s=e),n>=i&&n<=o?a=n:o>=e&&o<=n&&(a=o),null!=s&&null!=a&&!isNaN(s)&&!isNaN(a)){const t=new r;return t.start=s===-1/0?null:new Date(s),t.end=a===1/0?null:new Date(a),t}return r.empty}offset(t,e,n=h.OX){if(this.isEmpty||this.isAllTime)return this.clone();const i=new r,{start:o,end:a}=this;return null!=o&&(i.start=(0,s.g1)(o,t,e,n)),null!=a&&(i.end=(0,s.g1)(a,t,e,n)),i}union(t){if(!t||t.isEmpty)return this.clone();if(this.isEmpty)return t.clone();if(this.isAllTime||t.isAllTime)return d.clone();const e=null!=this.start&&null!=t.start?new Date(Math.min(this.start.getTime(),t.start.getTime())):null,n=null!=this.end&&null!=t.end?new Date(Math.max(this.end.getTime(),t.end.getTime())):null;return new r({start:e,end:n})}};(0,i._)([(0,a.qq)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"end",void 0),(0,i._)([(0,l.E)("end")],p.prototype,"readEnd",null),(0,i._)([(0,u.G)("end")],p.prototype,"writeEnd",null),(0,i._)([(0,a.qq)({readOnly:!0,json:{read:!1}})],p.prototype,"isAllTime",null),(0,i._)([(0,a.qq)({readOnly:!0,json:{read:!1}})],p.prototype,"isEmpty",null),(0,i._)([(0,a.qq)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"start",void 0),(0,i._)([(0,l.E)("start")],p.prototype,"readStart",null),(0,i._)([(0,u.G)("start")],p.prototype,"writeStart",null),p=r=(0,i._)([(0,c.c)("esri.TimeExtent")],p);const d=new p,f=new p({start:void 0,end:void 0}),m=p},8528:(t,e,n)=>{n.d(e,{c:()=>r,g:()=>i});var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}},85304:(t,e,n)=>{n.d(e,{q:()=>l});var r,i,o,s=n(8528),a={exports:{}};r=a,i=function(){function t(n,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,l=r-i+1,c=Math.log(a),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(a-u)/a)*(l-a/2<0?-1:1);t(n,r,Math.max(i,Math.floor(r-l*u/a+h)),Math.min(o,Math.floor(r+(a-l)*u/a+h)),s)}var p=n[r],d=i,f=o;for(e(n,i,r),s(n[o],p)>0&&e(n,i,o);d<f;){for(e(n,d,f),d++,f--;s(n[d],p)<0;)d++;for(;s(n[f],p)>0;)f--}0===s(n[i],p)?e(n,i,f):e(n,++f,o),f<=r&&(i=f+1),r<=f&&(o=f-1)}}function e(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function n(t,e){return t<e?-1:t>e?1:0}return function(e,r,i,o,s){t(e,r,i||0,o||e.length-1,s||n)}},void 0!==(o=i())&&(r.exports=o);const l=(0,s.g)(a.exports)},3856:(t,e,n)=>{n.d(e,{m:()=>h,q:()=>u});var r=n(41948),i=n(43780),o=(n(9456),n(62088)),s=(n(66360),n(70680)),a=n(71448),l=n(20916),c=n(12552);const u=t=>{let e=class extends t{clone(){const t=(0,l.m6)(this);(0,s.EN)(t,"unable to clone instance of non-accessor class");const e=t.metadata,n=t.store,r={},i=new Map;for(const t in e){const s=e[t],l=n?.originOf(t),c=s.clonable;if(s.readOnly||!1===c||l!==a.sT.USER&&l!==a.sT.DEFAULTS&&l!==a.sT.WEB_MAP&&l!==a.sT.WEB_SCENE)continue;const u=this[t];let h=null;h="function"==typeof c?c(u):"reference"===c?u:(0,o.gx)(u),null!=u&&null==h||(l===a.sT.DEFAULTS?i.set(t,h):r[t]=h)}const c=new(0,Object.getPrototypeOf(this).constructor)(r);if(i.size){const t=(0,l.m6)(c)?.store;if(t)for(const[e,n]of i)t.set(e,n,a.sT.DEFAULTS)}return c}};return e=(0,r._)([(0,c.c)("esri.core.Clonable")],e),e};let h=class extends(u(i.c)){};h=(0,r._)([(0,c.c)("esri.core.Clonable")],h)},22156:(t,e,n)=>{n.d(e,{MR:()=>s,qm:()=>a});var r=n(41948),i=n(12552);let o=0;const s=t=>{let e=class extends t{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+o++})}};return e=(0,r._)([(0,i.c)("esri.core.Identifiable")],e),e},a=t=>{let e=class extends t{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:o++})}};return e=(0,r._)([(0,i.c)("esri.core.NumericIdentifiable")],e),e};let l=class extends(s(class{})){};l=(0,r._)([(0,i.c)("esri.core.Identifiable")],l)},63316:(t,e,n)=>{n.d(e,{AD:()=>h,wV:()=>u});var r=n(2600),i=n(20744),o=n(10860),s=n(28176),a=n(49416);let l=null,c=!0;function u(t,e,n,r){if(!e||!n)throw new Error("Cannot construct image data without dimensions");if(c)try{return new ImageData(t,e,n)}catch(t){c=!1}const i=function(t,e,n){return n||(l||(l=document.createElement("canvas"),l.width=1,l.height=1),n=l),n.getContext("2d").createImageData(t,e)}(e,n,r);return i.data.set(t,0),i}async function h(t,e){const{arrayBuffer:l,mediaType:c}=await async function(t,e){const n=(0,s.nV)(t);if(n?.isBase64)return{arrayBuffer:(0,a.K)(n.data),mediaType:n.mediaType};const i=await(0,r.c)(t,{responseType:"array-buffer",...e});return{arrayBuffer:i.data,mediaType:i.getHeader?.("Content-Type")??""}}(t,e),u="image/png"===c;if("image/gif"===c){const{isAnimatedGIF:t,parseGif:r}=await n.e(8560).then(n.bind(n,68560));if(t(l))return r(l,e)}if(u){const{isAnimatedPNG:t,parseApng:r}=await n.e(4464).then(n.bind(n,84464));if(t(l))return r(l,e)}return async function(t,e){const n=window.URL.createObjectURL(t);try{const{data:t}=await(0,r.c)(n,{...e,responseType:"image"});return t}catch(t){if(!(0,o.mA)(t))throw new i.c("invalid-image",`Could not fetch requested image at ${n}`);throw t}finally{window.URL.revokeObjectURL(n)}}(new Blob([l],{type:c}),e)}},68612:(t,e,n)=>{function r(){return[1,0,0,0,1,0,0,0,1]}function i(t,e,n,r,i,o,s,a,l){return[t,e,n,r,i,o,s,a,l]}n.d(e,{IJ:()=>o,Su:()=>r,WK:()=>i});const o=[1,0,0,0,1,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:function(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},create:r,createView:function(t,e){return new Float64Array(t,e,9)},fromValues:i},Symbol.toStringTag,{value:"Module"}))},85256:(t,e,n)=>{function r(){return[0,0]}function i(t,e){return[t,e]}function o(){return i(1,1)}function s(){return i(1,0)}function a(){return i(0,1)}n.d(e,{Su:()=>r,WK:()=>i});const l=o(),c=s(),u=a();Object.freeze(Object.defineProperty({__proto__:null,ONES:l,UNIT_X:c,UNIT_Y:u,ZEROS:[0,0],clone:function(t){return[t[0],t[1]]},create:r,createView:function(t,e){return new Float64Array(t,e,2)},fromArray:function(t,e=[0,0]){const n=Math.min(2,t.length);for(let r=0;r<n;++r)e[r]=t[r];return e},fromValues:i,ones:o,unitX:s,unitY:a,zeros:function(){return[0,0]}},Symbol.toStringTag,{value:"Module"}))},77556:(t,e,n)=>{n.d(e,{KU:()=>h,QT:()=>f,S_:()=>a,WO:()=>o,_7:()=>l,aU:()=>u,iW:()=>c,kr:()=>i,oL:()=>s,yy:()=>p});var r=n(47364);function i(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function o(t,e,n,r,i,o,s,a,l,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t[6]=a,t[7]=l,t[8]=c,t}function s(t,e){if(t===e){const n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function a(t,e){const n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*s-a*c,p=-u*o+a*l,d=c*o-s*l;let f=n*h+r*p+i*d;return f?(f=1/f,t[0]=h*f,t[1]=(-u*r+i*c)*f,t[2]=(a*r-i*s)*f,t[3]=p*f,t[4]=(u*n-i*l)*f,t[5]=(-a*n+i*o)*f,t[6]=d*f,t[7]=(-c*n+r*l)*f,t[8]=(s*n-r*o)*f,t):null}function l(t,e){const n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t[0]=s*u-a*c,t[1]=i*c-r*u,t[2]=r*a-i*s,t[3]=a*l-o*u,t[4]=n*u-i*l,t[5]=i*o-n*a,t[6]=o*c-s*l,t[7]=r*l-n*c,t[8]=n*s-r*o,t}function c(t,e,n){const r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],p=n[0],d=n[1],f=n[2],m=n[3],y=n[4],g=n[5],_=n[6],x=n[7],v=n[8];return t[0]=p*r+d*s+f*c,t[1]=p*i+d*a+f*u,t[2]=p*o+d*l+f*h,t[3]=m*r+y*s+g*c,t[4]=m*i+y*a+g*u,t[5]=m*o+y*l+g*h,t[6]=_*r+x*s+v*c,t[7]=_*i+x*a+v*u,t[8]=_*o+x*l+v*h,t}function u(t,e,n){const r=n[0],i=n[1],o=n[2];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=o*e[6],t[7]=o*e[7],t[8]=o*e[8],t}function h(t,e){const n=e[0],r=e[1],i=e[2],o=e[3],s=n+n,a=r+r,l=i+i,c=n*s,u=r*s,h=r*a,p=i*s,d=i*a,f=i*l,m=o*s,y=o*a,g=o*l;return t[0]=1-h-f,t[3]=u-g,t[6]=p+y,t[1]=u+g,t[4]=1-c-f,t[7]=d-m,t[2]=p-y,t[5]=d+m,t[8]=1-c-h,t}function p(t,e){const n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],p=e[10],d=e[11],f=e[12],m=e[13],y=e[14],g=e[15],_=n*a-r*s,x=n*l-i*s,v=n*c-o*s,w=r*l-i*a,b=r*c-o*a,M=i*c-o*l,q=u*m-h*f,P=u*y-p*f,S=u*g-d*f,I=h*y-p*m,E=h*g-d*m,R=p*g-d*y;let A=_*R-x*E+v*I+w*S-b*P+M*q;return A?(A=1/A,t[0]=(a*R-l*E+c*I)*A,t[1]=(l*S-s*R-c*P)*A,t[2]=(s*E-a*S+c*q)*A,t[3]=(i*E-r*R-o*I)*A,t[4]=(n*R-i*S+o*P)*A,t[5]=(r*S-n*E-o*q)*A,t[6]=(m*M-y*b+g*w)*A,t[7]=(y*v-f*M-g*x)*A,t[8]=(f*b-m*v+g*_)*A,t):null}function d(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}function f(t){const e=(0,r.Au)(),n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8];return Math.abs(1-(n*n+s*s+c*c))<=e&&Math.abs(1-(i*i+a*a+u*u))<=e&&Math.abs(1-(o*o+l*l+h*h))<=e}const m=c,y=d;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},adjoint:l,copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},determinant:function(t){const e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8];return e*(c*o-s*l)+n*(-c*i+s*a)+r*(l*i-o*a)},equals:function(t,e){const n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=e[0],d=e[1],f=e[2],m=e[3],y=e[4],g=e[5],_=e[6],x=e[7],v=e[8],w=(0,r.Au)();return Math.abs(n-p)<=w*Math.max(1,Math.abs(n),Math.abs(p))&&Math.abs(i-d)<=w*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-f)<=w*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(s-m)<=w*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(a-y)<=w*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(l-g)<=w*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(c-_)<=w*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-x)<=w*Math.max(1,Math.abs(u),Math.abs(x))&&Math.abs(h-v)<=w*Math.max(1,Math.abs(h),Math.abs(v))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2)},fromMat2d:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},fromMat4:i,fromQuat:h,fromRotation:function(t,e){const n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromTranslation:function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},invert:a,isOrthoNormal:f,mul:m,multiply:c,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t},normalFromMat4:p,normalFromMat4Legacy:function(t,e){const n=e[0],r=e[1],i=e[2],o=e[4],s=e[5],a=e[6],l=e[8],c=e[9],u=e[10],h=u*s-a*c,p=-u*o+a*l,d=c*o-s*l,f=n*h+r*p+i*d;if(!f)return null;const m=1/f;return t[0]=h*m,t[1]=(-u*r+i*c)*m,t[2]=(a*r-i*s)*m,t[3]=p*m,t[4]=(u*n-i*l)*m,t[5]=(-a*n+i*o)*m,t[6]=d*m,t[7]=(-c*n+r*l)*m,t[8]=(s*n-r*o)*m,t},projection:function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},rotate:function(t,e,n){const r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],p=Math.sin(n),d=Math.cos(n);return t[0]=d*r+p*s,t[1]=d*i+p*a,t[2]=d*o+p*l,t[3]=d*s-p*r,t[4]=d*a-p*i,t[5]=d*l-p*o,t[6]=c,t[7]=u,t[8]=h,t},scale:u,scaleByVec2:function(t,e,n){const r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t},set:o,str:function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},sub:y,subtract:d,translate:function(t,e,n){const r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],p=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=s,t[4]=a,t[5]=l,t[6]=p*r+d*s+c,t[7]=p*i+d*a+u,t[8]=p*o+d*l+h,t},transpose:s},Symbol.toStringTag,{value:"Module"}))},37648:(t,e,n)=>{n.d(e,{Cq:()=>p,WO:()=>i,c9:()=>f,m4:()=>d,qy:()=>l});var r=n(47364);function i(t,e,n){return t[0]=e,t[1]=n,t}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function s(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function a(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function l(t,e){const n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}function c(t,e){const n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function u(t){const e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function h(t){const e=t[0],n=t[1];return e*e+n*n}function p(t,e,n,r){const i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}function d(t,e,n){const r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function f(t,e,n,r){const i=e[0]-n[0],o=e[1]-n[1],s=Math.sin(r),a=Math.cos(r);return t[0]=i*a-o*s+n[0],t[1]=i*s+o*a+n[1],t}const m=u,y=o,g=s,_=a,x=l,v=c,w=h;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},angle:function(t,e){const n=t[0],r=t[1],i=e[0],o=e[1];let s=n*n+r*r;s>0&&(s=1/Math.sqrt(s));let a=i*i+o*o;a>0&&(a=1/Math.sqrt(a));const l=(n*i+r*o)*s*a;return l>1?0:l<-1?Math.PI:Math.acos(l)},ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t},cross:function(t,e,n){const r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},dist:x,distance:l,div:_,divide:a,dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},equals:function(t,e){const n=t[0],i=t[1],o=e[0],s=e[1],a=(0,r.Au)();return Math.abs(n-o)<=a*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=a*Math.max(1,Math.abs(i),Math.abs(s))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]},floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},inverse:function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},len:m,length:u,lerp:p,max:function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},min:function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},mul:g,multiply:s,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},normalize:function(t,e){const n=e[0],r=e[1];let i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},projectAndScale:function(t,e,n,r,i){let o=e[0]-n[0],s=e[1]-n[1];const a=(r[0]*o+r[1]*s)*(i-1);return o=r[0]*a,s=r[1]*a,t[0]=e[0]+o,t[1]=e[1]+s,t},random:function(t,e){e=e||1;const n=2*(0,r.QR)()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},rotate:f,round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},scale:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},scaleAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},set:i,sqrDist:v,sqrLen:w,squaredDistance:c,squaredLength:h,str:function(t){return"vec2("+t[0]+", "+t[1]+")"},sub:y,subtract:o,transformMat2:function(t,e,n){const r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t},transformMat2d:d,transformMat3:function(t,e,n){const r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t},transformMat4:function(t,e,n){const r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}},Symbol.toStringTag,{value:"Module"}))},3024:(t,e,n)=>{n.d(e,{U:()=>s});var r=n(92400),i=n(24680),o=n(85304);class s{constructor(t=9,e){this._compareMinX=u,this._compareMinY=h,this._toBBox=t=>t,this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&("function"==typeof e?this._toBBox=e:this._initFormat(e)),this.clear()}destroy(){this.clear(),x.prune(),v.prune(),w.prune(),b.prune()}all(t){this._all(this._data,t)}search(t,e){let n=this._data;const r=this._toBBox;if(g(t,n))for(x.clear();n;){for(let i=0,o=n.children.length;i<o;i++){const o=n.children[i],s=n.leaf?r(o):o;g(t,s)&&(n.leaf?e(o):y(t,s)?this._all(o,e):x.push(o))}n=x.pop()}}collides(t){let e=this._data;const n=this._toBBox;if(!g(t,e))return!1;for(x.clear();e;){for(let r=0,i=e.children.length;r<i;r++){const i=e.children[r],o=e.leaf?n(i):i;if(g(t,o)){if(e.leaf||y(t,o))return!0;x.push(i)}}e=x.pop()}return!1}load(t){if(!t.length)return this;if(t.length<this._minEntries){for(let e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}let e=this._build(t.slice(0,t.length),0,t.length-1,0);if(this._data.children.length)if(this._data.height===e.height)this._splitRoot(this._data,e);else{if(this._data.height<e.height){const t=this._data;this._data=e,e=t}this._insert(e,this._data.height-e.height-1,!0)}else this._data=e;return this}insert(t){return t&&this._insert(t,this._data.height-1),this}clear(){return this._data=new P([]),this}remove(t){if(!t)return this;let e,n=this._data,i=null,o=0,s=!1;const a=this._toBBox(t);for(w.clear(),b.clear();n||w.length>0;){if(n||(n=w.pop(),i=w.data[w.length-1],o=b.pop()??0,s=!0),n.leaf&&(e=(0,r.IP)(n.children,t,n.children.length,n.indexHint),-1!==e))return n.children.splice(e,1),w.push(n),this._condense(w),this;s||n.leaf||!y(n,a)?i?(o++,n=i.children[o],s=!1):n=null:(w.push(n),b.push(o),o=0,i=n,n=n.children[0])}return this}toJSON(){return this._data}fromJSON(t){return this._data=t,this}_all(t,e){let n=t;for(v.clear();n;){if(!0===n.leaf)for(const t of n.children)e(t);else v.pushArray(n.children);n=v.pop()??null}}_build(t,e,n,r){const i=n-e+1;let o=this._maxEntries;if(i<=o){const r=new P(t.slice(e,n+1));return a(r,this._toBBox),r}r||(r=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/o**(r-1)));const s=new S([]);s.height=r;const l=Math.ceil(i/o),c=l*Math.ceil(Math.sqrt(o));_(t,e,n,c,this._compareMinX);for(let i=e;i<=n;i+=c){const e=Math.min(i+c-1,n);_(t,i,e,l,this._compareMinY);for(let n=i;n<=e;n+=l){const i=Math.min(n+l-1,e);s.children.push(this._build(t,n,i,r-1))}}return a(s,this._toBBox),s}_chooseSubtree(t,e,n,r){for(;r.push(e),!0!==e.leaf&&r.length-1!==n;){let n,r=1/0,i=1/0;for(let o=0,s=e.children.length;o<s;o++){const s=e.children[o],a=p(s),l=f(t,s)-a;l<i?(i=l,r=a<r?a:r,n=s):l===i&&a<r&&(r=a,n=s)}e=n||e.children[0]}return e}_insert(t,e,n){const r=this._toBBox,i=n?t:r(t);w.clear();const o=this._chooseSubtree(i,this._data,e,w);for(o.children.push(t),c(o,i);e>=0&&w.data[e].children.length>this._maxEntries;)this._split(w,e),e--;this._adjustParentBBoxes(i,w,e)}_split(t,e){const n=t.data[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r);if(!o)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const s=n.children.splice(o,n.children.length-o),l=n.leaf?new P(s):new S(s);l.height=n.height,a(n,this._toBBox),a(l,this._toBBox),e?t.data[e-1].children.push(l):this._splitRoot(n,l)}_splitRoot(t,e){this._data=new S([t,e]),this._data.height=t.height+1,a(this._data,this._toBBox)}_chooseSplitIndex(t,e,n){let r,i,o;r=i=1/0;for(let s=e;s<=n-e;s++){const e=l(t,0,s,this._toBBox),a=l(t,s,n,this._toBBox),c=m(e,a),u=p(e)+p(a);c<r?(r=c,o=s,i=u<i?u:i):c===r&&u<i&&(i=u,o=s)}return o}_chooseSplitAxis(t,e,n){const r=t.leaf?this._compareMinX:u,i=t.leaf?this._compareMinY:h;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)}_allDistMargin(t,e,n,r){t.children.sort(r);const i=this._toBBox,o=l(t,0,e,i),s=l(t,n-e,n,i);let a=d(o)+d(s);for(let r=e;r<n-e;r++){const e=t.children[r];c(o,t.leaf?i(e):e),a+=d(o)}for(let r=n-e-1;r>=e;r--){const e=t.children[r];c(s,t.leaf?i(e):e),a+=d(s)}return a}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)c(e.data[r],t)}_condense(t){for(let e=t.length-1;e>=0;e--){const n=t.data[e];if(0===n.children.length)if(e>0){const i=t.data[e-1],o=i.children;o.splice((0,r.IP)(o,n,o.length,i.indexHint),1)}else this.clear();else a(n,this._toBBox)}}_initFormat(t){const e=["return a"," - b",";"];this._compareMinX=new Function("a","b",e.join(t[0])),this._compareMinY=new Function("a","b",e.join(t[1])),this._toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}function a(t,e){l(t,0,t.children.length,e,t)}function l(t,e,n,r,i){i||(i=new P([])),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o,s=e;s<n;s++)o=t.children[s],c(i,t.leaf?r(o):o);return i}function c(t,e){t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY)}function u(t,e){return t.minX-e.minX}function h(t,e){return t.minY-e.minY}function p(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function d(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function m(t,e){const n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function y(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function g(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function _(t,e,n,r,i){const s=[e,n];for(;s.length;){const e=s.pop(),n=s.pop();if(e-n<=r)continue;const a=n+Math.ceil((e-n)/r/2)*r;(0,o.q)(t,a,n,e,i),s.push(n,a,a,e)}}const x=new i.c,v=new i.c,w=new i.c,b=new i.c({deallocator:void 0});class M{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class q extends M{constructor(){super(...arguments),this.height=1,this.indexHint=new r.is}}class P extends q{constructor(t){super(),this.children=t,this.leaf=!0}}class S extends q{constructor(t){super(),this.children=t,this.leaf=!1}}},57896:(t,e,n)=>{n.d(e,{Eq:()=>p,KG:()=>g,_8:()=>y,_I:()=>c,aE:()=>l,du:()=>m,on:()=>h}),n(40196),n(2952);var r=n(60976),i=n(38912),o=n(70680),s=n(10860),a=n(37176);function l(t,e,n={}){return u(t,e,n,d)}function c(t,e,n={}){return u(t,e,n,f)}function u(t,e,n={},r){let i=null;const s=n.once?(t,n)=>{r(t)&&((0,o.oR)(i),e(t,n))}:(t,n)=>{r(t)&&e(t,n)};if(i=(0,a.M9)(t,s,n.sync,n.equals),n.initial){const e=t();s(e,e)}return i}function h(t,e,n,s={}){let a=null,c=null,u=null;function h(){a&&c&&(c.remove(),s.onListenerRemove?.(a),a=null,c=null)}function p(t){s.once&&s.once&&(0,o.oR)(u),n(t)}const d=l(t,((t,n)=>{h(),(0,r.sh)(t)&&(a=t,c=(0,r.on)(t,e,p),s.onListenerAdd?.(t))}),{sync:s.sync,initial:!0});return u=(0,i.uU)((()=>{d.remove(),h()})),u}function p(t,e){return function(t,e,n){if((0,s.wv)(n))return Promise.reject((0,s.Uh)());const r=t();if(e?.(r))return Promise.resolve(r);let a=null;function l(){a=(0,o.oR)(a)}return new Promise(((r,o)=>{a=(0,i.Ip)([(0,s.wD)(n,(()=>{l(),o((0,s.Uh)())})),u(t,(t=>{l(),r(t)}),{sync:!1,once:!0},e??d)])}))}(t,f,e)}function d(t){return!0}function f(t){return!!t}n(41168);const m={sync:!0},y={initial:!0},g={sync:!0,initial:!0}},63564:(t,e,n)=>{n.d(e,{Mr:()=>s,cf:()=>o,g1:()=>i});const r="randomUUID"in crypto;function i(){if(r)return crypto.randomUUID();const t=crypto.getRandomValues(new Uint16Array(8));t[3]=4095&t[3]|16384,t[4]=16383&t[4]|32768;const e=e=>t[e].toString(16).padStart(4,"0");return e(0)+e(1)+"-"+e(2)+"-"+e(3)+"-"+e(4)+"-"+e(5)+e(6)+e(7)}function o(){return`{${i().toUpperCase()}}`}function s(){return`{${i()}}`}},44048:(t,e,n)=>{n.d(e,{Hh:()=>s,iM:()=>c,wb:()=>l,yK:()=>a});var r=n(48516),i=n(56156),o=n(6704);const s={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new r.c({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:i.c.WebMercator}),minus180Line:new r.c({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:i.c.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new r.c({paths:[[[180,-180],[180,180]]],spatialReference:i.c.WGS84}),minus180Line:new r.c({paths:[[[-180,-180],[-180,180]]],spatialReference:i.c.WGS84})}};function a(t,e){return Math.ceil((t-e)/(2*e))}function l(t,e){const n=c(t);for(const t of n)for(const n of t)n[0]+=e;return t}function c(t){return(0,o.Cs)(t)?t.rings:t.paths}},81436:(t,e,n)=>{n.d(e,{c:()=>x});var r=n(41948),i=(n(60708),n(2600)),o=n(20744),s=n(77860),a=n(22156),l=n(95800),c=n(66360),u=n(10860),h=n(28176),p=n(1580),d=(n(9456),n(72052),n(12552)),f=n(6220),m=n(95247),y=n(56156);let g=0,_=class extends(s.c.EventedMixin((0,a.MR)(l.c))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new m.c(-180,-90,180,90,y.c.WGS84),this.id=Date.now().toString(16)+"-layer-"+g++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=y.c.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(t){const e="string"==typeof t?{url:t}:t;return(await n.e(9232).then(n.bind(n,69232))).fromUrl(e)}static fromPortalItem(t){return async function(t){const e="portalItem"in t?t:{portalItem:t},{fromItem:r}=await n.e(2259).then(n.bind(n,12259));try{return await r(e)}catch(t){const n=e&&e.portalItem,r=n?.id||"unset",i=n&&n.portal&&n.portal.url||f.default.portalUrl;throw c.c.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+i+"', id: '"+r+"')",t),t}}(t)}initialize(){this.when().catch((t=>{(0,u.mA)(t)||c.c.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:t})}))}destroy(){const t=this.parent;if(t){const e=this;"layers"in t&&t.layers.includes(e)?t.layers.remove(e):"tables"in t&&t.tables.includes(e)?t.tables.remove(e):"baseLayers"in t&&t.baseLayers.includes(e)?t.baseLayers.remove(e):"referenceLayers"in t&&t.referenceLayers.includes(e)&&t.referenceLayers.remove(e),this._set("parent",null)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,h.as)(this.url)}async fetchAttributionData(){const t=this.attributionDataUrl;if(this.hasAttributionData&&t)return(await(0,i.c)(t,{query:{f:"json"},responseType:"json"})).data;throw new o.c("layer:no-attribution-data","Layer does not have attribution data")}};(0,r._)([(0,p.qq)({type:String})],_.prototype,"attributionDataUrl",void 0),(0,r._)([(0,p.qq)({type:m.c})],_.prototype,"fullExtent",void 0),(0,r._)([(0,p.qq)({readOnly:!0})],_.prototype,"hasAttributionData",null),(0,r._)([(0,p.qq)({type:String,clonable:!1})],_.prototype,"id",void 0),(0,r._)([(0,p.qq)({type:Boolean,nonNullable:!0})],_.prototype,"legendEnabled",void 0),(0,r._)([(0,p.qq)({type:["show","hide","hide-children"]})],_.prototype,"listMode",void 0),(0,r._)([(0,p.qq)({type:Number,range:{min:0,max:1},nonNullable:!0})],_.prototype,"opacity",void 0),(0,r._)([(0,p.qq)({clonable:!1})],_.prototype,"parent",void 0),(0,r._)([(0,p.qq)({readOnly:!0})],_.prototype,"parsedUrl",null),(0,r._)([(0,p.qq)({type:Boolean,readOnly:!0})],_.prototype,"persistenceEnabled",void 0),(0,r._)([(0,p.qq)({type:Boolean})],_.prototype,"popupEnabled",void 0),(0,r._)([(0,p.qq)({type:Boolean})],_.prototype,"attributionVisible",void 0),(0,r._)([(0,p.qq)({type:y.c})],_.prototype,"spatialReference",void 0),(0,r._)([(0,p.qq)({type:String})],_.prototype,"title",void 0),(0,r._)([(0,p.qq)({readOnly:!0,json:{read:!1}})],_.prototype,"type",void 0),(0,r._)([(0,p.qq)()],_.prototype,"url",void 0),(0,r._)([(0,p.qq)({type:Boolean,nonNullable:!0})],_.prototype,"visible",void 0),_=(0,r._)([(0,d.c)("esri.layers.Layer")],_);const x=_},66664:(t,e,n)=>{n.r(e),n.d(e,{default:()=>he});var r=n(41948),i=n(2952),o=n(20744),s=n(66360),a=n(26496),l=n(10860),c=n(1580),u=n(33392),h=(n(72052),n(9456),n(33600)),p=n(12552),d=n(18996),f=n(71448),m=n(81436),y=n(25216),g=n(66576),_=n(98768),x=n(3116),v=n(2600),w=n(63316),b=n(28176),M=n(63564),q=n(22156),P=n(95800),S=n(43780),I=n(40504),E=n(77556),R=n(68612),A=n(37648),O=n(98472);const T=(0,n(62484).Su)(),L=(0,R.Su)(),B=(0,R.Su)(),C=(0,R.Su)();function j(t,e,n){return(0,O.s)(T,e[0],e[1],1),(0,O.t)(T,T,(0,E.oL)(L,n)),0===T[2]?(0,A.WO)(t,T[0],T[1]):(0,A.WO)(t,T[0]/T[2],T[1]/T[2])}function U(t,e,n){return W(B,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]),W(C,n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]),(0,E.iW)(t,(0,E._7)(B,B),C),0!==t[8]&&(t[0]/=t[8],t[1]/=t[8],t[2]/=t[8],t[3]/=t[8],t[4]/=t[8],t[5]/=t[8],t[6]/=t[8],t[7]/=t[8],t[8]/=t[8]),t}function W(t,e,n,r,i,o,s,a,l){(0,E.WO)(t,e,r,o,n,i,s,1,1,1),(0,O.s)(T,a,l,1),(0,E._7)(L,t);const[c,u,h]=(0,O.t)(T,T,(0,E.oL)(L,L));return(0,E.WO)(L,c,0,0,0,u,0,0,0,h),(0,E.iW)(t,L,t)}var X=n(50144),N=n(85256),Y=n(67776),H=n(7488),F=n(60074),D=n(56156),z=n(3856);let $=class extends z.m{projectOrWarn(t,e){if(null==t)return t;const{geometry:n,pending:r}=(0,F.projectOrLoad)(t,e);return r?null:r||n?n:(s.c.getLogger(this).warn("geometry could not be projected to the spatial reference",{georeference:this,geometry:t,sourceSpatialReference:t.spatialReference,targetSpatialReference:e}),null)}};$=(0,r._)([(0,p.c)("esri.layers.support.GeoreferenceBase")],$);const G=$,V=(0,R.Su)(),k=(0,N.Su)();let K=class extends S.c{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};(0,r._)([(0,c.qq)()],K.prototype,"sourcePoint",void 0),(0,r._)([(0,c.qq)({type:Y.c})],K.prototype,"mapPoint",void 0),K=(0,r._)([(0,p.c)("esri.layers.support.ControlPoint")],K);let J=class extends((0,I.Ib)(G)){constructor(t){super(t),this.controlPoints=null,this.height=0,this.type="control-points",this.width=0}readControlPoints(t,e){const n=D.c.fromJSON(e.spatialReference),r=(0,R.WK)(...e.coefficients,1);return t.map((t=>((0,A.WO)(k,t.x,t.y),j(k,k,r),{sourcePoint:t,mapPoint:new Y.c({x:k[0],y:k[1],spatialReference:n})})))}writeControlPoints(t,e,n,r){if(null!=this.transform)null!=t&&Q(t[0])&&(e.controlPoints=t.map((t=>{const e=t.sourcePoint;return{x:e.x,y:e.y}})),e.spatialReference=t[0].mapPoint.spatialReference.toJSON(),e.coefficients=this.transform.slice(0,8));else{const t=new o.c("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration.",{layer:r?.layer,georeference:this});r?.messages?r.messages.push(t):s.c.getLogger(this).error(t.name,t.message)}}get coords(){if(null==this.controlPoints)return null;const t=this._updateTransform(V);if(null==t||!Q(this.controlPoints[0]))return null;const e=this.controlPoints[0].mapPoint.spatialReference;return function(t,e,n,r){const i=(0,N.WK)(0,n),o=(0,N.WK)(0,0),s=(0,N.WK)(e,0),a=(0,N.WK)(e,n);return j(i,i,t),j(o,o,t),j(s,s,t),j(a,a,t),new H.c({rings:[[i,o,s,a,i]],spatialReference:r})}(t,this.width,this.height,e)}set coords(t){if(null==this.controlPoints||!Q(this.controlPoints[0]))return;const e=this.controlPoints[0].mapPoint.spatialReference;if(null==(t=this.projectOrWarn(t,e)))return;const{width:n,height:r}=this,{rings:[[i,o,s,a]]}=t,l={sourcePoint:(0,X.Gy)(0,r),mapPoint:new Y.c({x:i[0],y:i[1],spatialReference:e})},c={sourcePoint:(0,X.Gy)(0,0),mapPoint:new Y.c({x:o[0],y:o[1],spatialReference:e})},u={sourcePoint:(0,X.Gy)(n,0),mapPoint:new Y.c({x:s[0],y:s[1],spatialReference:e})},h={sourcePoint:(0,X.Gy)(n,r),mapPoint:new Y.c({x:a[0],y:a[1],spatialReference:e})};Q(l)&&Q(c)&&Q(u)&&Q(h)&&(ct(V,l,c,u,h),this.controlPoints=this.controlPoints.map((({sourcePoint:t})=>((0,A.WO)(k,t.x,t.y),j(k,k,V),{sourcePoint:t,mapPoint:new Y.c({x:k[0],y:k[1],spatialReference:e})}))))}get inverseTransform(){return null==this.transform?null:(0,E.S_)((0,R.Su)(),this.transform)}get transform(){return this._updateTransform()}toMap(t){if(null==t||null==this.transform||null==this.controlPoints||!Q(this.controlPoints[0]))return null;(0,A.WO)(k,t.x,t.y);const e=this.controlPoints[0].mapPoint.spatialReference;return j(k,k,this.transform),new Y.c({x:k[0],y:k[1],spatialReference:e})}toSource(t){if(null==t||null==this.inverseTransform||null==this.controlPoints||!Q(this.controlPoints[0]))return null;const e=this.controlPoints[0].mapPoint.spatialReference;return t=t.normalize(),null==(t=(0,F.projectOrLoad)(t,e).geometry)?null:((0,A.WO)(k,t.x,t.y),j(k,k,this.inverseTransform),(0,X.Gy)(k[0],k[1]))}toSourceNormalized(t){const e=this.toSource(t);return null!=e&&(e.x/=this.width,e.y/=this.height),e}_updateTransform(t){const{controlPoints:e,width:n,height:r}=this;if(!(null!=e&&n>0&&r>0))return null;const[i,o,s,a]=e;if(!Q(i))return null;const l=i.mapPoint.spatialReference,c=this._projectControlPoint(o,l),u=this._projectControlPoint(s,l),h=this._projectControlPoint(a,l);if(!c.valid||!u.valid||!h.valid)return null;if(!Q(c.controlPoint))return null;null==t&&(t=(0,R.Su)());let p=null;return p=Q(u.controlPoint)&&Q(h.controlPoint)?ct(t,i,c.controlPoint,u.controlPoint,h.controlPoint):Q(u.controlPoint)?function(t,e,n,r){return lt(Z,rt,e),lt(tt,it,n),lt(et,ot,r),(0,A.Cq)(nt,Z,tt,.5),(0,A.c9)(nt,et,nt,Math.PI),(0,A.Cq)(st,rt,it,.5),(0,A.c9)(st,ot,st,Math.PI),dt(t,Z,tt,et,nt,rt,it,ot,st)}(t,i,c.controlPoint,u.controlPoint):function(t,e,n){return lt(Z,rt,e),lt(tt,it,n),(0,A.c9)(et,tt,Z,at),(0,A.c9)(nt,Z,tt,at),(0,A.c9)(ot,it,rt,-at),(0,A.c9)(st,rt,it,-at),dt(t,Z,tt,et,nt,rt,it,ot,st)}(t,i,c.controlPoint),p.every((t=>0===t))?null:p}_projectControlPoint(t,e){if(!Q(t))return{valid:!0,controlPoint:t};const{sourcePoint:n,mapPoint:r}=t,{geometry:i,pending:o}=(0,F.projectOrLoad)(r,e);return o?{valid:!1,controlPoint:null}:o||i?{valid:!0,controlPoint:{sourcePoint:n,mapPoint:i}}:(s.c.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:t,sourceSpatialReference:r.spatialReference,targetSpatialReference:e}),{valid:!1,controlPoint:null})}};function Q(t){return null!=t?.sourcePoint&&null!=t.mapPoint}(0,r._)([(0,c.qq)({type:[K],json:{write:{allowNull:!1,isRequired:!0}}})],J.prototype,"controlPoints",void 0),(0,r._)([(0,h.E)("controlPoints")],J.prototype,"readControlPoints",null),(0,r._)([(0,d.G)("controlPoints")],J.prototype,"writeControlPoints",null),(0,r._)([(0,c.qq)()],J.prototype,"coords",null),(0,r._)([(0,c.qq)({json:{write:!0}})],J.prototype,"height",void 0),(0,r._)([(0,c.qq)({readOnly:!0})],J.prototype,"inverseTransform",null),(0,r._)([(0,c.qq)({readOnly:!0})],J.prototype,"transform",null),(0,r._)([(0,c.qq)({json:{write:!0}})],J.prototype,"width",void 0),J=(0,r._)([(0,p.c)("esri.layers.support.ControlPointsGeoreference")],J);const Z=(0,N.Su)(),tt=(0,N.Su)(),et=(0,N.Su)(),nt=(0,N.Su)(),rt=(0,N.Su)(),it=(0,N.Su)(),ot=(0,N.Su)(),st=(0,N.Su)(),at=Math.PI/2;function lt(t,e,n){(0,A.WO)(t,n.sourcePoint.x,n.sourcePoint.y),(0,A.WO)(e,n.mapPoint.x,n.mapPoint.y)}function ct(t,e,n,r,i){return lt(Z,rt,e),lt(tt,it,n),lt(et,ot,r),lt(nt,st,i),dt(t,Z,tt,et,nt,rt,it,ot,st)}const ut=new Array(8).fill(0),ht=new Array(8).fill(0);function pt(t,e,n,r,i){return t[0]=e[0],t[1]=e[1],t[2]=n[0],t[3]=n[1],t[4]=r[0],t[5]=r[1],t[6]=i[0],t[7]=i[1],t}function dt(t,e,n,r,i,o,s,a,l){return U(t,pt(ut,e,n,r,i),pt(ht,o,s,a,l))}const ft=J,mt=(0,N.Su)();let yt=class extends G{constructor(t){super(t),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type="corners"}get coords(){let{topLeft:t,topRight:e,bottomLeft:n,bottomRight:r}=this;if(null==t||null==e||null==n||null==r)return null;const i=t.spatialReference;return e=this.projectOrWarn(e,i),n=this.projectOrWarn(n,i),r=this.projectOrWarn(r,i),null==e||null==n||null==r?null:new H.c({rings:[[[n.x,n.y],[t.x,t.y],[e.x,e.y],[r.x,r.y],[n.x,n.y]]],spatialReference:i})}set coords(t){const{topLeft:e}=this;if(null==e)return;const n=e.spatialReference;if(null==(t=this.projectOrWarn(t,n)))return;const{rings:[[r,i,o,s]]}=t;this.bottomLeft=new Y.c({x:r[0],y:r[1],spatialReference:n}),this.topLeft=new Y.c({x:i[0],y:i[1],spatialReference:n}),this.topRight=new Y.c({x:o[0],y:o[1],spatialReference:n}),this.bottomRight=new Y.c({x:s[0],y:s[1],spatialReference:n})}toSourceNormalized(t){const{topLeft:e,topRight:n,bottomRight:r,bottomLeft:i}=this;if(null==t||null==e||null==n||null==r||null==i)return null;const o=e.spatialReference;t=t.normalize();const s=(0,F.projectOrLoad)(t,o).geometry;if(null==s)return null;(0,A.WO)(mt,s.x,s.y);const a=U((0,R.Su)(),[e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y],[0,0,0,1,1,0,1,1]);return j(mt,mt,a),(0,X.Gy)(mt[0],mt[1])}};(0,r._)([(0,c.qq)()],yt.prototype,"coords",null),(0,r._)([(0,c.qq)({type:Y.c})],yt.prototype,"bottomLeft",void 0),(0,r._)([(0,c.qq)({type:Y.c})],yt.prototype,"bottomRight",void 0),(0,r._)([(0,c.qq)({type:Y.c})],yt.prototype,"topLeft",void 0),(0,r._)([(0,c.qq)({type:Y.c})],yt.prototype,"topRight",void 0),yt=(0,r._)([(0,p.c)("esri.layers.support.CornersGeoreference")],yt);const gt=yt;var _t=n(53648),xt=n(47364),vt=n(95247);let wt=class extends G{constructor(t){super(t),this.extent=null,this.rotation=0,this.type="extent-and-rotation"}get coords(){if(null==this.extent)return null;const{xmin:t,ymin:e,xmax:n,ymax:r,spatialReference:i}=this.extent;let o;if(this.rotation){const{x:i,y:s}=this.extent.center,a=bt(i,s,this.rotation);o=[a(t,e),a(t,r),a(n,r),a(n,e)],o.push(o[0])}else o=[[t,e],[t,r],[n,r],[n,e],[t,e]];return new H.c({rings:[o],spatialReference:i})}set coords(t){if(null==t||null==this.extent)return;const e=this.extent.spatialReference;if(t=this.projectOrWarn(t,e),null==t?.extent)return;const{rings:[[n,r,i]],extent:{center:{x:o,y:s}}}=t,a=(0,_t.UB)(Math.PI/2-Math.atan2(r[1]-n[1],r[0]-n[0])),l=bt(o,s,-a),[c,u]=l(n[0],n[1]),[h,p]=l(i[0],i[1]);this.extent=new vt.c({xmin:c,ymin:u,xmax:h,ymax:p,spatialReference:e}),this.rotation=a}toSourceNormalized(t){const{extent:e,rotation:n}=this;if(null==t||null==e)return null;const{xmin:r,ymin:i,xmax:o,ymax:s,center:a,spatialReference:l}=e;t=t.normalize();const c=(0,F.projectOrLoad)(t,l).geometry;if(null==c)return null;let u=c.x,h=c.y;return n&&([u,h]=bt(a.x,a.y,-n)(u,h)),(0,X.Gy)((0,_t.aU)(u,r,o,0,1),(0,_t.aU)(h,s,i,0,1))}};function bt(t,e,n){const r=(0,xt.Af)(n),i=Math.cos(r),o=Math.sin(r);return(n,r)=>[i*(n-t)+o*(r-e)+t,i*(r-e)-o*(n-t)+e]}(0,r._)([(0,c.qq)()],wt.prototype,"coords",null),(0,r._)([(0,c.qq)({type:vt.c})],wt.prototype,"extent",void 0),(0,r._)([(0,c.qq)({type:Number})],wt.prototype,"rotation",void 0),wt=(0,r._)([(0,p.c)("esri.layers.support.ExtentAndRotationGeoreference")],wt);const Mt={key:"type",base:G,typeMap:{"control-points":ft,corners:gt,"extent-and-rotation":wt}},qt={key:"type",base:G,typeMap:{"control-points":ft}};let Pt=class extends((0,q.qm)((0,a.U)(P.c))){constructor(t){super(t),this.georeference=null,this.opacity=1}readGeoreference(t){return ft.fromJSON(t)}get contentWidth(){return 0}get contentHeight(){return 0}toSource(t){const{georeference:e,contentWidth:n,contentHeight:r}=this;if(null==t||null==e||0===n||0===r)return null;const i=e.toSourceNormalized(t);return null==i?null:(i.x*=n,i.y*=r,i)}};(0,r._)([(0,c.qq)({types:Mt,json:{write:!0,types:qt}})],Pt.prototype,"georeference",void 0),(0,r._)([(0,h.E)("georeference")],Pt.prototype,"readGeoreference",null),(0,r._)([(0,c.qq)({json:{read:!1,write:!1}})],Pt.prototype,"opacity",void 0),Pt=(0,r._)([(0,p.c)("esri.layers.support.MediaElementBase")],Pt);const St=Pt;n(60708);var It=n(60544);function Et(t,e){const n=(0,f.CQ)(e);return r=t,"media"===r?.type&&!!t.portalItem&&null!=n&&n>f.sT.PORTAL_ITEM;var r}var Rt=n(73960),At=n(91952);let Ot=class extends St{constructor(t){super(t),this.animationOptions=null,this.content=null,this.image=null,this.type="image",this.image=null}load(){const t=this.image;if("string"==typeof t){const e=(0,w.AD)(t).then((t=>{this._set("content",t)}));this.addResolvingPromise(e)}else if(t instanceof HTMLImageElement){const e=t.decode().then((()=>{this._set("content",t)}));this.addResolvingPromise(e)}else t?this._set("content",t):this.addResolvingPromise(Promise.reject(new o.c("image-element:invalid-image-type","Invalid image type",{image:t})));return Promise.resolve(this)}get contentWidth(){return null==this.content?0:this.content instanceof HTMLImageElement?this.content.naturalWidth:this.content.width}get contentHeight(){return null==this.content?0:this.content instanceof HTMLImageElement?this.content.naturalHeight:this.content.height}readImage(t,e,n){return(0,At.f)(e.url,n)}writeImage(t,e,n,r){if(null==t)return;const i=r?.portalItem,o=r?.resources;if(!i||!o)return void("string"==typeof t&&(e[n]=(0,At.t)(t,r)));const s=function(t){return"string"==typeof t&&!(0,b.o9)(t)&&!(0,b.ue)(t)}(t)?t:null;if(s){if(null==(0,At.i)(s))return void(e[n]=s);const t=(0,At.t)(s,{...r,verifyItemRelativeUrls:r?.verifyItemRelativeUrls?{writtenUrls:r.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},At.M.NO);if(i&&t&&!(0,b.ic)(t))return o.toKeep.push({resource:i.resourceFromPath(t),compress:!1}),void(e[n]=t)}e[n]="<pending>",o.pendingOperations.push(async function(t){return"string"==typeof t?(0,b.o9)(t)?(0,b.W8)(t):(await(0,v.c)(t,{responseType:"blob"})).data:new Promise((e=>function(t){if(t instanceof HTMLCanvasElement)return t;const e=t instanceof HTMLImageElement?t.naturalWidth:t.width,n=t instanceof HTMLImageElement?t.naturalHeight:t.height,r=document.createElement("canvas"),i=r.getContext("2d");return r.width=e,r.height=n,t instanceof HTMLImageElement?i.drawImage(t,0,0,t.width,t.height):t instanceof ImageData&&i.putImageData(t,0,0),r}(t).toBlob(e)))}(t).then((t=>{const r=function(t,e){const n=(0,M.g1)(),r=`${(0,b.kn)("media",n)}.${(0,Rt.e)({type:"blob",blob:t})}`;return e.resourceFromPath(r)}(t,i);e[n]=r.itemRelativeUrl,o.toAdd.push({resource:r,content:{type:"blob",blob:t},compress:!1,finish:t=>{this.image=t.url}})})))}write(t,e){const n=super.write(t,e);return"mediaType"in n&&!n.url&&delete n.mediaType,n}};(0,r._)([(0,c.qq)()],Ot.prototype,"animationOptions",void 0),(0,r._)([(0,c.qq)({readOnly:!0})],Ot.prototype,"content",void 0),(0,r._)([(0,c.qq)({readOnly:!0})],Ot.prototype,"contentWidth",null),(0,r._)([(0,c.qq)({readOnly:!0})],Ot.prototype,"contentHeight",null),(0,r._)([(0,c.qq)({json:{name:"url",type:String,write:{overridePolicy:(t,e,n)=>({enabled:!Et(n?.layer,n?.origin)})}}})],Ot.prototype,"image",void 0),(0,r._)([(0,h.E)("image",["url"])],Ot.prototype,"readImage",null),(0,r._)([(0,d.G)("image")],Ot.prototype,"writeImage",null),(0,r._)([(0,c.qq)({readOnly:!0,json:{read:!1,write:{target:"mediaType",ignoreOrigin:!0}}})],Ot.prototype,"type",void 0),Ot=(0,r._)([(0,p.c)("esri.layers.support.ImageElement")],Ot);const Tt=Ot;var Lt=n(30604),Bt=n(77860),Ct=n(94804),jt=n(57896),Ut=n(83372),Wt=n(41980),Xt=n(6904),Nt=n(33008),Yt=n(47452),Ht=n(6704),Ft=n(44048);function Dt(t,e,n){if(Array.isArray(t)){const r=t[0];if(r>e){const n=(0,Ft.yK)(r,e);t[0]=r+n*(-2*e)}else if(r<n){const e=(0,Ft.yK)(r,n);t[0]=r+e*(-2*n)}}else{const r=t.x;if(r>e){const n=(0,Ft.yK)(r,e);t.x+=n*(-2*e)}else if(r<n){const e=(0,Ft.yK)(r,n);t.x+=e*(-2*n)}}return t}function zt(t,e){const n=[],{ymin:r,ymax:i,xmin:o,xmax:s}=t,a=t.xmax-t.xmin,[l,c]=e.valid,{x:u,frameId:h}=$t(t.xmin,e),{x:p,frameId:d}=$t(t.xmax,e),f=u===p&&a>0;if(a>2*c){const t={xmin:o<s?u:p,ymin:r,xmax:c,ymax:i},e={xmin:l,ymin:r,xmax:o<s?p:u,ymax:i},a={xmin:0,ymin:r,xmax:c,ymax:i},f={xmin:l,ymin:r,xmax:0,ymax:i},m=[],y=[];Gt(t,a)&&m.push(h),Gt(t,f)&&y.push(h),Gt(e,a)&&m.push(d),Gt(e,f)&&y.push(d);for(let t=h+1;t<d;t++)m.push(t),y.push(t);n.push(new Kt(t,[h]),new Kt(e,[d]),new Kt(a,m),new Kt(f,y))}else u>p||f?n.push(new Kt({xmin:u,ymin:r,xmax:c,ymax:i},[h]),new Kt({xmin:l,ymin:r,xmax:p,ymax:i},[d])):n.push(new Kt({xmin:u,ymin:r,xmax:p,ymax:i},[h]));return n}function $t(t,e){const[n,r]=e.valid,i=2*r;let o,s=0;return t>r?(o=Math.ceil(Math.abs(t-r)/i),t-=o*i,s=o):t<n&&(o=Math.ceil(Math.abs(t-n)/i),t+=o*i,s=-o),{x:t,frameId:s}}function Gt(t,e){const{xmin:n,ymin:r,xmax:i,ymax:o}=e;return Vt(t,n,r)&&Vt(t,n,o)&&Vt(t,i,o)&&Vt(t,i,r)}function Vt(t,e,n){return e>=t.xmin&&e<=t.xmax&&n>=t.ymin&&n<=t.ymax}function kt(t,e,n=!0){const r=!(0,Ht.cZ)(t);if(r&&(0,Yt.Wk)(t),n)return(new Qt).cut(t,e);const i=r?t.rings:t.paths,o=r?4:2,s=i.length,a=-2*e;for(let t=0;t<s;t++){const e=i[t];if(e&&e.length>=o){const t=[];for(const n of e)t.push([n[0]+a,n[1]]);i.push(t)}}return r?t.rings=i:t.paths=i,t}class Kt{constructor(t,e){this.extent=t,this.frameIds=e}}const Jt=(0,Ut.Su)();class Qt{constructor(){this._linesIn=[],this._linesOut=[]}cut(t,e){let n;if(this._xCut=e,t.rings)this._closed=!0,n=t.rings,this._minPts=4;else{if(!t.paths)return null;this._closed=!1,n=t.paths,this._minPts=2}for(const t of n){if(!t||t.length<this._minPts)continue;let e=!0;for(const n of t)e?(this.moveTo(n),e=!1):this.lineTo(n);this._closed&&this.close()}this._pushLineIn(),this._pushLineOut(),n=[];for(const t of this._linesIn)t&&t.length>=this._minPts&&n.push(t);const r=-2*this._xCut;for(const t of this._linesOut)if(t&&t.length>=this._minPts){for(const e of t)e[0]+=r;n.push(t)}return this._closed?t.rings=n:t.paths=n,t}moveTo(t){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(t[0]),this._moveTo(t[0],t[1],this._prevSide),this._prevPt=t,this._firstPt=t}lineTo(t){const e=this._side(t[0]);if(e*this._prevSide==-1){const n=this._intersect(this._prevPt,t);this._lineTo(this._xCut,n,0),this._prevSide=0,this._lineTo(t[0],t[1],e)}else this._lineTo(t[0],t[1],e);this._prevSide=e,this._prevPt=t}close(){const t=this._firstPt,e=this._prevPt;t[0]===e[0]&&t[1]===e[1]||this.lineTo(t),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(t,e,n){this._closed?(this._lineIn.push([n<=0?t:this._xCut,e]),this._lineOut.push([n>=0?t:this._xCut,e])):(n<=0&&this._lineIn.push([t,e]),n>=0&&this._lineOut.push([t,e]))}_lineTo(t,e,n){this._closed?(this._addPolyVertex(this._lineIn,n<=0?t:this._xCut,e),this._addPolyVertex(this._lineOut,n>=0?t:this._xCut,e)):n<0?(0===this._prevSide&&this._pushLineOut(),this._lineIn.push([t,e])):n>0?(0===this._prevSide&&this._pushLineIn(),this._lineOut.push([t,e])):this._prevSide<0?(this._lineIn.push([t,e]),this._lineOut.push([t,e])):this._prevSide>0&&(this._lineOut.push([t,e]),this._lineIn.push([t,e]))}_addPolyVertex(t,e,n){const r=t.length;r>1&&t[r-1][0]===e&&t[r-2][0]===e?t[r-1][1]=n:t.push([e,n])}_checkClosingPt(t){const e=t.length;e>3&&t[0][0]===this._xCut&&t[e-2][0]===this._xCut&&t[1][0]===this._xCut&&(t[0][1]=t[e-2][1],t.pop())}_side(t){return t<this._xCut?-1:t>this._xCut?1:0}_intersect(t,e){const n=(this._xCut-t[0])/(e[0]-t[0]);return t[1]+n*(e[1]-t[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}let Zt=class extends S.c{constructor(t){super(t)}get bounds(){const t=this.coords;return null==t?.extent?null:(0,Ut.ER)(t.extent)}get coords(){const t=this.element.georeference?.coords;return(0,F.projectOrLoad)(t,this.spatialReference).geometry}get normalizedCoords(){return H.c.fromJSON(function(t,e){if(null==t)return null;const n=t.spatialReference,r=(0,It.Nq)(n),i=(0,I.wt)(t)?t.toJSON():t;if(!r)return i;const o=(0,It.kn)(n)?102100:4326,s=Ft.Hh[o].maxX,a=Ft.Hh[o].minX;if((0,Ht._x)(i))return Dt(i,s,a);if((0,Ht._)(i))return i.points=i.points.map((t=>Dt(t,s,a))),i;if((0,Ht.Ul)(i))return function(t,e){if(!e)return t;const n=zt(t,e).map((t=>t.extent));return n.length<2?n[0]||t:n.length>2?(t.xmin=e.valid[0],t.xmax=e.valid[1],t):{rings:n.map((t=>[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]))}}(i,r);if((0,Ht.Cs)(i)||(0,Ht.cZ)(i)){const t=(0,Nt.ac)(Jt,i),n={xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]},r=(0,Ft.yK)(n.xmin,a)*(2*s),o=0===r?i:(0,Ft.wb)(i,r);return n.xmin+=r,n.xmax+=r,n.xmax>s?kt(o,s,e):n.xmin<a?kt(o,a,e):o}return i}(this.coords,!0))}get normalizedBounds(){const t=null!=this.normalizedCoords?this.normalizedCoords.extent:null;return null!=t?(0,Ut.ER)(t):null}};(0,r._)([(0,c.qq)()],Zt.prototype,"spatialReference",void 0),(0,r._)([(0,c.qq)()],Zt.prototype,"element",void 0),(0,r._)([(0,c.qq)()],Zt.prototype,"bounds",null),(0,r._)([(0,c.qq)()],Zt.prototype,"coords",null),(0,r._)([(0,c.qq)()],Zt.prototype,"normalizedCoords",null),(0,r._)([(0,c.qq)()],Zt.prototype,"normalizedBounds",null),Zt=(0,r._)([(0,p.c)("esri.layers.support.MediaElementView")],Zt);var te=n(60976);let ee=class extends St{constructor(t){super(t),this.autoplay=!0,this.content=null,this.type="video"}load(){const t=this.video;if("string"==typeof t){const e=document.createElement("video");e.src=t,e.crossOrigin="anonymous",e.autoplay=!0,e.muted=!0,e.loop=!0,this.addResolvingPromise(this._loadVideo(e).then((()=>{this._set("content",e)})))}else t instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(t).then((()=>{this._set("content",t)}))):this.addResolvingPromise(Promise.reject(new o.c("video-element:invalid-video-type","Invalid video type",{video:t})));return Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}set video(t){"not-loaded"===this.loadStatus?this._set("video",t):s.c.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}_loadVideo(t){return new Promise(((e,n)=>{const r=(0,te.qw)(t,"canplay",(()=>{this.removeHandles("canplay"),this.autoplay?t.play().then(e,n):e()}));this.addHandles(r,"canplay"),"anonymous"!==t.crossOrigin&&(t.crossOrigin="anonymous",t.src?.includes("blob:")||(t.src=t.src))}))}};(0,r._)([(0,c.qq)()],ee.prototype,"autoplay",void 0),(0,r._)([(0,c.qq)({readOnly:!0})],ee.prototype,"content",void 0),(0,r._)([(0,c.qq)({readOnly:!0})],ee.prototype,"contentWidth",null),(0,r._)([(0,c.qq)({readOnly:!0})],ee.prototype,"contentHeight",null),(0,r._)([(0,c.qq)()],ee.prototype,"video",null),ee=(0,r._)([(0,p.c)("esri.layers.support.VideoElement")],ee);const ne=ee,re={key:"type",defaultKeyValue:"image",base:St,typeMap:{image:Tt,video:ne}},ie=i.c.ofType(re);let oe=class extends(P.c.LoadableMixin((0,Ct.g)(Bt.c.EventedAccessor))){constructor(t){super(t),this._index=new Xt.c,this._elementViewsMap=new Map,this._elementsIndexes=new Map,this._elementsChangedHandler=t=>{for(const e of t.removed){const t=this._elementViewsMap.get(e);this._elementViewsMap.delete(e),this._index.delete(t),this.removeHandles(t),t.destroy(),this.notifyChange("fullExtent")}const{spatialReference:e}=this;for(const n of t.added){if(this._elementViewsMap.get(n))continue;const t=new Zt({spatialReference:e,element:n});this._elementViewsMap.set(n,t);const r=(0,jt.aE)((()=>t.coords),(()=>this._updateIndexForElement(t,!1)));this._updateIndexForElement(t,!0),this.addHandles(r,t)}this._elementsIndexes.clear(),this.elements.forEach(((t,e)=>this._elementsIndexes.set(t,e))),this.emit("refresh")},this.elements=new ie}async load(t){if((0,l.wp)(t),!this.spatialReference){const t=this.elements.find((t=>null!=t.georeference?.coords));this._set("spatialReference",t?t.georeference.coords.spatialReference:D.c.WGS84)}return this._elementsChangedHandler({added:this.elements.items,removed:[]}),this.addHandles(this.elements.on("change",this._elementsChangedHandler)),this}destroy(){this._index.clear(),this._elementViewsMap.clear(),this._elementsIndexes.clear()}set elements(t){this._set("elements",(0,Lt.q)(t,this._get("elements"),ie))}get fullExtent(){if("not-loaded"===this.loadStatus)return null;const t=this._index.fullBounds;return null==t?null:new vt.c({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3],spatialReference:this.spatialReference})}set spatialReference(t){"not-loaded"===this.loadStatus?this._set("spatialReference",t):s.c.getLogger(this).error("#spatialReference","spatialReference cannot be changed after the source is loaded.")}async queryElements(t,e){await this.load(),await(0,F.initializeProjection)(t.spatialReference,this.spatialReference,null,e);const n=(0,It.yK)(t.spatialReference,this.spatialReference)?t:(0,F.project)(t,this.spatialReference);if(!n)return[];const r=n.normalize(),i=[];for(const t of r)this._index.forEachInBounds((0,Ut.ER)(t),(({normalizedCoords:e,element:n})=>{null!=e&&(0,Wt.yu)(t,e)&&i.push(n)}));return i.sort(((t,e)=>this._elementsIndexes.get(t)-this._elementsIndexes.get(e))),i}_updateIndexForElement(t,e){const n=t.normalizedBounds,r=this._index.has(t),i=null!=n;this._index.delete(t),i&&this._index.set(t,n),this.notifyChange("fullExtent"),e||(r!==i?this.emit("refresh"):this.emit("change",{element:t.element}))}};(0,r._)([(0,c.qq)()],oe.prototype,"elements",null),(0,r._)([(0,c.qq)({readOnly:!0})],oe.prototype,"fullExtent",null),(0,r._)([(0,c.qq)()],oe.prototype,"spatialReference",null),oe=(0,r._)([(0,p.c)("esri.layers.support.LocalMediaElementSource")],oe);const se=oe;var ae=n(8616);function le(t){return"object"==typeof t&&null!=t&&"type"in t}function ce(t){return le(t)&&"image"===t.type}let ue=class extends((0,y.W)((0,x.I)((0,g.Y)((0,_.K)((0,a.U)(m.c)))))){constructor(t){super(t),this.effectiveSource=null,this.georeference=null,this.copyright=null,this.operationalLayerType="MediaLayer",this.spatialReference=null,this.type="media",this._debouncedSaveOperations=(0,l.Cu)((async(t,e,r)=>{const{save:i,saveAs:o}=await n.e(7852).then(n.bind(n,7852));switch(t){case ae.U.SAVE:return i(this,e);case ae.U.SAVE_AS:return o(this,r,e)}})),this.source=new se}load(t){return this.addResolvingPromise(this._doLoad(t)),Promise.resolve(this)}async _doLoad(t){await this.loadFromPortal({supportedTypes:["Media Layer"]},t);let e=this.source;if(!e)throw new o.c("media-layer:source-missing","Set 'MediaLayer.source' before loading the layer.");const n=this._getSourceOverride(e,this.georeference);n&&(this.setAtOrigin("source",n,"web-map"),e=n);const r=le(e)?new se({elements:new i.c([e])}):e;this._set("effectiveSource",r),this.spatialReference&&(r.spatialReference=this.spatialReference),await r.load(t),this.spatialReference=r.spatialReference}destroy(){this.effectiveSource?.destroy(),this.source?.destroy()}readGeoreference(t,e){return t&&"itemId"in e&&e.itemId?t:void 0}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}set source(t){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("source",t):s.c.getLogger(this).error("#source","source cannot be changed after the layer is loaded.")}castSource(t){return t?Array.isArray(t)?new se({elements:new i.c(t)}):t instanceof i.c?new se({elements:t}):t:null}readSource(t,e,n){if("itemId"in e&&e.itemId)return;const r=this._createSource(e);return r?.read(e,n),r}writeSource(t,e,n,r){ce(t)?t.write(e,r):r?.messages&&r?.messages?.push(new o.c("media-layer:unsupported-source","source must be an 'ImageElement'"))}async save(t){return this._debouncedSaveOperations(ae.U.SAVE,t)}async saveAs(t,e){return this._debouncedSaveOperations(ae.U.SAVE_AS,e,t)}_createSource(t){if("mediaType"in t)switch(t.mediaType){case"image":return new Tt;case"video":return new ne}return null}_getSourceOverride(t,e){if(le(t)&&this.originIdOf("source")===f.sT.PORTAL_ITEM&&e&&this.originIdOf("georeference")===f.sT.WEB_MAP){const n=t.toJSON(),r=this._createSource(n);return r.read({...n},{origin:"portal-item"}),r.read({georeference:e},{origin:"web-map"}),r}return null}};(0,r._)([(0,c.qq)({readOnly:!0})],ue.prototype,"effectiveSource",void 0),(0,r._)([(0,c.qq)({readOnly:!0,json:{read:!1,write:!1,origins:{"web-map":{read:!0,write:!1}}}})],ue.prototype,"georeference",void 0),(0,r._)([(0,h.E)("web-map","georeference")],ue.prototype,"readGeoreference",null),(0,r._)([(0,c.qq)({type:String})],ue.prototype,"copyright",void 0),(0,r._)([(0,c.qq)({readOnly:!0})],ue.prototype,"fullExtent",null),(0,r._)([(0,c.qq)({type:["MediaLayer"]})],ue.prototype,"operationalLayerType",void 0),(0,r._)([(0,c.qq)({type:["show","hide"]})],ue.prototype,"listMode",void 0),(0,r._)([(0,c.qq)({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1,overridePolicy(t,e,n){return{enabled:!0,allowNull:!1,ignoreOrigin:Et(this,n?.origin)&&ce(t)&&!!t.georeference&&t.originIdOf("georeference")>f.sT.PORTAL_ITEM}}}}})],ue.prototype,"source",null),(0,r._)([(0,u.W)("source")],ue.prototype,"castSource",null),(0,r._)([(0,h.E)("source",["url"])],ue.prototype,"readSource",null),(0,r._)([(0,d.G)("source")],ue.prototype,"writeSource",null),(0,r._)([(0,c.qq)()],ue.prototype,"spatialReference",void 0),(0,r._)([(0,c.qq)({readOnly:!0})],ue.prototype,"type",void 0),ue=(0,r._)([(0,p.c)("esri.layers.MediaLayer")],ue);const he=ue},24676:(t,e,n)=>{n.d(e,{gH:()=>P,GA:()=>S});var r,i,o=n(20744),s=n(58820),a=n(46988),l=n(65604),c=(n(8528),n(14644)),u={exports:{}};i=function(){function t(e,n,r,i){var o=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(o,t.prototype),o.expected=n,o.found=r,o.location=i,o.name="SyntaxError",o}function e(t,e,n){return n=n||" ",t.length>e?t:(e-=t.length,t+(n+=n.repeat(e)).slice(0,e))}return function(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n}(t,Error),t.prototype.format=function(t){var n="Error: "+this.message;if(this.location){var r,i=null;for(r=0;r<t.length;r++)if(t[r].source===this.location.source){i=t[r].text.split(/\r\n|\n|\r/g);break}var o=this.location.start,s=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,a=this.location.source+":"+s.line+":"+s.column;if(i){var l=this.location.end,c=e("",s.line.toString().length," "),u=i[o.line-1],h=(o.line===l.line?l.column:u.length+1)-o.column||1;n+="\n --\x3e "+a+"\n"+c+" |\n"+s.line+" | "+u+"\n"+c+" | "+e("",o.column-1," ")+e("",h,"^")}else n+="\n at "+a}return n},t.buildMessage=function(t,e){var n={literal:function(t){return'"'+i(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?o(t[0])+"-"+o(t[1]):o(t)}));return"["+(t.inverted?"^":"")+e.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(t){return t.description}};function r(t){return t.charCodeAt(0).toString(16).toUpperCase()}function i(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+r(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+r(t)}))}function o(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+r(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+r(t)}))}function s(t){return n[t.type](t)}return"Expected "+function(t){var e,n,r=t.map(s);if(r.sort(),r.length>0){for(e=1,n=1;e<r.length;e++)r[e-1]!==r[e]&&(r[n]=r[e],n++);r.length=n}switch(r.length){case 1:return r[0];case 2:return r[0]+" or "+r[1];default:return r.slice(0,-1).join(", ")+", or "+r[r.length-1]}}(t)+" but "+function(t){return t?'"'+i(t)+'"':"end of input"}(e)+" found."},{SyntaxError:t,parse:function(e,n){var r,i={},o=(n=void 0!==n?n:{}).grammarSource,s={start:zt},a=zt,l="none",c=")",u=",",h="(",p="%",d="px",f="cm",m="mm",y="in",g="pt",_="pc",x="deg",v="rad",w="grad",b="turn",M="#",q=".",P="e",S=/^[ \t\n\r]/,I=/^[a-z\-]/,E=/^[0-9a-fA-F]/,R=/^[+\-]/,A=/^[0-9]/,O=Yt("none"),T=Xt("none",!1),L=Xt(")",!1),B=Xt(",",!1),C=Yt("whitespace"),j=Nt([" ","\t","\n","\r"],!1,!1),U=Yt("function"),W=Xt("(",!1),X=Yt("identifier"),N=Nt([["a","z"],"-"],!1,!1),Y=Yt("percentage"),H=Xt("%",!1),F=Yt("length"),D=Xt("px",!1),z=Xt("cm",!1),$=Xt("mm",!1),G=Xt("in",!1),V=Xt("pt",!1),k=Xt("pc",!1),K=Yt("angle"),J=Xt("deg",!1),Q=Xt("rad",!1),Z=Xt("grad",!1),tt=Xt("turn",!1),et=Yt("number"),nt=Yt("color"),rt=Xt("#",!1),it=Nt([["0","9"],["a","f"],["A","F"]],!1,!1),ot=Nt(["+","-"],!1,!1),st=Nt([["0","9"]],!1,!1),at=Xt(".",!1),lt=Xt("e",!1),ct=function(){return[]},ut=function(t,e){return{type:"function",name:t,parameters:e||[]}},ht=function(t,e){return e.length>0?function(t,e,n){return[t].concat(function(t,e){return t.map((function(t){return t[3]}))}(e))}(t,e):[t]},pt=function(t){return{type:"quantity",value:t.value,unit:t.unit}},dt=function(t){return{type:"color",colorType:t.type,value:t.value}},ft=function(t){return t},mt=function(){return Wt()},yt=function(t){return{value:t,unit:"%"}},gt=function(t){return{value:t,unit:"px"}},_t=function(t){return{value:t,unit:"cm"}},xt=function(t){return{value:t,unit:"mm"}},vt=function(t){return{value:t,unit:"in"}},wt=function(t){return{value:t,unit:"pt"}},bt=function(t){return{value:t,unit:"pc"}},Mt=function(t){return{value:t,unit:"deg"}},qt=function(t){return{value:t,unit:"rad"}},Pt=function(t){return{value:t,unit:"grad"}},St=function(t){return{value:t,unit:"turn"}},It=function(t){return{value:t,unit:null}},Et=function(){return{type:"hex",value:Wt()}},Rt=function(t){return{type:"function",value:t}},At=function(){return{type:"named",value:Wt()}},Ot=function(){return parseFloat(Wt())},Tt=0,Lt=0,Bt=[{line:1,column:1}],Ct=0,jt=[],Ut=0;if("startRule"in n){if(!(n.startRule in s))throw new Error("Can't start parsing from rule \""+n.startRule+'".');a=s[n.startRule]}function Wt(){return e.substring(Lt,Tt)}function Xt(t,e){return{type:"literal",text:t,ignoreCase:e}}function Nt(t,e,n){return{type:"class",parts:t,inverted:e,ignoreCase:n}}function Yt(t){return{type:"other",description:t}}function Ht(t){var n,r=Bt[t];if(r)return r;for(n=t-1;!Bt[n];)n--;for(r={line:(r=Bt[n]).line,column:r.column};n<t;)10===e.charCodeAt(n)?(r.line++,r.column=1):r.column++,n++;return Bt[t]=r,r}function Ft(t,e,n){var r=Ht(t),i=Ht(e),s={source:o,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:i.line,column:i.column}};return n&&o&&"function"==typeof o.offset&&(s.start=o.offset(s.start),s.end=o.offset(s.end)),s}function Dt(t){Tt<Ct||(Tt>Ct&&(Ct=Tt,jt=[]),jt.push(t))}function zt(){var t;return(t=$t())===i&&(t=function(){var t,e;if(t=[],(e=Gt())!==i)for(;e!==i;)t.push(e),e=Gt();else t=i;return t}()),t}function $t(){var t,n;return Ut++,t=Tt,kt(),e.substr(Tt,4)===l?(n=l,Tt+=4):(n=i,0===Ut&&Dt(T)),n!==i?(kt(),Lt=t,t=ct()):(Tt=t,t=i),Ut--,t===i&&0===Ut&&Dt(O),t}function Gt(){var t,n,r,o;return t=Tt,kt(),(n=function(){var t,n,r;return Ut++,t=Tt,(n=Kt())!==i?(40===e.charCodeAt(Tt)?(r=h,Tt++):(r=i,0===Ut&&Dt(W)),r!==i?(Lt=t,t=ft(n)):(Tt=t,t=i)):(Tt=t,t=i),Ut--,t===i&&(n=i,0===Ut&&Dt(U)),t}())!==i?(kt(),(r=function(){var t,n,r,o,s,a,l,c;if(t=Tt,(n=Vt())!==i){for(r=[],o=Tt,s=kt(),44===e.charCodeAt(Tt)?(a=u,Tt++):(a=i,0===Ut&&Dt(B)),a===i&&(a=null),l=kt(),(c=Vt())!==i?o=s=[s,a,l,c]:(Tt=o,o=i);o!==i;)r.push(o),o=Tt,s=kt(),44===e.charCodeAt(Tt)?(a=u,Tt++):(a=i,0===Ut&&Dt(B)),a===i&&(a=null),l=kt(),(c=Vt())!==i?o=s=[s,a,l,c]:(Tt=o,o=i);Lt=t,t=ht(n,r)}else Tt=t,t=i;return t}())===i&&(r=null),kt(),41===e.charCodeAt(Tt)?(o=c,Tt++):(o=i,0===Ut&&Dt(L)),o!==i?(kt(),Lt=t,t=ut(n,r)):(Tt=t,t=i)):(Tt=t,t=i),t}function Vt(){var t,e;return t=Tt,(e=Jt())===i&&(e=Qt())===i&&(e=Zt())===i&&(e=function(){var t,e;return Ut++,t=Tt,kt(),(e=ee())!==i?(Lt=t,t=It(e)):(Tt=t,t=i),Ut--,t===i&&0===Ut&&Dt(et),t}()),e!==i&&(Lt=t,e=pt(e)),(t=e)===i&&(t=Tt,(e=te())!==i&&(Lt=t,e=dt(e)),t=e),t}function kt(){var t,n;for(Ut++,t=[],S.test(e.charAt(Tt))?(n=e.charAt(Tt),Tt++):(n=i,0===Ut&&Dt(j));n!==i;)t.push(n),S.test(e.charAt(Tt))?(n=e.charAt(Tt),Tt++):(n=i,0===Ut&&Dt(j));return Ut--,n=i,0===Ut&&Dt(C),t}function Kt(){var t,n,r;if(Ut++,t=Tt,n=[],I.test(e.charAt(Tt))?(r=e.charAt(Tt),Tt++):(r=i,0===Ut&&Dt(N)),r!==i)for(;r!==i;)n.push(r),I.test(e.charAt(Tt))?(r=e.charAt(Tt),Tt++):(r=i,0===Ut&&Dt(N));else n=i;return n!==i&&(Lt=t,n=mt()),Ut--,(t=n)===i&&(n=i,0===Ut&&Dt(X)),t}function Jt(){var t,n,r;return Ut++,t=Tt,kt(),(n=ee())!==i?(37===e.charCodeAt(Tt)?(r=p,Tt++):(r=i,0===Ut&&Dt(H)),r!==i?(Lt=t,t=yt(n)):(Tt=t,t=i)):(Tt=t,t=i),Ut--,t===i&&0===Ut&&Dt(Y),t}function Qt(){var t,n,r;return Ut++,t=Tt,kt(),(n=ee())!==i?(e.substr(Tt,2)===d?(r=d,Tt+=2):(r=i,0===Ut&&Dt(D)),r!==i?(Lt=t,t=gt(n)):(Tt=t,t=i)):(Tt=t,t=i),t===i&&(t=Tt,kt(),(n=ee())!==i?(e.substr(Tt,2)===f?(r=f,Tt+=2):(r=i,0===Ut&&Dt(z)),r!==i?(Lt=t,t=_t(n)):(Tt=t,t=i)):(Tt=t,t=i),t===i&&(t=Tt,kt(),(n=ee())!==i?(e.substr(Tt,2)===m?(r=m,Tt+=2):(r=i,0===Ut&&Dt($)),r!==i?(Lt=t,t=xt(n)):(Tt=t,t=i)):(Tt=t,t=i),t===i&&(t=Tt,kt(),(n=ee())!==i?(e.substr(Tt,2)===y?(r=y,Tt+=2):(r=i,0===Ut&&Dt(G)),r!==i?(Lt=t,t=vt(n)):(Tt=t,t=i)):(Tt=t,t=i),t===i&&(t=Tt,kt(),(n=ee())!==i?(e.substr(Tt,2)===g?(r=g,Tt+=2):(r=i,0===Ut&&Dt(V)),r!==i?(Lt=t,t=wt(n)):(Tt=t,t=i)):(Tt=t,t=i),t===i&&(t=Tt,kt(),(n=ee())!==i?(e.substr(Tt,2)===_?(r=_,Tt+=2):(r=i,0===Ut&&Dt(k)),r!==i?(Lt=t,t=bt(n)):(Tt=t,t=i)):(Tt=t,t=i)))))),Ut--,t===i&&0===Ut&&Dt(F),t}function Zt(){var t,n,r;return Ut++,t=Tt,(n=ee())!==i?(e.substr(Tt,3)===x?(r=x,Tt+=3):(r=i,0===Ut&&Dt(J)),r!==i?(Lt=t,t=Mt(n)):(Tt=t,t=i)):(Tt=t,t=i),t===i&&(t=Tt,(n=ee())!==i?(e.substr(Tt,3)===v?(r=v,Tt+=3):(r=i,0===Ut&&Dt(Q)),r!==i?(Lt=t,t=qt(n)):(Tt=t,t=i)):(Tt=t,t=i),t===i&&(t=Tt,(n=ee())!==i?(e.substr(Tt,4)===w?(r=w,Tt+=4):(r=i,0===Ut&&Dt(Z)),r!==i?(Lt=t,t=Pt(n)):(Tt=t,t=i)):(Tt=t,t=i),t===i&&(t=Tt,(n=ee())!==i?(e.substr(Tt,4)===b?(r=b,Tt+=4):(r=i,0===Ut&&Dt(tt)),r!==i?(Lt=t,t=St(n)):(Tt=t,t=i)):(Tt=t,t=i)))),Ut--,t===i&&(n=i,0===Ut&&Dt(K)),t}function te(){var t,n,r,o;if(Ut++,t=Tt,35===e.charCodeAt(Tt)?(n=M,Tt++):(n=i,0===Ut&&Dt(rt)),n!==i){if(r=[],E.test(e.charAt(Tt))?(o=e.charAt(Tt),Tt++):(o=i,0===Ut&&Dt(it)),o!==i)for(;o!==i;)r.push(o),E.test(e.charAt(Tt))?(o=e.charAt(Tt),Tt++):(o=i,0===Ut&&Dt(it));else r=i;r!==i?(Lt=t,t=Et()):(Tt=t,t=i)}else Tt=t,t=i;return t===i&&(t=Tt,(n=Gt())!==i&&(Lt=t,n=Rt(n)),(t=n)===i&&(t=Tt,(n=Kt())!==i&&(Lt=t,n=At()),t=n)),Ut--,t===i&&(n=i,0===Ut&&Dt(nt)),t}function ee(){var t,n,r,o,s,a,l;for(t=Tt,R.test(e.charAt(Tt))?(e.charAt(Tt),Tt++):0===Ut&&Dt(ot),n=Tt,r=[],A.test(e.charAt(Tt))?(o=e.charAt(Tt),Tt++):(o=i,0===Ut&&Dt(st));o!==i;)r.push(o),A.test(e.charAt(Tt))?(o=e.charAt(Tt),Tt++):(o=i,0===Ut&&Dt(st));if(46===e.charCodeAt(Tt)?(o=q,Tt++):(o=i,0===Ut&&Dt(at)),o!==i){if(s=[],A.test(e.charAt(Tt))?(a=e.charAt(Tt),Tt++):(a=i,0===Ut&&Dt(st)),a!==i)for(;a!==i;)s.push(a),A.test(e.charAt(Tt))?(a=e.charAt(Tt),Tt++):(a=i,0===Ut&&Dt(st));else s=i;s!==i?n=r=[r,o,s]:(Tt=n,n=i)}else Tt=n,n=i;if(n===i)if(n=[],A.test(e.charAt(Tt))?(r=e.charAt(Tt),Tt++):(r=i,0===Ut&&Dt(st)),r!==i)for(;r!==i;)n.push(r),A.test(e.charAt(Tt))?(r=e.charAt(Tt),Tt++):(r=i,0===Ut&&Dt(st));else n=i;if(n!==i){if(r=Tt,101===e.charCodeAt(Tt)?(o=P,Tt++):(o=i,0===Ut&&Dt(lt)),o!==i){if(R.test(e.charAt(Tt))?(s=e.charAt(Tt),Tt++):(s=i,0===Ut&&Dt(ot)),s===i&&(s=null),a=[],A.test(e.charAt(Tt))?(l=e.charAt(Tt),Tt++):(l=i,0===Ut&&Dt(st)),l!==i)for(;l!==i;)a.push(l),A.test(e.charAt(Tt))?(l=e.charAt(Tt),Tt++):(l=i,0===Ut&&Dt(st));else a=i;a!==i?r=o=[o,s,a]:(Tt=r,r=i)}else Tt=r,r=i;r===i&&(r=null),Lt=t,t=Ot()}else Tt=t,t=i;return t}if((r=a())!==i&&Tt===e.length)return r;throw r!==i&&Tt<e.length&&Dt({type:"end"}),function(e,n,r){return new t(t.buildMessage(e,n),e,n,r)}(jt,Ct<e.length?e.charAt(Ct):null,Ct<e.length?Ft(Ct,Ct+1):Ft(Ct,Ct))}}},(r=u).exports&&(r.exports=i());var h=u.exports;function p(t){if(!t||0===t.length)return null;if("string"==typeof t){const e=d(t);return e&&0!==e.length?e:null}const e=t.map((t=>{if(!Number.isFinite(t.scale)||t.scale<=0)throw new o.c("effect:invalid-scale","scale must be finite and greater than 0",{stop:t});return{scale:t.scale,effects:d(t.value)}}));e.sort(((t,e)=>e.effects.length-t.effects.length));for(let t=0;t<e.length-1;t++){if(!(0,c.w1)(e[t].effects,e[t+1].effects))throw new o.c("effect:interpolation-impossible","Cannot interpolate by scale between 2 lists of mixed effects",{a:e[t].effects,b:e[t+1].effects});(0,c.A1)(e[t].effects,e[t+1].effects)}return e.sort(((t,e)=>e.scale-t.scale)),e}function d(t){let e;if(!t)return[];try{e=h.parse(t)}catch(e){throw new o.c("effect:invalid-syntax","Invalid effect syntax",{value:t,error:e})}return e.map((t=>function(t){try{switch(t.name){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":return function(t){let e=1;return f(t.parameters,1),1===t.parameters.length&&(e=x(t.parameters[0])),new l.M7(t.name,e)}(t);case"opacity":return function(t){let e=1;return f(t.parameters,1),1===t.parameters.length&&(e=x(t.parameters[0])),new l.Ez(e)}(t);case"hue-rotate":return function(t){let e=0;return f(t.parameters,1),1===t.parameters.length&&(e=function(t){return function(t){if("quantity"!==t.type||!(0===t.value&&null===t.unit||t.unit&&null!=g[t.unit]))throw new o.c("effect:type-error",`Expected <angle>, Actual: ${m(t)}`,{term:t})}(t),t.value*g[t.unit]||0}(t.parameters[0])),new l.C8(e)}(t);case"blur":return function(t){let e=0;return f(t.parameters,1),1===t.parameters.length&&(e=v(t.parameters[0]),y(e,t.parameters[0])),new l.o1(e)}(t);case"drop-shadow":return function(t){const e=[];let n=null;for(const r of t.parameters)if("color"===r.type){if(e.length&&Object.freeze(e),n)throw new o.c("effect:type-error","Accepts only one color",{});n=w(r)}else{const t=v(r);if(Object.isFrozen(e))throw new o.c("effect:type-error","<length> parameters not consecutive",{lengths:e});e.push(t),3===e.length&&y(t,r)}if(e.length<2||e.length>3)throw new o.c("effect:type-error",`Expected <length>{2,3}, Actual: <length>{${e.length}}`,{lengths:e});return new l.of(e[0],e[1],e[2]||0,n||b("black"))}(t);case"bloom":return function(t){let e=1,n=0,r=0;return f(t.parameters,3),t.parameters[0]&&(e=x(t.parameters[0])),t.parameters[1]&&(n=v(t.parameters[1]),y(n,t.parameters[1])),t.parameters[2]&&(r=x(t.parameters[2])),new l.qC(e,n,r)}(t)}}catch(e){throw e.details.filter=t,e}throw new o.c("effect:unknown-effect",`Effect '${t.name}' is not supported`,{effect:t})}(t)))}function f(t,e){if(t.length>e)throw new o.c("effect:type-error",`Function supports up to ${e} parameters, Actual: ${t.length}`,{parameters:t})}function m(t){if("color"===t.type)return"<color>";if(t.unit){if(t.unit in _)return"<length>";if(t.unit in g)return"<angle>";if("%"===t.unit)return"<percentage>"}return"<double>"}function y(t,e){if(t<0)throw new o.c("effect:type-error",`Negative values are not allowed, Actual: ${t}`,{term:e})}const g={deg:1,grad:.9,rad:180/Math.PI,turn:360},_={px:1,cm:96/2.54,mm:96/2.54/10,in:96,pc:16,pt:96/72};function x(t){!function(t){if("quantity"!==t.type||null!==t.unit&&"%"!==t.unit)throw new o.c("effect:type-error",`Expected <double> or <percentage>, Actual: ${m(t)}`,{term:t})}(t);const e=t.value;return y(e,t),"%"===t.unit?.01*e:e}function v(t){return function(t){if("quantity"!==t.type||!(0===t.value&&null===t.unit||t.unit&&null!=_[t.unit]))throw new o.c("effect:type-error",`Expected <length>, Actual: ${m(t)}`,{term:t})}(t),t.value*_[t.unit]||0}function w(t){switch(t.colorType){case"hex":return(0,a.yU)(t.value);case"named":return b(t.value);case"function":return function(t){if(f(t.parameters,4),M.test(t.name))return[x(t.parameters[0]),x(t.parameters[1]),x(t.parameters[2]),t.parameters[3]?x(t.parameters[3]):1];if(q.test(t.name))return(0,a.ec)(function(t){return function(t){if("quantity"!==t.type||null!==t.unit)throw new o.c("effect:type-error",`Expected <double>, Actual: ${m(t)}`,{term:t})}(t),y(t.value,t),t.value}(t.parameters[0]),x(t.parameters[1]),x(t.parameters[2]),t.parameters[3]?x(t.parameters[3]):1);throw new o.c("effect:syntax-error",`Invalid color function '${t.name}'`,{colorFunction:t})}(t.value)}}function b(t){if(!(0,a.kv)(t))throw new o.c("effect:unknown-color",`color '${t}' isn't valid`,{namedColor:t});return(0,a.uO)(t)}const M=/^rgba?/i,q=/^hsla?/i;function P(t,e,n){try{return function(t){if(!t||0===t.length)return null;if(function(t){const e=t[0];return!!e&&"scale"in e}(t)){const e=[];for(const n of t)e.push({scale:n.scale,value:I(n.value)});return e}return I(t)}(t)}catch(t){n?.messages?.push(t)}return null}function S(t,e,n,r){try{const r=function(t){const e=p(t);return e?(0,c.Ub)(e)?e.map((t=>t.toJSON())):e.map((({scale:t,effects:e})=>({scale:t,value:e.map((t=>t.toJSON()))}))):null}(t);(0,s.qQ)(n,r,e)}catch(t){r.messages&&r.messages.push(t)}}function I(t){if(!t?.length)return"";const e=[];for(const n of t){let t=[];switch(n.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":t=[E(n,"amount")];break;case"blur":t=[E(n,"radius","pt")];break;case"hue-rotate":t=[E(n,"angle","deg")];break;case"drop-shadow":t=[E(n,"xoffset","pt"),E(n,"yoffset","pt"),E(n,"blurRadius","pt"),R(n,"color")];break;case"bloom":t=[E(n,"strength"),E(n,"radius","pt"),E(n,"threshold")]}const r=`${n.type}(${t.filter(Boolean).join(" ")})`;p(r),e.push(r)}return e.join(" ")}function E(t,e,n){if(null==t[e])throw new o.c("effect:missing-parameter",`Missing parameter '${e}' in ${t.type} effect`,{effect:t});return n?t[e]+n:""+t[e]}function R(t,e){if(null==t[e])throw new o.c("effect:missing-parameter",`Missing parameter '${e}' in ${t.type} effect`,{effect:t});const n=t[e];return`rgba(${n[0]||0}, ${n[1]||0}, ${n[2]||0}, ${n[3]/255||0})`}},6904:(t,e,n)=>{n.d(e,{c:()=>a});var r=n(9456),i=n(3024),o=n(83372);const s={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new i.U(9,(0,r.c)("esri-csp-restrictions")?t=>({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const t=new Array(this._idByBounds.size);let e=0;this._idByBounds.forEach(((n,r)=>{t[e++]=r})),this._indexInvalid=!1,this._index.clear(),this._index.load(t)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((t=>this._idByBounds.has(t)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const t=(0,o.FZ)();for(const e of this._boundsById.values())e&&(t[0]=Math.min(e[0],t[0]),t[1]=Math.min(e[1],t[1]),t[2]=Math.max(e[2],t[2]),t[3]=Math.max(e[3],t[3]));return t}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(t){const e=this._boundsById.get(t);this._boundsById.delete(t),e&&(this._idByBounds.delete(e),this._indexInvalid||this._index.remove(e))}forEachInBounds(t,e){this._loadIndex(),function(t,e,n){(function(t){s.minX=t[0],s.minY=t[1],s.maxX=t[2],s.maxY=t[3]})(e),t.search(s,n)}(this._index,t,(t=>e(this._idByBounds.get(t))))}get(t){return this._boundsById.get(t)}has(t){return this._boundsById.has(t)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(t,e){if(!this._indexInvalid){const e=this._boundsById.get(t);e&&(this._index.remove(e),this._idByBounds.delete(e))}this._boundsById.set(t,e),e&&(this._idByBounds.set(e,t),this._indexInvalid||(this._boundsToLoad.push(e),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},25216:(t,e,n)=>{n.d(e,{W:()=>l});var r=n(41948),i=n(1580),o=(n(9456),n(66360),n(72052),n(12552)),s=n(24676);const a={read:{reader:s.gH},write:{allowNull:!0,writer:s.GA}},l=t=>{let e=class extends t{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return(0,r._)([(0,i.qq)({type:["average","color-burn","color-dodge","color","darken","destination-atop","destination-in","destination-out","destination-over","difference","exclusion","hard-light","hue","invert","lighten","lighter","luminosity","minus","multiply","normal","overlay","plus","reflect","saturation","screen","soft-light","source-atop","source-in","source-out","vivid-light","xor"],nonNullable:!0,json:{read:!1,write:!1,origins:{"web-map":{read:!0,write:!0},"portal-item":{read:!0,write:!0}}}})],e.prototype,"blendMode",void 0),(0,r._)([(0,i.qq)({json:{read:!1,write:!1,origins:{"web-map":a,"portal-item":a}}})],e.prototype,"effect",void 0),e=(0,r._)([(0,o.c)("esri.layers.mixins.BlendLayer")],e),e}},98768:(t,e,n)=>{n.d(e,{K:()=>b});var r=n(41948),i=n(6220),o=n(47620),s=n(2600),a=n(40196),l=n(20744),c=n(66360),u=n(70680),h=n(10860),p=n(28176),d=n(1580),f=(n(9456),n(72052),n(33600)),m=n(12552),y=n(18996),g=n(71068),_=n(54872),x=n(9764),v=n(53039),w=n(46940);const b=t=>{let e=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,u.mG)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(t){t!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",t))}readPortalItem(t,e,n){if(e.itemId)return new x.default({id:e.itemId,portal:n?.portal})}writePortalItem(t,e){t?.id&&(e.itemId=t.id)}async loadFromPortal(t,e){if(this.portalItem?.id)try{const{load:r}=await Promise.all([n.e(8828),n.e(4132)]).then(n.bind(n,94132));return(0,h.wp)(e),await r({instance:this,supportedTypes:t.supportedTypes,validateItem:t.validateItem,supportsData:t.supportsData,layerModuleTypeMap:t.layerModuleTypeMap},e)}catch(t){throw(0,h.mA)(t)||c.c.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${t}`),t}}async finishLoadEditablePortalLayer(t){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(t).catch((t=>((0,h.CE)(t),!0))))}async setUserPrivileges(t,e){if(!i.default.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(e);if(this.url)try{const{features:{edit:n,fullEdit:r},content:{updateItem:i}}=await this._fetchUserPrivileges(t,e);this._set("userHasEditingPrivileges",n),this._set("userHasFullEditingPrivileges",r),this._set("userHasUpdateItemPrivileges",i)}catch(t){(0,h.CE)(t)}}async _fetchUserPrivileges(t,e){let n=this.portalItem;if(!t||!n||!n.loaded||n.sourceUrl)return this._fetchFallbackUserPrivileges(e);const r=t===n.id;if(r&&n.portal.user)return(0,w.CI)(n);let i,s;if(r)i=n.portal.url;else try{i=await(0,g.mK)(this.url,e)}catch(t){(0,h.CE)(t)}if(!i||!(0,p.Cs)(i,n.portal.url))return this._fetchFallbackUserPrivileges(e);try{const t=null!=e?e.signal:null;s=await(o.id?.getCredential(`${i}/sharing`,{prompt:!1,signal:t}))}catch(t){(0,h.CE)(t)}if(!s)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(r?await n.reload():(n=new x.default({id:t,portal:{url:i}}),await n.load(e)),n.portal.user)return(0,w.CI)(n)}catch(t){(0,h.CE)(t)}return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}}}async _fetchFallbackUserPrivileges(t){let e=!0;try{e=await this._fetchUserHasEditingPrivileges(t)}catch(t){(0,h.CE)(t)}return{features:{edit:e,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(t){const e=this.url?o.id?.findCredential(this.url):null;if(!e)return!0;const n=M.credential===e?M.user:await this._fetchEditingUser(t);return M.credential=e,M.user=n,null==n?.privileges||n.privileges.includes("features:user:edit")}async _fetchEditingUser(t){const e=this.portalItem?.portal?.user;if(e)return e;const n=o.id.findServerInfo(this.url??"");if(!n?.owningSystemUrl)return null;const r=`${n.owningSystemUrl}/sharing/rest`,i=_.c.getDefault();if(i&&i.loaded&&(0,p.k7)(i.restUrl)===(0,p.k7)(r))return i.user;const l=`${r}/community/self`,c=null!=t?t.signal:null,u=await(0,a.aG)((0,s.c)(l,{authMode:"no-prompt",query:{f:"json"},signal:c}));return u.ok?v.c.fromJSON(u.value.data):null}read(t,e){e&&(e.layer=this),super.read(t,e)}write(t,e){const n=e?.portal,r=this.portalItem?.id&&(this.portalItem.portal||_.c.getDefault());return n&&r&&!(0,p.kF)(r.restUrl,n.restUrl)?(e.messages&&e.messages.push(new l.c("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(t,{...e,layer:this})}};return(0,r._)([(0,d.qq)({type:x.default})],e.prototype,"portalItem",null),(0,r._)([(0,f.E)("web-document","portalItem",["itemId"])],e.prototype,"readPortalItem",null),(0,r._)([(0,y.G)("web-document","portalItem",{itemId:{type:String}})],e.prototype,"writePortalItem",null),(0,r._)([(0,d.qq)({clonable:!1})],e.prototype,"resourceReferences",void 0),(0,r._)([(0,d.qq)({type:Boolean,readOnly:!0})],e.prototype,"userHasEditingPrivileges",void 0),(0,r._)([(0,d.qq)({type:Boolean,readOnly:!0})],e.prototype,"userHasFullEditingPrivileges",void 0),(0,r._)([(0,d.qq)({type:Boolean,readOnly:!0})],e.prototype,"userHasUpdateItemPrivileges",void 0),e=(0,r._)([(0,m.c)("esri.layers.mixins.PortalLayer")],e),e},M={credential:null,user:null}},3116:(t,e,n)=>{n.d(e,{I:()=>s});var r=n(41948),i=n(1580),o=(n(9456),n(66360),n(72052),n(12552));const s=t=>{let e=class extends t{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const t={minScale:this.minScale,maxScale:this.maxScale},e=this.parent;e&&"effectiveScaleRange"in e&&function(t,e){t.minScale=t.minScale>0?e.minScale>0?Math.min(t.minScale,e.minScale):t.minScale:e.minScale,t.maxScale=t.maxScale>0?e.maxScale>0?Math.max(t.maxScale,e.maxScale):t.maxScale:e.maxScale}(t,e.effectiveScaleRange);const n=this._get("effectiveScaleRange");return n&&n.minScale===t.minScale&&n.maxScale===t.maxScale?n:t}};return(0,r._)([(0,i.qq)({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"minScale",void 0),(0,r._)([(0,i.qq)({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"maxScale",void 0),(0,r._)([(0,i.qq)({readOnly:!0})],e.prototype,"effectiveScaleRange",null),e=(0,r._)([(0,o.c)("esri.layers.mixins.ScaleRangeLayer")],e),e}},73960:(t,e,n)=>{n.d(e,{e:()=>i});var r=n(28176);function i(t){return o[function(t){return"json"===t.type?"application/json":"blob"===t.type?t.blob.type:function(t){const e=(0,r.wt)(t);return l[e]||s}(t.url)}(t)]||a}const o={},s="text/plain",a=o[s],l={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const t in l)o[l[t]]=t},8616:(t,e,n)=>{var r;n.d(e,{U:()=>r}),function(t){t[t.SAVE=0]="SAVE",t[t.SAVE_AS=1]="SAVE_AS"}(r||(r={}))}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9232],{69232:(e,a,r)=>{r.r(a),r.d(a,{fromUrl:()=>d});var t=r(20744),n=r(28176),l=r(48212),s=r(50420),i=r(13608),o=r(71068),c=r(83928),u=r(66668);const y={FeatureLayer:!0,SceneLayer:!0};async function d(e){const a=e.properties?.customParameters,c=await async function(e,a){let r=(0,l.K0)(e);if(null==r&&(r=await async function(e,a){const r=await(0,u.S)(e,{customParameters:a});let t=null,s=null;const i=r.type;if("Feature Layer"===i||"Table"===i?(t="FeatureServer",s=r.id??null):"indexedVector"===i?t="VectorTileServer":r.hasOwnProperty("mapName")?t="MapServer":r.hasOwnProperty("bandCount")&&r.hasOwnProperty("pixelSizeX")?t="ImageServer":r.hasOwnProperty("maxRecordCount")&&r.hasOwnProperty("allowGeometryUpdates")?t="FeatureServer":r.hasOwnProperty("streamUrls")?t="StreamServer":m(r)?(t="SceneServer",s=r.id):r.hasOwnProperty("layers")&&m(r.layers?.[0])&&(t="SceneServer"),!t)return null;const o=null!=s?(0,l.Ej)(e):null;return{title:null!=o&&r.name||(0,n.u8)(e),serverType:t,sublayer:s,url:{path:null!=o?o.serviceUrl:(0,n.as)(e).path}}}(e,a)),null==r)throw new t.c("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:e});const{serverType:c,sublayer:d}=r;let f;const h={FeatureServer:"FeatureLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer"},p="FeatureServer"===c,S="SceneServer"===c,b={parsedUrl:r,Constructor:null,layerId:p||S?d??void 0:void 0,layers:[],tables:[]};switch(c){case"MapServer":f=null!=d?"FeatureLayer":await async function(e,a){return(await(0,u.S)(e,{customParameters:a})).tileInfo}(e,a)?"TileLayer":"MapImageLayer";break;case"ImageServer":{const r=await(0,u.S)(e,{customParameters:a}),{tileInfo:t,cacheType:n}=r;f=t?"LERC"!==t?.format?.toUpperCase()||n&&"elevation"!==n.toLowerCase()?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const e=await(0,u.S)(r.url.path,{customParameters:a});if(f="SceneLayer",e){const a=e?.layers;if("Voxel"===e?.layerType)f="VoxelLayer";else if(a?.length){const e=a[0]?.layerType;null!=e&&null!=o.Wr[e]&&(f=o.Wr[e])}}break}case"3DTilesServer":f="IntegratedMesh3DTilesLayer";break;case"FeatureServer":if(f="FeatureLayer",null!=d){const r=await(0,u.S)(e,{customParameters:a});b.sourceJSON=r,"Oriented Imagery Layer"===r.type&&(f="OrientedImageryLayer")}break;default:f=h[c]}if(y[f]&&null==d){const r=await async function(e,a,r){let t,n,l=!1;switch(a){case"FeatureServer":{const a=await(0,i.I)(e,{customParameters:r});l=!!a.layersJSON,t=a.layersJSON||a.serviceJSON;break}case"SceneServer":{const a=await async function(e,a){const r=await(0,u.S)(e,{customParameters:a}),t=r.layers?.[0];if(!t)return{serviceInfo:r};try{const{serverUrl:t}=await(0,s.S)(e),n=await(0,u.S)(t,{customParameters:a}).catch((()=>null));return n&&(r.tables=n.tables),{serviceInfo:r,tableServerUrl:t}}catch{return{serviceInfo:r}}}(e,r);t=a.serviceInfo,n=a.tableServerUrl;break}default:t=await(0,u.S)(e,{customParameters:r})}const o=t?.layers,c=t?.tables;return{layers:o?.map((e=>({id:e.id}))).reverse()||[],tables:c?.map((e=>({serverUrl:n,id:e.id}))).reverse()||[],layerInfos:l?o:[],tableInfos:l?c:[]}}(e,c,a);if(p&&(b.sublayerInfos=r.layerInfos,b.tableInfos=r.tableInfos),1!==r.layers.length+r.tables.length)b.layers=r.layers,b.tables=r.tables,p&&r.layerInfos?.length&&(b.sublayerConstructorProvider=await async function(e){const a=[],r=[];if(e.forEach((e=>{const{type:t}=e;"Oriented Imagery Layer"===t?(a.push(t),r.push(w("OrientedImageryLayer"))):(a.push(t),r.push(w("FeatureLayer")))})),!r.length)return;const t=await Promise.all(r),n=new Map;return a.forEach(((e,a)=>{n.set(e,t[a])})),e=>n.get(e.type)}(r.layerInfos));else if(p||S){const e=r.layerInfos?.[0]??r.tableInfos?.[0];b.layerId=r.layers[0]?.id??r.tables[0]?.id,b.sourceJSON=e,p&&"Oriented Imagery Layer"===e?.type&&(f="OrientedImageryLayer")}}return b.Constructor=await w(f),b}(e.url,a),d={...e.properties,url:e.url};if(c.layers.length+c.tables.length===0)return null!=c.layerId&&(d.layerId=c.layerId),null!=c.sourceJSON&&(d.sourceJSON=c.sourceJSON),new c.Constructor(d);const h=new(0,(await Promise.all([r.e(5612),r.e(5076)]).then(r.bind(r,44080))).default)({title:c.parsedUrl.title});return await async function(e,a,r){function t(e,a,t,n){const l={...r,layerId:a,sublayerTitleMode:"service-name"};return null!=e&&(l.url=e),null!=t&&(l.sourceJSON=t),n(l)}const n=a.sublayerConstructorProvider;for(const{id:r,serverUrl:l}of a.layers){const s=f(a.sublayerInfos,r),i=(s&&n?.(s))??a.Constructor,o=t(l,r,s,(e=>new i(e)));e.add(o)}if(a.tables.length){const r=await w("FeatureLayer");a.tables.forEach((({id:n,serverUrl:l})=>{const s=t(l,n,f(a.tableInfos,n),(e=>new r(e)));e.tables.add(s)}))}}(h,c,d),h}function f(e,a){return e?e.find((e=>e.id===a)):null}function m(e){return null!=e&&e.hasOwnProperty("store")&&e.hasOwnProperty("id")&&"number"==typeof e.id}async function w(e){return(0,c.q[e])()}},50420:(e,a,r)=>{r.d(a,{S:()=>u});var t=r(47620),n=r(2600),l=r(20744),s=r(10860),i=r(48212),o=r(54872),c=r(9764);async function u(e,a){const r=(0,i.K0)(e);if(!r)throw new l.c("invalid-url","Invalid scene service url");const u={...a,sceneServerUrl:r.url.path,layerId:r.sublayer??void 0};if(u.sceneLayerItem??=await async function(e){const a=(await y(e)).serviceItemId;if(!a)return null;const r=new c.default({id:a,apiKey:e.apiKey}),l=await async function(e){const a=t.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const r=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,n.c)(r,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,s.CE)(e)}return null}(e);null!=l&&(r.portal=new o.c({url:l}));try{return r.load({signal:e.signal})}catch(e){return(0,s.CE)(e),null}}(u),null==u.sceneLayerItem)return d(u.sceneServerUrl.replace("/SceneServer","/FeatureServer"),u);const f=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const r=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find((e=>"Feature Service"===e.type))||null;if(!r)return null;const t=new c.default({portal:r.portal,id:r.id});return await t.load(),t}catch(e){return(0,s.CE)(e),null}}(u);if(!f?.url)throw new l.c("related-service-not-found","Could not find feature service through portal item relationship");u.featureServiceItem=f;const m=await d(f.url,u);return m.portalItem=f,m}async function y(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const r=await(0,n.c)(e.sceneServerUrl,a);e.rootDocument=r.data}catch{e.rootDocument={}}return e.rootDocument}async function d(e,a){const r=(0,i.K0)(e);if(!r)throw new l.c("invalid-feature-service-url","Invalid feature service url");const t=r.url.path,s=a.layerId;if(null==s)return{serverUrl:t};const o=y(a),c=a.featureServiceItem?await a.featureServiceItem.fetchData("json"):null,u=(c?.layers?.[0]||c?.tables?.[0])?.customParameters,d=e=>{const r={query:{f:"json",...u},responseType:"json",authMode:e,signal:a.signal};return(0,n.c)(t,r)},f=d("anonymous").catch((()=>d("no-prompt"))),[m,w]=await Promise.all([f,o]),h=w?.layers,p=m.data&&m.data.layers;if(!Array.isArray(p))throw new Error("expected layers array");if(Array.isArray(h)){for(let e=0;e<Math.min(h.length,p.length);e++)if(h[e].id===s)return{serverUrl:t,layerId:p[e].id}}else if(null!=s&&s<p.length)return{serverUrl:t,layerId:p[s].id};throw new Error("could not find matching associated sublayer")}},13608:(e,a,r)=>{r.d(a,{I:()=>n});var t=r(66668);async function n(e,a){const{loadContext:r,...n}=a||{},l=r?await r.fetchServiceMetadata(e,n):await(0,t.S)(e,n);u(l),i(l);const s={serviceJSON:l};if((l.currentVersion??0)<10.5)return s;const o=`${e}/layers`,c=r?await r.fetchServiceMetadata(o,n):await(0,t.S)(o,n);return u(c),i(c),s.layersJSON={layers:c.layers,tables:c.tables},s}function l(e){return"Feature Layer"===e.type||"Oriented Imagery Layer"===e.type}function s(e){return"Table"===e.type}function i(e){e.layers=e.layers?.filter(l),e.tables=e.tables?.filter(s)}function o(e){e.type||="Feature Layer"}function c(e){e.type||="Table"}function u(e){e.layers?.forEach(o),e.tables?.forEach(c)}},83928:(e,a,r)=>{r.d(a,{q:()=>t});const t={BingMapsLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3912)]).then(r.bind(r,48388))).default,BuildingSceneLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(8980),r.e(5472),r.e(5864),r.e(1744),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(3180),r.e(9644),r.e(8344),r.e(9420),r.e(7064),r.e(5928)]).then(r.bind(r,10948))).default,CatalogLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(8980),r.e(5472),r.e(5864),r.e(1744),r.e(5776),r.e(236),r.e(8976),r.e(2664),r.e(2848),r.e(5468),r.e(572),r.e(8772)]).then(r.bind(r,20324))).default,CSVLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(8980),r.e(5472),r.e(5864),r.e(1744),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(2292)]).then(r.bind(r,79468))).default,DimensionLayer:async()=>(await Promise.all([r.e(5612),r.e(7832)]).then(r.bind(r,28320))).default,ElevationLayer:async()=>(await Promise.all([r.e(5612),r.e(2968),r.e(8380)]).then(r.bind(r,47104))).default,FeatureLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(8980),r.e(5472),r.e(5864),r.e(1744),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(3645)]).then(r.bind(r,672))).default,GeoJSONLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(8980),r.e(5472),r.e(5864),r.e(1744),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(6584)]).then(r.bind(r,92768))).default,GeoRSSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(7988),r.e(5472),r.e(8404)]).then(r.bind(r,43984))).default,GroupLayer:async()=>(await Promise.all([r.e(5612),r.e(7456)]).then(r.bind(r,44080))).default,ImageryLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(8980),r.e(5472),r.e(5864),r.e(1744),r.e(5776),r.e(2848),r.e(6128),r.e(9884),r.e(2124)]).then(r.bind(r,7896))).default,ImageryTileLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(8980),r.e(5472),r.e(5864),r.e(1744),r.e(6128),r.e(9884),r.e(7048),r.e(5496)]).then(r.bind(r,82744))).default,IntegratedMeshLayer:async()=>(await Promise.all([r.e(5612),r.e(9644),r.e(7024)]).then(r.bind(r,96584))).default,KMLLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(8980),r.e(5472),r.e(5864),r.e(1744),r.e(236),r.e(1312)]).then(r.bind(r,53688))).default,LineOfSightLayer:async()=>(await Promise.all([r.e(5612),r.e(3536)]).then(r.bind(r,91884))).default,LinkChartLayer:async()=>(await Promise.all([r.e(5156),r.e(2692),r.e(7988),r.e(8980),r.e(5472),r.e(5864),r.e(1744),r.e(5776),r.e(236),r.e(9512),r.e(3220),r.e(1512),r.e(6680),r.e(8080)]).then(r.bind(r,54192))).default,MapImageLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(8980),r.e(5472),r.e(5864),r.e(1744),r.e(5776),r.e(236),r.e(8976),r.e(2848),r.e(5468),r.e(7804),r.e(3089)]).then(r.bind(r,3089))).default,MapNotesLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(8980),r.e(5472),r.e(5864),r.e(1744),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(8528)]).then(r.bind(r,37784))).default,MediaLayer:async()=>(await Promise.all([r.e(5612),r.e(2364)]).then(r.bind(r,66664))).default,OGCFeatureLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(8980),r.e(5472),r.e(5864),r.e(1744),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(4384),r.e(8224)]).then(r.bind(r,56288))).default,OpenStreetMapLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3632),r.e(1244)]).then(r.bind(r,1244))).default,OrientedImageryLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(8980),r.e(5472),r.e(5864),r.e(1744),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(8640)]).then(r.bind(r,75432))).default,PointCloudLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(9644),r.e(2296)]).then(r.bind(r,21680))).default,RouteLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(7988),r.e(8980),r.e(5472),r.e(5864),r.e(1744),r.e(236),r.e(8520)]).then(r.bind(r,40900))).default,SceneLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(7988),r.e(8980),r.e(5472),r.e(5864),r.e(1744),r.e(5776),r.e(236),r.e(8976),r.e(3180),r.e(9644),r.e(9904),r.e(8344),r.e(9420),r.e(4716),r.e(7064),r.e(712)]).then(r.bind(r,3688))).default,StreamLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(8980),r.e(5472),r.e(5864),r.e(1744),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(1136)]).then(r.bind(r,18e3))).default,SubtypeGroupLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(8980),r.e(5472),r.e(5864),r.e(1744),r.e(5776),r.e(236),r.e(8976),r.e(2664),r.e(6556),r.e(5368),r.e(8792)]).then(r.bind(r,8444))).default,TileLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(8980),r.e(5472),r.e(5864),r.e(1744),r.e(5776),r.e(236),r.e(8976),r.e(2848),r.e(5468),r.e(2968),r.e(7804),r.e(0)]).then(r.bind(r,5e4))).default,IntegratedMesh3DTilesLayer:async()=>(await Promise.all([r.e(5612),r.e(7752)]).then(r.bind(r,71316))).default,UnknownLayer:async()=>(await r.e(4203).then(r.bind(r,56584))).default,UnsupportedLayer:async()=>(await r.e(2456).then(r.bind(r,12456))).default,VectorTileLayer:async()=>(await Promise.all([r.e(5612),r.e(8980),r.e(2968),r.e(1272),r.e(7936)]).then(r.bind(r,65632))).default,VoxelLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(9644),r.e(8256)]).then(r.bind(r,59496))).default,WFSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(8980),r.e(5472),r.e(5864),r.e(1744),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(4808),r.e(2612)]).then(r.bind(r,53440))).default,WMSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(5472),r.e(7052)]).then(r.bind(r,85024))).default,WMTSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3632),r.e(4832)]).then(r.bind(r,54832))).default,WebTileLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3632)]).then(r.bind(r,32896))).default}},66668:(e,a,r)=>{r.d(a,{S:()=>n});var t=r(2600);async function n(e,a){const{data:r}=await(0,t.c)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return r}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3180],{68612:(t,n,e)=>{function r(){return[1,0,0,0,1,0,0,0,1]}function o(t,n,e,r,o,a,u,s,c){return[t,n,e,r,o,a,u,s,c]}e.d(n,{IJ:()=>a,Su:()=>r,WK:()=>o});const a=[1,0,0,0,1,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:a,clone:function(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},create:r,createView:function(t,n){return new Float64Array(t,n,9)},fromValues:o},Symbol.toStringTag,{value:"Module"}))},87104:(t,n,e)=>{function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function o(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}e.d(n,{IJ:()=>a,Su:()=>r,ct:()=>o});const a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:a,clone:o,create:r,createView:function(t,n){return new Float64Array(t,n,16)},fromValues:function(t,n,e,r,o,a,u,s,c,i,l,f,M,h,E,I){return[t,n,e,r,o,a,u,s,c,i,l,f,M,h,E,I]}},Symbol.toStringTag,{value:"Module"}))},2620:(t,n,e)=>{function r(){return[0,0,0,1]}function o(t){return[t[0],t[1],t[2],t[3]]}e.d(n,{IJ:()=>a,Su:()=>r,ct:()=>o});const a=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:a,clone:o,create:r,createView:function(t,n){return new Float64Array(t,n,4)},fromValues:function(t,n,e,r){return[t,n,e,r]}},Symbol.toStringTag,{value:"Module"}))},85256:(t,n,e)=>{function r(){return[0,0]}function o(t,n){return[t,n]}function a(){return o(1,1)}function u(){return o(1,0)}function s(){return o(0,1)}e.d(n,{Su:()=>r,WK:()=>o});const c=a(),i=u(),l=s();Object.freeze(Object.defineProperty({__proto__:null,ONES:c,UNIT_X:i,UNIT_Y:l,ZEROS:[0,0],clone:function(t){return[t[0],t[1]]},create:r,createView:function(t,n){return new Float64Array(t,n,2)},fromArray:function(t,n=[0,0]){const e=Math.min(2,t.length);for(let r=0;r<e;++r)n[r]=t[r];return n},fromValues:o,ones:a,unitX:u,unitY:s,zeros:function(){return[0,0]}},Symbol.toStringTag,{value:"Module"}))},77556:(t,n,e)=>{e.d(n,{KU:()=>f,QT:()=>E,S_:()=>s,WO:()=>a,_7:()=>c,aU:()=>l,iW:()=>i,kr:()=>o,oL:()=>u,yy:()=>M});var r=e(47364);function o(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[4],t[4]=n[5],t[5]=n[6],t[6]=n[8],t[7]=n[9],t[8]=n[10],t}function a(t,n,e,r,o,a,u,s,c,i){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t[4]=a,t[5]=u,t[6]=s,t[7]=c,t[8]=i,t}function u(t,n){if(t===n){const e=n[1],r=n[2],o=n[5];t[1]=n[3],t[2]=n[6],t[3]=e,t[5]=n[7],t[6]=r,t[7]=o}else t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8];return t}function s(t,n){const e=n[0],r=n[1],o=n[2],a=n[3],u=n[4],s=n[5],c=n[6],i=n[7],l=n[8],f=l*u-s*i,M=-l*a+s*c,h=i*a-u*c;let E=e*f+r*M+o*h;return E?(E=1/E,t[0]=f*E,t[1]=(-l*r+o*i)*E,t[2]=(s*r-o*u)*E,t[3]=M*E,t[4]=(l*e-o*c)*E,t[5]=(-s*e+o*a)*E,t[6]=h*E,t[7]=(-i*e+r*c)*E,t[8]=(u*e-r*a)*E,t):null}function c(t,n){const e=n[0],r=n[1],o=n[2],a=n[3],u=n[4],s=n[5],c=n[6],i=n[7],l=n[8];return t[0]=u*l-s*i,t[1]=o*i-r*l,t[2]=r*s-o*u,t[3]=s*c-a*l,t[4]=e*l-o*c,t[5]=o*a-e*s,t[6]=a*i-u*c,t[7]=r*c-e*i,t[8]=e*u-r*a,t}function i(t,n,e){const r=n[0],o=n[1],a=n[2],u=n[3],s=n[4],c=n[5],i=n[6],l=n[7],f=n[8],M=e[0],h=e[1],E=e[2],I=e[3],S=e[4],O=e[5],T=e[6],A=e[7],N=e[8];return t[0]=M*r+h*u+E*i,t[1]=M*o+h*s+E*l,t[2]=M*a+h*c+E*f,t[3]=I*r+S*u+O*i,t[4]=I*o+S*s+O*l,t[5]=I*a+S*c+O*f,t[6]=T*r+A*u+N*i,t[7]=T*o+A*s+N*l,t[8]=T*a+A*c+N*f,t}function l(t,n,e){const r=e[0],o=e[1],a=e[2];return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=o*n[3],t[4]=o*n[4],t[5]=o*n[5],t[6]=a*n[6],t[7]=a*n[7],t[8]=a*n[8],t}function f(t,n){const e=n[0],r=n[1],o=n[2],a=n[3],u=e+e,s=r+r,c=o+o,i=e*u,l=r*u,f=r*s,M=o*u,h=o*s,E=o*c,I=a*u,S=a*s,O=a*c;return t[0]=1-f-E,t[3]=l-O,t[6]=M+S,t[1]=l+O,t[4]=1-i-E,t[7]=h-I,t[2]=M-S,t[5]=h+I,t[8]=1-i-f,t}function M(t,n){const e=n[0],r=n[1],o=n[2],a=n[3],u=n[4],s=n[5],c=n[6],i=n[7],l=n[8],f=n[9],M=n[10],h=n[11],E=n[12],I=n[13],S=n[14],O=n[15],T=e*s-r*u,A=e*c-o*u,N=e*i-a*u,m=r*c-o*s,R=r*i-a*s,b=o*i-a*c,d=l*I-f*E,_=l*S-M*E,C=l*O-h*E,L=f*S-M*I,P=f*O-h*I,p=M*O-h*S;let F=T*p-A*P+N*L+m*C-R*_+b*d;return F?(F=1/F,t[0]=(s*p-c*P+i*L)*F,t[1]=(c*C-u*p-i*_)*F,t[2]=(u*P-s*C+i*d)*F,t[3]=(o*P-r*p-a*L)*F,t[4]=(e*p-o*C+a*_)*F,t[5]=(r*C-e*P-a*d)*F,t[6]=(I*b-S*R+O*m)*F,t[7]=(S*N-E*b-O*A)*F,t[8]=(E*R-I*N+O*T)*F,t):null}function h(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t[4]=n[4]-e[4],t[5]=n[5]-e[5],t[6]=n[6]-e[6],t[7]=n[7]-e[7],t[8]=n[8]-e[8],t}function E(t){const n=(0,r.Au)(),e=t[0],o=t[1],a=t[2],u=t[3],s=t[4],c=t[5],i=t[6],l=t[7],f=t[8];return Math.abs(1-(e*e+u*u+i*i))<=n&&Math.abs(1-(o*o+s*s+l*l))<=n&&Math.abs(1-(a*a+c*c+f*f))<=n}const I=i,S=h;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t[4]=n[4]+e[4],t[5]=n[5]+e[5],t[6]=n[6]+e[6],t[7]=n[7]+e[7],t[8]=n[8]+e[8],t},adjoint:c,copy:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t},determinant:function(t){const n=t[0],e=t[1],r=t[2],o=t[3],a=t[4],u=t[5],s=t[6],c=t[7],i=t[8];return n*(i*a-u*c)+e*(-i*o+u*s)+r*(c*o-a*s)},equals:function(t,n){const e=t[0],o=t[1],a=t[2],u=t[3],s=t[4],c=t[5],i=t[6],l=t[7],f=t[8],M=n[0],h=n[1],E=n[2],I=n[3],S=n[4],O=n[5],T=n[6],A=n[7],N=n[8],m=(0,r.Au)();return Math.abs(e-M)<=m*Math.max(1,Math.abs(e),Math.abs(M))&&Math.abs(o-h)<=m*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(a-E)<=m*Math.max(1,Math.abs(a),Math.abs(E))&&Math.abs(u-I)<=m*Math.max(1,Math.abs(u),Math.abs(I))&&Math.abs(s-S)<=m*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(c-O)<=m*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(i-T)<=m*Math.max(1,Math.abs(i),Math.abs(T))&&Math.abs(l-A)<=m*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(f-N)<=m*Math.max(1,Math.abs(f),Math.abs(N))},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]},frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2)},fromMat2d:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=0,t[3]=n[2],t[4]=n[3],t[5]=0,t[6]=n[4],t[7]=n[5],t[8]=1,t},fromMat4:o,fromQuat:f,fromRotation:function(t,n){const e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=0,t[3]=-e,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromScaling:function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=n[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromTranslation:function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=n[0],t[7]=n[1],t[8]=1,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},invert:s,isOrthoNormal:E,mul:I,multiply:i,multiplyScalar:function(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t[4]=n[4]*e,t[5]=n[5]*e,t[6]=n[6]*e,t[7]=n[7]*e,t[8]=n[8]*e,t},multiplyScalarAndAdd:function(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t[4]=n[4]+e[4]*r,t[5]=n[5]+e[5]*r,t[6]=n[6]+e[6]*r,t[7]=n[7]+e[7]*r,t[8]=n[8]+e[8]*r,t},normalFromMat4:M,normalFromMat4Legacy:function(t,n){const e=n[0],r=n[1],o=n[2],a=n[4],u=n[5],s=n[6],c=n[8],i=n[9],l=n[10],f=l*u-s*i,M=-l*a+s*c,h=i*a-u*c,E=e*f+r*M+o*h;if(!E)return null;const I=1/E;return t[0]=f*I,t[1]=(-l*r+o*i)*I,t[2]=(s*r-o*u)*I,t[3]=M*I,t[4]=(l*e-o*c)*I,t[5]=(-s*e+o*a)*I,t[6]=h*I,t[7]=(-i*e+r*c)*I,t[8]=(u*e-r*a)*I,t},projection:function(t,n,e){return t[0]=2/n,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/e,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},rotate:function(t,n,e){const r=n[0],o=n[1],a=n[2],u=n[3],s=n[4],c=n[5],i=n[6],l=n[7],f=n[8],M=Math.sin(e),h=Math.cos(e);return t[0]=h*r+M*u,t[1]=h*o+M*s,t[2]=h*a+M*c,t[3]=h*u-M*r,t[4]=h*s-M*o,t[5]=h*c-M*a,t[6]=i,t[7]=l,t[8]=f,t},scale:l,scaleByVec2:function(t,n,e){const r=e[0],o=e[1];return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=o*n[3],t[4]=o*n[4],t[5]=o*n[5],t},set:a,str:function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},sub:S,subtract:h,translate:function(t,n,e){const r=n[0],o=n[1],a=n[2],u=n[3],s=n[4],c=n[5],i=n[6],l=n[7],f=n[8],M=e[0],h=e[1];return t[0]=r,t[1]=o,t[2]=a,t[3]=u,t[4]=s,t[5]=c,t[6]=M*r+h*u+i,t[7]=M*o+h*s+l,t[8]=M*a+h*c+f,t},transpose:u},Symbol.toStringTag,{value:"Module"}))},41512:(t,n,e)=>{e.d(n,{C0:()=>l,WO:()=>O,Wu:()=>I,fO:()=>h,iW:()=>f,sF:()=>P,yG:()=>i});var r=e(68612),o=e(2620),a=e(62484),u=e(47364),s=e(98472),c=e(74784);function i(t,n,e){e*=.5;const r=Math.sin(e);return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=Math.cos(e),t}function l(t,n){const e=2*Math.acos(n[3]),r=Math.sin(e/2);return r>(0,u.Au)()?(t[0]=n[0]/r,t[1]=n[1]/r,t[2]=n[2]/r):(t[0]=1,t[1]=0,t[2]=0),e}function f(t,n,e){const r=n[0],o=n[1],a=n[2],u=n[3],s=e[0],c=e[1],i=e[2],l=e[3];return t[0]=r*l+u*s+o*i-a*c,t[1]=o*l+u*c+a*s-r*i,t[2]=a*l+u*i+r*c-o*s,t[3]=u*l-r*s-o*c-a*i,t}function M(t,n,e,r){const o=n[0],a=n[1],s=n[2],c=n[3];let i,l,f,M,h,E=e[0],I=e[1],S=e[2],O=e[3];return l=o*E+a*I+s*S+c*O,l<0&&(l=-l,E=-E,I=-I,S=-S,O=-O),1-l>(0,u.Au)()?(i=Math.acos(l),f=Math.sin(i),M=Math.sin((1-r)*i)/f,h=Math.sin(r*i)/f):(M=1-r,h=r),t[0]=M*o+h*E,t[1]=M*a+h*I,t[2]=M*s+h*S,t[3]=M*c+h*O,t}function h(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function E(t,n){const e=n[0]+n[4]+n[8];let r;if(e>0)r=Math.sqrt(e+1),t[3]=.5*r,r=.5/r,t[0]=(n[5]-n[7])*r,t[1]=(n[6]-n[2])*r,t[2]=(n[1]-n[3])*r;else{let e=0;n[4]>n[0]&&(e=1),n[8]>n[3*e+e]&&(e=2);const o=(e+1)%3,a=(e+2)%3;r=Math.sqrt(n[3*e+e]-n[3*o+o]-n[3*a+a]+1),t[e]=.5*r,r=.5/r,t[3]=(n[3*o+a]-n[3*a+o])*r,t[o]=(n[3*o+e]+n[3*e+o])*r,t[a]=(n[3*a+e]+n[3*e+a])*r}return t}function I(t,n,e,r){const o=.5*Math.PI/180;n*=o,e*=o,r*=o;const a=Math.sin(n),u=Math.cos(n),s=Math.sin(e),c=Math.cos(e),i=Math.sin(r),l=Math.cos(r);return t[0]=a*c*l-u*s*i,t[1]=u*s*l+a*c*i,t[2]=u*c*i-a*s*l,t[3]=u*c*l+a*s*i,t}const S=c.c,O=c.s,T=c.g,A=f,N=c.d,m=c.h,R=c.l,b=c.i,d=b,_=c.j,C=_,L=c.n,P=c.a,p=c.e,F=(0,a.Su)(),y=(0,a.WK)(1,0,0),g=(0,a.WK)(0,1,0),w=(0,o.Su)(),D=(0,o.Su)(),U=(0,r.Su)();Object.freeze(Object.defineProperty({__proto__:null,add:T,calculateW:function(t,n){const e=n[0],r=n[1],o=n[2];return t[0]=e,t[1]=r,t[2]=o,t[3]=Math.sqrt(Math.abs(1-e*e-r*r-o*o)),t},conjugate:h,copy:S,dot:m,equals:p,exactEquals:P,fromEuler:I,fromMat3:E,getAxisAngle:l,identity:function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},invert:function(t,n){const e=n[0],r=n[1],o=n[2],a=n[3],u=e*e+r*r+o*o+a*a,s=u?1/u:0;return t[0]=-e*s,t[1]=-r*s,t[2]=-o*s,t[3]=a*s,t},len:d,length:b,lerp:R,mul:A,multiply:f,normalize:L,random:function(t){const n=u.QR,e=n(),r=n(),o=n(),a=Math.sqrt(1-e),s=Math.sqrt(e);return t[0]=a*Math.sin(2*Math.PI*r),t[1]=a*Math.cos(2*Math.PI*r),t[2]=s*Math.sin(2*Math.PI*o),t[3]=s*Math.cos(2*Math.PI*o),t},rotateX:function(t,n,e){e*=.5;const r=n[0],o=n[1],a=n[2],u=n[3],s=Math.sin(e),c=Math.cos(e);return t[0]=r*c+u*s,t[1]=o*c+a*s,t[2]=a*c-o*s,t[3]=u*c-r*s,t},rotateY:function(t,n,e){e*=.5;const r=n[0],o=n[1],a=n[2],u=n[3],s=Math.sin(e),c=Math.cos(e);return t[0]=r*c-a*s,t[1]=o*c+u*s,t[2]=a*c+r*s,t[3]=u*c-o*s,t},rotateZ:function(t,n,e){e*=.5;const r=n[0],o=n[1],a=n[2],u=n[3],s=Math.sin(e),c=Math.cos(e);return t[0]=r*c+o*s,t[1]=o*c-r*s,t[2]=a*c+u*s,t[3]=u*c-a*s,t},rotationTo:function(t,n,e){const r=(0,s.j)(n,e);return r<-.999999?((0,s.b)(F,y,n),(0,s.C)(F)<1e-6&&(0,s.b)(F,g,n),(0,s.n)(F,F),i(t,F,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):((0,s.b)(F,n,e),t[0]=F[0],t[1]=F[1],t[2]=F[2],t[3]=1+r,L(t,t))},scale:N,set:O,setAxes:function(t,n,e,r){const o=U;return o[0]=e[0],o[3]=e[1],o[6]=e[2],o[1]=r[0],o[4]=r[1],o[7]=r[2],o[2]=-n[0],o[5]=-n[1],o[8]=-n[2],L(t,E(t,o))},setAxisAngle:i,slerp:M,sqlerp:function(t,n,e,r,o,a){return M(w,n,o,a),M(D,e,r,a),M(t,w,D,2*a*(1-a)),t},sqrLen:C,squaredLength:_,str:function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}},Symbol.toStringTag,{value:"Module"}))},51120:(t,n,e)=>{e.d(n,{y:()=>i});var r=e(53648),o=e(15008),a=e(62484);function u(t,n,e){const r=Math.sin(t),o=Math.cos(t),a=Math.sin(n),u=Math.cos(n),s=e;return s[0]=-r,s[4]=-a*o,s[8]=u*o,s[12]=0,s[1]=o,s[5]=-a*r,s[9]=u*r,s[13]=0,s[2]=0,s[6]=u,s[10]=a,s[14]=0,s[3]=0,s[7]=0,s[11]=0,s[15]=1,s}var s=e(38380),c=e(60544);function i(t,n,e,r){if(null==t||null==r)return!1;const a=(0,s.Se)(t,s.Wy),i=(0,s.Se)(r,s.mq);if(a===i&&!l(i)&&(a!==s.o3.UNKNOWN||(0,c.yK)(t,r)))return(0,o.mu)(e,n),!0;if(l(i)){const t=s.yw[a][s.o3.LON_LAT],r=s.yw[s.o3.LON_LAT][i];return null!=t&&null!=r&&(t(n,0,M,0),r(M,0,h,0),u(f*M[0],f*M[1],e),e[12]=h[0],e[13]=h[1],e[14]=h[2],!0)}if((i===s.o3.WEB_MERCATOR||i===s.o3.PLATE_CARREE||i===s.o3.WGS84)&&(a===s.o3.WGS84||a===s.o3.CGCS2000&&i===s.o3.PLATE_CARREE||a===s.o3.SPHERICAL_ECEF||a===s.o3.WEB_MERCATOR)){const t=s.yw[a][s.o3.LON_LAT],r=s.yw[s.o3.LON_LAT][i];return null!=t&&null!=r&&(t(n,0,M,0),r(M,0,h,0),a===s.o3.SPHERICAL_ECEF?function(t,n,e){u(t,n,e),(0,o.oL)(e,e)}(f*M[0],f*M[1],e):(0,o.ZX)(e),e[12]=h[0],e[13]=h[1],e[14]=h[2],!0)}return!1}function l(t){return t===s.o3.SPHERICAL_ECEF||t===s.o3.SPHERICAL_MARS_PCPF||t===s.o3.SPHERICAL_MOON_PCPF}const f=(0,r.EF)(1),M=(0,a.Su)(),h=(0,a.Su)()},82448:(t,n,e)=>{e.d(n,{_s:()=>i});var r=e(22080),o=e(56156),a=e(60544);const u=new o.c(r._),s=new o.c(r.IP),c=new o.c(r.Om);function i(t){const n=l.get(t);if(n)return n;let e=u;if(t)if(t===s)e=s;else if(t===c)e=c;else{const n=t.wkid,r=t.latestWkid;if(null!=n||null!=r)(0,a.cJ)(n)||(0,a.cJ)(r)?e=s:((0,a.C_)(n)||(0,a.C_)(r))&&(e=c);else{const n=t.wkt2??t.wkt;if(n){const t=n.toUpperCase();t===f?e=s:t===M&&(e=c)}}}return l.set(t,e),e}new o.c(r.MJ);const l=new Map,f=s.wkt.toUpperCase(),M=c.wkt.toUpperCase()},58632:(t,n,e)=>{e.d(n,{Su:()=>a,XX:()=>s,Oq:()=>u}),e(53648);var r=e(98472),o=e(62484);function a(t=E){return[t[0],t[1],t[2],t[3]]}function u(t){return t}function s(t,n,e,o=0,u=Math.floor(e*(1/3)),E=Math.floor(e*(2/3))){if(e<3)return!1;n(i,o);let I=u,S=!1;for(;I<e-1&&!S;)n(l,I),I++,S=!(0,r.h)(i,l);if(!S)return!1;for(I=Math.max(I,E),S=!1;I<e&&!S;)n(f,I),I++,(0,r.f)(M,i,l),(0,r.n)(M,M),(0,r.f)(h,l,f),(0,r.n)(h,h),S=!(0,r.h)(i,f)&&!(0,r.h)(l,f)&&Math.abs((0,r.j)(M,h))<c;return S?(function(t,n,e,r=a()){const o=e[0]-n[0],u=e[1]-n[1],s=e[2]-n[2],c=t[0]-n[0],i=t[1]-n[1],l=t[2]-n[2],f=u*l-s*i,M=s*c-o*l,h=o*i-u*c,E=f*f+M*M+h*h,I=Math.abs(E-1)>1e-5&&E>1e-12?1/Math.sqrt(E):1;r[0]=f*I,r[1]=M*I,r[2]=h*I,r[3]=-(r[0]*t[0]+r[1]*t[1]+r[2]*t[2])}(i,l,f,t),!0):(0!==o||1!==u||2!==E)&&s(t,n,e,0,1,2)}e(74784),e(48880),e(20136),(0,o.Su)(),(0,o.Su)(),(0,o.Su)(),(0,o.Su)(),(0,o.Su)();const c=.99619469809,i=(0,o.Su)(),l=(0,o.Su)(),f=(0,o.Su)(),M=(0,o.Su)(),h=(0,o.Su)(),E=[0,0,1,0];var I,S;(S=I||(I={}))[S.NONE=0]="NONE",S[S.CLAMP=1]="CLAMP",S[S.INFINITE_MIN=4]="INFINITE_MIN",S[S.INFINITE_MAX=8]="INFINITE_MAX",I.INFINITE_MIN,I.INFINITE_MAX,I.INFINITE_MAX},48880:(t,n,e)=>{e.d(n,{i4:()=>u});var r=e(53648),o=e(98472),a=e(62484);function u(t,n){const e=(0,o.j)(t,n)/((0,o.l)(t)*(0,o.l)(n));return-(0,r.Uj)(e)}(0,a.Su)(),(0,a.Su)()},20136:(t,n,e)=>{e.d(n,{SW:()=>M,QX:()=>h,Wq:()=>f});var r=e(52324),o=e(68612),a=e(87104),u=e(2620),s=e(85256),c=e(62484),i=e(37008);class l{constructor(t){this._create=t,this._items=new Array,this._itemsPtr=0}get(){return 0===this._itemsPtr&&(0,r.o)((()=>this._reset())),this._itemsPtr>=this._items.length&&this._items.push(this._create()),this._items[this._itemsPtr++]}_reset(){const t=2*this._itemsPtr;this._items.length>t&&(this._items.length=t),this._itemsPtr=0}static createVec2f64(){return new l(s.Su)}static createVec3f64(){return new l(c.Su)}static createVec4f64(){return new l(i.Su)}static createMat3f64(){return new l(o.Su)}static createMat4f64(){return new l(a.Su)}static createQuatf64(){return new l(u.Su)}get test(){return{length:this._items.length}}}l.createVec2f64();const f=l.createVec3f64(),M=(l.createVec4f64(),l.createMat3f64(),l.createMat4f64()),h=l.createQuatf64()},89560:(t,n,e)=>{e.d(n,{O:()=>o,Y:()=>r});class r{constructor(t,n,e=n){this.data=t,this.size=n,this.stride=e}}class o extends r{constructor(t,n,e,r=!1,o=e){super(t,e,o),this.indices=n,this.exclusive=r}}},4636:(t,n,e)=>{var r;e.d(n,{K:()=>r}),function(t){t.POSITION="position",t.NORMAL="normal",t.NORMALCOMPRESSED="normalCompressed",t.UV0="uv0",t.COLOR="color",t.SYMBOLCOLOR="symbolColor",t.SIZE="size",t.TANGENT="tangent",t.OFFSET="offset",t.PERSPECTIVEDIVIDE="perspectiveDivide",t.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance",t.LENGTH="length",t.PREVPOSITION="prevPosition",t.NEXTPOSITION="nextPosition",t.SUBDIVISIONFACTOR="subdivisionFactor",t.COLORFEATUREATTRIBUTE="colorFeatureAttribute",t.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",t.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",t.DISTANCETOSTART="distanceToStart",t.UVMAPSPACE="uvMapSpace",t.BOUNDINGRECT="boundingRect",t.UVREGION="uvRegion",t.PROFILERIGHT="profileRight",t.PROFILEUP="profileUp",t.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",t.FEATUREVALUE="featureValue",t.INSTANCEMODELORIGINHI="instanceModelOriginHi",t.INSTANCEMODELORIGINLO="instanceModelOriginLo",t.INSTANCEMODEL="instanceModel",t.INSTANCEMODELNORMAL="instanceModelNormal",t.INSTANCECOLOR="instanceColor",t.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",t.LOCALTRANSFORM="localTransform",t.GLOBALTRANSFORM="globalTransform",t.BOUNDINGSPHERE="boundingSphere",t.MODELORIGIN="modelOrigin",t.MODELSCALEFACTORS="modelScaleFactors",t.FEATUREATTRIBUTE="featureAttribute",t.STATE="state",t.LODLEVEL="lodLevel",t.POSITION0="position0",t.POSITION1="position1",t.NORMAL2COMPRESSED="normal2Compressed",t.COMPONENTINDEX="componentIndex",t.VARIANTOFFSET="variantOffset",t.VARIANTSTROKE="variantStroke",t.VARIANTEXTENSION="variantExtension",t.SIDENESS="sideness",t.START="start",t.END="end",t.UP="up",t.EXTRUDE="extrude",t.OBJECTANDLAYERIDCOLOR="objectAndLayerIdColor",t.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"}(r||(r={}))}}]);