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

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 (55) hide show
  1. package/analysis/ElevationProfile/ElevationProfileLineInput.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{ecd6f163c1bb039d9736.js → 0c23d180de581ad47290.js} +1 -1
  4. package/assets/esri/core/workers/chunks/2dce02d199a9625abbd9.js +1 -0
  5. package/assets/esri/core/workers/chunks/{8f3503b2fb6cd38757b9.js → 458e87902abc24b375da.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{ef5657a2b6f88b16dbe9.js → 618ccc5d922f40fb6597.js} +1 -1
  7. package/assets/esri/core/workers/chunks/98739414c107ad78e4d8.js +1 -0
  8. package/assets/esri/core/workers/chunks/c8d58ceb142f2be9106f.js +1 -0
  9. package/assets/esri/themes/base/widgets/_Editor.scss +2 -1
  10. package/assets/esri/themes/base/widgets/_FeatureForm.scss +1 -1
  11. package/assets/esri/themes/dark/main.css +1 -1
  12. package/assets/esri/themes/light/main.css +1 -1
  13. package/assets/esri/themes/light/view.css +1 -1
  14. package/config.js +1 -1
  15. package/interfaces.d.ts +14 -14
  16. package/kernel.js +1 -1
  17. package/layers/support/fieldConfigUtils.js +1 -1
  18. package/layers/support/fieldFormatUtils.js +1 -1
  19. package/libs/parquet/parquet.js +1 -1
  20. package/package.json +1 -1
  21. package/support/revision.js +1 -1
  22. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  23. package/views/2d/engine/flow/dataUtils.js +1 -1
  24. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
  25. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  26. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  27. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  28. package/views/3d/layers/FlowSubView3D.js +1 -1
  29. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  30. package/views/3d/layers/TiledLayerView3D.js +1 -1
  31. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  32. package/views/3d/support/flow/FlowWorker.js +1 -1
  33. package/views/3d/support/flow/FlowWorkerHandle.js +1 -1
  34. package/views/3d/support/flow/constants.js +1 -1
  35. package/views/3d/support/flow/loadUtils.js +1 -1
  36. package/views/3d/support/popupHitTest.js +1 -1
  37. package/views/3d/terrain/TerrainSurface.js +1 -1
  38. package/views/3d/terrain/TileAgent.js +1 -1
  39. package/views/SceneView.js +1 -1
  40. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  41. package/widgets/Editor/UpdateWorkflow.js +1 -1
  42. package/widgets/Editor/Workflow.js +1 -1
  43. package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
  44. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  45. package/widgets/Editor.js +1 -1
  46. package/widgets/Feature/support/featureUtils.js +1 -1
  47. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  48. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  49. package/widgets/FeatureTable/FieldColumn.js +1 -1
  50. package/widgets/FeatureTable/Grid/Column.js +1 -1
  51. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  52. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
  53. package/assets/esri/core/workers/chunks/38ee69125da60464d5a1.js +0 -1
  54. package/assets/esri/core/workers/chunks/4640f9add1cc9af14468.js +0 -1
  55. package/assets/esri/core/workers/chunks/e7b96da2a615086d91a7.js +0 -1
package/config.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.34.0-next.116";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
5
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.34.0-next.117";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
package/interfaces.d.ts CHANGED
@@ -100385,7 +100385,7 @@ declare namespace __esri {
100385
100385
  */
100386
100386
  declare readonly dataUpdating: FeatureLayerViewMixin["dataUpdating"];
100387
100387
  /**
100388
- * Indicates whether the layer view contains all available features from the service.
100388
+ * Indicates whether the layer view contains all available features from the service or source.
100389
100389
  *
100390
100390
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CatalogFootprintLayerView.html#hasAllFeatures Read more...}
100391
100391
  */
@@ -100398,7 +100398,7 @@ declare namespace __esri {
100398
100398
  */
100399
100399
  declare readonly hasAllFeaturesInView: FeatureLayerViewMixin["hasAllFeaturesInView"];
100400
100400
  /**
100401
- * Indicates whether the layer view has geometries at full resolution.
100401
+ * Indicates whether the LayerView contains geometries at full resolution.
100402
100402
  *
100403
100403
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CatalogFootprintLayerView.html#hasFullGeometries Read more...}
100404
100404
  */
@@ -100622,7 +100622,7 @@ declare namespace __esri {
100622
100622
  */
100623
100623
  declare readonly dataUpdating: FeatureLayerViewMixin["dataUpdating"];
100624
100624
  /**
100625
- * Indicates whether the layer view contains all available features from the service.
100625
+ * Indicates whether the layer view contains all available features from the service or source.
100626
100626
  *
100627
100627
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#hasAllFeatures Read more...}
100628
100628
  */
@@ -100635,7 +100635,7 @@ declare namespace __esri {
100635
100635
  */
100636
100636
  declare readonly hasAllFeaturesInView: FeatureLayerViewMixin["hasAllFeaturesInView"];
100637
100637
  /**
100638
- * Indicates whether the layer view has geometries at full resolution.
100638
+ * Indicates whether the LayerView contains geometries at full resolution.
100639
100639
  *
100640
100640
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#hasFullGeometries Read more...}
100641
100641
  */
@@ -100904,7 +100904,7 @@ declare namespace __esri {
100904
100904
  */
100905
100905
  declare readonly dataUpdating: FeatureLayerViewMixin["dataUpdating"];
100906
100906
  /**
100907
- * Indicates whether the layer view contains all available features from the service.
100907
+ * Indicates whether the layer view contains all available features from the service or source.
100908
100908
  *
100909
100909
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#hasAllFeatures Read more...}
100910
100910
  */
@@ -100917,7 +100917,7 @@ declare namespace __esri {
100917
100917
  */
100918
100918
  declare readonly hasAllFeaturesInView: FeatureLayerViewMixin["hasAllFeaturesInView"];
100919
100919
  /**
100920
- * Indicates whether the layer view has geometries at full resolution.
100920
+ * Indicates whether the LayerView contains geometries at full resolution.
100921
100921
  *
100922
100922
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#hasFullGeometries Read more...}
100923
100923
  */
@@ -101233,7 +101233,7 @@ declare namespace __esri {
101233
101233
  */
101234
101234
  declare readonly dataUpdating: FeatureLayerViewMixin["dataUpdating"];
101235
101235
  /**
101236
- * Indicates whether the layer view contains all available features from the service.
101236
+ * Indicates whether the layer view contains all available features from the service or source.
101237
101237
  *
101238
101238
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-GeoJSONLayerView.html#hasAllFeatures Read more...}
101239
101239
  */
@@ -101246,7 +101246,7 @@ declare namespace __esri {
101246
101246
  */
101247
101247
  declare readonly hasAllFeaturesInView: FeatureLayerViewMixin["hasAllFeaturesInView"];
101248
101248
  /**
101249
- * Indicates whether the layer view has geometries at full resolution.
101249
+ * Indicates whether the LayerView contains geometries at full resolution.
101250
101250
  *
101251
101251
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-GeoJSONLayerView.html#hasFullGeometries Read more...}
101252
101252
  */
@@ -101938,7 +101938,7 @@ declare namespace __esri {
101938
101938
  */
101939
101939
  declare readonly dataUpdating: FeatureLayerViewMixin["dataUpdating"];
101940
101940
  /**
101941
- * Indicates whether the layer view contains all available features from the service.
101941
+ * Indicates whether the layer view contains all available features from the service or source.
101942
101942
  *
101943
101943
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-OGCFeatureLayerView.html#hasAllFeatures Read more...}
101944
101944
  */
@@ -101951,7 +101951,7 @@ declare namespace __esri {
101951
101951
  */
101952
101952
  declare readonly hasAllFeaturesInView: FeatureLayerViewMixin["hasAllFeaturesInView"];
101953
101953
  /**
101954
- * Indicates whether the layer view has geometries at full resolution.
101954
+ * Indicates whether the LayerView contains geometries at full resolution.
101955
101955
  *
101956
101956
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-OGCFeatureLayerView.html#hasFullGeometries Read more...}
101957
101957
  */
@@ -102143,7 +102143,7 @@ declare namespace __esri {
102143
102143
  */
102144
102144
  declare readonly dataUpdating: FeatureLayerViewMixin["dataUpdating"];
102145
102145
  /**
102146
- * Indicates whether the layer view contains all available features from the service.
102146
+ * Indicates whether the layer view contains all available features from the service or source.
102147
102147
  *
102148
102148
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ParquetLayerView.html#hasAllFeatures Read more...}
102149
102149
  */
@@ -102156,7 +102156,7 @@ declare namespace __esri {
102156
102156
  */
102157
102157
  declare readonly hasAllFeaturesInView: FeatureLayerViewMixin["hasAllFeaturesInView"];
102158
102158
  /**
102159
- * Indicates whether the layer view has geometries at full resolution.
102159
+ * Indicates whether the LayerView contains geometries at full resolution.
102160
102160
  *
102161
102161
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ParquetLayerView.html#hasFullGeometries Read more...}
102162
102162
  */
@@ -102887,7 +102887,7 @@ declare namespace __esri {
102887
102887
  */
102888
102888
  declare readonly dataUpdating: FeatureLayerViewMixin["dataUpdating"];
102889
102889
  /**
102890
- * Indicates whether the layer view contains all available features from the service.
102890
+ * Indicates whether the layer view contains all available features from the service or source.
102891
102891
  *
102892
102892
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-WFSLayerView.html#hasAllFeatures Read more...}
102893
102893
  */
@@ -102900,7 +102900,7 @@ declare namespace __esri {
102900
102900
  */
102901
102901
  declare readonly hasAllFeaturesInView: FeatureLayerViewMixin["hasAllFeaturesInView"];
102902
102902
  /**
102903
- * Indicates whether the layer view has geometries at full resolution.
102903
+ * Indicates whether the LayerView contains geometries at full resolution.
102904
102904
  *
102905
102905
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-WFSLayerView.html#hasFullGeometries Read more...}
102906
102906
  */
package/kernel.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.116",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
5
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.117",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{clone as n}from"../../core/lang.js";import e from"./FieldConfiguration.js";import{isFormattableField as o,fieldFormatFromFieldInfoFormat as t,defaultFieldFormat as s,fieldInfoFormatFromFieldFormat as l}from"./fieldFormatUtils.js";import{isFieldEditable as f}from"./fieldUtils.js";import i from"../../popup/FieldInfo.js";function r(n){const{popupTemplate:l,fieldsIndex:f}=n,i=l?.fieldInfos;if(!i?.length||!f)return;const r=[];for(const{fieldName:a,label:u,format:c}of i){const n=f.get(a);if(!n)continue;const l=u&&u!==n.alias?u:null,i=o(n)?c?t(c,n):s(n,{hour12:"always",useGrouping:"always"}):null;(l||i)&&r.push(new e({name:n.name,alias:l,fieldFormat:i}))}return r.length?r:null}function a(n){const{fields:t}=n;if(!t?.length)return;const l=[];for(const f of t){const n=o(f)?s(f):null;n&&l.push(new e({name:f.name,fieldFormat:n}))}return l.length?l:null}function u(n,e){const{popupTemplate:o,fieldsIndex:t}=n;if(!o||!t)return;const s=c(n,e,o.fieldInfos);if(!s)return;const l=o.clone();return l.fieldInfos=s,l}function c(e,t,s){t??=[],s=n(s)??[];let f=!1;const i=new Map;for(const n of t){const o=e.fieldsIndex.get(n.name);o&&i.set(o.name,n)}for(const n of s){const t=e.fieldsIndex.get(n.fieldName);if(!t)continue;const s=i.get(t.name);n.label=s?.alias||t.alias,n.format=o(t)&&s?.fieldFormat?l(s.fieldFormat,t):null,f=!0,i.delete(t.name)}for(const n of i.values()){const o=m(e,n);o&&(s.push(o),f=!0)}return f?s:null}function m(n,e){const{name:t,alias:s,fieldFormat:r}=e,a=n.fieldsIndex.get(t);if(!a||!s&&!r)return;const u=s||a.alias,c=o(a)&&r?l(r,a):null;return new i({fieldName:a.name,label:u,format:c,visible:!1,isEditable:f(a,n)})}function d(n){const e=new Map;for(const o of n)e.set(o.name.toLowerCase(),o);return e}function p(e,o){if(!o.length)return;const{fieldConfigurations:t}=e,s=t?d(t):null;let l;if(s?.size){l=[];for(const n of o)s.has(n.name.toLowerCase())||l.push(n);if(!l.length)return}else l=o;const f=n(t)??[];f.push(...l),e.fieldConfigurations=f}function g(n,e){const{fieldConfigurations:o}=n;if(!e.length||!o?.length)return;const t=d(e),s=[];let l=!1;for(const f of o){const n=t.get(f.name.toLowerCase());n?(s.push(n),l=!0):s.push(f.clone())}l&&(n.fieldConfigurations=s)}function h(n,e){const{fieldConfigurations:o}=n;if(!e.length||!o?.length)return;const t=new Set(e.map(n=>n.toLowerCase())),s=[];let l=!1;for(const f of o)t.has(f.name.toLowerCase())?l=!0:s.push(f.clone());l&&(n.fieldConfigurations=s)}export{p as addFieldConfigurations,a as fieldConfigurationsFromFields,r as fieldConfigurationsFromPopupTemplate,u as popupTemplateWithFieldConfigurations,h as removeFieldConfigurations,g as replaceFieldConfigurations};
5
+ import{clone as n}from"../../core/lang.js";import e from"./FieldConfiguration.js";import{fieldFormatFromFieldInfo as o,isFormattableField as t,defaultFieldFormat as s,fieldInfoFormatFromFieldFormat as f}from"./fieldFormatUtils.js";import{isFieldEditable as i}from"./fieldUtils.js";import l from"../../popup/FieldInfo.js";function r(n){const{popupTemplate:t,fieldsIndex:s}=n,f=t?.fieldInfos;if(!f?.length||!s)return;const i=[];for(const l of f){const{fieldName:n,label:t}=l,f=s.get(n);if(!f)continue;const r=t&&t!==f.alias?t:null,a=o(l,f);(r||a)&&i.push(new e({name:f.name,alias:r,fieldFormat:a}))}return i.length?i:null}function a(n){const{fields:o}=n;if(!o?.length)return;const f=[];for(const i of o){const n=t(i)?s(i):null;n&&f.push(new e({name:i.name,fieldFormat:n}))}return f.length?f:null}function u(n,e){const{popupTemplate:o,fieldsIndex:t}=n;if(!o||!t)return;const s=c(n,e,o.fieldInfos);if(!s)return;const f=o.clone();return f.fieldInfos=s,f}function c(e,o,s){o??=[],s=n(s)??[];let i=!1;const l=new Map;for(const n of o){const o=e.fieldsIndex.get(n.name);o&&l.set(o.name,n)}for(const n of s){const o=e.fieldsIndex.get(n.fieldName);if(!o)continue;const s=l.get(o.name);n.label=s?.alias||o.alias,n.format=t(o)&&s?.fieldFormat?f(s.fieldFormat,o):null,i=!0,l.delete(o.name)}for(const n of l.values()){const o=m(e,n);o&&(s.push(o),i=!0)}return i?s:null}function m(n,e){const{name:o,alias:s,fieldFormat:r}=e,a=n.fieldsIndex.get(o);if(!a||!s&&!r)return;const u=s||a.alias,c=t(a)&&r?f(r,a):null;return new l({fieldName:a.name,label:u,format:c,visible:!1,isEditable:i(a,n)})}function d(n){const e=new Map;for(const o of n)e.set(o.name.toLowerCase(),o);return e}function p(e,o){if(!o.length)return;const{fieldConfigurations:t}=e,s=t?d(t):null;let f;if(s?.size){f=[];for(const n of o)s.has(n.name.toLowerCase())||f.push(n);if(!f.length)return}else f=o;const i=n(t)??[];i.push(...f),e.fieldConfigurations=i}function g(n,e){const{fieldConfigurations:o}=n;if(!e.length||!o?.length)return;const t=d(e),s=[];let f=!1;for(const i of o){const n=t.get(i.name.toLowerCase());n?(s.push(n),f=!0):s.push(i.clone())}f&&(n.fieldConfigurations=s)}function h(n,e){const{fieldConfigurations:o}=n;if(!e.length||!o?.length)return;const t=new Set(e.map(n=>n.toLowerCase())),s=[];let f=!1;for(const i of o)t.has(i.name.toLowerCase())?f=!0:s.push(i.clone());f&&(n.fieldConfigurations=s)}export{p as addFieldConfigurations,a as fieldConfigurationsFromFields,r as fieldConfigurationsFromPopupTemplate,u as popupTemplateWithFieldConfigurations,h as removeFieldConfigurations,g as replaceFieldConfigurations};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"./DateTimeFieldFormat.js";import e from"./FieldFormat.js";import{isNumericField as n,isDateField as r,isDateOnlyField as o,isTimeOnlyField as a,isTimestampOffsetField as u}from"./fieldUtils.js";import i from"./NumberFieldFormat.js";import s from"../../popup/support/FieldInfoFormat.js";const l={base:e,key:"type",errorContext:"field-configuration-field-format",typeMap:{"date-time":t,number:i}};function c(t,e){const{dateFormat:n}=t;if(!e)return n?f(t):h(t);if(!m(e))return;const r={hour12:"always"};switch(e.type){case"integer":case"small-integer":case"big-integer":case"long":return d(t);case"single":case"double":return h(t);case"date":case"timestamp-offset":return n?f(t):I(e,r);case"date-only":return n?y(t):I(e);case"time-only":return n?g(t):I(e,r)}}function m(t){return n(t)||r(t)||o(t)||a(t)||u(t)}function d(t){return new i({useGrouping:t.digitSeparator?"always":"never"})}function h(t){const e=d(t),{places:n}=t;return e.minimumFractionDigits=n??0,e.maximumFractionDigits=n??2,e}function f(e){return new t({dateStyle:p(e),year:$(e),month:w(e),timeStyle:S(e),hour12:F(e)})}function y(e){return new t({dateStyle:p(e),year:$(e),month:w(e)})}function g(e){return new t({timeStyle:S(e),hour12:F(e)})}function p(t){const{dateFormat:e}=t;return e?e.startsWith("short-date")?"short":e.startsWith("day-short-month-year")?"medium":e.startsWith("long-month-day-year")?"long":e.startsWith("long-date")?"full":null:null}function F(t){return t.dateFormat?.endsWith("-24")?"never":"always"}function w(t){switch(t.dateFormat){case"short-month-year":return"short";case"long-month-year":return"long";default:return null}}function S(t){const{dateFormat:e}=t;return e?e.includes("short-time")?"short":e.includes("long-time")?"medium":null:null}function $(t){switch(t.dateFormat){case"short-month-year":case"long-month-year":case"year":return"numeric";default:return null}}function b(t,e){const n="number"===t.type,r="date-time"===t.type;if(!e)return n?x(t):r?j(t):null;if(m(e))switch(e.type){case"integer":case"small-integer":case"big-integer":case"long":return n?D(t):null;case"single":case"double":return n?x(t):null;case"date":case"timestamp-offset":return r?j(t):null;case"date-only":return r?v(t):null;case"time-only":return r?G(t):null}}function D(t){return new s({digitSeparator:"never"!==t.useGrouping})}function x(t){const e=D(t);return e.places=t.maximumFractionDigits,e}function j(t){let e;const n=W(t),r=k(t),o="never"===t.hour12?"24":null,a="numeric"===t.year?"year":null,u=C(t);return n&&r&&o?e=`${n}-${r}-${o}`:n&&r?e=`${n}-${r}`:n?e=n:a&&u?e=`${u}-${a}`:a&&(e=a),e?new s({dateFormat:e}):null}function v(t){let e;const n=W(t),r="numeric"===t.year?"year":null,o=C(t);return n?e=n:r&&o?e=`${o}-${r}`:r&&(e=r),e?new s({dateFormat:e}):null}function G(t){let e;const n=k(t),r="never"===t.hour12?"24":null;return n&&r?e=`short-date-${n}-${r}`:n&&(e=`short-date-${n}`),e?new s({dateFormat:e}):null}function W(t){switch(t.dateStyle){case"short":return"short-date";case"medium":return"day-short-month-year";case"long":return"long-month-day-year";case"full":return"long-date";default:return}}function k(t){return t.timeStyle&&("short"===t.timeStyle?"short-time":"long-time")}function C(t){switch(t.month){case"short":return"short-month";case"long":return"long-month";default:return}}function I(e,n){if(!m(e))return;const r=n?.useGrouping??"auto",o=n?.hour12??"auto";switch(e.type){case"integer":case"small-integer":case"big-integer":case"long":return new i({minimumFractionDigits:0,maximumFractionDigits:0,useGrouping:r});case"single":case"double":return new i({minimumFractionDigits:0,maximumFractionDigits:2,useGrouping:r});case"date":case"timestamp-offset":return new t({dateStyle:"short",timeStyle:"short",hour12:o});case"date-only":return new t({dateStyle:"short"});case"time-only":return new t({timeStyle:"short",hour12:o})}}export{I as defaultFieldFormat,c as fieldFormatFromFieldInfoFormat,b as fieldInfoFormatFromFieldFormat,l as formatTypes,m as isFormattableField};
5
+ import t from"./DateTimeFieldFormat.js";import e from"./FieldFormat.js";import{isNumericField as n,isDateField as r,isDateOnlyField as o,isTimeOnlyField as a,isTimestampOffsetField as u}from"./fieldUtils.js";import i from"./NumberFieldFormat.js";import s from"../../popup/support/FieldInfoFormat.js";const l={base:e,key:"type",errorContext:"field-configuration-field-format",typeMap:{"date-time":t,number:i}};function c(t,e){const{format:n}=t;return e&&h(e)?n?m(n,e):M(e,{hour12:"always",useGrouping:"always"}):null}function m(t,e){const{dateFormat:n}=t;if(!e)return n?y(t):f(t);if(!h(e))return;const r={hour12:"always"};switch(e.type){case"integer":case"small-integer":case"big-integer":case"long":return d(t);case"single":case"double":return f(t);case"date":case"timestamp-offset":return n?y(t):M(e,r);case"date-only":return n?g(t):M(e);case"time-only":return n?p(t):M(e,r)}}function h(t){return n(t)||r(t)||o(t)||a(t)||u(t)}function d(t){return new i({useGrouping:t.digitSeparator?"always":"never"})}function f(t){const e=d(t),{places:n}=t;return e.minimumFractionDigits=n??0,e.maximumFractionDigits=n??2,e}function y(e){return new t({dateStyle:w(e),year:b(e),month:S(e),timeStyle:$(e),hour12:F(e)})}function g(e){return new t({dateStyle:w(e),year:b(e),month:S(e)})}function p(e){return new t({timeStyle:$(e),hour12:F(e)})}function w(t){const{dateFormat:e}=t;return e?e.startsWith("short-date")?"short":e.startsWith("day-short-month-year")?"medium":e.startsWith("long-month-day-year")?"long":e.startsWith("long-date")?"full":null:null}function F(t){return t.dateFormat?.endsWith("-24")?"never":"always"}function S(t){switch(t.dateFormat){case"short-month-year":return"short";case"long-month-year":return"long";default:return null}}function $(t){const{dateFormat:e}=t;return e?e.includes("short-time")?"short":e.includes("long-time")?"medium":null:null}function b(t){switch(t.dateFormat){case"short-month-year":case"long-month-year":case"year":return"numeric";default:return null}}function D(t,e){const n="number"===t.type,r="date-time"===t.type;if(!e)return n?G(t):r?j(t):null;if(h(e))switch(e.type){case"integer":case"small-integer":case"big-integer":case"long":return n?x(t):null;case"single":case"double":return n?G(t):null;case"date":case"timestamp-offset":return r?j(t):null;case"date-only":return r?v(t):null;case"time-only":return r?W(t):null}}function x(t){return new s({digitSeparator:"never"!==t.useGrouping})}function G(t){const e=x(t);return e.places=t.maximumFractionDigits,e}function j(t){let e;const n=k(t),r=C(t),o="never"===t.hour12?"24":null,a="numeric"===t.year?"year":null,u=I(t);return n&&r&&o?e=`${n}-${r}-${o}`:n&&r?e=`${n}-${r}`:n?e=n:a&&u?e=`${u}-${a}`:a&&(e=a),e?new s({dateFormat:e}):null}function v(t){let e;const n=k(t),r="numeric"===t.year?"year":null,o=I(t);return n?e=n:r&&o?e=`${o}-${r}`:r&&(e=r),e?new s({dateFormat:e}):null}function W(t){let e;const n=C(t),r="never"===t.hour12?"24":null;return n&&r?e=`short-date-${n}-${r}`:n&&(e=`short-date-${n}`),e?new s({dateFormat:e}):null}function k(t){switch(t.dateStyle){case"short":return"short-date";case"medium":return"day-short-month-year";case"long":return"long-month-day-year";case"full":return"long-date";default:return}}function C(t){return t.timeStyle&&("short"===t.timeStyle?"short-time":"long-time")}function I(t){switch(t.month){case"short":return"short-month";case"long":return"long-month";default:return}}function M(e,n){if(!h(e))return;const r=n?.useGrouping??"auto",o=n?.hour12??"auto";switch(e.type){case"integer":case"small-integer":case"big-integer":case"long":return new i({minimumFractionDigits:0,maximumFractionDigits:0,useGrouping:r});case"single":case"double":return new i({minimumFractionDigits:0,maximumFractionDigits:2,useGrouping:r});case"date":case"timestamp-offset":return new t({dateStyle:"short",timeStyle:"short",hour12:o});case"date-only":return new t({dateStyle:"short"});case"time-only":return new t({timeStyle:"short",hour12:o})}}export{M as defaultFieldFormat,c as fieldFormatFromFieldInfo,m as fieldFormatFromFieldInfoFormat,D as fieldInfoFormatFromFieldFormat,l as formatTypes,h as isFormattableField};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../request.js";import t from"../../core/Error.js";import{loadParquetModule as n}from"./loadParquetModule.js";import{MultiscaleGeometryField as r,GeometryInfo as o,GeometryType as a,PrimaryGeometryField as i}from"../../chunks/bundle.js";const s=t=>async function(n,r,o,a){const i=t?.(),s=i?{...i,debug:a}:{debug:a},{data:u}=await e(n,{responseType:"array-buffer",query:s,headers:{range:`bytes=${r}-${o}`}});return u},u=t=>async function(n){const{data:r}=await e(n,{responseType:"native",method:"head",query:t?.()}),o=r.headers.get("Content-Length");if(null==o)throw new Error("Unable to parse content length");return parseInt(o,10)};function l(e){switch(e){case"esriGeometryPoint":return a.Point;case"esriGeometryPolygon":return a.Polygon;case"esriGeometryPolyline":return a.Polyline;case"esriGeometryMultipoint":return a.Multipoint;default:throw new t("parquet",`Found unexpected GeometryType: ${e}`)}}function c(e){switch(e.encoding.type){case"wkb":return i.fromWkb(e.encoding.primaryFieldName);case"location":{const{latitudeFieldName:t,longitudeFieldName:n}=e.encoding;return i.fromLocation(t,n)}}}function m(e,n){const a=e.spatialReference.wkid,i=n.wkid;if(!a||!i)throw new t("parquet","Unable to create ParquetFile, in and out wkid must be specified");const s=l(e.geometryType),u=c(e),m=[];if("xz"===e.displayOptimization?.mode){const t=e.displayOptimization.multiscale;for(const e of t.levels??[]){const[t,n]=e.transform.translate,[o,a]=e.transform.scale,i=new Float64Array([t,n]),s=new Float64Array([o,a]);m.push(r.new(e.level,e.column,i,s))}}return o.new(s,a,i,u,m)}async function d(e,t={}){const{ParquetFile:r}=await n(),o=s(t.getCustomParameters),a=u(t.getCustomParameters),i=t.geometryInfo?m(t.geometryInfo,t.outSpatialReference??t.geometryInfo.spatialReference):null;return r.fromUrl(e,o,a,i)}function f(e){const t=e.keyValueMetadata("geo");return null!=t?JSON.parse(t):null}function y(e){const t=e.keyValueMetadata("esri");return null!=t?JSON.parse(t):null}export{d as createParquetFile,y as readEsriMetadata,f as readGeoMetadata};
5
+ import e from"../../request.js";import t from"../../core/Error.js";import{isBlobProtocol as r}from"../../core/urlUtils.js";import{loadParquetModule as n}from"./loadParquetModule.js";import{MultiscaleGeometryField as o,GeometryInfo as a,GeometryType as i,PrimaryGeometryField as s}from"../../chunks/bundle.js";const u=t=>async function(r,n,o,a){const i=t?.(),s=i?{...i,debug:a}:{debug:a},{data:u}=await e(r,{responseType:"array-buffer",query:s,headers:{range:`bytes=${n}-${o}`}});return u},l=t=>async function(n){if(r(n)){const{data:t}=await e(n,{responseType:"blob"});return t.size}const{data:o}=await e(n,{responseType:"native",method:"head",query:t?.()}),a=o.headers.get("Content-Length");if(null==a)throw new Error("Unable to parse content length");return parseInt(a,10)};function c(e){switch(e){case"esriGeometryPoint":return i.Point;case"esriGeometryPolygon":return i.Polygon;case"esriGeometryPolyline":return i.Polyline;case"esriGeometryMultipoint":return i.Multipoint;default:throw new t("parquet",`Found unexpected GeometryType: ${e}`)}}function m(e){switch(e.encoding.type){case"wkb":return s.fromWkb(e.encoding.primaryFieldName);case"location":{const{latitudeFieldName:t,longitudeFieldName:r}=e.encoding;return s.fromLocation(t,r)}}}function f(e,r){const n=e.spatialReference.wkid,i=r.wkid;if(!n||!i)throw new t("parquet","Unable to create ParquetFile, in and out wkid must be specified");const s=c(e.geometryType),u=m(e),l=[];if("xz"===e.displayOptimization?.mode){const t=e.displayOptimization.multiscale;for(const e of t.levels??[]){const[t,r]=e.transform.translate,[n,a]=e.transform.scale,i=new Float64Array([t,r]),s=new Float64Array([n,a]);l.push(o.new(e.level,e.column,i,s))}}return a.new(s,n,i,u,l)}async function p(e,t={}){const{ParquetFile:r}=await n(),o=u(t.getCustomParameters),a=l(t.getCustomParameters),i=t.geometryInfo?f(t.geometryInfo,t.outSpatialReference??t.geometryInfo.spatialReference):null;return r.fromUrl(e,o,a,i)}function d(e){const t=e.keyValueMetadata("geo");return null!=t?JSON.parse(t):null}function y(e){const t=e.keyValueMetadata("esri");return null!=t?JSON.parse(t):null}export{p as createParquetFile,y as readEsriMetadata,d as readGeoMetadata};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.34.0-next.116",
3
+ "version": "4.34.0-next.117",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- const a="20251015",b="ebb70092e6a9437449248290460ac5691a25f64b";export{a as buildDate,b as commitHash};
5
+ const c="20251016",a="23139d07c16e6e507ac256a52193cada53cff664";export{c as buildDate,a as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../../Graphic.js";import r from"../../../../core/Accessor.js";import{getContrast as o}from"../../../../core/colorUtils.js";import{when as i,watch as s,syncAndInitial as a}from"../../../../core/reactiveUtils.js";import{throttle as l}from"../../../../core/throttle.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import c from"../../../../layers/GraphicsLayer.js";import m from"../../../../symbols/CIMSymbol.js";import{getConfig as y}from"../../../analysis/ElevationProfile/constants.js";import{createLineGeometry as h}from"../../../analysis/ElevationProfile/elevationProfileVisualizationUtils.js";let d=class extends r{constructor(t){super(t),this._graphic=new e,this._layer=new c({listMode:"hide",internal:!0}),this._updateGeometryThrottled=l(t=>{if(!t)return void(this._graphic.visible=!1);const e=this._layer,r=this.view.map?.layers;r&&(r.includes(e)||r.add(e),r.reorder(e,0)),this._graphic.visible=!0,this._graphic.geometry=h(t.samples,t.spatialReference)},y().profileLinesUpdateThrottleMillis)}initialize(){this._layer.add(this._graphic),this.addHandles([i(()=>!this.analysisViewData.visible,()=>{this._graphic.visible=!1}),s(()=>this._colorUpdateParameters,t=>this._updateColor(t),a),s(()=>this.analysisViewData.analysis.geometry,()=>{this._graphic.visible=!1},a),s(()=>this._geometryUpdateParameters,t=>this._updateGeometryThrottled(t),a),this._updateGeometryThrottled])}destroy(){this.view.map?.remove(this._layer),this._layer.destroy(),this._graphic.destroy()}get updating(){return this._updateGeometryThrottled.hasPendingUpdates()}get _result(){const{analysisViewData:t}=this;return t.visible?t.results.find(t=>t.available&&t.computation.profile.viewOptions.lineVisible):null}get _geometryUpdateParameters(){const t=this._result;return 1!==t?.progress?null:{samples:t.samples,spatialReference:this.view.spatialReference}}get _colorUpdateParameters(){const t=this._result?.computation.profile.color;return t?{color:t.toArray(),contrastColor:o(t).toArray()}:null}_updateColor(t){t&&(this._graphic.symbol=new m({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",capStyle:"Butt",color:t.color,effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,4],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],joinStyle:"Round",width:1.5},{type:"CIMSolidStroke",capStyle:"Butt",color:t.contrastColor,joinStyle:"Round",width:1.5}]}}}))}};t([p({constructOnly:!0})],d.prototype,"view",void 0),t([p({constructOnly:!0})],d.prototype,"analysisViewData",void 0),t([p()],d.prototype,"updating",null),t([p()],d.prototype,"_result",null),t([p()],d.prototype,"_geometryUpdateParameters",null),t([p()],d.prototype,"_colorUpdateParameters",null),d=t([n("esri.views.2d.analysis.ElevationProfile.ElevationProfileLineVisualization2D")],d);export{d as ElevationProfileLineVisualization2D};
5
+ import{__decorate as t}from"tslib";import e from"../../../../Graphic.js";import r from"../../../../core/Accessor.js";import{getContrast as o}from"../../../../core/colorUtils.js";import{when as i,watch as s,syncAndInitial as a}from"../../../../core/reactiveUtils.js";import{throttle as l}from"../../../../core/throttle.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import c from"../../../../layers/GraphicsLayer.js";import m from"../../../../symbols/CIMSymbol.js";import{getConfig as h}from"../../../analysis/ElevationProfile/constants.js";import{createLineGeometry as y}from"../../../analysis/ElevationProfile/elevationProfileVisualizationUtils.js";let d=class extends r{constructor(t){super(t),this._graphic=new e,this._layer=new c({listMode:"hide",internal:!0}),this._updateGeometryThrottled=l(t=>{if(!t)return void(this._graphic.visible=!1);const e=this._layer,r=this.view.map?.layers;r&&(r.includes(e)||r.add(e),r.reorder(e,0)),this._graphic.visible=!0,this._graphic.geometry=y(t.samples,t.spatialReference)},h().profileLinesUpdateThrottleMillis)}initialize(){this._layer.add(this._graphic),this.addHandles([i(()=>!this.analysisViewData.visible,()=>{this._graphic.visible=!1}),s(()=>this._colorUpdateParameters,t=>this._updateColor(t),a),s(()=>this.analysisViewData.analysis.geometry,()=>{this._graphic.visible=!1},a),s(()=>this._geometryUpdateParameters,t=>this._updateGeometryThrottled(t),a),this._updateGeometryThrottled])}destroy(){this.view.map?.remove(this._layer),this._layer.destroy(),this._graphic.destroy()}get updating(){return this._updateGeometryThrottled.hasPendingUpdates()}get _result(){const{analysisViewData:t}=this;return t.visible?t.results.find(({available:t,computation:e,rawResult:r})=>t&&e.profile.viewOptions.lineVisible&&!0===r?.hasZ):null}get _geometryUpdateParameters(){const t=this._result;return 1!==t?.progress?null:{samples:t.samples,spatialReference:this.view.spatialReference}}get _colorUpdateParameters(){const t=this._result?.computation.profile.color;return t?{color:t.toArray(),contrastColor:o(t).toArray()}:null}_updateColor(t){t&&(this._graphic.symbol=new m({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",capStyle:"Butt",color:t.color,effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,4],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],joinStyle:"Round",width:1.5},{type:"CIMSolidStroke",capStyle:"Butt",color:t.contrastColor,joinStyle:"Round",width:1.5}]}}}))}};t([p({constructOnly:!0})],d.prototype,"view",void 0),t([p({constructOnly:!0})],d.prototype,"analysisViewData",void 0),t([p()],d.prototype,"updating",null),t([p()],d.prototype,"_result",null),t([p()],d.prototype,"_geometryUpdateParameters",null),t([p()],d.prototype,"_colorUpdateParameters",null),d=t([n("esri.views.2d.analysis.ElevationProfile.ElevationProfileLineVisualization2D")],d);export{d as ElevationProfileLineVisualization2D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import t from"../../../../core/Logger.js";import{moduloPositive as e,deg2rad as n}from"../../../../core/mathUtils.js";import{throwIfAborted as r}from"../../../../core/promiseUtils.js";import o from"../../../../core/RandomLCG.js";import i from"../../../../geometry/Extent.js";import{getInfo as s}from"../../../../geometry/support/spatialReferenceUtils.js";const l=()=>t.getLogger("esri.views.2d.engine.flow.dataUtils"),a=10;async function c(t,e,n,o){const i=performance.now(),s=f(e,n),c=performance.now(),h=d(e,s,n.width,n.height),u=performance.now(),m=w(h,!0),y=performance.now(),x="Streamlines"===t?p(m,a):g(m),M=performance.now();return has("esri-2d-profiler")&&(l().info("I.1","_createFlowFieldFromData (ms)",Math.round(c-i)),l().info("I.2","_getStreamlines (ms)",Math.round(u-c)),l().info("I.3","createAnimatedLinesData (ms)",Math.round(y-u)),l().info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(M-y)),l().info("I.5","createFlowMesh (ms)",Math.round(M-i)),l().info("I.6","Mesh size (bytes)",x.vertexData.buffer.byteLength+x.indexData.buffer.byteLength)),await Promise.resolve(),r(o),x}function f(t,e){const n=m(e.data,e.width,e.height,t.smoothing);if(t.interpolate){return(t,r)=>{const o=Math.floor(t),i=Math.floor(r);if(o<0||o>=e.width)return[0,0];if(i<0||i>=e.height)return[0,0];const s=t-o,l=r-i,a=o,c=i,f=o<e.width-1?o+1:o,h=i<e.height-1?i+1:i,u=n[2*(c*e.width+a)],d=n[2*(c*e.width+f)],m=n[2*(h*e.width+a)],w=n[2*(h*e.width+f)],p=n[2*(c*e.width+a)+1],g=n[2*(c*e.width+f)+1];return[(u*(1-l)+m*l)*(1-s)+(d*(1-l)+w*l)*s,(p*(1-l)+n[2*(h*e.width+a)+1]*l)*(1-s)+(g*(1-l)+n[2*(h*e.width+f)+1]*l)*s]}}return(t,r)=>{const o=Math.round(t),i=Math.round(r);return o<0||o>=e.width||i<0||i>=e.height?[0,0]:[n[2*(i*e.width+o)],n[2*(i*e.width+o)+1]]}}function h(t,n,r,o,i,s,l,a){const c=[],{raster:f,width:h,height:u,resolutionFactor:d}=a;let m=o,w=i,p=0,[g,y]=r(m,w);g*=n.velocityScale,y*=n.velocityScale;const x=Math.sqrt(g*g+y*y);let M,v;c.push({x:m,y:w,t:p,speed:x});for(let A=0;A<n.verticesPerLine;A++){let[o,i]=r(m,w);o*=n.velocityScale,i*=n.velocityScale;const a=Math.sqrt(o*o+i*i);if(a<n.minSpeedThreshold)return c;const g=t*o/a,y=t*i/a;m+=g*n.segmentLength,w+=y*n.segmentLength,n.wrapAround&&(m=e(m,s[0]));if(p+=t*n.segmentLength/a,Math.acos(g*M+y*v)>n.maxTurnAngle)return c;if(n.collisions){let t=Math.round(m*d);const r=Math.round(w*d);if(n.wrapAround&&(t=e(t,h)),t<0||t>h-1||r<0||r>u-1)return c;const o=f[r*h+t];if(-1!==o&&o!==l)return c;f[r*h+t]=l}c.push({x:m,y:w,t:p,speed:a}),M=g,v=y}return c}function u(t,e,n,r,o,i,s,l){const a=Math.round((.2+.6*s.getFloat())*t.verticesPerLine),c=t.verticesPerLine-a,f=h(-1,{...t,verticesPerLine:c},e,n,r,o,i,l),u=h(1,{...t,verticesPerLine:a},e,n,r,o,i,l),d=f.reverse();d.splice(-1,1);return d.concat(u)}function d(t,e,n,r,i={positions:[]}){if(t.density<=0)return[];const{positions:s}=i,l=[],a=new o,c=1/Math.max(t.lineCollisionWidth,1),f=Math.round(n*c),d=Math.round(r*c),m=new Int32Array(f*d);for(let o=0;o<m.length;o++)m[o]=-1;const w={raster:m,width:f,height:d,resolutionFactor:c},p={},g=t.lineSpacing/Math.sqrt(t.density),y=Math.floor(r/g),x=Math.floor(n/g);for(let o=0;o<y;o++){const t=o*g;for(let e=0;e<x;e++){const n=e*g;p[`${e}-${o}`]={x:n,y:t,positions:[]}}}for(const{x:o,y:h}of s){const t=p[`${Math.floor(o/g)}-${Math.floor(h/g)}`];t&&t.positions.push([o,h])}const M=[];for(const o in p){const t=p[o];if(0===t.positions.length)M.push({x:t.x,y:t.y,sort:.66+.33*a.getFloat(),stage:0});else{const[e]=t.positions.splice(0,1);M.push({x:e[0],y:e[1],sort:.33*a.getFloat(),stage:1});for(const[n,r]of t.positions)M.push({x:n,y:r,sort:.33+.33*a.getFloat(),stage:2})}}M.sort((t,e)=>t.sort-e.sort);for(const{x:o,y:v,stage:A}of M){const i=t.onlyForwardTracing?h(1,t,e,o,v,[n,r],l.length,w):u(t,e,o,v,[n,r],l.length,a,w);i.length<2||l.push({stage:A,vertices:i})}return l}function m(t,e,n,r){if(0===r)return t;const o=Math.round(3*r),i=new Array(2*o+1);let s=0;for(let c=-o;c<=o;c++){const t=Math.exp(-c*c/(r*r));i[c+o]=t,s+=t}for(let c=-o;c<=o;c++)i[c+o]/=s;const l=new Float32Array(t.length);for(let c=0;c<n;c++)for(let n=0;n<e;n++){let r=0,s=0;for(let l=-o;l<=o;l++){if(n+l<0||n+l>=e)continue;const a=i[l+o];r+=a*t[2*(c*e+(n+l))],s+=a*t[2*(c*e+(n+l))+1]}l[2*(c*e+n)]=r,l[2*(c*e+n)+1]=s}const a=new Float32Array(t.length);for(let c=0;c<e;c++)for(let t=0;t<n;t++){let r=0,s=0;for(let a=-o;a<=o;a++){if(t+a<0||t+a>=n)continue;const f=i[a+o];r+=f*l[2*((t+a)*e+c)],s+=f*l[2*((t+a)*e+c)+1]}a[2*(t*e+c)]=r,a[2*(t*e+c)+1]=s}return a}function w(t,e){const n=new o,r=t.reduce((t,e)=>t+e.vertices.length,0),i=new Float32Array(4*r),s=new Array(t.length);let l=0,a=0;for(const{vertices:o}of t){const t=l;for(const e of o)i[4*l]=e.x,i[4*l+1]=e.y,i[4*l+2]=e.t,i[4*l+3]=e.speed,l++;s[a++]={startVertex:t,numberOfVertices:o.length,totalTime:o[o.length-1].t,timeSeed:e?n.getFloat():0}}return{lineVertices:i,lineDescriptors:s}}function p(t,e){const n=9,{lineVertices:r,lineDescriptors:o}=t;let i=0,s=0;for(const d of o){i+=2*d.numberOfVertices;s+=6*(d.numberOfVertices-1)}const l=new Float32Array(i*n),a=new Uint32Array(s);let c=0,f=0;function h(){a[f++]=c-2,a[f++]=c,a[f++]=c-1,a[f++]=c,a[f++]=c+1,a[f++]=c-1}function u(t,e,r,o,i,s,a,f){const h=c*n;let u=0;l[h+u++]=t,l[h+u++]=e,l[h+u++]=1,l[h+u++]=r,l[h+u++]=s,l[h+u++]=a,l[h+u++]=o/2,l[h+u++]=i/2,l[h+u++]=f,c++,l[h+u++]=t,l[h+u++]=e,l[h+u++]=-1,l[h+u++]=r,l[h+u++]=s,l[h+u++]=a,l[h+u++]=-o/2,l[h+u++]=-i/2,l[h+u++]=f,c++}for(const d of o){const{totalTime:t,timeSeed:n}=d;let o=null,i=null,s=null,l=null,a=null,c=null;for(let f=0;f<d.numberOfVertices;f++){const m=r[4*(d.startVertex+f)],w=r[4*(d.startVertex+f)+1],p=r[4*(d.startVertex+f)+2],g=r[4*(d.startVertex+f)+3];let y=null,x=null,M=null,v=null;if(f>0){y=m-o,x=w-i;const r=Math.sqrt(y*y+x*x);if(y/=r,x/=r,f>1){let t=y+a,n=x+c;const r=Math.sqrt(t*t+n*n);t/=r,n/=r;const o=Math.min(1/(t*y+n*x),e);t*=o,n*=o,M=-n,v=t}else M=-x,v=y;null!==M&&null!==v&&(u(o,i,s,M,v,t,n,g),h())}o=m,i=w,s=p,a=y,c=x,l=g}u(o,i,s,-c,a,t,n,l)}return{vertexData:l,indexData:a}}function g(t){const e=16,n=1,r=2,{lineVertices:o,lineDescriptors:i}=t;let s=0,l=0;for(const S of i){const t=S.numberOfVertices-1;s+=4*t*2,l+=6*t*2}const a=new Float32Array(s*e),c=new Uint32Array(l);let f,h,u,d,m,w,p,g,y,x,M,v,A,F,I=0,V=0;function L(){c[V++]=I-8,c[V++]=I-7,c[V++]=I-6,c[V++]=I-7,c[V++]=I-5,c[V++]=I-6,c[V++]=I-4,c[V++]=I-3,c[V++]=I-2,c[V++]=I-3,c[V++]=I-1,c[V++]=I-2}function b(t,o,i,s,l,c,f,h,u,d,m,w,p,g){const y=I*e;let x=0;for(const e of[n,r])for(const n of[1,2,3,4])a[y+x++]=t,a[y+x++]=o,a[y+x++]=i,a[y+x++]=s,a[y+x++]=f,a[y+x++]=h,a[y+x++]=u,a[y+x++]=d,a[y+x++]=e,a[y+x++]=n,a[y+x++]=p,a[y+x++]=g,a[y+x++]=l/2,a[y+x++]=c/2,a[y+x++]=m/2,a[y+x++]=w/2,I++}function D(t,e){let n=y+M,r=x+v;const o=Math.sqrt(n*n+r*r);n/=o,r/=o;const i=y*n+x*r;n/=i,r/=i;let s=M+A,l=v+F;const a=Math.sqrt(s*s+l*l);s/=a,l/=a;const c=M*s+v*l;s/=c,l/=c,b(f,h,u,d,-r,n,m,w,p,g,-l,s,t,e),L()}function k(t,e,n,r,o,i){if(y=M,x=v,M=A,v=F,null==y&&null==x&&(y=M,x=v),null!=m&&null!=w){A=t-m,F=e-w;const n=Math.sqrt(A*A+F*F);A/=n,F/=n}null!=y&&null!=x&&D(o,i),f=m,h=w,u=p,d=g,m=t,w=e,p=n,g=r}function P(t,e){y=M,x=v,M=A,v=F,null==y&&null==x&&(y=M,x=v),null!=y&&null!=x&&D(t,e)}for(const S of i){f=null,h=null,u=null,d=null,m=null,w=null,p=null,g=null,y=null,x=null,M=null,v=null,A=null,F=null;const{totalTime:t,timeSeed:e}=S;for(let n=0;n<S.numberOfVertices;n++){k(o[4*(S.startVertex+n)],o[4*(S.startVertex+n)+1],o[4*(S.startVertex+n)+2],o[4*(S.startVertex+n)+3],t,e)}P(t,e)}return{vertexData:a,indexData:c}}function y(t,e){const r=e.pixels,{width:o,height:i}=e,s=new Float32Array(o*i*2),l=e.mask??new Uint8Array(o*i*2);if(e.mask||l.fill(255),"vector-uv"===t)for(let n=0;n<o*i;n++)s[2*n]=r[0][n],s[2*n+1]=-r[1][n];else if("vector-magdir"===t)for(let a=0;a<o*i;a++){const t=r[0][a],e=n(r[1][a]),o=Math.cos(e-Math.PI/2),i=Math.sin(e-Math.PI/2);s[2*a]=o*t,s[2*a+1]=i*t}return{data:s,mask:l,width:o,height:i}}async function x(t,e,n,r,o,a){const c=performance.now(),f=s(e.spatialReference);if(!f){const i=await M(t,e,n,r,o,a);return has("esri-2d-profiler")&&l().info("I.7","loadImagery, early exit (ms)",Math.round(performance.now()-c)),has("esri-2d-profiler")&&l().info("I.9","Number of parts",1),i}const[h,u]=f.valid,d=u-h,m=Math.ceil(e.width/d),w=e.width/m,p=Math.round(n/m);let g=e.xmin;const y=[],x=performance.now();for(let s=0;s<m;s++){const n=new i({xmin:g,xmax:g+w,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference});y.push(M(t,n,p,r,o,a)),g+=w}const v=await Promise.all(y);if(has("esri-2d-profiler")&&l().info("I.8","All calls to _fetchPart (ms)",Math.round(performance.now()-x)),has("esri-2d-profiler")&&l().info("I.9","Number of parts",v.length),1===v.length)return has("esri-2d-profiler")&&l().info("I.10","loadImagery, general exit without stitching back (ms)",Math.round(performance.now()-c)),v[0];const A={data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r};let F=0;for(const i of v){for(let t=0;t<i.height;t++)for(let e=0;e<i.width;e++)F+e>=n||(A.data[2*(t*n+F+e)]=i.data[2*(t*i.width+e)],A.data[2*(t*n+F+e)+1]=i.data[2*(t*i.width+e)+1],A.mask[t*n+F+e]=i.mask[t*i.width+e]);F+=i.width}return has("esri-2d-profiler")&&l().info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-c)),A}async function M(t,e,n,r,o,i){const s={requestProjectedLocalDirections:!0,signal:i};if(null!=o&&(s.timeExtent=o),"imagery"===t.type){await t.load({signal:i});const o=await t.internalFetchImage(e,n,r,s);if(null==o?.pixelData?.pixelBlock)return{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r};return y(t.rasterInfo.dataType,o.pixelData.pixelBlock)}await t.load({signal:i});const l=await t.fetchPixels(e,n,r,s);if(null==l?.pixelBlock)return{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r};return y(t.serviceRasterInfo.dataType,l.pixelBlock)}export{w as createAnimatedLinesData,f as createFlowFieldFromData,c as createFlowMesh,g as createParticlesMesh,p as createStreamlinesMesh,x as loadImagery,y as toFlowData,d as traceFlowPaths};
5
+ import has from"../../../../core/has.js";import t from"../../../../core/Logger.js";import{moduloPositive as e,deg2rad as n}from"../../../../core/mathUtils.js";import{throwIfAborted as r}from"../../../../core/promiseUtils.js";import o from"../../../../core/RandomLCG.js";import i from"../../../../geometry/Extent.js";import{getInfo as l}from"../../../../geometry/support/spatialReferenceUtils.js";const s=()=>t.getLogger("esri.views.2d.engine.flow.dataUtils"),a=10;async function c(t,e,n,o){const i=performance.now(),l=f(e,n),c=performance.now(),h=d(e,l,n.width,n.height),u=performance.now(),m=w(h,!0),y=performance.now(),x="Streamlines"===t?p(m,a):g(m),M=performance.now();return has("esri-2d-profiler")&&(s().info("I.1","_createFlowFieldFromData (ms)",Math.round(c-i)),s().info("I.2","_getStreamlines (ms)",Math.round(u-c)),s().info("I.3","createAnimatedLinesData (ms)",Math.round(y-u)),s().info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(M-y)),s().info("I.5","createFlowMesh (ms)",Math.round(M-i)),s().info("I.6","Mesh size (bytes)",x.vertexData.buffer.byteLength+x.indexData.buffer.byteLength)),await Promise.resolve(),r(o),x}function f(t,e){const n=m(e.data,e.width,e.height,t.smoothing);if(t.interpolate){return(t,r)=>{const o=Math.floor(t),i=Math.floor(r);if(o<0||o>=e.width)return[0,0];if(i<0||i>=e.height)return[0,0];const l=t-o,s=r-i,a=o,c=i,f=o<e.width-1?o+1:o,h=i<e.height-1?i+1:i,u=n[2*(c*e.width+a)],d=n[2*(c*e.width+f)],m=n[2*(h*e.width+a)],w=n[2*(h*e.width+f)],p=n[2*(c*e.width+a)+1],g=n[2*(c*e.width+f)+1];return[(u*(1-s)+m*s)*(1-l)+(d*(1-s)+w*s)*l,(p*(1-s)+n[2*(h*e.width+a)+1]*s)*(1-l)+(g*(1-s)+n[2*(h*e.width+f)+1]*s)*l]}}return(t,r)=>{const o=Math.round(t),i=Math.round(r);return o<0||o>=e.width||i<0||i>=e.height?[0,0]:[n[2*(i*e.width+o)],n[2*(i*e.width+o)+1]]}}function h(t,n,r,o,i,l,s,a){const c=[],{raster:f,width:h,height:u,resolutionFactor:d}=a;let m=o,w=i,p=0,[g,y]=r(m,w);g*=n.velocityScale,y*=n.velocityScale;const x=Math.sqrt(g*g+y*y);let M,A;c.push({x:m,y:w,t:p,speed:x});for(let v=0;v<n.verticesPerLine;v++){let[o,i]=r(m,w);o*=n.velocityScale,i*=n.velocityScale;const a=Math.sqrt(o*o+i*i);if(a<n.minSpeedThreshold)return c;const g=t*o/a,y=t*i/a;m+=g*n.segmentLength,w+=y*n.segmentLength,n.wrapAround&&(m=e(m,l[0]));if(p+=t*n.segmentLength/a,Math.acos(g*M+y*A)>n.maxTurnAngle)return c;if(n.collisions){let t=Math.round(m*d);const r=Math.round(w*d);if(n.wrapAround&&(t=e(t,h)),t<0||t>h-1||r<0||r>u-1)return c;const o=f[r*h+t];if(-1!==o&&o!==s)return c;f[r*h+t]=s}c.push({x:m,y:w,t:p,speed:a}),M=g,A=y}return c}function u(t,e,n,r,o,i,l,s){const a=Math.round((.2+.6*l.getFloat())*t.verticesPerLine),c=t.verticesPerLine-a,f=h(-1,{...t,verticesPerLine:c},e,n,r,o,i,s),u=h(1,{...t,verticesPerLine:a},e,n,r,o,i,s),d=f.reverse();d.splice(-1,1);return d.concat(u)}function d(t,e,n,r,i={positions:[]}){if(t.density<=0)return[];const{positions:l}=i,s=[],a=new o,c=1/Math.max(t.lineCollisionWidth,1),f=Math.round(n*c),d=Math.round(r*c),m=new Int32Array(f*d);for(let o=0;o<m.length;o++)m[o]=-1;const w={raster:m,width:f,height:d,resolutionFactor:c},p={},g=t.lineSpacing/Math.sqrt(t.density),y=Math.floor(r/g),x=Math.floor(n/g);for(let o=0;o<y;o++){const t=o*g;for(let e=0;e<x;e++){const n=e*g;p[`${e}-${o}`]={x:n,y:t,positions:[]}}}for(const{x:o,y:h}of l){const t=p[`${Math.floor(o/g)}-${Math.floor(h/g)}`];t&&t.positions.push([o,h])}const M=[];for(const o in p){const t=p[o];if(0===t.positions.length)M.push({x:t.x+g/2,y:t.y+g/2,sort:.66+.33*a.getFloat(),stage:0});else{const[e]=t.positions.splice(0,1);M.push({x:e[0],y:e[1],sort:.33*a.getFloat(),stage:1});for(const[n,r]of t.positions)M.push({x:n,y:r,sort:.33+.33*a.getFloat(),stage:2})}}M.sort((t,e)=>t.sort-e.sort);for(const{x:o,y:A,stage:v}of M){const i=t.onlyForwardTracing?h(1,t,e,o,A,[n,r],s.length,w):u(t,e,o,A,[n,r],s.length,a,w);i.length<2||s.push({stage:v,vertices:i})}return s}function m(t,e,n,r){if(0===r)return t;const o=Math.round(3*r),i=new Array(2*o+1);let l=0;for(let c=-o;c<=o;c++){const t=Math.exp(-c*c/(r*r));i[c+o]=t,l+=t}for(let c=-o;c<=o;c++)i[c+o]/=l;const s=new Float32Array(t.length);for(let c=0;c<n;c++)for(let n=0;n<e;n++){let r=0,l=0;for(let s=-o;s<=o;s++){if(n+s<0||n+s>=e)continue;const a=i[s+o];r+=a*t[2*(c*e+(n+s))],l+=a*t[2*(c*e+(n+s))+1]}s[2*(c*e+n)]=r,s[2*(c*e+n)+1]=l}const a=new Float32Array(t.length);for(let c=0;c<e;c++)for(let t=0;t<n;t++){let r=0,l=0;for(let a=-o;a<=o;a++){if(t+a<0||t+a>=n)continue;const f=i[a+o];r+=f*s[2*((t+a)*e+c)],l+=f*s[2*((t+a)*e+c)+1]}a[2*(t*e+c)]=r,a[2*(t*e+c)+1]=l}return a}function w(t,e){const n=new o,r=t.reduce((t,e)=>t+e.vertices.length,0),i=new Float32Array(4*r),l=new Array(t.length);let s=0,a=0;for(const{vertices:o}of t){const t=s;for(const e of o)i[4*s]=e.x,i[4*s+1]=e.y,i[4*s+2]=e.t,i[4*s+3]=e.speed,s++;l[a++]={startVertex:t,numberOfVertices:o.length,totalTime:o[o.length-1].t,timeSeed:e?n.getFloat():0}}return{lineVertices:i,lineDescriptors:l}}function p(t,e){const n=9,{lineVertices:r,lineDescriptors:o}=t;let i=0,l=0;for(const d of o){i+=2*d.numberOfVertices;l+=6*(d.numberOfVertices-1)}const s=new Float32Array(i*n),a=new Uint32Array(l);let c=0,f=0;function h(){a[f++]=c-2,a[f++]=c,a[f++]=c-1,a[f++]=c,a[f++]=c+1,a[f++]=c-1}function u(t,e,r,o,i,l,a,f){const h=c*n;let u=0;s[h+u++]=t,s[h+u++]=e,s[h+u++]=1,s[h+u++]=r,s[h+u++]=l,s[h+u++]=a,s[h+u++]=o/2,s[h+u++]=i/2,s[h+u++]=f,c++,s[h+u++]=t,s[h+u++]=e,s[h+u++]=-1,s[h+u++]=r,s[h+u++]=l,s[h+u++]=a,s[h+u++]=-o/2,s[h+u++]=-i/2,s[h+u++]=f,c++}for(const d of o){const{totalTime:t,timeSeed:n}=d;let o=null,i=null,l=null,s=null,a=null,c=null;for(let f=0;f<d.numberOfVertices;f++){const m=r[4*(d.startVertex+f)],w=r[4*(d.startVertex+f)+1],p=r[4*(d.startVertex+f)+2],g=r[4*(d.startVertex+f)+3];let y=null,x=null,M=null,A=null;if(f>0){y=m-o,x=w-i;const r=Math.sqrt(y*y+x*x);if(y/=r,x/=r,f>1){let t=y+a,n=x+c;const r=Math.sqrt(t*t+n*n);t/=r,n/=r;const o=Math.min(1/(t*y+n*x),e);t*=o,n*=o,M=-n,A=t}else M=-x,A=y;null!==M&&null!==A&&(u(o,i,l,M,A,t,n,g),h())}o=m,i=w,l=p,a=y,c=x,s=g}u(o,i,l,-c,a,t,n,s)}return{vertexData:s,indexData:a}}function g(t){const e=16,n=1,r=2,{lineVertices:o,lineDescriptors:i}=t;let l=0,s=0;for(const S of i){const t=S.numberOfVertices-1;l+=4*t*2,s+=6*t*2}const a=new Float32Array(l*e),c=new Uint32Array(s);let f,h,u,d,m,w,p,g,y,x,M,A,v,F,I=0,V=0;function L(){c[V++]=I-8,c[V++]=I-7,c[V++]=I-6,c[V++]=I-7,c[V++]=I-5,c[V++]=I-6,c[V++]=I-4,c[V++]=I-3,c[V++]=I-2,c[V++]=I-3,c[V++]=I-1,c[V++]=I-2}function b(t,o,i,l,s,c,f,h,u,d,m,w,p,g){const y=I*e;let x=0;for(const e of[n,r])for(const n of[1,2,3,4])a[y+x++]=t,a[y+x++]=o,a[y+x++]=i,a[y+x++]=l,a[y+x++]=f,a[y+x++]=h,a[y+x++]=u,a[y+x++]=d,a[y+x++]=e,a[y+x++]=n,a[y+x++]=p,a[y+x++]=g,a[y+x++]=s/2,a[y+x++]=c/2,a[y+x++]=m/2,a[y+x++]=w/2,I++}function k(t,e){let n=y+M,r=x+A;const o=Math.sqrt(n*n+r*r);n/=o,r/=o;const i=y*n+x*r;n/=i,r/=i;let l=M+v,s=A+F;const a=Math.sqrt(l*l+s*s);l/=a,s/=a;const c=M*l+A*s;l/=c,s/=c,b(f,h,u,d,-r,n,m,w,p,g,-s,l,t,e),L()}function D(t,e,n,r,o,i){if(y=M,x=A,M=v,A=F,null==y&&null==x&&(y=M,x=A),null!=m&&null!=w){v=t-m,F=e-w;const n=Math.sqrt(v*v+F*F);v/=n,F/=n}null!=y&&null!=x&&k(o,i),f=m,h=w,u=p,d=g,m=t,w=e,p=n,g=r}function P(t,e){y=M,x=A,M=v,A=F,null==y&&null==x&&(y=M,x=A),null!=y&&null!=x&&k(t,e)}for(const S of i){f=null,h=null,u=null,d=null,m=null,w=null,p=null,g=null,y=null,x=null,M=null,A=null,v=null,F=null;const{totalTime:t,timeSeed:e}=S;for(let n=0;n<S.numberOfVertices;n++){D(o[4*(S.startVertex+n)],o[4*(S.startVertex+n)+1],o[4*(S.startVertex+n)+2],o[4*(S.startVertex+n)+3],t,e)}P(t,e)}return{vertexData:a,indexData:c}}function y(t,e,r=e.width,o=e.height,i=0,l=0){const s=e.pixels,a=r*o,c=2,f=new Float32Array(a*c),h=e.width,u=(t,e)=>t+i+(e+l)*h,d=(t,e)=>t+e*r;let m;if(null!=e.mask)if(r!==e.width||o!==e.height||0!==i||0!==l){m=new Uint8Array(a*c);const t=e.mask;for(let e=0;e<o;++e)for(let n=0;n<r;++n){const r=u(n,e),o=d(n,e);m[c*o]=t[c*r],m[c*o+1]=t[c*r+1]}}else m=e.mask;else m=new Uint8Array(a*c),m.fill(255);if("vector-uv"===t)for(let n=0;n<o;++n)for(let t=0;t<r;++t){const e=u(t,n),r=d(t,n);f[c*r]=s[0][e],f[c*r+1]=-s[1][e]}else if("vector-magdir"===t){const{cos:t,sin:e}=Math;for(let i=0;i<o;++i)for(let o=0;o<r;++o){const r=u(o,i),l=d(o,i),a=s[0][r],h=n(s[1][r]),m=t(h-Math.PI/2),w=e(h-Math.PI/2);f[c*l]=m*a,f[c*l+1]=w*a}}return{data:f,mask:m,width:r,height:o}}async function x(t,e,n,r,o,a){const c=performance.now(),f=l(e.spatialReference);if(!f){const i=await M(t,e,n,r,o,a);return has("esri-2d-profiler")&&s().info("I.7","loadImagery, early exit (ms)",Math.round(performance.now()-c)),has("esri-2d-profiler")&&s().info("I.9","Number of parts",1),i}const[h,u]=f.valid,d=u-h,m=Math.ceil(e.width/d),w=e.width/m,p=Math.round(n/m);let g=e.xmin;const y=[],x=performance.now();for(let l=0;l<m;l++){const n=new i({xmin:g,xmax:g+w,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference});y.push(M(t,n,p,r,o,a)),g+=w}const A=await Promise.all(y);if(has("esri-2d-profiler")&&s().info("I.8","All calls to _fetchPart (ms)",Math.round(performance.now()-x)),has("esri-2d-profiler")&&s().info("I.9","Number of parts",A.length),1===A.length)return has("esri-2d-profiler")&&s().info("I.10","loadImagery, general exit without stitching back (ms)",Math.round(performance.now()-c)),A[0];const v={data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r};let F=0;for(const i of A){for(let t=0;t<i.height;t++)for(let e=0;e<i.width;e++)F+e>=n||(v.data[2*(t*n+F+e)]=i.data[2*(t*i.width+e)],v.data[2*(t*n+F+e)+1]=i.data[2*(t*i.width+e)+1],v.mask[t*n+F+e]=i.mask[t*i.width+e]);F+=i.width}return has("esri-2d-profiler")&&s().info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-c)),v}async function M(t,e,n,r,o,i){const l={requestProjectedLocalDirections:!0,signal:i};if(null!=o&&(l.timeExtent=o),"imagery"===t.type){await t.load({signal:i});const o=await t.internalFetchImage(e,n,r,l);if(null==o?.pixelData?.pixelBlock)return{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r};return y(t.rasterInfo.dataType,o.pixelData.pixelBlock)}await t.load({signal:i});const s=await t.fetchPixels(e,n,r,l);if(null==s?.pixelBlock)return{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r};return y(t.serviceRasterInfo.dataType,s.pixelBlock)}export{w as createAnimatedLinesData,f as createFlowFieldFromData,c as createFlowMesh,g as createParticlesMesh,p as createStreamlinesMesh,x as loadImagery,y as toFlowData,d as traceFlowPaths};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t,__param as e}from"tslib";import{location as i,input as s}from"../../GraphShaderModule.js";import{dot as o,Vec2 as l,Vec4 as r,mix as a,Float as n,length as m,clamp as d,Vec3 as p,step as u,min as y}from"../../graph/glsl.js";import{AAnimatedPolyShader as c,PolyHittestVertexInput as h,PolyVertexInput as x,PolyFragmentInput as v}from"./AAnimatedPolyShader.js";import{getValue as f}from"./AAnimatedShader.js";import{distPointSegment as b}from"../shaders/hittestUtils.js";import{getLineThinFactor as S}from"../shaders/LineShader.js";class w extends x{}t([i(10,n)],w.prototype,"accumulatedDistance",void 0),t([i(11,l)],w.prototype,"normal",void 0),t([i(12,l)],w.prototype,"segmentDirection",void 0);class g extends v{}class P extends c{constructor(){super(...arguments),this.type="AnimatedLineShader"}vertex(t,e){const{animationPointerAndBaseSizeAndReferenceSize:i}=t,s=i.xy,{distanceToPx:m,ndc:d,z:p,color:u,isOutline:y,strokeWidth:c,isSDF:h,baseSize:x,scale:v,scaleSymbolsProportionally:b,evalParams:S}=this._vertexPoly(t),w=t.sizing.xy,g=w.x.multiply(x).divide(w.y),P=f(s,6,S).a,z=t.accumulatedDistance.subtract(P),{normal:A}=t,D=t.normal.y,j=z.divide(this.view.displayZoomFactor).add(o(t.segmentDirection,t.offset)).divide(g),F=D.add(1).divide(2),R=new l(j,F),W=t.tlbr.divide(this.mosaicInfo.size.xyxy),M=x.divide(2);return{glPosition:new r(d,p,1),tlbr:W,uv:R,color:u.multiply(new n(1).subtract(y)),outlineColor:u.multiply(y),distanceToPx:m,strokeWidth:c.multiply(a(new n(1),v,b)),isOutline:y,isSDF:h,halfWidth:M,normal:A,...this.maybeRunHittest(t,e,M)}}fragment(t){const e=this._fragmentPoly(t),{halfWidth:i,normal:s}=t,o=S(i),l=m(s).multiply(i),r=d(o.multiply(i.subtract(l)).divide(o.subtract(new n(1))),new n(0),new n(1));return this.getFragmentOutput(e.multiply(r),t)}hittest(t,e,i){const{viewMat3:s,tileMat3:o}=this.view,l=s.multiply(o),r=l.multiply(new p(t.pos,1)),a=l.multiply(new p(e.nextPos1,1)),n=l.multiply(new p(e.nextPos2,1)),{distance:m,smallSymbolDistance:d,smallSymbolSizeThreshold:c}=this.hittestRequest,h=u(i,c.multiply(.5)).multiply(m.subtract(d)),x=this.hittestRequest.position;return y(b(x,r.xy,a.xy),b(x,r.xy,n.xy)).subtract(i).add(h)}}t([e(0,s(w)),e(1,s(h))],P.prototype,"vertex",null),t([e(0,s(g))],P.prototype,"fragment",null);export{P as AnimatedLineShader};
5
+ import{__decorate as t,__param as i}from"tslib";import{location as e,uniform as s,input as l}from"../../GraphShaderModule.js";import{dot as o,Vec2 as a,Float as n,max as r,Vec4 as d,mix as m,length as p,clamp as u,Vec3 as y,step as c,min as h}from"../../graph/glsl.js";import{AAnimatedPolyShader as x,PolyHittestVertexInput as v,PolyVertexInput as f,PolyFragmentInput as w}from"./AAnimatedPolyShader.js";import{getValue as b}from"./AAnimatedShader.js";import{distPointSegment as g}from"../shaders/hittestUtils.js";import{getLineAntialiasing as S,getLineThinFactor as P,AntialiasingControls as z}from"../shaders/LineShader.js";class A extends f{}t([e(10,n)],A.prototype,"accumulatedDistance",void 0),t([e(11,a)],A.prototype,"normal",void 0),t([e(12,a)],A.prototype,"segmentDirection",void 0);class D extends w{}class j extends x{constructor(){super(...arguments),this.type="AnimatedLineShader"}vertex(t,i){const{animationPointerAndBaseSizeAndReferenceSize:e}=t,s=e.xy,{distanceToPx:l,ndc:p,z:u,color:y,isOutline:c,strokeWidth:h,isSDF:x,baseSize:v,scale:f,scaleSymbolsProportionally:w,evalParams:g}=this._vertexPoly(t),S=t.sizing.xy,P=S.x.multiply(v).divide(S.y),z=b(s,6,g).a,A=t.accumulatedDistance.subtract(z),{normal:D}=t,j=t.normal.y,C=A.divide(this.view.displayZoomFactor).add(o(t.segmentDirection,t.offset)).divide(P),F=j.add(1).divide(2),R=new a(C,F),W=t.tlbr.divide(this.mosaicInfo.size.xyxy),M=v.divide(2),O=new n(.5).multiply(this.antialiasingControls.antialiasing),T=r(M.add(O),new n(.45)).add(new n(.1).multiply(O));return{glPosition:new d(p,u,1),tlbr:W,uv:R,color:y.multiply(new n(1).subtract(c)),outlineColor:y.multiply(c),distanceToPx:l,strokeWidth:h.multiply(m(new n(1),f,w)),isOutline:c,isSDF:x,halfWidth:T,normal:D,...this.maybeRunHittest(t,i,T)}}fragment(t){const i=this._fragmentPoly(t),e=S(t,this.antialiasingControls.blur),{halfWidth:s,normal:l}=t,o=P(s),a=p(l).multiply(s),r=u(o.multiply(s.subtract(a)).divide(o.subtract(new n(1))),new n(0),new n(1));return this.getFragmentOutput(i.multiply(r).multiply(e),t)}hittest(t,i,e){const{viewMat3:s,tileMat3:l}=this.view,o=s.multiply(l),a=o.multiply(new y(t.pos,1)),n=o.multiply(new y(i.nextPos1,1)),r=o.multiply(new y(i.nextPos2,1)),{distance:d,smallSymbolDistance:m,smallSymbolSizeThreshold:p}=this.hittestRequest,u=c(e,p.multiply(.5)).multiply(d.subtract(m)),x=this.hittestRequest.position;return h(g(x,a.xy,n.xy),g(x,a.xy,r.xy)).subtract(e).add(u)}}t([s(z)],j.prototype,"antialiasingControls",void 0),t([i(0,l(A)),i(1,l(v))],j.prototype,"vertex",null),t([i(0,l(D))],j.prototype,"fragment",null);export{j as AnimatedLineShader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{invert as e,multiply as t}from"../../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{animationDebugFlags as i}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{FeatureTechnique as r}from"../FeatureTechnique.js";import{isHittest as o,getSelectionDefines as n,getLocalTileOffset as s,getFeatureUniforms as m,resolveDynamicUniforms as l,getFeaturePipelineState as u}from"../featureTechniqueUtils.js";class c extends r{render(r,c){const{context:f,painter:g}=r,{target:p}=c,{freezeGlobalTime:d}=i,x=0,b=g.textureManager.animationStore.getTexture(f,x),h=[2/r.state.size[0],0,0,0,-2/r.state.size[1],0,-1,1,1],D=Array.from(e(a(),h)),T=Array.from(t(a(),D,p.transforms.displayViewScreenMat3)),y=c.instance.getInput(),z=g.textureManager.getMosaicInfo(r,c.textureKey,!1),{optionalAttributes:R}=y,S=R.zoomRange,j=R.value1Position2Value2,A="accumulatedDistance"in R&&R.accumulatedDistance,I="segmentDirection"in R&&R.segmentDirection,M="normal"in R&&R.normal;g.setShader({shader:this.shaders.geometry,uniforms:{...l(r,c.target,y.uniforms),...m(r,c.target),mosaicInfo:z,animationInfo:{globalTime:r.animationsEnabled?!1===d?r.time/1e3:d:0,animationTextureSize:[b.descriptor.width,b.descriptor.height],animationTexture:{unit:6,texture:b},toScreen:T,toNdc:h,mapRotation:r.state.rotation,pixelRatio:r.state.pixelRatio},localTileOffset:s(c.target)},defines:{...n(r)},optionalAttributes:{zoomRange:S,value1Position2Value2:j,accumulatedDistance:A,segmentDirection:I,normal:M},useComputeBuffer:o(r)}),g.setPipelineState({...u(r)}),g.submitDraw(r,c),!1===d&&r.animationsEnabled&&p.requestRender()}}export{c as AnimatedTechnique};
5
+ import{invert as e,multiply as t}from"../../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{animationDebugFlags as a}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{FeatureTechnique as o}from"../FeatureTechnique.js";import{isHittest as r,getSelectionDefines as n,getLocalTileOffset as s,getFeatureUniforms as m,resolveDynamicUniforms as l,getFeaturePipelineState as u}from"../featureTechniqueUtils.js";import{getAntialiasingControls as c}from"../line/utils.js";class f extends o{render(o,f){const{context:g,painter:p,pixelRatio:d}=o,{target:x}=f,{freezeGlobalTime:b}=a,h=0,D=p.textureManager.animationStore.getTexture(g,h),T=[2/o.state.size[0],0,0,0,-2/o.state.size[1],0,-1,1,1],R=Array.from(e(i(),T)),j=Array.from(t(i(),R,x.transforms.displayViewScreenMat3)),y=f.instance.getInput(),z=p.textureManager.getMosaicInfo(o,f.textureKey,!1),{optionalAttributes:S}=y,A=S.zoomRange,I=S.value1Position2Value2,M="accumulatedDistance"in S&&S.accumulatedDistance,q="segmentDirection"in S&&S.segmentDirection,w="normal"in S&&S.normal;p.setShader({shader:this.shaders.geometry,uniforms:{...l(o,f.target,y.uniforms),...m(o,f.target),antialiasingControls:c(d),mosaicInfo:z,animationInfo:{globalTime:o.animationsEnabled?!1===b?o.time/1e3:b:0,animationTextureSize:[D.descriptor.width,D.descriptor.height],animationTexture:{unit:6,texture:D},toScreen:j,toNdc:T,mapRotation:o.state.rotation,pixelRatio:o.state.pixelRatio},localTileOffset:s(f.target)},defines:{...n(o)},optionalAttributes:{zoomRange:A,value1Position2Value2:I,accumulatedDistance:M,segmentDirection:q,normal:w},useComputeBuffer:r(o)}),p.setPipelineState({...u(o)}),p.submitDraw(o,f),!1===b&&o.animationsEnabled&&x.requestRender()}}export{f as AnimatedTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t,__param as i}from"tslib";import{location as e,uniform as o,option as l,input as a,UniformGroup as r}from"../../GraphShaderModule.js";import{Vec3 as s,step as n,min as p,max as u,Float as m,Vec4 as d,length as y,clamp as c,Vec2 as f}from"../../graph/glsl.js";import{AFeatureShader as h,BaseHittestVertexInput as v,FeatureVertexInput as w,FeatureFragmentInput as V}from"./AFeatureShader.js";import{thinLineWidthFactor as b,thinLineHalfWidth as S,epsilon as x}from"./constants.js";import{distPointSegment as g}from"./hittestUtils.js";import{VisualVariableColor as j}from"./VisualVariableColor.js";import{VisualVariableOpacity as z}from"./VisualVariableOpacity.js";import{VisualVariableSizeMinMaxValue as M}from"./VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as W}from"./VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as C}from"./VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as P}from"./VisualVariableSizeUnitValue.js";import{getVisualVariableColor as R,getVisualVariableOpacity as H,hasVisualVariableSize as O,getVisualVariableSize as U}from"./vvUtils.js";class q extends w{}t([e(3,d)],q.prototype,"color",void 0),t([e(4,f)],q.prototype,"offset",void 0),t([e(5,f)],q.prototype,"normal",void 0),t([e(6,m)],q.prototype,"halfWidth",void 0),t([e(7,m)],q.prototype,"referenceHalfWidth",void 0),t([e(8,f)],q.prototype,"zoomRange",void 0);class A extends V{}class F extends r{}function D(t){return u(new m(b).multiply(n(t,new m(S))),new m(1))}function G(t,i){const{halfWidth:e,normal:o}=t,l=D(e),a=y(o).multiply(e);return c(l.multiply(e.subtract(a)).divide(i.add(l).subtract(new m(1))),new m(0),new m(1))}function L(t,i){const{id:e,halfWidth:o,referenceHalfWidth:l}=i;if(O(t)){const i=new m(2).multiply(l),a=U(t,e,i);return new m(.5).multiply(o.divide(u(l,new m(x)))).multiply(a)}return o}function T(t,i){const{id:e,offset:o,pos:l,normal:a,zoomRange:r}=i,{displayViewScreenMat3:p,displayViewMat3:y}=t.view,c=R(t,e,i.color),f=H(t,e),h=L(t,i),v=new m(.5).multiply(t.antialiasingControls.antialiasing),w=u(h.add(v),new m(.45)).add(new m(.1).multiply(v)),V=D(w).multiply(w).multiply(o),b=y.multiply(new s(V,new m(0))),S=p.multiply(new s(l,new m(1))).add(b),x=new m(2).multiply(n(h,new m(0))).add(t.clip(e,r)),g=new d(S.xy,x,1);return{color:c,opacity:f,halfWidth:w,normal:a,scaledOffset:V,scaledHalfWidth:h,glPosition:new d(g.xy,x,1)}}function k(t,i){const{opacity:e,color:o}=t,l=G(t,i);return e.multiply(o).multiply(l)}t([o(m)],F.prototype,"antialiasing",void 0),t([o(m)],F.prototype,"blur",void 0);class B extends h{constructor(){super(...arguments),this.type="LineShader",this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(t,i){const e=T(this,t);return{...e,...this.maybeRunHittest(t,i,e.halfWidth)}}fragment(t){const i=k(t,this.antialiasingControls.blur);return this.getFragmentOutput(i,t)}hittest(t,i,e){const{viewMat3:o,tileMat3:l}=this.view,a=o.multiply(l),r=a.multiply(new s(t.pos,1)),u=a.multiply(new s(i.nextPos1,1)),m=a.multiply(new s(i.nextPos2,1)),{distance:d,smallSymbolDistance:y,smallSymbolSizeThreshold:c}=this.hittestRequest,f=n(e,c.multiply(.5)).multiply(d.subtract(y)),h=this.hittestRequest.position;return p(g(h,r.xy,u.xy),g(h,r.xy,m.xy)).subtract(e).add(f)}}t([o(F)],B.prototype,"antialiasingControls",void 0),t([l(j)],B.prototype,"visualVariableColor",void 0),t([l(z)],B.prototype,"visualVariableOpacity",void 0),t([l(M)],B.prototype,"visualVariableSizeMinMaxValue",void 0),t([l(W)],B.prototype,"visualVariableSizeScaleStops",void 0),t([l(C)],B.prototype,"visualVariableSizeStops",void 0),t([l(P)],B.prototype,"visualVariableSizeUnitValue",void 0),t([i(0,a(q)),i(1,a(v))],B.prototype,"vertex",null),t([i(0,a(A))],B.prototype,"fragment",null);export{F as AntialiasingControls,A as LineFragmentInput,B as LineShader,q as LineVertexInput,G as getLineAntialiasing,k as getLineFragmentColor,D as getLineThinFactor,T as getLineVertexData};
5
+ import{__decorate as t,__param as i}from"tslib";import{location as e,uniform as o,option as l,input as a,UniformGroup as r}from"../../GraphShaderModule.js";import{Vec3 as s,step as n,min as p,length as u,clamp as m,Float as d,max as y,Vec4 as c,Vec2 as f}from"../../graph/glsl.js";import{AFeatureShader as h,BaseHittestVertexInput as v,FeatureVertexInput as w,FeatureFragmentInput as V}from"./AFeatureShader.js";import{thinLineWidthFactor as b,thinLineHalfWidth as S,epsilon as x}from"./constants.js";import{distPointSegment as g}from"./hittestUtils.js";import{VisualVariableColor as j}from"./VisualVariableColor.js";import{VisualVariableOpacity as z}from"./VisualVariableOpacity.js";import{VisualVariableSizeMinMaxValue as M}from"./VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as W}from"./VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as C}from"./VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as P}from"./VisualVariableSizeUnitValue.js";import{getVisualVariableColor as R,getVisualVariableOpacity as H,hasVisualVariableSize as O,getVisualVariableSize as U}from"./vvUtils.js";class q extends w{}t([e(3,c)],q.prototype,"color",void 0),t([e(4,f)],q.prototype,"offset",void 0),t([e(5,f)],q.prototype,"normal",void 0),t([e(6,d)],q.prototype,"halfWidth",void 0),t([e(7,d)],q.prototype,"referenceHalfWidth",void 0),t([e(8,f)],q.prototype,"zoomRange",void 0);class A extends V{}class F extends r{}function D(t){return y(new d(b).multiply(n(t,new d(S))),new d(1))}function G(t,i){const{halfWidth:e,normal:o}=t,l=D(e),a=u(o).multiply(e);return m(l.multiply(e.subtract(a)).divide(i.add(l).subtract(new d(1))),new d(0),new d(1))}function L(t,i){const{id:e,halfWidth:o,referenceHalfWidth:l}=i;if(O(t)){const i=new d(2).multiply(l),a=U(t,e,i);return new d(.5).multiply(o.divide(y(l,new d(x)))).multiply(a)}return o}function T(t,i){const{id:e,offset:o,pos:l,normal:a,zoomRange:r}=i,{displayViewScreenMat3:p,displayViewMat3:u}=t.view,m=R(t,e,i.color),f=H(t,e),h=L(t,i),v=new d(.5).multiply(t.antialiasingControls.antialiasing),w=y(h.add(v),new d(.45)).add(new d(.1).multiply(v)),V=D(w).multiply(w).multiply(o),b=u.multiply(new s(V,new d(0))),S=p.multiply(new s(l,new d(1))).add(b),x=new d(2).multiply(n(h,new d(0))).add(t.clip(e,r)),g=new c(S.xy,x,1);return{color:m,opacity:f,halfWidth:w,normal:a,scaledOffset:V,scaledHalfWidth:h,glPosition:new c(g.xy,x,1)}}function k(t,i){const{opacity:e,color:o}=t,l=G(t,i);return e.multiply(o).multiply(l)}t([o(d)],F.prototype,"antialiasing",void 0),t([o(d)],F.prototype,"blur",void 0);class B extends h{constructor(){super(...arguments),this.type="LineShader",this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(t,i){const e=T(this,t);return{...e,...this.maybeRunHittest(t,i,e.halfWidth)}}fragment(t){const i=k(t,this.antialiasingControls.blur);return this.getFragmentOutput(i,t)}hittest(t,i,e){const{viewMat3:o,tileMat3:l}=this.view,a=o.multiply(l),r=a.multiply(new s(t.pos,1)),u=a.multiply(new s(i.nextPos1,1)),m=a.multiply(new s(i.nextPos2,1)),{distance:d,smallSymbolDistance:y,smallSymbolSizeThreshold:c}=this.hittestRequest,f=n(e,c.multiply(.5)).multiply(d.subtract(y)),h=this.hittestRequest.position;return p(g(h,r.xy,u.xy),g(h,r.xy,m.xy)).subtract(e).add(f)}}t([o(F)],B.prototype,"antialiasingControls",void 0),t([l(j)],B.prototype,"visualVariableColor",void 0),t([l(z)],B.prototype,"visualVariableOpacity",void 0),t([l(M)],B.prototype,"visualVariableSizeMinMaxValue",void 0),t([l(W)],B.prototype,"visualVariableSizeScaleStops",void 0),t([l(C)],B.prototype,"visualVariableSizeStops",void 0),t([l(P)],B.prototype,"visualVariableSizeUnitValue",void 0),t([i(0,a(q)),i(1,a(v))],B.prototype,"vertex",null),t([i(0,a(A))],B.prototype,"fragment",null);export{F as AntialiasingControls,A as LineFragmentInput,B as LineShader,q as LineVertexInput,G as getLineAntialiasing,k as getLineFragmentColor,D as getLineThinFactor,T as getLineVertexData};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as r}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import t from"../../../../core/Accessor.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{j as s}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,fromExtent as c,width as p,height as d,expand as l}from"../../../../geometry/support/aaBoundingRect.js";import{vectorCoordinates as m}from"../../../../geometry/support/coordinateSystem.js";let u=class extends t{constructor(e){super(e),this.rawResult=null}get localOriginRenderSpace(){const{extent:e,localOrigin:r,renderCoordsHelper:t}=this,o=i();return t.toRenderCoords(r,e.spatialReference,o),o}get cameraPositionRenderSpace(){const{localOriginRenderSpace:e,renderCoordsHelper:r}=this,t=i(),o=1/r.unitInMeters;return r.setAltitude(t,R*o,e),t}get boundingRect(){const{extent:e,renderCoordsHelper:r}=this,t=a();return 2===r.viewingMode?c(e,t):(this._expandBoundingRect(e.xmin,e.ymin,t),this._expandBoundingRect(e.xmax,e.ymin,t),this._expandBoundingRect(e.xmin,e.ymax,t),this._expandBoundingRect(e.xmax,e.ymax,t)),t}get cameraDimensions(){const{boundingRect:e}=this;return{width:p(e),height:d(e)}}get cameraNearFar(){const{renderCoordsHelper:{unitInMeters:e}}=this,r=1/e;return{near:x*r,far:y*r}}get upVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,2,i())}get northVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,1,i())}get eastVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,0,i())}_expandBoundingRect(e,r,t){const{extent:o,eastVector:n,northVector:i,upVector:a,renderCoordsHelper:c}=this,p=o.center.z??0;s(g,e,r,p),c.toRenderCoords(g,o.spatialReference,g),m(g,n,i,a,h),l(t,h,t)}};e([o()],u.prototype,"renderCoordsHelper",void 0),e([o()],u.prototype,"extent",void 0),e([o()],u.prototype,"localOrigin",void 0),e([o()],u.prototype,"localOriginRenderSpace",null),e([o()],u.prototype,"cameraPositionRenderSpace",null),e([o()],u.prototype,"boundingRect",null),e([o()],u.prototype,"cameraDimensions",null),e([o()],u.prototype,"upVector",null),e([o()],u.prototype,"northVector",null),e([o()],u.prototype,"eastVector",null),e([o()],u.prototype,"rawResult",void 0),u=e([n("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillComputation")],u);const g=i(),h=i(),R=r.maxTargetElevation,x=0,y=r.targetElevationRange;export{u as VolumeMeasurementCutFillComputation};
5
+ import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as r}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import t from"../../../../core/Accessor.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{j as s}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,fromExtent as c,width as p,height as d,expand as l}from"../../../../geometry/support/aaBoundingRect.js";import{vectorCoordinates as m}from"../../../../geometry/support/coordinateSystem.js";let u=class extends t{constructor(e){super(e),this.rawResult=null}get localOriginRenderSpace(){const{extent:e,localOrigin:r,renderCoordsHelper:t}=this,o=i();return t.toRenderCoords(r,e.spatialReference,o),o}get cameraPositionRenderSpace(){const{localOriginRenderSpace:e,renderCoordsHelper:r}=this,t=i(),o=1/r.unitInMeters;return r.setAltitude(t,x*o,e),t}get boundingRect(){const{extent:e,renderCoordsHelper:r}=this,t=a();return 2===r.viewingMode?c(e,t):(this._expandBoundingRect(e.xmin,e.ymin,t),this._expandBoundingRect(e.xmax,e.ymin,t),this._expandBoundingRect(e.xmin,e.ymax,t),this._expandBoundingRect(e.xmax,e.ymax,t)),t}get cameraDimensions(){const{boundingRect:e}=this;return{width:p(e),height:d(e)}}get cameraNearFar(){const{renderCoordsHelper:{unitInMeters:e}}=this,r=1/e;return{near:y*r,far:f*r}}get upVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,2,i())}get northVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,1,i())}get eastVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,0,i())}_expandBoundingRect(e,r,t){const{extent:o,eastVector:n,northVector:i,upVector:a,renderCoordsHelper:c}=this,p=o.center.z??0;s(g,e,r,p),c.toRenderCoords(g,o.spatialReference,g),m(g,n,i,a,h),l(t,h,t)}};e([o()],u.prototype,"renderCoordsHelper",void 0),e([o()],u.prototype,"extent",void 0),e([o()],u.prototype,"localOrigin",void 0),e([o()],u.prototype,"localOriginRenderSpace",null),e([o()],u.prototype,"cameraPositionRenderSpace",null),e([o()],u.prototype,"boundingRect",null),e([o()],u.prototype,"cameraDimensions",null),e([o()],u.prototype,"upVector",null),e([o()],u.prototype,"northVector",null),e([o()],u.prototype,"eastVector",null),e([o()],u.prototype,"rawResult",void 0),u=e([n("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillComputation")],u);const g=i(),h=i(),R=100,x=r.maxTargetElevation,y=0,f=r.targetElevationRange+R;export{u as VolumeMeasurementCutFillComputation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as i,abortMaybe as r}from"../../../core/maybe.js";import{debounce as s,ignoreAbortErrors as o,throwIfAborted as n}from"../../../core/promiseUtils.js";import{watch as l,when as a,sync as u,whenOnce as d}from"../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../core/scheduling.js";import{Seconds as p,secondsFromMilliseconds as c}from"../../../core/time.js";import{getMetersPerVerticalUnitForSR as m}from"../../../core/unitUtils.js";import{property as g}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as f}from"../../../geometry/ellipsoidUtils.js";import{projectOrLoad as y}from"../../../geometry/projectionUtils.js";import{fromExtent as v,intersection as w,toExtent as T,area as S,intersects as b}from"../../../geometry/support/aaBoundingRect.js";import{getInfo as R}from"../../../geometry/support/spatialReferenceUtils.js";import j from"../../../symbols/support/ElevationInfo.js";import{simulationSettingsEqual as x,getPositions as A,getFlowSimulationSettings as L}from"../../2d/engine/flow/utils.js";import U from"./SubView3D.js";import{makeScheduleFunction as M}from"./support/makeScheduleFunction.js";import{thresholdForLoadingAllTiles as P,fadeOutTime as E,fadeInTime as I,defaultTransitionDuration as q,transitionDurationFactor as F,seamlessTransitionEnabled as V,averageLoadingTimeSmoothingFactor as k,minimumTracingResolution as C}from"../support/flow/constants.js";import{wrappedWidth as D,isFullExtent as B,FlowQuery3D as W}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as z}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as G,createStreamlineGeometry as H}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as O}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as N}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as Q}from"../support/flow/StreamlineResources3DShape.js";import{tilesAreRelated as J}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as K}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as X}from"../webgl-engine/materials/RibbonLineMaterial.js";import{isInEffectiveScaleRange as Y,hasLayerBasedScaleVisibility as Z}from"../../support/layerViewUtils.js";import{TaskPriority as $}from"../../support/Scheduler.js";let ee=class extends U{constructor(e){super(e),this.type="flow",this.renderedTiles=null,this.requireLoad=!1,this.workerHandle=null,this.frameTask=null,this._averageLoadingTime=p(0),this._abortController=null,this._loadingState="ready-to-load",this._tilesUpdateIsWaiting=!1,this._debugAllowAutoLoading=!0,this.emissiveStrength=0,this._overrideMaterialParameters=null,this._overrideSimulationSettings=null,this._overrideTransitionEnabled=null,this._updateTask=null,this._debouncedTileUpdate=s(async()=>{const{allTiles:e}=this.surface,t=this._getTileFilterFunction(),i=new Set;function*r(r){for(let s=0;s<e.length;++s){const o=e.at(s);t(o)&&i.add(o),r.madeProgress(),r.done&&(r=yield)}}await this.frameTask.scheduleGenerator(r),this.renderedTiles=i})}initialize(){const{surface:e,view:t}=this,{resourceController:i}=t;this.workerHandle=new z(M(i)),this.frameTask=i.scheduler.registerTask($.FLOW_GENERATOR),this._updateTask=h({update:e=>this._update(e)}),this.addHandles([l(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>null==e&&null==t||null!=e&&null!=t&&x(e,t)}),l(()=>{const{elevationInfo:e}=this;return[this._clippingArea,this._visible,this._draped,this.view.state.contentPixelRatio,this.view.viewingMode,e?.mode,e?.offset,e?.unit,this._effectiveDensity]},()=>this.triggerLoad(),u),l(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),e.on("tiles-changed",()=>{this.loadByTileTreesAllowed&&this._triggerTilesUpdate()}),t.enableFeatureTiles(),l(()=>[this._dataBounds,this._featureTilesBounds,this.loadAllTiles],()=>this._triggerTilesUpdate()),l(()=>this._flowRenderer,(e,t)=>{const i=t?.visualVariables??[],r=e?.visualVariables??[];r.length===i.length&&r.every((e,t)=>e.type===i[t].type)||this.clear()}),a(()=>!t.featureTiles?.updating,()=>{this.loadByTileTreesAllowed&&this._triggerTilesUpdate()})]),this._triggerTilesUpdate()}destroy(){this._updateTask=i(this._updateTask),this.abort(),this.clear()}abort(){this._abortController=r(this._abortController),this.requireLoad=!1}get _clippingArea(){const e=y(this.view.clippingArea,this.surface.spatialReference).geometry;return null==e?null:v(e)}get _dataBounds(){const e=y(this.layer.fullExtent,this.surface.spatialReference).geometry;return null==e?null:v(e)}get _draped(){return"on-the-ground"===this.elevationInfo.mode}get _ellipsoidRadius(){return f(this.view.spatialReference).radius}get extent(){const{spatialReference:e}=this.surface,{renderedTiles:t}=this;if(null==e||null==t)return null;const i=O(t,this.spatialReferenceInfo);return null==i?null:(w(i,this._clippingArea,i),T(i,e))}get loadAllTiles(){const{position:e}=this.view.camera,t=e.z;if(null==t)return!1;return t*m(e.spatialReference)/this._ellipsoidRadius>=P}get loadByTileTreesAllowed(){return!this.loadAllTiles||!this.loadRequirementsMet}get _featureTilesBounds(){const e=this.view.featureTiles?.filterExtent,t=y(e,this.surface.spatialReference).geometry;return null==t?null:v(t)}get _flowRenderer(){const e=this.layer.renderer;return"flow"!==e?.type?null:e}get _materialParameters(){return{...G(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),fadeInTime:I,fadeOutTime:E,...this._overrideMaterialParameters,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&K(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _seamlessTransitionWaitingTime(){const{_averageLoadingTime:e}=this;return p(0===e?q:this._averageLoadingTime*F)}get _seamlessTransitionEnabled(){return null!=this._overrideTransitionEnabled?this._overrideTransitionEnabled:V}get _tracingResolution(){const{extent:e}=this;if(!e)return[0,0];const t=D(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[i,r]=this.view.size;let s,o;i<r?(s=i,o=i/t):(s=r*t,o=r);const n=C,l=this.view.qualitySettings.flow3D.maxTracingResolution,a=Math.max(1,n/Math.min(s,o)),u=a*Math.min(1,l/Math.max(s*a,o*a));return[Math.round(s*u),Math.round(o*u)]}get _visible(){const e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(null==e||e.a>0)}get _estimatedStreamlines(){const{extent:e,_simulationSettings:t,renderedTiles:i}=this;if(null==t||null==i)return 0;const r=this._tracingResolution[0]*this._tracingResolution[1]/t.lineSpacing**2*t.density;let s=0;for(const a of i)s+=S(a.extent);const o=null==e?null:v(e),n=S(o),l=0===n?0:s/n;return 2*Math.round(r*l)}get _effectiveDensity(){const{_estimatedStreamlines:e,_simulationSettings:t}=this,{qualitySettings:i,quality:r}=this.view;if(null==t)return 0;const s=i.flow3D.maxTotalNumberOfStreamlines,o=e>=s?s/e:1,n=t.density*o*r;return t.lineSpacing/Math.sqrt(n)<t.lineCollisionWidth?4*t.lineSpacing:n}get elevationInfo(){return this.layer.elevationInfo??te}startPositions(e){if(!this._seamlessTransitionEnabled)return[];const{_flowRenderer:t,_resources:i}=this;return null==t||null==i?[]:A(i.streamlines,i.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return R(this.surface.spatialReference)}get layer(){return this.layerView.layer}get loadingState(){return this._loadingState}get loadRequirementsMet(){return null!=this.renderedTiles&&this.renderedTiles.size>0}getUpdating(){return this.updatingHandles.updating||this.requireLoad||"before-transition"===this._loadingState}get updating(){return this.getUpdating()}get visibleAtCurrentScale(){return!Z()||Y(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){const{_flowRenderer:e,_overrideSimulationSettings:t}=this;if(null==e)return null;let i=L(e);return i.segmentLength=i.lineCollisionWidth/2,i.onlyForwardTracing=!1,null!=t&&(i={...i,...t}),i}getSimulationSettings(e){const{_simulationSettings:t,spatialReferenceInfo:i}=this;if(null==t)return null;const r="global"===this.view.viewingMode&&null!=i&&B(e.extent.xmin,e.extent.xmax,i);return{...t,wrapAround:r,density:this._effectiveDensity}}get surface(){return this.view.basemapTerrain}doRefresh(){this.triggerLoad()}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null,this._loadingState="ready-to-load"}_update(e){const t=c(e.time);this._lastResources?.hasFadedOut(t)&&this._lastResources.detach();const i=this._nextStateForTransition(t);if(!this.requireLoad||this.updatingHandles.updating||"ready-to-load"!==i||!this.loadRequirementsMet)return void(this._loadingState=i);this._loadingState="loading";const r=async()=>{const e=performance.now(),i=this._seamlessTransitionEnabled&&null!=this._resources?p(t+this._seamlessTransitionWaitingTime):t;await this._load(i);const r=p((performance.now()-e)/1e3);this._updateAverageLoadingTime(r)};this.updatingHandles.addPromise(o(r())),this.requireLoad=!1}_updateAverageLoadingTime(e){const t=k;this._averageLoadingTime=p(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){this._debugAllowAutoLoading&&(this.requireLoad=!0)}async _load(e){const{extent:t,view:i}=this;if(!this._visible)return this.clear(),void(this._loadingState="ready-to-load");if(null==t)return void(this._loadingState="ready-to-load");const r=new W(t,this.layerView.timeExtent,this._tracingResolution,i.state.contentPixelRatio,e);null==this._abortController&&(this._abortController=new AbortController);const s=this._abortController,o=await this._loadStreamlines(r,s.signal);if(n(s.signal),this._visible&&null!=o){this._lastResources?.detach(),this._lastResources=this._resources,this._resources=o;const t=performance.now()/1e3,i=t>e?t:e;null!=this._lastResources&&(this._lastResources.endTime=i),this._resources.startTime=i,await o.attach(),this._loadingState=this._seamlessTransitionEnabled?"before-transition":"transitioning"}else this._loadingState="ready-to-load"}async _loadStreamlines(e,t){const i=await this.fetchDataAndGenerateStreamlines(e,t);if(null==i)return null;const{geometries:r,material:s}=await this._createGeometry(e,i);return this._draped?new N(e,i,s,r,this.layerView):new Q(e,i,s,r,this.view)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t){const i=new X(this._materialParameters,this.view.state.isGlobal),r=new Array,{elevationInfo:s,_draped:o,view:n}=this;function*l(l){for(let a=0;a<t.length;++a)r.push(H(n,e,t[a],s,i,o)),l.madeProgress(),l.done&&(l=yield)}return await this.frameTask.scheduleGenerator(l),{geometries:r,material:i}}_triggerTilesUpdate(){if(this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;const e=async()=>{await d(()=>this.view.stationary),this._tilesUpdateIsWaiting=!1,await this._debouncedTileUpdate()};this.updatingHandles.addPromise(o(e()))}_getTileFilterFunction(){const{_dataBounds:e,view:i,_featureTilesBounds:r}=this;if(this.loadAllTiles)return t=>t.leaf&&ie(e,t.extent);const s=t=>t.rendered&&t.visible&&ie(e,t.extent),{featureTiles:o}=i;if(!o)return s;const n=o.tiles.filter(e=>e.measures.visible);return e=>s(e)&&ie(r,e.extent)&&n.some(({lij:i})=>t(i,e.lij)||J(i,e.lij))}_nextStateForTransition(e){const{_resources:t}=this;if(null==this._flowRenderer||null==t||"ready-to-load"===this._loadingState||"loading"===this._loadingState)return this._loadingState;const i=t.startTime;return e<i?"before-transition":e<i+E?"transitioning":"ready-to-load"}get usedMemory(){return(this._lastResources?.usedMemory??0)+(this._resources?.usedMemory??0)}get test(){}};e([g()],ee.prototype,"type",void 0),e([g()],ee.prototype,"renderedTiles",void 0),e([g()],ee.prototype,"_resources",void 0),e([g()],ee.prototype,"_lastResources",void 0),e([g()],ee.prototype,"requireLoad",void 0),e([g()],ee.prototype,"_averageLoadingTime",void 0),e([g()],ee.prototype,"_loadingState",void 0),e([g()],ee.prototype,"emissiveStrength",void 0),e([g()],ee.prototype,"_clippingArea",null),e([g()],ee.prototype,"_dataBounds",null),e([g()],ee.prototype,"_draped",null),e([g()],ee.prototype,"_ellipsoidRadius",null),e([g()],ee.prototype,"extent",null),e([g()],ee.prototype,"loadAllTiles",null),e([g()],ee.prototype,"_featureTilesBounds",null),e([g()],ee.prototype,"_flowRenderer",null),e([g()],ee.prototype,"_materialParameters",null),e([g()],ee.prototype,"_opacity",null),e([g()],ee.prototype,"_seamlessTransitionWaitingTime",null),e([g()],ee.prototype,"_seamlessTransitionEnabled",null),e([g()],ee.prototype,"_tracingResolution",null),e([g()],ee.prototype,"_visible",null),e([g()],ee.prototype,"_estimatedStreamlines",null),e([g()],ee.prototype,"_effectiveDensity",null),e([g()],ee.prototype,"elevationInfo",null),e([g()],ee.prototype,"needsMagnitude",null),e([g()],ee.prototype,"spatialReferenceInfo",null),e([g()],ee.prototype,"layer",null),e([g()],ee.prototype,"loadingState",null),e([g()],ee.prototype,"updating",null),e([g()],ee.prototype,"visibleAtCurrentScale",null),e([g()],ee.prototype,"_overrideMaterialParameters",void 0),e([g()],ee.prototype,"_overrideSimulationSettings",void 0),e([g()],ee.prototype,"_overrideTransitionEnabled",void 0),e([g()],ee.prototype,"_simulationSettings",null),e([g()],ee.prototype,"surface",null),ee=e([_("esri.views.3d.layers.FlowSubView3D")],ee);const te=new j({mode:"on-the-ground"});function ie(e,t){return null==e||null==t||b(e,t)}export{ee as default};
5
+ import{__decorate as e}from"tslib";import{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as i,abortMaybe as r}from"../../../core/maybe.js";import{debounce as s,ignoreAbortErrors as n,throwIfAborted as o}from"../../../core/promiseUtils.js";import{watch as l,when as a,sync as u,whenOnce as d}from"../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../core/scheduling.js";import{Seconds as p,secondsFromMilliseconds as c}from"../../../core/time.js";import{getMetersPerVerticalUnitForSR as m}from"../../../core/unitUtils.js";import{property as g}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as f}from"../../../geometry/ellipsoidUtils.js";import{projectOrLoad as y}from"../../../geometry/projectionUtils.js";import{fromExtent as v,intersection as w,toExtent as T,contains as S,area as b,intersects as R}from"../../../geometry/support/aaBoundingRect.js";import{getInfo as j}from"../../../geometry/support/spatialReferenceUtils.js";import x from"../../../symbols/support/ElevationInfo.js";import{simulationSettingsEqual as A,getPositions as L,getFlowSimulationSettings as M}from"../../2d/engine/flow/utils.js";import U from"./SubView3D.js";import{makeScheduleFunction as P}from"./support/makeScheduleFunction.js";import{tileFilterDistance as E,thresholdForLoadingAllTiles as I,fadeOutTime as q,fadeInTime as F,defaultTransitionDuration as V,transitionDurationFactor as k,seamlessTransitionEnabled as C,averageLoadingTimeSmoothingFactor as D,minimumTracingResolution as B}from"../support/flow/constants.js";import{wrappedWidth as W,isFullExtent as z,FlowQuery3D as G}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as H}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as O,createStreamlineGeometry as N}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as Q}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as J}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as K}from"../support/flow/StreamlineResources3DShape.js";import{tilesAreRelated as X}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as Y}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as Z}from"../webgl-engine/materials/RibbonLineMaterial.js";import{isInEffectiveScaleRange as $,hasLayerBasedScaleVisibility as ee}from"../../support/layerViewUtils.js";import{TaskPriority as te}from"../../support/Scheduler.js";let ie=class extends U{constructor(e){super(e),this.type="flow",this.renderedTiles=null,this.requireLoad=!1,this.workerHandle=null,this.frameTask=null,this._averageLoadingTime=p(0),this._abortController=null,this._loadingState="ready-to-load",this._tilesUpdateIsWaiting=!1,this._debugAllowAutoLoading=!0,this.emissiveStrength=0,this._overrideMaterialParameters=null,this._overrideSimulationSettings=null,this._overrideTransitionEnabled=null,this._updateTask=null,this._debouncedTileUpdate=s(async()=>{const{allTiles:e}=this.surface,t=this._getTileFilterFunction(),i=new Set;function*r(r){for(let s=0;s<e.length;++s){const n=e.at(s);t(n)&&i.add(n),r.madeProgress(),r.done&&(r=yield)}}await this.frameTask.scheduleGenerator(r),this.renderedTiles=i})}initialize(){const{surface:e,view:t}=this,{resourceController:i}=t;this.workerHandle=new H(P(i)),this.frameTask=i.scheduler.registerTask(te.FLOW_GENERATOR),this._updateTask=h({update:e=>this._update(e)}),this.addHandles([l(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>null==e&&null==t||null!=e&&null!=t&&A(e,t)}),l(()=>{const{elevationInfo:e}=this;return[this._clippingArea,this._visible,this._draped,this.view.state.contentPixelRatio,this.view.viewingMode,e?.mode,e?.offset,e?.unit,this._effectiveDensity]},()=>this.triggerLoad(),u),l(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),e.on("tiles-changed",()=>{this.loadByTileTreesAllowed&&this._triggerTilesUpdate()}),t.enableFeatureTiles(),l(()=>[this._dataBounds,this._featureTilesBounds,this.loadAllTiles],()=>this._triggerTilesUpdate()),l(()=>this._flowRenderer,(e,t)=>{const i=t?.visualVariables??[],r=e?.visualVariables??[];r.length===i.length&&r.every((e,t)=>e.type===i[t].type)||this.clear()}),a(()=>!t.featureTiles?.updating,()=>{this.loadByTileTreesAllowed&&this._triggerTilesUpdate()})]),this._triggerTilesUpdate()}destroy(){this._updateTask=i(this._updateTask),this.abort(),this.clear()}abort(){this._abortController=r(this._abortController),this.requireLoad=!1}get _clippingArea(){const e=y(this.view.clippingArea,this.surface.spatialReference).geometry;return null==e?null:v(e)}get _dataBounds(){const e=y(this.layer.fullExtent,this.surface.spatialReference).geometry;return null==e?null:v(e)}get _draped(){return"on-the-ground"===this.elevationInfo.mode}get _ellipsoidRadius(){return f(this.view.spatialReference).radius}get extent(){const{spatialReference:e}=this.surface;let t=this.renderedTiles;if(null==e||null==t)return null;const i=this.view.terrainLevel;if(null!=i){const e=new Set;t.forEach(t=>{Math.abs(i-t.level)<E&&e.add(t)}),t=e}const r=Q(t,this.spatialReferenceInfo);return null==r?null:(w(r,this._clippingArea,r),T(r,e))}get loadAllTiles(){const{position:e}=this.view.camera,t=e.z;if(null==t)return!1;return t*m(e.spatialReference)/this._ellipsoidRadius>=I}get loadByTileTreesAllowed(){return!this.loadAllTiles||!this.loadRequirementsMet}get _featureTilesBounds(){const e=this.view.featureTiles?.filterExtent,t=y(e,this.surface.spatialReference).geometry;return null==t?null:v(t)}get _flowRenderer(){const e=this.layer.renderer;return"flow"!==e?.type?null:e}get _materialParameters(){return{...O(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),fadeInTime:F,fadeOutTime:q,...this._overrideMaterialParameters,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&Y(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _seamlessTransitionWaitingTime(){const{_averageLoadingTime:e}=this;return p(0===e?V:this._averageLoadingTime*k)}get _seamlessTransitionEnabled(){return null!=this._overrideTransitionEnabled?this._overrideTransitionEnabled:C}get _tracingResolution(){const{extent:e}=this;if(!e)return[0,0];const t=W(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[i,r]=this.view.size;let s,n;i<r?(s=i,n=i/t):(s=r*t,n=r);const o=B,l=this.view.qualitySettings.flow3D.maxTracingResolution,a=Math.max(1,o/Math.min(s,n)),u=a*Math.min(1,l/Math.max(s*a,n*a));return[Math.round(s*u),Math.round(n*u)]}get _visible(){const e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(null==e||e.a>0)}get _estimatedStreamlines(){const{extent:e,_simulationSettings:t,renderedTiles:i}=this;if(null==t||null==i)return 0;const r=this._tracingResolution[0]*this._tracingResolution[1]/t.lineSpacing**2*t.density,s=null==e?null:v(e);if(null==s)return 0;let n=0;for(const a of i)S(s,a.extent)&&(n+=b(a.extent));const o=b(s),l=0===o?0:n/o;return 2*Math.round(r*l)}get _effectiveDensity(){const{_estimatedStreamlines:e,_simulationSettings:t}=this,{qualitySettings:i,quality:r}=this.view;if(null==t)return 0;const s=i.flow3D.maxTotalNumberOfStreamlines,n=e>=s?s/e:1,o=t.density*n*r;return t.lineSpacing/Math.sqrt(o)<t.lineCollisionWidth?4*t.lineSpacing:o}get elevationInfo(){return this.layer.elevationInfo??re}startPositions(e){if(!this._seamlessTransitionEnabled)return[];const{_flowRenderer:t,_resources:i}=this;return null==t||null==i?[]:L(i.streamlines,i.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return j(this.surface.spatialReference)}get layer(){return this.layerView.layer}get loadingState(){return this._loadingState}get loadRequirementsMet(){return null!=this.renderedTiles&&this.renderedTiles.size>0}getUpdating(){return this.updatingHandles.updating||this.requireLoad||"before-transition"===this._loadingState}get updating(){return this.getUpdating()}get visibleAtCurrentScale(){return!ee()||$(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){const{_flowRenderer:e,_overrideSimulationSettings:t}=this;if(null==e)return null;let i=M(e);return i.segmentLength=i.lineCollisionWidth/2,i.onlyForwardTracing=!1,null!=t&&(i={...i,...t}),i}getSimulationSettings(e){const{_simulationSettings:t,spatialReferenceInfo:i}=this;if(null==t)return null;const r="global"===this.view.viewingMode&&null!=i&&z(e.extent.xmin,e.extent.xmax,i);return{...t,wrapAround:r,density:this._effectiveDensity}}get surface(){return this.view.basemapTerrain}doRefresh(){this.triggerLoad()}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null,this._loadingState="ready-to-load"}_update(e){const t=c(e.time);this._lastResources?.hasFadedOut(t)&&this._lastResources.detach();const i=this._nextStateForTransition(t);if(!this.requireLoad||this.updatingHandles.updating||"ready-to-load"!==i||!this.loadRequirementsMet)return void(this._loadingState=i);this._loadingState="loading";const r=async()=>{const e=performance.now(),i=this._seamlessTransitionEnabled&&null!=this._resources?p(t+this._seamlessTransitionWaitingTime):t;await this._load(i);const r=p((performance.now()-e)/1e3);this._updateAverageLoadingTime(r)};this.updatingHandles.addPromise(n(r())),this.requireLoad=!1}_updateAverageLoadingTime(e){const t=D;this._averageLoadingTime=p(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){this._debugAllowAutoLoading&&(this.requireLoad=!0)}async _load(e){const{extent:t,view:i}=this;if(!this._visible)return this.clear(),void(this._loadingState="ready-to-load");if(null==t)return void(this._loadingState="ready-to-load");const r=new G(t,this.layerView.timeExtent,this._tracingResolution,i.state.contentPixelRatio,e);null==this._abortController&&(this._abortController=new AbortController);const s=this._abortController,n=await this._loadStreamlines(r,s.signal);if(o(s.signal),this._visible&&null!=n){this._lastResources?.detach(),this._lastResources=this._resources,this._resources=n;const t=performance.now()/1e3,i=t>e?t:e;null!=this._lastResources&&(this._lastResources.endTime=i),this._resources.startTime=i,await n.attach(),this._loadingState=this._seamlessTransitionEnabled?"before-transition":"transitioning"}else this._loadingState="ready-to-load"}async _loadStreamlines(e,t){const i=await this.fetchDataAndGenerateStreamlines(e,t);if(null==i)return null;const{geometries:r,material:s}=await this._createGeometry(e,i);return this._draped?new J(e,i,s,r,this.layerView):new K(e,i,s,r,this.view)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t){const i=new Z(this._materialParameters,this.view.state.isGlobal),r=new Array,{elevationInfo:s,_draped:n,view:o}=this;function*l(l){for(let a=0;a<t.length;++a)r.push(N(o,e,t[a],s,i,n)),l.madeProgress(),l.done&&(l=yield)}return await this.frameTask.scheduleGenerator(l),{geometries:r,material:i}}_triggerTilesUpdate(){if(this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;const e=async()=>{await d(()=>this.view.stationary),this._tilesUpdateIsWaiting=!1,await this._debouncedTileUpdate()};this.updatingHandles.addPromise(n(e()))}_getTileFilterFunction(){const{_dataBounds:e,view:i,_featureTilesBounds:r}=this;if(this.loadAllTiles)return t=>t.leaf&&se(e,t.extent);const s=t=>t.rendered&&t.visible&&se(e,t.extent),{featureTiles:n}=i;if(!n)return s;const o=n.tiles.filter(e=>e.measures.visible);return e=>s(e)&&se(r,e.extent)&&o.some(({lij:i})=>t(i,e.lij)||X(i,e.lij))}_nextStateForTransition(e){const{_resources:t}=this;if(null==this._flowRenderer||null==t||"ready-to-load"===this._loadingState||"loading"===this._loadingState)return this._loadingState;const i=t.startTime;return e<i?"before-transition":e<i+q?"transitioning":"ready-to-load"}get usedMemory(){return(this._lastResources?.usedMemory??0)+(this._resources?.usedMemory??0)}get test(){}};e([g()],ie.prototype,"type",void 0),e([g()],ie.prototype,"renderedTiles",void 0),e([g()],ie.prototype,"_resources",void 0),e([g()],ie.prototype,"_lastResources",void 0),e([g()],ie.prototype,"requireLoad",void 0),e([g()],ie.prototype,"_averageLoadingTime",void 0),e([g()],ie.prototype,"_loadingState",void 0),e([g()],ie.prototype,"emissiveStrength",void 0),e([g()],ie.prototype,"_clippingArea",null),e([g()],ie.prototype,"_dataBounds",null),e([g()],ie.prototype,"_draped",null),e([g()],ie.prototype,"_ellipsoidRadius",null),e([g()],ie.prototype,"extent",null),e([g()],ie.prototype,"loadAllTiles",null),e([g()],ie.prototype,"_featureTilesBounds",null),e([g()],ie.prototype,"_flowRenderer",null),e([g()],ie.prototype,"_materialParameters",null),e([g()],ie.prototype,"_opacity",null),e([g()],ie.prototype,"_seamlessTransitionWaitingTime",null),e([g()],ie.prototype,"_seamlessTransitionEnabled",null),e([g()],ie.prototype,"_tracingResolution",null),e([g()],ie.prototype,"_visible",null),e([g()],ie.prototype,"_estimatedStreamlines",null),e([g()],ie.prototype,"_effectiveDensity",null),e([g()],ie.prototype,"elevationInfo",null),e([g()],ie.prototype,"needsMagnitude",null),e([g()],ie.prototype,"spatialReferenceInfo",null),e([g()],ie.prototype,"layer",null),e([g()],ie.prototype,"loadingState",null),e([g()],ie.prototype,"updating",null),e([g()],ie.prototype,"visibleAtCurrentScale",null),e([g()],ie.prototype,"_overrideMaterialParameters",void 0),e([g()],ie.prototype,"_overrideSimulationSettings",void 0),e([g()],ie.prototype,"_overrideTransitionEnabled",void 0),e([g()],ie.prototype,"_simulationSettings",null),e([g()],ie.prototype,"surface",null),ie=e([_("esri.views.3d.layers.FlowSubView3D")],ie);const re=new x({mode:"on-the-ground"});function se(e,t){return null==e||null==t||R(e,t)}export{ie as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import{whenOnce as r,watch as i,sync as s,initial as a}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{projectDatasetExtent as n}from"../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{LayerView3D as m}from"./LayerView3D.js";import{TiledLayerView3D as h}from"./TiledLayerView3D.js";import p from"../support/flow/FlowSubViewTiles3D.js";import{RasterTile as d}from"../terrain/RasterTile.js";import c from"../../layers/ImageryTileLayerView.js";import u from"../../layers/LayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as f}from"../../support/drapedUtils.js";import{getWebGLCapabilities as g}from"../../webgl/capabilities.js";let b=class extends(c(y(h(m(u))))){constructor(){super(...arguments),this.type="imagery-tile-3d",this._isAlignedMapTile=!0,this._flowSubView=null,this.ignoresMemoryFactor=!1,this.unloadedMemory=0}initialize(){this.layer.increaseRasterJobHandlerUsage(),null==this.fullExtent&&this.addResolvingPromise(Promise.reject(new t("layerview:spatial-reference-incompatible","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})));const e=r(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{const e=this.view.basemapTerrain.tilingScheme,t=this.layer.tileInfo;this._isAlignedMapTile=["png","png24","png32","jpg","mixed"].includes(t.format)&&e.compatibleWith(t),this.tileInfo=this._isAlignedMapTile?t:e.toTileInfo(),this.addHandles(i(()=>[this.layer.renderer,this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction,this.timeExtent],()=>this._updatingHandles.addPromise(this.doRefresh()),s))});this.addResolvingPromise(e),this.addHandles(i(()=>this.layer.renderer,e=>this._setSubView(e),a))}destroy(){this.layer.decreaseRasterJobHandlerUsage(),this._flowSubView?.destroy()}_setSubView(e){if("wcs"===this.layer.type)return;const t="flow"===e?.type,r=this._flowSubView;t&&null!=r||(r?.destroy(),this._flowSubView=t?new p({layerView:this}):null)}get _blankTile(){const e=document.createElement("canvas"),t=e.getContext("2d"),[r,i]=this.tileInfo.size;return e.width=r,e.height=i,t.clearRect(0,0,r,i),t.getImageData(0,0,r,i)}get _hasFlow(){return null!=this._flowSubView}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get dataLevelRange(){const e=this.layer.tileInfo,t=this.tileInfo.lodAt(0)?.scale,r=e.lodAt(e.lods.length-1)?.scale;return this.levelRangeFromScaleRange(t,r)}get fetchLevelRange(){if(this._hasFlow){const{minScale:e,maxScale:t}=this.layer.effectiveScaleRange;return this.levelRangeFromScaleRange(e,t)}return this.dataLevelRange}get visibleAtCurrentScale(){return this._flowSubView?.visibleAtCurrentScale??this.tilesVisibleAtCurrentScale()}_getFullExtent(){return n(this.layer.serviceRasterInfo,this.view.basemapTerrain?.spatialReference??this.view.spatialReference)}async fetchTile(e,t){const r=this.tileInfo,i=this._canSymbolizeInWebGL(),s={tileInfo:r,requestRawData:i,signal:t.signal,timeExtent:this.timeExtent,requestAsImageElement:this._isAlignedMapTile,requestProjectedLocalDirections:this._hasFlow,noClip:!1},{layer:a}=this,[l,o,n]=e,m=await a.fetchTile(l,o,n,s);if(m instanceof HTMLImageElement)return m;let h=m?.pixelBlock;if(null==h)return this._blankTile;if(!i&&!this._hasFlow&&(h=await a.applyRenderer(m),null==h))return this._blankTile;const p=new d([l,o,n],h,r.size[0],r.size[1]);return i?(p.symbolizerRenderer=a.symbolizer.rendererJSON,p.symbolizerParameters=a.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(l)),p.transformGrid=m.transformGrid,p.bandIds=a.bandIds):(p.isRendereredSource=!0,p.bandIds=null),p.interpolation=a.interpolation,p}_getSymbolizerOptions(e){const t=this.tileInfo.lodAt(e).resolution;return{pixelBlock:null,isGCS:null!=this.view.basemapTerrain?.spatialReference?this.view.basemapTerrain.spatialReference.isGeographic:this.view.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:this.layer.bandIds}}ensureSymbolizerParameters(e){this._canSymbolizeInWebGL()&&JSON.stringify(e.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(e.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e.lij[0])))}createFetchPopupFeaturesQueryGeometry(e,t){return f(e,t,this.view)}async doRefresh(){this.suspended||(this._flowSubView?.doRefresh(),this.emit("data-changed"))}isUpdating(){return this._flowSubView?.updating??!1}_canSymbolizeInWebGL(){const e=g(),{symbolizer:t}=this.layer,r=t.lookup.colormapLut?.indexedColormap,i=!!this.layer.rasterFunction?.hasClipFunction,s=r&&r.length>4*(e.maxTextureSize||4096);return t.canRenderInWebGL&&!s&&!i}get usedMemory(){return this._flowSubView?.usedMemory??0}get test(){}};e([l({readOnly:!0})],b.prototype,"_blankTile",null),e([l()],b.prototype,"_hasFlow",null),e([l({readOnly:!0})],b.prototype,"imageFormatIsOpaque",null),e([l({readOnly:!0})],b.prototype,"hasMixedImageFormats",null),e([l()],b.prototype,"_flowSubView",void 0),e([l({readOnly:!0})],b.prototype,"dataLevelRange",null),e([l({readOnly:!0})],b.prototype,"fetchLevelRange",null),e([l({readOnly:!0})],b.prototype,"visibleAtCurrentScale",null),b=e([o("esri.views.3d.layers.ImageryTileLayerView3D")],b);const w=b;export{w as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import{whenOnce as i,watch as r,sync as s,initial as a}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{projectDatasetExtent as n}from"../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{LayerView3D as m}from"./LayerView3D.js";import{TiledLayerView3D as h}from"./TiledLayerView3D.js";import p from"../support/flow/FlowSubViewTiles3D.js";import{RasterTile as d}from"../terrain/RasterTile.js";import u from"../../layers/ImageryTileLayerView.js";import c from"../../layers/LayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as f}from"../../support/drapedUtils.js";import{getWebGLCapabilities as b}from"../../webgl/capabilities.js";let g=class extends(u(y(h(m(c))))){constructor(){super(...arguments),this.type="imagery-tile-3d",this._isAlignedMapTile=!0,this._flowSubView=null,this.ignoresMemoryFactor=!1,this.unloadedMemory=0}initialize(){this.layer.increaseRasterJobHandlerUsage(),null==this.fullExtent&&this.addResolvingPromise(Promise.reject(new t("layerview:spatial-reference-incompatible","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})));const e=i(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{const e=this.view.basemapTerrain.tilingScheme,t=this.layer.tileInfo;this._isAlignedMapTile=["png","png24","png32","jpg","mixed"].includes(t.format)&&e.compatibleWith(t),this.tileInfo=this._isAlignedMapTile?t:e.toTileInfo(),this.addHandles(r(()=>[this.layer.renderer,this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction,this.timeExtent],()=>this._updatingHandles.addPromise(this.doRefresh()),s))});this.addResolvingPromise(e),this.addHandles(r(()=>this.layer.renderer,e=>this._setSubView(e),a))}destroy(){this.layer.decreaseRasterJobHandlerUsage(),this._flowSubView?.destroy()}_setSubView(e){if("wcs"===this.layer.type)return;const t="flow"===e?.type,i=this._flowSubView;t&&null!=i||(i?.destroy(),this._flowSubView=t?new p({layerView:this}):null)}get _blankTile(){const e=document.createElement("canvas"),t=e.getContext("2d"),[i,r]=this.tileInfo.size;return e.width=i,e.height=r,t.clearRect(0,0,i,r),t.getImageData(0,0,i,r)}get _hasFlow(){return null!=this._flowSubView}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get dataLevelRange(){const e=this.layer.tileInfo,t=this.tileInfo.lodAt(0)?.scale,i=e.lodAt(e.lods.length-1)?.scale;return this.levelRangeFromScaleRange(t,i)}get visibleAtCurrentScale(){return this._flowSubView?.visibleAtCurrentScale??this.tilesVisibleAtCurrentScale()}_getFullExtent(){return n(this.layer.serviceRasterInfo,this.view.basemapTerrain?.spatialReference??this.view.spatialReference)}async fetchTile(e,t){const i=this.tileInfo,r=this._canSymbolizeInWebGL(),s={tileInfo:i,requestRawData:r,signal:t.signal,timeExtent:this.timeExtent,requestAsImageElement:this._isAlignedMapTile,requestProjectedLocalDirections:this._hasFlow,noClip:!1},{layer:a}=this,[l,o,n]=e,m=await a.fetchTile(l,o,n,s);if(m instanceof HTMLImageElement)return m;let h=m?.pixelBlock;if(null==h)return this._blankTile;if(!r&&!this._hasFlow&&(h=await a.applyRenderer(m),null==h))return this._blankTile;const p=new d([l,o,n],h,i.size[0],i.size[1]);return r?(p.symbolizerRenderer=a.symbolizer.rendererJSON,p.symbolizerParameters=a.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(l)),p.transformGrid=m.transformGrid,p.bandIds=a.bandIds):(p.isRendereredSource=!0,p.bandIds=null),p.interpolation=a.interpolation,p}_getSymbolizerOptions(e){const t=this.tileInfo.lodAt(e).resolution;return{pixelBlock:null,isGCS:null!=this.view.basemapTerrain?.spatialReference?this.view.basemapTerrain.spatialReference.isGeographic:this.view.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:this.layer.bandIds}}ensureSymbolizerParameters(e){this._canSymbolizeInWebGL()&&JSON.stringify(e.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(e.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e.lij[0])))}createFetchPopupFeaturesQueryGeometry(e,t){return f(e,t,this.view)}async doRefresh(){this.suspended||(this._flowSubView?.doRefresh(),this.emit("data-changed"))}isUpdating(){return this._flowSubView?.updating??!1}_canSymbolizeInWebGL(){const e=b(),{symbolizer:t}=this.layer,i=t.lookup.colormapLut?.indexedColormap,r=!!this.layer.rasterFunction?.hasClipFunction,s=i&&i.length>4*(e.maxTextureSize||4096);return t.canRenderInWebGL&&!s&&!r}get usedMemory(){return this._flowSubView?.usedMemory??0}get test(){}};e([l({readOnly:!0})],g.prototype,"_blankTile",null),e([l()],g.prototype,"_hasFlow",null),e([l({readOnly:!0})],g.prototype,"imageFormatIsOpaque",null),e([l({readOnly:!0})],g.prototype,"hasMixedImageFormats",null),e([l()],g.prototype,"_flowSubView",void 0),e([l({readOnly:!0})],g.prototype,"dataLevelRange",null),e([l({readOnly:!0})],g.prototype,"visibleAtCurrentScale",null),g=e([o("esri.views.3d.layers.ImageryTileLayerView3D")],g);const w=g;export{w as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{whenOnce as i}from"../../../core/reactiveUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerViewPerformanceInfo as l}from"./support/LayerViewPerformanceInfo.js";import{updatingProgress as s,updatingProgressValue as n}from"../support/updatingProperties.js";import{checkIfTileInfoSupportedForView as o}from"../terrain/terrainUtils.js";import{isScaleRangeActive as c,validateScaleRange as h}from"../../support/layerViewUtils.js";const p=p=>{const m=p;let u=class extends m{constructor(){super(...arguments),this.hasMixedImageFormats=!0}get imageFormatIsOpaque(){return!1}get fullExtent(){return this.layer.fullExtent}get isOpaque(){return this.fullOpacity>=1&&this.imageFormatIsOpaque}tilesVisibleAtCurrentScale(){const{minScale:e,maxScale:t}=this.layer;if(!c(e,t))return!0;const{basemapTerrain:i}=this.view,r=i.getLayerIndexByUID(1,this.uid);if(null==r)return!1;const{tilingScheme:a}=i,l=e&&a.levelAtScale(e),s=t&&a.levelAtScale(t);return i.renderer.visibleTiles.some(e=>!!e.layerInfo[1][r]&&(!l||e.level>=l)&&(!s||e.level<=s))}get visibleAtCurrentScale(){return this.tilesVisibleAtCurrentScale()}get dataScaleRange(){const e=this.tileInfo.lods;let t=e[0].scale,i=e[e.length-1].scale;if("tilemapCache"in this.layer&&this.layer.tilemapCache){const{effectiveMinLOD:e,effectiveMaxLOD:r}=this.layer.tilemapCache;t=this.tileInfo.lodAt(e).scale,i=this.tileInfo.lodAt(r).scale}return{minScale:t,maxScale:i}}canResume(){const e=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&!this.parent?.suspended&&this.view?.ready&&h(e)&&this.visibleAtCurrentTimeExtent||!1}get dataLevelRange(){const{minScale:e,maxScale:t}=this.dataScaleRange;return this.levelRangeFromScaleRange(e,t)}get fetchLevelRange(){return this.dataLevelRange}get displayLevelRange(){const e=this.layer.minScale||this.dataScaleRange.minScale,t=this.layer.maxScale||this.dataScaleRange.maxScale,i=this.levelRangeFromScaleRange(e,t);return this.layer.maxScale&&i.maxLevel++,i}get performanceInfo(){return new l(this.view.basemapTerrain.getUsedMemoryForLayerView(this))}getTileUrl(e){return this.layer.getTileUrl(e[0],e[1],e[2])}_addTilingSchemeMatchPromise(){if(null==this.fullExtent)return this.addResolvingPromise(Promise.reject(new t("tilingscheme:extent-not-defined","This layer doesn't define a fullExtent.")));const e=this._getTileInfoSupportError(this.tileInfo,this.fullExtent);if(e)return this.addResolvingPromise(Promise.reject(e));this.addResolvingPromise(i(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{const e=this.view.basemapTerrain.tilingScheme,t="tilemapCache"in this.layer?this.layer.tilemapCache?.effectiveMaxLOD:void 0,i=this._getTileInfoCompatibilityError(this.tileInfo,e,t);if(i)throw i}))}_getTileInfoSupportError(e,i){const r=o(e,i,this.view.spatialReference,this.view.state.viewingMode,"tilemapCache"in this.layer?this.layer.tilemapCache?.effectiveMaxLOD:void 0);if(!r)return;const a={layer:this.layer,error:r};switch(r.name){case"tilingscheme:spatial-reference-mismatch":case"tilingscheme:global-unsupported-spatial-reference":case"tilingscheme:local-unsupported-spatial-reference":return new t("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",a);default:return new t("layerview:tiling-scheme-unsupported","The tiling scheme of this layer is not supported by SceneView",a)}}_getTileInfoCompatibilityError(e,i,r){return null!=e&&i.compatibleWith(e,r)?null:new t("layerview:tiling-scheme-incompatible","The tiling scheme of this layer is incompatible with the tiling scheme of the surface")}levelRangeFromScaleRange(e,t){const i={minLevel:0,maxLevel:1/0},r=this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.tilingScheme;if(!r)return i;const a=r.levels[0],l=e=>{const t=Math.log(a.scale/e)/Math.LN2;return.5-Math.abs(.5-t%1)<1e-9?Math.round(t):Math.ceil(t)};return null!=e&&e>0&&(i.minLevel=Math.max(0,l(e))),null!=t&&t>0&&(i.maxLevel=Math.max(0,l(t))),i}isUpdating(){return!!(this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.updating)}};return e([r({readOnly:!0})],u.prototype,"imageFormatIsOpaque",null),e([r({readOnly:!0})],u.prototype,"updating",void 0),e([r(s)],u.prototype,"updatingProgress",void 0),e([r(n)],u.prototype,"updatingProgressValue",void 0),e([r()],u.prototype,"hasMixedImageFormats",void 0),e([r()],u.prototype,"fullExtent",null),e([r({readOnly:!0})],u.prototype,"isOpaque",null),e([r({readOnly:!0})],u.prototype,"visibleAtCurrentScale",null),e([r()],u.prototype,"dataScaleRange",null),e([r({readOnly:!0})],u.prototype,"dataLevelRange",null),e([r({readOnly:!0})],u.prototype,"fetchLevelRange",null),e([r({readOnly:!0})],u.prototype,"displayLevelRange",null),e([r()],u.prototype,"layer",void 0),u=e([a("esri.views.3d.layers.TiledLayerView3D")],u),u};export{p as TiledLayerView3D};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{whenOnce as i}from"../../../core/reactiveUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerViewPerformanceInfo as l}from"./support/LayerViewPerformanceInfo.js";import{updatingProgress as s,updatingProgressValue as n}from"../support/updatingProperties.js";import{checkIfTileInfoSupportedForView as o}from"../terrain/terrainUtils.js";import{isScaleRangeActive as c,validateScaleRange as h}from"../../support/layerViewUtils.js";const p=p=>{const m=p;let u=class extends m{constructor(){super(...arguments),this.hasMixedImageFormats=!0}get imageFormatIsOpaque(){return!1}get fullExtent(){return this.layer.fullExtent}get isOpaque(){return this.fullOpacity>=1&&this.imageFormatIsOpaque}tilesVisibleAtCurrentScale(){const{minScale:e,maxScale:t}=this.layer;if(!c(e,t))return!0;const{basemapTerrain:i}=this.view,r=i.getLayerIndexByUID(1,this.uid);if(null==r)return!1;const{tilingScheme:a}=i,l=e&&a.levelAtScale(e),s=t&&a.levelAtScale(t);return i.renderer.visibleTiles.some(e=>!!e.layerInfo[1][r]&&(!l||e.level>=l)&&(!s||e.level<=s))}get visibleAtCurrentScale(){return this.tilesVisibleAtCurrentScale()}get dataScaleRange(){const e=this.tileInfo.lods;let t=e[0].scale,i=e[e.length-1].scale;if("tilemapCache"in this.layer&&this.layer.tilemapCache){const{effectiveMinLOD:e,effectiveMaxLOD:r}=this.layer.tilemapCache;t=this.tileInfo.lodAt(e).scale,i=this.tileInfo.lodAt(r).scale}return{minScale:t,maxScale:i}}canResume(){const e=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&!this.parent?.suspended&&this.view?.ready&&h(e)&&this.visibleAtCurrentTimeExtent||!1}get dataLevelRange(){const{minScale:e,maxScale:t}=this.dataScaleRange;return this.levelRangeFromScaleRange(e,t)}get displayLevelRange(){const e=this.layer.minScale||this.dataScaleRange.minScale,t=this.layer.maxScale||this.dataScaleRange.maxScale,i=this.levelRangeFromScaleRange(e,t);return this.layer.maxScale&&i.maxLevel++,i}get performanceInfo(){return new l(this.view.basemapTerrain.getUsedMemoryForLayerView(this))}getTileUrl(e){return this.layer.getTileUrl(e[0],e[1],e[2])}_addTilingSchemeMatchPromise(){if(null==this.fullExtent)return this.addResolvingPromise(Promise.reject(new t("tilingscheme:extent-not-defined","This layer doesn't define a fullExtent.")));const e=this._getTileInfoSupportError(this.tileInfo,this.fullExtent);if(e)return this.addResolvingPromise(Promise.reject(e));this.addResolvingPromise(i(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{const e=this.view.basemapTerrain.tilingScheme,t="tilemapCache"in this.layer?this.layer.tilemapCache?.effectiveMaxLOD:void 0,i=this._getTileInfoCompatibilityError(this.tileInfo,e,t);if(i)throw i}))}_getTileInfoSupportError(e,i){const r=o(e,i,this.view.spatialReference,this.view.state.viewingMode,"tilemapCache"in this.layer?this.layer.tilemapCache?.effectiveMaxLOD:void 0);if(!r)return;const a={layer:this.layer,error:r};switch(r.name){case"tilingscheme:spatial-reference-mismatch":case"tilingscheme:global-unsupported-spatial-reference":case"tilingscheme:local-unsupported-spatial-reference":return new t("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",a);default:return new t("layerview:tiling-scheme-unsupported","The tiling scheme of this layer is not supported by SceneView",a)}}_getTileInfoCompatibilityError(e,i,r){return null!=e&&i.compatibleWith(e,r)?null:new t("layerview:tiling-scheme-incompatible","The tiling scheme of this layer is incompatible with the tiling scheme of the surface")}levelRangeFromScaleRange(e,t){const i={minLevel:0,maxLevel:1/0},r=this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.tilingScheme;if(!r)return i;const a=r.levels[0],l=e=>{const t=Math.log(a.scale/e)/Math.LN2;return.5-Math.abs(.5-t%1)<1e-9?Math.round(t):Math.ceil(t)};return null!=e&&e>0&&(i.minLevel=Math.max(0,l(e))),null!=t&&t>0&&(i.maxLevel=Math.max(0,l(t))),i}isUpdating(){return!!(this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.updating)}};return e([r({readOnly:!0})],u.prototype,"imageFormatIsOpaque",null),e([r({readOnly:!0})],u.prototype,"updating",void 0),e([r(s)],u.prototype,"updatingProgress",void 0),e([r(n)],u.prototype,"updatingProgressValue",void 0),e([r()],u.prototype,"hasMixedImageFormats",void 0),e([r()],u.prototype,"fullExtent",null),e([r({readOnly:!0})],u.prototype,"isOpaque",null),e([r({readOnly:!0})],u.prototype,"visibleAtCurrentScale",null),e([r()],u.prototype,"dataScaleRange",null),e([r({readOnly:!0})],u.prototype,"dataLevelRange",null),e([r({readOnly:!0})],u.prototype,"displayLevelRange",null),e([r()],u.prototype,"layer",void 0),u=e([a("esri.views.3d.layers.TiledLayerView3D")],u),u};export{p as TiledLayerView3D};