@arcgis/core 5.1.0-next.104 → 5.1.0-next.105

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 (147) hide show
  1. package/analysis/ShadowCastAnalysis.d.ts +81 -62
  2. package/assets/esri/core/t9n/Units.json +1 -1
  3. package/assets/esri/core/t9n/Units_en.json +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/{f5bd0a4f82df5e942b70.js → 093f27e4e4781870b431.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{8e986167d4a393ee41ea.js → 130851b81f04e6a008cd.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{1cb0c4fc315bbc2bd00b.js → 1c8a21b7b60c0709e6b2.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{ce0c7070eeb723a718e7.js → 1e8d5bfc5f8c2664190c.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{7d571845292b1b7769c2.js → 2dced41ff2aa1bd86665.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{bff0c4094c14cb97b18f.js → 359dbfbfb9acfb18bc6e.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{9542ef3f6c2bc7c14d85.js → 39a8e6c9d710d3faea3c.js} +1 -1
  12. package/assets/esri/core/workers/chunks/466c250537415f12eb59.js +1 -0
  13. package/assets/esri/core/workers/chunks/{0cb8bc6dbbbe3b212712.js → 558606a1af22e4a0d536.js} +1 -1
  14. package/assets/esri/core/workers/chunks/6854b28853f5dd195110.js +262 -0
  15. package/assets/esri/core/workers/chunks/{b63cbf6c2c9ec1b02b9a.js → 6e21675bbd7a44070771.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{bb04aff0b4947408592c.js → 7617bd0f3a70dfe61637.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{cf3c0bee919bb509cd4f.js → 7b66691d133dabd87ce6.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{bf2c202dec5ab7bc770b.js → 829a0583b8a228c65379.js} +1 -1
  19. package/assets/esri/core/workers/chunks/8a1751187a20b6578875.js +1 -0
  20. package/assets/esri/core/workers/chunks/{d610f517fb3c6cb24365.js → 8ade869fa9bae446266a.js} +1 -1
  21. package/assets/esri/core/workers/chunks/9b89cc85c1b5d561df7c.js +2 -0
  22. package/assets/esri/core/workers/chunks/{2a5f6a8d282f2c391591.js → a0e72b107991ba38a9f0.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{f3a9100518b044e79501.js → a943bd2e6fb7443c2b66.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{037b36d415ae27e987f9.js → aec4a4cd7044fdbbbe34.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{29b00d07d3e1d095c590.js → b262478da29470abb72b.js} +2 -2
  26. package/assets/esri/core/workers/chunks/b7a81fd4994eabba1869.js +640 -0
  27. package/assets/esri/core/workers/chunks/{3c9482764c9e4f8bcbb0.js → c187bc997bad61b6c6e9.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{1c83e61fd9a4f8fc8372.js → d3f08f1a9a250cd8a2c8.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{c476f4979048e558baa7.js → e90afd914f2ccd4f5374.js} +57 -75
  30. package/assets/esri/core/workers/chunks/{5cffc7b49966201eccdb.js → f75295cdd5e84eb97d5a.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{95798e3de3419fdda6ac.js → fb415b01f0f1d644832d.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{64e268ebac0b62076f81.js → fbb23db01f3cf629d32e.js} +1 -1
  33. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
  34. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  35. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  36. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  37. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  38. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  39. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  40. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  41. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  42. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
  43. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  44. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  45. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  46. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  47. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  48. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  49. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  50. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  51. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  52. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  53. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  54. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  55. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  56. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  57. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  58. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  59. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  60. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  61. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  62. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  63. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  64. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  65. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  66. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  67. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  68. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  69. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  70. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  71. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  72. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  73. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  74. package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
  75. package/chunks/ChapmanAtmosphere.glsl.js +14 -19
  76. package/chunks/Compositing.glsl.js +4 -4
  77. package/chunks/GaussianSplatShadow.glsl.js +7 -7
  78. package/chunks/GlobalIllumination.glsl.js +27 -50
  79. package/chunks/GlobalIlluminationBlur.glsl.js +16 -11
  80. package/chunks/Terrain.glsl.js +1 -1
  81. package/config.js +1 -1
  82. package/core/ReactiveSet.js +1 -1
  83. package/kernel.js +1 -1
  84. package/layers/VideoLayer.js +1 -1
  85. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  86. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +1 -1
  87. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  88. package/layers/knowledgeGraph/layerUtils.js +1 -1
  89. package/layers/orientedImagery/core/utils.js +1 -1
  90. package/package.json +2 -2
  91. package/support/revision.js +1 -1
  92. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  93. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  94. package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +9 -5
  95. package/views/3d/layers/FlowSubView3D.js +1 -1
  96. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  97. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  98. package/views/3d/terrain/TerrainRenderer.js +1 -1
  99. package/views/3d/terrain/TileCompositor.js +1 -1
  100. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  101. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  102. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.glsl.js +1 -1
  103. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
  104. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphereTechnique.js +1 -1
  105. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  106. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
  107. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  108. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
  109. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationBlur.glsl.js +1 -1
  110. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechniqueConfiguration.js +1 -1
  111. package/views/3d/webgl-engine/lib/Compositor.js +1 -1
  112. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  113. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  114. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  115. package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
  116. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  117. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  118. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  119. package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
  120. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  121. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  122. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  123. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  124. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  125. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  126. package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
  127. package/views/3d/webgl-engine/shaders/ditherNoise.glsl.js +1 -1
  128. package/views/layers/FeatureLikeLayerView.js +1 -1
  129. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  130. package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.js +1 -1
  131. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  132. package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
  133. package/widgets/OrientedImageryViewer.js +1 -1
  134. package/widgets/TableList/TableListViewModel.js +1 -1
  135. package/widgets/Track/TrackViewModel.d.ts +1 -0
  136. package/widgets/Track/TrackViewModel.js +1 -1
  137. package/widgets/Track.js +1 -1
  138. package/widgets/support/GeolocationPositioning.d.ts +1 -0
  139. package/widgets/support/GeolocationPositioning.js +1 -1
  140. package/assets/esri/core/workers/chunks/35fdd62277fd06468a29.js +0 -2
  141. package/assets/esri/core/workers/chunks/40caf5e09e4382d81104.js +0 -640
  142. package/assets/esri/core/workers/chunks/4213aa844900fcf95287.js +0 -1
  143. package/assets/esri/core/workers/chunks/594e1f633527749d92d7.js +0 -1
  144. package/assets/esri/core/workers/chunks/cc8d55d1830d7542c3f5.js +0 -262
  145. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphereTechniqueConfiguration.js +0 -2
  146. /package/assets/esri/core/workers/chunks/{35fdd62277fd06468a29.js.LICENSE.txt → 9b89cc85c1b5d561df7c.js.LICENSE.txt} +0 -0
  147. /package/assets/esri/core/workers/chunks/{29b00d07d3e1d095c590.js.LICENSE.txt → b262478da29470abb72b.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{watch as r,syncAndInitial as s,on as l,whenOnce as a}from"../../core/reactiveUtils.js";import{sqlOr as n,sqlIn as o,sqlAnd as u}from"../../core/sql.js";import{property as d,subclass as p}from"../../core/accessorSupport/decorators.js";import{getPopupProvider as f}from"../../graphic/getPopupProvider.js";import{getFeatureIdInfoFieldNames as h}from"../../layers/graphics/data/FeatureIdInfo.js";import{systemIsSpatialFieldName as y}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as m}from"../../layers/support/displayFilterUtils.js";import c from"../../layers/support/FeatureEffect.js";import F from"../../layers/support/FeatureFilter.js";import{getSignedInUser as g,layerRequiresGeometryZM as I}from"../../layers/support/featureLayerUtils.js";import{fetchFeaturePopupFeatures as b,loadFeaturePopupArcadeModules as v}from"../../layers/support/featurePopupQueryUtils.js";import{fixFields as w,unpackFieldNames as x,collectLabelingFields as E,collectElevationFields as R,collectFilterFields as q,collectFeatureReductionFields as _,collectOrderByInfos as j,collectFields as O,collectTrackInfoFields as C,collectDisplayFilterFields as k,collectField as P,featureHasFields as U}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as T}from"../../layers/support/floorFilterUtils.js";import{collectRelativeTimeFields as L}from"../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as Z}from"../../networks/support/networkFieldUtils.js";import S from"../../rest/support/Query.js";import{createFeatureIdInfo as M}from"../2d/layers/features/layerAdapters/featureServiceUtils.js";import D from"./LayerView.js";import{getFetchPopupTemplate as N,getRequiredFields as Q}from"./support/popupUtils.js";import{WhereClauseVisitor as G}from"./support/WhereClauseVisitor.js";let H=class extends D{constructor(){super(...arguments),this._updatingRequiredPromise=null,this._defaultReturnZ=!1,this.hasZ=!1,this.hasM=!1,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([r(()=>{const e=this.layer,t=this.view;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"returnZ"in e&&e.returnZ,e&&"returnM"in e&&e.returnM,e&&"capabilities"in e&&e.capabilities,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,t?.requiredFieldsOptions?.featureTitleFields&&e&&"featureTitleFields"in e&&e.featureTitleFields,t?.requiredFieldsOptions?.utilityNetworkFields&&Z(t,e),e&&"displayFilterInfo"in e&&e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode]},()=>this._handleChange(),s),l(()=>this.view?.floors,"change",()=>this._handleChange()),l(()=>(this.layer&&"displayFilterInfo"in this.layer?this.layer.displayFilterInfo:null)?.filters,"change",()=>this._handleChange()),l(()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null,"change",()=>this._handleChange())])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:i}=this;return"outFields"in e&&e.outFields?w(t,[...x(t,e.outFields),...i]):w(t,i)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return"displayFilterInfo"in e&&this.displayFilterEnabled&&e.displayFilterInfo?m(e.displayFilterInfo,this.view):null}get effectiveDisplayFilterClause(){const e=this.effectiveDisplayFilter?.where??null;return e&&this.hasHighlight?n(e,o(this.layer.objectIdField,this.highlightIds)):e}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get highlightOptions(){}set highlightOptions(e){}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?g(this.layer.url):Promise.resolve(null)}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new S(e);return"floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=u(t.where,T(this))),this.displayFilterEnabled&&(t.where=u(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new S(e)}async fetchPopupFeaturesFromGraphics(e,t){const i=[],r=new Set;for(const l of e){const e=f(l.origin),s=N(e,{...t,checkPopupEnabled:!0});s&&(i.push(l),r.add(s))}if(0===i.length||0===r.size)return[];const s=await this._createPopupQuery(r,t);return await b(this.layer,i,s,{hasRequiredFields:(e,t)=>this._popupFeatureHasRequiredFields(e,t),...t})}_handleChange(){const e=Promise.all([a(()=>!("reloading"in this.layer&&this.layer.reloading)),this._updateRequiredFields(),this._updateClientWhereClauseRequirements(),this._updateHasZM()]).then(()=>{});return this._updatingRequiredPromise=e,e.then(()=>{this._updatingRequiredPromise===e&&(this._updatingRequiredPromise=null)}),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,i=new G(e.fieldsIndex);if(i.visitFilter(this.filter),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&i.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&i.visitTrackInfo(e.trackInfo),"2d"===this.view.type&&(i.visitFilter(this.featureEffect?.filter),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction),"displayFilterInfo"in e&&i.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo)),"subtype-group"===e.type)for(const t of e.sublayers)i.visitLabelingInfo(t.labelsVisible,t.labelingInfo);"definitionExpression"in e&&"capabilities"in e&&e.capabilities?.query.relativeTimeBinWindow&&i.visitRelativeTimeQuery(e.definitionExpression);try{const e=await i.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(r){t.getLogger(this).error(r)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:i,layer:{fieldsIndex:r}}=this,s="renderer"in i&&i.renderer,l="orderBy"in i&&i.orderBy,a="featureReduction"in i?i.featureReduction:null,n=new Set,o=[s?s.collectRequiredFields(n,r):null,E(n,i),e&&"elevationInfo"in i?R(n,i):null,null!=this.filter?q(n,i,this.filter):null,e||null==this.featureEffect?null:q(n,i,this.featureEffect.filter),!e&&a?_(n,i,a):null,!e&&l?j(n,i,l):null,"definitionExpression"in i&&"capabilities"in i&&i.capabilities?.query.relativeTimeBinWindow?L(n,i.fieldsIndex,i.definitionExpression):null];if("timeInfo"in i&&i.timeInfo&&this.timeExtent&&O(n,i.fieldsIndex,[i.timeInfo.startField,i.timeInfo.endField]),"timeInfo"in i&&i.timeInfo&&"trackInfo"in i&&i.trackInfo){const{trackInfo:e}=i;O(n,i.fieldsIndex,[i.timeInfo.trackIdField]),"feature"!==i.type&&"startTimeField"!==e.timeField||O(n,i.fieldsIndex,[i.timeInfo.startField]),"endTimeField"===e.timeField&&O(n,i.fieldsIndex,[i.timeInfo.endField]),await C(n,i)}if("floorInfo"in i&&i.floorInfo&&O(n,i.fieldsIndex,[i.floorInfo.floorField]),"featureTitleFields"in i&&this.view?.requiredFieldsOptions?.featureTitleFields&&i.featureTitleFields&&O(n,i.fieldsIndex,i.featureTitleFields),"feature"===i.type&&i.globalIdField&&this.view?.requiredFieldsOptions?.globalIdField&&O(n,i.fieldsIndex,[i.globalIdField]),"feature"!==i.type&&"subtype-group"!==i.type||!this.view?.requiredFieldsOptions?.utilityNetworkFields||O(n,i.fieldsIndex,Z(this.view,i)),this.displayFilterEnabled&&"displayFilterInfo"in i&&o.push(k(n,i,i.displayFilterInfo)),"feature"===i.type&&e&&null!=i.infoFor3D&&(null==i.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),O(n,i.fieldsIndex,[i.globalIdField])),"subtype-group"===i.type){P(n,r,i.subtypeField);const e=i.sublayers.map(e=>Promise.all([e.renderer?.collectRequiredFields(n,r),E(n,e)]));o.push(Promise.all(e))}if("catalog-footprint"===i.type&&i.parent){const e=i.parent;O(n,r,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===i.type&&"link-chart"===i.parentCompositeLayer.type&&P(n,r,y);const u=await Promise.allSettled(o);if(e)P(n,r,i.objectIdField);else for(const t of h(M(i)))P(n,r,t);e&&"displayField"in i&&i.displayField&&P(n,r,i.displayField);for(const p of u)"rejected"===p.status&&t.getLogger(this).error(p.reason);const d=Array.from(n).sort();this._set("requiredFields",d)}async _updateHasZM(){const{layer:e}=this;if(!e||!this.view)return;let t=!1,i=!1;if("capabilities"in e&&e.capabilities){const{data:r}=e.capabilities;t=r.supportsZ,i=r.supportsM}this._set("hasZ",t),this._set("hasM",i);const{returnZ:r,returnM:s}=await I(e);t&&=r??this._defaultReturnZ,i&&=s??!1,this.hasZ!==t&&this._set("hasZ",t),this.hasM!==i&&this._set("hasM",i)}_popupFeatureHasRequiredFields(e,t){return U(e,t)}async _createPopupQuery(e,t){const r=this.layer.createQuery(),s=new Set;let l="point"===this.layer.geometryType;for(const a of e){if(!l){const e=await v(a);i(t),l=(e&&e.arcadeUtils.hasGeometryOperations(a))??!1}const e=await Q(this.layer,a);i(t);for(const t of e)s.add(t)}return r.where="1=1",r.returnGeometry=l,r.returnZ=l,r.returnM=l,r.outFields=Array.from(s),r.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo&&(r.where=u(r.where,T(this))),r}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};e([d()],H.prototype,"_updatingRequiredPromise",void 0),e([d()],H.prototype,"_defaultReturnZ",void 0),e([d({readOnly:!0})],H.prototype,"availableFields",null),e([d({readOnly:!0})],H.prototype,"hasZ",void 0),e([d({readOnly:!0})],H.prototype,"hasM",void 0),e([d({readOnly:!0})],H.prototype,"displayFilterEnabled",null),e([d({readOnly:!0})],H.prototype,"effectiveDisplayFilter",null),e([d({readOnly:!0})],H.prototype,"effectiveDisplayFilterClause",null),e([d({type:c})],H.prototype,"featureEffect",null),e([d({type:F})],H.prototype,"filter",void 0),e([d()],H.prototype,"layer",void 0),e([d({type:Number})],H.prototype,"maximumNumberOfFeatures",null),e([d({readOnly:!0,type:Boolean})],H.prototype,"maximumNumberOfFeaturesExceeded",null),e([d()],H.prototype,"requiresCurrentUser",void 0),e([d({readOnly:!0})],H.prototype,"requiredFields",void 0),e([d({readOnly:!0})],H.prototype,"signedInUser",null),e([d()],H.prototype,"view",void 0),H=e([p("esri.views.layers.FeatureLikeLayerView")],H);export{H as default};
2
+ import{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{watch as r,syncAndInitial as s,on as l,whenOnce as a}from"../../core/reactiveUtils.js";import{sqlOr as n,sqlIn as o,sqlAnd as u}from"../../core/sql.js";import{property as d,subclass as p}from"../../core/accessorSupport/decorators.js";import{getPopupProvider as f}from"../../graphic/getPopupProvider.js";import{getFeatureIdInfoFieldNames as h}from"../../layers/graphics/data/FeatureIdInfo.js";import{systemIsSpatialFieldName as y}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as m}from"../../layers/support/displayFilterUtils.js";import c from"../../layers/support/FeatureEffect.js";import F from"../../layers/support/FeatureFilter.js";import{getSignedInUser as g,layerRequiresGeometryZM as I}from"../../layers/support/featureLayerUtils.js";import{fetchFeaturePopupFeatures as b,loadFeaturePopupArcadeModules as v}from"../../layers/support/featurePopupQueryUtils.js";import{fixFields as w,unpackFieldNames as x,collectLabelingFields as E,collectElevationFields as R,collectFilterFields as q,collectFeatureReductionFields as _,collectOrderByInfos as j,collectFields as O,collectTrackInfoFields as C,collectDisplayFilterFields as k,collectField as P,featureHasFields as U}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as T}from"../../layers/support/floorFilterUtils.js";import{collectRelativeTimeFields as L}from"../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as Z}from"../../networks/support/networkFieldUtils.js";import S from"../../rest/support/Query.js";import{createFeatureIdInfo as M}from"../2d/layers/features/layerAdapters/featureServiceUtils.js";import D from"./LayerView.js";import{getFetchPopupTemplate as N,getRequiredFields as Q}from"./support/popupUtils.js";import{WhereClauseVisitor as G}from"./support/WhereClauseVisitor.js";let H=class extends D{constructor(){super(...arguments),this._updatingRequiredPromise=null,this._defaultReturnZ=!1,this.hasZ=!1,this.hasM=!1,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([r(()=>{const e=this.layer,t=this.view;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"returnZ"in e&&e.returnZ,e&&"returnM"in e&&e.returnM,e&&"capabilities"in e&&e.capabilities,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,t?.requiredFieldsOptions?.featureTitleFields&&e&&"featureTitleFields"in e&&e.featureTitleFields,t?.requiredFieldsOptions?.utilityNetworkFields&&Z(t,e),e&&"displayFilterInfo"in e&&e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer?.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode]},()=>this._handleChange(),s),l(()=>this.view?.floors,"change",()=>this._handleChange()),l(()=>(this.layer&&"displayFilterInfo"in this.layer?this.layer.displayFilterInfo:null)?.filters,"change",()=>this._handleChange()),l(()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null,"change",()=>this._handleChange())])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:i}=this;return"outFields"in e&&e.outFields?w(t,[...x(t,e.outFields),...i]):w(t,i)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return"displayFilterInfo"in e&&this.displayFilterEnabled&&e.displayFilterInfo?m(e.displayFilterInfo,this.view):null}get effectiveDisplayFilterClause(){const e=this.effectiveDisplayFilter?.where??null;return e&&this.hasHighlight?n(e,o(this.layer.objectIdField,this.highlightIds)):e}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get highlightOptions(){}set highlightOptions(e){}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?g(this.layer.url):Promise.resolve(null)}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new S(e);return"floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=u(t.where,T(this))),this.displayFilterEnabled&&(t.where=u(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new S(e)}async fetchPopupFeaturesFromGraphics(e,t){const i=[],r=new Set;for(const l of e){const e=f(l.origin),s=N(e,{...t,checkPopupEnabled:!0});s&&(i.push(l),r.add(s))}if(0===i.length||0===r.size)return[];const s=await this._createPopupQuery(r,t);return await b(this.layer,i,s,{hasRequiredFields:(e,t)=>this._popupFeatureHasRequiredFields(e,t),...t})}_handleChange(){const e=Promise.all([a(()=>!("reloading"in this.layer&&this.layer.reloading)),this._updateRequiredFields(),this._updateClientWhereClauseRequirements(),this._updateHasZM()]).then(()=>{});return this._updatingRequiredPromise=e,e.then(()=>{this._updatingRequiredPromise===e&&(this._updatingRequiredPromise=null)}),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,i=new G(e.fieldsIndex);if(i.visitFilter(this.filter),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&i.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&i.visitTrackInfo(e.trackInfo),"2d"===this.view.type&&(i.visitFilter(this.featureEffect?.filter),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction),"displayFilterInfo"in e&&i.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo)),"subtype-group"===e.type)for(const t of e.sublayers)i.visitLabelingInfo(t.labelsVisible,t.labelingInfo);"definitionExpression"in e&&"capabilities"in e&&e.capabilities?.query.relativeTimeBinWindow&&i.visitRelativeTimeQuery(e.definitionExpression);try{const e=await i.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(r){t.getLogger(this).error(r)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:i,layer:{fieldsIndex:r}}=this,s="renderer"in i&&i.renderer,l="orderBy"in i&&i.orderBy,a="featureReduction"in i?i.featureReduction:null,n=new Set,o=[s?s.collectRequiredFields(n,r):null,E(n,i),e&&"elevationInfo"in i?R(n,i):null,null!=this.filter?q(n,i,this.filter):null,e||null==this.featureEffect?null:q(n,i,this.featureEffect.filter),!e&&a?_(n,i,a):null,!e&&l?j(n,i,l):null,"definitionExpression"in i&&"capabilities"in i&&i.capabilities?.query.relativeTimeBinWindow?L(n,i.fieldsIndex,i.definitionExpression):null];if("timeInfo"in i&&i.timeInfo&&this.timeExtent&&O(n,i.fieldsIndex,[i.timeInfo.startField,i.timeInfo.endField]),"timeInfo"in i&&i.timeInfo&&"trackInfo"in i&&i.trackInfo){const{trackInfo:e}=i;O(n,i.fieldsIndex,[i.timeInfo.trackIdField]),"feature"!==i.type&&"startTimeField"!==e.timeField||O(n,i.fieldsIndex,[i.timeInfo.startField]),"endTimeField"===e.timeField&&O(n,i.fieldsIndex,[i.timeInfo.endField]),await C(n,i)}if("floorInfo"in i&&i.floorInfo&&O(n,i.fieldsIndex,[i.floorInfo.floorField]),"featureTitleFields"in i&&this.view?.requiredFieldsOptions?.featureTitleFields&&i.featureTitleFields&&O(n,i.fieldsIndex,i.featureTitleFields),"feature"===i.type&&i.globalIdField&&this.view?.requiredFieldsOptions?.globalIdField&&O(n,i.fieldsIndex,[i.globalIdField]),"feature"!==i.type&&"subtype-group"!==i.type||!this.view?.requiredFieldsOptions?.utilityNetworkFields||O(n,i.fieldsIndex,Z(this.view,i)),this.displayFilterEnabled&&"displayFilterInfo"in i&&o.push(k(n,i,i.displayFilterInfo)),"feature"===i.type&&e&&null!=i.infoFor3D&&(null==i.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),O(n,i.fieldsIndex,[i.globalIdField])),"subtype-group"===i.type){P(n,r,i.subtypeField);const e=i.sublayers.map(e=>Promise.all([e.renderer?.collectRequiredFields(n,r),E(n,e)]));o.push(Promise.all(e))}if("catalog-footprint"===i.type&&i.parent){const e=i.parent;O(n,r,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===i.type&&"link-chart"===i.parentCompositeLayer?.type&&P(n,r,y);const u=await Promise.allSettled(o);if(e)P(n,r,i.objectIdField);else for(const t of h(M(i)))P(n,r,t);e&&"displayField"in i&&i.displayField&&P(n,r,i.displayField);for(const p of u)"rejected"===p.status&&t.getLogger(this).error(p.reason);const d=Array.from(n).sort();this._set("requiredFields",d)}async _updateHasZM(){const{layer:e}=this;if(!e||!this.view)return;let t=!1,i=!1;if("capabilities"in e&&e.capabilities){const{data:r}=e.capabilities;t=r.supportsZ,i=r.supportsM}this._set("hasZ",t),this._set("hasM",i);const{returnZ:r,returnM:s}=await I(e);t&&=r??this._defaultReturnZ,i&&=s??!1,this.hasZ!==t&&this._set("hasZ",t),this.hasM!==i&&this._set("hasM",i)}_popupFeatureHasRequiredFields(e,t){return U(e,t)}async _createPopupQuery(e,t){const r=this.layer.createQuery(),s=new Set;let l="point"===this.layer.geometryType;for(const a of e){if(!l){const e=await v(a);i(t),l=(e&&e.arcadeUtils.hasGeometryOperations(a))??!1}const e=await Q(this.layer,a);i(t);for(const t of e)s.add(t)}return r.where="1=1",r.returnGeometry=l,r.returnZ=l,r.returnM=l,r.outFields=Array.from(s),r.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo&&(r.where=u(r.where,T(this))),r}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};e([d()],H.prototype,"_updatingRequiredPromise",void 0),e([d()],H.prototype,"_defaultReturnZ",void 0),e([d({readOnly:!0})],H.prototype,"availableFields",null),e([d({readOnly:!0})],H.prototype,"hasZ",void 0),e([d({readOnly:!0})],H.prototype,"hasM",void 0),e([d({readOnly:!0})],H.prototype,"displayFilterEnabled",null),e([d({readOnly:!0})],H.prototype,"effectiveDisplayFilter",null),e([d({readOnly:!0})],H.prototype,"effectiveDisplayFilterClause",null),e([d({type:c})],H.prototype,"featureEffect",null),e([d({type:F})],H.prototype,"filter",void 0),e([d()],H.prototype,"layer",void 0),e([d({type:Number})],H.prototype,"maximumNumberOfFeatures",null),e([d({readOnly:!0,type:Boolean})],H.prototype,"maximumNumberOfFeaturesExceeded",null),e([d()],H.prototype,"requiresCurrentUser",void 0),e([d({readOnly:!0})],H.prototype,"requiredFields",void 0),e([d({readOnly:!0})],H.prototype,"signedInUser",null),e([d()],H.prototype,"view",void 0),H=e([p("esri.views.layers.FeatureLikeLayerView")],H);export{H as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{pushIfSome as t}from"../../core/arrayUtils.js";import{createTask as s}from"../../core/asyncUtils.js";import r from"../../core/Collection.js";import i from"../../core/Error.js";import{EventedAccessor as a}from"../../core/Evented.js";import n from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{abortMaybe as h,destroyMaybe as l}from"../../core/maybe.js";import{throwIfAborted as p,isAbortError as u}from"../../core/promiseUtils.js";import m from"../../core/ReactiveMap.js";import{on as c,sync as d,watch as f,whenOnce as y}from"../../core/reactiveUtils.js";import{property as g,subclass as v}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as _}from"../../core/support/UpdatingHandles.js";import F from"../../geometry/SpatialReference.js";import{getGraphicLayer as A}from"../../graphic/graphicOriginUtils.js";import{system as x}from"../../time/constants.js";import{createReactiveGraphic as w,isAttributeFormSupportedLayerWithAttachments as I,layerSupportsQueryAttachments as C,queryAttachmentsForElements as E}from"./batchAttributeFormUtils.js";import{ArcadeExecutorProvider as M}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as b}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as k}from"./expressions/ExpressionsModel.js";import T from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as V}from"./inputs/support/createBatchFormInputs.js";import{isGroupInput as j,isFieldInput as H}from"./inputs/support/inputUtils.js";import L from"./templates/BatchFormTemplate.js";import{getLayerContingentValuesMetaData as B}from"./templates/support/contingentValuesUtils.js";import{createBatchFormTemplate as R}from"./templates/support/createBatchFormTemplate.js";import{isExcludedFromSharedForm as S,isGroupElementTemplate as G}from"./templates/support/templateUtils.js";import{isEmptyValue as U}from"../support/forms/formUtils.js";function W(e,t){return e?.find(e=>e.layer===t)}let N=class extends a{constructor(e){super(e),this._attachmentCache=new m,this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new r,this._hasAsyncArcadeExpressions=!1,this.maximumFeatureCount=2e3,this.maximumFeatureCountWithComplexForms=50,this.map=null,this.readOnly=!1,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this.layerInfos=null,this._arcadeExecutorProvider=new M,this._selectedAttachment=null,this._activeFormInputsByElementId=new Map,this._emptyForm=new T({inputs:[]}),this._emptyFormTemplate=new L({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new m,this._updatingHandles=new _,this._layerTemplateMap=new m,this._layerContingentValuesMap=new m,this._workingFeatures=new r,this._expressionsManager=new b({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:x}}),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.addHandles([c(()=>this.features,"after-changes",()=>{this.setSelectedAttachment(null),this.notifyChange("layers"),this._prepare()},d),f(()=>[this.features,this.map,this.timeZone,this.editType],()=>this._prepare(),d),f(()=>this.activeForm,()=>{this._activeFormInputsByElementId.clear(),this._syncAttachments()},d),f(()=>this.activeFeature,()=>{this.setSelectedAttachment(null),this._syncAttachments()},d)]),this._prepare()}destroy(){this._prepareTask=h(this._prepareTask),this._workingFeatures.destroyAll(),l(this._expressionsManager),this._updatingHandles.destroy(),this._reactiveGraphicLookup=new m,this._emptyForm.destroy(),this._emptyFormTemplate.destroy()}get activeFeature(){const e=this.activeFeatureIndex;return e<0?null:this.features.at(e)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const e=this._workingFeatures.at(this.activeFeatureIndex);if(!e)return this._emptyForm;const t=this._featureFormMap.get(e);if(t)return t;const s=this._makeBatchFormInputsForFeature(e);return s!==this._emptyForm&&this._featureFormMap.set(e,s),s}get activeLayer(){const{activeFeature:e}=this;if(!e)return null;return A(e)??null}get calculating(){return this._expressionsManager.calculating}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:e}=this;return this.invalidFeatures.some(t=>t!==e)}get hasAsyncArcadeExpressions(){return this._hasAsyncArcadeExpressions}get hasTooManyFeatures(){return this._workingFeatures.length>this.maximumFeatureCount}get hasTooManyComplexFeatures(){return this._workingFeatures.length>this.maximumFeatureCountWithComplexForms&&this.hasAsyncArcadeExpressions}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.visibleInputs.length>0}get hasLayersWithContingentValues(){for(const e of this.layers){const t=this._layerContingentValuesMap.get(e);if(t&&t.size>0)return!0}return!1}get visibleInputs(){return this.activeForm.inputs.filter(e=>e.visible)}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return"noElements";const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case"hidden:not-in-all-layers":case"hidden:no-domain-in-common":e.add("noElementsInCommon");break;case"hidden:field-definition":case"hidden:group-visibility-expression:all-features":case"hidden:visibility-expression:all-features":e.add("allElementsHidden");break;case"hidden:group-visibility-expression:some-features":case"hidden:visibility-expression:some-features":return"elementsHiddenInSome"}return e.has("allElementsHidden")?"allElementsHidden":"noElementsInCommon"}get status(){const e=this._prepareTask;return null==e?"not-loaded":e.finished?null!=e.error?"failed":"loaded":"loading"}get submittable(){return this.valid,!0}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid&&Array.from(this._featureFormMap.values()).every(e=>e.valid)}get layers(){const e=new Set;return this.features.forEach(t=>{const s=A(t);s&&e.add(s)}),Array.from(e)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){this.submitHasBeenAttempted=!0,this.emit("submit",{name:"submit",results:this._makeSubmitResults(),valid:this.valid})}get selectedAttachment(){return this._selectedAttachment}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const s=this.activeForm.allFieldInputs.find(t=>t.template.elementId===e);return void 0!==s?(t.set(e,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const e of this.visibleInputs){if(j(e)){const t=e.inputs.find(e=>H(e)&&!e.valid);if(t)return{input:t,groupInput:e}}if(H(e)&&!e.valid)return{input:e}}}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._reactiveGraphicLookup.get(e);if(!t)throw new i("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}notifyGeometriesChanged(e){const t=[];for(const s of e){const e=this._reactiveGraphicLookup.get(s);e&&(t.push(e),e.geometry=s.geometry)}this._expressionsManager.runGeometryDependentExpressions(t)}async setFieldInputValue(e,t){const s=new Set(this.invalidFeatures);await e.setValueFromUser(t),this.userHasChangedValues=!0,this._trackValidityChange(s),this.emit("value-change",{features:e.features.toArray().map(e=>e.source),fieldName:e.fieldName,name:"value-change",value:t})}async setValue(e,t){const s=this.findFieldInput(e);if(null==s)throw new i("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);await this.setFieldInputValue(s,t)}async stageAddAttachments(e,t){if(0===t.length)return[];const s=this._findAttachmentInput(e);if(!s)return[];const r=await s.stageAddAttachments(t,this._expressionsManager.arcadeContext);return this.userHasChangedValues=!0,this._emitAttachmentsChange(s),r}stageDeleteAttachment(e,t){const s=this._findAttachmentInput(e);if(!s)return;const r=this._findAttachment(s,t);r&&(s.stageDeleteAttachment(r),this.userHasChangedValues=!0,this._emitAttachmentsChange(s))}stageRenameAttachment(e,t,s){const r=this._findAttachmentInput(e);if(!r)return;const i=this._findAttachment(r,t);i&&0!==s.trim().length&&(r.stageRenameAttachment(i,s.trim()),this.userHasChangedValues=!0,this._emitAttachmentsChange(r))}async stageReplaceAttachment(e,t,s){const r=this._findAttachmentInput(e);if(!r)return;const i=this._findAttachment(r,t);i&&(await r.stageReplaceAttachment(i,s,this._expressionsManager.arcadeContext),this.userHasChangedValues=!0,this._emitAttachmentsChange(r))}clearAttachmentChanges(e){const t=this._findAttachmentInput(e);t&&(t.clearAttachmentChanges(),this._emitAttachmentsChange(t))}setSelectedAttachment(e){this._selectedAttachment=e??null}userChangesHaveMadeFeatureInvalid(e){return!!this._reactiveGraphicLookup.get(e)?.userChangesHaveMadeInvalid}async _trackValidityChange(e){await y(()=>!1===this.calculating);const t=this.invalidFeatures;for(const s of t)!1===e.has(s)&&this._reactiveGraphicLookup.has(s)&&(this._reactiveGraphicLookup.get(s).userChangesHaveMadeInvalid=!0)}validate(){return!1}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?V(t,new r([e]),this._expressionsManager):this._emptyForm}_makeSubmitResults(){const e=new Map;for(const[s,r]of this._reactiveGraphicLookup){const i=[],a=[],n=this._featureFormMap.get(r)?.allAttachmentElementInputs??[];for(const e of n)t(i,e.toSubmitEdits()),e.valid||a.push(e.template.elementId);e.set(s,{feature:s,values:{...r.attributes},invalidFields:[],attachmentEdits:i,invalidAttachmentElementIds:a})}for(const t of this.sharedForm.allFieldInputs)for(const s of t.invalidFeatures)e.get(s)?.invalidFields.push(t.fieldName);return Array.from(e.values())}_findAttachmentInput(e){const t=this.activeForm.allAttachmentElementInputs.find(t=>t.template.elementId===e);return t||n.getLogger(this).error(`Attachment input not found for elementId '${e}'`),t}_findAttachment(e,t){const s=e.findAttachment(t);return s||n.getLogger(this).error(`Attachment '${t}' not found for attachment element '${e.template.elementId}'`),s}_makeAttachmentEdits(e){const s=[];for(const r of e.allAttachmentElementInputs)t(s,r.toSubmitEdits());return s}_emitAttachmentsChange(e){const t=e.single.feature;if(!t)return;const s=this._featureFormMap.get(t);this.emit("attachments-change",{name:"attachments-change",feature:t.source,attachmentEdits:this._makeAttachmentEdits(s??this.activeForm),valid:this.valid})}_prepare(){this._hasAsyncArcadeExpressions=!1,this._prepareTask=h(this._prepareTask),this._updateWorkingFeatures(),l(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new b({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??F.WebMercator,map:this.map,timeZone:this.timeZone||"system"}});const{layers:e}=this;if(0===e.length)return;const t=s(async t=>{try{p(t);const s=new Map;for(const i of e){const e=await B(i);if(p(t),e){const t=e.fieldGroups.flatMap(e=>e.fields);this._layerContingentValuesMap.set(i,new Set(t))}else this._layerContingentValuesMap.set(i,new Set);const r=W(this.layerInfos,i),a=await R(i,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this.timeZone},r?.formTemplate);p(t),this._layerTemplateMap.set(i,a);const n=a.getExpressionExecutorsForLayer(i);if(this._expressionsManager.layerExpressionsModelMap.set(i,new k({preserveFieldValuesWhenHidden:a.preserveFieldValuesWhenHidden,executorMap:n})),!this._hasAsyncArcadeExpressions)for(const t of n.keys()){const e=n.get(t);if(this._hasAsyncArcadeExpressions=!0===(e.editableExpression?.isAsync||e.requiredExpression?.isAsync||e.valueExpression?.isAsync||e.visibilityExpression?.isAsync),this._hasAsyncArcadeExpressions)break}for(const t of a.elements){if(S(t))continue;const e=t.clone();G(e)&&(e.elements=e.elements.filter(e=>!S(e)));const{elementId:r}=e;s.has(r)?s.get(r).foldIn(e):s.set(r,e)}}if(this.hasTooManyComplexFeatures)throw new i("too-many-features-with-complex-forms","There are too many features to load into the form with the configured complexity");if(this.hasTooManyFeatures)throw new i("too-many-features","There are too many features to load into the form.");const r=new L({elements:Array.from(s.values())});this.sharedFormTemplate=r,this.sharedForm=V(r,this._workingFeatures,this._expressionsManager),await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray())}catch(s){throw u(s)||n.getLogger(this).error("Failed preparing form",s),s}});this._updatingHandles.consumePromise(t.promise),this._prepareTask=t}_updateWorkingFeatures(){this._workingFeatures.destroyAll();for(const t of this._featureFormMap.values())t.destroy();this._featureFormMap.clear(),this._attachmentCache.clear();const{features:e}=this;if(this._reactiveGraphicLookup=new m,0!==e.length){this._workingFeatures.addMany(e.map(w));for(const e of this._workingFeatures)this._reactiveGraphicLookup.set(e.source,e)}}async _syncAttachments(){const{activeFeature:e,activeLayer:t,activeForm:s}=this;if(!(e&&s&&I(t)&&C(t)))return;const r=e.getObjectId();if(null==r)return;const i=this._attachmentCache.get(t),a=s.allAttachmentElementInputs;if(!a.length)return;let n;if(i){const e=i.get(r);e&&(n=e)}if(!n){n=await E(t,r,a);o(this._attachmentCache,t,()=>new m).set(r,n)}for(const o of a)o.applyFetchedAttachments(D(o,n))}};e([g()],N.prototype,"_attachmentCache",void 0),e([g({readOnly:!0})],N.prototype,"activeFeature",null),e([g()],N.prototype,"activeFeatureIndex",void 0),e([g({readOnly:!0})],N.prototype,"activeForm",null),e([g({readOnly:!0})],N.prototype,"activeLayer",null),e([g()],N.prototype,"disabled",void 0),e([g()],N.prototype,"calculating",null),e([g()],N.prototype,"editType",void 0),e([g()],N.prototype,"features",void 0),e([g()],N.prototype,"expressionEvaluationFailed",null),e([g()],N.prototype,"hasNonActiveInvalidFeatures",null),e([g()],N.prototype,"hasAsyncArcadeExpressions",null),e([g()],N.prototype,"_hasAsyncArcadeExpressions",void 0),e([g()],N.prototype,"invalidFeatures",null),e([g()],N.prototype,"hasVisibleInputs",null),e([g()],N.prototype,"hasLayersWithContingentValues",null),e([g()],N.prototype,"maximumFeatureCount",void 0),e([g()],N.prototype,"maximumFeatureCountWithComplexForms",void 0),e([g()],N.prototype,"visibleInputs",null),e([g()],N.prototype,"map",void 0),e([g()],N.prototype,"noVisibleElementsReason",null),e([g()],N.prototype,"readOnly",void 0),e([g()],N.prototype,"spatialReference",void 0),e([g()],N.prototype,"submitHasBeenAttempted",void 0),e([g()],N.prototype,"timeZone",void 0),e([g()],N.prototype,"updating",null),e([g()],N.prototype,"valid",null),e([g()],N.prototype,"layers",null),e([g()],N.prototype,"mode",null),e([g()],N.prototype,"sharedForm",void 0),e([g()],N.prototype,"sharedFormTemplate",void 0),e([g()],N.prototype,"selectedAttachment",null),e([g()],N.prototype,"userHasChangedValues",void 0),e([g()],N.prototype,"layerInfos",void 0),e([g()],N.prototype,"_arcadeExecutorProvider",void 0),e([g()],N.prototype,"_selectedAttachment",void 0),e([g()],N.prototype,"_prepareTask",void 0),e([g()],N.prototype,"_reactiveGraphicLookup",void 0),e([g()],N.prototype,"_layerTemplateMap",void 0),e([g()],N.prototype,"_layerContingentValuesMap",void 0),e([g()],N.prototype,"_workingFeatures",void 0),e([g()],N.prototype,"_expressionsManager",void 0),N=e([v("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],N);const O=N;function Z(e){return null!=e&&e.trim().length>0}function P(e,t){const s=e.keywords;return Z(s)&&s.toLowerCase()===t}function D(e,t){const s="attachment"===e.input?.type?e.input.attachmentAssociationType:"exact",r=e.attachmentKeyword;if("any"===s)return t;if("exactOrNone"===s){if(U(r))return t.filter(e=>!Z(e.keywords));const e=r.toLowerCase();return t.filter(t=>!Z(t.keywords)||P(t,e))}if(U(r))return t;const i=r.toLowerCase();return t.filter(e=>P(e,i))}export{O as default};
2
+ import{__decorate as e}from"tslib";import{pushIfSome as t}from"../../core/arrayUtils.js";import{createTask as s}from"../../core/asyncUtils.js";import r from"../../core/Collection.js";import i from"../../core/Error.js";import{EventedAccessor as a}from"../../core/Evented.js";import n from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{abortMaybe as h,destroyMaybe as l}from"../../core/maybe.js";import{throwIfAborted as p,isAbortError as u}from"../../core/promiseUtils.js";import m from"../../core/ReactiveMap.js";import{on as c,sync as d,watch as f,whenOnce as y}from"../../core/reactiveUtils.js";import{property as g,subclass as v}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as _}from"../../core/support/UpdatingHandles.js";import F from"../../geometry/SpatialReference.js";import{getGraphicLayer as A}from"../../graphic/graphicOriginUtils.js";import{system as x}from"../../time/constants.js";import{createReactiveGraphic as w,isAttributeFormSupportedLayerWithAttachments as I,layerSupportsQueryAttachments as C,queryAttachmentsForElements as M}from"./batchAttributeFormUtils.js";import{ArcadeExecutorProvider as E}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as b}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as k}from"./expressions/ExpressionsModel.js";import T from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as V}from"./inputs/support/createBatchFormInputs.js";import{isGroupInput as j,isFieldInput as H}from"./inputs/support/inputUtils.js";import L from"./templates/BatchFormTemplate.js";import{getLayerContingentValuesMetaData as B}from"./templates/support/contingentValuesUtils.js";import{createBatchFormTemplate as R}from"./templates/support/createBatchFormTemplate.js";import{isExcludedFromSharedForm as S,isGroupElementTemplate as G}from"./templates/support/templateUtils.js";import{isEmptyValue as U}from"../support/forms/formUtils.js";function W(e,t){return e?.find(e=>e.layer===t)}let N=class extends a{constructor(e){super(e),this._attachmentCache=new m,this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new r,this._hasAsyncArcadeExpressions=!1,this.maximumFeatureCount=2e3,this.maximumFeatureCountWithComplexForms=50,this.map=null,this.readOnly=!1,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this.layerInfos=null,this._arcadeExecutorProvider=new E,this._selectedAttachment=null,this._activeFormInputsByElementId=new Map,this._emptyForm=new T({inputs:[]}),this._emptyFormTemplate=new L({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new m,this._updatingHandles=new _,this._layerTemplateMap=new m,this._layerContingentValuesMap=new m,this._workingFeatures=new r,this._expressionsManager=new b({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:x}}),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.addHandles([c(()=>this.features,"after-changes",()=>{this.setSelectedAttachment(null),this.notifyChange("layers"),this._prepare()},d),f(()=>[this.features,this.map,this.timeZone,this.editType],()=>this._prepare(),d),f(()=>this.activeForm,()=>{this._activeFormInputsByElementId.clear(),this._syncAttachments()},d),f(()=>this.activeFeature,()=>{this.setSelectedAttachment(null),this._syncAttachments()},d)]),this._prepare()}destroy(){this._prepareTask=h(this._prepareTask),this._workingFeatures.destroyAll(),l(this._expressionsManager),this._updatingHandles.destroy(),this._reactiveGraphicLookup=new m,this._emptyForm.destroy(),this._emptyFormTemplate.destroy()}get activeFeature(){const e=this.activeFeatureIndex;return e<0?null:this.features.at(e)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const e=this._workingFeatures.at(this.activeFeatureIndex);if(!e)return this._emptyForm;const t=this._featureFormMap.get(e);if(t)return t;const s=this._makeBatchFormInputsForFeature(e);return s!==this._emptyForm&&this._featureFormMap.set(e,s),s}get activeLayer(){const{activeFeature:e}=this;if(!e)return null;return A(e)??null}get calculating(){return this._expressionsManager.calculating}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:e}=this;return this.invalidFeatures.some(t=>t!==e)}get hasAsyncArcadeExpressions(){return this._hasAsyncArcadeExpressions}get hasTooManyFeatures(){return this._workingFeatures.length>this.maximumFeatureCount}get hasTooManyComplexFeatures(){return this._workingFeatures.length>this.maximumFeatureCountWithComplexForms&&this.hasAsyncArcadeExpressions}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.visibleInputs.length>0}get hasLayersWithContingentValues(){for(const e of this.layers){const t=this._layerContingentValuesMap.get(e);if(t&&t.size>0)return!0}return!1}get visibleInputs(){return this.activeForm.inputs.filter(e=>e.visible)}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return"noElements";const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case"hidden:not-in-all-layers":case"hidden:no-domain-in-common":e.add("noElementsInCommon");break;case"hidden:field-definition":case"hidden:group-visibility-expression:all-features":case"hidden:visibility-expression:all-features":e.add("allElementsHidden");break;case"hidden:group-visibility-expression:some-features":case"hidden:visibility-expression:some-features":return"elementsHiddenInSome"}return e.has("allElementsHidden")?"allElementsHidden":"noElementsInCommon"}get status(){const e=this._prepareTask;return null==e?"not-loaded":e.finished?null!=e.error?"failed":"loaded":"loading"}get submittable(){return this.valid,!0}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid&&Array.from(this._featureFormMap.values()).every(e=>e.valid)}get layers(){const e=new Set;return this.features.forEach(t=>{const s=A(t);s&&e.add(s)}),Array.from(e)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){this.submitHasBeenAttempted=!0,this.emit("submit",{name:"submit",results:this._makeSubmitResults(),valid:this.valid})}get selectedAttachment(){return this._selectedAttachment}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const s=this.activeForm.allFieldInputs.find(t=>t.template.elementId===e);return void 0!==s?(t.set(e,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const e of this.visibleInputs){if(j(e)){const t=e.inputs.find(e=>H(e)&&!e.valid);if(t)return{input:t,groupInput:e}}if(H(e)&&!e.valid)return{input:e}}}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._reactiveGraphicLookup.get(e);if(!t)throw new i("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}notifyGeometriesChanged(e){const t=[];for(const s of e){const e=this._reactiveGraphicLookup.get(s);e&&(t.push(e),e.geometry=s.geometry)}this._expressionsManager.runGeometryDependentExpressions(t)}async setFieldInputValue(e,t){const s=new Set(this.invalidFeatures);await e.setValueFromUser(t),this.userHasChangedValues=!0,this._trackValidityChange(s),this.emit("value-change",{features:e.features.toArray().map(e=>e.source),fieldName:e.fieldName,name:"value-change",value:t})}async setValue(e,t){const s=this.findFieldInput(e);if(null==s)throw new i("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);await this.setFieldInputValue(s,t)}async stageAddAttachments(e,t){if(0===t.length)return[];const s=this._findAttachmentInput(e);if(!s)return[];const r=await s.stageAddAttachments(t,this._expressionsManager.arcadeContext);return this.userHasChangedValues=!0,this._emitAttachmentsChange(s),r}stageDeleteAttachment(e,t){const s=this._findAttachmentInput(e);if(!s)return;const r=this._findAttachment(s,t);r&&(s.stageDeleteAttachment(r),this.userHasChangedValues=!0,this._emitAttachmentsChange(s))}stageRenameAttachment(e,t,s){const r=this._findAttachmentInput(e);if(!r)return;const i=this._findAttachment(r,t);i&&0!==s.trim().length&&(r.stageRenameAttachment(i,s.trim()),this.userHasChangedValues=!0,this._emitAttachmentsChange(r))}async stageReplaceAttachment(e,t,s){const r=this._findAttachmentInput(e);if(!r)return;const i=this._findAttachment(r,t);i&&(await r.stageReplaceAttachment(i,s,this._expressionsManager.arcadeContext),this.userHasChangedValues=!0,this._emitAttachmentsChange(r))}clearAttachmentChanges(e){const t=this._findAttachmentInput(e);t&&(t.clearAttachmentChanges(),this._emitAttachmentsChange(t))}setSelectedAttachment(e){this._selectedAttachment=e??null}userChangesHaveMadeFeatureInvalid(e){return!!this._reactiveGraphicLookup.get(e)?.userChangesHaveMadeInvalid}async _trackValidityChange(e){await y(()=>!1===this.calculating);const t=this.invalidFeatures;for(const s of t)!1===e.has(s)&&this._reactiveGraphicLookup.has(s)&&(this._reactiveGraphicLookup.get(s).userChangesHaveMadeInvalid=!0)}validate(){return!1}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?V(t,{allFeatures:new r([e]),expressionsManager:this._expressionsManager,map:this.map}):this._emptyForm}_makeSubmitResults(){const e=new Map;for(const[s,r]of this._reactiveGraphicLookup){const i=[],a=[],n=this._featureFormMap.get(r)?.allAttachmentElementInputs??[];for(const e of n)t(i,e.toSubmitEdits()),e.valid||a.push(e.template.elementId);e.set(s,{feature:s,values:{...r.attributes},invalidFields:[],attachmentEdits:i,invalidAttachmentElementIds:a})}for(const t of this.sharedForm.allFieldInputs)for(const s of t.invalidFeatures)e.get(s)?.invalidFields.push(t.fieldName);return Array.from(e.values())}_findAttachmentInput(e){const t=this.activeForm.allAttachmentElementInputs.find(t=>t.template.elementId===e);return t||n.getLogger(this).error(`Attachment input not found for elementId '${e}'`),t}_findAttachment(e,t){const s=e.findAttachment(t);return s||n.getLogger(this).error(`Attachment '${t}' not found for attachment element '${e.template.elementId}'`),s}_makeAttachmentEdits(e){const s=[];for(const r of e.allAttachmentElementInputs)t(s,r.toSubmitEdits());return s}_emitAttachmentsChange(e){const t=e.single.feature;if(!t)return;const s=this._featureFormMap.get(t);this.emit("attachments-change",{name:"attachments-change",feature:t.source,attachmentEdits:this._makeAttachmentEdits(s??this.activeForm),valid:this.valid})}_prepare(){this._hasAsyncArcadeExpressions=!1,this._prepareTask=h(this._prepareTask),this._updateWorkingFeatures(),l(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new b({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??F.WebMercator,map:this.map,timeZone:this.timeZone||"system"}});const{layers:e}=this;if(0===e.length)return;const t=s(async t=>{try{p(t);const s=new Map;for(const i of e){const e=await B(i);if(p(t),e){const t=e.fieldGroups.flatMap(e=>e.fields);this._layerContingentValuesMap.set(i,new Set(t))}else this._layerContingentValuesMap.set(i,new Set);const r=W(this.layerInfos,i),a=await R(i,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this.timeZone},r?.formTemplate);p(t),this._layerTemplateMap.set(i,a);const n=a.getExpressionExecutorsForLayer(i);if(this._expressionsManager.layerExpressionsModelMap.set(i,new k({preserveFieldValuesWhenHidden:a.preserveFieldValuesWhenHidden,executorMap:n})),!this._hasAsyncArcadeExpressions)for(const t of n.keys()){const e=n.get(t);if(this._hasAsyncArcadeExpressions=!0===(e.editableExpression?.isAsync||e.requiredExpression?.isAsync||e.valueExpression?.isAsync||e.visibilityExpression?.isAsync),this._hasAsyncArcadeExpressions)break}for(const t of a.elements){if(S(t))continue;const e=t.clone();G(e)&&(e.elements=e.elements.filter(e=>!S(e)));const{elementId:r}=e;s.has(r)?s.get(r).foldIn(e):s.set(r,e)}}if(this.hasTooManyComplexFeatures)throw new i("too-many-features-with-complex-forms","There are too many features to load into the form with the configured complexity");if(this.hasTooManyFeatures)throw new i("too-many-features","There are too many features to load into the form.");const r=new L({elements:Array.from(s.values())});this.sharedFormTemplate=r,this.sharedForm=V(r,{allFeatures:this._workingFeatures,expressionsManager:this._expressionsManager,map:this.map}),await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray())}catch(s){throw u(s)||n.getLogger(this).error("Failed preparing form",s),s}});this._updatingHandles.consumePromise(t.promise),this._prepareTask=t}_updateWorkingFeatures(){this._workingFeatures.destroyAll();for(const t of this._featureFormMap.values())t.destroy();this._featureFormMap.clear(),this._attachmentCache.clear();const{features:e}=this;if(this._reactiveGraphicLookup=new m,0!==e.length){this._workingFeatures.addMany(e.map(w));for(const e of this._workingFeatures)this._reactiveGraphicLookup.set(e.source,e)}}async _syncAttachments(){const{activeFeature:e,activeLayer:t,activeForm:s}=this;if(!(e&&s&&I(t)&&C(t)))return;const r=e.getObjectId();if(null==r)return;const i=this._attachmentCache.get(t),a=s.allAttachmentElementInputs;if(!a.length)return;let n;if(i){const e=i.get(r);e&&(n=e)}if(!n){n=await M(t,r,a);o(this._attachmentCache,t,()=>new m).set(r,n)}for(const o of a)o.applyFetchedAttachments(D(o,n))}};e([g()],N.prototype,"_attachmentCache",void 0),e([g({readOnly:!0})],N.prototype,"activeFeature",null),e([g()],N.prototype,"activeFeatureIndex",void 0),e([g({readOnly:!0})],N.prototype,"activeForm",null),e([g({readOnly:!0})],N.prototype,"activeLayer",null),e([g()],N.prototype,"disabled",void 0),e([g()],N.prototype,"calculating",null),e([g()],N.prototype,"editType",void 0),e([g()],N.prototype,"features",void 0),e([g()],N.prototype,"expressionEvaluationFailed",null),e([g()],N.prototype,"hasNonActiveInvalidFeatures",null),e([g()],N.prototype,"hasAsyncArcadeExpressions",null),e([g()],N.prototype,"_hasAsyncArcadeExpressions",void 0),e([g()],N.prototype,"invalidFeatures",null),e([g()],N.prototype,"hasVisibleInputs",null),e([g()],N.prototype,"hasLayersWithContingentValues",null),e([g()],N.prototype,"maximumFeatureCount",void 0),e([g()],N.prototype,"maximumFeatureCountWithComplexForms",void 0),e([g()],N.prototype,"visibleInputs",null),e([g()],N.prototype,"map",void 0),e([g()],N.prototype,"noVisibleElementsReason",null),e([g()],N.prototype,"readOnly",void 0),e([g()],N.prototype,"spatialReference",void 0),e([g()],N.prototype,"submitHasBeenAttempted",void 0),e([g()],N.prototype,"timeZone",void 0),e([g()],N.prototype,"updating",null),e([g()],N.prototype,"valid",null),e([g()],N.prototype,"layers",null),e([g()],N.prototype,"mode",null),e([g()],N.prototype,"sharedForm",void 0),e([g()],N.prototype,"sharedFormTemplate",void 0),e([g()],N.prototype,"selectedAttachment",null),e([g()],N.prototype,"userHasChangedValues",void 0),e([g()],N.prototype,"layerInfos",void 0),e([g()],N.prototype,"_arcadeExecutorProvider",void 0),e([g()],N.prototype,"_selectedAttachment",void 0),e([g()],N.prototype,"_prepareTask",void 0),e([g()],N.prototype,"_reactiveGraphicLookup",void 0),e([g()],N.prototype,"_layerTemplateMap",void 0),e([g()],N.prototype,"_layerContingentValuesMap",void 0),e([g()],N.prototype,"_workingFeatures",void 0),e([g()],N.prototype,"_expressionsManager",void 0),N=e([v("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],N);const O=N;function Z(e){return null!=e&&e.trim().length>0}function P(e,t){const s=e.keywords;return Z(s)&&s.toLowerCase()===t}function D(e,t){const s="attachment"===e.input?.type?e.input.attachmentAssociationType:"exact",r=e.attachmentKeyword;if("any"===s)return t;if("exactOrNone"===s){if(U(r))return t.filter(e=>!Z(e.keywords));const e=r.toLowerCase();return t.filter(t=>!Z(t.keywords)||P(t,e))}if(U(r))return t;const i=r.toLowerCase();return t.filter(e=>P(e,i))}export{O as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{property as e,subclass as o}from"../../../core/accessorSupport/decorators.js";import r from"./EditableInput.js";import s from"./SingleFeatureInputAdapter.js";let i=class extends r{constructor(t){super(t),this.group=null,this.single=new s({input:this}),this.type="utilityNetworkAssociations"}get associationTypes(){return this.template.associationTypes}get feature(){return this.single.feature}get layer(){return this.single.layer}};t([e()],i.prototype,"associationTypes",null),t([e()],i.prototype,"feature",null),t([e()],i.prototype,"group",void 0),t([e()],i.prototype,"layer",null),t([e({readOnly:!0})],i.prototype,"single",void 0),t([e({readOnly:!0})],i.prototype,"type",void 0),i=t([o("esri.widgets.BatchAttributeForm.inputs.UtilityNetworkAssociationsElementInput")],i);const p=i;export{p as default};
2
+ import{__decorate as t}from"tslib";import{property as e,subclass as o}from"../../../core/accessorSupport/decorators.js";import r from"./EditableInput.js";import s from"./SingleFeatureInputAdapter.js";let i=class extends r{constructor(t){super(t),this.group=null,this.map=null,this.single=new s({input:this}),this.type="utilityNetworkAssociations"}get associationTypes(){return this.template.associationTypes}get feature(){return this.single.feature}get layer(){return this.single.layer}};t([e()],i.prototype,"associationTypes",null),t([e()],i.prototype,"feature",null),t([e()],i.prototype,"group",void 0),t([e()],i.prototype,"layer",null),t([e()],i.prototype,"map",void 0),t([e({readOnly:!0})],i.prototype,"single",void 0),t([e({readOnly:!0})],i.prototype,"type",void 0),i=t([o("esri.widgets.BatchAttributeForm.inputs.UtilityNetworkAssociationsElementInput")],i);const p=i;export{p as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../core/Error.js";import t from"../AttachmentElementInput.js";import r from"../BatchFormInputs.js";import s from"../FieldInput.js";import n from"../GroupInput.js";import p from"../RelationshipElementInput.js";import o from"../TextElementInput.js";import a from"../UtilityNetworkAssociationsElementInput.js";import{isFieldElementTemplate as i,isGroupElementTemplate as m,isRelationshipElementTemplate as l,isTextElementTemplate as u,isAttachmentElementTemplate as f,isUtilityNetworkAssociationsElementTemplate as x}from"../../templates/support/templateUtils.js";function I(e,t,s){const n=e.elements.map(e=>w(e,t,s));return new r({inputs:n,template:e})}function w(r,I,c){const y=new Set(r.layers),h=I.filter(e=>y.has(e.layer)),j=h.length===I.length;if(i(r))return new s({existsInAllLayers:j,features:h,template:r,expressionsManager:c});if(m(r)){const e=r.elements.map(e=>w(e,I,c));return new n({existsInAllLayers:j,features:h,inputs:e,template:r,expressionsManager:c})}if(l(r))return new p({existsInAllLayers:j,features:h,template:r,expressionsManager:c});if(u(r))return new o({existsInAllLayers:j,features:h,template:r,expressionsManager:c});if(f(r))return new t({existsInAllLayers:j,features:h,template:r,expressionsManager:c});if(x(r))return new a({existsInAllLayers:j,features:h,template:r,expressionsManager:c});throw new e("batch-attribute-form:unsupported-element-template","The type of form element template provided is not supported")}export{I as createBatchFormInputsFromBatchFormTemplate};
2
+ import e from"../../../../core/Error.js";import t from"../AttachmentElementInput.js";import r from"../BatchFormInputs.js";import s from"../FieldInput.js";import n from"../GroupInput.js";import a from"../RelationshipElementInput.js";import p from"../TextElementInput.js";import o from"../UtilityNetworkAssociationsElementInput.js";import{isFieldElementTemplate as m,isGroupElementTemplate as i,isRelationshipElementTemplate as l,isTextElementTemplate as u,isAttachmentElementTemplate as f,isUtilityNetworkAssociationsElementTemplate as x}from"../../templates/support/templateUtils.js";function I(e,t){return new r({inputs:e.elements.map(e=>w(e,t)),template:e})}function w(r,I){const{allFeatures:y,expressionsManager:c,map:g}=I,h=new Set(r.layers),j=y.filter(e=>h.has(e.layer)),A=j.length===y.length;if(m(r))return new s({existsInAllLayers:A,features:j,template:r,expressionsManager:c});if(i(r)){const e=r.elements.map(e=>w(e,I));return new n({existsInAllLayers:A,features:j,inputs:e,template:r,expressionsManager:c})}if(l(r))return new a({existsInAllLayers:A,features:j,template:r,expressionsManager:c});if(u(r))return new p({existsInAllLayers:A,features:j,template:r,expressionsManager:c});if(f(r))return new t({existsInAllLayers:A,features:j,template:r,expressionsManager:c});if(x(r))return new o({existsInAllLayers:A,features:j,template:r,expressionsManager:c,map:g});throw new e("batch-attribute-form:unsupported-element-template","The type of form element template provided is not supported")}export{I as createBatchFormInputsFromBatchFormTemplate};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{css as e}from"../css.js";import{loadCalciteComponents as t}from"../../support/componentsUtils.js";import{tsx as n}from"../../support/widget.js";function i(){return t({panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider")})}function c(t){const{uiStrings:i,videoEnhancementToolActive:c,resetTools:s,onClose:a,brightness:l,constrast:r,handleBrightnessChange:m,handleContrastChange:p}=t,{reset:d,videoEnhancement:h}=i;return n("calcite-panel",{class:e.imageEnhancementWrapper,closable:!0,closed:!c,heading:h,key:h,onCalcitePanelClose:a},n("div",{class:e.imageEnhancementTools},o({title:i.brightness,value:l,handleChange:m}),o({title:i.contrast,value:r,handleChange:p})),n("calcite-action",{icon:"reset",onclick:s,slot:"header-actions-end",text:d}))}function o({title:t,value:i,handleChange:c,max:o=10,min:s=0,ticks:a=2,step:l=1}){return n("div",{class:e.imageEnhancementToolContainer},n("calcite-label",null,t,n("calcite-slider",{labelTicks:!0,max:o,min:s,step:l,ticks:a,value:i,onCalciteSliderInput:c})))}export{c as VideoEnhancementTools,i as loadVideoEnhancementComponents,o as renderEnhancementSlider};
2
+ import{css as e}from"../css.js";import{loadCalciteComponents as t}from"../../support/componentsUtils.js";import{tsx as n}from"../../support/widget.js";function i(){return t({panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider")})}function o(t){const{uiStrings:i,videoEnhancementToolActive:o,resetTools:s,onClose:a,brightness:l,constrast:r,handleBrightnessChange:m,handleContrastChange:p}=t,{reset:d,videoEnhancement:h}=i;return n("calcite-panel",{class:e.imageEnhancementWrapper,closable:!0,closed:!o,heading:h,key:h,onCalcitePanelClose:a},n("div",{class:e.imageEnhancementTools},c({title:i.brightness,value:l,handleChange:m}),c({title:i.contrast,value:r,handleChange:p})),n("calcite-action",{icon:"reset",onclick:s,slot:"header-actions-end",text:d}))}function c({title:t,tooltip:i,value:o,handleChange:c,max:s=10,min:a=0,ticks:l=2,step:r=1}){return n("div",{class:e.imageEnhancementToolContainer},n("calcite-label",{title:i},t,n("calcite-slider",{labelTicks:!0,max:s,min:a,step:r,ticks:l,title:i,value:o,onCalciteSliderInput:c})))}export{o as VideoEnhancementTools,i as loadVideoEnhancementComponents,c as renderEnhancementSlider};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{prefersRTL as t,substitute as i}from"../intl.js";import{prefersReducedMotion as a}from"../core/a11yUtils.js";import{createTask as s}from"../core/asyncUtils.js";import o from"../core/Collection.js";import{deprecateWidget as n,deprecatedProperty as r}from"../core/deprecate.js";import l from"../core/Logger.js";import{isAbortError as d}from"../core/promiseUtils.js";import{watch as c,initial as g,syncAndInitial as h,on as m,sync as u}from"../core/reactiveUtils.js";import{throttle as p}from"../core/throttle.js";import{property as v,subclass as y}from"../core/accessorSupport/decorators.js";import{or as w}from"../layers/orientedImagery/transformations/utils.js";import _ from"./Expand.js";import M from"./PanoramicVideoViewer.js";import T from"./PanoramicViewer.js";import b from"./Widget.js";import{getAllArcPath as C}from"./OrientedImageryViewer/arcUtils.js";import{getDelegatedEvents as f,defaultImageGeometryField as I,defaultOIObjectIDField as S,segmentArcs as A,featureCircleRadius as k,navigationToolDimensionLength as V,sectorsRadii as L}from"./OrientedImageryViewer/constants.js";import{css as E,navigation as O,navigationToolRotationFrom as P,navigationToolRotationTo as F,root as x}from"./OrientedImageryViewer/css.js";import{isFeatureAttachment as G,loadImageForAttachment as N,getThumbnailPixelBlock as D,renderImageWithRotation as H}from"./OrientedImageryViewer/galleryUtils.js";import j from"./OrientedImageryViewer/OrientedImageryViewerViewModel.js";import $ from"./OrientedImageryViewer/OrientedImageryViewerVisibleElements.js";import{loadAlertComponents as B,Alert as R}from"./OrientedImageryViewer/components/Alert.js";import q from"./OrientedImageryViewer/components/ImageLocationWidget.js";import W from"./OrientedImageryViewer/components/ImageViewer.js";import U from"./OrientedImageryViewer/components/NavigationUI.js";import Z from"./OrientedImageryViewer/components/NavigationUI360.js";import{SequentialNavigationUI as z}from"./OrientedImageryViewer/components/SequentialNavigationUI.js";import{loadVideoEnhancementComponents as J,renderEnhancementSlider as K,VideoEnhancementTools as Q}from"./OrientedImageryViewer/components/VideoEnhancementTools.js";import{NoImageLoadedError as X}from"./OrientedImageryViewer/navigation/errors.js";import{loadCalciteComponents as Y}from"./support/componentsUtils.js";import{globalCss as ee}from"./support/globalCss.js";import{vmEvent as te,messageBundle as ie,tsx as ae}from"./support/widget.js";const se={overlayed:"overlayed"};let oe=class extends b{constructor(e,t){super(e,t),this.dataCaptureEnabled=!1,this.galleryOpened=!1,this.imageEnhancementToolActive=!1,this.videoEnhancementToolActive=!1,this.imageOverlaysOpened=!1,this.navigationToolActive=!1,this.viewModel=new j,this.messagesCommon=null,this.messagesSketch=null,this.pixelMeasurementUnit="meters",this.pixelAreaMeasurementUnit="square-meters",this.selectedGroup=null,this.showCameraLocations=!1,this.showMapFeatures=!1,this.visibleElements=new $,this._defaultSuperimposeZOffsetPercentage=100,this._panoramicSuperimposeRadiusOffsetPercentage=100,this._imageOverlaysLoaderTask=null,this._imageMeasurementToolsLoaderTask=null,this._navigationSettingsLoaderTask=null,this._navigationTask=null,this._clearMeasurements=()=>{this.viewModel.measureType=null,this.viewModel.triangularMeasurementActive=!1,this.viewModel.clearPreviousMeasurements()},this._clearImageLocation=()=>{this.imageLocationToolActive=!1,this.triangularMeasurementActive=!1},this._createNavigationTask=async e=>(this._navigationTask?.abort(),this._navigationTask=s(async t=>await this.navigate({...e,signal:t})),this._navigationTask.promise),this._navigateNext=async()=>await this._createNavigationTask({step:1}),this._navigatePrevious=async()=>await this._createNavigationTask({step:-1}),this._navigationToolExpanded=!1,this._navigationTool=null,this._galleryController=new AbortController,this._galleryObserver=new IntersectionObserver(this._lazyLoadImage.bind(this)),this._overlayedLayers=new o,this._previousAction=null,this._closeImageSequenceAlert=()=>{this._set("noImageInSequenceError",!1)},this._handleDataCaptureLayerChange=async e=>{if(this.dataCaptureLayer&&await this.stopDataCapture(!0),this.dataCaptureLayer=this.dataCaptureLayer===e?null:e,this.dataCaptureLayer)return this.startDataCapture(this.dataCaptureLayer)},this._handleNavigationSettingsInputChange=(e,t)=>{this.set(`${e}Threshold`,t)},this._handleNavigationSettingsToggle=e=>{this.viewModel.preserveAngle=e},this._handleOverlayLayerDeselect=e=>{const t=e.layer;t===this.dataCaptureLayer&&(this.stopDataCapture(),this.dataCaptureLayer=null),this.removeOverlayedGraphicsOnImage(`${t.id}`)},this._handleOverlayLayerSelect=e=>{const t=e.layer;this.viewModel.overlayMapFeatures(t,this.showMapFeatures),this.addHandles(c(()=>t.visible,()=>{this.viewModel.toggleOverlayMapFeatures(t.id,t.visible,this.showMapFeatures)}),`${se.overlayed}-${t.id}`)},this._highlight=e=>{const t=e.target?.dataset.objectid;t&&this.viewModel.highlight(t)},this._onAction=e=>{const{target:t}=e,{dataset:{action:i}}=t,{_previousAction:a}=this,s=a?.dataset.action,o=s?.includes("draw")??!1,n="select-feature"===s,r=s!==i;switch(i){case"draw-point":case"draw-polygon":case"draw-polyline":{a&&w(n,o&&r)&&(a.active=!1),t.active=!t.active;const e=i.replace("draw-","");this.viewModel.digitizeCreate(e),this._previousAction=t.active?t:null;break}case"save":this.viewModel.saveDrawing();break;case"select-feature":o&&(this._previousAction.active=!1),t.active=!t.active,this.viewModel.toggleSelection(t.active),this._previousAction=t.active?t:null;break;case"delete-feature":this.viewModel.digitizeDelete()}},this._onImageOverlayClosed=e=>{e.stopPropagation(),this.imageOverlaysOpened=!1},this._onShowCameraLocationsChanged=e=>{this.showCameraLocations=e},this._onShowMapFeaturesChanged=e=>{this.showMapFeatures=e},this._removeHighlight=()=>this.viewModel.removeHighlight(),this._restoreOverlays=async()=>Promise.all(this._overlayedLayers.map(e=>this.viewModel.overlayMapFeatures(e,this.showMapFeatures))),this._scaleNavigationTool=()=>{this._navigationToolExpanded=!this._navigationToolExpanded},this._sketchLoaderTask=null,this._settingsToggle=null,this._toggleImageNavigation=async e=>{const t=this.navigationMode;this._closeAllImageTools(),this.navigationMode=t!==e?e:null;const{activeViewer:i}=this.viewModel;if(!i)return;const{mode:a,preserveAngle:s}=this.viewModel;if("default"===a)if("directional"===this.navigationMode){const e=await this._loadNavigationSettings(),t="heading"===s||"both"===s,i="pitch"===s||"both"===s,{messages:a,messagesCommon:o}=this,n=new e({cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold,uiStrings:{configureNavigation:a.configureNavigation,preserveHeading:a.preserveHeading,preserveHeadingDescription:a.preserveHeadingDescription,preservePitch:a.preservePitch,preservePitchDescription:a.preservePitchDescription,settings:o.settings,thresholdLabel:a.thresholdLabel},onInputChange:this._handleNavigationSettingsInputChange,onToggle:this._handleNavigationSettingsToggle,preserveHeading:t,preservePitch:i});this._settingsToggle=new _({content:n,expandIcon:"configure"}),this.viewModel.activeViewer?.ui.add(this._settingsToggle,{position:"top-left"})}else this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))},this._toggleImageAttributes=p(this.viewModel.toggleImageAttributes.bind(this.viewModel)),this.navigate=async e=>{let t=null;try{const{currentNode:i}=this.viewModel;if(!i)throw new X;t=await this.viewModel.navigate(i,e)}catch(i){d(i)||l.getLogger(this).error("Error occurred while navigating",i),["NoImageInSequenceError","NoSequenceFoundError"].includes(i.name)&&this._set("noImageInSequenceError",!0)}return t},this.reset=()=>{this._closeAllImageTools(),this.viewModel.reset()},this._loadImageFromGallery=this._loadImageFromGallery.bind(this),this._registerGalleryItem=this._registerGalleryItem.bind(this),this._unregisterGalleryItem=this._unregisterGalleryItem.bind(this),this.loadImageFromSource=this.loadImageFromSource.bind(this),this.updateSuitabilities=this.updateSuitabilities.bind(this),this._handleVideoBrightnessChange=this._handleVideoBrightnessChange.bind(this),this._handleVideoContrastChange=this._handleVideoContrastChange.bind(this),this._handleBrightnessChange=this._handleBrightnessChange.bind(this),this._handleContrastChange=this._handleContrastChange.bind(this),this._handleSharpnessChange=this._handleSharpnessChange.bind(this),this._handleSuperimposeZOffsetChange=this._handleSuperimposeZOffsetChange.bind(this),this._toggleSuperimposeCameraLock=this._toggleSuperimposeCameraLock.bind(this),this._resetSuperimposeOffset=this._resetSuperimposeOffset.bind(this),this._resetVideoTools=this._resetVideoTools.bind(this),this._toggleEnhancementToolState=this._toggleEnhancementToolState.bind(this),this.announceDeprecation=()=>{n(l.getLogger(this),"Oriented Imagery Viewer","arcgis-oriented-imagery-viewer",{version:"5.0"})}}initialize(){this.addHandles([c(()=>[this.viewModel?.bestFeatureAngle,this._navigationTool],([e,t])=>{t&&this._updateNavigationTool(t)},g),c(()=>this.currentCoverageVisible,e=>this._onCurrentCoverageVisibilityChange(e)),c(()=>this.isAdditionalCoverageVisible,e=>this._onAdditionalCoverageVisibilityChange(e)),c(()=>this.isAdditionalPointSourcesVisible,e=>this._onAdditionalCameraLocationsVisibility(e)),c(()=>this.superimposeViewEnabled,e=>{e?(this._closeAllImageTools(),this.selectedGroup=null,this.shouldShowSelectedImage=!1,this.verticalFilterEnabled=!1):this._resetSuperimposeOffset()}),c(()=>({features:this.currentBestFeature,overlaysEnabled:this._imageOverlaysEnabled,showCameraLocations:this.showCameraLocations}),({overlaysEnabled:e,showCameraLocations:t})=>{e&&this.viewModel.overlayCameraLocations(t)},h),c(()=>({feature:this.currentBestFeature,overlaysEnabled:this._imageOverlaysEnabled,showMapFeatures:this.showMapFeatures}),async(e,t)=>{e.showMapFeatures!==t?.showMapFeatures&&await this.viewModel.toggleAllOverlayMapFeatures(e.showMapFeatures);const i=e.feature&&e.feature!==t?.feature,a=e.overlaysEnabled&&!t?.overlaysEnabled;(i||a)&&(i&&this.viewModel.removeAllOverlayMapFeatures(),e.overlaysEnabled&&(this.dataCaptureLayer&&this.stopDataCapture(),await this._restoreOverlays(),this.dataCaptureLayer&&(await this.startDataCapture(this.dataCaptureLayer),this._previousAction?.active&&(this._previousAction.active=!1,this._previousAction=null))))},g),m(()=>this.viewModel,"popup-open",async e=>{await(this.view?.openPopup(e))},u),m(()=>this.viewModel,"popup-close",()=>{this.view?.closePopup()},u),this._toggleImageAttributes])}loadDependencies(){return Promise.all([J(),Y({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),shell:()=>import("@esri/calcite-components/dist/components/calcite-shell"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider")}),B()])}destroy(){this._galleryController.abort(),this._galleryObserver.disconnect(),this.currentBestFeature=null}get accuracyParametersMissing(){return this.viewModel.accuracyParametersMissing}get activeLayer(){return r(l.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){r(l.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get activeVideoIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?t.videoPaused?"play":"pause":"play"}get activeAudioIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?.videoMuted?"sound-off":"sound"}get cameraHeadingThreshold(){return this.viewModel.cameraHeadingThreshold}set cameraHeadingThreshold(e){this.viewModel.cameraHeadingThreshold=e}get cameraPitchThreshold(){return this.viewModel.cameraPitchThreshold}set cameraPitchThreshold(e){this.viewModel.cameraPitchThreshold=e}get canNavigateSequentially(){return!!this.layer?.effectiveSequenceOrderField?.length}get currentBestFeature(){return this.viewModel.currentBestFeature}set currentBestFeature(e){this.viewModel.currentBestFeature=e}get currentCoverageVisible(){return this.viewModel.currentCoverageVisible}set currentCoverageVisible(e){this.viewModel.currentCoverageVisible=e}get dataCaptureLayer(){return this.viewModel.dataCaptureLayer}set dataCaptureLayer(e){this.viewModel.dataCaptureLayer=e}get depthImageNotSupported(){return this.viewModel.depthImageNotSupported}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get displayMessage(){return this.viewModel.displayMessage}get enhancementToolActive(){return"video"===this.viewModel.mode?this.videoEnhancementToolActive:this.imageEnhancementToolActive}set enhancementToolActive(e){"video"===this.viewModel.mode?this.videoEnhancementToolActive=e:this.imageEnhancementToolActive=e}get features(){return this.viewModel.features}get imagePointsInView(){return this.viewModel.imagePointsInView}get icon(){return"oriented-imagery-widget"}set icon(e){this._overrideIfSome("icon",e)}get imageGalleryEnabled(){return this.viewModel.imageGalleryEnabled}get imageLocationToolActive(){return this.viewModel.imageLocationToolState}set imageLocationToolActive(e){this.viewModel.imageLocationToolState=e}get invalidCameraHeading(){return this.viewModel.invalidCameraHeading}get isAdditionalCoverageVisible(){return this.viewModel.isAdditionalCoverageVisible}set isAdditionalCoverageVisible(e){this.viewModel.isAdditionalCoverageVisible=e}get isAdditionalPointSourcesVisible(){return this.viewModel.isAdditionalPointSourcesVisible}set isAdditionalPointSourcesVisible(e){this.viewModel.isAdditionalPointSourcesVisible=e}get mapImageConversionToolState(){return this.viewModel.mapImageConversionToolState}set mapImageConversionToolState(e){this.viewModel.setMapImageConversionToolState(e)}get measureType(){return this.viewModel.measureType}set measureType(e){this.viewModel.measureType=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get navigationMode(){return this.viewModel.navigationMode}set navigationMode(e){this.viewModel.navigationMode=e}get popupEnabled(){const{popupEnabled:e,state:t}=this.viewModel;return("image-loaded"===t||this.videoLoaded)&&e}get preloadMedia(){return this.viewModel.preloadMedia}set preloadMedia(e){this.viewModel.preloadMedia=e}get referencePoint(){return this.viewModel.referencePoint??null}get sketchViewModel(){return this.viewModel.sketch}get triangularMeasurementActive(){return this.viewModel.triangularMeasurementActive}set triangularMeasurementActive(e){this.viewModel.triangularMeasurementActive=e}get videoLoaded(){const{mode:e,videoElement:t,panoramicVideoLoaded:i}=this.viewModel;return("video"===e&&!0===t?.loaded||i)??!1}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set determineWorkflowForFeature(e){this.viewModel.determineWorkflowForFeature=e}get determineWorkflowForFeature(){return this.viewModel.determineWorkflowForFeature}get shouldShowSelectedImage(){return this.viewModel.shouldShowSelectedImage}set shouldShowSelectedImage(e){this.viewModel.shouldShowSelectedImage=e}get superimposeViewEnabled(){return this.viewModel.superimposeViewEnabled}set superimposeViewEnabled(e){this.viewModel.superimposeViewEnabled=e}get defaultSuperimposeCameraLockEnabled(){return this.viewModel.defaultSuperimposeCameraLockEnabled}set defaultSuperimposeCameraLockEnabled(e){this.viewModel.defaultSuperimposeCameraLockEnabled=e}set updateFootprint(e){this.viewModel.updateFootprint=e}get updateFootprint(){return this.viewModel.updateFootprint}get verticalFilterEnabled(){return this.viewModel.verticalFilterEnabled}set verticalFilterEnabled(e){this.viewModel.verticalFilterEnabled=e}_renderActionBar(){const{selectedGroup:e,superimposeViewEnabled:i}=this;if(i)return ae("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},ae("calcite-action-group",null,this._superimposeViewToggle()));const a=t();return ae("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},!e&&ae("calcite-action-group",null,this._searchGroupToggle(),this._overlaysGroupToggle(),this._navigationGroupToggle(),this._measurementsGroupToggle(),this._utilitiesGroupToggle()),this._renderGroupBackAction(a),"overlays"===e&&ae("calcite-action-group",null,this._currentFootprintToggle(),this._additionalFootprintToggle(),this._additionalPointSourcesToggle(),this._mapImageConversionToggle(),this._imageOverlaysToggle()),"navigation"===e&&ae("calcite-action-group",null,this._directionToolsToggle(),this._navigationToolToggle(),this._imageGalleryToggle()),"measurements"===e&&ae("calcite-action-group",null,this._measurementToolToggle()),"utilities"===e&&ae("calcite-action-group",null,this._imageEnhancementsToggle(),this._videoEnhancementsToggle(),this._superimposeViewToggle(),this._openPopupAction()),"search"===e&&ae("calcite-action-group",null,this._exploreImagesToggle(),this._exploreImages3DToggle(),this._showSelectedImageToggle()))}_renderGroupBackAction(e){return this.selectedGroup?ae("calcite-action",{bind:this,icon:e?"arrow-right":"arrow-left",key:"back-arrow",onclick:()=>this._toggleGroupSelection(null),text:this.messages.previous,title:this.messages.previous}):null}get _activeMeasurementHeading(){const{measureType:e,messages:t,triangularMeasurementActive:i}=this,{groundArea:a,heightAboveGround:s,groundDistance:o,triangulatedAreaHeading:n,triangulatedDistanceHeading:r}=t;if(i)return"area"===e?n:r;switch(e){case"area":return a;case"height":return s;default:return o}}_additionalFootprintToggle(){const{isAdditionalCoverageVisible:e,invalidCameraHeading:t,visibleElements:{additionalFootprintToggle:i}}=this;return i?ae("calcite-action",{active:e,bind:this,class:E.addCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleAdditionalCoverage,text:this.messages.additionalFootprints,title:this.messages.additionalFootprints}):null}_additionalPointSourcesToggle(){const{isAdditionalPointSourcesVisible:e,invalidCameraHeading:t,visibleElements:{additionalCameraLocationsToggle:i}}=this;return i?ae("calcite-action",{active:e,bind:this,class:E.addExpPoints,disabled:t,icon:"circle-area",onclick:this._toggleAdditionalCameraLocations,text:this.messages.additionalCameraLocations,title:this.messages.additionalCameraLocations}):null}get _measurementToggle(){const{viewModel:{state:e,measureType:t,currentBestFeatureMeasurementImage:i},triangularMeasurementActive:a,id:s}=this;if("image-loaded"!==e||!t||a&&!i)return;this._imageMeasurementToolsLoaderTask||this._loadImageMeasurementResources();const o=this._imageMeasurementToolsLoaderTask?.value;return o?ae("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:this._activeMeasurementHeading,id:`${s}-${t}-measurement`,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearMeasurements},ae(o,{measurementType:t,measurementUnitMessages:this.measurementUnitMessages,messages:this.messages,oiViewModel:this.viewModel})):null}get _renderRoot(){const{viewModel:{state:e},triangularMeasurementActive:t}=this;return ae("calcite-panel",{bind:this,class:t?E.viewerContainerMeasurement:E.viewerContainer,heading:this.visibleElements.header?this.messages.title:void 0,loading:e.includes("loading")&&!t},this.visibleElements.menu?this._renderActionBar():null,ae("calcite-shell",null,ae("calcite-panel",null,this._imageViewer,this._panoramicViewer,this._panoramicVideoViewer,this._videoViewer,this._messageBox,this.invalidCameraHeading?null:[this._imageGalleryPanel,this._renderNavigation,this._imageOverlaysPanel()],this._imageEnhancementTools,this._videoEnhancementTools,this._superimposeTools,this._renderSketch(),this._navigationUI),this._imageViewerTriangular,this._measurementToggle,this._locationToggle,this.invalidCameraHeading?this._renderWarning(this.messages.invalidCameraHeadingWarningTitle,this.messages.invalidCameraHeadingWarningDescription):null,this.depthImageNotSupported?this._renderWarning(this.messages.depthImageNotSupportedTitle,this.messages.depthImageNotSupportedDescription):null,this.noImageInSequenceError?this._renderWarning(this.messages.sequentialNavigationWarning,this.messages.sequentialNavigationWarning,this._closeImageSequenceAlert):null))}_currentFootprintToggle(){const{currentCoverageVisible:e,invalidCameraHeading:t}=this,{currentFootprintToggle:i}=this.visibleElements;return i?ae("calcite-action",{active:e,bind:this,class:E.currentCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleCurrentCoverage,text:this.messages.currentFootprint,title:this.messages.currentFootprint}):null}_exploreImagesToggle(){const{exploreImages:e}=this.messages;return this.visibleElements.exploreImages?ae("calcite-action",{active:!this.disabled,bind:this,icon:"oriented-imagery-widget",onclick:this._toggleExploreImages,text:e,title:e}):null}get _imageEnhancementTools(){const{enhancementToolActive:e,viewModel:{brightness:t,contrast:i,sharpness:a,state:s}}=this;return e&&"image-loaded"===s?ae("calcite-panel",{bind:this,class:E.imageEnhancementWrapper,closable:!0,closed:!e,heading:this.messages.imageEnhancement,key:this.messages.imageEnhancement,onCalcitePanelClose:this._toggleEnhancementToolState},ae("div",{class:E.imageEnhancementTools},K({title:this.messages.brightness,value:t,max:10,min:-10,ticks:5,handleChange:this._handleBrightnessChange}),K({title:this.messages.contrast,value:i,max:10,min:-10,ticks:5,handleChange:this._handleContrastChange}),K({title:this.messages.sharpness,value:a,max:1,min:0,ticks:.5,step:.1,handleChange:this._handleSharpnessChange})),ae("calcite-action",{bind:this,icon:"reset",onclick:this._resetImageTools,slot:"header-actions-end",text:this.messagesCommon.reset,title:this.messagesCommon.reset})):null}get _videoEnhancementTools(){const{enhancementToolActive:e,viewModel:{videoViewModel:t,mode:i},messages:{videoEnhancement:a,brightness:s,contrast:o},messagesCommon:{reset:n}}=this;return e&&"video"===i&&t?ae(Q,{brightness:t.videoBrightness,constrast:t.videoContrast,handleBrightnessChange:this._handleVideoBrightnessChange,handleContrastChange:this._handleVideoContrastChange,resetTools:this._resetVideoTools,uiStrings:{videoEnhancement:a,brightness:s,contrast:o,reset:n},videoEnhancementToolActive:e,onClose:this._toggleEnhancementToolState}):null}get _superimposeTools(){const{superimposeViewEnabled:e,view:t,viewModel:{state:i,mode:a},messages:{superimposeSettings:s,superimposeSliderTitle:o}}=this,n="panoramic"===a;return e&&"3d"===t?.type&&"image-loaded"===i?ae("calcite-panel",{bind:this,class:this.classes(E.imageEnhancementWrapper,E.superimposeTools),heading:s,key:"superimpose-settings"},ae("div",{class:E.imageEnhancementTools},K({title:o,value:n?this._panoramicSuperimposeRadiusOffsetPercentage:this._defaultSuperimposeZOffsetPercentage,max:100,min:0,ticks:10,step:1,handleChange:this._handleSuperimposeZOffsetChange})),ae("calcite-action",{bind:this,icon:"reset",onclick:this._resetSuperimposeOffset,slot:"header-actions-end",text:this.messagesCommon.reset,title:this.messagesCommon.reset})):null}_imageEnhancementsToggle(){const{state:e,mode:t}=this.viewModel,{enhancementTool:i}=this.visibleElements;return i&&"video"!==t?ae("calcite-action",{active:this.enhancementToolActive,bind:this,disabled:"default"!==t||"image-loaded"!==e,icon:"sliders-horizontal",onclick:this._toggleEnhancementToolState,text:this.messages.imageEnhancement,title:this.messages.imageEnhancement}):null}_exploreImages3DToggle(){const{exploreImages3D:e}=this.messages,t="3d"!==this.view?.type||!this.layer?.verticalSearchRange;return this.visibleElements.exploreImages3D?ae("calcite-action",{active:this.verticalFilterEnabled,bind:this,disabled:t,icon:"i3DSearch",onclick:this._toggleVerticalSearchFilter,text:e,title:e}):null}_showSelectedImageToggle(){const{displayImages:e}=this.messages,t=this.viewModel.mode.includes("video");return this.visibleElements.showSelectedImage?ae("calcite-action",{active:this.shouldShowSelectedImage,bind:this,disabled:t,icon:"show-oriented-imagery",onclick:this._toggleShowSelectedImage,text:e,title:e}):null}_superimposeViewToggle(){const{superimposeView:e}=this.messages,{mode:t,accuracyParametersMissing:i}=this.viewModel,a=!this.superimposeViewEnabled&&("3d"!==this.view?.type||t.includes("video")||i);return this.visibleElements.superimpose?ae("calcite-action",{active:this.superimposeViewEnabled,bind:this,disabled:a,icon:"superimpose",onclick:this._toggleSuperimposeView,text:e,title:e}):null}_videoEnhancementsToggle(){const{mode:e}=this.viewModel,{videoEnhancement:t}=this.messages,{enhancementTool:i}=this.visibleElements;return i&&"video"===e?ae("calcite-action",{active:this.enhancementToolActive,bind:this,disabled:"video"!==e,icon:"sliders-horizontal",onclick:this._toggleEnhancementToolState,text:t,title:t}):null}get _imageGalleryPanel(){const{container:e,galleryOpened:t,imageGalleryEnabled:i}=this;return i&&t&&e?this._imageGalleryContext:null}get _imageGalleryContext(){const{galleryOpened:e,invalidCameraHeading:t}=this;return ae("calcite-panel",{bind:this,class:E.carousel,closable:!0,closed:!e,disabled:t,heading:this.messages.imageGallery,key:this.messages.imageGallery,onCalcitePanelClose:this._toggleImageGallery},ae("div",{class:E.carouselContainer},this._renderThumbnails))}_imageGalleryToggle(){const{imageGalleryEnabled:e,invalidCameraHeading:t,visibleElements:{imageGallery:i}}=this;return i?ae("calcite-action",{active:this.galleryOpened,bind:this,disabled:!e||t,icon:"images",onclick:this._toggleImageGallery,text:this.messages.imageGallery,title:this.messages.imageGallery}):null}get _imageOverlaysComponent(){const{_imageOverlayMessages:e,_imageOverlaysLoaderTask:t,_overlayedLayers:i,dataCaptureEnabled:a,dataCaptureLayer:o,imageOverlaysOpened:n,showCameraLocations:r,showMapFeatures:l,view:d,layer:c}=this;if(!c)return null;const g=c.imageGeometryField?.length?c.imageGeometryField:I,h=c.imageReferenceField?.length?c.imageReferenceField:S;t||(this._imageOverlaysLoaderTask=s(async()=>(await import("./OrientedImageryViewer/components/ImageOverlays.js")).default));const m=this._imageOverlaysLoaderTask?.value;return m?ae(m,{closed:!n,dataCaptureEnabled:a,dataCaptureLayer:o,imageGeometryField:g,imageReferenceField:h,messages:e,overlayedLayers:i,showCameraLocations:r,showMapFeatures:l,view:d,onDataCaptureLayerChanged:this._handleDataCaptureLayerChange,onFilterCapturedFeatures:this.viewModel.filterCapturedFeatures,onImageOverlaysClosed:this._onImageOverlayClosed,onLayerDeselected:this._handleOverlayLayerDeselect,onLayerSelected:this._handleOverlayLayerSelect,onShowCameraLocationsChanged:this._onShowCameraLocationsChanged,onShowMapFeaturesChanged:this._onShowMapFeaturesChanged}):null}get _navigationUI(){const{navigationMode:e,viewModel:t}=this,{mode:i,state:a}=t;if(e&&("default"===i||"panoramic"===i)&&"image-loaded"===a)return"directional"===e?"default"===i?ae(U,{cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold,currentNode:this.viewModel.currentNode,navigate:this._createNavigationTask,nodes:this.viewModel.navigationNodes,preserveAngle:this.viewModel.preserveAngle}):ae(Z,{currentNode:this.viewModel.currentNode,navigate:this._createNavigationTask,nodes:this.viewModel.navigationNodes}):ae(z,{layout:"horizontal",uiStrings:{end:this.messages.end,next:this.messages.next,previous:this.messages.previous,start:this.messages.start},onNext:this._navigateNext,onPrev:this._navigatePrevious})}get _imageOverlayMessages(){return{...this.messages,...this.messagesSketch}}get _imageSketchToolsMessages(){return{...this.messagesCommon,...this.messagesSketch}}_imageOverlaysPanel(){const{imageOverlaysOpened:e}=this,t=this.classes({[E.imageOverlaysContainer]:!0,[ee.hidden]:!e||!this._imageOverlaysEnabled});return ae("div",{class:t,key:this.messages.imageOverlays},this._imageOverlaysComponent)}_imageOverlaysToggle(){const{imageOverlaysOpened:e,invalidCameraHeading:t,visibleElements:{imageOverlays:i}}=this;return i?ae("calcite-action",{active:e,bind:this,disabled:!this._imageOverlaysEnabled||t,icon:"layers",onclick:this._toggleImageOverlays,text:this.messages.imageOverlays,title:this.messages.imageOverlays}):null}get _imageOverlaysEnabled(){return this.viewModel.overlayGraphicsEnabled}get _imageViewer(){const{displayMessage:e,loadImageViewer:t,mode:i,clickAction:a,state:s}=this.viewModel,o=null!=e||"default"!==i||s.includes("loading");return ae(W,{afterCreate:t,clickAction:a,visible:!o})}get _imageViewerTriangular(){const{messages:e,triangularMeasurementActive:t}=this,{displayMessage:i,storeImageMeasurementViewer:a,storePanoramicMeasurementViewer:s,mode:o,state:n,clickAction:r}=this.viewModel,l=null!=i||"none"===o||"video"===o,d=this.classes({[E.viewer]:!l,[E.viewerHidden]:l});return t?ae("calcite-panel",{class:E.viewerContainerMeasurement,heading:e.measurementViewerHeading,loading:n.includes("loading")},ae("calcite-panel",{bind:this,class:d},"default"===o?ae(W,{afterCreate:a,clickAction:r,uiStrings:e}):ae(T,{afterCreate:s,clickAction:r,uiStrings:e}))):null}_utilitiesGroupToggle(){const{utilityTools:e}=this.messages;return this.visibleElements.utilityTools?ae("calcite-action",{bind:this,icon:"tools",key:"utilities-group-toggle",onclick:()=>this._toggleGroupSelection("utilities"),text:e,title:e}):null}_searchGroupToggle(){const{searchTools:e}=this.messages;return this.visibleElements.searchTools?ae("calcite-action",{bind:this,icon:"search",key:"search-group-toggle",onclick:()=>this._toggleGroupSelection("search"),text:e,title:e}):null}get _videoViewer(){const{mode:e,loadVideoViewer:t,videoViewModel:i}=this.viewModel,{control:a,reset:s}=this.messagesCommon,{mute:o,unmute:n}=this.messages,r="video"!==e,l=this.classes({[E.viewer]:!r,[E.viewerHidden]:r}),d="esri-image-viewer",c=`${d}__slider-container`;return ae("calcite-panel",{bind:this,class:l},ae("calcite-panel",{afterCreate:t,class:this.classes(ee.widget,d)}),ae("calcite-block",{class:c,expanded:!0},ae("calcite-slider",{bind:this,labelHandles:!0,labelTicks:!0,max:i?.videoDuration,minLabel:"0",value:i?.currentTime??0,onCalciteSliderChange:this._handleVideoSeek})),ae("calcite-action-bar",{expandDisabled:!0,layout:"horizontal"},ae("calcite-action-group",null,ae("calcite-action",{bind:this,icon:this.activeVideoIcon,onclick:()=>i?.playVideoHandler(),text:"Play",title:i?.videoPaused?a.play:a.pause})),ae("calcite-action-group",null,ae("calcite-action",{bind:this,icon:"refresh",onclick:()=>i?.rewindVideoHandler(),text:"Rewind",title:s})),ae("calcite-action-group",null,ae("calcite-action",{bind:this,icon:this.activeAudioIcon,onclick:()=>i?.toggleAudio(),text:"Audio",title:i?.videoMuted?o:n}))))}get _locationToggle(){const{viewModel:{state:e,groundCoordinates:t,groundCoordinatesAccuracy:i,triangulatedPoint:a},imageLocationToolActive:s,triangularMeasurementActive:o,messages:{groundLocation:n,triangulatedLocationHeading:r}}=this;if("image-loaded"!==e||!t||!s)return;let l=t;if(o){if(!a)return;l=a}return ae("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:o?r:n,id:n,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearImageLocation},ae(q,{accuracy:i,groundCoordinates:l,messages:this.messages}))}_mapImageConversionToggle(){const{mapImageConversionToolState:e,viewModel:{state:t,disabled:i},videoLoaded:a,invalidCameraHeading:s,visibleElements:{mapImageConversionTool:o}}=this,n=!("video"!==this.viewModel.mode||!a||!this.viewModel.videoViewModel?.videoPaused),r="panoramic-video"===this.viewModel.mode&&this.viewModel.panoramicVideoLoaded&&this.viewModel.panoramicVideoPaused;return o?ae("calcite-action",{active:e,bind:this,disabled:"image-loaded"!==t&&!n&&!r||s||i,icon:"image-pin",onclick:this._toggleMapImageConversionToolState,text:this.messages.mapImageConversionTool,title:this.messages.mapImageConversionTool}):null}_measurementToolToggle(){const{measureType:e,viewModel:t,accuracyParametersMissing:i,messages:a,triangularMeasurementActive:s}=this,{state:o}=t,{groundDistance:n,groundArea:r,heightAboveGround:l,groundLocation:d,triangulatedDistanceHeading:c,triangulatedAreaHeading:g,triangulatedLocationHeading:h}=a,m="image-loaded"!==o||i;return ae("calcite-action-group",{key:"measurement-tools",scale:"m"},ae("calcite-action",{active:"distance"===e&&!s,bind:this,disabled:m,icon:"measure-line",key:"distance-measurement",onclick:e=>this._toggleMeasurementSketch(e,"distance"),text:n,title:n}),ae("calcite-action",{active:"area"===e&&!s,bind:this,disabled:m,icon:"measure-area",key:"area-measurement",onclick:e=>this._toggleMeasurementSketch(e,"area"),text:r,title:r}),ae("calcite-action",{active:"height"===e,bind:this,disabled:m,icon:"measure-building-height-top-base",key:"height-measurement",onclick:e=>this._toggleMeasurementSketch(e,"height"),text:l,title:l}),ae("calcite-action",{active:!!this.imageLocationToolActive&&!s,bind:this,disabled:m,icon:"pin-tear",key:"surface-location",onclick:this._toggleLocationTool,text:d,title:d}),ae("calcite-action",{active:!!s&&this.imageLocationToolActive,bind:this,disabled:m,icon:"dual-image-location",key:"triangular-location",onclick:this._toggleTriangularLocation,text:h,title:h}),ae("calcite-action",{active:!!s&&"distance"===this.measureType,bind:this,disabled:m,icon:"dual-image-distance",key:"triangular-distance",onclick:this._toggleTriangularDistanceMeasurements,text:c,title:c}),ae("calcite-action",{active:!!s&&"area"===this.measureType,bind:this,disabled:m,icon:"dual-image-area",key:"triangular-area",onclick:this._toggleTriangularAreaMeasurements,text:g,title:g}))}get _messageBox(){const{messages:e,viewModel:{displayMessage:t,mode:a}}=this;if(!t||"video"===a)return null;const{data:s,key:o,map:n}=t,r=`${n?i(e[o],n):e[o]}`;return ae("span",{class:E.messageBox},s?`${r} ${s}`:r)}async _loadNavigationSettings(){return this._navigationSettingsLoaderTask||(this._navigationSettingsLoaderTask=s(async()=>(await import("./OrientedImageryViewer/components/NavigationSettings.js")).default)),await this._navigationSettingsLoaderTask.promise}_measurementsGroupToggle(){const{measurementTools:e}=this.messages,{state:t,accuracyParametersMissing:i}=this.viewModel,a="image-loaded"!==t||i;return this.visibleElements.measurementTools?ae("calcite-action",{bind:this,disabled:a,icon:"measure-line",key:"measurements-group-toggle",onclick:()=>this._toggleGroupSelection("measurements"),text:e,title:e}):null}_navigationGroupToggle(){const{imageNavigation:e}=this.messages;return this.visibleElements.imageNavigationTools?ae("calcite-action",{bind:this,icon:"absolute-direction",key:"navigation-group-toggle",onclick:()=>this._toggleGroupSelection("navigation"),text:e,title:e}):null}_navigationToolToggle(){const{state:e}=this.viewModel,{visibleElements:{navigationTool:t},videoLoaded:i}=this;return t?ae("calcite-action",{active:this.navigationToolActive,bind:this,disabled:"image-loaded"!==e&&!i||this.invalidCameraHeading,icon:"explore",onclick:this._toggleNavigationTool,text:this.messages.navigationTool,title:this.messages.navigationTool}):null}_directionToolsToggle(){const{messages:e,viewModel:t,visibleElements:i}=this,{directionalNavigation:a,sequentialNavigation:s}=i,{state:o}=t,{directionalNavigation:n,directionalNavigationDescription:r,sequentialNavigation:l,sequentialNavigationDescription:d}=e;return ae("calcite-action-group",{key:"navigation-tools",scale:"m"},a?ae("calcite-action",{active:"directional"===this.navigationMode,bind:this,disabled:"image-loaded"!==o||this.invalidCameraHeading,icon:"directional-navigation",onclick:()=>{this._toggleImageNavigation("directional")},text:r,title:n}):null,s?ae("calcite-action",{active:"sequential"===this.navigationMode,bind:this,disabled:"image-loaded"!==o||this.invalidCameraHeading||!this.canNavigateSequentially,icon:"sequential-navigation",onclick:()=>{this._toggleImageNavigation("sequential")},text:d,title:l}):null)}_overlaysGroupToggle(){const{overlays:e}=this.messages;return this.visibleElements.overlays?ae("calcite-action",{bind:this,icon:"oriented-imagery-overlays",key:"overlays-group-toggle",onclick:()=>this._toggleGroupSelection("overlays"),text:e,title:e}):null}_openPopupAction(){const{showPopupsAction:e}=this.visibleElements;return e?ae("calcite-action",{bind:this,disabled:!this.popupEnabled,icon:"popup",onclick:this._toggleImageAttributes,text:this.messages.showPopups,title:this.messages.showPopups}):null}get _panoramicVideoViewer(){const{displayMessage:e,loadPanoramicVideoViewer:t,mode:i,clickAction:a,state:s,currentBestFeature:o}=this.viewModel,n=o?.attributes.imagePath,r=null!=e||"panoramic-video"!==i||s.includes("loading")||!n;return ae(M,{afterCreate:t,clickAction:a,oiViewModel:this.viewModel,videoSource:n,visible:!r})}get _panoramicViewer(){const{displayMessage:e,loadPanoramicViewer:t,mode:i,clickAction:a,state:s}=this.viewModel,o=null!=e||"panoramic"!==i||s.includes("loading");return ae(T,{afterCreate:t,clickAction:a,visible:!o})}get noImageInSequenceError(){return this._get("noImageInSequenceError")??!1}_activateTriangulatedImageLocationTool(){this.navigationToolActive=!0,this.imageLocationToolActive=!0}_activateTriangulatedImageLocationWorkflow(e,t){this._closeAllImageTools(),this.imageLocationToolActive=!0,this.triangularMeasurementActive=!e,this.navigationToolActive=!!t||!t}_closeImageToolsAndToggleNavigation(e,t){this._closeAllImageTools(),this.triangularMeasurementActive=!e,this.navigationToolActive=!t}_resetMeasureTypeAndActivateImageLocationTool(){this.measureType=null,this.imageLocationToolActive=!0}_closeAllImageTools(){this.enhancementToolActive=!1,this.navigationToolActive=!1,this.imageOverlaysOpened=!1,this.galleryOpened=!1,this.measureType=null,this.imageLocationToolActive=!1,this.navigationMode=null,this.triangularMeasurementActive=!1,this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))}_handleBrightnessChange(e){this.viewModel.brightness=e.currentTarget.value??0}_handleVideoBrightnessChange(e){this.viewModel.videoViewModel?.handleVideoBrightnessChange(e.target.value)}_handleContrastChange(e){this.viewModel.contrast=e.currentTarget.value??0}_handleVideoContrastChange(e){this.viewModel.videoViewModel?.handleVideoContrastChange(e.target.value)}_handleVideoSeek(e){const t=this.viewModel?.videoElement?.content;t&&(t.currentTime=e.target.value,t.play())}_handleSharpnessChange(e){this.viewModel.sharpness=e.currentTarget.value??0}_handleSuperimposeZOffsetChange(e){const t=e.currentTarget.value??0;if("default"===this.viewModel.mode)return this._defaultSuperimposeZOffsetPercentage=t,void this.viewModel.setDefaultSuperimposeZOffsetPercentage(100-t);this._panoramicSuperimposeRadiusOffsetPercentage=t,this.viewModel.setPanoramicSuperimposeRadiusPercentage(100-t)}_lazyLoadImage(e,t){e.forEach(async e=>{if(e.isIntersecting){const a=e.target,s=a.getAttribute("data-src"),o=a.getAttribute("data-rotation"),n=a.getAttribute("data-objectid"),r=o?parseFloat(o)%360:0,{layer:c,_galleryController:{signal:g}}=this;if(!s||!n)return;let h;try{h=G(s)?await N(c,n,{signal:g}):await D(s,{signal:g})}catch(i){d(i)||l.getLogger("esri.widgets.OrientedImageryViewer").error("#lazyLoadImage()",i)}finally{t.unobserve(a)}if(!h)return;H(h,a,r)}})}_loadImageFromGallery(e){const{target:t}=e;if(!t)return;const i=t.getAttribute("data-objectid");i&&this.viewModel.currentBestFeature?.attributes.objectId!==Number(i)&&this.viewModel.selectBestFeature(i)}_loadImageMeasurementResources(){this._imageMeasurementToolsLoaderTask=s(async()=>{const{default:e}=await import("./OrientedImageryViewer/components/ImageMeasurementWidget.js");return e})}_loadSketchResources(){this._sketchLoaderTask=s(async()=>(await import("./OrientedImageryViewer/components/SketchTools.js")).default)}_onAdditionalCoverageVisibilityChange(e){this.viewModel.setAdditionalCoverageVisibility(e)}_onAdditionalCameraLocationsVisibility(e){this.viewModel.setAdditionalCameraLocationsVisibility(e)}_onCurrentCoverageVisibilityChange(e){this.viewModel.setCurrentCoverageVisibility(e)}_registerGalleryItem(e){this._galleryObserver.observe(e)}_renderWarning(e,t,i){const{viewModel:{state:a}}=this;return"image-loaded"===a?ae(R,{icon:"exclamation-mark-triangle-f",kind:"warning",message:t,open:!0,title:e,tooltip:t,topLayerDisabled:this.topLayerDisabled,onClose:i}):null}get _renderNavigation(){const{viewModel:{sectorData:e,navigatorCurrentBestFeature:t,currentBestFeature:i,state:s}}=this;if(!this.container||!i)return null;let o,n,r,l,d;if(t){const{x:e,y:i,direction:a}=t,[s,c,g,h]=A[a];o=`M ${e} ${i} L ${s} ${c} A ${L[2]} ${L[2]} 0 0 1 ${g} ${h} Z`,n=e,l=i,r=A[a][4],d=A[a][5]}const c=e=>{const t=e.target.dataset?.sector;t&&this.viewModel.handleSectorClick(+t)},g=e=>{const t=e.target.dataset;if(!t)return;const{featureIndexInSector:i,sector:a}=t;i&&a&&this.viewModel.handleFeatureClick({sector:a,featureIndexInSector:+i})},h=e=>{e.removeEventListener("click",g)},m=i.attributes.objectId,u=e?.map(e=>e?.items).filter(Boolean).flatMap(e=>e?.map(({x:e,y:t,objectID:i,featureIndexInSector:a,sector:s})=>ae("circle",{afterRemoved:h,class:this.classes(E.feature,{selected:m===i}),cx:e,cy:t,"data-feature-index-in-sector":a,"data-sector":s,key:`${E.feature}-${i}`,onclick:g,r:k}))),p=e=>{e.removeEventListener("click",c)},v=this.classes({[E.navigationWrapper]:!0,[E.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&("image-loaded"===s||this.videoLoaded)?ae("div",{bind:this,class:v,key:this.messages.navigationTool},ae("svg",{afterCreate:e=>this._storeNavigationToolReference(e),class:a()?O:E.rotateWithAnimation,focusable:"false",height:V,role:"img",width:V,xmlns:"http://www.w3.org/2000/svg"},ae("defs",null,ae("linearGradient",{gradientUnits:"userSpaceOnUse",id:`${this.id}-coverage-fill`,x1:n,x2:r,y1:l,y2:d},ae("stop",{class:E.navigationPathOffset0,offset:0}),ae("stop",{class:E.navigationPathOffset1,offset:1}))),ae("g",null,ae("circle",{class:this.classes(E.sector,E.outerSector),cx:L[3],cy:L[3],onclick:this._scaleNavigationTool,r:L[3]}),ae("circle",{class:E.sector,cx:L[3],cy:L[3],r:L[2]}),ae("circle",{class:E.sector,cx:L[3],cy:L[3],r:L[1]}),ae("circle",{class:E.sector,cx:L[3],cy:L[3],r:L[0]}),ae("path",{class:E.pointer,d:"M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z",key:`${E.pointer}-west`}),ae("path",{class:this.classes(E.pointer,E.north),d:"M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z",key:`${E.pointer}-north`}),ae("path",{class:E.pointer,d:"M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z",key:`${E.pointer}-east`}),ae("path",{class:E.pointer,d:"M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z",key:`${E.pointer}-south`}),ae("path",{class:this.classes(E.sector,E.sectorSeparator),d:"M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076",key:E.sectorSeparator}),C([L[2],L[1],L[0]],L[3],L[3]).map((t,i)=>ae("path",{afterRemoved:p,class:this.classes(E.sector,e?.[i]?.length?E.sectorEnabled:E.sectorDisabled),d:t,"data-sector":`${i}`,key:`${E.sector}-${i}`,onclick:c})),ae("path",{class:this.classes(E.sector,E.sectorCross),d:"M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53",key:E.sectorCross}),u,i.attributes.cameraPitch>=5&&o?ae("path",{class:E.selectedFeaturePath,d:o,fill:`url(#${this.id}-coverage-fill)`,key:E.selectedFeaturePath}):null))):null}_renderSketch(){const{dataCaptureLayer:e,imageOverlaysOpened:t}=this;if(!e||t)return null;if(this._sketchLoaderTask||this._loadSketchResources(),!this._sketchLoaderTask?.value)return null;const{geometryType:i}=e,a="point"===i?"pin":"polyline"===i?"line":"polygon",s=this._sketchLoaderTask.value;return ae("div",{class:E.sketchTools},ae(s,{icon:a,messages:this._imageSketchToolsMessages,type:i,onAction:this._onAction}))}get _renderThumbnails(){const{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?ae("div",{class:E.carouselContent},t?.items.map(({url:t,objectId:i,rotation:a},s)=>ae("div",{class:`${E.carouselItemWrapper}${e.attributes.objectId===i?"--selected":""}`,key:`${E.carouselItemWrapper}-${s}`},ae("canvas",{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${i}`,class:E.carouselItem,"data-objectid":`${i}`,"data-rotation":`${a}`,"data-src":t,onclick:this._loadImageFromGallery,onmouseenter:this._highlight,onmouseleave:this._removeHighlight})))):null}_resetImageTools(){this.viewModel.sharpness=this.viewModel.brightness=this.viewModel.contrast=0}_resetVideoTools(){this.viewModel.videoViewModel?.resetVideoEnhancementTools()}_storeNavigationToolReference(e){this._navigationTool=e}_toggleAdditionalCameraLocations(){this.isAdditionalPointSourcesVisible=!this.isAdditionalPointSourcesVisible}_toggleAdditionalCoverage(){this.isAdditionalCoverageVisible=!this.isAdditionalCoverageVisible}_toggleCurrentCoverage(){this.currentCoverageVisible=!this.currentCoverageVisible}_toggleShowSelectedImage(){this.shouldShowSelectedImage=!this.shouldShowSelectedImage,this._toggleDisabledViewer(this.shouldShowSelectedImage)}_resetSuperimposeOffset(){if("default"===this.viewModel.mode)return this._defaultSuperimposeZOffsetPercentage=100,void this.viewModel.setDefaultSuperimposeZOffsetPercentage(0);this._panoramicSuperimposeRadiusOffsetPercentage=100,this.viewModel.setPanoramicSuperimposeRadiusPercentage(0)}_toggleSuperimposeCameraLock(){this.viewModel.updateDefaultSuperimposeCameraLock(!this.defaultSuperimposeCameraLockEnabled)}_toggleSuperimposeView(){this.superimposeViewEnabled=!this.superimposeViewEnabled}_toggleVerticalSearchFilter(){this.verticalFilterEnabled=!this.verticalFilterEnabled,this._toggleDisabledViewer(this.verticalFilterEnabled)}_toggleDisabledViewer(e){e&&(this.disabled=!1)}_toggleEnhancementToolState(e){e.stopPropagation();const t=this.enhancementToolActive;this._closeAllImageTools(),this.enhancementToolActive=!t}_toggleExploreImages(){this.disabled=!this.disabled,this.disabled&&(this.shouldShowSelectedImage=!1,this.verticalFilterEnabled=!1)}_toggleGroupSelection(e){this.selectedGroup=e}_toggleImageOverlays(e){e.stopPropagation();const t=this.imageOverlaysOpened;this._closeAllImageTools(),this.imageOverlaysOpened=!t}_toggleImageGallery(e){e.stopPropagation();const t=this.galleryOpened;this._closeAllImageTools(),this.galleryOpened=!!this.imageGalleryEnabled&&!t}_toggleLocationTool(e){const t=this.imageLocationToolActive,i=this.triangularMeasurementActive&&t;this._closeAllImageTools(),this.imageLocationToolActive=i||!t,e.stopPropagation()}_toggleMeasurementSketch(e,t){e.stopPropagation();const i=this.measureType,a=this.triangularMeasurementActive;this._closeAllImageTools(),this.measureType=i!==t||a?t:null,this.measureType===t&&(this.viewModel.displayNewMeasurementButton=!0)}_toggleNavigationTool(){const e=this.navigationToolActive;this._closeAllImageTools(),this.navigationToolActive=!e}_toggleMapImageConversionToolState(){this.mapImageConversionToolState=!this.mapImageConversionToolState}_toggleTriangularAreaMeasurements(){this._toggleTriangularMeasurements("area")}_toggleTriangularDistanceMeasurements(){this._toggleTriangularMeasurements("distance")}_toggleTriangularLocation(){const e=this.triangularMeasurementActive,t=this.navigationToolActive;e?null===this.measureType?this.imageLocationToolActive?this._closeImageToolsAndToggleNavigation(e,t):this._activateTriangulatedImageLocationTool():this._resetMeasureTypeAndActivateImageLocationTool():this._activateTriangulatedImageLocationWorkflow(e,t)}_toggleTriangularMeasurements(e){const t=this.triangularMeasurementActive,i=this.viewModel.measureType,a=this.navigationToolActive;t?e===i?(this._closeAllImageTools(),this.triangularMeasurementActive=!t,this.navigationToolActive=!a):(this.imageLocationToolActive=!1,this.measureType=e):(this._closeAllImageTools(),this.measureType=e,this.triangularMeasurementActive=!t,this.navigationToolActive=!!a||!a)}_unregisterGalleryItem(e){this._galleryObserver.unobserve(e)}_updateNavigationTool(e){const{previousFeatureAngle:t,bestFeatureAngle:i}=this.viewModel,a=(i-t+540)%360-180;e.style.setProperty(P,`${t}deg`),e.style.setProperty(F,`${t+a}deg`)}async loadBestImage(e,t){return this.viewModel.loadBestImage(e,t)}loadImageFromSource(e,t,i){return"default"===e?this.viewModel.loadMediaSource(t,i):this.viewModel.loadPanoramicMediaSource(t,i)}async overlayMapFeatures(e,t){return this.removeHandles(`${se.overlayed}-${e.id}`),this.addHandles(c(()=>e.visible,()=>{this.viewModel.toggleOverlayMapFeatures(e.id,e.visible,this.showMapFeatures)}),`${se.overlayed}-${e.id}`),this._overlayedLayers.add(e),this.viewModel.overlayMapFeatures(e,t&&this.showMapFeatures)}async plotMapPoint(e){return this.viewModel.plotMapPoint(e)}plotReferencePointOnGround(e){this.viewModel.plotReferencePointOnGround(e)}plotReferencePointOnImage(e){this.viewModel.plotReferencePointOnImage(e)}removeOverlayedGraphicsOnImage(e){this.removeHandles(`${se.overlayed}-${e}`),this._overlayedLayers.remove(this._overlayedLayers.find(t=>t.id===e)),this.viewModel.removeOverlayedGraphicsOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return ae("div",{class:this.classes(ee.widget,x)},this._renderRoot)}async showImageByObjectId(e,t){return this.viewModel.showImageByObjectId(e,t)}async startDataCapture(e){return this.viewModel.startDataCapture(e)}async stopDataCapture(e){return this.viewModel.stopDataCapture(e)}updateSuitabilities(e){this.viewModel.updateSuitabilities(e)}};e([v({readOnly:!0})],oe.prototype,"accuracyParametersMissing",null),e([v()],oe.prototype,"activeLayer",null),e([v()],oe.prototype,"activeVideoIcon",null),e([v()],oe.prototype,"activeAudioIcon",null),e([v()],oe.prototype,"cameraHeadingThreshold",null),e([v()],oe.prototype,"cameraPitchThreshold",null),e([v()],oe.prototype,"canNavigateSequentially",null),e([v()],oe.prototype,"currentBestFeature",null),e([v()],oe.prototype,"currentCoverageVisible",null),e([v()],oe.prototype,"dataCaptureEnabled",void 0),e([v()],oe.prototype,"dataCaptureLayer",null),e([v()],oe.prototype,"depthImageNotSupported",null),e([v()],oe.prototype,"disabled",null),e([v()],oe.prototype,"enhancementToolActive",null),e([v()],oe.prototype,"features",null),e([v()],oe.prototype,"imagePointsInView",null),e([v()],oe.prototype,"galleryOpened",void 0),e([v()],oe.prototype,"icon",null),e([v()],oe.prototype,"imageEnhancementToolActive",void 0),e([v()],oe.prototype,"videoEnhancementToolActive",void 0),e([v({readOnly:!0})],oe.prototype,"imageGalleryEnabled",null),e([v()],oe.prototype,"imageLocationToolActive",null),e([v()],oe.prototype,"imageOverlaysOpened",void 0),e([v({readOnly:!0})],oe.prototype,"invalidCameraHeading",null),e([v()],oe.prototype,"isAdditionalCoverageVisible",null),e([v()],oe.prototype,"isAdditionalPointSourcesVisible",null),e([v()],oe.prototype,"mapImageConversionToolState",null),e([v()],oe.prototype,"measureType",null),e([v()],oe.prototype,"layer",null),e([v()],oe.prototype,"navigationToolActive",void 0),e([v()],oe.prototype,"navigationMode",null),e([te(f()),v({type:j})],oe.prototype,"viewModel",void 0),e([v(),ie("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],oe.prototype,"messages",void 0),e([v(),ie("esri/core/t9n/Units")],oe.prototype,"measurementUnitMessages",void 0),e([v(),ie("esri/t9n/common")],oe.prototype,"messagesCommon",void 0),e([v(),ie("esri/widgets/Sketch/t9n/Sketch")],oe.prototype,"messagesSketch",void 0),e([v()],oe.prototype,"pixelMeasurementUnit",void 0),e([v()],oe.prototype,"pixelAreaMeasurementUnit",void 0),e([v({readOnly:!0})],oe.prototype,"popupEnabled",null),e([v()],oe.prototype,"preloadMedia",null),e([v()],oe.prototype,"referencePoint",null),e([v()],oe.prototype,"selectedGroup",void 0),e([v()],oe.prototype,"showCameraLocations",void 0),e([v()],oe.prototype,"showMapFeatures",void 0),e([te(["create","delete","redo","undo","update"]),v({readOnly:!0})],oe.prototype,"sketchViewModel",null),e([v()],oe.prototype,"triangularMeasurementActive",null),e([v()],oe.prototype,"videoLoaded",null),e([v()],oe.prototype,"view",null),e([v({type:$,nonNullable:!0})],oe.prototype,"visibleElements",void 0),e([v()],oe.prototype,"determineWorkflowForFeature",null),e([v()],oe.prototype,"shouldShowSelectedImage",null),e([v()],oe.prototype,"superimposeViewEnabled",null),e([v()],oe.prototype,"defaultSuperimposeCameraLockEnabled",null),e([v()],oe.prototype,"updateFootprint",null),e([v()],oe.prototype,"verticalFilterEnabled",null),e([v()],oe.prototype,"_defaultSuperimposeZOffsetPercentage",void 0),e([v()],oe.prototype,"_panoramicSuperimposeRadiusOffsetPercentage",void 0),e([v()],oe.prototype,"_activeMeasurementHeading",null),e([v()],oe.prototype,"_imageOverlaysLoaderTask",void 0),e([v()],oe.prototype,"_imageMeasurementToolsLoaderTask",void 0),e([v()],oe.prototype,"_navigationSettingsLoaderTask",void 0),e([v()],oe.prototype,"_navigationTask",void 0),e([v()],oe.prototype,"_measurementToggle",null),e([v()],oe.prototype,"_renderRoot",null),e([v()],oe.prototype,"_imageEnhancementTools",null),e([v()],oe.prototype,"_videoEnhancementTools",null),e([v()],oe.prototype,"_superimposeTools",null),e([v()],oe.prototype,"_imageGalleryPanel",null),e([v()],oe.prototype,"_imageGalleryContext",null),e([v()],oe.prototype,"_imageOverlaysComponent",null),e([v()],oe.prototype,"_navigationUI",null),e([v()],oe.prototype,"_imageOverlayMessages",null),e([v()],oe.prototype,"_imageSketchToolsMessages",null),e([v()],oe.prototype,"_imageOverlaysEnabled",null),e([v()],oe.prototype,"_imageViewer",null),e([v()],oe.prototype,"_imageViewerTriangular",null),e([v()],oe.prototype,"_videoViewer",null),e([v()],oe.prototype,"_locationToggle",null),e([v()],oe.prototype,"_messageBox",null),e([v()],oe.prototype,"_navigationToolExpanded",void 0),e([v()],oe.prototype,"_navigationTool",void 0),e([v()],oe.prototype,"_panoramicVideoViewer",null),e([v()],oe.prototype,"_panoramicViewer",null),e([v({readOnly:!0})],oe.prototype,"noImageInSequenceError",null),e([v()],oe.prototype,"_renderNavigation",null),e([v()],oe.prototype,"_renderThumbnails",null),e([v()],oe.prototype,"_sketchLoaderTask",void 0),oe=e([y("esri.widgets.OrientedImageryViewer")],oe);const ne=oe;export{ne as default};
2
+ import{__decorate as e}from"tslib";import{prefersRTL as t,substitute as i}from"../intl.js";import{prefersReducedMotion as a}from"../core/a11yUtils.js";import{createTask as s}from"../core/asyncUtils.js";import o from"../core/Collection.js";import{deprecateWidget as n,deprecatedProperty as r}from"../core/deprecate.js";import l from"../core/Logger.js";import{isAbortError as d}from"../core/promiseUtils.js";import{watch as c,initial as g,syncAndInitial as h,on as m,sync as u}from"../core/reactiveUtils.js";import{throttle as p}from"../core/throttle.js";import{property as v,subclass as y}from"../core/accessorSupport/decorators.js";import{or as w}from"../layers/orientedImagery/transformations/utils.js";import _ from"./Expand.js";import T from"./PanoramicVideoViewer.js";import M from"./PanoramicViewer.js";import b from"./Widget.js";import{getAllArcPath as C}from"./OrientedImageryViewer/arcUtils.js";import{getDelegatedEvents as f,defaultImageGeometryField as I,defaultOIObjectIDField as S,segmentArcs as A,featureCircleRadius as k,navigationToolDimensionLength as V,sectorsRadii as L}from"./OrientedImageryViewer/constants.js";import{css as E,navigation as O,navigationToolRotationFrom as P,navigationToolRotationTo as F,root as x}from"./OrientedImageryViewer/css.js";import{isFeatureAttachment as G,loadImageForAttachment as N,getThumbnailPixelBlock as D,renderImageWithRotation as H}from"./OrientedImageryViewer/galleryUtils.js";import j from"./OrientedImageryViewer/OrientedImageryViewerViewModel.js";import $ from"./OrientedImageryViewer/OrientedImageryViewerVisibleElements.js";import{loadAlertComponents as B,Alert as R}from"./OrientedImageryViewer/components/Alert.js";import q from"./OrientedImageryViewer/components/ImageLocationWidget.js";import W from"./OrientedImageryViewer/components/ImageViewer.js";import U from"./OrientedImageryViewer/components/NavigationUI.js";import Z from"./OrientedImageryViewer/components/NavigationUI360.js";import{SequentialNavigationUI as z}from"./OrientedImageryViewer/components/SequentialNavigationUI.js";import{loadVideoEnhancementComponents as J,renderEnhancementSlider as K,VideoEnhancementTools as Q}from"./OrientedImageryViewer/components/VideoEnhancementTools.js";import{NoImageLoadedError as X}from"./OrientedImageryViewer/navigation/errors.js";import{loadCalciteComponents as Y}from"./support/componentsUtils.js";import{globalCss as ee}from"./support/globalCss.js";import{vmEvent as te,messageBundle as ie,tsx as ae}from"./support/widget.js";const se={overlayed:"overlayed"};let oe=class extends b{constructor(e,t){super(e,t),this.dataCaptureEnabled=!1,this.galleryOpened=!1,this.imageEnhancementToolActive=!1,this.videoEnhancementToolActive=!1,this.imageOverlaysOpened=!1,this.navigationToolActive=!1,this.viewModel=new j,this.messagesCommon=null,this.messagesSketch=null,this.pixelMeasurementUnit="meters",this.pixelAreaMeasurementUnit="square-meters",this.selectedGroup=null,this.showCameraLocations=!1,this.showMapFeatures=!1,this.visibleElements=new $,this._defaultSuperimposeZOffsetPercentage=100,this._panoramicSuperimposeRadiusOffsetPercentage=100,this._imageOverlaysLoaderTask=null,this._imageMeasurementToolsLoaderTask=null,this._navigationSettingsLoaderTask=null,this._navigationTask=null,this._clearMeasurements=()=>{this.viewModel.measureType=null,this.viewModel.triangularMeasurementActive=!1,this.viewModel.clearPreviousMeasurements()},this._clearImageLocation=()=>{this.imageLocationToolActive=!1,this.triangularMeasurementActive=!1},this._createNavigationTask=async e=>(this._navigationTask?.abort(),this._navigationTask=s(async t=>await this.navigate({...e,signal:t})),this._navigationTask.promise),this._navigateNext=async()=>await this._createNavigationTask({step:1}),this._navigatePrevious=async()=>await this._createNavigationTask({step:-1}),this._navigationToolExpanded=!1,this._navigationTool=null,this._galleryController=new AbortController,this._galleryObserver=new IntersectionObserver(this._lazyLoadImage.bind(this)),this._overlayedLayers=new o,this._previousAction=null,this._closeImageSequenceAlert=()=>{this._set("noImageInSequenceError",!1)},this._handleDataCaptureLayerChange=async e=>{if(this.dataCaptureLayer&&await this.stopDataCapture(!0),this.dataCaptureLayer=this.dataCaptureLayer===e?null:e,this.dataCaptureLayer)return this.startDataCapture(this.dataCaptureLayer)},this._handleNavigationSettingsInputChange=(e,t)=>{this.set(`${e}Threshold`,t)},this._handleNavigationSettingsToggle=e=>{this.viewModel.preserveAngle=e},this._handleOverlayLayerDeselect=e=>{const t=e.layer;t===this.dataCaptureLayer&&(this.stopDataCapture(),this.dataCaptureLayer=null),this.removeOverlayedGraphicsOnImage(`${t.id}`)},this._handleOverlayLayerSelect=e=>{const t=e.layer;this.viewModel.overlayMapFeatures(t,this.showMapFeatures),this.addHandles(c(()=>t.visible,()=>{this.viewModel.toggleOverlayMapFeatures(t.id,t.visible,this.showMapFeatures)}),`${se.overlayed}-${t.id}`)},this._highlight=e=>{const t=e.target?.dataset.objectid;t&&this.viewModel.highlight(t)},this._onAction=e=>{const{target:t}=e,{dataset:{action:i}}=t,{_previousAction:a}=this,s=a?.dataset.action,o=s?.includes("draw")??!1,n="select-feature"===s,r=s!==i;switch(i){case"draw-point":case"draw-polygon":case"draw-polyline":{a&&w(n,o&&r)&&(a.active=!1),t.active=!t.active;const e=i.replace("draw-","");this.viewModel.digitizeCreate(e),this._previousAction=t.active?t:null;break}case"save":this.viewModel.saveDrawing();break;case"select-feature":o&&(this._previousAction.active=!1),t.active=!t.active,this.viewModel.toggleSelection(t.active),this._previousAction=t.active?t:null;break;case"delete-feature":this.viewModel.digitizeDelete()}},this._onImageOverlayClosed=e=>{e.stopPropagation(),this.imageOverlaysOpened=!1},this._onShowCameraLocationsChanged=e=>{this.showCameraLocations=e},this._onShowMapFeaturesChanged=e=>{this.showMapFeatures=e},this._removeHighlight=()=>this.viewModel.removeHighlight(),this._restoreOverlays=async()=>Promise.all(this._overlayedLayers.map(e=>this.viewModel.overlayMapFeatures(e,this.showMapFeatures))),this._scaleNavigationTool=()=>{this._navigationToolExpanded=!this._navigationToolExpanded},this._sketchLoaderTask=null,this._settingsToggle=null,this._toggleImageNavigation=async e=>{const t=this.navigationMode;this._closeAllImageTools(),this.navigationMode=t!==e?e:null;const{activeViewer:i}=this.viewModel;if(!i)return;const{mode:a,preserveAngle:s}=this.viewModel;if("default"===a)if("directional"===this.navigationMode){const e=await this._loadNavigationSettings(),t="heading"===s||"both"===s,i="pitch"===s||"both"===s,{messages:a,messagesCommon:o}=this,n=new e({cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold,uiStrings:{configureNavigation:a.configureNavigation,preserveHeading:a.preserveHeading,preserveHeadingDescription:a.preserveHeadingDescription,preservePitch:a.preservePitch,preservePitchDescription:a.preservePitchDescription,settings:o.settings,thresholdLabel:a.thresholdLabel},onInputChange:this._handleNavigationSettingsInputChange,onToggle:this._handleNavigationSettingsToggle,preserveHeading:t,preservePitch:i});this._settingsToggle=new _({content:n,expandIcon:"configure"}),this.viewModel.activeViewer?.ui.add(this._settingsToggle,{position:"top-left"})}else this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))},this._toggleImageAttributes=p(this.viewModel.toggleImageAttributes.bind(this.viewModel)),this.navigate=async e=>{let t=null;try{const{currentNode:i}=this.viewModel;if(!i)throw new X;t=await this.viewModel.navigate(i,e)}catch(i){d(i)||l.getLogger(this).error("Error occurred while navigating",i),["NoImageInSequenceError","NoSequenceFoundError"].includes(i.name)&&this._set("noImageInSequenceError",!0)}return t},this.reset=()=>{this._closeAllImageTools(),this.viewModel.reset()},this._loadImageFromGallery=this._loadImageFromGallery.bind(this),this._registerGalleryItem=this._registerGalleryItem.bind(this),this._unregisterGalleryItem=this._unregisterGalleryItem.bind(this),this.loadImageFromSource=this.loadImageFromSource.bind(this),this.updateSuitabilities=this.updateSuitabilities.bind(this),this._handleVideoBrightnessChange=this._handleVideoBrightnessChange.bind(this),this._handleVideoContrastChange=this._handleVideoContrastChange.bind(this),this._handleBrightnessChange=this._handleBrightnessChange.bind(this),this._handleContrastChange=this._handleContrastChange.bind(this),this._handleSharpnessChange=this._handleSharpnessChange.bind(this),this._handleSuperimposeZOffsetChange=this._handleSuperimposeZOffsetChange.bind(this),this._toggleSuperimposeCameraLock=this._toggleSuperimposeCameraLock.bind(this),this._resetSuperimposeOffset=this._resetSuperimposeOffset.bind(this),this._resetVideoTools=this._resetVideoTools.bind(this),this._toggleEnhancementToolState=this._toggleEnhancementToolState.bind(this),this.announceDeprecation=()=>{n(l.getLogger(this),"Oriented Imagery Viewer","arcgis-oriented-imagery-viewer",{version:"5.0"})}}initialize(){this.addHandles([c(()=>[this.viewModel?.bestFeatureAngle,this._navigationTool],([e,t])=>{t&&this._updateNavigationTool(t)},g),c(()=>this.currentCoverageVisible,e=>this._onCurrentCoverageVisibilityChange(e)),c(()=>this.isAdditionalCoverageVisible,e=>this._onAdditionalCoverageVisibilityChange(e)),c(()=>this.isAdditionalPointSourcesVisible,e=>this._onAdditionalCameraLocationsVisibility(e)),c(()=>this.superimposeViewEnabled,e=>{e?(this._closeAllImageTools(),this.selectedGroup=null,this.shouldShowSelectedImage=!1,this.verticalFilterEnabled=!1):this._resetSuperimposeOffset()}),c(()=>({features:this.currentBestFeature,overlaysEnabled:this._imageOverlaysEnabled,showCameraLocations:this.showCameraLocations}),({overlaysEnabled:e,showCameraLocations:t})=>{e&&this.viewModel.overlayCameraLocations(t)},h),c(()=>({feature:this.currentBestFeature,overlaysEnabled:this._imageOverlaysEnabled,showMapFeatures:this.showMapFeatures}),async(e,t)=>{e.showMapFeatures!==t?.showMapFeatures&&await this.viewModel.toggleAllOverlayMapFeatures(e.showMapFeatures);const i=e.feature&&e.feature!==t?.feature,a=e.overlaysEnabled&&!t?.overlaysEnabled;(i||a)&&(i&&this.viewModel.removeAllOverlayMapFeatures(),e.overlaysEnabled&&(this.dataCaptureLayer&&this.stopDataCapture(),await this._restoreOverlays(),this.dataCaptureLayer&&(await this.startDataCapture(this.dataCaptureLayer),this._previousAction?.active&&(this._previousAction.active=!1,this._previousAction=null))))},g),m(()=>this.viewModel,"popup-open",async e=>{await(this.view?.openPopup(e))},u),m(()=>this.viewModel,"popup-close",()=>{this.view?.closePopup()},u),this._toggleImageAttributes])}loadDependencies(){return Promise.all([J(),Y({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),shell:()=>import("@esri/calcite-components/dist/components/calcite-shell"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider")}),B()])}destroy(){this._galleryController.abort(),this._galleryObserver.disconnect(),this.currentBestFeature=null}get accuracyParametersMissing(){return this.viewModel.accuracyParametersMissing}get activeLayer(){return r(l.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){r(l.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get activeVideoIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?t.videoPaused?"play":"pause":"play"}get activeAudioIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?.videoMuted?"sound-off":"sound"}get cameraHeadingThreshold(){return this.viewModel.cameraHeadingThreshold}set cameraHeadingThreshold(e){this.viewModel.cameraHeadingThreshold=e}get cameraPitchThreshold(){return this.viewModel.cameraPitchThreshold}set cameraPitchThreshold(e){this.viewModel.cameraPitchThreshold=e}get canNavigateSequentially(){return!!this.layer?.effectiveSequenceOrderField?.length}get currentBestFeature(){return this.viewModel.currentBestFeature}set currentBestFeature(e){this.viewModel.currentBestFeature=e}get currentCoverageVisible(){return this.viewModel.currentCoverageVisible}set currentCoverageVisible(e){this.viewModel.currentCoverageVisible=e}get dataCaptureLayer(){return this.viewModel.dataCaptureLayer}set dataCaptureLayer(e){this.viewModel.dataCaptureLayer=e}get depthImageNotSupported(){return this.viewModel.depthImageNotSupported}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get displayMessage(){return this.viewModel.displayMessage}get enhancementToolActive(){return"video"===this.viewModel.mode?this.videoEnhancementToolActive:this.imageEnhancementToolActive}set enhancementToolActive(e){"video"===this.viewModel.mode?this.videoEnhancementToolActive=e:this.imageEnhancementToolActive=e}get features(){return this.viewModel.features}get imagePointsInView(){return this.viewModel.imagePointsInView}get icon(){return"oriented-imagery-widget"}set icon(e){this._overrideIfSome("icon",e)}get imageGalleryEnabled(){return this.viewModel.imageGalleryEnabled}get imageLocationToolActive(){return this.viewModel.imageLocationToolState}set imageLocationToolActive(e){this.viewModel.imageLocationToolState=e}get invalidCameraHeading(){return this.viewModel.invalidCameraHeading}get isAdditionalCoverageVisible(){return this.viewModel.isAdditionalCoverageVisible}set isAdditionalCoverageVisible(e){this.viewModel.isAdditionalCoverageVisible=e}get isAdditionalPointSourcesVisible(){return this.viewModel.isAdditionalPointSourcesVisible}set isAdditionalPointSourcesVisible(e){this.viewModel.isAdditionalPointSourcesVisible=e}get mapImageConversionToolState(){return this.viewModel.mapImageConversionToolState}set mapImageConversionToolState(e){this.viewModel.setMapImageConversionToolState(e)}get measureType(){return this.viewModel.measureType}set measureType(e){this.viewModel.measureType=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get navigationMode(){return this.viewModel.navigationMode}set navigationMode(e){this.viewModel.navigationMode=e}get popupEnabled(){const{popupEnabled:e,state:t}=this.viewModel;return("image-loaded"===t||this.videoLoaded)&&e}get preloadMedia(){return this.viewModel.preloadMedia}set preloadMedia(e){this.viewModel.preloadMedia=e}get referencePoint(){return this.viewModel.referencePoint??null}get sketchViewModel(){return this.viewModel.sketch}get triangularMeasurementActive(){return this.viewModel.triangularMeasurementActive}set triangularMeasurementActive(e){this.viewModel.triangularMeasurementActive=e}get videoLoaded(){const{mode:e,videoElement:t,panoramicVideoLoaded:i}=this.viewModel;return("video"===e&&!0===t?.loaded||i)??!1}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set determineWorkflowForFeature(e){this.viewModel.determineWorkflowForFeature=e}get determineWorkflowForFeature(){return this.viewModel.determineWorkflowForFeature}get shouldShowSelectedImage(){return this.viewModel.shouldShowSelectedImage}set shouldShowSelectedImage(e){this.viewModel.shouldShowSelectedImage=e}get superimposeViewEnabled(){return this.viewModel.superimposeViewEnabled}set superimposeViewEnabled(e){this.viewModel.superimposeViewEnabled=e}get defaultSuperimposeCameraLockEnabled(){return this.viewModel.defaultSuperimposeCameraLockEnabled}set defaultSuperimposeCameraLockEnabled(e){this.viewModel.defaultSuperimposeCameraLockEnabled=e}set updateFootprint(e){this.viewModel.updateFootprint=e}get updateFootprint(){return this.viewModel.updateFootprint}get verticalFilterEnabled(){return this.viewModel.verticalFilterEnabled}set verticalFilterEnabled(e){this.viewModel.verticalFilterEnabled=e}_renderActionBar(){const{selectedGroup:e,superimposeViewEnabled:i}=this;if(i)return ae("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},ae("calcite-action-group",null,this._superimposeViewToggle()));const a=t();return ae("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},!e&&ae("calcite-action-group",null,this._searchGroupToggle(),this._overlaysGroupToggle(),this._navigationGroupToggle(),this._measurementsGroupToggle(),this._utilitiesGroupToggle()),this._renderGroupBackAction(a),"overlays"===e&&ae("calcite-action-group",null,this._currentFootprintToggle(),this._additionalFootprintToggle(),this._additionalPointSourcesToggle(),this._mapImageConversionToggle(),this._imageOverlaysToggle()),"navigation"===e&&ae("calcite-action-group",null,this._directionToolsToggle(),this._navigationToolToggle(),this._imageGalleryToggle()),"measurements"===e&&ae("calcite-action-group",null,this._measurementToolToggle()),"utilities"===e&&ae("calcite-action-group",null,this._imageEnhancementsToggle(),this._videoEnhancementsToggle(),this._superimposeViewToggle(),this._openPopupAction()),"search"===e&&ae("calcite-action-group",null,this._exploreImagesToggle(),this._exploreImages3DToggle(),this._showSelectedImageToggle()))}_renderGroupBackAction(e){return this.selectedGroup?ae("calcite-action",{bind:this,icon:e?"arrow-right":"arrow-left",key:"back-arrow",onclick:()=>this._toggleGroupSelection(null),text:this.messages.previous,title:this.messages.previous}):null}get _activeMeasurementHeading(){const{measureType:e,messages:t,triangularMeasurementActive:i}=this,{groundArea:a,heightAboveGround:s,groundDistance:o,triangulatedAreaHeading:n,triangulatedDistanceHeading:r}=t;if(i)return"area"===e?n:r;switch(e){case"area":return a;case"height":return s;default:return o}}_additionalFootprintToggle(){const{isAdditionalCoverageVisible:e,invalidCameraHeading:t,visibleElements:{additionalFootprintToggle:i}}=this;return i?ae("calcite-action",{active:e,bind:this,class:E.addCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleAdditionalCoverage,text:this.messages.additionalFootprints,title:this.messages.additionalFootprints}):null}_additionalPointSourcesToggle(){const{isAdditionalPointSourcesVisible:e,invalidCameraHeading:t,visibleElements:{additionalCameraLocationsToggle:i}}=this;return i?ae("calcite-action",{active:e,bind:this,class:E.addExpPoints,disabled:t,icon:"circle-area",onclick:this._toggleAdditionalCameraLocations,text:this.messages.additionalCameraLocations,title:this.messages.additionalCameraLocations}):null}get _measurementToggle(){const{viewModel:{state:e,measureType:t,currentBestFeatureMeasurementImage:i},triangularMeasurementActive:a,id:s}=this;if("image-loaded"!==e||!t||a&&!i)return;this._imageMeasurementToolsLoaderTask||this._loadImageMeasurementResources();const o=this._imageMeasurementToolsLoaderTask?.value;return o?ae("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:this._activeMeasurementHeading,id:`${s}-${t}-measurement`,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearMeasurements},ae(o,{measurementType:t,measurementUnitMessages:this.measurementUnitMessages,messages:this.messages,oiViewModel:this.viewModel})):null}get _renderRoot(){const{viewModel:{state:e},triangularMeasurementActive:t}=this;return ae("calcite-panel",{bind:this,class:t?E.viewerContainerMeasurement:E.viewerContainer,heading:this.visibleElements.header?this.messages.title:void 0,loading:e.includes("loading")&&!t},this.visibleElements.menu?this._renderActionBar():null,ae("calcite-shell",null,ae("calcite-panel",null,this._imageViewer,this._panoramicViewer,this._panoramicVideoViewer,this._videoViewer,this._messageBox,this.invalidCameraHeading?null:[this._imageGalleryPanel,this._renderNavigation,this._imageOverlaysPanel()],this._imageEnhancementTools,this._videoEnhancementTools,this._superimposeTools,this._renderSketch(),this._navigationUI),this._imageViewerTriangular,this._measurementToggle,this._locationToggle,this.invalidCameraHeading?this._renderWarning(this.messages.invalidCameraHeadingWarningTitle,this.messages.invalidCameraHeadingWarningDescription):null,this.depthImageNotSupported?this._renderWarning(this.messages.depthImageNotSupportedTitle,this.messages.depthImageNotSupportedDescription):null,this.noImageInSequenceError?this._renderWarning(this.messages.sequentialNavigationWarning,this.messages.sequentialNavigationWarning,this._closeImageSequenceAlert):null))}_currentFootprintToggle(){const{currentCoverageVisible:e,invalidCameraHeading:t}=this,{currentFootprintToggle:i}=this.visibleElements;return i?ae("calcite-action",{active:e,bind:this,class:E.currentCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleCurrentCoverage,text:this.messages.currentFootprint,title:this.messages.currentFootprint}):null}_exploreImagesToggle(){const{exploreImages:e}=this.messages;return this.visibleElements.exploreImages?ae("calcite-action",{active:!this.disabled,bind:this,icon:"oriented-imagery-widget",onclick:this._toggleExploreImages,text:e,title:e}):null}get _imageEnhancementTools(){const{enhancementToolActive:e,viewModel:{brightness:t,contrast:i,sharpness:a,state:s}}=this;return e&&"image-loaded"===s?ae("calcite-panel",{bind:this,class:E.imageEnhancementWrapper,closable:!0,closed:!e,heading:this.messages.imageEnhancement,key:this.messages.imageEnhancement,onCalcitePanelClose:this._toggleEnhancementToolState},ae("div",{class:E.imageEnhancementTools},K({title:this.messages.brightness,value:t,max:10,min:-10,ticks:5,handleChange:this._handleBrightnessChange}),K({title:this.messages.contrast,value:i,max:10,min:-10,ticks:5,handleChange:this._handleContrastChange}),K({title:this.messages.sharpness,value:a,max:1,min:0,ticks:.5,step:.1,handleChange:this._handleSharpnessChange})),ae("calcite-action",{bind:this,icon:"reset",onclick:this._resetImageTools,slot:"header-actions-end",text:this.messagesCommon.reset,title:this.messagesCommon.reset})):null}get _videoEnhancementTools(){const{enhancementToolActive:e,viewModel:{videoViewModel:t,mode:i},messages:{videoEnhancement:a,brightness:s,contrast:o},messagesCommon:{reset:n}}=this;return e&&"video"===i&&t?ae(Q,{brightness:t.videoBrightness,constrast:t.videoContrast,handleBrightnessChange:this._handleVideoBrightnessChange,handleContrastChange:this._handleVideoContrastChange,resetTools:this._resetVideoTools,uiStrings:{videoEnhancement:a,brightness:s,contrast:o,reset:n},videoEnhancementToolActive:e,onClose:this._toggleEnhancementToolState}):null}get _superimposeTools(){const{superimposeViewEnabled:e,view:t,viewModel:{state:i,mode:a},messages:{superimposeSettings:s,superimposeSliderTitle:o,superimposeSliderTooltip:n}}=this,r="panoramic"===a;return e&&"3d"===t?.type&&"image-loaded"===i?ae("calcite-panel",{bind:this,class:this.classes(E.imageEnhancementWrapper,E.superimposeTools),heading:s,key:"superimpose-settings"},ae("div",{class:E.imageEnhancementTools},K({title:o,tooltip:n,value:r?this._panoramicSuperimposeRadiusOffsetPercentage:this._defaultSuperimposeZOffsetPercentage,max:100,min:0,ticks:10,step:1,handleChange:this._handleSuperimposeZOffsetChange})),ae("calcite-action",{bind:this,icon:"reset",onclick:this._resetSuperimposeOffset,slot:"header-actions-end",text:this.messagesCommon.reset,title:this.messagesCommon.reset})):null}_imageEnhancementsToggle(){const{state:e,mode:t}=this.viewModel,{enhancementTool:i}=this.visibleElements;return i&&"video"!==t?ae("calcite-action",{active:this.enhancementToolActive,bind:this,disabled:"default"!==t||"image-loaded"!==e,icon:"sliders-horizontal",onclick:this._toggleEnhancementToolState,text:this.messages.imageEnhancement,title:this.messages.imageEnhancement}):null}_exploreImages3DToggle(){const{exploreImages3D:e}=this.messages,t="3d"!==this.view?.type||!this.layer?.verticalSearchRange;return this.visibleElements.exploreImages3D?ae("calcite-action",{active:this.verticalFilterEnabled,bind:this,disabled:t,icon:"i3DSearch",onclick:this._toggleVerticalSearchFilter,text:e,title:e}):null}_showSelectedImageToggle(){const{displayImages:e}=this.messages,t=this.viewModel.mode.includes("video");return this.visibleElements.showSelectedImage?ae("calcite-action",{active:this.shouldShowSelectedImage,bind:this,disabled:t,icon:"show-oriented-imagery",onclick:this._toggleShowSelectedImage,text:e,title:e}):null}_superimposeViewToggle(){const{superimposeView:e}=this.messages,{mode:t,accuracyParametersMissing:i}=this.viewModel,a=!this.superimposeViewEnabled&&("3d"!==this.view?.type||t.includes("video")||i);return this.visibleElements.superimpose?ae("calcite-action",{active:this.superimposeViewEnabled,bind:this,disabled:a,icon:"superimpose",onclick:this._toggleSuperimposeView,text:e,title:e}):null}_videoEnhancementsToggle(){const{mode:e}=this.viewModel,{videoEnhancement:t}=this.messages,{enhancementTool:i}=this.visibleElements;return i&&"video"===e?ae("calcite-action",{active:this.enhancementToolActive,bind:this,disabled:"video"!==e,icon:"sliders-horizontal",onclick:this._toggleEnhancementToolState,text:t,title:t}):null}get _imageGalleryPanel(){const{container:e,galleryOpened:t,imageGalleryEnabled:i}=this;return i&&t&&e?this._imageGalleryContext:null}get _imageGalleryContext(){const{galleryOpened:e,invalidCameraHeading:t}=this;return ae("calcite-panel",{bind:this,class:E.carousel,closable:!0,closed:!e,disabled:t,heading:this.messages.imageGallery,key:this.messages.imageGallery,onCalcitePanelClose:this._toggleImageGallery},ae("div",{class:E.carouselContainer},this._renderThumbnails))}_imageGalleryToggle(){const{imageGalleryEnabled:e,invalidCameraHeading:t,visibleElements:{imageGallery:i}}=this;return i?ae("calcite-action",{active:this.galleryOpened,bind:this,disabled:!e||t,icon:"images",onclick:this._toggleImageGallery,text:this.messages.imageGallery,title:this.messages.imageGallery}):null}get _imageOverlaysComponent(){const{_imageOverlayMessages:e,_imageOverlaysLoaderTask:t,_overlayedLayers:i,dataCaptureEnabled:a,dataCaptureLayer:o,imageOverlaysOpened:n,showCameraLocations:r,showMapFeatures:l,view:d,layer:c}=this;if(!c)return null;const g=c.imageGeometryField?.length?c.imageGeometryField:I,h=c.imageReferenceField?.length?c.imageReferenceField:S;t||(this._imageOverlaysLoaderTask=s(async()=>(await import("./OrientedImageryViewer/components/ImageOverlays.js")).default));const m=this._imageOverlaysLoaderTask?.value;return m?ae(m,{closed:!n,dataCaptureEnabled:a,dataCaptureLayer:o,imageGeometryField:g,imageReferenceField:h,messages:e,overlayedLayers:i,showCameraLocations:r,showMapFeatures:l,view:d,onDataCaptureLayerChanged:this._handleDataCaptureLayerChange,onFilterCapturedFeatures:this.viewModel.filterCapturedFeatures,onImageOverlaysClosed:this._onImageOverlayClosed,onLayerDeselected:this._handleOverlayLayerDeselect,onLayerSelected:this._handleOverlayLayerSelect,onShowCameraLocationsChanged:this._onShowCameraLocationsChanged,onShowMapFeaturesChanged:this._onShowMapFeaturesChanged}):null}get _navigationUI(){const{navigationMode:e,viewModel:t}=this,{mode:i,state:a}=t;if(e&&("default"===i||"panoramic"===i)&&"image-loaded"===a)return"directional"===e?"default"===i?ae(U,{cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold,currentNode:this.viewModel.currentNode,navigate:this._createNavigationTask,nodes:this.viewModel.navigationNodes,preserveAngle:this.viewModel.preserveAngle}):ae(Z,{currentNode:this.viewModel.currentNode,navigate:this._createNavigationTask,nodes:this.viewModel.navigationNodes}):ae(z,{layout:"horizontal",uiStrings:{end:this.messages.end,next:this.messages.next,previous:this.messages.previous,start:this.messages.start},onNext:this._navigateNext,onPrev:this._navigatePrevious})}get _imageOverlayMessages(){return{...this.messages,...this.messagesSketch}}get _imageSketchToolsMessages(){return{...this.messagesCommon,...this.messagesSketch}}_imageOverlaysPanel(){const{imageOverlaysOpened:e}=this,t=this.classes({[E.imageOverlaysContainer]:!0,[ee.hidden]:!e||!this._imageOverlaysEnabled});return ae("div",{class:t,key:this.messages.imageOverlays},this._imageOverlaysComponent)}_imageOverlaysToggle(){const{imageOverlaysOpened:e,invalidCameraHeading:t,visibleElements:{imageOverlays:i}}=this;return i?ae("calcite-action",{active:e,bind:this,disabled:!this._imageOverlaysEnabled||t,icon:"layers",onclick:this._toggleImageOverlays,text:this.messages.imageOverlays,title:this.messages.imageOverlays}):null}get _imageOverlaysEnabled(){return this.viewModel.overlayGraphicsEnabled}get _imageViewer(){const{displayMessage:e,loadImageViewer:t,mode:i,clickAction:a,state:s}=this.viewModel,o=null!=e||"default"!==i||s.includes("loading");return ae(W,{afterCreate:t,clickAction:a,visible:!o})}get _imageViewerTriangular(){const{messages:e,triangularMeasurementActive:t}=this,{displayMessage:i,storeImageMeasurementViewer:a,storePanoramicMeasurementViewer:s,mode:o,state:n,clickAction:r}=this.viewModel,l=null!=i||"none"===o||"video"===o,d=this.classes({[E.viewer]:!l,[E.viewerHidden]:l});return t?ae("calcite-panel",{class:E.viewerContainerMeasurement,heading:e.measurementViewerHeading,loading:n.includes("loading")},ae("calcite-panel",{bind:this,class:d},"default"===o?ae(W,{afterCreate:a,clickAction:r,uiStrings:e}):ae(M,{afterCreate:s,clickAction:r,uiStrings:e}))):null}_utilitiesGroupToggle(){const{utilityTools:e}=this.messages;return this.visibleElements.utilityTools?ae("calcite-action",{bind:this,icon:"tools",key:"utilities-group-toggle",onclick:()=>this._toggleGroupSelection("utilities"),text:e,title:e}):null}_searchGroupToggle(){const{searchTools:e}=this.messages;return this.visibleElements.searchTools?ae("calcite-action",{bind:this,icon:"search",key:"search-group-toggle",onclick:()=>this._toggleGroupSelection("search"),text:e,title:e}):null}get _videoViewer(){const{mode:e,loadVideoViewer:t,videoViewModel:i}=this.viewModel,{control:a,reset:s}=this.messagesCommon,{mute:o,unmute:n}=this.messages,r="video"!==e,l=this.classes({[E.viewer]:!r,[E.viewerHidden]:r}),d="esri-image-viewer",c=`${d}__slider-container`;return ae("calcite-panel",{bind:this,class:l},ae("calcite-panel",{afterCreate:t,class:this.classes(ee.widget,d)}),ae("calcite-block",{class:c,expanded:!0},ae("calcite-slider",{bind:this,labelHandles:!0,labelTicks:!0,max:i?.videoDuration,minLabel:"0",value:i?.currentTime??0,onCalciteSliderChange:this._handleVideoSeek})),ae("calcite-action-bar",{expandDisabled:!0,layout:"horizontal"},ae("calcite-action-group",null,ae("calcite-action",{bind:this,icon:this.activeVideoIcon,onclick:()=>i?.playVideoHandler(),text:"Play",title:i?.videoPaused?a.play:a.pause})),ae("calcite-action-group",null,ae("calcite-action",{bind:this,icon:"refresh",onclick:()=>i?.rewindVideoHandler(),text:"Rewind",title:s})),ae("calcite-action-group",null,ae("calcite-action",{bind:this,icon:this.activeAudioIcon,onclick:()=>i?.toggleAudio(),text:"Audio",title:i?.videoMuted?o:n}))))}get _locationToggle(){const{viewModel:{state:e,groundCoordinates:t,groundCoordinatesAccuracy:i,triangulatedPoint:a},imageLocationToolActive:s,triangularMeasurementActive:o,messages:{groundLocation:n,triangulatedLocationHeading:r}}=this;if("image-loaded"!==e||!t||!s)return;let l=t;if(o){if(!a)return;l=a}return ae("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:o?r:n,id:n,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearImageLocation},ae(q,{accuracy:i,groundCoordinates:l,messages:this.messages}))}_mapImageConversionToggle(){const{mapImageConversionToolState:e,viewModel:{state:t,disabled:i},videoLoaded:a,invalidCameraHeading:s,visibleElements:{mapImageConversionTool:o}}=this,n=!("video"!==this.viewModel.mode||!a||!this.viewModel.videoViewModel?.videoPaused),r="panoramic-video"===this.viewModel.mode&&this.viewModel.panoramicVideoLoaded&&this.viewModel.panoramicVideoPaused;return o?ae("calcite-action",{active:e,bind:this,disabled:"image-loaded"!==t&&!n&&!r||s||i,icon:"image-pin",onclick:this._toggleMapImageConversionToolState,text:this.messages.mapImageConversionTool,title:this.messages.mapImageConversionTool}):null}_measurementToolToggle(){const{measureType:e,viewModel:t,accuracyParametersMissing:i,messages:a,triangularMeasurementActive:s}=this,{state:o}=t,{groundDistance:n,groundArea:r,heightAboveGround:l,groundLocation:d,triangulatedDistanceHeading:c,triangulatedAreaHeading:g,triangulatedLocationHeading:h}=a,m="image-loaded"!==o||i;return ae("calcite-action-group",{key:"measurement-tools",scale:"m"},ae("calcite-action",{active:"distance"===e&&!s,bind:this,disabled:m,icon:"measure-line",key:"distance-measurement",onclick:e=>this._toggleMeasurementSketch(e,"distance"),text:n,title:n}),ae("calcite-action",{active:"area"===e&&!s,bind:this,disabled:m,icon:"measure-area",key:"area-measurement",onclick:e=>this._toggleMeasurementSketch(e,"area"),text:r,title:r}),ae("calcite-action",{active:"height"===e,bind:this,disabled:m,icon:"measure-building-height-top-base",key:"height-measurement",onclick:e=>this._toggleMeasurementSketch(e,"height"),text:l,title:l}),ae("calcite-action",{active:!!this.imageLocationToolActive&&!s,bind:this,disabled:m,icon:"pin-tear",key:"surface-location",onclick:this._toggleLocationTool,text:d,title:d}),ae("calcite-action",{active:!!s&&this.imageLocationToolActive,bind:this,disabled:m,icon:"dual-image-location",key:"triangular-location",onclick:this._toggleTriangularLocation,text:h,title:h}),ae("calcite-action",{active:!!s&&"distance"===this.measureType,bind:this,disabled:m,icon:"dual-image-distance",key:"triangular-distance",onclick:this._toggleTriangularDistanceMeasurements,text:c,title:c}),ae("calcite-action",{active:!!s&&"area"===this.measureType,bind:this,disabled:m,icon:"dual-image-area",key:"triangular-area",onclick:this._toggleTriangularAreaMeasurements,text:g,title:g}))}get _messageBox(){const{messages:e,viewModel:{displayMessage:t,mode:a}}=this;if(!t||"video"===a)return null;const{data:s,key:o,map:n}=t,r=`${n?i(e[o],n):e[o]}`;return ae("span",{class:E.messageBox},s?`${r} ${s}`:r)}async _loadNavigationSettings(){return this._navigationSettingsLoaderTask||(this._navigationSettingsLoaderTask=s(async()=>(await import("./OrientedImageryViewer/components/NavigationSettings.js")).default)),await this._navigationSettingsLoaderTask.promise}_measurementsGroupToggle(){const{measurementTools:e}=this.messages,{state:t,accuracyParametersMissing:i}=this.viewModel,a="image-loaded"!==t||i;return this.visibleElements.measurementTools?ae("calcite-action",{bind:this,disabled:a,icon:"measure-line",key:"measurements-group-toggle",onclick:()=>this._toggleGroupSelection("measurements"),text:e,title:e}):null}_navigationGroupToggle(){const{imageNavigation:e}=this.messages;return this.visibleElements.imageNavigationTools?ae("calcite-action",{bind:this,icon:"absolute-direction",key:"navigation-group-toggle",onclick:()=>this._toggleGroupSelection("navigation"),text:e,title:e}):null}_navigationToolToggle(){const{state:e}=this.viewModel,{visibleElements:{navigationTool:t},videoLoaded:i}=this;return t?ae("calcite-action",{active:this.navigationToolActive,bind:this,disabled:"image-loaded"!==e&&!i||this.invalidCameraHeading,icon:"explore",onclick:this._toggleNavigationTool,text:this.messages.navigationTool,title:this.messages.navigationTool}):null}_directionToolsToggle(){const{messages:e,viewModel:t,visibleElements:i}=this,{directionalNavigation:a,sequentialNavigation:s}=i,{state:o}=t,{directionalNavigation:n,directionalNavigationDescription:r,sequentialNavigation:l,sequentialNavigationDescription:d}=e;return ae("calcite-action-group",{key:"navigation-tools",scale:"m"},a?ae("calcite-action",{active:"directional"===this.navigationMode,bind:this,disabled:"image-loaded"!==o||this.invalidCameraHeading,icon:"directional-navigation",onclick:()=>{this._toggleImageNavigation("directional")},text:r,title:n}):null,s?ae("calcite-action",{active:"sequential"===this.navigationMode,bind:this,disabled:"image-loaded"!==o||this.invalidCameraHeading||!this.canNavigateSequentially,icon:"sequential-navigation",onclick:()=>{this._toggleImageNavigation("sequential")},text:d,title:l}):null)}_overlaysGroupToggle(){const{overlays:e}=this.messages;return this.visibleElements.overlays?ae("calcite-action",{bind:this,icon:"oriented-imagery-overlays",key:"overlays-group-toggle",onclick:()=>this._toggleGroupSelection("overlays"),text:e,title:e}):null}_openPopupAction(){const{showPopupsAction:e}=this.visibleElements;return e?ae("calcite-action",{bind:this,disabled:!this.popupEnabled,icon:"popup",onclick:this._toggleImageAttributes,text:this.messages.showPopups,title:this.messages.showPopups}):null}get _panoramicVideoViewer(){const{displayMessage:e,loadPanoramicVideoViewer:t,mode:i,clickAction:a,state:s,currentBestFeature:o}=this.viewModel,n=o?.attributes.imagePath,r=null!=e||"panoramic-video"!==i||s.includes("loading")||!n;return ae(T,{afterCreate:t,clickAction:a,oiViewModel:this.viewModel,videoSource:n,visible:!r})}get _panoramicViewer(){const{displayMessage:e,loadPanoramicViewer:t,mode:i,clickAction:a,state:s}=this.viewModel,o=null!=e||"panoramic"!==i||s.includes("loading");return ae(M,{afterCreate:t,clickAction:a,visible:!o})}get noImageInSequenceError(){return this._get("noImageInSequenceError")??!1}_activateTriangulatedImageLocationTool(){this.navigationToolActive=!0,this.imageLocationToolActive=!0}_activateTriangulatedImageLocationWorkflow(e,t){this._closeAllImageTools(),this.imageLocationToolActive=!0,this.triangularMeasurementActive=!e,this.navigationToolActive=!!t||!t}_closeImageToolsAndToggleNavigation(e,t){this._closeAllImageTools(),this.triangularMeasurementActive=!e,this.navigationToolActive=!t}_resetMeasureTypeAndActivateImageLocationTool(){this.measureType=null,this.imageLocationToolActive=!0}_closeAllImageTools(){this.enhancementToolActive=!1,this.navigationToolActive=!1,this.imageOverlaysOpened=!1,this.galleryOpened=!1,this.measureType=null,this.imageLocationToolActive=!1,this.navigationMode=null,this.triangularMeasurementActive=!1,this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))}_handleBrightnessChange(e){this.viewModel.brightness=e.currentTarget.value??0}_handleVideoBrightnessChange(e){this.viewModel.videoViewModel?.handleVideoBrightnessChange(e.target.value)}_handleContrastChange(e){this.viewModel.contrast=e.currentTarget.value??0}_handleVideoContrastChange(e){this.viewModel.videoViewModel?.handleVideoContrastChange(e.target.value)}_handleVideoSeek(e){const t=this.viewModel?.videoElement?.content;t&&(t.currentTime=e.target.value,t.play())}_handleSharpnessChange(e){this.viewModel.sharpness=e.currentTarget.value??0}_handleSuperimposeZOffsetChange(e){const t=e.currentTarget.value??0;if("default"===this.viewModel.mode)return this._defaultSuperimposeZOffsetPercentage=t,void this.viewModel.setDefaultSuperimposeZOffsetPercentage(100-t);this._panoramicSuperimposeRadiusOffsetPercentage=t,this.viewModel.setPanoramicSuperimposeRadiusPercentage(100-t)}_lazyLoadImage(e,t){e.forEach(async e=>{if(e.isIntersecting){const a=e.target,s=a.getAttribute("data-src"),o=a.getAttribute("data-rotation"),n=a.getAttribute("data-objectid"),r=o?parseFloat(o)%360:0,{layer:c,_galleryController:{signal:g}}=this;if(!s||!n)return;let h;try{h=G(s)?await N(c,n,{signal:g}):await D(s,{signal:g})}catch(i){d(i)||l.getLogger("esri.widgets.OrientedImageryViewer").error("#lazyLoadImage()",i)}finally{t.unobserve(a)}if(!h)return;H(h,a,r)}})}_loadImageFromGallery(e){const{target:t}=e;if(!t)return;const i=t.getAttribute("data-objectid");i&&this.viewModel.currentBestFeature?.attributes.objectId!==Number(i)&&this.viewModel.selectBestFeature(i)}_loadImageMeasurementResources(){this._imageMeasurementToolsLoaderTask=s(async()=>{const{default:e}=await import("./OrientedImageryViewer/components/ImageMeasurementWidget.js");return e})}_loadSketchResources(){this._sketchLoaderTask=s(async()=>(await import("./OrientedImageryViewer/components/SketchTools.js")).default)}_onAdditionalCoverageVisibilityChange(e){this.viewModel.setAdditionalCoverageVisibility(e)}_onAdditionalCameraLocationsVisibility(e){this.viewModel.setAdditionalCameraLocationsVisibility(e)}_onCurrentCoverageVisibilityChange(e){this.viewModel.setCurrentCoverageVisibility(e)}_registerGalleryItem(e){this._galleryObserver.observe(e)}_renderWarning(e,t,i){const{viewModel:{state:a}}=this;return"image-loaded"===a?ae(R,{icon:"exclamation-mark-triangle-f",kind:"warning",message:t,open:!0,title:e,tooltip:t,topLayerDisabled:this.topLayerDisabled,onClose:i}):null}get _renderNavigation(){const{viewModel:{sectorData:e,navigatorCurrentBestFeature:t,currentBestFeature:i,state:s}}=this;if(!this.container||!i)return null;let o,n,r,l,d;if(t){const{x:e,y:i,direction:a}=t,[s,c,g,h]=A[a];o=`M ${e} ${i} L ${s} ${c} A ${L[2]} ${L[2]} 0 0 1 ${g} ${h} Z`,n=e,l=i,r=A[a][4],d=A[a][5]}const c=e=>{const t=e.target.dataset?.sector;t&&this.viewModel.handleSectorClick(+t)},g=e=>{const t=e.target.dataset;if(!t)return;const{featureIndexInSector:i,sector:a}=t;i&&a&&this.viewModel.handleFeatureClick({sector:a,featureIndexInSector:+i})},h=e=>{e.removeEventListener("click",g)},m=i.attributes.objectId,u=e?.map(e=>e?.items).filter(Boolean).flatMap(e=>e?.map(({x:e,y:t,objectID:i,featureIndexInSector:a,sector:s})=>ae("circle",{afterRemoved:h,class:this.classes(E.feature,{selected:m===i}),cx:e,cy:t,"data-feature-index-in-sector":a,"data-sector":s,key:`${E.feature}-${i}`,onclick:g,r:k}))),p=e=>{e.removeEventListener("click",c)},v=this.classes({[E.navigationWrapper]:!0,[E.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&("image-loaded"===s||this.videoLoaded)?ae("div",{bind:this,class:v,key:this.messages.navigationTool},ae("svg",{afterCreate:e=>this._storeNavigationToolReference(e),class:a()?O:E.rotateWithAnimation,focusable:"false",height:V,role:"img",width:V,xmlns:"http://www.w3.org/2000/svg"},ae("defs",null,ae("linearGradient",{gradientUnits:"userSpaceOnUse",id:`${this.id}-coverage-fill`,x1:n,x2:r,y1:l,y2:d},ae("stop",{class:E.navigationPathOffset0,offset:0}),ae("stop",{class:E.navigationPathOffset1,offset:1}))),ae("g",null,ae("circle",{class:this.classes(E.sector,E.outerSector),cx:L[3],cy:L[3],onclick:this._scaleNavigationTool,r:L[3]}),ae("circle",{class:E.sector,cx:L[3],cy:L[3],r:L[2]}),ae("circle",{class:E.sector,cx:L[3],cy:L[3],r:L[1]}),ae("circle",{class:E.sector,cx:L[3],cy:L[3],r:L[0]}),ae("path",{class:E.pointer,d:"M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z",key:`${E.pointer}-west`}),ae("path",{class:this.classes(E.pointer,E.north),d:"M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z",key:`${E.pointer}-north`}),ae("path",{class:E.pointer,d:"M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z",key:`${E.pointer}-east`}),ae("path",{class:E.pointer,d:"M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z",key:`${E.pointer}-south`}),ae("path",{class:this.classes(E.sector,E.sectorSeparator),d:"M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076",key:E.sectorSeparator}),C([L[2],L[1],L[0]],L[3],L[3]).map((t,i)=>ae("path",{afterRemoved:p,class:this.classes(E.sector,e?.[i]?.length?E.sectorEnabled:E.sectorDisabled),d:t,"data-sector":`${i}`,key:`${E.sector}-${i}`,onclick:c})),ae("path",{class:this.classes(E.sector,E.sectorCross),d:"M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53",key:E.sectorCross}),u,i.attributes.cameraPitch>=5&&o?ae("path",{class:E.selectedFeaturePath,d:o,fill:`url(#${this.id}-coverage-fill)`,key:E.selectedFeaturePath}):null))):null}_renderSketch(){const{dataCaptureLayer:e,imageOverlaysOpened:t}=this;if(!e||t)return null;if(this._sketchLoaderTask||this._loadSketchResources(),!this._sketchLoaderTask?.value)return null;const{geometryType:i}=e,a="point"===i?"pin":"polyline"===i?"line":"polygon",s=this._sketchLoaderTask.value;return ae("div",{class:E.sketchTools},ae(s,{icon:a,messages:this._imageSketchToolsMessages,type:i,onAction:this._onAction}))}get _renderThumbnails(){const{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?ae("div",{class:E.carouselContent},t?.items.map(({url:t,objectId:i,rotation:a},s)=>ae("div",{class:`${E.carouselItemWrapper}${e.attributes.objectId===i?"--selected":""}`,key:`${E.carouselItemWrapper}-${s}`},ae("canvas",{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${i}`,class:E.carouselItem,"data-objectid":`${i}`,"data-rotation":`${a}`,"data-src":t,onclick:this._loadImageFromGallery,onmouseenter:this._highlight,onmouseleave:this._removeHighlight})))):null}_resetImageTools(){this.viewModel.sharpness=this.viewModel.brightness=this.viewModel.contrast=0}_resetVideoTools(){this.viewModel.videoViewModel?.resetVideoEnhancementTools()}_storeNavigationToolReference(e){this._navigationTool=e}_toggleAdditionalCameraLocations(){this.isAdditionalPointSourcesVisible=!this.isAdditionalPointSourcesVisible}_toggleAdditionalCoverage(){this.isAdditionalCoverageVisible=!this.isAdditionalCoverageVisible}_toggleCurrentCoverage(){this.currentCoverageVisible=!this.currentCoverageVisible}_toggleShowSelectedImage(){this.shouldShowSelectedImage=!this.shouldShowSelectedImage,this._toggleDisabledViewer(this.shouldShowSelectedImage)}_resetSuperimposeOffset(){if("default"===this.viewModel.mode)return this._defaultSuperimposeZOffsetPercentage=100,void this.viewModel.setDefaultSuperimposeZOffsetPercentage(0);this._panoramicSuperimposeRadiusOffsetPercentage=100,this.viewModel.setPanoramicSuperimposeRadiusPercentage(0)}_toggleSuperimposeCameraLock(){this.viewModel.updateDefaultSuperimposeCameraLock(!this.defaultSuperimposeCameraLockEnabled)}_toggleSuperimposeView(){this.superimposeViewEnabled=!this.superimposeViewEnabled}_toggleVerticalSearchFilter(){this.verticalFilterEnabled=!this.verticalFilterEnabled,this._toggleDisabledViewer(this.verticalFilterEnabled)}_toggleDisabledViewer(e){e&&(this.disabled=!1)}_toggleEnhancementToolState(e){e.stopPropagation();const t=this.enhancementToolActive;this._closeAllImageTools(),this.enhancementToolActive=!t}_toggleExploreImages(){this.disabled=!this.disabled,this.disabled&&(this.shouldShowSelectedImage=!1,this.verticalFilterEnabled=!1)}_toggleGroupSelection(e){this.selectedGroup=e}_toggleImageOverlays(e){e.stopPropagation();const t=this.imageOverlaysOpened;this._closeAllImageTools(),this.imageOverlaysOpened=!t}_toggleImageGallery(e){e.stopPropagation();const t=this.galleryOpened;this._closeAllImageTools(),this.galleryOpened=!!this.imageGalleryEnabled&&!t}_toggleLocationTool(e){const t=this.imageLocationToolActive,i=this.triangularMeasurementActive&&t;this._closeAllImageTools(),this.imageLocationToolActive=i||!t,e.stopPropagation()}_toggleMeasurementSketch(e,t){e.stopPropagation();const i=this.measureType,a=this.triangularMeasurementActive;this._closeAllImageTools(),this.measureType=i!==t||a?t:null,this.measureType===t&&(this.viewModel.displayNewMeasurementButton=!0)}_toggleNavigationTool(){const e=this.navigationToolActive;this._closeAllImageTools(),this.navigationToolActive=!e}_toggleMapImageConversionToolState(){this.mapImageConversionToolState=!this.mapImageConversionToolState}_toggleTriangularAreaMeasurements(){this._toggleTriangularMeasurements("area")}_toggleTriangularDistanceMeasurements(){this._toggleTriangularMeasurements("distance")}_toggleTriangularLocation(){const e=this.triangularMeasurementActive,t=this.navigationToolActive;e?null===this.measureType?this.imageLocationToolActive?this._closeImageToolsAndToggleNavigation(e,t):this._activateTriangulatedImageLocationTool():this._resetMeasureTypeAndActivateImageLocationTool():this._activateTriangulatedImageLocationWorkflow(e,t)}_toggleTriangularMeasurements(e){const t=this.triangularMeasurementActive,i=this.viewModel.measureType,a=this.navigationToolActive;t?e===i?(this._closeAllImageTools(),this.triangularMeasurementActive=!t,this.navigationToolActive=!a):(this.imageLocationToolActive=!1,this.measureType=e):(this._closeAllImageTools(),this.measureType=e,this.triangularMeasurementActive=!t,this.navigationToolActive=!!a||!a)}_unregisterGalleryItem(e){this._galleryObserver.unobserve(e)}_updateNavigationTool(e){const{previousFeatureAngle:t,bestFeatureAngle:i}=this.viewModel,a=(i-t+540)%360-180;e.style.setProperty(P,`${t}deg`),e.style.setProperty(F,`${t+a}deg`)}async loadBestImage(e,t){return this.viewModel.loadBestImage(e,t)}loadImageFromSource(e,t,i){return"default"===e?this.viewModel.loadMediaSource(t,i):this.viewModel.loadPanoramicMediaSource(t,i)}async overlayMapFeatures(e,t){return this.removeHandles(`${se.overlayed}-${e.id}`),this.addHandles(c(()=>e.visible,()=>{this.viewModel.toggleOverlayMapFeatures(e.id,e.visible,this.showMapFeatures)}),`${se.overlayed}-${e.id}`),this._overlayedLayers.add(e),this.viewModel.overlayMapFeatures(e,t&&this.showMapFeatures)}async plotMapPoint(e){return this.viewModel.plotMapPoint(e)}plotReferencePointOnGround(e){this.viewModel.plotReferencePointOnGround(e)}plotReferencePointOnImage(e){this.viewModel.plotReferencePointOnImage(e)}removeOverlayedGraphicsOnImage(e){this.removeHandles(`${se.overlayed}-${e}`),this._overlayedLayers.remove(this._overlayedLayers.find(t=>t.id===e)),this.viewModel.removeOverlayedGraphicsOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return ae("div",{class:this.classes(ee.widget,x)},this._renderRoot)}async showImageByObjectId(e,t){return this.viewModel.showImageByObjectId(e,t)}async startDataCapture(e){return this.viewModel.startDataCapture(e)}async stopDataCapture(e){return this.viewModel.stopDataCapture(e)}updateSuitabilities(e){this.viewModel.updateSuitabilities(e)}};e([v({readOnly:!0})],oe.prototype,"accuracyParametersMissing",null),e([v()],oe.prototype,"activeLayer",null),e([v()],oe.prototype,"activeVideoIcon",null),e([v()],oe.prototype,"activeAudioIcon",null),e([v()],oe.prototype,"cameraHeadingThreshold",null),e([v()],oe.prototype,"cameraPitchThreshold",null),e([v()],oe.prototype,"canNavigateSequentially",null),e([v()],oe.prototype,"currentBestFeature",null),e([v()],oe.prototype,"currentCoverageVisible",null),e([v()],oe.prototype,"dataCaptureEnabled",void 0),e([v()],oe.prototype,"dataCaptureLayer",null),e([v()],oe.prototype,"depthImageNotSupported",null),e([v()],oe.prototype,"disabled",null),e([v()],oe.prototype,"enhancementToolActive",null),e([v()],oe.prototype,"features",null),e([v()],oe.prototype,"imagePointsInView",null),e([v()],oe.prototype,"galleryOpened",void 0),e([v()],oe.prototype,"icon",null),e([v()],oe.prototype,"imageEnhancementToolActive",void 0),e([v()],oe.prototype,"videoEnhancementToolActive",void 0),e([v({readOnly:!0})],oe.prototype,"imageGalleryEnabled",null),e([v()],oe.prototype,"imageLocationToolActive",null),e([v()],oe.prototype,"imageOverlaysOpened",void 0),e([v({readOnly:!0})],oe.prototype,"invalidCameraHeading",null),e([v()],oe.prototype,"isAdditionalCoverageVisible",null),e([v()],oe.prototype,"isAdditionalPointSourcesVisible",null),e([v()],oe.prototype,"mapImageConversionToolState",null),e([v()],oe.prototype,"measureType",null),e([v()],oe.prototype,"layer",null),e([v()],oe.prototype,"navigationToolActive",void 0),e([v()],oe.prototype,"navigationMode",null),e([te(f()),v({type:j})],oe.prototype,"viewModel",void 0),e([v(),ie("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],oe.prototype,"messages",void 0),e([v(),ie("esri/core/t9n/Units")],oe.prototype,"measurementUnitMessages",void 0),e([v(),ie("esri/t9n/common")],oe.prototype,"messagesCommon",void 0),e([v(),ie("esri/widgets/Sketch/t9n/Sketch")],oe.prototype,"messagesSketch",void 0),e([v()],oe.prototype,"pixelMeasurementUnit",void 0),e([v()],oe.prototype,"pixelAreaMeasurementUnit",void 0),e([v({readOnly:!0})],oe.prototype,"popupEnabled",null),e([v()],oe.prototype,"preloadMedia",null),e([v()],oe.prototype,"referencePoint",null),e([v()],oe.prototype,"selectedGroup",void 0),e([v()],oe.prototype,"showCameraLocations",void 0),e([v()],oe.prototype,"showMapFeatures",void 0),e([te(["create","delete","redo","undo","update"]),v({readOnly:!0})],oe.prototype,"sketchViewModel",null),e([v()],oe.prototype,"triangularMeasurementActive",null),e([v()],oe.prototype,"videoLoaded",null),e([v()],oe.prototype,"view",null),e([v({type:$,nonNullable:!0})],oe.prototype,"visibleElements",void 0),e([v()],oe.prototype,"determineWorkflowForFeature",null),e([v()],oe.prototype,"shouldShowSelectedImage",null),e([v()],oe.prototype,"superimposeViewEnabled",null),e([v()],oe.prototype,"defaultSuperimposeCameraLockEnabled",null),e([v()],oe.prototype,"updateFootprint",null),e([v()],oe.prototype,"verticalFilterEnabled",null),e([v()],oe.prototype,"_defaultSuperimposeZOffsetPercentage",void 0),e([v()],oe.prototype,"_panoramicSuperimposeRadiusOffsetPercentage",void 0),e([v()],oe.prototype,"_activeMeasurementHeading",null),e([v()],oe.prototype,"_imageOverlaysLoaderTask",void 0),e([v()],oe.prototype,"_imageMeasurementToolsLoaderTask",void 0),e([v()],oe.prototype,"_navigationSettingsLoaderTask",void 0),e([v()],oe.prototype,"_navigationTask",void 0),e([v()],oe.prototype,"_measurementToggle",null),e([v()],oe.prototype,"_renderRoot",null),e([v()],oe.prototype,"_imageEnhancementTools",null),e([v()],oe.prototype,"_videoEnhancementTools",null),e([v()],oe.prototype,"_superimposeTools",null),e([v()],oe.prototype,"_imageGalleryPanel",null),e([v()],oe.prototype,"_imageGalleryContext",null),e([v()],oe.prototype,"_imageOverlaysComponent",null),e([v()],oe.prototype,"_navigationUI",null),e([v()],oe.prototype,"_imageOverlayMessages",null),e([v()],oe.prototype,"_imageSketchToolsMessages",null),e([v()],oe.prototype,"_imageOverlaysEnabled",null),e([v()],oe.prototype,"_imageViewer",null),e([v()],oe.prototype,"_imageViewerTriangular",null),e([v()],oe.prototype,"_videoViewer",null),e([v()],oe.prototype,"_locationToggle",null),e([v()],oe.prototype,"_messageBox",null),e([v()],oe.prototype,"_navigationToolExpanded",void 0),e([v()],oe.prototype,"_navigationTool",void 0),e([v()],oe.prototype,"_panoramicVideoViewer",null),e([v()],oe.prototype,"_panoramicViewer",null),e([v({readOnly:!0})],oe.prototype,"noImageInSequenceError",null),e([v()],oe.prototype,"_renderNavigation",null),e([v()],oe.prototype,"_renderThumbnails",null),e([v()],oe.prototype,"_sketchLoaderTask",void 0),oe=e([y("esri.widgets.OrientedImageryViewer")],oe);const ne=oe;export{ne as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../core/Collection.js";import{EventedAccessor as s}from"../../core/Evented.js";import{watch as i,initial as l}from"../../core/reactiveUtils.js";import{property as o,subclass as a}from"../../core/accessorSupport/decorators.js";import{findLayerListMode as r}from"../LayerList/support/layerListUtils.js";import d from"./ListItem.js";const m={map:"map",layerListMode:"layer-list-mode"},n="hide",h=e.ofType(d);let c=class extends s{constructor(t){super(t),this.checkPublishStatusEnabled=!1,this.listItemCreatedFunction=null,this.listModeDisabled=!1,this.tableItems=new h,this.map=null}initialize(){this.addHandles([i(()=>[this.tables,this.map?.allTables.toArray()],()=>this._compileList(),l),i(()=>[this.map?.loaded,this.listItemCreatedFunction,this.checkPublishStatusEnabled,this.listModeDisabled],()=>this._recompileList())],m.map)}destroy(){this._removeAllItems(),this.map=null,this.tables=null}get tables(){return this.map?.allTables}set tables(t){this._overrideIfSome("tables",t)}get state(){const{map:t,tables:e}=this;if(!t)return e?"ready":"disabled";const s=t?.loadStatus;return"string"==typeof s?"loaded"===s?"ready":"loading"===s?"loading":"disabled":"ready"}get totalItems(){return this.tableItems.length}triggerAction(t,e){t&&!t.disabled&&this.emit("trigger-action",{action:t,item:e})}_removeAllItems(){this.tableItems.destroyAll()}_getViewableTables(t){return t?this.listModeDisabled?t:t.filter(t=>r(t)!==n):void 0}_watchTablesListMode(t){this.removeHandles(m.layerListMode),t&&!this.listModeDisabled&&this.addHandles(i(()=>t.filter(t=>"listMode"in t).map(t=>t.listMode).toArray(),()=>this._compileList()),m.layerListMode)}_compileList(){const{tables:t}=this;this._watchTablesListMode(t);const e=this._getViewableTables(t);e?.length?(this._createNewItems(e),this._removeItems(e),this._sortItems(e)):this._removeAllItems()}_createNewItems(t){const{tableItems:e,listItemCreatedFunction:s,checkPublishStatusEnabled:i}=this;t.forEach(t=>{e.some(e=>e.layer===t)||e.add(new d({checkPublishStatusEnabled:i,layer:t,listItemCreatedFunction:s}))})}_removeItems(t){const{tableItems:e}=this;e.forEach(s=>{if(!s)return;const i=t?.find(t=>s.layer===t);i||(e.remove(s),s.destroy())})}_sortItems(t){const{tableItems:e}=this;e.sort((e,s)=>{const i=t.indexOf(e.layer),l=t.indexOf(s.layer);return i>l?-1:i<l?1:0})}_recompileList(){this._removeAllItems(),this._compileList()}};t([o()],c.prototype,"checkPublishStatusEnabled",void 0),t([o()],c.prototype,"listItemCreatedFunction",void 0),t([o({nonNullable:!0})],c.prototype,"listModeDisabled",void 0),t([o({type:h,readOnly:!0})],c.prototype,"tableItems",void 0),t([o()],c.prototype,"tables",null),t([o()],c.prototype,"map",void 0),t([o({readOnly:!0})],c.prototype,"state",null),t([o()],c.prototype,"totalItems",null),c=t([a("esri.widgets.TableList.TableListViewModel")],c);export{c as default};
2
+ import{__decorate as t}from"tslib";import e from"../../core/Collection.js";import{EventedAccessor as s}from"../../core/Evented.js";import{watch as i,initial as l}from"../../core/reactiveUtils.js";import{property as o,subclass as a}from"../../core/accessorSupport/decorators.js";import{findLayerListMode as r}from"../LayerList/support/layerListUtils.js";import d from"./ListItem.js";const m={map:"map",layerListMode:"layer-list-mode"},n="hide",h=e.ofType(d);let c=class extends s{constructor(t){super(t),this.checkPublishStatusEnabled=!1,this.listItemCreatedFunction=null,this.listModeDisabled=!1,this.tableItems=new h,this.map=null}initialize(){this.addHandles([i(()=>[this.tables?.toArray(),this.map?.allTables.toArray()],()=>this._compileList(),l),i(()=>[this.map?.loaded,this.listItemCreatedFunction,this.checkPublishStatusEnabled,this.listModeDisabled],()=>this._recompileList())],m.map)}destroy(){this._removeAllItems(),this.map=null,this.tables=null}get tables(){return this.map?.allTables}set tables(t){this._overrideIfSome("tables",t)}get state(){const{map:t,tables:e}=this;if(!t)return e?"ready":"disabled";const s=t?.loadStatus;return"string"==typeof s?"loaded"===s?"ready":"loading"===s?"loading":"disabled":"ready"}get totalItems(){return this.tableItems.length}triggerAction(t,e){t&&!t.disabled&&this.emit("trigger-action",{action:t,item:e})}_removeAllItems(){this.tableItems.destroyAll()}_getViewableTables(t){return t?this.listModeDisabled?t:t.filter(t=>r(t)!==n):void 0}_watchTablesListMode(t){this.removeHandles(m.layerListMode),t&&!this.listModeDisabled&&this.addHandles(i(()=>t.filter(t=>"listMode"in t).map(t=>t.listMode).toArray(),()=>this._compileList()),m.layerListMode)}_compileList(){const{tables:t}=this;this._watchTablesListMode(t);const e=this._getViewableTables(t);e?.length?(this._createNewItems(e),this._removeItems(e),this._sortItems(e)):this._removeAllItems()}_createNewItems(t){const{tableItems:e,listItemCreatedFunction:s,checkPublishStatusEnabled:i}=this;t.forEach(t=>{e.some(e=>e.layer===t)||e.add(new d({checkPublishStatusEnabled:i,layer:t,listItemCreatedFunction:s}))})}_removeItems(t){const{tableItems:e}=this;e.forEach(s=>{if(!s)return;const i=t?.find(t=>s.layer===t);i||(e.remove(s),s.destroy())})}_sortItems(t){const{tableItems:e}=this;e.sort((e,s)=>{const i=t.indexOf(e.layer),l=t.indexOf(s.layer);return i>l?-1:i<l?1:0})}_recompileList(){this._removeAllItems(),this._compileList()}};t([o()],c.prototype,"checkPublishStatusEnabled",void 0),t([o()],c.prototype,"listItemCreatedFunction",void 0),t([o({nonNullable:!0})],c.prototype,"listModeDisabled",void 0),t([o({type:h,readOnly:!0})],c.prototype,"tableItems",void 0),t([o()],c.prototype,"tables",null),t([o()],c.prototype,"map",void 0),t([o({readOnly:!0})],c.prototype,"state",null),t([o()],c.prototype,"totalItems",null),c=t([a("esri.widgets.TableList.TableListViewModel")],c);export{c as default};
@@ -45,6 +45,7 @@ export interface TrackViewModelTrackErrorEvent {
45
45
  * > For additional information regarding this, visit the ArcGIS blog,
46
46
  * > [Increased web API security in Google Chrome](https://blogs.esri.com/esri/arcgis/2016/04/14/increased-web-api-security-in-google-chrome/).
47
47
  *
48
+ * @deprecated since version 5.1. Use the [Track component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-track/) instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/).
48
49
  * @since 4.0
49
50
  * @see [Track](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-track/) component
50
51
  * @see [Track](https://developers.arcgis.com/javascript/latest/references/core/widgets/Track/) widget - _Deprecated since 4.32. Use the [Track component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-track/) instead._
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{ignoreAbortErrors as i,debounce as o,isAbortError as r}from"../../core/promiseUtils.js";import{property as s,subclass as e}from"../../core/accessorSupport/decorators.js";import a from"../support/GeolocationPositioning.js";const n=15e3;let c=class extends a{constructor(t){super(t),this._watchId=void 0,this._trackStartingTimeoutId=void 0,this._settingPosition=null,this._trackController=null,this.error=void 0,this.positionFilterFunction=null}destroy(){this._stopTracking()}get state(){return this._geolocationUsable?this.view&&!this.view.ready?"disabled":this._settingPosition||void 0!==this._trackStartingTimeoutId?"waiting":this.tracking?"tracking":null!=this.error?"error":"ready":"feature-unsupported"}get tracking(){return void 0!==this._watchId}start(){"disabled"!==this.state&&"feature-unsupported"!==this.state&&this._startTracking()}stop(){"disabled"!==this.state&&"feature-unsupported"!==this.state&&this._stopTracking()}_stopWatchingPosition(){void 0!==this._watchId&&(navigator.geolocation.clearWatch(this._watchId),this._watchId=void 0)}_stopTracking(){this._abortTrack(),this._clearWaitingTimer(),this._stopWatchingPosition(),this._clearGraphic()}_startTracking(){this._stopTracking();const t=o(async t=>{this._abortTrack();const i=new AbortController;this._trackController=i;const{timestamp:o,coords:s}=t,e={timestamp:o,coords:s.toJSON()};this.error=void 0;try{if("function"==typeof this.positionFilterFunction&&!this.positionFilterFunction.call(null,{position:e}))return;if(await this.updatePosition(t,i),this._trackController!==i)return;this._clearWaitingTimer(),this._addGraphic(),this.emit("track",{position:t}),this._trackController=null}catch(a){if(r(a))return;throw this._trackController=null,this._emitError(a),this._clearWaitingTimer(),a}},0);this._watchId=navigator.geolocation.watchPosition(o=>{this._settingPosition=t(o).catch(i)},this._handleWatchPositionError.bind(this),this.geolocationOptions??void 0),this._trackStartingTimeoutId=setTimeout(()=>{this._trackStartingTimeoutId=void 0},n)}_handleWatchPositionError(t){t.code===t.PERMISSION_DENIED&&this._stopTracking(),this._emitError(t)}_abortTrack(){this._trackController?.abort(),this._trackController=null}_clearWaitingTimer(){clearTimeout(this._trackStartingTimeoutId),this._trackStartingTimeoutId=void 0,this._settingPosition=null}_emitError(t){this.error=t,this.emit("track-error",{error:t})}};t([s()],c.prototype,"_watchId",void 0),t([s()],c.prototype,"_trackStartingTimeoutId",void 0),t([s()],c.prototype,"_settingPosition",void 0),t([s()],c.prototype,"error",void 0),t([s()],c.prototype,"positionFilterFunction",void 0),t([s({readOnly:!0})],c.prototype,"state",null),t([s({readOnly:!0})],c.prototype,"tracking",null),t([s()],c.prototype,"start",null),t([s()],c.prototype,"stop",null),c=t([e("esri.widgets.Track.TrackViewModel")],c);const h=c;export{h as default};
2
+ import{__decorate as t}from"tslib";import{deprecateUnnecessaryViewModel as i}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{ignoreAbortErrors as o,debounce as s,isAbortError as e}from"../../core/promiseUtils.js";import{property as a,subclass as n}from"../../core/accessorSupport/decorators.js";import c from"../support/GeolocationPositioning.js";const h=15e3;let l=class extends c{constructor(t){super(t),this._watchId=void 0,this._trackStartingTimeoutId=void 0,this._settingPosition=null,this._trackController=null,this.error=void 0,this.positionFilterFunction=null,t?.suppressDeprecationWarning||i(r.getLogger(this),"Track","arcgis-track",{version:"5.1"})}normalizeCtorArgs(t){const{suppressDeprecationWarning:i,...r}=t??{};return r}destroy(){this._stopTracking()}get state(){return this._geolocationUsable?this.view&&!this.view.ready?"disabled":this._settingPosition||void 0!==this._trackStartingTimeoutId?"waiting":this.tracking?"tracking":null!=this.error?"error":"ready":"feature-unsupported"}get tracking(){return void 0!==this._watchId}start(){"disabled"!==this.state&&"feature-unsupported"!==this.state&&this._startTracking()}stop(){"disabled"!==this.state&&"feature-unsupported"!==this.state&&this._stopTracking()}_stopWatchingPosition(){void 0!==this._watchId&&(navigator.geolocation.clearWatch(this._watchId),this._watchId=void 0)}_stopTracking(){this._abortTrack(),this._clearWaitingTimer(),this._stopWatchingPosition(),this._clearGraphic()}_startTracking(){this._stopTracking();const t=s(async t=>{this._abortTrack();const i=new AbortController;this._trackController=i;const{timestamp:r,coords:o}=t,s={timestamp:r,coords:o.toJSON()};this.error=void 0;try{if("function"==typeof this.positionFilterFunction&&!this.positionFilterFunction.call(null,{position:s}))return;if(await this.updatePosition(t,i),this._trackController!==i)return;this._clearWaitingTimer(),this._addGraphic(),this.emit("track",{position:t}),this._trackController=null}catch(a){if(e(a))return;throw this._trackController=null,this._emitError(a),this._clearWaitingTimer(),a}},0);this._watchId=navigator.geolocation.watchPosition(i=>{this._settingPosition=t(i).catch(o)},this._handleWatchPositionError.bind(this),this.geolocationOptions??void 0),this._trackStartingTimeoutId=setTimeout(()=>{this._trackStartingTimeoutId=void 0},h)}_handleWatchPositionError(t){t.code===t.PERMISSION_DENIED&&this._stopTracking(),this._emitError(t)}_abortTrack(){this._trackController?.abort(),this._trackController=null}_clearWaitingTimer(){clearTimeout(this._trackStartingTimeoutId),this._trackStartingTimeoutId=void 0,this._settingPosition=null}_emitError(t){this.error=t,this.emit("track-error",{error:t})}};t([a()],l.prototype,"_watchId",void 0),t([a()],l.prototype,"_trackStartingTimeoutId",void 0),t([a()],l.prototype,"_settingPosition",void 0),t([a()],l.prototype,"error",void 0),t([a()],l.prototype,"positionFilterFunction",void 0),t([a({readOnly:!0})],l.prototype,"state",null),t([a({readOnly:!0})],l.prototype,"tracking",null),t([a()],l.prototype,"start",null),t([a()],l.prototype,"stop",null),l=t([n("esri.widgets.Track.TrackViewModel")],l);const p=l;export{p as default};
package/widgets/Track.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../Graphic.js";import{deprecateWidget as o}from"../core/deprecate.js";import i from"../core/Logger.js";import{property as r,subclass as s}from"../core/accessorSupport/decorators.js";import a from"./Widget.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as l}from"./support/globalCss.js";import{messageBundle as c,vmEvent as p,tsx as d}from"./support/widget.js";import g from"./Track/TrackViewModel.js";const u={base:"esri-track"};let h=class extends a{constructor(e,t){super(e,t),this.messages=null,this.viewModel=new g,this._toggleTracking=()=>{const e=this.viewModel;e&&"feature-unsupported"!==e.state&&"disabled"!==e.state&&("tracking"!==e.state&&"waiting"!==e.state?this.viewModel.start():this.viewModel.stop())},o(i.getLogger(this),"Track","arcgis-track",{version:"4.32"})}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}get geolocationOptions(){return this.viewModel.geolocationOptions}set geolocationOptions(e){this.viewModel.geolocationOptions=e}get goToLocationEnabled(){return this.viewModel.goToLocationEnabled}set goToLocationEnabled(e){this.viewModel.goToLocationEnabled=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get icon(){return"compass-north-circle"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get rotationEnabled(){return this.viewModel.rotationEnabled}set rotationEnabled(e){this.viewModel.rotationEnabled=e}get scale(){return this.viewModel.scale}set scale(e){this.viewModel.scale=e}get tracking(){return this.viewModel.tracking}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}start(){this.viewModel.start()}stop(){this.viewModel.stop()}render(){const{viewModel:e,messages:t,icon:o}=this,i=e?.state,r="tracking"===i,s=this._localizeError(this.viewModel?.error),a=(r?t?.stopTracking:t?.startTracking)??"",n="feature-unsupported"===i,c=("tracking"===i?"pause":void 0)??o;return d("div",{class:this.classes(u.base,l.widget)},!n&&d("calcite-button",{class:l.widgetButton,disabled:"disabled"===i,iconStart:c,kind:"neutral",label:a,loading:"waiting"===i,onclick:this._toggleTracking,title:a}),s?d("calcite-tooltip",{open:!0,overlayPositioning:"fixed",referenceElement:this.container,topLayerDisabled:this.topLayerDisabled},s):null)}_localizeError(e){return e instanceof GeolocationPositionError?e.code===GeolocationPositionError.PERMISSION_DENIED?this.messages?.permissionError:e.code===GeolocationPositionError.TIMEOUT?this.messages?.timeoutError:this.messages?.positionUnavailable:e instanceof Error?e.message:void 0}};e([r()],h.prototype,"geolocationOptions",null),e([r()],h.prototype,"goToLocationEnabled",null),e([r()],h.prototype,"goToOverride",null),e([r({type:t})],h.prototype,"graphic",null),e([r()],h.prototype,"icon",null),e([r()],h.prototype,"label",null),e([r(),c("esri/widgets/Track/t9n/Track")],h.prototype,"messages",void 0),e([r()],h.prototype,"rotationEnabled",null),e([r()],h.prototype,"scale",null),e([r({readOnly:!0})],h.prototype,"tracking",null),e([r()],h.prototype,"view",null),e([r({type:g}),p(["track","track-error"])],h.prototype,"viewModel",void 0),h=e([s("esri.widgets.Track")],h);const v=h;export{v as default};
2
+ import{__decorate as e}from"tslib";import t from"../Graphic.js";import{deprecateWidget as o}from"../core/deprecate.js";import i from"../core/Logger.js";import{property as r,subclass as s}from"../core/accessorSupport/decorators.js";import a from"./Widget.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as l}from"./support/globalCss.js";import{messageBundle as c,vmEvent as p,tsx as d}from"./support/widget.js";import g from"./Track/TrackViewModel.js";const u={base:"esri-track"};let h=class extends a{constructor(e,t){super(e,t),this.messages=null,this.viewModel=new g({suppressDeprecationWarning:!0}),this._toggleTracking=()=>{const e=this.viewModel;e&&"feature-unsupported"!==e.state&&"disabled"!==e.state&&("tracking"!==e.state&&"waiting"!==e.state?this.viewModel.start():this.viewModel.stop())},o(i.getLogger(this),"Track","arcgis-track",{version:"4.32"})}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}get geolocationOptions(){return this.viewModel.geolocationOptions}set geolocationOptions(e){this.viewModel.geolocationOptions=e}get goToLocationEnabled(){return this.viewModel.goToLocationEnabled}set goToLocationEnabled(e){this.viewModel.goToLocationEnabled=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get icon(){return"compass-north-circle"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get rotationEnabled(){return this.viewModel.rotationEnabled}set rotationEnabled(e){this.viewModel.rotationEnabled=e}get scale(){return this.viewModel.scale}set scale(e){this.viewModel.scale=e}get tracking(){return this.viewModel.tracking}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}start(){this.viewModel.start()}stop(){this.viewModel.stop()}render(){const{viewModel:e,messages:t,icon:o}=this,i=e?.state,r="tracking"===i,s=this._localizeError(this.viewModel?.error),a=(r?t?.stopTracking:t?.startTracking)??"",n="feature-unsupported"===i,c=("tracking"===i?"pause":void 0)??o;return d("div",{class:this.classes(u.base,l.widget)},!n&&d("calcite-button",{class:l.widgetButton,disabled:"disabled"===i,iconStart:c,kind:"neutral",label:a,loading:"waiting"===i,onclick:this._toggleTracking,title:a}),s?d("calcite-tooltip",{open:!0,overlayPositioning:"fixed",referenceElement:this.container,topLayerDisabled:this.topLayerDisabled},s):null)}_localizeError(e){return e instanceof GeolocationPositionError?e.code===GeolocationPositionError.PERMISSION_DENIED?this.messages?.permissionError:e.code===GeolocationPositionError.TIMEOUT?this.messages?.timeoutError:this.messages?.positionUnavailable:e instanceof Error?e.message:void 0}};e([r()],h.prototype,"geolocationOptions",null),e([r()],h.prototype,"goToLocationEnabled",null),e([r()],h.prototype,"goToOverride",null),e([r({type:t})],h.prototype,"graphic",null),e([r()],h.prototype,"icon",null),e([r()],h.prototype,"label",null),e([r(),c("esri/widgets/Track/t9n/Track")],h.prototype,"messages",void 0),e([r()],h.prototype,"rotationEnabled",null),e([r()],h.prototype,"scale",null),e([r({readOnly:!0})],h.prototype,"tracking",null),e([r()],h.prototype,"view",null),e([r({type:g}),p(["track","track-error"])],h.prototype,"viewModel",void 0),h=e([s("esri.widgets.Track")],h);const v=h;export{v as default};
@@ -36,6 +36,7 @@ export interface GeolocationPositioningProperties extends GoToProperties, Partia
36
36
  * Provides common logic for [LocateViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Locate/LocateViewModel/)
37
37
  * and [TrackViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Track/TrackViewModel/).
38
38
  *
39
+ * @deprecated since version 5.1. Use the [Track component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-track/) or [Locate component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-locate/) instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/).
39
40
  * @since 4.0
40
41
  */
41
42
  export default class GeolocationPositioning extends GeolocationPositioningSuperclass {