@arcgis/core 5.0.0-next.121 → 5.0.0-next.122

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 (64) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{4cb702d574c100483226.js → 0fe47bf45428100cc808.js} +1 -1
  3. package/assets/esri/core/workers/chunks/2d67ab4927a968d5c8d4.js +1 -0
  4. package/assets/esri/core/workers/chunks/{8f26e93eb539ee66c5ac.js → 6a043be736f096d70070.js} +1 -1
  5. package/assets/esri/core/workers/chunks/804c31973f7d116523cb.js +1 -0
  6. package/assets/esri/core/workers/chunks/e8a7ff6210cd11d3a828.js +1 -0
  7. package/config.js +1 -1
  8. package/core/Logger.js +1 -1
  9. package/core/deprecate.js +1 -1
  10. package/kernel.js +1 -1
  11. package/layers/ImageryLayer.d.ts +1 -1
  12. package/layers/MapImageLayer.d.ts +1 -1
  13. package/layers/TileLayer.d.ts +1 -1
  14. package/layers/WebTileLayer.d.ts +1 -1
  15. package/layers/graphics/data/QueryEngineResult.js +1 -1
  16. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  17. package/layers/orientedImagery/transformations/utils.js +1 -1
  18. package/layers/orientedImagery/transformations/worldToImage.js +1 -1
  19. package/layers/support/relativeTimeQueryUtils.js +1 -1
  20. package/package.json +1 -1
  21. package/support/basemapUtils.js +1 -1
  22. package/support/revision.js +1 -1
  23. package/symbols/support/Symbol3DEmissive.d.ts +9 -9
  24. package/symbols/support/Symbol3DMaterial.d.ts +8 -8
  25. package/time/TimeExtent.d.ts +1 -1
  26. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  27. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  28. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  29. package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
  30. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  31. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  32. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  33. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  34. package/views/Attribution.js +1 -1
  35. package/views/DOMContainer.js +1 -1
  36. package/views/LinkChartView.d.ts +1 -1
  37. package/views/MapView.d.ts +1 -1
  38. package/views/SceneView.d.ts +1 -1
  39. package/views/View.d.ts +1 -1
  40. package/views/input/types.d.ts +1 -1
  41. package/views/ui/DefaultUI.d.ts +5 -12
  42. package/views/ui/DefaultUI.js +1 -1
  43. package/views/ui/types.d.ts +1 -1
  44. package/webscene/SunLighting.d.ts +20 -2
  45. package/webscene/VirtualLighting.d.ts +20 -2
  46. package/widgets/Attribution/AttributionViewModel.d.ts +1 -1
  47. package/widgets/Attribution.d.ts +1 -1
  48. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  49. package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
  50. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  51. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  52. package/widgets/OrientedImageryViewer/services/TransformationService.js +1 -1
  53. package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +1 -1
  54. package/widgets/OrientedImageryViewer/support/geometryUtils.js +1 -1
  55. package/widgets/OrientedImageryViewer/support/urlUtils.js +1 -1
  56. package/widgets/OrientedImageryViewer/utils.js +1 -1
  57. package/widgets/OrientedImageryViewer.js +1 -1
  58. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  59. package/widgets/PanoramicViewer/support/PanoramicMedia.js +1 -1
  60. package/widgets/TimeSlider/TimeSliderViewModel.d.ts +1 -2
  61. package/widgets/TimeSlider.d.ts +3 -4
  62. package/assets/esri/core/workers/chunks/00112f984698b31909d3.js +0 -1
  63. package/assets/esri/core/workers/chunks/98c3b7d8db53f0b12642.js +0 -1
  64. package/assets/esri/core/workers/chunks/c88101cb8301f095d037.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import e from"../../../../../core/Error.js";import"../../../../../core/has.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{baseObjectMemory as r}from"../../../../../core/memoryEstimations.js";import s from"../../../../../core/pbf.js";import n from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetCache as a}from"./FeatureSetCache.js";import{FeatureSetReader as i}from"./FeatureSetReader.js";import{parseHeader as h}from"./FeatureSetReaderPBFHeader.js";const o=268435455,d=128,u=128e3,c={small:{delta:new Int32Array(d),decoded:new Int32Array(d)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(u),decoded:new Int32Array(u)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function l(e,t){return t?e<=c.small64.delta.length?c.small64:(e<=c.large64.delta.length||(c.large64.delta=new Float64Array(Math.round(1.25*e)),c.large64.decoded=new Float64Array(Math.round(1.25*e))),c.large64):e<=c.small.delta.length?c.small:(e<=c.large.delta.length||(c.large.delta=new Int32Array(Math.round(1.25*e)),c.large.decoded=new Int32Array(Math.round(1.25*e))),c.large)}function _(t){try{const e=2,r=new s(new Uint8Array(t),new DataView(t));for(;r.next();){if(r.tag()===e)return g(r.getMessage());r.skip()}}catch(r){throw new e("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:r})}return null}function g(e){const t=1;for(;e.next();){if(e.tag()===t)return e.getMessage();e.skip()}return null}function f(e){const t=1,r=2,s=3,n=4,a=5,i=6,h=7,o=8,d=9,u=e.getLength(),c=e.pos()+u;for(;e.pos()<c&&e.next();)switch(e.tag()){case t:return e.getString();case r:return e.getFloat();case s:return e.getDouble();case n:return e.getSInt32();case a:return e.getUInt32();case i:return e.getInt64();case h:return e.getUInt64();case o:return e.getSInt64();case d:return e.getBool();default:return e.skip(),null}return null}function y(e,t,r,s,n){if(!e)return!1;return 0===t*n-s*r&&t*s+r*n>0}class m extends i{static fromBuffer(e,t,r=!1){const s=t.geometryType,n=_(e),a=h(n,"esriGeometryPoint"===s,t.featureIdInfo,r);return new m(n,a,t,r)}constructor(e,t,r,s){super(r),this._use64Bit=s,this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints="esriGeometryPoint"===r.geometryType}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){if(1===this._header.idFieldIndices.length)return this._readAttributeAtIndex(this._header.idFieldIndices[0]);const e=this._header.idFieldIndices.map(e=>this._readAttributeAtIndex(e));return JSON.stringify(e)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new m(e,this._header,this.metadata,this._use64Bit);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0;++this._featureIndex<this._size&&!this._getExists(););return this._featureIndex<this._size}get usedMemory(){return r+(this._cache.geometry?.usedMemory??0)}get underlyingMemory(){return super.underlyingMemory+this._reader.usedMemory+this._header.usedMemory}_readX(){return this._header.centroid[2*this._featureIndex]}_readY(){return this._header.centroid[2*this._featureIndex+1]}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];return e===o?null:new n([],[e,t])}_readGeometry(e=!1){if(void 0===this._cache.geometry){let r=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===o)return null;const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];r=new n([],[e,t])}else{const s=this._header.offsets.geometry[this._featureIndex],n=this._reader;if(0===s)return null;n.move(s);try{r=e?this._parseGeometryForDisplay(n):this._parseGeometry(n)}catch(t){return null}}return 0===r?.coords.length&&(r=null),this._cache.geometry=r,r}return this._cache.geometry}_readAttribute(e,t){const r=this._header.fields.get(e);if(null==r)return;const s=this._readAttributeAtIndex(r.index),n=this._header.fields.isDateField(r.name);return t?null==s?s:n?new Date(s):s:s}_readAttributes(){const e={};for(const t of this._header.fields.fields)e[t.name]=this._readAttributeAtIndex(t.index);return e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext,e._parseCaches=this._parseCaches}_readAttributeAtIndex(e){let t=this._parseCaches[e];if(t||(t=new a(this.getSize()),this._parseCaches[e]=t),t.has(this._featureIndex))return t.get(this._featureIndex);const r=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;s.move(r);const n=f(s);return t.set(this._featureIndex,n),n}_readGeometryDeltaDecoded(e=!1){if(void 0===this._cache.unquantGeometry){const t=this._readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;if(!this.getInTransform())return this._cache.unquantGeometry=t,t;const r=l(t.coords.length,this._use64Bit).decoded,s=t.clone(r),n=s.coords;let a=0;for(const e of s.lengths){for(let t=1;t<e;t++){const e=2*(a+t),r=2*(a+t-1);n[e]+=n[r],n[e+1]+=n[r+1]}a+=e}return this._cache.unquantGeometry=s,s}return this._cache.unquantGeometry}_parseGeometry(e){const t=2,r=3,s=e.asUnsafe(),a=s.getLength(),i=s.pos()+a,h=[],o=[];for(;s.pos()<i&&s.next();)switch(s.tag()){case t:{const e=s.getUInt32(),t=s.pos()+e;for(;s.pos()<t;)o.push(s.getUInt32());break}case r:{const e=s.getUInt32(),t=s.pos()+e;for(h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();s.pos()<t;)h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();break}default:s.skip()}return new n(o,h,this.hasZ,this.hasM)}_parseGeometryForDisplay(e){const r=2,s=3,a=e.asUnsafe(),i=a.getLength(),h=a.pos()+i,o=[],d=[];let u=0,c=0,_=null,g=0;const f="esriGeometryPolygon"===this.geometryType,m="esriGeometryPolyline"===this.geometryType,I=f?3:m?2:1,p=f||m;for(;a.pos()<h&&a.next();)switch(a.tag()){case r:{const e=a.getUInt32(),t=a.pos()+e;for(;a.pos()<t;){const e=a.getUInt32();o.push(e),u+=e}_=l(2*u,this._use64Bit).delta;break}case s:{a.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);t(_);for(const t of o){if(c+e*t>_.length){for(let e=0;e<t;e++)a.getSInt64(),a.getSInt64(),this.hasZ&&a.getSInt64(),this.hasM&&a.getSInt64();continue}let r=0,s=a.getSInt64(),n=a.getSInt64();this.hasZ&&a.getSInt64(),this.hasM&&a.getSInt64(),_[c++]=s,_[c++]=n,r+=1;for(let e=1;e<t;e++){const e=a.getSInt64(),t=a.getSInt64(),i=s+e,h=n+t;g+=-.5*(i-s)*(h+n),this.hasZ&&a.getSInt64(),this.hasM&&a.getSInt64(),0===e&&0===t||y(p,_[c-2],_[c-1],e,t)?(_[c-2]+=e,_[c-1]+=t):(_[c++]=e,_[c++]=t,r+=1),s=i,n=h}r>=I?d.push(r):c-=r*e}break}default:a.skip()}return this._cache.area=g,d.length?new n(d,_,this.hasZ,this.hasM):null!=_?this._createDeltaQuantizedExtrudedGeometry(_[0],_[1]):null}}export{m as FeatureSetReaderPBF};
2
+ import e from"../../../../../core/Error.js";import"../../../../../core/has.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{baseObjectMemory as r}from"../../../../../core/memoryEstimations.js";import s from"../../../../../core/pbf.js";import n from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetCache as a}from"./FeatureSetCache.js";import{FeatureSetReader as i}from"./FeatureSetReader.js";import{parseHeader as h}from"./FeatureSetReaderPBFHeader.js";const o=268435455,d=128,u=128e3,c={small:{delta:new Int32Array(d),decoded:new Int32Array(d)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(u),decoded:new Int32Array(u)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function l(e,t){return t?e<=c.small64.delta.length?c.small64:(e<=c.large64.delta.length||(c.large64.delta=new Float64Array(Math.round(1.25*e)),c.large64.decoded=new Float64Array(Math.round(1.25*e))),c.large64):e<=c.small.delta.length?c.small:(e<=c.large.delta.length||(c.large.delta=new Int32Array(Math.round(1.25*e)),c.large.decoded=new Int32Array(Math.round(1.25*e))),c.large)}function _(t){try{const e=2,r=new s(new Uint8Array(t),new DataView(t));for(;r.next();){if(r.tag()===e)return g(r.getMessage());r.skip()}}catch(r){throw new e("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:r})}return null}function g(e){const t=1;for(;e.next();){if(e.tag()===t)return e.getMessage();e.skip()}return null}function f(e){const t=1,r=2,s=3,n=4,a=5,i=6,h=7,o=8,d=9,u=e.getLength(),c=e.pos()+u;for(;e.pos()<c&&e.next();)switch(e.tag()){case t:return e.getString();case r:return e.getFloat();case s:return e.getDouble();case n:return e.getSInt32();case a:return e.getUInt32();case i:return e.getInt64();case h:return e.getUInt64();case o:return e.getSInt64();case d:return e.getBool();default:return e.skip(),null}return null}function y(e,t,r,s,n){if(!e)return!1;return 0===t*n-s*r&&t*s+r*n>0}class m extends i{static fromBuffer(e,t,r=!1){const s=t.geometryType,n=_(e),a=h(n,"esriGeometryPoint"===s,t.featureIdInfo);return new m(n,a,t,r)}constructor(e,t,r,s){super(r),this._use64Bit=s,this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints="esriGeometryPoint"===r.geometryType}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){if(1===this._header.idFieldIndices.length)return this._readAttributeAtIndex(this._header.idFieldIndices[0]);const e=this._header.idFieldIndices.map(e=>this._readAttributeAtIndex(e));return JSON.stringify(e)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new m(e,this._header,this.metadata,this._use64Bit);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0;++this._featureIndex<this._size&&!this._getExists(););return this._featureIndex<this._size}get usedMemory(){return r+(this._cache.geometry?.usedMemory??0)}get underlyingMemory(){return super.underlyingMemory+this._reader.usedMemory+this._header.usedMemory}_readX(){return this._header.centroid[2*this._featureIndex]}_readY(){return this._header.centroid[2*this._featureIndex+1]}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];return e===o?null:new n([],[e,t])}_readGeometry(e=!1){if(void 0===this._cache.geometry){let r=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===o)return null;const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];r=new n([],[e,t])}else{const s=this._header.offsets.geometry[this._featureIndex],n=this._reader;if(0===s)return null;n.move(s);try{r=e?this._parseGeometryForDisplay(n):this._parseGeometry(n)}catch(t){return null}}return 0===r?.coords.length&&(r=null),this._cache.geometry=r,r}return this._cache.geometry}_readAttribute(e,t){const r=this._header.fields.get(e);if(null==r)return;const s=this._readAttributeAtIndex(r.index),n=this._header.fields.isDateField(r.name);return t?null==s?s:n?new Date(s):s:s}_readAttributes(){const e={};for(const t of this._header.fields.fields)e[t.name]=this._readAttributeAtIndex(t.index);return e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext,e._parseCaches=this._parseCaches}_readAttributeAtIndex(e){let t=this._parseCaches[e];if(t||(t=new a(this.getSize()),this._parseCaches[e]=t),t.has(this._featureIndex))return t.get(this._featureIndex);const r=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;s.move(r);const n=f(s);return t.set(this._featureIndex,n),n}_readGeometryDeltaDecoded(e=!1){if(void 0===this._cache.unquantGeometry){const t=this._readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;if(!this.getInTransform())return this._cache.unquantGeometry=t,t;const r=l(t.coords.length,this._use64Bit).decoded,s=t.clone(r),n=s.coords;let a=0;for(const e of s.lengths){for(let t=1;t<e;t++){const e=2*(a+t),r=2*(a+t-1);n[e]+=n[r],n[e+1]+=n[r+1]}a+=e}return this._cache.unquantGeometry=s,s}return this._cache.unquantGeometry}_parseGeometry(e){const t=2,r=3,s=e.asUnsafe(),a=s.getLength(),i=s.pos()+a,h=[],o=[];for(;s.pos()<i&&s.next();)switch(s.tag()){case t:{const e=s.getUInt32(),t=s.pos()+e;for(;s.pos()<t;)o.push(s.getUInt32());break}case r:{const e=s.getUInt32(),t=s.pos()+e;for(h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();s.pos()<t;)h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();break}default:s.skip()}return new n(o,h,this.hasZ,this.hasM)}_parseGeometryForDisplay(e){const r=2,s=3,a=e.asUnsafe(),i=a.getLength(),h=a.pos()+i,o=[],d=[];let u=0,c=0,_=null,g=0;const f="esriGeometryPolygon"===this.geometryType,m="esriGeometryPolyline"===this.geometryType,I=f?3:m?2:1,p=f||m;for(;a.pos()<h&&a.next();)switch(a.tag()){case r:{const e=a.getUInt32(),t=a.pos()+e;for(;a.pos()<t;){const e=a.getUInt32();o.push(e),u+=e}_=l(2*u,this._use64Bit).delta;break}case s:{a.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);t(_);for(const t of o){if(c+e*t>_.length){for(let e=0;e<t;e++)a.getSInt64(),a.getSInt64(),this.hasZ&&a.getSInt64(),this.hasM&&a.getSInt64();continue}let r=0,s=a.getSInt64(),n=a.getSInt64();this.hasZ&&a.getSInt64(),this.hasM&&a.getSInt64(),_[c++]=s,_[c++]=n,r+=1;for(let e=1;e<t;e++){const e=a.getSInt64(),t=a.getSInt64(),i=s+e,h=n+t;g+=-.5*(i-s)*(h+n),this.hasZ&&a.getSInt64(),this.hasM&&a.getSInt64(),0===e&&0===t||y(p,_[c-2],_[c-1],e,t)?(_[c-2]+=e,_[c-1]+=t):(_[c++]=e,_[c++]=t,r+=1),s=i,n=h}r>=I?d.push(r):c-=r*e}break}default:a.skip()}return this._cache.area=g,d.length?new n(d,_,this.hasZ,this.hasM):null!=_?this._createDeltaQuantizedExtrudedGeometry(_[0],_[1]):null}}export{m as FeatureSetReaderPBF};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{estimateNumberArrayMemory as e}from"../../../../../core/memoryEstimations.js";import{getFeatureIdInfoFieldNames as t}from"../../../../../layers/graphics/data/FeatureIdInfo.js";import s from"../../../../../layers/support/FieldsIndex.js";import{parseField as r,parseTransform as o}from"../../../../../rest/query/operations/pbfFeatureServiceParser.js";const n=268435455;class i{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.idFieldIndices=[],this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}get usedMemory(){let t=0;return t+=e(this.idFieldIndices),t+=e(this.offsets.attributes),t+=e(this.offsets.geometry),t+=e(this.centroid),this.displayIds&&(t+=e(this.displayIds)),this.groupIds&&(t+=e(this.groupIds)),t}}function a(e,a,c,f=!1){const d=9,u=12,p=13,g=15,h=e.asUnsafe(),l=h.pos(),m=new i;let y=0,I=0;const w=1,b=2,k=4,x=3;let A=null,L=!1;const F=[];for(;h.next();)switch(h.tag()){case u:A=h.processMessage(o);break;case d:if(m.exceededTransferLimit=h.getBool(),m.exceededTransferLimit){m.offsets.geometry=f?new Float64Array(8e3):new Int32Array(8e3),m.centroid=f?new Float64Array(16e3):new Int32Array(16e3);for(let e=0;e<m.centroid.length;e++)m.centroid[e]=n}break;case p:{const e=h.processMessage(r);e.index=y++,F.push(e);break}case g:{const e=h.getLength(),t=h.pos()+e;if(!m.exceededTransferLimit){const e=m.offsets.geometry,t=m.centroid;e.push(0),t.push(n),t.push(n)}!L&&m.exceededTransferLimit&&(L=!0,m.offsets.attributes=f?new Float64Array(8e3*y):new Uint32Array(8e3*y));let s=I*y;for(;h.pos()<t&&h.next();)switch(h.tag()){case w:{if(L)m.offsets.attributes[s++]=h.pos();else{m.offsets.attributes.push(h.pos())}const e=h.getLength();h.skipLen(e);break}case b:if(a){const e=h.getLength(),t=h.pos()+e;for(;h.pos()<t&&h.next();)switch(h.tag()){case x:{h.getUInt32();const e=h.getSInt64(),t=h.getSInt64();m.centroid[2*I]=e,m.centroid[2*I+1]=t;break}default:h.skip()}}else{m.offsets.geometry[I]=h.pos();const e=h.getLength();m.vertexCount+=e,h.skipLen(e)}break;case k:{const e=h.getLength(),t=h.pos()+e;for(;h.pos()<t&&h.next();)switch(h.tag()){case x:{h.getUInt32();const e=h.getSInt64(),t=h.getSInt64();m.centroid[2*I]=e,m.centroid[2*I+1]=t;break}default:h.skip()}break}default:h.skip()}I++,m.hasFeatures=!0;break}default:h.skip()}m.fields=new s(F),m.featureCount=I,m.fieldCount=y;const C=t(c);return m.idFieldIndices=Array.from(C,e=>m.fields.get(e)?.index),m.transform=A,m.displayIds=new Uint32Array(m.featureCount),m.groupIds=new Uint16Array(m.featureCount),h.move(l),m}export{i as FeatureSetHeader,a as parseHeader};
2
+ import{estimateNumberArrayMemory as e}from"../../../../../core/memoryEstimations.js";import{getFeatureIdInfoFieldNames as t}from"../../../../../layers/graphics/data/FeatureIdInfo.js";import s from"../../../../../layers/support/FieldsIndex.js";import{parseField as r,parseTransform as o}from"../../../../../rest/query/operations/pbfFeatureServiceParser.js";const n=268435455;class i{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.idFieldIndices=[],this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}get usedMemory(){let t=0;return t+=e(this.idFieldIndices),t+=e(this.offsets.attributes),t+=e(this.offsets.geometry),t+=e(this.centroid),this.displayIds&&(t+=e(this.displayIds)),this.groupIds&&(t+=e(this.groupIds)),t}}function a(e,a,c){const d=9,f=12,u=13,p=15,g=e.asUnsafe(),h=g.pos(),l=new i;let m=0,y=0;const I=1,k=2,b=4,x=3;let w=null;const L=[];for(;g.next();)switch(g.tag()){case f:w=g.processMessage(o);break;case d:l.exceededTransferLimit=g.getBool();break;case u:{const e=g.processMessage(r);e.index=m++,L.push(e);break}case p:{const e=g.getLength(),t=g.pos()+e,s=l.offsets.geometry,r=l.centroid;for(s.push(0),r.push(n),r.push(n);g.pos()<t&&g.next();)switch(g.tag()){case I:{l.offsets.attributes.push(g.pos());const e=g.getLength();g.skipLen(e);break}case k:if(a){const e=g.getLength(),t=g.pos()+e;for(;g.pos()<t&&g.next();)switch(g.tag()){case x:{g.getUInt32();const e=g.getSInt64(),t=g.getSInt64();l.centroid[2*y]=e,l.centroid[2*y+1]=t;break}default:g.skip()}}else{l.offsets.geometry[y]=g.pos();const e=g.getLength();l.vertexCount+=e,g.skipLen(e)}break;case b:{const e=g.getLength(),t=g.pos()+e;for(;g.pos()<t&&g.next();)switch(g.tag()){case x:{g.getUInt32();const e=g.getSInt64(),t=g.getSInt64();l.centroid[2*y]=e,l.centroid[2*y+1]=t;break}default:g.skip()}break}default:g.skip()}y++,l.hasFeatures=!0;break}default:g.skip()}l.fields=new s(L),l.featureCount=y,l.fieldCount=m;const C=t(c);return l.idFieldIndices=Array.from(C,e=>l.fields.get(e)?.index),l.transform=w,l.displayIds=new Uint32Array(l.featureCount),l.groupIds=new Uint16Array(l.featureCount),g.move(h),l}export{i as FeatureSetHeader,a as parseHeader};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{createTask as e}from"../../../../core/asyncUtils.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import{roundToNearest as s}from"../../../../core/mathUtils.js";import{removeMaybe as r,abortMaybe as a}from"../../../../core/maybe.js";import{throwIfAborted as n}from"../../../../core/promiseUtils.js";import{watch as l,syncAndInitial as d}from"../../../../core/reactiveUtils.js";import{createScreenPoint as h}from"../../../../core/screenUtils.js";import{throttle as p}from"../../../../core/throttle.js";import{convertTime as c}from"../../../../core/timeUtils.js";import{property as u,subclass as m}from"../../../../core/accessorSupport/decorators.js";import{formatDuration as _}from"../../../../intl/duration.js";import{onLocaleChange as w}from"../../../../intl/locale.js";import{fetchMessageBundle as v}from"../../../../intl/messages.js";import{substitute as f}from"../../../../intl/substitute.js";let y=class extends o{constructor(t){super(t),this.throttleDelay=x,this._tooltipElement=g(),this._tooltipContentElement=D(),this._messagesTask=null,this._screenPoint=null,this._shadowDurationTask=null,this._shadowDuration=null,this._throttledUpdateShadowDuration=null,this._onPointerMove=({x:t,y:o})=>{const e=h(t,o);this._screenPoint=e,this._throttledUpdateShadowDuration?.(this.view,e)},this._updateShadowDuration=(t,o)=>{this._abortShadowDurationTask(),this._shadowDurationTask=e(async e=>{const{results:i,ground:s}=await t.hitTest(o);if(n(e),0===i.length&&!s.mapPoint)return void(this._shadowDuration=null);const r=await this.getDuration(o,e);n(e),this._shadowDuration=r})}}initialize(){this._tooltipElement.appendChild(this._tooltipContentElement);const t=()=>{this._messagesTask?.abort(),this._messagesTask=e(()=>v("esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis"))};t(),this.addHandles([w(t),l(()=>({enabled:this.isVisible(),surface:this.view.surface}),({enabled:t,surface:o})=>{t&&o?(o.appendChild(this._tooltipElement),this._startTracking(this.view)):(this.removeHandles(T),this._tooltipElement.remove())},d),l(()=>this._styles,t=>{Object.assign(this._tooltipElement.style,t)},d),l(()=>this._formattedText,t=>{this._tooltipContentElement.innerText=t},d),l(()=>this.throttleDelay,t=>{this._throttledUpdateShadowDuration=p(this._updateShadowDuration,t)},d),i(()=>{this._throttledUpdateShadowDuration=r(this._throttledUpdateShadowDuration)})])}destroy(){this._tooltipElement.remove()}get updating(){return null!=this._shadowDurationTask&&!this._shadowDurationTask?.finished||!0===this._throttledUpdateShadowDuration?.hasPendingUpdates()}get _formattedText(){const t=this._messagesTask?.value,o=this._shadowDuration;if(null==t||null==o)return"";const e=s(o,o<E?j:E);return f(t.shadowDuration,{duration:_(e)})}get _styles(){const t=this._screenPoint;return t&&this._formattedText?{display:"block",transform:`translate(${t.x}px, ${t.y}px)`}:{display:"none"}}_startTracking(t){if(this.hasHandles(T))return;const o=o=>{this.hasHandles(S)||(o&&this._onPointerMove(o),this.addHandles(t.on("pointer-move",this._onPointerMove),S))},e=()=>{this.removeHandles(S),this._abortShadowDurationTask(),this._screenPoint=null,this._shadowDuration=null};this.addHandles([t.on("pointer-enter",o),t.on("pointer-leave",e),t.on("pointer-down",e),t.on("pointer-up",o),t.on("pointer-drag",t=>{"end"===t.action?o(t):e()}),t.on("click",o=>{const e=h(o.x,o.y);this._screenPoint=e,this._updateShadowDuration(t,e)}),i(()=>this._abortShadowDurationTask())],T),o()}_abortShadowDurationTask(){this._shadowDurationTask=a(this._shadowDurationTask)}};function g(){const t=k(document.createElement("div"),{position:"absolute",top:"0",left:"0",pointerEvents:"none"});return t.style.setProperty("--tooltip-arrow-size","6px"),t.style.setProperty("--tooltip-background","var(--calcite-color-foreground-1)"),t.appendChild(b()),t}function D(){return k(document.createElement("div"),{color:"var(--calcite-color-text-1)",fontSize:"var(--calcite-font-size-sm)",position:"absolute",width:"max-content",transform:"translate(0, -100%)",insetInlineStart:"calc(var(--calcite-spacing-lg) * -1)",marginTop:"calc((var(--tooltip-arrow-size) * -1) - var(--calcite-spacing-xxs))",background:"var(--tooltip-background)",paddingInline:"var(--calcite-spacing-md)",paddingBlock:"var(--calcite-spacing-xs)",pointerEvents:"none",borderRadius:"var(--calcite-corner-radius-sm)"})}function b(){return k(document.createElement("div"),{display:"block",position:"absolute",width:"0",height:"0",bottom:"-1px",left:"50%",transform:"translate(-50%, 0)",borderTop:"var(--tooltip-arrow-size) solid var(--tooltip-background)",borderRight:"var(--tooltip-arrow-size) solid transparent",borderBottom:"var(--tooltip-arrow-size) solid transparent",borderLeft:"var(--tooltip-arrow-size) solid transparent",pointerEvents:"none"})}function k(t,o){return Object.assign(t.style,o),t}t([u()],y.prototype,"view",void 0),t([u()],y.prototype,"isVisible",void 0),t([u()],y.prototype,"getDuration",void 0),t([u()],y.prototype,"throttleDelay",void 0),t([u()],y.prototype,"updating",null),t([u()],y.prototype,"_messagesTask",void 0),t([u()],y.prototype,"_screenPoint",void 0),t([u()],y.prototype,"_shadowDurationTask",void 0),t([u()],y.prototype,"_shadowDuration",void 0),t([u()],y.prototype,"_throttledUpdateShadowDuration",void 0),t([u()],y.prototype,"_formattedText",null),t([u()],y.prototype,"_styles",null),y=t([m("esri.views.3d.analysis.ShadowCast.ShadowCastTooltip")],y);const T=Symbol("tracking"),S=Symbol("pointer"),x=300,j=c(1,"minutes","milliseconds"),E=c(15,"minutes","milliseconds");export{y as ShadowCastTooltip};
2
+ import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{createTask as s}from"../../../../core/asyncUtils.js";import{makeHandle as e}from"../../../../core/handleUtils.js";import{roundToNearest as i}from"../../../../core/mathUtils.js";import{removeMaybe as a,abortMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as n}from"../../../../core/promiseUtils.js";import{initial as l}from"../../../../core/reactiveUtils.js";import{createScreenPoint as d}from"../../../../core/screenUtils.js";import{throttle as h}from"../../../../core/throttle.js";import{convertTime as p}from"../../../../core/timeUtils.js";import{property as u,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as m}from"../../../../core/support/UpdatingHandles.js";import{formatDuration as _}from"../../../../intl/duration.js";import{onLocaleChange as w}from"../../../../intl/locale.js";import{fetchMessageBundle as g}from"../../../../intl/messages.js";import{substitute as v}from"../../../../intl/substitute.js";let f=class extends o{constructor(t){super(t),this.throttleDelay=x,this._tooltipElement=y(),this._tooltipContentElement=D(),this._updatingHandles=new m,this._messagesTask=null,this._screenPoint=null,this._shadowDurationTask=null,this.shadowDuration=null,this._throttledUpdateShadowDuration=null,this._onPointerMove=({x:t,y:o})=>{const s=d(t,o);this._screenPoint=s,this._throttledUpdateShadowDuration?.(this.view,s)},this._updateShadowDuration=(t,o)=>{this._abortShadowDurationTask(),this._shadowDurationTask=s(async s=>{const{results:e,ground:i}=await t.hitTest(o);if(n(s),0===e.length&&!i.mapPoint)return void(this.shadowDuration=null);const a=await this.getDuration(o,s);n(s),this.shadowDuration=a})}}initialize(){this._tooltipElement.appendChild(this._tooltipContentElement);const t=()=>{this._messagesTask?.abort(),this._messagesTask=s(()=>g("esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis"))};t(),this.addHandles([w(t),this._updatingHandles.add(()=>({enabled:this.isVisible(),surface:this.view.surface}),({enabled:t,surface:o})=>{t&&o?(o.appendChild(this._tooltipElement),this._startTracking(this.view)):(this.removeHandles(T),this._tooltipElement.remove())},l),this._updatingHandles.add(()=>this._styles,t=>{Object.assign(this._tooltipElement.style,t)},l),this._updatingHandles.add(()=>this._formattedText,t=>{this._tooltipContentElement.innerText=t},l),this._updatingHandles.add(()=>this.throttleDelay,t=>{this._throttledUpdateShadowDuration=h(this._updateShadowDuration,t)},l),e(()=>{this._throttledUpdateShadowDuration=a(this._throttledUpdateShadowDuration)})])}destroy(){this._updatingHandles.destroy(),this._tooltipElement.remove()}get updating(){return this._updatingHandles.updating||null!=this._shadowDurationTask&&!this._shadowDurationTask?.finished||null!=this._messagesTask&&!this._messagesTask?.finished||!0===this._throttledUpdateShadowDuration?.hasPendingUpdates()}get _formattedText(){const t=this._messagesTask?.value,o=this.shadowDuration;if(null==t||null==o)return"";const s=i(o,o<U?j:U);return v(t.shadowDuration,{duration:_(s)})}get _styles(){const t=this._screenPoint;return t&&this._formattedText?{display:"block",transform:`translate(${t.x}px, ${t.y}px)`}:{display:"none"}}_startTracking(t){if(this.hasHandles(T))return;const o=o=>{this.hasHandles(S)||(o&&this._onPointerMove(o),this.addHandles(t.on("pointer-move",this._onPointerMove),S))},s=()=>{this.removeHandles(S),this._abortShadowDurationTask(),this._screenPoint=null,this.shadowDuration=null};this.addHandles([t.on("pointer-enter",o),t.on("pointer-leave",s),t.on("pointer-down",s),t.on("pointer-up",o),t.on("pointer-drag",t=>{"end"===t.action?o(t):s()}),t.on("click",o=>{const s=d(o.x,o.y);this._screenPoint=s,this._updateShadowDuration(t,s)}),e(()=>this._abortShadowDurationTask())],T),o()}_abortShadowDurationTask(){this._shadowDurationTask=r(this._shadowDurationTask)}};function y(){const t=k(document.createElement("div"),{position:"absolute",top:"0",left:"0",pointerEvents:"none"});return t.style.setProperty("--tooltip-arrow-size","6px"),t.style.setProperty("--tooltip-background","var(--calcite-color-foreground-1)"),t.appendChild(b()),t}function D(){return k(document.createElement("div"),{color:"var(--calcite-color-text-1)",fontSize:"var(--calcite-font-size-sm)",position:"absolute",width:"max-content",transform:"translate(0, -100%)",insetInlineStart:"calc(var(--calcite-spacing-lg) * -1)",marginTop:"calc((var(--tooltip-arrow-size) * -1) - var(--calcite-spacing-xxs))",background:"var(--tooltip-background)",paddingInline:"var(--calcite-spacing-md)",paddingBlock:"var(--calcite-spacing-xs)",pointerEvents:"none",borderRadius:"var(--calcite-corner-radius-sm)"})}function b(){return k(document.createElement("div"),{display:"block",position:"absolute",width:"0",height:"0",bottom:"-1px",left:"50%",transform:"translate(-50%, 0)",borderTop:"var(--tooltip-arrow-size) solid var(--tooltip-background)",borderRight:"var(--tooltip-arrow-size) solid transparent",borderBottom:"var(--tooltip-arrow-size) solid transparent",borderLeft:"var(--tooltip-arrow-size) solid transparent",pointerEvents:"none"})}function k(t,o){return Object.assign(t.style,o),t}t([u()],f.prototype,"view",void 0),t([u()],f.prototype,"isVisible",void 0),t([u()],f.prototype,"getDuration",void 0),t([u()],f.prototype,"throttleDelay",void 0),t([u()],f.prototype,"updating",null),t([u()],f.prototype,"_messagesTask",void 0),t([u()],f.prototype,"_screenPoint",void 0),t([u()],f.prototype,"_shadowDurationTask",void 0),t([u()],f.prototype,"shadowDuration",void 0),t([u()],f.prototype,"_throttledUpdateShadowDuration",void 0),t([u()],f.prototype,"_formattedText",null),t([u()],f.prototype,"_styles",null),f=t([c("esri.views.3d.analysis.ShadowCast.ShadowCastTooltip")],f);const T=Symbol("tracking"),S=Symbol("pointer"),x=300,j=p(1,"minutes","milliseconds"),U=p(15,"minutes","milliseconds");export{f as ShadowCastTooltip};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import o from"../../../../core/Logger.js";import{debounce as i}from"../../../../core/promiseUtils.js";import{createVolume as n}from"../../../../core/quantity.js";import{whenOnce as s,watch as a,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as u,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{e as c}from"../../../../chunks/earcut.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scaleAndAdd as d,sqrDist as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as g,clone as f,create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as _}from"../../../../core/support/UpdatingHandles.js";import v from"../../../../geometry/Multipoint.js";import{projectOrLoad as w}from"../../../../geometry/projectionUtils.js";import{e as b}from"../../../../chunks/containsOperator.js";import{e as j}from"../../../../chunks/convexHullOperator.js";import{e as E}from"../../../../chunks/simplifyOperator.js";import{e as R}from"../../../../chunks/unionOperator.js";import{computeTranslationToOriginAndRotation as C}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as T}from"../../../../geometry/projection/projectBoundingRect.js";import{fromExtent as L,intersects as G,create as O,empty as x}from"../../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as D}from"../../../../geometry/support/DoubleArray.js";import{t as I}from"../../../../chunks/vec3.js";import H from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as M}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as V}from"./VolumeMeasurementCutFillComputation.js";import{VolumeMeasurementInsufficientDataError as A,VolumeMeasurementPerimeterTooLargeError as P,VolumeMeasurementUnsupportedCoordinateSystemError as U,VolumeMeasurementUnsupportedLayerTransparencyError as k}from"./volumeMeasurementErrors.js";import{VolumeMeasurementRawResult as S}from"./VolumeMeasurementRawResult.js";import F from"./VolumeMeasurementResult.js";import{ElevationContext as W}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as N}from"../../support/ElevationProvider.js";import{polygonToRenderInfo as z}from"../../support/renderInfoUtils/polygon.js";import{IteratorPreorder as q}from"../../terrain/tileUtils.js";import{CutFillDepth as B,TargetGeometryRenderInfo as Z}from"../../webgl-engine/lib/CutFillDepth.js";import{isIntegratedMeshLayerView as J}from"../../../support/layerViewUtils.js";import{MeasurementWorkerHandle as K}from"../../../support/MeasurementWorkerHandle.js";let Q=class extends r{constructor(e){super(e),this._measurementWorkerHandle=new K,this._getElevationProvider=()=>this.view.elevationProvider,this.labelAnchors=null,this._updatingHandles=new _,this._rawResult=null,this._sufficientDataCoverage=!0,this._tileIterator=new q,this._intersectingObbs=[],this._intersectingTiles=[],this._debouncedUpdate=i(async(e,t,r,o)=>{if(!this._renderer.done)return;const{renderCoordsHelper:i}=this.view,n=new V({extent:t,localOrigin:r,renderCoordsHelper:i});this._renderer.update(n,o),this._determineDataCoverage(n);const[a]=await Promise.allSettled([this._measurementWorkerHandle.areaHorizontal(e,{returnLength:!0}),s(()=>this._renderer.done).then(()=>{this._updateLabelAnchors(n,this._renderer.getResults())})]);if(!this._enabled||!this._sufficientDataCoverage)return void(this._rawResult=null);const l=this._renderer.getResults();this._updateResult(n,l,"fulfilled"===a.status?a.value:null)}),this._determineDataCoverage=e=>{const{elevationAlignedGeometry:t}=this,{frustum:r}=this._renderer,{cameraDimensions:o}=e;t&&r&&(this._intersectingObbs.length=0,this._imLayerViewsAffectingMeasurement.forEach(e=>{this._findIntersectingObbs(e,r)}),this._intersectingObbs.length?this._sufficientDataCoverage=this._sufficientIntegratedMeshCoverage(t,o):(this._findIntersectingTerrainTiles(t),this._sufficientDataCoverage=this._sufficientTerrainCoverage(o)))}}initialize(){const e=this.view;this._renderer=new B({view:e}),this.addHandles([this._createElevationUpdateHandle(),a(()=>({projectedGeometry:this._projectedGeometry,localOrigin:this._localOrigin,targetGeometryRenderInfos:this._targetGeometryRenderInfos,enabled:this._enabled}),({projectedGeometry:e,localOrigin:t,targetGeometryRenderInfos:r,enabled:o})=>{const i=e?.extent;if(!(e&&i&&t&&r&&o))return this._rawResult=null,void(this._sufficientDataCoverage=!0);this._updatingHandles.addPromise(this._debouncedUpdate(e,i,t,r))},l)])}destroy(){this._updatingHandles.destroy(),this._renderer.destroy(),this._measurementWorkerHandle.destroy()}get _projectedGeometry(){const e=this.analysis.geometry;if(!e||!this.analysis.valid)return null;const t=E(e),r=w(t,this.view.spatialReference);return r.pending?(this._updatingHandles.addPromise(r.pending),null):(t&&!r.geometry&&M(this.analysis,e.spatialReference,o.getLogger(this)),r.geometry)}get _localOrigin(){const e=this._projectedGeometry?.extent;return e?g(e.center.x,e.center.y,0):null}get elevationAlignedGeometry(){const e=this._projectedGeometry;if(!e)return null;const t=e.clone();return X(this._getElevationProvider(),t),t}get targetGeometry(){const{elevationAlignedGeometry:e}=this;if(!e)return null;const t=this.analysis.measureType,{effectiveTargetElevation:r}=this.analysisViewData;if("stockpile"===t||null==r)return e;const o=e.clone();return o.rings.forEach(e=>e.forEach(e=>e[2]=r)),o}get _targetGeometryRenderInfos(){const e=this.targetGeometry,t=this._projectedGeometry?.extent,r=this._localOrigin;if(!e||!t||!r)return null;const{elevationProvider:o,renderCoordsHelper:i}=this.view,n=z(e,o,i,W.fromElevationInfo(new H({mode:"absolute-height"}))),{polygons:s}=n;return s.map(e=>{const o=c(e.position,e.holeIndices,3),n=D(3*e.count),s=m(),a=m();return C(t.spatialReference,r,s,i.spatialReference),a[12]=-s[12],a[13]=-s[13],a[14]=-s[14],I(n,e.position,a),new Z(n,o)})}get updating(){return this._renderer.updating||this._updatingHandles.updating}get result(){const e=this._rawResult,{volume:t,area:r,length:o}=this.analysisViewData.effectiveDisplayUnits;return e?new F({measureType:this.analysis.measureType,rawResult:e,volumeUnit:t,areaUnit:r,lengthUnit:o}):null}get error(){return this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._perimeterTooLargeError??this._insufficientDataError}get _imLayerViewsAffectingMeasurement(){return this.view.allLayerViews.filter(e=>J(e)).filter(e=>e.visible&&!e.suspended)}get _insufficientDataError(){return this._sufficientDataCoverage?null:new A}get _perimeterTooLargeError(){return this._perimeterTooLargeLocalError??this._perimeterTooLargeGlobalError}get _perimeterTooLargeLocalError(){const{spatialReference:e,state:{isLocal:r}}=this.view;if(!r||!e.isWebMercator)return null;const o=this._perimeter,{maxPerimeterLocalWebMercator:i}=t;return null!=o&&o>i?new P:null}get _perimeterTooLargeGlobalError(){if(!this.view.state.isGlobal)return null;const e=this._perimeter,{maxPerimeterGlobal:r}=t;return null!=e&&e>r?new P:null}get _unsupportedCoordinateSystemError(){return this.view.state.isLocal&&this.view.spatialReference.isGeographic?new U:null}get _unsupportedLayerTransparencyError(){return this.view.map.ground&&this.view.map.ground.opacity<1?new k:null}get _perimeter(){if(!this._targetGeometryRenderInfos)return null;let e=null;for(const t of this._targetGeometryRenderInfos){const r=$(ee(t.positions));e=r?Math.max(e??0,r):e}return null!=e?e/this.view.renderCoordsHelper.unitInMeters:null}get _enabled(){return!(this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._perimeterTooLargeError)}_createElevationUpdateHandle(){const e=e=>{const t=this._projectedGeometry?.extent;"ground"===e.context&&t&&(T(e.extent,e.spatialReference,re,this.view.spatialReference),L(t,oe),G(re,oe)&&(this._getElevationProvider=()=>this.view.elevationProvider))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_updateResult(e,t,r){const{unitInMeters:o}=this.view.renderCoordsHelper,{dimensions:{width:i,height:s},cameraNearFar:{near:a,far:l}}=e,u=i/t.width*(s/t.height),p=Y(t.cut.totalDepth,a,l)*u,c=Y(t.fill.totalDepth,a,l)*u,m=o**3;this._rawResult=new S({cutVolume:n(Math.abs(p*m),"cubic-meters"),fillVolume:n(c*m,"cubic-meters"),area:r?.area,perimeter:r?.length})}_updateLabelAnchors(e,t){const{dimensions:{width:r,height:o},cameraNearFar:{near:i,far:n},cameraPositionRenderSpace:s,northVector:a,eastVector:l,upVector:u}=e,p=e=>{const{labelDepth:p,labelCoords:c,totalDepth:m}=e,h=f(s);return 0!==m&&(d(h,h,l,r*(c[0]/t.width-.5)),d(h,h,a,o*(c[1]/t.height-.5))),d(h,h,u,-Y(p,i,n)),h};this.labelAnchors={cut:p(t.cut),fill:p(t.fill)}}_findIntersectingObbs(e,t){const r=this._intersectingObbs;"integrated-mesh-3d"===e.type&&e.getVisibleNodes().forEach(o=>{e.isNodeLoaded(o.index)&&o.geometryObbInRenderSR?.intersectsFrustum(t)&&r.push(o.geometryObbInRenderSR)}),"integrated-mesh-3dtiles"===e.type&&e.forEachVisibleComponentObject(({obb:e})=>{e.intersectsFrustum(t)&&r.push(e)})}_sufficientIntegratedMeshCoverage(e,t){const{renderCoordsHelper:r,spatialReference:o}=this.view,i=[],n=new v({spatialReference:o});if(this._intersectingObbs.forEach(e=>{if(te(e.radius,t)&&(e.getCorners(ne),n.points.length=0,ne.forEach(e=>{const t=r.fromRenderCoords(e,se,o);t&&n.addPoint([t[0],t[1]])}),n.points.length)){const e=j(n);"polygon"===e?.type&&i.push(e)}}),!i.length)return!1;const s=R(i);return!!s&&b(s,e)}_findIntersectingTerrainTiles(e){const{basemapTerrain:t}=this.view;if(this._intersectingTiles.length=0,!e.extent)return;L(e.extent,ie);const r=this._tileIterator;r.reset(t.rootTiles);for(let o=r.next();o;o=r.next())o.intersectsExtent(ie)?o.rendered&&this._intersectingTiles.push(o):r.skipSubtree()}_sufficientTerrainCoverage(e){const{basemapTerrain:{tilingScheme:t}}=this.view,r=256/t.pixelSize;return this._intersectingTiles.every(t=>te(t.radius*r,e))}};function X(e,t){t.hasZ=!0,t.rings.forEach(t=>t.forEach(t=>t[2]=N(e,t,"ground")??0))}function Y(e,t,r){return e*(r-t)+t}function $(e){if(!e)return null;let t=null,r=null,o=0;for(const i of e)t||(t=[i[0],i[1],i[2]??0]),r?o+=h(r,i):r=[0,0,0],r[0]=i[0],r[1]=i[1],r[2]=i[2];return t&&r&&(o+=h(r,t)),Math.sqrt(o)}function*ee(e){const t=y();for(let r=0;r<e.length;r+=3)t[0]=e[r],t[1]=e[r+1],t[2]=e[r+2],yield t}e([u()],Q.prototype,"_projectedGeometry",null),e([u()],Q.prototype,"_localOrigin",null),e([u()],Q.prototype,"_getElevationProvider",void 0),e([u()],Q.prototype,"elevationAlignedGeometry",null),e([u()],Q.prototype,"targetGeometry",null),e([u()],Q.prototype,"_targetGeometryRenderInfos",null),e([u({constructOnly:!0})],Q.prototype,"analysis",void 0),e([u({constructOnly:!0})],Q.prototype,"analysisViewData",void 0),e([u({constructOnly:!0})],Q.prototype,"view",void 0),e([u()],Q.prototype,"updating",null),e([u()],Q.prototype,"result",null),e([u()],Q.prototype,"labelAnchors",void 0),e([u()],Q.prototype,"error",null),e([u()],Q.prototype,"_imLayerViewsAffectingMeasurement",null),e([u()],Q.prototype,"_insufficientDataError",null),e([u()],Q.prototype,"_perimeterTooLargeError",null),e([u()],Q.prototype,"_perimeterTooLargeLocalError",null),e([u()],Q.prototype,"_perimeterTooLargeGlobalError",null),e([u()],Q.prototype,"_unsupportedCoordinateSystemError",null),e([u()],Q.prototype,"_unsupportedLayerTransparencyError",null),e([u()],Q.prototype,"_perimeter",null),e([u()],Q.prototype,"_enabled",null),e([u()],Q.prototype,"_renderer",void 0),e([u({readOnly:!0})],Q.prototype,"_updatingHandles",void 0),e([u()],Q.prototype,"_rawResult",void 0),e([u()],Q.prototype,"_sufficientDataCoverage",void 0),Q=e([p("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillController")],Q);const te=(e,t)=>e<(t.width+t.height)/2,re=x(),oe=x(),ie=O(),ne=new Array(8).fill(0).map(()=>y()),se=y();export{Q as VolumeMeasurementCutFillController};
2
+ import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import o from"../../../../core/Logger.js";import{debounce as i}from"../../../../core/promiseUtils.js";import{createVolume as n}from"../../../../core/quantity.js";import{whenOnce as s,watch as a,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as u,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{e as c}from"../../../../chunks/earcut.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scaleAndAdd as d,sqrDist as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as g,clone as f,create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as _}from"../../../../core/support/UpdatingHandles.js";import v from"../../../../geometry/Multipoint.js";import{projectOrLoad as w}from"../../../../geometry/projectionUtils.js";import{e as b}from"../../../../chunks/containsOperator.js";import{e as j}from"../../../../chunks/convexHullOperator.js";import{e as E}from"../../../../chunks/simplifyOperator.js";import{e as R}from"../../../../chunks/unionOperator.js";import{computeTranslationToOriginAndRotation as C}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as T}from"../../../../geometry/projection/projectBoundingRect.js";import{fromExtent as G,intersects as L,create as O,empty as x}from"../../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as I}from"../../../../geometry/support/DoubleArray.js";import{t as D}from"../../../../chunks/vec3.js";import H from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as M}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as V}from"./VolumeMeasurementCutFillComputation.js";import{VolumeMeasurementInsufficientDataError as A,VolumeMeasurementPerimeterTooLargeError as P,VolumeMeasurementUnsupportedCoordinateSystemError as U,VolumeMeasurementUnsupportedLayerTransparencyError as k}from"./volumeMeasurementErrors.js";import{VolumeMeasurementRawResult as S}from"./VolumeMeasurementRawResult.js";import F from"./VolumeMeasurementResult.js";import{ElevationContext as W}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as N}from"../../support/ElevationProvider.js";import{polygonToRenderInfo as z}from"../../support/renderInfoUtils/polygon.js";import{IteratorPreorder as q}from"../../terrain/tileUtils.js";import{CutFillDepth as B,TargetGeometryRenderInfo as Z}from"../../webgl-engine/lib/CutFillDepth.js";import{isIntegratedMeshLayerView as J}from"../../../support/layerViewUtils.js";import{MeasurementWorkerHandle as K}from"../../../support/MeasurementWorkerHandle.js";let Q=class extends r{constructor(e){super(e),this._measurementWorkerHandle=new K,this._getElevationProvider=()=>this.view.elevationProvider,this.labelAnchors=null,this._updatingHandles=new _,this._rawResult=null,this._sufficientDataCoverage=!0,this._tileIterator=new q,this._intersectingObbs=[],this._intersectingTiles=[],this._debouncedUpdate=i(async(e,t,r,o)=>{if(!this._renderer.done)return;const{renderCoordsHelper:i}=this.view,n=new V({extent:t,localOrigin:r,renderCoordsHelper:i});this._renderer.update(n,o),this._determineDataCoverage(n);const[a]=await Promise.allSettled([this._measurementWorkerHandle.areaHorizontal(e,{returnLength:!0}),s(()=>this._renderer.done).then(()=>{this._updateLabelAnchors(n,this._renderer.getResults())})]);if(this.error)return void(this._rawResult=null);const l=this._renderer.getResults();this._updateResult(n,l,"fulfilled"===a.status?a.value:null)}),this._determineDataCoverage=e=>{const{elevationAlignedGeometry:t}=this,{frustum:r}=this._renderer,{cameraDimensions:o}=e;t&&r&&(this._intersectingObbs.length=0,this._imLayerViewsAffectingMeasurement.forEach(e=>{this._findIntersectingObbs(e,r)}),this._intersectingObbs.length?this._sufficientDataCoverage=this._sufficientIntegratedMeshCoverage(t,o):(this._findIntersectingTerrainTiles(t),this._sufficientDataCoverage=this._sufficientTerrainCoverage(o)))}}initialize(){const e=this.view;this._renderer=new B({view:e}),this.addHandles([this._createElevationUpdateHandle(),a(()=>({projectedGeometry:this._projectedGeometry,localOrigin:this._localOrigin,targetGeometryRenderInfos:this._targetGeometryRenderInfos}),({projectedGeometry:e,localOrigin:t,targetGeometryRenderInfos:r})=>{const o=e?.extent;if(!(e&&o&&t&&r))return this._rawResult=null,void(this._sufficientDataCoverage=!0);this._updatingHandles.addPromise(this._debouncedUpdate(e,o,t,r))},l)])}destroy(){this._updatingHandles.destroy(),this._renderer.destroy(),this._measurementWorkerHandle.destroy()}get _projectedGeometry(){const e=this.analysis.geometry;if(!e||!this.analysis.valid)return null;const t=E(e),r=w(t,this.view.spatialReference);return r.pending?(this._updatingHandles.addPromise(r.pending),null):(t&&!r.geometry&&M(this.analysis,e.spatialReference,o.getLogger(this)),r.geometry)}get _localOrigin(){const e=this._projectedGeometry?.extent;return e?g(e.center.x,e.center.y,0):null}get elevationAlignedGeometry(){const e=this._projectedGeometry;if(!e)return null;const t=e.clone();return X(this._getElevationProvider(),t),t}get targetGeometry(){const{elevationAlignedGeometry:e}=this;if(!e)return null;const t=this.analysis.measureType,{effectiveTargetElevation:r}=this.analysisViewData;if("stockpile"===t||null==r)return e;const o=e.clone();return o.rings.forEach(e=>e.forEach(e=>e[2]=r)),o}get _targetGeometryRenderInfos(){const e=this.targetGeometry,t=this._projectedGeometry?.extent,r=this._localOrigin;if(!e||!t||!r)return null;const{elevationProvider:o,renderCoordsHelper:i}=this.view,n=z(e,o,i,W.fromElevationInfo(new H({mode:"absolute-height"}))),{polygons:s}=n;return s.map(e=>{const o=c(e.position,e.holeIndices,3),n=I(3*e.count),s=m(),a=m();return C(t.spatialReference,r,s,i.spatialReference),a[12]=-s[12],a[13]=-s[13],a[14]=-s[14],D(n,e.position,a),new Z(n,o)})}get updating(){return this._renderer.updating||this._updatingHandles.updating}get result(){const e=this._rawResult,{volume:t,area:r,length:o}=this.analysisViewData.effectiveDisplayUnits;return e?new F({measureType:this.analysis.measureType,rawResult:e,volumeUnit:t,areaUnit:r,lengthUnit:o}):null}get error(){return this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._perimeterTooLargeError??this._insufficientDataError}get _imLayerViewsAffectingMeasurement(){return this.view.allLayerViews.filter(e=>J(e)).filter(e=>e.visible&&!e.suspended)}get _insufficientDataError(){return this._sufficientDataCoverage?null:new A}get _perimeterTooLargeError(){return this._perimeterTooLargeLocalError??this._perimeterTooLargeGlobalError}get _perimeterTooLargeLocalError(){const{spatialReference:e,state:{isLocal:r}}=this.view;if(!r||!e.isWebMercator)return null;const o=this._perimeter,{maxPerimeterLocalWebMercator:i}=t;return null!=o&&o>i?new P:null}get _perimeterTooLargeGlobalError(){if(!this.view.state.isGlobal)return null;const e=this._perimeter,{maxPerimeterGlobal:r}=t;return null!=e&&e>r?new P:null}get _unsupportedCoordinateSystemError(){return this.view.state.isLocal&&this.view.spatialReference.isGeographic?new U:null}get _unsupportedLayerTransparencyError(){return this.view.map.ground&&this.view.map.ground.opacity<1?new k:null}get _perimeter(){if(!this._targetGeometryRenderInfos)return null;let e=null;for(const t of this._targetGeometryRenderInfos){const r=$(ee(t.positions));e=r?Math.max(e??0,r):e}return null!=e?e/this.view.renderCoordsHelper.unitInMeters:null}_createElevationUpdateHandle(){const e=e=>{const t=this._projectedGeometry?.extent;"ground"===e.context&&t&&(T(e.extent,e.spatialReference,re,this.view.spatialReference),G(t,oe),L(re,oe)&&(this._getElevationProvider=()=>this.view.elevationProvider))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_updateResult(e,t,r){const{unitInMeters:o}=this.view.renderCoordsHelper,{dimensions:{width:i,height:s},cameraNearFar:{near:a,far:l}}=e,u=i/t.width*(s/t.height),p=Y(t.cut.totalDepth,a,l)*u,c=Y(t.fill.totalDepth,a,l)*u,m=o**3;this._rawResult=new S({cutVolume:n(Math.abs(p*m),"cubic-meters"),fillVolume:n(c*m,"cubic-meters"),area:r?.area,perimeter:r?.length})}_updateLabelAnchors(e,t){const{dimensions:{width:r,height:o},cameraNearFar:{near:i,far:n},cameraPositionRenderSpace:s,northVector:a,eastVector:l,upVector:u}=e,p=e=>{const{labelDepth:p,labelCoords:c,totalDepth:m}=e,h=f(s);return 0!==m&&(d(h,h,l,r*(c[0]/t.width-.5)),d(h,h,a,o*(c[1]/t.height-.5))),d(h,h,u,-Y(p,i,n)),h};this.labelAnchors={cut:p(t.cut),fill:p(t.fill)}}_findIntersectingObbs(e,t){const r=this._intersectingObbs;"integrated-mesh-3d"===e.type&&e.getVisibleNodes().forEach(o=>{e.isNodeLoaded(o.index)&&o.geometryObbInRenderSR?.intersectsFrustum(t)&&r.push(o.geometryObbInRenderSR)}),"integrated-mesh-3dtiles"===e.type&&e.forEachVisibleComponentObject(({obb:e})=>{e.intersectsFrustum(t)&&r.push(e)})}_sufficientIntegratedMeshCoverage(e,t){const{renderCoordsHelper:r,spatialReference:o}=this.view,i=[],n=new v({spatialReference:o});if(this._intersectingObbs.forEach(e=>{if(te(e.radius,t)&&(e.getCorners(ne),n.points.length=0,ne.forEach(e=>{const t=r.fromRenderCoords(e,se,o);t&&n.addPoint([t[0],t[1]])}),n.points.length)){const e=j(n);"polygon"===e?.type&&i.push(e)}}),!i.length)return!1;const s=R(i);return!!s&&b(s,e)}_findIntersectingTerrainTiles(e){const{basemapTerrain:t}=this.view;if(this._intersectingTiles.length=0,!e.extent)return;G(e.extent,ie);const r=this._tileIterator;r.reset(t.rootTiles);for(let o=r.next();o;o=r.next())o.intersectsExtent(ie)?o.rendered&&this._intersectingTiles.push(o):r.skipSubtree()}_sufficientTerrainCoverage(e){const{basemapTerrain:{tilingScheme:t}}=this.view,r=256/t.pixelSize;return this._intersectingTiles.every(t=>te(t.radius*r,e))}};function X(e,t){t.hasZ=!0,t.rings.forEach(t=>t.forEach(t=>t[2]=N(e,t,"ground")??0))}function Y(e,t,r){return e*(r-t)+t}function $(e){if(!e)return null;let t=null,r=null,o=0;for(const i of e)t||(t=[i[0],i[1],i[2]??0]),r?o+=h(r,i):r=[0,0,0],r[0]=i[0],r[1]=i[1],r[2]=i[2];return t&&r&&(o+=h(r,t)),Math.sqrt(o)}function*ee(e){const t=y();for(let r=0;r<e.length;r+=3)t[0]=e[r],t[1]=e[r+1],t[2]=e[r+2],yield t}e([u()],Q.prototype,"_projectedGeometry",null),e([u()],Q.prototype,"_localOrigin",null),e([u()],Q.prototype,"_getElevationProvider",void 0),e([u()],Q.prototype,"elevationAlignedGeometry",null),e([u()],Q.prototype,"targetGeometry",null),e([u()],Q.prototype,"_targetGeometryRenderInfos",null),e([u({constructOnly:!0})],Q.prototype,"analysis",void 0),e([u({constructOnly:!0})],Q.prototype,"analysisViewData",void 0),e([u({constructOnly:!0})],Q.prototype,"view",void 0),e([u()],Q.prototype,"updating",null),e([u()],Q.prototype,"result",null),e([u()],Q.prototype,"labelAnchors",void 0),e([u()],Q.prototype,"error",null),e([u()],Q.prototype,"_imLayerViewsAffectingMeasurement",null),e([u()],Q.prototype,"_insufficientDataError",null),e([u()],Q.prototype,"_perimeterTooLargeError",null),e([u()],Q.prototype,"_perimeterTooLargeLocalError",null),e([u()],Q.prototype,"_perimeterTooLargeGlobalError",null),e([u()],Q.prototype,"_unsupportedCoordinateSystemError",null),e([u()],Q.prototype,"_unsupportedLayerTransparencyError",null),e([u()],Q.prototype,"_perimeter",null),e([u()],Q.prototype,"_renderer",void 0),e([u({readOnly:!0})],Q.prototype,"_updatingHandles",void 0),e([u()],Q.prototype,"_rawResult",void 0),e([u()],Q.prototype,"_sufficientDataCoverage",void 0),Q=e([p("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillController")],Q);const te=(e,t)=>e<(t.width+t.height)/2,re=x(),oe=x(),ie=O(),ne=new Array(8).fill(0).map(()=>y()),se=y();export{Q as VolumeMeasurementCutFillController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{onLocaleChange as t,substitute as i,fetchMessageBundle as s}from"../../../../intl.js";import{volumeMeasurementConfiguration as o}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import{equals as l}from"../../../../core/arrayUtils.js";import{cyclicalPI as n}from"../../../../core/Cyclical.js";import{destroyMaybe as a}from"../../../../core/maybe.js";import{formatDecimal as c,preferredVolumePrecision as u}from"../../../../core/quantityFormatUtils.js";import{watch as m,initial as d}from"../../../../core/reactiveUtils.js";import{adaptiveVolumeUnit as h}from"../../../../core/units.js";import{property as p,subclass as g}from"../../../../core/accessorSupport/decorators.js";import{e as y}from"../../../../chunks/earcut.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f,normalize as v,subtract as j,cross as b,dot as L}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as C,fromValues as w}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as G}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as P}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as V}from"../../../../geometry/support/Indices.js";import{angleAroundAxis as R}from"../../../../geometry/support/vector.js";import{t as F}from"../../../../chunks/vec3.js";import A from"../../../../symbols/support/ElevationInfo.js";import{LabelVisualElement as x}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as O}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as D}from"../../interactive/visualElements/OutlineVisualElement.js";import{EuclideanSegment as M}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as U}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as S}from"../../layers/graphics/extrudeUtils.js";import{polygonToRenderInfo as E}from"../../support/renderInfoUtils/polygon.js";import{CutFillColor as B,VolumeGeometry as N}from"../../webgl-engine/lib/CutFillColor.js";import{createStipplePatternSimple as T}from"../../webgl-engine/materials/lineStippleUtils.js";let H=class extends r{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}get updating(){return this.loadingMessages}get hasUnsupportedError(){const{error:e}=this.analysisViewData;return!!e&&["unsupported-coordinate-system","unsupported-layer-transparency"].includes(e.name)}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._elevationContext=U.fromElevationInfo(new A({mode:"absolute-height"})),this._extrusionHeight=o.targetElevationRange,this._projectionLines=[]}initialize(){const{view:e}=this,i={view:e,isDecoration:!0},s=o,r={...i,width:s.geometryOutlineWidth};this._elevationAlignedGeometry=new D({...r,isDraped:!0,color:s.geometryOutlineColor.toUnitRGBA()}),this._targetGeometry=new D(r);const l={...i,attached:!0,width:s.projectionLineWidth,renderOccluded:4,polygonOffset:!0},n={...l,stipplePattern:T(s.projectionLineStippleSize)},a=s.cutProjectionLineColor.toUnitRGBA(),c=s.fillProjectionLineColor.toUnitRGBA();this._cutProjectionLines=new O({...l,color:a}),this._occludedCutProjectionLines=new O({...n,color:a}),this._fillProjectionLines=new O({...l,color:c}),this._occludedFillProjectionLines=new O({...n,color:c});const u={...i,attached:!0};this._cutVolumeLabel=new x({...u,distance:s.labelDistance}),this._fillVolumeLabel=new x({...u,distance:-s.labelDistance}),this._cutFillRenderNode=new B({view:e,cutColor:s.cutColor,fillColor:s.fillColor,borderColor:s.geometryOutlineColor}),this.addHandles([m(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},d),m(()=>({interactive:this.analysisViewData.interactive,measureType:this.analysis.measureType,visible:this.visible}),({visible:e,interactive:t,measureType:i})=>{this._elevationAlignedGeometry.visible=e&&!t,this._targetGeometry.visible=e&&"cut-fill"===i,this._cutFillRenderNode.measureType=i},d),m(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:i})=>this._updateProjectionLines(e,t,i),d),m(()=>({interactive:this.analysisViewData.interactive,accentColor:this.view.effectiveTheme.accentColor,hasResult:!!this.analysisViewData.result}),({interactive:e,accentColor:t,hasResult:i})=>{this._updateColors(e,t,i)},d),m(()=>this.analysisViewData.targetGeometry,()=>this._updateCutFillGeometry(),d),m(()=>this.visible&&!this.hasUnsupportedError,e=>this._updateCutFillVisibility(e),d),m(()=>{const{messages:e,unitsMessages:t,visible:i,analysisViewData:s}=this;return{labelAnchors:s.labelAnchors,effectiveDisplayUnits:s.effectiveDisplayUnits,messages:e,unitsMessages:t,result:s.result,visible:i&&!!s.result}},e=>this._updateLabels(e)),m(()=>this.view.state.camera,e=>this._updateProjectionLineOcclusion(e),d),t(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=a(this._elevationAlignedGeometry),this._targetGeometry=a(this._targetGeometry),this._cutProjectionLines=a(this._cutProjectionLines),this._occludedCutProjectionLines=a(this._occludedCutProjectionLines),this._fillProjectionLines=a(this._fillProjectionLines),this._occludedFillProjectionLines=a(this._occludedFillProjectionLines),this._cutVolumeLabel=a(this._cutVolumeLabel),this._fillVolumeLabel=a(this._fillVolumeLabel),this._cutFillRenderNode.destroy()}_updateProjectionLines(e,t,i){if(this._cutProjectionLines.visible=i,this._occludedCutProjectionLines.visible=i,this._fillProjectionLines.visible=i,this._occludedFillProjectionLines.visible=i,!e||!t)return;const{renderCoordsHelper:s}=this.view,o=[],r=[],n=[],a=[],c=[],u=e.spatialReference;for(let m=0;m<e.rings.length;m++){const i=e.rings[m],d=i.length>1&&l(i[0],i[i.length-1]),h=i.length-(d?1:0),p=[];for(let e=0;e<h;++e){const o=i[e],r=f(C(),o[0],o[1],o[2]);s.toRenderCoords(r,u,r);const l=t.rings[m][e],n=f(C(),l[0],l[1],l[2]);s.toRenderCoords(n,u,n);const a=new M(r,n);p.push(a)}e.isClockwise(i)||p.reverse();const g=this.view.state.camera;for(let s=0;s<p.length;++s){const i=p[s],l=p[0===s?p.length-1:s-1],u=p[s===p.length-1?0:s+1],d=e.rings[m][s],h=t.rings[m][s],y=d[2]>h[2],_=new k(i,l,u,y);o.push(_),_.updateOccluded(g);const f=_.isOccluded;y?(f?n:r).push(i):(f?c:a).push(i)}}this._projectionLines=o,this._cutProjectionLines.setGeometryFromSegments(r),this._occludedCutProjectionLines.setGeometryFromSegments(n),this._fillProjectionLines.setGeometryFromSegments(a),this._occludedFillProjectionLines.setGeometryFromSegments(c)}_updateProjectionLineOcclusion(e){const t=[],i=[],s=[],o=[];let r=!1,l=!1;for(const n of this._projectionLines){n.updateOccluded(e)&&(r||=n.isCut,l||=!n.isCut);const a=n.isOccluded;(n.isCut?a?i:t:a?o:s).push(n.segment)}l&&(this._fillProjectionLines.setGeometryFromSegments(s),this._occludedFillProjectionLines.setGeometryFromSegments(o)),r&&(this._cutProjectionLines.setGeometryFromSegments(t),this._occludedCutProjectionLines.setGeometryFromSegments(i))}_updateColors(e,t,i){const{geometryOutlineColor:s,cutColor:r,fillColor:l,cutColorMuted:n,fillColorMuted:a,cutProjectionLineColor:c,fillProjectionLineColor:u}=o;if(this._cutFillRenderNode.cutColor=i?r:n,this._cutFillRenderNode.fillColor=i?l:a,e){const e=t.toUnitRGBA();this._targetGeometry.color=e,this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e,this._fillProjectionLines.color=e,this._occludedFillProjectionLines.color=e,this._cutFillRenderNode.borderColor=t}else{this._targetGeometry.color=s.toUnitRGBA();const e=(i?c:n).toUnitRGBA();this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e;const t=(i?u:a).toUnitRGBA();this._fillProjectionLines.color=t,this._occludedFillProjectionLines.color=t,this._cutFillRenderNode.borderColor=s}}_updateLabels(e){const{effectiveDisplayUnits:t,labelAnchors:s,messages:o,unitsMessages:r,result:l,visible:n}=e;if(this._cutVolumeLabel.visible=n,this._fillVolumeLabel.visible=n,this._cutVolumeLabel.geometry=s?{type:"point",point:s.cut}:null,this._fillVolumeLabel.geometry=s?{type:"point",point:s.fill}:null,null==l||null==o||null==r)return this._cutVolumeLabel.text="-",void(this._fillVolumeLabel.text="-");const a=t.volume,c=i(o.labels.cut,{volume:I(r,l.cutVolume,a)}),u=i(o.labels.fill,{volume:I(r,l.fillVolume,a)});this._cutVolumeLabel.text=c,this._fillVolumeLabel.text=u}_updateCutFillVisibility(e){e?this._cutFillRenderNode.enable():this._cutFillRenderNode.disable()}_updateCutFillGeometry(){const{renderCoordsHelper:e}=this.view,{targetGeometry:t}=this.analysisViewData;if(!t?.extent)return;const{center:i}=t.extent,s=w(i.x,i.y,0),o=C();e.toRenderCoords(s,t.spatialReference,o);const r=this._getExtrudedVolumes(t,this._extrusionHeight,s,o),l=this._getExtrudedVolumes(t,-this._extrusionHeight,s,o);this._cutFillRenderNode.updateGeometries(r,l,o)}_getExtrudedVolumes(e,t,i,s){const{renderCoordsHelper:o,spatialReference:r,elevationProvider:l}=this.view,n=C(),a=1===o.viewingMode;o.worldUpAtPosition(s,n);const c=E(e,l,o,this._elevationContext),{polygons:u,mapPositions:m,position:d}=c;return u.map(e=>{const s=e.count,l=y(e.mapPositions,e.holeIndices,3),c=l.length,u=6*s,h=V(u+c),p=V(c),g=P(3*u),f=P(3*u);S(d,m,l,e,g,null,f,null,h,p,t,n,a);const v=_(),j=_();if(G(r,i,v,o.spatialReference),j[12]=-v[12],j[13]=-v[13],j[14]=-v[14],F(g,g,j),"stockpile"===this.analysis.measureType)for(let t=0;t<f.length;t+=3)f[t]=n[0],f[t+1]=n[1],f[t+2]=n[2];return new N(g,p,h,f)})}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await s("esri/core/t9n/Units"),this.messages=await s("esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis")}finally{this.loadingMessages=!1}}};function I(e,t,i){if(!t||!e)return null;const s=h(t.value,t.unit,i),o=u(s);return c(e,t,s,o)}e([p({constructOnly:!0})],H.prototype,"view",void 0),e([p({constructOnly:!0})],H.prototype,"analysis",void 0),e([p({constructOnly:!0})],H.prototype,"analysisViewData",void 0),e([p()],H.prototype,"unitsMessages",void 0),e([p()],H.prototype,"messages",void 0),e([p()],H.prototype,"loadingMessages",void 0),e([p({readOnly:!0})],H.prototype,"visible",null),e([p()],H.prototype,"updating",null),e([p()],H.prototype,"hasUnsupportedError",null),H=e([g("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillVisualization")],H);class k{constructor(e,t,i,s){this.segment=e,this.previous=t,this.next=i,this.isCut=s,this._isOccluded=!1,this._n1=C(),this._n2=C();const o=v(z,j(z,e.endRenderSpace,e.startRenderSpace));v(this._n1,b(this._n1,o,v(W,j(W,t.startRenderSpace,e.startRenderSpace)))),v(this._n2,b(this._n2,o,v(W,j(W,e.startRenderSpace,i.startRenderSpace)))),this._isConvex=n.normalize(R(this._n1,this._n2,o))<0}get isOccluded(){return this._isOccluded}updateOccluded(e){j(z,this.segment.startRenderSpace,e.eye);const t=L(this._n1,z)<0,i=L(this._n2,z)<0,s=this._isOccluded;return this._isOccluded=this._isConvex?t&&i:t||i,this._isOccluded!==s}}const z=C(),W=C();export{H as VolumeMeasurementCutFillVisualization};
2
+ import{__decorate as e}from"tslib";import{onLocaleChange as t,substitute as i,fetchMessageBundle as s}from"../../../../intl.js";import{volumeMeasurementConfiguration as o}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import{equals as l}from"../../../../core/arrayUtils.js";import{cyclicalPI as n}from"../../../../core/Cyclical.js";import{destroyMaybe as a}from"../../../../core/maybe.js";import{formatDecimal as c,preferredVolumePrecision as u}from"../../../../core/quantityFormatUtils.js";import{watch as m,initial as d}from"../../../../core/reactiveUtils.js";import{adaptiveVolumeUnit as h}from"../../../../core/units.js";import{property as p,subclass as g}from"../../../../core/accessorSupport/decorators.js";import{e as y}from"../../../../chunks/earcut.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f,normalize as v,subtract as j,cross as b,dot as L}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as C,fromValues as w}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as G}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as V}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as P}from"../../../../geometry/support/Indices.js";import{angleAroundAxis as R}from"../../../../geometry/support/vector.js";import{t as F}from"../../../../chunks/vec3.js";import A from"../../../../symbols/support/ElevationInfo.js";import{LabelVisualElement as x}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as M}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as O}from"../../interactive/visualElements/OutlineVisualElement.js";import{EuclideanSegment as D}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as U}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as S}from"../../layers/graphics/extrudeUtils.js";import{polygonToRenderInfo as E}from"../../support/renderInfoUtils/polygon.js";import{CutFillColor as B,VolumeGeometry as N}from"../../webgl-engine/lib/CutFillColor.js";import{createStipplePatternSimple as H}from"../../webgl-engine/materials/lineStippleUtils.js";let T=class extends r{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}get updating(){return this.loadingMessages}get hasUnsupportedError(){const{error:e}=this.analysisViewData;return!!e&&["unsupported-coordinate-system","unsupported-layer-transparency"].includes(e.name)}get _extrusionHeights(){const{renderCoordsHelper:e}=this.view,{labelAnchors:t,targetGeometry:i}=this.analysisViewData,{targetElevationRange:s}=o;if(!i||!t)return{cut:s,fill:-s};let r=-1/0;for(const o of i.rings)for(const e of o)r=Math.max(r,e[2]);const l=1,n=e.getAltitude(t.fill);return{cut:s,fill:Math.min(n-r,0)-l}}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._elevationContext=U.fromElevationInfo(new A({mode:"absolute-height"})),this._projectionLines=[]}initialize(){const{view:e}=this,i={view:e,isDecoration:!0},s=o,r={...i,width:s.geometryOutlineWidth};this._elevationAlignedGeometry=new O({...r,isDraped:!0,color:s.geometryOutlineColor.toUnitRGBA()}),this._targetGeometry=new O(r);const l={...i,attached:!0,width:s.projectionLineWidth,renderOccluded:4,polygonOffset:!0},n={...l,stipplePattern:H(s.projectionLineStippleSize)},a=s.cutProjectionLineColor.toUnitRGBA(),c=s.fillProjectionLineColor.toUnitRGBA();this._cutProjectionLines=new M({...l,color:a}),this._occludedCutProjectionLines=new M({...n,color:a}),this._fillProjectionLines=new M({...l,color:c}),this._occludedFillProjectionLines=new M({...n,color:c});const u={...i,attached:!0};this._cutVolumeLabel=new x({...u,distance:s.labelDistance}),this._fillVolumeLabel=new x({...u,distance:-s.labelDistance}),this._cutFillRenderNode=new B({view:e,cutColor:s.cutColor,fillColor:s.fillColor,borderColor:s.geometryOutlineColor}),this.addHandles([m(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},d),m(()=>({interactive:this.analysisViewData.interactive,measureType:this.analysis.measureType,visible:this.visible}),({visible:e,interactive:t,measureType:i})=>{this._elevationAlignedGeometry.visible=e&&!t,this._targetGeometry.visible=e&&"cut-fill"===i,this._cutFillRenderNode.measureType=i},d),m(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:i})=>this._updateProjectionLines(e,t,i),d),m(()=>({interactive:this.analysisViewData.interactive,accentColor:this.view.effectiveTheme.accentColor,hasResult:!!this.analysisViewData.result}),({interactive:e,accentColor:t,hasResult:i})=>{this._updateColors(e,t,i)},d),m(()=>[this.analysisViewData.targetGeometry,this._extrusionHeights],()=>this._updateCutFillGeometry(),d),m(()=>this.visible&&this.view.state.camera.aboveGround&&!this.hasUnsupportedError,e=>this._updateCutFillVisibility(e),d),m(()=>{const{messages:e,unitsMessages:t,visible:i,analysisViewData:s}=this;return{labelAnchors:s.labelAnchors,effectiveDisplayUnits:s.effectiveDisplayUnits,messages:e,unitsMessages:t,result:s.result,visible:i&&!!s.result}},e=>this._updateLabels(e)),m(()=>this.view.state.camera,e=>this._updateProjectionLineOcclusion(e),d),t(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=a(this._elevationAlignedGeometry),this._targetGeometry=a(this._targetGeometry),this._cutProjectionLines=a(this._cutProjectionLines),this._occludedCutProjectionLines=a(this._occludedCutProjectionLines),this._fillProjectionLines=a(this._fillProjectionLines),this._occludedFillProjectionLines=a(this._occludedFillProjectionLines),this._cutVolumeLabel=a(this._cutVolumeLabel),this._fillVolumeLabel=a(this._fillVolumeLabel),this._cutFillRenderNode.destroy()}_updateProjectionLines(e,t,i){if(this._cutProjectionLines.visible=i,this._occludedCutProjectionLines.visible=i,this._fillProjectionLines.visible=i,this._occludedFillProjectionLines.visible=i,!e||!t)return;const{renderCoordsHelper:s}=this.view,o=[],r=[],n=[],a=[],c=[],u=e.spatialReference;for(let m=0;m<e.rings.length;m++){const i=e.rings[m],d=i.length>1&&l(i[0],i[i.length-1]),h=i.length-(d?1:0),p=[];for(let e=0;e<h;++e){const o=i[e],r=f(C(),o[0],o[1],o[2]);s.toRenderCoords(r,u,r);const l=t.rings[m][e],n=f(C(),l[0],l[1],l[2]);s.toRenderCoords(n,u,n);const a=new D(r,n);p.push(a)}e.isClockwise(i)||p.reverse();const g=this.view.state.camera;for(let s=0;s<p.length;++s){const i=p[s],l=p[0===s?p.length-1:s-1],u=p[s===p.length-1?0:s+1],d=e.rings[m][s],h=t.rings[m][s],y=d[2]>h[2],_=new k(i,l,u,y);o.push(_),_.updateOccluded(g);const f=_.isOccluded;y?(f?n:r).push(i):(f?c:a).push(i)}}this._projectionLines=o,this._cutProjectionLines.setGeometryFromSegments(r),this._occludedCutProjectionLines.setGeometryFromSegments(n),this._fillProjectionLines.setGeometryFromSegments(a),this._occludedFillProjectionLines.setGeometryFromSegments(c)}_updateProjectionLineOcclusion(e){const t=[],i=[],s=[],o=[];let r=!1,l=!1;for(const n of this._projectionLines){n.updateOccluded(e)&&(r||=n.isCut,l||=!n.isCut);const a=n.isOccluded;(n.isCut?a?i:t:a?o:s).push(n.segment)}l&&(this._fillProjectionLines.setGeometryFromSegments(s),this._occludedFillProjectionLines.setGeometryFromSegments(o)),r&&(this._cutProjectionLines.setGeometryFromSegments(t),this._occludedCutProjectionLines.setGeometryFromSegments(i))}_updateColors(e,t,i){const{geometryOutlineColor:s,cutColor:r,fillColor:l,cutColorMuted:n,fillColorMuted:a,cutProjectionLineColor:c,fillProjectionLineColor:u}=o;if(this._cutFillRenderNode.cutColor=i?r:n,this._cutFillRenderNode.fillColor=i?l:a,e){const e=t.toUnitRGBA();this._targetGeometry.color=e,this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e,this._fillProjectionLines.color=e,this._occludedFillProjectionLines.color=e,this._cutFillRenderNode.borderColor=t}else{this._targetGeometry.color=s.toUnitRGBA();const e=(i?c:n).toUnitRGBA();this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e;const t=(i?u:a).toUnitRGBA();this._fillProjectionLines.color=t,this._occludedFillProjectionLines.color=t,this._cutFillRenderNode.borderColor=s}}_updateLabels(e){const{effectiveDisplayUnits:t,labelAnchors:s,messages:o,unitsMessages:r,result:l,visible:n}=e;if(this._cutVolumeLabel.visible=n,this._fillVolumeLabel.visible=n,this._cutVolumeLabel.geometry=s?{type:"point",point:s.cut}:null,this._fillVolumeLabel.geometry=s?{type:"point",point:s.fill}:null,null==l||null==o||null==r)return this._cutVolumeLabel.text="-",void(this._fillVolumeLabel.text="-");const a=t.volume,c=i(o.labels.cut,{volume:I(r,l.cutVolume,a)}),u=i(o.labels.fill,{volume:I(r,l.fillVolume,a)});this._cutVolumeLabel.text=c,this._fillVolumeLabel.text=u}_updateCutFillVisibility(e){e?this._cutFillRenderNode.enable():this._cutFillRenderNode.disable()}_updateCutFillGeometry(){const{renderCoordsHelper:e}=this.view,{targetGeometry:t}=this.analysisViewData,{cut:i,fill:s}=this._extrusionHeights;if(!t?.extent)return;const{center:o}=t.extent,r=w(o.x,o.y,0),l=C();e.toRenderCoords(r,t.spatialReference,l);const n=this._getExtrudedVolumes(t,i,r,l),a=this._getExtrudedVolumes(t,s,r,l);this._cutFillRenderNode.updateGeometries(n,a,l)}_getExtrudedVolumes(e,t,i,s){const{renderCoordsHelper:o,spatialReference:r,elevationProvider:l}=this.view,n=C(),a=1===o.viewingMode;o.worldUpAtPosition(s,n);const c=E(e,l,o,this._elevationContext),{polygons:u,mapPositions:m,position:d}=c;return u.map(e=>{const s=e.count,l=y(e.mapPositions,e.holeIndices,3),c=l.length,u=6*s,h=P(u+c),p=P(c),g=V(3*u),f=V(3*u);S(d,m,l,e,g,null,f,null,h,p,t,n,a);const v=_(),j=_();if(G(r,i,v,o.spatialReference),j[12]=-v[12],j[13]=-v[13],j[14]=-v[14],F(g,g,j),"stockpile"===this.analysis.measureType)for(let t=0;t<f.length;t+=3)f[t]=n[0],f[t+1]=n[1],f[t+2]=n[2];return new N(g,p,h,f)})}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await s("esri/core/t9n/Units"),this.messages=await s("esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis")}finally{this.loadingMessages=!1}}};function I(e,t,i){if(!t||!e)return null;const s=h(t.value,t.unit,i),o=u(s);return c(e,t,s,o)}e([p({constructOnly:!0})],T.prototype,"view",void 0),e([p({constructOnly:!0})],T.prototype,"analysis",void 0),e([p({constructOnly:!0})],T.prototype,"analysisViewData",void 0),e([p()],T.prototype,"unitsMessages",void 0),e([p()],T.prototype,"messages",void 0),e([p()],T.prototype,"loadingMessages",void 0),e([p({readOnly:!0})],T.prototype,"visible",null),e([p()],T.prototype,"updating",null),e([p()],T.prototype,"hasUnsupportedError",null),e([p()],T.prototype,"_extrusionHeights",null),T=e([g("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillVisualization")],T);class k{constructor(e,t,i,s){this.segment=e,this.previous=t,this.next=i,this.isCut=s,this._isOccluded=!1,this._n1=C(),this._n2=C();const o=v(z,j(z,e.endRenderSpace,e.startRenderSpace));v(this._n1,b(this._n1,o,v(W,j(W,t.startRenderSpace,e.startRenderSpace)))),v(this._n2,b(this._n2,o,v(W,j(W,e.startRenderSpace,i.startRenderSpace)))),this._isConvex=n.normalize(R(this._n1,this._n2,o))<0}get isOccluded(){return this._isOccluded}updateOccluded(e){j(z,this.segment.startRenderSpace,e.eye);const t=L(this._n1,z)<0,i=L(this._n2,z)<0,s=this._isOccluded;return this._isOccluded=this._isConvex?t&&i:t||i,this._isOccluded!==s}}const z=C(),W=C();export{T as VolumeMeasurementCutFillVisualization};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{destroyMaybe as e}from"../../../../core/maybe.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{on as o}from"../../../../core/reactiveUtils.js";import{property as i,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{distance as n,exactEquals as a,copy as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../../../geometry/Point.js";import{distanceToScale as h}from"../cameraUtils.js";import{PointOfInterest as p}from"./PointOfInterest.js";import{PropertiesPool as u}from"../../../support/PropertiesPool.js";import{Yield as m}from"../../../support/Yield.js";let _=class extends p{constructor(t){super(t),this._dirty=!1,this._propertiesPool=new u({location:()=>new c,renderLocation:()=>d()},this),this._estimatedSurfaceAltitude=0,this._elevationQueryController=null,this.renderLocation=d(),this._tmpPoint=new c}initialize(){if(this.scheduler&&this.addHandles(this.scheduler.registerTask(this.task,this)),this.runTask(),this.map){const t=()=>this._setDirty();this.addHandles(o(()=>this.map?.ground?.layers,"change",t,{onListenerAdd:t,onListenerRemove:t}))}this._updateRenderLocation()}destroy(){this._cancelPendingRequest(),this._propertiesPool=e(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const t=this._propertiesPool.get("location");return t.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,t),t}get scale(){const t=this._camera,e=n(t.eye,this.renderLocation),r={renderCoordsHelper:this.renderCoordsHelper,state:{camera:t}};return h(r,e)}get updating(){return this._dirty||null!=this._elevationQueryController}updateRenderLocation(){this._setDirty(),this._updateRenderLocation()}_setDirty(){this._dirty||(this._dirty=!0,this.notifyChange("updating"))}_cancelPendingRequest(){const t=this._elevationQueryController;t&&(this._elevationQueryController=null,t.abort(),this.notifyChange("updating"))}get readyToRun(){return!this._elevationQueryController&&this._dirty}runTask(){if(this._cancelPendingRequest(),this._dirty=!1,this.notifyChange("updating"),!this.map?.ground)return this._updateSurfaceAltitude(0),m;const t=this.state.spatialReference;this._tmpPoint.spatialReference=t,this.renderCoordsHelper.fromRenderCoords(this._camera.eye,this._tmpPoint);const e=(this._tmpPoint.z??0)>f&&1===this.renderCoordsHelper.viewingMode&&(t.isWGS84||t.isWebMercator);let o=new AbortController;return this.map.ground.queryElevation(this._tmpPoint,{signal:o.signal,cache:this.cache,minDemResolution:e?g:0}).then(t=>this._updateSurfaceAltitude(t.geometry.z??0)).catch(t=>{r(t)||this._updateSurfaceAltitude(0)}).then(()=>{this._elevationQueryController===o&&(this._elevationQueryController=null,this.notifyChange("updating")),o=null}),this._elevationQueryController=o,m}_updateSurfaceAltitude(t){this._estimatedSurfaceAltitude!==t&&(this._estimatedSurfaceAltitude=t,this._updateRenderLocation())}_updateRenderLocation(){this.renderCoordsHelper.setAltitude(y,this._estimatedSurfaceAltitude,this._camera.eye),a(this._get("renderLocation"),y)||(this._set("renderLocation",l(this._propertiesPool.get("renderLocation"),y)),this.notifyChange("renderLocation"))}};t([i({constructOnly:!0})],_.prototype,"scheduler",void 0),t([i({constructOnly:!0})],_.prototype,"cache",void 0),t([i({constructOnly:!0})],_.prototype,"map",void 0),t([i({constructOnly:!0})],_.prototype,"task",void 0),t([i()],_.prototype,"location",null),t([i()],_.prototype,"renderLocation",void 0),t([i()],_.prototype,"scale",null),t([i()],_.prototype,"updating",null),_=t([s("esri.views.3d.support.pointsOfInterest.CameraOnSurface")],_);const y=d(),f=1e5,g=1e6;export{_ as CameraOnSurface};
2
+ import{__decorate as t}from"tslib";import{destroyMaybe as e}from"../../../../core/maybe.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{on as i}from"../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{distance as n,exactEquals as a,copy as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../../../geometry/Point.js";import{distanceToScale as h}from"../cameraUtils.js";import{PointOfInterest as p}from"./PointOfInterest.js";import{PropertiesPool as u}from"../../../support/PropertiesPool.js";import{Yield as m}from"../../../support/Yield.js";let _=class extends p{constructor(t){super(t),this._dirty=!1,this._propertiesPool=new u({location:()=>new c,renderLocation:()=>d()},this),this._estimatedSurfaceAltitude=0,this._elevationQueryController=null,this.renderLocation=d(),this._tmpPoint=new c}initialize(){if(this.scheduler&&this.addHandles(this.scheduler.registerTask(this.task,this)),this.runTask(),this.map){const t=()=>this._setDirty();this.addHandles(i(()=>this.map?.ground?.layers,"change",t,{onListenerAdd:t,onListenerRemove:t}))}this._updateRenderLocation()}destroy(){this._cancelPendingRequest(),this._propertiesPool=e(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const t=this._propertiesPool.get("location");return t.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,t),t}get scale(){const t=this._camera,e=n(t.eye,this.renderLocation),r={renderCoordsHelper:this.renderCoordsHelper,state:{camera:t}};return h(r,e)}get updating(){return this._dirty||null!=this._elevationQueryController}updateRenderLocation(){this._setDirty(),this._updateRenderLocation()}_setDirty(){this._dirty||(this._dirty=!0,this.notifyChange("updating"))}_cancelPendingRequest(){const t=this._elevationQueryController;t&&(this._elevationQueryController=null,t.abort(),this.notifyChange("updating"))}get readyToRun(){return!this._elevationQueryController&&this._dirty}runTask(){if(this._cancelPendingRequest(),this._dirty=!1,this.notifyChange("updating"),!this.map?.ground)return this._updateSurfaceAltitude(0),m;const t=this.state.spatialReference;this._tmpPoint.spatialReference=t,this.renderCoordsHelper.fromRenderCoords(this._camera.eye,this._tmpPoint);const e=(this._tmpPoint.z??0)>f&&1===this.renderCoordsHelper.viewingMode&&(t.isWGS84||t.isWebMercator);let i=new AbortController;return this.map.ground.queryElevation(this._tmpPoint,{signal:i.signal,cache:this.cache,minDemResolution:e?g:0}).then(t=>this._updateSurfaceAltitude(t.geometry.z??0)).catch(t=>{r(t)||this._updateSurfaceAltitude(0)}).finally(()=>{this._elevationQueryController===i&&(this._elevationQueryController=null,this.notifyChange("updating")),i=null}),this._elevationQueryController=i,this.notifyChange("updating"),m}_updateSurfaceAltitude(t){this._estimatedSurfaceAltitude!==t&&(this._estimatedSurfaceAltitude=t,this._updateRenderLocation())}_updateRenderLocation(){this.renderCoordsHelper.setAltitude(y,this._estimatedSurfaceAltitude,this._camera.eye),a(this._get("renderLocation"),y)||(this._set("renderLocation",l(this._propertiesPool.get("renderLocation"),y)),this.notifyChange("renderLocation"))}};t([o({constructOnly:!0})],_.prototype,"scheduler",void 0),t([o({constructOnly:!0})],_.prototype,"cache",void 0),t([o({constructOnly:!0})],_.prototype,"map",void 0),t([o({constructOnly:!0})],_.prototype,"task",void 0),t([o()],_.prototype,"location",null),t([o()],_.prototype,"renderLocation",void 0),t([o()],_.prototype,"scale",null),t([o()],_.prototype,"updating",null),_=t([s("esri.views.3d.support.pointsOfInterest.CameraOnSurface")],_);const y=d(),f=1e5,g=1e6;export{_ as CameraOnSurface};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{nextHighestPowerOfTwo as t}from"../../../../../core/mathUtils.js";import{disposeMaybe as e}from"../../../../../core/maybe.js";import{copy as r,invert as o,transpose as s}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{glLayout as a}from"../../../support/buffer/glUtil.js";import{VertexArrayObject as f}from"../../lib/VertexArrayObject.js";import{getMaxItemCount as i,getMaxByteSize as u}from"../../lib/TextureBackedBuffer/TextureBackedBufferUtils.js";import{TextureBuffer as c}from"../../lib/TextureBackedBuffer/TextureBuffer.js";import{bufferRangePool as m}from"./BufferRange.js";import{DrawCommand as g}from"./DrawCommand.js";import{BaseInstanceData as l}from"./PerBaseInstanceData.js";import{VertexBuffer as h}from"../../../../webgl/VertexBuffer.js";class y{constructor(t,e){this._rctx=e;const r=t.createBufferWriter();this._bufferWriter=r,this._vaoCache=e.getVaoCache(a(r.layout));const o=["geometry"];"textureBufferLayout"in r&&null!=r.textureBufferLayout&&o.push("texture"),this.targetBuffers=o}maxElements(t){if("texture"===t){const t=this._targetLayout("texture");return null==t?0:i(this._rctx,t)}return Math.floor(x/this._targetStrideBytes(t))}_targetStrideBytes(t){return this._targetLayout(t)?.stride??0}_targetLayout(t){return"geometry"===t?this._bufferWriter.layout:"baseInstance"===t?this._bufferWriter.baseInstanceLayout:this._bufferWriter.textureBufferLayout}evaluateBufferAllocation(t,e,r,o){const s=this._targetStrideBytes("geometry"),n=e.reduce((t,{geometry:e})=>t+this.vertexElementCount(e),0),a=r.reduce((t,{geometry:e})=>t+this.vertexElementCount(e),0),f=Math.min((t+n-a)*s,x),i=o.vao?.buffer("geometry"),u=i?.sizeBytes??0;return f>b&&f<u/2?0:f>u?1:2}deleteBuffer(t){if(t.isInstanced)return t.instancedCommandVAOs?.dispose(),t.vao?.buffer("geometry")?.dispose(),t.vao?.disposeVAOOnly(),void(t.vao=null);this._vaoCache.deleteVao(t.vao),t.vaoEndElement=0,t.textureBuffer=e(t.textureBuffer),t.textureEndElement=0}createBaseInstanceData(t){const{_bufferWriter:e}=this;if(null==t||null==e.baseInstanceLayout||null==e.writeBaseInstance||null==e.elementCountBaseInstance)return null;const r=this._targetLayout("baseInstance"),o=e.elementCountBaseInstance(t.attributes),s=o*r.stride,n=new h(this._rctx,a(r));n.setSize(Math.ceil(s));const f=S(s),i=r.createView(f.buffer);e.writeBaseInstance(t.attributes,i),n.setSubData(f,0,0,s);const u=new g;return u.first=0,u.count=o,new l(t,n,u)}_allocateInstanceBuffer(t){const e=this._bufferWriter.layout,r=t*this._targetStrideBytes("geometry"),o=new h(this._rctx,a(e,1));return o.setSize(v(r)),o}_createInstancedVao(t,e){return new f(this._rctx,new Map([["baseInstance",t],["geometry",e]]))}reallocateBuffer(t,e,r){if(this.deleteBuffer(e),null!=t){const o=t.baseInstanceBuffer,s=this._allocateInstanceBuffer(r.geometry);e.vao=this._createInstancedVao(o,s)}else{const t=r.geometry*this._targetStrideBytes("geometry");e.vao=this._vaoCache.newVao(v(t))}const o=this._targetLayout("texture");if(null!=o){const t=v(r.texture*o.stride),s=Math.ceil(t/o.stride);e.textureBuffer=new c(this._rctx,o,s)}e.vaoEndElement=Math.floor((e.vao?.getByteLength("geometry")??0)/this._targetStrideBytes("geometry")),e.textureEndElement=e.textureBuffer?.itemCount??0}elementCount(t,e){const{attributes:r}=t;return"geometry"===e?this._bufferWriter.elementCount(r):"baseInstance"===e?this._bufferWriter.elementCountBaseInstance?.(r)??0:this._bufferWriter.elementCountTextureBuffer?.(r)??0}vertexElementCount(t){return this._bufferWriter.elementCount(t.attributes)}textureElementCount(t){return this._bufferWriter.elementCountTextureBuffer?.(t.attributes)??0}canGrow(t,e){const r=this.targetBuffers.map(r=>this._evaluateTargetBufferGrowth(r,t,e));return r.every(({canGrow:t})=>t)&&r.some(({needsToGrow:t})=>t)}_evaluateTargetBufferGrowth(t,e,r){const o=this._targetLayout(t),s=e.getTargetBuffer(t);if(null==o||null==s)return{needsToGrow:null!=o,canGrow:!0};return{needsToGrow:r[t]*o.stride>s.sizeBytes,canGrow:"geometry"===t?s.sizeBytes<v(x-b):s.sizeBytes<u(this._rctx,o)}}clearHoles(t,e){for(const r of this.targetBuffers){const o=this._targetStrideBytes(r),s=t[r],n=s.reduce((t,e)=>Math.max(t,e.numElements),0)*o,a=S(n);a.fill(0,0,n);for(const t of s)this._setTargetSubData(r,e,o,t,a)}}clearHolesMetal(t,e,r){const{targetBuffers:o}=this,s={};let n=0;for(const i of o){const t=e[i].numElements*this._targetStrideBytes(i);s[i]=n,n+=t}const a=S(n);a.fill(0,0,n);const f={};for(const i of o)f[i]=this._targetLayout(i)?.createView(a.buffer,s[i]);for(const i of t){const t=i.targetRanges.geometry;if(!(t.from>=e.geometry.from&&t.to<=e.geometry.to))continue;const r={};for(const s of o)r[s]=i.targetRanges[s].from-e[s].from;this._writeGeometry(i.geometry,f,r,i.targetRanges)}for(const i of o)this._setTargetSubData(i,r,this._targetStrideBytes(i),e[i],a,s[i])}writeRandomInstances(t,e,r){const{targetBuffers:o}=this,s={},n={},a={},f={};let i=0;for(const g of o)s[g]=t[g]*this._targetStrideBytes(g),n[g]=i,a[g]=0,f[g]=m.acquire(0,0),i+=s[g];const u=S(i),c={};for(const m of o)c[m]=this._targetLayout(m)?.createView(u.buffer,n[m]);for(const m of e){for(const t of o){const e=m.targetRanges[t],o=f[t];o.to===e.from||(o.numElements>0&&this._setTargetSubData(t,r,this._targetStrideBytes(t),f[t],u,n[t]),o.from=e.from,a[t]=0)}this._writeGeometry(m.geometry,c,a,m.targetRanges);for(const t of o){const e=m.targetRanges[t];a[t]+=e.numElements,f[t].to=e.to}}for(const g of o){const t=f[g];t.numElements>0&&this._setTargetSubData(g,r,this._targetStrideBytes(g),t,u,n[g]),m.release(f[g])}}writeInstanceRangeMetal(t,e,r){const{targetBuffers:o}=this,s={},n={};let a=0;for(const u of o)s[u]=t[u].numElements*this._targetStrideBytes(u),n[u]=a,a+=s[u];const f=S(a),i={};for(const u of o)i[u]=this._targetLayout(u)?.createView(f.buffer,n[u]);f.fill(0,0,a);for(const u of e){const e=u.targetRanges.geometry;if(!(e.from>=t.geometry.from&&e.to<=t.geometry.to))continue;const r={},s={};for(const n of o){const e=u.targetRanges[n];r[n]=e.from-t[n].from,s[n]=e}this._writeGeometry(u.geometry,i,r,s)}for(const u of o)t[u].numElements>0&&this._setTargetSubData(u,r,this._targetStrideBytes(u),t[u],f,n[u])}rebuildInstances(t,e,r){const{targetBuffers:o}=this,s={},n={},a={};let f=0;for(const c of o)s[c]=t[c]*this._targetStrideBytes(c),n[c]=f,f+=s[c],a[c]=0;const i=S(f),u={};for(const c of o)u[c]=this._targetLayout(c)?.createView(i.buffer,n[c]);for(const c of e){const t={},e={};for(const r of o){t[r]=a[r],a[r]+=this.elementCount(c.geometry.geometry,r);const o=c.targetRanges[r];o.from=t[r],o.to=a[r],e[r]=o}this._writeGeometry(c.geometry,u,t,e)}for(const c of o){const t=m.acquire(0,a[c]);this._setTargetSubData(c,r,this._targetStrideBytes(c),t,i,n[c]),m.release(t)}return a}updateInstance(t,e){const{targetBuffers:r}=this,o={},s={};let n=0;for(const i of r){const e=this._targetStrideBytes(i);o[i]=this.elementCount(t.geometry.geometry,i)*e,s[i]=n,n+=o[i]}const a=S(n),f={};for(const i of r)f[i]=this._targetLayout(i)?.createView(a.buffer,s[i]);this._writeGeometry(t.geometry,f,s,t.targetRanges);for(const i of r)this._setTargetSubData(i,e,this._targetStrideBytes(i),t.targetRanges[i],a,s[i])}updateInstancesMetal(t){const{targetBuffers:e}=this;for(const[r,o]of t){const t={};for(const r of e)t[r]=m.acquire(1/0,-1/0);for(const r of o)for(const o of e){const e=t[o],s=r.targetRanges[o];e.from=Math.min(e.from,s.from),e.to=Math.max(e.to,s.to)}this.writeInstanceRangeMetal(t,r.instances.values(),r);for(const r of e)m.release(t[r])}}_writeGeometry(t,e,n,a){const{_bufferWriter:f}=this;null!=f&&(r(B,t.transformation),B[12]-=t.localOrigin.vec3[0],B[13]-=t.localOrigin.vec3[1],B[14]-=t.localOrigin.vec3[2],o(_,B),s(_,_),f.write(B,_,t.geometry.attributes,t.geometry.olidColor,e.geometry,n.geometry,a.texture),null!=e.texture&&f.writeTextureBuffer&&f.writeTextureBuffer(B,_,t.geometry.attributes,e.texture,n.texture))}_setTargetSubData(t,e,r,o,s,n=0){if("geometry"===t){const a=e.getTargetBuffer(t);a?.setSubData(s,o.from*r,n,o.numElements*r)}else if("texture"===t){const r=e.getTargetBuffer(t);r?.setSubData(s.buffer,o.from,n,o.numElements)}}static prune(){w=new Uint8Array(b)}}const B=n(),_=n(),b=262144,d=1024,x=16777216;let w=new Uint8Array(b);function S(t){return w.byteLength<t&&(w=new Uint8Array(t)),w}function v(e){return e<=d?d:e<b?t(e):Math.max(Math.min(Math.ceil(1.5*e/b)*b,x),e)}export{y as VaoWriter};
2
+ import{nextHighestPowerOfTwo as t}from"../../../../../core/mathUtils.js";import{disposeMaybe as e}from"../../../../../core/maybe.js";import{copy as r,invert as o,transpose as s}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{glLayout as a}from"../../../support/buffer/glUtil.js";import{VertexArrayObject as f}from"../../lib/VertexArrayObject.js";import{getMaxItemCount as i,getMaxByteSize as u}from"../../lib/TextureBackedBuffer/TextureBackedBufferUtils.js";import{TextureBuffer as c}from"../../lib/TextureBackedBuffer/TextureBuffer.js";import{bufferRangePool as m}from"./BufferRange.js";import{DrawCommand as g}from"./DrawCommand.js";import{BaseInstanceData as l}from"./PerBaseInstanceData.js";import{VertexBuffer as h}from"../../../../webgl/VertexBuffer.js";class y{constructor(t,e){this._rctx=e;const r=t.createBufferWriter();this._bufferWriter=r,this._vaoCache=e.getVaoCache(a(r.layout));const o=["geometry"];"textureBufferLayout"in r&&null!=r.textureBufferLayout&&o.push("texture"),this.targetBuffers=o}maxElements(t){if("texture"===t){const t=this._targetLayout("texture");return null==t?0:i(this._rctx,t)}return Math.floor(x/this._targetStrideBytes(t))}_targetStrideBytes(t){return this._targetLayout(t)?.stride??0}_targetLayout(t){return"geometry"===t?this._bufferWriter.layout:"baseInstance"===t?this._bufferWriter.baseInstanceLayout:this._bufferWriter.textureBufferLayout}evaluateBufferAllocation(t,e,r,o){const s=this._targetStrideBytes("geometry"),n=e.reduce((t,{geometry:e})=>t+this.vertexElementCount(e),0),a=r.reduce((t,{geometry:e})=>t+this.vertexElementCount(e),0),f=Math.min((t+n-a)*s,x),i=o.vao?.buffer("geometry"),u=i?.sizeBytes??0;return f>b&&f<u/2?0:f>u?1:2}deleteBuffer(t){if(t.isInstanced)return t.instancedCommandVAOs?.dispose(),t.vao?.buffer("geometry")?.dispose(),t.vao?.disposeVAOOnly(),void(t.vao=null);this._vaoCache.deleteVao(t.vao),t.vaoEndElement=0,t.textureBuffer=e(t.textureBuffer),t.textureEndElement=0}createBaseInstanceData(t){const{_bufferWriter:e}=this;if(null==t||null==e.baseInstanceLayout||null==e.writeBaseInstance||null==e.elementCountBaseInstance)return null;const r=this._targetLayout("baseInstance"),o=e.elementCountBaseInstance(t.attributes),s=o*r.stride,n=new h(this._rctx,a(r));n.setSize(Math.ceil(s));const f=S(s),i=r.createView(f.buffer);e.writeBaseInstance(t.attributes,i),n.setSubData(f,0,0,s);const u=new g;return u.first=0,u.count=o,new l(t,n,u)}_allocateInstanceBuffer(t){const e=this._bufferWriter.layout,r=t*this._targetStrideBytes("geometry"),o=new h(this._rctx,a(e,1));return o.setSize(v(r)),o}_createInstancedVao(t,e){return new f(this._rctx,new Map([["baseInstance",t],["geometry",e]]))}reallocateBuffer(t,e,r){if(this.deleteBuffer(e),null!=t){const o=t.baseInstanceBuffer,s=this._allocateInstanceBuffer(r.geometry);e.vao=this._createInstancedVao(o,s)}else{const t=r.geometry*this._targetStrideBytes("geometry");e.vao=this._vaoCache.newVao(v(t))}const o=this._targetLayout("texture");if(null!=o){const t=v(r.texture*o.stride),s=Math.ceil(t/o.stride);e.textureBuffer=new c(this._rctx,o,s)}e.vaoEndElement=Math.floor((e.vao?.getByteLength("geometry")??0)/this._targetStrideBytes("geometry")),e.textureEndElement=e.textureBuffer?.itemCount??0}elementCount(t,e){const{attributes:r}=t;return"geometry"===e?this._bufferWriter.elementCount(r):"baseInstance"===e?this._bufferWriter.elementCountBaseInstance?.(r)??0:this._bufferWriter.elementCountTextureBuffer?.(r)??0}vertexElementCount(t){return this._bufferWriter.elementCount(t.attributes)}textureElementCount(t){return this._bufferWriter.elementCountTextureBuffer?.(t.attributes)??0}canGrow(t,e){const r=this.targetBuffers.map(r=>this._evaluateTargetBufferGrowth(r,t,e));return r.every(({canGrow:t})=>t)&&r.some(({needsToGrow:t})=>t)}_evaluateTargetBufferGrowth(t,e,r){const o=this._targetLayout(t),s=e.getTargetBuffer(t);if(null==o||null==s)return{needsToGrow:null!=o,canGrow:!0};return{needsToGrow:r[t]*o.stride>s.sizeBytes,canGrow:"geometry"===t?s.sizeBytes<v(x-b):s.sizeBytes<u(this._rctx,o)}}clearHoles(t,e){for(const r of this.targetBuffers){const o=this._targetStrideBytes(r),s=t[r],n=s.reduce((t,e)=>Math.max(t,e.numElements),0)*o,a=S(n);a.fill(0,0,n);for(const t of s)this._setTargetSubData(r,e,o,t,a)}}clearHolesMetal(t,e,r){const{targetBuffers:o}=this,s={};let n=0;for(const i of o){const t=e[i].numElements*this._targetStrideBytes(i);s[i]=n,n+=t}const a=S(n);a.fill(0,0,n);const f={};for(const i of o)f[i]=this._targetLayout(i)?.createView(a.buffer,s[i]);for(const i of t){const t=i.targetRanges.geometry;if(!(t.from>=e.geometry.from&&t.to<=e.geometry.to))continue;const r={};for(const s of o)r[s]=i.targetRanges[s].from-e[s].from;this._writeGeometry(i.geometry,f,r,i.targetRanges)}for(const i of o)this._setTargetSubData(i,r,this._targetStrideBytes(i),e[i],a,s[i])}writeRandomInstances(t,e,r){const{targetBuffers:o}=this,s={},n={},a={},f={};let i=0;for(const g of o)s[g]=t[g]*this._targetStrideBytes(g),n[g]=i,a[g]=0,f[g]=m.acquire(0,0),i+=s[g];const u=S(i),c={};for(const m of o)c[m]=this._targetLayout(m)?.createView(u.buffer,n[m]);for(const m of e){for(const t of o){const e=m.targetRanges[t],o=f[t];o.to===e.from||(o.numElements>0&&this._setTargetSubData(t,r,this._targetStrideBytes(t),f[t],u,n[t]),o.from=e.from,a[t]=0)}this._writeGeometry(m.geometry,c,a,m.targetRanges);for(const t of o){const e=m.targetRanges[t];a[t]+=e.numElements,f[t].to=e.to}}for(const g of o){const t=f[g];t.numElements>0&&this._setTargetSubData(g,r,this._targetStrideBytes(g),t,u,n[g]),m.release(f[g])}}writeInstanceRangeMetal(t,e,r){const{targetBuffers:o}=this,s={},n={};let a=0;for(const u of o)s[u]=t[u].numElements*this._targetStrideBytes(u),n[u]=a,a+=s[u];const f=S(a),i={};for(const u of o)i[u]=this._targetLayout(u)?.createView(f.buffer,n[u]);f.fill(0,0,a);for(const u of e){const e=u.targetRanges.geometry;if(!(e.from>=t.geometry.from&&e.to<=t.geometry.to))continue;const r={},s={};for(const n of o){const e=u.targetRanges[n];r[n]=e.from-t[n].from,s[n]=e}this._writeGeometry(u.geometry,i,r,s)}for(const u of o)t[u].numElements>0&&this._setTargetSubData(u,r,this._targetStrideBytes(u),t[u],f,n[u])}rebuildInstances(t,e,r){const{targetBuffers:o}=this,s={},n={},a={};let f=0;for(const c of o)s[c]=t[c]*this._targetStrideBytes(c),n[c]=f,f+=s[c],a[c]=0;const i=S(f),u={};for(const c of o)u[c]=this._targetLayout(c)?.createView(i.buffer,n[c]);for(const c of e){const t={},e={};for(const r of o){t[r]=a[r],a[r]+=this.elementCount(c.geometry.geometry,r);const o=c.targetRanges[r];o.from=t[r],o.to=a[r],e[r]=o}this._writeGeometry(c.geometry,u,t,e)}for(const c of o){const t=m.acquire(0,a[c]);this._setTargetSubData(c,r,this._targetStrideBytes(c),t,i,n[c]),m.release(t)}return a}updateInstance(t,e){const{targetBuffers:r}=this,o={},s={};let n=0;for(const u of r){const e=this._targetStrideBytes(u);o[u]=this.elementCount(t.geometry.geometry,u)*e,s[u]=n,n+=o[u]}const a=S(n),f={},i={};for(const u of r)i[u]=0,f[u]=this._targetLayout(u)?.createView(a.buffer,s[u]);this._writeGeometry(t.geometry,f,i,t.targetRanges);for(const u of r)this._setTargetSubData(u,e,this._targetStrideBytes(u),t.targetRanges[u],a,s[u])}updateInstancesMetal(t){const{targetBuffers:e}=this;for(const[r,o]of t){const t={};for(const r of e)t[r]=m.acquire(1/0,-1/0);for(const r of o)for(const o of e){const e=t[o],s=r.targetRanges[o];e.from=Math.min(e.from,s.from),e.to=Math.max(e.to,s.to)}this.writeInstanceRangeMetal(t,r.instances.values(),r);for(const r of e)m.release(t[r])}}_writeGeometry(t,e,n,a){const{_bufferWriter:f}=this;null!=f&&(r(B,t.transformation),B[12]-=t.localOrigin.vec3[0],B[13]-=t.localOrigin.vec3[1],B[14]-=t.localOrigin.vec3[2],o(_,B),s(_,_),f.write(B,_,t.geometry.attributes,t.geometry.olidColor,e.geometry,n.geometry,a.texture),null!=e.texture&&f.writeTextureBuffer&&f.writeTextureBuffer(B,_,t.geometry.attributes,e.texture,n.texture))}_setTargetSubData(t,e,r,o,s,n=0){if("geometry"===t){const a=e.getTargetBuffer(t);a?.setSubData(s,o.from*r,n,o.numElements*r)}else if("texture"===t){const r=e.getTargetBuffer(t);r?.setSubData(s.buffer,o.from,n,o.numElements)}}static prune(){w=new Uint8Array(b)}}const B=n(),_=n(),b=262144,d=1024,x=16777216;let w=new Uint8Array(b);function S(t){return w.byteLength<t&&(w=new Uint8Array(t)),w}function v(e){return e<=d?d:e<b?t(e):Math.max(Math.min(Math.ceil(1.5*e/b)*b,x),e)}export{y as VaoWriter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../core/Accessor.js";import{makeHandle as s}from"../core/handleUtils.js";import{isActivationKey as i}from"../core/keyboard.js";import{watch as o,initial as r}from"../core/reactiveUtils.js";import{renderingSanitizer as a}from"../core/sanitizerUtils.js";import{addFrameTask as n}from"../core/scheduling.js";import{property as h,subclass as c}from"../core/accessorSupport/decorators.js";import{getCalciteModeClassName as d,setCalciteModeClass as l}from"../support/modeUtils.js";import{globalCss as p}from"../widgets/support/globalCss.js";const u="esri-attribution",_={poweredBy:`${u}__powered-by`,sources:`${u}__sources`,sourcesOpen:`${u}__sources--open`,link:`${u}__link`};let m=class extends t{constructor(e){super(e),this._previousSourceHeight=0,this._opened=!1,this._overflowing=!1,this._changeSet=new Set,this.height=0,this._toggleState=()=>{(this._opened||this._overflowing)&&(this._opened=!this._opened,this._invalidate("opened"))},this.surface=document.createElement("div"),this._task=n({render:()=>{this._update(),this._task.pause(),this._changeSet.clear()}}),this.addHandles(this._task)}appendTo(e){e.appendChild(this.surface),this._invalidate("mode")}initialize(){const e=document.createElement("div");e.setAttribute("dir","ltr"),e.classList.add("esri-widget","esri-view-attribution","esri-attribution"),this._set("surface",e);const t=new ResizeObserver(()=>{this.height=e.clientHeight});t.observe(e),this.addHandles(s(()=>t.disconnect())),e.innerHTML=`\n <div class="${_.sources}"></div>\n <div class="${_.poweredBy}">\n Powered by\n <a class="${_.link}" href="https://www.esri.com/" rel="noreferrer" target="_blank">Esri</a>\n </div>`,this.addHandles([this.surface,o(()=>this.attributionItems,()=>this._invalidate("attributionItems"),r),o(()=>this.mode,()=>this._invalidate("mode"),r)]);const a=e.querySelector(`.${_.sources}`);this._previousSourceHeight=a.clientHeight;const n=new ResizeObserver(()=>{this._invalidate("overflow")});n.observe(a),this.addHandles(s(()=>n.disconnect()));const h=new MutationObserver(()=>{this._invalidate("overflow")});h.observe(a,{childList:!0,subtree:!0,characterData:!0}),this.addHandles(s(()=>h.disconnect())),a.onclick=this._toggleState,a.onkeydown=e=>{i(e.key)&&(e.preventDefault(),this._toggleState())}}_invalidate(e){this._changeSet.add(e),this._task.resume()}_update(){const e=this.surface.querySelector(`.${_.sources}`);if(this._changeSet.has("overflow")){const{clientHeight:t,clientWidth:s,scrollWidth:i}=e,o=t<this._previousSourceHeight;this._previousSourceHeight=t,this._opened?o&&(this._opened=!1):o||(this._overflowing=i>s)}if(this._changeSet.has("overflow")||this._changeSet.has("opened")){const t=this._opened||this._overflowing,s=t?"0":"";e.setAttribute("tabindex",s),e.classList.toggle(p.interactive,t),e.classList.toggle(_.sourcesOpen,this._opened)}this._changeSet.has("attributionItems")&&(e.innerHTML=a.sanitize(this.attributionItems?.map(e=>e.text).join(" | ")??"")),this._changeSet.has("mode")&&(this.surface.classList.remove(d("light"),d("dark")),this.mode?this.surface.classList.add(d(this.mode)):l(this.surface))}};e([h()],m.prototype,"attributionItems",void 0),e([h()],m.prototype,"height",void 0),e([h({type:["dark","light"]})],m.prototype,"mode",void 0),e([h({readOnly:!0})],m.prototype,"surface",void 0),m=e([c("esri.views.Attribution")],m);export{m as Attribution};
2
+ import{__decorate as e}from"tslib";import t from"../core/Accessor.js";import{makeHandle as s}from"../core/handleUtils.js";import{isActivationKey as i}from"../core/keyboard.js";import{watch as o,initial as r}from"../core/reactiveUtils.js";import{renderingSanitizer as n}from"../core/sanitizerUtils.js";import{addFrameTask as a}from"../core/scheduling.js";import{property as h,subclass as c}from"../core/accessorSupport/decorators.js";import{getCalciteModeClassName as d,setCalciteModeClass as l}from"../support/modeUtils.js";import{globalCss as p}from"../widgets/support/globalCss.js";const u="esri-attribution",_={poweredBy:`${u}__powered-by`,sources:`${u}__sources`,sourcesOpen:`${u}__sources--open`,link:`${u}__link`};let m=class extends t{constructor(e){super(e),this._previousSourceHeight=0,this._opened=!1,this._overflowing=!1,this._changeSet=new Set,this.height=0,this._toggleState=()=>{(this._opened||this._overflowing)&&(this._opened=!this._opened,this._invalidate("opened"))},this.surface=document.createElement("div"),this._task=a({render:()=>{this._update(),this._task.pause(),this._changeSet.clear()}}),this.addHandles(this._task)}appendBefore(e,t){e.insertBefore(this.surface,t),this._invalidate("mode")}initialize(){const e=document.createElement("div");e.setAttribute("dir","ltr"),e.classList.add("esri-widget","esri-view-attribution","esri-attribution"),this._set("surface",e);const t=new ResizeObserver(()=>{this.height=e.clientHeight});t.observe(e),this.addHandles(s(()=>t.disconnect())),e.innerHTML=`\n <div class="${_.sources}"></div>\n <div class="${_.poweredBy}">\n Powered by\n <a class="${_.link}" href="https://www.esri.com/" rel="noreferrer" target="_blank">Esri</a>\n </div>`,this.addHandles([this.surface,o(()=>this.attributionItems,()=>this._invalidate("attributionItems"),r),o(()=>this.mode,()=>this._invalidate("mode"),r)]);const n=e.querySelector(`.${_.sources}`);this._previousSourceHeight=n.clientHeight;const a=new ResizeObserver(()=>{this._invalidate("overflow")});a.observe(n),this.addHandles(s(()=>a.disconnect()));const h=new MutationObserver(()=>{this._invalidate("overflow")});h.observe(n,{childList:!0,subtree:!0,characterData:!0}),this.addHandles(s(()=>h.disconnect())),n.onclick=this._toggleState,n.onkeydown=e=>{i(e.key)&&(e.preventDefault(),this._toggleState())}}_invalidate(e){this._changeSet.add(e),this._task.resume()}_update(){const e=this.surface.querySelector(`.${_.sources}`);if(this._changeSet.has("overflow")){const{clientHeight:t,clientWidth:s,scrollWidth:i}=e,o=t<this._previousSourceHeight;this._previousSourceHeight=t,this._opened?o&&(this._opened=!1):o||(this._overflowing=i>s)}if(this._changeSet.has("overflow")||this._changeSet.has("opened")){const t=this._opened||this._overflowing,s=t?"0":"";e.setAttribute("tabindex",s),e.classList.toggle(p.interactive,t),e.classList.toggle(_.sourcesOpen,this._opened)}this._changeSet.has("attributionItems")&&(e.innerHTML=n.sanitize(this.attributionItems?.map(e=>e.text).join(" | ")??"")),this._changeSet.has("mode")&&(this.surface.classList.remove(d("light"),d("dark")),this.mode?this.surface.classList.add(d(this.mode)):l(this.surface))}};e([h()],m.prototype,"attributionItems",void 0),e([h()],m.prototype,"height",void 0),e([h({type:["dark","light"]})],m.prototype,"mode",void 0),e([h({readOnly:!0})],m.prototype,"surface",void 0),m=e([c("esri.views.Attribution")],m);export{m as Attribution};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{byId as e,reparent as i}from"../core/domUtils.js";import{on as s}from"../core/events.js";import{makeHandle as r}from"../core/handleUtils.js";import n from"../core/Logger.js";import{destroyMaybe as o,removeMaybe as a}from"../core/maybe.js";import{watch as h,initial as d,syncAndInitial as l}from"../core/reactiveUtils.js";import{addFrameTask as u}from"../core/scheduling.js";import{property as c,subclass as p}from"../core/accessorSupport/decorators.js";import{Attribution as m}from"./Attribution.js";import f from"./overlay/ViewOverlay.js";const _=[0,0];function y(t){const e=(t.ownerDocument||window.document).defaultView,i=t.getBoundingClientRect();return _[0]=i.left+(e?.pageXOffset??0),_[1]=i.top+(e?.pageYOffset??0),_}function g(t){t&&(t.textContent="",t.parentNode&&t.parentNode.removeChild(t))}const v="test"===process.env.NODE_ENV,b=v?0:16,w=v?0:750,C=v?0:512,H=2,O=_=>{const v=_;let O=class extends v{constructor(...t){super(...t),this._freqInfo={freq:b,time:w},this._overlayRenderTaskHandle=null,this.aria={},this.attributionMode=null,this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([h(()=>this.cursor,t=>{const{surface:e}=this;e&&e.setAttribute("data-cursor",t)}),h(()=>this.navigating,t=>{const{surface:e}=this;e&&e.setAttribute("data-navigating",t.toString())}),h(()=>[this.aria,this.surface],()=>this._updateAria(),{initial:!0})])}initialize(){const t=this;this.addHandles([h(()=>this.ui,(t,e)=>this._handleUIChange(t,e),d),t.on("focus",()=>this.notifyChange("focused")),t.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui?.destroy(),this.container=null)}get attributionHeight(){return this._attribution?.height??0}get container(){return this._get("container")??null}set container(t){const s=this._get("container"),r=e(t);if(r||"string"!=typeof t||n.getLogger(this).error("#container",`element with id '${t}' not found`),s===r)return;if(this._stopMeasuring(),this.removeHandles("container"),s&&(s.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this._attribution=o(this._attribution),this.root&&(g(this.root),this._set("root",null)),this.userContent&&(i(this.userContent,s),g(this.userContent),this._set("userContent",null))),!r)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);r.classList.add("esri-view");const d=document.createElement("div");d.className="esri-view-user-storage",i(r,d),r.appendChild(d),this._set("userContent",d);const c=document.createElement("div");c.className="esri-view-root",r.insertBefore(c,r.firstChild),this._set("root",c);const p=document.createElement("div");p.className="esri-view-surface",p.setAttribute("role","application"),p.tabIndex=0,c.appendChild(p),this._set("surface",p);const _=new f;c.appendChild(_.surface),this._set("overlay",_),this.addHandles(h(()=>_.needsRender,t=>{t&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=u({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=a(this._overlayRenderTaskHandle)}),"container"),this.addHandles([h(()=>({visible:this.attributionVisible&&this.ready,items:this.attributionItems,mode:this.attributionMode}),({visible:t,items:e,mode:i})=>{t?(this._attribution||(this._attribution=new m({attributionItems:this.attributionItems,mode:this.attributionMode}),this._attribution.appendTo(c)),this._attribution.attributionItems=e,this._attribution.mode=i):this._attribution=o(this._attribution)},l)],"container"),this.forceDOMReadyCycle(),this._set("container",r),this._startMeasuring()}get focused(){const t=document.activeElement===this.surface;return document.hasFocus()&&t}get size(){return[this.width,this.height]}get ui(){return this._get("ui")}set ui(t){const e=this._get("ui");e!==t&&e?.destroy(),this._set("ui",t)}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(t,e,i){const s=this.position;return t-=s?s[0]:0,e-=s?s[1]:0,i?(i[0]=t,i[1]=e):i=[t,e],i}containerToPage(t,e,i){const s=this.position;return t+=s?s[0]:0,e+=s?s[1]:0,i?(i[0]=t,i[1]=e):i=[t,e],i}_updateAria(){const{surface:t,aria:e}=this;t&&(t.ariaLabelledByElements=e?.labelledByElements??null,t.ariaDescribedByElements=e?.describedByElements??null,t.ariaLabel=e?.label??null,t.ariaDescription=e?.description??null)}_handleUIChange(t,e){this.removeHandles("ui"),e&&e!==t&&e.destroy(),t&&(t.view=this,this.addHandles(h(()=>this.root,e=>{if(e){const i=document.createElement("div");e.insertBefore(i,this._attribution?.surface??null),t.container=i}else t.container=null},d),"ui")),this._set("ui",t)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const t=this._freqInfo;t.freq=b,t.time=w;const e=u({prepare:t=>{const i=this._measure(),s=this._freqInfo;if(s.time+=t.deltaTime,i&&(s.freq=b,this._get("resizing")||this._set("resizing",!0)),s.time<s.freq)return;s.time=0;const r=this._position();s.freq=r||i?b:Math.min(w,s.freq*H),!i&&s.freq>=C&&(e.pause(),this._get("resizing")&&this._set("resizing",!1))}}),i=new ResizeObserver(i=>{t.freq=b,t.time=w,e.resume()});null!=this.container&&i.observe(this.container);const n=r(()=>i.disconnect());this.addHandles([s(window,"resize",()=>{t.freq=b,t.time=w,e.resume()}),n,e],"measuring"),this._measure(),this._position()}_measure(){const t=this.container,e=t?t.clientWidth:0,i=t?t.clientHeight:0;if(0===e||0===i)return this.suspended||this._set("suspended",!0),!1;const s=this.width,r=this.height;if(e===s&&i===r)return this.suspended&&this._set("suspended",!1),!1;this._set("width",e),this._set("height",i),this.suspended&&this._set("suspended",!1);return this.emit("resize",{oldWidth:s,oldHeight:r,width:e,height:i}),!0}_position(){const t=this.container,e=this.position,i=t&&y(t);return!!i&&((!e||i[0]!==e[0]||i[1]!==e[1])&&(this._set("position",[i[0],i[1]]),!0))}forceDOMReadyCycle(){}};return t([c()],O.prototype,"_attribution",void 0),t([c()],O.prototype,"aria",void 0),t([c()],O.prototype,"attributionHeight",null),t([c()],O.prototype,"attributionMode",void 0),t([c()],O.prototype,"container",null),t([c({readOnly:!0})],O.prototype,"focused",null),t([c({readOnly:!0})],O.prototype,"height",void 0),t([c()],O.prototype,"messagesCommon",void 0),t([c({type:f})],O.prototype,"overlay",void 0),t([c({readOnly:!0})],O.prototype,"position",void 0),t([c({readOnly:!0})],O.prototype,"resizing",void 0),t([c({readOnly:!0})],O.prototype,"root",void 0),t([c({value:null,readOnly:!0})],O.prototype,"size",null),t([c({readOnly:!0})],O.prototype,"surface",void 0),t([c({readOnly:!0})],O.prototype,"suspended",void 0),t([c({nonNullable:!0})],O.prototype,"ui",null),t([c({readOnly:!0})],O.prototype,"userContent",void 0),t([c({readOnly:!0})],O.prototype,"width",void 0),t([c()],O.prototype,"widthBreakpoint",void 0),O=t([p("esri.views.DOMContainer")],O),O};export{O as DOMContainer};
2
+ import{__decorate as t}from"tslib";import{byId as e,reparent as i}from"../core/domUtils.js";import{on as s}from"../core/events.js";import{makeHandle as r}from"../core/handleUtils.js";import n from"../core/Logger.js";import{destroyMaybe as o,removeMaybe as a}from"../core/maybe.js";import{watch as h,initial as d,syncAndInitial as l}from"../core/reactiveUtils.js";import{addFrameTask as u}from"../core/scheduling.js";import{property as c,subclass as p}from"../core/accessorSupport/decorators.js";import{Attribution as m}from"./Attribution.js";import f from"./overlay/ViewOverlay.js";const _=[0,0];function y(t){const e=(t.ownerDocument||window.document).defaultView,i=t.getBoundingClientRect();return _[0]=i.left+(e?.pageXOffset??0),_[1]=i.top+(e?.pageYOffset??0),_}function g(t){t&&(t.textContent="",t.parentNode&&t.parentNode.removeChild(t))}const v="test"===process.env.NODE_ENV,b=v?0:16,w=v?0:750,C=v?0:512,H=2,O=_=>{const v=_;let O=class extends v{constructor(...t){super(...t),this._freqInfo={freq:b,time:w},this._overlayRenderTaskHandle=null,this.aria={},this.attributionMode=null,this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([h(()=>this.cursor,t=>{const{surface:e}=this;e&&e.setAttribute("data-cursor",t)}),h(()=>this.navigating,t=>{const{surface:e}=this;e&&e.setAttribute("data-navigating",t.toString())}),h(()=>[this.aria,this.surface],()=>this._updateAria(),{initial:!0})])}initialize(){const t=this;this.addHandles([h(()=>this.ui,(t,e)=>this._handleUIChange(t,e),d),t.on("focus",()=>this.notifyChange("focused")),t.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui?.destroy(),this.container=null)}get attributionHeight(){return this._attribution?.height??0}get container(){return this._get("container")??null}set container(t){const s=this._get("container"),r=e(t);if(r||"string"!=typeof t||n.getLogger(this).error("#container",`element with id '${t}' not found`),s===r)return;if(this._stopMeasuring(),this.removeHandles("container"),s&&(s.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this._attribution=o(this._attribution),this.root&&(g(this.root),this._set("root",null)),this.userContent&&(i(this.userContent,s),g(this.userContent),this._set("userContent",null))),!r)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);r.classList.add("esri-view");const d=document.createElement("div");d.className="esri-view-user-storage",i(r,d),r.appendChild(d),this._set("userContent",d);const c=document.createElement("div");c.className="esri-view-root",r.insertBefore(c,r.firstChild),this._set("root",c);const p=document.createElement("div");p.className="esri-view-surface",p.setAttribute("role","application"),p.tabIndex=0,c.appendChild(p),this._set("surface",p);const _=new f;c.appendChild(_.surface),this._set("overlay",_),this.addHandles(h(()=>_.needsRender,t=>{t&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=u({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=a(this._overlayRenderTaskHandle)}),"container"),this.addHandles([h(()=>({visible:this.attributionVisible&&this.ready,items:this.attributionItems,mode:this.attributionMode}),({visible:t,items:e,mode:i})=>{t?(this._attribution||(this._attribution=new m({attributionItems:this.attributionItems,mode:this.attributionMode}),this._attribution.appendBefore(c,this.ui.container)),this._attribution.attributionItems=e,this._attribution.mode=i):this._attribution=o(this._attribution)},l)],"container"),this.forceDOMReadyCycle(),this._set("container",r),this._startMeasuring()}get focused(){const t=document.activeElement===this.surface;return document.hasFocus()&&t}get size(){return[this.width,this.height]}get ui(){return this._get("ui")}set ui(t){const e=this._get("ui");e!==t&&e?.destroy(),this._set("ui",t)}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(t,e,i){const s=this.position;return t-=s?s[0]:0,e-=s?s[1]:0,i?(i[0]=t,i[1]=e):i=[t,e],i}containerToPage(t,e,i){const s=this.position;return t+=s?s[0]:0,e+=s?s[1]:0,i?(i[0]=t,i[1]=e):i=[t,e],i}_updateAria(){const{surface:t,aria:e}=this;t&&(t.ariaLabelledByElements=e?.labelledByElements??null,t.ariaDescribedByElements=e?.describedByElements??null,t.ariaLabel=e?.label??null,t.ariaDescription=e?.description??null)}_handleUIChange(t,e){this.removeHandles("ui"),e&&e!==t&&e.destroy(),t&&(t.view=this,this.addHandles(h(()=>this.root,e=>{if(e){const i=document.createElement("div");e.insertBefore(i,this._attribution?.surface??null),t.container=i}else t.container=null},d),"ui")),this._set("ui",t)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const t=this._freqInfo;t.freq=b,t.time=w;const e=u({prepare:t=>{const i=this._measure(),s=this._freqInfo;if(s.time+=t.deltaTime,i&&(s.freq=b,this._get("resizing")||this._set("resizing",!0)),s.time<s.freq)return;s.time=0;const r=this._position();s.freq=r||i?b:Math.min(w,s.freq*H),!i&&s.freq>=C&&(e.pause(),this._get("resizing")&&this._set("resizing",!1))}}),i=new ResizeObserver(i=>{t.freq=b,t.time=w,e.resume()});null!=this.container&&i.observe(this.container);const n=r(()=>i.disconnect());this.addHandles([s(window,"resize",()=>{t.freq=b,t.time=w,e.resume()}),n,e],"measuring"),this._measure(),this._position()}_measure(){const t=this.container,e=t?t.clientWidth:0,i=t?t.clientHeight:0;if(0===e||0===i)return this.suspended||this._set("suspended",!0),!1;const s=this.width,r=this.height;if(e===s&&i===r)return this.suspended&&this._set("suspended",!1),!1;this._set("width",e),this._set("height",i),this.suspended&&this._set("suspended",!1);return this.emit("resize",{oldWidth:s,oldHeight:r,width:e,height:i}),!0}_position(){const t=this.container,e=this.position,i=t&&y(t);return!!i&&((!e||i[0]!==e[0]||i[1]!==e[1])&&(this._set("position",[i[0],i[1]]),!0))}forceDOMReadyCycle(){}};return t([c()],O.prototype,"_attribution",void 0),t([c()],O.prototype,"aria",void 0),t([c()],O.prototype,"attributionHeight",null),t([c()],O.prototype,"attributionMode",void 0),t([c()],O.prototype,"container",null),t([c({readOnly:!0})],O.prototype,"focused",null),t([c({readOnly:!0})],O.prototype,"height",void 0),t([c()],O.prototype,"messagesCommon",void 0),t([c({type:f})],O.prototype,"overlay",void 0),t([c({readOnly:!0})],O.prototype,"position",void 0),t([c({readOnly:!0})],O.prototype,"resizing",void 0),t([c({readOnly:!0})],O.prototype,"root",void 0),t([c({value:null,readOnly:!0})],O.prototype,"size",null),t([c({readOnly:!0})],O.prototype,"surface",void 0),t([c({readOnly:!0})],O.prototype,"suspended",void 0),t([c({nonNullable:!0})],O.prototype,"ui",null),t([c({readOnly:!0})],O.prototype,"userContent",void 0),t([c({readOnly:!0})],O.prototype,"width",void 0),t([c()],O.prototype,"widthBreakpoint",void 0),O=t([p("esri.views.DOMContainer")],O),O};export{O as DOMContainer};
@@ -91,7 +91,7 @@ export default class LinkChartView extends View2D {
91
91
  * @param screenPoint - The screen coordinates (or native mouse event) of the click on the view.
92
92
  * @param options - Options to specify what is included in or excluded from the hitTest. Supported since 4.16.
93
93
  * @returns When resolved, returns an array of objects containing different [result types](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ViewHit).
94
- * @see [Sample: Access features with pointer events](https://developers.arcgis.com/javascript/latest/sample-code/view-hittest/)
94
+ * @see [Sample: Access features with hitTest](https://developers.arcgis.com/javascript/latest/sample-code/map-component-hittest/)
95
95
  */
96
96
  hitTest(screenPoint: ScreenPoint | MouseEvent, options?: HitTestOptions): Promise<ViewHitTestResult>;
97
97
  }
@@ -370,7 +370,7 @@ export default class MapView extends View2D {
370
370
  * @param screenPoint - The screen coordinates (or native mouse event) of the click on the view.
371
371
  * @param options - Options to specify what is included in or excluded from the hitTest. Supported since 4.16.
372
372
  * @returns When resolved, returns an array of objects containing different [result types](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ViewHit).
373
- * @see [Sample: Access features with pointer events](https://developers.arcgis.com/javascript/latest/sample-code/view-hittest/)
373
+ * @see [Sample: Access features with hitTest](https://developers.arcgis.com/javascript/latest/sample-code/map-component-hittest/)
374
374
  * @example
375
375
  * // Get the screen point from the view's click event
376
376
  * view.on("click", (event) => {
@@ -1398,7 +1398,7 @@ export default class SceneView extends SceneViewSuperclass {
1398
1398
  * @param options - Intersection test options. By default the [Map.ground](https://developers.arcgis.com/javascript/latest/references/core/Map/#ground) is excluded if its opacity
1399
1399
  * is smaller than one.
1400
1400
  * @returns When resolved, returns an array of objects containing different [result types](https://developers.arcgis.com/javascript/latest/references/core/views/types/#SceneViewHit).
1401
- * @see [Sample: Access features with click events](https://developers.arcgis.com/javascript/latest/sample-code/view-hittest/)
1401
+ * @see [Sample: Access features with hitTest](https://developers.arcgis.com/javascript/latest/sample-code/map-component-hittest/)
1402
1402
  * @see [Sample: SceneView - hitTest](https://developers.arcgis.com/javascript/latest/sample-code/sceneview-hittest/)
1403
1403
  * @example
1404
1404
  * // Get the screen point from the view's click event
package/views/View.d.ts CHANGED
@@ -331,7 +331,7 @@ export default abstract class View<TLayerView extends LayerView = LayerView> ext
331
331
  * >
332
332
  * > Esri requires that when you use an ArcGIS Online basemap in your app, the map must include Esri attribution and you must be licensed to use the content.
333
333
  * > For detailed guidelines on working with attribution, please visit the official [attribution in your app](https://developers.arcgis.com/terms/attribution/) documentation.
334
- * > For information on terms of use, see the [Terms of Use FAQ](https://developers.arcgis.com/terms/faq/).
334
+ * > For information, see the [Terms of Use documentation](https://developers.arcgis.com/documentation/terms-of-use/).
335
335
  *
336
336
  * @default true
337
337
  * @since 5.0
@@ -883,7 +883,7 @@ export interface ViewEventTypes extends ViewBaseEventTypes {
883
883
  * for responding to a click event without delay.
884
884
  *
885
885
  * @since 5.0
886
- * @see [Sample: Access features with click events](https://developers.arcgis.com/javascript/latest/sample-code/view-hittest/)
886
+ * @see [Sample: Access features with hitTest](https://developers.arcgis.com/javascript/latest/sample-code/map-component-hittest/)
887
887
  * @example
888
888
  * view.on("click", function(event){
889
889
  * // event is the event object returned after the event fires
@@ -6,7 +6,7 @@ export interface DefaultUIProperties extends UIProperties, Partial<Pick<DefaultU
6
6
 
7
7
  /**
8
8
  * The DefaultUI class exposes the default
9
- * [Widget](https://developers.arcgis.com/javascript/latest/references/core/widgets/Widget/) [components](https://developers.arcgis.com/javascript/latest/references/core/views/ui/DefaultUI/#components) available in either a
9
+ * [widgets](https://developers.arcgis.com/javascript/latest/references/core/widgets/Widget/) and [components](https://developers.arcgis.com/javascript/latest/references/core/views/ui/DefaultUI/#components) available in either a
10
10
  * [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) or a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). This class
11
11
  * also provides a simple API for [adding](https://developers.arcgis.com/javascript/latest/references/core/views/ui/DefaultUI/#add), [moving](https://developers.arcgis.com/javascript/latest/references/core/views/ui/DefaultUI/#move) and [removing](https://developers.arcgis.com/javascript/latest/references/core/views/ui/DefaultUI/#remove)
12
12
  * [widgets](https://developers.arcgis.com/javascript/latest/references/core/widgets/Widget/) and other HTML components from the view's UI.
@@ -63,22 +63,15 @@ export default class DefaultUI extends UI {
63
63
  * [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) is created. The default widgets differ between MapView
64
64
  * and SceneView.
65
65
  *
66
- * The following are the default components in each view:
66
+ * The following are the default widgets in each view:
67
67
  *
68
- * **MapView:** `["attribution", "zoom"]`
68
+ * **MapView:** `["zoom"]`
69
69
  *
70
- * **SceneView:** `["attribution", "navigation-toggle", "compass", "zoom"]`
70
+ * **SceneView:** `["navigation-toggle", "compass", "zoom"]`
71
71
  *
72
72
  * > [!WARNING]
73
73
  * >
74
- * > Esri requires that when you use an ArcGIS Online basemap in your app, the map must include Esri attribution and you must be licensed to use the content.
75
- * > For detailed guidelines on working with attribution, please visit the official [attribution in your app](https://developers.arcgis.com/terms/attribution/) documentation.
76
- * > For information on terms of use, see the [Terms of Use FAQ](https://developers.arcgis.com/terms/faq/).
77
- *
78
- * @example
79
- * // Removes all default UI components, except Attribution.
80
- * // Passing an empty array will remove all components.
81
- * view.ui.components = [ "attribution" ];
74
+ * > As of version 5.0, attribution is a part of the view itself. To control the visibility of the attribution, use the [View.attributionVisible](https://developers.arcgis.com/javascript/latest/references/core/views/View/#attributionVisible) property.
82
75
  */
83
76
  accessor components: ComponentName[];
84
77
  }
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import"../../core/has.js";import"../../core/Logger.js";import{watch as i,initial as e}from"../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import r from"./Component.js";import n from"./UI.js";import a from"../../widgets/Attribution.js";import d from"../../widgets/Compass.js";import p from"../../widgets/NavigationToggle.js";import m from"../../widgets/Zoom.js";function c(t){return void 0!==t?.view}let h=class extends n{constructor(t){super(t),this._defaultPositionLookup={attribution:"manual",compass:"top-left","navigation-toggle":"top-left",zoom:"top-left"},this.components=[],this._updateViewAwareWidgets=t=>{this.components.forEach(i=>{const e=this._find(i),o=e?.widget;c(o)&&(o.view=t)})},this._componentsWatcher=(t,i)=>{this._removeComponents(i),this._addComponents(t)},this._adjustPadding=({ready:t,attributionVisible:i})=>{if(t&&!i&&!this._isOverridden("padding")){const{top:t}=this.padding;this.padding=t}}}initialize(){this.addHandles([i(()=>this.components,this._componentsWatcher,e),i(()=>this.view,this._updateViewAwareWidgets,e),i(()=>({ready:this.view?.ready,attributionVisible:this.view?.attributionVisible}),this._adjustPadding,e)])}_add(t,i,e,o,s){let r=t;if("string"==typeof t&&this._defaultPositionLookup[t]){if(this._find(t))return;r=this._createComponent(t)}super._add(r,i,e,o,s)}_removeComponents(t){t.forEach(t=>{const i=this._find(t);i&&(this.remove(i),i.destroy())})}_addComponents(t){this.constructed&&t.forEach(t=>this.add(this._createComponent(t),this._defaultPositionLookup[t]))}_createComponent(t){const i=this._createWidget(t);return new r({id:t,node:i})}_createWidget(t){const i=this.view;switch(t){case"attribution":return new a({view:i});case"compass":return new d({view:i});case"navigation-toggle":return new p({view:i,isDefaultUI:!0});case"zoom":return new m({view:i})}}};t([o()],h.prototype,"components",void 0),h=t([s("esri.views.ui.DefaultUI")],h);const u=h;export{u as default};
2
+ import{__decorate as t}from"tslib";import"../../core/has.js";import"../../core/Logger.js";import{watch as i,initial as e}from"../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import n from"./Component.js";import r from"./UI.js";import a from"../../widgets/Compass.js";import d from"../../widgets/NavigationToggle.js";import p from"../../widgets/Zoom.js";function c(t){return void 0!==t?.view}let m=class extends r{constructor(t){super(t),this._defaultPositionLookup={compass:"top-left","navigation-toggle":"top-left",zoom:"top-left"},this.components=[],this._updateViewAwareWidgets=t=>{this.components.forEach(i=>{const e=this._find(i),o=e?.widget;c(o)&&(o.view=t)})},this._componentsWatcher=(t,i)=>{this._removeComponents(i),this._addComponents(t)},this._adjustPadding=({ready:t,attributionVisible:i})=>{if(t&&!i&&!this._isOverridden("padding")){const{top:t}=this.padding;this.padding=t}}}initialize(){this.addHandles([i(()=>this.components,this._componentsWatcher,e),i(()=>this.view,this._updateViewAwareWidgets,e),i(()=>({ready:this.view?.ready,attributionVisible:this.view?.attributionVisible}),this._adjustPadding,e)])}_add(t,i,e,o,s){let n=t;if("string"==typeof t&&this._defaultPositionLookup[t]){if(this._find(t))return;n=this._createComponent(t)}super._add(n,i,e,o,s)}_removeComponents(t){t.forEach(t=>{const i=this._find(t);i&&(this.remove(i),i.destroy())})}_addComponents(t){this.constructed&&t.forEach(t=>this.add(this._createComponent(t),this._defaultPositionLookup[t]))}_createComponent(t){const i=this._createWidget(t);return new n({id:t,node:i})}_createWidget(t){const i=this.view;switch(t){case"compass":return new a({view:i});case"navigation-toggle":return new d({view:i,isDefaultUI:!0});case"zoom":return new p({view:i})}}};t([o()],m.prototype,"components",void 0),m=t([s("esri.views.ui.DefaultUI")],m);const h=m;export{h as default};
@@ -1,7 +1,7 @@
1
1
  import type Widget from "../../widgets/Widget.js";
2
2
 
3
3
  /** @since 5.0 */
4
- export type ComponentName = "attribution" | "compass" | "navigation-toggle" | "zoom";
4
+ export type ComponentName = "compass" | "navigation-toggle" | "zoom";
5
5
 
6
6
  /** @since 5.0 */
7
7
  export interface Options {
@@ -9,7 +9,16 @@ export interface SunLightingProperties extends Partial<Pick<SunLighting, "direct
9
9
  * This might lead to different lighting for users in different time zones.
10
10
  */
11
11
  date?: (Date | number | string);
12
- /** This adds a glow effect to the scene for more intensity and scattering of light emitters. */
12
+ /**
13
+ * Adds a glow effect to the scene intended for stylistic visualizations. When set, this property creates a halo around
14
+ * light emitters, making them appear brighter and more prominent. Accepts a [Glow](https://developers.arcgis.com/javascript/latest/references/core/webscene/Glow/) instance or `null` to
15
+ * disable the effect.
16
+ *
17
+ * Example:
18
+ * ```js
19
+ * scene.environment.lighting.glow = new Glow({ intensity: 1 });
20
+ * ```
21
+ */
13
22
  glow?: GlowProperties | null;
14
23
  }
15
24
 
@@ -46,7 +55,16 @@ export default class SunLighting extends JSONSupport {
46
55
  * This value does not have an impact on the actual lighting of the scene.
47
56
  */
48
57
  accessor displayUTCOffset: number | null | undefined;
49
- /** This adds a glow effect to the scene for more intensity and scattering of light emitters. */
58
+ /**
59
+ * Adds a glow effect to the scene intended for stylistic visualizations. When set, this property creates a halo around
60
+ * light emitters, making them appear brighter and more prominent. Accepts a [Glow](https://developers.arcgis.com/javascript/latest/references/core/webscene/Glow/) instance or `null` to
61
+ * disable the effect.
62
+ *
63
+ * Example:
64
+ * ```js
65
+ * scene.environment.lighting.glow = new Glow({ intensity: 1 });
66
+ * ```
67
+ */
50
68
  get glow(): Glow | null | undefined;
51
69
  set glow(value: GlowProperties | null | undefined);
52
70
  /** Indicates that the light source is simulated position of the sun. */
@@ -3,7 +3,16 @@ import type { JSONSupport } from "../core/JSONSupport.js";
3
3
  import type { GlowProperties } from "./Glow.js";
4
4
 
5
5
  export interface VirtualLightingProperties extends Partial<Pick<VirtualLighting, "directShadowsEnabled">> {
6
- /** This adds a glow effect to the scene for more intensity and scattering of light emitters. */
6
+ /**
7
+ * Adds a glow effect to the scene intended for stylistic visualizations. When set, this property creates a halo around
8
+ * light emitters, making them appear brighter and more prominent. Accepts a [Glow](https://developers.arcgis.com/javascript/latest/references/core/webscene/Glow/) instance or `null` to
9
+ * disable the effect.
10
+ *
11
+ * Example:
12
+ * ```js
13
+ * scene.environment.lighting.glow = new Glow({ intensity: 1 });
14
+ * ```
15
+ */
7
16
  glow?: GlowProperties | null;
8
17
  }
9
18
 
@@ -29,7 +38,16 @@ export default class VirtualLighting extends JSONSupport {
29
38
  * @default false
30
39
  */
31
40
  accessor directShadowsEnabled: boolean;
32
- /** This adds a glow effect to the scene for more intensity and scattering of light emitters. */
41
+ /**
42
+ * Adds a glow effect to the scene intended for stylistic visualizations. When set, this property creates a halo around
43
+ * light emitters, making them appear brighter and more prominent. Accepts a [Glow](https://developers.arcgis.com/javascript/latest/references/core/webscene/Glow/) instance or `null` to
44
+ * disable the effect.
45
+ *
46
+ * Example:
47
+ * ```js
48
+ * scene.environment.lighting.glow = new Glow({ intensity: 1 });
49
+ * ```
50
+ */
33
51
  get glow(): Glow | null | undefined;
34
52
  set glow(value: GlowProperties | null | undefined);
35
53
  /**
@@ -18,7 +18,7 @@ export type AttributionViewModelState = "disabled" | "ready" | "loading";
18
18
  * >
19
19
  * > Esri requires that when you use an ArcGIS Online basemap in your app, the map must include Esri attribution and you must be licensed to use the content.
20
20
  * > For detailed guidelines on working with attribution, please visit the official [attribution in your app](https://developers.arcgis.com/terms/attribution/) documentation.
21
- * > For information on terms of use, see the [Terms of Use FAQ](https://developers.arcgis.com/terms/faq/).
21
+ * > For information, see the [Terms of Use documentation](https://developers.arcgis.com/documentation/terms-of-use/).
22
22
  *
23
23
  * @since 4.0
24
24
  * @see [Attribution](https://developers.arcgis.com/javascript/latest/references/core/widgets/Attribution/)
@@ -57,7 +57,7 @@ export interface AttributionProperties extends WidgetProperties, Partial<Pick<At
57
57
  * >
58
58
  * > Esri requires that when you use an ArcGIS Online basemap in your app, the map must include Esri attribution and you must be licensed to use the content.
59
59
  * > For detailed guidelines on working with attribution, please visit the official [attribution in your app](https://developers.arcgis.com/terms/attribution/) documentation.
60
- * > For information on terms of use, see the [Terms of Use FAQ](https://developers.arcgis.com/terms/faq/).
60
+ * > For information, see the [Terms of Use documentation](https://developers.arcgis.com/documentation/terms-of-use/).
61
61
  *
62
62
  * @deprecated since version 5.0. As of 5.0, attribution is handled automatically by the [Map](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-map/) and [Scene](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-scene/) components, with properties for extracting attribution items, hiding the attribution, as well as setting dark and light mode for the attribution. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/).
63
63
  * @since 4.0