@arcgis/core 4.34.0-next.22 → 4.34.0-next.23
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.
- package/applications/Components/arcadeFeatureUtils.d.ts +5 -0
- package/applications/Components/arcadeFeatureUtils.js +5 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0f6203ae32663b2b52db.js +1 -0
- package/assets/esri/core/workers/chunks/20bcd2e6cf02e057ad7d.js +1 -0
- package/assets/esri/core/workers/chunks/{1d9e44bdd129cc682ae5.js → ac93b3f1ff15a95d926c.js} +1 -1
- package/assets/esri/core/workers/chunks/{8b19fe829a9dc26fb3fe.js → d915d0a30d9beb24bd3a.js} +1 -1
- package/assets/esri/core/workers/chunks/{bbca1b85656d9ba71e4c.js → def8a854a05f17d3538e.js} +1 -1
- package/assets/esri/core/workers/chunks/f90573c9dc36e51cd588.js +1 -0
- package/config.js +1 -1
- package/interfaces.d.ts +89 -31
- package/kernel.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/support/SceneModification.js +1 -1
- package/layers/support/SceneModifications.js +1 -1
- package/layers/support/rasterDatasets/MRFRaster.js +1 -1
- package/layers/video/videoUtils.js +1 -1
- package/libs/basisu/BasisUEncoder.js +1 -1
- package/libs/dxtEncoder/DXTEncoder.js +1 -1
- package/libs/i3s/I3SModule.js +1 -1
- package/networks/support/utils.js +1 -1
- package/package.json +1 -1
- package/rest/knowledgeGraph/GraphAddFieldIndexResult.js +1 -1
- package/rest/knowledgeGraph/GraphAddNamedTypesResult.js +1 -1
- package/rest/knowledgeGraph/GraphAddPropertyResult.js +1 -1
- package/rest/knowledgeGraph/GraphDataModelOperationResult.d.ts +1 -1
- package/rest/knowledgeGraph/GraphDataModelOperationResult.js +1 -1
- package/rest/knowledgeGraph/GraphDeleteFieldIndexResult.js +1 -1
- package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.js +1 -1
- package/rest/knowledgeGraph/GraphDeletePropertyResult.js +1 -1
- package/rest/knowledgeGraph/GraphUpdateNamedTypesResult.js +1 -1
- package/rest/knowledgeGraph/GraphUpdatePropertyResult.js +1 -1
- package/rest/knowledgeGraph/GraphUpdateSearchIndexResult.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/VideoLayerView2D.js +1 -1
- package/views/3d/layers/SceneLayerWorker.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/draw/DrawScreenTool.js +1 -1
- package/views/support/TextureCompressionHelper.js +1 -1
- package/views/support/TextureCompressionWorker.js +1 -1
- package/views/support/TextureCompressionWorkerHandle.js +1 -1
- package/widgets/BatchAttributeForm/inputs/EditableInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/InputBase.d.ts +1 -1
- package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
- package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/support/Selector2D/SelectionOperation.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/58e74681ddef30ba9cb6.js +0 -1
- package/assets/esri/core/workers/chunks/8fa6c938e8dc7bbfaeb7.js +0 -1
- package/assets/esri/core/workers/chunks/e2cb295104ed2f8cd2ff.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import o from"../../../core/Accessor.js";import{createTask as i}from"../../../core/asyncUtils.js";import{abortMaybe as s}from"../../../core/maybe.js";import{throwIfAborted as r}from"../../../core/promiseUtils.js";import{watch as n,when as a,initial as l}from"../../../core/reactiveUtils.js";import{throttle as p}from"../../../core/throttle.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import h from"../../../geometry/Point.js";import"../../../popup/content/AttachmentsContent.js";import"../../../popup/content/Content.js";import"../../../popup/content/CustomContent.js";import"../../../popup/content/ExpressionContent.js";import u from"../../../popup/content/FieldsContent.js";import d from"../../../popup/content/MediaContent.js";import"../../../popup/content/RelationshipContent.js";import f from"../../../popup/content/TextContent.js";import"../../../popup/content/UtilityNetworkAssociationsContent.js";import v from"../../../popup/ElementExpressionInfo.js";import _ from"../FeatureContent/FeatureContentViewModel.js";import y from"../FeatureFields/FeatureFieldsViewModel.js";import w from"../FeatureMedia/FeatureMediaViewModel.js";import{compileExpression as T}from"../support/arcadeFeatureUtils.js";const j=1;let k=class extends o{constructor(e){super(e),this._compileTask=null,this._evaluateTask=null,this.expressionInfo=null,this.graphic=null,this.contentElementViewModel=null,this.interceptor=null,this.location=null,this.view=null,this._createVM=()=>{const e=this.contentElement?.type;this.contentElementViewModel?.destroy();const t="fields"===e?new y:"media"===e?new w:"text"===e?new _:null;this._set("contentElementViewModel",t)},this._compileThrottled=p(this._startCompile,()=>this.notifyChange("state"),j,this),this._evaluateThrottled=p(this._startEvaluate,()=>this.notifyChange("state"),j,this),this.addHandles([n(()=>[this.expressionInfo,this.graphic],()=>this._compileThrottled(),l),n(()=>[this.contentElement],()=>this._createVM(),l),a(()=>{if(!this._compileTask?.finished)return null;const e=this._compileTask.value,t=e?.dependencies;return[e,this.spatialReference,this.map,this.view,t?.has("view-scale")?this.view?.scale:null,t?.has("view-time-extent")?this.view?.timeExtent?.start:null,t?.has("view-time-extent")?this.view?.timeExtent?.end:null]},([e])=>this._evaluateThrottled(e))])}initialize(){this.addHandles([this._compileThrottled,this._evaluateThrottled])}destroy(){this._compileTask=s(this._compileTask),this._evaluateTask=s(this._evaluateTask),this.contentElementViewModel?.destroy(),this._set("contentElementViewModel",null)}get contentElement(){return this._evaluateTask?.value}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{contentElement:e,contentElementViewModel:t}=this;return this._compileThrottled.hasPendingUpdates()||this._evaluateThrottled.hasPendingUpdates()||!this._compileTask?.finished||!this._evaluateTask?.finished?"loading":e||t?"ready":"disabled"}get map(){return this.view?.map??null}set map(e){this._override("map",e)}_startCompile(){this._evaluateTask=s(this._evaluateTask),this._compileTask=s(this._compileTask),this._compileTask=i(async e=>{const{expressionInfo:t,graphic:o}=this;if(!t||!o)return null;const{createArcadeExecutor:i,createArcadeProfile:s}=await import("../../../arcade.js");r(e);const n=await T({expressionInfo:t,createArcadeExecutor:i,createArcadeProfile:s,graphic:o});return r(e),n})}_startEvaluate(e){this._evaluateTask=s(this._evaluateTask),this._evaluateTask=i(async t=>{const{graphic:o}=this;if(!e||!o)return null;const{interceptor:i,spatialReference:s,map:n,location:a,view:l}=this,p=await e.evaluate({graphic:o,interceptor:i,location:a,map:n,options:{signal:t},spatialReference:s,view:l});r(t);const c=p;if(!c||"esri.arcade.Dictionary"!==c.declaredClass)return null;const m=await c.castAsJsonAsync(t);r(t);const h=m?.type,v="media"===h?d.fromJSON(m):"text"===h?f.fromJSON(m):"fields"===h?u.fromJSON(m):null;return"media"===v.type&&!v.mediaInfos||"fields"===v.type&&!v.fieldInfos||"text"===v.type&&!v.text?null:v})}};e([c()],k.prototype,"_compileTask",void 0),e([c()],k.prototype,"_evaluateTask",void 0),e([c({type:v})],k.prototype,"expressionInfo",void 0),e([c({type:t})],k.prototype,"graphic",void 0),e([c({readOnly:!0})],k.prototype,"contentElement",null),e([c({readOnly:!0})],k.prototype,"contentElementViewModel",void 0),e([c()],k.prototype,"interceptor",void 0),e([c({type:h})],k.prototype,"location",void 0),e([c()],k.prototype,"spatialReference",null),e([c({readOnly:!0})],k.prototype,"state",null),e([c()],k.prototype,"map",null),e([c()],k.prototype,"view",void 0),k=e([m("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],k);export{k as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import{FeatureSetQueryInterceptor as i}from"../../arcade/featureset/support/FeatureSetQueryInterceptor.js";import s from"../../core/Accessor.js";import{isSome as o}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import n from"../../core/Identifiable.js";import l from"../../core/Logger.js";import{abortMaybe as p}from"../../core/maybe.js";import{eachAlways as c,isAbortError as d,throwIfAborted as h}from"../../core/promiseUtils.js";import{watch as u,when as f,initial as m,on as _}from"../../core/reactiveUtils.js";import{throttle as y}from"../../core/throttle.js";import{property as g}from"../../core/accessorSupport/decorators/property.js";import{cast as b}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import{subclass as v}from"../../core/accessorSupport/decorators/subclass.js";import w from"../../geometry/Point.js";import A from"../../geometry/SpatialReference.js";import I from"../../popup/content/TextContent.js";import{system as x}from"../../time/constants.js";import M from"./FeatureAttachments/FeatureAttachmentsViewModel.js";import T from"./FeatureContent/FeatureContentViewModel.js";import F from"./FeatureExpression/FeatureExpressionViewModel.js";import C from"./FeatureFields/FeatureFieldsViewModel.js";import E from"./FeatureMedia/FeatureMediaViewModel.js";import V from"./FeatureRelationship/FeatureRelationshipViewModel.js";import{compileExpressionInfos as j,formatArcadeValue as k}from"./support/arcadeFeatureUtils.js";import{preLayerQueryCallback as P,preRequestCallback as R,createFieldInfoMap as L,getAllFieldInfos as O,getSourceLayer as N,querySourceLayer as U,queryUpdatedFeature as Z,isRelatableFeatureSupportedLayer as B,isAssociatedFeatureSupportedLayer as S,substituteFieldsInLinksAndAttributes as H,isExpressionField as D,isRelatedField as G,formatEditInfo as q,graphicCallback as z,formatAttributes as Q}from"./support/featureUtils.js";import{queryLayerInfos as J,queryRelatedFeatures as K,setRelatedFeatures as W,getRelatedFieldInfo as X,createRelatedInfo as Y,updateRelatedInfo as $}from"./support/relatedFeatureUtils.js";import ee from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";var te;const ie=1,se="content-view-models",oe="relationship-view-models",re="association-view-models",ae={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0,utilityNetworkAssociationsContent:!0};let ne=class extends(n.IdentifiableMixin(s)){static{te=this}constructor(e){super(e),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._associationVMAbortController=null,this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...ae},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._graphicChangedThrottled=y(this._graphicChanged,()=>this.notifyChange("waitingForContent"),ie,this),this._isAllowedContentType=e=>{const{abilities:t}=this;return"attachments"===e.type&&!!t.attachmentsContent||"custom"===e.type&&!!t.customContent||"fields"===e.type&&!!t.fieldsContent||"media"===e.type&&!!t.mediaContent||"text"===e.type&&!!t.textContent||"expression"===e.type&&!!t.expressionContent||"relationship"===e.type&&!!t.relationshipContent||"utility-network-associations"===e.type&&!!t.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=y(this._evaluateExpressionAttributes,()=>this.notifyChange("waitingForContent"),ie,this),this.addHandles([u(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),m),f(()=>{if(!this._graphicChangedTask?.finished||null==this._graphicChangedTask.value)return null;const e=this._graphicChangedTask.value,t=e?.expressionInfos?.dependencies;return[e,t?.has("view-scale")?this.view?.scale:null,t?.has("view-time-extent")?this.view?.timeExtent?.start:null,t?.has("view-time-extent")?this.view?.timeExtent?.end:null]},([e])=>this._evaluateExpressionAttributesThrottled(e))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=p(this._graphicChangedTask),this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}static{this.interceptor=new i(P,R)}get _effectivePopupTemplate(){return null!=this.graphic?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return L(O(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return N(this.graphic)}castAbilities(e){return{...ae,...e}}get isFeatureFromTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(e){this._set("graphic",e?.clone()??null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get timeZone(){return this.view?.timeZone??x}set timeZone(e){this._overrideIfSome("timeZone",e)}get map(){return this.view?.map||null}set map(e){this._override("map",e)}get waitingForContent(){const{_graphicChangedThrottled:e,_evaluateExpressionAttributesThrottled:t,_graphicChangedTask:i,_evaluateExpressionAttributesTask:s,_associationVMAbortController:o}=this;return e.hasPendingUpdates()||t.hasPendingUpdates()||null!=i&&!i.finished||null!=s&&!s.finished||!!o}setActiveMedia(e,t){const i=this.contentViewModels[e];i instanceof E&&i.setActiveMedia(t)}nextMedia(e){const t=this.contentViewModels[e];t instanceof E&&t.next()}previousMedia(e){const t=this.contentViewModels[e];t instanceof E&&t.previous()}async updateGeometry(){const{graphic:e,spatialReference:t,_sourceLayer:i}=this;await(i?.load());const s=i?.objectIdField;if(!s||!e||!i)return;const o=e?.attributes?.[s];if(null==o)return;const r=[o];if(!e.geometry){const s=await U({layer:i,graphic:e,outFields:[],objectIds:r,returnGeometry:!0,spatialReference:t}),o=s?.geometry;o&&(e.geometry=o)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}_graphicChanged(){this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._graphicChangedTask=p(this._graphicChangedTask),this._graphicChangedTask=r(async e=>{this._error=null,this._clear();const{graphic:t}=this;try{if(!t)return null;const{_sourceLayer:i,_effectivePopupTemplate:s}=this,o=this.spatialReference;await Z({graphic:t,popupTemplate:s,layer:i,spatialReference:o},{signal:e});const[{value:r},{value:a}]=await c([this._getContent(),this._getTitle()]),[,{value:n}]=await c([this._checkForRelatedFeatures({signal:e}),j(s?.expressionInfos,t)]);return{expressionInfos:n,content:r,title:a}}catch(i){throw d(i)||(this._error=i,l.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:t,popupTemplate:this._effectivePopupTemplate})),i}})}_compileContentElement(e,t){return"attachments"===e.type?this._compileAttachments(e,t):"custom"===e.type?this._compileCustom(e,t):"fields"===e.type?this._compileFields(e,t):"media"===e.type?this._compileMedia(e,t):"text"===e.type?this._compileText(e,t):"expression"===e.type?this._compileExpression(e,t):"relationship"===e.type?this._compileRelationship(e,t):"utility-network-associations"===e.type?this._compileUtilityNetworkAssociation(e,t):void 0}_compileContent(e){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map((e,t)=>this._compileContentElement(e,t)).filter(o):"string"==typeof e?this._compileText(new I({text:e}),0).text:e}_destroyContentViewModels(){this.removeHandles(oe),this.removeHandles(se),this.contentViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("contentViewModels",[])}_matchesFeature(e,t){const i=e?.graphic?.getObjectId(),s=t?.getObjectId();return null!=i&&null!=s&&i===s}_setRelatedFeaturesViewModels({relatedFeatureViewModels:e,relatedFeatures:t,map:i}){const{view:s,spatialReference:o,timeZone:r}=this;t?.filter(Boolean).forEach(t=>{e.some(e=>this._matchesFeature(e,t))||e.add(new te({abilities:{relationshipContent:!1},map:i,view:s,spatialReference:o,timeZone:r,graphic:t}))}),e.forEach(i=>{const s=t?.find(e=>this._matchesFeature(i,e));s||e.remove(i)})}_setExpressionContentVM(e,t){const i=this.formattedAttributes,{contentElement:s,contentElementViewModel:o}=e,r=s?.type;o&&r&&("fields"===r&&(this._createFieldsFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),o.set(this._createFieldsVMParams(s,t))),"media"===r&&(this._createMediaFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),o.set(this._createMediaVMParams(s,t))),"text"===r&&o.set(this._createTextVMParams(s)))}_compileRelationship(e,t){const{displayCount:i,orderByFields:s,relationshipId:o,title:r,description:a}=e,{_sourceLayer:n,graphic:l,map:p}=this;if(!B(n))return;const c=new V({displayCount:i,graphic:l,orderByFields:s,relationshipId:o,layer:n,map:p,...this._compileTitleAndDesc({title:r,description:a})});return this.contentViewModels[t]=c,this.addHandles(_(()=>c.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(c)),oe),e}_matchesGlobalFeature(e,t){const i=e?.association.globalId,s=t?.association.globalId;return null!=i&&null!=s&&i===s}async _setUpUtilityNetworkAssociationsViewModels(e,t,i){const{view:s,spatialReference:o,timeZone:r}=this;e.forEach((i,s)=>{const o=t.get(s);o?i.forEach(t=>{o.find(e=>this._matchesGlobalFeature(t,e))||(i.remove(t),0===i.length&&e.delete(s))}):(i.removeAll(),e.delete(s))}),t.forEach((t,n)=>{const l=e.get(n)||new a;t?.filter(Boolean).forEach(e=>{if(!l.some(t=>this._matchesGlobalFeature(t,e))){const{association:t,feature:a,terminalName:n,title:p}=e;l.add({title:p,association:t,featureViewModel:new te({abilities:{utilityNetworkAssociationsContent:!1},map:i,view:s,spatialReference:o,timeZone:r,graphic:a}),terminalName:n})}}),e.set(n,l)}),this._sortListObjectsByTitle(e)}async _sortListObjectsByTitle(e){for(const t of e.values())t.sort(this._compareByFeatureTitle)}_compareByFeatureTitle(e,t){return e.title.localeCompare(t.title,void 0,{numeric:!0})}_compileUtilityNetworkAssociation(e,t){const{displayCount:i,title:s,description:o,associationTypes:r}=e,{_sourceLayer:a,graphic:n,map:l}=this;if(!S(a))return;const p=new ee({graphic:n,displayCount:i,associationTypes:r,layer:a,map:l,...this._compileTitleAndDesc({title:s,description:o})});return this.contentViewModels[t]=p,this.addHandles([u(()=>p.associationFeatures.values(),()=>this._setUpUtilityNetworkAssociationsViewModels(p.associationViewModels,p.associationFeatures,p.map))],re),e}_compileExpression(e,t){const{expressionInfo:i}=e,{graphic:s,map:o,spatialReference:r,view:a,location:n}=this,l=new F({expressionInfo:i,graphic:s,interceptor:te.interceptor,map:o,spatialReference:r,view:a,location:n});return this.contentViewModels[t]=l,this.addHandles(u(()=>l.contentElementViewModel,()=>this._setExpressionContentVM(l,t),m),se),e}_compileAttachments(e,t){const{graphic:i}=this,{description:s,title:o,orderByFields:r}=e;return this.contentViewModels[t]=new M({graphic:i,orderByFields:r,...this._compileTitleAndDesc({title:o,description:s})}),e}_compileCustom(e,t){const{graphic:i}=this,{creator:s,destroyer:o}=e;return this.contentViewModels[t]=new T({graphic:i,creator:s,destroyer:o}),e}_compileTitleAndDesc({title:e,description:t}){const{_fieldInfoMap:i,_sourceLayer:s,graphic:o,formattedAttributes:r}=this,a=o?.attributes,n=this._expressionAttributes,l=r.global;return{title:H({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:s,text:e}),description:H({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:s,text:t})}}_createFieldsVMParams(e,t){const i=this._effectivePopupTemplate,s=this.formattedAttributes,o={...s?.global,...s?.content[t]},r=e?.fieldInfos||i?.fieldInfos,a=r?.filter(({fieldName:e})=>!!e&&(D(e)||G(e)||o.hasOwnProperty(e))),n=i?.expressionInfos,{description:l,title:p}=e;return{attributes:o,expressionInfos:n,fieldInfos:a,...this._compileTitleAndDesc({title:p,description:l})}}_compileFields(e,t){const i=e.clone(),s=new C(this._createFieldsVMParams(e,t));return this.contentViewModels[t]=s,i.fieldInfos=s.formattedFieldInfos.slice(),i}_createMediaVMParams(e,t){const{abilities:i,graphic:s,_fieldInfoMap:o,_effectivePopupTemplate:r,relatedInfos:a,_sourceLayer:n,_expressionAttributes:l}=this,p=this.formattedAttributes,c=s?.attributes??{},{description:d,mediaInfos:h,title:u}=e;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:e.activeMediaInfoIndex||0,attributes:c,isAggregate:s?.isAggregate,layer:n,fieldInfoMap:o,formattedAttributes:{...p?.global,...p?.content[t]},expressionAttributes:l,mediaInfos:h,popupTemplate:r,relatedInfos:a,...this._compileTitleAndDesc({title:u,description:d})}}_compileMedia(e,t){const i=e.clone(),s=new E(this._createMediaVMParams(e,t));return i.mediaInfos=s.formattedMediaInfos.slice(),this.contentViewModels[t]=s,i}_createTextVMParams(e){const{graphic:t,_fieldInfoMap:i,_sourceLayer:s,_expressionAttributes:o}=this;if(e&&e.text){const r=t?.attributes??{},a=this.formattedAttributes?.global??{};e.text=H({attributes:r,fieldInfoMap:i,globalAttributes:a,expressionAttributes:o,layer:s,text:e.text})}return{graphic:t,creator:e.text}}_compileText(e,t){const i=e.clone();return this.contentViewModels[t]=new T(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:e,_sourceLayer:t,graphic:i,timeZone:s}=this;if(!e)return;const{lastEditInfoEnabled:o}=e,r=t?.editFieldsInfo;return o&&r?q(r,i?.attributes,s,t):void 0}_compileTitle(e){const{_fieldInfoMap:t,_sourceLayer:i,graphic:s,_expressionAttributes:o}=this,r=s?.attributes??{},a=this.formattedAttributes?.global??{};return H({attributes:r,fieldInfoMap:t,globalAttributes:a,expressionAttributes:o,layer:i,text:e})}async _getTitle(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?z({type:"title",value:e?.title,event:{graphic:t}}):null}async _getContent(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?z({type:"content",value:e?.content,event:{graphic:t}}):null}_evaluateExpressionAttributes({title:e,content:t,expressionInfos:i}){this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=r(async s=>{const{graphic:o,map:r,view:a,spatialReference:n,location:p}=this;try{if(!o)return;let l;if(null!=i){const e=[];for(const[t,l]of i.expressions.entries())null!=l?e.push(l.evaluate({graphic:o,interceptor:te.interceptor,location:p,map:r,options:{signal:s},spatialReference:n,view:a}).then(e=>[t,k(e)]).catch(()=>[t,void 0])):e.push(Promise.resolve([t,void 0]));l=Object.fromEntries(await Promise.all(e)),h(s)}this._expressionAttributes=l,this._graphicExpressionAttributes={...o.attributes,...l},this._set("formattedAttributes",this._createFormattedAttributes(t)),this._set("title",this._compileTitle(e)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(t)||null)}catch(c){d(c)||(this._error=c,l.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:c,graphic:o,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){const{_effectivePopupTemplate:s,graphic:o,relatedInfos:r,_sourceLayer:a,_fieldInfoMap:n,_graphicExpressionAttributes:l,timeZone:p}=this;i.content[t]=Q({fieldInfos:s?.fieldInfos,graphic:o,attributes:{...l,...e.attributes},layer:a,fieldInfoMap:n,relatedInfos:r,timeZone:p})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){if(e.fieldInfos){const{graphic:s,relatedInfos:o,_sourceLayer:r,_fieldInfoMap:a,_graphicExpressionAttributes:n,timeZone:l}=this;i.content[t]=Q({fieldInfos:e.fieldInfos,graphic:s,attributes:{...n,...e.attributes},layer:r,fieldInfoMap:a,relatedInfos:o,timeZone:l})}}_createFormattedAttributes(e){const{_effectivePopupTemplate:t,graphic:i,relatedInfos:s,_sourceLayer:o,_fieldInfoMap:r,_graphicExpressionAttributes:a,timeZone:n}=this,l=t?.fieldInfos,p={global:Q({fieldInfos:l,graphic:i,attributes:a,layer:o,fieldInfoMap:r,relatedInfos:s,timeZone:n}),content:[]};return Array.isArray(e)&&e.forEach((e,t)=>{"fields"===e.type&&this._createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:p}),"media"===e.type&&this._createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:p})}),p}_checkForRelatedFeatures(e){const{graphic:t,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(t,O(i),e)}async _queryRelatedInfos(e,t,i){const{relatedInfos:s,_sourceLayer:o}=this;s.clear();const r=null!=o?.associatedLayer?await(o?.associatedLayer.load(i)):o;if(!r||!e)return;const a=t.filter(e=>!!e.fieldName&&G(e.fieldName));if(!a?.length)return;t.forEach(e=>this._configureRelatedInfo(e,r));const n=await J({relatedInfos:s,layer:r},i);Object.keys(n).forEach(e=>{const t=s.get(e.toString()),i=n[e]?.value;t&&i&&(t.layerInfo=i.data)});const l=await K({graphic:e,relatedInfos:s,layer:r},i);Object.keys(l).forEach(e=>{W(l[e]?.value,s.get(e.toString()))})}_configureRelatedInfo(e,t){const{relatedInfos:i}=this,s=X(e.fieldName||"");if(!s)return;const{layerId:o,fieldName:r}=s;if(!o)return;const a=i.get(o.toString())||Y(o,t);a&&($({relatedInfo:a,fieldName:r,fieldInfo:e}),this.relatedInfos.set(o,a))}};e([g()],ne.prototype,"_error",void 0),e([g()],ne.prototype,"_graphicChangedTask",void 0),e([g()],ne.prototype,"_evaluateExpressionAttributesTask",void 0),e([g()],ne.prototype,"_associationVMAbortController",void 0),e([g({readOnly:!0})],ne.prototype,"_effectivePopupTemplate",null),e([g({readOnly:!0})],ne.prototype,"_fieldInfoMap",null),e([g({readOnly:!0})],ne.prototype,"_sourceLayer",null),e([g()],ne.prototype,"abilities",void 0),e([b("abilities")],ne.prototype,"castAbilities",null),e([g({readOnly:!0})],ne.prototype,"content",void 0),e([g({readOnly:!0})],ne.prototype,"contentViewModels",void 0),e([g()],ne.prototype,"description",void 0),e([g({type:Boolean})],ne.prototype,"defaultPopupTemplateEnabled",void 0),e([g({readOnly:!0})],ne.prototype,"isFeatureFromTable",null),e([g({readOnly:!0})],ne.prototype,"state",null),e([g({readOnly:!0})],ne.prototype,"formattedAttributes",void 0),e([g({type:t,value:null})],ne.prototype,"graphic",null),e([g({readOnly:!0})],ne.prototype,"lastEditInfo",void 0),e([g({type:w})],ne.prototype,"location",void 0),e([g({readOnly:!0})],ne.prototype,"relatedInfos",void 0),e([g({type:A})],ne.prototype,"spatialReference",null),e([g()],ne.prototype,"timeZone",null),e([g({readOnly:!0})],ne.prototype,"title",void 0),e([g()],ne.prototype,"map",null),e([g({readOnly:!0})],ne.prototype,"waitingForContent",null),e([g()],ne.prototype,"view",void 0),ne=te=e([v("esri.widgets.Feature.FeatureViewModel")],ne);export{ne as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import{FeatureSetQueryInterceptor as i}from"../../arcade/featureset/support/FeatureSetQueryInterceptor.js";import s from"../../core/Accessor.js";import{isSome as o}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import n from"../../core/Identifiable.js";import l from"../../core/Logger.js";import{abortMaybe as p}from"../../core/maybe.js";import{eachAlways as c,isAbortError as d,throwIfAborted as h}from"../../core/promiseUtils.js";import{watch as u,when as f,initial as m,on as _}from"../../core/reactiveUtils.js";import{throttle as y}from"../../core/throttle.js";import{property as g}from"../../core/accessorSupport/decorators/property.js";import{cast as b}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import{subclass as v}from"../../core/accessorSupport/decorators/subclass.js";import w from"../../geometry/Point.js";import A from"../../geometry/SpatialReference.js";import I from"../../popup/content/TextContent.js";import{system as x}from"../../time/constants.js";import M from"./FeatureAttachments/FeatureAttachmentsViewModel.js";import T from"./FeatureContent/FeatureContentViewModel.js";import F from"./FeatureExpression/FeatureExpressionViewModel.js";import C from"./FeatureFields/FeatureFieldsViewModel.js";import E from"./FeatureMedia/FeatureMediaViewModel.js";import V from"./FeatureRelationship/FeatureRelationshipViewModel.js";import{compileExpressionInfos as j,formatArcadeValue as k}from"./support/arcadeFeatureUtils.js";import{preLayerQueryCallback as P,preRequestCallback as R,createFieldInfoMap as L,getAllFieldInfos as O,getSourceLayer as N,querySourceLayer as U,queryUpdatedFeature as Z,isRelatableFeatureSupportedLayer as B,isAssociatedFeatureSupportedLayer as S,substituteFieldsInLinksAndAttributes as H,isExpressionField as D,isRelatedField as G,formatEditInfo as q,graphicCallback as z,formatAttributes as Q}from"./support/featureUtils.js";import{queryLayerInfos as J,queryRelatedFeatures as K,setRelatedFeatures as W,getRelatedFieldInfo as X,createRelatedInfo as Y,updateRelatedInfo as $}from"./support/relatedFeatureUtils.js";import ee from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";var te;const ie=1,se="content-view-models",oe="relationship-view-models",re="association-view-models",ae={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0,utilityNetworkAssociationsContent:!0};let ne=class extends(n.IdentifiableMixin(s)){static{te=this}constructor(e){super(e),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._associationVMAbortController=null,this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...ae},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._graphicChangedThrottled=y(this._graphicChanged,()=>this.notifyChange("waitingForContent"),ie,this),this._isAllowedContentType=e=>{const{abilities:t}=this;return"attachments"===e.type&&!!t.attachmentsContent||"custom"===e.type&&!!t.customContent||"fields"===e.type&&!!t.fieldsContent||"media"===e.type&&!!t.mediaContent||"text"===e.type&&!!t.textContent||"expression"===e.type&&!!t.expressionContent||"relationship"===e.type&&!!t.relationshipContent||"utility-network-associations"===e.type&&!!t.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=y(this._evaluateExpressionAttributes,()=>this.notifyChange("waitingForContent"),ie,this),this.addHandles([u(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),m),f(()=>{if(!this._graphicChangedTask?.finished||null==this._graphicChangedTask.value)return null;const e=this._graphicChangedTask.value,t=e?.expressionInfos?.dependencies;return[e,t?.has("view-scale")?this.view?.scale:null,t?.has("view-time-extent")?this.view?.timeExtent?.start:null,t?.has("view-time-extent")?this.view?.timeExtent?.end:null]},([e])=>this._evaluateExpressionAttributesThrottled(e))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=p(this._graphicChangedTask),this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}static{this.interceptor=new i(P,R)}get _effectivePopupTemplate(){return null!=this.graphic?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return L(O(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return N(this.graphic)}castAbilities(e){return{...ae,...e}}get isFeatureFromTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(e){this._set("graphic",e?.clone()??null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get timeZone(){return this.view?.timeZone??x}set timeZone(e){this._overrideIfSome("timeZone",e)}get map(){return this.view?.map||null}set map(e){this._override("map",e)}get waitingForContent(){const{_graphicChangedThrottled:e,_evaluateExpressionAttributesThrottled:t,_graphicChangedTask:i,_evaluateExpressionAttributesTask:s,_associationVMAbortController:o}=this;return e.hasPendingUpdates()||t.hasPendingUpdates()||null!=i&&!i.finished||null!=s&&!s.finished||!!o}setActiveMedia(e,t){const i=this.contentViewModels[e];i instanceof E&&i.setActiveMedia(t)}nextMedia(e){const t=this.contentViewModels[e];t instanceof E&&t.next()}previousMedia(e){const t=this.contentViewModels[e];t instanceof E&&t.previous()}async updateGeometry(){const{graphic:e,spatialReference:t,_sourceLayer:i}=this;await(i?.load());const s=i?.objectIdField;if(!s||!e||!i)return;const o=e?.attributes?.[s];if(null==o)return;const r=[o];if(!e.geometry){const s=await U({layer:i,graphic:e,outFields:[],objectIds:r,returnGeometry:!0,spatialReference:t}),o=s?.geometry;o&&(e.geometry=o)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}_graphicChanged(){this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._graphicChangedTask=p(this._graphicChangedTask),this._graphicChangedTask=r(async e=>{this._error=null,this._clear();const{graphic:t}=this;try{if(!t)return null;const{_sourceLayer:i,_effectivePopupTemplate:s}=this,o=this.spatialReference;await Z({graphic:t,popupTemplate:s,layer:i,spatialReference:o},{signal:e});const[{value:r},{value:a}]=await c([this._getContent(),this._getTitle()]),[,{value:n}]=await c([this._checkForRelatedFeatures({signal:e}),j(s?.expressionInfos,t)]);return{expressionInfos:n,content:r,title:a}}catch(i){throw d(i)||(this._error=i,l.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:t,popupTemplate:this._effectivePopupTemplate})),i}})}_compileContentElement(e,t){return"attachments"===e.type?this._compileAttachments(e,t):"custom"===e.type?this._compileCustom(e,t):"fields"===e.type?this._compileFields(e,t):"media"===e.type?this._compileMedia(e,t):"text"===e.type?this._compileText(e,t):"expression"===e.type?this._compileExpression(e,t):"relationship"===e.type?this._compileRelationship(e,t):"utility-network-associations"===e.type?this._compileUtilityNetworkAssociation(e,t):void 0}_compileContent(e){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map((e,t)=>this._compileContentElement(e,t)).filter(o):"string"==typeof e?this._compileText(new I({text:e}),0).text:e}_destroyContentViewModels(){this.removeHandles(oe),this.removeHandles(se),this.contentViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("contentViewModels",[])}_matchesFeature(e,t){const i=e?.graphic?.getObjectId(),s=t?.getObjectId();return null!=i&&null!=s&&i===s}_setRelatedFeaturesViewModels({relatedFeatureViewModels:e,relatedFeatures:t,map:i}){const{view:s,spatialReference:o,timeZone:r}=this;t?.filter(Boolean).forEach(t=>{e.some(e=>this._matchesFeature(e,t))||e.add(new te({abilities:{relationshipContent:!1},map:i,view:s,spatialReference:o,timeZone:r,graphic:t}))}),e.forEach(i=>{const s=t?.find(e=>this._matchesFeature(i,e));s||e.remove(i)})}_setExpressionContentVM(e,t){const i=this.formattedAttributes,{contentElement:s,contentElementViewModel:o}=e,r=s?.type;o&&r&&("fields"===r&&(this._createFieldsFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),o.set(this._createFieldsVMParams(s,t))),"media"===r&&(this._createMediaFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),o.set(this._createMediaVMParams(s,t))),"text"===r&&o.set(this._createTextVMParams(s)))}_compileRelationship(e,t){const{displayCount:i,orderByFields:s,relationshipId:o,title:r,description:a}=e,{_sourceLayer:n,graphic:l,map:p}=this;if(!B(n))return;const c=new V({displayCount:i,graphic:l,orderByFields:s,relationshipId:o,layer:n,map:p,...this._compileTitleAndDesc({title:r,description:a})});return this.contentViewModels[t]=c,this.addHandles(_(()=>c.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(c)),oe),e}_matchesGlobalFeature(e,t){const i=e?.association.globalId,s=t?.association.globalId;return null!=i&&null!=s&&i===s}async _setUpUtilityNetworkAssociationsViewModels(e,t,i){const{view:s,spatialReference:o,timeZone:r}=this;e.forEach((i,s)=>{const o=t.get(s);o?i.forEach(t=>{o.find(e=>this._matchesGlobalFeature(t,e))||(i.remove(t),0===i.length&&e.delete(s))}):(i.removeAll(),e.delete(s))}),t.forEach((t,n)=>{const l=e.get(n)||new a;t?.filter(Boolean).forEach(e=>{if(!l.some(t=>this._matchesGlobalFeature(t,e))){const{association:t,feature:a,terminalName:n,title:p}=e;l.add({title:p,association:t,featureViewModel:new te({abilities:{utilityNetworkAssociationsContent:!1},map:i,view:s,spatialReference:o,timeZone:r,graphic:a}),terminalName:n})}}),e.set(n,l)}),this._sortListObjectsByTitle(e)}async _sortListObjectsByTitle(e){for(const t of e.values())t.sort(this._compareByFeatureTitle)}_compareByFeatureTitle(e,t){return e.title.localeCompare(t.title,void 0,{numeric:!0})}_compileUtilityNetworkAssociation(e,t){const{displayCount:i,title:s,description:o,associationTypes:r}=e,{_sourceLayer:a,graphic:n,map:l}=this;if(!S(a))return;const p=new ee({graphic:n,displayCount:i,associationTypes:r,layer:a,map:l,...this._compileTitleAndDesc({title:s,description:o})});return this.contentViewModels[t]=p,this.addHandles([u(()=>p.associationFeatures.values(),()=>this._setUpUtilityNetworkAssociationsViewModels(p.associationViewModels,p.associationFeatures,p.map))],re),e}_compileExpression(e,t){const{expressionInfo:i}=e,{graphic:s,map:o,spatialReference:r,view:a,location:n}=this,l=new F({expressionInfo:i,graphic:s,interceptor:te.interceptor,map:o,spatialReference:r,view:a,location:n});return this.contentViewModels[t]=l,this.addHandles(u(()=>l.contentElementViewModel,()=>this._setExpressionContentVM(l,t),m),se),e}_compileAttachments(e,t){const{graphic:i}=this,{description:s,title:o,orderByFields:r}=e;return this.contentViewModels[t]=new M({graphic:i,orderByFields:r,...this._compileTitleAndDesc({title:o,description:s})}),e}_compileCustom(e,t){const{graphic:i}=this,{creator:s,destroyer:o}=e;return this.contentViewModels[t]=new T({graphic:i,creator:s,destroyer:o}),e}_compileTitleAndDesc({title:e,description:t}){const{_fieldInfoMap:i,_sourceLayer:s,graphic:o,formattedAttributes:r}=this,a=o?.attributes,n=this._expressionAttributes,l=r.global;return{title:H({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:s,text:e}),description:H({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:s,text:t})}}_createFieldsVMParams(e,t){const i=this._effectivePopupTemplate,s=this.formattedAttributes,o={...s?.global,...s?.content[t]},r=e?.fieldInfos||i?.fieldInfos,a=r?.filter(({fieldName:e})=>!!e&&(D(e)||G(e)||o.hasOwnProperty(e))),n=i?.expressionInfos,{description:l,title:p}=e;return{attributes:o,expressionInfos:n,fieldInfos:a,...this._compileTitleAndDesc({title:p,description:l})}}_compileFields(e,t){const i=e.clone(),s=new C(this._createFieldsVMParams(e,t));return this.contentViewModels[t]=s,i.fieldInfos=s.formattedFieldInfos.slice(),i}_createMediaVMParams(e,t){const{abilities:i,graphic:s,_fieldInfoMap:o,_effectivePopupTemplate:r,relatedInfos:a,_sourceLayer:n,_expressionAttributes:l}=this,p=this.formattedAttributes,c=s?.attributes??{},{description:d,mediaInfos:h,title:u}=e;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:e.activeMediaInfoIndex||0,attributes:c,isAggregate:s?.isAggregate,layer:n,fieldInfoMap:o,formattedAttributes:{...p?.global,...p?.content[t]},expressionAttributes:l,mediaInfos:h,popupTemplate:r,relatedInfos:a,...this._compileTitleAndDesc({title:u,description:d})}}_compileMedia(e,t){const i=e.clone(),s=new E(this._createMediaVMParams(e,t));return i.mediaInfos=s.formattedMediaInfos.slice(),this.contentViewModels[t]=s,i}_createTextVMParams(e){const{graphic:t,_fieldInfoMap:i,_sourceLayer:s,_expressionAttributes:o}=this;if(e&&e.text){const r=t?.attributes??{},a=this.formattedAttributes?.global??{};e.text=H({attributes:r,fieldInfoMap:i,globalAttributes:a,expressionAttributes:o,layer:s,text:e.text})}return{graphic:t,creator:e.text}}_compileText(e,t){const i=e.clone();return this.contentViewModels[t]=new T(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:e,_sourceLayer:t,graphic:i,timeZone:s}=this;if(!e)return;const{lastEditInfoEnabled:o}=e,r=t?.editFieldsInfo;return o&&r?q(r,i?.attributes,s,t):void 0}_compileTitle(e){const{_fieldInfoMap:t,_sourceLayer:i,graphic:s,_expressionAttributes:o}=this,r=s?.attributes??{},a=this.formattedAttributes?.global??{};return H({attributes:r,fieldInfoMap:t,globalAttributes:a,expressionAttributes:o,layer:i,text:e})}async _getTitle(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?z({type:"title",value:e?.title,event:{graphic:t}}):null}async _getContent(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?z({type:"content",value:e?.content,event:{graphic:t}}):null}_evaluateExpressionAttributes({title:e,content:t,expressionInfos:i}){this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=r(async s=>{const{graphic:o,map:r,view:a,spatialReference:n,location:p}=this;try{if(!o)return;let l;if(null!=i){const e=[];for(const[t,l]of i.expressions.entries())null!=l?e.push(l.evaluate({graphic:o,interceptor:te.interceptor,location:p,map:r,options:{signal:s},spatialReference:n,view:a}).then(e=>[t,"string"==typeof e?k(e):e]).catch(()=>[t,void 0])):e.push(Promise.resolve([t,void 0]));l=Object.fromEntries(await Promise.all(e)),h(s)}this._expressionAttributes=l,this._graphicExpressionAttributes={...o.attributes,...l},this._set("formattedAttributes",this._createFormattedAttributes(t)),this._set("title",this._compileTitle(e)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(t)||null)}catch(c){d(c)||(this._error=c,l.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:c,graphic:o,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){const{_effectivePopupTemplate:s,graphic:o,relatedInfos:r,_sourceLayer:a,_fieldInfoMap:n,_graphicExpressionAttributes:l,timeZone:p}=this;i.content[t]=Q({fieldInfos:s?.fieldInfos,graphic:o,attributes:{...l,...e.attributes},layer:a,fieldInfoMap:n,relatedInfos:r,timeZone:p})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){if(e.fieldInfos){const{graphic:s,relatedInfos:o,_sourceLayer:r,_fieldInfoMap:a,_graphicExpressionAttributes:n,timeZone:l}=this;i.content[t]=Q({fieldInfos:e.fieldInfos,graphic:s,attributes:{...n,...e.attributes},layer:r,fieldInfoMap:a,relatedInfos:o,timeZone:l})}}_createFormattedAttributes(e){const{_effectivePopupTemplate:t,graphic:i,relatedInfos:s,_sourceLayer:o,_fieldInfoMap:r,_graphicExpressionAttributes:a,timeZone:n}=this,l=t?.fieldInfos,p={global:Q({fieldInfos:l,graphic:i,attributes:a,layer:o,fieldInfoMap:r,relatedInfos:s,timeZone:n}),content:[]};return Array.isArray(e)&&e.forEach((e,t)=>{"fields"===e.type&&this._createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:p}),"media"===e.type&&this._createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:p})}),p}_checkForRelatedFeatures(e){const{graphic:t,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(t,O(i),e)}async _queryRelatedInfos(e,t,i){const{relatedInfos:s,_sourceLayer:o}=this;s.clear();const r=null!=o?.associatedLayer?await(o?.associatedLayer.load(i)):o;if(!r||!e)return;const a=t.filter(e=>!!e.fieldName&&G(e.fieldName));if(!a?.length)return;t.forEach(e=>this._configureRelatedInfo(e,r));const n=await J({relatedInfos:s,layer:r},i);Object.keys(n).forEach(e=>{const t=s.get(e.toString()),i=n[e]?.value;t&&i&&(t.layerInfo=i.data)});const l=await K({graphic:e,relatedInfos:s,layer:r},i);Object.keys(l).forEach(e=>{W(l[e]?.value,s.get(e.toString()))})}_configureRelatedInfo(e,t){const{relatedInfos:i}=this,s=X(e.fieldName||"");if(!s)return;const{layerId:o,fieldName:r}=s;if(!o)return;const a=i.get(o.toString())||Y(o,t);a&&($({relatedInfo:a,fieldName:r,fieldInfo:e}),this.relatedInfos.set(o,a))}};e([g()],ne.prototype,"_error",void 0),e([g()],ne.prototype,"_graphicChangedTask",void 0),e([g()],ne.prototype,"_evaluateExpressionAttributesTask",void 0),e([g()],ne.prototype,"_associationVMAbortController",void 0),e([g({readOnly:!0})],ne.prototype,"_effectivePopupTemplate",null),e([g({readOnly:!0})],ne.prototype,"_fieldInfoMap",null),e([g({readOnly:!0})],ne.prototype,"_sourceLayer",null),e([g()],ne.prototype,"abilities",void 0),e([b("abilities")],ne.prototype,"castAbilities",null),e([g({readOnly:!0})],ne.prototype,"content",void 0),e([g({readOnly:!0})],ne.prototype,"contentViewModels",void 0),e([g()],ne.prototype,"description",void 0),e([g({type:Boolean})],ne.prototype,"defaultPopupTemplateEnabled",void 0),e([g({readOnly:!0})],ne.prototype,"isFeatureFromTable",null),e([g({readOnly:!0})],ne.prototype,"state",null),e([g({readOnly:!0})],ne.prototype,"formattedAttributes",void 0),e([g({type:t,value:null})],ne.prototype,"graphic",null),e([g({readOnly:!0})],ne.prototype,"lastEditInfo",void 0),e([g({type:w})],ne.prototype,"location",void 0),e([g({readOnly:!0})],ne.prototype,"relatedInfos",void 0),e([g({type:A})],ne.prototype,"spatialReference",null),e([g()],ne.prototype,"timeZone",null),e([g({readOnly:!0})],ne.prototype,"title",void 0),e([g()],ne.prototype,"map",null),e([g({readOnly:!0})],ne.prototype,"waitingForContent",null),e([g()],ne.prototype,"view",void 0),ne=te=e([v("esri.widgets.Feature.FeatureViewModel")],ne);export{ne as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSupportedLayer as e}from"../../../arcade/featureset/support/shared.js";import r from"../../../core/Logger.js";import t from"../../../layers/FeatureLayer.js";import{applyTextFormattingHTML as a,htmlEntities as n}from"./featureUtils.js";
|
|
5
|
+
import{isSupportedLayer as e}from"../../../arcade/featureset/support/shared.js";import r from"../../../core/Logger.js";import t from"../../../layers/FeatureLayer.js";import{applyTextFormattingHTML as a,htmlEntities as n}from"./featureUtils.js";const o="esri.widgets.Feature.support.arcadeFeatureUtils",i=()=>r.getLogger(o);function s(e){return a(n(e))}function c(e){return"createQuery"in e&&"queryFeatures"in e}async function p({graphic:e,view:r,options:t}){const{isAggregate:a,layer:n}=e;if(!a||!n||"2d"!==r?.type)return[];const o=await r.whenLayerView(n);if(!c(o))return[];const i=o.createQuery(),s=e.getObjectId();i.aggregateIds=null!=s?[s]:[];const{features:p}=await o.queryFeatures(i,t);return p}function u({layer:e,aggregatedFeatures:r,interceptor:a}){const{fields:n,objectIdField:o,geometryType:i,spatialReference:s,displayField:c}=e;return new t({fields:n,objectIdField:o,geometryType:i,spatialReference:s,displayField:c,interceptor:a,..."feature"===e.type?{templates:e.templates,typeIdField:e.typeIdField,types:e.types}:null,source:r})}function d(e){const r="esri.views.3d.layers.VoxelGraphic"===e.declaredClass;return e.isAggregate?"popup-feature-reduction":r?"popup-voxel":"popup"}function l(e){return{scale:e?.scale,timeProperties:{currentStart:e?.timeExtent?.start,currentEnd:e?.timeExtent?.end,startIncluded:!0,endIncluded:!0}}}function f(e){return{$voxel:e}}async function y(e,r,t,a,n){let o=null;if(n.has("$aggregatedfeatures")){const n=await p({graphic:e,view:r,options:t}),i=e.sourceLayer||e.layer;o=u({layer:i,aggregatedFeatures:n,interceptor:a})}return{vars:{$feature:e,$aggregatedFeatures:o,$view:l(r)},[Symbol.dispose]:()=>o?.[Symbol.dispose]()}}function g(r,t,a,n){const o=(r.sourceLayer||r.layer)??void 0;return{$feature:r,$layer:null!=o&&e(o)?o:"scene"===o?.type&&null!=o.associatedLayer?o.associatedLayer:void 0,$map:t,$datastore:o?.url,$userInput:a,$graph:"knowledge-graph-sublayer"===o?.type?o?.parentCompositeLayer?.knowledgeGraph:void 0,$view:l(n)}}async function w(e,{graphic:r,map:t,location:a,view:n,options:o,interceptor:i,arcadeExecutor:s}){switch(e){case"popup":return{vars:g(r,t,a,n),[Symbol.dispose](){}};case"popup-feature-reduction":{const e=new Set(s.variablesUsed);return await y(r,n,o,i,e)}case"popup-voxel":return{vars:f(r),[Symbol.dispose](){}};default:throw new Error(`Unexpected profile name ${e}`)}}async function m({expressionInfo:e,createArcadeExecutor:r,createArcadeProfile:t,graphic:a}){const n=e?.expression;if(!n)return null;const o=d(a),s=t(o);let c;try{c=await r(n,s)}catch(u){return i().error("arcade-executor-error",{error:u,expressionInfo:e}),null}const p=new Set;return c.variablesUsed.includes("$view")&&(c.variablesUsed.includes("scale")&&p.add("view-scale"),c.variablesUsed.includes("timeproperties")&&p.add("view-time-extent")),{dependencies:p,async evaluate({graphic:r,interceptor:t,location:a,map:n,options:s,spatialReference:p,view:d}){const l=await w(o,{graphic:r,map:n,location:a,view:d,options:s,interceptor:t,arcadeExecutor:c}),f={abortSignal:s?.signal??void 0,interceptor:t??void 0,rawOutput:!0,spatialReference:p??void 0,timeZone:d?.timeZone,console(...e){i().info(...e)}};try{return await c.executeAsync(l.vars,f)}catch(u){if(s?.signal?.aborted)return;return void i().error("arcade-execution-error",{error:u,graphic:r,expressionInfo:e})}finally{l[Symbol.dispose]()}}}}async function v(e,r){if(!e?.length)return{dependencies:new Set,expressions:new Map};const{createArcadeExecutor:t,createArcadeProfile:a}=await import("../../../arcade.js"),n=new Set,o=new Map;for(const i of e){const e=await m({expressionInfo:i,createArcadeExecutor:t,createArcadeProfile:a,graphic:r});o.set(`expression/${i.name}`,e),e?.dependencies.forEach(e=>n.add(e))}return{dependencies:n,expressions:o}}export{m as compileExpression,v as compileExpressionInfos,s as formatArcadeValue};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{prefersReducedMotion as t}from"../core/a11yUtils.js";import{createTask as i}from"../core/asyncUtils.js";import a from"../core/Collection.js";import{deprecatedProperty as s}from"../core/deprecate.js";import o from"../core/Logger.js";import{isAbortError as n}from"../core/promiseUtils.js";import{watch as r,initial as l,syncAndInitial as d,whenOnce as c}from"../core/reactiveUtils.js";import{property as g}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import{or as m}from"../layers/orientedImagery/transformations/utils.js";import u from"./Expand.js";import v from"./PanoramicViewer.js";import p from"./Widget.js";import{getAllArcPath as y}from"./OrientedImageryViewer/arcUtils.js";import{getDelegatedEvents as w,defaultImageGeometryField as _,defaultOIObjectIDField as T,segmentArcs as M,featureCircleRadius as b,navigationToolDimensionLength as C,sectorsRadii as A}from"./OrientedImageryViewer/constants.js";import{css as I,navigation as f,navigationToolRotationFrom as L,navigationToolRotationTo as k,root as V}from"./OrientedImageryViewer/css.js";import{loadImageForAttachment as S,getThumbnailPixelBlock as O,isFeatureAttachment as E,renderImageWithRotation as F}from"./OrientedImageryViewer/galleryUtils.js";import P from"./OrientedImageryViewer/OrientedImageryViewerViewModel.js";import x from"./OrientedImageryViewer/OrientedImageryViewerVisibleElements.js";import{loadAlertComponents as H,Alert as j}from"./OrientedImageryViewer/components/Alert.js";import G from"./OrientedImageryViewer/components/ImageLocationWidget.js";import D from"./OrientedImageryViewer/components/ImageViewer.js";import $ from"./OrientedImageryViewer/components/NavigationAction.js";import{NavigationActionsCollection as N,NavigationActions as B}from"./OrientedImageryViewer/components/NavigationActions.js";import{NoImageLoadedError as R}from"./OrientedImageryViewer/navigation/errors.js";import{loadCalciteComponents as W}from"./support/componentsUtils.js";import{globalCss as U}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as z}from"./support/decorators/messageBundle.js";import{vmEvent as q}from"./support/decorators/vmEvent.js";import{tsx as Z,tsxFragment as J}from"./support/jsxFactory.js";import{substitute as K}from"../intl/substitute.js";const Q={overlayed:"overlayed"};let X=class extends p{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 P,this.messagesCommon=null,this.messagesSketch=null,this.pixelMeasurementUnit="meters",this.pixelAreaMeasurementUnit="square-meters",this.showCameraLocations=!1,this.showMapFeatures=!1,this.visibleElements=new x,this._imageOverlaysLoaderTask=null,this._imageMeasurementToolsLoaderTask=null,this._navigationSettingsLoaderTask=null,this._clearMeasurements=()=>{this.viewModel.measureType=null,this.viewModel.clearPreviousMeasurements()},this._clearImageLocation=()=>{this.imageLocationToolActive=!1},this._navigationToolExpanded=!1,this._navigationTool=null,this._galleryController=new AbortController,this._galleryObserver=new IntersectionObserver(this._lazyLoadImage.bind(this)),this._overlayedLayers=new a,this._previousAction=null,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(r(()=>t.visible,()=>{this.viewModel.toggleOverlayMapFeatures(t.id,t.visible)}),`${Q.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&&m(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=()=>{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 u({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=()=>{this.viewModel.toggleImageAttributes()},this.navigate=async e=>{let t=null;try{const{currentNode:i}=this.viewModel;if(!i)throw new R;t=await this.viewModel.navigate(i,e)}catch(i){n(i)||o.getLogger(this).error("Error occurred while navigating",i)}return t},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)}initialize(){this.addHandles([r(()=>[this.viewModel?.bestFeatureAngle,this._navigationTool],([e,t])=>{t&&this._updateNavigationTool(t)},l),r(()=>this.currentCoverageVisible,e=>this._onCurrentCoverageVisibilityChange(e)),r(()=>this.isAdditionalCoverageVisible,e=>this._onAdditionalCoverageVisibilityChange(e)),r(()=>this.isAdditionalPointSourcesVisible,e=>this._onAdditionalCameraLocationsVisibility(e)),r(()=>({features:this.currentBestFeature,showCameraLocations:this.showCameraLocations,state:this.viewModel.state}),({showCameraLocations:e,state:t})=>{"image-loaded"===t&&this.viewModel.overlayCameraLocations(e)},d),r(()=>({feature:this.currentBestFeature,showMapFeatures:this.showMapFeatures,state:this.viewModel.state}),async(e,t)=>{if(e.showMapFeatures!==t?.showMapFeatures&&this.viewModel.toggleAllOverlayMapFeatures(e.showMapFeatures),null!=e.feature&&e.feature!==t?.feature){if(this.viewModel.removeAllOverlayMapFeatures(),await c(()=>"image-loaded"===this.viewModel.state),this.dataCaptureLayer&&this.stopDataCapture(),await this._restoreOverlays(),!this.dataCaptureLayer)return;await this.startDataCapture(this.dataCaptureLayer),this._previousAction?.active&&(this._previousAction.active=!1,this._previousAction=null)}},l)])}loadDependencies(){return Promise.all([W({"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"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),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"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider")}),H()])}destroy(){this._galleryController.abort(),this._galleryObserver.disconnect()}get accuracyParametersMissing(){return this.viewModel.accuracyParametersMissing}get activeLayer(){return s(o.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){s(o.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(){const{layer:e}=this;if(!e)return!1;const{fields:t,sequenceOrderField:i}=e;return t.some(({name:e})=>e.toLowerCase()===`${i??"sequenceorder"}`.toLowerCase())}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 disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get displayMessage(){return this.viewModel.displayMessage}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.mapImageConversionToolState=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&&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 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}set updateFootprint(e){this.viewModel.updateFootprint=e}get updateFootprint(){return this.viewModel.updateFootprint}_renderActionBar(){return Z("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},Z("calcite-action-group",null,this._currentFootprintToggle(),this._additionalFootprintToggle(),this._additionalPointSourcesToggle()),Z("calcite-action-group",null,this._directionToolToggle(),this._mapImageConversionToggle(),this._navigationToolToggle(),this._imageEnhancementsToggle(),this._videoEnhancementsToggle()),Z("calcite-action-group",null,this._measurementToolsToggle(),this._imageGalleryToggle(),this._imageOverlaysToggle(),this._openPopupAction()))}_renderEnhancementSlider({title:e,value:t,handleChange:i}){return Z("div",{class:I.imageEnhancementToolContainer},Z("calcite-label",null,e,Z("calcite-slider",{bind:this,labelTicks:!0,max:10,min:0,ticks:2,value:t,onCalciteSliderInput:i})))}get _activeMeasurementIcon(){const{measureType:e,imageLocationToolActive:t}=this;if(t)return"pin-tear";switch(e){case"area":return"measure-area";case"height":return"measure-building-height-top-base";default:return"measure-line"}}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?Z("calcite-action",{active:e,bind:this,class:I.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?Z("calcite-action",{active:e,bind:this,class:I.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?Z("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},Z(o,{measurementType:t,measurementUnitMessages:this.measurementUnitMessages,messages:this.messages,oiViewModel:this.viewModel})):null}get _renderRoot(){const{viewModel:{state:e},triangularMeasurementActive:t}=this;return Z("calcite-panel",{bind:this,class:t?I.viewerContainerMeasurement:I.viewerContainer,heading:this.visibleElements.title?this.messages.title:void 0,loading:e.includes("loading")&&!t},this.visibleElements.menu?this._renderActionBar():null,Z("calcite-shell",null,Z("calcite-panel",null,this._imageViewer,this._panoramicViewer,this._videoViewer,this._messageBox,this.invalidCameraHeading?this._renderWarning(this.messages.invalidCameraHeadingWarningTitle,this.messages.invalidCameraHeadingWarningDescription):[this._imageGalleryPanel,this._renderNavigation,this._imageOverlaysPanel()],this._imageEnhancementTools,this._videoEnhancementTools,this._renderSketch()),this._imageViewerTriangular,this._measurementToggle,this._locationToggle))}_currentFootprintToggle(){const{currentCoverageVisible:e,invalidCameraHeading:t}=this,{currentFootprintToggle:i}=this.visibleElements;return i?Z("calcite-action",{active:e,bind:this,class:I.currentCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleCurrentCoverage,text:this.messages.currentFootprint,title:this.messages.currentFootprint}):null}get _imageEnhancementTools(){const{imageEnhancementToolActive:e,viewModel:{brightness:t,contrast:i,sharpness:a,state:s}}=this;return e&&"image-loaded"===s?Z("calcite-panel",{bind:this,class:I.imageEnhancementWrapper,closable:!0,closed:!e,heading:this.messages.imageEnhancement,key:this.messages.imageEnhancement,onCalcitePanelClose:this._toggleImageEnhancementToolState},Z("div",{class:I.imageEnhancementTools},Z("div",{class:I.imageEnhancementToolContainer},Z("calcite-label",null,this.messages.brightness,Z("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:t,onCalciteSliderInput:this._handleBrightnessChange}))),Z("div",{class:I.imageEnhancementToolContainer},Z("calcite-label",null,this.messages.contrast,Z("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:i,onCalciteSliderInput:this._handleContrastChange}))),Z("div",{class:I.imageEnhancementToolContainer},Z("calcite-label",null,this.messages.sharpness,Z("calcite-slider",{bind:this,labelTicks:!0,max:1,min:0,step:.1,ticks:.5,value:a,onCalciteSliderInput:this._handleSharpnessChange})))),Z("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{videoEnhancementToolActive:e,viewModel:{videoViewModel:t,mode:i},messages:{videoEnhancement:a,brightness:s,contrast:o},messagesCommon:{reset:n}}=this;return e&&"video"===i&&t?Z("calcite-panel",{bind:this,class:I.imageEnhancementWrapper,closable:!0,closed:!e,heading:a,key:a,onCalcitePanelClose:this._toggleVideoEnhancementToolState},Z("div",{class:I.imageEnhancementTools},this._renderEnhancementSlider({title:s,value:t.videoBrightness,handleChange:this._handleVideoBrightnessChange}),this._renderEnhancementSlider({title:o,value:t.videoContrast,handleChange:this._handleVideoContrastChange})),Z("calcite-action",{bind:this,icon:"reset",onclick:this._resetVideoTools,slot:"header-actions-end",text:n})):null}_imageEnhancementsToggle(){const{state:e,mode:t}=this.viewModel,{imageEnhancement:i}=this.visibleElements;return i&&"video"!==t?Z("calcite-action",{active:this.imageEnhancementToolActive,bind:this,disabled:"default"!==t||"image-loaded"!==e,icon:"sliders-horizontal",onclick:this._toggleImageEnhancementToolState,text:this.messages.imageEnhancement,title:this.messages.imageEnhancement}):null}_videoEnhancementsToggle(){const{mode:e}=this.viewModel,{videoEnhancement:t}=this.messages;return"video"===e?Z("calcite-action",{active:this.imageEnhancementToolActive,bind:this,disabled:"video"!==e,icon:"sliders-horizontal",onclick:this._toggleVideoEnhancementToolState,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 Z("calcite-panel",{bind:this,class:I.carousel,closable:!0,closed:!e,disabled:t,heading:this.messages.imageGallery,key:this.messages.imageGallery,onCalcitePanelClose:this._toggleImageGallery},Z("div",{class:I.carouselContainer},this._renderThumbnails))}_imageGalleryToggle(){const{imageGalleryEnabled:e,invalidCameraHeading:t,visibleElements:{imageGallery:i}}=this;return i?Z("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:a,dataCaptureEnabled:s,dataCaptureLayer:o,imageOverlaysOpened:n,showCameraLocations:r,showMapFeatures:l,view:d,layer:c}=this;if(!c)return null;const g=c.imageGeometryField?.length?c.imageGeometryField:_,h=c.imageReferenceField?.length?c.imageReferenceField:T;t||(this._imageOverlaysLoaderTask=i(async()=>(await import("./OrientedImageryViewer/components/ImageOverlays.js")).default));const m=this._imageOverlaysLoaderTask?.value;return m?Z(m,{closed:!n,dataCaptureEnabled:s,dataCaptureLayer:o,imageGeometryField:g,imageReferenceField:h,messages:e,overlayedLayers:a,showCameraLocations:r,showMapFeatures:l,view:d,onDataCaptureLayerChanged:this._handleDataCaptureLayerChange,onImageOverlaysClosed:this._onImageOverlayClosed,onLayerDeselected:this._handleOverlayLayerDeselect,onLayerSelected:this._handleOverlayLayerSelect,onShowCameraLocationsChanged:this._onShowCameraLocationsChanged,onShowMapFeaturesChanged:this._onShowMapFeaturesChanged}):null}get _imageOverlayMessages(){return{...this.messages,...this.messagesSketch}}get _imageSketchToolsMessages(){return{...this.messagesSketch,...this.messagesCommon}}_imageOverlaysPanel(){const{imageOverlaysOpened:e,viewModel:{state:t}}=this,i=this.classes({[I.imageOverlaysContainer]:!0,[U.hidden]:!e||"image-loaded"!==t});return Z("div",{class:i,key:this.messages.imageOverlays},this._imageOverlaysComponent)}_imageOverlaysToggle(){const{viewModel:{state:e},imageOverlaysOpened:t,invalidCameraHeading:i,visibleElements:{imageOverlays:a}}=this;return a?Z("calcite-action",{active:t,bind:this,disabled:"image-loaded"!==e||i,icon:"layers",onclick:this._toggleImageOverlays,text:this.messages.imageOverlays,title:this.messages.imageOverlays}):null}get _imageViewer(){const{displayMessage:e,loadImageViewer:t,mode:i,clickAction:a,state:s}=this.viewModel,o=null!=e||"default"!==i||s.includes("loading"),{messages:{end:n,next:r,previous:l,start:d}}=this;return Z(D,{afterCreate:t,clickAction:a,navigationEnabled:!o&&null!==this.navigationMode,navigationViewModel:this.viewModel,uiStrings:{end:n,next:r,previous:l,start:d},visible:!o})}get _imageViewerTriangular(){const{messages:e,triangularMeasurementActive:t}=this,{displayMessage:i,storeImageMeasurementViewer:a,mode:s,state:o,clickAction:n}=this.viewModel,r=null!=i||"default"!==s,l=this.classes({[I.viewer]:!r,[I.viewerHidden]:r});return t?Z("calcite-panel",{class:I.viewerContainerMeasurement,heading:e.measurementViewerHeading,loading:o.includes("loading")},Z("calcite-panel",{bind:this,class:l},Z(D,{afterCreate:a,clickAction:n,uiStrings: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({[I.viewer]:!r,[I.viewerHidden]:r});return Z("calcite-panel",{bind:this,class:l},Z("div",{afterCreate:t,styles:{height:"100%"}}),Z("calcite-slider",{bind:this,labelHandles:!0,labelTicks:!0,max:i?.videoDuration,minLabel:"0",value:i?.currentTime??0,onCalciteSliderChange:this._sliderChangeHandler}),Z("calcite-action-bar",{expandDisabled:!0,layout:"horizontal"},Z("calcite-action-group",null,Z("calcite-action",{bind:this,icon:this.activeVideoIcon,onclick:()=>i?.playVideoHandler(),text:"Play",title:i?.videoPaused?a.play:a.pause})),Z("calcite-action-group",null,Z("calcite-action",{bind:this,icon:"refresh",onclick:()=>i?.rewindVideoHandler(),text:"Rewind",title:s})),Z("calcite-action-group",null,Z("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 Z("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},Z(G,{accuracy:i,groundCoordinates:l,messages:this.messages}))}_mapImageConversionToggle(){const{mapImageConversionToolState:e,viewModel:{state:t},invalidCameraHeading:i,visibleElements:{mapImageConversionTool:a}}=this;return a?Z("calcite-action",{active:e,bind:this,disabled:"image-loaded"!==t||i,icon:"image-pin",onclick:this._toggleMapImageConversionToolState,text:this.messages.mapImageConversionTool,title:this.messages.mapImageConversionTool}):null}_measurementToolsToggle(){const{_activeMeasurementIcon:e,measureType:t,viewModel:i,accuracyParametersMissing:a,messages:s,triangularMeasurementActive:o,visibleElements:{measurementTools:n}}=this,{state:r,mode:l}=i,{measurementTools:d,groundDistance:c,groundArea:g,heightAboveGround:h,groundLocation:m,triangulatedDistanceHeading:u,triangulatedAreaHeading:v,triangulatedLocationHeading:p}=s;return n?Z("calcite-dropdown",{disabled:a,key:"measurement-tools",maxItems:5,title:d,width:"m"},Z("calcite-action",{bind:this,disabled:"image-loaded"!==r||a,icon:e,slot:"trigger",text:d}),Z("calcite-dropdown-group",null,Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-line",key:"distance-measurement",onclick:e=>this._toggleMeasurementSketch(e,"distance"),selected:"distance"===t&&!o},c),Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-area",key:"area-measurement",onclick:e=>this._toggleMeasurementSketch(e,"area"),selected:"area"===t&&!o},g),Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-building-height-top-base",key:"height-dropdown",onclick:e=>this._toggleMeasurementSketch(e,"height"),selected:"height"===t},h),Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"pin-tear",key:"surface-location",onclick:this._toggleLocationTool,selected:!!this.imageLocationToolActive&&!o},m),"default"===l&&Z(J,null,Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"dual-image-distance",key:"triangular-measurement-distance",selected:!!o&&"distance"===this.measureType,onCalciteDropdownItemSelect:this._toggleTriangularDistanceMeasurements},u),Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"dual-image-area",key:"triangular-measurement-area",selected:!!o&&"area"===this.measureType,onCalciteDropdownItemSelect:this._toggleTriangularAreaMeasurements},v),Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"dual-image-location",key:"triangular-location",selected:!!o&&this.imageLocationToolActive,onCalciteDropdownItemSelect:this._toggleTriangularLocation},p)))):null}get _messageBox(){const{messages:e,viewModel:{displayMessage:t,mode:i}}=this;if(!t||"video"===i)return null;const{data:a,key:s,map:o}=t,n=`${o?K(e[s],o):e[s]}`;return Z("span",{class:I.messageBox},a?`${n} ${a}`:n)}async _loadNavigationSettings(){return this._navigationSettingsLoaderTask||(this._navigationSettingsLoaderTask=i(async()=>(await import("./OrientedImageryViewer/components/NavigationSettings.js")).default)),await this._navigationSettingsLoaderTask.promise}_navigationToolToggle(){const{state:e}=this.viewModel,{visibleElements:{navigationTool:t}}=this;return t?Z("calcite-action",{active:this.navigationToolActive,bind:this,disabled:"image-loaded"!==e||this.invalidCameraHeading,icon:"explore",onclick:this._toggleNavigationTool,text:this.messages.navigationTool,title:this.messages.navigationTool}):null}_directionToolToggle(){const{state:e}=this.viewModel,{visibleElements:{directionalNavigation:t,sequentialNavigation:i}}=this,a=new N;t&&a.push(new $({active:"directional"===this.navigationMode,disabled:"image-loaded"!==e||this.invalidCameraHeading,icon:"i2DExplore",onclick:()=>{this._toggleImageNavigation("directional")},text:this.messages.directionalNavigation,title:this.messages.directionalNavigationDescription})),i&&a.push(new $({active:"sequential"===this.navigationMode,disabled:"image-loaded"!==e||this.invalidCameraHeading||!this.canNavigateSequentially,icon:"reorder-stack",onclick:()=>{this._toggleImageNavigation("sequential")},text:this.messages.sequentialNavigation,title:this.messages.sequentialNavigationDescription}));return t||i?Z(B,{actions:a,activeAction:a.items.find(e=>e.active),icon:"absolute-direction",label:this.messages.imageNavigation,scale:"m",title:this.messages.imageNavigation}):null}_openPopupAction(){const{showPopupsAction:e}=this.visibleElements;return e?Z("calcite-action",{bind:this,disabled:!this.popupEnabled,icon:"popup",onclick:this._toggleImageAttributes,text:this.messages.showPopups,title:this.messages.showPopups}):null}get _panoramicViewer(){const{displayMessage:e,loadPanoramicViewer:t,mode:i,clickAction:a,state:s}=this.viewModel,{messages:{end:o,next:n,previous:r,start:l}}=this,d=null!=e||"panoramic"!==i||s.includes("loading");return Z(v,{afterCreate:t,clickAction:a,navigationEnabled:!d&&null!==this.navigationMode,navigationViewModel:this.viewModel,uiStrings:{end:o,next:n,previous:r,start:l},visible:!d})}_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.imageEnhancementToolActive=!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)}_handleSharpnessChange(e){this.viewModel.sharpness=e.currentTarget.value??0}_lazyLoadImage(e,t){e.forEach(async e=>{if(e.isIntersecting){const a=e.target,s=a.getAttribute("data-src"),r=a.getAttribute("data-rotation"),l=a.getAttribute("data-objectid"),d=r?parseFloat(r)%360:0,{layer:c,_galleryController:{signal:g}}=this;if(!s||!l)return;let h;try{h=E(s)?await S(c,l,{signal:g}):await O(s,{signal:g})}catch(i){n(i)||o.getLogger("esri.widgets.OrientedImageryViewer").error("#lazyLoadImage()",i)}finally{t.unobserve(a)}if(!h)return;F(h,a,d)}})}_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=i(async()=>{const{default:e}=await import("./OrientedImageryViewer/components/ImageMeasurementWidget.js");return e})}_loadSketchResources(){this._sketchLoaderTask=i(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){const{viewModel:{state:i}}=this;return"image-loaded"===i?Z(j,{icon:"exclamation-mark-triangle-f",kind:"warning",message:t,open:!0,title:e,tooltip:t}):null}get _renderNavigation(){const{viewModel:{sectorData:e,navigatorCurrentBestFeature:i,currentBestFeature:a,state:s}}=this;if(!this.container||!a)return null;let o,n,r,l,d;if(i){const{x:e,y:t,direction:a}=i,[s,c,g,h]=M[a];o=`M ${e} ${t} L ${s} ${c} A ${A[2]} ${A[2]} 0 0 1 ${g} ${h} Z`,n=e,l=t,r=M[a][4],d=M[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=a.attributes.objectId,u=e?.map(e=>e?.items).filter(Boolean).flatMap(e=>e?.map(({x:e,y:t,objectID:i,featureIndexInSector:a,sector:s})=>Z("circle",{afterRemoved:h,class:this.classes(I.feature,{selected:m===i}),cx:e,cy:t,"data-feature-index-in-sector":a,"data-sector":s,key:`${I.feature}-${i}`,onclick:g,r:b}))),v=e=>{e.removeEventListener("click",c)},p=this.classes({[I.navigationWrapper]:!0,[I.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&"image-loaded"===s?Z("div",{bind:this,class:p,key:this.messages.navigationTool},Z("svg",{afterCreate:e=>this._storeNavigationToolReference(e),class:t()?f:I.rotateWithAnimation,focusable:"false",height:C,role:"img",width:C,xmlns:"http://www.w3.org/2000/svg"},Z("defs",null,Z("linearGradient",{gradientUnits:"userSpaceOnUse",id:`${this.id}-coverage-fill`,x1:n,x2:r,y1:l,y2:d},Z("stop",{class:I.navigationPathOffset0,offset:0}),Z("stop",{class:I.navigationPathOffset1,offset:1}))),Z("g",null,Z("circle",{class:this.classes(I.sector,I.outerSector),cx:A[3],cy:A[3],onclick:this._scaleNavigationTool,r:A[3]}),Z("circle",{class:I.sector,cx:A[3],cy:A[3],r:A[2]}),Z("circle",{class:I.sector,cx:A[3],cy:A[3],r:A[1]}),Z("circle",{class:I.sector,cx:A[3],cy:A[3],r:A[0]}),Z("path",{class:I.pointer,d:"M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z",key:`${I.pointer}-west`}),Z("path",{class:this.classes(I.pointer,I.north),d:"M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z",key:`${I.pointer}-north`}),Z("path",{class:I.pointer,d:"M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z",key:`${I.pointer}-east`}),Z("path",{class:I.pointer,d:"M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z",key:`${I.pointer}-south`}),Z("path",{class:this.classes(I.sector,I.sectorSeparator),d:"M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076",key:I.sectorSeparator}),y([A[2],A[1],A[0]],A[3],A[3]).map((t,i)=>Z("path",{afterRemoved:v,class:this.classes(I.sector,e?.[i]?.length?I.sectorEnabled:I.sectorDisabled),d:t,"data-sector":`${i}`,key:`${I.sector}-${i}`,onclick:c})),Z("path",{class:this.classes(I.sector,I.sectorCross),d:"M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53",key:I.sectorCross}),u,a.attributes.cameraPitch>=5&&o?Z("path",{class:I.selectedFeaturePath,d:o,fill:`url(#${this.id}-coverage-fill)`,key:I.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 Z("div",{class:I.sketchTools},Z(s,{icon:a,messages:this._imageSketchToolsMessages,type:i,onAction:this._onAction}))}get _renderThumbnails(){const{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?Z("div",{class:I.carouselContent},t?.items.map(({url:t,objectId:i,rotation:a},s)=>Z("div",{class:`${I.carouselItemWrapper}${e.attributes.objectId===i?"--selected":""}`,key:`${I.carouselItemWrapper}-${s}`},Z("canvas",{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${i}`,class:I.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()}_sliderChangeHandler(e){const t=this.viewModel?.videoElement?.content;t&&(t.currentTime=e.target.value,t.play())}_storeNavigationToolReference(e){this._navigationTool=e}_toggleAdditionalCameraLocations(){this.isAdditionalPointSourcesVisible=!this.isAdditionalPointSourcesVisible}_toggleAdditionalCoverage(){this.isAdditionalCoverageVisible=!this.isAdditionalCoverageVisible}_toggleCurrentCoverage(){this.currentCoverageVisible=!this.currentCoverageVisible}_toggleImageEnhancementToolState(e){e.stopPropagation();const t=this.imageEnhancementToolActive;this._closeAllImageTools(),this.imageEnhancementToolActive=!t}_toggleVideoEnhancementToolState(e){e.stopPropagation(),this.videoEnhancementToolActive=!this.videoEnhancementToolActive}_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(L,`${t}deg`),e.style.setProperty(k,`${t+a}deg`)}async loadBestImage(e){return this.viewModel.loadBestImage(e)}loadImageFromSource(e,t){return this.viewModel.loadImageFromSource(e,t)}async overlayMapFeatures(e,t){return this.removeHandles(`${Q.overlayed}-${e.id}`),this.addHandles(r(()=>e.visible,()=>{this.viewModel.toggleOverlayMapFeatures(e.id,e.visible)}),`${Q.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(`${Q.overlayed}-${e}`),this._overlayedLayers.remove(this._overlayedLayers.find(t=>t.id===e)),this.viewModel.removeOverlayedGraphicsOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return Z("div",{class:this.classes(U.widget,V)},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([g({readOnly:!0})],X.prototype,"accuracyParametersMissing",null),e([g()],X.prototype,"activeLayer",null),e([g()],X.prototype,"activeVideoIcon",null),e([g()],X.prototype,"activeAudioIcon",null),e([g()],X.prototype,"cameraHeadingThreshold",null),e([g()],X.prototype,"cameraPitchThreshold",null),e([g()],X.prototype,"canNavigateSequentially",null),e([g()],X.prototype,"currentBestFeature",null),e([g()],X.prototype,"currentCoverageVisible",null),e([g()],X.prototype,"dataCaptureEnabled",void 0),e([g()],X.prototype,"dataCaptureLayer",null),e([g()],X.prototype,"disabled",null),e([g()],X.prototype,"features",null),e([g()],X.prototype,"imagePointsInView",null),e([g()],X.prototype,"galleryOpened",void 0),e([g()],X.prototype,"icon",null),e([g()],X.prototype,"imageEnhancementToolActive",void 0),e([g()],X.prototype,"videoEnhancementToolActive",void 0),e([g({readOnly:!0})],X.prototype,"imageGalleryEnabled",null),e([g()],X.prototype,"imageLocationToolActive",null),e([g()],X.prototype,"imageOverlaysOpened",void 0),e([g({readOnly:!0})],X.prototype,"invalidCameraHeading",null),e([g()],X.prototype,"isAdditionalCoverageVisible",null),e([g()],X.prototype,"isAdditionalPointSourcesVisible",null),e([g()],X.prototype,"mapImageConversionToolState",null),e([g()],X.prototype,"measureType",null),e([g()],X.prototype,"layer",null),e([g()],X.prototype,"navigationToolActive",void 0),e([g()],X.prototype,"navigationMode",null),e([q(w()),g({type:P})],X.prototype,"viewModel",void 0),e([g(),z("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],X.prototype,"messages",void 0),e([g(),z("esri/core/t9n/Units")],X.prototype,"measurementUnitMessages",void 0),e([g(),z("esri/t9n/common")],X.prototype,"messagesCommon",void 0),e([g(),z("esri/widgets/Sketch/t9n/Sketch")],X.prototype,"messagesSketch",void 0),e([g()],X.prototype,"pixelMeasurementUnit",void 0),e([g()],X.prototype,"pixelAreaMeasurementUnit",void 0),e([g({readOnly:!0})],X.prototype,"popupEnabled",null),e([g()],X.prototype,"referencePoint",null),e([g()],X.prototype,"showCameraLocations",void 0),e([g()],X.prototype,"showMapFeatures",void 0),e([q(["create","delete","redo","undo","update"]),g({readOnly:!0})],X.prototype,"sketchViewModel",null),e([g()],X.prototype,"triangularMeasurementActive",null),e([g()],X.prototype,"view",null),e([g({type:x,nonNullable:!0})],X.prototype,"visibleElements",void 0),e([g()],X.prototype,"determineWorkflowForFeature",null),e([g()],X.prototype,"updateFootprint",null),e([g()],X.prototype,"_activeMeasurementIcon",null),e([g()],X.prototype,"_activeMeasurementHeading",null),e([g()],X.prototype,"_imageOverlaysLoaderTask",void 0),e([g()],X.prototype,"_imageMeasurementToolsLoaderTask",void 0),e([g()],X.prototype,"_navigationSettingsLoaderTask",void 0),e([g()],X.prototype,"_measurementToggle",null),e([g()],X.prototype,"_renderRoot",null),e([g()],X.prototype,"_imageEnhancementTools",null),e([g()],X.prototype,"_videoEnhancementTools",null),e([g()],X.prototype,"_imageGalleryPanel",null),e([g()],X.prototype,"_imageGalleryContext",null),e([g()],X.prototype,"_imageOverlaysComponent",null),e([g()],X.prototype,"_imageOverlayMessages",null),e([g()],X.prototype,"_imageSketchToolsMessages",null),e([g()],X.prototype,"_imageViewer",null),e([g()],X.prototype,"_imageViewerTriangular",null),e([g()],X.prototype,"_videoViewer",null),e([g()],X.prototype,"_locationToggle",null),e([g()],X.prototype,"_messageBox",null),e([g()],X.prototype,"_navigationToolExpanded",void 0),e([g()],X.prototype,"_navigationTool",void 0),e([g()],X.prototype,"_panoramicViewer",null),e([g()],X.prototype,"_renderNavigation",null),e([g()],X.prototype,"_renderThumbnails",null),e([g()],X.prototype,"_sketchLoaderTask",void 0),X=e([h("esri.widgets.OrientedImageryViewer")],X);const Y=X;export{Y as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{prefersReducedMotion as t}from"../core/a11yUtils.js";import{createTask as i}from"../core/asyncUtils.js";import a from"../core/Collection.js";import{deprecatedProperty as s}from"../core/deprecate.js";import o from"../core/Logger.js";import{isAbortError as n}from"../core/promiseUtils.js";import{watch as r,initial as l,syncAndInitial as d,whenOnce as c}from"../core/reactiveUtils.js";import{property as g}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import{or as m}from"../layers/orientedImagery/transformations/utils.js";import u from"./Expand.js";import v from"./PanoramicViewer.js";import p from"./Widget.js";import{getAllArcPath as y}from"./OrientedImageryViewer/arcUtils.js";import{getDelegatedEvents as w,defaultImageGeometryField as _,defaultOIObjectIDField as T,segmentArcs as M,featureCircleRadius as b,navigationToolDimensionLength as C,sectorsRadii as A}from"./OrientedImageryViewer/constants.js";import{css as I,navigation as f,navigationToolRotationFrom as L,navigationToolRotationTo as k,root as V}from"./OrientedImageryViewer/css.js";import{loadImageForAttachment as S,getThumbnailPixelBlock as O,isFeatureAttachment as E,renderImageWithRotation as F}from"./OrientedImageryViewer/galleryUtils.js";import P from"./OrientedImageryViewer/OrientedImageryViewerViewModel.js";import x from"./OrientedImageryViewer/OrientedImageryViewerVisibleElements.js";import{loadAlertComponents as H,Alert as j}from"./OrientedImageryViewer/components/Alert.js";import G from"./OrientedImageryViewer/components/ImageLocationWidget.js";import D from"./OrientedImageryViewer/components/ImageViewer.js";import $ from"./OrientedImageryViewer/components/NavigationAction.js";import{NavigationActionsCollection as N,NavigationActions as B}from"./OrientedImageryViewer/components/NavigationActions.js";import{NoImageLoadedError as R}from"./OrientedImageryViewer/navigation/errors.js";import{loadCalciteComponents as W}from"./support/componentsUtils.js";import{globalCss as U}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as z}from"./support/decorators/messageBundle.js";import{vmEvent as q}from"./support/decorators/vmEvent.js";import{tsx as Z,tsxFragment as J}from"./support/jsxFactory.js";import{substitute as K}from"../intl/substitute.js";const Q={overlayed:"overlayed"};let X=class extends p{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 P,this.messagesCommon=null,this.messagesSketch=null,this.pixelMeasurementUnit="meters",this.pixelAreaMeasurementUnit="square-meters",this.showCameraLocations=!1,this.showMapFeatures=!1,this.visibleElements=new x,this._imageOverlaysLoaderTask=null,this._imageMeasurementToolsLoaderTask=null,this._navigationSettingsLoaderTask=null,this._clearMeasurements=()=>{this.viewModel.measureType=null,this.viewModel.clearPreviousMeasurements()},this._clearImageLocation=()=>{this.imageLocationToolActive=!1},this._navigationToolExpanded=!1,this._navigationTool=null,this._galleryController=new AbortController,this._galleryObserver=new IntersectionObserver(this._lazyLoadImage.bind(this)),this._overlayedLayers=new a,this._previousAction=null,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(r(()=>t.visible,()=>{this.viewModel.toggleOverlayMapFeatures(t.id,t.visible)}),`${Q.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&&m(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=()=>{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 u({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=()=>{this.viewModel.toggleImageAttributes()},this.navigate=async e=>{let t=null;try{const{currentNode:i}=this.viewModel;if(!i)throw new R;t=await this.viewModel.navigate(i,e)}catch(i){n(i)||o.getLogger(this).error("Error occurred while navigating",i)}return t},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)}initialize(){this.addHandles([r(()=>[this.viewModel?.bestFeatureAngle,this._navigationTool],([e,t])=>{t&&this._updateNavigationTool(t)},l),r(()=>this.currentCoverageVisible,e=>this._onCurrentCoverageVisibilityChange(e)),r(()=>this.isAdditionalCoverageVisible,e=>this._onAdditionalCoverageVisibilityChange(e)),r(()=>this.isAdditionalPointSourcesVisible,e=>this._onAdditionalCameraLocationsVisibility(e)),r(()=>({features:this.currentBestFeature,showCameraLocations:this.showCameraLocations,state:this.viewModel.state}),({showCameraLocations:e,state:t})=>{"image-loaded"===t&&this.viewModel.overlayCameraLocations(e)},d),r(()=>({feature:this.currentBestFeature,showMapFeatures:this.showMapFeatures,state:this.viewModel.state}),async(e,t)=>{if(e.showMapFeatures!==t?.showMapFeatures&&this.viewModel.toggleAllOverlayMapFeatures(e.showMapFeatures),null!=e.feature&&e.feature!==t?.feature){if(this.viewModel.removeAllOverlayMapFeatures(),await c(()=>"image-loaded"===this.viewModel.state),this.dataCaptureLayer&&this.stopDataCapture(),await this._restoreOverlays(),!this.dataCaptureLayer)return;await this.startDataCapture(this.dataCaptureLayer),this._previousAction?.active&&(this._previousAction.active=!1,this._previousAction=null)}},l)])}loadDependencies(){return Promise.all([W({"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"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),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"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider")}),H()])}destroy(){this._galleryController.abort(),this._galleryObserver.disconnect(),this.currentBestFeature=null}get accuracyParametersMissing(){return this.viewModel.accuracyParametersMissing}get activeLayer(){return s(o.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){s(o.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(){const{layer:e}=this;if(!e)return!1;const{fields:t,sequenceOrderField:i}=e;return t.some(({name:e})=>e.toLowerCase()===`${i??"sequenceorder"}`.toLowerCase())}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 disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get displayMessage(){return this.viewModel.displayMessage}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.mapImageConversionToolState=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&&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 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}set updateFootprint(e){this.viewModel.updateFootprint=e}get updateFootprint(){return this.viewModel.updateFootprint}_renderActionBar(){return Z("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},Z("calcite-action-group",null,this._currentFootprintToggle(),this._additionalFootprintToggle(),this._additionalPointSourcesToggle()),Z("calcite-action-group",null,this._directionToolToggle(),this._mapImageConversionToggle(),this._navigationToolToggle(),this._imageEnhancementsToggle(),this._videoEnhancementsToggle()),Z("calcite-action-group",null,this._measurementToolsToggle(),this._imageGalleryToggle(),this._imageOverlaysToggle(),this._openPopupAction()))}_renderEnhancementSlider({title:e,value:t,handleChange:i}){return Z("div",{class:I.imageEnhancementToolContainer},Z("calcite-label",null,e,Z("calcite-slider",{bind:this,labelTicks:!0,max:10,min:0,ticks:2,value:t,onCalciteSliderInput:i})))}get _activeMeasurementIcon(){const{measureType:e,imageLocationToolActive:t}=this;if(t)return"pin-tear";switch(e){case"area":return"measure-area";case"height":return"measure-building-height-top-base";default:return"measure-line"}}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?Z("calcite-action",{active:e,bind:this,class:I.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?Z("calcite-action",{active:e,bind:this,class:I.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?Z("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},Z(o,{measurementType:t,measurementUnitMessages:this.measurementUnitMessages,messages:this.messages,oiViewModel:this.viewModel})):null}get _renderRoot(){const{viewModel:{state:e},triangularMeasurementActive:t}=this;return Z("calcite-panel",{bind:this,class:t?I.viewerContainerMeasurement:I.viewerContainer,heading:this.visibleElements.title?this.messages.title:void 0,loading:e.includes("loading")&&!t},this.visibleElements.menu?this._renderActionBar():null,Z("calcite-shell",null,Z("calcite-panel",null,this._imageViewer,this._panoramicViewer,this._videoViewer,this._messageBox,this.invalidCameraHeading?this._renderWarning(this.messages.invalidCameraHeadingWarningTitle,this.messages.invalidCameraHeadingWarningDescription):[this._imageGalleryPanel,this._renderNavigation,this._imageOverlaysPanel()],this._imageEnhancementTools,this._videoEnhancementTools,this._renderSketch()),this._imageViewerTriangular,this._measurementToggle,this._locationToggle))}_currentFootprintToggle(){const{currentCoverageVisible:e,invalidCameraHeading:t}=this,{currentFootprintToggle:i}=this.visibleElements;return i?Z("calcite-action",{active:e,bind:this,class:I.currentCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleCurrentCoverage,text:this.messages.currentFootprint,title:this.messages.currentFootprint}):null}get _imageEnhancementTools(){const{imageEnhancementToolActive:e,viewModel:{brightness:t,contrast:i,sharpness:a,state:s}}=this;return e&&"image-loaded"===s?Z("calcite-panel",{bind:this,class:I.imageEnhancementWrapper,closable:!0,closed:!e,heading:this.messages.imageEnhancement,key:this.messages.imageEnhancement,onCalcitePanelClose:this._toggleImageEnhancementToolState},Z("div",{class:I.imageEnhancementTools},Z("div",{class:I.imageEnhancementToolContainer},Z("calcite-label",null,this.messages.brightness,Z("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:t,onCalciteSliderInput:this._handleBrightnessChange}))),Z("div",{class:I.imageEnhancementToolContainer},Z("calcite-label",null,this.messages.contrast,Z("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:i,onCalciteSliderInput:this._handleContrastChange}))),Z("div",{class:I.imageEnhancementToolContainer},Z("calcite-label",null,this.messages.sharpness,Z("calcite-slider",{bind:this,labelTicks:!0,max:1,min:0,step:.1,ticks:.5,value:a,onCalciteSliderInput:this._handleSharpnessChange})))),Z("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{videoEnhancementToolActive:e,viewModel:{videoViewModel:t,mode:i},messages:{videoEnhancement:a,brightness:s,contrast:o},messagesCommon:{reset:n}}=this;return e&&"video"===i&&t?Z("calcite-panel",{bind:this,class:I.imageEnhancementWrapper,closable:!0,closed:!e,heading:a,key:a,onCalcitePanelClose:this._toggleVideoEnhancementToolState},Z("div",{class:I.imageEnhancementTools},this._renderEnhancementSlider({title:s,value:t.videoBrightness,handleChange:this._handleVideoBrightnessChange}),this._renderEnhancementSlider({title:o,value:t.videoContrast,handleChange:this._handleVideoContrastChange})),Z("calcite-action",{bind:this,icon:"reset",onclick:this._resetVideoTools,slot:"header-actions-end",text:n})):null}_imageEnhancementsToggle(){const{state:e,mode:t}=this.viewModel,{imageEnhancement:i}=this.visibleElements;return i&&"video"!==t?Z("calcite-action",{active:this.imageEnhancementToolActive,bind:this,disabled:"default"!==t||"image-loaded"!==e,icon:"sliders-horizontal",onclick:this._toggleImageEnhancementToolState,text:this.messages.imageEnhancement,title:this.messages.imageEnhancement}):null}_videoEnhancementsToggle(){const{mode:e}=this.viewModel,{videoEnhancement:t}=this.messages;return"video"===e?Z("calcite-action",{active:this.imageEnhancementToolActive,bind:this,disabled:"video"!==e,icon:"sliders-horizontal",onclick:this._toggleVideoEnhancementToolState,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 Z("calcite-panel",{bind:this,class:I.carousel,closable:!0,closed:!e,disabled:t,heading:this.messages.imageGallery,key:this.messages.imageGallery,onCalcitePanelClose:this._toggleImageGallery},Z("div",{class:I.carouselContainer},this._renderThumbnails))}_imageGalleryToggle(){const{imageGalleryEnabled:e,invalidCameraHeading:t,visibleElements:{imageGallery:i}}=this;return i?Z("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:a,dataCaptureEnabled:s,dataCaptureLayer:o,imageOverlaysOpened:n,showCameraLocations:r,showMapFeatures:l,view:d,layer:c}=this;if(!c)return null;const g=c.imageGeometryField?.length?c.imageGeometryField:_,h=c.imageReferenceField?.length?c.imageReferenceField:T;t||(this._imageOverlaysLoaderTask=i(async()=>(await import("./OrientedImageryViewer/components/ImageOverlays.js")).default));const m=this._imageOverlaysLoaderTask?.value;return m?Z(m,{closed:!n,dataCaptureEnabled:s,dataCaptureLayer:o,imageGeometryField:g,imageReferenceField:h,messages:e,overlayedLayers:a,showCameraLocations:r,showMapFeatures:l,view:d,onDataCaptureLayerChanged:this._handleDataCaptureLayerChange,onImageOverlaysClosed:this._onImageOverlayClosed,onLayerDeselected:this._handleOverlayLayerDeselect,onLayerSelected:this._handleOverlayLayerSelect,onShowCameraLocationsChanged:this._onShowCameraLocationsChanged,onShowMapFeaturesChanged:this._onShowMapFeaturesChanged}):null}get _imageOverlayMessages(){return{...this.messages,...this.messagesSketch}}get _imageSketchToolsMessages(){return{...this.messagesSketch,...this.messagesCommon}}_imageOverlaysPanel(){const{imageOverlaysOpened:e,viewModel:{state:t}}=this,i=this.classes({[I.imageOverlaysContainer]:!0,[U.hidden]:!e||"image-loaded"!==t});return Z("div",{class:i,key:this.messages.imageOverlays},this._imageOverlaysComponent)}_imageOverlaysToggle(){const{viewModel:{state:e},imageOverlaysOpened:t,invalidCameraHeading:i,visibleElements:{imageOverlays:a}}=this;return a?Z("calcite-action",{active:t,bind:this,disabled:"image-loaded"!==e||i,icon:"layers",onclick:this._toggleImageOverlays,text:this.messages.imageOverlays,title:this.messages.imageOverlays}):null}get _imageViewer(){const{displayMessage:e,loadImageViewer:t,mode:i,clickAction:a,state:s}=this.viewModel,o=null!=e||"default"!==i||s.includes("loading"),{messages:{end:n,next:r,previous:l,start:d}}=this;return Z(D,{afterCreate:t,clickAction:a,navigationEnabled:!o&&null!==this.navigationMode,navigationViewModel:this.viewModel,uiStrings:{end:n,next:r,previous:l,start:d},visible:!o})}get _imageViewerTriangular(){const{messages:e,triangularMeasurementActive:t}=this,{displayMessage:i,storeImageMeasurementViewer:a,mode:s,state:o,clickAction:n}=this.viewModel,r=null!=i||"default"!==s,l=this.classes({[I.viewer]:!r,[I.viewerHidden]:r});return t?Z("calcite-panel",{class:I.viewerContainerMeasurement,heading:e.measurementViewerHeading,loading:o.includes("loading")},Z("calcite-panel",{bind:this,class:l},Z(D,{afterCreate:a,clickAction:n,uiStrings: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({[I.viewer]:!r,[I.viewerHidden]:r});return Z("calcite-panel",{bind:this,class:l},Z("div",{afterCreate:t,styles:{height:"100%"}}),Z("calcite-slider",{bind:this,labelHandles:!0,labelTicks:!0,max:i?.videoDuration,minLabel:"0",value:i?.currentTime??0,onCalciteSliderChange:this._sliderChangeHandler}),Z("calcite-action-bar",{expandDisabled:!0,layout:"horizontal"},Z("calcite-action-group",null,Z("calcite-action",{bind:this,icon:this.activeVideoIcon,onclick:()=>i?.playVideoHandler(),text:"Play",title:i?.videoPaused?a.play:a.pause})),Z("calcite-action-group",null,Z("calcite-action",{bind:this,icon:"refresh",onclick:()=>i?.rewindVideoHandler(),text:"Rewind",title:s})),Z("calcite-action-group",null,Z("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 Z("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},Z(G,{accuracy:i,groundCoordinates:l,messages:this.messages}))}_mapImageConversionToggle(){const{mapImageConversionToolState:e,viewModel:{state:t},invalidCameraHeading:i,visibleElements:{mapImageConversionTool:a}}=this;return a?Z("calcite-action",{active:e,bind:this,disabled:"image-loaded"!==t||i,icon:"image-pin",onclick:this._toggleMapImageConversionToolState,text:this.messages.mapImageConversionTool,title:this.messages.mapImageConversionTool}):null}_measurementToolsToggle(){const{_activeMeasurementIcon:e,measureType:t,viewModel:i,accuracyParametersMissing:a,messages:s,triangularMeasurementActive:o,visibleElements:{measurementTools:n}}=this,{state:r,mode:l}=i,{measurementTools:d,groundDistance:c,groundArea:g,heightAboveGround:h,groundLocation:m,triangulatedDistanceHeading:u,triangulatedAreaHeading:v,triangulatedLocationHeading:p}=s;return n?Z("calcite-dropdown",{disabled:a,key:"measurement-tools",maxItems:5,title:d,width:"m"},Z("calcite-action",{bind:this,disabled:"image-loaded"!==r||a,icon:e,slot:"trigger",text:d}),Z("calcite-dropdown-group",null,Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-line",key:"distance-measurement",onclick:e=>this._toggleMeasurementSketch(e,"distance"),selected:"distance"===t&&!o},c),Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-area",key:"area-measurement",onclick:e=>this._toggleMeasurementSketch(e,"area"),selected:"area"===t&&!o},g),Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-building-height-top-base",key:"height-dropdown",onclick:e=>this._toggleMeasurementSketch(e,"height"),selected:"height"===t},h),Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"pin-tear",key:"surface-location",onclick:this._toggleLocationTool,selected:!!this.imageLocationToolActive&&!o},m),"default"===l&&Z(J,null,Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"dual-image-distance",key:"triangular-measurement-distance",selected:!!o&&"distance"===this.measureType,onCalciteDropdownItemSelect:this._toggleTriangularDistanceMeasurements},u),Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"dual-image-area",key:"triangular-measurement-area",selected:!!o&&"area"===this.measureType,onCalciteDropdownItemSelect:this._toggleTriangularAreaMeasurements},v),Z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"dual-image-location",key:"triangular-location",selected:!!o&&this.imageLocationToolActive,onCalciteDropdownItemSelect:this._toggleTriangularLocation},p)))):null}get _messageBox(){const{messages:e,viewModel:{displayMessage:t,mode:i}}=this;if(!t||"video"===i)return null;const{data:a,key:s,map:o}=t,n=`${o?K(e[s],o):e[s]}`;return Z("span",{class:I.messageBox},a?`${n} ${a}`:n)}async _loadNavigationSettings(){return this._navigationSettingsLoaderTask||(this._navigationSettingsLoaderTask=i(async()=>(await import("./OrientedImageryViewer/components/NavigationSettings.js")).default)),await this._navigationSettingsLoaderTask.promise}_navigationToolToggle(){const{state:e}=this.viewModel,{visibleElements:{navigationTool:t}}=this;return t?Z("calcite-action",{active:this.navigationToolActive,bind:this,disabled:"image-loaded"!==e||this.invalidCameraHeading,icon:"explore",onclick:this._toggleNavigationTool,text:this.messages.navigationTool,title:this.messages.navigationTool}):null}_directionToolToggle(){const{state:e}=this.viewModel,{visibleElements:{directionalNavigation:t,sequentialNavigation:i}}=this,a=new N;t&&a.push(new $({active:"directional"===this.navigationMode,disabled:"image-loaded"!==e||this.invalidCameraHeading,icon:"i2DExplore",onclick:()=>{this._toggleImageNavigation("directional")},text:this.messages.directionalNavigation,title:this.messages.directionalNavigationDescription})),i&&a.push(new $({active:"sequential"===this.navigationMode,disabled:"image-loaded"!==e||this.invalidCameraHeading||!this.canNavigateSequentially,icon:"reorder-stack",onclick:()=>{this._toggleImageNavigation("sequential")},text:this.messages.sequentialNavigation,title:this.messages.sequentialNavigationDescription}));return t||i?Z(B,{actions:a,activeAction:a.items.find(e=>e.active),icon:"absolute-direction",label:this.messages.imageNavigation,scale:"m",title:this.messages.imageNavigation}):null}_openPopupAction(){const{showPopupsAction:e}=this.visibleElements;return e?Z("calcite-action",{bind:this,disabled:!this.popupEnabled,icon:"popup",onclick:this._toggleImageAttributes,text:this.messages.showPopups,title:this.messages.showPopups}):null}get _panoramicViewer(){const{displayMessage:e,loadPanoramicViewer:t,mode:i,clickAction:a,state:s}=this.viewModel,{messages:{end:o,next:n,previous:r,start:l}}=this,d=null!=e||"panoramic"!==i||s.includes("loading");return Z(v,{afterCreate:t,clickAction:a,navigationEnabled:!d&&null!==this.navigationMode,navigationViewModel:this.viewModel,uiStrings:{end:o,next:n,previous:r,start:l},visible:!d})}_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.imageEnhancementToolActive=!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)}_handleSharpnessChange(e){this.viewModel.sharpness=e.currentTarget.value??0}_lazyLoadImage(e,t){e.forEach(async e=>{if(e.isIntersecting){const a=e.target,s=a.getAttribute("data-src"),r=a.getAttribute("data-rotation"),l=a.getAttribute("data-objectid"),d=r?parseFloat(r)%360:0,{layer:c,_galleryController:{signal:g}}=this;if(!s||!l)return;let h;try{h=E(s)?await S(c,l,{signal:g}):await O(s,{signal:g})}catch(i){n(i)||o.getLogger("esri.widgets.OrientedImageryViewer").error("#lazyLoadImage()",i)}finally{t.unobserve(a)}if(!h)return;F(h,a,d)}})}_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=i(async()=>{const{default:e}=await import("./OrientedImageryViewer/components/ImageMeasurementWidget.js");return e})}_loadSketchResources(){this._sketchLoaderTask=i(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){const{viewModel:{state:i}}=this;return"image-loaded"===i?Z(j,{icon:"exclamation-mark-triangle-f",kind:"warning",message:t,open:!0,title:e,tooltip:t}):null}get _renderNavigation(){const{viewModel:{sectorData:e,navigatorCurrentBestFeature:i,currentBestFeature:a,state:s}}=this;if(!this.container||!a)return null;let o,n,r,l,d;if(i){const{x:e,y:t,direction:a}=i,[s,c,g,h]=M[a];o=`M ${e} ${t} L ${s} ${c} A ${A[2]} ${A[2]} 0 0 1 ${g} ${h} Z`,n=e,l=t,r=M[a][4],d=M[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=a.attributes.objectId,u=e?.map(e=>e?.items).filter(Boolean).flatMap(e=>e?.map(({x:e,y:t,objectID:i,featureIndexInSector:a,sector:s})=>Z("circle",{afterRemoved:h,class:this.classes(I.feature,{selected:m===i}),cx:e,cy:t,"data-feature-index-in-sector":a,"data-sector":s,key:`${I.feature}-${i}`,onclick:g,r:b}))),v=e=>{e.removeEventListener("click",c)},p=this.classes({[I.navigationWrapper]:!0,[I.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&"image-loaded"===s?Z("div",{bind:this,class:p,key:this.messages.navigationTool},Z("svg",{afterCreate:e=>this._storeNavigationToolReference(e),class:t()?f:I.rotateWithAnimation,focusable:"false",height:C,role:"img",width:C,xmlns:"http://www.w3.org/2000/svg"},Z("defs",null,Z("linearGradient",{gradientUnits:"userSpaceOnUse",id:`${this.id}-coverage-fill`,x1:n,x2:r,y1:l,y2:d},Z("stop",{class:I.navigationPathOffset0,offset:0}),Z("stop",{class:I.navigationPathOffset1,offset:1}))),Z("g",null,Z("circle",{class:this.classes(I.sector,I.outerSector),cx:A[3],cy:A[3],onclick:this._scaleNavigationTool,r:A[3]}),Z("circle",{class:I.sector,cx:A[3],cy:A[3],r:A[2]}),Z("circle",{class:I.sector,cx:A[3],cy:A[3],r:A[1]}),Z("circle",{class:I.sector,cx:A[3],cy:A[3],r:A[0]}),Z("path",{class:I.pointer,d:"M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z",key:`${I.pointer}-west`}),Z("path",{class:this.classes(I.pointer,I.north),d:"M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z",key:`${I.pointer}-north`}),Z("path",{class:I.pointer,d:"M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z",key:`${I.pointer}-east`}),Z("path",{class:I.pointer,d:"M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z",key:`${I.pointer}-south`}),Z("path",{class:this.classes(I.sector,I.sectorSeparator),d:"M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076",key:I.sectorSeparator}),y([A[2],A[1],A[0]],A[3],A[3]).map((t,i)=>Z("path",{afterRemoved:v,class:this.classes(I.sector,e?.[i]?.length?I.sectorEnabled:I.sectorDisabled),d:t,"data-sector":`${i}`,key:`${I.sector}-${i}`,onclick:c})),Z("path",{class:this.classes(I.sector,I.sectorCross),d:"M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53",key:I.sectorCross}),u,a.attributes.cameraPitch>=5&&o?Z("path",{class:I.selectedFeaturePath,d:o,fill:`url(#${this.id}-coverage-fill)`,key:I.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 Z("div",{class:I.sketchTools},Z(s,{icon:a,messages:this._imageSketchToolsMessages,type:i,onAction:this._onAction}))}get _renderThumbnails(){const{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?Z("div",{class:I.carouselContent},t?.items.map(({url:t,objectId:i,rotation:a},s)=>Z("div",{class:`${I.carouselItemWrapper}${e.attributes.objectId===i?"--selected":""}`,key:`${I.carouselItemWrapper}-${s}`},Z("canvas",{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${i}`,class:I.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()}_sliderChangeHandler(e){const t=this.viewModel?.videoElement?.content;t&&(t.currentTime=e.target.value,t.play())}_storeNavigationToolReference(e){this._navigationTool=e}_toggleAdditionalCameraLocations(){this.isAdditionalPointSourcesVisible=!this.isAdditionalPointSourcesVisible}_toggleAdditionalCoverage(){this.isAdditionalCoverageVisible=!this.isAdditionalCoverageVisible}_toggleCurrentCoverage(){this.currentCoverageVisible=!this.currentCoverageVisible}_toggleImageEnhancementToolState(e){e.stopPropagation();const t=this.imageEnhancementToolActive;this._closeAllImageTools(),this.imageEnhancementToolActive=!t}_toggleVideoEnhancementToolState(e){e.stopPropagation(),this.videoEnhancementToolActive=!this.videoEnhancementToolActive}_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(L,`${t}deg`),e.style.setProperty(k,`${t+a}deg`)}async loadBestImage(e){return this.viewModel.loadBestImage(e)}loadImageFromSource(e,t){return this.viewModel.loadImageFromSource(e,t)}async overlayMapFeatures(e,t){return this.removeHandles(`${Q.overlayed}-${e.id}`),this.addHandles(r(()=>e.visible,()=>{this.viewModel.toggleOverlayMapFeatures(e.id,e.visible)}),`${Q.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(`${Q.overlayed}-${e}`),this._overlayedLayers.remove(this._overlayedLayers.find(t=>t.id===e)),this.viewModel.removeOverlayedGraphicsOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return Z("div",{class:this.classes(U.widget,V)},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([g({readOnly:!0})],X.prototype,"accuracyParametersMissing",null),e([g()],X.prototype,"activeLayer",null),e([g()],X.prototype,"activeVideoIcon",null),e([g()],X.prototype,"activeAudioIcon",null),e([g()],X.prototype,"cameraHeadingThreshold",null),e([g()],X.prototype,"cameraPitchThreshold",null),e([g()],X.prototype,"canNavigateSequentially",null),e([g()],X.prototype,"currentBestFeature",null),e([g()],X.prototype,"currentCoverageVisible",null),e([g()],X.prototype,"dataCaptureEnabled",void 0),e([g()],X.prototype,"dataCaptureLayer",null),e([g()],X.prototype,"disabled",null),e([g()],X.prototype,"features",null),e([g()],X.prototype,"imagePointsInView",null),e([g()],X.prototype,"galleryOpened",void 0),e([g()],X.prototype,"icon",null),e([g()],X.prototype,"imageEnhancementToolActive",void 0),e([g()],X.prototype,"videoEnhancementToolActive",void 0),e([g({readOnly:!0})],X.prototype,"imageGalleryEnabled",null),e([g()],X.prototype,"imageLocationToolActive",null),e([g()],X.prototype,"imageOverlaysOpened",void 0),e([g({readOnly:!0})],X.prototype,"invalidCameraHeading",null),e([g()],X.prototype,"isAdditionalCoverageVisible",null),e([g()],X.prototype,"isAdditionalPointSourcesVisible",null),e([g()],X.prototype,"mapImageConversionToolState",null),e([g()],X.prototype,"measureType",null),e([g()],X.prototype,"layer",null),e([g()],X.prototype,"navigationToolActive",void 0),e([g()],X.prototype,"navigationMode",null),e([q(w()),g({type:P})],X.prototype,"viewModel",void 0),e([g(),z("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],X.prototype,"messages",void 0),e([g(),z("esri/core/t9n/Units")],X.prototype,"measurementUnitMessages",void 0),e([g(),z("esri/t9n/common")],X.prototype,"messagesCommon",void 0),e([g(),z("esri/widgets/Sketch/t9n/Sketch")],X.prototype,"messagesSketch",void 0),e([g()],X.prototype,"pixelMeasurementUnit",void 0),e([g()],X.prototype,"pixelAreaMeasurementUnit",void 0),e([g({readOnly:!0})],X.prototype,"popupEnabled",null),e([g()],X.prototype,"referencePoint",null),e([g()],X.prototype,"showCameraLocations",void 0),e([g()],X.prototype,"showMapFeatures",void 0),e([q(["create","delete","redo","undo","update"]),g({readOnly:!0})],X.prototype,"sketchViewModel",null),e([g()],X.prototype,"triangularMeasurementActive",null),e([g()],X.prototype,"view",null),e([g({type:x,nonNullable:!0})],X.prototype,"visibleElements",void 0),e([g()],X.prototype,"determineWorkflowForFeature",null),e([g()],X.prototype,"updateFootprint",null),e([g()],X.prototype,"_activeMeasurementIcon",null),e([g()],X.prototype,"_activeMeasurementHeading",null),e([g()],X.prototype,"_imageOverlaysLoaderTask",void 0),e([g()],X.prototype,"_imageMeasurementToolsLoaderTask",void 0),e([g()],X.prototype,"_navigationSettingsLoaderTask",void 0),e([g()],X.prototype,"_measurementToggle",null),e([g()],X.prototype,"_renderRoot",null),e([g()],X.prototype,"_imageEnhancementTools",null),e([g()],X.prototype,"_videoEnhancementTools",null),e([g()],X.prototype,"_imageGalleryPanel",null),e([g()],X.prototype,"_imageGalleryContext",null),e([g()],X.prototype,"_imageOverlaysComponent",null),e([g()],X.prototype,"_imageOverlayMessages",null),e([g()],X.prototype,"_imageSketchToolsMessages",null),e([g()],X.prototype,"_imageViewer",null),e([g()],X.prototype,"_imageViewerTriangular",null),e([g()],X.prototype,"_videoViewer",null),e([g()],X.prototype,"_locationToggle",null),e([g()],X.prototype,"_messageBox",null),e([g()],X.prototype,"_navigationToolExpanded",void 0),e([g()],X.prototype,"_navigationTool",void 0),e([g()],X.prototype,"_panoramicViewer",null),e([g()],X.prototype,"_renderNavigation",null),e([g()],X.prototype,"_renderThumbnails",null),e([g()],X.prototype,"_sketchLoaderTask",void 0),X=e([h("esri.widgets.OrientedImageryViewer")],X);const Y=X;export{Y as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import t from"../../core/Collection.js";import{watch as i}from"../../core/reactiveUtils.js";import{throttle as o}from"../../core/throttle.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{fetchMessageBundle as r}from"../../intl/messages.js";import{isFeatureLayer as l,isSubtypeSublayer as a}from"../../layers/support/layerUtils.js";import"../../popup/content/AttachmentsContent.js";import"../../popup/content/Content.js";import"../../popup/content/CustomContent.js";import"../../popup/content/ExpressionContent.js";import"../../popup/content/FieldsContent.js";import"../../popup/content/MediaContent.js";import"../../popup/content/RelationshipContent.js";import"../../popup/content/TextContent.js";import c from"../../popup/content/UtilityNetworkAssociationsContent.js";import{substituteActionImage as d,getActionStyles as p}from"../../support/actions/actionUtils.js";import u from"../Feature.js";import h from"../Spinner.js";import m from"../Widget.js";import{css as g}from"../Feature/resources.js";import{FeatureContentMixin as v}from"../Feature/support/FeatureContentMixin.js";import{css as w}from"../Features/css.js";import _ from"../Features/FeaturesViewModel.js";import{ActionsCollection as f}from"../Popup/actions.js";import{zoomToLocation as y}from"../Popup/actionUtils.js";import{loadCalciteComponents as M}from"../support/componentsUtils.js";import{globalCss as F}from"../support/globalCss.js";import{Heading as A}from"../support/Heading.js";import"../support/widgetUtils.js";import{messageBundle as k}from"../support/decorators/messageBundle.js";import{vmEvent as b}from"../support/decorators/vmEvent.js";import{tsx as C}from"../support/jsxFactory.js";import I from"./UtilityNetworkTraceFeaturesDrillIn.js";import{substitute as T}from"../../intl/substitute.js";const j="selected-index",N=0,W="features-spinner",x="esri-utility-network-trace",S={blockContainer:`${x}__block-container`,blockContent:`${x}__block-content`,featureContent:`${x}__feature-content`,paddingBottom:`${x}__pad-bottom`,paddingTop:`${x}__pad-top`};let U=class extends(v(m)){constructor(e,s){super(e,s),this._actionBarMenuNode=null,this._drillInFlowItems=new t,this._drillInWidget=new I({flowItems:this._drillInFlowItems}),this._feature=null,this._featureMenuViewportNode=null,this._spinner=null,this._utilityNetworkTraceMessages=null,this.featureNavigationTop=!1,this.headerActions=new f,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new _,this._renderAction=(e,t)=>{const i=this._getActionTitle(e),{type:o,active:s,uid:n,disabled:r,indicator:l}=e;return e.visible?C("calcite-action",{active:"toggle"===o&&e.value,appearance:"solid",bind:this,"data-action-uid":n,disabled:"zoom-to-feature"===e.id?!this.feature.geometry:r,icon:this._getActionIcon(e),indicator:l,key:`action-${t}`,loading:s,onclick:this._triggerAction,scale:"s",text:i,title:this._hideActionText?i:void 0},this._renderFallbackIcon(e)):null},this._renderAddNsoBlock=()=>{const{_utilityNetworkTraceMessages:e,messagesCommon:t}=this;return C("calcite-block",{class:S.blockContent,expanded:!this.feature,heading:e?.inputsStrings.addNonspatialOption},C("calcite-action",{icon:"x",onclick:()=>this.emit("close-un-trace-feature-block"),slot:"control",text:t.close}),C("calcite-notice",{icon:"information",kind:"info",open:!this.feature},C("div",{slot:"message"},e?.inputsStrings.addNonspatialHint)))},this._renderNoAssociationNotice=()=>{const{_utilityNetworkTraceMessages:e}=this;return C("calcite-notice",{class:this.classes(S.paddingBottom,S.paddingTop),icon:"exclamation-mark-triangle",kind:"danger",open:!0},C("div",{slot:"message"},e.alertsStrings.noAssociationsConfigured))},this._renderNoPopupErrorBlock=()=>{const{_utilityNetworkTraceMessages:e,messagesCommon:t}=this;return C("calcite-block",{description:void 0,expanded:!0,heading:"show-feature-info"===this.mode?t.warning:void 0},C("calcite-notice",{class:this.classes(S.paddingBottom,S.paddingTop),icon:"exclamation-mark-triangle",kind:"danger",open:!0},C("div",{slot:"message"},e.alertsStrings.noPopupConfigured)),"show-feature-info"===this.mode?C("calcite-action",{icon:"x",onclick:()=>this.emit("close-un-trace-feature-block"),slot:"control",text:t.close}):void 0)},this._displaySpinnerThrottled=o(()=>this._displaySpinner(),N),this.addHandles([this._displaySpinnerThrottled,i(()=>this.viewModel?.active,e=>this._drillInWidget.closed=!e),i(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),i(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),i(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),i(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),i(()=>this.selectedFeatureWidget,()=>this._destroyDrillInFlowItemWidgets()),i(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]},()=>this._setTitleFromFeatureWidget()),i(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]},()=>this._setContentFromFeatureWidget()),i(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),this._drillInWidget.on("close",()=>{this.emit("close")}),this._drillInWidget.on("exit",()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on("open-feature",({feature:e})=>this._openRelatedFeature(e)),this._drillInWidget.on("zoom-to-feature",({featureWidget:e})=>y(this.viewModel,e)),this._drillInWidget.on("add-nso-trace-location",({featureWidget:e})=>this.emit("add-nso-trace-location",{featureWidget:e}))])}initialize(){(async()=>{this._utilityNetworkTraceMessages=await r("esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace")})(),this._drillInWidget.mode=this.mode,this._drillInWidget.closable=!1}loadDependencies(){return M({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._drillInWidget?.destroy()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return"xsmall"===e||"small"===e||"medium"===e}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get feature(){return this.viewModel.features.length?this.viewModel.features[0]:null}set feature(e){this.viewModel.features=e?[e]:[]}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get hasAssociationsPopupElement(){const e=l(this.feature?.layer)?this.feature?.layer:void 0,t=a(this.feature?.layer)?this.feature?.layer:void 0,i=e?.popupTemplate||t?.popupTemplate||null,o=i?.content;return!(Array.isArray(o)&&!o.some(e=>e instanceof c))}get hasPopupInfo(){const e=l(this.feature?.layer)?this.feature?.layer:void 0,t=a(this.feature?.layer)?this.feature?.layer:void 0;return!(!e?.popupTemplate&&!t?.popupTemplate)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get mode(){return this._get("mode")||"add-nso"}set mode(e){this._set("mode",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return"feature-association"===t||"feature-relationship"===t?e.graphic??null:null}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o}=this,{selectedFeatureViewModel:s}=this.viewModel,n={title:!1};return s?(e?(e.viewModel=s,e.visibleElements=n):this._feature=new u({flowItems:i,headingLevel:t+1,timeZone:o,viewModel:s,visibleElements:n}),this._feature):null}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}open(e){this.removeHandles(j),this.viewModel.open({features:[e]})}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return C("div",{bind:this,class:this.classes(w.base,F.widget,F.panel,S.blockContainer)},"add-nso"===this.mode?this._renderAddNsoBlock():void 0,this.feature?this.hasPopupInfo?this._renderContentContainer():this._renderNoPopupErrorBlock():void 0)}_renderActionBar(){return this.viewModel.allActions?.length?C("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},C("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?C("div",{class:g.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_renderContentContainer(){const e=[this._renderContentFeature(),this._drillInWidget.render()];return C("calcite-flow",{key:"content-container"},e)}_renderContentFeature(){const{_drillInFlowItems:e,headingLevel:t,featureNavigationTop:i}=this,{title:o,active:s}=this.viewModel,n=o||"";return C("calcite-flow-item",{bind:this,class:this.classes({[w.contentFeature]:!0}),closed:!s,collapseDirection:i?"down":"up",headingLevel:t,key:"root-flow-item",loading:this.viewModel.waitingForContents,selected:0===e.length},"show-feature-info"===this.mode?C("calcite-action",{icon:"x",onclick:()=>{this.emit("close")},slot:"header-actions-end",text:this.messagesCommon.close}):void 0,n?C(A,{class:this.classes(w.featuresHeading,F.heading),innerHTML:n,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),this.hasAssociationsPopupElement?void 0:this._renderNoAssociationNotice(),C("div",{class:"add-nso"===this.mode?this.classes(w.container,w.contentContainer):this.classes(w.container,w.contentContainer,S.featureContent)},this._renderContent()))}_renderFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=d({action:e,feature:this.selectedFeature}),s={[w.icon]:!!t,[w.actionImage]:!!o};return t&&(s[t]=!0),o||t?C("span",{"aria-hidden":"true",class:this.classes(w.icon,s),key:"icon",styles:p(o)}):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?C("calcite-action",{active:"toggle"===e.type&&e.value,appearance:"solid",bind:this,"data-action-uid":e.uid,disabled:e.disabled||!this.feature.geometry,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_createSpinner(e){e&&(this._spinner=new h({view:e}),e.ui.add(this._spinner,{key:W,position:"manual",internal:!0}))}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()})}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,W),e.destroy(),this._spinner=null)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_getActionIcon(e){return e.icon?e.icon:e.image||e.className?void 0:"question"}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:s}=e,n=i?.attributes,r=e.title??"",l="zoom-to-feature"===s?T(r,{messages:t}):"remove-selected-feature"===s?T(r,{messages:o}):"zoom-to-clustered-features"===s||"browse-clustered-features"===s?T(r,{messages:t}):e.title;return l&&n?T(l,n):l??""}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;null!=i&&null!=t&&(this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i}),this.open(t))}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex(e=>e.uid===i),n=o.at(s);n&&"toggle"===n.type&&(n.value=!n.value),this.viewModel.triggerAction(s)}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find(({uid:e})=>e===i);o&&!o.disabled&&("toggle"===o?.type&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_wireUpView(e){this._destroySpinner(),e&&this._createSpinner(e)}};e([s()],U.prototype,"_drillInFlowItems",void 0),e([s()],U.prototype,"_hideActionText",null),e([s({readOnly:!0})],U.prototype,"active",null),e([s()],U.prototype,"content",null),e([s()],U.prototype,"feature",null),e([s()],U.prototype,"featureNavigationTop",void 0),e([s()],U.prototype,"goToOverride",null),e([s()],U.prototype,"hasAssociationsPopupElement",null),e([s()],U.prototype,"hasPopupInfo",null),e([s({type:f})],U.prototype,"headerActions",void 0),e([s()],U.prototype,"headingLevel",void 0),e([s()],U.prototype,"location",null),e([s(),k("esri/widgets/Features/t9n/Features")],U.prototype,"messages",void 0),e([s(),k("esri/t9n/common")],U.prototype,"messagesCommon",void 0),e([s()],U.prototype,"mode",null),e([s()],U.prototype,"promises",null),e([s()],U.prototype,"responsiveActionsEnabled",void 0),e([s({readOnly:!0})],U.prototype,"selectedFeature",null),e([s({readOnly:!0})],U.prototype,"selectedDrillInFeature",null),e([s({readOnly:!0})],U.prototype,"selectedFeatureWidget",null),e([s()],U.prototype,"timeZone",null),e([s()],U.prototype,"view",null),e([s({type:_}),b(["triggerAction","trigger-action"])],U.prototype,"viewModel",void 0),U=e([n("esri.widgets.UtilityNetworkTrace.UtilityNetworkTraceFeature")],U);const B=U;export{B as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import t from"../../core/Collection.js";import{watch as i}from"../../core/reactiveUtils.js";import{throttle as o}from"../../core/throttle.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{fetchMessageBundle as r}from"../../intl/messages.js";import{isFeatureLayer as a,isSubtypeSublayer as l}from"../../layers/support/layerUtils.js";import"../../popup/content/AttachmentsContent.js";import"../../popup/content/Content.js";import"../../popup/content/CustomContent.js";import"../../popup/content/ExpressionContent.js";import"../../popup/content/FieldsContent.js";import"../../popup/content/MediaContent.js";import"../../popup/content/RelationshipContent.js";import"../../popup/content/TextContent.js";import c from"../../popup/content/UtilityNetworkAssociationsContent.js";import{substituteActionImage as d,getActionStyles as p}from"../../support/actions/actionUtils.js";import u from"../Feature.js";import h from"../Spinner.js";import m from"../Widget.js";import{css as g}from"../Feature/resources.js";import{FeatureContentMixin as v}from"../Feature/support/FeatureContentMixin.js";import{css as w}from"../Features/css.js";import _ from"../Features/FeaturesViewModel.js";import{ActionsCollection as f}from"../Popup/actions.js";import{zoomToLocation as y}from"../Popup/actionUtils.js";import{loadCalciteComponents as M}from"../support/componentsUtils.js";import{globalCss as F}from"../support/globalCss.js";import{Heading as A}from"../support/Heading.js";import"../support/widgetUtils.js";import{messageBundle as k}from"../support/decorators/messageBundle.js";import{vmEvent as b}from"../support/decorators/vmEvent.js";import{tsx as C}from"../support/jsxFactory.js";import I from"./UtilityNetworkTraceFeaturesDrillIn.js";import{substitute as T}from"../../intl/substitute.js";const j="selected-index",N=0,W="features-spinner",x="esri-utility-network-trace",S={blockContainer:`${x}__block-container`,blockContent:`${x}__block-content`,featureContent:`${x}__feature-content`,paddingBottom:`${x}__pad-bottom`,paddingTop:`${x}__pad-top`};let L=class extends(v(m)){constructor(e,s){super(e,s),this._actionBarMenuNode=null,this._drillInFlowItems=new t,this._drillInWidget=new I({flowItems:this._drillInFlowItems}),this._feature=null,this._featureMenuViewportNode=null,this._spinner=null,this._utilityNetworkTraceMessages=null,this.featureNavigationTop=!1,this.headerActions=new f,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new _,this._renderAction=(e,t)=>{const i=this._getActionTitle(e),{type:o,active:s,uid:n,disabled:r,indicator:a}=e;return e.visible?C("calcite-action",{active:"toggle"===o&&e.value,appearance:"solid",bind:this,"data-action-uid":n,disabled:"zoom-to-feature"===e.id?!this.feature.geometry:r,icon:this._getActionIcon(e),indicator:a,key:`action-${t}`,loading:s,onclick:this._triggerAction,scale:"s",text:i,title:this._hideActionText?i:void 0},this._renderFallbackIcon(e)):null},this._renderAddNsoBlock=()=>{const{_utilityNetworkTraceMessages:e,messagesCommon:t}=this;return C("calcite-block",{class:S.blockContent,expanded:!this.feature,heading:e?.inputsStrings.addNonspatialOption},C("calcite-action",{icon:"x",onclick:()=>this.emit("close-un-trace-feature-block"),slot:"control",text:t.close}),C("calcite-notice",{icon:"information",kind:"info",open:!this.feature},C("div",{slot:"message"},e?.inputsStrings.addNonspatialHint)))},this._renderNoAssociationNotice=()=>{const{_utilityNetworkTraceMessages:e}=this;return C("calcite-notice",{class:this.classes(S.paddingBottom,S.paddingTop),icon:"exclamation-mark-triangle",kind:"danger",open:!0},C("div",{slot:"message"},e.alertsStrings.noAssociationsConfigured))},this._renderNoPopupErrorBlock=()=>{const{_utilityNetworkTraceMessages:e,messagesCommon:t}=this;return C("calcite-block",{description:void 0,expanded:!0,heading:"show-feature-info"===this.mode?t.warning:void 0},C("calcite-notice",{class:this.classes(S.paddingBottom,S.paddingTop),icon:"exclamation-mark-triangle",kind:"danger",open:!0},C("div",{slot:"message"},e.alertsStrings.noPopupConfigured)),"show-feature-info"===this.mode?C("calcite-action",{icon:"x",onclick:()=>this.emit("close-un-trace-feature-block"),slot:"control",text:t.close}):void 0)},this._displaySpinnerThrottled=o(()=>this._displaySpinner(),N),this.addHandles([this._displaySpinnerThrottled,i(()=>this.viewModel?.active,e=>this._drillInWidget.closed=!e),i(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),i(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),i(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),i(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),i(()=>this.selectedFeatureWidget,()=>this._destroyDrillInFlowItemWidgets()),i(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]},()=>this._setTitleFromFeatureWidget()),i(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]},()=>this._setContentFromFeatureWidget()),i(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),this._drillInWidget.on("close",()=>{this.emit("close")}),this._drillInWidget.on("exit",()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on("open-feature",({feature:e})=>this._openRelatedFeature(e)),this._drillInWidget.on("zoom-to-feature",({featureWidget:e})=>y(this.viewModel,e)),this._drillInWidget.on("add-nso-trace-location",({featureWidget:e})=>this.emit("add-nso-trace-location",{featureWidget:e}))])}initialize(){(async()=>{this._utilityNetworkTraceMessages=await r("esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace")})(),this._drillInWidget.mode=this.mode,this._drillInWidget.closable=!1}loadDependencies(){return M({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._drillInWidget?.destroy()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return"xsmall"===e||"small"===e||"medium"===e}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get feature(){return this.viewModel.features.length?this.viewModel.features[0]:null}set feature(e){this.viewModel.features=e?[e]:[]}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get hasAssociationsPopupElement(){const e=a(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0,t=l(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0,i=e?.popupTemplate||t?.popupTemplate||null,o=i?.content;return!(Array.isArray(o)&&!o.some(e=>e instanceof c))}get hasPopupInfo(){const e=a(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0,t=l(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0;return!(!e?.popupTemplate&&!t?.popupTemplate)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get mode(){return this._get("mode")||"add-nso"}set mode(e){this._set("mode",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return"feature-association"===t||"feature-relationship"===t?e.graphic??null:null}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o}=this,{selectedFeatureViewModel:s}=this.viewModel,n={title:!1};return s?(e?(e.viewModel=s,e.visibleElements=n):this._feature=new u({flowItems:i,headingLevel:t+1,timeZone:o,viewModel:s,visibleElements:n}),this._feature):null}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}open(e){this.removeHandles(j),this.viewModel.open({features:[e]})}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return C("div",{bind:this,class:this.classes(w.base,F.widget,F.panel,S.blockContainer)},"add-nso"===this.mode?this._renderAddNsoBlock():void 0,this.feature?this.hasPopupInfo?this._renderContentContainer():this._renderNoPopupErrorBlock():void 0)}_renderActionBar(){return this.viewModel.allActions?.length?C("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},C("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?C("div",{class:g.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_renderContentContainer(){const e=[this._renderContentFeature(),this._drillInWidget.render()];return C("calcite-flow",{key:"content-container"},e)}_renderContentFeature(){const{_drillInFlowItems:e,headingLevel:t,featureNavigationTop:i}=this,{title:o,active:s}=this.viewModel,n=o||"";return C("calcite-flow-item",{bind:this,class:this.classes({[w.contentFeature]:!0}),closed:!s,collapseDirection:i?"down":"up",headingLevel:t,key:"root-flow-item",loading:this.viewModel.waitingForContents,selected:0===e.length},"show-feature-info"===this.mode?C("calcite-action",{icon:"x",onclick:()=>{this.emit("close")},slot:"header-actions-end",text:this.messagesCommon.close}):void 0,n?C(A,{class:this.classes(w.featuresHeading,F.heading),innerHTML:n,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),this.hasAssociationsPopupElement?void 0:this._renderNoAssociationNotice(),C("div",{class:"add-nso"===this.mode?this.classes(w.container,w.contentContainer):this.classes(w.container,w.contentContainer,S.featureContent)},this._renderContent()))}_renderFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=d({action:e,feature:this.selectedFeature}),s={[w.icon]:!!t,[w.actionImage]:!!o};return t&&(s[t]=!0),o||t?C("span",{"aria-hidden":"true",class:this.classes(w.icon,s),key:"icon",styles:p(o)}):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?C("calcite-action",{active:"toggle"===e.type&&e.value,appearance:"solid",bind:this,"data-action-uid":e.uid,disabled:e.disabled||!this.feature.geometry,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_createSpinner(e){e&&(this._spinner=new h({view:e}),e.ui.add(this._spinner,{key:W,position:"manual",internal:!0}))}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()})}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,W),e.destroy(),this._spinner=null)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_getActionIcon(e){return e.icon?e.icon:e.image||e.className?void 0:"question"}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:s}=e,n=i?.attributes,r=e.title??"",a="zoom-to-feature"===s?T(r,{messages:t}):"remove-selected-feature"===s?T(r,{messages:o}):"zoom-to-clustered-features"===s||"browse-clustered-features"===s?T(r,{messages:t}):e.title;return a&&n?T(a,n):a??""}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;null!=i&&null!=t&&(this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i}),this.open(t))}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex(e=>e.uid===i),n=o.at(s);n&&"toggle"===n.type&&(n.value=!n.value),this.viewModel.triggerAction(s)}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find(({uid:e})=>e===i);o&&!o.disabled&&("toggle"===o?.type&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_wireUpView(e){this._destroySpinner(),e&&this._createSpinner(e)}};e([s()],L.prototype,"_drillInFlowItems",void 0),e([s()],L.prototype,"_hideActionText",null),e([s({readOnly:!0})],L.prototype,"active",null),e([s()],L.prototype,"content",null),e([s()],L.prototype,"feature",null),e([s()],L.prototype,"featureNavigationTop",void 0),e([s()],L.prototype,"goToOverride",null),e([s()],L.prototype,"hasAssociationsPopupElement",null),e([s()],L.prototype,"hasPopupInfo",null),e([s({type:f})],L.prototype,"headerActions",void 0),e([s()],L.prototype,"headingLevel",void 0),e([s()],L.prototype,"location",null),e([s(),k("esri/widgets/Features/t9n/Features")],L.prototype,"messages",void 0),e([s(),k("esri/t9n/common")],L.prototype,"messagesCommon",void 0),e([s()],L.prototype,"mode",null),e([s()],L.prototype,"promises",null),e([s()],L.prototype,"responsiveActionsEnabled",void 0),e([s({readOnly:!0})],L.prototype,"selectedFeature",null),e([s({readOnly:!0})],L.prototype,"selectedDrillInFeature",null),e([s({readOnly:!0})],L.prototype,"selectedFeatureWidget",null),e([s()],L.prototype,"timeZone",null),e([s()],L.prototype,"view",null),e([s({type:_}),b(["triggerAction","trigger-action"])],L.prototype,"viewModel",void 0),L=e([n("esri.widgets.UtilityNetworkTrace.UtilityNetworkTraceFeature")],L);const U=L;export{U as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{fetchMessageBundle as o}from"../../intl/messages.js";import s from"../Widget.js";import{css as a}from"../Features/css.js";import{zoomToFeature as r}from"../Popup/actions.js";import{loadCalciteComponents as n}from"../support/componentsUtils.js";import"../support/widgetUtils.js";import{messageBundle as c}from"../support/decorators/messageBundle.js";import{tsx as l,tsxFragment as d}from"../support/jsxFactory.js";import{substitute as p}from"../../intl/substitute.js";const m=r.clone(),u={featureContent:`${"esri-utility-network-trace"}__feature-content`};let h=class extends s{constructor(e,t){super(e,t),this._utilityNetworkTraceMessages=null,this.closed=!1,this.closable=!0,this.messages=null,this.messagesCommon=null,this._handleAddNonspatialTraceLocation=e=>{this.emit("add-nso-trace-location",{featureWidget:e})},this._handleOpenFeature=e=>{this.emit("open-feature",{feature:e})},this._handleZoomToFeature=e=>{this.emit("zoom-to-feature",{featureWidget:e})}}initialize(){(async()=>{this._utilityNetworkTraceMessages=await o("esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace")})()}loadDependencies(){return n({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item")})}get mode(){return this._get("mode")||"show-feature-info"}set mode(e){this._set("mode",e)}render(){const{flowItems:e}=this,t=e?.toArray();return l(d,null,t?.map((t,i)=>this._renderFlowItem(t,i===e.length-1)))}_renderAddNonspatialTraceLocationAction(e){const{_utilityNetworkTraceMessages:t}=this;return l("calcite-action",{appearance:"solid",bind:this,icon:"utility-network-trace",onclick:()=>this._handleAddNonspatialTraceLocation(e),scale:"s",text:t.inputsStrings.addNonspatialOption,textEnabled:!0,title:t.inputsStrings.addNonspatialOption})}_renderFlowItem(e,t){const{messages:i,closable:o,closed:s}=this,r="graphic"in e&&!e.isTable,n="feature-association"===e.flowType,c=this._getExitMessage(e),d=i.selectFeature,p=e,m=p?p.graphic?.
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{fetchMessageBundle as o}from"../../intl/messages.js";import s from"../Widget.js";import{css as a}from"../Features/css.js";import{zoomToFeature as r}from"../Popup/actions.js";import{loadCalciteComponents as n}from"../support/componentsUtils.js";import"../support/widgetUtils.js";import{messageBundle as c}from"../support/decorators/messageBundle.js";import{tsx as l,tsxFragment as d}from"../support/jsxFactory.js";import{substitute as p}from"../../intl/substitute.js";const m=r.clone(),u={featureContent:`${"esri-utility-network-trace"}__feature-content`};let h=class extends s{constructor(e,t){super(e,t),this._utilityNetworkTraceMessages=null,this.closed=!1,this.closable=!0,this.messages=null,this.messagesCommon=null,this._handleAddNonspatialTraceLocation=e=>{this.emit("add-nso-trace-location",{featureWidget:e})},this._handleOpenFeature=e=>{this.emit("open-feature",{feature:e})},this._handleZoomToFeature=e=>{this.emit("zoom-to-feature",{featureWidget:e})}}initialize(){(async()=>{this._utilityNetworkTraceMessages=await o("esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace")})()}loadDependencies(){return n({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item")})}get mode(){return this._get("mode")||"show-feature-info"}set mode(e){this._set("mode",e)}render(){const{flowItems:e}=this,t=e?.toArray();return l(d,null,t?.map((t,i)=>this._renderFlowItem(t,i===e.length-1)))}_renderAddNonspatialTraceLocationAction(e){const{_utilityNetworkTraceMessages:t}=this;return l("calcite-action",{appearance:"solid",bind:this,icon:"utility-network-trace",onclick:()=>this._handleAddNonspatialTraceLocation(e),scale:"s",text:t.inputsStrings.addNonspatialOption,textEnabled:!0,title:t.inputsStrings.addNonspatialOption})}_renderFlowItem(e,t){const{messages:i,closable:o,closed:s}=this,r="graphic"in e&&!e.isTable,n="feature-association"===e.flowType,c=this._getExitMessage(e),d=i.selectFeature,p=e,m=p?p.graphic?.sourceLayer:null,h=!(m?m.geometryType:null);return l("calcite-flow-item",{bind:this,closable:o,closed:s,description:this._getDrillInFlowItemDescription(e),heading:e.title??"",key:`flow-item-${e.viewModel.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleDrillInBackClick()}},l("calcite-action",{appearance:"transparent",bind:this,class:a.actionExit,icon:"move-up",key:"exit-action",onclick:this._handleExitClick,slot:"header-actions-start",text:c,title:c}),r?l("calcite-action",{appearance:"transparent",bind:this,icon:"zoom-to-object",key:"open-feature-action",onclick:()=>this._handleOpenFeature(e),slot:"header-actions-end",text:d,title:d}):null,"show-feature-info"===this.mode?l("calcite-action",{icon:"x",onclick:()=>{this.emit("close")},slot:"header-actions-end",text:this.messagesCommon.close}):void 0,n&&"add-nso"===this.mode?l("calcite-action-bar",{expandDisabled:!0,expanded:!0,key:"header-action-bar",scale:"s",slot:"action-bar"},l("calcite-action-group",{overlayPositioning:"fixed",scale:"s"},h?this._renderAddNonspatialTraceLocationAction(e):this._renderZoomToFeatureAction(e))):null,l("div",{class:this.classes(a.container,u.featureContent)},e.render()))}_renderZoomToFeatureAction(e){const t=this._getActionTitle(m);return l("calcite-action",{active:m.active,appearance:"solid",bind:this,"data-action-uid":m.uid,disabled:m.disabled,icon:m.icon??"question",indicator:m.indicator,key:`action-${m.uid}`,loading:m.active,onclick:()=>this._handleZoomToFeature(e),scale:"s",text:t,textEnabled:!0,title:t})}_getActionTitle(e){const{messages:t}=this,{id:i}=e,o=e.title??"";return"zoom-to-feature"===i?p(o,{messages:t}):o}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":return e.viewModel.description??"";case"feature-relationship":return e.allItemsDescription;case"feature-utility-network-association-type":return e.description??""}}_getExitMessage(e){switch(e.flowType){case"feature":case"feature-association":return"";case"feature-relationship":return this.messages.exitRelatedRecords;case"feature-utility-network-associations":case"feature-utility-network-association-type":return this.messages.exitAssociations}}_handleDrillInBackClick(){const e=this.flowItems?.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_handleExitClick(){this.emit("exit")}};e([t()],h.prototype,"closed",void 0),e([t()],h.prototype,"closable",void 0),e([t()],h.prototype,"flowItems",void 0),e([t(),c("esri/widgets/Features/t9n/Features")],h.prototype,"messages",void 0),e([t(),c("esri/t9n/common")],h.prototype,"messagesCommon",void 0),e([t()],h.prototype,"mode",null),h=e([i("esri.widgets.UtilityNetworkTrace.UtilityNetworkTraceFeaturesDrillIn")],h);const f=h;export{f as default};
|