@arcgis/core 6.0.0-next.58 → 6.0.0-next.59

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 (73) hide show
  1. package/Graphic.d.ts +1 -0
  2. package/applications/SceneViewer/sceneViewerUtils.d.ts +74 -0
  3. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  4. package/arcgisGlobal.d.ts +2 -0
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/{5e4de4ddd3bdc74100e0.js → 75667b1427a7f02f2cda.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{b4018b21a03c0c909d23.js → 75a48b122254deb3ad59.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{690041373d03d02a3044.js → 956810d6f553c2198aae.js} +1 -1
  9. package/assets/esri/core/workers/chunks/a27c2edd7e043643cdd1.js +1 -0
  10. package/assets/esri/core/workers/chunks/bd8ee0205f0a01d6d4d7.js +1 -0
  11. package/assets/esri/core/workers/chunks/{423c7a981b9a06b76cbd.js → d833fc1fe63c9917ae3e.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{32d5aae2e0953420216a.js → dca6abf260c0bfb7c9c0.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{fc8cb947a677aa12348d.js → e38ffdb19132529beda7.js} +1 -1
  14. package/chunks/BlurEmission.glsl.js +6 -6
  15. package/chunks/EmissionComposite.glsl.js +2 -2
  16. package/chunks/Fog.glsl.js +4 -4
  17. package/chunks/RibbonLine.glsl.js +154 -108
  18. package/config.js +1 -1
  19. package/core/urlUtils.js +1 -1
  20. package/interfaces.d.ts +8 -0
  21. package/kernel.js +1 -1
  22. package/layers/graphics/sources/CSVSource.js +1 -1
  23. package/layers/graphics/sources/GeoJSONSource.js +1 -1
  24. package/layers/raster/formats/tiffParser.js +1 -1
  25. package/package.json +2 -2
  26. package/popup/FeatureModel.js +1 -1
  27. package/popup/FeaturesModel.js +1 -1
  28. package/rest/support/AttributeBinsQuery.d.ts +41 -1
  29. package/rest/support/AttributeBinsQuery.js +1 -1
  30. package/rest/support/Query.d.ts +1 -2
  31. package/rest/versionManagement/gdbVersion/post.js +1 -1
  32. package/rest/versionManagement/gdbVersion/reconcile.js +1 -1
  33. package/rest/versionManagement/gdbVersion/serverVersionUtils.js +1 -1
  34. package/rest/versionManagement/gdbVersion/support/PostResult.d.ts +1 -1
  35. package/rest/versionManagement/gdbVersion/support/ReconcileResult.d.ts +1 -1
  36. package/smartMapping/statistics/histogram.js +1 -1
  37. package/smartMapping/statistics/types.d.ts +18 -0
  38. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  39. package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
  40. package/symbols/LineSymbol3DLayer.js +1 -1
  41. package/tables/support/templateUtils.js +1 -1
  42. package/versionManagement/VersionManagementService.d.ts +47 -1
  43. package/versionManagement/VersionManagementService.js +1 -1
  44. package/versionManagement/support/PostJobInfo.d.ts +61 -0
  45. package/versionManagement/support/PostJobInfo.js +2 -0
  46. package/versionManagement/support/ReconcileJobInfo.d.ts +61 -0
  47. package/versionManagement/support/ReconcileJobInfo.js +2 -0
  48. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  49. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  50. package/views/3d/terrain/OverlayRenderer.js +1 -1
  51. package/views/3d/terrain/PatchGeometry.js +1 -1
  52. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  53. package/views/3d/terrain/TerrainRenderer.js +1 -1
  54. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
  55. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +21 -12
  56. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  57. package/views/3d/webgl-engine/effects/fog/Fog.glsl.js +1 -1
  58. package/views/3d/webgl-engine/effects/glow/BlurEmission.glsl.js +1 -1
  59. package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +20 -15
  60. package/views/3d/webgl-engine/lib/EmissionComposite.glsl.js +1 -1
  61. package/views/3d/webgl-engine/lib/TriangleRangeBVH.js +1 -1
  62. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  63. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  64. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  65. package/views/Attribution.js +2 -2
  66. package/views/DOMContainer.d.ts +3 -2
  67. package/views/DOMContainer.js +1 -1
  68. package/views/SceneView.js +1 -1
  69. package/views/View.d.ts +2 -2
  70. package/views/View.js +1 -1
  71. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  72. package/assets/esri/core/workers/chunks/294097140e349e073b7e.js +0 -1
  73. package/assets/esri/core/workers/chunks/6a202ef9ba9b89e09153.js +0 -1
package/core/urlUtils.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../config.js";import{parseKnownArcGISOnlineDomain as t}from"../portal/support/urlUtils.js";import{base64ToArrayBuffer as n,arrayBufferToBase64 as r}from"../support/base64Utils.js";import{isSome as i}from"./arrayUtils.js";import a from"./Error.js";import o from"./Logger.js";import{isSerializable as s}from"./support/jsonUtils.js";const c=()=>o.getLogger(`esri.core.urlUtils`),l=e.request,u=`esri/config: esriConfig.request.proxyUrl is not set.`,d=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,p=/^\s*https:/i,ee=/^\s*file:/i,m=/:\d+$/,te=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,ne=RegExp(`^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$`),re=RegExp(`^((([^[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^[:]*))(:([0-9]+))?$`);class h{constructor(e=``){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=this.uri.match(ne);this.scheme=t[2]||(t[1]?``:null),this.authority=t[4]||(t[3]?``:null),this.path=t[5],this.query=t[7]||(t[6]?``:null),this.fragment=t[9]||(t[8]?``:null),this.authority!=null&&(t=this.authority.match(re),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const g={},_=new h(e.applicationUrl);let v=_;const y=oe();let b=y;const ie=()=>v,ae=()=>b;function oe(){let e=v.path,t=e.slice(0,e.lastIndexOf(`/`)+1);return`${v.scheme}://${v.host}${v.port==null?``:`:${v.port}`}${t}`}const se={setAppUrl:e=>v=e,setAppBaseUrl:e=>b=e,restoreUrls:()=>{v=_,b=y}};function x(e){if(!e)return null;let t={path:null,query:null},n=new h(e),r=e.indexOf(`?`);return n.query===null?t.path=e:(t.path=e.slice(0,r),t.query=S(n.query)),n.fragment&&(t.hash=n.fragment,n.query===null&&(t.path=t.path.slice(0,t.path.length-(n.fragment.length+1)))),t}function S(e){let t=e.split(`&`),n={};for(let e of t){if(!e)continue;let t=e.indexOf(`=`),r,i;t<0?(r=decodeURIComponent(e),i=``):(r=decodeURIComponent(e.slice(0,t)),i=decodeURIComponent(e.slice(t+1)));let a=n[r];typeof a==`string`&&(a=n[r]=[a]),Array.isArray(a)?a.push(i):n[r]=i}return n}function C(e,t){return e?t&&typeof t==`function`?Object.keys(e).map(n=>encodeURIComponent(n)+`=`+encodeURIComponent(t(n,e[n]))).join(`&`):Object.keys(e).map(n=>{let r=e[n];if(r==null)return``;let i=encodeURIComponent(n)+`=`,a=t?.[n];return a?i+encodeURIComponent(a(r)):Array.isArray(r)?r.map(e=>s(e)?i+encodeURIComponent(JSON.stringify(e)):i+encodeURIComponent(e)).join(`&`):s(r)?i+encodeURIComponent(JSON.stringify(r)):i+encodeURIComponent(r)}).filter(e=>e).join(`&`):``}function w(e=!1){let t,n=l.proxyUrl;if(typeof e==`string`){t=K(e);let r=O(e);r&&(n=r.proxyUrl)}else t=!!e;if(!n)throw c().warn(u),new a(`urlUtils:proxy-not-set`,u);return t&&Y()&&(n=J(n)),x(n)}function ce(e,t=!1){let n=O(e),r,i;if(n){let e=E(n.proxyUrl);r=e.path,i=e.query?S(e.query):null}else if(t){let t=w(e);r=t.path,i=t.query}if(r){let t=x(e);e=r+`?`+t.path;let n=C({...i,...t.query});n&&(e=`${e}?${n}`)}return e}const T={path:``,query:``};function E(e){let t=e.indexOf(`?`);return t===-1?(T.path=e,T.query=null):(T.path=e.slice(0,t),T.query=e.slice(t+1)),T}function D(e){return e=E(e).path,e=Z(e),e=X(e,!0),e=e.toLowerCase()}function le(e){let t={proxyUrl:e.proxyUrl,urlPrefix:D(e.urlPrefix)},n=l.proxyRules,r=t.urlPrefix,i=n.length;for(let e=0;e<n.length;e++){let t=n[e].urlPrefix;if(r.startsWith(t)){if(r.length===t.length)return-1;i=e;break}t.startsWith(r)&&(i=e+1)}return n.splice(i,0,t),i}function O(e){let t=l.proxyRules,n=D(e);for(let e=0;e<t.length;e++)if(n.startsWith(t[e].urlPrefix))return t[e]}function k(e,n){if(!e||!n)return!1;e=A(e),n=A(n);let r=t(e),i=t(n);return r!=null&&i!=null?r.portalHostname===i.portalHostname:r!=null||i!=null?!1:M(e,n,!0)}function ue(e,n){if(!e||!n)return!1;e=A(e),n=A(n);let r=t(e),i=t(n);return r!=null&&i!=null&&r.portalHostname===i.portalHostname}function de(e,t){return e=A(e),t=A(t),X(e)===X(t)}function A(e){e=P(e);let t=e.indexOf(`/sharing`);return t>0?e.slice(0,t):e.replace(/\/+$/,``)}function j(e,t=l.interceptors){let n=t=>t instanceof RegExp?t.test(e):typeof t==`string`?e.startsWith(t):t==null;if(t){for(let e of t)if(Array.isArray(e.urls)){if(e.urls.some(n))return e}else if(n(e.urls))return e}return null}function M(e,t,n=!1){if(!e||!t)return!1;let r=Q(e),i=Q(t);return!n&&r.scheme!==i.scheme||r.host==null||i.host==null?!1:r.host.toLowerCase()===i.host.toLowerCase()&&r.port===i.port}function fe(e){if(typeof e==`string`){if(L(e))e=Q(e);else return!0}if(M(e,v))return!0;let t=l.trustedServers||[];for(let n=0;n<t.length;n++){let r=pe(t[n]);for(let t=0;t<r.length;t++)if(M(e,r[t]))return!0}return!1}function pe(e){return g[e]||(!G(e)&&!W(e)?g[e]=[new h(`http://${e}`),new h(`https://${e}`)]:g[e]=[new h(N(e))]),g[e]}function N(e,t=b,n){return W(e)?n?.preserveProtocolRelative?e:v.scheme===`http`&&v.authority===I(e).slice(2)?`http:${e}`:`https:${e}`:G(e)?e:F(e.startsWith(`/`)?Te(t):t,e)}function me(e,t=b,n){if(e==null||!L(e))return e;let r=P(e),i=r.toLowerCase(),a=P(t).toLowerCase().replace(/\/+$/,``),o=n?P(n).toLowerCase().replace(/\/+$/,``):null;if(o&&!a.startsWith(o))return e;let s=(e,t,n)=>(n=e.indexOf(t,n),n===-1?e.length:n),c=s(i,`/`,i.indexOf(`//`)+2),l=-1;for(;i.slice(0,c+1)===a.slice(0,c)+`/`&&(l=c+1,c!==i.length);)c=s(i,`/`,c+1);if(l===-1||o&&l<o.length)return e;e=r.slice(l);let u=a.slice(l-1).replaceAll(/[^/]+/g,``).length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function P(e){return e=e.trim(),e=N(e),e=ke(e),e=Ae(e),e=je(e)}function F(...e){let t=e.filter(i);if(!t?.length)return;let n=[];if(L(t[0])){let e=t[0],r=e.indexOf(`//`);r!==-1&&(n.push(e.slice(0,r+1)),q(t[0])&&(n[0]+=`/`),t[0]=e.slice(r+2))}else t[0].startsWith(`/`)&&n.push(``);let r=t.reduce((e,t)=>t?e.concat(t.split(`/`)):e,[]);for(let e=0;e<r.length;e++){let t=r[e];t===`..`&&n.length>0&&n[n.length-1]!==`..`?n.pop():(!t&&e===r.length-1||t&&(t!==`.`||n.length===0))&&n.push(t)}return n.join(`/`)}function I(e,t=!1){if(e==null||R(e)||z(e))return null;let n=e.indexOf(`://`);if(n===-1&&W(e))n=2;else if(n!==-1)n+=3;else return null;let r=e.indexOf(`/`,n);return r!==-1&&(e=e.slice(0,r)),t&&(e=X(e,!0)),e}function L(e){return W(e)||G(e)}function R(e){return e!=null&&e.startsWith(`blob:`)}function z(e){return e!=null&&e.startsWith(`data:`)}function B(e){let t=V(e);return t?.isBase64?n(t.data):null}function he(e){return r(e).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/,``)}const ge=/^data:(.*?)(;base64)?,(.*)$/;function V(e){let t=e.match(ge);if(!t)return null;let[,n,r,i]=t;return{mediaType:n,isBase64:!!r,data:i}}function _e(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}async function ve(e){return(await fetch(e)).blob()}function H(e){let t=B(e);if(!t)return null;let n=V(e);return new Blob([t],{type:n.mediaType})}function ye(e,t){xe(e,t)}function be(e,t){U(e,t)}function xe(e,t){let n=H(e);return n?U(n,t):!1}function U(e,t){if(!e)return!1;let n=document.createElement(`a`);if(!(`download`in n))return!1;let r=URL.createObjectURL(e);return n.download=t,n.href=r,n.style.display=`none`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r),!0}function W(e){return e!=null&&e.startsWith(`/`)&&e[1]===`/`}function G(e){return e!=null&&d.test(e)}function K(e){return e!=null&&p.test(e)||v.scheme===`https`&&W(e)}function Se(e){return e!=null&&f.test(e)||v.scheme===`http`&&W(e)}function q(e){return e!=null&&ee.test(e)}function Ce(e){return W(e)?`http:${e}`:e.replace(p,`http:`)}function J(e){return W(e)?`https:${e}`:e.replace(f,`https:`)}function we(){return v.scheme===`http`}function Y(){return v.scheme===`https`}function X(e,t=!1){return W(e)?e.slice(2):(e=e.replace(d,``),t&&e.length>1&&e.startsWith(`/`)&&e[1]===`/`&&(e=e.slice(2)),e)}function Te(e){let t=e.indexOf(`//`),n=e.indexOf(`/`,t+2);return n===-1?e:e.slice(0,n)}function Ee(e){let t=0;if(L(e)){let n=e.indexOf(`//`);n!==-1&&(t=n+2)}let n=e.lastIndexOf(`/`);return n<t?e:e.slice(0,n+1)}function De(e,t){if(!e)return``;let n=x(e).path.replace(/\/+$/,``),r=n.slice(n.lastIndexOf(`/`)+1);if(!t?.length)return r;let i=RegExp(`\\.(${t.join(`|`)})$`,`i`);return r.replace(i,``)}function Z(e){return e.endsWith(`/`)?e:`${e}/`}function Oe(e){return e.replace(/\/+$/,``)}function ke(e){if(/^https?:\/\//i.test(e)){let t=E(e);e=t.path.replaceAll(/\/{2,}/g,`/`),e=e.replace(`/`,`//`),t.query&&(e+=`?${t.query}`)}return e}function Ae(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,`$1www.$2`)}function je(e){let t=l.httpsDomains;if(!Se(e))return e;let n=e.indexOf(`/`,7),r;if(r=n===-1?e:e.slice(0,n),r=r.toLowerCase().slice(7),m.test(r)){if(r.endsWith(`:80`))r=r.slice(0,-3),e=e.replace(`:80`,``);else return e}return we()&&r===v.authority&&!te.test(e)||(Y()&&r===v.authority||t&&t.some(e=>r===e||r.endsWith(`.${e}`))||Y()&&!O(e))&&(e=J(e)),e}function Me(e,t,n){if(!t||!n||!e||!L(e))return e;let r=e.indexOf(`//`),i=e.indexOf(`/`,r+2),a=e.indexOf(`:`,r+2),o=Math.min(i<0?e.length:i,a<0?e.length:a);return e.slice(r+2,o).toLowerCase()===t.toLowerCase()?`${e.slice(0,r+2)}${n}${e.slice(o)}`:e}function Ne(e,t){let n=new URL(e);return n.host=t,n.port&&!m.test(t)&&(n.port=``),n.href}function Pe(e){return new URL(e).host}function Q(e){return typeof e==`string`?new h(N(e)):(e.scheme||=v.scheme,e)}function Fe(e){return Ue.test(e)}function Ie(e,t){let n=x(e),r=Object.keys(n.query||{});return r.length>0&&t&&t.warn(`removeQueryParameters()`,`Url query parameters are not supported, the following parameters have been removed: ${r.join(`, `)}.`),n.path}function Le(e,t,n){let r=x(e),i=r.query||{};return i[t]=String(n),`${r.path}?${C(i)}`}function Re(e,t){if(!t)return e;let n=x(e),r=n.query||{};for(let[e,n]of Object.entries(t))n!=null&&(r[e]=n);let i=C(r);return i?`${n.path}?${i}`:n.path}function ze(e,t){let{path:n,query:r}=x(e);if(!r)return e;delete r[t];let i=C(r);return i?`${n}?${i}`:n}function Be(e){if(e==null)return null;let t=e.match($);return t?t[2]:null}function Ve(e){if(e==null)return null;let t=e.match($);return t?{path:t[1],extension:t[2]}:{path:e,extension:null}}async function He(e){return typeof e==`string`?V(e)??{data:e}:new Promise((t,n)=>{let r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(V(r.result)),r.onerror=e=>n(e)})}const $=/([^.]*)\.([^/]*)$/,Ue=/(^data:image\/svg|\.svg$)/i;export{h as Url,ce as addProxy,le as addProxyRule,Le as addQueryParameter,Re as addQueryParameters,he as base64UrlEncode,ve as blobUrlToBlob,Me as changeDomain,Ne as changeHost,V as dataComponents,B as dataToArrayBuffer,H as dataToBlob,be as downloadBlobAsFile,ye as downloadDataAsFile,Z as ensureTrailingSlash,ae as getAppBaseUrl,ie as getAppUrl,De as getFilename,Pe as getHost,j as getInterceptor,I as getOrigin,Be as getPathExtension,O as getProxyRule,w as getProxyUrl,G as hasProtocol,ue as hasSameCanonicalArcGISOnlinePortal,k as hasSameCanonicalPortal,M as hasSameOrigin,de as hasSamePortal,L as isAbsolute,Y as isAppHTTPS,R as isBlobProtocol,z as isDataProtocol,K as isHTTPSProtocol,W as isProtocolRelative,Fe as isSVG,fe as isTrustedServer,F as join,N as makeAbsolute,_e as makeData,me as makeRelative,P as normalize,C as objectToQuery,He as parseData,S as queryToObject,Ee as removeFile,ze as removeQueryParameter,Ie as removeQueryParameters,Oe as removeTrailingSlash,Ve as splitPathExtension,se as test,Ce as toHTTP,J as toHTTPS,g as trustedServersUrlCache,x as urlToObject};
2
+ import e from"../config.js";import{parseKnownArcGISOnlineDomain as t}from"../portal/support/urlUtils.js";import{base64ToArrayBuffer as n,arrayBufferToBase64 as r}from"../support/base64Utils.js";import{isSome as i}from"./arrayUtils.js";import a from"./Error.js";import o from"./Logger.js";import{isSerializable as s}from"./support/jsonUtils.js";const c=()=>o.getLogger(`esri.core.urlUtils`),l=e.request,u=`esri/config: esriConfig.request.proxyUrl is not set.`,d=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,p=/^\s*https:/i,ee=/^\s*file:/i,m=/:\d+$/,h=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,te=RegExp(`^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$`),ne=RegExp(`^((([^[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^[:]*))(:([0-9]+))?$`);class g{constructor(e=``){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=this.uri.match(te);this.scheme=t[2]||(t[1]?``:null),this.authority=t[4]||(t[3]?``:null),this.path=t[5],this.query=t[7]||(t[6]?``:null),this.fragment=t[9]||(t[8]?``:null),this.authority!=null&&(t=this.authority.match(ne),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const _={},v=new g(e.applicationUrl);let y=v;const b=ie();let x=b;const S=()=>y,re=()=>x;function ie(){let e=y.path,t=e.slice(0,e.lastIndexOf(`/`)+1);return`${y.scheme}://${y.host}${y.port==null?``:`:${y.port}`}${t}`}const ae={setAppUrl:e=>y=e,setAppBaseUrl:e=>x=e,restoreUrls:()=>{y=v,x=b}};function C(e){if(!e)return null;let t={path:null,query:null},n=new g(e),r=e.indexOf(`?`);return n.query===null?t.path=e:(t.path=e.slice(0,r),t.query=w(n.query)),n.fragment&&(t.hash=n.fragment,n.query===null&&(t.path=t.path.slice(0,t.path.length-(n.fragment.length+1)))),t}function w(e){let t=e.split(`&`),n={};for(let e of t){if(!e)continue;let t=e.indexOf(`=`),r,i;t<0?(r=decodeURIComponent(e),i=``):(r=decodeURIComponent(e.slice(0,t)),i=decodeURIComponent(e.slice(t+1)));let a=n[r];typeof a==`string`&&(a=n[r]=[a]),Array.isArray(a)?a.push(i):n[r]=i}return n}function oe(e){return e instanceof URLSearchParams?w(e.toString().replaceAll(`+`,` `)):e}function T(e,t){return e?t&&typeof t==`function`?Object.keys(e).map(n=>encodeURIComponent(n)+`=`+encodeURIComponent(t(n,e[n]))).join(`&`):Object.keys(e).map(n=>{let r=e[n];if(r==null)return``;let i=encodeURIComponent(n)+`=`,a=t?.[n];return a?i+encodeURIComponent(a(r)):Array.isArray(r)?r.map(e=>s(e)?i+encodeURIComponent(JSON.stringify(e)):i+encodeURIComponent(e)).join(`&`):s(r)?i+encodeURIComponent(JSON.stringify(r)):i+encodeURIComponent(r)}).filter(e=>e).join(`&`):``}function E(e=!1){let t,n=l.proxyUrl;if(typeof e==`string`){t=q(e);let r=A(e);r&&(n=r.proxyUrl)}else t=!!e;if(!n)throw c().warn(u),new a(`urlUtils:proxy-not-set`,u);return t&&Y()&&(n=J(n)),C(n)}function se(e,t=!1){let n=A(e),r,i;if(n){let e=O(n.proxyUrl);r=e.path,i=e.query?w(e.query):null}else if(t){let t=E(e);r=t.path,i=t.query}if(r){let t=C(e);e=r+`?`+t.path;let n=T({...i,...t.query});n&&(e=`${e}?${n}`)}return e}const D={path:``,query:``};function O(e){let t=e.indexOf(`?`);return t===-1?(D.path=e,D.query=null):(D.path=e.slice(0,t),D.query=e.slice(t+1)),D}function k(e){return e=O(e).path,e=Z(e),e=X(e,!0),e=e.toLowerCase()}function ce(e){let t={proxyUrl:e.proxyUrl,urlPrefix:k(e.urlPrefix)},n=l.proxyRules,r=t.urlPrefix,i=n.length;for(let e=0;e<n.length;e++){let t=n[e].urlPrefix;if(r.startsWith(t)){if(r.length===t.length)return-1;i=e;break}t.startsWith(r)&&(i=e+1)}return n.splice(i,0,t),i}function A(e){let t=l.proxyRules,n=k(e);for(let e=0;e<t.length;e++)if(n.startsWith(t[e].urlPrefix))return t[e]}function le(e,n){if(!e||!n)return!1;e=j(e),n=j(n);let r=t(e),i=t(n);return r!=null&&i!=null?r.portalHostname===i.portalHostname:r!=null||i!=null?!1:N(e,n,!0)}function ue(e,n){if(!e||!n)return!1;e=j(e),n=j(n);let r=t(e),i=t(n);return r!=null&&i!=null&&r.portalHostname===i.portalHostname}function de(e,t){return e=j(e),t=j(t),X(e)===X(t)}function j(e){e=F(e);let t=e.indexOf(`/sharing`);return t>0?e.slice(0,t):e.replace(/\/+$/,``)}function M(e,t=l.interceptors){let n=t=>t instanceof RegExp?t.test(e):typeof t==`string`?e.startsWith(t):t==null;if(t){for(let e of t)if(Array.isArray(e.urls)){if(e.urls.some(n))return e}else if(n(e.urls))return e}return null}function N(e,t,n=!1){if(!e||!t)return!1;let r=Q(e),i=Q(t);return!n&&r.scheme!==i.scheme||r.host==null||i.host==null?!1:r.host.toLowerCase()===i.host.toLowerCase()&&r.port===i.port}function fe(e){if(typeof e==`string`){if(R(e))e=Q(e);else return!0}if(N(e,y))return!0;let t=l.trustedServers||[];for(let n=0;n<t.length;n++){let r=pe(t[n]);for(let t=0;t<r.length;t++)if(N(e,r[t]))return!0}return!1}function pe(e){return _[e]||(!K(e)&&!G(e)?_[e]=[new g(`http://${e}`),new g(`https://${e}`)]:_[e]=[new g(P(e))]),_[e]}function P(e,t=x,n){return G(e)?n?.preserveProtocolRelative?e:y.scheme===`http`&&y.authority===L(e).slice(2)?`http:${e}`:`https:${e}`:K(e)?e:I(e.startsWith(`/`)?Ee(t):t,e)}function me(e,t=x,n){if(e==null||!R(e))return e;let r=F(e),i=r.toLowerCase(),a=F(t).toLowerCase().replace(/\/+$/,``),o=n?F(n).toLowerCase().replace(/\/+$/,``):null;if(o&&!a.startsWith(o))return e;let s=(e,t,n)=>(n=e.indexOf(t,n),n===-1?e.length:n),c=s(i,`/`,i.indexOf(`//`)+2),l=-1;for(;i.slice(0,c+1)===a.slice(0,c)+`/`&&(l=c+1,c!==i.length);)c=s(i,`/`,c+1);if(l===-1||o&&l<o.length)return e;e=r.slice(l);let u=a.slice(l-1).replaceAll(/[^/]+/g,``).length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function F(e){return e=e.trim(),e=P(e),e=Ae(e),e=je(e),e=Me(e)}function I(...e){let t=e.filter(i);if(!t?.length)return;let n=[];if(R(t[0])){let e=t[0],r=e.indexOf(`//`);r!==-1&&(n.push(e.slice(0,r+1)),Ce(t[0])&&(n[0]+=`/`),t[0]=e.slice(r+2))}else t[0].startsWith(`/`)&&n.push(``);let r=t.reduce((e,t)=>t?e.concat(t.split(`/`)):e,[]);for(let e=0;e<r.length;e++){let t=r[e];t===`..`&&n.length>0&&n[n.length-1]!==`..`?n.pop():(!t&&e===r.length-1||t&&(t!==`.`||n.length===0))&&n.push(t)}return n.join(`/`)}function L(e,t=!1){if(e==null||z(e)||B(e))return null;let n=e.indexOf(`://`);if(n===-1&&G(e))n=2;else if(n!==-1)n+=3;else return null;let r=e.indexOf(`/`,n);return r!==-1&&(e=e.slice(0,r)),t&&(e=X(e,!0)),e}function R(e){return G(e)||K(e)}function z(e){return e!=null&&e.startsWith(`blob:`)}function B(e){return e!=null&&e.startsWith(`data:`)}function V(e){let t=H(e);return t?.isBase64?n(t.data):null}function he(e){return r(e).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/,``)}const ge=/^data:(.*?)(;base64)?,(.*)$/;function H(e){let t=e.match(ge);if(!t)return null;let[,n,r,i]=t;return{mediaType:n,isBase64:!!r,data:i}}function _e(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}async function ve(e){return(await fetch(e)).blob()}function U(e){let t=V(e);if(!t)return null;let n=H(e);return new Blob([t],{type:n.mediaType})}function ye(e,t){xe(e,t)}function be(e,t){W(e,t)}function xe(e,t){let n=U(e);return n?W(n,t):!1}function W(e,t){if(!e)return!1;let n=document.createElement(`a`);if(!(`download`in n))return!1;let r=URL.createObjectURL(e);return n.download=t,n.href=r,n.style.display=`none`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r),!0}function G(e){return e!=null&&e.startsWith(`/`)&&e[1]===`/`}function K(e){return e!=null&&d.test(e)}function q(e){return e!=null&&p.test(e)||y.scheme===`https`&&G(e)}function Se(e){return e!=null&&f.test(e)||y.scheme===`http`&&G(e)}function Ce(e){return e!=null&&ee.test(e)}function we(e){return G(e)?`http:${e}`:e.replace(p,`http:`)}function J(e){return G(e)?`https:${e}`:e.replace(f,`https:`)}function Te(){return y.scheme===`http`}function Y(){return y.scheme===`https`}function X(e,t=!1){return G(e)?e.slice(2):(e=e.replace(d,``),t&&e.length>1&&e.startsWith(`/`)&&e[1]===`/`&&(e=e.slice(2)),e)}function Ee(e){let t=e.indexOf(`//`),n=e.indexOf(`/`,t+2);return n===-1?e:e.slice(0,n)}function De(e){let t=0;if(R(e)){let n=e.indexOf(`//`);n!==-1&&(t=n+2)}let n=e.lastIndexOf(`/`);return n<t?e:e.slice(0,n+1)}function Oe(e,t){if(!e)return``;let n=C(e).path.replace(/\/+$/,``),r=n.slice(n.lastIndexOf(`/`)+1);if(!t?.length)return r;let i=RegExp(`\\.(${t.join(`|`)})$`,`i`);return r.replace(i,``)}function Z(e){return e.endsWith(`/`)?e:`${e}/`}function ke(e){return e.replace(/\/+$/,``)}function Ae(e){if(/^https?:\/\//i.test(e)){let t=O(e);e=t.path.replaceAll(/\/{2,}/g,`/`),e=e.replace(`/`,`//`),t.query&&(e+=`?${t.query}`)}return e}function je(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,`$1www.$2`)}function Me(e){let t=l.httpsDomains;if(!Se(e))return e;let n=e.indexOf(`/`,7),r;if(r=n===-1?e:e.slice(0,n),r=r.toLowerCase().slice(7),m.test(r)){if(r.endsWith(`:80`))r=r.slice(0,-3),e=e.replace(`:80`,``);else return e}return Te()&&r===y.authority&&!h.test(e)||(Y()&&r===y.authority||t&&t.some(e=>r===e||r.endsWith(`.${e}`))||Y()&&!A(e))&&(e=J(e)),e}function Ne(e,t,n){if(!t||!n||!e||!R(e))return e;let r=e.indexOf(`//`),i=e.indexOf(`/`,r+2),a=e.indexOf(`:`,r+2),o=Math.min(i<0?e.length:i,a<0?e.length:a);return e.slice(r+2,o).toLowerCase()===t.toLowerCase()?`${e.slice(0,r+2)}${n}${e.slice(o)}`:e}function Pe(e,t){let n=new URL(e);return n.host=t,n.port&&!m.test(t)&&(n.port=``),n.href}function Fe(e){return new URL(e).host}function Q(e){return typeof e==`string`?new g(P(e)):(e.scheme||=y.scheme,e)}function Ie(e){return We.test(e)}function Le(e,t){let n=C(e),r=Object.keys(n.query||{});return r.length>0&&t&&t.warn(`removeQueryParameters()`,`Url query parameters are not supported, the following parameters have been removed: ${r.join(`, `)}.`),n.path}function Re(e,t,n){let r=C(e),i=r.query||{};return i[t]=String(n),`${r.path}?${T(i)}`}function ze(e,t){if(!t)return e;let n=C(e),r=n.query||{};for(let[e,n]of Object.entries(t))n!=null&&(r[e]=n);let i=T(r);return i?`${n.path}?${i}`:n.path}function Be(e,t){let{path:n,query:r}=C(e);if(!r)return e;delete r[t];let i=T(r);return i?`${n}?${i}`:n}function Ve(e){if(e==null)return null;let t=e.match($);return t?t[2]:null}function He(e){if(e==null)return null;let t=e.match($);return t?{path:t[1],extension:t[2]}:{path:e,extension:null}}async function Ue(e){return typeof e==`string`?H(e)??{data:e}:new Promise((t,n)=>{let r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(H(r.result)),r.onerror=e=>n(e)})}const $=/([^.]*)\.([^/]*)$/,We=/(^data:image\/svg|\.svg$)/i;export{g as Url,se as addProxy,ce as addProxyRule,Re as addQueryParameter,ze as addQueryParameters,he as base64UrlEncode,ve as blobUrlToBlob,Ne as changeDomain,Pe as changeHost,H as dataComponents,V as dataToArrayBuffer,U as dataToBlob,be as downloadBlobAsFile,ye as downloadDataAsFile,Z as ensureTrailingSlash,re as getAppBaseUrl,S as getAppUrl,Oe as getFilename,Fe as getHost,M as getInterceptor,L as getOrigin,Ve as getPathExtension,A as getProxyRule,E as getProxyUrl,K as hasProtocol,ue as hasSameCanonicalArcGISOnlinePortal,le as hasSameCanonicalPortal,N as hasSameOrigin,de as hasSamePortal,R as isAbsolute,Y as isAppHTTPS,z as isBlobProtocol,B as isDataProtocol,q as isHTTPSProtocol,G as isProtocolRelative,Ie as isSVG,fe as isTrustedServer,I as join,P as makeAbsolute,_e as makeData,me as makeRelative,F as normalize,oe as normalizeQueryParams,T as objectToQuery,Ue as parseData,w as queryToObject,De as removeFile,Be as removeQueryParameter,Le as removeQueryParameters,ke as removeTrailingSlash,He as splitPathExtension,ae as test,we as toHTTP,J as toHTTPS,_ as trustedServersUrlCache,C as urlToObject};
package/interfaces.d.ts CHANGED
@@ -11122,6 +11122,14 @@ declare namespace __esri {
11122
11122
 
11123
11123
  export const versionManagementUtils: versionManagementUtils;
11124
11124
 
11125
+ /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
11126
+ export type PostJobInfo = import("./versionManagement/support/PostJobInfo.js").default;
11127
+ export const PostJobInfo: typeof import("./versionManagement/support/PostJobInfo.js").default;
11128
+
11129
+ /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
11130
+ export type ReconcileJobInfo = import("./versionManagement/support/ReconcileJobInfo.js").default;
11131
+ export const ReconcileJobInfo: typeof import("./versionManagement/support/ReconcileJobInfo.js").default;
11132
+
11125
11133
  /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
11126
11134
  export type VersionIdentifier = import("./versionManagement/support/jsonTypes.js").VersionIdentifier;
11127
11135
  /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`6.0`;let n=`6.0`;n=`6.0.0-next.58`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}});export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
2
+ import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`6.0`;let n=`6.0`;n=`6.0.0-next.59`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}});export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{Loadable as r}from"../../../core/Loadable.js";import{debounce as i}from"../../../core/promiseUtils.js";import{open as a}from"../../../core/workers.js";import o from"../../../geometry/Extent.js";import s from"../../../rest/support/FeatureSet.js";import{applyTimeExtentToQuery as c}from"./support/timeQueryUtils.js";let l=class extends r{constructor(e){super(e),this.type=`csv`,this.refresh=i(async e=>{await this.load();let{extent:t,timeExtent:n}=await this._connection.invoke(`refresh`,e);return t&&(this.sourceJSON.extent=t),n&&(this.sourceJSON.timeInfo.timeExtent=[n.start,n.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){await this.load(t);let n=c(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryFeatures`,n.toJSON(),t);return s.fromJSON(r)}async queryFeaturesJSON(e,t={}){await this.load(t);let n=c(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatures`,n.toJSON(),t)}async queryFeatureCount(e,t={}){await this.load(t);let n=c(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatureCount`,n.toJSON(),t)}async queryObjectIds(e,t={}){await this.load(t);let n=c(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryObjectIds`,n.toJSON(),t)}async queryExtent(e,t={}){await this.load(t);let n=c(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryExtent`,n.toJSON(),t);return{count:r.count,extent:o.fromJSON(r.extent)}}async querySnapping(e,t={}){return await this.load(t),this._connection.invoke(`querySnapping`,e,t)}async queryAttributeBins(e,t={}){await this.load();let n=c(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryAttributeBins`,n.toJSON(),t)}async _startWorker(e){this._connection=await a(`CSVSourceWorker`,{strategy:`dedicated`,signal:e,registryTarget:this});let{url:t,delimiter:n,fields:r,latitudeField:i,longitudeField:o,spatialReference:s,timeInfo:c}=this.loadOptions,l=await this._connection.invoke(`load`,{url:t,customParameters:this.customParameters,parsingOptions:{delimiter:n,fields:r?.map(e=>e.toJSON()),latitudeField:i,longitudeField:o,spatialReference:s?.toJSON(),timeInfo:c?.toJSON()}},{signal:e});this.locationInfo=l.locationInfo,this.sourceJSON=l.layerDefinition,this.delimiter=l.delimiter}};e([t()],l.prototype,`type`,void 0),e([t()],l.prototype,`loadOptions`,void 0),e([t()],l.prototype,`customParameters`,void 0),e([t({constructOnly:!0})],l.prototype,`layer`,void 0),e([t()],l.prototype,`locationInfo`,void 0),e([t()],l.prototype,`sourceJSON`,void 0),e([t()],l.prototype,`delimiter`,void 0),l=e([n(`esri.layers.graphics.sources.CSVSource`)],l);export{l as CSVSource};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{Loadable as r}from"../../../core/Loadable.js";import{debounce as i}from"../../../core/promiseUtils.js";import{open as a}from"../../../core/workers.js";import o from"../../../geometry/Extent.js";import s from"../../../rest/support/FeatureSet.js";import{applyTimeExtentToQuery as c}from"./support/timeQueryUtils.js";let l=class extends r{constructor(e){super(e),this.type=`csv`,this.refresh=i(async e=>{await this.load();let{extent:t,timeExtent:n}=await this._connection.invoke(`refresh`,e);return t&&(this.sourceJSON.extent=t),n&&(this.sourceJSON.timeInfo.timeExtent=[n.start,n.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){await this.load(t);let n=c(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryFeatures`,n.toJSON(),t);return s.fromJSON(r)}async queryFeaturesJSON(e,t={}){await this.load(t);let n=c(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatures`,n.toJSON(),t)}async queryFeatureCount(e,t={}){await this.load(t);let n=c(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatureCount`,n.toJSON(),t)}async queryObjectIds(e,t={}){await this.load(t);let n=c(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryObjectIds`,n.toJSON(),t)}async queryExtent(e,t={}){await this.load(t);let n=c(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryExtent`,n.toJSON(),t);return{count:r.count,extent:o.fromJSON(r.extent)}}async querySnapping(e,t={}){return await this.load(t),this._connection.invoke(`querySnapping`,e,t)}async queryAttributeBins(e,t={}){await this.load();let n=c(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryAttributeBins`,n.toJSON(),t);return(await import(`../../../rest/support/AttributeBinsFeatureSet.js`)).default.fromJSON(r)}async _startWorker(e){this._connection=await a(`CSVSourceWorker`,{strategy:`dedicated`,signal:e,registryTarget:this});let{url:t,delimiter:n,fields:r,latitudeField:i,longitudeField:o,spatialReference:s,timeInfo:c}=this.loadOptions,l=await this._connection.invoke(`load`,{url:t,customParameters:this.customParameters,parsingOptions:{delimiter:n,fields:r?.map(e=>e.toJSON()),latitudeField:i,longitudeField:o,spatialReference:s?.toJSON(),timeInfo:c?.toJSON()}},{signal:e});this.locationInfo=l.locationInfo,this.sourceJSON=l.layerDefinition,this.delimiter=l.delimiter}};e([t()],l.prototype,`type`,void 0),e([t()],l.prototype,`loadOptions`,void 0),e([t()],l.prototype,`customParameters`,void 0),e([t({constructOnly:!0})],l.prototype,`layer`,void 0),e([t()],l.prototype,`locationInfo`,void 0),e([t()],l.prototype,`sourceJSON`,void 0),e([t()],l.prototype,`delimiter`,void 0),l=e([n(`esri.layers.graphics.sources.CSVSource`)],l);export{l as CSVSource};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import r from"../../../core/Error.js";import{Loadable as i}from"../../../core/Loadable.js";import a from"../../../core/Logger.js";import{debounce as o}from"../../../core/promiseUtils.js";import{open as s}from"../../../core/workers.js";import c from"../../../geometry/Extent.js";import l from"../../../geometry/Polygon.js";import{featureGeometryTypeKebabDictionary as u}from"../../../geometry/support/typeUtils.js";import d from"../../../rest/support/FeatureSet.js";import{createCapabilities as f}from"./support/clientSideDefaults.js";import{applyTimeExtentToQuery as p}from"./support/timeQueryUtils.js";let m=class extends i{constructor(){super(...arguments),this.type=`geojson`,this.refresh=o(async e=>{await this.load();let{extent:t,timeExtent:n}=await this._connection.invoke(`refresh`,e);return this.sourceJSON.extent=t,n&&(this.sourceJSON.timeInfo.timeExtent=[n.start,n.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}queryFeatures(e,t={}){return this.load(t).then(()=>{let n=p(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatures`,n.toJSON(),t)}).then(e=>d.fromJSON(e))}queryFeaturesJSON(e,t={}){return this.load(t).then(()=>{let n=p(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatures`,n.toJSON(),t)})}queryFeatureCount(e,t={}){return this.load(t).then(()=>{let n=p(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatureCount`,n.toJSON(),t)})}queryObjectIds(e,t={}){return this.load(t).then(()=>{let n=p(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryObjectIds`,n.toJSON(),t)})}queryExtent(e,t={}){return this.load(t).then(()=>{let n=p(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryExtent`,n.toJSON(),t)}).then(e=>({count:e.count,extent:c.fromJSON(e.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke(`querySnapping`,e,t))}async queryAttributeBins(e,t={}){await this.load();let n=p(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryAttributeBins`,n.toJSON(),t)}_applyEdits(e){if(!this._connection)throw new r(`geojson-layer-source:edit-failure`,`Memory source not loaded`);let t=this.layer.objectIdField,n=[],i=[],a=[];if(e.addFeatures)for(let t of e.addFeatures)n.push(this._serializeFeature(t));if(e.deleteFeatures)for(let n of e.deleteFeatures)`objectId`in n&&n.objectId!=null?i.push(n.objectId):`attributes`in n&&n.attributes[t]!=null&&i.push(n.attributes[t]);if(e.updateFeatures)for(let t of e.updateFeatures)a.push(this._serializeFeature(t));return this._connection.invoke(`applyEdits`,{adds:n,updates:a,deletes:i}).then(({extent:e,timeExtent:t,featureEditResults:n})=>(this.sourceJSON.extent=e,t&&(this.sourceJSON.timeInfo.timeExtent=[t.start,t.end]),this._createEditsResult(n)))}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){let t=e.success===!0?null:e.error||{code:void 0,description:``};return{objectId:e.objectId,globalId:e.globalId,error:t?new r(`geojson-layer-source:edit-failure`,t.description,{code:t.code}):null}}_serializeFeature(e){let{attributes:t}=e,n=this._geometryForSerialization(e);return n?{geometry:n.toJSON(),attributes:t}:{attributes:t}}_geometryForSerialization(e){let{geometry:t}=e;return t==null?null:t.type===`mesh`||t.type===`extent`?l.fromExtent(t.extent):t}async _startWorker(e){this._connection=await s(`GeoJSONSourceWorker`,{strategy:`dedicated`,signal:e,registryTarget:this});let{fields:t,spatialReference:n,hasZ:r,geometryType:i,objectIdField:o,url:c,timeInfo:l,customParameters:d}=this.layer,p=this.layer.originOf(`spatialReference`)===`defaults`,m={url:c,customParameters:d,fields:t&&t.map(e=>e.toJSON()),geometryType:u.toJSON(i),hasZ:r,objectIdField:o,timeInfo:l?l.toJSON():null,spatialReference:p?null:n&&n.toJSON()},h=await this._connection.invoke(`load`,m,{signal:e});for(let e of h.warnings)a.getLogger(this.layer).warn(`#load()`,`${e.message} (title: '${this.layer.title||`no title`}', id: '${this.layer.id??`no id`}')`,{warning:e});h.featureErrors.length&&a.getLogger(this.layer).warn(`#load()`,`Encountered ${h.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||`no title`}', id: '${this.layer.id??`no id`}')`,{errors:h.featureErrors}),this.sourceJSON=h.layerDefinition,this.capabilities=f(this.sourceJSON.hasZ,!0,!this.sourceJSON.geometryType)}};e([t()],m.prototype,`capabilities`,void 0),e([t()],m.prototype,`type`,void 0),e([t({constructOnly:!0})],m.prototype,`layer`,void 0),e([t()],m.prototype,`sourceJSON`,void 0),m=e([n(`esri.layers.graphics.sources.GeoJSONSource`)],m);export{m as GeoJSONSource};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import r from"../../../core/Error.js";import{Loadable as i}from"../../../core/Loadable.js";import a from"../../../core/Logger.js";import{debounce as o}from"../../../core/promiseUtils.js";import{open as s}from"../../../core/workers.js";import c from"../../../geometry/Extent.js";import l from"../../../geometry/Polygon.js";import{featureGeometryTypeKebabDictionary as u}from"../../../geometry/support/typeUtils.js";import d from"../../../rest/support/FeatureSet.js";import{createCapabilities as f}from"./support/clientSideDefaults.js";import{applyTimeExtentToQuery as p}from"./support/timeQueryUtils.js";let m=class extends i{constructor(){super(...arguments),this.type=`geojson`,this.refresh=o(async e=>{await this.load();let{extent:t,timeExtent:n}=await this._connection.invoke(`refresh`,e);return this.sourceJSON.extent=t,n&&(this.sourceJSON.timeInfo.timeExtent=[n.start,n.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}queryFeatures(e,t={}){return this.load(t).then(()=>{let n=p(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatures`,n.toJSON(),t)}).then(e=>d.fromJSON(e))}queryFeaturesJSON(e,t={}){return this.load(t).then(()=>{let n=p(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatures`,n.toJSON(),t)})}queryFeatureCount(e,t={}){return this.load(t).then(()=>{let n=p(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatureCount`,n.toJSON(),t)})}queryObjectIds(e,t={}){return this.load(t).then(()=>{let n=p(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryObjectIds`,n.toJSON(),t)})}queryExtent(e,t={}){return this.load(t).then(()=>{let n=p(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryExtent`,n.toJSON(),t)}).then(e=>({count:e.count,extent:c.fromJSON(e.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke(`querySnapping`,e,t))}async queryAttributeBins(e,t={}){await this.load();let n=p(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryAttributeBins`,n.toJSON(),t);return(await import(`../../../rest/support/AttributeBinsFeatureSet.js`)).default.fromJSON(r)}_applyEdits(e){if(!this._connection)throw new r(`geojson-layer-source:edit-failure`,`Memory source not loaded`);let t=this.layer.objectIdField,n=[],i=[],a=[];if(e.addFeatures)for(let t of e.addFeatures)n.push(this._serializeFeature(t));if(e.deleteFeatures)for(let n of e.deleteFeatures)`objectId`in n&&n.objectId!=null?i.push(n.objectId):`attributes`in n&&n.attributes[t]!=null&&i.push(n.attributes[t]);if(e.updateFeatures)for(let t of e.updateFeatures)a.push(this._serializeFeature(t));return this._connection.invoke(`applyEdits`,{adds:n,updates:a,deletes:i}).then(({extent:e,timeExtent:t,featureEditResults:n})=>(this.sourceJSON.extent=e,t&&(this.sourceJSON.timeInfo.timeExtent=[t.start,t.end]),this._createEditsResult(n)))}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){let t=e.success===!0?null:e.error||{code:void 0,description:``};return{objectId:e.objectId,globalId:e.globalId,error:t?new r(`geojson-layer-source:edit-failure`,t.description,{code:t.code}):null}}_serializeFeature(e){let{attributes:t}=e,n=this._geometryForSerialization(e);return n?{geometry:n.toJSON(),attributes:t}:{attributes:t}}_geometryForSerialization(e){let{geometry:t}=e;return t==null?null:t.type===`mesh`||t.type===`extent`?l.fromExtent(t.extent):t}async _startWorker(e){this._connection=await s(`GeoJSONSourceWorker`,{strategy:`dedicated`,signal:e,registryTarget:this});let{fields:t,spatialReference:n,hasZ:r,geometryType:i,objectIdField:o,url:c,timeInfo:l,customParameters:d}=this.layer,p=this.layer.originOf(`spatialReference`)===`defaults`,m={url:c,customParameters:d,fields:t&&t.map(e=>e.toJSON()),geometryType:u.toJSON(i),hasZ:r,objectIdField:o,timeInfo:l?l.toJSON():null,spatialReference:p?null:n&&n.toJSON()},h=await this._connection.invoke(`load`,m,{signal:e});for(let e of h.warnings)a.getLogger(this.layer).warn(`#load()`,`${e.message} (title: '${this.layer.title||`no title`}', id: '${this.layer.id??`no id`}')`,{warning:e});h.featureErrors.length&&a.getLogger(this.layer).warn(`#load()`,`Encountered ${h.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||`no title`}', id: '${this.layer.id??`no id`}')`,{errors:h.featureErrors}),this.sourceJSON=h.layerDefinition,this.capabilities=f(this.sourceJSON.hasZ,!0,!this.sourceJSON.geometryType)}};e([t()],m.prototype,`capabilities`,void 0),e([t()],m.prototype,`type`,void 0),e([t({constructOnly:!0})],m.prototype,`layer`,void 0),e([t()],m.prototype,`sourceJSON`,void 0),m=e([n(`esri.layers.graphics.sources.GeoJSONSource`)],m);export{m as GeoJSONSource};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../core/Error.js";import{bytesToUTF8 as t}from"../datasets/byteStreamUtils.js";import{readCustomSpatialReference as n}from"./tiffSpatialReferenceUtils.js";import{tiffTags as r,ifdTags as i,getTagName as a,geoKeys as o}from"./tiffTag.js";const s=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],c=4294967296,l=new Map([[1,(e,t)=>e.getUint8(t)],[2,(e,t)=>e.getUint8(t)],[3,(e,t,n)=>e.getUint16(t,n)],[4,(e,t,n)=>e.getUint32(t,n)],[5,(e,t,n)=>e.getUint32(t,n)/e.getUint32(t+4,n)],[6,(e,t)=>e.getInt8(t)],[7,(e,t)=>e.getUint8(t)],[8,(e,t,n)=>e.getInt16(t,n)],[9,(e,t,n)=>e.getInt32(t,n)],[10,(e,t,n)=>e.getInt32(t,n)/e.getInt32(t+4,n)],[11,(e,t,n)=>e.getFloat32(t,n)],[12,(e,t,n)=>e.getFloat64(t,n)],[13,(e,t,n)=>e.getUint32(t,n)],[16,(e,t,n)=>u(e,t,n)],[17,(e,t,n)=>d(e,t,n)],[18,(e,t,n)=>u(e,t,n)]]);function u(e,t,n){return Number(e.getBigUint64(t,n))}function d(e,t,n){return Number(e.getBigInt64(t,n))}function f(e,t){return{x:t[0]*e.x+t[1]*e.y+t[2],y:t[3]*e.x+t[4]*e.y+t[5]}}function p(e,t){return e.get(t)?.values}function m(e,t){return e.get(t)?.values}function h(e,t){return e.get(t)?.values?.[0]}function g(e,t){return e.get(t)?.values?.[0]}function _(e){let n=e.get(`GEOKEYDIRECTORY`),r=n?.values;if(!r||typeof r[0]!=`number`||r.length<4)return;let i=r,s=i.slice(0,3).join(`.`),c=i[3];if(i.length<4+c*4)return;let l=new Map;l.set(`GEOTIFFVersion`,{id:0,type:2,valueCount:1,valueOffset:null,values:[s]});for(let n=0;n<c;n++){let r=4+n*4,s=i[r],c=i[r+1],u=i[r+2],d=i[r+3],f={id:s,type:c,valueCount:u,valueOffset:d,values:null};if(c===0)f.values=[d];else{let n=e.get(a(c)),r=n?.values;if(r==null&&n?.offlineOffsetSize!=null)return;if(r!=null){let e=d+u;n?.asciiBytes?e<=n.asciiBytes.length&&(f.values=[t(n.asciiBytes.subarray(d,e)).replace(/\|$/,``)]):typeof r[0]==`string`?e<=r[0].length&&(f.values=[r[0].slice(d,e).replace(/\|$/,``)]):e<=r.length&&(f.values=r.slice(d,e))}}let p=a(s,o);l.set(p,f)}n.data=l}function v(e,t,n,r){return r?u(e,t,n):e.getUint32(t,n)}function y(e,t,n,i=0,o=r,s=4){let c=s===8,l=c?8:2;if(n<0||n+l>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:l};let d=c?u(new DataView(e,n,8),0,t):new DataView(e,n,2).getUint16(0,t),f=4+s*2,p=s,m=l+d*f+p;if(n+m>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:m};let h=v(new DataView(e,n+m-p,p),0,t,c),g=n+l,_=new Map;for(let n=0;n<d;n++){let r=new DataView(e,g+f*n,f),c=r.getUint16(0,t),l=r.getUint16(2,t),u=a(c,o),d=[],p=0,m=0;s===4?(p=r.getUint32(4,t),m=r.getUint32(8,t)):s===8&&(p=v(r,4,t,!0),m=v(r,12,t,!0),d.push(r.getUint32(12,t)),d.push(r.getUint32(16,t)));let h={id:c,type:l,valueCount:p,valueOffset:m,valueOffsets:d,values:null};C(e,t,h,i,!1,s),_.set(u,h)}return{success:!0,ifd:_,nextIFD:h,requiredBufferSize:m}}function b(e){if(!e)return null;let t=e.match(/<Item(.*?)Item>/gi);if(!t||t.length===0)return null;let n=new Map;for(let e=0;e<t.length;e++){let r=t[e],i=r.indexOf(`sample=`),a=i>-1?r.slice(i+8,r.indexOf(`"`,i+8)):null;i=r.indexOf(`name=`);let o=i>-1?r.slice(i+6,r.indexOf(`"`,i+6)):r.slice(6,r.indexOf(`>`));if(o){let e=r.slice(r.indexOf(`>`)+1,r.indexOf(`</Item>`)).trim();a==null?n.set(o,e):(n.has(o)||n.set(o,[]),n.get(o)[a]=e)}}let r=n.get(`STATISTICS_MINIMUM`),i=n.get(`STATISTICS_MAXIMUM`),a=n.get(`STATISTICS_MEAN`),o=n.get(`STATISTICS_STDDEV`),s=n.get(`STATISTICS_COUNT`),c=n.get(`STATISTICS_MEDIAN`),l=n.get(`STATISTICS_COVARIANCES`),u=null;if(r&&i){u=[];for(let e=0;e<r.length;e++){let t={min:parseFloat(r[e]),max:parseFloat(i[e]),avg:a&&parseFloat(a[e]),stddev:o&&parseFloat(o[e])};s&&(t.count=parseFloat(s[e])),c&&(t.median=parseFloat(c[e])),l&&(t.covariances=l[e].split(`,`).map(e=>parseFloat(e))),u.push(t)}}let d=n.get(`BandName`),f=n.get(`WavelengthMin`),p=n.get(`WavelengthMax`),m=null;if(d){m=[];for(let e=0;e<d.length;e++)m.push({BandName:d[e],WavelengthMin:f&&parseFloat(f[e]),WavelengthMax:p&&parseFloat(p[e])})}let h=n.get(`DataType`);return{statistics:u,bandProperties:m,dataType:h,rawMetadata:n}}function x(e,t,n,r){let{type:i,valueCount:a}=t,o=s[i];if(o==null||o<=0)return[];let c=a*o,u=c/o,d=new DataView(e,n,c),f=[],p=l.get(i);if(!p)return[];for(let e=0,t=0;e<u;e++,t+=o)f.push(p(d,t,r));return f}function S(e,t,n=4){let{type:r,valueCount:i,valueOffsets:a}=e,o=s[r];if(o==null||o<=0)return[];let l=o*8,u=i*l,{valueOffset:d}=e,f=n===8?64:32;if(!t){if(f<=32)d>>>=32-u;else{let e=a?.length?a[0]:d>>>0,t=a?.length?a[1]:Math.round((d-e)/c);u<=32?(d=e>>>32-u,a[0]=d):(d=e*2**(32-u)+(t>>>32-u),a[0]=e,a[1]=t>>>32-u)}}if(i===1&&l===f)return[d];let p=[];if(f===64){let e=a?.length?a[0]:d>>>0,t=a?.length?a[1]:Math.round((d-e)/c),n=e,r=32;for(let e=1;e<=i;e++){let i=32-l*e%32;if(r<l){let e=n<<i>>>32-r,a=t<<32-r>>>32-r;n=t,p.push(e+a*2**(l-r)),r-=32-(l-r)}else p.push(n<<i>>>32-l),r-=l;r===0&&(r=32,n=t)}return p}for(let e=1;e<=i;e++){let t=32-l*e;p.push(d<<t>>>32-l)}return p}function C(e,n,r,i=0,a=!1,o=4){if(r.values)return!0;let{type:c,valueCount:l}=r,u=r.valueOffset,d=s[c];if(d==null||d<=0)return r.values=[],!0;let f=l*d,p=l*s[c]*8,m=o===8?64:32,h;if(p<=m)h=S(r,n,o);else{let t=a?e.byteLength:e.byteLength-u+i;if(u-=i,a&&(u=0),u<0||f>t)return r.offlineOffsetSize=[r.valueOffset,f],r.values=null,!1;h=x(e,r,u,n)}if(c===2){let e=h instanceof Uint8Array?h:new Uint8Array(h);r.id===34737&&(r.asciiBytes=e),r.values=[e.length?t(e):``]}else r.values=h;return!0}function w(e){if(!e.has(`XMP`))return;let n=e.get(`XMP`),r=n.values;r&&typeof r[0]==`number`&&n.type===7&&(n.values=[t(new Uint8Array(r))])}function T(e){let t=g(e,`PHOTOMETRICINTERPRETATION`),n=m(e,`COLORMAP`);if(t!=null&&t<=3&&n?.length&&n.length%3==0){let e=[],t=n.length/3;for(let r=0;r<t;r++)e.push([r,n[r]>>>8,n[r+t]>>>8,n[r+t*2]>>>8]);return e}}function E(e){let t=m(e,`GEOTIEPOINTS`),n=m(e,`GEOPIXELSCALE`),r=m(e,`GEOTRANSMATRIX`),i=e.get(`GEOKEYDIRECTORY`)?.data,a=i?g(i,`GTRasterTypeGeoKey`)===2:!1,{spatialReference:o,isPseudoGeographic:s}=D(e),c;n&&t&&t.length>=6?(c=[n[0],0,t[3]-t[0]*n[0],0,-Math.abs(n[1]),t[4]-t[1]*n[1]],a&&(c[2]-=c[0]*.5+c[1]*.5,c[5]-=c[3]*.5+c[4]*.5)):r?.length===16&&(c=a?[r[0],r[1],r[3]-r[0]*.5,r[4],r[5],r[7]-r[5]*.5]:[r[0],r[1],r[3],r[4],r[5],r[7]]);let l,u=g(e,`IMAGEWIDTH`),d=g(e,`IMAGELENGTH`);if(c){let e=[{x:0,y:d},{x:0,y:0},{x:u,y:d},{x:u,y:0}],t,n=1/0,r=1/0,i=-1/0,a=-1/0;for(let o=0;o<e.length;o++)t=f(e[o],c),n=t.x>n?n:t.x,i=t.x<i?i:t.x,r=t.y>r?r:t.y,a=t.y<a?a:t.y;l={xmin:n,xmax:i,ymin:r,ymax:a,spatialReference:o}}else l={xmin:-.5,ymin:.5-d,xmax:u-.5,ymax:.5,spatialReference:o};return s&&(l.xmax-l.xmin>400||Math.max(Math.abs(l.xmin),Math.abs(l.xmax))>361)&&(l.spatialReference=null),{extent:l,isPseudoGeographic:s,affine:n?void 0:c}}function D(e){let t=h(e,`GEOASCIIPARAMS`),n=null;if(t){let e=t.split(`|`).find(e=>e.includes(`ESRI PE String = `)),r=e?e.replace(`ESRI PE String = `,``):``;n=r.startsWith(`COMPD_CS`)||r.startsWith(`PROJCS`)||r.startsWith(`GEOGCS`)?{wkid:null,wkt:r}:null}let r=!1,i=e.get(`GEOKEYDIRECTORY`)?.data;if(i){let e=g(i,`GTModelTypeGeoKey`);if(e===2){let e=g(i,`GeographicTypeGeoKey`);e>=1024&&e<=32766&&(n={wkid:e}),!n&&e===32767&&(r=!0,n={wkid:4326})}else if(e===1){let e=g(i,`ProjectedCSTypeGeoKey`);e>=1024&&e<=32766&&(n={wkid:e})}}return{spatialReference:n,isPseudoGeographic:r}}function O(e){let{width:t,height:n,tileHeight:r,tileWidth:i}=e,a=e.planes,o=i?i*r:t*n,s=M(e.ifds[0]),c=o*a,l=``;return c>2**30/(s>8?s/8:1)&&(l=i?`tiled tiff exceeding 1 gigabits per tile is not supported`:`scanline tiff exceeding 1 gigabits is not supported`),l}function k(e){return g(e,`PLANARCONFIGURATION`)===2}function A(e){return g(e,`COMPRESSION`)??1}function j(e){return g(e,`SAMPLESPERPIXEL`)??1}function M(e){return g(e,`BITSPERSAMPLE`)??1}function N(e){return g(e,`SAMPLEFORMAT`)??1}function P(e){return g(e,`PREDICTOR`)??1}function F(e){let t=A(e),n,r=!1;switch(t){case 1:n=`NONE`,r=!0;break;case 2:case 3:case 4:case 32771:n=`CCITT`;break;case 5:n=`LZW`,r=!0;break;case 6:case 7:n=`JPEG`,r=!0;break;case 32773:n=`PACKBITS`;break;case 8:case 32946:n=`DEFLATE`,r=!0;break;case 34712:n=`JPEG2000`;break;case 34887:n=`LERC`,r=!0;break;default:n=String(t)}return{compression:n,supported:r}}function I(e,t){let n=`unknown`;return e===3?n=t===64?`f64`:`f32`:e===1?t===1?n=`u1`:t===2?n=`u2`:t===4?n=`u4`:t<=8?n=`u8`:t<=16?n=`u16`:t<=32&&(n=`u32`):e===2&&(t<=8?n=`s8`:t<=16?n=`s16`:t<=32&&(n=`s32`)),n}async function L(e){let t=R(e),r=e[0].get(`GEOKEYDIRECTORY`)?.data;return!t.extent.spatialReference&&!t.isPseudoGeographic&&r&&(t.extent.spatialReference=await n(r)),t}function R(e){let t=e[0],n=g(t,`TILEWIDTH`),r=g(t,`TILELENGTH`),i=g(t,`IMAGEWIDTH`),a=g(t,`IMAGELENGTH`),o=M(t),s=j(t),c=N(t),l=I(c,o),u=k(t),d=p(t,`GDAL_NODATA`),f=null;d?.length&&(f=d.map(e=>parseFloat(e)),f.some(e=>isNaN(e))&&(f=null));let m=!0,_=``,{compression:v,supported:y}=F(t);y||(m=!1,_+=`unsupported tag compression `+v),c>3&&(m=!1,_+=`unsupported tag sampleFormat `+c),o>32&&o!==64&&(m=!1,_+=`unsupported tag bitsPerSample `+o);let{extent:x,isPseudoGeographic:S,affine:C}=E(t),w=z(e),D,A,P,L;if(w.length>0){P=Math.round(Math.log(i/g(w[0],`IMAGEWIDTH`))/Math.LN2);let e=w[w.length-1];L=w.length,D=g(e,`TILEWIDTH`),A=g(e,`TILELENGTH`)}D=L!=null&&L>0?D||n:null,A=L!=null&&L>0?A||r:null;let R;n&&(R=[{maxCol:Math.ceil(i/n)-1,maxRow:Math.ceil(a/r)-1,minRow:0,minCol:0}],w.forEach(e=>{R.push({maxCol:Math.ceil(g(e,`IMAGEWIDTH`)/g(e,`TILEWIDTH`))-1,maxRow:Math.ceil(g(e,`IMAGELENGTH`)/g(e,`TILELENGTH`))-1,minRow:0,minCol:0})}));let V=b(h(e[0],`GDAL_METADATA`));_+=` `+O({width:i,height:a,tileWidth:n,tileHeight:r,planes:s,ifds:e});let H=B(e).length===w.length+1,U=w?.length?w.map(e=>({x:i/g(e,`IMAGEWIDTH`),y:a/g(e,`IMAGELENGTH`)})):void 0,W=T(t);return{width:i,height:a,tileWidth:n,tileHeight:r,planes:s,isBSQ:u,pixelType:l,compression:v,noData:f,hasMaskBand:H,isSupported:m,pyramidResolutions:U,message:_,extent:x,isPseudoGeographic:S,affine:C,firstPyramidLevel:P,maximumPyramidLevel:L,pyramidBlockWidth:D,pyramidBlockHeight:A,tileBoundary:R,metadata:V,colormap:W}}function z(e){return e.filter(e=>g(e,`NEWSUBFILETYPE`)===1)}function B(e){return e.filter(e=>{let t=((g(e,`NEWSUBFILETYPE`)??0)&4)==4,n=g(e,`PHOTOMETRICINTERPRETATION`)===4;return t&&n})}function V(e,t,n,a=0,o=r,s=4){let c=y(e,t,n,a,o,s),l,u=c.ifd;if(u){for(let[n,r]of i)u.has(n)&&(l=u.get(n),l.data=y(e,t,l.valueOffset-a,a,r).ifd);_(u),w(u)}return c}function H(t){let n=new DataView(t,0,16),r=n.getUint16(0,!1),i=null;if(r===18761)i=!0;else if(r===19789)i=!1;else throw new e(`tiff-reader:parse-signature`,`unexpected endianness byte`);let a=n.getUint16(2,i);if(a!==42&&a!==43)throw new e(`tiff-reader:parse-signature`,`unexpected tiff identifier`);let o=4,s=a===43;if(s){let t=n.getUint16(o,i);if(o+=2,t!==8||n.getUint16(o,i)!==0)throw new e(`tiff-reader:parse-signature`,`unsupported bigtiff version`);o+=2}let c=v(n,o,i,s);return{littleEndian:i,isBigTiff:s,firstIFDPos:c}}function U(e){let{littleEndian:t,isBigTiff:n,firstIFDPos:i}=H(e),a=i,o=[];do{let i=V(e,t,a,0,r,n?8:4);if(i.success)o.push(i.ifd),a=i.nextIFD;else break}while(a>0);let s=R(o),c=z(o),l=B(o);return{...s,littleEndian:t,isBigTiff:n,ifds:o,pyramidIFDs:c,maskIFDs:l}}export{O as checkRequiredArraySize,M as getBitsPerSample,A as getCompressionType,L as getFullImageInfo,R as getImageInfo,B as getMaskIFDs,I as getPixelType,P as getPredictor,z as getPyramidIFDs,N as getSampleFormat,j as getSamplesPerPixel,g as getTagFirstNumericValue,m as getTagNumericValues,k as isBSQConfig,C as parseFieldValues,_ as parseGeoKeyDirectory,U as parseHeader,V as parseIFD,b as parseMetadata,H as parseSignature,w as parseXMP};
2
+ import e from"../../../core/Error.js";import{bytesToUTF8 as t}from"../datasets/byteStreamUtils.js";import{readCustomSpatialReference as n}from"./tiffSpatialReferenceUtils.js";import{tiffTags as r,ifdTags as i,getTagName as a,geoKeys as o}from"./tiffTag.js";const s=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],c=new Map([[1,(e,t)=>e.getUint8(t)],[2,(e,t)=>e.getUint8(t)],[3,(e,t,n)=>e.getUint16(t,n)],[4,(e,t,n)=>e.getUint32(t,n)],[5,(e,t,n)=>e.getUint32(t,n)/e.getUint32(t+4,n)],[6,(e,t)=>e.getInt8(t)],[7,(e,t)=>e.getUint8(t)],[8,(e,t,n)=>e.getInt16(t,n)],[9,(e,t,n)=>e.getInt32(t,n)],[10,(e,t,n)=>e.getInt32(t,n)/e.getInt32(t+4,n)],[11,(e,t,n)=>e.getFloat32(t,n)],[12,(e,t,n)=>e.getFloat64(t,n)],[13,(e,t,n)=>e.getUint32(t,n)],[16,(e,t,n)=>l(e,t,n)],[17,(e,t,n)=>u(e,t,n)],[18,(e,t,n)=>l(e,t,n)]]);function l(e,t,n){return Number(e.getBigUint64(t,n))}function u(e,t,n){return Number(e.getBigInt64(t,n))}function d(e,t){return{x:t[0]*e.x+t[1]*e.y+t[2],y:t[3]*e.x+t[4]*e.y+t[5]}}function f(e,t){return e.get(t)?.values}function p(e,t){return e.get(t)?.values}function m(e,t){return e.get(t)?.values?.[0]}function h(e,t){return e.get(t)?.values?.[0]}function g(e){let n=e.get(`GEOKEYDIRECTORY`),r=n?.values;if(!r||typeof r[0]!=`number`||r.length<4)return;let i=r,s=i.slice(0,3).join(`.`),c=i[3];if(i.length<4+c*4)return;let l=new Map;l.set(`GEOTIFFVersion`,{id:0,type:2,valueCount:1,valueOffset:null,values:[s]});for(let n=0;n<c;n++){let r=4+n*4,s=i[r],c=i[r+1],u=i[r+2],d=i[r+3],f={id:s,type:c,valueCount:u,valueOffset:d,values:null};if(c===0)f.values=[d];else{let n=e.get(a(c)),r=n?.values;if(r==null&&n?.offlineOffsetSize!=null)return;if(r!=null){let e=d+u;n?.asciiBytes?e<=n.asciiBytes.length&&(f.values=[t(n.asciiBytes.subarray(d,e)).replace(/\|$/,``)]):typeof r[0]==`string`?e<=r[0].length&&(f.values=[r[0].slice(d,e).replace(/\|$/,``)]):e<=r.length&&(f.values=r.slice(d,e))}}let p=a(s,o);l.set(p,f)}n.data=l}function _(e,t,n,r){return r?l(e,t,n):e.getUint32(t,n)}function v(e,t,n,i=0,o=r,s=4){let c=s===8,u=c?8:2;if(n<0||n+u>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:u};let d=c?l(new DataView(e,n,8),0,t):new DataView(e,n,2).getUint16(0,t),f=4+s*2,p=s,m=u+d*f+p;if(n+m>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:m};let h=_(new DataView(e,n+m-p,p),0,t,c),g=n+u,v=new Map;for(let n=0;n<d;n++){let r=new DataView(e,g+f*n,f),c=r.getUint16(0,t),l=r.getUint16(2,t),u=a(c,o),d=[],p=0,m=0;s===4?(p=r.getUint32(4,t),m=r.getUint32(8,t)):s===8&&(p=_(r,4,t,!0),m=_(r,12,t,!0),d.push(r.getUint32(12,t)),d.push(r.getUint32(16,t)));let h={id:c,type:l,valueCount:p,valueOffset:m,valueOffsets:d,values:null};S(e,t,h,i,!1,s),v.set(u,h)}return{success:!0,ifd:v,nextIFD:h,requiredBufferSize:m}}function y(e){if(!e)return null;let t=e.match(/<Item(.*?)Item>/gi);if(!t||t.length===0)return null;let n=new Map;for(let e=0;e<t.length;e++){let r=t[e],i=r.indexOf(`sample=`),a=i>-1?r.slice(i+8,r.indexOf(`"`,i+8)):null;i=r.indexOf(`name=`);let o=i>-1?r.slice(i+6,r.indexOf(`"`,i+6)):r.slice(6,r.indexOf(`>`));if(o){let e=r.slice(r.indexOf(`>`)+1,r.indexOf(`</Item>`)).trim();a==null?n.set(o,e):(n.has(o)||n.set(o,[]),n.get(o)[a]=e)}}let r=n.get(`STATISTICS_MINIMUM`),i=n.get(`STATISTICS_MAXIMUM`),a=n.get(`STATISTICS_MEAN`),o=n.get(`STATISTICS_STDDEV`),s=n.get(`STATISTICS_COUNT`),c=n.get(`STATISTICS_MEDIAN`),l=n.get(`STATISTICS_COVARIANCES`),u=null;if(r&&i){u=[];for(let e=0;e<r.length;e++){let t={min:parseFloat(r[e]),max:parseFloat(i[e]),avg:a&&parseFloat(a[e]),stddev:o&&parseFloat(o[e])};s&&(t.count=parseFloat(s[e])),c&&(t.median=parseFloat(c[e])),l&&(t.covariances=l[e].split(`,`).map(e=>parseFloat(e))),u.push(t)}}let d=n.get(`BandName`),f=n.get(`WavelengthMin`),p=n.get(`WavelengthMax`),m=null;if(d){m=[];for(let e=0;e<d.length;e++)m.push({BandName:d[e],WavelengthMin:f&&parseFloat(f[e]),WavelengthMax:p&&parseFloat(p[e])})}let h=n.get(`DataType`);return{statistics:u,bandProperties:m,dataType:h,rawMetadata:n}}function b(e,t,n,r){let{type:i,valueCount:a}=t,o=s[i];if(o==null||o<=0)return[];let l=a*o,u=new DataView(e,n,l),d=[],f=c.get(i);if(!f)return[];for(let e=0,t=0;e<a;e++,t+=o)d.push(f(u,t,r));return d}function x(e,t,n=4){let{valueOffset:r,valueOffsets:i}=e,a=new ArrayBuffer(n),o=new DataView(a);return n===4?o.setUint32(0,r,t):i?.length?(o.setUint32(0,i[0],t),o.setUint32(4,i[1],t)):o.setBigUint64(0,BigInt(r),t),b(a,e,0,t)}function S(e,n,r,i=0,a=!1,o=4){if(r.values)return!0;let{type:c,valueCount:l}=r,u=r.valueOffset,d=s[c];if(d==null||d<=0)return r.values=[],!0;let f=l*d,p=l*s[c]*8,m=o===8?64:32,h;if(p<=m)h=x(r,n,o);else{let t=a?e.byteLength:e.byteLength-u+i;if(u-=i,a&&(u=0),u<0||f>t)return r.offlineOffsetSize=[r.valueOffset,f],r.values=null,!1;h=b(e,r,u,n)}if(c===2){let e=h instanceof Uint8Array?h:new Uint8Array(h);r.id===34737&&(r.asciiBytes=e),r.values=[e.length?t(e):``]}else r.values=h;return!0}function C(e){if(!e.has(`XMP`))return;let n=e.get(`XMP`),r=n.values;r&&typeof r[0]==`number`&&n.type===7&&(n.values=[t(new Uint8Array(r))])}function w(e){let t=h(e,`PHOTOMETRICINTERPRETATION`),n=p(e,`COLORMAP`);if(t!=null&&t<=3&&n?.length&&n.length%3==0){let e=[],t=n.length/3;for(let r=0;r<t;r++)e.push([r,n[r]>>>8,n[r+t]>>>8,n[r+t*2]>>>8]);return e}}function T(e){let t=p(e,`GEOTIEPOINTS`),n=p(e,`GEOPIXELSCALE`),r=p(e,`GEOTRANSMATRIX`),i=e.get(`GEOKEYDIRECTORY`)?.data,a=i?h(i,`GTRasterTypeGeoKey`)===2:!1,{spatialReference:o,isPseudoGeographic:s}=E(e),c;n&&t&&t.length>=6?(c=[n[0],0,t[3]-t[0]*n[0],0,-Math.abs(n[1]),t[4]-t[1]*n[1]],a&&(c[2]-=c[0]*.5+c[1]*.5,c[5]-=c[3]*.5+c[4]*.5)):r?.length===16&&(c=a?[r[0],r[1],r[3]-r[0]*.5,r[4],r[5],r[7]-r[5]*.5]:[r[0],r[1],r[3],r[4],r[5],r[7]]);let l,u=h(e,`IMAGEWIDTH`),f=h(e,`IMAGELENGTH`);if(c){let e=[{x:0,y:f},{x:0,y:0},{x:u,y:f},{x:u,y:0}],t,n=1/0,r=1/0,i=-1/0,a=-1/0;for(let o=0;o<e.length;o++)t=d(e[o],c),n=t.x>n?n:t.x,i=t.x<i?i:t.x,r=t.y>r?r:t.y,a=t.y<a?a:t.y;l={xmin:n,xmax:i,ymin:r,ymax:a,spatialReference:o}}else l={xmin:-.5,ymin:.5-f,xmax:u-.5,ymax:.5,spatialReference:o};return s&&(l.xmax-l.xmin>400||Math.max(Math.abs(l.xmin),Math.abs(l.xmax))>361)&&(l.spatialReference=null),{extent:l,isPseudoGeographic:s,affine:n?void 0:c}}function E(e){let t=m(e,`GEOASCIIPARAMS`),n=null;if(t){let e=t.split(`|`).find(e=>e.includes(`ESRI PE String = `)),r=e?e.replace(`ESRI PE String = `,``):``;n=r.startsWith(`COMPD_CS`)||r.startsWith(`PROJCS`)||r.startsWith(`GEOGCS`)?{wkid:null,wkt:r}:null}let r=!1,i=e.get(`GEOKEYDIRECTORY`)?.data;if(i){let e=h(i,`GTModelTypeGeoKey`);if(e===2){let e=h(i,`GeographicTypeGeoKey`);e>=1024&&e<=32766&&(n={wkid:e}),!n&&e===32767&&(r=!0,n={wkid:4326})}else if(e===1){let e=h(i,`ProjectedCSTypeGeoKey`);e>=1024&&e<=32766&&(n={wkid:e})}}return{spatialReference:n,isPseudoGeographic:r}}function D(e){let{width:t,height:n,tileHeight:r,tileWidth:i}=e,a=e.planes,o=i?i*r:t*n,s=j(e.ifds[0]),c=o*a,l=``;return c>2**30/(s>8?s/8:1)&&(l=i?`tiled tiff exceeding 1 gigabits per tile is not supported`:`scanline tiff exceeding 1 gigabits is not supported`),l}function O(e){return h(e,`PLANARCONFIGURATION`)===2}function k(e){return h(e,`COMPRESSION`)??1}function A(e){return h(e,`SAMPLESPERPIXEL`)??1}function j(e){return h(e,`BITSPERSAMPLE`)??1}function M(e){return h(e,`SAMPLEFORMAT`)??1}function N(e){return h(e,`PREDICTOR`)??1}function P(e){let t=k(e),n,r=!1;switch(t){case 1:n=`NONE`,r=!0;break;case 2:case 3:case 4:case 32771:n=`CCITT`;break;case 5:n=`LZW`,r=!0;break;case 6:case 7:n=`JPEG`,r=!0;break;case 32773:n=`PACKBITS`;break;case 8:case 32946:n=`DEFLATE`,r=!0;break;case 34712:n=`JPEG2000`;break;case 34887:n=`LERC`,r=!0;break;default:n=String(t)}return{compression:n,supported:r}}function F(e,t){let n=`unknown`;return e===3?n=t===64?`f64`:`f32`:e===1?t===1?n=`u1`:t===2?n=`u2`:t===4?n=`u4`:t<=8?n=`u8`:t<=16?n=`u16`:t<=32&&(n=`u32`):e===2&&(t<=8?n=`s8`:t<=16?n=`s16`:t<=32&&(n=`s32`)),n}async function I(e){let t=L(e),r=e[0].get(`GEOKEYDIRECTORY`)?.data;return!t.extent.spatialReference&&!t.isPseudoGeographic&&r&&(t.extent.spatialReference=await n(r)),t}function L(e){let t=e[0],n=h(t,`TILEWIDTH`),r=h(t,`TILELENGTH`),i=h(t,`IMAGEWIDTH`),a=h(t,`IMAGELENGTH`),o=j(t),s=A(t),c=M(t),l=F(c,o),u=O(t),d=f(t,`GDAL_NODATA`),p=null;d?.length&&(p=d.map(e=>parseFloat(e)),p.some(e=>isNaN(e))&&(p=null));let g=!0,_=``,{compression:v,supported:b}=P(t);b||(g=!1,_+=`unsupported tag compression `+v),c>3&&(g=!1,_+=`unsupported tag sampleFormat `+c),o>32&&o!==64&&(g=!1,_+=`unsupported tag bitsPerSample `+o);let{extent:x,isPseudoGeographic:S,affine:C}=T(t),E=R(e),k,N,I,L;if(E.length>0){I=Math.round(Math.log(i/h(E[0],`IMAGEWIDTH`))/Math.LN2);let e=E[E.length-1];L=E.length,k=h(e,`TILEWIDTH`),N=h(e,`TILELENGTH`)}k=L!=null&&L>0?k||n:null,N=L!=null&&L>0?N||r:null;let B;n&&(B=[{maxCol:Math.ceil(i/n)-1,maxRow:Math.ceil(a/r)-1,minRow:0,minCol:0}],E.forEach(e=>{B.push({maxCol:Math.ceil(h(e,`IMAGEWIDTH`)/h(e,`TILEWIDTH`))-1,maxRow:Math.ceil(h(e,`IMAGELENGTH`)/h(e,`TILELENGTH`))-1,minRow:0,minCol:0})}));let V=y(m(e[0],`GDAL_METADATA`));_+=` `+D({width:i,height:a,tileWidth:n,tileHeight:r,planes:s,ifds:e});let H=z(e).length===E.length+1,U=E?.length?E.map(e=>({x:i/h(e,`IMAGEWIDTH`),y:a/h(e,`IMAGELENGTH`)})):void 0,W=w(t);return{width:i,height:a,tileWidth:n,tileHeight:r,planes:s,isBSQ:u,pixelType:l,compression:v,noData:p,hasMaskBand:H,isSupported:g,pyramidResolutions:U,message:_,extent:x,isPseudoGeographic:S,affine:C,firstPyramidLevel:I,maximumPyramidLevel:L,pyramidBlockWidth:k,pyramidBlockHeight:N,tileBoundary:B,metadata:V,colormap:W}}function R(e){return e.filter(e=>h(e,`NEWSUBFILETYPE`)===1)}function z(e){return e.filter(e=>{let t=((h(e,`NEWSUBFILETYPE`)??0)&4)==4,n=h(e,`PHOTOMETRICINTERPRETATION`)===4;return t&&n})}function B(e,t,n,a=0,o=r,s=4){let c=v(e,t,n,a,o,s),l,u=c.ifd;if(u){for(let[n,r]of i)u.has(n)&&(l=u.get(n),l.data=v(e,t,l.valueOffset-a,a,r).ifd);g(u),C(u)}return c}function V(t){let n=new DataView(t,0,16),r=n.getUint16(0,!1),i=null;if(r===18761)i=!0;else if(r===19789)i=!1;else throw new e(`tiff-reader:parse-signature`,`unexpected endianness byte`);let a=n.getUint16(2,i);if(a!==42&&a!==43)throw new e(`tiff-reader:parse-signature`,`unexpected tiff identifier`);let o=4,s=a===43;if(s){let t=n.getUint16(o,i);if(o+=2,t!==8||n.getUint16(o,i)!==0)throw new e(`tiff-reader:parse-signature`,`unsupported bigtiff version`);o+=2}let c=_(n,o,i,s);return{littleEndian:i,isBigTiff:s,firstIFDPos:c}}function H(e){let{littleEndian:t,isBigTiff:n,firstIFDPos:i}=V(e),a=i,o=[];do{let i=B(e,t,a,0,r,n?8:4);if(i.success)o.push(i.ifd),a=i.nextIFD;else break}while(a>0);let s=L(o),c=R(o),l=z(o);return{...s,littleEndian:t,isBigTiff:n,ifds:o,pyramidIFDs:c,maskIFDs:l}}export{D as checkRequiredArraySize,j as getBitsPerSample,k as getCompressionType,I as getFullImageInfo,L as getImageInfo,z as getMaskIFDs,F as getPixelType,N as getPredictor,R as getPyramidIFDs,M as getSampleFormat,A as getSamplesPerPixel,h as getTagFirstNumericValue,p as getTagNumericValues,O as isBSQConfig,S as parseFieldValues,g as parseGeoKeyDirectory,H as parseHeader,B as parseIFD,y as parseMetadata,V as parseSignature,C as parseXMP};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "6.0.0-next.58",
3
+ "version": "6.0.0-next.59",
4
4
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
5
5
  "keywords": [
6
6
  "ArcGIS",
@@ -20,7 +20,7 @@
20
20
  "license": "SEE LICENSE IN LICENSE.md",
21
21
  "dependencies": {
22
22
  "@amcharts/amcharts5": "~5.25.0",
23
- "@arcgis/toolkit": "6.0.0-next.58",
23
+ "@arcgis/toolkit": "6.0.0-next.59",
24
24
  "@esri/arcgis-html-sanitizer": "~4.2.0",
25
25
  "@esri/calcite-components": "^5.2.2",
26
26
  "@vaadin/grid": "~25.3.7",
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{FeatureSetQueryInterceptor as t}from"../arcade/featureset/support/FeatureSetQueryInterceptor.js";import n from"../core/Accessor.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import{isSome as a}from"../core/arrayUtils.js";import{createTask as o}from"../core/asyncUtils.js";import{IdentifiableMixin as s}from"../core/Identifiable.js";import c from"../core/Logger.js";import{abortMaybe as l}from"../core/maybe.js";import{eachAlways as u,isAbortError as d,throwIfAborted as f}from"../core/promiseUtils.js";import{watch as p,initial as m,when as h}from"../core/reactiveUtils.js";import{throttle as g}from"../core/throttle.js";import _ from"../geometry/Point.js";import v from"../geometry/SpatialReference.js";import y from"../Graphic.js";import{system as b}from"../time/constants.js";import{ActionsCollection as x,createDefaultAggregateActions as S,createDefaultActions as C}from"./actions.js";import w from"./content/TextContent.js";import{compileExpressionInfos as T,formatArcadeValue as E}from"./support/arcadeFeatureUtils.js";import D from"./support/FeatureAbilities.js";import{preLayerQueryCallback as O,preRequestCallback as k,getPopupLayer as A,createFieldInfoMap as j,getAllFieldInfos as M,querySourceLayer as N,queryUpdatedFeature as P,isRelatableFeatureSupportedLayer as F,isAssociatedFeatureSupportedLayer as I,formatEditInfo as L,substituteFieldsInLinksAndAttributes as R,graphicCallback as z,formatAttributes as B,isRelatedField as V}from"./support/featureUtils.js";import{queryLayerInfos as H,queryRelatedFeatures as U,setRelatedFeatures as W,getRelatedFieldInfo as G,createRelatedInfo as K,updateRelatedInfo as q}from"./support/relatedFeatureUtils.js";var J;let Y=class extends s(n){static{J=this}constructor(e){super(e),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._graphicExpressionAttributes=null,this.abilities=new D,this.content=null,this.description=null,this.actions=new x,this.includeDefaultActions=!1,this.defaultPopupTemplateEnabled=!1,this.expressionAttributes=null,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.heading=``,this.view=null,this._graphicChangedThrottled=g(this._graphicChanged,()=>{this._evaluateExpressionAttributesThrottled.remove(),this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._graphicChangedTask=l(this._graphicChangedTask),this.notifyChange(`waitingForContent`)},1,this),this._isAllowedContentType=e=>{let{abilities:t}=this;return e.type===`attachments`&&!!t.attachmentsContent||e.type===`custom`&&!!t.customContent||e.type===`fields`&&!!t.fieldsContent||e.type===`media`&&!!t.mediaContent||e.type===`text`&&!!t.textContent||e.type===`expression`&&!!t.expressionContent||e.type===`relationship`&&!!t.relationshipContent||e.type===`utility-network-associations`&&!!t.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=g(this._evaluateExpressionAttributes,()=>this.notifyChange(`waitingForContent`),1,this),this.addHandles([p(()=>[this._effectivePopupTemplate,this.abilities.attachmentsContent,this.abilities.chartAnimation,this.abilities.customContent,this.abilities.expressionContent,this.abilities.fieldsContent,this.abilities.mediaContent,this.abilities.relationshipContent,this.abilities.textContent,this.abilities.utilityNetworkAssociationsContent,this.graphic,this.timeZone],()=>this._graphicChangedThrottled(),m),h(()=>{if(!this._graphicChangedTask?.finished||this._graphicChangedTask.value==null)return null;let e=this._graphicChangedTask.value,t=e?.expressionInfos?.dependencies;return[e,t?.has(`view-scale`)?this.view?.scale:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.start:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.end:null]},([e])=>this._evaluateExpressionAttributesThrottled(e))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=l(this._graphicChangedTask),this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this.relatedInfos.clear()}static{this.interceptor=new t(O,k)}get _effectivePopupTemplate(){return this.graphic?.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled)??null}get _fieldInfoMap(){let e=A(this.graphic);return j(M(this._effectivePopupTemplate),e)}get defaultActions(){let e=this._get(`defaultActions`)||new x;return e.removeAll(),e.addMany(this.graphic?.isAggregate?S():C()),e}get allActions(){let e=this._get(`allActions`)||new x,{actions:t,defaultPopupTemplateEnabled:n,includeDefaultActions:r,graphic:i}=this,o=[];if(i){let e=r?this.defaultActions.concat(t):t,s=typeof i.getEffectivePopupTemplate==`function`&&i.getEffectivePopupTemplate(n)||i.popupTemplate,c=s?.actions;o=(s?.overwriteActions?c:c?.concat(e)??e)?.filter(a).toArray()??[]}let s=e.toArray();return(s.length!==o.length||s.some((e,t)=>e!==o[t]))&&(e.removeAll(),e.addMany(o)),e}get isFeatureFromTable(){return A(this.graphic)?.isTable??!1}get state(){return this.graphic?this._error?`error`:this.waitingForContent?`loading`:`ready`:`disabled`}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get timeZone(){return this.view?.timeZone??b}set timeZone(e){this._overrideIfSome(`timeZone`,e)}get map(){return this.view?.map||null}set map(e){this._override(`map`,e)}get waitingForContent(){let{_graphicChangedThrottled:e,_evaluateExpressionAttributesThrottled:t,_graphicChangedTask:n,_evaluateExpressionAttributesTask:r}=this;return e.hasPendingUpdates()||t.hasPendingUpdates()||n!=null&&!n.finished||r!=null&&!r.finished}async updateGeometry(){let{graphic:e,spatialReference:t}=this,n=A(e);await n?.load();let r=n?.objectIdField;if(!r||!e)return;let i=e.attributes?.[r];if(i==null)return;let a=(await N({layer:n,graphic:e,outFields:[],objectIds:[i],returnGeometry:!0,spatialReference:t}))?.geometry;a&&(e.geometry=a)}_clear(){this._set(`heading`,``),this._set(`content`,null),this._set(`formattedAttributes`,null),this._set(`expressionAttributes`,null)}_graphicChanged(){this._graphicChangedTask=o(async e=>{this._error=null;let{graphic:t}=this;try{if(!t)return this._clear(),null;let{_effectivePopupTemplate:n}=this,r=A(t),i=this.spatialReference;await P({graphic:t,popupTemplate:n,layer:r,spatialReference:i},{signal:e});let[{value:a},{value:o}]=await u([this._getContent(),this._getTitle()]),[,{value:s}]=await u([this._checkForRelatedFeatures({signal:e}),T(n?.expressionInfos,t)]);return{expressionInfos:s,content:a,heading:o}}catch(n){throw!d(n)&&!e.aborted&&(this._clear(),this._error=n,c.getLogger(this).error(`error`,`The popupTemplate could not be displayed for this feature.`,{error:n,graphic:t,popupTemplate:this._effectivePopupTemplate})),n}})}_compileContentElement(e){let t=A(this.graphic);return e.type===`relationship`?F(t)?e:void 0:e.type===`utility-network-associations`?I(t)?e:void 0:e}_compileContent(e){if(this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map(e=>this._compileContentElement(e)).filter(a):typeof e==`string`?new w({text:e}).text:e}_compileLastEditInfo(){let{_effectivePopupTemplate:e,graphic:t,timeZone:n}=this,r=A(t);if(!e)return;let{lastEditInfoEnabled:i}=e,a=r?.editFieldsInfo;if(i&&a)return L(a,t?.attributes,n,r)}_compileHeading(e){let{_fieldInfoMap:t,graphic:n,expressionAttributes:r}=this,i=A(n),a=n?.attributes??{},o=this.formattedAttributes?.global??{};return R({attributes:a,fieldInfoMap:t,globalAttributes:o,expressionAttributes:r,layer:i,text:e})}async _getTitle(){let{_effectivePopupTemplate:e,graphic:t}=this;return t?z({type:`title`,value:e?.title,event:{graphic:t}}):null}async _getContent(){let{_effectivePopupTemplate:e,graphic:t}=this;return t?z({type:`content`,value:e?.content,event:{graphic:t}}):null}_evaluateExpressionAttributes({heading:e,content:t,expressionInfos:n}){this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=o(async r=>{let{graphic:i,map:a,view:o,spatialReference:s,location:l}=this;try{if(!i)return;let c;if(n!=null){let e=[];for(let[t,c]of n.expressions.entries())c==null?e.push(Promise.resolve([t,void 0])):e.push(c.evaluate({graphic:i,interceptor:J.interceptor,location:l,map:a,options:{signal:r},spatialReference:s,view:o}).then(e=>[t,typeof e==`string`?E(e):e]).catch(()=>[t,void 0]));c=Object.fromEntries(await Promise.all(e)),f(r)}this._set(`expressionAttributes`,c??null),this._graphicExpressionAttributes={...i.attributes,...c},this._set(`formattedAttributes`,this._createFormattedAttributes(t)),this._set(`heading`,this._compileHeading(e)),this._set(`lastEditInfo`,this._compileLastEditInfo()||null),this._set(`content`,this._compileContent(t)||null)}catch(e){!d(e)&&!r.aborted&&(this._clear(),this._error=e,c.getLogger(this).error(`error`,`The popupTemplate could not be displayed for this feature.`,{error:e,graphic:i,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:n}){let{_effectivePopupTemplate:r,graphic:i,relatedInfos:a,_fieldInfoMap:o,_graphicExpressionAttributes:s,timeZone:c}=this,l=A(i);n.content[t]=B({attributes:{...s,...e.attributes},fieldInfoMap:o,fieldInfos:r?.fieldInfos,graphic:i,layer:l,relatedInfos:a,timeZone:c})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:n}){if(e.fieldInfos){let{graphic:r,relatedInfos:i,_fieldInfoMap:a,_graphicExpressionAttributes:o,timeZone:s}=this,c=A(r);n.content[t]=B({attributes:{...o,...e.attributes},fieldInfoMap:a,fieldInfos:e.fieldInfos,graphic:r,isContentFieldInfos:!0,layer:c,relatedInfos:i,timeZone:s})}}_createFormattedAttributes(e){let{_effectivePopupTemplate:t,graphic:n,relatedInfos:r,_fieldInfoMap:i,_graphicExpressionAttributes:a,timeZone:o}=this,s=A(n),c=t?.fieldInfos,l={global:B({attributes:a,fieldInfoMap:i,fieldInfos:c,graphic:n,layer:s,relatedInfos:r,timeZone:o}),content:[]};return Array.isArray(e)&&e.forEach((e,t)=>{e.type===`fields`&&this._createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:l}),e.type===`media`&&this._createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:l})}),l}_checkForRelatedFeatures(e){let{graphic:t,_effectivePopupTemplate:n}=this;return this._queryRelatedInfos(t,M(n),e)}async _queryRelatedInfos(e,t,n){let{relatedInfos:r}=this,i=A(e);r.clear();let a=await i?.associatedLayer?.load(n)??i;if(!a||!e||!t.filter(e=>!!e.fieldName&&V(e.fieldName))?.length)return;t.forEach(e=>this._configureRelatedInfo(e,a));let o=await H({relatedInfos:r,layer:a},n);Object.keys(o).forEach(e=>{let t=r.get(e.toString()),n=o[e]?.value;t&&n&&(t.layerInfo=n.data)});let s=await U({graphic:e,relatedInfos:r,layer:a},n);Object.keys(s).forEach(e=>{W(s[e]?.value,r.get(e.toString()))})}_configureRelatedInfo(e,t){let{relatedInfos:n}=this,r=G(e.fieldName||``);if(!r)return;let{layerId:i,fieldName:a}=r;if(!i)return;let o=n.get(i.toString())||K(i,t);o&&(q({relatedInfo:o,fieldName:a,fieldInfo:e}),this.relatedInfos.set(i,o))}};e([r()],Y.prototype,`_error`,void 0),e([r()],Y.prototype,`_graphicChangedTask`,void 0),e([r()],Y.prototype,`_evaluateExpressionAttributesTask`,void 0),e([r({readOnly:!0})],Y.prototype,`_effectivePopupTemplate`,null),e([r({readOnly:!0})],Y.prototype,`_fieldInfoMap`,null),e([r({type:D})],Y.prototype,`abilities`,void 0),e([r({readOnly:!0})],Y.prototype,`content`,void 0),e([r()],Y.prototype,`description`,void 0),e([r({type:x,readOnly:!0})],Y.prototype,`defaultActions`,null),e([r({type:x})],Y.prototype,`actions`,void 0),e([r()],Y.prototype,`includeDefaultActions`,void 0),e([r({type:x,readOnly:!0})],Y.prototype,`allActions`,null),e([r({type:Boolean})],Y.prototype,`defaultPopupTemplateEnabled`,void 0),e([r({readOnly:!0})],Y.prototype,`expressionAttributes`,void 0),e([r({readOnly:!0})],Y.prototype,`isFeatureFromTable`,null),e([r({readOnly:!0})],Y.prototype,`state`,null),e([r({readOnly:!0})],Y.prototype,`formattedAttributes`,void 0),e([r({type:y})],Y.prototype,`graphic`,void 0),e([r({readOnly:!0})],Y.prototype,`lastEditInfo`,void 0),e([r({type:_})],Y.prototype,`location`,void 0),e([r({readOnly:!0})],Y.prototype,`relatedInfos`,void 0),e([r({type:v})],Y.prototype,`spatialReference`,null),e([r()],Y.prototype,`timeZone`,null),e([r({readOnly:!0})],Y.prototype,`heading`,void 0),e([r()],Y.prototype,`map`,null),e([r({readOnly:!0})],Y.prototype,`waitingForContent`,null),e([r()],Y.prototype,`view`,void 0),Y=J=e([i(`esri.popup.FeatureModel`)],Y);const X=Y;export{X as default};
2
+ import{__decorate as e}from"tslib";import{FeatureSetQueryInterceptor as t}from"../arcade/featureset/support/FeatureSetQueryInterceptor.js";import n from"../core/Accessor.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import{isSome as a}from"../core/arrayUtils.js";import{createTask as o}from"../core/asyncUtils.js";import{IdentifiableMixin as s}from"../core/Identifiable.js";import c from"../core/Logger.js";import{abortMaybe as l}from"../core/maybe.js";import{eachAlways as u,isAbortError as d,throwIfAborted as f}from"../core/promiseUtils.js";import{watch as p,initial as m,when as h}from"../core/reactiveUtils.js";import{throttle as g}from"../core/throttle.js";import _ from"../geometry/Point.js";import v from"../geometry/SpatialReference.js";import y from"../Graphic.js";import{system as b}from"../time/constants.js";import{ActionsCollection as x,createDefaultAggregateActions as S,createDefaultActions as C}from"./actions.js";import w from"./content/TextContent.js";import{compileExpressionInfos as T,formatArcadeValue as E}from"./support/arcadeFeatureUtils.js";import D from"./support/FeatureAbilities.js";import{preLayerQueryCallback as O,preRequestCallback as k,getPopupLayer as A,createFieldInfoMap as j,getAllFieldInfos as M,querySourceLayer as N,queryUpdatedFeature as P,isRelatableFeatureSupportedLayer as F,isAssociatedFeatureSupportedLayer as I,formatEditInfo as L,substituteFieldsInLinksAndAttributes as R,graphicCallback as z,formatAttributes as B,isRelatedField as V}from"./support/featureUtils.js";import{queryLayerInfos as H,queryRelatedFeatures as U,setRelatedFeatures as W,getRelatedFieldInfo as G,createRelatedInfo as K,updateRelatedInfo as q}from"./support/relatedFeatureUtils.js";var J;let Y=class extends s(n){static{J=this}constructor(e){super(e),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._graphicExpressionAttributes=null,this.abilities=new D,this.content=null,this.description=null,this.actions=new x,this.includeDefaultActions=!1,this.defaultPopupTemplateEnabled=!1,this.expressionAttributes=null,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.heading=``,this.view=null,this._graphicChangedThrottled=g(this._graphicChanged,()=>{this._evaluateExpressionAttributesThrottled.remove(),this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._graphicChangedTask=l(this._graphicChangedTask),this.notifyChange(`waitingForContent`)},1,this),this._isAllowedContentType=e=>{let{abilities:t}=this;return e.type===`attachments`&&!!t.attachmentsContent||e.type===`custom`&&!!t.customContent||e.type===`fields`&&!!t.fieldsContent||e.type===`media`&&!!t.mediaContent||e.type===`text`&&!!t.textContent||e.type===`expression`&&!!t.expressionContent||e.type===`relationship`&&!!t.relationshipContent||e.type===`utility-network-associations`&&!!t.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=g(this._evaluateExpressionAttributes,()=>this.notifyChange(`waitingForContent`),1,this),this.addHandles([p(()=>[this._effectivePopupTemplate,this.abilities.attachmentsContent,this.abilities.chartAnimation,this.abilities.customContent,this.abilities.expressionContent,this.abilities.fieldsContent,this.abilities.mediaContent,this.abilities.relationshipContent,this.abilities.textContent,this.abilities.utilityNetworkAssociationsContent,this.graphic,this.timeZone],()=>this._graphicChangedThrottled(),m),h(()=>{if(!this._graphicChangedTask?.finished||this._graphicChangedTask.value==null)return null;let e=this._graphicChangedTask.value,t=e?.expressionInfos?.dependencies;return[e,t?.has(`view-scale`)?this.view?.scale:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.start:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.end:null]},([e])=>this._evaluateExpressionAttributesThrottled(e))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=l(this._graphicChangedTask),this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this.relatedInfos.clear()}static{this.interceptor=new t(O,k)}get _effectivePopupTemplate(){return this.graphic?.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled)??null}get _fieldInfoMap(){let e=A(this.graphic);return j(M(this._effectivePopupTemplate),e)}get defaultActions(){let e=this._get(`defaultActions`)||new x;return e.removeAll(),e.addMany(this.graphic?.isAggregate?S():C()),e}get allActions(){let e=this._get(`allActions`)||new x,{actions:t,defaultPopupTemplateEnabled:n,includeDefaultActions:r,graphic:i}=this,o=[];if(i){let e=r?this.defaultActions.concat(t):t,s=typeof i.getEffectivePopupTemplate==`function`&&i.getEffectivePopupTemplate(n)||i.popupTemplate,c=s?.actions;o=(s?.overwriteActions?c:c?.concat(e)??e)?.filter(a).toArray()??[]}let s=e.toArray();return(s.length!==o.length||s.some((e,t)=>e!==o[t]))&&(e.removeAll(),e.addMany(o)),e}get isFeatureFromTable(){return A(this.graphic)?.isTable??!1}get state(){return this.graphic?this._error?`error`:this.waitingForContent?`loading`:`ready`:`disabled`}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get timeZone(){return this.view?.timeZone??b}set timeZone(e){this._overrideIfSome(`timeZone`,e)}get map(){return this.view?.map||null}set map(e){this._override(`map`,e)}get waitingForContent(){let{_graphicChangedThrottled:e,_evaluateExpressionAttributesThrottled:t,_graphicChangedTask:n,_evaluateExpressionAttributesTask:r}=this;return e.hasPendingUpdates()||t.hasPendingUpdates()||n!=null&&!n.finished||r!=null&&!r.finished}async updateGeometry(){let{graphic:e,spatialReference:t}=this,n=A(e);await n?.load();let r=n?.objectIdField;if(!r||!e)return;let i=e.attributes?.[r];if(i==null)return;let a=(await N({layer:n,graphic:e,outFields:[],objectIds:[i],returnGeometry:!0,spatialReference:t}))?.geometry;a&&(e.geometry=a)}_clear(){this._set(`heading`,``),this._set(`content`,null),this._set(`formattedAttributes`,null),this._set(`expressionAttributes`,null)}_graphicChanged(){this._graphicChangedTask=o(async e=>{this._error=null;let{graphic:t}=this;try{if(!t)return this._clear(),null;let{_effectivePopupTemplate:n}=this,r=A(t),i=this.spatialReference;await P({graphic:t,popupTemplate:n,layer:r,spatialReference:i},{signal:e});let[{value:a},{value:o}]=await u([this._getContent(),this._getTitle()]),[,{value:s}]=await u([this._checkForRelatedFeatures({signal:e}),T(n?.expressionInfos,t)]);return{expressionInfos:s,content:a,heading:o}}catch(n){throw!d(n)&&!e.aborted&&(this._clear(),this._error=n,c.getLogger(this).error(`error`,`The popupTemplate could not be displayed for this feature.`,{error:n,graphic:t,popupTemplate:this._effectivePopupTemplate})),n}})}_compileContentElement(e){let t=A(this.graphic);return e.type===`relationship`?F(t)?e:void 0:e.type===`utility-network-associations`?I(t)?e:void 0:e}_compileContent(e){if(this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map(e=>this._compileContentElement(e)).filter(a):typeof e==`string`?new w({text:e}).text:e}_compileLastEditInfo(){let{_effectivePopupTemplate:e,graphic:t,timeZone:n}=this,r=A(t);if(!e)return;let{lastEditInfoEnabled:i}=e,a=r?.editFieldsInfo;if(i&&a)return L(a,t?.attributes,n,r)}_compileHeading(e){let{_fieldInfoMap:t,graphic:n,expressionAttributes:r}=this,i=A(n),a=n?.attributes??{},o=this.formattedAttributes?.global??{};return R({attributes:a,fieldInfoMap:t,globalAttributes:o,expressionAttributes:r,layer:i,text:e})}async _getTitle(){let{_effectivePopupTemplate:e,graphic:t}=this;return t?z({type:`title`,value:e?.title,event:{graphic:t}}):null}async _getContent(){let{_effectivePopupTemplate:e,graphic:t}=this;return t?z({type:`content`,value:e?.content,event:{graphic:t}}):null}_evaluateExpressionAttributes({heading:e,content:t,expressionInfos:n}){this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=o(async r=>{let{graphic:i,map:a,view:o,spatialReference:s,location:l}=this;try{if(!i)return;let c;if(n!=null){let e=[];for(let[t,c]of n.expressions.entries())c==null?e.push(Promise.resolve([t,void 0])):e.push(c.evaluate({graphic:i,interceptor:J.interceptor,location:l,map:a,options:{signal:r},spatialReference:s,view:o}).then(e=>[t,typeof e==`string`?E(e):e]).catch(()=>[t,void 0]));c=Object.fromEntries(await Promise.all(e)),f(r)}this._set(`expressionAttributes`,c??null),this._graphicExpressionAttributes={...i.attributes,...c},this._set(`formattedAttributes`,this._createFormattedAttributes(t)),this._set(`heading`,this._compileHeading(e)),this._set(`lastEditInfo`,this._compileLastEditInfo()||null),this._set(`content`,this._compileContent(t)||null)}catch(e){!d(e)&&!r.aborted&&(this._clear(),this._error=e,c.getLogger(this).error(`error`,`The popupTemplate could not be displayed for this feature.`,{error:e,graphic:i,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:n}){let{_effectivePopupTemplate:r,graphic:i,relatedInfos:a,_fieldInfoMap:o,_graphicExpressionAttributes:s,timeZone:c}=this,l=A(i);n.content[t]=B({attributes:{...s,...e.attributes},fieldInfoMap:o,fieldInfos:r?.fieldInfos,graphic:i,layer:l,relatedInfos:a,timeZone:c})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:n}){if(e.fieldInfos){let{graphic:r,relatedInfos:i,_fieldInfoMap:a,_graphicExpressionAttributes:o,timeZone:s}=this,c=A(r);n.content[t]=B({attributes:{...o,...e.attributes},fieldInfoMap:a,fieldInfos:e.fieldInfos,graphic:r,isContentFieldInfos:!0,layer:c,relatedInfos:i,timeZone:s})}}_createFormattedAttributes(e){let{_effectivePopupTemplate:t,graphic:n,relatedInfos:r,_fieldInfoMap:i,_graphicExpressionAttributes:a,timeZone:o}=this,s=A(n),c=t?.fieldInfos,l={global:B({attributes:a,fieldInfoMap:i,fieldInfos:c,graphic:n,layer:s,relatedInfos:r,timeZone:o}),content:[]};return Array.isArray(e)&&e.forEach((e,t)=>{e.type===`fields`&&this._createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:l}),e.type===`media`&&this._createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:l})}),l}_checkForRelatedFeatures(e){let{graphic:t,_effectivePopupTemplate:n}=this;return this._queryRelatedInfos(t,M(n),e)}async _queryRelatedInfos(e,t,n){let{relatedInfos:r}=this,i=A(e);r.clear();let a=await i?.associatedLayer?.load(n)??i;if(!a||!e||!t.filter(e=>!!e.fieldName&&V(e.fieldName))?.length)return;t.forEach(e=>this._configureRelatedInfo(e,a));let o=await H({relatedInfos:r,layer:a},n);Object.keys(o).forEach(e=>{let t=r.get(e.toString()),n=o[e]?.value;t&&n&&(t.layerInfo=n.data)});let s=await U({graphic:e,relatedInfos:r,layer:a},n);Object.keys(s).forEach(e=>{W(s[e]?.value,r.get(e.toString()))})}_configureRelatedInfo(e,t){let{relatedInfos:n}=this,r=G(e.fieldName||``);if(!r)return;let{layerId:i,fieldName:a}=r;if(!i)return;let o=n.get(i.toString())||K(i,t);o&&(q({relatedInfo:o,fieldName:a,fieldInfo:e}),this.relatedInfos.set(i,o))}};e([r()],Y.prototype,`_error`,void 0),e([r()],Y.prototype,`_graphicChangedTask`,void 0),e([r()],Y.prototype,`_evaluateExpressionAttributesTask`,void 0),e([r({readOnly:!0})],Y.prototype,`_effectivePopupTemplate`,null),e([r({readOnly:!0})],Y.prototype,`_fieldInfoMap`,null),e([r({type:D})],Y.prototype,`abilities`,void 0),e([r({readOnly:!0})],Y.prototype,`content`,void 0),e([r()],Y.prototype,`description`,void 0),e([r({readOnly:!0})],Y.prototype,`defaultActions`,null),e([r({type:x})],Y.prototype,`actions`,void 0),e([r()],Y.prototype,`includeDefaultActions`,void 0),e([r({readOnly:!0})],Y.prototype,`allActions`,null),e([r({type:Boolean})],Y.prototype,`defaultPopupTemplateEnabled`,void 0),e([r({readOnly:!0})],Y.prototype,`expressionAttributes`,void 0),e([r({readOnly:!0})],Y.prototype,`isFeatureFromTable`,null),e([r({readOnly:!0})],Y.prototype,`state`,null),e([r({readOnly:!0})],Y.prototype,`formattedAttributes`,void 0),e([r({type:y})],Y.prototype,`graphic`,void 0),e([r({readOnly:!0})],Y.prototype,`lastEditInfo`,void 0),e([r({type:_})],Y.prototype,`location`,void 0),e([r({readOnly:!0})],Y.prototype,`relatedInfos`,void 0),e([r({type:v})],Y.prototype,`spatialReference`,null),e([r()],Y.prototype,`timeZone`,null),e([r({readOnly:!0})],Y.prototype,`heading`,void 0),e([r()],Y.prototype,`map`,null),e([r({readOnly:!0})],Y.prototype,`waitingForContent`,null),e([r()],Y.prototype,`view`,void 0),Y=J=e([i(`esri.popup.FeatureModel`)],Y);const X=Y;export{X as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../core/accessorSupport/decorators.js";import r from"../core/Error.js";import{EventedAccessor as i}from"../core/Evented.js";import a from"../core/Logger.js";import{abortMaybe as o}from"../core/maybe.js";import{debounce as s,isAbortError as c,logOnError as l}from"../core/promiseUtils.js";import{watch as u,when as d}from"../core/reactiveUtils.js";import{throttle as f}from"../core/throttle.js";import p from"../geometry/Point.js";import{project as m}from"../geometry/projectionUtils.js";import h from"../geometry/SpatialReference.js";import{geographicToWebMercator as g}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as _}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as v}from"../layers/LayerConstants.js";import{getDisplayedSymbol as y}from"../symbols/support/symbolUtils.js";import{system as b}from"../time/constants.js";import{highlightsSupported as x}from"../views/support/layerViewUtils.js";import{GoTo as S}from"../widgets/support/GoTo.js";import{ActionsCollection as C,createDefaultActions as w}from"./actions.js";import{getSelectedTarget as T}from"./actionUtils.js";import E from"./FeatureModel.js";import D from"./support/FeatureAbilities.js";import{getHighlightLayer as O,getHighlightLayerView as k}from"./support/featureUtils.js";const A=Symbol(`feature-stream-flush`);let j=null;function M(e,t){switch(e){case`building-scene`:case`map-image`:case`tile`:case`imagery`:return!0;case`imagery-tile`:return t===`2d`;default:return!1}}let N=class extends S(i){constructor(e){super(e),this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new D,this._emptyActions=new C,this._activeFeatureStream=null,this._featureStreamHasYielded=!1,this.actions=new C,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.diagnostics=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureModels=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=s(async()=>{this._cancelLocationUpdate();let e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([u(()=>this.view?.scale,()=>{this.open&&l(this._debouncedLocationUpdate(),a.getLogger(this))}),u(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),u(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),u(()=>this.location,e=>this._locationChange(e)),u(()=>!!this.view?.focusRegionVisible,()=>{this._initialDisplayMode===void 0&&this._syncSelectedFeatureIndex(this.features)}),u(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),u(()=>[this.featurePage,this.selectedFeatureIndex,this.featuresPerPage,this.featureMenuOpen,this.open,this.initialDisplayMode,this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.actions,this.defaultPopupTemplateEnabled,this.includeDefaultActions,this.features,this.map,this.spatialReference,this.timeZone],(e,t)=>this._updateFeatureModels(t?.[1]??-1),{initial:!0}),d(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this._destroyFeatureModels(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get defaultActions(){let e=this._get(`defaultActions`)||new C;return e.removeAll(),e.addMany(this.selectedFeatureItem?.defaultActions.toArray()??w()),e}get allActions(){let e=this.selectedFeatureItem;return e?e.allActions:(this._emptyActions.removeAll(),this._emptyActions)}get active(){return this.open&&!this.waitingForResult}set content(e){this.featureStream=null,this._set(`diagnostics`,null),this.features=[],this._set(`content`,e)}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}get featurePage(){return this._get(`featurePage`)}set featurePage(e){e==null?this.featureCount||this._set(`featurePage`,null):!Number.isInteger(e)||e<1||e>Math.ceil(this.featureCount/this.featuresPerPage)||e!==1&&e!==(this.featurePage??0)+1||this._set(`featurePage`,e)}set features(e){if(this._get(`features`)===e)return;let t=e||[];this._set(`features`,t),this._activeFeatureStream&&t.length&&this.featurePage!=null||(this.featurePage=t.length?1:null),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get(`featureStream`)||null}set featureStream(e){this._setFeatureStream(e)}_setFeatureStream(e,t,n){this._set(`diagnostics`,n??null),this._get(`featureStream`)!==e&&(this._set(`featureStream`,e),this._cancelFeatureStream(),e&&(this._featureStreamHasYielded=!1,this._set(`pendingLocation`,t??null),this._activeFeatureStream=e,this._consumeFeatureStream(e,t).catch(()=>{})))}get initialDisplayMode(){return this._initialDisplayMode??(this.view?.focusRegionVisible?`list`:`feature`)}set initialDisplayMode(e){this._initialDisplayMode=e,this._syncSelectedFeatureIndex(this.features)}set location(e){let t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?g(e):e;this._set(`location`,t)}get map(){return this.view?.map??null}set map(e){this._override(`map`,e)}get pendingLocation(){return this._get(`pendingLocation`)??null}get streamingFeatures(){return this._activeFeatureStream!=null}get selectedFeature(){return this.selectedFeatureIndex===-1?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){let e=this._get(`selectedFeatureIndex`);return typeof e==`number`?e:-1}set selectedFeatureIndex(e){let{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set(`selectedFeatureIndex`,e)}get selectedFeatureItem(){return this.featureModels[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get state(){return this.view?this.view.ready?`ready`:`disabled`:this.map?`ready`:`disabled`}get timeZone(){return this.view?.timeZone??b}set timeZone(e){this._overrideIfSome(`timeZone`,e)}get waitingForContents(){return this.featureModels.some(e=>e.waitingForContent)}get waitingForResult(){return this.streamingFeatures&&!this._featureStreamHasYielded}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this._set(`diagnostics`,null),this.set({featureStream:null,features:[],content:null,heading:null,location:null,activeFeature:null})}openFeatureStream(e){this._setFeatureStream(e.featureStream,e.location??null,e.diagnostics),this.open=!0}async fetchFeatures(e,t){let{view:n}=this;if(!n||!e)throw new r(`fetch-features:invalid-screenpoint-or-view`,`Cannot fetch features without a screen point/screen area and view.`,{screenPoint:e,view:n});let i={},a=n.fetchPopupFeatures(e,{diagnostics:i,pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal});this._setFeatureStream(a,void 0,i)}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){let{selectedFeatureIndex:t}=this,n=this._activeFeatureStream!=null&&e.length>0;this.initialDisplayMode===`list`?n||(this.selectedFeatureIndex=-1):n&&t===-1?this.selectedFeatureIndex=0:n&&t!==-1||(this.selectedFeatureIndex=e.length?0:-1)}_centerAtLocation(){let{view:e}=this,t=T(this);this._cancelCenterAtLocation();let n=new AbortController,{signal:i}=n;return this._centerAtLocationController=n,!t||!e?Promise.reject(new r(`center-at-location:invalid-target-or-view`,`Cannot center at a location without a target and view.`,{target:t,view:e})):this.callGoTo({target:{target:t,scale:e.scale},options:{signal:i}}).catch(e=>{c(e)||a.getLogger(this).error(e)})}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){let{selectedFeature:t,updateLocationEnabled:n,view:r}=this;r&&!this._locationUpdateController&&n&&e&&(!t||t.geometry)&&this._centerAtLocation()}async _selectedFeatureChange(e){let{location:t,updateLocationEnabled:n,view:r}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!r)return;let i=_(e)?.type;if((i===`map-image`||i===`imagery`||i===`imagery-tile`)&&(e.symbol=await y(e)),(n||!t)&&e.geometry){if(e.geometry.type===`point`){this.location=e.geometry;return}let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);this.location=t(e.geometry)}else if(n&&!e.geometry){await this._centerAtLocation();let e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.featureStream&&(this.open=!1)}_destroyFeatureModels(){this.featureModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set(`featureModels`,[])}_reconcileFeatureModels(e,t){let n=[],r=new Map;if(this.featureModels.forEach((t,i)=>{let a=t?.graphic;if(!a||t.destroyed)t.destroy();else if(e[i]===a)n[i]=t;else{let e=r.get(a);e?e.push(t):r.set(a,[t])}}),!r.size)return n;for(let e of r.values())e.reverse();for(let t=0;t<e.length&&r.size;t++){if(n[t])continue;let i=e[t],a=r.get(i);a&&(n[t]=a.pop(),a.length||r.delete(i))}let i=this.selectedFeatureIndex,a=e[i],o=this.featureModels[t],s=null;for(let e of r.values())for(let t of e)t===o?s=t:t.destroy();return s&&(a&&!n[i]?(s.graphic=a,n[i]=s):s.destroy()),n}_updateFeatureModels(e){let{selectedFeature:t,features:n}=this;if(!n.length){this._destroyFeatureModels();return}let r={abilities:this.featureItemAbilities??this._defaultFeatureAbilities,actions:this.actions,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,includeDefaultActions:this.includeDefaultActions,spatialReference:this.spatialReference,location:this.location,map:this.map,view:this.view,timeZone:this.timeZone},i=this._reconcileFeatureModels(n,e);i.forEach(e=>e.set(r));let a=e=>{let t=n[e];t&&!i[e]&&(i[e]=new E({...r,graphic:t}))};if(t&&a(this.selectedFeatureIndex),(this.featurePage??0)>1||this.open&&(this.featureMenuOpen||this.initialDisplayMode===`list`)){let e=Math.min((this.featurePage??0)*this.featuresPerPage,n.length);for(let t=0;t<e;t++)a(t)}this._set(`featureModels`,i)}_cancelCenterAtLocation(){this._centerAtLocationController=o(this._centerAtLocationController)}_cancelFeatureStream(){this.removeHandles(A);let e=this._activeFeatureStream;this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._get(`featureStream`)===e&&this._set(`featureStream`,null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){let{spatialReference:t}=this,n=this.selectedFeature,r=n?.geometry?.type,i=this.location;if(r&&r!==`mesh`&&t&&i&&n){if(r===`point`){let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);if(e?.signal?.aborted||this.selectedFeature!==n||!n.geometry)return;this.location=t(n.geometry)}else try{let r=n.geometry,a=this._getHighlightLayer(n),o=n.getObjectId();if(!a||!this.view)return;if(o!=null){let n=this.view?.allLayerViews.find(e=>e.layer.uid===a.uid);if(!n||!(`queryFeatures`in n))return;let i=n.createQuery();i.outSpatialReference=t,i.objectIds=[o],i.returnGeometry=!0;let{features:s}=await n.queryFeatures(i,e);if(e?.signal?.aborted)return;r=s[0]?.geometry}if(!r||r.type===`mesh`)return;r=m(r,t),j??=await Promise.all([import(`../geometry/operators/intersectsOperator.js`),import(`../geometry/operators/proximityOperator.js`)]);let[{intersectsExecute:s},{proximityGetNearestCoordinate:c}]=j;if(!s(r,i)){let e=c(r,i).coordinate??i;this.selectedFeature===n&&(this.location=e)}}catch(e){c(e)||a.getLogger(this).error(e)}}}_cancelLocationUpdate(){this._locationUpdateController=o(this._locationUpdateController)}_getHighlightLayer(e){return O(e,this.map)}_getHighlightTarget(e,t,n){if(M(t.type,n))return e;let r=e.getObjectId();if(r!=null)return r;let i=t.type===`imagery`?void 0:`objectIdField`in t?t.objectIdField||v:null,a=e.attributes;return a&&i&&a[i]||e}async _highlightFeature(e,t){this.removeHandles(e);let n=this[t];if(!n)return;let{highlightEnabled:r,view:i,open:a}=this;if(!i||!r||!a)return;let o=this._getHighlightLayer(n);if(!o)return;let s=k(i,o,this.map);if(!s)return;this._highlightPromises[e]=s;let c=await s;if(!c||!x(c)||this._highlightPromises[e]!==s||!this[t]||!this.highlightEnabled)return;let l=c.highlight(this._getHighlightTarget(n,o,i.type));this.addHandles(l,e)}async _highlightActiveFeature(){return this._highlightFeature(`highlight-active-feature`,`activeFeature`)}async _highlightSelectedFeature(){return this._highlightFeature(`highlight-selected-feature`,`selectedFeature`)}async _consumeFeatureStream(e,t){if(e!==this._activeFeatureStream)return;let n=[],r=f(()=>{let t=n;n=[],e===this._activeFeatureStream&&t.length&&this._addFeatures(t)},16);this.addHandles({remove:()=>{r.remove(),n=[]}},A);try{for await(let i of e){if(e!==this._activeFeatureStream)return;let a=!this._featureStreamHasYielded;a&&(this.features=[]),t!==void 0&&(this.location=t,t=void 0),this._set(`pendingLocation`,null),a?(this._addFeatures([i]),e===this._activeFeatureStream&&(this._featureStreamHasYielded=!0)):(n.push(i),r())}}finally{this._activeFeatureStream===e&&r.forceUpdate(),this._activeFeatureStream===e&&(this.removeHandles(A),this._featureStreamHasYielded||(this.features=[]),this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._waitingForResultChange())}}_addFeatures(e){let{features:t}=this,n=new Set(t),r=e.filter(e=>!n.has(e)&&(n.add(e),!0));r.length&&(this.features=t.concat(r))}};e([t()],N.prototype,`_initialDisplayMode`,void 0),e([t()],N.prototype,`_activeFeatureStream`,void 0),e([t()],N.prototype,`_featureStreamHasYielded`,void 0),e([t({type:C})],N.prototype,`actions`,void 0),e([t({type:C,readOnly:!0})],N.prototype,`defaultActions`,null),e([t({type:C,readOnly:!0})],N.prototype,`allActions`,null),e([t({readOnly:!0})],N.prototype,`active`,null),e([t()],N.prototype,`activeFeature`,void 0),e([t()],N.prototype,`aggregatedFeaturesEnabled`,void 0),e([t({value:null})],N.prototype,`content`,null),e([t({type:Boolean})],N.prototype,`defaultPopupTemplateEnabled`,void 0),e([t({readOnly:!0})],N.prototype,`diagnostics`,void 0),e([t({readOnly:!0})],N.prototype,`effectiveHeading`,null),e([t({readOnly:!0})],N.prototype,`featureCount`,null),e([t({value:null})],N.prototype,`featurePage`,null),e([t({value:[]})],N.prototype,`features`,null),e([t()],N.prototype,`featureStream`,null),e([t()],N.prototype,`featuresPerPage`,void 0),e([t()],N.prototype,`featureMenuOpen`,void 0),e([t({type:D})],N.prototype,`featureItemAbilities`,void 0),e([t({readOnly:!0})],N.prototype,`featureModels`,void 0),e([t()],N.prototype,`heading`,void 0),e([t()],N.prototype,`highlightEnabled`,void 0),e([t()],N.prototype,`includeDefaultActions`,void 0),e([t()],N.prototype,`initialDisplayMode`,null),e([t({type:p})],N.prototype,`location`,null),e([t()],N.prototype,`map`,null),e([t()],N.prototype,`open`,void 0),e([t({readOnly:!0})],N.prototype,`pendingLocation`,null),e([t({readOnly:!0})],N.prototype,`streamingFeatures`,null),e([t({value:null,readOnly:!0})],N.prototype,`selectedFeature`,null),e([t({value:-1})],N.prototype,`selectedFeatureIndex`,null),e([t({readOnly:!0})],N.prototype,`selectedFeatureItem`,null),e([t({type:h})],N.prototype,`spatialReference`,null),e([t({readOnly:!0})],N.prototype,`state`,null),e([t()],N.prototype,`timeZone`,null),e([t()],N.prototype,`updateLocationEnabled`,void 0),e([t()],N.prototype,`view`,void 0),e([t({readOnly:!0})],N.prototype,`waitingForContents`,null),e([t({readOnly:!0})],N.prototype,`waitingForResult`,null),e([t()],N.prototype,`zoomFactor`,void 0),N=e([n(`esri.popup.FeaturesModel`)],N);const P=N;export{P as default};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../core/accessorSupport/decorators.js";import r from"../core/Error.js";import{EventedAccessor as i}from"../core/Evented.js";import a from"../core/Logger.js";import{abortMaybe as o}from"../core/maybe.js";import{debounce as s,isAbortError as c,logOnError as l}from"../core/promiseUtils.js";import{watch as u,when as d}from"../core/reactiveUtils.js";import{throttle as f}from"../core/throttle.js";import p from"../geometry/Point.js";import{project as m}from"../geometry/projectionUtils.js";import h from"../geometry/SpatialReference.js";import{geographicToWebMercator as g}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as _}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as v}from"../layers/LayerConstants.js";import{getDisplayedSymbol as y}from"../symbols/support/symbolUtils.js";import{system as b}from"../time/constants.js";import{highlightsSupported as x}from"../views/support/layerViewUtils.js";import{GoTo as S}from"../widgets/support/GoTo.js";import{ActionsCollection as C,createDefaultActions as w}from"./actions.js";import{getSelectedTarget as T}from"./actionUtils.js";import E from"./FeatureModel.js";import D from"./support/FeatureAbilities.js";import{getHighlightLayer as O,getHighlightLayerView as k}from"./support/featureUtils.js";const A=Symbol(`feature-stream-flush`);let j=null;function M(e,t){switch(e){case`building-scene`:case`map-image`:case`tile`:case`imagery`:return!0;case`imagery-tile`:return t===`2d`;default:return!1}}let N=class extends S(i){constructor(e){super(e),this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new D,this._emptyActions=new C,this._activeFeatureStream=null,this._featureStreamHasYielded=!1,this.actions=new C,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.diagnostics=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureModels=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=s(async()=>{this._cancelLocationUpdate();let e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([u(()=>this.view?.scale,()=>{this.open&&l(this._debouncedLocationUpdate(),a.getLogger(this))}),u(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),u(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),u(()=>this.location,e=>this._locationChange(e)),u(()=>!!this.view?.focusRegionVisible,()=>{this._initialDisplayMode===void 0&&this._syncSelectedFeatureIndex(this.features)}),u(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),u(()=>[this.featurePage,this.selectedFeatureIndex,this.featuresPerPage,this.featureMenuOpen,this.open,this.initialDisplayMode,this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.actions,this.defaultPopupTemplateEnabled,this.includeDefaultActions,this.features,this.map,this.spatialReference,this.timeZone],(e,t)=>this._updateFeatureModels(t?.[1]??-1),{initial:!0}),d(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this._destroyFeatureModels(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get defaultActions(){let e=this._get(`defaultActions`)||new C;return e.removeAll(),e.addMany(this.selectedFeatureItem?.defaultActions.toArray()??w()),e}get allActions(){let e=this.selectedFeatureItem;return e?e.allActions:(this._emptyActions.removeAll(),this._emptyActions)}get active(){return this.open&&!this.waitingForResult}set content(e){this.featureStream=null,this._set(`diagnostics`,null),this.features=[],this._set(`content`,e)}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}get featurePage(){return this._get(`featurePage`)}set featurePage(e){e==null?this.featureCount||this._set(`featurePage`,null):!Number.isInteger(e)||e<1||e>Math.ceil(this.featureCount/this.featuresPerPage)||e!==1&&e!==(this.featurePage??0)+1||this._set(`featurePage`,e)}set features(e){if(this._get(`features`)===e)return;let t=e||[];this._set(`features`,t),this._activeFeatureStream&&t.length&&this.featurePage!=null||(this.featurePage=t.length?1:null),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get(`featureStream`)||null}set featureStream(e){this._setFeatureStream(e)}_setFeatureStream(e,t,n){this._set(`diagnostics`,n??null),this._get(`featureStream`)!==e&&(this._set(`featureStream`,e),this._cancelFeatureStream(),e&&(this._featureStreamHasYielded=!1,this._set(`pendingLocation`,t??null),this._activeFeatureStream=e,this._consumeFeatureStream(e,t).catch(()=>{})))}get initialDisplayMode(){return this._initialDisplayMode??(this.view?.focusRegionVisible?`list`:`feature`)}set initialDisplayMode(e){this._initialDisplayMode=e,this._syncSelectedFeatureIndex(this.features)}set location(e){let t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?g(e):e;this._set(`location`,t)}get map(){return this.view?.map??null}set map(e){this._override(`map`,e)}get pendingLocation(){return this._get(`pendingLocation`)??null}get streamingFeatures(){return this._activeFeatureStream!=null}get selectedFeature(){return this.selectedFeatureIndex===-1?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){let e=this._get(`selectedFeatureIndex`);return typeof e==`number`?e:-1}set selectedFeatureIndex(e){let{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set(`selectedFeatureIndex`,e)}get selectedFeatureItem(){return this.featureModels[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get state(){return this.view?this.view.ready?`ready`:`disabled`:this.map?`ready`:`disabled`}get timeZone(){return this.view?.timeZone??b}set timeZone(e){this._overrideIfSome(`timeZone`,e)}get waitingForContents(){return this.featureModels.some(e=>e.waitingForContent)}get waitingForResult(){return this.streamingFeatures&&!this._featureStreamHasYielded}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this._set(`diagnostics`,null),this.set({featureStream:null,features:[],content:null,heading:null,location:null,activeFeature:null})}openFeatureStream(e){this._setFeatureStream(e.featureStream,e.location??null,e.diagnostics),this.open=!0}async fetchFeatures(e,t){let{view:n}=this;if(!n||!e)throw new r(`fetch-features:invalid-screenpoint-or-view`,`Cannot fetch features without a screen point/screen area and view.`,{screenPoint:e,view:n});let i={},a=n.fetchPopupFeatures(e,{diagnostics:i,pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal});this._setFeatureStream(a,void 0,i)}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){let{selectedFeatureIndex:t}=this,n=this._activeFeatureStream!=null&&e.length>0;this.initialDisplayMode===`list`?n||(this.selectedFeatureIndex=-1):n&&t===-1?this.selectedFeatureIndex=0:n&&t!==-1||(this.selectedFeatureIndex=e.length?0:-1)}_centerAtLocation(){let{view:e}=this,t=T(this);this._cancelCenterAtLocation();let n=new AbortController,{signal:i}=n;return this._centerAtLocationController=n,!t||!e?Promise.reject(new r(`center-at-location:invalid-target-or-view`,`Cannot center at a location without a target and view.`,{target:t,view:e})):this.callGoTo({target:{target:t,scale:e.scale},options:{signal:i}}).catch(e=>{c(e)||a.getLogger(this).error(e)})}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){let{selectedFeature:t,updateLocationEnabled:n,view:r}=this;r&&!this._locationUpdateController&&n&&e&&(!t||t.geometry)&&this._centerAtLocation()}async _selectedFeatureChange(e){let{location:t,updateLocationEnabled:n,view:r}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!r)return;let i=_(e)?.type;if((i===`map-image`||i===`imagery`||i===`imagery-tile`)&&(e.symbol=await y(e)),(n||!t)&&e.geometry){if(e.geometry.type===`point`){this.location=e.geometry;return}let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);this.location=t(e.geometry)}else if(n&&!e.geometry){await this._centerAtLocation();let e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.featureStream&&(this.open=!1)}_destroyFeatureModels(){this.featureModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set(`featureModels`,[])}_reconcileFeatureModels(e,t){let n=[],r=new Map;if(this.featureModels.forEach((t,i)=>{let a=t?.graphic;if(!a||t.destroyed)t.destroy();else if(e[i]===a)n[i]=t;else{let e=r.get(a);e?e.push(t):r.set(a,[t])}}),!r.size)return n;for(let e of r.values())e.reverse();for(let t=0;t<e.length&&r.size;t++){if(n[t])continue;let i=e[t],a=r.get(i);a&&(n[t]=a.pop(),a.length||r.delete(i))}let i=this.selectedFeatureIndex,a=e[i],o=this.featureModels[t],s=null;for(let e of r.values())for(let t of e)t===o?s=t:t.destroy();return s&&(a&&!n[i]?(s.graphic=a,n[i]=s):s.destroy()),n}_updateFeatureModels(e){let{selectedFeature:t,features:n}=this;if(!n.length){this._destroyFeatureModels();return}let r={abilities:this.featureItemAbilities??this._defaultFeatureAbilities,actions:this.actions,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,includeDefaultActions:this.includeDefaultActions,spatialReference:this.spatialReference,location:this.location,map:this.map,view:this.view,timeZone:this.timeZone},i=this._reconcileFeatureModels(n,e);i.forEach(e=>e.set(r));let a=e=>{let t=n[e];t&&!i[e]&&(i[e]=new E({...r,graphic:t}))};if(t&&a(this.selectedFeatureIndex),(this.featurePage??0)>1||this.open&&(this.featureMenuOpen||this.initialDisplayMode===`list`)){let e=Math.min((this.featurePage??0)*this.featuresPerPage,n.length);for(let t=0;t<e;t++)a(t)}this._set(`featureModels`,i)}_cancelCenterAtLocation(){this._centerAtLocationController=o(this._centerAtLocationController)}_cancelFeatureStream(){this.removeHandles(A);let e=this._activeFeatureStream;this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._get(`featureStream`)===e&&this._set(`featureStream`,null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){let{spatialReference:t}=this,n=this.selectedFeature,r=n?.geometry?.type,i=this.location;if(r&&r!==`mesh`&&t&&i&&n){if(r===`point`){let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);if(e?.signal?.aborted||this.selectedFeature!==n||!n.geometry)return;this.location=t(n.geometry)}else try{let r=n.geometry,a=this._getHighlightLayer(n),o=n.getObjectId();if(!a||!this.view)return;if(o!=null){let n=this.view?.allLayerViews.find(e=>e.layer.uid===a.uid);if(!n||!(`queryFeatures`in n))return;let i=n.createQuery();i.outSpatialReference=t,i.objectIds=[o],i.returnGeometry=!0;let{features:s}=await n.queryFeatures(i,e);if(e?.signal?.aborted)return;r=s[0]?.geometry}if(!r||r.type===`mesh`)return;r=m(r,t),j??=await Promise.all([import(`../geometry/operators/intersectsOperator.js`),import(`../geometry/operators/proximityOperator.js`)]);let[{intersectsExecute:s},{proximityGetNearestCoordinate:c}]=j;if(!s(r,i)){let e=c(r,i).coordinate??i;this.selectedFeature===n&&(this.location=e)}}catch(e){c(e)||a.getLogger(this).error(e)}}}_cancelLocationUpdate(){this._locationUpdateController=o(this._locationUpdateController)}_getHighlightLayer(e){return O(e,this.map)}_getHighlightTarget(e,t,n){if(M(t.type,n))return e;let r=e.getObjectId();if(r!=null)return r;let i=t.type===`imagery`?void 0:`objectIdField`in t?t.objectIdField||v:null,a=e.attributes;return a&&i&&a[i]||e}async _highlightFeature(e,t){this.removeHandles(e);let n=this[t];if(!n)return;let{highlightEnabled:r,view:i,open:a}=this;if(!i||!r||!a)return;let o=this._getHighlightLayer(n);if(!o)return;let s=k(i,o,this.map);if(!s)return;this._highlightPromises[e]=s;let c=await s;if(!c||!x(c)||this._highlightPromises[e]!==s||!this[t]||!this.highlightEnabled)return;let l=c.highlight(this._getHighlightTarget(n,o,i.type));this.addHandles(l,e)}async _highlightActiveFeature(){return this._highlightFeature(`highlight-active-feature`,`activeFeature`)}async _highlightSelectedFeature(){return this._highlightFeature(`highlight-selected-feature`,`selectedFeature`)}async _consumeFeatureStream(e,t){if(e!==this._activeFeatureStream)return;let n=[],r=f(()=>{let t=n;n=[],e===this._activeFeatureStream&&t.length&&this._addFeatures(t)},16);this.addHandles({remove:()=>{r.remove(),n=[]}},A);try{for await(let i of e){if(e!==this._activeFeatureStream)return;let a=!this._featureStreamHasYielded;a&&(this.features=[]),t!==void 0&&(this.location=t,t=void 0),this._set(`pendingLocation`,null),a?(this._addFeatures([i]),e===this._activeFeatureStream&&(this._featureStreamHasYielded=!0)):(n.push(i),r())}}finally{this._activeFeatureStream===e&&r.forceUpdate(),this._activeFeatureStream===e&&(this.removeHandles(A),this._featureStreamHasYielded||(this.features=[]),this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._waitingForResultChange())}}_addFeatures(e){let{features:t}=this,n=new Set(t),r=e.filter(e=>!n.has(e)&&(n.add(e),!0));r.length&&(this.features=t.concat(r))}};e([t()],N.prototype,`_initialDisplayMode`,void 0),e([t()],N.prototype,`_activeFeatureStream`,void 0),e([t()],N.prototype,`_featureStreamHasYielded`,void 0),e([t({type:C})],N.prototype,`actions`,void 0),e([t({readOnly:!0})],N.prototype,`defaultActions`,null),e([t({readOnly:!0})],N.prototype,`allActions`,null),e([t({readOnly:!0})],N.prototype,`active`,null),e([t()],N.prototype,`activeFeature`,void 0),e([t()],N.prototype,`aggregatedFeaturesEnabled`,void 0),e([t({value:null})],N.prototype,`content`,null),e([t({type:Boolean})],N.prototype,`defaultPopupTemplateEnabled`,void 0),e([t({readOnly:!0})],N.prototype,`diagnostics`,void 0),e([t({readOnly:!0})],N.prototype,`effectiveHeading`,null),e([t({readOnly:!0})],N.prototype,`featureCount`,null),e([t({value:null})],N.prototype,`featurePage`,null),e([t({value:[]})],N.prototype,`features`,null),e([t()],N.prototype,`featureStream`,null),e([t()],N.prototype,`featuresPerPage`,void 0),e([t()],N.prototype,`featureMenuOpen`,void 0),e([t({type:D})],N.prototype,`featureItemAbilities`,void 0),e([t({readOnly:!0})],N.prototype,`featureModels`,void 0),e([t()],N.prototype,`heading`,void 0),e([t()],N.prototype,`highlightEnabled`,void 0),e([t()],N.prototype,`includeDefaultActions`,void 0),e([t()],N.prototype,`initialDisplayMode`,null),e([t({type:p})],N.prototype,`location`,null),e([t()],N.prototype,`map`,null),e([t()],N.prototype,`open`,void 0),e([t({readOnly:!0})],N.prototype,`pendingLocation`,null),e([t({readOnly:!0})],N.prototype,`streamingFeatures`,null),e([t({value:null,readOnly:!0})],N.prototype,`selectedFeature`,null),e([t({value:-1})],N.prototype,`selectedFeatureIndex`,null),e([t({readOnly:!0})],N.prototype,`selectedFeatureItem`,null),e([t({type:h})],N.prototype,`spatialReference`,null),e([t({readOnly:!0})],N.prototype,`state`,null),e([t()],N.prototype,`timeZone`,null),e([t()],N.prototype,`updateLocationEnabled`,void 0),e([t()],N.prototype,`view`,void 0),e([t({readOnly:!0})],N.prototype,`waitingForContents`,null),e([t({readOnly:!0})],N.prototype,`waitingForResult`,null),e([t()],N.prototype,`zoomFactor`,void 0),N=e([n(`esri.popup.FeaturesModel`)],N);const P=N;export{P as default};
@@ -24,7 +24,7 @@ import type { SpatialReferenceProperties } from "../../geometry/SpatialReference
24
24
  import type { StatisticDefinitionProperties } from "./StatisticDefinition.js";
25
25
  import type { TimeExtentProperties } from "../../time/TimeExtent.js";
26
26
 
27
- export interface AttributeBinsQueryProperties extends Partial<Pick<AttributeBinsQuery, "binOrder" | "cacheHint" | "datumTransformation" | "distance" | "lowerBoundaryAlias" | "outTimeZone" | "returnDistinctValues" | "spatialRelationship" | "units" | "upperBoundaryAlias" | "where">> {
27
+ export interface AttributeBinsQueryProperties extends Partial<Pick<AttributeBinsQuery, "binOrder" | "cacheHint" | "datumTransformation" | "distance" | "lowerBoundaryAlias" | "outTimeZone" | "returnDistinctValues" | "returnStatisticsAggregatedIds" | "spatialRelationship" | "units" | "upperBoundaryAlias" | "where">> {
28
28
  /**
29
29
  * Bin parameters describe the characteristics of the bins, including their size and starting value. Each bin's size can either be specified by a parameter
30
30
  * or calculated dynamically. Additionally, bins can be based on either date or numeric values.
@@ -238,6 +238,46 @@ export default class AttributeBinsQuery extends AttributeBinsQuerySuperclass {
238
238
  * @default false
239
239
  */
240
240
  accessor returnDistinctValues: boolean | null | undefined;
241
+ /**
242
+ * If `true`, the object IDs of the features contributing to each attribute bin returned by
243
+ * `queryAttributeBins()` are included in the [statisticsAggregatedIds](https://developers.arcgis.com/javascript/latest/references/core/AttributeBinsGraphic/#statisticsAggregatedIds) property of the
244
+ * corresponding [AttributeBinsGraphic](https://developers.arcgis.com/javascript/latest/references/core/AttributeBinsGraphic/).
245
+ *
246
+ * Bins are defined by [binParameters](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsQuery/#binParameters). For example, when grouping trees by height range, each bin includes the IDs
247
+ * of the trees within that range.
248
+ *
249
+ * @see [AttributeBinsGraphic.statisticsAggregatedIds](https://developers.arcgis.com/javascript/latest/references/core/AttributeBinsGraphic/#statisticsAggregatedIds)
250
+ * @since 6.0
251
+ * @internal
252
+ * @example
253
+ * // Count trees in each height range and return the IDs of those trees
254
+ * const query = new AttributeBinsQuery({
255
+ * binParameters: new FixedIntervalBinParameters({
256
+ * field: "HEIGHT",
257
+ * start: 0,
258
+ * end: 30,
259
+ * interval: 10
260
+ * }),
261
+ * outStatistics: [{
262
+ * onStatisticField: layer.objectIdField,
263
+ * outStatisticFieldName: "treeCount",
264
+ * statisticType: "count"
265
+ * }],
266
+ * returnStatisticsAggregatedIds: true
267
+ * });
268
+ *
269
+ * const result = await layer.queryAttributeBins(query);
270
+ *
271
+ * for (const bin of result.features) {
272
+ * console.log(
273
+ * bin.attributes.lowerBoundary,
274
+ * bin.attributes.upperBoundary,
275
+ * bin.attributes.treeCount,
276
+ * bin.statisticsAggregatedIds
277
+ * );
278
+ * }
279
+ */
280
+ accessor returnStatisticsAggregatedIds: boolean | undefined;
241
281
  /**
242
282
  * For spatial queries, this parameter defines the spatial relationship to query features in the layer or layer view against the input [Query.geometry](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#geometry).
243
283
  * The spatial relationships discover how features are spatially related to each other.
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{ensureType as r}from"../../core/accessorSupport/ensureType.js";import{ClonableMixin as i}from"../../core/Clonable.js";import{JSONMap as a}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import s from"../../core/Logger.js";import c from"../../geometry/SpatialReference.js";import{fromJSON as l}from"../../geometry/support/jsonUtils.js";import{geometryTypes as u}from"../../geometry/support/typeUtils.js";import{unitsKebabDict as d}from"../../layers/graphics/data/queryUtils.js";import f from"../../time/TimeExtent.js";import{isTimeZoneValid as p}from"../../time/timeZoneUtils.js";import m from"./AutoIntervalBinParameters.js";import h from"./BinParametersBase.js";import g from"./DateBinParameters.js";import _ from"./FixedBoundariesBinParameters.js";import v from"./FixedIntervalBinParameters.js";import{spatialRelKebabDict as y}from"./spatialRelationships.js";import b from"./StatisticDefinition.js";import{enumeration as x}from"../../core/accessorSupport/decorators/enumeration.js";const S=new a({asc:`ascending`,desc:`descending`}),C={base:h,key:`type`,typeMap:{"auto-interval":m,date:g,"fixed-boundaries":_,"fixed-interval":v}};let w=class extends i(o){constructor(e){super(e),this.binParameters=null,this.binOrder=`ascending`,this.cacheHint=void 0,this.datumTransformation=null,this.defaultSpatialReference=null,this.distance=void 0,this.geometry=null,this.lowerBoundaryAlias=null,this.outSpatialReference=null,this.outStatistics=null,this.returnDistinctValues=null,this.spatialRelationship=`intersects`,this.timeExtent=null,this.upperBoundaryAlias=null,this.units=null,this.where=`1=1`}set outTimeZone(e){this._set(`outTimeZone`,e),e&&!p(e)&&s.getLogger(this).warn(`#outTimeZone`,`the parsed value '${e}' may not be a valid IANA time zone`)}};e([t({types:C,json:{name:`bin`,write:!0}})],w.prototype,`binParameters`,void 0),e([x(S)],w.prototype,`binOrder`,void 0),e([t({type:Boolean,json:{write:!0}})],w.prototype,`cacheHint`,void 0),e([t({json:{write:!0}})],w.prototype,`datumTransformation`,void 0),e([t({type:c,json:{name:`defaultSR`,write:!0}})],w.prototype,`defaultSpatialReference`,void 0),e([t({type:Number,json:{write:{overridePolicy(e){return{enabled:e>0}}}}})],w.prototype,`distance`,void 0),e([t({types:u,json:{read:l,write:!0}})],w.prototype,`geometry`,void 0),e([t({type:String,json:{write:!0}})],w.prototype,`lowerBoundaryAlias`,void 0),e([t({type:c,json:{name:`outSR`,write:!0}})],w.prototype,`outSpatialReference`,void 0),e([t({type:[b],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],w.prototype,`outStatistics`,void 0),e([t({value:null,json:{name:`outTimeReference`,read:{reader:e=>e.ianaTimeZone},write:{writer:(e,t,n)=>{e&&(t[n]={ianaTimeZone:e})}}}})],w.prototype,`outTimeZone`,null),e([t({type:Boolean,json:{name:`returnAggIds`,write:{overridePolicy(e){return{enabled:e!=null}}}}})],w.prototype,`returnAggregateIds`,void 0),e([t({type:Boolean,json:{write:!0}})],w.prototype,`returnDistinctValues`,void 0),e([x(y,{name:`spatialRel`})],w.prototype,`spatialRelationship`,void 0),e([t({type:f,json:{write:!0}})],w.prototype,`timeExtent`,void 0),e([t({type:String,json:{write:!0}})],w.prototype,`upperBoundaryAlias`,void 0),e([t({type:String,json:{read:d.read,write:{writer:d.write,overridePolicy(e){return{enabled:e!=null&&!!this.distance}}}}})],w.prototype,`units`,void 0),e([t({type:String,json:{write:!0}})],w.prototype,`where`,void 0),w=e([n(`esri.rest.support.AttributeBinsQuery`)],w),w.from=r(w);export{w as default};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{ensureType as r}from"../../core/accessorSupport/ensureType.js";import{ClonableMixin as i}from"../../core/Clonable.js";import{JSONMap as a}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import s from"../../core/Logger.js";import c from"../../geometry/SpatialReference.js";import{fromJSON as l}from"../../geometry/support/jsonUtils.js";import{geometryTypes as u}from"../../geometry/support/typeUtils.js";import{unitsKebabDict as d}from"../../layers/graphics/data/queryUtils.js";import f from"../../time/TimeExtent.js";import{isTimeZoneValid as p}from"../../time/timeZoneUtils.js";import m from"./AutoIntervalBinParameters.js";import h from"./BinParametersBase.js";import g from"./DateBinParameters.js";import _ from"./FixedBoundariesBinParameters.js";import v from"./FixedIntervalBinParameters.js";import{spatialRelKebabDict as y}from"./spatialRelationships.js";import b from"./StatisticDefinition.js";import{enumeration as x}from"../../core/accessorSupport/decorators/enumeration.js";const S=new a({asc:`ascending`,desc:`descending`}),C={base:h,key:`type`,typeMap:{"auto-interval":m,date:g,"fixed-boundaries":_,"fixed-interval":v}};let w=class extends i(o){constructor(e){super(e),this.binParameters=null,this.binOrder=`ascending`,this.cacheHint=void 0,this.datumTransformation=null,this.defaultSpatialReference=null,this.distance=void 0,this.geometry=null,this.lowerBoundaryAlias=null,this.outSpatialReference=null,this.outStatistics=null,this.returnDistinctValues=null,this.spatialRelationship=`intersects`,this.timeExtent=null,this.upperBoundaryAlias=null,this.units=null,this.where=`1=1`}set outTimeZone(e){this._set(`outTimeZone`,e),e&&!p(e)&&s.getLogger(this).warn(`#outTimeZone`,`the parsed value '${e}' may not be a valid IANA time zone`)}};e([t({types:C,json:{name:`bin`,write:!0}})],w.prototype,`binParameters`,void 0),e([x(S)],w.prototype,`binOrder`,void 0),e([t({type:Boolean,json:{write:!0}})],w.prototype,`cacheHint`,void 0),e([t({json:{write:!0}})],w.prototype,`datumTransformation`,void 0),e([t({type:c,json:{name:`defaultSR`,write:!0}})],w.prototype,`defaultSpatialReference`,void 0),e([t({type:Number,json:{write:{overridePolicy(e){return{enabled:e>0}}}}})],w.prototype,`distance`,void 0),e([t({types:u,json:{read:l,write:!0}})],w.prototype,`geometry`,void 0),e([t({type:String,json:{write:!0}})],w.prototype,`lowerBoundaryAlias`,void 0),e([t({type:c,json:{name:`outSR`,write:!0}})],w.prototype,`outSpatialReference`,void 0),e([t({type:[b],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],w.prototype,`outStatistics`,void 0),e([t({value:null,json:{name:`outTimeReference`,read:{reader:e=>e.ianaTimeZone},write:{writer:(e,t,n)=>{e&&(t[n]={ianaTimeZone:e})}}}})],w.prototype,`outTimeZone`,null),e([t({type:Boolean,json:{name:`returnAggIds`,write:{overridePolicy(e){return{enabled:e!=null}}}}})],w.prototype,`returnStatisticsAggregatedIds`,void 0),e([t({type:Boolean,json:{write:!0}})],w.prototype,`returnDistinctValues`,void 0),e([x(y,{name:`spatialRel`})],w.prototype,`spatialRelationship`,void 0),e([t({type:f,json:{write:!0}})],w.prototype,`timeExtent`,void 0),e([t({type:String,json:{write:!0}})],w.prototype,`upperBoundaryAlias`,void 0),e([t({type:String,json:{read:d.read,write:{writer:d.write,overridePolicy(e){return{enabled:e!=null&&!!this.distance}}}}})],w.prototype,`units`,void 0),e([t({type:String,json:{write:!0}})],w.prototype,`where`,void 0),w=e([n(`esri.rest.support.AttributeBinsQuery`)],w),w.from=r(w);export{w as default};
@@ -877,10 +877,9 @@ export default class Query extends JSONSupport {
877
877
  * @see [Graphic.statisticsAggregatedIds](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#statisticsAggregatedIds)
878
878
  * @internal
879
879
  * @since 5.1
880
- * @internal
881
880
  * @example
882
881
  * // query for the count of trees in each park and include the IDs of
883
- * // the trees contributing to each count. The aggregateIds can then be
882
+ * // the trees contributing to each count. The statisticsAggregatedIds can then be
884
883
  * // used to query for the individual tree features or further inspect the trees
885
884
  * if (layer.capabilities.query.supportsStatisticsAggregatedIds) {
886
885
  * const query = new Query({
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../core/Error.js";import t from"../../../request.js";import{parseUrl as n,asValidOptions as r,encode as i}from"../../utils.js";import{addServerVersion as a}from"./serverVersionUtils.js";import o from"./support/PostResult.js";const s=new Map;async function c(c,l,u,d){if(s.has(c)||await a(s,c),(s.get(c)?.serverVersion??0)<=11.1)throw new e(`post:enterprise-version`,`versioning API requires ArcGIS Enterprise version 11.2 or higher`);if(!l)throw new e(`post:missing-guid`,`guid for version is missing`);let f=n(c),p=u.toJSON();u.rows&&(p.rows=JSON.stringify(u.rows));let m=r(f.query,{query:i({...p,f:`json`}),...d,method:`post`});l.startsWith(`{`)&&(l=l.slice(1,-1));let h=`${f.path}/versions/${l}/post`,{data:g}=await t(h,m);return o.fromJSON(g)}export{c as post,s as serverVersionCacheMap};
2
+ import e from"../../../core/Error.js";import{normalizeQueryParams as t}from"../../../core/urlUtils.js";import n from"../../../request.js";import{asValidOptions as r,encode as i,parseUrl as a}from"../../utils.js";import{addServerVersion as o}from"./serverVersionUtils.js";import s from"./support/PostResult.js";const c=new Map;async function l(e,t,a,o){let{path:c,query:l}=await f(e,t),u=r(l,{query:i({...d(a),f:`json`}),...o,method:`post`}),{data:p}=await n(c,u);return s.fromJSON(p)}async function u(a,o,s,c){let{path:l,query:u}=await f(a,o,c),p=r(u,{...c,query:{...t(c?.query),...i({...d(s),f:`json`,async:!0})},method:`post`}),{data:m}=await n(l,p);if(!m?.statusUrl)throw new e(`post:missing-status-url`,`The post job did not return a status URL.`);return m.statusUrl}function d(e){let t=e.toJSON();return e.rows&&(t.rows=JSON.stringify(e.rows)),t}async function f(t,n,r){if(c.has(t)||await o(c,t,r),(c.get(t)?.serverVersion??0)<=11.1)throw new e(`post:enterprise-version`,`versioning API requires ArcGIS Enterprise version 11.2 or higher`);if(!n)throw new e(`post:missing-guid`,`guid for version is missing`);n.startsWith(`{`)&&(n=n.slice(1,-1));let i=a(t);return{...i,path:`${i.path}/versions/${n}/post`}}export{l as post,c as serverVersionCacheMap,u as submitPostJob};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../core/Error.js";import t from"../../../request.js";import{parseUrl as n,asValidOptions as r,encode as i}from"../../utils.js";import{addServerVersion as a}from"./serverVersionUtils.js";import o from"./support/ReconcileResult.js";const s=new Map;async function c(c,l,u,d){if(s.has(c)||await a(s,c),(s.get(c)?.serverVersion??0)<=11.1)throw new e(`reconcile:enterprise-version`,`versioning API requires ArcGIS Enterprise version 11.2 or higher`);if(!l)throw new e(`reconcile:missing-guid`,`guid for version is missing`);let f=n(c),p=u.toJSON(),m=r(f.query,{query:i({...p,f:`json`}),...d,method:`post`});l.startsWith(`{`)&&(l=l.slice(1,-1));let h=`${f.path}/versions/${l}/reconcile`,{data:g}=await t(h,m);return o.fromJSON(g)}export{c as reconcile,s as serverVersionCacheMap};
2
+ import e from"../../../core/Error.js";import{normalizeQueryParams as t}from"../../../core/urlUtils.js";import n from"../../../request.js";import{asValidOptions as r,encode as i,parseUrl as a}from"../../utils.js";import{addServerVersion as o}from"./serverVersionUtils.js";import s from"./support/ReconcileResult.js";const c=new Map;async function l(e,t,a,o){let{path:c,query:l}=await d(e,t),u=r(l,{query:i({...a.toJSON(),f:`json`}),...o,method:`post`}),{data:f}=await n(c,u);return s.fromJSON(f)}async function u(a,o,s,c){let{path:l,query:u}=await d(a,o,c),f=r(u,{...c,query:{...t(c?.query),...i({...s.toJSON(),f:`json`,async:!0})},method:`post`}),{data:p}=await n(l,f);if(!p?.statusUrl)throw new e(`reconcile:missing-status-url`,`The reconcile job did not return a status URL.`);return p.statusUrl}async function d(t,n,r){if(c.has(t)||await o(c,t,r),(c.get(t)?.serverVersion??0)<=11.1)throw new e(`reconcile:enterprise-version`,`versioning API requires ArcGIS Enterprise version 11.2 or higher`);if(!n)throw new e(`reconcile:missing-guid`,`guid for version is missing`);n.startsWith(`{`)&&(n=n.slice(1,-1));let i=a(t);return{...i,path:`${i.path}/versions/${n}/reconcile`}}export{l as reconcile,c as serverVersionCacheMap,u as submitReconcileJob};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../request.js";async function t(t,n){let r=null,i=typeof n==`string`?n:n.path;if(!t.has(i)){let a=await e(i.replace(/\/VersionManagementServer/i,`/FeatureServer`),{query:{f:`json`}});r={serverVersion:Number(a.data.currentVersion),featureServerUrl:i.replace(/\/VersionManagementServer/i,`/FeatureServer`)},t.set(n,r)}}export{t as addServerVersion};
2
+ import e from"../../../request.js";async function t(t,n,r){let i=null,a=typeof n==`string`?n:n.path;if(!t.has(a)){let{authMode:o,headers:s,signal:c,timeout:l,useProxy:u}=r??{},d=await e(a.replace(/\/VersionManagementServer/i,`/FeatureServer`),{authMode:o,headers:s,query:{f:`json`},signal:c,timeout:l,useProxy:u});i={serverVersion:Number(d.data.currentVersion),featureServerUrl:a.replace(/\/VersionManagementServer/i,`/FeatureServer`)},t.set(n,i)}}export{t as addServerVersion};
@@ -24,7 +24,7 @@ export default class PostResult extends JSONSupport {
24
24
  get moment(): Date | null | undefined;
25
25
  set moment(value: (Date | number | string) | null | undefined);
26
26
  /**
27
- * Specifies if the post rest call was successful.
27
+ * Indicates whether the post operation succeeded.
28
28
  *
29
29
  * @default false
30
30
  * @since 5.0
@@ -38,7 +38,7 @@ export default class ReconcileResult extends JSONSupport {
38
38
  get moment(): Date | null | undefined;
39
39
  set moment(value: (Date | number | string) | null | undefined);
40
40
  /**
41
- * Specifies if the reconcile rest call was successful.
41
+ * Indicates whether the reconcile operation succeeded.
42
42
  *
43
43
  * @default false
44
44
  * @since 5.0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../core/Error.js";import{isTimeOnlyField as t,numericTypes as n}from"../../layers/support/fieldUtils.js";import{defaultSupportedLayerTypes as r,binningCapableLayerTypes as i,createLayerAdapter as a,getLayerTypeLabels as o}from"../support/adapters/support/layerUtils.js";import{verifyBinningParams as s}from"../support/binningUtils.js";import{getNormalizationType as c,getFieldsList as l,isAnyDateField as u,dateTypes as d}from"../support/utils.js";import{verifyBasicFieldValidity as f,verifyFieldType as p,verifyFilterValidity as m}from"./support/utils.js";const h=[...d,`time-only`,...n];async function g(d){if(!(d?.layer&&(d.field||d.fields?.length||d.valueExpression||d.sqlExpression)))throw new e(`histogram:missing-parameters`,`'layer' and 'field', 'fields', 'valueExpression' or 'sqlExpression' parameters are required`);if(d.valueExpression&&!d.sqlExpression&&!d.view)throw new e(`histogram:missing-parameters`,`View is required when 'valueExpression' is specified`);d.forBinning&&s(d,`histogram`);let{layer:g,..._}=d,v=[...r,0,4,7],y=d.forBinning?i:v,b=a(g,y,d.forBinning);if(!b)throw new e(`histogram:invalid-parameters`,`'layer' must be one of these types: `+o(y).join(`, `));let x={layerAdapter:b,..._};x.normalizationType=c(x);let S=x.signal==null?null:{signal:x.signal};await b.load(S);let C=await l({field:x.field,normalizationField:x.normalizationField,valueExpression:x.valueExpression,fields:x.fields}),w=f(b,C,`histogram:invalid-parameters`);if(w)throw w;let T=!x.classificationMethod||x.classificationMethod===`equal-interval`;if(x.fields?.length){let t=x.fields;if(t.length<2)throw new e(`histogram:invalid-parameters`,`'fields' must contain at least 2 fields if specified.`);if(x.normalizationType||x.valueExpression||x.field)throw new e(`histogram:invalid-parameters`,`Normalization, 'field', 'valueExpression' are not allowed when 'fields' is specified.`);let r=new Set;for(let e of t){let t=b.getField(e),i=p(b,t,`histogram:invalid-parameters`,n);if(i)throw i;r.add(t.type)}if(r.size>1)throw new e(`histogram:invalid-parameters`,`All fields must be of the same type when 'fields' is specified.`);if(!T)throw new e(`histogram:invalid-parameters`,`'classificationMethod' other than 'equal-interval' is not allowed when 'fields' is specified`)}else if(x.valueExpression||x.sqlExpression){if(x.normalizationType)throw new e(`histogram:invalid-parameters`,`Normalization is not allowed when 'valueExpression' or 'sqlExpression' is specified`);if(!T)throw new e(`histogram:invalid-parameters`,`'classificationMethod' other than 'equal-interval' is not allowed when 'valueExpression' or 'sqlExpression' is specified`)}else if(x.field){let n=b.getField(x.field),r=p(b,n,`histogram:invalid-parameters`,h);if(r)throw r;if(u(n)||t(n)){if(x.normalizationType)throw new e(`histogram:invalid-parameters`,`Normalization is not allowed for date fields`);if(!T)throw new e(`histogram:invalid-parameters`,`'classificationMethod' other than 'equal-interval' is not allowed for date fields`)}}x.filter&&!x.filter.spatialRelationship&&(x.filter.spatialRelationship=`intersects`);let E=m(x.filter,`histogram:invalid-parameters`);if(E)throw E;if(x.useQueryAttributeBins??=!0,!x.useQueryAttributeBins&&x.returnAggregateIds)throw new e(`histogram:invalid-parameters`,`'returnAggregateIds' cannot be true when 'useQueryAttributeBins' is false.`);return x}async function _(e){let{layerAdapter:t,...n}=await g(e);return t.histogram(n)}export{_ as default};
2
+ import e from"../../core/Error.js";import{isTimeOnlyField as t,numericTypes as n}from"../../layers/support/fieldUtils.js";import{defaultSupportedLayerTypes as r,binningCapableLayerTypes as i,createLayerAdapter as a,getLayerTypeLabels as o}from"../support/adapters/support/layerUtils.js";import{verifyBinningParams as s}from"../support/binningUtils.js";import{getNormalizationType as c,getFieldsList as l,isAnyDateField as u,dateTypes as d}from"../support/utils.js";import{verifyBasicFieldValidity as f,verifyFieldType as p,verifyFilterValidity as m}from"./support/utils.js";const h=[...d,`time-only`,...n];async function g(d){if(!(d?.layer&&(d.field||d.fields?.length||d.valueExpression||d.sqlExpression)))throw new e(`histogram:missing-parameters`,`'layer' and 'field', 'fields', 'valueExpression' or 'sqlExpression' parameters are required`);if(d.valueExpression&&!d.sqlExpression&&!d.view)throw new e(`histogram:missing-parameters`,`View is required when 'valueExpression' is specified`);d.forBinning&&s(d,`histogram`);let{layer:g,..._}=d,v=[...r,0,4,7],y=d.forBinning?i:v,b=a(g,y,d.forBinning);if(!b)throw new e(`histogram:invalid-parameters`,`'layer' must be one of these types: `+o(y).join(`, `));let x={layerAdapter:b,..._};x.normalizationType=c(x);let S=x.signal==null?null:{signal:x.signal};await b.load(S);let C=await l({field:x.field,normalizationField:x.normalizationField,valueExpression:x.valueExpression,fields:x.fields}),w=f(b,C,`histogram:invalid-parameters`);if(w)throw w;let T=!x.classificationMethod||x.classificationMethod===`equal-interval`;if(x.fields?.length){let t=x.fields;if(t.length<2)throw new e(`histogram:invalid-parameters`,`'fields' must contain at least 2 fields if specified.`);if(x.normalizationType||x.valueExpression||x.field)throw new e(`histogram:invalid-parameters`,`Normalization, 'field', 'valueExpression' are not allowed when 'fields' is specified.`);let r=new Set;for(let e of t){let t=b.getField(e),i=p(b,t,`histogram:invalid-parameters`,n);if(i)throw i;r.add(t.type)}if(r.size>1)throw new e(`histogram:invalid-parameters`,`All fields must be of the same type when 'fields' is specified.`);if(!T)throw new e(`histogram:invalid-parameters`,`'classificationMethod' other than 'equal-interval' is not allowed when 'fields' is specified`)}else if(x.valueExpression||x.sqlExpression){if(x.normalizationType)throw new e(`histogram:invalid-parameters`,`Normalization is not allowed when 'valueExpression' or 'sqlExpression' is specified`);if(!T)throw new e(`histogram:invalid-parameters`,`'classificationMethod' other than 'equal-interval' is not allowed when 'valueExpression' or 'sqlExpression' is specified`)}else if(x.field){let n=b.getField(x.field),r=p(b,n,`histogram:invalid-parameters`,h);if(r)throw r;if(u(n)||t(n)){if(x.normalizationType)throw new e(`histogram:invalid-parameters`,`Normalization is not allowed for date fields`);if(!T)throw new e(`histogram:invalid-parameters`,`'classificationMethod' other than 'equal-interval' is not allowed for date fields`)}}x.filter&&!x.filter.spatialRelationship&&(x.filter.spatialRelationship=`intersects`);let E=m(x.filter,`histogram:invalid-parameters`);if(E)throw E;if(x.useQueryAttributeBins??=!0,!x.useQueryAttributeBins&&x.returnStatisticsAggregatedIds)throw new e(`histogram:invalid-parameters`,`'returnStatisticsAggregatedIds' cannot be true when 'useQueryAttributeBins' is false.`);return x}async function _(e){let{layerAdapter:t,...n}=await g(e);return t.histogram(n)}export{_ as default};
@@ -13,6 +13,7 @@ import type { Feature as FeatureJSON } from "../../portal/jsonTypes.js";
13
13
  import type { ClassificationMethod, NormalizationType } from "../../renderers/types.js";
14
14
  import type { OutStatisticTypes } from "../../statistics/types.js";
15
15
  import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js";
16
+ import type { ObjectId } from "../../views/types.js";
16
17
  import type { SupportedLayer, SmartMappingTimeUnit } from "../types.js";
17
18
 
18
19
  /** The result returned from the [histogram()](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/statistics/histogram/#histogram) method. */
@@ -46,6 +47,15 @@ export interface HistogramBin {
46
47
  * contained between the indicated `minValue` and `maxValue`.
47
48
  */
48
49
  count: number;
50
+ /**
51
+ * The object IDs of the features contributing to this histogram bin. Returned by [histogram()](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/statistics/histogram/#histogram) when the
52
+ * [returnStatisticsAggregatedIds](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/statistics/types/#HistogramParameters-returnStatisticsAggregatedIds)
53
+ * parameter is `true`.
54
+ *
55
+ * @internal
56
+ * @since 6.0
57
+ */
58
+ statisticsAggregatedIds?: ObjectId[] | null;
49
59
  }
50
60
 
51
61
  export interface SummaryStatisticsParameters extends AbortOptions {
@@ -410,6 +420,14 @@ export interface HistogramParameters extends AbortOptions {
410
420
  * @since 4.23
411
421
  */
412
422
  useFeaturesInView?: boolean | null;
423
+ /**
424
+ * If `true`, includes the object IDs of the features contributing to each histogram bin in its
425
+ * [statisticsAggregatedIds](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/statistics/types/#HistogramBin-statisticsAggregatedIds) property.
426
+ *
427
+ * @since 6.0
428
+ * @internal
429
+ */
430
+ returnStatisticsAggregatedIds?: boolean | null;
413
431
  /**
414
432
  * A feature filter used to filter
415
433
  * statistic queries by geometry. This parameter is only used for filtering statistics by geometry. Any