@arcgis/core 4.26.0-next.20230121 → 4.26.0-next.20230123
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/SceneViewer/sceneViewerUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/006af87392d7136fb8c7.js +1 -0
- package/assets/esri/core/workers/chunks/5c8fd7842bdfe912eef2.js +1 -0
- package/assets/esri/core/workers/chunks/{d75f1c8f8dcabdf32021.js → c49510a48cdf64a0d9fc.js} +1 -1
- package/assets/esri/themes/base/widgets/_Tooltip.scss +29 -2
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_en.json +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/voxel/VoxelIsosurface.js +1 -1
- package/package.json +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectStates.js +1 -1
- package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/support/SceneLayerViewRequiredFields.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/webgl-engine/lib/AppleAmdDriverHelper.js +5 -0
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/draw/DrawGraphicTool.js +1 -1
- package/views/interactive/sketch/SketchTooltipVisibleElements.js +1 -1
- package/views/interactive/tooltip/DrawTooltipInfos.js +1 -1
- package/views/interactive/tooltip/SketchTooltipInfo.js +1 -1
- package/views/interactive/tooltip/content/TooltipContent.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawCircle.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawRectangle.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentExtentRotate.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentExtentScale.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentReshapeEdgeOffset.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformAbsolute.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformRotate.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformScale.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateGraphic.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateGraphicXY.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateGraphicZ.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateVertexXY.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateVertexZ.js +1 -1
- package/views/interactive/tooltip/css.js +1 -1
- package/views/interactive/tooltip/support/TooltipContentWithHelpMessage.js +5 -0
- package/views/webgl/WebGLDriverTest.js +1 -1
- package/views/webgl/testAppleAmdDrawArrays.js +5 -0
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/assets/esri/core/workers/chunks/1363e647f3b0bca07e09.js +0 -1
- package/assets/esri/core/workers/chunks/fa52b97a76b2b4170c5d.js +0 -1
package/widgets/Editor.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{HandleOwnerMixin as t}from"../core/HandleOwner.js";import s from"../core/Logger.js";import{isSome as a}from"../core/maybe.js";import{createDeferred as i}from"../core/promiseUtils.js";import{watch as n,on as o,when as r,initial as l}from"../core/reactiveUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import{cast as c}from"../core/accessorSupport/decorators/cast.js";import"../core/arrayUtils.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{getDisplayFieldName as m}from"../layers/support/fieldUtils.js";import h from"./Attachments.js";import u from"./FeatureForm.js";import g from"./FeatureTemplates.js";import _ from"./Spinner.js";import w from"./Widget.js";import{workflowDeprecation as f}from"./Editor/deprecationUtils.js";import v from"./Editor/EditorViewModel.js";import{ItemList as k}from"./FeatureTemplates/ItemList.js";import{Heading as b,incrementHeadingLevel as y}from"./support/Heading.js";import C from"./support/SnappingControls.js";import{accessibleHandler as M}from"./support/decorators/accessibleHandler.js";import{messageBundle as A}from"./support/decorators/messageBundle.js";import{vmEvent as F}from"./support/decorators/vmEvent.js";import{tsx as W}from"./support/jsxFactory.js";import"./support/widgetUtils.js";import{substitute as E}from"../intl/substitute.js";const T="esri-editor",B=`${T}__panel`,S=`${T}__prompt`,L={base:`${T} esri-widget esri-widget--panel`,message:`${T}__message`,actions:`${T}__actions`,actionButton:`${T}_action-button`,progressBar:`${T}__progress-bar`,panelToolbar:`${B}-toolbar`,panelContent:`${B}-content`,panelContentMessage:`${B}-content__message`,panelContentSection:`${B}-content__section`,panelContentSectionGroup:`${B}-content__section__group`,snappingSettingsContainer:`${T}__snapping-settings`,updateFeaturesActionButtons:`${T}__update-features-action-buttons`,updateFeaturesActionButtonsButton:`${T}__update-features-action-buttons--button`,featureTemplatesContainer:`${T}__feature-templates-container`,promptContainer:S,promptHeader:`${S}__header`,promptHeading:`${S}__header__heading`,promptMessage:`${S}__message`,promptDivider:`${S}__divider`,promptActions:`${S}__actions`,warningIcon:"esri-icon-notice-triangle",widgetIcon:"esri-icon-edit"},P={undoRedoButtons:!1,snappingControls:!0,snappingControlsElements:{header:!1,enabledToggle:!0,selfEnabledToggle:!0,featureEnabledToggle:!0,layerList:!0}};function j(e){e.focus()}const I="esri.widgets.Editor",U=s.getLogger(I);let V=class extends(t(w)){constructor(e,t){super(e,t),this._candidateCommitted=!1,this._featureForm=new u,this._attachments=new h({visibleElements:{addSubmitButton:!1,cancelAddButton:!1,cancelUpdateButton:!1,deleteButton:!1,errorMessage:!1,progressBar:!1,updateButton:!1}}),this._featureTemplates=new g({enableListScroll:!1}),this._filterText="",this._prompt=null,this._spinner=new _,this.useDeprecatedCreateWorkflow=!1,this.headingLevel=4,this.iconClass=L.widgetIcon,this.messages=null,this.messagesCommon=null,this.messagesTemplates=null,this.supportingWidgetDefaults=null,this.viewModel=new v,this.visibleElements={...P},this._setCandidateFeature=(e,t=!1)=>{if(this._candidateCommitted)return;const s=this._assertActiveUpdateWorkflow();s.data.edits.feature=e,t&&(s.next(),this._candidateCommitted=!0)},this._clearPrompt=()=>{this._prompt=null},this._handleSave=this._handleSave.bind(this),this._handleBack=this._handleBack.bind(this),this._handleDelete=this._handleDelete.bind(this),this._handleAdd=this._handleAdd.bind(this),this._handleEdit=this._handleEdit.bind(this),this._handleAttachmentAdd=this._handleAttachmentAdd.bind(this),this._handleAttachmentUpdate=this._handleAttachmentUpdate.bind(this),this._handleAttachmentDelete=this._handleAttachmentDelete.bind(this),this.EditorPanel=this.EditorPanel.bind(this)}initialize(){const{view:e,snappingOptions:t}=this;this._snappingControls=new C({layerListOpen:!1,snappingOptions:t,view:e,visibleElements:this.visibleElements.snappingControlsElements});const s=()=>this.scheduleRender();this.addHandles([n((()=>y(this.headingLevel)),(e=>{this._featureForm.headingLevel=e,this._featureTemplates.headingLevel=e}),l),o((()=>this.viewModel.featureTemplatesViewModel),"select",(async({item:e,oldItem:t})=>{this.viewModel.activeWorkflow&&await this.viewModel.cancelWorkflow(),e&&e.id!==t?.id&&(this.useDeprecatedCreateWorkflow?this.startCreateWorkflowAtFeatureCreation(e):this.startCreateFeaturesWorkflowAtFeatureCreation(e))})),n((()=>this.viewModel.selectedTemplateItem),(e=>this._featureTemplates.select(e,!1))),n((()=>this.viewModel),(e=>{this._featureForm.viewModel=e?.featureFormViewModel??null,this._attachments.viewModel=e?.attachmentsViewModel??null,this._featureTemplates.viewModel=e?.featureTemplatesViewModel??null,this._spinner.viewModel=e?.spinnerViewModel??null}),l),n((()=>this.view),((e,t)=>{const s=`editor-${this.id}-spinner`;t?.ui.remove(this._spinner,s),e?.ui.add(this._spinner,{key:s,position:"manual"})}),l),o((()=>this.viewModel?.sketchViewModel),"create",s),o((()=>this.viewModel?.activeWorkflow),"cancel-request",(({controller:e})=>{const{messages:t,messagesCommon:s}=this;this._prompt={title:t.cancelRequestTitle,message:t.cancelRequestWarningMessage,context:"danger",actions:{primary:{label:s.form.yes,action:()=>{e.allow(),this._clearPrompt()}},secondary:{label:s.form.no,action:()=>{e.deny(),this._clearPrompt()}}}}})),r((()=>this.supportingWidgetDefaults),(e=>{this._featureForm.set(e.featureForm),this._attachments.set(e.attachments),this._featureTemplates.set(e.featureTemplates),this.viewModel.sketchViewModel.set(e.sketch)}),l),r((()=>this._attachments?.error),(e=>{const{messages:t,messagesCommon:s}=this;this._prompt={title:t.errorWarningTitle,message:e.message,context:"warning",actions:{primary:{label:s.form.ok,action:this._clearPrompt}}}})),r((()=>this.viewModel?.failures),(e=>{const{messages:t}=this,[{error:s,retry:a,cancel:i}]=e;this._prompt={title:t.errorWarningTitle,message:E(t.errorWarningMessageTemplate,{errorMessage:s.message}),context:"warning",actions:{primary:{label:t.retry,action:()=>{a(),this._clearPrompt()}},secondary:{label:t.ignore,action:()=>{i(),this._clearPrompt()}}}}})),n((()=>this.viewModel?.state),(e=>{switch(e){case"awaiting-feature-to-update":case"ready":case"disabled":this._filterText="",this._featureTemplates.filterText="";break;case"awaiting-update-feature-candidate":this._candidateCommitted=!1}})),n((()=>[this._attachments?.selectedFile,this._attachments?.submitting]),s),n((()=>this.viewModel.featureFormDisabled),(e=>this._featureForm.disabled=e)),o((()=>this.view),"key-down",(e=>{"Escape"===e.key&&this._handleBack()}))])}destroy(){this._attachments.destroy(),this._featureForm.destroy(),this._featureTemplates.destroy(),this._snappingControls.destroy()}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-accordion-item.js"),import("@esri/calcite-components/dist/components/calcite-accordion.js"),import("@esri/calcite-components/dist/components/calcite-button.js"),import("@esri/calcite-components/dist/components/calcite-flow-item.js"),import("@esri/calcite-components/dist/components/calcite-flow-item.js"),import("@esri/calcite-components/dist/components/calcite-flow.js"),import("@esri/calcite-components/dist/components/calcite-icon.js"),import("@esri/calcite-components/dist/components/calcite-list.js"),import("@esri/calcite-components/dist/components/calcite-list-item.js"),import("@esri/calcite-components/dist/components/calcite-scrim.js")])}get activeWorkflow(){return this.viewModel.activeWorkflow}get allowedWorkflows(){return this.viewModel.allowedWorkflows}set allowedWorkflows(e){this.viewModel.allowedWorkflows=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelOptions(){return this.viewModel.labelOptions}set labelOptions(e){this.viewModel.labelOptions=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get tooltipOptions(){return this.viewModel.tooltipOptions}set tooltipOptions(e){this.viewModel.tooltipOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}castVisibleElements(e){const t={...P,...e,snappingControlsElements:{...P.snappingControlsElements,...e?.snappingControlsElements}};return a(this._snappingControls)&&(this._snappingControls.visibleElements=t.snappingControlsElements),t}startCreateWorkflowAtFeatureTypeSelection(){return f(U,"startCreateWorkflowAtFeatureTypeSelection","startCreateFeaturesWorkflowAtFeatureTypeSelection"),this.viewModel.startCreateWorkflowAtFeatureTypeSelection()}startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.viewModel.startCreateFeaturesWorkflowAtFeatureTypeSelection()}startCreateWorkflowAtFeatureCreation(e){return f(U,"startCreateWorkflowAtFeatureCreation","startCreateFeaturesWorkflowAtFeatureCreation"),this.viewModel.startCreateWorkflowAtFeatureCreation(e)}startCreateFeaturesWorkflowAtFeatureCreation(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureCreation(e)}startCreateWorkflowAtFeatureEdit(e){return f(U,"startCreateWorkflowAtFeatureEdit"),this.viewModel.startCreateWorkflowAtFeatureEdit(e)}startUpdateWorkflowAtFeatureSelection(){return this.viewModel.startUpdateWorkflowAtFeatureSelection()}startUpdateWorkflowAtMultipleFeatureSelection(e){return this.viewModel.startUpdateWorkflowAtMultipleFeatureSelection(e)}startUpdateWorkflowAtFeatureEdit(e){return this.viewModel.startUpdateWorkflowAtFeatureEdit(e)}deleteFeatureFromWorkflow(){return this.viewModel.deleteFeatureFromWorkflow()}cancelWorkflow(e){return this.viewModel.cancelWorkflow(e)}render(){const{_attachments:e,_prompt:t,viewModel:s}=this;if(!s)return W("div",{class:L.base});const i=a(t)&&W("calcite-scrim",null,this._renderPrompt(t)),{state:n}=s,o=s.syncing||e.submitting;return W("div",{class:L.base},o&&this._renderProgressBar(),W("calcite-flow",null,s.pageStack.map((e=>this._renderPage(e,n))),this._renderPage(s.page,n)),i)}_renderPage(e,t){switch(e){case"disabled":break;case"ready":return this._renderLanding(t);case"awaiting-feature-creation-info":return this._renderTemplates(t);case"creating-features":case"editing-new-feature":case"editing-existing-feature":return this._renderAttributeEditing(t);case"awaiting-update-feature-candidate":return this._renderFeatureList(t);case"adding-attachment":return this._renderAttachmentAdding(t);case"editing-attachment":return this._renderAttachmentEditing(t)}return W("div",null)}_isPanelActive(e){return this.viewModel.state===e}_renderTemplates(e){const{EditorPanel:t,headingLevel:s,messages:a,messagesCommon:i,_handleBack:n,_snappingControls:o,viewModel:{sketchViewModel:r}}=this;return W(t,{active:this._isPanelActive(e),key:"templates-panel",handleBack:n,heading:a.selectTemplate,headingLevel:s,messages:a,messagesCommon:i,sketchViewModel:r,snappingControls:o},W("div",{class:L.panelContent},this._featureTemplates.render()),this._renderFooterActions([this._backButtonInfo]))}_renderAttributeEditing(e){const{activeWorkflow:t,EditorPanel:s,messages:a,messagesCommon:i,headingLevel:n,_handleBack:o,_snappingControls:r,viewModel:l}=this;if(!t)return null;const d=t.type,c=l.featureFormViewModel,p="update"===d&&!t.data.edits.modified||l.syncing||c.updating,m="update"===d?a.editFeature:a.createFeatures,h="update"===d?i.update:i.create,u="create-features"===d&&"create-new"===t.createFeatureState,g="create-features"===d?t.numPendingFeatures:0,_=g>1?E(a.createFeaturesTemplate,{numFeatures:g}):h,w=this._shouldShowAttachments,f=c.inputFields.every((e=>!e.visible))&&!w?this._renderMessage(E(a.clickToFinishTemplate,{button:h})):W("div",{key:"panel-content-section",class:L.panelContentSection},W("div",{class:L.panelContentSectionGroup},this._featureForm.render(),w&&W("div",{key:"attachments"},W(b,{level:y(n)},a.attachments),this._attachments.render())));return W(s,{active:this._isPanelActive(e),key:"attribute-editing-panel",heading:m,headingLevel:n,handleBack:o,messages:a,messagesCommon:i,sketchViewModel:l.sketchViewModel,snappingControls:r},W("div",{key:"panel-content",class:L.panelContent},f,u&&W("calcite-scrim",null)),this._renderFooterActions([this._backButtonInfo,{clickHandler:this._handleSave,disabled:p,label:_,type:"primary"},this._shouldShowDeleteButton?{...this._deleteButtonCommonInfo,clickHandler:this._handleDelete,disabled:l.syncing,label:i.delete}:null]))}_renderAttachmentAdding(e){const{_attachments:t,EditorPanel:s,_handleBack:a,headingLevel:i,messages:n,messagesCommon:o,_snappingControls:r,viewModel:{sketchViewModel:l}}=this;return W(s,{active:this._isPanelActive(e),key:"attachment-adding-panel",heading:n.addAttachment,headingLevel:i,handleBack:a,messages:n,messagesCommon:o,sketchViewModel:l,snappingControls:r},W("div",{class:L.panelContent},t.render()),this._renderFooterActions([{label:t.submitting?o.cancel:o.add,disabled:t.submitting||!t.selectedFile,type:"primary",clickHandler:this._handleAttachmentAdd},this._backButtonInfo]))}_renderAttachmentEditing(e){const{_attachments:t,EditorPanel:s,_handleBack:a,headingLevel:i,messages:n,messagesCommon:o,_snappingControls:r,viewModel:{sketchViewModel:l}}=this;return W(s,{active:this._isPanelActive(e),key:"attachment-editing-panel",heading:n.editAttachment,headingLevel:i,handleBack:a,messages:n,messagesCommon:o,sketchViewModel:l,snappingControls:r},W("div",{class:L.panelContent},t.render()),this._renderFooterActions([this._backButtonInfo,{label:o.update,disabled:t.submitting||!t.selectedFile,type:"primary",clickHandler:this._handleAttachmentUpdate},{...this._deleteButtonCommonInfo,clickHandler:this._handleAttachmentDelete,disabled:t.submitting,label:o.delete}]))}_renderMessage(e){return W("div",{key:"panel-content-message",class:L.panelContentMessage},e)}_renderFooterActions(e){return W("div",{key:"footer-actions",slot:"footer",class:L.actions},e.filter(a).map((({type:e,disabled:t,class:s,clickHandler:a,label:i,...n},o)=>W("calcite-button",{key:`action-${o}`,slot:"footer-actions",class:this.classes(s,L.actionButton),disabled:t??!1,onclick:a,width:"full",...n},i))))}_renderPrompt({title:e,message:t,context:s,actions:a}){const i=a.secondary,n=W("calcite-button",{appearance:"solid",kind:"danger"===s?"danger":"brand",width:i?"half":"full",onclick:a.primary.action,key:"prompt-primary-button",afterCreate:j},a.primary.label),o=i&&W("calcite-button",{appearance:"outline",kind:"danger"===s?"danger":"brand",width:"half",onclick:i.action,key:"prompt-secondary-button"},i.label);return W("div",{class:`${L.promptContainer}--${s}`},W("div",{class:L.promptHeader},W("calcite-icon",{icon:"exclamation-mark-triangle"}),W(b,{class:L.promptHeading,level:this.headingLevel},e)),W("div",{class:L.promptMessage},t),W("div",{class:L.promptDivider}),W("div",{class:L.promptActions},o,n))}_renderProgressBar(){return W("div",{class:this.classes(L.progressBar),key:"progress-bar"})}_renderLanding(e){const{EditorPanel:t,headingLevel:s,messages:a,messagesCommon:i,_snappingControls:n,_featureTemplates:{viewModel:{numberOfFeatureTemplates:o}},viewModel:{canUpdate:r,sketchViewModel:l}}=this,d=!r&&0===o;return W(t,{active:this._isPanelActive(e),key:"landing-panel",heading:a.widgetLabel,headingLevel:s,messages:a,messagesCommon:i,sketchViewModel:l,snappingControls:n},W("div",{class:L.panelContent},r&&W("div",{key:"edit-actions",class:L.panelContentSection},this._renderUpdateActions(e)),o>0&&W("div",{key:"create-actions",class:L.panelContentSection},this._renderCreateActions()),d&&W("div",{key:"no-content",class:L.panelContentMessage},a.noEditableLayers)))}_renderUpdateActions(e){const{messages:t,messagesCommon:s}=this;return W("div",{key:"update-actions"},W(b,{level:y(this.headingLevel)},t.editFeatures),W("calcite-list",{selectionMode:"single",selectionAppearance:"border"},W("calcite-list-item",{selected:"awaiting-feature-to-update"===e,label:s.select,onCalciteListItemSelect:this._handleEdit},W("calcite-icon",{icon:"cursor",slot:"content-start"}))))}_renderCreateActions(){const{_featureTemplates:e,headingLevel:t,messages:s}=this;return W("div",{key:"create-actions"},W(b,{level:y(t)},s.createFeatures),W("div",{key:"templates",class:L.featureTemplatesContainer},e.render()))}_renderFeatureList(e){const{EditorPanel:t,_handleBack:s,headingLevel:i,messages:n,messagesCommon:o,messagesTemplates:r,_snappingControls:l,viewModel:{editableItems:d,sketchViewModel:c}}=this,p=this._assertActiveUpdateWorkflow().data.candidates,m=E(n.multipleFeaturesTemplate,{total:p.length}),h=new Map;let u=0;p.map((e=>({label:this._getLabel(e),id:e.attributes[e.layer.objectIdField],data:e}))).filter((e=>{const{label:t,data:s}=e,a=this._filterText.toLowerCase(),{title:i}=s.layer,n=d.find((e=>e.layer===s.layer));if(!n)return null;const{attachmentsOnUpdateEnabled:o,supports:r}=n;return(r.includes("update")||r.includes("delete")||o)&&(!a||t?.toLowerCase().includes(a)||i?.toLowerCase().includes(a))})).filter(a).forEach((e=>{u++;const t=e.data.layer;h.has(t)?h.get(t)?.items.push(e):h.set(t,{id:`${t.id}`,label:t.title??"",items:[e]})}));const g=d.toArray().map((({layer:e})=>h.get(e))).filter(a),_=u>10||this._filterText.length>0;return W(t,{active:this._isPanelActive(e),key:"feature-list",heading:m,headingLevel:i,handleBack:s,messages:n,messagesCommon:o,sketchViewModel:c,snappingControls:l},W("div",{class:L.panelContent},W("div",{class:L.panelContentSection},k({id:this.id,enableListScroll:!1,filterEnabled:_,filterText:this._filterText,items:g,messages:{filterPlaceholder:r.filterPlaceholder,noItems:r.noItems,noMatches:r.noMatches},onItemMouseEnter:e=>this._setCandidateFeature(e.data),onItemMouseLeave:()=>this._setCandidateFeature(null),onItemSelect:e=>this._setCandidateFeature(e.data,!0),onFilterChange:e=>this._filterText=e}))),this._renderFooterActions([this._backButtonInfo]))}EditorPanel(e,...t){const{handleBack:s,heading:a,headingLevel:i,key:n,messages:o,messagesCommon:r,sketchViewModel:l,snappingControls:d}=e,{snappingControls:c,undoRedoButtons:p}=this.visibleElements;return W("calcite-flow-item",{bind:this,key:n,heading:a,headingLevel:i,closable:!1,onCalciteFlowItemBack:s??void 0},W("div",{key:"panel-toolbar",class:L.panelToolbar},c&&W("calcite-accordion",{class:L.snappingSettingsContainer,appearance:"transparent"},W("calcite-accordion-item",{heading:o?.snapping,iconStart:"vertex-gps"},d.render())),p&&[W("calcite-button",{key:"undo-button",label:r.undo,appearance:"transparent",kind:"neutral",alignment:"center",iconStart:"undo",scale:"l",disabled:!l.canUndo(),onclick:l.undo.bind(l)},r.undo),W("calcite-button",{key:"redo-button",label:r.redo,appearance:"transparent",kind:"neutral",alignment:"center",iconStart:"redo",scale:"l",disabled:!l.canRedo(),onclick:l.redo.bind(l)},r.redo)]),...t)}_getLabel(e){const t=e.layer;if(!t)return null;const{objectIdField:s}=t,{attributes:a}=e,i=m(t);return i&&a[i]&&`${a[i]}`||E(this.messages.untitledFeatureTemplate,{id:a[s]})}_handleDelete(){const{messages:e,messagesCommon:t}=this;this._prompt={title:e.deleteWarningTitle,message:e.deleteWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:()=>{this.viewModel.deleteFeatureFromWorkflow(),this._clearPrompt()}},secondary:{label:e.keepFeature,action:this._clearPrompt}}}}_handleSave(){const{featureFormViewModel:e}=this.viewModel;e.submit(),!e.submittable||e.validateContingencyConstraints(e.getValues(),{includeIncompleteViolations:!0}).length>0||this.viewModel.activeWorkflow?.commit()}_handleAttachmentAdd(){const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type?(this._attachments.addFile(),e.previous()):this._attachments.addAttachment().then((()=>e.previous())))}_handleAttachmentUpdate(){const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type?(this._attachments.updateFile(),e.previous()):this._attachments.updateAttachment().then((()=>e.previous())))}_handleAttachmentDelete(){const{messages:e,messagesCommon:t}=this;this._prompt={title:e.deleteAttachmentWarningTitle,message:e.deleteAttachmentWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:()=>{const{_attachments:e}=this,{activeWorkflow:t}=this.viewModel;t&&("create-features"===t.type?(e.deleteFile(),t.previous(),this._clearPrompt()):e.deleteAttachment(e.viewModel.activeAttachmentInfo).then((()=>{t.previous(),this._clearPrompt()})))}},secondary:{label:e.keepAttachment,action:this._clearPrompt}}}}_handleAdd(){this.viewModel.canCreate}async _handleEdit(e){const{viewModel:t}=this;if(!t.canUpdate)return;e.target.selected?await t.startUpdateWorkflowAtFeatureSelection():t.activeWorkflow&&await t.cancelWorkflow()}async _handleBack(e){e?.stopPropagation();const t=this.activeWorkflow;if(!t||!this._canGoBack)return;const s=i(),a=async()=>{await(t.hasPreviousStep?t.previous({cancelCurrentStep:!0}):this.viewModel.cancelWorkflow({force:!0})),s.resolve()},n="create"===t.type;if(n||"create-features"===t.type&&t.numPendingFeatures>0||"editing-existing-feature"===t.stepId&&t.data.edits.modified){const{messages:e}=this;this._prompt={title:n?e.cancelAddTitle:e.cancelEditTitle,message:n?e.cancelAddWarningMessage:e.cancelEditWarningMessage,context:"danger",actions:{primary:{label:n?e.discardFeature:e.discardEdits,action:()=>{this._clearPrompt(),a()}},secondary:{label:n?e.continueAdding:e.continueEditing,action:this._clearPrompt}}}}else a();return s.promise}_assertActiveUpdateWorkflow(){const e=this.viewModel.activeWorkflow;if("update"===e?.type)return e;throw new Error("Expected activeWorkflow to be an UpdateWorkflow")}get _canGoBack(){return a(this.activeWorkflow)&&!this.viewModel.syncing}get _shouldShowDeleteButton(){const{activeWorkflow:e}=this;return!!e&&"update"===e.type&&e.data.editableItem.supports.includes("delete")}get _shouldShowAttachments(){const e=this.activeWorkflow;if(!e)return!1;if("update"===e.type)return e.data.editableItem.attachmentsOnUpdateEnabled;const t=e.data.creationInfo;if(!t)return!1;const{layerInfos:s}=this,{layer:a}=t,i=this.viewModel.editableItems.find((e=>e.layer===a));if(i)return i.attachmentsOnCreateEnabled;const{data:n}=a.capabilities,o=s&&s.find((e=>e.layer===a));return"supportsAttachment"in n&&n.supportsAttachment&&(!o||!1!==o.allowAttachments&&!1!==o.attachmentsOnUpdateEnabled)}get _backButtonInfo(){return{appearance:"outline",clickHandler:this._handleBack,label:this.messagesCommon.back,type:"secondary"}}get _deleteButtonCommonInfo(){return{appearance:"transparent",kind:"danger",type:"primary"}}};e([d()],V.prototype,"_attachments",void 0),e([d()],V.prototype,"_filterText",void 0),e([d()],V.prototype,"_prompt",void 0),e([d({readOnly:!0})],V.prototype,"activeWorkflow",null),e([d()],V.prototype,"allowedWorkflows",null),e([d()],V.prototype,"useDeprecatedCreateWorkflow",void 0),e([d()],V.prototype,"headingLevel",void 0),e([d()],V.prototype,"iconClass",void 0),e([d()],V.prototype,"label",null),e([d()],V.prototype,"labelOptions",null),e([d()],V.prototype,"layerInfos",null),e([d(),A("esri/widgets/Editor/t9n/Editor")],V.prototype,"messages",void 0),e([d(),A("esri/t9n/common")],V.prototype,"messagesCommon",void 0),e([d(),A("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],V.prototype,"messagesTemplates",void 0),e([d()],V.prototype,"snappingOptions",null),e([d()],V.prototype,"tooltipOptions",null),e([d()],V.prototype,"supportingWidgetDefaults",void 0),e([d()],V.prototype,"view",null),e([d(),F(["workflow-cancel","workflow-commit"])],V.prototype,"viewModel",void 0),e([d()],V.prototype,"visibleElements",void 0),e([c("visibleElements")],V.prototype,"castVisibleElements",null),e([M()],V.prototype,"_handleDelete",null),e([M()],V.prototype,"_handleAttachmentAdd",null),e([M()],V.prototype,"_handleAttachmentUpdate",null),e([M()],V.prototype,"_handleAttachmentDelete",null),e([M()],V.prototype,"_handleAdd",null),e([M()],V.prototype,"_handleEdit",null),e([M()],V.prototype,"_handleBack",null),e([d()],V.prototype,"_canGoBack",null),e([d()],V.prototype,"_shouldShowDeleteButton",null),e([d()],V.prototype,"_shouldShowAttachments",null),e([d()],V.prototype,"_backButtonInfo",null),e([d()],V.prototype,"_deleteButtonCommonInfo",null),V=e([p(I)],V);const $=V;export{$ as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{HandleOwnerMixin as t}from"../core/HandleOwner.js";import s from"../core/Logger.js";import{isSome as o}from"../core/maybe.js";import{createDeferred as a}from"../core/promiseUtils.js";import{watch as i,on as n,when as r,initial as l}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import"../core/arrayUtils.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{getDisplayFieldName as m}from"../layers/support/fieldUtils.js";import h from"./Attachments.js";import u from"./FeatureForm.js";import g from"./FeatureTemplates.js";import _ from"./Spinner.js";import w from"./Widget.js";import{workflowDeprecation as f}from"./Editor/deprecationUtils.js";import v from"./Editor/EditorViewModel.js";import{ItemList as k}from"./FeatureTemplates/ItemList.js";import{Heading as y,incrementHeadingLevel as b}from"./support/Heading.js";import C from"./support/SnappingControls.js";import{accessibleHandler as M}from"./support/decorators/accessibleHandler.js";import{messageBundle as A}from"./support/decorators/messageBundle.js";import{vmEvent as F}from"./support/decorators/vmEvent.js";import{tsx as W}from"./support/jsxFactory.js";import"./support/widgetUtils.js";import{substitute as T}from"../intl/substitute.js";const E="esri-editor",B=`${E}__panel`,L=`${E}__prompt`,S={base:`${E} esri-widget esri-widget--panel`,message:`${E}__message`,actions:`${E}__actions`,actionButton:`${E}_action-button`,progressBar:`${E}__progress-bar`,panelToolbar:`${B}-toolbar`,panelContent:`${B}-content`,panelContentMessage:`${B}-content__message`,panelContentSection:`${B}-content__section`,panelContentSectionGroup:`${B}-content__section__group`,snappingSettingsContainer:`${E}__snapping-settings`,updateFeaturesActionButtons:`${E}__update-features-action-buttons`,updateFeaturesActionButtonsButton:`${E}__update-features-action-buttons--button`,featureTemplatesContainer:`${E}__feature-templates-container`,promptContainer:L,promptHeader:`${L}__header`,promptHeading:`${L}__header__heading`,promptMessage:`${L}__message`,promptDivider:`${L}__divider`,promptActions:`${L}__actions`,warningIcon:"esri-icon-notice-triangle",widgetIcon:"esri-icon-edit"},j={undoRedoButtons:!1,snappingControls:!0,snappingControlsElements:{header:!1,enabledToggle:!0,selfEnabledToggle:!0,featureEnabledToggle:!0,layerList:!0}};function P(e){e.focus()}const I="esri.widgets.Editor",U=s.getLogger(I);let $=class extends(t(w)){constructor(e,t){super(e,t),this._featureForm=new u,this._attachments=new h({visibleElements:{addSubmitButton:!1,cancelAddButton:!1,cancelUpdateButton:!1,deleteButton:!1,errorMessage:!1,progressBar:!1,updateButton:!1}}),this._featureTemplates=new g({enableListScroll:!1}),this._filterText="",this._prompt=null,this._spinner=new _,this.useDeprecatedCreateWorkflow=!1,this.headingLevel=4,this.iconClass=S.widgetIcon,this.messages=null,this.messagesCommon=null,this.messagesTemplates=null,this.supportingWidgetDefaults=null,this.viewModel=new v,this.visibleElements={...j},this.EditorPanel=(e,...t)=>{const{handleBack:s,heading:o,headingLevel:a,key:i,messages:n,messagesCommon:r,sketchViewModel:l,snappingControls:c}=e,d=this.visibleElements;return W("calcite-flow-item",{bind:this,key:i,heading:o,headingLevel:a,closable:!1,onCalciteFlowItemBack:s??void 0},W("div",{key:"panel-toolbar",class:S.panelToolbar},d.snappingControls&&W("calcite-accordion",{class:S.snappingSettingsContainer,appearance:"transparent"},W("calcite-accordion-item",{heading:n?.snapping,iconStart:"vertex-gps"},c.render())),d.undoRedoButtons&&[W("calcite-button",{key:"undo-button",label:r.undo,appearance:"transparent",kind:"neutral",alignment:"center",iconStart:"undo",scale:"l",disabled:!l.canUndo(),onclick:l.undo.bind(l)},r.undo),W("calcite-button",{key:"redo-button",label:r.redo,appearance:"transparent",kind:"neutral",alignment:"center",iconStart:"redo",scale:"l",disabled:!l.canRedo(),onclick:l.redo.bind(l)},r.redo)]),...t)},this._showDiscardWarning=()=>{const{messages:e}=this,t="create"===this.activeWorkflow?.type,s=a();return this._prompt={title:e[t?"cancelAddTitle":"cancelEditTitle"],message:e[t?"cancelAddWarningMessage":"cancelEditWarningMessage"],context:"danger",actions:{primary:{label:e[t?"discardFeature":"discardEdits"],action:()=>{s.resolve(),this._clearPrompt()}},secondary:{label:e[t?"continueAdding":"continueEditing"],action:()=>{s.reject(),this._clearPrompt()}}}},s.promise},this._onAttachmentDeleteConfirm=async()=>{const e=this._attachments,{activeWorkflow:t}=this.viewModel;t&&("create-features"===t.type?e.deleteFile():(await e.deleteAttachment(e.viewModel.activeAttachmentInfo),this._clearPrompt()),await t.previous(),this._clearPrompt())},this._onAttachmentsError=e=>{this._prompt={title:this.messages.errorWarningTitle,message:e.message,context:"warning",actions:{primary:{label:this.messagesCommon.form.ok,action:this._clearPrompt}}}},this._clearPrompt=()=>{this._prompt=null},this._onBack=this._onBack.bind(this),this._onSave=this._onSave.bind(this),this._onDelete=this._onDelete.bind(this),this._onToggleUpdateWorkflow=this._onToggleUpdateWorkflow.bind(this),this._onAttachmentAdd=this._onAttachmentAdd.bind(this),this._onAttachmentUpdate=this._onAttachmentUpdate.bind(this),this._onAttachmentDelete=this._onAttachmentDelete.bind(this)}initialize(){const{view:e,snappingOptions:t}=this;this._snappingControls=new C({layerListOpen:!1,snappingOptions:t,view:e,visibleElements:this.visibleElements.snappingControlsElements});const s=()=>this.scheduleRender();this.addHandles([i((()=>b(this.headingLevel)),(e=>{this._featureForm.headingLevel=e,this._featureTemplates.headingLevel=e}),l),n((()=>this.viewModel.featureTemplatesViewModel),"select",(async({item:e,oldItem:t})=>{this.viewModel.activeWorkflow&&await this.viewModel.cancelWorkflow(),e&&e.id!==t?.id&&(this.useDeprecatedCreateWorkflow?this.startCreateWorkflowAtFeatureCreation(e):this.startCreateFeaturesWorkflowAtFeatureCreation(e))})),i((()=>this.viewModel.selectedTemplateItem),(e=>this._featureTemplates.select(e,!1))),n((()=>this.viewModel.activeWorkflow),"cancel-request",(({controller:e})=>{const{messages:t,messagesCommon:s}=this;this._prompt={title:t.cancelRequestTitle,message:t.cancelRequestWarningMessage,context:"danger",actions:{primary:{label:s.form.yes,action:()=>{e.allow(),this._clearPrompt()}},secondary:{label:s.form.no,action:()=>{e.deny(),this._clearPrompt()}}}}})),i((()=>this.viewModel),(e=>{this._featureForm.viewModel=e?.featureFormViewModel??null,this._attachments.viewModel=e?.attachmentsViewModel??null,this._featureTemplates.viewModel=e?.featureTemplatesViewModel??null,this._spinner.viewModel=e?.spinnerViewModel??null,e.showDiscardPrompt=this._showDiscardWarning}),l),i((()=>this.view),((e,t)=>{const s=`editor-${this.id}-spinner`;t?.ui.remove(this._spinner,s),e?.ui.add(this._spinner,{key:s,position:"manual"})}),l),n((()=>this.viewModel?.sketchViewModel),"create",s),r((()=>this.supportingWidgetDefaults),(e=>{this._featureForm.set(e.featureForm),this._attachments.set(e.attachments),this._featureTemplates.set(e.featureTemplates),this.viewModel.sketchViewModel.set(e.sketch)}),l),r((()=>this._attachments?.error),(e=>this._onAttachmentsError(e))),r((()=>this.viewModel?.failures),(e=>{const{messages:t}=this,[{error:s,retry:o,cancel:a}]=e;this._prompt={title:t.errorWarningTitle,message:T(t.errorWarningMessageTemplate,{errorMessage:s.message}),context:"warning",actions:{primary:{label:t.retry,action:()=>{o(),this._clearPrompt()}},secondary:{label:t.ignore,action:()=>{a(),this._clearPrompt()}}}}})),i((()=>this.viewModel?.state),(e=>{switch(e){case"awaiting-feature-to-update":case"ready":case"disabled":this._filterText="",this._featureTemplates.filterText=""}})),i((()=>[this._attachments?.selectedFile,this._attachments?.submitting]),s),i((()=>this.viewModel.featureFormDisabled),(e=>this._featureForm.disabled=e)),n((()=>this.view),"key-down",(e=>{"Escape"===e.key&&this.viewModel.back()}))])}destroy(){this._attachments.destroy(),this._featureForm.destroy(),this._featureTemplates.destroy(),this._snappingControls.destroy()}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-accordion-item.js"),import("@esri/calcite-components/dist/components/calcite-accordion.js"),import("@esri/calcite-components/dist/components/calcite-button.js"),import("@esri/calcite-components/dist/components/calcite-flow-item.js"),import("@esri/calcite-components/dist/components/calcite-flow-item.js"),import("@esri/calcite-components/dist/components/calcite-flow.js"),import("@esri/calcite-components/dist/components/calcite-icon.js"),import("@esri/calcite-components/dist/components/calcite-list.js"),import("@esri/calcite-components/dist/components/calcite-list-item.js"),import("@esri/calcite-components/dist/components/calcite-scrim.js")])}get _backButtonInfo(){return{appearance:"outline",clickHandler:this._onBack,label:this.messagesCommon.back,type:"secondary"}}get _deleteButtonCommonInfo(){return{appearance:"transparent",kind:"danger",type:"primary"}}get activeWorkflow(){return this.viewModel.activeWorkflow}get allowedWorkflows(){return this.viewModel.allowedWorkflows}set allowedWorkflows(e){this.viewModel.allowedWorkflows=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelOptions(){return this.viewModel.labelOptions}set labelOptions(e){this.viewModel.labelOptions=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get tooltipOptions(){return this.viewModel.tooltipOptions}set tooltipOptions(e){this.viewModel.tooltipOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}castVisibleElements(e){const t={...j,...e,snappingControlsElements:{...j.snappingControlsElements,...e?.snappingControlsElements}};return o(this._snappingControls)&&(this._snappingControls.visibleElements=t.snappingControlsElements),t}startCreateWorkflowAtFeatureTypeSelection(){return f(U,"startCreateWorkflowAtFeatureTypeSelection","startCreateFeaturesWorkflowAtFeatureTypeSelection"),this.viewModel.startCreateWorkflowAtFeatureTypeSelection()}startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.viewModel.startCreateFeaturesWorkflowAtFeatureTypeSelection()}startCreateWorkflowAtFeatureCreation(e){return f(U,"startCreateWorkflowAtFeatureCreation","startCreateFeaturesWorkflowAtFeatureCreation"),this.viewModel.startCreateWorkflowAtFeatureCreation(e)}startCreateFeaturesWorkflowAtFeatureCreation(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureCreation(e)}startCreateWorkflowAtFeatureEdit(e){return f(U,"startCreateWorkflowAtFeatureEdit"),this.viewModel.startCreateWorkflowAtFeatureEdit(e)}startUpdateWorkflowAtFeatureSelection(){return this.viewModel.startUpdateWorkflowAtFeatureSelection()}startUpdateWorkflowAtMultipleFeatureSelection(e){return this.viewModel.startUpdateWorkflowAtMultipleFeatureSelection(e)}startUpdateWorkflowAtFeatureEdit(e){return this.viewModel.startUpdateWorkflowAtFeatureEdit(e)}deleteFeatureFromWorkflow(){return this.viewModel.deleteFeatureFromWorkflow()}cancelWorkflow(e){return this.viewModel.cancelWorkflow(e)}render(){const{viewModel:e}=this;if(!e)return W("div",{class:S.base});const{state:t}=e,s=e.syncing||this._attachments.submitting;return W("div",{class:S.base},s&&this._renderProgressBar(),W("calcite-flow",null,e.pageStack.map((e=>this._renderPage(e,t))),this._renderPage(e.page,t)),this._renderPrompt())}_renderPage(e,t){switch(e){case"disabled":break;case"ready":return this._renderLanding(t);case"awaiting-feature-creation-info":return this._renderTemplates(t);case"creating-features":case"editing-new-feature":case"editing-existing-feature":return this._renderAttributeEditing(t);case"awaiting-update-feature-candidate":return this._renderFeatureList(t);case"adding-attachment":return this._renderAttachmentAdding(t);case"editing-attachment":return this._renderAttachmentEditing(t)}return W("div",null)}_renderTemplates(e){const{EditorPanel:t,headingLevel:s,messages:o,messagesCommon:a,_onBack:i,_snappingControls:n,viewModel:{sketchViewModel:r}}=this;return W(t,{active:this._isPanelActive(e),key:"templates-panel",handleBack:i,heading:o.selectTemplate,headingLevel:s,messages:o,messagesCommon:a,sketchViewModel:r,snappingControls:n},W("div",{class:S.panelContent},this._featureTemplates.render()),this._renderFooterActions([this._backButtonInfo]))}_renderAttributeEditing(e){const{activeWorkflow:t,EditorPanel:s,messages:o,messagesCommon:a,headingLevel:i,_onBack:n,_snappingControls:r,viewModel:l}=this;if(!t)return null;const c=t.type,d=l.featureFormViewModel,p="update"===c&&!t.data.edits.modified||l.syncing||d.updating,m="update"===c?o.editFeature:o.createFeatures,h="update"===c?a.update:a.create,u="create-features"===c&&"create-new"===t.createFeatureState,g="create-features"===c?t.numPendingFeatures:0,_=g>1?T(o.createFeaturesTemplate,{numFeatures:g}):h,w=l.shouldShowAttachments,f=d.inputFields.every((e=>!e.visible))&&!w?this._renderMessage(T(o.clickToFinishTemplate,{button:h})):W("div",{key:"panel-content-section",class:S.panelContentSection},W("div",{class:S.panelContentSectionGroup},this._featureForm.render(),w&&W("div",{key:"attachments"},W(y,{level:b(i)},o.attachments),this._attachments.render())));return W(s,{active:this._isPanelActive(e),key:"attribute-editing-panel",heading:m,headingLevel:i,handleBack:n,messages:o,messagesCommon:a,sketchViewModel:l.sketchViewModel,snappingControls:r},W("div",{key:"panel-content",class:S.panelContent},f,u&&W("calcite-scrim",null)),this._renderFooterActions([this._backButtonInfo,{clickHandler:this._onSave,disabled:p,label:_,type:"primary"},l.shouldShowDeleteButton?{...this._deleteButtonCommonInfo,clickHandler:this._onDelete,disabled:l.syncing,label:a.delete}:null]))}_renderAttachmentAdding(e){const{_attachments:t,EditorPanel:s,_onBack:o,headingLevel:a,messages:i,messagesCommon:n,_snappingControls:r,viewModel:{sketchViewModel:l}}=this;return W(s,{active:this._isPanelActive(e),key:"attachment-adding-panel",heading:i.addAttachment,headingLevel:a,handleBack:o,messages:i,messagesCommon:n,sketchViewModel:l,snappingControls:r},W("div",{class:S.panelContent},t.render()),this._renderFooterActions([{label:t.submitting?n.cancel:n.add,disabled:t.submitting||!t.selectedFile,type:"primary",clickHandler:this._onAttachmentAdd},this._backButtonInfo]))}_renderAttachmentEditing(e){const{_attachments:t,EditorPanel:s,_onBack:o,headingLevel:a,messages:i,messagesCommon:n,_snappingControls:r,viewModel:{sketchViewModel:l}}=this;return W(s,{active:this._isPanelActive(e),key:"attachment-editing-panel",heading:i.editAttachment,headingLevel:a,handleBack:o,messages:i,messagesCommon:n,sketchViewModel:l,snappingControls:r},W("div",{class:S.panelContent},t.render()),this._renderFooterActions([this._backButtonInfo,{label:n.update,disabled:t.submitting||!t.selectedFile,type:"primary",clickHandler:this._onAttachmentUpdate},{...this._deleteButtonCommonInfo,clickHandler:this._onAttachmentDelete,disabled:t.submitting,label:n.delete}]))}_renderMessage(e){return W("div",{key:"panel-content-message",class:S.panelContentMessage},e)}_renderFooterActions(e){return W("div",{key:"footer-actions",slot:"footer",class:S.actions},e.filter(o).map((({type:e,disabled:t,class:s,clickHandler:o,label:a,...i},n)=>W("calcite-button",{key:`action-${n}`,slot:"footer-actions",class:this.classes(s,S.actionButton),disabled:t??!1,onclick:o,width:"full",...i},a))))}_renderPrompt(){const e=this._prompt;if(!e)return null;const{title:t,message:s,context:o,actions:a}=e,i=a.secondary,n=W("calcite-button",{appearance:"solid",kind:"danger"===o?"danger":"brand",width:i?"half":"full",onclick:a.primary.action,key:"prompt-primary-button",afterCreate:P},a.primary.label),r=i&&W("calcite-button",{appearance:"outline",kind:"danger"===o?"danger":"brand",width:"half",onclick:i.action,key:"prompt-secondary-button"},i.label);return W("calcite-scrim",null,W("div",{class:`${S.promptContainer}--${o}`},W("div",{class:S.promptHeader},W("calcite-icon",{icon:"exclamation-mark-triangle"}),W(y,{class:S.promptHeading,level:this.headingLevel},t)),W("div",{class:S.promptMessage},s),W("div",{class:S.promptDivider}),W("div",{class:S.promptActions},r,n)))}_renderProgressBar(){return W("div",{class:this.classes(S.progressBar),key:"progress-bar"})}_renderLanding(e){const{EditorPanel:t,headingLevel:s,messages:o,messagesCommon:a,_snappingControls:i,_featureTemplates:{viewModel:{numberOfFeatureTemplates:n}},viewModel:{canUpdate:r,sketchViewModel:l}}=this,c=!r&&0===n;return W(t,{active:this._isPanelActive(e),key:"landing-panel",heading:o.widgetLabel,headingLevel:s,messages:o,messagesCommon:a,sketchViewModel:l,snappingControls:i},W("div",{class:S.panelContent},r&&W("div",{key:"edit-actions",class:S.panelContentSection},this._renderUpdateActions(e)),n>0&&W("div",{key:"create-actions",class:S.panelContentSection},this._renderCreateActions()),c&&W("div",{key:"no-content",class:S.panelContentMessage},o.noEditableLayers)))}_renderUpdateActions(e){const{messages:t,messagesCommon:s}=this;return W("div",{key:"update-actions"},W(y,{level:b(this.headingLevel)},t.editFeatures),W("calcite-list",{selectionMode:"single",selectionAppearance:"border"},W("calcite-list-item",{selected:"awaiting-feature-to-update"===e,label:s.select,onCalciteListItemSelect:this._onToggleUpdateWorkflow},W("calcite-icon",{icon:"cursor",slot:"content-start"}))))}_renderCreateActions(){const{_featureTemplates:e,headingLevel:t,messages:s}=this;return W("div",{key:"create-actions"},W(y,{level:b(t)},s.createFeatures),W("div",{key:"templates",class:S.featureTemplatesContainer},e.render()))}_renderFeatureList(e){const{EditorPanel:t,_onBack:s,headingLevel:a,messages:i,messagesCommon:n,messagesTemplates:r,_snappingControls:l,viewModel:{activeWorkflow:c,editableItems:d,sketchViewModel:p}}=this;if("update"!==c?.type)return null;const m=c.data.candidates,h=T(i.multipleFeaturesTemplate,{total:m.length}),u=new Map;let g=0;m.map((e=>({label:this._getLabel(e),id:e.attributes[e.layer.objectIdField],data:e}))).filter((e=>{const{label:t,data:s}=e,o=this._filterText.toLowerCase(),{title:a}=s.layer,i=d.find((e=>e.layer===s.layer));if(!i)return null;const{attachmentsOnUpdateEnabled:n,supports:r}=i;return(r.includes("update")||r.includes("delete")||n)&&(!o||t?.toLowerCase().includes(o)||a?.toLowerCase().includes(o))})).filter(o).forEach((e=>{g++;const t=e.data.layer;u.has(t)?u.get(t)?.items.push(e):u.set(t,{id:`${t.id}`,label:t.title??"",items:[e]})}));const _=d.toArray().map((({layer:e})=>u.get(e))).filter(o),w=g>10||this._filterText.length>0;return W(t,{active:this._isPanelActive(e),key:"feature-list",heading:h,headingLevel:a,handleBack:s,messages:i,messagesCommon:n,sketchViewModel:p,snappingControls:l},W("div",{class:S.panelContent},W("div",{class:S.panelContentSection},k({id:this.id,enableListScroll:!1,filterEnabled:w,filterText:this._filterText,items:_,messages:{filterPlaceholder:r.filterPlaceholder,noItems:r.noItems,noMatches:r.noMatches},onItemMouseEnter:e=>this.viewModel.selectFeature(e.data),onItemMouseLeave:()=>this.viewModel.selectFeature(null),onItemSelect:e=>this.viewModel.selectFeature(e.data,!0),onFilterChange:e=>this._filterText=e}))),this._renderFooterActions([this._backButtonInfo]))}_isPanelActive(e){return this.viewModel.state===e}_getLabel(e){const t=e.layer;if(!t)return null;const{objectIdField:s}=t,{attributes:o}=e,a=m(t);return a&&o[a]&&`${o[a]}`||T(this.messages.untitledFeatureTemplate,{id:o[s]})}_onSave(){this.viewModel.save()}_onDelete(){const{messages:e,messagesCommon:t}=this;this._prompt={title:e.deleteWarningTitle,message:e.deleteWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:()=>{this.deleteFeatureFromWorkflow(),this._clearPrompt()}},secondary:{label:e.keepFeature,action:this._clearPrompt}}}}async _onToggleUpdateWorkflow(){const{viewModel:e}=this;e.canUpdate&&(e.activeWorkflow&&"awaiting-feature-to-update"===e.state?await e.cancelWorkflow():await e.startUpdateWorkflowAtFeatureSelection())}async _onBack(e){return e?.stopPropagation(),this.viewModel.back()}_onAttachmentAdd(){const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type?(this._attachments.addFile(),e.previous()):this._attachments.addAttachment().then((()=>e.previous())))}_onAttachmentUpdate(){const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type?(this._attachments.updateFile(),e.previous()):this._attachments.updateAttachment().then((()=>e.previous())))}_onAttachmentDelete(){const{messages:e,messagesCommon:t}=this;this._prompt={title:e.deleteAttachmentWarningTitle,message:e.deleteAttachmentWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:this._onAttachmentDeleteConfirm},secondary:{label:e.keepAttachment,action:this._clearPrompt}}}}};e([c()],$.prototype,"_featureForm",void 0),e([c()],$.prototype,"_attachments",void 0),e([c()],$.prototype,"_featureTemplates",void 0),e([c()],$.prototype,"_filterText",void 0),e([c()],$.prototype,"_prompt",void 0),e([c()],$.prototype,"_snappingControls",void 0),e([c()],$.prototype,"_spinner",void 0),e([c()],$.prototype,"_backButtonInfo",null),e([c()],$.prototype,"_deleteButtonCommonInfo",null),e([c({readOnly:!0})],$.prototype,"activeWorkflow",null),e([c()],$.prototype,"allowedWorkflows",null),e([c()],$.prototype,"useDeprecatedCreateWorkflow",void 0),e([c()],$.prototype,"headingLevel",void 0),e([c()],$.prototype,"iconClass",void 0),e([c()],$.prototype,"label",null),e([c()],$.prototype,"labelOptions",null),e([c()],$.prototype,"layerInfos",null),e([c(),A("esri/widgets/Editor/t9n/Editor")],$.prototype,"messages",void 0),e([c(),A("esri/t9n/common")],$.prototype,"messagesCommon",void 0),e([c(),A("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],$.prototype,"messagesTemplates",void 0),e([c()],$.prototype,"snappingOptions",null),e([c()],$.prototype,"tooltipOptions",null),e([c()],$.prototype,"supportingWidgetDefaults",void 0),e([c()],$.prototype,"view",null),e([c(),F(["workflow-cancel","workflow-commit"])],$.prototype,"viewModel",void 0),e([c()],$.prototype,"visibleElements",void 0),e([d("visibleElements")],$.prototype,"castVisibleElements",null),e([M()],$.prototype,"_onSave",null),e([M()],$.prototype,"_onDelete",null),e([M()],$.prototype,"_onToggleUpdateWorkflow",null),e([M()],$.prototype,"_onBack",null),e([M()],$.prototype,"_onAttachmentAdd",null),e([M()],$.prototype,"_onAttachmentUpdate",null),e([M()],$.prototype,"_onAttachmentDelete",null),$=e([p(I)],$);const D=$;export{D as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../chunks/tslib.es6.js";import{createTask as e}from"../core/asyncUtils.js";import{isSome as s,destroyMaybe as i,isNone as r,applySome as o,abortMaybe as n}from"../core/maybe.js";import{memoize as a}from"../core/memoize.js";import{createAbortError as l}from"../core/promiseUtils.js";import{watch as h,initial as c}from"../core/reactiveUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import u from"./Widget.js";import{CSS as m}from"./ElevationProfile/css.js";import _ from"./ElevationProfile/ElevationProfileViewModel.js";import C from"./ElevationProfile/ElevationProfileVisibleElements.js";import{Legend as v}from"./ElevationProfile/components/Legend.js";import{SettingsButton as g}from"./ElevationProfile/components/SettingsButton.js";import{createChart as f}from"./ElevationProfile/support/chartUtils.js";import{ElevationProfileErrorState as y,getConfig as w,ElevationProfileState as b}from"./ElevationProfile/support/constants.js";import{onResize as k}from"./support/widgetUtils.js";import{messageBundle as S}from"./support/decorators/messageBundle.js";import{tsx as B}from"./support/jsxFactory.js";var M;!function(t){t.Sketch="sketch",t.SketchCancel="sketch-cancel",t.SketchDone="sketch-done",t.Select="select",t.SelectCancel="select-cancel"}(M||(M={}));const P=[{type:M.Select},{type:M.Sketch}],E={[y.None]:null,[y.NoValidInput]:"noProfile",[y.NoVisibleProfiles]:"noProfile",[y.RefinedButNoChartData]:"noProfile",[y.TooComplex]:"tooComplex",[y.UnknownError]:"unknown",[y.InvalidGeometry]:"invalidGeometry",[y.InvalidElevationInfo]:"invalidElevationInfo"};let j=class extends u{constructor(t,e){super(t,e),this.viewModel=null,this.visibleElements=new C,this.iconClass=m.widgetIcon,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this._chartContainer=null,this._chart=null,this._chartInitTask=null,this._chartIsRefined=!1,this._width=0,this._zoomOutButtonVisible=!1,this._getChartUpdateParamsMemoized=a(((t,e,s,i)=>({chart:t,data:e,stationary:s,messages:i}))),this._getDetailsPropsMemoized=a(((t,e)=>({effectiveUnits:t,profiles:e}))),t?.viewModel||(this._defaultViewModel=new _({view:t?.view}),this.viewModel=this._defaultViewModel)}initialize(){this._legend=new v(this._legendProps),this._settingsButton=new g(this._settingsButtonProps),this.addHandles([h((()=>this._legendProps),(t=>this._legend.set(t))),h((()=>this._settingsButtonProps),(t=>this._settingsButton.set(t)))])}postInitialize(){this.addHandles([h((()=>({container:this._chartContainer,width:this._width})),(({container:t,width:e})=>{this._destroyChart(),s(t)&&e>0&&this._initializeChart(t)}),c),h((()=>this._chartUpdateParams),(()=>this._updateChart(this._chartUpdateParams)),c)])}destroy(){this._destroyChart(),s(this._defaultViewModel)&&this.viewModel!==this._defaultViewModel&&this._defaultViewModel.destroy(),this._legend=i(this._legend),this._settingsButton=i(this._settingsButton)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}get input(){return this.viewModel.input}set input(t){this.viewModel.input=t}get profiles(){return this.viewModel.profiles}set profiles(t){this.viewModel.profiles=t}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(t){this.viewModel.unitOptions=t}get unit(){return this.viewModel.unit}set unit(t){this.viewModel.unit=t}get geodesicDistanceThreshold(){return this.viewModel.geodesicDistanceThreshold}set geodesicDistanceThreshold(t){this.viewModel.geodesicDistanceThreshold=t}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get visible(){return this.viewModel.visible}set visible(t){this.viewModel.visible=t}get _portrait(){return this._width<w().portraitModePixelBreakpoint}get _chartUpdateParams(){const t=this.view;return this._getChartUpdateParamsMemoized(this._chart,this.viewModel.chartData,!s(t)||t.stationary,this._chartMessages)}get _chartMessages(){return{...this.messagesUnits,...this.messages}}get _legendProps(){return this._getDetailsPropsMemoized(this.viewModel.effectiveUnits,this._profilesArray)}get _profilesArray(){return this.profiles.toArray()}get _settingsButtonProps(){return{viewModel:this.viewModel,visibleElements:this.visibleElements}}render(){const{viewModel:t,visible:e}=this;return B("div",{key:this,class:this.classes({[m.base]:e,[m.esriWidget]:e,[m.esriWidgetDisabled]:e&&"disabled"===t.state,[m.portrait]:this._portrait,[m.refined]:1===t.progress}),"aria-label":this.messages.widgetLabel,afterCreate:t=>{this.addHandles(k(t,(t=>{this._width=t.contentRect.width})))}},e&&this._renderContentForState())}_renderContentForState(){switch(this.viewModel.state){case b.Ready:return this._renderContentForReadyState();case b.Selecting:return this._renderContentForSelectingState();case b.Creating:return this._renderContentForCreatingState();case b.Selected:return this._renderContentForSelectedState();case b.Created:return this._renderContentForCreatedState();case b.Disabled:return this._renderContentForReadyState()}}_renderContentForReadyState(){const{sketchButton:t,selectButton:e}=this.visibleElements,s=this.messages;let i;return i=t&&e?s.readyPrompt:t?s.readyPromptCreateOnly:e?s.readyPromptSelectOnly:s.errors?.noProfile,this._renderContent({prompt:i,chart:!1,actions:P})}_renderContentForSelectingState(){const t=this.view;if(r(t))return null;const e=this.messages[`selectingPrompt-${t.type}`];return this._renderContent({prompt:e,chart:!1,actions:[{type:M.SelectCancel}]})}_renderContentForCreatingState(){const{view:t,viewModel:e}=this;if(r(t))return null;const s=e.hasVertices?[{type:M.SketchCancel},{type:M.SketchDone,disabled:!e.tool.interaction.canStopCreating}]:[{type:M.Select},{type:M.Sketch,disabled:!0}];if(e.errorState===y.NoValidInput){const e=this.messages[`creatingPrompt-${t.type}`];return this._renderContent({chart:!1,actions:s,prompt:e})}const i=this._getErrorMessage();return i?this._renderContent({chart:!1,actions:s,prompt:i}):this._renderContent({chart:!0,actions:s})}_renderContentForSelectedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:P,prompt:t}):this._renderContent({chart:!0,actions:P})}_renderContentForCreatedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:P,prompt:t}):this._renderContent({chart:!0,actions:P})}_getErrorMessage(){const t=E[this.viewModel.errorState];return t?this.messages?.errors?.[t]:null}_renderContent(t){const e=s(t.prompt)?this._renderPrompt(t.prompt):t.chart&&this._renderChart(),i=s(this.viewModel.input);return[B("header",{key:"header",class:m.header},this._zoomOutButtonVisible&&this._renderZoomOutButton(),this.visibleElements.clearButton&&i&&this._renderClearButton(),this.visibleElements.settingsButton&&this._settingsButton.render()),B("div",{class:m.mainContainer},e),this.visibleElements.legend&&this._legend.render(),this._renderActions(t)]}_renderZoomOutButton(){return B("button",{key:"zoom-out",class:m.zoomOutButton,bind:this,onclick:this._onZoomOutButtonClick,title:this.messages.zoomOut,type:"button"})}_onZoomOutButtonClick(){o(this._chart,(t=>t.zoomOut()))}_renderClearButton(){return B("button",{key:"clear-profile",class:m.clearButton,bind:this,onclick:this._onClearButtonClick,title:this.messages.clearProfile,type:"button"})}_onClearButtonClick(){this.viewModel.clear()}_renderPrompt(t){return[B("div",{key:"prompt-container",bind:this,class:m.promptContainer},B("p",null,t))]}_renderChart(){if(!this.visibleElements.chart)return[B("div",{key:"empty-chart-container",class:m.chartContainer})];const t=this._chartIsRefined||this._canRenderChart();if(!t)return[this._renderSpinner({size:"large"}),B("div",{key:"chart-container-empty",class:m.chartContainer})];const{chartData:e,progress:i}=this.viewModel;return[s(e)&&i>0&&i<1&&this._renderSpinner({size:t?"small":"large"}),B("div",{key:"chart-container",bind:this,class:m.chartContainer,afterCreate:this._onChartContainerAfterCreate,afterRemoved:this._onChartContainerRemoved})]}_renderSpinner(t){return B("div",{key:"spinner",class:this.classes(m.chartSpinner,{[m.chartSpinnerSmall]:"small"===t.size}),afterCreate:this._onSpinnerAfterCreate,exitAnimation:this._onSpinnerExit})}_onSpinnerAfterCreate(t){requestAnimationFrame((()=>t.classList.add(m.chartSpinnerVisible)))}_onSpinnerExit(t,e){t.classList.remove(m.chartSpinnerVisible),setTimeout(e,200)}_canRenderChart(){const t=this.viewModel.chartData;if(r(t))return!1;if(!this.viewModel.inputIsSketched)return t.refined;let e=0;for(const{samples:i}of t.lines)e+=s(i)?i.length:0;return t.refined||e<=w().largeChartSamples}_renderActions({actions:t}){const e=t.map((t=>{switch(t.type){case M.Sketch:return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onSketchButtonClick,className:m.sketchButton,label:this.messages.sketchButtonLabel});case M.SketchCancel:return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:m.sketchCancelButton,label:this.messagesCommon.cancel});case M.SketchDone:return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onDoneButtonClick,className:m.sketchDoneButton,label:this.messagesCommon.done});case M.Select:return this.visibleElements.selectButton&&this._renderAction({action:t,onClick:this._onSelectButtonClick,className:m.selectButton,label:this.messages.selectButtonLabel});case M.SelectCancel:return this.visibleElements.selectButton&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:m.selectCancelButton,label:this.messagesCommon.cancel})}})).filter(Boolean);return e.length?B("footer",{key:"footer",class:m.footer},e):null}_renderAction({action:t,onClick:e,className:s,label:i}){return B("button",{key:`action-${t.type}`,class:this.classes(m.actionButton,s,{[m.buttonDisabled]:!!t.disabled}),bind:this,disabled:t.disabled,onclick:e,type:"button"},i)}_onSketchButtonClick(){this.viewModel.start({mode:"sketch"})}_onSelectButtonClick(){this.viewModel.start({mode:"select"})}_onCancelButtonClick(){this.viewModel.cancel()}_onDoneButtonClick(){this.viewModel.stop()}_updateChart(t){const{data:e,chart:i,messages:o,stationary:n}=t;!r(i)&&!r(o)&&n&&this._canRenderChart()&&(i.update(t),this._chartIsRefined=s(e)&&e.refined)}_onChartContainerAfterCreate(t){this._chartContainer=t}_onChartContainerRemoved(){this._chartContainer=null}_initializeChart(t){n(this._chartInitTask),this._chartInitTask=e((async e=>{const s=await f({container:t,abortOptions:{signal:e},onRangeChange:(t,e)=>{this._zoomOutButtonVisible=1!==t||1!==e},onCursorPositionChange:t=>{this.viewModel.hoveredChartPosition=t}});if(e.aborted)throw i(s),l();this._chart=s,this._updateChart(this._chartUpdateParams)}))}_destroyChart(){this._chartInitTask=n(this._chartInitTask),this._chart=i(this._chart),this._chartIsRefined=!1}get test(){return{projector:this._projector,chart:this._chart}}};t([d({type:_})],j.prototype,"viewModel",void 0),t([d()],j.prototype,"view",null),t([d()],j.prototype,"input",null),t([d()],j.prototype,"profiles",null),t([d()],j.prototype,"unitOptions",null),t([d()],j.prototype,"unit",null),t([d()],j.prototype,"geodesicDistanceThreshold",null),t([d({type:C,nonNullable:!0})],j.prototype,"visibleElements",void 0),t([d()],j.prototype,"iconClass",void 0),t([d()],j.prototype,"label",null),t([d()],j.prototype,"visible",null),t([d(),S("esri/widgets/ElevationProfile/t9n/ElevationProfile")],j.prototype,"messages",void 0),t([d(),S("esri/t9n/common")],j.prototype,"messagesCommon",void 0),t([d(),S("esri/core/t9n/Units")],j.prototype,"messagesUnits",void 0),t([d()],j.prototype,"_chartContainer",void 0),t([d()],j.prototype,"_chart",void 0),t([d()],j.prototype,"_chartInitTask",void 0),t([d()],j.prototype,"_chartIsRefined",void 0),t([d()],j.prototype,"_settingsButton",void 0),t([d()],j.prototype,"_legend",void 0),t([d()],j.prototype,"_width",void 0),t([d()],j.prototype,"_portrait",null),t([d()],j.prototype,"_zoomOutButtonVisible",void 0),t([d()],j.prototype,"_chartUpdateParams",null),t([d()],j.prototype,"_chartMessages",null),t([d()],j.prototype,"_legendProps",null),t([d()],j.prototype,"_profilesArray",null),t([d()],j.prototype,"_settingsButtonProps",null),j=t([p("esri.widgets.ElevationProfile")],j);const I=j;export{I as default};
|
|
5
|
+
import{_ as t}from"../chunks/tslib.es6.js";import{createTask as e}from"../core/asyncUtils.js";import{isSome as s,destroyMaybe as i,isNone as r,applySome as o,abortMaybe as n}from"../core/maybe.js";import{memoize as a}from"../core/memoize.js";import{createAbortError as l}from"../core/promiseUtils.js";import{watch as h,initial as c}from"../core/reactiveUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import u from"./Widget.js";import{CSS as m}from"./ElevationProfile/css.js";import _ from"./ElevationProfile/ElevationProfileViewModel.js";import C from"./ElevationProfile/ElevationProfileVisibleElements.js";import{Legend as v}from"./ElevationProfile/components/Legend.js";import{SettingsButton as g}from"./ElevationProfile/components/SettingsButton.js";import{createChart as f}from"./ElevationProfile/support/chartUtils.js";import{ElevationProfileErrorState as y,getConfig as w,ElevationProfileState as b}from"./ElevationProfile/support/constants.js";import{onResize as k}from"./support/widgetUtils.js";import{messageBundle as S}from"./support/decorators/messageBundle.js";import{tsx as B}from"./support/jsxFactory.js";var M;!function(t){t.Sketch="sketch",t.SketchCancel="sketch-cancel",t.SketchDone="sketch-done",t.Select="select",t.SelectCancel="select-cancel"}(M||(M={}));const P=[{type:M.Select},{type:M.Sketch}],E={[y.None]:null,[y.NoValidInput]:"noProfile",[y.NoVisibleProfiles]:"noProfile",[y.RefinedButNoChartData]:"noProfile",[y.TooComplex]:"tooComplex",[y.UnknownError]:"unknown",[y.InvalidGeometry]:"invalidGeometry",[y.InvalidElevationInfo]:"invalidElevationInfo"},j=Symbol("resize-observer-handle");let z=class extends u{constructor(t,e){super(t,e),this.viewModel=null,this.visibleElements=new C,this.iconClass=m.widgetIcon,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this._chartContainer=null,this._chart=null,this._chartInitTask=null,this._chartIsRefined=!1,this._width=0,this._zoomOutButtonVisible=!1,this._getChartUpdateParamsMemoized=a(((t,e,s,i)=>({chart:t,data:e,stationary:s,messages:i}))),this._getDetailsPropsMemoized=a(((t,e)=>({effectiveUnits:t,profiles:e}))),t?.viewModel||(this._defaultViewModel=new _({view:t?.view}),this.viewModel=this._defaultViewModel)}initialize(){this._legend=new v(this._legendProps),this._settingsButton=new g(this._settingsButtonProps),this.addHandles([h((()=>this._legendProps),(t=>this._legend.set(t))),h((()=>this._settingsButtonProps),(t=>this._settingsButton.set(t)))])}postInitialize(){this.addHandles([h((()=>({container:this._chartContainer,width:this._width})),(({container:t,width:e})=>{this._destroyChart(),s(t)&&e>0&&this._initializeChart(t)}),c),h((()=>this._chartUpdateParams),(()=>this._updateChart(this._chartUpdateParams)),c)])}destroy(){this._destroyChart(),s(this._defaultViewModel)&&this.viewModel!==this._defaultViewModel&&this._defaultViewModel.destroy(),this._legend=i(this._legend),this._settingsButton=i(this._settingsButton)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}get input(){return this.viewModel.input}set input(t){this.viewModel.input=t}get profiles(){return this.viewModel.profiles}set profiles(t){this.viewModel.profiles=t}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(t){this.viewModel.unitOptions=t}get unit(){return this.viewModel.unit}set unit(t){this.viewModel.unit=t}get geodesicDistanceThreshold(){return this.viewModel.geodesicDistanceThreshold}set geodesicDistanceThreshold(t){this.viewModel.geodesicDistanceThreshold=t}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get visible(){return this.viewModel.visible}set visible(t){this.viewModel.visible=t}get _portrait(){return this._width<w().portraitModePixelBreakpoint}get _chartUpdateParams(){const t=this.view;return this._getChartUpdateParamsMemoized(this._chart,this.viewModel.chartData,!s(t)||t.stationary,this._chartMessages)}get _chartMessages(){return{...this.messagesUnits,...this.messages}}get _legendProps(){return this._getDetailsPropsMemoized(this.viewModel.effectiveUnits,this._profilesArray)}get _profilesArray(){return this.profiles.toArray()}get _settingsButtonProps(){return{viewModel:this.viewModel,visibleElements:this.visibleElements}}render(){const{viewModel:t,visible:e}=this;return B("div",{key:this,class:this.classes({[m.base]:e,[m.esriWidget]:e,[m.esriWidgetDisabled]:e&&"disabled"===t.state,[m.portrait]:this._portrait,[m.refined]:1===t.progress}),"aria-label":this.messages.widgetLabel},B("div",{key:"content-wrapper",bind:this,afterCreate:this._onContentWrapperAfterCreate,afterRemoved:this._onContentWrapperRemoved},e&&this._renderContentForState()))}_renderContentForState(){switch(this.viewModel.state){case b.Ready:return this._renderContentForReadyState();case b.Selecting:return this._renderContentForSelectingState();case b.Creating:return this._renderContentForCreatingState();case b.Selected:return this._renderContentForSelectedState();case b.Created:return this._renderContentForCreatedState();case b.Disabled:return this._renderContentForReadyState()}}_renderContentForReadyState(){const{sketchButton:t,selectButton:e}=this.visibleElements,s=this.messages;let i;return i=t&&e?s.readyPrompt:t?s.readyPromptCreateOnly:e?s.readyPromptSelectOnly:s.errors?.noProfile,this._renderContent({prompt:i,chart:!1,actions:P})}_renderContentForSelectingState(){const t=this.view;if(r(t))return null;const e=this.messages[`selectingPrompt-${t.type}`];return this._renderContent({prompt:e,chart:!1,actions:[{type:M.SelectCancel}]})}_renderContentForCreatingState(){const{view:t,viewModel:e}=this;if(r(t))return null;const s=e.hasVertices?[{type:M.SketchCancel},{type:M.SketchDone,disabled:!e.tool.interaction.canStopCreating}]:[{type:M.Select},{type:M.Sketch,disabled:!0}];if(e.errorState===y.NoValidInput){const e=this.messages[`creatingPrompt-${t.type}`];return this._renderContent({chart:!1,actions:s,prompt:e})}const i=this._getErrorMessage();return i?this._renderContent({chart:!1,actions:s,prompt:i}):this._renderContent({chart:!0,actions:s})}_renderContentForSelectedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:P,prompt:t}):this._renderContent({chart:!0,actions:P})}_renderContentForCreatedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:P,prompt:t}):this._renderContent({chart:!0,actions:P})}_getErrorMessage(){const t=E[this.viewModel.errorState];return t?this.messages?.errors?.[t]:null}_renderContent(t){const e=s(t.prompt)?this._renderPrompt(t.prompt):t.chart&&this._renderChart(),i=s(this.viewModel.input);return[B("header",{key:"header",class:m.header},this._zoomOutButtonVisible&&this._renderZoomOutButton(),this.visibleElements.clearButton&&i&&this._renderClearButton(),this.visibleElements.settingsButton&&this._settingsButton.render()),B("div",{class:m.mainContainer},e),this.visibleElements.legend&&this._legend.render(),this._renderActions(t)]}_renderZoomOutButton(){return B("button",{key:"zoom-out",class:m.zoomOutButton,bind:this,onclick:this._onZoomOutButtonClick,title:this.messages.zoomOut,type:"button"})}_onZoomOutButtonClick(){o(this._chart,(t=>t.zoomOut()))}_renderClearButton(){return B("button",{key:"clear-profile",class:m.clearButton,bind:this,onclick:this._onClearButtonClick,title:this.messages.clearProfile,type:"button"})}_onClearButtonClick(){this.viewModel.clear()}_renderPrompt(t){return[B("div",{key:"prompt-container",bind:this,class:m.promptContainer},B("p",null,t))]}_renderChart(){if(!this.visibleElements.chart)return[B("div",{key:"empty-chart-container",class:m.chartContainer})];const t=this._chartIsRefined||this._canRenderChart();if(!t)return[this._renderSpinner({size:"large"}),B("div",{key:"chart-container-empty",class:m.chartContainer})];const{chartData:e,progress:i}=this.viewModel;return[s(e)&&i>0&&i<1&&this._renderSpinner({size:t?"small":"large"}),B("div",{key:"chart-container",bind:this,class:m.chartContainer,afterCreate:this._onChartContainerAfterCreate,afterRemoved:this._onChartContainerRemoved})]}_renderSpinner(t){return B("div",{key:"spinner",class:this.classes(m.chartSpinner,{[m.chartSpinnerSmall]:"small"===t.size}),afterCreate:this._onSpinnerAfterCreate,exitAnimation:this._onSpinnerExit})}_onSpinnerAfterCreate(t){requestAnimationFrame((()=>t.classList.add(m.chartSpinnerVisible)))}_onSpinnerExit(t,e){t.classList.remove(m.chartSpinnerVisible),setTimeout(e,200)}_canRenderChart(){const t=this.viewModel.chartData;if(r(t))return!1;if(!this.viewModel.inputIsSketched)return t.refined;let e=0;for(const{samples:i}of t.lines)e+=s(i)?i.length:0;return t.refined||e<=w().largeChartSamples}_renderActions({actions:t}){const e=t.map((t=>{switch(t.type){case M.Sketch:return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onSketchButtonClick,className:m.sketchButton,label:this.messages.sketchButtonLabel});case M.SketchCancel:return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:m.sketchCancelButton,label:this.messagesCommon.cancel});case M.SketchDone:return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onDoneButtonClick,className:m.sketchDoneButton,label:this.messagesCommon.done});case M.Select:return this.visibleElements.selectButton&&this._renderAction({action:t,onClick:this._onSelectButtonClick,className:m.selectButton,label:this.messages.selectButtonLabel});case M.SelectCancel:return this.visibleElements.selectButton&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:m.selectCancelButton,label:this.messagesCommon.cancel})}})).filter(Boolean);return e.length?B("footer",{key:"footer",class:m.footer},e):null}_renderAction({action:t,onClick:e,className:s,label:i}){return B("button",{key:`action-${t.type}`,class:this.classes(m.actionButton,s,{[m.buttonDisabled]:!!t.disabled}),bind:this,disabled:t.disabled,onclick:e,type:"button"},i)}_onSketchButtonClick(){this.viewModel.start({mode:"sketch"})}_onSelectButtonClick(){this.viewModel.start({mode:"select"})}_onCancelButtonClick(){this.viewModel.cancel()}_onDoneButtonClick(){this.viewModel.stop()}_onContentWrapperAfterCreate(t){const e=k(t,(t=>{this._width=t.contentRect.width}));this.addHandles(e,j)}_onContentWrapperRemoved(){this.removeHandles(j)}_updateChart(t){const{data:e,chart:i,messages:o,stationary:n}=t;!r(i)&&!r(o)&&n&&this._canRenderChart()&&(i.update(t),this._chartIsRefined=s(e)&&e.refined)}_onChartContainerAfterCreate(t){this._chartContainer=t}_onChartContainerRemoved(){this._chartContainer=null}_initializeChart(t){n(this._chartInitTask),this._chartInitTask=e((async e=>{const s=await f({container:t,abortOptions:{signal:e},onRangeChange:(t,e)=>{this._zoomOutButtonVisible=1!==t||1!==e},onCursorPositionChange:t=>{this.viewModel.hoveredChartPosition=t}});if(e.aborted)throw i(s),l();this._chart=s,this._updateChart(this._chartUpdateParams)}))}_destroyChart(){this._chartInitTask=n(this._chartInitTask),this._chart=i(this._chart),this._chartIsRefined=!1}get test(){return{projector:this._projector,chart:this._chart}}};t([d({type:_})],z.prototype,"viewModel",void 0),t([d()],z.prototype,"view",null),t([d()],z.prototype,"input",null),t([d()],z.prototype,"profiles",null),t([d()],z.prototype,"unitOptions",null),t([d()],z.prototype,"unit",null),t([d()],z.prototype,"geodesicDistanceThreshold",null),t([d({type:C,nonNullable:!0})],z.prototype,"visibleElements",void 0),t([d()],z.prototype,"iconClass",void 0),t([d()],z.prototype,"label",null),t([d()],z.prototype,"visible",null),t([d(),S("esri/widgets/ElevationProfile/t9n/ElevationProfile")],z.prototype,"messages",void 0),t([d(),S("esri/t9n/common")],z.prototype,"messagesCommon",void 0),t([d(),S("esri/core/t9n/Units")],z.prototype,"messagesUnits",void 0),t([d()],z.prototype,"_chartContainer",void 0),t([d()],z.prototype,"_chart",void 0),t([d()],z.prototype,"_chartInitTask",void 0),t([d()],z.prototype,"_chartIsRefined",void 0),t([d()],z.prototype,"_settingsButton",void 0),t([d()],z.prototype,"_legend",void 0),t([d()],z.prototype,"_width",void 0),t([d()],z.prototype,"_portrait",null),t([d()],z.prototype,"_zoomOutButtonVisible",void 0),t([d()],z.prototype,"_chartUpdateParams",null),t([d()],z.prototype,"_chartMessages",null),t([d()],z.prototype,"_legendProps",null),t([d()],z.prototype,"_profilesArray",null),t([d()],z.prototype,"_settingsButtonProps",null),z=t([p("esri.widgets.ElevationProfile")],z);const I=z;export{I as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7476],{28659:(e,t,r)=>{r.d(t,{B:()=>f});var i=r(81153),s=r(17452),o=r(41123),n=r(7628),a=r(31263),l=r(5600);function p(e){return d[function(e){return e instanceof Blob?e.type:function(e){const t=(0,s.Ml)(e);return y[t]||c}(e.url)}(e)]||u}const d={},c="text/plain",u=d[c],y={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const e in y)d[y[e]]=e;var h=r(25929);function f(e){const t=e?.origins??[void 0];return(r,o)=>{const d=function(e,t,r){if("resource"===e?.type)return function(e,t,r){const o=(0,n.Oe)(t,r);return{type:String,read:(e,t,r)=>{const i=(0,h.r)(e,t,r);return o.type===String?i:"function"==typeof o.type?new o.type({url:i}):void 0},write:{writer(t,n,l,d){if(!d||!d.resources)return"string"==typeof t?void(n[l]=(0,h.t)(t,d)):void(n[l]=t.write({},d));const c=function(e){return null==e?null:"string"==typeof e?e:e.url}(t),u=(0,h.t)(c,{...d,verifyItemRelativeUrls:d&&d.verifyItemRelativeUrls?{writtenUrls:d.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},h.M.NO),y=o.type!==String&&(!(0,i.l)(this)||d&&d.origin&&this.originIdOf(r)>(0,a.M9)(d.origin)),f={object:this,propertyName:r,value:t,targetUrl:u,dest:n,targetPropertyName:l,context:d,params:e};d&&d.portalItem&&u&&!(0,s.YP)(u)?y?function(e){const{context:t,targetUrl:r,params:i,value:o,dest:n,targetPropertyName:a}=e;if(!t.portalItem)return;const l=t.portalItem.resourceFromPath(r),d=b(o,r,t),c=p(d),u=(0,s.Ml)(l.path),y=i?.compress??!1;c===u?(t.resources&&m({...e,resource:l,content:d,compress:y,updates:t.resources.toUpdate}),n[a]=r):g(e)}(f):function({context:e,targetUrl:t,dest:r,targetPropertyName:i}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(t),compress:!1}),r[i]=t)}(f):d&&d.portalItem&&(null==u||null!=(0,h.i)(u)||(0,s.jc)(u)||y)?g(f):n[l]=u}}}}(e,t,r);switch(e?.type??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:e,write:t}=h.a;return{read:e,write:t}}}}(e,r,o);for(const e of t){const t=(0,l.CJ)(r,e,o);for(const e in d)t[e]=d[e]}}}function g(e){const{targetUrl:t,params:i,value:n,context:a,dest:l,targetPropertyName:d}=e;if(!a.portalItem)return;const c=(0,h.p)(t),u=c?.filename??(0,o.D)(),y=i?.prefix??c?.prefix,f=b(n,t,a),g=(0,s.v_)(y,u),v=`${g}.${p(f)}`,w=a.portalItem.resourceFromPath(v);(0,s.jc)(t)&&a.resources&&a.resources.pendingOperations.push(async function(e){const t=(await Promise.resolve().then(r.bind(r,3172))).default,{data:i}=await t(e,{responseType:"blob"});return i}(t).then((e=>{w.path=`${g}.${p(e)}`,l[d]=w.itemRelativeUrl})).catch((()=>{})));const I=i?.compress??!1;a.resources&&m({...e,resource:w,content:f,compress:I,updates:a.resources.toAdd}),l[d]=w.itemRelativeUrl}function m({object:e,propertyName:t,updates:r,resource:i,content:s,compress:o}){r.push({resource:i,content:s,compress:o,finish:r=>{!function(e,t,r){"string"==typeof e[t]?e[t]=r.url:e[t].url=r.url}(e,t,r)}})}function b(e,t,r){return"string"==typeof e?{url:t}:new Blob([JSON.stringify(e.toJSON(r))],{type:"application/json"})}},57476:(e,t,r)=>{r.r(t),r.d(t,{default:()=>he});var i=r(43697),s=r(38171),o=r(51773),n=(r(16050),r(12501),r(28756),r(92271),r(72529),r(5499),r(84382),r(81571),r(91423),r(32400)),a=r(3172),l=r(46791),p=r(20102),d=r(92604),c=r(70586),u=r(16453),y=r(95330),h=r(17445),f=r(17452),g=r(5600),m=(r(75215),r(67676),r(1153)),b=r(71715),v=r(52011),w=r(31263),I=r(87085),_=r(54295),C=r(17287),L=r(66361),S=r(38009),F=r(16859),j=r(72965),x=r(32271),O=r(15506),P=r(21506),R=r(61960),E=r(85857),T=r(14147),N=r(53518),A=r(99514),Z=r(35671),D=r(51161),U=r(54306),q=r(30707),Q=r(56765),k=r(96674);let G=class extends k.wq{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};(0,i._)([(0,g.Cb)({type:String,json:{read:!0,write:!0}})],G.prototype,"name",void 0),(0,i._)([(0,g.Cb)({type:String,json:{read:!0,write:!0}})],G.prototype,"field",void 0),(0,i._)([(0,g.Cb)({type:[Number],json:{read:!0,write:!0}})],G.prototype,"currentRangeExtent",void 0),(0,i._)([(0,g.Cb)({type:[Number],json:{read:!0,write:!0}})],G.prototype,"fullRangeExtent",void 0),(0,i._)([(0,g.Cb)({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],G.prototype,"type",void 0),G=(0,i._)([(0,v.j)("esri.layers.support.RangeInfo")],G);var V,J=r(61247),W=r(22974),M=r(28659),z=r(20941),$=(r(80442),r(38913)),K=r(44547);let B=V=class extends((0,k.eC)(l.Z.ofType($.Z))){constructor(e){super(e)}clone(){return new V(this.items.map((e=>e.clone())))}write(e,t){return this.toJSON(t)}toJSON(e){const t=e?.layer?.spatialReference;return t?this.toArray().map((r=>{if(!t.equals(r.spatialReference)){if(!(0,K.Up)(r.spatialReference,t))return e&&e.messages&&e.messages.push(new z.Z("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const i=new $.Z;(0,K.Wt)(r,i,t),r=i}const i=r.toJSON(e);return delete i.spatialReference,i})).filter((e=>null!=e)):(e?.messages&&e.messages.push(new z.Z("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map((t=>t.toJSON(e))))}static fromJSON(e,t){const r=new V;return e.forEach((e=>r.add($.Z.fromJSON(e,t)))),r}};B=V=(0,i._)([(0,v.j)("esri.layers.support.PolygonCollection")],B);const Y=B;var H,X=r(25929);let ee=H=class extends k.wq{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new Y,this._geometriesSource=null,this._handles=new J.Z}initialize(){this._handles.add((0,h.on)((()=>this.geometries),"after-changes",(()=>this.geometries=this.geometries),h.Z_))}destroy(){this._handles.destroy()}readGeometries(e,t,r){this._geometriesSource={url:(0,X.f)(e,r),context:r}}async loadGeometries(e,t){if((0,c.Wi)(this._geometriesSource))return;const{url:r,context:i}=this._geometriesSource,s=await(0,a.default)(r,{responseType:"json",signal:(0,c.U2)(t,"signal")}),o=e.toJSON(),n=s.data.map((e=>({...e,spatialReference:o})));this.geometries=Y.fromJSON(n,i),this._geometriesSource=null}clone(){return new H({geometries:(0,W.d9)(this.geometries),spatialRelationship:this.spatialRelationship})}};(0,i._)([(0,g.Cb)({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],ee.prototype,"spatialRelationship",void 0),(0,i._)([(0,g.Cb)({type:Y,nonNullable:!0,json:{write:!0}}),(0,M.B)({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries"})],ee.prototype,"geometries",void 0),(0,i._)([(0,b.r)(["web-scene","portal-item"],"geometries")],ee.prototype,"readGeometries",null),ee=H=(0,i._)([(0,v.j)("esri.layers.support.SceneFilter")],ee);const te=ee;var re=r(40555),ie=r(14165),se=r(72245),oe=r(32163),ne=r(77397),ae=r(19833),le=r(65242);const pe=["3DObject","Point"],de=(0,N.v)();let ce=class extends((0,L.o1)((0,x.Vt)((0,C.Y)((0,S.q)((0,F.I)((0,j.M)((0,u.R)((0,_.V)(I.Z))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new l.Z,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&"inherited"!==r.type?r:this.getField(e)?.domain??null}getFeatureType(e){return null!=e&&(0,c.pC)(this.associatedLayer)?this.associatedLayer.getFeatureType(e):null}get types(){return(0,c.pC)(this.associatedLayer)?this.associatedLayer.types??[]:[]}get typeIdField(){return(0,c.pC)(this.associatedLayer)?this.associatedLayer.typeIdField:null}get formTemplate(){return(0,c.pC)(this.associatedLayer)?this.associatedLayer.formTemplate:null}get fieldsIndex(){return new A.Z(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:D.U4.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get geometryType(){return ye[this.profile]||"mesh"}set renderer(e){(0,Z.YN)(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){const e=(0,c.pC)(this.associatedLayer)&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:O.C,{query:t,editing:{supportsGlobalId:r,supportsRollbackOnFailure:i,supportsUploadWithItemId:s,supportsGeometryUpdate:o,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:a,supportsM:l,isVersioned:p,supportsAttachment:d},operations:{supportsEditing:u,supportsAdd:y,supportsUpdate:h,supportsDelete:f,supportsQuery:g,supportsQueryAttachments:m}}=e,b=e.operations.supportsChangeTracking,v=(0,c.pC)(this.associatedLayer)&&(0,c.pC)(this.associatedLayer.infoFor3D)&&(0,se.Rx)();return{query:t,editing:{supportsGlobalId:r,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:i,supportsGeometryUpdate:v&&o,supportsUploadWithItemId:s},data:{supportsAttachment:d,supportsZ:a,supportsM:l,isVersioned:p},operations:{supportsQuery:g,supportsQueryAttachments:m,supportsEditing:u&&b,supportsAdd:v&&y&&b,supportsDelete:v&&f&&b,supportsUpdate:h&&b}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return(0,c.pC)(this.associatedLayer)?this.associatedLayer.infoFor3D:null}get defaultPopupTemplate(){return(0,c.pC)(this.associatedLayer)||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e))),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e))),e||void 0}get displayField(){return(0,c.pC)(this.associatedLayer)?this.associatedLayer.displayField:null}readProfile(e,t){const r=t.store.profile;return null!=r&&ue[r]?ue[r]:(d.Z.getLogger(this.declaredClass).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}load(e){const t=(0,c.pC)(e)?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(y.r9).then((()=>this._fetchService(t))).then((()=>Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),(0,c.pC)(this.filter)?this.filter.loadGeometries(this.spatialReference):null]))).then((()=>this._validateElevationInfo())).then((()=>this._applyAssociatedLayerOverrides())).then((()=>this._populateFieldUsageInfo())).then((()=>(0,re.y)(this,{origin:"service"},t))).then((()=>(0,Z.YN)(this.renderer,this.fieldsIndex))).then((()=>this.finishLoadEditablePortalLayer(e)));return this.addResolvingPromise(r),Promise.resolve(this)}async beforeSave(){(0,c.pC)(this.filter)&&await this.load()}createQuery(){const e=new ie.Z;return"mesh"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e}))}async queryCachedAttributes(e,t){const r=(0,Z.Lk)(this.fieldsIndex,await(0,ae.e)(this,(0,ae.V)(this)));return(0,ne.xe)(this.parsedUrl.path,this.attributeStorageInfo??[],e,t,r)}async queryCachedFeature(e,t){const r=await this.queryCachedAttributes(e,[t]);if(!r||0===r.length)throw new p.Z("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const i=new s.Z;return i.attributes=r[0],i.layer=this,i.sourceLayer=this,i}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryObjectIds(e||this.createQuery(),t)))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryAttachments(e,t)))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(d.Z.getLogger(this.declaredClass).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return(0,oe.eZ)(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return(0,c.pC)(e)&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),(0,c.Wi)(this.associatedLayer))throw new p.Z("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new p.Z("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some((t=>t.name===e))}async queryCachedStatistics(e,t){if(await this.load(t),!this.statisticsInfo)throw new p.Z("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const r=this.fieldsIndex.get(e);if(!r)throw new p.Z("scenelayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const e of this.statisticsInfo)if(e.name===r.name){const r=(0,f.v_)(this.parsedUrl.path,e.href);return(0,a.default)(r,{query:{f:"json",token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then((e=>e.data))}throw new p.Z("scenelayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(x.xp.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(x.xp.SAVE,e)}async applyEdits(e,t){const i=await r.e(7541).then(r.bind(r,87269));if(await this.load(),(0,c.Wi)(this.associatedLayer))throw new p.Z(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),i.applyEdits(this,this.associatedLayer.source,e,t)}on(e,t){return super.on(e,t)}validateLayer(e){if(e.layerType&&!pe.includes(e.layerType))throw new p.Z("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new p.Z("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new p.Z("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});!function(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new p.Z("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new p.Z("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new p.Z("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!(!this.attributeStorageInfo||!this.attributeStorageInfo.some((t=>t.name===e.name))),r=!!((0,c.pC)(this.associatedLayer)&&this.associatedLayer.fields&&this.associatedLayer.fields.some((t=>t&&e.name===t.name))),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides()}_applyAssociatedLayerFieldsOverrides(){if((0,c.Wi)(this.associatedLayer)||!this.associatedLayer.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if((0,c.Wi)(this.associatedLayer))return;const e=["popupTemplate","popupEnabled"],t=(0,m.vw)(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(o===w.s3.SERVICE||o===w.s3.PORTAL_ITEM)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}async _setAssociatedFeatureLayer(e){if(!["mesh-pyramids","points"].includes(this.profile))return;const t=new T.W(this.parsedUrl,this.portalItem,this.apiKey,e);try{this.associatedLayer=await t.fetch()}catch(e){(0,y.D_)(e)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){await(0,h.N1)((()=>this.popupEnabled&&null!=this.popupTemplate));const e=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?d.Z.getLogger(this.declaredClass).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):d.Z.getLogger(this.declaredClass).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;e&&("mesh-pyramids"===this.profile&&"relative-to-scene"===e.mode&&d.Z.getLogger(this.declaredClass).warn(".elevationInfo=","Mesh scene layers don't support relative-to-scene elevation mode"),e.featureExpressionInfo&&"0"!==e.featureExpressionInfo.expression&&d.Z.getLogger(this.declaredClass).warn(".elevationInfo=","Scene layers do not support featureExpressionInfo"))}};(0,i._)([(0,g.Cb)({types:{key:"type",base:R.B,typeMap:{selection:E.Z}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],ce.prototype,"featureReduction",void 0),(0,i._)([(0,g.Cb)({type:[G],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],ce.prototype,"rangeInfos",void 0),(0,i._)([(0,g.Cb)({json:{read:!1}})],ce.prototype,"associatedLayer",void 0),(0,i._)([(0,g.Cb)({type:["show","hide"]})],ce.prototype,"listMode",void 0),(0,i._)([(0,g.Cb)({type:["ArcGISSceneServiceLayer"]})],ce.prototype,"operationalLayerType",void 0),(0,i._)([(0,g.Cb)({json:{read:!1},readOnly:!0})],ce.prototype,"type",void 0),(0,i._)([(0,g.Cb)({...de.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],ce.prototype,"fields",void 0),(0,i._)([(0,g.Cb)()],ce.prototype,"types",null),(0,i._)([(0,g.Cb)()],ce.prototype,"typeIdField",null),(0,i._)([(0,g.Cb)()],ce.prototype,"formTemplate",null),(0,i._)([(0,g.Cb)({readOnly:!0})],ce.prototype,"fieldsIndex",null),(0,i._)([(0,g.Cb)({type:Q.Z,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],ce.prototype,"floorInfo",void 0),(0,i._)([(0,g.Cb)(de.outFields)],ce.prototype,"outFields",void 0),(0,i._)([(0,g.Cb)({type:D.U4,readOnly:!0,json:{read:!1}})],ce.prototype,"nodePages",void 0),(0,i._)([(0,b.r)("service","nodePages",["nodePages","pointNodePages"])],ce.prototype,"readNodePages",null),(0,i._)([(0,g.Cb)({type:[D.QI],readOnly:!0})],ce.prototype,"materialDefinitions",void 0),(0,i._)([(0,g.Cb)({type:[D.Yh],readOnly:!0})],ce.prototype,"textureSetDefinitions",void 0),(0,i._)([(0,g.Cb)({type:[D.H3],readOnly:!0})],ce.prototype,"geometryDefinitions",void 0),(0,i._)([(0,g.Cb)({readOnly:!0})],ce.prototype,"serviceUpdateTimeStamp",void 0),(0,i._)([(0,g.Cb)({readOnly:!0})],ce.prototype,"attributeStorageInfo",void 0),(0,i._)([(0,g.Cb)({readOnly:!0})],ce.prototype,"statisticsInfo",void 0),(0,i._)([(0,g.Cb)({type:l.Z.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],ce.prototype,"excludeObjectIds",void 0),(0,i._)([(0,g.Cb)({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],ce.prototype,"definitionExpression",void 0),(0,i._)([(0,g.Cb)({type:te,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],ce.prototype,"filter",void 0),(0,i._)([(0,g.Cb)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],ce.prototype,"path",void 0),(0,i._)([(0,g.Cb)(P.PV)],ce.prototype,"elevationInfo",null),(0,i._)([(0,g.Cb)({type:String})],ce.prototype,"geometryType",null),(0,i._)([(0,g.Cb)(P.iR)],ce.prototype,"labelsVisible",void 0),(0,i._)([(0,g.Cb)({type:[U.Z],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:q.r},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:q.r},write:!0}})],ce.prototype,"labelingInfo",void 0),(0,i._)([(0,g.Cb)(P.rn)],ce.prototype,"legendEnabled",void 0),(0,i._)([(0,g.Cb)({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?(0,le.b)(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],ce.prototype,"opacity",void 0),(0,i._)([(0,g.Cb)({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],ce.prototype,"priority",void 0),(0,i._)([(0,g.Cb)({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],ce.prototype,"semantic",void 0),(0,i._)([(0,g.Cb)({types:n.o,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],ce.prototype,"renderer",null),(0,i._)([(0,g.Cb)({json:{read:!1}})],ce.prototype,"cachedDrawingInfo",void 0),(0,i._)([(0,b.r)("service","cachedDrawingInfo")],ce.prototype,"readCachedDrawingInfo",null),(0,i._)([(0,g.Cb)({readOnly:!0,json:{read:!1}})],ce.prototype,"capabilities",null),(0,i._)([(0,g.Cb)({type:Boolean,json:{read:!1}})],ce.prototype,"editingEnabled",null),(0,i._)([(0,g.Cb)({readOnly:!0,json:{write:!1,read:!1}})],ce.prototype,"infoFor3D",null),(0,i._)([(0,g.Cb)(P.C_)],ce.prototype,"popupEnabled",void 0),(0,i._)([(0,g.Cb)({type:o.Z,json:{name:"popupInfo",write:!0}})],ce.prototype,"popupTemplate",void 0),(0,i._)([(0,g.Cb)({readOnly:!0,json:{read:!1}})],ce.prototype,"defaultPopupTemplate",null),(0,i._)([(0,g.Cb)({type:String,json:{read:!1}})],ce.prototype,"objectIdField",void 0),(0,i._)([(0,b.r)("service","objectIdField",["objectIdField","fields"])],ce.prototype,"readObjectIdField",null),(0,i._)([(0,g.Cb)({type:String,json:{read:!1}})],ce.prototype,"globalIdField",void 0),(0,i._)([(0,b.r)("service","globalIdField",["globalIdField","fields"])],ce.prototype,"readGlobalIdField",null),(0,i._)([(0,g.Cb)({readOnly:!0,type:String,json:{read:!1}})],ce.prototype,"displayField",null),(0,i._)([(0,g.Cb)({type:String,json:{read:!1}})],ce.prototype,"profile",void 0),(0,i._)([(0,b.r)("service","profile",["store.profile"])],ce.prototype,"readProfile",null),(0,i._)([(0,g.Cb)({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],ce.prototype,"normalReferenceFrame",void 0),(0,i._)([(0,g.Cb)(P.YI)],ce.prototype,"screenSizePerspectiveEnabled",void 0),ce=(0,i._)([(0,v.j)("esri.layers.SceneLayer")],ce);const ue={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},ye={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"},he=ce}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5464,7873],{92835:(e,t,r)=>{r.d(t,{Z:()=>m});var i,s=r(43697),n=r(96674),o=r(70586),a=r(35463),l=r(5600),c=(r(75215),r(67676),r(71715)),u=r(52011),p=r(30556);let h=i=class extends n.wq{static get allTime(){return d}static get empty(){return y}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?e.getTime():null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?e.getTime():null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=(0,o.pC)(this.start)?this.start.getTime():this.start,r=(0,o.pC)(this.end)?this.end.getTime():this.end,i=(0,o.pC)(e.start)?e.start.getTime():e.start,s=(0,o.pC)(e.end)?e.end.getTime():e.end;return t===i&&r===s}expandTo(e){if(this.isEmpty||this.isAllTime)return this.clone();const t=(0,o.yw)(this.start,(t=>(0,a.JE)(t,e))),r=(0,o.yw)(this.end,(t=>{const r=(0,a.JE)(t,e);return t.getTime()===r.getTime()?r:(0,a.Nm)(r,1,e)}));return new i({start:t,end:r})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return i.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=(0,o.R2)(this.start,-1/0,(e=>e.getTime())),r=(0,o.R2)(this.end,1/0,(e=>e.getTime())),s=(0,o.R2)(e.start,-1/0,(e=>e.getTime())),n=(0,o.R2)(e.end,1/0,(e=>e.getTime()));let a,l;if(s>=t&&s<=r?a=s:t>=s&&t<=n&&(a=t),r>=s&&r<=n?l=r:n>=t&&n<=r&&(l=n),null!=a&&null!=l&&!isNaN(a)&&!isNaN(l)){const e=new i;return e.start=a===-1/0?null:new Date(a),e.end=l===1/0?null:new Date(l),e}return i.empty}offset(e,t){if(this.isEmpty||this.isAllTime)return this.clone();const r=new i,{start:s,end:n}=this;return(0,o.pC)(s)&&(r.start=(0,a.Nm)(s,e,t)),(0,o.pC)(n)&&(r.end=(0,a.Nm)(n,e,t)),r}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return d.clone();const t=(0,o.pC)(this.start)&&(0,o.pC)(e.start)?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=(0,o.pC)(this.end)&&(0,o.pC)(e.end)?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:r})}};(0,s._)([(0,l.Cb)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"end",void 0),(0,s._)([(0,c.r)("end")],h.prototype,"readEnd",null),(0,s._)([(0,p.c)("end")],h.prototype,"writeEnd",null),(0,s._)([(0,l.Cb)({readOnly:!0,json:{read:!1}})],h.prototype,"isAllTime",null),(0,s._)([(0,l.Cb)({readOnly:!0,json:{read:!1}})],h.prototype,"isEmpty",null),(0,s._)([(0,l.Cb)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"start",void 0),(0,s._)([(0,c.r)("start")],h.prototype,"readStart",null),(0,s._)([(0,p.c)("start")],h.prototype,"writeStart",null),h=i=(0,s._)([(0,u.j)("esri.TimeExtent")],h);const d=new h,y=new h({start:void 0,end:void 0}),m=h},46521:(e,t,r)=>{function i(){return[1,0,0,0,1,0,0,0,1]}function s(e,t){return new Float64Array(e,t,9)}r.d(t,{a:()=>s,c:()=>i}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},create:i,createView:s,fromValues:function(e,t,r,i,s,n,o,a,l){return[e,t,r,i,s,n,o,a,l]}},Symbol.toStringTag,{value:"Module"}))},51305:(e,t,r)=>{r.d(t,{c:()=>d,g:()=>u,j:()=>M,k:()=>m,m:()=>p,s:()=>c});var i=r(46521),s=r(94961),n=r(65617),o=r(46851),a=r(17896),l=r(98766);function c(e,t,r){r*=.5;const i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e}function u(e,t){const r=2*Math.acos(t[3]),i=Math.sin(r/2);return i>(0,o.g)()?(e[0]=t[0]/i,e[1]=t[1]/i,e[2]=t[2]/i):(e[0]=1,e[1]=0,e[2]=0),r}function p(e,t,r){const i=t[0],s=t[1],n=t[2],o=t[3],a=r[0],l=r[1],c=r[2],u=r[3];return e[0]=i*u+o*a+s*c-n*l,e[1]=s*u+o*l+n*a-i*c,e[2]=n*u+o*c+i*l-s*a,e[3]=o*u-i*a-s*l-n*c,e}function h(e,t,r,i){const s=t[0],n=t[1],a=t[2],l=t[3];let c,u,p,h,d,y=r[0],m=r[1],g=r[2],f=r[3];return u=s*y+n*m+a*g+l*f,u<0&&(u=-u,y=-y,m=-m,g=-g,f=-f),1-u>(0,o.g)()?(c=Math.acos(u),p=Math.sin(c),h=Math.sin((1-i)*c)/p,d=Math.sin(i*c)/p):(h=1-i,d=i),e[0]=h*s+d*y,e[1]=h*n+d*m,e[2]=h*a+d*g,e[3]=h*l+d*f,e}function d(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function y(e,t){const r=t[0]+t[4]+t[8];let i;if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);const s=(r+1)%3,n=(r+2)%3;i=Math.sqrt(t[3*r+r]-t[3*s+s]-t[3*n+n]+1),e[r]=.5*i,i=.5/i,e[3]=(t[3*s+n]-t[3*n+s])*i,e[s]=(t[3*s+r]+t[3*r+s])*i,e[n]=(t[3*n+r]+t[3*r+n])*i}return e}function m(e,t,r,i){const s=.5*Math.PI/180;t*=s,r*=s,i*=s;const n=Math.sin(t),o=Math.cos(t),a=Math.sin(r),l=Math.cos(r),c=Math.sin(i),u=Math.cos(i);return e[0]=n*l*u-o*a*c,e[1]=o*a*u+n*l*c,e[2]=o*l*c-n*a*u,e[3]=o*l*u+n*a*c,e}const g=l.c,f=l.s,b=l.a,v=p,_=l.b,w=l.d,S=l.l,x=l.e,C=x,j=l.f,I=j,V=l.n,M=l.g,R=l.h,A=(0,n.c)(),N=(0,n.f)(1,0,0),T=(0,n.f)(0,1,0),q=(0,s.a)(),D=(0,s.a)(),E=(0,i.c)();Object.freeze(Object.defineProperty({__proto__:null,add:b,calculateW:function(e,t){const r=t[0],i=t[1],s=t[2];return e[0]=r,e[1]=i,e[2]=s,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-s*s)),e},conjugate:d,copy:g,dot:w,equals:R,exactEquals:M,fromEuler:m,fromMat3:y,getAxisAngle:u,identity:function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},invert:function(e,t){const r=t[0],i=t[1],s=t[2],n=t[3],o=r*r+i*i+s*s+n*n,a=o?1/o:0;return e[0]=-r*a,e[1]=-i*a,e[2]=-s*a,e[3]=n*a,e},len:C,length:x,lerp:S,mul:v,multiply:p,normalize:V,random:function(e){const t=o.R,r=t(),i=t(),s=t(),n=Math.sqrt(1-r),a=Math.sqrt(r);return e[0]=n*Math.sin(2*Math.PI*i),e[1]=n*Math.cos(2*Math.PI*i),e[2]=a*Math.sin(2*Math.PI*s),e[3]=a*Math.cos(2*Math.PI*s),e},rotateX:function(e,t,r){r*=.5;const i=t[0],s=t[1],n=t[2],o=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=i*l+o*a,e[1]=s*l+n*a,e[2]=n*l-s*a,e[3]=o*l-i*a,e},rotateY:function(e,t,r){r*=.5;const i=t[0],s=t[1],n=t[2],o=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=i*l-n*a,e[1]=s*l+o*a,e[2]=n*l+i*a,e[3]=o*l-s*a,e},rotateZ:function(e,t,r){r*=.5;const i=t[0],s=t[1],n=t[2],o=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=i*l+s*a,e[1]=s*l-i*a,e[2]=n*l+o*a,e[3]=o*l-n*a,e},rotationTo:function(e,t,r){const i=(0,a.e)(t,r);return i<-.999999?((0,a.f)(A,N,t),(0,a.u)(A)<1e-6&&(0,a.f)(A,T,t),(0,a.n)(A,A),c(e,A,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):((0,a.f)(A,t,r),e[0]=A[0],e[1]=A[1],e[2]=A[2],e[3]=1+i,V(e,e))},scale:_,set:f,setAxes:function(e,t,r,i){const s=E;return s[0]=r[0],s[3]=r[1],s[6]=r[2],s[1]=i[0],s[4]=i[1],s[7]=i[2],s[2]=-t[0],s[5]=-t[1],s[8]=-t[2],V(e,y(e,s))},setAxisAngle:c,slerp:h,sqlerp:function(e,t,r,i,s,n){return h(q,t,s,n),h(D,r,i,n),h(e,q,D,2*n*(1-n)),e},sqrLen:I,squaredLength:j,str:function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}},Symbol.toStringTag,{value:"Module"}))},94961:(e,t,r)=>{function i(){return[0,0,0,1]}function s(e){return[e[0],e[1],e[2],e[3]]}function n(e,t){return new Float64Array(e,t,4)}r.d(t,{I:()=>o,a:()=>i,b:()=>s,c:()=>n});const o=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:s,create:i,createView:n,fromValues:function(e,t,r,i){return[e,t,r,i]}},Symbol.toStringTag,{value:"Module"}))},35270:(e,t,r)=>{r.d(t,{B7:()=>l,St:()=>s,VL:()=>o,h$:()=>n,rW:()=>c});const i={transparent:[0,0,0,0],black:[0,0,0,1],silver:[192,192,192,1],gray:[128,128,128,1],white:[255,255,255,1],maroon:[128,0,0,1],red:[255,0,0,1],purple:[128,0,128,1],fuchsia:[255,0,255,1],green:[0,128,0,1],lime:[0,255,0,1],olive:[128,128,0,1],yellow:[255,255,0,1],navy:[0,0,128,1],blue:[0,0,255,1],teal:[0,128,128,1],aqua:[0,255,255,1],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],blanchedalmond:[255,235,205,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],oldlace:[253,245,230,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],rebeccapurple:[102,51,153,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],whitesmoke:[245,245,245,1],yellowgreen:[154,205,50,1]};function s(e){return i[e]||i[e.toLowerCase()]}function n(e){return i[e]??i[e.toLowerCase()]}function o(e){return[...n(e)]}function a(e,t,r){r<0&&++r,r>1&&--r;const i=6*r;return i<1?e+(t-e)*i:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}function l(e,t,r,i=1){const s=(e%360+360)%360/360,n=r<=.5?r*(t+1):r+t-r*t,o=2*r-n;return[Math.round(255*a(o,n,s+1/3)),Math.round(255*a(o,n,s)),Math.round(255*a(o,n,s-1/3)),i]}function c(e){const t=e.length>5,r=t?8:4,i=(1<<r)-1,s=t?1:17,n=t?9===e.length:5===e.length;let o=Number("0x"+e.substr(1));if(isNaN(o))return null;const a=[0,0,0,1];let l;return n&&(l=o&i,o>>=r,a[3]=s*l/255),l=o&i,o>>=r,a[2]=s*l,l=o&i,o>>=r,a[1]=s*l,l=o&i,o>>=r,a[0]=s*l,a}},2368:(e,t,r)=>{r.d(t,{J:()=>u,j:()=>p});var i=r(43697),s=r(15923),n=(r(80442),r(22974)),o=(r(92604),r(70586)),a=r(31263),l=r(1153),c=r(52011);const u=e=>{let t=class extends e{clone(){const e=(0,o.s3)((0,l.vw)(this),"unable to clone instance of non-accessor class"),t=e.metadatas,r=e.store,i={},s=new Map;for(const e in t){const o=t[e],l=r?.originOf(e),c=o.clonable;if(o.readOnly||!1===c||l!==a.s3.USER&&l!==a.s3.DEFAULTS&&l!==a.s3.WEB_MAP&&l!==a.s3.WEB_SCENE)continue;const u=this[e];let p=null;p="function"==typeof c?c(u):"reference"===c?u:(0,n.Vo)(u),null!=u&&null==p||(l===a.s3.DEFAULTS?s.set(e,p):i[e]=p)}const c=new(0,Object.getPrototypeOf(this).constructor)(i);if(s.size){const e=(0,l.vw)(c)?.store;if(e)for(const[t,r]of s)e.set(t,r,a.s3.DEFAULTS)}return c}};return t=(0,i._)([(0,c.j)("esri.core.Clonable")],t),t};let p=class extends(u(s.Z)){};p=(0,i._)([(0,c.j)("esri.core.Clonable")],p)},46791:(e,t,r)=>{r.d(t,{Z:()=>A});var i,s=r(43697),n=r(3894),o=r(32448),a=r(22974),l=r(70586),c=r(71143);!function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE",e[e.MOVE=4]="MOVE"}(i||(i={}));var u,p=r(1654),h=r(5600),d=r(75215),y=r(52421),m=r(52011),g=r(58971),f=r(10661);const b=new c.Z(class{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}},void 0,(e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1})),v=()=>{};function _(e){return e?e instanceof R?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function w(e){if(e&&e.length)return e[0]}function S(e,t,r,i){const s=Math.min(e.length-r,t.length-i);let n=0;for(;n<s&&e[r+n]===t[i+n];)n++;return n}function x(e,t,r,i){t&&t.forEach(((t,s,n)=>{e.push(t),x(e,r.call(i,t,s,n),r,i)}))}const C=new Set,j=new Set,I=new Set,V=new Map;let M=0,R=u=class extends o.Z.EventedAccessor{static isCollection(e){return null!=e&&e instanceof u}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._timer=null,this._observable=new f.s,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:M++})}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof u?{items:e}:e:{}}destroy(){this.removeAll()}*[Symbol.iterator](){yield*this.items}get items(){return(0,g.it)(this._observable),this._items}set items(e){this._emitBeforeChanges(i.ADD)||(this._splice(0,this.length,_(e)),this._emitAfterChanges(i.ADD))}hasEventListener(e){return"change"===e?this._chgListeners.length>0:this._emitter.hasEventListener(e)}on(e,t){if("change"===e){const e=this._chgListeners,r={removed:!1,callback:t};return e.push(r),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),{remove(){this.remove=v,r.removed=!0,e.splice(e.indexOf(r),1)}}}return this._emitter.on(e,t)}once(e,t){const r=this.on(e,t);return{remove(){r.remove()}}}add(e,t){if((0,g.it)(this._observable),this._emitBeforeChanges(i.ADD))return this;const r=this.getNextIndex(t??null);return this._splice(r,0,[e]),this._emitAfterChanges(i.ADD),this}addMany(e,t=this._items.length){if((0,g.it)(this._observable),!e||!e.length)return this;if(this._emitBeforeChanges(i.ADD))return this;const r=this.getNextIndex(t);return this._splice(r,0,_(e)),this._emitAfterChanges(i.ADD),this}at(e){if((0,g.it)(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if((0,g.it)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return[];const e=this._splice(0,this.length)||[];return this._emitAfterChanges(i.REMOVE),e}clone(){return(0,g.it)(this._observable),this._createNewInstance({items:this._items.map(a.d9)})}concat(...e){(0,g.it)(this._observable);const t=e.map(_);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if((0,g.it)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return;const r=(0,l.j0)(this._splice(0,this.length)),s=r.length;for(let i=0;i<s;i++)e.call(t,r[i],i,r);this._emitAfterChanges(i.REMOVE)}every(e,t){return(0,g.it)(this._observable),this._items.every(e,t)}filter(e,t){let r;return(0,g.it)(this._observable),r=2===arguments.length?this._items.filter(e,t):this._items.filter(e),this._createNewInstance({items:r})}find(e,t){return(0,g.it)(this._observable),this._items.find(e,t)}findIndex(e,t){return(0,g.it)(this._observable),this._items.findIndex(e,t)}flatten(e,t){(0,g.it)(this._observable);const r=[];return x(r,this,e,t),new u(r)}forEach(e,t){return(0,g.it)(this._observable),this._items.forEach(e,t)}getItemAt(e){return(0,g.it)(this._observable),this._items[e]}getNextIndex(e){(0,g.it)(this._observable);const t=this.length;return(e=e??t)<0?e=0:e>t&&(e=t),e}includes(e,t=0){return(0,g.it)(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return(0,g.it)(this._observable),this._items.indexOf(e,t)}join(e=","){return(0,g.it)(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return(0,g.it)(this._observable),this._items.lastIndexOf(e,t)}map(e,t){(0,g.it)(this._observable);const r=this._items.map(e,t);return new u({items:r})}reorder(e,t=this.length-1){(0,g.it)(this._observable);const r=this.indexOf(e);if(-1!==r){if(t<0?t=0:t>=this.length&&(t=this.length-1),r!==t){if(this._emitBeforeChanges(i.MOVE))return e;this._splice(r,1),this._splice(t,0,[e]),this._emitAfterChanges(i.MOVE)}return e}}pop(){if((0,g.it)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return;const e=w(this._splice(this.length-1,1));return this._emitAfterChanges(i.REMOVE),e}push(...e){return(0,g.it)(this._observable),this._emitBeforeChanges(i.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(i.ADD)),this.length}reduce(e,t){(0,g.it)(this._observable);const r=this._items;return 2===arguments.length?r.reduce(e,t):r.reduce(e)}reduceRight(e,t){(0,g.it)(this._observable);const r=this._items;return 2===arguments.length?r.reduceRight(e,t):r.reduceRight(e)}remove(e){return(0,g.it)(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if((0,g.it)(this._observable),e<0||e>=this.length||this._emitBeforeChanges(i.REMOVE))return;const t=w(this._splice(e,1));return this._emitAfterChanges(i.REMOVE),t}removeMany(e){if((0,g.it)(this._observable),!e||!e.length||this._emitBeforeChanges(i.REMOVE))return[];const t=e instanceof u?e.toArray():e,r=this._items,s=[],n=t.length;for(let e=0;e<n;e++){const i=t[e],n=r.indexOf(i);if(n>-1){const i=1+S(t,r,e+1,n+1),o=this._splice(n,i);o&&o.length>0&&s.push.apply(s,o),e+=i-1}}return this._emitAfterChanges(i.REMOVE),s}reverse(){if((0,g.it)(this._observable),this._emitBeforeChanges(i.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(i.MOVE),this}shift(){if((0,g.it)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return;const e=w(this._splice(0,1));return this._emitAfterChanges(i.REMOVE),e}slice(e=0,t=this.length){return(0,g.it)(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return(0,g.it)(this._observable),this._items.some(e,t)}sort(e){if((0,g.it)(this._observable),!this.length||this._emitBeforeChanges(i.MOVE))return this;const t=(0,l.j0)(this._splice(0,this.length));return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(i.MOVE),this}splice(e,t,...r){(0,g.it)(this._observable);const s=(t?i.REMOVE:0)|(r.length?i.ADD:0);if(this._emitBeforeChanges(s))return[];const n=this._splice(e,t,r)||[];return this._emitAfterChanges(s),n}toArray(){return(0,g.it)(this._observable),this._items.slice()}toJSON(){return(0,g.it)(this._observable),this.toArray()}toLocaleString(){return(0,g.it)(this._observable),this._items.toLocaleString()}toString(){return(0,g.it)(this._observable),this._items.toString()}unshift(...e){return(0,g.it)(this._observable),!e.length||this._emitBeforeChanges(i.ADD)||(this._splice(0,0,e),this._emitAfterChanges(i.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,r){const i=this._items,s=this.itemType;let n,o;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._timer=(0,p.Os)((()=>this._dispatchChange()))),t){if(o=i.splice(e,t),this.hasEventListener("before-remove")){const t=b.acquire();t.target=this,t.cancellable=!0;for(let r=0,s=o.length;r<s;r++)n=o[r],t.reset(n),this.emit("before-remove",t),t.defaultPrevented&&(o.splice(r,1),i.splice(e,0,n),e+=1,r-=1,s-=1);b.release(t)}if(this.length=this._items.length,this.hasEventListener("after-remove")){const e=b.acquire();e.target=this,e.cancellable=!1;const t=o.length;for(let r=0;r<t;r++)e.reset(o[r]),this.emit("after-remove",e);b.release(e)}}if(r&&r.length){if(s){const e=[];for(const t of r){const r=s.ensureType(t);null==r&&null!=t||e.push(r)}r=e}const t=this.hasEventListener("before-add"),n=this.hasEventListener("after-add"),o=e===this.length;if(t||n){const s=b.acquire();s.target=this,s.cancellable=!0;const a=b.acquire();a.target=this,a.cancellable=!1;for(const l of r)t?(s.reset(l),this.emit("before-add",s),s.defaultPrevented||(o?i.push(l):i.splice(e++,0,l),this._set("length",i.length),n&&(a.reset(l),this.emit("after-add",a)))):(o?i.push(l):i.splice(e++,0,l),this._set("length",i.length),a.reset(l),this.emit("after-add",a));b.release(a),b.release(s)}else{if(o)for(const e of r)i.push(e);else i.splice(e,0,...r);this._set("length",i.length)}}return(r&&r.length||o&&o.length)&&this._notifyChangeEvent(r,o),o}_emitBeforeChanges(e){let t=!1;if(this.hasEventListener("before-changes")){const r=b.acquire();r.target=this,r.cancellable=!0,r.type=e,this.emit("before-changes",r),t=r.defaultPrevented,b.release(r)}return t}_emitAfterChanges(e){if(this.hasEventListener("after-changes")){const t=b.acquire();t.target=this,t.cancellable=!1,t.type=e,this.emit("after-changes",t),b.release(t)}this._observable.notify()}_notifyChangeEvent(e,t){this.hasEventListener("change")&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:e,removed:t})}_dispatchChange(){if(this._timer&&(this._timer.remove(),this._timer=null),!this._notifications)return;const e=this._notifications;this._notifications=null;for(const t of e){const e=t.changes;C.clear(),j.clear(),I.clear();for(const{added:t,removed:r}of e){if(t)if(0===I.size&&0===j.size)for(const e of t)C.add(e);else for(const e of t)j.has(e)?(I.add(e),j.delete(e)):I.has(e)||C.add(e);if(r)if(0===I.size&&0===C.size)for(const e of r)j.add(e);else for(const e of r)C.has(e)?C.delete(e):(I.delete(e),j.add(e))}const r=n.Z.acquire();C.forEach((e=>{r.push(e)}));const i=n.Z.acquire();j.forEach((e=>{i.push(e)}));const s=this._items,o=t.items,a=n.Z.acquire();if(I.forEach((e=>{o.indexOf(e)!==s.indexOf(e)&&a.push(e)})),t.listeners&&(r.length||i.length||a.length)){const e={target:this,added:r,removed:i,moved:a},s=t.listeners.length;for(let r=0;r<s;r++){const i=t.listeners[r];i.removed||i.callback.call(this,e)}}n.Z.release(r),n.Z.release(i),n.Z.release(a)}C.clear(),j.clear(),I.clear()}};R.ofType=e=>{if(!e)return u;if(V.has(e))return V.get(e);let t=null;if("function"==typeof e)t=e.prototype.declaredClass;else if(e.base)t=e.base.prototype.declaredClass;else for(const r in e.typeMap){const i=e.typeMap[r].prototype.declaredClass;t?t+=` | ${i}`:t=i}let r=class extends u{};return(0,s._)([(0,y.c)({Type:e,ensureType:"function"==typeof e?(0,d.se)(e):(0,d.N7)(e)})],r.prototype,"itemType",void 0),r=(0,s._)([(0,m.j)(`esri.core.Collection<${t}>`)],r),V.set(e,r),r},(0,s._)([(0,h.Cb)()],R.prototype,"length",void 0),(0,s._)([(0,h.Cb)()],R.prototype,"items",null),R=u=(0,s._)([(0,m.j)("esri.core.Collection")],R);const A=R},68251:(e,t,r)=>{r.d(t,{BV:()=>o});var i=r(22021);class s{constructor(e,t){this.min=e,this.max=t,this.range=t-e}ndiff(e,t=0){return Math.ceil((e-t)/this.range)*this.range+t}_normalize(e,t,r,i=0,s=!1){return(r-=i)<e?r+=this.ndiff(e-r):r>t&&(r-=this.ndiff(r-t)),s&&r===t&&(r=e),r+i}normalize(e,t=0,r=!1){return this._normalize(this.min,this.max,e,t,r)}clamp(e,t=0){return(0,i.uZ)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+this.ndiff(e-t,r)}minimalMonotonic(e,t,r){return this._normalize(e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);const r=(t=this.normalize(t))-e,i=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(i)?r:i}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function n(e){for(const t in e){const r=e[t];r instanceof Function&&(e[t]=r.bind(e))}return e}n(new s(0,2*Math.PI)),n(new s(-Math.PI,Math.PI));const o=n(new s(0,360))},28659:(e,t,r)=>{r.d(t,{B:()=>m});var i=r(81153),s=r(17452),n=r(41123),o=r(7628),a=r(31263),l=r(5600);function c(e){return u[function(e){return e instanceof Blob?e.type:function(e){const t=(0,s.Ml)(e);return d[t]||p}(e.url)}(e)]||h}const u={},p="text/plain",h=u[p],d={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const e in d)u[d[e]]=e;var y=r(25929);function m(e){const t=e?.origins??[void 0];return(r,n)=>{const u=function(e,t,r){if("resource"===e?.type)return function(e,t,r){const n=(0,o.Oe)(t,r);return{type:String,read:(e,t,r)=>{const i=(0,y.r)(e,t,r);return n.type===String?i:"function"==typeof n.type?new n.type({url:i}):void 0},write:{writer(t,o,l,u){if(!u||!u.resources)return"string"==typeof t?void(o[l]=(0,y.t)(t,u)):void(o[l]=t.write({},u));const p=function(e){return null==e?null:"string"==typeof e?e:e.url}(t),h=(0,y.t)(p,{...u,verifyItemRelativeUrls:u&&u.verifyItemRelativeUrls?{writtenUrls:u.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},y.M.NO),d=n.type!==String&&(!(0,i.l)(this)||u&&u.origin&&this.originIdOf(r)>(0,a.M9)(u.origin)),m={object:this,propertyName:r,value:t,targetUrl:h,dest:o,targetPropertyName:l,context:u,params:e};u&&u.portalItem&&h&&!(0,s.YP)(h)?d?function(e){const{context:t,targetUrl:r,params:i,value:n,dest:o,targetPropertyName:a}=e;if(!t.portalItem)return;const l=t.portalItem.resourceFromPath(r),u=b(n,r,t),p=c(u),h=(0,s.Ml)(l.path),d=i?.compress??!1;p===h?(t.resources&&f({...e,resource:l,content:u,compress:d,updates:t.resources.toUpdate}),o[a]=r):g(e)}(m):function({context:e,targetUrl:t,dest:r,targetPropertyName:i}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(t),compress:!1}),r[i]=t)}(m):u&&u.portalItem&&(null==h||null!=(0,y.i)(h)||(0,s.jc)(h)||d)?g(m):o[l]=h}}}}(e,t,r);switch(e?.type??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:e,write:t}=y.a;return{read:e,write:t}}}}(e,r,n);for(const e of t){const t=(0,l.CJ)(r,e,n);for(const e in u)t[e]=u[e]}}}function g(e){const{targetUrl:t,params:i,value:o,context:a,dest:l,targetPropertyName:u}=e;if(!a.portalItem)return;const p=(0,y.p)(t),h=p?.filename??(0,n.D)(),d=i?.prefix??p?.prefix,m=b(o,t,a),g=(0,s.v_)(d,h),v=`${g}.${c(m)}`,_=a.portalItem.resourceFromPath(v);(0,s.jc)(t)&&a.resources&&a.resources.pendingOperations.push(async function(e){const t=(await Promise.resolve().then(r.bind(r,3172))).default,{data:i}=await t(e,{responseType:"blob"});return i}(t).then((e=>{_.path=`${g}.${c(e)}`,l[u]=_.itemRelativeUrl})).catch((()=>{})));const w=i?.compress??!1;a.resources&&f({...e,resource:_,content:m,compress:w,updates:a.resources.toAdd}),l[u]=_.itemRelativeUrl}function f({object:e,propertyName:t,updates:r,resource:i,content:s,compress:n}){r.push({resource:i,content:s,compress:n,finish:r=>{!function(e,t,r){"string"==typeof e[t]?e[t]=r.url:e[t].url=r.url}(e,t,r)}})}function b(e,t,r){return"string"==typeof e?{url:t}:new Blob([JSON.stringify(e.toJSON(r))],{type:"application/json"})}},52421:(e,t,r)=>{function i(e){return(t,r)=>{t[r]=e}}r.d(t,{c:()=>i})},65845:(e,t,r)=>{r.d(t,{D:()=>s});var i=r(81153);function s(e){e&&e.writtenProperties&&e.writtenProperties.forEach((({target:e,propName:t,newOrigin:r})=>{(0,i.l)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)}))}},70921:(e,t,r)=>{r.d(t,{R:()=>n,Z:()=>s});var i=r(46791);function s(e,t,r=i.Z){return t||(t=new r),t===e||(t.removeAll(),(s=e)&&(Array.isArray(s)||"items"in s&&Array.isArray(s.items))?t.addMany(e):e&&t.add(e)),t;var s}function n(e){return e}},81153:(e,t,r)=>{function i(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{l:()=>i})},35463:(e,t,r)=>{r.d(t,{JE:()=>o,Nm:()=>n,rJ:()=>a}),r(80442);const i={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8},s={milliseconds:{getter:"getMilliseconds",setter:"setMilliseconds",multiplier:1},seconds:{getter:"getSeconds",setter:"setSeconds",multiplier:1},minutes:{getter:"getMinutes",setter:"setMinutes",multiplier:1},hours:{getter:"getHours",setter:"setHours",multiplier:1},days:{getter:"getDate",setter:"setDate",multiplier:1},weeks:{getter:"getDate",setter:"setDate",multiplier:7},months:{getter:"getMonth",setter:"setMonth",multiplier:1},years:{getter:"getFullYear",setter:"setFullYear",multiplier:1},decades:{getter:"getFullYear",setter:"setFullYear",multiplier:10},centuries:{getter:"getFullYear",setter:"setFullYear",multiplier:100}};function n(e,t,r){const i=new Date(e.getTime());if(t&&r){const e=s[r],{getter:n,setter:o,multiplier:a}=e;if("months"===r){const e=function(e,t){const r=new Date(e,t+1,1);return r.setDate(0),r.getDate()}(i.getFullYear(),i.getMonth()+t);i.getDate()>e&&i.setDate(e)}i[o](i[n]()+t*a)}return i}function o(e,t){switch(t){case"milliseconds":return new Date(e.getTime());case"seconds":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds());case"minutes":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes());case"hours":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours());case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate());case"weeks":return new Date(e.getFullYear(),e.getMonth(),e.getDate()-e.getDay());case"months":return new Date(e.getFullYear(),e.getMonth(),1);case"years":return new Date(e.getFullYear(),0,1);case"decades":return new Date(e.getFullYear()-e.getFullYear()%10,0,1);case"centuries":return new Date(e.getFullYear()-e.getFullYear()%100,0,1);default:return new Date}}function a(e,t,r){return 0===e?0:e*i[t]/i[r]}},41123:(e,t,r)=>{r.d(t,{D:()=>s});const i="randomUUID"in crypto;function s(){if(i)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}},79235:(e,t,r)=>{r.d(t,{Z:()=>v});var i,s=r(43697),n=r(67676),o=r(35454),a=r(96674),l=r(67900),c=r(20941),u=r(5600),p=(r(75215),r(71715)),h=r(52011),d=r(30556);const y=(0,o.w)()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),m=y.jsonValues.slice();(0,n.e$)(m,"orthometric");const g=(0,o.w)()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let f=i=class extends a.wq{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,r){return y.write(e,t,r)}readHeightModel(e,t,r){return y.read(e)||(r&&r.messages&&r.messages.push(function(e,t){return new c.Z("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}(e,{context:r})),null)}readHeightUnit(e,t,r){return g.read(e)||(r&&r.messages&&r.messages.push(b(e,{context:r})),null)}readHeightUnitService(e,t,r){return(0,l.$C)(e)||g.read(e)||(r&&r.messages&&r.messages.push(b(e,{context:r})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new i({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const r=(0,l.cM)(t);return new i({heightModel:e.heightModel,heightUnit:r,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new i;return t.read(e,{origin:"web-scene"}),t}};function b(e,t){return new c.Z("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}(0,s._)([(0,u.Cb)({type:y.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:m,default:"ellipsoidal"}}}})],f.prototype,"heightModel",void 0),(0,s._)([(0,d.c)("web-scene","heightModel")],f.prototype,"writeHeightModel",null),(0,s._)([(0,p.r)(["web-scene","service"],"heightModel")],f.prototype,"readHeightModel",null),(0,s._)([(0,u.Cb)({type:g.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:g.jsonValues,write:g.write}}}})],f.prototype,"heightUnit",void 0),(0,s._)([(0,p.r)("web-scene","heightUnit")],f.prototype,"readHeightUnit",null),(0,s._)([(0,p.r)("service","heightUnit")],f.prototype,"readHeightUnitService",null),(0,s._)([(0,u.Cb)({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],f.prototype,"vertCRS",void 0),(0,s._)([(0,p.r)("service","vertCRS",["vertCRS","ellipsoid","geoid"])],f.prototype,"readVertCRS",null),f=i=(0,s._)([(0,h.j)("esri.geometry.HeightModelInfo")],f);const v=f},28865:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Je});var i=r(43697),s=r(46791),n=r(20102),o=r(92604),a=r(70586),l=r(16453),c=r(95330),u=r(5600),p=r(75215),h=(r(67676),r(71715)),d=r(52011),y=r(17896),m=r(65617),g=r(6570),f=r(87085),b=r(54295),v=r(17287),_=r(38009),w=r(16859),S=r(72965),x=r(32271),C=r(66677),j=r(21506),I=r(1231),V=r(2368),M=r(68251),R=r(96674),A=r(28659),N=r(51305),T=r(94961),q=r(46851);const D=(0,m.c)(),E=(0,T.a)(),z=(0,T.a)(),O=(0,T.a)(),Z=(0,m.f)(0,0,1),F=(0,m.f)(0,1,0),P=(0,m.f)(1,0,0);function L(e){(0,y.c)(D,e),(0,y.n)(D,D);const t=Math.atan2(D[1],D[0]),r=(0,N.s)((0,T.a)(),Z,-t);(0,y.q)(D,D,r);const i=-1*Math.atan2(D[2],D[0]);return[(0,q.a)(t)+270,(0,q.a)(i)+90]}function k(e,t){return(0,N.s)(z,Z,(0,q.t)(e-270)),(0,N.s)(O,F,(0,q.t)(t-90)),(0,N.m)(E,z,O),(0,y.c)(D,P),(0,y.q)(D,D,E),(0,y.n)(D,D),[D[0],D[1],D[2]]}var U=r(90578);let B=class extends((0,V.J)(R.wq)){constructor(e){super(e),this.enabled=!0,this.label="",this.normal=null,this.point=null}get orientation(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,t]=L(this.normal);return M.BV.normalize((0,p.q9)(e),0,!0)}set orientation(e){const t=k(e,this.tilt);this._set("normal",t),this._set("orientation",e)}get tilt(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,t]=L(this.normal);return M.BV.normalize((0,p.q9)(t),0,!0)}set tilt(e){const t=k(this.orientation,e);this._set("normal",t),this._set("tilt",e)}};(0,i._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],B.prototype,"enabled",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],B.prototype,"label",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),(0,U.p)((e=>M.BV.normalize((0,p.q9)(e),0,!0)))],B.prototype,"orientation",null),(0,i._)([(0,u.Cb)({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),(0,U.p)((e=>M.BV.normalize((0,p.q9)(e),0,!0)))],B.prototype,"tilt",null),(0,i._)([(0,u.Cb)({type:[Number],json:{write:!0}})],B.prototype,"normal",void 0),(0,i._)([(0,u.Cb)({type:[Number],json:{write:!0}})],B.prototype,"point",void 0),B=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelSlice")],B);const $=B;var K=r(25929);let J=class extends((0,V.J)(R.wq)){constructor(){super(...arguments),this.enabled=!0,this.href=null,this.id=null,this.label="",this.normal=null,this.point=null,this.sizeInPixel=null,this.slices=null,this.timeId=0,this.variableId=null}get orientation(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,t]=L(this.normal);return M.BV.normalize((0,p.q9)(e),0,!0)}get tilt(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,t]=L(this.normal);return M.BV.normalize((0,p.q9)(t),0,!0)}};(0,i._)([(0,u.Cb)({type:Boolean,json:{default:!0,write:!0}})],J.prototype,"enabled",void 0),(0,i._)([(0,u.Cb)({type:String,json:{origins:{service:{read:K.r}},write:{enabled:!0,isRequired:!0}}}),(0,A.B)({origins:["web-scene"],type:"resource",prefix:"sections",compress:!0})],J.prototype,"href",void 0),(0,i._)([(0,u.Cb)({type:p.z8,json:{write:{enabled:!0,isRequired:!0}}})],J.prototype,"id",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],J.prototype,"label",void 0),(0,i._)([(0,u.Cb)({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],J.prototype,"orientation",null),(0,i._)([(0,u.Cb)({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],J.prototype,"tilt",null),(0,i._)([(0,u.Cb)({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],J.prototype,"normal",void 0),(0,i._)([(0,u.Cb)({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],J.prototype,"point",void 0),(0,i._)([(0,u.Cb)({type:[p.z8],json:{write:{enabled:!0,isRequired:!0}}})],J.prototype,"sizeInPixel",void 0),(0,i._)([(0,u.Cb)({type:[$],json:{write:!0}})],J.prototype,"slices",void 0),(0,i._)([(0,u.Cb)({type:p.z8,json:{default:0,write:!0}})],J.prototype,"timeId",void 0),(0,i._)([(0,u.Cb)({type:p.z8,json:{write:{enabled:!0,isRequired:!0}}})],J.prototype,"variableId",void 0),J=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelSection")],J);const Y=J;let H=class extends R.wq{constructor(){super(...arguments),this.diffuseFactor=.5,this.specularFactor=.5}};(0,i._)([(0,u.Cb)({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],H.prototype,"diffuseFactor",void 0),(0,i._)([(0,u.Cb)({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],H.prototype,"specularFactor",void 0),H=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelSimpleShading")],H);const W=H;let G=class extends R.wq{constructor(){super(...arguments),this.continuity=null,this.hasNoData=!1,this.noData=0,this.offset=0,this.scale=1,this.type=null}};(0,i._)([(0,u.Cb)({type:["discrete","continuous"],json:{write:!0}})],G.prototype,"continuity",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],G.prototype,"hasNoData",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],G.prototype,"noData",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],G.prototype,"offset",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],G.prototype,"scale",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:{enabled:!0,isRequired:!0}}})],G.prototype,"type",void 0),G=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelFormat")],G);const Q=G;let X=class extends R.wq{constructor(){super(...arguments),this.id=null,this.description="",this.name=null,this.originalFormat=null,this.renderingFormat=null,this.unit="",this.volumeId=0,this.type=null}};(0,i._)([(0,u.Cb)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],X.prototype,"id",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],X.prototype,"description",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:{enabled:!0,isRequired:!0}}})],X.prototype,"name",void 0),(0,i._)([(0,u.Cb)({type:Q,json:{write:!0}})],X.prototype,"originalFormat",void 0),(0,i._)([(0,u.Cb)({type:Q,json:{write:{enabled:!0,isRequired:!0}}})],X.prototype,"renderingFormat",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],X.prototype,"unit",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],X.prototype,"volumeId",void 0),(0,i._)([(0,u.Cb)({type:["stc-hot-spot-results","stc-cluster-outlier-results","stc-estimated-bin","generic-nearest-interpolated"],json:{write:!0}})],X.prototype,"type",void 0),X=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelVariable")],X);const ee=X;var te=r(22974),re=r(22303);let ie=class extends((0,V.J)(R.wq)){constructor(){super(...arguments),this.color=re.Z.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label="",this.colorLocked=!1}};(0,i._)([(0,u.Cb)({type:re.Z,json:{type:[p.z8],write:{enabled:!0,isRequired:!0}}})],ie.prototype,"color",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],ie.prototype,"value",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{default:!0,write:!0}})],ie.prototype,"enabled",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],ie.prototype,"label",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{default:!1}})],ie.prototype,"colorLocked",void 0),ie=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelIsosurface")],ie);const se=ie;var ne=r(70921),oe=r(22021);let ae=class extends((0,V.J)(R.wq)){constructor(){super(...arguments),this.color=null,this.position=0}};(0,i._)([(0,u.Cb)({type:re.Z,json:{type:[p.z8],write:{enabled:!0,isRequired:!0}}})],ae.prototype,"color",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],ae.prototype,"position",void 0),ae=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelColorStop")],ae);const le=ae;let ce=class extends((0,V.J)(R.wq)){constructor(){super(...arguments),this.opacity=1,this.position=0}};(0,i._)([(0,u.Cb)({type:Number,json:{name:"alpha",write:{enabled:!0,isRequired:!0}}})],ce.prototype,"opacity",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],ce.prototype,"position",void 0),ce=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelOpacityStop")],ce);const ue=ce;let pe=class extends((0,V.J)(R.wq)){constructor(){super(...arguments),this.enabled=!1,this.range=null}};(0,i._)([(0,u.Cb)({type:Boolean,json:{default:!1,write:!0}})],pe.prototype,"enabled",void 0),(0,i._)([(0,u.Cb)({type:[Number],json:{write:!0}})],pe.prototype,"range",void 0),pe=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelRangeFilter")],pe);const he=pe;var de,ye;(ye=de||(de={}))[ye.Color=1]="Color",ye[ye.Alpha=2]="Alpha",ye[ye.Both=3]="Both";let me=class extends((0,V.J)(R.wq)){constructor(e){super(e),this.interpolation=null,this.stretchRange=null,this.rangeFilter=null,this._colorMapSize=256,this.colorStops=new(s.Z.ofType(le)),this.opacityStops=new(s.Z.ofType(ue))}set colorStops(e){this._set("colorStops",(0,ne.Z)(e,this._get("colorStops"),s.Z.ofType(le)))}set opacityStops(e){this._set("opacityStops",(0,ne.Z)(e,this._get("opacityStops"),s.Z.ofType(ue)))}getPreviousNext(e,t,r){let i=e;for(;--i>0&&t[i].type!==r&&t[i].type!==de.Both;);let s=e;const n=t.length;for(;++s<n&&t[s].type!==r&&t[s].type!==de.Both;);return[i,s]}get rasterizedTransferFunction(){const e=[];if(this.colorStops.length<2)return e;const t=[],r=[];for(const t of this.colorStops){if(!t.color)return e;r.push({color:{r:t.color.r,g:t.color.g,b:t.color.b,a:Math.round(255*(1-t.color.a))},position:t.position,type:de.Color})}if(0===this.opacityStops.length)for(const e of r)t.push({color:e.color,position:e.position});else{for(const e of this.opacityStops){const t=(0,oe.uZ)(e.position,0,1),i=Math.round(255*(0,oe.uZ)(1-e.opacity,0,1));let s=!1;for(const e of r)if(e.type===de.Color&&Math.abs(e.position-t)<1e-5){e.color.a=i,e.type=de.Both,s=!0;break}s||r.push({color:{r:0,g:0,b:0,a:i},position:e.position,type:de.Alpha})}r.sort(((e,t)=>e.position<t.position?-1:1));const e=r.length;for(let t=0;t<e;++t){const i=r[t];if(i.type!==de.Both)if(i.type===de.Color){const[s,n]=this.getPreviousNext(t,r,de.Alpha);if(-1!==s&&n!==e){const e=(i.position-r[s].position)/(r[n].position-r[s].position);i.color.a=Math.round((0,oe.t7)(r[s].color.a,r[n].color.a,e))}else i.color.a=-1!==s?r[s].color.a:r[n].color.a}else{const[s,n]=this.getPreviousNext(t,r,de.Color);if(-1!==s&&n!==e){const e=(i.position-r[s].position)/(r[n].position-r[s].position),t=r[s].color,o=r[n].color;["r","g","b"].forEach((r=>{i.color[r]=Math.round((0,oe.t7)(t[r],o[r],e))}))}else["r","g","b"].forEach(-1!==s?e=>{i.color[e]=r[s][e]}:e=>{i.color[e]=r[n][e]})}}for(const e of r)t.push({color:e.color,position:e.position})}t[0].position=0,t[t.length-1].position=1;let i=0,s=1;for(let r=0;r<this._colorMapSize;++r){const n=r/this._colorMapSize;for(;n>t[s].position;)i=s++;const o=(n-t[i].position)/(t[s].position-t[i].position),a=t[i].color,l=t[s].color,c=new re.Z;["r","g","b"].forEach((e=>{c[e]=Math.round((0,oe.t7)(a[e],l[e],o))})),c.a=(0,oe.uZ)(1-(0,oe.t7)(a.a,l.a,o)/255,0,1),e.push(c)}return e}getColorForContinuousDataValue(e,t){const r=this.rasterizedTransferFunction;if(this.colorStops.length<2||!Array.isArray(this.stretchRange)||this.stretchRange.length<2||r.length<256)return null;let i=this.stretchRange[0],s=this.stretchRange[1];if(i>s){const e=i;i=s,s=e}e=(0,oe.uZ)(e,i,s);const n=r[Math.round((e-i)/(s-i)*(this._colorMapSize-1))].clone();return t||(n.a=1),n}};(0,i._)([(0,u.Cb)({type:["linear","nearest"],json:{write:!0}})],me.prototype,"interpolation",void 0),(0,i._)([(0,u.Cb)({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],me.prototype,"stretchRange",void 0),(0,i._)([(0,u.Cb)({type:s.Z.ofType(le),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.colorStops&&this.colorStops.length>0}}}}})],me.prototype,"colorStops",null),(0,i._)([(0,u.Cb)({type:s.Z.ofType(ue),json:{read:{source:"alphaStops"},write:{enabled:!0,target:"alphaStops",overridePolicy(){return{enabled:!!this.opacityStops&&this.opacityStops.length>0}}}}})],me.prototype,"opacityStops",null),(0,i._)([(0,u.Cb)({type:he,json:{write:!0}})],me.prototype,"rangeFilter",void 0),(0,i._)([(0,u.Cb)({type:[re.Z],clonable:!1,json:{read:!1}})],me.prototype,"rasterizedTransferFunction",null),me=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelTransferFunctionStyle")],me);const ge=me;let fe=class extends((0,V.J)(R.wq)){constructor(){super(...arguments),this.color=re.Z.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label=""}};(0,i._)([(0,u.Cb)({type:re.Z,json:{type:[p.z8],write:{enabled:!0,isRequired:!0}}})],fe.prototype,"color",void 0),(0,i._)([(0,u.Cb)({type:p.z8,json:{write:{enabled:!0,isRequired:!0}}})],fe.prototype,"value",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{default:!0,write:!0}})],fe.prototype,"enabled",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],fe.prototype,"label",void 0),fe=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelUniqueValue")],fe);const be=fe;var ve;let _e=ve=class extends R.wq{constructor(e){super(e),this.variableId=0,this.label="",this.transferFunction=null,this.uniqueValues=null,this.isosurfaces=null,this.uniqueValues=new(s.Z.ofType(be)),this.isosurfaces=new(s.Z.ofType(se))}clone(){return new ve({variableId:this.variableId,label:this.label,transferFunction:(0,te.d9)(this.transferFunction),uniqueValues:(0,te.d9)(this.uniqueValues),isosurfaces:(0,te.d9)(this.isosurfaces)})}};(0,i._)([(0,u.Cb)({type:p.z8,json:{write:{enabled:!0,isRequired:!0}}})],_e.prototype,"variableId",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],_e.prototype,"label",void 0),(0,i._)([(0,u.Cb)({type:ge,json:{write:{enabled:!0,overridePolicy(){return{enabled:!this.uniqueValues||this.uniqueValues.length<1}}}}})],_e.prototype,"transferFunction",void 0),(0,i._)([(0,u.Cb)({type:s.Z.ofType(be),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.uniqueValues&&this.uniqueValues.length>0}}}}})],_e.prototype,"uniqueValues",void 0),(0,i._)([(0,u.Cb)({type:s.Z.ofType(se),json:{write:{enabled:!0,overridePolicy(){const e=!this.uniqueValues||this.uniqueValues.length<1,t=!!this.isosurfaces&&this.isosurfaces.length>0;return{enabled:e&&t}}}}})],_e.prototype,"isosurfaces",void 0),_e=ve=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelVariableStyle")],_e);const we=_e;var Se=r(94139),xe=r(82971),Ce=r(8744);let je=class extends R.wq{constructor(){super(...arguments),this.values=null}};(0,i._)([(0,u.Cb)({type:[Number],json:{write:!0}})],je.prototype,"values",void 0),je=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelIrregularSpacing")],je);const Ie=je;let Ve=class extends R.wq{constructor(){super(...arguments),this.scale=1,this.offset=0}};(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],Ve.prototype,"scale",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],Ve.prototype,"offset",void 0),Ve=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelRegularSpacing")],Ve);const Me=Ve;let Re=class extends R.wq{constructor(){super(...arguments),this.irregularSpacing=null,this.isPositiveUp=!0,this.isWrappedDateLine=!1,this.label=null,this.name=null,this.quantity=null,this.regularSpacing=null,this.size=0,this.unit=null}get isRegular(){return(null==this.irregularSpacing||void 0===this.irregularSpacing)&&null!==this.regularSpacing}getRange(){return this.isRegular?[this.regularSpacing.offset,this.regularSpacing.offset+this.regularSpacing.scale*(this.size-1)]:Array.isArray(this.irregularSpacing?.values)&&this.irregularSpacing.values.length>1?[this.irregularSpacing.values[0],this.irregularSpacing.values[this.irregularSpacing.values.length-1]]:[0,0]}};(0,i._)([(0,u.Cb)({type:Ie,json:{write:!0}})],Re.prototype,"irregularSpacing",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],Re.prototype,"isPositiveUp",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],Re.prototype,"isWrappedDateLine",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],Re.prototype,"label",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],Re.prototype,"name",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],Re.prototype,"quantity",void 0),(0,i._)([(0,u.Cb)({type:Me,json:{write:!0}})],Re.prototype,"regularSpacing",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],Re.prototype,"size",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],Re.prototype,"unit",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{read:!1}})],Re.prototype,"isRegular",null),Re=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelDimension")],Re);const Ae=Re,Ne="esri.layers.voxel.VoxelVolume",Te=o.Z.getLogger(Ne);let qe=class extends R.wq{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=xe.Z.WGS84}get zDimension(){if(!this.dimensions)return-1;if(!Array.isArray(this.dimensions))return-1;if(4!==this.dimensions.length)return-1;for(let e=2;e<4;++e)if(this.dimensions[e].size>0)return e;return-1}get isValid(){return!(!this.dimensions||!Array.isArray(this.dimensions)||4!==this.dimensions.length||this.dimensions[0].size<1||this.dimensions[1].size<1||-1===this.zDimension||this.dimensions[this.zDimension].size<1)}get originInLayerSpace3D(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),t=this.dimensions[1].getRange(),r=this.dimensions[2],i=r.isRegular?r.getRange():[0,r.size];return[e[0],t[0],i[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),t=this.dimensions[1].getRange(),r=this.dimensions[2],i=r.isRegular?r.getRange():[0,r.size],s=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let e=0;e<3;++e)s[e]<2?s[e]=1:s[e]-=1;return r.isRegular&&!r.isPositiveUp&&(s[2]*=-1),[(e[1]-e[0])/s[0],(t[1]-t[0])/s[1],(i[1]-i[0])/s[2]]}get volumeType(){if(this.isValid){const e=this.dimensions[2].size>0,t=this.dimensions[3].size>0;if(!e&&t)return"xyt";if(e&&t)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const e=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[e].size]}computeVoxelSpaceLocation(e){if(!this.isValid)return[0,0,0];if("xyt"===this.volumeType)return Te.error("computeVoxelSpacePosition cannot be used with XYT volumes."),[0,0,0];if(!(0,Ce.fS)(this.spatialReference,e.spatialReference))return Te.error("pos argument should have the same spatial reference as the VoxelLayer."),[0,0,0];const t=(0,m.f)(e.x,e.y,e.z??0);(0,y.b)(t,t,this.originInLayerSpace3D),(0,y.C)(t,t,this.voxelSizeInLayerSpaceSigned);const r=this.dimensions[this.zDimension];if(!r.isRegular&&Array.isArray(r.irregularSpacing?.values)&&r.irregularSpacing.values.length>1){const i=e.z??0,s=r.irregularSpacing.values,n=r.isPositiveUp?1:-1,o=s.reduce(((e,t)=>Math.abs(n*t-i)<Math.abs(n*e-i)?t:e));for(let e=0;e<s.length;++e)if(s[e]===o){t[2]=e;break}}return[t[0],t[1],t[2]]}computeLayerSpaceLocation(e){if(!this.isValid)return new Se.Z({x:0,y:0,spatialReference:this.spatialReference});const t=(0,m.d)(e);if((0,y.B)(t,t,this.voxelSizeInLayerSpaceSigned),(0,y.a)(t,t,this.originInLayerSpace3D),"xyt"===this.volumeType)return new Se.Z({x:t[0],y:t[1],spatialReference:this.spatialReference});const r=this.dimensions[this.zDimension];return r.isRegular||Array.isArray(r.irregularSpacing?.values)&&(e[2]<0?t[2]=r.irregularSpacing.values[0]:e[2]<r.irregularSpacing.values.length?t[2]=r.irregularSpacing.values[e[2]]:t[2]=r.irregularSpacing.values[r.irregularSpacing.values.length-1],r.isPositiveUp||(t[2]*=-1)),new Se.Z({x:t[0],y:t[1],z:t[2],spatialReference:this.spatialReference})}};(0,i._)([(0,u.Cb)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],qe.prototype,"id",void 0),(0,i._)([(0,u.Cb)({type:[Ae],json:{write:{enabled:!0,isRequired:!0}}})],qe.prototype,"dimensions",void 0),(0,i._)([(0,u.Cb)({type:xe.Z,json:{read:{enabled:!1}}})],qe.prototype,"spatialReference",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{read:!1}})],qe.prototype,"zDimension",null),(0,i._)([(0,u.Cb)({type:[Boolean],json:{read:!1}})],qe.prototype,"isValid",null),(0,i._)([(0,u.Cb)({type:[Number],json:{read:!1}})],qe.prototype,"originInLayerSpace3D",null),(0,i._)([(0,u.Cb)({type:[Number],json:{read:!1}})],qe.prototype,"voxelSizeInLayerSpaceSigned",null),(0,i._)([(0,u.Cb)({type:["xyz","xyzt","xyt"],json:{read:{enabled:!1}}})],qe.prototype,"volumeType",null),(0,i._)([(0,u.Cb)({type:[Number],json:{read:!1}})],qe.prototype,"sizeInVoxels",null),qe=(0,i._)([(0,d.j)(Ne)],qe);const De=qe;var Ee;let ze=Ee=class extends R.wq{constructor(){super(...arguments),this.apronWidth=1,this.brickSize=[32,32,32],this.maxLodLevel=0,this.nodeSize=[4,4,4]}isValid(){const e=new Ee;return e.apronWidth===this.apronWidth&&e.maxLodLevel===this.maxLodLevel&&!!this.brickSize&&!!this.nodeSize&&!(!Array.isArray(this.brickSize)||!Array.isArray(this.nodeSize))&&3===this.brickSize.length&&3===this.nodeSize.length&&32===this.brickSize[0]&&32===this.brickSize[1]&&32===this.brickSize[2]&&4===this.nodeSize[0]&&4===this.nodeSize[1]&&4===this.nodeSize[2]}};(0,i._)([(0,u.Cb)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],ze.prototype,"apronWidth",void 0),(0,i._)([(0,u.Cb)({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],ze.prototype,"brickSize",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],ze.prototype,"maxLodLevel",void 0),(0,i._)([(0,u.Cb)({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],ze.prototype,"nodeSize",void 0),ze=Ee=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelVolumeIndex")],ze);const Oe=ze;let Ze=class extends((0,V.J)(R.wq)){constructor(e){super(e),this.enabled=!0,this.label="",this.normal=null,this.point=null}get orientation(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,t]=L(this.normal);return M.BV.normalize((0,p.q9)(e),0,!0)}set orientation(e){const t=k(e,this.tilt);this._set("normal",t),this._set("orientation",e)}get tilt(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,t]=L(this.normal);return M.BV.normalize((0,p.q9)(t),0,!0)}set tilt(e){const t=k(this.orientation,e);this._set("normal",t),this._set("tilt",e)}};(0,i._)([(0,u.Cb)({type:Boolean,json:{default:!0,write:!0}})],Ze.prototype,"enabled",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],Ze.prototype,"label",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),(0,U.p)((e=>M.BV.normalize((0,p.q9)(e),0,!0)))],Ze.prototype,"orientation",null),(0,i._)([(0,u.Cb)({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),(0,U.p)((e=>M.BV.normalize((0,p.q9)(e),0,!0)))],Ze.prototype,"tilt",null),(0,i._)([(0,u.Cb)({type:[Number],json:{write:!0}})],Ze.prototype,"normal",void 0),(0,i._)([(0,u.Cb)({type:[Number],json:{write:!0}})],Ze.prototype,"point",void 0),Ze=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelDynamicSection")],Ze);const Fe=Ze;var Pe;let Le=Pe=class extends R.wq{constructor(e){super(e),this.volumeId=0,this.verticalExaggeration=1,this.exaggerationMode="scale-height",this.verticalOffset=0,this.slices=new(s.Z.ofType($)),this.dynamicSections=new(s.Z.ofType(Fe))}set slices(e){this._set("slices",(0,ne.Z)(e,this._get("slices"),s.Z.ofType($)))}set dynamicSections(e){this._set("dynamicSections",(0,ne.Z)(e,this._get("dynamicSections"),s.Z.ofType(Fe)))}clone(){return new Pe({volumeId:this.volumeId,verticalExaggeration:this.verticalExaggeration,exaggerationMode:this.exaggerationMode,verticalOffset:this.verticalOffset,slices:(0,te.d9)(this.slices),dynamicSections:(0,te.d9)(this.dynamicSections)})}};(0,i._)([(0,u.Cb)({type:p.z8,json:{write:{enabled:!0,isRequired:!0}}})],Le.prototype,"volumeId",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{default:1,write:!0}})],Le.prototype,"verticalExaggeration",void 0),(0,i._)([(0,u.Cb)({type:["scale-position","scale-height"],json:{default:"scale-height",write:!0}})],Le.prototype,"exaggerationMode",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{default:0,write:!0}})],Le.prototype,"verticalOffset",void 0),(0,i._)([(0,u.Cb)({type:s.Z.ofType($),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.slices&&this.slices.length>0}}}}})],Le.prototype,"slices",null),(0,i._)([(0,u.Cb)({type:s.Z.ofType(Fe),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.dynamicSections&&this.dynamicSections.length>0}}}}})],Le.prototype,"dynamicSections",null),Le=Pe=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelVolumeStyle")],Le);const ke=Le;var Ue=r(32163);const Be="esri.layers.VoxelLayer",$e=o.Z.getLogger(Be);let Ke=class extends((0,x.Vt)((0,v.Y)((0,_.q)((0,w.I)((0,S.M)((0,l.R)((0,b.V)(f.Z)))))))){constructor(e){super(e),this.serviceRoot="",this.operationalLayerType="Voxel",this.legendEnabled=!0,this.title=null,this.sections=null,this.currentVariableId=0,this.volumeStyles=null,this.renderMode="volume",this.variableStyles=null,this.enableSlices=!0,this.enableSections=!0,this.enableDynamicSections=!0,this.enableIsosurfaces=!0,this.shading=new W,this.opacity=1,this.variables=new s.Z,this.volumes=new s.Z,this.index=null,this.minScale=0,this.maxScale=0,this.type="voxel",this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.fullExtent=null,this.popupEnabled=!0,this.popupTemplate=null,this.test=null,this.volumeStyles=new(s.Z.ofType(ke)),this.variableStyles=new(s.Z.ofType(we)),this.sections=new(s.Z.ofType(Y)),e?.constantUpscaling&&(this.test={constantUpscaling:!0})}set url(e){this._set("url",(0,C.Nm)(e,$e))}load(e){const t=(0,a.pC)(e)?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(c.r9).then((()=>this._fetchService(t))).then((()=>this.serviceRoot=this.url));return this.addResolvingPromise(r),Promise.resolve(this)}read(e,t){super.read(e,t);for(const e of this.volumes)e.spatialReference=this.spatialReference}readVersion(e,t){return super.parseVersionString(e)}validateLayer(e){if(e.layerType&&e.layerType!==this.operationalLayerType)throw new n.Z("voxel-layer:layer-type-not-supported","VoxelLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor)||this.version.major<3)throw new n.Z("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"});if(this.version.major>3)throw new n.Z("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"})}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const i=g.Z.fromJSON(e,r);if(0===i.zmin&&0===i.zmax&&Array.isArray(t.volumes)){const e=De.fromJSON(t.volumes[0]);if(e.isValid&&"xyt"!==e.volumeType){const t=e.dimensions[2];if(t.isRegular){let e=t.regularSpacing.offset,r=t.regularSpacing.offset+t.regularSpacing.scale*(t.size-1);if(e>r){const t=e;e=r,r=t}i.zmin=e,i.zmax=r}}}return i}return null}get voxelFields(){const e=[new I.Z({name:"Voxel.ServiceValue",alias:"Value",domain:null,editable:!1,length:128,type:"string"}),new I.Z({name:"Voxel.ServiceVariableLabel",alias:"Variable",domain:null,editable:!1,length:128,type:"string"}),new I.Z({name:"Voxel.Position",alias:"Voxel Position",domain:null,editable:!1,length:128,type:"string"})],t=this.getVolume(null);if((0,a.pC)(t)){if("xyzt"===t.volumeType||"xyt"===t.volumeType){const t=new I.Z({name:"Voxel.ServiceLocalTime",alias:"Local Time",domain:null,editable:!1,length:128,type:"string"});e.push(t);const r=new I.Z({name:"Voxel.ServiceNativeTime",alias:"Native Time",domain:null,editable:!1,length:128,type:"string"});e.push(r)}if("xyt"!==t.volumeType){const t=new I.Z({name:"Voxel.ServiceDepth",alias:"Depth",domain:null,editable:!1,length:128,type:"string"});e.push(t)}}return e}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const t=this.voxelFields,r=this.title;return(0,Ue.eZ)({fields:t,title:r},e)}getConfiguration(){const e={layerType:this.operationalLayerType,version:this.version.versionString,name:this.title,spatialReference:this.spatialReference,fullExtent:this.fullExtent,volumes:this.volumes.toJSON(),variables:this.variables.toJSON(),index:this.index?.toJSON(),sections:this.getSections(),style:{volumeStyles:this.getVolumeStyles(),currentVariableId:this.currentVariableId,renderMode:this.renderMode,variableStyles:this.getVariableStyles(),enableSections:this.enableSections,enableDynamicSections:this.enableDynamicSections,enableIsosurfaces:this.enableIsosurfaces,enableSlices:this.enableSlices,shading:this.shading}};return e.index&&this.index?.isValid()?JSON.stringify(e):""}getVariableStyle(e){let t=-1;if(t=(0,a.pC)(e)?e:this.currentVariableId,!this.variableStyles||-1===t)return null;const r=this.variableStyles.findIndex((e=>e.variableId===t));return r<0?null:this.variableStyles.getItemAt(r)}getVariable(e){let t=-1;if(t=(0,a.pC)(e)?e:this.currentVariableId,!this.variables||-1===t)return null;const r=this.variables.findIndex((e=>e.id===t));return r<0?null:this.variables.getItemAt(r)}getVolume(e){const t=this.getVariable(e);return(0,a.pC)(t)?this.volumes.find((({id:e})=>e===t.volumeId)):null}getVolumeStyle(e){const t=this.getVariable(e);return(0,a.pC)(t)?this.volumeStyles.find((({volumeId:e})=>e===t.volumeId)):null}getColorForContinuousDataValue(e,t,r){const i=this.getVariable(e);if((0,a.Wi)(i)||"continuous"!==i.renderingFormat?.continuity)return null;if(!this.variableStyles)return null;const s=this.variableStyles.findIndex((t=>t.variableId===e));if(s<0)return null;const n=this.variableStyles.getItemAt(s);return n.transferFunction?n.transferFunction.getColorForContinuousDataValue(t,r):null}getSections(){const e=[];for(const t of this.sections)e.push(new Y({enabled:t.enabled,href:t.href,id:t.id,label:t.label,normal:t.normal,point:t.point,sizeInPixel:t.sizeInPixel,slices:t.slices,timeId:t.timeId,variableId:t.variableId}));return e}getVariableStyles(){const e=[];for(const t of this.variableStyles){const r=this._getVariable(t);if((0,a.pC)(r)){const i=t.clone();i.isosurfaces.length>4&&(i.isosurfaces=i.isosurfaces.slice(0,3),$e.error("A maximum of 4 isosurfaces are supported for Voxel Layers."));for(const e of i.isosurfaces)if(!e.colorLocked){const t=this.getColorForContinuousDataValue(i.variableId,e.value,!1);null===t||t.equals(e.color)||(e.color=t)}if("continuous"===r.renderingFormat.continuity)(null===i.transferFunction||i.transferFunction.colorStops.length<2)&&$e.error(`VoxelVariableStyle for variable ${r.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),null!==i.transferFunction&&(Array.isArray(i.transferFunction.stretchRange)&&2===i.transferFunction.stretchRange.length||($e.error(`VoxelVariableStyle for variable ${r.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),i.transferFunction.stretchRange=[0,1],i.transferFunction.colorStops.removeAll()));else if("discrete"===r.renderingFormat.continuity)if(0===t.uniqueValues.length)$e.error(`VoxelVariableStyle for variable ${r.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(const e of t.uniqueValues)null!==e.label&&void 0!==e.label||null===e.value||void 0===e.value||(e.label=e.value.toString());e.push(i)}else $e.error(`VoxelVariable ID=${t.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return e}getVolumeStyles(){const e=[];for(const t of this.volumeStyles){const r=this._getVolumeFromVolumeId(t.volumeId);if((0,a.pC)(r)){const i=t.clone();for(const e of i.slices)this._isPlaneValid(e,[0,1,r.zDimension],r.dimensions)||(e.enabled=!1,e.label="invalid");for(const e of i.dynamicSections)this._isPlaneValid(e,[0,1,r.zDimension],r.dimensions)||(e.enabled=!1,e.label="invalid");e.push(i)}else $e.error(`VoxelVolume ID=${t.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return e}_getVariable(e){const t=e.variableId;for(const e of this.variables)if(e.id===t)return e;return null}_getVolumeFromVolumeId(e){for(const t of this.volumes)if(t.id===e)return t;return null}_isPlaneValid(e,t,r){if(!e.point)return!1;if(!Array.isArray(e.point)||3!==e.point.length)return!1;if(!e.normal)return!1;if(!Array.isArray(e.normal)||3!==e.normal.length)return!1;for(let i=0;i<3;++i){const s=e.point[i];if(s<0||s>=r[t[i]].size)return!1}const i=(0,m.f)(e.normal[0],e.normal[1],e.normal[2]);return(0,y.n)(i,i),!(Math.abs(i[0])+Math.abs(i[1])+Math.abs(i[2])<1e-6||(e.normal[0]=i[0],e.normal[1]=i[1],e.normal[2]=i[2],0))}};(0,i._)([(0,u.Cb)({type:["Voxel"]})],Ke.prototype,"operationalLayerType",void 0),(0,i._)([(0,u.Cb)(j.rn)],Ke.prototype,"legendEnabled",void 0),(0,i._)([(0,u.Cb)({json:{write:!0}})],Ke.prototype,"title",void 0),(0,i._)([(0,u.Cb)(j.HQ)],Ke.prototype,"url",null),(0,i._)([(0,u.Cb)({type:s.Z.ofType(Y),json:{origins:{"web-scene":{name:"layerDefinition.sections",write:!0}}}})],Ke.prototype,"sections",void 0),(0,i._)([(0,u.Cb)({type:p.z8,json:{origins:{"web-scene":{name:"layerDefinition.style.currentVariableId",write:{enabled:!0,isRequired:!0,ignoreOrigin:!0}},service:{name:"style.currentVariableId"}}}})],Ke.prototype,"currentVariableId",void 0),(0,i._)([(0,u.Cb)({type:s.Z.ofType(ke),json:{origins:{"web-scene":{name:"layerDefinition.style.volumeStyles",write:!0},service:{name:"style.volumeStyles"}}}})],Ke.prototype,"volumeStyles",void 0),(0,i._)([(0,u.Cb)({type:["volume","surfaces"],json:{origins:{"web-scene":{name:"layerDefinition.style.renderMode",write:!0},service:{name:"style.renderMode"}}}})],Ke.prototype,"renderMode",void 0),(0,i._)([(0,u.Cb)({type:s.Z.ofType(we),json:{origins:{"web-scene":{name:"layerDefinition.style.variableStyles",write:!0},service:{name:"style.variableStyles"}}}})],Ke.prototype,"variableStyles",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSlices",write:!0},service:{name:"style.enableSlices"}}}})],Ke.prototype,"enableSlices",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSections",write:!0},service:{name:"style.enableSections"}}}})],Ke.prototype,"enableSections",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableDynamicSections",write:!0},service:{name:"style.enableDynamicSections"}}}})],Ke.prototype,"enableDynamicSections",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableIsosurfaces",write:!0},service:{name:"style.enableIsosurfaces"}}}})],Ke.prototype,"enableIsosurfaces",void 0),(0,i._)([(0,u.Cb)({type:W,json:{origins:{"web-scene":{name:"layerDefinition.style.shading",write:!0},service:{name:"style.shading"}}}})],Ke.prototype,"shading",void 0),(0,i._)([(0,u.Cb)({type:["show","hide"]})],Ke.prototype,"listMode",void 0),(0,i._)([(0,u.Cb)({type:Number,range:{min:0,max:1},nonNullable:!0,json:{read:!1,write:!1,origins:{"web-scene":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],Ke.prototype,"opacity",void 0),(0,i._)([(0,u.Cb)({type:s.Z.ofType(ee)})],Ke.prototype,"variables",void 0),(0,i._)([(0,u.Cb)({type:s.Z.ofType(De)})],Ke.prototype,"volumes",void 0),(0,i._)([(0,u.Cb)({type:Oe})],Ke.prototype,"index",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{name:"layerDefinition.minScale",read:!1,write:!1,origins:{service:{read:!1,write:!1}}}})],Ke.prototype,"minScale",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{name:"layerDefinition.maxScale",read:!1,write:!1,origins:{service:{read:!1,write:!1}}}})],Ke.prototype,"maxScale",void 0),(0,i._)([(0,u.Cb)({json:{read:!1},readOnly:!0})],Ke.prototype,"type",void 0),(0,i._)([(0,u.Cb)({readOnly:!0,json:{name:"serviceVersion"}})],Ke.prototype,"version",void 0),(0,i._)([(0,h.r)("service","version")],Ke.prototype,"readVersion",null),(0,i._)([(0,u.Cb)({type:g.Z})],Ke.prototype,"fullExtent",void 0),(0,i._)([(0,h.r)("service","fullExtent",["fullExtent"])],Ke.prototype,"readFullExtent",null),(0,i._)([(0,u.Cb)({readOnly:!0,clonable:!1,json:{read:!1}})],Ke.prototype,"voxelFields",null),(0,i._)([(0,u.Cb)(j.C_)],Ke.prototype,"popupEnabled",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],Ke.prototype,"defaultPopupTemplate",null),Ke=(0,i._)([(0,d.j)(Be)],Ke);const Je=Ke},54295:(e,t,r)=>{r.d(t,{V:()=>o});var i=r(43697),s=r(5600),n=(r(75215),r(67676),r(52011));const o=e=>{let t=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i._)([(0,s.Cb)({type:String})],t.prototype,"apiKey",null),t=(0,i._)([(0,n.j)("esri.layers.mixins.APIKeyMixin")],t),t}},17287:(e,t,r)=>{r.d(t,{Y:()=>c});var i=r(43697),s=r(92604),n=r(70586),o=r(5600),a=(r(75215),r(67676),r(52011)),l=r(66677);const c=e=>{let t=class extends e{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,l.Qc)(this.url);if((0,n.pC)(e)&&e.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,l.Nm)(e,s.Z.getLogger(this.declaredClass)))}};return(0,i._)([(0,o.Cb)()],t.prototype,"title",null),(0,i._)([(0,o.Cb)({type:String})],t.prototype,"url",null),t=(0,i._)([(0,a.j)("esri.layers.mixins.ArcGISService")],t),t}},32271:(e,t,r)=>{r.d(t,{xp:()=>Z,Vt:()=>N});var i=r(43697),s=r(3172),n=r(20102),o=(r(80442),r(92604)),a=r(70586),l=r(95330),c=r(17452),u=r(5600),p=(r(75215),r(67676),r(71715)),h=r(52011),d=r(30556),y=r(65845),m=r(6570),g=r(79235),f=r(82971),b=r(66677),v=r(21506),_=r(61064),w=r(65587),S=r(15235),x=r(66643),C=r(41123),j=r(97873);async function I(e,t,r){if(!t||!t.resources)return;const i=t.portalItem===e.portalItem?new Set(e.paths):new Set;e.paths.length=0,e.portalItem=t.portalItem;const s=new Set(t.resources.toKeep.map((e=>e.resource.path))),o=new Set,a=[];s.forEach((t=>{i.delete(t),e.paths.push(t)}));for(const n of t.resources.toUpdate)if(i.delete(n.resource.path),s.has(n.resource.path)||o.has(n.resource.path)){const{resource:t,content:i,finish:s,error:o}=n,l=(0,j.getSiblingOfSameTypeI)(t,(0,C.D)());e.paths.push(l.path),a.push(V({resource:l,content:i,compress:n.compress,finish:s,error:o},r))}else e.paths.push(n.resource.path),a.push(M(n,r)),o.add(n.resource.path);for(const i of t.resources.toAdd)a.push(V(i,r)),e.paths.push(i.resource.path);if(i.forEach((e=>{if(t.portalItem){const r=t.portalItem.resourceFromPath(e);a.push(r.portalItem.removeResource(r).catch((()=>{})))}})),0===a.length)return;const c=await(0,l.as)(a);(0,l.k_)(r);const u=c.filter((e=>"error"in e)).map((e=>e.error));if(u.length>0)throw new n.Z("save:resources","Failed to save one or more resources",{errors:u})}async function V(e,t){const r={...(0,a.pC)(t)?t:{},compress:e.compress},i=await(0,x.q6)(e.resource.portalItem.addResource(e.resource,e.content,r));if(!0!==i.ok)throw e.error?.(i.error),i.error;e.finish?.(e.resource)}async function M(e,t){const r=await(0,x.q6)(e.resource.update(e.content,t));if(!0!==r.ok)throw e.error?.(r.error),r.error;e.finish?.(e.resource)}const R="esri.layers.mixins.SceneService",A=o.Z.getLogger(R),N=e=>{let t=class extends e{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.indexInfo=null,this._debouncedSaveOperations=(0,l.Ds)((async(e,t,r)=>{switch(e){case Z.SAVE:return this._save(t);case Z.SAVE_AS:return this._saveAs(r,t)}}))}readSpatialReference(e,t){return this._readSpatialReference(t)}_readSpatialReference(e){if(null!=e.spatialReference)return f.Z.fromJSON(e.spatialReference);{const t=e.store,r=t.indexCRS||t.geographicCRS,i=r&&parseInt(r.substring(r.lastIndexOf("/")+1,r.length),10);return null!=i?new f.Z(i):null}}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const i=null==e.spatialReference?{...e,spatialReference:this._readSpatialReference(t)}:e;return m.Z.fromJSON(i,r)}const i=t.store,s=this._readSpatialReference(t);return null==s||null==i||null==i.extent||!Array.isArray(i.extent)||i.extent.some((e=>e<T))?null:new m.Z({xmin:i.extent[0],ymin:i.extent[1],xmax:i.extent[2],ymax:i.extent[3],spatialReference:s})}parseVersionString(e){const t={major:Number.NaN,minor:Number.NaN,versionString:e},r=e.split(".");return r.length>=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,i=null!=r.version?r.version.toString():"";return this.parseVersionString(i)}readTitlePortalItem(e){return"item-title"!==this.sublayerTitleMode?void 0:e}readTitleService(e,t){const r=this.portalItem&&this.portalItem.title;if("item-title"===this.sublayerTitleMode)return(0,b.a7)(this.url,t.name);let i=t.name;if(!i&&this.url){const e=(0,b.Qc)(this.url);(0,a.pC)(e)&&(i=e.title)}return"item-title-and-service-name"===this.sublayerTitleMode&&r&&(i=r+" - "+i),(0,b.ld)(i)}set url(e){const t=(0,b.XG)({layer:this,url:e,nonStandardUrlAllowed:!1,logger:A});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,i){(0,b.wH)(this,e,"layers",t,i)}get parsedUrl(){const e=this._get("url"),t=(0,c.mN)(e);return null!=this.layerId&&(t.path=`${t.path}/layers/${this.layerId}`),t}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=(0,_.T)(this.parsedUrl.path,this.rootNode,e,this.apiKey,A,t),null==this.fullExtent||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(e){if("page"===e?.type){const t=e.rootIndex%e.pageSize,r=e.rootPage?.nodes?.[t];if(null==r||null==r.obb||null==r.obb.center||null==r.obb.halfSize)throw new n.Z("sceneservice:invalid-node-page","Invalid node page.");if(r.obb.center[0]<T||null==this.fullExtent||this.fullExtent.hasZ)return;const i=r.obb.halfSize,s=r.obb.center[2],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]);this.fullExtent.zmin=s-o,this.fullExtent.zmax=s+o}else if("node"===e?.type){const t=e.rootNode?.mbs;if(!Array.isArray(t)||4!==t.length||t[0]<T)return;const r=t[2],i=t[3],{fullExtent:s}=this;s&&(s.zmin=r-i,s.zmax=r+i)}}async _fetchService(e){if(null==this.url)throw new n.Z("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const t=await this._fetchFirstLayerId(e);null!=t&&(this.layerId=t)}return this._fetchServiceLayer(e)}async _fetchFirstLayerId(e){const t=await(0,s.default)(this.url,{query:{f:"json",token:this.apiKey},responseType:"json",signal:e});if(t.data&&Array.isArray(t.data.layers)&&t.data.layers.length>0)return t.data.layers[0].id}async _fetchServiceLayer(e){const t=await(0,s.default)(this.parsedUrl?.path??"",{query:{f:"json",token:this.apiKey},responseType:"json",signal:e});t.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));let r=!1;if(t.data.layerType&&"Voxel"===t.data.layerType&&(r=!0),r)return this._fetchVoxelServiceLayer();const i=t.data;this.read(i,this._getServiceContext()),this.validateLayer(i)}async _fetchVoxelServiceLayer(e){const t=(await(0,s.default)(this.parsedUrl?.path+"/layer",{query:{f:"json",token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,this._getServiceContext()),this.validateLayer(t)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&"function"==typeof this.beforeSave&&await this.beforeSave()}validateLayer(e){}_updateTypeKeywords(e,t,r){e.typeKeywords||(e.typeKeywords=[]);const i=t.getTypeKeywords();for(const t of i)e.typeKeywords.push(t);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)),r===D.newItem&&(e.typeKeywords=e.typeKeywords.filter((e=>"Hosted Service"!==e))))}async _saveAs(e,t){const r={...O,...t};let i=S.default.from(e);i||(A.error("_saveAs(): requires a portal item parameter"),await Promise.reject(new n.Z("sceneservice:portal-item-required","_saveAs() requires a portal item to save to"))),i.id&&(i=i.clone(),i.id=null);const s=i.portal||w.Z.getDefault();await this._ensureLoadBeforeSave(),i.type=z,i.portal=s;const o={origin:"portal-item",url:null,messages:[],portal:s,portalItem:i,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},a={layers:[this.write({},o)]};return await Promise.all(o.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(a,o,r),i.url=this.url,i.title||(i.title=this.title),this._updateTypeKeywords(i,r,D.newItem),await s.signIn(),await(s.user?.addItem({item:i,folder:r&&r.folder,data:a})),await I(this.resourceReferences,o,null),this.portalItem=i,(0,y.D)(o),o.portalItem=i,i}async _save(e){const t={...O,...e};if(!this.portalItem)throw A.error("_save(): requires the .portalItem property to be set"),new n.Z("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==z)throw A.error("_save(): Non-matching portal item type. Got "+this.portalItem.type+", expected "+z),new n.Z("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${z}"`);await this._ensureLoadBeforeSave();const r={origin:"portal-item",url:this.portalItem.itemUrl&&(0,c.mN)(this.portalItem.itemUrl),messages:[],portal:this.portalItem.portal||w.Z.getDefault(),portalItem:this.portalItem,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},i={layers:[this.write({},r)]};return await Promise.all(r.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(i,r,t),this.portalItem.url=this.url,this.portalItem.title||(this.portalItem.title=this.title),this._updateTypeKeywords(this.portalItem,t,D.existingItem),await this.portalItem.update({data:i}),await I(this.resourceReferences,r,null),(0,y.D)(r),this.portalItem}async _validateAgainstJSONSchema(e,t,i){let s=t.messages?.filter((e=>"error"===e.type)).map((e=>new n.Z(e.name,e.message,e.details)))??[];if(i&&i.validationOptions?.ignoreUnsupported&&(s=s.filter((e=>"layer:unsupported"!==e.name&&"symbol:unsupported"!==e.name&&"symbol-layer:unsupported"!==e.name&&"property:unsupported"!==e.name&&"url:unsupported"!==e.name&&"scenemodification:unsupported"!==e.name))),i.validationOptions?.enabled||q){const t=(await r.e(5015).then(r.bind(r,25015))).validate(e,i.portalItemLayerType);if(t.length>0){const e=`Layer item did not validate:\n${t.join("\n")}`;if(A.error(`_validateAgainstJSONSchema(): ${e}`),"throw"===i.validationOptions?.failPolicy){const e=t.map((e=>new n.Z("sceneservice:schema-validation",e))).concat(s);throw new n.Z("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{combined:e})}}}if(s.length>0)throw new n.Z("sceneservice:save","Failed to save SceneService due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:s})}};return(0,i._)([(0,u.Cb)(v.id)],t.prototype,"id",void 0),(0,i._)([(0,u.Cb)({type:f.Z})],t.prototype,"spatialReference",void 0),(0,i._)([(0,p.r)("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],t.prototype,"readSpatialReference",null),(0,i._)([(0,u.Cb)({type:m.Z})],t.prototype,"fullExtent",void 0),(0,i._)([(0,p.r)("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],t.prototype,"readFullExtent",null),(0,i._)([(0,u.Cb)({readOnly:!0,type:g.Z})],t.prototype,"heightModelInfo",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],t.prototype,"minScale",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],t.prototype,"maxScale",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"version",void 0),(0,i._)([(0,p.r)("version",["store.version"])],t.prototype,"readVersion",null),(0,i._)([(0,u.Cb)({type:String,json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),(0,i._)([(0,u.Cb)({type:String,json:{read:!1}})],t.prototype,"sublayerTitleMode",void 0),(0,i._)([(0,u.Cb)({type:String})],t.prototype,"title",void 0),(0,i._)([(0,p.r)("portal-item","title")],t.prototype,"readTitlePortalItem",null),(0,i._)([(0,p.r)("service","title",["name"])],t.prototype,"readTitleService",null),(0,i._)([(0,u.Cb)({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],t.prototype,"layerId",void 0),(0,i._)([(0,u.Cb)(v.HQ)],t.prototype,"url",null),(0,i._)([(0,d.c)("url")],t.prototype,"writeUrl",null),(0,i._)([(0,u.Cb)()],t.prototype,"parsedUrl",null),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"store",void 0),(0,i._)([(0,u.Cb)({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],t.prototype,"rootNode",void 0),t=(0,i._)([(0,h.j)(R)],t),t},T=-1e38,q=!1;var D,E;(E=D||(D={}))[E.existingItem=0]="existingItem",E[E.newItem=1]="newItem";const z="Scene Service",O={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};var Z;!function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(Z||(Z={}))},61064:(e,t,r)=>{r.d(t,{T:()=>o});var i=r(3172),s=r(20102),n=r(70586);async function o(e,t,r,o,a,l){let c=null;if((0,n.pC)(r)){const t=`${e}/nodepages/`,s=t+Math.floor(r.rootIndex/r.nodesPerPage);try{return{type:"page",rootPage:(await(0,i.default)(s,{query:{f:"json",token:o},responseType:"json",signal:l})).data,rootIndex:r.rootIndex,pageSize:r.nodesPerPage,lodMetric:r.lodSelectionMetricType,urlPrefix:t}}catch(e){(0,n.pC)(a)&&a.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",s,e),c=e}}if(!t)return null;const u=`${e}/nodes/`,p=u+(t&&t.split("/").pop());try{return{type:"node",rootNode:(await(0,i.default)(p,{query:{f:"json",token:o},responseType:"json",signal:l})).data,urlPrefix:u}}catch(e){throw new s.Z("sceneservice:root-node-missing","Root node missing.",{pageError:c,nodeError:e,url:p})}}},97873:(e,t,r)=>{r.r(t),r.d(t,{addOrUpdateResource:()=>l,contentToBlob:()=>d,fetchResources:()=>a,getSiblingOfSameType:()=>y,getSiblingOfSameTypeI:()=>m,removeAllResources:()=>u,removeResource:()=>c,splitPrefixFileNameAndExtension:()=>h});var i=r(3172),s=r(20102),n=r(70586),o=r(17452);async function a(e,t={},r){await e.load(r);const i=(0,o.v_)(e.itemUrl,"resources"),{start:s=1,num:a=10,sortOrder:l="asc",sortField:c="created"}=t,u={query:{start:s,num:a,sortOrder:l,sortField:c,token:e.apiKey},signal:(0,n.U2)(r,"signal")},p=await e.portal.request(i,u);return{total:p.total,nextStart:p.nextStart,resources:p.resources.map((({created:t,size:r,resource:i})=>({created:new Date(t),size:r,resource:e.resourceFromPath(i)})))}}async function l(e,t,r,i){if(!e.hasPath())throw new s.Z(`portal-item-resource-${t}:invalid-path`,"Resource does not have a valid path");const a=e.portalItem;await a.load(i);const l=(0,o.v_)(a.userItemUrl,"add"===t?"addResources":"updateResources"),[c,u]=p(e.path),h=await d(r),y=new FormData;return c&&"."!==c&&y.append("resourcesPrefix",c),(0,n.pC)(i)&&i.compress&&y.append("compress","true"),y.append("fileName",u),y.append("file",h,u),y.append("f","json"),(0,n.pC)(i)&&i.access&&y.append("access",i.access),await a.portal.request(l,{method:"post",body:y,signal:(0,n.U2)(i,"signal")}),e}async function c(e,t,r){if(!t.hasPath())throw new s.Z("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await e.load(r);const i=(0,o.v_)(e.userItemUrl,"removeResources");await e.portal.request(i,{method:"post",query:{resource:t.path},signal:(0,n.U2)(r,"signal")}),t.portalItem=null}async function u(e,t){await e.load(t);const r=(0,o.v_)(e.userItemUrl,"removeResources");return e.portal.request(r,{method:"post",query:{deleteAll:!0},signal:(0,n.U2)(t,"signal")})}function p(e){const t=e.lastIndexOf("/");return-1===t?[".",e]:[e.slice(0,t),e.slice(t+1)]}function h(e){const[t,r]=function(e){const t=(0,o.Ml)(e);return(0,n.Wi)(t)?[e,""]:[e.slice(0,e.length-t.length-1),`.${t}`]}(e),[i,s]=p(t);return[i,s,r]}async function d(e){return e instanceof Blob?e:(await(0,i.default)(e.url,{responseType:"blob"})).data}function y(e,t){if(!e.hasPath())return null;const[r,,i]=h(e.path);return e.portalItem.resourceFromPath((0,o.v_)(r,t+i))}function m(e,t){if(!e.hasPath())return null;const[r,,i]=h(e.path);return e.portalItem.resourceFromPath((0,o.v_)(r,t+i))}},32163:(e,t,r)=>{r.d(t,{eZ:()=>p});var i=r(51773),s=r(35671),n=r(84649),o=(r(63801),r(48074),r(38745),r(9190)),a=(r(10214),r(71423),r(44951),r(422)),l=r(63061);const c=["oid","global-id"],u=["oid","global-id","guid"];function p({displayField:e,editFieldsInfo:t,fields:r,objectIdField:l,title:c},u){if(!r)return null;const p=function({editFieldsInfo:e,fields:t,objectIdField:r},i){return function(e,t){const r=e;return t&&(e=e.filter((e=>!t.includes(e.type)))),e===r&&(e=e.slice()),e.sort(y),e}(t??[],i?.ignoreFieldTypes||v).map((t=>new a.Z({fieldName:t.name,isEditable:g(t,e),label:t.alias,format:f(t),visible:d(t,{editFieldsInfo:e,objectIdField:r,visibleFieldNames:i?.visibleFieldNames})})))}({editFieldsInfo:t,fields:r,objectIdField:l},u);if(!p.length)return null;const h=function(e){const t=(0,s.O5)(e),{titleBase:r}=e;return t?`${r}: {${t.trim()}}`:r??""}({titleBase:c,fields:r,displayField:e}),m=[new o.Z,new n.Z];return new i.Z({title:h,content:m,fieldInfos:p})}const h=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/shape/i,/perimeter/i,/objectid/i,/_i$/i],d=(e,{editFieldsInfo:t,objectIdField:r,visibleFieldNames:i})=>i?i.has(e.name):!(m(e.name,t)||r&&e.name===r||c.includes(e.type)||h.some((t=>t.test(e.name))));function y(e,t){return"oid"===e.type?-1:"oid"===t.type?1:b(e)?-1:b(t)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((t.alias||t.name).toLocaleLowerCase())}function m(e,t){if(!e||!t)return!1;const{creationDateField:r,creatorField:i,editDateField:s,editorField:n}=t;return[r&&r.toLowerCase(),i&&i.toLowerCase(),s&&s.toLowerCase(),n&&n.toLowerCase()].includes(e.toLowerCase())}function g(e,t){return e.editable&&!u.includes(e.type)&&!m(e.name,t)}function f(e){switch(e.type){case"small-integer":case"integer":case"single":return new l.Z({digitSeparator:!0,places:0});case"double":return new l.Z({digitSeparator:!0,places:2});case"date":return new l.Z({dateFormat:"long-month-day-year"});default:return"string"===e.type&&(0,s.Ec)(e.name)?new l.Z({digitSeparator:!0,places:0}):null}}function b(e){return"name"===(e.name&&e.name.toLowerCase())||"name"===(e.alias&&e.alias.toLowerCase())}const v=["geometry","blob","raster","guid","xml"]}}]);
|