@arcgis/core 4.33.0-next.20250430 → 4.33.0-next.20250502

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 (203) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/02b38423276536596aba.js +1 -0
  3. package/assets/esri/core/workers/chunks/{de16b771d2c8d816c738.js → 05c80002c37002ac99e8.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{5d40c4783f58af1ae0dc.js → 0e8181e7fc1386d08ffc.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{96e5d192c8d23c1e324f.js → 13e68c43acc8916520db.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{e6a5911ea21bef32834b.js → 1bc22af4cc4effcbcf2b.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{9b2ab27159500315fbc1.js → 26850ec0917ee355ddb7.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{1bd4fe77ba6fb25322e7.js → 29e2b105f55adafc3a6d.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{5d63dfa5a60c88e03b28.js → 2c77a543a174e5bc736a.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{d0ddf4f1c6a351b447c7.js → 30d7d2c7d6e9e5e2ecb9.js} +1 -1
  11. package/assets/esri/core/workers/chunks/3cee3ff926f47aae476f.js +1 -0
  12. package/assets/esri/core/workers/chunks/{febae745a29a17ca130a.js → 4480e4b61affb3b2e9d6.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{4d4a271351fd288277d2.js → 49085a0b3a74e158f32f.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{392e64a573f67817db02.js → 4cb199b547e5b97e65fb.js} +1 -1
  15. package/assets/esri/core/workers/chunks/4df36ee2406861c7afa8.js +1 -0
  16. package/assets/esri/core/workers/chunks/{ba917175ca2a6681501e.js → 563594357f3648652a5c.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{abfc5f9ac16c3e885c5f.js → 56db71ea7eb8a5652d98.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{e56647e61296643c5f84.js → 5719471414810b6a9aec.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{235efd948ae470a6f238.js → 60b1365d25581ccf0485.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{3795793643f4db64af0e.js → 63c25455b9cf1b3df76a.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{cb25b45a6b385e60c68d.js → 653ff3e631fea8ad393a.js} +122 -121
  22. package/assets/esri/core/workers/chunks/{909be86782af3deb448e.js → 654fe135d41af81daa13.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{cd9343c78a7c3acdbbcd.js → 681b2662f6ce936afd7e.js} +1 -1
  24. package/assets/esri/core/workers/chunks/6d89d42bcba213be2d9d.js +1 -0
  25. package/assets/esri/core/workers/chunks/6ecc3a3737ae8622dfa4.js +1 -0
  26. package/assets/esri/core/workers/chunks/6fef5a07f75b2a5736ad.js +1 -0
  27. package/assets/esri/core/workers/chunks/6ff46126c82354e6c78e.js +1 -0
  28. package/assets/esri/core/workers/chunks/{65f2b22d8fc12e6d4a87.js → 7000d9158da929a16071.js} +1 -1
  29. package/assets/esri/core/workers/chunks/71dc9d78dec981078a1a.js +1 -0
  30. package/assets/esri/core/workers/chunks/{ab6ecd8eeec5ff761b34.js → 73bca519c93920bc8c9f.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{7551011117c3d36ff3db.js → 743cdbff5c4616ddc2b4.js} +1 -1
  32. package/assets/esri/core/workers/chunks/7a282674d77875c58acd.js +1 -0
  33. package/assets/esri/core/workers/chunks/{968956284f44187f0622.js → 8540fb31bd0b29ff1906.js} +1 -1
  34. package/assets/esri/core/workers/chunks/8c5cea49e48f8858f115.js +1 -0
  35. package/assets/esri/core/workers/chunks/{237a965bd41ba8903e03.js → 921c040d0497031fd8ff.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{96d2a0777f5c418055fb.js → 92b48e3365d1cc933113.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{5d485c07848164099859.js → 95a4da3150ad8e8e36d8.js} +1 -1
  38. package/assets/esri/core/workers/chunks/9652cfd4668b95036c87.js +39 -0
  39. package/assets/esri/core/workers/chunks/{46fb6ba8900286d18b6f.js → 9d564f79b82d427fc1da.js} +1 -1
  40. package/assets/esri/core/workers/chunks/9f07919ade6707b103da.js +1 -0
  41. package/assets/esri/core/workers/chunks/{00612d6e05b1c8647668.js → 9fff43ffcd5602ccc50f.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{1cc5c566e68f2255d035.js → a6ca68ef6311ffc365b2.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{5a51c75a2932d9da001a.js → a8d043b73e087bee7c40.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{d3174ff4dd5acd16485a.js → c041f4a1d18d42e27ad7.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{ebfa4a0334401f5e004a.js → c12765e0c8b44e349c2a.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{afddb94ff4e1a70022c7.js → c3b2b05996e2008adbe3.js} +1 -1
  47. package/assets/esri/core/workers/chunks/c9a2c4fd169b943db4b4.js +1 -0
  48. package/assets/esri/core/workers/chunks/{4fb4884d2de42792abe3.js → d1a9e8db5ba403abe721.js} +1 -1
  49. package/assets/esri/core/workers/chunks/d35cd309ba7bb8968a22.js +1 -0
  50. package/assets/esri/core/workers/chunks/{6e6422eda398774acbc7.js → d60da671aba70485050e.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{7a8df1225abd54ff68ed.js → db298b292a4e43cba72d.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{2bda2cfc6e81818d7d33.js → dcaeb57c69d432118604.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{fb455fd89b74b70a6a2b.js → e613df03ceb39e29befa.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{05d7d8ff3e4cbad32580.js → e8dcaa7837b6fe7bff20.js} +1 -1
  55. package/assets/esri/core/workers/chunks/ec1a4b82cbc44ba45f83.js +1 -0
  56. package/assets/esri/core/workers/chunks/ec778cc7a55068f51937.js +1 -0
  57. package/assets/esri/core/workers/chunks/{51339193abddfe37745d.js → f2b63597ae956db74eb3.js} +1 -1
  58. package/chunks/Bufferer-CicaNej1.js +1 -1
  59. package/chunks/Distance2DCalculator-C1KHhZwD.js +1 -1
  60. package/chunks/Envelope.js +1 -1
  61. package/chunks/Envelope2D.js +1 -1
  62. package/chunks/GeodeticDistanceCalculator-CcF1gMZX.js +1 -1
  63. package/chunks/Geometry.js +1 -1
  64. package/chunks/GeometryCleaner-BEJM7I4l.js +1 -1
  65. package/chunks/OperatorClip.js +1 -1
  66. package/chunks/OperatorCrosses.js +1 -1
  67. package/chunks/OperatorCut.js +1 -1
  68. package/chunks/OperatorGeneralize.js +1 -1
  69. package/chunks/OperatorGeodesicBuffer.js +1 -1
  70. package/chunks/OperatorGeodeticArea.js +1 -1
  71. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  72. package/chunks/OperatorGeodeticDistance.js +1 -1
  73. package/chunks/OperatorGeodeticLength.js +1 -1
  74. package/chunks/OperatorIntersects.js +1 -1
  75. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  76. package/chunks/OperatorOverlaps.js +1 -1
  77. package/chunks/OperatorProximity.js +1 -1
  78. package/chunks/OperatorProximityGeodesic.js +1 -1
  79. package/chunks/OperatorShapePreservingLength.js +1 -1
  80. package/chunks/OperatorShapePreservingProject.js +1 -1
  81. package/chunks/OperatorSimplifyOGC.js +1 -1
  82. package/chunks/OperatorTouches.js +1 -1
  83. package/chunks/OperatorWithin.js +1 -1
  84. package/chunks/Point2D.js +1 -1
  85. package/chunks/ProjectionTransformation.js +1 -1
  86. package/chunks/QuadraticBezier.js +1 -1
  87. package/chunks/SSAO.glsl.js +43 -42
  88. package/chunks/SideCalculator2D-BNwb5gvz.js +1 -1
  89. package/chunks/Transformation2D.js +1 -1
  90. package/chunks/containsOperator.js +1 -1
  91. package/chunks/disjointOperator.js +1 -1
  92. package/chunks/equalsOperator.js +1 -1
  93. package/core/NestedMap.js +1 -1
  94. package/core/deprecate.js +1 -1
  95. package/geometry/operators/extendOperator.js +1 -1
  96. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  97. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  98. package/geometry/operators/gx/operatorBuffer.js +1 -1
  99. package/geometry/operators/gx/operatorDifference.js +1 -1
  100. package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
  101. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  102. package/geometry/operators/gx/operatorIntersection.js +1 -1
  103. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  104. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  105. package/geometry/operators/gx/operatorLocateBetween.js +1 -1
  106. package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
  107. package/geometry/operators/gx/operatorOffset.js +1 -1
  108. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  109. package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
  110. package/geometry/operators/gx/operatorSimplify.js +1 -1
  111. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  112. package/geometry/operators/gx/operatorUnion.js +1 -1
  113. package/geometry/operators/isNearOperator.js +1 -1
  114. package/geometry/operators/json/containsOperator.js +1 -1
  115. package/geometry/operators/json/disjointOperator.js +1 -1
  116. package/geometry/operators/reshapeOperator.js +1 -1
  117. package/geometry/operators/support/apiConverter.js +1 -1
  118. package/geometry/operators/support/initNoPeFactory.js +1 -1
  119. package/geometry/operators/support/jsonConverter.js +1 -1
  120. package/interfaces.d.ts +263 -39
  121. package/layers/MapImageLayer.js +1 -1
  122. package/layers/RouteLayer.js +1 -1
  123. package/layers/mixins/operationalLayers.js +1 -1
  124. package/layers/save/mapImageLayerUtils.js +5 -0
  125. package/package.json +1 -1
  126. package/portal/support/portalItemUtils.js +1 -1
  127. package/support/revision.js +1 -1
  128. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/utils.js +1 -1
  129. package/views/3d/environment/EnvironmentManager.js +1 -1
  130. package/views/3d/glTF/LoaderResult.js +1 -1
  131. package/views/3d/glTF/loader.js +1 -1
  132. package/views/3d/interactive/Manipulator3D.js +1 -1
  133. package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
  134. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  135. package/views/3d/layers/I3SMeshView3D.js +1 -1
  136. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  137. package/views/3d/layers/graphics/DeconflictAABR.js +5 -0
  138. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  139. package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
  140. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  141. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  142. package/views/3d/layers/graphics/Labeler.js +1 -1
  143. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  144. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  145. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  146. package/views/3d/webgl-engine/Stage.js +1 -1
  147. package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
  148. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  149. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +2 -2
  150. package/views/3d/webgl-engine/lib/ContentObjectType.js +1 -1
  151. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +5 -0
  152. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  153. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  154. package/views/3d/webgl-engine/lib/IntersectorTarget.js +1 -1
  155. package/views/3d/webgl-engine/lib/ModelDirtySet.js +1 -1
  156. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  157. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  158. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  159. package/views/3d/webgl-engine/lib/RendererBase.js +1 -1
  160. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  161. package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
  162. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  163. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  164. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  165. package/views/3d/webgl-engine/parts/Model.js +1 -1
  166. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  167. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  168. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  169. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  170. package/views/SelectionManager.js +1 -1
  171. package/views/ui/DefaultUI.js +1 -1
  172. package/views/webgl/Sync.js +5 -0
  173. package/widgets/Directions/DirectionsViewModel.js +1 -1
  174. package/widgets/Directions/css.js +5 -0
  175. package/widgets/Directions.js +1 -1
  176. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  177. package/widgets/FeatureTable/support/AttachmentsViewOptions.d.ts +4 -0
  178. package/widgets/FeatureTable.js +1 -1
  179. package/widgets/Fullscreen/FullscreenViewModel.js +1 -1
  180. package/widgets/Fullscreen.js +1 -1
  181. package/widgets/LayerList/LayerListItem.js +1 -1
  182. package/widgets/LayerList/ListItemPanel.js +1 -1
  183. package/widgets/NavigationToggle/NavigationToggleViewModel.js +1 -1
  184. package/widgets/NavigationToggle.js +1 -1
  185. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  186. package/widgets/TableList/ListItemPanel.js +1 -1
  187. package/widgets/Weather/WeatherViewModel.js +1 -1
  188. package/widgets/Weather.js +1 -1
  189. package/assets/esri/core/workers/chunks/11b55e7e76e50fe11bbe.js +0 -1
  190. package/assets/esri/core/workers/chunks/25142d431dd1e5e82234.js +0 -1
  191. package/assets/esri/core/workers/chunks/2c92f6f268aa2de5432c.js +0 -1
  192. package/assets/esri/core/workers/chunks/7bfa18dd8771d4932533.js +0 -1
  193. package/assets/esri/core/workers/chunks/7fce62ef3f0b011e0d35.js +0 -1
  194. package/assets/esri/core/workers/chunks/84d7ed2cf5fe23a0888f.js +0 -1
  195. package/assets/esri/core/workers/chunks/86931186095c23e47c0c.js +0 -1
  196. package/assets/esri/core/workers/chunks/8c8d812a7f2d29c29676.js +0 -1
  197. package/assets/esri/core/workers/chunks/a79511b926a2830bb160.js +0 -1
  198. package/assets/esri/core/workers/chunks/b780c7062b1b18a5ae19.js +0 -1
  199. package/assets/esri/core/workers/chunks/b8248939373e25a8d6db.js +0 -1
  200. package/assets/esri/core/workers/chunks/baa9fd23414f03ef90bc.js +0 -1
  201. package/assets/esri/core/workers/chunks/c819535525e9a27bae1f.js +0 -39
  202. package/assets/esri/core/workers/chunks/e08bff9f8247909776a4.js +0 -1
  203. package/assets/esri/core/workers/chunks/f2bc75a718a10065011d.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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import{watch as i,sync as l,initial as o,on as n}from"../core/reactiveUtils.js";import{formatFileSize as s}from"../core/unitFormatUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import{isLayerFromCatalog as c}from"../layers/catalog/catalogUtils.js";import{isKnowledgeGraphLayer as d,isMapImageLayer as h,isSubtypeGroupLayer as p}from"../layers/support/layerUtils.js";import m from"../tables/AttributeTableTemplate.js";import u from"./Widget.js";import{isSupportedImage as g,getCalciteIconForAttachment as w}from"./Attachments/support/attachmentUtils.js";import{loadPromptComponents as b,Prompt as v}from"./Editor/components/Prompt.js";import y from"./FeatureTable/ColumnMenuVisibleElements.js";import f from"./FeatureTable/FeatureTableViewModel.js";import _ from"./FeatureTable/VisibleElements.js";import{isGroupColumn as M}from"./FeatureTable/support/columnUtils.js";import{loadFieldColumnComponents as A,isIFeatureTableSupportedLayer as C,isIFeatureTableSupportedLayerWithAttachments as S,getRelationshipIdsToShow as T}from"./FeatureTable/support/tableUtils.js";import{loadCalciteComponents as E}from"./support/componentsUtils.js";import{globalCss as I}from"./support/globalCss.js";import{getIconForLayer as V}from"./support/iconUtils.js";import{renderingSanitizer as R,storeNode as x,discardNode as k}from"./support/widgetUtils.js";import{messageBundle as D}from"./support/decorators/messageBundle.js";import{vmEvent as P}from"./support/decorators/vmEvent.js";import{tsx as F}from"./support/jsxFactory.js";import{substitute as L}from"../intl/substitute.js";var j;const O="esri-feature-table",z=`${O}__prompt`,$=`${O}__attachments-view`,U={base:O,content:`${O}__content`,menuPopover:`${O}__menu-popover`,layerDropdownMenu:`${O}__layer-switcher-menu`,tableContainer:`${O}__table-container`,tableContainerWithAttachments:`${O}__table-container--attachments`,tableNavigation:`${O}__table-navigation`,attachmentsView:$,attachmentsViewContent:`${$}__content`,attachmentsViewDropArea:`${$}__drop-area`,attachmentsViewIcon:`${$}__icon`,attachmentsViewInformation:`${$}__information`,attachmentsViewList:`${$}__list`,attachmentsViewListFileSize:`${$}__list__filesize`,attachmentsViewListItemDelete:`${$}__list-item--delete`,attachmentsViewListThumbnail:`${$}__list__thumbnail`,expanded:`${O}__expanded`,collapsed:`${O}__collapsed`,promptContainer:z,promptHeader:`${z}__header`,promptHeading:`${z}__header__heading`,promptMessage:`${z}__message`,promptDivider:`${z}__divider`,promptActions:`${z}__actions`},B={attachment:"attachment",chevronDown:"chevron-down",chevronLeft:"chevron-left",chevronRight:"chevron-right",clearSelection:"clear-selection",downloadTo:"download-to",exclamationMarkTriangle:"exclamation-mark-triangle",exportToCSV:"file-csv",folderOpen:"folder-open",delete:"trash",launch:"launch",layers:"layers",moveUp:"move-up",plus:"plus",refresh:"refresh",replaceImage:"replace-image",save:"save",showAll:"selection-x",showColumn:"show-column",showSelected:"selection-filter",upload:"upload",zoomToSelection:"zoom-to-object"};let H=j=class extends u{constructor(e,t){super(e,t),this._attachmentsInput=null,this._columnVisibilityActions=new Map,this.attachmentsList=null,this.description=null,this.disabled=!1,this.menuConfig=null,this.title=null,this.viewModel=new f,this.visibleElements=new _,this._showDeletePrompt=this._showDeletePrompt.bind(this),this._onDeleteSelectionClick=this._onDeleteSelectionClick.bind(this)}initialize(){this.addHandles([i((()=>[this.isQueryingOrSyncing,this.editingEnabled]),(()=>this.scheduleRender())),i((()=>[this._effectiveVisibleElements,this._effectiveVisibleElements.columnDescriptions,this._effectiveVisibleElements.columnMenus,this._effectiveVisibleElements.columnMenuItems,this.columns.length]),(()=>{this.columns.forEach((e=>e.visibleElements=this._effectiveVisibleElements)),this.refreshCellContent()}),l),i((()=>this._effectiveVisibleElements.selectionColumn),(e=>{this.grid&&(this.grid.selectionColumnEnabled=e)}),o),n((()=>this.viewModel),"show-related-table",(e=>this._onShowRelatedTable(e))),i((()=>this.editingEnabled),(()=>{const{attachmentsViewOptions:e}=this;this.clearPrompt(),e&&(e.form?.reset(),e.candidates=null)}))])}loadDependencies(){return Promise.all([E({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),alert:()=>import("@esri/calcite-components/dist/components/calcite-alert"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),pagination:()=>import("@esri/calcite-components/dist/components/calcite-pagination"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),progress:()=>import("@esri/calcite-components/dist/components/calcite-progress"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")}),b(),A()])}destroy(){this.drainRelatedTables(),this.clearPrompt()}get _effectiveDescription(){const{description:e}=this;return null!=e?R.sanitize("function"==typeof e?e():e):void 0}get _effectiveLayers(){const{layer:e,layers:t}=this,i=t?.length?t.filter(C):[],l=i.length?i:[...this._viewLayers];return e&&!l.includes(e)&&l.push(e),l}get _effectiveTitle(){const{layer:e,messages:t,state:i,highlightIds:l,title:o,size:n}=this;if(o)return R.sanitize("function"==typeof o?o():o);if(!e)return t.noLayer;switch(i){case"disabled":return t.errorLayer;case"ready":case"loading":return t.loading;case"error":return t.errorData}return L(t.header,{title:R.sanitize(e.title),count:n,selected:l.length})}get _effectiveVisibleElements(){return this.visibleElementsOverride??this.visibleElements}get _filteredTables(){const e=this.relatedTables.toArray(),t=1===e.length;return this.allRelatedTablesVisible?e:t?[e[0]]:this._shouldShowAttachmentsView?e.slice(-1):e.slice(-2)}get _hasAttachmentsViewError(){return null!=this.attachmentsViewOptions.error}get _hasCustomMenuItems(){return!!this.menuConfig?.items?.length}get _hasDefaultMenuItems(){return!!(this._showClearSelectionAction||this._showDeleteSelectionAction||this._showExportSelectionToCSVAction||this._showRefreshDataAction||this._showZoomToSelectionAction||this._showSelectedRecordsShowSelectedAction||this._showSelectedRecordsShowAllAction||this._showColumnsVisibilityAction)}get _shouldShowGrid(){return this.allRelatedTablesVisible||1===this.relatedTables.length&&!this._shouldShowAttachmentsView}get _shouldShowMenu(){const{header:e,menu:t}=this._effectiveVisibleElements;return!(!e||!t||!this._hasDefaultMenuItems&&!this._hasCustomMenuItems)}get _shouldShowAttachmentsView(){return!(null==this.attachmentsViewOptions.objectId&&!this.relatedTables.some((e=>null!=e.attachmentsViewOptions.objectId)))}get _showClearSelectionAction(){return!(!this.highlightIds.length||!this._effectiveVisibleElements.menuItems?.clearSelection||this.relatedTables.length)}get _showColumnsVisibilityAction(){const{header:e,menu:t,menuItems:i}=this._effectiveVisibleElements;return!(!(e&&t&&i?.toggleColumns)||this.showRelatedTableCallback||this.allRelatedTablesVisible||this._shouldShowAttachmentsView)}get _showDeleteSelectionAction(){return!(!(this.editingEnabled&&this.highlightIds.length&&this._effectiveVisibleElements.menuItems?.deleteSelection&&this.layer?.capabilities?.operations?.supportsDelete)||this.relatedTables.length)}get _showExportSelectionToCSVAction(){return!(!(this._effectiveVisibleElements.menuItems.exportSelectionToCSV&&this.layer&&this.highlightIds.length)||this.relatedTables.length)}get _showLayerDropdown(){return!(!this._effectiveLayers.length||!this._effectiveVisibleElements.layerDropdown)}get _shouldShowNavigationBar(){const e=!!this.relatedTable||this._shouldShowAttachmentsView;return!this.tableParent&&e}get _showRefreshDataAction(){return!!this._effectiveVisibleElements.menuItems?.refreshData}get _showSelectedRecordsShowSelectedAction(){const e=this.objectIds.length,t=this.highlightIds.length;return!(!t||!this._effectiveVisibleElements.menuItems?.selectedRecordsShowSelectedToggle||e&&t===e||this.relatedTables.length)}get _showSelectedRecordsShowAllAction(){return!(!this._effectiveVisibleElements.menuItems?.selectedRecordsShowAllToggle||!this.objectIds.length||this.relatedTables.length)}get _showZoomToSelectionAction(){return!(!this.view||!this.highlightIds.length||this.effectiveTable.layer?.isTable||!this._effectiveVisibleElements.menuItems?.zoomToSelection)}get _viewLayers(){const e=this.view?.map;if(!e)return[];const t=new Set,i=e=>{!C(e)||p(e)||t.has(e)||(e.load(),t.add(e))},l=e=>{c(e)||"catalog-footprint"===e.type||(d(e)?(e.load(),e.layers?.forEach(i),e.tables?.forEach(i)):h(e)?(e.loadAll(),e.sublayers?.forEach(i),e.subtables?.forEach(i)):p(e)?(e.loadAll(),e.sublayers?.forEach(i)):i(e))};return e.allLayers.forEach(l),e.allTables.forEach(l),[...t.values()]}get grid(){return this.viewModel.grid}get actionColumnConfig(){return this.viewModel.actionColumnConfig}set actionColumnConfig(e){this.viewModel.actionColumnConfig=e}get activeFilters(){return this.viewModel.activeFilters}get activeSortOrders(){return this.viewModel.activeSortOrders}get allColumns(){return this.viewModel.allColumns}get allRelatedTablesVisible(){return this.viewModel.allRelatedTablesVisible}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get attachmentsViewOptions(){return this.viewModel.attachmentsViewOptions}set attachmentsViewOptions(e){this.viewModel.attachmentsViewOptions=e}get attributeTableTemplate(){return this.viewModel.attributeTableTemplate}set attributeTableTemplate(e){this.viewModel.attributeTableTemplate=e}get autoRefreshEnabled(){return this.viewModel.autoRefreshEnabled}set autoRefreshEnabled(e){this.viewModel.autoRefreshEnabled=e}get clearPrompt(){return this.viewModel.clearPrompt}set clearPrompt(e){this.viewModel.clearPrompt=e}get columnPerformanceModeEnabled(){return this.viewModel.columnPerformanceModeEnabled}set columnPerformanceModeEnabled(e){this.viewModel.columnPerformanceModeEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get columns(){return this.viewModel.columns}get definitionExpression(){return this.viewModel.definitionExpression}set definitionExpression(e){this.viewModel.definitionExpression=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveSize(){return this.viewModel.effectiveSize}get effectiveTable(){return this.relatedTable||this}get filterGeometry(){return this.viewModel.filterGeometry}set filterGeometry(e){this.viewModel.filterGeometry=e}get filterBySelectionEnabled(){return this.viewModel.filterBySelectionEnabled}set filterBySelectionEnabled(e){this.viewModel.filterBySelectionEnabled=e}get hiddenFields(){return this.viewModel.hiddenFields}set hiddenFields(e){this.viewModel.hiddenFields=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get icon(){return"table"}set icon(e){this._overrideIfSome("icon",e)}get initialSize(){return this.viewModel.initialSize}set initialSize(e){this.viewModel.initialSize=e}get isQueryingOrSyncing(){return this.viewModel.isQueryingOrSyncing}get isSyncingAttachments(){return this.viewModel.isSyncingAttachments}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get layerView(){return this.viewModel.layerView}get maxSize(){return this.viewModel.maxSize}set maxSize(e){this.viewModel.maxSize=e}get messages(){return this.viewModel.messages}set messages(e){this.viewModel.messages=e}get messagesCommon(){return this.viewModel.messagesCommon}set messagesCommon(e){this.viewModel.messagesCommon=e}get messagesUnits(){return this.viewModel.messagesUnits}set messagesUnits(e){this.viewModel.messagesUnits=e}get messagesURIUtils(){return this.viewModel.messagesURIUtils}set messagesURIUtils(e){this.viewModel.messagesURIUtils=e}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get multipleSortPriority(){return this.viewModel.multipleSortPriority}set multipleSortPriority(e){this.viewModel.multipleSortPriority=e}get noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get objectIds(){return this.viewModel.objectIds}set objectIds(e){this.viewModel.objectIds=e}get outFields(){return this.viewModel.outFields}set outFields(e){this.viewModel.outFields=e}get pageCount(){return this.viewModel.pageCount}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get paginationEnabled(){return this.viewModel.paginationEnabled}set paginationEnabled(e){this.viewModel.paginationEnabled=e}get prompt(){return this.viewModel.prompt}set prompt(e){this.viewModel.prompt=e}get relatedRecordsEnabled(){return this.viewModel.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.viewModel.relatedRecordsEnabled=e}get relatedTable(){return this.viewModel.relatedTable}get relatedTables(){return this.viewModel.relatedTables}set relatedTables(e){this.viewModel.relatedTables=e}get relationship(){return this.viewModel.relationship}get relationshipColumnConfigs(){return this.viewModel.relationshipColumnConfigs}set relationshipColumnConfigs(e){this.viewModel.relationshipColumnConfigs=e}get relationshipConfig(){return this.viewModel.relationshipConfig}set relationshipConfig(e){this.viewModel.relationshipConfig=e}get relationshipInfos(){return this.viewModel.relationshipInfos}get returnGeometryEnabled(){return this.viewModel.returnGeometryEnabled}set returnGeometryEnabled(e){this.viewModel.returnGeometryEnabled=e}get returnMEnabled(){return this.viewModel.returnMEnabled}set returnMEnabled(e){this.viewModel.returnMEnabled=e}get returnZEnabled(){return this.viewModel.returnZEnabled}set returnZEnabled(e){this.viewModel.returnZEnabled=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get selectionSource(){return this.viewModel.selectionSource}set selectionSource(e){this.viewModel.selectionSource=e}get showAllRelatedTables(){return this.viewModel.showAllRelatedTables}set showAllRelatedTables(e){this.viewModel.showAllRelatedTables=e}get showPrompt(){return this.viewModel.showPrompt}set showPrompt(e){this.viewModel.showPrompt=e}get showRelatedTableCallback(){return this.viewModel.showRelatedTableCallback}set showRelatedTableCallback(e){this.viewModel.showRelatedTableCallback=e}get size(){return this.viewModel.size}get state(){return this.viewModel.state}get supportsAddAttachments(){return this.viewModel.supportsAddAttachments}get supportsAttachments(){return this.viewModel.supportsAttachments}get supportsDeleteAttachments(){return this.viewModel.supportsDeleteAttachments}get supportsResizeAttachments(){return this.viewModel.supportsResizeAttachments}get supportsUpdateAttachments(){return this.viewModel.supportsUpdateAttachments}get tableController(){return this.viewModel.tableController}set tableController(e){this.viewModel.tableController=e}get tableParent(){return this.viewModel.tableParent}set tableParent(e){this.viewModel.tableParent=e}get tableTemplate(){return this.viewModel.tableTemplate}set tableTemplate(e){this.viewModel.tableTemplate=e}get tableTemplateOverride(){return this.viewModel.tableTemplateOverride}set tableTemplateOverride(e){this.viewModel.tableTemplateOverride=e}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(e){this.viewModel.timeExtent=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visibleElementsOverride(){const{attachmentsViewOptions:e,relatedTable:t,tableController:i,visibleElements:l}=this,{columnDescriptions:o,columnMenus:n,tooltips:s}=l,a=null!=e.objectId;if(t)return new _({columnDescriptions:o,columnMenus:n,tooltips:s,close:l.close,header:l.header,layerDropdown:l.layerDropdown,layerDropdownIcons:l.layerDropdownIcons,menu:l.menu,menuItems:l.menuItems,progress:l.progress,selectionColumn:!1,columnMenuItems:new y({sortAscending:!1,sortDescending:!1})});if(i){const e=i.relatedTable===this,t=i.allRelatedTablesVisible,r=e&&l.selectionColumn&&!t&&!a,c=e&&!t&&!a;return new _({columnDescriptions:o,columnMenus:n,tooltips:s,selectionColumn:r,close:!1,header:!1,layerDropdown:!1,menu:!1,progress:!1,columnMenuItems:new y({sortAscending:c,sortDescending:c})})}return a?new _({columnDescriptions:o,columnMenus:n,tooltips:s,close:l.close,header:l.header,layerDropdown:l.layerDropdown,layerDropdownIcons:l.layerDropdownIcons,menu:l.menu,menuItems:l.menuItems,progress:l.progress,selectionColumn:!1,columnMenuItems:new y({sortAscending:!1,sortDescending:!1})}):null}clearSelectionFilter(){this.viewModel.clearSelectionFilter()}async deleteAttachments(e,t,i){null!=e&&t?.length&&(i?this._showDeleteAttachmentPrompt(e,t):await this.viewModel.deleteAttachments(e,t))}deleteSelection(e){return this.highlightIds.length?e?(this._showDeletePrompt(),this.scheduleRender(),Promise.resolve()):this.viewModel.deleteSelection():Promise.resolve()}async downloadAttachmentById(e,t){return this.viewModel.downloadAttachmentById(e,t)}drainRelatedTables(){this.viewModel.drainRelatedTables()}exportSelectionToCSV(e){return this.viewModel.exportSelectionToCSV(e)}filterBySelection(){this.viewModel.filterBySelection()}findColumn(e){return this.viewModel.findColumn(e)}goToPage(e){this.viewModel.goToPage(e)}hideColumn(e){this.grid?.hideColumn(e)}nextPage(){this.viewModel.nextPage()}previousPage(){this.viewModel.previousPage()}async refresh(){await this.viewModel.refresh()}refreshCellContent(){this.viewModel.refreshCellContent()}async saveAttachmentsViewForm(){await this.viewModel.saveAttachmentsViewForm()}showAllColumns(){this.viewModel.showAllColumns()}showColumn(e){this.grid?.showColumn(e)}sortColumn(e,t){this.viewModel.sortColumn(e,t)}scrollLeft(){this.viewModel.scrollLeft()}scrollToBottom(){this.viewModel.scrollToBottom()}scrollToIndex(e){this.viewModel.scrollToIndex(e)}scrollToRow(e){this.viewModel.scrollToRow(e)}scrollToTop(){this.viewModel.scrollToTop()}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}zoomToSelection(){this.effectiveTable.viewModel.zoomToSelection()}render(){const{_effectiveVisibleElements:e,isQueryingOrSyncing:t,menuConfig:i,state:l}=this;return F("div",{bind:this,class:this.classes(U.base,I.widget)},F("calcite-panel",{bind:this,class:U.content,closable:e.close,description:this._effectiveDescription,disabled:this.disabled||"disabled"===l&&!this._effectiveLayers?.length,heading:e.header?this._effectiveTitle:void 0,loading:"loading"===l,menuOpen:!!i?.open,overlayPositioning:"fixed",onCalcitePanelClose:e=>{e.currentTarget.closed=!1,this.emit("close")}},e.progress?F("calcite-progress",{type:t?"indeterminate":"determinate"}):null,this._showLayerDropdown?this._renderLayerDropdown():null,this._renderColumnVisibilityAction(),this._renderHeaderMenuActions(),this._renderNavigationBar(),this._renderTables(),this._renderError()),this._renderColumnVisibilityPopover(),this._renderPrompt())}_renderTables(){const{grid:e,relatedTables:t}=this,i=this.classes(U.tableContainer);if(t.length){const l=this.classes(U.base,this.allRelatedTablesVisible?U.expanded:U.collapsed,this._shouldShowAttachmentsView?U.tableContainerWithAttachments:void 0);return F("div",{class:i},F("calcite-panel",{overlayPositioning:"fixed"},F("div",null,[this._shouldShowGrid?F("div",{class:l},e?.render(),this._renderPagination()):void 0,...this._filteredTables.map((e=>{const i=t.indexOf(e);return F("div",{class:l,key:`related-${i}`},e.render())})),,])))}return null!=this.attachmentsViewOptions.objectId?F("div",{class:i},F("calcite-panel",{overlayPositioning:"fixed"},F("div",null,[F("div",{class:this.classes(U.base,U.collapsed)},e?.render(),this._renderPagination()),this._renderAttachmentsView()]))):[F("div",{class:i},e?.render()),this._renderPagination()]}_renderPagination(){if(this.paginationEnabled)return F("calcite-pagination",{pageSize:1,startItem:this.pageIndex+1,totalItems:this.pageCount,onCalcitePaginationChange:e=>this.goToPage(e.currentTarget.startItem-1)})}_renderError(){const{messages:e}=this;return F("calcite-alert",{autoClose:!0,autoCloseDuration:"fast",icon:B.exclamationMarkTriangle,kind:"danger",label:e.errorOccured,open:this._hasAttachmentsViewError,slot:"alerts",onCalciteAlertClose:()=>{this.attachmentsViewOptions.error=null}},F("span",{slot:"message"},e.errorOccured))}_renderPrompt(){return this.prompt?F(v,{...this.prompt,headingLevel:2}):void 0}_showDeletePrompt(){const{messages:e,messagesCommon:t}=this,i=L(e.deleteSelectionCount,{count:this.highlightIds.length});this.showPrompt({title:i,message:e.deleteRecordsRemoved,context:"danger",actions:{primary:{label:t.delete,action:this._onDeleteSelectionClick},secondary:{label:e.keepRecords,action:()=>this.clearPrompt()}}})}_showDeleteAttachmentPrompt(e,t){const{messages:i,messagesCommon:l}=this,o=L(i.deleteAttachmentCount,{count:t.length});this.showPrompt({title:o,message:i.deleteAttachmentConfirmation,context:"danger",actions:{primary:{label:l.delete,action:async()=>{try{await this.deleteAttachments(e,t,!1)}finally{this.clearPrompt()}}},secondary:{label:l.cancel,action:()=>this.clearPrompt()}}})}async _onDeleteSelectionClick(){try{await this.viewModel.deleteSelection()}finally{this.clearPrompt()}}_renderHeaderMenuAction(e){const{disabled:t,hidden:i,icon:l,text:o,clickFunction:n}=e;if(!i)return F("calcite-action",{disabled:t??this.menuConfig?.disabled,icon:l??void 0,key:o,onclick:()=>n(),slot:"header-menu-actions",text:o,textEnabled:!0,title:o})}_renderHeaderMenuActions(){return this._shouldShowMenu?[this._renderDefaultHeaderMenuActions(),this._renderCustomHeaderMenuActions()]:[]}_renderDefaultHeaderMenuActions(){if(!this._hasDefaultMenuItems)return[];const{messages:e}=this;return[this._showRefreshDataAction&&{icon:B.refresh,text:e.refreshData,clickFunction:()=>this.refresh()},this._showDeleteSelectionAction&&{icon:B.delete,text:e.deleteSelection,clickFunction:()=>this.deleteSelection(!0)},this._showClearSelectionAction&&{icon:B.clearSelection,text:e.clearSelection,clickFunction:()=>this.highlightIds?.removeAll()},this._showZoomToSelectionAction&&{icon:B.zoomToSelection,text:e.zoomToSelection,clickFunction:()=>this.zoomToSelection()},this._showSelectedRecordsShowSelectedAction&&{icon:B.showSelected,text:e.showSelected,clickFunction:()=>{const{objectIds:e}=this;e.removeAll(),e.addMany(this.highlightIds.toArray())}},this._showSelectedRecordsShowAllAction&&{icon:B.showAll,text:e.showAllRecords,clickFunction:()=>this.objectIds.removeAll()},this._showExportSelectionToCSVAction&&{icon:B.exportToCSV,text:e.exportSelectionCSV,clickFunction:()=>this.exportSelectionToCSV()}].filter(t).map((e=>e&&this._renderHeaderMenuAction(e)))}_renderCustomHeaderMenuActions(){return this.menuConfig?.items?.map((({disabled:e,hidden:t,icon:i,label:l,clickFunction:o})=>this._renderHeaderMenuAction({hidden:"function"==typeof t?t():t,icon:i,text:l,disabled:e,clickFunction:e=>o(e)})))??[]}_renderColumnVisibilityAction(){if(!this._showColumnsVisibilityAction)return[];const{_columnVisibilityActions:e,effectiveTable:t,id:i}=this,l=this.messages.toggleColumns;return F("calcite-action",{afterCreate:t=>e.set(i,t),afterRemoved:()=>e.delete(i),appearance:"transparent",bind:this,disabled:t.menuConfig?.disabled,icon:B.showColumn,id:`${i}__toggle-columns-action`,slot:"header-actions-end",text:l},this._effectiveVisibleElements.tooltips?F("calcite-tooltip",{closeOnClick:!0,overlayPositioning:"fixed",placement:"bottom-end",slot:"tooltip"},l):null)}_renderColumnVisibilityPopover(){if(!this._showColumnsVisibilityAction||this.effectiveTable.menuConfig?.disabled)return;const{effectiveTable:e}=this,t=this.messages.toggleColumns;return F("calcite-popover",{autoClose:!0,class:U.menuPopover,label:t,overlayPositioning:"fixed",placement:"top-end",pointerDisabled:!0,referenceElement:this._columnVisibilityActions.get(this.id)},F("calcite-list",{displayMode:"nested",filterEnabled:!0,filterPlaceholder:t,label:t,selectionMode:"multiple"},e.columns.toArray().map((t=>{const i=M(t)?t.columns?.map((t=>this._renderColumnListItem({column:t,table:e,ignoreSelect:!0}))):void 0;return this._renderColumnListItem({column:t,table:e,items:i})}))))}_renderColumnListItem(e){const{column:t,table:i,items:l,ignoreSelect:o}=e,{effectiveLabel:n,fieldName:s,hidden:a}=t;return F("calcite-list-item",{expanded:!(!l?.length||a)||void 0,key:`toggle-columns__item-${s}`,label:n,selected:!a,value:s,onCalciteListItemSelect:e=>{o&&e.stopPropagation(),i.toggleColumnVisibility(e.currentTarget.value)}},l)}_renderLayerDropdown(){const e=this.messages.selectALayer;return F("div",{class:U.layerDropdownMenu,key:`${this.id}-layerDropdown`,slot:"header-actions-start"},F("calcite-dropdown",{bind:this,maxItems:5,overlayPositioning:"fixed",placement:"bottom-start"},F("calcite-action",{icon:B.layers,slot:"trigger",text:e,title:e}),F("calcite-dropdown-group",{selectionMode:"single"},this._effectiveLayers.map(((e,t)=>this._renderLayerDropdownItem(e,t)))??null)))}_renderLayerDropdownItem(e,t){const i=this.visibleElements.layerDropdownIcons;return F("calcite-dropdown-item",{iconStart:i?V(e):void 0,key:`dropdown-item-${t}`,label:e.title??"",selected:e===this.layer,value:e.id,onCalciteDropdownItemSelect:()=>{this.layer=e}},e.title)}_onRelatedNavigationItemClick(e){this.viewModel.drainRelatedTablesAboveIndex(e)}_collapseRelatedTable(e){this.viewModel.collapseRelatedTable(this.effectiveTable,e)}_onShowRelatedTable(e){this.showRelatedTableCallback||(this._collapseRelatedTable(e),this._createRelatedTable(e))}async _createRelatedTable(e){const{editingEnabled:t,effectiveTable:i,paginationEnabled:l,pageSize:o,view:n,viewModel:s}=this,{layer:a,objectId:r,relatedLayer:c,relationshipId:d}=e;await a.load();const h=this.attachmentsEnabled&&S(a),p=new j({layer:a,attachmentsEnabled:h,editingEnabled:t,paginationEnabled:l,pageSize:o,relatedRecordsEnabled:!0,relationshipConfig:{objectId:r,relatedLayer:c,relationshipId:d},relationshipColumnConfigs:T(a,d),tableController:this,tableParent:i,view:n,showRelatedTableCallback:e=>s.emit("show-related-table",e)});this.relatedTables.add(p),this.scheduleRender()}_renderAttachmentsView(){const{attachmentInfos:e,mode:t,objectId:i}=this.attachmentsViewOptions;return"file"!==t&&e.length&&null!=i?this._renderAttachmentsViewList():this._renderAttachmentsViewFilePane()}_renderAttachmentsViewFilePane(){const{attachmentsViewOptions:e,isSyncingAttachments:t,supportsAddAttachments:i,messages:l,messagesUnits:o}=this,{attachmentId:n,attachmentInfos:a,candidates:r,objectId:c}=e,d=a.find((e=>e.id===n)),h=a.length,p=r?.length,m=d?F("calcite-label",{alignment:"center",key:"replace-file-node",scale:"l"},l.replaceFile):void 0,u=p?void 0:F("calcite-label",{alignment:"center",key:"message-node",scale:"m"},i?null==c?l.noFeature:l.dragAndDropToUpload:l.editingRestricted),g=Array.from(r??[]).pop(),w=g?F("calcite-label",{key:"filename-node"},g.name):void 0,b=i&&null!=c,v=b&&p,y=F("input",{afterCreate:x,afterRemoved:k,afterUpdate:x,bind:this,"data-node-ref":"_attachmentsInput",files:r,hidden:!0,name:"attachment",onchange:e=>this._onAttachmentsViewCandidateChange(e),type:"file"}),f=b?F("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:B.folderOpen,key:"select-node",loading:!1,onclick:()=>{this._attachmentsInput&&(this._attachmentsInput.value="",this._attachmentsInput.click())},width:"full"},l.selectFile):void 0,_=v?F("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:B.save,key:"save-node",loading:t,onclick:()=>{this.saveAttachmentsViewForm()},width:"full"},d?l.updateAttachment:l.addAttachment):void 0,M=h||p?F("calcite-button",{appearance:"transparent",bind:this,disabled:t,key:"cancel-node",onclick:()=>{this._attachmentsInput&&(this._attachmentsInput.value=""),e.reset(),e.attachmentInfos?.length&&(e.mode="list")},width:"full"},this.messagesCommon.cancel):void 0;return[F("div",{class:U.attachmentsView,key:"attachments-view"},F("div",{class:U.attachmentsViewContent,key:"attachments-view-content"},F("div",{bind:this,class:U.attachmentsViewDropArea,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},F("calcite-icon",{class:U.attachmentsViewIcon,icon:B.upload,scale:"l"}),m,u,F("form",{afterCreate:t=>e.form=t,afterRemoved:()=>e.form=null,bind:this,key:"attachments-form"},F("fieldset",null,w,y,f,_,M)))),null!=c&&null!=d?F("div",{class:U.attachmentsViewInformation,key:"information"},this._renderAttachmentsViewThumbnail(d,200),F("label",{key:"file-label"},l.fileName),F("span",{key:"file-span"},d.name),F("label",{key:"size-label"},l.size),F("span",{key:"size-span"},s(o,d.size??0))):void 0)]}_renderAttachmentsViewList(){const{attachmentsViewOptions:e,isSyncingAttachments:t,messages:i,messagesUnits:l,supportsDeleteAttachments:o,supportsUpdateAttachments:n}=this,{attachmentInfos:a,objectId:r}=e;return F("calcite-list",{afterCreate:x,afterRemoved:k,afterUpdate:x,bind:this,class:U.attachmentsViewList,"data-node-ref":"attachmentsList",key:`attachments-list-${r}`,label:i?.attachments,loading:t,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop,selectionMode:"multiple",onCalciteListChange:()=>this.scheduleRender()},...a?.map((t=>{const{id:a,name:c,size:d,url:h}=t,p=s(l,d??0);return F("calcite-list-item",{afterRemoved:()=>this.scheduleRender(),key:`attachment-${a}`,label:c,value:a},this._renderAttachmentsViewListThumbnail(t),F("span",{class:U.attachmentsViewListFileSize,slot:"actions-end",title:p},p),F("calcite-action",{appearance:"transparent",icon:B.downloadTo,key:`download-attachment-${a}`,label:`${c}`,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(r??-1,a)},slot:"actions-end",text:i.downloadAttachment,title:i.downloadAttachment}),n&&null!=r?F("calcite-action",{appearance:"transparent",disabled:!n,icon:B.replaceImage,key:`replace-attachment-${a}`,label:`${c}`,onclick:()=>{e.mode="file",e.attachmentId=a},slot:"actions-end",text:i.updateAttachment,title:i.updateAttachment}):void 0,F("calcite-action",{appearance:"transparent",icon:B.launch,key:`launch-attachment-${a}`,label:`${c}`,onclick:()=>{h&&window.open(h,"_blank")},slot:"actions-end",text:i.viewAttachment,title:i.viewAttachment}),o&&null!=r?F("calcite-action",{appearance:"transparent",class:U.attachmentsViewListItemDelete,disabled:!o,icon:B.delete,key:`delete-attachment-${a}`,label:`${c}`,onclick:()=>{this.deleteAttachments(r,[a],!0)},slot:"actions-end",text:i.deleteAttachment,title:i.deleteAttachment}):void 0)})))}_renderAttachmentsViewListThumbnail(e){return F("div",{class:U.attachmentsViewListThumbnail,slot:"content-start"},F("a",{href:e.url??"",rel:"noreferrer",target:"_blank"},this._renderAttachmentsViewThumbnail(e)))}_renderAttachmentsViewThumbnail(e,t=64){const{contentType:i,name:l,size:o,url:n}=e,s=`${n}${n?.includes("?")?"&":"?"}w=${t}&s=${o}`;return this.supportsResizeAttachments&&g(i)?F("img",{alt:l,key:`thumbnail-image-${l}`,src:s,title:l}):F("calcite-icon",{icon:w(i),key:`thumbnail-icon-${l}`,scale:"l",textLabel:l,title:l})}_onAttachmentsViewCandidateChange({target:e}){this.attachmentsViewOptions.candidates=e?.files}_onAttachmentsViewDrop(e){e.preventDefault(),(this.supportsAddAttachments||this.supportsUpdateAttachments)&&this.attachmentsViewOptions.set({mode:"file",candidates:e.dataTransfer?.files})}_renderNavigationBar(){const{effectiveTable:e,messages:t,messagesCommon:i,relatedTable:l,relatedTables:o}=this;if(!this._shouldShowNavigationBar)return;const{attachmentsList:n,attachmentsViewOptions:s,layer:a,supportsAddAttachments:r,supportsDeleteAttachments:c}=e;if(!a)return;const{attachmentInfos:d,objectId:h}=s,p=null!=h,m=d.length,u=n?.selectedItems?.length??0,g=`${a.objectIdField}: ${h}`,w=L(t.selectedCount,{count:u}),b=L(t.attachmentsCount,{count:m}),v=p?F("calcite-action",{bind:this,icon:B.chevronRight,iconFlipRtl:!0,key:"navigation-feature",onclick:()=>e.scrollToRow(h),text:g,textEnabled:!0,title:g}):void 0,y=p?F("calcite-action",{icon:B.chevronRight,iconFlipRtl:!0,key:"navigation-attachments-label",label:b,onclick:()=>{m>0&&(s.mode="list")},text:b,textEnabled:!0,title:b}):void 0,f=p?F("calcite-chip",{closable:!0,closed:0===u,key:"navigation-chip",kind:"inverse",label:w,selected:!0,title:w,value:"selected",onCalciteChipClose:()=>n?.selectedItems?.forEach((e=>e.selected=!1))},w):void 0,_=l?F("calcite-label",{layout:"inline"},t.showAllTables,F("calcite-switch",{checked:this.allRelatedTablesVisible,onCalciteSwitchChange:e=>this.showAllRelatedTables=!!e.currentTarget.checked})):void 0,M=p&&"list"===s.mode&&null!=h&&u&&c?F("calcite-action",{icon:B.delete,iconFlipRtl:!0,key:"attachments-trash-all",onclick:()=>{e.deleteAttachments(h,n?.selectedItems?.map((e=>e.value))??[],!0)},text:i.delete,textEnabled:!0,title:L(t.deleteAttachmentCount,{count:u})}):void 0,A=p&&"list"===s.mode&&r?F("calcite-action",{bind:this,icon:B.plus,iconFlipRtl:!0,key:"attachments-add",onclick:()=>{s.attachmentId=null,s.mode="file"},text:t.addAttachment,textEnabled:!0,title:t.addAttachment}):void 0;return F("div",{class:U.tableNavigation,key:"table-nav"},F("calcite-action",{icon:B.moveUp,iconFlipRtl:!0,key:"go-back",onclick:()=>{l&&this.drainRelatedTables(),e.attachmentsViewOptions.objectId=null},text:this.layer?.title??"",textEnabled:!1,title:l?t.exitRelatedRecords:t.exitAttachments}),o.toArray().map(((e,t)=>this._renderRelatedTableNavigationAction(e,t))),v,y,F("div",null,f,_,M,A))}_renderRelatedTableNavigationAction(e,t){const i=this._getLabelForRelatedTableNavigationAction(e);return F("calcite-action",{icon:B.chevronRight,iconFlipRtl:!0,key:t,onclick:()=>this._onRelatedNavigationItemClick(t),text:i,textEnabled:!0,title:e.layer?.title||""})}_getLabelForRelatedTableNavigationAction(e){const t=e.layer?.title;if(!t)return"";const{relatedTables:i}=this;if(i.length<=1)return t;return i.indexOf(e)!==i.length-1&&t.length>20?`${t.slice(0,20)}...`:t}};e([a()],H.prototype,"_attachmentsInput",void 0),e([a()],H.prototype,"_columnVisibilityActions",void 0),e([a()],H.prototype,"_effectiveDescription",null),e([a()],H.prototype,"_effectiveLayers",null),e([a()],H.prototype,"_effectiveTitle",null),e([a()],H.prototype,"_effectiveVisibleElements",null),e([a()],H.prototype,"_filteredTables",null),e([a()],H.prototype,"_hasAttachmentsViewError",null),e([a()],H.prototype,"_hasCustomMenuItems",null),e([a()],H.prototype,"_hasDefaultMenuItems",null),e([a()],H.prototype,"_shouldShowGrid",null),e([a()],H.prototype,"_shouldShowMenu",null),e([a()],H.prototype,"_shouldShowAttachmentsView",null),e([a()],H.prototype,"_showClearSelectionAction",null),e([a()],H.prototype,"_showColumnsVisibilityAction",null),e([a()],H.prototype,"_showDeleteSelectionAction",null),e([a()],H.prototype,"_showExportSelectionToCSVAction",null),e([a()],H.prototype,"_showLayerDropdown",null),e([a()],H.prototype,"_shouldShowNavigationBar",null),e([a()],H.prototype,"_showRefreshDataAction",null),e([a()],H.prototype,"_showSelectedRecordsShowSelectedAction",null),e([a()],H.prototype,"_showSelectedRecordsShowAllAction",null),e([a()],H.prototype,"_showZoomToSelectionAction",null),e([a()],H.prototype,"_viewLayers",null),e([a()],H.prototype,"attachmentsList",void 0),e([a({readOnly:!0})],H.prototype,"grid",null),e([a()],H.prototype,"actionColumnConfig",null),e([a({readOnly:!0})],H.prototype,"activeFilters",null),e([a({readOnly:!0})],H.prototype,"activeSortOrders",null),e([a()],H.prototype,"allColumns",null),e([a({readOnly:!0})],H.prototype,"allRelatedTablesVisible",null),e([a()],H.prototype,"attachmentsEnabled",null),e([a()],H.prototype,"attachmentsViewOptions",null),e([a({type:m})],H.prototype,"attributeTableTemplate",null),e([a()],H.prototype,"autoRefreshEnabled",null),e([a()],H.prototype,"clearPrompt",null),e([a()],H.prototype,"columnPerformanceModeEnabled",null),e([a()],H.prototype,"columnReorderingEnabled",null),e([a({readOnly:!0})],H.prototype,"columns",null),e([a()],H.prototype,"definitionExpression",null),e([a()],H.prototype,"description",void 0),e([a()],H.prototype,"disabled",void 0),e([a()],H.prototype,"editingEnabled",null),e([a()],H.prototype,"effectiveSize",null),e([a()],H.prototype,"effectiveTable",null),e([a()],H.prototype,"filterGeometry",null),e([a()],H.prototype,"filterBySelectionEnabled",null),e([a()],H.prototype,"hiddenFields",null),e([a()],H.prototype,"highlightEnabled",null),e([a()],H.prototype,"highlightIds",null),e([a()],H.prototype,"icon",null),e([a()],H.prototype,"initialSize",null),e([a()],H.prototype,"isQueryingOrSyncing",null),e([a()],H.prototype,"isSyncingAttachments",null),e([a()],H.prototype,"label",null),e([a()],H.prototype,"layer",null),e([a()],H.prototype,"layers",null),e([a()],H.prototype,"layerView",null),e([a()],H.prototype,"maxSize",null),e([a(),D("esri/widgets/FeatureTable/t9n/FeatureTable")],H.prototype,"messages",null),e([a(),D("esri/t9n/common")],H.prototype,"messagesCommon",null),e([a(),D("esri/core/t9n/Units")],H.prototype,"messagesUnits",null),e([a(),D("esri/widgets/support/t9n/uriUtils")],H.prototype,"messagesURIUtils",null),e([a()],H.prototype,"menuConfig",void 0),e([a()],H.prototype,"multipleSelectionEnabled",null),e([a()],H.prototype,"multiSortEnabled",null),e([a()],H.prototype,"multipleSortPriority",null),e([a()],H.prototype,"noDataMessage",null),e([a()],H.prototype,"objectIds",null),e([a()],H.prototype,"outFields",null),e([a()],H.prototype,"pageCount",null),e([a()],H.prototype,"pageIndex",null),e([a()],H.prototype,"pageSize",null),e([a()],H.prototype,"paginationEnabled",null),e([a()],H.prototype,"prompt",null),e([a()],H.prototype,"relatedRecordsEnabled",null),e([a()],H.prototype,"relatedTable",null),e([a()],H.prototype,"relatedTables",null),e([a()],H.prototype,"relationship",null),e([a()],H.prototype,"relationshipColumnConfigs",null),e([a()],H.prototype,"relationshipConfig",null),e([a()],H.prototype,"relationshipInfos",null),e([a()],H.prototype,"returnGeometryEnabled",null),e([a()],H.prototype,"returnMEnabled",null),e([a()],H.prototype,"returnZEnabled",null),e([a()],H.prototype,"rowHighlightIds",null),e([a()],H.prototype,"selectionSource",null),e([a()],H.prototype,"showAllRelatedTables",null),e([a()],H.prototype,"showPrompt",null),e([a()],H.prototype,"showRelatedTableCallback",null),e([a()],H.prototype,"size",null),e([a({readOnly:!0})],H.prototype,"state",null),e([a()],H.prototype,"supportsAddAttachments",null),e([a()],H.prototype,"supportsAttachments",null),e([a()],H.prototype,"supportsDeleteAttachments",null),e([a()],H.prototype,"supportsResizeAttachments",null),e([a()],H.prototype,"supportsUpdateAttachments",null),e([a({constructOnly:!0})],H.prototype,"tableController",null),e([a({constructOnly:!0})],H.prototype,"tableParent",null),e([a()],H.prototype,"tableTemplate",null),e([a()],H.prototype,"tableTemplateOverride",null),e([a()],H.prototype,"title",void 0),e([a()],H.prototype,"timeExtent",null),e([a()],H.prototype,"timeZone",null),e([a()],H.prototype,"view",null),e([a({type:f}),P(["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder","show-related-table"])],H.prototype,"viewModel",void 0),e([a({type:_,nonNullable:!0})],H.prototype,"visibleElements",void 0),e([a({type:_})],H.prototype,"visibleElementsOverride",null),H=j=e([r("esri.widgets.FeatureTable")],H);const N=H;export{N as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import{watch as i,sync as l,initial as o,on as n}from"../core/reactiveUtils.js";import{formatFileSize as s}from"../core/unitFormatUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import{isLayerFromCatalog as c}from"../layers/catalog/catalogUtils.js";import{isKnowledgeGraphLayer as d,isMapImageLayer as h,isSubtypeGroupLayer as p}from"../layers/support/layerUtils.js";import m from"../tables/AttributeTableTemplate.js";import u from"./Widget.js";import{isSupportedImage as g,getCalciteIconForAttachment as b}from"./Attachments/support/attachmentUtils.js";import{loadPromptComponents as w,Prompt as v}from"./Editor/components/Prompt.js";import y from"./FeatureTable/ColumnMenuVisibleElements.js";import f from"./FeatureTable/FeatureTableViewModel.js";import _ from"./FeatureTable/VisibleElements.js";import{isGroupColumn as M}from"./FeatureTable/support/columnUtils.js";import{loadFieldColumnComponents as C,isIFeatureTableSupportedLayer as A,isIFeatureTableSupportedLayerWithAttachments as S,getRelationshipIdsToShow as T}from"./FeatureTable/support/tableUtils.js";import{loadCalciteComponents as E}from"./support/componentsUtils.js";import{globalCss as I}from"./support/globalCss.js";import{getIconForLayer as V}from"./support/iconUtils.js";import{renderingSanitizer as R,storeNode as x,discardNode as k}from"./support/widgetUtils.js";import{messageBundle as D}from"./support/decorators/messageBundle.js";import{vmEvent as P}from"./support/decorators/vmEvent.js";import{tsx as O}from"./support/jsxFactory.js";import{substitute as F}from"../intl/substitute.js";var L;const j="esri-feature-table",z=`${j}__prompt`,$=`${j}__attachments-view`,U={base:j,content:`${j}__content`,menuPopover:`${j}__menu-popover`,layerDropdownMenu:`${j}__layer-switcher-menu`,tableContainer:`${j}__table-container`,tableContainerWithAttachments:`${j}__table-container--attachments`,tableNavigation:`${j}__table-navigation`,attachmentsView:$,attachmentsViewContent:`${$}__content`,attachmentsViewDropArea:`${$}__drop-area`,attachmentsViewIcon:`${$}__icon`,attachmentsViewInformation:`${$}__information`,attachmentsViewList:`${$}__list`,attachmentsViewListFileSize:`${$}__list__filesize`,attachmentsViewListItemDelete:`${$}__list-item--delete`,attachmentsViewListThumbnail:`${$}__list__thumbnail`,expanded:`${j}__expanded`,collapsed:`${j}__collapsed`,promptContainer:z,promptHeader:`${z}__header`,promptHeading:`${z}__header__heading`,promptMessage:`${z}__message`,promptDivider:`${z}__divider`,promptActions:`${z}__actions`},B={attachment:"attachment",chevronDown:"chevron-down",chevronLeft:"chevron-left",chevronRight:"chevron-right",clearSelection:"clear-selection",downloadTo:"download-to",exclamationMarkTriangle:"exclamation-mark-triangle",exportToCSV:"file-csv",folderOpen:"folder-open",delete:"trash",launch:"launch",layers:"layers",moveUp:"move-up",plus:"plus",refresh:"refresh",replaceImage:"replace-image",save:"save",showAll:"selection-x",showColumn:"show-column",showSelected:"selection-filter",upload:"upload",zoomToSelection:"zoom-to-object"};let H=L=class extends u{constructor(e,t){super(e,t),this._attachmentsInput=null,this._columnVisibilityActions=new Map,this.attachmentsList=null,this.description=null,this.disabled=!1,this.menuConfig=null,this.title=null,this.viewModel=new f,this.visibleElements=new _,this._showDeletePrompt=this._showDeletePrompt.bind(this),this._onDeleteSelectionClick=this._onDeleteSelectionClick.bind(this)}initialize(){this.addHandles([i((()=>[this.isQueryingOrSyncing,this.editingEnabled]),(()=>this.scheduleRender())),i((()=>[this._effectiveVisibleElements,this._effectiveVisibleElements.columnDescriptions,this._effectiveVisibleElements.columnMenus,this._effectiveVisibleElements.columnMenuItems,this.columns.length]),(()=>{this.columns.forEach((e=>e.visibleElements=this._effectiveVisibleElements)),this.refreshCellContent()}),l),i((()=>this._effectiveVisibleElements.selectionColumn),(e=>{this.grid&&(this.grid.selectionColumnEnabled=e)}),o),n((()=>this.viewModel),"show-related-table",(e=>this._onShowRelatedTable(e))),i((()=>this.editingEnabled),(()=>{const{attachmentsViewOptions:e}=this;this.clearPrompt(),e&&(e.form?.reset(),e.candidates=null)}))])}loadDependencies(){return Promise.all([E({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),alert:()=>import("@esri/calcite-components/dist/components/calcite-alert"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),pagination:()=>import("@esri/calcite-components/dist/components/calcite-pagination"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),progress:()=>import("@esri/calcite-components/dist/components/calcite-progress"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")}),w(),C()])}destroy(){this.drainRelatedTables(),this.clearPrompt()}get _effectiveDescription(){const{description:e}=this;return null!=e?R.sanitize("function"==typeof e?e():e):void 0}get _effectiveLayers(){const{layer:e,layers:t}=this,i=t?.length?t.filter(A):[],l=i.length?i:[...this._viewLayers];return e&&!l.includes(e)&&l.push(e),l}get _effectiveTitle(){const{layer:e,messages:t,state:i,highlightIds:l,title:o,size:n}=this;if(o)return R.sanitize("function"==typeof o?o():o);if(!e)return t.noLayer;switch(i){case"disabled":return t.errorLayer;case"ready":case"loading":return t.loading;case"error":return t.errorData}return F(t.header,{title:R.sanitize(e.title),count:n,selected:l.length})}get _effectiveVisibleElements(){return this.visibleElementsOverride??this.visibleElements}get _filteredTables(){const e=this.relatedTables.toArray(),t=1===e.length;return this.allRelatedTablesVisible?e:t?[e[0]]:this._shouldShowAttachmentsView?e.slice(-1):e.slice(-2)}get _hasAttachmentsViewError(){return null!=this.attachmentsViewOptions.error}get _hasCustomMenuItems(){return!!this.menuConfig?.items?.length}get _hasDefaultMenuItems(){return!!(this._showClearSelectionAction||this._showDeleteSelectionAction||this._showExportSelectionToCSVAction||this._showRefreshDataAction||this._showZoomToSelectionAction||this._showSelectedRecordsShowSelectedAction||this._showSelectedRecordsShowAllAction||this._showColumnsVisibilityAction)}get _shouldShowGrid(){return this.allRelatedTablesVisible||1===this.relatedTables.length&&!this._shouldShowAttachmentsView}get _shouldShowMenu(){const{header:e,menu:t}=this._effectiveVisibleElements;return!(!e||!t||!this._hasDefaultMenuItems&&!this._hasCustomMenuItems)}get _shouldShowAttachmentsView(){return!(null==this.attachmentsViewOptions.objectId&&!this.relatedTables.some((e=>null!=e.attachmentsViewOptions.objectId)))}get _showClearSelectionAction(){return!(!this.highlightIds.length||!this._effectiveVisibleElements.menuItems?.clearSelection||this.relatedTables.length)}get _showColumnsVisibilityAction(){const{header:e,menu:t,menuItems:i}=this._effectiveVisibleElements;return!(!(e&&t&&i?.toggleColumns)||this.showRelatedTableCallback||this.allRelatedTablesVisible||this._shouldShowAttachmentsView)}get _showDeleteSelectionAction(){return!(!(this.editingEnabled&&this.highlightIds.length&&this._effectiveVisibleElements.menuItems?.deleteSelection&&this.layer?.capabilities?.operations?.supportsDelete)||this.relatedTables.length)}get _showExportSelectionToCSVAction(){return!(!(this._effectiveVisibleElements.menuItems.exportSelectionToCSV&&this.layer&&this.highlightIds.length)||this.relatedTables.length)}get _showLayerDropdown(){return!(!this._effectiveLayers.length||!this._effectiveVisibleElements.layerDropdown)}get _shouldShowNavigationBar(){const e=!!this.relatedTable||this._shouldShowAttachmentsView;return!this.tableParent&&e}get _showRefreshDataAction(){return!!this._effectiveVisibleElements.menuItems?.refreshData}get _showSelectedRecordsShowSelectedAction(){const e=this.objectIds.length,t=this.highlightIds.length;return!(!t||!this._effectiveVisibleElements.menuItems?.selectedRecordsShowSelectedToggle||e&&t===e||this.relatedTables.length)}get _showSelectedRecordsShowAllAction(){return!(!this._effectiveVisibleElements.menuItems?.selectedRecordsShowAllToggle||!this.objectIds.length||this.relatedTables.length)}get _showZoomToSelectionAction(){return!(!this.view||!this.highlightIds.length||this.effectiveTable.layer?.isTable||!this._effectiveVisibleElements.menuItems?.zoomToSelection)}get _viewLayers(){const e=this.view?.map;if(!e)return[];const t=new Set,i=e=>{!A(e)||p(e)||t.has(e)||(e.load(),t.add(e))},l=e=>{c(e)||"catalog-footprint"===e.type||(d(e)?(e.load(),e.layers?.forEach(i),e.tables?.forEach(i)):h(e)?(e.loadAll(),e.sublayers?.forEach(i),e.subtables?.forEach(i)):p(e)?(e.loadAll(),e.sublayers?.forEach(i)):i(e))};return e.allLayers.forEach(l),e.allTables.forEach(l),[...t.values()]}get grid(){return this.viewModel.grid}get actionColumn(){return this.viewModel.actionColumn}get actionColumnConfig(){return this.viewModel.actionColumnConfig}set actionColumnConfig(e){this.viewModel.actionColumnConfig=e}get activeFilters(){return this.viewModel.activeFilters}get activeSortOrders(){return this.viewModel.activeSortOrders}get allColumns(){return this.viewModel.allColumns}get allRelatedTablesVisible(){return this.viewModel.allRelatedTablesVisible}get allVisibleColumns(){return this.viewModel.allVisibleColumns}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get attachmentsViewOptions(){return this.viewModel.attachmentsViewOptions}set attachmentsViewOptions(e){this.viewModel.attachmentsViewOptions=e}get attributeTableTemplate(){return this.viewModel.attributeTableTemplate}set attributeTableTemplate(e){this.viewModel.attributeTableTemplate=e}get autoRefreshEnabled(){return this.viewModel.autoRefreshEnabled}set autoRefreshEnabled(e){this.viewModel.autoRefreshEnabled=e}get clearPrompt(){return this.viewModel.clearPrompt}set clearPrompt(e){this.viewModel.clearPrompt=e}get columnPerformanceModeEnabled(){return this.viewModel.columnPerformanceModeEnabled}set columnPerformanceModeEnabled(e){this.viewModel.columnPerformanceModeEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get columns(){return this.viewModel.columns}get definitionExpression(){return this.viewModel.definitionExpression}set definitionExpression(e){this.viewModel.definitionExpression=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveSize(){return this.viewModel.effectiveSize}get effectiveTable(){return this.relatedTable||this}get filterGeometry(){return this.viewModel.filterGeometry}set filterGeometry(e){this.viewModel.filterGeometry=e}get filterBySelectionEnabled(){return this.viewModel.filterBySelectionEnabled}set filterBySelectionEnabled(e){this.viewModel.filterBySelectionEnabled=e}get hiddenFields(){return this.viewModel.hiddenFields}set hiddenFields(e){this.viewModel.hiddenFields=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get icon(){return"table"}set icon(e){this._overrideIfSome("icon",e)}get initialSize(){return this.viewModel.initialSize}set initialSize(e){this.viewModel.initialSize=e}get isQueryingOrSyncing(){return this.viewModel.isQueryingOrSyncing}get isSyncingAttachments(){return this.viewModel.isSyncingAttachments}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get layerView(){return this.viewModel.layerView}get maxSize(){return this.viewModel.maxSize}set maxSize(e){this.viewModel.maxSize=e}get messages(){return this.viewModel.messages}set messages(e){this.viewModel.messages=e}get messagesCommon(){return this.viewModel.messagesCommon}set messagesCommon(e){this.viewModel.messagesCommon=e}get messagesUnits(){return this.viewModel.messagesUnits}set messagesUnits(e){this.viewModel.messagesUnits=e}get messagesURIUtils(){return this.viewModel.messagesURIUtils}set messagesURIUtils(e){this.viewModel.messagesURIUtils=e}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get multipleSortPriority(){return this.viewModel.multipleSortPriority}set multipleSortPriority(e){this.viewModel.multipleSortPriority=e}get noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get objectIds(){return this.viewModel.objectIds}set objectIds(e){this.viewModel.objectIds=e}get outFields(){return this.viewModel.outFields}set outFields(e){this.viewModel.outFields=e}get pageCount(){return this.viewModel.pageCount}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get paginationEnabled(){return this.viewModel.paginationEnabled}set paginationEnabled(e){this.viewModel.paginationEnabled=e}get prompt(){return this.viewModel.prompt}set prompt(e){this.viewModel.prompt=e}get relatedRecordsEnabled(){return this.viewModel.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.viewModel.relatedRecordsEnabled=e}get relatedTable(){return this.viewModel.relatedTable}get relatedTables(){return this.viewModel.relatedTables}set relatedTables(e){this.viewModel.relatedTables=e}get relationship(){return this.viewModel.relationship}get relationshipColumnConfigs(){return this.viewModel.relationshipColumnConfigs}set relationshipColumnConfigs(e){this.viewModel.relationshipColumnConfigs=e}get relationshipConfig(){return this.viewModel.relationshipConfig}set relationshipConfig(e){this.viewModel.relationshipConfig=e}get relationshipInfos(){return this.viewModel.relationshipInfos}get returnGeometryEnabled(){return this.viewModel.returnGeometryEnabled}set returnGeometryEnabled(e){this.viewModel.returnGeometryEnabled=e}get returnMEnabled(){return this.viewModel.returnMEnabled}set returnMEnabled(e){this.viewModel.returnMEnabled=e}get returnZEnabled(){return this.viewModel.returnZEnabled}set returnZEnabled(e){this.viewModel.returnZEnabled=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get selectionSource(){return this.viewModel.selectionSource}set selectionSource(e){this.viewModel.selectionSource=e}get showAllRelatedTables(){return this.viewModel.showAllRelatedTables}set showAllRelatedTables(e){this.viewModel.showAllRelatedTables=e}get showPrompt(){return this.viewModel.showPrompt}set showPrompt(e){this.viewModel.showPrompt=e}get showRelatedTableCallback(){return this.viewModel.showRelatedTableCallback}set showRelatedTableCallback(e){this.viewModel.showRelatedTableCallback=e}get size(){return this.viewModel.size}get state(){return this.viewModel.state}get supportsAddAttachments(){return this.viewModel.supportsAddAttachments}get supportsAttachments(){return this.viewModel.supportsAttachments}get supportsDeleteAttachments(){return this.viewModel.supportsDeleteAttachments}get supportsResizeAttachments(){return this.viewModel.supportsResizeAttachments}get supportsUpdateAttachments(){return this.viewModel.supportsUpdateAttachments}get syncTemplateOnChangesEnabled(){return this.viewModel.syncTemplateOnChangesEnabled}set syncTemplateOnChangesEnabled(e){this.viewModel.syncTemplateOnChangesEnabled=e}get tableController(){return this.viewModel.tableController}set tableController(e){this.viewModel.tableController=e}get tableParent(){return this.viewModel.tableParent}set tableParent(e){this.viewModel.tableParent=e}get tableTemplate(){return this.viewModel.tableTemplate}set tableTemplate(e){this.viewModel.tableTemplate=e}get tableTemplateOverride(){return this.viewModel.tableTemplateOverride}set tableTemplateOverride(e){this.viewModel.tableTemplateOverride=e}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(e){this.viewModel.timeExtent=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visibleColumns(){return this.viewModel.visibleColumns}get visibleElementsOverride(){const{attachmentsViewOptions:e,relatedTable:t,tableController:i,visibleElements:l}=this,{columnDescriptions:o,columnMenus:n,tooltips:s}=l,a=null!=e.objectId;if(t)return new _({columnDescriptions:o,columnMenus:n,tooltips:s,close:l.close,header:l.header,layerDropdown:l.layerDropdown,layerDropdownIcons:l.layerDropdownIcons,menu:l.menu,menuItems:l.menuItems,progress:l.progress,selectionColumn:!1,columnMenuItems:new y({sortAscending:!1,sortDescending:!1})});if(i){const e=i.relatedTable===this,t=i.allRelatedTablesVisible,r=e&&l.selectionColumn&&!t&&!a,c=e&&!t&&!a;return new _({columnDescriptions:o,columnMenus:n,tooltips:s,selectionColumn:r,close:!1,header:!1,layerDropdown:!1,menu:!1,progress:!1,columnMenuItems:new y({sortAscending:c,sortDescending:c})})}return a?new _({columnDescriptions:o,columnMenus:n,tooltips:s,close:l.close,header:l.header,layerDropdown:l.layerDropdown,layerDropdownIcons:l.layerDropdownIcons,menu:l.menu,menuItems:l.menuItems,progress:l.progress,selectionColumn:!1,columnMenuItems:new y({sortAscending:!1,sortDescending:!1})}):null}clearSelectionFilter(){this.viewModel.clearSelectionFilter()}async deleteAttachments(e,t,i){null!=e&&t?.length&&(i?this._showDeleteAttachmentPrompt(e,t):await this.viewModel.deleteAttachments(e,t))}deleteSelection(e){return this.highlightIds.length?e?(this._showDeletePrompt(),this.scheduleRender(),Promise.resolve()):this.viewModel.deleteSelection():Promise.resolve()}async downloadAttachmentById(e,t){return this.viewModel.downloadAttachmentById(e,t)}drainRelatedTables(){this.viewModel.drainRelatedTables()}exportSelectionToCSV(e){return this.viewModel.exportSelectionToCSV(e)}filterBySelection(){this.viewModel.filterBySelection()}findColumn(e){return this.viewModel.findColumn(e)}goToPage(e){this.viewModel.goToPage(e)}hideColumn(e){this.grid?.hideColumn(e)}nextPage(){this.viewModel.nextPage()}previousPage(){this.viewModel.previousPage()}async refresh(){await this.viewModel.refresh()}refreshCellContent(){this.viewModel.refreshCellContent()}async saveAttachmentsViewForm(){await this.viewModel.saveAttachmentsViewForm()}showAllColumns(){this.viewModel.showAllColumns()}showColumn(e){this.grid?.showColumn(e)}sortColumn(e,t){this.viewModel.sortColumn(e,t)}scrollLeft(){this.viewModel.scrollLeft()}scrollToBottom(){this.viewModel.scrollToBottom()}scrollToIndex(e){this.viewModel.scrollToIndex(e)}scrollToRow(e){this.viewModel.scrollToRow(e)}scrollToTop(){this.viewModel.scrollToTop()}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}zoomToSelection(){this.effectiveTable.viewModel.zoomToSelection()}render(){const{_effectiveVisibleElements:e,isQueryingOrSyncing:t,menuConfig:i,state:l}=this;return O("div",{bind:this,class:this.classes(U.base,I.widget)},O("calcite-panel",{bind:this,class:U.content,closable:e.close,description:this._effectiveDescription,disabled:this.disabled||"disabled"===l&&!this._effectiveLayers?.length,heading:e.header?this._effectiveTitle:void 0,loading:"loading"===l,menuOpen:!!i?.open,overlayPositioning:"fixed",onCalcitePanelClose:e=>{e.currentTarget.closed=!1,this.emit("close")}},e.progress?O("calcite-progress",{type:t?"indeterminate":"determinate"}):null,this._showLayerDropdown?this._renderLayerDropdown():null,this._renderColumnVisibilityAction(),this._renderHeaderMenuActions(),this._renderNavigationBar(),this._renderTables(),this._renderError()),this._renderColumnVisibilityPopover(),this._renderPrompt())}_renderTables(){const{grid:e,relatedTables:t}=this,i=this.classes(U.tableContainer);if(t.length){const l=this.classes(U.base,this.allRelatedTablesVisible?U.expanded:U.collapsed,this._shouldShowAttachmentsView?U.tableContainerWithAttachments:void 0);return O("div",{class:i},O("calcite-panel",{overlayPositioning:"fixed"},O("div",null,[this._shouldShowGrid?O("div",{class:l},e?.render(),this._renderPagination()):void 0,...this._filteredTables.map((e=>{const i=t.indexOf(e);return O("div",{class:l,key:`related-${i}`},e.render())})),,])))}return null!=this.attachmentsViewOptions.objectId?O("div",{class:i},O("calcite-panel",{overlayPositioning:"fixed"},O("div",null,[O("div",{class:this.classes(U.base,U.collapsed)},e?.render(),this._renderPagination()),this._renderAttachmentsView()]))):[O("div",{class:i},e?.render()),this._renderPagination()]}_renderPagination(){if(this.paginationEnabled)return O("calcite-pagination",{pageSize:1,startItem:this.pageIndex+1,totalItems:this.pageCount,onCalcitePaginationChange:e=>this.goToPage(e.currentTarget.startItem-1)})}_renderError(){const{messages:e}=this;return O("calcite-alert",{autoClose:!0,autoCloseDuration:"fast",icon:B.exclamationMarkTriangle,kind:"danger",label:e.errorOccured,open:this._hasAttachmentsViewError,slot:"alerts",onCalciteAlertClose:()=>{this.attachmentsViewOptions.error=null}},O("span",{slot:"message"},e.errorOccured))}_renderPrompt(){return this.prompt?O(v,{...this.prompt,headingLevel:2}):void 0}_showDeletePrompt(){const{messages:e,messagesCommon:t}=this,i=F(e.deleteSelectionCount,{count:this.highlightIds.length});this.showPrompt({title:i,message:e.deleteRecordsRemoved,context:"danger",actions:{primary:{label:t.delete,action:this._onDeleteSelectionClick},secondary:{label:e.keepRecords,action:()=>this.clearPrompt()}}})}_showDeleteAttachmentPrompt(e,t){const{messages:i,messagesCommon:l}=this,o=F(i.deleteAttachmentCount,{count:t.length});this.showPrompt({title:o,message:i.deleteAttachmentConfirmation,context:"danger",actions:{primary:{label:l.delete,action:async()=>{try{await this.deleteAttachments(e,t,!1)}finally{this.clearPrompt()}}},secondary:{label:l.cancel,action:()=>this.clearPrompt()}}})}async _onDeleteSelectionClick(){try{await this.viewModel.deleteSelection()}finally{this.clearPrompt()}}_renderHeaderMenuAction(e){const{disabled:t,hidden:i,icon:l,text:o,clickFunction:n}=e;if(!i)return O("calcite-action",{disabled:t??this.menuConfig?.disabled,icon:l??void 0,key:o,onclick:()=>n(),slot:"header-menu-actions",text:o,textEnabled:!0,title:o})}_renderHeaderMenuActions(){return this._shouldShowMenu?[this._renderDefaultHeaderMenuActions(),this._renderCustomHeaderMenuActions()]:[]}_renderDefaultHeaderMenuActions(){if(!this._hasDefaultMenuItems)return[];const{messages:e}=this;return[this._showRefreshDataAction&&{icon:B.refresh,text:e.refreshData,clickFunction:()=>this.refresh()},this._showDeleteSelectionAction&&{icon:B.delete,text:e.deleteSelection,clickFunction:()=>this.deleteSelection(!0)},this._showClearSelectionAction&&{icon:B.clearSelection,text:e.clearSelection,clickFunction:()=>this.highlightIds?.removeAll()},this._showZoomToSelectionAction&&{icon:B.zoomToSelection,text:e.zoomToSelection,clickFunction:()=>this.zoomToSelection()},this._showSelectedRecordsShowSelectedAction&&{icon:B.showSelected,text:e.showSelected,clickFunction:()=>{const{objectIds:e}=this;e.removeAll(),e.addMany(this.highlightIds.toArray())}},this._showSelectedRecordsShowAllAction&&{icon:B.showAll,text:e.showAllRecords,clickFunction:()=>this.objectIds.removeAll()},this._showExportSelectionToCSVAction&&{icon:B.exportToCSV,text:e.exportSelectionCSV,clickFunction:()=>this.exportSelectionToCSV()}].filter(t).map((e=>e&&this._renderHeaderMenuAction(e)))}_renderCustomHeaderMenuActions(){return this.menuConfig?.items?.map((({disabled:e,hidden:t,icon:i,label:l,clickFunction:o})=>this._renderHeaderMenuAction({hidden:"function"==typeof t?t():t,icon:i,text:l,disabled:e,clickFunction:e=>o(e)})))??[]}_renderColumnVisibilityAction(){if(!this._showColumnsVisibilityAction)return[];const{_columnVisibilityActions:e,effectiveTable:t,id:i}=this,l=this.messages.toggleColumns;return O("calcite-action",{afterCreate:t=>e.set(i,t),afterRemoved:()=>e.delete(i),appearance:"transparent",bind:this,disabled:t.menuConfig?.disabled,icon:B.showColumn,id:`${i}__toggle-columns-action`,slot:"header-actions-end",text:l},this._effectiveVisibleElements.tooltips?O("calcite-tooltip",{closeOnClick:!0,overlayPositioning:"fixed",placement:"bottom-end",slot:"tooltip"},l):null)}_renderColumnVisibilityPopover(){if(!this._showColumnsVisibilityAction||this.effectiveTable.menuConfig?.disabled)return;const{effectiveTable:e}=this,t=this.messages.toggleColumns;return O("calcite-popover",{autoClose:!0,class:U.menuPopover,label:t,overlayPositioning:"fixed",placement:"top-end",pointerDisabled:!0,referenceElement:this._columnVisibilityActions.get(this.id)},O("calcite-list",{displayMode:"nested",filterEnabled:!0,filterPlaceholder:t,label:t,selectionMode:"multiple"},e.columns.toArray().map((t=>{const i=M(t)?t.columns?.map((t=>this._renderColumnListItem({column:t,table:e,ignoreSelect:!0}))):void 0;return this._renderColumnListItem({column:t,table:e,items:i})}))))}_renderColumnListItem(e){const{column:t,table:i,items:l,ignoreSelect:o}=e,{effectiveLabel:n,fieldName:s,hidden:a}=t;return O("calcite-list-item",{expanded:!(!l?.length||a)||void 0,key:`toggle-columns__item-${s}`,label:n,selected:!a,value:s,onCalciteListItemSelect:e=>{o&&e.stopPropagation(),i.toggleColumnVisibility(e.currentTarget.value)}},l)}_renderLayerDropdown(){const e=this.messages.selectALayer;return O("div",{class:U.layerDropdownMenu,key:`${this.id}-layerDropdown`,slot:"header-actions-start"},O("calcite-dropdown",{bind:this,maxItems:5,overlayPositioning:"fixed",placement:"bottom-start"},O("calcite-action",{icon:B.layers,slot:"trigger",text:e,title:e}),O("calcite-dropdown-group",{selectionMode:"single"},this._effectiveLayers.map(((e,t)=>this._renderLayerDropdownItem(e,t)))??null)))}_renderLayerDropdownItem(e,t){const i=this.visibleElements.layerDropdownIcons;return O("calcite-dropdown-item",{iconStart:i?V(e):void 0,key:`dropdown-item-${t}`,label:e.title??"",selected:e===this.layer,value:e.id,onCalciteDropdownItemSelect:()=>{this.layer=e}},e.title)}_onRelatedNavigationItemClick(e){this.viewModel.drainRelatedTablesAboveIndex(e)}_collapseRelatedTable(e){this.viewModel.collapseRelatedTable(this.effectiveTable,e)}_onShowRelatedTable(e){this.showRelatedTableCallback||(this._collapseRelatedTable(e),this._createRelatedTable(e))}async _createRelatedTable(e){const{editingEnabled:t,effectiveTable:i,paginationEnabled:l,pageSize:o,view:n,viewModel:s}=this,{layer:a,objectId:r,relatedLayer:c,relationshipId:d}=e;await a.load();const h=this.attachmentsEnabled&&S(a),p=new L({layer:a,attachmentsEnabled:h,editingEnabled:t,paginationEnabled:l,pageSize:o,relatedRecordsEnabled:!0,relationshipConfig:{objectId:r,relatedLayer:c,relationshipId:d},relationshipColumnConfigs:T(a,d),tableController:this,tableParent:i,view:n,showRelatedTableCallback:e=>s.emit("show-related-table",e)});this.relatedTables.add(p),this.scheduleRender()}_renderAttachmentsView(){const{attachmentInfos:e,mode:t,objectId:i}=this.attachmentsViewOptions;return"file"!==t&&e.length&&null!=i?this._renderAttachmentsViewList():this._renderAttachmentsViewFilePane()}_renderAttachmentsViewFilePane(){const{attachmentsViewOptions:e,isSyncingAttachments:t,supportsAddAttachments:i,messages:l,messagesUnits:o}=this,{attachmentId:n,attachmentInfos:a,candidates:r,objectId:c}=e,d=a.find((e=>e.id===n)),h=a.length,p=r?.length,m=d?O("calcite-label",{alignment:"center",key:"replace-file-node",scale:"l"},l.replaceFile):void 0,u=p?void 0:O("calcite-label",{alignment:"center",key:"message-node",scale:"m"},i?null==c?l.noFeature:l.dragAndDropToUpload:l.editingRestricted),g=Array.from(r??[]).pop(),b=g?O("calcite-label",{key:"filename-node"},g.name):void 0,w=i&&null!=c,v=w&&p,y=O("input",{afterCreate:x,afterRemoved:k,afterUpdate:x,bind:this,"data-node-ref":"_attachmentsInput",files:r,hidden:!0,name:"attachment",onchange:e=>this._onAttachmentsViewCandidateChange(e),type:"file"}),f=w?O("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:B.folderOpen,key:"select-node",loading:!1,onclick:()=>{this._attachmentsInput&&(this._attachmentsInput.value="",this._attachmentsInput.click())},width:"full"},l.selectFile):void 0,_=v?O("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:B.save,key:"save-node",loading:t,onclick:()=>{this.saveAttachmentsViewForm()},width:"full"},d?l.updateAttachment:l.addAttachment):void 0,M=h||p?O("calcite-button",{appearance:"transparent",bind:this,disabled:t,key:"cancel-node",onclick:()=>{this._attachmentsInput&&(this._attachmentsInput.value=""),e.reset(),e.attachmentInfos?.length&&(e.mode="list")},width:"full"},this.messagesCommon.cancel):void 0;return[O("div",{class:U.attachmentsView,key:"attachments-view"},O("div",{class:U.attachmentsViewContent,key:"attachments-view-content"},O("div",{bind:this,class:U.attachmentsViewDropArea,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},O("calcite-icon",{class:U.attachmentsViewIcon,icon:B.upload,scale:"l"}),m,u,O("form",{afterCreate:t=>e.form=t,afterRemoved:()=>e.form=null,bind:this,key:"attachments-form"},O("fieldset",null,b,y,f,_,M)))),null!=c&&null!=d?O("div",{class:U.attachmentsViewInformation,key:"information"},this._renderAttachmentsViewThumbnail(d,200),O("label",{key:"file-label"},l.fileName),O("span",{key:"file-span"},d.name),O("label",{key:"size-label"},l.size),O("span",{key:"size-span"},s(o,d.size??0))):void 0)]}_renderAttachmentsViewList(){const{attachmentsViewOptions:e,isSyncingAttachments:t,messages:i,messagesUnits:l,supportsDeleteAttachments:o,supportsUpdateAttachments:n}=this,{attachmentInfos:a,objectId:r}=e;return O("calcite-list",{afterCreate:x,afterRemoved:k,afterUpdate:x,bind:this,class:U.attachmentsViewList,"data-node-ref":"attachmentsList",key:`attachments-list-${r}`,label:i?.attachments,loading:t,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop,selectionMode:"multiple",onCalciteListChange:()=>this.scheduleRender()},...a?.map((t=>{const{id:a,name:c,size:d,url:h}=t,p=s(l,d??0);return O("calcite-list-item",{afterRemoved:()=>this.scheduleRender(),key:`attachment-${a}`,label:c,value:a},this._renderAttachmentsViewListThumbnail(t),O("span",{class:U.attachmentsViewListFileSize,slot:"actions-end",title:p},p),O("calcite-action",{appearance:"transparent",icon:B.downloadTo,key:`download-attachment-${a}`,label:`${c}`,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(r??-1,a)},slot:"actions-end",text:i.downloadAttachment,title:i.downloadAttachment}),n&&null!=r?O("calcite-action",{appearance:"transparent",disabled:!n,icon:B.replaceImage,key:`replace-attachment-${a}`,label:`${c}`,onclick:()=>{e.mode="file",e.attachmentId=a},slot:"actions-end",text:i.updateAttachment,title:i.updateAttachment}):void 0,O("calcite-action",{appearance:"transparent",icon:B.launch,key:`launch-attachment-${a}`,label:`${c}`,onclick:()=>{h&&window.open(h,"_blank")},slot:"actions-end",text:i.viewAttachment,title:i.viewAttachment}),o&&null!=r?O("calcite-action",{appearance:"transparent",class:U.attachmentsViewListItemDelete,disabled:!o,icon:B.delete,key:`delete-attachment-${a}`,label:`${c}`,onclick:()=>{this.deleteAttachments(r,[a],!0)},slot:"actions-end",text:i.deleteAttachment,title:i.deleteAttachment}):void 0)})))}_renderAttachmentsViewListThumbnail(e){return O("div",{class:U.attachmentsViewListThumbnail,slot:"content-start"},O("a",{href:e.url??"",rel:"noreferrer",target:"_blank"},this._renderAttachmentsViewThumbnail(e)))}_renderAttachmentsViewThumbnail(e,t=64){const{contentType:i,name:l,size:o,url:n}=e,s=`${n}${n?.includes("?")?"&":"?"}w=${t}&s=${o}`;return this.supportsResizeAttachments&&g(i)?O("img",{alt:l,key:`thumbnail-image-${l}`,src:s,title:l}):O("calcite-icon",{icon:b(i),key:`thumbnail-icon-${l}`,scale:"l",textLabel:l,title:l})}_onAttachmentsViewCandidateChange({target:e}){this.attachmentsViewOptions.candidates=e?.files}_onAttachmentsViewDrop(e){e.preventDefault(),(this.supportsAddAttachments||this.supportsUpdateAttachments)&&this.attachmentsViewOptions.set({mode:"file",candidates:e.dataTransfer?.files})}_renderNavigationBar(){const{effectiveTable:e,messages:t,messagesCommon:i,relatedTable:l,relatedTables:o}=this;if(!this._shouldShowNavigationBar)return;const{attachmentsList:n,attachmentsViewOptions:s,layer:a,supportsAddAttachments:r,supportsDeleteAttachments:c}=e;if(!a)return;const{attachmentInfos:d,objectId:h}=s,p=null!=h,m=d.length,u=n?.selectedItems?.length??0,g=`${a.objectIdField}: ${h}`,b=F(t.selectedCount,{count:u}),w=F(t.attachmentsCount,{count:m}),v=p?O("calcite-action",{bind:this,icon:B.chevronRight,iconFlipRtl:!0,key:"navigation-feature",onclick:()=>e.scrollToRow(h),text:g,textEnabled:!0,title:g}):void 0,y=p?O("calcite-action",{icon:B.chevronRight,iconFlipRtl:!0,key:"navigation-attachments-label",label:w,onclick:()=>{m>0&&(s.mode="list")},text:w,textEnabled:!0,title:w}):void 0,f=p?O("calcite-chip",{closable:!0,closed:0===u,key:"navigation-chip",kind:"inverse",label:b,selected:!0,title:b,value:"selected",onCalciteChipClose:()=>n?.selectedItems?.forEach((e=>e.selected=!1))},b):void 0,_=l?O("calcite-label",{layout:"inline"},t.showAllTables,O("calcite-switch",{checked:this.allRelatedTablesVisible,onCalciteSwitchChange:e=>this.showAllRelatedTables=!!e.currentTarget.checked})):void 0,M=p&&"list"===s.mode&&null!=h&&u&&c?O("calcite-action",{icon:B.delete,iconFlipRtl:!0,key:"attachments-trash-all",onclick:()=>{e.deleteAttachments(h,n?.selectedItems?.map((e=>e.value))??[],!0)},text:i.delete,textEnabled:!0,title:F(t.deleteAttachmentCount,{count:u})}):void 0,C=p&&"list"===s.mode&&r?O("calcite-action",{bind:this,icon:B.plus,iconFlipRtl:!0,key:"attachments-add",onclick:()=>{s.attachmentId=null,s.mode="file"},text:t.addAttachment,textEnabled:!0,title:t.addAttachment}):void 0;return O("div",{class:U.tableNavigation,key:"table-nav"},O("calcite-action",{icon:B.moveUp,iconFlipRtl:!0,key:"go-back",onclick:()=>{l&&this.drainRelatedTables(),e.attachmentsViewOptions.objectId=null},text:this.layer?.title??"",textEnabled:!1,title:l?t.exitRelatedRecords:t.exitAttachments}),o.toArray().map(((e,t)=>this._renderRelatedTableNavigationAction(e,t))),v,y,O("div",null,f,_,M,C))}_renderRelatedTableNavigationAction(e,t){const i=this._getLabelForRelatedTableNavigationAction(e);return O("calcite-action",{icon:B.chevronRight,iconFlipRtl:!0,key:t,onclick:()=>this._onRelatedNavigationItemClick(t),text:i,textEnabled:!0,title:e.layer?.title||""})}_getLabelForRelatedTableNavigationAction(e){const t=e.layer?.title;if(!t)return"";const{relatedTables:i}=this;if(i.length<=1)return t;return i.indexOf(e)!==i.length-1&&t.length>20?`${t.slice(0,20)}...`:t}};e([a()],H.prototype,"_attachmentsInput",void 0),e([a()],H.prototype,"_columnVisibilityActions",void 0),e([a()],H.prototype,"_effectiveDescription",null),e([a()],H.prototype,"_effectiveLayers",null),e([a()],H.prototype,"_effectiveTitle",null),e([a()],H.prototype,"_effectiveVisibleElements",null),e([a()],H.prototype,"_filteredTables",null),e([a()],H.prototype,"_hasAttachmentsViewError",null),e([a()],H.prototype,"_hasCustomMenuItems",null),e([a()],H.prototype,"_hasDefaultMenuItems",null),e([a()],H.prototype,"_shouldShowGrid",null),e([a()],H.prototype,"_shouldShowMenu",null),e([a()],H.prototype,"_shouldShowAttachmentsView",null),e([a()],H.prototype,"_showClearSelectionAction",null),e([a()],H.prototype,"_showColumnsVisibilityAction",null),e([a()],H.prototype,"_showDeleteSelectionAction",null),e([a()],H.prototype,"_showExportSelectionToCSVAction",null),e([a()],H.prototype,"_showLayerDropdown",null),e([a()],H.prototype,"_shouldShowNavigationBar",null),e([a()],H.prototype,"_showRefreshDataAction",null),e([a()],H.prototype,"_showSelectedRecordsShowSelectedAction",null),e([a()],H.prototype,"_showSelectedRecordsShowAllAction",null),e([a()],H.prototype,"_showZoomToSelectionAction",null),e([a()],H.prototype,"_viewLayers",null),e([a()],H.prototype,"attachmentsList",void 0),e([a({readOnly:!0})],H.prototype,"grid",null),e([a()],H.prototype,"actionColumn",null),e([a()],H.prototype,"actionColumnConfig",null),e([a({readOnly:!0})],H.prototype,"activeFilters",null),e([a({readOnly:!0})],H.prototype,"activeSortOrders",null),e([a()],H.prototype,"allColumns",null),e([a({readOnly:!0})],H.prototype,"allRelatedTablesVisible",null),e([a()],H.prototype,"allVisibleColumns",null),e([a()],H.prototype,"attachmentsEnabled",null),e([a()],H.prototype,"attachmentsViewOptions",null),e([a({type:m})],H.prototype,"attributeTableTemplate",null),e([a()],H.prototype,"autoRefreshEnabled",null),e([a()],H.prototype,"clearPrompt",null),e([a()],H.prototype,"columnPerformanceModeEnabled",null),e([a()],H.prototype,"columnReorderingEnabled",null),e([a({readOnly:!0})],H.prototype,"columns",null),e([a()],H.prototype,"definitionExpression",null),e([a()],H.prototype,"description",void 0),e([a()],H.prototype,"disabled",void 0),e([a()],H.prototype,"editingEnabled",null),e([a()],H.prototype,"effectiveSize",null),e([a()],H.prototype,"effectiveTable",null),e([a()],H.prototype,"filterGeometry",null),e([a()],H.prototype,"filterBySelectionEnabled",null),e([a()],H.prototype,"hiddenFields",null),e([a()],H.prototype,"highlightEnabled",null),e([a()],H.prototype,"highlightIds",null),e([a()],H.prototype,"icon",null),e([a()],H.prototype,"initialSize",null),e([a()],H.prototype,"isQueryingOrSyncing",null),e([a()],H.prototype,"isSyncingAttachments",null),e([a()],H.prototype,"label",null),e([a()],H.prototype,"layer",null),e([a()],H.prototype,"layers",null),e([a()],H.prototype,"layerView",null),e([a()],H.prototype,"maxSize",null),e([a(),D("esri/widgets/FeatureTable/t9n/FeatureTable")],H.prototype,"messages",null),e([a(),D("esri/t9n/common")],H.prototype,"messagesCommon",null),e([a(),D("esri/core/t9n/Units")],H.prototype,"messagesUnits",null),e([a(),D("esri/widgets/support/t9n/uriUtils")],H.prototype,"messagesURIUtils",null),e([a()],H.prototype,"menuConfig",void 0),e([a()],H.prototype,"multipleSelectionEnabled",null),e([a()],H.prototype,"multiSortEnabled",null),e([a()],H.prototype,"multipleSortPriority",null),e([a()],H.prototype,"noDataMessage",null),e([a()],H.prototype,"objectIds",null),e([a()],H.prototype,"outFields",null),e([a()],H.prototype,"pageCount",null),e([a()],H.prototype,"pageIndex",null),e([a()],H.prototype,"pageSize",null),e([a()],H.prototype,"paginationEnabled",null),e([a()],H.prototype,"prompt",null),e([a()],H.prototype,"relatedRecordsEnabled",null),e([a()],H.prototype,"relatedTable",null),e([a()],H.prototype,"relatedTables",null),e([a()],H.prototype,"relationship",null),e([a()],H.prototype,"relationshipColumnConfigs",null),e([a()],H.prototype,"relationshipConfig",null),e([a()],H.prototype,"relationshipInfos",null),e([a()],H.prototype,"returnGeometryEnabled",null),e([a()],H.prototype,"returnMEnabled",null),e([a()],H.prototype,"returnZEnabled",null),e([a()],H.prototype,"rowHighlightIds",null),e([a()],H.prototype,"selectionSource",null),e([a()],H.prototype,"showAllRelatedTables",null),e([a()],H.prototype,"showPrompt",null),e([a()],H.prototype,"showRelatedTableCallback",null),e([a()],H.prototype,"size",null),e([a({readOnly:!0})],H.prototype,"state",null),e([a()],H.prototype,"supportsAddAttachments",null),e([a()],H.prototype,"supportsAttachments",null),e([a()],H.prototype,"supportsDeleteAttachments",null),e([a()],H.prototype,"supportsResizeAttachments",null),e([a()],H.prototype,"supportsUpdateAttachments",null),e([a()],H.prototype,"syncTemplateOnChangesEnabled",null),e([a({constructOnly:!0})],H.prototype,"tableController",null),e([a({constructOnly:!0})],H.prototype,"tableParent",null),e([a()],H.prototype,"tableTemplate",null),e([a()],H.prototype,"tableTemplateOverride",null),e([a()],H.prototype,"title",void 0),e([a()],H.prototype,"timeExtent",null),e([a()],H.prototype,"timeZone",null),e([a()],H.prototype,"view",null),e([a({type:f}),P(["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder","show-related-table"])],H.prototype,"viewModel",void 0),e([a()],H.prototype,"visibleColumns",null),e([a({type:_,nonNullable:!0})],H.prototype,"visibleElements",void 0),e([a({type:_})],H.prototype,"visibleElementsOverride",null),H=L=e([r("esri.widgets.FeatureTable")],H);const N=H;export{N as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import r from"../../core/Logger.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";let o=class extends t{constructor(e){super(e),this._vendorInfo=null,this._fullscreenStyle="width: 100%; height: 100%;",this.view=null,this._errorHandler=this._errorHandler.bind(this),this._stateHandler=this._stateHandler.bind(this)}destroy(){this._removeFullscreenListeners(),this.view=null}get element(){return this.view?.container??null}set element(e){this._override("element",e)}get state(){return this.element?this._isSupported()?this._isActive()?"active":"ready":"feature-unsupported":"disabled"}enter(){this._enterFullscreen()}exit(){this._exitFullscreen()}toggle(){this._isActive()?this._exitFullscreen():this._enterFullscreen()}_isSupported(){this._removeFullscreenListeners();const e=this._getVendorInfo(this.element);return this._addFullscreenListeners(e),this._vendorInfo=e,!!e}_isActive(){return!!this._vendorInfo&&!!document[this._vendorInfo.propertyName]}_stateHandler(){this.notifyChange("state"),"active"===this.state?this._addStyle():this._removeStyle()}_errorHandler(e){r.getLogger(this).error("fullscreen request failed",e)}_getVendorInfo(e){if(e)return e.requestFullscreen?{enterName:"requestFullscreen",exitName:"exitFullscreen",errorEventName:"fullscreenerror",changeEventName:"fullscreenchange",propertyName:"fullscreen"}:e.webkitRequestFullScreen?{enterName:"webkitRequestFullscreen",exitName:"webkitCancelFullScreen",errorEventName:"webkitfullscreenerror",changeEventName:"webkitfullscreenchange",propertyName:"webkitIsFullScreen"}:e.mozRequestFullScreen?{enterName:"mozRequestFullScreen",exitName:"mozCancelFullScreen",errorEventName:"mozfullscreenerror",changeEventName:"mozfullscreenchange",propertyName:"mozFullScreen"}:void 0}_enterFullscreen(){if("feature-unsupported"===this.state)return void r.getLogger(this).warn("The fullscreen API is not supported in this browser.");const{element:e}=this;e&&(this._vendorInfo&&e[this._vendorInfo.enterName].call(e),this.notifyChange("state"))}_addStyle(){const{element:e}=this;e&&e.setAttribute("style",this._fullscreenStyle)}_removeStyle(){const{element:e}=this;e&&e.removeAttribute("style")}_exitFullscreen(){if("feature-unsupported"===this.state)return;const{element:e}=this;e&&(this._vendorInfo&&document[this._vendorInfo.exitName].call(document),this.notifyChange("state"))}_addFullscreenListeners(e){e&&(document.addEventListener(e.changeEventName,this._stateHandler),document.addEventListener(e.errorEventName,this._errorHandler))}_removeFullscreenListeners(){const{_vendorInfo:e}=this;e&&(document.removeEventListener(e.changeEventName,this._stateHandler),document.removeEventListener(e.errorEventName,this._errorHandler))}};e([s()],o.prototype,"element",null),e([s({readOnly:!0})],o.prototype,"state",null),e([s()],o.prototype,"view",void 0),e([s()],o.prototype,"enter",null),e([s()],o.prototype,"exit",null),e([s()],o.prototype,"toggle",null),o=e([n("esri.widgets.Fullscreen.FullscreenViewModel")],o);const l=o;export{l as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{deprecatedModule as r}from"../../core/deprecate.js";import s from"../../core/Logger.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";let o=class extends t{constructor(e){super(e),this._vendorInfo=null,this._fullscreenStyle="width: 100%; height: 100%;",this.view=null,this._errorHandler=this._errorHandler.bind(this),this._stateHandler=this._stateHandler.bind(this),e?.isDefaultViewModel||r(s.getLogger("esri.widgets.Fullscreen.FullscreenViewModel"),"esri.widgets.Fullscreen.FullscreenViewModel",{replacement:"Fullscreen API",version:"4.33",see:"https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API",warnOnce:!0})}normalizeCtorArgs(e={}){const{isDefaultViewModel:t,...r}=e;return r}destroy(){this._removeFullscreenListeners(),this.view=null}get element(){return this.view?.container??null}set element(e){this._override("element",e)}get state(){return this.element?this._isSupported()?this._isActive()?"active":"ready":"feature-unsupported":"disabled"}enter(){this._enterFullscreen()}exit(){this._exitFullscreen()}toggle(){this._isActive()?this._exitFullscreen():this._enterFullscreen()}_isSupported(){this._removeFullscreenListeners();const e=this._getVendorInfo(this.element);return this._addFullscreenListeners(e),this._vendorInfo=e,!!e}_isActive(){return!!this._vendorInfo&&!!document[this._vendorInfo.propertyName]}_stateHandler(){this.notifyChange("state"),"active"===this.state?this._addStyle():this._removeStyle()}_errorHandler(e){s.getLogger(this).error("fullscreen request failed",e)}_getVendorInfo(e){if(e)return e.requestFullscreen?{enterName:"requestFullscreen",exitName:"exitFullscreen",errorEventName:"fullscreenerror",changeEventName:"fullscreenchange",propertyName:"fullscreen"}:e.webkitRequestFullScreen?{enterName:"webkitRequestFullscreen",exitName:"webkitCancelFullScreen",errorEventName:"webkitfullscreenerror",changeEventName:"webkitfullscreenchange",propertyName:"webkitIsFullScreen"}:e.mozRequestFullScreen?{enterName:"mozRequestFullScreen",exitName:"mozCancelFullScreen",errorEventName:"mozfullscreenerror",changeEventName:"mozfullscreenchange",propertyName:"mozFullScreen"}:void 0}_enterFullscreen(){if("feature-unsupported"===this.state)return void s.getLogger(this).warn("The fullscreen API is not supported in this browser.");const{element:e}=this;e&&(this._vendorInfo&&e[this._vendorInfo.enterName].call(e),this.notifyChange("state"))}_addStyle(){const{element:e}=this;e&&e.setAttribute("style",this._fullscreenStyle)}_removeStyle(){const{element:e}=this;e&&e.removeAttribute("style")}_exitFullscreen(){if("feature-unsupported"===this.state)return;const{element:e}=this;e&&(this._vendorInfo&&document[this._vendorInfo.exitName].call(document),this.notifyChange("state"))}_addFullscreenListeners(e){e&&(document.addEventListener(e.changeEventName,this._stateHandler),document.addEventListener(e.errorEventName,this._errorHandler))}_removeFullscreenListeners(){const{_vendorInfo:e}=this;e&&(document.removeEventListener(e.changeEventName,this._stateHandler),document.removeEventListener(e.errorEventName,this._errorHandler))}};e([n()],o.prototype,"element",null),e([n({readOnly:!0})],o.prototype,"state",null),e([n()],o.prototype,"view",void 0),e([n()],o.prototype,"enter",null),e([n()],o.prototype,"exit",null),e([n()],o.prototype,"toggle",null),o=e([l("esri.widgets.Fullscreen.FullscreenViewModel")],o);const i=o;export{i as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{deprecateWidget as t}from"../core/deprecate.js";import s from"../core/Logger.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import i from"./Widget.js";import l from"./Fullscreen/FullscreenViewModel.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as p}from"./support/decorators/messageBundle.js";import{tsx as a}from"./support/jsxFactory.js";const d={base:"esri-fullscreen"};let u=class extends i{constructor(e,o){super(e,o),this.messages=null,this.viewModel=new l,this._toggle=()=>{this.viewModel.toggle()},t(s.getLogger(this),"Fullscreen","arcgis-fullscreen",{version:"4.32"})}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button")})}get element(){return this.viewModel.element}set element(e){this.viewModel.element=e}get fullscreenTitle(){const e=this.viewModel?.state;return"active"===e?this.messages.exit:"ready"===e?this.messages.enter:""}get icon(){const e=this.viewModel?.state;return"ready"===e||"disabled"===e||"feature-unsupported"===e?"zoom-out-fixed":"zoom-in-fixed"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{fullscreenTitle:e,icon:t}=this,s=this.viewModel?.state,o="feature-unsupported"===s;return a("div",{class:this.classes(d.base,c.widget)},!o&&a("calcite-button",{class:c.widgetButton,disabled:"disabled"===s,iconStart:t,kind:"neutral",label:e,onclick:this._toggle,title:e}))}};e([o()],u.prototype,"element",null),e([o({readOnly:!0})],u.prototype,"fullscreenTitle",null),e([o()],u.prototype,"icon",null),e([o()],u.prototype,"label",null),e([o(),p("esri/widgets/Fullscreen/t9n/Fullscreen")],u.prototype,"messages",void 0),e([o()],u.prototype,"view",null),e([o({type:l})],u.prototype,"viewModel",void 0),u=e([r("esri.widgets.Fullscreen")],u);const m=u;export{m as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{deprecateWidget as t}from"../core/deprecate.js";import s from"../core/Logger.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import i from"./Widget.js";import l from"./Fullscreen/FullscreenViewModel.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as p}from"./support/decorators/messageBundle.js";import{tsx as a}from"./support/jsxFactory.js";const d={base:"esri-fullscreen"};let u=class extends i{constructor(e,o){super(e,o),this.messages=null,this.viewModel=new l({isDefaultViewModel:!0}),this._toggle=()=>{this.viewModel.toggle()},t(s.getLogger(this),"Fullscreen","arcgis-fullscreen",{version:"4.32"})}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button")})}get element(){return this.viewModel.element}set element(e){this.viewModel.element=e}get fullscreenTitle(){const e=this.viewModel?.state;return"active"===e?this.messages.exit:"ready"===e?this.messages.enter:""}get icon(){const e=this.viewModel?.state;return"ready"===e||"disabled"===e||"feature-unsupported"===e?"zoom-out-fixed":"zoom-in-fixed"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{fullscreenTitle:e,icon:t}=this,s=this.viewModel?.state,o="feature-unsupported"===s;return a("div",{class:this.classes(d.base,c.widget)},!o&&a("calcite-button",{class:c.widgetButton,disabled:"disabled"===s,iconStart:t,kind:"neutral",label:e,onclick:this._toggle,title:e}))}};e([o()],u.prototype,"element",null),e([o({readOnly:!0})],u.prototype,"fullscreenTitle",null),e([o()],u.prototype,"icon",null),e([o()],u.prototype,"label",null),e([o(),p("esri/widgets/Fullscreen/t9n/Fullscreen")],u.prototype,"messages",void 0),e([o()],u.prototype,"view",null),e([o({type:l})],u.prototype,"viewModel",void 0),u=e([r("esri.widgets.Fullscreen")],u);const m=u;export{m as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{isLayerFromCatalog as n,isCatalogSublayer as o}from"../../layers/catalog/catalogUtils.js";import{getActionIcon as s,getActionStyles as a}from"../../support/actions/actionUtils.js";import l from"../Widget.js";import{getStatusIcon as r,listItemHasChildren as c,areChildrenHidden as d,canSortSublayers as p,getSingleAction as m,getItem as u,getVisibilityIcon as g}from"./support/layerListUtils.js";import{loadCalciteComponents as y}from"../support/componentsUtils.js";import{tsx as h}from"../support/jsxFactory.js";import{setFocus as b}from"../support/widgetUtils.js";import{substitute as v}from"../../intl/substitute.js";var _;let I=class extends l{static{_=this}constructor(e){super(e),this.dragEnabled=!1,this.listModeDisabled=!1,this.parent=null,this.parentTitles=null,this.viewModel=null,this._onActionMenuOpen=e=>{this.item.actionsOpen=e.currentTarget.open},this._setTooltipReference=e=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,e)},this._removeTooltipReference=()=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,null)}}loadDependencies(){return y({"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}static{this.vnodeSelector="calcite-list-item"}render(){const e=this.parentTitles??[],{_title:t,item:i,activeItem:n,selectionMode:o,selectedItems:s,messages:a,parent:l,css:r}=this,c="visibleAtCurrentTimeExtent"in i&&"layerInvisibleAtTime"in a&&!i.visibleAtCurrentTimeExtent?`${t} (${a.layerInvisibleAtTime})`:"visibleAtCurrentScale"in i&&"layerInvisibleAtScale"in a&&!i.visibleAtCurrentScale?`${t} (${a.layerInvisibleAtScale})`:t,d="parent"in i&&"catalog"===i.parent?.layer?.type,{layer:p}=i,m="visibleAtCurrentScale"in i&&!i.visibleAtCurrentScale||"visibleAtCurrentTimeExtent"in i&&!i.visibleAtCurrentTimeExtent;return h("calcite-list-item",{afterCreate:e=>this._focusSelectedDragEl(e,i),afterUpdate:e=>this._focusSelectedDragEl(e,i),class:this.classes(r.item,"itemActive"in r&&{[r.itemActive]:n===i}),"data-item":i,"data-layer-id":p?.id,dragDisabled:!i.sortable||d,expanded:"open"in i&&i.open,id:p?.uid,key:`list-item-${p?.uid}`,label:t,metadata:{parentTitles:e,_title:t},selected:"none"!==o&&s.includes(i),title:c,unavailable:m,value:p?.uid,onCalciteListItemSelect:e=>"visible"in i&&this._handleCalciteListItemSelect(e,i,l),onCalciteListItemToggle:e=>"open"in i&&this._handleCalciteListItemToggle(e,i)},this._renderedCatalogFootprintIcon,this._renderedCatalogDynamicIcon,this._renderedItemStatus,this._renderedItemToggle,this._renderedCatalogSelectNode,this._renderedItemTemporaryIcon,this._renderedChildList,this._renderedItemMessage,this._renderedPanel,this._renderedPanelAction,this._renderedActions)}get _title(){const{messages:e}=this;return this.item.title||("untitledTable"in e?e.untitledTable:e.untitledLayer)}get _renderedItemStatus(){const{item:e,parent:t,visibleElements:i,css:n}=this;if(!i.statusIndicators)return null;const{publishing:o}=e,s="updating"in e&&e.updating&&!t,a="connectionStatus"in e?e.connectionStatus:void 0,l=!!a;return h("calcite-icon",{class:this.classes(n.statusIndicator,{[n.publishing]:o},"updating"in n&&{[n.updating]:s},"connectionStatus"in n&&{[n.connectionStatus]:l},"connectionStatusConnected"in n&&{[n.connectionStatusConnected]:l&&"connected"===a}),icon:r({connectionStatus:a,publishing:o}),key:"layer-item-status",scale:"s",slot:"content-end"})}get _renderedItemTemporaryIcon(){const{item:e,visibleElements:t,css:i}=this,{layer:o}=e,s="temporaryLayerIndicators"in t&&t.temporaryLayerIndicators,a="temporaryTableIndicators"in t&&t.temporaryTableIndicators,l=o&&"persistenceEnabled"in o&&(n(o)||!o.persistenceEnabled);return(s||a)&&l?h("calcite-icon",{class:i.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"content-start",title:this.messages.temporary}):null}get _renderedItemToggle(){const{_title:e,item:t,parent:i,messages:n,visibilityAppearance:o,css:s}=this;if(!("visible"in t&&"layerVisibility"in n&&"showLayer"in n&&"hideLayer"in n&&"visibleToggle"in s&&o))return null;const{visible:a}=t,l=this._getParentVisibilityMode(i);if("inherited"===l)return null;const r=g({visible:a,exclusive:"exclusive"===l,visibilityAppearance:o}),c="checkbox"===o,d=n.layerVisibility,p=v(a?n.hideLayer:n.showLayer,{layerName:e});return h("calcite-action",{appearance:"transparent",class:s.visibleToggle,icon:c?r:void 0,key:"visibility-toggle",label:p,onclick:()=>this._toggleVisibility(t,i),scale:"s",slot:c?"actions-start":"actions-end",text:d,title:p},c?null:h("calcite-icon",{class:this.classes({[s.visibleIcon]:"exclusive"!==l&&a}),icon:r,scale:"s"}))}get _renderedPanel(){const{panel:e}=this.item;return!e?.open||e.disabled||e.flowEnabled?null:h("div",{class:this.css.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}get _renderedPanelAction(){const{panel:e}=this.item;if(!e?.visible)return null;const{open:t,title:i,disabled:n}=e;return h("calcite-action",{active:t,appearance:"transparent",disabled:n,icon:s(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),scale:"s",slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}get _renderedActions(){switch(this._actionsCount){case 0:return null;case 1:return this._singleAction;default:return this._renderedActionMenu}}get _renderedActionMenu(){const{item:e,messagesCommon:t}=this,i=t.options;return h("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:t.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",scale:"s",slot:"actions-end",onCalciteActionMenuOpen:this._onActionMenuOpen},h("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:"s",slot:"trigger",text:i,title:i}),this._renderedActionMenuContent)}get _renderedActionMenuContent(){return this._filteredSections.toArray().map((e=>h("calcite-action-group",{key:`action-section-${e.uid}`},e.toArray().map((e=>this._renderAction({action:e,textEnabled:!0}))))))}get _renderedCatalogFootprintIcon(){const{css:e}=this,t=this.item.layer,i="catalog-footprint"===t?.type,n="sublayer"===t?.type&&o(t,"footprints");return"itemCatalogIcon"in e&&(i||n)?h("calcite-icon",{class:e.itemCatalogIcon,icon:"footprint",key:"footprint",scale:"s",slot:"content-start"}):null}get _renderedCatalogDynamicIcon(){const{css:e}=this,t=this.item.layer,i="catalog-dynamic-group"===t?.type,n="sublayer"===t?.type&&o(t,"layers-in-view");return"itemCatalogIcon"in e&&(i||n)?h("calcite-icon",{class:e.itemCatalogIcon,icon:"catalog-dataset",key:"catalog-dataset",scale:"s",slot:"content-start"}):null}get _renderedCatalogSelectNode(){const{_title:e,item:t,visibleElements:i}=this;if(!("visible"in t))return;const{layer:n}=t,o="catalog-dynamic-group"===n?.type;return"catalogLayerList"in i&&i.catalogLayerList&&o?h("calcite-action",{appearance:"transparent",disabled:!n.visible,icon:"chevron-right",iconFlipRtl:!0,onclick:()=>this._triggerOnCatalogOpen(t),scale:"s",slot:"actions-end",text:e}):null}get _renderedChildList(){const{dragEnabled:e,item:t,rootGroupUid:i,listModeDisabled:n,selectionMode:o,displayMode:s}=this;if(!("children"in t))return;const a=[...this.parentTitles??[],t.title],{children:l,layer:r}=t,m="catalog-dynamic-group"!==r?.type&&c(t),u=!n&&d(r),g="group"===r?.type,y=!u&&!m&&e&&g,b=!!e&&("childrenSortable"in t&&t.childrenSortable&&p(t));return m||y?h("calcite-list",{canPull:e=>!!this.canMove&&this.canMove(e,"pull"),canPut:e=>!!this.canMove&&this.canMove(e,"put"),"data-item":t,"data-layer-type":i,displayMode:s,dragEnabled:b,group:g?i:`${i}-${r?.uid}`,key:`child-list-${r?.uid}`,label:t.title,selectionAppearance:"border",selectionMode:o},l?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error))).toArray().map((e=>this._renderItem(e,t,a))),this._renderedTablesItem):null}get _hasTables(){const{layerTablesEnabled:e}=this,t=this.item.layer;if(!e||!t)return!1;switch(t.type){case"knowledge-graph":return e.includes(t.type)&&"tables"in t&&!!t.tables?.length;case"map-image":case"tile":return e.includes(t.type)&&"subtables"in t&&!!t.subtables?.length;default:return!1}}get _renderedTablesItem(){const{item:e,messages:t,css:i}=this,{layer:n}=e;return"itemTableIcon"in i&&"visible"in e&&"tables"in t&&this._hasTables?h("calcite-list-item",{class:i.item,"data-layer-id":n?.id,dragDisabled:!0,key:`list-item-table-list-tables-${n?.uid}`,label:t.tables,title:t.tables,onCalciteListItemSelect:()=>this._triggerOnTablesOpen(e)},h("calcite-icon",{class:i.itemTableIcon,icon:"table",scale:"s",slot:"content-start"}),h("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"})):null}get _renderedItemMessage(){const{item:e,messages:t,css:i}=this;return e.error?h("div",{class:i.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},h("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},h("div",{slot:"message"},"tableError"in t?t.tableError:t.layerError))):"incompatible"in e&&e.incompatible&&"layerIncompatible"in t?h("div",{class:i.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},h("calcite-notice",{afterCreate:this._setTooltipReference,afterRemoved:this._removeTooltipReference,bind:this,icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},h("div",{slot:"message"},t.layerIncompatible))):null}get _singleAction(){return this._renderAction({action:m(this._filteredSections),textEnabled:!1})}get _filteredSections(){return this.item.actionsSections.map((e=>e.filter((e=>e.visible))))}get _actionsCount(){return this.item.actionsSections.reduce(((e,t)=>e+t.length),0)}_renderAction(e){const{item:t}=this,{action:i,textEnabled:n}=e;if(!i)return null;const{active:o,disabled:a,title:l,type:r,indicator:c}=i;return h("calcite-action",{active:"toggle"===r&&i.value,appearance:"transparent","data-action-id":i.id,disabled:a,icon:s(i),indicator:c,key:`action-${i.uid}`,loading:o,onclick:()=>this._triggerAction(t,i),scale:"s",slot:n?void 0:"actions-end",text:l??"",textEnabled:n,title:l??void 0},this._renderFallbackIcon(i))}_renderFallbackIcon(e){const{css:t}=this,{className:i,icon:n}=e;if(n)return null;const o="image"in e?e.image:void 0,s={[t.itemActionIcon]:!!i,[t.itemActionImage]:!!o};return i&&(s[i]=!0),o||i?h("span",{"aria-hidden":"true",class:this.classes(t.itemActionIcon,s),key:"icon",styles:a(o)}):null}_renderItem(e,t,i=[]){return h(_,{activeItem:this.activeItem,canMove:this.canMove,css:this.css,displayMode:this.displayMode,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this.rootGroupUid,selectedDragItemLayerUid:this.selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this.onAction,onCatalogOpen:this.onCatalogOpen,onPanelOpen:this.onPanelOpen,onSelectedDragItemLayerUidChange:this.onSelectedDragItemLayerUidChange,onTablesOpen:this.onTablesOpen,onTooltipReferenceChange:this.onTooltipReferenceChange})}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.onAction(t,e))}_triggerOnTablesOpen(e){e&&this.onTablesOpen&&this.onTablesOpen(e)}_triggerOnCatalogOpen(e){e&&this.onCatalogOpen?.(e)}_focusSelectedDragEl(e,t){this.selectedDragItemLayerUid===t.layer?.uid&&(b(e),this.onSelectedDragItemLayerUidChange?.(null))}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.open}_getParentVisibilityMode(e){return e&&"visibilityMode"in e?e.visibilityMode:null}_handleCalciteListItemSelect(e,t,i){if(u(e.target)!==t)return;const n=this._getParentVisibilityMode(i);"none"===this.selectionMode&&"inherited"!==n&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&this.onPanelOpen()}_toggleVisibility(e,t){if(!e||!("visible"in e))return;"exclusive"===this._getParentVisibilityMode(t)&&e.visible||(e.visible=!e.visible)}};e([t()],I.prototype,"activeItem",void 0),e([t()],I.prototype,"canMove",void 0),e([t()],I.prototype,"css",void 0),e([t()],I.prototype,"displayMode",void 0),e([t()],I.prototype,"dragEnabled",void 0),e([t()],I.prototype,"item",void 0),e([t()],I.prototype,"layerTablesEnabled",void 0),e([t()],I.prototype,"listModeDisabled",void 0),e([t()],I.prototype,"messages",void 0),e([t()],I.prototype,"messagesCommon",void 0),e([t()],I.prototype,"onAction",void 0),e([t()],I.prototype,"onPanelOpen",void 0),e([t()],I.prototype,"onCatalogOpen",void 0),e([t()],I.prototype,"onTablesOpen",void 0),e([t()],I.prototype,"onSelectedDragItemLayerUidChange",void 0),e([t()],I.prototype,"onTooltipReferenceChange",void 0),e([t()],I.prototype,"parent",void 0),e([t()],I.prototype,"parentTitles",void 0),e([t()],I.prototype,"rootGroupUid",void 0),e([t()],I.prototype,"selectionMode",void 0),e([t()],I.prototype,"selectedItems",void 0),e([t()],I.prototype,"selectedDragItemLayerUid",void 0),e([t()],I.prototype,"visibleElements",void 0),e([t()],I.prototype,"visibilityAppearance",void 0),e([t()],I.prototype,"_title",null),e([t()],I.prototype,"_renderedItemStatus",null),e([t()],I.prototype,"_renderedItemTemporaryIcon",null),e([t()],I.prototype,"_renderedItemToggle",null),e([t()],I.prototype,"_renderedPanel",null),e([t()],I.prototype,"_renderedPanelAction",null),e([t()],I.prototype,"_renderedActions",null),e([t()],I.prototype,"_renderedActionMenu",null),e([t()],I.prototype,"_renderedActionMenuContent",null),e([t()],I.prototype,"_renderedCatalogFootprintIcon",null),e([t()],I.prototype,"_renderedCatalogDynamicIcon",null),e([t()],I.prototype,"_renderedCatalogSelectNode",null),e([t()],I.prototype,"_renderedChildList",null),e([t()],I.prototype,"_hasTables",null),e([t()],I.prototype,"_renderedTablesItem",null),e([t()],I.prototype,"_renderedItemMessage",null),e([t()],I.prototype,"_singleAction",null),e([t()],I.prototype,"_filteredSections",null),e([t()],I.prototype,"_actionsCount",null),I=_=e([i("esri.widgets.LayerList.LayerListItem")],I);const C=I;export{C as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{isLayerFromCatalog as n,isCatalogSublayer as o}from"../../layers/catalog/catalogUtils.js";import{getActionIcon as s,getActionStyles as a}from"../../support/actions/actionUtils.js";import l from"../Widget.js";import{getStatusIcon as r,listItemHasChildren as c,areChildrenHidden as d,canSortSublayers as p,getSingleAction as m,getItem as u,getVisibilityIcon as g}from"./support/layerListUtils.js";import{loadCalciteComponents as y}from"../support/componentsUtils.js";import{tsx as h}from"../support/jsxFactory.js";import{setFocus as b}from"../support/widgetUtils.js";import{substitute as v}from"../../intl/substitute.js";var _;let I=class extends l{static{_=this}constructor(e){super(e),this.dragEnabled=!1,this.listModeDisabled=!1,this.parent=null,this.parentTitles=null,this.viewModel=null,this._onActionMenuOpen=e=>{this.item.actionsOpen=e.currentTarget.open},this._setTooltipReference=e=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,e)},this._removeTooltipReference=()=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,null)}}loadDependencies(){return y({"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}static{this.vnodeSelector="calcite-list-item"}render(){const e=this.parentTitles??[],{_title:t,item:i,activeItem:n,selectionMode:o,selectedItems:s,messages:a,parent:l,css:r}=this,c="visibleAtCurrentTimeExtent"in i&&"layerInvisibleAtTime"in a&&!i.visibleAtCurrentTimeExtent?`${t} (${a.layerInvisibleAtTime})`:"visibleAtCurrentScale"in i&&"layerInvisibleAtScale"in a&&!i.visibleAtCurrentScale?`${t} (${a.layerInvisibleAtScale})`:t,d="parent"in i&&"catalog"===i.parent?.layer?.type,{layer:p}=i,m="visibleAtCurrentScale"in i&&!i.visibleAtCurrentScale||"visibleAtCurrentTimeExtent"in i&&!i.visibleAtCurrentTimeExtent;return h("calcite-list-item",{afterCreate:e=>this._focusSelectedDragEl(e,i),afterUpdate:e=>this._focusSelectedDragEl(e,i),class:this.classes(r.item,"itemActive"in r&&{[r.itemActive]:n===i}),"data-item":i,"data-layer-id":p?.id,dragDisabled:!i.sortable||d,expanded:"open"in i&&i.open,id:p?.uid,key:`list-item-${p?.uid}`,label:t,metadata:{parentTitles:e,_title:t},selected:"none"!==o&&s.includes(i),title:c,unavailable:m,value:p?.uid,onCalciteListItemSelect:e=>"visible"in i&&this._handleCalciteListItemSelect(e,i,l),onCalciteListItemToggle:e=>"open"in i&&this._handleCalciteListItemToggle(e,i)},this._renderedCatalogFootprintIcon,this._renderedCatalogDynamicIcon,this._renderedItemStatus,this._renderedItemToggle,this._renderedCatalogSelectNode,this._renderedItemTemporaryIcon,this._renderedChildList,this._renderedItemMessage,this._renderedPanel,this._renderedPanelAction,this._renderedActions)}get _title(){const{messages:e}=this;return this.item.title||("untitledTable"in e?e.untitledTable:e.untitledLayer)}get _renderedItemStatus(){const{item:e,parent:t,visibleElements:i,css:n}=this;if(!i.statusIndicators)return null;const{publishing:o}=e,s="updating"in e&&e.updating&&!t,a="connectionStatus"in e?e.connectionStatus:void 0,l=!!a;return h("calcite-icon",{class:this.classes(n.statusIndicator,{[n.publishing]:o},"updating"in n&&{[n.updating]:s},"connectionStatus"in n&&{[n.connectionStatus]:l},"connectionStatusConnected"in n&&{[n.connectionStatusConnected]:l&&"connected"===a}),icon:r({connectionStatus:a,publishing:o}),key:"layer-item-status",scale:"s",slot:"content-end"})}get _renderedItemTemporaryIcon(){const{item:e,visibleElements:t,css:i}=this,{layer:o}=e,s="temporaryLayerIndicators"in t&&t.temporaryLayerIndicators,a="temporaryTableIndicators"in t&&t.temporaryTableIndicators,l=o&&"persistenceEnabled"in o&&(n(o)||!o.persistenceEnabled);return(s||a)&&l?h("calcite-icon",{class:i.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"content-start",title:this.messages.temporary}):null}get _renderedItemToggle(){const{_title:e,item:t,parent:i,messages:n,visibilityAppearance:o,css:s}=this;if(!("visible"in t&&"layerVisibility"in n&&"showLayer"in n&&"hideLayer"in n&&"visibleToggle"in s&&o))return null;const{visible:a}=t,l=this._getParentVisibilityMode(i);if("inherited"===l)return null;const r=g({visible:a,exclusive:"exclusive"===l,visibilityAppearance:o}),c="checkbox"===o,d=n.layerVisibility,p=v(a?n.hideLayer:n.showLayer,{layerName:e});return h("calcite-action",{appearance:"transparent",class:s.visibleToggle,icon:c?r:void 0,key:"visibility-toggle",label:p,onclick:()=>this._toggleVisibility(t,i),scale:"s",slot:c?"actions-start":"actions-end",text:d,title:p},c?null:h("calcite-icon",{class:this.classes({[s.visibleIcon]:"exclusive"!==l&&a}),icon:r,scale:"s"}))}get _renderedPanel(){const{panel:e}=this.item;return!e?.open||e.disabled||e.flowEnabled?null:h("div",{class:this.css.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}get _renderedPanelAction(){const{panel:e}=this.item;if(!e?.visible)return null;const{open:t,title:i,disabled:n}=e;return h("calcite-action",{active:t,appearance:"transparent",disabled:n,icon:s(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),scale:"s",slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}get _renderedActions(){switch(this._actionsCount){case 0:return null;case 1:return this._singleAction;default:return this._renderedActionMenu}}get _renderedActionMenu(){const{item:e,messagesCommon:t}=this,i=t.options;return h("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:t.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",scale:"s",slot:"actions-end",onCalciteActionMenuOpen:this._onActionMenuOpen},h("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:"s",slot:"trigger",text:i,title:i}),this._renderedActionMenuContent)}get _renderedActionMenuContent(){return this._filteredSections.toArray().map((e=>h("calcite-action-group",{key:`action-section-${e.uid}`},e.toArray().map((e=>this._renderAction({action:e,textEnabled:!0}))))))}get _renderedCatalogFootprintIcon(){const{css:e}=this,t=this.item.layer,i="catalog-footprint"===t?.type,n="sublayer"===t?.type&&o(t,"footprints");return"itemCatalogIcon"in e&&(i||n)?h("calcite-icon",{class:e.itemCatalogIcon,icon:"footprint",key:"footprint",scale:"s",slot:"content-start"}):null}get _renderedCatalogDynamicIcon(){const{css:e}=this,t=this.item.layer,i="catalog-dynamic-group"===t?.type,n="sublayer"===t?.type&&o(t,"layers-in-view");return"itemCatalogIcon"in e&&(i||n)?h("calcite-icon",{class:e.itemCatalogIcon,icon:"catalog-dataset",key:"catalog-dataset",scale:"s",slot:"content-start"}):null}get _renderedCatalogSelectNode(){const{_title:e,item:t,visibleElements:i}=this;if(!("visible"in t))return;const{layer:n}=t,o="catalog-dynamic-group"===n?.type;return"catalogLayerList"in i&&i.catalogLayerList&&o?h("calcite-action",{appearance:"transparent",disabled:!n.visible,icon:"chevron-right",iconFlipRtl:!0,onclick:()=>this._triggerOnCatalogOpen(t),scale:"s",slot:"actions-end",text:e}):null}get _renderedChildList(){const{dragEnabled:e,item:t,rootGroupUid:i,listModeDisabled:n,selectionMode:o,displayMode:s}=this;if(!("children"in t))return;const a=[...this.parentTitles??[],t.title],{children:l,layer:r}=t,m="catalog-dynamic-group"!==r?.type&&c(t),u=!n&&d(r),g="group"===r?.type,y=!u&&!m&&e&&g,b=!!e&&("childrenSortable"in t&&t.childrenSortable&&p(t));return m||y?h("calcite-list",{canPull:e=>!!this.canMove&&this.canMove(e,"pull"),canPut:e=>!!this.canMove&&this.canMove(e,"put"),"data-item":t,"data-layer-type":i,displayMode:s,dragEnabled:b,group:g?i:`${i}-${r?.uid}`,key:`child-list-${r?.uid}`,label:t.title,selectionAppearance:"border",selectionMode:o},l?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error))).toArray().map((e=>this._renderItem(e,t,a))),this._renderedTablesItem):null}get _hasTables(){const{layerTablesEnabled:e}=this,t=this.item.layer;if(!e||!t)return!1;switch(t.type){case"knowledge-graph":return e.includes(t.type)&&"tables"in t&&!!t.tables?.length;case"map-image":case"tile":return e.includes(t.type)&&"subtables"in t&&!!t.subtables?.length;default:return!1}}get _renderedTablesItem(){const{item:e,messages:t,css:i}=this,{layer:n}=e;return"itemTableIcon"in i&&"visible"in e&&"tables"in t&&this._hasTables?h("calcite-list-item",{class:i.item,"data-layer-id":n?.id,dragDisabled:!0,key:`list-item-table-list-tables-${n?.uid}`,label:t.tables,title:t.tables,onCalciteListItemSelect:()=>this._triggerOnTablesOpen(e)},h("calcite-icon",{class:i.itemTableIcon,icon:"table",scale:"s",slot:"content-start"}),h("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"})):null}get _renderedItemMessage(){const{item:e,messages:t,css:i}=this;return e.error?h("div",{class:i.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},h("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},h("div",{slot:"message"},"tableError"in t?t.tableError:t.layerError))):"incompatible"in e&&e.incompatible&&"layerIncompatible"in t?h("div",{class:i.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},h("calcite-notice",{afterCreate:this._setTooltipReference,afterRemoved:this._removeTooltipReference,bind:this,icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},h("div",{slot:"message"},t.layerIncompatible))):null}get _singleAction(){return this._renderAction({action:m(this._filteredSections),textEnabled:!1})}get _filteredSections(){return this.item.actionsSections.map((e=>e.filter((e=>e.visible))))}get _actionsCount(){return this.item.actionsSections.reduce(((e,t)=>e+t.length),0)}_renderAction(e){const{item:t}=this,{action:i,textEnabled:n}=e;if(!i)return null;const{active:o,disabled:a,title:l,type:r,indicator:c}=i;return h("calcite-action",{active:"toggle"===r&&i.value,appearance:"transparent","data-action-id":i.id,disabled:a,icon:s(i),indicator:c,key:`action-${i.uid}`,loading:o,onclick:()=>this._triggerAction(t,i),scale:"s",slot:n?void 0:"actions-end",text:l??"",textEnabled:n,title:l??void 0},this._renderFallbackIcon(i))}_renderFallbackIcon(e){const{css:t}=this,{icon:i}=e,n="className"in e?e.className:void 0;if(i)return null;const o="image"in e?e.image:void 0,s={[t.itemActionIcon]:!!n,[t.itemActionImage]:!!o};return n&&(s[n]=!0),o||n?h("span",{"aria-hidden":"true",class:this.classes(t.itemActionIcon,s),key:"icon",styles:a(o)}):null}_renderItem(e,t,i=[]){return h(_,{activeItem:this.activeItem,canMove:this.canMove,css:this.css,displayMode:this.displayMode,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this.rootGroupUid,selectedDragItemLayerUid:this.selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this.onAction,onCatalogOpen:this.onCatalogOpen,onPanelOpen:this.onPanelOpen,onSelectedDragItemLayerUidChange:this.onSelectedDragItemLayerUidChange,onTablesOpen:this.onTablesOpen,onTooltipReferenceChange:this.onTooltipReferenceChange})}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.onAction(t,e))}_triggerOnTablesOpen(e){e&&this.onTablesOpen&&this.onTablesOpen(e)}_triggerOnCatalogOpen(e){e&&this.onCatalogOpen?.(e)}_focusSelectedDragEl(e,t){this.selectedDragItemLayerUid===t.layer?.uid&&(b(e),this.onSelectedDragItemLayerUidChange?.(null))}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.open}_getParentVisibilityMode(e){return e&&"visibilityMode"in e?e.visibilityMode:null}_handleCalciteListItemSelect(e,t,i){if(u(e.target)!==t)return;const n=this._getParentVisibilityMode(i);"none"===this.selectionMode&&"inherited"!==n&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&this.onPanelOpen()}_toggleVisibility(e,t){if(!e||!("visible"in e))return;"exclusive"===this._getParentVisibilityMode(t)&&e.visible||(e.visible=!e.visible)}};e([t()],I.prototype,"activeItem",void 0),e([t()],I.prototype,"canMove",void 0),e([t()],I.prototype,"css",void 0),e([t()],I.prototype,"displayMode",void 0),e([t()],I.prototype,"dragEnabled",void 0),e([t()],I.prototype,"item",void 0),e([t()],I.prototype,"layerTablesEnabled",void 0),e([t()],I.prototype,"listModeDisabled",void 0),e([t()],I.prototype,"messages",void 0),e([t()],I.prototype,"messagesCommon",void 0),e([t()],I.prototype,"onAction",void 0),e([t()],I.prototype,"onPanelOpen",void 0),e([t()],I.prototype,"onCatalogOpen",void 0),e([t()],I.prototype,"onTablesOpen",void 0),e([t()],I.prototype,"onSelectedDragItemLayerUidChange",void 0),e([t()],I.prototype,"onTooltipReferenceChange",void 0),e([t()],I.prototype,"parent",void 0),e([t()],I.prototype,"parentTitles",void 0),e([t()],I.prototype,"rootGroupUid",void 0),e([t()],I.prototype,"selectionMode",void 0),e([t()],I.prototype,"selectedItems",void 0),e([t()],I.prototype,"selectedDragItemLayerUid",void 0),e([t()],I.prototype,"visibleElements",void 0),e([t()],I.prototype,"visibilityAppearance",void 0),e([t()],I.prototype,"_title",null),e([t()],I.prototype,"_renderedItemStatus",null),e([t()],I.prototype,"_renderedItemTemporaryIcon",null),e([t()],I.prototype,"_renderedItemToggle",null),e([t()],I.prototype,"_renderedPanel",null),e([t()],I.prototype,"_renderedPanelAction",null),e([t()],I.prototype,"_renderedActions",null),e([t()],I.prototype,"_renderedActionMenu",null),e([t()],I.prototype,"_renderedActionMenuContent",null),e([t()],I.prototype,"_renderedCatalogFootprintIcon",null),e([t()],I.prototype,"_renderedCatalogDynamicIcon",null),e([t()],I.prototype,"_renderedCatalogSelectNode",null),e([t()],I.prototype,"_renderedChildList",null),e([t()],I.prototype,"_hasTables",null),e([t()],I.prototype,"_renderedTablesItem",null),e([t()],I.prototype,"_renderedItemMessage",null),e([t()],I.prototype,"_singleAction",null),e([t()],I.prototype,"_filteredSections",null),e([t()],I.prototype,"_actionsCount",null),I=_=e([i("esri.widgets.LayerList.LayerListItem")],I);const C=I;export{C as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Identifiable.js";import{destroyMaybe as i}from"../../core/maybe.js";import{watch as n,initial as r}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import l from"../Widget.js";import{isSublayer as d}from"./support/layerListUtils.js";import{isWidget as a}from"../support/widget.js";import{tsx as p}from"../support/jsxFactory.js";let g=class extends(t.IdentifiableMixin(l)){constructor(e,t){super(e,t),this._legend=null,this.className=null,this.content=null,this.flowEnabled=!1,this.image=null,this.listItem=null,this.open=!1,this.visible=!0}initialize(){this.addHandles([n((()=>this._canCreateLegend),(()=>this._createLegend()),r),n((()=>[this._legend,this._legendOptions]),(()=>this._updateLegend()),r)])}destroy(){this._legend=i(this._legend)}get _canCreateLegend(){const{content:e,listItem:t}=this;if(!t)return!1;const i="legend";return e===i||null!=e&&!!Array.isArray(e)&&e.includes(i)}get _legendOptions(){const{listItem:e,_legendLayerInfo:t}=this,i=e?.view;return t&&i?{view:i,layerInfos:[t]}:{}}get _legendLayerInfo(){const e=this.listItem?.layer;if(!e||"subtype-sublayer"===e.type)return null;const t=d(e)?e:null,i=e?.parent,n=null!=i&&"type"in i&&"map-image"===i.type?t?.source:null,r="";return n&&i?{layer:i,title:r,sublayerIds:[n.mapLayerId]}:{layer:e,title:r}}get disabled(){const{listItem:e,_legend:t,content:i}=this;return!e||!(Array.isArray(i)&&i.length>1)&&(!!t&&(!t.activeLayerInfos?.length||!e.visibleAtCurrentScale||!e.visible))}set disabled(e){this._overrideIfSome("disabled",e)}get icon(){const{image:e}=this,t=this._getFirstWidget();return this._get("icon")??(!e&&t?t.icon:null)}set icon(e){this._overrideIfSome("icon",e)}get title(){return this._get("title")||(this._getFirstWidget()?.label??"")}set title(e){this._override("title",e)}render(){return p("div",{class:"esri-list-item-panel"},this._renderContents())}_renderContent(e){const{_legend:t,disabled:i,open:n}=this;return e&&!i&&n?"legend"===e&&t?p("div",{key:"legend-widget"},t.render()):"string"==typeof e?p("div",{innerHTML:e,key:e}):a(e)?p("div",{key:"content-widget"},e.render()):e instanceof HTMLElement?p("div",{afterCreate:this._attachToNode,bind:e,key:"content-element"}):null:null}_renderContents(){const{content:e,open:t}=this;return t?Array.isArray(e)?e.map((e=>this._renderContent(e))):this._renderContent(e):null}async _createLegend(){if(i(this._legend),this._legend=null,!this._canCreateLegend)return;const{default:e}=await import("../Legend.js"),t=new e(this._legendOptions);this._legend=t}_attachToNode(e){e.appendChild(this)}_updateLegend(){const e=this._legend;e&&e.set(this._legendOptions)}_getWidget(e){return"legend"===e?this._legend:a(e)?e:null}_getFirstWidget(){const{content:e}=this;return Array.isArray(e)?e.map((e=>this._getWidget(e))).find((e=>e)):this._getWidget(e)}};e([s()],g.prototype,"_legend",void 0),e([s()],g.prototype,"_canCreateLegend",null),e([s()],g.prototype,"_legendOptions",null),e([s()],g.prototype,"_legendLayerInfo",null),e([s()],g.prototype,"className",void 0),e([s()],g.prototype,"content",void 0),e([s()],g.prototype,"disabled",null),e([s()],g.prototype,"flowEnabled",void 0),e([s()],g.prototype,"icon",null),e([s()],g.prototype,"image",void 0),e([s()],g.prototype,"listItem",void 0),e([s()],g.prototype,"open",void 0),e([s()],g.prototype,"title",null),e([s()],g.prototype,"visible",void 0),g=e([o("esri.widgets.LayerList.ListItemPanel")],g);const c=g;export{c as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Identifiable.js";import{destroyMaybe as n}from"../../core/maybe.js";import{watch as i,initial as r}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import l from"../Widget.js";import{isSublayer as d}from"./support/layerListUtils.js";import{isWidget as a}from"../support/widget.js";import{tsx as p}from"../support/jsxFactory.js";let g=class extends(t.IdentifiableMixin(l)){constructor(e,t){super(e,t),this._legend=null,this.content=null,this.flowEnabled=!1,this.image=null,this.listItem=null,this.open=!1,this.visible=!0}initialize(){this.addHandles([i((()=>this._canCreateLegend),(()=>this._createLegend()),r),i((()=>[this._legend,this._legendOptions]),(()=>this._updateLegend()),r)])}destroy(){this._legend=n(this._legend)}get _canCreateLegend(){const{content:e,listItem:t}=this;if(!t)return!1;const n="legend";return e===n||null!=e&&!!Array.isArray(e)&&e.includes(n)}get _legendOptions(){const{listItem:e,_legendLayerInfo:t}=this,n=e?.view;return t&&n?{view:n,layerInfos:[t]}:{}}get _legendLayerInfo(){const e=this.listItem?.layer;if(!e||"subtype-sublayer"===e.type)return null;const t=d(e)?e:null,n=e?.parent,i=null!=n&&"type"in n&&"map-image"===n.type?t?.source:null,r="";return i&&n?{layer:n,title:r,sublayerIds:[i.mapLayerId]}:{layer:e,title:r}}get disabled(){const{listItem:e,_legend:t,content:n}=this;return!e||!(Array.isArray(n)&&n.length>1)&&(!!t&&(!t.activeLayerInfos?.length||!e.visibleAtCurrentScale||!e.visible))}set disabled(e){this._overrideIfSome("disabled",e)}get icon(){const{image:e}=this,t=this._getFirstWidget();return this._get("icon")??(!e&&t?t.icon:null)}set icon(e){this._overrideIfSome("icon",e)}get title(){return this._get("title")||(this._getFirstWidget()?.label??"")}set title(e){this._override("title",e)}render(){return p("div",{class:"esri-list-item-panel"},this._renderContents())}_renderContent(e){const{_legend:t,disabled:n,open:i}=this;return e&&!n&&i?"legend"===e&&t?p("div",{key:"legend-widget"},t.render()):"string"==typeof e?p("div",{innerHTML:e,key:e}):a(e)?p("div",{key:"content-widget"},e.render()):e instanceof HTMLElement?p("div",{afterCreate:this._attachToNode,bind:e,key:"content-element"}):null:null}_renderContents(){const{content:e,open:t}=this;return t?Array.isArray(e)?e.map((e=>this._renderContent(e))):this._renderContent(e):null}async _createLegend(){if(n(this._legend),this._legend=null,!this._canCreateLegend)return;const{default:e}=await import("../Legend.js"),t=new e(this._legendOptions);this._legend=t}_attachToNode(e){e.appendChild(this)}_updateLegend(){const e=this._legend;e&&e.set(this._legendOptions)}_getWidget(e){return"legend"===e?this._legend:a(e)?e:null}_getFirstWidget(){const{content:e}=this;return Array.isArray(e)?e.map((e=>this._getWidget(e))).find((e=>e)):this._getWidget(e)}};e([s()],g.prototype,"_legend",void 0),e([s()],g.prototype,"_canCreateLegend",null),e([s()],g.prototype,"_legendOptions",null),e([s()],g.prototype,"_legendLayerInfo",null),e([s()],g.prototype,"content",void 0),e([s()],g.prototype,"disabled",null),e([s()],g.prototype,"flowEnabled",void 0),e([s()],g.prototype,"icon",null),e([s()],g.prototype,"image",void 0),e([s()],g.prototype,"listItem",void 0),e([s()],g.prototype,"open",void 0),e([s()],g.prototype,"title",null),e([s()],g.prototype,"visible",void 0),g=e([o("esri.widgets.LayerList.ListItemPanel")],g);const c=g;export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import o from"../../core/Accessor.js";import{when as i}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends o{constructor(t){super(t),this._navigationMode="pan",this.view=null}initialize(){this.addHandles(i((()=>this.view?.navigation?.actionMap),(()=>this._updateNavigationActionMap())))}destroy(){this.view=null}get state(){return this.view?.ready&&"3d"===this.view?.type?"ready":"disabled"}get navigationMode(){return this._navigationMode}set navigationMode(t){this._navigationMode=t,this._updateNavigationActionMap()}toggle(){"disabled"!==this.state&&(this.navigationMode="pan"!==this.navigationMode?"pan":"rotate")}_updateNavigationActionMap(){const t=this.view?.navigation?.actionMap;if(!t)return;const o="pan"===this._navigationMode;t.dragPrimary=o?"pan":"rotate",t.dragSecondary=o?"rotate":"pan"}};t([a({readOnly:!0})],s.prototype,"state",null),t([a()],s.prototype,"_navigationMode",void 0),t([a()],s.prototype,"view",void 0),s=t([e("esri.widgets.NavigationToggle.NavigationToggleViewModel")],s);const r=s;export{r as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import o from"../../core/Accessor.js";import{deprecateUnnecessaryViewModel as i}from"../../core/deprecate.js";import e from"../../core/Logger.js";import{when as a}from"../../core/reactiveUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";let n=class extends o{constructor(t){super(t),this._navigationMode="pan",this.view=null,t?.isDefaultViewModel||i(e.getLogger(this),"Navigation Toggle","navigation-toggle",{version:"4.33"})}normalizeCtorArgs(t={}){const{isDefaultViewModel:o,...i}=t;return i}initialize(){this.addHandles(a((()=>this.view?.navigation?.actionMap),(()=>this._updateNavigationActionMap())))}destroy(){this.view=null}get state(){return this.view?.ready&&"3d"===this.view?.type?"ready":"disabled"}get navigationMode(){return this._navigationMode}set navigationMode(t){this._navigationMode=t,this._updateNavigationActionMap()}toggle(){"disabled"!==this.state&&(this.navigationMode="pan"!==this.navigationMode?"pan":"rotate")}_updateNavigationActionMap(){const t=this.view?.navigation?.actionMap;if(!t)return;const o="pan"===this._navigationMode;t.dragPrimary=o?"pan":"rotate",t.dragSecondary=o?"rotate":"pan"}};t([r({readOnly:!0})],n.prototype,"state",null),t([r()],n.prototype,"_navigationMode",void 0),t([r()],n.prototype,"view",void 0),n=t([s("esri.widgets.NavigationToggle.NavigationToggleViewModel")],n);const d=n;export{d as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../chunks/tslib.es6.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import i from"./Widget.js";import{css as s}from"./NavigationToggle/css.js";import r from"./NavigationToggle/NavigationToggleViewModel.js";import{loadCalciteComponents as l}from"./support/componentsUtils.js";import{globalCss as a}from"./support/globalCss.js";import{setFocus as n}from"./support/widgetUtils.js";import{messageBundle as p}from"./support/decorators/messageBundle.js";import{tsx as g}from"./support/jsxFactory.js";let c=class extends i{constructor(t,e){super(t,e),this.messages=null,this.viewModel=new r,this.toggle=()=>this.viewModel.toggle(),this._panButton=null,this._rotateButton=null,this._toggle=()=>{const t="pan"===this.viewModel?.navigationMode?this._rotateButton:this._panButton;n(t),this.toggle()}}loadDependencies(){return l({button:()=>import("@esri/calcite-components/dist/components/calcite-button")})}get icon(){return"move"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){"horizontal"!==t&&(t="vertical"),this._set("layout",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t="disabled"===this.viewModel?.state,e="pan"===this.viewModel?.navigationMode,o=this.messages.toggle;return g("div",{class:this.classes(s.base,a.widget,{[s.isLayoutHorizontal]:"horizontal"===this.layout})},g("calcite-button",{afterCreate:t=>{this._panButton=t},appearance:e?"outline-fill":"solid",class:a.widgetButton,disabled:t,iconStart:"move",kind:"neutral",label:o,onclick:this._toggle,tabIndex:e?void 0:-1,title:o}),g("calcite-button",{afterCreate:t=>{this._rotateButton=t},appearance:e?"solid":"outline-fill",class:a.widgetButton,disabled:t,iconStart:"rotate",kind:"neutral",label:o,onclick:this._toggle,tabIndex:e?-1:void 0,title:o}))}};t([e()],c.prototype,"icon",null),t([e()],c.prototype,"label",null),t([e({value:"vertical"})],c.prototype,"layout",null),t([e(),p("esri/widgets/NavigationToggle/t9n/NavigationToggle")],c.prototype,"messages",void 0),t([e()],c.prototype,"view",null),t([e({type:r})],c.prototype,"viewModel",void 0),c=t([o("esri.widgets.NavigationToggle")],c);const d=c;export{d as default};
5
+ import{_ as t}from"../chunks/tslib.es6.js";import{deprecateWidget as e}from"../core/deprecate.js";import o from"../core/Logger.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import{css as a}from"./NavigationToggle/css.js";import l from"./NavigationToggle/NavigationToggleViewModel.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as g}from"./support/globalCss.js";import{setFocus as p}from"./support/widgetUtils.js";import{messageBundle as c}from"./support/decorators/messageBundle.js";import{tsx as d}from"./support/jsxFactory.js";let u=class extends r{constructor(t,i){super(t,i),this.messages=null,this.viewModel=new l({isDefaultViewModel:!0}),this.toggle=()=>this.viewModel.toggle(),this._panButton=null,this._rotateButton=null,this._toggle=()=>{const t="pan"===this.viewModel?.navigationMode?this._rotateButton:this._panButton;p(t),this.toggle()},t?.isDefaultUI||e(o.getLogger(this),"Navigation Toggle","arcgis-navigation-toggle",{version:"4.32"})}normalizeCtorArgs(t={}){const{isDefaultUI:e,...o}=t;return o}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button")})}get icon(){return"move"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){"horizontal"!==t&&(t="vertical"),this._set("layout",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t="disabled"===this.viewModel?.state,e="pan"===this.viewModel?.navigationMode,o=this.messages.toggle;return d("div",{class:this.classes(a.base,g.widget,{[a.isLayoutHorizontal]:"horizontal"===this.layout})},d("calcite-button",{afterCreate:t=>{this._panButton=t},appearance:e?"outline-fill":"solid",class:g.widgetButton,disabled:t,iconStart:"move",kind:"neutral",label:o,onclick:this._toggle,tabIndex:e?void 0:-1,title:o}),d("calcite-button",{afterCreate:t=>{this._rotateButton=t},appearance:e?"solid":"outline-fill",class:g.widgetButton,disabled:t,iconStart:"rotate",kind:"neutral",label:o,onclick:this._toggle,tabIndex:e?-1:void 0,title:o}))}};t([i()],u.prototype,"icon",null),t([i()],u.prototype,"label",null),t([i({value:"vertical"})],u.prototype,"layout",null),t([i(),c("esri/widgets/NavigationToggle/t9n/NavigationToggle")],u.prototype,"messages",void 0),t([i()],u.prototype,"view",null),t([i({type:l})],u.prototype,"viewModel",void 0),u=t([s("esri.widgets.NavigationToggle")],u);const m=u;export{m as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{throwIfAborted as t}from"../../core/promiseUtils.js";import{formatLength as e,formatArea as r}from"../../core/quantityFormatUtils.js";import{createLength as n,createArea as a}from"../../core/quantityUtils.js";import{distance as o}from"../../core/libs/gl-matrix-2/math/vec2.js";import{geodesicDensify as i,simplify as s,geodesicLength as c,planarLength as u,planarArea as l,geodesicArea as f}from"../../geometry/geometryEngine.js";import m from"../../geometry/Point.js";import p from"../../geometry/Polygon.js";import y from"../../geometry/Polyline.js";import{projectWithZConversion as h,project as g}from"../../geometry/projection.js";import x from"../../geometry/SpatialReference.js";import{isSupported as w,geodesicLengths as d,geodesicAreas as v}from"../../geometry/support/geodesicUtils.js";import{imageToWorld as R,imageToWorldPanoramic as z}from"../../layers/orientedImagery/transformations/imageToWorld.js";import{convertSphereVertexToPixelLocation as M}from"../../layers/orientedImagery/transformations/utils.js";import{worldToImage as P,worldToImagePanoramic as j}from"../../layers/orientedImagery/transformations/worldToImage.js";const E=1e5;function b(t,e){let r=180*Math.atan2(-t.y+e.y,t.x-e.x)/Math.PI;return r<0&&(r+=180),r*Math.PI/180}function I(t,e){let r=180*Math.atan2(-t.y+e.y,t.x-e.x)/Math.PI;return r<0&&(r+=180),r*Math.PI/180}function q(t,e,r){if(!t?.length||!e?.length||!r)return;const[n,a]=t,[,o]=e,i=o-a;return[n+i*Math.cos(r),a+i*Math.sin(r)]}function L(t,e,r){if(w(t)){const t=d([e],"meters")[0];return{area:v([r],"square-meters")[0],perimeter:t}}const n=x.WGS84,a=g(e,n),o=g(r,n);let c=i(o,E);if(c=s(c),!c)return null;const u=d([a],"meters")[0];return{area:v([c],"square-meters")[0],perimeter:u}}async function W(e,r,n,a,o=!1,i){if(r.length<2||!a||!n||!e)return null;const s=Q(n,e);if(!s)return null;const c=r.map((t=>[t.x,t.y])),u=c.at(0),l=c.at(-1);if(!u||!l)return null;const f=s.map((t=>tt([u,l],t,e,o,!1))),m=await Promise.all(f);t(i);let p=0;for(const t of m){if(!t)return null;const e=Math.abs(t-a);p=Math.max(e,p)}return p}async function G(e,r,n,a,o,i=!1,s){if(r.length<2||!a||!n||!e)throw new Error("Missing parameters");const c=X(n,e),u=r.map((t=>[t.x,t.y])),l=u.at(0),f=u.at(-1),m=c.map((t=>et([l,f],t,e,o,i,!1))),p=await Promise.all(m);t(s);let y=0;for(const t of p){if(!t)return 0;const e=Math.abs(t-a);y=Math.max(e,y)}return y}function k(t,e){const r=K(t,!1);if(!r?.length)return;return 20*o([r[0].x,r[0].y],[r.at(-1).x,r.at(-1).y])/e}function D(t){const e=t.spatialReference;if(e.isGeographic){if(w(e))return d([t],"meters")[0];const r=g(t,x.WGS84);return d([r],"meters")[0]}return e.isWebMercator?c(t,"meters"):u(t,"meters")}function U(t){if(!t?.length)throw new Error("Invalid deviations array");const[e,r,n]=[0,1,2].map((e=>t.map((t=>t[e])).filter((t=>null!==t)))).map((t=>t.length?$(t):0));return[e,r,n]}function F(t,e){const r=s(e);if(!r)return null;const n=u(t,"meters");return{area:l(r,"square-meters"),perimeter:n}}function S(t,e){let r=i(e,E,"meters");if(r=s(r),!r)return null;const n=c(t,"meters");return{area:f(r,"square-meters"),perimeter:n}}async function T(e,r,n){if(!r||!e)throw new Error("Missing required parameters");const a=await R(e,r);t(n);const o=a.clone();o.z?o.z+=20:o.z=20;const{averageElevation:i,cameraPitch:s,cameraRoll:c,farDistance:u,...l}=r;return P(o,l)}async function H(e,r,n,a){const{attributes:o}=n,{location:i}=o,{updateElevationProps:s,...c}=r;if(!e||!r)throw new Error("Missing parameters");let u=i.clone();u.spatialReference.isGeographic&&(u=await h(u,x.WebMercator));const l=await z(e,{...c,cameraLocation:u},s);t(a);const f=l.clone();return f.z?f.z+=20:f.z=20,j(f,c)}function O(t,e,r,n,a=0,i=1,s){const{averageElevation:c,cameraPitch:u,cameraRoll:l,farDistance:f,...p}=n;if(a>=5||i<=.1)return{value:t};const y=new m({x:e.x,y:e.y,z:e.z?e.z+t:t,spatialReference:n.cameraLocation.spatialReference}),h=P(y,p),g=o([r[0].x,r[0].y],[h.x,h.y]),x=r.at(0),w=r.at(-1);if(!x||!w)return null;const d=o([x.x,x.y],[w.x,w.y])*t/g;return O(d,e,r,n,a+1,Math.abs(t-d))}function V(t,e,r,n,a=0,i=1,s){const{averageElevation:c,horizontalFieldOfView:u,verticalFieldOfView:l,farDistance:f,...p}=n;if(a>=5||i<=.1)return{value:t};const y=new m({x:e.x,y:e.y,z:e.z?e.z+t:t,spatialReference:n.cameraLocation.spatialReference}),h=j(y,p),g=o([r[0].x,r[0].y],[h.x,h.y]),x=r.at(0),w=r.at(-1);if(!x||!w)return null;const d=o([x.x,x.y],[w.x,w.y])*t/g;return V(d,e,r,n,a+1,Math.abs(t-d))}async function A(t,e){const{updateElevationProps:r,...n}=e;return await R(t,n,r)}async function B(t,e){const{updateElevationProps:r,...n}=e;return z(t,n,r)}function C(t){navigator.clipboard.writeText(t).catch((t=>{throw t}))}function J(t){const e=t.map((t=>[t.x,t.y])),r=t[0].spatialReference;return new y({paths:[e],spatialReference:r})}function K(t,e){return t.map((t=>({x:e?.5+t[0]:t[0],y:e?.5-t[1]:t[1]})))}function N(t,r,a,o,i){const s="measurement"===t?r:a;if(i&&s)return e(o,n(s,"meters"),i,3)||null}function Q(t,e){const{cameraPitch:r,cameraRoll:n,cameraLocation:a}=t,{x:o,y:i,z:s,spatialReference:c}=a;if(e.every((t=>0===t))||!e||!e.length)return null;const[u,l,,f,p]=e,y=[-f,0,f],h=[-p,0,p],g=[-u,0,u],x=[-l,0,l],w=[];for(const d of y)for(const e of h)for(const a of g)for(const u of g)for(const l of x){const f={...t};f.cameraPitch=r+d,f.cameraRoll=n+e,f.cameraLocation=new m({x:o+a,y:i+u,z:s?s+l:0,spatialReference:{wkid:c.wkid}}),w.push(f)}return w}function X(t,e){const{cameraHeading:r,cameraLocation:n}=t,{x:a,y:o,z:i,spatialReference:s}=n;if(e.every((t=>0===t))||!e||!e.length)throw new Error("Invalid parameters");const[c,u,l]=e,f=l>0?[-l,0,l]:[],p=c>0?[-c,0,c]:[],y=u>0?[-u,0,u]:[],h=[];for(const g of f)for(const e of p)for(const n of p)for(const c of y){const u={...t};u.cameraHeading=r+g,u.cameraLocation=new m({x:a+e,y:o+n,z:i?i+c:0,spatialReference:{wkid:s.wkid}}),h.push(u)}return h}function Y(t,r,a,o,i){const s="measurement"===t?r:$(a);if(i&&s)return e(o,n(s,"meters"),i,3)||null}function Z(t,e,n,o,i){const s="measurement"===t?e:n;if(i&&s)return r(o,a(s,"square-meters"),i,3)||null}function $(t){return Math.sqrt(t.reduce(((t,e)=>t+e**2),0))}function _(t,e,r){if("default"===e)return t;const n={x:t[0],y:t[1],z:t[2]},a=M(n,r[0],r[1]);return[a.x,a.y]}async function tt(e,r,n,a=!1,i=!1,s){if(!e||!r||e.length<2)return null;const c=K(e,a);if(!c||c.length<2)return null;const[u,l]=[c[0],c.at(-1)];if(!l)return null;const f=[u],m=await R(u,r);t(s);const p=m.clone();p.z?p.z+=20:p.z=20;const{averageElevation:y,cameraPitch:h,cameraRoll:g,farDistance:x,...w}=r,d=P(p,w),v=o([u.x,u.y],[d.x,d.y]),z=b(u,d);if(!z)return;const M=q([u.x,u.y],[l.x,l.y],z);if(!M?.length)return;f.push({x:M[0],y:M[1]});const j=20*o([f[0].x,f[0].y],[f[1].x,f[1].y])/v;if(!i)return j;const E=O(j,m,f,r,0,1);return E?.value}async function et(e,r,n,a,i=!1,s=!1,c){const{attributes:u}=a,{location:l}=u,{updateElevationProps:f,...m}=r;if(!e||!r||e.length<2)throw new Error("Invalid parameters");const p=K(e,i),[y,g]=[p[0],p.at(-1)],w=[y];let d=l.clone();d.spatialReference.isGeographic&&(d=await h(d,x.WebMercator));const v=await z(y,{...m,cameraLocation:d},f);t(c);const R=v.clone();R.z?R.z+=20:R.z=20;const M=j(R,m),P=o([y.x,y.y],[M.x,M.y]),E=b(y,M);if(!E)return;const I=q([y.x,y.y],[g.x,g.y],E);if(!I?.length)return;w.push({x:I[0],y:I[1]});const L=20*o([w[0].x,w[0].y],[w[1].x,w[1].y])/P;if(!s)return L;const W=V(L,v,w,r,0,1);return W?.value}async function rt(t,e,r=!1){if(t.length<3)return null;const n=K(t,r),a=await A(n,e),o=a.map((({x:t,y:e})=>[t,e]));t.push(t[0]),o.push(o[0]);const i=a[0].spatialReference,s=new y({paths:[o],spatialReference:i}),c=new p({rings:[o],spatialReference:i});return i.isGeographic?L(i,s,c):i.isWebMercator?S(s,c):F(s,c)}async function nt(e,r,n=!1,a){if(e.length<3)return null;const o=K(e,n),i=await B(o,r);t(a);const s=i.map((({x:t,y:e})=>[t,e]));e.push(e[0]),s.push(s[0]);const c=i[0].spatialReference,u=new y({paths:[s],spatialReference:c}),l=new p({rings:[s],spatialReference:c});return c.isGeographic?L(c,u,l):c.isWebMercator?S(u,l):F(u,l)}async function at(t,e,r=!1){const n=K(t,r);return D(J(await A(n,e)))}async function ot(e,r,n=!1,a){const o=K(e,n),i=await B(o,r);t(a);return D(J(i))}export{b as calculateAngle,I as calculateAnglePano,q as calculateCorrectedPixel,W as calculateHeightAccuracy,G as calculateHeightAccuracyPanoramic,k as calculateHeightFromTemporaryDistance,U as calculateLocationAccuracyFromDeviations,H as calculateReferenceImagePointPanoramic,T as calculateTempImagePoint,O as computeHeightIteratively,V as computeHeightIterativelyPanoramic,C as copyToClipboard,K as formatPixels,Q as generateCombinations,X as generateCombinationsPanoramic,Z as getConvertedArea,Y as getConvertedDistance,N as getConvertedHeight,_ as getModeCorrectedPoint,$ as getRootOfSumOfSquaredErrors,tt as heightMeasurement2D,et as heightMeasurementPanoramic,rt as pixelAreaMeasurement2D,nt as pixelAreaMeasurementPanoramic,at as pixelDistanceMeasurement2D,ot as pixelDistanceMeasurementPanoramic};
5
+ import{throwIfAborted as t}from"../../core/promiseUtils.js";import{formatLength as e,formatArea as r}from"../../core/quantityFormatUtils.js";import{createLength as n,createArea as a}from"../../core/quantityUtils.js";import{distance as o}from"../../core/libs/gl-matrix-2/math/vec2.js";import i from"../../geometry/Point.js";import s from"../../geometry/Polygon.js";import c from"../../geometry/Polyline.js";import{projectWithZConversion as u,project as l}from"../../geometry/projection.js";import f from"../../geometry/SpatialReference.js";import{e as m}from"../../chunks/areaOperator.js";import{l as p,e as y}from"../../chunks/geodeticAreaOperator.js";import{l as h,e as g}from"../../chunks/geodeticDensifyOperator.js";import{l as x,e as w}from"../../chunks/geodeticLengthOperator.js";import{e as d}from"../../chunks/lengthOperator.js";import{e as v}from"../../chunks/simplifyOperator.js";import{isSupported as R,geodesicLengths as z,geodesicAreas as M}from"../../geometry/support/geodesicUtils.js";import{imageToWorld as j,imageToWorldPanoramic as P}from"../../layers/orientedImagery/transformations/imageToWorld.js";import{convertSphereVertexToPixelLocation as E}from"../../layers/orientedImagery/transformations/utils.js";import{worldToImage as b,worldToImagePanoramic as I}from"../../layers/orientedImagery/transformations/worldToImage.js";const k=1e5;function L(t,e){let r=180*Math.atan2(-t.y+e.y,t.x-e.x)/Math.PI;return r<0&&(r+=180),r*Math.PI/180}function O(t,e){let r=180*Math.atan2(-t.y+e.y,t.x-e.x)/Math.PI;return r<0&&(r+=180),r*Math.PI/180}function W(t,e,r){if(!t?.length||!e?.length||!r)return;const[n,a]=t,[,o]=e,i=o-a;return[n+i*Math.cos(r),a+i*Math.sin(r)]}async function q(t,e,r){if(await h(),R(t)){const t=z([e],"meters")[0];return{area:M([r],"square-meters")[0],perimeter:t}}const n=f.WGS84,a=l(e,n),o=l(r,n);let i=g(o,k);if(i=v(i),!i)return null;const s=z([a],"meters")[0];return{area:M([i],"square-meters")[0],perimeter:s}}async function G(e,r,n,a,o=!1,i){if(r.length<2||!a||!n||!e)return null;const s=Z(n,e);if(!s)return null;const c=r.map((t=>[t.x,t.y])),u=c.at(0),l=c.at(-1);if(!u||!l)return null;const f=s.map((t=>nt([u,l],t,e,o,!1))),m=await Promise.all(f);t(i);let p=0;for(const t of m){if(!t)return null;const e=Math.abs(t-a);p=Math.max(e,p)}return p}async function D(e,r,n,a,o,i=!1,s){if(r.length<2||!a||!n||!e)throw new Error("Missing parameters");const c=$(n,e),u=r.map((t=>[t.x,t.y])),l=u.at(0),f=u.at(-1),m=c.map((t=>at([l,f],t,e,o,i,!1))),p=await Promise.all(m);t(s);let y=0;for(const t of p){if(!t)return 0;const e=Math.abs(t-a);y=Math.max(e,y)}return y}function U(t,e){const r=X(t,!1);if(!r?.length)return;return 20*o([r[0].x,r[0].y],[r.at(-1).x,r.at(-1).y])/e}async function F(t){await x();const e=t.spatialReference;if(e.isGeographic){if(R(e))return z([t],"meters")[0];const r=l(t,f.WGS84);return z([r],"meters")[0]}return e.isWebMercator?w(t):d(t)}function S(t){if(!t?.length)throw new Error("Invalid deviations array");const[e,r,n]=[0,1,2].map((e=>t.map((t=>t[e])).filter((t=>null!==t)))).map((t=>t.length?et(t):0));return[e,r,n]}function T(t,e){const r=v(e);if(!r)return null;const n=d(t);return{area:m(r),perimeter:n}}async function H(t,e){await Promise.all([p(),h(),x()]);let r=g(e,k);if(r=v(r),!r)return null;const n=w(t);return{area:y(r),perimeter:n}}async function V(e,r,n){if(!r||!e)throw new Error("Missing required parameters");const a=await j(e,r);t(n);const o=a.clone();o.z?o.z+=20:o.z=20;const{averageElevation:i,cameraPitch:s,cameraRoll:c,farDistance:u,...l}=r;return b(o,l)}async function A(e,r,n,a){const{attributes:o}=n,{location:i}=o,{updateElevationProps:s,...c}=r;if(!e||!r)throw new Error("Missing parameters");let l=i.clone();l.spatialReference.isGeographic&&(l=await u(l,f.WebMercator));const m=await P(e,{...c,cameraLocation:l},s);t(a);const p=m.clone();return p.z?p.z+=20:p.z=20,I(p,c)}function B(t,e,r,n,a=0,s=1,c){const{averageElevation:u,cameraPitch:l,cameraRoll:f,farDistance:m,...p}=n;if(a>=5||s<=.1)return{value:t};const y=new i({x:e.x,y:e.y,z:e.z?e.z+t:t,spatialReference:n.cameraLocation.spatialReference}),h=b(y,p),g=o([r[0].x,r[0].y],[h.x,h.y]),x=r.at(0),w=r.at(-1);if(!x||!w)return null;const d=o([x.x,x.y],[w.x,w.y])*t/g;return B(d,e,r,n,a+1,Math.abs(t-d))}function C(t,e,r,n,a=0,s=1,c){const{averageElevation:u,horizontalFieldOfView:l,verticalFieldOfView:f,farDistance:m,...p}=n;if(a>=5||s<=.1)return{value:t};const y=new i({x:e.x,y:e.y,z:e.z?e.z+t:t,spatialReference:n.cameraLocation.spatialReference}),h=I(y,p),g=o([r[0].x,r[0].y],[h.x,h.y]),x=r.at(0),w=r.at(-1);if(!x||!w)return null;const d=o([x.x,x.y],[w.x,w.y])*t/g;return C(d,e,r,n,a+1,Math.abs(t-d))}async function J(t,e){const{updateElevationProps:r,...n}=e;return await j(t,n,r)}async function K(t,e){const{updateElevationProps:r,...n}=e;return P(t,n,r)}function N(t){navigator.clipboard.writeText(t).catch((t=>{throw t}))}function Q(t){const e=t.map((t=>[t.x,t.y])),r=t[0].spatialReference;return new c({paths:[e],spatialReference:r})}function X(t,e){return t.map((t=>({x:e?.5+t[0]:t[0],y:e?.5-t[1]:t[1]})))}function Y(t,r,a,o,i){const s="measurement"===t?r:a;if(i&&s)return e(o,n(s,"meters"),i,3)||null}function Z(t,e){const{cameraPitch:r,cameraRoll:n,cameraLocation:a}=t,{x:o,y:s,z:c,spatialReference:u}=a;if(e.every((t=>0===t))||!e||!e.length)return null;const[l,f,,m,p]=e,y=[-m,0,m],h=[-p,0,p],g=[-l,0,l],x=[-f,0,f],w=[];for(const d of y)for(const e of h)for(const a of g)for(const l of g)for(const f of x){const m={...t};m.cameraPitch=r+d,m.cameraRoll=n+e,m.cameraLocation=new i({x:o+a,y:s+l,z:c?c+f:0,spatialReference:{wkid:u.wkid}}),w.push(m)}return w}function $(t,e){const{cameraHeading:r,cameraLocation:n}=t,{x:a,y:o,z:s,spatialReference:c}=n;if(e.every((t=>0===t))||!e||!e.length)throw new Error("Invalid parameters");const[u,l,f]=e,m=f>0?[-f,0,f]:[],p=u>0?[-u,0,u]:[],y=l>0?[-l,0,l]:[],h=[];for(const g of m)for(const e of p)for(const n of p)for(const u of y){const l={...t};l.cameraHeading=r+g,l.cameraLocation=new i({x:a+e,y:o+n,z:s?s+u:0,spatialReference:{wkid:c.wkid}}),h.push(l)}return h}function _(t,r,a,o,i){const s="measurement"===t?r:et(a);if(i&&s)return e(o,n(s,"meters"),i,3)||null}function tt(t,e,n,o,i){const s="measurement"===t?e:n;if(i&&s)return r(o,a(s,"square-meters"),i,3)||null}function et(t){return Math.sqrt(t.reduce(((t,e)=>t+e**2),0))}function rt(t,e,r){if("default"===e)return t;const n={x:t[0],y:t[1],z:t[2]},a=E(n,r[0],r[1]);return[a.x,a.y]}async function nt(e,r,n,a=!1,i=!1,s){if(!e||!r||e.length<2)return null;const c=X(e,a);if(!c||c.length<2)return null;const[u,l]=[c[0],c.at(-1)];if(!l)return null;const f=[u],m=await j(u,r);t(s);const p=m.clone();p.z?p.z+=20:p.z=20;const{averageElevation:y,cameraPitch:h,cameraRoll:g,farDistance:x,...w}=r,d=b(p,w),v=o([u.x,u.y],[d.x,d.y]),R=L(u,d);if(!R)return;const z=W([u.x,u.y],[l.x,l.y],R);if(!z?.length)return;f.push({x:z[0],y:z[1]});const M=20*o([f[0].x,f[0].y],[f[1].x,f[1].y])/v;if(!i)return M;const P=B(M,m,f,r,0,1);return P?.value}async function at(e,r,n,a,i=!1,s=!1,c){const{attributes:l}=a,{location:m}=l,{updateElevationProps:p,...y}=r;if(!e||!r||e.length<2)throw new Error("Invalid parameters");const h=X(e,i),[g,x]=[h[0],h.at(-1)],w=[g];let d=m.clone();d.spatialReference.isGeographic&&(d=await u(d,f.WebMercator));const v=await P(g,{...y,cameraLocation:d},p);t(c);const R=v.clone();R.z?R.z+=20:R.z=20;const z=I(R,y),M=o([g.x,g.y],[z.x,z.y]),j=L(g,z);if(!j)return;const E=W([g.x,g.y],[x.x,x.y],j);if(!E?.length)return;w.push({x:E[0],y:E[1]});const b=20*o([w[0].x,w[0].y],[w[1].x,w[1].y])/M;if(!s)return b;const k=C(b,v,w,r,0,1);return k?.value}async function ot(t,e,r=!1){if(t.length<3)return null;const n=X(t,r),a=await J(n,e),o=a.map((({x:t,y:e})=>[t,e]));t.push(t[0]),o.push(o[0]);const i=a[0].spatialReference,u=new c({paths:[o],spatialReference:i}),l=new s({rings:[o],spatialReference:i});return i.isGeographic?q(i,u,l):i.isWebMercator?H(u,l):T(u,l)}async function it(e,r,n=!1,a){if(e.length<3)return null;const o=X(e,n),i=await K(o,r);t(a);const u=i.map((({x:t,y:e})=>[t,e]));e.push(e[0]),u.push(u[0]);const l=i[0].spatialReference,f=new c({paths:[u],spatialReference:l}),m=new s({rings:[u],spatialReference:l});return l.isGeographic?q(l,f,m):l.isWebMercator?H(f,m):T(f,m)}async function st(t,e,r=!1){const n=X(t,r);return F(Q(await J(n,e)))}async function ct(e,r,n=!1,a){const o=X(e,n),i=await K(o,r);t(a);return F(Q(i))}export{L as calculateAngle,O as calculateAnglePano,W as calculateCorrectedPixel,G as calculateHeightAccuracy,D as calculateHeightAccuracyPanoramic,U as calculateHeightFromTemporaryDistance,S as calculateLocationAccuracyFromDeviations,A as calculateReferenceImagePointPanoramic,V as calculateTempImagePoint,B as computeHeightIteratively,C as computeHeightIterativelyPanoramic,N as copyToClipboard,X as formatPixels,Z as generateCombinations,$ as generateCombinationsPanoramic,tt as getConvertedArea,_ as getConvertedDistance,Y as getConvertedHeight,rt as getModeCorrectedPoint,et as getRootOfSumOfSquaredErrors,nt as heightMeasurement2D,at as heightMeasurementPanoramic,ot as pixelAreaMeasurement2D,it as pixelAreaMeasurementPanoramic,st as pixelDistanceMeasurement2D,ct as pixelDistanceMeasurementPanoramic};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Identifiable.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import r from"../Widget.js";import{isWidget as s}from"../support/widget.js";import{tsx as n}from"../support/jsxFactory.js";let l=class extends(e.IdentifiableMixin(r)){constructor(t,e){super(t,e),this.className=null,this.content=null,this.flowEnabled=!1,this.image=null,this.listItem=null,this.open=!1,this.visible=!0}get disabled(){return!(this.content&&this.listItem)}set disabled(t){this._overrideIfSome("disabled",t)}get icon(){const{image:t}=this,e=this._getFirstWidget();return this._get("icon")??(!t&&e?e.icon:null)}set icon(t){this._overrideIfSome("icon",t)}get title(){return this._get("title")||(this._getFirstWidget()?.label??"")}set title(t){this._override("title",t)}render(){return n("div",{class:"esri-list-item-panel"},this._renderContents())}_renderContent(t){const{disabled:e,open:i}=this;return t&&!e&&i?"string"==typeof t?n("div",{innerHTML:t,key:t}):s(t)?n("div",{key:"content-widget"},t.render()):t instanceof HTMLElement?n("div",{afterCreate:this._attachToNode,bind:t,key:"content-element"}):null:null}_renderContents(){const{content:t,open:e}=this;return e?Array.isArray(t)?t.map((t=>this._renderContent(t))):this._renderContent(t):null}_attachToNode(t){t.appendChild(this)}_getWidget(t){return s(t)?t:null}_getFirstWidget(){const{content:t}=this;return Array.isArray(t)?t.map((t=>this._getWidget(t))).find((t=>t)):this._getWidget(t)}};t([i()],l.prototype,"className",void 0),t([i()],l.prototype,"content",void 0),t([i()],l.prototype,"disabled",null),t([i()],l.prototype,"flowEnabled",void 0),t([i()],l.prototype,"icon",null),t([i()],l.prototype,"image",void 0),t([i()],l.prototype,"listItem",void 0),t([i()],l.prototype,"open",void 0),t([i()],l.prototype,"title",null),t([i()],l.prototype,"visible",void 0),l=t([o("esri.widgets.TableList.ListItemPanel")],l);const d=l;export{d as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Identifiable.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import r from"../Widget.js";import{isWidget as s}from"../support/widget.js";import{tsx as n}from"../support/jsxFactory.js";let l=class extends(e.IdentifiableMixin(r)){constructor(t,e){super(t,e),this.content=null,this.flowEnabled=!1,this.image=null,this.listItem=null,this.open=!1,this.visible=!0}get disabled(){return!(this.content&&this.listItem)}set disabled(t){this._overrideIfSome("disabled",t)}get icon(){const{image:t}=this,e=this._getFirstWidget();return this._get("icon")??(!t&&e?e.icon:null)}set icon(t){this._overrideIfSome("icon",t)}get title(){return this._get("title")||(this._getFirstWidget()?.label??"")}set title(t){this._override("title",t)}render(){return n("div",{class:"esri-list-item-panel"},this._renderContents())}_renderContent(t){const{disabled:e,open:i}=this;return t&&!e&&i?"string"==typeof t?n("div",{innerHTML:t,key:t}):s(t)?n("div",{key:"content-widget"},t.render()):t instanceof HTMLElement?n("div",{afterCreate:this._attachToNode,bind:t,key:"content-element"}):null:null}_renderContents(){const{content:t,open:e}=this;return e?Array.isArray(t)?t.map((t=>this._renderContent(t))):this._renderContent(t):null}_attachToNode(t){t.appendChild(this)}_getWidget(t){return s(t)?t:null}_getFirstWidget(){const{content:t}=this;return Array.isArray(t)?t.map((t=>this._getWidget(t))).find((t=>t)):this._getWidget(t)}};t([i()],l.prototype,"content",void 0),t([i()],l.prototype,"disabled",null),t([i()],l.prototype,"flowEnabled",void 0),t([i()],l.prototype,"icon",null),t([i()],l.prototype,"image",void 0),t([i()],l.prototype,"listItem",void 0),t([i()],l.prototype,"open",void 0),t([i()],l.prototype,"title",null),t([i()],l.prototype,"visible",void 0),l=t([o("esri.widgets.TableList.ListItemPanel")],l);const d=l;export{d as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import r from"../../core/Logger.js";import{watch as n,syncAndInitial as o}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import a from"../../views/3d/environment/CloudyWeather.js";import l from"../../views/3d/environment/FoggyWeather.js";import h from"../../views/3d/environment/RainyWeather.js";import p from"../../views/3d/environment/SnowyWeather.js";import y from"../../views/3d/environment/SunnyWeather.js";import{validateWeatherType as m}from"../../views/3d/environment/weather.js";import{WeatherState as u,WeatherError as w}from"./enums.js";let c=class extends t{constructor(e){super(e),this.view=null,this._weatherByType={sunny:new y,cloudy:new a,rainy:new h,snowy:new p,foggy:new l},this._settingWeather=!1}initialize(){this.addHandles([n((()=>this.current),(e=>{this._settingWeather||null==e||(this._weatherByType={...this._weatherByType,[e.type]:e})}),o)])}get state(){const e=this.view;return null!=e&&e.ready?null!=this.error?this.error===w.NotVisible?u.Ready:u.Error:u.Ready:u.Disabled}get weatherByType(){return this._weatherByType}get error(){const e=this.view;return null!=e&&e.ready?"3d"!==e.type?w.UnsupportedView:"local"===e.viewingMode?w.LocalScene:e.environment.atmosphereEnabled?e.environment.weatherAvailable?null:w.NotVisible:w.NoAtmosphere:null}get current(){return this._environment?.weather??this._weatherByType.sunny}set current(e){const t=this._environment;t&&(t.weather=e)}get _environment(){const e=this.view;return null!=e&&"3d"===e.type?e.environment:null}setWeatherByType(e){if(!m(e,r.getLogger(this)))return;const t=this._environment;null!=t&&(this._settingWeather=!0,t.weather=this._weatherByType[e],this._settingWeather=!1)}setSnowCoverEnabled(e){const t=this.current;"snowCover"in t&&(t.snowCover=e?"enabled":"disabled")}};e([s()],c.prototype,"view",void 0),e([s()],c.prototype,"state",null),e([s()],c.prototype,"_weatherByType",void 0),e([s()],c.prototype,"weatherByType",null),e([s()],c.prototype,"error",null),e([s()],c.prototype,"current",null),e([s()],c.prototype,"_environment",null),c=e([i("esri.widgets.Weather.WeatherViewModel")],c);const d=c;export{d as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{deprecateUnnecessaryViewModel as r}from"../../core/deprecate.js";import o from"../../core/Logger.js";import{watch as n,syncAndInitial as s}from"../../core/reactiveUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import l from"../../views/3d/environment/CloudyWeather.js";import h from"../../views/3d/environment/FoggyWeather.js";import p from"../../views/3d/environment/RainyWeather.js";import m from"../../views/3d/environment/SnowyWeather.js";import y from"../../views/3d/environment/SunnyWeather.js";import{validateWeatherType as u}from"../../views/3d/environment/weather.js";import{WeatherState as w,WeatherError as c}from"./enums.js";let d=class extends t{constructor(e){super(e),this.view=null,this._weatherByType={sunny:new y,cloudy:new l,rainy:new p,snowy:new m,foggy:new h},this._settingWeather=!1,e?.isDefaultViewModel||r(o.getLogger(this),"Weather","weather",{version:"4.33"})}normalizeCtorArgs(e={}){const{isDefaultViewModel:t,...r}=e;return r}initialize(){this.addHandles([n((()=>this.current),(e=>{this._settingWeather||null==e||(this._weatherByType={...this._weatherByType,[e.type]:e})}),s)])}get state(){const e=this.view;return null!=e&&e.ready?null!=this.error?this.error===c.NotVisible?w.Ready:w.Error:w.Ready:w.Disabled}get weatherByType(){return this._weatherByType}get error(){const e=this.view;return null!=e&&e.ready?"3d"!==e.type?c.UnsupportedView:"local"===e.viewingMode?c.LocalScene:e.environment.atmosphereEnabled?e.environment.weatherAvailable?null:c.NotVisible:c.NoAtmosphere:null}get current(){return this._environment?.weather??this._weatherByType.sunny}set current(e){const t=this._environment;t&&(t.weather=e)}get _environment(){const e=this.view;return null!=e&&"3d"===e.type?e.environment:null}setWeatherByType(e){if(!u(e,o.getLogger(this)))return;const t=this._environment;null!=t&&(this._settingWeather=!0,t.weather=this._weatherByType[e],this._settingWeather=!1)}setSnowCoverEnabled(e){const t=this.current;"snowCover"in t&&(t.snowCover=e?"enabled":"disabled")}};e([i()],d.prototype,"view",void 0),e([i()],d.prototype,"state",null),e([i()],d.prototype,"_weatherByType",void 0),e([i()],d.prototype,"weatherByType",null),e([i()],d.prototype,"error",null),e([i()],d.prototype,"current",null),e([i()],d.prototype,"_environment",null),d=e([a("esri.widgets.Weather.WeatherViewModel")],d);const v=d;export{v as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{memoize as o}from"../core/memoize.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import{weatherTypesArray as s}from"../views/3d/environment/weather.js";import n from"./Widget.js";import{loadCalciteComponents as i}from"./support/componentsUtils.js";import{globalCss as a}from"./support/globalCss.js";import{Heading as l}from"./support/Heading.js";import{classes as c}from"./support/widgetUtils.js";import{messageBundle as d}from"./support/decorators/messageBundle.js";import{tsx as p,tsxFragment as u}from"./support/jsxFactory.js";import{css as h}from"./Weather/css.js";import{WeatherState as g,WeatherError as m}from"./Weather/enums.js";import{LabeledSlider as v}from"./Weather/LabeledSlider.js";import y from"./Weather/VisibleElements.js";import b from"./Weather/WeatherViewModel.js";const w={sunny:"brightness",cloudy:"partly-cloudy",rainy:"rain",snowy:"snow",foggy:"fog"};let C=class extends n{constructor(e){super(e),this.viewModel=new b,this.headingLevel=4,this.visibleElements=new y,this._renderWeatherTypeButton=e=>{const o=this.viewModel,t=this.messages[e].label,r=o.state===g.Disabled,s=!r&&o.current.type===e;return p("calcite-button",{appearance:s?"solid":"outline","aria-checked":s?"true":"false",disabled:r,iconStart:w[e],key:`${e}-type-button`,kind:s?"brand":"neutral",label:t,onclick:()=>{s||o.setWeatherByType(e)},scale:"l",title:t})},this._memoizedCallbacks=o((e=>({onCloudCoverChange:o=>{"cloudCover"in e&&(e.cloudCover=o)},onPrecipitationChange:o=>{"precipitation"in e&&(e.precipitation=o)},onFogStrengthChange:o=>{"fogStrength"in e&&(e.fogStrength=o)},onSnowCoverChange:e=>{this.viewModel.setSnowCoverEnabled(e.currentTarget.checked)}})))}render(){const e=this.viewModel.state===g.Disabled;return p("div",{"aria-label":this.messages.widgetLabelAccessible,class:this.classes(h.base,a.widget,e&&a.widgetDisabled),role:"region"},this._renderContent())}loadDependencies(){return i({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label")})}get view(){return this.viewModel?.view}set view(e){this.viewModel&&(this.viewModel.view=e)}get icon(){return"partly-cloudy"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get _errorMessage(){const e=this.messages.error;switch(this.viewModel.error){case m.LocalScene:return e.localScene;case m.NoAtmosphere:return e.noAtmosphere;case m.UnsupportedView:return e.unsupported;default:return null}}get _warningMessage(){if(this.viewModel.error===m.NotVisible){return null!=this.view&&"3d"===this.view?.type&&this.view.environment.atmosphereEnabled?this.messages.error.notVisible:null}return null}_renderContent(){const{headingLevel:e,messages:o,viewModel:t,visibleElements:r}=this,n=this._warningMessage,i=t.current,a=t.state===g.Error;return p(u,null,r.header?p(l,{level:e},o.widgetLabel):null,a?p("div",{class:h.error,key:"error"},this._errorMessage):null,p("div",{class:c({[h.content]:!0,[h.hasError]:a}),key:"content"},p("div",{"aria-label":o.weatherType,class:h.selector,key:"type-selector",role:"radiogroup"},s.map(this._renderWeatherTypeButton)),Object.values(t.weatherByType).map((e=>p("div",{class:c({[h.options]:!0,[h.optionsHidden]:e.type!==i?.type}),key:"options-container"},this._renderOptions(e)))),null!=n?this._renderWarning(n):null))}_renderOptions(e){const{viewModel:o,messages:t}=this,r=o.state===g.Disabled,s=this._memoizedCallbacks(e);switch(e.type){case"sunny":return p(v,{disabled:r,key:"sunny-cover",label:t.sunny.cloudCover,value:e.cloudCover,onChange:s.onCloudCoverChange});case"cloudy":return p(v,{disabled:r,key:"cloudy-cover",label:t.cloudy.cloudCover,value:e.cloudCover,onChange:s.onCloudCoverChange});case"rainy":return p(u,null,p(v,{disabled:r,key:"rainy-cover",label:t.rainy.cloudCover,value:e.cloudCover,onChange:s.onCloudCoverChange}),p(v,{disabled:r,key:"rainy-precipitation",label:t.rainy.precipitation,value:e.precipitation,onChange:s.onPrecipitationChange}));case"snowy":return p(u,null,p(v,{disabled:r,key:"snowy-cloud-cover",label:t.snowy.cloudCover,value:e.cloudCover,onChange:s.onCloudCoverChange}),p(v,{disabled:r,key:"snowy-precipitation",label:t.snowy.precipitation,value:e.precipitation,onChange:s.onPrecipitationChange}),p("calcite-label",{key:"snow-cover",layout:"inline",scale:"s",title:t.snowy.snowCoverTooltip},p("calcite-checkbox",{checked:"enabled"===e.snowCover,disabled:r,onCalciteCheckboxChange:s.onSnowCoverChange}),t.snowy.snowCover));case"foggy":return p(v,{disabled:r,key:"foggy-cover",label:t.foggy.fogStrength,value:e.fogStrength,onChange:s.onFogStrengthChange})}}_renderWarning(e){return p("div",{class:h.warning,key:"warning"},p("calcite-icon",{icon:"exclamation-mark-triangle",scale:"s"}),e)}};e([t()],C.prototype,"viewModel",void 0),e([t()],C.prototype,"view",null),e([t()],C.prototype,"headingLevel",void 0),e([t({type:y,nonNullable:!0})],C.prototype,"visibleElements",void 0),e([t()],C.prototype,"icon",null),e([t()],C.prototype,"label",null),e([t(),d("esri/widgets/Weather/t9n/Weather")],C.prototype,"messages",void 0),e([t()],C.prototype,"_errorMessage",null),e([t()],C.prototype,"_warningMessage",null),C=e([r("esri.widgets.Weather")],C);const f=C;export{f as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{deprecateWidget as o}from"../core/deprecate.js";import t from"../core/Logger.js";import{memoize as r}from"../core/memoize.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import{weatherTypesArray as i}from"../views/3d/environment/weather.js";import a from"./Widget.js";import{loadCalciteComponents as l}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import{Heading as d}from"./support/Heading.js";import{classes as p}from"./support/widgetUtils.js";import{messageBundle as u}from"./support/decorators/messageBundle.js";import{tsx as h,tsxFragment as g}from"./support/jsxFactory.js";import{css as m}from"./Weather/css.js";import{WeatherState as v,WeatherError as y}from"./Weather/enums.js";import{LabeledSlider as b}from"./Weather/LabeledSlider.js";import w from"./Weather/VisibleElements.js";import C from"./Weather/WeatherViewModel.js";const f={sunny:"brightness",cloudy:"partly-cloudy",rainy:"rain",snowy:"snow",foggy:"fog"};let k=class extends a{constructor(e){super(e),this.viewModel=new C({isDefaultViewModel:!0}),this.headingLevel=4,this.visibleElements=new w,this._renderWeatherTypeButton=e=>{const o=this.viewModel,t=this.messages[e].label,r=o.state===v.Disabled,s=!r&&o.current.type===e;return h("calcite-button",{appearance:s?"solid":"outline","aria-checked":s?"true":"false",disabled:r,iconStart:f[e],key:`${e}-type-button`,kind:s?"brand":"neutral",label:t,onclick:()=>{s||o.setWeatherByType(e)},scale:"l",title:t})},this._memoizedCallbacks=r((e=>({onCloudCoverChange:o=>{"cloudCover"in e&&(e.cloudCover=o)},onPrecipitationChange:o=>{"precipitation"in e&&(e.precipitation=o)},onFogStrengthChange:o=>{"fogStrength"in e&&(e.fogStrength=o)},onSnowCoverChange:e=>{this.viewModel.setSnowCoverEnabled(e.currentTarget.checked)}}))),o(t.getLogger(this),"Weather","arcgis-weather",{version:"4.33"})}render(){const e=this.viewModel.state===v.Disabled;return h("div",{"aria-label":this.messages.widgetLabelAccessible,class:this.classes(m.base,c.widget,e&&c.widgetDisabled),role:"region"},this._renderContent())}loadDependencies(){return l({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label")})}get view(){return this.viewModel?.view}set view(e){this.viewModel&&(this.viewModel.view=e)}get icon(){return"partly-cloudy"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get _errorMessage(){const e=this.messages.error;switch(this.viewModel.error){case y.LocalScene:return e.localScene;case y.NoAtmosphere:return e.noAtmosphere;case y.UnsupportedView:return e.unsupported;default:return null}}get _warningMessage(){if(this.viewModel.error===y.NotVisible){return null!=this.view&&"3d"===this.view?.type&&this.view.environment.atmosphereEnabled?this.messages.error.notVisible:null}return null}_renderContent(){const{headingLevel:e,messages:o,viewModel:t,visibleElements:r}=this,s=this._warningMessage,n=t.current,a=t.state===v.Error;return h(g,null,r.header?h(d,{level:e},o.widgetLabel):null,a?h("div",{class:m.error,key:"error"},this._errorMessage):null,h("div",{class:p({[m.content]:!0,[m.hasError]:a}),key:"content"},h("div",{"aria-label":o.weatherType,class:m.selector,key:"type-selector",role:"radiogroup"},i.map(this._renderWeatherTypeButton)),Object.values(t.weatherByType).map((e=>h("div",{class:p({[m.options]:!0,[m.optionsHidden]:e.type!==n?.type}),key:"options-container"},this._renderOptions(e)))),null!=s?this._renderWarning(s):null))}_renderOptions(e){const{viewModel:o,messages:t}=this,r=o.state===v.Disabled,s=this._memoizedCallbacks(e);switch(e.type){case"sunny":return h(b,{disabled:r,key:"sunny-cover",label:t.sunny.cloudCover,value:e.cloudCover,onChange:s.onCloudCoverChange});case"cloudy":return h(b,{disabled:r,key:"cloudy-cover",label:t.cloudy.cloudCover,value:e.cloudCover,onChange:s.onCloudCoverChange});case"rainy":return h(g,null,h(b,{disabled:r,key:"rainy-cover",label:t.rainy.cloudCover,value:e.cloudCover,onChange:s.onCloudCoverChange}),h(b,{disabled:r,key:"rainy-precipitation",label:t.rainy.precipitation,value:e.precipitation,onChange:s.onPrecipitationChange}));case"snowy":return h(g,null,h(b,{disabled:r,key:"snowy-cloud-cover",label:t.snowy.cloudCover,value:e.cloudCover,onChange:s.onCloudCoverChange}),h(b,{disabled:r,key:"snowy-precipitation",label:t.snowy.precipitation,value:e.precipitation,onChange:s.onPrecipitationChange}),h("calcite-label",{key:"snow-cover",layout:"inline",scale:"s",title:t.snowy.snowCoverTooltip},h("calcite-checkbox",{checked:"enabled"===e.snowCover,disabled:r,onCalciteCheckboxChange:s.onSnowCoverChange}),t.snowy.snowCover));case"foggy":return h(b,{disabled:r,key:"foggy-cover",label:t.foggy.fogStrength,value:e.fogStrength,onChange:s.onFogStrengthChange})}}_renderWarning(e){return h("div",{class:m.warning,key:"warning"},h("calcite-icon",{icon:"exclamation-mark-triangle",scale:"s"}),e)}};e([s()],k.prototype,"viewModel",void 0),e([s()],k.prototype,"view",null),e([s()],k.prototype,"headingLevel",void 0),e([s({type:w,nonNullable:!0})],k.prototype,"visibleElements",void 0),e([s()],k.prototype,"icon",null),e([s()],k.prototype,"label",null),e([s(),u("esri/widgets/Weather/t9n/Weather")],k.prototype,"messages",void 0),e([s()],k.prototype,"_errorMessage",null),e([s()],k.prototype,"_warningMessage",null),k=e([n("esri.widgets.Weather")],k);const j=k;export{j as default};