@arcgis/core 4.26.0-next.20230213 → 4.26.0-next.20230214

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{4b41a08d603e846306da.js → 1faf0e2aeabe003e2f64.js} +1 -1
  3. package/assets/esri/core/workers/chunks/8111fc49f8e8f260981d.js +1 -0
  4. package/assets/esri/core/workers/chunks/979d5e22dbdcec90029f.js +1 -0
  5. package/assets/esri/core/workers/chunks/9f8aad19c5973e201604.js +1 -0
  6. package/assets/esri/core/workers/chunks/{21f1d91121d95ef21604.js → bb6e4affafef9855b8fd.js} +1 -1
  7. package/layers/graphics/sources/support/QueryTask.js +1 -1
  8. package/layers/support/rasterFunctions/BaseRasterFunction.js +1 -1
  9. package/layers/support/rasterFunctions/LocalFunction.js +1 -1
  10. package/layers/support/rasterFunctions/LocalFunctionArguments.js +1 -1
  11. package/layers/support/rasterFunctions/localUtils.js +1 -1
  12. package/package.json +1 -1
  13. package/portal/PortalItem.js +1 -1
  14. package/rest/query/executeQuery.js +1 -1
  15. package/support/revision.js +1 -1
  16. package/views/2d/layers/MediaLayerView2D.js +1 -1
  17. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  18. package/views/3d/interactive/Manipulator3D.js +1 -1
  19. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  20. package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
  21. package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
  22. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  23. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  24. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  25. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  26. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  27. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  28. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  29. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  30. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  31. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  32. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  33. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  34. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  35. package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
  36. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  37. package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
  38. package/views/interactive/snapping/Settings.js +1 -1
  39. package/views/interactive/snapping/SnappingAlgorithm.js +1 -1
  40. package/widgets/Editor/EditorViewModel.js +1 -1
  41. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  42. package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
  43. package/widgets/FeatureForm/InputField.js +1 -1
  44. package/assets/esri/core/workers/chunks/52e40e348c27a0e66f9a.js +0 -1
  45. package/assets/esri/core/workers/chunks/8be68f08c270c62e38bb.js +0 -1
  46. package/assets/esri/core/workers/chunks/978220022a8c9a3e9261.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import n from"../../../Color.js";import{JSONSupport as t}from"../../../core/JSONSupport.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";let r=class extends t{constructor(){super(...arguments),this.enabled=!0}};e([i({type:Boolean})],r.prototype,"enabled",void 0),r=e([o("esri.views.interactive.snapping.Settings.DefaultSnappingAlgorithm")],r);let l=class extends t{constructor(e){super(e),this.lineSnapper=new r,this.parallelLineSnapper=new r,this.rightAngleSnapper=new r,this.rightAngleTriangleSnapper=new r,this.shortLineThreshold=15,this.distance=7,this.pointThreshold=1e-6,this.intersectionParallelLineThreshold=1e-6,this.parallelLineThreshold=1e-6,this.touchSensitivityMultiplier=1.5,this.pointOnLineThreshold=1e-6,this.orange=new n([255,127,0]),this.lineHintWidthReference=3,this.lineHintWidthTarget=3,this.lineHintFadedExtensions=.3,this.parallelLineHintWidth=2,this.parallelLineHintLength=24,this.parallelLineHintOffset=1.5,this.rightAngleHintSize=24,this.rightAngleHintOutlineSize=1.5,this.satisfiesConstraintScreenThreshold=1}};e([i({type:r,constructOnly:!0,nonNullable:!0,json:{write:!0}})],l.prototype,"lineSnapper",void 0),e([i({type:r,constructOnly:!0,nonNullable:!0,json:{write:!0}})],l.prototype,"parallelLineSnapper",void 0),e([i({type:r,constructOnly:!0,nonNullable:!0,json:{write:!0}})],l.prototype,"rightAngleSnapper",void 0),e([i({type:r,constructOnly:!0,nonNullable:!0,json:{write:!0}})],l.prototype,"rightAngleTriangleSnapper",void 0),e([i({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],l.prototype,"shortLineThreshold",void 0),e([i({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],l.prototype,"distance",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],l.prototype,"pointThreshold",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],l.prototype,"intersectionParallelLineThreshold",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],l.prototype,"parallelLineThreshold",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],l.prototype,"touchSensitivityMultiplier",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],l.prototype,"pointOnLineThreshold",void 0),e([i({type:n,nonNullable:!0})],l.prototype,"orange",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],l.prototype,"lineHintWidthReference",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],l.prototype,"lineHintWidthTarget",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],l.prototype,"lineHintFadedExtensions",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],l.prototype,"parallelLineHintWidth",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:50},json:{write:!0}})],l.prototype,"parallelLineHintLength",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],l.prototype,"parallelLineHintOffset",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:46},json:{write:!0}})],l.prototype,"rightAngleHintSize",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:6},json:{write:!0}})],l.prototype,"rightAngleHintOutlineSize",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],l.prototype,"satisfiesConstraintScreenThreshold",void 0),l=e([o("esri.views.interactive.snapping.Settings.Defaults")],l);const p=new l;export{p as defaults};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import n from"../../../Color.js";import{JSONSupport as t}from"../../../core/JSONSupport.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";let o=class extends t{constructor(){super(...arguments),this.enabled=!0}};e([i({type:Boolean})],o.prototype,"enabled",void 0),o=e([r("esri.views.interactive.snapping.Settings.DefaultSnappingAlgorithm")],o);let l=class extends t{constructor(e){super(e),this.lineSnapper=new o,this.parallelLineSnapper=new o,this.rightAngleSnapper=new o,this.rightAngleTriangleSnapper=new o,this.shortLineThreshold=15,this.distance=7,this.pointThreshold=1e-6,this.intersectionParallelLineThreshold=1e-6,this.parallelLineThreshold=1e-6,this.verticalLineThreshold=.1,this.touchSensitivityMultiplier=1.5,this.pointOnLineThreshold=1e-6,this.orange=new n([255,127,0]),this.orangeTransparent=new n([255,127,0,.5]),this.lineHintWidthReference=3,this.lineHintWidthTarget=3,this.lineHintFadedExtensions=.3,this.parallelLineHintWidth=2,this.parallelLineHintLength=24,this.parallelLineHintOffset=1.5,this.rightAngleHintSize=24,this.rightAngleHintOutlineSize=1.5,this.satisfiesConstraintScreenThreshold=1}};e([i({type:o,constructOnly:!0,nonNullable:!0,json:{write:!0}})],l.prototype,"lineSnapper",void 0),e([i({type:o,constructOnly:!0,nonNullable:!0,json:{write:!0}})],l.prototype,"parallelLineSnapper",void 0),e([i({type:o,constructOnly:!0,nonNullable:!0,json:{write:!0}})],l.prototype,"rightAngleSnapper",void 0),e([i({type:o,constructOnly:!0,nonNullable:!0,json:{write:!0}})],l.prototype,"rightAngleTriangleSnapper",void 0),e([i({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],l.prototype,"shortLineThreshold",void 0),e([i({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],l.prototype,"distance",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],l.prototype,"pointThreshold",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],l.prototype,"intersectionParallelLineThreshold",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],l.prototype,"parallelLineThreshold",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],l.prototype,"verticalLineThreshold",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],l.prototype,"touchSensitivityMultiplier",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],l.prototype,"pointOnLineThreshold",void 0),e([i({type:n,nonNullable:!0})],l.prototype,"orange",void 0),e([i({type:n,nonNullable:!0})],l.prototype,"orangeTransparent",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],l.prototype,"lineHintWidthReference",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],l.prototype,"lineHintWidthTarget",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],l.prototype,"lineHintFadedExtensions",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],l.prototype,"parallelLineHintWidth",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:50},json:{write:!0}})],l.prototype,"parallelLineHintLength",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],l.prototype,"parallelLineHintOffset",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:46},json:{write:!0}})],l.prototype,"rightAngleHintSize",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:6},json:{write:!0}})],l.prototype,"rightAngleHintOutlineSize",void 0),e([i({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],l.prototype,"satisfiesConstraintScreenThreshold",void 0),l=e([r("esri.views.interactive.snapping.Settings.Defaults")],l);const p=new l;export{p as defaults};
@@ -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{isSome as e}from"../../../core/maybe.js";import{absoluteHeightElevationInfo as t}from"../../../support/elevationInfoUtils.js";import{defaults as s}from"./Settings.js";import{anyMapPointToSnappingPoint as r}from"./SnappingPoint.js";import{squaredScreenDistance as i}from"./snappingUtils.js";import{vectorToScreenPoint as o}from"../support/viewUtils.js";class h{constructor(e,t){this.view=e,this.options=t,this.squaredShortLineThreshold=s.shortLineThreshold*s.shortLineThreshold}snap(t,s){return e(s.vertexHandle)?"vertex"!==s.vertexHandle.type?[]:this.snapExistingVertex(t,s):this.snapNewVertex(t,s)}edgeExceedsShortLineThreshold(e,t){return this.exceedsShortLineThreshold(r(e.leftVertex.pos,this.view,t),r(e.rightVertex.pos,this.view,t),t)}exceedsShortLineThreshold(e,s,{spatialReference:r}){return 0===this.squaredShortLineThreshold||i(o(s,r,t,this.view),o(e,r,t,this.view))>this.squaredShortLineThreshold}squaredProximityThreshold(e){return"touch"===e?this._squaredTouchProximityThreshold:this._squaredMouseProximityTreshold}get _squaredMouseProximityTreshold(){return this.options.distance*this.options.distance}get _squaredTouchProximityThreshold(){const{distance:e,touchSensitivityMultiplier:t}=this.options,s=e*t;return s*s}}export{h as SnappingAlgorithm};
5
+ import{isSome as e}from"../../../core/maybe.js";import{k as t}from"../../../chunks/vec2.js";import{absoluteHeightElevationInfo as s}from"../../../support/elevationInfoUtils.js";import{defaults as r}from"./Settings.js";import{anyMapPointToSnappingPoint as i}from"./SnappingPoint.js";import{squaredScreenDistance as o}from"./snappingUtils.js";import{vectorToScreenPoint as h}from"../support/viewUtils.js";class n{constructor(e,t){this.view=e,this.options=t,this.squaredShortLineThreshold=r.shortLineThreshold*r.shortLineThreshold}snap(t,s){return e(s.vertexHandle)?"vertex"!==s.vertexHandle.type?[]:this.snapExistingVertex(t,s):this.snapNewVertex(t,s)}edgeExceedsShortLineThreshold(e,t){return this.exceedsShortLineThreshold(i(e.leftVertex.pos,this.view,t),i(e.rightVertex.pos,this.view,t),t)}exceedsShortLineThreshold(e,t,{spatialReference:r}){return 0===this.squaredShortLineThreshold||o(h(t,r,s,this.view),h(e,r,s,this.view))>this.squaredShortLineThreshold}isVertical(e,s){return t(e,s)<r.verticalLineThreshold}squaredProximityThreshold(e){return"touch"===e?this._squaredTouchProximityThreshold:this._squaredMouseProximityThreshold}get _squaredMouseProximityThreshold(){return this.options.distance*this.options.distance}get _squaredTouchProximityThreshold(){const{distance:e,touchSensitivityMultiplier:t}=this.options,s=e*t;return s*s}}export{n as SnappingAlgorithm};
@@ -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 a from"../../core/Collection.js";import{deprecated as r}from"../../core/deprecate.js";import i from"../../core/Error.js";import s from"../../core/Evented.js";import{HandleOwnerMixin as o}from"../../core/HandleOwner.js";import n from"../../core/Logger.js";import{abortMaybe as l,isSome as d}from"../../core/maybe.js";import{watch as p,on as c,when as u,whenOnce as h,initial as w}from"../../core/reactiveUtils.js";import{property as f}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import y from"../../layers/GraphicsLayer.js";import{getEffectiveLayerCapabilities as k}from"../../layers/support/layerUtils.js";import g from"../Attachments/AttachmentsViewModel.js";import v from"./CreateFeaturesWorkflow.js";import b from"./CreateWorkflow.js";import{workflowDeprecation as _}from"./deprecationUtils.js";import W from"./UpdateWorkflow.js";import{whenEditorLayerView as C}from"./workflowUtils.js";import F from"../FeatureForm/FeatureFormViewModel.js";import E from"../FeatureTemplates/FeatureTemplatesViewModel.js";import I from"../Sketch/SketchViewModel.js";import O from"../Spinner/SpinnerViewModel.js";const U="esri.widgets.Editor.EditorViewModel",A=n.getLogger(U),V=["create","create-features","update"];function M(t,e,a){A.error(new i(t,e,a))}function j(t,e){return t?t.find((t=>t.layer===e)):void 0}let T=class extends(o(s.EventedAccessor)){constructor(t){super(t),this._sketchGraphicsLayer=new y({listMode:"hide",internal:!0}),this._updateEditableItemsTask=null,this.activeWorkflow=null,this._activityQueue=[],this.editableItems=new a,this.failures=[],this.attachmentsViewModel=new g({abilities:{editing:!0}}),this.featureFormViewModel=new F,this.featureTemplatesViewModel=new E,this.sketchViewModel=new I({layer:this._sketchGraphicsLayer}),this.spinnerViewModel=new O,this.pageStack=[],this.showDiscardPrompt=()=>Promise.resolve(),this._candidateCommitted=!1,this.back=async()=>{const t=this.activeWorkflow;if(t&&this.canGoBack){if(this.hasPendingEdits)try{await this.showDiscardPrompt()}catch(e){return}t.hasPreviousStep?await t.previous({cancelCurrentStep:!0}):await this.cancelWorkflow({force:!0})}},this.save=()=>{const{featureFormViewModel:t}=this;t.submit(),!t.submittable||t.validateContingencyConstraints(t.getValues(),{includeIncompleteViolations:!0}).length>0||this.activeWorkflow?.commit()},this.selectFeature=(t,e=!1)=>{const a=this.activeWorkflow;this._candidateCommitted||"update"!==a?.type||(a.data.edits.feature=t,e&&(a.next(),this._candidateCommitted=!0))}}initialize(){this.handles.add([p((()=>{const t=this.view?.map?.editableLayers.filter((t=>t.visible)),e=this.view?.allLayerViews,a=e?.filter((e=>!!t?.includes(e.layer)));return[t,a,this.layerInfos]}),(()=>this._updateEditableItems()),w),c((()=>this.activeWorkflow),"cancel",(()=>this.emit("workflow-cancel"))),c((()=>this.activeWorkflow),"commit",(()=>this.emit("workflow-commit"))),u((()=>this.view?.map),(t=>{t.add(this._sketchGraphicsLayer)}),w),p((()=>this.editableItems.toArray()),(()=>{const{activeWorkflow:t}=this;if(this.refreshCreationTemplates(),!t)return;const{stepId:e}=t;"create"!==t.type?"update"===t.type&&("awaiting-feature-to-update"===e&&!this.canUpdate||"awaiting-update-feature-candidate"===e&&!t.data.candidates.some((t=>{const e=this.editableItems.find((e=>e.layer===t.layer));return e&&e.supports.includes("update")})))&&this._cancelWorkflow():"awaiting-feature-creation-info"!==e||this.canCreate||this._cancelWorkflow()})),p((()=>this.page),((t,e)=>{const a=this.pageStack.slice(),r=a.indexOf(t);-1===r&&e?a.push(e):a.splice(r),this.pageStack=a})),u((()=>"awaiting-update-feature-candidate"===this.state),(()=>this._candidateCommitted=!1))])}destroy(){this._cancelWorkflow().then((()=>{this.view?.map&&this.view.map.remove(this._sketchGraphicsLayer),this.view=null})),this._updateEditableItemsTask=l(this._updateEditableItemsTask)}get allowedWorkflows(){return this._get("allowedWorkflows")}set allowedWorkflows(t){t&&0!==t.length||(t=[...V]),this._set("allowedWorkflows",t)}get canCreate(){return this.editableItems.some((t=>t.supports.includes("create")))}get canUpdate(){return this.editableItems.some((t=>t.supports.includes("update")||t.supports.includes("delete")||t.attachmentsOnUpdateEnabled))}get labelOptions(){return this.sketchViewModel.labelOptions}set labelOptions(t){this.sketchViewModel.labelOptions=t}set layerInfos(t){t?.some((t=>("allowAttachments"in t&&r(A,"Property: layerInfo.allowAttachments",{replacement:"layerInfo.attachmentsOnCreateEnabled or layerInfo.attachmentsOnUpdateEnabled",version:"4.26"}),!0))),this._set("layerInfos",t)}get snappingOptions(){return this.sketchViewModel.snappingOptions}set snappingOptions(t){this.sketchViewModel.snappingOptions=t}get state(){if(!this.get("view.ready")||0===this.editableItems.length)return"disabled";const t=this.attachmentsViewModel.mode;if("add"===t)return"adding-attachment";if("edit"===t)return"editing-attachment";const{activeWorkflow:e}=this;return e?e.stepId:"ready"}get syncing(){return this._activityQueue.length>0}get updating(){return this.updatingHandles.updating}get tooltipOptions(){return this.sketchViewModel.tooltipOptions}set tooltipOptions(t){this.sketchViewModel.tooltipOptions=t}set view(t){this.sketchViewModel.view=t,this.spinnerViewModel.view=t,this._set("view",t)}get page(){const{activeWorkflow:t,state:e}=this;return"awaiting-feature-to-update"===e||"awaiting-feature-to-create"===e||"create-features"===t?.type&&0===t.pendingFeatures.length?"ready":e??"disabled"}get selectedTemplateItem(){const{activeWorkflow:t}=this;if("create-features"===t?.type&&0===t.pendingFeatures.length){const{template:e}=t.data.creationInfo;for(const t of this.featureTemplatesViewModel.items)if("findByTemplate"in t){const a=t.findByTemplate(e);if(a)return a}else if(t.template===e)return t}}get featureFormDisabled(){const{state:t,activeWorkflow:e}=this;return"editing-existing-feature"===t&&"update"===e?.type&&!1===e?.data.editableItem.attributeUpdatesEnabled}get canGoBack(){return d(this.activeWorkflow)&&!this.syncing}get shouldShowDeleteButton(){const{activeWorkflow:t}=this;return!!t&&"update"===t.type&&t.data.editableItem.supports.includes("delete")}get hasPendingEdits(){const{activeWorkflow:t}=this;return!!t&&("create"===t.type||"create-features"===t.type&&t.numPendingFeatures>0||"editing-existing-feature"===t.stepId&&t.data.edits.modified)}async startCreateWorkflowAtFeatureTypeSelection(){if(_(A,"startCreateWorkflowAtFeatureTypeSelection","startCreateFeaturesWorkflowAtFeatureTypeSelection"),await h((()=>!this.updating)),!this.canCreate)return void M("editing:unsupported-workflow","Create workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createCreateWorkflow();await t.start(),this._set("activeWorkflow",t)}async startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.startCreateFeaturesWorkflow()}async startCreateWorkflowAtFeatureCreation(t){if(_(A,"startCreateWorkflowAtFeatureCreation","startCreateFeaturesWorkflowAtFeatureCreation"),await h((()=>!this.updating)),!this.canCreate)return void M("editing:unsupported-workflow","Create workflow is unsupported or disabled.");await this._cancelWorkflow();const e=this._createCreateWorkflow("awaiting-feature-to-create");e.data.creationInfo=t,await e.start(),this._set("activeWorkflow",e)}async startCreateFeaturesWorkflowAtFeatureCreation(t){return this.startCreateFeaturesWorkflow(t,"creating-features")}async startCreateFeaturesWorkflow(t,e="awaiting-feature-creation-info"){if(await h((()=>!this.updating)),!this.canCreate)throw new i("editing:unsupported-workflow","Creating features is unsupported or disabled.");await this._cancelWorkflow();const a=this._createCreateFeaturesWorkflow(t,e);await a.start(),this._set("activeWorkflow",a)}async startCreateWorkflowAtFeatureEdit(t){if(_(A,"startCreateWorkflowAtFeatureEdit"),await h((()=>!this.updating)),!this.canCreate)return void M("editing:unsupported-workflow","Create workflow is unsupported or disabled.");await this._cancelWorkflow();const e=this._createCreateWorkflow("editing-new-feature");e.data.edits.feature=t,await e.start(),this._set("activeWorkflow",e)}async startUpdateWorkflowAtFeatureSelection(){if(await h((()=>!this.updating)),!this.canUpdate)return void M("editing:unsupported-workflow","Update workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createUpdateWorkflow();await t.start(),this._set("activeWorkflow",t)}async startUpdateWorkflowAtMultipleFeatureSelection(t){if(await h((()=>!this.updating)),!this.canUpdate)return void M("editing:unsupported-workflow","Update workflow is unsupported or disabled.");await this._cancelWorkflow();const e=this._createUpdateWorkflow("awaiting-update-feature-candidate");e.data.candidates=t,await e.start(),this._set("activeWorkflow",e)}async startUpdateWorkflowAtFeatureEdit(t){if(await h((()=>!this.updating)),!this.canUpdate)return void M("editing:unsupported-workflow","Update workflow is unsupported or disabled.");await this._cancelWorkflow();const e=this._createUpdateWorkflow("editing-existing-feature");e.data.edits.feature=t,await e.start(),this._set("activeWorkflow",e)}async deleteFeatureFromWorkflow(){const{activeWorkflow:t}=this;t&&"update"===t.type?(await this._delete(t.data.edits.feature),await t.reset()):M("editing:unsupported-workflow","Deleting requires an active update workflow.")}async cancelWorkflow(t){return this._cancelWorkflow({warn:!0,...t})}findEditableItemForLayer(t){const e="subtype-sublayer"===t.type?t.parent:t;return this.editableItems.find((t=>t.layer===e))}refreshCreationTemplates(){const t=[];for(const{layer:e,supports:a}of this.editableItems)e.loaded&&a.includes("create")&&t.push(e);this.featureTemplatesViewModel.layers=t}async _updateEditableItems(){l(this._updateEditableItemsTask);const t=e((async t=>{const e=this.view?.allLayerViews,r=this.view?.map?.editableLayers;if(!e||!r)return;const i=new Set(r),s=r?.filter((t=>{const e=k(t)?.operations;return!(!t.visible||!e?.supportsAdd||e?.supportsQuery)})),o=e.filter((t=>i.has(t.layer))),n=[];for(const a of o.reverse()){const{layer:t,suspended:e}=a;"subtype-group"===t.type?(await t.loadAll(),n.push(...t.sublayers.slice().reverse().map((t=>this._makeEditableItemForLayer(t,e))))):n.push(this._makeEditableItemForLayer(t,e))}for(const a of s.reverse())"subtype-group"===a.type?(await a.loadAll(),n.push(...a.sublayers.map((t=>this._makeEditableItemForLayer(t,!1))))):n.push(this._makeEditableItemForLayer(a,!1));if(t.aborted)return;const l=this.editableItems;this.editableItems=new a(n),l.destroy()}));this.updatingHandles.addPromise(t.promise),this._updateEditableItemsTask=t}async _cancelWorkflow(t){const e=this.activeWorkflow;if(!e)return void(t&&t.warn&&M("editing:no-active-workflow","There is no active workflow to cancel."));if(!t||!1!==t.force)return this.emit("workflow-cancel"),this._set("activeWorkflow",null),void await e.cancel(t);await e.cancel(t),this._set("activeWorkflow",null)}_createCreateFeaturesWorkflow(t,e){return v.create(this,t,e,((t,e,a)=>this._applyEdits(t,e,a)),((t,e)=>this._addAttachments(t,e)))}_createCreateWorkflow(t){return b.create(this,t,((t,e,a)=>this._applyEdits(t,e,a)))}_createUpdateWorkflow(t){return W.create(this,t,((t,e)=>this._applyEdits(t,e)))}async _delete(t){const e=t?.sourceLayer;e&&"applyEdits"in e&&await this._applyEdits(e,{deleteFeatures:[t]})}_addAttachments(t,e){const a=[];return e?.forEach((e=>a.push(this._addAttachment(t,e.feature,e.attachment)))),Promise.all(a)}async _addAttachment(t,e,a){let r=null;if("geojson"===t.type||"scene"===t.type||"oriented-imagery"===t.type)throw new i("editor:attachments-not-supported","Adding attachments is not supported for this layer type");return await this._queueOperation((async()=>(r=await(t.addAttachment?.(e,a).catch((t=>{throw t?.error||t})))??null,r))),r}async _applyEdits(t,e,a){let r=null;return await this._queueOperation((async()=>{if(k(t)?.operations.supportsQuery){const i=await C(this.view,t);return r=await t.applyEdits(e,a),await h((()=>!i.updating)),r}return r=await t.applyEdits(e,a),r})),r}_queueOperation(t){this._activityQueue.push(t),this.notifyChange("syncing");const e=(t,e)=>{const a=e.indexOf(t);a>-1&&e.splice(a,1)};return t().then((t=>{if("error"in t&&t.error)throw t.error;if("addFeatureResults"in t){const{addFeatureResults:e,deleteFeatureResults:a,updateFeatureResults:r}=t,i=e.find((t=>!!t.error))||r.find((t=>!!t.error))||a.find((t=>!!t.error));if(i)throw i.error}return t})).catch((a=>{M("editing:operation-error","An error occurred.",{error:a});const r={error:a,retry:()=>(e(r,this.failures),this._queueOperation(t)),cancel:()=>{e(r,this.failures)}};this._set("failures",[...this.failures,r])})).then((()=>{e(t,this._activityQueue),this.notifyChange("syncing")}))}_makeEditableItemForLayer(t,e=!0){const a=k(t),r=a?.operations,i=j(this.layerInfos,t),s=this.allowedWorkflows,o=s.includes("create")||s.includes("create-features"),n=s.includes("update"),l=t=>!i||!1!==i.enabled&&!1!==i[t],d=o&&!!r?.supportsAdd&&l("addEnabled"),p=n&&!!r?.supportsUpdate&&l("updateEnabled"),c=n&&!!r?.supportsDelete&&l("deleteEnabled"),u=[];e||(d&&u.push("create"),p&&u.push("update"),c&&u.push("delete"));const h=p&&(!i||!1!==i.attributeUpdatesEnabled),w=p&&!!a?.editing?.supportsGeometryUpdate&&(!i||!1!==i.geometryUpdatesEnabled),f=!(!a?.data?.supportsAttachment||i&&!1===i.allowAttachments);return{layer:t,supports:u,attributeUpdatesEnabled:h,geometryUpdatesEnabled:w,hasAttachments:f,attachmentsOnCreateEnabled:f&&o&&(!i||!1!==i.attachmentsOnCreateEnabled),attachmentsOnUpdateEnabled:f&&(!i||!1!==i.attachmentsOnUpdateEnabled)}}};t([f({readOnly:!0})],T.prototype,"activeWorkflow",void 0),t([f({readOnly:!0})],T.prototype,"_activityQueue",void 0),t([f({value:[...V]})],T.prototype,"allowedWorkflows",null),t([f({readOnly:!0})],T.prototype,"canCreate",null),t([f({readOnly:!0})],T.prototype,"canUpdate",null),t([f()],T.prototype,"editableItems",void 0),t([f({readOnly:!0})],T.prototype,"failures",void 0),t([f()],T.prototype,"attachmentsViewModel",void 0),t([f()],T.prototype,"featureFormViewModel",void 0),t([f()],T.prototype,"featureTemplatesViewModel",void 0),t([f()],T.prototype,"labelOptions",null),t([f()],T.prototype,"layerInfos",null),t([f()],T.prototype,"sketchViewModel",void 0),t([f()],T.prototype,"snappingOptions",null),t([f()],T.prototype,"spinnerViewModel",void 0),t([f()],T.prototype,"state",null),t([f({readOnly:!0})],T.prototype,"syncing",null),t([f()],T.prototype,"updating",null),t([f()],T.prototype,"tooltipOptions",null),t([f()],T.prototype,"view",null),t([f()],T.prototype,"pageStack",void 0),t([f()],T.prototype,"showDiscardPrompt",void 0),t([f()],T.prototype,"_candidateCommitted",void 0),t([f()],T.prototype,"page",null),t([f()],T.prototype,"selectedTemplateItem",null),t([f()],T.prototype,"featureFormDisabled",null),t([f()],T.prototype,"canGoBack",null),t([f()],T.prototype,"shouldShowDeleteButton",null),t([f()],T.prototype,"hasPendingEdits",null),T=t([m(U)],T);const S=T;export{S as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import{createTask as e}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import{deprecated as r}from"../../core/deprecate.js";import i from"../../core/Error.js";import s from"../../core/Evented.js";import{HandleOwnerMixin as o}from"../../core/HandleOwner.js";import n from"../../core/Logger.js";import{abortMaybe as l,isSome as d}from"../../core/maybe.js";import{watch as p,on as c,when as u,whenOnce as h,initial as w}from"../../core/reactiveUtils.js";import{property as f}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import y from"../../layers/GraphicsLayer.js";import{getEffectiveLayerCapabilities as k}from"../../layers/support/layerUtils.js";import g from"../Attachments/AttachmentsViewModel.js";import v from"./CreateFeaturesWorkflow.js";import b from"./CreateWorkflow.js";import{workflowDeprecation as _}from"./deprecationUtils.js";import W from"./UpdateWorkflow.js";import{whenEditorLayerView as C}from"./workflowUtils.js";import F from"../FeatureForm/FeatureFormViewModel.js";import E from"../FeatureTemplates/FeatureTemplatesViewModel.js";import I from"../Sketch/SketchViewModel.js";import O from"../Spinner/SpinnerViewModel.js";const U="esri.widgets.Editor.EditorViewModel",A=n.getLogger(U),V=["create","create-features","update"];function M(t,e,a){A.error(new i(t,e,a))}function j(t,e){return t?t.find((t=>t.layer===e)):void 0}let T=class extends(o(s.EventedAccessor)){constructor(t){super(t),this._sketchGraphicsLayer=new y({listMode:"hide",internal:!0}),this._updateEditableItemsTask=null,this.activeWorkflow=null,this._activityQueue=[],this.editableItems=new a,this.failures=[],this.attachmentsViewModel=new g({abilities:{editing:!0}}),this.featureFormViewModel=new F,this.featureTemplatesViewModel=new E,this.sketchViewModel=new I({layer:this._sketchGraphicsLayer}),this.spinnerViewModel=new O,this.pageStack=[],this.showDiscardPrompt=()=>Promise.resolve(),this._candidateCommitted=!1,this.back=async()=>{const t=this.activeWorkflow;if(t&&this.canGoBack){if(this.hasPendingEdits)try{await this.showDiscardPrompt()}catch(e){return}t.hasPreviousStep?await t.previous({cancelCurrentStep:!0}):await this.cancelWorkflow({force:!0})}},this.save=()=>{const{featureFormViewModel:t}=this;t.submit(),!t.submittable||t.validateContingencyConstraints(t.getValues(),{includeIncompleteViolations:!0}).length>0||this.activeWorkflow?.commit()},this.selectFeature=(t,e=!1)=>{const a=this.activeWorkflow;this._candidateCommitted||"update"!==a?.type||(a.data.edits.feature=t,e&&(a.next(),this._candidateCommitted=!0))}}initialize(){this.handles.add([p((()=>{const t=this.view?.map?.editableLayers.filter((t=>t.visible)),e=this.view?.allLayerViews,a=e?.filter((e=>!!t?.includes(e.layer)));return[t,a,this.layerInfos]}),(()=>this._updateEditableItems()),w),c((()=>this.activeWorkflow),"cancel",(()=>this.emit("workflow-cancel"))),c((()=>this.activeWorkflow),"commit",(()=>this.emit("workflow-commit"))),u((()=>this.view?.map),(t=>{t.add(this._sketchGraphicsLayer)}),w),p((()=>this.editableItems.toArray()),(()=>{const{activeWorkflow:t}=this;if(this.refreshCreationTemplates(),!t)return;const{stepId:e}=t;"create"!==t.type?"update"===t.type&&("awaiting-feature-to-update"===e&&!this.canUpdate||"awaiting-update-feature-candidate"===e&&!t.data.candidates.some((t=>{const e=this.editableItems.find((e=>e.layer===t.layer));return e&&e.supports.includes("update")})))&&this._cancelWorkflow():"awaiting-feature-creation-info"!==e||this.canCreate||this._cancelWorkflow()})),p((()=>this.page),((t,e)=>{const a=this.pageStack.slice(),r=a.indexOf(t);-1===r&&e?a.push(e):a.splice(r),this.pageStack=a})),u((()=>"awaiting-update-feature-candidate"===this.state),(()=>this._candidateCommitted=!1))])}destroy(){this._cancelWorkflow().then((()=>{this.view?.map&&this.view.map.remove(this._sketchGraphicsLayer),this.view=null})),this._updateEditableItemsTask=l(this._updateEditableItemsTask)}get allowedWorkflows(){return this._get("allowedWorkflows")}set allowedWorkflows(t){t&&0!==t.length||(t=[...V]),this._set("allowedWorkflows",t)}get canCreate(){return this.editableItems.some((t=>t.supports.includes("create")))}get canUpdate(){return this.editableItems.some((t=>t.supports.includes("update")||t.supports.includes("delete")||t.attachmentsOnUpdateEnabled))}get labelOptions(){return this.sketchViewModel.labelOptions}set labelOptions(t){this.sketchViewModel.labelOptions=t}set layerInfos(t){t?.some((t=>("allowAttachments"in t&&r(A,"Property: layerInfo.allowAttachments",{replacement:"layerInfo.attachmentsOnCreateEnabled or layerInfo.attachmentsOnUpdateEnabled",version:"4.26"}),!0))),this._set("layerInfos",t)}get snappingOptions(){return this.sketchViewModel.snappingOptions}set snappingOptions(t){this.sketchViewModel.snappingOptions=t}get state(){if(!this.get("view.ready")||0===this.editableItems.length)return"disabled";const t=this.attachmentsViewModel.mode;if("add"===t)return"adding-attachment";if("edit"===t)return"editing-attachment";const{activeWorkflow:e}=this;return e?e.stepId:"ready"}get syncing(){return this._activityQueue.length>0}get updating(){return this.updatingHandles.updating}get tooltipOptions(){return this.sketchViewModel.tooltipOptions}set tooltipOptions(t){this.sketchViewModel.tooltipOptions=t}set view(t){this.sketchViewModel.view=t,this.spinnerViewModel.view=t,this._set("view",t)}get page(){const{activeWorkflow:t,state:e}=this;return"awaiting-feature-to-update"===e||"awaiting-feature-to-create"===e||"create-features"===t?.type&&0===t.pendingFeatures.length?"ready":e??"disabled"}get selectedTemplateItem(){const{activeWorkflow:t}=this;if("create-features"===t?.type&&0===t.pendingFeatures.length){const{template:e}=t.data.creationInfo;for(const t of this.featureTemplatesViewModel.items)if("findByTemplate"in t){const a=t.findByTemplate(e);if(a)return a}else if(t.template===e)return t}}get featureFormDisabled(){const{activeWorkflow:t}=this;return"update"===t?.type&&!1===t?.data.editableItem?.attributeUpdatesEnabled}get canGoBack(){return d(this.activeWorkflow)&&!this.syncing}get shouldShowDeleteButton(){const{activeWorkflow:t}=this;return!!t&&"update"===t.type&&t.data.editableItem.supports.includes("delete")}get hasPendingEdits(){const{activeWorkflow:t}=this;return!!t&&("create"===t.type||"create-features"===t.type&&t.numPendingFeatures>0||"editing-existing-feature"===t.stepId&&t.data.edits.modified)}async startCreateWorkflowAtFeatureTypeSelection(){if(_(A,"startCreateWorkflowAtFeatureTypeSelection","startCreateFeaturesWorkflowAtFeatureTypeSelection"),await h((()=>!this.updating)),!this.canCreate)return void M("editing:unsupported-workflow","Create workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createCreateWorkflow();await t.start(),this._set("activeWorkflow",t)}async startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.startCreateFeaturesWorkflow()}async startCreateWorkflowAtFeatureCreation(t){if(_(A,"startCreateWorkflowAtFeatureCreation","startCreateFeaturesWorkflowAtFeatureCreation"),await h((()=>!this.updating)),!this.canCreate)return void M("editing:unsupported-workflow","Create workflow is unsupported or disabled.");await this._cancelWorkflow();const e=this._createCreateWorkflow("awaiting-feature-to-create");e.data.creationInfo=t,await e.start(),this._set("activeWorkflow",e)}async startCreateFeaturesWorkflowAtFeatureCreation(t){return this.startCreateFeaturesWorkflow(t,"creating-features")}async startCreateFeaturesWorkflow(t,e="awaiting-feature-creation-info"){if(await h((()=>!this.updating)),!this.canCreate)throw new i("editing:unsupported-workflow","Creating features is unsupported or disabled.");await this._cancelWorkflow();const a=this._createCreateFeaturesWorkflow(t,e);await a.start(),this._set("activeWorkflow",a)}async startCreateWorkflowAtFeatureEdit(t){if(_(A,"startCreateWorkflowAtFeatureEdit"),await h((()=>!this.updating)),!this.canCreate)return void M("editing:unsupported-workflow","Create workflow is unsupported or disabled.");await this._cancelWorkflow();const e=this._createCreateWorkflow("editing-new-feature");e.data.edits.feature=t,await e.start(),this._set("activeWorkflow",e)}async startUpdateWorkflowAtFeatureSelection(){if(await h((()=>!this.updating)),!this.canUpdate)return void M("editing:unsupported-workflow","Update workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createUpdateWorkflow();await t.start(),this._set("activeWorkflow",t)}async startUpdateWorkflowAtMultipleFeatureSelection(t){if(await h((()=>!this.updating)),!this.canUpdate)return void M("editing:unsupported-workflow","Update workflow is unsupported or disabled.");await this._cancelWorkflow();const e=this._createUpdateWorkflow("awaiting-update-feature-candidate");e.data.candidates=t,await e.start(),this._set("activeWorkflow",e)}async startUpdateWorkflowAtFeatureEdit(t){if(await h((()=>!this.updating)),!this.canUpdate)return void M("editing:unsupported-workflow","Update workflow is unsupported or disabled.");await this._cancelWorkflow();const e=this._createUpdateWorkflow("editing-existing-feature");e.data.edits.feature=t,await e.start(),this._set("activeWorkflow",e)}async deleteFeatureFromWorkflow(){const{activeWorkflow:t}=this;t&&"update"===t.type?(await this._delete(t.data.edits.feature),await t.reset()):M("editing:unsupported-workflow","Deleting requires an active update workflow.")}async cancelWorkflow(t){return this._cancelWorkflow({warn:!0,...t})}findEditableItemForLayer(t){const e="subtype-sublayer"===t.type?t.parent:t;return this.editableItems.find((t=>t.layer===e))}refreshCreationTemplates(){const t=[];for(const{layer:e,supports:a}of this.editableItems)e.loaded&&a.includes("create")&&t.push(e);this.featureTemplatesViewModel.layers=t}async _updateEditableItems(){l(this._updateEditableItemsTask);const t=e((async t=>{const e=this.view?.allLayerViews,r=this.view?.map?.editableLayers;if(!e||!r)return;const i=new Set(r),s=r?.filter((t=>{const e=k(t)?.operations;return!(!t.visible||!e?.supportsAdd||e?.supportsQuery)})),o=e.filter((t=>i.has(t.layer))),n=[];for(const a of o.reverse()){const{layer:t,suspended:e}=a;"subtype-group"===t.type?(await t.loadAll(),n.push(...t.sublayers.slice().reverse().map((t=>this._makeEditableItemForLayer(t,e))))):n.push(this._makeEditableItemForLayer(t,e))}for(const a of s.reverse())"subtype-group"===a.type?(await a.loadAll(),n.push(...a.sublayers.map((t=>this._makeEditableItemForLayer(t,!1))))):n.push(this._makeEditableItemForLayer(a,!1));if(t.aborted)return;const l=this.editableItems;this.editableItems=new a(n),l.destroy()}));this.updatingHandles.addPromise(t.promise),this._updateEditableItemsTask=t}async _cancelWorkflow(t){const e=this.activeWorkflow;if(!e)return void(t&&t.warn&&M("editing:no-active-workflow","There is no active workflow to cancel."));if(!t||!1!==t.force)return this.emit("workflow-cancel"),this._set("activeWorkflow",null),void await e.cancel(t);await e.cancel(t),this._set("activeWorkflow",null)}_createCreateFeaturesWorkflow(t,e){return v.create(this,t,e,((t,e,a)=>this._applyEdits(t,e,a)),((t,e)=>this._addAttachments(t,e)))}_createCreateWorkflow(t){return b.create(this,t,((t,e,a)=>this._applyEdits(t,e,a)))}_createUpdateWorkflow(t){return W.create(this,t,((t,e)=>this._applyEdits(t,e)))}async _delete(t){const e=t?.sourceLayer;e&&"applyEdits"in e&&await this._applyEdits(e,{deleteFeatures:[t]})}_addAttachments(t,e){const a=[];return e?.forEach((e=>a.push(this._addAttachment(t,e.feature,e.attachment)))),Promise.all(a)}async _addAttachment(t,e,a){let r=null;if("geojson"===t.type||"scene"===t.type||"oriented-imagery"===t.type)throw new i("editor:attachments-not-supported","Adding attachments is not supported for this layer type");return await this._queueOperation((async()=>(r=await(t.addAttachment?.(e,a).catch((t=>{throw t?.error||t})))??null,r))),r}async _applyEdits(t,e,a){let r=null;return await this._queueOperation((async()=>{if(k(t)?.operations.supportsQuery){const i=await C(this.view,t);return r=await t.applyEdits(e,a),await h((()=>!i.updating)),r}return r=await t.applyEdits(e,a),r})),r}_queueOperation(t){this._activityQueue.push(t),this.notifyChange("syncing");const e=(t,e)=>{const a=e.indexOf(t);a>-1&&e.splice(a,1)};return t().then((t=>{if("error"in t&&t.error)throw t.error;if("addFeatureResults"in t){const{addFeatureResults:e,deleteFeatureResults:a,updateFeatureResults:r}=t,i=e.find((t=>!!t.error))||r.find((t=>!!t.error))||a.find((t=>!!t.error));if(i)throw i.error}return t})).catch((a=>{M("editing:operation-error","An error occurred.",{error:a});const r={error:a,retry:()=>(e(r,this.failures),this._queueOperation(t)),cancel:()=>{e(r,this.failures)}};this._set("failures",[...this.failures,r])})).then((()=>{e(t,this._activityQueue),this.notifyChange("syncing")}))}_makeEditableItemForLayer(t,e=!0){const a=k(t),r=a?.operations,i=j(this.layerInfos,t),s=this.allowedWorkflows,o=s.includes("create")||s.includes("create-features"),n=s.includes("update"),l=t=>!i||!1!==i.enabled&&!1!==i[t],d=o&&!!r?.supportsAdd&&l("addEnabled"),p=n&&!!r?.supportsUpdate&&l("updateEnabled"),c=n&&!!r?.supportsDelete&&l("deleteEnabled"),u=[];e||(d&&u.push("create"),p&&u.push("update"),c&&u.push("delete"));const h=p&&(!i||!1!==i.attributeUpdatesEnabled),w=p&&!!a?.editing?.supportsGeometryUpdate&&(!i||!1!==i.geometryUpdatesEnabled),f=!(!a?.data?.supportsAttachment||i&&!1===i.allowAttachments);return{layer:t,supports:u,attributeUpdatesEnabled:h,geometryUpdatesEnabled:w,hasAttachments:f,attachmentsOnCreateEnabled:f&&o&&(!i||!1!==i.attachmentsOnCreateEnabled),attachmentsOnUpdateEnabled:f&&(!i||!1!==i.attachmentsOnUpdateEnabled)}}};t([f({readOnly:!0})],T.prototype,"activeWorkflow",void 0),t([f({readOnly:!0})],T.prototype,"_activityQueue",void 0),t([f({value:[...V]})],T.prototype,"allowedWorkflows",null),t([f({readOnly:!0})],T.prototype,"canCreate",null),t([f({readOnly:!0})],T.prototype,"canUpdate",null),t([f()],T.prototype,"editableItems",void 0),t([f({readOnly:!0})],T.prototype,"failures",void 0),t([f()],T.prototype,"attachmentsViewModel",void 0),t([f()],T.prototype,"featureFormViewModel",void 0),t([f()],T.prototype,"featureTemplatesViewModel",void 0),t([f()],T.prototype,"labelOptions",null),t([f()],T.prototype,"layerInfos",null),t([f()],T.prototype,"sketchViewModel",void 0),t([f()],T.prototype,"snappingOptions",null),t([f()],T.prototype,"spinnerViewModel",void 0),t([f()],T.prototype,"state",null),t([f({readOnly:!0})],T.prototype,"syncing",null),t([f()],T.prototype,"updating",null),t([f()],T.prototype,"tooltipOptions",null),t([f()],T.prototype,"view",null),t([f()],T.prototype,"pageStack",void 0),t([f()],T.prototype,"showDiscardPrompt",void 0),t([f()],T.prototype,"_candidateCommitted",void 0),t([f()],T.prototype,"page",null),t([f()],T.prototype,"selectedTemplateItem",null),t([f()],T.prototype,"featureFormDisabled",null),t([f()],T.prototype,"canGoBack",null),t([f()],T.prototype,"shouldShowDeleteButton",null),t([f()],T.prototype,"hasPendingEdits",null),T=t([m(U)],T);const S=T;export{S as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import"../../intl.js";import s from"../../core/Evented.js";import{HandleOwnerMixin as n}from"../../core/HandleOwner.js";import i from"../../core/Logger.js";import{destroyMaybe as o,isSome as r,isNone as a,unwrap as l}from"../../core/maybe.js";import{EsriPromiseMixin as u}from"../../core/Promise.js";import{watch as p}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 c}from"../../core/accessorSupport/decorators/subclass.js";import f from"../../form/FormTemplate.js";import h from"../../layers/support/ContingentValue.js";import{isEditableLayer as g}from"../../layers/support/editableLayers.js";import m from"../../layers/support/LayerContingentValuesCache.js";import{isGroupField as y,getNormalizedFeatureTypeInfo as _}from"./featureFormUtils.js";import{createFormExpressionArcadeExecutor as F}from"./FormExpressionArcadeExecutor.js";import{FormExpressionsManager as v}from"./FormExpressionsManager.js";import C from"./InputField.js";import E from"./InputFieldGroup.js";import{onLocaleChange as x}from"../../intl/locale.js";import{fetchMessageBundle as I}from"../../intl/messages.js";const V=new t({attributes:{}}),b=["editableExpression","requiredExpression","valueExpression","visibilityExpression"],j=["visibilityExpression"],w="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",A="#JSAPI_CONTINGENT_VALUE_ANY_HASH",M="#JSAPI_CONTINGENT_VALUE_NULL_HASH";let T=class extends(n(u(s.EventedAccessor))){constructor(e){super(e),this._expressionExecutorLookup=new Map,this._expressionLookup=new Map,this._expressionsManager=null,this._contingentValuesCache=null,this._featureClone=V.clone(),this._initialFeature=V.clone(),this.arcadeEditType="NA",this.contingencyConstraintViolations=new Map,this.inputFields=[],this.messages=null,this.strict=!1}initialize(){const e=async()=>{const e=await I("esri/widgets/FeatureForm/t9n/FeatureForm");this.messages=e;for(const t of this.allInputFields)t.messages=e};e();const t=p((()=>[this.layer,this.layer?.loaded,this.formTemplate]),(([e,t])=>{r(e)&&(t?this._updateInputFields():e.load().catch((()=>i.getLogger(this.declaredClass).error("Failed to load layer",e.loadError))))}),{equals:([e,t,s],[n,i,o])=>e===n&&t===i&&s===o,initial:!0}),s=p((()=>this.layer),(e=>{const t="subtype-sublayer"===e?.type?e.parent:"feature"===e?.type?e:null;t&&this.addResolvingPromise(m.createLoadedLayerContingentValuesCache(t).then((e=>{this._contingentValuesCache=e,this.notifyChange("fieldsWithContingentValues")})))}),{initial:!0});this.handles.add([x(e),t,s])}destroy(){this.feature=null,this.layer=null,this._contingentValuesCache=o(this._contingentValuesCache)}get _arcadeContextInfo(){const{_initialFeature:e,arcadeEditType:t,layer:s,spatialReference:n,view:i}=this;return{layer:g(s)?s:null,originalFeature:e,editType:t,spatialReference:n,map:i?.map}}get updating(){return this.updatingHandles.updating}get allInputFields(){return L(this.inputFields)}get _layerFieldsByName(){return new Map(this.layer.fields.map((e=>[e.name,e])))}get feature(){return this._get("feature")}set feature(e){this._featureClone=e?e.clone():V.clone(),this._initialFeature=this._featureClone.clone(),this._resetInputFieldValues(this._featureClone),this.contingencyConstraintViolations.clear(),r(this._expressionsManager)&&(this._expressionsManager.resetExecutors(),this._expressionsManager.feature=this._featureClone,this.updatingHandles.addPromise(this._expressionsManager.evaluateAll().finally((()=>this._afterExpressionsEvaluated())))),this._set("feature",e)}get fieldsWithContingentValues(){if(a(this._contingentValuesCache))return new Set;const e=this._contingentValuesCache.fieldGroups.flatMap((e=>e.fields));return new Set(e)}get formTemplate(){return this.layer&&"formTemplate"in this.layer?this.layer.formTemplate:null}set formTemplate(e){void 0===e?this._clearOverride("formTemplate"):this._override("formTemplate",e)}get joinedContingentValues(){return this._joinContingentValues()}get layer(){return this.feature?.sourceLayer&&"applyEdits"in this.feature.sourceLayer?this.feature.sourceLayer:null}set layer(e){this._override("layer",e)}get spatialReference(){return this.layer?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.messages&&this.get("layer.loaded")?"ready":"disabled"}get submittable(){return!!this.valid||this.allInputFields.filter((e=>!e.valid)).every((({submittable:e})=>e))}get valid(){const e=this.allInputFields;return e.length>0&&e.every((({valid:e})=>e))}findField(e){return this.allInputFields.find((t=>t.name===e))}getValue(e){const{_featureClone:t,layer:s}=this,n=!!s?.getField(e);return t.getAttribute(e)??(n?null:void 0)}setValue(e,t){const{_featureClone:s,strict:n}=this,i=this.findField(e);t=""===t?null:t,i&&s.getAttribute(e)!==t&&(i.value=t,n&&!i.valid||(this._afterValueChange(i),r(this._expressionsManager)&&this.updatingHandles.addPromise(this._expressionsManager.evaluateInvalidated([i.name]).finally((()=>this._afterExpressionsEvaluated())))))}getValues(){return{...this._featureClone.attributes}}submit(){const e=this.allInputFields,t=new Set(e.filter((e=>e.valid)).map((({name:e})=>e))),s=e.filter((e=>!e.valid)).map((({name:e})=>e)),n=this.getValues();if(this.validateContingencyConstraints(n,{includeIncompleteViolations:!0}).length>0)for(const[i,o]of this.contingencyConstraintViolations.entries())"error"===o.type&&(t.delete(i),s.push(i));this.emit("submit",{valid:[...t],invalid:s,values:n})}validateContingencyConstraints(e,t){const{_contingentValuesCache:s}=this,n=new Map;if(this.contingencyConstraintViolations=n,a(s))return[];const{invalid:i,incomplete:o}=s.validateContingencyConstraints(e),r=[...i,...t?.includeIncompleteViolations?o:[]];for(const a of r)for(const e of a.fieldGroup.fields)n.set(e,a);return r}notifyFeatureGeometryChanged(){const{_expressionsManager:e,feature:t,_featureClone:s}=this;s.geometry=t.geometry,r(e)&&this.updatingHandles.addPromise(e.evaluateInvalidatedByGeometry().finally((()=>this._afterExpressionsEvaluated())))}_emitChangeEvent({name:e,valid:t,value:s}){this.emit("value-change",{layer:this.layer,feature:this.feature,fieldName:e,value:s,valid:t})}_updateInputFields(){const{_featureClone:e,_initialFeature:t,formTemplate:s,inputFields:n,messages:i,layer:o}=this,a={feature:e,initialFeature:t,layer:o,messages:i},l=n.slice(),u=r(s)&&s.elements.length>0?this._updateInputFieldsFromElements(l,s.elements,a):this._updateInputFieldsFromLayerFields(l,o?.fields,a);this.inputFields=u}_updateInputFieldsFromElements(e,t,s){const n=new Map;for(const r of e)if(y(r)){N(n,r.groupElement,r);for(const e of r.inputFields)N(n,e.fieldElement,e)}else N(n,r.fieldElement,r);const i=new Map,o=this._updateInputFieldsRecursive({existingInputFieldsByElement:n,updatedElements:t.filter(this._isSupportedElement),sharedInitializationProperties:s,group:null,newExpressionExecutorPromises:i});this.updatingHandles.addPromise(Promise.all(Array.from(i.values())).then((()=>{const e=Array.from(this._expressionExecutorLookup.values()),t=L(o);return this._createExpressionsManager(e,t),l(this._expressionsManager).evaluateAll().finally((()=>this._afterExpressionsEvaluated()))})));for(const[r,a]of n.entries())n.delete(r),a.destroy();return o}_updateInputFieldsRecursive(e){const{existingInputFieldsByElement:t,updatedElements:s,sharedInitializationProperties:n,group:i,newExpressionExecutorPromises:o}=e,r=[];for(const a of s){const e=t.has(a),s=e?t.get(a):S(a)?this._makeInputFieldGroupFromGroupElement(a,n):this._makeInputFieldFromFieldElement(a,n,i);if(r.push(s),e)if(t.delete(a),y(s)){const{feature:e}=n;s.set({feature:e})}else s.set(n);else this._assignExpressionExecutors(s,a,o);if(S(a)){const e=a.elements.filter((e=>this._isSupportedElement(e)));s.inputFields=this._updateInputFieldsRecursive({existingInputFieldsByElement:t,updatedElements:e,sharedInitializationProperties:n,group:s,newExpressionExecutorPromises:o})}}return r}_updateInputFieldsFromLayerFields(e,t,s){if(!Array.isArray(t))return i.getLogger(this.declaredClass).warn(this.declaredClass,"No attribute fields found."),[];const n=new Map;for(const i of e)if(y(i)){for(const e of i.inputFields)e.destroy();i.inputFields.length=0,i.destroy()}else r(i.fieldElement)?i.destroy():n.set(i.field,i);const o=[],{feature:a,initialFeature:l,layer:u,messages:p}=s;for(const i of t){const e=n.get(i)??new C({field:i,feature:a,initialFeature:l,layer:u,messages:p,value:a.getAttribute(i.name)??null});o.push(e),n.delete(i)}for(const[i,r]of n.entries())n.delete(i),r.destroy();return o}_resetInputFieldValues(e){for(const t of this.allInputFields)t.value=e.getAttribute(t.name)}_makeInputFieldFromFieldElement(e,t,s=null){const{feature:n,initialFeature:i,layer:o,messages:r}=t;return new C({fieldElement:e,field:this._layerFieldsByName.get(e.fieldName),value:n.getAttribute(e.fieldName)??null,feature:n,initialFeature:i,layer:o,group:s,messages:r})}_makeInputFieldGroupFromGroupElement(e,t){const{feature:s,initialFeature:n}=t;return new E({groupElement:e,inputFields:[],feature:s,initialFeature:n})}_assignExpressionExecutors(e,t,s){const n=S(t)?j:b,i=[];for(const o of n){const n=t[o],{_expressionExecutorLookup:i}=this;if(r(n)&&""!==n){const t=`${o}Executor`,r=this._expressionLookup.get(n)??this._addToExpressionLookup(n);if(i.has(r))e[t]=i.get(r);else if(s.has(r)){const n=s.get(r).then((s=>(e[t]=s,s)));s.set(r,n)}else{const n=F(r,this.layer).then((s=>(e[t]=s,i.set(r,s),s)));s.set(r,n)}}}return i}_createExpressionsManager(e,t){const{_arcadeContextInfo:s,_featureClone:n}=this;this._expressionsManager=new v({executors:e,feature:n,arcadeContextInfo:s,inputFields:t})}_afterValueChange(e){const{name:t,value:s}=e,{_featureClone:n}=this,i=n.getAttribute(t);n.setAttribute(t,s);const{typeFieldName:o,types:r}=_(this.layer);if(t===o&&s!==i){if("subtype-sublayer"===this.layer.type){const e=this.layer.parent?.findSublayerForFeature(n);n.sourceLayer=this.feature.sourceLayer=e}const e=new Set;for(const t of r)if(t.domains&&"object"==typeof t.domains)for(const s of Object.keys(t.domains))e.add(s);for(const t of e){const e=this.findField(t);e&&e.notifyChange("domain")}}this._emitChangeEvent(e)}_afterExpressionsEvaluated(){const{_featureClone:e}=this;for(const t of this.allInputFields)t.value!==e.getAttribute(t.name)&&this._afterValueChange(t)}_addToExpressionLookup(e){const{_expressionLookup:t,formTemplate:s}=this,n=(r(s)&&r(s.expressionInfos)?Object.values(s.expressionInfos).find((t=>t.name===e)):null)?.expression??e;return t.set(e,n),e!==n&&t.set(n,n),n}_isSupportedElement(e){return"field"===e.type||"group"===e.type||(i.getLogger(this.declaredClass).warn("form-info::unsupported-element-type","Only element types 'field' and 'group' are supported",`Element ${e.label} has unsupported type '${e.type}'`),!1)}_joinContingentValues(){const e=this._contingentValuesCache;if(a(e))return[];const{typeFieldName:t}=_(this.layer),s=t?this.getValue(t):null,n=[];for(const a of e.fieldGroups){const{contingencies:e,fields:t,name:i}=a,o=[];for(const n of e)n.isRetired||r(n.subtype)&&n.subtype.code!==s||o.push({values:n.values});o.length>0&&n.push({name:i,fields:t,contingencies:o})}const[i,o]=this._generateJoinPlan(n);return[...i.flatMap((e=>this._joinFieldGroupContingencies(e))),...o.flatMap((e=>e.contingencies))]}_generateJoinPlan(e){const t=new Map,s=[],n=new Set;for(const l of e)for(const e of l.fields)if(t.has(e)){const i=t.get(e),o=l,r=[i.name,o.name].sort().join("|");if(n.has(r))continue;s.push([i,o]),n.add(r),t.set(e,o)}else t.set(e,l);const i=new Set(s.flat()),o=new Set(e);for(const l of i)o.delete(l);const r=new Map,a=new Map;for(const l of new Set(s.flat())){const e=Symbol(l.name);r.set(e,new Set([l])),a.set(l,e)}for(const[l,u]of s){const e=a.get(l),t=a.get(u);if(e===t)continue;const s=r.get(e),n=r.get(t);for(const i of n)s.add(i),a.set(i,e);r.delete(t)}return[[...r.values()].map((e=>[...e])),[...o]]}_joinFieldGroupContingencies(e){const t=e.slice(),s=t.shift();let n=t.shift(),i=this._generateJoinKey(s.fields,n.fields),o=new Set([...s.fields,...n.fields]),l=new Map;for(const r of s.contingencies){const[e]=this._hashContingency(r,i.codedValueFields,!0);l.has(e)?l.get(e).push(r):l.set(e,[r])}for(;t.length>0;){const e=new Map,s=t.shift(),r=this._generateJoinKey(o,s.fields);for(const t of n.contingencies){const[s,n]=this._hashContingency(t,i.codedValueFields),o=n?this._findMatchingContingenciesWithAnyHashMask(l,s):l.get(s);if(l.has(A)&&o.push(...this._findMatchingContingenciesContainingAny(t,l.get(A),i.codedValueFields)),!a(o))for(const l of o){const s=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(l,t,i.rangeFields):this._joinContingencies(l,t);if(a(s))break;const[n]=this._hashContingency(s,r.codedValueFields,!0);e.has(n)?e.get(n).push(s):e.set(n,[s])}}l=e,n=s,i=r,o=new Set([...o,...n.fields])}const u=[];for(const p of n.contingencies){const[e,t]=this._hashContingency(p,i.codedValueFields),s=t?this._findMatchingContingenciesWithAnyHashMask(l,e):l.get(e);if(l.has(A)&&s.push(...this._findMatchingContingenciesContainingAny(p,l.get(A),i.codedValueFields)),!a(s))for(const n of s){const e=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(n,p,i.rangeFields):this._joinContingencies(n,p);r(e)&&u.push(e)}}return u}_joinContingencies(e,t){const s={values:{...e.values,...t.values}};for(const[n,i]of Object.entries(s.values))"any"===i.objectType&&r(e.values[n])&&(s.values[n]=e.values[n]);return s}_joinContingenciesWithRangeDomains(e,t,s){const n=this._joinContingencies(e,t);for(const i of s){const s=e.values[i],o=t.values[i],{leftIsNull:r,rightIsNull:a,bothAreNull:l,leftIsAny:u,rightIsAny:p,bothAreAny:d,leftIsRange:c,rightIsRange:f}=this._compareObjectTypes(s.objectType,o.objectType);if(l||d)continue;if(r&&p||a&&u){n.values[i]=new h({objectType:"null"});continue}if(r&&f||a&&c)return null;u?(s.minValue=-1/0,s.maxValue=1/0):p&&(o.minValue=-1/0,o.maxValue=1/0);const g=Math.max(s.minValue,o.minValue),m=Math.min(s.maxValue,o.maxValue);if(g>m)return null;n.values[i]=new h({objectType:"range",minValue:g,maxValue:m})}return n}_findMatchingContingenciesContainingAny(e,t,s){return t.filter((t=>s.every((s=>{const n=t.values[s],i=e.values[s];return"any"===n.objectType||"any"===i.objectType||n.codedValue?.code===i.codedValue?.code}))))}_findMatchingContingenciesWithAnyHashMask(e,t){const s=RegExp(`${t}$`),n=[];for(const[i,o]of e){if(i===A)break;s.test(i)&&n.push(...o)}return n}_generateJoinKey(e,t){const s=Array.isArray(e)?new Set(e):e,n=Array.isArray(t)?new Set(t):t,i=s.size<n.size?s:n,o=i===s?n:s,r=new Set,l=new Set;for(const u of i)if(o.has(u)){const e=this.layer.getFieldDomain(u,{feature:this.feature});if(a(e))continue;switch(e.type){case"coded-value":r.add(u);break;case"range":l.add(u)}}return{codedValueFields:[...r],rangeFields:[...l]}}_hashContingency(e,t,s=!1){if(t.length<1)return[w,!1];const n=[];let i=!1;for(const o of t){const t=e.values[o];if("any"===t.objectType){if(s)return[A,!0];i=!0,n.push(`${o}:.*`)}else"null"===t.objectType?n.push(`${o}:${M}`):n.push(`${o}:${t.codedValue?.code}`)}return[n.sort().join("&"),i]}_compareObjectTypes(e,t){return{leftIsNull:"null"===e,rightIsNull:"null"===t,bothAreNull:"null"===e&&"null"===t,leftIsAny:"any"===e,rightIsAny:"any"===t,bothAreAny:"any"===e&&"any"===t,leftIsRange:"range"===e,rightIsRange:"range"===t}}};e([d()],T.prototype,"_featureClone",void 0),e([d()],T.prototype,"_arcadeContextInfo",null),e([d()],T.prototype,"updating",null),e([d({readOnly:!0})],T.prototype,"allInputFields",null),e([d()],T.prototype,"_layerFieldsByName",null),e([d()],T.prototype,"arcadeEditType",void 0),e([d()],T.prototype,"contingencyConstraintViolations",void 0),e([d()],T.prototype,"feature",null),e([d()],T.prototype,"fieldsWithContingentValues",null),e([d({type:f})],T.prototype,"formTemplate",null),e([d()],T.prototype,"inputFields",void 0),e([d()],T.prototype,"joinedContingentValues",null),e([d()],T.prototype,"layer",null),e([d()],T.prototype,"messages",void 0),e([d()],T.prototype,"spatialReference",null),e([d()],T.prototype,"state",null),e([d()],T.prototype,"strict",void 0),e([d()],T.prototype,"submittable",null),e([d()],T.prototype,"valid",null),e([d()],T.prototype,"view",void 0),e([d()],T.prototype,"getValues",null),e([d()],T.prototype,"submit",null),T=e([c("esri.widgets.FeatureForm.FeatureFormViewModel")],T);const S=e=>"group"===e.type,L=e=>e.reduce(((e,t)=>y(t)?[...e,...t.inputFields]:[...e,t]),[]),N=(e,t,s)=>{r(t)&&e.set(t,s)},k=T;export{k as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import"../../intl.js";import s from"../../core/Evented.js";import{HandleOwnerMixin as n}from"../../core/HandleOwner.js";import i from"../../core/Logger.js";import{destroyMaybe as o,isSome as r,isNone as a,unwrap as l}from"../../core/maybe.js";import{EsriPromiseMixin as u}from"../../core/Promise.js";import{watch as p}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 c}from"../../core/accessorSupport/decorators/subclass.js";import f from"../../form/FormTemplate.js";import h from"../../layers/support/ContingentValue.js";import{isEditableLayer as g}from"../../layers/support/editableLayers.js";import m from"../../layers/support/LayerContingentValuesCache.js";import{isGroupField as y,getNormalizedFeatureTypeInfo as _}from"./featureFormUtils.js";import{createFormExpressionArcadeExecutor as F}from"./FormExpressionArcadeExecutor.js";import{FormExpressionsManager as v}from"./FormExpressionsManager.js";import C from"./InputField.js";import E from"./InputFieldGroup.js";import{onLocaleChange as x}from"../../intl/locale.js";import{fetchMessageBundle as I}from"../../intl/messages.js";const V=new t({attributes:{}}),b=["editableExpression","requiredExpression","valueExpression","visibilityExpression"],j=["visibilityExpression"],w="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",A="#JSAPI_CONTINGENT_VALUE_ANY_HASH",M="#JSAPI_CONTINGENT_VALUE_NULL_HASH";let T=class extends(n(u(s.EventedAccessor))){constructor(e){super(e),this._expressionExecutorLookup=new Map,this._expressionLookup=new Map,this._expressionsManager=null,this._contingentValuesCache=null,this._featureClone=V.clone(),this._initialFeature=V.clone(),this.arcadeEditType="NA",this.contingencyConstraintViolations=new Map,this.inputFields=[],this.messages=null,this.strict=!1}initialize(){const e=async()=>{const e=await I("esri/widgets/FeatureForm/t9n/FeatureForm");this.messages=e;for(const t of this.allInputFields)t.messages=e};e();const t=p((()=>[this.layer,this.layer?.loaded,this.formTemplate]),(([e,t])=>{r(e)&&(t?this._updateInputFields():e.load().catch((()=>i.getLogger(this.declaredClass).error("Failed to load layer",e.loadError))))}),{equals:([e,t,s],[n,i,o])=>e===n&&t===i&&s===o,initial:!0}),s=p((()=>this.layer),(e=>{const t="subtype-sublayer"===e?.type?e.parent:"feature"===e?.type?e:null;t&&this.addResolvingPromise(m.createLoadedLayerContingentValuesCache(t).then((e=>{this._contingentValuesCache=e,this.notifyChange("fieldsWithContingentValues")})))}),{initial:!0});this.handles.add([x(e),t,s])}destroy(){this.feature=null,this.layer=null,this._contingentValuesCache=o(this._contingentValuesCache)}get _arcadeContextInfo(){const{_initialFeature:e,arcadeEditType:t,layer:s,spatialReference:n,view:i}=this;return{layer:g(s)?s:null,originalFeature:e,editType:t,spatialReference:n,map:i?.map}}get updating(){return this.updatingHandles.updating}get allInputFields(){return L(this.inputFields)}get _layerFieldsByName(){return new Map(this.layer.fields.map((e=>[e.name,e])))}get feature(){return this._get("feature")}set feature(e){this._featureClone=e?e.clone():V.clone(),this._initialFeature=this._featureClone.clone(),this._resetInputFieldValues(this._featureClone),this.contingencyConstraintViolations.clear(),r(this._expressionsManager)&&(this._expressionsManager.resetExecutors(),this._expressionsManager.feature=this._featureClone,this.updatingHandles.addPromise(this._expressionsManager.evaluateAll().finally((()=>this._afterExpressionsEvaluated())))),this._set("feature",e)}get fieldsWithContingentValues(){if(a(this._contingentValuesCache))return new Set;const e=this._contingentValuesCache.fieldGroups.flatMap((e=>e.fields));return new Set(e)}get formTemplate(){return this.layer&&"formTemplate"in this.layer?this.layer.formTemplate:null}set formTemplate(e){void 0===e?this._clearOverride("formTemplate"):this._override("formTemplate",e)}get joinedContingentValues(){return this._joinContingentValues()}get layer(){return this.feature?.sourceLayer&&"applyEdits"in this.feature.sourceLayer?this.feature.sourceLayer:null}set layer(e){this._override("layer",e)}get spatialReference(){return this.layer?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.messages&&this.get("layer.loaded")?"ready":"disabled"}get submittable(){return!!this.valid||this.allInputFields.filter((e=>!e.valid)).every((({submittable:e})=>e))}get valid(){const e=this.allInputFields;return e.length>0&&e.every((({valid:e})=>e))}findField(e){return this.allInputFields.find((t=>t.name===e))}getValue(e){const{_featureClone:t,layer:s}=this,n=!!s?.getField(e);return t.getAttribute(e)??(n?null:void 0)}setValue(e,t){const{_featureClone:s,strict:n}=this,i=this.findField(e);t=""===t?null:t,i&&s.getAttribute(e)!==t&&(i.value=t,n&&!i.valid||(this._afterValueChange(i),r(this._expressionsManager)&&this.updatingHandles.addPromise(this._expressionsManager.evaluateInvalidated([i.name]).finally((()=>this._afterExpressionsEvaluated())))))}getValues(){return{...this._featureClone.attributes}}submit(){const e=this.allInputFields,t=new Set(e.filter((e=>e.valid)).map((({name:e})=>e))),s=e.filter((e=>!e.valid)).map((({name:e})=>e)),n=this.getValues();if(this.validateContingencyConstraints(n,{includeIncompleteViolations:!0}).length>0)for(const[i,o]of this.contingencyConstraintViolations.entries())"error"===o.type&&(t.delete(i),s.push(i));this.emit("submit",{valid:[...t],invalid:s,values:n})}validateContingencyConstraints(e,t){const{_contingentValuesCache:s}=this,n=new Map;if(this.contingencyConstraintViolations=n,a(s))return[];const{invalid:i,incomplete:o}=s.validateContingencyConstraints(e),r=[...i,...t?.includeIncompleteViolations?o:[]];for(const a of r)for(const e of a.fieldGroup.fields)n.set(e,a);return r}notifyFeatureGeometryChanged(){const{_expressionsManager:e,feature:t,_featureClone:s}=this;s.geometry=t.geometry,r(e)&&this.updatingHandles.addPromise(e.evaluateInvalidatedByGeometry().finally((()=>this._afterExpressionsEvaluated())))}_emitChangeEvent({name:e,valid:t,value:s}){this.emit("value-change",{layer:this.layer,feature:this.feature,fieldName:e,value:s,valid:t})}_updateInputFields(){const{_featureClone:e,_initialFeature:t,arcadeEditType:s,formTemplate:n,inputFields:i,messages:o,layer:a}=this,l={arcadeEditType:s,feature:e,initialFeature:t,layer:a,messages:o},u=i.slice(),p=r(n)&&n.elements.length>0?this._updateInputFieldsFromElements(u,n.elements,l):this._updateInputFieldsFromLayerFields(u,a?.fields,l);this.inputFields=p}_updateInputFieldsFromElements(e,t,s){const n=new Map;for(const r of e)if(y(r)){N(n,r.groupElement,r);for(const e of r.inputFields)N(n,e.fieldElement,e)}else N(n,r.fieldElement,r);const i=new Map,o=this._updateInputFieldsRecursive({existingInputFieldsByElement:n,updatedElements:t.filter(this._isSupportedElement),sharedInitializationProperties:s,group:null,newExpressionExecutorPromises:i});this.updatingHandles.addPromise(Promise.all(Array.from(i.values())).then((()=>{const e=Array.from(this._expressionExecutorLookup.values()),t=L(o);return this._createExpressionsManager(e,t),l(this._expressionsManager).evaluateAll().finally((()=>this._afterExpressionsEvaluated()))})));for(const[r,a]of n.entries())n.delete(r),a.destroy();return o}_updateInputFieldsRecursive(e){const{existingInputFieldsByElement:t,updatedElements:s,sharedInitializationProperties:n,group:i,newExpressionExecutorPromises:o}=e,r=[];for(const a of s){const e=t.has(a),s=e?t.get(a):S(a)?this._makeInputFieldGroupFromGroupElement(a,n):this._makeInputFieldFromFieldElement(a,n,i);if(r.push(s),e)if(t.delete(a),y(s)){const{feature:e}=n;s.set({feature:e})}else s.set(n);else this._assignExpressionExecutors(s,a,o);if(S(a)){const e=a.elements.filter((e=>this._isSupportedElement(e)));s.inputFields=this._updateInputFieldsRecursive({existingInputFieldsByElement:t,updatedElements:e,sharedInitializationProperties:n,group:s,newExpressionExecutorPromises:o})}}return r}_updateInputFieldsFromLayerFields(e,t,s){if(!Array.isArray(t))return i.getLogger(this.declaredClass).warn(this.declaredClass,"No attribute fields found."),[];const n=new Map;for(const i of e)if(y(i)){for(const e of i.inputFields)e.destroy();i.inputFields.length=0,i.destroy()}else r(i.fieldElement)?i.destroy():n.set(i.field,i);const o=[],{arcadeEditType:a,feature:l,initialFeature:u,layer:p,messages:d}=s;for(const i of t){const e=n.get(i)??new C({arcadeEditType:a,field:i,feature:l,initialFeature:u,layer:p,messages:d,value:l.getAttribute(i.name)??null});o.push(e),n.delete(i)}for(const[i,r]of n.entries())n.delete(i),r.destroy();return o}_resetInputFieldValues(e){for(const t of this.allInputFields)t.value=e.getAttribute(t.name)}_makeInputFieldFromFieldElement(e,t,s=null){const{arcadeEditType:n,feature:i,initialFeature:o,layer:r,messages:a}=t;return new C({arcadeEditType:n,fieldElement:e,field:this._layerFieldsByName.get(e.fieldName),value:i.getAttribute(e.fieldName)??null,feature:i,initialFeature:o,layer:r,group:s,messages:a})}_makeInputFieldGroupFromGroupElement(e,t){const{feature:s,initialFeature:n}=t;return new E({groupElement:e,inputFields:[],feature:s,initialFeature:n})}_assignExpressionExecutors(e,t,s){const n=S(t)?j:b,i=[];for(const o of n){const n=t[o],{_expressionExecutorLookup:i}=this;if(r(n)&&""!==n){const t=`${o}Executor`,r=this._expressionLookup.get(n)??this._addToExpressionLookup(n);if(i.has(r))e[t]=i.get(r);else if(s.has(r)){const n=s.get(r).then((s=>(e[t]=s,s)));s.set(r,n)}else{const n=F(r,this.layer).then((s=>(e[t]=s,i.set(r,s),s)));s.set(r,n)}}}return i}_createExpressionsManager(e,t){const{_arcadeContextInfo:s,_featureClone:n}=this;this._expressionsManager=new v({executors:e,feature:n,arcadeContextInfo:s,inputFields:t})}_afterValueChange(e){const{name:t,value:s}=e,{_featureClone:n}=this,i=n.getAttribute(t);n.setAttribute(t,s);const{typeFieldName:o,types:r}=_(this.layer);if(t===o&&s!==i){if("subtype-sublayer"===this.layer.type){const e=this.layer.parent?.findSublayerForFeature(n);n.sourceLayer=this.feature.sourceLayer=e}const e=new Set;for(const t of r)if(t.domains&&"object"==typeof t.domains)for(const s of Object.keys(t.domains))e.add(s);for(const t of e){const e=this.findField(t);e&&e.notifyChange("domain")}}this._emitChangeEvent(e)}_afterExpressionsEvaluated(){const{_featureClone:e}=this;for(const t of this.allInputFields)t.value!==e.getAttribute(t.name)&&this._afterValueChange(t)}_addToExpressionLookup(e){const{_expressionLookup:t,formTemplate:s}=this,n=(r(s)&&r(s.expressionInfos)?Object.values(s.expressionInfos).find((t=>t.name===e)):null)?.expression??e;return t.set(e,n),e!==n&&t.set(n,n),n}_isSupportedElement(e){return"field"===e.type||"group"===e.type||(i.getLogger(this.declaredClass).warn("form-info::unsupported-element-type","Only element types 'field' and 'group' are supported",`Element ${e.label} has unsupported type '${e.type}'`),!1)}_joinContingentValues(){const e=this._contingentValuesCache;if(a(e))return[];const{typeFieldName:t}=_(this.layer),s=t?this.getValue(t):null,n=[];for(const a of e.fieldGroups){const{contingencies:e,fields:t,name:i}=a,o=[];for(const n of e)n.isRetired||r(n.subtype)&&n.subtype.code!==s||o.push({values:n.values});o.length>0&&n.push({name:i,fields:t,contingencies:o})}const[i,o]=this._generateJoinPlan(n);return[...i.flatMap((e=>this._joinFieldGroupContingencies(e))),...o.flatMap((e=>e.contingencies))]}_generateJoinPlan(e){const t=new Map,s=[],n=new Set;for(const l of e)for(const e of l.fields)if(t.has(e)){const i=t.get(e),o=l,r=[i.name,o.name].sort().join("|");if(n.has(r))continue;s.push([i,o]),n.add(r),t.set(e,o)}else t.set(e,l);const i=new Set(s.flat()),o=new Set(e);for(const l of i)o.delete(l);const r=new Map,a=new Map;for(const l of new Set(s.flat())){const e=Symbol(l.name);r.set(e,new Set([l])),a.set(l,e)}for(const[l,u]of s){const e=a.get(l),t=a.get(u);if(e===t)continue;const s=r.get(e),n=r.get(t);for(const i of n)s.add(i),a.set(i,e);r.delete(t)}return[[...r.values()].map((e=>[...e])),[...o]]}_joinFieldGroupContingencies(e){const t=e.slice(),s=t.shift();let n=t.shift(),i=this._generateJoinKey(s.fields,n.fields),o=new Set([...s.fields,...n.fields]),l=new Map;for(const r of s.contingencies){const[e]=this._hashContingency(r,i.codedValueFields,!0);l.has(e)?l.get(e).push(r):l.set(e,[r])}for(;t.length>0;){const e=new Map,s=t.shift(),r=this._generateJoinKey(o,s.fields);for(const t of n.contingencies){const[s,n]=this._hashContingency(t,i.codedValueFields),o=n?this._findMatchingContingenciesWithAnyHashMask(l,s):l.get(s);if(l.has(A)&&o.push(...this._findMatchingContingenciesContainingAny(t,l.get(A),i.codedValueFields)),!a(o))for(const l of o){const s=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(l,t,i.rangeFields):this._joinContingencies(l,t);if(a(s))break;const[n]=this._hashContingency(s,r.codedValueFields,!0);e.has(n)?e.get(n).push(s):e.set(n,[s])}}l=e,n=s,i=r,o=new Set([...o,...n.fields])}const u=[];for(const p of n.contingencies){const[e,t]=this._hashContingency(p,i.codedValueFields),s=t?this._findMatchingContingenciesWithAnyHashMask(l,e):l.get(e);if(l.has(A)&&s.push(...this._findMatchingContingenciesContainingAny(p,l.get(A),i.codedValueFields)),!a(s))for(const n of s){const e=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(n,p,i.rangeFields):this._joinContingencies(n,p);r(e)&&u.push(e)}}return u}_joinContingencies(e,t){const s={values:{...e.values,...t.values}};for(const[n,i]of Object.entries(s.values))"any"===i.objectType&&r(e.values[n])&&(s.values[n]=e.values[n]);return s}_joinContingenciesWithRangeDomains(e,t,s){const n=this._joinContingencies(e,t);for(const i of s){const s=e.values[i],o=t.values[i],{leftIsNull:r,rightIsNull:a,bothAreNull:l,leftIsAny:u,rightIsAny:p,bothAreAny:d,leftIsRange:c,rightIsRange:f}=this._compareObjectTypes(s.objectType,o.objectType);if(l||d)continue;if(r&&p||a&&u){n.values[i]=new h({objectType:"null"});continue}if(r&&f||a&&c)return null;u?(s.minValue=-1/0,s.maxValue=1/0):p&&(o.minValue=-1/0,o.maxValue=1/0);const g=Math.max(s.minValue,o.minValue),m=Math.min(s.maxValue,o.maxValue);if(g>m)return null;n.values[i]=new h({objectType:"range",minValue:g,maxValue:m})}return n}_findMatchingContingenciesContainingAny(e,t,s){return t.filter((t=>s.every((s=>{const n=t.values[s],i=e.values[s];return"any"===n.objectType||"any"===i.objectType||n.codedValue?.code===i.codedValue?.code}))))}_findMatchingContingenciesWithAnyHashMask(e,t){const s=RegExp(`${t}$`),n=[];for(const[i,o]of e){if(i===A)break;s.test(i)&&n.push(...o)}return n}_generateJoinKey(e,t){const s=Array.isArray(e)?new Set(e):e,n=Array.isArray(t)?new Set(t):t,i=s.size<n.size?s:n,o=i===s?n:s,r=new Set,l=new Set;for(const u of i)if(o.has(u)){const e=this.layer.getFieldDomain(u,{feature:this.feature});if(a(e))continue;switch(e.type){case"coded-value":r.add(u);break;case"range":l.add(u)}}return{codedValueFields:[...r],rangeFields:[...l]}}_hashContingency(e,t,s=!1){if(t.length<1)return[w,!1];const n=[];let i=!1;for(const o of t){const t=e.values[o];if("any"===t.objectType){if(s)return[A,!0];i=!0,n.push(`${o}:.*`)}else"null"===t.objectType?n.push(`${o}:${M}`):n.push(`${o}:${t.codedValue?.code}`)}return[n.sort().join("&"),i]}_compareObjectTypes(e,t){return{leftIsNull:"null"===e,rightIsNull:"null"===t,bothAreNull:"null"===e&&"null"===t,leftIsAny:"any"===e,rightIsAny:"any"===t,bothAreAny:"any"===e&&"any"===t,leftIsRange:"range"===e,rightIsRange:"range"===t}}};e([d()],T.prototype,"_featureClone",void 0),e([d()],T.prototype,"_arcadeContextInfo",null),e([d()],T.prototype,"updating",null),e([d({readOnly:!0})],T.prototype,"allInputFields",null),e([d()],T.prototype,"_layerFieldsByName",null),e([d()],T.prototype,"arcadeEditType",void 0),e([d()],T.prototype,"contingencyConstraintViolations",void 0),e([d()],T.prototype,"feature",null),e([d()],T.prototype,"fieldsWithContingentValues",null),e([d({type:f})],T.prototype,"formTemplate",null),e([d()],T.prototype,"inputFields",void 0),e([d()],T.prototype,"joinedContingentValues",null),e([d()],T.prototype,"layer",null),e([d()],T.prototype,"messages",void 0),e([d()],T.prototype,"spatialReference",null),e([d()],T.prototype,"state",null),e([d()],T.prototype,"strict",void 0),e([d()],T.prototype,"submittable",null),e([d()],T.prototype,"valid",null),e([d()],T.prototype,"view",void 0),e([d()],T.prototype,"getValues",null),e([d()],T.prototype,"submit",null),T=e([c("esri.widgets.FeatureForm.FeatureFormViewModel")],T);const S=e=>"group"===e.type,L=e=>e.reduce(((e,t)=>y(t)?[...e,...t.inputFields]:[...e,t]),[]),N=(e,t,s)=>{r(t)&&e.set(t,s)},k=T;export{k as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{getOrCreateMapValue as s}from"../../core/MapUtils.js";import{isSome as r}from"../../core/maybe.js";import{isAbortError as o,createResolver as a}from"../../core/promiseUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";const c="#JSAPI_FORM_EXPRESSIONS_MANAGER_GEOMETRY",l="esri.widgets.FeatureForm.FormExpressionsManager";let p=class extends t{constructor(e){super(e),this._fieldReferencesLookup=new Map,this._fieldsAffectedLookup=new Map,this._latestFieldValues={...e.feature.attributes}}initialize(){this._dependencyGraph=this._buildDependencyGraph()}get _baseContext(){const{editType:e,layer:t,map:s,originalFeature:o,spatialReference:a}=this.arcadeContextInfo,i="feature"===t?.type?t:"scene"===t?.type&&r(t.associatedLayer)?t.associatedLayer:void 0;return[{$originalfeature:o,$editcontext:{editType:e},$layer:i,$featureset:i,$datastore:t?.url,$map:s},{spatialReference:a}]}set feature(e){this._latestFieldValues={...e?.attributes},this._set("feature",e)}evaluateAll(){return this._evaluate(this.executors)}evaluateExpressions(e){return this._evaluate(e)}evaluateInvalidated(e){const{_fieldReferencesLookup:t,_latestFieldValues:s,feature:r}=this,o=new Set;for(const a of e)if(s[a]=r.getAttribute(a),t.has(a))for(const e of t.get(a))o.add(e);return this._evaluate([...o])}async evaluateInvalidatedByGeometry(){if(this._fieldReferencesLookup.has(c))return this._evaluate([...this._fieldReferencesLookup.get(c)])}resetExecutors(){for(const e of this.executors)e.reset()}_buildDependencyGraph(){const{_fieldReferencesLookup:e,_fieldsAffectedLookup:t,executors:o}=this,a=new Map(this.inputFields.map((e=>[e.name,e]))),i=new Map(o.map((e=>[e,new Array])));for(const n of o){for(const o of n.fieldsUsed){s(e,o,(()=>new Set)).add(n);const c=a.get(o),{valueExpressionExecutor:l,editableExpressionExecutor:p}=c;if(r(l)){i.get(l).push(n);s(t,l,(()=>new Set)).add(c)}if(r(p)){i.get(p).push(n);s(t,p,(()=>new Set)).add(c)}}if(n.geometryUsed){s(e,c,(()=>new Set)).add(n)}}return i}async _evaluate(e){const t=new Map,{_dependencyGraph:s,_fieldsAffectedLookup:r,_latestFieldValues:a}=this;for(const o of e)u(o,t,s);for(const[n,{resolver:c,dependencyPromises:l}]of t){Promise.all(l).then((async()=>{const[e,t]=this._makeContext(a);return n.executeAsync(e,t)})).then((()=>{if(r.has(n))for(const e of r.get(n))this._latestFieldValues[e.name]=e.value;c.resolve()}),(e=>{!e||o(e)||f(e)||n.markStale(),c.reject(e)}))}const i=(await Promise.allSettled(Array.from(t.values(),(({resolver:e})=>e.promise)))).filter((e=>"rejected"===e.status&&!(o(e.reason)||f(e.reason))));if(i.length>0)throw new AggregateError(i,"One or more expression executions failed")}_makeContext(e){const[t,s]=this._baseContext,r=this.feature.clone();return r.attributes=e,[{...t,$feature:r},s]}};e([i()],p.prototype,"_baseContext",null),e([i()],p.prototype,"feature",null),e([i()],p.prototype,"executors",void 0),e([i()],p.prototype,"inputFields",void 0),e([i()],p.prototype,"arcadeContextInfo",void 0),p=e([n(l)],p);const u=(e,t,s)=>{if(t.has(e))return;const r=a();t.set(e,{resolver:r,dependencyPromises:[]}),e.abort();const o=s.get(e);for(const a of o)u(a,t,s),t.get(a).dependencyPromises.push(r.promise)},f=e=>e&&"object"==typeof e&&"message"in e&&"Cancelled"===e.message;export{p as FormExpressionsManager};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{getOrCreateMapValue as s}from"../../core/MapUtils.js";import{isSome as r}from"../../core/maybe.js";import{isAbortError as o,createResolver as a}from"../../core/promiseUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";const c="#JSAPI_FORM_EXPRESSIONS_MANAGER_GEOMETRY",l="esri.widgets.FeatureForm.FormExpressionsManager";let p=class extends t{constructor(e){super(e),this._fieldReferencesLookup=new Map,this._fieldsAffectedLookup=new Map,this._latestFieldValues={...e.feature.attributes}}initialize(){this._dependencyGraph=this._buildDependencyGraph()}get _baseContext(){const{editType:e,layer:t,map:s,originalFeature:o,spatialReference:a}=this.arcadeContextInfo,i="feature"===t?.type?t:"scene"===t?.type&&r(t.associatedLayer)?t.associatedLayer:void 0;return[{$originalfeature:o,$editcontext:{editType:e},$layer:i,$featureset:i,$datastore:t?.url,$map:s},{spatialReference:a}]}set feature(e){this._latestFieldValues={...e?.attributes},this._set("feature",e)}evaluateAll(){return this._evaluate(this.executors)}evaluateExpressions(e){return this._evaluate(e)}evaluateInvalidated(e){const{_fieldReferencesLookup:t,_latestFieldValues:s,feature:r}=this,o=new Set;for(const a of e)if(s[a]=r.getAttribute(a),t.has(a))for(const e of t.get(a))o.add(e);return this._evaluate([...o])}async evaluateInvalidatedByGeometry(){if(this._fieldReferencesLookup.has(c))return this._evaluate([...this._fieldReferencesLookup.get(c)])}resetExecutors(){for(const e of this.executors)e.reset()}_buildDependencyGraph(){const{_fieldReferencesLookup:e,_fieldsAffectedLookup:t,executors:o}=this,a=new Map(this.inputFields.map((e=>[e.name,e]))),i=new Map(o.map((e=>[e,new Array])));for(const n of o){for(const o of n.fieldsUsed){s(e,o,(()=>new Set)).add(n);const c=a.get(o),{valueExpressionExecutor:l,editableExpressionExecutor:p}=c;if(r(l)&&l!==n){i.get(l).push(n);s(t,l,(()=>new Set)).add(c)}if(r(p)&&p!==n){i.get(p).push(n);s(t,p,(()=>new Set)).add(c)}}if(n.geometryUsed){s(e,c,(()=>new Set)).add(n)}}return i}async _evaluate(e){const t=new Map,{_dependencyGraph:s,_fieldsAffectedLookup:r,_latestFieldValues:a}=this;for(const o of e)u(o,t,s);for(const[n,{resolver:c,dependencyPromises:l}]of t){Promise.all(l).then((async()=>{const[e,t]=this._makeContext(a);return n.executeAsync(e,t)})).then((()=>{if(r.has(n))for(const e of r.get(n))this._latestFieldValues[e.name]=e.value;c.resolve()}),(e=>{!e||o(e)||f(e)||n.markStale(),c.reject(e)}))}const i=(await Promise.allSettled(Array.from(t.values(),(({resolver:e})=>e.promise)))).filter((e=>"rejected"===e.status&&!(o(e.reason)||f(e.reason))));if(i.length>0)throw new AggregateError(i,"One or more expression executions failed")}_makeContext(e){const[t,s]=this._baseContext,r=this.feature.clone();return r.attributes=e,[{...t,$feature:r},s]}};e([i()],p.prototype,"_baseContext",null),e([i()],p.prototype,"feature",null),e([i()],p.prototype,"executors",void 0),e([i()],p.prototype,"inputFields",void 0),e([i()],p.prototype,"arcadeContextInfo",void 0),p=e([n(l)],p);const u=(e,t,s)=>{if(t.has(e))return;const r=a();t.set(e,{resolver:r,dependencyPromises:[]}),e.abort();const o=s.get(e);for(const a of o)u(a,t,s),t.get(a).dependencyPromises.push(r.promise)},f=e=>e&&"object"==typeof e&&"message"in e&&"Cancelled"===e.message;export{p as FormExpressionsManager};
@@ -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 t from"../../core/Accessor.js";import{HandleOwnerMixin as i}from"../../core/HandleOwner.js";import{isSome as r,unwrap as s,isNone as l,get as o}from"../../core/maybe.js";import{generateUID as n}from"../../core/uid.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{CodedValue as p}from"../../layers/support/CodedValue.js";import"../../core/has.js";import d from"../../layers/support/CodedValueDomain.js";import"../../layers/support/Domain.js";import"../../layers/support/InheritedDomain.js";import"../../layers/support/RangeDomain.js";import{validateDomainValue as m,DomainValidationError as y,getDomainRange as h}from"../../layers/support/domainUtils.js";import{isNumericField as c,isStringField as E,isDateField as f,TypeValidationError as g,validateFieldValue as v,getFeatureEditFields as x,getFeatureGeometryFields as b,NumericRangeValidationError as _,getFieldRange as V}from"../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as O}from"../../layers/support/layerUtils.js";import{getNormalizedFeatureTypeInfo as j,isFieldElementWithInputType as T}from"./featureFormUtils.js";import{substitute as F}from"../../intl/substitute.js";var D,A;!function(e){e.Text="text",e.Number="number",e.Date="date",e.Unsupported="unsupported"}(D||(D={})),function(e){e.TOO_SHORT="length-validation-error::too-short"}(A||(A={}));const N={type:"number"},U={type:"number",intlOptions:{notation:"scientific"}},q={type:"date",intlOptions:{day:"2-digit",month:"2-digit",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}},L="__internal-type-based-coded-value-domain__";function w(e){return e>=1e7||e<=-1e7}let I=class extends(i(t)){constructor(e){super(e),this._storedValue=null,this.editableExpressionExecutor=null,this.id=n().toString(),this.requiredExpressionExecutor=null,this.valueExpressionExecutor=null,this.visibilityExpressionExecutor=null,this.feature=null,this.field=null,this.fieldElement=null,this.layer=null,this.error=null,this.group=null,this.messages=null}get _configAllowsEdits(){const{fieldElement:e,layer:t,name:i}=this;if(r(e))return e.editableExpression?this.evaluatedEditableExpression:!1!==e.editable;if(t.userHasUpdateItemPrivileges)return!0;return("popupTemplate"in t?t?.popupTemplate?.fieldInfos?.find((({fieldName:e})=>e===i)):null)?.isEditable??!0}get _layerFieldAllowsEdits(){const{field:e,layer:t}=this;return!(!t||!e)&&!(!O(t)?.operations.supportsEditing||!e.editable)}get isUsingValueExpression(){return this._shouldUseValueExpression()}get evaluatedEditableExpression(){const{editableExpressionExecutor:e}=this;return r(e)?!!e.lastEvaluatedValue:null}get evaluatedRequiredExpression(){const{requiredExpressionExecutor:e}=this;return r(e)?!!e.lastEvaluatedValue:null}get evaluatedVisibilityExpression(){const{visibilityExpressionExecutor:e}=this;return r(e)?!!e.lastEvaluatedValue:null}get evaluatedValueExpression(){const{valueExpressionExecutor:e}=this;return r(e)?e.lastEvaluatedValue:null}set initialFeature(e){this._set("initialFeature",e),this.notifyChange("valid")}get description(){return s(this.fieldElement)?.description}get domain(){const{layer:e}=this,{typeFieldName:t,types:i}=j(e);if(t===this.name&&l(this.field.domain))return new d({name:L,codedValues:i.map((({code:e,name:t})=>new p({code:e,name:t})))});const{feature:s}=this,n=e.getFieldDomain(this.name,{feature:s}),a=o(this.fieldElement,"domain");return r(a)&&this._isDomainCompatible(a)?a:n}get editable(){return!!this._layerFieldAllowsEdits&&(this.evaluatedEditableExpression??this._configAllowsEdits)}get inputType(){return s(this.fieldElement)?.input?.type}get errorMessage(){return this._toErrorMessage()}get hint(){return s(this.fieldElement)?.hint}get includeTime(){const{fieldElement:e}=this,t=r(e)&&"datetime-picker"===e.input?.type?e.input.includeTime:void 0;return void 0===t||t}get label(){return r(this.fieldElement)&&this.fieldElement.label||this.field.alias||this.field.name}get maxLength(){const e=-1;if(this.type===D.Date)return e;const{field:t,fieldElement:i}=this,r=t?.length,s=R(i)?i.input.maxLength:NaN;return!isNaN(s)&&s>=e&&(r===e||s<=r)?s:r}get minLength(){const e=-1;if(this.type===D.Date)return e;const{field:t,fieldElement:i}=this,r=t?.length,s=R(i)?i.input.minLength:NaN;return!isNaN(s)&&s>=e&&(r===e||s<=r)?s:e}get name(){return this.field?.name}get required(){const{editable:e,evaluatedRequiredExpression:t,field:i,visible:s}=this;return!!e&&(!1===i?.nullable||!(!s||!r(t))&&t)}set required(e){this._overrideIfSome("required",e)}get submittable(){const{field:e,required:t,valid:i,value:r}=this;return(!t||!l(r))&&(!!i||this.initialFeature.getAttribute(e.name)===r)}get type(){const{field:e}=this;return c(e)?D.Number:E(e)?D.Text:f(e)?D.Date:D.Unsupported}get updating(){const{editableExpressionExecutor:e,valueExpressionExecutor:t}=this;return r(t)&&t.updating||r(e)&&e.updating}get valid(){const e=this.editable?this._validate():null;return this._set("error",e),null===e}get value(){if(this._shouldUseValueExpression()){const e=this.evaluatedValueExpression;if(this.type===D.Date){if(e instanceof Date)return e.getTime();if("number"!=typeof e)return parseInt(e,10)}return r(e)&&"object"==typeof e?e.toString():e}return this.get("_storedValue")}set value(e){this.notifyChange("evaluatedVisibilityExpression"),this.set("_storedValue",e)}get visible(){return!this._isEditorField()&&(r(this.evaluatedVisibilityExpression)?this.evaluatedVisibilityExpression:!!r(this.fieldElement)||this._isVisibleByDefault())}_isDomainCompatible(e){const{field:t}=this;if("coded-value"===e?.type){const i=typeof e.codedValues[0].code;if("string"===i&&E(t)||"number"===i&&c(t))return!0}return!!("range"===e?.type&&c(t)||f(t))}_validate(){const{domain:e,field:t,initialFeature:i,minLength:r,required:s,type:l,valid:o,value:n}=this,a=s&&null===n,u=void 0!==o;return!a&&i.getAttribute(t.name)===n&&u?null:a?g.INVALID_TYPE:"text"===l&&r>-1&&"string"==typeof n&&n.length<r?A.TOO_SHORT:e?null!==n||s?m(e,n):null:v(t,n)}_isVisibleByDefault(){const e=this.field?.type;return this.field?.visible&&"oid"!==e&&"global-id"!==e&&!this._isGeometryField()}_isEditorField(){return x(this.layer).includes(this.name)}_isGeometryField(){return b(this.layer).includes(this.name)}_shouldUseValueExpression(){return this._layerFieldAllowsEdits&&!this._configAllowsEdits&&r(this.valueExpressionExecutor)}_toErrorMessage(){const{domain:e,field:t,messages:i,minLength:r,value:s,required:l,type:o}=this,n=this.error;if(l&&null===s)return i.validationErrors.cannotBeNull;if(n===y.VALUE_OUT_OF_RANGE||n===_.OUT_OF_RANGE){const r=h(e)||V(t);return F(i.validationErrors.outsideRange,r,{format:{max:"date"===o?q:w(r.max)?U:N,min:"date"===o?q:w(r.min)?U:N}})}return n===y.INVALID_CODED_VALUE?i.validationErrors.invalidCodedValue:n===g.INVALID_TYPE?i.validationErrors.invalidType:n===A.TOO_SHORT?F(i.validationErrors.tooShort,{min:r}):null}};e([a()],I.prototype,"_storedValue",void 0),e([a()],I.prototype,"_configAllowsEdits",null),e([a()],I.prototype,"_layerFieldAllowsEdits",null),e([a()],I.prototype,"editableExpressionExecutor",void 0),e([a()],I.prototype,"requiredExpressionExecutor",void 0),e([a()],I.prototype,"valueExpressionExecutor",void 0),e([a()],I.prototype,"isUsingValueExpression",null),e([a()],I.prototype,"visibilityExpressionExecutor",void 0),e([a()],I.prototype,"evaluatedEditableExpression",null),e([a()],I.prototype,"evaluatedRequiredExpression",null),e([a()],I.prototype,"evaluatedVisibilityExpression",null),e([a()],I.prototype,"evaluatedValueExpression",null),e([a()],I.prototype,"feature",void 0),e([a()],I.prototype,"field",void 0),e([a({constructOnly:!0})],I.prototype,"fieldElement",void 0),e([a()],I.prototype,"initialFeature",null),e([a()],I.prototype,"layer",void 0),e([a({readOnly:!0})],I.prototype,"description",null),e([a()],I.prototype,"domain",null),e([a()],I.prototype,"editable",null),e([a({readOnly:!0})],I.prototype,"inputType",null),e([a({readOnly:!0})],I.prototype,"error",void 0),e([a({dependsOn:["error","messages","value"]})],I.prototype,"errorMessage",null),e([a()],I.prototype,"group",void 0),e([a({readOnly:!0})],I.prototype,"hint",null),e([a()],I.prototype,"includeTime",null),e([a()],I.prototype,"label",null),e([a()],I.prototype,"maxLength",null),e([a()],I.prototype,"minLength",null),e([a()],I.prototype,"messages",void 0),e([a({readOnly:!0})],I.prototype,"name",null),e([a()],I.prototype,"required",null),e([a()],I.prototype,"submittable",null),e([a()],I.prototype,"type",null),e([a()],I.prototype,"updating",null),e([a()],I.prototype,"valid",null),e([a({value:null})],I.prototype,"value",null),e([a()],I.prototype,"visible",null),I=e([u("esri.widgets.FeatureForm.InputField")],I);const R=e=>r(e)&&(T(e,"text-box")||T(e,"text-area")),S=I;export{S as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import t from"../../core/Accessor.js";import{HandleOwnerMixin as i}from"../../core/HandleOwner.js";import{isSome as r,unwrap as s,isNone as o,get as l}from"../../core/maybe.js";import{generateUID as n}from"../../core/uid.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{CodedValue as p}from"../../layers/support/CodedValue.js";import"../../core/has.js";import d from"../../layers/support/CodedValueDomain.js";import"../../layers/support/Domain.js";import"../../layers/support/InheritedDomain.js";import"../../layers/support/RangeDomain.js";import{validateDomainValue as m,DomainValidationError as y,getDomainRange as h}from"../../layers/support/domainUtils.js";import{isNumericField as c,isStringField as E,isDateField as f,TypeValidationError as g,validateFieldValue as v,getFeatureEditFields as x,getFeatureGeometryFields as b,NumericRangeValidationError as _,getFieldRange as V}from"../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as T}from"../../layers/support/layerUtils.js";import{getNormalizedFeatureTypeInfo as O,isFieldElementWithInputType as j}from"./featureFormUtils.js";import{substitute as D}from"../../intl/substitute.js";var A,F;!function(e){e.Text="text",e.Number="number",e.Date="date",e.Unsupported="unsupported"}(A||(A={})),function(e){e.TOO_SHORT="length-validation-error::too-short"}(F||(F={}));const N={type:"number"},U={type:"number",intlOptions:{notation:"scientific"}},L={type:"date",intlOptions:{day:"2-digit",month:"2-digit",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}},q="__internal-type-based-coded-value-domain__";function w(e){return e>=1e7||e<=-1e7}let I=class extends(i(t)){constructor(e){super(e),this._storedValue=null,this.arcadeEditType="NA",this.editableExpressionExecutor=null,this.id=n().toString(),this.requiredExpressionExecutor=null,this.valueExpressionExecutor=null,this.visibilityExpressionExecutor=null,this.feature=null,this.field=null,this.fieldElement=null,this.layer=null,this.error=null,this.group=null,this.messages=null}get _configAllowsEdits(){const{fieldElement:e,layer:t,name:i}=this;if(r(e))return e.editableExpression?this.evaluatedEditableExpression:!1!==e.editable;if(t.userHasUpdateItemPrivileges)return!0;return("popupTemplate"in t?t?.popupTemplate?.fieldInfos?.find((({fieldName:e})=>e===i)):null)?.isEditable??!0}get _layerFieldAllowsEdits(){const{field:e,layer:t}=this;if(!t||!e)return!1;const i=T(t),r=i?.operations.supportsEditing,s=e.editable,o=R(i,this.arcadeEditType);return!!(r&&s&&o)}get isUsingValueExpression(){return this._shouldUseValueExpression()}get evaluatedEditableExpression(){const{editableExpressionExecutor:e}=this;return r(e)?!!e.lastEvaluatedValue:null}get evaluatedRequiredExpression(){const{requiredExpressionExecutor:e}=this;return r(e)?!!e.lastEvaluatedValue:null}get evaluatedVisibilityExpression(){const{visibilityExpressionExecutor:e}=this;return r(e)?!!e.lastEvaluatedValue:null}get evaluatedValueExpression(){const{valueExpressionExecutor:e}=this;return r(e)?e.lastEvaluatedValue:null}set initialFeature(e){this._set("initialFeature",e),this.notifyChange("valid")}get description(){return s(this.fieldElement)?.description}get domain(){const{layer:e}=this,{typeFieldName:t,types:i}=O(e);if(t===this.name&&o(this.field.domain))return new d({name:q,codedValues:i.map((({code:e,name:t})=>new p({code:e,name:t})))});const{feature:s}=this,n=e.getFieldDomain(this.name,{feature:s}),a=l(this.fieldElement,"domain");return r(a)&&this._isDomainCompatible(a)?a:n}get editable(){return!!this._layerFieldAllowsEdits&&(this.evaluatedEditableExpression??this._configAllowsEdits)}get inputType(){return s(this.fieldElement)?.input?.type}get errorMessage(){return this._toErrorMessage()}get hint(){return s(this.fieldElement)?.hint}get includeTime(){const{fieldElement:e}=this,t=r(e)&&"datetime-picker"===e.input?.type?e.input.includeTime:void 0;return void 0===t||t}get label(){return r(this.fieldElement)&&this.fieldElement.label||this.field.alias||this.field.name}get maxLength(){const e=-1;if(this.type===A.Date)return e;const{field:t,fieldElement:i}=this,r=t?.length,s=S(i)?i.input.maxLength:NaN;return!isNaN(s)&&s>=e&&(r===e||s<=r)?s:r}get minLength(){const e=-1;if(this.type===A.Date)return e;const{field:t,fieldElement:i}=this,r=t?.length,s=S(i)?i.input.minLength:NaN;return!isNaN(s)&&s>=e&&(r===e||s<=r)?s:e}get name(){return this.field?.name}get required(){const{editable:e,evaluatedRequiredExpression:t,field:i,visible:s}=this;return!!e&&(!1===i?.nullable||!(!s||!r(t))&&t)}set required(e){this._overrideIfSome("required",e)}get submittable(){const{field:e,required:t,valid:i,value:r}=this;return(!t||!o(r))&&(!!i||this.initialFeature.getAttribute(e.name)===r)}get type(){const{field:e}=this;return c(e)?A.Number:E(e)?A.Text:f(e)?A.Date:A.Unsupported}get updating(){const{editableExpressionExecutor:e,valueExpressionExecutor:t}=this;return r(t)&&t.updating||r(e)&&e.updating}get valid(){const e=this.editable?this._validate():null;return this._set("error",e),null===e}get value(){if(this._shouldUseValueExpression()){const e=this.evaluatedValueExpression;if(this.type===A.Date){if(e instanceof Date)return e.getTime();if("number"!=typeof e)return parseInt(e,10)}return r(e)&&"object"==typeof e?e.toString():e}return this.get("_storedValue")}set value(e){this.notifyChange("evaluatedVisibilityExpression"),this.set("_storedValue",e)}get visible(){return!this._isEditorField()&&(r(this.evaluatedVisibilityExpression)?this.evaluatedVisibilityExpression:!!r(this.fieldElement)||this._isVisibleByDefault())}_isDomainCompatible(e){const{field:t}=this;if("coded-value"===e?.type){const i=typeof e.codedValues[0].code;if("string"===i&&E(t)||"number"===i&&c(t))return!0}return!!("range"===e?.type&&c(t)||f(t))}_validate(){const{domain:e,field:t,initialFeature:i,minLength:r,required:s,type:o,valid:l,value:n}=this,a=s&&null===n,u=void 0!==l;return!a&&i.getAttribute(t.name)===n&&u?null:a?g.INVALID_TYPE:"text"===o&&r>-1&&"string"==typeof n&&n.length<r?F.TOO_SHORT:e?null!==n||s?m(e,n):null:v(t,n)}_isVisibleByDefault(){const e=this.field?.type;return this.field?.visible&&"oid"!==e&&"global-id"!==e&&!this._isGeometryField()}_isEditorField(){return x(this.layer).includes(this.name)}_isGeometryField(){return b(this.layer).includes(this.name)}_shouldUseValueExpression(){return this._layerFieldAllowsEdits&&!this._configAllowsEdits&&r(this.valueExpressionExecutor)}_toErrorMessage(){const{domain:e,field:t,messages:i,minLength:r,value:s,required:o,type:l}=this,n=this.error;if(o&&null===s)return i.validationErrors.cannotBeNull;if(n===y.VALUE_OUT_OF_RANGE||n===_.OUT_OF_RANGE){const r=h(e)||V(t);return D(i.validationErrors.outsideRange,r,{format:{max:"date"===l?L:w(r.max)?U:N,min:"date"===l?L:w(r.min)?U:N}})}return n===y.INVALID_CODED_VALUE?i.validationErrors.invalidCodedValue:n===g.INVALID_TYPE?i.validationErrors.invalidType:n===F.TOO_SHORT?D(i.validationErrors.tooShort,{min:r}):null}};e([a()],I.prototype,"_storedValue",void 0),e([a()],I.prototype,"_configAllowsEdits",null),e([a()],I.prototype,"_layerFieldAllowsEdits",null),e([a()],I.prototype,"arcadeEditType",void 0),e([a()],I.prototype,"editableExpressionExecutor",void 0),e([a()],I.prototype,"requiredExpressionExecutor",void 0),e([a()],I.prototype,"valueExpressionExecutor",void 0),e([a()],I.prototype,"isUsingValueExpression",null),e([a()],I.prototype,"visibilityExpressionExecutor",void 0),e([a()],I.prototype,"evaluatedEditableExpression",null),e([a()],I.prototype,"evaluatedRequiredExpression",null),e([a()],I.prototype,"evaluatedVisibilityExpression",null),e([a()],I.prototype,"evaluatedValueExpression",null),e([a()],I.prototype,"feature",void 0),e([a()],I.prototype,"field",void 0),e([a({constructOnly:!0})],I.prototype,"fieldElement",void 0),e([a()],I.prototype,"initialFeature",null),e([a()],I.prototype,"layer",void 0),e([a({readOnly:!0})],I.prototype,"description",null),e([a()],I.prototype,"domain",null),e([a()],I.prototype,"editable",null),e([a({readOnly:!0})],I.prototype,"inputType",null),e([a({readOnly:!0})],I.prototype,"error",void 0),e([a({dependsOn:["error","messages","value"]})],I.prototype,"errorMessage",null),e([a()],I.prototype,"group",void 0),e([a({readOnly:!0})],I.prototype,"hint",null),e([a()],I.prototype,"includeTime",null),e([a()],I.prototype,"label",null),e([a()],I.prototype,"maxLength",null),e([a()],I.prototype,"minLength",null),e([a()],I.prototype,"messages",void 0),e([a({readOnly:!0})],I.prototype,"name",null),e([a()],I.prototype,"required",null),e([a()],I.prototype,"submittable",null),e([a()],I.prototype,"type",null),e([a()],I.prototype,"updating",null),e([a()],I.prototype,"valid",null),e([a({value:null})],I.prototype,"value",null),e([a()],I.prototype,"visible",null),I=e([u("esri.widgets.FeatureForm.InputField")],I);const R=(e,t)=>{if(!e)return!0;const{operations:i}=e;switch(t){case"INSERT":return i.supportsAdd;case"UPDATE":case"DELETE":return i.supportsUpdate;default:return!0}},S=e=>r(e)&&(j(e,"text-box")||j(e,"text-area")),C=I;export{C as default};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6368],{57435:(e,t,r)=>{r.d(t,{Z:()=>p});var i=r(43697),s=r(46791),o=r(70586),n=(r(80442),r(20102),r(92604),r(26258),r(87538)),a=r(5600),l=(r(75215),r(67676),r(52011));let u=class extends s.Z{constructor(e){super(e),this.getCollections=null}initialize(){this.own((0,n.EH)((()=>this._refresh())))}destroy(){this.getCollections=null}_refresh(){const e=(0,o.pC)(this.getCollections)?this.getCollections():null;if((0,o.Wi)(e))return void this.removeAll();let t=0;for(const r of e)(0,o.pC)(r)&&(t=this._processCollection(t,r));this.splice(t,this.length)}_createNewInstance(e){return new s.Z(e)}_processCollection(e,t){if(!t)return e;const r=this.itemFilterFunction?this.itemFilterFunction:e=>!!e;for(const i of t)if(i){if(r(i)){const t=this.indexOf(i,e);t>=0?t!==e&&this.reorder(i,e):this.add(i,e),++e}if(this.getChildrenFunction){const t=this.getChildrenFunction(i);if(Array.isArray(t))for(const r of t)e=this._processCollection(e,r);else e=this._processCollection(e,t)}}return e}};(0,i._)([(0,a.Cb)()],u.prototype,"getCollections",void 0),(0,i._)([(0,a.Cb)()],u.prototype,"getChildrenFunction",void 0),(0,i._)([(0,a.Cb)()],u.prototype,"itemFilterFunction",void 0),u=(0,i._)([(0,l.j)("esri.core.CollectionFlattener")],u);const p=u},23670:(e,t,r)=>{r.d(t,{G:()=>s});var i=r(20102);let s=class{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.Z(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new s(this.major,this.minor,this._context)}static parse(e,t=""){const[r,o]=e.split("."),n=/^\s*\d+\s*$/;if(!r||!r.match||!r.match(n))throw new i.Z((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!o||!o.match||!o.match(n))throw new i.Z((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const a=parseInt(r,10),l=parseInt(o,10);return new s(a,l,t)}}},68668:(e,t,r)=>{r.d(t,{G:()=>a,w:()=>l});var i=r(66643),s=r(46791),o=r(83379),n=r(70586);async function a(e,t){return await e.load(),l(e,t)}async function l(e,t){const r=[],a=(...e)=>{for(const t of e)(0,n.Wi)(t)||(Array.isArray(t)?a(...t):s.Z.isCollection(t)?t.forEach((e=>a(e))):o.Z.isLoadable(t)&&r.push(t))};t(a);let l=null;if(await(0,i.UI)(r,(async e=>{const t=await(0,i.q6)(function(e){return"loadAll"in e&&"function"==typeof e.loadAll}(e)?e.loadAll():e.load());!1!==t.ok||l||(l=t)})),l)throw l.error;return e}},42033:(e,t,r)=>{r.d(t,{E:()=>s,_:()=>o});var i=r(70586);async function s(e,t){const{WhereClause:i}=await r.e(1534).then(r.bind(r,41534));return i.create(e,t)}function o(e,t){return(0,i.pC)(e)?(0,i.pC)(t)?`(${e}) AND (${t})`:e:t}},74654:(e,t,r)=>{r.d(t,{Z:()=>A});var i=r(43697),s=r(15923),o=r(20102),n=r(80442),a=r(70586),l=r(95330),u=r(17452),p=r(5600),d=(r(75215),r(67676),r(52011)),c=r(10158),y=r(11282),h=r(41818),f=(r(66577),r(34599)),m=r(14165),b=r(6570),g=r(5396),S=r(4967),v=r(69285),w=r(98732);function _(e,t){return t}function C(e,t,r,i){switch(r){case 0:return E(e,t+i,0);case 1:return"lowerLeft"===e.originPosition?E(e,t+i,1):function({translate:e,scale:t},r,i){return e[i]-r*t[i]}(e,t+i,1)}}function I(e,t,r,i){return 2===r?E(e,t,2):C(e,t,r,i)}function x(e,t,r,i){return 2===r?E(e,t,3):C(e,t,r,i)}function F(e,t,r,i){return 3===r?E(e,t,3):I(e,t,r,i)}function E({translate:e,scale:t},r,i){return e[i]+r*t[i]}class T{constructor(e){this._options=e,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=_,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const t=(0,v.k)(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(!(0,a.Wi)(t))for(const r of e.features)t(r.geometry)}createSpatialReference(){return{}}addField(e,t){const r=e.fields;(0,a.O3)(r),r.push(t);const i=r.map((e=>e.name));this._attributesConstructor=function(){for(const e of i)this[e]=null}}addFeature(e,t){e.features.push(t)}prepareFeatures(e){switch(this._transform=e.transform,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++,e.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,t,r)=>this.addCoordinatePoint(e,t,r),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,t,r)=>this._addCoordinatePolygon(e,t,r),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,t,r)=>this._addCoordinatePolyline(e,t,r),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,t,r)=>this._addCoordinateMultipoint(e,t,r),this.createGeometry=e=>this._createMultipointGeometry(e)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(e,t,r){0===this._lengths.length&&(this._toAddInCurrentPath=t),this._lengths.push(t)}addQueryGeometry(e,t){const{queryGeometry:r,queryGeometryType:i}=t,s=(0,w.$g)(r.clone(),r,!1,!1,this._transform),o=(0,w.di)(s,i,!1,!1);e.queryGeometryType=i,e.queryGeometry={...o}}createPointGeometry(e){const t={x:0,y:0,spatialReference:e.spatialReference};return e.hasZ&&(t.z=0),e.hasM&&(t.m=0),t}addCoordinatePoint(e,t,r){const i=(0,a.s3)(this._transform,"transform");switch(t=this._applyTransform(i,t,r,0),r){case 0:e.x=t;break;case 1:e.y=t;break;case 2:"z"in e?e.z=t:e.m=t;break;case 3:e.m=t}}_transformPathLikeValue(e,t){let r=0;t<=1&&(r=this._previousCoordinate[t],this._previousCoordinate[t]+=e);const i=(0,a.s3)(this._transform,"transform");return this._applyTransform(i,e,t,r)}_addCoordinatePolyline(e,t,r){this._dehydratedAddPointsCoordinate(e.paths,t,r)}_addCoordinatePolygon(e,t,r){this._dehydratedAddPointsCoordinate(e.rings,t,r)}_addCoordinateMultipoint(e,t,r){0===r&&e.points.push([]);const i=this._transformPathLikeValue(t,r);e.points[e.points.length-1].push(i)}_createPolygonGeometry(e){return{rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,t,r){0===r&&0==this._toAddInCurrentPath--&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const i=this._transformPathLikeValue(t,r),s=e[e.length-1];0===r&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),s.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=i}_deriveApplyTransform(e){const{hasZ:t,hasM:r}=e;return t&&r?F:t?I:r?x:C}}var O=r(74889);let D=class extends s.Z{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return(0,u.mN)(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){const r=this._normalizeQuery(e),i=null!=e.outStatistics?.[0],s=(0,n.Z)("featurelayer-pbf-statistics"),o=!i||s;let a;if(this.pbfSupported&&o)try{a=await async function(e,t,r){const i=(0,y.en)(e),s={...r},o=m.Z.from(t),n=!o.quantizationParameters,{data:a}=await(0,f.qp)(i,o,new T({sourceSpatialReference:o.sourceSpatialReference,applyTransform:n}),s);return a}(this.url,r,t)}catch(e){if("query:parsing-pbf"!==e.name)throw e;this.pbfSupported=!1}return this.pbfSupported&&o||(a=await(0,S.F)(this.url,r,t)),this._normalizeFields(a.fields),a}async featureSetFromJSON(e,t,i){if(!this._queryIs3DObjectFormat(e)||(0,a.Wi)(this.infoFor3D)||!t.assetMaps||!t.features||!t.features.length)return O.Z.fromJSON(t);const{meshFeatureSetFromJSON:s}=await(0,l.Hl)(Promise.all([r.e(6481),r.e(6459),r.e(1932)]).then(r.bind(r,21932)),i);return s(e,this.infoFor3D,t)}executeForCount(e,t){return(0,h.P)(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return async function(e,t,r){const i=(0,y.en)(e);return(0,f.Vr)(i,m.Z.from(t),{...r}).then((e=>({count:e.data.count,extent:b.Z.fromJSON(e.data.extent)})))}(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return(0,g.G)(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:i},{executeRelationshipQuery:s}]=await(0,l.Hl)(Promise.all([r.e(5935).then(r.bind(r,75935)),r.e(1073).then(r.bind(r,81073))]),t);return e=i.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:i},{executeRelationshipQueryForCount:s}]=await(0,l.Hl)(Promise.all([r.e(5935).then(r.bind(r,75935)),r.e(1073).then(r.bind(r,81073))]),t);return e=i.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:i,fetchAttachments:s,processAttachmentQueryResult:o}=await(0,l.Hl)(r.e(540).then(r.bind(r,30540)),t),n=(0,y.en)(this.url);return o(n,await(this.queryAttachmentsSupported?i(n,e,t):s(n,e,t)))}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:i}=await(0,l.Hl)(r.e(1158).then(r.bind(r,71158)),t);return i(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:i}=await(0,l.Hl)(r.e(3992).then(r.bind(r,33992)),t);return i(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:i}=await(0,l.Hl)(r.e(1790).then(r.bind(r,21790)),t);return i(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:i}=await(0,l.Hl)(r.e(4371).then(r.bind(r,14371)),t);return i(this.parsedUrl,e,t)}_normalizeQuery(e){let t=m.Z.from(e);if(t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?c.n.from(e.dynamicDataSource):this.dynamicDataSource),(0,a.pC)(this.infoFor3D)&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;for(const e of this.infoFor3D.queryFormats){if("3D_glb"===e){t.formatOf3DObjects=e;break}"3D_gltf"!==e||t.formatOf3DObjects||(t.formatOf3DObjects=e)}if(!t.formatOf3DObjects)throw new o.Z("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if((0,a.Wi)(t.outFields)||!t.outFields.includes("*")){t=t===e?t.clone():t,(0,a.Wi)(t.outFields)&&(t.outFields=[]);const{originX:r,originY:i,originZ:s,translationX:o,translationY:n,translationZ:l,scaleX:u,scaleY:p,scaleZ:d,rotationX:c,rotationY:y,rotationZ:h,rotationDeg:f}=this.infoFor3D.transformFieldRoles;t.outFields.push(r,i,s,o,n,l,u,p,d,c,y,h,f)}}return t}_normalizeFields(e){if((0,a.pC)(this.fieldsIndex)&&(0,a.pC)(e))for(const t of e){const e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryIs3DObjectFormat(e){return(0,a.pC)(this.infoFor3D)&&(0,a.pC)(e.returnGeometry)&&"xyFootprint"!==e.multipatchOption&&!e.outStatistics}};(0,i._)([(0,p.Cb)({type:c.n})],D.prototype,"dynamicDataSource",void 0),(0,i._)([(0,p.Cb)()],D.prototype,"fieldsIndex",void 0),(0,i._)([(0,p.Cb)()],D.prototype,"gdbVersion",void 0),(0,i._)([(0,p.Cb)()],D.prototype,"infoFor3D",void 0),(0,i._)([(0,p.Cb)({readOnly:!0})],D.prototype,"parsedUrl",null),(0,i._)([(0,p.Cb)()],D.prototype,"pbfSupported",void 0),(0,i._)([(0,p.Cb)()],D.prototype,"queryAttachmentsSupported",void 0),(0,i._)([(0,p.Cb)()],D.prototype,"sourceSpatialReference",void 0),(0,i._)([(0,p.Cb)({type:String})],D.prototype,"url",void 0),D=(0,i._)([(0,d.j)("esri.tasks.QueryTask")],D);const A=D},54295:(e,t,r)=>{r.d(t,{V:()=>n});var i=r(43697),s=r(5600),o=(r(75215),r(67676),r(52011));const n=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,o.j)("esri.layers.mixins.APIKeyMixin")],t),t}},7944:(e,t,r)=>{r.d(t,{O:()=>h});var i=r(43697),s=r(3172),o=r(95330),n=r(17452),a=r(23670),l=r(5600),u=(r(75215),r(67676),r(71715)),p=r(52011),d=r(6570),c=r(82971),y=r(21506);const h=e=>{let t=class extends e{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesPromise=null,this._allLayersAndTablesMap=null}readCapabilities(e,t){const r=t.capabilities&&t.capabilities.split(",").map((e=>e.toLowerCase().trim()));if(!r)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};const i=this.type,s="tile"!==i&&!!t.supportsDynamicLayers,o=r.includes("query"),n=r.includes("map"),l=!!t.exportTilesAllowed,u=r.includes("tilemap"),p=r.includes("data"),d="tile"!==i&&(!t.tileInfo||s),c="tile"!==i&&(!t.tileInfo||s),y="tile"!==i,h=t.cimVersion&&a.G.parse(t.cimVersion),f=h?.since(1,4)??!1,m=h?.since(2,0)??!1;return{operations:{supportsExportMap:n,supportsExportTiles:l,supportsIdentify:o,supportsQuery:p,supportsTileMap:u},exportMap:n?{supportsArcadeExpressionForLabeling:f,supportsSublayersChanges:y,supportsDynamicLayers:s,supportsSublayerVisibility:d,supportsSublayerDefinitionExpression:c,supportsCIMSymbols:m}:null,exportTiles:l?{maxExportTilesCount:+t.maxExportTilesCount}:null}}readVersion(e,t){let r=t.currentVersion;return r||(r=t.hasOwnProperty("capabilities")||t.hasOwnProperty("tables")?10:t.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),r}async fetchSublayerInfo(e,t){return await this.fetchAllLayersAndTables(t),this._allLayersAndTablesMap?.get(e)}async fetchAllLayersAndTables(e){await this.load(e),this._allLayersAndTablesPromise||(this._allLayersAndTablesPromise=(0,s.default)((0,n.mN)(this.url).path+"/layers",{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then((e=>{this._allLayersAndTablesMap=new Map;for(const t of e.data.layers)this._allLayersAndTablesMap.set(t.id,t);return{result:e.data}}),(e=>({error:e}))));const t=await this._allLayersAndTablesPromise;if((0,o.k_)(e),"result"in t)return t.result;throw t.error}};return(0,i._)([(0,l.Cb)({readOnly:!0})],t.prototype,"capabilities",void 0),(0,i._)([(0,u.r)("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],t.prototype,"readCapabilities",null),(0,i._)([(0,l.Cb)({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),(0,i._)([(0,l.Cb)({type:d.Z})],t.prototype,"fullExtent",void 0),(0,i._)([(0,l.Cb)(y.id)],t.prototype,"id",void 0),(0,i._)([(0,l.Cb)({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],t.prototype,"legendEnabled",void 0),(0,i._)([(0,l.Cb)(y.C_)],t.prototype,"popupEnabled",void 0),(0,i._)([(0,l.Cb)({type:c.Z})],t.prototype,"spatialReference",void 0),(0,i._)([(0,l.Cb)({readOnly:!0})],t.prototype,"version",void 0),(0,i._)([(0,u.r)("version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],t.prototype,"readVersion",null),t=(0,i._)([(0,p.j)("esri.layers.mixins.ArcGISMapService")],t),t}},10343:(e,t,r)=>{r.d(t,{x:()=>g});var i=r(43697),s=r(46791),o=r(57435),n=r(20102),a=r(92604),l=r(17445),u=r(5600),p=(r(75215),r(67676),r(1153)),d=r(52011),c=r(31263),y=r(49867),h=r(32073);const f=a.Z.getLogger("esri.layers.TileLayer"),m=s.Z.ofType(y.Z);function b(e,t){e&&e.forEach((e=>{t(e),e.sublayers&&e.sublayers.length&&b(e.sublayers,t)}))}const g=e=>{let t=class extends e{constructor(...e){super(...e),this.allSublayers=new o.Z({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.sublayersSourceJSON={[c.s3.SERVICE]:{},[c.s3.PORTAL_ITEM]:{},[c.s3.WEB_SCENE]:{},[c.s3.WEB_MAP]:{}},this.addHandles((0,l.YP)((()=>this.sublayers),((e,t)=>this._handleSublayersChange(e,t)),l.Z_))}readSublayers(e,t){if(!t||!e)return;const{sublayersSourceJSON:r}=this,i=(0,c.M9)(t.origin);if(i<c.s3.SERVICE)return;if(r[i]={context:t,visibleLayers:e.visibleLayers||r[i].visibleLayers,layers:e.layers||r[i].layers},i>c.s3.SERVICE)return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:s,origin:o}=this.createSublayersForOrigin("web-document"),n=(0,p.vw)(this);n.setDefaultOrigin(o),this._set("sublayers",new m(s)),n.setDefaultOrigin("user")}findSublayerById(e){return this.allSublayers.find((t=>t.id===e))}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(e){const t=(0,c.M9)("web-document"===e?"web-map":e);let r=c.s3.SERVICE,i=this.sublayersSourceJSON[c.s3.SERVICE].layers,s=this.sublayersSourceJSON[c.s3.SERVICE].context,o=null;const n=[c.s3.PORTAL_ITEM,c.s3.WEB_SCENE,c.s3.WEB_MAP].filter((e=>e<=t));for(const e of n){const t=this.sublayersSourceJSON[e];(0,h.ac)(t.layers)&&(r=e,i=t.layers,s=t.context,t.visibleLayers&&(o={visibleLayers:t.visibleLayers,context:t.context}))}const a=[c.s3.PORTAL_ITEM,c.s3.WEB_SCENE,c.s3.WEB_MAP].filter((e=>e>r&&e<=t));let l=null;for(const e of a){const{layers:t,visibleLayers:r,context:i}=this.sublayersSourceJSON[e];t&&(l={layers:t,context:i}),r&&(o={visibleLayers:r,context:i})}const u=function(e,t){const r=[],i={};return e?(e.forEach((e=>{const s=new y.Z;if(s.read(e,t),i[s.id]=s,null!=e.parentLayerId&&-1!==e.parentLayerId){const t=i[e.parentLayerId];t.sublayers||(t.sublayers=[]),t.sublayers.unshift(s)}else r.unshift(s)})),r):r}(i,s),p=new Map,d=new Set;if(l)for(const e of l.layers)p.set(e.id,e);if(o?.visibleLayers)for(const e of o.visibleLayers)d.add(e);return b(u,(e=>{l&&e.read(p.get(e.id),l.context),o&&e.read({defaultVisibility:d.has(e.id)},o.context)})),{origin:(0,c.x3)(r),sublayers:new m({items:u})}}read(e,t){super.read(e,t),this.readSublayers(e,t)}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null,e.layer=null})),this.handles.remove("sublayers-owner")),e&&(e.forEach((e=>{e.parent=this,e.layer=this})),this.handles.add([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null}))],"sublayers-owner"),"tile"===this.type&&this.handles.add(e.on("before-changes",(e=>{f.error(new n.Z("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),e.preventDefault()})),"sublayers-owner"))}};return(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"allSublayers",void 0),(0,i._)([(0,u.Cb)({readOnly:!0,type:s.Z.ofType(y.Z)})],t.prototype,"serviceSublayers",void 0),(0,i._)([(0,u.Cb)({value:null,type:m,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],t.prototype,"sublayers",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"sublayersSourceJSON",void 0),t=(0,i._)([(0,d.j)("esri.layers.mixins.SublayersOwner")],t),t}},70082:(e,t,r)=>{r.d(t,{Z:()=>d});var i=r(43697),s=r(2368),o=r(35454),n=r(96674),a=r(5600),l=(r(75215),r(67676),r(52011));const u=new o.X({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let p=class extends((0,s.J)(n.wq)){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};(0,i._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"name",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"description",void 0),(0,i._)([(0,a.Cb)({json:{read:u.read,write:u.write}})],p.prototype,"drawingTool",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"prototype",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"thumbnail",void 0),p=(0,i._)([(0,l.j)("esri.layers.support.FeatureTemplate")],p);const d=p},16451:(e,t,r)=>{r.d(t,{Z:()=>y});var i=r(43697),s=r(2368),o=r(96674),n=r(5600),a=(r(75215),r(67676),r(71715)),l=r(52011),u=r(30556),p=r(72729),d=r(70082);let c=class extends((0,s.J)(o.wq)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,p.im)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,i._)([(0,n.Cb)({json:{write:!0}})],c.prototype,"id",void 0),(0,i._)([(0,n.Cb)({json:{write:!0}})],c.prototype,"name",void 0),(0,i._)([(0,n.Cb)({json:{write:!0}})],c.prototype,"domains",void 0),(0,i._)([(0,a.r)("domains")],c.prototype,"readDomains",null),(0,i._)([(0,u.c)("domains")],c.prototype,"writeDomains",null),(0,i._)([(0,n.Cb)({type:[d.Z],json:{write:!0}})],c.prototype,"templates",void 0),c=(0,i._)([(0,l.j)("esri.layers.support.FeatureType")],c);const y=c},56765:(e,t,r)=>{r.d(t,{Z:()=>p});var i,s=r(43697),o=r(46791),n=r(96674),a=r(5600),l=(r(75215),r(67676),r(52011));let u=i=class extends n.wq{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new o.Z}clone(){return new i({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,s._)([(0,a.Cb)({type:String,json:{write:!0}})],u.prototype,"floorField",void 0),(0,s._)([(0,a.Cb)({json:{read:!1,write:!1}})],u.prototype,"viewAllMode",void 0),(0,s._)([(0,a.Cb)({json:{read:!1,write:!1}})],u.prototype,"viewAllLevelIds",void 0),u=i=(0,s._)([(0,l.j)("esri.layers.support.LayerFloorInfo")],u);const p=u},49867:(e,t,r)=>{r.d(t,{Z:()=>X});var i,s=r(43697),o=(r(66577),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(9790),u=r(46791),p=r(20102),d=r(3920),c=r(80442),y=r(10699),h=r(22974),f=r(83379),m=r(92604),b=r(70586),g=r(16453),S=r(42033),v=r(17452),w=r(5600),_=r(90578),C=r(71715),I=r(52011),x=r(30556),F=r(75215),E=r(31263),T=r(1153),O=r(74654),D=r(16451),A=r(1231),P=r(99514),L=r(54306),R=r(30707),j=r(56765),M=r(72064),Z=r(10158),V=r(42843),N=r(56545),q=r(14165),Q=r(32163),G=r(6570),k=r(86973);function z(e){return null!=e&&"esriSMS"===e.type}function U(e,t,r){const i=this.originIdOf(t)>=(0,E.M9)(r.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!r&&"map-image"===r.layer?.type&&(r.writeSublayerStructure||i)}}function B(e,t,r){return{enabled:!!r&&"tile"===r.layer?.type&&this._isOverridden(t)}}function J(e,t,r){return{ignoreOrigin:!0,enabled:r&&r.writeSublayerStructure||!1}}function W(e,t,r){return{ignoreOrigin:!0,enabled:!!r&&(r.writeSublayerStructure||this.originIdOf(t)>=(0,E.M9)(r.origin))}}let H=0;const $=new Set;$.add("layer"),$.add("parent"),$.add("loaded"),$.add("loadStatus"),$.add("loadError"),$.add("loadWarnings");let K=i=class extends((0,d.p)((0,g.R)((0,y.IG)(f.Z)))){constructor(e){super(e),this.capabilities=void 0,this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.legendEnabled=!0,this.objectIdField=null,this.popupEnabled=!0,this.popupTemplate=null,this.sourceJSON=null,this.title=null,this.typeIdField=null,this.types=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise((async()=>{const{layer:t,source:r,url:i}=this;if(!t&&!i)throw new p.Z("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});let s=null;if(!t||this.originIdOf("url")>E.s3.SERVICE||"data-layer"===r?.type)s=(await(0,a.default)(i,{responseType:"json",query:{f:"json"},...e})).data;else{let i=this.id;"map-layer"===r?.type&&(i=r.mapLayerId),s=await t.fetchSublayerInfo(i,e)}s&&(this.sourceJSON=s,this.read({layerDefinition:s},{origin:"service"}))})()),this}readCapabilities(e,t){t=t.layerDefinition||t;const{operations:{supportsQuery:r,supportsQueryAttachments:i},query:{supportsFormatPBF:s},data:{supportsAttachment:o}}=(0,M.h)(t,this.url);return{exportMap:{supportsModification:!!t.canModifyLayer},operations:{supportsQuery:r,supportsQueryAttachments:i},data:{supportsAttachment:o},query:{supportsFormatPBF:s}}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer("definitionExpression",e)}get fieldsIndex(){return new P.Z(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer("floorInfo",e)}readGlobalIdFieldFromService(e,t){if((t=t.layerDefinition||t).globalIdField)return t.globalIdField;if(t.fields)for(const e of t.fields)if("esriFieldTypeGlobalID"===e.type)return e.name}get id(){return this._get("id")??H++}set id(e){this._get("id")!==e&&(!1!==this.layer?.capabilities?.exportMap?.supportsDynamicLayers?this._set("id",e):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}set labelingInfo(e){this._setAndNotifyLayer("labelingInfo",e)}writeLabelingInfo(e,t,r,i){e&&e.length&&(t.layerDefinition={drawingInfo:{labelingInfo:e.map((e=>e.write({},i)))}})}set labelsVisible(e){this._setAndNotifyLayer("labelsVisible",e)}set layer(e){this._set("layer",e),this.sublayers&&this.sublayers.forEach((t=>t.layer=e))}set listMode(e){this._set("listMode",e)}set minScale(e){this._setAndNotifyLayer("minScale",e)}readMinScale(e,t){return t.minScale||t.layerDefinition&&t.layerDefinition.minScale||0}set maxScale(e){this._setAndNotifyLayer("maxScale",e)}readMaxScale(e,t){return t.maxScale||t.layerDefinition&&t.layerDefinition.maxScale||0}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}readObjectIdFieldFromService(e,t){if((t=t.layerDefinition||t).objectIdField)return t.objectIdField;if(t.fields)for(const e of t.fields)if("esriFieldTypeOID"===e.type)return e.name}set opacity(e){this._setAndNotifyLayer("opacity",e)}readOpacity(e,t){const r=t.layerDefinition;return 1-.01*((null!=r?.transparency?r.transparency:r?.drawingInfo?.transparency)??0)}writeOpacity(e,t,r,i){t.layerDefinition={drawingInfo:{transparency:100-100*e}}}writeParent(e,t){this.parent&&this.parent!==this.layer?t.parentLayerId=(0,F.vU)(this.parent.id):t.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{spatialReference:e}=this.layer,t="gdbVersion"in this.layer?this.layer.gdbVersion:void 0,{capabilities:r,fieldsIndex:i}=this,s=(0,c.Z)("featurelayer-pbf")&&r?.query.supportsFormatPBF,o=r?.operations?.supportsQueryAttachments??!1;return new O.Z({url:this.url,pbfSupported:s,fieldsIndex:i,gdbVersion:t,sourceSpatialReference:e,queryAttachmentsSupported:o})}set renderer(e){if(e)for(const t of e.getSymbols())if((0,l.dU)(t)){m.Z.getLogger(this.declaredClass).warn("Sublayer renderer should use 2D symbols");break}this._setAndNotifyLayer("renderer",e)}get source(){return this._get("source")||new V.R({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer("source",e)}set sublayers(e){this._handleSublayersChange(e,this._get("sublayers")),this._set("sublayers",e)}castSublayers(e){return(0,F.se)(u.Z.ofType(i),e)}writeSublayers(e,t,r){this.sublayers?.length&&(t[r]=this.sublayers.map((e=>e.id)).toArray().reverse())}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find((e=>e.name.toLowerCase()===r));e&&(r=e.name)}return r}get url(){const e=this.layer?.parsedUrl??this._lastParsedUrl,t=this.source;if(!e)return null;if(this._lastParsedUrl=e,"map-layer"===t?.type)return`${e.path}/${t.mapLayerId}`;const r={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${(0,v.B7)(r)}`}set url(e){this._overrideIfSome("url",e)}set visible(e){this._setAndNotifyLayer("visible",e)}writeVisible(e,t,r,i){t[r]=this.getAtOrigin("defaultVisibility","service")||e}clone(){const{store:e}=(0,T.vw)(this),t=new i;return(0,T.vw)(t).store=e.clone($),this.commitProperty("url"),t._lastParsedUrl=this._lastParsedUrl,t}createPopupTemplate(e){return(0,Q.eZ)(this,e)}createQuery(){return new q.Z({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const{layer:e}=this,t=e?.parsedUrl,i=new(0,(await Promise.all([r.e(5546),r.e(9942),r.e(9238),r.e(216)]).then(r.bind(r,19238))).default)({url:t?.path});return t&&this.source&&("map-layer"===this.source.type?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source),null!=e?.refreshInterval&&(i.refreshInterval=e.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=(0,h.d9)(this.floorInfo)),this.originIdOf("labelingInfo")>E.s3.SERVICE&&(i.labelingInfo=(0,h.d9)(this.labelingInfo)),this.originIdOf("labelsVisible")>E.s3.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>E.s3.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>E.s3.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>E.s3.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>E.s3.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>E.s3.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>E.s3.DEFAULTS&&(i.popupTemplate=(0,h.d9)(this.popupTemplate)),this.originIdOf("renderer")>E.s3.SERVICE&&(i.renderer=(0,h.d9)(this.renderer)),"data-layer"===this.source?.type&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>E.s3.DEFAULTS&&(i.title=this.title),"map-image"===e?.type&&e.originIdOf("customParameters")>E.s3.DEFAULTS&&(i.customParameters=e.customParameters),"tile"===e?.type&&e.originIdOf("customParameters")>E.s3.DEFAULTS&&(i.customParameters=e.customParameters),i}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){const{typeIdField:t,types:r}=this;if(!t||!e)return null;const i=e.attributes?e.attributes[t]:void 0;if(null==i)return null;let s=null;return r?.some((e=>{const{id:t}=e;return null!=t&&(t.toString()===i.toString()&&(s=e),!!s)})),s}getFieldDomain(e,t){const r=t&&t.feature,i=this.getFeatureType(r);if(i){const t=i.domains&&i.domains[e];if(t&&"inherited"!==t.type)return t}return this._getLayerDomain(e)}async queryAttachments(e,t){await this.load(),e=N.Z.from(e);const r=this.capabilities;if(!r?.data?.supportsAttachment)throw new p.Z("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:s,globalIds:o,num:n,size:a,start:l,where:u}=e;if(!r?.operations?.supportsQueryAttachments&&(i?.length>0||o?.length>0||a?.length>0||n||l||u))throw new p.Z("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(s?.length||o?.length||u))throw new p.Z("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);return this.queryTask.executeAttachmentQuery(e,t)}async queryFeatures(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new p.Z("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new p.Z("queryFeatures:not-supported","this layer has no url.");const r=await this.queryTask.execute(e,{...t,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(r?.features)for(const e of r.features)e.sourceLayer=this;return r}toExportImageJSON(e){const t={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},r=(0,S._)(e,this.definitionExpression);(0,b.pC)(r)&&(t.definitionExpression=r);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce(((e,t)=>(e[t]=this.originIdOf(t),e)),{}),s=Object.keys(i).some((e=>i[e]>E.s3.SERVICE));if(s){const e=t.drawingInfo={};if(i.renderer>E.s3.SERVICE&&(e.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>E.s3.SERVICE&&(e.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>E.s3.SERVICE){!this.loaded&&this.labelingInfo.some((e=>!e.labelPlacement))&&m.Z.getLogger(this.declaredClass).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let t=this.labelingInfo;(0,b.pC)(this.geometryType)&&(t=(0,R.a)(this.labelingInfo,k.M.toJSON(this.geometryType))),e.labelingInfo=t.filter((e=>e.labelPlacement)).map((e=>e.toJSON({origin:"service",layer:this.layer}))),e.showLabels=!0}i.opacity>E.s3.SERVICE&&(e.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(e.renderer)}return t}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,(e=>{e.color||"esriSMSX"!==e.style&&"esriSMSCross"!==e.style||(e.outline&&e.outline.color?e.color=e.outline.color:e.color=[0,0,0,0])}))}_forEachSimpleMarkerSymbols(e,t){if(e){const r=("uniqueValueInfos"in e?e.uniqueValueInfos:"classBreakInfos"in e?e.classBreakInfos:null)??[];for(const e of r)z(e.symbol)&&t(e.symbol);"symbol"in e&&z(e.symbol)&&t(e.symbol),"defaultSymbol"in e&&z(e.defaultSymbol)&&t(e.defaultSymbol)}}_setAndNotifyLayer(e,t){const r=this.layer,i=this._get(e);let s,o;switch(e){case"definitionExpression":case"floorInfo":s="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":s="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":s="supportsDynamicLayers",o="supportsModification"}const n=(0,T.vw)(this).getDefaultOrigin();if("service"!==n){if(s&&!1===this.layer?.capabilities?.exportMap?.[s])return void this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${s}'`);if(o&&!1===this.capabilities?.exportMap[o])return void this._logLockedError(e,`capability not available 'capabilities.exportMap.${o}'`)}"source"!==e||"not-loaded"===this.loadStatus?(this._set(e,t),"service"!==n&&i!==t&&r&&r.emit&&r.emit("sublayer-update",{propertyName:e,target:this})):this._logLockedError(e,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null,e.layer=null})),this.handles.removeAll()),e&&(e.forEach((e=>{e.parent=this,e.layer=this.layer})),this.handles.add([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this.layer})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null})),e.on("before-changes",(e=>{const t=this.layer?.capabilities?.exportMap?.supportsSublayersChanges;null==t||t||(m.Z.getLogger(this.declaredClass).error(new p.Z("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),e.preventDefault())}))]))}_logLockedError(e,t){const{layer:r,declaredClass:i}=this;m.Z.getLogger(i).error(new p.Z("sublayer:locked",`Property '${String(e)}' can't be changed on Sublayer from the layer '${r?.id}'`,{reason:t,sublayer:this,layer:r}))}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};K.test={isMapImageLayerOverridePolicy:e=>e===J||e===U,isTileImageLayerOverridePolicy:e=>e===B},(0,s._)([(0,w.Cb)({readOnly:!0})],K.prototype,"capabilities",void 0),(0,s._)([(0,C.r)("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],K.prototype,"readCapabilities",null),(0,s._)([(0,w.Cb)()],K.prototype,"defaultPopupTemplate",null),(0,s._)([(0,w.Cb)({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:U}}})],K.prototype,"definitionExpression",null),(0,s._)([(0,w.Cb)({type:[A.Z],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],K.prototype,"fields",void 0),(0,s._)([(0,w.Cb)({readOnly:!0})],K.prototype,"fieldsIndex",null),(0,s._)([(0,w.Cb)({type:j.Z,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:U},origins:{"web-scene":{read:!1,write:!1}}}})],K.prototype,"floorInfo",null),(0,s._)([(0,w.Cb)({type:G.Z,json:{read:{source:"layerDefinition.extent"}}})],K.prototype,"fullExtent",void 0),(0,s._)([(0,w.Cb)({type:k.M.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:k.M.read}}}}})],K.prototype,"geometryType",void 0),(0,s._)([(0,w.Cb)({type:String})],K.prototype,"globalIdField",void 0),(0,s._)([(0,C.r)("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],K.prototype,"readGlobalIdFieldFromService",null),(0,s._)([(0,w.Cb)({type:F.z8,json:{write:{ignoreOrigin:!0}}})],K.prototype,"id",null),(0,s._)([(0,w.Cb)({value:null,type:[L.Z],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:J}}})],K.prototype,"labelingInfo",null),(0,s._)([(0,x.c)("labelingInfo")],K.prototype,"writeLabelingInfo",null),(0,s._)([(0,w.Cb)({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:J}}})],K.prototype,"labelsVisible",null),(0,s._)([(0,w.Cb)({value:null})],K.prototype,"layer",null),(0,s._)([(0,w.Cb)({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:W}}})],K.prototype,"legendEnabled",void 0),(0,s._)([(0,w.Cb)({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],K.prototype,"listMode",null),(0,s._)([(0,w.Cb)({type:Number,value:0,json:{write:{overridePolicy:J}}})],K.prototype,"minScale",null),(0,s._)([(0,C.r)("minScale",["minScale","layerDefinition.minScale"])],K.prototype,"readMinScale",null),(0,s._)([(0,w.Cb)({type:Number,value:0,json:{write:{overridePolicy:J}}})],K.prototype,"maxScale",null),(0,s._)([(0,C.r)("maxScale",["maxScale","layerDefinition.maxScale"])],K.prototype,"readMaxScale",null),(0,s._)([(0,w.Cb)({readOnly:!0})],K.prototype,"effectiveScaleRange",null),(0,s._)([(0,w.Cb)({type:String})],K.prototype,"objectIdField",void 0),(0,s._)([(0,C.r)("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],K.prototype,"readObjectIdFieldFromService",null),(0,s._)([(0,w.Cb)({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:J}}})],K.prototype,"opacity",null),(0,s._)([(0,C.r)("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],K.prototype,"readOpacity",null),(0,s._)([(0,x.c)("opacity")],K.prototype,"writeOpacity",null),(0,s._)([(0,w.Cb)({json:{type:F.z8,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:J}}})],K.prototype,"parent",void 0),(0,s._)([(0,x.c)("parent")],K.prototype,"writeParent",null),(0,s._)([(0,w.Cb)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy:W,writer(e,t,r){t[r]=!e}}}})],K.prototype,"popupEnabled",void 0),(0,s._)([(0,w.Cb)({type:o.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:W}}})],K.prototype,"popupTemplate",void 0),(0,s._)([(0,w.Cb)({readOnly:!0})],K.prototype,"queryTask",null),(0,s._)([(0,w.Cb)({types:n.A,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:J},origins:{"web-scene":{types:n.o,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:J}}}}})],K.prototype,"renderer",null),(0,s._)([(0,w.Cb)({types:{key:"type",base:null,typeMap:{"data-layer":Z.n,"map-layer":V.R}},cast(e){if(e){if("mapLayerId"in e)return(0,F.TJ)(V.R,e);if("dataSource"in e)return(0,F.TJ)(Z.n,e)}return e},json:{name:"layerDefinition.source",write:{overridePolicy:J}}})],K.prototype,"source",null),(0,s._)([(0,w.Cb)()],K.prototype,"sourceJSON",void 0),(0,s._)([(0,w.Cb)({value:null,json:{type:[F.z8],write:{target:"subLayerIds",allowNull:!0,overridePolicy:J}}})],K.prototype,"sublayers",null),(0,s._)([(0,_.p)("sublayers")],K.prototype,"castSublayers",null),(0,s._)([(0,x.c)("sublayers")],K.prototype,"writeSublayers",null),(0,s._)([(0,w.Cb)({type:String,json:{name:"name",write:{overridePolicy:W}}})],K.prototype,"title",void 0),(0,s._)([(0,w.Cb)({type:String})],K.prototype,"typeIdField",void 0),(0,s._)([(0,C.r)("typeIdField",["layerDefinition.typeIdField"])],K.prototype,"readTypeIdField",null),(0,s._)([(0,w.Cb)({type:[D.Z],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],K.prototype,"types",void 0),(0,s._)([(0,w.Cb)({type:String,json:{read:{source:"layerUrl"},write:{target:"layerUrl",overridePolicy:B}}})],K.prototype,"url",null),(0,s._)([(0,w.Cb)({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:J}}})],K.prototype,"visible",null),(0,s._)([(0,x.c)("visible")],K.prototype,"writeVisible",null),K=i=(0,s._)([(0,I.j)("esri.layers.support.Sublayer")],K);const X=K},90082:(e,t,r)=>{r.d(t,{g:()=>s});var i=r(20102);async function s(e,t){try{return await createImageBitmap(e)}catch(e){throw new i.Z("request:server",`Unable to load ${t}`,{url:t,error:e})}}},72064:(e,t,r)=>{r.d(t,{h:()=>d});var i=r(80442),s=r(70586),o=r(66677);const n={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function a(e,t,r){return!!(e&&e.hasOwnProperty(t)?e[t]:r)}function l(e,t,r){return e&&e.hasOwnProperty(t)?e[t]:r}function u(e){const t=e?.supportedSpatialAggregationStatistics?.map((e=>e.toLowerCase()));return{envelope:!!t?.includes("envelopeaggregate"),centroid:!!t?.includes("centroidaggregate"),convexHull:!!t?.includes("convexhullaggregate")}}function p(e,t){const r=e?.supportedOperationsWithCacheHint?.map((e=>e.toLowerCase()));return!!r?.includes(t.toLowerCase())}function d(e,t){return{analytics:c(e),attachment:y(e),data:h(e),metadata:f(e),operations:m(e.capabilities,e,t),query:b(e,t),queryRelated:g(e),queryTopFeatures:S(e),editing:v(e)}}function c(e){return{supportsCacheHint:p(e.advancedQueryCapabilities,"queryAnalytics")}}function y(e){const t=e.attachmentProperties,r={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:p(e.advancedQueryCapabilities,"queryAttachments"),supportsResize:a(e,"supportsAttachmentsResizing",!1)};return t&&Array.isArray(t)&&t.forEach((e=>{const t=n[e.name];t&&(r[t]=!!e.isEnabled)})),r}function h(e){return{isVersioned:a(e,"isDataVersioned",!1),supportsAttachment:a(e,"hasAttachments",!1),supportsM:a(e,"hasM",!1),supportsZ:a(e,"hasZ",!1)}}function f(e){return{supportsAdvancedFieldProperties:a(e,"supportsFieldDescriptionProperty",!1)}}function m(e,t,r){const i=e?e.toLowerCase().split(",").map((e=>e.trim())):[],n=r?(0,o.Qc)(r):null,l=i.includes((0,s.pC)(n)&&"MapServer"===n.serverType?"data":"query"),u=i.includes("editing")&&!t.datesInUnknownTimezone;let p=u&&i.includes("create"),d=u&&i.includes("delete"),c=u&&i.includes("update");const y=i.includes("changetracking"),h=t.advancedQueryCapabilities;return u&&!(p||d||c)&&(p=d=c=!0),{supportsCalculate:a(t,"supportsCalculate",!1),supportsTruncate:a(t,"supportsTruncate",!1),supportsValidateSql:a(t,"supportsValidateSql",!1),supportsAdd:p,supportsDelete:d,supportsEditing:u,supportsChangeTracking:y,supportsQuery:l,supportsQueryAnalytics:a(h,"supportsQueryAnalytic",!1),supportsQueryAttachments:a(h,"supportsQueryAttachments",!1),supportsQueryTopFeatures:a(h,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:a(t,"supportsAttachmentsResizing",!1),supportsSync:i.includes("sync"),supportsUpdate:c,supportsExceedsLimitStatistics:a(t,"supportsExceedsLimitStatistics",!1)}}function b(e,t){const r=e.advancedQueryCapabilities,s=e.ownershipBasedAccessControlForFeatures,n=e.archivingInfo,d=e.currentVersion,c=t?.includes("MapServer"),y=!c||d>=(0,i.Z)("mapserver-pbf-version-support"),h=(0,o.M8)(t),f=new Set((e.supportedQueryFormats??"").split(",").map((e=>e.toLowerCase().trim())));return{supportsStatistics:a(r,"supportsStatistics",e.supportsStatistics),supportsPercentileStatistics:a(r,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:a(r,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:u(r),supportsCentroid:a(r,"supportsReturningGeometryCentroid",!1),supportsDistance:a(r,"supportsQueryWithDistance",!1),supportsDistinct:a(r,"supportsDistinct",e.supportsAdvancedQueries),supportsExtent:a(r,"supportsReturningQueryExtent",!1),supportsGeometryProperties:a(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:a(r,"supportsHavingClause",!1),supportsOrderBy:a(r,"supportsOrderBy",e.supportsAdvancedQueries),supportsPagination:a(r,"supportsPagination",!1),supportsQuantization:a(e,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:a(e,"supportsQuantizationEditMode",!1),supportsQueryGeometry:a(e,"supportsReturningQueryGeometry",!1),supportsResultType:a(r,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:a(r,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:a(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:a(e,"useStandardizedQueries",!1),supportsTopFeaturesQuery:a(r,"supportsTopFeaturesQuery",!1),supportsQueryByOthers:a(s,"allowOthersToQuery",!0),supportsHistoricMoment:a(n,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:y&&f.has("pbf"),supportsDisjointSpatialRelationship:a(r,"supportsDisjointSpatialRel",!1),supportsCacheHint:a(r,"supportsQueryWithCacheHint",!1)||p(r,"query"),supportsDefaultSpatialReference:a(r,"supportsDefaultSR",!1),supportsCompactGeometry:h,supportsFullTextSearch:a(r,"supportsFullTextSearch",!1),maxRecordCountFactor:l(e,"maxRecordCountFactor",void 0),maxRecordCount:l(e,"maxRecordCount",void 0),standardMaxRecordCount:l(e,"standardMaxRecordCount",void 0),tileMaxRecordCount:l(e,"tileMaxRecordCount",void 0)}}function g(e){const t=e.advancedQueryCapabilities,r=a(t,"supportsAdvancedQueryRelated",!1);return{supportsPagination:a(t,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r,supportsCacheHint:p(t,"queryRelated")}}function S(e){return{supportsCacheHint:p(e.advancedQueryCapabilities,"queryTopFilter")}}function v(e){const t=e.ownershipBasedAccessControlForFeatures;return{supportsGeometryUpdate:a(e,"allowGeometryUpdates",!0),supportsGlobalId:a(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:a(e,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:a(e,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:a(e,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:a(e,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:a(t,"allowAnonymousToDelete",!0),supportsDeleteByOthers:a(t,"allowOthersToDelete",!0),supportsUpdateByAnonymous:a(t,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:a(t,"allowOthersToUpdate",!0)}}},32073:(e,t,r)=>{r.d(t,{FN:()=>n,QV:()=>o,ac:()=>l});var i=r(70586),s=r(31263);function o(e,t,r){const i=t.flatten((({sublayers:e})=>e)).length;return i!==e.length||!!e.some((e=>e.originIdOf("minScale")>r||e.originIdOf("maxScale")>r||e.originIdOf("renderer")>r||e.originIdOf("labelingInfo")>r||e.originIdOf("opacity")>r||e.originIdOf("labelsVisible")>r||e.originIdOf("source")>r))||!a(e,t)}function n(e,t,r){return!!e.some((e=>{const t=e.source;return!(!t||"map-layer"===t.type&&t.mapLayerId===e.id&&((0,i.Wi)(t.gdbVersion)||t.gdbVersion===r))||e.originIdOf("renderer")>s.s3.SERVICE||e.originIdOf("labelingInfo")>s.s3.SERVICE||e.originIdOf("opacity")>s.s3.SERVICE||e.originIdOf("labelsVisible")>s.s3.SERVICE}))||!a(e,t)}function a(e,t){if(!e||!e.length||(0,i.Wi)(t))return!0;const r=t.slice().reverse().flatten((({sublayers:e})=>e&&e.toArray().reverse())).map((e=>e.id)).toArray();if(e.length>r.length)return!1;let s=0;const o=r.length;for(const{id:t}of e){for(;s<o&&r[s]!==t;)s++;if(s>=o)return!1}return!0}function l(e){return!!e&&e.some((e=>null!=e.minScale||e.layerDefinition&&null!=e.layerDefinition.minScale))}},51706:(e,t,r)=>{var i,s;function o(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}function n(e){return null!=e&&!isNaN(e)&&isFinite(e)}function a(e){return e.valueExpression?i.Expression:e.field&&"string"==typeof e.field?i.Field:i.Unknown}function l(e,t){const r=t||a(e),o=e.valueUnit||"unknown";return r===i.Unknown?s.Constant:e.stops?s.Stops:null!=e.minSize&&null!=e.maxSize&&null!=e.minDataValue&&null!=e.maxDataValue?s.ClampedLinear:"unknown"===o?null!=e.minSize&&null!=e.minDataValue?e.minSize&&e.minDataValue?s.Proportional:s.Additive:s.Identity:s.RealWorldSize}r.d(t,{PS:()=>a,QW:()=>l,RY:()=>i,hL:()=>s,iY:()=>o,qh:()=>n}),function(e){e.Unknown="unknown",e.Expression="expression",e.Field="field"}(i||(i={})),function(e){e.Unknown="unknown",e.Stops="stops",e.ClampedLinear="clamped-linear",e.Proportional="proportional",e.Additive="additive",e.Constant="constant",e.Identity="identity",e.RealWorldSize="real-world-size"}(s||(s={}))},41818:(e,t,r)=>{r.d(t,{P:()=>n});var i=r(11282),s=r(34599),o=r(14165);async function n(e,t,r){const n=(0,i.en)(e);return(0,s.hH)(n,o.Z.from(t),{...r}).then((e=>e.data.count))}},5396:(e,t,r)=>{r.d(t,{G:()=>n});var i=r(11282),s=r(34599),o=r(14165);async function n(e,t,r){const n=(0,i.en)(e);return(0,s.Ev)(n,o.Z.from(t),{...r}).then((e=>e.data.objectIds))}},4967:(e,t,r)=>{r.d(t,{F:()=>l,e:()=>a});var i=r(11282),s=r(34599),o=r(74889),n=r(14165);async function a(e,t,r){const i=await l(e,t,r);return o.Z.fromJSON(i)}async function l(e,t,r){const o=(0,i.en)(e),a={...r},l=n.Z.from(t),{data:u}=await(0,s.JT)(o,l,l.sourceSpatialReference,a);return u}},28694:(e,t,r)=>{r.d(t,{p:()=>o});var i=r(70586),s=r(69285);function o(e,t,r){if(!r||!r.features||!r.hasZ)return;const o=(0,s.k)(r.geometryType,t,e.outSpatialReference);if(!(0,i.Wi)(o))for(const e of r.features)o(e.geometry)}},56545:(e,t,r)=>{r.d(t,{Z:()=>c});var i,s=r(43697),o=r(96674),n=r(22974),a=r(5600),l=r(75215),u=r(52011),p=r(30556);let d=i=class extends o.wq{constructor(e){super(e),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10}clone(){return new i((0,n.d9)({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};(0,s._)([(0,a.Cb)({type:[String],json:{write:!0}})],d.prototype,"attachmentTypes",void 0),(0,s._)([(0,a.Cb)({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],d.prototype,"attachmentsWhere",void 0),(0,s._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],d.prototype,"cacheHint",void 0),(0,s._)([(0,a.Cb)({type:[String],json:{write:!0}})],d.prototype,"keywords",void 0),(0,s._)([(0,a.Cb)({type:[Number],json:{write:!0}})],d.prototype,"globalIds",void 0),(0,s._)([(0,a.Cb)({json:{write:!0}})],d.prototype,"name",void 0),(0,s._)([(0,a.Cb)({type:Number,json:{read:{source:"resultRecordCount"}}})],d.prototype,"num",void 0),(0,s._)([(0,a.Cb)({type:[Number],json:{write:!0}})],d.prototype,"objectIds",void 0),(0,s._)([(0,a.Cb)({type:Boolean,json:{default:!1,write:!0}})],d.prototype,"returnMetadata",void 0),(0,s._)([(0,a.Cb)({type:[Number],json:{write:!0}})],d.prototype,"size",void 0),(0,s._)([(0,a.Cb)({type:Number,json:{read:{source:"resultOffset"}}})],d.prototype,"start",void 0),(0,s._)([(0,p.c)("start"),(0,p.c)("num")],d.prototype,"writeStart",null),(0,s._)([(0,a.Cb)({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],d.prototype,"where",void 0),d=i=(0,s._)([(0,u.j)("esri.rest.support.AttachmentQuery")],d),d.from=(0,l.se)(d);const c=d},74889:(e,t,r)=>{r.d(t,{Z:()=>v});var i,s=r(43697),o=r(66577),n=r(38171),a=r(35454),l=r(96674),u=r(22974),p=r(70586),d=r(5600),c=(r(75215),r(71715)),y=r(52011),h=r(30556),f=r(82971),m=r(33955),b=r(1231);const g=new a.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let S=i=class extends l.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=f.Z.fromJSON(t.spatialReference),i=[];for(let t=0;t<e.length;t++){const s=e[t],o=n.Z.fromJSON(s),a=s.geometry&&s.geometry.spatialReference;(0,p.pC)(o.geometry)&&!a&&(o.geometry.spatialReference=r);const l=s.aggregateGeometries,u=o.aggregateGeometries;if(l&&(0,p.pC)(u))for(const e in u){const t=u[e],i=l[e]?.spatialReference;(0,p.pC)(t)&&!i&&(t.spatialReference=r)}i.push(o)}return i}writeGeometryType(e,t,r,i){if(e)return void g.write(e,t,r,i);const{features:s}=this;if(s)for(const e of s)if(e&&(0,p.pC)(e.geometry))return void g.write(e.geometry.type,t,r,i)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,i=(0,m.im)(e);return i&&!r&&t.spatialReference&&(i.spatialReference=f.Z.fromJSON(t.spatialReference)),i}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&(0,p.pC)(e.geometry)&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new i(this.cloneProperties())}cloneProperties(){return(0,u.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const i=t.features[r];if(i.geometry){const t=e&&e[r];i.geometry=t&&t.toJSON()||i.geometry}}return t}quantize(e){const{scale:[t,r],translate:[i,s]}=e,o=this.features,n=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-i)/t)),(e=>Math.round((s-e)/r)));for(let e=0,t=o.length;e<t;e++)n?.((0,p.Wg)(o[e].geometry))||(o.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[i,s],scale:[o,n]}=r,a=this._getHydrationFunction(e,(e=>e*o+i),(e=>s-e*n));for(const{geometry:e}of t)(0,p.pC)(e)&&a&&a(e);return this.transform=null,this}_quantizePoints(e,t,r){let i,s;const o=[];for(let n=0,a=e.length;n<a;n++){const a=e[n];if(n>0){const e=t(a[0]),n=r(a[1]);e===i&&n===s||(o.push([e-i,n-s]),i=e,s=n)}else i=t(a[0]),s=r(a[1]),o.push([i,s])}return o.length>0?o:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const i=(0,m.oU)(e)?e.rings:e.paths,s=[];for(let e=0,o=i.length;e<o;e++){const o=i[e],n=this._quantizePoints(o,t,r);n&&s.push(n)}return s.length>0?((0,m.oU)(e)?e.rings=s:e.paths=s,e):null}:"multipoint"===e?e=>{const i=this._quantizePoints(e.points,t,r);return i&&i.length>0?(e.points=i,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y)}:"polyline"===e||"polygon"===e?e=>{const i=(0,m.oU)(e)?e.rings:e.paths;let s,o;for(let e=0,n=i.length;e<n;e++){const n=i[e];for(let e=0,i=n.length;e<i;e++){const i=n[e];e>0?(s+=i[0],o+=i[1]):(s=i[0],o=i[1]),i[0]=t(s),i[1]=r(o)}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax)}:"multipoint"===e?e=>{const i=e.points;let s,o;for(let e=0,n=i.length;e<n;e++){const n=i[e];e>0?(s+=n[0],o+=n[1]):(s=n[0],o=n[1]),n[0]=t(s),n[1]=r(o)}}:null}};(0,s._)([(0,d.Cb)({type:String,json:{write:!0}})],S.prototype,"displayFieldName",void 0),(0,s._)([(0,d.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],S.prototype,"exceededTransferLimit",void 0),(0,s._)([(0,d.Cb)({type:[n.Z],json:{write:!0}})],S.prototype,"features",void 0),(0,s._)([(0,c.r)("features")],S.prototype,"readFeatures",null),(0,s._)([(0,d.Cb)({type:[b.Z],json:{write:!0}})],S.prototype,"fields",void 0),(0,s._)([(0,d.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],S.prototype,"geometryType",void 0),(0,s._)([(0,h.c)("geometryType")],S.prototype,"writeGeometryType",null),(0,s._)([(0,d.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],S.prototype,"hasM",void 0),(0,s._)([(0,d.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],S.prototype,"hasZ",void 0),(0,s._)([(0,d.Cb)({types:o.qM,json:{write:!0}})],S.prototype,"queryGeometry",void 0),(0,s._)([(0,c.r)("queryGeometry")],S.prototype,"readQueryGeometry",null),(0,s._)([(0,d.Cb)({type:f.Z,json:{write:!0}})],S.prototype,"spatialReference",void 0),(0,s._)([(0,h.c)("spatialReference")],S.prototype,"writeSpatialReference",null),(0,s._)([(0,d.Cb)({json:{write:!0}})],S.prototype,"transform",void 0),S=i=(0,s._)([(0,y.j)("esri.rest.support.FeatureSet")],S),S.prototype.toJSON.isDefaultToJSON=!0;const v=S},58333:(e,t,r)=>{r.d(t,{ET:()=>o,I4:()=>s,eG:()=>l,lF:()=>n,lj:()=>p,qP:()=>a,wW:()=>u});const i=[252,146,31,255],s={type:"esriSMS",style:"esriSMSCircle",size:6,color:i,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},o={type:"esriSLS",style:"esriSLSSolid",width:.75,color:i},n={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},l={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},u={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},p={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);