@arcgis/core 5.2.0-next.22 → 5.2.0-next.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{b0b3c67b7d37bd854d95.js → 1040bce57ea63a6dbca4.js} +2 -2
  3. package/assets/esri/core/workers/chunks/{1a4bec464daa9662ab2a.js → 1a7c0a1dc6ecc93ea03a.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{f02a9408ba3893484c6c.js → 2d6d01913096f7cb5ff8.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{7fc8516111bd869256fc.js → 30298f84bd414f9dea64.js} +1 -1
  6. package/assets/esri/core/workers/chunks/353c67da4b25c29360db.js +2 -0
  7. package/assets/esri/core/workers/chunks/{a54773c9bbc751619b3f.js → 47948c72bc01bd173c20.js} +2 -2
  8. package/assets/esri/core/workers/chunks/{e29c8c10331edfa83277.js → 502464c4eab7667f6566.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{8579eba21f40630d073d.js → 7dbaa089c7472825b80c.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{66c2cfe11161d5dc989a.js → 7dec8c453fdee1968d12.js} +1 -1
  11. package/assets/esri/core/workers/chunks/7e4093f42795ba2f8cfd.js +1 -0
  12. package/assets/esri/core/workers/chunks/{50345dfc00380b158c96.js → 8ba3e0462a9bdaae5f40.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{44e32ed3a570593a7245.js → a8310f55de4749f973d0.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{fb9f8b6cc2b4ae5b60df.js → c9ce408675dae6a0edd1.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{5b42f8aa0247adc2d065.js → d41eed41916ed0422059.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{2255a21c7b959f04d941.js → db90fb8ac96579259566.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{ef94d25d1cceb25ea9fe.js → dd0acd0f8b96839b4f24.js} +2 -2
  18. package/assets/esri/core/workers/chunks/{162dada6a199d1efdf86.js → f859c53432f258af77e3.js} +2 -2
  19. package/config.d.ts +9 -2
  20. package/config.js +1 -1
  21. package/form/elements/AttachmentElement.d.ts +4 -4
  22. package/kernel.js +1 -1
  23. package/layers/OrientedImageryLayer.d.ts +20 -2
  24. package/layers/orientedImagery/types.d.ts +4 -1
  25. package/package.json +3 -3
  26. package/support/revision.js +1 -1
  27. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
  28. package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
  29. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js +1 -1
  30. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js +1 -1
  31. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
  32. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  33. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  34. package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
  35. package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +1 -1
  36. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  37. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  38. package/views/3d/state/utils/navigationUtils.js +1 -1
  39. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  40. package/views/PopupView.d.ts +3 -0
  41. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  42. package/widgets/BatchAttributeForm/types.d.ts +0 -7
  43. package/widgets/BatchAttributeForm.d.ts +7 -9
  44. package/widgets/BatchAttributeForm.js +1 -1
  45. package/widgets/Editor/EditorViewModel.d.ts +12 -2
  46. package/widgets/Editor/EditorViewModel.js +1 -1
  47. package/widgets/Editor/compatibilityAdapters.js +2 -0
  48. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  49. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  50. package/widgets/Editor/legacy/AddAssociationWorkflow.js +2 -0
  51. package/widgets/Editor/legacy/AddAssociationWorkflowData.js +2 -0
  52. package/widgets/Editor/legacy/CreateFeaturesWorkflow.js +2 -0
  53. package/widgets/Editor/legacy/CreateFeaturesWorkflowData.js +2 -0
  54. package/widgets/Editor/legacy/MergeFeaturesWorkflow.js +2 -0
  55. package/widgets/Editor/legacy/MergeFeaturesWorkflowData.js +2 -0
  56. package/widgets/Editor/legacy/SplitFeatureWorkflow.js +2 -0
  57. package/widgets/Editor/legacy/SplitFeatureWorkflowData.js +2 -0
  58. package/widgets/Editor/legacy/UpdateFeatureWorkflow.js +2 -0
  59. package/widgets/Editor/legacy/UpdateFeatureWorkflowData.js +2 -0
  60. package/widgets/Editor/legacy/UpdateFeaturesWorkflow.js +2 -0
  61. package/widgets/Editor/legacy/UpdateFeaturesWorkflowData.js +2 -0
  62. package/widgets/Editor/legacy/UpdateRecordWorkflow.js +2 -0
  63. package/widgets/Editor/legacy/UpdateRecordWorkflowData.js +2 -0
  64. package/widgets/Editor/legacy/UpdateWorkflow.js +2 -0
  65. package/widgets/Editor/legacy/UpdateWorkflowData.js +2 -0
  66. package/widgets/Editor/legacy/Workflow.js +2 -0
  67. package/widgets/Editor/legacy/workflowUtils.js +2 -0
  68. package/widgets/Editor/workflowUtils.js +1 -1
  69. package/widgets/Editor.js +1 -1
  70. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  71. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +2 -1
  72. package/widgets/FeatureTable/Grid/GridViewModel.d.ts +3 -0
  73. package/assets/esri/core/workers/chunks/0eb0ce43b4813cae968f.js +0 -2
  74. package/assets/esri/core/workers/chunks/be4275a4b8977ec3eb61.js +0 -1
  75. /package/assets/esri/core/workers/chunks/{b0b3c67b7d37bd854d95.js.LICENSE.txt → 1040bce57ea63a6dbca4.js.LICENSE.txt} +0 -0
  76. /package/assets/esri/core/workers/chunks/{0eb0ce43b4813cae968f.js.LICENSE.txt → 353c67da4b25c29360db.js.LICENSE.txt} +0 -0
  77. /package/assets/esri/core/workers/chunks/{a54773c9bbc751619b3f.js.LICENSE.txt → 47948c72bc01bd173c20.js.LICENSE.txt} +0 -0
  78. /package/assets/esri/core/workers/chunks/{ef94d25d1cceb25ea9fe.js.LICENSE.txt → dd0acd0f8b96839b4f24.js.LICENSE.txt} +0 -0
  79. /package/assets/esri/core/workers/chunks/{162dada6a199d1efdf86.js.LICENSE.txt → f859c53432f258af77e3.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import i from"../../../../core/Accessor.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{createTask as a}from"../../../../core/asyncUtils.js";import{cyclicalDegrees as n,Cyclical as o}from"../../../../core/Cyclical.js";import{handlesGroup as r}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{deg2rad as s}from"../../../../core/mathUtils.js";import{abortMaybe as l,destroyMaybe as p}from"../../../../core/maybe.js";import{after as h,throwIfAborted as u}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as c,initial as v}from"../../../../core/reactiveUtils.js";import{property as g,subclass as m}from"../../../../core/accessorSupport/decorators.js";import{sub as f,len as b,dot as M}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{tryProject as w}from"../../../../geometry/projectionUtils.js";import{viewingModeFromString as O}from"../../../ViewingMode.js";import{viewshedToolManipulatorConfiguration as V}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as y,isSideHorizontal as T,flipSide as D}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedScaleOrientManipulation as H}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as S}from"./viewshedToolManipulatorUtils.js";import{discRadiusSmall as C}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as j}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{resetProperties as F,sceneSnappingAtProjectedLocation as x,dragManipulatedObject as A}from"../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as P}from"../../../interactive/editGeometry/EditGeometryOperations.js";const k=Symbol("dragHandles"),E=Symbol("hideManipulators"),z=Symbol("hideFoVManipulators"),U=Symbol("hideObserverManipulator");let R=class extends i{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._forceHoveringTask=null,this._forceHoveringTestPromise=null,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new y({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new H({view:this.view,tool:this.parentTool}),this._observerManipulator=new S(this.view,this.parentTool),this.addHandles([d(()=>this.elevationAlignedObserverRenderSpace,e=>{null!=e&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},c),d(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=s(90-e))},v),d(()=>{const{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace}},({viewshedComputedData:e,observer:i},a)=>{this._grabbing&&i!==a?.observer||(this.removeHandles(k),e?.valid&&this.addHandles([this._buildObserverDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(t),k))},v),d(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},v),d(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)},v),d(()=>{const e=this.analysisViewData.visible&&(this.viewshedComputedData?.valid??!1),i=this.parentTool.selectedViewshedComputedData===this.viewshedComputedData,{creating:t,isPlacingTarget:a}=this.parentTool;return{fovManipulationAvailable:e&&!a,nonFOVManipulationAvailable:e&&(!t||i)}},({fovManipulationAvailable:e,nonFOVManipulationAvailable:i})=>{this._moveManipulation.available=i,this._scaleOrientManipulation.available=i,this._observerManipulator.available=i,this._fieldOfViewManipulation.available=e},v),d(()=>{const e=this.viewshedComputedData;if(!e?.valid)return null;const{observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}=e;return{viewshedCompData:e,observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}},e=>{null!=e&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},v)]);const e=e=>{this.addHandles([e.events.on("focus-changed",()=>{const e=this._someManipulatorHovering();e&&this.parentTool.subToolHandles.forEach(({subTool:e})=>{e._resetHoveringTask()}),this._someManipulatorSelected()||e||(this._forceHoveringTask=a(async e=>{await(this._forceHoveringTestPromise??h(V.hoverTimeoutMilliseconds,e)),u(e),this._forceHoveringTask=null,this._updateManipulatorVisibility()}))}),e.events.on("grab-changed",i=>{this._grabbing="start"===i.action,"end"===i.action&&this.parentTool.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:e})=>{e!==this&&e._setInteractive(!this._grabbing)}),this._setInteractive(i=>i.hasManipulator(e)||!this._grabbing)}),e.events.on("drag",e=>{"start"===e.action&&this.parentTool.updateInteractionVisualsVisibility()})])};this._forEachManipulator(e)}destroy(){this._forceHoveringTask=l(this._forceHoveringTask),this._moveManipulation=p(this._moveManipulation),this._fieldOfViewManipulation=p(this._fieldOfViewManipulation),this._scaleOrientManipulation=p(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=p(this._observerManipulator)}get updating(){return null!=this._forceHoveringTask&&!this._forceHoveringTask.finished}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){const i=this.viewshed;null!=i&&(i.observer=e)}get elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get moveInteractionState(){const{dragging:e,grabbing:i}=this._moveManipulation;return{dragging:e,grabbing:i}}get scaleOrientInteractionState(){const{dragging:e,grabbing:i}=this._scaleOrientManipulation;return{dragging:e,grabbing:i}}_setInteractive(e){const i="boolean"==typeof e;this._forEachManipulation(t=>t.interactive=i?e:e(t))}onManipulatorSelectionChanged(){if(this._updateManipulatorVisibility(),!this._someManipulatorSelected()){this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null),this._resetHoveringTask()}}hasManipulator(e){let i=!1;return this._forEachManipulator(t=>{i=i||t===e}),i}_someManipulatorSelected(){return this._moveManipulation.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_someManipulatorHovering(){return this._moveManipulation.hovering||this._fieldOfViewManipulation.hovering||this._scaleOrientManipulation.hovering}_createMoveManipulation(){return new j({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:C})}_buildObserverDragPipeline(e){const i={mode:"absolute-height",offset:0},t=e.observer;if(null==t)return null;const a=this.view.spatialReference;return this._moveManipulation.createDragPipeline((n,o,r,s,l)=>{s=s.next(F(this,["observer"]));const p=w(t,a),h=w(e.elevationAlignedObserver,a);if(null==p||null==h)return{steps:r,cancel:s};const u=P.fromGeometry(p,O(this.view.viewingMode)),d=P.fromGeometry(h,O(this.view.viewingMode)),c=this.parentTool.createObserverMoveSnappingPipeline?.(n,d,l);if(null!=c){const{snappingStep:e,cancelSnapping:t}=c,{coordinateHelper:a}=d.data;s=s.next(t);return{steps:r.next(e=>({...e,snapOrigin:a.pointToVector(h)})).next(x(this.view,i)).next(...e).next(A({operations:u})).next(e=>(this.observer=u.data.geometry,e)),cancel:s}}return{steps:r.next(A({operations:u})).next(e=>(this.observer=u.data.geometry,e)),cancel:s}},i,a,void 0)}_buildFOVDragPipeline(e){let i=0,t=0;return this._fieldOfViewManipulation.createDragPipeline((a,o,r)=>{if(null==e)return{steps:o,cancel:r};const s=e.viewshed;let l=null;r=r.next(F(s,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:o.next(a=>{"start"===a.action&&(l=null,i=e.horizontalFieldOfView,t=e.verticalFieldOfView);const o=a.deltaAngle;if(null==l&&0!==o){const e="bottom"===a.side||"left"===a.side?o>0:o<0;l=T(a.side)?0===i&&e||360===i&&!e:0===t&&e}const r=l?D(a.side):a.side;let p=0;switch(r){case"left":p=i/2-o;break;case"right":p=i/2+o;break;case"top":p=t+2*o;break;case"bottom":p=t-2*o}return T(r)?(p=n.normalize(p),p=p>270?0:p>180?180:p,s.horizontalFieldOfView=2*p):s.verticalFieldOfView=p,a}),cancel:r}},e)}_buildScaleOrientDragPipeline(e){let i=0,t=0;const a=(i,t)=>(a,n,o)=>{if(null==e)return{steps:n,cancel:o};const r=e.viewshed;return o=o.next(F(r,[i])),{steps:n=n.next(t(r,e)),cancel:o}};return r([this._scaleOrientManipulation.createHeadingDragPipeline(a("heading",(i,a)=>a=>("start"===a.action&&(t=e.heading),i.heading=n.normalize(t+a.deltaAngle),a)),e),this._scaleOrientManipulation.createTiltDragPipeline(a("tilt",(t,a)=>a=>{"start"===a.action&&(i=e.tilt);let n=i+a.deltaAngle;return n<-90?n=180:n>270&&(n=0),t.tilt=G.clamp(n),a}),e),this._scaleOrientManipulation.createDistanceDragPipeline(a("farDistance",(e,i)=>t=>{const a=f(I,t.renderEnd,i.elevationAlignedObserverRenderSpace),n=b(a)*i.metersPerUnit,o=M(a,i.targetDirection)<0?V.scaleOrientMinDistance:n;return e.farDistance=o,t}),e)])}_updateManipulatorVisibility(){const e=this._someManipulatorSelected(),i=null!=this._forceHoveringTask||this._someManipulatorHovering(),t=this._fieldOfViewManipulation.hovering,a=this.parentTool.creating;let n=[];const o=e=>{n.push(e.disableDisplay())};e||!a&&i?this.removeHandles(E):(this._scaleOrientManipulation.forEachManipulator(o),this._moveManipulation.forEachManipulator(o),this.addHandles(n,E),n=[]),e||!a&&i||a&&t?this.removeHandles(z):(this._fieldOfViewManipulation.forEachManipulator(o),this.addHandles(n,z)),e||!a?this.removeHandles(U):this.addHandles(this._observerManipulator.disableDisplay(),U)}_resetHoveringTask(){this._forceHoveringTask=l(this._forceHoveringTask),this._updateManipulatorVisibility()}_forEachManipulator(e){this._forEachManipulation(i=>{i.forEachManipulator(e)}),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData,setHoveringTimeoutPromise:e=>{this._forceHoveringTestPromise=e}}}};e([g({constructOnly:!0})],R.prototype,"analysis",void 0),e([g({constructOnly:!0})],R.prototype,"analysisViewData",void 0),e([g({constructOnly:!0})],R.prototype,"parentTool",void 0),e([g({constructOnly:!0,nonNullable:!0})],R.prototype,"view",void 0),e([g()],R.prototype,"_forceHoveringTask",void 0),e([g()],R.prototype,"updating",null),e([g()],R.prototype,"viewshed",null),e([g()],R.prototype,"_grabbing",void 0),e([g()],R.prototype,"grabbing",null),e([g()],R.prototype,"viewshedComputedData",void 0),e([g()],R.prototype,"observer",null),e([g()],R.prototype,"elevationAlignedObserverRenderSpace",null),R=e([m("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],R);const I=_(),G=new o(0,180);export{R as ViewshedSubTool};
2
+ import{__decorate as e}from"tslib";import i from"../../../../core/Accessor.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{createTask as a}from"../../../../core/asyncUtils.js";import{cyclicalDegrees as n,Cyclical as o}from"../../../../core/Cyclical.js";import{handlesGroup as r}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{deg2rad as s}from"../../../../core/mathUtils.js";import{abortMaybe as l,destroyMaybe as p}from"../../../../core/maybe.js";import{after as h,throwIfAborted as u}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as c,initial as v}from"../../../../core/reactiveUtils.js";import{property as g,subclass as m}from"../../../../core/accessorSupport/decorators.js";import{sub as f,len as b,dot as M}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{tryProject as w}from"../../../../geometry/projectionUtils.js";import{viewshedToolManipulatorConfiguration as O}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as V,isSideHorizontal as y,flipSide as T}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedScaleOrientManipulation as D}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as H}from"./viewshedToolManipulatorUtils.js";import{discRadiusSmall as S}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as C}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{resetProperties as F,sceneSnappingAtProjectedLocation as j,dragManipulatedObject as x}from"../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as A}from"../../../interactive/editGeometry/EditGeometryOperations.js";const P=Symbol("dragHandles"),k=Symbol("hideManipulators"),E=Symbol("hideFoVManipulators"),z=Symbol("hideObserverManipulator");let U=class extends i{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._forceHoveringTask=null,this._forceHoveringTestPromise=null,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new V({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new D({view:this.view,tool:this.parentTool}),this._observerManipulator=new H(this.view,this.parentTool),this.addHandles([d(()=>this.elevationAlignedObserverRenderSpace,e=>{null!=e&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},c),d(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=s(90-e))},v),d(()=>{const{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace}},({viewshedComputedData:e,observer:i},a)=>{this._grabbing&&i!==a?.observer||(this.removeHandles(P),e?.valid&&this.addHandles([this._buildObserverDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(t),P))},v),d(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},v),d(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)},v),d(()=>{const e=this.analysisViewData.visible&&(this.viewshedComputedData?.valid??!1),i=this.parentTool.selectedViewshedComputedData===this.viewshedComputedData,{creating:t,isPlacingTarget:a}=this.parentTool;return{fovManipulationAvailable:e&&!a,nonFOVManipulationAvailable:e&&(!t||i)}},({fovManipulationAvailable:e,nonFOVManipulationAvailable:i})=>{this._moveManipulation.available=i,this._scaleOrientManipulation.available=i,this._observerManipulator.available=i,this._fieldOfViewManipulation.available=e},v),d(()=>{const e=this.viewshedComputedData;if(!e?.valid)return null;const{observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}=e;return{viewshedCompData:e,observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}},e=>{null!=e&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},v)]);const e=e=>{this.addHandles([e.events.on("focus-changed",()=>{const e=this._someManipulatorHovering();e&&this.parentTool.subToolHandles.forEach(({subTool:e})=>{e._resetHoveringTask()}),this._someManipulatorSelected()||e||(this._forceHoveringTask=a(async e=>{await(this._forceHoveringTestPromise??h(O.hoverTimeoutMilliseconds,e)),u(e),this._forceHoveringTask=null,this._updateManipulatorVisibility()}))}),e.events.on("grab-changed",i=>{this._grabbing="start"===i.action,"end"===i.action&&this.parentTool.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:e})=>{e!==this&&e._setInteractive(!this._grabbing)}),this._setInteractive(i=>i.hasManipulator(e)||!this._grabbing)}),e.events.on("drag",e=>{"start"===e.action&&this.parentTool.updateInteractionVisualsVisibility()})])};this._forEachManipulator(e)}destroy(){this._forceHoveringTask=l(this._forceHoveringTask),this._moveManipulation=p(this._moveManipulation),this._fieldOfViewManipulation=p(this._fieldOfViewManipulation),this._scaleOrientManipulation=p(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=p(this._observerManipulator)}get updating(){return null!=this._forceHoveringTask&&!this._forceHoveringTask.finished}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){const i=this.viewshed;null!=i&&(i.observer=e)}get elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get moveInteractionState(){const{dragging:e,grabbing:i}=this._moveManipulation;return{dragging:e,grabbing:i}}get scaleOrientInteractionState(){const{dragging:e,grabbing:i}=this._scaleOrientManipulation;return{dragging:e,grabbing:i}}_setInteractive(e){const i="boolean"==typeof e;this._forEachManipulation(t=>t.interactive=i?e:e(t))}onManipulatorSelectionChanged(){if(this._updateManipulatorVisibility(),!this._someManipulatorSelected()){this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null),this._resetHoveringTask()}}hasManipulator(e){let i=!1;return this._forEachManipulator(t=>{i=i||t===e}),i}_someManipulatorSelected(){return this._moveManipulation.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_someManipulatorHovering(){return this._moveManipulation.hovering||this._fieldOfViewManipulation.hovering||this._scaleOrientManipulation.hovering}_createMoveManipulation(){return new C({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:S})}_buildObserverDragPipeline(e){const{observer:i,effectiveElevationInfo:t}=e,a=this.view.spatialReference;return this._moveManipulation.createDragPipeline((e,n,o,r,s)=>{r=r.next(F(this,["observer"]));const l=w(i,a);if(null==l)return{steps:o,cancel:r};const p=A.fromGeometry(l,this.view.state.viewingMode),h=this.parentTool.createObserverMoveSnappingPipeline?.(e,s,t);if(null!=h){const{snappingStep:e,cancelSnapping:i}=h;return r=r.next(i),{steps:o=o.next(j(this.view,t)).next(...e).next(x({operations:p})).next(e=>(this.observer=p.data.geometry,e)),cancel:r}}return{steps:o=o.next(x({operations:p})).next(e=>(this.observer=p.data.geometry,e)),cancel:r}},t,a,void 0)}_buildFOVDragPipeline(e){let i=0,t=0;return this._fieldOfViewManipulation.createDragPipeline((a,o,r)=>{if(null==e)return{steps:o,cancel:r};const s=e.viewshed;let l=null;r=r.next(F(s,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:o.next(a=>{"start"===a.action&&(l=null,i=e.horizontalFieldOfView,t=e.verticalFieldOfView);const o=a.deltaAngle;if(null==l&&0!==o){const e="bottom"===a.side||"left"===a.side?o>0:o<0;l=y(a.side)?0===i&&e||360===i&&!e:0===t&&e}const r=l?T(a.side):a.side;let p=0;switch(r){case"left":p=i/2-o;break;case"right":p=i/2+o;break;case"top":p=t+2*o;break;case"bottom":p=t-2*o}return y(r)?(p=n.normalize(p),p=p>270?0:p>180?180:p,s.horizontalFieldOfView=2*p):s.verticalFieldOfView=p,a}),cancel:r}},e)}_buildScaleOrientDragPipeline(e){let i=0,t=0;const a=(i,t)=>(a,n,o)=>{if(null==e)return{steps:n,cancel:o};const r=e.viewshed;return o=o.next(F(r,[i])),{steps:n=n.next(t(r,e)),cancel:o}};return r([this._scaleOrientManipulation.createHeadingDragPipeline(a("heading",(i,a)=>a=>("start"===a.action&&(t=e.heading),i.heading=n.normalize(t+a.deltaAngle),a)),e),this._scaleOrientManipulation.createTiltDragPipeline(a("tilt",(t,a)=>a=>{"start"===a.action&&(i=e.tilt);let n=i+a.deltaAngle;return n<-90?n=180:n>270&&(n=0),t.tilt=R.clamp(n),a}),e),this._scaleOrientManipulation.createDistanceDragPipeline(a("farDistance",(e,i)=>t=>{const a=f(I,t.renderEnd,i.elevationAlignedObserverRenderSpace),n=b(a)*i.metersPerUnit,o=M(a,i.targetDirection)<0?O.scaleOrientMinDistance:n;return e.farDistance=o,t}),e)])}_updateManipulatorVisibility(){const e=this._someManipulatorSelected(),i=null!=this._forceHoveringTask||this._someManipulatorHovering(),t=this._fieldOfViewManipulation.hovering,a=this.parentTool.creating;let n=[];const o=e=>{n.push(e.disableDisplay())};e||!a&&i?this.removeHandles(k):(this._scaleOrientManipulation.forEachManipulator(o),this._moveManipulation.forEachManipulator(o),this.addHandles(n,k),n=[]),e||!a&&i||a&&t?this.removeHandles(E):(this._fieldOfViewManipulation.forEachManipulator(o),this.addHandles(n,E)),e||!a?this.removeHandles(z):this.addHandles(this._observerManipulator.disableDisplay(),z)}_resetHoveringTask(){this._forceHoveringTask=l(this._forceHoveringTask),this._updateManipulatorVisibility()}_forEachManipulator(e){this._forEachManipulation(i=>{i.forEachManipulator(e)}),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData,setHoveringTimeoutPromise:e=>{this._forceHoveringTestPromise=e}}}};e([g({constructOnly:!0})],U.prototype,"analysis",void 0),e([g({constructOnly:!0})],U.prototype,"analysisViewData",void 0),e([g({constructOnly:!0})],U.prototype,"parentTool",void 0),e([g({constructOnly:!0,nonNullable:!0})],U.prototype,"view",void 0),e([g()],U.prototype,"_forceHoveringTask",void 0),e([g()],U.prototype,"updating",null),e([g()],U.prototype,"viewshed",null),e([g()],U.prototype,"_grabbing",void 0),e([g()],U.prototype,"grabbing",null),e([g()],U.prototype,"viewshedComputedData",void 0),e([g()],U.prototype,"observer",null),e([g()],U.prototype,"elevationAlignedObserverRenderSpace",null),U=e([m("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],U);const I=_(),R=new o(0,180);export{U as ViewshedSubTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{cyclicalPI as i}from"../../../../core/Cyclical.js";import{deg2rad as e}from"../../../../core/mathUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as s}from"../../../../core/screenUtils.js";import{property as r,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{copy as a,distance as h}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as m,negate as c,length as _,subtract as p,normalize as l,add as u,scale as d,dot as P}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as S}from"../../../../geometry/ellipsoidUtils.js";import{wrapAxisAngle as v}from"../../../../geometry/support/axisAngle.js";import{create as C,fromPositionAndNormal as b,getNormal as w}from"../../../../geometry/support/plane.js";import{Sphere as M}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as f,applyAll as z}from"../../camera/constraintUtils.js";import{ConstraintOptions as j}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as E}from"../../input/util.js";import{InteractiveController as A}from"./InteractiveController.js";import{PanPlanarMomentumController as k}from"./momentum/PanPlanarMomentumController.js";import{PanSphericalMomentumController as y}from"./momentum/PanSphericalMomentumController.js";import{RotationMomentumController as R}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as x}from"./momentum/ZoomPlanarMomentumController.js";import{ZoomSphericalMomentumController as O}from"./momentum/ZoomSphericalMomentumController.js";import{inferNavigationMode as H,pickPointAndInitSphere as F,excludeTerrain as Y,sphereOrPlanePointFromScreenPoint as L,maxPanDistanceModifier as T,minPinchAndPanCameraHeight as D,pivotSearchAreaSize as U,intersectPlaneFromScreenPointAtEye as G,applyZoomOnSphere as I,findHorizonScreenY as V,computeHorizonDownLimitScreenY as Z,shouldClampScreenY as q,shouldPreserveHeading as B,applyPanSphericalPreserveHeading as J,applyPanSphericalDirectRotation as K,computeHorizonUpLimitScreenY as N,normalizeRotationDelta as Q,applyRotation as W,applyPanPlanar as X,applyZoomToPoint as $,intersectsSphereAtScreenPoint as tt}from"../utils/navigationUtils.js";import it from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as et}from"../../../navigation/PanPlanarMomentumEstimator.js";import{PanSphericalMomentumEstimator as nt}from"../../../navigation/PanSphericalMomentumEstimator.js";import{RotationMomentumEstimator as st}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as rt}from"../../../navigation/ZoomMomentumEstimator.js";let ot=class extends A{constructor(t){super(t),this.forceHorizontalPan=!1,this._smoothRotation=new E(.05),this._rotationAxis=g(),this._beginAngle=0,this._beginHeading=0,this._panningPlane=C(),this._beginRadius=0,this._smoothScaling=new E(.05),this._zoomCenterScreen=n(),this._zoomMomentumEstimator=new rt,this._rotationMomentumEstimator=new st,this._panSphericalMomentumEstimator=new nt,this._panPlanarMomentumEstimator=new et,this._adjustedSphere=new M,this._referenceSphere=new M,this._tmp3d=g(),this._tmpScreenPointArray=n(),this._beginScreenPoint=n(),this._beginScenePoint=g(),this._screenPickPoint=n(),this._clampedScreenPoint=n(),this._scenePickPoint=g(),this._horizonScreenY=null,this._panLimitScreenY=null,this._panLimitFromAbove=!1,this._navigationMode=1,this._sphere=new M,this._pointerCount=0,this._tmpInteractionDirection=g(),this._beginCamera=new it,this._constraintOptions=new j(15,0,0,this._beginCamera)}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;this._zoomMomentumEstimator.enabled=this._rotationMomentumEstimator.enabled=this._panPlanarMomentumEstimator.enabled=this._panSphericalMomentumEstimator.enabled=this.view.navigation.momentumEnabled,this._beginHeading=-i.normalize(e(this.view.camera.heading)),this._beginRadius=t.radius,this._beginAngle=t.angle,this._pointerCount=t.pointers.size,this._smoothRotation.reset(),this._referenceSphere.radius=S(this.view.spatialReference).radius,s(t.center,this._screenPickPoint),this.forceHorizontalPan?this._navigationMode=1:this._navigationMode=H(this.startCamera,this._screenPickPoint,this.view.renderCoordsHelper,this.view.viewingMode),1===this._navigationMode&&(this._initClampValues(),a(this._screenPickPoint,this._clampScreenPointToHorizonPaddingRegion(this._screenPickPoint))),a(this._beginScreenPoint,this._screenPickPoint);const n=F(this._intersectionHelper,this.startCamera,this._screenPickPoint,this._referenceSphere.radius,1,this.view.basemapTerrain.invisible?Y:{});null!=n.scenePickPoint&&(this._scenePickPoint=n.scenePickPoint,this._sphere=n.sphere,m(this._beginScenePoint,this._scenePickPoint),0===this._navigationMode?this._preparePlanarPanMode(t,n.hasGeometryIntersection):this._prepareSphericalPanMode(),this._beginCamera.copyFrom(this.startCamera))}update(t){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1;1===this._navigationMode?(i&&this._zoomSpherical(t),this._panningSpherical(t),i&&this._rotateSpherical(t)):(i&&this._zoomPlanar(t),this._panningPlanar(t),i&&this._rotatePlanar(t)),this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this.view.animationsEnabled&&this._zoomMomentumEstimator.evaluateMomentum();if(i)return 1===this._navigationMode?new O({view:this.view,momentum:i,screenCenter:this._zoomCenterScreen,sceneCenter:this._beginScenePoint,radius:this._sphere.radius}):new x({view:this.view,momentum:i,zoomCenter:this._beginScenePoint});const e=this.view.animationsEnabled&&this._rotationMomentumEstimator.evaluateMomentum();if(e)return new R({view:this.view,momentum:e,center:this._sphere.center,axis:this._rotationAxis});if(1===this._navigationMode){const t=this.view.animationsEnabled&&this._panSphericalMomentumEstimator.evaluateMomentum();if(t)return new y({view:this.view,momentum:t})}else{const t=this.view.animationsEnabled&&this._panPlanarMomentumEstimator.evaluateMomentum();if(t)return new k({view:this.view,momentum:t})}return null}_preparePlanarPanMode(t,i){const e=c(this._tmp3d,this.startCamera.viewForward);b(this._scenePickPoint,e,this._panningPlane);const r=n(this._screenPickPoint[0],0),o=g(),a=_(this.startCamera.eye);this._adjustedSphere.radius=a<this._sphere.radius?a-100:this._sphere.radius,L(this._adjustedSphere,this.startCamera,r,o);const h=g(),S=g(),v=g();p(h,this._scenePickPoint,this.currentCamera.eye);const C=_(h);l(h,h);const M=T*Math.max(Math.abs(this.view.camera.position.z),D),f=this.view.stage.renderView.getMinimalDepthForArea(null,this._screenPickPoint[0],this._screenPickPoint[1],this.view.state.camera,U);let z=null!=f?f:M;i&&(z=Math.min(z,C)),m(v,u(S,this.currentCamera.eye,d(S,h,z))),this._panningPlane[3]=-P(w(this._panningPlane),v),this.startCamera.center=u(S,this.startCamera.eye,d(S,this.startCamera.viewForward,z));const j=s(t.center,this._tmpScreenPointArray);G(this._panningPlane,this.startCamera,j,this._beginScenePoint)}_zoomSpherical(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),I(this._sphere,this.currentCamera,this._smoothScaling.value),s(t.center,this._zoomCenterScreen),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=f(t.radius-this._beginRadius),z(this.view,this.currentCamera,this._constraintOptions)}_initClampValues(){this._horizonScreenY=V(this.startCamera,t=>tt(this._referenceSphere,this.startCamera,this._screenPickPoint[0],t));const t=null!=this._horizonScreenY;this._panLimitFromAbove=t&&this._screenPickPoint[1]<this._horizonScreenY,this._panLimitScreenY=t?Z(this.startCamera,this._horizonScreenY):null}_prepareSphericalPanMode(){null!=this._panLimitScreenY&&q(this._screenPickPoint[1],this._panLimitFromAbove,this._panLimitScreenY)&&(this._screenPickPoint[1]=this._panLimitScreenY,L(this._sphere,this.startCamera,this._screenPickPoint,this._beginScenePoint),m(this._scenePickPoint,this._beginScenePoint)),a(this._clampedScreenPoint,this._screenPickPoint)}_panningSpherical(t){const i=s(t.center,this._tmpScreenPointArray),e=this._clampScreenPointToHorizonPaddingRegion(i);L(this._sphere,this.currentCamera,e,this._tmp3d),B(this._beginScenePoint,P(this.currentCamera.up,this._beginScenePoint),this._sphere.radius,this._beginHeading,this.view.camera.tilt,this.startCamera.aboveGround)?(J(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this._beginHeading,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumPreserveHeading(e,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere,this._beginHeading,this.view.camera.tilt)):(K(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumDirectRotation(e,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere.radius,this.view.camera.tilt)),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=f(h(this._screenPickPoint,e)),z(this.view,this.currentCamera,this._constraintOptions)}_clampScreenPointToHorizonPaddingRegion(t){if(a(this._clampedScreenPoint,t),null==this._panLimitScreenY)return this._clampedScreenPoint;const i=V(this.startCamera,i=>tt(this._referenceSphere,this.currentCamera,t[0],i));return null!=i&&(this._horizonScreenY=i,this._panLimitScreenY=this._panLimitFromAbove?Z(this.currentCamera,i):N(this.currentCamera,i)),q(t[1],this._panLimitFromAbove,this._panLimitScreenY)&&(this._clampedScreenPoint[1]=this._panLimitScreenY,this._panSphericalMomentumEstimator.reset()),this._clampedScreenPoint}_rotateSpherical(t){l(this._rotationAxis,this._scenePickPoint),this.currentCamera.aboveGround||c(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value,e=i+Q(t.angle-i),n=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=n,this._smoothRotation.update(e);const s=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(s,.001*t.timestamp),W(this.currentCamera,this._sphere.center,v(this._rotationAxis,s)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=f(t.radius*e),z(this.view,this.currentCamera,this._constraintOptions)}_panningPlanar(t){const i=s(t.center,this._tmpScreenPointArray);G(this._panningPlane,this.currentCamera,i,this._tmp3d)&&(X(this.currentCamera,this._beginScenePoint,this._tmp3d),this._panPlanarMomentumEstimator.add(i,this._tmp3d,.001*t.timestamp),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=f(h(this._beginScreenPoint,i)),this._constraintOptions.interactionDirection=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,this._tmpInteractionDirection),z(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null)}_zoomPlanar(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),$(this.currentCamera,this._beginScenePoint,this._smoothScaling.value,this.view.state.constraints.minimumPoiDistance),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=f(t.radius-this._beginRadius),z(this.view,this.currentCamera,this._constraintOptions)}_rotatePlanar(t){m(this._rotationAxis,this._beginScenePoint),this.currentCamera.aboveGround||c(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value;let e=t.angle-i;e=Q(e);const n=i+e,s=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=s,this._smoothRotation.update(n);const r=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(r,.001*t.timestamp),W(this.currentCamera,this._sphere.center,v(this._rotationAxis,r)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=f(t.radius*r),z(this.view,this.currentCamera,this._constraintOptions)}};t([r()],ot.prototype,"forceHorizontalPan",void 0),ot=t([o("esri.views.3d.state.controllers.PinchAndPanControllerGlobal")],ot);export{ot as PinchAndPanControllerGlobal};
2
+ import{__decorate as t}from"tslib";import{cyclicalPI as i}from"../../../../core/Cyclical.js";import{deg2rad as e}from"../../../../core/mathUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as s}from"../../../../core/screenUtils.js";import{property as r,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{copy as a,distance as h}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as m,negate as c,length as _,subtract as p,normalize as l,add as u,scale as d,dot as P}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as S}from"../../../../geometry/ellipsoidUtils.js";import{wrapAxisAngle as v}from"../../../../geometry/support/axisAngle.js";import{create as C,fromPositionAndNormal as b,getNormal as w}from"../../../../geometry/support/plane.js";import{Sphere as M}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as f,applyAll as z}from"../../camera/constraintUtils.js";import{ConstraintOptions as j}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as E}from"../../input/util.js";import{InteractiveController as A}from"./InteractiveController.js";import{PanPlanarMomentumController as k}from"./momentum/PanPlanarMomentumController.js";import{PanSphericalMomentumController as y}from"./momentum/PanSphericalMomentumController.js";import{RotationMomentumController as R}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as x}from"./momentum/ZoomPlanarMomentumController.js";import{ZoomSphericalMomentumController as O}from"./momentum/ZoomSphericalMomentumController.js";import{inferNavigationMode as H,pickPointAndInitSphere as F,excludeTerrain as Y,sphereOrPlanePointFromScreenPoint as L,maxPanDistanceModifier as T,minPinchAndPanCameraHeight as D,pivotSearchAreaSize as U,intersectPlaneFromScreenPointAtEye as G,applyZoomOnSphere as I,findSphereHorizonY as V,computeHorizonDownLimitScreenY as Z,shouldClampScreenY as q,shouldPreserveHeading as B,applyPanSphericalPreserveHeading as J,applyPanSphericalDirectRotation as K,computeHorizonUpLimitScreenY as N,normalizeRotationDelta as Q,applyRotation as W,applyPanPlanar as X,applyZoomToPoint as $}from"../utils/navigationUtils.js";import tt from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as it}from"../../../navigation/PanPlanarMomentumEstimator.js";import{PanSphericalMomentumEstimator as et}from"../../../navigation/PanSphericalMomentumEstimator.js";import{RotationMomentumEstimator as nt}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as st}from"../../../navigation/ZoomMomentumEstimator.js";let rt=class extends A{constructor(t){super(t),this.forceHorizontalPan=!1,this._smoothRotation=new E(.05),this._rotationAxis=g(),this._beginAngle=0,this._beginHeading=0,this._panningPlane=C(),this._beginRadius=0,this._smoothScaling=new E(.05),this._zoomCenterScreen=n(),this._zoomMomentumEstimator=new st,this._rotationMomentumEstimator=new nt,this._panSphericalMomentumEstimator=new et,this._panPlanarMomentumEstimator=new it,this._adjustedSphere=new M,this._referenceSphere=new M,this._tmp3d=g(),this._tmpScreenPointArray=n(),this._beginScreenPoint=n(),this._beginScenePoint=g(),this._screenPickPoint=n(),this._clampedScreenPoint=n(),this._scenePickPoint=g(),this._horizonScreenY=null,this._panLimitScreenY=null,this._panLimitFromAbove=!1,this._navigationMode=1,this._sphere=new M,this._pointerCount=0,this._tmpInteractionDirection=g(),this._beginCamera=new tt,this._constraintOptions=new j(15,0,0,this._beginCamera)}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;this._zoomMomentumEstimator.enabled=this._rotationMomentumEstimator.enabled=this._panPlanarMomentumEstimator.enabled=this._panSphericalMomentumEstimator.enabled=this.view.navigation.momentumEnabled,this._beginHeading=-i.normalize(e(this.view.camera.heading)),this._beginRadius=t.radius,this._beginAngle=t.angle,this._pointerCount=t.pointers.size,this._smoothRotation.reset(),this._referenceSphere.radius=S(this.view.spatialReference).radius,s(t.center,this._screenPickPoint),this.forceHorizontalPan?this._navigationMode=1:this._navigationMode=H(this.startCamera,this._screenPickPoint,this.view.renderCoordsHelper,this.view.viewingMode),1===this._navigationMode&&(this._initClampValues(),a(this._screenPickPoint,this._clampScreenPointToHorizonPaddingRegion(this._screenPickPoint))),a(this._beginScreenPoint,this._screenPickPoint);const n=F(this._intersectionHelper,this.startCamera,this._screenPickPoint,this._referenceSphere.radius,1,this.view.basemapTerrain.invisible?Y:{});null!=n.scenePickPoint&&(this._scenePickPoint=n.scenePickPoint,this._sphere=n.sphere,m(this._beginScenePoint,this._scenePickPoint),0===this._navigationMode?this._preparePlanarPanMode(t,n.hasGeometryIntersection):this._prepareSphericalPanMode(),this._beginCamera.copyFrom(this.startCamera))}update(t){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1;1===this._navigationMode?(i&&this._zoomSpherical(t),this._panningSpherical(t),i&&this._rotateSpherical(t)):(i&&this._zoomPlanar(t),this._panningPlanar(t),i&&this._rotatePlanar(t)),this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this.view.animationsEnabled&&this._zoomMomentumEstimator.evaluateMomentum();if(i)return 1===this._navigationMode?new O({view:this.view,momentum:i,screenCenter:this._zoomCenterScreen,sceneCenter:this._beginScenePoint,radius:this._sphere.radius}):new x({view:this.view,momentum:i,zoomCenter:this._beginScenePoint});const e=this.view.animationsEnabled&&this._rotationMomentumEstimator.evaluateMomentum();if(e)return new R({view:this.view,momentum:e,center:this._sphere.center,axis:this._rotationAxis});if(1===this._navigationMode){const t=this.view.animationsEnabled&&this._panSphericalMomentumEstimator.evaluateMomentum();if(t)return new y({view:this.view,momentum:t})}else{const t=this.view.animationsEnabled&&this._panPlanarMomentumEstimator.evaluateMomentum();if(t)return new k({view:this.view,momentum:t})}return null}_preparePlanarPanMode(t,i){const e=c(this._tmp3d,this.startCamera.viewForward);b(this._scenePickPoint,e,this._panningPlane);const r=n(this._screenPickPoint[0],0),o=g(),a=_(this.startCamera.eye);this._adjustedSphere.radius=a<this._sphere.radius?a-100:this._sphere.radius,L(this._adjustedSphere,this.startCamera,r,o);const h=g(),S=g(),v=g();p(h,this._scenePickPoint,this.currentCamera.eye);const C=_(h);l(h,h);const M=T*Math.max(Math.abs(this.view.camera.position.z),D),f=this.view.stage.renderView.getMinimalDepthForArea(null,this._screenPickPoint[0],this._screenPickPoint[1],this.view.state.camera,U);let z=null!=f?f:M;i&&(z=Math.min(z,C)),m(v,u(S,this.currentCamera.eye,d(S,h,z))),this._panningPlane[3]=-P(w(this._panningPlane),v),this.startCamera.center=u(S,this.startCamera.eye,d(S,this.startCamera.viewForward,z));const j=s(t.center,this._tmpScreenPointArray);G(this._panningPlane,this.startCamera,j,this._beginScenePoint)}_zoomSpherical(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),I(this._sphere,this.currentCamera,this._smoothScaling.value),s(t.center,this._zoomCenterScreen),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=f(t.radius-this._beginRadius),z(this.view,this.currentCamera,this._constraintOptions)}_initClampValues(){this._horizonScreenY=V(this.startCamera,this._referenceSphere,this._screenPickPoint);const t=null!=this._horizonScreenY;this._panLimitFromAbove=t&&this._screenPickPoint[1]<this._horizonScreenY,this._panLimitScreenY=t?Z(this.startCamera,this._horizonScreenY):null}_prepareSphericalPanMode(){null!=this._panLimitScreenY&&q(this._screenPickPoint[1],this._panLimitFromAbove,this._panLimitScreenY)&&(this._screenPickPoint[1]=this._panLimitScreenY,L(this._sphere,this.startCamera,this._screenPickPoint,this._beginScenePoint),m(this._scenePickPoint,this._beginScenePoint)),a(this._clampedScreenPoint,this._screenPickPoint)}_panningSpherical(t){const i=s(t.center,this._tmpScreenPointArray),e=this._clampScreenPointToHorizonPaddingRegion(i);L(this._sphere,this.currentCamera,e,this._tmp3d),B(this._beginScenePoint,P(this.currentCamera.up,this._beginScenePoint),this._sphere.radius,this._beginHeading,this.view.camera.tilt,this.startCamera.aboveGround)?(J(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this._beginHeading,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumPreserveHeading(e,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere,this._beginHeading,this.view.camera.tilt)):(K(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumDirectRotation(e,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere.radius,this.view.camera.tilt)),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=f(h(this._screenPickPoint,e)),z(this.view,this.currentCamera,this._constraintOptions)}_clampScreenPointToHorizonPaddingRegion(t){if(a(this._clampedScreenPoint,t),null==this._panLimitScreenY)return this._clampedScreenPoint;const i=V(this.currentCamera,this._referenceSphere,t);return null!=i&&(this._horizonScreenY=i,this._panLimitScreenY=this._panLimitFromAbove?Z(this.currentCamera,i):N(this.currentCamera,i)),q(t[1],this._panLimitFromAbove,this._panLimitScreenY)&&(this._clampedScreenPoint[1]=this._panLimitScreenY,this._panSphericalMomentumEstimator.reset()),this._clampedScreenPoint}_rotateSpherical(t){l(this._rotationAxis,this._scenePickPoint),this.currentCamera.aboveGround||c(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value,e=i+Q(t.angle-i),n=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=n,this._smoothRotation.update(e);const s=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(s,.001*t.timestamp),W(this.currentCamera,this._sphere.center,v(this._rotationAxis,s)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=f(t.radius*e),z(this.view,this.currentCamera,this._constraintOptions)}_panningPlanar(t){const i=s(t.center,this._tmpScreenPointArray);G(this._panningPlane,this.currentCamera,i,this._tmp3d)&&(X(this.currentCamera,this._beginScenePoint,this._tmp3d),this._panPlanarMomentumEstimator.add(i,this._tmp3d,.001*t.timestamp),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=f(h(this._beginScreenPoint,i)),this._constraintOptions.interactionDirection=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,this._tmpInteractionDirection),z(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null)}_zoomPlanar(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),$(this.currentCamera,this._beginScenePoint,this._smoothScaling.value,this.view.state.constraints.minimumPoiDistance),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=f(t.radius-this._beginRadius),z(this.view,this.currentCamera,this._constraintOptions)}_rotatePlanar(t){m(this._rotationAxis,this._beginScenePoint),this.currentCamera.aboveGround||c(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value;let e=t.angle-i;e=Q(e);const n=i+e,s=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=s,this._smoothRotation.update(n);const r=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(r,.001*t.timestamp),W(this.currentCamera,this._sphere.center,v(this._rotationAxis,r)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=f(t.radius*r),z(this.view,this.currentCamera,this._constraintOptions)}};t([r()],rt.prototype,"forceHorizontalPan",void 0),rt=t([o("esri.views.3d.state.controllers.PinchAndPanControllerGlobal")],rt);export{rt as PinchAndPanControllerGlobal};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as r,asinClamped as o}from"../../../../core/mathUtils.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{fromRotation as a,exactEquals as s,rotate as c,multiply as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as u,create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{length as h,dot as M,subtract as g,normalize as y,squaredDistance as d,copy as b,transformMat4 as x,add as j,distance as v,cross as P,scale as w,lerp as z,set as I}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as R}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as A,axis as H,fromPoints as S,wrapAxisAngle as T}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as U,vectorCoordinates as G}from"../../../../geometry/support/coordinateSystem.js";import{create as k,fromNormalAndOffset as E,intersectRay as F,projectVector as q}from"../../../../geometry/support/plane.js";import{Sphere as C}from"../../../../geometry/support/sphere.js";import{sm4d as O,sv3d as W}from"../../../../geometry/support/vectorStacks.js";import{fromScreenAtEye as B,fromScreen as D}from"../../support/geometryUtils/ray.js";import{intersectScreen as J}from"../../support/geometryUtils/sphere.js";import K from"../../webgl/RenderCamera.js";import{terrainId as L}from"../../webgl-engine/lib/verticalOffsetUtils.js";const N=30,Q=[1,3e8],V=8,X=[200,1508e5],Y=5,Z=50,$=5,_=10,tt=80,et=90,nt=1e-6,rt={exclude:new Set([L])};function ot(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function it(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function at(t,e,n){const r=a(O.get(),n[3],H(n));null==r||s(r,u)||(g(ye,t.eye,e),x(ye,ye,r),t.eye=j(ye,ye,e),g(ye,t.center,e),x(ye,ye,r),t.center=j(ye,ye,e),t.up=x(ye,t.up,r))}function st(t,e,n,r){return F(t,D(e,n,Pe),r)}function ct(t,e,n,r){return F(t,B(e,n,Pe),r)}function lt(t,e,n,r){const o=W.get();let i=1-n;g(o,e,t.eye);const a=h(o);let s=a*(1-i);i>=0&&s<r&&(s=r,i=-(s-a)/a),Math.abs(a-s)<nt||(w(o,o,i),t.eye=j(ye,t.eye,o),t.center=z(ye,t.center,e,i))}function ut(t,e,n){e.getScreenCenter(mt),J(t,e,mt,ye)&&(e.center=ye);const r=e.distance,o=r*n;if(Math.abs(r-o)<nt)return;const i=w(W.get(),e.viewForward,o);e.eye=g(ye,e.center,i)}const mt=i();function ft(t,e){I(e,0,0,0);for(const n of t)j(e,e,n);w(e,e,1/t.length)}function pt(t,e,n,r){return Math.sin(t/h(e))*(n+r.radius)}function ht(t,e,n,r){return pt(Math.PI/2,e,n,r)+(t-Math.PI/2)}const Mt={Elevation:3e4,Angle:e(16)},gt=.05,yt=12,dt=12,bt=e(80);function xt(t,e,n,r,o,i){const a=R(),s=new C;let c=!0,l=!0;const{eye:u}=e;return t.intersectScreen(n,a,i)&&ne(u,a,r)?s.radius=h(a):(l=!1,e.aboveGround&&0!==o?s.radius=Math.max(h(e.center),.9*r):s.radius=h(e.eye)-e.relativeElevation,1===o?wt(s,e,n,a):c=J(s,e,n,a)),{sphere:s,scenePickPoint:c?a:null,hasGeometryIntersection:l}}function jt(t,e,n,r){const o=t.relativeElevation;if(o>Mt.Elevation&&"global"===r)return 1;B(t,e,we);const i=Math.sign(o),a=n.worldUpAtPosition(t.eye,ye);return-i*M(a,we.direction)<Math.sin(Mt.Angle)*h(we.direction)?0:1}function vt(t,e,n){g(Pt,n,e),t.eye=g(ye,t.eye,Pt),t.center=g(ye,t.center,Pt)}const Pt=R();function wt(t,e,n,r){const o=B(e,n,Pe);return null!=o&&(t.closestPointOnSilhouette(o,zt),t.intersectRay(o,r)?!(d(zt,o.origin)<d(r,o.origin))||(b(r,zt),!1):(g(It,e.eye,e.center),y(It,It),E(It,-M(y(It,It),zt),Rt),F(Rt,o,r),!1))}const zt=R(),It=R(),Rt=k();function At(t,e){const n=t.fullHeight/t.pixelRatio,r=e(0),o=e(n);if(r||!o)return null;let i=0,a=n;for(let s=0;s<dt;s++){const t=.5*(i+a);e(t)?a=t:i=t}return a}const Ht=R(),St=R(),Tt=i();function Ut(t,e){return q(e,t.viewForward,Ht),j(St,t.eye,Ht),t.projectToScreen(St,Tt),Tt[1]}function Gt(t,e,n){return e?t>n:t<n}function kt(t,e){const n=t.fullHeight/t.pixelRatio,r=Math.max(e,n-e);return Math.max(yt,gt*r)}function Et(t,e){const n=t.fullHeight/t.pixelRatio;return Math.min(n,e+kt(t,e))}function Ft(t,e){return Math.max(0,e-kt(t,e))}function qt(t,e,n,r){return ze[0]=n,ze[1]=r,t.intersectRay(B(e,ze,Pe),ye)}function Ct(t,e,n,r){return ze[0]=n,ze[1]=r,F(t,B(e,ze,Pe),ye)}function Ot(i,a,s,c,l,u){let m=0;if(P(xe,i,a),g(de,i,a),h(i)<=l||!c.aboveGround){P(s,de,c.eye);const f=M(i,a)/(h(i)*h(a));if(f<.9999)m=r(f);else{const t=h(P(R(),i,a))/(h(i)*h(a));m=o(t)}const p=Math.cos(n(t.normalize(e(u)),0,bt));m=-m-Math.max(0,h(a)-l)/(p*l)}else g(Wt,c.eye,c.center),P(s,de,Wt),m=-h(de)/l;return y(s,s),w(s,s,h(xe)),m}const Wt=R();function Bt(o,i,a,s){let c,l;const u=Math.cos(n(t.normalize(e(s)),0,bt));return c=i>a?-(i-a)/(u*a):i<-a?Math.PI-(i+a)/(u*a):r(i/a),l=o>a?-(o-a)/(u*a):o<-a?Math.PI-(o+a)/(u*a):r(o/a),(l-c)*a}function Dt(t,e,n,r,o,i,a,s,c,l){const u=Bt(t[2],e[2],i.radius,s),m=c?Bt(t[0],e[0],i.radius,180):e[0]-t[0],p=Math.sin(a)*m-Math.cos(a)*u,h=Math.cos(a)*m+Math.sin(a)*u;y(ye,o);const g=c?p/Math.sqrt(Math.abs(i.radius**2-M(n,ye)**2)):p/i.radius,d=h/Math.sqrt(Math.abs(i.radius**2-M(n,r)**2));f(l,g,d)}function Jt(t,e,n,r,o,i,a,s,c,l){P(xe,t,e),U(i.up,i.eye,ae,se,ce),U([0,0,1],i.eye,re,oe,ie),b(n,oe),b(r,re),y(n,n),w(n,n,h(xe)),G(t,y(se,se),y(ce,ce),y(ae,ae),le),G(e,se,ce,ae,ue),Dt(le,ue,t,re,oe,a,s,c,l,o)}function Kt(t,e,n,r,o,i,s){a(pe,o,r),a(he,s,i),l(Me,pe,he),g(e,t,n),x(e,e,Me),j(e,e,n)}function Lt(t,e,n,r,o,i){a(pe,r,n),a(he,i,o),l(Me,pe,he),g(ye,t.eye,e),x(ye,ye,Me),t.eye=j(ye,ye,e),g(ye,t.center,e),x(ye,ye,Me),t.center=j(ye,ye,e),g(ye,t.up,e),x(ye,ye,Me),t.up=j(ye,ye,e)}const Nt={Pole:.95,Angle:e(18),Tilt:45,TiltHysteresisMargin:1e-7};let Qt=!1;function Vt(t,e,n,r,o,i){const a=Math.abs(r)>Math.PI-Nt.Angle||Math.abs(r)<Nt.Angle,s=(Math.abs(t[2])<n*Nt.Pole||Math.abs(e)>n)&&i;return a&&s?!Qt&&o<Nt.Tilt-Nt.TiltHysteresisMargin?Qt=!0:Qt&&o>Nt.Tilt+Nt.TiltHysteresisMargin&&(Qt=!1):Qt=!1,Qt}function Xt(t,e,n,r,o,i){if(i)S(n,r,fe),at(e,t.center,fe);else{const i=Ot(n,r,je,e,t.radius,o);at(e,t.center,T(je,i))}}function Yt(t,e,n,r,o,i,a){const s=a?20:1,c=1e-12;let l,u;b(ge,r),be.copyFrom(e);for(let m=0;m<s&&d(n,ge)>c&&(l=d(n,ge),Jt(n,ge,oe,re,me,be,t,o,i,a),Lt(be,t.center,re,me[1],oe,me[0]),Kt(ge,ge,t.center,re,me[1],oe,me[0]),u=d(n,ge),u<l||0===m);m++)e.copyFrom(be)}function Zt(n,r,o,i,a,s,c){Vt(o,M(r.up,o),n.radius,-t.normalize(e(a)),s,r.aboveGround)?Yt(n,r,o,i,-t.normalize(e(a)),s,c):Xt(n,r,o,i,s,c)}function $t(t,e,n,r,o,i){const{eye:a}=t;U([0,0,1],a,re,oe,ie);const s=e.translation[0]*n.pan,l="zoom"===o.mode?0:e.translation[1]*n.pan,u=Math.max(Math.sqrt(Math.abs(1-M(t.center,re)**2/h(t.center)**2)),.5),m=(Math.sin(i)*l+Math.cos(i)*s)/u,f=-Math.cos(i)*l+Math.sin(i)*s;switch(c(r.pan.matrix,r.pan.matrix,m,re),r.pan.enabled=!0,o.mode){case"pan":c(r.pan.matrix,r.pan.matrix,f,oe),r.pan.enabled=!0;break;case"zoom":r.zoom=-e.translation[1]*n.zoom}}function _t(t,e,n,r,o){const{eye:i,viewRight:a}=t,s=P(W.get(),a,i),l=e.translation[0]*n.pan;switch(0!==l&&(c(r.pan.matrix,r.pan.matrix,-l,s),r.pan.enabled=!0),o.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(c(r.pan.matrix,r.pan.matrix,t,a),r.pan.enabled=!0);break}case"zoom":r.zoom=-e.translation[1]*n.zoom}}function te(n,r,o,i,a,s,c,l,u){Vt(n.center,M(n.up,n.center),h(n.center),-t.normalize(e(s)),c,r.aboveGround)?$t(r,o,i,l,u,-t.normalize(e(a))):_t(r,o,i,l,u)}function ee(t,e,n=1/0){const r=Math.abs(M(t,e));return Math.min(n,1/r)}function ne(t,e,n){const r=v(t,e),o=h(t);return r<Math.max(o,n)}const re=R(),oe=R(),ie=R(),ae=R(),se=R(),ce=R(),le=R(),ue=R(),me=p(),fe=A(),pe=m(),he=m(),Me=m(),ge=R(),ye=R(),de=R();let be=new K;const xe=R(),je=R();function ve(){be=new K}const Pe={origin:R(),direction:R()},we={origin:R(),direction:R()},ze=i();export{bt as TiltThresholdPanningSpeed,Mt as VerticalPanTresholds,vt as applyPanPlanar,Xt as applyPanSphericalDirectRotation,Yt as applyPanSphericalPreserveHeading,at as applyRotation,Lt as applyRotationWithTwoAxes,ut as applyZoomOnSphere,lt as applyZoomToPoint,ft as centroid,ve as cleanupNavigationUtils,Ft as computeHorizonDownLimitScreenY,kt as computeHorizonPadding,Et as computeHorizonUpLimitScreenY,nt as distanceComparisonTolerance,rt as excludeTerrain,At as findHorizonScreenY,Ut as findPlaneHorizonY,ee as getTiltScaleFactor,jt as inferNavigationMode,st as intersectPlaneFromScreenPoint,ct as intersectPlaneFromScreenPointAtEye,Ct as intersectsPlaneAtScreenPoint,qt as intersectsSphereAtScreenPoint,ne as isHitOnSamePlanetSide,Bt as lengthFromPoints,Y as maxPanDistanceModifier,$ as maxRotatePivotDistanceModifier,N as maxZoomPivotDistanceModifier,V as maxZoomStepDistanceModifier,Z as minPinchAndPanCameraHeight,_ as minRotatePivotDistance,ot as normalizeCoordinate,it as normalizeRotationDelta,ht as offSurfaceTiltToEyeTiltGlobal,pt as onSurfaceTiltToEyeTiltGlobal,te as panMotionToRotationMatrix,Zt as panToPosition,xt as pickPointAndInitSphere,tt as pivotSearchAreaSize,Nt as preservingHeadingThresholds,gt as relativeHorizonPanPadding,et as rotatePivotSearchAreaSize,Kt as rotatePointAroundTwoAxes,Ot as rotationAngleAndAxisDirectRotation,Jt as rotationAnglesAndAxesHeadingPreserving,Dt as rotationAnglesHeadingPreserving,Gt as shouldClampScreenY,Vt as shouldPreserveHeading,wt as sphereOrPlanePointFromScreenPoint,Q as zoomPivotDistanceClamp,X as zoomStepDistanceClamp};
2
+ import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as r,asinClamped as o}from"../../../../core/mathUtils.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{fromRotation as a,exactEquals as s,rotate as c,multiply as u}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as l,create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{length as h,dot as M,subtract as g,normalize as y,squaredDistance as d,copy as b,transformMat4 as x,add as j,distance as v,cross as P,scale as w,lerp as z,crossAndNormalize as I,scaleAndAdd as S,set as T}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as R}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as A,axis as q,fromPoints as H,wrapAxisAngle as U}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as G,vectorCoordinates as k}from"../../../../geometry/support/coordinateSystem.js";import{create as E,fromNormalAndOffset as F,intersectRay as C,fromPositionAndNormal as O,distance as W,projectPoint as B,projectVector as D}from"../../../../geometry/support/plane.js";import{create as J}from"../../../../geometry/support/ray.js";import{Sphere as K}from"../../../../geometry/support/sphere.js";import{sm4d as L,sv3d as N}from"../../../../geometry/support/vectorStacks.js";import{fromScreenAtEye as Q,fromScreen as V}from"../../support/geometryUtils/ray.js";import{intersectScreen as X}from"../../support/geometryUtils/sphere.js";import Y from"../../webgl/RenderCamera.js";import{terrainId as Z}from"../../webgl-engine/lib/verticalOffsetUtils.js";const $=30,_=[1,3e8],tt=8,et=[200,1508e5],nt=5,rt=50,ot=5,it=10,at=80,st=90,ct=1e-6,ut={exclude:new Set([Z])};function lt(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function mt(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function ft(t,e,n){const r=a(L.get(),n[3],q(n));null==r||s(r,l)||(g(ke,t.eye,e),x(ke,ke,r),t.eye=j(ke,ke,e),g(ke,t.center,e),x(ke,ke,r),t.center=j(ke,ke,e),t.up=x(ke,t.up,r))}function pt(t,e,n,r){return C(t,V(e,n,Be),r)}function ht(t,e,n,r){return C(t,Q(e,n,Be),r)}function Mt(t,e,n,r){const o=N.get();let i=1-n;g(o,e,t.eye);const a=h(o);let s=a*(1-i);i>=0&&s<r&&(s=r,i=-(s-a)/a),Math.abs(a-s)<ct||(w(o,o,i),t.eye=j(ke,t.eye,o),t.center=z(ke,t.center,e,i))}function gt(t,e,n){e.getScreenCenter(yt),X(t,e,yt,ke)&&(e.center=ke);const r=e.distance,o=r*n;if(Math.abs(r-o)<ct)return;const i=w(N.get(),e.viewForward,o);e.eye=g(ke,e.center,i)}const yt=i();function dt(t,e){T(e,0,0,0);for(const n of t)j(e,e,n);w(e,e,1/t.length)}function bt(t,e,n,r){return Math.sin(t/h(e))*(n+r.radius)}function xt(t,e,n,r){return bt(Math.PI/2,e,n,r)+(t-Math.PI/2)}const jt={Elevation:3e4,Angle:e(16)},vt=e(80);function Pt(t,e,n,r,o,i){const a=R(),s=new K;let c=!0,u=!0;const{eye:l}=e;return t.intersectScreen(n,a,i)&&xe(l,a,r)?s.radius=h(a):(u=!1,e.aboveGround&&0!==o?s.radius=Math.max(h(e.center),.9*r):s.radius=h(e.eye)-e.relativeElevation,1===o?St(s,e,n,a):c=X(s,e,n,a)),{sphere:s,scenePickPoint:c?a:null,hasGeometryIntersection:u}}function wt(t,e,n,r){const o=t.relativeElevation;if(o>jt.Elevation&&"global"===r)return 1;Q(t,e,De);const i=Math.sign(o),a=n.worldUpAtPosition(t.eye,ke);return-i*M(a,De.direction)<Math.sin(jt.Angle)*h(De.direction)?0:1}function zt(t,e,n){g(It,n,e),t.eye=g(ke,t.eye,It),t.center=g(ke,t.center,It)}const It=R();function St(t,e,n,r){const o=Q(e,n,Be);return null!=o&&(t.closestPointOnSilhouette(o,Tt),t.intersectRay(o,r)?!(d(Tt,o.origin)<d(r,o.origin))||(b(r,Tt),!1):(g(Rt,e.eye,e.center),y(Rt,Rt),F(Rt,-M(y(Rt,Rt),Tt),At),C(At,o,r),!1))}const Tt=R(),Rt=R(),At=E(),qt=R(),Ht=R(),Ut=i();function Gt(t,e){return D(e,t.viewForward,qt),j(Ht,t.eye,qt),t.projectToScreen(Ht,Ut),Ut[1]}const kt=R(),Et=E(),Ft=R(),Ct=R(),Ot=R(),Wt=R(),Bt=R(),Dt=R(),Jt=R(),Kt=R(),Lt=i(),Nt=i(),Qt=J();function Vt(t,e,n){const r=t.eye;if(v(e.center,r)<e.radius)return null;const o=t.up;Q(t,n,Qt);const i=e.radius;if(I(kt,o,Qt.direction),O(r,kt,Et),W(Et,e.center)>i)return null;B(Et,e.center,Ft);const a=v(e.center,Ft),s=Math.sqrt(i**2-a**2);g(Ct,r,Ft),y(Ot,Ct),I(Wt,kt,Ot);const c=M(Ct,Ot),u=M(Ct,Wt),l=Math.sqrt(c**2+u**2),m=s**2/l**2,f=s/l**2*Math.sqrt(l**2-s**2),p=m*c,h=f*-u,d=m*u,b=f*c,x=p-h,P=d+b,z=d-b;return j(Bt,Ft,S(Bt,w(Bt,Ot,p+h),Wt,P)),j(Dt,Ft,S(Dt,w(Dt,Ot,x),Wt,z)),g(Jt,Bt,r),g(Kt,Dt,r),t.projectToScreen(Bt,Lt),t.projectToScreen(Dt,Nt),Math.min(Lt[1],Nt[1])}function Xt(t,e,n){return e?t>n:t<n}const Yt=.05,Zt=12;function $t(t,e){const n=t.fullHeight/t.pixelRatio,r=Math.max(e,n-e);return Math.max(Zt,Yt*r)}function _t(t,e){const n=t.fullHeight/t.pixelRatio;return Math.min(n,e+$t(t,e))}function te(t,e){return Math.max(0,e-$t(t,e))}function ee(t,e,n,r){return Je[0]=n,Je[1]=r,t.intersectRay(Q(e,Je,Be),ke)}function ne(t,e,n,r){return Je[0]=n,Je[1]=r,C(t,Q(e,Je,Be),ke)}function re(i,a,s,c,u,l){let m=0;if(P(Ce,i,a),g(Ee,i,a),h(i)<=u||!c.aboveGround){P(s,Ee,c.eye);const f=M(i,a)/(h(i)*h(a));if(f<.9999)m=r(f);else{const t=h(P(R(),i,a))/(h(i)*h(a));m=o(t)}const p=Math.cos(n(t.normalize(e(l)),0,vt));m=-m-Math.max(0,h(a)-u)/(p*u)}else g(oe,c.eye,c.center),P(s,Ee,oe),m=-h(Ee)/u;return y(s,s),w(s,s,h(Ce)),m}const oe=R();function ie(o,i,a,s){let c,u;const l=Math.cos(n(t.normalize(e(s)),0,vt));return c=i>a?-(i-a)/(l*a):i<-a?Math.PI-(i+a)/(l*a):r(i/a),u=o>a?-(o-a)/(l*a):o<-a?Math.PI-(o+a)/(l*a):r(o/a),(u-c)*a}function ae(t,e,n,r,o,i,a,s,c,u){const l=ie(t[2],e[2],i.radius,s),m=c?ie(t[0],e[0],i.radius,180):e[0]-t[0],p=Math.sin(a)*m-Math.cos(a)*l,h=Math.cos(a)*m+Math.sin(a)*l;y(ke,o);const g=c?p/Math.sqrt(Math.abs(i.radius**2-M(n,ke)**2)):p/i.radius,d=h/Math.sqrt(Math.abs(i.radius**2-M(n,r)**2));f(u,g,d)}function se(t,e,n,r,o,i,a,s,c,u){P(Ce,t,e),G(i.up,i.eye,we,ze,Ie),G([0,0,1],i.eye,je,ve,Pe),b(n,ve),b(r,je),y(n,n),w(n,n,h(Ce)),k(t,y(ze,ze),y(Ie,Ie),y(we,we),Se),k(e,ze,Ie,we,Te),ae(Se,Te,t,je,ve,a,s,c,u,o)}function ce(t,e,n,r,o,i,s){a(qe,o,r),a(He,s,i),u(Ue,qe,He),g(e,t,n),x(e,e,Ue),j(e,e,n)}function ue(t,e,n,r,o,i){a(qe,r,n),a(He,i,o),u(Ue,qe,He),g(ke,t.eye,e),x(ke,ke,Ue),t.eye=j(ke,ke,e),g(ke,t.center,e),x(ke,ke,Ue),t.center=j(ke,ke,e),g(ke,t.up,e),x(ke,ke,Ue),t.up=j(ke,ke,e)}const le={Pole:.95,Angle:e(18),Tilt:45,TiltHysteresisMargin:1e-7};let me=!1;function fe(t,e,n,r,o,i){const a=Math.abs(r)>Math.PI-le.Angle||Math.abs(r)<le.Angle,s=(Math.abs(t[2])<n*le.Pole||Math.abs(e)>n)&&i;return a&&s?!me&&o<le.Tilt-le.TiltHysteresisMargin?me=!0:me&&o>le.Tilt+le.TiltHysteresisMargin&&(me=!1):me=!1,me}function pe(t,e,n,r,o,i){if(i)H(n,r,Ae),ft(e,t.center,Ae);else{const i=re(n,r,Oe,e,t.radius,o);ft(e,t.center,U(Oe,i))}}function he(t,e,n,r,o,i,a){const s=a?20:1,c=1e-12;let u,l;b(Ge,r),Fe.copyFrom(e);for(let m=0;m<s&&d(n,Ge)>c&&(u=d(n,Ge),se(n,Ge,ve,je,Re,Fe,t,o,i,a),ue(Fe,t.center,je,Re[1],ve,Re[0]),ce(Ge,Ge,t.center,je,Re[1],ve,Re[0]),l=d(n,Ge),l<u||0===m);m++)e.copyFrom(Fe)}function Me(n,r,o,i,a,s,c){fe(o,M(r.up,o),n.radius,-t.normalize(e(a)),s,r.aboveGround)?he(n,r,o,i,-t.normalize(e(a)),s,c):pe(n,r,o,i,s,c)}function ge(t,e,n,r,o,i){const{eye:a}=t;G([0,0,1],a,je,ve,Pe);const s=e.translation[0]*n.pan,u="zoom"===o.mode?0:e.translation[1]*n.pan,l=Math.max(Math.sqrt(Math.abs(1-M(t.center,je)**2/h(t.center)**2)),.5),m=(Math.sin(i)*u+Math.cos(i)*s)/l,f=-Math.cos(i)*u+Math.sin(i)*s;switch(c(r.pan.matrix,r.pan.matrix,m,je),r.pan.enabled=!0,o.mode){case"pan":c(r.pan.matrix,r.pan.matrix,f,ve),r.pan.enabled=!0;break;case"zoom":r.zoom=-e.translation[1]*n.zoom}}function ye(t,e,n,r,o){const{eye:i,viewRight:a}=t,s=P(N.get(),a,i),u=e.translation[0]*n.pan;switch(0!==u&&(c(r.pan.matrix,r.pan.matrix,-u,s),r.pan.enabled=!0),o.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(c(r.pan.matrix,r.pan.matrix,t,a),r.pan.enabled=!0);break}case"zoom":r.zoom=-e.translation[1]*n.zoom}}function de(n,r,o,i,a,s,c,u,l){fe(n.center,M(n.up,n.center),h(n.center),-t.normalize(e(s)),c,r.aboveGround)?ge(r,o,i,u,l,-t.normalize(e(a))):ye(r,o,i,u,l)}function be(t,e,n=1/0){const r=Math.abs(M(t,e));return Math.min(n,1/r)}function xe(t,e,n){const r=v(t,e),o=h(t);return r<Math.max(o,n)}const je=R(),ve=R(),Pe=R(),we=R(),ze=R(),Ie=R(),Se=R(),Te=R(),Re=p(),Ae=A(),qe=m(),He=m(),Ue=m(),Ge=R(),ke=R(),Ee=R();let Fe=new Y;const Ce=R(),Oe=R();function We(){Fe=new Y}const Be={origin:R(),direction:R()},De={origin:R(),direction:R()},Je=i();export{vt as TiltThresholdPanningSpeed,jt as VerticalPanTresholds,zt as applyPanPlanar,pe as applyPanSphericalDirectRotation,he as applyPanSphericalPreserveHeading,ft as applyRotation,ue as applyRotationWithTwoAxes,gt as applyZoomOnSphere,Mt as applyZoomToPoint,dt as centroid,We as cleanupNavigationUtils,te as computeHorizonDownLimitScreenY,$t as computeHorizonPadding,_t as computeHorizonUpLimitScreenY,ct as distanceComparisonTolerance,ut as excludeTerrain,Gt as findPlaneHorizonY,Vt as findSphereHorizonY,be as getTiltScaleFactor,wt as inferNavigationMode,pt as intersectPlaneFromScreenPoint,ht as intersectPlaneFromScreenPointAtEye,ne as intersectsPlaneAtScreenPoint,ee as intersectsSphereAtScreenPoint,xe as isHitOnSamePlanetSide,ie as lengthFromPoints,nt as maxPanDistanceModifier,ot as maxRotatePivotDistanceModifier,$ as maxZoomPivotDistanceModifier,tt as maxZoomStepDistanceModifier,rt as minPinchAndPanCameraHeight,it as minRotatePivotDistance,lt as normalizeCoordinate,mt as normalizeRotationDelta,xt as offSurfaceTiltToEyeTiltGlobal,bt as onSurfaceTiltToEyeTiltGlobal,de as panMotionToRotationMatrix,Me as panToPosition,Pt as pickPointAndInitSphere,at as pivotSearchAreaSize,le as preservingHeadingThresholds,Yt as relativeHorizonPanPadding,st as rotatePivotSearchAreaSize,ce as rotatePointAroundTwoAxes,re as rotationAngleAndAxisDirectRotation,se as rotationAnglesAndAxesHeadingPreserving,ae as rotationAnglesHeadingPreserving,Xt as shouldClampScreenY,fe as shouldPreserveHeading,St as sphereOrPlanePointFromScreenPoint,_ as zoomPivotDistanceClamp,et as zoomStepDistanceClamp};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{has}from"../../../../applications/Components/baUtils.js";import{reallocGrowthFactor as t}from"../../../../core/arrayUtils.js";import{initialSplatAtlasTextureHeight as e,GaussianSplatAtlasPages as s,splatAtlasTextureWidth as r,gaussiansPerPage as a}from"./GaussianSplatAtlasPages.js";import{PixelType as i,SizedPixelFormat as l}from"../../../webgl/enums.js";import{DisposableFramebufferObject as o}from"../../../webgl/FramebufferObject.js";import h from"../../../webgl/Texture.js";import{TextureDescriptor as u}from"../../../webgl/TextureDescriptor.js";class c{constructor(t,r,a,i){this._splatAtlasTextureHeight=e,this.texture=null,this._rctx=t,this._fboCache=a,this._onCachedTextureEvicted=i,this.pageAllocator=new s,this._cache=r.newCache("gaussian texture cache",t=>{t.dispose(),this._onCachedTextureEvicted()})}get usedMemory(){return this.texture?.usedMemory??0}ensureTextureAtlas(){if(this.texture?.hasWebGLTextureObject)return;this.texture=null;const t=this._cache.pop("splatTextureAtlas");if(t)return void(this.texture=t);const e=new u;e.height=this._splatAtlasTextureHeight,e.width=r,e.pixelFormat=36249,e.dataType=i.UNSIGNED_INT,e.internalFormat=l.RGBA32UI,e.samplingMode=9728,e.wrapMode=33071,e.isImmutable=!0,this.texture=new h(this._rctx,e),this._updatePageAllocator()}grow(){if(!this.texture)return this.ensureTextureAtlas(),!1;const e=Math.floor(this._splatAtlasTextureHeight*t);if(e>Math.min(has("esri-mobile")?4096:16384,this._rctx.parameters.maxTextureSize))return!1;const s=new o(this._rctx,this.texture),a=this._fboCache.acquire(r,e,"gaussian splat atlas resize",12);return this._rctx.blitFramebuffer(s,a.fbo,16384,9728,0,0,r,this._splatAtlasTextureHeight,0,0,r,this._splatAtlasTextureHeight),this.texture=a.fbo?.detachColorTexture(),s.dispose(),a.dispose(),this._splatAtlasTextureHeight=e,this._updatePageAllocator(),!0}requestPage(){let t=this.pageAllocator.findFirstFreePage();return null===t&&this.grow()&&(t=this.pageAllocator.findFirstFreePage()),null!==t&&this.pageAllocator.allocate(t),t}freePage(t){this.pageAllocator.free(t)}update(t,e,s){this.ensureTextureAtlas(),this.texture.updateData(0,t,e,a,1,s)}_updatePageAllocator(){const t=r*this._splatAtlasTextureHeight/a;this.pageAllocator.pageCount!==t&&this.pageAllocator.resize(t)}clear(){this.texture&&(this._cache.put("splatTextureAtlas",this.texture),this.texture=null)}destroy(){this._onCachedTextureEvicted=()=>{},this._cache.destroy(),this.texture?.dispose(),this.texture=null}}export{c as GaussianSplatTextureAtlas};
2
+ import{has}from"../../../../applications/Components/baUtils.js";import{reallocGrowthFactor as t}from"../../../../core/arrayUtils.js";import{initialSplatAtlasTextureHeight as e,GaussianSplatAtlasPages as s,splatAtlasTextureWidth as r,gaussiansPerPage as a}from"./GaussianSplatAtlasPages.js";import{PixelType as i,SizedPixelFormat as l}from"../../../webgl/enums.js";import{DisposableFramebufferObject as o}from"../../../webgl/FramebufferObject.js";import h from"../../../webgl/Texture.js";import{TextureDescriptor as u}from"../../../webgl/TextureDescriptor.js";class c{constructor(t,r,a,i){this._splatAtlasTextureHeight=e,this.texture=null,this._rctx=t,this._fboCache=a,this._onCachedTextureEvicted=i,this.pageAllocator=new s,this._cache=r.newCache("gaussian texture cache",t=>{t.dispose(),this._onCachedTextureEvicted()})}get usedMemory(){return this.texture?.usedMemory??0}ensureTextureAtlas(){if(this.texture?.hasWebGLTextureObject)return;this.texture=null;const t=this._cache.pop("splatTextureAtlas");if(t)return void(this.texture=t);const e=new u;e.height=this._splatAtlasTextureHeight,e.width=r,e.pixelFormat=36249,e.dataType=i.UNSIGNED_INT,e.internalFormat=l.RGBA32UI,e.samplingMode=9728,e.wrapMode=33071,e.isImmutable=!0,this.texture=new h(this._rctx,e),this._updatePageAllocator()}grow(){if(!this.texture)return this.ensureTextureAtlas(),!1;const e=Math.floor(this._splatAtlasTextureHeight*t);if(e>Math.min(has("esri-mobile")?1048:4096,this._rctx.parameters.maxTextureSize))return!1;const s=new o(this._rctx,this.texture),a=this._fboCache.acquire(r,e,"gaussian splat atlas resize",12);return this._rctx.blitFramebuffer(s,a.fbo,16384,9728,0,0,r,this._splatAtlasTextureHeight,0,0,r,this._splatAtlasTextureHeight),this.texture=a.fbo?.detachColorTexture(),s.dispose(),a.dispose(),this._splatAtlasTextureHeight=e,this._updatePageAllocator(),!0}requestPage(){let t=this.pageAllocator.findFirstFreePage();return null===t&&this.grow()&&(t=this.pageAllocator.findFirstFreePage()),null!==t&&this.pageAllocator.allocate(t),t}freePage(t){this.pageAllocator.free(t)}update(t,e,s){this.ensureTextureAtlas(),this.texture.updateData(0,t,e,a,1,s)}_updatePageAllocator(){const t=r*this._splatAtlasTextureHeight/a;this.pageAllocator.pageCount!==t&&this.pageAllocator.resize(t)}clear(){this.texture&&(this._cache.put("splatTextureAtlas",this.texture),this.texture=null)}destroy(){this._onCachedTextureEvicted=()=>{},this._cache.destroy(),this.texture?.dispose(),this.texture=null}}export{c as GaussianSplatTextureAtlas};
@@ -127,6 +127,9 @@ export abstract class PopupView {
127
127
  * an end user's click location. This method allows a developer to
128
128
  * control how the input location is handled, and then subsequently, what to do with the results.
129
129
  *
130
+ * > [!WARNING]
131
+ * > Using [ScreenRect](https://developers.arcgis.com/javascript/latest/references/core/core/types/#ScreenRect) as the hit target is considered **[beta](https://developers.arcgis.com/javascript/latest/faq/#what-does-the-beta-tag-mean)** functionality.
132
+ *
130
133
  * @param hitTarget
131
134
  * @param options
132
135
  * @returns An async generator of features ready to be displayed by the popup,
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{createArcadeProfile as e,createArcadeExecutor as t}from"../../../../arcade.js";import r from"../../../../core/Error.js";import n from"../../../../core/Logger.js";import{getEffectiveFieldAlias as o}from"../../../../editing/fieldUtils.js";import i from"../../../../form/ExpressionInfo.js";import s from"../../../../form/elements/AttachmentElement.js";import{isMultipleChoiceInput as a}from"../../../../form/elements/inputs/inputUtils.js";import{isAttachmentElement as l,isFieldElement as m,isGroupElement as c,isRelationshipElement as d,isTextElement as p,isUtilityNetworkAssociationsElement as f}from"../../../../form/support/formUtils.js";import{getLowerCaseEditTrackingFields as u,isFieldVisibleByDefault as x}from"../../../../layers/support/fieldUtils.js";import{isNumber as y}from"../../../../support/guards.js";import{layerSupportsQueryAttachments as h,getLayerTimeZone as E}from"../../batchAttributeFormUtils.js";import{makeExpressionInfosMap as w,makeExecutorSetForFormElement as v}from"../../expressions/expressionUtils.js";import{AttachmentElementTemplate as b}from"../AttachmentElementTemplate.js";import I from"../BatchFormTemplate.js";import{FieldElementTemplate as T}from"../FieldElementTemplate.js";import{GroupElementTemplate as j}from"../GroupElementTemplate.js";import{RelationshipElementTemplate as P}from"../RelationshipElementTemplate.js";import{TextElementTemplate as g}from"../TextElementTemplate.js";import{UtilityNetworkAssociationsElementTemplate as F}from"../UtilityNetworkAssociationsElementTemplate.js";import{isGroupElementTemplate as A}from"./templateUtils.js";import{compileTextElementMarkdownToHTML as U}from"./textElementTemplateUtils.js";const C="expression/dea57012-47ca4b55a000-8df62742ed0c",L=e("form-attachment-filename-calculation"),Z=()=>n.getLogger("esri.widgets.BatchAttributeForm.templates.templateUtils");async function B(e,t,r=e.formTemplate){return await e.load(),r?.elements&&r.elements.length>0?S(r,e,t):H(e,t)}async function H(e,{arcadeExecutorProvider:t,attachmentsEnabled:r,formTimeZone:n}){const o=new Set(u(e)),i={arcadeExecutorProvider:t,formTimeZone:n,layer:e},s=[];for(const l of e.fields)z(l,e,o)&&s.push(q(l,i));const a=await Promise.all(s);return r&&await R(a,{arcadeExecutorProvider:t,expressionInfos:w(void 0),layer:e}),new I({elements:a,title:e.formTemplate?.title,preserveFieldValuesWhenHidden:!0})}function N(e,t){for(const r of e??[])if("group"!==r.type){if("field"===r.type&&!1===r.editable&&!r.editableExpression)return!0}else if(N(r.elements??[]))return!0;return!1}async function R(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:n}){if(!h(n))return;const o=await V(new s({displayFilename:!0}),{arcadeExecutorProvider:t,expressionInfos:r,layer:n});e.push(o)}async function S(e,t,r){let n=null;N(e.elements??[])&&(n=new i({title:"",name:C,expression:"false"}));const o=w(n?[...e.expressionInfos??[],n]:e.expressionInfos),s={description:e.description,elements:new Array,title:e.title,preserveFieldValuesWhenHidden:e.preserveFieldValuesWhenHidden,supportsAttachmentElements:e.supportsAttachmentElements},{elements:a}=e;if(!a)return new I(s);let l=!1;const{arcadeExecutorProvider:m,formTimeZone:c}=r;for(const i of a){const e=await W(i,{arcadeExecutorProvider:m,expressionInfos:o,layer:t,formTimeZone:c});if(e){if(s.elements.push(e),l)continue;"attachment"===e.type&&(l=!0),A(e)&&e.elements.some(e=>("attachment"===e.type&&(l=!0),l))}}return e.supportsAttachmentElements||!r.attachmentsEnabled||l||await R(s.elements,{arcadeExecutorProvider:m,expressionInfos:o,layer:t}),new I(s)}async function V(e,{arcadeExecutorProvider:r,expressionInfos:n,layer:o}){let i=null;if(e.filenameExpression)try{i=await t(e.filenameExpression,L)}catch(l){Z().error("Failed to compile attachment filename expression",l)}const s=new b({allowUserRename:e.allowUserRename,attachmentKeyword:e.attachmentKeyword,description:e.description,displayFilename:e.displayFilename,filenameExpressionExecutor:i,input:e.input,label:e.label,maxAttachmentCount:e.maxAttachmentCount,minAttachmentCount:e.minAttachmentCount,useOriginalFilename:e.useOriginalFilename}),a=await v({element:e,expressionInfos:n,provider:r});return s.addLayer(o,a),s}async function W(e,t){return l(e)?V(e,{arcadeExecutorProvider:t.arcadeExecutorProvider,expressionInfos:t.expressionInfos,layer:t.layer}):m(e)?k(e,t):c(e)?K(e,t):d(e)?O(e,t):p(e)?G(e,t):f(e)?$(e,t):null}async function k(e,{arcadeExecutorProvider:t,expressionInfos:n,layer:o,formTimeZone:i}){const{fieldsIndex:s}=o,{description:l,domain:m,fieldName:c,hint:d,input:p,label:f}=e;if(null==c||!s.has(c))return Z().warn(new r("batch-attribute-form:invalid-form-element-field",`Field element with label '${f}' does not refer to a valid field`)),null;if(!1!==e.editable||e.editableExpression||((e=e.clone()).editableExpression=C),p&&a(p)&&p.otherChoice){const e=p.otherChoice.fieldName,t=s.get(e);t&&t.name!==e&&(p.otherChoice=p.otherChoice.clone(),p.otherChoice.fieldName=t.name)}const u=new T({description:l,domain:m,field:s.get(c),hint:d,input:p,formTimeZone:i,layerTimeZone:E(o),label:f}),x=await v({element:e,expressionInfos:n,provider:t});return u.addLayer(o,x),u}async function K(e,t){const{arcadeExecutorProvider:r,expressionInfos:n,layer:o}=t,{description:i,label:s,initialState:a}=e,l=[];for(const d of e.elements){const e=await W(d,t);e&&l.push(e)}const m=new j({description:i,elements:l,label:s,initialState:a??"expanded"}),c=await v({element:e,expressionInfos:n,provider:r});return m.addLayer(o,c),m}async function O(e,t){const{description:r,label:n,displayCount:o,displayType:i,orderByFields:s,relationshipId:a}=e,{arcadeExecutorProvider:l,expressionInfos:m,layer:c}=t,d=new P({description:r,...y(o)&&{displayCount:o},displayType:i,label:n,orderByFields:s,relationshipId:a}),p=await v({element:e,expressionInfos:m,provider:l});return d.addLayer(c,p),d}async function G(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:n}){const{description:o,label:i,text:s,textFormat:a}=e,{fieldsIndex:l}=n,m=s&&"markdown"===a?await U(s):s,c=new g({compiledText:m,description:o,fieldsIndex:l,label:i}),d=await v({element:e,expressionInfos:r,provider:t}),{expressionParts:p}=c;if(p.length){const e=await Promise.all(p.map(e=>{const n=r.get(e)?.expression??e;return t.getArcadeExecutor(n)}));d.textExpressions=e}return c.addLayer(n,d),c}async function $(e,t){const{associationTypes:r,description:n,label:o}=e,{arcadeExecutorProvider:i,expressionInfos:s,layer:a}=t,l=new F({associationTypes:r,description:n,label:o}),m=await v({element:e,expressionInfos:s,provider:i});return l.addLayer(a,m),l}async function q(e,{arcadeExecutorProvider:t,layer:r,formTimeZone:n}){const i=o(e,r)||e.name,s=new T({field:e,label:i,formTimeZone:n,layerTimeZone:E(r)}),a={};return e.editable&&r.userHasUpdateItemPrivileges&&(a.editableExpression=await t.getArcadeExecutor("true")),s.addLayer(r,a),s}function z(e,t,r){return!r.has(e.name.toLowerCase())&&x(e,t)}export{B as createBatchFormTemplate,H as createBatchFormTemplateFromFields};
2
+ import{createArcadeProfile as e,createArcadeExecutor as t}from"../../../../arcade.js";import r from"../../../../core/Error.js";import o from"../../../../core/Logger.js";import{getEffectiveFieldAlias as n}from"../../../../editing/fieldUtils.js";import i from"../../../../form/ExpressionInfo.js";import s from"../../../../form/elements/AttachmentElement.js";import{isMultipleChoiceInput as a}from"../../../../form/elements/inputs/inputUtils.js";import{isAttachmentElement as l,isFieldElement as m,isGroupElement as c,isRelationshipElement as d,isTextElement as p,isUtilityNetworkAssociationsElement as f}from"../../../../form/support/formUtils.js";import{getLowerCaseEditTrackingFields as u,isFieldVisibleByDefault as x}from"../../../../layers/support/fieldUtils.js";import{isNumber as y}from"../../../../support/guards.js";import{layerSupportsQueryAttachments as h,getLayerTimeZone as E}from"../../batchAttributeFormUtils.js";import{makeExpressionInfosMap as w,makeExecutorSetForFormElement as T}from"../../expressions/expressionUtils.js";import{AttachmentElementTemplate as v}from"../AttachmentElementTemplate.js";import b from"../BatchFormTemplate.js";import{FieldElementTemplate as I}from"../FieldElementTemplate.js";import{GroupElementTemplate as j}from"../GroupElementTemplate.js";import{RelationshipElementTemplate as P}from"../RelationshipElementTemplate.js";import{TextElementTemplate as g}from"../TextElementTemplate.js";import{UtilityNetworkAssociationsElementTemplate as Z}from"../UtilityNetworkAssociationsElementTemplate.js";import{isGroupElementTemplate as F}from"./templateUtils.js";import{compileTextElementMarkdownToHTML as A}from"./textElementTemplateUtils.js";const U="expression/dea57012-47ca4b55a000-8df62742ed0c",C=e("form-attachment-filename-calculation"),L=()=>o.getLogger("esri.widgets.BatchAttributeForm.templates.templateUtils");async function B(e,t,r=e.formTemplate){return await e.load(),r?.elements&&r.elements.length>0?S(r,e,t):H(e,t)}async function H(e,{arcadeExecutorProvider:t,attachmentsEnabled:r,formTimeZone:o}){const n=new Set(u(e)),i={arcadeExecutorProvider:t,formTimeZone:o,layer:e},s=[];for(const l of e.fields)z(l,e,n)&&s.push(q(l,i));const a=await Promise.all(s);return r&&await R(a,{arcadeExecutorProvider:t,expressionInfos:w(void 0),layer:e}),new b({elements:a,title:e.formTemplate?.title,preserveFieldValuesWhenHidden:!0})}function N(e,t){for(const r of e??[])if("group"!==r.type){if("field"===r.type&&!1===r.editable&&!r.editableExpression)return!0}else if(N(r.elements??[]))return!0;return!1}async function R(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:o}){if(!h(o))return;const n=await V(new s({displayFilename:!0}),{arcadeExecutorProvider:t,expressionInfos:r,layer:o});e.push(n)}async function S(e,t,r){let o=null;N(e.elements??[])&&(o=new i({title:"",name:U,expression:"false"}));const n=w(o?[...e.expressionInfos??[],o]:e.expressionInfos),s={description:e.description,elements:new Array,title:e.title,preserveFieldValuesWhenHidden:e.preserveFieldValuesWhenHidden,supportsAttachmentElements:e.supportsAttachmentElements},{elements:a}=e;if(!a)return new b(s);let l=!1;const{arcadeExecutorProvider:m,formTimeZone:c}=r;for(const i of a){const e=await W(i,{arcadeExecutorProvider:m,expressionInfos:n,layer:t,formTimeZone:c});if(e){if(s.elements.push(e),l)continue;"attachment"===e.type&&(l=!0),F(e)&&e.elements.some(e=>("attachment"===e.type&&(l=!0),l))}}return e.supportsAttachmentElements||!r.attachmentsEnabled||l||await R(s.elements,{arcadeExecutorProvider:m,expressionInfos:n,layer:t}),new b(s)}async function V(e,{arcadeExecutorProvider:r,expressionInfos:o,layer:n}){let i=null;if(e.filenameExpression)try{i=await t(e.filenameExpression,C)}catch(l){L().error("Failed to compile attachment filename expression",l)}const s=new v({allowUserRename:e.allowUserRename,attachmentKeyword:e.attachmentKeyword,description:e.description,displayFilename:e.displayFilename,filenameExpressionExecutor:i,input:e.input,label:e.label,maxAttachmentCount:e.maxAttachmentCount,minAttachmentCount:e.minAttachmentCount,useOriginalFilename:e.useOriginalFilename}),a=await T({element:e,expressionInfos:o,provider:r});return s.addLayer(n,a),s}async function W(e,t){return l(e)?V(e,{arcadeExecutorProvider:t.arcadeExecutorProvider,expressionInfos:t.expressionInfos,layer:t.layer}):m(e)?k(e,t):c(e)?K(e,t):d(e)?O(e,t):p(e)?G(e,t):f(e)?$(e,t):null}async function k(e,{arcadeExecutorProvider:t,expressionInfos:o,layer:n,formTimeZone:i}){const{fieldsIndex:s}=n,{description:l,domain:m,fieldName:c,hint:d,input:p,label:f}=e;if(null==c||!s.has(c))return L().warn(new r("batch-attribute-form:invalid-form-element-field",`Field element with label '${f}' does not refer to a valid field`)),null;if(!1!==e.editable||e.editableExpression||((e=e.clone()).editableExpression=U),p&&a(p)&&p.otherChoice){const e=p.otherChoice.fieldName,t=s.get(e);t&&t.name!==e&&(p.otherChoice=p.otherChoice.clone(),p.otherChoice.fieldName=t.name)}const u=new I({description:l,domain:m,field:s.get(c),hint:d,input:p,formTimeZone:i,layerTimeZone:E(n),label:f}),x=await T({element:e,expressionInfos:o,provider:t});return u.addLayer(n,x),u}async function K(e,t){const{arcadeExecutorProvider:r,expressionInfos:o,layer:n}=t,{description:i,label:s,initialState:a}=e,l=[];for(const d of e.elements){const e=await W(d,t);e&&l.push(e)}const m=new j({description:i,elements:l,label:s,initialState:a??"expanded"}),c=await T({element:e,expressionInfos:o,provider:r});return m.addLayer(n,c),m}async function O(e,t){const{description:r,label:o,displayCount:n,displayType:i,orderByFields:s,relationshipId:a}=e,{arcadeExecutorProvider:l,expressionInfos:m,layer:c,formTimeZone:d}=t,p=new P({description:r,...y(n)&&{displayCount:n},displayType:i,formTimeZone:d,label:o,layerTimeZone:E(c),orderByFields:s,relationshipId:a}),f=await T({element:e,expressionInfos:m,provider:l});return p.addLayer(c,f),p}async function G(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:o,formTimeZone:n}){const{description:i,label:s,text:a,textFormat:l}=e,{fieldsIndex:m}=o,c=a&&"markdown"===l?await A(a):a,d=new g({compiledText:c,description:i,fieldsIndex:m,formTimeZone:n,label:s,layerTimeZone:E(o)}),p=await T({element:e,expressionInfos:r,provider:t}),{expressionParts:f}=d;if(f.length){const e=await Promise.all(f.map(e=>{const o=r.get(e)?.expression??e;return t.getArcadeExecutor(o)}));p.textExpressions=e}return d.addLayer(o,p),d}async function $(e,t){const{associationTypes:r,description:o,label:n}=e,{arcadeExecutorProvider:i,expressionInfos:s,formTimeZone:a,layer:l}=t,m=new Z({associationTypes:r,description:o,formTimeZone:a,label:n,layerTimeZone:E(l)}),c=await T({element:e,expressionInfos:s,provider:i});return m.addLayer(l,c),m}async function q(e,{arcadeExecutorProvider:t,layer:r,formTimeZone:o}){const i=n(e,r)||e.name,s=new I({field:e,formTimeZone:o,label:i,layerTimeZone:E(r)}),a={};return e.editable&&r.userHasUpdateItemPrivileges&&(a.editableExpression=await t.getArcadeExecutor("true")),s.addLayer(r,a),s}function z(e,t,r){return!r.has(e.name.toLowerCase())&&x(e,t)}export{B as createBatchFormTemplate,H as createBatchFormTemplateFromFields};
@@ -393,13 +393,6 @@ export type AssociationsLayerUnion = FeatureLayer | SubtypeSublayer;
393
393
  */
394
394
  export interface FooterButtonInfo {}
395
395
 
396
- /**
397
- * Configuration information needed to render a notice in the BatchAttributeForm footer.
398
- *
399
- * @internal
400
- */
401
- export interface FooterNoticeInfo {}
402
-
403
396
  /**
404
397
  * Valid types of pages that can be displayed by the Batch Attribute Form.
405
398
  *
@@ -9,7 +9,7 @@ import type UtilityNetworkAssociationsElementInput from "./BatchAttributeForm/in
9
9
  import type { Icon } from "@esri/calcite-components/components/calcite-icon";
10
10
  import type { WidgetProperties } from "./Widget.js";
11
11
  import type { BatchAttributeFormViewModelEvents, BatchAttributeFormViewModelProperties } from "./BatchAttributeForm/BatchAttributeFormViewModel.js";
12
- import type { AssociationsLayerUnion, AttributeFormSupportedLayerInfo, FooterButtonInfo, FooterNoticeInfo, Page, SelectedAttachmentDetails, SelectedAttachmentIdentifier } from "./BatchAttributeForm/types.js";
12
+ import type { AssociationsLayerUnion, AttributeFormSupportedLayerInfo, FooterButtonInfo, Page, SelectedAttachmentDetails, SelectedAttachmentIdentifier } from "./BatchAttributeForm/types.js";
13
13
  import type { HeadingLevel } from "./support/types.js";
14
14
  import type { VisibleElementsProperties } from "./BatchAttributeForm/VisibleElements.js";
15
15
 
@@ -105,6 +105,12 @@ export default class BatchAttributeForm extends Widget<BatchAttributeFormPropert
105
105
  * @default false
106
106
  */
107
107
  accessor disabled: boolean;
108
+ /**
109
+ * Indicates the component is in a disabled or readOnly state, disregarding updating
110
+ *
111
+ * @internal
112
+ */
113
+ get disabledOrReadOnly(): boolean;
108
114
  /**
109
115
  * Indicates the component is currently in a disabled state, accounting for when the
110
116
  * viewModel is in the process of updating.
@@ -140,14 +146,6 @@ export default class BatchAttributeForm extends Widget<BatchAttributeFormPropert
140
146
  * @internal
141
147
  */
142
148
  get footerButtonInfos(): FooterButtonInfo[];
143
- /**
144
- * Configuration information about notices displayed in the footer. Only a single notice can be displayed at a time.
145
- * If more than one notice is generated, only the latest notice in this array will be displayed.
146
- * This can be used to replicate notice behavior in an external panel (e.g. Editor).
147
- *
148
- * @internal
149
- */
150
- get footerNoticeInfos(): FooterNoticeInfo[];
151
149
  /**
152
150
  * Defines how groups will be displayed to the user.
153
151
  *