@arcgis/core 4.34.0-next.115 → 4.34.0-next.116

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 (53) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/7010d1eb303a13c72f81.js +1 -0
  3. package/assets/esri/core/workers/chunks/{9bbf1ee424d480b62d48.js → 7748356f4d848254fc66.js} +1 -1
  4. package/assets/esri/core/workers/chunks/9786e854ae9f40975cee.js +1 -0
  5. package/assets/esri/core/workers/chunks/be1b8e5ff2b1be26845a.js +1 -0
  6. package/assets/esri/core/workers/chunks/ecd6f163c1bb039d9736.js +1 -0
  7. package/config.js +1 -1
  8. package/graphic/graphicOriginUtils.js +1 -1
  9. package/interfaces.d.ts +66 -26
  10. package/kernel.js +1 -1
  11. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  12. package/layers/video/VideoController.js +1 -1
  13. package/package.json +1 -1
  14. package/portal/Portal.js +1 -1
  15. package/support/revision.js +1 -1
  16. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  17. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedPolyShader.js +1 -1
  18. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
  19. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
  20. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
  21. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  22. package/views/2d/layers/features/Processor.js +1 -1
  23. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  24. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  25. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  26. package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
  27. package/views/3d/analysis/ElevationProfile/ElevationProfileGeometryVisualization3D.js +1 -1
  28. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  29. package/views/3d/layers/FlowSubView3D.js +1 -1
  30. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  31. package/views/3d/layers/TiledLayerView3D.js +1 -1
  32. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  33. package/views/3d/support/DisplayQualityProfile.js +1 -1
  34. package/views/3d/support/QualitySettings.js +1 -1
  35. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  36. package/views/3d/support/flow/StreamlineResources3D.js +1 -1
  37. package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
  38. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  39. package/views/3d/support/flow/constants.js +1 -1
  40. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  41. package/views/analysis/ElevationProfile/types.d.ts +5 -0
  42. package/views/analysis/ElevationProfile/types.js +5 -0
  43. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  44. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  45. package/widgets/FeatureTable/FieldColumn.js +1 -1
  46. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  47. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  48. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  49. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  50. package/assets/esri/core/workers/chunks/57aaebcd2022659f9c19.js +0 -1
  51. package/assets/esri/core/workers/chunks/630efe10c871425b6a95.js +0 -1
  52. package/assets/esri/core/workers/chunks/78b35a19332e58c8c279.js +0 -1
  53. package/assets/esri/core/workers/chunks/e7c9d9e1205a8e246bfa.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as i,abortMaybe as r}from"../../../core/maybe.js";import{debounce as s,ignoreAbortErrors as o,throwIfAborted as a}from"../../../core/promiseUtils.js";import{watch as l,when as n,sync as u,whenOnce as d}from"../../../core/reactiveUtils.js";import{addFrameTask as p}from"../../../core/scheduling.js";import{Seconds as h,secondsFromMilliseconds as c}from"../../../core/time.js";import{getMetersPerVerticalUnitForSR as m}from"../../../core/unitUtils.js";import{property as g}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as f}from"../../../geometry/ellipsoidUtils.js";import{projectOrLoad as y}from"../../../geometry/projectionUtils.js";import{fromExtent as v,intersection as w,toExtent as T,intersects as S}from"../../../geometry/support/aaBoundingRect.js";import{getInfo as b}from"../../../geometry/support/spatialReferenceUtils.js";import R from"../../../symbols/support/ElevationInfo.js";import{simulationSettingsEqual as j,getPositions as A,getFlowSimulationSettings as L}from"../../2d/engine/flow/utils.js";import U from"./SubView3D.js";import{makeScheduleFunction as x}from"./support/makeScheduleFunction.js";import{thresholdForLoadingAllTiles as P,fadeOutTime as E,fadeInTime as I,defaultTransitionDuration as M,transitionDurationFactor as q,seamlessTransitionEnabled as F,averageLoadingTimeSmoothingFactor as V}from"../support/flow/constants.js";import{isFullExtent as k,FlowQuery3D as B,wrappedWidth as C}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as W}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as z,createStreamlineGeometry as G}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as H}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as D}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as O}from"../support/flow/StreamlineResources3DShape.js";import{tilesAreRelated as N}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as Q}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as J}from"../webgl-engine/materials/RibbonLineMaterial.js";import{isInEffectiveScaleRange as K,hasLayerBasedScaleVisibility as X}from"../../support/layerViewUtils.js";import{TaskPriority as Y}from"../../support/Scheduler.js";let Z=class extends U{constructor(e){super(e),this.type="flow",this.renderedTiles=null,this.requireLoad=!1,this.workerHandle=null,this.frameTask=null,this._averageLoadingTime=h(0),this._abortController=null,this._loadingState="ready-to-load",this._tilesUpdateIsWaiting=!1,this._debugAllowAutoLoading=!0,this.emissiveStrength=0,this._overrideMaterialParameters=null,this._overrideSimulationSettings=null,this._overrideTransitionEnabled=null,this._updateTask=null,this._debouncedTileUpdate=s(async()=>{const{allTiles:e}=this.surface,t=this._getTileFilterFunction(),i=new Set;function*r(r){for(let s=0;s<e.length;++s){const o=e.at(s);t(o)&&i.add(o),r.madeProgress(),r.done&&(r=yield)}}await this.frameTask.scheduleGenerator(r),this.renderedTiles=i})}initialize(){const{surface:e,view:t}=this,{resourceController:i}=t;this.workerHandle=new W(x(i)),this.frameTask=i.scheduler.registerTask(Y.FLOW_GENERATOR),this._updateTask=p({update:e=>this._update(e)}),this.addHandles([l(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>null==e&&null==t||null!=e&&null!=t&&j(e,t)}),l(()=>{const{elevationInfo:e}=this;return[this._clippingArea,this._visible,this._draped,this.view.state.contentPixelRatio,this.view.viewingMode,e?.mode,e?.offset,e?.unit]},()=>this.triggerLoad(),u),l(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),e.on("tiles-changed",()=>{this.loadByTileTreesAllowed&&this._triggerTilesUpdate()}),t.enableFeatureTiles(),l(()=>[this._dataBounds,this._featureTilesBounds,this.loadAllTiles],()=>this._triggerTilesUpdate()),l(()=>this._flowRenderer,(e,t)=>{const i=t?.visualVariables??[],r=e?.visualVariables??[];r.length===i.length&&r.every((e,t)=>e.type===i[t].type)||this.clear()}),n(()=>!t.featureTiles?.updating,()=>{this.loadByTileTreesAllowed&&this._triggerTilesUpdate()})]),this._triggerTilesUpdate()}destroy(){this._updateTask=i(this._updateTask),this.abort(),this.clear()}abort(){this._abortController=r(this._abortController),this.requireLoad=!1}get _clippingArea(){const e=y(this.view.clippingArea,this.surface.spatialReference).geometry;return null==e?null:v(e)}get _dataBounds(){const e=y(this.layer.fullExtent,this.surface.spatialReference).geometry;return null==e?null:v(e)}get _draped(){return"on-the-ground"===this.elevationInfo.mode}get _ellipsoidRadius(){return f(this.view.spatialReference).radius}get loadAllTiles(){const{position:e}=this.view.camera,t=e.z;if(null==t)return!1;return t*m(e.spatialReference)/this._ellipsoidRadius>=P}get loadByTileTreesAllowed(){return!this.loadAllTiles||!this.loadRequirementsMet}get _featureTilesBounds(){const e=this.view.featureTiles?.filterExtent,t=y(e,this.surface.spatialReference).geometry;return null==t?null:v(t)}get _flowRenderer(){const e=this.layer.renderer;return"flow"!==e?.type?null:e}get _materialParameters(){return{...z(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),fadeInTime:I,fadeOutTime:E,...this._overrideMaterialParameters,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&Q(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _seamlessTransitionWaitingTime(){const{_averageLoadingTime:e}=this;return h(0===e?M:this._averageLoadingTime*q)}get _seamlessTransitionEnabled(){return null!=this._overrideTransitionEnabled?this._overrideTransitionEnabled:F}get _visible(){const e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(null==e||e.a>0)}get elevationInfo(){return this.layer.elevationInfo??$}startPositions(e){if(!this._seamlessTransitionEnabled)return[];const{_flowRenderer:t,_resources:i}=this;return null==t||null==i?[]:A(i.streamlines,i.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return b(this.surface.spatialReference)}get layer(){return this.layerView.layer}get loadingState(){return this._loadingState}get loadRequirementsMet(){return null!=this.renderedTiles&&this.renderedTiles.size>0}getUpdating(){return this.updatingHandles.updating||this.requireLoad||"before-transition"===this._loadingState}get updating(){return this.getUpdating()}get visibleAtCurrentScale(){return!X()||K(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){const{_flowRenderer:e,_overrideSimulationSettings:t}=this;if(null==e)return null;let i=L(e);return i.segmentLength=i.lineCollisionWidth/2,i.onlyForwardTracing=!1,null!=t&&(i={...i,...t}),i}getSimulationSettings(e){const{_simulationSettings:t,spatialReferenceInfo:i}=this;if(null==t)return null;const r="global"===this.view.viewingMode&&null!=i&&k(e.extent.xmin,e.extent.xmax,i);return{...t,wrapAround:r}}get surface(){return this.view.basemapTerrain}doRefresh(){this.triggerLoad()}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null,this._loadingState="ready-to-load"}_update(e){const t=c(e.time);this._lastResources?.hasFadedOut(t)&&this._lastResources.detach();const i=this._nextStateForTransition(t);if(!this.requireLoad||this.updatingHandles.updating||"ready-to-load"!==i||!this.loadRequirementsMet)return void(this._loadingState=i);this._loadingState="loading";const r=async()=>{const e=performance.now(),i=this._seamlessTransitionEnabled&&null!=this._resources?h(t+this._seamlessTransitionWaitingTime):t;await this._load(this.renderedTiles,i);const r=h((performance.now()-e)/1e3);this._updateAverageLoadingTime(r)};this.updatingHandles.addPromise(o(r())),this.requireLoad=!1}_updateAverageLoadingTime(e){const t=V;this._averageLoadingTime=h(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){this._debugAllowAutoLoading&&(this.requireLoad=!0)}async _load(e,t){if(!this._visible)return this.clear(),void(this._loadingState="ready-to-load");const i=this._computeExtent(e);if(0===e.size||null==i)return void(this._loadingState="ready-to-load");const r=new B(i,this.layerView.timeExtent,this._viewSizeWithEqualRatio(i),this.view.state.contentPixelRatio,t);null==this._abortController&&(this._abortController=new AbortController);const s=this._abortController,o=await this._loadStreamlines(r,s.signal);if(a(s.signal),this._visible&&null!=o){this._lastResources?.detach(),this._lastResources=this._resources,this._resources=o;const e=performance.now()/1e3,i=e>t?e:t;null!=this._lastResources&&(this._lastResources.endTime=i),this._resources.startTime=i,await o.attach(),this._loadingState=this._seamlessTransitionEnabled?"before-transition":"transitioning"}else this._loadingState="ready-to-load"}async _loadStreamlines(e,t){const i=await this.fetchDataAndGenerateStreamlines(e,t);if(null==i)return null;const{geometries:r,material:s}=await this._createGeometry(e,i);return this._draped?new D(e,i,s,r,this.layerView):new O(e,i,s,r,this.view)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t){const i=new J(this._materialParameters,this.view.state.isGlobal),r=new Array,{elevationInfo:s,_draped:o,view:a}=this;function*l(l){for(let n=0;n<t.length;++n)r.push(G(a,e,t[n],s,i,o)),l.madeProgress(),l.done&&(l=yield)}return await this.frameTask.scheduleGenerator(l),{geometries:r,material:i}}_computeExtent(e){const{spatialReference:t}=this.surface;if(null==t)return null;const i=H(e,this.spatialReferenceInfo);return null==i?null:(w(i,this._clippingArea,i),T(i,t))}_triggerTilesUpdate(){if(this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;const e=async()=>{await d(()=>this.view.stationary),this._tilesUpdateIsWaiting=!1,await this._debouncedTileUpdate()};this.updatingHandles.addPromise(o(e()))}_getTileFilterFunction(){const{_dataBounds:e,view:i,_featureTilesBounds:r}=this;if(this.loadAllTiles)return t=>t.leaf&&ee(e,t.extent);const s=t=>t.rendered&&t.visible&&ee(e,t.extent),{featureTiles:o}=i;if(!o)return s;const a=o.tiles.filter(e=>e.measures.visible);return e=>s(e)&&ee(r,e.extent)&&a.some(({lij:i})=>t(i,e.lij)||N(i,e.lij))}_viewSizeWithEqualRatio(e){const t=C(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[i,r]=this.view.size;return i<r?[i,Math.floor(i/t)]:[Math.floor(r*t),r]}_nextStateForTransition(e){const{_resources:t}=this;if(null==this._flowRenderer||null==t||"ready-to-load"===this._loadingState||"loading"===this._loadingState)return this._loadingState;const i=t.startTime;return e<i?"before-transition":e<i+E?"transitioning":"ready-to-load"}get test(){}};e([g()],Z.prototype,"type",void 0),e([g()],Z.prototype,"renderedTiles",void 0),e([g()],Z.prototype,"_resources",void 0),e([g()],Z.prototype,"_lastResources",void 0),e([g()],Z.prototype,"requireLoad",void 0),e([g()],Z.prototype,"_averageLoadingTime",void 0),e([g()],Z.prototype,"_loadingState",void 0),e([g()],Z.prototype,"emissiveStrength",void 0),e([g()],Z.prototype,"_clippingArea",null),e([g()],Z.prototype,"_dataBounds",null),e([g()],Z.prototype,"_draped",null),e([g()],Z.prototype,"_ellipsoidRadius",null),e([g()],Z.prototype,"loadAllTiles",null),e([g()],Z.prototype,"_featureTilesBounds",null),e([g()],Z.prototype,"_flowRenderer",null),e([g()],Z.prototype,"_materialParameters",null),e([g()],Z.prototype,"_opacity",null),e([g()],Z.prototype,"_seamlessTransitionWaitingTime",null),e([g()],Z.prototype,"_seamlessTransitionEnabled",null),e([g()],Z.prototype,"_visible",null),e([g()],Z.prototype,"elevationInfo",null),e([g()],Z.prototype,"needsMagnitude",null),e([g()],Z.prototype,"spatialReferenceInfo",null),e([g()],Z.prototype,"layer",null),e([g()],Z.prototype,"loadingState",null),e([g()],Z.prototype,"updating",null),e([g()],Z.prototype,"visibleAtCurrentScale",null),e([g()],Z.prototype,"_overrideMaterialParameters",void 0),e([g()],Z.prototype,"_overrideSimulationSettings",void 0),e([g()],Z.prototype,"_overrideTransitionEnabled",void 0),e([g()],Z.prototype,"_simulationSettings",null),e([g()],Z.prototype,"surface",null),Z=e([_("esri.views.3d.layers.FlowSubView3D")],Z);const $=new R({mode:"on-the-ground"});function ee(e,t){return null==e||null==t||S(e,t)}export{Z as default};
5
+ import{__decorate as e}from"tslib";import{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as i,abortMaybe as r}from"../../../core/maybe.js";import{debounce as s,ignoreAbortErrors as o,throwIfAborted as n}from"../../../core/promiseUtils.js";import{watch as l,when as a,sync as u,whenOnce as d}from"../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../core/scheduling.js";import{Seconds as p,secondsFromMilliseconds as c}from"../../../core/time.js";import{getMetersPerVerticalUnitForSR as m}from"../../../core/unitUtils.js";import{property as g}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as f}from"../../../geometry/ellipsoidUtils.js";import{projectOrLoad as y}from"../../../geometry/projectionUtils.js";import{fromExtent as v,intersection as w,toExtent as T,area as S,intersects as b}from"../../../geometry/support/aaBoundingRect.js";import{getInfo as R}from"../../../geometry/support/spatialReferenceUtils.js";import j from"../../../symbols/support/ElevationInfo.js";import{simulationSettingsEqual as x,getPositions as A,getFlowSimulationSettings as L}from"../../2d/engine/flow/utils.js";import U from"./SubView3D.js";import{makeScheduleFunction as M}from"./support/makeScheduleFunction.js";import{thresholdForLoadingAllTiles as P,fadeOutTime as E,fadeInTime as I,defaultTransitionDuration as q,transitionDurationFactor as F,seamlessTransitionEnabled as V,averageLoadingTimeSmoothingFactor as k,minimumTracingResolution as C}from"../support/flow/constants.js";import{wrappedWidth as D,isFullExtent as B,FlowQuery3D as W}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as z}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as G,createStreamlineGeometry as H}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as O}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as N}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as Q}from"../support/flow/StreamlineResources3DShape.js";import{tilesAreRelated as J}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as K}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as X}from"../webgl-engine/materials/RibbonLineMaterial.js";import{isInEffectiveScaleRange as Y,hasLayerBasedScaleVisibility as Z}from"../../support/layerViewUtils.js";import{TaskPriority as $}from"../../support/Scheduler.js";let ee=class extends U{constructor(e){super(e),this.type="flow",this.renderedTiles=null,this.requireLoad=!1,this.workerHandle=null,this.frameTask=null,this._averageLoadingTime=p(0),this._abortController=null,this._loadingState="ready-to-load",this._tilesUpdateIsWaiting=!1,this._debugAllowAutoLoading=!0,this.emissiveStrength=0,this._overrideMaterialParameters=null,this._overrideSimulationSettings=null,this._overrideTransitionEnabled=null,this._updateTask=null,this._debouncedTileUpdate=s(async()=>{const{allTiles:e}=this.surface,t=this._getTileFilterFunction(),i=new Set;function*r(r){for(let s=0;s<e.length;++s){const o=e.at(s);t(o)&&i.add(o),r.madeProgress(),r.done&&(r=yield)}}await this.frameTask.scheduleGenerator(r),this.renderedTiles=i})}initialize(){const{surface:e,view:t}=this,{resourceController:i}=t;this.workerHandle=new z(M(i)),this.frameTask=i.scheduler.registerTask($.FLOW_GENERATOR),this._updateTask=h({update:e=>this._update(e)}),this.addHandles([l(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>null==e&&null==t||null!=e&&null!=t&&x(e,t)}),l(()=>{const{elevationInfo:e}=this;return[this._clippingArea,this._visible,this._draped,this.view.state.contentPixelRatio,this.view.viewingMode,e?.mode,e?.offset,e?.unit,this._effectiveDensity]},()=>this.triggerLoad(),u),l(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),e.on("tiles-changed",()=>{this.loadByTileTreesAllowed&&this._triggerTilesUpdate()}),t.enableFeatureTiles(),l(()=>[this._dataBounds,this._featureTilesBounds,this.loadAllTiles],()=>this._triggerTilesUpdate()),l(()=>this._flowRenderer,(e,t)=>{const i=t?.visualVariables??[],r=e?.visualVariables??[];r.length===i.length&&r.every((e,t)=>e.type===i[t].type)||this.clear()}),a(()=>!t.featureTiles?.updating,()=>{this.loadByTileTreesAllowed&&this._triggerTilesUpdate()})]),this._triggerTilesUpdate()}destroy(){this._updateTask=i(this._updateTask),this.abort(),this.clear()}abort(){this._abortController=r(this._abortController),this.requireLoad=!1}get _clippingArea(){const e=y(this.view.clippingArea,this.surface.spatialReference).geometry;return null==e?null:v(e)}get _dataBounds(){const e=y(this.layer.fullExtent,this.surface.spatialReference).geometry;return null==e?null:v(e)}get _draped(){return"on-the-ground"===this.elevationInfo.mode}get _ellipsoidRadius(){return f(this.view.spatialReference).radius}get extent(){const{spatialReference:e}=this.surface,{renderedTiles:t}=this;if(null==e||null==t)return null;const i=O(t,this.spatialReferenceInfo);return null==i?null:(w(i,this._clippingArea,i),T(i,e))}get loadAllTiles(){const{position:e}=this.view.camera,t=e.z;if(null==t)return!1;return t*m(e.spatialReference)/this._ellipsoidRadius>=P}get loadByTileTreesAllowed(){return!this.loadAllTiles||!this.loadRequirementsMet}get _featureTilesBounds(){const e=this.view.featureTiles?.filterExtent,t=y(e,this.surface.spatialReference).geometry;return null==t?null:v(t)}get _flowRenderer(){const e=this.layer.renderer;return"flow"!==e?.type?null:e}get _materialParameters(){return{...G(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),fadeInTime:I,fadeOutTime:E,...this._overrideMaterialParameters,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&K(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _seamlessTransitionWaitingTime(){const{_averageLoadingTime:e}=this;return p(0===e?q:this._averageLoadingTime*F)}get _seamlessTransitionEnabled(){return null!=this._overrideTransitionEnabled?this._overrideTransitionEnabled:V}get _tracingResolution(){const{extent:e}=this;if(!e)return[0,0];const t=D(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[i,r]=this.view.size;let s,o;i<r?(s=i,o=i/t):(s=r*t,o=r);const n=C,l=this.view.qualitySettings.flow3D.maxTracingResolution,a=Math.max(1,n/Math.min(s,o)),u=a*Math.min(1,l/Math.max(s*a,o*a));return[Math.round(s*u),Math.round(o*u)]}get _visible(){const e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(null==e||e.a>0)}get _estimatedStreamlines(){const{extent:e,_simulationSettings:t,renderedTiles:i}=this;if(null==t||null==i)return 0;const r=this._tracingResolution[0]*this._tracingResolution[1]/t.lineSpacing**2*t.density;let s=0;for(const a of i)s+=S(a.extent);const o=null==e?null:v(e),n=S(o),l=0===n?0:s/n;return 2*Math.round(r*l)}get _effectiveDensity(){const{_estimatedStreamlines:e,_simulationSettings:t}=this,{qualitySettings:i,quality:r}=this.view;if(null==t)return 0;const s=i.flow3D.maxTotalNumberOfStreamlines,o=e>=s?s/e:1,n=t.density*o*r;return t.lineSpacing/Math.sqrt(n)<t.lineCollisionWidth?4*t.lineSpacing:n}get elevationInfo(){return this.layer.elevationInfo??te}startPositions(e){if(!this._seamlessTransitionEnabled)return[];const{_flowRenderer:t,_resources:i}=this;return null==t||null==i?[]:A(i.streamlines,i.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return R(this.surface.spatialReference)}get layer(){return this.layerView.layer}get loadingState(){return this._loadingState}get loadRequirementsMet(){return null!=this.renderedTiles&&this.renderedTiles.size>0}getUpdating(){return this.updatingHandles.updating||this.requireLoad||"before-transition"===this._loadingState}get updating(){return this.getUpdating()}get visibleAtCurrentScale(){return!Z()||Y(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){const{_flowRenderer:e,_overrideSimulationSettings:t}=this;if(null==e)return null;let i=L(e);return i.segmentLength=i.lineCollisionWidth/2,i.onlyForwardTracing=!1,null!=t&&(i={...i,...t}),i}getSimulationSettings(e){const{_simulationSettings:t,spatialReferenceInfo:i}=this;if(null==t)return null;const r="global"===this.view.viewingMode&&null!=i&&B(e.extent.xmin,e.extent.xmax,i);return{...t,wrapAround:r,density:this._effectiveDensity}}get surface(){return this.view.basemapTerrain}doRefresh(){this.triggerLoad()}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null,this._loadingState="ready-to-load"}_update(e){const t=c(e.time);this._lastResources?.hasFadedOut(t)&&this._lastResources.detach();const i=this._nextStateForTransition(t);if(!this.requireLoad||this.updatingHandles.updating||"ready-to-load"!==i||!this.loadRequirementsMet)return void(this._loadingState=i);this._loadingState="loading";const r=async()=>{const e=performance.now(),i=this._seamlessTransitionEnabled&&null!=this._resources?p(t+this._seamlessTransitionWaitingTime):t;await this._load(i);const r=p((performance.now()-e)/1e3);this._updateAverageLoadingTime(r)};this.updatingHandles.addPromise(o(r())),this.requireLoad=!1}_updateAverageLoadingTime(e){const t=k;this._averageLoadingTime=p(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){this._debugAllowAutoLoading&&(this.requireLoad=!0)}async _load(e){const{extent:t,view:i}=this;if(!this._visible)return this.clear(),void(this._loadingState="ready-to-load");if(null==t)return void(this._loadingState="ready-to-load");const r=new W(t,this.layerView.timeExtent,this._tracingResolution,i.state.contentPixelRatio,e);null==this._abortController&&(this._abortController=new AbortController);const s=this._abortController,o=await this._loadStreamlines(r,s.signal);if(n(s.signal),this._visible&&null!=o){this._lastResources?.detach(),this._lastResources=this._resources,this._resources=o;const t=performance.now()/1e3,i=t>e?t:e;null!=this._lastResources&&(this._lastResources.endTime=i),this._resources.startTime=i,await o.attach(),this._loadingState=this._seamlessTransitionEnabled?"before-transition":"transitioning"}else this._loadingState="ready-to-load"}async _loadStreamlines(e,t){const i=await this.fetchDataAndGenerateStreamlines(e,t);if(null==i)return null;const{geometries:r,material:s}=await this._createGeometry(e,i);return this._draped?new N(e,i,s,r,this.layerView):new Q(e,i,s,r,this.view)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t){const i=new X(this._materialParameters,this.view.state.isGlobal),r=new Array,{elevationInfo:s,_draped:o,view:n}=this;function*l(l){for(let a=0;a<t.length;++a)r.push(H(n,e,t[a],s,i,o)),l.madeProgress(),l.done&&(l=yield)}return await this.frameTask.scheduleGenerator(l),{geometries:r,material:i}}_triggerTilesUpdate(){if(this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;const e=async()=>{await d(()=>this.view.stationary),this._tilesUpdateIsWaiting=!1,await this._debouncedTileUpdate()};this.updatingHandles.addPromise(o(e()))}_getTileFilterFunction(){const{_dataBounds:e,view:i,_featureTilesBounds:r}=this;if(this.loadAllTiles)return t=>t.leaf&&ie(e,t.extent);const s=t=>t.rendered&&t.visible&&ie(e,t.extent),{featureTiles:o}=i;if(!o)return s;const n=o.tiles.filter(e=>e.measures.visible);return e=>s(e)&&ie(r,e.extent)&&n.some(({lij:i})=>t(i,e.lij)||J(i,e.lij))}_nextStateForTransition(e){const{_resources:t}=this;if(null==this._flowRenderer||null==t||"ready-to-load"===this._loadingState||"loading"===this._loadingState)return this._loadingState;const i=t.startTime;return e<i?"before-transition":e<i+E?"transitioning":"ready-to-load"}get usedMemory(){return(this._lastResources?.usedMemory??0)+(this._resources?.usedMemory??0)}get test(){}};e([g()],ee.prototype,"type",void 0),e([g()],ee.prototype,"renderedTiles",void 0),e([g()],ee.prototype,"_resources",void 0),e([g()],ee.prototype,"_lastResources",void 0),e([g()],ee.prototype,"requireLoad",void 0),e([g()],ee.prototype,"_averageLoadingTime",void 0),e([g()],ee.prototype,"_loadingState",void 0),e([g()],ee.prototype,"emissiveStrength",void 0),e([g()],ee.prototype,"_clippingArea",null),e([g()],ee.prototype,"_dataBounds",null),e([g()],ee.prototype,"_draped",null),e([g()],ee.prototype,"_ellipsoidRadius",null),e([g()],ee.prototype,"extent",null),e([g()],ee.prototype,"loadAllTiles",null),e([g()],ee.prototype,"_featureTilesBounds",null),e([g()],ee.prototype,"_flowRenderer",null),e([g()],ee.prototype,"_materialParameters",null),e([g()],ee.prototype,"_opacity",null),e([g()],ee.prototype,"_seamlessTransitionWaitingTime",null),e([g()],ee.prototype,"_seamlessTransitionEnabled",null),e([g()],ee.prototype,"_tracingResolution",null),e([g()],ee.prototype,"_visible",null),e([g()],ee.prototype,"_estimatedStreamlines",null),e([g()],ee.prototype,"_effectiveDensity",null),e([g()],ee.prototype,"elevationInfo",null),e([g()],ee.prototype,"needsMagnitude",null),e([g()],ee.prototype,"spatialReferenceInfo",null),e([g()],ee.prototype,"layer",null),e([g()],ee.prototype,"loadingState",null),e([g()],ee.prototype,"updating",null),e([g()],ee.prototype,"visibleAtCurrentScale",null),e([g()],ee.prototype,"_overrideMaterialParameters",void 0),e([g()],ee.prototype,"_overrideSimulationSettings",void 0),e([g()],ee.prototype,"_overrideTransitionEnabled",void 0),e([g()],ee.prototype,"_simulationSettings",null),e([g()],ee.prototype,"surface",null),ee=e([_("esri.views.3d.layers.FlowSubView3D")],ee);const te=new j({mode:"on-the-ground"});function ie(e,t){return null==e||null==t||b(e,t)}export{ee as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import{whenOnce as r,watch as i,sync as s,initial as a}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{projectDatasetExtent as o}from"../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{LayerView3D as m}from"./LayerView3D.js";import{TiledLayerView3D as h}from"./TiledLayerView3D.js";import p from"../support/flow/FlowSubViewTiles3D.js";import{RasterTile as d}from"../terrain/RasterTile.js";import c from"../../layers/ImageryTileLayerView.js";import u from"../../layers/LayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as f}from"../../support/drapedUtils.js";import{getWebGLCapabilities as g}from"../../webgl/capabilities.js";let b=class extends(c(y(h(m(u))))){constructor(){super(...arguments),this.type="imagery-tile-3d",this._isAlignedMapTile=!0,this._flowSubView=null}initialize(){this.layer.increaseRasterJobHandlerUsage(),null==this.fullExtent&&this.addResolvingPromise(Promise.reject(new t("layerview:spatial-reference-incompatible","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})));const e=r(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{const e=this.view.basemapTerrain.tilingScheme,t=this.layer.tileInfo;this._isAlignedMapTile=["png","png24","png32","jpg","mixed"].includes(t.format)&&e.compatibleWith(t),this.tileInfo=this._isAlignedMapTile?t:e.toTileInfo(),this.addHandles(i(()=>[this.layer.renderer,this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction,this.timeExtent],()=>this._updatingHandles.addPromise(this.doRefresh()),s))});this.addResolvingPromise(e),this.addHandles(i(()=>this.layer.renderer,e=>this._setSubView(e),a))}destroy(){this.layer.decreaseRasterJobHandlerUsage(),this._flowSubView?.destroy()}_setSubView(e){if("wcs"===this.layer.type)return;const t="flow"===e?.type,r=this._flowSubView;t&&null!=r||(r?.destroy(),this._flowSubView=t?new p({layerView:this}):null)}get _blankTile(){const e=document.createElement("canvas"),t=e.getContext("2d"),[r,i]=this.tileInfo.size;return e.width=r,e.height=i,t.clearRect(0,0,r,i),t.getImageData(0,0,r,i)}get _hasFlow(){return null!=this._flowSubView}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get dataLevelRange(){const e=this.layer.tileInfo,t=this.tileInfo.lodAt(0)?.scale,r=e.lodAt(e.lods.length-1)?.scale;return this.levelRangeFromScaleRange(t,r)}get fetchLevelRange(){if(this._hasFlow){const{minScale:e,maxScale:t}=this.layer.effectiveScaleRange;return this.levelRangeFromScaleRange(e,t)}return this.dataLevelRange}get visibleAtCurrentScale(){return this._flowSubView?.visibleAtCurrentScale??super.visibleAtCurrentScale}_getFullExtent(){return o(this.layer.serviceRasterInfo,this.view.basemapTerrain?.spatialReference??this.view.spatialReference)}async fetchTile(e,t){const r=this.tileInfo,i=this._canSymbolizeInWebGL(),s={tileInfo:r,requestRawData:i,signal:t.signal,timeExtent:this.timeExtent,requestAsImageElement:this._isAlignedMapTile,requestProjectedLocalDirections:this._hasFlow,noClip:!1},{layer:a}=this,[l,n,o]=e,m=await a.fetchTile(l,n,o,s);if(m instanceof HTMLImageElement)return m;let h=m?.pixelBlock;if(null==h)return this._blankTile;if(!i&&!this._hasFlow&&(h=await a.applyRenderer(m),null==h))return this._blankTile;const p=new d([l,n,o],h,r.size[0],r.size[1]);return i?(p.symbolizerRenderer=a.symbolizer.rendererJSON,p.symbolizerParameters=a.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(l)),p.transformGrid=m.transformGrid,p.bandIds=a.bandIds):(p.isRendereredSource=!0,p.bandIds=null),p.interpolation=a.interpolation,p}_getSymbolizerOptions(e){const t=this.tileInfo.lodAt(e).resolution;return{pixelBlock:null,isGCS:null!=this.view.basemapTerrain?.spatialReference?this.view.basemapTerrain.spatialReference.isGeographic:this.view.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:this.layer.bandIds}}ensureSymbolizerParameters(e){this._canSymbolizeInWebGL()&&JSON.stringify(e.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(e.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e.lij[0])))}createFetchPopupFeaturesQueryGeometry(e,t){return f(e,t,this.view)}async doRefresh(){this.suspended||(this._flowSubView?.doRefresh(),this.emit("data-changed"))}isUpdating(){return this._flowSubView?.updating??!1}_canSymbolizeInWebGL(){const e=g(),{symbolizer:t}=this.layer,r=t.lookup.colormapLut?.indexedColormap,i=!!this.layer.rasterFunction?.hasClipFunction,s=r&&r.length>4*(e.maxTextureSize||4096);return t.canRenderInWebGL&&!s&&!i}get test(){}};e([l({readOnly:!0})],b.prototype,"_blankTile",null),e([l()],b.prototype,"_hasFlow",null),e([l({readOnly:!0})],b.prototype,"imageFormatIsOpaque",null),e([l({readOnly:!0})],b.prototype,"hasMixedImageFormats",null),e([l()],b.prototype,"_flowSubView",void 0),e([l({readOnly:!0})],b.prototype,"dataLevelRange",null),e([l({readOnly:!0})],b.prototype,"fetchLevelRange",null),e([l({readOnly:!0})],b.prototype,"visibleAtCurrentScale",null),b=e([n("esri.views.3d.layers.ImageryTileLayerView3D")],b);const w=b;export{w as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import{whenOnce as r,watch as i,sync as s,initial as a}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{projectDatasetExtent as n}from"../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{LayerView3D as m}from"./LayerView3D.js";import{TiledLayerView3D as h}from"./TiledLayerView3D.js";import p from"../support/flow/FlowSubViewTiles3D.js";import{RasterTile as d}from"../terrain/RasterTile.js";import c from"../../layers/ImageryTileLayerView.js";import u from"../../layers/LayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as f}from"../../support/drapedUtils.js";import{getWebGLCapabilities as g}from"../../webgl/capabilities.js";let b=class extends(c(y(h(m(u))))){constructor(){super(...arguments),this.type="imagery-tile-3d",this._isAlignedMapTile=!0,this._flowSubView=null,this.ignoresMemoryFactor=!1,this.unloadedMemory=0}initialize(){this.layer.increaseRasterJobHandlerUsage(),null==this.fullExtent&&this.addResolvingPromise(Promise.reject(new t("layerview:spatial-reference-incompatible","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})));const e=r(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{const e=this.view.basemapTerrain.tilingScheme,t=this.layer.tileInfo;this._isAlignedMapTile=["png","png24","png32","jpg","mixed"].includes(t.format)&&e.compatibleWith(t),this.tileInfo=this._isAlignedMapTile?t:e.toTileInfo(),this.addHandles(i(()=>[this.layer.renderer,this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction,this.timeExtent],()=>this._updatingHandles.addPromise(this.doRefresh()),s))});this.addResolvingPromise(e),this.addHandles(i(()=>this.layer.renderer,e=>this._setSubView(e),a))}destroy(){this.layer.decreaseRasterJobHandlerUsage(),this._flowSubView?.destroy()}_setSubView(e){if("wcs"===this.layer.type)return;const t="flow"===e?.type,r=this._flowSubView;t&&null!=r||(r?.destroy(),this._flowSubView=t?new p({layerView:this}):null)}get _blankTile(){const e=document.createElement("canvas"),t=e.getContext("2d"),[r,i]=this.tileInfo.size;return e.width=r,e.height=i,t.clearRect(0,0,r,i),t.getImageData(0,0,r,i)}get _hasFlow(){return null!=this._flowSubView}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get dataLevelRange(){const e=this.layer.tileInfo,t=this.tileInfo.lodAt(0)?.scale,r=e.lodAt(e.lods.length-1)?.scale;return this.levelRangeFromScaleRange(t,r)}get fetchLevelRange(){if(this._hasFlow){const{minScale:e,maxScale:t}=this.layer.effectiveScaleRange;return this.levelRangeFromScaleRange(e,t)}return this.dataLevelRange}get visibleAtCurrentScale(){return this._flowSubView?.visibleAtCurrentScale??this.tilesVisibleAtCurrentScale()}_getFullExtent(){return n(this.layer.serviceRasterInfo,this.view.basemapTerrain?.spatialReference??this.view.spatialReference)}async fetchTile(e,t){const r=this.tileInfo,i=this._canSymbolizeInWebGL(),s={tileInfo:r,requestRawData:i,signal:t.signal,timeExtent:this.timeExtent,requestAsImageElement:this._isAlignedMapTile,requestProjectedLocalDirections:this._hasFlow,noClip:!1},{layer:a}=this,[l,o,n]=e,m=await a.fetchTile(l,o,n,s);if(m instanceof HTMLImageElement)return m;let h=m?.pixelBlock;if(null==h)return this._blankTile;if(!i&&!this._hasFlow&&(h=await a.applyRenderer(m),null==h))return this._blankTile;const p=new d([l,o,n],h,r.size[0],r.size[1]);return i?(p.symbolizerRenderer=a.symbolizer.rendererJSON,p.symbolizerParameters=a.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(l)),p.transformGrid=m.transformGrid,p.bandIds=a.bandIds):(p.isRendereredSource=!0,p.bandIds=null),p.interpolation=a.interpolation,p}_getSymbolizerOptions(e){const t=this.tileInfo.lodAt(e).resolution;return{pixelBlock:null,isGCS:null!=this.view.basemapTerrain?.spatialReference?this.view.basemapTerrain.spatialReference.isGeographic:this.view.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:this.layer.bandIds}}ensureSymbolizerParameters(e){this._canSymbolizeInWebGL()&&JSON.stringify(e.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(e.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e.lij[0])))}createFetchPopupFeaturesQueryGeometry(e,t){return f(e,t,this.view)}async doRefresh(){this.suspended||(this._flowSubView?.doRefresh(),this.emit("data-changed"))}isUpdating(){return this._flowSubView?.updating??!1}_canSymbolizeInWebGL(){const e=g(),{symbolizer:t}=this.layer,r=t.lookup.colormapLut?.indexedColormap,i=!!this.layer.rasterFunction?.hasClipFunction,s=r&&r.length>4*(e.maxTextureSize||4096);return t.canRenderInWebGL&&!s&&!i}get usedMemory(){return this._flowSubView?.usedMemory??0}get test(){}};e([l({readOnly:!0})],b.prototype,"_blankTile",null),e([l()],b.prototype,"_hasFlow",null),e([l({readOnly:!0})],b.prototype,"imageFormatIsOpaque",null),e([l({readOnly:!0})],b.prototype,"hasMixedImageFormats",null),e([l()],b.prototype,"_flowSubView",void 0),e([l({readOnly:!0})],b.prototype,"dataLevelRange",null),e([l({readOnly:!0})],b.prototype,"fetchLevelRange",null),e([l({readOnly:!0})],b.prototype,"visibleAtCurrentScale",null),b=e([o("esri.views.3d.layers.ImageryTileLayerView3D")],b);const w=b;export{w as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{whenOnce as i}from"../../../core/reactiveUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerViewPerformanceInfo as l}from"./support/LayerViewPerformanceInfo.js";import{updatingProgress as s,updatingProgressValue as n}from"../support/updatingProperties.js";import{checkIfTileInfoSupportedForView as o}from"../terrain/terrainUtils.js";import{isScaleRangeActive as c,validateScaleRange as h}from"../../support/layerViewUtils.js";const p=p=>{const m=p;let u=class extends m{constructor(){super(...arguments),this.hasMixedImageFormats=!0}get imageFormatIsOpaque(){return!1}get fullExtent(){return this.layer.fullExtent}get isOpaque(){return this.fullOpacity>=1&&this.imageFormatIsOpaque}get visibleAtCurrentScale(){const{minScale:e,maxScale:t}=this.layer;if(!c(e,t))return!0;const{basemapTerrain:i}=this.view,r=i.getLayerIndexByUID(1,this.uid);if(null==r)return!1;const{tilingScheme:a}=i,l=e&&a.levelAtScale(e),s=t&&a.levelAtScale(t);return i.renderer.visibleTiles.some(e=>!!e.layerInfo[1][r]&&(!l||e.level>=l)&&(!s||e.level<=s))}get dataScaleRange(){const e=this.tileInfo.lods;let t=e[0].scale,i=e[e.length-1].scale;if("tilemapCache"in this.layer&&this.layer.tilemapCache){const{effectiveMinLOD:e,effectiveMaxLOD:r}=this.layer.tilemapCache;t=this.tileInfo.lodAt(e).scale,i=this.tileInfo.lodAt(r).scale}return{minScale:t,maxScale:i}}canResume(){const e=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&!this.parent?.suspended&&this.view?.ready&&h(e)&&this.visibleAtCurrentTimeExtent||!1}get dataLevelRange(){const{minScale:e,maxScale:t}=this.dataScaleRange;return this.levelRangeFromScaleRange(e,t)}get fetchLevelRange(){return this.dataLevelRange}get displayLevelRange(){const e=this.layer.minScale||this.dataScaleRange.minScale,t=this.layer.maxScale||this.dataScaleRange.maxScale,i=this.levelRangeFromScaleRange(e,t);return this.layer.maxScale&&i.maxLevel++,i}get performanceInfo(){return new l(this.view.basemapTerrain.getUsedMemoryForLayerView(this))}getTileUrl(e){return this.layer.getTileUrl(e[0],e[1],e[2])}_addTilingSchemeMatchPromise(){if(null==this.fullExtent)return this.addResolvingPromise(Promise.reject(new t("tilingscheme:extent-not-defined","This layer doesn't define a fullExtent.")));const e=this._getTileInfoSupportError(this.tileInfo,this.fullExtent);if(e)return this.addResolvingPromise(Promise.reject(e));this.addResolvingPromise(i(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{const e=this.view.basemapTerrain.tilingScheme,t="tilemapCache"in this.layer?this.layer.tilemapCache?.effectiveMaxLOD:void 0,i=this._getTileInfoCompatibilityError(this.tileInfo,e,t);if(i)throw i}))}_getTileInfoSupportError(e,i){const r=o(e,i,this.view.spatialReference,this.view.state.viewingMode,"tilemapCache"in this.layer?this.layer.tilemapCache?.effectiveMaxLOD:void 0);if(!r)return;const a={layer:this.layer,error:r};switch(r.name){case"tilingscheme:spatial-reference-mismatch":case"tilingscheme:global-unsupported-spatial-reference":case"tilingscheme:local-unsupported-spatial-reference":return new t("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",a);default:return new t("layerview:tiling-scheme-unsupported","The tiling scheme of this layer is not supported by SceneView",a)}}_getTileInfoCompatibilityError(e,i,r){return null!=e&&i.compatibleWith(e,r)?null:new t("layerview:tiling-scheme-incompatible","The tiling scheme of this layer is incompatible with the tiling scheme of the surface")}levelRangeFromScaleRange(e,t){const i={minLevel:0,maxLevel:1/0},r=this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.tilingScheme;if(!r)return i;const a=r.levels[0],l=e=>{const t=Math.log(a.scale/e)/Math.LN2;return.5-Math.abs(.5-t%1)<1e-9?Math.round(t):Math.ceil(t)};return null!=e&&e>0&&(i.minLevel=Math.max(0,l(e))),null!=t&&t>0&&(i.maxLevel=Math.max(0,l(t))),i}isUpdating(){return!!(this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.updating)}};return e([r({readOnly:!0})],u.prototype,"imageFormatIsOpaque",null),e([r({readOnly:!0})],u.prototype,"updating",void 0),e([r(s)],u.prototype,"updatingProgress",void 0),e([r(n)],u.prototype,"updatingProgressValue",void 0),e([r()],u.prototype,"hasMixedImageFormats",void 0),e([r()],u.prototype,"fullExtent",null),e([r({readOnly:!0})],u.prototype,"isOpaque",null),e([r({readOnly:!0})],u.prototype,"visibleAtCurrentScale",null),e([r()],u.prototype,"dataScaleRange",null),e([r({readOnly:!0})],u.prototype,"dataLevelRange",null),e([r({readOnly:!0})],u.prototype,"fetchLevelRange",null),e([r({readOnly:!0})],u.prototype,"displayLevelRange",null),e([r()],u.prototype,"layer",void 0),u=e([a("esri.views.3d.layers.TiledLayerView3D")],u),u};export{p as TiledLayerView3D};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{whenOnce as i}from"../../../core/reactiveUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerViewPerformanceInfo as l}from"./support/LayerViewPerformanceInfo.js";import{updatingProgress as s,updatingProgressValue as n}from"../support/updatingProperties.js";import{checkIfTileInfoSupportedForView as o}from"../terrain/terrainUtils.js";import{isScaleRangeActive as c,validateScaleRange as h}from"../../support/layerViewUtils.js";const p=p=>{const m=p;let u=class extends m{constructor(){super(...arguments),this.hasMixedImageFormats=!0}get imageFormatIsOpaque(){return!1}get fullExtent(){return this.layer.fullExtent}get isOpaque(){return this.fullOpacity>=1&&this.imageFormatIsOpaque}tilesVisibleAtCurrentScale(){const{minScale:e,maxScale:t}=this.layer;if(!c(e,t))return!0;const{basemapTerrain:i}=this.view,r=i.getLayerIndexByUID(1,this.uid);if(null==r)return!1;const{tilingScheme:a}=i,l=e&&a.levelAtScale(e),s=t&&a.levelAtScale(t);return i.renderer.visibleTiles.some(e=>!!e.layerInfo[1][r]&&(!l||e.level>=l)&&(!s||e.level<=s))}get visibleAtCurrentScale(){return this.tilesVisibleAtCurrentScale()}get dataScaleRange(){const e=this.tileInfo.lods;let t=e[0].scale,i=e[e.length-1].scale;if("tilemapCache"in this.layer&&this.layer.tilemapCache){const{effectiveMinLOD:e,effectiveMaxLOD:r}=this.layer.tilemapCache;t=this.tileInfo.lodAt(e).scale,i=this.tileInfo.lodAt(r).scale}return{minScale:t,maxScale:i}}canResume(){const e=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&!this.parent?.suspended&&this.view?.ready&&h(e)&&this.visibleAtCurrentTimeExtent||!1}get dataLevelRange(){const{minScale:e,maxScale:t}=this.dataScaleRange;return this.levelRangeFromScaleRange(e,t)}get fetchLevelRange(){return this.dataLevelRange}get displayLevelRange(){const e=this.layer.minScale||this.dataScaleRange.minScale,t=this.layer.maxScale||this.dataScaleRange.maxScale,i=this.levelRangeFromScaleRange(e,t);return this.layer.maxScale&&i.maxLevel++,i}get performanceInfo(){return new l(this.view.basemapTerrain.getUsedMemoryForLayerView(this))}getTileUrl(e){return this.layer.getTileUrl(e[0],e[1],e[2])}_addTilingSchemeMatchPromise(){if(null==this.fullExtent)return this.addResolvingPromise(Promise.reject(new t("tilingscheme:extent-not-defined","This layer doesn't define a fullExtent.")));const e=this._getTileInfoSupportError(this.tileInfo,this.fullExtent);if(e)return this.addResolvingPromise(Promise.reject(e));this.addResolvingPromise(i(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{const e=this.view.basemapTerrain.tilingScheme,t="tilemapCache"in this.layer?this.layer.tilemapCache?.effectiveMaxLOD:void 0,i=this._getTileInfoCompatibilityError(this.tileInfo,e,t);if(i)throw i}))}_getTileInfoSupportError(e,i){const r=o(e,i,this.view.spatialReference,this.view.state.viewingMode,"tilemapCache"in this.layer?this.layer.tilemapCache?.effectiveMaxLOD:void 0);if(!r)return;const a={layer:this.layer,error:r};switch(r.name){case"tilingscheme:spatial-reference-mismatch":case"tilingscheme:global-unsupported-spatial-reference":case"tilingscheme:local-unsupported-spatial-reference":return new t("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",a);default:return new t("layerview:tiling-scheme-unsupported","The tiling scheme of this layer is not supported by SceneView",a)}}_getTileInfoCompatibilityError(e,i,r){return null!=e&&i.compatibleWith(e,r)?null:new t("layerview:tiling-scheme-incompatible","The tiling scheme of this layer is incompatible with the tiling scheme of the surface")}levelRangeFromScaleRange(e,t){const i={minLevel:0,maxLevel:1/0},r=this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.tilingScheme;if(!r)return i;const a=r.levels[0],l=e=>{const t=Math.log(a.scale/e)/Math.LN2;return.5-Math.abs(.5-t%1)<1e-9?Math.round(t):Math.ceil(t)};return null!=e&&e>0&&(i.minLevel=Math.max(0,l(e))),null!=t&&t>0&&(i.maxLevel=Math.max(0,l(t))),i}isUpdating(){return!!(this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.updating)}};return e([r({readOnly:!0})],u.prototype,"imageFormatIsOpaque",null),e([r({readOnly:!0})],u.prototype,"updating",void 0),e([r(s)],u.prototype,"updatingProgress",void 0),e([r(n)],u.prototype,"updatingProgressValue",void 0),e([r()],u.prototype,"hasMixedImageFormats",void 0),e([r()],u.prototype,"fullExtent",null),e([r({readOnly:!0})],u.prototype,"isOpaque",null),e([r({readOnly:!0})],u.prototype,"visibleAtCurrentScale",null),e([r()],u.prototype,"dataScaleRange",null),e([r({readOnly:!0})],u.prototype,"dataLevelRange",null),e([r({readOnly:!0})],u.prototype,"fetchLevelRange",null),e([r({readOnly:!0})],u.prototype,"displayLevelRange",null),e([r()],u.prototype,"layer",void 0),u=e([a("esri.views.3d.layers.TiledLayerView3D")],u),u};export{p as TiledLayerView3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as e}from"../../../../core/compilerUtils.js";import has from"../../../../core/has.js";import{defaultPrimitive as r}from"../../../../symbols/support/ObjectSymbol3DLayerResource.js";import{pathNumCircleProfileSubdivisions as t,pathNumRoundJoinSubdivisions as a,pathNumRoundCapExtrusionSubdivisions as s}from"./Graphics3DPathSymbolLayerConstants.js";import{primitiveLodResources as u}from"./primitiveObjectSymbolUtils.js";import{EstimatedSymbolComplexity as o,SymbolComplexityMemory as b,EstimatedAggregateSymbolComplexity as y,AggregateSymbolComplexity as i,SymbolComplexity as c}from"./SymbolComplexity.js";import{hasEdges as n}from"../support/edgeUtils.js";import{DefaultMaterial as l}from"../../webgl-engine/materials/DefaultMaterial.js";const P=new o({});function m(e){if("web-style"===e.type)return P;return F(e.symbolLayers.toArray().map(r=>L(e,r)))}function F(e){let r=0,t=0,a=0,s=!1,u=0;const o=new b;for(const b of e)null!=b&&(r+=b.verticesPerFeature,t+=b.verticesPerCoordinate,a+=b.drawCallsPerFeature,o.bytesPerFeature+=b.memory.bytesPerFeature,o.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,o.resourceBytes+=b.memory.resourceBytes,o.draped.bytesPerFeature+=b.memory.bytesPerFeature,o.draped.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,s=s||b.estimated,++u);return s?new y(u,{verticesPerFeature:r,verticesPerCoordinate:t,drawCallsPerFeature:a,memory:o}):new i(u,{verticesPerFeature:r,verticesPerCoordinate:t,drawCallsPerFeature:a,memory:o})}function d(e){const r=F(e);return r.numComplexities>0&&(r.verticesPerFeature/=r.numComplexities,r.verticesPerCoordinate/=r.numComplexities,r.drawCallsPerFeature/=r.numComplexities,r.memory.bytesPerFeature/=r.numComplexities,r.memory.bytesPerFeatureLabel/=r.numComplexities,r.memory.resourceBytes/=r.numComplexities,r.memory.draped.bytesPerFeature/=r.numComplexities,r.memory.draped.bytesPerFeatureLabel/=r.numComplexities),r}const p={};function L(u,b){const y=C(u,b),i=n(b)?2:0;switch(b.type){case"extrude":return new c({verticesPerFeature:-12,verticesPerCoordinate:12,drawCallsPerFeature:i,memory:y});case"fill":if("mesh-3d"===u.type)return new c({drawCallsPerFeature:i,memory:y});if(null!=b.outline&&b.outline.size>0)return new c({verticesPerFeature:-12,verticesPerCoordinate:9,memory:y});case"water":return new c({verticesPerFeature:-6,verticesPerCoordinate:3,memory:y});case"line":return new c({verticesPerFeature:-6,verticesPerCoordinate:6,memory:y});case"object":return b.resource?.href?new o({verticesPerFeature:100,memory:y}):{...f(b.resource?.primitive??r),memory:y};case"path":{let r=0,u=0;switch(b.profile){case"circle":r=t;break;case"quad":r=4;break;default:return void e(b.profile)}switch(b.join){case"round":u=a;break;case"miter":case"bevel":u=1;break;default:return}const o=2*r,i=r*u*2,n=i+o;let l=-2*i-o;switch(b.cap){case"none":break;case"butt":case"square":l+=2*(r-1);break;case"round":l+=2*(r*(s-1)*2+r);break;default:return}return new c({verticesPerFeature:l,verticesPerCoordinate:n,memory:y})}case"text":{const e="label-3d"===u.type?0:2;return new c({verticesPerFeature:6,memory:y,drawCallsPerFeature:e})}case"icon":return new c({verticesPerFeature:6,memory:y});default:return}}function C(r,t){const a="point-3d"===r.type;switch(t.type){case"extrude":return t.edges&&t.edges.size>0?E.EXTRUDE_EDGES:E.EXTRUDE;case"fill":return null!=t.outline&&t.outline.size>0?E.FILL_OUTLINE:E.FILL;case"water":return E.FILL;case"line":return"round"===t.join?E.LINE_ROUND:E.LINE_MITER;case"path":switch(t.join){case"round":switch(t.profile){case"circle":return E.PATH_ROUND_CIRCLE;case"quad":return E.PATH_ROUND_QUAD;default:return void e(t.profile)}case"miter":case"bevel":switch(t.profile){case"circle":return E.PATH_MITER_CIRCLE;case"quad":return E.PATH_MITER_QUAD;default:return void e(t.profile)}default:return}case"object":return a?E.OBJECT_POINT:E.OBJECT_POLYGON;case"icon":case"text":return a?E.ICON_POINT:E.ICON_POLYGON;default:return}}function f(e){const r=p[e];if(r)return r;const t=w(u(e,new l({},{spherical:!0})).levels);return p[e]=new c({verticesPerFeature:t}),p[e]}function w(e){return e.reduce((e,r,t)=>e+r.numVertices*(1/10**t),0)/e.reduce((e,r,t)=>e+1/10**t,0)}const E={ICON_POINT:{bytesPerFeature:2658,bytesPerFeatureLabel:3484,resourceBytes:0,draped:{bytesPerFeature:1845,bytesPerFeatureLabel:3498}},ICON_POLYGON:{bytesPerFeature:3086,bytesPerFeatureLabel:2996,resourceBytes:0,draped:{bytesPerFeature:2694,bytesPerFeatureLabel:3014}},OBJECT_POINT:{bytesPerFeature:497,bytesPerFeatureLabel:2933,resourceBytes:0,draped:{bytesPerFeature:497,bytesPerFeatureLabel:2933}},OBJECT_POLYGON:{bytesPerFeature:867,bytesPerFeatureLabel:2491,resourceBytes:0,draped:{bytesPerFeature:867,bytesPerFeatureLabel:2491}},LINE_MITER:{bytesPerFeature:2337,bytesPerFeatureLabel:2658,resourceBytes:0,draped:{bytesPerFeature:1864,bytesPerFeatureLabel:2656}},LINE_ROUND:{bytesPerFeature:2341,bytesPerFeatureLabel:2672,resourceBytes:0,draped:{bytesPerFeature:1873,bytesPerFeatureLabel:2643}},PATH_MITER_CIRCLE:{bytesPerFeature:22374,bytesPerFeatureLabel:2558,resourceBytes:0,draped:{bytesPerFeature:22374,bytesPerFeatureLabel:2558}},PATH_ROUND_CIRCLE:{bytesPerFeature:24004,bytesPerFeatureLabel:2598,resourceBytes:0,draped:{bytesPerFeature:24004,bytesPerFeatureLabel:2598}},PATH_MITER_QUAD:{bytesPerFeature:24040,bytesPerFeatureLabel:2940,resourceBytes:0,draped:{bytesPerFeature:24040,bytesPerFeatureLabel:2940}},PATH_ROUND_QUAD:{bytesPerFeature:23088,bytesPerFeatureLabel:2886,resourceBytes:0,draped:{bytesPerFeature:23088,bytesPerFeatureLabel:2886}},FILL:{bytesPerFeature:3059,bytesPerFeatureLabel:2838,resourceBytes:0,draped:{bytesPerFeature:2352,bytesPerFeatureLabel:2808}},FILL_OUTLINE:{bytesPerFeature:3093,bytesPerFeatureLabel:2632,resourceBytes:0,draped:{bytesPerFeature:2480,bytesPerFeatureLabel:2601}},EXTRUDE:{bytesPerFeature:5075,bytesPerFeatureLabel:2559,resourceBytes:0,draped:{bytesPerFeature:5075,bytesPerFeatureLabel:2559}},EXTRUDE_EDGES:{bytesPerFeature:2843,bytesPerFeatureLabel:2139,resourceBytes:0,draped:{bytesPerFeature:2843,bytesPerFeatureLabel:2139}}};if(has("esri-tests-disable-symbol-memory-estimators"))for(const _ in E){const e=E[_];e.bytesPerFeature=0,e.bytesPerFeatureLabel=0,e.draped.bytesPerFeature=0,e.draped.bytesPerFeatureLabel=0}export{d as averageSymbolComplexities,m as defaultSymbolComplexity,L as defaultSymbolLayerComplexity,C as defaultSymbolLayerMemoryComplexity,P as emptySymbolComplexity,w as estimateNumVerticesForLods,F as totalSymbolComplexities};
5
+ import{neverReached as e}from"../../../../core/compilerUtils.js";import has from"../../../../core/has.js";import{defaultPrimitive as r}from"../../../../symbols/support/ObjectSymbol3DLayerResource.js";import{pathNumCircleProfileSubdivisions as t,pathNumRoundJoinSubdivisions as a,pathNumRoundCapExtrusionSubdivisions as s}from"./Graphics3DPathSymbolLayerConstants.js";import{primitiveLodResources as u}from"./primitiveObjectSymbolUtils.js";import{EstimatedSymbolComplexity as o,SymbolComplexityMemory as b,EstimatedAggregateSymbolComplexity as y,AggregateSymbolComplexity as i,SymbolComplexity as c}from"./SymbolComplexity.js";import{hasEdges as n}from"../support/edgeUtils.js";import{DefaultMaterial as l}from"../../webgl-engine/materials/DefaultMaterial.js";const P=new o({});function m(e){if("web-style"===e.type)return P;return F(e.symbolLayers.toArray().map(r=>L(e,r)))}function F(e){let r=0,t=0,a=0,s=!1,u=0;const o=new b;for(const b of e)null!=b&&(r+=b.verticesPerFeature,t+=b.verticesPerCoordinate,a+=b.drawCallsPerFeature,o.bytesPerFeature+=b.memory.bytesPerFeature,o.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,o.resourceBytes+=b.memory.resourceBytes,o.draped.bytesPerFeature+=b.memory.bytesPerFeature,o.draped.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,s=s||b.estimated,++u);return s?new y(u,{verticesPerFeature:r,verticesPerCoordinate:t,drawCallsPerFeature:a,memory:o}):new i(u,{verticesPerFeature:r,verticesPerCoordinate:t,drawCallsPerFeature:a,memory:o})}function d(e){const r=F(e);return r.numComplexities>0&&(r.verticesPerFeature/=r.numComplexities,r.verticesPerCoordinate/=r.numComplexities,r.drawCallsPerFeature/=r.numComplexities,r.memory.bytesPerFeature/=r.numComplexities,r.memory.bytesPerFeatureLabel/=r.numComplexities,r.memory.resourceBytes/=r.numComplexities,r.memory.draped.bytesPerFeature/=r.numComplexities,r.memory.draped.bytesPerFeatureLabel/=r.numComplexities),r}const p={};function L(u,b){const y=C(u,b),i=n(b)?2:0;switch(b.type){case"extrude":return new c({verticesPerFeature:-12,verticesPerCoordinate:12,drawCallsPerFeature:i,memory:y});case"fill":if("mesh-3d"===u.type)return new c({drawCallsPerFeature:i,memory:y});if(null!=b.outline&&b.outline.size>0)return new c({verticesPerFeature:-12,verticesPerCoordinate:9,memory:y});case"water":return new c({verticesPerFeature:-6,verticesPerCoordinate:3,memory:y});case"line":return new c({verticesPerFeature:-6,verticesPerCoordinate:6,memory:y});case"object":return b.resource?.href?new o({verticesPerFeature:100,memory:y}):{...f(b.resource?.primitive??r),memory:y};case"path":{let r=0,u=0;switch(b.profile){case"circle":r=t;break;case"quad":r=4;break;default:return void e(b.profile)}switch(b.join){case"round":u=a;break;case"miter":case"bevel":u=1;break;default:return}const o=2*r,i=r*u*2,n=i+o;let l=-2*i-o;switch(b.cap){case"none":break;case"butt":case"square":l+=2*(r-1);break;case"round":l+=2*(r*(s-1)*2+r);break;default:return}return new c({verticesPerFeature:l,verticesPerCoordinate:n,memory:y})}case"text":{const e="label-3d"===u.type?0:2;return new c({verticesPerFeature:6,memory:y,drawCallsPerFeature:e})}case"icon":return new c({verticesPerFeature:6,memory:y});default:return}}function C(r,t){const a="point-3d"===r.type;switch(t.type){case"extrude":return t.edges&&t.edges.size>0?E.EXTRUDE_EDGES:E.EXTRUDE;case"fill":return null!=t.outline&&t.outline.size>0?E.FILL_OUTLINE:E.FILL;case"water":return E.FILL;case"line":return"round"===t.join?E.LINE_ROUND:E.LINE_MITER;case"path":switch(t.join){case"round":switch(t.profile){case"circle":return E.PATH_ROUND_CIRCLE;case"quad":return E.PATH_ROUND_QUAD;default:return void e(t.profile)}case"miter":case"bevel":switch(t.profile){case"circle":return E.PATH_MITER_CIRCLE;case"quad":return E.PATH_MITER_QUAD;default:return void e(t.profile)}default:return}case"object":return a?E.OBJECT_POINT:E.OBJECT_POLYGON;case"icon":case"text":return a?E.ICON_POINT:E.ICON_POLYGON;default:return}}function f(e){const r=p[e];if(r)return r;const t=w(u(e,new l({},{spherical:!0})).levels);return p[e]=new c({verticesPerFeature:t}),p[e]}function w(e){return e.reduce((e,r,t)=>e+r.numVertices*(1/10**t),0)/e.reduce((e,r,t)=>e+1/10**t,0)}const E={ICON_POINT:{bytesPerFeature:2658,bytesPerFeatureLabel:3484,resourceBytes:0,draped:{bytesPerFeature:1845,bytesPerFeatureLabel:3498}},ICON_POLYGON:{bytesPerFeature:3086,bytesPerFeatureLabel:2996,resourceBytes:0,draped:{bytesPerFeature:2694,bytesPerFeatureLabel:3014}},OBJECT_POINT:{bytesPerFeature:497,bytesPerFeatureLabel:2933,resourceBytes:0,draped:{bytesPerFeature:497,bytesPerFeatureLabel:2933}},OBJECT_POLYGON:{bytesPerFeature:867,bytesPerFeatureLabel:2491,resourceBytes:0,draped:{bytesPerFeature:867,bytesPerFeatureLabel:2491}},LINE_MITER:{bytesPerFeature:2337,bytesPerFeatureLabel:2658,resourceBytes:0,draped:{bytesPerFeature:1864,bytesPerFeatureLabel:2656}},LINE_ROUND:{bytesPerFeature:2341,bytesPerFeatureLabel:2672,resourceBytes:0,draped:{bytesPerFeature:1873,bytesPerFeatureLabel:2643}},PATH_MITER_CIRCLE:{bytesPerFeature:22374,bytesPerFeatureLabel:2558,resourceBytes:0,draped:{bytesPerFeature:22374,bytesPerFeatureLabel:2558}},PATH_ROUND_CIRCLE:{bytesPerFeature:24004,bytesPerFeatureLabel:2598,resourceBytes:0,draped:{bytesPerFeature:24004,bytesPerFeatureLabel:2598}},PATH_MITER_QUAD:{bytesPerFeature:24040,bytesPerFeatureLabel:2940,resourceBytes:0,draped:{bytesPerFeature:24040,bytesPerFeatureLabel:2940}},PATH_ROUND_QUAD:{bytesPerFeature:23088,bytesPerFeatureLabel:2886,resourceBytes:0,draped:{bytesPerFeature:23088,bytesPerFeatureLabel:2886}},FILL:{bytesPerFeature:3059,bytesPerFeatureLabel:2838,resourceBytes:0,draped:{bytesPerFeature:2352,bytesPerFeatureLabel:2808}},FILL_OUTLINE:{bytesPerFeature:3093,bytesPerFeatureLabel:2632,resourceBytes:0,draped:{bytesPerFeature:2480,bytesPerFeatureLabel:2601}},EXTRUDE:{bytesPerFeature:5075,bytesPerFeatureLabel:2559,resourceBytes:0,draped:{bytesPerFeature:5075,bytesPerFeatureLabel:2559}},EXTRUDE_EDGES:{bytesPerFeature:2843,bytesPerFeatureLabel:2139,resourceBytes:0,draped:{bytesPerFeature:2843,bytesPerFeatureLabel:2139}}};if(has("esri-tests-disable-symbol-memory-estimators"))for(const _ in E){const e=E[_];e.bytesPerFeature=0,e.bytesPerFeatureLabel=0,e.draped.bytesPerFeature=0,e.draped.bytesPerFeatureLabel=0}export{d as averageSymbolComplexities,m as defaultSymbolComplexity,L as defaultSymbolLayerComplexity,C as defaultSymbolLayerMemoryComplexity,P as emptySymbolComplexity,w as estimateNumVerticesForLods,E as memoryEstimators,F as totalSymbolComplexities};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../core/has.js";import{Milliseconds as e}from"../../../core/time.js";class a{static isValidProfile(e){return e in l}static getDefaultProfile(){return has("esri-iPhone")?"low":"medium"}static apply(e,a){const i=l[e];a.graphics3D.maxTotalNumberOfFeatures=i.graphics3D.maxTotalNumberOfFeatures,a.graphics3D.maxNumberOfDrawCalls=i.graphics3D.maxNumberOfDrawCalls,a.graphics3D.maxTotalNumberOfVertices=i.graphics3D.maxTotalNumberOfVertices,a.graphics3D.polygonLodFactor=i.graphics3D.polygonLodFactor,a.graphics3D.polylineLodFactor=i.graphics3D.polylineLodFactor,a.graphics3D.snapshotAvailable=i.graphics3D.snapshotAvailable,a.graphics3D.skipHighSymbolLods=i.graphics3D.skipHighSymbolLods;const t=a.sceneService.object,o=i.sceneService.object;t.lodFactor=o.lodFactor,a.sceneService.point.lodFactor=i.sceneService.point.lodFactor,a.sceneService.integratedMesh.lodFactor=i.sceneService.integratedMesh.lodFactor,a.sceneService.pointCloud.lodFactor=i.sceneService.pointCloud.lodFactor,a.tiledSurface.lodBias=i.tiledSurface.lodBias,a.tiledSurface.angledSplitBias=i.tiledSurface.angledSplitBias,a.tiledSurface.vtlContentZoom=i.tiledSurface.vtlContentZoom,a.tiledSurface.elevationLevelDelta=i.tiledSurface.elevationLevelDelta,a.tiledSurface.reduceTileLevelDifferences=i.tiledSurface.reduceTileLevelDifferences,a.gaussianSplat.minimumSplatPixelRadius=i.gaussianSplat.minimumSplatPixelRadius,a.gaussianSplat.minimumOpacity=i.gaussianSplat.minimumOpacity,a.gaussianSplat.maxAllowedVisibleGaussians=i.gaussianSplat.maxAllowedVisibleGaussians,a.heatmap.pixelRatio=i.heatmap.pixelRatio,a.heatmap.maxTotalNumberOfFeatures=i.heatmap.maxTotalNumberOfFeatures,a.fadeDuration=i.fadeDuration,a.antialiasingEnabled=i.antialiasingEnabled,a.physicallyBasedRenderingEnabled=i.physicalBasedRenderingEnabled,a.highQualityTransparency=i.highQualityTransparency,a.highResolutionAtmosphere=i.highResolutionAtmosphere,a.reflections=i.reflections,a.ambientOcclusion=i.ambientOcclusion,a.maxTexturePixels=i.maxTexturePixels,a.memoryLimit=i.memoryLimit,a.additionalCacheMemory=i.additionalCacheMemory,a.frameRate=i.frameRate,a.maximumPixelRatio=i.maximumPixelRatio}static{this.test={reset(){const e=t();for(const a of Object.keys(e))l[a]=e[a]}}}}const i={IPhone12Pro:120,GalaxyS20:200,FullHD:240,SurfacePro7:300,FullHDRetina:430},l=t();function t(){const a=!!has("esri-mobile"),l=!!has("ios"),t=e(400);return{low:{graphics3D:{maxTotalNumberOfFeatures:25e3,maxNumberOfDrawCalls:8e3,maxTotalNumberOfVertices:255e4,polygonLodFactor:.5,polylineLodFactor:1,snapshotAvailable:!1,skipHighSymbolLods:!0},heatmap:{pixelRatio:.125,maxTotalNumberOfFeatures:5e4},sceneService:{object:{lodFactor:.2},point:{lodFactor:1},integratedMesh:{lodFactor:.6},pointCloud:{lodFactor:.5}},gaussianSplat:{minimumSplatPixelRadius:2,minimumOpacity:.1,maxAllowedVisibleGaussians:4e6},tiledSurface:{lodBias:-1,angledSplitBias:.5,vtlContentZoom:.75,elevationLevelDelta:3,reduceTileLevelDifferences:!0},fadeDuration:e(0),antialiasingEnabled:!1,physicalBasedRenderingEnabled:!1,highQualityTransparency:!1,highResolutionAtmosphere:!1,reflections:!1,ambientOcclusion:!1,maxTexturePixels:a?1048576:4194304,memoryLimit:200+i.IPhone12Pro,additionalCacheMemory:0,frameRate:0,maximumPixelRatio:1},medium:{graphics3D:{maxTotalNumberOfFeatures:1e5,maxNumberOfDrawCalls:17e3,maxTotalNumberOfVertices:625e4,polygonLodFactor:a?.8:1,polylineLodFactor:a?1.2:1.5,snapshotAvailable:!l,skipHighSymbolLods:!1},heatmap:{pixelRatio:.25,maxTotalNumberOfFeatures:13e4},sceneService:{object:{lodFactor:1},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1}},gaussianSplat:{minimumSplatPixelRadius:1,minimumOpacity:.05,maxAllowedVisibleGaussians:8e6},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,elevationLevelDelta:3,reduceTileLevelDifferences:!has("disable-feature:reduce-map-tile-levels")},fadeDuration:t,antialiasingEnabled:!1,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highResolutionAtmosphere:!1,reflections:!1,ambientOcclusion:!1,maxTexturePixels:a?4194304:4096**2,memoryLimit:a?600+i.GalaxyS20:750+i.FullHD,additionalCacheMemory:a?-100:150,frameRate:0,maximumPixelRatio:1},high:{graphics3D:{maxTotalNumberOfFeatures:1e5,maxNumberOfDrawCalls:17e3,maxTotalNumberOfVertices:125e5,polygonLodFactor:a?1.2:2,polylineLodFactor:a?1.2:2,snapshotAvailable:!l,skipHighSymbolLods:!1},heatmap:{pixelRatio:.5,maxTotalNumberOfFeatures:23e4},sceneService:{object:{lodFactor:1},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1}},gaussianSplat:{minimumSplatPixelRadius:.5,minimumOpacity:.005,maxAllowedVisibleGaussians:16e6},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,elevationLevelDelta:2,reduceTileLevelDifferences:!has("disable-feature:reduce-map-tile-levels")},fadeDuration:t,antialiasingEnabled:!0,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highResolutionAtmosphere:!0,reflections:!0,ambientOcclusion:!0,maxTexturePixels:a?4096**2:1/0,memoryLimit:a?900+i.SurfacePro7:1500+i.FullHDRetina,additionalCacheMemory:a?-150:0,frameRate:0,maximumPixelRatio:a?1:1/0}}}export{a as default};
5
+ import has from"../../../core/has.js";import{Milliseconds as e}from"../../../core/time.js";class a{static isValidProfile(e){return e in l}static getDefaultProfile(){return has("esri-iPhone")?"low":"medium"}static apply(e,a){const i=l[e];a.graphics3D.maxTotalNumberOfFeatures=i.graphics3D.maxTotalNumberOfFeatures,a.graphics3D.maxNumberOfDrawCalls=i.graphics3D.maxNumberOfDrawCalls,a.graphics3D.maxTotalNumberOfVertices=i.graphics3D.maxTotalNumberOfVertices,a.graphics3D.polygonLodFactor=i.graphics3D.polygonLodFactor,a.graphics3D.polylineLodFactor=i.graphics3D.polylineLodFactor,a.graphics3D.snapshotAvailable=i.graphics3D.snapshotAvailable,a.graphics3D.skipHighSymbolLods=i.graphics3D.skipHighSymbolLods;const t=a.sceneService.object,o=i.sceneService.object;t.lodFactor=o.lodFactor,a.sceneService.point.lodFactor=i.sceneService.point.lodFactor,a.sceneService.integratedMesh.lodFactor=i.sceneService.integratedMesh.lodFactor,a.sceneService.pointCloud.lodFactor=i.sceneService.pointCloud.lodFactor,a.tiledSurface.lodBias=i.tiledSurface.lodBias,a.tiledSurface.angledSplitBias=i.tiledSurface.angledSplitBias,a.tiledSurface.vtlContentZoom=i.tiledSurface.vtlContentZoom,a.tiledSurface.elevationLevelDelta=i.tiledSurface.elevationLevelDelta,a.tiledSurface.reduceTileLevelDifferences=i.tiledSurface.reduceTileLevelDifferences,a.gaussianSplat.minimumSplatPixelRadius=i.gaussianSplat.minimumSplatPixelRadius,a.gaussianSplat.minimumOpacity=i.gaussianSplat.minimumOpacity,a.gaussianSplat.maxAllowedVisibleGaussians=i.gaussianSplat.maxAllowedVisibleGaussians,a.heatmap.pixelRatio=i.heatmap.pixelRatio,a.heatmap.maxTotalNumberOfFeatures=i.heatmap.maxTotalNumberOfFeatures,a.flow3D.maxTotalNumberOfStreamlines=i.flow3D.maxTotalNumberOfStreamlines,a.flow3D.maxTracingResolution=i.flow3D.maxTracingResolution,a.fadeDuration=i.fadeDuration,a.antialiasingEnabled=i.antialiasingEnabled,a.physicallyBasedRenderingEnabled=i.physicalBasedRenderingEnabled,a.highQualityTransparency=i.highQualityTransparency,a.highResolutionAtmosphere=i.highResolutionAtmosphere,a.reflections=i.reflections,a.ambientOcclusion=i.ambientOcclusion,a.maxTexturePixels=i.maxTexturePixels,a.memoryLimit=i.memoryLimit,a.additionalCacheMemory=i.additionalCacheMemory,a.frameRate=i.frameRate,a.maximumPixelRatio=i.maximumPixelRatio}static{this.test={reset(){const e=t();for(const a of Object.keys(e))l[a]=e[a]}}}}const i={IPhone12Pro:120,GalaxyS20:200,FullHD:240,SurfacePro7:300,FullHDRetina:430},l=t();function t(){const a=!!has("esri-mobile"),l=!!has("ios"),t=e(400);return{low:{flow3D:{maxTotalNumberOfStreamlines:25e3,maxTracingResolution:1024},graphics3D:{maxTotalNumberOfFeatures:25e3,maxNumberOfDrawCalls:8e3,maxTotalNumberOfVertices:255e4,polygonLodFactor:.5,polylineLodFactor:1,snapshotAvailable:!1,skipHighSymbolLods:!0},heatmap:{pixelRatio:.125,maxTotalNumberOfFeatures:5e4},sceneService:{object:{lodFactor:.2},point:{lodFactor:1},integratedMesh:{lodFactor:.6},pointCloud:{lodFactor:.5}},gaussianSplat:{minimumSplatPixelRadius:2,minimumOpacity:.1,maxAllowedVisibleGaussians:4e6},tiledSurface:{lodBias:-1,angledSplitBias:.5,vtlContentZoom:.75,elevationLevelDelta:3,reduceTileLevelDifferences:!0},fadeDuration:e(0),antialiasingEnabled:!1,physicalBasedRenderingEnabled:!1,highQualityTransparency:!1,highResolutionAtmosphere:!1,reflections:!1,ambientOcclusion:!1,maxTexturePixels:a?1048576:4194304,memoryLimit:200+i.IPhone12Pro,additionalCacheMemory:0,frameRate:0,maximumPixelRatio:1},medium:{flow3D:{maxTotalNumberOfStreamlines:1e5,maxTracingResolution:2048},graphics3D:{maxTotalNumberOfFeatures:1e5,maxNumberOfDrawCalls:17e3,maxTotalNumberOfVertices:625e4,polygonLodFactor:a?.8:1,polylineLodFactor:a?1.2:1.5,snapshotAvailable:!l,skipHighSymbolLods:!1},heatmap:{pixelRatio:.25,maxTotalNumberOfFeatures:13e4},sceneService:{object:{lodFactor:1},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1}},gaussianSplat:{minimumSplatPixelRadius:1,minimumOpacity:.05,maxAllowedVisibleGaussians:8e6},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,elevationLevelDelta:3,reduceTileLevelDifferences:!has("disable-feature:reduce-map-tile-levels")},fadeDuration:t,antialiasingEnabled:!1,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highResolutionAtmosphere:!1,reflections:!1,ambientOcclusion:!1,maxTexturePixels:a?4194304:4096**2,memoryLimit:a?600+i.GalaxyS20:750+i.FullHD,additionalCacheMemory:a?-100:150,frameRate:0,maximumPixelRatio:1},high:{flow3D:{maxTotalNumberOfStreamlines:1e5,maxTracingResolution:2048},graphics3D:{maxTotalNumberOfFeatures:1e5,maxNumberOfDrawCalls:17e3,maxTotalNumberOfVertices:125e5,polygonLodFactor:a?1.2:2,polylineLodFactor:a?1.2:2,snapshotAvailable:!l,skipHighSymbolLods:!1},heatmap:{pixelRatio:.5,maxTotalNumberOfFeatures:23e4},sceneService:{object:{lodFactor:1},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1}},gaussianSplat:{minimumSplatPixelRadius:.5,minimumOpacity:.005,maxAllowedVisibleGaussians:16e6},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,elevationLevelDelta:2,reduceTileLevelDifferences:!has("disable-feature:reduce-map-tile-levels")},fadeDuration:t,antialiasingEnabled:!0,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highResolutionAtmosphere:!0,reflections:!0,ambientOcclusion:!0,maxTexturePixels:a?4096**2:1/0,memoryLimit:a?900+i.SurfacePro7:1500+i.FullHDRetina,additionalCacheMemory:a?-150:0,frameRate:0,maximumPixelRatio:a?1:1/0}}}export{a as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{Milliseconds as o}from"../../../core/time.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";let r=class extends e{constructor(){super(...arguments),this.minTotalNumberOfFeatures=2e3,this.maxTotalNumberOfFeatures=5e4,this.maxNumberOfDrawCalls=17e3,this.maxTotalNumberOfVertices=17e5,this.snapshotAvailable=!0,this.polygonLodFactor=1,this.polylineLodFactor=1,this.skipHighSymbolLods=!1}};t([i()],r.prototype,"minTotalNumberOfFeatures",void 0),t([i()],r.prototype,"maxTotalNumberOfFeatures",void 0),t([i()],r.prototype,"maxNumberOfDrawCalls",void 0),t([i()],r.prototype,"maxTotalNumberOfVertices",void 0),t([i()],r.prototype,"snapshotAvailable",void 0),t([i()],r.prototype,"polygonLodFactor",void 0),t([i()],r.prototype,"polylineLodFactor",void 0),t([i()],r.prototype,"skipHighSymbolLods",void 0),r=t([s("esri.views.3d.support.QualitySettings.Graphics3DSettings")],r);let p=class{constructor(){this.minimumSplatPixelRadius=1,this.minimumOpacity=.05,this.maxAllowedVisibleGaussians=8e6}};t([i()],p.prototype,"minimumSplatPixelRadius",void 0),t([i()],p.prototype,"minimumOpacity",void 0),t([i()],p.prototype,"maxAllowedVisibleGaussians",void 0),p=t([s("esri.views.3d.support.QualitySettings.GaussianSplatSettings")],p);let a=class extends e{constructor(){super(...arguments),this.lodFactor=1}};t([i()],a.prototype,"lodFactor",void 0),a=t([s("esri.views.3d.support.QualitySettings.LoDFactorSettings")],a);let l=class extends e{constructor(){super(...arguments),this.object=new a,this.point=new a,this.integratedMesh=new a,this.pointCloud=new a}};t([i({type:a})],l.prototype,"object",void 0),t([i({type:a})],l.prototype,"point",void 0),t([i({type:a})],l.prototype,"integratedMesh",void 0),t([i({type:a})],l.prototype,"pointCloud",void 0),l=t([s("esri.views.3d.support.QualitySettings.SceneServiceSettings")],l);let n=class extends e{constructor(){super(...arguments),this.lodBias=0,this.angledSplitBias=1,this.vtlContentZoom=1,this.elevationLevelDelta=3,this.reduceTileLevelDifferences=!0}};t([i()],n.prototype,"lodBias",void 0),t([i()],n.prototype,"angledSplitBias",void 0),t([i()],n.prototype,"vtlContentZoom",void 0),t([i()],n.prototype,"elevationLevelDelta",void 0),t([i()],n.prototype,"reduceTileLevelDifferences",void 0),n=t([s("esri.views.3d.support.QualitySettings.TiledSurfaceSettings")],n);let d=class extends e{constructor(){super(...arguments),this.pixelRatio=1,this.maxTotalNumberOfFeatures=5e4}};t([i()],d.prototype,"pixelRatio",void 0),t([i()],d.prototype,"maxTotalNumberOfFeatures",void 0),d=t([s("esri.views.3d.support.QualitySettings.HeatmapSettings")],d);let c=class extends e{constructor(){super(...arguments),this.graphics3D=new r,this.sceneService=new l,this.tiledSurface=new n,this.gaussianSplat=new p,this.heatmap=new d,this.fadeDuration=o(400),this.antialiasingEnabled=!0,this.physicallyBasedRenderingEnabled=!1,this.highQualityTransparency=!0,this.highResolutionAtmosphere=!1,this.reflections=!1,this.ambientOcclusion=!1,this.glow=!1,this.maxTexturePixels=1/0,this.memoryLimit=750,this.additionalCacheMemory=0,this.frameRate=void 0,this.maximumPixelRatio=1/0}};t([i({type:r})],c.prototype,"graphics3D",void 0),t([i({type:l})],c.prototype,"sceneService",void 0),t([i({type:n})],c.prototype,"tiledSurface",void 0),t([i({type:p})],c.prototype,"gaussianSplat",void 0),t([i({type:d})],c.prototype,"heatmap",void 0),t([i()],c.prototype,"fadeDuration",void 0),t([i()],c.prototype,"antialiasingEnabled",void 0),t([i()],c.prototype,"physicallyBasedRenderingEnabled",void 0),t([i()],c.prototype,"highQualityTransparency",void 0),t([i()],c.prototype,"highResolutionAtmosphere",void 0),t([i()],c.prototype,"reflections",void 0),t([i()],c.prototype,"ambientOcclusion",void 0),t([i()],c.prototype,"glow",void 0),t([i()],c.prototype,"maxTexturePixels",void 0),t([i()],c.prototype,"memoryLimit",void 0),t([i()],c.prototype,"additionalCacheMemory",void 0),t([i()],c.prototype,"frameRate",void 0),t([i()],c.prototype,"maximumPixelRatio",void 0),c=t([s("esri.views.3d.support.QualitySettings")],c);const m=c;export{m as default};
5
+ import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{Milliseconds as o}from"../../../core/time.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";let r=class extends e{constructor(){super(...arguments),this.minTotalNumberOfFeatures=2e3,this.maxTotalNumberOfFeatures=5e4,this.maxNumberOfDrawCalls=17e3,this.maxTotalNumberOfVertices=17e5,this.snapshotAvailable=!0,this.polygonLodFactor=1,this.polylineLodFactor=1,this.skipHighSymbolLods=!1}};t([i()],r.prototype,"minTotalNumberOfFeatures",void 0),t([i()],r.prototype,"maxTotalNumberOfFeatures",void 0),t([i()],r.prototype,"maxNumberOfDrawCalls",void 0),t([i()],r.prototype,"maxTotalNumberOfVertices",void 0),t([i()],r.prototype,"snapshotAvailable",void 0),t([i()],r.prototype,"polygonLodFactor",void 0),t([i()],r.prototype,"polylineLodFactor",void 0),t([i()],r.prototype,"skipHighSymbolLods",void 0),r=t([s("esri.views.3d.support.QualitySettings.Graphics3DSettings")],r);let p=class{constructor(){this.minimumSplatPixelRadius=1,this.minimumOpacity=.05,this.maxAllowedVisibleGaussians=8e6}};t([i()],p.prototype,"minimumSplatPixelRadius",void 0),t([i()],p.prototype,"minimumOpacity",void 0),t([i()],p.prototype,"maxAllowedVisibleGaussians",void 0),p=t([s("esri.views.3d.support.QualitySettings.GaussianSplatSettings")],p);let a=class extends e{constructor(){super(...arguments),this.lodFactor=1}};t([i()],a.prototype,"lodFactor",void 0),a=t([s("esri.views.3d.support.QualitySettings.LoDFactorSettings")],a);let l=class extends e{constructor(){super(...arguments),this.object=new a,this.point=new a,this.integratedMesh=new a,this.pointCloud=new a}};t([i({type:a})],l.prototype,"object",void 0),t([i({type:a})],l.prototype,"point",void 0),t([i({type:a})],l.prototype,"integratedMesh",void 0),t([i({type:a})],l.prototype,"pointCloud",void 0),l=t([s("esri.views.3d.support.QualitySettings.SceneServiceSettings")],l);let n=class extends e{constructor(){super(...arguments),this.lodBias=0,this.angledSplitBias=1,this.vtlContentZoom=1,this.elevationLevelDelta=3,this.reduceTileLevelDifferences=!0}};t([i()],n.prototype,"lodBias",void 0),t([i()],n.prototype,"angledSplitBias",void 0),t([i()],n.prototype,"vtlContentZoom",void 0),t([i()],n.prototype,"elevationLevelDelta",void 0),t([i()],n.prototype,"reduceTileLevelDifferences",void 0),n=t([s("esri.views.3d.support.QualitySettings.TiledSurfaceSettings")],n);let d=class extends e{constructor(){super(...arguments),this.pixelRatio=1,this.maxTotalNumberOfFeatures=5e4}};t([i()],d.prototype,"pixelRatio",void 0),t([i()],d.prototype,"maxTotalNumberOfFeatures",void 0),d=t([s("esri.views.3d.support.QualitySettings.HeatmapSettings")],d);let m=class extends e{constructor(){super(...arguments),this.maxTotalNumberOfStreamlines=1e5,this.maxTracingResolution=2048}};t([i()],m.prototype,"maxTotalNumberOfStreamlines",void 0),t([i()],m.prototype,"maxTracingResolution",void 0),m=t([s("esri.views.3d.support.QualitySettings.Flow3DSettings")],m);let u=class extends e{constructor(){super(...arguments),this.graphics3D=new r,this.sceneService=new l,this.tiledSurface=new n,this.gaussianSplat=new p,this.heatmap=new d,this.flow3D=new m,this.fadeDuration=o(400),this.antialiasingEnabled=!0,this.physicallyBasedRenderingEnabled=!1,this.highQualityTransparency=!0,this.highResolutionAtmosphere=!1,this.reflections=!1,this.ambientOcclusion=!1,this.glow=!1,this.maxTexturePixels=1/0,this.memoryLimit=750,this.additionalCacheMemory=0,this.frameRate=void 0,this.maximumPixelRatio=1/0}};t([i({type:r})],u.prototype,"graphics3D",void 0),t([i({type:l})],u.prototype,"sceneService",void 0),t([i({type:n})],u.prototype,"tiledSurface",void 0),t([i({type:p})],u.prototype,"gaussianSplat",void 0),t([i({type:d})],u.prototype,"heatmap",void 0),t([i({type:m})],u.prototype,"flow3D",void 0),t([i()],u.prototype,"fadeDuration",void 0),t([i()],u.prototype,"antialiasingEnabled",void 0),t([i()],u.prototype,"physicallyBasedRenderingEnabled",void 0),t([i()],u.prototype,"highQualityTransparency",void 0),t([i()],u.prototype,"highResolutionAtmosphere",void 0),t([i()],u.prototype,"reflections",void 0),t([i()],u.prototype,"ambientOcclusion",void 0),t([i()],u.prototype,"glow",void 0),t([i()],u.prototype,"maxTexturePixels",void 0),t([i()],u.prototype,"memoryLimit",void 0),t([i()],u.prototype,"additionalCacheMemory",void 0),t([i()],u.prototype,"frameRate",void 0),t([i()],u.prototype,"maximumPixelRatio",void 0),u=t([s("esri.views.3d.support.QualitySettings")],u);const c=u;export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{watch as t,sync as s}from"../../../../core/reactiveUtils.js";import{throttle as r}from"../../../../core/throttle.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{clone as a}from"../../../../geometry/support/aaBoundingRect.js";import{toFlowData as o}from"../../../2d/engine/flow/dataUtils.js";import n from"../../layers/FlowSubView3D.js";import{tilesWaitingTime as d}from"./constants.js";import{tileToKey as h,FlowDataTile as u}from"./loadUtils.js";import{isRasterTile as g}from"../../terrain/TerrainData.js";let c=class extends n{constructor(e){super(e),this._resetTileData=!0,this._throttledTriggerLoad=null,this._throttling=!1}initialize(){this.addHandles([this.surface.on("tile-data-changed",({tile:e,layerIndex:t,layerClass:s})=>{null!=this.renderedTiles&&this.loadByTileTreesAllowed&&t===this._layerIndex&&1===s&&this._updateFlowDataTile(e)}),t(()=>this.renderedTiles,e=>{const t=this.frameTask.scheduleGenerator(t=>this._updateFlowDataTiles(e,t));this.updatingHandles.addPromise(t)},s)]),this._throttledTriggerLoad=r(()=>{super.triggerLoad(),this._throttling=!1},()=>this._throttling=!0,d,this),this.addHandles(this._throttledTriggerLoad)}async*_updateFlowDataTiles(e,t){const s=f();for(const r of e??[]){const e=this._flowDataTiles?.get(h(r)),i=null==e||"delete"===e||"waiting"===e?this._getFlowDataCopy(r):e;null!=i&&s.set(h(r),i),t.madeProgress(),t.done&&(t=yield)}this._flowDataTiles=s,this._resetTileData=!0,this.triggerLoad()}abort(){super.abort(),this._throttling=!1}get _layerIndex(){return this.surface.getLayerIndexByUID(1,this.layerView.uid)}get loadByTileTreesAllowed(){return super.loadByTileTreesAllowed||!this._allTilesLoaded}doRefresh(){const{_flowDataTiles:e}=this;null!=e&&(e.forEach((t,s)=>{e.set(s,"waiting")}),super.doRefresh())}triggerLoad(){const{_throttledTriggerLoad:e}=this;this._allTilesLoaded?(e.hasPendingUpdates()||e(),e.forceUpdate()):e()}async fetchDataAndGenerateStreamlines(e,t){const{_flowDataTiles:s,needsMagnitude:r,workerHandle:i}=this,l=this.getSimulationSettings(e);if(null==l||null==i||null==s)return;const a=this._resetTileData;this._resetTileData=!1;const o=f();s.forEach((e,t)=>{"delete"===e?(o.set(t,"delete"),s.delete(t)):(a||"on-worker"!==e&&"waiting"!==e)&&(o.set(t,e),s.set(t,"on-worker"))});const n={simulationSettings:l,flowExtentInfo:e.flowExtentInfo,flowDataTiles:o,pixelSize:this.surface.tilingScheme.pixelSize,reset:a,needsMagnitude:r,startPositions:this.startPositions(e)},{streamlines:d}=await i.generateTiledStreamlines(n,t);return d}getUpdating(){return super.getUpdating()||this._throttling}_getFlowDataCopy(e){const{_layerIndex:t}=this,s=null==e.surface;if(null==t||s)return null;const r=e.getLayerInfo(t,1);if(null==r)return null;if(!e.visible&&null==r.requestAbort)return r.requestAbort=new AbortController,this.surface.requestTileData(e,t,1,r.requestAbort),null;if(r.dataMissing||!e.hasLayerData(t,1))return null;const{data:i}=r;if(!g(i))return null;const l=o(this.layer.serviceRasterInfo.dataType,i.source),n=new Uint8Array(l.width*l.height);for(let a=0;a<n.length;a++)n[a]=l.mask[a];return new u(l.data,n,l.width,l.height,e.lij,a(e.extent))}_updateFlowDataTile(e){const t=this.renderedTiles?.has(e)?this._getFlowDataCopy(e)??"delete":"delete";this._setTileData(e,t)&&this.triggerLoad()}_setTileData(e,t){const{_flowDataTiles:s}=this;if(null==s)return!1;const r=h(e);return(null!=s.get(r)||"delete"!==t)&&(s.set(r,t),!0)}get _allTilesLoaded(){let e=0;for(const t of this._flowDataTiles?.values()??[])"delete"!==t&&"waiting"!==t&&e++;return e===this.renderedTiles?.size}get test(){return{...super.test,loadedTiles:this._flowDataTiles??f()}}};function f(){return new Map}e([i()],c.prototype,"_throttling",void 0),c=e([l("esri.views.3d.support.flow.FlowSubViewTiles3D")],c);export{c as default};
5
+ import{__decorate as e}from"tslib";import{watch as t,sync as s}from"../../../../core/reactiveUtils.js";import{throttle as i}from"../../../../core/throttle.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{clone as l}from"../../../../geometry/support/aaBoundingRect.js";import{toFlowData as o}from"../../../2d/engine/flow/dataUtils.js";import n from"../../layers/FlowSubView3D.js";import{tilesWaitingTime as d}from"./constants.js";import{tileToKey as h,FlowDataTile as u}from"./loadUtils.js";import{isRasterTile as g}from"../../terrain/TerrainData.js";let c=class extends n{constructor(e){super(e),this._resetTileData=!0,this._throttledTriggerLoad=null,this._throttling=!1}initialize(){this.addHandles([this.surface.on("tile-data-changed",({tile:e,layerIndex:t,layerClass:s})=>{null!=this.renderedTiles&&this.loadByTileTreesAllowed&&t===this._layerIndex&&1===s&&this._updateFlowDataTile(e)}),t(()=>this.renderedTiles,e=>{const t=this.frameTask.scheduleGenerator(t=>this._updateFlowDataTiles(e,t));this.updatingHandles.addPromise(t)},s),t(()=>this._pixelSize,()=>{this.invalidateTileData(),this._resetTileData=!0},s)]),this._throttledTriggerLoad=i(()=>{super.triggerLoad(),this._throttling=!1},()=>this._throttling=!0,d,this),this.addHandles(this._throttledTriggerLoad)}async*_updateFlowDataTiles(e,t){const s=p();for(const i of e??[]){const e=this._flowDataTiles?.get(h(i)),r=null==e||"delete"===e||"waiting"===e?this._getFlowDataCopy(i):e;null!=r&&s.set(h(i),r),t.madeProgress(),t.done&&(t=yield)}this._flowDataTiles=s,this._resetTileData=!0,this.triggerLoad()}abort(){super.abort(),this._throttling=!1}get _layerIndex(){return this.surface.getLayerIndexByUID(1,this.layerView.uid)}get loadByTileTreesAllowed(){return super.loadByTileTreesAllowed||!this._allTilesLoaded}get _pixelSize(){return this.surface.tilingScheme.pixelSize}doRefresh(){this.invalidateTileData(),super.doRefresh()}triggerLoad(){const{_throttledTriggerLoad:e}=this;this._allTilesLoaded?(e.hasPendingUpdates()||e(),e.forceUpdate()):e()}async fetchDataAndGenerateStreamlines(e,t){const{_flowDataTiles:s,needsMagnitude:i,workerHandle:r}=this,a=this.getSimulationSettings(e);if(null==a||null==r||null==s)return;const l=this._resetTileData;this._resetTileData=!1;const o=p();s.forEach((e,t)=>{"delete"===e?(o.set(t,"delete"),s.delete(t)):(l||"on-worker"!==e&&"waiting"!==e)&&(o.set(t,e),s.set(t,"on-worker"))});const n={simulationSettings:a,flowExtentInfo:e.flowExtentInfo,flowDataTiles:o,pixelSize:this._pixelSize,reset:l,needsMagnitude:i,startPositions:this.startPositions(e)},{streamlines:d}=await r.generateTiledStreamlines(n,t);return d}getUpdating(){return super.getUpdating()||this._throttling}_getFlowDataCopy(e){const{_layerIndex:t}=this,s=null==e.surface;if(null==t||s)return null;const i=e.getLayerInfo(t,1);if(null==i)return null;if(!e.visible&&null==i.requestAbort)return i.requestAbort=new AbortController,this.surface.requestTileData(e,t,1,i.requestAbort),null;if(i.dataMissing||!e.hasLayerData(t,1))return null;const{data:r}=i;if(!g(r))return null;const a=o(this.layer.serviceRasterInfo.dataType,r.source),n=new Uint8Array(a.width*a.height);for(let l=0;l<n.length;l++)n[l]=a.mask[l];return new u(a.data,n,a.width,a.height,e.lij,l(e.extent))}_updateFlowDataTile(e){const t=this.renderedTiles?.has(e)?this._getFlowDataCopy(e)??"delete":"delete";this._setTileData(e,t)&&this.triggerLoad()}_setTileData(e,t){const{_flowDataTiles:s}=this;if(null==s)return!1;const i=h(e);return(null!=s.get(i)||"delete"!==t)&&(s.set(i,t),!0)}get _allTilesLoaded(){let e=0;for(const t of this._flowDataTiles?.values()??[])"delete"!==t&&"waiting"!==t&&e++;return e===this.renderedTiles?.size}invalidateTileData(){const{_flowDataTiles:e}=this;e?.forEach((t,s)=>{e.set(s,"waiting")})}get usedMemory(){const e=9*this._pixelSize**2,t=(this._flowDataTiles?.size??0)*e;return super.usedMemory+t}get test(){return{...super.test,loadedTiles:this._flowDataTiles??p()}}};function p(){return new Map}e([r()],c.prototype,"_throttling",void 0),c=e([a("esri.views.3d.support.flow.FlowSubViewTiles3D")],c);export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{Seconds as e}from"../../../../core/time.js";import{FlowQuery3D as t}from"./FlowQuery3D.js";class i{constructor(e,t,i,r){this._query=e,this.streamlines=t,this._material=i,this.geometries=r,this._startTime=0,this._endTime=1/0,this.startTime=this._query.time}get startTime(){return this._startTime}set startTime(i){this._query.time!==i&&(this._query=new t(this._query.extent,this._query.timeExtent,this._query.size,this._query.pixelRatio,e(i))),this._startTime=i,this.setMaterialParameters({startTime:i})}get endTime(){return this._endTime}set endTime(e){this._endTime=e,this.setMaterialParameters({endTime:e})}get query(){return this._query}hasFadedOut(e){return this.endTime+this._material.parameters.fadeOutTime<e}setMaterialParameters(e){this._material.setParameters(e)}get test(){return null}}export{i as StreamlineResources3D};
5
+ import"../../../../core/has.js";import{estimateNestedObjectMemory as e}from"../../../../core/memoryEstimations.js";import{Seconds as t}from"../../../../core/time.js";import{FlowQuery3D as s}from"./FlowQuery3D.js";class i{constructor(e,t,s,i,r){this._query=e,this.streamlines=t,this._material=s,this.geometries=i,this._bytesPerFeature=r,this._startTime=0,this._endTime=1/0,this.usedMemory=null,this.startTime=this._query.time,this.computeMemory()}computeMemory(){const t=e(this.streamlines),s=e(this.geometries.map(e=>e.attributes)),i=this.streamlines.length*this._bytesPerFeature;this.usedMemory=t+s+i}get startTime(){return this._startTime}set startTime(e){this._query.time!==e&&(this._query=new s(this._query.extent,this._query.timeExtent,this._query.size,this._query.pixelRatio,t(e))),this._startTime=e,this.setMaterialParameters({startTime:e})}get endTime(){return this._endTime}set endTime(e){this._endTime=e,this.setMaterialParameters({endTime:e})}get query(){return this._query}hasFadedOut(e){return this.endTime+this._material.parameters.fadeOutTime<e}setMaterialParameters(e){this._material.setParameters(e)}get test(){return null}}export{i as StreamlineResources3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{removeMaybe as e,destroyMaybe as r}from"../../../../core/maybe.js";import{streamlinGeometryBatchSize as t}from"./constants.js";import{StreamlineResources3D as s}from"./StreamlineResources3D.js";import{RenderGeometry as i}from"../../webgl-engine/lib/RenderGeometry.js";import{TaskPriority as a}from"../../../support/Scheduler.js";class h extends s{constructor(e,r,t,s,i){super(e,r,t,s),this._layerView=i,this._drapeRenderer=null,this.drapeSourceType=2,this.updatePolicy=0,this.renderGroup=0,this._frameTask=null,this._renderGeometries=[]}get _view(){return this._layerView.view}get layer(){return this._layerView.layer}get fullOpacity(){return this._layerView.fullOpacity}get attached(){return null!=this._drapeRenderer}get destroyed(){return this.attached}async attach(){const{geometries:e}=this;null!=e&&(this.detach(),this._frameTask=this._view.resourceController.scheduler.registerTask(a.FLOW_GENERATOR),await this._frameTask.scheduleGenerator(r=>this._addGeometryToOverlay(e,r)))}async*_addGeometryToOverlay(e,r){this._drapeRenderer=this._view.overlayManager.registerGeometryDrapeSource(this);for(let s=0;s<e.length;s+=t){const a=e.slice(s,s+t).map(e=>new i(e));this._drapeRenderer.addGeometries(a,0),this._renderGeometries.push(...a),this._drapeRenderer.commitChanges(),r.madeProgress(),r.done&&(r=yield)}}detach(){this._frameTask=e(this._frameTask),this._drapeRenderer&&(this._drapeRenderer.removeGeometries(this._renderGeometries,2),this._drapeRenderer.commitChanges(),this._renderGeometries.length=0),this.attached&&this._view.overlayManager.unregisterDrapeSource(this),this._drapeRenderer=r(this._drapeRenderer)}}export{h as StreamlineResources3DOverlay};
5
+ import{removeMaybe as e,destroyMaybe as r}from"../../../../core/maybe.js";import{memoryEstimators as t}from"../../layers/graphics/defaultSymbolComplexity.js";import{streamlinGeometryBatchSize as s}from"./constants.js";import{StreamlineResources3D as i}from"./StreamlineResources3D.js";import{RenderGeometry as a}from"../../webgl-engine/lib/RenderGeometry.js";import{TaskPriority as o}from"../../../support/Scheduler.js";class d extends i{constructor(e,r,s,i,a){super(e,r,s,i,t.LINE_ROUND.draped.bytesPerFeature),this._layerView=a,this._drapeRenderer=null,this.drapeSourceType=2,this.updatePolicy=0,this.renderGroup=0,this._frameTask=null,this._renderGeometries=[]}get _view(){return this._layerView.view}get layer(){return this._layerView.layer}get fullOpacity(){return this._layerView.fullOpacity}get attached(){return null!=this._drapeRenderer}get destroyed(){return this.attached}async attach(){const{geometries:e}=this;null!=e&&(this.detach(),this._frameTask=this._view.resourceController.scheduler.registerTask(o.FLOW_GENERATOR),await this._frameTask.scheduleGenerator(r=>this._addGeometryToOverlay(e,r)))}async*_addGeometryToOverlay(e,r){this._drapeRenderer=this._view.overlayManager.registerGeometryDrapeSource(this);for(let t=0;t<e.length;t+=s){const i=e.slice(t,t+s).map(e=>new a(e));this._drapeRenderer.addGeometries(i,0),this._renderGeometries.push(...i),this._drapeRenderer.commitChanges(),r.madeProgress(),r.done&&(r=yield)}}detach(){this._frameTask=e(this._frameTask),this._drapeRenderer&&(this._drapeRenderer.removeGeometries(this._renderGeometries,2),this._drapeRenderer.commitChanges(),this._renderGeometries.length=0),this.attached&&this._view.overlayManager.unregisterDrapeSource(this),this._drapeRenderer=r(this._drapeRenderer)}}export{d as StreamlineResources3DOverlay};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{removeMaybe as e}from"../../../../core/maybe.js";import{streamlinGeometryBatchSize as t}from"./constants.js";import{StreamlineResources3D as s}from"./StreamlineResources3D.js";import{Object3D as r}from"../../webgl-engine/lib/Object3D.js";import{WebGLLayer as i}from"../../webgl-engine/lib/WebGLLayer.js";import{TaskPriority as a}from"../../../support/Scheduler.js";class o extends s{constructor(e,t,s,r,i){super(e,t,s,r),this._view=i,this._objects3D=[],this._engineLayer=null,this._frameTask=null}get attached(){return null!=this._engineLayer}async attach(){const{geometries:e}=this;null!=e&&(this.detach(),this._frameTask=this._view.resourceController.scheduler.registerTask(a.FLOW_GENERATOR),await this._frameTask.scheduleGenerator(t=>this._addGeometryToLayer(e,t)))}detach(){this.attached&&(this._engineLayer?.removeMany(this._objects3D),this._objects3D.forEach(e=>e.dispose()),this._objects3D=[],this._engineLayer=null,this._frameTask=e(this._frameTask))}async*_addGeometryToLayer(e,s){const{stage:a}=this._view,o=new i(a,{pickable:!1,updatePolicy:1});for(let i=0;i<e.length;i+=t){const a=new r({geometries:e.slice(i,i+t),castShadow:!1});o.add(a),this._objects3D.push(a),o.commit(),s.madeProgress(),s.done&&(s=yield)}this._engineLayer=o}}export{o as StreamlineResources3DShape};
5
+ import{removeMaybe as e}from"../../../../core/maybe.js";import{memoryEstimators as t}from"../../layers/graphics/defaultSymbolComplexity.js";import{streamlinGeometryBatchSize as s}from"./constants.js";import{StreamlineResources3D as r}from"./StreamlineResources3D.js";import{Object3D as i}from"../../webgl-engine/lib/Object3D.js";import{WebGLLayer as a}from"../../webgl-engine/lib/WebGLLayer.js";import{TaskPriority as o}from"../../../support/Scheduler.js";class n extends r{constructor(e,s,r,i,a){super(e,s,r,i,t.LINE_ROUND.bytesPerFeature),this._view=a,this._objects3D=[],this._engineLayer=null,this._frameTask=null}get attached(){return null!=this._engineLayer}async attach(){const{geometries:e}=this;null!=e&&(this.detach(),this._frameTask=this._view.resourceController.scheduler.registerTask(o.FLOW_GENERATOR),await this._frameTask.scheduleGenerator(t=>this._addGeometryToLayer(e,t)))}detach(){this.attached&&(this._engineLayer?.removeMany(this._objects3D),this._objects3D.forEach(e=>e.dispose()),this._engineLayer?.commit(),this._objects3D=[],this._engineLayer=null,this._frameTask=e(this._frameTask))}async*_addGeometryToLayer(e,t){const{stage:r}=this._view,o=new a(r,{pickable:!1,updatePolicy:1});for(let a=0;a<e.length;a+=s){const r=new i({geometries:e.slice(a,a+s),castShadow:!1});o.add(r),this._objects3D.push(r),o.commit(),t.madeProgress(),t.done&&(t=yield)}this._engineLayer=o}}export{n as StreamlineResources3DShape};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- const e=.1,o=1,t=1,c=1e3,n=!1,p=3,r=1,s=1.1,x=501;export{e as averageLoadingTimeSmoothingFactor,r as defaultTransitionDuration,t as fadeInTime,o as fadeOutTime,n as seamlessTransitionEnabled,x as streamlinGeometryBatchSize,s as thresholdForLoadingAllTiles,c as tilesWaitingTime,p as transitionDurationFactor};
5
+ const e=.1,o=1,t=1,c=1e3,n=!1,p=3,r=1,s=1.1,x=501,a=256;export{e as averageLoadingTimeSmoothingFactor,r as defaultTransitionDuration,t as fadeInTime,o as fadeOutTime,a as minimumTracingResolution,n as seamlessTransitionEnabled,x as streamlinGeometryBatchSize,s as thresholdForLoadingAllTiles,c as tilesWaitingTime,p as transitionDurationFactor};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import s from"../../../core/Accessor.js";import{createTask as i}from"../../../core/asyncUtils.js";import"../../../core/has.js";import{makeHandle as a}from"../../../core/handleUtils.js";import{ignoreAbortErrors as r,isAborted as o,throwIfAborted as n}from"../../../core/promiseUtils.js";import{watch as l,syncAndInitial as c}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as d}from"../../../core/support/UpdatingHandles.js";import m from"../../../layers/GraphicsLayer.js";import{getGraphicEffectiveElevationInfo as y}from"../../../support/elevationInfoUtils.js";import u from"../../../symbols/CIMSymbol.js";import g from"../../../symbols/SimpleLineSymbol.js";import _ from"../../../symbols/support/ElevationInfo.js";import{ExclusiveOperationManager as f}from"../ExclusiveOperationManager.js";import{isPolyline as k,isValidInputGraphic as v,isInternalGraphic as w}from"./elevationProfileGeometryUtils.js";import{ViewEventPriorities as b}from"../../input/InputManager.js";import{isCancelEvent as G}from"../../interactive/interactiveToolUtils.js";import S from"../../../widgets/Sketch/SketchViewModel.js";let M=class extends s{constructor(e){super(e),this._updatingHandles=new d,this._operationManager=new f}initialize(){const{view:e}=this;this._graphicsLayer=new m({listMode:"hide",internal:!0}),this._sketchViewModel=new S({layer:this._graphicsLayer,view:e,defaultCreateOptions:{mode:"click",hasZ:!0},updateOnGraphicClick:!1,defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{shapeOperation:"none"},toggleToolOnClick:!1,tool:"reshape"},polylineSymbol:this._lineSymbol,activeLineSymbol:this._lineSymbol}),this.addHandles([l(()=>({map:e.map,internalGraphicsLayer:this._graphicsLayer,state:this.state,geometryVisualizationVisible:this._analysis.viewOptions.geometryVisualizationVisible,visible:this.analysisViewData.visible}),({map:e,internalGraphicsLayer:t,state:s,geometryVisualizationVisible:i,visible:a})=>{L(e,t);const o=this.sketchGraphic;switch(o&&(o.visible=a),s){case"idle":case"reshaping-disabled":o&&!i&&(o.visible=!1),this._operationManager.stop(),this._ensureUpdatedSketchGraphic();break;case"reshaping":r(this._startReshape());break;case"awaiting-sketch":this.analysisViewData.interactive=!0}},c),l(()=>this._analysis.elevationInfo,e=>{this._graphicsLayer.elevationInfo=e},c)])}destroy(){this._operationManager.destroy(),this._sketchViewModel.destroy();const e=this._graphicsLayer;this.view.map?.remove(e),e.destroy()}get sketchGraphic(){return this._get("sketchGraphic")}set sketchGraphic(e){e!==this._get("sketchGraphic")&&(this._set("sketchGraphic",e),V(this._graphicsLayer,e),this._updateAnalysisFromSketchGraphic())}get state(){const{visible:e,interactive:t}=this.analysisViewData;if(!e)return"idle";switch(this._operationManager.currentOperationType){case"place":return this._sketchViewModel.createGraphic===this.sketchGraphic?"sketching":"awaiting-sketch";case"pick-feature":return"picking";default:return this._analysis.geometry?t?"reshaping":"reshaping-disabled":"idle"}}get updating(){return this._sketchViewModel.updating||this._updatingHandles.updating}get _analysis(){return this.analysisViewData.analysis}get _lineSymbol(){return j(this.view.type)}place(e){return this._operationManager.start("place",async t=>{const s=this._analysis.clone();this._ensureUpdatedSketchGraphic();const i=this._stashSketchGraphic(),n=this._sketchViewModel.on("create",e=>{switch(e.state){case"start":this.sketchGraphic=e.graphic,this._analysis.elevationInfo=this._graphicsLayer.elevationInfo,i.remove();break;case"active":this._updateAnalysisFromSketchGraphic();break;case"complete":this._updateAnalysisFromSketchGraphic(),t.stop();break;case"cancel":t.stop()}});t.handles.push(n,a(()=>(n.remove(),this._sketchViewModel.cancel(),this._updateAnalysisFromSketchGraphic(),this._analysis.valid?o(e)||s.equals(this._analysis)?t.reject():void t.resolve({}):(this._clear(),t.reject()))),i),this._graphicsLayer.elevationInfo=I,await this._updatingHandles.addPromise(r(this._sketchViewModel.create("polyline")))},e)}_stashSketchGraphic(){const e=this.sketchGraphic;if(!e)return a();const t=this._analysis.elevationInfo,s=new m({listMode:"hide",internal:!0,elevationInfo:t});return this.view.map.add(s),s.graphics.add(e),a(()=>{this.sketchGraphic===e&&(this._graphicsLayer.elevationInfo=t,this._graphicsLayer.add(e)),s.removeFromParent(),s.destroy()})}async pickFeature(e){return this._operationManager.start("pick-feature",async e=>{const{view:t}=this;t.closePopup();let s=null;const r=a=>{a.defer(async()=>{s?.abort(),s=i(async s=>{const{results:i}=await t.hitTest(a);n(s);let r=null;for(const e of i)if("graphic"===e.type&&v(e.graphic)&&!w(e.graphic)){r=e.graphic;break}r?(a.preventDefault(),a.stopPropagation(),this.sketchGraphic=null,this._analysis.geometry=r.geometry,this._analysis.elevationInfo=new _({...y(r)}),e.resolve({feature:r}),e.stop()):e.reject()}),await s.promise})},o=t=>{G(t)&&(e.reject(),e.stop())};e.handles.push(t.on("immediate-click",r,b.TOOL),t.on("key-down",o,b.TOOL),t.acquireCursor("crosshair","high"),a(()=>{s?.abort(),e.reject()})),t.focus()},e)}_startReshape(){return this._operationManager.start("reshape",async e=>{const t=()=>{const e=this._ensureUpdatedSketchGraphic();return e?(V(this._graphicsLayer,e),this._updatingHandles.addPromise(this._sketchViewModel.update(e,{tool:"reshape"}))):Promise.resolve()};if(!this._ensureUpdatedSketchGraphic())return;const s=this._sketchViewModel.on("update",s=>{this._updateAnalysisFromSketchGraphic(),"complete"===s.state&&("reshaping"===this.state?r(t()):e.resolve())});e.handles.push(s,a(()=>{s.remove(),this._sketchViewModel.cancel(),e.resolve()})),await t()})}_ensureUpdatedSketchGraphic(){const{geometry:e}=this._analysis;if(!e)return this.sketchGraphic=null,null;const s=this.sketchGraphic??=new t({symbol:this._lineSymbol,geometry:e});return s.geometry=e,s}_clear(){this.sketchGraphic=null,this._analysis.clear()}_updateAnalysisFromSketchGraphic(){let e=this.sketchGraphic?.geometry;k(e)||(e=null);const t=this._analysis;t.geometry!==e&&(t.geometry=e)}};function j(e){if("2d"===e){const e={type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",width:1.5};return new u({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{...e,effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,4],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],color:[0,0,0,255]},{...e,color:[255,255,255,255]}]}}})}return new g({color:[0,0,0,0]})}function L(e,t){t&&(t.removeFromParent(),e?.add(t))}function V({graphics:e},t){t?(e.includes(t)||e.add(t),1!==e.length&&e.removeMany(e.filter(e=>e!==t))):e.removeAll()}e([h({constructOnly:!0})],M.prototype,"analysisViewData",void 0),e([h({constructOnly:!0})],M.prototype,"view",void 0),e([h()],M.prototype,"sketchGraphic",null),e([h({nonNullable:!0})],M.prototype,"state",null),e([h()],M.prototype,"updating",null),e([h()],M.prototype,"_analysis",null),e([h()],M.prototype,"_lineSymbol",null),M=e([p("esri.views.analysis.ElevationProfile.ElevationProfileTool")],M);const I=new _({mode:"on-the-ground",offset:0});export{M as ElevationProfileTool};
5
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import s from"../../../core/Accessor.js";import{createTask as i}from"../../../core/asyncUtils.js";import a from"../../../core/Collection.js";import"../../../core/has.js";import{makeHandle as r}from"../../../core/handleUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{ignoreAbortErrors as n,isAborted as c,throwIfAborted as h}from"../../../core/promiseUtils.js";import{watch as l,syncAndInitial as p}from"../../../core/reactiveUtils.js";import{property as m}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as y}from"../../../core/support/UpdatingHandles.js";import u from"../../../layers/GraphicsLayer.js";import{getGraphicEffectiveElevationInfo as g}from"../../../support/elevationInfoUtils.js";import _ from"../../../symbols/CIMSymbol.js";import k from"../../../symbols/SimpleLineSymbol.js";import f from"../../../symbols/support/ElevationInfo.js";import{ExclusiveOperationManager as v}from"../ExclusiveOperationManager.js";import{isPolyline as b,isValidInputGraphic as w,isInternalGraphic as G}from"./elevationProfileGeometryUtils.js";import{ViewEventPriorities as S}from"../../input/InputManager.js";import{isCancelEvent as j}from"../../interactive/interactiveToolUtils.js";import M from"../../../widgets/Sketch/SketchViewModel.js";let L=class extends s{constructor(e){super(e),this._sketchViewModels=new a,this._updatingHandles=new y,this._operationManager=new v}initialize(){const{view:e}=this;this._graphicsLayer=new u({listMode:"hide",internal:!0}),this.addHandles([l(()=>({map:e.map,internalGraphicsLayer:this._graphicsLayer,state:this.state,geometryVisualizationVisible:this._analysis.viewOptions.geometryVisualizationVisible,visible:this.analysisViewData.visible}),({map:e,internalGraphicsLayer:t,state:s,geometryVisualizationVisible:i,visible:a})=>{I(e,t);const r=this.sketchGraphic;switch(r&&(r.visible=a),s){case"idle":case"reshaping-disabled":r&&!i&&(r.visible=!1),this._operationManager.stop(),this._ensureUpdatedSketchGraphic();break;case"reshaping":n(this._startReshape());break;case"awaiting-sketch":this.analysisViewData.interactive=!0}},p),l(()=>this._analysis.elevationInfo,e=>{this._graphicsLayer.elevationInfo=e},p)])}destroy(){this._operationManager.destroy(),this._sketchViewModels.drain(e=>o(e));const e=this._graphicsLayer;this.view.map?.remove(e),e.destroy()}get sketchGraphic(){return this._get("sketchGraphic")}set sketchGraphic(e){e!==this._get("sketchGraphic")&&(this._set("sketchGraphic",e),this._updateAnalysisFromSketchGraphic())}get state(){const{visible:e,interactive:t}=this.analysisViewData;if(!e)return"idle";switch(this._operationManager.currentOperationType){case"place":return this._sketching?"sketching":"awaiting-sketch";case"pick-feature":return"picking";default:return this._analysis.geometry?t?"reshaping":"reshaping-disabled":"idle"}}get updating(){return this._sketchViewModels.some(e=>e.updating)||this._updatingHandles.updating}get _sketching(){return this._sketchViewModels.some(e=>e.createGraphic===this.sketchGraphic)}get _analysis(){return this.analysisViewData.analysis}get _lineSymbol(){return V(this.view.type)}place(e){return this._operationManager.start("place",async t=>{const s=this._createSketchViewModel(),i=this._analysis.clone();this._ensureUpdatedSketchGraphic();const a=this.sketchGraphic,o=this._analysis.elevationInfo,h=r(()=>{this.sketchGraphic===a&&(this._graphicsLayer.elevationInfo=o)}),l=s.on("create",e=>{switch(e.state){case"start":this._graphicsLayer.removeAll(),this.sketchGraphic=e.graphic,this._analysis.elevationInfo=this._graphicsLayer.elevationInfo;break;case"active":this._updateAnalysisFromSketchGraphic();break;case"complete":this.sketchGraphic&&(this._updateAnalysisFromSketchGraphic(),this._addSketchGraphic(this.sketchGraphic)),t.stop();break;case"cancel":t.stop()}});t.handles.push(l,r(()=>(l.remove(),s.destroy(),this._sketchViewModels.remove(s),this._updateAnalysisFromSketchGraphic(),this._analysis.valid?c(e)||i.equals(this._analysis)?t.reject():void t.resolve({}):(this._clear(),t.reject()))),h),this._graphicsLayer.elevationInfo=O,await this._updatingHandles.addPromise(n(s.create("polyline")))},e)}async pickFeature(e){return this._operationManager.start("pick-feature",async e=>{const{view:t}=this;t.closePopup();let s=null;const a=a=>{a.defer(async()=>{s?.abort(),s=i(async s=>{const{results:i}=await t.hitTest(a);h(s);let r=null;for(const e of i)if("graphic"===e.type&&w(e.graphic)&&!G(e.graphic)){r=e.graphic;break}r?(a.preventDefault(),a.stopPropagation(),this.sketchGraphic=null,this._analysis.geometry=r.geometry,this._analysis.elevationInfo=new f({...g(r)}),e.resolve({feature:r}),e.stop()):e.reject()}),await s.promise})},o=t=>{j(t)&&(e.reject(),e.stop())};e.handles.push(t.on("immediate-click",a,S.TOOL),t.on("key-down",o,S.TOOL),t.acquireCursor("crosshair","high"),r(()=>{s?.abort(),e.reject()})),t.focus()},e)}_startReshape(){const e=this._createSketchViewModel();return this._sketchViewModels.add(e),this._operationManager.start("reshape",async t=>{const s=()=>{const t=this._ensureUpdatedSketchGraphic();return t?this._updatingHandles.addPromise(e.update(t,{tool:"reshape"})):Promise.resolve()};if(!this._ensureUpdatedSketchGraphic())return;const i=e.on("update",e=>{this._updateAnalysisFromSketchGraphic(),"complete"===e.state&&("reshaping"===this.state?n(s()):t.resolve())});t.handles.push(i,r(()=>{i.remove(),this._sketchViewModels.remove(e),e.destroy(),t.resolve()})),await s()})}_createSketchViewModel(){return new M({layer:this._graphicsLayer,view:this.view,defaultCreateOptions:{mode:"click",hasZ:!0},updateOnGraphicClick:!1,defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{shapeOperation:"none"},toggleToolOnClick:!1,tool:"reshape"},polylineSymbol:this._lineSymbol,activeLineSymbol:this._lineSymbol})}_ensureUpdatedSketchGraphic(){const{geometry:e}=this._analysis;if(!e)return this.sketchGraphic=null,this._graphicsLayer.removeAll(),null;const s=this.sketchGraphic??=new t({symbol:this._lineSymbol,geometry:e});return s.geometry=e,this._addSketchGraphic(s),s}_addSketchGraphic(e){const{graphics:t}=this._graphicsLayer;t.includes(e)||t.add(e),1!==t.length&&t.removeMany(t.filter(t=>t!==e))}_clear(){this.sketchGraphic=null,this._analysis.clear()}_updateAnalysisFromSketchGraphic(){let e=this.sketchGraphic?.geometry;b(e)||(e=null);const t=this._analysis;t.geometry!==e&&(t.geometry=e)}};function V(e){if("2d"===e){const e={type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",width:1.5};return new _({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{...e,effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,4],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],color:[0,0,0,255]},{...e,color:[255,255,255,255]}]}}})}return new k({color:[0,0,0,0]})}function I(e,t){t&&(t.removeFromParent(),e?.add(t))}e([m({constructOnly:!0})],L.prototype,"analysisViewData",void 0),e([m({constructOnly:!0})],L.prototype,"view",void 0),e([m()],L.prototype,"sketchGraphic",null),e([m({nonNullable:!0})],L.prototype,"state",null),e([m()],L.prototype,"updating",null),e([m()],L.prototype,"_sketching",null),e([m()],L.prototype,"_analysis",null),e([m()],L.prototype,"_lineSymbol",null),L=e([d("esri.views.analysis.ElevationProfile.ElevationProfileTool")],L);const O=new f({mode:"on-the-ground",offset:0});export{L as ElevationProfileTool};
@@ -0,0 +1,5 @@
1
+ import "../../../interfaces";
2
+
3
+ export type ElevationProfilePlacementResult = __esri.ElevationProfileTypes.ElevationProfilePlacementResult;
4
+ export type ElevationProfilePickResult = __esri.ElevationProfileTypes.ElevationProfilePickResult;
5
+ export type ElevationProfileEffectiveDisplayUnits = __esri.ElevationProfileTypes.ElevationProfileEffectiveDisplayUnits;
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ function n(){}export{n as __exported__};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../core/Error.js";import{makeHandle as r,handlesGroup as i,destroyHandle as o}from"../../core/handleUtils.js";import{destroyMaybe as a}from"../../core/maybe.js";import{on as s,whenOnce as l,watch as n,initial as d}from"../../core/reactiveUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import p from"../../layers/GraphicsLayer.js";import u from"../../views/draw/support/HighlightHelper.js";import{temporaryHighlightName as c}from"../../views/support/HighlightDefaults.js";import f from"./Edits.js";import w from"./MergeFeaturesWorkflowData.js";import y from"./Workflow.js";import{updateGraphicSymbolWhenRequired as g,makeMinimalAttributes as F}from"./workflowUtils.js";import{assertViewNot3D as v,assertMergeWorkflowCapabilities as _,assertMinimumFeatureCount as M,assertFeaturesAreFromSameLayer as k,InvalidKeyFeatureError as j}from"./support/errors.js";import{mergeFeatures as H}from"./support/mergeFeaturesUtils.js";import V from"../FeatureForm/FeatureFormViewModel.js";var b;const E=Symbol();let I=b=class extends y{constructor(e){super(e),this.type="merge-features",this._formViewModel=null,this._graphicsLayer=null,this._highlightHelper=null,this._webStyleCache=new Map}initialize(){const e=this.data.viewModel.view;this._highlightHelper=e?new u({view:e}):null,this._initializeFeatureFormViewModel(),this._initializeGraphicsLayer(),this._createAndInitializeEdits(this.data.keyFeature)}destroy(){const e=this._graphicsLayer,{view:t}=this.data.viewModel;t?.destroyed||t?.map.remove(e),this._graphicsLayer=a(this._graphicsLayer),this._formViewModel?.destroy(),this._highlightHelper?.destroy()}get formViewModel(){return this._formViewModel}get hasPendingEdits(){return!1}get layer(){return this.data.editorItem.layer}get parent(){return this.data.parent}static async create(e){const{applyEdits:t,applyEditsFeatureService:r,...i}=e,{editorItem:o,features:a}=i;if(v(i.viewModel,"merge-features"),_(o),M(a,2),k(a),i.keyFeature&&!a.includes(i.keyFeature))throw new j;const s=await H(a),l=new b({data:new w({...i,mergedGeometry:s}),onCommit:z(t)});return l._set("steps",S()),l}async enter(){}exit(){}isKeyFeature(e){return this.data.keyFeature===e}isTemporaryHighlightFeature(e){return this.data.temporaryHighlightFeature===e}async setKeyFeature(e){const{data:t}=this;if(e!==t.keyFeature){if(!t.features.includes(e))throw new j;t.keyFeature=e,await this._createAndInitializeEdits(e)}}async start(){return await super.start(),this._makeSketchController()}getFeatureTitle(e){return this.data.getFeatureTitle(e)}async _createAndInitializeEdits(e){const{data:t}=this,r=e.clone();r.geometry=t.mergedGeometry;const i=new f({feature:r});t.edits=i,i.trackChanges(e),await this._setFeatureOnFormViewModel(r)}_initializeFeatureFormViewModel(){const{data:e,_webStyleCache:t}=this,r=e.viewModel.view,i=new V({disabled:!0,editType:"UPDATE",formTemplate:e.editorItem.formTemplate,highlightHelper:this._highlightHelper,map:r?.map,spatialReference:r?.spatialReference,timeZone:e.timeZone});this._formViewModel=i,this.addHandles(s(()=>i,"value-change",({feature:i,fieldName:o,value:a})=>{const s=e.edits;i&&s&&(s.setAttribute(o,a),g(i,t,r?.scale))}))}_initializeGraphicsLayer(){const{data:e}=this,{view:t}=e.viewModel,r=new p({elevationInfo:e.editorItem.layer.elevationInfo,internal:!0,listMode:"hide",title:"mergeFeaturesWorkflow-internal"});this._graphicsLayer=r,t?.map.add(r)}_makeSketchController(){return{enter:async()=>{this.addHandles(A(this.data),E)},exit:()=>{this.removeHandles(E)}}}async _setFeatureOnFormViewModel(e){const t=this._formViewModel;t.feature=e,await l(()=>!t.updating)}};e([h()],I.prototype,"formViewModel",null),e([h()],I.prototype,"hasPendingEdits",null),e([h()],I.prototype,"layer",null),e([h()],I.prototype,"parent",null),e([h()],I.prototype,"type",void 0),e([h()],I.prototype,"_formViewModel",void 0),e([h()],I.prototype,"_graphicsLayer",void 0),e([h()],I.prototype,"_highlightHelper",void 0),I=b=e([m("esri.widgets.Editor.MergeFeaturesWorkflow")],I);const L=I;function S(){return[{id:"choosing-key-feature",async setUp(){},async tearDown(){}}]}function z(e){return async r=>{const{edits:i,keyFeature:o}=r,a=i?.feature?.cloneShallow(),s=r.editorItem.layer;if(!i||!a)throw new t("editing:missing-feature","Workflow data has no edits to submit.");i.attributesModified||(a.attributes=F(a,r.editorItem.layer));const l=[];for(const e of r.features){if(e===o)continue;const t=e.cloneShallow();t.attributes=F(t,s),t.geometry=null,l.push(t)}await e(s,{updateFeatures:[a],deleteFeatures:l})}}function A(e){const t=e.viewModel.view;if(!t)return r();const a=new u({view:t});for(const r of e.features)a.add(r);const s=new u({view:t,highlightName:c}),l=n(()=>e.keyFeature,e=>{s.removeAll(),s.add(e)},d),h=new u({view:t,highlightName:c}),m=n(()=>e.temporaryHighlightFeature,e=>{h.removeAll(),e&&h.add(e)});return i([o(a),l,o(s),m,o(h)])}export{L as default};
5
+ import{__decorate as e}from"tslib";import t from"../../core/Error.js";import{makeHandle as r,handlesGroup as i,destroyHandle as a}from"../../core/handleUtils.js";import{destroyMaybe as o}from"../../core/maybe.js";import{on as s,whenOnce as n,watch as l,initial as d}from"../../core/reactiveUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import p from"../../layers/GraphicsLayer.js";import c from"../../views/draw/support/HighlightHelper.js";import{temporaryHighlightName as u}from"../../views/support/HighlightDefaults.js";import w from"./Edits.js";import f from"./MergeFeaturesWorkflowData.js";import y from"./Workflow.js";import{updateGraphicSymbolWhenRequired as g,makeMinimalAttributes as F}from"./workflowUtils.js";import{assertViewNot3D as v,assertMergeWorkflowCapabilities as _,assertMinimumFeatureCount as M,assertFeaturesAreFromSameLayer as k,InvalidKeyFeatureError as j}from"./support/errors.js";import{mergeFeatures as V}from"./support/mergeFeaturesUtils.js";import b from"../FeatureForm/FeatureFormViewModel.js";var H;const A=Symbol();let E=H=class extends y{constructor(e){super(e),this.type="merge-features",this._formViewModel=null,this._graphicsLayer=null,this._highlightHelper=null,this._webStyleCache=new Map}initialize(){const e=this.data.viewModel.view;this._highlightHelper=e?new c({view:e}):null,this._initializeFeatureFormViewModel(),this._initializeGraphicsLayer(),this._createAndInitializeEdits(this.data.keyFeature)}destroy(){const e=this._graphicsLayer,{view:t}=this.data.viewModel;t?.destroyed||t?.map.remove(e),this._graphicsLayer=o(this._graphicsLayer),this._formViewModel?.destroy(),this._highlightHelper?.destroy()}get formViewModel(){return this._formViewModel}get hasPendingEdits(){return!1}get layer(){return this.data.editorItem.layer}get parent(){return this.data.parent}get shouldShowAttachments(){return this.data.editorItem.capabilities.attachments.enabled}static async create(e){const{applyEdits:t,applyEditsFeatureService:r,...i}=e,{editorItem:a,features:o}=i;if(v(i.viewModel,"merge-features"),_(a),M(o,2),k(o),i.keyFeature&&!o.includes(i.keyFeature))throw new j;const s=await V(o),n=new H({data:new f({...i,mergedGeometry:s}),onCommit:L(t)});return n._set("steps",S()),n}async enter(){this._configureAttachmentsViewModel()}exit(){}isKeyFeature(e){return this.data.keyFeature===e}isTemporaryHighlightFeature(e){return this.data.temporaryHighlightFeature===e}async setKeyFeature(e){const{data:t}=this;if(e!==t.keyFeature){if(!t.features.includes(e))throw new j;t.keyFeature=e,await this._createAndInitializeEdits(e)}}async start(){return await super.start(),this._makeSketchController()}getFeatureTitle(e){return this.data.getFeatureTitle(e)}async _createAndInitializeEdits(e){const{data:t}=this,r=e.clone();r.geometry=t.mergedGeometry;const i=new w({feature:r});t.edits=i,i.trackChanges(e),await this._setFeatureOnFormViewModel(r),this._setFeatureOnAttachmentsViewModel(e)}_initializeFeatureFormViewModel(){const{data:e,_webStyleCache:t}=this,r=e.viewModel.view,i=new b({disabled:!0,editType:"UPDATE",formTemplate:e.editorItem.formTemplate,highlightHelper:this._highlightHelper,map:r?.map,spatialReference:r?.spatialReference,timeZone:e.timeZone});this._formViewModel=i,this.addHandles(s(()=>i,"value-change",({feature:i,fieldName:a,value:o})=>{const s=e.edits;i&&s&&(s.setAttribute(a,o),g(i,t,r?.scale))}))}_initializeGraphicsLayer(){const{data:e}=this,{view:t}=e.viewModel,r=new p({elevationInfo:e.editorItem.layer.elevationInfo,internal:!0,listMode:"hide",title:"mergeFeaturesWorkflow-internal"});this._graphicsLayer=r,t?.map.add(r)}_makeSketchController(){return{enter:async()=>{this.addHandles(z(this.data),A)},exit:()=>{this.removeHandles(A)}}}async _setFeatureOnFormViewModel(e){const t=this._formViewModel;t.feature=e,await n(()=>!t.updating)}_configureAttachmentsViewModel(){const{data:e}=this,{keyFeature:t,viewModel:r}=e,{attachmentsViewModel:i}=r;i.set({capabilities:{editing:!1},graphic:t,filesEnabled:!1,mode:"view"})}_setFeatureOnAttachmentsViewModel(e){this.data.viewModel.attachmentsViewModel.graphic=e}};e([h()],E.prototype,"formViewModel",null),e([h()],E.prototype,"hasPendingEdits",null),e([h()],E.prototype,"layer",null),e([h()],E.prototype,"parent",null),e([h()],E.prototype,"shouldShowAttachments",null),e([h()],E.prototype,"type",void 0),e([h()],E.prototype,"_formViewModel",void 0),e([h()],E.prototype,"_graphicsLayer",void 0),e([h()],E.prototype,"_highlightHelper",void 0),E=H=e([m("esri.widgets.Editor.MergeFeaturesWorkflow")],E);const I=E;function S(){return[{id:"choosing-key-feature",async setUp(){},async tearDown(){}}]}function L(e){return async r=>{const{edits:i,keyFeature:a}=r,o=i?.feature?.cloneShallow(),s=r.editorItem.layer;if(!i||!o)throw new t("editing:missing-feature","Workflow data has no edits to submit.");i.attributesModified||(o.attributes=F(o,r.editorItem.layer));const n=[];for(const e of r.features){if(e===a)continue;const t=e.cloneShallow();t.attributes=F(t,s),t.geometry=null,n.push(t)}await e(s,{updateFeatures:[o],deleteFeatures:n})}}function z(e){const t=e.viewModel.view;if(!t)return r();const o=new c({view:t});for(const r of e.features)o.add(r);const s=new c({view:t,highlightName:u}),n=l(()=>e.keyFeature,e=>{s.removeAll(),s.add(e)},d),h=new c({view:t,highlightName:u}),m=l(()=>e.temporaryHighlightFeature,e=>{h.removeAll(),e&&h.add(e)});return i([a(o),n,a(s),m,a(h)])}export{I as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{substitute as e}from"../../../intl/substitute.js";import{css as t}from"../css.js";import{isCreateFeaturesWorkflow as o,isSplitFeatureWorkflow as i,isMergeFeaturesWorkflow as n,isUpdateFeaturesWorkflow as s,isBatchAttributeFormViewModel as a,isUpdateFeatureWorkflow as r}from"../workflowUtils.js";import{loadFooterActionsComponents as l,FooterActions as c}from"./FooterActions.js";import u from"./MergeFeaturesList.js";import{loadNoticesComponents as m,Notices as p}from"./Notices.js";import{loadPanelContentComponents as d,PanelContentSection as f,PanelContentSectionGroup as g,PanelContent as w}from"./PanelContent.js";import k from"./PendingFeatureList.js";import{loadCalciteComponents as h}from"../../support/componentsUtils.js";import{Heading as b,incrementHeadingLevel as v}from"../../support/Heading.js";import{classes as F}from"../../support/widgetUtils.js";import{tsx as y,tsxFragment as A}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const j=()=>Promise.all([h({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),action:()=>import("@esri/calcite-components/dist/components/calcite-action")}),l(),m(),d()]);function C(e){const{editorViewModel:r,headingLevel:l,messages:m,renderAttachments:d,renderFeatureForm:h,renderBatchAttributeForm:F,renderSketchToolbar:j}=e,{activeFeatureCount:C,activeLeafWorkflow:L,activeWorkflow:T,formViewModel:V}=r;if(!L||!T||!V)return null;const x=a(V),z=o(L)&&!L.data.selectedPendingFeature||i(L)&&!L.activeFeature,I=n(L),B="shouldShowAttachments"in L&&L.shouldShowAttachments&&!x&&!V.activeRelationshipInput&&!V.activeAssociationInput,D=x?V.activeForm.inputs:V.inputs,W=o(L)&&D.every(e=>!e.visible)&&!B,H=null!=r.featureFormViewModel?.activeAssociationInput,P=!z&&!W&&!H,U=s(L)?F:h,E=W?y(f,null,y(k,{headingLevel:l,key:"pending-feature-list",workflow:L})):y(A,null,y(p,{activeFeatureCount:C,messages:m,workflow:T}),I?y(f,{class:t.mergeFeaturesListSection,key:"panel-section-merge"},y(u,{headingLevel:l,key:"merge-features-list",workflow:L})):void 0,y(f,{key:"panel-content-section-main"},y(g,null,z?y(k,{headingLevel:l,key:"pending-feature-list",workflow:L}):U(),B?y("div",{key:"attachments"},y(b,{level:v(l)},m.attachments),d()):null)));return y(A,null,P?M(L,e):void 0,W?j?.():void 0,y(w,{key:"attribute-panel-content"},E),y(c,{buttons:S(e)}))}function M(e,o){const i=[],n="3d"===o.editorViewModel.view?.type;if(o.visibleElements.zoomToButton&&o.editorViewModel.canZoomTo&&i.push(y("calcite-action",{alignment:"center",appearance:"transparent",icon:"zoom-to-object",key:"zoom-to-button",onclick:()=>o.editorViewModel.zoomTo(),scale:"s",text:o.messages.zoomTo,title:o.messages.zoomTo})),r(e)&&e.editorItem.supportsSplitFeatureWorkflow&&!n&&o.onSplit){const{onSplit:e,messages:t}=o;i.push(y("calcite-action",{icon:"split-geometry",key:"split-button",onclick:e,scale:"s",text:t.split,title:t.split}))}if(s(e)&&e.supportsMergeFeaturesWorkflow&&!n&&o.onMerge){const{onMerge:e,messages:t}=o;i.push(y("calcite-action",{icon:"merge",key:"merge-button",onclick:e,scale:"s",text:t.mergeFeatures,title:t.mergeFeatures}))}return i.length>0?y("calcite-action-bar",{class:F(t.sketchContainer,t.updateActionBar),"data-testid":"update-feature-panel-action-bar",expandDisabled:!0,layout:"horizontal"},i):void 0}function S({editorViewModel:t,messages:o,messagesCommon:i,onDelete:n,onDeleteAssociation:s,onSave:a}){const{activeFeatureCount:r,activeLeafWorkflow:l,syncing:c}=t;if(!l)return[];const{page:u}=t;if("viewing-associated-features"===u||"viewing-associated-layers"===u)return[{appearance:"outline",onClick:()=>{const{featureFormViewModel:e}=t;null!=e?.associationId&&(e.associationId=null)},disabled:c,label:i.cancel,type:"button"}];const m=[],p=r>1?o.multiFeature:o.singleFeature,d=!l.allowSave||c,f=e(p[l.saveActionLabel],{count:r});m.push({appearance:"solid",onClick:a,disabled:d,label:f,type:"button"});const g={appearance:"outline",disabled:c,kind:"danger",label:e(p.delete,{count:r}),type:"button"};return t.shouldShowDeleteButton&&!t.featureFormHasAssociation&&n&&m.push({...g,onClick:n}),t.featureFormHasAssociation&&!t.shouldShowDeleteButton&&s&&m.push({...g,onClick:s,label:o.deleteAssociationTitle}),t.featureFormHasAssociation&&t.shouldShowDeleteButton&&s&&n&&m.push({...g,primaryLabel:i.delete,primaryText:i.delete,onClick:n,dropdownItems:[{onClick:s,label:o.deleteAssociationTitle}],type:"split-button"}),m}export{C as UpdateFeaturePanelContent,j as loadUpdateFeaturePanelContentComponents};
5
+ import{substitute as e}from"../../../intl/substitute.js";import{css as t}from"../css.js";import{isCreateFeaturesWorkflow as o,isSplitFeatureWorkflow as i,isMergeFeaturesWorkflow as n,isUpdateFeaturesWorkflow as s,isBatchAttributeFormViewModel as a,isUpdateFeatureWorkflow as r}from"../workflowUtils.js";import{loadFooterActionsComponents as l,FooterActions as c}from"./FooterActions.js";import u from"./MergeFeaturesList.js";import{loadNoticesComponents as p,Notices as m}from"./Notices.js";import{loadPanelContentComponents as d,PanelContentSection as f,PanelContentSectionGroup as g,PanelContent as k}from"./PanelContent.js";import w from"./PendingFeatureList.js";import{loadCalciteComponents as b}from"../../support/componentsUtils.js";import{Heading as v,incrementHeadingLevel as h}from"../../support/Heading.js";import{classes as F}from"../../support/widgetUtils.js";import{tsx as y,tsxFragment as j}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const A=()=>Promise.all([b({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),action:()=>import("@esri/calcite-components/dist/components/calcite-action")}),l(),p(),d()]);function C(e){const{editorViewModel:r,headingLevel:l,messages:p,renderAttachments:d,renderFeatureForm:b,renderBatchAttributeForm:F,renderSketchToolbar:A}=e,{activeFeatureCount:C,activeLeafWorkflow:S,activeWorkflow:T,formViewModel:V}=r;if(!S||!T||!V)return null;const x=a(V),z=o(S)&&!S.data.selectedPendingFeature||i(S)&&!S.activeFeature,I=n(S),B=S.shouldShowAttachments&&!x&&!V.activeRelationshipInput&&!V.activeAssociationInput,D=x?V.activeForm.inputs:V.inputs,W=o(S)&&D.every(e=>!e.visible)&&!B,H=null!=r.featureFormViewModel?.activeAssociationInput,P=!z&&!W&&!H,U=s(S)?F:b,E=W?y(f,null,y(w,{headingLevel:l,key:"pending-feature-list",workflow:S})):y(j,null,y(m,{activeFeatureCount:C,messages:p,workflow:T}),I?y(f,{class:t.mergeFeaturesListSection,key:"panel-section-merge"},y(u,{headingLevel:l,key:"merge-features-list",workflow:S})):void 0,y(f,{key:"panel-content-section-main"},y(g,null,z?y(w,{headingLevel:l,key:"pending-feature-list",workflow:S}):U(),B?y("div",{key:"attachments"},y(v,{level:h(l)},p.attachments),d()):null)));return y(j,null,P?M(S,e):void 0,W?A?.():void 0,y(k,{key:"attribute-panel-content"},E),y(c,{buttons:L(e)}))}function M(e,o){const i=[],n="3d"===o.editorViewModel.view?.type;if(o.visibleElements.zoomToButton&&o.editorViewModel.canZoomTo&&i.push(y("calcite-action",{alignment:"center",appearance:"transparent",icon:"zoom-to-object",key:"zoom-to-button",onclick:()=>o.editorViewModel.zoomTo(),scale:"s",text:o.messages.zoomTo,title:o.messages.zoomTo})),r(e)&&e.editorItem.supportsSplitFeatureWorkflow&&!n&&o.onSplit){const{onSplit:e,messages:t}=o;i.push(y("calcite-action",{icon:"split-geometry",key:"split-button",onclick:e,scale:"s",text:t.split,title:t.split}))}if(s(e)&&e.supportsMergeFeaturesWorkflow&&!n&&o.onMerge){const{onMerge:e,messages:t}=o;i.push(y("calcite-action",{icon:"merge",key:"merge-button",onclick:e,scale:"s",text:t.mergeFeatures,title:t.mergeFeatures}))}return i.length>0?y("calcite-action-bar",{class:F(t.sketchContainer,t.updateActionBar),"data-testid":"update-feature-panel-action-bar",expandDisabled:!0,layout:"horizontal"},i):void 0}function L({editorViewModel:t,messages:o,messagesCommon:i,onDelete:n,onDeleteAssociation:s,onSave:a}){const{activeFeatureCount:r,activeLeafWorkflow:l,syncing:c}=t;if(!l)return[];const{page:u}=t;if("viewing-associated-features"===u||"viewing-associated-layers"===u)return[{appearance:"outline",onClick:()=>{const{featureFormViewModel:e}=t;null!=e?.associationId&&(e.associationId=null)},disabled:c,label:i.cancel,type:"button"}];const p=[],m=r>1?o.multiFeature:o.singleFeature,d=!l.allowSave||c,f=e(m[l.saveActionLabel],{count:r});p.push({appearance:"solid",onClick:a,disabled:d,label:f,type:"button"});const g={appearance:"outline",disabled:c,kind:"danger",label:e(m.delete,{count:r}),type:"button"};return t.shouldShowDeleteButton&&!t.featureFormHasAssociation&&n&&p.push({...g,onClick:n}),t.featureFormHasAssociation&&!t.shouldShowDeleteButton&&s&&p.push({...g,onClick:s,label:o.deleteAssociationTitle}),t.featureFormHasAssociation&&t.shouldShowDeleteButton&&s&&n&&p.push({...g,primaryLabel:i.delete,primaryText:i.delete,onClick:n,dropdownItems:[{onClick:s,label:o.deleteAssociationTitle}],type:"split-button"}),p}export{C as UpdateFeaturePanelContent,A as loadUpdateFeaturePanelContentComponents};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{on as i,sync as n}from"../../core/reactiveUtils.js";import{renderingSanitizer as o}from"../../core/sanitizerUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{getEffectiveFieldAlias as a}from"../../editing/fieldUtils.js";import{convertDateFormatToIntlOptions as s,defaultFormatterOptionsNoTime as u,convertDateTimeFieldFormatToIntlOptions as p,defaultFormatterOptions as d}from"../../intl/date.js";import{formatNumber as m,convertNumberFormatToIntlOptions as c,convertNumberFieldFormatToIntlOptions as f}from"../../intl/number.js";import{isEditableLayer as h}from"../../layers/support/editableLayers.js";import{computeDomainFromTypes as y}from"../../layers/support/featureLayerUtils.js";import g from"../../layers/support/Field.js";import{defaultFieldFormat as v}from"../../layers/support/fieldFormatUtils.js";import{validateFieldValue as F,isDateField as _,isTimeOnlyField as C,isIntegerField as b,isNumericField as D,isStringField as I,isDateOnlyField as x,isTimestampOffsetField as O}from"../../layers/support/fieldUtils.js";import{isAnyDateField as T}from"../../smartMapping/support/utils.js";import{system as w}from"../../time/constants.js";import{getTimeZoneFormattingOptions as V}from"../../time/timeZoneUtils.js";import E from"../FeatureForm/FieldInput.js";import Z from"./Grid/EditorColumn.js";import{isIFeatureTableSupportedLayerWithFieldConfigurations as j,isEmptyStringOrWhitespace as L}from"./support/tableUtils.js";import{dateFieldsWithStringFieldValue as R,getLabelForDateFieldValue as S,valueIsInRange as N,dateTimeIsInRange as U,getUnixFieldValueFromDateComponents as A,getISOFieldValueFromDateComponents as q,normalizeTimeOnlyString as k,prepareISOFieldValueForDateComponents as z,prepareUnixFieldValueForDateComponents as B}from"../support/dateUtils.js";import{setFocus as H}from"../support/widgetUtils.js";const P={cancelEdit:"Escape"},M=Symbol(),W="esri-column",G={input:`${W}__cell-input`,inputContainer:`${W}__cell__input-container`};let $=class extends Z{constructor(e){super(e),this._activeFieldInput=null,this.cellValueFormatFunction=({root:e,rowData:t,value:i})=>{const{formatFunction:n}=this;if(n&&t){const{index:r,item:{attachments:l,feature:a,relatedRecords:s}}=t;return n({attachments:l,column:this,feature:a,field:this.field,index:r,relatedRecords:s,value:o.sanitize(i),virtualIndex:this.getVirtualRowIndex(e)})}if(null===i)return"&nbsp;";const{field:r}=this,l=this._getDomainForFeature(t?.item?.feature);if(l){const e=this._getComputedDomain(i,l);return"date"===r.type&&"range"===l.type?this._formatDateValueForDisplay(r,e):this._isNumericField&&"range"===l.type?m(parseFloat(i),this._numberFormatOptions):R.has(r.type)?"range"===l.type?o.sanitize(S(r,e)):o.sanitize(e):e}return"date"===r.type||R.has(r.type)?this._formatDateValueForDisplay(r,i):this._isNumericField?m(parseFloat(i),this._numberFormatOptions):o.sanitize(i)},this.cellValueValidatorFunction=({oldValue:e,value:i})=>{const{_effectiveRange:n,field:o}=this,{max:r,min:l}=n;if(this.effectiveRequired&&(null==i||""===i))return!1;if(this._isNumericField&&(F(o,i)||!N({max:r,min:l,value:i})))return t.getLogger(this).warn("value-exceeds-valid-range","Field value exceeds valid range. Attempted edit was rejected."),!1;if(this._isAnyDateOrTimeField){const e=o.type;if(!U({type:e,range:n,value:i}))return!1}return e!==i},this.field=null,this.formatFunction=null,this.inputRenderFunction=async({root:e,column:i,rowData:n})=>{if(this.editInfo||!this.effectiveEditable)return;const o=this.getCellValue(n),{field:r}=this;if("big-integer"===r.type&&F(r,o))return void t.getLogger(this).warn("value-exceeds-valid-range","Field value is beyond supported limit. Editing is disabled for this field value.");const l=n?.item.feature;if(!l)return;this._activeFieldInput=this._setUpFieldInput(l,o);const a=document.createElement("div");a.classList.add(G.inputContainer);const s=[],u="coded-value"===this._effectiveDomain?.type;if(this._isAnyDateOrTimeField&&!u){const e=document.createElement("div"),t=this._setUpDateComponents(o),i=this._setUpDateActionBar();t.forEach(t=>e.appendChild(t)),a.appendChild(e),a.appendChild(i),s.push(...t)}else{const e=this.createInputElement({value:o});a.appendChild(e),s.push(e)}this._set("editInfo",{column:i,inputs:s,root:e,rowData:n,oldValue:o}),this.removeCellContent(e),e.appendChild(a),this._syncRowEditingState(e,!0),this.grid?.generateCellPartNames();const p=s[0];await H(p),"selectText"in p&&await p.selectText()},this.layer=null,this.parseInputValueFunction=({inputs:e})=>{const{editInfo:t,field:i,includeTime:n}=this;if(!t||!e.length)return null;const o=e[0];if(this._isAnyDateOrTimeField){if("coded-value"===this._effectiveDomain?.type){if(null==o.value||""===o.value)return null;const e=String(o.value);return _(i)?parseFloat(e):e}const{timeZone:r}=this.effectiveTimeZoneOptions,l=t.oldValue??void 0;switch(i.type){case"date-only":{const e=o.value;return""!==e?e:null}case"time-only":{const e=k(o.value);return""!==e?e:null}case"timestamp-offset":{const t=n?e[1]:void 0,i=e.at(-1);return q({oldValue:l,dateComponent:o,timeComponent:t,timeZoneComponent:i,defaultTimeZone:r})}case"date":{const{max:t,min:i}=this._effectiveRange;return A({oldValue:l,dateComponent:o,timeComponent:e[1],timeZone:r,max:t,min:i})}}return null}const r=o.value,{effectiveRequired:l}=this;return l||null!=r&&""!==r?this._isNumericField?parseFloat(r):this._isStringField?r.trim():r:null},this.sortable=!0,this.store=null,this.template=null,this.view=null}get _effectiveDomain(){const e=this._activeFieldInput?.feature;return e?this._getDomainForFeature(e):null}get _effectiveRange(){return this._activeFieldInput?.range??{max:null,min:null}}get _isAnyDateOrTimeField(){const{field:e}=this;return T(e)||C(e)}get _isIntegerField(){return b(this.field)}get _isNumericField(){return D(this.field)}get _isStringField(){return I(this.field)}get _isSubtypeField(){const{layer:e}=this;if(e?.subtypeField){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1}get _layerWithFieldConfigurations(){const{layer:e}=this;return j(e)?e:null}get _dateTimeFormatOptions(){const{layerFieldConfigurationFormat:e,template:t}=this;return t?.format?.dateFormat?s(t.format.dateFormat):t?.input&&"includeTime"in t.input&&!1===t.input.includeTime?u:"date-time"===e?.type?p(e):this._isAnyDateOrTimeField?d:void 0}get _numberFormatOptions(){const{layerFieldConfigurationFormat:e,template:t}=this;return t?.format?c(t.format):"number"===e?.type?f(e):this._isNumericField?{useGrouping:!0,maximumFractionDigits:20}:void 0}get alias(){return a(this.field,this._layerWithFieldConfigurations)}get defaultValue(){return this.field?.defaultValue}get effectiveDescription(){const{description:e,field:t}=this,i=t.description,n=L(e)?L(i)?null:i:e;return null==n?null:o.sanitize(n)}get effectiveEditable(){const{editable:e,field:t,layer:i,tableEditingEnabled:n}=this;if(!t||!i)return!1;const o=h(i),r=i.effectiveCapabilities??i.capabilities,l=r?.operations?.supportsUpdate;return!!(t.editable&&o&&l&&"oid"!==t.type&&n)&&e}get effectiveLabel(){return o.sanitize(this.label||this.alias||this.fieldName)}get effectiveRequired(){return!this.nullable||this._isSubtypeField||this._activeFieldInput?.required||this.required}get effectiveSortable(){return!(!this.layer?.capabilities?.query?.supportsOrderBy||!this.sortable)}get effectiveTimeZoneOptions(){const{layer:e,field:t}=this;if(!e||"date"!==t?.type&&"timestamp-offset"!==t?.type)return{timeZone:void 0,timeZoneName:void 0};const{tableTimeZone:i,timeZone:n,view:o}=this;return V(e.preferredTimeZone||null,!!e.datesInUnknownTimezone,n??i??o?.timeZone??w,s("short-time"),t.type)}get includeTime(){const{field:e,template:t}=this;return"time-only"===e.type||"date-only"!==e.type&&(!t?.input||"includeTime"in t.input&&!1!==t.input.includeTime)}get layerFieldConfigurationFormat(){const{_layerWithFieldConfigurations:e}=this;if(e)return e.getFieldConfiguration(this.fieldName)?.fieldFormat??v(this.field)}get loadingMessage(){return this.messages?.loading||"..."}get maxLength(){const{field:e,template:t}=this,i=e?.length??-1,n=t?.input&&"maxLength"in t.input?t.input.maxLength:null;return null!=n&&!isNaN(n)&&n>=-1&&(-1===i||n<=i)?n:i}get minLength(){const{template:e,maxLength:t}=this,i=e?.input&&"minLength"in e.input?e.input.minLength:null;return t&&i<=t?i:null}get name(){return this.field?.name}get nullable(){return!1!==this.field.nullable}get shouldShowPrompt(){return this._isSubtypeField}createInputElement({value:e}){const{_effectiveDomain:t,maxLength:o,minLength:r,effectiveRequired:l}=this;let a;if("coded-value"===t?.type)a=this.createCalciteSelect(e,t.codedValues.map(({code:e,name:t})=>({value:e,name:t}))),this.addHandles([i(()=>a,"calciteSelectChange",()=>this.onInputBlur(),n)],M);else if(this._isNumericField){const{_effectiveRange:{max:t,min:i}}=this;a=document.createElement("calcite-input"),a.type="number",this._isIntegerField&&(a.step=1),null!=t&&(a.max=t),null!=i&&(a.min=i),a.status=N({max:t,min:i,value:e})?"idle":"invalid"}else a=document.createElement("calcite-input"),this.addHandles([i(()=>a,"calciteInputChange",()=>this.onInputBlur(),n)],M),o>-1&&(a.maxLength=o),r>0&&(a.minLength=r);return a.classList.add(G.input),a.required=l,a.value=null!=e?e.toString():"",this.addHandles([i(()=>a,"keydown",e=>{e.key===P.cancelEdit&&this.onInputBlur(!0)},n),i(()=>a,"blur",()=>this.onInputBlur(),n)],M),a}onInputBlur(e=!1){this.removeHandles(M),super.onInputBlur(e)}onEditComplete(){const e=this.editInfo?.root;e&&this._syncRowEditingState(e,!1),this._activeFieldInput=null,super.onEditComplete()}get test(){}_clearActiveEditValues(){this.editInfo?.inputs?.forEach(e=>e.value="")}_setUpDateActionBar(){const{messagesCommon:e}=this,t=e?.cancel??"",i=e?.clear??"",n=e?.save??"",o=document.createElement("calcite-action-bar");return o.expandDisabled=!0,o.layout="horizontal",o.appendChild(this.createCalciteAction({text:n,icon:"save",onclick:()=>this.submit()})),this.effectiveRequired||o.appendChild(this.createCalciteAction({text:i,icon:"trash",onclick:()=>{this._clearActiveEditValues(),this.submit()}})),o.appendChild(this.createCalciteAction({text:t,icon:"x",onclick:()=>this.cancel()})),o}_formatDateValueForDisplay(e,t){const{timeZone:i,timeZoneName:n}=this.effectiveTimeZoneOptions;return null!=t?S(e,t,{...this._dateTimeFormatOptions,timeZone:i,timeZoneName:n}):null}_setUpDateComponents(e){const{_effectiveRange:{max:t,min:n,rawMax:o,rawMin:r},field:l,effectiveRequired:a}=this,s=this._getDateFieldValuesForComponents(l,e),u=[];if(T(l)){const e=this.createDateComponent(),p=x(l)||O(l)?o:t,d=x(l)||O(l)?r:n,m=this._getDateFieldValuesForComponents(l,p??null),c=this._getDateFieldValuesForComponents(l,d??null);e.value=s.date??"",e.max=m.date??"",e.min=c.date??"",e.required=a,this.addHandles([i(()=>e,"calciteInputDatePickerOpen",()=>this._onDateComponentOpen(e))],M),u.push(e)}if(this.includeTime){const e=this.createTimeComponent();e.value=s.time??"",e.required=a,this.addHandles([i(()=>e,"calciteInputTimePickerOpen",()=>this._onDateComponentOpen(e))],M),u.push(e)}if("timestamp-offset"===l.type){const e=this.createTimeZoneComponent();e.value=s.timeZoneOffset??"0",this.addHandles([i(()=>e,"calciteInputTimeZoneOpen",()=>this._onDateComponentOpen(e))],M),u.push(e)}return u}_onDateComponentOpen(e){this.editInfo?.inputs.forEach(t=>{t!==e&&"open"in t&&(t.open=!1)})}_syncRowEditingState(e,t=!1){const i=this.grid?.getRowContainingNode(e);i&&(t?i.setAttribute("editing","true"):i.removeAttribute("editing"))}_getDateFieldValuesForComponents(e,t){switch(e.type){case"date":return B(t,this.effectiveTimeZoneOptions.timeZone);case"date-only":return{date:t};case"time-only":return{time:t};case"timestamp-offset":return z(t);default:return{}}}_setUpFieldInput(e,t){const{field:i,layer:n,effectiveTimeZoneOptions:{timeZone:o}}=this,r=new E({feature:e,field:i,initialFeature:e.clone(),layer:n,timeZone:o});return r.set("value",t),r}_isDomainCompatible(e){if(!e)return!1;const{_isNumericField:t,_isStringField:i}=this,{type:n}=e;if("coded-value"===n){const n=typeof e.codedValues[0].code;if("string"===n&&i||"number"===n&&t)return!0}return!("range"!==n||!t)}_getDomainForFeature(e){const{fieldName:t,layer:i,template:n}=this;if(!e||!i?.getFieldDomain)return null;if("wfs"===i.type||"geojson"===i.type||"csv"===i.type||"knowledge-graph-sublayer"===i.type)return null;if(n?.domain&&this._isDomainCompatible(n.domain))return n.domain;if("feature"!==i.type&&"subtype-group"!==i.type&&null==i.getField(t)?.domain){const e=y(i,t);if(e)return e}return i.getFieldDomain(t,{feature:e})}_getComputedDomain(e,t){if(!t)return null;if("range"===t.type)return e;if("coded-value"===t.type){const i=t.codedValues.filter(t=>t.hasOwnProperty("code")&&t.code===e);return i&&i.length?i[0].name:e}return null}};e([r()],$.prototype,"_effectiveDomain",null),e([r()],$.prototype,"_activeFieldInput",void 0),e([r()],$.prototype,"_effectiveRange",null),e([r()],$.prototype,"_isAnyDateOrTimeField",null),e([r()],$.prototype,"_isIntegerField",null),e([r()],$.prototype,"_isNumericField",null),e([r()],$.prototype,"_isStringField",null),e([r()],$.prototype,"_isSubtypeField",null),e([r()],$.prototype,"_layerWithFieldConfigurations",null),e([r()],$.prototype,"_dateTimeFormatOptions",null),e([r()],$.prototype,"_numberFormatOptions",null),e([r({readOnly:!0})],$.prototype,"alias",null),e([r()],$.prototype,"cellValueFormatFunction",void 0),e([r()],$.prototype,"cellValueValidatorFunction",void 0),e([r({readOnly:!0})],$.prototype,"defaultValue",null),e([r()],$.prototype,"effectiveDescription",null),e([r()],$.prototype,"effectiveEditable",null),e([r()],$.prototype,"effectiveLabel",null),e([r()],$.prototype,"effectiveRequired",null),e([r()],$.prototype,"effectiveSortable",null),e([r()],$.prototype,"effectiveTimeZoneOptions",null),e([r({type:g})],$.prototype,"field",void 0),e([r()],$.prototype,"formatFunction",void 0),e([r()],$.prototype,"includeTime",null),e([r()],$.prototype,"inputRenderFunction",void 0),e([r()],$.prototype,"layer",void 0),e([r()],$.prototype,"layerFieldConfigurationFormat",null),e([r({readOnly:!0})],$.prototype,"loadingMessage",null),e([r()],$.prototype,"maxLength",null),e([r()],$.prototype,"minLength",null),e([r({readOnly:!0})],$.prototype,"name",null),e([r({readOnly:!0})],$.prototype,"nullable",null),e([r()],$.prototype,"parseInputValueFunction",void 0),e([r()],$.prototype,"shouldShowPrompt",null),e([r()],$.prototype,"sortable",void 0),e([r()],$.prototype,"store",void 0),e([r()],$.prototype,"template",void 0),e([r()],$.prototype,"view",void 0),$=e([l("esri.widgets.FeatureTable.FieldColumn")],$);const J=$;export{J as default};
5
+ import{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{on as i,sync as n}from"../../core/reactiveUtils.js";import{renderingSanitizer as o}from"../../core/sanitizerUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import{getEffectiveFieldAlias as a}from"../../editing/fieldUtils.js";import{convertDateFormatToIntlOptions as s,defaultFormatterOptionsNoTime as u,convertDateTimeFieldFormatToIntlOptions as p,defaultFormatterOptions as d}from"../../intl/date.js";import{formatNumber as m,convertNumberFormatToIntlOptions as c,convertNumberFieldFormatToIntlOptions as f}from"../../intl/number.js";import{isEditableLayer as h}from"../../layers/support/editableLayers.js";import{computeDomainFromTypes as y}from"../../layers/support/featureLayerUtils.js";import g from"../../layers/support/Field.js";import{defaultFieldFormat as v}from"../../layers/support/fieldFormatUtils.js";import{validateFieldValue as F,isDateField as _,isTimeOnlyField as C,isIntegerField as b,isNumericField as D,isStringField as I,isDateOnlyField as x,isTimestampOffsetField as O}from"../../layers/support/fieldUtils.js";import{isAnyDateField as T}from"../../smartMapping/support/utils.js";import{system as w}from"../../time/constants.js";import{getTimeZoneFormattingOptions as V}from"../../time/timeZoneUtils.js";import E from"../FeatureForm/FieldInput.js";import Z from"./Grid/EditorColumn.js";import{isIFeatureTableSupportedLayerWithFieldConfigurations as j,isEmptyStringOrWhitespace as L}from"./support/tableUtils.js";import{dateFieldsWithStringFieldValue as R,valueIsInRange as S,dateTimeIsInRange as N,getUnixFieldValueFromDateComponents as A,getISOFieldValueFromDateComponents as U,normalizeTimeOnlyString as q,getLabelForDateFieldValue as k,prepareISOFieldValueForDateComponents as B,prepareUnixFieldValueForDateComponents as z}from"../support/dateUtils.js";import{setFocus as H}from"../support/widgetUtils.js";const P={cancelEdit:"Escape"},M=Symbol(),W="esri-column",G={input:`${W}__cell-input`,inputContainer:`${W}__cell__input-container`};let $=class extends Z{constructor(e){super(e),this._activeFieldInput=null,this.cellValueFormatFunction=({root:e,rowData:t,value:i})=>{const{formatFunction:n}=this;if(n&&t){const{index:l,item:{attachments:r,feature:a,relatedRecords:s}}=t;return n({attachments:r,column:this,feature:a,field:this.field,index:l,relatedRecords:s,value:o.sanitize(i),virtualIndex:this.getVirtualRowIndex(e)})}if(null===i)return"&nbsp;";const{field:l}=this,r=this._getDomainForFeature(t?.item?.feature);if(r){const e=this._getComputedDomain(i,r);return this._isAnyDateOrTimeField&&"range"===r.type?this._formatDateValueForDisplay(l,e):this._isNumericField&&"range"===r.type?m(parseFloat(i),this._numberFormatOptions):R.has(l.type)?o.sanitize(e):e}return this._isAnyDateOrTimeField?this._formatDateValueForDisplay(l,i):this._isNumericField?m(parseFloat(i),this._numberFormatOptions):o.sanitize(i)},this.cellValueValidatorFunction=({oldValue:e,value:i})=>{const{_effectiveRange:n,field:o}=this,{max:l,min:r}=n;if(this.effectiveRequired&&(null==i||""===i))return!1;if(this._isNumericField&&(F(o,i)||!S({max:l,min:r,value:i})))return t.getLogger(this).warn("value-exceeds-valid-range","Field value exceeds valid range. Attempted edit was rejected."),!1;if(this._isAnyDateOrTimeField){const e=o.type;if(!N({type:e,range:n,value:i}))return!1}return e!==i},this.field=null,this.formatFunction=null,this.inputRenderFunction=async({root:e,column:i,rowData:n})=>{if(this.editInfo||!this.effectiveEditable)return;const o=this.getCellValue(n),{field:l}=this;if("big-integer"===l.type&&F(l,o))return void t.getLogger(this).warn("value-exceeds-valid-range","Field value is beyond supported limit. Editing is disabled for this field value.");const r=n?.item.feature;if(!r)return;this._activeFieldInput=this._setUpFieldInput(r,o);const a=document.createElement("div");a.classList.add(G.inputContainer);const s=[],u="coded-value"===this._effectiveDomain?.type;if(this._isAnyDateOrTimeField&&!u){const e=document.createElement("div"),t=this._setUpDateComponents(o),i=this._setUpDateActionBar();t.forEach(t=>e.appendChild(t)),a.appendChild(e),a.appendChild(i),s.push(...t)}else{const e=this.createInputElement({value:o});a.appendChild(e),s.push(e)}this._set("editInfo",{column:i,inputs:s,root:e,rowData:n,oldValue:o}),this.removeCellContent(e),e.appendChild(a),this._syncRowEditingState(e,!0),this.grid?.generateCellPartNames();const p=s[0];await H(p),"selectText"in p&&await p.selectText()},this.layer=null,this.parseInputValueFunction=({inputs:e})=>{const{editInfo:t,field:i,includeTime:n}=this;if(!t||!e.length)return null;const o=e[0];if(this._isAnyDateOrTimeField){if("coded-value"===this._effectiveDomain?.type){if(null==o.value||""===o.value)return null;const e=String(o.value);return _(i)?parseFloat(e):e}const{timeZone:l}=this.effectiveTimeZoneOptions,r=t.oldValue??void 0;switch(i.type){case"date-only":{const e=o.value;return""!==e?e:null}case"time-only":{const e=q(o.value);return""!==e?e:null}case"timestamp-offset":{const t=n?e[1]:void 0,i=e.at(-1);return U({oldValue:r,dateComponent:o,timeComponent:t,timeZoneComponent:i,defaultTimeZone:l})}case"date":{const{max:t,min:i}=this._effectiveRange;return A({oldValue:r,dateComponent:o,timeComponent:e[1],timeZone:l,max:t,min:i})}}return null}const l=o.value,{effectiveRequired:r}=this;return r||null!=l&&""!==l?this._isNumericField?parseFloat(l):this._isStringField?l.trim():l:null},this.sortable=!0,this.store=null,this.template=null,this.view=null}get _effectiveDomain(){const e=this._activeFieldInput?.feature;return e?this._getDomainForFeature(e):null}get _effectiveRange(){return this._activeFieldInput?.range??{max:null,min:null}}get _isAnyDateOrTimeField(){const{field:e}=this;return T(e)||C(e)}get _isIntegerField(){return b(this.field)}get _isNumericField(){return D(this.field)}get _isStringField(){return I(this.field)}get _isSubtypeField(){const{layer:e}=this;if(e?.subtypeField){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1}get _layerWithFieldConfigurations(){const{layer:e}=this;return j(e)?e:null}get _dateTimeFormatOptions(){const{layerFieldConfigurationFormat:e,template:t}=this;return t?.format?.dateFormat?s(t.format.dateFormat):t?.input&&"includeTime"in t.input&&!1===t.input.includeTime?u:"date-time"===e?.type?p(e):this._isAnyDateOrTimeField?d:void 0}get _numberFormatOptions(){const{layerFieldConfigurationFormat:e,template:t}=this;return t?.format?c(t.format):"number"===e?.type?f(e):this._isNumericField?{useGrouping:!0,maximumFractionDigits:20}:void 0}get alias(){return a(this.field,this._layerWithFieldConfigurations)}get defaultValue(){return this.field?.defaultValue}get effectiveDescription(){const{description:e,field:t}=this,i=t.description,n=L(e)?L(i)?null:i:e;return null==n?null:o.sanitize(n)}get effectiveEditable(){const{editable:e,field:t,layer:i,tableEditingEnabled:n}=this;if(!t||!i)return!1;const o=h(i),l=i.effectiveCapabilities??i.capabilities,r=l?.operations?.supportsUpdate;return!!(t.editable&&o&&r&&"oid"!==t.type&&n)&&e}get effectiveLabel(){return o.sanitize(this.label||this.alias||this.fieldName)}get effectiveRequired(){return!this.nullable||this._isSubtypeField||this._activeFieldInput?.required||this.required}get effectiveSortable(){return!(!this.layer?.capabilities?.query?.supportsOrderBy||!this.sortable)}get effectiveTimeZoneOptions(){const{layer:e,field:t}=this;if(!e||"date"!==t?.type&&"timestamp-offset"!==t?.type)return{timeZone:void 0,timeZoneName:void 0};const{tableTimeZone:i,timeZone:n,view:o}=this;return V(e.preferredTimeZone||null,!!e.datesInUnknownTimezone,n??i??o?.timeZone??w,s("short-time"),t.type)}get includeTime(){const{field:e,template:t}=this;return"time-only"===e.type||"date-only"!==e.type&&(!t?.input||"includeTime"in t.input&&!1!==t.input.includeTime)}get layerFieldConfigurationFormat(){const{_layerWithFieldConfigurations:e}=this;if(e)return e.getFieldConfiguration(this.fieldName)?.fieldFormat??v(this.field)}get loadingMessage(){return this.messages?.loading||"..."}get maxLength(){const{field:e,template:t}=this,i=e?.length??-1,n=t?.input&&"maxLength"in t.input?t.input.maxLength:null;return null!=n&&!isNaN(n)&&n>=-1&&(-1===i||n<=i)?n:i}get minLength(){const{template:e,maxLength:t}=this,i=e?.input&&"minLength"in e.input?e.input.minLength:null;return t&&i<=t?i:null}get name(){return this.field?.name}get nullable(){return!1!==this.field.nullable}get shouldShowPrompt(){return this._isSubtypeField}createInputElement({value:e}){const{_effectiveDomain:t,maxLength:o,minLength:l,effectiveRequired:r}=this;let a;if("coded-value"===t?.type)a=this.createCalciteSelect(e,t.codedValues.map(({code:e,name:t})=>({value:e,name:t}))),this.addHandles([i(()=>a,"calciteSelectChange",()=>this.onInputBlur(),n)],M);else if(this._isNumericField){const{_effectiveRange:{max:t,min:i}}=this;a=document.createElement("calcite-input"),a.type="number",this._isIntegerField&&(a.step=1),null!=t&&(a.max=t),null!=i&&(a.min=i),a.status=S({max:t,min:i,value:e})?"idle":"invalid"}else a=document.createElement("calcite-input"),this.addHandles([i(()=>a,"calciteInputChange",()=>this.onInputBlur(),n)],M),o>-1&&(a.maxLength=o),l>0&&(a.minLength=l);return a.classList.add(G.input),a.required=r,a.value=null!=e?e.toString():"",this.addHandles([i(()=>a,"keydown",e=>{e.key===P.cancelEdit&&this.onInputBlur(!0)},n),i(()=>a,"blur",()=>this.onInputBlur(),n)],M),a}onInputBlur(e=!1){this.removeHandles(M),super.onInputBlur(e)}onEditComplete(){const e=this.editInfo?.root;e&&this._syncRowEditingState(e,!1),this._activeFieldInput=null,super.onEditComplete()}get test(){}_clearActiveEditValues(){this.editInfo?.inputs?.forEach(e=>e.value="")}_setUpDateActionBar(){const{messagesCommon:e}=this,t=e?.cancel??"",i=e?.clear??"",n=e?.save??"",o=document.createElement("calcite-action-bar");return o.expandDisabled=!0,o.layout="horizontal",o.appendChild(this.createCalciteAction({text:n,icon:"save",onclick:()=>this.submit()})),this.effectiveRequired||o.appendChild(this.createCalciteAction({text:i,icon:"trash",onclick:()=>{this._clearActiveEditValues(),this.submit()}})),o.appendChild(this.createCalciteAction({text:t,icon:"x",onclick:()=>this.cancel()})),o}_formatDateValueForDisplay(e,t){const{timeZone:i,timeZoneName:n}=this.effectiveTimeZoneOptions;return null!=t?k(e,t,{...this._dateTimeFormatOptions,timeZone:i,timeZoneName:n}):null}_setUpDateComponents(e){const{_effectiveRange:{max:t,min:n,rawMax:o,rawMin:l},field:r,effectiveRequired:a}=this,s=this._getDateFieldValuesForComponents(r,e),u=[];if(T(r)){const e=this.createDateComponent(),p=x(r)||O(r)?o:t,d=x(r)||O(r)?l:n,m=this._getDateFieldValuesForComponents(r,p??null),c=this._getDateFieldValuesForComponents(r,d??null);e.value=s.date??"",e.max=m.date??"",e.min=c.date??"",e.required=a,this.addHandles([i(()=>e,"calciteInputDatePickerOpen",()=>this._onDateComponentOpen(e))],M),u.push(e)}if(this.includeTime){const e=this.createTimeComponent();e.value=s.time??"",e.required=a,this.addHandles([i(()=>e,"calciteInputTimePickerOpen",()=>this._onDateComponentOpen(e))],M),u.push(e)}if("timestamp-offset"===r.type){const e=this.createTimeZoneComponent();e.value=s.timeZoneOffset??"0",this.addHandles([i(()=>e,"calciteInputTimeZoneOpen",()=>this._onDateComponentOpen(e))],M),u.push(e)}return u}_onDateComponentOpen(e){this.editInfo?.inputs.forEach(t=>{t!==e&&"open"in t&&(t.open=!1)})}_syncRowEditingState(e,t=!1){const i=this.grid?.getRowContainingNode(e);i&&(t?i.setAttribute("editing","true"):i.removeAttribute("editing"))}_getDateFieldValuesForComponents(e,t){switch(e.type){case"date":return z(t,this.effectiveTimeZoneOptions.timeZone);case"date-only":return{date:t};case"time-only":return{time:t};case"timestamp-offset":return B(t);default:return{}}}_setUpFieldInput(e,t){const{field:i,layer:n,effectiveTimeZoneOptions:{timeZone:o}}=this,l=new E({feature:e,field:i,initialFeature:e.clone(),layer:n,timeZone:o});return l.set("value",t),l}_isDomainCompatible(e){if(!e)return!1;const{_isNumericField:t,_isStringField:i}=this,{type:n}=e;if("coded-value"===n){const n=typeof e.codedValues[0].code;if("string"===n&&i||"number"===n&&t)return!0}return!("range"!==n||!t)}_getDomainForFeature(e){const{fieldName:t,layer:i,template:n}=this;if(!e||!i?.getFieldDomain)return null;if("wfs"===i.type||"geojson"===i.type||"csv"===i.type||"knowledge-graph-sublayer"===i.type)return null;if(n?.domain&&this._isDomainCompatible(n.domain))return n.domain;if("feature"!==i.type&&"subtype-group"!==i.type&&null==i.getField(t)?.domain){const e=y(i,t);if(e)return e}return i.getFieldDomain(t,{feature:e})}_getComputedDomain(e,t){if(!t)return null;if("range"===t.type)return e;if("coded-value"===t.type){const i=t.codedValues.filter(t=>t.hasOwnProperty("code")&&t.code===e);return i&&i.length?i[0].name:e}return null}};e([l()],$.prototype,"_effectiveDomain",null),e([l()],$.prototype,"_activeFieldInput",void 0),e([l()],$.prototype,"_effectiveRange",null),e([l()],$.prototype,"_isAnyDateOrTimeField",null),e([l()],$.prototype,"_isIntegerField",null),e([l()],$.prototype,"_isNumericField",null),e([l()],$.prototype,"_isStringField",null),e([l()],$.prototype,"_isSubtypeField",null),e([l()],$.prototype,"_layerWithFieldConfigurations",null),e([l()],$.prototype,"_dateTimeFormatOptions",null),e([l()],$.prototype,"_numberFormatOptions",null),e([l({readOnly:!0})],$.prototype,"alias",null),e([l()],$.prototype,"cellValueFormatFunction",void 0),e([l()],$.prototype,"cellValueValidatorFunction",void 0),e([l({readOnly:!0})],$.prototype,"defaultValue",null),e([l()],$.prototype,"effectiveDescription",null),e([l()],$.prototype,"effectiveEditable",null),e([l()],$.prototype,"effectiveLabel",null),e([l()],$.prototype,"effectiveRequired",null),e([l()],$.prototype,"effectiveSortable",null),e([l()],$.prototype,"effectiveTimeZoneOptions",null),e([l({type:g})],$.prototype,"field",void 0),e([l()],$.prototype,"formatFunction",void 0),e([l()],$.prototype,"includeTime",null),e([l()],$.prototype,"inputRenderFunction",void 0),e([l()],$.prototype,"layer",void 0),e([l()],$.prototype,"layerFieldConfigurationFormat",null),e([l({readOnly:!0})],$.prototype,"loadingMessage",null),e([l()],$.prototype,"maxLength",null),e([l()],$.prototype,"minLength",null),e([l({readOnly:!0})],$.prototype,"name",null),e([l({readOnly:!0})],$.prototype,"nullable",null),e([l()],$.prototype,"parseInputValueFunction",void 0),e([l()],$.prototype,"shouldShowPrompt",null),e([l()],$.prototype,"sortable",void 0),e([l()],$.prototype,"store",void 0),e([l()],$.prototype,"template",void 0),e([l()],$.prototype,"view",void 0),$=e([r("esri.widgets.FeatureTable.FieldColumn")],$);const J=$;export{J as default};