@arcgis/core 4.33.0-next.20250603 → 4.33.0-next.20250605

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 (119) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{6d90887dc605261dd7b3.js → 062e88b6eb4d45169856.js} +1 -1
  3. package/assets/esri/core/workers/chunks/0ff6f15d46d7ddf6fe4d.js +1 -0
  4. package/assets/esri/core/workers/chunks/{cc37bfa72c34bc2ef993.js → 28677588ec75bc08ade9.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{0039dee1337160366112.js → 3145218abe59b5e99ff8.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{dea3e131bbd48cc48e1a.js → 369978472cc9ee6a00b5.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{539541dec5fcf3b657aa.js → 3f58da371633967a61ca.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{f48eb59b94ba8b7d4d72.js → 4079e307a0fce4516aa4.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{e0ae33206f519b159b49.js → 5853b2af6ac8be2c69d8.js} +1 -1
  10. package/assets/esri/core/workers/chunks/64f5f27e7c5649d79cbc.js +1 -0
  11. package/assets/esri/core/workers/chunks/{6b0ae9ccdd1acef5b5b4.js → 679d7baea233faf3fdbc.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{51c31e6d014005107d42.js → 68e432a80bf6fa7b17fb.js} +1 -1
  13. package/assets/esri/core/workers/chunks/86c12fcaf8d0c96a52ba.js +1 -0
  14. package/assets/esri/core/workers/chunks/97b69fec3e87f11210ba.js +1 -0
  15. package/assets/esri/core/workers/chunks/{fda48126f67e80034404.js → 998819aade3898f52414.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{427318722815bef1496b.js → a08ce98672ab94d19613.js} +1 -1
  17. package/assets/esri/core/workers/chunks/a6fb75929e456f87f804.js +1 -0
  18. package/assets/esri/core/workers/chunks/b72137c63b7f2a525d9e.js +1 -0
  19. package/assets/esri/core/workers/chunks/c2264451d12f1fbaad22.js +1 -0
  20. package/assets/esri/core/workers/chunks/c23cc0eaaf737af3ac35.js +1 -0
  21. package/assets/esri/core/workers/chunks/{562800b0af52a38a311b.js → cf25f487fe4eb1579aee.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{a41f9b6deff08196566e.js → fa894be8cfb6ed485df9.js} +1 -1
  23. package/assets/esri/core/workers/chunks/fe3703ec198cbfebec30.js +1 -0
  24. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  25. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
  26. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
  27. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
  28. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
  29. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
  30. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
  31. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
  32. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
  33. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  34. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
  35. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
  36. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
  37. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
  38. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
  39. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
  40. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
  41. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
  42. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
  43. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
  44. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
  45. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
  46. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
  47. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
  48. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
  49. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
  50. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
  51. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
  52. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
  53. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
  54. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
  55. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
  56. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
  57. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
  58. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
  59. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
  60. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
  61. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
  62. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
  63. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
  64. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
  65. package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
  66. package/chunks/FocusAreaMask.glsl.js +1 -1
  67. package/core/urlUtils.js +1 -1
  68. package/geometry/support/coordsUtils.js +1 -1
  69. package/interfaces.d.ts +148 -81
  70. package/layers/CatalogLayer.js +1 -1
  71. package/layers/FeatureLayer.js +1 -1
  72. package/layers/VideoLayer.js +1 -1
  73. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  74. package/layers/mixins/ArcGISImageService.js +1 -1
  75. package/layers/mixins/FeatureLayerBase.js +1 -1
  76. package/layers/support/arcgisLayers.js +1 -1
  77. package/layers/support/fetchService.js +1 -1
  78. package/layers/support/layerUtils.js +1 -1
  79. package/networks/UtilityNetwork.js +1 -1
  80. package/package.json +1 -1
  81. package/portal/support/layersLoader.js +1 -1
  82. package/portal/support/loadUtils.js +1 -1
  83. package/portal/support/portalLayers.js +1 -1
  84. package/rest/networks/queryAssociations.js +1 -1
  85. package/support/revision.js +1 -1
  86. package/views/3d/FocusAreasView.js +1 -1
  87. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  88. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  89. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  90. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  91. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  92. package/views/3d/webgl-engine/effects/focusArea/FocusAreaOutlineItem.js +1 -1
  93. package/webscene/Slide.js +1 -1
  94. package/widgets/BasemapLayerList.js +1 -1
  95. package/widgets/BatchAttributeForm.js +1 -1
  96. package/widgets/CatalogLayerList.js +1 -1
  97. package/widgets/Editor/UpdateWorkflow.js +1 -1
  98. package/widgets/Editor/UpdateWorkflowData.js +1 -1
  99. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  100. package/widgets/LayerList.js +1 -1
  101. package/widgets/ShadowCast/DiscreteOptions.js +1 -1
  102. package/widgets/ShadowCast/DurationOptions.js +1 -1
  103. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  104. package/widgets/ShadowCast/ShadowCastVisibleElements.js +1 -1
  105. package/widgets/ShadowCast/ThresholdOptions.js +1 -1
  106. package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
  107. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  108. package/widgets/TableList.js +1 -1
  109. package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
  110. package/widgets/support/UtilityNetworkAssociations/utils/isFromElement.js +1 -1
  111. package/assets/esri/core/workers/chunks/464c15b2779f9b803a06.js +0 -1
  112. package/assets/esri/core/workers/chunks/543b8dc8baa21b99147b.js +0 -1
  113. package/assets/esri/core/workers/chunks/5d3246b8fc50f9d9e2c4.js +0 -1
  114. package/assets/esri/core/workers/chunks/7a2189614f2dad49ffcd.js +0 -1
  115. package/assets/esri/core/workers/chunks/87623ebe32c6ae9cb223.js +0 -1
  116. package/assets/esri/core/workers/chunks/b09539a4b491a90a6bbe.js +0 -1
  117. package/assets/esri/core/workers/chunks/b6c3a2d93a59df9a1418.js +0 -1
  118. package/assets/esri/core/workers/chunks/e04bcc98a557f77cc6fa.js +0 -1
  119. package/assets/esri/core/workers/chunks/eb23ce385b0d18959c7c.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 t}from"../../chunks/tslib.es6.js";import o from"../../core/Accessor.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends o{constructor(t){super(t),this.addAttachmentsCallback=null,this.applyEditsCallback=null,this.applyEditsFeatureServiceCallback=null,this.candidates=null,this.rootFeature=null,this.sketchOptions=null,this.snappingManager=null,this.viewModel=null}};t([e()],s.prototype,"addAttachmentsCallback",void 0),t([e()],s.prototype,"applyEditsCallback",void 0),t([e()],s.prototype,"applyEditsFeatureServiceCallback",void 0),t([e()],s.prototype,"candidates",void 0),t([e()],s.prototype,"rootFeature",void 0),t([e({constructOnly:!0})],s.prototype,"sketchOptions",void 0),t([e()],s.prototype,"snappingManager",void 0),t([e()],s.prototype,"viewModel",void 0),s=t([r("esri.widgets.Editor.UpdateWorkflowData")],s);const a=s;export{a as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import o from"../../core/Accessor.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends o{constructor(t){super(t),this.addAttachmentsCallback=null,this.applyEditsCallback=null,this.applyEditsFeatureServiceCallback=null,this.candidates=[],this.rootFeature=null,this.sketchOptions=null,this.snappingManager=null,this.viewModel=null}};t([e()],s.prototype,"addAttachmentsCallback",void 0),t([e()],s.prototype,"applyEditsCallback",void 0),t([e()],s.prototype,"applyEditsFeatureServiceCallback",void 0),t([e()],s.prototype,"candidates",void 0),t([e()],s.prototype,"rootFeature",void 0),t([e({constructOnly:!0})],s.prototype,"sketchOptions",void 0),t([e()],s.prototype,"snappingManager",void 0),t([e()],s.prototype,"viewModel",void 0),s=t([r("esri.widgets.Editor.UpdateWorkflowData")],s);const a=s;export{a 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{watch as t,on as r,initial as i}from"../../../core/reactiveUtils.js";import{stripHTML as s}from"../../../core/string.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{defaultHighlightName as a,temporaryHighlightName as n}from"../../../views/support/HighlightDefaults.js";import c from"../../Widget.js";import d from"../UtilityNetworkAssociationAddAssociationViewModel.js";import{loadCalciteComponents as u}from"../../support/componentsUtils.js";import p from"../../support/FilterBuilder.js";import{globalCss as h}from"../../support/globalCss.js";import{Heading as m}from"../../support/Heading.js";import _ from"../../support/SelectionToolbar.js";import"../../support/widgetUtils.js";import{messageBundle as f}from"../../support/decorators/messageBundle.js";import{tsx as v}from"../../support/jsxFactory.js";import g from"../../support/SelectionToolbar/VisibleElements.js";import{substitute as y}from"../../../intl/substitute.js";const b="esri-feature-form-utility-network-association-layers",F={base:b,header:`${b}__header`,headingContent:`${b}__heading-content`,featureObserver:`${b}__feature-observer`,filterContainer:`${b}__filter-container`,filterOptionsContainer:`${b}__filter-options-container`,filterOptionsHeader:`${b}__filter-options-header`,listContainer:`${b}__list-container`,spatialSelectContainer:`${b}__spatial-select-container`,spatialSelectToolbar:`${b}__spatial-select-toolbar`,stickySpinnerContainer:`${b}__sticky-loading-container`,loadingContainer:`${b}__loading-container`};let w=class extends c{constructor(e,t){super(e,t),this.headingLevel=5,this.messagesCommon=null,this.messagesEditor=null,this.messagesFeature=null,this.messagesFeatureForm=null,this.messagesFilterBuilder=null,this.viewModel=new d,this.view=null,this._filterBuilder=new p,this._featureFilterText="",this._layerFilterText="",this._observer=new IntersectionObserver((([e])=>{e?.isIntersecting&&this._increaseFeaturePage()}),{root:window.document}),this._observerNode=null,this._selectionToolbar=new _({returnFeatureTitleFields:!0,layerViewPreferenceEnabled:!1,persistSelection:!1,visibleElements:new g({chip:!1,pan:!1})}),this._onSelectionComplete=async e=>{const{highlightHelper:t}=this.viewModel;await this.viewModel.onSelectionComplete(e),t?.removeAll(),this._featureSpatialGraphics.length>0&&t?.add(this._featureSpatialGraphics)}}initialize(){this._setupSelectionToolbar(),this.addHandles([t((()=>this.viewModel),(()=>this.reset())),t((()=>[this.viewModel.state,this._observerNode]),(()=>this._onObserverChange())),t((()=>this.selectedLayer),(e=>{this._filterBuilder.layer=e,e||(this.filterOptionsVisible=!1,this._featureFilterText="")}))])}loadDependencies(){return u({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._filterBuilder.destroy(),this._selectionToolbar.destroy()}get filterOptionsVisible(){return this.viewModel.filterOptionsVisible}set filterOptionsVisible(e){this.viewModel.filterOptionsVisible=e}get isSelecting(){return"active"===this._selectionToolbar.state}get selectedLayer(){return this.viewModel.selectedLayer}set selectedLayer(e){this.viewModel.selectedLayer=e}get selectedFeature(){return this.viewModel.selectedFeature}set selectedFeature(e){this.viewModel.selectedFeature=e}get filterWhereClause(){return this.viewModel.filterWhereClause}set filterWhereClause(e){this.viewModel.filterWhereClause=e,e||this._filterBuilder.reset()}get _featureSpatialGraphics(){return this.viewModel.featureSpatialItems.toArray().map((e=>e.feature))}get _filteredFeatureItems(){const{_featureFilterText:e}=this,{featureItems:t,featureSpatialItems:r}=this.viewModel;return(r.length?r:t).map((e=>({label:e.label,graphic:e.feature,layer:e.feature.sourceLayer}))).filter((t=>t.label?.toLowerCase().includes(e)??!1))}get _filteredFeatureItemsPage(){const{featurePage:e,featuresPerPage:t}=this.viewModel,r=e*t;return this._filteredFeatureItems.toArray().slice(0,r)}render(){return v("div",{class:this.classes(F.base,h.widget)},this._renderContent())}applyFilterOptions(){const{selectedLayer:e}=this;this.filterOptionsVisible=!1,e&&(this.filterWhereClause=this._filterBuilder.whereClause)}cancelSelection(){this._selectionToolbar.cancel()}reset(){this.filterWhereClause=null,this._featureFilterText="",this._layerFilterText="",this.filterOptionsVisible=!1,this._filterBuilder.reset()}startSelection(e){this._selectionToolbar.activateTool(e)}_setupSelectionToolbar(){this.addHandles([t((()=>this.view),(e=>{this.viewModel.reset(),this._selectionToolbar.view="2d"===e?.type?e:null}),i),t((()=>[this.viewModel,this.viewModel.layerItems.length]),(()=>this._selectionToolbar.sources=this.viewModel.layerItems.toArray())),r((()=>this._selectionToolbar),"before-activate",(e=>this.emit("before-selection",e))),r((()=>this._selectionToolbar),"complete",this._onSelectionComplete)])}async _onObserverChange(){this._observerNode&&this._observer.unobserve(this._observerNode);const{state:e}=this.viewModel;this._observerNode&&"ready"===e&&this._observer.observe(this._observerNode)}_increaseFeaturePage(){const{featureCount:e,featurePage:t,featureSpatialItems:r,state:i}=this.viewModel;e||r.length||1===t?"ready"===i&&this.viewModel.featurePage++:this.viewModel.featurePage=1}_renderContent(){const{state:e,filterOptionsVisible:t}=this.viewModel;return"loading"===e?this._renderLoading():t?this._renderFilterOptions():[this._renderSelectionToolbar(),this._renderListContent()]}_renderListContent(){return this._selectionToolbar.activeOperation?.processingFinalSelection?this._renderLoading():this.selectedLayer||this.viewModel.featureSpatialItems.length?this._renderFeatures():this._renderLayers()}_renderSelectionToolbar(){const{messagesCommon:e,_selectionToolbar:t}=this,{featureSpatialItems:r,selectedLayer:i}=this.viewModel;if(i||!t.sources?.length)return null;const s=v("div",{class:F.spatialSelectToolbar},t.render()),o=v("calcite-button",{appearance:"transparent",disabled:!r.length,label:e.clear,onclick:()=>this.viewModel.reset()},e.clear);return v("div",{class:F.spatialSelectContainer,key:"spatial-select-toolbar"},s,o)}_renderStickyLoading(){return"querying"===this.viewModel.state?v("div",{class:F.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoading(){return v("div",{class:F.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderLoadingIcon(){return v("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderFilterOptions(){return v("div",{class:F.filterOptionsContainer},v("div",{class:F.filterOptionsHeader},v("span",null,this.messagesFilterBuilder.widgetLabel),v("calcite-button",{appearance:"transparent",onclick:()=>this._filterBuilder.reset()},this.messagesCommon.clear)),this._filterBuilder.render())}_renderLayers(){const e=this.messagesFeatureForm.associations,t=e.availableLayers,r=e.filterLayers;return v("div",null,this._renderHeader({heading:t,placeholder:r,renderFilterOptions:!1,renderTotal:!1}),v("div",{class:F.listContainer},v("calcite-list",{label:e.associatedFeatures},this._renderLayerItems(),this._renderStickyLoading())))}_renderLayerItems(){const{_layerFilterText:e,viewModel:t,messagesCommon:r}=this,{layerItems:i,tableItems:s}=t;return i.concat(s).map((e=>({label:e.title??r.untitled,layer:e}))).filter((t=>t.label?.toLowerCase().includes(e)??!1)).toArray().map((e=>this._renderLayerItem(e)))}_renderLayerItem(e){const{label:t,layer:r}=e;return v("calcite-list-item",{key:`layer-item-${r.id}`,label:s(t),onCalciteListItemSelect:()=>{this.selectedLayer=r,this._filterBuilder.reset()}},v("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderFeatures(){const{selectedLayer:e,viewModel:t}=this,r=t.featureSpatialItems.length>0,i=this.messagesFeatureForm.associations,s=r?void 0:e?.title||this.messagesCommon.untitled,o=i.filterFeatures;return v("div",null,this._renderHeader({heading:s,placeholder:o,renderFilterOptions:!r,renderTotal:!0}),v("div",{class:F.listContainer},v("calcite-list",{label:i.associatedFeatures},this._renderFeatureItems(),this._renderStickyLoading(),this._renderFeatureObserver())))}_renderFeatureItems(){return this._filteredFeatureItemsPage.map((e=>this._renderFeatureItem(e)))}_renderFeatureItem(e){const{viewModel:t}=this,{highlightHelper:r}=t,{label:i,graphic:o}=e,l=t.featureSpatialItems.length>0?()=>r?.update(o,a):void 0,c=t.featureSpatialItems.length>0?()=>r?.update(o,n):void 0;return v("calcite-list-item",{key:`feature-item-${o.uid}`,label:s(i),onmouseenter:l,onmouseleave:c,onCalciteListItemSelect:()=>{this.selectedFeature={feature:o,label:i}}},v("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_onObserverCreate(e){this._observerNode=e}_renderFeatureObserver(){return v("div",{afterCreate:this._onObserverCreate,bind:this,class:F.featureObserver,key:"feature-observer"})}_renderHeader(e){return v("div",{class:F.header,key:"filter"},this._renderHeading(e.heading),this._renderFilter(e.placeholder,e.renderFilterOptions),e.renderTotal?this._renderTotal():null)}_renderHeading(e){return e?v(m,{key:"title",level:this.headingLevel},v("div",{class:F.headingContent},v("calcite-icon",{icon:"layer"}),e)):null}_renderFilter(e,t){const r=!this.selectedLayer&&!this.viewModel.featureSpatialItems.length,i=r?this._layerFilterText:this._featureFilterText;return v("div",{class:F.filterContainer,key:"filter"},v("calcite-input",{icon:"search",placeholder:e,type:"search",value:i,onCalciteInputInput:e=>{r?this._layerFilterText=e.currentTarget.value.trim().toLowerCase():this._featureFilterText=e.currentTarget.value.trim().toLowerCase()}},t?this._renderFilterOptionsAction():null))}_renderFilterOptionsAction(){const e=this.messagesFeatureForm.associations.filterOptions;return v("calcite-action",{appearance:"transparent",icon:"sliders",indicator:!!this._filterBuilder.whereClause,onclick:()=>{this.viewModel.filterOptionsVisible=!this.viewModel.filterOptionsVisible},scale:"s",slot:"action",text:e,title:e})}_renderTotal(){const{messagesFeature:e,viewModel:t}=this,{featureCount:r,featureSpatialItems:i}=t,s=y(e.numberRecords,{number:i.length?i.length:r});return v("div",{key:"total"},s)}};e([o()],w.prototype,"filterOptionsVisible",null),e([o()],w.prototype,"headingLevel",void 0),e([o()],w.prototype,"isSelecting",null),e([o(),f("esri/t9n/common")],w.prototype,"messagesCommon",void 0),e([o(),f("esri/widgets/Editor/t9n/Editor")],w.prototype,"messagesEditor",void 0),e([o(),f("esri/widgets/Feature/t9n/Feature")],w.prototype,"messagesFeature",void 0),e([o(),f("esri/widgets/FeatureForm/t9n/FeatureForm")],w.prototype,"messagesFeatureForm",void 0),e([o(),f("esri/widgets/support/FilterBuilder/t9n/FilterBuilder")],w.prototype,"messagesFilterBuilder",void 0),e([o()],w.prototype,"selectedLayer",null),e([o({type:d})],w.prototype,"viewModel",void 0),e([o()],w.prototype,"selectedFeature",null),e([o()],w.prototype,"filterWhereClause",null),e([o()],w.prototype,"view",void 0),e([o()],w.prototype,"_filterBuilder",void 0),e([o()],w.prototype,"_featureFilterText",void 0),e([o()],w.prototype,"_layerFilterText",void 0),e([o()],w.prototype,"_observer",void 0),e([o()],w.prototype,"_featureSpatialGraphics",null),e([o()],w.prototype,"_filteredFeatureItems",null),e([o()],w.prototype,"_filteredFeatureItemsPage",null),e([o()],w.prototype,"_observerNode",void 0),w=e([l("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.UtilityNetworkAssociationItemList")],w);const C=w;export{C as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../intl.js";import{watch as t,on as r,initial as i}from"../../../core/reactiveUtils.js";import{stripHTML as s}from"../../../core/string.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{isSubtypeGroupLayer as a,isGroupLayer as n}from"../../../layers/support/layerUtils.js";import{defaultHighlightName as c,temporaryHighlightName as d}from"../../../views/support/HighlightDefaults.js";import p from"../../Widget.js";import u from"../UtilityNetworkAssociationAddAssociationViewModel.js";import{loadCalciteComponents as h}from"../../support/componentsUtils.js";import m from"../../support/FilterBuilder.js";import{globalCss as _}from"../../support/globalCss.js";import{Heading as v}from"../../support/Heading.js";import f from"../../support/SelectionToolbar.js";import"../../support/widgetUtils.js";import{messageBundle as g}from"../../support/decorators/messageBundle.js";import{tsx as y}from"../../support/jsxFactory.js";import b from"../../support/SelectionToolbar/VisibleElements.js";import{substitute as F}from"../../../intl/substitute.js";const w="esri-feature-form-utility-network-association-layers",C={base:w,header:`${w}__header`,headingContent:`${w}__heading-content`,featureObserver:`${w}__feature-observer`,filterContainer:`${w}__filter-container`,filterOptionsContainer:`${w}__filter-options-container`,filterOptionsHeader:`${w}__filter-options-header`,listContainer:`${w}__list-container`,spatialSelectContainer:`${w}__spatial-select-container`,spatialSelectToolbar:`${w}__spatial-select-toolbar`,stickySpinnerContainer:`${w}__sticky-loading-container`,loadingContainer:`${w}__loading-container`};let L=class extends p{constructor(e,t){super(e,t),this.headingLevel=5,this.messagesCommon=null,this.messagesEditor=null,this.messagesFeature=null,this.messagesFeatureForm=null,this.messagesFilterBuilder=null,this.viewModel=new u,this.view=null,this._filterBuilder=new m,this._featureFilterText="",this._layerFilterText="",this._observer=new IntersectionObserver((([e])=>{e?.isIntersecting&&this._increaseFeaturePage()}),{root:window.document}),this._observerNode=null,this._selectionToolbar=new f({returnFeatureTitleFields:!0,layerViewPreferenceEnabled:!1,persistSelection:!1,visibleElements:new b({chip:!1,pan:!1})}),this._onSelectionComplete=async e=>{const{highlightHelper:t}=this.viewModel;await this.viewModel.onSelectionComplete(e),t?.removeAll(),this._featureSpatialGraphics.length>0&&t?.add(this._featureSpatialGraphics)}}initialize(){this._setupSelectionToolbar(),this.addHandles([t((()=>this.viewModel),(()=>this.reset())),t((()=>[this.viewModel.state,this._observerNode]),(()=>this._onObserverChange())),t((()=>this.selectedLayer),(e=>{this._filterBuilder.layer=e,e||(this.filterOptionsVisible=!1,this._featureFilterText="")}))])}loadDependencies(){return h({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._filterBuilder.destroy(),this._selectionToolbar.destroy()}get filterOptionsVisible(){return this.viewModel.filterOptionsVisible}set filterOptionsVisible(e){this.viewModel.filterOptionsVisible=e}get isSelecting(){return"active"===this._selectionToolbar.state}get selectedLayer(){return this.viewModel.selectedLayer}set selectedLayer(e){this.viewModel.selectedLayer=e}get selectedFeature(){return this.viewModel.selectedFeature}set selectedFeature(e){this.viewModel.selectedFeature=e}get filterWhereClause(){return this.viewModel.filterWhereClause}set filterWhereClause(e){this.viewModel.filterWhereClause=e,e||this._filterBuilder.reset()}get _featureSpatialGraphics(){return this.viewModel.featureSpatialItems.toArray().map((e=>e.feature))}get _filteredFeatureItems(){const{_featureFilterText:e}=this,{featureItems:t,featureSpatialItems:r}=this.viewModel;return(r.length?r:t).map((e=>({label:e.label,graphic:e.feature,layer:e.feature.sourceLayer}))).filter((t=>t.label?.toLowerCase().includes(e)??!1))}get _filteredFeatureItemsPage(){const{featurePage:e,featuresPerPage:t}=this.viewModel,r=e*t;return this._filteredFeatureItems.toArray().slice(0,r)}render(){return y("div",{class:this.classes(C.base,_.widget)},this._renderContent())}applyFilterOptions(){const{selectedLayer:e}=this;this.filterOptionsVisible=!1,e&&(this.filterWhereClause=this._filterBuilder.whereClause)}cancelSelection(){this._selectionToolbar.cancel()}reset(){this.filterWhereClause=null,this._featureFilterText="",this._layerFilterText="",this.filterOptionsVisible=!1,this._filterBuilder.reset()}startSelection(e){this._selectionToolbar.activateTool(e)}_setupSelectionToolbar(){this.addHandles([t((()=>this.view),(e=>{this.viewModel.reset(),this._selectionToolbar.view="2d"===e?.type?e:null}),i),t((()=>[this.viewModel,this.viewModel.layerItems.length,this.viewModel.map?.allLayers.map((e=>e.visible)),this.viewModel.map?.allLayers?.filter((e=>a(e))).toArray().flatMap((e=>e.sublayers.toArray())).map((e=>e.visible))]),(()=>this._updateToolbarSources())),r((()=>this._selectionToolbar),"before-activate",(e=>this.emit("before-selection",e))),r((()=>this._selectionToolbar),"complete",this._onSelectionComplete)])}_updateToolbarSources(){const e=this.viewModel.layerItems.toArray().filter((e=>{const{parent:t}=e;return!(t&&(n(t)||a(t))&&!t.visible)&&e.visible}));this._selectionToolbar.sources=e}async _onObserverChange(){this._observerNode&&this._observer.unobserve(this._observerNode);const{state:e}=this.viewModel;this._observerNode&&"ready"===e&&this._observer.observe(this._observerNode)}_increaseFeaturePage(){const{featureCount:e,featurePage:t,featureSpatialItems:r,state:i}=this.viewModel;e||r.length||1===t?"ready"===i&&this.viewModel.featurePage++:this.viewModel.featurePage=1}_renderContent(){const{state:e,filterOptionsVisible:t}=this.viewModel;return"loading"===e?this._renderLoading():t?this._renderFilterOptions():[this._renderSelectionToolbar(),this._renderListContent()]}_renderListContent(){return this._selectionToolbar.activeOperation?.processingFinalSelection?this._renderLoading():this.selectedLayer||this.viewModel.featureSpatialItems.length?this._renderFeatures():this._renderLayers()}_renderSelectionToolbar(){const{messagesCommon:e,_selectionToolbar:t}=this,{featureSpatialItems:r,selectedLayer:i}=this.viewModel;if(i||!t.sources?.length)return null;const s=y("div",{class:C.spatialSelectToolbar},t.render()),o=y("calcite-button",{appearance:"transparent",disabled:!r.length,label:e.clear,onclick:()=>this.viewModel.reset()},e.clear);return y("div",{class:C.spatialSelectContainer,key:"spatial-select-toolbar"},s,o)}_renderStickyLoading(){return"querying"===this.viewModel.state?y("div",{class:C.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoading(){return y("div",{class:C.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderLoadingIcon(){return y("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderFilterOptions(){return y("div",{class:C.filterOptionsContainer},y("div",{class:C.filterOptionsHeader},y("span",null,this.messagesFilterBuilder.widgetLabel),y("calcite-button",{appearance:"transparent",onclick:()=>this._filterBuilder.reset()},this.messagesCommon.clear)),this._filterBuilder.render())}_renderLayers(){const e=this.messagesFeatureForm.associations,t=e.availableLayers,r=e.filterLayers;return y("div",null,this._renderHeader({heading:t,placeholder:r,renderFilterOptions:!1,renderTotal:!1}),y("div",{class:C.listContainer},y("calcite-list",{label:e.associatedFeatures},this._renderLayerItems(),this._renderStickyLoading())))}_renderLayerItems(){const{_layerFilterText:e,viewModel:t,messagesCommon:r}=this,{layerItems:i,tableItems:s}=t;return i.concat(s).map((e=>({label:e.title??r.untitled,layer:e}))).filter((t=>t.label?.toLowerCase().includes(e)??!1)).toArray().map((e=>this._renderLayerItem(e)))}_renderLayerItem(e){const{label:t,layer:r}=e;return y("calcite-list-item",{key:`layer-item-${r.id}`,label:s(t),onCalciteListItemSelect:()=>{this.selectedLayer=r,this._filterBuilder.reset()}},y("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderFeatures(){const{selectedLayer:e,viewModel:t}=this,r=t.featureSpatialItems.length>0,i=this.messagesFeatureForm.associations,s=r?void 0:e?.title||this.messagesCommon.untitled,o=i.filterFeatures;return y("div",null,this._renderHeader({heading:s,placeholder:o,renderFilterOptions:!r,renderTotal:!0}),y("div",{class:C.listContainer},y("calcite-list",{label:i.associatedFeatures},this._renderFeatureItems(),this._renderStickyLoading(),this._renderFeatureObserver())))}_renderFeatureItems(){return this._filteredFeatureItemsPage.map((e=>this._renderFeatureItem(e)))}_renderFeatureItem(e){const{viewModel:t}=this,{highlightHelper:r}=t,{label:i,graphic:o}=e,l=t.featureSpatialItems.length>0?()=>r?.update(o,c):void 0,a=t.featureSpatialItems.length>0?()=>r?.update(o,d):void 0;return y("calcite-list-item",{key:`feature-item-${o.uid}`,label:s(i),onmouseenter:l,onmouseleave:a,onCalciteListItemSelect:()=>{this.selectedFeature={feature:o,label:i}}},y("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_onObserverCreate(e){this._observerNode=e}_renderFeatureObserver(){return y("div",{afterCreate:this._onObserverCreate,bind:this,class:C.featureObserver,key:"feature-observer"})}_renderHeader(e){return y("div",{class:C.header,key:"filter"},this._renderHeading(e.heading),this._renderFilter(e.placeholder,e.renderFilterOptions),e.renderTotal?this._renderTotal():null)}_renderHeading(e){return e?y(v,{key:"title",level:this.headingLevel},y("div",{class:C.headingContent},y("calcite-icon",{icon:"layer"}),e)):null}_renderFilter(e,t){const r=!this.selectedLayer&&!this.viewModel.featureSpatialItems.length,i=r?this._layerFilterText:this._featureFilterText;return y("div",{class:C.filterContainer,key:"filter"},y("calcite-input",{icon:"search",placeholder:e,type:"search",value:i,onCalciteInputInput:e=>{r?this._layerFilterText=e.currentTarget.value.trim().toLowerCase():this._featureFilterText=e.currentTarget.value.trim().toLowerCase()}},t?this._renderFilterOptionsAction():null))}_renderFilterOptionsAction(){const e=this.messagesFeatureForm.associations.filterOptions;return y("calcite-action",{appearance:"transparent",icon:"sliders",indicator:!!this._filterBuilder.whereClause,onclick:()=>{this.viewModel.filterOptionsVisible=!this.viewModel.filterOptionsVisible},scale:"s",slot:"action",text:e,title:e})}_renderTotal(){const{messagesFeature:e,viewModel:t}=this,{featureCount:r,featureSpatialItems:i}=t,s=F(e.numberRecords,{number:i.length?i.length:r});return y("div",{key:"total"},s)}};e([o()],L.prototype,"filterOptionsVisible",null),e([o()],L.prototype,"headingLevel",void 0),e([o()],L.prototype,"isSelecting",null),e([o(),g("esri/t9n/common")],L.prototype,"messagesCommon",void 0),e([o(),g("esri/widgets/Editor/t9n/Editor")],L.prototype,"messagesEditor",void 0),e([o(),g("esri/widgets/Feature/t9n/Feature")],L.prototype,"messagesFeature",void 0),e([o(),g("esri/widgets/FeatureForm/t9n/FeatureForm")],L.prototype,"messagesFeatureForm",void 0),e([o(),g("esri/widgets/support/FilterBuilder/t9n/FilterBuilder")],L.prototype,"messagesFilterBuilder",void 0),e([o()],L.prototype,"selectedLayer",null),e([o({type:u})],L.prototype,"viewModel",void 0),e([o()],L.prototype,"selectedFeature",null),e([o()],L.prototype,"filterWhereClause",null),e([o()],L.prototype,"view",void 0),e([o()],L.prototype,"_filterBuilder",void 0),e([o()],L.prototype,"_featureFilterText",void 0),e([o()],L.prototype,"_layerFilterText",void 0),e([o()],L.prototype,"_observer",void 0),e([o()],L.prototype,"_featureSpatialGraphics",null),e([o()],L.prototype,"_filteredFeatureItems",null),e([o()],L.prototype,"_filteredFeatureItemsPage",null),e([o()],L.prototype,"_observerNode",void 0),L=e([l("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.UtilityNetworkAssociationItemList")],L);const S=L;export{S 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/Collection.js";import i from"../core/Identifiable.js";import o from"../core/ReactiveMap.js";import{on as s,watch as l,initial as r}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 n}from"../core/accessorSupport/decorators/subclass.js";import d from"./Widget.js";import{css as p}from"./LayerList/css.js";import c from"./LayerList/LayerListItem.js";import m from"./LayerList/LayerListViewModel.js";import h from"./LayerList/LayerListVisibleElements.js";import y from"./LayerList/ListItem.js";import{minDragEnabledItems as u,minFilterItems as g,getItem as _,getLayerType as L,removeDestroyedListItems as f,setFilterPredicate as v,sortLayersToIds as I,sortChildLayersToIds as w}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as b}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{calciteListFilterProps as E}from"./support/listUtils.js";import{setFocus as F}from"./support/widgetUtils.js";import{messageBundle as M}from"./support/decorators/messageBundle.js";import{vmEvent as O}from"./support/decorators/vmEvent.js";import{tsx as T}from"./support/jsxFactory.js";const P=t.ofType(y),A="nested";let j=class extends(i.IdentifiableMixin(d)){constructor(e,i){super(e,i),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new o,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new o,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=u,this.minFilterItems=g,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new P,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new m,this.visibilityAppearance="default",this.visibleElements=new h,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=_(e);if(!l?.sortable)return!1;const r=_(t),a=L(t),n=_(i),d=L(i),p=!!a&&!!d&&a===d,c={selected:l,from:r,to:n},m=t.group,h=i.group,y=r?.layer?.type??"",u=n?.layer?.type??"",g=new Set(["map-image","catalog","knowledge-graph"]),f="sublayer";return m&&h&&"function"==typeof s?s.call(null,c):p&&!g.has(y)&&!g.has(u)&&l?.layer?.type!==f},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find((e=>e.classList?.contains(p.item)));this._activeItem=_(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:o,dragEl:s,newIndex:l}=e;if(o&&i&&!(t?.newIndex===l&&t?.dragEl===s&&t?.toEl===i&&t?.fromEl===o))if(this._lastDragDetail=e,this._selectedDragItemLayerUid=s.value,o!==i)this._moveLayerFromChildList({toEl:i,fromEl:o,dragEl:s,newIndex:l});else{const e=Array.from(o.children).filter((e=>e?.matches("calcite-list-item"))).map((e=>e.value));this._sortLayers(o,e)}}}initialize(){this.addHandles([s((()=>this.openedLayers),"change",(()=>this._handleOpenedLayersChange()),r),s((()=>this.viewModel.operationalItems),"change",(()=>f(this.selectedItems)),r),l((()=>[this.filterPredicate,this._rootListEl]),(()=>v(this._rootListEl,this.filterPredicate)))])}loadDependencies(){return b({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _totalItems(){return this.viewModel.operationalItems.flatten((e=>e.children.filter((e=>"catalog-dynamic-group"!==e.layer?.type)))).length}get _visibleItems(){return this.operationalItems?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error)))}get _openedPanelItems(){return this._visibleItems.flatten((e=>e.children)).filter((({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled))}get _dragEnabled(){return this._totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this._totalItems>=this.minFilterItems&&this.visibleElements.filter}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map(((t,i)=>this._renderLayerFlowItem(t,i===e.length-1)))}get icon(){return"layers"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get operationalItems(){return this.viewModel.operationalItems}set operationalItems(e){this.viewModel.operationalItems=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[C.hidden]:"loading"===e,[C.disabled]:"disabled"===e};return T("div",{class:this.classes(p.base,C.widget,C.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){const{_layerListMap:i}=this,o=i.get(e);if(o)return o;const s="catalog"===e.type?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||i.set(e,s),s}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();const o=new AbortController,{signal:s}=o;this._openedLayersController=o,e.forEach(((i,o)=>{t.includes(o)||(i.destroy(),e.delete(o))}));const l=await Promise.all(t.map((e=>this._createFlowList(e,s))));if(s.aborted)return;i.removeAll(),i.addMany(l);const r=i.at(-1);r?"catalogLayer"in r?(this._set("catalogLayerList",r),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",r)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:i}=this;return e?T("calcite-tooltip",{key:`tooltip-${e.layer?.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer?.uid)},i.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter((e=>!e.hidden)).toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderItemTooltips(){return this._visibleItems?.toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderNoItemsMessage(){return T("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return T("div",{class:p.itemMessage,key:"esri-layer-list__no-items"},T("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}async _createCatalogLayerList(e){const{default:t}=await import("./CatalogLayerList.js"),{headingLevel:i,catalogOptions:o,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,_onCatalogOpen:p,_onTablesOpen:c,layerTablesEnabled:m}=this;return new t({headingLevel:i,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,...o,catalogLayer:e,layerTablesEnabled:m,onCatalogOpen:p,onTablesOpen:c})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await import("./TableList.js"),{headingLevel:i,selectionMode:o,dragEnabled:s}=this;return new t({headingLevel:i,selectionMode:o,dragEnabled:s,...this._getTableListParams(e)})}_renderLayerFlowItem(e,t){const{messages:i,openedLayers:o}=this,s=e.title||this.messages.untitledLayer;return T("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:s,heading:i["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),o.pop();const t=o.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map((({title:i,panel:o},s)=>{const l=()=>this._handlePanelFlowItemBack(o);return T("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:i,heading:o.title,headingLevel:this.headingLevel,key:`flow-panel-${o.uid}`,selected:!t.length&&s===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),l()}},o.render(),T("calcite-button",{appearance:"transparent",onclick:l,slot:"footer-actions",width:"full"},this.messagesCommon.back))}))}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,F(e))}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,F(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,F(e))}_renderItems(){const{visible:e,collapsed:t,_visibleItems:i,_openedPanelItems:o,_filterEnabled:s,_rootGroupUid:l,visibleElements:{closeButton:r,collapseButton:a,heading:n,flow:d},_dragEnabled:c,selectionMode:m,filterText:h,openedLayers:y,filterPlaceholder:u,messages:g}=this,_=[T("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:r,closed:!e,collapsed:t,collapsible:a,heading:n?g.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!y.length&&!o.length,onCalciteFlowItemClose:()=>this.visible=!1},i?.length?T("calcite-list",{afterCreate:e=>{this._rootListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":l,displayMode:A,dragEnabled:c,filterEnabled:s,filterPlaceholder:u,filterProps:E,filterText:s?h:"",group:l,key:"root-list",label:g.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:m,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},i.toArray().map((e=>this._renderItem(e))),s?T("div",{class:p.filterNoResults,slot:"filter-no-results"},T("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null):this._renderNoItems()),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?d?T("calcite-flow",{key:"root-flow"},_):_:null}_renderItem(e,t,i){return T(c,{activeItem:this._activeItem,canMove:this._canMove,css:p,displayMode:A,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.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._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:o}){const s=_(i),l=_(e),r=_(t);this.viewModel.moveListItem(s,r,l,o)}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:o}=e;t.insertBefore(i,t.children[o])}_sortLayers(e,t){if(e)if(e===this._rootListEl)I(this.view?.map?.layers,t);else{const i=_(e);if(!i)return;w(i,t)}}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map((e=>_(e))).filter(Boolean);i.removeAll(),i.addMany(o)}};e([a()],j.prototype,"_rootListEl",void 0),e([a()],j.prototype,"_activeItem",void 0),e([a()],j.prototype,"_tooltipReferenceMap",void 0),e([a()],j.prototype,"_focusRootFlowItem",void 0),e([a()],j.prototype,"_focusPanelFlowItem",void 0),e([a()],j.prototype,"_focusLayerFlowItem",void 0),e([a()],j.prototype,"_layerListMap",void 0),e([a()],j.prototype,"_totalItems",null),e([a()],j.prototype,"_visibleItems",null),e([a()],j.prototype,"_openedPanelItems",null),e([a()],j.prototype,"_dragEnabled",null),e([a()],j.prototype,"_filterEnabled",null),e([a()],j.prototype,"_renderedOpenLayerFlowItems",null),e([a({readOnly:!0})],j.prototype,"catalogLayerList",void 0),e([a()],j.prototype,"catalogOptions",void 0),e([a()],j.prototype,"collapsed",void 0),e([a()],j.prototype,"dragEnabled",void 0),e([a()],j.prototype,"filterPlaceholder",void 0),e([a()],j.prototype,"filterPredicate",void 0),e([a()],j.prototype,"filterText",void 0),e([a()],j.prototype,"headingLevel",void 0),e([a()],j.prototype,"icon",null),e([a()],j.prototype,"knowledgeGraphOptions",void 0),e([a()],j.prototype,"label",null),e([a()],j.prototype,"layerTablesEnabled",void 0),e([a()],j.prototype,"listItemCanGiveFunction",void 0),e([a()],j.prototype,"listItemCanReceiveFunction",void 0),e([a()],j.prototype,"listItemCreatedFunction",null),e([a()],j.prototype,"mapImageOptions",void 0),e([a(),M("esri/widgets/LayerList/t9n/LayerList")],j.prototype,"messages",void 0),e([a(),M("esri/t9n/common")],j.prototype,"messagesCommon",void 0),e([a()],j.prototype,"minDragEnabledItems",void 0),e([a()],j.prototype,"minFilterItems",void 0),e([a({readOnly:!0})],j.prototype,"openedLayers",void 0),e([a({readOnly:!0})],j.prototype,"openedLayerLists",void 0),e([a()],j.prototype,"operationalItems",null),e([a()],j.prototype,"selectedItems",void 0),e([a()],j.prototype,"selectionMode",void 0),e([a({readOnly:!0})],j.prototype,"tableList",void 0),e([a()],j.prototype,"tileOptions",void 0),e([a()],j.prototype,"view",null),e([O("trigger-action"),a({type:m})],j.prototype,"viewModel",void 0),e([a()],j.prototype,"visibilityAppearance",void 0),e([a({type:h,nonNullable:!0})],j.prototype,"visibleElements",void 0),j=e([n("esri.widgets.LayerList")],j);const D=j;export{D as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import i from"../core/Identifiable.js";import o from"../core/ReactiveMap.js";import{on as s,watch as l,initial as r}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 n}from"../core/accessorSupport/decorators/subclass.js";import d from"./Widget.js";import{css as p}from"./LayerList/css.js";import c from"./LayerList/LayerListItem.js";import m from"./LayerList/LayerListViewModel.js";import h from"./LayerList/LayerListVisibleElements.js";import y from"./LayerList/ListItem.js";import{minDragEnabledItems as u,minFilterItems as g,getItem as _,getLayerType as L,removeDestroyedListItems as f,setFilterPredicate as v,sortLayersToIds as I,sortChildLayersToIds as w}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as b}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{calciteListFilterProps as E}from"./support/listUtils.js";import{setFocus as F}from"./support/widgetUtils.js";import{messageBundle as M}from"./support/decorators/messageBundle.js";import{vmEvent as O}from"./support/decorators/vmEvent.js";import{tsx as T}from"./support/jsxFactory.js";const P=t.ofType(y),A="nested";let j=class extends(i.IdentifiableMixin(d)){constructor(e,i){super(e,i),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new o,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new o,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=u,this.minFilterItems=g,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new P,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new m,this.visibilityAppearance="default",this.visibleElements=new h,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=_(e);if(!l?.sortable)return!1;const r=_(t),a=L(t),n=_(i),d=L(i),p=!!a&&!!d&&a===d,c={selected:l,from:r,to:n},m=t.group,h=i.group,y=r?.layer?.type??"",u=n?.layer?.type??"",g=new Set(["map-image","catalog","knowledge-graph"]),f="sublayer";return m&&h&&"function"==typeof s?s.call(null,c):p&&!g.has(y)&&!g.has(u)&&l?.layer?.type!==f},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find((e=>e.classList?.contains(p.item)));this._activeItem=_(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:o,dragEl:s,newIndex:l}=e;if(o&&i&&!(t?.newIndex===l&&t?.dragEl===s&&t?.toEl===i&&t?.fromEl===o))if(this._lastDragDetail=e,this._selectedDragItemLayerUid=s.value,o!==i)this._moveLayerFromChildList({toEl:i,fromEl:o,dragEl:s,newIndex:l});else{const e=Array.from(o.children).filter((e=>e?.matches("calcite-list-item"))).map((e=>e.value));this._sortLayers(o,e)}}}initialize(){this.addHandles([s((()=>this.openedLayers),"change",(()=>this._handleOpenedLayersChange()),r),s((()=>this.viewModel.operationalItems),"change",(()=>f(this.selectedItems)),r),l((()=>[this.filterPredicate,this._rootListEl]),(()=>v(this._rootListEl,this.filterPredicate)))])}loadDependencies(){return b({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _totalItems(){return this.viewModel.operationalItems.flatten((e=>e.children.filter((e=>"catalog-dynamic-group"!==e.layer?.type)))).length}get _visibleItems(){return this.operationalItems?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error)))}get _openedPanelItems(){return this._visibleItems.flatten((e=>e.children)).filter((({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled))}get _dragEnabled(){return this._totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this._totalItems>=this.minFilterItems&&this.visibleElements.filter}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map(((t,i)=>this._renderLayerFlowItem(t,i===e.length-1)))}get icon(){return"layers"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get operationalItems(){return this.viewModel.operationalItems}set operationalItems(e){this.viewModel.operationalItems=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[C.hidden]:"loading"===e,[C.disabled]:"disabled"===e};return T("div",{class:this.classes(p.base,C.widget,C.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){const{_layerListMap:i}=this,o=i.get(e);if(o)return o;const s="catalog"===e.type?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||i.set(e,s),s}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();const o=new AbortController,{signal:s}=o;this._openedLayersController=o,e.forEach(((i,o)=>{t.includes(o)||(i.destroy(),e.delete(o))}));const l=await Promise.all(t.map((e=>this._createFlowList(e,s))));if(s.aborted)return;i.removeAll(),i.addMany(l);const r=i.at(-1);r?"catalogLayer"in r?(this._set("catalogLayerList",r),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",r)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:i}=this;return e?T("calcite-tooltip",{key:`tooltip-${e.layer?.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer?.uid)},i.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter((e=>!e.hidden)).toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderItemTooltips(){return this._visibleItems?.toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderNoItemsMessage(){return T("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return T("div",{class:p.itemMessage,key:"esri-layer-list__no-items"},T("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}async _createCatalogLayerList(e){const{default:t}=await import("./CatalogLayerList.js"),{headingLevel:i,catalogOptions:o,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,_onCatalogOpen:p,_onTablesOpen:c,layerTablesEnabled:m}=this;return new t({headingLevel:i,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,...o,catalogLayer:e,layerTablesEnabled:m,onCatalogOpen:p,onTablesOpen:c})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await import("./TableList.js"),{headingLevel:i,selectionMode:o,dragEnabled:s}=this;return new t({headingLevel:i,selectionMode:o,dragEnabled:s,...this._getTableListParams(e)})}_renderLayerFlowItem(e,t){const{messages:i,openedLayers:o}=this,s=e.title||this.messages.untitledLayer;return T("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:s,heading:i["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),o.pop();const t=o.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map((({title:i,panel:o},s)=>{const l=()=>this._handlePanelFlowItemBack(o);return T("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:i,heading:o.title,headingLevel:this.headingLevel,key:`flow-panel-${o.uid}`,selected:!t.length&&s===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),l()}},o.render(),T("calcite-button",{appearance:"transparent",onclick:l,slot:"footer-actions",width:"full"},this.messagesCommon.back))}))}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,F(e))}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,F(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,F(e))}_renderItems(){const{visible:e,collapsed:t,_visibleItems:i,_openedPanelItems:o,_filterEnabled:s,_rootGroupUid:l,visibleElements:{closeButton:r,collapseButton:a,heading:n,flow:d},_dragEnabled:c,selectionMode:m,filterText:h,openedLayers:y,filterPlaceholder:u,messages:g}=this,_=[T("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:r,closed:!e,collapsed:t,collapsible:a,heading:n?g.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!y.length&&!o.length,onCalciteFlowItemClose:()=>this.visible=!1},i?.length?null:this._renderNoItems(),T("calcite-list",{afterCreate:e=>{this._rootListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":l,displayMode:A,dragEnabled:c,filterEnabled:s,filterPlaceholder:u,filterProps:E,filterText:s?h:"",group:l,key:"root-list",label:g.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:m,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},i.toArray().map((e=>this._renderItem(e))),s?T("div",{class:p.filterNoResults,slot:"filter-no-results"},T("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?d?T("calcite-flow",{key:"root-flow"},_):_:null}_renderItem(e,t,i){return T(c,{activeItem:this._activeItem,canMove:this._canMove,css:p,displayMode:A,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.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._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:o}){const s=_(i),l=_(e),r=_(t);this.viewModel.moveListItem(s,r,l,o)}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:o}=e;t.insertBefore(i,t.children[o])}_sortLayers(e,t){if(e)if(e===this._rootListEl)I(this.view?.map?.layers,t);else{const i=_(e);if(!i)return;w(i,t)}}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map((e=>_(e))).filter(Boolean);i.removeAll(),i.addMany(o)}};e([a()],j.prototype,"_rootListEl",void 0),e([a()],j.prototype,"_activeItem",void 0),e([a()],j.prototype,"_tooltipReferenceMap",void 0),e([a()],j.prototype,"_focusRootFlowItem",void 0),e([a()],j.prototype,"_focusPanelFlowItem",void 0),e([a()],j.prototype,"_focusLayerFlowItem",void 0),e([a()],j.prototype,"_layerListMap",void 0),e([a()],j.prototype,"_totalItems",null),e([a()],j.prototype,"_visibleItems",null),e([a()],j.prototype,"_openedPanelItems",null),e([a()],j.prototype,"_dragEnabled",null),e([a()],j.prototype,"_filterEnabled",null),e([a()],j.prototype,"_renderedOpenLayerFlowItems",null),e([a({readOnly:!0})],j.prototype,"catalogLayerList",void 0),e([a()],j.prototype,"catalogOptions",void 0),e([a()],j.prototype,"collapsed",void 0),e([a()],j.prototype,"dragEnabled",void 0),e([a()],j.prototype,"filterPlaceholder",void 0),e([a()],j.prototype,"filterPredicate",void 0),e([a()],j.prototype,"filterText",void 0),e([a()],j.prototype,"headingLevel",void 0),e([a()],j.prototype,"icon",null),e([a()],j.prototype,"knowledgeGraphOptions",void 0),e([a()],j.prototype,"label",null),e([a()],j.prototype,"layerTablesEnabled",void 0),e([a()],j.prototype,"listItemCanGiveFunction",void 0),e([a()],j.prototype,"listItemCanReceiveFunction",void 0),e([a()],j.prototype,"listItemCreatedFunction",null),e([a()],j.prototype,"mapImageOptions",void 0),e([a(),M("esri/widgets/LayerList/t9n/LayerList")],j.prototype,"messages",void 0),e([a(),M("esri/t9n/common")],j.prototype,"messagesCommon",void 0),e([a()],j.prototype,"minDragEnabledItems",void 0),e([a()],j.prototype,"minFilterItems",void 0),e([a({readOnly:!0})],j.prototype,"openedLayers",void 0),e([a({readOnly:!0})],j.prototype,"openedLayerLists",void 0),e([a()],j.prototype,"operationalItems",null),e([a()],j.prototype,"selectedItems",void 0),e([a()],j.prototype,"selectionMode",void 0),e([a({readOnly:!0})],j.prototype,"tableList",void 0),e([a()],j.prototype,"tileOptions",void 0),e([a()],j.prototype,"view",null),e([O("trigger-action"),a({type:m})],j.prototype,"viewModel",void 0),e([a()],j.prototype,"visibilityAppearance",void 0),e([a({type:h,nonNullable:!0})],j.prototype,"visibleElements",void 0),j=e([n("esri.widgets.LayerList")],j);const D=j;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 o}from"../../chunks/tslib.es6.js";import s from"../../Color.js";import r from"../../core/Accessor.js";import t from"../../core/Collection.js";import{referenceSetter as e}from"../../core/collectionUtils.js";import{convertTime as i}from"../../core/timeUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";let n=class extends r{constructor(o){super(o),this.color=new s([50,50,50,.7]),this.interval=i(1,"hours","milliseconds"),this.intervalOptions=new t([i(15,"minutes","milliseconds"),i(30,"minutes","milliseconds"),i(1,"hours","milliseconds"),i(2,"hours","milliseconds"),i(3,"hours","milliseconds")])}set intervalOptions(o){this._set("intervalOptions",e(o,this._get("intervalOptions")))}};o([l({type:s,nonNullable:!0})],n.prototype,"color",void 0),o([l()],n.prototype,"interval",void 0),o([l({type:t})],n.prototype,"intervalOptions",null),n=o([c("esri.widgets.ShadowCast.DiscreteOptions")],n);const p=n;export{p as default};
5
+ import{_ as o}from"../../chunks/tslib.es6.js";import s from"../../Color.js";import r from"../../core/Accessor.js";import t from"../../core/Collection.js";import{referenceSetter as e}from"../../core/collectionUtils.js";import{convertTime as i}from"../../core/timeUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";let p=class extends r{constructor(o){super(o),this.color=new s([50,50,50,.7]),this.interval=i(1,"hours","milliseconds"),this.intervalOptions=new t([i(15,"minutes","milliseconds"),i(30,"minutes","milliseconds"),i(1,"hours","milliseconds"),i(2,"hours","milliseconds"),i(3,"hours","milliseconds")])}set intervalOptions(o){this._set("intervalOptions",e(o,this._get("intervalOptions")))}};o([l({type:s,nonNullable:!0})],p.prototype,"color",void 0),o([l({type:Number})],p.prototype,"interval",void 0),o([l({type:t})],p.prototype,"intervalOptions",null),p=o([c("esri.widgets.ShadowCast.DiscreteOptions")],p);const n=p;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 o}from"../../chunks/tslib.es6.js";import r from"../../Color.js";import s from"../../core/Accessor.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 e}from"../../core/accessorSupport/decorators/subclass.js";import{DurationMode as p}from"./DurationMode.js";let c=class extends s{constructor(o){super(o),this.color=new r([0,0,255,.7]),this.mode=p.Continuous}};o([t({type:r,nonNullable:!0})],c.prototype,"color",void 0),o([t()],c.prototype,"mode",void 0),c=o([e("esri.widgets.ShadowCast.DurationOptions")],c);const i=c;export{i as default};
5
+ import{_ as o}from"../../chunks/tslib.es6.js";import r from"../../Color.js";import s from"../../core/Accessor.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 e}from"../../core/accessorSupport/decorators/subclass.js";import{DurationMode as p}from"./DurationMode.js";let c=class extends s{constructor(o){super(o),this.color=new r([0,0,255,.7]),this.mode=p.Continuous}};o([t({type:r,nonNullable:!0})],c.prototype,"color",void 0),o([t({type:["continuous","hourly"]})],c.prototype,"mode",void 0),c=o([e("esri.widgets.ShadowCast.DurationOptions")],c);const i=c;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 t}from"../../chunks/tslib.es6.js";import e from"../../Color.js";import i from"../../core/Accessor.js";import{isSome as r}from"../../core/arrayUtils.js";import{createTask as s}from"../../core/asyncUtils.js";import"../../core/has.js";import{abortMaybe as o,destroyMaybe as n}from"../../core/maybe.js";import{after as a,throwIfAborted as l}from"../../core/promiseUtils.js";import{watch as u,syncAndInitial as p}from"../../core/reactiveUtils.js";import{createScreenPointArray as d,createRenderScreenPointArray as h}from"../../core/screenUtils.js";import{convertTime as c,offsetDateUTC as m}from"../../core/timeUtils.js";import{property as f}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import{subclass as _}from"../../core/accessorSupport/decorators/subclass.js";import{create as g}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{longitudeToTimezone as v}from"../../views/3d/support/earthUtils.js";import{computeDirectionsOverTime as y}from"../../views/3d/support/sunUtils.js";import{ShadowCastVisualization as w}from"../../views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration.js";import D from"./DiscreteOptions.js";import{DurationMode as T}from"./DurationMode.js";import O from"./DurationOptions.js";import{ShadowCastState as P}from"./ShadowCastState.js";import{ShadowTooltipViewModel as C}from"./ShadowTooltipViewModel.js";import{ShadowVisualizationType as b}from"./ShadowVisualizationType.js";import z from"./ThresholdOptions.js";import{breadthFirstBinaryPartitioning as j}from"../support/traversalUtils.js";const U=[],V=g(),x=[],S=255,E=c(1,"hours","milliseconds"),R=500;let A=class extends i{constructor(t){super(t),this.view=null,this.tooltip=new C({getDuration:(t,e)=>this.getDuration(t,e)}),this.startTimeOfDay=c(10,"hours","milliseconds"),this.endTimeOfDay=c(16,"hours","milliseconds"),this.visualizationType=b.Threshold,this.thresholdOptions=new z,this.durationOptions=new O,this.discreteOptions=new D,this._running=!0,this._stopPreviewingTask=null,this._forcePreview=!1,this._autoRestoreForcePreviewEnabled=!0,this._utcOffset=null,this.date=new Date}initialize(){this.addHandles([u((()=>({view:this.view,tooltipEnabled:this._tooltipEnabled})),(({view:t,tooltipEnabled:e})=>{this.tooltip.view=t,this.tooltip.enabled=e}),p),u((()=>this._forcePreviewDependencies),(()=>{o(this._stopPreviewingTask),this._forcePreview=!0,this._autoRestoreForcePreviewEnabled&&(this._stopPreviewingTask=s((async t=>{await a(R,t),l(t),this._forcePreview=!1})))}),p),u((()=>({renderer:this.renderer,parameters:this._visualizationParameters})),(t=>G(t.renderer,t.parameters)),p),u((()=>({renderer:this.renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext})),(t=>G(t.renderer,{lightDirections:t.lightDirections,lightDirectionsContext:t.lightDirectionsContext})),p),u((()=>({renderer:this.renderer,parameters:{enabled:this._running}})),(t=>G(t.renderer,t.parameters)),p),u((()=>({renderer:this.renderer,parameters:{previewing:this._previewing}})),(t=>G(t.renderer,t.parameters)),p)])}destroy(){this.stop(),G(this.renderer,{enabled:!1}),n(this.tooltip)}get state(){return null!=this.view&&this.view.ready&&null!=this._referencePosition?P.Ready:P.Disabled}set date(t){const e=new Date(t);e.setHours(0,0,0,0),this._set("date",e)}get utcOffset(){return this._utcOffset??this._utcOffsetAuto}set utcOffset(t){this._utcOffset=t}get testData(){}get _previewing(){const{view:t}=this;if(null==t?.allLayerViews)return!0;const{stationary:e,allLayerViews:i,graphicsView:r}=t;return this._forcePreview||!e||i.some((t=>N(t)&&t.updating))||!r?.suspended&&!!r?.updating}get _utcOffsetAuto(){const t=this._referencePosition;return null!=t?v(t[0],!1):0}get _dateUTCOffset(){let t=this.date;return t=m(t,-t.getTimezoneOffset(),"minutes"),t=m(t,-this.utcOffset,"hours"),t}get _startDateTimeUTC(){return m(this._dateUTCOffset,this.startTimeOfDay)}get _endDateTimeUTC(){return m(this._dateUTCOffset,this.endTimeOfDay)}get _referencePosition(){return this.view?.environmentManager?.referencePositionGeographic}get _durationInterval(){return this._duration>0?Math.floor(this._duration/S):S}get _interval(){const t=this._durationInterval;switch(this.visualizationType){case b.Threshold:case b.Duration:return t;case b.Discrete:return this.discreteOptions.interval||t}}get _intervalContext(){const{contextEnabled:t,contextOptions:{interval:e}}=this.thresholdOptions;return this.visualizationType===b.Threshold&&t?e||this._durationInterval:-1}get _durationSampleCount(){return this._lightDirections.length}get _duration(){return this.endTimeOfDay-this.startTimeOfDay}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(t){const{view:e}=this;if(null==e||t<=0)return U;const i="global"===e.viewingMode?V:this._referencePosition;if(null==i)return U;const r=y(this._startDateTimeUTC,this._endDateTimeUTC,t,i,e.state.viewingMode),s=r.length;x.length=0;const o=j(0,s,x),n=new Array(s);for(let a=0;a<s;++a)n[a]=r[o[a]];return n}get _tooltipEnabled(){return this.state===P.Ready&&this.visualizationType!==b.Discrete&&this._running&&!this._previewing}get _visualizationParameters(){if(!this._running)return null;switch(this.visualizationType){case b.Threshold:return this._thresholdVisualizationParameters;case b.Duration:return this._durationVisualizationParameters;case b.Discrete:return this._discreteVisualizationParameters}}get _thresholdVisualizationParameters(){const{value:t,color:i}=this.thresholdOptions,r=this._duration;return{visualization:w.Threshold,thresholdColor:e.toUnitRGBA(i),threshold:r>0?t/this._duration:0,...this._thresholdDiscreteVisualizationParameters}}get _thresholdDiscreteVisualizationParameters(){const{contextOptions:{color:t},contextEnabled:i}=this.thresholdOptions;return i?{visualization:w.ThresholdAndGradient,gradientColor:e.toUnitRGBA(t)}:{}}get _durationVisualizationParameters(){const{color:t,mode:i}=this.durationOptions,r=this._duration,s=r>0&&i===T.Hourly?E/r:0,o=e.toUnitRGBA(t);return 0===s?{...this._discreteVisualizationParameters,gradientColor:o}:{bandedGradientColor:o,visualization:w.BandedGradient,bandSize:s}}get _discreteVisualizationParameters(){return{gradientColor:e.toUnitRGBA(this.discreteOptions.color),visualization:w.Gradient}}get _forcePreviewDependencies(){const{view:t}=this;if(null==t)return null;const e=t.slice.plane,i=t.allLayerViews.toArray().filter(N),s=i.map((t=>t.layer)).filter(r),o=i.map((t=>t.suspended)),n=s.map((t=>t.visible)),a=s.map((t=>t.opacity)),l=!!t.graphicsView?.suspended,u=s.filter((t=>"definitionExpression"in t)).map((t=>t.definitionExpression)),p=i.filter((t=>"filter"in t)).map((t=>t.filter));return{slicePlane:e,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:o,graphicsViewSuspended:l,layerVisibilities:n,layerOpacities:a,filters:p,definitionExpressions:u}}get renderer(){const{view:t}=this;if(null==t)return null;const e=t.stage;return null==e?null:e.renderer}start(){this.setRunning(!0)}stop(){this.setRunning(!1)}setRunning(t){this._running=t}async getDuration(t,e){const{view:i,renderer:r,_durationSampleCount:s}=this;if(null==i||null==r||0===s)return 0;const o=i.state.camera.screenToRender(d(t.x,t.y),h());return r.readAccumulatedShadow(o)*this._duration}};function G(t,e){null!=t&&null!=e&&t.setParameters({shadowCast:e})}function N(t){if(t.suspended)return!1;switch(t.type){case"building-scene-3d":case"csv-3d":case"elevation-3d":case"feature-3d":case"geojson-3d":case"graphics-3d":case"integrated-mesh-3d":case"integrated-mesh-3dtiles":case"ogc-feature-3d":case"route-3d":case"scene-layer-3d":case"scene-layer-graphics-3d":case"stream-3d":case"wms-3d":case"catalog-footprint-3d":return!0;default:return!1}}t([f()],A.prototype,"state",null),t([f()],A.prototype,"view",void 0),t([f()],A.prototype,"tooltip",void 0),t([f({type:Date,nonNullable:!0})],A.prototype,"date",null),t([f({nonNullable:!0})],A.prototype,"utcOffset",null),t([f({nonNullable:!0})],A.prototype,"startTimeOfDay",void 0),t([f({nonNullable:!0})],A.prototype,"endTimeOfDay",void 0),t([f({nonNullable:!0})],A.prototype,"visualizationType",void 0),t([f({type:z,nonNullable:!0})],A.prototype,"thresholdOptions",void 0),t([f({type:O,nonNullable:!0})],A.prototype,"durationOptions",void 0),t([f({type:D,nonNullable:!0})],A.prototype,"discreteOptions",void 0),t([f()],A.prototype,"_running",void 0),t([f()],A.prototype,"_stopPreviewingTask",void 0),t([f()],A.prototype,"_forcePreview",void 0),t([f()],A.prototype,"_autoRestoreForcePreviewEnabled",void 0),t([f()],A.prototype,"_previewing",null),t([f()],A.prototype,"_utcOffset",void 0),t([f()],A.prototype,"_utcOffsetAuto",null),t([f()],A.prototype,"_dateUTCOffset",null),t([f()],A.prototype,"_startDateTimeUTC",null),t([f()],A.prototype,"_endDateTimeUTC",null),t([f()],A.prototype,"_referencePosition",null),t([f()],A.prototype,"_interval",null),t([f()],A.prototype,"_intervalContext",null),t([f()],A.prototype,"_durationSampleCount",null),t([f()],A.prototype,"_duration",null),t([f()],A.prototype,"_lightDirections",null),t([f()],A.prototype,"_lightDirectionsContext",null),t([f()],A.prototype,"_tooltipEnabled",null),t([f()],A.prototype,"_visualizationParameters",null),t([f()],A.prototype,"_thresholdVisualizationParameters",null),t([f()],A.prototype,"_thresholdDiscreteVisualizationParameters",null),t([f()],A.prototype,"_durationVisualizationParameters",null),t([f()],A.prototype,"_discreteVisualizationParameters",null),t([f()],A.prototype,"_forcePreviewDependencies",null),t([f()],A.prototype,"renderer",null),A=t([_("esri.widgets.ShadowCast.ShadowCastViewModel")],A);const L=A;export{L as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Color.js";import i from"../../core/Accessor.js";import{isSome as r}from"../../core/arrayUtils.js";import{createTask as s}from"../../core/asyncUtils.js";import"../../core/has.js";import{abortMaybe as o,destroyMaybe as n}from"../../core/maybe.js";import{after as a,throwIfAborted as l}from"../../core/promiseUtils.js";import{watch as u,syncAndInitial as p}from"../../core/reactiveUtils.js";import{createScreenPointArray as d,createRenderScreenPointArray as h}from"../../core/screenUtils.js";import{convertTime as c,offsetDateUTC as m}from"../../core/timeUtils.js";import{property as f}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import{subclass as _}from"../../core/accessorSupport/decorators/subclass.js";import{create as g}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{longitudeToTimezone as y}from"../../views/3d/support/earthUtils.js";import{computeDirectionsOverTime as v}from"../../views/3d/support/sunUtils.js";import{ShadowCastVisualization as w}from"../../views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration.js";import D from"./DiscreteOptions.js";import{DurationMode as T}from"./DurationMode.js";import O from"./DurationOptions.js";import{ShadowCastState as P}from"./ShadowCastState.js";import{ShadowTooltipViewModel as C}from"./ShadowTooltipViewModel.js";import{ShadowVisualizationType as b}from"./ShadowVisualizationType.js";import z from"./ThresholdOptions.js";import{breadthFirstBinaryPartitioning as j}from"../support/traversalUtils.js";const U=[],V=g(),x=[],S=255,E=c(1,"hours","milliseconds"),R=500;let A=class extends i{constructor(t){super(t),this.view=null,this.tooltip=new C({getDuration:(t,e)=>this.getDuration(t,e)}),this.startTimeOfDay=c(10,"hours","milliseconds"),this.endTimeOfDay=c(16,"hours","milliseconds"),this.visualizationType=b.Threshold,this.thresholdOptions=new z,this.durationOptions=new O,this.discreteOptions=new D,this._running=!0,this._stopPreviewingTask=null,this._forcePreview=!1,this._autoRestoreForcePreviewEnabled=!0,this._utcOffset=null,this.date=new Date}initialize(){this.addHandles([u((()=>({view:this.view,tooltipEnabled:this._tooltipEnabled})),(({view:t,tooltipEnabled:e})=>{this.tooltip.view=t,this.tooltip.enabled=e}),p),u((()=>this._forcePreviewDependencies),(()=>{o(this._stopPreviewingTask),this._forcePreview=!0,this._autoRestoreForcePreviewEnabled&&(this._stopPreviewingTask=s((async t=>{await a(R,t),l(t),this._forcePreview=!1})))}),p),u((()=>({renderer:this.renderer,parameters:this._visualizationParameters})),(t=>N(t.renderer,t.parameters)),p),u((()=>({renderer:this.renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext})),(t=>N(t.renderer,{lightDirections:t.lightDirections,lightDirectionsContext:t.lightDirectionsContext})),p),u((()=>({renderer:this.renderer,parameters:{enabled:this._running}})),(t=>N(t.renderer,t.parameters)),p),u((()=>({renderer:this.renderer,parameters:{previewing:this._previewing}})),(t=>N(t.renderer,t.parameters)),p)])}destroy(){this.stop(),N(this.renderer,{enabled:!1}),n(this.tooltip)}get state(){return null!=this.view&&this.view.ready&&null!=this._referencePosition?P.Ready:P.Disabled}set date(t){const e=new Date(t);e.setHours(0,0,0,0),this._set("date",e)}get utcOffset(){return this._utcOffset??this._utcOffsetAuto}set utcOffset(t){this._utcOffset=t}get testData(){}get _previewing(){const{view:t}=this;if(null==t?.allLayerViews)return!0;const{stationary:e,allLayerViews:i,graphicsView:r}=t;return this._forcePreview||!e||i.some((t=>G(t)&&t.updating))||!r?.suspended&&!!r?.updating}get _utcOffsetAuto(){const t=this._referencePosition;return null!=t?y(t[0],!1):0}get _dateUTCOffset(){let t=this.date;return t=m(t,-t.getTimezoneOffset(),"minutes"),t=m(t,-this.utcOffset,"hours"),t}get _startDateTimeUTC(){return m(this._dateUTCOffset,this.startTimeOfDay)}get _endDateTimeUTC(){return m(this._dateUTCOffset,this.endTimeOfDay)}get _referencePosition(){return this.view?.environmentManager?.referencePositionGeographic}get _durationInterval(){return this._duration>0?Math.floor(this._duration/S):S}get _interval(){const t=this._durationInterval;switch(this.visualizationType){case b.Threshold:case b.Duration:return t;case b.Discrete:return this.discreteOptions.interval||t}}get _intervalContext(){const{contextEnabled:t,contextOptions:{interval:e}}=this.thresholdOptions;return this.visualizationType===b.Threshold&&t?e||this._durationInterval:-1}get _durationSampleCount(){return this._lightDirections.length}get _duration(){return this.endTimeOfDay-this.startTimeOfDay}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(t){const{view:e}=this;if(null==e||t<=0)return U;const i="global"===e.viewingMode?V:this._referencePosition;if(null==i)return U;const r=v(this._startDateTimeUTC,this._endDateTimeUTC,t,i,e.state.viewingMode),s=r.length;x.length=0;const o=j(0,s,x),n=new Array(s);for(let a=0;a<s;++a)n[a]=r[o[a]];return n}get _tooltipEnabled(){return this.state===P.Ready&&this.visualizationType!==b.Discrete&&this._running&&!this._previewing}get _visualizationParameters(){if(!this._running)return null;switch(this.visualizationType){case b.Threshold:return this._thresholdVisualizationParameters;case b.Duration:return this._durationVisualizationParameters;case b.Discrete:return this._discreteVisualizationParameters}}get _thresholdVisualizationParameters(){const{value:t,color:i}=this.thresholdOptions,r=this._duration;return{visualization:w.Threshold,thresholdColor:e.toUnitRGBA(i),threshold:r>0?t/this._duration:0,...this._thresholdDiscreteVisualizationParameters}}get _thresholdDiscreteVisualizationParameters(){const{contextOptions:{color:t},contextEnabled:i}=this.thresholdOptions;return i?{visualization:w.ThresholdAndGradient,gradientColor:e.toUnitRGBA(t)}:{}}get _durationVisualizationParameters(){const{color:t,mode:i}=this.durationOptions,r=this._duration,s=r>0&&i===T.Hourly?E/r:0,o=e.toUnitRGBA(t);return 0===s?{...this._discreteVisualizationParameters,gradientColor:o}:{bandedGradientColor:o,visualization:w.BandedGradient,bandSize:s}}get _discreteVisualizationParameters(){return{gradientColor:e.toUnitRGBA(this.discreteOptions.color),visualization:w.Gradient}}get _forcePreviewDependencies(){const{view:t}=this;if(null==t)return null;const e=t.slice.plane,i=t.allLayerViews.toArray().filter(G),s=i.map((t=>t.layer)).filter(r),o=i.map((t=>t.suspended)),n=s.map((t=>t.visible)),a=s.map((t=>t.opacity)),l=!!t.graphicsView?.suspended,u=s.filter((t=>"definitionExpression"in t)).map((t=>t.definitionExpression)),p=i.filter((t=>"filter"in t)).map((t=>t.filter));return{slicePlane:e,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:o,graphicsViewSuspended:l,layerVisibilities:n,layerOpacities:a,filters:p,definitionExpressions:u}}get renderer(){const{view:t}=this;if(null==t)return null;const e=t.stage;return null==e?null:e.renderer}start(){this.setRunning(!0)}stop(){this.setRunning(!1)}setRunning(t){this._running=t}async getDuration(t,e){const{view:i,renderer:r,_durationSampleCount:s}=this;if(null==i||null==r||0===s)return 0;const o=i.state.camera.screenToRender(d(t.x,t.y),h());return r.readAccumulatedShadow(o)*this._duration}};function N(t,e){null!=t&&null!=e&&t.setParameters({shadowCast:e})}function G(t){if(t.suspended)return!1;switch(t.type){case"building-scene-3d":case"csv-3d":case"elevation-3d":case"feature-3d":case"geojson-3d":case"graphics-3d":case"integrated-mesh-3d":case"integrated-mesh-3dtiles":case"ogc-feature-3d":case"route-3d":case"scene-layer-3d":case"scene-layer-graphics-3d":case"stream-3d":case"wms-3d":case"catalog-footprint-3d":return!0;default:return!1}}t([f()],A.prototype,"state",null),t([f()],A.prototype,"view",void 0),t([f()],A.prototype,"tooltip",void 0),t([f({type:Date,nonNullable:!0})],A.prototype,"date",null),t([f({type:Number,nonNullable:!0})],A.prototype,"utcOffset",null),t([f({type:Number,nonNullable:!0})],A.prototype,"startTimeOfDay",void 0),t([f({type:Number,nonNullable:!0})],A.prototype,"endTimeOfDay",void 0),t([f({type:["threshold","duration","discrete"],nonNullable:!0})],A.prototype,"visualizationType",void 0),t([f({type:z,nonNullable:!0})],A.prototype,"thresholdOptions",void 0),t([f({type:O,nonNullable:!0})],A.prototype,"durationOptions",void 0),t([f({type:D,nonNullable:!0})],A.prototype,"discreteOptions",void 0),t([f()],A.prototype,"_running",void 0),t([f()],A.prototype,"_stopPreviewingTask",void 0),t([f()],A.prototype,"_forcePreview",void 0),t([f()],A.prototype,"_autoRestoreForcePreviewEnabled",void 0),t([f()],A.prototype,"_previewing",null),t([f()],A.prototype,"_utcOffset",void 0),t([f()],A.prototype,"_utcOffsetAuto",null),t([f()],A.prototype,"_dateUTCOffset",null),t([f()],A.prototype,"_startDateTimeUTC",null),t([f()],A.prototype,"_endDateTimeUTC",null),t([f()],A.prototype,"_referencePosition",null),t([f()],A.prototype,"_interval",null),t([f()],A.prototype,"_intervalContext",null),t([f()],A.prototype,"_durationSampleCount",null),t([f()],A.prototype,"_duration",null),t([f()],A.prototype,"_lightDirections",null),t([f()],A.prototype,"_lightDirectionsContext",null),t([f()],A.prototype,"_tooltipEnabled",null),t([f()],A.prototype,"_visualizationParameters",null),t([f()],A.prototype,"_thresholdVisualizationParameters",null),t([f()],A.prototype,"_thresholdDiscreteVisualizationParameters",null),t([f()],A.prototype,"_durationVisualizationParameters",null),t([f()],A.prototype,"_discreteVisualizationParameters",null),t([f()],A.prototype,"_forcePreviewDependencies",null),t([f()],A.prototype,"renderer",null),A=t([_("esri.widgets.ShadowCast.ShadowCastViewModel")],A);const L=A;export{L as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends t{constructor(){super(...arguments),this.timeRangeSlider=!0,this.timezone=!0,this.datePicker=!0,this.visualizationOptions=!0,this.colorPicker=!0,this.tooltip=!0,this.thresholdContext=!0,this.thresholdContextToggle=!0,this.thresholdContextTimeInterval=!0,this.thresholdContextColor=!0}};o([e()],s.prototype,"timeRangeSlider",void 0),o([e()],s.prototype,"timezone",void 0),o([e()],s.prototype,"datePicker",void 0),o([e()],s.prototype,"visualizationOptions",void 0),o([e()],s.prototype,"colorPicker",void 0),o([e()],s.prototype,"tooltip",void 0),o([e()],s.prototype,"thresholdContext",void 0),o([e()],s.prototype,"thresholdContextToggle",void 0),o([e()],s.prototype,"thresholdContextTimeInterval",void 0),o([e()],s.prototype,"thresholdContextColor",void 0),s=o([r("esri.widgets.ShadowCast.ShadowCastVisibleElements")],s);const i=s;export{i as default};
5
+ import{_ as o}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends t{constructor(){super(...arguments),this.timeRangeSlider=!0,this.timezone=!0,this.datePicker=!0,this.visualizationOptions=!0,this.colorPicker=!0,this.tooltip=!0,this.thresholdContext=!0,this.thresholdContextToggle=!0,this.thresholdContextTimeInterval=!0,this.thresholdContextColor=!0}};o([e({type:Boolean})],s.prototype,"timeRangeSlider",void 0),o([e({type:Boolean})],s.prototype,"timezone",void 0),o([e({type:Boolean})],s.prototype,"datePicker",void 0),o([e({type:Boolean})],s.prototype,"visualizationOptions",void 0),o([e({type:Boolean})],s.prototype,"colorPicker",void 0),o([e({type:Boolean})],s.prototype,"tooltip",void 0),o([e({type:Boolean})],s.prototype,"thresholdContext",void 0),o([e({type:Boolean})],s.prototype,"thresholdContextToggle",void 0),o([e({type:Boolean})],s.prototype,"thresholdContextTimeInterval",void 0),o([e({type:Boolean})],s.prototype,"thresholdContextColor",void 0),s=o([r("esri.widgets.ShadowCast.ShadowCastVisibleElements")],s);const i=s;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 o}from"../../chunks/tslib.es6.js";import t from"../../Color.js";import s from"../../core/Accessor.js";import{convertTime as r}from"../../core/timeUtils.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 i}from"../../core/accessorSupport/decorators/subclass.js";import p from"./DiscreteOptions.js";let c=class extends s{constructor(o){super(o),this.color=new t([255,0,0,.7]),this.value=r(4,"hours","milliseconds"),this.minValue=0,this.maxValue=r(8,"hours","milliseconds"),this.contextEnabled=!1,this.contextOptions=new p}};o([e({type:t,nonNullable:!0})],c.prototype,"color",void 0),o([e()],c.prototype,"value",void 0),o([e()],c.prototype,"minValue",void 0),o([e()],c.prototype,"maxValue",void 0),o([e()],c.prototype,"contextEnabled",void 0),o([e({type:p,nonNullable:!0})],c.prototype,"contextOptions",void 0),c=o([i("esri.widgets.ShadowCast.ThresholdOptions")],c);const l=c;export{l as default};
5
+ import{_ as o}from"../../chunks/tslib.es6.js";import t from"../../Color.js";import e from"../../core/Accessor.js";import{convertTime as r}from"../../core/timeUtils.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 p}from"../../core/accessorSupport/decorators/subclass.js";import i from"./DiscreteOptions.js";let c=class extends e{constructor(o){super(o),this.color=new t([255,0,0,.7]),this.value=r(4,"hours","milliseconds"),this.minValue=0,this.maxValue=r(8,"hours","milliseconds"),this.contextEnabled=!1,this.contextOptions=new i}};o([s({type:t,nonNullable:!0})],c.prototype,"color",void 0),o([s({type:Number})],c.prototype,"value",void 0),o([s({type:Number})],c.prototype,"minValue",void 0),o([s({type:Number})],c.prototype,"maxValue",void 0),o([s({type:Boolean})],c.prototype,"contextEnabled",void 0),o([s({type:i,nonNullable:!0})],c.prototype,"contextOptions",void 0),c=o([p("esri.widgets.ShadowCast.ThresholdOptions")],c);const l=c;export{l as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{isSome as r}from"../../../../core/arrayUtils.js";import{destroyMaybe as t}from"../../../../core/maybe.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../Widget.js";import i from"./MeasuredContentGroup.js";import l from"./OverflowGroup.js";import n from"./ResponsiveToolbarManager.js";import{SplitButton as c}from"./SplitButton.js";import{loadCalciteComponents as d}from"../../../support/componentsUtils.js";import"../../../support/widgetUtils.js";import{tsx as p}from"../../../support/jsxFactory.js";const m="esri-responsive-toolbar",u={rulerBase:`${m}__ruler`,rulerBarHorizontal:`${m}__ruler--bar`,rulerBarVertical:`${m}__ruler--bar--vertical`,rulerPadVertical:`${m}__ruler--pad--vertical`,rulerPadHorizontal:`${m}__ruler--pad--horizontal`,bar:`${m}__bar`,barHorizontal:`${m}__bar--horizontal`,barVertical:`${m}__bar--vertical`,pad:`${m}__pad`,padVertical:`${m}__pad--vertical`,padHorizontal:`${m}__pad--horizontal`};let h=class extends s{constructor(e){super(e),this.scale="m",this.barStyle="floating",this._measurementManager=new n,this._managedWidgets=new Map}loadDependencies(){return d({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-pad":()=>import("@esri/calcite-components/dist/components/calcite-action-pad")})}destroy(){this._measurementManager=t(this._measurementManager),this._managedWidgets.forEach((e=>e.destroy())),this._managedWidgets.clear()}set layout(e){const r=this._get("layout");this._set("layout",e),this._measurementManager&&(this._measurementManager.layout=e),r!==e&&this.scheduleRender()}render(){const{layout:e,scale:r,barStyle:t}=this,a={layout:e,scale:r,expandDisabled:!0,key:"measured-toolbar"},o="docked"===t?"vertical"===e?u.rulerBarVertical:u.rulerBarHorizontal:"horizontal"===e?u.rulerPadHorizontal:u.rulerPadVertical;return p("div",null,p("div",{afterCreate:e=>{this._measurementManager?.connect(e)},class:this.classes(u.rulerBase,o)}),"docked"===t?p("calcite-action-bar",{...a,classes:{[u.barHorizontal]:"horizontal"===this.layout,[u.barVertical]:"vertical"===this.layout,[u.bar]:!0},overflowActionsDisabled:!0},this._renderChildren()):p("calcite-action-pad",{...a,class:this.classes(u.pad,"horizontal"===e?u.padHorizontal:u.padVertical)},this._renderChildren()))}_renderChildren(){if(!this.children)return;const e=this.children.filter((e=>void 0!==e.properties?.key&&"group-kind"in e.properties)),t=new Set,a=e.map((e=>{const r=e.properties,a=r.key;t.add(a);const o="docked"===this.barStyle?r.slot??void 0:void 0,s=r.priority??0,n=r["group-kind"]??"overflow-group",d=r["allow-collapse"]??!0,p=this._managedWidgets.get(a);if(p)return p.children=e.children,p.priority=s,"allowCollapse"in p&&(p.allowCollapse=d),p.slot=o,p.layout=this.layout,p.scale=this.scale,p.measurementManager=this._measurementManager,p;const m={scale:this.scale,priority:s,measurementManager:this._measurementManager,children:e.children,slot:o,layout:this.layout};switch(n){case"split-button":{const e=new c({...m});return this._managedWidgets.set(a,e),e}case"overflow-group":{const e=new l({...m,allowCollapse:d});return this._managedWidgets.set(a,e),e}case"measured-content":{const e=new i({...m});return this._managedWidgets.set(a,e),e}}})).filter(r);return Array.from(this._managedWidgets.keys()).filter((e=>!t.has(e))).forEach((e=>{this._managedWidgets.get(e)?.destroy(),this._managedWidgets.delete(e)})),this._measurementManager?.allocate(),a.map((e=>e.render()))}};e([a()],h.prototype,"scale",void 0),e([a({value:"horizontal"})],h.prototype,"layout",null),e([a()],h.prototype,"barStyle",void 0),e([a()],h.prototype,"_measurementManager",void 0),e([a()],h.prototype,"_managedWidgets",void 0),h=e([o("esri.widgets.Sketch.support.ResponsiveToolbar.ResponsiveToolbar")],h);export{h as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{isSome as r}from"../../../../core/arrayUtils.js";import{destroyMaybe as t}from"../../../../core/maybe.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../Widget.js";import i from"./MeasuredContentGroup.js";import l from"./OverflowGroup.js";import n from"./ResponsiveToolbarManager.js";import{SplitButton as c}from"./SplitButton.js";import{loadCalciteComponents as d}from"../../../support/componentsUtils.js";import"../../../support/widgetUtils.js";import{tsx as p}from"../../../support/jsxFactory.js";const u="esri-responsive-toolbar",m={rulerBase:`${u}__ruler`,rulerBarHorizontal:`${u}__ruler--bar`,rulerBarVertical:`${u}__ruler--bar--vertical`,rulerPadVertical:`${u}__ruler--pad--vertical`,rulerPadHorizontal:`${u}__ruler--pad--horizontal`,bar:`${u}__bar`,barHorizontal:`${u}__bar--horizontal`,barVertical:`${u}__bar--vertical`,pad:`${u}__pad`,padVertical:`${u}__pad--vertical`,padHorizontal:`${u}__pad--horizontal`};let h=class extends s{constructor(e){super(e),this.scale="m",this.barStyle="floating",this._measurementManager=new n,this._managedWidgets=new Map}loadDependencies(){return d({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar")})}destroy(){this._measurementManager=t(this._measurementManager),this._managedWidgets.forEach((e=>e.destroy())),this._managedWidgets.clear()}set layout(e){const r=this._get("layout");this._set("layout",e),this._measurementManager&&(this._measurementManager.layout=e),r!==e&&this.scheduleRender()}get _barClasses(){const e="docked"===this.barStyle,r="vertical"===this.layout;return{[m.barHorizontal]:e&&!r,[m.barVertical]:e&&r,[m.bar]:e,[m.padHorizontal]:!e&&!r,[m.padVertical]:!e&&r,[m.pad]:!e}}render(){const{layout:e,scale:r,barStyle:t}=this,a={layout:e,scale:r,expandDisabled:!0,key:"measured-toolbar"},o="docked"===t?"vertical"===e?m.rulerBarVertical:m.rulerBarHorizontal:"horizontal"===e?m.rulerPadHorizontal:m.rulerPadVertical;return p("div",null,p("div",{afterCreate:e=>{this._measurementManager?.connect(e)},class:this.classes(m.rulerBase,o)}),p("calcite-action-bar",{...a,classes:this._barClasses,floating:"docked"!==t,overflowActionsDisabled:!0},this._renderChildren()))}_renderChildren(){if(!this.children)return;const e=this.children.filter((e=>void 0!==e.properties?.key&&"group-kind"in e.properties)),t=new Set,a=e.map((e=>{const r=e.properties,a=r.key;t.add(a);const o="docked"===this.barStyle?r.slot??void 0:void 0,s=r.priority??0,n=r["group-kind"]??"overflow-group",d=r["allow-collapse"]??!0,p=this._managedWidgets.get(a);if(p)return p.children=e.children,p.priority=s,"allowCollapse"in p&&(p.allowCollapse=d),p.slot=o,p.layout=this.layout,p.scale=this.scale,p.measurementManager=this._measurementManager,p;const u={scale:this.scale,priority:s,measurementManager:this._measurementManager,children:e.children,slot:o,layout:this.layout};switch(n){case"split-button":{const e=new c({...u,allowCollapse:d});return this._managedWidgets.set(a,e),e}case"overflow-group":{const e=new l({...u,allowCollapse:d});return this._managedWidgets.set(a,e),e}case"measured-content":{const e=new i({...u});return this._managedWidgets.set(a,e),e}}})).filter(r);return Array.from(this._managedWidgets.keys()).filter((e=>!t.has(e))).forEach((e=>{this._managedWidgets.get(e)?.destroy(),this._managedWidgets.delete(e)})),this._measurementManager?.allocate(),a.map((e=>e.render()))}};e([a()],h.prototype,"scale",void 0),e([a({value:"horizontal"})],h.prototype,"layout",null),e([a()],h.prototype,"barStyle",void 0),e([a()],h.prototype,"_measurementManager",void 0),e([a()],h.prototype,"_managedWidgets",void 0),e([a()],h.prototype,"_barClasses",null),h=e([o("esri.widgets.Sketch.support.ResponsiveToolbar.ResponsiveToolbar")],h);export{h as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import{property as o}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";import r from"../../../Widget.js";import{WellKnownSizes as i,Icons as n}from"./responsiveToolbarUtils.js";import{ToolbarGroupBase as s}from"./ToolbarGroupBase.js";import{loadCalciteComponents as a}from"../../../support/componentsUtils.js";import"../../../support/widgetUtils.js";import{messageBundle as c}from"../../../support/decorators/messageBundle.js";import{tsx as p,tsxFragment as l}from"../../../support/jsxFactory.js";const m={splitButtonBase:`${"esri-split-button"}--split-part`};let u=class extends(s(r)){constructor(t){super(t),this.messagesCommon=null}loadDependencies(){return a({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu")})}static{this.vnodeSelector="calcite-action-group"}get minimumLength(){const t=this.actionChildren;return t.length?1===t.length?i.action[this.scale]+i.groupSeparator:i.action[this.scale]+i.splitButtonPart[this.layout][this.scale]+i.groupSeparator:0}get lengthOptions(){const{actionChildren:t,minimumLength:o,layout:e,scale:r,priority:n}=this;if(t.length<2||n<0)return[o];const s=i.groupSeparator+i.action[r]*t.length;return[i.groupSeparator+i.action[r]+i.splitButtonPart[e][r],s]}render(){if(!this.actionChildren.length)return p(l,null,void 0);const{actionChildren:t,minimumLength:o,budgetedLength:e,layout:r,slot:i}=this,n=t.length<2||e>o;return p("calcite-action-group",{key:"split-button-group",layout:r,onclick:t=>this._handleClick(t.target),slot:i},n?this._renderUnSplit():this._renderSplit())}_renderSplit(){const{activeChildElement:t,layout:o,actionChildren:e,scale:r,messagesCommon:i}=this,s=t??e.at(0);if(!s)return;const a=e.filter((t=>t!==s));return[this._renderManagedAction(s),p("calcite-action-menu",{key:"split-button-dropdown",label:i.more,overlayPositioning:"fixed",placement:"horizontal"===o?"bottom-end":"right-end"},p("calcite-action",{class:`${m.splitButtonBase}--${o}--${this.scale}`,compact:"horizontal"===o,icon:n.splitButton[o],key:"split-button-dropdown-trigger",scale:r,slot:"trigger",text:i.more}),a?.map((t=>this._renderManagedAction(t))))]}_renderUnSplit(){return this.actionChildren.map((t=>this._renderManagedAction(t)))}_renderManagedAction(t){return p("calcite-action",{...t?.properties,"data-action-key":t?.properties?.key,text:t?.properties?.text??""})}};t([o()],u.prototype,"minimumLength",null),t([o()],u.prototype,"lengthOptions",null),t([o(),c("esri/t9n/common")],u.prototype,"messagesCommon",void 0),u=t([e("esri.widgets.Sketch.support.ResponsiveToolbar.SplitButton")],u);export{u as SplitButton};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{property as o}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";import r from"../../../Widget.js";import{WellKnownSizes as i,Icons as n}from"./responsiveToolbarUtils.js";import{ToolbarGroupBase as s}from"./ToolbarGroupBase.js";import{loadCalciteComponents as a}from"../../../support/componentsUtils.js";import"../../../support/widgetUtils.js";import{messageBundle as l}from"../../../support/decorators/messageBundle.js";import{tsx as p,tsxFragment as c}from"../../../support/jsxFactory.js";const m={splitButtonBase:`${"esri-split-button"}--split-part`};let u=class extends(s(r)){constructor(t){super(t),this.allowCollapse=!0,this.messagesCommon=null}loadDependencies(){return a({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu")})}static{this.vnodeSelector="calcite-action-group"}get minimumLength(){const t=this.actionChildren;return t.length?1===t.length?i.action[this.scale]+i.groupSeparator:this.allowCollapse?i.action[this.scale]+i.splitButtonPart[this.layout][this.scale]+i.groupSeparator:i.action[this.scale]*t.length+i.groupSeparator:0}get lengthOptions(){const{actionChildren:t,minimumLength:o,layout:e,scale:r,priority:n,allowCollapse:s}=this;if(t.length<2||n<0||!s)return[o];const a=i.groupSeparator+i.action[r]*t.length;return[i.groupSeparator+i.action[r]+i.splitButtonPart[e][r],a]}render(){if(!this.actionChildren.length)return p(c,null,void 0);const{actionChildren:t,minimumLength:o,budgetedLength:e,layout:r,slot:i,allowCollapse:n}=this,s=!n||t.length<2||e>o;return p("calcite-action-group",{key:"split-button-group",layout:r,onclick:t=>this._handleClick(t.target),slot:i},s?this._renderUnSplit():this._renderSplit())}_renderSplit(){const{activeChildElement:t,layout:o,actionChildren:e,scale:r,messagesCommon:i}=this,s=t??e.at(0);if(!s)return;const a=e.filter((t=>t!==s));return[this._renderManagedAction(s),p("calcite-action-menu",{key:"split-button-dropdown",label:i.more,overlayPositioning:"fixed",placement:"horizontal"===o?"bottom-end":"right-end"},p("calcite-action",{class:`${m.splitButtonBase}--${o}--${this.scale}`,compact:"horizontal"===o,icon:n.splitButton[o],key:"split-button-dropdown-trigger",scale:r,slot:"trigger",text:i.more}),a?.map((t=>this._renderManagedAction(t))))]}_renderUnSplit(){return this.actionChildren.map((t=>this._renderManagedAction(t)))}_renderManagedAction(t){return p("calcite-action",{...t?.properties,"data-action-key":t?.properties?.key,text:t?.properties?.text??""})}};t([o()],u.prototype,"minimumLength",null),t([o()],u.prototype,"allowCollapse",void 0),t([o()],u.prototype,"lengthOptions",null),t([o(),l("esri/t9n/common")],u.prototype,"messagesCommon",void 0),u=t([e("esri.widgets.Sketch.support.ResponsiveToolbar.SplitButton")],u);export{u as SplitButton};
@@ -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/Collection.js";import i from"../core/Identifiable.js";import{on as o,watch as s,initial as l}from"../core/reactiveUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import a from"./Widget.js";import d from"./LayerList/LayerListItem.js";import{minDragEnabledItems as c,minFilterItems as m,getLayerType as p,removeDestroyedListItems as h,setFilterPredicate as u}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{globalCss as f}from"./support/globalCss.js";import{calciteListFilterProps as I}from"./support/listUtils.js";import{setFocus as b}from"./support/widgetUtils.js";import{messageBundle as _}from"./support/decorators/messageBundle.js";import{vmEvent as v}from"./support/decorators/vmEvent.js";import{tsx as y}from"./support/jsxFactory.js";import{css as w}from"./TableList/css.js";import L from"./TableList/ListItem.js";import E from"./TableList/TableListViewModel.js";import C from"./TableList/TableListVisibleElements.js";import{getItem as F,sortTablesToIds as M}from"./TableList/support/tableListUtils.js";const P="nested",j=t.ofType(L);let D=class extends(i.IdentifiableMixin(a)){constructor(e,t){super(e,t),this._rootListEl=null,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`table-${this.uid}`,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=c,this.minFilterItems=m,this.selectedItems=new j,this.selectionMode="none",this.viewModel=new E,this.visibleElements=new C,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=F(e);if(!l?.sortable)return!1;const r=F(t),n=p(t),a=F(i),d=p(i),c=!!n&&!!d&&n===d,m={selected:l,from:r,to:a},h=t.group,u=i.group;return h&&u&&"function"==typeof s?s.call(null,m):c},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:o,dragEl:s,newIndex:l}=e;if(!o||!i||t?.newIndex===l&&t?.dragEl===s&&t?.toEl===i&&t?.fromEl===o)return;this._lastDragDetail=e,this._selectedDragItemLayerUid=s.value;const r=Array.from(o.children).filter((e=>e?.matches("calcite-list-item"))).map((e=>e.value));M(this.map?.tables,r)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0}}initialize(){this.addHandles([o((()=>this.viewModel.tableItems),"change",(()=>h(this.selectedItems)),l),s((()=>[this.filterPredicate,this._rootListEl]),(()=>u(this._rootListEl,this.filterPredicate)))])}loadDependencies(){return g({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}get _dragEnabled(){return this.viewModel.totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this.viewModel.totalItems>=this.minFilterItems&&this.visibleElements.filter}get _visibleItems(){return this.tableItems?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error)))}get _openedPanelItems(){return this._visibleItems.filter((({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled))}get icon(){return"table"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get tableItems(){return this.viewModel.tableItems}get tables(){return this.viewModel.tables}set tables(e){this.viewModel.tables=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[f.hidden]:"loading"===e,[f.disabled]:"disabled"===e};return y("div",{class:this.classes(w.base,f.widget,f.panel,t)},this._renderItems())}_renderNoItemsMessage(){return y("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return y("div",{class:w.itemMessage,key:"esri-layer-list__no-items"},y("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}_renderPanelFlowItems(){const{_openedPanelItems:e}=this;return e.toArray().map((({title:t,panel:i},o)=>{const s=()=>this._handlePanelFlowItemBack(i);return y("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:t,heading:i.title,headingLevel:this.headingLevel,key:`flow-panel-${i.uid}`,selected:o===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),s()}},i.render(),y("calcite-button",{appearance:"transparent",onclick:s,slot:"footer-actions",width:"full"},this.messagesCommon.back))}))}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,b(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,b(e))}_renderItems(){const{visible:e,collapsed:t,visibleElements:{closeButton:i,collapseButton:o,heading:s,flow:l},_dragEnabled:r,_visibleItems:n,_filterEnabled:a,_rootGroupUid:d,_openedPanelItems:c,selectionMode:m,messages:p,filterPlaceholder:h,filterText:u}=this,g=[y("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:i,closed:!e,collapsed:t,collapsible:o,heading:s?p.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!c.length,onCalciteFlowItemClose:()=>this.visible=!1},n?.length?y("calcite-list",{afterCreate:e=>{this._rootListEl=e},afterRemoved:()=>{this._rootListEl=null},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":d,displayMode:P,dragEnabled:r,filterEnabled:a,filterPlaceholder:h,filterProps:I,filterText:a?u:"",group:d,key:"root-list",label:p.widgetLabel,selectionAppearance:"border",selectionMode:m,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},n.toArray().map((e=>this._renderItem(e))),a?y("div",{class:w.filterNoResults,slot:"filter-no-results"},y("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null):this._renderNoItems()),this._renderPanelFlowItems()];return e?l?y("calcite-flow",{key:"root-flow"},g):g:null}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:o}=e;t.insertBefore(i,t.children[o])}_renderItem(e){return y(d,{canMove:this._canMove,css:w,displayMode:P,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer.uid}`,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange})}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map((e=>F(e))).filter(Boolean);i.removeAll(),i.addMany(o)}};e([r()],D.prototype,"_rootListEl",void 0),e([r()],D.prototype,"_focusRootFlowItem",void 0),e([r()],D.prototype,"_focusPanelFlowItem",void 0),e([r()],D.prototype,"_dragEnabled",null),e([r()],D.prototype,"_filterEnabled",null),e([r()],D.prototype,"_visibleItems",null),e([r()],D.prototype,"_openedPanelItems",null),e([r()],D.prototype,"collapsed",void 0),e([r()],D.prototype,"dragEnabled",void 0),e([r()],D.prototype,"filterPlaceholder",void 0),e([r()],D.prototype,"filterPredicate",void 0),e([r()],D.prototype,"filterText",void 0),e([r()],D.prototype,"headingLevel",void 0),e([r()],D.prototype,"icon",null),e([r()],D.prototype,"label",null),e([r()],D.prototype,"listItemCanGiveFunction",void 0),e([r()],D.prototype,"listItemCanReceiveFunction",void 0),e([r()],D.prototype,"listItemCreatedFunction",null),e([r()],D.prototype,"map",null),e([r(),_("esri/widgets/TableList/t9n/TableList")],D.prototype,"messages",void 0),e([r(),_("esri/t9n/common")],D.prototype,"messagesCommon",void 0),e([r()],D.prototype,"minDragEnabledItems",void 0),e([r()],D.prototype,"minFilterItems",void 0),e([r({type:j})],D.prototype,"selectedItems",void 0),e([r()],D.prototype,"selectionMode",void 0),e([r({readOnly:!0})],D.prototype,"tableItems",null),e([r()],D.prototype,"tables",null),e([v("trigger-action"),r({type:E})],D.prototype,"viewModel",void 0),e([r({type:C,nonNullable:!0})],D.prototype,"visibleElements",void 0),D=e([n("esri.widgets.TableList")],D);const T=D;export{T as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import i from"../core/Identifiable.js";import{on as o,watch as s,initial as l}from"../core/reactiveUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import a from"./Widget.js";import d from"./LayerList/LayerListItem.js";import{minDragEnabledItems as c,minFilterItems as m,getLayerType as p,removeDestroyedListItems as h,setFilterPredicate as u}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{globalCss as f}from"./support/globalCss.js";import{calciteListFilterProps as I}from"./support/listUtils.js";import{setFocus as b}from"./support/widgetUtils.js";import{messageBundle as _}from"./support/decorators/messageBundle.js";import{vmEvent as v}from"./support/decorators/vmEvent.js";import{tsx as y}from"./support/jsxFactory.js";import{css as w}from"./TableList/css.js";import L from"./TableList/ListItem.js";import E from"./TableList/TableListViewModel.js";import C from"./TableList/TableListVisibleElements.js";import{getItem as F,sortTablesToIds as M}from"./TableList/support/tableListUtils.js";const P="nested",j=t.ofType(L);let D=class extends(i.IdentifiableMixin(a)){constructor(e,t){super(e,t),this._rootListEl=null,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`table-${this.uid}`,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=c,this.minFilterItems=m,this.selectedItems=new j,this.selectionMode="none",this.viewModel=new E,this.visibleElements=new C,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=F(e);if(!l?.sortable)return!1;const r=F(t),n=p(t),a=F(i),d=p(i),c=!!n&&!!d&&n===d,m={selected:l,from:r,to:a},h=t.group,u=i.group;return h&&u&&"function"==typeof s?s.call(null,m):c},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:o,dragEl:s,newIndex:l}=e;if(!o||!i||t?.newIndex===l&&t?.dragEl===s&&t?.toEl===i&&t?.fromEl===o)return;this._lastDragDetail=e,this._selectedDragItemLayerUid=s.value;const r=Array.from(o.children).filter((e=>e?.matches("calcite-list-item"))).map((e=>e.value));M(this.map?.tables,r)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0}}initialize(){this.addHandles([o((()=>this.viewModel.tableItems),"change",(()=>h(this.selectedItems)),l),s((()=>[this.filterPredicate,this._rootListEl]),(()=>u(this._rootListEl,this.filterPredicate)))])}loadDependencies(){return g({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}get _dragEnabled(){return this.viewModel.totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this.viewModel.totalItems>=this.minFilterItems&&this.visibleElements.filter}get _visibleItems(){return this.tableItems?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error)))}get _openedPanelItems(){return this._visibleItems.filter((({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled))}get icon(){return"table"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get tableItems(){return this.viewModel.tableItems}get tables(){return this.viewModel.tables}set tables(e){this.viewModel.tables=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[f.hidden]:"loading"===e,[f.disabled]:"disabled"===e};return y("div",{class:this.classes(w.base,f.widget,f.panel,t)},this._renderItems())}_renderNoItemsMessage(){return y("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return y("div",{class:w.itemMessage,key:"esri-layer-list__no-items"},y("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}_renderPanelFlowItems(){const{_openedPanelItems:e}=this;return e.toArray().map((({title:t,panel:i},o)=>{const s=()=>this._handlePanelFlowItemBack(i);return y("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:t,heading:i.title,headingLevel:this.headingLevel,key:`flow-panel-${i.uid}`,selected:o===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),s()}},i.render(),y("calcite-button",{appearance:"transparent",onclick:s,slot:"footer-actions",width:"full"},this.messagesCommon.back))}))}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,b(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,b(e))}_renderItems(){const{visible:e,collapsed:t,visibleElements:{closeButton:i,collapseButton:o,heading:s,flow:l},_dragEnabled:r,_visibleItems:n,_filterEnabled:a,_rootGroupUid:d,_openedPanelItems:c,selectionMode:m,messages:p,filterPlaceholder:h,filterText:u}=this,g=[y("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:i,closed:!e,collapsed:t,collapsible:o,heading:s?p.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!c.length,onCalciteFlowItemClose:()=>this.visible=!1},n?.length?null:this._renderNoItems(),y("calcite-list",{afterCreate:e=>{this._rootListEl=e},afterRemoved:()=>{this._rootListEl=null},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":d,displayMode:P,dragEnabled:r,filterEnabled:a,filterPlaceholder:h,filterProps:I,filterText:a?u:"",group:d,key:"root-list",label:p.widgetLabel,selectionAppearance:"border",selectionMode:m,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},n.toArray().map((e=>this._renderItem(e))),a?y("div",{class:w.filterNoResults,slot:"filter-no-results"},y("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems()];return e?l?y("calcite-flow",{key:"root-flow"},g):g:null}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:o}=e;t.insertBefore(i,t.children[o])}_renderItem(e){return y(d,{canMove:this._canMove,css:w,displayMode:P,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer.uid}`,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange})}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map((e=>F(e))).filter(Boolean);i.removeAll(),i.addMany(o)}};e([r()],D.prototype,"_rootListEl",void 0),e([r()],D.prototype,"_focusRootFlowItem",void 0),e([r()],D.prototype,"_focusPanelFlowItem",void 0),e([r()],D.prototype,"_dragEnabled",null),e([r()],D.prototype,"_filterEnabled",null),e([r()],D.prototype,"_visibleItems",null),e([r()],D.prototype,"_openedPanelItems",null),e([r()],D.prototype,"collapsed",void 0),e([r()],D.prototype,"dragEnabled",void 0),e([r()],D.prototype,"filterPlaceholder",void 0),e([r()],D.prototype,"filterPredicate",void 0),e([r()],D.prototype,"filterText",void 0),e([r()],D.prototype,"headingLevel",void 0),e([r()],D.prototype,"icon",null),e([r()],D.prototype,"label",null),e([r()],D.prototype,"listItemCanGiveFunction",void 0),e([r()],D.prototype,"listItemCanReceiveFunction",void 0),e([r()],D.prototype,"listItemCreatedFunction",null),e([r()],D.prototype,"map",null),e([r(),_("esri/widgets/TableList/t9n/TableList")],D.prototype,"messages",void 0),e([r(),_("esri/t9n/common")],D.prototype,"messagesCommon",void 0),e([r()],D.prototype,"minDragEnabledItems",void 0),e([r()],D.prototype,"minFilterItems",void 0),e([r({type:j})],D.prototype,"selectedItems",void 0),e([r()],D.prototype,"selectionMode",void 0),e([r({readOnly:!0})],D.prototype,"tableItems",null),e([r()],D.prototype,"tables",null),e([v("trigger-action"),r({type:E})],D.prototype,"viewModel",void 0),e([r({type:C,nonNullable:!0})],D.prototype,"visibleElements",void 0),D=e([n("esri.widgets.TableList")],D);const T=D;export{T as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../Color.js";import i from"../../../core/Evented.js";import r from"../../../core/Logger.js";import{rad2deg as s}from"../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{when as n,watch as a}from"../../../core/reactiveUtils.js";import{convertUnit as l}from"../../../core/unitUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../geometry/Point.js";import{isLoadedOrLoadFor as d,project as m}from"../../../geometry/projectionUtils.js";import{getResolutionForScale as g}from"../../../geometry/support/scaleUtils.js";import{MeasuredGrid as u}from"../../../grids/MeasuredGrid.js";import{makeDehydratedPoint as v}from"../../../layers/graphics/dehydratedPoint.js";import{defaultUnitPropertyMetadata as y}from"../../../properties/defaultUnit.js";import _ from"../../../symbols/SimpleLineSymbol.js";import w from"../../../symbols/SimpleMarkerSymbol.js";import{minimumPixelsPerStrideForDisplayWhenScalingOff as f}from"../../../views/2d/grid/constants.js";import{getScaleFactor as S,shouldUsePlanar as b,measureMetersPerUnitAtReferencePoint as P}from"../../../views/2d/grid/gridUtils.js";import{DrawGraphicTool2D as j}from"../../../views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js";import"../../../views/2d/interactive/editingTools/ControlPointsTransformTool.js";import"../../../views/2d/interactive/editingTools/TransformTool.js";import"../../../views/2d/interactive/editingTools/MediaTransformToolsWrapper.js";import C from"../../../views/interactive/snapping/SnappingOptions.js";import{gridPlacementGraphicSymbol as T}from"../../../views/interactive/snapping/snappingUtils.js";import x from"../../../views/overlay/CrosshairOverlayItem.js";import G from"../../../views/overlay/TextOverlayItem.js";import{loadAutomaticAreaMeasurementUtils as O}from"../../../views/support/automaticAreaMeasurementUtils.js";import{loadAutomaticLengthMeasurementUtils as R}from"../../../views/support/automaticLengthMeasurementUtils.js";import{degreeSymbol as L}from"../../CoordinateConversion/support/formatUtils.js";import{applyColorToGrid as M,gridRotationToDegrees as I}from"./gridUtils.js";const U=Symbol("grid-interactivity");let k=class extends i.EventedAccessor{constructor(t){super(t),this._drawGraphicTool=null,this._crosshairLabel=null,this._crosshairItem=null,this.snappingManager=null,this.snappingOptions=null,this.view=null,this.placementDisabled=!1,this._mostRecentlyShownGrid=null,this._sketchedVertexCount=0}initialize(){this.addHandles([n((()=>!this.displayEnabled),(()=>{this.interactivePlacementState=null})),a((()=>this.view?.viewpoint),(()=>{this._renderOverlays()})),a((()=>this.snappingOptions?.gridEnabled),(t=>{null!=t&&this.trySetDisplayEnabled(t)})),a((()=>this.view?.grid),((t,e)=>{this._mostRecentlyShownGrid=!t&&e?e:null}))])}destroy(){this._resetGridPlacementState(),this._crosshairItem&&(this.view?.overlay?.removeItem(this._crosshairItem),this._crosshairItem=o(this._crosshairItem)),this._crosshairLabel&&(this.view?.overlay?.removeItem(this._crosshairLabel),this._crosshairLabel=o(this._crosshairLabel))}get displayEnabled(){return!!this.view?.grid}get dynamicScaling(){return this.grid?.dynamicScaling??!1}set dynamicScaling(t){this.grid&&(this.grid.dynamicScaling=t)}get grid(){return this.view?.grid??this._mostRecentlyShownGrid}set gridColor(t){if(t?.equals(this.grid?.majorLineColor))return;if(!t)return;const[e,i,r,s]=t.toArray();M(this.grid,[e,i,r,s/255])}get gridColor(){return this.grid?.majorLineColor}get gridControlsEnabled(){return this.displayEnabled&&!this.interactivePlacementState}set interactivePlacementState(t){this._set("interactivePlacementState",t),this._resetGridPlacementState(),t&&this._startGridManipulation(t)}get majorLineInterval(){return this.grid?.majorLineInterval??10}set majorLineInterval(t){this.grid&&(this.grid.majorLineInterval=t<1?1:t>15?15:t)}get rotateWithMap(){return this.grid?.rotateWithMap??!1}set rotateWithMap(t){this.grid&&(this.grid.rotateWithMap=t)}get rotation(){return this.grid?.rotation??-180}set rotation(t){this.grid&&(this.grid.rotation=t)}get snappingEnabled(){return(this.grid&&this.snappingOptions?.gridEnabled)??!1}set snappingEnabled(t){const{snappingOptions:e}=this;e&&(e.gridEnabled=t)}get spacing(){return this.grid?.spacing??1}set spacing(t){this.grid&&t>0&&(this.grid.spacing=t)}get unit(){return this.grid?.units}set unit(t){this.grid&&(this.grid.units=t)}get gridOutOfScale(){return!this.dynamicScaling&&null!=this._pixelsPerStride&&this._pixelsPerStride<f}get effectiveSpacingAfterDynamicScaling(){return this.majorLineInterval<1||!this.dynamicScaling||!this.view||null==this._pixelsPerStride||!this.grid?.spacing?null:this.grid.spacing*S(this.majorLineInterval,this._pixelsPerStride,this.dynamicScaling)}get numericSpacingInputShouldBeVisible(){return!!this.view?.spatialReference&&b(this.view.spatialReference)}get _metersPerSRUnit(){if(!(this.view&&this.displayEnabled&&this.grid&&d(this.grid.center.spatialReference,this.view.spatialReference)))return null;const t=m(this.grid.center,this.view.spatialReference);return P(t)}get _pixelsPerStride(){if(!this.view?.scale||!this.displayEnabled||!this.grid||null==this._metersPerSRUnit)return null;const t=this.grid,{scale:e,spatialReference:i}=this.view;return l(t.spacing,t.units,"meters")/(this._metersPerSRUnit*g(e,i))}get _isPlacing(){if(!this._drawGraphicTool)return!1;const t=this.interactivePlacementState;return"place"===t||"interactive"===t&&0===this._sketchedVertexCount}get _isRotating(){if(!this._drawGraphicTool)return!1;const t=this.interactivePlacementState;return"rotate"===t||"interactive"===t&&1===this._sketchedVertexCount}get _isScaling(){if(!this._drawGraphicTool)return!1;return"interactive"===this.interactivePlacementState&&1===this._sketchedVertexCount}togglePlacementState(t){this.interactivePlacementState=this.interactivePlacementState===t?null:t}trySetDisplayEnabled(t){const{view:e}=this;if(e?.ready)if(!e.grid&&t)if(this._mostRecentlyShownGrid)e.grid=this._mostRecentlyShownGrid;else{const t="imperial"===this.defaultUnit?"feet":"meters";e.grid=new u({units:t,center:e.center??new p,rotateWithMap:!0}),M(this.grid,[115,115,115])}else t||(e.grid=null);else r.getLogger(this).warn("Attempting to enable grid display while view is not ready")}async startPlacement(t){const{view:e,snappingManager:i}=this;if(!e)return;this._set("interactivePlacementState",t),this._sketchedVertexCount=0;const r=new j({view:e,graphicProperties:{attributes:{[T]:T}},sketchOptions:{tooltips:{enabled:!0,visibleElements:{direction:!1,rotation:!1,totalLength:!1,elevation:!1,distance:!1,area:!1}}},geometryType:"polyline",mode:"click",snapToScene:!1,snappingManager:i,forceUniformSize:!0,centered:!1,cursor:"interactive"===this.interactivePlacementState||"place"===this.interactivePlacementState?"none":null,regularVerticesSymbol:void 0,activeVertexSymbol:V,activeLineSymbol:E,graphicSymbol:E,automaticAreaMeasurementUtils:await O(),automaticLengthMeasurementUtils:await R()});this._drawGraphicTool=r,e.addAndActivateTool(r),this._renderOverlays(),this.addHandles([r.on("cursor-update",(t=>this._onCursorUpdate(t))),r.on("complete",(()=>this._onDrawComplete())),r.on("vertex-add",(e=>this._onVertexAdd(e,t)))],U)}async _startGridManipulation(t){const{view:e}=this;if(!e)return void(this.interactivePlacementState=null);const i=new CustomEvent("before-placement",{cancelable:!0});this.emit("before-placement",i),i.defaultPrevented||await this.startPlacement(t)}_onCursorUpdate(t){try{if(this._isPlacing){const e=t.vertices[0].coordinates;return void this._handlePlace(e)}if(this._drawGraphicTool.cursor=null,this._isRotating&&this._handleRotate(t.vertices[0].coordinates),this._isScaling){const t=this._drawGraphicTool?.drawOperation.cursorVertex;this._handleScale(t)}}finally{this._renderOverlays()}}_onDrawComplete(){this._drawGraphicTool.cursor=null,this.interactivePlacementState=null}_onVertexAdd(t,e){const i=t.vertices[0].coordinates;this._isPlacing&&this._handlePlace(i),this._isRotating&&this._sketchedVertexCount>0&&this._handleRotate(i),this._isScaling&&this._sketchedVertexCount>0&&this._handleScale(v(i[0],i[1],void 0,this.view.spatialReference)),this._sketchedVertexCount++,this._drawGraphicTool.cursor=null,2!==this._sketchedVertexCount&&"interactive"===e||(this.interactivePlacementState=null),this._renderOverlays()}_handlePlace(t){const{grid:e,view:i}=this;e&&i&&(e.center=new p({x:t[0],y:t[1],spatialReference:i.spatialReference}))}_handleRotate(t){const{grid:e,view:i}=this;if(!e||!i)return;this._drawGraphicTool?.sketchOptions.tooltips.set("enabled",!1);const{x:r,y:o}=e.center,[n,a]=t,l=i.toScreen(e.center,{pickClosestTarget:!0}),c=l&&i.toMap(l),h=i.toScreen(v(n,a,void 0,i.spatialReference),{pickClosestTarget:!0}),p=h&&i.toMap(h),d=c?c.x:r,m=c?c.y:o,g=d-(p?p.x:n),u=m-(p?p.y:a);if(0===g&&0===u)return;const y=Math.atan2(u,g),_=s(y),w=e.rotateWithMap,f=i.viewpoint.rotation??0,S=w?_:_-f;e.rotation=Math.fround(S)%360}_handleScale(t){const{view:e,grid:i,_drawGraphicTool:r,interactivePlacementState:s,_metersPerSRUnit:o}=this;if(!(t&&e&&i&&r&&o))return;r.sketchOptions.tooltips.enabled=!1;const n="interactive"===s?i.center:r.drawOperation.firstVertex;if(!n||!t)return;const a=e?.toScreen(n),c=a&&e.toMap(a),h=e?.toScreen(t),p=c??n,d=(h&&e.toMap(h))??t,m=Math.sqrt((p.x-d.x)**2+(p.y-d.y)**2),g=l(m*o,"meters",i.units);this.spacing=g}_renderOverlays(){this._renderCrosshairOverlay(),this._renderTextOverlay()}_renderTextOverlay(){const{grid:t,view:e,_drawGraphicTool:i}=this,r=this._getCrosshairLabel();if(!(t&&e?.overlay&&i&&r))return;const s=e.toScreen(t.center,{pickClosestTarget:!0});s&&(r.position=[s.x+12,s.y+12]),this._isRotating?(r.text=`${I(t.rotation)}${L}`,r.visible=!0):r.visible=!1}_renderCrosshairOverlay(){const{grid:t,view:e,_drawGraphicTool:i}=this;if(!t||!e?.overlay||!i)return;const r=this._getCrosshair();if(!r)return;const s=e.toScreen(t.center);s&&(r.x=s.x,r.y=s.y,r.rotation=t.rotateWithMap?e.viewpoint.rotation-t.rotation:-t.rotation,r.visible=!!i)}_getCrosshairLabel(){if(this._crosshairLabel)return this._crosshairLabel;const{grid:t,view:i,_drawGraphicTool:r}=this;if(!t||!i?.overlay||!r)return null;const s=new G({anchor:"top-left",fontSize:10,textColor:new e([21,21,21]),backgroundColor:new e([248,248,248]),padding:8,borderRadius:20});return i.overlay.addItem(s),this._crosshairLabel=s,s}_getCrosshair(){const{_crosshairItem:t,view:e}=this;return e?.overlay?t&&e.overlay.items.includes(t)?t:(this._crosshairItem=new x({color:e.effectiveTheme.accentColor,thickness:4,length:36,visible:!0}),e.overlay?.addItem(this._crosshairItem),this._crosshairItem):null}_resetGridPlacementState(){this.removeHandles(U),this._crosshairItem&&(this._crosshairItem.visible=!1),this._crosshairLabel&&(this._crosshairLabel.visible=!1),this._drawGraphicTool&&(this.view?.activeTool===this._drawGraphicTool&&(this.view.activeTool=null),this.view?.tools.remove(this._drawGraphicTool)),this._drawGraphicTool=o(this._drawGraphicTool)}};t([c(y)],k.prototype,"defaultUnit",void 0),t([c({readOnly:!0})],k.prototype,"displayEnabled",null),t([c()],k.prototype,"dynamicScaling",null),t([c()],k.prototype,"grid",null),t([c()],k.prototype,"gridColor",null),t([c({readOnly:!0})],k.prototype,"gridControlsEnabled",null),t([c()],k.prototype,"interactivePlacementState",null),t([c()],k.prototype,"majorLineInterval",null),t([c()],k.prototype,"rotateWithMap",null),t([c()],k.prototype,"rotation",null),t([c()],k.prototype,"snappingEnabled",null),t([c()],k.prototype,"snappingManager",void 0),t([c({type:C})],k.prototype,"snappingOptions",void 0),t([c()],k.prototype,"spacing",null),t([c()],k.prototype,"unit",null),t([c()],k.prototype,"view",void 0),t([c({readOnly:!0})],k.prototype,"gridOutOfScale",null),t([c({readOnly:!0})],k.prototype,"effectiveSpacingAfterDynamicScaling",null),t([c({readOnly:!0})],k.prototype,"numericSpacingInputShouldBeVisible",null),t([c()],k.prototype,"placementDisabled",void 0),t([c()],k.prototype,"_metersPerSRUnit",null),t([c()],k.prototype,"_pixelsPerStride",null),t([c()],k.prototype,"_isPlacing",null),t([c()],k.prototype,"_isRotating",null),t([c()],k.prototype,"_isScaling",null),t([c()],k.prototype,"_mostRecentlyShownGrid",void 0),t([c()],k.prototype,"_sketchedVertexCount",void 0),k=t([h("esri.widgets.support.GridControls.GridControlsViewModel")],k);const E=new _({width:0}),V=new w({color:e.fromArray([0,0,0,0]),outline:new _({color:e.fromArray([0,0,0,0])})});export{k as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../Color.js";import i from"../../../core/Evented.js";import r from"../../../core/Logger.js";import{rad2deg as s}from"../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{when as n,watch as a}from"../../../core/reactiveUtils.js";import{convertUnit as l}from"../../../core/unitUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import d from"../../../geometry/Point.js";import{isLoadedOrLoadFor as p,project as m}from"../../../geometry/projectionUtils.js";import{getResolutionForScale as g}from"../../../geometry/support/scaleUtils.js";import{MeasuredGrid as u}from"../../../grids/MeasuredGrid.js";import{makeDehydratedPoint as v}from"../../../layers/graphics/dehydratedPoint.js";import{defaultUnitPropertyMetadata as y}from"../../../properties/defaultUnit.js";import _ from"../../../symbols/SimpleLineSymbol.js";import w from"../../../symbols/SimpleMarkerSymbol.js";import{minimumPixelsPerStrideForDisplayWhenScalingOff as f}from"../../../views/2d/grid/constants.js";import{getScaleFactor as S,shouldUsePlanar as b,measureMetersPerUnitAtReferencePoint as j}from"../../../views/2d/grid/gridUtils.js";import{DrawGraphicTool2D as P}from"../../../views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js";import"../../../views/2d/interactive/editingTools/ControlPointsTransformTool.js";import"../../../views/2d/interactive/editingTools/TransformTool.js";import"../../../views/2d/interactive/editingTools/MediaTransformToolsWrapper.js";import{ViewEventPriorities as T}from"../../../views/input/InputManager.js";import{KeyBindings as C,sketchKeys as x}from"../../../views/interactive/keybindings.js";import G from"../../../views/interactive/snapping/SnappingOptions.js";import{gridPlacementGraphicSymbol as O}from"../../../views/interactive/snapping/snappingUtils.js";import R from"../../../views/overlay/CrosshairOverlayItem.js";import M from"../../../views/overlay/TextOverlayItem.js";import{loadAutomaticAreaMeasurementUtils as L}from"../../../views/support/automaticAreaMeasurementUtils.js";import{loadAutomaticLengthMeasurementUtils as I}from"../../../views/support/automaticLengthMeasurementUtils.js";import{degreeSymbol as k}from"../../CoordinateConversion/support/formatUtils.js";import{applyColorToGrid as U,gridRotationToDegrees as E}from"./gridUtils.js";const V=Symbol("grid-interactivity");let A=class extends i.EventedAccessor{constructor(t){super(t),this._drawGraphicTool=null,this._keybindings=null,this._crosshairLabel=null,this._crosshairItem=null,this.snappingManager=null,this.snappingOptions=null,this.view=null,this.placementDisabled=!1,this._mostRecentlyShownGrid=null,this._sketchedVertexCount=0}initialize(){this.addHandles([n((()=>!this.displayEnabled),(()=>{this.interactivePlacementState=null})),a((()=>this.view?.viewpoint),(()=>{this._renderOverlays()})),a((()=>this.snappingOptions?.gridEnabled),(t=>{null!=t&&this.trySetDisplayEnabled(t)})),a((()=>this.view?.grid),((t,e)=>{this._mostRecentlyShownGrid=!t&&e?e:null}))])}destroy(){this._resetGridPlacementState(),this._crosshairItem&&(this.view?.overlay?.removeItem(this._crosshairItem),this._crosshairItem=o(this._crosshairItem)),this._crosshairLabel&&(this.view?.overlay?.removeItem(this._crosshairLabel),this._crosshairLabel=o(this._crosshairLabel))}get displayEnabled(){return!!this.view?.grid}get dynamicScaling(){return this.grid?.dynamicScaling??!1}set dynamicScaling(t){this.grid&&(this.grid.dynamicScaling=t)}get grid(){return this.view?.grid??this._mostRecentlyShownGrid}set gridColor(t){if(t?.equals(this.grid?.majorLineColor))return;if(!t)return;const[e,i,r,s]=t.toArray();U(this.grid,[e,i,r,s/255])}get gridColor(){return this.grid?.majorLineColor}get gridControlsEnabled(){return this.displayEnabled&&!this.interactivePlacementState}set interactivePlacementState(t){this._set("interactivePlacementState",t),this._resetGridPlacementState(),t&&this._startGridManipulation(t)}get majorLineInterval(){return this.grid?.majorLineInterval??10}set majorLineInterval(t){this.grid&&(this.grid.majorLineInterval=t<1?1:t>15?15:t)}get rotateWithMap(){return this.grid?.rotateWithMap??!1}set rotateWithMap(t){this.grid&&(this.grid.rotateWithMap=t)}get rotation(){return this.grid?.rotation??-180}set rotation(t){this.grid&&(this.grid.rotation=t)}get snappingEnabled(){return(this.grid&&this.snappingOptions?.gridEnabled)??!1}set snappingEnabled(t){const{snappingOptions:e}=this;e&&(e.gridEnabled=t)}get spacing(){return this.grid?.spacing??1}set spacing(t){this.grid&&t>0&&(this.grid.spacing=t)}get unit(){return this.grid?.units}set unit(t){this.grid&&(this.grid.units=t)}get gridOutOfScale(){return!this.dynamicScaling&&null!=this._pixelsPerStride&&this._pixelsPerStride<f}get effectiveSpacingAfterDynamicScaling(){return this.majorLineInterval<1||!this.dynamicScaling||!this.view||null==this._pixelsPerStride||!this.grid?.spacing?null:this.grid.spacing*S(this.majorLineInterval,this._pixelsPerStride,this.dynamicScaling)}get numericSpacingInputShouldBeVisible(){return!!this.view?.spatialReference&&b(this.view.spatialReference)}get _metersPerSRUnit(){if(!(this.view&&this.displayEnabled&&this.grid&&p(this.grid.center.spatialReference,this.view.spatialReference)))return null;const t=m(this.grid.center,this.view.spatialReference);return j(t)}get _pixelsPerStride(){if(!this.view?.scale||!this.displayEnabled||!this.grid||null==this._metersPerSRUnit)return null;const t=this.grid,{scale:e,spatialReference:i}=this.view;return l(t.spacing,t.units,"meters")/(this._metersPerSRUnit*g(e,i))}get _isPlacing(){if(!this._drawGraphicTool)return!1;const t=this.interactivePlacementState;return"place"===t||"interactive"===t&&0===this._sketchedVertexCount}get _isRotating(){if(!this._drawGraphicTool)return!1;const t=this.interactivePlacementState;return"rotate"===t||"interactive"===t&&1===this._sketchedVertexCount}get _isScaling(){if(!this._drawGraphicTool)return!1;return"interactive"===this.interactivePlacementState&&1===this._sketchedVertexCount}togglePlacementState(t){this.interactivePlacementState=this.interactivePlacementState===t?null:t}trySetDisplayEnabled(t){const{view:e}=this;if(e?.ready)if(!e.grid&&t)if(this._mostRecentlyShownGrid)e.grid=this._mostRecentlyShownGrid;else{const t="imperial"===this.defaultUnit?"feet":"meters";e.grid=new u({units:t,center:e.center??new d,rotateWithMap:!0}),U(this.grid,[115,115,115])}else t||(e.grid=null);else r.getLogger(this).warn("Attempting to enable grid display while view is not ready")}async startPlacement(t){const{view:e,snappingManager:i}=this;if(!e)return;this._set("interactivePlacementState",t),this._sketchedVertexCount=0;const r=new P({view:e,graphicProperties:{attributes:{[O]:O}},sketchOptions:{tooltips:{enabled:!0,visibleElements:{direction:!1,rotation:!1,totalLength:!1,elevation:!1,distance:!1,area:!1}}},geometryType:"polyline",mode:"click",snapToScene:!1,snappingManager:i,forceUniformSize:!0,centered:!1,cursor:"interactive"===this.interactivePlacementState||"place"===this.interactivePlacementState?"none":null,regularVerticesSymbol:void 0,activeVertexSymbol:W,activeLineSymbol:D,graphicSymbol:D,automaticAreaMeasurementUtils:await L(),automaticLengthMeasurementUtils:await I()});if(this._drawGraphicTool=r,e.addAndActivateTool(r),this._renderOverlays(),!this._keybindings){const t=new C;t.add(x.complete,(()=>this._onDrawComplete())),t.add(x.vertexAdd,(()=>this._drawGraphicTool?.drawOperation.commitStagedVertex())),this._keybindings=t}this.addHandles([r.on("cursor-update",(t=>this._onCursorUpdate(t))),r.on("complete",(()=>this._onDrawComplete())),r.on("vertex-add",(e=>this._onVertexAdd(e,t))),this._keybindings.register(e,T.WIDGET)],V)}async _startGridManipulation(t){const{view:e}=this;if(!e)return void(this.interactivePlacementState=null);const i=new CustomEvent("before-placement",{cancelable:!0});this.emit("before-placement",i),i.defaultPrevented||await this.startPlacement(t)}_onCursorUpdate(t){try{if(this._isPlacing){const e=t.vertices[0].coordinates;return void this._handlePlace(e)}if(this._drawGraphicTool.cursor=null,this._isRotating&&this._handleRotate(t.vertices[0].coordinates),this._isScaling){const t=this._drawGraphicTool?.drawOperation.cursorVertex;this._handleScale(t)}}finally{this._renderOverlays()}}_onDrawComplete(){this._drawGraphicTool.cursor=null,this.interactivePlacementState=null}_onVertexAdd(t,e){const i=t.vertices[0].coordinates;this._isPlacing&&this._handlePlace(i),this._isRotating&&this._sketchedVertexCount>0&&this._handleRotate(i),this._isScaling&&this._sketchedVertexCount>0&&this._handleScale(v(i[0],i[1],void 0,this.view.spatialReference)),this._sketchedVertexCount++,this._drawGraphicTool.cursor=null,2!==this._sketchedVertexCount&&"interactive"===e||(this.interactivePlacementState=null),this._renderOverlays()}_handlePlace(t){const{grid:e,view:i}=this;e&&i&&(e.center=new d({x:t[0],y:t[1],spatialReference:i.spatialReference}))}_handleRotate(t){const{grid:e,view:i}=this;if(!e||!i)return;this._drawGraphicTool?.sketchOptions.tooltips.set("enabled",!1);const{x:r,y:o}=e.center,[n,a]=t,l=i.toScreen(e.center,{pickClosestTarget:!0}),c=l&&i.toMap(l),h=i.toScreen(v(n,a,void 0,i.spatialReference),{pickClosestTarget:!0}),d=h&&i.toMap(h),p=c?c.x:r,m=c?c.y:o,g=p-(d?d.x:n),u=m-(d?d.y:a);if(0===g&&0===u)return;const y=Math.atan2(u,g),_=s(y),w=e.rotateWithMap,f=i.viewpoint.rotation??0,S=w?_:_-f;e.rotation=Math.fround(S)%360}_handleScale(t){const{view:e,grid:i,_drawGraphicTool:r,interactivePlacementState:s,_metersPerSRUnit:o}=this;if(!(t&&e&&i&&r&&o))return;r.sketchOptions.tooltips.enabled=!1;const n="interactive"===s?i.center:r.drawOperation.firstVertex;if(!n||!t)return;const a=e?.toScreen(n),c=a&&e.toMap(a),h=e?.toScreen(t),d=c??n,p=(h&&e.toMap(h))??t,m=Math.sqrt((d.x-p.x)**2+(d.y-p.y)**2),g=l(m*o,"meters",i.units);this.spacing=g}_renderOverlays(){this._renderCrosshairOverlay(),this._renderTextOverlay()}_renderTextOverlay(){const{grid:t,view:e,_drawGraphicTool:i}=this,r=this._getCrosshairLabel();if(!(t&&e?.overlay&&i&&r))return;const s=e.toScreen(t.center,{pickClosestTarget:!0});s&&(r.position=[s.x+12,s.y+12]),this._isRotating?(r.text=`${E(t.rotation)}${k}`,r.visible=!0):r.visible=!1}_renderCrosshairOverlay(){const{grid:t,view:e,_drawGraphicTool:i}=this;if(!t||!e?.overlay||!i)return;const r=this._getCrosshair();if(!r)return;const s=e.toScreen(t.center);s&&(r.x=s.x,r.y=s.y,r.rotation=t.rotateWithMap?e.viewpoint.rotation-t.rotation:-t.rotation,r.visible=!!i)}_getCrosshairLabel(){if(this._crosshairLabel)return this._crosshairLabel;const{grid:t,view:i,_drawGraphicTool:r}=this;if(!t||!i?.overlay||!r)return null;const s=new M({anchor:"top-left",fontSize:10,textColor:new e([21,21,21]),backgroundColor:new e([248,248,248]),padding:8,borderRadius:20});return i.overlay.addItem(s),this._crosshairLabel=s,s}_getCrosshair(){const{_crosshairItem:t,view:e}=this;return e?.overlay?t&&e.overlay.items.includes(t)?t:(this._crosshairItem=new R({color:e.effectiveTheme.accentColor,thickness:4,length:36,visible:!0}),e.overlay?.addItem(this._crosshairItem),this._crosshairItem):null}_resetGridPlacementState(){this.removeHandles(V),this._crosshairItem&&(this._crosshairItem.visible=!1),this._crosshairLabel&&(this._crosshairLabel.visible=!1),this._drawGraphicTool&&(this.view?.activeTool===this._drawGraphicTool&&(this.view.activeTool=null),this.view?.tools.remove(this._drawGraphicTool)),this._drawGraphicTool=o(this._drawGraphicTool)}};t([c(y)],A.prototype,"defaultUnit",void 0),t([c({readOnly:!0})],A.prototype,"displayEnabled",null),t([c()],A.prototype,"dynamicScaling",null),t([c()],A.prototype,"grid",null),t([c()],A.prototype,"gridColor",null),t([c({readOnly:!0})],A.prototype,"gridControlsEnabled",null),t([c()],A.prototype,"interactivePlacementState",null),t([c()],A.prototype,"majorLineInterval",null),t([c()],A.prototype,"rotateWithMap",null),t([c()],A.prototype,"rotation",null),t([c()],A.prototype,"snappingEnabled",null),t([c()],A.prototype,"snappingManager",void 0),t([c({type:G})],A.prototype,"snappingOptions",void 0),t([c()],A.prototype,"spacing",null),t([c()],A.prototype,"unit",null),t([c()],A.prototype,"view",void 0),t([c({readOnly:!0})],A.prototype,"gridOutOfScale",null),t([c({readOnly:!0})],A.prototype,"effectiveSpacingAfterDynamicScaling",null),t([c({readOnly:!0})],A.prototype,"numericSpacingInputShouldBeVisible",null),t([c()],A.prototype,"placementDisabled",void 0),t([c()],A.prototype,"_metersPerSRUnit",null),t([c()],A.prototype,"_pixelsPerStride",null),t([c()],A.prototype,"_isPlacing",null),t([c()],A.prototype,"_isRotating",null),t([c()],A.prototype,"_isScaling",null),t([c()],A.prototype,"_mostRecentlyShownGrid",void 0),t([c()],A.prototype,"_sketchedVertexCount",void 0),A=t([h("esri.widgets.support.GridControls.GridControlsViewModel")],A);const D=new _({width:0}),W=new w({color:e.fromArray([0,0,0,0]),outline:new _({color:e.fromArray([0,0,0,0])})});export{A 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
- function l(l,e){return!!(l.layer&&"globalIdField"in l.layer&&l.layer.globalIdField&&e.fromNetworkElement)&&l.attributes[l.layer.globalIdField]===e.fromNetworkElement.globalId}export{l as isFromElement};
5
+ function e(e,r){return!!(e.sourceLayer&&"globalIdField"in e.sourceLayer&&e.sourceLayer.globalIdField&&r.fromNetworkElement)&&e.attributes[e.sourceLayer.globalIdField]===r.fromNetworkElement.globalId}export{e as isFromElement};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5356,5613],{4513:(e,a,r)=>{r.d(a,{S:()=>t});const t={BingMapsLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(6424)]).then(r.bind(r,17029))).default,BuildingSceneLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(1214),r.e(9953),r.e(1956),r.e(4796),r.e(3029),r.e(4111),r.e(8506),r.e(3600),r.e(7937),r.e(2944),r.e(8947),r.e(8288),r.e(257),r.e(9875)]).then(r.bind(r,88303))).default,CSVLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(1214),r.e(9953),r.e(1956),r.e(4796),r.e(3029),r.e(4111),r.e(8506),r.e(3600),r.e(8446)]).then(r.bind(r,72256))).default,CatalogLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(1214),r.e(1956),r.e(4796),r.e(708),r.e(4111),r.e(8506),r.e(364),r.e(8628),r.e(2593),r.e(1419),r.e(9141)]).then(r.bind(r,79003))).default,DimensionLayer:async()=>(await Promise.all([r.e(6131),r.e(3813)]).then(r.bind(r,71493))).default,ElevationLayer:async()=>(await Promise.all([r.e(6131),r.e(9953),r.e(9186),r.e(5751)]).then(r.bind(r,68611))).default,FeatureLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(1214),r.e(9953),r.e(1956),r.e(4796),r.e(3029),r.e(4111),r.e(8506),r.e(3600),r.e(9867)]).then(r.bind(r,13600))).default,GeoJSONLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(1214),r.e(9953),r.e(1956),r.e(4796),r.e(3029),r.e(8551)]).then(r.bind(r,17625))).default,GeoRSSLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(3610)]).then(r.bind(r,63201))).default,GroupLayer:async()=>(await Promise.all([r.e(6131),r.e(3562),r.e(8256)]).then(r.bind(r,85989))).default,ImageryLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(9953),r.e(1956),r.e(364),r.e(1427),r.e(8542),r.e(4990)]).then(r.bind(r,58434))).default,ImageryTileLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(9953),r.e(1427),r.e(6049),r.e(8542),r.e(7677),r.e(5943)]).then(r.bind(r,35943))).default,IntegratedMesh3DTilesLayer:async()=>(await Promise.all([r.e(6131),r.e(9172),r.e(132)]).then(r.bind(r,61528))).default,IntegratedMeshLayer:async()=>(await Promise.all([r.e(6131),r.e(8947),r.e(9172),r.e(3642)]).then(r.bind(r,74660))).default,KMLLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(1214),r.e(8039)]).then(r.bind(r,79465))).default,KnowledgeGraphLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(1214),r.e(9953),r.e(1956),r.e(4796),r.e(3029),r.e(708),r.e(8368),r.e(4560),r.e(397),r.e(3202),r.e(217),r.e(8916),r.e(5655),r.e(2083),r.e(8692)]).then(r.bind(r,28692))).default,LineOfSightLayer:async()=>(await Promise.all([r.e(6131),r.e(7937),r.e(9405),r.e(9695)]).then(r.bind(r,49695))).default,LinkChartLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(1214),r.e(9953),r.e(1956),r.e(4796),r.e(3029),r.e(708),r.e(8368),r.e(4560),r.e(397),r.e(3202),r.e(217),r.e(8916),r.e(5655),r.e(2083),r.e(1728)]).then(r.bind(r,71728))).default,MapImageLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(1214),r.e(1956),r.e(4796),r.e(708),r.e(4111),r.e(364),r.e(5962),r.e(7656),r.e(2042)]).then(r.bind(r,7656))).default,MapNotesLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(1214),r.e(9953),r.e(1956),r.e(4796),r.e(3029),r.e(4111),r.e(8506),r.e(3600),r.e(5655),r.e(9945)]).then(r.bind(r,96953))).default,MediaLayer:async()=>(await Promise.all([r.e(7330),r.e(6131),r.e(2763)]).then(r.bind(r,19647))).default,OGCFeatureLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(1214),r.e(1956),r.e(4796),r.e(3029),r.e(708),r.e(257),r.e(9936),r.e(681)]).then(r.bind(r,87152))).default,OpenStreetMapLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(2029),r.e(349)]).then(r.bind(r,40349))).default,OrientedImageryLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(1214),r.e(9953),r.e(1956),r.e(4796),r.e(3029),r.e(4111),r.e(8506),r.e(3600),r.e(8373),r.e(5011)]).then(r.bind(r,97927))).default,PointCloudLayer:async()=>(await Promise.all([r.e(6131),r.e(8948),r.e(8947),r.e(7984),r.e(6528)]).then(r.bind(r,76742))).default,RouteLayer:async()=>(await Promise.all([r.e(6131),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(1214),r.e(217),r.e(4654)]).then(r.bind(r,64185))).default,SceneLayer:async()=>(await Promise.all([r.e(6131),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(1214),r.e(1956),r.e(4796),r.e(7937),r.e(2944),r.e(8947),r.e(8288),r.e(257),r.e(1737)]).then(r.bind(r,13899))).default,StreamLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(1214),r.e(1956),r.e(4796),r.e(3029),r.e(362)]).then(r.bind(r,60683))).default,SubtypeGroupLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(1956),r.e(4796),r.e(4111),r.e(8506),r.e(2765)]).then(r.bind(r,59929))).default,TileLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(1214),r.e(1956),r.e(4796),r.e(708),r.e(4111),r.e(364),r.e(9186),r.e(5962),r.e(573)]).then(r.bind(r,71756))).default,UnknownLayer:async()=>(await r.e(146).then(r.bind(r,146))).default,UnsupportedLayer:async()=>(await r.e(5165).then(r.bind(r,45165))).default,VectorTileLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(9186),r.e(9949),r.e(5897),r.e(4753)]).then(r.bind(r,48757))).default,VideoLayer:async()=>(await Promise.all([r.e(6131),r.e(3910),r.e(5715),r.e(5323),r.e(6830)]).then(r.bind(r,61269))).default,ViewshedLayer:async()=>(await Promise.all([r.e(6131),r.e(7937),r.e(9405),r.e(6650)]).then(r.bind(r,96650))).default,VoxelLayer:async()=>(await Promise.all([r.e(6131),r.e(8948),r.e(8947),r.e(1389)]).then(r.bind(r,16183))).default,WCSLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(9953),r.e(1427),r.e(6049),r.e(8542),r.e(7677),r.e(9547)]).then(r.bind(r,19547))).default,WFSLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5715),r.e(5323),r.e(13),r.e(1214),r.e(9953),r.e(1956),r.e(4796),r.e(3029),r.e(2144)]).then(r.bind(r,16350))).default,WMSLayer:async()=>(await Promise.all([r.e(7330),r.e(6131),r.e(8219),r.e(8948),r.e(3910),r.e(5323),r.e(3669)]).then(r.bind(r,51904))).default,WMTSLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(2029),r.e(309)]).then(r.bind(r,20309))).default,WebTileLayer:async()=>(await Promise.all([r.e(6131),r.e(8219),r.e(2029)]).then(r.bind(r,47314))).default}},8947:(e,a,r)=>{r.d(a,{L:()=>s});var t=r(60999),n=r(74887),i=r(67076);async function s(e,a,r){const s=e&&e.getAtOrigin&&e.getAtOrigin("renderer",a.origin);if(s&&"unique-value"===s.type&&s.styleOrigin){const l=await(0,t.Ke)(s.populateFromStyle());if((0,n.Te)(r),!1===l.ok){const r=l.error;a?.messages&&a.messages.push(new i.A("renderer:style-reference",`Failed to create unique value renderer from style reference: ${r.message}`,{error:r,context:a})),e.clear("renderer",a?.origin)}}}},10407:(e,a,r)=>{r.d(a,{It:()=>L,LG:()=>s,OM:()=>y,Sm:()=>o,Y:()=>l,bK:()=>c,mm:()=>d,sQ:()=>u});var t=r(98988),n=r(16930),i=r(28735);function s(e,a){if(!l(e,a)){const r=e.typeKeywords;r?r.push(a):e.typeKeywords=[a]}}function l(e,a){return!!e.typeKeywords?.includes(a)}function c(e){return l(e,d.HOSTED_SERVICE)}function y(e,a){const r=e.typeKeywords;if(r){const e=r.indexOf(a);e>-1&&r.splice(e,1)}}function o(e,a,r){r?s(e,a):y(e,a)}async function u(e){const a=e.clone().normalize();let r;if(a.length>1)for(const e of a)r?e.width>r.width&&(r=e):r=e;else r=a[0];return async function(e){const a=e.spatialReference;if(a.isWGS84)return e.clone();if(a.isWebMercator)return(0,i.ci)(e);const r=n.A.WGS84;return await(0,t.initializeProjection)(a,r),(0,t.project)(e,r)}(r)}const d={CHARTS:"Charts",DYNAMIC:"Dynamic",DEVELOPER_BASEMAP:"DeveloperBasemap",GROUP_LAYER_MAP:"Map",HOSTED_SERVICE:"Hosted Service",JSAPI:"ArcGIS API for JavaScript",LOCAL_SCENE:"ViewingMode-Local",METADATA:"Metadata",MULTI_LAYER:"Multilayer",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer",SINGLE_LAYER:"Singlelayer",SUBTYPE_GROUP_LAYER:"SubtypeGroupLayer",SUBTYPE_GROUP_TABLE:"SubtypeGroupTable",TABLE:"Table",TILED_IMAGERY:"Tiled Imagery"};function L(e){const{portal:a,isOrgItem:r,itemControl:t}=e,n=a.user?.privileges;let i=!n||n.includes("features:user:edit"),s=!!r&&!!n?.includes("features:user:fullEdit");const l="update"===t||"admin"===t;return l?s=i=!0:s&&(i=!0),{features:{edit:i,fullEdit:s},content:{updateItem:l}}}},22429:(e,a,r)=>{r.d(a,{v:()=>n});var t=r(24183);class n{constructor(){this._serviceMetadatas=new Map,this._itemDatas=new Map}async fetchServiceMetadata(e,a){const r=this._serviceMetadatas.get(e);if(r)return r;const n=await(0,t.V)(e,a);return this._serviceMetadatas.set(e,n),n}async fetchItemData(e){const{id:a}=e;if(!a)return null;const{_itemDatas:r}=this;if(r.has(a))return r.get(a);const t=await e.fetchData();return r.set(a,t),t}async fetchCustomParameters(e,a){const r=await this.fetchItemData(e);return r&&"object"==typeof r&&(a?a(r):r.customParameters)||null}}},23154:(e,a,r)=>{r.d(a,{K:()=>d,Q:()=>i});var t=r(24183);const n=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer"]);async function i(e,a){const{loadContext:r,...n}=a||{},i=r?await r.fetchServiceMetadata(e,n):await(0,t.V)(e,n);u(i),c(i);const s={serviceJSON:i};if((i.currentVersion??0)<10.5)return s;const l=`${e}/layers`,y=r?await r.fetchServiceMetadata(l,n):await(0,t.V)(l,n);return u(y),c(y),s.layersJSON={layers:y.layers,tables:y.tables},s}function s(e){const{type:a}=e;return!!a&&n.has(a)}function l(e){return"Table"===e.type}function c(e){e.layers=e.layers?.filter(s),e.tables=e.tables?.filter(l)}function y(e){e.type||="Feature Layer"}function o(e){e.type||="Table"}function u(e){e.layers?.forEach(y),e.tables?.forEach(o)}function d(e){switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer"}return"FeatureLayer"}},24183:(e,a,r)=>{r.d(a,{V:()=>n});var t=r(78888);async function n(e,a){const{data:r}=await(0,t.A)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return r}},45613:(e,a,r)=>{r.d(a,{fromItem:()=>d,n:()=>L});var t=r(49186),n=r(92009),i=r(23154),s=r(22429),l=r(77548),c=r(4513),y=r(80812),o=r(66964),u=r(10407);async function d(e){let{portalItem:a}=e;!a||a instanceof y.default||(a=new y.default(a));const r=await async function(e){await e.load();const a=new s.v;return async function(e){const a=e.className,r=c.S[a];return{constructor:await r(),properties:e.properties}}(await L(e,a))}(a);return new(0,r.constructor)({portalItem:a,...r.properties})}async function L(e,a){switch(e.type){case"3DTiles Service":return e.typeKeywords.includes("3DObject")?{className:"UnsupportedLayer"}:{className:"IntegratedMesh3DTilesLayer"};case"CSV":return{className:"CSVLayer"};case"Feature Collection":return async function(e){await e.load();const a=(0,u.Y)(e,"Map Notes"),r=(0,u.Y)(e,"Markup");if(a||r)return{className:"MapNotesLayer"};if((0,u.Y)(e,"Route Layer"))return{className:"RouteLayer"};const t=await e.fetchData();return 1===(0,o.XH)(t)?{className:"FeatureLayer"}:{className:"GroupLayer"}}(e);case"Feature Service":return async function(e,a){const r=await f(e,a);if("object"==typeof r){const{sourceJSON:e,className:a}=r,t={sourceJSON:e};return null!=r.id&&(t.layerId=r.id),{className:a||"FeatureLayer",properties:t}}return{className:"GroupLayer"}}(e,a);case"Feed":case"Stream Service":return{className:"StreamLayer"};case"GeoJson":return{className:"GeoJSONLayer"};case"Group Layer":return{className:"GroupLayer"};case"Image Service":return async function(e,a){await e.load();const r=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(r.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(r.includes("tiled imagery"))return{className:"ImageryTileLayer"};const t=await a.fetchItemData(e),n=t?.layerType;if("ArcGISTiledImageServiceLayer"===n)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===n)return{className:"ImageryLayer"};const i=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)}),s=i.cacheType?.toLowerCase(),l=i.capabilities?.toLowerCase().includes("tilesonly"),c=i.tileInfo?.format?.toLowerCase()??"",y=null==s&&["jpg","jpeg","png","png8","png24","png32","mixed"].includes(c);return"map"===s||y||l?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}(e,a);case"KML":return{className:"KMLLayer"};case"Knowledge Graph Layer":return{className:"KnowledgeGraphLayer"};case"Map Service":return async function(e,a){return await async function(e,a){const{tileInfo:r}=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)});return r}(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}(e,a);case"Media Layer":return{className:"MediaLayer"};case"Scene Service":return async function(e,a){const r=await f(e,a,(async()=>{try{if(!e.url)return[];const{serverUrl:r}=await(0,n.L)(e.url,{sceneLayerItem:e}),t=await a.fetchServiceMetadata(r);return t?.tables??[]}catch{return[]}}));if("object"==typeof r){const t={};let n;if(null!=r.id?(t.layerId=r.id,n=`${e.url}/layers/${r.id}`):n=e.url,e.typeKeywords?.length)for(const a of Object.keys(l.XX))if(e.typeKeywords.includes(a))return{className:l.XX[a]};const i=await a.fetchServiceMetadata(n,{customParameters:await a.fetchCustomParameters(e,(e=>(0,o.pJ)(e)?.customParameters))});return{className:l.XX[i?.layerType]||"SceneLayer",properties:t}}if(!1===r){const r=await a.fetchServiceMetadata(e.url);if("Voxel"===r?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}(e,a);case"Video Service":return async function(e,a){return"object"==typeof await f(e,a)?{className:"VideoLayer"}:{className:"GroupLayer"}}(e,a);case"Vector Tile Service":return{className:"VectorTileLayer"};case"WCS":return{className:"WCSLayer"};case"WFS":return{className:"WFSLayer"};case"WMS":return{className:"WMSLayer"};case"WMTS":return{className:"WMTSLayer"};default:throw new t.A("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function f(e,a,r){const{url:t,type:n}=e,s="Feature Service"===n;if(!t)return{};if(/\/\d+$/.test(t)){if(s){const r=await a.fetchServiceMetadata(t,{customParameters:await a.fetchCustomParameters(e,(e=>(0,o.pJ)(e)?.customParameters))});return{id:r.id,className:(0,i.K)(r.type),sourceJSON:r}}return{}}if("Video Service"===n){const e=await a.fetchServiceMetadata(t);return!((e.layers?.length??0)>1)&&{}}await e.load();let l=await a.fetchItemData(e);if(s){const e=await(0,o.bO)(l,t,a),r=m(e);if("object"==typeof r){const a=(0,o.rc)(e,r.id);r.className=(0,o.K8)(a?.layerType)}return r}if("Scene Service"===n&&(l=await(0,o.nu)(e,l,a)),(0,o.XH)(l)>0)return m(l);const c=await a.fetchServiceMetadata(t);return r&&(c.tables=await r()),m(c)}function m(e){return 1===(0,o.XH)(e)&&{id:(0,o.pJ)(e)?.id}}},66964:(e,a,r)=>{r.d(a,{Ju:()=>y,K8:()=>d,XH:()=>o,_r:()=>i,bO:()=>s,l:()=>u,nu:()=>L,pJ:()=>l,rc:()=>c});var t=r(92009),n=r(23154);function i(e){const a={id:e.id,name:e.name},r=(0,n.K)(e.type);return"FeatureLayer"!==r&&(a.layerType=r),a}async function s(e,a,r){if(null==e?.layers||null==e?.tables){const t=await r.fetchServiceMetadata(a,{customParameters:l(e)?.customParameters});(e=e||{}).layers=e.layers||t?.layers?.map(i),e.tables=e.tables||t?.tables?.map(i)}return e}function l(e){if(!e)return null;const{layers:a,tables:r}=e;return a?.length?a[0]:r?.length?r[0]:null}function c(e,a){return null==a?null:[...e.layers||[],...e.tables||[]].find((e=>e.id===a))}function y(e,a){return[...e.layers||[],...e.tables||[]].filter((({layerType:e})=>e?a.includes(e):a.includes("ArcGISFeatureLayer")))}function o(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function u(e){switch(e){case"catalog":return["CatalogLayer"];case"feature":return["ArcGISFeatureLayer"];case"oriented-imagery":return["OrientedImageryLayer"];case"subtype-group":return["SubtypeGroupLayer","SubtypeGroupTable"]}return null}function d(e){switch(e){case"CatalogLayer":return"CatalogLayer";case"OrientedImageryLayer":return"OrientedImageryLayer";case"SubtypeGroupLayer":case"SubtypeGroupTable":return"SubtypeGroupLayer"}return"FeatureLayer"}async function L(e,a,r){if(!e?.url)return a??{};if(a??={},!a.layers){const t=await r.fetchServiceMetadata(e.url);a.layers=t.layers?.map(i)}const{serverUrl:n,portalItem:s}=await(0,t.L)(e.url,{sceneLayerItem:e,customParameters:l(a)?.customParameters}).catch((()=>({serverUrl:null,portalItem:null})));if(null==n)return a.tables=[],a;if(!a.tables&&s){const e=await s.fetchData().catch((()=>null));if(e?.tables)a.tables=e.tables.map(i);else{const t=await r.fetchServiceMetadata(n,{customParameters:l(e)?.customParameters}).catch((()=>null));a.tables=t?.tables?.map(i)}}if(a.tables)for(const e of a.tables)e.url=`${n}/${e.id}`;return a}},75356:(e,a,r)=>{r.d(a,{N:()=>M,populateOperationalLayers:()=>o});var t=r(5503),n=(r(44208),r(22429)),i=r(4513),s=r(80812);function l(e,a){return!(!e.layerType||"ArcGISFeatureLayer"!==e.layerType)&&e.featureCollectionType===a}var c=r(45613),y=r(8947);async function o(e,a,r){if(!a)return;const t=a.map((e=>async function(e,a){return async function(e,a,r){const t=new e;return t.read(a,r.context),"group"===t.type&&("GroupLayer"===a.layerType?await M(t,a,r):v(a)?function(e,a,r){a.itemId&&(e.portalItem=new s.default({id:a.itemId,portal:r?.portal}),e.when((()=>{const t=t=>{const n=t.layerId;G(t,e,a,n,r);const i=a.featureCollection?.layers?.[n];i&&t.read(i,r)};e.layers?.forEach(t),e.tables?.forEach(t)})))}(t,a,r.context):b(a)&&await async function(e,a,r){const t=i.S.FeatureLayer,n=await t(),s=a.featureCollection,l=s?.showLegend,c=s?.layers?.map(((t,i)=>{const s=new n;s.read(t,r);const c={...r,ignoreDefaults:!0};return G(s,e,a,i,c),null!=l&&s.read({showLegend:l},c),s}));e.layers.addMany(c??[])}(t,a,r.context)),await(0,y.L)(t,r.context),t}(await I(e,a),e,a)}(e,r))),n=await Promise.allSettled(t);for(const a of n)"rejected"===a.status||a.value&&e.add(a.value)}const u={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BuildingSceneLayer:"BuildingSceneLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",Object3DTilesLayer:"UnsupportedLayer",IntegratedMeshLayer:"IntegratedMeshLayer",KML:"KMLLayer",LineOfSightLayer:"LineOfSightLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",PointCloudLayer:"PointCloudLayer",RasterDataLayer:"UnsupportedLayer",VectorTileLayer:"VectorTileLayer",ViewshedLayer:"ViewshedLayer",Voxel:"VoxelLayer",WCS:"WCSLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},d={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},L={ArcGISFeatureLayer:"FeatureLayer"},f={ArcGISImageServiceLayer:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"UnsupportedLayer",WMS:"UnsupportedLayer",WebTiledLayer:"WebTileLayer"},m={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",ArcGISVideoLayer:"VideoLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GeoRSS:"GeoRSSLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"KnowledgeGraphLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},p={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"SubtypeGroupLayer"},S={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},w={...m,LinkChartLayer:"LinkChartLayer"},h={...p},g={...S};async function I(e,a){const r=a.context,t=T(r);let y=e.layerType||e.type;!y&&a?.defaultLayerType&&(y=a.defaultLayerType);const o=t[y];let u=o?i.S[o]:i.S.UnknownLayer;if(v(e)){const a=r?.portal;if(e.itemId){const r=new s.default({id:e.itemId,portal:a});await r.load();const t=(await(0,c.n)(r,new n.v)).className||"UnknownLayer";u=i.S[t]}}else"ArcGISFeatureLayer"===y?function(e){return l(e,"notes")}(e)||function(e){return l(e,"markup")}(e)?u=i.S.MapNotesLayer:function(e){return l(e,"route")}(e)?u=i.S.RouteLayer:b(e)&&(u=i.S.GroupLayer):e.wmtsInfo?.url&&e.wmtsInfo.layerIdentifier?u=i.S.WMTSLayer:"WFS"===y&&"2.0.0"!==e.wfsInfo?.version&&(u=i.S.UnsupportedLayer);return u()}function b(e){return"ArcGISFeatureLayer"===e.layerType&&!v(e)&&(e.featureCollection?.layers?.length??0)>1}function v(e){return"Feature Collection"===e.type}function T(e){let a;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":a=f;break;case"ground":a=d;break;case"tables":a=L;break;default:a=u}break;case"link-chart":switch(e.layerContainerType){case"basemap":a=g;break;case"tables":a=h;break;default:a=w}break;default:switch(e.layerContainerType){case"basemap":a=S;break;case"tables":a=p;break;default:a=m}}return a}async function M(e,a,r){const n=new t.A,i=o(n,Array.isArray(a.layers)?a.layers:[],r);try{try{if(await i,"group"===e.type)return e.layers.addMany(n),e}catch(a){e.destroy();for(const e of n)e.destroy();throw a}}catch(e){throw e}}function G(e,a,r,t,n){e.read({id:`${a.id}-sublayer-${t}`,visibility:r.visibleLayers?.includes(t)??!0},n)}},92009:(e,a,r)=>{r.d(a,{L:()=>o});var t=r(70333),n=r(78888),i=r(49186),s=r(74887),l=r(60694),c=r(20655),y=r(80812);async function o(e,a){const r=(0,l.qg)(e);if(!r)throw new i.A("invalid-url","Invalid scene service url");const o={...a,sceneServerUrl:r.url.path,layerId:r.sublayer??void 0};if(o.sceneLayerItem??=await async function(e){const a=(await u(e)).serviceItemId;if(!a)return null;const r=new y.default({id:a,apiKey:e.apiKey}),i=await async function(e){const a=t.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const r=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,n.A)(r,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,s.QP)(e)}return null}(e);null!=i&&(r.portal=new c.A({url:i}));try{return await r.load({signal:e.signal})}catch(e){return(0,s.QP)(e),null}}(o),null==o.sceneLayerItem)return d(o.sceneServerUrl.replace("/SceneServer","/FeatureServer"),o);const L=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const r=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find((e=>"Feature Service"===e.type))||null;if(!r)return null;const t=new y.default({portal:r.portal,id:r.id});return await t.load(),t}catch(e){return(0,s.QP)(e),null}}(o);if(!L?.url)throw new i.A("related-service-not-found","Could not find feature service through portal item relationship");o.featureServiceItem=L;const f=await d(L.url,o);return f.portalItem=L,f}async function u(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const r=await(0,n.A)(e.sceneServerUrl,a);e.rootDocument=r.data}catch{e.rootDocument={}}return e.rootDocument}async function d(e,a){const r=(0,l.qg)(e);if(!r)throw new i.A("invalid-feature-service-url","Invalid feature service url");const t=r.url.path,s=a.layerId;if(null==s)return{serverUrl:t};const c=u(a),y=a.featureServiceItem?await a.featureServiceItem.fetchData("json"):null,o=(y?.layers?.[0]||y?.tables?.[0])?.customParameters,d=e=>{const r={query:{f:"json",...o},responseType:"json",authMode:e,signal:a.signal};return(0,n.A)(t,r)},L=d("anonymous").catch((()=>d("no-prompt"))),[f,m]=await Promise.all([L,c]),p=m?.layers,S=f.data&&f.data.layers;if(!Array.isArray(S))throw new Error("expected layers array");if(Array.isArray(p)){for(let e=0;e<Math.min(p.length,S.length);e++)if(p[e].id===s)return{serverUrl:t,layerId:S[e].id}}else if(null!=s&&s<S.length)return{serverUrl:t,layerId:S[s].id};throw new Error("could not find matching associated sublayer")}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7883],{27883:(e,t,n)=>{n.d(t,{resolveWebStyleSymbol:()=>b});var o=n(61473),r=n(49186),l=n(84952),s=n(20655),a=n(97159),i=n(73838),c=n(98751),u=n(85594),y=n(57212),m=n(33910);const f=["web-gltf","web","cim"];function b(e,t,n){const o=e.name;return null==o?Promise.reject(new r.A("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference")):"Esri2DPointSymbolsStyle"===e.styleName?function(e,t,n){const o=u.jg.replaceAll(/\{SymbolName\}/gi,e),r=null!=t.portal?t.portal:s.A.getDefault();return(0,u.yA)(o,n).then((e=>{const t=(0,u.bo)(e.data);return(0,i.rS)(t,{portal:r,url:(0,l.An)((0,l.nM)(o)),origin:"portal-item"})}))}(o,t,n):(0,u.cF)(e,t,n).then((e=>p(e,o,t,u.o5,n)))}async function p(e,t,n,b,p){const d=null!=n?.portal?n.portal:s.A.getDefault(),g={portal:d,url:(0,l.An)(e.baseUrl)},S=function(e,t){return t.items.find((t=>t.name===e))}(t,e.data);if(!S)throw new r.A("symbolstyleutils:symbol-name-not-found",`The symbol name '${t}' could not be found`,{symbolName:t});const w=p?.acceptedFormats??f,A=b(S,w);if(!A)throw new r.A("symbolstyleutils:symbol-reference-no-accepted-format",`The symbol name '${t}' does not have an accepted format (one of ${w})`,{symbolName:t});const{url:h,format:C}=A;let M=(0,a.f)(h,g),k=S.thumbnail?.href??null;const v=S.thumbnail?.imageData;(0,o.b5)()&&(M=(0,o.EM)(M)??"",k=(0,o.EM)(k));const L={portal:d,url:(0,l.An)((0,l.nM)(M)),origin:"portal-item"};return(0,u.yA)(M,p).then((o=>{const r="cim"===C?(0,u.bo)(o.data):o.data,l=(0,i.rS)(r,L);if(l&&(0,m.wk)(l)){if(k){const e=(0,a.f)(k,g);l.thumbnail=new y.V({url:e})}else v&&(l.thumbnail=new y.V({url:`data:image/png;base64,${v}`}));e.styleUrl?l.styleOrigin=new c.A({portal:n.portal,styleUrl:e.styleUrl,name:t}):e.styleName&&(l.styleOrigin=new c.A({portal:n.portal,styleName:e.styleName,name:t}))}return l}))}},59868:(e,t,n)=>{n.d(t,{A7:()=>c,Cx:()=>u,Hk:()=>y,UK:()=>i}),n(44208);var o=n(94985),r=n(31593),l=n(53930),s=n(68249),a=n(93470);const i=l.A.fromJSON(a.Cb),c=r.A.fromJSON(a.yM),u=o.A.fromJSON(a.WR),y=s.A.fromJSON(a.JZ);l.A.fromJSON(a.nC),r.A.fromJSON(a.HW),o.A.fromJSON(a.b6)},61473:(e,t,n)=>{function o(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function r(e,t){return e?(t=t||globalThis.location.hostname)?null!=t.match(l)||null!=t.match(a)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(s)||null!=t.match(i)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e:null}n.d(t,{EM:()=>r,b5:()=>o});const l=/^devext\.arcgis\.com$/,s=/^qaext\.arcgis\.com$/,a=/^[\w-]*\.mapsdevext\.arcgis\.com$/,i=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,l,s,/^jsapps\.esri\.com$/,a,i]},73838:(e,t,n)=>{n.d(t,{rS:()=>T,M9:()=>U,oO:()=>$});var o=n(49186),r=n(77548),l=n(37757),s=n(13313),a=n(97887),i=n(68548),c=n(58592),u=n(75981),y=n(65365),m=n(94985),f=n(31593),b=n(53930),p=n(68249),d=n(68197),g=n(5503),S=(n(44208),n(90629)),w=n(27845),A=n(11506),h=n(39065),C=n(59868),M=n(93470);u.A.fromSimpleMarkerSymbol(C.UK),a.A.fromSimpleLineSymbol(C.A7),y.A.fromSimpleFillSymbol(C.Cx),new i.A({symbolLayers:new g.A([new w.A({material:{color:M.fT},edges:new h.A({size:(0,S.PN)(1),color:new d.A(M.JR)})})])});const k=new a.A({symbolLayers:new g.A([new A.A({material:{color:new d.A([0,0,0])},size:(0,S.PN)(1)})])}),v=new y.A({symbolLayers:new g.A([new w.A({outline:{color:new d.A([0,0,0]),size:(0,S.PN)(1)}})])});var L=n(33910);const I="#useCIMFallbackSymbology()",N={retainId:!1,ignoreDrivers:!1,hasLabelingContext:!0};function U(e,t,n,o){const r=D(e,{},{context:o,isLabelSymbol:!1});null!=r&&(t[n]=r)}function $(e,t,n,o){const r=D(e,{},{context:o,isLabelSymbol:!0});null!=r&&(t[n]=r)}function x(e){return(0,L.wk)(e)||e instanceof l.A}function D(e,t,n){if(null==e)return null;const{context:d,isLabelSymbol:g}=n,S=d?.origin,w=d?.messages;if("web-scene"===S&&!x(e)){const n=function(e,t=N){if(!e)return{symbol:null};const{retainId:n=N.retainId,ignoreDrivers:r=N.ignoreDrivers,hasLabelingContext:d=N.hasLabelingContext,retainCIM:g=N.retainCIM,cimFallbackEnabled:S=N.cimFallbackEnabled}=t;let w=null;if((0,L.wk)(e)||e instanceof l.A)w=e.clone();else if("cim"===e.type){const n=e.data?.symbol?.type;switch(n){case"CIMPointSymbol":w=g?e.clone():u.A.fromCIMSymbol(e);break;case"CIMLineSymbol":S&&(w=k.clone(),t?.logWarning?.(I,"Unsupported CIM line symbology converted to fallback 3D line symbology"));break;case"CIMPolygonSymbol":S&&(w=v.clone(),t?.logWarning?.(I,"Unsupported CIM polygon symbology converted to fallback 3D polygon symbology"))}if(!w)return{error:new o.A("symbol-conversion:unsupported-cim-symbol",`CIM symbol of type '${n||"unknown"}' is unsupported in 3D`,{symbol:e})}}else if(e instanceof f.A)w=a.A.fromSimpleLineSymbol(e);else if(e instanceof b.A)w=u.A.fromSimpleMarkerSymbol(e);else if(e instanceof c.A)w=u.A.fromPictureMarkerSymbol(e);else if(e instanceof m.A)w=t.geometryType&&"mesh"===t.geometryType?i.A.fromSimpleFillSymbol(e):y.A.fromSimpleFillSymbol(e);else{if(!(e instanceof p.A))return{error:new o.A("symbol-conversion:unsupported-2d-symbol",`2D symbol of type '${e.type||e.declaredClass}' is unsupported in 3D`,{symbol:e})};w=d?s.A.fromTextSymbol(e):u.A.fromTextSymbol(e)}return n&&w&&"cim"!==w.type&&(w.id=e.id),!r||"cim"===w.type||w instanceof l.A||w.symbolLayers.forEach((e=>e.ignoreDrivers=!0)),{symbol:w}}(e,{retainCIM:!0,hasLabelingContext:g});return null!=n.symbol?n.symbol.write(t,d):(w?.push(new o.A("symbol:unsupported",`Symbols of type '${e.declaredClass}' are not supported in scenes. Use 3D symbology instead when working with WebScene and SceneView`,{symbol:e,context:d,error:n.error})),null)}return(0,r.TU)(d?.layer)&&(A=e,"polygon-3d"===A?.type||"line-3d"===A?.type)?(w?.push(new o.A("symbol:unsupported",`Symbols of type '${e.declaredClass}' are not supported on layers of type '${d?.layer?.declaredClass}'.`,{symbol:e,context:d})),null):("web-map"===S||"portal-item"===S&&!(0,r.TU)(d?.layer))&&x(e)?(w?.push(new o.A("symbol:unsupported",`Symbols of type '${e.declaredClass}' are not supported in web maps and portal items. Use 2D symbology and CIMSymbol instead when working with MapView`,{symbol:e,context:d})),null):e.write(t,d);var A}function T(e,t){return(0,L.Bu)(e,null,t)}},77548:(e,t,n)=>{n.d(t,{tk:()=>y,BR:()=>u,wI:()=>c,Ov:()=>a,W_:()=>i,TU:()=>s,XX:()=>l});var o=n(70333),r=n(78888);n(5503),n(36563),n(36708),new WeakMap;const l={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function s(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function a(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function i(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}async function c(e,t){const n=o.id?.findServerInfo(e);if(null!=n?.currentVersion)return n.owningSystemUrl||null;const l=e.toLowerCase().indexOf("/rest/services");if(-1===l)return null;const s=`${e.slice(0,l)}/rest/info`,a=null!=t?t.signal:null,{data:i}=await(0,r.A)(s,{query:{f:"json"},responseType:"json",signal:a});return i?.owningSystemUrl||null}function u(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function y(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}},85594:(e,t,n)=>{n.d(t,{jg:()=>S,cF:()=>y,bo:()=>m,yA:()=>p,o5:()=>f});var o=n(78888),r=n(49186),l=n(44208),s=n(74887),a=n(84952),i=n(20655),c=n(16405);const u=new Map;function y(e,t,n){return null!=e?.styleUrl?async function(e,t){try{return{data:(await p(e,t)).data,baseUrl:(0,a.nM)(e),styleUrl:e}}catch(e){return(0,s.QP)(e),null}}(e.styleUrl,n):null!=e?.styleName?function(e,t,n){const o=null!=t.portal?t.portal:i.A.getDefault();let l;const s=`${o.url} - ${o.user?.username} - ${e}`,a=u.get(s);if(a)return a;const y=function(e,t,n){return t.load(n).then((()=>{const o=new c.A({disableExtraQuery:!0,query:`owner:${d} AND type:${g} AND typekeywords:"${e}"`});return t.queryItems(o,n)})).then((({results:t})=>{let o=null;const l=e.toLowerCase();if(t&&Array.isArray(t))for(const e of t){const t=e.typeKeywords?.some((e=>e.toLowerCase()===l));if(t&&e.type===g&&e.owner===d){o=e;break}}if(!o)throw new r.A("symbolstyleutils:style-not-found",`The style '${e}' could not be found`,{styleName:e});return o.load(n)}))}(e,o,n).then((e=>(l=e,e.fetchData()))).then((t=>({data:t,baseUrl:l.itemUrl??"",styleName:e})));return u.set(s,y),y}(e.styleName,t,n):Promise.reject(new r.A("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function m(e){return null===e||"CIMSymbolReference"===e.type?e:{type:"CIMSymbolReference",symbol:e}}function f(e,t){for(const n of t)switch(n){case"cim":if(e.cimRef)return{format:n,url:encodeURI(e.cimRef)};break;case"web-gltf-basisu":{const t=b(e,"gltf_basisu");if(t)return{format:n,url:t};break}case"web-gltf":{const t=b(e,"gltf");if(t)return{format:n,url:t};break}case"web":{const t=b(e,"gltf");if(t)return{format:"web-gltf",url:t};if(e.webRef)return{format:n,url:encodeURI(e.webRef)};break}}}function b(e,t){if(!(0,l.A)("enable-feature:force-wosr"))return e.formatInfos?.find((e=>e.type===t))?.href}function p(e,t){const n={responseType:"json",query:{f:"json"},...t};return(0,o.A)((0,a.S8)(e),n)}const d="esri_en",g="Style",S="https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json"},93470:(e,t,n)=>{n.d(t,{Cb:()=>l,HW:()=>u,JR:()=>r,JZ:()=>i,WR:()=>a,b6:()=>y,fT:()=>o,nC:()=>c,yM:()=>s});const o=[252,146,31,255],r=[153,153,153,255],l={type:"esriSMS",style:"esriSMSCircle",size:6,color:o,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},s={type:"esriSLS",style:"esriSLSSolid",width:.75,color:o},a={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},i={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},c={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},u={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},y={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);