@arcgis/core 4.34.0-next.70 → 4.34.0-next.71

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 (85) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{f47a0b9e500af2b9453b.js → 1f51c94d392826fdbdf4.js} +1 -1
  3. package/assets/esri/core/workers/chunks/ada8e07ff12bc5d4a1d9.js +1 -0
  4. package/assets/esri/core/workers/chunks/{6f4079b7a2b45f304ee6.js → e21eeb4e78a46fb7e32e.js} +1 -1
  5. package/assets/esri/core/workers/chunks/ed8a85efbd90241512bb.js +1 -0
  6. package/config.js +1 -1
  7. package/geometry/support/aaBoundingBox.js +1 -1
  8. package/geometry/support/aaBoundingRect.js +1 -1
  9. package/geometry/support/rotate.js +1 -1
  10. package/interfaces.d.ts +10 -10
  11. package/kernel.js +1 -1
  12. package/layers/BaseElevationLayer.js +1 -1
  13. package/layers/graphics/sources/support/uploadAssets.js +1 -1
  14. package/networks/CircuitManager.js +1 -1
  15. package/networks/support/Circuit.js +5 -0
  16. package/networks/support/CircuitLocation.js +5 -0
  17. package/networks/support/CircuitPath.js +5 -0
  18. package/networks/support/CircuitPathConnectivityElement.js +5 -0
  19. package/networks/support/CircuitSection.js +5 -0
  20. package/networks/support/Subcircuit.js +5 -0
  21. package/networks/support/typeUtils.js +1 -1
  22. package/package.json +1 -1
  23. package/rest/networks/circuits/support/CircuitTraceResult.js +5 -0
  24. package/rest/networks/circuits/support/CircuitVerifyResult.js +1 -1
  25. package/rest/networks/circuits/support/CreateAlterCircuitParameters.js +1 -1
  26. package/rest/networks/circuits/support/QueryCircuitsParameters.js +1 -1
  27. package/rest/networks/circuits/support/QueryCircuitsResult.js +1 -1
  28. package/rest/networks/support/TraceLocation.js +1 -1
  29. package/rest/networks/support/TraceResult.js +1 -1
  30. package/rest/print.js +1 -1
  31. package/smartMapping/heuristics/scaleRange.js +1 -1
  32. package/smartMapping/heuristics/sizeRange.js +1 -1
  33. package/support/revision.js +1 -1
  34. package/views/2d/navigation/actions/Pan.js +1 -1
  35. package/views/2d/navigation/actions/Pinch.js +1 -1
  36. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  37. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  38. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  39. package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
  40. package/views/3d/camera/intersectionUtils.js +1 -1
  41. package/views/3d/constraints/Constraints.js +1 -1
  42. package/views/3d/layers/FlowSubView3D.js +1 -1
  43. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  44. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  45. package/views/3d/state/ConstraintsManager.js +1 -1
  46. package/views/3d/state/NearFarHeuristic.js +1 -1
  47. package/views/3d/state/ViewState.js +1 -1
  48. package/views/3d/state/ViewStateManager.js +1 -1
  49. package/views/3d/state/controllers/CameraController.js +1 -1
  50. package/views/3d/state/controllers/InteractiveController.js +1 -1
  51. package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
  52. package/views/3d/state/controllers/SurfaceCollisionCorrectionController.js +1 -1
  53. package/views/3d/state/controllers/momentum/MomentumController.js +1 -1
  54. package/views/3d/state/controllers/momentum/RotationMomentumController.js +1 -1
  55. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  56. package/views/3d/state/controllers/momentum/ZoomSphericalMomentumController.js +1 -1
  57. package/views/3d/support/MemoryController.js +1 -1
  58. package/views/3d/support/flow/loadUtils.js +1 -1
  59. package/views/3d/{support → terrain}/ElevationUpdateEvent.js +1 -1
  60. package/views/3d/terrain/Overlay.js +1 -1
  61. package/views/3d/terrain/OverlayManager.js +1 -1
  62. package/views/3d/terrain/TerrainSurface.js +1 -1
  63. package/views/3d/webgl/RenderCamera.js +1 -1
  64. package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
  65. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  66. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  67. package/views/SceneView.js +1 -1
  68. package/views/draw/support/Reshape.js +1 -1
  69. package/views/draw/support/drawUtils.js +1 -1
  70. package/views/draw/support/reshapeTooltipUtils.js +1 -1
  71. package/views/draw/support/reshapeUtils.js +5 -0
  72. package/views/interactive/tooltip/content/TooltipContentElevation.js +5 -0
  73. package/views/interactive/tooltip/content/tooltipContentFactory.js +1 -1
  74. package/views/interactive/tooltip/infos/ElevationTooltipInfo.js +5 -0
  75. package/views/navigation/Momentum.js +1 -1
  76. package/widgets/Editor/Upload.js +1 -1
  77. package/assets/esri/core/workers/chunks/57a579b0cbc1bcf0d903.js +0 -1
  78. package/assets/esri/core/workers/chunks/dd120d562b63618e71c0.js +0 -1
  79. package/rest/networks/support/Circuit.js +0 -5
  80. package/rest/networks/support/CircuitLocation.js +0 -5
  81. package/rest/networks/support/CircuitPath.js +0 -5
  82. package/rest/networks/support/CircuitPathConnectivityElement.js +0 -5
  83. package/rest/networks/support/CircuitSection.js +0 -5
  84. package/rest/networks/support/CircuitTraceResult.js +0 -5
  85. package/rest/networks/support/Subcircuit.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import{JSONSupport as o}from"../../../../core/JSONSupport.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../../geometry/Geometry.js";let p=class extends o{constructor(r){super(r),this.error=null,this.geometry=null,this.name=null}};r([t({type:Object})],p.prototype,"error",void 0),r([t({type:s})],p.prototype,"geometry",void 0),r([t({type:String})],p.prototype,"name",void 0),p=r([e("esri.rest.networks.circuits.support.CircuitVerifyResult")],p);const i=p;export{i as default};
5
+ import{__decorate as r}from"tslib";import{JSONSupport as o}from"../../../../core/JSONSupport.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../../geometry/Polyline.js";let p=class extends o{constructor(r){super(r),this.error=null,this.geometry=null,this.name=null}};r([t({type:Object})],p.prototype,"error",void 0),r([t({type:s})],p.prototype,"geometry",void 0),r([t({type:String})],p.prototype,"name",void 0),p=r([e("esri.rest.networks.circuits.support.CircuitVerifyResult")],p);const i=p;export{i as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import{JSONSupport as o}from"../../../../core/JSONSupport.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import{ensureClass as s}from"../../../../core/accessorSupport/ensureType.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";var i;let p=i=class extends o{static from(r){return s(i,r)}constructor(r){super(r),this.circuit=null,this.domainNetworkName=null,this.gdbVersion=null,this.sessionId=null}};r([t({json:{write:!0}})],p.prototype,"circuit",void 0),r([t({type:String,json:{write:!0}})],p.prototype,"domainNetworkName",void 0),r([t({type:String,json:{write:!0}})],p.prototype,"gdbVersion",void 0),r([t({type:String,json:{write:!0}})],p.prototype,"sessionId",void 0),p=i=r([e("esri.rest.networks.circuits.support.CreateAlterCircuitParameters")],p);const c=p;export{c as default};
5
+ import{__decorate as r}from"tslib";import{JSONSupport as o}from"../../../../core/JSONSupport.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import{ensureClass as s}from"../../../../core/accessorSupport/ensureType.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import i from"../../../../networks/support/Circuit.js";var p;let c=p=class extends o{static from(r){return s(p,r)}constructor(r){super(r),this.circuit=null,this.domainNetworkName=null,this.gdbVersion=null,this.sessionId=null}};r([t({type:i,json:{write:!0}})],c.prototype,"circuit",void 0),r([t({type:String,json:{write:!0}})],c.prototype,"domainNetworkName",void 0),r([t({type:String,json:{write:!0}})],c.prototype,"gdbVersion",void 0),r([t({type:String,json:{write:!0}})],c.prototype,"sessionId",void 0),c=p=r([e("esri.rest.networks.circuits.support.CreateAlterCircuitParameters")],c);const n=c;export{n as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{JSONSupport as o}from"../../../../core/JSONSupport.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import{ensureClass as e}from"../../../../core/accessorSupport/ensureType.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{writer as s}from"../../../../core/accessorSupport/decorators/writer.js";var n;let p=n=class extends o{static from(t){return e(n,t)}constructor(t){super(t),this.gdbVersion=null,this.sessionId=null,this.moment=null,this.domainNetworkName=null,this.circuits=null,this.location=null,this.terminalId=1,this.locationType=null,this.returnConsumerCircuits=!1,this.resultTypes=null}writeLocation(t,o){null!=t&&(o.sourceId=t.sourceId,o.globalId=t.globalId,o.firstUnit=t.firstUnit,o.numUnits=t.numUnits)}};t([r({type:String,json:{write:!0}})],p.prototype,"gdbVersion",void 0),t([r({type:String,json:{write:!0}})],p.prototype,"sessionId",void 0),t([r({type:Date,json:{type:Number,write:{writer:(t,o)=>{o.moment=t?t.getTime():null}}}})],p.prototype,"moment",void 0),t([r({type:String,json:{write:!0}})],p.prototype,"domainNetworkName",void 0),t([r({type:[String],json:{write:!0}})],p.prototype,"circuits",void 0),t([r({type:Object,json:{write:!0}})],p.prototype,"location",void 0),t([s("location")],p.prototype,"writeLocation",null),t([r({type:Number,json:{write:!0}})],p.prototype,"terminalId",void 0),t([r({type:String,json:{write:!0}})],p.prototype,"locationType",void 0),t([r({type:Boolean,json:{write:!0}})],p.prototype,"returnConsumerCircuits",void 0),t([r({type:[String],json:{write:!0}})],p.prototype,"resultTypes",void 0),p=n=t([i("esri.rest.networks.circuits.support.QueryCircuitsParameters")],p);const c=p;export{c as default};
5
+ import{__decorate as t}from"tslib";import{JSONSupport as o}from"../../../../core/JSONSupport.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import{ensureClass as e}from"../../../../core/accessorSupport/ensureType.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{writer as s}from"../../../../core/accessorSupport/decorators/writer.js";import n from"../../../../networks/support/CircuitLocation.js";var p;let c=p=class extends o{static from(t){return e(p,t)}constructor(t){super(t),this.gdbVersion=null,this.sessionId=null,this.moment=null,this.domainNetworkName=null,this.circuits=null,this.location=null,this.locationType=null,this.returnConsumerCircuits=!1,this.resultTypes=null}writeLocation(t,o){null!=t&&(o.sourceId=t.sourceId,o.globalId=t.globalId,o.terminalId=t.terminalId,o.firstUnit=t.firstUnit,o.numUnits=t.numUnits)}};t([r({type:String,json:{write:!0}})],c.prototype,"gdbVersion",void 0),t([r({type:String,json:{write:!0}})],c.prototype,"sessionId",void 0),t([r({type:Date,json:{type:Number,write:{writer:(t,o)=>{o.moment=t?t.getTime():null}}}})],c.prototype,"moment",void 0),t([r({type:String,json:{write:!0}})],c.prototype,"domainNetworkName",void 0),t([r({type:[String],json:{write:!0}})],c.prototype,"circuits",void 0),t([r({type:n,json:{write:!0}})],c.prototype,"location",void 0),t([s("location")],c.prototype,"writeLocation",null),t([r({type:String,json:{write:!0}})],c.prototype,"locationType",void 0),t([r({type:Boolean,json:{write:!0}})],c.prototype,"returnConsumerCircuits",void 0),t([r({type:[String],json:{write:!0}})],c.prototype,"resultTypes",void 0),c=p=t([i("esri.rest.networks.circuits.support.QueryCircuitsParameters")],c);const u=c;export{u as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import{JSONSupport as t}from"../../../../core/JSONSupport.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";let e=class extends t{constructor(r){super(r),this.circuits=null,this.circuitNames=null}};r([o({type:[Object],json:{type:[Object],write:!0}})],e.prototype,"circuits",void 0),r([o({type:[String],json:{write:!0}})],e.prototype,"circuitNames",void 0),e=r([s("esri.rest.networks.circuits.support.QueryCircuitsResult")],e);export{e as default};
5
+ import{__decorate as r}from"tslib";import{JSONSupport as o}from"../../../../core/JSONSupport.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import e from"../../../../networks/support/Circuit.js";let i=class extends o{constructor(r){super(r),this.circuits=null,this.circuitNames=null}};r([t({type:[e],json:{write:!0}})],i.prototype,"circuits",void 0),r([t({type:[String],json:{write:!0}})],i.prototype,"circuitNames",void 0),i=r([s("esri.rest.networks.circuits.support.QueryCircuitsResult")],i);export{i as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{JSONMap as r}from"../../../core/jsonMap.js";import{JSONSupport as o}from"../../../core/JSONSupport.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";const s=new r({startingPoint:"starting-point",barrier:"barrier",stoppingPoint:"stopping-point"});let p=class extends o{constructor(t){super(t),this.globalId=null,this.isFilterBarrier=!1,this.percentAlong=null,this.terminalId=null,this.type=null,this.firstUnit=null,this.numUnits=null}};t([e({type:String,json:{write:!0}})],p.prototype,"globalId",void 0),t([e({type:Boolean,json:{write:!0}})],p.prototype,"isFilterBarrier",void 0),t([e({type:Number,json:{write:!0}})],p.prototype,"percentAlong",void 0),t([e({type:Number,json:{write:!0}})],p.prototype,"terminalId",void 0),t([e({type:s.apiValues,json:{type:s.jsonValues,read:{reader:s.read,source:"traceLocationType"},write:{writer:s.write,target:"traceLocationType"}}})],p.prototype,"type",void 0),t([e({type:Number,json:{write:!0}})],p.prototype,"firstUnit",void 0),t([e({type:Number,json:{write:!0}})],p.prototype,"numUnits",void 0),p=t([i("esri.rest.networks.support.TraceLocation")],p);const n=p;export{n as default};
5
+ import{__decorate as t}from"tslib";import{JSONSupport as r}from"../../../core/JSONSupport.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import{traceLocationTypeKebabDict as s}from"../../../networks/support/typeUtils.js";let i=class extends r{constructor(t){super(t),this.globalId=null,this.isFilterBarrier=!1,this.percentAlong=null,this.terminalId=null,this.type=null,this.firstUnit=null,this.numUnits=null,this.networkSourceId=null}};t([o({type:String,json:{write:!0}})],i.prototype,"globalId",void 0),t([o({type:Boolean,json:{write:!0}})],i.prototype,"isFilterBarrier",void 0),t([o({type:Number,json:{write:!0}})],i.prototype,"percentAlong",void 0),t([o({type:Number,json:{write:!0}})],i.prototype,"terminalId",void 0),t([o({type:s.apiValues,json:{type:s.jsonValues,read:{reader:s.read,source:"traceLocationType"},write:{writer:s.write,target:"traceLocationType"}}})],i.prototype,"type",void 0),t([o({type:Number,json:{write:!0}})],i.prototype,"firstUnit",void 0),t([o({type:Number,json:{write:!0}})],i.prototype,"numUnits",void 0),t([o({type:Number})],i.prototype,"networkSourceId",void 0),i=t([e("esri.rest.networks.support.TraceLocation")],i);const p=i;export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{JSONSupport as t}from"../../../core/JSONSupport.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{reader as o}from"../../../core/accessorSupport/decorators/reader.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{writer as n}from"../../../core/accessorSupport/decorators/writer.js";import i from"./AggregatedGeometry.js";import p from"./CircuitPath.js";import l from"./CircuitTraceResult.js";import a from"./FunctionResult.js";import m from"./NetworkElement.js";import u from"./TelecomNetworkElement.js";let c=class extends t{constructor(e){super(e),this.aggregatedGeometry=null,this.circuits=null,this.elements=null,this.globalFunctionResults=null,this.kFeaturesForKNNFound=!1,this.paths=null,this.startingPointsIgnored=!1,this.warnings=null}readNetworkElements(e,t){return null!=t.elements&&Array.isArray(t.elements)?t.elements.map(e=>"firstUnit"in e&&"numUnits"in e?new u({...e}):new m({...e})):[]}writeNetworkElements(e,t){t.elements=e.map(e=>e.toJSON())}};e([r({type:i,json:{write:!0},readOnly:!0})],c.prototype,"aggregatedGeometry",void 0),e([r({type:[l],json:{write:!0},readOnly:!0})],c.prototype,"circuits",void 0),e([r({type:[m],json:{write:!0},readOnly:!0})],c.prototype,"elements",void 0),e([o("elements")],c.prototype,"readNetworkElements",null),e([n("elements")],c.prototype,"writeNetworkElements",null),e([r({type:[a],json:{write:!0},readOnly:!0})],c.prototype,"globalFunctionResults",void 0),e([r({type:Boolean,json:{write:!0},readOnly:!0})],c.prototype,"kFeaturesForKNNFound",void 0),e([r({type:[p],json:{write:!0},readOnly:!0})],c.prototype,"paths",void 0),e([r({type:Boolean,json:{write:!0},readOnly:!0})],c.prototype,"startingPointsIgnored",void 0),e([r({type:[String],json:{write:!0},readOnly:!0})],c.prototype,"warnings",void 0),c=e([s("esri.rest.networks.support.TraceResult")],c);export{c as default};
5
+ import{__decorate as e}from"tslib";import{JSONSupport as t}from"../../../core/JSONSupport.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{reader as o}from"../../../core/accessorSupport/decorators/reader.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{writer as n}from"../../../core/accessorSupport/decorators/writer.js";import i from"../../../networks/support/CircuitPath.js";import p from"../circuits/support/CircuitTraceResult.js";import l from"./AggregatedGeometry.js";import a from"./FunctionResult.js";import m from"./NetworkElement.js";import u from"./TelecomNetworkElement.js";let c=class extends t{constructor(e){super(e),this.aggregatedGeometry=null,this.circuits=null,this.elements=null,this.globalFunctionResults=null,this.kFeaturesForKNNFound=!1,this.paths=null,this.startingPointsIgnored=!1,this.warnings=null}readNetworkElements(e,t){return null!=t.elements&&Array.isArray(t.elements)?t.elements.map(e=>"firstUnit"in e&&"numUnits"in e?new u({...e}):new m({...e})):[]}writeNetworkElements(e,t){t.elements=e.map(e=>e.toJSON())}};e([r({type:l,json:{write:!0},readOnly:!0})],c.prototype,"aggregatedGeometry",void 0),e([r({type:[p],json:{write:!0},readOnly:!0})],c.prototype,"circuits",void 0),e([r({type:[m],json:{write:!0},readOnly:!0})],c.prototype,"elements",void 0),e([o("elements")],c.prototype,"readNetworkElements",null),e([n("elements")],c.prototype,"writeNetworkElements",null),e([r({type:[a],json:{write:!0},readOnly:!0})],c.prototype,"globalFunctionResults",void 0),e([r({type:Boolean,json:{write:!0},readOnly:!0})],c.prototype,"kFeaturesForKNNFound",void 0),e([r({type:[i],json:{write:!0},readOnly:!0})],c.prototype,"paths",void 0),e([r({type:Boolean,json:{write:!0},readOnly:!0})],c.prototype,"startingPointsIgnored",void 0),e([r({type:[String],json:{write:!0},readOnly:!0})],c.prototype,"warnings",void 0),c=e([s("esri.rest.networks.support.TraceResult")],c);export{c as default};
package/rest/print.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{id as e}from"../kernel.js";import t from"../request.js";import{JSONMap as i}from"../core/jsonMap.js";import{createScreenPoint as a,pt2px as r,px2pt as n}from"../core/screenUtils.js";import{dataComponents as o,normalize as s}from"../core/urlUtils.js";import l from"../geometry/Polygon.js";import{collectLabelingFields as c}from"../layers/support/fieldUtils.js";import{getFloorFilterClause as u}from"../layers/support/floorFilterUtils.js";import{getSizeRangeAtScale as y}from"../renderers/visualVariables/support/visualVariableUtils.js";import{asValidOptions as p,findToken as f}from"./utils.js";import{execute as d}from"./geoprocessor/execute.js";import{submitJob as m}from"./geoprocessor/submitJob.js";import{formatJsonMap as g}from"./support/fileFormat.js";import{toJSON as h}from"./support/layoutTemplate.js";import{getVisibleLayerViews as b,isScreenshotRequired as w,isBingMapsLayer as S,isBlendLayer as x,getCopyright as I,getSelectionSymbol as v,createPointLayer as D,createPolygonLayer as T,createPolylineLayer as L,createMultipointLayer as O,getContextBoundingBox as E}from"./support/printTaskUtils.js";import P from"./support/PrintTemplate.js";import{toJSON as M}from"./support/reportTemplate.js";import{getDefaultHighlightOptions as V}from"../views/2d/support/highlightOptionsUtils.js";import F from"../views/support/HighlightOptions.js";const k={Feet:"ft",Kilometers:"km",Meters:"m",Miles:"mi"},N=new i({esriFeet:"Feet",esriKilometers:"Kilometers",esriMeters:"Meters",esriMiles:"Miles"}),U=new i({esriExecutionTypeSynchronous:"sync",esriExecutionTypeAsynchronous:"async"}),R=new Map;async function j(e,t,i){const a=await J(e,i),r=await $(t,a);if("sync"===await A(e,i)){const{results:t}=await d(e,r,void 0,i);return t?.[0]?.value}const n=await m(e,r,void 0,i);await n.waitForJobCompletion({interval:t.updateDelay});const{value:o}=await n.fetchResultData("Output_File",null,i);return o}async function J(e,i){const a=q(e),r=R.get(a)??{gpServerUrl:a,legendLayerNameMap:{},legendLayers:[]};return r.gpMetadata??=(await t(a,p({f:"json"},i))).data,r.cimVersion=r.gpMetadata.cimVersion,R.set(a,r),r}async function A(e,t){return xe(await J(e,t))}async function C(e,i){const a=await J(e,i),r=a.gpMetadata.tasks,n=a.gpServerUrl;return a.taskInfos||(a.taskInfos={},await Promise.all(r?.map(async e=>{const r=(await t(`${n}/${e}`,p({f:"json"},i))).data,o=r.name.startsWith("GetLayoutTemplatesInfo")?"GetLayoutTemplatesInfo":r.name.startsWith("ExportWebMap")?"ExportWebMap":null;o&&(a.taskInfos[o]??=r)})??[])),a.taskInfos}async function _(e,t,i){return(await C(e,i))[t]??null}async function z(e,t,i){const a=await _(e,t,i);return a?.executionType?U.fromJSON(a.executionType):"sync"}async function $(t,i){i=i||{is11xService:!1,legendLayerNameMap:{},legendLayers:[]};const a=t.template||new P;null==a.showLabels&&(a.showLabels=!0);const r=a.exportOptions;let n;const o=h(a.layout);if(r){if(n={dpi:r.dpi},"map_only"===o?.toLowerCase()||""===o){const{width:e,height:t}=r;n.outputSize=null!=e&&null!=t?[e,t]:void 0}}const s=a.layoutOptions;let l;if(s){let e,t;"Miles"===s.scalebarUnit||"Kilometers"===s.scalebarUnit?(e="Kilometers",t="Miles"):"Meters"!==s.scalebarUnit&&"Feet"!==s.scalebarUnit||(e="Meters",t="Feet"),l={titleText:s.titleText,authorText:s.authorText,copyrightText:s.copyrightText,customTextElements:s.customTextElements,elementOverrides:s.elementOverrides,scaleBarOptions:e||t?{metricUnit:N.toJSON(e)??void 0,metricLabel:e?k[e]:void 0,nonMetricUnit:N.toJSON(t)??void 0,nonMetricLabel:t?k[t]:void 0}:void 0}}let c=null;s?.legendLayers&&(c=s.legendLayers.map(e=>{const t=e.layerId;i.legendLayerNameMap[t]=e.title;const a={id:t};return e.subLayerIds&&(a.subLayerIds=e.subLayerIds),a}));const u=await W(t,a,i);if(u.operationalLayers){const e=new RegExp("[\\u4E00-\\u9FFF\\u0E00-\\u0E7F\\u0900-\\u097F\\u3040-\\u309F\\u30A0-\\u30FF\\u31F0-\\u31FF]"),t=/[\u0600-\u06FF]/,i=i=>{const a=i.text,r=i.font,n=r?.family?.toLowerCase();a&&r&&("arial"===n||"arial unicode ms"===n)&&(r.family=e.test(a)?"Arial Unicode MS":"Arial","normal"!==r.style&&t.test(a)&&(r.family="Arial Unicode MS"))};for(const a of u.operationalLayers)if(a.featureCollection?.layers)for(const e of a.featureCollection.layers){if(e.layerDefinition?.drawingInfo?.renderer?.symbol){const t=e.layerDefinition.drawingInfo.renderer;"esriTS"===t.symbol.type&&i(t.symbol)}if(e.featureSet?.features)for(const t of e.featureSet.features)t.symbol&&"esriTS"===t.symbol.type&&i(t.symbol)}}t.outSpatialReference&&(u.mapOptions.spatialReference=t.outSpatialReference.toJSON()),Object.assign(u,{exportOptions:n,layoutOptions:l||{}}),Object.assign(u.layoutOptions,{legendOptions:{operationalLayers:null!=c?c:i.legendLayers.slice()}}),i.legendLayers.length=0,R.set(i.gpServerUrl,i);const y={Web_Map_as_JSON:JSON.stringify(u),Format:g.toJSON(a.format),Layout_Template:o,Layout_Item_ID:void 0,Report_Template:M(a.report),Report_Item_ID:void 0};if(a.layoutItem){delete y.Layout_Template;const t=a.layoutItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(i.gpServerUrl),y.Layout_Item_ID=JSON.stringify({id:t.id})}if(a.reportItem){delete y.Report_Template;const t=a.reportItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(i.gpServerUrl),y.Report_Item_ID=JSON.stringify({id:t.id})}return t.extraParameters&&Object.assign(y,t.extraParameters),y}async function W(e,t,i){const a=e.view;let r=a.spatialReference;const n={operationalLayers:await B(a,t,i)};t.includeTables&&(n.tables=await ce(a));let o=e.extent||i.ssExtent||a.extent;if(r?.isWrappable&&(o=o.clone()._normalize(!0),r=o.spatialReference),n.mapOptions={extent:o&&o.toJSON(),spatialReference:r&&r.toJSON(),showAttribution:t.attributionVisible},i.ssExtent=null,a.background&&(n.background=a.background.toJSON()),a.rotation&&(n.mapOptions.rotation=-a.rotation),t.scalePreserved&&(n.mapOptions.scale=t.outScale||a.scale),null!=a.timeExtent){const e=null!=a.timeExtent.start?a.timeExtent.start.getTime():null,t=null!=a.timeExtent.end?a.timeExtent.end.getTime():null;n.mapOptions.time=[e,t]}return t.reportOptions&&(n.reportOptions=t.reportOptions),n}function q(e){let t=e;const i=t.lastIndexOf("/GPServer/");return i>0&&(t=t.slice(0,i+9)),t}async function B(e,t,i){const a=[],r={layerView:null,printTemplate:t,view:e};let n=0;t.scalePreserved&&(n=t.outScale||e.scale);const o=b(e,n);for(const s of o){const e=s.layer;if(!e.loaded||"layers"in e)continue;let t;r.layerView=s,t=w(s)?await oe(e,r,i):S(e)?K(e):"csv"===e?.type?await H(e,r,i):"catalog-footprint"===e?.type?await G(e,r,i):"feature"===e?.type?await X(e,r,i):"geojson"===e?.type?await Y(e,r,i):"graphics"===e?.type?await Z(e,r,i):"imagery"===e?.type?ee(e,i):"imagery-tile"===e?.type?await te(e,r,i):"kml"===e?.type?await ie(e,r,i):"map-image"===e?.type?ae(e,r,i):"map-notes"===e?.type?await re(r,i):"open-street-map"===e?.type?ne():"stream"===e?.type?await se(e,r,i):"subtype-group"===e?.type?await le(e,i):"tile"===e?.type?ue(e,i):"vector-tile"===e?.type?await ye(e,r,i):"web-tile"===e?.type?pe(e):"wfs"===e?.type?await fe(e,r,i):"wms"===e?.type?de(e,i):"wmts"===e?.type?me(e):await oe(e,r,i),t&&(Array.isArray(t)?a.push(...t):(t.id=e.id,t.title=i.legendLayerNameMap[e.id]||e.title,t.opacity=s.fullOpacity,t.minScale=e.minScale||0,t.maxScale=e.maxScale||0,x(e)&&e.blendMode&&"normal"!==e.blendMode&&(t.blendMode=e.blendMode),a.push(t)))}if(n)for(const s of a)s.minScale=0,s.maxScale=0;if(e.graphics?.length){const r=await Q(null,e.graphics,t,i);r&&a.push(r)}return a}function K(e){return{culture:e.culture,key:e.key,type:"BingMaps"+("aerial"===e.style?"Aerial":"hybrid"===e.style?"Hybrid":"Road")}}async function G(e,{layerView:t,printTemplate:i},a){if(parseFloat(a.cimVersion)<3.1){return Q(e,await we(t),i,a)}const r=e.parent,n={id:(o=Se(r,"web-map")).id,url:o.url,layerType:o.layerType,customParameters:o.customParameters,dynamicGroupLayer:{visibility:!1},footprintLayer:o.footprintLayer,layerDefinition:o.layerDefinition};var o;return ge(n,r),n}async function H(e,t,i){e.legendEnabled&&i.legendLayers.push({id:e.id});const a=t.layerView,r=t.printTemplate;if(!(a.filter||e.portalItem&&"public"!==e.portalItem.access)){const t=Se(e,"web-map");return t.type="CSV",delete t.popupInfo,delete t.layerType,t.showLabels=r.showLabels&&e.labelsVisible,t}return Q(e,await we(a),r,i)}async function Q(e,t,i,a){let r;const n=T(),o=L(),s=D(),u=O(),y=D();if(y.layerDefinition.name="textLayer",delete y.layerDefinition.drawingInfo,e){if("esri.layers.FeatureLayer"===e.declaredClass||"esri.layers.StreamLayer"===e.declaredClass?n.layerDefinition.name=o.layerDefinition.name=s.layerDefinition.name=u.layerDefinition.name=a.legendLayerNameMap[e.id]||e.arcgisProps?.title||e.title:"esri.layers.GraphicsLayer"===e.declaredClass&&(t=e.graphics.items),e.renderer){const t=e.renderer.toJSON(),i=n.layerDefinition.drawingInfo;i&&(i.renderer=t);const a=o.layerDefinition.drawingInfo;a&&(a.renderer=t);const r=s.layerDefinition.drawingInfo;r&&(r.renderer=t);const l=u.layerDefinition.drawingInfo;l&&(l.renderer=t)}if(i.showLabels&&e.labelsVisible&&"function"==typeof e.write){const t=Se(e,"web-map"),i=t.layerDefinition?.drawingInfo?.labelingInfo;if(i){r=!0;const e=n.layerDefinition.drawingInfo;e&&(e.labelingInfo=i);const t=o.layerDefinition.drawingInfo;t&&(t.labelingInfo=i);const a=s.layerDefinition.drawingInfo;a&&(a.labelingInfo=i);const l=u.layerDefinition.drawingInfo;l&&(l.labelingInfo=i)}}}let p;e?.renderer||r||(delete n.layerDefinition.drawingInfo,delete o.layerDefinition.drawingInfo,delete s.layerDefinition.drawingInfo,delete u.layerDefinition.drawingInfo);const f=e?.fieldsIndex,d=e?.renderer;if(f){const t=new Set;r&&await c(t,e),d&&"function"==typeof d.collectRequiredFields&&await d.collectRequiredFields(t,f),p=Array.from(t);const i=f.fields.map(e=>e.toJSON());n.layerDefinition.fields=i,o.layerDefinition.fields=i,s.layerDefinition.fields=i,u.layerDefinition.fields=i}const m=t?.length;let g;for(let c=0;c<m;c++){const e=t[c]||t.at(c);if(!1!==e.visible&&e.geometry){if(g=e.toJSON(),g.hasOwnProperty("popupTemplate")&&delete g.popupTemplate,g.geometry?.z&&delete g.geometry.z,g.symbol&&(g.symbol.angle||delete g.symbol.angle,Ie(g.symbol)?g.symbol=await he(g.symbol,a):g.symbol.text&&delete g.attributes),(!i||!i.forceFeatureAttributes)&&p?.length){const e={};for(const t of p)g.attributes?.hasOwnProperty(t)&&(e[t]=g.attributes[t]);g.attributes=e}"polygon"===e.geometry.type?n.featureSet.features.push(g):"polyline"===e.geometry.type?o.featureSet.features.push(g):"point"===e.geometry.type?g.symbol?.text?y.featureSet.features.push(g):s.featureSet.features.push(g):"multipoint"===e.geometry.type?u.featureSet.features.push(g):"extent"===e.geometry.type&&(g.geometry=l.fromExtent(e.geometry).toJSON(),n.featureSet.features.push(g))}}const h=[n,o,u,s,y].filter(e=>e.featureSet.features.length>0);for(const l of h){const e=l.featureSet.features.every(e=>e.symbol);if(e&&(!i||!i.forceFeatureAttributes))for(const t of l.featureSet.features)delete t.attributes;e&&delete l.layerDefinition.drawingInfo,l.layerDefinition.drawingInfo?.renderer&&await be(l.layerDefinition.drawingInfo.renderer,a)}return h.length?{featureCollection:{layers:h},showLabels:r}:null}async function X(e,t,i){let a;const r=e.renderer,n=parseFloat(i.cimVersion);if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type&&(n<2.9||"pie-chart"===e.featureReduction.renderer?.type)||"pie-chart"===r?.type&&n<3.1||"dot-density"===r?.type&&n<2.6)return oe(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});const o=t.layerView,{printTemplate:s,view:l}=t,c="feature-layer"!==e.source?.type&&"ogc-feature"!==e.source?.type;if(o.filter||c||!r||"field"in r&&null!=r.field&&!e.getField(r.field)){const t=await we(o);a=await Q(e,t,s,i)}else{if(a={id:(p=Se(e)).id,title:p.title,url:p.url,layerType:p.layerType,customParameters:p.customParameters,layerDefinition:p.layerDefinition,charts:s.includeCharts?p.charts:void 0},s.attributionVisible&&(a.credits=I(e)),a.showLabels=s.showLabels&&e.labelsVisible,ge(a,e),delete a.layerDefinition?.featureReduction?.disablePopup,delete a.layerDefinition?.featureReduction?.popupInfo,o.displayFilterEnabled||delete a.layerDefinition?.displayFilterInfo,a.layerDefinition?.drawingInfo?.renderer&&(delete a.layerDefinition.minScale,delete a.layerDefinition.maxScale,await be(a.layerDefinition.drawingInfo.renderer,i),"visualVariables"in r&&r.visualVariables?.[0])){const e=r.visualVariables[0];if("size"===e.type&&e.maxSize&&"number"!=typeof e.maxSize&&e.minSize&&"number"!=typeof e.minSize){const t=y(e,l.scale);a.layerDefinition.drawingInfo.renderer.visualVariables[0].minSize=t.minSize,a.layerDefinition.drawingInfo.renderer.visualVariables[0].maxSize=t.maxSize}}const t=u(o);if(t&&(a.layerDefinition??={},a.layerDefinition.definitionExpression=a.layerDefinition.definitionExpression?`(${a.layerDefinition.definitionExpression}) AND (${t})`:t),e.gdbVersion&&(a.layerDefinition??={},a.layerDefinition.gdbVersion=e.gdbVersion),o.hasHighlight&&"highlightIds"in o){const t=o;a.selectionObjectIds=t.highlightIds;const i=V(t)||V(l)||new F;a.selectionSymbol=v(e.geometryType,i)}}var p;return a}async function Y(e,t,i){if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type)return oe(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});return Q(e,await we(t.layerView),t.printTemplate,i)}async function Z(e,{printTemplate:t},i){return Q(e,null,t,i)}function ee(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const i={layerType:(a=Se(e)).layerType,customParameters:a.customParameters};var a;return i.bandIds=e.bandIds,i.compressionQuality=e.compressionQuality,i.format=e.format,i.interpolation=e.interpolation,(e.mosaicRule||e.definitionExpression)&&(i.mosaicRule=e.exportImageServiceParameters.mosaicRule.toJSON()),e.rasterFunction&&(i.renderingRule=e.rasterFunction.toJSON()),e.renderer&&(i.layerDefinition??={},i.layerDefinition.drawingInfo??={},i.layerDefinition.drawingInfo.renderer=e.renderer.toJSON()),ge(i,e),i}async function te(e,t,i){if("flow"===e.renderer?.type)return oe(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});const a={bandIds:(r=Se(e)).bandIds,customParameters:r.customParameters,interpolation:r.interpolation,layerDefinition:r.layerDefinition};var r;return a.layerType="ArcGISImageServiceLayer",ge(a,e),a}async function ie(e,t,i){const a=t.printTemplate;if(!e.portalItem||"public"===e.portalItem.access){const t=Se(e,"web-map");return t.type="kml",delete t.layerType,t.url=s(e.url),t}const r=[],n=t.layerView,o="data:image/png;base64,";n.allVisibleMapImages.forEach((t,i)=>{const a={id:`${e.id}_image${i}`,type:"image",title:e.id,minScale:e.minScale||0,maxScale:e.maxScale||0,opacity:n.fullOpacity,extent:t.extent};t.href.startsWith(o)?a.imageData=t.href.slice(o.length):a.url=t.href,r.push(a)});const l=[...n.allVisiblePoints.items,...n.allVisiblePolylines.items,...n.allVisiblePolygons.items],c={id:e.id,...await Q(null,l,a,i)};return r.push(c),r}function ae(e,{printTemplate:t,view:i},a){let r;const n={id:e.id,subLayerIds:[]};let o=[];const s=i.scale,l=e=>{const t=0===s,i=0===e.minScale||s<=e.minScale,a=0===e.maxScale||s>=e.maxScale;if(e.visible&&(t||i&&a))if(e.sublayers)e.sublayers.forEach(l);else{const t=e.toExportImageJSON(),i={id:e.id,name:e.title,layerDefinition:{definitionExpression:t.definitionExpression,drawingInfo:t.drawingInfo,orderBy:t.orderBy,source:t.source}};o.unshift(i),n.subLayerIds.push(e.id)}};var c;return e.sublayers?.forEach(l),o.length&&(o=o.map(({id:e,name:t,layerDefinition:i})=>({id:e,name:t,layerDefinition:i})),r={layerType:(c=Se(e)).layerType,customParameters:c.customParameters},r.layers=o,r.visibleLayers=e.capabilities?.exportMap?.supportsDynamicLayers?void 0:n.subLayerIds,t.attributionVisible&&(r.credits=I(e)),e.gdbVersion&&(r.gdbVersion=e.gdbVersion),ge(r,e),e.legendEnabled&&a.legendLayers.push(n)),r}async function re({layerView:e,printTemplate:t},i){const a=[],r=e.layer;if(null!=r.featureCollections)for(const n of r.featureCollections){const e=await Q(n,n.source,t,i);e&&a.push(...e.featureCollection.layers)}else if(null!=r.sublayers)for(const n of r.sublayers){const e=await Q(null,n.graphics,t,i);e&&a.push(...e.featureCollection.layers)}return{featureCollection:{layers:a}}}function ne(){return{type:"OpenStreetMap"}}async function oe(e,{printTemplate:t,view:i},r){const n={type:"image"},s={format:"png",ignoreBackground:!0,ignorePadding:!0,layers:[e]};0!==i.rotation&&(s.rotation=0);const l=r.ssExtent||i.state.extent.clone();let c=96,u=!0,y=!0;if(t.exportOptions){const e=t.exportOptions;null!=e.dpi&&e.dpi>0&&(c=e.dpi),null!=e.width&&e.width>0&&(u=e.width%2==i.width%2),null!=e.height&&e.height>0&&(y=e.height%2==i.height%2)}if("map-only"===t.layout&&t.scalePreserved&&(!t.outScale||t.outScale===i.scale)&&96===c&&(!u||!y)&&i.state.extent.equals(i.extent)&&(s.area={x:0,y:0,width:i.width,height:i.height},u||(s.area.width-=1),y||(s.area.height-=1),!r.ssExtent)){const e=i.toMap(a(s.area.width,s.area.height));l.ymin=e.y,l.xmax=e.x,r.ssExtent=l}n.extent=l.clone()._normalize(!0).toJSON();const p=await i.takeScreenshot(s);return n.imageData=o(p.dataUrl)?.data,n}async function se(e,{layerView:t,printTemplate:i},a){e.legendEnabled&&a.legendLayers.push({id:e.id});return Q(e,await we(t),i,a)}async function le(e,t){if(e.legendEnabled)for(const r of e.sublayers)r.legendEnabled&&t.legendLayers.push({id:r.id});const i={customParameters:(a=Se(e)).customParameters,effect:a.effect,layerDefinition:a.layerDefinition,layerType:a.layerType,layers:a.layers,url:a.url};var a;if(ge(i,e),Array.isArray(i.layers)){for(const e of i.layers)delete e.popupInfo;i.token&&i.layers.length>0&&(i.layers[i.layers.length-1].token=i.token,delete i.token)}return i}async function ce(e){const t=[],i=[];for(const a of e.map.allTables)"feature"!==a.type||a.loaded||i.push(a.load());i.length&&await Promise.allSettled(i);for(const a of e.map.allTables)if("feature"===a.type&&a.loaded&&a.isTable&&"feature-layer"===a.source?.type){const e=(e=>({id:e.id,title:e.title,customParameters:e.customParameters,layerDefinition:{definitionExpression:e.layerDefinition?.definitionExpression},url:e.url}))(Se(a));ge(e,a),t.push(e)}return t.length?t:void 0}function ue(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const i={layerType:(a=Se(e)).layerType,customParameters:a.customParameters};var a;return ge(i,e),i}async function ye(e,t,i){const a=t.layerView;if(e.serviceUrl&&e.styleUrl&&!a.spriteSourceChanged&&!a.styleChanged){const t=f(e.styleUrl,e.apiKey),a=f(e.serviceUrl,e.apiKey);if(!t&&!a||"2.1.0"!==i.cimVersion){const i={type:"VectorTileLayer"};return i.styleUrl=s(e.styleUrl),i.token=t,a!==t&&(i.additionalTokens=[{url:e.serviceUrl,token:a}]),i}}return oe(e,t,i)}function pe(e){const t=e.urlTemplate?.replace(/\${/g,"{"),i={type:"WebTiledLayer",urlTemplate:t,credits:e.copyright};return e.subDomains&&e.subDomains.length>0&&(i.subDomains=e.subDomains),i}async function fe(e,t,i){return parseFloat(i.cimVersion)<3.5?oe(e,t,i):(e.legendEnabled&&i.legendLayers.push({id:e.id}),{layerType:(a=Se(e,"web-map")).layerType,layerDefinition:a.layerDefinition,url:a.url,wfsInfo:a.wfsInfo});var a}function de(e,t){let i;const a=[],r=e=>{e.visible&&(e.sublayers?e.sublayers.forEach(r):e.name&&a.unshift(e.name))};return e.sublayers&&e.sublayers.forEach(r),a.length&&(e.legendEnabled&&t.legendLayers.push({id:e.id,subLayerIds:a}),i={type:"wms",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,transparentBackground:e.imageTransparency,visibleLayers:a,url:s(e.url),version:e.version}),i}function me(e){const t=e.activeLayer;return{type:"wmts",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,format:t.imageFormat,layer:t.id,style:t.styleId,tileMatrixSet:t.tileMatrixSetId,url:s(e.url)}}function ge(e,t){t.url&&(e.url=s(e.url||t.url),e.token=f(e.url,t.apiKey))}async function he(e,i){i.canvas||(i.canvas=document.createElement("canvas"));const a=1024;i.canvas.width=a,i.canvas.height=a;const o=i.canvas.getContext("2d");let s,l;if(e.path){const t=new Path2D(e.path);t.closePath(),o.fillStyle=Array.isArray(e.color)?`rgba(${e.color[0]},${e.color[1]},${e.color[2]},${e.color[3]/255})`:"rgb(0,0,0)",o.fill(t);const i=E(o);if(!i)return null;o.clearRect(0,0,a,a);const n=r(e.size)/Math.max(i.width,i.height);o.scale(n,n);const c=a/n,u=c/2-i.width/2-i.x,y=c/2-i.height/2-i.y;if(o.translate(u,y),Array.isArray(e.color)&&o.fill(t),e.outline?.width&&Array.isArray(e.outline.color)){const a=e.outline;o.lineWidth=r(a.width)/n,o.lineJoin="round",o.strokeStyle=`rgba(${a.color[0]},${a.color[1]},${a.color[2]},${a.color[3]/255})`,o.stroke(t),i.width+=o.lineWidth,i.height+=o.lineWidth}i.width*=n,i.height*=n;const p=o.getImageData(a/2-i.width/2,a/2-i.height/2,Math.ceil(i.width),Math.ceil(i.height));s=p.width,l=p.height,o.canvas.width=s,o.canvas.height=l,o.putImageData(p,0,0)}else{const i="image/svg+xml"===e.contentType?"data:image/svg+xml;base64,"+e.imageData:e.url,a=(await t(i,{responseType:"image"})).data;s=r(e.width),l=r(e.height),o.canvas.width=s,o.canvas.height=l,o.drawImage(a,0,0,o.canvas.width,o.canvas.height)}return{type:"esriPMS",imageData:o.canvas.toDataURL("image/png").slice(22),angle:e.angle,contentType:"image/png",height:n(l),width:n(s),xoffset:e.xoffset,yoffset:e.yoffset}}async function be(e,t){const i=e.type;if("simple"===i&&Ie(e.symbol))e.symbol=await he(e.symbol,t);else if("uniqueValue"===i||"classBreaks"===i){Ie(e.defaultSymbol)&&(e.defaultSymbol=await he(e.defaultSymbol,t));const a=e["uniqueValue"===i?"uniqueValueInfos":"classBreakInfos"];if(a)for(const e of a)Ie(e.symbol)&&(e.symbol=await he(e.symbol,t))}}async function we(e){return e.queryFeatures(e.createQuery()).then(e=>e.features)}function Se(e,t){return e.write({},{ignorePersistenceEnabled:!0,origin:t})??{}}function xe(e){return e.gpMetadata?.executionType?U.fromJSON(e.gpMetadata.executionType):"sync"}function Ie(e){return e&&(e.path||"image/svg+xml"===e.contentType||e.url?.endsWith(".svg"))}export{j as execute,$ as getGpPrintParams,q as getGpServerUrl,A as getMode,z as getTaskExecutionMode,_ as getTaskInfo,C as getTaskInfos,R as printCacheMap};
5
+ import{id as e}from"../kernel.js";import t from"../request.js";import{JSONMap as i}from"../core/jsonMap.js";import{createScreenPoint as a,pt2px as r,px2pt as n}from"../core/screenUtils.js";import{dataComponents as o,normalize as s}from"../core/urlUtils.js";import l from"../geometry/Polygon.js";import{collectLabelingFields as c}from"../layers/support/fieldUtils.js";import{getFloorFilterClause as u}from"../layers/support/floorFilterUtils.js";import{getSizeRangeAtScale as y}from"../renderers/visualVariables/support/visualVariableUtils.js";import{asValidOptions as p,findToken as f}from"./utils.js";import{execute as d}from"./geoprocessor/execute.js";import{submitJob as m}from"./geoprocessor/submitJob.js";import{formatJsonMap as g}from"./support/fileFormat.js";import{toJSON as h}from"./support/layoutTemplate.js";import{getVisibleLayerViews as b,isScreenshotRequired as w,isBingMapsLayer as S,isBlendLayer as x,getCopyright as I,getSelectionSymbol as v,createPointLayer as D,createPolygonLayer as T,createPolylineLayer as L,createMultipointLayer as O,getContextBoundingBox as E}from"./support/printTaskUtils.js";import P from"./support/PrintTemplate.js";import{toJSON as V}from"./support/reportTemplate.js";import{getDefaultHighlightOptions as M}from"../views/2d/support/highlightOptionsUtils.js";import F from"../views/support/HighlightOptions.js";const k={Feet:"ft",Kilometers:"km",Meters:"m",Miles:"mi"},N=new i({esriFeet:"Feet",esriKilometers:"Kilometers",esriMeters:"Meters",esriMiles:"Miles"}),U=new i({esriExecutionTypeSynchronous:"sync",esriExecutionTypeAsynchronous:"async"}),R=new Map;async function j(e,t,i){const a=await J(e,i),r=await $(t,a);if("sync"===await A(e,i)){const{results:t}=await d(e,r,void 0,i);return t?.[0]?.value}const n=await m(e,r,void 0,i);await n.waitForJobCompletion({interval:t.updateDelay});const{value:o}=await n.fetchResultData("Output_File",null,i);return o}async function J(e,i){const a=q(e),r=R.get(a)??{gpServerUrl:a,legendLayerNameMap:{},legendLayers:[]};return r.gpMetadata??=(await t(a,p({f:"json"},i))).data,r.cimVersion=r.gpMetadata.cimVersion,R.set(a,r),r}async function A(e,t){return xe(await J(e,t))}async function C(e,i){const a=await J(e,i),r=a.gpMetadata.tasks,n=a.gpServerUrl;return a.taskInfos||(a.taskInfos={},await Promise.all(r?.map(async e=>{const r=(await t(`${n}/${e}`,p({f:"json"},i))).data,o=r.name.startsWith("GetLayoutTemplatesInfo")?"GetLayoutTemplatesInfo":r.name.startsWith("ExportWebMap")?"ExportWebMap":null;o&&(a.taskInfos[o]??=r)})??[])),a.taskInfos}async function _(e,t,i){return(await C(e,i))[t]??null}async function z(e,t,i){const a=await _(e,t,i);return a?.executionType?U.fromJSON(a.executionType):"sync"}async function $(t,i){i=i||{is11xService:!1,legendLayerNameMap:{},legendLayers:[]};const a=t.template||new P;null==a.showLabels&&(a.showLabels=!0);const r=a.exportOptions;let n;const o=h(a.layout);if(r){if(n={dpi:r.dpi},"map_only"===o?.toLowerCase()||""===o){const{width:e,height:t}=r;n.outputSize=null!=e&&null!=t?[e,t]:void 0}}const s=a.layoutOptions;let l;if(s){let e,t;"Miles"===s.scalebarUnit||"Kilometers"===s.scalebarUnit?(e="Kilometers",t="Miles"):"Meters"!==s.scalebarUnit&&"Feet"!==s.scalebarUnit||(e="Meters",t="Feet"),l={titleText:s.titleText,authorText:s.authorText,copyrightText:s.copyrightText,customTextElements:s.customTextElements,elementOverrides:s.elementOverrides,scaleBarOptions:e||t?{metricUnit:N.toJSON(e)??void 0,metricLabel:e?k[e]:void 0,nonMetricUnit:N.toJSON(t)??void 0,nonMetricLabel:t?k[t]:void 0}:void 0}}let c=null;s?.legendLayers&&(c=s.legendLayers.map(e=>{const t=e.layerId;i.legendLayerNameMap[t]=e.title;const a={id:t};return e.subLayerIds&&(a.subLayerIds=e.subLayerIds),a}));const u=await W(t,a,i);if(u.operationalLayers){const e=new RegExp("[\\u4E00-\\u9FFF\\u0E00-\\u0E7F\\u0900-\\u097F\\u3040-\\u309F\\u30A0-\\u30FF\\u31F0-\\u31FF]"),t=/[\u0600-\u06FF]/,i=i=>{const a=i.text,r=i.font,n=r?.family?.toLowerCase();a&&r&&("arial"===n||"arial unicode ms"===n)&&(r.family=e.test(a)?"Arial Unicode MS":"Arial","normal"!==r.style&&t.test(a)&&(r.family="Arial Unicode MS"))};for(const a of u.operationalLayers)if(a.featureCollection?.layers)for(const e of a.featureCollection.layers){if(e.layerDefinition?.drawingInfo?.renderer?.symbol){const t=e.layerDefinition.drawingInfo.renderer;"esriTS"===t.symbol.type&&i(t.symbol)}if(e.featureSet?.features)for(const t of e.featureSet.features)t.symbol&&"esriTS"===t.symbol.type&&i(t.symbol)}}t.outSpatialReference&&(u.mapOptions.spatialReference=t.outSpatialReference.toJSON()),Object.assign(u,{exportOptions:n,layoutOptions:l||{}}),Object.assign(u.layoutOptions,{legendOptions:{operationalLayers:null!=c?c:i.legendLayers.slice()}}),i.legendLayers.length=0,R.set(i.gpServerUrl,i);const y={Web_Map_as_JSON:JSON.stringify(u),Format:g.toJSON(a.format),Layout_Template:o,Layout_Item_ID:void 0,Report_Template:V(a.report),Report_Item_ID:void 0};if(a.layoutItem){delete y.Layout_Template;const t=a.layoutItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(i.gpServerUrl),y.Layout_Item_ID=JSON.stringify({id:t.id})}if(a.reportItem){delete y.Report_Template;const t=a.reportItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(i.gpServerUrl),y.Report_Item_ID=JSON.stringify({id:t.id})}return t.extraParameters&&Object.assign(y,t.extraParameters),y}async function W(e,t,i){const a=e.view;let r=a.spatialReference;const n={operationalLayers:await B(a,t,i)};t.includeTables&&(n.tables=await ce(a));let o=e.extent||i.ssExtent||a.extent;if(r?.isWrappable&&(o=o.clone()._normalize(!0),r=o.spatialReference),n.mapOptions={extent:o&&o.toJSON(),spatialReference:r&&r.toJSON(),showAttribution:t.attributionVisible},i.ssExtent=null,a.background&&(n.background=a.background.toJSON()),a.rotation&&(n.mapOptions.rotation=-a.rotation),t.scalePreserved&&(n.mapOptions.scale=t.outScale||a.scale),null!=a.timeExtent){const e=null!=a.timeExtent.start?a.timeExtent.start.getTime():null,t=null!=a.timeExtent.end?a.timeExtent.end.getTime():null;n.mapOptions.time=[e,t]}return t.reportOptions&&(n.reportOptions=t.reportOptions),n}function q(e){let t=e;const i=t.lastIndexOf("/GPServer/");return i>0&&(t=t.slice(0,i+9)),t}async function B(e,t,i){const a=[],r={layerView:null,printTemplate:t,view:e};let n=0;t.scalePreserved&&(n=t.outScale||e.scale);const o=b(e,n);for(const s of o){const e=s.layer;if(!e.loaded||"layers"in e)continue;let t;r.layerView=s,t=w(s)?await oe(e,r,i):S(e)?K(e):"csv"===e?.type?await H(e,r,i):"catalog-footprint"===e?.type?await G(e,r,i):"feature"===e?.type?await X(e,r,i):"geojson"===e?.type?await Y(e,r,i):"graphics"===e?.type?await Z(e,r,i):"imagery"===e?.type?ee(e,i):"imagery-tile"===e?.type?await te(e,r,i):"kml"===e?.type?await ie(e,r,i):"map-image"===e?.type?ae(e,r,i):"map-notes"===e?.type?await re(r,i):"open-street-map"===e?.type?ne():"stream"===e?.type?await se(e,r,i):"subtype-group"===e?.type?await le(e,i):"tile"===e?.type?ue(e,i):"vector-tile"===e?.type?await ye(e,r,i):"web-tile"===e?.type?pe(e):"wfs"===e?.type?await fe(e,r,i):"wms"===e?.type?de(e,i):"wmts"===e?.type?me(e):await oe(e,r,i),t&&(Array.isArray(t)?a.push(...t):(t.id=e.id,t.title=i.legendLayerNameMap[e.id]||e.title,t.opacity=s.fullOpacity,t.minScale=e.minScale||0,t.maxScale=e.maxScale||0,x(e)&&e.blendMode&&"normal"!==e.blendMode&&(t.blendMode=e.blendMode),a.push(t)))}if(n)for(const s of a)s.minScale=0,s.maxScale=0;if(e.graphics?.length){const r=await Q(null,e.graphics,t,i);r&&a.push(r)}return a}function K(e){return{culture:e.culture,key:e.key,type:"BingMaps"+("aerial"===e.style?"Aerial":"hybrid"===e.style?"Hybrid":"Road")}}async function G(e,{layerView:t,printTemplate:i},a){if(parseFloat(a.cimVersion)<3.1){return Q(e,await we(t),i,a)}const r=e.parent,n={id:(o=Se(r,"web-map")).id,url:o.url,layerType:o.layerType,customParameters:o.customParameters,dynamicGroupLayer:{visibility:!1},footprintLayer:o.footprintLayer,layerDefinition:o.layerDefinition};var o;return ge(n,r),n}async function H(e,t,i){e.legendEnabled&&i.legendLayers.push({id:e.id});const a=t.layerView,r=t.printTemplate;if(!(a.filter||e.portalItem&&"public"!==e.portalItem.access)){const t=Se(e,"web-map");return t.type="CSV",delete t.popupInfo,delete t.layerType,t.showLabels=r.showLabels&&e.labelsVisible,t}return Q(e,await we(a),r,i)}async function Q(e,t,i,a){let r;const n=T(),o=L(),s=D(),u=O(),y=D();if(y.layerDefinition.name="textLayer",delete y.layerDefinition.drawingInfo,e){if("esri.layers.FeatureLayer"===e.declaredClass||"esri.layers.StreamLayer"===e.declaredClass?n.layerDefinition.name=o.layerDefinition.name=s.layerDefinition.name=u.layerDefinition.name=a.legendLayerNameMap[e.id]||e.arcgisProps?.title||e.title:"esri.layers.GraphicsLayer"===e.declaredClass&&(t=e.graphics.items),e.renderer){const t=e.renderer.toJSON(),i=n.layerDefinition.drawingInfo;i&&(i.renderer=t);const a=o.layerDefinition.drawingInfo;a&&(a.renderer=t);const r=s.layerDefinition.drawingInfo;r&&(r.renderer=t);const l=u.layerDefinition.drawingInfo;l&&(l.renderer=t)}if(i.showLabels&&e.labelsVisible&&"function"==typeof e.write){const t=Se(e,"web-map"),i=t.layerDefinition?.drawingInfo?.labelingInfo;if(i){r=!0;const e=n.layerDefinition.drawingInfo;e&&(e.labelingInfo=i);const t=o.layerDefinition.drawingInfo;t&&(t.labelingInfo=i);const a=s.layerDefinition.drawingInfo;a&&(a.labelingInfo=i);const l=u.layerDefinition.drawingInfo;l&&(l.labelingInfo=i)}}}let p;e?.renderer||r||(delete n.layerDefinition.drawingInfo,delete o.layerDefinition.drawingInfo,delete s.layerDefinition.drawingInfo,delete u.layerDefinition.drawingInfo);const f=e?.fieldsIndex,d=e?.renderer;if(f){const t=new Set;r&&await c(t,e),d&&"function"==typeof d.collectRequiredFields&&await d.collectRequiredFields(t,f),p=Array.from(t);const i=f.fields.map(e=>e.toJSON());n.layerDefinition.fields=i,o.layerDefinition.fields=i,s.layerDefinition.fields=i,u.layerDefinition.fields=i}const m=t?.length;let g;for(let c=0;c<m;c++){const e=t[c]||t.at(c);if(!1!==e.visible&&e.geometry){if(g=e.toJSON(),g.hasOwnProperty("popupTemplate")&&delete g.popupTemplate,g.geometry?.z&&delete g.geometry.z,g.symbol&&(g.symbol.angle||delete g.symbol.angle,Ie(g.symbol)?g.symbol=await he(g.symbol,a):g.symbol.text&&delete g.attributes),(!i||!i.forceFeatureAttributes)&&p?.length){const e={};for(const t of p)g.attributes?.hasOwnProperty(t)&&(e[t]=g.attributes[t]);g.attributes=e}"polygon"===e.geometry.type?n.featureSet.features.push(g):"polyline"===e.geometry.type?o.featureSet.features.push(g):"point"===e.geometry.type?g.symbol?.text?y.featureSet.features.push(g):s.featureSet.features.push(g):"multipoint"===e.geometry.type?u.featureSet.features.push(g):"extent"===e.geometry.type&&(g.geometry=l.fromExtent(e.geometry).toJSON(),n.featureSet.features.push(g))}}const h=[n,o,u,s,y].filter(e=>e.featureSet.features.length>0);for(const l of h){const e=l.featureSet.features.every(e=>e.symbol);if(e&&(!i||!i.forceFeatureAttributes))for(const t of l.featureSet.features)delete t.attributes;e&&delete l.layerDefinition.drawingInfo,l.layerDefinition.drawingInfo?.renderer&&await be(l.layerDefinition.drawingInfo.renderer,a)}return h.length?{featureCollection:{layers:h},showLabels:r}:null}async function X(e,t,i){let a;const r=e.renderer,n=parseFloat(i.cimVersion);if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type&&(n<2.9||"pie-chart"===e.featureReduction.renderer?.type)||"pie-chart"===r?.type&&n<3.1||"dot-density"===r?.type&&n<2.6||"polygon"===e.geometryType&&r?.authoringInfo?.visualVariables?.some(e=>"spike"===e.theme))return oe(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});const o=t.layerView,{printTemplate:s,view:l}=t,c="feature-layer"!==e.source?.type&&"ogc-feature"!==e.source?.type;if(o.filter||c||!r||"field"in r&&null!=r.field&&!e.getField(r.field)){const t=await we(o);a=await Q(e,t,s,i)}else{if(a={id:(p=Se(e)).id,title:p.title,url:p.url,layerType:p.layerType,customParameters:p.customParameters,layerDefinition:p.layerDefinition,charts:s.includeCharts?p.charts:void 0},s.attributionVisible&&(a.credits=I(e)),a.showLabels=s.showLabels&&e.labelsVisible,ge(a,e),delete a.layerDefinition?.featureReduction?.disablePopup,delete a.layerDefinition?.featureReduction?.popupInfo,o.displayFilterEnabled||delete a.layerDefinition?.displayFilterInfo,a.layerDefinition?.drawingInfo?.renderer&&(delete a.layerDefinition.minScale,delete a.layerDefinition.maxScale,await be(a.layerDefinition.drawingInfo.renderer,i),"visualVariables"in r&&r.visualVariables?.[0])){const e=r.visualVariables[0];if("size"===e.type&&e.maxSize&&"number"!=typeof e.maxSize&&e.minSize&&"number"!=typeof e.minSize){const t=y(e,l.scale);a.layerDefinition.drawingInfo.renderer.visualVariables[0].minSize=t.minSize,a.layerDefinition.drawingInfo.renderer.visualVariables[0].maxSize=t.maxSize}}const t=u(o);if(t&&(a.layerDefinition??={},a.layerDefinition.definitionExpression=a.layerDefinition.definitionExpression?`(${a.layerDefinition.definitionExpression}) AND (${t})`:t),e.gdbVersion&&(a.layerDefinition??={},a.layerDefinition.gdbVersion=e.gdbVersion),o.hasHighlight&&"highlightIds"in o){const t=o;a.selectionObjectIds=t.highlightIds;const i=M(t)||M(l)||new F;a.selectionSymbol=v(e.geometryType,i)}}var p;return a}async function Y(e,t,i){if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type)return oe(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});return Q(e,await we(t.layerView),t.printTemplate,i)}async function Z(e,{printTemplate:t},i){return Q(e,null,t,i)}function ee(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const i={layerType:(a=Se(e)).layerType,customParameters:a.customParameters};var a;return i.bandIds=e.bandIds,i.compressionQuality=e.compressionQuality,i.format=e.format,i.interpolation=e.interpolation,(e.mosaicRule||e.definitionExpression)&&(i.mosaicRule=e.exportImageServiceParameters.mosaicRule.toJSON()),e.rasterFunction&&(i.renderingRule=e.rasterFunction.toJSON()),e.renderer&&(i.layerDefinition??={},i.layerDefinition.drawingInfo??={},i.layerDefinition.drawingInfo.renderer=e.renderer.toJSON()),ge(i,e),i}async function te(e,t,i){if("flow"===e.renderer?.type)return oe(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});const a={bandIds:(r=Se(e)).bandIds,customParameters:r.customParameters,interpolation:r.interpolation,layerDefinition:r.layerDefinition};var r;return a.layerType="ArcGISImageServiceLayer",ge(a,e),a}async function ie(e,t,i){const a=t.printTemplate;if(!e.portalItem||"public"===e.portalItem.access){const t=Se(e,"web-map");return t.type="kml",delete t.layerType,t.url=s(e.url),t}const r=[],n=t.layerView,o="data:image/png;base64,";n.allVisibleMapImages.forEach((t,i)=>{const a={id:`${e.id}_image${i}`,type:"image",title:e.id,minScale:e.minScale||0,maxScale:e.maxScale||0,opacity:n.fullOpacity,extent:t.extent};t.href.startsWith(o)?a.imageData=t.href.slice(o.length):a.url=t.href,r.push(a)});const l=[...n.allVisiblePoints.items,...n.allVisiblePolylines.items,...n.allVisiblePolygons.items],c={id:e.id,...await Q(null,l,a,i)};return r.push(c),r}function ae(e,{printTemplate:t,view:i},a){let r;const n={id:e.id,subLayerIds:[]};let o=[];const s=i.scale,l=e=>{const t=0===s,i=0===e.minScale||s<=e.minScale,a=0===e.maxScale||s>=e.maxScale;if(e.visible&&(t||i&&a))if(e.sublayers)e.sublayers.forEach(l);else{const t=e.toExportImageJSON(),i={id:e.id,name:e.title,layerDefinition:{definitionExpression:t.definitionExpression,drawingInfo:t.drawingInfo,orderBy:t.orderBy,source:t.source}};o.unshift(i),n.subLayerIds.push(e.id)}};var c;return e.sublayers?.forEach(l),o.length&&(o=o.map(({id:e,name:t,layerDefinition:i})=>({id:e,name:t,layerDefinition:i})),r={layerType:(c=Se(e)).layerType,customParameters:c.customParameters},r.layers=o,r.visibleLayers=e.capabilities?.exportMap?.supportsDynamicLayers?void 0:n.subLayerIds,t.attributionVisible&&(r.credits=I(e)),e.gdbVersion&&(r.gdbVersion=e.gdbVersion),ge(r,e),e.legendEnabled&&a.legendLayers.push(n)),r}async function re({layerView:e,printTemplate:t},i){const a=[],r=e.layer;if(null!=r.featureCollections)for(const n of r.featureCollections){const e=await Q(n,n.source,t,i);e&&a.push(...e.featureCollection.layers)}else if(null!=r.sublayers)for(const n of r.sublayers){const e=await Q(null,n.graphics,t,i);e&&a.push(...e.featureCollection.layers)}return{featureCollection:{layers:a}}}function ne(){return{type:"OpenStreetMap"}}async function oe(e,{printTemplate:t,view:i},r){const n={type:"image"},s={format:"png",ignoreBackground:!0,ignorePadding:!0,layers:[e]};0!==i.rotation&&(s.rotation=0);const l=r.ssExtent||i.state.extent.clone();let c=96,u=!0,y=!0;if(t.exportOptions){const e=t.exportOptions;null!=e.dpi&&e.dpi>0&&(c=e.dpi),null!=e.width&&e.width>0&&(u=e.width%2==i.width%2),null!=e.height&&e.height>0&&(y=e.height%2==i.height%2)}if("map-only"===t.layout&&t.scalePreserved&&(!t.outScale||t.outScale===i.scale)&&96===c&&(!u||!y)&&i.state.extent.equals(i.extent)&&(s.area={x:0,y:0,width:i.width,height:i.height},u||(s.area.width-=1),y||(s.area.height-=1),!r.ssExtent)){const e=i.toMap(a(s.area.width,s.area.height));l.ymin=e.y,l.xmax=e.x,r.ssExtent=l}n.extent=l.clone()._normalize(!0).toJSON();const p=await i.takeScreenshot(s);return n.imageData=o(p.dataUrl)?.data,n}async function se(e,{layerView:t,printTemplate:i},a){e.legendEnabled&&a.legendLayers.push({id:e.id});return Q(e,await we(t),i,a)}async function le(e,t){if(e.legendEnabled)for(const r of e.sublayers)r.legendEnabled&&t.legendLayers.push({id:r.id});const i={customParameters:(a=Se(e)).customParameters,effect:a.effect,layerDefinition:a.layerDefinition,layerType:a.layerType,layers:a.layers,url:a.url};var a;if(ge(i,e),Array.isArray(i.layers)){for(const e of i.layers)delete e.popupInfo;i.token&&i.layers.length>0&&(i.layers[i.layers.length-1].token=i.token,delete i.token)}return i}async function ce(e){const t=[],i=[];for(const a of e.map.allTables)"feature"!==a.type||a.loaded||i.push(a.load());i.length&&await Promise.allSettled(i);for(const a of e.map.allTables)if("feature"===a.type&&a.loaded&&a.isTable&&"feature-layer"===a.source?.type){const e=(e=>({id:e.id,title:e.title,customParameters:e.customParameters,layerDefinition:{definitionExpression:e.layerDefinition?.definitionExpression},url:e.url}))(Se(a));ge(e,a),t.push(e)}return t.length?t:void 0}function ue(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const i={layerType:(a=Se(e)).layerType,customParameters:a.customParameters};var a;return ge(i,e),i}async function ye(e,t,i){const a=t.layerView;if(e.serviceUrl&&e.styleUrl&&!a.spriteSourceChanged&&!a.styleChanged){const t=f(e.styleUrl,e.apiKey),a=f(e.serviceUrl,e.apiKey);if(!t&&!a||"2.1.0"!==i.cimVersion){const i={type:"VectorTileLayer"};return i.styleUrl=s(e.styleUrl),i.token=t,a!==t&&(i.additionalTokens=[{url:e.serviceUrl,token:a}]),i}}return oe(e,t,i)}function pe(e){const t=e.urlTemplate?.replace(/\${/g,"{"),i={type:"WebTiledLayer",urlTemplate:t,credits:e.copyright};return e.subDomains&&e.subDomains.length>0&&(i.subDomains=e.subDomains),i}async function fe(e,t,i){return parseFloat(i.cimVersion)<3.5?oe(e,t,i):(e.legendEnabled&&i.legendLayers.push({id:e.id}),{layerType:(a=Se(e,"web-map")).layerType,layerDefinition:a.layerDefinition,url:a.url,wfsInfo:a.wfsInfo});var a}function de(e,t){let i;const a=[],r=e=>{e.visible&&(e.sublayers?e.sublayers.forEach(r):e.name&&a.unshift(e.name))};return e.sublayers&&e.sublayers.forEach(r),a.length&&(e.legendEnabled&&t.legendLayers.push({id:e.id,subLayerIds:a}),i={type:"wms",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,transparentBackground:e.imageTransparency,visibleLayers:a,url:s(e.url),version:e.version}),i}function me(e){const t=e.activeLayer;return{type:"wmts",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,format:t.imageFormat,layer:t.id,style:t.styleId,tileMatrixSet:t.tileMatrixSetId,url:s(e.url)}}function ge(e,t){t.url&&(e.url=s(e.url||t.url),e.token=f(e.url,t.apiKey))}async function he(e,i){i.canvas||(i.canvas=document.createElement("canvas"));const a=1024;i.canvas.width=a,i.canvas.height=a;const o=i.canvas.getContext("2d");let s,l;if(e.path){const t=new Path2D(e.path);t.closePath(),o.fillStyle=Array.isArray(e.color)?`rgba(${e.color[0]},${e.color[1]},${e.color[2]},${e.color[3]/255})`:"rgb(0,0,0)",o.fill(t);const i=E(o);if(!i)return null;o.clearRect(0,0,a,a);const n=r(e.size)/Math.max(i.width,i.height);o.scale(n,n);const c=a/n,u=c/2-i.width/2-i.x,y=c/2-i.height/2-i.y;if(o.translate(u,y),Array.isArray(e.color)&&o.fill(t),e.outline?.width&&Array.isArray(e.outline.color)){const a=e.outline;o.lineWidth=r(a.width)/n,o.lineJoin="round",o.strokeStyle=`rgba(${a.color[0]},${a.color[1]},${a.color[2]},${a.color[3]/255})`,o.stroke(t),i.width+=o.lineWidth,i.height+=o.lineWidth}i.width*=n,i.height*=n;const p=o.getImageData(a/2-i.width/2,a/2-i.height/2,Math.ceil(i.width),Math.ceil(i.height));s=p.width,l=p.height,o.canvas.width=s,o.canvas.height=l,o.putImageData(p,0,0)}else{const i="image/svg+xml"===e.contentType?"data:image/svg+xml;base64,"+e.imageData:e.url,a=(await t(i,{responseType:"image"})).data;s=r(e.width),l=r(e.height),o.canvas.width=s,o.canvas.height=l,o.drawImage(a,0,0,o.canvas.width,o.canvas.height)}return{type:"esriPMS",imageData:o.canvas.toDataURL("image/png").slice(22),angle:e.angle,contentType:"image/png",height:n(l),width:n(s),xoffset:e.xoffset,yoffset:e.yoffset}}async function be(e,t){const i=e.type;if("simple"===i&&Ie(e.symbol))e.symbol=await he(e.symbol,t);else if("uniqueValue"===i||"classBreaks"===i){Ie(e.defaultSymbol)&&(e.defaultSymbol=await he(e.defaultSymbol,t));const a=e["uniqueValue"===i?"uniqueValueInfos":"classBreakInfos"];if(a)for(const e of a)Ie(e.symbol)&&(e.symbol=await he(e.symbol,t))}}async function we(e){return e.queryFeatures(e.createQuery()).then(e=>e.features)}function Se(e,t){return e.write({},{ignorePersistenceEnabled:!0,origin:t})??{}}function xe(e){return e.gpMetadata?.executionType?U.fromJSON(e.gpMetadata.executionType):"sync"}function Ie(e){return e&&(e.path||"image/svg+xml"===e.contentType||e.url?.endsWith(".svg"))}export{j as execute,$ as getGpPrintParams,q as getGpServerUrl,A as getMode,z as getTaskExecutionMode,_ as getTaskInfo,C as getTaskInfos,R as printCacheMap};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import{getScaleForResolution as a}from"../../geometry/support/scaleUtils.js";import t from"../statistics/spatialStatistics.js";import{verifyBinningParams as n}from"../support/binningUtils.js";import{binningCapableLayerTypes as i,featureCapableLayerTypes as s,createLayerAdapter as r,getLayerTypeLabels as o}from"../support/adapters/support/layerUtils.js";const l=500,c=1e8,p=1280,f=12,m=30,u=15;async function g(a){const{view:t,sampleSize:c}=a;if(!a||!a.layer)throw new e("scale-range:missing-parameters","'layer' parameter is required");if(a.snapToLOD&&!t)throw new e("scale-range:missing-parameters","'view' parameter is required when 'snapToLOD' is true");a.forBinning&&n(a,"scale-range");const{layer:p,...f}=a,m=a.forBinning?i:s,u=r(p,m,a.forBinning);if(!u)throw new e("scale-range:invalid-parameters","'layer' must be one of these types: "+o(m).join(", "));const g={layerAdapter:u,...f};g.sampleSize=c||l,await(t?.when());const y=null!=g.signal?{signal:g.signal}:null;return await u.load(y),g}function y(e,a){const t=f,n=p/4,i=m,s=p/4,r=u,o=p/2;let l=0,c=0,g=0,y=0;switch(e){case"point":case"multipoint":{const e=a;l=e.avgMinDistance??0,c=t,g=e.minDistance??0,y=n;break}case"polyline":{const e=a;l=e.avgLength??0,c=i,g=e.minLength??0,y=s;break}case"polygon":{const e=a;l=e.avgSize??0,c=r,g=e.minSize??0,y=o;break}}return{resolutionForMinScale:l>0?l/c:null,resolutionForMaxScale:g>0?g/y:null}}function w(e,t,n){const i=y(e.geometryType,t),s=n?.spatialReference||e.layer.spatialReference;return{minScale:a(i.resolutionForMinScale??0,s),maxScale:a(i.resolutionForMaxScale??0,s)}}function S(e,a,t=!0){if(e.constraints&&"effectiveLODs"in e.constraints){const n=e.constraints.effectiveLODs,i=t?n:n.slice().reverse();let s=null;for(const e of i)if(!(t?e.scale>a:e.scale<a)){s=e;break}return s}}function h(a,t,n,i){const{view:s,snapToLOD:r,layerAdapter:o}=a;if(r&&s){const e=S(s,t),a=S(s,n,!1);t=e?e.scale:t,n=a?a.scale:n}if(t<n)throw new e("scale-range:invalid","calculated minScale is less than maxScale.");return n>t/2&&(n=Math.floor(n/2)),t>c&&(t=0),"polygon"!==o.geometryType&&(n=0),{minScale:Math.ceil(t),maxScale:Math.floor(n),spatialStatistics:i}}async function v(a){const n=await g(a),{view:i,sampleSize:s,layerAdapter:r,signal:o,filter:l}=n,c=await r.getSampleFeatures({view:i,sampleSize:s,returnGeometry:!0,filter:l,signal:o},"json");if(!c?.length)throw new e("scale-range:insufficient-info","No features are available to calculate statistics");const p=await t({features:c,geometryType:r.geometryType}),{minScale:f,maxScale:m}=w(r,p,i);return h(n,f,m,p)}export{v as default};
5
+ import e from"../../core/Error.js";import{getScaleForResolution as a}from"../../geometry/support/scaleUtils.js";import t from"../statistics/spatialStatistics.js";import{verifyBinningParams as n}from"../support/binningUtils.js";import{binningCapableLayerTypes as i,featureCapableLayerTypes as s,createLayerAdapter as r,getLayerTypeLabels as o}from"../support/adapters/support/layerUtils.js";const l=500,c=1e8,p=1280,f=12,m=30,u=15;async function g(a){const{view:t,sampleSize:c}=a;if(!a||!a.layer)throw new e("scale-range:missing-parameters","'layer' parameter is required");if(a.snapToLOD&&!t)throw new e("scale-range:missing-parameters","'view' parameter is required when 'snapToLOD' is true");a.forBinning&&n(a,"scale-range");const{layer:p,...f}=a,m=a.forBinning?i:s,u=r(p,m,a.forBinning);if(!u)throw new e("scale-range:invalid-parameters","'layer' must be one of these types: "+o(m).join(", "));const g={layerAdapter:u,...f};g.sampleSize=c||l,await(t?.when());const y=null!=g.signal?{signal:g.signal}:null;return await u.load(y),g}function y(e,a){const t=f,n=p/4,i=m,s=p/4,r=u,o=p/2;let l=0,c=0,g=0,y=0;switch(e){case"point":case"multipoint":{const e=a;l=e.avgMinDistance??0,c=t,g=e.minDistance??0,y=n;break}case"polyline":{const e=a;l=e.avgLength??0,c=i,g=e.minLength??0,y=s;break}case"polygon":{const e=a;l=e.avgSize??0,c=r,g=e.minSize??0,y=o;break}}return{resolutionForMinScale:l>0?l/c:null,resolutionForMaxScale:g>0?g/y:null}}function w(e,t,n){const i=y(e.geometryType,t),s=n?.spatialReference||e.layer.spatialReference;return{minScale:a(i.resolutionForMinScale??0,s),maxScale:a(i.resolutionForMaxScale??0,s)}}function S(e,a,t=!0){if("effectiveLODs"in e.constraints){const n=e.constraints.effectiveLODs,i=t?n:n.slice().reverse();let s=null;for(const e of i)if(!(t?e.scale>a:e.scale<a)){s=e;break}return s}}function h(a,t,n,i){const{view:s,snapToLOD:r,layerAdapter:o}=a;if(r&&s){const e=S(s,t),a=S(s,n,!1);t=e?e.scale:t,n=a?a.scale:n}if(t<n)throw new e("scale-range:invalid","calculated minScale is less than maxScale.");return n>t/2&&(n=Math.floor(n/2)),t>c&&(t=0),"polygon"!==o.geometryType&&(n=0),{minScale:Math.ceil(t),maxScale:Math.floor(n),spatialStatistics:i}}async function v(a){const n=await g(a),{view:i,sampleSize:s,layerAdapter:r,signal:o,filter:l}=n,c=await r.getSampleFeatures({view:i,sampleSize:s,returnGeometry:!0,filter:l,signal:o},"json");if(!c?.length)throw new e("scale-range:insufficient-info","No features are available to calculate statistics");const p=await t({features:c,geometryType:r.geometryType}),{minScale:f,maxScale:m}=w(r,p,i);return h(n,f,m,p)}export{v as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import e from"../../core/Error.js";import{px2pt as n}from"../../core/screenUtils.js";import{getScale as s}from"../../geometry/support/scaleUtils.js";import l from"../../renderers/visualVariables/SizeVariable.js";import i from"../../renderers/visualVariables/support/SizeStop.js";import a from"./scaleRange.js";import{verifyBinningParams as t}from"../support/binningUtils.js";import{binningCapableLayerTypes as r,featureCapableLayerTypes as o,createLayerAdapter as c,getLayerTypeLabels as u}from"../support/adapters/support/layerUtils.js";const p=1e8,m=1128.497176,v=591657527.591555,f=[10,8,4,2],w=[100,100,60,30],g=[2,1,.75,.5],S=[32,18,12,6],h=[{level:0,resolution:156543.03392800014,scale:591657527.591555},{level:1,resolution:78271.51696399994,scale:295828763.795777},{level:2,resolution:39135.75848200009,scale:147914381.897889},{level:3,resolution:19567.87924099992,scale:73957190.948944},{level:4,resolution:9783.93962049996,scale:36978595.474472},{level:5,resolution:4891.96981024998,scale:18489297.737236},{level:6,resolution:2445.98490512499,scale:9244648.868618},{level:7,resolution:1222.992452562495,scale:4622324.434309},{level:8,resolution:611.4962262813797,scale:2311162.217155},{level:9,resolution:305.74811314055756,scale:1155581.108577},{level:10,resolution:152.87405657041106,scale:577790.554289},{level:11,resolution:76.43702828507324,scale:288895.277144},{level:12,resolution:38.21851414253662,scale:144447.638572},{level:13,resolution:19.10925707126831,scale:72223.819286},{level:14,resolution:9.554628535634155,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.388657133974685,scale:9027.977411},{level:17,resolution:1.1943285668550503,scale:4513.988705},{level:18,resolution:.5971642835598172,scale:2256.994353},{level:19,resolution:.29858214164761665,scale:1128.497176}];async function y(n){const{view:s}=n;if(!(n&&s&&n.layer))throw new e("size-range:missing-parameters","'view' and 'layer' parameters are required");n.forBinning&&t(n,"size-range");const{layer:l,...i}=n,a=n.forBinning?r:o,p=c(l,a,n.forBinning);if(!p)throw new e("size-range:invalid-parameters","'layer' must be one of these types: "+u(a).join(", "));const m={layerAdapter:p,...i,view:s};await s.when();const v=null!=m.signal?{signal:m.signal}:null;await p.load(v);const f=p.geometryType;if("point"!==f&&"multipoint"!==f&&"polyline"!==f&&"polygon"!==f)throw new e("size-range:not-supported",`sizeRange is not supported for geometryType: ${f}`);return m}function z(e,n){const s=Math.ceil(e/n);let l=Math.ceil(s/4);l<4?l=4:l>16&&(l=16);const i=5*l;return{min:l,max:i<50?50:i}}function d(n,s){const{view:l}=n;if(!l)throw new e("scale-range:invalid-parameters","'view' is required");const i=s.minScale||p,a=l.constraints&&"effectiveLODs"in l.constraints&&l.constraints.effectiveLODs||h,t=[];for(let e=0;e<a.length;e++){if(a[e].scale>i)continue;const n=Number(e),s=[n-3,n,n+3,n+6];for(const e of s)e>-1&&e<a.length&&t.push(a[e].scale);break}return t.sort((e,n)=>e-n)}function x(n,l){const{view:i,layerAdapter:a}=n;if(!i)throw new e("scale-range:invalid-parameters","'view' is required");const t=a.fullExtent,r=a.minScale||m,o=a.maxScale||v,c=l.minScale||0,u=l.maxScale||0;let p=null!=t?s(i,t):0;p=p<r&&p>o?p:0;return{scales:[r,o,c,u,p].map(Math.round).sort((e,n)=>e-n).filter((e,n,s)=>!!e&&s.indexOf(e)===n).filter((e,n,s)=>!n||Math.abs(e-s[n-1])>5),fullExtentScale:p}}function E(s,a){const{minScale:t,maxScale:r}=a,o=d(s,{minScale:t});if(!o.length)throw new e("scale-range:insufficient-info","not enough scale values");return{minSize:new l({valueExpression:"$view.scale",stops:o.map((e,s)=>new i({value:e,size:n(f[s])}))}),maxSize:new l({valueExpression:"$view.scale",stops:o.map((e,s)=>new i({value:e,size:n(w[s])}))})}}function j(s,a){const{minScale:t,maxScale:r}=a,o=d(s,{minScale:t});if(!o.length)throw new e("scale-range:insufficient-info","not enough scale values");return{minSize:new l({valueExpression:"$view.scale",stops:o.map((e,s)=>new i({value:e,size:n(g[s])}))}),maxSize:new l({valueExpression:"$view.scale",stops:o.map((e,s)=>new i({value:e,size:n(S[s])}))})}}function b(s,a){const{spatialStatistics:t,minScale:r,maxScale:o}=a;if(!("avgSize"in t)||!t.avgSize)throw new e("size-range:insufficient-info","average polygon size is invalid");const c=t.avgSize,{view:u}=s;if(!u)throw new e("scale-range:invalid-parameters","'view' is required");const{resolution:p,scale:m}=u,v=p/m,{scales:f,fullExtentScale:w}=x(s,{minScale:r,maxScale:o}),g=[],S=[];f.forEach((e,s)=>{const{min:l,max:a}=z(c,v*e),t=f.indexOf(w),r=t>-1&&s>t?2:1;g.push(new i({value:e,size:n(l/r)})),S.push(new i({value:e,size:n(a/r)}))});return{minSize:new l({valueExpression:"$view.scale",stops:g}),maxSize:new l({valueExpression:"$view.scale",stops:S})}}async function $(e){const n=await y(e),{view:s,layerAdapter:l,signal:i,filter:t}=n,r=await a({layer:l,view:s,signal:i,filter:t});switch(l.geometryType){case"point":case"multipoint":return E(n,r);case"polyline":return j(n,r);case"polygon":return b(n,r);case"mesh":case"multipatch":return null}return null}export{$ as default};
5
+ import"../../core/has.js";import e from"../../core/Error.js";import{px2pt as l}from"../../core/screenUtils.js";import{getScale as n}from"../../geometry/support/scaleUtils.js";import s from"../../renderers/visualVariables/SizeVariable.js";import i from"../../renderers/visualVariables/support/SizeStop.js";import a from"./scaleRange.js";import{verifyBinningParams as t}from"../support/binningUtils.js";import{binningCapableLayerTypes as r,featureCapableLayerTypes as o,createLayerAdapter as c,getLayerTypeLabels as u}from"../support/adapters/support/layerUtils.js";const p=1e8,m=1128.497176,v=591657527.591555,f=[10,8,4,2],w=[100,100,60,30],g=[2,1,.75,.5],S=[32,18,12,6],h=[{level:0,resolution:156543.03392800014,scale:591657527.591555},{level:1,resolution:78271.51696399994,scale:295828763.795777},{level:2,resolution:39135.75848200009,scale:147914381.897889},{level:3,resolution:19567.87924099992,scale:73957190.948944},{level:4,resolution:9783.93962049996,scale:36978595.474472},{level:5,resolution:4891.96981024998,scale:18489297.737236},{level:6,resolution:2445.98490512499,scale:9244648.868618},{level:7,resolution:1222.992452562495,scale:4622324.434309},{level:8,resolution:611.4962262813797,scale:2311162.217155},{level:9,resolution:305.74811314055756,scale:1155581.108577},{level:10,resolution:152.87405657041106,scale:577790.554289},{level:11,resolution:76.43702828507324,scale:288895.277144},{level:12,resolution:38.21851414253662,scale:144447.638572},{level:13,resolution:19.10925707126831,scale:72223.819286},{level:14,resolution:9.554628535634155,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.388657133974685,scale:9027.977411},{level:17,resolution:1.1943285668550503,scale:4513.988705},{level:18,resolution:.5971642835598172,scale:2256.994353},{level:19,resolution:.29858214164761665,scale:1128.497176}];async function y(l){const{view:n}=l;if(!(l&&n&&l.layer))throw new e("size-range:missing-parameters","'view' and 'layer' parameters are required");l.forBinning&&t(l,"size-range");const{layer:s,...i}=l,a=l.forBinning?r:o,p=c(s,a,l.forBinning);if(!p)throw new e("size-range:invalid-parameters","'layer' must be one of these types: "+u(a).join(", "));const m={layerAdapter:p,...i,view:n};await n.when();const v=null!=m.signal?{signal:m.signal}:null;await p.load(v);const f=p.geometryType;if("point"!==f&&"multipoint"!==f&&"polyline"!==f&&"polygon"!==f)throw new e("size-range:not-supported",`sizeRange is not supported for geometryType: ${f}`);return m}function z(e,l){const n=Math.ceil(e/l);let s=Math.ceil(n/4);s<4?s=4:s>16&&(s=16);const i=5*s;return{min:s,max:i<50?50:i}}function d(l,n){const{view:s}=l;if(!s)throw new e("scale-range:invalid-parameters","'view' is required");const i=n.minScale||p,a="effectiveLODs"in s.constraints&&s.constraints.effectiveLODs||h,t=[];for(let e=0;e<a.length;e++){if(a[e].scale>i)continue;const l=Number(e),n=[l-3,l,l+3,l+6];for(const e of n)e>-1&&e<a.length&&t.push(a[e].scale);break}return t.sort((e,l)=>e-l)}function x(l,s){const{view:i,layerAdapter:a}=l;if(!i)throw new e("scale-range:invalid-parameters","'view' is required");const t=a.fullExtent,r=a.minScale||m,o=a.maxScale||v,c=s.minScale||0,u=s.maxScale||0;let p=null!=t?n(i,t):0;p=p<r&&p>o?p:0;return{scales:[r,o,c,u,p].map(Math.round).sort((e,l)=>e-l).filter((e,l,n)=>!!e&&n.indexOf(e)===l).filter((e,l,n)=>!l||Math.abs(e-n[l-1])>5),fullExtentScale:p}}function E(n,a){const{minScale:t,maxScale:r}=a,o=d(n,{minScale:t});if(!o.length)throw new e("scale-range:insufficient-info","not enough scale values");return{minSize:new s({valueExpression:"$view.scale",stops:o.map((e,n)=>new i({value:e,size:l(f[n])}))}),maxSize:new s({valueExpression:"$view.scale",stops:o.map((e,n)=>new i({value:e,size:l(w[n])}))})}}function j(n,a){const{minScale:t,maxScale:r}=a,o=d(n,{minScale:t});if(!o.length)throw new e("scale-range:insufficient-info","not enough scale values");return{minSize:new s({valueExpression:"$view.scale",stops:o.map((e,n)=>new i({value:e,size:l(g[n])}))}),maxSize:new s({valueExpression:"$view.scale",stops:o.map((e,n)=>new i({value:e,size:l(S[n])}))})}}function b(n,a){const{spatialStatistics:t,minScale:r,maxScale:o}=a;if(!("avgSize"in t)||!t.avgSize)throw new e("size-range:insufficient-info","average polygon size is invalid");const c=t.avgSize,{view:u}=n;if(!u)throw new e("scale-range:invalid-parameters","'view' is required");const{resolution:p,scale:m}=u,v=p/m,{scales:f,fullExtentScale:w}=x(n,{minScale:r,maxScale:o}),g=[],S=[];f.forEach((e,n)=>{const{min:s,max:a}=z(c,v*e),t=f.indexOf(w),r=t>-1&&n>t?2:1;g.push(new i({value:e,size:l(s/r)})),S.push(new i({value:e,size:l(a/r)}))});return{minSize:new s({valueExpression:"$view.scale",stops:g}),maxSize:new s({valueExpression:"$view.scale",stops:S})}}async function $(e){const l=await y(e),{view:n,layerAdapter:s,signal:i,filter:t}=l,r=await a({layer:s,view:n,signal:i,filter:t});switch(s.geometryType){case"point":case"multipoint":return E(l,r);case"polyline":return j(l,r);case"polygon":return b(l,r);case"mesh":case"multipatch":return null}return null}export{$ as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- const a="20250829",d="34977dc50fa51a82df5f6d06ed28aab920be4aa8";export{a as buildDate,d as commitHash};
5
+ const c="20250830",b="437928cf089bc1d34b1c39971c71c2bfbfb01019";export{c as buildDate,b as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import i from"../../../../Viewpoint.js";import o from"../../../../core/Accessor.js";import{when as e}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as s}from"../../../../core/screenUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{g as r}from"../../../../chunks/vec32.js";import{create as a,fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../../../geometry/Point.js";import{translateBy as u}from"../../viewpointUtils.js";import{PanPlanarMomentumEstimator as h}from"../../../navigation/PanPlanarMomentumEstimator.js";let d=class extends o{constructor(t){super(t),this.animationTime=0,this.momentumEstimator=new h(500,6,.92),this.momentum=null,this.tmpMomentum=a(),this.momentumFinished=!1,this.viewpoint=new i({targetGeometry:new c,scale:0,rotation:0}),this._previousDrag=null,this.addHandles(e(()=>this.momentumFinished,()=>this.navigation.stop()))}begin(t,i){this.navigation.begin(),this.momentumEstimator.reset(),this.addToEstimator(i),this._previousDrag=i}update(t,i){this.addToEstimator(i);let o=i.center.x,e=i.center.y;const s=this._previousDrag;o=s?s.center.x-o:-o,e=s?e-s.center.y:e,t.viewpoint=u(this.viewpoint,t.viewpoint,[o||0,e||0]),this._previousDrag=i}end(t,i){this.addToEstimator(i);const o=t.navigation.effectiveMomentumEnabled;this.momentum=o?this.momentumEstimator.evaluateMomentum():null,this.animationTime=0,this.momentum&&this.onAnimationUpdate(t),this._previousDrag=null,this.navigation.end()}addToEstimator(t){const i=t.center.x,o=t.center.y,e=s(-i,o),m=p(-i,o,0);this.momentumEstimator.add(e,m,.001*t.timestamp)}onAnimationUpdate(t){this.navigation.animationManager?.animateContinuous(t.viewpoint,(i,o)=>{const{momentum:e,animationTime:s,tmpMomentum:m}=this,n=.001*o;if(!(this.momentumFinished=!e||e.isFinished(s))){const o=e.valueDelta(s,n);r(m,e.direction,o),u(i,i,m),t.constraints.constrainByGeometry(i)}this.animationTime+=n})}stopMomentumNavigation(){this.momentum&&(this.momentumEstimator.reset(),this.momentum=null,this.navigation.stop())}};t([m()],d.prototype,"momentumFinished",void 0),t([m()],d.prototype,"viewpoint",void 0),t([m()],d.prototype,"navigation",void 0),d=t([n("esri.views.2d.navigation.actions.Pan")],d);export{d as default};
5
+ import{__decorate as t}from"tslib";import i from"../../../../Viewpoint.js";import o from"../../../../core/Accessor.js";import{when as e}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as m}from"../../../../core/screenUtils.js";import{Seconds as s,secondsFromMilliseconds as n}from"../../../../core/time.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{g as p}from"../../../../chunks/vec32.js";import{create as c,fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import u from"../../../../geometry/Point.js";import{translateBy as d}from"../../viewpointUtils.js";import{PanPlanarMomentumEstimator as v}from"../../../navigation/PanPlanarMomentumEstimator.js";let l=class extends o{constructor(t){super(t),this.animationTime=s(0),this.momentumEstimator=new v(500,6,.92),this.momentum=null,this.tmpMomentum=c(),this.momentumFinished=!1,this.viewpoint=new i({targetGeometry:new u,scale:0,rotation:0}),this._previousDrag=null,this.addHandles(e(()=>this.momentumFinished,()=>this.navigation.stop()))}begin(t,i){this.navigation.begin(),this.momentumEstimator.reset(),this.addToEstimator(i),this._previousDrag=i}update(t,i){this.addToEstimator(i);let o=i.center.x,e=i.center.y;const m=this._previousDrag;o=m?m.center.x-o:-o,e=m?e-m.center.y:e,t.viewpoint=d(this.viewpoint,t.viewpoint,[o||0,e||0]),this._previousDrag=i}end(t,i){this.addToEstimator(i);const o=t.navigation.effectiveMomentumEnabled;this.momentum=o?this.momentumEstimator.evaluateMomentum():null,this.animationTime=s(0),this.momentum&&this.onAnimationUpdate(t),this._previousDrag=null,this.navigation.end()}addToEstimator(t){const i=t.center.x,o=t.center.y,e=m(-i,o),s=h(-i,o,0);this.momentumEstimator.add(e,s,.001*t.timestamp)}onAnimationUpdate(t){this.navigation.animationManager?.animateContinuous(t.viewpoint,(i,o)=>{const{momentum:e,animationTime:m,tmpMomentum:r}=this,a=this.momentumFinished=!e||e.isFinished(m),c=n(o);if(!a){const o=e.valueDelta(m,c);p(r,e.direction,o),d(i,i,r),t.constraints.constrainByGeometry(i)}this.animationTime=s(this.animationTime+c)})}stopMomentumNavigation(){this.momentum&&(this.momentumEstimator.reset(),this.momentum=null,this.navigation.stop())}};t([r()],l.prototype,"momentumFinished",void 0),t([r()],l.prototype,"viewpoint",void 0),t([r()],l.prototype,"navigation",void 0),l=t([a("esri.views.2d.navigation.actions.Pan")],l);export{l as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import o from"../../../../Viewpoint.js";import i from"../../../../core/Accessor.js";import{when as s}from"../../../../core/reactiveUtils.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{set as n,add as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import h from"../../../../geometry/Point.js";import{getPaddingScreenTranslation as u,scaleAndRotateBy as l}from"../../viewpointUtils.js";import{RotationMomentumEstimator as p}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as c}from"../../../navigation/ZoomMomentumEstimator.js";let _=class extends i{constructor(t){super(t),this._animationTime=0,this._momentumFinished=!1,this._previousAngle=0,this._previousRadius=0,this._previousCenter=null,this._rotationMomentumEstimator=new p(.6,.15,.95),this._rotationDirection=1,this._startAngle=0,this._startRadius=0,this._updateTimestamp=null,this._zoomDirection=1,this._zoomMomentumEstimator=new c,this._zoomOnly=null,this.viewpoint=new o({targetGeometry:new h,scale:0,rotation:0}),this.zoomMomentum=null,this.rotateMomentum=null,this.addHandles(s(()=>this._momentumFinished,()=>this.navigation.stop()))}begin(t,o){this.navigation.begin(),this._rotationMomentumEstimator.reset(),this._zoomMomentumEstimator.reset(),this._zoomOnly=null,this._previousAngle=this._startAngle=o.angle,this._previousRadius=this._startRadius=o.radius,this._previousCenter=o.center,this._updateTimestamp=null,t.constraints.rotationEnabled&&this.addToRotateEstimator(0,o.timestamp),this.addToZoomEstimator(o,1)}update(t,o){null===this._updateTimestamp&&(this._updateTimestamp=o.timestamp);const i=o.angle,s=o.radius,e=o.center,m=Math.abs(180*(i-this._startAngle)/Math.PI),n=Math.abs(s-this._startRadius),a=this._startRadius/s;if(this._previousRadius&&this._previousCenter){const r=s/this._previousRadius;let h=180*(i-this._previousAngle)/Math.PI;this._rotationDirection=h>=0?1:-1,this._zoomDirection=r>=1?1:-1,t.constraints.rotationEnabled?(null===this._zoomOnly&&o.timestamp-this._updateTimestamp>200&&(this._zoomOnly=n-m>0),null===this._zoomOnly||this._zoomOnly?h=0:this.addToRotateEstimator(i-this._startAngle,o.timestamp)):h=0,this.addToZoomEstimator(o,a),this.navigation.setViewpoint([e.x,e.y],1/r,h,[this._previousCenter.x-e.x,e.y-this._previousCenter.y])}this._previousAngle=i,this._previousRadius=s,this._previousCenter=e}end(t){this.rotateMomentum=this._rotationMomentumEstimator.evaluateMomentum(),this.zoomMomentum=this._zoomMomentumEstimator.evaluateMomentum(),this._animationTime=0,(this.rotateMomentum||this.zoomMomentum)&&this.onAnimationUpdate(t),this.navigation.end()}addToRotateEstimator(t,o){this._rotationMomentumEstimator.add(t,.001*o)}addToZoomEstimator(t,o){this._zoomMomentumEstimator.add(o,.001*t.timestamp)}canZoomIn(t){const o=t.scale,i=t.constraints.effectiveMaxScale;return 0===i||o>i}canZoomOut(t){const o=t.scale,i=t.constraints.effectiveMinScale;return 0===i||o<i}onAnimationUpdate(t){this.navigation.animationManager?.animateContinuous(t.viewpoint,(o,i)=>{const s=!this.canZoomIn(t)&&this._zoomDirection>1||!this.canZoomOut(t)&&this._zoomDirection<1,e=!this.rotateMomentum||this.rotateMomentum.isFinished(this._animationTime),m=s||!this.zoomMomentum||this.zoomMomentum.isFinished(this._animationTime),h=.001*i;if(this._momentumFinished=e&&m,!this._momentumFinished){const i=this.rotateMomentum?Math.abs(this.rotateMomentum.valueDelta(this._animationTime,h))*this._rotationDirection*180/Math.PI:0;let s=this.zoomMomentum?Math.abs(this.zoomMomentum.valueDelta(this._animationTime,h)):1;const e=r(),m=r();if(this._previousCenter){n(e,this._previousCenter.x,this._previousCenter.y),u(m,t.size,t.padding),a(e,e,m);const{constraints:r,scale:h}=t,p=h*s;s<1&&!r.canZoomInTo(p)?(s=h/r.effectiveMaxScale,this.zoomMomentum=null,this.rotateMomentum=null):s>1&&!r.canZoomOutTo(p)&&(s=h/r.effectiveMinScale,this.zoomMomentum=null,this.rotateMomentum=null),l(o,t.viewpoint,s,i,e,t.size),t.constraints.constrainByGeometry(o)}}this._animationTime+=h})}stopMomentumNavigation(){(this.rotateMomentum||this.zoomMomentum)&&(this.rotateMomentum&&(this._rotationMomentumEstimator.reset(),this.rotateMomentum=null),this.zoomMomentum&&(this._zoomMomentumEstimator.reset(),this.zoomMomentum=null),this.navigation.stop())}};t([e()],_.prototype,"_momentumFinished",void 0),t([e()],_.prototype,"viewpoint",void 0),t([e()],_.prototype,"navigation",void 0),_=t([m("esri.views.2d.navigation.actions.Pinch")],_);export{_ as default};
5
+ import{__decorate as t}from"tslib";import o from"../../../../Viewpoint.js";import i from"../../../../core/Accessor.js";import{when as s}from"../../../../core/reactiveUtils.js";import{Seconds as e,secondsFromMilliseconds as m}from"../../../../core/time.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{set as r,add as h}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import l from"../../../../geometry/Point.js";import{getPaddingScreenTranslation as p,scaleAndRotateBy as c}from"../../viewpointUtils.js";import{RotationMomentumEstimator as _}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as d}from"../../../navigation/ZoomMomentumEstimator.js";let M=class extends i{constructor(t){super(t),this._animationTime=e(0),this._momentumFinished=!1,this._previousAngle=0,this._previousRadius=0,this._previousCenter=null,this._rotationMomentumEstimator=new _(.6,.15,.95),this._rotationDirection=1,this._startAngle=0,this._startRadius=0,this._updateTimestamp=null,this._zoomDirection=1,this._zoomMomentumEstimator=new d,this._zoomOnly=null,this.viewpoint=new o({targetGeometry:new l,scale:0,rotation:0}),this.zoomMomentum=null,this.rotateMomentum=null,this.addHandles(s(()=>this._momentumFinished,()=>this.navigation.stop()))}begin(t,o){this.navigation.begin(),this._rotationMomentumEstimator.reset(),this._zoomMomentumEstimator.reset(),this._zoomOnly=null,this._previousAngle=this._startAngle=o.angle,this._previousRadius=this._startRadius=o.radius,this._previousCenter=o.center,this._updateTimestamp=null,t.constraints.rotationEnabled&&this.addToRotateEstimator(0,o.timestamp),this.addToZoomEstimator(o,1)}update(t,o){null===this._updateTimestamp&&(this._updateTimestamp=o.timestamp);const i=o.angle,s=o.radius,e=o.center,m=Math.abs(180*(i-this._startAngle)/Math.PI),n=Math.abs(s-this._startRadius),a=this._startRadius/s;if(this._previousRadius&&this._previousCenter){const r=s/this._previousRadius;let h=180*(i-this._previousAngle)/Math.PI;this._rotationDirection=h>=0?1:-1,this._zoomDirection=r>=1?1:-1,t.constraints.rotationEnabled?(null===this._zoomOnly&&o.timestamp-this._updateTimestamp>200&&(this._zoomOnly=n-m>0),null===this._zoomOnly||this._zoomOnly?h=0:this.addToRotateEstimator(i-this._startAngle,o.timestamp)):h=0,this.addToZoomEstimator(o,a),this.navigation.setViewpoint([e.x,e.y],1/r,h,[this._previousCenter.x-e.x,e.y-this._previousCenter.y])}this._previousAngle=i,this._previousRadius=s,this._previousCenter=e}end(t){this.rotateMomentum=this._rotationMomentumEstimator.evaluateMomentum(),this.zoomMomentum=this._zoomMomentumEstimator.evaluateMomentum(),this._animationTime=e(0),(this.rotateMomentum||this.zoomMomentum)&&this.onAnimationUpdate(t),this.navigation.end()}addToRotateEstimator(t,o){this._rotationMomentumEstimator.add(t,.001*o)}addToZoomEstimator(t,o){this._zoomMomentumEstimator.add(o,.001*t.timestamp)}canZoomIn(t){const o=t.scale,i=t.constraints.effectiveMaxScale;return 0===i||o>i}canZoomOut(t){const o=t.scale,i=t.constraints.effectiveMinScale;return 0===i||o<i}onAnimationUpdate(t){this.navigation.animationManager?.animateContinuous(t.viewpoint,(o,i)=>{const s=!this.canZoomIn(t)&&this._zoomDirection>1||!this.canZoomOut(t)&&this._zoomDirection<1,n=!this.rotateMomentum||this.rotateMomentum.isFinished(this._animationTime),a=s||!this.zoomMomentum||this.zoomMomentum.isFinished(this._animationTime),l=m(i);if(this._momentumFinished=n&&a,!this._momentumFinished){const i=this.rotateMomentum?Math.abs(this.rotateMomentum.valueDelta(this._animationTime,l))*this._rotationDirection*180/Math.PI:0;let s=this.zoomMomentum?Math.abs(this.zoomMomentum.valueDelta(this._animationTime,l)):1;const e=u(),m=u();if(this._previousCenter){r(e,this._previousCenter.x,this._previousCenter.y),p(m,t.size,t.padding),h(e,e,m);const{constraints:n,scale:a}=t,u=a*s;s<1&&!n.canZoomInTo(u)?(s=a/n.effectiveMaxScale,this.zoomMomentum=null,this.rotateMomentum=null):s>1&&!n.canZoomOutTo(u)&&(s=a/n.effectiveMinScale,this.zoomMomentum=null,this.rotateMomentum=null),c(o,t.viewpoint,s,i,e,t.size),t.constraints.constrainByGeometry(o)}}this._animationTime=e(this._animationTime+l)})}stopMomentumNavigation(){(this.rotateMomentum||this.zoomMomentum)&&(this.rotateMomentum&&(this._rotationMomentumEstimator.reset(),this.rotateMomentum=null),this.zoomMomentum&&(this._zoomMomentumEstimator.reset(),this.zoomMomentum=null),this.navigation.stop())}};t([n()],M.prototype,"_momentumFinished",void 0),t([n()],M.prototype,"viewpoint",void 0),t([n()],M.prototype,"navigation",void 0),M=t([a("esri.views.2d.navigation.actions.Pinch")],M);export{M as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{deg2rad as i}from"../../../../core/mathUtils.js";import{watch as e,sync as s,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{rotateZ as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{d as l,m as p}from"../../../../chunks/vec32.js";import{fromArray as c,clone as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as h,sm4d as u}from"../../../../geometry/support/vectorStacks.js";import{ShiftManipulator as d}from"../Slice/ShiftManipulator.js";import{IsShiftEdgeOnScreenFlag as f}from"../Slice/sliceToolUtils.js";import{calculateTranslateRotateFromBases as y}from"../../interactive/manipulatorUtils.js";import{screenToZConstrained as v}from"../../interactive/editingTools/dragEventPipeline3D.js";import{createManipulatorDragEventPipeline as g}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as j}from"../../../interactive/InteractiveToolBase.js";let M=class extends j{constructor(t){super(t)}initialize(){const{view:t}=this;this._shiftManipulator=new d(t,0),this._shiftManipulator.state|=f,this.manipulators.add(this._shiftManipulator),this.addHandles([this._createDragPipeline(),e(()=>this.analysisViewData.targetGeometry,()=>this._updateManipulatorPosition(),s),e(()=>[this.analysisViewData.interactive,this.analysisViewData.targetGeometry,this.analysis.measureType],()=>this._updateManipulatorVisibility(),o)]),this.finishToolCreation()}destroy(){this._shiftManipulator.destroy()}_createDragPipeline(){return g(this._shiftManipulator,(t,i,e)=>{const s=m(t.renderLocation),o=this.analysis.cutFillOptions.targetElevation;i.next(v(this.view,s,this.view.spatialReference)).next(this._updateValue()),e.next(()=>{this.analysis.cutFillOptions.targetElevation=o})})}_updateManipulatorPosition(){const{targetGeometry:t}=this.analysisViewData,{renderCoordsHelper:e}=this.view;if(!t)return;const s=.5,o=t.rings[0],a=c(o[0]),r=c(o[1]);e.toRenderCoords(a,t.spatialReference,a),e.toRenderCoords(r,t.spatialReference,r);const d=h.get();l(d,r,a);const f=h.get();p(f,a,r,s);const v=e.worldBasisAtPosition(f,1,h.get()),g=e.worldBasisAtPosition(f,0,h.get()),j=y(v,g,f,u.get()),M=e.headingAtPosition(f,d),w=t.isClockwise(t.rings[0])?-Math.PI/2:Math.PI/2;n(j,j,i(M)+w),j[12]=0,j[13]=0,j[14]=0,this._shiftManipulator.renderLocation=m(f),this._shiftManipulator.modelTransform=j}_updateManipulatorVisibility(){const{interactive:t,targetGeometry:i}=this.analysisViewData,{measureType:e}=this.analysis,s=t&&null!=i&&"cut-fill"===e;this._shiftManipulator.available=s}_updateValue(){const{analysis:t}=this;return i=>(t.cutFillOptions.targetElevation=i.mapEnd.z,i)}};t([a({constructOnly:!0})],M.prototype,"analysis",void 0),t([a({constructOnly:!0})],M.prototype,"view",void 0),t([a({constructOnly:!0})],M.prototype,"analysisViewData",void 0),M=t([r("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementShiftTool")],M);export{M as VolumeMeasurementShiftTool};
5
+ import{__decorate as t}from"tslib";import{deg2rad as i}from"../../../../core/mathUtils.js";import{createLength as o}from"../../../../core/quantityUtils.js";import{watch as e,sync as s,syncAndInitial as a}from"../../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as r}from"../../../../core/unitUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{rotateZ as p}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{d as h,m as c}from"../../../../chunks/vec32.js";import{fromArray as u,clone as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as d,sm4d as f}from"../../../../geometry/support/vectorStacks.js";import{ShiftManipulator as v}from"../Slice/ShiftManipulator.js";import{IsShiftEdgeOnScreenFlag as y}from"../Slice/sliceToolUtils.js";import{calculateTranslateRotateFromBases as _}from"../../interactive/manipulatorUtils.js";import{screenToZConstrained as g}from"../../interactive/editingTools/dragEventPipeline3D.js";import{createManipulatorDragEventPipeline as w}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as T}from"../../../interactive/InteractiveToolBase.js";import j from"../../../interactive/sketch/SketchOptions.js";import{makeTooltip as M,enterInputModeIfAvailable as V}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{ElevationTooltipInfo as O}from"../../../interactive/tooltip/infos/ElevationTooltipInfo.js";let S=class extends T{constructor(t){super(t),this.sketchOptions=new j,this._tooltipInfo=null}initialize(){const{view:t}=this;this._shiftManipulator=new v(t,0),this._shiftManipulator.state|=y,this.manipulators.add(this._shiftManipulator),this.addHandles([this._createDragPipeline(),e(()=>this.analysisViewData.targetGeometry,()=>this._updateManipulatorPosition(),s),e(()=>[this.analysisViewData.interactive,this.analysisViewData.targetGeometry,this.analysis.measureType],()=>this._updateManipulatorVisibility(),a)]),this._initializeTooltip(),this.finishToolCreation()}_initializeTooltip(){const{view:t}=this;this.tooltip=M(()=>({view:t,options:this.sketchOptions.tooltips})),this.sketchOptions.tooltips.placement="trailing",this.addHandles([e(()=>this.analysisViewData.effectiveTargetElevation,()=>this._updateTooltip()),e(()=>this._shouldShowTooltip,t=>{t?this._showTooltip():this._hideTooltip()}),this.tooltip.on("commit",()=>{const t=this._tooltipInfo?.elevation.actual?.value;this._updateValue(t)})])}destroy(){this._shiftManipulator.destroy(),this.tooltip.destroy()}onInputEvent(t){if(!this.destroyed&&!V(t,this.tooltip))return super.onInputEvent(t)}get _shouldShowTooltip(){return this.hasFocusedManipulators||"input"===this.tooltip.mode}_createDragPipeline(){const{cutFillOptions:t}=this.analysis;return w(this._shiftManipulator,(i,o,e)=>{const s=m(i.renderLocation),a=t.targetElevation;o.next(g(this.view,s,this.view.spatialReference)).next(t=>(this._updateValue(t.mapEnd.z),t)),e.next(()=>{this._updateValue(a)})})}_updateManipulatorPosition(){const{targetGeometry:t}=this.analysisViewData,{renderCoordsHelper:o}=this.view;if(!t)return;const e=.5,s=t.rings[0],a=u(s[0]),r=u(s[1]);o.toRenderCoords(a,t.spatialReference,a),o.toRenderCoords(r,t.spatialReference,r);const n=d.get();h(n,r,a);const l=d.get();c(l,a,r,e);const v=o.worldBasisAtPosition(l,1,d.get()),y=o.worldBasisAtPosition(l,0,d.get()),g=_(v,y,l,f.get()),w=o.headingAtPosition(l,n),T=t.isClockwise(t.rings[0])?-Math.PI/2:Math.PI/2;p(g,g,i(w)+T),g[12]=0,g[13]=0,g[14]=0,this._shiftManipulator.renderLocation=m(l),this._shiftManipulator.modelTransform=g}_updateManipulatorVisibility(){const{interactive:t,targetGeometry:i}=this.analysisViewData,{measureType:o}=this.analysis,e=t&&null!=i&&"cut-fill"===o;this._shiftManipulator.available=e}_updateValue(t){this.analysis.cutFillOptions.targetElevation=t}_getUpdatedTooltipInfo(){const{effectiveTargetElevation:t}=this.analysisViewData,i=this._tooltipInfo??=new O({sketchOptions:this.sketchOptions}),e=r(this.view.spatialReference);return t&&e?(i.elevation.actual=o(t,e),i):null}_updateTooltip(){this._shouldShowTooltip&&(this.tooltip.info=this._getUpdatedTooltipInfo())}_showTooltip(){this._updateTooltip()}_hideTooltip(){this.tooltip?.clear()}};t([n({constructOnly:!0})],S.prototype,"analysis",void 0),t([n({constructOnly:!0})],S.prototype,"view",void 0),t([n({constructOnly:!0})],S.prototype,"analysisViewData",void 0),t([n({constructOnly:!0,type:j})],S.prototype,"sketchOptions",void 0),t([n()],S.prototype,"_shouldShowTooltip",null),S=t([l("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementShiftTool")],S);export{S as VolumeMeasurementShiftTool};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../Graphic.js";import s from"../../../../core/Accessor.js";import{isSome as i}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{makeHandle as a}from"../../../../core/handleUtils.js";import{ignoreAbortErrors as r,isAborted as o,createResolver as h,createAbortError as c,onAbort as n}from"../../../../core/promiseUtils.js";import{watch as p,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as d}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as y}from"../../../../core/support/UpdatingHandles.js";import u from"../../../../layers/GraphicsLayer.js";import _ from"../../../../symbols/SimpleFillSymbol.js";import{isPolygon as k,isPolygonGraphic as g}from"./volumeMeasurementGeometryUtils.js";import{VolumeMeasurementShiftTool as G}from"./VolumeMeasurementShiftTool.js";import w from"../../../../widgets/Sketch/SketchViewModel.js";const v=Symbol("interactive-operation");let b=class extends s{constructor(e){super(e),this._updatingHandles=new y,this._onUndoRedo=()=>{this._updateGeometryFromSketchGraphic()}}initialize(){const{analysis:e,analysisViewData:t,view:s}=this;this._graphicsLayer=new u({listMode:"hide",internal:!0,elevationInfo:{mode:"on-the-ground"}}),this._sketchViewModel=new w({layer:this._graphicsLayer,view:s,updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{shapeOperation:"none"},enableRotation:!1,enableScaling:!1,enableMoveAllGraphics:!1,enableZ:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"reshape"},polygonSymbol:this._polygonSymbol}),this.addHandles(this._sketchViewModel.on(["undo","redo"],this._onUndoRedo)),this.addHandles(p(()=>({map:s.map,internalGraphicsLayer:this._graphicsLayer,state:this.state}),({map:e,internalGraphicsLayer:t,state:s})=>{switch(S(e,t),s){case"idle":case"sketching":break;case"awaiting-sketch":this.analysisViewData.interactive=!0;break;case"reshaping":this._startReshape();break;case"reshaping-disabled":this._stopOperation(),this._ensureUpdatedSketchGraphic()}},l)),this._shiftTool=new G({analysis:e,view:s,analysisViewData:t}),s.tools.add(this._shiftTool)}destroy(){this._sketchViewModel.destroy(),this._shiftTool.destroy();const e=this._graphicsLayer;this.view.map.remove(e),e.destroy()}get sketchGraphic(){return this._get("sketchGraphic")}set sketchGraphic(e){e!==this._get("sketchGraphic")&&(this._set("sketchGraphic",e),this._updateGeometryFromSketchGraphic())}get state(){const{geometry:e}=this.analysis,{interactive:t,visible:s}=this.analysisViewData;return s?this._sketchViewModel.createGraphic?this._sketchViewModel.createGraphic===this.sketchGraphic?"sketching":"awaiting-sketch":e?t?"reshaping":"reshaping-disabled":"idle":"idle"}get updating(){return this._sketchViewModel.updating||this._updatingHandles.updating}get _polygonSymbol(){return new _({color:[0,0,0,0],outline:{color:[0,0,0,0]}})}place(e){return this._startPlaceOperation(e,(t,s)=>{const i=this.analysis.clone(),h=this._sketchViewModel.on("create",e=>{switch(e.state){case"complete":this._updateGeometryFromSketchGraphic(),this._stopOperation();break;case"cancel":this._stopOperation();break;case"active":this._updateGeometryFromSketchGraphic();break;case"start":this.sketchGraphic=e.graphic}});return this._ensureUpdatedSketchGraphic(),this._updatingHandles.addPromise(r(this._sketchViewModel.create("polygon"))),a(()=>(h.remove(),this._sketchViewModel.cancel(),this._updateGeometryFromSketchGraphic(),this.analysis.valid?o(e)||i.equals(this.analysis)?s():void t():(this._clearGeometry(),s())))})}async _startPlaceOperation(e,t){const s=h(),i=t(()=>s.resolve({}),()=>s.reject(c()));return n(e,()=>this._stopOperation()),this._replaceHandles([i,n(e,()=>this._stopOperation())],v),await s.promise}_startReshape(){this._stopOperation();const e=this._sketchViewModel.on("update",e=>{this._updateGeometryFromSketchGraphic(),"complete"===e.state&&("reshaping"===this.state?this._startReshape():this._stopOperation())});this._replaceHandles(a(()=>{e.remove(),this._sketchViewModel.cancel()}),v);const t=this._ensureUpdatedSketchGraphic();t&&this._updatingHandles.addPromise(r(this._sketchViewModel.update(t,{tool:"reshape"})))}_stopOperation(){this.removeHandles(v)}_ensureUpdatedSketchGraphic(){const{geometry:e}=this.analysis;return k(e)?(this.sketchGraphic??=new t({geometry:e,symbol:this._polygonSymbol}),this.sketchGraphic.geometry=e,this._graphicsLayer.add(this.sketchGraphic),this.sketchGraphic):(this.sketchGraphic=null,null)}_clearGeometry(){this.sketchGraphic=null,this.analysis.geometry=null}_updateGeometryFromSketchGraphic(){const e=this.sketchGraphic;this.analysis.geometry=g(e)?e.geometry:null}_replaceHandles(e,t){this.removeHandles(t),this.addHandles((Array.isArray(e)?e:[e]).filter(i),t)}};function S(e,t){t&&(t.parent&&"remove"in t.parent&&t.parent.remove(t),e?.add(t))}e([d({constructOnly:!0})],b.prototype,"analysisViewData",void 0),e([d({constructOnly:!0})],b.prototype,"view",void 0),e([d({constructOnly:!0})],b.prototype,"analysis",void 0),e([d()],b.prototype,"sketchGraphic",null),e([d({nonNullable:!0})],b.prototype,"state",null),e([d()],b.prototype,"updating",null),e([d()],b.prototype,"_polygonSymbol",null),b=e([m("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementTool")],b);export{b as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../../Graphic.js";import s from"../../../../core/Accessor.js";import{isSome as i}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{makeHandle as a}from"../../../../core/handleUtils.js";import{ignoreAbortErrors as r,isAborted as o,createResolver as h,createAbortError as c,onAbort as n}from"../../../../core/promiseUtils.js";import{watch as p,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as d}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as y}from"../../../../core/support/UpdatingHandles.js";import u from"../../../../layers/GraphicsLayer.js";import _ from"../../../../symbols/SimpleFillSymbol.js";import{isPolygon as k,isPolygonGraphic as g}from"./volumeMeasurementGeometryUtils.js";import{VolumeMeasurementShiftTool as G}from"./VolumeMeasurementShiftTool.js";import w from"../../../../widgets/Sketch/SketchViewModel.js";const v=Symbol("interactive-operation");let b=class extends s{constructor(e){super(e),this._updatingHandles=new y,this._onUndoRedo=()=>{this._updateGeometryFromSketchGraphic()}}initialize(){const{analysis:e,analysisViewData:t,view:s}=this;this._graphicsLayer=new u({listMode:"hide",internal:!0,elevationInfo:{mode:"on-the-ground"}}),this._sketchViewModel=new w({layer:this._graphicsLayer,view:s,updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{shapeOperation:"none"},enableRotation:!1,enableScaling:!1,enableMoveAllGraphics:!1,enableZ:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"reshape"},polygonSymbol:this._polygonSymbol}),this.addHandles(this._sketchViewModel.on(["undo","redo"],this._onUndoRedo)),this.addHandles(p(()=>({map:s.map,internalGraphicsLayer:this._graphicsLayer,state:this.state}),({map:e,internalGraphicsLayer:t,state:s})=>{switch(S(e,t),s){case"idle":case"sketching":break;case"awaiting-sketch":this.analysisViewData.interactive=!0;break;case"reshaping":this._startReshape();break;case"reshaping-disabled":this._stopOperation(),this._ensureUpdatedSketchGraphic()}},l)),this._shiftTool=new G({analysis:e,view:s,analysisViewData:t}),s.tools.add(this._shiftTool)}destroy(){this._sketchViewModel.destroy(),this._shiftTool.destroy();const e=this._graphicsLayer;this.view.map.remove(e),e.destroy()}get sketchGraphic(){return this._get("sketchGraphic")}set sketchGraphic(e){e!==this._get("sketchGraphic")&&(this._set("sketchGraphic",e),this._updateGeometryFromSketchGraphic())}get state(){const{geometry:e}=this.analysis,{interactive:t,visible:s}=this.analysisViewData;return s?this._sketchViewModel.createGraphic?this._sketchViewModel.createGraphic===this.sketchGraphic?"sketching":"awaiting-sketch":e?t?"reshaping":"reshaping-disabled":"idle":"idle"}get updating(){return this._sketchViewModel.updating||this._updatingHandles.updating}get _polygonSymbol(){return new _({color:[0,0,0,0],outline:{color:[0,0,0,0]}})}place(e){return this._startPlaceOperation(e,(t,s)=>{const i=this.analysis.clone(),h=this._sketchViewModel.on("create",e=>{switch(e.state){case"complete":this._updateGeometryFromSketchGraphic(),this._stopOperation();break;case"cancel":this._stopOperation();break;case"active":this._updateGeometryFromSketchGraphic();break;case"start":this.sketchGraphic=e.graphic}});return this._ensureUpdatedSketchGraphic(),this._updatingHandles.addPromise(r(this._sketchViewModel.create("polygon"))),a(()=>(h.remove(),this._sketchViewModel.cancel(),this._updateGeometryFromSketchGraphic(),this.analysis.valid?o(e)||i.equals(this.analysis)?s():void t():(this._clearGeometry(),s())))})}async _startPlaceOperation(e,t){const s=h(),i=t(()=>s.resolve({}),()=>s.reject(c()));return n(e,()=>this._stopOperation()),this._replaceHandles([i,n(e,()=>this._stopOperation())],v),await s.promise}_startReshape(){this._stopOperation();const e=this._sketchViewModel.on("update",e=>{this._updateGeometryFromSketchGraphic(),"complete"===e.state&&("reshaping"===this.state?this._startReshape():this._stopOperation())});this._replaceHandles(a(()=>{e.remove(),this._sketchViewModel.cancel()}),v);const t=this._ensureUpdatedSketchGraphic();t&&this._updatingHandles.addPromise(r(this._sketchViewModel.update(t,{tool:"reshape"})))}_stopOperation(){this.removeHandles(v)}_ensureUpdatedSketchGraphic(){const{geometry:e}=this.analysis;return k(e)?(this.sketchGraphic??=new t({geometry:e,symbol:this._polygonSymbol}),this.sketchGraphic.geometry=e,this._graphicsLayer.add(this.sketchGraphic),this.sketchGraphic):(this.sketchGraphic=null,null)}_clearGeometry(){this.sketchGraphic=null,this.analysis.geometry=null}_updateGeometryFromSketchGraphic(){const e=this.sketchGraphic;this.analysis.geometry=g(e)?e.geometry:null}_replaceHandles(e,t){this.removeHandles(t),this.addHandles((Array.isArray(e)?e:[e]).filter(i),t)}get test(){}};function S(e,t){t&&(t.parent&&"remove"in t.parent&&t.parent.remove(t),e?.add(t))}e([d({constructOnly:!0})],b.prototype,"analysisViewData",void 0),e([d({constructOnly:!0})],b.prototype,"view",void 0),e([d({constructOnly:!0})],b.prototype,"analysis",void 0),e([d()],b.prototype,"sketchGraphic",null),e([d({nonNullable:!0})],b.prototype,"state",null),e([d()],b.prototype,"updating",null),e([d()],b.prototype,"_polygonSymbol",null),b=e([m("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementTool")],b);export{b as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{destroyMaybe as t}from"../../../core/maybe.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{getDefaultUnitForView as o}from"../../../support/getDefaultUnitForView.js";import{AnalysisView3D as r}from"./AnalysisView3D.js";import{VolumeMeasurementCutFillController as l}from"./VolumeMeasurement/VolumeMeasurementCutFillController.js";import{VolumeMeasurementCutFillVisualization as a}from"./VolumeMeasurement/VolumeMeasurementCutFillVisualization.js";import n from"./VolumeMeasurement/VolumeMeasurementTool.js";let u=class extends r{constructor(e){super(e),this.type="volume-measurement-view-3d",this.analysis=null,this.elevationAlignedGeometry=null,this.targetGeometry=null}initialize(){const{analysis:e,view:t}=this;this._analysisController=new l({view:t,analysis:e,analysisViewData:this}),this._analysisTool=new n({analysis:e,view:t,analysisViewData:this}),this._analysisVisualization=new a({view:t,analysisViewData:this})}destroy(){this._analysisController=t(this._analysisController),this._analysisVisualization=t(this._analysisVisualization),this._analysisTool.destroy()}get result(){return this._analysisController.result}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get visible(){return super.visible}set visible(e){super.visible=e}get effectiveTargetElevation(){const{targetElevation:e}=this.analysis.cutFillOptions;if(null!=e)return e;const t=this.elevationAlignedGeometry?.extent;return t&&t.zmin&&t.zmax?(t.zmax+t.zmin)/2:null}get unit(){return this.analysis.unit??o(this.view)}get updating(){return null!=this._analysisController&&this._analysisController.updating||this._analysisTool.updating}place(e){return this._analysisTool.place(e)}};e([s({readOnly:!0})],u.prototype,"type",void 0),e([s({constructOnly:!0,nonNullable:!0})],u.prototype,"analysis",void 0),e([s({readOnly:!0})],u.prototype,"result",null),e([s()],u.prototype,"elevationAlignedGeometry",void 0),e([s({type:Number})],u.prototype,"effectiveTargetElevation",null),e([s()],u.prototype,"targetGeometry",void 0),e([s()],u.prototype,"unit",null),e([s()],u.prototype,"updating",null),u=e([i("esri.views.3d.analysis.VolumeMeasurementAnalysisView3D")],u);const p=u;export{p as default};
5
+ import{__decorate as e}from"tslib";import"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{getDefaultUnitForView as o}from"../../../support/getDefaultUnitForView.js";import{AnalysisView3D as r}from"./AnalysisView3D.js";import{VolumeMeasurementCutFillController as l}from"./VolumeMeasurement/VolumeMeasurementCutFillController.js";import{VolumeMeasurementCutFillVisualization as a}from"./VolumeMeasurement/VolumeMeasurementCutFillVisualization.js";import n from"./VolumeMeasurement/VolumeMeasurementTool.js";let u=class extends r{constructor(e){super(e),this.type="volume-measurement-view-3d",this.analysis=null,this.elevationAlignedGeometry=null,this.targetGeometry=null}initialize(){const{analysis:e,view:t}=this;this._analysisController=new l({view:t,analysis:e,analysisViewData:this}),this._analysisTool=new n({analysis:e,view:t,analysisViewData:this}),this._analysisVisualization=new a({view:t,analysisViewData:this})}destroy(){this._analysisController=t(this._analysisController),this._analysisVisualization=t(this._analysisVisualization),this._analysisTool.destroy()}get result(){return this._analysisController.result}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get visible(){return super.visible}set visible(e){super.visible=e}get effectiveTargetElevation(){const{targetElevation:e}=this.analysis.cutFillOptions;if(null!=e)return e;const t=this.elevationAlignedGeometry?.extent;return t&&t.zmin&&t.zmax?(t.zmax+t.zmin)/2:null}get unit(){return this.analysis.unit??o(this.view)}get updating(){return null!=this._analysisController&&this._analysisController.updating||this._analysisTool.updating}place(e){return this._analysisTool.place(e)}get test(){}};e([s({readOnly:!0})],u.prototype,"type",void 0),e([s({constructOnly:!0,nonNullable:!0})],u.prototype,"analysis",void 0),e([s({readOnly:!0})],u.prototype,"result",null),e([s()],u.prototype,"elevationAlignedGeometry",void 0),e([s({type:Number})],u.prototype,"effectiveTargetElevation",null),e([s()],u.prototype,"targetGeometry",void 0),e([s()],u.prototype,"unit",null),e([s()],u.prototype,"updating",null),u=e([i("esri.views.3d.analysis.VolumeMeasurementAnalysisView3D")],u);const p=u;export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{l as e,d as t,f as r,g as n}from"../../../../chunks/vec32.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{surfaceElevationBelowRenderLocation as s}from"../intersectionUtils.js";function i(o,i,a=0){const f=o.state.constraints;if(!f.collision.enabled)return!1;const d=s(o,i.eye),m=o.renderCoordsHelper.getAltitude(i.eye),u=d+f.collision.elevationMargin;if(m>=u)return!1;const y=e(i.eye);if(t(c,i.center,i.eye),i.eye=o.renderCoordsHelper.setAltitude(l,u,i.eye),1===a)i.center=r(c,i.eye,c);else if(2===a){const e=(y-m+u)/y;i.center=n(c,i.center,e)}return!0}const c=o(),l=o();export{i as applySurfaceCollisionConstraint};
5
+ import{l as e,d as t,f as r,g as n}from"../../../../chunks/vec32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{surfaceElevationBelowRenderLocation as o}from"../intersectionUtils.js";function i(s,i,a=0){const f=s.state.constraints.collision;if(!f.enabled)return!1;const d=o(s,i.eye),m=s.renderCoordsHelper.getAltitude(i.eye),u=d+f.elevationMargin;if(m>=u)return!1;const y=e(i.eye);if(t(c,i.center,i.eye),i.eye=s.renderCoordsHelper.setAltitude(l,u,i.eye),1===a)i.center=r(c,i.eye,c);else if(2===a){const e=(y-m+u)/y;i.center=n(c,i.center,e)}return!0}const c=s(),l=s();export{i as applySurfaceCollisionConstraint};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{c as e,s as r,g as t,d as n,f as i,e as o,l as s}from"../../../chunks/vec32.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as c}from"../../../geometry/ellipsoidUtils.js";import{containsPoint as l}from"../../../geometry/support/aaBoundingRect.js";import d from"../webgl/RenderCamera.js";import{DepthRange as g}from"../webgl-engine/lib/DepthRange.js";import{Intersector as f}from"../webgl-engine/lib/Intersector.js";function u(e,r,t,n){return null!=e.renderCoordsHelper.fromRenderCoords(r.eye,j,n)&&l(t,j)}function m(e,r){return e.elevationProvider?e.elevationProvider.getElevation(r[0],r[1],r[2],e.renderCoordsHelper.spatialReference,"ground")??0:0}function p(o,s,a,c){const l=o.state.camera.clone();s&&a&&c&&(l.eye=s,l.center=a,l.up=c),v(o,l.ray,R)||e(R,l.center);const d=o.state.constraints,g=d.minimumPoiDistance;if(r(l.eye,R)<g){const r=d.collision.enabled;e(C,l.viewForward),t(C,C,g),r?l.eye=n(j,R,C):i(R,l.eye,C);const s=o.renderCoordsHelper,a=s.getAltitude(l.eye),c=d.collision.elevationMargin;r&&a<c&&(n(C,R,l.eye),l.eye=s.setAltitude(j,c,l.eye),i(R,l.eye,C))}return l.center=R,l}function y(e,t,n){if(!e.state.isGlobal||!e.stateManager.constraintsManager)return!1;const i=m(e,t),o=e.stateManager.constraintsManager.nearFarHeuristic;let s=H.get(e);void 0===s&&(s=new d,H.set(e,s)),s.eye=t,s.center=n;const{far:a}=o.compute(s,e.renderDataExtent,g.infinite,i),c=a*a;return r(t,n)>c}function v(e,r,t){let n=w[e.viewingMode];n||(n=new f(e.state.viewingMode),n.options.backfacesTerrain=!e.state.isGlobal,n.options.invisibleTerrain=!0,w[e.viewingMode]=n);const{isGlobal:i}=e.state;return!(!e.sceneIntersectionHelper.intersectRay(r,n,t)||y(e,r.origin,t))||(!(!e.renderCoordsHelper.intersectManifold(r,0,t)||y(e,r.origin,t))||!!i&&b(r,t,c(e.spatialReference).radius))}function b(e,r,n){const a=o(e.origin,e.origin)-n*n,c=a>0?Math.sqrt(a)/3:1;return t(r,e.direction,c/s(e.direction)),i(r,r,e.origin),!0}let w={};function M(){w={}}const j=a(),R=a(),C=a(),H=new WeakMap;export{p as cameraOnContentAlongViewDirection,M as cleanupIntersectionUtils,u as eyeWithinExtent,m as surfaceElevationBelowRenderLocation};
5
+ import{c as e,s as r,g as t,d as n,f as i,e as o,l as s}from"../../../chunks/vec32.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as c}from"../../../geometry/ellipsoidUtils.js";import{containsPoint as l}from"../../../geometry/support/aaBoundingRect.js";import d from"../webgl/RenderCamera.js";import{DepthRange as g}from"../webgl-engine/lib/DepthRange.js";import{Intersector as f}from"../webgl-engine/lib/Intersector.js";function u(e,r,t,n){return null!=e.renderCoordsHelper.fromRenderCoords(r.eye,j,n)&&l(t,j)}function m(e,r){return e.elevationProvider?e.elevationProvider.getElevation(r[0],r[1],r[2],e.renderCoordsHelper.spatialReference,"ground")??0:0}function p(o,s,a,c){const l=o.state.camera.clone();s&&a&&c&&(l.eye=s,l.center=a,l.up=c),v(o,l.ray,R)||e(R,l.center);const d=o.state.constraints,g=d.minimumPoiDistance;if(r(l.eye,R)<g){const r=d.collision.enabled;e(C,l.viewForward),t(C,C,g),r?l.eye=n(j,R,C):i(R,l.eye,C);const s=o.renderCoordsHelper,a=s.getAltitude(l.eye),c=d.collision.elevationMargin;r&&a<c&&(n(C,R,l.eye),l.eye=s.setAltitude(j,c,l.eye),i(R,l.eye,C))}return l.center=R,l}function y(e,t,n){if(!e.state.isGlobal||!e.stateManager.constraintsManager)return!1;const i=m(e,t),o=e.stateManager.constraintsManager.nearFarHeuristic;let s=H.get(e);void 0===s&&(s=new d,H.set(e,s)),s.eye=t,s.center=n;const{far:a}=o.compute(s,e.renderDataExtent,g.Infinite,i),c=a*a;return r(t,n)>c}function v(e,r,t){let n=w[e.viewingMode];n||(n=new f(e.state.viewingMode),n.options.backfacesTerrain=!e.state.isGlobal,n.options.invisibleTerrain=!0,w[e.viewingMode]=n);const{isGlobal:i}=e.state;return!(!e.sceneIntersectionHelper.intersectRay(r,n,t)||y(e,r.origin,t))||(!(!e.renderCoordsHelper.intersectManifold(r,0,t)||y(e,r.origin,t))||!!i&&b(r,t,c(e.spatialReference).radius))}function b(e,r,n){const a=o(e.origin,e.origin)-n*n,c=a>0?Math.sqrt(a)/3:1;return t(r,e.direction,c/s(e.direction)),i(r,r,e.origin),!0}let w={};function M(){w={}}const j=a(),R=a(),C=a(),H=new WeakMap;export{p as cameraOnContentAlongViewDirection,M as cleanupIntersectionUtils,u as eyeWithinExtent,m as surfaceElevationBelowRenderLocation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{Clonable as o}from"../../../core/Clonable.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{AltitudeConstraint as i}from"./AltitudeConstraint.js";import{ClipDistanceConstraint as e}from"./ClipDistanceConstraint.js";import{TiltConstraint as p}from"./TiltConstraint.js";let c=class extends o{constructor(t){super(t),this.tilt=new p,this.altitude=new i,this.clipDistance=new e}};t([r({type:p})],c.prototype,"tilt",void 0),t([r({type:i})],c.prototype,"altitude",void 0),t([r({type:e})],c.prototype,"clipDistance",void 0),c=t([s("esri.views.3d.constraints.Constraints")],c);export{c as Constraints};
5
+ import{__decorate as t}from"tslib";import{Clonable as o}from"../../../core/Clonable.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{AltitudeConstraint as e}from"./AltitudeConstraint.js";import{ClipDistanceConstraint as i}from"./ClipDistanceConstraint.js";import{TiltConstraint as p}from"./TiltConstraint.js";let n=class extends o{constructor(t){super(t),this.tilt=new p,this.altitude=new e,this.clipDistance=new i}};t([r({type:p,nonNullable:!0})],n.prototype,"tilt",void 0),t([r({type:e,nonNullable:!0})],n.prototype,"altitude",void 0),t([r({type:i,nonNullable:!0})],n.prototype,"clipDistance",void 0),n=t([s("esri.views.3d.constraints.Constraints")],n);export{n as Constraints};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{abortMaybe as r}from"../../../core/maybe.js";import{debounce as i,throwIfAborted as s,ignoreAbortErrors as o}from"../../../core/promiseUtils.js";import l from"../../../core/RandomLCG.js";import{watch as n,when as a,sync as u}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{projectOrLoad as h}from"../../../geometry/projectionUtils.js";import{fromExtent as c,toExtent as m,intersects as f}from"../../../geometry/support/aaBoundingRect.js";import g from"../../../symbols/support/ElevationInfo.js";import{simulationSettingsEqual as _,getFlowSimulationSettings as y}from"../../2d/engine/flow/utils.js";import w from"./SubView3D.js";import{makeScheduleFunction as v}from"./support/makeScheduleFunction.js";import{FlowWorkerHandle as b}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as S,createStreamlineGeometry as j}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as T}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as R}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as x}from"../support/flow/StreamlineResources3DShape.js";import U from"../support/flow/VisualQuery3D.js";import{tilesAreRelated as P}from"../terrain/tileUtils.js";import{RibbonLineMaterial as L}from"../webgl-engine/materials/RibbonLineMaterial.js";import{TaskPriority as C}from"../../support/Scheduler.js";let E=class extends w{constructor(e){super(e),this.type="flow",this.renderedTiles=null,this._abortController=null,this._frameTask=null,this.workerHandle=null,this.emissiveStrength=0,this._overrideMaterialParameters=null,this._overrideSimulationSettings=null,this._debouncedLoad=i(async e=>{const{view:t}=this;if(!this._visible)return void this.clear();if(0===e.size)return;const r=this._computeExtent(e);if(null==r)return;const i=new U(r,this.layer.timeExtent,this._viewSizeWithEqualRatio(r),t.state.contentPixelRatio);null==this._abortController&&(this._abortController=new AbortController);const o=this._abortController,l=await this._load(i,o.signal);s(o.signal),this.clear(),this._visible&&null!=l&&(l.attach(),this._resources=l)}),this._debouncedTileUpdate=i(async()=>{const{allTiles:e}=this.surface,{featureTiles:r}=this.view,{_dataBounds:i,_featureTilesBounds:s}=this,o=e=>e.rendered&&e.visible&&B(i,e.extent);if(null==r)return void(this.renderedTiles=new Set(e.filter(e=>o(e))));const l=r.tiles.filter(e=>e.measures.visible),n=new Set;function*a(r){for(let i=0;i<e.length;++i){const a=e.at(i);if(!o(a))continue;if(!B(s,a.extent))continue;l.some(({lij:e})=>t(e,a.lij)||P(e,a.lij))&&n.add(a),r.madeProgress(),r.done&&(r=yield)}}await this._frameTask.scheduleGenerator(a),this.renderedTiles=n}),this._debugStopLoading=!1}initialize(){const{surface:e,view:t}=this,{resourceController:r}=t;this.workerHandle=new b(v(r)),this._frameTask=r.scheduler.registerTask(C.FLOW_GENERATOR),this.addHandles([n(()=>this.simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>null==e&&null==t||null!=e&&null!=t&&_(e,t)}),n(()=>{const{elevationInfo:e}=this;return[this._visible,this._draped,e?.mode,e?.offset,e?.unit]},()=>this.triggerLoad(),u),n(()=>this._materialParameters,e=>this._resources?.setMaterialParameters(e)),e.on("tiles-changed",()=>this._triggerTilesUpdate()),t.enableFeatureTiles(),n(()=>[this._dataBounds,this._featureTilesBounds],()=>this._triggerTilesUpdate()),a(()=>!t.featureTiles?.updating,()=>this._triggerTilesUpdate())]),this._triggerTilesUpdate()}destroy(){this.abort(),this.clear()}abort(){this._abortController=r(this._abortController)}get _dataBounds(){const e=h(this.layer.fullExtent,this.surface.spatialReference).geometry;return null==e?null:c(e)}get _draped(){return"on-the-ground"===this.elevationInfo.mode}get _featureTilesBounds(){const e=this.view.featureTiles?.filterExtent,t=h(e,this.surface.spatialReference).geometry;return null==t?null:c(t)}get _flowRenderer(){const e=this.layer.renderer;return"flow"!==e?.type?null:e}get _materialParameters(){return{...S(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),...this._overrideMaterialParameters}}get _opacity(){return this.layerView.fullOpacity}get _visible(){const e=this._flowRenderer?.color;return this.layerView.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(null==e||e.a>0)}get elevationInfo(){return this.layer.elevationInfo??k}get layer(){return this.layerView.layer}get simulationSettings(){const{_flowRenderer:e,_overrideSimulationSettings:t}=this;if(null==e)return null;let r=y(e);return null!=t&&(r={...r,...t}),r}get surface(){return this.view.basemapTerrain}doRefresh(){return this.triggerLoad()}clear(){this._resources?.detach(),this._resources=null}async triggerLoad(){const{renderedTiles:e}=this;if(null==e||0===e.size||this._debugStopLoading)return;const t=this._debouncedLoad(e);return this.updatingHandles.addPromise(o(t))}async _load(e,t){const r=await this.fetchDataAndGenerateStreamlines(e,t);if(null==r||0===r.length)return null;const i=await this._createGeometry(e,r);return this._draped?new R(r,i,this.surface.overlayManager):new x(r,i,this.view.stage)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t){const r=new L(this._materialParameters),i=new Array,s=new l(1),{elevationInfo:o,_draped:n,view:a}=this;function*u(l){for(let u=0;u<t.length;++u)i.push(j(a,e,t[u],o,r,n,s)),l.madeProgress(),l.done&&(l=yield)}return await this._frameTask.scheduleGenerator(u),i}_computeExtent(e){const{spatialReference:t}=this.surface;if(null==t)return null;const r=T(e);return null==r?null:m(r,t)}async _triggerTilesUpdate(){const e=this._debouncedTileUpdate();return this.updatingHandles.addPromise(o(e))}_viewSizeWithEqualRatio(e){const t=(e.xmax-e.xmin)/(e.ymax-e.ymin),[r,i]=this.view.size;return r<i?[r,Math.floor(r/t)]:[Math.floor(i*t),i]}get test(){}};e([d()],E.prototype,"type",void 0),e([d()],E.prototype,"renderedTiles",void 0),e([d()],E.prototype,"emissiveStrength",void 0),e([d()],E.prototype,"_dataBounds",null),e([d()],E.prototype,"_draped",null),e([d()],E.prototype,"_featureTilesBounds",null),e([d()],E.prototype,"_flowRenderer",null),e([d()],E.prototype,"_materialParameters",null),e([d()],E.prototype,"_opacity",null),e([d()],E.prototype,"_visible",null),e([d()],E.prototype,"elevationInfo",null),e([d()],E.prototype,"layer",null),e([d()],E.prototype,"_overrideMaterialParameters",void 0),e([d()],E.prototype,"_overrideSimulationSettings",void 0),e([d()],E.prototype,"simulationSettings",null),e([d()],E.prototype,"surface",null),E=e([p("esri.views.3d.layers.FlowSubView3D")],E);const k=new g({mode:"on-the-ground"});function B(e,t){return null==e||null==t||f(e,t)}export{E as default};
5
+ import{__decorate as e}from"tslib";import{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{abortMaybe as r}from"../../../core/maybe.js";import{debounce as i,throwIfAborted as s,ignoreAbortErrors as o}from"../../../core/promiseUtils.js";import l from"../../../core/RandomLCG.js";import{watch as n,when as a,sync as u}from"../../../core/reactiveUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{projectOrLoad as h}from"../../../geometry/projectionUtils.js";import{fromExtent as c,intersection as m,toExtent as f,intersects as g}from"../../../geometry/support/aaBoundingRect.js";import _ from"../../../symbols/support/ElevationInfo.js";import{simulationSettingsEqual as y,getFlowSimulationSettings as w}from"../../2d/engine/flow/utils.js";import v from"./SubView3D.js";import{makeScheduleFunction as b}from"./support/makeScheduleFunction.js";import{FlowWorkerHandle as S}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as j,createStreamlineGeometry as T}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as R}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as x}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as U}from"../support/flow/StreamlineResources3DShape.js";import P from"../support/flow/VisualQuery3D.js";import{tilesAreRelated as L}from"../terrain/tileUtils.js";import{RibbonLineMaterial as A}from"../webgl-engine/materials/RibbonLineMaterial.js";import{TaskPriority as C}from"../../support/Scheduler.js";let E=class extends v{constructor(e){super(e),this.type="flow",this.renderedTiles=null,this._abortController=null,this._frameTask=null,this.workerHandle=null,this.emissiveStrength=0,this._overrideMaterialParameters=null,this._overrideSimulationSettings=null,this._debouncedLoad=i(async e=>{const{view:t}=this;if(!this._visible)return void this.clear();if(0===e.size)return;const r=this._computeExtent(e);if(null==r)return;const i=new P(r,this.layer.timeExtent,this._viewSizeWithEqualRatio(r),t.state.contentPixelRatio);null==this._abortController&&(this._abortController=new AbortController);const o=this._abortController,l=await this._load(i,o.signal);s(o.signal),this.clear(),this._visible&&null!=l&&(l.attach(),this._resources=l)}),this._debouncedTileUpdate=i(async()=>{const{allTiles:e}=this.surface,{featureTiles:r}=this.view,{_dataBounds:i,_featureTilesBounds:s}=this,o=e=>e.rendered&&e.visible&&B(i,e.extent);if(null==r)return void(this.renderedTiles=new Set(e.filter(e=>o(e))));const l=r.tiles.filter(e=>e.measures.visible),n=new Set;function*a(r){for(let i=0;i<e.length;++i){const a=e.at(i);if(!o(a))continue;if(!B(s,a.extent))continue;l.some(({lij:e})=>t(e,a.lij)||L(e,a.lij))&&n.add(a),r.madeProgress(),r.done&&(r=yield)}}await this._frameTask.scheduleGenerator(a),this.renderedTiles=n}),this._debugStopLoading=!1}initialize(){const{surface:e,view:t}=this,{resourceController:r}=t;this.workerHandle=new S(b(r)),this._frameTask=r.scheduler.registerTask(C.FLOW_GENERATOR),this.addHandles([n(()=>this.simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>null==e&&null==t||null!=e&&null!=t&&y(e,t)}),n(()=>{const{elevationInfo:e}=this;return[this._clippingArea,this._visible,this._draped,e?.mode,e?.offset,e?.unit]},()=>this.triggerLoad(),u),n(()=>this._materialParameters,e=>this._resources?.setMaterialParameters(e)),e.on("tiles-changed",()=>this._triggerTilesUpdate()),t.enableFeatureTiles(),n(()=>[this._dataBounds,this._featureTilesBounds],()=>this._triggerTilesUpdate()),a(()=>!t.featureTiles?.updating,()=>this._triggerTilesUpdate())]),this._triggerTilesUpdate()}destroy(){this.abort(),this.clear()}abort(){this._abortController=r(this._abortController)}get _clippingArea(){const e=h(this.view.clippingArea,this.surface.spatialReference).geometry;return null==e?null:c(e)}get _dataBounds(){const e=h(this.layer.fullExtent,this.surface.spatialReference).geometry;return null==e?null:c(e)}get _draped(){return"on-the-ground"===this.elevationInfo.mode}get _featureTilesBounds(){const e=this.view.featureTiles?.filterExtent,t=h(e,this.surface.spatialReference).geometry;return null==t?null:c(t)}get _flowRenderer(){const e=this.layer.renderer;return"flow"!==e?.type?null:e}get _materialParameters(){return{...j(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),...this._overrideMaterialParameters}}get _opacity(){return this.layerView.fullOpacity}get _visible(){const e=this._flowRenderer?.color;return this.layerView.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(null==e||e.a>0)}get elevationInfo(){return this.layer.elevationInfo??k}get layer(){return this.layerView.layer}get simulationSettings(){const{_flowRenderer:e,_overrideSimulationSettings:t}=this;if(null==e)return null;let r=w(e);return null!=t&&(r={...r,...t}),r}get surface(){return this.view.basemapTerrain}doRefresh(){return this.triggerLoad()}clear(){this._resources?.detach(),this._resources=null}async triggerLoad(){const{renderedTiles:e}=this;if(null==e||0===e.size||this._debugStopLoading)return;const t=this._debouncedLoad(e);return this.updatingHandles.addPromise(o(t))}async _load(e,t){const r=await this.fetchDataAndGenerateStreamlines(e,t);if(null==r||0===r.length)return null;const i=await this._createGeometry(e,r);return this._draped?new x(r,i,this.surface.overlayManager):new U(r,i,this.view.stage)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t){const r=new A(this._materialParameters),i=new Array,s=new l(1),{elevationInfo:o,_draped:n,view:a}=this;function*u(l){for(let u=0;u<t.length;++u)i.push(T(a,e,t[u],o,r,n,s)),l.madeProgress(),l.done&&(l=yield)}return await this._frameTask.scheduleGenerator(u),i}_computeExtent(e){const{spatialReference:t}=this.surface;if(null==t)return null;const r=R(e);return null==r?null:(m(r,this._clippingArea,r),f(r,t))}async _triggerTilesUpdate(){const e=this._debouncedTileUpdate();return this.updatingHandles.addPromise(o(e))}_viewSizeWithEqualRatio(e){const t=(e.xmax-e.xmin)/(e.ymax-e.ymin),[r,i]=this.view.size;return r<i?[r,Math.floor(r/t)]:[Math.floor(i*t),i]}get test(){}};e([p()],E.prototype,"type",void 0),e([p()],E.prototype,"renderedTiles",void 0),e([p()],E.prototype,"emissiveStrength",void 0),e([p()],E.prototype,"_clippingArea",null),e([p()],E.prototype,"_dataBounds",null),e([p()],E.prototype,"_draped",null),e([p()],E.prototype,"_featureTilesBounds",null),e([p()],E.prototype,"_flowRenderer",null),e([p()],E.prototype,"_materialParameters",null),e([p()],E.prototype,"_opacity",null),e([p()],E.prototype,"_visible",null),e([p()],E.prototype,"elevationInfo",null),e([p()],E.prototype,"layer",null),e([p()],E.prototype,"_overrideMaterialParameters",void 0),e([p()],E.prototype,"_overrideSimulationSettings",void 0),e([p()],E.prototype,"simulationSettings",null),e([p()],E.prototype,"surface",null),E=e([d("esri.views.3d.layers.FlowSubView3D")],E);const k=new _({mode:"on-the-ground"});function B(e,t){return null==e||null==t||g(e,t)}export{E as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../core/Evented.js";import r from"../../../../core/Logger.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromQuat as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as a,t as l}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBoundingSphere as p}from"../../../../geometry/projection/projectBoundingSphere.js";import{empty as m,expand as u}from"../../../../geometry/support/aaBoundingRect.js";import{f as h}from"../../../../chunks/sphere.js";import{ElevationRange as f}from"../../support/ElevationRange.js";import{ElevationUpdateEvent as d}from"../../support/ElevationUpdateEvent.js";import{Intersector as v}from"../../webgl-engine/lib/Intersector.js";let E=class extends t{constructor(e){super(e),this._tmpEvent=new d,this._renderCoordsHelper=e.view.renderCoordsHelper,this._renderSR=this._renderCoordsHelper.spatialReference,this._layerElevationSource=e.layerElevationSource}initialize(){this._intersector=new v(this.view.state.viewingMode),this._intersector.options.store=0,this._intersector.options.normalRequired=!1,this._tmpEvent.context=this.intersectionHandler.isGround?"ground":"scene"}get spatialReference(){return this.view?.elevationProvider?.spatialReference}getElevation(e,t,i,n){const o=this._renderCoordsHelper,s=a(x,e,t,i);if(!o.toRenderCoords(s,n,s))return r.getLogger(this).error("could not project point to compute elevation"),null;const{layerElevationSource:l,_intersector:c,intersectionHandler:p}=this,m=l.fullExtent,u=null!=m&&Number.isFinite(m.xmin)&&Number.isFinite(m.xmax)&&Number.isFinite(m.ymin)&&Number.isFinite(m.ymax)&&Number.isFinite(m.zmin)&&Number.isFinite(m.zmax)?new f(m.zmin,m.zmax):l.elevationRange;if(null==u)return null;const h=l.elevationOffset,d=u.elevationRangeMin+h,v=u.elevationRangeMax+h,E=o.setAltitude(R,v,s),g=o.setAltitude(y,d,s);return c.reset(E,g,this.view.state.camera),p.intersect(c,null,E,g,null,!0),c.results.min.getIntersectionPoint(s)?o.getAltitude(s):null}getSphereElevationBounds(e,t){return p(e,t,_,this._renderSR),this._layerElevationSource.getElevationRange(_)}getRootElevationBounds(){const e=this.layerElevationSource.fullExtent;return e?.hasZ?new f(e.zmin,e.zmax):null}notifyObjectsChanged(e){this.spatialReference&&(this._computeLayerExtent(t=>{for(const r of e)t(r)},this._tmpEvent.extent),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}notifyObjectsChangedFunctional(e){this.spatialReference&&(this._computeLayerExtent(e,this._tmpEvent.extent),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}notifyObjectChanged(e){this.spatialReference&&(this._computeObjectExtent(e,this._tmpEvent.extent),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}_computeObjectExtent(e,t){m(t),this._expandExtent(e,t)}_computeLayerExtent(e,t){m(t),e(e=>{this._expandExtent(e,t)})}_expandExtent(e,t){const r=this.spatialReference;if(null==r)return;if(null==e)return;o(g,e.quaternion),g[12]=e.center[0],g[13]=e.center[1],g[14]=e.center[2];const i=e.halfSize;for(let n=0;n<8;++n)x[0]=1&n?i[0]:-i[0],x[1]=2&n?i[1]:-i[1],x[2]=4&n?i[2]:-i[2],l(x,x,g),this._renderCoordsHelper.fromRenderCoords(x,x,r),u(t,x,t)}};e([i({constructOnly:!0})],E.prototype,"layerElevationSource",void 0),e([i({constructOnly:!0})],E.prototype,"intersectionHandler",void 0),e([i({constructOnly:!0})],E.prototype,"view",void 0),e([i()],E.prototype,"spatialReference",null),E=e([n("esri.views.3d.layers.i3s.LayerElevationProvider")],E);const g=s(),_=h(0,0,0,0),x=c(),R=c(),y=c();export{E as LayerElevationProvider};
5
+ import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../core/Evented.js";import r from"../../../../core/Logger.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromQuat as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as a,t as l}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBoundingSphere as p}from"../../../../geometry/projection/projectBoundingSphere.js";import{empty as m,expand as u}from"../../../../geometry/support/aaBoundingRect.js";import{f as h}from"../../../../chunks/sphere.js";import{ElevationRange as f}from"../../support/ElevationRange.js";import{ElevationUpdateEventImplementation as d}from"../../terrain/ElevationUpdateEvent.js";import{Intersector as v}from"../../webgl-engine/lib/Intersector.js";let E=class extends t{constructor(e){super(e),this._tmpEvent=new d,this._renderCoordsHelper=e.view.renderCoordsHelper,this._renderSR=this._renderCoordsHelper.spatialReference,this._layerElevationSource=e.layerElevationSource}initialize(){this._intersector=new v(this.view.state.viewingMode),this._intersector.options.store=0,this._intersector.options.normalRequired=!1,this._tmpEvent.context=this.intersectionHandler.isGround?"ground":"scene"}get spatialReference(){return this.view?.elevationProvider?.spatialReference}getElevation(e,t,i,n){const o=this._renderCoordsHelper,s=a(x,e,t,i);if(!o.toRenderCoords(s,n,s))return r.getLogger(this).error("could not project point to compute elevation"),null;const{layerElevationSource:l,_intersector:c,intersectionHandler:p}=this,m=l.fullExtent,u=null!=m&&Number.isFinite(m.xmin)&&Number.isFinite(m.xmax)&&Number.isFinite(m.ymin)&&Number.isFinite(m.ymax)&&Number.isFinite(m.zmin)&&Number.isFinite(m.zmax)?new f(m.zmin,m.zmax):l.elevationRange;if(null==u)return null;const h=l.elevationOffset,d=u.elevationRangeMin+h,v=u.elevationRangeMax+h,E=o.setAltitude(R,v,s),g=o.setAltitude(y,d,s);return c.reset(E,g,this.view.state.camera),p.intersect(c,null,E,g,null,!0),c.results.min.getIntersectionPoint(s)?o.getAltitude(s):null}getSphereElevationBounds(e,t){return p(e,t,_,this._renderSR),this._layerElevationSource.getElevationRange(_)}getRootElevationBounds(){const e=this.layerElevationSource.fullExtent;return e?.hasZ?new f(e.zmin,e.zmax):null}notifyObjectsChanged(e){this.spatialReference&&(this._computeLayerExtent(t=>{for(const r of e)t(r)},this._tmpEvent.extent),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}notifyObjectsChangedFunctional(e){this.spatialReference&&(this._computeLayerExtent(e,this._tmpEvent.extent),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}notifyObjectChanged(e){this.spatialReference&&(this._computeObjectExtent(e,this._tmpEvent.extent),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}_computeObjectExtent(e,t){m(t),this._expandExtent(e,t)}_computeLayerExtent(e,t){m(t),e(e=>{this._expandExtent(e,t)})}_expandExtent(e,t){const r=this.spatialReference;if(null==r)return;if(null==e)return;o(g,e.quaternion),g[12]=e.center[0],g[13]=e.center[1],g[14]=e.center[2];const i=e.halfSize;for(let n=0;n<8;++n)x[0]=1&n?i[0]:-i[0],x[1]=2&n?i[1]:-i[1],x[2]=4&n?i[2]:-i[2],l(x,x,g),this._renderCoordsHelper.fromRenderCoords(x,x,r),u(t,x,t)}};e([i({constructOnly:!0})],E.prototype,"layerElevationSource",void 0),e([i({constructOnly:!0})],E.prototype,"intersectionHandler",void 0),e([i({constructOnly:!0})],E.prototype,"view",void 0),e([i()],E.prototype,"spatialReference",null),E=e([n("esri.views.3d.layers.i3s.LayerElevationProvider")],E);const g=s(),_=h(0,0,0,0),x=c(),R=c(),y=c();export{E as LayerElevationProvider};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../core/Evented.js";import r from"../../../../core/Logger.js";import{getMetersPerVerticalUnitForSR as o}from"../../../../core/unitUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as a,toRect as l,expandWithVec3 as c}from"../../../../geometry/support/aaBoundingBox.js";import{getMetersPerUnit as d}from"../../../../symbols/support/unitConversionUtils.js";import{ElevationUpdateEvent as p}from"../../support/ElevationUpdateEvent.js";import{Intersector as m}from"../../webgl-engine/lib/Intersector.js";import{affectsGeometry as h}from"../../webgl-engine/lib/VertexAttribute.js";const u=1,f=Symbol("layerHandles");let g=class extends t{get spatialReference(){return this.view.spatialReference}constructor(e){super(e),this._elevationOffset=0}initialize(){this._renderCoordsHelper=this.view.renderCoordsHelper,this._intersectLayers=[this.stageLayer],this._intersector=new m(this.view.state.viewingMode),this._intersector.options.store=0;const e=this._computeLayerExtent(this.spatialReference,this.stageLayer);this._zmin=e[2],this._zmax=e[5];const t=this.stageLayer.events;this.addHandles([t.on(["layerObjectAdded","layerObjectRemoved","transformationChanged","shaderTransformationChanged"],e=>this._objectChanged(e)),t.on(["geometryAdded","geometryRemoved"],({object:e})=>this._objectChanged(e)),t.on("attributesChanged",({attribute:e,object:t})=>h(e)&&this._objectChanged(t))],f)}destroy(){this.removeHandles(f)}elevationInfoChanged(){const e=null!=this.layer?this.layer.elevationInfo:null;if(null!=e&&"on-the-ground"!==e.mode){const t=o(this.layer.spatialReference),r=d(e.unit??"meters");this._elevationOffset=(e.offset??0)*r/t}else this._elevationOffset=0}getElevation(e,t,o,s){if(x[0]=e,x[1]=t,x[2]=o,!this._renderCoordsHelper.toRenderCoords(x,s,x))return r.getLogger(this).error("could not project point for elevation alignment"),null;const i=this._elevationOffset,n=this._zmin+i,a=this._zmax+i;this._renderCoordsHelper.setAltitude(b,a,x),this._renderCoordsHelper.setAltitude(j,n,x);const l=e=>!!e.lastValidElevationBB;return this._intersector.reset(b,j,null),this._intersector.intersect(this._intersectLayers,null,u,null,l),this._intersector.results.min.getIntersectionPoint(x)?this._renderCoordsHelper.getAltitude(x):null}_objectChanged(e){const t=this.spatialReference;if(!e.lastValidElevationBB||!t)return;a(_);const r=e.lastValidElevationBB;r.isEmpty()||this._expandExtent(t,r.min,r.max,_);const{min:o,max:s}=e.boundingVolumeWorldSpace;this._expandExtent(t,o,s,_),l(_,v.extent),this._zmin=Math.min(this._zmin,_[2]),this._zmax=Math.max(this._zmax,_[5]),v.spatialReference=t,this.emit("elevation-change",v),v.spatialReference=null,r.assignMinMax(o,s)}_computeLayerExtent(e,t){return a(_),null!=e&&t.objects.forEach(t=>this._expandExtent(e,t.boundingVolumeWorldSpace.min,t.boundingVolumeWorldSpace.max,_)),_}_expandExtent(e,t,r,o){for(let s=0;s<8;++s)x[0]=1&s?t[0]:r[0],x[1]=2&s?t[1]:r[1],x[2]=4&s?t[2]:r[2],this._renderCoordsHelper.fromRenderCoords(x,x,e),c(o,x);return o}};e([s({constructOnly:!0})],g.prototype,"layer",void 0),e([s({constructOnly:!0})],g.prototype,"stageLayer",void 0),e([s({constructOnly:!0})],g.prototype,"view",void 0),e([s()],g.prototype,"spatialReference",null),g=e([i("esri.views.3d.layers.support.StageLayerElevationProvider")],g);const _=a(),v=new p;function y(){v.spatialReference=null}const x=n(),b=n(),j=n();export{g as StageLayerElevationProvider,y as cleanupStageLayerElevationProvider};
5
+ import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../core/Evented.js";import r from"../../../../core/Logger.js";import{getMetersPerVerticalUnitForSR as o}from"../../../../core/unitUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as a,toRect as l,expandWithVec3 as c}from"../../../../geometry/support/aaBoundingBox.js";import{getMetersPerUnit as d}from"../../../../symbols/support/unitConversionUtils.js";import{ElevationUpdateEventImplementation as m}from"../../terrain/ElevationUpdateEvent.js";import{Intersector as p}from"../../webgl-engine/lib/Intersector.js";import{affectsGeometry as h}from"../../webgl-engine/lib/VertexAttribute.js";const u=1,f=Symbol("layerHandles");let g=class extends t{get spatialReference(){return this.view.spatialReference}constructor(e){super(e),this._elevationOffset=0}initialize(){this._renderCoordsHelper=this.view.renderCoordsHelper,this._intersectLayers=[this.stageLayer],this._intersector=new p(this.view.state.viewingMode),this._intersector.options.store=0;const e=this._computeLayerExtent(this.spatialReference,this.stageLayer);this._zmin=e[2],this._zmax=e[5];const t=this.stageLayer.events;this.addHandles([t.on(["layerObjectAdded","layerObjectRemoved","transformationChanged","shaderTransformationChanged"],e=>this._objectChanged(e)),t.on(["geometryAdded","geometryRemoved"],({object:e})=>this._objectChanged(e)),t.on("attributesChanged",({attribute:e,object:t})=>h(e)&&this._objectChanged(t))],f)}destroy(){this.removeHandles(f)}elevationInfoChanged(){const e=null!=this.layer?this.layer.elevationInfo:null;if(null!=e&&"on-the-ground"!==e.mode){const t=o(this.layer.spatialReference),r=d(e.unit??"meters");this._elevationOffset=(e.offset??0)*r/t}else this._elevationOffset=0}getElevation(e,t,o,s){if(x[0]=e,x[1]=t,x[2]=o,!this._renderCoordsHelper.toRenderCoords(x,s,x))return r.getLogger(this).error("could not project point for elevation alignment"),null;const i=this._elevationOffset,n=this._zmin+i,a=this._zmax+i;this._renderCoordsHelper.setAltitude(b,a,x),this._renderCoordsHelper.setAltitude(j,n,x);const l=e=>!!e.lastValidElevationBB;return this._intersector.reset(b,j,null),this._intersector.intersect(this._intersectLayers,null,u,null,l),this._intersector.results.min.getIntersectionPoint(x)?this._renderCoordsHelper.getAltitude(x):null}_objectChanged(e){const t=this.spatialReference;if(!e.lastValidElevationBB||!t)return;a(_);const r=e.lastValidElevationBB;r.isEmpty()||this._expandExtent(t,r.min,r.max,_);const{min:o,max:s}=e.boundingVolumeWorldSpace;this._expandExtent(t,o,s,_),l(_,v.extent),this._zmin=Math.min(this._zmin,_[2]),this._zmax=Math.max(this._zmax,_[5]),v.spatialReference=t,this.emit("elevation-change",v),v.spatialReference=null,r.assignMinMax(o,s)}_computeLayerExtent(e,t){return a(_),null!=e&&t.objects.forEach(t=>this._expandExtent(e,t.boundingVolumeWorldSpace.min,t.boundingVolumeWorldSpace.max,_)),_}_expandExtent(e,t,r,o){for(let s=0;s<8;++s)x[0]=1&s?t[0]:r[0],x[1]=2&s?t[1]:r[1],x[2]=4&s?t[2]:r[2],this._renderCoordsHelper.fromRenderCoords(x,x,e),c(o,x);return o}};e([s({constructOnly:!0})],g.prototype,"layer",void 0),e([s({constructOnly:!0})],g.prototype,"stageLayer",void 0),e([s({constructOnly:!0})],g.prototype,"view",void 0),e([s()],g.prototype,"spatialReference",null),g=e([i("esri.views.3d.layers.support.StageLayerElevationProvider")],g);const _=a(),v=new m;function y(){v.spatialReference=null}const x=n(),b=n(),j=n();export{g as StageLayerElevationProvider,y as cleanupStageLayerElevationProvider};